@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.
Files changed (174) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +76 -0
  3. package/dist/_virtual/_rolldown/runtime.cjs +30 -0
  4. package/dist/components/Breadcrumbs/Breadcrumbs.cjs +129 -0
  5. package/dist/components/Breadcrumbs/Breadcrumbs.d.cts +61 -0
  6. package/dist/components/Breadcrumbs/Breadcrumbs.d.mts +61 -0
  7. package/dist/components/Breadcrumbs/Breadcrumbs.mjs +126 -0
  8. package/dist/components/Button/Button.cjs +80 -0
  9. package/dist/components/Button/Button.d.cts +68 -0
  10. package/dist/components/Button/Button.d.mts +68 -0
  11. package/dist/components/Button/Button.mjs +79 -0
  12. package/dist/components/Checkbox/Checkbox.cjs +183 -0
  13. package/dist/components/Checkbox/Checkbox.d.cts +45 -0
  14. package/dist/components/Checkbox/Checkbox.d.mts +45 -0
  15. package/dist/components/Checkbox/Checkbox.mjs +182 -0
  16. package/dist/components/CheckboxGroup/CheckboxGroup.cjs +97 -0
  17. package/dist/components/CheckboxGroup/CheckboxGroup.d.cts +56 -0
  18. package/dist/components/CheckboxGroup/CheckboxGroup.d.mts +56 -0
  19. package/dist/components/CheckboxGroup/CheckboxGroup.mjs +96 -0
  20. package/dist/components/FileTrigger/FileTrigger.cjs +51 -0
  21. package/dist/components/FileTrigger/FileTrigger.d.cts +52 -0
  22. package/dist/components/FileTrigger/FileTrigger.d.mts +52 -0
  23. package/dist/components/FileTrigger/FileTrigger.mjs +50 -0
  24. package/dist/components/GridList/GridList.cjs +220 -0
  25. package/dist/components/GridList/GridList.d.cts +72 -0
  26. package/dist/components/GridList/GridList.d.mts +72 -0
  27. package/dist/components/GridList/GridList.mjs +217 -0
  28. package/dist/components/Group/Group.cjs +77 -0
  29. package/dist/components/Group/Group.d.cts +61 -0
  30. package/dist/components/Group/Group.d.mts +61 -0
  31. package/dist/components/Group/Group.mjs +74 -0
  32. package/dist/components/Icon/Icon.cjs +52 -0
  33. package/dist/components/Icon/Icon.mjs +52 -0
  34. package/dist/components/Icon/glyphs.cjs +72 -0
  35. package/dist/components/Icon/glyphs.mjs +63 -0
  36. package/dist/components/Link/Link.cjs +62 -0
  37. package/dist/components/Link/Link.d.cts +38 -0
  38. package/dist/components/Link/Link.d.mts +38 -0
  39. package/dist/components/Link/Link.mjs +61 -0
  40. package/dist/components/ListBox/ListBox.cjs +126 -0
  41. package/dist/components/ListBox/ListBox.d.cts +63 -0
  42. package/dist/components/ListBox/ListBox.d.mts +63 -0
  43. package/dist/components/ListBox/ListBox.mjs +123 -0
  44. package/dist/components/Meter/Meter.cjs +126 -0
  45. package/dist/components/Meter/Meter.d.cts +63 -0
  46. package/dist/components/Meter/Meter.d.mts +63 -0
  47. package/dist/components/Meter/Meter.mjs +125 -0
  48. package/dist/components/NumberField/NumberField.cjs +221 -0
  49. package/dist/components/NumberField/NumberField.d.cts +68 -0
  50. package/dist/components/NumberField/NumberField.d.mts +68 -0
  51. package/dist/components/NumberField/NumberField.mjs +220 -0
  52. package/dist/components/ProgressBar/ProgressBar.cjs +132 -0
  53. package/dist/components/ProgressBar/ProgressBar.d.cts +56 -0
  54. package/dist/components/ProgressBar/ProgressBar.d.mts +56 -0
  55. package/dist/components/ProgressBar/ProgressBar.mjs +129 -0
  56. package/dist/components/RadioGroup/RadioGroup.cjs +218 -0
  57. package/dist/components/RadioGroup/RadioGroup.d.cts +82 -0
  58. package/dist/components/RadioGroup/RadioGroup.d.mts +82 -0
  59. package/dist/components/RadioGroup/RadioGroup.mjs +215 -0
  60. package/dist/components/Select/Select.cjs +253 -0
  61. package/dist/components/Select/Select.d.cts +86 -0
  62. package/dist/components/Select/Select.d.mts +86 -0
  63. package/dist/components/Select/Select.mjs +250 -0
  64. package/dist/components/Separator/Separator.cjs +64 -0
  65. package/dist/components/Separator/Separator.d.cts +44 -0
  66. package/dist/components/Separator/Separator.d.mts +44 -0
  67. package/dist/components/Separator/Separator.mjs +63 -0
  68. package/dist/components/Slider/Slider.cjs +160 -0
  69. package/dist/components/Slider/Slider.d.cts +45 -0
  70. package/dist/components/Slider/Slider.d.mts +45 -0
  71. package/dist/components/Slider/Slider.mjs +159 -0
  72. package/dist/components/Switch/Switch.cjs +176 -0
  73. package/dist/components/Switch/Switch.d.cts +43 -0
  74. package/dist/components/Switch/Switch.d.mts +43 -0
  75. package/dist/components/Switch/Switch.mjs +175 -0
  76. package/dist/components/Tabs/Tabs.cjs +180 -0
  77. package/dist/components/Tabs/Tabs.d.cts +85 -0
  78. package/dist/components/Tabs/Tabs.d.mts +85 -0
  79. package/dist/components/Tabs/Tabs.mjs +173 -0
  80. package/dist/components/Toast/Toast.cjs +218 -0
  81. package/dist/components/Toast/Toast.d.cts +96 -0
  82. package/dist/components/Toast/Toast.d.mts +96 -0
  83. package/dist/components/Toast/Toast.mjs +214 -0
  84. package/dist/components/ToggleButton/ToggleButton.cjs +125 -0
  85. package/dist/components/ToggleButton/ToggleButton.d.cts +43 -0
  86. package/dist/components/ToggleButton/ToggleButton.d.mts +43 -0
  87. package/dist/components/ToggleButton/ToggleButton.mjs +124 -0
  88. package/dist/components/ToggleButtonGroup/ToggleButtonGroup.cjs +48 -0
  89. package/dist/components/ToggleButtonGroup/ToggleButtonGroup.d.cts +41 -0
  90. package/dist/components/ToggleButtonGroup/ToggleButtonGroup.d.mts +41 -0
  91. package/dist/components/ToggleButtonGroup/ToggleButtonGroup.mjs +47 -0
  92. package/dist/components/Toolbar/Toolbar.cjs +67 -0
  93. package/dist/components/Toolbar/Toolbar.d.cts +60 -0
  94. package/dist/components/Toolbar/Toolbar.d.mts +60 -0
  95. package/dist/components/Toolbar/Toolbar.mjs +66 -0
  96. package/dist/composites/Accordion/Accordion.cjs +279 -0
  97. package/dist/composites/Accordion/Accordion.d.cts +176 -0
  98. package/dist/composites/Accordion/Accordion.d.mts +176 -0
  99. package/dist/composites/Accordion/Accordion.mjs +270 -0
  100. package/dist/composites/ConfirmationDialog/ConfirmationDialog.cjs +206 -0
  101. package/dist/composites/ConfirmationDialog/ConfirmationDialog.d.cts +166 -0
  102. package/dist/composites/ConfirmationDialog/ConfirmationDialog.d.mts +166 -0
  103. package/dist/composites/ConfirmationDialog/ConfirmationDialog.mjs +203 -0
  104. package/dist/composites/Dialog/Dialog.cjs +372 -0
  105. package/dist/composites/Dialog/Dialog.d.cts +234 -0
  106. package/dist/composites/Dialog/Dialog.d.mts +234 -0
  107. package/dist/composites/Dialog/Dialog.mjs +360 -0
  108. package/dist/composites/Disclosure/Disclosure.cjs +214 -0
  109. package/dist/composites/Disclosure/Disclosure.d.cts +118 -0
  110. package/dist/composites/Disclosure/Disclosure.d.mts +118 -0
  111. package/dist/composites/Disclosure/Disclosure.mjs +207 -0
  112. package/dist/composites/Form/Form.cjs +161 -0
  113. package/dist/composites/Form/Form.d.cts +176 -0
  114. package/dist/composites/Form/Form.d.mts +176 -0
  115. package/dist/composites/Form/Form.mjs +156 -0
  116. package/dist/composites/Menu/Menu.cjs +190 -0
  117. package/dist/composites/Menu/Menu.d.cts +158 -0
  118. package/dist/composites/Menu/Menu.d.mts +158 -0
  119. package/dist/composites/Menu/Menu.mjs +186 -0
  120. package/dist/composites/Popover/Popover.cjs +80 -0
  121. package/dist/composites/Popover/Popover.d.cts +56 -0
  122. package/dist/composites/Popover/Popover.d.mts +56 -0
  123. package/dist/composites/Popover/Popover.mjs +78 -0
  124. package/dist/composites/SearchField/SearchField.cjs +194 -0
  125. package/dist/composites/SearchField/SearchField.d.cts +81 -0
  126. package/dist/composites/SearchField/SearchField.d.mts +81 -0
  127. package/dist/composites/SearchField/SearchField.mjs +189 -0
  128. package/dist/composites/TagGroup/TagGroup.cjs +212 -0
  129. package/dist/composites/TagGroup/TagGroup.d.cts +84 -0
  130. package/dist/composites/TagGroup/TagGroup.d.mts +84 -0
  131. package/dist/composites/TagGroup/TagGroup.mjs +209 -0
  132. package/dist/composites/TextArea/TextArea.cjs +190 -0
  133. package/dist/composites/TextArea/TextArea.d.cts +95 -0
  134. package/dist/composites/TextArea/TextArea.d.mts +95 -0
  135. package/dist/composites/TextArea/TextArea.mjs +181 -0
  136. package/dist/composites/TextField/TextField.cjs +200 -0
  137. package/dist/composites/TextField/TextField.d.cts +111 -0
  138. package/dist/composites/TextField/TextField.d.mts +111 -0
  139. package/dist/composites/TextField/TextField.mjs +191 -0
  140. package/dist/composites/Tooltip/Tooltip.cjs +79 -0
  141. package/dist/composites/Tooltip/Tooltip.d.cts +53 -0
  142. package/dist/composites/Tooltip/Tooltip.d.mts +53 -0
  143. package/dist/composites/Tooltip/Tooltip.mjs +77 -0
  144. package/dist/composites/Wizard/Wizard.cjs +333 -0
  145. package/dist/composites/Wizard/Wizard.d.cts +206 -0
  146. package/dist/composites/Wizard/Wizard.d.mts +206 -0
  147. package/dist/composites/Wizard/Wizard.mjs +324 -0
  148. package/dist/composites/scope.cjs +124 -0
  149. package/dist/composites/scope.mjs +121 -0
  150. package/dist/index.cjs +186 -0
  151. package/dist/index.d.cts +37 -0
  152. package/dist/index.d.mts +37 -0
  153. package/dist/index.mjs +39 -0
  154. package/dist/semantics/componentMeta.d.cts +37 -0
  155. package/dist/semantics/componentMeta.d.mts +37 -0
  156. package/dist/semantics/index.cjs +16 -0
  157. package/dist/semantics/index.d.cts +4 -0
  158. package/dist/semantics/index.d.mts +4 -0
  159. package/dist/semantics/index.mjs +3 -0
  160. package/dist/semantics/taxonomy.cjs +150 -0
  161. package/dist/semantics/taxonomy.d.cts +153 -0
  162. package/dist/semantics/taxonomy.d.mts +153 -0
  163. package/dist/semantics/taxonomy.mjs +140 -0
  164. package/dist/tokens/escapeHatch.cjs +13 -0
  165. package/dist/tokens/escapeHatch.mjs +13 -0
  166. package/dist/tokens/focusRing.cjs +28 -0
  167. package/dist/tokens/focusRing.mjs +28 -0
  168. package/dist/tokens/keyframes.cjs +76 -0
  169. package/dist/tokens/keyframes.mjs +75 -0
  170. package/dist/tokens/resolveInteractiveStyle.cjs +41 -0
  171. package/dist/tokens/resolveInteractiveStyle.mjs +41 -0
  172. package/llms.txt +142 -0
  173. package/package.json +70 -0
  174. package/src/tokens/CONTRACT.md +505 -0
@@ -0,0 +1,68 @@
1
+
2
+ import { CompositionsFor, ConsequencesFor, EvaluationsFor } from "../../semantics/taxonomy.mjs";
3
+ import { ButtonProps } from "react-aria-components";
4
+
5
+ //#region src/components/Button/Button.d.ts
6
+ /**
7
+ * Formal semantic identity — what this component *is* (Layer 1).
8
+ */
9
+ declare const buttonMeta: {
10
+ readonly displayName: "Button";
11
+ readonly entity: "Action";
12
+ readonly structure: "root";
13
+ };
14
+ /**
15
+ * Displays a semantic action trigger (entity: Action).
16
+ *
17
+ * Entity = Action → colors: `action`, radii: `control`, border: `outline.control`,
18
+ * sizing: `hit.base`, spacing: `inset.control.md`, typography: `label.md`, motion: `feedback`.
19
+ */
20
+ interface ButtonProps$1 extends Omit<ButtonProps, 'style'> {
21
+ /**
22
+ * Semantic emphasis.
23
+ * @default 'primary'
24
+ */
25
+ evaluation?: EvaluationsFor<(typeof buttonMeta)['entity']>;
26
+ /**
27
+ * Effect on state this button's action produces. Emitted as
28
+ * `data-consequence` on the DOM so host integrations (confirm wrappers,
29
+ * telemetry, undo/redo hooks) and tests can observe the contract.
30
+ *
31
+ * NOT used for coloring — visual distinction (if any) is a theme /
32
+ * host-CSS concern, matching the same contract as `MenuItem`.
33
+ *
34
+ * @default 'neutral'
35
+ */
36
+ consequence?: ConsequencesFor<(typeof buttonMeta)['entity']>;
37
+ /**
38
+ * Slot this button occupies inside a parent composite (FSL §4).
39
+ * Emitted as `data-composition` on the DOM and consumed at runtime by
40
+ * composites that need to reorder or style actions by role — notably
41
+ * `DialogActions`, which reorders children per platform convention
42
+ * (iOS vs Windows).
43
+ *
44
+ * Orthogonal to `evaluation` (authorial voice) and `consequence`
45
+ * (effect on state): composition is purely *positional* semantics.
46
+ */
47
+ composition?: CompositionsFor<(typeof buttonMeta)['entity']>;
48
+ /**
49
+ * Data scope identifier for the button.
50
+ * @default 'button'
51
+ */
52
+ 'data-scope'?: string;
53
+ }
54
+ /**
55
+ * A semantic action button built on React Aria.
56
+ */
57
+ declare const Button$1: {
58
+ ({
59
+ evaluation,
60
+ consequence,
61
+ composition,
62
+ "data-scope": dataScope,
63
+ ...props
64
+ }: ButtonProps$1): import("react/jsx-runtime").JSX.Element;
65
+ displayName: "Button";
66
+ };
67
+ //#endregion
68
+ export { Button$1 as Button, ButtonProps$1 as ButtonProps, buttonMeta };
@@ -0,0 +1,79 @@
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 { vars } from "@ttoss/fsl-theme/vars";
5
+ import { Button } from "react-aria-components";
6
+ import { jsx } from "react/jsx-runtime";
7
+
8
+ //#region src/components/Button/Button.tsx
9
+ /**
10
+ * Formal semantic identity — what this component *is* (Layer 1).
11
+ */
12
+ var buttonMeta = {
13
+ displayName: "Button",
14
+ entity: "Action",
15
+ structure: "root"
16
+ };
17
+ /**
18
+ * A semantic action button built on React Aria.
19
+ */
20
+ var Button$1 = ({
21
+ evaluation = "primary",
22
+ consequence = "neutral",
23
+ composition,
24
+ "data-scope": dataScope = "button",
25
+ ...props
26
+ }) => {
27
+ const colors = vars.colors.action[evaluation];
28
+ return /* @__PURE__ */jsx(Button, {
29
+ ...props,
30
+ "data-scope": dataScope,
31
+ "data-part": "root",
32
+ "data-evaluation": evaluation,
33
+ "data-consequence": consequence,
34
+ "data-composition": composition,
35
+ style: ({
36
+ isHovered,
37
+ isPressed,
38
+ isDisabled,
39
+ isFocusVisible
40
+ }) => {
41
+ return {
42
+ boxSizing: "border-box",
43
+ display: "inline-flex",
44
+ alignItems: "center",
45
+ justifyContent: "center",
46
+ cursor: isDisabled ? "not-allowed" : "pointer",
47
+ borderRadius: vars.radii.control,
48
+ borderWidth: vars.border.outline.control.width,
49
+ borderStyle: vars.border.outline.control.style,
50
+ minHeight: vars.sizing.hit.base,
51
+ paddingBlock: vars.spacing.inset.control.sm,
52
+ paddingInline: vars.spacing.inset.control.lg,
53
+ ...vars.text.label.md,
54
+ transitionDuration: vars.motion.feedback.duration,
55
+ transitionTimingFunction: vars.motion.feedback.easing,
56
+ transitionProperty: "background-color, border-color, color",
57
+ backgroundColor: resolveInteractiveStyle(colors?.background, {
58
+ isHovered,
59
+ isPressed,
60
+ isDisabled
61
+ }),
62
+ borderColor: resolveInteractiveStyle(colors?.border, {
63
+ isDisabled,
64
+ isFocusVisible
65
+ }),
66
+ color: resolveInteractiveStyle(colors?.text, {
67
+ isHovered,
68
+ isPressed,
69
+ isDisabled
70
+ }) ?? colors?.text?.default,
71
+ outline: focusRingOutline(isFocusVisible)
72
+ };
73
+ }
74
+ });
75
+ };
76
+ Button$1.displayName = buttonMeta.displayName;
77
+
78
+ //#endregion
79
+ export { Button$1 as Button, buttonMeta };
@@ -0,0 +1,183 @@
1
+ /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
+ const require_focusRing = require('../../tokens/focusRing.cjs');
3
+ const require_resolveInteractiveStyle = require('../../tokens/resolveInteractiveStyle.cjs');
4
+ const require_Icon = require('../Icon/Icon.cjs');
5
+ let _ttoss_fsl_theme_vars = require("@ttoss/fsl-theme/vars");
6
+ let react_aria_components = require("react-aria-components");
7
+ let react_jsx_runtime = require("react/jsx-runtime");
8
+
9
+ //#region src/components/Checkbox/Checkbox.tsx
10
+ /** Formal semantic identity — Checkbox root (Selection entity, toggle.binary). */
11
+ var checkboxMeta = {
12
+ displayName: "Checkbox",
13
+ entity: "Selection",
14
+ structure: "root"
15
+ };
16
+ var BOX_STYLE_STATIC = {
17
+ boxSizing: "border-box",
18
+ flexShrink: 0,
19
+ display: "inline-flex",
20
+ alignItems: "center",
21
+ justifyContent: "center",
22
+ width: "1.125rem",
23
+ height: "1.125rem",
24
+ borderRadius: _ttoss_fsl_theme_vars.vars.radii.control,
25
+ borderStyle: _ttoss_fsl_theme_vars.vars.border.outline.control.style,
26
+ transitionProperty: "background-color, border-color, border-width",
27
+ transitionDuration: _ttoss_fsl_theme_vars.vars.motion.feedback.duration,
28
+ transitionTimingFunction: _ttoss_fsl_theme_vars.vars.motion.feedback.easing,
29
+ outlineOffset: "2px"
30
+ };
31
+ /** Box (selectionControl) style — the visual checkbox square. */
32
+ var buildBoxStyle = ({
33
+ c,
34
+ isSelected,
35
+ isIndeterminate,
36
+ isInvalid,
37
+ isDisabled,
38
+ isHovered,
39
+ isPressed,
40
+ isFocusVisible
41
+ }) => {
42
+ const checkedLike = isSelected || isIndeterminate;
43
+ return {
44
+ ...BOX_STYLE_STATIC,
45
+ borderWidth: checkedLike ? _ttoss_fsl_theme_vars.vars.border.outline.selected.width : _ttoss_fsl_theme_vars.vars.border.outline.control.width,
46
+ backgroundColor: require_resolveInteractiveStyle.resolveInteractiveStyle(c?.background, {
47
+ isDisabled,
48
+ isInvalid,
49
+ isSelected,
50
+ isIndeterminate,
51
+ isHovered,
52
+ isPressed
53
+ }),
54
+ borderColor: require_resolveInteractiveStyle.resolveInteractiveStyle(c?.border, {
55
+ isDisabled,
56
+ isInvalid,
57
+ isSelected,
58
+ isIndeterminate,
59
+ isFocusVisible
60
+ }),
61
+ outline: require_focusRing.focusRingOutline(isFocusVisible)
62
+ };
63
+ };
64
+ /** Indicator glyph color — a theme may omit the dimension; degrade to undefined. */
65
+ var resolveIndicatorColor = ({
66
+ text,
67
+ isIndeterminate
68
+ }) => {
69
+ return isIndeterminate ? text?.indeterminate ?? text?.checked ?? text?.default : text?.checked ?? text?.default;
70
+ };
71
+ /** Label color — invalid dominates disabled dominates default. */
72
+ var resolveLabelColor = ({
73
+ text,
74
+ isInvalid,
75
+ isDisabled
76
+ }) => {
77
+ if (isInvalid) return text?.invalid;
78
+ if (isDisabled) return text?.disabled;
79
+ return text?.default;
80
+ };
81
+ /**
82
+ * A semantic selection checkbox built on React Aria.
83
+ *
84
+ * Entity = Selection → reads `vars.colors.input.primary.*`. Validation
85
+ * feedback is rendered via the `invalid` State (driven by React Aria's
86
+ * `isInvalid` prop or form-library validation), not via an Evaluation
87
+ * variant.
88
+ *
89
+ * @example
90
+ * ```tsx
91
+ * <Checkbox>Accept terms</Checkbox>
92
+ * <Checkbox isInvalid>Accept terms (must be checked)</Checkbox>
93
+ * <Checkbox isIndeterminate>Partially selected</Checkbox>
94
+ * ```
95
+ */
96
+ var Checkbox = ({
97
+ children,
98
+ ...props
99
+ }) => {
100
+ const c = _ttoss_fsl_theme_vars.vars.colors.input.primary;
101
+ return /* @__PURE__ */(0, react_jsx_runtime.jsx)(react_aria_components.Checkbox, {
102
+ ...props,
103
+ "data-scope": "checkbox",
104
+ "data-part": "root",
105
+ style: ({
106
+ isDisabled
107
+ }) => {
108
+ return {
109
+ boxSizing: "border-box",
110
+ display: "inline-flex",
111
+ alignItems: "center",
112
+ gap: _ttoss_fsl_theme_vars.vars.spacing.gap.inline.sm,
113
+ minHeight: _ttoss_fsl_theme_vars.vars.sizing.hit.base,
114
+ cursor: isDisabled ? "not-allowed" : "pointer",
115
+ opacity: isDisabled ? _ttoss_fsl_theme_vars.vars.opacity.disabled : void 0,
116
+ ..._ttoss_fsl_theme_vars.vars.text.label.md,
117
+ color: isDisabled ? c?.text?.disabled : c?.text?.default
118
+ };
119
+ },
120
+ children: ({
121
+ isHovered,
122
+ isPressed,
123
+ isDisabled,
124
+ isFocusVisible,
125
+ isSelected,
126
+ isIndeterminate,
127
+ isInvalid
128
+ }) => {
129
+ const text = c?.text;
130
+ const showIndicator = isSelected || isIndeterminate;
131
+ return /* @__PURE__ */(0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, {
132
+ children: [/* @__PURE__ */(0, react_jsx_runtime.jsx)("span", {
133
+ "data-scope": "checkbox",
134
+ "data-part": "selectionControl",
135
+ "aria-hidden": true,
136
+ style: buildBoxStyle({
137
+ c,
138
+ isSelected,
139
+ isIndeterminate,
140
+ isInvalid,
141
+ isDisabled,
142
+ isHovered,
143
+ isPressed,
144
+ isFocusVisible
145
+ }),
146
+ children: showIndicator && /* @__PURE__ */(0, react_jsx_runtime.jsx)("span", {
147
+ "data-scope": "checkbox",
148
+ "data-part": "indicator",
149
+ "aria-hidden": true,
150
+ style: {
151
+ color: resolveIndicatorColor({
152
+ text,
153
+ isIndeterminate
154
+ }),
155
+ lineHeight: 1,
156
+ userSelect: "none"
157
+ },
158
+ children: /* @__PURE__ */(0, react_jsx_runtime.jsx)(require_Icon.Icon, {
159
+ intent: isIndeterminate ? "selection.indeterminate" : "selection.checked",
160
+ size: "sm"
161
+ })
162
+ })
163
+ }), children != null && /* @__PURE__ */(0, react_jsx_runtime.jsx)("span", {
164
+ "data-scope": "checkbox",
165
+ "data-part": "label",
166
+ style: {
167
+ color: resolveLabelColor({
168
+ text,
169
+ isInvalid,
170
+ isDisabled
171
+ })
172
+ },
173
+ children
174
+ })]
175
+ });
176
+ }
177
+ });
178
+ };
179
+ Checkbox.displayName = checkboxMeta.displayName;
180
+
181
+ //#endregion
182
+ exports.Checkbox = Checkbox;
183
+ exports.checkboxMeta = checkboxMeta;
@@ -0,0 +1,45 @@
1
+
2
+ import * as React from "react";
3
+ import { CheckboxProps } from "react-aria-components";
4
+
5
+ //#region src/components/Checkbox/Checkbox.d.ts
6
+ /** Formal semantic identity — Checkbox root (Selection entity, toggle.binary). */
7
+ declare const checkboxMeta: {
8
+ readonly displayName: "Checkbox";
9
+ readonly entity: "Selection";
10
+ readonly structure: "root";
11
+ };
12
+ /**
13
+ * Props for the Checkbox component.
14
+ */
15
+ interface CheckboxProps$1 extends Omit<CheckboxProps, 'style' | 'children'> {
16
+ /**
17
+ * Label content displayed next to the checkbox indicator.
18
+ * Rendered inside a `data-part="label"` span.
19
+ */
20
+ children?: React.ReactNode;
21
+ }
22
+ /**
23
+ * A semantic selection checkbox built on React Aria.
24
+ *
25
+ * Entity = Selection → reads `vars.colors.input.primary.*`. Validation
26
+ * feedback is rendered via the `invalid` State (driven by React Aria's
27
+ * `isInvalid` prop or form-library validation), not via an Evaluation
28
+ * variant.
29
+ *
30
+ * @example
31
+ * ```tsx
32
+ * <Checkbox>Accept terms</Checkbox>
33
+ * <Checkbox isInvalid>Accept terms (must be checked)</Checkbox>
34
+ * <Checkbox isIndeterminate>Partially selected</Checkbox>
35
+ * ```
36
+ */
37
+ declare const Checkbox: {
38
+ ({
39
+ children,
40
+ ...props
41
+ }: CheckboxProps$1): import("react/jsx-runtime").JSX.Element;
42
+ displayName: "Checkbox";
43
+ };
44
+ //#endregion
45
+ export { Checkbox, CheckboxProps$1 as CheckboxProps, checkboxMeta };
@@ -0,0 +1,45 @@
1
+
2
+ import { CheckboxProps } from "react-aria-components";
3
+ import * as React from "react";
4
+
5
+ //#region src/components/Checkbox/Checkbox.d.ts
6
+ /** Formal semantic identity — Checkbox root (Selection entity, toggle.binary). */
7
+ declare const checkboxMeta: {
8
+ readonly displayName: "Checkbox";
9
+ readonly entity: "Selection";
10
+ readonly structure: "root";
11
+ };
12
+ /**
13
+ * Props for the Checkbox component.
14
+ */
15
+ interface CheckboxProps$1 extends Omit<CheckboxProps, 'style' | 'children'> {
16
+ /**
17
+ * Label content displayed next to the checkbox indicator.
18
+ * Rendered inside a `data-part="label"` span.
19
+ */
20
+ children?: React.ReactNode;
21
+ }
22
+ /**
23
+ * A semantic selection checkbox built on React Aria.
24
+ *
25
+ * Entity = Selection → reads `vars.colors.input.primary.*`. Validation
26
+ * feedback is rendered via the `invalid` State (driven by React Aria's
27
+ * `isInvalid` prop or form-library validation), not via an Evaluation
28
+ * variant.
29
+ *
30
+ * @example
31
+ * ```tsx
32
+ * <Checkbox>Accept terms</Checkbox>
33
+ * <Checkbox isInvalid>Accept terms (must be checked)</Checkbox>
34
+ * <Checkbox isIndeterminate>Partially selected</Checkbox>
35
+ * ```
36
+ */
37
+ declare const Checkbox$1: {
38
+ ({
39
+ children,
40
+ ...props
41
+ }: CheckboxProps$1): import("react/jsx-runtime").JSX.Element;
42
+ displayName: "Checkbox";
43
+ };
44
+ //#endregion
45
+ export { Checkbox$1 as Checkbox, CheckboxProps$1 as CheckboxProps, checkboxMeta };
@@ -0,0 +1,182 @@
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 { Checkbox } from "react-aria-components";
7
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+
9
+ //#region src/components/Checkbox/Checkbox.tsx
10
+ /** Formal semantic identity — Checkbox root (Selection entity, toggle.binary). */
11
+ var checkboxMeta = {
12
+ displayName: "Checkbox",
13
+ entity: "Selection",
14
+ structure: "root"
15
+ };
16
+ var BOX_STYLE_STATIC = {
17
+ boxSizing: "border-box",
18
+ flexShrink: 0,
19
+ display: "inline-flex",
20
+ alignItems: "center",
21
+ justifyContent: "center",
22
+ width: "1.125rem",
23
+ height: "1.125rem",
24
+ borderRadius: vars.radii.control,
25
+ borderStyle: vars.border.outline.control.style,
26
+ transitionProperty: "background-color, border-color, border-width",
27
+ transitionDuration: vars.motion.feedback.duration,
28
+ transitionTimingFunction: vars.motion.feedback.easing,
29
+ outlineOffset: "2px"
30
+ };
31
+ /** Box (selectionControl) style — the visual checkbox square. */
32
+ var buildBoxStyle = ({
33
+ c,
34
+ isSelected,
35
+ isIndeterminate,
36
+ isInvalid,
37
+ isDisabled,
38
+ isHovered,
39
+ isPressed,
40
+ isFocusVisible
41
+ }) => {
42
+ const checkedLike = isSelected || isIndeterminate;
43
+ return {
44
+ ...BOX_STYLE_STATIC,
45
+ borderWidth: checkedLike ? vars.border.outline.selected.width : vars.border.outline.control.width,
46
+ backgroundColor: resolveInteractiveStyle(c?.background, {
47
+ isDisabled,
48
+ isInvalid,
49
+ isSelected,
50
+ isIndeterminate,
51
+ isHovered,
52
+ isPressed
53
+ }),
54
+ borderColor: resolveInteractiveStyle(c?.border, {
55
+ isDisabled,
56
+ isInvalid,
57
+ isSelected,
58
+ isIndeterminate,
59
+ isFocusVisible
60
+ }),
61
+ outline: focusRingOutline(isFocusVisible)
62
+ };
63
+ };
64
+ /** Indicator glyph color — a theme may omit the dimension; degrade to undefined. */
65
+ var resolveIndicatorColor = ({
66
+ text,
67
+ isIndeterminate
68
+ }) => {
69
+ return isIndeterminate ? text?.indeterminate ?? text?.checked ?? text?.default : text?.checked ?? text?.default;
70
+ };
71
+ /** Label color — invalid dominates disabled dominates default. */
72
+ var resolveLabelColor = ({
73
+ text,
74
+ isInvalid,
75
+ isDisabled
76
+ }) => {
77
+ if (isInvalid) return text?.invalid;
78
+ if (isDisabled) return text?.disabled;
79
+ return text?.default;
80
+ };
81
+ /**
82
+ * A semantic selection checkbox built on React Aria.
83
+ *
84
+ * Entity = Selection → reads `vars.colors.input.primary.*`. Validation
85
+ * feedback is rendered via the `invalid` State (driven by React Aria's
86
+ * `isInvalid` prop or form-library validation), not via an Evaluation
87
+ * variant.
88
+ *
89
+ * @example
90
+ * ```tsx
91
+ * <Checkbox>Accept terms</Checkbox>
92
+ * <Checkbox isInvalid>Accept terms (must be checked)</Checkbox>
93
+ * <Checkbox isIndeterminate>Partially selected</Checkbox>
94
+ * ```
95
+ */
96
+ var Checkbox$1 = ({
97
+ children,
98
+ ...props
99
+ }) => {
100
+ const c = vars.colors.input.primary;
101
+ return /* @__PURE__ */jsx(Checkbox, {
102
+ ...props,
103
+ "data-scope": "checkbox",
104
+ "data-part": "root",
105
+ style: ({
106
+ isDisabled
107
+ }) => {
108
+ return {
109
+ boxSizing: "border-box",
110
+ display: "inline-flex",
111
+ alignItems: "center",
112
+ gap: vars.spacing.gap.inline.sm,
113
+ minHeight: vars.sizing.hit.base,
114
+ cursor: isDisabled ? "not-allowed" : "pointer",
115
+ opacity: isDisabled ? vars.opacity.disabled : void 0,
116
+ ...vars.text.label.md,
117
+ color: isDisabled ? c?.text?.disabled : c?.text?.default
118
+ };
119
+ },
120
+ children: ({
121
+ isHovered,
122
+ isPressed,
123
+ isDisabled,
124
+ isFocusVisible,
125
+ isSelected,
126
+ isIndeterminate,
127
+ isInvalid
128
+ }) => {
129
+ const text = c?.text;
130
+ const showIndicator = isSelected || isIndeterminate;
131
+ return /* @__PURE__ */jsxs(Fragment, {
132
+ children: [/* @__PURE__ */jsx("span", {
133
+ "data-scope": "checkbox",
134
+ "data-part": "selectionControl",
135
+ "aria-hidden": true,
136
+ style: buildBoxStyle({
137
+ c,
138
+ isSelected,
139
+ isIndeterminate,
140
+ isInvalid,
141
+ isDisabled,
142
+ isHovered,
143
+ isPressed,
144
+ isFocusVisible
145
+ }),
146
+ children: showIndicator && /* @__PURE__ */jsx("span", {
147
+ "data-scope": "checkbox",
148
+ "data-part": "indicator",
149
+ "aria-hidden": true,
150
+ style: {
151
+ color: resolveIndicatorColor({
152
+ text,
153
+ isIndeterminate
154
+ }),
155
+ lineHeight: 1,
156
+ userSelect: "none"
157
+ },
158
+ children: /* @__PURE__ */jsx(Icon, {
159
+ intent: isIndeterminate ? "selection.indeterminate" : "selection.checked",
160
+ size: "sm"
161
+ })
162
+ })
163
+ }), children != null && /* @__PURE__ */jsx("span", {
164
+ "data-scope": "checkbox",
165
+ "data-part": "label",
166
+ style: {
167
+ color: resolveLabelColor({
168
+ text,
169
+ isInvalid,
170
+ isDisabled
171
+ })
172
+ },
173
+ children
174
+ })]
175
+ });
176
+ }
177
+ });
178
+ };
179
+ Checkbox$1.displayName = checkboxMeta.displayName;
180
+
181
+ //#endregion
182
+ export { Checkbox$1 as Checkbox, checkboxMeta };
@@ -0,0 +1,97 @@
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/CheckboxGroup/CheckboxGroup.tsx
7
+ /** Formal semantic identity — CheckboxGroup root (Selection entity, multi-choice). */
8
+ var checkboxGroupMeta = {
9
+ displayName: "CheckboxGroup",
10
+ entity: "Selection",
11
+ structure: "root"
12
+ };
13
+ /**
14
+ * Resolve the group's text colors once (default for label/description, invalid
15
+ * for the validation message). Hoisted out of the render so the optional-chain
16
+ * reads live here and keep the component's cyclomatic complexity low.
17
+ */
18
+ var resolveGroupTextColors = c => {
19
+ const text = c?.text;
20
+ return {
21
+ base: text?.default,
22
+ invalid: text?.invalid ?? text?.default
23
+ };
24
+ };
25
+ /**
26
+ * A semantic checkbox group built on React Aria's `CheckboxGroup`.
27
+ *
28
+ * Orchestrates a set of independently-selectable `Checkbox` options (multi
29
+ * select — the counterpart of the single-select `RadioGroup`). Group-level
30
+ * validation set via `isInvalid` (or React Aria's `validate`) propagates to
31
+ * every child Checkbox, which surfaces the `invalid` State.
32
+ *
33
+ * Entity = Selection → reads `vars.colors.input.primary.*`. Validation is the
34
+ * `invalid` State, never an `evaluation` variant.
35
+ *
36
+ * @example
37
+ * ```tsx
38
+ * <CheckboxGroup label="Notifications" description="Pick at least one">
39
+ * <Checkbox value="email">Email</Checkbox>
40
+ * <Checkbox value="sms">SMS</Checkbox>
41
+ * </CheckboxGroup>
42
+ * ```
43
+ */
44
+ var CheckboxGroup = ({
45
+ label,
46
+ description,
47
+ errorMessage,
48
+ children,
49
+ ...props
50
+ }) => {
51
+ const {
52
+ base,
53
+ invalid
54
+ } = resolveGroupTextColors(_ttoss_fsl_theme_vars.vars.colors.input.primary);
55
+ return /* @__PURE__ */(0, react_jsx_runtime.jsxs)(react_aria_components.CheckboxGroup, {
56
+ ...props,
57
+ "data-scope": "checkbox-group",
58
+ "data-part": "root",
59
+ style: {
60
+ boxSizing: "border-box",
61
+ display: "flex",
62
+ flexDirection: "column",
63
+ gap: _ttoss_fsl_theme_vars.vars.spacing.gap.stack.sm
64
+ },
65
+ children: [label != null && /* @__PURE__ */(0, react_jsx_runtime.jsx)(react_aria_components.Label, {
66
+ "data-scope": "checkbox-group",
67
+ "data-part": "label",
68
+ style: {
69
+ ..._ttoss_fsl_theme_vars.vars.text.label.md,
70
+ color: base
71
+ },
72
+ children: label
73
+ }), children, description != null && /* @__PURE__ */(0, react_jsx_runtime.jsx)(react_aria_components.Text, {
74
+ slot: "description",
75
+ "data-scope": "checkbox-group",
76
+ "data-part": "description",
77
+ style: {
78
+ ..._ttoss_fsl_theme_vars.vars.text.label.sm,
79
+ color: base
80
+ },
81
+ children: description
82
+ }), /* @__PURE__ */(0, react_jsx_runtime.jsx)(react_aria_components.FieldError, {
83
+ "data-scope": "checkbox-group",
84
+ "data-part": "validationMessage",
85
+ style: {
86
+ ..._ttoss_fsl_theme_vars.vars.text.label.sm,
87
+ color: invalid
88
+ },
89
+ children: errorMessage
90
+ })]
91
+ });
92
+ };
93
+ CheckboxGroup.displayName = checkboxGroupMeta.displayName;
94
+
95
+ //#endregion
96
+ exports.CheckboxGroup = CheckboxGroup;
97
+ exports.checkboxGroupMeta = checkboxGroupMeta;