@atelier-ui/react 0.1.12 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/index.d.ts +29 -29
- package/src/index.js +29 -29
- package/src/index.js.map +1 -1
- package/src/lib/accordion/{llm-accordion.css → atl-accordion.css} +8 -8
- package/src/lib/accordion/{llm-accordion.d.ts → atl-accordion.d.ts} +12 -12
- package/src/lib/accordion/{llm-accordion.d.ts.map → atl-accordion.d.ts.map} +1 -1
- package/src/lib/accordion/{llm-accordion.js → atl-accordion.js} +9 -9
- package/src/lib/accordion/{llm-accordion.js.map → atl-accordion.js.map} +1 -1
- package/src/lib/alert/{llm-alert.css → atl-alert.css} +10 -10
- package/src/lib/alert/{llm-alert.d.ts → atl-alert.d.ts} +8 -8
- package/src/lib/alert/{llm-alert.d.ts.map → atl-alert.d.ts.map} +1 -1
- package/src/lib/alert/{llm-alert.js → atl-alert.js} +4 -4
- package/src/lib/alert/{llm-alert.js.map → atl-alert.js.map} +1 -1
- package/src/lib/avatar/{llm-avatar.css → atl-avatar.css} +20 -20
- package/src/lib/avatar/{llm-avatar.d.ts → atl-avatar.d.ts} +10 -10
- package/src/lib/avatar/{llm-avatar.d.ts.map → atl-avatar.d.ts.map} +1 -1
- package/src/lib/avatar/{llm-avatar.js → atl-avatar.js} +6 -6
- package/src/lib/avatar/{llm-avatar.js.map → atl-avatar.js.map} +1 -1
- package/src/lib/badge/{llm-badge.css → atl-badge.css} +9 -9
- package/src/lib/badge/atl-badge.d.ts +27 -0
- package/src/lib/badge/{llm-badge.d.ts.map → atl-badge.d.ts.map} +1 -1
- package/src/lib/badge/{llm-badge.js → atl-badge.js} +4 -4
- package/src/lib/badge/{llm-badge.js.map → atl-badge.js.map} +1 -1
- package/src/lib/breadcrumbs/{llm-breadcrumbs.css → atl-breadcrumbs.css} +11 -11
- package/src/lib/breadcrumbs/atl-breadcrumbs.d.ts +38 -0
- package/src/lib/breadcrumbs/{llm-breadcrumbs.d.ts.map → atl-breadcrumbs.d.ts.map} +1 -1
- package/src/lib/breadcrumbs/{llm-breadcrumbs.js → atl-breadcrumbs.js} +7 -7
- package/src/lib/breadcrumbs/{llm-breadcrumbs.js.map → atl-breadcrumbs.js.map} +1 -1
- package/src/lib/button/{llm-button.css → atl-button.css} +20 -20
- package/src/lib/button/{llm-button.d.ts → atl-button.d.ts} +7 -7
- package/src/lib/button/{llm-button.d.ts.map → atl-button.d.ts.map} +1 -1
- package/src/lib/button/{llm-button.js → atl-button.js} +4 -4
- package/src/lib/button/{llm-button.js.map → atl-button.js.map} +1 -1
- package/src/lib/card/{llm-card.css → atl-card.css} +20 -20
- package/src/lib/card/{llm-card.d.ts → atl-card.d.ts} +13 -13
- package/src/lib/card/{llm-card.d.ts.map → atl-card.d.ts.map} +1 -1
- package/src/lib/card/atl-card.js +30 -0
- package/src/lib/card/{llm-card.js.map → atl-card.js.map} +1 -1
- package/src/lib/chat/{llm-chat.css → atl-chat.css} +55 -55
- package/src/lib/chat/{llm-chat.d.ts → atl-chat.d.ts} +26 -26
- package/src/lib/chat/{llm-chat.d.ts.map → atl-chat.d.ts.map} +1 -1
- package/src/lib/chat/{llm-chat.js → atl-chat.js} +21 -21
- package/src/lib/chat/{llm-chat.js.map → atl-chat.js.map} +1 -1
- package/src/lib/checkbox/{llm-checkbox.css → atl-checkbox.css} +19 -19
- package/src/lib/checkbox/{llm-checkbox.d.ts → atl-checkbox.d.ts} +6 -6
- package/src/lib/checkbox/{llm-checkbox.d.ts.map → atl-checkbox.d.ts.map} +1 -1
- package/src/lib/checkbox/{llm-checkbox.js → atl-checkbox.js} +4 -4
- package/src/lib/checkbox/{llm-checkbox.js.map → atl-checkbox.js.map} +1 -1
- package/src/lib/code-block/{llm-code-block.css → atl-code-block.css} +2 -2
- package/src/lib/code-block/{llm-code-block.d.ts → atl-code-block.d.ts} +4 -4
- package/src/lib/code-block/{llm-code-block.d.ts.map → atl-code-block.d.ts.map} +1 -1
- package/src/lib/code-block/{llm-code-block.js → atl-code-block.js} +4 -4
- package/src/lib/code-block/{llm-code-block.js.map → atl-code-block.js.map} +1 -1
- package/src/lib/combobox/{llm-combobox.css → atl-combobox.css} +24 -24
- package/src/lib/combobox/{llm-combobox.d.ts → atl-combobox.d.ts} +7 -7
- package/src/lib/combobox/{llm-combobox.d.ts.map → atl-combobox.d.ts.map} +1 -1
- package/src/lib/combobox/{llm-combobox.js → atl-combobox.js} +8 -8
- package/src/lib/combobox/{llm-combobox.js.map → atl-combobox.js.map} +1 -1
- package/src/lib/dialog/{llm-dialog.css → atl-dialog.css} +18 -18
- package/src/lib/dialog/{llm-dialog.d.ts → atl-dialog.d.ts} +12 -12
- package/src/lib/dialog/{llm-dialog.d.ts.map → atl-dialog.d.ts.map} +1 -1
- package/src/lib/dialog/{llm-dialog.js → atl-dialog.js} +13 -13
- package/src/lib/dialog/{llm-dialog.js.map → atl-dialog.js.map} +1 -1
- package/src/lib/drawer/{llm-drawer.css → atl-drawer.css} +35 -35
- package/src/lib/drawer/{llm-drawer.d.ts → atl-drawer.d.ts} +12 -12
- package/src/lib/drawer/{llm-drawer.d.ts.map → atl-drawer.d.ts.map} +1 -1
- package/src/lib/drawer/{llm-drawer.js → atl-drawer.js} +13 -13
- package/src/lib/drawer/{llm-drawer.js.map → atl-drawer.js.map} +1 -1
- package/src/lib/icon/{llm-icon.css → atl-icon.css} +4 -4
- package/src/lib/icon/atl-icon.d.ts +24 -0
- package/src/lib/icon/{llm-icon.d.ts.map → atl-icon.d.ts.map} +1 -1
- package/src/lib/icon/{llm-icon.js → atl-icon.js} +5 -5
- package/src/lib/icon/{llm-icon.js.map → atl-icon.js.map} +1 -1
- package/src/lib/input/{llm-input.css → atl-input.css} +14 -14
- package/src/lib/input/{llm-input.d.ts → atl-input.d.ts} +6 -6
- package/src/lib/input/{llm-input.d.ts.map → atl-input.d.ts.map} +1 -1
- package/src/lib/input/{llm-input.js → atl-input.js} +4 -4
- package/src/lib/input/{llm-input.js.map → atl-input.js.map} +1 -1
- package/src/lib/menu/{llm-menu.css → atl-menu.css} +11 -11
- package/src/lib/menu/{llm-menu.d.ts → atl-menu.d.ts} +13 -13
- package/src/lib/menu/{llm-menu.d.ts.map → atl-menu.d.ts.map} +1 -1
- package/src/lib/menu/{llm-menu.js → atl-menu.js} +10 -10
- package/src/lib/menu/{llm-menu.js.map → atl-menu.js.map} +1 -1
- package/src/lib/pagination/{llm-pagination.css → atl-pagination.css} +1 -1
- package/src/lib/pagination/{llm-pagination.d.ts → atl-pagination.d.ts} +6 -6
- package/src/lib/pagination/{llm-pagination.d.ts.map → atl-pagination.d.ts.map} +1 -1
- package/src/lib/pagination/{llm-pagination.js → atl-pagination.js} +4 -4
- package/src/lib/pagination/{llm-pagination.js.map → atl-pagination.js.map} +1 -1
- package/src/lib/progress/{llm-progress.css → atl-progress.css} +9 -9
- package/src/lib/progress/{llm-progress.d.ts → atl-progress.d.ts} +6 -6
- package/src/lib/progress/{llm-progress.d.ts.map → atl-progress.d.ts.map} +1 -1
- package/src/lib/progress/{llm-progress.js → atl-progress.js} +4 -4
- package/src/lib/progress/{llm-progress.js.map → atl-progress.js.map} +1 -1
- package/src/lib/radio/{llm-radio.css → atl-radio.css} +11 -11
- package/src/lib/radio/{llm-radio.d.ts → atl-radio.d.ts} +7 -7
- package/src/lib/radio/{llm-radio.d.ts.map → atl-radio.d.ts.map} +1 -1
- package/src/lib/radio/{llm-radio.js → atl-radio.js} +6 -6
- package/src/lib/radio/{llm-radio.js.map → atl-radio.js.map} +1 -1
- package/src/lib/radio-group/{llm-radio-group.css → atl-radio-group.css} +6 -6
- package/src/lib/radio-group/{llm-radio-group.d.ts → atl-radio-group.d.ts} +6 -6
- package/src/lib/radio-group/{llm-radio-group.d.ts.map → atl-radio-group.d.ts.map} +1 -1
- package/src/lib/radio-group/{llm-radio-group.js → atl-radio-group.js} +4 -4
- package/src/lib/radio-group/{llm-radio-group.js.map → atl-radio-group.js.map} +1 -1
- package/src/lib/select/{llm-select.css → atl-select.css} +11 -11
- package/src/lib/select/{llm-select.d.ts → atl-select.d.ts} +10 -10
- package/src/lib/select/{llm-select.d.ts.map → atl-select.d.ts.map} +1 -1
- package/src/lib/select/{llm-select.js → atl-select.js} +6 -6
- package/src/lib/select/{llm-select.js.map → atl-select.js.map} +1 -1
- package/src/lib/skeleton/{llm-skeleton.css → atl-skeleton.css} +6 -6
- package/src/lib/skeleton/{llm-skeleton.d.ts → atl-skeleton.d.ts} +6 -6
- package/src/lib/skeleton/{llm-skeleton.d.ts.map → atl-skeleton.d.ts.map} +1 -1
- package/src/lib/skeleton/{llm-skeleton.js → atl-skeleton.js} +4 -4
- package/src/lib/skeleton/{llm-skeleton.js.map → atl-skeleton.js.map} +1 -1
- package/src/lib/spec.d.ts +120 -120
- package/src/lib/spec.js.map +1 -1
- package/src/lib/stepper/{llm-stepper.css → atl-stepper.css} +5 -5
- package/src/lib/stepper/{llm-stepper.d.ts → atl-stepper.d.ts} +9 -9
- package/src/lib/stepper/{llm-stepper.d.ts.map → atl-stepper.d.ts.map} +1 -1
- package/src/lib/stepper/{llm-stepper.js → atl-stepper.js} +11 -11
- package/src/lib/stepper/{llm-stepper.js.map → atl-stepper.js.map} +1 -1
- package/src/lib/table/{llm-table.css → atl-table.css} +30 -30
- package/src/lib/table/atl-table.d.ts +40 -0
- package/src/lib/table/{llm-table.d.ts.map → atl-table.d.ts.map} +1 -1
- package/src/lib/table/{llm-table.js → atl-table.js} +14 -14
- package/src/lib/table/{llm-table.js.map → atl-table.js.map} +1 -1
- package/src/lib/tabs/{llm-tabs.css → atl-tabs.css} +17 -17
- package/src/lib/tabs/{llm-tabs.d.ts → atl-tabs.d.ts} +12 -12
- package/src/lib/tabs/{llm-tabs.d.ts.map → atl-tabs.d.ts.map} +1 -1
- package/src/lib/tabs/{llm-tabs.js → atl-tabs.js} +11 -11
- package/src/lib/tabs/{llm-tabs.js.map → atl-tabs.js.map} +1 -1
- package/src/lib/textarea/{llm-textarea.css → atl-textarea.css} +15 -15
- package/src/lib/textarea/{llm-textarea.d.ts → atl-textarea.d.ts} +6 -6
- package/src/lib/textarea/{llm-textarea.d.ts.map → atl-textarea.d.ts.map} +1 -1
- package/src/lib/textarea/{llm-textarea.js → atl-textarea.js} +4 -4
- package/src/lib/textarea/{llm-textarea.js.map → atl-textarea.js.map} +1 -1
- package/src/lib/toast/{llm-toast.css → atl-toast.css} +16 -16
- package/src/lib/toast/atl-toast.d.ts +54 -0
- package/src/lib/toast/{llm-toast.d.ts.map → atl-toast.d.ts.map} +1 -1
- package/src/lib/toast/{llm-toast.js → atl-toast.js} +12 -12
- package/src/lib/toast/{llm-toast.js.map → atl-toast.js.map} +1 -1
- package/src/lib/toggle/{llm-toggle.css → atl-toggle.css} +16 -16
- package/src/lib/toggle/{llm-toggle.d.ts → atl-toggle.d.ts} +6 -6
- package/src/lib/toggle/{llm-toggle.d.ts.map → atl-toggle.d.ts.map} +1 -1
- package/src/lib/toggle/{llm-toggle.js → atl-toggle.js} +4 -4
- package/src/lib/toggle/{llm-toggle.js.map → atl-toggle.js.map} +1 -1
- package/src/lib/tooltip/{llm-tooltip.css → atl-tooltip.css} +12 -12
- package/src/lib/tooltip/atl-tooltip.d.ts +17 -0
- package/src/lib/tooltip/{llm-tooltip.d.ts.map → atl-tooltip.d.ts.map} +1 -1
- package/src/lib/tooltip/{llm-tooltip.js → atl-tooltip.js} +7 -7
- package/src/lib/tooltip/{llm-tooltip.js.map → atl-tooltip.js.map} +1 -1
- package/src/lib/badge/llm-badge.d.ts +0 -27
- package/src/lib/breadcrumbs/llm-breadcrumbs.d.ts +0 -38
- package/src/lib/card/llm-card.js +0 -30
- package/src/lib/icon/llm-icon.d.ts +0 -24
- package/src/lib/table/llm-table.d.ts +0 -40
- package/src/lib/toast/llm-toast.d.ts +0 -54
- package/src/lib/tooltip/llm-tooltip.d.ts +0 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"atl-radio-group.js","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/radio-group/atl-radio-group.tsx"],"names":[],"mappings":"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","sourcesContent":["import {\n createContext,\n useContext,\n useRef,\n type KeyboardEvent,\n InputHTMLAttributes,\n ReactNode,\n} from 'react';\nimport type { AtlRadioGroupSpec } from '../spec';\nimport './atl-radio-group.css';\n\n/**\n * Interface for the RadioGroup context.\n */\nexport interface RadioGroupContextValue {\n /**\n * The currently selected value.\n */\n value: string;\n /**\n * The name of the radio group.\n */\n name: string;\n /**\n * Whether the entire radio group is disabled.\n */\n disabled: boolean;\n /**\n * Whether the entire radio group is read-only.\n */\n readOnly: boolean;\n /**\n * Whether the radio group is in an invalid state.\n */\n invalid: boolean;\n /**\n * Callback to select a value.\n */\n onSelect: (value: string) => void;\n /**\n * Callback triggered on blur.\n */\n onBlur: () => void;\n}\n\nexport const RadioGroupContext = createContext<RadioGroupContextValue>({\n value: '',\n name: '',\n disabled: false,\n readOnly: false,\n invalid: false,\n onSelect: () => undefined,\n onBlur: () => undefined,\n});\n\n/**\n * Properties for the AtlRadioGroup component.\n */\nexport interface AtlRadioGroupProps\n extends Omit<InputHTMLAttributes<HTMLDivElement>, 'onChange'>,\n AtlRadioGroupSpec {\n /**\n * The current value of the radio group.\n */\n value?: string;\n /**\n * Callback triggered when the value changes.\n */\n onValueChange?: (value: string) => void;\n /**\n * The layout orientation of the radio group.\n */\n orientation?: 'horizontal' | 'vertical';\n /**\n * The name of the radio group, applied to all child radio buttons.\n */\n name?: string;\n /**\n * Whether the radio group is disabled.\n */\n disabled?: boolean;\n /**\n * Whether the radio group is read-only.\n */\n readOnly?: boolean;\n /**\n * Whether the radio group is in an invalid state.\n */\n invalid?: boolean;\n /**\n * Whether a value is required.\n */\n required?: boolean;\n /**\n * Array of error messages to display.\n */\n errors?: string[];\n /**\n * The radio buttons to be rendered.\n */\n children?: ReactNode;\n}\n\n/**\n * A group of radio buttons.\n */\nexport function AtlRadioGroup({\n value = '',\n onValueChange,\n orientation = 'vertical',\n name = '',\n disabled = false,\n readOnly: reactReadOnly,\n readonly: specReadOnly,\n invalid = false,\n required = false,\n errors = [],\n children,\n className,\n ...rest\n}: AtlRadioGroupProps) {\n const readOnly = reactReadOnly ?? specReadOnly ?? false;\n const groupRef = useRef<HTMLDivElement>(null);\n\n // Roving arrow-key navigation per the WAI-ARIA radiogroup pattern: Arrow\n // Down/Right move to the next enabled radio, Up/Left to the previous, both\n // wrapping, and the navigated radio is selected and focused.\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (disabled || readOnly) return;\n const forward = event.key === 'ArrowDown' || event.key === 'ArrowRight';\n const backward = event.key === 'ArrowUp' || event.key === 'ArrowLeft';\n if (!forward && !backward) return;\n const radios = Array.from(\n groupRef.current?.querySelectorAll<HTMLInputElement>('input[type=\"radio\"]') ?? []\n ).filter((radio) => !radio.disabled);\n if (radios.length === 0) return;\n event.preventDefault();\n const currentIdx = radios.findIndex((radio) => radio.value === value);\n const start = currentIdx === -1 ? (forward ? -1 : 0) : currentIdx;\n const nextIdx = (start + (forward ? 1 : -1) + radios.length) % radios.length;\n const target = radios[nextIdx];\n target.focus();\n onValueChange?.(target.value);\n };\n\n const classes = [\n 'atl-radio-group',\n `orientation-${orientation}`,\n invalid && 'is-invalid',\n disabled && 'is-disabled',\n readOnly && 'is-readonly',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <RadioGroupContext.Provider\n value={{\n value,\n name,\n disabled,\n readOnly,\n invalid,\n onSelect: (v) => !disabled && !readOnly && onValueChange?.(v),\n onBlur: () => undefined,\n }}\n >\n <div\n ref={groupRef}\n className={classes}\n role=\"radiogroup\"\n aria-invalid={invalid || undefined}\n aria-required={required || undefined}\n onKeyDown={handleKeyDown}\n {...rest}\n >\n {children}\n {errors.length > 0 && (\n <div className=\"errors\" role=\"alert\" aria-live=\"polite\">\n {errors.map((err, i) => (\n <p key={i} className=\"error-message\">\n {err}\n </p>\n ))}\n </div>\n )}\n </div>\n </RadioGroupContext.Provider>\n );\n}\n\nexport function useRadioGroup(): RadioGroupContextValue {\n return useContext(RadioGroupContext);\n}\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
.
|
|
1
|
+
.atl-select {
|
|
2
2
|
display: inline-block;
|
|
3
3
|
position: relative;
|
|
4
4
|
font-family: var(--ui-font-family);
|
|
5
5
|
font-size: var(--ui-font-size-md);
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
.
|
|
8
|
+
.atl-select label {
|
|
9
9
|
display: block;
|
|
10
10
|
margin-bottom: var(--ui-spacing-2);
|
|
11
11
|
font-size: var(--ui-font-size-sm);
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
/* Select wrapper — holds native select + arrow icon */
|
|
17
|
-
.
|
|
17
|
+
.atl-select .select-wrapper {
|
|
18
18
|
position: relative;
|
|
19
19
|
display: flex;
|
|
20
20
|
align-items: center;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
.
|
|
23
|
+
.atl-select select {
|
|
24
24
|
display: flex;
|
|
25
25
|
align-items: center;
|
|
26
26
|
justify-content: space-between;
|
|
@@ -43,27 +43,27 @@
|
|
|
43
43
|
background-color var(--ui-transition-fast);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
.
|
|
46
|
+
.atl-select select:hover:not(:disabled) {
|
|
47
47
|
border-color: var(--ui-color-input-border-hover);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
.
|
|
50
|
+
.atl-select select:focus-visible {
|
|
51
51
|
outline: none;
|
|
52
52
|
box-shadow: var(--ui-focus-ring);
|
|
53
53
|
border-color: var(--ui-color-input-border-focus);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
.
|
|
56
|
+
.atl-select select:disabled {
|
|
57
57
|
opacity: var(--ui-opacity-disabled);
|
|
58
58
|
cursor: not-allowed;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
.
|
|
61
|
+
.atl-select.is-invalid select {
|
|
62
62
|
border-color: var(--ui-color-input-border-invalid);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
/* Arrow icon */
|
|
66
|
-
.
|
|
66
|
+
.atl-select .select-arrow {
|
|
67
67
|
position: absolute;
|
|
68
68
|
inset-inline-end: var(--ui-spacing-4);
|
|
69
69
|
pointer-events: none;
|
|
@@ -72,11 +72,11 @@
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
/* Error display */
|
|
75
|
-
.
|
|
75
|
+
.atl-select .errors {
|
|
76
76
|
margin-top: var(--ui-spacing-2);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
.
|
|
79
|
+
.atl-select .error-message {
|
|
80
80
|
margin: 0;
|
|
81
81
|
font-size: var(--ui-font-size-sm);
|
|
82
82
|
color: var(--ui-color-error-text);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ReactNode, SelectHTMLAttributes, OptionHTMLAttributes } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
import './
|
|
2
|
+
import type { AtlSelectSpec, AtlOptionSpec } from '../spec';
|
|
3
|
+
import './atl-select.css';
|
|
4
4
|
/**
|
|
5
|
-
* Properties for the
|
|
5
|
+
* Properties for the AtlSelect component.
|
|
6
6
|
*/
|
|
7
|
-
export interface
|
|
7
|
+
export interface AtlSelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'value' | 'onChange'>, AtlSelectSpec {
|
|
8
8
|
/**
|
|
9
9
|
* The current value of the select.
|
|
10
10
|
*/
|
|
@@ -37,11 +37,11 @@ export interface LlmSelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElem
|
|
|
37
37
|
/**
|
|
38
38
|
* A select component for choosing an option from a list.
|
|
39
39
|
*/
|
|
40
|
-
export declare function
|
|
40
|
+
export declare function AtlSelect({ value, onValueChange, placeholder, invalid, errors, disabled, readOnly: reactReadOnly, readonly: specReadOnly, required, label, children, className, id, ...rest }: AtlSelectProps): import("react").JSX.Element;
|
|
41
41
|
/**
|
|
42
|
-
* Properties for the
|
|
42
|
+
* Properties for the AtlOption component.
|
|
43
43
|
*/
|
|
44
|
-
export interface
|
|
44
|
+
export interface AtlOptionProps extends OptionHTMLAttributes<HTMLOptionElement>, AtlOptionSpec {
|
|
45
45
|
/**
|
|
46
46
|
* The value of the option.
|
|
47
47
|
*/
|
|
@@ -52,7 +52,7 @@ export interface LlmOptionProps extends OptionHTMLAttributes<HTMLOptionElement>,
|
|
|
52
52
|
children?: ReactNode;
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
|
-
* An individual option component for use within
|
|
55
|
+
* An individual option component for use within AtlSelect.
|
|
56
56
|
*/
|
|
57
|
-
export declare function
|
|
58
|
-
//# sourceMappingURL=
|
|
57
|
+
export declare function AtlOption({ optionValue, children, ...rest }: AtlOptionProps): import("react").JSX.Element;
|
|
58
|
+
//# sourceMappingURL=atl-select.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"atl-select.d.ts","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/select/atl-select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAC9E,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACd,MAAM,SAAS,CAAC;AACjB,OAAO,kBAAkB,CAAC;AAE1B;;GAEG;AACH,MAAM,WAAW,cACf,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC,EACzE,aAAa;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAU,EACV,aAAa,EACb,WAAW,EACX,OAAe,EACf,MAAW,EACX,QAAgB,EAChB,QAAQ,EAAE,aAAa,EACvB,QAAQ,EAAE,YAAY,EACtB,QAAgB,EAChB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,EAAE,EACF,GAAG,IAAI,EACR,EAAE,cAAc,+BAiDhB;AAED;;GAEG;AACH,MAAM,WAAW,cACf,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC,EAC7C,aAAa;IACf;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,cAAc,+BAM3E"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import './
|
|
2
|
+
import './atl-select.css';
|
|
3
3
|
/**
|
|
4
4
|
* A select component for choosing an option from a list.
|
|
5
5
|
*/
|
|
6
|
-
export function
|
|
6
|
+
export function AtlSelect({ value = '', onValueChange, placeholder, invalid = false, errors = [], disabled = false, readOnly: reactReadOnly, readonly: specReadOnly, required = false, label, children, className, id, ...rest }) {
|
|
7
7
|
const readOnly = reactReadOnly ?? specReadOnly ?? false;
|
|
8
8
|
const selectId = id || (label ? `select-${label.toLowerCase().replace(/\s+/g, '-')}` : undefined);
|
|
9
9
|
const classes = [
|
|
10
|
-
'
|
|
10
|
+
'atl-select',
|
|
11
11
|
invalid && 'is-invalid',
|
|
12
12
|
disabled && 'is-disabled',
|
|
13
13
|
readOnly && 'is-readonly',
|
|
@@ -18,9 +18,9 @@ export function LlmSelect({ value = '', onValueChange, placeholder, invalid = fa
|
|
|
18
18
|
return (_jsxs("div", { className: classes, children: [label && _jsx("label", { htmlFor: selectId, children: label }), _jsxs("div", { className: "select-wrapper", children: [_jsxs("select", { id: selectId, value: value, onChange: (e) => onValueChange?.(e.target.value), disabled: disabled, required: required, "aria-invalid": invalid || undefined, ...rest, children: [placeholder && (_jsx("option", { value: "", disabled: true, hidden: true, children: placeholder })), children] }), _jsx("span", { className: "select-arrow", "aria-hidden": "true", children: "\u25BE" })] }), errors.length > 0 && (_jsx("div", { className: "errors", role: "alert", "aria-live": "polite", children: errors.map((err, i) => (_jsx("p", { className: "error-message", children: err }, i))) }))] }));
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
* An individual option component for use within
|
|
21
|
+
* An individual option component for use within AtlSelect.
|
|
22
22
|
*/
|
|
23
|
-
export function
|
|
23
|
+
export function AtlOption({ optionValue, children, ...rest }) {
|
|
24
24
|
return (_jsx("option", { value: optionValue, ...rest, children: children }));
|
|
25
25
|
}
|
|
26
|
-
//# sourceMappingURL=
|
|
26
|
+
//# sourceMappingURL=atl-select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"atl-select.js","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/select/atl-select.tsx"],"names":[],"mappings":";AAKA,OAAO,kBAAkB,CAAC;AAsC1B;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,EACxB,KAAK,GAAG,EAAE,EACV,aAAa,EACb,WAAW,EACX,OAAO,GAAG,KAAK,EACf,MAAM,GAAG,EAAE,EACX,QAAQ,GAAG,KAAK,EAChB,QAAQ,EAAE,aAAa,EACvB,QAAQ,EAAE,YAAY,EACtB,QAAQ,GAAG,KAAK,EAChB,KAAK,EACL,QAAQ,EACR,SAAS,EACT,EAAE,EACF,GAAG,IAAI,EACQ;IACf,MAAM,QAAQ,GAAG,aAAa,IAAI,YAAY,IAAI,KAAK,CAAC;IACxD,MAAM,QAAQ,GACZ,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,KAAK,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACnF,MAAM,OAAO,GAAG;QACd,YAAY;QACZ,OAAO,IAAI,YAAY;QACvB,QAAQ,IAAI,aAAa;QACzB,QAAQ,IAAI,aAAa;QACzB,SAAS;KACV;SACE,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,CACL,eAAK,SAAS,EAAE,OAAO,aACpB,KAAK,IAAI,gBAAO,OAAO,EAAE,QAAQ,YAAG,KAAK,GAAS,EACnD,eAAK,SAAS,EAAC,gBAAgB,aAC7B,kBACE,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAChD,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,kBACJ,OAAO,IAAI,SAAS,KAC9B,IAAI,aAEP,WAAW,IAAI,CACd,iBAAQ,KAAK,EAAC,EAAE,EAAC,QAAQ,QAAC,MAAM,kBAC7B,WAAW,GACL,CACV,EACA,QAAQ,IACF,EACT,eAAM,SAAS,EAAC,cAAc,iBAAa,MAAM,uBAE1C,IACH,EACL,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CACpB,cAAK,SAAS,EAAC,QAAQ,EAAC,IAAI,EAAC,OAAO,eAAW,QAAQ,YACpD,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,YAAW,SAAS,EAAC,eAAe,YACjC,GAAG,IADE,CAAC,CAEL,CACL,CAAC,GACE,CACP,IACG,CACP,CAAC;AACJ,CAAC;AAkBD;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAkB;IAC1E,OAAO,CACL,iBAAQ,KAAK,EAAE,WAAW,KAAM,IAAI,YACjC,QAAQ,GACF,CACV,CAAC;AACJ,CAAC","sourcesContent":["import { ReactNode, SelectHTMLAttributes, OptionHTMLAttributes } from 'react';\nimport type {\n AtlSelectSpec,\n AtlOptionSpec,\n} from '../spec';\nimport './atl-select.css';\n\n/**\n * Properties for the AtlSelect component.\n */\nexport interface AtlSelectProps\n extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'value' | 'onChange'>,\n AtlSelectSpec {\n /**\n * The current value of the select.\n */\n value?: string;\n /**\n * Callback triggered when the value changes.\n */\n onValueChange?: (value: string) => void;\n /**\n * Placeholder text to display when no value is selected.\n */\n placeholder?: string;\n /**\n * Whether the select is in an invalid state.\n */\n invalid?: boolean;\n /**\n * Array of error messages to display.\n */\n errors?: string[];\n /**\n * The label for the select.\n */\n label?: string;\n /**\n * Whether the select is read-only.\n */\n readOnly?: boolean;\n}\n\n/**\n * A select component for choosing an option from a list.\n */\nexport function AtlSelect({\n value = '',\n onValueChange,\n placeholder,\n invalid = false,\n errors = [],\n disabled = false,\n readOnly: reactReadOnly,\n readonly: specReadOnly,\n required = false,\n label,\n children,\n className,\n id,\n ...rest\n}: AtlSelectProps) {\n const readOnly = reactReadOnly ?? specReadOnly ?? false;\n const selectId =\n id || (label ? `select-${label.toLowerCase().replace(/\\s+/g, '-')}` : undefined);\n const classes = [\n 'atl-select',\n invalid && 'is-invalid',\n disabled && 'is-disabled',\n readOnly && 'is-readonly',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <div className={classes}>\n {label && <label htmlFor={selectId}>{label}</label>}\n <div className=\"select-wrapper\">\n <select\n id={selectId}\n value={value}\n onChange={(e) => onValueChange?.(e.target.value)}\n disabled={disabled}\n required={required}\n aria-invalid={invalid || undefined}\n {...rest}\n >\n {placeholder && (\n <option value=\"\" disabled hidden>\n {placeholder}\n </option>\n )}\n {children}\n </select>\n <span className=\"select-arrow\" aria-hidden=\"true\">\n ▾\n </span>\n </div>\n {errors.length > 0 && (\n <div className=\"errors\" role=\"alert\" aria-live=\"polite\">\n {errors.map((err, i) => (\n <p key={i} className=\"error-message\">\n {err}\n </p>\n ))}\n </div>\n )}\n </div>\n );\n}\n\n/**\n * Properties for the AtlOption component.\n */\nexport interface AtlOptionProps\n extends OptionHTMLAttributes<HTMLOptionElement>,\n AtlOptionSpec {\n /**\n * The value of the option.\n */\n optionValue: string;\n /**\n * The content to be rendered inside the option.\n */\n children?: ReactNode;\n}\n\n/**\n * An individual option component for use within AtlSelect.\n */\nexport function AtlOption({ optionValue, children, ...rest }: AtlOptionProps) {\n return (\n <option value={optionValue} {...rest}>\n {children}\n </option>\n );\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.
|
|
1
|
+
.atl-skeleton {
|
|
2
2
|
display: block;
|
|
3
3
|
background: var(--ui-color-border);
|
|
4
4
|
overflow: hidden;
|
|
@@ -6,22 +6,22 @@
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
/* Variant shapes */
|
|
9
|
-
.
|
|
9
|
+
.atl-skeleton.variant-text {
|
|
10
10
|
border-radius: var(--ui-radius-sm);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
.
|
|
13
|
+
.atl-skeleton.variant-circular {
|
|
14
14
|
border-radius: var(--ui-radius-full, 9999px);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
.
|
|
17
|
+
.atl-skeleton.variant-rectangular {
|
|
18
18
|
border-radius: var(--ui-radius-md);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/* Shimmer animation — uses currentColor-aware overlay so it reads on
|
|
22
22
|
* both light and dark surfaces (was hardcoded white at 0.3 alpha,
|
|
23
23
|
* which only showed on dark backgrounds). */
|
|
24
|
-
.
|
|
24
|
+
.atl-skeleton.is-animated::after {
|
|
25
25
|
content: '';
|
|
26
26
|
position: absolute;
|
|
27
27
|
inset: 0;
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
|
|
46
46
|
/* Respect reduced motion */
|
|
47
47
|
@media (prefers-reduced-motion: reduce) {
|
|
48
|
-
.
|
|
48
|
+
.atl-skeleton.is-animated::after {
|
|
49
49
|
animation: none;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
import './
|
|
2
|
+
import type { AtlSkeletonSpec } from '../spec';
|
|
3
|
+
import './atl-skeleton.css';
|
|
4
4
|
/**
|
|
5
|
-
* Properties for the
|
|
5
|
+
* Properties for the AtlSkeleton component.
|
|
6
6
|
*/
|
|
7
|
-
export interface
|
|
7
|
+
export interface AtlSkeletonProps extends HTMLAttributes<HTMLDivElement>, AtlSkeletonSpec {
|
|
8
8
|
/**
|
|
9
9
|
* The visual style variant of the skeleton.
|
|
10
10
|
*/
|
|
@@ -25,5 +25,5 @@ export interface LlmSkeletonProps extends HTMLAttributes<HTMLDivElement>, LlmSke
|
|
|
25
25
|
/**
|
|
26
26
|
* A placeholder component used to represent content while it's loading.
|
|
27
27
|
*/
|
|
28
|
-
export declare function
|
|
29
|
-
//# sourceMappingURL=
|
|
28
|
+
export declare function AtlSkeleton({ variant, width, height, animated, className, style, ...rest }: AtlSkeletonProps): import("react").JSX.Element;
|
|
29
|
+
//# sourceMappingURL=atl-skeleton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"atl-skeleton.d.ts","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/skeleton/atl-skeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,cAAc,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,oBAAoB,CAAC;AAE5B;;GAEG;AACH,MAAM,WAAW,gBACf,SAAQ,cAAc,CAAC,cAAc,CAAC,EACpC,eAAe;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,aAAa,CAAC;IAC9C;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAgBD;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAC1B,OAAgB,EAChB,KAAc,EACd,MAAM,EACN,QAAe,EACf,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,gBAAgB,+BAMlB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import './
|
|
2
|
+
import './atl-skeleton.css';
|
|
3
3
|
function computeHeight(variant, width, height) {
|
|
4
4
|
if (height)
|
|
5
5
|
return height;
|
|
@@ -17,11 +17,11 @@ function computeHeight(variant, width, height) {
|
|
|
17
17
|
/**
|
|
18
18
|
* A placeholder component used to represent content while it's loading.
|
|
19
19
|
*/
|
|
20
|
-
export function
|
|
21
|
-
const classes = ['
|
|
20
|
+
export function AtlSkeleton({ variant = 'text', width = '100%', height, animated = true, className, style, ...rest }) {
|
|
21
|
+
const classes = ['atl-skeleton', `variant-${variant}`, animated && 'is-animated', className]
|
|
22
22
|
.filter(Boolean).join(' ');
|
|
23
23
|
const computedHeight = computeHeight(variant, width, height);
|
|
24
24
|
const inlineStyle = { ...style, width, height: computedHeight };
|
|
25
25
|
return _jsx("div", { className: classes, style: inlineStyle, "aria-hidden": "true", ...rest });
|
|
26
26
|
}
|
|
27
|
-
//# sourceMappingURL=
|
|
27
|
+
//# sourceMappingURL=atl-skeleton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"atl-skeleton.js","sourceRoot":"","sources":["../../../../../../libs/react/src/lib/skeleton/atl-skeleton.tsx"],"names":[],"mappings":";AAEA,OAAO,oBAAoB,CAAC;AA0B5B,SAAS,aAAa,CAAC,OAAe,EAAE,KAAa,EAAE,MAAe;IACpE,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC;IAC1B,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,MAAM;YACT,OAAO,KAAK,CAAC;QACf,KAAK,UAAU;YACb,OAAO,KAAK,CAAC;QACf,KAAK,aAAa;YAChB,OAAO,OAAO,CAAC;QACjB;YACE,OAAO,KAAK,CAAC;IACjB,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,OAAO,GAAG,MAAM,EAChB,KAAK,GAAG,MAAM,EACd,MAAM,EACN,QAAQ,GAAG,IAAI,EACf,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACU;IACjB,MAAM,OAAO,GAAG,CAAC,cAAc,EAAE,WAAW,OAAO,EAAE,EAAE,QAAQ,IAAI,aAAa,EAAE,SAAS,CAAC;SACzF,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7B,MAAM,cAAc,GAAG,aAAa,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IAC7D,MAAM,WAAW,GAAkB,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;IAC/E,OAAO,cAAK,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,iBAAc,MAAM,KAAK,IAAI,GAAI,CAAC;AACtF,CAAC","sourcesContent":["import { CSSProperties, HTMLAttributes } from 'react';\nimport type { AtlSkeletonSpec } from '../spec';\nimport './atl-skeleton.css';\n\n/**\n * Properties for the AtlSkeleton component.\n */\nexport interface AtlSkeletonProps\n extends HTMLAttributes<HTMLDivElement>,\n AtlSkeletonSpec {\n /**\n * The visual style variant of the skeleton.\n */\n variant?: 'text' | 'circular' | 'rectangular';\n /**\n * The width of the skeleton.\n */\n width?: string;\n /**\n * The height of the skeleton.\n */\n height?: string;\n /**\n * Whether the skeleton should be animated.\n */\n animated?: boolean;\n}\n\nfunction computeHeight(variant: string, width: string, height?: string): string {\n if (height) return height;\n switch (variant) {\n case 'text':\n return '1em';\n case 'circular':\n return width;\n case 'rectangular':\n return '100px';\n default:\n return '1em';\n }\n}\n\n/**\n * A placeholder component used to represent content while it's loading.\n */\nexport function AtlSkeleton({\n variant = 'text',\n width = '100%',\n height,\n animated = true,\n className,\n style,\n ...rest\n}: AtlSkeletonProps) {\n const classes = ['atl-skeleton', `variant-${variant}`, animated && 'is-animated', className]\n .filter(Boolean).join(' ');\n const computedHeight = computeHeight(variant, width, height);\n const inlineStyle: CSSProperties = { ...style, width, height: computedHeight };\n return <div className={classes} style={inlineStyle} aria-hidden=\"true\" {...rest} />;\n}\n"]}
|