@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,214 @@
1
+ /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
+ const require_focusRing = require('../../tokens/focusRing.cjs');
4
+ const require_resolveInteractiveStyle = require('../../tokens/resolveInteractiveStyle.cjs');
5
+ const require_Icon = require('../../components/Icon/Icon.cjs');
6
+ const require_scope = require('../scope.cjs');
7
+ let _ttoss_fsl_theme_vars = require("@ttoss/fsl-theme/vars");
8
+ let react_aria_components = require("react-aria-components");
9
+ let react_jsx_runtime = require("react/jsx-runtime");
10
+ let react = require("react");
11
+ react = require_runtime.__toESM(react);
12
+
13
+ //#region src/composites/Disclosure/Disclosure.tsx
14
+ var disclosureScope = require_scope.createCompositeScope("Disclosure");
15
+ /** Formal semantic identity — Disclosure root (Disclosure entity, single section). */
16
+ var disclosureMeta = {
17
+ displayName: "Disclosure",
18
+ entity: "Disclosure",
19
+ structure: "root"
20
+ };
21
+ /** Formal semantic identity — DisclosureTrigger (header button). */
22
+ var disclosureTriggerMeta = {
23
+ displayName: "DisclosureTrigger",
24
+ entity: "Disclosure",
25
+ structure: "trigger"
26
+ };
27
+ /** Formal semantic identity — DisclosurePanel (collapsible content region). */
28
+ var disclosurePanelMeta = {
29
+ displayName: "DisclosurePanel",
30
+ entity: "Disclosure",
31
+ structure: "content"
32
+ };
33
+ /**
34
+ * A single collapsible section built on React Aria's `Disclosure`.
35
+ *
36
+ * The standalone counterpart of `Accordion` (a `DisclosureGroup`): use
37
+ * `Disclosure` when there is exactly one expandable region with no sibling
38
+ * coordination (a "show more" block, an optional settings section). Entity =
39
+ * Disclosure → reads `vars.colors.navigation.{primary|muted}` and animates
40
+ * with `vars.motion.transition.{enter,exit}`.
41
+ *
42
+ * @example
43
+ * ```tsx
44
+ * <Disclosure>
45
+ * <DisclosureTrigger>Advanced options</DisclosureTrigger>
46
+ * <DisclosurePanel>Rarely-needed settings live here.</DisclosurePanel>
47
+ * </Disclosure>
48
+ * ```
49
+ */
50
+ var Disclosure = ({
51
+ evaluation = "primary",
52
+ children,
53
+ ...props
54
+ }) => {
55
+ return /* @__PURE__ */(0, react_jsx_runtime.jsx)(disclosureScope.Provider, {
56
+ value: {
57
+ evaluation
58
+ },
59
+ children: /* @__PURE__ */(0, react_jsx_runtime.jsx)(react_aria_components.Disclosure, {
60
+ ...props,
61
+ "data-scope": "disclosure",
62
+ "data-part": "root",
63
+ "data-evaluation": evaluation,
64
+ style: {
65
+ boxSizing: "border-box",
66
+ display: "flex",
67
+ flexDirection: "column",
68
+ borderWidth: _ttoss_fsl_theme_vars.vars.border.outline.control.width,
69
+ borderStyle: _ttoss_fsl_theme_vars.vars.border.outline.control.style,
70
+ borderColor: _ttoss_fsl_theme_vars.vars.colors.navigation[evaluation]?.border?.default ?? "transparent",
71
+ borderRadius: _ttoss_fsl_theme_vars.vars.radii.surface,
72
+ overflow: "hidden"
73
+ },
74
+ children
75
+ })
76
+ });
77
+ };
78
+ Disclosure.displayName = disclosureMeta.displayName;
79
+ /**
80
+ * The clickable header of a `Disclosure`. Renders inside a heading element
81
+ * (level via `headingLevel`, default `<h3>`) and exposes `aria-expanded` plus
82
+ * a chevron that rotates when the section is open. Must be used inside a
83
+ * `Disclosure`.
84
+ */
85
+ var DisclosureTrigger = ({
86
+ headingLevel = 3,
87
+ children,
88
+ ...props
89
+ }) => {
90
+ const {
91
+ evaluation
92
+ } = disclosureScope.use(disclosureTriggerMeta.displayName);
93
+ const c = _ttoss_fsl_theme_vars.vars.colors.navigation[evaluation];
94
+ const isExpanded = react.useContext(react_aria_components.DisclosureStateContext)?.isExpanded ?? false;
95
+ return /* @__PURE__ */(0, react_jsx_runtime.jsx)(react_aria_components.Heading, {
96
+ level: headingLevel,
97
+ "data-scope": "disclosure",
98
+ "data-part": "header",
99
+ style: {
100
+ margin: 0
101
+ },
102
+ children: /* @__PURE__ */(0, react_jsx_runtime.jsxs)(react_aria_components.Button, {
103
+ ...props,
104
+ slot: "trigger",
105
+ "data-scope": "disclosure",
106
+ "data-part": "trigger",
107
+ style: ({
108
+ isHovered,
109
+ isPressed,
110
+ isDisabled,
111
+ isFocusVisible
112
+ }) => {
113
+ const flags = {
114
+ isHovered,
115
+ isPressed,
116
+ isDisabled,
117
+ isFocusVisible,
118
+ isExpanded
119
+ };
120
+ return {
121
+ boxSizing: "border-box",
122
+ width: "100%",
123
+ display: "inline-flex",
124
+ alignItems: "center",
125
+ justifyContent: "space-between",
126
+ gap: _ttoss_fsl_theme_vars.vars.spacing.gap.inline.sm,
127
+ minHeight: _ttoss_fsl_theme_vars.vars.sizing.hit.base,
128
+ paddingBlock: _ttoss_fsl_theme_vars.vars.spacing.inset.control.md,
129
+ paddingInline: _ttoss_fsl_theme_vars.vars.spacing.inset.control.md,
130
+ border: "none",
131
+ background: "none",
132
+ backgroundColor: require_resolveInteractiveStyle.resolveInteractiveStyle(c?.background, flags),
133
+ color: require_resolveInteractiveStyle.resolveInteractiveStyle(c?.text, flags) ?? c?.text?.default,
134
+ cursor: isDisabled ? "not-allowed" : "pointer",
135
+ opacity: isDisabled ? _ttoss_fsl_theme_vars.vars.opacity.disabled : void 0,
136
+ ..._ttoss_fsl_theme_vars.vars.text.label.md,
137
+ textAlign: "start",
138
+ transitionProperty: "background-color, color",
139
+ transitionDuration: _ttoss_fsl_theme_vars.vars.motion.transition.enter.duration,
140
+ transitionTimingFunction: _ttoss_fsl_theme_vars.vars.motion.transition.enter.easing,
141
+ outline: require_focusRing.focusRingOutline(isFocusVisible),
142
+ outlineOffset: "-2px"
143
+ };
144
+ },
145
+ children: [/* @__PURE__ */(0, react_jsx_runtime.jsx)("span", {
146
+ "data-scope": "disclosure",
147
+ "data-part": "label",
148
+ style: {
149
+ flex: 1
150
+ },
151
+ children
152
+ }), /* @__PURE__ */(0, react_jsx_runtime.jsx)("span", {
153
+ "data-scope": "disclosure",
154
+ "data-part": "indicator",
155
+ "aria-hidden": true,
156
+ style: {
157
+ flexShrink: 0,
158
+ display: "inline-block",
159
+ transform: isExpanded ? "rotate(90deg)" : "rotate(0deg)",
160
+ transitionProperty: "transform",
161
+ transitionDuration: isExpanded ? _ttoss_fsl_theme_vars.vars.motion.transition.enter.duration : _ttoss_fsl_theme_vars.vars.motion.transition.exit.duration,
162
+ transitionTimingFunction: isExpanded ? _ttoss_fsl_theme_vars.vars.motion.transition.enter.easing : _ttoss_fsl_theme_vars.vars.motion.transition.exit.easing
163
+ },
164
+ children: /* @__PURE__ */(0, react_jsx_runtime.jsx)(require_Icon.Icon, {
165
+ intent: "disclosure.collapse"
166
+ })
167
+ })]
168
+ })
169
+ });
170
+ };
171
+ DisclosureTrigger.displayName = disclosureTriggerMeta.displayName;
172
+ /**
173
+ * The collapsible content region of a `Disclosure`. React Aria handles
174
+ * show/hide via the parent Disclosure state; the chrome uses
175
+ * `vars.motion.transition.{enter,exit}` semantics. Must be used inside a
176
+ * `Disclosure`.
177
+ *
178
+ * @example
179
+ * ```tsx
180
+ * <DisclosurePanel>Rarely-needed settings live here.</DisclosurePanel>
181
+ * ```
182
+ */
183
+ var DisclosurePanel = ({
184
+ children,
185
+ ...props
186
+ }) => {
187
+ const {
188
+ evaluation
189
+ } = disclosureScope.use(disclosurePanelMeta.displayName);
190
+ const c = _ttoss_fsl_theme_vars.vars.colors.navigation[evaluation];
191
+ return /* @__PURE__ */(0, react_jsx_runtime.jsx)(react_aria_components.DisclosurePanel, {
192
+ ...props,
193
+ "data-scope": "disclosure",
194
+ "data-part": "content",
195
+ style: {
196
+ boxSizing: "border-box",
197
+ paddingBlock: _ttoss_fsl_theme_vars.vars.spacing.inset.control.md,
198
+ paddingInline: _ttoss_fsl_theme_vars.vars.spacing.inset.control.md,
199
+ backgroundColor: c?.background?.default,
200
+ color: c?.text?.default,
201
+ ..._ttoss_fsl_theme_vars.vars.text.body.md
202
+ },
203
+ children
204
+ });
205
+ };
206
+ DisclosurePanel.displayName = disclosurePanelMeta.displayName;
207
+
208
+ //#endregion
209
+ exports.Disclosure = Disclosure;
210
+ exports.DisclosurePanel = DisclosurePanel;
211
+ exports.DisclosureTrigger = DisclosureTrigger;
212
+ exports.disclosureMeta = disclosureMeta;
213
+ exports.disclosurePanelMeta = disclosurePanelMeta;
214
+ exports.disclosureTriggerMeta = disclosureTriggerMeta;
@@ -0,0 +1,118 @@
1
+
2
+ import { EvaluationsFor } from "../../semantics/taxonomy.cjs";
3
+ import * as React from "react";
4
+ import { ButtonProps, DisclosurePanelProps, DisclosureProps } from "react-aria-components";
5
+
6
+ //#region src/composites/Disclosure/Disclosure.d.ts
7
+ type DisclosureEvaluation = EvaluationsFor<'Disclosure'>;
8
+ /** Formal semantic identity — Disclosure root (Disclosure entity, single section). */
9
+ declare const disclosureMeta: {
10
+ readonly displayName: "Disclosure";
11
+ readonly entity: "Disclosure";
12
+ readonly structure: "root";
13
+ };
14
+ /** Formal semantic identity — DisclosureTrigger (header button). */
15
+ declare const disclosureTriggerMeta: {
16
+ readonly displayName: "DisclosureTrigger";
17
+ readonly entity: "Disclosure";
18
+ readonly structure: "trigger";
19
+ };
20
+ /** Formal semantic identity — DisclosurePanel (collapsible content region). */
21
+ declare const disclosurePanelMeta: {
22
+ readonly displayName: "DisclosurePanel";
23
+ readonly entity: "Disclosure";
24
+ readonly structure: "content";
25
+ };
26
+ /**
27
+ * Props for the Disclosure component.
28
+ *
29
+ * The composite owns its layout; pass `style`/`className` on a wrapping
30
+ * element rather than on the composite root. See CONTRIBUTING §4.
31
+ */
32
+ interface DisclosureProps$1 extends Omit<DisclosureProps, 'style' | 'children' | 'className'> {
33
+ /**
34
+ * Authorial emphasis. `primary` is the standard disclosure chrome; `muted`
35
+ * is a subdued variant for sidebars and dense lists.
36
+ * @default 'primary'
37
+ */
38
+ evaluation?: DisclosureEvaluation;
39
+ /** `DisclosureTrigger` then `DisclosurePanel`, in that order. */
40
+ children?: React.ReactNode;
41
+ }
42
+ /**
43
+ * A single collapsible section built on React Aria's `Disclosure`.
44
+ *
45
+ * The standalone counterpart of `Accordion` (a `DisclosureGroup`): use
46
+ * `Disclosure` when there is exactly one expandable region with no sibling
47
+ * coordination (a "show more" block, an optional settings section). Entity =
48
+ * Disclosure → reads `vars.colors.navigation.{primary|muted}` and animates
49
+ * with `vars.motion.transition.{enter,exit}`.
50
+ *
51
+ * @example
52
+ * ```tsx
53
+ * <Disclosure>
54
+ * <DisclosureTrigger>Advanced options</DisclosureTrigger>
55
+ * <DisclosurePanel>Rarely-needed settings live here.</DisclosurePanel>
56
+ * </Disclosure>
57
+ * ```
58
+ */
59
+ declare const Disclosure: {
60
+ ({
61
+ evaluation,
62
+ children,
63
+ ...props
64
+ }: DisclosureProps$1): import("react/jsx-runtime").JSX.Element;
65
+ displayName: "Disclosure";
66
+ };
67
+ /**
68
+ * Props for the DisclosureTrigger component.
69
+ *
70
+ * Extends the React Aria `Button` API (minus `style`/`className`/`slot`) so
71
+ * behavior props — `isDisabled`, `onPress`, `id`, `aria-*` — flow through.
72
+ */
73
+ interface DisclosureTriggerProps extends Omit<ButtonProps, 'style' | 'className' | 'children' | 'slot'> {
74
+ /**
75
+ * HTML heading level of the wrapping heading element. Pick the level that
76
+ * fits the host page's document outline.
77
+ * @default 3
78
+ */
79
+ headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
80
+ /** Visible label content of the trigger row. */
81
+ children?: React.ReactNode;
82
+ }
83
+ /**
84
+ * The clickable header of a `Disclosure`. Renders inside a heading element
85
+ * (level via `headingLevel`, default `<h3>`) and exposes `aria-expanded` plus
86
+ * a chevron that rotates when the section is open. Must be used inside a
87
+ * `Disclosure`.
88
+ */
89
+ declare const DisclosureTrigger: {
90
+ ({
91
+ headingLevel,
92
+ children,
93
+ ...props
94
+ }: DisclosureTriggerProps): import("react/jsx-runtime").JSX.Element;
95
+ displayName: "DisclosureTrigger";
96
+ };
97
+ /** Props for the DisclosurePanel component. */
98
+ type DisclosurePanelProps$1 = Omit<DisclosurePanelProps, 'style' | 'className'>;
99
+ /**
100
+ * The collapsible content region of a `Disclosure`. React Aria handles
101
+ * show/hide via the parent Disclosure state; the chrome uses
102
+ * `vars.motion.transition.{enter,exit}` semantics. Must be used inside a
103
+ * `Disclosure`.
104
+ *
105
+ * @example
106
+ * ```tsx
107
+ * <DisclosurePanel>Rarely-needed settings live here.</DisclosurePanel>
108
+ * ```
109
+ */
110
+ declare const DisclosurePanel: {
111
+ ({
112
+ children,
113
+ ...props
114
+ }: DisclosurePanelProps$1): import("react/jsx-runtime").JSX.Element;
115
+ displayName: "DisclosurePanel";
116
+ };
117
+ //#endregion
118
+ export { Disclosure, DisclosurePanel, DisclosurePanelProps$1 as DisclosurePanelProps, DisclosureProps$1 as DisclosureProps, DisclosureTrigger, DisclosureTriggerProps, disclosureMeta, disclosurePanelMeta, disclosureTriggerMeta };
@@ -0,0 +1,118 @@
1
+
2
+ import { EvaluationsFor } from "../../semantics/taxonomy.mjs";
3
+ import { ButtonProps, DisclosurePanelProps, DisclosureProps } from "react-aria-components";
4
+ import * as React from "react";
5
+
6
+ //#region src/composites/Disclosure/Disclosure.d.ts
7
+ type DisclosureEvaluation = EvaluationsFor<'Disclosure'>;
8
+ /** Formal semantic identity — Disclosure root (Disclosure entity, single section). */
9
+ declare const disclosureMeta: {
10
+ readonly displayName: "Disclosure";
11
+ readonly entity: "Disclosure";
12
+ readonly structure: "root";
13
+ };
14
+ /** Formal semantic identity — DisclosureTrigger (header button). */
15
+ declare const disclosureTriggerMeta: {
16
+ readonly displayName: "DisclosureTrigger";
17
+ readonly entity: "Disclosure";
18
+ readonly structure: "trigger";
19
+ };
20
+ /** Formal semantic identity — DisclosurePanel (collapsible content region). */
21
+ declare const disclosurePanelMeta: {
22
+ readonly displayName: "DisclosurePanel";
23
+ readonly entity: "Disclosure";
24
+ readonly structure: "content";
25
+ };
26
+ /**
27
+ * Props for the Disclosure component.
28
+ *
29
+ * The composite owns its layout; pass `style`/`className` on a wrapping
30
+ * element rather than on the composite root. See CONTRIBUTING §4.
31
+ */
32
+ interface DisclosureProps$1 extends Omit<DisclosureProps, 'style' | 'children' | 'className'> {
33
+ /**
34
+ * Authorial emphasis. `primary` is the standard disclosure chrome; `muted`
35
+ * is a subdued variant for sidebars and dense lists.
36
+ * @default 'primary'
37
+ */
38
+ evaluation?: DisclosureEvaluation;
39
+ /** `DisclosureTrigger` then `DisclosurePanel`, in that order. */
40
+ children?: React.ReactNode;
41
+ }
42
+ /**
43
+ * A single collapsible section built on React Aria's `Disclosure`.
44
+ *
45
+ * The standalone counterpart of `Accordion` (a `DisclosureGroup`): use
46
+ * `Disclosure` when there is exactly one expandable region with no sibling
47
+ * coordination (a "show more" block, an optional settings section). Entity =
48
+ * Disclosure → reads `vars.colors.navigation.{primary|muted}` and animates
49
+ * with `vars.motion.transition.{enter,exit}`.
50
+ *
51
+ * @example
52
+ * ```tsx
53
+ * <Disclosure>
54
+ * <DisclosureTrigger>Advanced options</DisclosureTrigger>
55
+ * <DisclosurePanel>Rarely-needed settings live here.</DisclosurePanel>
56
+ * </Disclosure>
57
+ * ```
58
+ */
59
+ declare const Disclosure$1: {
60
+ ({
61
+ evaluation,
62
+ children,
63
+ ...props
64
+ }: DisclosureProps$1): import("react/jsx-runtime").JSX.Element;
65
+ displayName: "Disclosure";
66
+ };
67
+ /**
68
+ * Props for the DisclosureTrigger component.
69
+ *
70
+ * Extends the React Aria `Button` API (minus `style`/`className`/`slot`) so
71
+ * behavior props — `isDisabled`, `onPress`, `id`, `aria-*` — flow through.
72
+ */
73
+ interface DisclosureTriggerProps extends Omit<ButtonProps, 'style' | 'className' | 'children' | 'slot'> {
74
+ /**
75
+ * HTML heading level of the wrapping heading element. Pick the level that
76
+ * fits the host page's document outline.
77
+ * @default 3
78
+ */
79
+ headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
80
+ /** Visible label content of the trigger row. */
81
+ children?: React.ReactNode;
82
+ }
83
+ /**
84
+ * The clickable header of a `Disclosure`. Renders inside a heading element
85
+ * (level via `headingLevel`, default `<h3>`) and exposes `aria-expanded` plus
86
+ * a chevron that rotates when the section is open. Must be used inside a
87
+ * `Disclosure`.
88
+ */
89
+ declare const DisclosureTrigger: {
90
+ ({
91
+ headingLevel,
92
+ children,
93
+ ...props
94
+ }: DisclosureTriggerProps): import("react/jsx-runtime").JSX.Element;
95
+ displayName: "DisclosureTrigger";
96
+ };
97
+ /** Props for the DisclosurePanel component. */
98
+ type DisclosurePanelProps$1 = Omit<DisclosurePanelProps, 'style' | 'className'>;
99
+ /**
100
+ * The collapsible content region of a `Disclosure`. React Aria handles
101
+ * show/hide via the parent Disclosure state; the chrome uses
102
+ * `vars.motion.transition.{enter,exit}` semantics. Must be used inside a
103
+ * `Disclosure`.
104
+ *
105
+ * @example
106
+ * ```tsx
107
+ * <DisclosurePanel>Rarely-needed settings live here.</DisclosurePanel>
108
+ * ```
109
+ */
110
+ declare const DisclosurePanel$1: {
111
+ ({
112
+ children,
113
+ ...props
114
+ }: DisclosurePanelProps$1): import("react/jsx-runtime").JSX.Element;
115
+ displayName: "DisclosurePanel";
116
+ };
117
+ //#endregion
118
+ export { Disclosure$1 as Disclosure, DisclosurePanel$1 as DisclosurePanel, DisclosurePanelProps$1 as DisclosurePanelProps, DisclosureProps$1 as DisclosureProps, DisclosureTrigger, DisclosureTriggerProps, disclosureMeta, disclosurePanelMeta, disclosureTriggerMeta };
@@ -0,0 +1,207 @@
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 "../../components/Icon/Icon.mjs";
5
+ import { createCompositeScope } from "../scope.mjs";
6
+ import { vars } from "@ttoss/fsl-theme/vars";
7
+ import { Button, Disclosure, DisclosurePanel, DisclosureStateContext, Heading } from "react-aria-components";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ import * as React from "react";
10
+
11
+ //#region src/composites/Disclosure/Disclosure.tsx
12
+ var disclosureScope = createCompositeScope("Disclosure");
13
+ /** Formal semantic identity — Disclosure root (Disclosure entity, single section). */
14
+ var disclosureMeta = {
15
+ displayName: "Disclosure",
16
+ entity: "Disclosure",
17
+ structure: "root"
18
+ };
19
+ /** Formal semantic identity — DisclosureTrigger (header button). */
20
+ var disclosureTriggerMeta = {
21
+ displayName: "DisclosureTrigger",
22
+ entity: "Disclosure",
23
+ structure: "trigger"
24
+ };
25
+ /** Formal semantic identity — DisclosurePanel (collapsible content region). */
26
+ var disclosurePanelMeta = {
27
+ displayName: "DisclosurePanel",
28
+ entity: "Disclosure",
29
+ structure: "content"
30
+ };
31
+ /**
32
+ * A single collapsible section built on React Aria's `Disclosure`.
33
+ *
34
+ * The standalone counterpart of `Accordion` (a `DisclosureGroup`): use
35
+ * `Disclosure` when there is exactly one expandable region with no sibling
36
+ * coordination (a "show more" block, an optional settings section). Entity =
37
+ * Disclosure → reads `vars.colors.navigation.{primary|muted}` and animates
38
+ * with `vars.motion.transition.{enter,exit}`.
39
+ *
40
+ * @example
41
+ * ```tsx
42
+ * <Disclosure>
43
+ * <DisclosureTrigger>Advanced options</DisclosureTrigger>
44
+ * <DisclosurePanel>Rarely-needed settings live here.</DisclosurePanel>
45
+ * </Disclosure>
46
+ * ```
47
+ */
48
+ var Disclosure$1 = ({
49
+ evaluation = "primary",
50
+ children,
51
+ ...props
52
+ }) => {
53
+ return /* @__PURE__ */jsx(disclosureScope.Provider, {
54
+ value: {
55
+ evaluation
56
+ },
57
+ children: /* @__PURE__ */jsx(Disclosure, {
58
+ ...props,
59
+ "data-scope": "disclosure",
60
+ "data-part": "root",
61
+ "data-evaluation": evaluation,
62
+ style: {
63
+ boxSizing: "border-box",
64
+ display: "flex",
65
+ flexDirection: "column",
66
+ borderWidth: vars.border.outline.control.width,
67
+ borderStyle: vars.border.outline.control.style,
68
+ borderColor: vars.colors.navigation[evaluation]?.border?.default ?? "transparent",
69
+ borderRadius: vars.radii.surface,
70
+ overflow: "hidden"
71
+ },
72
+ children
73
+ })
74
+ });
75
+ };
76
+ Disclosure$1.displayName = disclosureMeta.displayName;
77
+ /**
78
+ * The clickable header of a `Disclosure`. Renders inside a heading element
79
+ * (level via `headingLevel`, default `<h3>`) and exposes `aria-expanded` plus
80
+ * a chevron that rotates when the section is open. Must be used inside a
81
+ * `Disclosure`.
82
+ */
83
+ var DisclosureTrigger = ({
84
+ headingLevel = 3,
85
+ children,
86
+ ...props
87
+ }) => {
88
+ const {
89
+ evaluation
90
+ } = disclosureScope.use(disclosureTriggerMeta.displayName);
91
+ const c = vars.colors.navigation[evaluation];
92
+ const isExpanded = React.useContext(DisclosureStateContext)?.isExpanded ?? false;
93
+ return /* @__PURE__ */jsx(Heading, {
94
+ level: headingLevel,
95
+ "data-scope": "disclosure",
96
+ "data-part": "header",
97
+ style: {
98
+ margin: 0
99
+ },
100
+ children: /* @__PURE__ */jsxs(Button, {
101
+ ...props,
102
+ slot: "trigger",
103
+ "data-scope": "disclosure",
104
+ "data-part": "trigger",
105
+ style: ({
106
+ isHovered,
107
+ isPressed,
108
+ isDisabled,
109
+ isFocusVisible
110
+ }) => {
111
+ const flags = {
112
+ isHovered,
113
+ isPressed,
114
+ isDisabled,
115
+ isFocusVisible,
116
+ isExpanded
117
+ };
118
+ return {
119
+ boxSizing: "border-box",
120
+ width: "100%",
121
+ display: "inline-flex",
122
+ alignItems: "center",
123
+ justifyContent: "space-between",
124
+ gap: vars.spacing.gap.inline.sm,
125
+ minHeight: vars.sizing.hit.base,
126
+ paddingBlock: vars.spacing.inset.control.md,
127
+ paddingInline: vars.spacing.inset.control.md,
128
+ border: "none",
129
+ background: "none",
130
+ backgroundColor: resolveInteractiveStyle(c?.background, flags),
131
+ color: resolveInteractiveStyle(c?.text, flags) ?? c?.text?.default,
132
+ cursor: isDisabled ? "not-allowed" : "pointer",
133
+ opacity: isDisabled ? vars.opacity.disabled : void 0,
134
+ ...vars.text.label.md,
135
+ textAlign: "start",
136
+ transitionProperty: "background-color, color",
137
+ transitionDuration: vars.motion.transition.enter.duration,
138
+ transitionTimingFunction: vars.motion.transition.enter.easing,
139
+ outline: focusRingOutline(isFocusVisible),
140
+ outlineOffset: "-2px"
141
+ };
142
+ },
143
+ children: [/* @__PURE__ */jsx("span", {
144
+ "data-scope": "disclosure",
145
+ "data-part": "label",
146
+ style: {
147
+ flex: 1
148
+ },
149
+ children
150
+ }), /* @__PURE__ */jsx("span", {
151
+ "data-scope": "disclosure",
152
+ "data-part": "indicator",
153
+ "aria-hidden": true,
154
+ style: {
155
+ flexShrink: 0,
156
+ display: "inline-block",
157
+ transform: isExpanded ? "rotate(90deg)" : "rotate(0deg)",
158
+ transitionProperty: "transform",
159
+ transitionDuration: isExpanded ? vars.motion.transition.enter.duration : vars.motion.transition.exit.duration,
160
+ transitionTimingFunction: isExpanded ? vars.motion.transition.enter.easing : vars.motion.transition.exit.easing
161
+ },
162
+ children: /* @__PURE__ */jsx(Icon, {
163
+ intent: "disclosure.collapse"
164
+ })
165
+ })]
166
+ })
167
+ });
168
+ };
169
+ DisclosureTrigger.displayName = disclosureTriggerMeta.displayName;
170
+ /**
171
+ * The collapsible content region of a `Disclosure`. React Aria handles
172
+ * show/hide via the parent Disclosure state; the chrome uses
173
+ * `vars.motion.transition.{enter,exit}` semantics. Must be used inside a
174
+ * `Disclosure`.
175
+ *
176
+ * @example
177
+ * ```tsx
178
+ * <DisclosurePanel>Rarely-needed settings live here.</DisclosurePanel>
179
+ * ```
180
+ */
181
+ var DisclosurePanel$1 = ({
182
+ children,
183
+ ...props
184
+ }) => {
185
+ const {
186
+ evaluation
187
+ } = disclosureScope.use(disclosurePanelMeta.displayName);
188
+ const c = vars.colors.navigation[evaluation];
189
+ return /* @__PURE__ */jsx(DisclosurePanel, {
190
+ ...props,
191
+ "data-scope": "disclosure",
192
+ "data-part": "content",
193
+ style: {
194
+ boxSizing: "border-box",
195
+ paddingBlock: vars.spacing.inset.control.md,
196
+ paddingInline: vars.spacing.inset.control.md,
197
+ backgroundColor: c?.background?.default,
198
+ color: c?.text?.default,
199
+ ...vars.text.body.md
200
+ },
201
+ children
202
+ });
203
+ };
204
+ DisclosurePanel$1.displayName = disclosurePanelMeta.displayName;
205
+
206
+ //#endregion
207
+ export { Disclosure$1 as Disclosure, DisclosurePanel$1 as DisclosurePanel, DisclosureTrigger, disclosureMeta, disclosurePanelMeta, disclosureTriggerMeta };