@atelier-ui/react 0.3.9 → 0.3.11

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.
Files changed (56) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/package.json +2 -2
  3. package/src/index.d.ts +1 -0
  4. package/src/index.d.ts.map +1 -1
  5. package/src/index.js.map +1 -1
  6. package/src/lib/breadcrumbs/atl-breadcrumbs.d.ts +8 -1
  7. package/src/lib/breadcrumbs/atl-breadcrumbs.d.ts.map +1 -1
  8. package/src/lib/breadcrumbs/atl-breadcrumbs.js +24 -9
  9. package/src/lib/breadcrumbs/atl-breadcrumbs.js.map +1 -1
  10. package/src/lib/checkbox/atl-checkbox.d.ts +2 -2
  11. package/src/lib/checkbox/atl-checkbox.d.ts.map +1 -1
  12. package/src/lib/checkbox/atl-checkbox.js +2 -1
  13. package/src/lib/checkbox/atl-checkbox.js.map +1 -1
  14. package/src/lib/combobox/atl-combobox.d.ts +2 -2
  15. package/src/lib/combobox/atl-combobox.d.ts.map +1 -1
  16. package/src/lib/combobox/atl-combobox.js +19 -3
  17. package/src/lib/combobox/atl-combobox.js.map +1 -1
  18. package/src/lib/error-message.d.ts +7 -0
  19. package/src/lib/error-message.d.ts.map +1 -0
  20. package/src/lib/error-message.js +8 -0
  21. package/src/lib/error-message.js.map +1 -0
  22. package/src/lib/input/atl-input.d.ts +2 -2
  23. package/src/lib/input/atl-input.d.ts.map +1 -1
  24. package/src/lib/input/atl-input.js +2 -1
  25. package/src/lib/input/atl-input.js.map +1 -1
  26. package/src/lib/menu/atl-menu.d.ts.map +1 -1
  27. package/src/lib/menu/atl-menu.js +101 -3
  28. package/src/lib/menu/atl-menu.js.map +1 -1
  29. package/src/lib/pagination/atl-pagination.d.ts +3 -1
  30. package/src/lib/pagination/atl-pagination.d.ts.map +1 -1
  31. package/src/lib/pagination/atl-pagination.js.map +1 -1
  32. package/src/lib/radio-group/atl-radio-group.d.ts +2 -2
  33. package/src/lib/radio-group/atl-radio-group.d.ts.map +1 -1
  34. package/src/lib/radio-group/atl-radio-group.js +2 -1
  35. package/src/lib/radio-group/atl-radio-group.js.map +1 -1
  36. package/src/lib/select/atl-select.d.ts +2 -2
  37. package/src/lib/select/atl-select.d.ts.map +1 -1
  38. package/src/lib/select/atl-select.js +2 -1
  39. package/src/lib/select/atl-select.js.map +1 -1
  40. package/src/lib/spec.d.ts +17 -0
  41. package/src/lib/spec.d.ts.map +1 -1
  42. package/src/lib/spec.js.map +1 -1
  43. package/src/lib/stepper/atl-stepper.d.ts +1 -1
  44. package/src/lib/stepper/atl-stepper.d.ts.map +1 -1
  45. package/src/lib/stepper/atl-stepper.js.map +1 -1
  46. package/src/lib/textarea/atl-textarea.d.ts +2 -2
  47. package/src/lib/textarea/atl-textarea.d.ts.map +1 -1
  48. package/src/lib/textarea/atl-textarea.js +2 -1
  49. package/src/lib/textarea/atl-textarea.js.map +1 -1
  50. package/src/lib/toggle/atl-toggle.d.ts +2 -2
  51. package/src/lib/toggle/atl-toggle.d.ts.map +1 -1
  52. package/src/lib/toggle/atl-toggle.js +2 -1
  53. package/src/lib/toggle/atl-toggle.js.map +1 -1
  54. package/src/lib/tooltip/atl-tooltip.d.ts +2 -1
  55. package/src/lib/tooltip/atl-tooltip.d.ts.map +1 -1
  56. package/src/lib/tooltip/atl-tooltip.js.map +1 -1
@@ -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,7 +27,7 @@ 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 are completed. */
30
+ /** Restrict forward navigation until every previous step is completed or `optional`: optional steps can be passed. */
31
31
  linear?: boolean;
32
32
  /** The `AtlStep` elements, in order, plus any step content. */
33
33
  children?: ReactNode;
@@ -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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AAC;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,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,M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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 /** 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"]}
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,EACR,SAAS,EACT,GAAG,IAAI,EACS;IAChB,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,YAAY,IAAI,CAAC,CAAC,CAAC;IACpE,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Q,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"]}
@@ -1,5 +1,5 @@
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.
@@ -52,7 +52,7 @@ export interface AtlTextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAr
52
52
  /**
53
53
  * List of error messages to display.
54
54
  */
55
- errors?: string[];
55
+ errors?: ReadonlyArray<string | AtlErrorItem>;
56
56
  /**
57
57
  * Label text for the textarea.
58
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;AAC/C,OAAO,8CAA8C,CAAC;AAGtD;;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,MAAM,EAAE,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,aAAa,EACb,OAAe,EACf,MAAW,EACX,QAAgB,EAChB,QAAQ,EAAE,aAAa,EACvB,QAAQ,EAAE,YAAY,EACtB,QAAgB,EAChB,KAAK,EACL,UAAkB,EAClB,IAAQ,EACR,SAAS,EACT,EAAE,EACF,GAAG,IAAI,EACR,EAAE,gBAAgB,+BAuElB"}
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,MAAM,kBAAkB,CAAC;AA+D3C;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,aAAa,EACb,OAAO,GAAG,KAAK,EACf,MAAM,GAAG,EAAE,EACX,QAAQ,GAAG,KAAK,EAChB,QAAQ,EAAE,aAAa,EACvB,QAAQ,EAAE,YAAY,EACtB,QAAQ,GAAG,KAAK,EAChB,KAAK,EACL,UAAU,GAAG,KAAK,EAClB,IAAI,GAAG,CAAC,EACR,SAAS,EACT,EAAE,EACF,GAAG,IAAI,EACU;IACjB,MAAM,QAAQ,GAAG,aAAa,IAAI,YAAY,IAAI,KAAK,CAAC;IACxD,MAAM,WAAW,GAAG,MAAM,CAAsB,IAAI,CAAC,CAAC;IACtD,0EAA0E;IAC1E,wEAAwE;IACxE,2CAA2C;IAC3C,MAAM,WAAW,GAAG,KAAK,EAAE,CAAC;IAC5B,MAAM,OAAO,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACtE,MAAM,OAAO,GAAG;QACd,c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,EAAE,KAAK,EACZ,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,kBACI,OAAO,IAAI,SAAS,mBACnB,QAAQ,IAAI,SAAS,sBAClB,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,KACrD,IAAI,GACR,EACD,OAAO,IAAI,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,GAAG,IADE,CAAC,CAEL,CACL,CAAC,GACE,CACP,IACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { TextareaHTMLAttributes, useRef, useEffect, useId } from 'react';\nimport type { AtlTextareaSpec } from '../spec';\nimport '@atelier-ui/styles/textarea/atl-textarea.css';\nimport { AtlIcon } from '../icon/atl-icon';\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?: string[];\n /**\n * Label text for the textarea.\n */\n label?: string;\n}\n\n/**\n * A multi-line text input component that supports automatic resizing and validation states.\n */\nexport function AtlTextarea({\n value,\n onChange,\n onValueChange,\n invalid = false,\n errors = [],\n disabled = false,\n readOnly: reactReadOnly,\n readonly: specReadOnly,\n required = false,\n label,\n autoResize = false,\n rows = 3,\n className,\n id,\n ...rest\n}: AtlTextareaProps) {\n const readOnly = reactReadOnly ?? specReadOnly ?? false;\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n // useId(), not a slug derived from the label text: two textareas with the\n // same label used to collide on one id and break the for/id association\n // (same bug as AtlInput's — see ADR-0091).\n const generatedId = useId();\n const inputId = id || (label ? `textarea-${generatedId}` : undefined);\n const classes = [\n 'atl-textarea',\n invalid && 'is-invalid',\n disabled && 'is-disabled',\n readOnly && 'is-readonly',\n autoResize && 'is-auto-resize',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n useEffect(() => {\n if (autoResize && textareaRef.current) {\n const el = textareaRef.current;\n el.style.height = 'auto';\n el.style.height = `${el.scrollHeight}px`;\n }\n }, [value, autoResize]);\n\n const handleChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n onChange?.(e);\n onValueChange?.(e.target.value);\n if (autoResize && textareaRef.current) {\n textareaRef.current.style.height = 'auto';\n textareaRef.current.style.height = `${textareaRef.current.scrollHeight}px`;\n }\n };\n\n const errorId = inputId ? `${inputId}-errors` : undefined;\n\n return (\n <div className={classes}>\n {label && <label htmlFor={inputId}>{label}</label>}\n <div className=\"textarea-field\">\n <textarea\n ref={textareaRef}\n id={inputId}\n value={value}\n onChange={handleChange}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n rows={rows}\n aria-invalid={invalid || undefined}\n aria-required={required || undefined}\n aria-describedby={errors.length > 0 ? errorId : undefined}\n {...rest}\n />\n {invalid && (\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 {err}\n </p>\n ))}\n </div>\n )}\n </div>\n );\n}\n"]}
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,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AA+DhD;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,aAAa,EACb,OAAO,GAAG,KAAK,EACf,MAAM,GAAG,EAAE,EACX,QAAQ,GAAG,KAAK,EAChB,QAAQ,EAAE,aAAa,EACvB,QAAQ,EAAE,YAAY,EACtB,QAAQ,GAAG,KAAK,EAChB,KAAK,EACL,UAAU,GAAG,KAAK,EAClB,IAAI,GAAG,CAAC,EACR,SAAS,EACT,EAAE,EACF,GAAG,IAAI,EACU;IACjB,MAAM,QAAQ,GAAG,aAAa,IAAI,YAAY,IAAI,KAAK,CAAC;IACxD,MAAM,WAAW,GAAG,MAAM,CAAsB,IAAI,CAAC,CAAC;IACtD,0EAA0E;IAC1E,wEAAwE;IACxE,2CAA2C;IAC3C,MAAM,WAAW,GAAG,KAAK,EAAE,CAAC;IAC5B,MAAM,OAAO,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAA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,SAAS,EAAC,gBAAgB,aAC7B,mBACE,GAAG,EAAE,WAAW,EAChB,EAAE,EAAE,OAAO,EACX,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,kBACI,OAAO,IAAI,SAAS,mBACnB,QAAQ,IAAI,SAAS,sBAClB,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,KACrD,IAAI,GACR,EACD,OAAO,IAAI,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,5 +1,5 @@
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.
@@ -28,7 +28,7 @@ export interface AtlToggleProps extends Omit<InputHTMLAttributes<HTMLInputElemen
28
28
  /**
29
29
  * List of error messages to display.
30
30
  */
31
- errors?: string[];
31
+ errors?: ReadonlyArray<string | AtlErrorItem>;
32
32
  /**
33
33
  * Optional content to display alongside the toggle.
34
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;AAC7C,OAAO,0CAA0C,CAAC;AAElD;;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,MAAM,EAAE,CAAC;IAClB;;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
+ {"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
@@ -1 +1 @@
1
- {"version":3,"file":"atl-toggle.js","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/toggle/atl-toggle.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkC,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9D,OAAO,0CAA0C,CAAC;AA0ClD;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,EACxB,OAAO,GAAG,KAAK,EACf,eAAe,EACf,OAAO,GAAG,KAAK,EACf,MAAM,GAAG,EAAE,EACX,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,EAChB,QAAQ,EACR,SAAS,EACT,EAAE,EACF,IAAI,EACJ,GAAG,IAAI,EACQ;IACf,MAAM,WAAW,GAAG,KAAK,EAAE,CAAC;IAC5B,MAAM,OAAO,GAAG,EAAE,IAAI,UAAU,WAAW,EAAE,CAAC;IAC9C,MAAM,OAAO,GAAG,GAAG,OAAO,SAAS,CAAC;IAEpC,MAAM,OAAO,GAAG;QACd,YAAY;QACZ,OAAO,IAAI,YAAY;QACvB,OAAO,IAAI,YAAY;QACvB,QAAQ,IAAI,aAAa;QACzB,SAAS;KACV;SACE,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,CACL,eAAK,SAAS,EAAE,OAAO,aACrB,iBAAO,OAAO,EAAE,OAAO,aACrB,gBACE,IAAI,EAAC,UAAU,EACf,IAAI,EAAC,QAAQ,EACb,EAAE,EAAE,OAAO,EACX,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EACpD,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,kBACJ,OAAO,kBACP,OAAO,IAAI,SAAS,mBACnB,QAAQ,IAAI,SAAS,sBAClB,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EACzD,IAAI,EAAE,IAAI,KACN,IAAI,GACR,EACF,eAAM,SAAS,EAAC,OAAO,iBAAa,MAAM,YACxC,eAAM,SAAS,EAAC,OAAO,GAAG,GACrB,EACN,QAAQ,IACH,EACP,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CACpB,cAAK,SAAS,EAAC,QAAQ,EAAC,EAAE,EAAE,OAAO,eAAY,QAAQ,YACpD,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,YAAW,SAAS,EAAC,eAAe,YACjC,GAAG,IADE,CAAC,CAEL,CACL,CAAC,GACE,CACP,IACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { InputHTMLAttributes, ReactNode, useId } from 'react';\nimport type { AtlToggleSpec } from '../spec';\nimport '@atelier-ui/styles/toggle/atl-toggle.css';\n\n/**\n * Properties for the AtlToggle component.\n */\nexport interface AtlToggleProps\n extends\n Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'type' | 'checked' | 'onChange' | 'readOnly' | 'value'\n >,\n AtlToggleSpec {\n /**\n * Whether the toggle is on. Controlled: pair it with `onCheckedChange`.\n */\n checked?: boolean;\n /**\n * Whether the toggle has validation errors.\n */\n invalid?: boolean;\n /**\n * Whether the toggle is disabled.\n */\n disabled?: boolean;\n /**\n * Whether the toggle is required.\n */\n required?: boolean;\n /**\n * Callback fired when the checked state changes.\n */\n onCheckedChange?: (checked: boolean) => void;\n /**\n * List of error messages to display.\n */\n errors?: string[];\n /**\n * Optional content to display alongside the toggle.\n */\n children?: ReactNode;\n}\n\n/**\n * A toggle switch component for binary choices, supporting validation and custom labels.\n */\nexport function AtlToggle({\n checked = false,\n onCheckedChange,\n invalid = false,\n errors = [],\n disabled = false,\n required = false,\n children,\n className,\n id,\n name,\n ...rest\n}: AtlToggleProps) {\n const generatedId = useId();\n const inputId = id || `toggle-${generatedId}`;\n const errorId = `${inputId}-errors`;\n\n const classes = [\n 'atl-toggle',\n checked && 'is-checked',\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 htmlFor={inputId}>\n <input\n type=\"checkbox\"\n role=\"switch\"\n id={inputId}\n checked={checked}\n onChange={(e) => onCheckedChange?.(e.target.checked)}\n disabled={disabled}\n required={required}\n aria-checked={checked}\n aria-invalid={invalid || undefined}\n aria-required={required || undefined}\n aria-describedby={errors.length > 0 ? errorId : undefined}\n name={name}\n {...rest}\n />\n <span className=\"track\" aria-hidden=\"true\">\n <span className=\"thumb\" />\n </span>\n {children}\n </label>\n {errors.length > 0 && (\n <div className=\"errors\" id={errorId} aria-live=\"polite\">\n {errors.map((err, i) => (\n <p key={i} className=\"error-message\">\n {err}\n </p>\n ))}\n </div>\n )}\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"atl-toggle.js","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/toggle/atl-toggle.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkC,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9D,OAAO,0CAA0C,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AA0ChD;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,EACxB,OAAO,GAAG,KAAK,EACf,eAAe,EACf,OAAO,GAAG,KAAK,EACf,MAAM,GAAG,EAAE,EACX,QAAQ,G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AE,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 { InputHTMLAttributes, ReactNode, useId } from 'react';\nimport type { AtlToggleSpec, AtlErrorItem } from '../spec';\nimport '@atelier-ui/styles/toggle/atl-toggle.css';\nimport { errorMessage } from '../error-message';\n\n/**\n * Properties for the AtlToggle component.\n */\nexport interface AtlToggleProps\n extends\n Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'type' | 'checked' | 'onChange' | 'readOnly' | 'value'\n >,\n AtlToggleSpec {\n /**\n * Whether the toggle is on. Controlled: pair it with `onCheckedChange`.\n */\n checked?: boolean;\n /**\n * Whether the toggle has validation errors.\n */\n invalid?: boolean;\n /**\n * Whether the toggle is disabled.\n */\n disabled?: boolean;\n /**\n * Whether the toggle is required.\n */\n required?: boolean;\n /**\n * Callback fired when the checked state changes.\n */\n onCheckedChange?: (checked: boolean) => void;\n /**\n * List of error messages to display.\n */\n errors?: ReadonlyArray<string | AtlErrorItem>;\n /**\n * Optional content to display alongside the toggle.\n */\n children?: ReactNode;\n}\n\n/**\n * A toggle switch component for binary choices, supporting validation and custom labels.\n */\nexport function AtlToggle({\n checked = false,\n onCheckedChange,\n invalid = false,\n errors = [],\n disabled = false,\n required = false,\n children,\n className,\n id,\n name,\n ...rest\n}: AtlToggleProps) {\n const generatedId = useId();\n const inputId = id || `toggle-${generatedId}`;\n const errorId = `${inputId}-errors`;\n\n const classes = [\n 'atl-toggle',\n checked && 'is-checked',\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 htmlFor={inputId}>\n <input\n type=\"checkbox\"\n role=\"switch\"\n id={inputId}\n checked={checked}\n onChange={(e) => onCheckedChange?.(e.target.checked)}\n disabled={disabled}\n required={required}\n aria-checked={checked}\n aria-invalid={invalid || undefined}\n aria-required={required || undefined}\n aria-describedby={errors.length > 0 ? errorId : undefined}\n name={name}\n {...rest}\n />\n <span className=\"track\" aria-hidden=\"true\">\n <span className=\"thumb\" />\n </span>\n {children}\n </label>\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"]}
@@ -11,7 +11,8 @@ export interface AtlTooltipProps extends AtlTooltipSpec {
11
11
  */
12
12
  atlTooltip: string;
13
13
  /**
14
- * Preferred tooltip placement. Falls back to the opposite side if clipped.
14
+ * Preferred tooltip placement. Applied as a fixed CSS class: it does not flip
15
+ * when clipped; Angular's CDK overlay does.
15
16
  */
16
17
  atlTooltipPosition?: AtlTooltipPosition;
17
18
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"atl-tooltip.d.ts","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/tooltip/atl-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,SAAS,EAAS,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,4CAA4C,CAAC;AACpD,OAAO,mDAAmD,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,cAAc;IACrD;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,EACzB,UAAU,EACV,kBAA4B,EAC5B,kBAA0B,EAC1B,mBAAyB,EACzB,mBAAuB,EACvB,QAAQ,GACT,EAAE,eAAe,+BAiFjB"}
1
+ {"version":3,"file":"atl-tooltip.d.ts","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/tooltip/atl-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,SAAS,EAAS,MAAM,OAAO,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,4CAA4C,CAAC;AACpD,OAAO,mDAAmD,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,cAAc;IACrD;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,EACzB,UAAU,EACV,kBAA4B,EAC5B,kBAA0B,EAC1B,mBAAyB,EACzB,mBAAuB,EACvB,QAAQ,GACT,EAAE,eAAe,+BAiFjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"atl-tooltip.js","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/tooltip/atl-tooltip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAa,KAAK,EAAE,MAAM,OAAO,CAAC;AAEtE,OAAO,4CAA4C,CAAC;AACpD,OAAO,mDAAmD,CAAC;AAgC3D;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,UAAU,EACV,kBAAkB,GAAG,OAAO,EAC5B,kBAAkB,GAAG,KAAK,EA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,OAAO,IAAI,CAAC,kBAAkB,IAAI,UAAU,IAAI,CAC/C,cACE,EAAE,EAAE,SAAS,EACb,IAAI,EAAC,SAAS,EACd,SAAS,EAAE,wBAAwB,kBAAkB,EAAE,YAEtD,UAAU,GACP,CACP,IACI,CACR,CAAC;AACJ,CAAC","sourcesContent":["import { useState, useRef, useEffect, ReactNode, useId } from 'react';\nimport type { AtlTooltipSpec, AtlTooltipPosition } from '../spec';\nimport '@atelier-ui/styles/tooltip/atl-tooltip.css';\nimport '@atelier-ui/styles/tooltip/atl-tooltip.native.css';\n\n/**\n * Properties for the AtlTooltip component.\n */\nexport interface AtlTooltipProps extends AtlTooltipSpec {\n /**\n * The tooltip text.\n */\n atlTooltip: string;\n /**\n * Preferred tooltip placement. Falls back to the opposite side if clipped.\n */\n atlTooltipPosition?: AtlTooltipPosition;\n /**\n * Disables the tooltip without removing the wrapper.\n */\n atlTooltipDisabled?: boolean;\n /**\n * Delay in ms before the tooltip appears.\n */\n atlTooltipShowDelay?: number;\n /**\n * Delay in ms before the tooltip hides.\n */\n atlTooltipHideDelay?: number;\n /**\n * The content to trigger the tooltip.\n */\n children: ReactNode;\n}\n\n/**\n * A tooltip component that displays additional information when the trigger is hovered or focused.\n */\nexport function AtlTooltip({\n atlTooltip,\n atlTooltipPosition = 'above',\n atlTooltipDisabled = false,\n atlTooltipShowDelay = 300,\n atlTooltipHideDelay = 0,\n children,\n}: AtlTooltipProps) {\n const [visible, setVisible] = useState(false);\n const showTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const hideTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const wrapperRef = useRef<HTMLSpanElement>(null);\n const id = useId();\n const tooltipId = `tooltip-${id}`;\n\n const show = () => {\n if (atlTooltipDisabled || !atlTooltip) return;\n if (hideTimer.current) {\n clearTimeout(hideTimer.current);\n hideTimer.current = null;\n }\n if (!visible) {\n showTimer.current = setTimeout(() => {\n showTimer.current = null;\n setVisible(true);\n }, atlTooltipShowDelay);\n }\n };\n\n const hide = () => {\n if (showTimer.current) {\n clearTimeout(showTimer.current);\n showTimer.current = null;\n }\n hideTimer.current = setTimeout(() => {\n hideTimer.current = null;\n setVisible(false);\n }, atlTooltipHideDelay);\n };\n\n // Set aria-describedby on the child element\n useEffect(() => {\n const el = wrapperRef.current?.firstElementChild as HTMLElement | null;\n if (el && visible) {\n el.setAttribute('aria-describedby', tooltipId);\n } else if (el) {\n el.removeAttribute('aria-describedby');\n }\n }, [visible, tooltipId]);\n\n // Handle Escape key to dismiss\n useEffect(() => {\n const keyHandler = (e: globalThis.KeyboardEvent) => {\n if (e.key === 'Escape') setVisible(false);\n };\n document.addEventListener('keydown', keyHandler);\n return () => document.removeEventListener('keydown', keyHandler);\n }, []);\n\n // Cleanup timers on unmount\n useEffect(() => {\n return () => {\n if (showTimer.current) clearTimeout(showTimer.current);\n if (hideTimer.current) clearTimeout(hideTimer.current);\n };\n }, []);\n\n return (\n <span\n ref={wrapperRef}\n className=\"atl-tooltip-wrapper\"\n onMouseEnter={show}\n onMouseLeave={hide}\n onFocus={show}\n onBlur={hide}\n >\n {children}\n {visible && !atlTooltipDisabled && atlTooltip && (\n <div\n id={tooltipId}\n role=\"tooltip\"\n className={`atl-tooltip position-${atlTooltipPosition}`}\n >\n {atlTooltip}\n </div>\n )}\n </span>\n );\n}\n"]}
1
+ {"version":3,"file":"atl-tooltip.js","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/tooltip/atl-tooltip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAa,KAAK,EAAE,MAAM,OAAO,CAAC;AAEtE,OAAO,4CAA4C,CAAC;AACpD,OAAO,mDAAmD,CAAC;AAiC3D;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,EACzB,UAAU,EACV,kBAAkB,GAAG,OAAO,EAC5B,kBAAkB,GAAG,KAAK,EAC1B,mBAAmB,GAAG,GAAG,EACzB,mBAAmB,GAAG,CAAC,EACv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E,EAAE,EAAE,SAAS,EACb,IAAI,EAAC,SAAS,EACd,SAAS,EAAE,wBAAwB,kBAAkB,EAAE,YAEtD,UAAU,GACP,CACP,IACI,CACR,CAAC;AACJ,CAAC","sourcesContent":["import { useState, useRef, useEffect, ReactNode, useId } from 'react';\nimport type { AtlTooltipSpec, AtlTooltipPosition } from '../spec';\nimport '@atelier-ui/styles/tooltip/atl-tooltip.css';\nimport '@atelier-ui/styles/tooltip/atl-tooltip.native.css';\n\n/**\n * Properties for the AtlTooltip component.\n */\nexport interface AtlTooltipProps extends AtlTooltipSpec {\n /**\n * The tooltip text.\n */\n atlTooltip: string;\n /**\n * Preferred tooltip placement. Applied as a fixed CSS class: it does not flip\n * when clipped; Angular's CDK overlay does.\n */\n atlTooltipPosition?: AtlTooltipPosition;\n /**\n * Disables the tooltip without removing the wrapper.\n */\n atlTooltipDisabled?: boolean;\n /**\n * Delay in ms before the tooltip appears.\n */\n atlTooltipShowDelay?: number;\n /**\n * Delay in ms before the tooltip hides.\n */\n atlTooltipHideDelay?: number;\n /**\n * The content to trigger the tooltip.\n */\n children: ReactNode;\n}\n\n/**\n * A tooltip component that displays additional information when the trigger is hovered or focused.\n */\nexport function AtlTooltip({\n atlTooltip,\n atlTooltipPosition = 'above',\n atlTooltipDisabled = false,\n atlTooltipShowDelay = 300,\n atlTooltipHideDelay = 0,\n children,\n}: AtlTooltipProps) {\n const [visible, setVisible] = useState(false);\n const showTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const hideTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const wrapperRef = useRef<HTMLSpanElement>(null);\n const id = useId();\n const tooltipId = `tooltip-${id}`;\n\n const show = () => {\n if (atlTooltipDisabled || !atlTooltip) return;\n if (hideTimer.current) {\n clearTimeout(hideTimer.current);\n hideTimer.current = null;\n }\n if (!visible) {\n showTimer.current = setTimeout(() => {\n showTimer.current = null;\n setVisible(true);\n }, atlTooltipShowDelay);\n }\n };\n\n const hide = () => {\n if (showTimer.current) {\n clearTimeout(showTimer.current);\n showTimer.current = null;\n }\n hideTimer.current = setTimeout(() => {\n hideTimer.current = null;\n setVisible(false);\n }, atlTooltipHideDelay);\n };\n\n // Set aria-describedby on the child element\n useEffect(() => {\n const el = wrapperRef.current?.firstElementChild as HTMLElement | null;\n if (el && visible) {\n el.setAttribute('aria-describedby', tooltipId);\n } else if (el) {\n el.removeAttribute('aria-describedby');\n }\n }, [visible, tooltipId]);\n\n // Handle Escape key to dismiss\n useEffect(() => {\n const keyHandler = (e: globalThis.KeyboardEvent) => {\n if (e.key === 'Escape') setVisible(false);\n };\n document.addEventListener('keydown', keyHandler);\n return () => document.removeEventListener('keydown', keyHandler);\n }, []);\n\n // Cleanup timers on unmount\n useEffect(() => {\n return () => {\n if (showTimer.current) clearTimeout(showTimer.current);\n if (hideTimer.current) clearTimeout(hideTimer.current);\n };\n }, []);\n\n return (\n <span\n ref={wrapperRef}\n className=\"atl-tooltip-wrapper\"\n onMouseEnter={show}\n onMouseLeave={hide}\n onFocus={show}\n onBlur={hide}\n >\n {children}\n {visible && !atlTooltipDisabled && atlTooltip && (\n <div\n id={tooltipId}\n role=\"tooltip\"\n className={`atl-tooltip position-${atlTooltipPosition}`}\n >\n {atlTooltip}\n </div>\n )}\n </span>\n );\n}\n"]}