@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,247 @@
|
|
|
1
|
+
@import "../motion/motion.css";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Styles ui-sdk's dialog and alert dialog alike: the slots of both end in "dialog-content",
|
|
5
|
+
* "dialog-backdrop", "dialog-title", "dialog-description" and "dialog-close".
|
|
6
|
+
*/
|
|
7
|
+
@layer kumiko {
|
|
8
|
+
:where(:root) {
|
|
9
|
+
--kumiko-dialog-backdrop: rgb(0 0 0 / 0.45);
|
|
10
|
+
--kumiko-dialog-backdrop-blur: 0px;
|
|
11
|
+
--kumiko-dialog-bg: Canvas;
|
|
12
|
+
--kumiko-dialog-fg: CanvasText;
|
|
13
|
+
--kumiko-dialog-border-width: 1px;
|
|
14
|
+
--kumiko-dialog-radius: 1rem;
|
|
15
|
+
--kumiko-dialog-shadow: 0 24px 64px -16px color-mix(in oklab, CanvasText 40%, transparent);
|
|
16
|
+
--kumiko-dialog-padding: 1.5rem;
|
|
17
|
+
--kumiko-dialog-width: 28rem;
|
|
18
|
+
--kumiko-dialog-max-width: 48rem;
|
|
19
|
+
--kumiko-dialog-gutter: 1rem;
|
|
20
|
+
--kumiko-dialog-gap: 1rem;
|
|
21
|
+
--kumiko-dialog-font-size: 0.9375rem;
|
|
22
|
+
--kumiko-dialog-title-font: inherit;
|
|
23
|
+
--kumiko-dialog-title-size: 1.25rem;
|
|
24
|
+
--kumiko-dialog-title-weight: 600;
|
|
25
|
+
--kumiko-dialog-description-size: 0.9em;
|
|
26
|
+
--kumiko-dialog-description-weight: 400;
|
|
27
|
+
--kumiko-dialog-close-size: 2rem;
|
|
28
|
+
--kumiko-dialog-sheet-max-height: 85dvh;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
:where([data-slot$="dialog-content"]) {
|
|
32
|
+
/* The page's width and height, less the gutter, are the most a panel may take. */
|
|
33
|
+
--_dialog-room-inline: calc(100dvw - 2 * var(--kumiko-dialog-gutter));
|
|
34
|
+
--_dialog-room-block: calc(
|
|
35
|
+
var(--visual-viewport-height, 100dvh) - 2 * var(--kumiko-dialog-gutter)
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
/* Derived colours resolve on the panel, so they follow a fg and bg set on any container. */
|
|
39
|
+
--_dialog-border: var(
|
|
40
|
+
--kumiko-dialog-border,
|
|
41
|
+
color-mix(in oklab, var(--kumiko-dialog-fg) 14%, transparent)
|
|
42
|
+
);
|
|
43
|
+
--_dialog-muted-fg: var(
|
|
44
|
+
--kumiko-dialog-muted-fg,
|
|
45
|
+
color-mix(in oklab, var(--kumiko-dialog-fg) 64%, var(--kumiko-dialog-bg))
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
box-sizing: border-box;
|
|
49
|
+
margin: 0;
|
|
50
|
+
padding: var(--kumiko-dialog-padding);
|
|
51
|
+
overflow-y: auto;
|
|
52
|
+
overscroll-behavior: contain;
|
|
53
|
+
border: var(--kumiko-dialog-border-width) solid var(--_dialog-border);
|
|
54
|
+
border-radius: var(--kumiko-dialog-radius);
|
|
55
|
+
background: var(--kumiko-dialog-bg);
|
|
56
|
+
box-shadow: var(--kumiko-dialog-shadow);
|
|
57
|
+
color: var(--kumiko-dialog-fg);
|
|
58
|
+
font-size: var(--kumiko-dialog-font-size);
|
|
59
|
+
line-height: 1.5;
|
|
60
|
+
outline: none;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* A centred dialog. A sheet's place and size are ui-sdk's. */
|
|
64
|
+
:where([data-slot$="dialog-content"]:not([data-presentation="sheet"])) {
|
|
65
|
+
inset: 0;
|
|
66
|
+
margin: auto;
|
|
67
|
+
inline-size: min(var(--kumiko-dialog-width), var(--_dialog-room-inline));
|
|
68
|
+
max-inline-size: min(var(--kumiko-dialog-max-width), var(--_dialog-room-inline));
|
|
69
|
+
block-size: fit-content;
|
|
70
|
+
max-block-size: var(--_dialog-room-block);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* A sheet rises from the bottom edge, so only its top corners are round. */
|
|
74
|
+
:where([data-slot$="dialog-content"][data-presentation="sheet"]) {
|
|
75
|
+
--sheet-backdrop: var(--kumiko-dialog-backdrop);
|
|
76
|
+
|
|
77
|
+
max-block-size: var(--kumiko-dialog-sheet-max-height);
|
|
78
|
+
border-end-start-radius: 0;
|
|
79
|
+
border-end-end-radius: 0;
|
|
80
|
+
|
|
81
|
+
/*
|
|
82
|
+
* On a touch screen ui-sdk moves a sheet by scrolling the page layer around it, and sets
|
|
83
|
+
* overscroll-behavior: contain on the sheet itself. The panel scrolls its own content, so
|
|
84
|
+
* with contain the browser keeps a vertical touch for the panel, even one with nothing
|
|
85
|
+
* to scroll, and the swipe never reaches the sheet. Auto lets a swipe the panel can't
|
|
86
|
+
* scroll (it is at the top, or has no overflow) carry on to close the sheet. Only
|
|
87
|
+
* !important beats the inline style.
|
|
88
|
+
*/
|
|
89
|
+
overscroll-behavior: auto !important;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
:where([data-slot$="dialog-title"]) {
|
|
93
|
+
margin: 0;
|
|
94
|
+
color: var(--kumiko-dialog-title-fg, inherit);
|
|
95
|
+
font-family: var(--kumiko-dialog-title-font);
|
|
96
|
+
font-size: var(--kumiko-dialog-title-size);
|
|
97
|
+
font-weight: var(--kumiko-dialog-title-weight);
|
|
98
|
+
line-height: 1.25;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
:where([data-slot$="dialog-description"]) {
|
|
102
|
+
margin: 0;
|
|
103
|
+
color: var(--kumiko-dialog-description-fg, var(--_dialog-muted-fg));
|
|
104
|
+
font-size: var(--kumiko-dialog-description-size);
|
|
105
|
+
font-weight: var(--kumiko-dialog-description-weight);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/*
|
|
109
|
+
* The header, body and footer are stacked with a gap; the description sits close to its title.
|
|
110
|
+
* Layers inside the panel (a nested dialog, a menu or a popover, all [popover]) place themselves.
|
|
111
|
+
*/
|
|
112
|
+
:where([data-slot$="dialog-content"] > :not([popover]) ~ :not([popover])) {
|
|
113
|
+
margin-block-start: var(--kumiko-dialog-gap);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
:where([data-slot$="dialog-title"] + [data-slot$="dialog-description"]) {
|
|
117
|
+
margin-block-start: 0.375rem;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* The footer: a row of actions at the end, wrapping on a narrow screen. */
|
|
121
|
+
:where(
|
|
122
|
+
[data-kumiko-actions],
|
|
123
|
+
[data-slot$="dialog-content"] > div:has(> [data-slot$="dialog-close"])
|
|
124
|
+
) {
|
|
125
|
+
display: flex;
|
|
126
|
+
flex-wrap: wrap;
|
|
127
|
+
gap: 0.5rem;
|
|
128
|
+
justify-content: flex-end;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* An icon-only Close (one with an aria-label) straight in the panel is the corner "×". */
|
|
132
|
+
:where([data-slot$="dialog-content"] > [data-slot$="dialog-close"][aria-label]) {
|
|
133
|
+
position: absolute;
|
|
134
|
+
inset-block-start: calc(var(--kumiko-dialog-padding) / 2);
|
|
135
|
+
inset-inline-end: calc(var(--kumiko-dialog-padding) / 2);
|
|
136
|
+
display: inline-grid;
|
|
137
|
+
box-sizing: border-box;
|
|
138
|
+
inline-size: var(--kumiko-dialog-close-size);
|
|
139
|
+
block-size: var(--kumiko-dialog-close-size);
|
|
140
|
+
margin: 0;
|
|
141
|
+
padding: 0;
|
|
142
|
+
border: 0;
|
|
143
|
+
border-radius: 999px;
|
|
144
|
+
background: transparent;
|
|
145
|
+
color: var(--_dialog-muted-fg);
|
|
146
|
+
font: inherit;
|
|
147
|
+
font-size: 1.25em;
|
|
148
|
+
line-height: 1;
|
|
149
|
+
cursor: var(--kumiko-press-cursor, pointer);
|
|
150
|
+
place-items: center;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
:where([data-slot$="dialog-content"] > [data-slot$="dialog-close"][aria-label]:hover) {
|
|
154
|
+
background: color-mix(in oklab, var(--kumiko-dialog-fg) 10%, transparent);
|
|
155
|
+
color: var(--kumiko-dialog-fg);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* The dim behind a dialog: the Backdrop part, or the panel's own ::backdrop without one. */
|
|
159
|
+
:where([data-slot$="dialog-backdrop"]) {
|
|
160
|
+
position: fixed;
|
|
161
|
+
inset: 0;
|
|
162
|
+
background: var(--kumiko-dialog-backdrop);
|
|
163
|
+
backdrop-filter: blur(var(--kumiko-dialog-backdrop-blur));
|
|
164
|
+
transition: opacity calc(var(--kumiko-fade-duration) * 0.6) var(--kumiko-enter-ease);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
:where([data-slot$="dialog-content"]:not([data-presentation="sheet"]))::backdrop {
|
|
168
|
+
background: var(--kumiko-dialog-backdrop);
|
|
169
|
+
backdrop-filter: blur(var(--kumiko-dialog-backdrop-blur));
|
|
170
|
+
transition: opacity calc(var(--kumiko-fade-duration) * 0.6) var(--kumiko-enter-ease);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* With a Backdrop part, the panel's ::backdrop would dim a second time. */
|
|
174
|
+
:where([data-slot$="dialog-backdrop"] ~ [data-slot$="dialog-content"])::backdrop {
|
|
175
|
+
background: transparent;
|
|
176
|
+
backdrop-filter: none;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
:where([data-slot$="dialog-backdrop"]:is([data-starting-style], [data-ending-style])) {
|
|
180
|
+
opacity: 0;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
:where([data-slot$="dialog-backdrop"][data-ending-style]) {
|
|
184
|
+
transition-duration: var(--kumiko-fade-duration);
|
|
185
|
+
transition-timing-function: var(--kumiko-exit-ease);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
:where(
|
|
189
|
+
[data-slot$="dialog-content"]:not([data-presentation="sheet"]):is(
|
|
190
|
+
[data-starting-style],
|
|
191
|
+
[data-ending-style]
|
|
192
|
+
)
|
|
193
|
+
)::backdrop {
|
|
194
|
+
opacity: 0;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
:where(
|
|
198
|
+
[data-slot$="dialog-content"]:not([data-presentation="sheet"])[data-ending-style]
|
|
199
|
+
)::backdrop {
|
|
200
|
+
transition-duration: var(--kumiko-fade-duration);
|
|
201
|
+
transition-timing-function: var(--kumiko-exit-ease);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/* The panel fades, and grows from a little smaller. Opening is quicker than closing. */
|
|
205
|
+
/*
|
|
206
|
+
* At rest the panel has no scale, not an explicit 1: any scale, translate or transform other
|
|
207
|
+
* than none makes it the containing block of fixed-position descendants (a portalled list),
|
|
208
|
+
* so its overflow would clip them.
|
|
209
|
+
*/
|
|
210
|
+
:where([data-slot$="dialog-content"]:not([data-presentation="sheet"])) {
|
|
211
|
+
transition-property: opacity, scale;
|
|
212
|
+
transition-duration: calc(var(--kumiko-fade-duration) * 0.6), var(--kumiko-pop-duration);
|
|
213
|
+
transition-timing-function: var(--kumiko-enter-ease), var(--kumiko-pop-ease);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/* A dialog with another open above it steps back, half as far as a new one grows in. */
|
|
217
|
+
:where([data-slot$="dialog-content"]:not([data-presentation="sheet"])[data-nested-open]) {
|
|
218
|
+
scale: calc(1 - (1 - var(--kumiko-pop-scale)) * 0.5 * var(--dialog-stack, 1));
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
:where([data-slot$="dialog-content"]:not([data-presentation="sheet"])):where(
|
|
222
|
+
[data-starting-style],
|
|
223
|
+
[data-ending-style]
|
|
224
|
+
) {
|
|
225
|
+
opacity: 0;
|
|
226
|
+
scale: var(--kumiko-pop-scale);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/* Closing, the shrink lasts as long as the fade and on its curve, so a large panel never stops moving mid-fade. */
|
|
230
|
+
:where([data-slot$="dialog-content"]:not([data-presentation="sheet"])[data-ending-style]) {
|
|
231
|
+
transition-duration: var(--kumiko-fade-duration);
|
|
232
|
+
transition-timing-function: var(--kumiko-exit-ease);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/* With reduced or still motion the panel only fades, so scale has nothing to animate. */
|
|
236
|
+
@media (prefers-reduced-motion: reduce) {
|
|
237
|
+
:where([data-slot$="dialog-content"]:not([data-presentation="sheet"])) {
|
|
238
|
+
transition-property: opacity;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
:where(
|
|
243
|
+
[data-kumiko-motion="still"] [data-slot$="dialog-content"]:not([data-presentation="sheet"])
|
|
244
|
+
) {
|
|
245
|
+
transition-property: opacity;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { createDialogController, Dialog, DialogBackdrop, DialogClose, DialogContent, DialogDescription, DialogShortcut, DialogTitle, DialogTrigger, type DialogApi, type DialogBackdropState, type DialogCloseActionDetails, type DialogCloseProps, type DialogCloseState, type DialogContentProps, type DialogContentState, type DialogController, type DialogDismissAttemptDetails, type DialogDismissReason, type DialogFinalFocus, type DialogInitialFocus, type DialogOpenChangeDetails, type DialogOpenChangeReason, type DialogOptions, type DialogPayloadChangeReason, type DialogProps, type DialogShortcutProps, type DialogTriggerProps, type DialogTriggerState } from "@ui-sdk/react/dialog";
|
|
2
|
+
export { AlertDialog, AlertDialogBackdrop, AlertDialogClose, AlertDialogContent, AlertDialogDescription, AlertDialogShortcut, AlertDialogTitle, AlertDialogTrigger, confirm, createAlertDialogController, createConfirm, type AlertDialogCloseProps, type AlertDialogContentProps, type AlertDialogContentState, type AlertDialogController, type AlertDialogOpenChangeReason, type AlertDialogOptions, type AlertDialogProps, type AlertDialogTriggerProps, type ConfirmEntry, type ConfirmOptions } from "@ui-sdk/react/alert-dialog";
|
|
3
|
+
export { OverlayHost, type OverlayHostProps } from "@ui-sdk/react/overlays";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { createDialogController, Dialog, DialogBackdrop, DialogClose, DialogContent, DialogDescription, DialogShortcut, DialogTitle, DialogTrigger } from "@ui-sdk/react/dialog";
|
|
2
|
+
export { AlertDialog, AlertDialogBackdrop, AlertDialogClose, AlertDialogContent, AlertDialogDescription, AlertDialogShortcut, AlertDialogTitle, AlertDialogTrigger, confirm, createAlertDialogController, createConfirm } from "@ui-sdk/react/alert-dialog";
|
|
3
|
+
export { OverlayHost } from "@ui-sdk/react/overlays";
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
@import "../motion/motion.css";
|
|
2
|
+
|
|
3
|
+
@layer kumiko {
|
|
4
|
+
:where(:root) {
|
|
5
|
+
--kumiko-hover-card-bg: Canvas;
|
|
6
|
+
--kumiko-hover-card-fg: CanvasText;
|
|
7
|
+
--kumiko-hover-card-border-width: 1px;
|
|
8
|
+
--kumiko-hover-card-radius: 0.75rem;
|
|
9
|
+
--kumiko-hover-card-shadow: 0 12px 32px -10px
|
|
10
|
+
color-mix(in oklab, CanvasText 32%, transparent);
|
|
11
|
+
--kumiko-hover-card-padding: 0.875rem;
|
|
12
|
+
--kumiko-hover-card-width: 20rem;
|
|
13
|
+
--kumiko-hover-card-max-width: 22rem;
|
|
14
|
+
--kumiko-hover-card-font-size: 0.875rem;
|
|
15
|
+
--kumiko-hover-card-arrow-size: 0.75rem;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* Derived colours resolve on the card, so they follow a fg and bg set on any container. */
|
|
19
|
+
:where([data-slot="hover-card-content"]) {
|
|
20
|
+
--_card-border: var(
|
|
21
|
+
--kumiko-hover-card-border,
|
|
22
|
+
color-mix(in oklab, var(--kumiko-hover-card-fg) 14%, transparent)
|
|
23
|
+
);
|
|
24
|
+
--_card-scrollbar-thumb: var(
|
|
25
|
+
--kumiko-hover-card-scrollbar-thumb,
|
|
26
|
+
color-mix(in oklab, var(--kumiko-hover-card-fg) 40%, transparent)
|
|
27
|
+
);
|
|
28
|
+
--_card-scrollbar-track: var(--kumiko-hover-card-scrollbar-track, transparent);
|
|
29
|
+
--_card-from: 0 0;
|
|
30
|
+
/* No scale or translate at rest: any other value than none would clip fixed-position descendants. */
|
|
31
|
+
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
inline-size: var(--kumiko-hover-card-width);
|
|
34
|
+
max-inline-size: min(var(--kumiko-hover-card-max-width), var(--available-width, 100dvw));
|
|
35
|
+
max-block-size: var(--available-height, 100dvh);
|
|
36
|
+
margin: 0;
|
|
37
|
+
padding: var(--kumiko-hover-card-padding);
|
|
38
|
+
overflow-y: auto;
|
|
39
|
+
overscroll-behavior: contain;
|
|
40
|
+
scrollbar-width: thin;
|
|
41
|
+
scrollbar-color: var(--_card-scrollbar-thumb) var(--_card-scrollbar-track);
|
|
42
|
+
border: var(--kumiko-hover-card-border-width) solid var(--_card-border);
|
|
43
|
+
border-radius: var(--kumiko-hover-card-radius);
|
|
44
|
+
background: var(--kumiko-hover-card-bg);
|
|
45
|
+
box-shadow: var(--kumiko-hover-card-shadow);
|
|
46
|
+
color: var(--kumiko-hover-card-fg);
|
|
47
|
+
font-size: var(--kumiko-hover-card-font-size);
|
|
48
|
+
line-height: 1.4;
|
|
49
|
+
outline: none;
|
|
50
|
+
transform-origin: var(--transform-origin);
|
|
51
|
+
transition-property: opacity, scale, translate;
|
|
52
|
+
/* Opening is quicker than closing, so a card opened again and again never feels slow. */
|
|
53
|
+
transition-duration:
|
|
54
|
+
calc(var(--kumiko-fade-duration) * 0.6), var(--kumiko-pop-duration),
|
|
55
|
+
var(--kumiko-pop-duration);
|
|
56
|
+
transition-timing-function:
|
|
57
|
+
var(--kumiko-enter-ease), var(--kumiko-pop-ease), var(--kumiko-pop-ease);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@media (prefers-contrast: more) {
|
|
61
|
+
:where([data-slot="hover-card-content"]) {
|
|
62
|
+
--_card-scrollbar-thumb: CanvasText;
|
|
63
|
+
--_card-scrollbar-track: Canvas;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* The arrow sticks out of the card, so a card with one can't clip it by scrolling. */
|
|
68
|
+
:where([data-slot="hover-card-content"]:has(> [data-slot="hover-card-arrow"])) {
|
|
69
|
+
overflow: visible;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
:where([data-slot="hover-card-content"][data-side="bottom"]) {
|
|
73
|
+
--_card-from: 0 calc(var(--kumiko-pop-distance) * -1);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:where([data-slot="hover-card-content"][data-side="top"]) {
|
|
77
|
+
--_card-from: 0 var(--kumiko-pop-distance);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
:where([data-slot="hover-card-content"][data-side="right"]) {
|
|
81
|
+
--_card-from: calc(var(--kumiko-pop-distance) * -1) 0;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:where([data-slot="hover-card-content"][data-side="left"]) {
|
|
85
|
+
--_card-from: var(--kumiko-pop-distance) 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
:where([data-slot="hover-card-content"]):where([data-starting-style], [data-ending-style]) {
|
|
89
|
+
opacity: 0;
|
|
90
|
+
scale: var(--kumiko-pop-scale);
|
|
91
|
+
translate: var(--_card-from);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:where([data-slot="hover-card-content"][data-ending-style]) {
|
|
95
|
+
/* Closing, the shrink and slide last as long as the fade and on its curve, so they never stop mid-fade. */
|
|
96
|
+
transition-duration: var(--kumiko-fade-duration);
|
|
97
|
+
transition-timing-function: var(--kumiko-exit-ease);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* With reduced or still motion the card only fades. */
|
|
101
|
+
@media (prefers-reduced-motion: reduce) {
|
|
102
|
+
:where([data-slot="hover-card-content"]) {
|
|
103
|
+
transition-property: opacity;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
:where([data-kumiko-motion="still"] [data-slot="hover-card-content"]) {
|
|
108
|
+
transition-property: opacity;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* Same arrow as the popover's: a turned square on the card's edge, pointing at the trigger. */
|
|
112
|
+
:where([data-slot="hover-card-arrow"]) {
|
|
113
|
+
--_arrow: var(--kumiko-hover-card-arrow-size);
|
|
114
|
+
--_arrow-edge: calc(var(--_arrow) / -2 - var(--kumiko-hover-card-border-width));
|
|
115
|
+
|
|
116
|
+
position: absolute;
|
|
117
|
+
box-sizing: border-box;
|
|
118
|
+
inline-size: var(--_arrow);
|
|
119
|
+
block-size: var(--_arrow);
|
|
120
|
+
border: 0 solid var(--_card-border);
|
|
121
|
+
background: var(--kumiko-hover-card-bg);
|
|
122
|
+
pointer-events: none;
|
|
123
|
+
rotate: 45deg;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
:where([data-slot="hover-card-arrow"][data-side="bottom"]) {
|
|
127
|
+
inset-block-start: var(--_arrow-edge);
|
|
128
|
+
border-top-width: var(--kumiko-hover-card-border-width);
|
|
129
|
+
border-left-width: var(--kumiko-hover-card-border-width);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
:where([data-slot="hover-card-arrow"][data-side="top"]) {
|
|
133
|
+
inset-block-end: var(--_arrow-edge);
|
|
134
|
+
border-right-width: var(--kumiko-hover-card-border-width);
|
|
135
|
+
border-bottom-width: var(--kumiko-hover-card-border-width);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
:where([data-slot="hover-card-arrow"][data-side="right"]) {
|
|
139
|
+
left: var(--_arrow-edge);
|
|
140
|
+
border-bottom-width: var(--kumiko-hover-card-border-width);
|
|
141
|
+
border-left-width: var(--kumiko-hover-card-border-width);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
:where([data-slot="hover-card-arrow"][data-side="left"]) {
|
|
145
|
+
right: var(--_arrow-edge);
|
|
146
|
+
border-top-width: var(--kumiko-hover-card-border-width);
|
|
147
|
+
border-right-width: var(--kumiko-hover-card-border-width);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { HoverCard as SdkHoverCard } from "@ui-sdk/react/hover-card";
|
|
3
|
+
/** How long the pointer rests on a trigger before its card opens, unless `delay` says otherwise. */
|
|
4
|
+
const restingDelay = 450;
|
|
5
|
+
/** The ui-sdk hover card, which waits 450ms instead of 600ms. Any `delay` still overrides it. */
|
|
6
|
+
export function HoverCard({ delay = restingDelay, ...props }) {
|
|
7
|
+
return _jsx(SdkHoverCard, { delay: delay, ...props });
|
|
8
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { HoverCard } from "./hover-card";
|
|
2
|
+
export { createHoverCardController, HoverCardArrow, HoverCardContent, HoverCardTrigger, type HoverCardApi, type HoverCardArrowState, type HoverCardContentProps, type HoverCardContentState, type HoverCardController, type HoverCardOpenChangeReason, type HoverCardOptions, type HoverCardPayloadChangeReason, type HoverCardPrimitive, type HoverCardProps, type HoverCardTriggerProps, type HoverCardTriggerState } from "@ui-sdk/react/hover-card";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Input, type InputProps } from "./input";
|
|
2
|
+
export { inputAttributes, type InputLook, type InputSize } from "./input-attributes";
|
|
3
|
+
export { SearchInput, type SearchEscape, type SearchInputProps } from "./search-input";
|
|
4
|
+
export { createInputController, InputClear, InputGroup, type InputController, type InputGroupOptions, type InputGroupPrimitive, type InputGroupState, type InputOptions, type InputPrimitive, type InputState, type InputValueChangeReason } from "@ui-sdk/react/input";
|
|
5
|
+
export { Field, FieldDescription, FieldError, FieldLabel } from "@ui-sdk/react/field";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Input } from "./input";
|
|
2
|
+
export { inputAttributes } from "./input-attributes";
|
|
3
|
+
export { SearchInput } from "./search-input";
|
|
4
|
+
export { createInputController, InputClear, InputGroup } from "@ui-sdk/react/input";
|
|
5
|
+
export { Field, FieldDescription, FieldError, FieldLabel } from "@ui-sdk/react/field";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type InputSize = "default" | "title" | "touch";
|
|
2
|
+
/** Which of the three looks a field has. Without one, a field takes its container's look, and `cozy` outside any. */
|
|
3
|
+
export type InputLook = "calm" | "raised" | "cozy";
|
|
4
|
+
/**
|
|
5
|
+
* The attributes the field look keys on. Put them on any element, such as a contenteditable title editor, to
|
|
6
|
+
* give it the Kumiko field look.
|
|
7
|
+
*/
|
|
8
|
+
export declare function inputAttributes(size?: InputSize, look?: InputLook): {
|
|
9
|
+
"data-slot": "input";
|
|
10
|
+
"data-size": InputSize;
|
|
11
|
+
"data-look"?: InputLook;
|
|
12
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The attributes the field look keys on. Put them on any element, such as a contenteditable title editor, to
|
|
3
|
+
* give it the Kumiko field look.
|
|
4
|
+
*/
|
|
5
|
+
export function inputAttributes(size = "default", look) {
|
|
6
|
+
return look
|
|
7
|
+
? { "data-slot": "input", "data-size": size, "data-look": look }
|
|
8
|
+
: { "data-slot": "input", "data-size": size };
|
|
9
|
+
}
|