@atelier-ui/react 0.3.8 → 0.3.10
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/index.d.ts +1 -0
- package/src/index.d.ts.map +1 -1
- package/src/index.js.map +1 -1
- package/src/lib/breadcrumbs/atl-breadcrumbs.d.ts +12 -1
- package/src/lib/breadcrumbs/atl-breadcrumbs.d.ts.map +1 -1
- package/src/lib/breadcrumbs/atl-breadcrumbs.js +24 -9
- package/src/lib/breadcrumbs/atl-breadcrumbs.js.map +1 -1
- package/src/lib/button/atl-button.d.ts +11 -2
- package/src/lib/button/atl-button.d.ts.map +1 -1
- package/src/lib/button/atl-button.js.map +1 -1
- package/src/lib/chat/atl-chat.d.ts +1 -0
- package/src/lib/chat/atl-chat.d.ts.map +1 -1
- package/src/lib/chat/atl-chat.js.map +1 -1
- package/src/lib/checkbox/atl-checkbox.d.ts +10 -2
- package/src/lib/checkbox/atl-checkbox.d.ts.map +1 -1
- package/src/lib/checkbox/atl-checkbox.js +2 -1
- package/src/lib/checkbox/atl-checkbox.js.map +1 -1
- package/src/lib/combobox/atl-combobox.d.ts +39 -2
- package/src/lib/combobox/atl-combobox.d.ts.map +1 -1
- package/src/lib/combobox/atl-combobox.js +19 -3
- package/src/lib/combobox/atl-combobox.js.map +1 -1
- package/src/lib/error-message.d.ts +7 -0
- package/src/lib/error-message.d.ts.map +1 -0
- package/src/lib/error-message.js +8 -0
- package/src/lib/error-message.js.map +1 -0
- package/src/lib/input/atl-input.d.ts +22 -2
- 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.d.ts.map +1 -1
- package/src/lib/menu/atl-menu.js +99 -2
- package/src/lib/menu/atl-menu.js.map +1 -1
- package/src/lib/pagination/atl-pagination.d.ts +3 -1
- package/src/lib/pagination/atl-pagination.d.ts.map +1 -1
- package/src/lib/pagination/atl-pagination.js.map +1 -1
- package/src/lib/radio-group/atl-radio-group.d.ts +6 -2
- package/src/lib/radio-group/atl-radio-group.d.ts.map +1 -1
- package/src/lib/radio-group/atl-radio-group.js +2 -1
- package/src/lib/radio-group/atl-radio-group.js.map +1 -1
- package/src/lib/select/atl-select.d.ts +14 -2
- package/src/lib/select/atl-select.d.ts.map +1 -1
- package/src/lib/select/atl-select.js +2 -1
- package/src/lib/select/atl-select.js.map +1 -1
- package/src/lib/spec.d.ts +17 -0
- package/src/lib/spec.d.ts.map +1 -1
- package/src/lib/spec.js.map +1 -1
- package/src/lib/stepper/atl-stepper.d.ts +2 -1
- package/src/lib/stepper/atl-stepper.d.ts.map +1 -1
- package/src/lib/stepper/atl-stepper.js.map +1 -1
- package/src/lib/table/atl-table.d.ts +15 -0
- package/src/lib/table/atl-table.d.ts.map +1 -1
- package/src/lib/table/atl-table.js.map +1 -1
- package/src/lib/textarea/atl-textarea.d.ts +34 -2
- 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/toggle/atl-toggle.d.ts +18 -2
- package/src/lib/toggle/atl-toggle.d.ts.map +1 -1
- package/src/lib/toggle/atl-toggle.js +2 -1
- package/src/lib/toggle/atl-toggle.js.map +1 -1
- package/src/lib/tooltip/atl-tooltip.d.ts +22 -1
- package/src/lib/tooltip/atl-tooltip.d.ts.map +1 -1
- package/src/lib/tooltip/atl-tooltip.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atl-select.d.ts","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/select/atl-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,oBAAoB,EACpB,oBAAoB,EAErB,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"atl-select.d.ts","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/select/atl-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,oBAAoB,EACpB,oBAAoB,EAErB,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,0CAA0C,CAAC;AAClD,OAAO,iDAAiD,CAAC;AAIzD;;GAEG;AACH,MAAM,WAAW,cACf,SACE,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,EACnE,aAAa;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;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,aAAa,CAAC,MAAM,GAAG,YAAY,CAAC,CAAC;IAC9C;;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,+BAyDhB;AAED;;GAEG;AACH,MAAM,WAAW,cACf,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,aAAa;IAC9D;;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,6 +3,7 @@ import { useId, } from 'react';
|
|
|
3
3
|
import '@atelier-ui/styles/select/atl-select.css';
|
|
4
4
|
import '@atelier-ui/styles/select/atl-select.native.css';
|
|
5
5
|
import { AtlIcon } from '../icon/atl-icon';
|
|
6
|
+
import { errorMessage } from '../error-message';
|
|
6
7
|
/**
|
|
7
8
|
* A select component for choosing an option from a list.
|
|
8
9
|
*/
|
|
@@ -23,7 +24,7 @@ export function AtlSelect({ value = '', onValueChange, placeholder, invalid = fa
|
|
|
23
24
|
]
|
|
24
25
|
.filter(Boolean)
|
|
25
26
|
.join(' ');
|
|
26
|
-
return (_jsxs("div", { className: classes, children: [label && _jsx("label", { htmlFor: selectId, children: label }), _jsxs("div", { className: "select-wrapper", children: [_jsxs("select", { id: selectId, value: value, onChange: (e) => onValueChange?.(e.target.value), disabled: disabled, required: required, "aria-invalid": invalid || undefined, "aria-describedby": errors.length > 0 ? errorsId : undefined, ...rest, children: [placeholder && (_jsx("option", { value: "", disabled: true, hidden: true, children: placeholder })), children] }), invalid && (_jsx(AtlIcon, { name: "danger", size: "sm", className: "invalid-icon" })), _jsx("span", { className: "select-arrow", "aria-hidden": "true", children: _jsx(AtlIcon, { name: "chevron-down", size: "sm" }) })] }), errors.length > 0 && (_jsx("div", { className: "errors", id: errorsId, "aria-live": "polite", children: errors.map((err, i) => (_jsx("p", { className: "error-message", children: err }, i))) }))] }));
|
|
27
|
+
return (_jsxs("div", { className: classes, children: [label && _jsx("label", { htmlFor: selectId, children: label }), _jsxs("div", { className: "select-wrapper", children: [_jsxs("select", { id: selectId, value: value, onChange: (e) => onValueChange?.(e.target.value), disabled: disabled, required: required, "aria-invalid": invalid || undefined, "aria-describedby": errors.length > 0 ? errorsId : undefined, ...rest, children: [placeholder && (_jsx("option", { value: "", disabled: true, hidden: true, children: placeholder })), children] }), invalid && (_jsx(AtlIcon, { name: "danger", size: "sm", className: "invalid-icon" })), _jsx("span", { className: "select-arrow", "aria-hidden": "true", children: _jsx(AtlIcon, { name: "chevron-down", size: "sm" }) })] }), errors.length > 0 && (_jsx("div", { className: "errors", id: errorsId, "aria-live": "polite", children: errors.map((err, i) => (_jsx("p", { className: "error-message", children: errorMessage(err) }, i))) }))] }));
|
|
27
28
|
}
|
|
28
29
|
/**
|
|
29
30
|
* An individual option component for use within AtlSelect.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atl-select.js","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/select/atl-select.tsx"],"names":[],"mappings":";AAAA,OAAO,EAIL,KAAK,GACN,MAAM,OAAO,CAAC;AAEf,OAAO,0CAA0C,CAAC;AAClD,OAAO,iDAAiD,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"atl-select.js","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/select/atl-select.tsx"],"names":[],"mappings":";AAAA,OAAO,EAIL,KAAK,GACN,MAAM,OAAO,CAAC;AAEf,OAAO,0CAA0C,CAAC;AAClD,OAAO,iDAAiD,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AA+ChD;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,EACxB,KAAK,GAAG,EAAE,EACV,aAAa,EACb,WAAW,EACX,OAAO,GAAG,KAAK,EACf,MAAM,GAAG,EAAE,EACX,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,EAChB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,EAAE,EACF,GAAG,IAAI,EACQ;IACf,wEAAw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AAa,MAAM,YAC/C,KAAC,OAAO,IAAC,IAAI,EAAC,cAAc,EAAC,IAAI,EAAC,IAAI,GAAG,GACpC,IACH,EACL,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CACpB,cAAK,SAAS,EAAC,QAAQ,EAAC,EAAE,EAAE,QAAQ,eAAY,QAAQ,YACrD,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,CACP,CAAC;AACJ,CAAC;AAiBD;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAkB;IAC1E,OAAO,CACL,iBAAQ,KAAK,EAAE,WAAW,KAAM,IAAI,YACjC,QAAQ,GACF,CACV,CAAC;AACJ,CAAC","sourcesContent":["import {\n ReactNode,\n SelectHTMLAttributes,\n OptionHTMLAttributes,\n useId,\n} from 'react';\nimport type { AtlSelectSpec, AtlOptionSpec, AtlErrorItem } from '../spec';\nimport '@atelier-ui/styles/select/atl-select.css';\nimport '@atelier-ui/styles/select/atl-select.native.css';\nimport { AtlIcon } from '../icon/atl-icon';\nimport { errorMessage } from '../error-message';\n\n/**\n * Properties for the AtlSelect component.\n */\nexport interface AtlSelectProps\n extends\n Omit<SelectHTMLAttributes<HTMLSelectElement>, 'value' | 'onChange'>,\n AtlSelectSpec {\n /**\n * Whether the select is disabled.\n */\n disabled?: boolean;\n /**\n * Whether the select is required.\n */\n required?: boolean;\n /**\n * The select's name attribute, used for form submission.\n */\n name?: string;\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?: ReadonlyArray<string | AtlErrorItem>;\n /**\n * The label for the select.\n */\n label?: string;\n}\n\n/**\n * A select component for choosing an option from a list.\n */\nexport function AtlSelect({\n value = '',\n onValueChange,\n placeholder,\n invalid = false,\n errors = [],\n disabled = false,\n required = false,\n label,\n children,\n className,\n id,\n ...rest\n}: AtlSelectProps) {\n // useId(), not a slug derived from the label text: two selects with the\n // same label used to collide on one id and break the for/id association\n // (same bug as AtlInput's — see ADR-0091).\n const generatedId = useId();\n const selectId = id || (label ? `select-${generatedId}` : undefined);\n // Derived from the field id, the same way AtlInput derives its own, so the error\n // text can be pointed at with aria-describedby.\n const errorsId = selectId ? `${selectId}-errors` : undefined;\n const classes = [\n 'atl-select',\n invalid && 'is-invalid',\n disabled && 'is-disabled',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <div className={classes}>\n {label && <label htmlFor={selectId}>{label}</label>}\n <div className=\"select-wrapper\">\n <select\n id={selectId}\n value={value}\n onChange={(e) => onValueChange?.(e.target.value)}\n disabled={disabled}\n required={required}\n aria-invalid={invalid || undefined}\n aria-describedby={errors.length > 0 ? errorsId : undefined}\n {...rest}\n >\n {placeholder && (\n <option value=\"\" disabled hidden>\n {placeholder}\n </option>\n )}\n {children}\n </select>\n {invalid && (\n <AtlIcon name=\"danger\" size=\"sm\" className=\"invalid-icon\" />\n )}\n <span className=\"select-arrow\" aria-hidden=\"true\">\n <AtlIcon name=\"chevron-down\" size=\"sm\" />\n </span>\n </div>\n {errors.length > 0 && (\n <div className=\"errors\" id={errorsId} aria-live=\"polite\">\n {errors.map((err, i) => (\n <p key={i} className=\"error-message\">\n {errorMessage(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>, AtlOptionSpec {\n /**\n * The value of the option.\n */\n optionValue: string;\n /**\n * The content to be rendered inside the option.\n */\n children?: ReactNode;\n}\n\n/**\n * An individual option component for use within AtlSelect.\n */\nexport function AtlOption({ optionValue, children, ...rest }: AtlOptionProps) {\n return (\n <option value={optionValue} {...rest}>\n {children}\n </option>\n );\n}\n"]}
|
package/src/lib/spec.d.ts
CHANGED
|
@@ -71,7 +71,24 @@ export interface AtlCardSpec {
|
|
|
71
71
|
*/
|
|
72
72
|
role?: AtlCardRole;
|
|
73
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* One validation error. Structurally the same as Angular Signal Forms'
|
|
76
|
+
* `ValidationError` (`kind` plus an optional `message`), so Angular's
|
|
77
|
+
* `[formField]` binding passes its errors straight through, and React and Vue
|
|
78
|
+
* consumers can build the same shape by hand.
|
|
79
|
+
*/
|
|
80
|
+
export interface AtlErrorItem {
|
|
81
|
+
/** Identifies the kind of error, e.g. `'required'`. */
|
|
82
|
+
readonly kind: string;
|
|
83
|
+
/** Human readable message, rendered under the field. */
|
|
84
|
+
readonly message?: string;
|
|
85
|
+
}
|
|
74
86
|
export interface AtlFormFieldSpec {
|
|
87
|
+
/**
|
|
88
|
+
* Validation errors to show under the field. Angular takes Signal Forms'
|
|
89
|
+
* `ValidationError` objects; React and Vue take those objects or plain strings.
|
|
90
|
+
*/
|
|
91
|
+
errors?: ReadonlyArray<string | AtlErrorItem>;
|
|
75
92
|
value?: any;
|
|
76
93
|
onValueChange?: (value: any) => void;
|
|
77
94
|
disabled?: boolean;
|
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,CAA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,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB"}
|
package/src/lib/spec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spec.js","sourceRoot":"","sources":["../../../../../libs/react/src/lib/spec.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,4EAA4E;AAC5E,qEAAqE","sourcesContent":["// AUTO-GENERATED from libs/spec/src/index.ts — do not edit here.\n// Run `node tools/scripts/sync-spec.mjs` after editing the source of truth.\n// The framework libs inline this so @atelier-ui/spec stays internal.\n\n/**\n * @atelier-ui/spec\n *\n * Framework-agnostic TypeScript interfaces defining the public API contract\n * for every Atelier component. Both the Angular and React libraries\n * import from here so the compiler enforces parity.\n *\n * Angular: use the union types as `input<T>()` type parameters.\n * React: extend the spec interface from the framework-specific props interface.\n */\n\n// ---------------------------------------------------------------------------\n// Button\n// ---------------------------------------------------------------------------\nexport type AtlButtonVariant = 'primary' | 'secondary' | 'outline' | 'danger';\nexport type AtlButtonSize = 'sm' | 'md' | 'lg';\nexport interface AtlButtonSpec {\n variant?: AtlButtonVariant;\n size?: AtlButtonSize;\n disabled?: boolean;\n loading?: boolean;\n /**\n * Accessible name — rendered as `aria-label`. Required when the\n * button has no visible text label (icon-only buttons), otherwise\n * the button is unnamed for assistive tech. The React adapter\n * encodes this requirement at the type level via a discriminated\n * union; the Angular and Vue adapters log a dev-mode warning when\n * a rendered button has no accessible name.\n */\n 'aria-label'?: string;\n}\n\n// ---------------------------------------------------------------------------\n// Badge\n// ---------------------------------------------------------------------------\nexport type AtlBadgeVariant =\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 */\nexport interface AtlFormFieldSpec {\n value?: any;\n onValueChange?: (value: any) => void;\n disabled?: boolean;\n invalid?: boolean;\n required?: boolean;\n name?: string;\n}\n\n/**\n * `readonly` — the value is shown and submitted, but the user cannot change it.\n *\n * Deliberately NOT part of `AtlFormFieldSpec`. It used to be, and the four choice\n * controls that inherited it could not keep the promise: HTML ignores `readonly`\n * on `<input type=\"checkbox\">` and `<input type=\"radio\">`, and\n * `HTMLSelectElement` has no `readOnly` property at all — measured, the user\n * still flipped the control and `onCheckedChange` still fired. A prop that\n * silently does nothing is worse than an absent one, so this mixin is applied\n * only where the state is actually enforced: natively by the text fields, and by\n * an explicit guard in AtlCombobox and AtlRadioGroup. See ADR-0045.\n */\nexport interface AtlReadonlySpec {\n readonly?: boolean;\n}\n\n/**\n * Visible caption rendered as a `<label>` associated with the control via\n * `for`/`id`. When omitted, the control renders with no visible caption —\n * supply an external `<label>` or an `aria-label` at the call site in that\n * case, or the control has no accessible name.\n *\n * Deliberately NOT merged into `AtlFormFieldSpec`. Two of that mixin's\n * consumers project their caption as CONTENT rather than a string prop —\n * `AtlCheckboxSpec`/`AtlToggleSpec` take it as `children`/`<ng-content>`/\n * `<slot>` — so inheriting `label` there would be a second, unused, and\n * actively misleading way to say the same thing. Two more,\n * `AtlRadioGroupSpec` and `AtlComboboxSpec`, have no caption prop in any\n * adapter today, so applying it there would be speculative. Applied only\n * where a `label` prop actually exists in at least one adapter today —\n * `AtlInputSpec`, `AtlTextareaSpec`, `AtlSelectSpec` — three occurrences,\n * which is what justifies pulling it out as its own mixin instead of leaving\n * it three separate, easy-to-let-drift declarations (see ADR-0091, which\n * also documents the one-off reading this mixin corrects).\n */\nexport interface AtlCaptionSpec {\n label?: string;\n}\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\nexport type AtlInputType =\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\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"]}
|
|
@@ -27,8 +27,9 @@ export interface AtlStepperProps extends HTMLAttributes<HTMLDivElement>, AtlStep
|
|
|
27
27
|
onActiveStepChange?: (index: number) => void;
|
|
28
28
|
/** Layout orientation. */
|
|
29
29
|
orientation?: 'horizontal' | 'vertical';
|
|
30
|
-
/** Restrict forward navigation until previous steps
|
|
30
|
+
/** Restrict forward navigation until every previous step is completed or `optional`: optional steps can be passed. */
|
|
31
31
|
linear?: boolean;
|
|
32
|
+
/** The `AtlStep` elements, in order, plus any step content. */
|
|
32
33
|
children?: ReactNode;
|
|
33
34
|
}
|
|
34
35
|
export declare function AtlStepper({ activeStep: externalStep, onActiveStepChange, orientation, linear, children, className, ...rest }: AtlStepperProps): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atl-stepper.d.ts","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/stepper/atl-stepper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,SAAS,EACT,cAAc,EAKf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,4CAA4C,CAAC;AAGpD,UAAU,QAAQ;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,UAAU,mBAAmB;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,IAAI,IAAI,CAAC;IACb,IAAI,IAAI,IAAI,CAAC;IACb,IAAI,C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,cAAc;IACtD,mCAAmC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6CAA6C;IAC7C,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,0BAA0B;IAC1B,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC,sHAAsH;IACtH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,wBAAgB,UAAU,CAAC,EACzB,UAAU,EAAE,YAAY,EACxB,kBAAkB,EAClB,WAA0B,EAC1B,MAAc,EACd,QAAQ,EACR,SAAS,EACT,GAAG,IAAI,EACR,EAAE,eAAe,+BAmKjB;AAED,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC/C,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,yBAAyB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iCAAiC;IACjC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,wBAAwB;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,wBAAgB,OAAO,CAAC,EAAE,QAAQ,EAAE,EAAE,YAAY,aAEjD;yBAFe,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atl-stepper.js","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/stepper/atl-stepper.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,QAAQ,EACR,aAAa,EACb,UAAU,EACV,QAAQ,EAGR,QAAQ,EACR,cAAc,EACd,OAAO,GAER,MAAM,OAAO,CAAC;AAEf,OAAO,4CAA4C,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAA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wCAChB,CAAC,UAAU,GAAG,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,WAAW;qCAClD;yCACE,MAAM,CAAC,OAAO,CAAC;yCACf,IAAI,CAAC,GAAG,CAAC,GACZ,CACH,KAzCY,CAAC,CA0CL,CACZ,CAAC;oBACJ,CAAC,CAAC,GACC,EACL,cAAK,SAAS,EAAC,iBAAiB,YAC7B,UAAU,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;wBAC3B,MAAM,OAAO,GAAG,KAAmC,CAAC;wBACpD,OAAO,CACL,cAEE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,YAAY,qBACL,YAAY,CAAC,EAAE,EAChC,MAAM,EAAE,CAAC,KAAK,UAAU,YAEvB,OAAO,CAAC,KAAK,CAAC,QAAQ,IANlB,CAAC,CAOF,CACP,CAAC;oBACJ,CAAC,CAAC,GACE,IACF,GACkB,CAC3B,CAAC;AACJ,CAAC;AAkBD,MAAM,UAAU,OAAO,CAAC,EAAE,QAAQ,EAAgB;IAChD,OAAO,QAAQ,CAAC;AAClB,CAAC;AACD,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC","sourcesContent":["import {\n Fragment,\n createContext,\n useContext,\n useState,\n ReactNode,\n HTMLAttributes,\n Children,\n isValidElement,\n useMemo,\n ReactElement,\n} from 'react';\nimport type { AtlStepperSpec, AtlStepSpec } from '../spec';\nimport '@atelier-ui/styles/stepper/atl-stepper.css';\nimport { AtlIcon } from '../icon/atl-icon';\n\ninterface StepInfo {\n label: string;\n description?: string;\n completed: boolean;\n error: boolean;\n optional: boolean;\n disabled: boolean;\n}\n\ninterface StepperContextValue {\n activeStep: number;\n setActiveStep: (i: number) => void;\n steps: StepInfo[];\n linear: boolean;\n next(): void;\n prev(): void;\n goTo(i: number): void;\n}\n\nconst StepperContext = createContext<StepperContextValue>({\n activeStep: 0,\n setActiveStep: () => undefined,\n steps: [],\n linear: false,\n next: () => undefined,\n prev: () => undefined,\n goTo: () => undefined,\n});\n\n/** Access stepper navigation from within step content. */\nexport function useAtlStepper() {\n return useContext(StepperContext);\n}\n\nexport interface AtlStepperProps\n extends HTMLAttributes<HTMLDivElement>, AtlStepperSpec {\n /** Currently active step index. */\n activeStep?: number;\n /** Callback when the active step changes. */\n onActiveStepChange?: (index: number) => void;\n /** Layout orientation. */\n orientation?: 'horizontal' | 'vertical';\n /** Restrict forward navigation until previous steps are completed. */\n linear?: boolean;\n children?: ReactNode;\n}\n\nexport function AtlStepper({\n activeStep: externalStep,\n onActiveStepChange,\n orientation = 'horizontal',\n linear = false,\n children,\n className,\n ...rest\n}: AtlStepperProps) {\n const [internalStep, setInternalStep] = useState(externalStep ?? 0);\n const isControlled = externalStep !== undefined;\n const activeStep = isControlled ? externalStep : internalStep;\n\n const setStep = (i: number) => {\n if (!isControlled) setInternalStep(i);\n onActiveStepChange?.(i);\n };\n\n const childArray = Children.toArray(children);\n const steps: StepInfo[] = useMemo(\n () =>\n childArray\n .filter(\n (c) =>\n isValidElement(c) &&\n (c.type as { displayName?: string }).displayName === 'AtlStep',\n )\n .map((c) => {\n const element = c as ReactElement<AtlStepProps>;\n return {\n label: element.props.label ?? '',\n description: element.props.description,\n completed: element.props.completed ?? false,\n error: element.props.error ?? false,\n optional: element.props.optional ?? false,\n disabled: element.props.disabled ?? false,\n };\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [children],\n );\n\n // Whether step `i` can be activated right now: not itself disabled, and — in\n // linear mode — either at/behind the active step, or ahead of it with every\n // step before it completed or optional. Drives both goTo()'s guard and the\n // header button's native `disabled` state, so an unreachable step is also\n // not focusable — no roving-tabindex bookkeeping needed, since the header is\n // a list, not a tab widget.\n const isReachable = (i: number) => {\n const step = steps[i];\n if (!step || step.disabled) return false;\n if (!linear) return true;\n if (i <= activeStep) return true;\n return steps.slice(0, i).every((s) => s.completed || s.optional);\n };\n\n const goTo = (i: number) => {\n if (i < 0 || i >= steps.length) return;\n if (!isReachable(i)) return;\n setStep(i);\n };\n\n const next = () => goTo(activeStep + 1);\n const prev = () => {\n const p = activeStep - 1;\n if (p >= 0 && !steps[p]?.disabled) setStep(p);\n };\n\n const classes = ['atl-stepper', `orientation-${orientation}`, className]\n .filter(Boolean)\n .join(' ');\n\n const stepPanels = childArray.filter(\n (c) =>\n isValidElement(c) &&\n (c.type as { displayName?: string }).displayName === 'AtlStep',\n );\n\n return (\n <StepperContext.Provider\n value={{\n activeStep,\n setActiveStep: setStep,\n steps,\n linear,\n next,\n prev,\n goTo,\n }}\n >\n <div className={classes} {...rest}>\n <ol className=\"stepper-header\" role=\"list\" aria-label=\"Progress\">\n {steps.map((step, i) => {\n const isActive = activeStep === i;\n const isCompleted = step.completed && !isActive;\n const itemClass = [\n 'step-item',\n isActive && 'is-active',\n isCompleted && 'is-completed',\n step.error && 'is-error',\n step.disabled && 'is-disabled',\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <Fragment key={i}>\n <li className={itemClass}>\n <button\n type=\"button\"\n id={`atl-step-${i}`}\n className=\"step-circle\"\n aria-label={step.label}\n aria-current={isActive ? 'step' : undefined}\n disabled={!isReachable(i)}\n onClick={() => goTo(i)}\n >\n {step.completed && !step.error ? (\n <AtlIcon name=\"check\" size=\"sm\" />\n ) : step.error ? (\n <AtlIcon name=\"close\" size=\"sm\" />\n ) : (\n i + 1\n )}\n </button>\n <div className=\"step-text\">\n <span className=\"step-label\">{step.label}</span>\n {step.description && (\n <span className=\"step-description\">\n {step.description}\n </span>\n )}\n {step.optional && !step.completed && (\n <span className=\"step-optional\">Optional</span>\n )}\n </div>\n </li>\n {i < steps.length - 1 && (\n <li\n aria-hidden=\"true\"\n className={[\n 'step-connector',\n (activeStep > i || step.completed) && 'is-active',\n ]\n .filter(Boolean)\n .join(' ')}\n />\n )}\n </Fragment>\n );\n })}\n </ol>\n <div className=\"stepper-content\">\n {stepPanels.map((panel, i) => {\n const element = panel as ReactElement<AtlStepProps>;\n return (\n <div\n key={i}\n role=\"region\"\n className=\"step-panel\"\n aria-labelledby={`atl-step-${i}`}\n hidden={i !== activeStep}\n >\n {element.props.children}\n </div>\n );\n })}\n </div>\n </div>\n </StepperContext.Provider>\n );\n}\n\nexport interface AtlStepProps extends AtlStepSpec {\n /** Text displayed on the step indicator. Required. */\n label: string;\n /** Optional subtitle. */\n description?: string;\n /** Mark as completed (shows checkmark). */\n completed?: boolean;\n /** Mark as errored (shows X). */\n error?: boolean;\n /** Mark as optional. */\n optional?: boolean;\n /** Whether the step is disabled. */\n disabled?: boolean;\n children?: ReactNode;\n}\n\nexport function AtlStep({ children }: AtlStepProps) {\n return children;\n}\nAtlStep.displayName = 'AtlStep';\n"]}
|
|
1
|
+
{"version":3,"file":"atl-stepper.js","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/stepper/atl-stepper.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,QAAQ,EACR,aAAa,EACb,UAAU,EACV,QAAQ,EAGR,QAAQ,EACR,cAAc,EACd,OAAO,GAER,MAAM,OAAO,CAAC;AAEf,OAAO,4CAA4C,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAqB3C,MAAM,cAAc,GAAG,aAAa,CAAsB;IACxD,UAAU,EAAE,CAAC;IACb,aAAa,EAAE,GAAG,EAAE,CAAC,SAAS;IAC9B,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,GAAG,EAAE,CAAC,SAAS;IACrB,IAAI,EAAE,GAAG,EAAE,CAAC,SAAS;IACrB,IAAI,EAAE,GAAG,EAAE,CAAC,SAAS;CACtB,CAAC,CAAC;AAEH,0DAA0D;AAC1D,MAAM,UAAU,aAAa;IAC3B,OAAO,UAAU,CAAC,cAAc,CAAC,CAAC;AACpC,CAAC;AAgBD,MAAM,UAAU,UAAU,CAAC,EACzB,UAAU,EAAE,YAAY,EACxB,kBAAkB,EAClB,WAAW,GAAG,YAAY,EAC1B,MAAM,GAAG,KAAK,EACd,QAAQ,E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;oBACJ,CAAC,CAAC,GACE,IACF,GACkB,CAC3B,CAAC;AACJ,CAAC;AAkBD,MAAM,UAAU,OAAO,CAAC,EAAE,QAAQ,EAAgB;IAChD,OAAO,QAAQ,CAAC;AAClB,CAAC;AACD,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC","sourcesContent":["import {\n Fragment,\n createContext,\n useContext,\n useState,\n ReactNode,\n HTMLAttributes,\n Children,\n isValidElement,\n useMemo,\n ReactElement,\n} from 'react';\nimport type { AtlStepperSpec, AtlStepSpec } from '../spec';\nimport '@atelier-ui/styles/stepper/atl-stepper.css';\nimport { AtlIcon } from '../icon/atl-icon';\n\ninterface StepInfo {\n label: string;\n description?: string;\n completed: boolean;\n error: boolean;\n optional: boolean;\n disabled: boolean;\n}\n\ninterface StepperContextValue {\n activeStep: number;\n setActiveStep: (i: number) => void;\n steps: StepInfo[];\n linear: boolean;\n next(): void;\n prev(): void;\n goTo(i: number): void;\n}\n\nconst StepperContext = createContext<StepperContextValue>({\n activeStep: 0,\n setActiveStep: () => undefined,\n steps: [],\n linear: false,\n next: () => undefined,\n prev: () => undefined,\n goTo: () => undefined,\n});\n\n/** Access stepper navigation from within step content. */\nexport function useAtlStepper() {\n return useContext(StepperContext);\n}\n\nexport interface AtlStepperProps\n extends HTMLAttributes<HTMLDivElement>, AtlStepperSpec {\n /** Currently active step index. */\n activeStep?: number;\n /** Callback when the active step changes. */\n onActiveStepChange?: (index: number) => void;\n /** Layout orientation. */\n orientation?: 'horizontal' | 'vertical';\n /** Restrict forward navigation until every previous step is completed or `optional`: optional steps can be passed. */\n linear?: boolean;\n /** The `AtlStep` elements, in order, plus any step content. */\n children?: ReactNode;\n}\n\nexport function AtlStepper({\n activeStep: externalStep,\n onActiveStepChange,\n orientation = 'horizontal',\n linear = false,\n children,\n className,\n ...rest\n}: AtlStepperProps) {\n const [internalStep, setInternalStep] = useState(externalStep ?? 0);\n const isControlled = externalStep !== undefined;\n const activeStep = isControlled ? externalStep : internalStep;\n\n const setStep = (i: number) => {\n if (!isControlled) setInternalStep(i);\n onActiveStepChange?.(i);\n };\n\n const childArray = Children.toArray(children);\n const steps: StepInfo[] = useMemo(\n () =>\n childArray\n .filter(\n (c) =>\n isValidElement(c) &&\n (c.type as { displayName?: string }).displayName === 'AtlStep',\n )\n .map((c) => {\n const element = c as ReactElement<AtlStepProps>;\n return {\n label: element.props.label ?? '',\n description: element.props.description,\n completed: element.props.completed ?? false,\n error: element.props.error ?? false,\n optional: element.props.optional ?? false,\n disabled: element.props.disabled ?? false,\n };\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [children],\n );\n\n // Whether step `i` can be activated right now: not itself disabled, and — in\n // linear mode — either at/behind the active step, or ahead of it with every\n // step before it completed or optional. Drives both goTo()'s guard and the\n // header button's native `disabled` state, so an unreachable step is also\n // not focusable — no roving-tabindex bookkeeping needed, since the header is\n // a list, not a tab widget.\n const isReachable = (i: number) => {\n const step = steps[i];\n if (!step || step.disabled) return false;\n if (!linear) return true;\n if (i <= activeStep) return true;\n return steps.slice(0, i).every((s) => s.completed || s.optional);\n };\n\n const goTo = (i: number) => {\n if (i < 0 || i >= steps.length) return;\n if (!isReachable(i)) return;\n setStep(i);\n };\n\n const next = () => goTo(activeStep + 1);\n const prev = () => {\n const p = activeStep - 1;\n if (p >= 0 && !steps[p]?.disabled) setStep(p);\n };\n\n const classes = ['atl-stepper', `orientation-${orientation}`, className]\n .filter(Boolean)\n .join(' ');\n\n const stepPanels = childArray.filter(\n (c) =>\n isValidElement(c) &&\n (c.type as { displayName?: string }).displayName === 'AtlStep',\n );\n\n return (\n <StepperContext.Provider\n value={{\n activeStep,\n setActiveStep: setStep,\n steps,\n linear,\n next,\n prev,\n goTo,\n }}\n >\n <div className={classes} {...rest}>\n <ol className=\"stepper-header\" role=\"list\" aria-label=\"Progress\">\n {steps.map((step, i) => {\n const isActive = activeStep === i;\n const isCompleted = step.completed && !isActive;\n const itemClass = [\n 'step-item',\n isActive && 'is-active',\n isCompleted && 'is-completed',\n step.error && 'is-error',\n step.disabled && 'is-disabled',\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <Fragment key={i}>\n <li className={itemClass}>\n <button\n type=\"button\"\n id={`atl-step-${i}`}\n className=\"step-circle\"\n aria-label={step.label}\n aria-current={isActive ? 'step' : undefined}\n disabled={!isReachable(i)}\n onClick={() => goTo(i)}\n >\n {step.completed && !step.error ? (\n <AtlIcon name=\"check\" size=\"sm\" />\n ) : step.error ? (\n <AtlIcon name=\"close\" size=\"sm\" />\n ) : (\n i + 1\n )}\n </button>\n <div className=\"step-text\">\n <span className=\"step-label\">{step.label}</span>\n {step.description && (\n <span className=\"step-description\">\n {step.description}\n </span>\n )}\n {step.optional && !step.completed && (\n <span className=\"step-optional\">Optional</span>\n )}\n </div>\n </li>\n {i < steps.length - 1 && (\n <li\n aria-hidden=\"true\"\n className={[\n 'step-connector',\n (activeStep > i || step.completed) && 'is-active',\n ]\n .filter(Boolean)\n .join(' ')}\n />\n )}\n </Fragment>\n );\n })}\n </ol>\n <div className=\"stepper-content\">\n {stepPanels.map((panel, i) => {\n const element = panel as ReactElement<AtlStepProps>;\n return (\n <div\n key={i}\n role=\"region\"\n className=\"step-panel\"\n aria-labelledby={`atl-step-${i}`}\n hidden={i !== activeStep}\n >\n {element.props.children}\n </div>\n );\n })}\n </div>\n </div>\n </StepperContext.Provider>\n );\n}\n\nexport interface AtlStepProps extends AtlStepSpec {\n /** Text displayed on the step indicator. Required. */\n label: string;\n /** Optional subtitle. */\n description?: string;\n /** Mark as completed (shows checkmark). */\n completed?: boolean;\n /** Mark as errored (shows X). */\n error?: boolean;\n /** Mark as optional. */\n optional?: boolean;\n /** Whether the step is disabled. */\n disabled?: boolean;\n children?: ReactNode;\n}\n\nexport function AtlStep({ children }: AtlStepProps) {\n return children;\n}\nAtlStep.displayName = 'AtlStep';\n"]}
|
|
@@ -3,6 +3,21 @@ import type { AtlTableSpec, AtlTbodySpec, AtlTrSpec, AtlThSpec, AtlTdSpec, AtlSo
|
|
|
3
3
|
import '@atelier-ui/styles/table/atl-table.css';
|
|
4
4
|
export type { AtlSortDirection };
|
|
5
5
|
export interface AtlTableProps extends HTMLAttributes<HTMLDivElement>, AtlTableSpec {
|
|
6
|
+
/**
|
|
7
|
+
* Visual style of the table rows.
|
|
8
|
+
*/
|
|
9
|
+
variant?: 'default' | 'striped' | 'bordered';
|
|
10
|
+
/**
|
|
11
|
+
* Row density: the vertical padding of cells.
|
|
12
|
+
*/
|
|
13
|
+
size?: 'sm' | 'md' | 'lg';
|
|
14
|
+
/**
|
|
15
|
+
* Whether the header row sticks to the top when the table scrolls.
|
|
16
|
+
*/
|
|
17
|
+
stickyHeader?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The table sections: `AtlThead` and `AtlTbody` elements.
|
|
20
|
+
*/
|
|
6
21
|
children?: ReactNode;
|
|
7
22
|
/**
|
|
8
23
|
* Accessible name for the scrollable table region. Surfaces to
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atl-table.d.ts","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/table/atl-table.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,SAAS,EACT,SAAS,EACT,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAEjB,OAAO,wCAAwC,CAAC;AAGhD,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAMjC,MAAM,WAAW,aACf,SAAQ,cAAc,CAAC,cAAc,CAAC,EAAE,YAAY;IACpD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,QAAQ,CAAC,EACvB,OAAmB,EACnB,IAAW,EACX,YAAoB,EACpB,QAAQ,EACR,SAAS,EACT,YAAY,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CAAC,EACvB,KAAa,EACb,OAAW,EACX,QAAQ,EACR,YAAY,GACb,EAAE,aAAa,+BAcf;AAMD,MAAM,WAAW,UAAW,SAAQ,SAAS;IAC3C,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;CAChD;AAED,wBAAgB,KAAK,CAAC,EACpB,QAAgB,EAChB,UAAkB,EAClB,QAAQ,EACR,gBAAgB,GACjB,EAAE,UAAU,+BAcZ;AAMD,MAAM,WAAW,UACf,SAAQ,IAAI,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC,EAAE,SAAS;IACxE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAChD;AAED,wBAAgB,KAAK,CAAC,EACpB,QAAgB,EAChB,aAAoB,EACpB,KAAe,EACf,KAAK,EACL,QAAQ,EACR,MAAM,EACN,SAAS,EACT,GAAG,IAAI,EACR,EAAE,UAAU,+BAsDZ;AAMD,MAAM,WAAW,UACf,SAAQ,IAAI,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC,EAAE,SAAS;IACxE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,wBAAgB,KAAK,CAAC,EACpB,KAAe,EACf,QAAQ,EACR,SAAS,EACT,GAAG,IAAI,EACR,EAAE,UAAU,+BAOZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atl-table.js","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/table/atl-table.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,wCAAwC,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"atl-table.js","sourceRoot":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AAO,CACL,0BACa,QAAQ,EACnB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,EACpC,SAAS,EAAE,OAAO,KACd,IAAI,YAEP,QAAQ,CAAC,CAAC,CAAC,CACV,kBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAC,iBAAiB,EAAC,OAAO,EAAE,SAAS,aACjE,QAAQ,EACT,gBAAM,SAAS,EAAC,kBAAkB,iBAAa,MAAM,aACnD,KAAC,OAAO,IACN,IAAI,EAAC,UAAU,EACf,IAAI,EAAC,IAAI,EACT,SAAS,EAAC,uBAAuB,GACjC,EACF,KAAC,OAAO,IACN,IAAI,EAAC,WAAW,EAChB,IAAI,EAAC,IAAI,EACT,SAAS,EAAC,wBAAwB,GAClC,IACG,IACA,CACV,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,GACE,CACN,CAAC;AACJ,CAAC;AAWD,MAAM,UAAU,KAAK,CAAC,EACpB,KAAK,GAAG,OAAO,EACf,QAAQ,EACR,SAAS,EACT,GAAG,IAAI,EACI;IACX,MAAM,OAAO,GAAG,CAAC,SAAS,KAAK,EAAE,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACxE,OAAO,CACL,aAAI,SAAS,EAAE,OAAO,KAAM,IAAI,YAC7B,QAAQ,GACN,CACN,CAAC;AACJ,CAAC","sourcesContent":["import {\n HTMLAttributes,\n ReactNode,\n TdHTMLAttributes,\n ThHTMLAttributes,\n} from 'react';\nimport type {\n AtlTableSpec,\n AtlTbodySpec,\n AtlTrSpec,\n AtlThSpec,\n AtlTdSpec,\n AtlSortDirection,\n} from '../spec';\nimport { AtlCheckbox } from '../checkbox/atl-checkbox';\nimport '@atelier-ui/styles/table/atl-table.css';\nimport { AtlIcon } from '../icon/atl-icon';\n\nexport type { AtlSortDirection };\n\n// ---------------------------------------------------------------------------\n// AtlTable\n// ---------------------------------------------------------------------------\n\nexport interface AtlTableProps\n extends HTMLAttributes<HTMLDivElement>, AtlTableSpec {\n /**\n * Visual style of the table rows.\n */\n variant?: 'default' | 'striped' | 'bordered';\n /**\n * Row density: the vertical padding of cells.\n */\n size?: 'sm' | 'md' | 'lg';\n /**\n * Whether the header row sticks to the top when the table scrolls.\n */\n stickyHeader?: boolean;\n /**\n * The table sections: `AtlThead` and `AtlTbody` elements.\n */\n children?: ReactNode;\n /**\n * Accessible name for the scrollable table region. Surfaces to\n * screen readers as the region's label so keyboard users who\n * scroll the wrapper know what they're scrolling. Defaults to\n * `\"Table\"` if unset.\n */\n 'aria-label'?: string;\n}\n\nexport function AtlTable({\n variant = 'default',\n size = 'md',\n stickyHeader = false,\n children,\n className,\n 'aria-label': ariaLabel,\n ...rest\n}: AtlTableProps) {\n const classes = [\n 'atl-table',\n `variant-${variant}`,\n `size-${size}`,\n stickyHeader && 'is-sticky-header',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <div className={classes} {...rest}>\n {/* The wrapper is the scrollable region — give it tabindex=0 so\n * keyboard users can scroll horizontally through wide tables.\n * role=region + aria-label expose it as a labelled landmark for\n * screen readers (axe rule: scrollable-region-focusable). */}\n <div\n className=\"atl-table-wrapper\"\n tabIndex={0}\n role=\"region\"\n aria-label={ariaLabel ?? 'Table'}\n >\n <table>{children}</table>\n </div>\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// AtlThead\n// ---------------------------------------------------------------------------\n\nexport interface AtlTheadProps {\n children?: ReactNode;\n}\n\nexport function AtlThead({ children }: AtlTheadProps) {\n return <thead>{children}</thead>;\n}\n\n// ---------------------------------------------------------------------------\n// AtlTbody\n// ---------------------------------------------------------------------------\n\nexport interface AtlTbodyProps extends AtlTbodySpec {\n children?: ReactNode;\n /** Content shown in place of rows when empty=true. */\n emptyContent?: ReactNode;\n}\n\nexport function AtlTbody({\n empty = false,\n colSpan = 1,\n children,\n emptyContent,\n}: AtlTbodyProps) {\n return (\n <tbody>\n {!empty ? (\n children\n ) : (\n <tr>\n <td colSpan={colSpan} className=\"atl-tbody-empty-cell\">\n {emptyContent}\n </td>\n </tr>\n )}\n </tbody>\n );\n}\n\n// ---------------------------------------------------------------------------\n// AtlTr\n// ---------------------------------------------------------------------------\n\nexport interface AtlTrProps extends AtlTrSpec {\n children?: ReactNode;\n onSelectedChange?: (selected: boolean) => void;\n}\n\nexport function AtlTr({\n selected = false,\n selectable = false,\n children,\n onSelectedChange,\n}: AtlTrProps) {\n return (\n <tr\n aria-selected={selectable ? selected : undefined}\n className={selected ? 'is-selected' : undefined}\n >\n {selectable && (\n <td className=\"atl-tr-select-cell\">\n <AtlCheckbox checked={selected} onCheckedChange={onSelectedChange} />\n </td>\n )}\n {children}\n </tr>\n );\n}\n\n// ---------------------------------------------------------------------------\n// AtlTh\n// ---------------------------------------------------------------------------\n\nexport interface AtlThProps\n extends Omit<ThHTMLAttributes<HTMLTableCellElement>, 'align'>, AtlThSpec {\n children?: ReactNode;\n onSort?: (direction: AtlSortDirection) => void;\n}\n\nexport function AtlTh({\n sortable = false,\n sortDirection = null,\n align = 'start',\n width,\n children,\n onSort,\n className,\n ...rest\n}: AtlThProps) {\n const classes =\n [\n `align-${align}`,\n sortDirection && 'is-sorted',\n sortDirection === 'asc' && 'sort-asc',\n sortDirection === 'desc' && 'sort-desc',\n className,\n ]\n .filter(Boolean)\n .join(' ') || undefined;\n\n const ariaSort = sortable\n ? sortDirection === 'asc'\n ? 'ascending'\n : sortDirection === 'desc'\n ? 'descending'\n : 'none'\n : undefined;\n\n function cycleSort() {\n const next: AtlSortDirection =\n sortDirection === null ? 'asc' : sortDirection === 'asc' ? 'desc' : null;\n onSort?.(next);\n }\n\n return (\n <th\n aria-sort={ariaSort}\n style={width ? { width } : undefined}\n className={classes}\n {...rest}\n >\n {sortable ? (\n <button type=\"button\" className=\"atl-th-sort-btn\" onClick={cycleSort}>\n {children}\n <span className=\"atl-th-sort-icon\" aria-hidden=\"true\">\n <AtlIcon\n name=\"sort-asc\"\n size=\"sm\"\n className=\"atl-th-sort-asc-arrow\"\n />\n <AtlIcon\n name=\"sort-desc\"\n size=\"sm\"\n className=\"atl-th-sort-desc-arrow\"\n />\n </span>\n </button>\n ) : (\n children\n )}\n </th>\n );\n}\n\n// ---------------------------------------------------------------------------\n// AtlTd\n// ---------------------------------------------------------------------------\n\nexport interface AtlTdProps\n extends Omit<TdHTMLAttributes<HTMLTableCellElement>, 'align'>, AtlTdSpec {\n children?: ReactNode;\n}\n\nexport function AtlTd({\n align = 'start',\n children,\n className,\n ...rest\n}: AtlTdProps) {\n const classes = [`align-${align}`, className].filter(Boolean).join(' ');\n return (\n <td className={classes} {...rest}>\n {children}\n </td>\n );\n}\n"]}
|
|
@@ -1,10 +1,42 @@
|
|
|
1
1
|
import { TextareaHTMLAttributes } from 'react';
|
|
2
|
-
import type { AtlTextareaSpec } from '../spec';
|
|
2
|
+
import type { AtlTextareaSpec, AtlErrorItem } from '../spec';
|
|
3
3
|
import '@atelier-ui/styles/textarea/atl-textarea.css';
|
|
4
4
|
/**
|
|
5
5
|
* Properties for the AtlTextarea component.
|
|
6
6
|
*/
|
|
7
7
|
export interface AtlTextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'readOnly'>, AtlTextareaSpec {
|
|
8
|
+
/**
|
|
9
|
+
* Whether the textarea is disabled.
|
|
10
|
+
*/
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the textarea has validation errors.
|
|
14
|
+
*/
|
|
15
|
+
invalid?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the textarea is required.
|
|
18
|
+
*/
|
|
19
|
+
required?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The textarea's name attribute, used for form submission.
|
|
22
|
+
*/
|
|
23
|
+
name?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Lowercase alias of `readOnly`: whether the textarea is read-only. `readOnly` wins when both are set.
|
|
26
|
+
*/
|
|
27
|
+
readonly?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Number of visible text rows.
|
|
30
|
+
*/
|
|
31
|
+
rows?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Placeholder text shown when the textarea is empty.
|
|
34
|
+
*/
|
|
35
|
+
placeholder?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the textarea height grows automatically to fit its content.
|
|
38
|
+
*/
|
|
39
|
+
autoResize?: boolean;
|
|
8
40
|
/**
|
|
9
41
|
* Current value of the textarea.
|
|
10
42
|
*/
|
|
@@ -20,7 +52,7 @@ export interface AtlTextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAr
|
|
|
20
52
|
/**
|
|
21
53
|
* List of error messages to display.
|
|
22
54
|
*/
|
|
23
|
-
errors?: string
|
|
55
|
+
errors?: ReadonlyArray<string | AtlErrorItem>;
|
|
24
56
|
/**
|
|
25
57
|
* Label text for the textarea.
|
|
26
58
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atl-textarea.d.ts","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/textarea/atl-textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAA4B,MAAM,OAAO,CAAC;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"atl-textarea.d.ts","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/textarea/atl-textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAA4B,MAAM,OAAO,CAAC;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,8CAA8C,CAAC;AAItD;;GAEG;AACH,MAAM,WAAW,gBACf,SACE,IAAI,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,EAAE,UAAU,CAAC,EAC7D,eAAe;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;OAEG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,YAAY,CAAC,CAAC;IAC9C;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,aAAa,EACb,OAAe,EACf,MAAW,EACX,QAAgB,EAChB,QAAQ,EAAE,aAAa,EACvB,QAAQ,EAAE,YAAY,EACtB,QAAgB,EAChB,KAAK,EACL,UAAkB,EAClB,IAAQ,EACR,SAAS,EACT,EAAE,EACF,GAAG,IAAI,EACR,EAAE,gBAAgB,+BAuElB"}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef, useEffect, useId } from 'react';
|
|
3
3
|
import '@atelier-ui/styles/textarea/atl-textarea.css';
|
|
4
4
|
import { AtlIcon } from '../icon/atl-icon';
|
|
5
|
+
import { errorMessage } from '../error-message';
|
|
5
6
|
/**
|
|
6
7
|
* A multi-line text input component that supports automatic resizing and validation states.
|
|
7
8
|
*/
|
|
@@ -39,6 +40,6 @@ export function AtlTextarea({ value, onChange, onValueChange, invalid = false, e
|
|
|
39
40
|
}
|
|
40
41
|
};
|
|
41
42
|
const errorId = inputId ? `${inputId}-errors` : undefined;
|
|
42
|
-
return (_jsxs("div", { className: classes, children: [label && _jsx("label", { htmlFor: inputId, children: label }), _jsxs("div", { className: "textarea-field", children: [_jsx("textarea", { ref: textareaRef, id: inputId, value: value, onChange: handleChange, disabled: disabled, readOnly: readOnly, required: required, rows: rows, "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))) }))] }));
|
|
43
|
+
return (_jsxs("div", { className: classes, children: [label && _jsx("label", { htmlFor: inputId, children: label }), _jsxs("div", { className: "textarea-field", children: [_jsx("textarea", { ref: textareaRef, id: inputId, value: value, onChange: handleChange, disabled: disabled, readOnly: readOnly, required: required, rows: rows, "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: errorMessage(err) }, i))) }))] }));
|
|
43
44
|
}
|
|
44
45
|
//# sourceMappingURL=atl-textarea.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atl-textarea.js","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/textarea/atl-textarea.tsx"],"names":[],"mappings":";AAAA,OAAO,EAA0B,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,8CAA8C,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE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M,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,KACrD,IAAI,GACR,EACD,OAAO,IAAI,CACV,KAAC,OAAO,IAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,cAAc,GAAG,CAC7D,IACG,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,YAAY,CAAC,GAAG,CAAC,IADZ,CAAC,CAEL,CACL,CAAC,GACE,CACP,IACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { TextareaHTMLAttributes, useRef, useEffect, useId } from 'react';\nimport type { AtlTextareaSpec, AtlErrorItem } from '../spec';\nimport '@atelier-ui/styles/textarea/atl-textarea.css';\nimport { AtlIcon } from '../icon/atl-icon';\nimport { errorMessage } from '../error-message';\n\n/**\n * Properties for the AtlTextarea component.\n */\nexport interface AtlTextareaProps\n extends\n Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'readOnly'>,\n AtlTextareaSpec {\n /**\n * Whether the textarea is disabled.\n */\n disabled?: boolean;\n /**\n * Whether the textarea has validation errors.\n */\n invalid?: boolean;\n /**\n * Whether the textarea is required.\n */\n required?: boolean;\n /**\n * The textarea's name attribute, used for form submission.\n */\n name?: string;\n /**\n * Lowercase alias of `readOnly`: whether the textarea is read-only. `readOnly` wins when both are set.\n */\n readonly?: boolean;\n /**\n * Number of visible text rows.\n */\n rows?: number;\n /**\n * Placeholder text shown when the textarea is empty.\n */\n placeholder?: string;\n /**\n * Whether the textarea height grows automatically to fit its content.\n */\n autoResize?: boolean;\n /**\n * Current value of the textarea.\n */\n value?: string;\n /**\n * Whether the textarea is read-only.\n */\n readOnly?: boolean;\n /**\n * Callback fired when the value changes.\n */\n onValueChange?: (value: string) => void;\n /**\n * List of error messages to display.\n */\n errors?: ReadonlyArray<string | AtlErrorItem>;\n /**\n * Label text for the textarea.\n */\n label?: string;\n}\n\n/**\n * A multi-line text input component that supports automatic resizing and validation states.\n */\nexport function AtlTextarea({\n value,\n onChange,\n onValueChange,\n invalid = false,\n errors = [],\n disabled = false,\n readOnly: reactReadOnly,\n readonly: specReadOnly,\n required = false,\n label,\n autoResize = false,\n rows = 3,\n className,\n id,\n ...rest\n}: AtlTextareaProps) {\n const readOnly = reactReadOnly ?? specReadOnly ?? false;\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n // useId(), not a slug derived from the label text: two textareas with the\n // same label used to collide on one id and break the for/id association\n // (same bug as AtlInput's — see ADR-0091).\n const generatedId = useId();\n const inputId = id || (label ? `textarea-${generatedId}` : undefined);\n const classes = [\n 'atl-textarea',\n invalid && 'is-invalid',\n disabled && 'is-disabled',\n readOnly && 'is-readonly',\n autoResize && 'is-auto-resize',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n useEffect(() => {\n if (autoResize && textareaRef.current) {\n const el = textareaRef.current;\n el.style.height = 'auto';\n el.style.height = `${el.scrollHeight}px`;\n }\n }, [value, autoResize]);\n\n const handleChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n onChange?.(e);\n onValueChange?.(e.target.value);\n if (autoResize && textareaRef.current) {\n textareaRef.current.style.height = 'auto';\n textareaRef.current.style.height = `${textareaRef.current.scrollHeight}px`;\n }\n };\n\n const errorId = inputId ? `${inputId}-errors` : undefined;\n\n return (\n <div className={classes}>\n {label && <label htmlFor={inputId}>{label}</label>}\n <div className=\"textarea-field\">\n <textarea\n ref={textareaRef}\n id={inputId}\n value={value}\n onChange={handleChange}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n rows={rows}\n aria-invalid={invalid || undefined}\n aria-required={required || undefined}\n aria-describedby={errors.length > 0 ? errorId : undefined}\n {...rest}\n />\n {invalid && (\n <AtlIcon name=\"danger\" size=\"sm\" className=\"invalid-icon\" />\n )}\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 {errorMessage(err)}\n </p>\n ))}\n </div>\n )}\n </div>\n );\n}\n"]}
|
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import type { AtlToggleSpec } from '../spec';
|
|
2
|
+
import type { AtlToggleSpec, AtlErrorItem } from '../spec';
|
|
3
3
|
import '@atelier-ui/styles/toggle/atl-toggle.css';
|
|
4
4
|
/**
|
|
5
5
|
* Properties for the AtlToggle component.
|
|
6
6
|
*/
|
|
7
7
|
export interface AtlToggleProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'checked' | 'onChange' | 'readOnly' | 'value'>, AtlToggleSpec {
|
|
8
|
+
/**
|
|
9
|
+
* Whether the toggle is on. Controlled: pair it with `onCheckedChange`.
|
|
10
|
+
*/
|
|
11
|
+
checked?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Whether the toggle has validation errors.
|
|
14
|
+
*/
|
|
15
|
+
invalid?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the toggle is disabled.
|
|
18
|
+
*/
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Whether the toggle is required.
|
|
22
|
+
*/
|
|
23
|
+
required?: boolean;
|
|
8
24
|
/**
|
|
9
25
|
* Callback fired when the checked state changes.
|
|
10
26
|
*/
|
|
@@ -12,7 +28,7 @@ export interface AtlToggleProps extends Omit<InputHTMLAttributes<HTMLInputElemen
|
|
|
12
28
|
/**
|
|
13
29
|
* List of error messages to display.
|
|
14
30
|
*/
|
|
15
|
-
errors?: string
|
|
31
|
+
errors?: ReadonlyArray<string | AtlErrorItem>;
|
|
16
32
|
/**
|
|
17
33
|
* Optional content to display alongside the toggle.
|
|
18
34
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atl-toggle.d.ts","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/toggle/atl-toggle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAS,MAAM,OAAO,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"atl-toggle.d.ts","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/toggle/atl-toggle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAS,MAAM,OAAO,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,0CAA0C,CAAC;AAGlD;;GAEG;AACH,MAAM,WAAW,cACf,SACE,IAAI,CACF,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,CACvD,EACD,aAAa;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C;;OAEG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC,MAAM,GAAG,YAAY,CAAC,CAAC;IAC9C;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,EACxB,OAAe,EACf,eAAe,EACf,OAAe,EACf,MAAW,EACX,QAAgB,EAChB,QAAgB,EAChB,QAAQ,EACR,SAAS,EACT,EAAE,EACF,IAAI,EACJ,GAAG,IAAI,EACR,EAAE,cAAc,+BAiDhB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useId } from 'react';
|
|
3
3
|
import '@atelier-ui/styles/toggle/atl-toggle.css';
|
|
4
|
+
import { errorMessage } from '../error-message';
|
|
4
5
|
/**
|
|
5
6
|
* A toggle switch component for binary choices, supporting validation and custom labels.
|
|
6
7
|
*/
|
|
@@ -17,6 +18,6 @@ export function AtlToggle({ checked = false, onCheckedChange, invalid = false, e
|
|
|
17
18
|
]
|
|
18
19
|
.filter(Boolean)
|
|
19
20
|
.join(' ');
|
|
20
|
-
return (_jsxs("div", { className: classes, children: [_jsxs("label", { htmlFor: inputId, children: [_jsx("input", { type: "checkbox", role: "switch", id: inputId, checked: checked, onChange: (e) => onCheckedChange?.(e.target.checked), disabled: disabled, required: required, "aria-checked": checked, "aria-invalid": invalid || undefined, "aria-required": required || undefined, "aria-describedby": errors.length > 0 ? errorId : undefined, name: name, ...rest }), _jsx("span", { className: "track", "aria-hidden": "true", children: _jsx("span", { className: "thumb" }) }), children] }), 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))) }))] }));
|
|
21
|
+
return (_jsxs("div", { className: classes, children: [_jsxs("label", { htmlFor: inputId, children: [_jsx("input", { type: "checkbox", role: "switch", id: inputId, checked: checked, onChange: (e) => onCheckedChange?.(e.target.checked), disabled: disabled, required: required, "aria-checked": checked, "aria-invalid": invalid || undefined, "aria-required": required || undefined, "aria-describedby": errors.length > 0 ? errorId : undefined, name: name, ...rest }), _jsx("span", { className: "track", "aria-hidden": "true", children: _jsx("span", { className: "thumb" }) }), children] }), errors.length > 0 && (_jsx("div", { className: "errors", id: errorId, "aria-live": "polite", children: errors.map((err, i) => (_jsx("p", { className: "error-message", children: errorMessage(err) }, i))) }))] }));
|
|
21
22
|
}
|
|
22
23
|
//# sourceMappingURL=atl-toggle.js.map
|