@atelier-ui/react 0.2.27 โ 0.2.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +78 -0
- package/package.json +1 -1
- package/src/lib/input/atl-input.d.ts.map +1 -1
- package/src/lib/input/atl-input.js +5 -1
- package/src/lib/input/atl-input.js.map +1 -1
- package/src/lib/select/atl-select.d.ts.map +1 -1
- package/src/lib/select/atl-select.js +6 -1
- package/src/lib/select/atl-select.js.map +1 -1
- package/src/lib/spec.d.ts +25 -3
- package/src/lib/spec.d.ts.map +1 -1
- package/src/lib/spec.js.map +1 -1
- package/src/lib/textarea/atl-textarea.d.ts.map +1 -1
- package/src/lib/textarea/atl-textarea.js +6 -2
- package/src/lib/textarea/atl-textarea.js.map +1 -1
- package/styles/tokens.css +17 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,81 @@
|
|
|
1
|
+
## 0.2.36 (2026-09-06)
|
|
2
|
+
|
|
3
|
+
This was a version bump only for react to align it with other projects, there were no code changes.
|
|
4
|
+
|
|
5
|
+
## 0.2.35 (2026-09-06)
|
|
6
|
+
|
|
7
|
+
### ๐ Features
|
|
8
|
+
|
|
9
|
+
- **storybook:** 10.6 and the first-party Angular framework ([137042d](https://github.com/DominikPieper/atelier-ui/commit/137042d))
|
|
10
|
+
|
|
11
|
+
### โค๏ธ Thank You
|
|
12
|
+
|
|
13
|
+
- Claude Opus 5 (1M context)
|
|
14
|
+
- Dominik Pieper @DominikPieper
|
|
15
|
+
|
|
16
|
+
## 0.2.34 (2026-09-05)
|
|
17
|
+
|
|
18
|
+
This was a version bump only for react to align it with other projects, there were no code changes.
|
|
19
|
+
|
|
20
|
+
## 0.2.33 (2026-09-05)
|
|
21
|
+
|
|
22
|
+
This was a version bump only for react to align it with other projects, there were no code changes.
|
|
23
|
+
|
|
24
|
+
## 0.2.32 (2026-09-05)
|
|
25
|
+
|
|
26
|
+
### ๐ Features
|
|
27
|
+
|
|
28
|
+
- **spec:** a caption three adapters shipped and the contract never had ([a8ab0d2](https://github.com/DominikPieper/atelier-ui/commit/a8ab0d2))
|
|
29
|
+
|
|
30
|
+
### โค๏ธ Thank You
|
|
31
|
+
|
|
32
|
+
- Claude Opus 5 (1M context)
|
|
33
|
+
- Dominik Pieper @DominikPieper
|
|
34
|
+
|
|
35
|
+
## 0.2.31 (2026-08-29)
|
|
36
|
+
|
|
37
|
+
### ๐ Features
|
|
38
|
+
|
|
39
|
+
- **gates:** typecheck the specs and stories, and pay the 146 errors nobody could see ([6a8ac9f](https://github.com/DominikPieper/atelier-ui/commit/6a8ac9f))
|
|
40
|
+
|
|
41
|
+
### โค๏ธ Thank You
|
|
42
|
+
|
|
43
|
+
- Claude Opus 5 (1M context)
|
|
44
|
+
- Dominik Pieper @DominikPieper
|
|
45
|
+
|
|
46
|
+
## 0.2.30 (2026-08-29)
|
|
47
|
+
|
|
48
|
+
### ๐ Features
|
|
49
|
+
|
|
50
|
+
- **tokens:** decide the counting rule, then mint the two roles it earns ([93323ec](https://github.com/DominikPieper/atelier-ui/commit/93323ec))
|
|
51
|
+
|
|
52
|
+
### โค๏ธ Thank You
|
|
53
|
+
|
|
54
|
+
- Claude Opus 5 (1M context)
|
|
55
|
+
- Dominik Pieper @DominikPieper
|
|
56
|
+
|
|
57
|
+
## 0.2.29 (2026-08-29)
|
|
58
|
+
|
|
59
|
+
### ๐ฉน Fixes
|
|
60
|
+
|
|
61
|
+
- **schulung:** close the minors, and settle whether ADR-0083 was a workaround for a typo ([688347e](https://github.com/DominikPieper/atelier-ui/commit/688347e))
|
|
62
|
+
|
|
63
|
+
### โค๏ธ Thank You
|
|
64
|
+
|
|
65
|
+
- Claude Opus 5 (1M context)
|
|
66
|
+
- Dominik Pieper @DominikPieper
|
|
67
|
+
|
|
68
|
+
## 0.2.28 (2026-08-29)
|
|
69
|
+
|
|
70
|
+
### ๐ฉน Fixes
|
|
71
|
+
|
|
72
|
+
- **schulung:** the fifteen majors, and a props claim that was too generous ([9de43bf](https://github.com/DominikPieper/atelier-ui/commit/9de43bf))
|
|
73
|
+
|
|
74
|
+
### โค๏ธ Thank You
|
|
75
|
+
|
|
76
|
+
- Claude Opus 5 (1M context)
|
|
77
|
+
- Dominik Pieper @DominikPieper
|
|
78
|
+
|
|
1
79
|
## 0.2.27 (2026-08-29)
|
|
2
80
|
|
|
3
81
|
This was a version bump only for react to align it with other projects, there were no code changes.
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atl-input.d.ts","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/input/atl-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"atl-input.d.ts","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/input/atl-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAS,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,iBAAiB,CAAC;AAGzB;;GAEG;AACH,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC,EACtE,YAAY;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,GAAG,KAAK,GAAG,KAAK,CAAC;IAChE;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,EACvB,IAAa,EACb,KAAK,EACL,QAAQ,EACR,aAAa,EACb,OAAe,EACf,MAAW,EACX,QAAgB,EAChB,QAAQ,EAAE,aAAa,EACvB,QAAQ,EAAE,YAAY,EACtB,QAAgB,EAChB,KAAK,EACL,SAAS,EACT,EAAE,EACF,GAAG,IAAI,EACR,EAAE,aAAa,+BAqDf"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from 'react';
|
|
2
3
|
import './atl-input.css';
|
|
3
4
|
import { AtlIcon } from '../icon/atl-icon';
|
|
4
5
|
/**
|
|
@@ -6,7 +7,10 @@ import { AtlIcon } from '../icon/atl-icon';
|
|
|
6
7
|
*/
|
|
7
8
|
export function AtlInput({ type = 'text', value, onChange, onValueChange, invalid = false, errors = [], disabled = false, readOnly: reactReadOnly, readonly: specReadOnly, required = false, label, className, id, ...rest }) {
|
|
8
9
|
const readOnly = reactReadOnly ?? specReadOnly ?? false;
|
|
9
|
-
|
|
10
|
+
// useId(), not a slug derived from the label text: two inputs with the same
|
|
11
|
+
// label used to collide on one id and break the for/id association.
|
|
12
|
+
const generatedId = useId();
|
|
13
|
+
const inputId = id || (label ? `input-${generatedId}` : undefined);
|
|
10
14
|
const classes = [
|
|
11
15
|
'atl-input',
|
|
12
16
|
invalid && 'is-invalid',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atl-input.js","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/input/atl-input.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"atl-input.js","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/input/atl-input.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAuB,KAAK,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,iBAAiB,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;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ACZ,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,kBACJ,OAAO,IAAI,SAAS,mBACnB,QAAQ,IAAI,SAAS,sBAClB,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,KACrD,IAAI,GACR,EACD,OAAO,IAAI,KAAC,OAAO,IAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,cAAc,GAAG,IACpE,EACL,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CACpB,cAAK,SAAS,EAAC,QAAQ,EAAC,EAAE,EAAE,OAAO,eAAY,QAAQ,YACpD,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,YAAW,SAAS,EAAC,eAAe,YACjC,GAAG,IADE,CAAC,CAEL,CACL,CAAC,GACE,CACP,IACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { InputHTMLAttributes, useId } from 'react';\nimport type { AtlInputSpec } from '../spec';\nimport './atl-input.css';\nimport { AtlIcon } from '../icon/atl-icon';\n\n/**\n * Properties for the AtlInput component.\n */\nexport interface AtlInputProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'readOnly'>,\n AtlInputSpec {\n /**\n * The type of input to render.\n */\n type?: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url';\n /**\n * The current value of the input.\n */\n value?: string;\n /**\n * Callback triggered when the value changes.\n */\n onValueChange?: (value: string) => void;\n /**\n * Whether the input is in an invalid state.\n */\n invalid?: boolean;\n /**\n * Array of error messages to display.\n */\n errors?: string[];\n /**\n * The label for the input.\n */\n label?: string;\n /**\n * Whether the input is read-only.\n */\n readOnly?: boolean;\n}\n\n/**\n * A versatile input component for text entry.\n */\nexport function AtlInput({\n type = 'text',\n value,\n onChange,\n onValueChange,\n invalid = false,\n errors = [],\n disabled = false,\n readOnly: reactReadOnly,\n readonly: specReadOnly,\n required = false,\n label,\n className,\n id,\n ...rest\n}: AtlInputProps) {\n const readOnly = reactReadOnly ?? specReadOnly ?? false;\n // useId(), not a slug derived from the label text: two inputs with the same\n // label used to collide on one id and break the for/id association.\n const generatedId = useId();\n const inputId = id || (label ? `input-${generatedId}` : undefined);\n const classes = [\n 'atl-input',\n invalid && 'is-invalid',\n disabled && 'is-disabled',\n readOnly && 'is-readonly',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange?.(e);\n onValueChange?.(e.target.value);\n };\n\n const errorId = inputId ? `${inputId}-errors` : undefined;\n\n return (\n <div className={classes}>\n {label && <label htmlFor={inputId}>{label}</label>}\n <div className=\"input-field\">\n <input\n id={inputId}\n type={type}\n value={value}\n onChange={handleChange}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n aria-invalid={invalid || undefined}\n aria-required={required || undefined}\n aria-describedby={errors.length > 0 ? errorId : undefined}\n {...rest}\n />\n {invalid && <AtlIcon name=\"danger\" size=\"sm\" className=\"invalid-icon\" />}\n </div>\n {errors.length > 0 && (\n <div className=\"errors\" id={errorId} aria-live=\"polite\">\n {errors.map((err, i) => (\n <p key={i} className=\"error-message\">\n {err}\n </p>\n ))}\n </div>\n )}\n </div>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atl-select.d.ts","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/select/atl-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"atl-select.d.ts","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/select/atl-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,oBAAoB,EAAS,MAAM,OAAO,CAAC;AACrF,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACd,MAAM,SAAS,CAAC;AACjB,OAAO,kBAAkB,CAAC;AAG1B;;GAEG;AACH,MAAM,WAAW,cACf,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,EACzE,aAAa;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAU,EACV,aAAa,EACb,WAAW,EACX,OAAe,EACf,MAAW,EACX,QAAgB,EAChB,QAAgB,EAChB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,EAAE,EACF,GAAG,IAAI,EACR,EAAE,cAAc,+BAuDhB;AAED;;GAEG;AACH,MAAM,WAAW,cACf,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC,EAC7C,aAAa;IACf;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,cAAc,+BAM3E"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from 'react';
|
|
2
3
|
import './atl-select.css';
|
|
3
4
|
import { AtlIcon } from '../icon/atl-icon';
|
|
4
5
|
/**
|
|
5
6
|
* A select component for choosing an option from a list.
|
|
6
7
|
*/
|
|
7
8
|
export function AtlSelect({ value = '', onValueChange, placeholder, invalid = false, errors = [], disabled = false, required = false, label, children, className, id, ...rest }) {
|
|
8
|
-
|
|
9
|
+
// useId(), not a slug derived from the label text: two selects with the
|
|
10
|
+
// same label used to collide on one id and break the for/id association
|
|
11
|
+
// (same bug as AtlInput's โ see ADR-0091).
|
|
12
|
+
const generatedId = useId();
|
|
13
|
+
const selectId = id || (label ? `select-${generatedId}` : undefined);
|
|
9
14
|
// Derived from the field id, the same way AtlInput derives its own, so the error
|
|
10
15
|
// text can be pointed at with aria-describedby.
|
|
11
16
|
const errorsId = selectId ? `${selectId}-errors` : undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atl-select.js","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/select/atl-select.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"atl-select.js","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/select/atl-select.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAyD,KAAK,EAAE,MAAM,OAAO,CAAC;AAKrF,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAkC3C;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,EACxB,KAAK,GAAG,EAAE,EACV,aAAa,EACb,WAAW,EACX,OAAO,GAAG,KAAK,EACf,MAAM,GAAG,EAAE,EACX,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,EAChB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,EAAE,EACF,GAAG,IAAI,EACQ;IACf,wEAAwE;IACxE,wEAAwE;IACxE,2CAA2C;IAC3C,MAAM,WAAW,GAAG,KAAK,EAAE,CAAC;IAC5B,MAAM,QAAQ,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACr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MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,YAAW,SAAS,EAAC,eAAe,YACjC,GAAG,IADE,CAAC,CAEL,CACL,CAAC,GACE,CACP,IACG,CACP,CAAC;AACJ,CAAC;AAkBD;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAkB;IAC1E,OAAO,CACL,iBAAQ,KAAK,EAAE,WAAW,KAAM,IAAI,YACjC,QAAQ,GACF,CACV,CAAC;AACJ,CAAC","sourcesContent":["import { ReactNode, SelectHTMLAttributes, OptionHTMLAttributes, useId } from 'react';\nimport type {\n AtlSelectSpec,\n AtlOptionSpec,\n} from '../spec';\nimport './atl-select.css';\nimport { AtlIcon } from '../icon/atl-icon';\n\n/**\n * Properties for the AtlSelect component.\n */\nexport interface AtlSelectProps\n extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'value' | 'onChange'>,\n AtlSelectSpec {\n /**\n * The current value of the select.\n */\n value?: string;\n /**\n * Callback triggered when the value changes.\n */\n onValueChange?: (value: string) => void;\n /**\n * Placeholder text to display when no value is selected.\n */\n placeholder?: string;\n /**\n * Whether the select is in an invalid state.\n */\n invalid?: boolean;\n /**\n * Array of error messages to display.\n */\n errors?: string[];\n /**\n * The label for the select.\n */\n label?: string;\n}\n\n/**\n * A select component for choosing an option from a list.\n */\nexport function AtlSelect({\n value = '',\n onValueChange,\n placeholder,\n invalid = false,\n errors = [],\n disabled = false,\n required = false,\n label,\n children,\n className,\n id,\n ...rest\n}: AtlSelectProps) {\n // useId(), not a slug derived from the label text: two selects with the\n // same label used to collide on one id and break the for/id association\n // (same bug as AtlInput's โ see ADR-0091).\n const generatedId = useId();\n const selectId = id || (label ? `select-${generatedId}` : undefined);\n // Derived from the field id, the same way AtlInput derives its own, so the error\n // text can be pointed at with aria-describedby.\n const errorsId = selectId ? `${selectId}-errors` : undefined;\n const classes = [\n 'atl-select',\n invalid && 'is-invalid',\n disabled && 'is-disabled',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <div className={classes}>\n {label && <label htmlFor={selectId}>{label}</label>}\n <div className=\"select-wrapper\">\n <select\n id={selectId}\n value={value}\n onChange={(e) => onValueChange?.(e.target.value)}\n disabled={disabled}\n required={required}\n aria-invalid={invalid || undefined}\n aria-describedby={errors.length > 0 ? errorsId : undefined}\n {...rest}\n >\n {placeholder && (\n <option value=\"\" disabled hidden>\n {placeholder}\n </option>\n )}\n {children}\n </select>\n {invalid && <AtlIcon name=\"danger\" size=\"sm\" className=\"invalid-icon\" />}\n <span className=\"select-arrow\" aria-hidden=\"true\">\n <AtlIcon name=\"chevron-down\" size=\"sm\" />\n </span>\n </div>\n {errors.length > 0 && (\n <div className=\"errors\" id={errorsId} aria-live=\"polite\">\n {errors.map((err, i) => (\n <p key={i} className=\"error-message\">\n {err}\n </p>\n ))}\n </div>\n )}\n </div>\n );\n}\n\n/**\n * Properties for the AtlOption component.\n */\nexport interface AtlOptionProps\n extends OptionHTMLAttributes<HTMLOptionElement>,\n AtlOptionSpec {\n /**\n * The value of the option.\n */\n optionValue: string;\n /**\n * The content to be rendered inside the option.\n */\n children?: ReactNode;\n}\n\n/**\n * An individual option component for use within AtlSelect.\n */\nexport function AtlOption({ optionValue, children, ...rest }: AtlOptionProps) {\n return (\n <option value={optionValue} {...rest}>\n {children}\n </option>\n );\n}\n"]}
|
package/src/lib/spec.d.ts
CHANGED
|
@@ -94,12 +94,34 @@ export interface AtlFormFieldSpec {
|
|
|
94
94
|
export interface AtlReadonlySpec {
|
|
95
95
|
readonly?: boolean;
|
|
96
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Visible caption rendered as a `<label>` associated with the control via
|
|
99
|
+
* `for`/`id`. When omitted, the control renders with no visible caption โ
|
|
100
|
+
* supply an external `<label>` or an `aria-label` at the call site in that
|
|
101
|
+
* case, or the control has no accessible name.
|
|
102
|
+
*
|
|
103
|
+
* Deliberately NOT merged into `AtlFormFieldSpec`. Two of that mixin's
|
|
104
|
+
* consumers project their caption as CONTENT rather than a string prop โ
|
|
105
|
+
* `AtlCheckboxSpec`/`AtlToggleSpec` take it as `children`/`<ng-content>`/
|
|
106
|
+
* `<slot>` โ so inheriting `label` there would be a second, unused, and
|
|
107
|
+
* actively misleading way to say the same thing. Two more,
|
|
108
|
+
* `AtlRadioGroupSpec` and `AtlComboboxSpec`, have no caption prop in any
|
|
109
|
+
* adapter today, so applying it there would be speculative. Applied only
|
|
110
|
+
* where a `label` prop actually exists in at least one adapter today โ
|
|
111
|
+
* `AtlInputSpec`, `AtlTextareaSpec`, `AtlSelectSpec` โ three occurrences,
|
|
112
|
+
* which is what justifies pulling it out as its own mixin instead of leaving
|
|
113
|
+
* it three separate, easy-to-let-drift declarations (see ADR-0091, which
|
|
114
|
+
* also documents the one-off reading this mixin corrects).
|
|
115
|
+
*/
|
|
116
|
+
export interface AtlCaptionSpec {
|
|
117
|
+
label?: string;
|
|
118
|
+
}
|
|
97
119
|
export type AtlInputType = 'text' | 'email' | 'password' | 'number' | 'tel' | 'url';
|
|
98
|
-
export interface AtlInputSpec extends AtlFormFieldSpec, AtlReadonlySpec {
|
|
120
|
+
export interface AtlInputSpec extends AtlFormFieldSpec, AtlReadonlySpec, AtlCaptionSpec {
|
|
99
121
|
type?: AtlInputType;
|
|
100
122
|
placeholder?: string;
|
|
101
123
|
}
|
|
102
|
-
export interface AtlTextareaSpec extends AtlFormFieldSpec, AtlReadonlySpec {
|
|
124
|
+
export interface AtlTextareaSpec extends AtlFormFieldSpec, AtlReadonlySpec, AtlCaptionSpec {
|
|
103
125
|
rows?: number;
|
|
104
126
|
placeholder?: string;
|
|
105
127
|
autoResize?: boolean;
|
|
@@ -120,7 +142,7 @@ export interface AtlRadioSpec {
|
|
|
120
142
|
export interface AtlRadioGroupSpec extends AtlFormFieldSpec, AtlReadonlySpec {
|
|
121
143
|
value?: string;
|
|
122
144
|
}
|
|
123
|
-
export interface AtlSelectSpec extends AtlFormFieldSpec {
|
|
145
|
+
export interface AtlSelectSpec extends AtlFormFieldSpec, AtlCaptionSpec {
|
|
124
146
|
placeholder?: string;
|
|
125
147
|
}
|
|
126
148
|
export interface AtlOptionSpec {
|
package/src/lib/spec.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../../../../../libs/react/src/lib/spec.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAKH,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAC;AAC9E,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC/C,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAKD,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;AACpF,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,CAAC;AACvC,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,IAAI,CAAC,EAAE,YAAY,CAAC;CACrB;AAKD,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC7D,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,QAAQ,CAAC;AACjD,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC;AAC1E,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,E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,eAAe,GACf,qBAAqB,GACrB,sBAAsB,GACtB,UAAU,GACV,WAAW,GACX,aAAa,GACb,YAAY,GACZ,MAAM,GACN,OAAO,GACP,KAAK,GACL,MAAM,GACN,QAAQ,GACR,OAAO,GACP,MAAM,GACN,QAAQ,GACR,eAAe,CAAC;AACpB,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC7C,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAKD,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;AAC3D,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,WAAW,GAAG,OAAO,CAAC;AAC3D,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEjE,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,kBAAkB,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB"}
|
package/src/lib/spec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../../../../../libs/react/src/lib/spec.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,4EAA4E;AAC5E,qEAAqE","sourcesContent":["// AUTO-GENERATED from libs/spec/src/index.ts โ do not edit here.\n// Run `node tools/scripts/sync-spec.mjs` after editing the source of truth.\n// The framework libs inline this so @atelier-ui/spec stays internal.\n\n/**\n * @atelier-ui/spec\n *\n * Framework-agnostic TypeScript interfaces defining the public API contract\n * for every Atelier component. Both the Angular and React libraries\n * import from here so the compiler enforces parity.\n *\n * Angular: use the union types as `input<T>()` type parameters.\n * React: extend the spec interface from the framework-specific props interface.\n */\n\n// ---------------------------------------------------------------------------\n// Button\n// ---------------------------------------------------------------------------\nexport type AtlButtonVariant = 'primary' | 'secondary' | 'outline' | 'danger';\nexport type AtlButtonSize = 'sm' | 'md' | 'lg';\nexport interface AtlButtonSpec {\n variant?: AtlButtonVariant;\n size?: AtlButtonSize;\n disabled?: boolean;\n loading?: boolean;\n /**\n * Accessible name โ rendered as `aria-label`. Required when the\n * button has no visible text label (icon-only buttons), otherwise\n * the button is unnamed for assistive tech. The React adapter\n * encodes this requirement at the type level via a discriminated\n * union; the Angular and Vue adapters log a dev-mode warning when\n * a rendered button has no accessible name.\n */\n 'aria-label'?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Badge\n// ---------------------------------------------------------------------------\nexport type AtlBadgeVariant = 'default' | 'success' | 'warning' | 'danger' | 'info';\nexport type AtlBadgeSize = 'sm' | 'md';\nexport interface AtlBadgeSpec {\n variant?: AtlBadgeVariant;\n size?: AtlBadgeSize;\n}\n\n// ---------------------------------------------------------------------------\n// Avatar / AvatarGroup\n// ---------------------------------------------------------------------------\nexport type AtlAvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\nexport type AtlAvatarShape = 'circle' | 'square';\nexport type AtlAvatarStatus = 'online' | 'offline' | 'away' | 'busy' | '';\nexport interface AtlAvatarSpec {\n src?: string;\n alt?: string;\n name?: string;\n size?: AtlAvatarSize;\n shape?: AtlAvatarShape;\n status?: AtlAvatarStatus;\n}\nexport interface AtlAvatarGroupSpec {\n max?: number;\n size?: AtlAvatarSize;\n}\n\n// ---------------------------------------------------------------------------\n// Card\n// ---------------------------------------------------------------------------\nexport type AtlCardVariant = 'elevated' | 'outlined' | 'flat';\nexport type AtlCardPadding = 'none' | 'sm' | 'md' | 'lg';\n/**\n * Optional landmark role for the card. Default behaviour is a plain\n * `<div>` โ most cards group content visually and shouldn't add a\n * landmark to the page outline.\n *\n * Pick a role only when the card is meaningful as a landmark:\n * - `'article'` for self-contained pieces of content (a blog post,\n * a comment, a forum entry) that make sense out of context.\n * - `'region'` for a perceivable area that needs a screen-reader\n * stop. Pair with `aria-label` or `aria-labelledby`.\n * - `'section'` is not a landmark by itself โ equivalent to a\n * `<section>` element. Useful when nesting structure matters.\n */\nexport type AtlCardRole = 'article' | 'region' | 'section';\nexport interface AtlCardSpec {\n variant?: AtlCardVariant;\n padding?: AtlCardPadding;\n /**\n * Opt-in landmark role. Default is no role (plain `<div>`).\n * See {@link AtlCardRole} for when to use each value.\n */\n role?: AtlCardRole;\n}\n\n// ---------------------------------------------------------------------------\n// Input / Textarea (shared form field props)\n// ---------------------------------------------------------------------------\n// `any` is intentional here: downstream form-field interfaces narrow `value`\n// to the concrete primitive they accept (string, number, boolean, Date, โฆ).\n// Using `unknown` would force every downstream consumer to redeclare the\n// property, defeating the purpose of the shared spec.\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport interface AtlFormFieldSpec {\n value?: any;\n onValueChange?: (value: any) => void;\n disabled?: boolean;\n invalid?: boolean;\n required?: boolean;\n name?: string;\n}\n\n/**\n * `readonly` โ the value is shown and submitted, but the user cannot change it.\n *\n * Deliberately NOT part of `AtlFormFieldSpec`. It used to be, and the four choice\n * controls that inherited it could not keep the promise: HTML ignores `readonly`\n * on `<input type=\"checkbox\">` and `<input type=\"radio\">`, and\n * `HTMLSelectElement` has no `readOnly` property at all โ measured, the user\n * still flipped the control and `onCheckedChange` still fired. A prop that\n * silently does nothing is worse than an absent one, so this mixin is applied\n * only where the state is actually enforced: natively by the text fields, and by\n * an explicit guard in AtlCombobox and AtlRadioGroup. See ADR-0045.\n */\nexport interface AtlReadonlySpec {\n readonly?: boolean;\n}\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\nexport type AtlInputType = 'text' | 'email' | 'password' | 'number' | 'tel' | 'url';\nexport interface AtlInputSpec extends AtlFormFieldSpec, AtlReadonlySpec {\n type?: AtlInputType;\n placeholder?: string;\n}\n\nexport interface AtlTextareaSpec extends AtlFormFieldSpec, AtlReadonlySpec {\n rows?: number;\n placeholder?: string;\n autoResize?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Checkbox / Toggle\n// ---------------------------------------------------------------------------\n// Checkbox/Toggle are checked-based, not value-based, so they omit the\n// inherited `value`/`onValueChange` โ their state is `checked`/`onCheckedChange`.\n// (Input/Textarea/RadioGroup/Select/Combobox keep the value-based pair.)\nexport interface AtlCheckboxSpec extends Omit<AtlFormFieldSpec, 'value' | 'onValueChange'> {\n checked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n indeterminate?: boolean;\n}\n\nexport interface AtlToggleSpec extends Omit<AtlFormFieldSpec, 'value' | 'onValueChange'> {\n checked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n}\n\n// ---------------------------------------------------------------------------\n// Radio / RadioGroup\n// ---------------------------------------------------------------------------\nexport interface AtlRadioSpec {\n radioValue: string;\n disabled?: boolean;\n}\n\nexport interface AtlRadioGroupSpec extends AtlFormFieldSpec, AtlReadonlySpec {\n value?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Select / Option\n// ---------------------------------------------------------------------------\nexport interface AtlSelectSpec extends AtlFormFieldSpec {\n placeholder?: string;\n}\n\nexport interface AtlOptionSpec {\n optionValue: string;\n disabled?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Stepper\n// ---------------------------------------------------------------------------\nexport interface AtlStepperSpec {\n activeStep?: number;\n orientation?: 'horizontal' | 'vertical';\n linear?: boolean;\n}\n\nexport interface AtlStepSpec {\n label: string;\n description?: string;\n completed?: boolean;\n error?: boolean;\n optional?: boolean;\n disabled?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Combobox\n// ---------------------------------------------------------------------------\nexport interface AtlComboboxOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\nexport interface AtlComboboxSpec extends AtlFormFieldSpec, AtlReadonlySpec {\n options?: AtlComboboxOption[];\n placeholder?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Alert\n// ---------------------------------------------------------------------------\nexport type AtlAlertVariant = 'info' | 'success' | 'warning' | 'danger';\nexport interface AtlAlertSpec {\n variant?: AtlAlertVariant;\n dismissible?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Dialog\n// ---------------------------------------------------------------------------\nexport type AtlDialogSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';\nexport interface AtlDialogSpec {\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n closeOnBackdrop?: boolean;\n size?: AtlDialogSize;\n}\n\n// ---------------------------------------------------------------------------\n// TabGroup / Tab\n// ---------------------------------------------------------------------------\nexport type AtlTabGroupVariant = 'default' | 'pills';\nexport interface AtlTabGroupSpec {\n selectedIndex?: number;\n onSelectedIndexChange?: (index: number) => void;\n variant?: AtlTabGroupVariant;\n}\n\nexport interface AtlTabSpec {\n label: string;\n disabled?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// AccordionGroup / AccordionItem\n// ---------------------------------------------------------------------------\nexport type AtlAccordionGroupVariant = 'default' | 'bordered' | 'separated';\nexport interface AtlAccordionGroupSpec {\n multi?: boolean;\n variant?: AtlAccordionGroupVariant;\n}\n\nexport type AtlAccordionHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\nexport interface AtlAccordionItemSpec {\n expanded?: boolean;\n onExpandedChange?: (expanded: boolean) => void;\n disabled?: boolean;\n /**\n * HTML heading level wrapping the trigger button. Default `3`.\n * Set this to match your page's heading outline so the\n * accordion's section titles don't break heading order.\n * Example: if the accordion is nested under an `<h2>`, pass\n * `headingLevel={3}` (default); if nested under an `<h3>`, pass\n * `headingLevel={4}`.\n */\n headingLevel?: AtlAccordionHeadingLevel;\n}\n\n// ---------------------------------------------------------------------------\n// Menu / MenuItem\n// ---------------------------------------------------------------------------\nexport type AtlMenuVariant = 'default' | 'compact';\nexport interface AtlMenuSpec {\n variant?: AtlMenuVariant;\n}\n\nexport interface AtlMenuItemSpec {\n disabled?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Tooltip\n// ---------------------------------------------------------------------------\nexport type AtlTooltipPosition = 'above' | 'below' | 'left' | 'right';\nexport interface AtlTooltipSpec {\n atlTooltip: string;\n atlTooltipPosition?: AtlTooltipPosition;\n atlTooltipDisabled?: boolean;\n atlTooltipShowDelay?: number;\n atlTooltipHideDelay?: number;\n}\n\n// ---------------------------------------------------------------------------\n// Toast\n// ---------------------------------------------------------------------------\nexport type AtlToastVariant = 'default' | 'success' | 'warning' | 'danger' | 'info';\nexport type AtlToastContainerPosition =\n | 'top-right'\n | 'top-center'\n | 'bottom-right'\n | 'bottom-center';\nexport interface AtlToastOptions {\n variant?: AtlToastVariant;\n duration?: number;\n dismissible?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Skeleton\n// ---------------------------------------------------------------------------\nexport type AtlSkeletonVariant = 'text' | 'circular' | 'rectangular';\nexport interface AtlSkeletonSpec {\n variant?: AtlSkeletonVariant;\n width?: string;\n height?: string;\n animated?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Breadcrumbs / BreadcrumbItem\n// ---------------------------------------------------------------------------\nexport interface AtlBreadcrumbsSpec {\n separator?: string;\n}\n\nexport interface AtlBreadcrumbItemSpec {\n href?: string;\n current?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Pagination\n// ---------------------------------------------------------------------------\nexport interface AtlPaginationSpec {\n page?: number;\n pageCount?: number;\n siblingCount?: number;\n showFirstLast?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Progress\n// ---------------------------------------------------------------------------\nexport type AtlProgressVariant = 'default' | 'success' | 'warning' | 'danger';\nexport type AtlProgressSize = 'sm' | 'md' | 'lg';\nexport interface AtlProgressSpec {\n value?: number;\n max?: number;\n variant?: AtlProgressVariant;\n size?: AtlProgressSize;\n indeterminate?: boolean;\n /**\n * Accessible name for the progress bar โ rendered as `aria-label`.\n * Required by ARIA when there is no visible label nearby; without it\n * screen readers announce only \"progress bar 47%\". Examples:\n * `\"Upload progress\"`, `\"Form completion\"`, `\"Quota usage\"`.\n */\n label?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Drawer\n// ---------------------------------------------------------------------------\nexport type AtlDrawerPosition = 'left' | 'right' | 'top' | 'bottom';\nexport type AtlDrawerSize = 'sm' | 'md' | 'lg' | 'full';\nexport interface AtlDrawerSpec {\n open?: boolean;\n position?: AtlDrawerPosition;\n size?: AtlDrawerSize;\n closeOnBackdrop?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Table\n// ---------------------------------------------------------------------------\nexport type AtlTableVariant = 'default' | 'striped' | 'bordered';\nexport type AtlTableSize = 'sm' | 'md' | 'lg';\nexport type AtlSortDirection = 'asc' | 'desc' | null;\nexport type AtlTableAlign = 'start' | 'center' | 'end';\n\nexport interface AtlTableSpec {\n variant?: AtlTableVariant;\n size?: AtlTableSize;\n stickyHeader?: boolean;\n /**\n * Accessible name for the scrollable table region. The wrapper\n * around the `<table>` is keyboard-focusable (tabindex=0) so that\n * users can scroll horizontally; this label is what screen readers\n * announce when focus enters the region. Defaults to `\"Table\"`.\n */\n 'aria-label'?: string;\n}\n\nexport interface AtlTbodySpec {\n empty?: boolean;\n colSpan?: number;\n}\n\nexport interface AtlTrSpec {\n selected?: boolean;\n selectable?: boolean;\n rowId?: string;\n}\n\nexport interface AtlThSpec {\n sortable?: boolean;\n sortDirection?: AtlSortDirection;\n align?: AtlTableAlign;\n width?: string;\n}\n\nexport interface AtlTdSpec {\n align?: AtlTableAlign;\n}\n\n// ---------------------------------------------------------------------------\n// Icon\n// ---------------------------------------------------------------------------\nexport type AtlIconName =\n | 'success'\n | 'check'\n | 'warning'\n | 'danger'\n | 'info'\n | 'error'\n | 'chevron-up'\n | 'chevron-down'\n | 'chevron-left'\n | 'chevron-right'\n | 'chevron-double-left'\n | 'chevron-double-right'\n | 'sort-asc'\n | 'sort-desc'\n | 'arrow-right'\n | 'arrow-left'\n | 'copy'\n | 'paste'\n | 'add'\n | 'edit'\n | 'delete'\n | 'close'\n | 'more'\n | 'person'\n | 'default-toast';\nexport type AtlIconSize = 'sm' | 'md' | 'lg';\nexport interface AtlIconSpec {\n name: AtlIconName;\n size?: AtlIconSize;\n /**\n * Accessible label. When provided, the icon is announced as an image with\n * this label. When omitted, the icon is hidden from assistive tech (treated\n * as decorative).\n */\n label?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Chat (AI surface)\n// ---------------------------------------------------------------------------\nexport type AtlChatVariant = 'drawer' | 'popup' | 'inline';\nexport type AtlChatStatus = 'idle' | 'streaming' | 'error';\nexport type AtlChatMessageRole = 'user' | 'assistant' | 'system';\n\nexport interface AtlChatMessageSpec {\n id: string;\n role: AtlChatMessageRole;\n content: string;\n failed?: boolean;\n}\n\nexport interface AtlChatSuggestionSpec {\n id: string;\n label: string;\n hint?: string;\n}\n\nexport interface AtlChatSpec {\n variant?: AtlChatVariant;\n status?: AtlChatStatus;\n open?: boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../../../../../libs/react/src/lib/spec.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,4EAA4E;AAC5E,qEAAqE","sourcesContent":["// AUTO-GENERATED from libs/spec/src/index.ts โ do not edit here.\n// Run `node tools/scripts/sync-spec.mjs` after editing the source of truth.\n// The framework libs inline this so @atelier-ui/spec stays internal.\n\n/**\n * @atelier-ui/spec\n *\n * Framework-agnostic TypeScript interfaces defining the public API contract\n * for every Atelier component. Both the Angular and React libraries\n * import from here so the compiler enforces parity.\n *\n * Angular: use the union types as `input<T>()` type parameters.\n * React: extend the spec interface from the framework-specific props interface.\n */\n\n// ---------------------------------------------------------------------------\n// Button\n// ---------------------------------------------------------------------------\nexport type AtlButtonVariant = 'primary' | 'secondary' | 'outline' | 'danger';\nexport type AtlButtonSize = 'sm' | 'md' | 'lg';\nexport interface AtlButtonSpec {\n variant?: AtlButtonVariant;\n size?: AtlButtonSize;\n disabled?: boolean;\n loading?: boolean;\n /**\n * Accessible name โ rendered as `aria-label`. Required when the\n * button has no visible text label (icon-only buttons), otherwise\n * the button is unnamed for assistive tech. The React adapter\n * encodes this requirement at the type level via a discriminated\n * union; the Angular and Vue adapters log a dev-mode warning when\n * a rendered button has no accessible name.\n */\n 'aria-label'?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Badge\n// ---------------------------------------------------------------------------\nexport type AtlBadgeVariant = 'default' | 'success' | 'warning' | 'danger' | 'info';\nexport type AtlBadgeSize = 'sm' | 'md';\nexport interface AtlBadgeSpec {\n variant?: AtlBadgeVariant;\n size?: AtlBadgeSize;\n}\n\n// ---------------------------------------------------------------------------\n// Avatar / AvatarGroup\n// ---------------------------------------------------------------------------\nexport type AtlAvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\nexport type AtlAvatarShape = 'circle' | 'square';\nexport type AtlAvatarStatus = 'online' | 'offline' | 'away' | 'busy' | '';\nexport interface AtlAvatarSpec {\n src?: string;\n alt?: string;\n name?: string;\n size?: AtlAvatarSize;\n shape?: AtlAvatarShape;\n status?: AtlAvatarStatus;\n}\nexport interface AtlAvatarGroupSpec {\n max?: number;\n size?: AtlAvatarSize;\n}\n\n// ---------------------------------------------------------------------------\n// Card\n// ---------------------------------------------------------------------------\nexport type AtlCardVariant = 'elevated' | 'outlined' | 'flat';\nexport type AtlCardPadding = 'none' | 'sm' | 'md' | 'lg';\n/**\n * Optional landmark role for the card. Default behaviour is a plain\n * `<div>` โ most cards group content visually and shouldn't add a\n * landmark to the page outline.\n *\n * Pick a role only when the card is meaningful as a landmark:\n * - `'article'` for self-contained pieces of content (a blog post,\n * a comment, a forum entry) that make sense out of context.\n * - `'region'` for a perceivable area that needs a screen-reader\n * stop. Pair with `aria-label` or `aria-labelledby`.\n * - `'section'` is not a landmark by itself โ equivalent to a\n * `<section>` element. Useful when nesting structure matters.\n */\nexport type AtlCardRole = 'article' | 'region' | 'section';\nexport interface AtlCardSpec {\n variant?: AtlCardVariant;\n padding?: AtlCardPadding;\n /**\n * Opt-in landmark role. Default is no role (plain `<div>`).\n * See {@link AtlCardRole} for when to use each value.\n */\n role?: AtlCardRole;\n}\n\n// ---------------------------------------------------------------------------\n// Input / Textarea (shared form field props)\n// ---------------------------------------------------------------------------\n// `any` is intentional here: downstream form-field interfaces narrow `value`\n// to the concrete primitive they accept (string, number, boolean, Date, โฆ).\n// Using `unknown` would force every downstream consumer to redeclare the\n// property, defeating the purpose of the shared spec.\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport interface AtlFormFieldSpec {\n value?: any;\n onValueChange?: (value: any) => void;\n disabled?: boolean;\n invalid?: boolean;\n required?: boolean;\n name?: string;\n}\n\n/**\n * `readonly` โ the value is shown and submitted, but the user cannot change it.\n *\n * Deliberately NOT part of `AtlFormFieldSpec`. It used to be, and the four choice\n * controls that inherited it could not keep the promise: HTML ignores `readonly`\n * on `<input type=\"checkbox\">` and `<input type=\"radio\">`, and\n * `HTMLSelectElement` has no `readOnly` property at all โ measured, the user\n * still flipped the control and `onCheckedChange` still fired. A prop that\n * silently does nothing is worse than an absent one, so this mixin is applied\n * only where the state is actually enforced: natively by the text fields, and by\n * an explicit guard in AtlCombobox and AtlRadioGroup. See ADR-0045.\n */\nexport interface AtlReadonlySpec {\n readonly?: boolean;\n}\n\n/**\n * Visible caption rendered as a `<label>` associated with the control via\n * `for`/`id`. When omitted, the control renders with no visible caption โ\n * supply an external `<label>` or an `aria-label` at the call site in that\n * case, or the control has no accessible name.\n *\n * Deliberately NOT merged into `AtlFormFieldSpec`. Two of that mixin's\n * consumers project their caption as CONTENT rather than a string prop โ\n * `AtlCheckboxSpec`/`AtlToggleSpec` take it as `children`/`<ng-content>`/\n * `<slot>` โ so inheriting `label` there would be a second, unused, and\n * actively misleading way to say the same thing. Two more,\n * `AtlRadioGroupSpec` and `AtlComboboxSpec`, have no caption prop in any\n * adapter today, so applying it there would be speculative. Applied only\n * where a `label` prop actually exists in at least one adapter today โ\n * `AtlInputSpec`, `AtlTextareaSpec`, `AtlSelectSpec` โ three occurrences,\n * which is what justifies pulling it out as its own mixin instead of leaving\n * it three separate, easy-to-let-drift declarations (see ADR-0091, which\n * also documents the one-off reading this mixin corrects).\n */\nexport interface AtlCaptionSpec {\n label?: string;\n}\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\nexport type AtlInputType = 'text' | 'email' | 'password' | 'number' | 'tel' | 'url';\nexport interface AtlInputSpec extends AtlFormFieldSpec, AtlReadonlySpec, AtlCaptionSpec {\n type?: AtlInputType;\n placeholder?: string;\n}\n\nexport interface AtlTextareaSpec extends AtlFormFieldSpec, AtlReadonlySpec, AtlCaptionSpec {\n rows?: number;\n placeholder?: string;\n autoResize?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Checkbox / Toggle\n// ---------------------------------------------------------------------------\n// Checkbox/Toggle are checked-based, not value-based, so they omit the\n// inherited `value`/`onValueChange` โ their state is `checked`/`onCheckedChange`.\n// (Input/Textarea/RadioGroup/Select/Combobox keep the value-based pair.)\nexport interface AtlCheckboxSpec extends Omit<AtlFormFieldSpec, 'value' | 'onValueChange'> {\n checked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n indeterminate?: boolean;\n}\n\nexport interface AtlToggleSpec extends Omit<AtlFormFieldSpec, 'value' | 'onValueChange'> {\n checked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n}\n\n// ---------------------------------------------------------------------------\n// Radio / RadioGroup\n// ---------------------------------------------------------------------------\nexport interface AtlRadioSpec {\n radioValue: string;\n disabled?: boolean;\n}\n\nexport interface AtlRadioGroupSpec extends AtlFormFieldSpec, AtlReadonlySpec {\n value?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Select / Option\n// ---------------------------------------------------------------------------\nexport interface AtlSelectSpec extends AtlFormFieldSpec, AtlCaptionSpec {\n placeholder?: string;\n}\n\nexport interface AtlOptionSpec {\n optionValue: string;\n disabled?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Stepper\n// ---------------------------------------------------------------------------\nexport interface AtlStepperSpec {\n activeStep?: number;\n orientation?: 'horizontal' | 'vertical';\n linear?: boolean;\n}\n\nexport interface AtlStepSpec {\n label: string;\n description?: string;\n completed?: boolean;\n error?: boolean;\n optional?: boolean;\n disabled?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Combobox\n// ---------------------------------------------------------------------------\nexport interface AtlComboboxOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\nexport interface AtlComboboxSpec extends AtlFormFieldSpec, AtlReadonlySpec {\n options?: AtlComboboxOption[];\n placeholder?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Alert\n// ---------------------------------------------------------------------------\nexport type AtlAlertVariant = 'info' | 'success' | 'warning' | 'danger';\nexport interface AtlAlertSpec {\n variant?: AtlAlertVariant;\n dismissible?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Dialog\n// ---------------------------------------------------------------------------\nexport type AtlDialogSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';\nexport interface AtlDialogSpec {\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n closeOnBackdrop?: boolean;\n size?: AtlDialogSize;\n}\n\n// ---------------------------------------------------------------------------\n// TabGroup / Tab\n// ---------------------------------------------------------------------------\nexport type AtlTabGroupVariant = 'default' | 'pills';\nexport interface AtlTabGroupSpec {\n selectedIndex?: number;\n onSelectedIndexChange?: (index: number) => void;\n variant?: AtlTabGroupVariant;\n}\n\nexport interface AtlTabSpec {\n label: string;\n disabled?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// AccordionGroup / AccordionItem\n// ---------------------------------------------------------------------------\nexport type AtlAccordionGroupVariant = 'default' | 'bordered' | 'separated';\nexport interface AtlAccordionGroupSpec {\n multi?: boolean;\n variant?: AtlAccordionGroupVariant;\n}\n\nexport type AtlAccordionHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\nexport interface AtlAccordionItemSpec {\n expanded?: boolean;\n onExpandedChange?: (expanded: boolean) => void;\n disabled?: boolean;\n /**\n * HTML heading level wrapping the trigger button. Default `3`.\n * Set this to match your page's heading outline so the\n * accordion's section titles don't break heading order.\n * Example: if the accordion is nested under an `<h2>`, pass\n * `headingLevel={3}` (default); if nested under an `<h3>`, pass\n * `headingLevel={4}`.\n */\n headingLevel?: AtlAccordionHeadingLevel;\n}\n\n// ---------------------------------------------------------------------------\n// Menu / MenuItem\n// ---------------------------------------------------------------------------\nexport type AtlMenuVariant = 'default' | 'compact';\nexport interface AtlMenuSpec {\n variant?: AtlMenuVariant;\n}\n\nexport interface AtlMenuItemSpec {\n disabled?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Tooltip\n// ---------------------------------------------------------------------------\nexport type AtlTooltipPosition = 'above' | 'below' | 'left' | 'right';\nexport interface AtlTooltipSpec {\n atlTooltip: string;\n atlTooltipPosition?: AtlTooltipPosition;\n atlTooltipDisabled?: boolean;\n atlTooltipShowDelay?: number;\n atlTooltipHideDelay?: number;\n}\n\n// ---------------------------------------------------------------------------\n// Toast\n// ---------------------------------------------------------------------------\nexport type AtlToastVariant = 'default' | 'success' | 'warning' | 'danger' | 'info';\nexport type AtlToastContainerPosition =\n | 'top-right'\n | 'top-center'\n | 'bottom-right'\n | 'bottom-center';\nexport interface AtlToastOptions {\n variant?: AtlToastVariant;\n duration?: number;\n dismissible?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Skeleton\n// ---------------------------------------------------------------------------\nexport type AtlSkeletonVariant = 'text' | 'circular' | 'rectangular';\nexport interface AtlSkeletonSpec {\n variant?: AtlSkeletonVariant;\n width?: string;\n height?: string;\n animated?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Breadcrumbs / BreadcrumbItem\n// ---------------------------------------------------------------------------\nexport interface AtlBreadcrumbsSpec {\n separator?: string;\n}\n\nexport interface AtlBreadcrumbItemSpec {\n href?: string;\n current?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Pagination\n// ---------------------------------------------------------------------------\nexport interface AtlPaginationSpec {\n page?: number;\n pageCount?: number;\n siblingCount?: number;\n showFirstLast?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Progress\n// ---------------------------------------------------------------------------\nexport type AtlProgressVariant = 'default' | 'success' | 'warning' | 'danger';\nexport type AtlProgressSize = 'sm' | 'md' | 'lg';\nexport interface AtlProgressSpec {\n value?: number;\n max?: number;\n variant?: AtlProgressVariant;\n size?: AtlProgressSize;\n indeterminate?: boolean;\n /**\n * Accessible name for the progress bar โ rendered as `aria-label`.\n * Required by ARIA when there is no visible label nearby; without it\n * screen readers announce only \"progress bar 47%\". Examples:\n * `\"Upload progress\"`, `\"Form completion\"`, `\"Quota usage\"`.\n */\n label?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Drawer\n// ---------------------------------------------------------------------------\nexport type AtlDrawerPosition = 'left' | 'right' | 'top' | 'bottom';\nexport type AtlDrawerSize = 'sm' | 'md' | 'lg' | 'full';\nexport interface AtlDrawerSpec {\n open?: boolean;\n position?: AtlDrawerPosition;\n size?: AtlDrawerSize;\n closeOnBackdrop?: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// Table\n// ---------------------------------------------------------------------------\nexport type AtlTableVariant = 'default' | 'striped' | 'bordered';\nexport type AtlTableSize = 'sm' | 'md' | 'lg';\nexport type AtlSortDirection = 'asc' | 'desc' | null;\nexport type AtlTableAlign = 'start' | 'center' | 'end';\n\nexport interface AtlTableSpec {\n variant?: AtlTableVariant;\n size?: AtlTableSize;\n stickyHeader?: boolean;\n /**\n * Accessible name for the scrollable table region. The wrapper\n * around the `<table>` is keyboard-focusable (tabindex=0) so that\n * users can scroll horizontally; this label is what screen readers\n * announce when focus enters the region. Defaults to `\"Table\"`.\n */\n 'aria-label'?: string;\n}\n\nexport interface AtlTbodySpec {\n empty?: boolean;\n colSpan?: number;\n}\n\nexport interface AtlTrSpec {\n selected?: boolean;\n selectable?: boolean;\n rowId?: string;\n}\n\nexport interface AtlThSpec {\n sortable?: boolean;\n sortDirection?: AtlSortDirection;\n align?: AtlTableAlign;\n width?: string;\n}\n\nexport interface AtlTdSpec {\n align?: AtlTableAlign;\n}\n\n// ---------------------------------------------------------------------------\n// Icon\n// ---------------------------------------------------------------------------\nexport type AtlIconName =\n | 'success'\n | 'check'\n | 'warning'\n | 'danger'\n | 'info'\n | 'error'\n | 'chevron-up'\n | 'chevron-down'\n | 'chevron-left'\n | 'chevron-right'\n | 'chevron-double-left'\n | 'chevron-double-right'\n | 'sort-asc'\n | 'sort-desc'\n | 'arrow-right'\n | 'arrow-left'\n | 'copy'\n | 'paste'\n | 'add'\n | 'edit'\n | 'delete'\n | 'close'\n | 'more'\n | 'person'\n | 'default-toast';\nexport type AtlIconSize = 'sm' | 'md' | 'lg';\nexport interface AtlIconSpec {\n name: AtlIconName;\n size?: AtlIconSize;\n /**\n * Accessible label. When provided, the icon is announced as an image with\n * this label. When omitted, the icon is hidden from assistive tech (treated\n * as decorative).\n */\n label?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Chat (AI surface)\n// ---------------------------------------------------------------------------\nexport type AtlChatVariant = 'drawer' | 'popup' | 'inline';\nexport type AtlChatStatus = 'idle' | 'streaming' | 'error';\nexport type AtlChatMessageRole = 'user' | 'assistant' | 'system';\n\nexport interface AtlChatMessageSpec {\n id: string;\n role: AtlChatMessageRole;\n content: string;\n failed?: boolean;\n}\n\nexport interface AtlChatSuggestionSpec {\n id: string;\n label: string;\n hint?: string;\n}\n\nexport interface AtlChatSpec {\n variant?: AtlChatVariant;\n status?: AtlChatStatus;\n open?: boolean;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atl-textarea.d.ts","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/textarea/atl-textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,
|
|
1
|
+
{"version":3,"file":"atl-textarea.d.ts","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/textarea/atl-textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAA4B,MAAM,OAAO,CAAC;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,oBAAoB,CAAC;AAG5B;;GAEG;AACH,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,EAAE,UAAU,CAAC,EACnE,eAAe;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,aAAa,EACb,OAAe,EACf,MAAW,EACX,QAAgB,EAChB,QAAQ,EAAE,aAAa,EACvB,QAAQ,EAAE,YAAY,EACtB,QAAgB,EAChB,KAAK,EACL,UAAkB,EAClB,IAAQ,EACR,SAAS,EACT,EAAE,EACF,GAAG,IAAI,EACR,EAAE,gBAAgB,+BAqElB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useRef, useEffect } from 'react';
|
|
2
|
+
import { useRef, useEffect, useId } from 'react';
|
|
3
3
|
import './atl-textarea.css';
|
|
4
4
|
import { AtlIcon } from '../icon/atl-icon';
|
|
5
5
|
/**
|
|
@@ -8,7 +8,11 @@ import { AtlIcon } from '../icon/atl-icon';
|
|
|
8
8
|
export function AtlTextarea({ value, onChange, onValueChange, invalid = false, errors = [], disabled = false, readOnly: reactReadOnly, readonly: specReadOnly, required = false, label, autoResize = false, rows = 3, className, id, ...rest }) {
|
|
9
9
|
const readOnly = reactReadOnly ?? specReadOnly ?? false;
|
|
10
10
|
const textareaRef = useRef(null);
|
|
11
|
-
|
|
11
|
+
// useId(), not a slug derived from the label text: two textareas with the
|
|
12
|
+
// same label used to collide on one id and break the for/id association
|
|
13
|
+
// (same bug as AtlInput's โ see ADR-0091).
|
|
14
|
+
const generatedId = useId();
|
|
15
|
+
const inputId = id || (label ? `textarea-${generatedId}` : undefined);
|
|
12
16
|
const classes = [
|
|
13
17
|
'atl-textarea',
|
|
14
18
|
invalid && 'is-invalid',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atl-textarea.js","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/textarea/atl-textarea.tsx"],"names":[],"mappings":";AAAA,OAAO,EAA0B,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"atl-textarea.js","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/textarea/atl-textarea.tsx"],"names":[],"mappings":";AAAA,OAAO,EAA0B,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AA8B3C;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,aAAa,EACb,OAAO,GAAG,KAAK,EACf,MAAM,GAAG,EAAE,EACX,QAAQ,GAAG,KAAK,EAChB,QAAQ,EAAE,aAAa,EACvB,QAAQ,EAAE,YAAY,EACtB,QAAQ,GAAG,KAAK,EAChB,KAAK,EACL,UAAU,GAAG,KAAK,EAClB,IAAI,GAAG,CAAC,EACR,SAAS,EACT,EAAE,EACF,GAAG,IAAI,EACU;I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AO,CAAC,YAAY,IAAI,CAAC;QAC7E,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;IAE1D,OAAO,CACL,eAAK,SAAS,EAAE,OAAO,aACpB,KAAK,IAAI,gBAAO,OAAO,EAAE,OAAO,YAAG,KAAK,GAAS,EAClD,eAAK,SAAS,EAAC,gBAAgB,aAC7B,mBACE,GAAG,EAAE,WAAW,EAChB,EAAE,EAAE,OAAO,EACX,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,kBACI,OAAO,IAAI,SAAS,mBACnB,QAAQ,IAAI,SAAS,sBAClB,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,KACrD,IAAI,GACR,EACD,OAAO,IAAI,KAAC,OAAO,IAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,cAAc,GAAG,IACpE,EACL,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CACpB,cAAK,SAAS,EAAC,QAAQ,EAAC,EAAE,EAAE,OAAO,eAAY,QAAQ,YACpD,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,YAAW,SAAS,EAAC,eAAe,YACjC,GAAG,IADE,CAAC,CAEL,CACL,CAAC,GACE,CACP,IACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { TextareaHTMLAttributes, useRef, useEffect, useId } from 'react';\nimport type { AtlTextareaSpec } from '../spec';\nimport './atl-textarea.css';\nimport { AtlIcon } from '../icon/atl-icon';\n\n/**\n * Properties for the AtlTextarea component.\n */\nexport interface AtlTextareaProps\n extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'readOnly'>,\n AtlTextareaSpec {\n /**\n * Current value of the textarea.\n */\n value?: string;\n /**\n * Whether the textarea is read-only.\n */\n readOnly?: boolean;\n /**\n * Callback fired when the value changes.\n */\n onValueChange?: (value: string) => void;\n /**\n * List of error messages to display.\n */\n errors?: string[];\n /**\n * Label text for the textarea.\n */\n label?: string;\n}\n\n/**\n * A multi-line text input component that supports automatic resizing and validation states.\n */\nexport function AtlTextarea({\n value,\n onChange,\n onValueChange,\n invalid = false,\n errors = [],\n disabled = false,\n readOnly: reactReadOnly,\n readonly: specReadOnly,\n required = false,\n label,\n autoResize = false,\n rows = 3,\n className,\n id,\n ...rest\n}: AtlTextareaProps) {\n const readOnly = reactReadOnly ?? specReadOnly ?? false;\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n // useId(), not a slug derived from the label text: two textareas with the\n // same label used to collide on one id and break the for/id association\n // (same bug as AtlInput's โ see ADR-0091).\n const generatedId = useId();\n const inputId = id || (label ? `textarea-${generatedId}` : undefined);\n const classes = [\n 'atl-textarea',\n invalid && 'is-invalid',\n disabled && 'is-disabled',\n readOnly && 'is-readonly',\n autoResize && 'is-auto-resize',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n useEffect(() => {\n if (autoResize && textareaRef.current) {\n const el = textareaRef.current;\n el.style.height = 'auto';\n el.style.height = `${el.scrollHeight}px`;\n }\n }, [value, autoResize]);\n\n const handleChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n onChange?.(e);\n onValueChange?.(e.target.value);\n if (autoResize && textareaRef.current) {\n textareaRef.current.style.height = 'auto';\n textareaRef.current.style.height = `${textareaRef.current.scrollHeight}px`;\n }\n };\n\n const errorId = inputId ? `${inputId}-errors` : undefined;\n\n return (\n <div className={classes}>\n {label && <label htmlFor={inputId}>{label}</label>}\n <div className=\"textarea-field\">\n <textarea\n ref={textareaRef}\n id={inputId}\n value={value}\n onChange={handleChange}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n rows={rows}\n aria-invalid={invalid || undefined}\n aria-required={required || undefined}\n aria-describedby={errors.length > 0 ? errorId : undefined}\n {...rest}\n />\n {invalid && <AtlIcon name=\"danger\" size=\"sm\" className=\"invalid-icon\" />}\n </div>\n {errors.length > 0 && (\n <div className=\"errors\" id={errorId} aria-live=\"polite\">\n {errors.map((err, i) => (\n <p key={i} className=\"error-message\">\n {err}\n </p>\n ))}\n </div>\n )}\n </div>\n );\n}\n"]}
|
package/styles/tokens.css
CHANGED
|
@@ -143,6 +143,23 @@
|
|
|
143
143
|
--ui-type-action: var(--ui-font-weight-semibold) var(--ui-font-size-md) /
|
|
144
144
|
var(--ui-line-height-tight) var(--ui-font-family);
|
|
145
145
|
|
|
146
|
+
/* The row roles (ADR-0085). Where `control` is the label ON a control and
|
|
147
|
+
* `action` is the text of a control that acts, these two are the text IN a
|
|
148
|
+
* row: a menu item, an option, a table cell, a checkbox or radio label. They
|
|
149
|
+
* are regular weight, not medium, and they sit at the two default sizes the
|
|
150
|
+
* row ladder uses โ `row` at md for the standard rung, `row-sm` at sm for the
|
|
151
|
+
* compact one. Same tight leading as the rest of the ladder: a row's height
|
|
152
|
+
* comes from --ui-row-height-*, so its leading must not grow with the text.
|
|
153
|
+
*
|
|
154
|
+
* The ADR-0073 carve-out applies here exactly as it does above: a control's
|
|
155
|
+
* own VALUE text keeps its longhands. `row` describes what the row DISPLAYS,
|
|
156
|
+
* not what an input CONTAINS.
|
|
157
|
+
*/
|
|
158
|
+
--ui-type-row: var(--ui-font-weight-normal) var(--ui-font-size-md) /
|
|
159
|
+
var(--ui-line-height-tight) var(--ui-font-family);
|
|
160
|
+
--ui-type-row-sm: var(--ui-font-weight-normal) var(--ui-font-size-sm) /
|
|
161
|
+
var(--ui-line-height-tight) var(--ui-font-family);
|
|
162
|
+
|
|
146
163
|
/* โโ Colours ยท light mode (default) โโโโโโโโโโโโโโโโโโโโโโโโโโ */
|
|
147
164
|
|
|
148
165
|
/* Primary โ Conciso deep teal */
|