@ttoss/fsl-ui 0.2.4 → 0.2.5

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 (117) hide show
  1. package/dist/components/AppShell/AppShell.cjs +124 -0
  2. package/dist/components/AppShell/AppShell.d.cts +74 -0
  3. package/dist/components/AppShell/AppShell.d.mts +74 -0
  4. package/dist/components/AppShell/AppShell.mjs +123 -0
  5. package/dist/components/Badge/Badge.cjs +61 -0
  6. package/dist/components/Badge/Badge.d.cts +56 -0
  7. package/dist/components/Badge/Badge.d.mts +56 -0
  8. package/dist/components/Badge/Badge.mjs +60 -0
  9. package/dist/components/Box/Box.cjs +114 -0
  10. package/dist/components/Box/Box.d.cts +115 -0
  11. package/dist/components/Box/Box.d.mts +115 -0
  12. package/dist/components/Box/Box.mjs +113 -0
  13. package/dist/components/Breadcrumbs/Breadcrumbs.cjs +1 -1
  14. package/dist/components/Breadcrumbs/Breadcrumbs.mjs +1 -1
  15. package/dist/components/Button/Button.cjs +2 -2
  16. package/dist/components/Button/Button.d.cts +2 -1
  17. package/dist/components/Button/Button.d.mts +2 -1
  18. package/dist/components/Button/Button.mjs +2 -2
  19. package/dist/components/Checkbox/Checkbox.cjs +2 -2
  20. package/dist/components/Checkbox/Checkbox.mjs +2 -2
  21. package/dist/components/CheckboxGroup/CheckboxGroup.cjs +1 -1
  22. package/dist/components/CheckboxGroup/CheckboxGroup.mjs +1 -1
  23. package/dist/components/Code/Code.cjs +69 -0
  24. package/dist/components/Code/Code.d.cts +53 -0
  25. package/dist/components/Code/Code.d.mts +53 -0
  26. package/dist/components/Code/Code.mjs +68 -0
  27. package/dist/components/Container/Container.cjs +65 -0
  28. package/dist/components/Container/Container.d.cts +61 -0
  29. package/dist/components/Container/Container.d.mts +61 -0
  30. package/dist/components/Container/Container.mjs +64 -0
  31. package/dist/components/FileTrigger/FileTrigger.cjs +1 -1
  32. package/dist/components/FileTrigger/FileTrigger.mjs +1 -1
  33. package/dist/components/Grid/Grid.cjs +88 -0
  34. package/dist/components/Grid/Grid.d.cts +87 -0
  35. package/dist/components/Grid/Grid.d.mts +87 -0
  36. package/dist/components/Grid/Grid.mjs +87 -0
  37. package/dist/components/GridList/GridList.cjs +2 -2
  38. package/dist/components/GridList/GridList.mjs +2 -2
  39. package/dist/components/Group/Group.cjs +1 -1
  40. package/dist/components/Group/Group.mjs +1 -1
  41. package/dist/components/Heading/Heading.cjs +78 -0
  42. package/dist/components/Heading/Heading.d.cts +63 -0
  43. package/dist/components/Heading/Heading.d.mts +63 -0
  44. package/dist/components/Heading/Heading.mjs +77 -0
  45. package/dist/components/Link/Link.cjs +1 -1
  46. package/dist/components/Link/Link.mjs +1 -1
  47. package/dist/components/ListBox/ListBox.cjs +1 -1
  48. package/dist/components/ListBox/ListBox.mjs +1 -1
  49. package/dist/components/Meter/Meter.cjs +11 -1
  50. package/dist/components/Meter/Meter.mjs +11 -1
  51. package/dist/components/NumberField/NumberField.cjs +2 -2
  52. package/dist/components/NumberField/NumberField.mjs +2 -2
  53. package/dist/components/ProgressBar/ProgressBar.cjs +1 -1
  54. package/dist/components/ProgressBar/ProgressBar.mjs +1 -1
  55. package/dist/components/RadioGroup/RadioGroup.cjs +2 -2
  56. package/dist/components/RadioGroup/RadioGroup.mjs +2 -2
  57. package/dist/components/Select/Select.cjs +2 -2
  58. package/dist/components/Select/Select.mjs +2 -2
  59. package/dist/components/Separator/Separator.cjs +1 -1
  60. package/dist/components/Separator/Separator.mjs +1 -1
  61. package/dist/components/Slider/Slider.cjs +1 -1
  62. package/dist/components/Slider/Slider.mjs +1 -1
  63. package/dist/components/Stack/Stack.cjs +89 -0
  64. package/dist/components/Stack/Stack.d.cts +75 -0
  65. package/dist/components/Stack/Stack.d.mts +75 -0
  66. package/dist/components/Stack/Stack.mjs +88 -0
  67. package/dist/components/Surface/Surface.cjs +84 -0
  68. package/dist/components/Surface/Surface.d.cts +72 -0
  69. package/dist/components/Surface/Surface.d.mts +72 -0
  70. package/dist/components/Surface/Surface.mjs +83 -0
  71. package/dist/components/Switch/Switch.cjs +3 -3
  72. package/dist/components/Switch/Switch.d.cts +1 -1
  73. package/dist/components/Switch/Switch.d.mts +1 -1
  74. package/dist/components/Switch/Switch.mjs +3 -3
  75. package/dist/components/Tabs/Tabs.cjs +1 -1
  76. package/dist/components/Tabs/Tabs.mjs +1 -1
  77. package/dist/components/Text/Text.cjs +69 -0
  78. package/dist/components/Text/Text.d.cts +84 -0
  79. package/dist/components/Text/Text.d.mts +84 -0
  80. package/dist/components/Text/Text.mjs +68 -0
  81. package/dist/components/Toast/Toast.cjs +1 -1
  82. package/dist/components/Toast/Toast.mjs +1 -1
  83. package/dist/components/ToggleButton/ToggleButton.cjs +2 -2
  84. package/dist/components/ToggleButton/ToggleButton.mjs +2 -2
  85. package/dist/components/ToggleButtonGroup/ToggleButtonGroup.cjs +1 -1
  86. package/dist/components/ToggleButtonGroup/ToggleButtonGroup.mjs +1 -1
  87. package/dist/components/Toolbar/Toolbar.cjs +1 -1
  88. package/dist/components/Toolbar/Toolbar.mjs +1 -1
  89. package/dist/composites/Accordion/Accordion.cjs +14 -9
  90. package/dist/composites/Accordion/Accordion.mjs +14 -9
  91. package/dist/composites/Dialog/Dialog.cjs +1 -1
  92. package/dist/composites/Dialog/Dialog.mjs +1 -1
  93. package/dist/composites/Disclosure/Disclosure.cjs +14 -9
  94. package/dist/composites/Disclosure/Disclosure.mjs +14 -9
  95. package/dist/composites/Form/Form.cjs +1 -1
  96. package/dist/composites/Form/Form.mjs +1 -1
  97. package/dist/composites/Menu/Menu.cjs +2 -2
  98. package/dist/composites/Menu/Menu.mjs +2 -2
  99. package/dist/composites/Popover/Popover.cjs +1 -1
  100. package/dist/composites/Popover/Popover.mjs +1 -1
  101. package/dist/composites/SearchField/SearchField.cjs +2 -2
  102. package/dist/composites/SearchField/SearchField.mjs +2 -2
  103. package/dist/composites/TagGroup/TagGroup.cjs +2 -2
  104. package/dist/composites/TagGroup/TagGroup.mjs +2 -2
  105. package/dist/composites/TextArea/TextArea.cjs +2 -2
  106. package/dist/composites/TextArea/TextArea.mjs +2 -2
  107. package/dist/composites/TextField/TextField.cjs +2 -2
  108. package/dist/composites/TextField/TextField.mjs +2 -2
  109. package/dist/composites/Tooltip/Tooltip.cjs +1 -1
  110. package/dist/composites/Tooltip/Tooltip.mjs +1 -1
  111. package/dist/index.cjs +30 -0
  112. package/dist/index.d.cts +11 -1
  113. package/dist/index.d.mts +11 -1
  114. package/dist/index.mjs +11 -1
  115. package/llms.txt +12 -1
  116. package/package.json +4 -4
  117. package/src/tokens/CONTRACT.md +23 -4
@@ -3,8 +3,8 @@ import { focusRingOutline } from "../../tokens/focusRing.mjs";
3
3
  import { resolveInteractiveStyle } from "../../tokens/resolveInteractiveStyle.mjs";
4
4
  import { Icon } from "../Icon/Icon.mjs";
5
5
  import { vars } from "@ttoss/fsl-theme/vars";
6
- import { Button, FieldError, Group, Input, Label, NumberField, Text } from "react-aria-components";
7
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { Button, FieldError, Group, Input, Label, NumberField, Text } from "react-aria-components";
8
8
 
9
9
  //#region src/components/NumberField/NumberField.tsx
10
10
  /** Formal semantic identity — NumberField root (Input entity). */
@@ -24,7 +24,7 @@ var buildControlBoxStyle = ({
24
24
  boxSizing: "border-box",
25
25
  display: "inline-flex",
26
26
  alignItems: "center",
27
- minHeight: vars.sizing.hit.base,
27
+ minHeight: vars.sizing.hit,
28
28
  borderRadius: vars.radii.control,
29
29
  borderWidth: vars.border.outline.control.width,
30
30
  borderStyle: vars.border.outline.control.style,
@@ -2,8 +2,8 @@
2
2
  const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
3
3
  const require_keyframes = require('../../tokens/keyframes.cjs');
4
4
  let _ttoss_fsl_theme_vars = require("@ttoss/fsl-theme/vars");
5
- let react_aria_components = require("react-aria-components");
6
5
  let react_jsx_runtime = require("react/jsx-runtime");
6
+ let react_aria_components = require("react-aria-components");
7
7
  let react = require("react");
8
8
  react = require_runtime.__toESM(react);
9
9
 
@@ -1,8 +1,8 @@
1
1
  /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
2
  import { ANIMATION_NAMES, ensureKeyframes } from "../../tokens/keyframes.mjs";
3
3
  import { vars } from "@ttoss/fsl-theme/vars";
4
- import { ProgressBar } from "react-aria-components";
5
4
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ import { ProgressBar } from "react-aria-components";
6
6
  import * as React from "react";
7
7
 
8
8
  //#region src/components/ProgressBar/ProgressBar.tsx
@@ -2,8 +2,8 @@
2
2
  const require_focusRing = require('../../tokens/focusRing.cjs');
3
3
  const require_resolveInteractiveStyle = require('../../tokens/resolveInteractiveStyle.cjs');
4
4
  let _ttoss_fsl_theme_vars = require("@ttoss/fsl-theme/vars");
5
- let react_aria_components = require("react-aria-components");
6
5
  let react_jsx_runtime = require("react/jsx-runtime");
6
+ let react_aria_components = require("react-aria-components");
7
7
 
8
8
  //#region src/components/RadioGroup/RadioGroup.tsx
9
9
  /** Formal semantic identity — RadioGroup root (Selection entity, single-choice). */
@@ -151,7 +151,7 @@ var Radio = ({
151
151
  display: "inline-flex",
152
152
  alignItems: "center",
153
153
  gap: _ttoss_fsl_theme_vars.vars.spacing.gap.inline.sm,
154
- minHeight: _ttoss_fsl_theme_vars.vars.sizing.hit.base,
154
+ minHeight: _ttoss_fsl_theme_vars.vars.sizing.hit,
155
155
  cursor: isDisabled ? "not-allowed" : "pointer",
156
156
  opacity: isDisabled ? _ttoss_fsl_theme_vars.vars.opacity.disabled : void 0,
157
157
  ..._ttoss_fsl_theme_vars.vars.text.label.md,
@@ -2,8 +2,8 @@
2
2
  import { focusRingOutline } from "../../tokens/focusRing.mjs";
3
3
  import { resolveInteractiveStyle } from "../../tokens/resolveInteractiveStyle.mjs";
4
4
  import { vars } from "@ttoss/fsl-theme/vars";
5
- import { Label, Radio, RadioGroup } from "react-aria-components";
6
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ import { Label, Radio, RadioGroup } from "react-aria-components";
7
7
 
8
8
  //#region src/components/RadioGroup/RadioGroup.tsx
9
9
  /** Formal semantic identity — RadioGroup root (Selection entity, single-choice). */
@@ -151,7 +151,7 @@ var Radio$1 = ({
151
151
  display: "inline-flex",
152
152
  alignItems: "center",
153
153
  gap: vars.spacing.gap.inline.sm,
154
- minHeight: vars.sizing.hit.base,
154
+ minHeight: vars.sizing.hit,
155
155
  cursor: isDisabled ? "not-allowed" : "pointer",
156
156
  opacity: isDisabled ? vars.opacity.disabled : void 0,
157
157
  ...vars.text.label.md,
@@ -3,8 +3,8 @@ const require_focusRing = require('../../tokens/focusRing.cjs');
3
3
  const require_resolveInteractiveStyle = require('../../tokens/resolveInteractiveStyle.cjs');
4
4
  const require_Icon = require('../Icon/Icon.cjs');
5
5
  let _ttoss_fsl_theme_vars = require("@ttoss/fsl-theme/vars");
6
- let react_aria_components = require("react-aria-components");
7
6
  let react_jsx_runtime = require("react/jsx-runtime");
7
+ let react_aria_components = require("react-aria-components");
8
8
 
9
9
  //#region src/components/Select/Select.tsx
10
10
  var selectMeta = {
@@ -104,7 +104,7 @@ var Select = ({
104
104
  alignItems: "center",
105
105
  justifyContent: "space-between",
106
106
  gap: _ttoss_fsl_theme_vars.vars.spacing.gap.inline.sm,
107
- minHeight: _ttoss_fsl_theme_vars.vars.sizing.hit.base,
107
+ minHeight: _ttoss_fsl_theme_vars.vars.sizing.hit,
108
108
  paddingBlock: _ttoss_fsl_theme_vars.vars.spacing.inset.control.md,
109
109
  paddingInline: _ttoss_fsl_theme_vars.vars.spacing.inset.control.md,
110
110
  borderRadius: _ttoss_fsl_theme_vars.vars.radii.control,
@@ -3,8 +3,8 @@ import { focusRingOutline } from "../../tokens/focusRing.mjs";
3
3
  import { resolveInteractiveStyle } from "../../tokens/resolveInteractiveStyle.mjs";
4
4
  import { Icon } from "../Icon/Icon.mjs";
5
5
  import { vars } from "@ttoss/fsl-theme/vars";
6
- import { Button, Label, ListBox, ListBoxItem, Popover, Select, SelectValue } from "react-aria-components";
7
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ import { Button, Label, ListBox, ListBoxItem, Popover, Select, SelectValue } from "react-aria-components";
8
8
 
9
9
  //#region src/components/Select/Select.tsx
10
10
  var selectMeta = {
@@ -104,7 +104,7 @@ var Select$1 = ({
104
104
  alignItems: "center",
105
105
  justifyContent: "space-between",
106
106
  gap: vars.spacing.gap.inline.sm,
107
- minHeight: vars.sizing.hit.base,
107
+ minHeight: vars.sizing.hit,
108
108
  paddingBlock: vars.spacing.inset.control.md,
109
109
  paddingInline: vars.spacing.inset.control.md,
110
110
  borderRadius: vars.radii.control,
@@ -1,7 +1,7 @@
1
1
  /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
2
  let _ttoss_fsl_theme_vars = require("@ttoss/fsl-theme/vars");
3
- let react_aria_components = require("react-aria-components");
4
3
  let react_jsx_runtime = require("react/jsx-runtime");
4
+ let react_aria_components = require("react-aria-components");
5
5
 
6
6
  //#region src/components/Separator/Separator.tsx
7
7
  /** Formal semantic identity — Separator root (Structure entity, divider). */
@@ -1,7 +1,7 @@
1
1
  /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
2
  import { vars } from "@ttoss/fsl-theme/vars";
3
- import { Separator } from "react-aria-components";
4
3
  import { jsx } from "react/jsx-runtime";
4
+ import { Separator } from "react-aria-components";
5
5
 
6
6
  //#region src/components/Separator/Separator.tsx
7
7
  /** Formal semantic identity — Separator root (Structure entity, divider). */
@@ -1,8 +1,8 @@
1
1
  /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
2
  const require_focusRing = require('../../tokens/focusRing.cjs');
3
3
  let _ttoss_fsl_theme_vars = require("@ttoss/fsl-theme/vars");
4
- let react_aria_components = require("react-aria-components");
5
4
  let react_jsx_runtime = require("react/jsx-runtime");
5
+ let react_aria_components = require("react-aria-components");
6
6
 
7
7
  //#region src/components/Slider/Slider.tsx
8
8
  /** Formal semantic identity — Slider root (Input entity). */
@@ -1,8 +1,8 @@
1
1
  /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
2
  import { focusRingOutline } from "../../tokens/focusRing.mjs";
3
3
  import { vars } from "@ttoss/fsl-theme/vars";
4
- import { Label, Slider, SliderOutput, SliderThumb, SliderTrack } from "react-aria-components";
5
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { Label, Slider, SliderOutput, SliderThumb, SliderTrack } from "react-aria-components";
6
6
 
7
7
  //#region src/components/Slider/Slider.tsx
8
8
  /** Formal semantic identity — Slider root (Input entity). */
@@ -0,0 +1,89 @@
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_jsx_runtime = require("react/jsx-runtime");
4
+
5
+ //#region src/components/Stack/Stack.tsx
6
+ /** Formal semantic identity — Stack root (Structure entity, layout rhythm). */
7
+ var stackMeta = {
8
+ displayName: "Stack",
9
+ entity: "Structure",
10
+ structure: "root"
11
+ };
12
+ var GAP_STACK = {
13
+ xs: _ttoss_fsl_theme_vars.vars.spacing.gap.stack.xs,
14
+ sm: _ttoss_fsl_theme_vars.vars.spacing.gap.stack.sm,
15
+ md: _ttoss_fsl_theme_vars.vars.spacing.gap.stack.md,
16
+ lg: _ttoss_fsl_theme_vars.vars.spacing.gap.stack.lg,
17
+ xl: _ttoss_fsl_theme_vars.vars.spacing.gap.stack.xl
18
+ };
19
+ var GAP_INLINE = {
20
+ xs: _ttoss_fsl_theme_vars.vars.spacing.gap.inline.xs,
21
+ sm: _ttoss_fsl_theme_vars.vars.spacing.gap.inline.sm,
22
+ md: _ttoss_fsl_theme_vars.vars.spacing.gap.inline.md,
23
+ lg: _ttoss_fsl_theme_vars.vars.spacing.gap.inline.lg,
24
+ xl: _ttoss_fsl_theme_vars.vars.spacing.gap.inline.xl
25
+ };
26
+ var ALIGN = {
27
+ start: "flex-start",
28
+ center: "center",
29
+ end: "flex-end",
30
+ stretch: "stretch"
31
+ };
32
+ var JUSTIFY = {
33
+ start: "flex-start",
34
+ center: "center",
35
+ end: "flex-end",
36
+ between: "space-between"
37
+ };
38
+ /**
39
+ * The layout rhythm primitive — a flex container spaced from the FSL gap scale.
40
+ *
41
+ * Entity = Structure. Use it to stack sections (`direction="vertical"`) or lay
42
+ * out a row of controls (`direction="horizontal"`) with consistent, themeable
43
+ * spacing. `gap`, `align`, and `justify` draw only from named scales/keywords —
44
+ * there is no raw `gap: 12px`, which is how spacing rhythm stays consistent
45
+ * across a product.
46
+ *
47
+ * @example
48
+ * ```tsx
49
+ * <Stack gap="lg">
50
+ * <Heading level={2}>Payment</Heading>
51
+ * <Stack direction="horizontal" gap="sm" justify="end">
52
+ * <Button evaluation="muted">Cancel</Button>
53
+ * <Button evaluation="primary">Save</Button>
54
+ * </Stack>
55
+ * </Stack>
56
+ * ```
57
+ */
58
+ var Stack = ({
59
+ direction = "vertical",
60
+ gap = "md",
61
+ align = "stretch",
62
+ justify = "start",
63
+ wrap = false,
64
+ children,
65
+ ...props
66
+ }) => {
67
+ const isHorizontal = direction === "horizontal";
68
+ return /* @__PURE__ */(0, react_jsx_runtime.jsx)("div", {
69
+ ...props,
70
+ "data-scope": "stack",
71
+ "data-part": "root",
72
+ "data-direction": direction,
73
+ "data-gap": gap,
74
+ style: {
75
+ display: "flex",
76
+ flexDirection: isHorizontal ? "row" : "column",
77
+ gap: isHorizontal ? GAP_INLINE[gap] : GAP_STACK[gap],
78
+ alignItems: ALIGN[align],
79
+ justifyContent: JUSTIFY[justify],
80
+ flexWrap: wrap ? "wrap" : "nowrap"
81
+ },
82
+ children
83
+ });
84
+ };
85
+ Stack.displayName = stackMeta.displayName;
86
+
87
+ //#endregion
88
+ exports.Stack = Stack;
89
+ exports.stackMeta = stackMeta;
@@ -0,0 +1,75 @@
1
+
2
+ import * as React from "react";
3
+
4
+ //#region src/components/Stack/Stack.d.ts
5
+ /** Formal semantic identity — Stack root (Structure entity, layout rhythm). */
6
+ declare const stackMeta: {
7
+ readonly displayName: "Stack";
8
+ readonly entity: "Structure";
9
+ readonly structure: "root";
10
+ };
11
+ /** Flow direction — vertical stacks, horizontal inlines. */
12
+ type StackDirection = 'vertical' | 'horizontal';
13
+ /** A step of the gap scale. */
14
+ type StackGap = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
15
+ /** Cross-axis alignment. */
16
+ type StackAlign = 'start' | 'center' | 'end' | 'stretch';
17
+ /** Main-axis distribution. */
18
+ type StackJustify = 'start' | 'center' | 'end' | 'between';
19
+ /** Props for the Stack component. */
20
+ interface StackProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'style' | 'className'> {
21
+ /**
22
+ * Flow direction. `vertical` stacks children in a column (reads the
23
+ * `gap.stack` scale); `horizontal` lays them in a row (reads `gap.inline`).
24
+ * @default 'vertical'
25
+ */
26
+ direction?: StackDirection;
27
+ /**
28
+ * Space between children, from the gap scale. There is no raw-length
29
+ * vocabulary — rhythm always comes from the scale.
30
+ * @default 'md'
31
+ */
32
+ gap?: StackGap;
33
+ /** Cross-axis alignment (`align-items`). @default 'stretch' */
34
+ align?: StackAlign;
35
+ /** Main-axis distribution (`justify-content`). @default 'start' */
36
+ justify?: StackJustify;
37
+ /** Allow children to wrap onto multiple lines. @default false */
38
+ wrap?: boolean;
39
+ /** The items to lay out. */
40
+ children?: React.ReactNode;
41
+ }
42
+ /**
43
+ * The layout rhythm primitive — a flex container spaced from the FSL gap scale.
44
+ *
45
+ * Entity = Structure. Use it to stack sections (`direction="vertical"`) or lay
46
+ * out a row of controls (`direction="horizontal"`) with consistent, themeable
47
+ * spacing. `gap`, `align`, and `justify` draw only from named scales/keywords —
48
+ * there is no raw `gap: 12px`, which is how spacing rhythm stays consistent
49
+ * across a product.
50
+ *
51
+ * @example
52
+ * ```tsx
53
+ * <Stack gap="lg">
54
+ * <Heading level={2}>Payment</Heading>
55
+ * <Stack direction="horizontal" gap="sm" justify="end">
56
+ * <Button evaluation="muted">Cancel</Button>
57
+ * <Button evaluation="primary">Save</Button>
58
+ * </Stack>
59
+ * </Stack>
60
+ * ```
61
+ */
62
+ declare const Stack: {
63
+ ({
64
+ direction,
65
+ gap,
66
+ align,
67
+ justify,
68
+ wrap,
69
+ children,
70
+ ...props
71
+ }: StackProps): import("react/jsx-runtime").JSX.Element;
72
+ displayName: "Stack";
73
+ };
74
+ //#endregion
75
+ export { Stack, StackAlign, StackDirection, StackGap, StackJustify, StackProps, stackMeta };
@@ -0,0 +1,75 @@
1
+
2
+ import * as React from "react";
3
+
4
+ //#region src/components/Stack/Stack.d.ts
5
+ /** Formal semantic identity — Stack root (Structure entity, layout rhythm). */
6
+ declare const stackMeta: {
7
+ readonly displayName: "Stack";
8
+ readonly entity: "Structure";
9
+ readonly structure: "root";
10
+ };
11
+ /** Flow direction — vertical stacks, horizontal inlines. */
12
+ type StackDirection = 'vertical' | 'horizontal';
13
+ /** A step of the gap scale. */
14
+ type StackGap = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
15
+ /** Cross-axis alignment. */
16
+ type StackAlign = 'start' | 'center' | 'end' | 'stretch';
17
+ /** Main-axis distribution. */
18
+ type StackJustify = 'start' | 'center' | 'end' | 'between';
19
+ /** Props for the Stack component. */
20
+ interface StackProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'style' | 'className'> {
21
+ /**
22
+ * Flow direction. `vertical` stacks children in a column (reads the
23
+ * `gap.stack` scale); `horizontal` lays them in a row (reads `gap.inline`).
24
+ * @default 'vertical'
25
+ */
26
+ direction?: StackDirection;
27
+ /**
28
+ * Space between children, from the gap scale. There is no raw-length
29
+ * vocabulary — rhythm always comes from the scale.
30
+ * @default 'md'
31
+ */
32
+ gap?: StackGap;
33
+ /** Cross-axis alignment (`align-items`). @default 'stretch' */
34
+ align?: StackAlign;
35
+ /** Main-axis distribution (`justify-content`). @default 'start' */
36
+ justify?: StackJustify;
37
+ /** Allow children to wrap onto multiple lines. @default false */
38
+ wrap?: boolean;
39
+ /** The items to lay out. */
40
+ children?: React.ReactNode;
41
+ }
42
+ /**
43
+ * The layout rhythm primitive — a flex container spaced from the FSL gap scale.
44
+ *
45
+ * Entity = Structure. Use it to stack sections (`direction="vertical"`) or lay
46
+ * out a row of controls (`direction="horizontal"`) with consistent, themeable
47
+ * spacing. `gap`, `align`, and `justify` draw only from named scales/keywords —
48
+ * there is no raw `gap: 12px`, which is how spacing rhythm stays consistent
49
+ * across a product.
50
+ *
51
+ * @example
52
+ * ```tsx
53
+ * <Stack gap="lg">
54
+ * <Heading level={2}>Payment</Heading>
55
+ * <Stack direction="horizontal" gap="sm" justify="end">
56
+ * <Button evaluation="muted">Cancel</Button>
57
+ * <Button evaluation="primary">Save</Button>
58
+ * </Stack>
59
+ * </Stack>
60
+ * ```
61
+ */
62
+ declare const Stack: {
63
+ ({
64
+ direction,
65
+ gap,
66
+ align,
67
+ justify,
68
+ wrap,
69
+ children,
70
+ ...props
71
+ }: StackProps): import("react/jsx-runtime").JSX.Element;
72
+ displayName: "Stack";
73
+ };
74
+ //#endregion
75
+ export { Stack, StackAlign, StackDirection, StackGap, StackJustify, StackProps, stackMeta };
@@ -0,0 +1,88 @@
1
+ /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
+ import { vars } from "@ttoss/fsl-theme/vars";
3
+ import { jsx } from "react/jsx-runtime";
4
+
5
+ //#region src/components/Stack/Stack.tsx
6
+ /** Formal semantic identity — Stack root (Structure entity, layout rhythm). */
7
+ var stackMeta = {
8
+ displayName: "Stack",
9
+ entity: "Structure",
10
+ structure: "root"
11
+ };
12
+ var GAP_STACK = {
13
+ xs: vars.spacing.gap.stack.xs,
14
+ sm: vars.spacing.gap.stack.sm,
15
+ md: vars.spacing.gap.stack.md,
16
+ lg: vars.spacing.gap.stack.lg,
17
+ xl: vars.spacing.gap.stack.xl
18
+ };
19
+ var GAP_INLINE = {
20
+ xs: vars.spacing.gap.inline.xs,
21
+ sm: vars.spacing.gap.inline.sm,
22
+ md: vars.spacing.gap.inline.md,
23
+ lg: vars.spacing.gap.inline.lg,
24
+ xl: vars.spacing.gap.inline.xl
25
+ };
26
+ var ALIGN = {
27
+ start: "flex-start",
28
+ center: "center",
29
+ end: "flex-end",
30
+ stretch: "stretch"
31
+ };
32
+ var JUSTIFY = {
33
+ start: "flex-start",
34
+ center: "center",
35
+ end: "flex-end",
36
+ between: "space-between"
37
+ };
38
+ /**
39
+ * The layout rhythm primitive — a flex container spaced from the FSL gap scale.
40
+ *
41
+ * Entity = Structure. Use it to stack sections (`direction="vertical"`) or lay
42
+ * out a row of controls (`direction="horizontal"`) with consistent, themeable
43
+ * spacing. `gap`, `align`, and `justify` draw only from named scales/keywords —
44
+ * there is no raw `gap: 12px`, which is how spacing rhythm stays consistent
45
+ * across a product.
46
+ *
47
+ * @example
48
+ * ```tsx
49
+ * <Stack gap="lg">
50
+ * <Heading level={2}>Payment</Heading>
51
+ * <Stack direction="horizontal" gap="sm" justify="end">
52
+ * <Button evaluation="muted">Cancel</Button>
53
+ * <Button evaluation="primary">Save</Button>
54
+ * </Stack>
55
+ * </Stack>
56
+ * ```
57
+ */
58
+ var Stack = ({
59
+ direction = "vertical",
60
+ gap = "md",
61
+ align = "stretch",
62
+ justify = "start",
63
+ wrap = false,
64
+ children,
65
+ ...props
66
+ }) => {
67
+ const isHorizontal = direction === "horizontal";
68
+ return /* @__PURE__ */jsx("div", {
69
+ ...props,
70
+ "data-scope": "stack",
71
+ "data-part": "root",
72
+ "data-direction": direction,
73
+ "data-gap": gap,
74
+ style: {
75
+ display: "flex",
76
+ flexDirection: isHorizontal ? "row" : "column",
77
+ gap: isHorizontal ? GAP_INLINE[gap] : GAP_STACK[gap],
78
+ alignItems: ALIGN[align],
79
+ justifyContent: JUSTIFY[justify],
80
+ flexWrap: wrap ? "wrap" : "nowrap"
81
+ },
82
+ children
83
+ });
84
+ };
85
+ Stack.displayName = stackMeta.displayName;
86
+
87
+ //#endregion
88
+ export { Stack, stackMeta };
@@ -0,0 +1,84 @@
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_jsx_runtime = require("react/jsx-runtime");
4
+
5
+ //#region src/components/Surface/Surface.tsx
6
+ /** Formal semantic identity — Surface root (Structure entity, depth container). */
7
+ var surfaceMeta = {
8
+ displayName: "Surface",
9
+ entity: "Structure",
10
+ structure: "root"
11
+ };
12
+ /** Inset padding per scale step; `none` collapses to zero. */
13
+ var PADDING_BY_KEY = {
14
+ none: "0",
15
+ sm: _ttoss_fsl_theme_vars.vars.spacing.inset.surface.sm,
16
+ md: _ttoss_fsl_theme_vars.vars.spacing.inset.surface.md,
17
+ lg: _ttoss_fsl_theme_vars.vars.spacing.inset.surface.lg
18
+ };
19
+ /** Text colour for content sitting on the surface. */
20
+ var SURFACE_TEXT = _ttoss_fsl_theme_vars.vars.colors.informational.primary.text?.default;
21
+ /**
22
+ * The surface's background colour. Raised strata read the tonal surface colour
23
+ * (the "colour at depth"); `flat` — or a theme that ships no tonal group — is
24
+ * canvas, so it falls back to the primary informational background.
25
+ */
26
+ var backgroundFor = level => {
27
+ const tonal = _ttoss_fsl_theme_vars.vars.elevation.tonal;
28
+ if (level === "flat" || tonal === void 0) return _ttoss_fsl_theme_vars.vars.colors.informational.primary.background?.default;
29
+ return tonal[level];
30
+ };
31
+ /** The hairline boundary colour for the given evaluation. */
32
+ var borderColorFor = evaluation => {
33
+ return _ttoss_fsl_theme_vars.vars.colors.informational[evaluation]?.border?.default ?? "transparent";
34
+ };
35
+ /**
36
+ * A depth-bearing container — the surface primitive of the FSL grammar.
37
+ *
38
+ * Entity = Structure. Use it wherever a region needs to read as a distinct
39
+ * surface: cards, panels, sheets, the body of a dialog. Pick the `level` by
40
+ * how the surface should sit relative to the page, not by how it should look —
41
+ * the theme decides the shadow and tonal treatment per mode. Non-interactive:
42
+ * it owns no hover/focus chrome; interactivity belongs to the controls placed
43
+ * inside it.
44
+ *
45
+ * @example
46
+ * ```tsx
47
+ * <Surface level="raised" padding="lg">
48
+ * <Heading level={3}>Storage</Heading>
49
+ * <Meter aria-label="Used" label="Used" value={72} />
50
+ * </Surface>
51
+ * ```
52
+ */
53
+ var Surface = ({
54
+ level = "raised",
55
+ padding = "md",
56
+ evaluation = "muted",
57
+ children,
58
+ ...props
59
+ }) => {
60
+ return /* @__PURE__ */(0, react_jsx_runtime.jsx)("div", {
61
+ ...props,
62
+ "data-scope": "surface",
63
+ "data-part": "root",
64
+ "data-level": level,
65
+ "data-evaluation": evaluation,
66
+ style: {
67
+ boxSizing: "border-box",
68
+ padding: PADDING_BY_KEY[padding],
69
+ color: SURFACE_TEXT,
70
+ background: backgroundFor(level),
71
+ boxShadow: _ttoss_fsl_theme_vars.vars.elevation.surface[level],
72
+ borderRadius: _ttoss_fsl_theme_vars.vars.radii.surface,
73
+ borderWidth: _ttoss_fsl_theme_vars.vars.border.outline.surface.width,
74
+ borderStyle: _ttoss_fsl_theme_vars.vars.border.outline.surface.style,
75
+ borderColor: borderColorFor(evaluation)
76
+ },
77
+ children
78
+ });
79
+ };
80
+ Surface.displayName = surfaceMeta.displayName;
81
+
82
+ //#endregion
83
+ exports.Surface = Surface;
84
+ exports.surfaceMeta = surfaceMeta;
@@ -0,0 +1,72 @@
1
+
2
+ import { EvaluationsFor } from "../../semantics/taxonomy.cjs";
3
+ import * as React from "react";
4
+
5
+ //#region src/components/Surface/Surface.d.ts
6
+ /** Formal semantic identity — Surface root (Structure entity, depth container). */
7
+ declare const surfaceMeta: {
8
+ readonly displayName: "Surface";
9
+ readonly entity: "Structure";
10
+ readonly structure: "root";
11
+ };
12
+ /** The elevation strata a Surface can express (elevation.md surface contract). */
13
+ type SurfaceLevel = 'flat' | 'raised' | 'overlay' | 'blocking';
14
+ /** Inner padding drawn from the surface inset scale. */
15
+ type SurfacePadding = 'none' | 'sm' | 'md' | 'lg';
16
+ /** Props for the Surface component. */
17
+ interface SurfaceProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'style' | 'className'> {
18
+ /**
19
+ * Elevation stratum. `flat` sits flush with the page (no shadow); `raised`
20
+ * is the default card/panel depth; `overlay` floats above raised content;
21
+ * `blocking` is the strongest in-flow depth (dialog bodies). Depth is
22
+ * carried by the paired shadow recipe *and* the tonal surface colour, so it
23
+ * reads correctly in both light and dark (dark depth is the tonal step —
24
+ * shadows go invisible on a near-black canvas).
25
+ * @default 'raised'
26
+ */
27
+ level?: SurfaceLevel;
28
+ /**
29
+ * Inner padding from the surface inset scale. `none` removes padding for
30
+ * surfaces that host their own edge-to-edge content (lists, media).
31
+ * @default 'md'
32
+ */
33
+ padding?: SurfacePadding;
34
+ /**
35
+ * Emphasis of the hairline boundary. `muted` is the quiet default that lets
36
+ * elevation carry the separation; `primary` draws a firmer edge.
37
+ * @default 'muted'
38
+ */
39
+ evaluation?: EvaluationsFor<(typeof surfaceMeta)['entity']>;
40
+ /** The surface's content. */
41
+ children?: React.ReactNode;
42
+ }
43
+ /**
44
+ * A depth-bearing container — the surface primitive of the FSL grammar.
45
+ *
46
+ * Entity = Structure. Use it wherever a region needs to read as a distinct
47
+ * surface: cards, panels, sheets, the body of a dialog. Pick the `level` by
48
+ * how the surface should sit relative to the page, not by how it should look —
49
+ * the theme decides the shadow and tonal treatment per mode. Non-interactive:
50
+ * it owns no hover/focus chrome; interactivity belongs to the controls placed
51
+ * inside it.
52
+ *
53
+ * @example
54
+ * ```tsx
55
+ * <Surface level="raised" padding="lg">
56
+ * <Heading level={3}>Storage</Heading>
57
+ * <Meter aria-label="Used" label="Used" value={72} />
58
+ * </Surface>
59
+ * ```
60
+ */
61
+ declare const Surface: {
62
+ ({
63
+ level,
64
+ padding,
65
+ evaluation,
66
+ children,
67
+ ...props
68
+ }: SurfaceProps): import("react/jsx-runtime").JSX.Element;
69
+ displayName: "Surface";
70
+ };
71
+ //#endregion
72
+ export { Surface, SurfaceLevel, SurfacePadding, SurfaceProps, surfaceMeta };