@atelier-ui/react 0.4.4 → 0.4.6
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 +22 -0
- package/package.json +2 -2
- package/src/lib/button/atl-button.d.ts +4 -1
- package/src/lib/button/atl-button.d.ts.map +1 -1
- package/src/lib/button/atl-button.js +10 -2
- package/src/lib/button/atl-button.js.map +1 -1
- package/src/lib/radio-group/atl-radio-group.d.ts +15 -2
- package/src/lib/radio-group/atl-radio-group.d.ts.map +1 -1
- package/src/lib/radio-group/atl-radio-group.js.map +1 -1
- package/src/lib/spec.d.ts +12 -0
- package/src/lib/spec.d.ts.map +1 -1
- package/src/lib/spec.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
## 0.4.6 (2026-10-16)
|
|
2
|
+
|
|
3
|
+
This was a version bump only for react to align it with other projects, there were no code changes.
|
|
4
|
+
|
|
5
|
+
## 0.4.5 (2026-10-14)
|
|
6
|
+
|
|
7
|
+
### 🩹 Fixes
|
|
8
|
+
|
|
9
|
+
- ⚠️ **a11y:** loading button stays focusable, danger shows its ring, radio groups get named (package 2) ([64929883](https://github.com/DominikPieper/atelier-ui/commit/64929883))
|
|
10
|
+
|
|
11
|
+
### ⚠️ Breaking Changes
|
|
12
|
+
|
|
13
|
+
- **a11y:** loading button stays focusable, danger shows its ring, radio groups get named (package 2) ([64929883](https://github.com/DominikPieper/atelier-ui/commit/64929883))
|
|
14
|
+
React `AtlRadioGroup` now requires `aria-label` or
|
|
15
|
+
`aria-labelledby`; an unnamed group no longer type-checks. A loading `AtlButton`
|
|
16
|
+
(all frameworks) is no longer natively `disabled`: it stays focusable and
|
|
17
|
+
carries `aria-disabled` and `aria-busy` instead.
|
|
18
|
+
|
|
19
|
+
### ❤️ Thank You
|
|
20
|
+
|
|
21
|
+
- Dominik Pieper @DominikPieper
|
|
22
|
+
|
|
1
23
|
## 0.4.4 (2026-10-12)
|
|
2
24
|
|
|
3
25
|
This was a version bump only for react to align it with other projects, there were no code changes.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atelier-ui/react",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"description": "Atelier component library for React — LLM-optimised, accessible, design-token-driven",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"directory": "libs/react"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@atelier-ui/styles": "0.4.
|
|
22
|
+
"@atelier-ui/styles": "0.4.6"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -23,7 +23,10 @@ export type AtlButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'chil
|
|
|
23
23
|
size?: AtlButtonSize;
|
|
24
24
|
/** Disables the button, preventing interaction. */
|
|
25
25
|
disabled?: boolean;
|
|
26
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* Shows a loading spinner, announces `aria-busy` and ignores activation.
|
|
28
|
+
* The button stays focusable (ADR-0171).
|
|
29
|
+
*/
|
|
27
30
|
loading?: boolean;
|
|
28
31
|
};
|
|
29
32
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atl-button.d.ts","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/button/atl-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAc,MAAM,OAAO,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC9E,OAAO,0CAA0C,CAAC;AAElD;;;;GAIG;AACH,KAAK,uBAAuB,GACxB;IAAE,QAAQ,EAAE,SAAS,CAAC;IAAC,YAAY,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,EAAE,OAAO,CAAC;CACnB,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,SAAS,8GAkDrB,CAAC"}
|
|
@@ -4,7 +4,7 @@ import '@atelier-ui/styles/button/atl-button.css';
|
|
|
4
4
|
/**
|
|
5
5
|
* A versatile button component that supports various styles, sizes, and states.
|
|
6
6
|
*/
|
|
7
|
-
export const AtlButton = forwardRef(function AtlButton({ variant = 'primary', size = 'md', disabled = false, loading = false, children, className, ...rest }, ref) {
|
|
7
|
+
export const AtlButton = forwardRef(function AtlButton({ variant = 'primary', size = 'md', disabled = false, loading = false, children, className, onClick, ...rest }, ref) {
|
|
8
8
|
const isDisabled = disabled || loading;
|
|
9
9
|
const classes = [
|
|
10
10
|
'atl-button',
|
|
@@ -16,6 +16,14 @@ export const AtlButton = forwardRef(function AtlButton({ variant = 'primary', si
|
|
|
16
16
|
]
|
|
17
17
|
.filter(Boolean)
|
|
18
18
|
.join(' ');
|
|
19
|
-
return (_jsxs("button", { ref: ref, className: classes,
|
|
19
|
+
return (_jsxs("button", { ref: ref, className: classes,
|
|
20
|
+
// Native `disabled` only for the `disabled` prop. Loading is announced
|
|
21
|
+
// and blocked below, but the button stays focusable (ADR-0171).
|
|
22
|
+
disabled: disabled, "aria-disabled": isDisabled || undefined, "aria-busy": loading || undefined, ...rest, onClick: loading
|
|
23
|
+
? (event) => {
|
|
24
|
+
// Also stops a `type="submit"` from submitting its form.
|
|
25
|
+
event.preventDefault();
|
|
26
|
+
}
|
|
27
|
+
: onClick, children: [loading && _jsx("span", { className: "spinner", "aria-hidden": "true" }), children] }));
|
|
20
28
|
});
|
|
21
29
|
//# sourceMappingURL=atl-button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atl-button.js","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/button/atl-button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAmC,UAAU,EAAE,MAAM,OAAO,CAAC;AAEpE,OAAO,0CAA0C,CAAC;
|
|
1
|
+
{"version":3,"file":"atl-button.js","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/button/atl-button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAmC,UAAU,EAAE,MAAM,OAAO,CAAC;AAEpE,OAAO,0CAA0C,CAAC;AAiClD;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CACjC,SAAS,SAAS,CAChB,EACE,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,IAAI,EACX,QAAQ,GAAG,KAAK,EAChB,OAAO,GAAG,KAAK,EACf,QAAQ,EACR,SAAS,EACT,OAAO,EACP,GAAG,IAAI,EACR,EACD,GAAG;IAEH,MAAM,UAAU,GAAG,QAAQ,IAAI,OAAO,CAAC;IACvC,MAAM,OAAO,GAAG;QACd,YAAY;QACZ,WAAW,OAAO,EAAE;QACpB,QAAQ,IAAI,EAAE;QACd,UAAU,IAAI,aAAa;QAC3B,OAAO,IAAI,YAAY;QACvB,SAAS;KACV;SACE,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,CACL,kBACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO;QAClB,uEAAuE;QACvE,gEAAgE;QAChE,QAAQ,EAAE,QAAQ,mBACH,UAAU,IAAI,SAAS,eAC3B,OAAO,IAAI,SAAS,KAC3B,IAAI,EACR,OAAO,EACL,OAAO;YACL,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE;gBACR,yDAAyD;gBACzD,KAAK,CAAC,cAAc,EAAE,CAAC;YACzB,CAAC;YACH,CAAC,CAAC,OAAO,aAGZ,OAAO,IAAI,eAAM,SAAS,EAAC,SAAS,iBAAa,MAAM,GAAG,EAC1D,QAAQ,IACF,CACV,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { ButtonHTMLAttributes, ReactNode, forwardRef } from 'react';\nimport type { AtlButtonSpec, AtlButtonVariant, AtlButtonSize } from '../spec';\nimport '@atelier-ui/styles/button/atl-button.css';\n\n/**\n * Accessibility requirement: the button must carry an accessible name\n * either as visible children OR as an `aria-label`. TypeScript catches\n * the icon-only-without-aria-label mistake at consumer build time.\n */\ntype AtlButtonAccessibleName =\n | { children: ReactNode; 'aria-label'?: string }\n | { children?: undefined; 'aria-label': string };\n\n/**\n * Properties for the AtlButton component.\n */\nexport type AtlButtonProps = Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n 'children' | 'aria-label'\n> &\n AtlButtonSpec &\n AtlButtonAccessibleName & {\n /** Visual style of the button. */\n variant?: AtlButtonVariant;\n /** Size of the button. */\n size?: AtlButtonSize;\n /** Disables the button, preventing interaction. */\n disabled?: boolean;\n /**\n * Shows a loading spinner, announces `aria-busy` and ignores activation.\n * The button stays focusable (ADR-0171).\n */\n loading?: boolean;\n };\n\n/**\n * A versatile button component that supports various styles, sizes, and states.\n */\nexport const AtlButton = forwardRef<HTMLButtonElement, AtlButtonProps>(\n function AtlButton(\n {\n variant = 'primary',\n size = 'md',\n disabled = false,\n loading = false,\n children,\n className,\n onClick,\n ...rest\n },\n ref,\n ) {\n const isDisabled = disabled || loading;\n const classes = [\n 'atl-button',\n `variant-${variant}`,\n `size-${size}`,\n isDisabled && 'is-disabled',\n loading && 'is-loading',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <button\n ref={ref}\n className={classes}\n // Native `disabled` only for the `disabled` prop. Loading is announced\n // and blocked below, but the button stays focusable (ADR-0171).\n disabled={disabled}\n aria-disabled={isDisabled || undefined}\n aria-busy={loading || undefined}\n {...rest}\n onClick={\n loading\n ? (event) => {\n // Also stops a `type=\"submit\"` from submitting its form.\n event.preventDefault();\n }\n : onClick\n }\n >\n {loading && <span className=\"spinner\" aria-hidden=\"true\" />}\n {children}\n </button>\n );\n },\n);\n"]}
|
|
@@ -35,10 +35,22 @@ export interface RadioGroupContextValue {
|
|
|
35
35
|
onBlur: () => void;
|
|
36
36
|
}
|
|
37
37
|
export declare const RadioGroupContext: import("react").Context<RadioGroupContextValue>;
|
|
38
|
+
/**
|
|
39
|
+
* Accessibility requirement: a group has no `<label for>`, so it must carry an
|
|
40
|
+
* accessible name as `aria-label` OR `aria-labelledby`. TypeScript catches an
|
|
41
|
+
* unnamed group at consumer build time (ADR-0171), as it does for AtlButton.
|
|
42
|
+
*/
|
|
43
|
+
type AtlRadioGroupAccessibleName = {
|
|
44
|
+
'aria-label': string;
|
|
45
|
+
'aria-labelledby'?: string;
|
|
46
|
+
} | {
|
|
47
|
+
'aria-label'?: string;
|
|
48
|
+
'aria-labelledby': string;
|
|
49
|
+
};
|
|
38
50
|
/**
|
|
39
51
|
* Properties for the AtlRadioGroup component.
|
|
40
52
|
*/
|
|
41
|
-
export
|
|
53
|
+
export type AtlRadioGroupProps = Omit<InputHTMLAttributes<HTMLDivElement>, 'onChange' | 'aria-label' | 'aria-labelledby'> & AtlRadioGroupSpec & AtlRadioGroupAccessibleName & {
|
|
42
54
|
/**
|
|
43
55
|
* Lowercase alias of `readOnly`: whether the selection can be read but not changed. `readOnly` wins when both are set.
|
|
44
56
|
*/
|
|
@@ -83,10 +95,11 @@ export interface AtlRadioGroupProps extends Omit<InputHTMLAttributes<HTMLDivElem
|
|
|
83
95
|
* The radio buttons to be rendered.
|
|
84
96
|
*/
|
|
85
97
|
children?: ReactNode;
|
|
86
|
-
}
|
|
98
|
+
};
|
|
87
99
|
/**
|
|
88
100
|
* A group of radio buttons.
|
|
89
101
|
*/
|
|
90
102
|
export declare function AtlRadioGroup({ value, onValueChange, orientation, name, disabled, readOnly: reactReadOnly, readonly: specReadOnly, invalid, required, errors, children, className, ...rest }: AtlRadioGroupProps): import("react").JSX.Element;
|
|
91
103
|
export declare function useRadioGroup(): RadioGroupContextValue;
|
|
104
|
+
export {};
|
|
92
105
|
//# sourceMappingURL=atl-radio-group.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atl-radio-group.d.ts","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/radio-group/atl-radio-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,mBAAmB,EACnB,SAAS,EACV,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,oDAAoD,CAAC;AAG5D;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC;;OAEG;IACH,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,eAAO,MAAM,iBAAiB,iDAQ5B,CAAC;AAEH;;GAEG;AACH,MAAM,
|
|
1
|
+
{"version":3,"file":"atl-radio-group.d.ts","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/radio-group/atl-radio-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,mBAAmB,EACnB,SAAS,EACV,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,oDAAoD,CAAC;AAG5D;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC;;OAEG;I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f,QAAgB,EAChB,MAAW,EACX,QAAQ,EACR,SAAS,EACT,GAAG,IAAI,EACR,EAAE,kBAAkB,+BAyEpB;AAED,wBAAgB,aAAa,IAAI,sBAAsB,CAEtD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atl-radio-group.js","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/radio-group/atl-radio-group.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,UAAU,EACV,MAAM,GAIP,MAAM,OAAO,CAAC;AAEf,OAAO,oDAAoD,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAoChD,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAyB;IACrE,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,EAAE;IACR,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE,KAAK;IACf,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,GAAG,EAAE,CAAC,SAAS;IACzB,MAAM,EAAE,GAAG,EAAE,CAAC,SAAS;CACxB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"atl-radio-group.js","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/radio-group/atl-radio-group.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,UAAU,EACV,MAAM,GAIP,MAAM,OAAO,CAAC;AAEf,OAAO,oDAAoD,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAoChD,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAyB;IACrE,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,EAAE;IACR,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE,KAAK;IACf,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,GAAG,EAAE,CAAC,SAAS;IACzB,MAAM,EAAE,GAAG,EAAE,CAAC,SAAS;CACxB,CAAC,CAAC;AAkEH;;GAEG;AACH,MAAM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AC,QAAQ,EAAC,IAAI,EAAC,OAAO,eAAW,QAAQ,YACpD,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,YAAW,SAAS,EAAC,eAAe,YACjC,YAAY,CAAC,GAAG,CAAC,IADZ,CAAC,CAEL,CACL,CAAC,GACE,CACP,IACG,GACqB,CAC9B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,OAAO,UAAU,CAAC,iBAAiB,CAAC,CAAC;AACvC,CAAC","sourcesContent":["import {\n createContext,\n useContext,\n useRef,\n type KeyboardEvent,\n InputHTMLAttributes,\n ReactNode,\n} from 'react';\nimport type { AtlRadioGroupSpec, AtlErrorItem } from '../spec';\nimport '@atelier-ui/styles/radio-group/atl-radio-group.css';\nimport { errorMessage } from '../error-message';\n\n/**\n * Interface for the RadioGroup context.\n */\nexport interface RadioGroupContextValue {\n /**\n * The currently selected value.\n */\n value: string;\n /**\n * The name of the radio group.\n */\n name: string;\n /**\n * Whether the entire radio group is disabled.\n */\n disabled: boolean;\n /**\n * Whether the entire radio group is read-only.\n */\n readOnly: boolean;\n /**\n * Whether the radio group is in an invalid state.\n */\n invalid: boolean;\n /**\n * Callback to select a value.\n */\n onSelect: (value: string) => void;\n /**\n * Callback triggered on blur.\n */\n onBlur: () => void;\n}\n\nexport const RadioGroupContext = createContext<RadioGroupContextValue>({\n value: '',\n name: '',\n disabled: false,\n readOnly: false,\n invalid: false,\n onSelect: () => undefined,\n onBlur: () => undefined,\n});\n\n/**\n * Accessibility requirement: a group has no `<label for>`, so it must carry an\n * accessible name as `aria-label` OR `aria-labelledby`. TypeScript catches an\n * unnamed group at consumer build time (ADR-0171), as it does for AtlButton.\n */\ntype AtlRadioGroupAccessibleName =\n | { 'aria-label': string; 'aria-labelledby'?: string }\n | { 'aria-label'?: string; 'aria-labelledby': string };\n\n/**\n * Properties for the AtlRadioGroup component.\n */\nexport type AtlRadioGroupProps = Omit<\n InputHTMLAttributes<HTMLDivElement>,\n 'onChange' | 'aria-label' | 'aria-labelledby'\n> &\n AtlRadioGroupSpec &\n AtlRadioGroupAccessibleName & {\n /**\n * Lowercase alias of `readOnly`: whether the selection can be read but not changed. `readOnly` wins when both are set.\n */\n readonly?: boolean;\n /**\n * The current value of the radio group.\n */\n value?: string;\n /**\n * Callback triggered when the value changes.\n */\n onValueChange?: (value: string) => void;\n /**\n * The layout orientation of the radio group.\n */\n orientation?: 'horizontal' | 'vertical';\n /**\n * The name of the radio group, applied to all child radio buttons.\n */\n name?: string;\n /**\n * Whether the radio group is disabled.\n */\n disabled?: boolean;\n /**\n * Whether the radio group is read-only.\n */\n readOnly?: boolean;\n /**\n * Whether the radio group is in an invalid state.\n */\n invalid?: boolean;\n /**\n * Whether a value is required.\n */\n required?: boolean;\n /**\n * Array of error messages to display.\n */\n errors?: ReadonlyArray<string | AtlErrorItem>;\n /**\n * The radio buttons to be rendered.\n */\n children?: ReactNode;\n };\n\n/**\n * A group of radio buttons.\n */\nexport function AtlRadioGroup({\n value = '',\n onValueChange,\n orientation = 'vertical',\n name = '',\n disabled = false,\n readOnly: reactReadOnly,\n readonly: specReadOnly,\n invalid = false,\n required = false,\n errors = [],\n children,\n className,\n ...rest\n}: AtlRadioGroupProps) {\n const readOnly = reactReadOnly ?? specReadOnly ?? false;\n const groupRef = useRef<HTMLDivElement>(null);\n\n // Roving arrow-key navigation per the WAI-ARIA radiogroup pattern: Arrow\n // Down/Right move to the next enabled radio, Up/Left to the previous, both\n // wrapping, and the navigated radio is selected and focused.\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (disabled || readOnly) return;\n const forward = event.key === 'ArrowDown' || event.key === 'ArrowRight';\n const backward = event.key === 'ArrowUp' || event.key === 'ArrowLeft';\n if (!forward && !backward) return;\n const radios = Array.from(\n groupRef.current?.querySelectorAll<HTMLInputElement>(\n 'input[type=\"radio\"]',\n ) ?? [],\n ).filter((radio) => !radio.disabled);\n if (radios.length === 0) return;\n event.preventDefault();\n const currentIdx = radios.findIndex((radio) => radio.value === value);\n const start = currentIdx === -1 ? (forward ? -1 : 0) : currentIdx;\n const nextIdx =\n (start + (forward ? 1 : -1) + radios.length) % radios.length;\n const target = radios[nextIdx];\n target.focus();\n onValueChange?.(target.value);\n };\n\n const classes = [\n 'atl-radio-group',\n `orientation-${orientation}`,\n invalid && 'is-invalid',\n disabled && 'is-disabled',\n readOnly && 'is-readonly',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <RadioGroupContext.Provider\n value={{\n value,\n name,\n disabled,\n readOnly,\n invalid,\n onSelect: (v) => !disabled && !readOnly && onValueChange?.(v),\n onBlur: () => undefined,\n }}\n >\n <div\n ref={groupRef}\n className={classes}\n role=\"radiogroup\"\n aria-invalid={invalid || undefined}\n aria-required={required || undefined}\n onKeyDown={handleKeyDown}\n {...rest}\n >\n {children}\n {errors.length > 0 && (\n <div className=\"errors\" role=\"alert\" aria-live=\"polite\">\n {errors.map((err, i) => (\n <p key={i} className=\"error-message\">\n {errorMessage(err)}\n </p>\n ))}\n </div>\n )}\n </div>\n </RadioGroupContext.Provider>\n );\n}\n\nexport function useRadioGroup(): RadioGroupContextValue {\n return useContext(RadioGroupContext);\n}\n"]}
|
package/src/lib/spec.d.ts
CHANGED
|
@@ -158,6 +158,18 @@ export interface AtlRadioSpec {
|
|
|
158
158
|
}
|
|
159
159
|
export interface AtlRadioGroupSpec extends AtlFormFieldSpec, AtlReadonlySpec {
|
|
160
160
|
value?: string;
|
|
161
|
+
/**
|
|
162
|
+
* Accessible name of the group — written as `aria-label` on the element that
|
|
163
|
+
* carries `role="radiogroup"`. A `<label for>` cannot name a group, so a group
|
|
164
|
+
* needs this or `aria-labelledby`; there is no `label` caption prop (ADR-0171).
|
|
165
|
+
* The React adapter requires one of the two at the type level.
|
|
166
|
+
*/
|
|
167
|
+
'aria-label'?: string;
|
|
168
|
+
/**
|
|
169
|
+
* Id of the visible caption that names the group (e.g. a heading or a
|
|
170
|
+
* `<span>` above it). Use instead of `aria-label` when the text is on screen.
|
|
171
|
+
*/
|
|
172
|
+
'aria-labelledby'?: string;
|
|
161
173
|
}
|
|
162
174
|
export interface AtlSelectSpec extends AtlFormFieldSpec, AtlCaptionSpec {
|
|
163
175
|
placeholder?: string;
|
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,GACzB,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;AACxD,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,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I,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 =\n '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 */\n\n/**\n * One validation error. Structurally the same as Angular Signal Forms'\n * `ValidationError` (`kind` plus an optional `message`), so Angular's\n * `[formField]` binding passes its errors straight through, and React and Vue\n * consumers can build the same shape by hand.\n */\nexport interface AtlErrorItem {\n /** Identifies the kind of error, e.g. `'required'`. */\n readonly kind: string;\n /** Human readable message, rendered under the field. */\n readonly message?: string;\n}\n\nexport interface AtlFormFieldSpec {\n /**\n * Validation errors to show under the field. Angular takes Signal Forms'\n * `ValidationError` objects; React and Vue take those objects or plain strings.\n */\n errors?: ReadonlyArray<string | AtlErrorItem>;\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 =\n 'text' | 'email' | 'password' | 'number' | 'tel' | 'url';\nexport interface AtlInputSpec\n extends AtlFormFieldSpec, AtlReadonlySpec, AtlCaptionSpec {\n type?: AtlInputType;\n placeholder?: string;\n}\n\nexport interface AtlTextareaSpec\n 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<\n AtlFormFieldSpec,\n 'value' | 'onValueChange'\n> {\n checked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n indeterminate?: boolean;\n}\n\nexport interface AtlToggleSpec extends Omit<\n AtlFormFieldSpec,\n 'value' | 'onValueChange'\n> {\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 =\n 'default' | 'success' | 'warning' | 'danger' | 'info';\nexport type AtlToastContainerPosition =\n 'top-right' | 'top-center' | 'bottom-right' | '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 =\n '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 */\n\n/**\n * One validation error. Structurally the same as Angular Signal Forms'\n * `ValidationError` (`kind` plus an optional `message`), so Angular's\n * `[formField]` binding passes its errors straight through, and React and Vue\n * consumers can build the same shape by hand.\n */\nexport interface AtlErrorItem {\n /** Identifies the kind of error, e.g. `'required'`. */\n readonly kind: string;\n /** Human readable message, rendered under the field. */\n readonly message?: string;\n}\n\nexport interface AtlFormFieldSpec {\n /**\n * Validation errors to show under the field. Angular takes Signal Forms'\n * `ValidationError` objects; React and Vue take those objects or plain strings.\n */\n errors?: ReadonlyArray<string | AtlErrorItem>;\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 =\n 'text' | 'email' | 'password' | 'number' | 'tel' | 'url';\nexport interface AtlInputSpec\n extends AtlFormFieldSpec, AtlReadonlySpec, AtlCaptionSpec {\n type?: AtlInputType;\n placeholder?: string;\n}\n\nexport interface AtlTextareaSpec\n 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<\n AtlFormFieldSpec,\n 'value' | 'onValueChange'\n> {\n checked?: boolean;\n onCheckedChange?: (checked: boolean) => void;\n indeterminate?: boolean;\n}\n\nexport interface AtlToggleSpec extends Omit<\n AtlFormFieldSpec,\n 'value' | 'onValueChange'\n> {\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 * Accessible name of the group — written as `aria-label` on the element that\n * carries `role=\"radiogroup\"`. A `<label for>` cannot name a group, so a group\n * needs this or `aria-labelledby`; there is no `label` caption prop (ADR-0171).\n * The React adapter requires one of the two at the type level.\n */\n 'aria-label'?: string;\n /**\n * Id of the visible caption that names the group (e.g. a heading or a\n * `<span>` above it). Use instead of `aria-label` when the text is on screen.\n */\n 'aria-labelledby'?: 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 =\n 'default' | 'success' | 'warning' | 'danger' | 'info';\nexport type AtlToastContainerPosition =\n 'top-right' | 'top-center' | 'bottom-right' | '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"]}
|