@ttoss/fsl-ui 0.2.4
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/LICENSE +21 -0
- package/README.md +76 -0
- package/dist/_virtual/_rolldown/runtime.cjs +30 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.cjs +129 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.cts +61 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.mts +61 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.mjs +126 -0
- package/dist/components/Button/Button.cjs +80 -0
- package/dist/components/Button/Button.d.cts +68 -0
- package/dist/components/Button/Button.d.mts +68 -0
- package/dist/components/Button/Button.mjs +79 -0
- package/dist/components/Checkbox/Checkbox.cjs +183 -0
- package/dist/components/Checkbox/Checkbox.d.cts +45 -0
- package/dist/components/Checkbox/Checkbox.d.mts +45 -0
- package/dist/components/Checkbox/Checkbox.mjs +182 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.cjs +97 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.d.cts +56 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.d.mts +56 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.mjs +96 -0
- package/dist/components/FileTrigger/FileTrigger.cjs +51 -0
- package/dist/components/FileTrigger/FileTrigger.d.cts +52 -0
- package/dist/components/FileTrigger/FileTrigger.d.mts +52 -0
- package/dist/components/FileTrigger/FileTrigger.mjs +50 -0
- package/dist/components/GridList/GridList.cjs +220 -0
- package/dist/components/GridList/GridList.d.cts +72 -0
- package/dist/components/GridList/GridList.d.mts +72 -0
- package/dist/components/GridList/GridList.mjs +217 -0
- package/dist/components/Group/Group.cjs +77 -0
- package/dist/components/Group/Group.d.cts +61 -0
- package/dist/components/Group/Group.d.mts +61 -0
- package/dist/components/Group/Group.mjs +74 -0
- package/dist/components/Icon/Icon.cjs +52 -0
- package/dist/components/Icon/Icon.mjs +52 -0
- package/dist/components/Icon/glyphs.cjs +72 -0
- package/dist/components/Icon/glyphs.mjs +63 -0
- package/dist/components/Link/Link.cjs +62 -0
- package/dist/components/Link/Link.d.cts +38 -0
- package/dist/components/Link/Link.d.mts +38 -0
- package/dist/components/Link/Link.mjs +61 -0
- package/dist/components/ListBox/ListBox.cjs +126 -0
- package/dist/components/ListBox/ListBox.d.cts +63 -0
- package/dist/components/ListBox/ListBox.d.mts +63 -0
- package/dist/components/ListBox/ListBox.mjs +123 -0
- package/dist/components/Meter/Meter.cjs +126 -0
- package/dist/components/Meter/Meter.d.cts +63 -0
- package/dist/components/Meter/Meter.d.mts +63 -0
- package/dist/components/Meter/Meter.mjs +125 -0
- package/dist/components/NumberField/NumberField.cjs +221 -0
- package/dist/components/NumberField/NumberField.d.cts +68 -0
- package/dist/components/NumberField/NumberField.d.mts +68 -0
- package/dist/components/NumberField/NumberField.mjs +220 -0
- package/dist/components/ProgressBar/ProgressBar.cjs +132 -0
- package/dist/components/ProgressBar/ProgressBar.d.cts +56 -0
- package/dist/components/ProgressBar/ProgressBar.d.mts +56 -0
- package/dist/components/ProgressBar/ProgressBar.mjs +129 -0
- package/dist/components/RadioGroup/RadioGroup.cjs +218 -0
- package/dist/components/RadioGroup/RadioGroup.d.cts +82 -0
- package/dist/components/RadioGroup/RadioGroup.d.mts +82 -0
- package/dist/components/RadioGroup/RadioGroup.mjs +215 -0
- package/dist/components/Select/Select.cjs +253 -0
- package/dist/components/Select/Select.d.cts +86 -0
- package/dist/components/Select/Select.d.mts +86 -0
- package/dist/components/Select/Select.mjs +250 -0
- package/dist/components/Separator/Separator.cjs +64 -0
- package/dist/components/Separator/Separator.d.cts +44 -0
- package/dist/components/Separator/Separator.d.mts +44 -0
- package/dist/components/Separator/Separator.mjs +63 -0
- package/dist/components/Slider/Slider.cjs +160 -0
- package/dist/components/Slider/Slider.d.cts +45 -0
- package/dist/components/Slider/Slider.d.mts +45 -0
- package/dist/components/Slider/Slider.mjs +159 -0
- package/dist/components/Switch/Switch.cjs +176 -0
- package/dist/components/Switch/Switch.d.cts +43 -0
- package/dist/components/Switch/Switch.d.mts +43 -0
- package/dist/components/Switch/Switch.mjs +175 -0
- package/dist/components/Tabs/Tabs.cjs +180 -0
- package/dist/components/Tabs/Tabs.d.cts +85 -0
- package/dist/components/Tabs/Tabs.d.mts +85 -0
- package/dist/components/Tabs/Tabs.mjs +173 -0
- package/dist/components/Toast/Toast.cjs +218 -0
- package/dist/components/Toast/Toast.d.cts +96 -0
- package/dist/components/Toast/Toast.d.mts +96 -0
- package/dist/components/Toast/Toast.mjs +214 -0
- package/dist/components/ToggleButton/ToggleButton.cjs +125 -0
- package/dist/components/ToggleButton/ToggleButton.d.cts +43 -0
- package/dist/components/ToggleButton/ToggleButton.d.mts +43 -0
- package/dist/components/ToggleButton/ToggleButton.mjs +124 -0
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.cjs +48 -0
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.d.cts +41 -0
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.d.mts +41 -0
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.mjs +47 -0
- package/dist/components/Toolbar/Toolbar.cjs +67 -0
- package/dist/components/Toolbar/Toolbar.d.cts +60 -0
- package/dist/components/Toolbar/Toolbar.d.mts +60 -0
- package/dist/components/Toolbar/Toolbar.mjs +66 -0
- package/dist/composites/Accordion/Accordion.cjs +279 -0
- package/dist/composites/Accordion/Accordion.d.cts +176 -0
- package/dist/composites/Accordion/Accordion.d.mts +176 -0
- package/dist/composites/Accordion/Accordion.mjs +270 -0
- package/dist/composites/ConfirmationDialog/ConfirmationDialog.cjs +206 -0
- package/dist/composites/ConfirmationDialog/ConfirmationDialog.d.cts +166 -0
- package/dist/composites/ConfirmationDialog/ConfirmationDialog.d.mts +166 -0
- package/dist/composites/ConfirmationDialog/ConfirmationDialog.mjs +203 -0
- package/dist/composites/Dialog/Dialog.cjs +372 -0
- package/dist/composites/Dialog/Dialog.d.cts +234 -0
- package/dist/composites/Dialog/Dialog.d.mts +234 -0
- package/dist/composites/Dialog/Dialog.mjs +360 -0
- package/dist/composites/Disclosure/Disclosure.cjs +214 -0
- package/dist/composites/Disclosure/Disclosure.d.cts +118 -0
- package/dist/composites/Disclosure/Disclosure.d.mts +118 -0
- package/dist/composites/Disclosure/Disclosure.mjs +207 -0
- package/dist/composites/Form/Form.cjs +161 -0
- package/dist/composites/Form/Form.d.cts +176 -0
- package/dist/composites/Form/Form.d.mts +176 -0
- package/dist/composites/Form/Form.mjs +156 -0
- package/dist/composites/Menu/Menu.cjs +190 -0
- package/dist/composites/Menu/Menu.d.cts +158 -0
- package/dist/composites/Menu/Menu.d.mts +158 -0
- package/dist/composites/Menu/Menu.mjs +186 -0
- package/dist/composites/Popover/Popover.cjs +80 -0
- package/dist/composites/Popover/Popover.d.cts +56 -0
- package/dist/composites/Popover/Popover.d.mts +56 -0
- package/dist/composites/Popover/Popover.mjs +78 -0
- package/dist/composites/SearchField/SearchField.cjs +194 -0
- package/dist/composites/SearchField/SearchField.d.cts +81 -0
- package/dist/composites/SearchField/SearchField.d.mts +81 -0
- package/dist/composites/SearchField/SearchField.mjs +189 -0
- package/dist/composites/TagGroup/TagGroup.cjs +212 -0
- package/dist/composites/TagGroup/TagGroup.d.cts +84 -0
- package/dist/composites/TagGroup/TagGroup.d.mts +84 -0
- package/dist/composites/TagGroup/TagGroup.mjs +209 -0
- package/dist/composites/TextArea/TextArea.cjs +190 -0
- package/dist/composites/TextArea/TextArea.d.cts +95 -0
- package/dist/composites/TextArea/TextArea.d.mts +95 -0
- package/dist/composites/TextArea/TextArea.mjs +181 -0
- package/dist/composites/TextField/TextField.cjs +200 -0
- package/dist/composites/TextField/TextField.d.cts +111 -0
- package/dist/composites/TextField/TextField.d.mts +111 -0
- package/dist/composites/TextField/TextField.mjs +191 -0
- package/dist/composites/Tooltip/Tooltip.cjs +79 -0
- package/dist/composites/Tooltip/Tooltip.d.cts +53 -0
- package/dist/composites/Tooltip/Tooltip.d.mts +53 -0
- package/dist/composites/Tooltip/Tooltip.mjs +77 -0
- package/dist/composites/Wizard/Wizard.cjs +333 -0
- package/dist/composites/Wizard/Wizard.d.cts +206 -0
- package/dist/composites/Wizard/Wizard.d.mts +206 -0
- package/dist/composites/Wizard/Wizard.mjs +324 -0
- package/dist/composites/scope.cjs +124 -0
- package/dist/composites/scope.mjs +121 -0
- package/dist/index.cjs +186 -0
- package/dist/index.d.cts +37 -0
- package/dist/index.d.mts +37 -0
- package/dist/index.mjs +39 -0
- package/dist/semantics/componentMeta.d.cts +37 -0
- package/dist/semantics/componentMeta.d.mts +37 -0
- package/dist/semantics/index.cjs +16 -0
- package/dist/semantics/index.d.cts +4 -0
- package/dist/semantics/index.d.mts +4 -0
- package/dist/semantics/index.mjs +3 -0
- package/dist/semantics/taxonomy.cjs +150 -0
- package/dist/semantics/taxonomy.d.cts +153 -0
- package/dist/semantics/taxonomy.d.mts +153 -0
- package/dist/semantics/taxonomy.mjs +140 -0
- package/dist/tokens/escapeHatch.cjs +13 -0
- package/dist/tokens/escapeHatch.mjs +13 -0
- package/dist/tokens/focusRing.cjs +28 -0
- package/dist/tokens/focusRing.mjs +28 -0
- package/dist/tokens/keyframes.cjs +76 -0
- package/dist/tokens/keyframes.mjs +75 -0
- package/dist/tokens/resolveInteractiveStyle.cjs +41 -0
- package/dist/tokens/resolveInteractiveStyle.mjs +41 -0
- package/llms.txt +142 -0
- package/package.json +70 -0
- package/src/tokens/CONTRACT.md +505 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
|
|
2
|
+
import { ListBoxItemProps, SelectProps } from "react-aria-components";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Select/Select.d.ts
|
|
6
|
+
declare const selectMeta: {
|
|
7
|
+
readonly displayName: "Select";
|
|
8
|
+
readonly entity: "Selection";
|
|
9
|
+
readonly structure: "root";
|
|
10
|
+
};
|
|
11
|
+
declare const selectItemMeta: {
|
|
12
|
+
readonly displayName: "SelectItem";
|
|
13
|
+
readonly entity: "Selection";
|
|
14
|
+
readonly structure: "item";
|
|
15
|
+
readonly composition: "selection";
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Props for the Select component.
|
|
19
|
+
*/
|
|
20
|
+
interface SelectProps$1<T extends object = object> extends Omit<SelectProps<T>, 'style' | 'children'> {
|
|
21
|
+
/** Label displayed above the trigger button. */
|
|
22
|
+
label?: React.ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Placeholder shown in the trigger when no value is selected.
|
|
25
|
+
*
|
|
26
|
+
* Ships a documented English fallback (`'Select…'`) — the placeholder is
|
|
27
|
+
* supplementary hint text, not a flow-critical label (CONTRIBUTING §6 /
|
|
28
|
+
* ADR-001). Localized hosts should still supply their own copy.
|
|
29
|
+
* @default 'Select…'
|
|
30
|
+
*/
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
/** `SelectItem` children rendered inside the dropdown ListBox. */
|
|
33
|
+
children?: React.ReactNode;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A semantic dropdown selection built on React Aria.
|
|
37
|
+
*
|
|
38
|
+
* Composes a trigger `Button`, a floating `Popover`, and a `ListBox`.
|
|
39
|
+
* Use `SelectItem` for each option.
|
|
40
|
+
*
|
|
41
|
+
* Entity = Selection, interaction = `select.single`. Validation feedback is
|
|
42
|
+
* driven by React Aria's `isInvalid` and surfaces on the trigger via the
|
|
43
|
+
* `invalid` token State.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* <Select label="Framework" placeholder="Choose a framework">
|
|
48
|
+
* <SelectItem id="react">React</SelectItem>
|
|
49
|
+
* <SelectItem id="vue">Vue</SelectItem>
|
|
50
|
+
* <SelectItem id="angular">Angular</SelectItem>
|
|
51
|
+
* </Select>
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
declare const Select$1: {
|
|
55
|
+
<T extends object = object>({
|
|
56
|
+
label,
|
|
57
|
+
placeholder,
|
|
58
|
+
children,
|
|
59
|
+
...props
|
|
60
|
+
}: SelectProps$1<T>): import("react/jsx-runtime").JSX.Element;
|
|
61
|
+
displayName: "Select";
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Props for the SelectItem component.
|
|
65
|
+
*/
|
|
66
|
+
type SelectItemProps = Omit<ListBoxItemProps, 'style'>;
|
|
67
|
+
/**
|
|
68
|
+
* A single option inside a `Select` dropdown.
|
|
69
|
+
*
|
|
70
|
+
* Renders interactive hover/focus/selected states via
|
|
71
|
+
* `vars.colors.input.primary.*`.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```tsx
|
|
75
|
+
* <SelectItem id="react">React</SelectItem>
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
declare const SelectItem: {
|
|
79
|
+
({
|
|
80
|
+
children,
|
|
81
|
+
...props
|
|
82
|
+
}: SelectItemProps): import("react/jsx-runtime").JSX.Element;
|
|
83
|
+
displayName: "SelectItem";
|
|
84
|
+
};
|
|
85
|
+
//#endregion
|
|
86
|
+
export { Select$1 as Select, SelectItem, SelectItemProps, SelectProps$1 as SelectProps, selectItemMeta, selectMeta };
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
+
import { focusRingOutline } from "../../tokens/focusRing.mjs";
|
|
3
|
+
import { resolveInteractiveStyle } from "../../tokens/resolveInteractiveStyle.mjs";
|
|
4
|
+
import { Icon } from "../Icon/Icon.mjs";
|
|
5
|
+
import { vars } from "@ttoss/fsl-theme/vars";
|
|
6
|
+
import { Button, Label, ListBox, ListBoxItem, Popover, Select, SelectValue } from "react-aria-components";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
|
|
9
|
+
//#region src/components/Select/Select.tsx
|
|
10
|
+
var selectMeta = {
|
|
11
|
+
displayName: "Select",
|
|
12
|
+
entity: "Selection",
|
|
13
|
+
structure: "root"
|
|
14
|
+
};
|
|
15
|
+
var selectItemMeta = {
|
|
16
|
+
displayName: "SelectItem",
|
|
17
|
+
entity: "Selection",
|
|
18
|
+
structure: "item",
|
|
19
|
+
composition: "selection"
|
|
20
|
+
};
|
|
21
|
+
/** Trigger label color — invalid dominates default (Selection has no evaluation). */
|
|
22
|
+
var resolveSelectLabelColor = ({
|
|
23
|
+
c,
|
|
24
|
+
isInvalid
|
|
25
|
+
}) => {
|
|
26
|
+
const text = c?.text;
|
|
27
|
+
return isInvalid ? text?.invalid : text?.default;
|
|
28
|
+
};
|
|
29
|
+
/** Dropdown popover surface style — Selection-entity chrome. */
|
|
30
|
+
var buildPopoverStyle = c => {
|
|
31
|
+
return {
|
|
32
|
+
boxSizing: "border-box",
|
|
33
|
+
borderRadius: vars.radii.control,
|
|
34
|
+
borderWidth: vars.border.outline.control.width,
|
|
35
|
+
borderStyle: vars.border.outline.control.style,
|
|
36
|
+
borderColor: c?.border?.default,
|
|
37
|
+
backgroundColor: c?.background?.default,
|
|
38
|
+
overflow: "hidden"
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* A semantic dropdown selection built on React Aria.
|
|
43
|
+
*
|
|
44
|
+
* Composes a trigger `Button`, a floating `Popover`, and a `ListBox`.
|
|
45
|
+
* Use `SelectItem` for each option.
|
|
46
|
+
*
|
|
47
|
+
* Entity = Selection, interaction = `select.single`. Validation feedback is
|
|
48
|
+
* driven by React Aria's `isInvalid` and surfaces on the trigger via the
|
|
49
|
+
* `invalid` token State.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```tsx
|
|
53
|
+
* <Select label="Framework" placeholder="Choose a framework">
|
|
54
|
+
* <SelectItem id="react">React</SelectItem>
|
|
55
|
+
* <SelectItem id="vue">Vue</SelectItem>
|
|
56
|
+
* <SelectItem id="angular">Angular</SelectItem>
|
|
57
|
+
* </Select>
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
var Select$1 = ({
|
|
61
|
+
label,
|
|
62
|
+
placeholder = "Select…",
|
|
63
|
+
children,
|
|
64
|
+
...props
|
|
65
|
+
}) => {
|
|
66
|
+
const c = vars.colors.input.primary;
|
|
67
|
+
return /* @__PURE__ */jsx(Select, {
|
|
68
|
+
...props,
|
|
69
|
+
"data-scope": "select",
|
|
70
|
+
"data-part": "root",
|
|
71
|
+
style: {
|
|
72
|
+
boxSizing: "border-box",
|
|
73
|
+
display: "inline-flex",
|
|
74
|
+
flexDirection: "column",
|
|
75
|
+
gap: vars.spacing.gap.stack.xs
|
|
76
|
+
},
|
|
77
|
+
children: ({
|
|
78
|
+
isInvalid
|
|
79
|
+
}) => {
|
|
80
|
+
return /* @__PURE__ */jsxs(Fragment, {
|
|
81
|
+
children: [label && /* @__PURE__ */jsx(Label, {
|
|
82
|
+
"data-scope": "select",
|
|
83
|
+
"data-part": "label",
|
|
84
|
+
style: {
|
|
85
|
+
...vars.text.label.md,
|
|
86
|
+
color: resolveSelectLabelColor({
|
|
87
|
+
c,
|
|
88
|
+
isInvalid
|
|
89
|
+
})
|
|
90
|
+
},
|
|
91
|
+
children: label
|
|
92
|
+
}), /* @__PURE__ */jsxs(Button, {
|
|
93
|
+
"data-scope": "select",
|
|
94
|
+
"data-part": "trigger",
|
|
95
|
+
style: ({
|
|
96
|
+
isHovered,
|
|
97
|
+
isPressed,
|
|
98
|
+
isDisabled,
|
|
99
|
+
isFocusVisible
|
|
100
|
+
}) => {
|
|
101
|
+
return {
|
|
102
|
+
boxSizing: "border-box",
|
|
103
|
+
display: "inline-flex",
|
|
104
|
+
alignItems: "center",
|
|
105
|
+
justifyContent: "space-between",
|
|
106
|
+
gap: vars.spacing.gap.inline.sm,
|
|
107
|
+
minHeight: vars.sizing.hit.base,
|
|
108
|
+
paddingBlock: vars.spacing.inset.control.md,
|
|
109
|
+
paddingInline: vars.spacing.inset.control.md,
|
|
110
|
+
borderRadius: vars.radii.control,
|
|
111
|
+
borderWidth: vars.border.outline.control.width,
|
|
112
|
+
borderStyle: vars.border.outline.control.style,
|
|
113
|
+
...vars.text.label.md,
|
|
114
|
+
cursor: isDisabled ? "not-allowed" : "pointer",
|
|
115
|
+
opacity: isDisabled ? vars.opacity.disabled : void 0,
|
|
116
|
+
backgroundColor: resolveInteractiveStyle(c?.background, {
|
|
117
|
+
isDisabled,
|
|
118
|
+
isInvalid,
|
|
119
|
+
isHovered,
|
|
120
|
+
isPressed
|
|
121
|
+
}),
|
|
122
|
+
borderColor: resolveInteractiveStyle(c?.border, {
|
|
123
|
+
isDisabled,
|
|
124
|
+
isInvalid,
|
|
125
|
+
isFocusVisible
|
|
126
|
+
}),
|
|
127
|
+
color: resolveInteractiveStyle(c?.text, {
|
|
128
|
+
isDisabled,
|
|
129
|
+
isInvalid,
|
|
130
|
+
isHovered,
|
|
131
|
+
isPressed
|
|
132
|
+
}) ?? c?.text?.default,
|
|
133
|
+
transitionProperty: "background-color, border-color, color",
|
|
134
|
+
transitionDuration: vars.motion.feedback.duration,
|
|
135
|
+
transitionTimingFunction: vars.motion.feedback.easing,
|
|
136
|
+
outline: focusRingOutline(isFocusVisible)
|
|
137
|
+
};
|
|
138
|
+
},
|
|
139
|
+
children: [/* @__PURE__ */jsx(SelectValue, {
|
|
140
|
+
"data-scope": "select",
|
|
141
|
+
"data-part": "content",
|
|
142
|
+
style: {
|
|
143
|
+
flex: 1
|
|
144
|
+
},
|
|
145
|
+
children: ({
|
|
146
|
+
selectedText,
|
|
147
|
+
isPlaceholder
|
|
148
|
+
}) => {
|
|
149
|
+
return /* @__PURE__ */jsx("span", {
|
|
150
|
+
style: {
|
|
151
|
+
color: isPlaceholder ? c?.text?.disabled : void 0
|
|
152
|
+
},
|
|
153
|
+
children: isPlaceholder ? placeholder : selectedText
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}), /* @__PURE__ */jsx("span", {
|
|
157
|
+
"data-scope": "select",
|
|
158
|
+
"data-part": "icon",
|
|
159
|
+
"aria-hidden": true,
|
|
160
|
+
style: {
|
|
161
|
+
flexShrink: 0
|
|
162
|
+
},
|
|
163
|
+
children: /* @__PURE__ */jsx(Icon, {
|
|
164
|
+
intent: "disclosure.expand"
|
|
165
|
+
})
|
|
166
|
+
})]
|
|
167
|
+
}), /* @__PURE__ */jsx(Popover, {
|
|
168
|
+
"data-scope": "select",
|
|
169
|
+
"data-part": "positioner",
|
|
170
|
+
style: buildPopoverStyle(c),
|
|
171
|
+
children: /* @__PURE__ */jsx(ListBox, {
|
|
172
|
+
"data-scope": "select",
|
|
173
|
+
"data-part": "surface",
|
|
174
|
+
style: {
|
|
175
|
+
outline: "none",
|
|
176
|
+
display: "flex",
|
|
177
|
+
flexDirection: "column",
|
|
178
|
+
padding: vars.spacing.inset.control.md,
|
|
179
|
+
gap: vars.spacing.gap.stack.xs
|
|
180
|
+
},
|
|
181
|
+
children
|
|
182
|
+
})
|
|
183
|
+
})]
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
Select$1.displayName = selectMeta.displayName;
|
|
189
|
+
/**
|
|
190
|
+
* A single option inside a `Select` dropdown.
|
|
191
|
+
*
|
|
192
|
+
* Renders interactive hover/focus/selected states via
|
|
193
|
+
* `vars.colors.input.primary.*`.
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* ```tsx
|
|
197
|
+
* <SelectItem id="react">React</SelectItem>
|
|
198
|
+
* ```
|
|
199
|
+
*/
|
|
200
|
+
var SelectItem = ({
|
|
201
|
+
children,
|
|
202
|
+
...props
|
|
203
|
+
}) => {
|
|
204
|
+
const c = vars.colors.input.primary;
|
|
205
|
+
return /* @__PURE__ */jsx(ListBoxItem, {
|
|
206
|
+
...props,
|
|
207
|
+
"data-scope": "select",
|
|
208
|
+
"data-part": "item",
|
|
209
|
+
style: ({
|
|
210
|
+
isHovered,
|
|
211
|
+
isPressed,
|
|
212
|
+
isDisabled,
|
|
213
|
+
isFocusVisible,
|
|
214
|
+
isSelected
|
|
215
|
+
}) => {
|
|
216
|
+
return {
|
|
217
|
+
boxSizing: "border-box",
|
|
218
|
+
display: "flex",
|
|
219
|
+
alignItems: "center",
|
|
220
|
+
paddingBlock: vars.spacing.inset.control.md,
|
|
221
|
+
paddingInline: vars.spacing.inset.control.md,
|
|
222
|
+
borderRadius: vars.radii.control,
|
|
223
|
+
cursor: isDisabled ? "not-allowed" : "pointer",
|
|
224
|
+
opacity: isDisabled ? vars.opacity.disabled : void 0,
|
|
225
|
+
...vars.text.label.md,
|
|
226
|
+
backgroundColor: resolveInteractiveStyle(c?.background, {
|
|
227
|
+
isDisabled,
|
|
228
|
+
isSelected,
|
|
229
|
+
isHovered,
|
|
230
|
+
isPressed
|
|
231
|
+
}),
|
|
232
|
+
color: resolveInteractiveStyle(c?.text, {
|
|
233
|
+
isDisabled,
|
|
234
|
+
isSelected,
|
|
235
|
+
isHovered
|
|
236
|
+
}) ?? c?.text?.default,
|
|
237
|
+
outline: focusRingOutline(isFocusVisible),
|
|
238
|
+
outlineOffset: "2px",
|
|
239
|
+
transitionProperty: "background-color, color",
|
|
240
|
+
transitionDuration: vars.motion.feedback.duration,
|
|
241
|
+
transitionTimingFunction: vars.motion.feedback.easing
|
|
242
|
+
};
|
|
243
|
+
},
|
|
244
|
+
children
|
|
245
|
+
});
|
|
246
|
+
};
|
|
247
|
+
SelectItem.displayName = selectItemMeta.displayName;
|
|
248
|
+
|
|
249
|
+
//#endregion
|
|
250
|
+
export { Select$1 as Select, SelectItem, selectItemMeta, selectMeta };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
+
let _ttoss_fsl_theme_vars = require("@ttoss/fsl-theme/vars");
|
|
3
|
+
let react_aria_components = require("react-aria-components");
|
|
4
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
5
|
+
|
|
6
|
+
//#region src/components/Separator/Separator.tsx
|
|
7
|
+
/** Formal semantic identity — Separator root (Structure entity, divider). */
|
|
8
|
+
var separatorMeta = {
|
|
9
|
+
displayName: "Separator",
|
|
10
|
+
entity: "Structure",
|
|
11
|
+
structure: "root"
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* A semantic divider that separates content groups.
|
|
15
|
+
*
|
|
16
|
+
* Entity = Structure → reads `vars.colors.informational.*` for the line color
|
|
17
|
+
* and `vars.border.divider.*` for its width/style. Non-interactive: it has no
|
|
18
|
+
* hover/focus state. Orientation follows React Aria (`horizontal` default);
|
|
19
|
+
* the painted edge uses logical properties so it is correct under `dir="rtl"`.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <Separator />
|
|
24
|
+
* <Separator orientation="vertical" />
|
|
25
|
+
* <Separator evaluation="primary" />
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
var Separator = ({
|
|
29
|
+
evaluation = "muted",
|
|
30
|
+
orientation = "horizontal",
|
|
31
|
+
...props
|
|
32
|
+
}) => {
|
|
33
|
+
const color = _ttoss_fsl_theme_vars.vars.colors.informational[evaluation]?.border?.default ?? "transparent";
|
|
34
|
+
const isVertical = orientation === "vertical";
|
|
35
|
+
return /* @__PURE__ */(0, react_jsx_runtime.jsx)(react_aria_components.Separator, {
|
|
36
|
+
...props,
|
|
37
|
+
orientation,
|
|
38
|
+
"data-scope": "separator",
|
|
39
|
+
"data-part": "root",
|
|
40
|
+
"data-evaluation": evaluation,
|
|
41
|
+
style: {
|
|
42
|
+
boxSizing: "border-box",
|
|
43
|
+
margin: 0,
|
|
44
|
+
border: 0,
|
|
45
|
+
flexShrink: 0,
|
|
46
|
+
...(isVertical ? {
|
|
47
|
+
alignSelf: "stretch",
|
|
48
|
+
borderInlineStartWidth: _ttoss_fsl_theme_vars.vars.border.divider.width,
|
|
49
|
+
borderInlineStartStyle: _ttoss_fsl_theme_vars.vars.border.divider.style,
|
|
50
|
+
borderInlineStartColor: color
|
|
51
|
+
} : {
|
|
52
|
+
width: "100%",
|
|
53
|
+
borderBlockStartWidth: _ttoss_fsl_theme_vars.vars.border.divider.width,
|
|
54
|
+
borderBlockStartStyle: _ttoss_fsl_theme_vars.vars.border.divider.style,
|
|
55
|
+
borderBlockStartColor: color
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
Separator.displayName = separatorMeta.displayName;
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
exports.Separator = Separator;
|
|
64
|
+
exports.separatorMeta = separatorMeta;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
|
|
2
|
+
import { EvaluationsFor } from "../../semantics/taxonomy.cjs";
|
|
3
|
+
import { SeparatorProps } from "react-aria-components";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Separator/Separator.d.ts
|
|
6
|
+
/** Formal semantic identity — Separator root (Structure entity, divider). */
|
|
7
|
+
declare const separatorMeta: {
|
|
8
|
+
readonly displayName: "Separator";
|
|
9
|
+
readonly entity: "Structure";
|
|
10
|
+
readonly structure: "root";
|
|
11
|
+
};
|
|
12
|
+
/** Props for the Separator component. */
|
|
13
|
+
interface SeparatorProps$1 extends Omit<SeparatorProps, 'style'> {
|
|
14
|
+
/**
|
|
15
|
+
* Semantic emphasis of the divider line.
|
|
16
|
+
* @default 'muted'
|
|
17
|
+
*/
|
|
18
|
+
evaluation?: EvaluationsFor<(typeof separatorMeta)['entity']>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A semantic divider that separates content groups.
|
|
22
|
+
*
|
|
23
|
+
* Entity = Structure → reads `vars.colors.informational.*` for the line color
|
|
24
|
+
* and `vars.border.divider.*` for its width/style. Non-interactive: it has no
|
|
25
|
+
* hover/focus state. Orientation follows React Aria (`horizontal` default);
|
|
26
|
+
* the painted edge uses logical properties so it is correct under `dir="rtl"`.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <Separator />
|
|
31
|
+
* <Separator orientation="vertical" />
|
|
32
|
+
* <Separator evaluation="primary" />
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
declare const Separator: {
|
|
36
|
+
({
|
|
37
|
+
evaluation,
|
|
38
|
+
orientation,
|
|
39
|
+
...props
|
|
40
|
+
}: SeparatorProps$1): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
displayName: "Separator";
|
|
42
|
+
};
|
|
43
|
+
//#endregion
|
|
44
|
+
export { Separator, SeparatorProps$1 as SeparatorProps, separatorMeta };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
|
|
2
|
+
import { EvaluationsFor } from "../../semantics/taxonomy.mjs";
|
|
3
|
+
import { SeparatorProps } from "react-aria-components";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Separator/Separator.d.ts
|
|
6
|
+
/** Formal semantic identity — Separator root (Structure entity, divider). */
|
|
7
|
+
declare const separatorMeta: {
|
|
8
|
+
readonly displayName: "Separator";
|
|
9
|
+
readonly entity: "Structure";
|
|
10
|
+
readonly structure: "root";
|
|
11
|
+
};
|
|
12
|
+
/** Props for the Separator component. */
|
|
13
|
+
interface SeparatorProps$1 extends Omit<SeparatorProps, 'style'> {
|
|
14
|
+
/**
|
|
15
|
+
* Semantic emphasis of the divider line.
|
|
16
|
+
* @default 'muted'
|
|
17
|
+
*/
|
|
18
|
+
evaluation?: EvaluationsFor<(typeof separatorMeta)['entity']>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A semantic divider that separates content groups.
|
|
22
|
+
*
|
|
23
|
+
* Entity = Structure → reads `vars.colors.informational.*` for the line color
|
|
24
|
+
* and `vars.border.divider.*` for its width/style. Non-interactive: it has no
|
|
25
|
+
* hover/focus state. Orientation follows React Aria (`horizontal` default);
|
|
26
|
+
* the painted edge uses logical properties so it is correct under `dir="rtl"`.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <Separator />
|
|
31
|
+
* <Separator orientation="vertical" />
|
|
32
|
+
* <Separator evaluation="primary" />
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
declare const Separator$1: {
|
|
36
|
+
({
|
|
37
|
+
evaluation,
|
|
38
|
+
orientation,
|
|
39
|
+
...props
|
|
40
|
+
}: SeparatorProps$1): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
displayName: "Separator";
|
|
42
|
+
};
|
|
43
|
+
//#endregion
|
|
44
|
+
export { Separator$1 as Separator, SeparatorProps$1 as SeparatorProps, separatorMeta };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
+
import { vars } from "@ttoss/fsl-theme/vars";
|
|
3
|
+
import { Separator } from "react-aria-components";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/components/Separator/Separator.tsx
|
|
7
|
+
/** Formal semantic identity — Separator root (Structure entity, divider). */
|
|
8
|
+
var separatorMeta = {
|
|
9
|
+
displayName: "Separator",
|
|
10
|
+
entity: "Structure",
|
|
11
|
+
structure: "root"
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* A semantic divider that separates content groups.
|
|
15
|
+
*
|
|
16
|
+
* Entity = Structure → reads `vars.colors.informational.*` for the line color
|
|
17
|
+
* and `vars.border.divider.*` for its width/style. Non-interactive: it has no
|
|
18
|
+
* hover/focus state. Orientation follows React Aria (`horizontal` default);
|
|
19
|
+
* the painted edge uses logical properties so it is correct under `dir="rtl"`.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <Separator />
|
|
24
|
+
* <Separator orientation="vertical" />
|
|
25
|
+
* <Separator evaluation="primary" />
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
var Separator$1 = ({
|
|
29
|
+
evaluation = "muted",
|
|
30
|
+
orientation = "horizontal",
|
|
31
|
+
...props
|
|
32
|
+
}) => {
|
|
33
|
+
const color = vars.colors.informational[evaluation]?.border?.default ?? "transparent";
|
|
34
|
+
const isVertical = orientation === "vertical";
|
|
35
|
+
return /* @__PURE__ */jsx(Separator, {
|
|
36
|
+
...props,
|
|
37
|
+
orientation,
|
|
38
|
+
"data-scope": "separator",
|
|
39
|
+
"data-part": "root",
|
|
40
|
+
"data-evaluation": evaluation,
|
|
41
|
+
style: {
|
|
42
|
+
boxSizing: "border-box",
|
|
43
|
+
margin: 0,
|
|
44
|
+
border: 0,
|
|
45
|
+
flexShrink: 0,
|
|
46
|
+
...(isVertical ? {
|
|
47
|
+
alignSelf: "stretch",
|
|
48
|
+
borderInlineStartWidth: vars.border.divider.width,
|
|
49
|
+
borderInlineStartStyle: vars.border.divider.style,
|
|
50
|
+
borderInlineStartColor: color
|
|
51
|
+
} : {
|
|
52
|
+
width: "100%",
|
|
53
|
+
borderBlockStartWidth: vars.border.divider.width,
|
|
54
|
+
borderBlockStartStyle: vars.border.divider.style,
|
|
55
|
+
borderBlockStartColor: color
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
Separator$1.displayName = separatorMeta.displayName;
|
|
61
|
+
|
|
62
|
+
//#endregion
|
|
63
|
+
export { Separator$1 as Separator, separatorMeta };
|