@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
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024, Terezinha Tech Operations (ttoss)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,76 @@
1
+ # @ttoss/fsl-ui
2
+
3
+ Semantic, token-native component library for ttoss. Built on [React Aria Components](https://react-spectrum.adobe.com/react-aria/) with `@ttoss/fsl-theme` tokens.
4
+
5
+ Components are not visual variants of widgets — they are executable expressions of the [FSL](https://ttoss.dev/docs/design/design-system/fsl) semantic model. A component's identity (`Entity`, `Structure`, `Composition`, `Consequence`) determines which tokens it may consume.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pnpm add @ttoss/fsl-ui @ttoss/fsl-theme react-aria-components
11
+ ```
12
+
13
+ Peer dependencies: `react >= 18`, `react-dom >= 18`. The package is ESM-only, ships `sideEffects: false`, and tree-shakes: a Button-only import costs ≈ 1.8 KB minified before shared dependencies (React Aria Components is the dominant cost and is shared across every component you use).
14
+
15
+ ## Quickstart
16
+
17
+ Components read CSS-variable tokens, so the theme must be mounted once at the root:
18
+
19
+ ```tsx
20
+ import { createTheme } from '@ttoss/fsl-theme';
21
+ import { ThemeProvider } from '@ttoss/fsl-theme/react';
22
+ import { Button } from '@ttoss/fsl-ui';
23
+
24
+ const theme = createTheme(); // base theme + dark alternate
25
+
26
+ export const App = () => {
27
+ return (
28
+ <ThemeProvider theme={theme} defaultMode="system">
29
+ <Button
30
+ evaluation="primary"
31
+ onPress={() => {
32
+ console.log('pressed');
33
+ }}
34
+ >
35
+ Save
36
+ </Button>
37
+ </ThemeProvider>
38
+ );
39
+ };
40
+ ```
41
+
42
+ Three props carry the semantic model everywhere:
43
+
44
+ - `evaluation` — authorial emphasis (`primary`, `muted`, `negative`, …). Data-entry components (`TextField`, `Select`, `Checkbox`, …) intentionally have none: validation is the runtime `isInvalid` state, never a color prop.
45
+ - `consequence` — effect on state (`neutral`, `committing`, `destructive`). It drives mechanism: a `destructive` `ConfirmationDialog` requires a two-click armed confirmation.
46
+ - `composition` — the slot an element plays inside a parent (`primaryAction`, `dismissAction`, …). `DialogActions` reorders its children by it per platform convention.
47
+
48
+ Flow-critical labels are required props with no English defaults — `ConfirmationDialog` and `WizardNavigation` force the caller to supply localized copy (see `CONTRIBUTING.md` §6).
49
+
50
+ ## Customization
51
+
52
+ Composites accept no `style`/`className`. Geometry the host legitimately owns is exposed as `--fsl-*` CSS custom properties with built-in fallbacks:
53
+
54
+ ```css
55
+ [data-scope='dialog'] {
56
+ --fsl-dialog-max-width: 720px;
57
+ }
58
+ ```
59
+
60
+ The registered knobs and the full policy live in `src/tokens/CONTRACT.md` §7.
61
+
62
+ Icons are internal: components render glyphs through a semantic layer over the [Iconify](https://iconify.design/) provider (default set: Lucide), registered offline (no runtime network fetch). There is no public `Icon` export yet — see CONTRIBUTING ADR-005.
63
+
64
+ ## AI-first surface
65
+
66
+ The published tarball ships the machine-readable ground truth:
67
+
68
+ - **`llms.txt`** — distilled contract: semantic model, component catalog, Entity → token map, state cascade, integration rules.
69
+ - **`src/tokens/CONTRACT.md`** — the full Layer-2 authoring contract. Given an `Entity`, it specifies the exact `vars.*` paths, state cascade, and `data-*` conventions a component must use.
70
+
71
+ ## Contributing
72
+
73
+ - **`src/semantics/taxonomy.ts`** — the FSL vocabulary and legality matrices.
74
+ - **`CONTRIBUTING.md`** — how to add components, entities, and taxonomy terms; hard rules; package ADRs.
75
+
76
+ Contract tests auto-discover every `*Meta` export from `src/index.ts` and validate it against the taxonomy + token hygiene rules. No manual registry. `pnpm run verify:treeshake` proves the barrel still tree-shakes.
@@ -0,0 +1,30 @@
1
+ /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
+ //#region \0rolldown/runtime.js
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
12
+ key = keys[i];
13
+ if (!__hasOwnProp.call(to, key) && key !== except) {
14
+ __defProp(to, key, {
15
+ get: (k => from[k]).bind(null, key),
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ }
19
+ }
20
+ }
21
+ return to;
22
+ };
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
+ value: mod,
25
+ enumerable: true
26
+ }) : target, mod));
27
+
28
+ //#endregion
29
+
30
+ exports.__toESM = __toESM;
@@ -0,0 +1,129 @@
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
+ let _ttoss_fsl_theme_vars = require("@ttoss/fsl-theme/vars");
5
+ let react_aria_components = require("react-aria-components");
6
+ let react_jsx_runtime = require("react/jsx-runtime");
7
+
8
+ //#region src/components/Breadcrumbs/Breadcrumbs.tsx
9
+ /** Formal semantic identity — Breadcrumbs root (Navigation entity, trail). */
10
+ var breadcrumbsMeta = {
11
+ displayName: "Breadcrumbs",
12
+ entity: "Navigation",
13
+ structure: "root"
14
+ };
15
+ /** Formal semantic identity — Breadcrumb item (Navigation entity). */
16
+ var breadcrumbMeta = {
17
+ displayName: "Breadcrumb",
18
+ entity: "Navigation",
19
+ structure: "item"
20
+ };
21
+ /**
22
+ * A breadcrumb trail (Navigation entity). Renders an ordered list of
23
+ * `Breadcrumb` items; React Aria marks the last as the current location.
24
+ *
25
+ * @example
26
+ * ```tsx
27
+ * <Breadcrumbs>
28
+ * <Breadcrumb href="/">Home</Breadcrumb>
29
+ * <Breadcrumb href="/reports">Reports</Breadcrumb>
30
+ * <Breadcrumb>Q3</Breadcrumb>
31
+ * </Breadcrumbs>
32
+ * ```
33
+ */
34
+ var Breadcrumbs = props => {
35
+ return /* @__PURE__ */(0, react_jsx_runtime.jsx)(react_aria_components.Breadcrumbs, {
36
+ ...props,
37
+ "data-scope": "breadcrumbs",
38
+ "data-part": "root",
39
+ style: {
40
+ boxSizing: "border-box",
41
+ display: "flex",
42
+ flexWrap: "wrap",
43
+ alignItems: "center",
44
+ gap: _ttoss_fsl_theme_vars.vars.spacing.gap.inline.sm,
45
+ margin: 0,
46
+ padding: 0,
47
+ listStyle: "none"
48
+ }
49
+ });
50
+ };
51
+ Breadcrumbs.displayName = breadcrumbsMeta.displayName;
52
+ /**
53
+ * One crumb in a `Breadcrumbs` trail. Renders a navigation link, except the
54
+ * current (last) crumb which renders as text in the `current` color and is
55
+ * followed by no separator.
56
+ */
57
+ var Breadcrumb = ({
58
+ href,
59
+ children,
60
+ ...props
61
+ }) => {
62
+ const colors = _ttoss_fsl_theme_vars.vars.colors.navigation.primary;
63
+ return /* @__PURE__ */(0, react_jsx_runtime.jsx)(react_aria_components.Breadcrumb, {
64
+ ...props,
65
+ "data-scope": "breadcrumbs",
66
+ "data-part": "item",
67
+ children: ({
68
+ isCurrent
69
+ }) => {
70
+ return /* @__PURE__ */(0, react_jsx_runtime.jsxs)("span", {
71
+ style: {
72
+ boxSizing: "border-box",
73
+ display: "inline-flex",
74
+ alignItems: "center",
75
+ gap: _ttoss_fsl_theme_vars.vars.spacing.gap.inline.sm
76
+ },
77
+ children: [isCurrent ? /* @__PURE__ */(0, react_jsx_runtime.jsx)("span", {
78
+ "data-scope": "breadcrumbs",
79
+ "data-part": "control",
80
+ "aria-current": "page",
81
+ style: {
82
+ ..._ttoss_fsl_theme_vars.vars.text.label.md,
83
+ color: colors?.text?.current ?? colors?.text?.default
84
+ },
85
+ children
86
+ }) : /* @__PURE__ */(0, react_jsx_runtime.jsx)(react_aria_components.Link, {
87
+ href,
88
+ "data-scope": "breadcrumbs",
89
+ "data-part": "control",
90
+ style: ({
91
+ isHovered,
92
+ isPressed,
93
+ isDisabled,
94
+ isFocusVisible
95
+ }) => {
96
+ return {
97
+ boxSizing: "border-box",
98
+ cursor: "pointer",
99
+ borderRadius: _ttoss_fsl_theme_vars.vars.radii.control,
100
+ textDecoration: isHovered ? "underline" : "none",
101
+ ..._ttoss_fsl_theme_vars.vars.text.label.md,
102
+ color: require_resolveInteractiveStyle.resolveInteractiveStyle(colors?.text, {
103
+ isHovered,
104
+ isPressed,
105
+ isDisabled
106
+ }),
107
+ outline: require_focusRing.focusRingOutline(isFocusVisible)
108
+ };
109
+ },
110
+ children
111
+ }), !isCurrent && /* @__PURE__ */(0, react_jsx_runtime.jsx)("span", {
112
+ "aria-hidden": true,
113
+ style: {
114
+ color: colors?.text?.default,
115
+ userSelect: "none"
116
+ },
117
+ children: "/"
118
+ })]
119
+ });
120
+ }
121
+ });
122
+ };
123
+ Breadcrumb.displayName = breadcrumbMeta.displayName;
124
+
125
+ //#endregion
126
+ exports.Breadcrumb = Breadcrumb;
127
+ exports.Breadcrumbs = Breadcrumbs;
128
+ exports.breadcrumbMeta = breadcrumbMeta;
129
+ exports.breadcrumbsMeta = breadcrumbsMeta;
@@ -0,0 +1,61 @@
1
+
2
+ import * as React from "react";
3
+ import { BreadcrumbProps, BreadcrumbsProps } from "react-aria-components";
4
+
5
+ //#region src/components/Breadcrumbs/Breadcrumbs.d.ts
6
+ /** Formal semantic identity — Breadcrumbs root (Navigation entity, trail). */
7
+ declare const breadcrumbsMeta: {
8
+ readonly displayName: "Breadcrumbs";
9
+ readonly entity: "Navigation";
10
+ readonly structure: "root";
11
+ };
12
+ /** Formal semantic identity — Breadcrumb item (Navigation entity). */
13
+ declare const breadcrumbMeta: {
14
+ readonly displayName: "Breadcrumb";
15
+ readonly entity: "Navigation";
16
+ readonly structure: "item";
17
+ };
18
+ /** Props for the Breadcrumbs container. */
19
+ type BreadcrumbsProps$1<T extends object = object> = Omit<BreadcrumbsProps<T>, 'style'>;
20
+ /**
21
+ * A breadcrumb trail (Navigation entity). Renders an ordered list of
22
+ * `Breadcrumb` items; React Aria marks the last as the current location.
23
+ *
24
+ * @example
25
+ * ```tsx
26
+ * <Breadcrumbs>
27
+ * <Breadcrumb href="/">Home</Breadcrumb>
28
+ * <Breadcrumb href="/reports">Reports</Breadcrumb>
29
+ * <Breadcrumb>Q3</Breadcrumb>
30
+ * </Breadcrumbs>
31
+ * ```
32
+ */
33
+ declare const Breadcrumbs: {
34
+ <T extends object = object>(props: BreadcrumbsProps$1<T>): import("react/jsx-runtime").JSX.Element;
35
+ displayName: "Breadcrumbs";
36
+ };
37
+ /** Props for a single Breadcrumb item. */
38
+ interface BreadcrumbProps$1 extends Omit<BreadcrumbProps, 'style'> {
39
+ /**
40
+ * Destination for this crumb. Omit on the final (current) crumb — the
41
+ * current location is rendered as text, not a link.
42
+ */
43
+ href?: string;
44
+ /** The crumb's visible label. */
45
+ children?: React.ReactNode;
46
+ }
47
+ /**
48
+ * One crumb in a `Breadcrumbs` trail. Renders a navigation link, except the
49
+ * current (last) crumb which renders as text in the `current` color and is
50
+ * followed by no separator.
51
+ */
52
+ declare const Breadcrumb: {
53
+ ({
54
+ href,
55
+ children,
56
+ ...props
57
+ }: BreadcrumbProps$1): import("react/jsx-runtime").JSX.Element;
58
+ displayName: "Breadcrumb";
59
+ };
60
+ //#endregion
61
+ export { Breadcrumb, BreadcrumbProps$1 as BreadcrumbProps, Breadcrumbs, BreadcrumbsProps$1 as BreadcrumbsProps, breadcrumbMeta, breadcrumbsMeta };
@@ -0,0 +1,61 @@
1
+
2
+ import { BreadcrumbProps, BreadcrumbsProps } from "react-aria-components";
3
+ import * as React from "react";
4
+
5
+ //#region src/components/Breadcrumbs/Breadcrumbs.d.ts
6
+ /** Formal semantic identity — Breadcrumbs root (Navigation entity, trail). */
7
+ declare const breadcrumbsMeta: {
8
+ readonly displayName: "Breadcrumbs";
9
+ readonly entity: "Navigation";
10
+ readonly structure: "root";
11
+ };
12
+ /** Formal semantic identity — Breadcrumb item (Navigation entity). */
13
+ declare const breadcrumbMeta: {
14
+ readonly displayName: "Breadcrumb";
15
+ readonly entity: "Navigation";
16
+ readonly structure: "item";
17
+ };
18
+ /** Props for the Breadcrumbs container. */
19
+ type BreadcrumbsProps$1<T extends object = object> = Omit<BreadcrumbsProps<T>, 'style'>;
20
+ /**
21
+ * A breadcrumb trail (Navigation entity). Renders an ordered list of
22
+ * `Breadcrumb` items; React Aria marks the last as the current location.
23
+ *
24
+ * @example
25
+ * ```tsx
26
+ * <Breadcrumbs>
27
+ * <Breadcrumb href="/">Home</Breadcrumb>
28
+ * <Breadcrumb href="/reports">Reports</Breadcrumb>
29
+ * <Breadcrumb>Q3</Breadcrumb>
30
+ * </Breadcrumbs>
31
+ * ```
32
+ */
33
+ declare const Breadcrumbs$1: {
34
+ <T extends object = object>(props: BreadcrumbsProps$1<T>): import("react/jsx-runtime").JSX.Element;
35
+ displayName: "Breadcrumbs";
36
+ };
37
+ /** Props for a single Breadcrumb item. */
38
+ interface BreadcrumbProps$1 extends Omit<BreadcrumbProps, 'style'> {
39
+ /**
40
+ * Destination for this crumb. Omit on the final (current) crumb — the
41
+ * current location is rendered as text, not a link.
42
+ */
43
+ href?: string;
44
+ /** The crumb's visible label. */
45
+ children?: React.ReactNode;
46
+ }
47
+ /**
48
+ * One crumb in a `Breadcrumbs` trail. Renders a navigation link, except the
49
+ * current (last) crumb which renders as text in the `current` color and is
50
+ * followed by no separator.
51
+ */
52
+ declare const Breadcrumb$1: {
53
+ ({
54
+ href,
55
+ children,
56
+ ...props
57
+ }: BreadcrumbProps$1): import("react/jsx-runtime").JSX.Element;
58
+ displayName: "Breadcrumb";
59
+ };
60
+ //#endregion
61
+ export { Breadcrumb$1 as Breadcrumb, BreadcrumbProps$1 as BreadcrumbProps, Breadcrumbs$1 as Breadcrumbs, BreadcrumbsProps$1 as BreadcrumbsProps, breadcrumbMeta, breadcrumbsMeta };
@@ -0,0 +1,126 @@
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 { Breadcrumb, Breadcrumbs, Link } from "react-aria-components";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+
8
+ //#region src/components/Breadcrumbs/Breadcrumbs.tsx
9
+ /** Formal semantic identity — Breadcrumbs root (Navigation entity, trail). */
10
+ var breadcrumbsMeta = {
11
+ displayName: "Breadcrumbs",
12
+ entity: "Navigation",
13
+ structure: "root"
14
+ };
15
+ /** Formal semantic identity — Breadcrumb item (Navigation entity). */
16
+ var breadcrumbMeta = {
17
+ displayName: "Breadcrumb",
18
+ entity: "Navigation",
19
+ structure: "item"
20
+ };
21
+ /**
22
+ * A breadcrumb trail (Navigation entity). Renders an ordered list of
23
+ * `Breadcrumb` items; React Aria marks the last as the current location.
24
+ *
25
+ * @example
26
+ * ```tsx
27
+ * <Breadcrumbs>
28
+ * <Breadcrumb href="/">Home</Breadcrumb>
29
+ * <Breadcrumb href="/reports">Reports</Breadcrumb>
30
+ * <Breadcrumb>Q3</Breadcrumb>
31
+ * </Breadcrumbs>
32
+ * ```
33
+ */
34
+ var Breadcrumbs$1 = props => {
35
+ return /* @__PURE__ */jsx(Breadcrumbs, {
36
+ ...props,
37
+ "data-scope": "breadcrumbs",
38
+ "data-part": "root",
39
+ style: {
40
+ boxSizing: "border-box",
41
+ display: "flex",
42
+ flexWrap: "wrap",
43
+ alignItems: "center",
44
+ gap: vars.spacing.gap.inline.sm,
45
+ margin: 0,
46
+ padding: 0,
47
+ listStyle: "none"
48
+ }
49
+ });
50
+ };
51
+ Breadcrumbs$1.displayName = breadcrumbsMeta.displayName;
52
+ /**
53
+ * One crumb in a `Breadcrumbs` trail. Renders a navigation link, except the
54
+ * current (last) crumb which renders as text in the `current` color and is
55
+ * followed by no separator.
56
+ */
57
+ var Breadcrumb$1 = ({
58
+ href,
59
+ children,
60
+ ...props
61
+ }) => {
62
+ const colors = vars.colors.navigation.primary;
63
+ return /* @__PURE__ */jsx(Breadcrumb, {
64
+ ...props,
65
+ "data-scope": "breadcrumbs",
66
+ "data-part": "item",
67
+ children: ({
68
+ isCurrent
69
+ }) => {
70
+ return /* @__PURE__ */jsxs("span", {
71
+ style: {
72
+ boxSizing: "border-box",
73
+ display: "inline-flex",
74
+ alignItems: "center",
75
+ gap: vars.spacing.gap.inline.sm
76
+ },
77
+ children: [isCurrent ? /* @__PURE__ */jsx("span", {
78
+ "data-scope": "breadcrumbs",
79
+ "data-part": "control",
80
+ "aria-current": "page",
81
+ style: {
82
+ ...vars.text.label.md,
83
+ color: colors?.text?.current ?? colors?.text?.default
84
+ },
85
+ children
86
+ }) : /* @__PURE__ */jsx(Link, {
87
+ href,
88
+ "data-scope": "breadcrumbs",
89
+ "data-part": "control",
90
+ style: ({
91
+ isHovered,
92
+ isPressed,
93
+ isDisabled,
94
+ isFocusVisible
95
+ }) => {
96
+ return {
97
+ boxSizing: "border-box",
98
+ cursor: "pointer",
99
+ borderRadius: vars.radii.control,
100
+ textDecoration: isHovered ? "underline" : "none",
101
+ ...vars.text.label.md,
102
+ color: resolveInteractiveStyle(colors?.text, {
103
+ isHovered,
104
+ isPressed,
105
+ isDisabled
106
+ }),
107
+ outline: focusRingOutline(isFocusVisible)
108
+ };
109
+ },
110
+ children
111
+ }), !isCurrent && /* @__PURE__ */jsx("span", {
112
+ "aria-hidden": true,
113
+ style: {
114
+ color: colors?.text?.default,
115
+ userSelect: "none"
116
+ },
117
+ children: "/"
118
+ })]
119
+ });
120
+ }
121
+ });
122
+ };
123
+ Breadcrumb$1.displayName = breadcrumbMeta.displayName;
124
+
125
+ //#endregion
126
+ export { Breadcrumb$1 as Breadcrumb, Breadcrumbs$1 as Breadcrumbs, breadcrumbMeta, breadcrumbsMeta };
@@ -0,0 +1,80 @@
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
+ let _ttoss_fsl_theme_vars = require("@ttoss/fsl-theme/vars");
5
+ let react_aria_components = require("react-aria-components");
6
+ let react_jsx_runtime = require("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 = ({
21
+ evaluation = "primary",
22
+ consequence = "neutral",
23
+ composition,
24
+ "data-scope": dataScope = "button",
25
+ ...props
26
+ }) => {
27
+ const colors = _ttoss_fsl_theme_vars.vars.colors.action[evaluation];
28
+ return /* @__PURE__ */(0, react_jsx_runtime.jsx)(react_aria_components.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: _ttoss_fsl_theme_vars.vars.radii.control,
48
+ borderWidth: _ttoss_fsl_theme_vars.vars.border.outline.control.width,
49
+ borderStyle: _ttoss_fsl_theme_vars.vars.border.outline.control.style,
50
+ minHeight: _ttoss_fsl_theme_vars.vars.sizing.hit.base,
51
+ paddingBlock: _ttoss_fsl_theme_vars.vars.spacing.inset.control.sm,
52
+ paddingInline: _ttoss_fsl_theme_vars.vars.spacing.inset.control.lg,
53
+ ..._ttoss_fsl_theme_vars.vars.text.label.md,
54
+ transitionDuration: _ttoss_fsl_theme_vars.vars.motion.feedback.duration,
55
+ transitionTimingFunction: _ttoss_fsl_theme_vars.vars.motion.feedback.easing,
56
+ transitionProperty: "background-color, border-color, color",
57
+ backgroundColor: require_resolveInteractiveStyle.resolveInteractiveStyle(colors?.background, {
58
+ isHovered,
59
+ isPressed,
60
+ isDisabled
61
+ }),
62
+ borderColor: require_resolveInteractiveStyle.resolveInteractiveStyle(colors?.border, {
63
+ isDisabled,
64
+ isFocusVisible
65
+ }),
66
+ color: require_resolveInteractiveStyle.resolveInteractiveStyle(colors?.text, {
67
+ isHovered,
68
+ isPressed,
69
+ isDisabled
70
+ }) ?? colors?.text?.default,
71
+ outline: require_focusRing.focusRingOutline(isFocusVisible)
72
+ };
73
+ }
74
+ });
75
+ };
76
+ Button.displayName = buttonMeta.displayName;
77
+
78
+ //#endregion
79
+ exports.Button = Button;
80
+ exports.buttonMeta = buttonMeta;
@@ -0,0 +1,68 @@
1
+
2
+ import { CompositionsFor, ConsequencesFor, EvaluationsFor } from "../../semantics/taxonomy.cjs";
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: {
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, ButtonProps$1 as ButtonProps, buttonMeta };