@atelier-ui/react 0.2.14 → 0.2.15
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 +18 -0
- package/package.json +1 -1
- package/src/lib/accordion/atl-accordion.css +21 -5
- package/src/lib/accordion/atl-accordion.d.ts.map +1 -1
- package/src/lib/accordion/atl-accordion.js +2 -3
- package/src/lib/accordion/atl-accordion.js.map +1 -1
- package/src/lib/alert/atl-alert.css +11 -1
- package/src/lib/alert/atl-alert.d.ts.map +1 -1
- package/src/lib/alert/atl-alert.js +2 -1
- package/src/lib/alert/atl-alert.js.map +1 -1
- package/src/lib/avatar/atl-avatar.css +19 -3
- package/src/lib/avatar/atl-avatar.d.ts.map +1 -1
- package/src/lib/avatar/atl-avatar.js +2 -1
- package/src/lib/avatar/atl-avatar.js.map +1 -1
- package/src/lib/badge/atl-badge.css +16 -6
- package/src/lib/breadcrumbs/atl-breadcrumbs.css +16 -0
- package/src/lib/button/atl-button.css +12 -2
- package/src/lib/card/atl-card.css +24 -4
- package/src/lib/chat/atl-chat.css +37 -11
- package/src/lib/chat/atl-chat.d.ts.map +1 -1
- package/src/lib/chat/atl-chat.js +2 -1
- package/src/lib/chat/atl-chat.js.map +1 -1
- package/src/lib/checkbox/atl-checkbox.css +12 -2
- package/src/lib/checkbox/atl-checkbox.d.ts +1 -5
- package/src/lib/checkbox/atl-checkbox.d.ts.map +1 -1
- package/src/lib/checkbox/atl-checkbox.js +2 -3
- package/src/lib/checkbox/atl-checkbox.js.map +1 -1
- package/src/lib/code-block/atl-code-block.css +25 -6
- package/src/lib/code-block/atl-code-block.d.ts.map +1 -1
- package/src/lib/code-block/atl-code-block.js +2 -1
- package/src/lib/code-block/atl-code-block.js.map +1 -1
- package/src/lib/combobox/atl-combobox.css +56 -5
- package/src/lib/combobox/atl-combobox.d.ts.map +1 -1
- package/src/lib/combobox/atl-combobox.js +4 -2
- package/src/lib/combobox/atl-combobox.js.map +1 -1
- package/src/lib/dialog/atl-dialog.css +24 -4
- package/src/lib/dialog/atl-dialog.d.ts.map +1 -1
- package/src/lib/dialog/atl-dialog.js +2 -1
- package/src/lib/dialog/atl-dialog.js.map +1 -1
- package/src/lib/drawer/atl-drawer.css +24 -4
- package/src/lib/drawer/atl-drawer.d.ts.map +1 -1
- package/src/lib/drawer/atl-drawer.js +2 -1
- package/src/lib/drawer/atl-drawer.js.map +1 -1
- package/src/lib/icon/atl-icon.css +18 -0
- package/src/lib/icon/atl-icon.d.ts +2 -1
- package/src/lib/icon/atl-icon.d.ts.map +1 -1
- package/src/lib/icon/atl-icon.js +6 -25
- package/src/lib/icon/atl-icon.js.map +1 -1
- package/src/lib/icons.d.ts +39 -0
- package/src/lib/icons.d.ts.map +1 -0
- package/src/lib/icons.js +49 -0
- package/src/lib/icons.js.map +1 -0
- package/src/lib/input/atl-input.css +21 -7
- package/src/lib/input/atl-input.d.ts.map +1 -1
- package/src/lib/input/atl-input.js +2 -1
- package/src/lib/input/atl-input.js.map +1 -1
- package/src/lib/menu/atl-menu.css +28 -3
- package/src/lib/pagination/atl-pagination.css +11 -1
- package/src/lib/progress/atl-progress.css +10 -0
- package/src/lib/radio/atl-radio.css +11 -1
- package/src/lib/radio/atl-radio.d.ts.map +1 -1
- package/src/lib/radio/atl-radio.js +5 -3
- package/src/lib/radio/atl-radio.js.map +1 -1
- package/src/lib/radio-group/atl-radio-group.css +10 -0
- package/src/lib/select/atl-select.css +21 -3
- package/src/lib/select/atl-select.d.ts +1 -5
- package/src/lib/select/atl-select.d.ts.map +1 -1
- package/src/lib/select/atl-select.js +1 -3
- package/src/lib/select/atl-select.js.map +1 -1
- package/src/lib/skeleton/atl-skeleton.css +10 -0
- package/src/lib/spec.d.ts +20 -6
- package/src/lib/spec.d.ts.map +1 -1
- package/src/lib/spec.js +1 -1
- package/src/lib/spec.js.map +1 -1
- package/src/lib/stepper/atl-stepper.css +11 -1
- package/src/lib/stepper/atl-stepper.d.ts.map +1 -1
- package/src/lib/stepper/atl-stepper.js +2 -1
- package/src/lib/stepper/atl-stepper.js.map +1 -1
- package/src/lib/table/atl-table.css +42 -3
- package/src/lib/table/atl-table.d.ts.map +1 -1
- package/src/lib/table/atl-table.js +2 -1
- package/src/lib/table/atl-table.js.map +1 -1
- package/src/lib/tabs/atl-tabs.css +27 -5
- package/src/lib/textarea/atl-textarea.css +22 -7
- package/src/lib/textarea/atl-textarea.d.ts.map +1 -1
- package/src/lib/textarea/atl-textarea.js +2 -1
- package/src/lib/textarea/atl-textarea.js.map +1 -1
- package/src/lib/toast/atl-toast.css +16 -0
- package/src/lib/toast/atl-toast.d.ts.map +1 -1
- package/src/lib/toast/atl-toast.js +2 -1
- package/src/lib/toast/atl-toast.js.map +1 -1
- package/src/lib/toggle/atl-toggle.css +11 -1
- package/src/lib/toggle/atl-toggle.d.ts +1 -5
- package/src/lib/toggle/atl-toggle.d.ts.map +1 -1
- package/src/lib/toggle/atl-toggle.js +2 -3
- package/src/lib/toggle/atl-toggle.js.map +1 -1
- package/src/lib/tooltip/atl-tooltip.css +16 -0
- package/styles/tokens.css +12 -0
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/* Geometry contract: every size this component states is a border-box size.
|
|
2
|
+
* Declared with the component rather than as a global reset, so it ships in the
|
|
3
|
+
* same file as the sizes it governs and no consuming app has to supply one.
|
|
4
|
+
* Gated by check:box-sizing; the resulting boxes are measured by check:geometry.
|
|
5
|
+
* See ADR-0043. */
|
|
6
|
+
.atl-input,
|
|
7
|
+
.atl-input * {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
}
|
|
10
|
+
|
|
1
11
|
.atl-input {
|
|
2
12
|
display: block;
|
|
3
13
|
font-family: var(--ui-font-family);
|
|
@@ -9,7 +19,7 @@
|
|
|
9
19
|
width: 100%;
|
|
10
20
|
min-height: var(--ui-control-height-md);
|
|
11
21
|
padding: calc(
|
|
12
|
-
(var(--ui-control-height-md) - var(--ui-line-height-tight) * var(--ui-font-size-md)) / 2 -
|
|
22
|
+
(var(--ui-control-height-md) - var(--ui-line-height-tight) * var(--ui-font-size-md)) / 2 - var(--ui-border-width)
|
|
13
23
|
)
|
|
14
24
|
var(--ui-spacing-4);
|
|
15
25
|
font-size: inherit;
|
|
@@ -19,7 +29,7 @@
|
|
|
19
29
|
line-height: var(--ui-line-height-tight);
|
|
20
30
|
color: var(--ui-color-text);
|
|
21
31
|
background-color: var(--ui-color-input-bg);
|
|
22
|
-
border:
|
|
32
|
+
border: var(--ui-border-width) solid var(--ui-color-input-border);
|
|
23
33
|
border-radius: var(--ui-radius-md);
|
|
24
34
|
transition: border-color var(--ui-transition-fast),
|
|
25
35
|
box-shadow var(--ui-transition-fast),
|
|
@@ -57,19 +67,19 @@
|
|
|
57
67
|
box-shadow: var(--ui-focus-ring-danger);
|
|
58
68
|
}
|
|
59
69
|
|
|
60
|
-
/* Non-color invalid indicator (WCAG 1.4.1)
|
|
61
|
-
|
|
62
|
-
|
|
70
|
+
/* Non-color invalid indicator (WCAG 1.4.1). A real AtlIcon rather than a CSS
|
|
71
|
+
* `content: '✕'`: the glyph could not follow the icon set and Figma cannot put an
|
|
72
|
+
* icon instance behind a pseudo-element (ADR-0046). */
|
|
73
|
+
.atl-input.is-invalid .input-field .invalid-icon {
|
|
63
74
|
position: absolute;
|
|
64
75
|
top: 50%;
|
|
65
76
|
transform: translateY(-50%);
|
|
66
77
|
right: 0.875rem;
|
|
67
78
|
color: var(--ui-color-danger);
|
|
68
|
-
font-weight: 700;
|
|
69
|
-
line-height: 1;
|
|
70
79
|
pointer-events: none;
|
|
71
80
|
}
|
|
72
81
|
|
|
82
|
+
|
|
73
83
|
/* Disabled state */
|
|
74
84
|
.atl-input.is-disabled {
|
|
75
85
|
opacity: var(--ui-opacity-disabled);
|
|
@@ -83,6 +93,10 @@
|
|
|
83
93
|
/* Readonly state */
|
|
84
94
|
.atl-input.is-readonly input {
|
|
85
95
|
background-color: var(--ui-color-surface-sunken);
|
|
96
|
+
/* Readonly is content, not a control: the interactive edge goes away while the
|
|
97
|
+
* filled surface stays. Transparent rather than removed so the 1px border keeps
|
|
98
|
+
* its space and the height stays exactly --ui-control-height-md (ADR-0045). */
|
|
99
|
+
border-color: transparent;
|
|
86
100
|
cursor: default;
|
|
87
101
|
}
|
|
88
102
|
|
|
@@ -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,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"atl-input.d.ts","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/input/atl-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAC5C,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,+BAmDf"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import './atl-input.css';
|
|
3
|
+
import { AtlIcon } from '../icon/atl-icon';
|
|
3
4
|
/**
|
|
4
5
|
* A versatile input component for text entry.
|
|
5
6
|
*/
|
|
@@ -20,6 +21,6 @@ export function AtlInput({ type = 'text', value, onChange, onValueChange, invali
|
|
|
20
21
|
onValueChange?.(e.target.value);
|
|
21
22
|
};
|
|
22
23
|
const errorId = inputId ? `${inputId}-errors` : undefined;
|
|
23
|
-
return (_jsxs("div", { className: classes, children: [label && _jsx("label", { htmlFor: inputId, children: label }),
|
|
24
|
+
return (_jsxs("div", { className: classes, children: [label && _jsx("label", { htmlFor: inputId, children: label }), _jsxs("div", { className: "input-field", children: [_jsx("input", { id: inputId, type: type, value: value, onChange: handleChange, disabled: disabled, readOnly: readOnly, required: required, "aria-invalid": invalid || undefined, "aria-required": required || undefined, "aria-describedby": errors.length > 0 ? errorId : undefined, ...rest }), invalid && _jsx(AtlIcon, { name: "danger", size: "sm", className: "invalid-icon" })] }), errors.length > 0 && (_jsx("div", { className: "errors", id: errorId, "aria-live": "polite", children: errors.map((err, i) => (_jsx("p", { className: "error-message", children: err }, i))) }))] }));
|
|
24
25
|
}
|
|
25
26
|
//# sourceMappingURL=atl-input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atl-input.js","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/input/atl-input.tsx"],"names":[],"mappings":";AAEA,OAAO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AAO,aACpB,KAAK,IAAI,gBAAO,OAAO,EAAE,OAAO,YAAG,KAAK,GAAS,EAClD,eAAK,SAAS,EAAC,aAAa,aAC1B,gBACE,EAAE,EAAE,OAAO,EACX,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,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 } 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 const inputId =\n id || (label ? `input-${label.toLowerCase().replace(/\\s+/g, '-')}` : 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,10 +1,30 @@
|
|
|
1
|
+
/* Geometry contract: every size this component states is a border-box size.
|
|
2
|
+
* Declared with the component rather than as a global reset, so it ships in the
|
|
3
|
+
* same file as the sizes it governs and no consuming app has to supply one.
|
|
4
|
+
* Gated by check:box-sizing; the resulting boxes are measured by check:geometry.
|
|
5
|
+
* See ADR-0043. */
|
|
6
|
+
:is(
|
|
7
|
+
.atl-menu,
|
|
8
|
+
.atl-menu-item,
|
|
9
|
+
.atl-menu-panel,
|
|
10
|
+
.atl-menu-separator
|
|
11
|
+
),
|
|
12
|
+
:is(
|
|
13
|
+
.atl-menu,
|
|
14
|
+
.atl-menu-item,
|
|
15
|
+
.atl-menu-panel,
|
|
16
|
+
.atl-menu-separator
|
|
17
|
+
) * {
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
}
|
|
20
|
+
|
|
1
21
|
/* Menu panel */
|
|
2
22
|
.atl-menu {
|
|
3
23
|
display: block;
|
|
4
24
|
min-width: 12rem;
|
|
5
25
|
padding: var(--ui-spacing-2) 0;
|
|
6
26
|
background: var(--ui-color-surface-raised);
|
|
7
|
-
border:
|
|
27
|
+
border: var(--ui-border-width) solid var(--ui-color-border);
|
|
8
28
|
border-radius: var(--ui-radius-lg);
|
|
9
29
|
box-shadow: var(--ui-shadow-lg);
|
|
10
30
|
font-family: var(--ui-font-family);
|
|
@@ -23,8 +43,13 @@
|
|
|
23
43
|
}
|
|
24
44
|
|
|
25
45
|
.atl-menu.variant-compact .atl-menu-item {
|
|
26
|
-
min-height:
|
|
27
|
-
|
|
46
|
+
min-height: var(--ui-control-height-sm);
|
|
47
|
+
/* Stated, not inherited: an inherited line-height makes the box grow with the
|
|
48
|
+
* text metrics, which is how three controls measured right on one machine and
|
|
49
|
+
* wrong on another (ADR-0048). */
|
|
50
|
+
line-height: var(--ui-line-height-tight);
|
|
51
|
+
padding: calc((var(--ui-control-height-sm) - var(--ui-line-height-tight) * var(--ui-font-size-sm)) / 2)
|
|
52
|
+
var(--ui-spacing-3);
|
|
28
53
|
}
|
|
29
54
|
|
|
30
55
|
@keyframes atl-menu-enter {
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/* Geometry contract: every size this component states is a border-box size.
|
|
2
|
+
* Declared with the component rather than as a global reset, so it ships in the
|
|
3
|
+
* same file as the sizes it governs and no consuming app has to supply one.
|
|
4
|
+
* Gated by check:box-sizing; the resulting boxes are measured by check:geometry.
|
|
5
|
+
* See ADR-0043. */
|
|
6
|
+
.atl-pagination,
|
|
7
|
+
.atl-pagination * {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
}
|
|
10
|
+
|
|
1
11
|
.atl-pagination {
|
|
2
12
|
display: block;
|
|
3
13
|
font-family: var(--ui-font-family);
|
|
@@ -23,7 +33,7 @@
|
|
|
23
33
|
height: 2.25rem;
|
|
24
34
|
padding: 0 var(--ui-spacing-2);
|
|
25
35
|
border-radius: var(--ui-radius-md);
|
|
26
|
-
border:
|
|
36
|
+
border: var(--ui-border-width) solid transparent;
|
|
27
37
|
background: transparent;
|
|
28
38
|
color: var(--ui-color-text);
|
|
29
39
|
font-size: var(--ui-font-size-sm);
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/* Geometry contract: every size this component states is a border-box size.
|
|
2
|
+
* Declared with the component rather than as a global reset, so it ships in the
|
|
3
|
+
* same file as the sizes it governs and no consuming app has to supply one.
|
|
4
|
+
* Gated by check:box-sizing; the resulting boxes are measured by check:geometry.
|
|
5
|
+
* See ADR-0043. */
|
|
6
|
+
.atl-progress,
|
|
7
|
+
.atl-progress * {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
}
|
|
10
|
+
|
|
1
11
|
.atl-progress {
|
|
2
12
|
display: block;
|
|
3
13
|
width: 100%;
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/* Geometry contract: every size this component states is a border-box size.
|
|
2
|
+
* Declared with the component rather than as a global reset, so it ships in the
|
|
3
|
+
* same file as the sizes it governs and no consuming app has to supply one.
|
|
4
|
+
* Gated by check:box-sizing; the resulting boxes are measured by check:geometry.
|
|
5
|
+
* See ADR-0043. */
|
|
6
|
+
.atl-radio,
|
|
7
|
+
.atl-radio * {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
}
|
|
10
|
+
|
|
1
11
|
.atl-radio {
|
|
2
12
|
display: inline-flex;
|
|
3
13
|
align-items: center;
|
|
@@ -23,7 +33,7 @@
|
|
|
23
33
|
flex-shrink: 0;
|
|
24
34
|
width: 1.25rem;
|
|
25
35
|
height: 1.25rem;
|
|
26
|
-
border:
|
|
36
|
+
border: var(--ui-border-width-thick) solid var(--ui-color-border-strong);
|
|
27
37
|
border-radius: 50%;
|
|
28
38
|
background-color: var(--ui-color-input-bg);
|
|
29
39
|
cursor: pointer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atl-radio.d.ts","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/radio/atl-radio.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,iBAAiB,CAAC;AAEzB;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,YAAY;IACjD;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,EAAE,UAAU,EAAE,QAAgB,EAAE,QAAQ,EAAE,EAAE,aAAa,+
|
|
1
|
+
{"version":3,"file":"atl-radio.d.ts","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/radio/atl-radio.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,iBAAiB,CAAC;AAEzB;;GAEG;AACH,MAAM,WAAW,aAAc,SAAQ,YAAY;IACjD;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,EAAE,UAAU,EAAE,QAAgB,EAAE,QAAQ,EAAE,EAAE,aAAa,+BAgCjF"}
|
|
@@ -7,17 +7,19 @@ import './atl-radio.css';
|
|
|
7
7
|
export function AtlRadio({ radioValue, disabled = false, children }) {
|
|
8
8
|
const ctx = useRadioGroup();
|
|
9
9
|
const isDisabled = disabled || ctx.disabled;
|
|
10
|
-
const isReadOnly = ctx.readOnly;
|
|
11
10
|
const isChecked = ctx.value === radioValue;
|
|
12
11
|
const classes = [
|
|
13
12
|
'atl-radio',
|
|
14
13
|
isDisabled && 'is-disabled',
|
|
15
|
-
isReadOnly && 'is-readonly',
|
|
16
14
|
isChecked && 'is-checked',
|
|
17
15
|
ctx.invalid && 'is-invalid',
|
|
18
16
|
]
|
|
19
17
|
.filter(Boolean)
|
|
20
18
|
.join(' ');
|
|
21
|
-
return (_jsxs("label", { className: classes, children: [_jsx("input", { type: "radio", name: ctx.name || undefined, value: radioValue, checked: isChecked, disabled: isDisabled,
|
|
19
|
+
return (_jsxs("label", { className: classes, children: [_jsx("input", { type: "radio", name: ctx.name || undefined, value: radioValue, checked: isChecked, disabled: isDisabled,
|
|
20
|
+
// HTML ignores `readonly` on a radio, so guarding onChange stops the model
|
|
21
|
+
// but not the input's own DOM state. Cancelling the click makes the browser
|
|
22
|
+
// restore the previous selection (verified in chromium). See ADR-0045.
|
|
23
|
+
onClick: (e) => ctx.readOnly && e.preventDefault(), onChange: () => !isDisabled && !ctx.readOnly && ctx.onSelect(radioValue), onBlur: () => ctx.onBlur() }), children && _jsx("span", { className: "radio-text", children: children })] }));
|
|
22
24
|
}
|
|
23
25
|
//# sourceMappingURL=atl-radio.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atl-radio.js","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/radio/atl-radio.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/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D,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,UAAU,IAAI,CAAC,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,EACxE,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,GAC1B,EACD,QAAQ,IAAI,eAAM,SAAS,EAAC,YAAY,YAAE,QAAQ,GAAQ,IACrD,CACT,CAAC;AACJ,CAAC","sourcesContent":["import { ReactNode } from 'react';\nimport type { AtlRadioSpec } from '../spec';\nimport { useRadioGroup } from '../radio-group/atl-radio-group';\nimport './atl-radio.css';\n\n/**\n * Properties for the AtlRadio component.\n */\nexport interface AtlRadioProps extends AtlRadioSpec {\n /**\n * The value of the radio button.\n */\n radioValue: string;\n /**\n * Whether the radio button is disabled.\n */\n disabled?: boolean;\n /**\n * The content to be rendered as the label for the radio button.\n */\n children?: ReactNode;\n}\n\n/**\n * An individual radio button component, meant to be used within AtlRadioGroup.\n */\nexport function AtlRadio({ radioValue, disabled = false, children }: AtlRadioProps) {\n const ctx = useRadioGroup();\n const isDisabled = disabled || ctx.disabled;\n const isChecked = ctx.value === radioValue;\n\n const classes = [\n 'atl-radio',\n isDisabled && 'is-disabled',\n isChecked && 'is-checked',\n ctx.invalid && 'is-invalid',\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <label className={classes}>\n <input\n type=\"radio\"\n name={ctx.name || undefined}\n value={radioValue}\n checked={isChecked}\n disabled={isDisabled}\n // HTML ignores `readonly` on a radio, so guarding onChange stops the model\n // but not the input's own DOM state. Cancelling the click makes the browser\n // restore the previous selection (verified in chromium). See ADR-0045.\n onClick={(e) => ctx.readOnly && e.preventDefault()}\n onChange={() => !isDisabled && !ctx.readOnly && ctx.onSelect(radioValue)}\n onBlur={() => ctx.onBlur()}\n />\n {children && <span className=\"radio-text\">{children}</span>}\n </label>\n );\n}\n"]}
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/* Geometry contract: every size this component states is a border-box size.
|
|
2
|
+
* Declared with the component rather than as a global reset, so it ships in the
|
|
3
|
+
* same file as the sizes it governs and no consuming app has to supply one.
|
|
4
|
+
* Gated by check:box-sizing; the resulting boxes are measured by check:geometry.
|
|
5
|
+
* See ADR-0043. */
|
|
6
|
+
.atl-radio-group,
|
|
7
|
+
.atl-radio-group * {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
}
|
|
10
|
+
|
|
1
11
|
.atl-radio-group {
|
|
2
12
|
display: flex;
|
|
3
13
|
font-family: var(--ui-font-family);
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/* Geometry contract: every size this component states is a border-box size.
|
|
2
|
+
* Declared with the component rather than as a global reset, so it ships in the
|
|
3
|
+
* same file as the sizes it governs and no consuming app has to supply one.
|
|
4
|
+
* Gated by check:box-sizing; the resulting boxes are measured by check:geometry.
|
|
5
|
+
* See ADR-0043. */
|
|
6
|
+
.atl-select,
|
|
7
|
+
.atl-select * {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
}
|
|
10
|
+
|
|
1
11
|
.atl-select {
|
|
2
12
|
display: inline-block;
|
|
3
13
|
position: relative;
|
|
@@ -25,11 +35,19 @@
|
|
|
25
35
|
align-items: center;
|
|
26
36
|
justify-content: space-between;
|
|
27
37
|
width: 100%;
|
|
28
|
-
min-height:
|
|
29
|
-
padding
|
|
38
|
+
min-height: var(--ui-control-height-md);
|
|
39
|
+
/* Control line-height plus padding derived from the height, so the box does not
|
|
40
|
+
* depend on which font is installed. Authored 0.625rem padding with an inherited
|
|
41
|
+
* line-height rendered 40px with Instrument Sans and 41px with the fallback — the
|
|
42
|
+
* defect only appeared in CI. See ADR-0048. */
|
|
43
|
+
line-height: var(--ui-line-height-tight);
|
|
44
|
+
padding: calc(
|
|
45
|
+
(var(--ui-control-height-md) - var(--ui-line-height-tight) * var(--ui-font-size-md)) / 2 -
|
|
46
|
+
var(--ui-border-width)
|
|
47
|
+
) var(--ui-spacing-4);
|
|
30
48
|
padding-inline-end: calc(var(--ui-spacing-4) + 1.25rem);
|
|
31
49
|
background: var(--ui-color-input-bg);
|
|
32
|
-
border:
|
|
50
|
+
border: var(--ui-border-width) solid var(--ui-color-input-border);
|
|
33
51
|
border-radius: var(--ui-radius-md);
|
|
34
52
|
color: var(--ui-color-text);
|
|
35
53
|
font-family: inherit;
|
|
@@ -29,15 +29,11 @@ export interface AtlSelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElem
|
|
|
29
29
|
* The label for the select.
|
|
30
30
|
*/
|
|
31
31
|
label?: string;
|
|
32
|
-
/**
|
|
33
|
-
* Whether the select is read-only.
|
|
34
|
-
*/
|
|
35
|
-
readOnly?: boolean;
|
|
36
32
|
}
|
|
37
33
|
/**
|
|
38
34
|
* A select component for choosing an option from a list.
|
|
39
35
|
*/
|
|
40
|
-
export declare function AtlSelect({ value, onValueChange, placeholder, invalid, errors, disabled,
|
|
36
|
+
export declare function AtlSelect({ value, onValueChange, placeholder, invalid, errors, disabled, required, label, children, className, id, ...rest }: AtlSelectProps): import("react").JSX.Element;
|
|
41
37
|
/**
|
|
42
38
|
* Properties for the AtlOption component.
|
|
43
39
|
*/
|
|
@@ -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,EAAE,MAAM,OAAO,CAAC;AAC9E,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACd,MAAM,SAAS,CAAC;AACjB,OAAO,kBAAkB,CAAC;AAE1B;;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;
|
|
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,EAAE,MAAM,OAAO,CAAC;AAC9E,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACd,MAAM,SAAS,CAAC;AACjB,OAAO,kBAAkB,CAAC;AAE1B;;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,+BA+ChB;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"}
|
|
@@ -3,14 +3,12 @@ import './atl-select.css';
|
|
|
3
3
|
/**
|
|
4
4
|
* A select component for choosing an option from a list.
|
|
5
5
|
*/
|
|
6
|
-
export function AtlSelect({ value = '', onValueChange, placeholder, invalid = false, errors = [], disabled = false,
|
|
7
|
-
const readOnly = reactReadOnly ?? specReadOnly ?? false;
|
|
6
|
+
export function AtlSelect({ value = '', onValueChange, placeholder, invalid = false, errors = [], disabled = false, required = false, label, children, className, id, ...rest }) {
|
|
8
7
|
const selectId = id || (label ? `select-${label.toLowerCase().replace(/\s+/g, '-')}` : undefined);
|
|
9
8
|
const classes = [
|
|
10
9
|
'atl-select',
|
|
11
10
|
invalid && 'is-invalid',
|
|
12
11
|
disabled && 'is-disabled',
|
|
13
|
-
readOnly && 'is-readonly',
|
|
14
12
|
className,
|
|
15
13
|
]
|
|
16
14
|
.filter(Boolean)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atl-select.js","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/select/atl-select.tsx"],"names":[],"mappings":";AAKA,OAAO,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"atl-select.js","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/select/atl-select.tsx"],"names":[],"mappings":";AAKA,OAAO,kBAAkB,CAAC;AAkC1B;;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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AEG;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 } from 'react';\nimport type {\n AtlSelectSpec,\n AtlOptionSpec,\n} from '../spec';\nimport './atl-select.css';\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 const selectId =\n id || (label ? `select-${label.toLowerCase().replace(/\\s+/g, '-')}` : 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 {...rest}\n >\n {placeholder && (\n <option value=\"\" disabled hidden>\n {placeholder}\n </option>\n )}\n {children}\n </select>\n <span className=\"select-arrow\" aria-hidden=\"true\">\n ▾\n </span>\n </div>\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 {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"]}
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/* Geometry contract: every size this component states is a border-box size.
|
|
2
|
+
* Declared with the component rather than as a global reset, so it ships in the
|
|
3
|
+
* same file as the sizes it governs and no consuming app has to supply one.
|
|
4
|
+
* Gated by check:box-sizing; the resulting boxes are measured by check:geometry.
|
|
5
|
+
* See ADR-0043. */
|
|
6
|
+
.atl-skeleton,
|
|
7
|
+
.atl-skeleton * {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
}
|
|
10
|
+
|
|
1
11
|
.atl-skeleton {
|
|
2
12
|
display: block;
|
|
3
13
|
background: var(--ui-color-border);
|
package/src/lib/spec.d.ts
CHANGED
|
@@ -75,17 +75,31 @@ export interface AtlFormFieldSpec {
|
|
|
75
75
|
value?: any;
|
|
76
76
|
onValueChange?: (value: any) => void;
|
|
77
77
|
disabled?: boolean;
|
|
78
|
-
readonly?: boolean;
|
|
79
78
|
invalid?: boolean;
|
|
80
79
|
required?: boolean;
|
|
81
80
|
name?: string;
|
|
82
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* `readonly` — the value is shown and submitted, but the user cannot change it.
|
|
84
|
+
*
|
|
85
|
+
* Deliberately NOT part of `AtlFormFieldSpec`. It used to be, and the four choice
|
|
86
|
+
* controls that inherited it could not keep the promise: HTML ignores `readonly`
|
|
87
|
+
* on `<input type="checkbox">` and `<input type="radio">`, and
|
|
88
|
+
* `HTMLSelectElement` has no `readOnly` property at all — measured, the user
|
|
89
|
+
* still flipped the control and `onCheckedChange` still fired. A prop that
|
|
90
|
+
* silently does nothing is worse than an absent one, so this mixin is applied
|
|
91
|
+
* only where the state is actually enforced: natively by the text fields, and by
|
|
92
|
+
* an explicit guard in AtlCombobox and AtlRadioGroup. See ADR-0045.
|
|
93
|
+
*/
|
|
94
|
+
export interface AtlReadonlySpec {
|
|
95
|
+
readonly?: boolean;
|
|
96
|
+
}
|
|
83
97
|
export type AtlInputType = 'text' | 'email' | 'password' | 'number' | 'tel' | 'url';
|
|
84
|
-
export interface AtlInputSpec extends AtlFormFieldSpec {
|
|
98
|
+
export interface AtlInputSpec extends AtlFormFieldSpec, AtlReadonlySpec {
|
|
85
99
|
type?: AtlInputType;
|
|
86
100
|
placeholder?: string;
|
|
87
101
|
}
|
|
88
|
-
export interface AtlTextareaSpec extends AtlFormFieldSpec {
|
|
102
|
+
export interface AtlTextareaSpec extends AtlFormFieldSpec, AtlReadonlySpec {
|
|
89
103
|
rows?: number;
|
|
90
104
|
placeholder?: string;
|
|
91
105
|
autoResize?: boolean;
|
|
@@ -103,7 +117,7 @@ export interface AtlRadioSpec {
|
|
|
103
117
|
radioValue: string;
|
|
104
118
|
disabled?: boolean;
|
|
105
119
|
}
|
|
106
|
-
export interface AtlRadioGroupSpec extends AtlFormFieldSpec {
|
|
120
|
+
export interface AtlRadioGroupSpec extends AtlFormFieldSpec, AtlReadonlySpec {
|
|
107
121
|
value?: string;
|
|
108
122
|
}
|
|
109
123
|
export interface AtlSelectSpec extends AtlFormFieldSpec {
|
|
@@ -131,7 +145,7 @@ export interface AtlComboboxOption {
|
|
|
131
145
|
label: string;
|
|
132
146
|
disabled?: boolean;
|
|
133
147
|
}
|
|
134
|
-
export interface AtlComboboxSpec extends AtlFormFieldSpec {
|
|
148
|
+
export interface AtlComboboxSpec extends AtlFormFieldSpec, AtlReadonlySpec {
|
|
135
149
|
options?: AtlComboboxOption[];
|
|
136
150
|
placeholder?: string;
|
|
137
151
|
}
|
|
@@ -277,7 +291,7 @@ export interface AtlThSpec {
|
|
|
277
291
|
export interface AtlTdSpec {
|
|
278
292
|
align?: AtlTableAlign;
|
|
279
293
|
}
|
|
280
|
-
export type AtlIconName = 'success' | 'warning' | 'danger' | 'info' | 'error' | 'chevron-up' | 'chevron-down' | 'chevron-left' | 'chevron-right' | 'sort-asc' | 'sort-desc' | 'arrow-right' | 'arrow-left' | 'copy' | 'paste' | 'add' | 'edit' | 'delete' | 'close' | 'more' | 'default-toast';
|
|
294
|
+
export type AtlIconName = 'success' | 'check' | 'warning' | 'danger' | 'info' | 'error' | 'chevron-up' | 'chevron-down' | 'chevron-left' | 'chevron-right' | 'sort-asc' | 'sort-desc' | 'arrow-right' | 'arrow-left' | 'copy' | 'paste' | 'add' | 'edit' | 'delete' | 'close' | 'more' | 'person' | 'default-toast';
|
|
281
295
|
export type AtlIconSize = 'sm' | 'md' | 'lg';
|
|
282
296
|
export interface AtlIconSpec {
|
|
283
297
|
name: AtlIconName;
|
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;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ACN,OAAO,GACP,YAAY,GACZ,cAAc,GACd,cAAc,GACd,eAAe,GACf,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
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// AUTO-GENERATED from libs/spec/src/index.ts — do not edit here.
|
|
2
2
|
// Run `node tools/scripts/sync-spec.mjs` after editing the source of truth.
|
|
3
|
-
// The framework libs inline
|
|
3
|
+
// The framework libs inline this so @atelier-ui/spec stays internal.
|
|
4
4
|
//# sourceMappingURL=spec.js.map
|
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,4EAA4E","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 these types 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 readonly?: boolean;\n invalid?: boolean;\n required?: boolean;\n name?: 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 {\n type?: AtlInputType;\n placeholder?: string;\n}\n\nexport interface AtlTextareaSpec extends AtlFormFieldSpec {\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 {\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 {\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 | 'warning'\n | 'danger'\n | 'info'\n | 'error'\n | 'chevron-up'\n | 'chevron-down'\n | 'chevron-left'\n | 'chevron-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 | '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/* 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 | '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"]}
|