@ttoss/fsl-ui 0.2.4 → 0.2.6

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 (134) hide show
  1. package/README.md +1 -1
  2. package/dist/components/AppShell/AppShell.cjs +124 -0
  3. package/dist/components/AppShell/AppShell.d.cts +74 -0
  4. package/dist/components/AppShell/AppShell.d.mts +74 -0
  5. package/dist/components/AppShell/AppShell.mjs +123 -0
  6. package/dist/components/Badge/Badge.cjs +61 -0
  7. package/dist/components/Badge/Badge.d.cts +56 -0
  8. package/dist/components/Badge/Badge.d.mts +56 -0
  9. package/dist/components/Badge/Badge.mjs +60 -0
  10. package/dist/components/Box/Box.cjs +114 -0
  11. package/dist/components/Box/Box.d.cts +115 -0
  12. package/dist/components/Box/Box.d.mts +115 -0
  13. package/dist/components/Box/Box.mjs +113 -0
  14. package/dist/components/Breadcrumbs/Breadcrumbs.cjs +1 -1
  15. package/dist/components/Breadcrumbs/Breadcrumbs.mjs +1 -1
  16. package/dist/components/Button/Button.cjs +2 -2
  17. package/dist/components/Button/Button.d.cts +2 -1
  18. package/dist/components/Button/Button.d.mts +2 -1
  19. package/dist/components/Button/Button.mjs +2 -2
  20. package/dist/components/Checkbox/Checkbox.cjs +2 -2
  21. package/dist/components/Checkbox/Checkbox.mjs +2 -2
  22. package/dist/components/CheckboxGroup/CheckboxGroup.cjs +1 -1
  23. package/dist/components/CheckboxGroup/CheckboxGroup.mjs +1 -1
  24. package/dist/components/Code/Code.cjs +69 -0
  25. package/dist/components/Code/Code.d.cts +53 -0
  26. package/dist/components/Code/Code.d.mts +53 -0
  27. package/dist/components/Code/Code.mjs +68 -0
  28. package/dist/components/Container/Container.cjs +65 -0
  29. package/dist/components/Container/Container.d.cts +61 -0
  30. package/dist/components/Container/Container.d.mts +61 -0
  31. package/dist/components/Container/Container.mjs +64 -0
  32. package/dist/components/FileTrigger/FileTrigger.cjs +1 -1
  33. package/dist/components/FileTrigger/FileTrigger.mjs +1 -1
  34. package/dist/components/Grid/Grid.cjs +88 -0
  35. package/dist/components/Grid/Grid.d.cts +87 -0
  36. package/dist/components/Grid/Grid.d.mts +87 -0
  37. package/dist/components/Grid/Grid.mjs +87 -0
  38. package/dist/components/GridList/GridList.cjs +2 -2
  39. package/dist/components/GridList/GridList.mjs +2 -2
  40. package/dist/components/Group/Group.cjs +1 -1
  41. package/dist/components/Group/Group.mjs +1 -1
  42. package/dist/components/Heading/Heading.cjs +78 -0
  43. package/dist/components/Heading/Heading.d.cts +63 -0
  44. package/dist/components/Heading/Heading.d.mts +63 -0
  45. package/dist/components/Heading/Heading.mjs +77 -0
  46. package/dist/components/Icon/Icon.cjs +2 -1
  47. package/dist/components/Icon/Icon.d.cts +59 -0
  48. package/dist/components/Icon/Icon.d.mts +59 -0
  49. package/dist/components/Icon/Icon.mjs +1 -1
  50. package/dist/components/Icon/glyphs.cjs +37 -10
  51. package/dist/components/Icon/glyphs.mjs +34 -10
  52. package/dist/components/Icon/intents.cjs +32 -0
  53. package/dist/components/Icon/intents.d.cts +33 -0
  54. package/dist/components/Icon/intents.d.mts +33 -0
  55. package/dist/components/Icon/intents.mjs +32 -0
  56. package/dist/components/Link/Link.cjs +1 -1
  57. package/dist/components/Link/Link.mjs +1 -1
  58. package/dist/components/ListBox/ListBox.cjs +1 -1
  59. package/dist/components/ListBox/ListBox.mjs +1 -1
  60. package/dist/components/Meter/Meter.cjs +11 -1
  61. package/dist/components/Meter/Meter.mjs +11 -1
  62. package/dist/components/NumberField/NumberField.cjs +2 -2
  63. package/dist/components/NumberField/NumberField.mjs +2 -2
  64. package/dist/components/ProgressBar/ProgressBar.cjs +1 -1
  65. package/dist/components/ProgressBar/ProgressBar.mjs +1 -1
  66. package/dist/components/RadioGroup/RadioGroup.cjs +2 -2
  67. package/dist/components/RadioGroup/RadioGroup.mjs +2 -2
  68. package/dist/components/Select/Select.cjs +2 -2
  69. package/dist/components/Select/Select.mjs +2 -2
  70. package/dist/components/Separator/Separator.cjs +1 -1
  71. package/dist/components/Separator/Separator.mjs +1 -1
  72. package/dist/components/Slider/Slider.cjs +1 -1
  73. package/dist/components/Slider/Slider.mjs +1 -1
  74. package/dist/components/Stack/Stack.cjs +89 -0
  75. package/dist/components/Stack/Stack.d.cts +75 -0
  76. package/dist/components/Stack/Stack.d.mts +75 -0
  77. package/dist/components/Stack/Stack.mjs +88 -0
  78. package/dist/components/Surface/Surface.cjs +84 -0
  79. package/dist/components/Surface/Surface.d.cts +72 -0
  80. package/dist/components/Surface/Surface.d.mts +72 -0
  81. package/dist/components/Surface/Surface.mjs +83 -0
  82. package/dist/components/Switch/Switch.cjs +3 -3
  83. package/dist/components/Switch/Switch.d.cts +1 -1
  84. package/dist/components/Switch/Switch.d.mts +1 -1
  85. package/dist/components/Switch/Switch.mjs +3 -3
  86. package/dist/components/Table/Table.cjs +248 -0
  87. package/dist/components/Table/Table.d.cts +128 -0
  88. package/dist/components/Table/Table.d.mts +128 -0
  89. package/dist/components/Table/Table.mjs +239 -0
  90. package/dist/components/Tabs/Tabs.cjs +71 -28
  91. package/dist/components/Tabs/Tabs.d.cts +0 -17
  92. package/dist/components/Tabs/Tabs.d.mts +0 -17
  93. package/dist/components/Tabs/Tabs.mjs +69 -28
  94. package/dist/components/Text/Text.cjs +70 -0
  95. package/dist/components/Text/Text.d.cts +89 -0
  96. package/dist/components/Text/Text.d.mts +89 -0
  97. package/dist/components/Text/Text.mjs +69 -0
  98. package/dist/components/Toast/Toast.cjs +1 -1
  99. package/dist/components/Toast/Toast.mjs +1 -1
  100. package/dist/components/ToggleButton/ToggleButton.cjs +2 -2
  101. package/dist/components/ToggleButton/ToggleButton.mjs +2 -2
  102. package/dist/components/ToggleButtonGroup/ToggleButtonGroup.cjs +1 -1
  103. package/dist/components/ToggleButtonGroup/ToggleButtonGroup.mjs +1 -1
  104. package/dist/components/Toolbar/Toolbar.cjs +1 -1
  105. package/dist/components/Toolbar/Toolbar.mjs +1 -1
  106. package/dist/composites/Accordion/Accordion.cjs +14 -9
  107. package/dist/composites/Accordion/Accordion.mjs +14 -9
  108. package/dist/composites/Dialog/Dialog.cjs +1 -1
  109. package/dist/composites/Dialog/Dialog.mjs +1 -1
  110. package/dist/composites/Disclosure/Disclosure.cjs +14 -9
  111. package/dist/composites/Disclosure/Disclosure.mjs +14 -9
  112. package/dist/composites/Form/Form.cjs +1 -1
  113. package/dist/composites/Form/Form.mjs +1 -1
  114. package/dist/composites/Menu/Menu.cjs +2 -2
  115. package/dist/composites/Menu/Menu.mjs +2 -2
  116. package/dist/composites/Popover/Popover.cjs +1 -1
  117. package/dist/composites/Popover/Popover.mjs +1 -1
  118. package/dist/composites/SearchField/SearchField.cjs +2 -2
  119. package/dist/composites/SearchField/SearchField.mjs +2 -2
  120. package/dist/composites/TagGroup/TagGroup.cjs +2 -2
  121. package/dist/composites/TagGroup/TagGroup.mjs +2 -2
  122. package/dist/composites/TextArea/TextArea.cjs +2 -2
  123. package/dist/composites/TextArea/TextArea.mjs +2 -2
  124. package/dist/composites/TextField/TextField.cjs +2 -2
  125. package/dist/composites/TextField/TextField.mjs +2 -2
  126. package/dist/composites/Tooltip/Tooltip.cjs +1 -1
  127. package/dist/composites/Tooltip/Tooltip.mjs +1 -1
  128. package/dist/index.cjs +46 -0
  129. package/dist/index.d.cts +14 -1
  130. package/dist/index.d.mts +14 -1
  131. package/dist/index.mjs +14 -1
  132. package/llms.txt +51 -8
  133. package/package.json +4 -4
  134. package/src/tokens/CONTRACT.md +28 -10
@@ -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 };
@@ -0,0 +1,72 @@
1
+
2
+ import { EvaluationsFor } from "../../semantics/taxonomy.mjs";
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 };
@@ -0,0 +1,83 @@
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/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: vars.spacing.inset.surface.sm,
16
+ md: vars.spacing.inset.surface.md,
17
+ lg: vars.spacing.inset.surface.lg
18
+ };
19
+ /** Text colour for content sitting on the surface. */
20
+ var SURFACE_TEXT = 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 = vars.elevation.tonal;
28
+ if (level === "flat" || tonal === void 0) return 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 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__ */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: vars.elevation.surface[level],
72
+ borderRadius: vars.radii.surface,
73
+ borderWidth: vars.border.outline.surface.width,
74
+ borderStyle: vars.border.outline.surface.style,
75
+ borderColor: borderColorFor(evaluation)
76
+ },
77
+ children
78
+ });
79
+ };
80
+ Surface.displayName = surfaceMeta.displayName;
81
+
82
+ //#endregion
83
+ export { Surface, surfaceMeta };
@@ -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/Switch/Switch.tsx
9
9
  /** Formal semantic identity — Switch root (Selection entity, toggle.binary). */
@@ -81,7 +81,7 @@ var resolveLabelColor = ({
81
81
  *
82
82
  * Entity = Selection → reads `vars.colors.input.primary.*`, radii: `round`
83
83
  * (pill track + circular thumb), border: `outline.control`,
84
- * sizing: `hit.base`, motion: `feedback`.
84
+ * sizing: `hit`, motion: `feedback`.
85
85
  *
86
86
  * @example
87
87
  * ```tsx
@@ -106,7 +106,7 @@ var Switch = ({
106
106
  display: "inline-flex",
107
107
  alignItems: "center",
108
108
  gap: _ttoss_fsl_theme_vars.vars.spacing.gap.inline.sm,
109
- minHeight: _ttoss_fsl_theme_vars.vars.sizing.hit.base,
109
+ minHeight: _ttoss_fsl_theme_vars.vars.sizing.hit,
110
110
  cursor: isDisabled ? "not-allowed" : "pointer",
111
111
  opacity: isDisabled ? _ttoss_fsl_theme_vars.vars.opacity.disabled : void 0,
112
112
  ..._ttoss_fsl_theme_vars.vars.text.label.md,
@@ -24,7 +24,7 @@ interface SwitchProps$1 extends Omit<SwitchProps, 'style' | 'children'> {
24
24
  *
25
25
  * Entity = Selection → reads `vars.colors.input.primary.*`, radii: `round`
26
26
  * (pill track + circular thumb), border: `outline.control`,
27
- * sizing: `hit.base`, motion: `feedback`.
27
+ * sizing: `hit`, motion: `feedback`.
28
28
  *
29
29
  * @example
30
30
  * ```tsx