@finstack-com-public/design 0.10.3 → 0.11.0

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.
@@ -0,0 +1,137 @@
1
+ /* Switch (spec 02 B, T131): a native checkbox with role="switch", drawn as a pill track with a knob.
2
+ Usage: switch.md. */
3
+ @layer fs.components {
4
+ .fs-switch {
5
+ /* W1: 28 × 16 at dense and compact, 36 × 20 at comfortable. The icon size is 16, 16 and 20 px at
6
+ the three densities, so the height follows it and the width is twice it less 4 px. */
7
+ --fs-switch-h: var(--fs-icon-size);
8
+ --fs-switch-w: calc(var(--fs-switch-h) * 2 - 4px);
9
+ display: inline-flex;
10
+ align-items: center;
11
+ gap: var(--fs-space-2);
12
+ min-height: var(--fs-size-touch);
13
+ font-size: var(--fs-text-body-size);
14
+ line-height: var(--fs-text-body-line);
15
+ color: var(--fs-ink);
16
+ cursor: pointer;
17
+ }
18
+ /* --end: the label first, the switch at the row's end (a settings row). Same markup, so `order`. */
19
+ .fs-switch--end {
20
+ display: flex;
21
+ justify-content: space-between;
22
+ }
23
+ .fs-switch--end > .fs-switch__input {
24
+ order: 1;
25
+ }
26
+
27
+ /* The track. Its edge is --fs-line-control-strong (3:1): no label sits inside it, as the checkbox box. */
28
+ .fs-switch__input {
29
+ appearance: none;
30
+ position: relative;
31
+ flex: none;
32
+ box-sizing: border-box;
33
+ width: var(--fs-switch-w);
34
+ height: var(--fs-switch-h);
35
+ margin: 0;
36
+ background: var(--fs-bg-sunken);
37
+ border: var(--fs-line-width) solid var(--fs-line-control-strong);
38
+ border-radius: var(--fs-radius-pill);
39
+ cursor: pointer;
40
+ }
41
+ /* The knob: a circle 4 px smaller than the track's height, 2 px in from its outer edge. Its position
42
+ says the state (W2: no glyph). --fs-dur is 0 under reduced motion, so the move is instant there. */
43
+ .fs-switch__input::before {
44
+ content: '';
45
+ position: absolute;
46
+ inset-block: 0;
47
+ inset-inline-start: calc(2px - var(--fs-line-width));
48
+ width: calc(var(--fs-switch-h) - 4px);
49
+ height: calc(var(--fs-switch-h) - 4px);
50
+ margin-block: auto;
51
+ background: var(--fs-line-control-strong);
52
+ border-radius: 50%;
53
+ transition: inset-inline-start var(--fs-dur) var(--fs-ease);
54
+ }
55
+ .fs-switch__input:checked {
56
+ background: var(--fs-accent);
57
+ border-color: var(--fs-accent);
58
+ }
59
+ .fs-switch__input:checked::before {
60
+ inset-inline-start: calc(var(--fs-switch-w) - var(--fs-switch-h) + 2px - var(--fs-line-width));
61
+ background: var(--fs-bg-surface);
62
+ }
63
+
64
+ @media (hover: hover) {
65
+ .fs-switch:hover > .fs-switch__input:not(:checked, :disabled) {
66
+ border-color: var(--fs-ink-2);
67
+ }
68
+ }
69
+
70
+ /* The ring recipe (D15). */
71
+ .fs-switch__input:focus-visible {
72
+ outline: var(--fs-ring-width) solid var(--fs-ring);
73
+ outline-offset: var(--fs-ring-halo-width);
74
+ box-shadow: 0 0 0 var(--fs-ring-halo-width) var(--fs-ring-halo);
75
+ }
76
+
77
+ /* Busy (aria-busy on the row): the change is on its way, so the knob keeps its place without motion. */
78
+ .fs-switch[aria-busy='true'],
79
+ .fs-switch[aria-busy='true'] > .fs-switch__input {
80
+ cursor: progress;
81
+ }
82
+ .fs-switch[aria-busy='true'] > .fs-switch__input::before {
83
+ transition: none;
84
+ }
85
+
86
+ /* Disabled comes last. Never opacity. */
87
+ .fs-switch:has(:disabled) {
88
+ color: var(--fs-ink-disabled);
89
+ cursor: not-allowed;
90
+ }
91
+ .fs-switch__input:disabled {
92
+ background: var(--fs-bg-disabled);
93
+ border-color: var(--fs-line);
94
+ cursor: not-allowed;
95
+ }
96
+ .fs-switch__input:disabled::before {
97
+ background: var(--fs-ink-disabled);
98
+ }
99
+ .fs-switch__input:disabled:checked {
100
+ background: var(--fs-ink-disabled);
101
+ border-color: var(--fs-ink-disabled);
102
+ }
103
+ .fs-switch__input:disabled:checked::before {
104
+ background: var(--fs-bg-disabled);
105
+ }
106
+
107
+ /* Forced colours erase the fills, and appearance: auto would draw a checkbox, so the kit keeps its
108
+ drawing in system colours: the knob's place still tells off from on. */
109
+ @media (forced-colors: active) {
110
+ .fs-switch__input {
111
+ background: Canvas;
112
+ border-color: CanvasText;
113
+ }
114
+ .fs-switch__input::before {
115
+ background: CanvasText;
116
+ }
117
+ .fs-switch__input:checked {
118
+ background: Highlight;
119
+ border-color: Highlight;
120
+ }
121
+ .fs-switch__input:checked::before {
122
+ background: HighlightText;
123
+ }
124
+ .fs-switch:has(:disabled) {
125
+ color: GrayText;
126
+ }
127
+ .fs-switch__input:disabled,
128
+ .fs-switch__input:disabled:checked {
129
+ background: Canvas;
130
+ border-color: GrayText;
131
+ }
132
+ .fs-switch__input:disabled::before,
133
+ .fs-switch__input:disabled:checked::before {
134
+ background: GrayText;
135
+ }
136
+ }
137
+ }
@@ -0,0 +1,28 @@
1
+ # Switch — `.fs-switch`
2
+
3
+ Spec 02 B (T131). CSS: `css/switch.css`. Gallery: `inputs.html`. React: `Switch`.
4
+
5
+ ```html
6
+ <label class="fs-switch"><input type="checkbox" role="switch" class="fs-switch__input"><span class="fs-switch__label">Show the title</span></label>
7
+ <label class="fs-switch fs-switch--end"><input type="checkbox" role="switch" class="fs-switch__input" checked><span class="fs-switch__label">Show border</span></label>
8
+ ```
9
+
10
+ - **A switch acts at once; a checkbox is a choice.** Use a switch when flipping it changes something
11
+ straight away (a style setting, showing a column). Use a checkbox (`.fs-checkbox`) when the choice is
12
+ applied later by a button (Save, Apply, a form's submit).
13
+ - A native `<input type="checkbox" role="switch">`, so Space, the label's click, the checked state and form
14
+ submission are the browser's; `aria-checked` follows `checked`. There is no helper. Enter does nothing, as on
15
+ a checkbox.
16
+ - Drawn by the kit (`appearance: none`): a pill track with a knob. Off is a `--fs-bg-sunken` track with a
17
+ `--fs-line-control-strong` edge and knob (3:1: no label sits inside); on is an `--fs-accent` track with a
18
+ `--fs-bg-surface` knob at the end. The knob's place, not its colour alone, says the state.
19
+ - Size: `--fs-switch-w` × `--fs-switch-h`, 28 × 16 px at dense and compact and 36 × 20 px at comfortable,
20
+ set on `.fs-switch` from the density. The row is at least 24 px high, the touch target of spec 06.
21
+ - `--end` puts the label first and the switch at the row's end (a settings row); the markup stays the same.
22
+ - Hover darkens the off track's edge (`--fs-ink-2`). Focus is the ring (D15). Disabled greys the track, the
23
+ knob and the label, by colour, never opacity.
24
+ - Busy: `aria-busy="true"` on the row while the change is on its way. The knob keeps its place without motion
25
+ and the cursor shows progress; the product decides whether to disable the input meanwhile. React: `busy`.
26
+ - The knob slides in `--fs-dur`, which is 0 under reduced motion.
27
+ - In forced colours the kit keeps its drawing in system colours: a `CanvasText` edge and knob on `Canvas`; on, a
28
+ `Highlight` track and a `HighlightText` knob; disabled, a `GrayText` edge, knob and label.
@@ -0,0 +1,2 @@
1
+ declare const css: string;
2
+ export default css;
@@ -0,0 +1 @@
1
+ export default "/* Editable combobox (spec 02 B; F2 draft §1, T133): a text input with list autocomplete. Usage:\n combobox.md. Behaviour: createCombobox. The input is a plain .fs-input (input.css: height, fill,\n edge, hover, ring, invalid, read-only, disabled); the popup is the completion list's\n .fs-menu--listbox (menu.css), grouped options included. */\n@layer fs.components {\n .fs-combobox {\n position: relative;\n display: block;\n min-width: 0;\n }\n /* Room for the toggle at the input's end. */\n .fs-combobox:has(> .fs-combobox__toggle) > .fs-input {\n padding-right: calc(var(--fs-size-touch) + var(--fs-space-1));\n }\n\n /* The toggle: a row icon button (24 px target) inside the input's end, out of the tab order. Its\n chevron is a mask on currentColor, as the select's, so it follows the system colours. */\n .fs-combobox__toggle {\n position: absolute;\n top: calc((var(--fs-control-h) - var(--fs-size-touch)) / 2);\n right: calc((var(--fs-control-h) - var(--fs-size-touch)) / 2);\n }\n .fs-combobox__toggle::before {\n content: '';\n width: 16px;\n height: 16px;\n background-color: currentColor;\n mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.875' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E\")\n center / contain no-repeat;\n }\n .fs-combobox__toggle[aria-expanded='true']::before {\n transform: rotate(180deg);\n }\n\n /* Read-only: no toggle (the input already has no edge). */\n .fs-combobox:has(> .fs-input:read-only:not(:disabled)) > .fs-combobox__toggle {\n display: none;\n }\n\n /* Disabled last: by colour, never opacity; the toggle takes no presses. */\n .fs-combobox:has(> .fs-input:disabled) > .fs-combobox__toggle {\n color: var(--fs-ink-disabled);\n background-color: transparent;\n cursor: not-allowed;\n pointer-events: none;\n }\n\n /* Forced colours: the current option keeps a Highlight outline (the input and the chevron are\n drawn by the system already); a disabled toggle is GrayText. */\n @media (forced-colors: active) {\n .fs-combobox .fs-menu__item[aria-selected='true'] {\n outline-color: Highlight;\n }\n .fs-combobox:has(> .fs-input:disabled) > .fs-combobox__toggle {\n color: GrayText;\n }\n }\n}\n";
@@ -2170,6 +2170,65 @@ export default `@layer fs.tokens, fs.reset, fs.base, fs.components, fs.utilities
2170
2170
  }
2171
2171
  }
2172
2172
 
2173
+ /* Editable combobox (spec 02 B; F2 draft §1, T133): a text input with list autocomplete. Usage:
2174
+ combobox.md. Behaviour: createCombobox. The input is a plain .fs-input (input.css: height, fill,
2175
+ edge, hover, ring, invalid, read-only, disabled); the popup is the completion list's
2176
+ .fs-menu--listbox (menu.css), grouped options included. */
2177
+ @layer fs.components {
2178
+ .fs-combobox {
2179
+ position: relative;
2180
+ display: block;
2181
+ min-width: 0;
2182
+ }
2183
+ /* Room for the toggle at the input's end. */
2184
+ .fs-combobox:has(> .fs-combobox__toggle) > .fs-input {
2185
+ padding-right: calc(var(--fs-size-touch) + var(--fs-space-1));
2186
+ }
2187
+
2188
+ /* The toggle: a row icon button (24 px target) inside the input's end, out of the tab order. Its
2189
+ chevron is a mask on currentColor, as the select's, so it follows the system colours. */
2190
+ .fs-combobox__toggle {
2191
+ position: absolute;
2192
+ top: calc((var(--fs-control-h) - var(--fs-size-touch)) / 2);
2193
+ right: calc((var(--fs-control-h) - var(--fs-size-touch)) / 2);
2194
+ }
2195
+ .fs-combobox__toggle::before {
2196
+ content: '';
2197
+ width: 16px;
2198
+ height: 16px;
2199
+ background-color: currentColor;
2200
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.875' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
2201
+ center / contain no-repeat;
2202
+ }
2203
+ .fs-combobox__toggle[aria-expanded='true']::before {
2204
+ transform: rotate(180deg);
2205
+ }
2206
+
2207
+ /* Read-only: no toggle (the input already has no edge). */
2208
+ .fs-combobox:has(> .fs-input:read-only:not(:disabled)) > .fs-combobox__toggle {
2209
+ display: none;
2210
+ }
2211
+
2212
+ /* Disabled last: by colour, never opacity; the toggle takes no presses. */
2213
+ .fs-combobox:has(> .fs-input:disabled) > .fs-combobox__toggle {
2214
+ color: var(--fs-ink-disabled);
2215
+ background-color: transparent;
2216
+ cursor: not-allowed;
2217
+ pointer-events: none;
2218
+ }
2219
+
2220
+ /* Forced colours: the current option keeps a Highlight outline (the input and the chevron are
2221
+ drawn by the system already); a disabled toggle is GrayText. */
2222
+ @media (forced-colors: active) {
2223
+ .fs-combobox .fs-menu__item[aria-selected='true'] {
2224
+ outline-color: Highlight;
2225
+ }
2226
+ .fs-combobox:has(> .fs-input:disabled) > .fs-combobox__toggle {
2227
+ color: GrayText;
2228
+ }
2229
+ }
2230
+ }
2231
+
2173
2232
  /* Control-row grid: filters, parameters and the property list (spec 02 B, T73). Usage: control-rows.md. */
2174
2233
  @layer fs.components {
2175
2234
  /* A stack of sections (Szűrők, then Paraméterek), 12 apart. */
@@ -5462,6 +5521,110 @@ export default `@layer fs.tokens, fs.reset, fs.base, fs.components, fs.utilities
5462
5521
  }
5463
5522
  }
5464
5523
 
5524
+ /* Custom select (spec 02 B; F2 draft §2, T132): a select-only combobox. Usage: select.md.
5525
+ Behaviour: createSelect. The trigger also carries .fs-select__control (input.css), so it takes the
5526
+ native select's height, fill, edge, hover, ring and invalid edge; the popup is the completion
5527
+ list's .fs-menu--listbox (menu.css). */
5528
+ @layer fs.components {
5529
+ .fs-select__trigger {
5530
+ display: flex;
5531
+ align-items: center;
5532
+ min-width: 0;
5533
+ text-align: left;
5534
+ user-select: none;
5535
+ }
5536
+ .fs-select__value,
5537
+ .fs-select__placeholder {
5538
+ flex: 1 1 auto;
5539
+ min-width: 0;
5540
+ overflow: hidden;
5541
+ text-overflow: ellipsis;
5542
+ white-space: nowrap;
5543
+ }
5544
+ .fs-select__placeholder {
5545
+ color: var(--fs-ink-muted);
5546
+ }
5547
+ /* The chevron sits in the trigger's row, whatever else the wrapper holds (the list, a hidden input). */
5548
+ .fs-select--listbox::after {
5549
+ bottom: auto;
5550
+ margin: 0;
5551
+ top: calc((var(--fs-control-h) - 16px) / 2);
5552
+ }
5553
+ .fs-select--listbox:has(> [aria-expanded='true'])::after {
5554
+ transform: rotate(180deg);
5555
+ }
5556
+
5557
+ /* The value's option: weight 600 and a 16 px check at its end (aria-selected marks only the
5558
+ current option while open, APG). Every option keeps the check's column, so rows line up. */
5559
+ .fs-select--listbox .fs-menu__item[role='option']::after {
5560
+ content: '';
5561
+ flex: none;
5562
+ width: 16px;
5563
+ height: 16px;
5564
+ margin-left: var(--fs-space-2);
5565
+ }
5566
+ .fs-select--listbox .fs-menu__item[role='option']:not(:has(.fs-menu__detail))::after {
5567
+ margin-left: auto;
5568
+ }
5569
+ .fs-select--listbox .fs-menu__item.fs-is-value {
5570
+ font-weight: var(--fs-weight-semibold);
5571
+ }
5572
+ .fs-select--listbox .fs-menu__item.fs-is-value::after {
5573
+ background-color: var(--fs-accent);
5574
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")
5575
+ center / contain no-repeat;
5576
+ }
5577
+
5578
+ /* Read-only: no edge, no chevron, the value in full ink (as a read-only input). */
5579
+ .fs-select__trigger[aria-readonly='true'] {
5580
+ background-color: transparent;
5581
+ border-color: transparent;
5582
+ cursor: default;
5583
+ }
5584
+ .fs-select--listbox:has(> [aria-readonly='true'])::after {
5585
+ content: none;
5586
+ }
5587
+
5588
+ /* Disabled last: by colour, never opacity. It stays focusable (aria-disabled). */
5589
+ .fs-select__trigger[aria-disabled='true'] {
5590
+ color: var(--fs-ink-disabled);
5591
+ background-color: var(--fs-bg-disabled);
5592
+ border-color: var(--fs-line);
5593
+ cursor: not-allowed;
5594
+ }
5595
+ .fs-select__trigger[aria-disabled='true'] .fs-select__placeholder {
5596
+ color: var(--fs-ink-disabled);
5597
+ }
5598
+ .fs-select--listbox:has(> [aria-disabled='true']) {
5599
+ color: var(--fs-ink-disabled);
5600
+ }
5601
+
5602
+ /* Forced colours: the trigger is a div, so the system draws no control edge for it: give it one.
5603
+ The check is drawn in a system colour; the current option keeps the Highlight outline. */
5604
+ @media (forced-colors: active) {
5605
+ .fs-select__trigger {
5606
+ border: var(--fs-line-width) solid ButtonText;
5607
+ }
5608
+ .fs-select__trigger[aria-readonly='true'] {
5609
+ border-color: transparent;
5610
+ }
5611
+ .fs-select--listbox .fs-menu__item.fs-is-value::after {
5612
+ background-color: CanvasText;
5613
+ }
5614
+ .fs-select--listbox .fs-menu__item[aria-selected='true'] {
5615
+ outline-color: Highlight;
5616
+ }
5617
+ .fs-select__trigger[aria-disabled='true'],
5618
+ .fs-select__trigger[aria-disabled='true'] .fs-select__placeholder {
5619
+ color: GrayText;
5620
+ border-color: GrayText;
5621
+ }
5622
+ .fs-select--listbox:has(> [aria-disabled='true'])::after {
5623
+ background-color: GrayText;
5624
+ }
5625
+ }
5626
+ }
5627
+
5465
5628
  /* Side sheet: modal on <dialog>, or docked as a pane (spec 02 D). Usage: sheet.md. Behaviour: createSheet. */
5466
5629
  @layer fs.components {
5467
5630
  .fs-sheet {
@@ -5662,6 +5825,176 @@ export default `@layer fs.tokens, fs.reset, fs.base, fs.components, fs.utilities
5662
5825
  }
5663
5826
  }
5664
5827
 
5828
+ /* Slider and range slider (spec 02 B; F2 draft §4, T134). Usage: slider.md. Behaviour: createSlider,
5829
+ which writes each thumb's place (--fs-slider-at) and the fill's ends (--fs-slider-low, --fs-slider-high). */
5830
+ @layer fs.components {
5831
+ .fs-slider {
5832
+ --fs-slider-track-h: 4px;
5833
+ --fs-slider-thumb: var(--fs-icon-size);
5834
+ display: flex;
5835
+ align-items: center;
5836
+ gap: var(--fs-space-3);
5837
+ min-width: 0;
5838
+ min-height: var(--fs-control-h);
5839
+ font-size: var(--fs-text-body-size);
5840
+ line-height: var(--fs-text-body-line);
5841
+ /* A press starts a drag: the page must not scroll or select under it. */
5842
+ touch-action: none;
5843
+ user-select: none;
5844
+ }
5845
+
5846
+ /* The track: 4 px, no fill or label inside it, so --fs-line-control-strong (3:1, D30). Half a thumb
5847
+ of room at each end keeps a thumb at the minimum or maximum inside the block. */
5848
+ .fs-slider__track {
5849
+ position: relative;
5850
+ flex: 1 1 auto;
5851
+ min-width: 0;
5852
+ box-sizing: border-box;
5853
+ height: var(--fs-slider-track-h);
5854
+ margin-inline: calc(var(--fs-slider-thumb) / 2);
5855
+ background: var(--fs-line-control-strong);
5856
+ border-radius: var(--fs-radius-sm);
5857
+ cursor: pointer;
5858
+ }
5859
+ /* The band from the minimum to the value, or between the two thumbs. */
5860
+ .fs-slider__fill {
5861
+ position: absolute;
5862
+ inset-block: 0;
5863
+ inset-inline-start: var(--fs-slider-low, 0%);
5864
+ inset-inline-end: calc(100% - var(--fs-slider-high, 0%));
5865
+ background: var(--fs-accent);
5866
+ border-radius: inherit;
5867
+ }
5868
+ /* Marks at the steps the product names, under the track. */
5869
+ .fs-slider__ticks {
5870
+ position: absolute;
5871
+ inset: 0;
5872
+ pointer-events: none;
5873
+ }
5874
+ .fs-slider__ticks > * {
5875
+ position: absolute;
5876
+ top: calc(var(--fs-slider-track-h) + 2px);
5877
+ inset-inline-start: var(--fs-slider-at, 0%);
5878
+ width: 1px;
5879
+ height: 4px;
5880
+ margin-inline-start: -0.5px;
5881
+ background: var(--fs-line-control-strong);
5882
+ }
5883
+
5884
+ /* A thumb: a circle of the icon size (16 px, 20 at comfortable), a 2 px accent edge on the surface,
5885
+ its centre on the value. Its hit area is padded to the 24 px touch target (spec 06 §1). */
5886
+ .fs-slider__thumb {
5887
+ position: absolute;
5888
+ top: 50%;
5889
+ inset-inline-start: var(--fs-slider-at, 0%);
5890
+ box-sizing: border-box;
5891
+ width: var(--fs-slider-thumb);
5892
+ height: var(--fs-slider-thumb);
5893
+ margin-block-start: calc(var(--fs-slider-thumb) / -2);
5894
+ margin-inline-start: calc(var(--fs-slider-thumb) / -2);
5895
+ background: var(--fs-bg-surface);
5896
+ border: 2px solid var(--fs-accent);
5897
+ border-radius: 50%;
5898
+ cursor: grab;
5899
+ }
5900
+ .fs-slider__thumb::before {
5901
+ content: '';
5902
+ position: absolute;
5903
+ inset: calc((var(--fs-slider-thumb) - var(--fs-size-touch)) / 2 - 2px);
5904
+ border-radius: 50%;
5905
+ }
5906
+ /* --range: two thumbs. At one value, the focused one is on top. */
5907
+ .fs-slider--range .fs-slider__thumb:focus {
5908
+ z-index: 1;
5909
+ }
5910
+ @media (hover: hover) {
5911
+ .fs-slider__thumb:hover {
5912
+ border-color: var(--fs-accent-strong);
5913
+ }
5914
+ }
5915
+ /* Dragging: the helper sets .fs-is-dragging for the whole drag (pointer capture ends :active early in some engines).
5916
+ Two rules, not one list: the gallery clones a rule naming :active into a later sheet, and a list would take
5917
+ .fs-is-dragging along, past the forced-colours rule below. */
5918
+ .fs-slider__thumb.fs-is-dragging {
5919
+ background: var(--fs-bg-selected);
5920
+ border-color: var(--fs-accent-strong);
5921
+ cursor: grabbing;
5922
+ }
5923
+ .fs-slider__thumb:active {
5924
+ background: var(--fs-bg-selected);
5925
+ border-color: var(--fs-accent-strong);
5926
+ cursor: grabbing;
5927
+ }
5928
+ /* The ring recipe (D15). */
5929
+ .fs-slider__thumb:focus-visible {
5930
+ outline: var(--fs-ring-width) solid var(--fs-ring);
5931
+ outline-offset: var(--fs-ring-halo-width);
5932
+ box-shadow: 0 0 0 var(--fs-ring-halo-width) var(--fs-ring-halo);
5933
+ }
5934
+
5935
+ /* The value beside it: an <output>, in tabular figures so it doesn't jitter while moving. */
5936
+ .fs-slider__value {
5937
+ flex: none;
5938
+ color: var(--fs-ink);
5939
+ font-variant-numeric: tabular-nums;
5940
+ white-space: nowrap;
5941
+ }
5942
+
5943
+ /* Disabled comes last: by colour, never opacity. The thumbs stay reachable (aria-disabled). */
5944
+ .fs-slider:has(.fs-slider__thumb[aria-disabled='true']) {
5945
+ color: var(--fs-ink-disabled);
5946
+ }
5947
+ .fs-slider:has(.fs-slider__thumb[aria-disabled='true']) .fs-slider__track {
5948
+ background: var(--fs-line);
5949
+ cursor: not-allowed;
5950
+ }
5951
+ .fs-slider:has(.fs-slider__thumb[aria-disabled='true']) .fs-slider__fill {
5952
+ background: var(--fs-ink-disabled);
5953
+ }
5954
+ .fs-slider__thumb[aria-disabled='true'] {
5955
+ background: var(--fs-bg-disabled);
5956
+ border-color: var(--fs-ink-disabled);
5957
+ cursor: not-allowed;
5958
+ }
5959
+
5960
+ /* Forced colours erase the fills: the track becomes a 1 px CanvasText edge, the fill Highlight, the
5961
+ thumb a Canvas disc with a CanvasText edge, Highlight while focused or dragged; disabled GrayText.
5962
+ The thumb's place carries the value, and __value says it. */
5963
+ @media (forced-colors: active) {
5964
+ .fs-slider__track {
5965
+ background: Canvas;
5966
+ border: 1px solid CanvasText;
5967
+ }
5968
+ .fs-slider__fill {
5969
+ background: Highlight;
5970
+ }
5971
+ .fs-slider__ticks > * {
5972
+ background: CanvasText;
5973
+ }
5974
+ .fs-slider__thumb {
5975
+ background: Canvas;
5976
+ border-color: CanvasText;
5977
+ }
5978
+ .fs-slider__thumb:focus-visible,
5979
+ .fs-slider__thumb.fs-is-dragging {
5980
+ border-color: Highlight;
5981
+ }
5982
+ .fs-slider:has(.fs-slider__thumb[aria-disabled='true']) {
5983
+ color: GrayText;
5984
+ }
5985
+ .fs-slider:has(.fs-slider__thumb[aria-disabled='true']) .fs-slider__track {
5986
+ border-color: GrayText;
5987
+ }
5988
+ .fs-slider:has(.fs-slider__thumb[aria-disabled='true']) .fs-slider__fill,
5989
+ .fs-slider:has(.fs-slider__thumb[aria-disabled='true']) .fs-slider__ticks > * {
5990
+ background: GrayText;
5991
+ }
5992
+ .fs-slider__thumb[aria-disabled='true'] {
5993
+ border-color: GrayText;
5994
+ }
5995
+ }
5996
+ }
5997
+
5665
5998
  /* Spinner: for busy steps and buttons only (spec 02 E). Usage: spinner.md. */
5666
5999
  @layer fs.components {
5667
6000
  .fs-spinner {
@@ -5836,6 +6169,144 @@ export default `@layer fs.tokens, fs.reset, fs.base, fs.components, fs.utilities
5836
6169
  }
5837
6170
  }
5838
6171
 
6172
+ /* Switch (spec 02 B, T131): a native checkbox with role="switch", drawn as a pill track with a knob.
6173
+ Usage: switch.md. */
6174
+ @layer fs.components {
6175
+ .fs-switch {
6176
+ /* W1: 28 × 16 at dense and compact, 36 × 20 at comfortable. The icon size is 16, 16 and 20 px at
6177
+ the three densities, so the height follows it and the width is twice it less 4 px. */
6178
+ --fs-switch-h: var(--fs-icon-size);
6179
+ --fs-switch-w: calc(var(--fs-switch-h) * 2 - 4px);
6180
+ display: inline-flex;
6181
+ align-items: center;
6182
+ gap: var(--fs-space-2);
6183
+ min-height: var(--fs-size-touch);
6184
+ font-size: var(--fs-text-body-size);
6185
+ line-height: var(--fs-text-body-line);
6186
+ color: var(--fs-ink);
6187
+ cursor: pointer;
6188
+ }
6189
+ /* --end: the label first, the switch at the row's end (a settings row). Same markup, so \`order\`. */
6190
+ .fs-switch--end {
6191
+ display: flex;
6192
+ justify-content: space-between;
6193
+ }
6194
+ .fs-switch--end > .fs-switch__input {
6195
+ order: 1;
6196
+ }
6197
+
6198
+ /* The track. Its edge is --fs-line-control-strong (3:1): no label sits inside it, as the checkbox box. */
6199
+ .fs-switch__input {
6200
+ appearance: none;
6201
+ position: relative;
6202
+ flex: none;
6203
+ box-sizing: border-box;
6204
+ width: var(--fs-switch-w);
6205
+ height: var(--fs-switch-h);
6206
+ margin: 0;
6207
+ background: var(--fs-bg-sunken);
6208
+ border: var(--fs-line-width) solid var(--fs-line-control-strong);
6209
+ border-radius: var(--fs-radius-pill);
6210
+ cursor: pointer;
6211
+ }
6212
+ /* The knob: a circle 4 px smaller than the track's height, 2 px in from its outer edge. Its position
6213
+ says the state (W2: no glyph). --fs-dur is 0 under reduced motion, so the move is instant there. */
6214
+ .fs-switch__input::before {
6215
+ content: '';
6216
+ position: absolute;
6217
+ inset-block: 0;
6218
+ inset-inline-start: calc(2px - var(--fs-line-width));
6219
+ width: calc(var(--fs-switch-h) - 4px);
6220
+ height: calc(var(--fs-switch-h) - 4px);
6221
+ margin-block: auto;
6222
+ background: var(--fs-line-control-strong);
6223
+ border-radius: 50%;
6224
+ transition: inset-inline-start var(--fs-dur) var(--fs-ease);
6225
+ }
6226
+ .fs-switch__input:checked {
6227
+ background: var(--fs-accent);
6228
+ border-color: var(--fs-accent);
6229
+ }
6230
+ .fs-switch__input:checked::before {
6231
+ inset-inline-start: calc(var(--fs-switch-w) - var(--fs-switch-h) + 2px - var(--fs-line-width));
6232
+ background: var(--fs-bg-surface);
6233
+ }
6234
+
6235
+ @media (hover: hover) {
6236
+ .fs-switch:hover > .fs-switch__input:not(:checked, :disabled) {
6237
+ border-color: var(--fs-ink-2);
6238
+ }
6239
+ }
6240
+
6241
+ /* The ring recipe (D15). */
6242
+ .fs-switch__input:focus-visible {
6243
+ outline: var(--fs-ring-width) solid var(--fs-ring);
6244
+ outline-offset: var(--fs-ring-halo-width);
6245
+ box-shadow: 0 0 0 var(--fs-ring-halo-width) var(--fs-ring-halo);
6246
+ }
6247
+
6248
+ /* Busy (aria-busy on the row): the change is on its way, so the knob keeps its place without motion. */
6249
+ .fs-switch[aria-busy='true'],
6250
+ .fs-switch[aria-busy='true'] > .fs-switch__input {
6251
+ cursor: progress;
6252
+ }
6253
+ .fs-switch[aria-busy='true'] > .fs-switch__input::before {
6254
+ transition: none;
6255
+ }
6256
+
6257
+ /* Disabled comes last. Never opacity. */
6258
+ .fs-switch:has(:disabled) {
6259
+ color: var(--fs-ink-disabled);
6260
+ cursor: not-allowed;
6261
+ }
6262
+ .fs-switch__input:disabled {
6263
+ background: var(--fs-bg-disabled);
6264
+ border-color: var(--fs-line);
6265
+ cursor: not-allowed;
6266
+ }
6267
+ .fs-switch__input:disabled::before {
6268
+ background: var(--fs-ink-disabled);
6269
+ }
6270
+ .fs-switch__input:disabled:checked {
6271
+ background: var(--fs-ink-disabled);
6272
+ border-color: var(--fs-ink-disabled);
6273
+ }
6274
+ .fs-switch__input:disabled:checked::before {
6275
+ background: var(--fs-bg-disabled);
6276
+ }
6277
+
6278
+ /* Forced colours erase the fills, and appearance: auto would draw a checkbox, so the kit keeps its
6279
+ drawing in system colours: the knob's place still tells off from on. */
6280
+ @media (forced-colors: active) {
6281
+ .fs-switch__input {
6282
+ background: Canvas;
6283
+ border-color: CanvasText;
6284
+ }
6285
+ .fs-switch__input::before {
6286
+ background: CanvasText;
6287
+ }
6288
+ .fs-switch__input:checked {
6289
+ background: Highlight;
6290
+ border-color: Highlight;
6291
+ }
6292
+ .fs-switch__input:checked::before {
6293
+ background: HighlightText;
6294
+ }
6295
+ .fs-switch:has(:disabled) {
6296
+ color: GrayText;
6297
+ }
6298
+ .fs-switch__input:disabled,
6299
+ .fs-switch__input:disabled:checked {
6300
+ background: Canvas;
6301
+ border-color: GrayText;
6302
+ }
6303
+ .fs-switch__input:disabled::before,
6304
+ .fs-switch__input:disabled:checked::before {
6305
+ background: GrayText;
6306
+ }
6307
+ }
6308
+ }
6309
+
5839
6310
  /* Tab bar of open objects (spec 02 C, BI App). Usage: tabbar.md. Behaviour: createTabs, closable. */
5840
6311
  @layer fs.components {
5841
6312
  .fs-tabbar {
@@ -0,0 +1,2 @@
1
+ declare const css: string;
2
+ export default css;
@@ -0,0 +1 @@
1
+ export default "/* Custom select (spec 02 B; F2 draft §2, T132): a select-only combobox. Usage: select.md.\n Behaviour: createSelect. The trigger also carries .fs-select__control (input.css), so it takes the\n native select's height, fill, edge, hover, ring and invalid edge; the popup is the completion\n list's .fs-menu--listbox (menu.css). */\n@layer fs.components {\n .fs-select__trigger {\n display: flex;\n align-items: center;\n min-width: 0;\n text-align: left;\n user-select: none;\n }\n .fs-select__value,\n .fs-select__placeholder {\n flex: 1 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .fs-select__placeholder {\n color: var(--fs-ink-muted);\n }\n /* The chevron sits in the trigger's row, whatever else the wrapper holds (the list, a hidden input). */\n .fs-select--listbox::after {\n bottom: auto;\n margin: 0;\n top: calc((var(--fs-control-h) - 16px) / 2);\n }\n .fs-select--listbox:has(> [aria-expanded='true'])::after {\n transform: rotate(180deg);\n }\n\n /* The value's option: weight 600 and a 16 px check at its end (aria-selected marks only the\n current option while open, APG). Every option keeps the check's column, so rows line up. */\n .fs-select--listbox .fs-menu__item[role='option']::after {\n content: '';\n flex: none;\n width: 16px;\n height: 16px;\n margin-left: var(--fs-space-2);\n }\n .fs-select--listbox .fs-menu__item[role='option']:not(:has(.fs-menu__detail))::after {\n margin-left: auto;\n }\n .fs-select--listbox .fs-menu__item.fs-is-value {\n font-weight: var(--fs-weight-semibold);\n }\n .fs-select--listbox .fs-menu__item.fs-is-value::after {\n background-color: var(--fs-accent);\n mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E\")\n center / contain no-repeat;\n }\n\n /* Read-only: no edge, no chevron, the value in full ink (as a read-only input). */\n .fs-select__trigger[aria-readonly='true'] {\n background-color: transparent;\n border-color: transparent;\n cursor: default;\n }\n .fs-select--listbox:has(> [aria-readonly='true'])::after {\n content: none;\n }\n\n /* Disabled last: by colour, never opacity. It stays focusable (aria-disabled). */\n .fs-select__trigger[aria-disabled='true'] {\n color: var(--fs-ink-disabled);\n background-color: var(--fs-bg-disabled);\n border-color: var(--fs-line);\n cursor: not-allowed;\n }\n .fs-select__trigger[aria-disabled='true'] .fs-select__placeholder {\n color: var(--fs-ink-disabled);\n }\n .fs-select--listbox:has(> [aria-disabled='true']) {\n color: var(--fs-ink-disabled);\n }\n\n /* Forced colours: the trigger is a div, so the system draws no control edge for it: give it one.\n The check is drawn in a system colour; the current option keeps the Highlight outline. */\n @media (forced-colors: active) {\n .fs-select__trigger {\n border: var(--fs-line-width) solid ButtonText;\n }\n .fs-select__trigger[aria-readonly='true'] {\n border-color: transparent;\n }\n .fs-select--listbox .fs-menu__item.fs-is-value::after {\n background-color: CanvasText;\n }\n .fs-select--listbox .fs-menu__item[aria-selected='true'] {\n outline-color: Highlight;\n }\n .fs-select__trigger[aria-disabled='true'],\n .fs-select__trigger[aria-disabled='true'] .fs-select__placeholder {\n color: GrayText;\n border-color: GrayText;\n }\n .fs-select--listbox:has(> [aria-disabled='true'])::after {\n background-color: GrayText;\n }\n }\n}\n";
@@ -0,0 +1,2 @@
1
+ declare const css: string;
2
+ export default css;