@tangible/ui 0.0.21 → 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/Button/Button.js +6 -8
- package/components/Button/types.d.ts +0 -5
- 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/Popover/Popover.js +16 -2
- package/components/SegmentedControl/types.d.ts +2 -2
- package/components/index.d.ts +1 -0
- package/components/index.js +1 -0
- package/package.json +5 -1
- package/styles/all.css +1 -1
- package/styles/all.expanded.css +384 -47
- package/styles/all.expanded.unlayered.css +384 -47
- package/styles/all.unlayered.css +1 -1
- package/styles/components/_bundle.scss +2 -0
- package/styles/components/button.scss +14 -8
- package/styles/components/card.scss +1 -1
- package/styles/components/chip.scss +27 -10
- package/styles/components/date-picker.scss +400 -0
- package/styles/components/icon-button.scss +4 -4
- package/styles/components/notice.scss +15 -6
- package/styles/components/popover.scss +6 -0
- package/styles/components/progress.scss +22 -5
- package/styles/components/segmented-control.scss +13 -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 +98 -10
- 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(); }
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
--tui-button-border-interact
|
|
11
11
|
--tui-button-fg-active
|
|
12
12
|
--tui-button-icon-scale
|
|
13
|
+
--tui-control-height-xs
|
|
13
14
|
--tui-control-height-sm
|
|
14
15
|
--tui-control-height-md
|
|
15
16
|
--tui-control-height-lg
|
|
@@ -17,7 +18,9 @@
|
|
|
17
18
|
|
|
18
19
|
// Structural constants (em-based scaling, not tokenised)
|
|
19
20
|
$_spacing-inline: 1.2em;
|
|
20
|
-
|
|
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;
|
|
21
24
|
|
|
22
25
|
// Typography defaults
|
|
23
26
|
$_typography-size: var(--#{sys.$prefix}button-font-size, var(--#{sys.$prefix}typography-size-md));
|
|
@@ -36,7 +39,7 @@ $_typography-lineHeight: var(--#{sys.$prefix}button-line-height, 1.4);
|
|
|
36
39
|
align-items: center;
|
|
37
40
|
padding-inline: $_spacing-inline;
|
|
38
41
|
padding-block: $_spacing-block;
|
|
39
|
-
min-height: var(--#{sys.$prefix}control-height-md);
|
|
42
|
+
min-height: var(--#{sys.$prefix}control-height-md, 2.5rem);
|
|
40
43
|
// gap is intentionally em-based (not tokenised) — scales with font-size so
|
|
41
44
|
// icon-to-label spacing stays proportional across size tiers.
|
|
42
45
|
gap: 0.5em;
|
|
@@ -71,6 +74,7 @@ $_typography-lineHeight: var(--#{sys.$prefix}button-line-height, 1.4);
|
|
|
71
74
|
// --tui-button-font-size-lg Font size for large button text
|
|
72
75
|
//
|
|
73
76
|
// Shared control height tokens (read from .tui-interface scope):
|
|
77
|
+
// --tui-control-height-xs Minimum height for xs controls (dense step)
|
|
74
78
|
// --tui-control-height-sm Minimum height for sm controls
|
|
75
79
|
// --tui-control-height-md Minimum height for md controls
|
|
76
80
|
// --tui-control-height-lg Minimum height for lg controls
|
|
@@ -226,21 +230,23 @@ $_typography-lineHeight: var(--#{sys.$prefix}button-line-height, 1.4);
|
|
|
226
230
|
|
|
227
231
|
&.is-size-lg {
|
|
228
232
|
font-size: var(--#{sys.$prefix}button-font-size-lg, var(--#{sys.$prefix}typography-size-lg));
|
|
229
|
-
min-height: var(--#{sys.$prefix}control-height-lg);
|
|
233
|
+
min-height: var(--#{sys.$prefix}control-height-lg, 3rem);
|
|
230
234
|
}
|
|
231
235
|
|
|
232
236
|
&.is-size-sm {
|
|
233
237
|
font-size: var(--#{sys.$prefix}button-font-size-sm, var(--#{sys.$prefix}typography-size-sm));
|
|
234
|
-
min-height: var(--#{sys.$prefix}control-height-sm);
|
|
238
|
+
min-height: var(--#{sys.$prefix}control-height-sm, 2rem);
|
|
235
239
|
}
|
|
236
240
|
|
|
237
|
-
// xs
|
|
238
|
-
//
|
|
239
|
-
//
|
|
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.
|
|
240
244
|
&.is-size-xs {
|
|
241
245
|
--_radius: var(--#{sys.$prefix}button-radius, var(--#{sys.$prefix}radius-sm));
|
|
242
246
|
font-size: var(--#{sys.$prefix}button-font-size-xs, var(--#{sys.$prefix}typography-size-xs));
|
|
243
|
-
padding:
|
|
247
|
+
padding-block: 0;
|
|
248
|
+
padding-inline: var(--#{sys.$prefix}spacing-xxs);
|
|
249
|
+
min-height: var(--#{sys.$prefix}control-height-xs, 1.5rem);
|
|
244
250
|
min-width: 2em;
|
|
245
251
|
}
|
|
246
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));
|
|
@@ -123,29 +123,46 @@
|
|
|
123
123
|
// -------------------------------------------------------------------------
|
|
124
124
|
// Icon slot — opt-in panel treatment for leftIcon
|
|
125
125
|
// -------------------------------------------------------------------------
|
|
126
|
-
// Wrap a chip's leftIcon in a span with class
|
|
127
|
-
// it its own background fill, a vertical
|
|
128
|
-
// it flush to the chip's
|
|
129
|
-
// 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.
|
|
130
134
|
|
|
131
135
|
.#{sys.$prefix}chip__icon-slot {
|
|
132
136
|
align-self: stretch;
|
|
133
137
|
display: inline-flex;
|
|
134
138
|
align-items: center;
|
|
135
139
|
justify-content: center;
|
|
136
|
-
// Pull flush through the chip's own padding.
|
|
137
|
-
margin-inline-start: calc(-1 * #{$_spacing-inline});
|
|
138
140
|
margin-block: calc(-1 * #{$_spacing-block});
|
|
139
|
-
margin-inline-end: calc(#{$_spacing-inline} - #{$_spacing-within});
|
|
140
141
|
padding-inline: 0.4em;
|
|
141
142
|
// Defaults: surface (white in light mode) panel with a darker icon —
|
|
142
143
|
// a subtle "lighter than the chip body" treatment that reads well on
|
|
143
144
|
// the secondary-subtle default chip background.
|
|
144
145
|
background-color: var(--#{sys.$prefix}chip-icon-slot-bg, var(--#{sys.$prefix}color-bg-surface));
|
|
145
146
|
color: var(--#{sys.$prefix}chip-icon-slot-fg, var(--#{sys.$prefix}color-fg));
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
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
|
+
}
|
|
149
166
|
}
|
|
150
167
|
|
|
151
168
|
|
|
@@ -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
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
/* @tui-tokens
|
|
4
4
|
--tui-notice-bg
|
|
5
5
|
--tui-notice-border
|
|
6
|
+
--tui-notice-border-width
|
|
6
7
|
--tui-notice-stripe
|
|
7
8
|
--tui-notice-stripe-width
|
|
8
9
|
--tui-notice-fg
|
|
@@ -20,6 +21,7 @@
|
|
|
20
21
|
// Component API tokens (never defined here, only read via fallback):
|
|
21
22
|
// --tui-notice-bg Background color
|
|
22
23
|
// --tui-notice-border Border color
|
|
24
|
+
// --tui-notice-border-width Border width (default: bold; standard with stripe)
|
|
23
25
|
// --tui-notice-stripe Stripe color (left edge, when enabled)
|
|
24
26
|
// --tui-notice-stripe-width Stripe width (default 4px)
|
|
25
27
|
// --tui-notice-fg Text color
|
|
@@ -40,6 +42,10 @@
|
|
|
40
42
|
--_stripe: var(--#{sys.$prefix}notice-stripe, var(--#{sys.$prefix}theme-primary-base));
|
|
41
43
|
--_fg: var(--#{sys.$prefix}notice-fg, inherit);
|
|
42
44
|
--_radius: var(--#{sys.$prefix}notice-radius, var(--#{sys.$prefix}radius-md));
|
|
45
|
+
// One emphasis device per panel: plain notices carry the bold border;
|
|
46
|
+
// the stripe variant already has its accent bar, so it keeps the
|
|
47
|
+
// standard width (see has-stripe below).
|
|
48
|
+
--_border-width: var(--#{sys.$prefix}notice-border-width, var(--#{sys.$prefix}border-width-bold, 2px));
|
|
43
49
|
--_padding: var(--#{sys.$prefix}notice-padding, var(--#{sys.$prefix}spacing-md));
|
|
44
50
|
--_foot-basis: var(--#{sys.$prefix}notice-foot-basis, 500px);
|
|
45
51
|
|
|
@@ -52,7 +58,7 @@
|
|
|
52
58
|
position: relative;
|
|
53
59
|
width: 100%;
|
|
54
60
|
border-style: solid;
|
|
55
|
-
border-width: var(
|
|
61
|
+
border-width: var(--_border-width);
|
|
56
62
|
border-color: var(--_border);
|
|
57
63
|
border-radius: var(--_radius);
|
|
58
64
|
background-color: var(--_bg);
|
|
@@ -265,6 +271,7 @@
|
|
|
265
271
|
// Uses a pseudo-element instead of border-inline-start so the stripe
|
|
266
272
|
// doesn't interact with border-radius geometry or border-width changes.
|
|
267
273
|
&.has-stripe {
|
|
274
|
+
--_border-width: var(--#{sys.$prefix}notice-border-width, var(--#{sys.$prefix}border-width, 1px));
|
|
268
275
|
overflow: hidden; // clip pseudo to border-radius
|
|
269
276
|
padding-inline-start: var(--#{sys.$prefix}notice-stripe-width, 4px);
|
|
270
277
|
|
|
@@ -286,12 +293,14 @@
|
|
|
286
293
|
// as its hover bg), so hosts can theme borders per-notice via
|
|
287
294
|
// --tui-notice-border or just widen border-width and get a colour that
|
|
288
295
|
// matches the theme.
|
|
296
|
+
// Reads the info ladder (palette-identical to primary today, but info
|
|
297
|
+
// semantics stay on info tokens so the two can ever diverge).
|
|
289
298
|
&.is-theme-info {
|
|
290
|
-
--_bg: var(--#{sys.$prefix}notice-bg, var(--#{sys.$prefix}theme-
|
|
291
|
-
--_bg-hover: var(--#{sys.$prefix}theme-
|
|
292
|
-
--_border: var(--#{sys.$prefix}notice-border, var(--#{sys.$prefix}theme-
|
|
293
|
-
--_stripe: var(--#{sys.$prefix}notice-stripe, var(--#{sys.$prefix}theme-
|
|
294
|
-
--_icon-color: var(--#{sys.$prefix}theme-
|
|
299
|
+
--_bg: var(--#{sys.$prefix}notice-bg, var(--#{sys.$prefix}theme-info-subtlest));
|
|
300
|
+
--_bg-hover: var(--#{sys.$prefix}theme-info-subtle);
|
|
301
|
+
--_border: var(--#{sys.$prefix}notice-border, var(--#{sys.$prefix}theme-info-subtle));
|
|
302
|
+
--_stripe: var(--#{sys.$prefix}notice-stripe, var(--#{sys.$prefix}theme-info-base));
|
|
303
|
+
--_icon-color: var(--#{sys.$prefix}theme-info-base);
|
|
295
304
|
}
|
|
296
305
|
|
|
297
306
|
&.is-theme-success {
|
|
@@ -48,6 +48,12 @@
|
|
|
48
48
|
z-index: var(--_z);
|
|
49
49
|
min-width: var(--#{sys.$prefix}popover-min-width, 200px);
|
|
50
50
|
max-width: var(--#{sys.$prefix}popover-max-width, min(360px, calc(100vw - 32px)));
|
|
51
|
+
// Written by the size middleware (output var, not an API token): when
|
|
52
|
+
// content is taller than the space at the best placement, the panel
|
|
53
|
+
// caps itself and scrolls instead of overflowing the viewport.
|
|
54
|
+
max-block-size: var(--#{sys.$prefix}popover-available-height, none);
|
|
55
|
+
overflow-y: auto;
|
|
56
|
+
overscroll-behavior: contain;
|
|
51
57
|
padding: var(--#{sys.$prefix}popover-padding, var(--#{sys.$prefix}spacing-sm, 12px));
|
|
52
58
|
box-sizing: border-box;
|
|
53
59
|
pointer-events: auto;
|