@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.
- package/README.md +1 -1
- package/dist/components/AppShell/AppShell.cjs +124 -0
- package/dist/components/AppShell/AppShell.d.cts +74 -0
- package/dist/components/AppShell/AppShell.d.mts +74 -0
- package/dist/components/AppShell/AppShell.mjs +123 -0
- package/dist/components/Badge/Badge.cjs +61 -0
- package/dist/components/Badge/Badge.d.cts +56 -0
- package/dist/components/Badge/Badge.d.mts +56 -0
- package/dist/components/Badge/Badge.mjs +60 -0
- package/dist/components/Box/Box.cjs +114 -0
- package/dist/components/Box/Box.d.cts +115 -0
- package/dist/components/Box/Box.d.mts +115 -0
- package/dist/components/Box/Box.mjs +113 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.cjs +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.mjs +1 -1
- package/dist/components/Button/Button.cjs +2 -2
- package/dist/components/Button/Button.d.cts +2 -1
- package/dist/components/Button/Button.d.mts +2 -1
- package/dist/components/Button/Button.mjs +2 -2
- package/dist/components/Checkbox/Checkbox.cjs +2 -2
- package/dist/components/Checkbox/Checkbox.mjs +2 -2
- package/dist/components/CheckboxGroup/CheckboxGroup.cjs +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.mjs +1 -1
- package/dist/components/Code/Code.cjs +69 -0
- package/dist/components/Code/Code.d.cts +53 -0
- package/dist/components/Code/Code.d.mts +53 -0
- package/dist/components/Code/Code.mjs +68 -0
- package/dist/components/Container/Container.cjs +65 -0
- package/dist/components/Container/Container.d.cts +61 -0
- package/dist/components/Container/Container.d.mts +61 -0
- package/dist/components/Container/Container.mjs +64 -0
- package/dist/components/FileTrigger/FileTrigger.cjs +1 -1
- package/dist/components/FileTrigger/FileTrigger.mjs +1 -1
- package/dist/components/Grid/Grid.cjs +88 -0
- package/dist/components/Grid/Grid.d.cts +87 -0
- package/dist/components/Grid/Grid.d.mts +87 -0
- package/dist/components/Grid/Grid.mjs +87 -0
- package/dist/components/GridList/GridList.cjs +2 -2
- package/dist/components/GridList/GridList.mjs +2 -2
- package/dist/components/Group/Group.cjs +1 -1
- package/dist/components/Group/Group.mjs +1 -1
- package/dist/components/Heading/Heading.cjs +78 -0
- package/dist/components/Heading/Heading.d.cts +63 -0
- package/dist/components/Heading/Heading.d.mts +63 -0
- package/dist/components/Heading/Heading.mjs +77 -0
- package/dist/components/Icon/Icon.cjs +2 -1
- package/dist/components/Icon/Icon.d.cts +59 -0
- package/dist/components/Icon/Icon.d.mts +59 -0
- package/dist/components/Icon/Icon.mjs +1 -1
- package/dist/components/Icon/glyphs.cjs +37 -10
- package/dist/components/Icon/glyphs.mjs +34 -10
- package/dist/components/Icon/intents.cjs +32 -0
- package/dist/components/Icon/intents.d.cts +33 -0
- package/dist/components/Icon/intents.d.mts +33 -0
- package/dist/components/Icon/intents.mjs +32 -0
- package/dist/components/Link/Link.cjs +1 -1
- package/dist/components/Link/Link.mjs +1 -1
- package/dist/components/ListBox/ListBox.cjs +1 -1
- package/dist/components/ListBox/ListBox.mjs +1 -1
- package/dist/components/Meter/Meter.cjs +11 -1
- package/dist/components/Meter/Meter.mjs +11 -1
- package/dist/components/NumberField/NumberField.cjs +2 -2
- package/dist/components/NumberField/NumberField.mjs +2 -2
- package/dist/components/ProgressBar/ProgressBar.cjs +1 -1
- package/dist/components/ProgressBar/ProgressBar.mjs +1 -1
- package/dist/components/RadioGroup/RadioGroup.cjs +2 -2
- package/dist/components/RadioGroup/RadioGroup.mjs +2 -2
- package/dist/components/Select/Select.cjs +2 -2
- package/dist/components/Select/Select.mjs +2 -2
- package/dist/components/Separator/Separator.cjs +1 -1
- package/dist/components/Separator/Separator.mjs +1 -1
- package/dist/components/Slider/Slider.cjs +1 -1
- package/dist/components/Slider/Slider.mjs +1 -1
- package/dist/components/Stack/Stack.cjs +89 -0
- package/dist/components/Stack/Stack.d.cts +75 -0
- package/dist/components/Stack/Stack.d.mts +75 -0
- package/dist/components/Stack/Stack.mjs +88 -0
- package/dist/components/Surface/Surface.cjs +84 -0
- package/dist/components/Surface/Surface.d.cts +72 -0
- package/dist/components/Surface/Surface.d.mts +72 -0
- package/dist/components/Surface/Surface.mjs +83 -0
- package/dist/components/Switch/Switch.cjs +3 -3
- package/dist/components/Switch/Switch.d.cts +1 -1
- package/dist/components/Switch/Switch.d.mts +1 -1
- package/dist/components/Switch/Switch.mjs +3 -3
- package/dist/components/Table/Table.cjs +248 -0
- package/dist/components/Table/Table.d.cts +128 -0
- package/dist/components/Table/Table.d.mts +128 -0
- package/dist/components/Table/Table.mjs +239 -0
- package/dist/components/Tabs/Tabs.cjs +71 -28
- package/dist/components/Tabs/Tabs.d.cts +0 -17
- package/dist/components/Tabs/Tabs.d.mts +0 -17
- package/dist/components/Tabs/Tabs.mjs +69 -28
- package/dist/components/Text/Text.cjs +70 -0
- package/dist/components/Text/Text.d.cts +89 -0
- package/dist/components/Text/Text.d.mts +89 -0
- package/dist/components/Text/Text.mjs +69 -0
- package/dist/components/Toast/Toast.cjs +1 -1
- package/dist/components/Toast/Toast.mjs +1 -1
- package/dist/components/ToggleButton/ToggleButton.cjs +2 -2
- package/dist/components/ToggleButton/ToggleButton.mjs +2 -2
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.cjs +1 -1
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.mjs +1 -1
- package/dist/components/Toolbar/Toolbar.cjs +1 -1
- package/dist/components/Toolbar/Toolbar.mjs +1 -1
- package/dist/composites/Accordion/Accordion.cjs +14 -9
- package/dist/composites/Accordion/Accordion.mjs +14 -9
- package/dist/composites/Dialog/Dialog.cjs +1 -1
- package/dist/composites/Dialog/Dialog.mjs +1 -1
- package/dist/composites/Disclosure/Disclosure.cjs +14 -9
- package/dist/composites/Disclosure/Disclosure.mjs +14 -9
- package/dist/composites/Form/Form.cjs +1 -1
- package/dist/composites/Form/Form.mjs +1 -1
- package/dist/composites/Menu/Menu.cjs +2 -2
- package/dist/composites/Menu/Menu.mjs +2 -2
- package/dist/composites/Popover/Popover.cjs +1 -1
- package/dist/composites/Popover/Popover.mjs +1 -1
- package/dist/composites/SearchField/SearchField.cjs +2 -2
- package/dist/composites/SearchField/SearchField.mjs +2 -2
- package/dist/composites/TagGroup/TagGroup.cjs +2 -2
- package/dist/composites/TagGroup/TagGroup.mjs +2 -2
- package/dist/composites/TextArea/TextArea.cjs +2 -2
- package/dist/composites/TextArea/TextArea.mjs +2 -2
- package/dist/composites/TextField/TextField.cjs +2 -2
- package/dist/composites/TextField/TextField.mjs +2 -2
- package/dist/composites/Tooltip/Tooltip.cjs +1 -1
- package/dist/composites/Tooltip/Tooltip.mjs +1 -1
- package/dist/index.cjs +46 -0
- package/dist/index.d.cts +14 -1
- package/dist/index.d.mts +14 -1
- package/dist/index.mjs +14 -1
- package/llms.txt +51 -8
- package/package.json +4 -4
- package/src/tokens/CONTRACT.md +28 -10
package/src/tokens/CONTRACT.md
CHANGED
|
@@ -112,7 +112,7 @@ The grouping criterion is a single discriminant question:
|
|
|
112
112
|
|
|
113
113
|
**Stacking inside `informational`.** When two `informational` surfaces overlap (Card inside Dialog, Dialog over page, …) they may resolve to the same `background` colour. Differentiation is paid in `elevation` first, `border` second, never in colour. See [colors.md → Stacking informational surfaces](/docs/design/design-system/design-tokens/colors#stacking-informational-surfaces) for the operational rule.
|
|
114
114
|
|
|
115
|
-
**Collection containers with Selection items (per-part entity split).** A selectable list composite (`ListBox`, `GridList`) is allowed to declare **two entities across its parts**: the container root is `Collection` (an `informational` surface — the frame that carries the items) while each selectable item is `Selection` (`input` chrome, `selected` State). The item's selection chrome is therefore identical to `Select`/`Checkbox`/`RadioGroup` (`vars.colors.input.*`), and the container reads `vars.colors.informational.*`. This is intentional and enforced-compatible: the entity→ux-context contract test unions the contexts of all entities declared in a file, so both reads are legal. See ADR-007 for the rationale.
|
|
115
|
+
**Collection containers with Selection items (per-part entity split).** A selectable list composite (`ListBox`, `GridList`, `Table`) is allowed to declare **two entities across its parts**: the container root is `Collection` (an `informational` surface — the frame that carries the items) while each selectable item is `Selection` (`input` chrome, `selected` State). The item's selection chrome is therefore identical to `Select`/`Checkbox`/`RadioGroup` (`vars.colors.input.*`), and the container reads `vars.colors.informational.*`. This is intentional and enforced-compatible: the entity→ux-context contract test unions the contexts of all entities declared in a file, so both reads are legal. See ADR-007 for the rationale. `Table` extends the split with two Collection parts: `TableColumn` is the `title` structural role (columnheader; sortable columns render the `action.sortAscending`/`action.sortDescending` Icon intents) and `TableCell` is `content` — the ROADMAP B2 mapping, no taxonomy addition needed.
|
|
116
116
|
|
|
117
117
|
**Surface type rule** (derives all non-color columns):
|
|
118
118
|
|
|
@@ -294,13 +294,21 @@ color: resolveInteractiveStyle(c?.text, { isHovered, isPressed,
|
|
|
294
294
|
|
|
295
295
|
| Family | Standard step | Token path |
|
|
296
296
|
| ---------- | ------------- | ------------------------------------------ |
|
|
297
|
-
| Sizing |
|
|
297
|
+
| Sizing | _(single)_ | `vars.sizing.hit` |
|
|
298
298
|
| Spacing | `md` | `vars.spacing.inset.{control\|surface}.md` |
|
|
299
299
|
| Typography | `md` | `vars.text.label.md` |
|
|
300
300
|
|
|
301
301
|
If a design calls for a "small button", the question is: **why is it smaller semantically?**
|
|
302
302
|
Is it a toolbar action? A chip? A compact selection control? Name it, give it an entity, and it gets its own fixed step.
|
|
303
303
|
|
|
304
|
+
> **Layout is not a control.** The "no size prop" rule governs _interactive_
|
|
305
|
+
> components (Entity ≠ Structure). The presentational layer — `Box`, `Grid`,
|
|
306
|
+
> `Container`, `Stack`, `Surface` (all Entity = `Structure`) — is the sanctioned,
|
|
307
|
+
> **token-constrained** escape hatch (ADR-009): its props accept only token keys
|
|
308
|
+
> (`padding="md"`, `columns={3}`, `maxWidth="reading"`) or layout keywords
|
|
309
|
+
> (`align`, `auto`/`100%`/`fit-content`), never a raw `style`/`className`/hex/px.
|
|
310
|
+
> Compose layouts with these instead of hand-rolling CSS.
|
|
311
|
+
|
|
304
312
|
---
|
|
305
313
|
|
|
306
314
|
## §5 — data-\* Attribute Convention
|
|
@@ -349,7 +357,18 @@ const valid = ENTITY_EVALUATION['Action'];
|
|
|
349
357
|
|
|
350
358
|
---
|
|
351
359
|
|
|
352
|
-
## §7 — Escape Hatches
|
|
360
|
+
## §7 — Escape Hatches
|
|
361
|
+
|
|
362
|
+
There are **two** sanctioned escape hatches, for two different needs:
|
|
363
|
+
|
|
364
|
+
1. **Composition → the presentational layer (ADR-009).** To arrange, pad, size,
|
|
365
|
+
or lightly group content, use `Box`/`Grid`/`Container`/`Stack`/`Surface`
|
|
366
|
+
(Entity = `Structure`). Their props are token-constrained (token keys +
|
|
367
|
+
layout keywords only) — this is the answer to "I need custom layout" and
|
|
368
|
+
replaces hand-rolled CSS. See §4.
|
|
369
|
+
2. **Host geometry on composites → composite-scoped CSS custom properties.**
|
|
370
|
+
For host-owned geometry knobs on interactive composites (which own their
|
|
371
|
+
layout and expose no visual props), the single channel is described below.
|
|
353
372
|
|
|
354
373
|
Composites own their layout: they expose no `style`/`className` and no
|
|
355
374
|
visual props. The **single sanctioned customization channel** is a
|
|
@@ -407,7 +426,7 @@ Registered knobs:
|
|
|
407
426
|
## §8 — Full Example: Button (Entity = Action)
|
|
408
427
|
|
|
409
428
|
`entity: 'Action'` → §1 row: colors=`action`, radii=`control`, border=`outline.control`,
|
|
410
|
-
sizing=`hit
|
|
429
|
+
sizing=`hit`, spacing=`inset.control.md`, typography=`label.md`, motion=`feedback`, elevation=`flat`.
|
|
411
430
|
|
|
412
431
|
```typescript
|
|
413
432
|
import { vars } from '@ttoss/fsl-theme/vars';
|
|
@@ -440,7 +459,7 @@ export const Button = ({ evaluation = 'primary', ...props }: ButtonProps) => {
|
|
|
440
459
|
borderRadius: vars.radii.control,
|
|
441
460
|
borderWidth: vars.border.outline.control.width,
|
|
442
461
|
borderStyle: vars.border.outline.control.style,
|
|
443
|
-
minHeight: vars.sizing.hit
|
|
462
|
+
minHeight: vars.sizing.hit,
|
|
444
463
|
paddingBlock: vars.spacing.inset.control.md,
|
|
445
464
|
paddingInline: vars.spacing.inset.control.md,
|
|
446
465
|
...(vars.text.label.md as React.CSSProperties),
|
|
@@ -471,15 +490,14 @@ export const Button = ({ evaluation = 'primary', ...props }: ButtonProps) => {
|
|
|
471
490
|
|
|
472
491
|
---
|
|
473
492
|
|
|
474
|
-
## §9 — Icons (
|
|
493
|
+
## §9 — Icons (semantic glyph layer; public since ADR-010)
|
|
475
494
|
|
|
476
495
|
When a component needs a glyph (chevron, check, close, …), do **not** hardcode
|
|
477
|
-
a unicode character or hand-author SVG. Use
|
|
478
|
-
|
|
479
|
-
(ADR-005):
|
|
496
|
+
a unicode character or hand-author SVG. Use `Icon` — a semantic layer over
|
|
497
|
+
the Iconify provider (ADR-005; public export per ADR-010):
|
|
480
498
|
|
|
481
499
|
```typescript
|
|
482
|
-
import { Icon } from '
|
|
500
|
+
import { Icon } from '@ttoss/fsl-ui'; // inside this package: '../Icon' from src/components/*
|
|
483
501
|
|
|
484
502
|
<Icon intent="disclosure.expand" /> // named by meaning, not glyph
|
|
485
503
|
<Icon intent="action.close" size="sm" /> // sm | md (default) | lg → vars.sizing.icon.*
|