Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/figma/Checkbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@

- Keyboard focus draws a 2px `color/focus-ring` ring 2px outside the box (like Button); in Figma it is a `focus ring`
rectangle inside `input`, absolutely positioned.
- Disabled and readOnly use one neutral look: `color/surface/disabled`, `color/border/disabled`, mark and label
`color/text/disabled`.
- Disabled and readOnly use one neutral look: `color/surface/disabled`, `color/border/disabled`, mark
`color/text/disabled-soft`, label `color/text/disabled`.
- The error border stays on a checked box.
- The partial mark is a rectangle (the code's SVG line); the check mark is `Icon/check` with its fill overridden.
- ListView's selectable rows use this Checkbox.
Expand Down
26 changes: 26 additions & 0 deletions docs/figma/Drawer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Drawer: Figma notes (maintained by AI, do not edit by hand)

## Nodes

| What | ID |
| ---------------------------------------------- | ------------------------------- |
| Page | `595:286` |
| Component set `Drawer` (12 variants) | `595:412` |
| Doc frame / Playground frame | `596:224` / `596:280` |
| Sections: Documentation, Playground, Component | `595:287`, `595:288`, `595:289` |

## Properties

- Variants: `position` (left, right, top, bottom) × `size` (md first; sm, lg). Width `sizing/320 · 480 · 760` for
left and right (shown 360 high), height `sizing/256 · 400 · 600` for top and bottom (shown 760 wide): the code
takes the screen's other dimension, at most 85% of it.
- Each variant is a clipped box with 40 of shadow room on the inner side only; the `drawer` frame inside carries the
size tokens and the shadow, so the outer edges show none (they sit at the screen edge in code).
- As Modal: `color/surface/raised`, effect `elevation/4`, radius `sizing/radius/lg` on the inner edges only, no border,
no line under the header.
- Header: `headerTitle` (text style heading-h5, `color/text/strong`) and `closeButton` (IconButton neutral, close,
`sizing/icon/lg`), padding and gap 16. Content: padding 16 (includePadding), a `children` placeholder in body-md.
- Properties: text `title`; booleans `showTitle`, `closable`, `header` (code: shown when there is a title or a close
button). includePadding=false is an override of the content padding (Scenarios).
- Scenarios: backdrop (`color/backdrop`) vs removeBackdrop on a page; header and padding combinations.
- Dark: every color follows its token.
2 changes: 1 addition & 1 deletion docs/figma/Radio.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
- Variants: `size` (md default, xs, sm, lg) × `checked` × `error` / `success` / `disabled` (one at a time, like
Checkbox). `label` (text) and `showLabel` (boolean).
- Checked is a filled disc (user, 2026-11-23: no dot). success colors the empty disc's border `color/success/border`
(and Checkbox's empty box, same PR). Checked disabled disc `color/text/disabled`.
(and Checkbox's empty box, same PR). Checked disabled disc `color/text/disabled-soft`.
- Keyboard focus is not a variant: a hidden `focus ring` ellipse in `radio`, turned on in the Color spec.
- Table: column `size`; rows off / on × default, error, success, disabled.
28 changes: 28 additions & 0 deletions docs/figma/Slider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Slider: Figma notes (maintained by AI, do not edit by hand)

## Nodes

| What | ID |
| -------------------------------------------------------- | -------------------------------------- |
| Page | `590:22` |
| Component set `Slider` (38 variants) | `590:188` |
| Part `_Slider/Thumb` (4 variants) | `590:31` |
| Part `_Slider/Tooltip` | `590:32` |
| Doc frame / Playground frame | `592:140` / `592:196` |
| Sections: Documentation, Playground, Component, Internal | `590:23`, `590:24`, `590:25`, `590:26` |

## Properties

- Variants: `size` (md first) × `variant` (VariantV2: neutral, primary, secondary, accent, info, success, warning,
danger) at fill=left; `disabled=true` at primary for every size; `fill` right and none at md primary.
- 240 wide (the code takes its container's width), as high as the hovered thumb (16 · 20 · 22 · 28). Track and fill
`sizing/2 · 4 · 6 · 8`, radius round; the thumb sits at 40%.
- `_Slider/Thumb`: `sizing/12 · 16 · 18 · 24`, `color/surface/raised`, a `sizing/2 · 2 · 3 · 4` inside ring
(`color/primary/solid`, overridden per variant), effect `elevation/1`.
- `_Slider/Tooltip`: `color/surface/contrast` bubble, `color/text/on-contrast` label-md stronger (text-sm 600), padding
4 / 8, radius md, a 12 × 6 pointer; text property `value`.
- Colors: track `color/neutral/soft`, fill and ring `{variant}/solid`. Disabled (and readOnly, the same look): track
`color/surface/disabled`, fill and ring `color/text/disabled-soft`.
- Spec: Size spec, Color spec · thumb (default, hover grown to the hover size, focus 2px `color/focus-ring` 2px
outside). Scenarios: value tooltip on hover, disabled and readOnly.
- Dark: every color follows its token.
16 changes: 16 additions & 0 deletions docs/figma/SliderRange.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# SliderRange: Figma notes (maintained by AI, do not edit by hand)

## Nodes

| What | ID |
| ---------------------------------------------- | ---------------------------- |
| Page | `593:22` |
| Component set `SliderRange` (36 variants) | `593:206` |
| Doc frame / Playground frame | `593:276` / `593:332` |
| Sections: Documentation, Playground, Component | `593:23`, `593:24`, `593:25` |

## Properties

- Variants: `size` (md first) × `variant` (VariantV2) and `disabled=true` at primary for every size.
- Same geometry and colors as Slider (two `_Slider/Thumb` at 20% and 70%, the fill between them); the code stacks two
Sliders. The value tooltip is `_Slider/Tooltip` (Scenarios).
3 changes: 2 additions & 1 deletion docs/figma/Switch.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
## Decisions (user, 2026-11-19)

- The off track is `color/neutral/solid` (darker than today's light gray, for contrast); the off thumb is
`color/surface/default` (dark in dark mode); checked: `color/primary/solid` with a `color/on-primary` thumb.
`color/surface/default` (dark in dark mode); checked: `color/primary/solid` with a `color/on-primary` thumb. Disabled: track `color/surface/disabled`, thumb
`color/text/disabled-soft`, label `color/text/disabled`.
- Disabled and readOnly: track `color/surface/disabled`, thumb and label `color/text/disabled`.
- The switch is keyboard accessible (role switch, Space toggles) with a 2px `color/focus-ring` ring 2px outside the
track; the input is visually hidden and not drawn in Figma.
42 changes: 42 additions & 0 deletions docs/figma/Table.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Table: Figma notes (maintained by AI, do not edit by hand)

## Nodes

| What | ID |
| -------------------------------------------------------- | ------------------------------------------ |
| Page | `597:286` |
| Component set `Table` (9 variants) | `597:956` |
| Part `_Table/HeaderCell` (9 variants) | `597:365` |
| Part `_Table/Cell` (33 variants) | `597:432` |
| Part `_Table/FooterCell` (9 variants) | `597:451` |
| Scenarios (group) | `599:907` |
| Doc frame / Playground frame | `601:763` / `601:819` |
| Sections: Documentation, Playground, Component, Internal | `597:287`, `597:288`, `597:289`, `597:290` |

## Properties

- Variants: `border` (cellBorders default, rowBorders, none) × `headerColsBackground` (solid default, transparent,
opposite; the footer takes the same). Three columns of 160 (the code sizes them by content or evenly), three rows,
the footer row (the first two cells absorbed) and the total records line.
- Parts, padding 12 / 8 (`sizing/space`), lines `color/border/soft` 1px included in layout (cell: right and bottom,
row: bottom, none):
- `_Table/HeaderCell`: `background` × `border`; label-md strongest `color/text/strong` (opposite:
`color/surface/contrast` + `color/text/on-contrast`); text `label`, boolean `sorting` (IconButton neutral, sm, expand_all).
- `_Table/Cell`: `state` (default, striped `color/surface/subtle`, selected `color/primary/soft`, a VariantV2 row color
`{variant}/soft`) × `border`; body-sm `color/text/default`; text `value`.
- `_Table/FooterCell`: as the header cell, text to the right.
- cellBorders: the table is clipped by a 1px `color/border/soft` outline with radius md; rowBorders: a top line.
- Hover (hoverable) is a Scenarios override: the row's own tone one step darker (`color/neutral/soft-hover` for plain
and striped rows, `color/primary/soft-hover` selected, `{variant}/soft-hover` row colors), never on a rowSpan cell
(drawn with a rowSpan table).
- cellBorders: the outline draws the outer edges, so the last column has no right line and the last row no bottom line
(instance overrides); no doubled 2px edge.
- opposite + cellBorders: the head and foot rows draw the outer edges in `color/surface/contrast` (as the code), the
body rows `color/border/soft`.
- Scenarios: title and subtitle, striped, selectable (Checkbox md without label, partial in the header), row colors,
hover with rowSpan, filterableTable, column filters and both (InputText sm), footer line (default, hideTotalRecords, pagination left /
center / right), pagination (footer 60 high, 8 under the table), loading
(Skeleton, three bars),
no data.
- The code's SCSS keeps its structure (deep th/td selectors, out of the strict stylelint list for now).
- Dark: every color follows its token.
5 changes: 4 additions & 1 deletion docs/review/design-tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Where the text comes from depends on whether the component has a size prop:
- Text: `text-stronger, text-strong, text-default, text-soft, text-softer`, `text-disabled`. On a solid intent fill use
`on-{intent}`; on images use `text-on-media`.
- Surfaces: `surface-canvas` (page), `surface-default` (card, panel), `surface-raised` (popover, dropdown, modal),
`surface-sunken`, `surface-subtle`, `surface-disabled`, `surface-opposite` (tooltip).
`surface-sunken`, `surface-subtle`, `surface-disabled`, `surface-contrast` (tooltip, with `text-on-contrast`), `surface-opposite`.
- Intent tokens, by job:
- `{intent}-solid`, `-solid-hover`, `-solid-active`: filled backgrounds;
- `{intent}-soft`, `-soft-hover`: tinted backgrounds, ghost/outline hover;
Expand All @@ -104,6 +104,9 @@ Where the text comes from depends on whether the component has a size prop:
`border-field`, `border-field-hover`, `border-field-focus`. Validation uses the intent borders directly (`danger-border`,
`success-border`); disabled uses the global disabled tokens. Flag a field-like component that uses the generic text or
border tokens instead of the field ones.
- Disabled controls: areas `surface-disabled`, lines `border-disabled`, labels `text-disabled`, and the fills and marks
inside (Checkbox check, Radio disc, Switch knob, Slider fill and thumb ring) `text-disabled-soft`, so a disabled fill does
not read as the neutral variant. Flag a disabled fill or mark on `text-disabled`.
- Dark mode is handled by the tokens (`light-dark()`). Flag component-level dark overrides: `@media (prefers-color-scheme)`,
`[data-mtf-mode]` selectors, or separate dark variables inside a component.

Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/Checkbox/Checkbox.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ $sizes: (("xs", 18, 6, 4, 16, "0 0 23 23"), ("sm", 20, 8, 6, 18, "0 0 23 23"), (
background-color: var(--mtf-color-surface-disabled);

&::before {
background-color: var(--mtf-color-text-disabled);
background-color: var(--mtf-color-text-disabled-soft);
}
}
}
Expand Down
99 changes: 49 additions & 50 deletions src/lib/components/Drawer/Drawer.module.scss
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
@use "@styles" as *;

$sizes: (
//sizeName, width, height
("sm", "320x", "256x"),
("md", "480x", "400x"),
("lg", "760x", "600x")
);
// size, width (left and right), height (top and bottom)
$sizes: (("sm", 320, 256), ("md", 480, 400), ("lg", 760, 600));

// The panel, as Modal's: a raised surface, rounded only on its inner edges
.Root {
position: fixed;
inset: 0;
background-color: var(--base-colors-black-black-overlay50);
z-index: z-layer("modal");
background-color: var(--mtf-color-backdrop);
@include fade-default;

&.show {
Expand All @@ -24,69 +21,70 @@ $sizes: (
}

.drawer {
position: fixed;
display: flex;
flex-direction: column;
position: fixed;
background: var(--theme-color-surface-base-global-light);
border: solid var(--base-sizing-1x) var(--theme-color-border-light-default);
max-width: 100%;
max-height: 100%;
overflow: hidden;
@include shadow(4);
color: var(--mtf-color-text-default);
background-color: var(--mtf-color-surface-raised);
box-shadow: var(--mtf-elevation-4);
}

.left & {
@include slide-default("left");
inset: 0 auto 0 0;
border-radius: 0 var(--theme-sizing-radius-default) var(--theme-sizing-radius-default) 0;
}
.left .drawer {
@include slide-default("left");
inset: 0 auto 0 0;
border-radius: 0 var(--mtf-sizing-radius-lg) var(--mtf-sizing-radius-lg) 0;
}

.right & {
@include slide-default("right");
inset: 0 0 0 auto;
border-radius: var(--theme-sizing-radius-default) 0 0 var(--theme-sizing-radius-default);
}
.right .drawer {
@include slide-default("right");
inset: 0 0 0 auto;
border-radius: var(--mtf-sizing-radius-lg) 0 0 var(--mtf-sizing-radius-lg);
}

.top & {
@include slide-default("top");
inset: 0 0 auto;
border-radius: 0 0 var(--theme-sizing-radius-default) var(--theme-sizing-radius-default);
}
.top .drawer {
@include slide-default("top");
inset: 0 0 auto;
border-radius: 0 0 var(--mtf-sizing-radius-lg) var(--mtf-sizing-radius-lg);
}

.bottom & {
@include slide-default("bottom");
inset: auto 0 0;
border-radius: var(--theme-sizing-radius-default) var(--theme-sizing-radius-default) 0 0;
}
.bottom .drawer {
@include slide-default("bottom");
inset: auto 0 0;
border-radius: var(--mtf-sizing-radius-lg) var(--mtf-sizing-radius-lg) 0 0;
}

.show & {
@include slide-in;
}
// After the positions: same specificity, so the open state wins by order
.show .drawer {
@include slide-in;
}

@each $size, $width, $height in $sizes {
.left.#{$size} &,
.right.#{$size} & {
width: min(var(--base-sizing-#{$width}), 85vw);
}
@each $size, $width, $height in $sizes {
.left.#{$size} .drawer,
.right.#{$size} .drawer {
width: min(var(--mtf-sizing-#{$width}), 85vw);
}

.top.#{$size} &,
.bottom.#{$size} & {
height: min(var(--base-sizing-#{$height}), 85vh);
}
.top.#{$size} .drawer,
.bottom.#{$size} .drawer {
height: min(var(--mtf-sizing-#{$height}), 85vh);
}
}

.header {
display: flex;
align-items: flex-start;
gap: var(--base-sizing-16x);
padding: var(--base-sizing-16x);
gap: var(--mtf-sizing-space-16);
padding: var(--mtf-sizing-space-16);
}

.headerTitle {
flex: 1;
color: var(--theme-color-text-base-title);
overflow-wrap: break-word;
@include font("base", "lg", "700");
color: var(--mtf-color-text-strong);
@include typography("heading-h5");
}

.closeButton {
Expand All @@ -97,8 +95,9 @@ $sizes: (
flex: 1 1 auto;
min-height: 0;
overflow-y: auto;
}
scrollbar-color: var(--mtf-color-border-strong) transparent;

.includePadding .content {
padding: var(--base-sizing-16x);
.includePadding & {
padding: var(--mtf-sizing-space-16);
}
}
4 changes: 2 additions & 2 deletions src/lib/components/Radio/Radio.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ $sizes: (("xs", 16, 6), ("sm", 20, 8), ("md", 24, 10), ("lg", 28, 12));
border-color: var(--mtf-color-border-disabled);
background-color: var(--mtf-color-surface-disabled);

// A checked disabled disc stays a darker gray, so it still reads as selected
// A checked disabled disc stays a step darker than the disabled surface, so it still reads as selected
&:checked {
background-color: var(--mtf-color-text-disabled);
background-color: var(--mtf-color-text-disabled-soft);
}
}
}
Expand Down
Loading
Loading