diff --git a/package.json b/package.json index b5ee63e..d1d7bbc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tnsu/ui-kit", - "version": "0.10.0", + "version": "0.11.0", "description": "TNSU shared UI components for SPFx web parts", "author": "Timur Gorodetskiy", "license": "ISC", diff --git a/src/Alert/Alert.module.scss b/src/Alert/Alert.module.scss index 4cd4bda..f4ad266 100644 --- a/src/Alert/Alert.module.scss +++ b/src/Alert/Alert.module.scss @@ -28,3 +28,9 @@ color: $red-500; border-color: #fecaca; } + +.info { + background: $navy-50; + color: $navy-800; + border-color: $navy-100; +} diff --git a/src/Alert/Alert.tsx b/src/Alert/Alert.tsx index 9eaccc1..630426a 100644 --- a/src/Alert/Alert.tsx +++ b/src/Alert/Alert.tsx @@ -3,7 +3,7 @@ import styles from './Alert.module.scss'; import { Icon } from '../Icon/Icon'; import { IconName } from '../Icon/iconNames'; -type AlertVariant = 'warn' | 'ok' | 'err'; +type AlertVariant = 'warn' | 'ok' | 'err' | 'info'; interface IAlertProps { variant: AlertVariant; @@ -13,13 +13,15 @@ interface IAlertProps { const variantClass: Record = { warn: styles.warn, ok: styles.ok, - err: styles.err + err: styles.err, + info: styles.info }; const variantIcon: Record = { warn: 'warning', ok: 'check', - err: 'close' + err: 'close', + info: 'info' }; export const Alert: React.FC = ({ variant, children }) => { diff --git a/src/Icon/IconSprite.tsx b/src/Icon/IconSprite.tsx index 794508c..3c3e3f1 100644 --- a/src/Icon/IconSprite.tsx +++ b/src/Icon/IconSprite.tsx @@ -147,6 +147,10 @@ export const IconSprite: React.FC = () => ( + + + + diff --git a/src/Icon/iconNames.ts b/src/Icon/iconNames.ts index b0fc4c4..70dc11b 100644 --- a/src/Icon/iconNames.ts +++ b/src/Icon/iconNames.ts @@ -35,6 +35,7 @@ export const ICON_NAMES = [ 'search', 'menu', 'warning', + 'info', 'check', 'plus' ] as const; diff --git a/src/TextArea/TextArea.module.scss b/src/TextArea/TextArea.module.scss index fc7cd6d..9c05833 100644 --- a/src/TextArea/TextArea.module.scss +++ b/src/TextArea/TextArea.module.scss @@ -21,3 +21,17 @@ color: $gray-400; } } + +// Инлайн-ввод в ячейке таблицы: без рамки/фона, компактный, без ручного ресайза. +.borderless { + border-color: transparent; + background: transparent; + padding: 6px 8px; + min-height: 32px; + resize: none; + + &:focus { + background: $white; + border-color: $gold-500; + } +} diff --git a/src/TextArea/TextArea.tsx b/src/TextArea/TextArea.tsx index abdb5ee..37a78a0 100644 --- a/src/TextArea/TextArea.tsx +++ b/src/TextArea/TextArea.tsx @@ -10,20 +10,25 @@ interface ITextAreaProps { rows?: number; /** Только чтение (режим согласующего). */ readOnly?: boolean; + /** Без рамки/фона — для инлайн-ввода в ячейках таблиц. */ + borderless?: boolean; + /** a11y-подпись, когда видимого label нет. */ + ariaLabel?: string; } /** Многострочный ввод (SharePoint Note). */ -export const TextArea: React.FC = ({ id, value, onChange, placeholder, rows = 3, readOnly }) => { +export const TextArea: React.FC = ({ id, value, onChange, placeholder, rows = 3, readOnly, borderless, ariaLabel }) => { const contextReadOnly = useFormReadOnly(); const effectiveReadOnly = readOnly ?? contextReadOnly; return (