@tangible/ui 0.0.20 → 0.1.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.
- package/components/Accordion/Accordion.js +1 -1
- package/components/Button/Button.js +6 -8
- package/components/Button/types.d.ts +0 -5
- package/components/Combobox/Combobox.js +2 -2
- package/components/DatePicker/Calendar.d.ts +12 -0
- package/components/DatePicker/Calendar.js +145 -0
- package/components/DatePicker/DatePicker.d.ts +23 -0
- package/components/DatePicker/DatePicker.js +123 -0
- package/components/DatePicker/DateRangePicker.d.ts +16 -0
- package/components/DatePicker/DateRangePicker.js +114 -0
- package/components/DatePicker/date-utils.d.ts +51 -0
- package/components/DatePicker/date-utils.js +228 -0
- package/components/DatePicker/index.d.ts +8 -0
- package/components/DatePicker/index.js +6 -0
- package/components/DatePicker/presets.d.ts +3 -0
- package/components/DatePicker/presets.js +37 -0
- package/components/DatePicker/types.d.ts +138 -0
- package/components/DatePicker/types.js +39 -0
- package/components/MultiSelect/MultiSelect.js +1 -1
- package/components/Notice/Notice.d.ts +2 -2
- package/components/Popover/Popover.js +16 -2
- package/components/SegmentedControl/types.d.ts +2 -2
- package/components/Select/Select.js +2 -2
- package/components/Tabs/Tabs.js +1 -1
- package/components/index.d.ts +1 -0
- package/components/index.js +1 -0
- package/icons/icons.svg +6 -2
- package/icons/lms/index.js +1 -1
- package/icons/manifest.json +32 -0
- package/icons/registry.d.ts +8 -0
- package/icons/registry.js +4 -0
- package/icons/system/index.d.ts +8 -0
- package/icons/system/index.js +45 -1
- package/package.json +5 -1
- package/styles/all.css +1 -1
- package/styles/all.expanded.css +429 -64
- package/styles/all.expanded.unlayered.css +429 -64
- package/styles/all.unlayered.css +1 -1
- package/styles/components/_bundle.scss +2 -0
- package/styles/components/accordion.scss +4 -1
- package/styles/components/button.scss +23 -10
- package/styles/components/card.scss +1 -1
- package/styles/components/chip.scss +36 -11
- package/styles/components/combobox.scss +3 -1
- package/styles/components/date-picker.scss +400 -0
- package/styles/components/icon-button.scss +4 -4
- package/styles/components/icon.scss +14 -3
- package/styles/components/multi-select.scss +5 -2
- package/styles/components/notice.scss +43 -10
- package/styles/components/popover.scss +6 -0
- package/styles/components/progress.scss +22 -5
- package/styles/components/segmented-control.scss +13 -1
- package/styles/components/select.scss +11 -2
- package/styles/components/text-input.scss +5 -1
- package/styles/core.css +1 -1
- package/styles/core.unlayered.css +1 -1
- package/styles/system/_control.scss +9 -8
- package/styles/system/_tokens.scss +3 -0
- package/tui-manifest.json +107 -13
- package/utils/portal.d.ts +0 -4
- package/utils/portal.js +38 -5
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
@use "./chip-group" as chipgroup;
|
|
10
10
|
@use "./combobox" as combobox;
|
|
11
11
|
@use "./content-indicator" as contentindicator;
|
|
12
|
+
@use "./date-picker" as datepicker;
|
|
12
13
|
@use "./dropdown" as dropdown;
|
|
13
14
|
@use "./field" as field;
|
|
14
15
|
@use "./multi-select" as multiselect;
|
|
@@ -72,6 +73,7 @@ $-input-dependents: (input, field, text-input, textarea, pager);
|
|
|
72
73
|
@if -wants($only, chip-group) { @include chipgroup.styles(); }
|
|
73
74
|
@if -wants($only, combobox) { @include combobox.styles(); }
|
|
74
75
|
@if -wants($only, content-indicator) { @include contentindicator.styles(); }
|
|
76
|
+
@if -wants($only, date-picker) { @include datepicker.styles(); }
|
|
75
77
|
@if -wants($only, dropdown) { @include dropdown.styles(); }
|
|
76
78
|
@if -wants($only, field) { @include field.styles(); }
|
|
77
79
|
@if -wants($only, multi-select) { @include multiselect.styles(); }
|
|
@@ -151,10 +151,13 @@
|
|
|
151
151
|
:where(.#{sys.$prefix}interface) .#{sys.$prefix}accordion__indicator {
|
|
152
152
|
flex-shrink: 0;
|
|
153
153
|
color: var(--_indicator);
|
|
154
|
+
// Component-owned size (was Icon size="lg" under the typography-tracking
|
|
155
|
+
// scale): the icon presentation scale has no 20px step, and the chevron
|
|
156
|
+
// sizes with the trigger's type, not the icon scale.
|
|
157
|
+
font-size: var(--#{sys.$prefix}typography-size-lg);
|
|
154
158
|
transition-property: transform;
|
|
155
159
|
transition-duration: var(--#{sys.$prefix}motion-duration);
|
|
156
160
|
transition-timing-function: var(--#{sys.$prefix}motion-timing);
|
|
157
|
-
|
|
158
161
|
}
|
|
159
162
|
|
|
160
163
|
:where(.#{sys.$prefix}interface) .#{sys.$prefix}accordion__trigger[data-state="open"] > .#{sys.$prefix}accordion__indicator {
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
--tui-button-fg-interact
|
|
10
10
|
--tui-button-border-interact
|
|
11
11
|
--tui-button-fg-active
|
|
12
|
+
--tui-button-icon-scale
|
|
13
|
+
--tui-control-height-xs
|
|
12
14
|
--tui-control-height-sm
|
|
13
15
|
--tui-control-height-md
|
|
14
16
|
--tui-control-height-lg
|
|
@@ -16,7 +18,9 @@
|
|
|
16
18
|
|
|
17
19
|
// Structural constants (em-based scaling, not tokenised)
|
|
18
20
|
$_spacing-inline: 1.2em;
|
|
19
|
-
|
|
21
|
+
// Block padding stays under the ladder at every size (the min-height
|
|
22
|
+
// governs; flex centering does the rest). 0.35em keeps sm ≤ 32px.
|
|
23
|
+
$_spacing-block: 0.35em;
|
|
20
24
|
|
|
21
25
|
// Typography defaults
|
|
22
26
|
$_typography-size: var(--#{sys.$prefix}button-font-size, var(--#{sys.$prefix}typography-size-md));
|
|
@@ -35,7 +39,7 @@ $_typography-lineHeight: var(--#{sys.$prefix}button-line-height, 1.4);
|
|
|
35
39
|
align-items: center;
|
|
36
40
|
padding-inline: $_spacing-inline;
|
|
37
41
|
padding-block: $_spacing-block;
|
|
38
|
-
min-height: var(--#{sys.$prefix}control-height-md);
|
|
42
|
+
min-height: var(--#{sys.$prefix}control-height-md, 2.5rem);
|
|
39
43
|
// gap is intentionally em-based (not tokenised) — scales with font-size so
|
|
40
44
|
// icon-to-label spacing stays proportional across size tiers.
|
|
41
45
|
gap: 0.5em;
|
|
@@ -61,6 +65,7 @@ $_typography-lineHeight: var(--#{sys.$prefix}button-line-height, 1.4);
|
|
|
61
65
|
// --tui-button-fg-interact Hover/focus/active foreground
|
|
62
66
|
// --tui-button-border-interact Hover/focus/active border
|
|
63
67
|
// --tui-button-fg-active Active/pressed foreground color
|
|
68
|
+
// --tui-button-icon-scale Icon:label size ratio multiplier (default 1.25)
|
|
64
69
|
// --tui-button-font-weight Font weight
|
|
65
70
|
// --tui-button-line-height Line height for button text
|
|
66
71
|
// --tui-button-font-size Font size for medium button text
|
|
@@ -69,6 +74,7 @@ $_typography-lineHeight: var(--#{sys.$prefix}button-line-height, 1.4);
|
|
|
69
74
|
// --tui-button-font-size-lg Font size for large button text
|
|
70
75
|
//
|
|
71
76
|
// Shared control height tokens (read from .tui-interface scope):
|
|
77
|
+
// --tui-control-height-xs Minimum height for xs controls (dense step)
|
|
72
78
|
// --tui-control-height-sm Minimum height for sm controls
|
|
73
79
|
// --tui-control-height-md Minimum height for md controls
|
|
74
80
|
// --tui-control-height-lg Minimum height for lg controls
|
|
@@ -149,8 +155,13 @@ $_typography-lineHeight: var(--#{sys.$prefix}button-line-height, 1.4);
|
|
|
149
155
|
border-style: solid;
|
|
150
156
|
border-width: var(--#{sys.$prefix}border-width);
|
|
151
157
|
|
|
152
|
-
|
|
153
|
-
|
|
158
|
+
// Icons track the label, never the presentation scale — the [class*=]
|
|
159
|
+
// arm outranks Icon's is-size-* rules so changes to the global icon
|
|
160
|
+
// scale can't reflow buttons. --tui-button-icon-scale adjusts the
|
|
161
|
+
// icon:label ratio (default 1.25).
|
|
162
|
+
.#{sys.$prefix}icon,
|
|
163
|
+
.#{sys.$prefix}icon[class*="is-size-"] {
|
|
164
|
+
font-size: calc(1.25em * var(--#{sys.$prefix}button-icon-scale, 1));
|
|
154
165
|
}
|
|
155
166
|
|
|
156
167
|
// -------------------------------------------------------------------------
|
|
@@ -219,21 +230,23 @@ $_typography-lineHeight: var(--#{sys.$prefix}button-line-height, 1.4);
|
|
|
219
230
|
|
|
220
231
|
&.is-size-lg {
|
|
221
232
|
font-size: var(--#{sys.$prefix}button-font-size-lg, var(--#{sys.$prefix}typography-size-lg));
|
|
222
|
-
min-height: var(--#{sys.$prefix}control-height-lg);
|
|
233
|
+
min-height: var(--#{sys.$prefix}control-height-lg, 3rem);
|
|
223
234
|
}
|
|
224
235
|
|
|
225
236
|
&.is-size-sm {
|
|
226
237
|
font-size: var(--#{sys.$prefix}button-font-size-sm, var(--#{sys.$prefix}typography-size-sm));
|
|
227
|
-
min-height: var(--#{sys.$prefix}control-height-sm);
|
|
238
|
+
min-height: var(--#{sys.$prefix}control-height-sm, 2rem);
|
|
228
239
|
}
|
|
229
240
|
|
|
230
|
-
// xs
|
|
231
|
-
//
|
|
232
|
-
//
|
|
241
|
+
// xs: the ladder's dense step (24px), shared with IconButton via
|
|
242
|
+
// --tui-control-height-xs. Smaller radius to stay proportional; block
|
|
243
|
+
// padding drops to zero so the min-height governs.
|
|
233
244
|
&.is-size-xs {
|
|
234
245
|
--_radius: var(--#{sys.$prefix}button-radius, var(--#{sys.$prefix}radius-sm));
|
|
235
246
|
font-size: var(--#{sys.$prefix}button-font-size-xs, var(--#{sys.$prefix}typography-size-xs));
|
|
236
|
-
padding:
|
|
247
|
+
padding-block: 0;
|
|
248
|
+
padding-inline: var(--#{sys.$prefix}spacing-xxs);
|
|
249
|
+
min-height: var(--#{sys.$prefix}control-height-xs, 1.5rem);
|
|
237
250
|
min-width: 2em;
|
|
238
251
|
}
|
|
239
252
|
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
|
|
36
36
|
:where(.#{sys.$prefix}interface) .#{sys.$prefix}card {
|
|
37
37
|
// Internal tokens — read component API with fallback to primitives
|
|
38
|
-
--_bg: var(--#{sys.$prefix}card-bg, var(--#{sys.$prefix}color-bg
|
|
38
|
+
--_bg: var(--#{sys.$prefix}card-bg, var(--#{sys.$prefix}color-bg));
|
|
39
39
|
--_border: var(--#{sys.$prefix}card-border, var(--#{sys.$prefix}color-border));
|
|
40
40
|
--_border-width: var(--#{sys.$prefix}card-border-width, var(--#{sys.$prefix}border-width));
|
|
41
41
|
--_border-interact: var(--#{sys.$prefix}card-border-interact, var(--#{sys.$prefix}theme-primary-base));
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
--tui-chip-fg
|
|
6
6
|
--tui-chip-border
|
|
7
7
|
--tui-chip-icon
|
|
8
|
+
--tui-chip-icon-scale
|
|
8
9
|
--tui-chip-radius
|
|
9
10
|
--tui-chip-selected-ring
|
|
10
11
|
--tui-chip-icon-slot-bg
|
|
@@ -21,6 +22,7 @@
|
|
|
21
22
|
// --tui-chip-fg Foreground/text color
|
|
22
23
|
// --tui-chip-border Border color
|
|
23
24
|
// --tui-chip-icon Icon color (optional, defaults to inherit)
|
|
25
|
+
// --tui-chip-icon-scale Icon:text size ratio multiplier (default 1.25)
|
|
24
26
|
// --tui-chip-radius Border radius
|
|
25
27
|
// --tui-chip-selected-ring Selected/pressed inset ring width (default: 1px)
|
|
26
28
|
// --tui-chip-icon-slot-bg Icon-slot panel background (used when leftIcon
|
|
@@ -80,8 +82,14 @@
|
|
|
80
82
|
transition-timing-function: var(--#{sys.$prefix}motion-timing);
|
|
81
83
|
transition-property: border-color, color, background-color, filter;
|
|
82
84
|
|
|
83
|
-
|
|
85
|
+
// Icons track the chip text, never the presentation scale — the
|
|
86
|
+
// [class*=] arm outranks Icon's is-size-* rules so changes to the
|
|
87
|
+
// global icon scale can't reflow chips. --tui-chip-icon-scale adjusts
|
|
88
|
+
// the icon:text ratio (default 1.25).
|
|
89
|
+
.#{sys.$prefix}icon,
|
|
90
|
+
.#{sys.$prefix}icon[class*="is-size-"] {
|
|
84
91
|
color: var(--_icon);
|
|
92
|
+
font-size: calc(1em * var(--#{sys.$prefix}chip-icon-scale, 1.25));
|
|
85
93
|
}
|
|
86
94
|
|
|
87
95
|
&:where([aria-disabled="true"], [disabled]) {
|
|
@@ -115,29 +123,46 @@
|
|
|
115
123
|
// -------------------------------------------------------------------------
|
|
116
124
|
// Icon slot — opt-in panel treatment for leftIcon
|
|
117
125
|
// -------------------------------------------------------------------------
|
|
118
|
-
// Wrap a chip's leftIcon in a span with class
|
|
119
|
-
// it its own background fill, a vertical
|
|
120
|
-
// it flush to the chip's
|
|
121
|
-
// where the icon reads as a discrete
|
|
126
|
+
// Wrap a chip's leftIcon or rightIcon in a span with class
|
|
127
|
+
// `tui-chip__icon-slot` to give it its own background fill, a vertical
|
|
128
|
+
// separator from the text, and pull it flush to the chip's edge. Used
|
|
129
|
+
// for utility chips (timers, meters) where the icon reads as a discrete
|
|
130
|
+
// affordance, not just decoration. The bleed direction follows the
|
|
131
|
+
// slot's position: first child bleeds left, last child bleeds right —
|
|
132
|
+
// previously the left bleed applied regardless of position, dragging a
|
|
133
|
+
// rightIcon slot backwards over the label's last character.
|
|
122
134
|
|
|
123
135
|
.#{sys.$prefix}chip__icon-slot {
|
|
124
136
|
align-self: stretch;
|
|
125
137
|
display: inline-flex;
|
|
126
138
|
align-items: center;
|
|
127
139
|
justify-content: center;
|
|
128
|
-
// Pull flush through the chip's own padding.
|
|
129
|
-
margin-inline-start: calc(-1 * #{$_spacing-inline});
|
|
130
140
|
margin-block: calc(-1 * #{$_spacing-block});
|
|
131
|
-
margin-inline-end: calc(#{$_spacing-inline} - #{$_spacing-within});
|
|
132
141
|
padding-inline: 0.4em;
|
|
133
142
|
// Defaults: surface (white in light mode) panel with a darker icon —
|
|
134
143
|
// a subtle "lighter than the chip body" treatment that reads well on
|
|
135
144
|
// the secondary-subtle default chip background.
|
|
136
145
|
background-color: var(--#{sys.$prefix}chip-icon-slot-bg, var(--#{sys.$prefix}color-bg-surface));
|
|
137
146
|
color: var(--#{sys.$prefix}chip-icon-slot-fg, var(--#{sys.$prefix}color-fg));
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
147
|
+
|
|
148
|
+
// Leading slot (leftIcon): pull flush through the chip's start padding.
|
|
149
|
+
&:first-child {
|
|
150
|
+
margin-inline-start: calc(-1 * #{$_spacing-inline});
|
|
151
|
+
margin-inline-end: calc(#{$_spacing-inline} - #{$_spacing-within});
|
|
152
|
+
border-inline-end: var(--#{sys.$prefix}border-width) solid var(--_border);
|
|
153
|
+
border-start-start-radius: calc(var(--_radius) - var(--#{sys.$prefix}border-width));
|
|
154
|
+
border-end-start-radius: calc(var(--_radius) - var(--#{sys.$prefix}border-width));
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Trailing slot (rightIcon): mirrored bleed. An only-child slot takes
|
|
158
|
+
// the leading treatment.
|
|
159
|
+
&:last-child:not(:first-child) {
|
|
160
|
+
margin-inline-end: calc(-1 * #{$_spacing-inline});
|
|
161
|
+
margin-inline-start: calc(#{$_spacing-inline} - #{$_spacing-within});
|
|
162
|
+
border-inline-start: var(--#{sys.$prefix}border-width) solid var(--_border);
|
|
163
|
+
border-start-end-radius: calc(var(--_radius) - var(--#{sys.$prefix}border-width));
|
|
164
|
+
border-end-end-radius: calc(var(--_radius) - var(--#{sys.$prefix}border-width));
|
|
165
|
+
}
|
|
141
166
|
}
|
|
142
167
|
|
|
143
168
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
@use "../system" as sys;
|
|
2
2
|
|
|
3
3
|
/* @tui-tokens
|
|
4
|
+
--tui-combobox-min-width
|
|
4
5
|
--tui-combobox-input-bg
|
|
5
6
|
--tui-combobox-input-fg
|
|
6
7
|
--tui-combobox-input-border
|
|
@@ -192,10 +193,11 @@ $_label-letter-spacing: 0.05em;
|
|
|
192
193
|
--_border: var(--#{sys.$prefix}combobox-content-border, var(--#{sys.$prefix}select-content-border, var(--#{sys.$prefix}color-border)));
|
|
193
194
|
--_shadow: var(--#{sys.$prefix}combobox-content-shadow, var(--#{sys.$prefix}select-content-shadow, var(--#{sys.$prefix}shadow-dropdown)));
|
|
194
195
|
--_radius: var(--#{sys.$prefix}combobox-content-radius, var(--#{sys.$prefix}select-content-radius, var(--#{sys.$prefix}radius-md)));
|
|
196
|
+
--_min-width: var(--#{sys.$prefix}combobox-min-width, var(--#{sys.$prefix}select-min-width, $_min-width));
|
|
195
197
|
|
|
196
198
|
// Layout
|
|
197
199
|
z-index: var(--#{sys.$prefix}layer-top);
|
|
198
|
-
min-width:
|
|
200
|
+
min-width: var(--_min-width);
|
|
199
201
|
padding: var(--#{sys.$prefix}spacing-xxs);
|
|
200
202
|
overflow-y: auto;
|
|
201
203
|
overscroll-behavior: contain;
|
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
@use "../system" as sys;
|
|
2
|
+
|
|
3
|
+
/* @tui-tokens
|
|
4
|
+
--tui-calendar-cell-size
|
|
5
|
+
--tui-calendar-cell-radius
|
|
6
|
+
--tui-calendar-selected-bg
|
|
7
|
+
--tui-calendar-selected-fg
|
|
8
|
+
--tui-calendar-range-bg
|
|
9
|
+
--tui-calendar-today-bg
|
|
10
|
+
--tui-calendar-caption-color
|
|
11
|
+
--tui-date-picker-width
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
@mixin styles() {
|
|
15
|
+
// ==========================================================================
|
|
16
|
+
// Calendar + DatePicker + DateRangePicker
|
|
17
|
+
// ==========================================================================
|
|
18
|
+
//
|
|
19
|
+
// Component API tokens (never defined here, only read via fallback):
|
|
20
|
+
// --tui-calendar-cell-size Day cell square (default 2.5rem)
|
|
21
|
+
// --tui-calendar-cell-radius Day cell radius (default full circle)
|
|
22
|
+
// --tui-calendar-selected-bg Selected/range-endpoint fill
|
|
23
|
+
// --tui-calendar-selected-fg Selected/range-endpoint text
|
|
24
|
+
// --tui-calendar-range-bg In-range day fill
|
|
25
|
+
// --tui-calendar-today-bg Today's fill (unselected)
|
|
26
|
+
// --tui-calendar-caption-color Month/year caption button color
|
|
27
|
+
// --tui-date-picker-width Single-date popover width (default 20rem)
|
|
28
|
+
//
|
|
29
|
+
// ==========================================================================
|
|
30
|
+
|
|
31
|
+
// ---------------------------------------------------------------------------
|
|
32
|
+
// Calendar
|
|
33
|
+
// ---------------------------------------------------------------------------
|
|
34
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}calendar {
|
|
35
|
+
--_cell: var(--#{sys.$prefix}calendar-cell-size, 2.5rem);
|
|
36
|
+
--_cell-radius: var(--#{sys.$prefix}calendar-cell-radius, var(--#{sys.$prefix}radius-full, 999px));
|
|
37
|
+
--_selected-bg: var(--#{sys.$prefix}calendar-selected-bg, var(--#{sys.$prefix}theme-primary-base));
|
|
38
|
+
--_selected-fg: var(--#{sys.$prefix}calendar-selected-fg, var(--#{sys.$prefix}color-fg-on-accent));
|
|
39
|
+
--_range-bg: var(--#{sys.$prefix}calendar-range-bg, var(--#{sys.$prefix}color-bg-muted));
|
|
40
|
+
--_today-bg: var(--#{sys.$prefix}calendar-today-bg, var(--#{sys.$prefix}color-bg-muted));
|
|
41
|
+
--_caption: var(--#{sys.$prefix}calendar-caption-color, var(--#{sys.$prefix}theme-primary-base));
|
|
42
|
+
|
|
43
|
+
display: inline-flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
gap: var(--#{sys.$prefix}spacing-xs);
|
|
46
|
+
|
|
47
|
+
&__nav {
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
justify-content: space-between;
|
|
51
|
+
gap: var(--#{sys.$prefix}spacing-xs);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&__caption {
|
|
55
|
+
border: 0;
|
|
56
|
+
background: none;
|
|
57
|
+
padding: var(--#{sys.$prefix}spacing-xxs) var(--#{sys.$prefix}spacing-xs);
|
|
58
|
+
border-radius: var(--#{sys.$prefix}radius-sm);
|
|
59
|
+
color: var(--_caption);
|
|
60
|
+
font: inherit;
|
|
61
|
+
font-weight: var(--#{sys.$prefix}typography-weight-medium, 600);
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&__caption-year {
|
|
66
|
+
font-weight: var(--#{sys.$prefix}typography-weight-normal, 400);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&__grid {
|
|
70
|
+
border-collapse: collapse;
|
|
71
|
+
|
|
72
|
+
th,
|
|
73
|
+
td {
|
|
74
|
+
padding: 0;
|
|
75
|
+
text-align: center;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&__weekday {
|
|
80
|
+
inline-size: var(--_cell);
|
|
81
|
+
block-size: var(--_cell);
|
|
82
|
+
color: var(--#{sys.$prefix}color-fg-muted);
|
|
83
|
+
font-weight: var(--#{sys.$prefix}typography-weight-normal, 400);
|
|
84
|
+
font-size: var(--#{sys.$prefix}typography-size-sm);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&__day {
|
|
88
|
+
inline-size: var(--_cell);
|
|
89
|
+
block-size: var(--_cell);
|
|
90
|
+
display: inline-flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
border: 0;
|
|
94
|
+
background: none;
|
|
95
|
+
border-radius: var(--_cell-radius);
|
|
96
|
+
color: var(--#{sys.$prefix}color-fg);
|
|
97
|
+
font: inherit;
|
|
98
|
+
cursor: pointer;
|
|
99
|
+
transition-property: background-color, color;
|
|
100
|
+
transition-duration: var(--#{sys.$prefix}motion-duration);
|
|
101
|
+
transition-timing-function: var(--#{sys.$prefix}motion-timing);
|
|
102
|
+
|
|
103
|
+
@media (hover: hover) {
|
|
104
|
+
&:hover {
|
|
105
|
+
background-color: var(--_range-bg);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&[aria-disabled="true"] {
|
|
110
|
+
color: var(--#{sys.$prefix}color-fg-muted);
|
|
111
|
+
opacity: var(--#{sys.$prefix}opacity-disabled);
|
|
112
|
+
cursor: default;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Days that belong to the adjacent months at the grid edges.
|
|
117
|
+
&__cell.is-outside .#{sys.$prefix}calendar__day {
|
|
118
|
+
color: var(--#{sys.$prefix}color-fg-muted);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&__cell.is-today .#{sys.$prefix}calendar__day {
|
|
122
|
+
background-color: var(--_today-bg);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Range fill: a continuous band, so the pill only rounds at its ends.
|
|
126
|
+
&__cell.is-in-range {
|
|
127
|
+
background-color: var(--_range-bg);
|
|
128
|
+
|
|
129
|
+
&:first-child,
|
|
130
|
+
&.is-range-start {
|
|
131
|
+
border-start-start-radius: var(--_cell-radius);
|
|
132
|
+
border-end-start-radius: var(--_cell-radius);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&:last-child,
|
|
136
|
+
&.is-range-end {
|
|
137
|
+
border-start-end-radius: var(--_cell-radius);
|
|
138
|
+
border-end-end-radius: var(--_cell-radius);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&__cell.is-selected .#{sys.$prefix}calendar__day,
|
|
143
|
+
&__cell.is-range-start .#{sys.$prefix}calendar__day,
|
|
144
|
+
&__cell.is-range-end .#{sys.$prefix}calendar__day {
|
|
145
|
+
background-color: var(--_selected-bg);
|
|
146
|
+
color: var(--_selected-fg);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Month/year drill-down view
|
|
150
|
+
&__months {
|
|
151
|
+
display: grid;
|
|
152
|
+
grid-template-columns: repeat(3, 1fr);
|
|
153
|
+
gap: var(--#{sys.$prefix}spacing-xs);
|
|
154
|
+
min-inline-size: calc(var(--_cell) * 7);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&__month {
|
|
158
|
+
border: 0;
|
|
159
|
+
background: none;
|
|
160
|
+
padding: var(--#{sys.$prefix}spacing-sm);
|
|
161
|
+
border-radius: var(--#{sys.$prefix}radius-md);
|
|
162
|
+
color: var(--#{sys.$prefix}color-fg);
|
|
163
|
+
font: inherit;
|
|
164
|
+
cursor: pointer;
|
|
165
|
+
|
|
166
|
+
@media (hover: hover) {
|
|
167
|
+
&:hover {
|
|
168
|
+
background-color: var(--_range-bg);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
&.is-selected {
|
|
173
|
+
background-color: var(--_selected-bg);
|
|
174
|
+
color: var(--_selected-fg);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// ---------------------------------------------------------------------------
|
|
180
|
+
// Shared trigger anatomy (both pickers): input-group button
|
|
181
|
+
// ---------------------------------------------------------------------------
|
|
182
|
+
:where(.#{sys.$prefix}interface)
|
|
183
|
+
:is(.#{sys.$prefix}date-picker__trigger, .#{sys.$prefix}date-range-picker__trigger) {
|
|
184
|
+
cursor: pointer;
|
|
185
|
+
text-align: start;
|
|
186
|
+
min-inline-size: 14rem;
|
|
187
|
+
font: inherit;
|
|
188
|
+
color: var(--#{sys.$prefix}color-fg);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
:where(.#{sys.$prefix}interface)
|
|
192
|
+
:is(.#{sys.$prefix}date-picker__trigger-value, .#{sys.$prefix}date-range-picker__trigger-value) {
|
|
193
|
+
flex: 1 1 auto;
|
|
194
|
+
overflow: hidden;
|
|
195
|
+
text-overflow: ellipsis;
|
|
196
|
+
white-space: nowrap;
|
|
197
|
+
|
|
198
|
+
&.is-placeholder {
|
|
199
|
+
color: var(--#{sys.$prefix}input-fg-placeholder, var(--#{sys.$prefix}color-fg-muted));
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// ---------------------------------------------------------------------------
|
|
204
|
+
// DatePicker popover
|
|
205
|
+
// ---------------------------------------------------------------------------
|
|
206
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}date-picker {
|
|
207
|
+
// The picker root IS the popover panel; the panel's padding rule wins
|
|
208
|
+
// the cascade, so size it via the popover token rather than `padding`.
|
|
209
|
+
--#{sys.$prefix}popover-padding: var(--#{sys.$prefix}spacing-md);
|
|
210
|
+
|
|
211
|
+
display: flex;
|
|
212
|
+
flex-direction: column;
|
|
213
|
+
gap: var(--#{sys.$prefix}spacing-md);
|
|
214
|
+
inline-size: var(--#{sys.$prefix}date-picker-width, 20rem);
|
|
215
|
+
|
|
216
|
+
// When the popover caps its height, scroll — don't compress the rows.
|
|
217
|
+
> * {
|
|
218
|
+
flex-shrink: 0;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
&__head {
|
|
222
|
+
display: flex;
|
|
223
|
+
align-items: center;
|
|
224
|
+
gap: var(--#{sys.$prefix}spacing-xs);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
&__title {
|
|
228
|
+
flex: 1 1 auto;
|
|
229
|
+
font-weight: var(--#{sys.$prefix}typography-weight-medium, 600);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
&__time {
|
|
233
|
+
display: flex;
|
|
234
|
+
align-items: stretch;
|
|
235
|
+
gap: var(--#{sys.$prefix}spacing-sm);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// In this row the AM/PM switcher sits as a peer control: input radius,
|
|
239
|
+
// control height (stretched to the control-sized time field).
|
|
240
|
+
&__meridiem {
|
|
241
|
+
--#{sys.$prefix}segmented-radius: var(--#{sys.$prefix}input-radius, var(--#{sys.$prefix}radius-md));
|
|
242
|
+
--#{sys.$prefix}segmented-item-radius: calc(
|
|
243
|
+
var(--#{sys.$prefix}input-radius, var(--#{sys.$prefix}radius-md)) - var(--#{sys.$prefix}spacing-xxs)
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
&__time-field {
|
|
248
|
+
// Control-sized and input-surfaced so the box matches the
|
|
249
|
+
// month/day/year controls exactly.
|
|
250
|
+
@include sys.control-sizing(sys.$prefix);
|
|
251
|
+
|
|
252
|
+
display: inline-flex;
|
|
253
|
+
align-items: center;
|
|
254
|
+
background-color: var(--#{sys.$prefix}input-bg, var(--#{sys.$prefix}color-bg-surface));
|
|
255
|
+
border: var(--#{sys.$prefix}border-width) solid
|
|
256
|
+
var(--#{sys.$prefix}input-border, var(--#{sys.$prefix}color-border));
|
|
257
|
+
border-radius: var(--#{sys.$prefix}input-radius, var(--#{sys.$prefix}radius-md));
|
|
258
|
+
padding-inline: var(--#{sys.$prefix}spacing-sm);
|
|
259
|
+
|
|
260
|
+
.#{sys.$prefix}input {
|
|
261
|
+
border: 0;
|
|
262
|
+
min-height: 0;
|
|
263
|
+
inline-size: 2.5ch;
|
|
264
|
+
padding-inline: 0;
|
|
265
|
+
text-align: center;
|
|
266
|
+
background: transparent;
|
|
267
|
+
|
|
268
|
+
&:focus-visible {
|
|
269
|
+
outline: none;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
&:focus-within {
|
|
274
|
+
border-color: var(--#{sys.$prefix}input-border-focus, var(--#{sys.$prefix}theme-primary-base));
|
|
275
|
+
outline: var(--#{sys.$prefix}focus-ring-width) solid var(--#{sys.$prefix}focus-ring-color);
|
|
276
|
+
outline-offset: var(--#{sys.$prefix}focus-ring-offset);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
&__time-colon {
|
|
281
|
+
color: var(--#{sys.$prefix}color-fg-muted);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
&__zone {
|
|
285
|
+
margin-inline-start: auto;
|
|
286
|
+
align-self: center;
|
|
287
|
+
color: var(--#{sys.$prefix}color-fg-muted);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
&__fields {
|
|
291
|
+
display: flex;
|
|
292
|
+
align-items: stretch;
|
|
293
|
+
gap: var(--#{sys.$prefix}spacing-sm);
|
|
294
|
+
|
|
295
|
+
.#{sys.$prefix}date-picker__month {
|
|
296
|
+
flex: 1 1 auto;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.#{sys.$prefix}date-picker__day-field {
|
|
300
|
+
inline-size: 3.5rem;
|
|
301
|
+
text-align: center;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.#{sys.$prefix}date-picker__year-field {
|
|
305
|
+
inline-size: 4.5rem;
|
|
306
|
+
text-align: center;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// ---------------------------------------------------------------------------
|
|
312
|
+
// DateRangePicker popover
|
|
313
|
+
// ---------------------------------------------------------------------------
|
|
314
|
+
:where(.#{sys.$prefix}interface) .#{sys.$prefix}date-range-picker {
|
|
315
|
+
// Two calendars + presets need more room than the popover default; and
|
|
316
|
+
// the body/foot own their padding, so zero the panel's (the picker root
|
|
317
|
+
// IS the popover panel — its padding would stack with theirs).
|
|
318
|
+
--#{sys.$prefix}popover-max-width: calc(100vw - 32px);
|
|
319
|
+
--#{sys.$prefix}popover-padding: 0;
|
|
320
|
+
|
|
321
|
+
display: flex;
|
|
322
|
+
flex-direction: column;
|
|
323
|
+
inline-size: max-content;
|
|
324
|
+
max-inline-size: 100%;
|
|
325
|
+
|
|
326
|
+
// When the popover caps its height, scroll — don't compress the rows.
|
|
327
|
+
> * {
|
|
328
|
+
flex-shrink: 0;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
&__body {
|
|
332
|
+
display: flex;
|
|
333
|
+
align-items: flex-start;
|
|
334
|
+
gap: var(--#{sys.$prefix}spacing-lg);
|
|
335
|
+
padding: var(--#{sys.$prefix}spacing-md);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
&__presets {
|
|
339
|
+
display: flex;
|
|
340
|
+
flex-direction: column;
|
|
341
|
+
align-items: flex-start;
|
|
342
|
+
gap: var(--#{sys.$prefix}spacing-xxs);
|
|
343
|
+
padding-block-start: var(--#{sys.$prefix}spacing-xs);
|
|
344
|
+
|
|
345
|
+
.#{sys.$prefix}date-range-picker__preset {
|
|
346
|
+
white-space: nowrap;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
&__main {
|
|
351
|
+
display: flex;
|
|
352
|
+
flex-direction: column;
|
|
353
|
+
gap: var(--#{sys.$prefix}spacing-md);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
&__fields {
|
|
357
|
+
display: flex;
|
|
358
|
+
align-items: flex-end;
|
|
359
|
+
gap: var(--#{sys.$prefix}spacing-sm);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
&__field {
|
|
363
|
+
flex: 1 1 auto;
|
|
364
|
+
display: flex;
|
|
365
|
+
flex-direction: column;
|
|
366
|
+
gap: var(--#{sys.$prefix}spacing-xxs);
|
|
367
|
+
// Override the .tui-interface bold-label default; the field name is a
|
|
368
|
+
// small caps-style eyebrow, not a form label.
|
|
369
|
+
font-weight: var(--#{sys.$prefix}typography-weight-normal, 400);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
&__field-label {
|
|
373
|
+
color: var(--#{sys.$prefix}color-fg-muted);
|
|
374
|
+
font-size: var(--#{sys.$prefix}typography-size-xs);
|
|
375
|
+
font-weight: var(--#{sys.$prefix}typography-weight-medium, 600);
|
|
376
|
+
letter-spacing: 0.05em;
|
|
377
|
+
text-transform: uppercase;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
&__fields-dash {
|
|
381
|
+
color: var(--#{sys.$prefix}color-fg-muted);
|
|
382
|
+
padding-block-end: var(--#{sys.$prefix}spacing-sm);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
&__calendars {
|
|
386
|
+
display: flex;
|
|
387
|
+
align-items: flex-start;
|
|
388
|
+
gap: var(--#{sys.$prefix}spacing-lg);
|
|
389
|
+
flex-wrap: wrap;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
&__foot {
|
|
393
|
+
display: flex;
|
|
394
|
+
justify-content: flex-end;
|
|
395
|
+
gap: var(--#{sys.$prefix}spacing-sm);
|
|
396
|
+
padding: var(--#{sys.$prefix}spacing-md);
|
|
397
|
+
border-block-start: var(--#{sys.$prefix}border-width) solid var(--#{sys.$prefix}color-border);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
// ---------------------------------------------------------------------------
|
|
34
34
|
//
|
|
35
35
|
// Size xs:
|
|
36
|
-
// xs (24px) is
|
|
37
|
-
// Uses a smaller radius fallback (radius-sm)
|
|
36
|
+
// xs (24px) is the ladder's dense step, shared with Button via
|
|
37
|
+
// --tui-control-height-xs. Uses a smaller radius fallback (radius-sm).
|
|
38
38
|
// At 24px, this is below WCAG 2.5.8's 24×24 CSS pixel minimum for pointer
|
|
39
39
|
// targets. Acceptable inside toolbars with adequate spacing; add padding or
|
|
40
40
|
// min-size when used standalone on touch interfaces.
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
// ==========================================================================
|
|
48
48
|
|
|
49
49
|
// Size defaults (used as fallbacks when control-height tokens aren't set)
|
|
50
|
-
$_size-xs: 1.5rem; // 24px —
|
|
50
|
+
$_size-xs: 1.5rem; // 24px — dense step, shared token --tui-control-height-xs
|
|
51
51
|
$_size-sm: 2rem; // 32px
|
|
52
52
|
$_size-md: 2.5rem; // 40px
|
|
53
53
|
$_size-lg: 3rem; // 48px
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
// Sizes
|
|
146
146
|
// -------------------------------------------------------------------------
|
|
147
147
|
&.is-size-xs {
|
|
148
|
-
--_size: #{$_size-xs};
|
|
148
|
+
--_size: var(--#{sys.$prefix}control-height-xs, #{$_size-xs});
|
|
149
149
|
--_radius: var(--#{sys.$prefix}icon-button-radius, var(--#{sys.$prefix}radius-sm));
|
|
150
150
|
}
|
|
151
151
|
|