@alulore/kumiko 0.0.0-stage → 0.14.1
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/dist/badge/badge.css +287 -0
- package/dist/badge/badge.d.ts +40 -0
- package/dist/badge/badge.js +51 -0
- package/dist/badge/index.d.ts +1 -0
- package/dist/badge/index.js +1 -0
- package/dist/board/board-api.d.ts +147 -0
- package/dist/board/board-api.js +139 -0
- package/dist/board/board-card-menu.d.ts +17 -0
- package/dist/board/board-card-menu.js +53 -0
- package/dist/board/board-drag-events.d.ts +12 -0
- package/dist/board/board-drag-events.js +86 -0
- package/dist/board/board-fold.d.ts +10 -0
- package/dist/board/board-fold.js +30 -0
- package/dist/board/board-group.d.ts +10 -0
- package/dist/board/board-group.js +28 -0
- package/dist/board/board-keys.d.ts +16 -0
- package/dist/board/board-keys.js +65 -0
- package/dist/board/board-locked-rows.d.ts +23 -0
- package/dist/board/board-locked-rows.js +77 -0
- package/dist/board/board-motion.d.ts +7 -0
- package/dist/board/board-motion.js +102 -0
- package/dist/board/board-primitive.d.ts +53 -0
- package/dist/board/board-primitive.js +66 -0
- package/dist/board/board-pull.d.ts +6 -0
- package/dist/board/board-pull.js +94 -0
- package/dist/board/board-selection.d.ts +42 -0
- package/dist/board/board-selection.js +130 -0
- package/dist/board/board-slots.d.ts +1003 -0
- package/dist/board/board-slots.js +250 -0
- package/dist/board/board-types.d.ts +99 -0
- package/dist/board/board-types.js +1 -0
- package/dist/board/board.css +343 -0
- package/dist/board/board.d.ts +290 -0
- package/dist/board/board.js +23 -0
- package/dist/board/card-menu.d.ts +21 -0
- package/dist/board/card-menu.js +79 -0
- package/dist/board/cell-key.d.ts +6 -0
- package/dist/board/cell-key.js +16 -0
- package/dist/board/index.d.ts +6 -0
- package/dist/board/index.js +5 -0
- package/dist/board/interactive.d.ts +18 -0
- package/dist/board/interactive.js +51 -0
- package/dist/board/keep-capture.d.ts +16 -0
- package/dist/board/keep-capture.js +57 -0
- package/dist/board/landing.d.ts +5 -0
- package/dist/board/landing.js +10 -0
- package/dist/board/press-to-drop.d.ts +9 -0
- package/dist/board/press-to-drop.js +28 -0
- package/dist/board/refused-home.d.ts +16 -0
- package/dist/board/refused-home.js +50 -0
- package/dist/board/repeat-gate.d.ts +4 -0
- package/dist/board/repeat-gate.js +12 -0
- package/dist/board/scrollbar-gutter.d.ts +1 -0
- package/dist/board/scrollbar-gutter.js +27 -0
- package/dist/board/touch-hold.d.ts +19 -0
- package/dist/board/touch-hold.js +103 -0
- package/dist/button/button.css +576 -0
- package/dist/button/button.d.ts +50 -0
- package/dist/button/button.js +70 -0
- package/dist/button/index.d.ts +2 -0
- package/dist/button/index.js +1 -0
- package/dist/checkbox/checkbox-mark.d.ts +8 -0
- package/dist/checkbox/checkbox-mark.js +17 -0
- package/dist/checkbox/checkbox-marks.d.ts +33 -0
- package/dist/checkbox/checkbox-marks.js +30 -0
- package/dist/checkbox/checkbox.css +201 -0
- package/dist/checkbox/checkbox.d.ts +26 -0
- package/dist/checkbox/checkbox.js +11 -0
- package/dist/checkbox/index.d.ts +3 -0
- package/dist/checkbox/index.js +3 -0
- package/dist/chip/chip.css +251 -0
- package/dist/chip/chip.d.ts +39 -0
- package/dist/chip/chip.js +25 -0
- package/dist/chip/index.d.ts +1 -0
- package/dist/chip/index.js +1 -0
- package/dist/dialog/dialog.css +247 -0
- package/dist/dialog/index.d.ts +3 -0
- package/dist/dialog/index.js +3 -0
- package/dist/hover-card/hover-card.css +149 -0
- package/dist/hover-card/hover-card.d.ts +3 -0
- package/dist/hover-card/hover-card.js +8 -0
- package/dist/hover-card/index.d.ts +2 -0
- package/dist/hover-card/index.js +2 -0
- package/dist/input/index.d.ts +5 -0
- package/dist/input/index.js +5 -0
- package/dist/input/input-attributes.d.ts +12 -0
- package/dist/input/input-attributes.js +9 -0
- package/dist/input/input.css +752 -0
- package/dist/input/input.d.ts +28 -0
- package/dist/input/input.js +9 -0
- package/dist/input/search-input.d.ts +41 -0
- package/dist/input/search-input.js +47 -0
- package/dist/kbd/index.d.ts +1 -0
- package/dist/kbd/index.js +1 -0
- package/dist/kbd/kbd.css +77 -0
- package/dist/kbd/kbd.d.ts +21 -0
- package/dist/kbd/kbd.js +37 -0
- package/dist/label/index.d.ts +1 -0
- package/dist/label/index.js +1 -0
- package/dist/label/label.css +37 -0
- package/dist/label/label.d.ts +13 -0
- package/dist/label/label.js +10 -0
- package/dist/menu/index.d.ts +3 -0
- package/dist/menu/index.js +3 -0
- package/dist/menu/menu.css +349 -0
- package/dist/menu/menu.d.ts +11 -0
- package/dist/menu/menu.js +86 -0
- package/dist/menu/point-menu.d.ts +26 -0
- package/dist/menu/point-menu.js +51 -0
- package/dist/motion/flip-math.d.ts +19 -0
- package/dist/motion/flip-math.js +33 -0
- package/dist/motion/flip.d.ts +40 -0
- package/dist/motion/flip.js +203 -0
- package/dist/motion/index.d.ts +2 -0
- package/dist/motion/index.js +2 -0
- package/dist/motion/motion.css +169 -0
- package/dist/popover/index.d.ts +1 -0
- package/dist/popover/index.js +1 -0
- package/dist/popover/popover.css +208 -0
- package/dist/progress/index.d.ts +2 -0
- package/dist/progress/index.js +2 -0
- package/dist/progress/progress.css +390 -0
- package/dist/progress/progress.d.ts +36 -0
- package/dist/progress/progress.js +107 -0
- package/dist/select/index.d.ts +3 -0
- package/dist/select/index.js +2 -0
- package/dist/select/select-labels.d.ts +6 -0
- package/dist/select/select-labels.js +64 -0
- package/dist/select/select-search.d.ts +18 -0
- package/dist/select/select-search.js +10 -0
- package/dist/select/select.css +470 -0
- package/dist/select/select.d.ts +44 -0
- package/dist/select/select.js +92 -0
- package/dist/separator/index.d.ts +2 -0
- package/dist/separator/index.js +1 -0
- package/dist/separator/separator.css +32 -0
- package/dist/separator/separator.d.ts +17 -0
- package/dist/separator/separator.js +10 -0
- package/dist/slider/index.d.ts +2 -0
- package/dist/slider/index.js +2 -0
- package/dist/slider/slider-bubble.css +203 -0
- package/dist/slider/slider-feel.d.ts +33 -0
- package/dist/slider/slider-feel.js +153 -0
- package/dist/slider/slider-format.d.ts +13 -0
- package/dist/slider/slider-format.js +15 -0
- package/dist/slider/slider-marks.d.ts +16 -0
- package/dist/slider/slider-marks.js +32 -0
- package/dist/slider/slider.css +335 -0
- package/dist/slider/slider.d.ts +34 -0
- package/dist/slider/slider.js +94 -0
- package/dist/smooth-caret/caret-box.d.ts +7 -0
- package/dist/smooth-caret/caret-box.js +8 -0
- package/dist/smooth-caret/caret-controller.d.ts +7 -0
- package/dist/smooth-caret/caret-controller.js +222 -0
- package/dist/smooth-caret/caret-geometry.d.ts +11 -0
- package/dist/smooth-caret/caret-geometry.js +230 -0
- package/dist/smooth-caret/caret-glide.d.ts +13 -0
- package/dist/smooth-caret/caret-glide.js +76 -0
- package/dist/smooth-caret/caret-host.d.ts +5 -0
- package/dist/smooth-caret/caret-host.js +40 -0
- package/dist/smooth-caret/index.d.ts +7 -0
- package/dist/smooth-caret/index.js +7 -0
- package/dist/smooth-caret/remote-carets.d.ts +40 -0
- package/dist/smooth-caret/remote-carets.js +130 -0
- package/dist/smooth-caret/smooth-caret.css +157 -0
- package/dist/smooth-caret/smooth-caret.d.ts +5 -0
- package/dist/smooth-caret/smooth-caret.js +9 -0
- package/dist/smooth-caret/use-smooth-caret.d.ts +5 -0
- package/dist/smooth-caret/use-smooth-caret.js +9 -0
- package/dist/switch/index.d.ts +2 -0
- package/dist/switch/index.js +2 -0
- package/dist/switch/switch-drag.d.ts +21 -0
- package/dist/switch/switch-drag.js +23 -0
- package/dist/switch/switch-gesture.d.ts +28 -0
- package/dist/switch/switch-gesture.js +131 -0
- package/dist/switch/switch.css +189 -0
- package/dist/switch/switch.d.ts +15 -0
- package/dist/switch/switch.js +24 -0
- package/dist/textarea/index.d.ts +2 -0
- package/dist/textarea/index.js +2 -0
- package/dist/textarea/textarea.css +37 -0
- package/dist/textarea/textarea.d.ts +35 -0
- package/dist/textarea/textarea.js +11 -0
- package/dist/toast/index.d.ts +2 -0
- package/dist/toast/index.js +2 -0
- package/dist/toast/toast.css +293 -0
- package/dist/tooltip/index.d.ts +2 -0
- package/dist/tooltip/index.js +2 -0
- package/dist/tooltip/tooltip.css +143 -0
- package/dist/tooltip/tooltip.d.ts +14 -0
- package/dist/tooltip/tooltip.js +13 -0
- package/package.json +246 -5
- package/README.md +0 -3
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
@import "../motion/motion.css";
|
|
2
|
+
@import "../tooltip/tooltip.css";
|
|
3
|
+
|
|
4
|
+
@layer kumiko {
|
|
5
|
+
:where(:root) {
|
|
6
|
+
--kumiko-select-trigger-bg: Canvas;
|
|
7
|
+
--kumiko-select-trigger-fg: CanvasText;
|
|
8
|
+
--kumiko-select-trigger-border-width: 1px;
|
|
9
|
+
--kumiko-select-trigger-radius: 0.5rem;
|
|
10
|
+
--kumiko-select-trigger-padding: 0.4rem 0.75rem;
|
|
11
|
+
--kumiko-select-trigger-min-height: 2.25rem;
|
|
12
|
+
--kumiko-select-trigger-font-size: 0.875rem;
|
|
13
|
+
--kumiko-select-trigger-font-weight: 400;
|
|
14
|
+
--kumiko-select-focus-ring: Highlight;
|
|
15
|
+
--kumiko-select-trigger-max-width: 20rem;
|
|
16
|
+
--kumiko-select-chevron-size: 0.5rem;
|
|
17
|
+
--kumiko-select-disabled-opacity: 0.5;
|
|
18
|
+
--kumiko-select-content-bg: Canvas;
|
|
19
|
+
--kumiko-select-content-fg: CanvasText;
|
|
20
|
+
--kumiko-select-content-border-width: 1px;
|
|
21
|
+
--kumiko-select-content-radius: 0.625rem;
|
|
22
|
+
--kumiko-select-content-shadow: 0 10px 28px -8px
|
|
23
|
+
color-mix(in oklab, CanvasText 30%, transparent);
|
|
24
|
+
--kumiko-select-content-padding: 0.25rem;
|
|
25
|
+
--kumiko-select-content-max-height: 18rem;
|
|
26
|
+
--kumiko-select-content-max-width: 24rem;
|
|
27
|
+
--kumiko-select-content-font-size: 0.875rem;
|
|
28
|
+
--kumiko-select-sheet-max-height: 70dvh;
|
|
29
|
+
--kumiko-select-item-padding: 0.4rem 0.625rem;
|
|
30
|
+
--kumiko-select-item-gap: 0.5rem;
|
|
31
|
+
--kumiko-select-item-min-height: 2rem;
|
|
32
|
+
--kumiko-select-sheet-item-min-height: 3rem;
|
|
33
|
+
--kumiko-select-item-disabled-opacity: 0.45;
|
|
34
|
+
--kumiko-select-indicator-size: 1rem;
|
|
35
|
+
--kumiko-select-group-label-size: 0.8em;
|
|
36
|
+
--kumiko-select-search-radius: 0.375rem;
|
|
37
|
+
--kumiko-select-search-padding: 0.4rem 0.625rem;
|
|
38
|
+
--kumiko-select-search-font-size: 1em;
|
|
39
|
+
--kumiko-select-match-weight: 700;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Derived colours resolve on the trigger, so they follow a fg and bg set on any container. */
|
|
43
|
+
:where([data-slot="select-trigger"]) {
|
|
44
|
+
--_select-border: var(
|
|
45
|
+
--kumiko-select-trigger-border,
|
|
46
|
+
color-mix(in oklab, var(--kumiko-select-trigger-fg) 28%, transparent)
|
|
47
|
+
);
|
|
48
|
+
--_select-placeholder-fg: var(
|
|
49
|
+
--kumiko-select-placeholder-fg,
|
|
50
|
+
color-mix(in oklab, var(--kumiko-select-trigger-fg) 58%, transparent)
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
display: inline-grid;
|
|
54
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
55
|
+
align-items: center;
|
|
56
|
+
box-sizing: border-box;
|
|
57
|
+
max-inline-size: 100%;
|
|
58
|
+
min-block-size: var(--kumiko-select-trigger-min-height);
|
|
59
|
+
padding: var(--kumiko-select-trigger-padding);
|
|
60
|
+
border: var(--kumiko-select-trigger-border-width) solid var(--_select-border);
|
|
61
|
+
border-radius: var(--kumiko-select-trigger-radius);
|
|
62
|
+
background: var(--kumiko-select-trigger-bg);
|
|
63
|
+
color: var(--kumiko-select-trigger-fg);
|
|
64
|
+
font: inherit;
|
|
65
|
+
font-size: var(--kumiko-select-trigger-font-size);
|
|
66
|
+
font-weight: var(--kumiko-select-trigger-font-weight);
|
|
67
|
+
text-align: start;
|
|
68
|
+
cursor: var(--kumiko-press-cursor, pointer);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
:where([data-slot="select-trigger"]):where(:focus-visible, [data-open]) {
|
|
72
|
+
outline: 2px solid var(--kumiko-select-focus-ring);
|
|
73
|
+
outline-offset: 2px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:where([data-slot="select-trigger"][data-disabled]) {
|
|
77
|
+
opacity: var(--kumiko-select-disabled-opacity);
|
|
78
|
+
cursor: not-allowed;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* Without a sizer, the trigger fits its value, up to the cap. */
|
|
82
|
+
:where([data-slot="select-trigger"]:not(:has(> [data-slot="select-sizer"]))) {
|
|
83
|
+
max-inline-size: min(var(--kumiko-select-trigger-max-width), 100%);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
:where([data-slot="select-value"]) {
|
|
87
|
+
grid-area: 1 / 2;
|
|
88
|
+
min-inline-size: 0;
|
|
89
|
+
overflow: hidden;
|
|
90
|
+
text-overflow: ellipsis;
|
|
91
|
+
white-space: nowrap;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/*
|
|
95
|
+
* The sizer is an invisible copy of every option label, stacked in the value's cell, so the widest
|
|
96
|
+
* one sets the trigger's own width and choosing never resizes it. Its cap is the only cap: a width
|
|
97
|
+
* the page gives the trigger is honoured, and the value fills it.
|
|
98
|
+
*/
|
|
99
|
+
:where([data-slot="select-sizer"]) {
|
|
100
|
+
display: grid;
|
|
101
|
+
grid-area: 1 / 2;
|
|
102
|
+
max-inline-size: var(--kumiko-select-trigger-max-width);
|
|
103
|
+
overflow: hidden;
|
|
104
|
+
pointer-events: none;
|
|
105
|
+
visibility: hidden;
|
|
106
|
+
white-space: nowrap;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
:where([data-slot="select-sizer"] > *) {
|
|
110
|
+
grid-area: 1 / 1;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
:where(
|
|
114
|
+
[data-slot="select-trigger"]:has(> [data-slot="select-sizer"]) > [data-slot="select-value"]
|
|
115
|
+
) {
|
|
116
|
+
contain: inline-size;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
:where([data-slot="select-value-icon"]) {
|
|
120
|
+
grid-area: 1 / 1;
|
|
121
|
+
margin-inline-end: 0.5rem;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
:where([data-slot="select-value"][data-placeholder]) {
|
|
125
|
+
color: var(--_select-placeholder-fg);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* A corner of a box turned to point down, and up while the list is open. */
|
|
129
|
+
:where([data-slot="select-chevron"]) {
|
|
130
|
+
box-sizing: border-box;
|
|
131
|
+
grid-area: 1 / 3;
|
|
132
|
+
margin-inline-start: 0.5rem;
|
|
133
|
+
inline-size: var(--kumiko-select-chevron-size);
|
|
134
|
+
block-size: var(--kumiko-select-chevron-size);
|
|
135
|
+
border: solid currentColor;
|
|
136
|
+
border-width: 0 max(1.5px, calc(var(--kumiko-select-chevron-size) * 0.22))
|
|
137
|
+
max(1.5px, calc(var(--kumiko-select-chevron-size) * 0.22)) 0;
|
|
138
|
+
opacity: 0.7;
|
|
139
|
+
rotate: 45deg;
|
|
140
|
+
translate: 0 -20%;
|
|
141
|
+
transition-property: rotate;
|
|
142
|
+
transition-duration: var(--kumiko-move-duration);
|
|
143
|
+
transition-timing-function: var(--kumiko-move-ease);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
:where([data-slot="select-trigger"][data-open] > [data-slot="select-chevron"]) {
|
|
147
|
+
rotate: 225deg;
|
|
148
|
+
translate: 0 20%;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* With reduced or still motion the chevron turns over at once. */
|
|
152
|
+
@media (prefers-reduced-motion: reduce) {
|
|
153
|
+
:where([data-slot="select-chevron"]) {
|
|
154
|
+
transition-property: none;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
:where([data-kumiko-motion="still"] [data-slot="select-chevron"]) {
|
|
159
|
+
transition-property: none;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/* Derived colours resolve on the list, so they follow a fg and bg set on any container. */
|
|
163
|
+
:where([data-slot="select-content"]) {
|
|
164
|
+
--_select-border: var(
|
|
165
|
+
--kumiko-select-content-border,
|
|
166
|
+
color-mix(in oklab, var(--kumiko-select-content-fg) 14%, transparent)
|
|
167
|
+
);
|
|
168
|
+
--_select-muted-fg: var(
|
|
169
|
+
--kumiko-select-group-label-fg,
|
|
170
|
+
color-mix(
|
|
171
|
+
in oklab,
|
|
172
|
+
var(--kumiko-select-content-fg) 64%,
|
|
173
|
+
var(--kumiko-select-content-bg)
|
|
174
|
+
)
|
|
175
|
+
);
|
|
176
|
+
--_select-highlight-bg: var(
|
|
177
|
+
--kumiko-select-highlight-bg,
|
|
178
|
+
color-mix(in oklab, var(--kumiko-select-content-fg) 10%, transparent)
|
|
179
|
+
);
|
|
180
|
+
--_select-selected-bg: var(
|
|
181
|
+
--kumiko-select-selected-bg,
|
|
182
|
+
color-mix(in oklab, var(--kumiko-select-content-fg) 6%, transparent)
|
|
183
|
+
);
|
|
184
|
+
--_select-separator: var(
|
|
185
|
+
--kumiko-select-separator,
|
|
186
|
+
color-mix(in oklab, var(--kumiko-select-content-fg) 12%, transparent)
|
|
187
|
+
);
|
|
188
|
+
--_select-scrollbar-thumb: var(
|
|
189
|
+
--kumiko-select-scrollbar-thumb,
|
|
190
|
+
color-mix(in oklab, var(--kumiko-select-content-fg) 40%, transparent)
|
|
191
|
+
);
|
|
192
|
+
--_select-scrollbar-track: var(--kumiko-select-scrollbar-track, transparent);
|
|
193
|
+
--_select-search-bg: var(
|
|
194
|
+
--kumiko-select-search-bg,
|
|
195
|
+
color-mix(in oklab, var(--kumiko-select-content-fg) 5%, transparent)
|
|
196
|
+
);
|
|
197
|
+
--_select-search-border: var(
|
|
198
|
+
--kumiko-select-search-border,
|
|
199
|
+
color-mix(in oklab, var(--kumiko-select-content-fg) 18%, transparent)
|
|
200
|
+
);
|
|
201
|
+
--_select-search-placeholder-fg: var(
|
|
202
|
+
--kumiko-select-search-placeholder-fg,
|
|
203
|
+
color-mix(in oklab, var(--kumiko-select-content-fg) 55%, transparent)
|
|
204
|
+
);
|
|
205
|
+
|
|
206
|
+
box-sizing: border-box;
|
|
207
|
+
margin: 0;
|
|
208
|
+
padding: var(--kumiko-select-content-padding);
|
|
209
|
+
overflow-y: auto;
|
|
210
|
+
overscroll-behavior: contain;
|
|
211
|
+
scrollbar-width: thin;
|
|
212
|
+
scrollbar-color: var(--_select-scrollbar-thumb) var(--_select-scrollbar-track);
|
|
213
|
+
border: var(--kumiko-select-content-border-width) solid var(--_select-border);
|
|
214
|
+
border-radius: var(--kumiko-select-content-radius);
|
|
215
|
+
background: var(--kumiko-select-content-bg);
|
|
216
|
+
box-shadow: var(--kumiko-select-content-shadow);
|
|
217
|
+
color: var(--kumiko-select-content-fg);
|
|
218
|
+
font-size: var(--kumiko-select-content-font-size);
|
|
219
|
+
line-height: 1.3;
|
|
220
|
+
outline: none;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
@media (prefers-contrast: more) {
|
|
224
|
+
:where([data-slot="select-content"]) {
|
|
225
|
+
--_select-scrollbar-thumb: CanvasText;
|
|
226
|
+
--_select-scrollbar-track: Canvas;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/* The list opens below its trigger and is at least as wide as it. Its height is capped, and never more than the room on the page. */
|
|
231
|
+
:where([data-slot="select-content"][data-presentation="popover"]) {
|
|
232
|
+
--_select-from: 0 0;
|
|
233
|
+
/* No scale or translate at rest: any other value than none would clip fixed-position descendants. */
|
|
234
|
+
|
|
235
|
+
min-inline-size: var(--anchor-width);
|
|
236
|
+
max-inline-size: min(
|
|
237
|
+
var(--kumiko-select-content-max-width),
|
|
238
|
+
var(--available-width, 100dvw)
|
|
239
|
+
);
|
|
240
|
+
max-block-size: min(
|
|
241
|
+
var(--kumiko-select-content-max-height),
|
|
242
|
+
var(--available-height, 100dvh)
|
|
243
|
+
);
|
|
244
|
+
transform-origin: var(--transform-origin);
|
|
245
|
+
transition-property: opacity, scale, translate;
|
|
246
|
+
/* Opening is quicker than closing, so a list opened again and again never feels slow. */
|
|
247
|
+
transition-duration:
|
|
248
|
+
calc(var(--kumiko-fade-duration) * 0.6), var(--kumiko-pop-duration),
|
|
249
|
+
var(--kumiko-pop-duration);
|
|
250
|
+
transition-timing-function:
|
|
251
|
+
var(--kumiko-enter-ease), var(--kumiko-pop-ease), var(--kumiko-pop-ease);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
:where([data-slot="select-content"][data-presentation="popover"][data-side="bottom"]) {
|
|
255
|
+
--_select-from: 0 calc(var(--kumiko-pop-distance) * -1);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
:where([data-slot="select-content"][data-presentation="popover"][data-side="top"]) {
|
|
259
|
+
--_select-from: 0 var(--kumiko-pop-distance);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
:where([data-slot="select-content"][data-presentation="popover"]):where(
|
|
263
|
+
[data-starting-style],
|
|
264
|
+
[data-ending-style]
|
|
265
|
+
) {
|
|
266
|
+
opacity: 0;
|
|
267
|
+
scale: var(--kumiko-pop-scale);
|
|
268
|
+
translate: var(--_select-from);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
:where([data-slot="select-content"][data-presentation="popover"][data-ending-style]) {
|
|
272
|
+
/* Closing, the shrink and slide last as long as the fade and on its curve, so they never stop mid-fade. */
|
|
273
|
+
transition-duration: var(--kumiko-fade-duration);
|
|
274
|
+
transition-timing-function: var(--kumiko-exit-ease);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/* With reduced or still motion the list only fades, so scale and translate have nothing to animate. */
|
|
278
|
+
@media (prefers-reduced-motion: reduce) {
|
|
279
|
+
:where([data-slot="select-content"][data-presentation="popover"]) {
|
|
280
|
+
transition-property: opacity;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
:where([data-kumiko-motion="still"] [data-slot="select-content"][data-presentation="popover"]) {
|
|
285
|
+
transition-property: opacity;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/* A sheet rises from the bottom edge, so only its top corners are round. Its slide belongs to ui-sdk, so nothing here moves it. */
|
|
289
|
+
:where([data-slot="select-content"][data-presentation="sheet"]) {
|
|
290
|
+
max-block-size: min(
|
|
291
|
+
var(--kumiko-select-sheet-max-height),
|
|
292
|
+
var(--visual-viewport-height, 100dvh)
|
|
293
|
+
);
|
|
294
|
+
padding-block-end: max(
|
|
295
|
+
var(--kumiko-select-content-padding),
|
|
296
|
+
env(safe-area-inset-bottom, 0px)
|
|
297
|
+
);
|
|
298
|
+
border-end-start-radius: 0;
|
|
299
|
+
border-end-end-radius: 0;
|
|
300
|
+
|
|
301
|
+
/* ui-sdk sets overscroll-behavior: contain inline on a sheet, which keeps a swipe the panel can't scroll from closing it. Only !important beats that. */
|
|
302
|
+
overscroll-behavior: auto !important;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
:where([data-slot="select-item"]) {
|
|
306
|
+
display: flex;
|
|
307
|
+
gap: var(--kumiko-select-item-gap);
|
|
308
|
+
align-items: center;
|
|
309
|
+
box-sizing: border-box;
|
|
310
|
+
min-block-size: var(--kumiko-select-item-min-height);
|
|
311
|
+
padding: var(--kumiko-select-item-padding);
|
|
312
|
+
border-radius: var(
|
|
313
|
+
--kumiko-select-item-radius,
|
|
314
|
+
calc(var(--kumiko-select-content-radius) - var(--kumiko-select-content-padding))
|
|
315
|
+
);
|
|
316
|
+
outline: none;
|
|
317
|
+
cursor: default;
|
|
318
|
+
user-select: none;
|
|
319
|
+
transition-property: background-color, color;
|
|
320
|
+
transition-duration: calc(var(--kumiko-fade-duration) * 0.5);
|
|
321
|
+
transition-timing-function: var(--kumiko-fade-ease);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
:where([data-slot="select-content"][data-presentation="sheet"] [data-slot="select-item"]) {
|
|
325
|
+
min-block-size: var(--kumiko-select-sheet-item-min-height);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
:where([data-slot="select-item"][data-selected]) {
|
|
329
|
+
background: var(--_select-selected-bg);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/* The highlight arrives at once and lets go quickly, so it barely trails a sweep. */
|
|
333
|
+
:where([data-slot="select-item"][data-highlighted]) {
|
|
334
|
+
transition-property: none;
|
|
335
|
+
background: var(--_select-highlight-bg);
|
|
336
|
+
color: var(--kumiko-select-highlight-fg, var(--kumiko-select-content-fg));
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/* The highlight fill is faint, so the keyboard's highlight is also ringed. */
|
|
340
|
+
:where(
|
|
341
|
+
[data-slot="select-content"][data-modality="keyboard"]
|
|
342
|
+
[data-slot="select-item"][data-highlighted]
|
|
343
|
+
) {
|
|
344
|
+
outline: 2px solid var(--kumiko-select-focus-ring);
|
|
345
|
+
outline-offset: -2px;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/* Where fills are faint or overridden, the highlighted row takes the system's selection colours. */
|
|
349
|
+
@media (prefers-contrast: more), (forced-colors: active) {
|
|
350
|
+
:where([data-slot="select-item"][data-highlighted]) {
|
|
351
|
+
background: Highlight;
|
|
352
|
+
color: HighlightText;
|
|
353
|
+
forced-color-adjust: none;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
:where([data-slot="select-item"][data-disabled]) {
|
|
358
|
+
opacity: var(--kumiko-select-item-disabled-opacity);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/* The check sits at the end of the row: right in left-to-right text, left in right-to-left. */
|
|
362
|
+
:where([data-slot="select-item-indicator"]) {
|
|
363
|
+
display: inline-grid;
|
|
364
|
+
flex: none;
|
|
365
|
+
inline-size: var(--kumiko-select-indicator-size);
|
|
366
|
+
block-size: var(--kumiko-select-indicator-size);
|
|
367
|
+
margin-inline-start: auto;
|
|
368
|
+
place-items: center;
|
|
369
|
+
transition-property: opacity, scale;
|
|
370
|
+
transition-duration: var(--kumiko-fade-duration), var(--kumiko-pop-duration);
|
|
371
|
+
transition-timing-function: var(--kumiko-enter-ease), var(--kumiko-pop-ease);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/* Only the item being chosen is highlighted, so a check already on doesn't pop as the list opens. */
|
|
375
|
+
@starting-style {
|
|
376
|
+
:where([data-highlighted] > [data-slot="select-item-indicator"]) {
|
|
377
|
+
opacity: 0;
|
|
378
|
+
scale: 0.4;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
:where([data-slot="select-item-indicator"])::before {
|
|
383
|
+
box-sizing: border-box;
|
|
384
|
+
inline-size: 0.35em;
|
|
385
|
+
block-size: 0.7em;
|
|
386
|
+
margin-block-start: -0.15em;
|
|
387
|
+
border: solid currentColor;
|
|
388
|
+
border-width: 0 max(2px, 0.14em) max(2px, 0.14em) 0;
|
|
389
|
+
rotate: 45deg;
|
|
390
|
+
content: "";
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
:where([data-slot="select-group-label"]) {
|
|
394
|
+
padding: var(--kumiko-select-item-padding);
|
|
395
|
+
color: var(--_select-muted-fg);
|
|
396
|
+
font-size: var(--kumiko-select-group-label-size);
|
|
397
|
+
font-weight: 600;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
:where([data-slot="select-separator"]) {
|
|
401
|
+
block-size: 1px;
|
|
402
|
+
margin: var(--kumiko-select-content-padding) calc(var(--kumiko-select-content-padding) * -1);
|
|
403
|
+
background: var(--_select-separator);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/* With a search field the list is a column: the field stays put and only the items scroll, under the same height caps. */
|
|
407
|
+
:where([data-slot="select-content"]:has(> [data-slot="select-input"])) {
|
|
408
|
+
display: flex;
|
|
409
|
+
flex-direction: column;
|
|
410
|
+
overflow-y: hidden;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
:where([data-slot="select-content"] > [data-slot="select-list"]) {
|
|
414
|
+
flex: 1 1 auto;
|
|
415
|
+
min-block-size: 0;
|
|
416
|
+
overflow-y: auto;
|
|
417
|
+
overscroll-behavior: contain;
|
|
418
|
+
scrollbar-width: thin;
|
|
419
|
+
scrollbar-color: var(--_select-scrollbar-thumb) var(--_select-scrollbar-track);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
:where([data-slot="select-content"][data-presentation="sheet"] > [data-slot="select-list"]) {
|
|
423
|
+
overscroll-behavior: auto;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
:where([data-slot="select-input"]) {
|
|
427
|
+
box-sizing: border-box;
|
|
428
|
+
flex: none;
|
|
429
|
+
inline-size: 100%;
|
|
430
|
+
margin: 0 0 var(--kumiko-select-content-padding);
|
|
431
|
+
padding: var(--kumiko-select-search-padding);
|
|
432
|
+
border: 1px solid var(--_select-search-border);
|
|
433
|
+
border-radius: var(--kumiko-select-search-radius);
|
|
434
|
+
background: var(--_select-search-bg);
|
|
435
|
+
color: var(--kumiko-select-search-fg, inherit);
|
|
436
|
+
font: inherit;
|
|
437
|
+
font-size: var(--kumiko-select-search-font-size);
|
|
438
|
+
outline: none;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
:where([data-slot="select-input"])::placeholder {
|
|
442
|
+
color: var(--_select-search-placeholder-fg);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
:where([data-slot="select-input"]:focus-visible) {
|
|
446
|
+
outline: 2px solid var(--kumiko-select-focus-ring);
|
|
447
|
+
outline-offset: -1px;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
/* Focus stays in the search field, which has the ring, so the highlighted row only has its fill. */
|
|
451
|
+
:where(
|
|
452
|
+
[data-slot="select-content"][data-modality="keyboard"]:has(> [data-slot="select-input"])
|
|
453
|
+
[data-slot="select-item"][data-highlighted]
|
|
454
|
+
) {
|
|
455
|
+
outline: none;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
:where([data-slot="select-empty"]) {
|
|
459
|
+
padding: var(--kumiko-select-item-padding);
|
|
460
|
+
color: var(--_select-muted-fg);
|
|
461
|
+
text-align: center;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/* A match is bolder, not boxed. */
|
|
465
|
+
:where([data-slot="select-item-text"] mark) {
|
|
466
|
+
background: none;
|
|
467
|
+
color: inherit;
|
|
468
|
+
font-weight: var(--kumiko-select-match-weight);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { SelectContent as SdkSelectContent, SelectItem as SdkSelectItem, SelectTrigger as SdkSelectTrigger, type SelectProps } from "@ui-sdk/react/select";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
import { type SelectSearch } from "./select-search";
|
|
4
|
+
/** The ui-sdk select, which opens as a bottom sheet on small touch screens instead of always as a popover. Any `presentation` still overrides it. */
|
|
5
|
+
export declare function Select<T = string, Multiple extends boolean | undefined = false>(props: SelectProps<T, Multiple>): React.JSX.Element;
|
|
6
|
+
type SdkTriggerProps = Parameters<typeof SdkSelectTrigger>[0];
|
|
7
|
+
export type SelectTriggerProps = SdkTriggerProps & {
|
|
8
|
+
/**
|
|
9
|
+
* Whether the trigger ends with a chevron that turns while the list is open.
|
|
10
|
+
* @defaultValue true
|
|
11
|
+
*/
|
|
12
|
+
chevron?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Whether hovering the trigger shows the full value in a tooltip while the trigger cuts it off.
|
|
15
|
+
* @defaultValue true
|
|
16
|
+
*/
|
|
17
|
+
tooltip?: boolean;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* The ui-sdk select trigger, with a chevron after its children unless `chevron` is `false`. It is as wide as its
|
|
21
|
+
* longest option, which an invisible copy of every label (a sizer) gives it, so choosing never resizes it.
|
|
22
|
+
*/
|
|
23
|
+
export declare function SelectTrigger({ chevron, tooltip, children, ref: callerRef, ...props }: SelectTriggerProps): React.JSX.Element;
|
|
24
|
+
type SdkContentProps = Parameters<typeof SdkSelectContent>[0];
|
|
25
|
+
export type SelectContentProps = SdkContentProps & {
|
|
26
|
+
/**
|
|
27
|
+
* Whether the list has a search field above it, or what the field says.
|
|
28
|
+
* @defaultValue false
|
|
29
|
+
*/
|
|
30
|
+
search?: SelectSearch;
|
|
31
|
+
};
|
|
32
|
+
/** The ui-sdk select content, which opens below its trigger, aligned to its start, with a small gap. */
|
|
33
|
+
export declare function SelectContent({ side, align, sideOffset, search, children, ...props }: SelectContentProps): React.JSX.Element | null;
|
|
34
|
+
type SdkItemProps<T> = Parameters<typeof SdkSelectItem<T>>[0];
|
|
35
|
+
export type SelectItemProps<T = string> = SdkItemProps<T> & {
|
|
36
|
+
/**
|
|
37
|
+
* Whether the selected item ends with a check mark.
|
|
38
|
+
* @defaultValue true
|
|
39
|
+
*/
|
|
40
|
+
indicator?: boolean;
|
|
41
|
+
};
|
|
42
|
+
/** The ui-sdk select item, with a check mark after its children unless `indicator` is `false`. */
|
|
43
|
+
export declare function SelectItem<T = string>({ indicator, children, ...props }: SelectItemProps<T>): ReactNode;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Select as SdkSelect, SelectItemText, SelectContent as SdkSelectContent, SelectItem as SdkSelectItem, SelectItemIndicator, SelectTrigger as SdkSelectTrigger } from "@ui-sdk/react/select";
|
|
3
|
+
import { useCallback, useContext, useRef, useState } from "react";
|
|
4
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../tooltip";
|
|
5
|
+
import { labelsOf, LabelsContext } from "./select-labels";
|
|
6
|
+
import { SearchContext, SearchedList } from "./select-search";
|
|
7
|
+
/** The ui-sdk select, which opens as a bottom sheet on small touch screens instead of always as a popover. Any `presentation` still overrides it. */
|
|
8
|
+
export function Select(props) {
|
|
9
|
+
const labels = labelsOf(props.items, props.children, props.placeholder);
|
|
10
|
+
return (_jsx(LabelsContext.Provider, { value: labels, children: _jsx(SdkSelect, { ...props, presentation: props.presentation ?? "auto" }) }));
|
|
11
|
+
}
|
|
12
|
+
/** Children with something added after them, whether they are nodes or a function of the part's state. */
|
|
13
|
+
function followedBy(children, extra) {
|
|
14
|
+
if (typeof children === "function") {
|
|
15
|
+
return (state) => (_jsxs(_Fragment, { children: [children(state), extra] }));
|
|
16
|
+
}
|
|
17
|
+
return (_jsxs(_Fragment, { children: [children, extra] }));
|
|
18
|
+
}
|
|
19
|
+
/** The text of a trigger's value while the trigger cuts it off and its list is closed, or null when there is nothing to show. */
|
|
20
|
+
function cutOff(trigger) {
|
|
21
|
+
const value = trigger?.querySelector('[data-slot="select-value"]');
|
|
22
|
+
if (!trigger || !value || Object.hasOwn(trigger.dataset, "open")) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
return value.scrollWidth > value.clientWidth ? value.textContent : null;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Puts Kumiko's tooltip on a select trigger, with `render`, so it is the same element. The tooltip opens only
|
|
29
|
+
* while the trigger cuts its value off and its list is closed, and then shows that value in full.
|
|
30
|
+
*
|
|
31
|
+
* ui-sdk's tooltip always sets `aria-describedby` on its trigger and offers no way to leave it off. So the
|
|
32
|
+
* tooltip holds no text while it is closed, and a screen reader hears nothing extra of it: the trigger already
|
|
33
|
+
* says its whole value.
|
|
34
|
+
*/
|
|
35
|
+
function CutOffTip({ trigger, triggerRef }) {
|
|
36
|
+
const [full, setFull] = useState("");
|
|
37
|
+
return (_jsxs(Tooltip, { type: "description", onOpenChangeComplete: (open) => {
|
|
38
|
+
if (!open) {
|
|
39
|
+
setFull("");
|
|
40
|
+
}
|
|
41
|
+
}, onOpenChange: (open, details) => {
|
|
42
|
+
if (!open) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const cut = cutOff(triggerRef.current);
|
|
46
|
+
if (cut === null) {
|
|
47
|
+
details.cancel();
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
setFull(cut);
|
|
51
|
+
}
|
|
52
|
+
}, children: [_jsx(TooltipTrigger, { render: trigger }), _jsx(TooltipContent, { children: full })] }));
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The ui-sdk select trigger, with a chevron after its children unless `chevron` is `false`. It is as wide as its
|
|
56
|
+
* longest option, which an invisible copy of every label (a sizer) gives it, so choosing never resizes it.
|
|
57
|
+
*/
|
|
58
|
+
export function SelectTrigger({ chevron = true, tooltip = true, children, ref: callerRef, ...props }) {
|
|
59
|
+
const ref = useRef(null);
|
|
60
|
+
// The trigger's own ref and the caller's both get the button.
|
|
61
|
+
const both = useCallback((node) => {
|
|
62
|
+
ref.current = node;
|
|
63
|
+
if (typeof callerRef === "function") {
|
|
64
|
+
const cleanup = callerRef(node);
|
|
65
|
+
return typeof cleanup === "function"
|
|
66
|
+
? () => {
|
|
67
|
+
ref.current = null;
|
|
68
|
+
cleanup();
|
|
69
|
+
}
|
|
70
|
+
: undefined;
|
|
71
|
+
}
|
|
72
|
+
if (callerRef) {
|
|
73
|
+
callerRef.current = node;
|
|
74
|
+
}
|
|
75
|
+
return undefined;
|
|
76
|
+
}, [callerRef]);
|
|
77
|
+
const labels = useContext(LabelsContext);
|
|
78
|
+
const extra = (_jsxs(_Fragment, { children: [labels.length > 0 ? (_jsx("span", { "data-slot": "select-sizer", "aria-hidden": "true", children: labels.map((label) => (_jsx("span", { children: label }, label))) })) : null, chevron ? _jsx("span", { "data-slot": "select-chevron", "aria-hidden": "true" }) : null] }));
|
|
79
|
+
const trigger = (_jsx(SdkSelectTrigger, { ...props, ref: both, children: followedBy(children, extra) }));
|
|
80
|
+
return tooltip ? _jsx(CutOffTip, { trigger: trigger, triggerRef: ref }) : trigger;
|
|
81
|
+
}
|
|
82
|
+
/** The ui-sdk select content, which opens below its trigger, aligned to its start, with a small gap. */
|
|
83
|
+
export function SelectContent({ side = "bottom", align = "start", sideOffset = 6, search = false, children, ...props }) {
|
|
84
|
+
return (_jsx(SdkSelectContent, { side: side, align: align, sideOffset: sideOffset, ...props, children: search ? (_jsx(SearchedList, { search: search === true ? {} : search, children: children })) : (children) }));
|
|
85
|
+
}
|
|
86
|
+
/** The ui-sdk select item, with a check mark after its children unless `indicator` is `false`. */
|
|
87
|
+
export function SelectItem({ indicator = true, children, ...props }) {
|
|
88
|
+
const searched = useContext(SearchContext);
|
|
89
|
+
const extra = indicator ? _jsx(SelectItemIndicator, {}) : null;
|
|
90
|
+
const shown = searched && (typeof children === "string" || typeof children === "number") ? (_jsx(SelectItemText, { children: children })) : (children);
|
|
91
|
+
return _jsx(SdkSelectItem, { ...props, children: followedBy(shown, extra) });
|
|
92
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Separator } from "./separator";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
@layer kumiko {
|
|
2
|
+
:where(:root) {
|
|
3
|
+
--kumiko-separator-color: color-mix(in oklab, CanvasText 18%, transparent);
|
|
4
|
+
--kumiko-separator-thickness: 1px;
|
|
5
|
+
--kumiko-separator-inset: 0px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
[data-slot="separator"] {
|
|
9
|
+
flex: none;
|
|
10
|
+
align-self: stretch;
|
|
11
|
+
background: var(--kumiko-separator-color);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/* The inset is space kept clear at the ends of the line, so a divider can stop short of the edges. */
|
|
15
|
+
[data-slot="separator"][data-orientation="horizontal"] {
|
|
16
|
+
block-size: var(--kumiko-separator-thickness);
|
|
17
|
+
inline-size: auto;
|
|
18
|
+
margin-inline: var(--kumiko-separator-inset);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
[data-slot="separator"][data-orientation="vertical"] {
|
|
22
|
+
inline-size: var(--kumiko-separator-thickness);
|
|
23
|
+
block-size: auto;
|
|
24
|
+
margin-block: var(--kumiko-separator-inset);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@media (forced-colors: active) {
|
|
28
|
+
[data-slot="separator"] {
|
|
29
|
+
background: CanvasText;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Separator as SdkSeparator } from "@ui-sdk/react/separator";
|
|
2
|
+
type SdkSeparatorProps = Parameters<typeof SdkSeparator>[0];
|
|
3
|
+
export type SeparatorProps = SdkSeparatorProps & {
|
|
4
|
+
/**
|
|
5
|
+
* Hides the line from screen readers (`role="none"`), for a line that only divides things visually.
|
|
6
|
+
* Turn it off when the line divides content a screen reader should hear as separate.
|
|
7
|
+
* @defaultValue true
|
|
8
|
+
*/
|
|
9
|
+
decorative?: boolean;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* The ui-sdk separator with Kumiko's look: a thin line in a soft tint of the text colour.
|
|
13
|
+
* It runs along the row or column it sits in, and a vertical one takes its row's height.
|
|
14
|
+
* It is decorative by default.
|
|
15
|
+
*/
|
|
16
|
+
export declare function Separator({ decorative, ...props }: SeparatorProps): React.JSX.Element | null;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Separator as SdkSeparator } from "@ui-sdk/react/separator";
|
|
3
|
+
/**
|
|
4
|
+
* The ui-sdk separator with Kumiko's look: a thin line in a soft tint of the text colour.
|
|
5
|
+
* It runs along the row or column it sits in, and a vertical one takes its row's height.
|
|
6
|
+
* It is decorative by default.
|
|
7
|
+
*/
|
|
8
|
+
export function Separator({ decorative = true, ...props }) {
|
|
9
|
+
return _jsx(SdkSeparator, { decorative: decorative, ...props });
|
|
10
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { Slider, type ShowValue, type SliderBubble, type SliderProps } from "./slider";
|
|
2
|
+
export { createSliderController, SliderControl, SliderIndicator, SliderThumb, SliderTrack, SliderValue, type NumberFormat, type SliderApi, type SliderChangeOptions, type SliderController, type SliderOptions, type SliderPrimitive, type SliderState, type SliderThumbProps, type SliderThumbState, type SliderValueChangeDetails, type SliderValueChangeReason, type SliderValueCommitDetails, type SliderValueState } from "@ui-sdk/react/slider";
|