@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
@@ -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
@@ -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
@@ -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 { Switch } from "react-aria-components";
6
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ import { Switch } from "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$1 = ({
106
106
  display: "inline-flex",
107
107
  alignItems: "center",
108
108
  gap: vars.spacing.gap.inline.sm,
109
- minHeight: vars.sizing.hit.base,
109
+ minHeight: vars.sizing.hit,
110
110
  cursor: isDisabled ? "not-allowed" : "pointer",
111
111
  opacity: isDisabled ? vars.opacity.disabled : void 0,
112
112
  ...vars.text.label.md,
@@ -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/Tabs/Tabs.tsx
9
9
  /** Formal semantic identity — Tabs root (Navigation entity). */
@@ -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 { Tab, TabList, TabPanel, Tabs } from "react-aria-components";
6
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ import { Tab, TabList, TabPanel, Tabs } from "react-aria-components";
7
7
 
8
8
  //#region src/components/Tabs/Tabs.tsx
9
9
  /** Formal semantic identity — Tabs root (Navigation entity). */
@@ -0,0 +1,69 @@
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/Text/Text.tsx
6
+ /** Formal semantic identity — Text root (Structure entity, body/label text). */
7
+ var textMeta = {
8
+ displayName: "Text",
9
+ entity: "Structure",
10
+ structure: "root"
11
+ };
12
+ /** Typography token per variant — the scale reaches the DOM only here. */
13
+ var TYPE_BY_VARIANT = {
14
+ "body-lg": _ttoss_fsl_theme_vars.vars.text.body.lg,
15
+ "body-md": _ttoss_fsl_theme_vars.vars.text.body.md,
16
+ "body-sm": _ttoss_fsl_theme_vars.vars.text.body.sm,
17
+ "label-lg": _ttoss_fsl_theme_vars.vars.text.label.lg,
18
+ "label-md": _ttoss_fsl_theme_vars.vars.text.label.md,
19
+ "label-sm": _ttoss_fsl_theme_vars.vars.text.label.sm
20
+ };
21
+ /** Muted text colour; `default` tone inherits (no colour set). */
22
+ var colorForTone = tone => {
23
+ return tone === "muted" ? _ttoss_fsl_theme_vars.vars.colors.informational.muted.text?.default : "inherit";
24
+ };
25
+ /**
26
+ * Running copy and labels bound to the FSL type scale.
27
+ *
28
+ * Entity = Structure. `variant` picks the step of the body/label scale — there
29
+ * is no raw font-size vocabulary, which is how the theme's typography reaches
30
+ * the screen consistently. `tone="muted"` is the sanctioned way to build text
31
+ * hierarchy (secondary copy recedes); otherwise colour is inherited from the
32
+ * surface.
33
+ *
34
+ * @example
35
+ * ```tsx
36
+ * <Text>Your changes are saved automatically.</Text>
37
+ * <Text variant="label-md" tone="muted">Last updated 2 minutes ago</Text>
38
+ * ```
39
+ */
40
+ var Text = ({
41
+ variant = "body-md",
42
+ tone = "default",
43
+ align = "start",
44
+ numeric = "normal",
45
+ as = "p",
46
+ children,
47
+ ...props
48
+ }) => {
49
+ return /* @__PURE__ */(0, react_jsx_runtime.jsx)(as, {
50
+ ...props,
51
+ "data-scope": "text",
52
+ "data-part": "root",
53
+ "data-variant": variant,
54
+ "data-tone": tone,
55
+ style: {
56
+ margin: 0,
57
+ color: colorForTone(tone),
58
+ textAlign: align,
59
+ fontVariantNumeric: numeric === "tabular" ? "tabular-nums" : void 0,
60
+ ...TYPE_BY_VARIANT[variant]
61
+ },
62
+ children
63
+ });
64
+ };
65
+ Text.displayName = textMeta.displayName;
66
+
67
+ //#endregion
68
+ exports.Text = Text;
69
+ exports.textMeta = textMeta;
@@ -0,0 +1,84 @@
1
+
2
+ import * as React from "react";
3
+
4
+ //#region src/components/Text/Text.d.ts
5
+ /** Formal semantic identity — Text root (Structure entity, body/label text). */
6
+ declare const textMeta: {
7
+ readonly displayName: "Text";
8
+ readonly entity: "Structure";
9
+ readonly structure: "root";
10
+ };
11
+ /** A step of the body/label type scale (`{family}-{step}`). */
12
+ type TextVariant = 'body-lg' | 'body-md' | 'body-sm' | 'label-lg' | 'label-md' | 'label-sm';
13
+ /** The tone of the text colour — default inherits; `muted` recedes. */
14
+ type TextTone = 'default' | 'muted';
15
+ /** Inline text alignment. */
16
+ type TextAlign = 'start' | 'center' | 'end';
17
+ /** Numeric figure style — `tabular` aligns digits in columns (metrics, tables). */
18
+ type TextNumeric = 'normal' | 'tabular';
19
+ /** The element Text renders as. */
20
+ type TextAs = 'p' | 'span' | 'div';
21
+ /** Props for the Text component. */
22
+ interface TextProps extends Omit<React.HTMLAttributes<HTMLElement>, 'style' | 'className'> {
23
+ /**
24
+ * Step of the body/label type scale. `body-*` is running copy; `label-*` is
25
+ * the tighter, slightly heavier form for field labels and captions.
26
+ * @default 'body-md'
27
+ */
28
+ variant?: TextVariant;
29
+ /**
30
+ * Colour tone. `default` inherits the surrounding surface's text colour;
31
+ * `muted` recedes to the muted informational text colour for secondary copy.
32
+ * @default 'default'
33
+ */
34
+ tone?: TextTone;
35
+ /**
36
+ * Inline alignment (`text-align`). A layout keyword, not a design token.
37
+ * @default 'start'
38
+ */
39
+ align?: TextAlign;
40
+ /**
41
+ * Numeric figure style. `tabular` renders `tabular-nums` so digits occupy
42
+ * equal width — use it for metrics, counts, and any figures that must line up
43
+ * in a column. A rendering *meaning*, not a raw style.
44
+ * @default 'normal'
45
+ */
46
+ numeric?: TextNumeric;
47
+ /**
48
+ * The element to render. `p` for paragraphs, `span` for inline runs, `div`
49
+ * for grouping.
50
+ * @default 'p'
51
+ */
52
+ as?: TextAs;
53
+ /** The text content. */
54
+ children?: React.ReactNode;
55
+ }
56
+ /**
57
+ * Running copy and labels bound to the FSL type scale.
58
+ *
59
+ * Entity = Structure. `variant` picks the step of the body/label scale — there
60
+ * is no raw font-size vocabulary, which is how the theme's typography reaches
61
+ * the screen consistently. `tone="muted"` is the sanctioned way to build text
62
+ * hierarchy (secondary copy recedes); otherwise colour is inherited from the
63
+ * surface.
64
+ *
65
+ * @example
66
+ * ```tsx
67
+ * <Text>Your changes are saved automatically.</Text>
68
+ * <Text variant="label-md" tone="muted">Last updated 2 minutes ago</Text>
69
+ * ```
70
+ */
71
+ declare const Text: {
72
+ ({
73
+ variant,
74
+ tone,
75
+ align,
76
+ numeric,
77
+ as,
78
+ children,
79
+ ...props
80
+ }: TextProps): import("react/jsx-runtime").JSX.Element;
81
+ displayName: "Text";
82
+ };
83
+ //#endregion
84
+ export { Text, TextAlign, TextAs, TextNumeric, TextProps, TextTone, TextVariant, textMeta };
@@ -0,0 +1,84 @@
1
+
2
+ import * as React from "react";
3
+
4
+ //#region src/components/Text/Text.d.ts
5
+ /** Formal semantic identity — Text root (Structure entity, body/label text). */
6
+ declare const textMeta: {
7
+ readonly displayName: "Text";
8
+ readonly entity: "Structure";
9
+ readonly structure: "root";
10
+ };
11
+ /** A step of the body/label type scale (`{family}-{step}`). */
12
+ type TextVariant = 'body-lg' | 'body-md' | 'body-sm' | 'label-lg' | 'label-md' | 'label-sm';
13
+ /** The tone of the text colour — default inherits; `muted` recedes. */
14
+ type TextTone = 'default' | 'muted';
15
+ /** Inline text alignment. */
16
+ type TextAlign = 'start' | 'center' | 'end';
17
+ /** Numeric figure style — `tabular` aligns digits in columns (metrics, tables). */
18
+ type TextNumeric = 'normal' | 'tabular';
19
+ /** The element Text renders as. */
20
+ type TextAs = 'p' | 'span' | 'div';
21
+ /** Props for the Text component. */
22
+ interface TextProps extends Omit<React.HTMLAttributes<HTMLElement>, 'style' | 'className'> {
23
+ /**
24
+ * Step of the body/label type scale. `body-*` is running copy; `label-*` is
25
+ * the tighter, slightly heavier form for field labels and captions.
26
+ * @default 'body-md'
27
+ */
28
+ variant?: TextVariant;
29
+ /**
30
+ * Colour tone. `default` inherits the surrounding surface's text colour;
31
+ * `muted` recedes to the muted informational text colour for secondary copy.
32
+ * @default 'default'
33
+ */
34
+ tone?: TextTone;
35
+ /**
36
+ * Inline alignment (`text-align`). A layout keyword, not a design token.
37
+ * @default 'start'
38
+ */
39
+ align?: TextAlign;
40
+ /**
41
+ * Numeric figure style. `tabular` renders `tabular-nums` so digits occupy
42
+ * equal width — use it for metrics, counts, and any figures that must line up
43
+ * in a column. A rendering *meaning*, not a raw style.
44
+ * @default 'normal'
45
+ */
46
+ numeric?: TextNumeric;
47
+ /**
48
+ * The element to render. `p` for paragraphs, `span` for inline runs, `div`
49
+ * for grouping.
50
+ * @default 'p'
51
+ */
52
+ as?: TextAs;
53
+ /** The text content. */
54
+ children?: React.ReactNode;
55
+ }
56
+ /**
57
+ * Running copy and labels bound to the FSL type scale.
58
+ *
59
+ * Entity = Structure. `variant` picks the step of the body/label scale — there
60
+ * is no raw font-size vocabulary, which is how the theme's typography reaches
61
+ * the screen consistently. `tone="muted"` is the sanctioned way to build text
62
+ * hierarchy (secondary copy recedes); otherwise colour is inherited from the
63
+ * surface.
64
+ *
65
+ * @example
66
+ * ```tsx
67
+ * <Text>Your changes are saved automatically.</Text>
68
+ * <Text variant="label-md" tone="muted">Last updated 2 minutes ago</Text>
69
+ * ```
70
+ */
71
+ declare const Text: {
72
+ ({
73
+ variant,
74
+ tone,
75
+ align,
76
+ numeric,
77
+ as,
78
+ children,
79
+ ...props
80
+ }: TextProps): import("react/jsx-runtime").JSX.Element;
81
+ displayName: "Text";
82
+ };
83
+ //#endregion
84
+ export { Text, TextAlign, TextAs, TextNumeric, TextProps, TextTone, TextVariant, textMeta };
@@ -0,0 +1,68 @@
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/Text/Text.tsx
6
+ /** Formal semantic identity — Text root (Structure entity, body/label text). */
7
+ var textMeta = {
8
+ displayName: "Text",
9
+ entity: "Structure",
10
+ structure: "root"
11
+ };
12
+ /** Typography token per variant — the scale reaches the DOM only here. */
13
+ var TYPE_BY_VARIANT = {
14
+ "body-lg": vars.text.body.lg,
15
+ "body-md": vars.text.body.md,
16
+ "body-sm": vars.text.body.sm,
17
+ "label-lg": vars.text.label.lg,
18
+ "label-md": vars.text.label.md,
19
+ "label-sm": vars.text.label.sm
20
+ };
21
+ /** Muted text colour; `default` tone inherits (no colour set). */
22
+ var colorForTone = tone => {
23
+ return tone === "muted" ? vars.colors.informational.muted.text?.default : "inherit";
24
+ };
25
+ /**
26
+ * Running copy and labels bound to the FSL type scale.
27
+ *
28
+ * Entity = Structure. `variant` picks the step of the body/label scale — there
29
+ * is no raw font-size vocabulary, which is how the theme's typography reaches
30
+ * the screen consistently. `tone="muted"` is the sanctioned way to build text
31
+ * hierarchy (secondary copy recedes); otherwise colour is inherited from the
32
+ * surface.
33
+ *
34
+ * @example
35
+ * ```tsx
36
+ * <Text>Your changes are saved automatically.</Text>
37
+ * <Text variant="label-md" tone="muted">Last updated 2 minutes ago</Text>
38
+ * ```
39
+ */
40
+ var Text = ({
41
+ variant = "body-md",
42
+ tone = "default",
43
+ align = "start",
44
+ numeric = "normal",
45
+ as = "p",
46
+ children,
47
+ ...props
48
+ }) => {
49
+ return /* @__PURE__ */jsx(as, {
50
+ ...props,
51
+ "data-scope": "text",
52
+ "data-part": "root",
53
+ "data-variant": variant,
54
+ "data-tone": tone,
55
+ style: {
56
+ margin: 0,
57
+ color: colorForTone(tone),
58
+ textAlign: align,
59
+ fontVariantNumeric: numeric === "tabular" ? "tabular-nums" : void 0,
60
+ ...TYPE_BY_VARIANT[variant]
61
+ },
62
+ children
63
+ });
64
+ };
65
+ Text.displayName = textMeta.displayName;
66
+
67
+ //#endregion
68
+ export { Text, textMeta };
@@ -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/Toast/Toast.tsx
10
10
  /** Formal semantic identity — Toast root (Feedback entity). */
@@ -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, Text, UNSTABLE_Toast, UNSTABLE_ToastContent, UNSTABLE_ToastQueue, UNSTABLE_ToastRegion } from "react-aria-components";
7
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { Button, Text, UNSTABLE_Toast, UNSTABLE_ToastContent, UNSTABLE_ToastQueue, UNSTABLE_ToastRegion } from "react-aria-components";
8
8
 
9
9
  //#region src/components/Toast/Toast.tsx
10
10
  /** Formal semantic identity — Toast root (Feedback entity). */
@@ -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/ToggleButton/ToggleButton.tsx
8
8
  /** Formal semantic identity — ToggleButton root (Action entity, toggle). */
@@ -99,7 +99,7 @@ var ToggleButton = ({
99
99
  borderRadius: _ttoss_fsl_theme_vars.vars.radii.control,
100
100
  borderWidth: _ttoss_fsl_theme_vars.vars.border.outline.control.width,
101
101
  borderStyle: _ttoss_fsl_theme_vars.vars.border.outline.control.style,
102
- minHeight: _ttoss_fsl_theme_vars.vars.sizing.hit.base,
102
+ minHeight: _ttoss_fsl_theme_vars.vars.sizing.hit,
103
103
  paddingBlock: _ttoss_fsl_theme_vars.vars.spacing.inset.control.sm,
104
104
  paddingInline: _ttoss_fsl_theme_vars.vars.spacing.inset.control.lg,
105
105
  ..._ttoss_fsl_theme_vars.vars.text.label.md,
@@ -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 { ToggleButton } from "react-aria-components";
5
4
  import { jsx } from "react/jsx-runtime";
5
+ import { ToggleButton } from "react-aria-components";
6
6
 
7
7
  //#region src/components/ToggleButton/ToggleButton.tsx
8
8
  /** Formal semantic identity — ToggleButton root (Action entity, toggle). */
@@ -99,7 +99,7 @@ var ToggleButton$1 = ({
99
99
  borderRadius: vars.radii.control,
100
100
  borderWidth: vars.border.outline.control.width,
101
101
  borderStyle: vars.border.outline.control.style,
102
- minHeight: vars.sizing.hit.base,
102
+ minHeight: vars.sizing.hit,
103
103
  paddingBlock: vars.spacing.inset.control.sm,
104
104
  paddingInline: vars.spacing.inset.control.lg,
105
105
  ...vars.text.label.md,
@@ -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/ToggleButtonGroup/ToggleButtonGroup.tsx
7
7
  /** Formal semantic identity — ToggleButtonGroup root (Selection entity). */
@@ -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 { ToggleButtonGroup } from "react-aria-components";
4
3
  import { jsx } from "react/jsx-runtime";
4
+ import { ToggleButtonGroup } from "react-aria-components";
5
5
 
6
6
  //#region src/components/ToggleButtonGroup/ToggleButtonGroup.tsx
7
7
  /** Formal semantic identity — ToggleButtonGroup root (Selection entity). */
@@ -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/Toolbar/Toolbar.tsx
7
7
  /** Formal semantic identity — Toolbar root (Structure entity, actions bar). */
@@ -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 { Toolbar } from "react-aria-components";
4
3
  import { jsx } from "react/jsx-runtime";
4
+ import { Toolbar } from "react-aria-components";
5
5
 
6
6
  //#region src/components/Toolbar/Toolbar.tsx
7
7
  /** Formal semantic identity — Toolbar root (Structure entity, actions bar). */