@alulore/kumiko 0.18.3 → 0.19.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.
Files changed (147) hide show
  1. package/dist/dialog/ask.d.ts +7 -0
  2. package/dist/dialog/ask.js +8 -0
  3. package/dist/dialog/dialog-content.d.ts +23 -0
  4. package/dist/dialog/dialog-content.js +15 -0
  5. package/dist/dialog/dialog-entry.d.ts +14 -0
  6. package/dist/dialog/dialog-entry.js +111 -0
  7. package/dist/dialog/dialog-labels.d.ts +23 -0
  8. package/dist/dialog/dialog-labels.js +16 -0
  9. package/dist/dialog/dialog-store.d.ts +139 -0
  10. package/dist/dialog/dialog-store.js +296 -0
  11. package/dist/dialog/dialog.css +36 -0
  12. package/dist/dialog/dialog.d.ts +0 -3
  13. package/dist/dialog/dialog.js +0 -6
  14. package/dist/dialog/index.d.ts +8 -2
  15. package/dist/dialog/index.js +7 -2
  16. package/dist/dialog/leave-guard.d.ts +24 -0
  17. package/dist/dialog/leave-guard.js +98 -0
  18. package/dist/dialog/nest.d.ts +14 -0
  19. package/dist/dialog/nest.js +26 -0
  20. package/dist/dialog/open-dialog.d.ts +16 -0
  21. package/dist/dialog/open-dialog.js +13 -0
  22. package/dist/dialog/overlay-host.d.ts +27 -0
  23. package/dist/dialog/overlay-host.js +47 -0
  24. package/dist/dialog/question-dialog.d.ts +21 -0
  25. package/dist/dialog/question-dialog.js +78 -0
  26. package/dist/drawer/drawer.css +18 -16
  27. package/dist/menu/menu.css +21 -17
  28. package/dist/otp-input/otp-input.css +38 -37
  29. package/dist/page/index.d.ts +8 -0
  30. package/dist/page/index.js +8 -0
  31. package/dist/page/page-action.d.ts +26 -0
  32. package/dist/page/page-action.js +23 -0
  33. package/dist/page/page-actions.d.ts +10 -0
  34. package/dist/page/page-actions.js +66 -0
  35. package/dist/page/page-back.d.ts +11 -0
  36. package/dist/page/page-back.js +17 -0
  37. package/dist/page/page-breadcrumbs.d.ts +21 -0
  38. package/dist/page/page-breadcrumbs.js +60 -0
  39. package/dist/page/page-context.d.ts +5 -0
  40. package/dist/page/page-context.js +13 -0
  41. package/dist/page/page-fit.d.ts +26 -0
  42. package/dist/page/page-fit.js +36 -0
  43. package/dist/page/page-header.d.ts +26 -0
  44. package/dist/page/page-header.js +16 -0
  45. package/dist/page/page-icons.d.ts +4 -0
  46. package/dist/page/page-icons.js +13 -0
  47. package/dist/page/page-labels.d.ts +12 -0
  48. package/dist/page/page-labels.js +6 -0
  49. package/dist/page/page-section.d.ts +14 -0
  50. package/dist/page/page-section.js +9 -0
  51. package/dist/page/page.css +422 -0
  52. package/dist/page/page.d.ts +16 -0
  53. package/dist/page/page.js +12 -0
  54. package/dist/page/use-measured-fit.d.ts +22 -0
  55. package/dist/page/use-measured-fit.js +75 -0
  56. package/dist/page/use-stuck.d.ts +7 -0
  57. package/dist/page/use-stuck.js +31 -0
  58. package/dist/pagination/index.d.ts +3 -0
  59. package/dist/pagination/index.js +3 -0
  60. package/dist/pagination/pagination-extras.d.ts +28 -0
  61. package/dist/pagination/pagination-extras.js +42 -0
  62. package/dist/pagination/pagination-fit.d.ts +15 -0
  63. package/dist/pagination/pagination-fit.js +52 -0
  64. package/dist/pagination/pagination-icons.d.ts +4 -0
  65. package/dist/pagination/pagination-icons.js +16 -0
  66. package/dist/pagination/pagination-labels.d.ts +23 -0
  67. package/dist/pagination/pagination-labels.js +14 -0
  68. package/dist/pagination/pagination-math.d.ts +7 -0
  69. package/dist/pagination/pagination-math.js +24 -0
  70. package/dist/pagination/pagination-motion.d.ts +6 -0
  71. package/dist/pagination/pagination-motion.js +71 -0
  72. package/dist/pagination/pagination.css +455 -0
  73. package/dist/pagination/pagination.d.ts +59 -0
  74. package/dist/pagination/pagination.js +77 -0
  75. package/dist/select/select.css +6 -10
  76. package/dist/server-render.test.js +49 -0
  77. package/dist/sidebar/app-shell.d.ts +54 -0
  78. package/dist/sidebar/app-shell.js +28 -0
  79. package/dist/sidebar/index.d.ts +9 -0
  80. package/dist/sidebar/index.js +8 -0
  81. package/dist/sidebar/shell-context.d.ts +30 -0
  82. package/dist/sidebar/shell-context.js +20 -0
  83. package/dist/sidebar/shell-sheet.d.ts +7 -0
  84. package/dist/sidebar/shell-sheet.js +12 -0
  85. package/dist/sidebar/shell-top-bar.d.ts +8 -0
  86. package/dist/sidebar/shell-top-bar.js +25 -0
  87. package/dist/sidebar/sidebar-body.d.ts +5 -0
  88. package/dist/sidebar/sidebar-body.js +37 -0
  89. package/dist/sidebar/sidebar-icons.d.ts +4 -0
  90. package/dist/sidebar/sidebar-icons.js +13 -0
  91. package/dist/sidebar/sidebar-item.d.ts +26 -0
  92. package/dist/sidebar/sidebar-item.js +68 -0
  93. package/dist/sidebar/sidebar-labels.d.ts +14 -0
  94. package/dist/sidebar/sidebar-labels.js +7 -0
  95. package/dist/sidebar/sidebar-marker.d.ts +12 -0
  96. package/dist/sidebar/sidebar-marker.js +77 -0
  97. package/dist/sidebar/sidebar-storage.d.ts +18 -0
  98. package/dist/sidebar/sidebar-storage.js +27 -0
  99. package/dist/sidebar/sidebar-toggle.d.ts +7 -0
  100. package/dist/sidebar/sidebar-toggle.js +18 -0
  101. package/dist/sidebar/sidebar.css +587 -0
  102. package/dist/sidebar/sidebar.d.ts +19 -0
  103. package/dist/sidebar/sidebar.js +31 -0
  104. package/dist/sidebar/use-collapsed.d.ts +13 -0
  105. package/dist/sidebar/use-collapsed.js +20 -0
  106. package/dist/sidebar/use-narrow.d.ts +4 -0
  107. package/dist/sidebar/use-narrow.js +18 -0
  108. package/dist/sidebar/use-shell-focus.d.ts +8 -0
  109. package/dist/sidebar/use-shell-focus.js +30 -0
  110. package/dist/sidebar/use-shell-shortcut.d.ts +4 -0
  111. package/dist/sidebar/use-shell-shortcut.js +32 -0
  112. package/dist/sidebar/use-shell-state.d.ts +18 -0
  113. package/dist/sidebar/use-shell-state.js +47 -0
  114. package/dist/slider/slider.css +9 -6
  115. package/dist/smooth-caret/caret-geometry.js +10 -4
  116. package/dist/table/data-table-props.d.ts +96 -0
  117. package/dist/table/data-table-props.js +1 -0
  118. package/dist/table/data-table.d.ts +7 -0
  119. package/dist/table/data-table.js +59 -0
  120. package/dist/table/index.d.ts +7 -0
  121. package/dist/table/index.js +5 -0
  122. package/dist/table/table-actions.d.ts +9 -0
  123. package/dist/table/table-actions.js +24 -0
  124. package/dist/table/table-builder.d.ts +60 -0
  125. package/dist/table/table-builder.js +99 -0
  126. package/dist/table/table-cells.d.ts +19 -0
  127. package/dist/table/table-cells.js +67 -0
  128. package/dist/table/table-columns.d.ts +38 -0
  129. package/dist/table/table-columns.js +119 -0
  130. package/dist/table/table-icons.d.ts +3 -0
  131. package/dist/table/table-icons.js +8 -0
  132. package/dist/table/table-labels.d.ts +24 -0
  133. package/dist/table/table-labels.js +17 -0
  134. package/dist/table/table-model.d.ts +28 -0
  135. package/dist/table/table-model.js +69 -0
  136. package/dist/table/table-sections.d.ts +25 -0
  137. package/dist/table/table-sections.js +79 -0
  138. package/dist/table/table-state.d.ts +42 -0
  139. package/dist/table/table-state.js +81 -0
  140. package/dist/table/table-types.d.ts +86 -0
  141. package/dist/table/table-types.js +1 -0
  142. package/dist/table/table.css +919 -0
  143. package/dist/table/use-table-view.d.ts +30 -0
  144. package/dist/table/use-table-view.js +147 -0
  145. package/dist/toast/index.d.ts +1 -2
  146. package/dist/toast/index.js +1 -2
  147. package/package.json +44 -1
@@ -0,0 +1,919 @@
1
+ @import "../motion/motion.css";
2
+
3
+ @layer kumiko {
4
+ :where(:root) {
5
+ --kumiko-touch-target: 2.75rem;
6
+ --kumiko-table-font-size: 0.875rem;
7
+ --kumiko-table-header-font-size: 0.75rem;
8
+ --kumiko-table-header-weight: 600;
9
+ --kumiko-table-fg: CanvasText;
10
+ --kumiko-table-bg: Canvas;
11
+ --kumiko-table-muted: color-mix(in oklab, CanvasText 58%, Canvas);
12
+ --kumiko-table-header-fg: color-mix(in oklab, CanvasText 62%, Canvas);
13
+ --kumiko-table-border: color-mix(in oklab, CanvasText 12%, Canvas);
14
+ --kumiko-table-radius: 0.75rem;
15
+ --kumiko-table-padding-inline: 0.875rem;
16
+ --kumiko-table-padding-block: 0.75rem;
17
+ --kumiko-table-padding-block-compact: 0.3125rem;
18
+ --kumiko-table-row-hover-bg: color-mix(in oklab, CanvasText 5%, Canvas);
19
+ --kumiko-table-row-selected-bg: color-mix(in oklab, Highlight 12%, Canvas);
20
+ --kumiko-table-row-selected-hover-bg: color-mix(
21
+ in oklab,
22
+ var(--kumiko-table-row-selected-bg),
23
+ CanvasText 5%
24
+ );
25
+ --kumiko-table-stripe-bg: color-mix(in oklab, CanvasText 3.5%, Canvas);
26
+ --kumiko-table-focus-ring: Highlight;
27
+ --kumiko-table-select-width: 3rem;
28
+ --kumiko-table-pin-shadow: color-mix(in oklab, CanvasText 18%, transparent);
29
+ --kumiko-table-pin-shadow-size: 0.75rem;
30
+ --kumiko-table-icon-size: 1em;
31
+ --kumiko-table-card-gap: 0.75rem;
32
+ --kumiko-table-card-padding: 0.875rem 1rem;
33
+ --kumiko-table-card-radius: 0.75rem;
34
+ --kumiko-table-card-border: 1px solid var(--kumiko-table-border);
35
+ --kumiko-table-card-bg: var(--kumiko-table-bg);
36
+ --kumiko-table-selection-bg: color-mix(in oklab, Highlight 12%, Canvas);
37
+ --kumiko-table-toolbar-gap: 0.75rem;
38
+ }
39
+
40
+ /* The container the narrow rules ask about, so the table answers to the room it has, not to the window. */
41
+ :where([data-slot="table"]) {
42
+ --_py: var(--kumiko-table-padding-block);
43
+
44
+ container: kumiko-table / inline-size;
45
+ color: var(--kumiko-table-fg);
46
+ font-size: var(--kumiko-table-font-size);
47
+ }
48
+
49
+ :where(
50
+ [data-slot="table"]:is(
51
+ [data-density="compact"],
52
+ :not([data-density]):is([data-kumiko-table~="compact"] *)
53
+ )
54
+ ) {
55
+ --_py: var(--kumiko-table-padding-block-compact);
56
+ }
57
+
58
+ :where([data-slot="table-toolbar"]) {
59
+ display: flex;
60
+ flex-wrap: wrap;
61
+ align-items: center;
62
+ gap: var(--kumiko-table-toolbar-gap);
63
+ margin-block-end: var(--kumiko-table-toolbar-gap);
64
+ }
65
+
66
+ :where([data-slot="table-toolbar"] > :first-child:not([data-slot="table-selection"])) {
67
+ flex: 0 1 20rem;
68
+ min-inline-size: 10rem;
69
+ }
70
+
71
+ /* The bar shows only while something is selected; it stays in the page so its count is read out. */
72
+ :where([data-slot="table-selection"]:not([data-empty])) {
73
+ display: flex;
74
+ flex-wrap: wrap;
75
+ align-items: center;
76
+ gap: 0.5rem 0.75rem;
77
+ padding: 0.25rem 0.5rem 0.25rem 0.875rem;
78
+ border-radius: 999px;
79
+ background: var(--kumiko-table-selection-bg);
80
+ font-variant-numeric: tabular-nums;
81
+ }
82
+
83
+ :where([data-slot="table-selected"]) {
84
+ font-weight: 600;
85
+ }
86
+
87
+ :where([data-slot="table-footer"]) {
88
+ margin-block-start: var(--kumiko-table-toolbar-gap);
89
+ }
90
+
91
+ /*
92
+ * The scroll box is a labelled region you can focus, so the keyboard can scroll it sideways. It positions the
93
+ * visually hidden text inside it; otherwise that text escapes the clip and widens the page.
94
+ */
95
+ :where([data-slot="table-scroll"]) {
96
+ position: relative;
97
+ overflow-x: auto;
98
+ overscroll-behavior-x: contain;
99
+ background: var(--kumiko-table-bg);
100
+ }
101
+
102
+ :where([data-slot="table-scroll"]):focus-visible {
103
+ outline: 2px solid var(--kumiko-table-focus-ring);
104
+ outline-offset: 2px;
105
+ }
106
+
107
+ :where([data-slot="table"] table) {
108
+ inline-size: 100%;
109
+ border-collapse: separate;
110
+ border-spacing: 0;
111
+ font: inherit;
112
+ }
113
+
114
+ :where([data-slot="table"] :is(th, td)) {
115
+ padding: var(--_py) var(--kumiko-table-padding-inline);
116
+ text-align: start;
117
+ vertical-align: middle;
118
+ background: transparent;
119
+ border-block-end: 1px solid var(--kumiko-table-border);
120
+ }
121
+
122
+ :where([data-slot="table"] tbody > tr:last-child > td) {
123
+ border-block-end: 0;
124
+ }
125
+
126
+ :where([data-slot="table"] :is(th, td)[data-align="center"]) {
127
+ text-align: center;
128
+ }
129
+
130
+ :where([data-slot="table"] :is(th, td)[data-align="end"]) {
131
+ text-align: end;
132
+ }
133
+
134
+ :where([data-slot="table"] thead th) {
135
+ color: var(--kumiko-table-header-fg);
136
+ font-size: var(--kumiko-table-header-font-size);
137
+ font-weight: var(--kumiko-table-header-weight);
138
+ white-space: nowrap;
139
+ }
140
+
141
+ /* A cell's hidden words, and the missing word's spoken twin. */
142
+ :where([data-slot="table-visually-hidden"]) {
143
+ position: absolute;
144
+ inline-size: 1px;
145
+ block-size: 1px;
146
+ overflow: hidden;
147
+ clip-path: inset(50%);
148
+ white-space: nowrap;
149
+ }
150
+
151
+ :where([data-slot="table-missing"]) {
152
+ color: var(--kumiko-table-muted);
153
+ }
154
+
155
+ :where([data-slot="table-cell-label"]) {
156
+ display: none;
157
+ }
158
+
159
+ :where([data-slot="table"] td[data-kind="actions"]) {
160
+ white-space: nowrap;
161
+ }
162
+
163
+ :where([data-slot="table-message"]) {
164
+ padding-block: 2.5rem;
165
+ color: var(--kumiko-table-muted);
166
+ text-align: center;
167
+ }
168
+
169
+ /* The selection column has a fixed width, so the pinned first column knows how far to sit from the edge. */
170
+ :where([data-slot="table"] :is(th, td)[data-kind="select"]) {
171
+ inline-size: var(--kumiko-table-select-width);
172
+ min-inline-size: var(--kumiko-table-select-width);
173
+ max-inline-size: var(--kumiko-table-select-width);
174
+ padding-inline: 0;
175
+ text-align: center;
176
+ }
177
+
178
+ :where([data-slot="table-control"]) {
179
+ position: relative;
180
+ z-index: 1;
181
+ display: inline-flex;
182
+ vertical-align: middle;
183
+ }
184
+
185
+ /* Looks: lines is the base. Striped swaps the separators for stripes, framed boxes it in, plain drops every line. */
186
+ :where(
187
+ [data-slot="table"]:is(
188
+ [data-look="striped"],
189
+ :not([data-look]):is([data-kumiko-table~="striped"] *)
190
+ )
191
+ ) {
192
+ & tbody > tr:nth-child(even) {
193
+ --_row-bg: var(--kumiko-table-stripe-bg);
194
+ }
195
+
196
+ & tbody td {
197
+ border-block-end-color: transparent;
198
+ }
199
+ }
200
+
201
+ :where(
202
+ [data-slot="table"]:is(
203
+ [data-look="framed"],
204
+ :not([data-look]):is([data-kumiko-table~="framed"] *)
205
+ )
206
+ ) {
207
+ & [data-slot="table-scroll"] {
208
+ border: 1px solid var(--kumiko-table-border);
209
+ border-radius: var(--kumiko-table-radius);
210
+ }
211
+ }
212
+
213
+ :where(
214
+ [data-slot="table"]:is(
215
+ [data-look="plain"],
216
+ :not([data-look]):is([data-kumiko-table~="plain"] *)
217
+ )
218
+ ) {
219
+ & :is(th, td) {
220
+ border-block-end-color: transparent;
221
+ }
222
+ }
223
+
224
+ /* Rows tint on hover and when selected. The tint is opaque, so a pinned cell can wear it too. */
225
+ :where([data-slot="table"] tbody > tr:not([data-slot])) {
226
+ position: relative;
227
+ background: var(--_row-bg, transparent);
228
+ transition: background-color var(--kumiko-fade-duration) var(--kumiko-fade-ease);
229
+ }
230
+
231
+ :where([data-slot="table"] tbody > tr[data-selected]) {
232
+ --_row-bg: var(--kumiko-table-row-selected-bg);
233
+ }
234
+
235
+ /* A date reads as one piece; its column grows rather than break it over two lines. */
236
+ :where([data-slot="table"] td time) {
237
+ white-space: nowrap;
238
+ }
239
+
240
+ /* Header buttons: the whole header cell is the target. */
241
+ :where([data-slot="table"] th:has(> [data-slot="table-sort"])) {
242
+ padding: 0;
243
+ }
244
+
245
+ :where([data-slot="table-sort"]) {
246
+ position: relative;
247
+ display: flex;
248
+ align-items: center;
249
+ gap: 0.375em;
250
+ box-sizing: border-box;
251
+ inline-size: 100%;
252
+ padding: var(--_py) var(--kumiko-table-padding-inline);
253
+ border: 0;
254
+ background: transparent;
255
+ color: inherit;
256
+ font: inherit;
257
+ text-align: start;
258
+ white-space: nowrap;
259
+ cursor: var(--kumiko-press-cursor, pointer);
260
+ -webkit-tap-highlight-color: transparent;
261
+ transition: color var(--kumiko-fade-duration) var(--kumiko-fade-ease);
262
+ }
263
+
264
+ :where([data-slot="table"] th[data-align="end"] [data-slot="table-sort"]) {
265
+ justify-content: flex-end;
266
+ }
267
+
268
+ :where([data-slot="table"] th[data-align="center"] [data-slot="table-sort"]) {
269
+ justify-content: center;
270
+ }
271
+
272
+ :where([data-slot="table-sort"]):focus-visible {
273
+ outline: 2px solid var(--kumiko-table-focus-ring);
274
+ outline-offset: -2px;
275
+ }
276
+
277
+ /* The icon holds both arrows: it is quiet until the column is sorted, and then points the way it sorts. */
278
+ :where([data-slot="table-sort-icon"]) {
279
+ flex: none;
280
+ inline-size: var(--kumiko-table-icon-size);
281
+ block-size: var(--kumiko-table-icon-size);
282
+ opacity: 0;
283
+ transition: opacity var(--kumiko-fade-duration) var(--kumiko-fade-ease);
284
+ }
285
+
286
+ :where([data-slot="table"] th[aria-sort] [data-slot="table-sort-icon"]) {
287
+ opacity: 1;
288
+ }
289
+
290
+ :where([data-slot="table"] th[aria-sort="ascending"] [data-part="down"]),
291
+ :where([data-slot="table"] th[aria-sort="descending"] [data-part="up"]) {
292
+ opacity: 0.25;
293
+ }
294
+
295
+ :where([data-slot="table-cell-value"]) {
296
+ min-inline-size: 0;
297
+ }
298
+
299
+ /*
300
+ * One link or button per row. Its ::after covers its own cell. A hidden copy in the last cell covers the whole
301
+ * row behind the cells, so the row can be clicked anywhere, while Tab and screen readers meet only one link.
302
+ */
303
+ :where([data-slot="table"] td[data-link]) {
304
+ position: relative;
305
+ z-index: 1;
306
+ }
307
+
308
+ :where([data-slot="table-row-link"]) {
309
+ padding: 0;
310
+ border: 0;
311
+ background: none;
312
+ color: inherit;
313
+ font: inherit;
314
+ font-weight: 500;
315
+ text-align: inherit;
316
+ text-decoration: none;
317
+ cursor: var(--kumiko-press-cursor, pointer);
318
+ -webkit-tap-highlight-color: transparent;
319
+ }
320
+
321
+ :where([data-slot="table-row-link"])::after {
322
+ content: "";
323
+ position: absolute;
324
+ inset: 0;
325
+ }
326
+
327
+ :where([data-slot="table-row-link"]):focus-visible {
328
+ outline: none;
329
+ }
330
+
331
+ :where([data-slot="table-row-overlay"]) {
332
+ position: absolute;
333
+ inset: 0;
334
+ z-index: 0;
335
+ display: block;
336
+ inline-size: 100%;
337
+ block-size: 100%;
338
+ padding: 0;
339
+ border: 0;
340
+ background: none;
341
+ cursor: var(--kumiko-press-cursor, pointer);
342
+ }
343
+
344
+ /* Anything pressable inside a cell sits above the overlay. */
345
+ :where(
346
+ [data-slot="table"]
347
+ td
348
+ :is(a, button, input, select, textarea, [tabindex]):not(
349
+ [data-slot="table-row-link"],
350
+ [data-slot="table-row-overlay"]
351
+ )
352
+ ) {
353
+ position: relative;
354
+ z-index: 1;
355
+ }
356
+
357
+ :where([data-slot="table"] tbody > tr:has([data-slot="table-row-link"]:focus-visible)) {
358
+ outline: 2px solid var(--kumiko-table-focus-ring);
359
+ outline-offset: -2px;
360
+ }
361
+
362
+ :where([data-slot="table-actions"]) {
363
+ display: inline-flex;
364
+ align-items: center;
365
+ gap: 0.125rem;
366
+ }
367
+
368
+ :where([data-slot="table"] [data-part="clear"]) {
369
+ margin-inline-start: auto;
370
+ }
371
+
372
+ @media (hover: hover) and (pointer: fine) {
373
+ :where([data-slot="table"] tbody > tr:not([data-slot]):hover) {
374
+ --_row-bg: var(--kumiko-table-row-hover-bg);
375
+ }
376
+
377
+ :where([data-slot="table"] tbody > tr[data-selected]:hover) {
378
+ --_row-bg: var(--kumiko-table-row-selected-hover-bg);
379
+ }
380
+
381
+ :where([data-slot="table"] th:has(> [data-slot="table-sort"]:hover)) {
382
+ color: var(--kumiko-table-fg);
383
+ }
384
+
385
+ :where(
386
+ [data-slot="table"]
387
+ th:not([aria-sort])
388
+ [data-slot="table-sort"]:hover
389
+ [data-slot="table-sort-icon"]
390
+ ) {
391
+ opacity: 0.5;
392
+ }
393
+ }
394
+
395
+ /* A finger gets full-size targets for the header buttons and each row's controls. */
396
+ @media (pointer: coarse) {
397
+ :where([data-slot="table-sort"], [data-slot="table"] [data-part="action"])::after {
398
+ content: "";
399
+ position: absolute;
400
+ inset: 50% auto auto 50%;
401
+ translate: -50% -50%;
402
+ inline-size: max(100%, var(--kumiko-touch-target));
403
+ block-size: max(100%, var(--kumiko-touch-target));
404
+ }
405
+ }
406
+
407
+ /* The header stays in view while the rows scroll in the table's own box. */
408
+ :where(
409
+ [data-slot="table"]:is(
410
+ [data-sticky="true"],
411
+ :not([data-sticky]):is([data-kumiko-table~="sticky"] *)
412
+ )
413
+ ) {
414
+ & [data-slot="table-scroll"] {
415
+ max-block-size: var(--kumiko-table-max-block-size, min(70vh, 40rem));
416
+ overflow: auto;
417
+ }
418
+
419
+ & thead th {
420
+ position: sticky;
421
+ inset-block-start: 0;
422
+ z-index: 3;
423
+ background: var(--kumiko-table-header-bg, var(--kumiko-table-bg));
424
+ }
425
+ }
426
+
427
+ @supports (animation-timeline: scroll()) {
428
+ @keyframes kumiko-table-edge {
429
+ to {
430
+ opacity: 1;
431
+ }
432
+ }
433
+ }
434
+
435
+ /*
436
+ * Below the breakpoint. Low-priority columns hide in either layout; scroll pins the first columns, and cards
437
+ * turn each row into a card whose header row stays for screen readers only.
438
+ */
439
+ @container kumiko-table (inline-size < 30rem) {
440
+ :where(
441
+ [data-slot="table"]:is(
442
+ [data-narrow-at="sm"],
443
+ :not([data-narrow-at]):is([data-kumiko-table~="narrow-sm"] *)
444
+ )
445
+ ) {
446
+ & [data-priority="low"] {
447
+ display: none;
448
+ }
449
+
450
+ &:where(
451
+ [data-narrow="scroll"],
452
+ :not([data-narrow]):not([data-kumiko-table~="cards"] *)
453
+ ) {
454
+ & table {
455
+ min-inline-size: max-content;
456
+ }
457
+
458
+ &
459
+ :is(th, td):is(
460
+ [data-kind="select"],
461
+ [data-kind="select"] + *,
462
+ :first-child
463
+ ):not([data-slot="table-message"]) {
464
+ position: sticky;
465
+ z-index: 2;
466
+ background: var(--_row-bg, var(--kumiko-table-bg));
467
+ }
468
+
469
+ & th:is([data-kind="select"], [data-kind="select"] + *, :first-child) {
470
+ z-index: 4;
471
+ background: var(--kumiko-table-header-bg, var(--kumiko-table-bg));
472
+ }
473
+
474
+ & :is(th, td):first-child {
475
+ inset-inline-start: 0;
476
+ }
477
+
478
+ & :is(th, td):is([data-kind="select"] + *) {
479
+ inset-inline-start: var(--kumiko-table-select-width);
480
+ }
481
+
482
+ /* The first data column casts a shadow on what scrolls under it, once the box has scrolled. */
483
+ @supports (animation-timeline: scroll()) {
484
+ &
485
+ :is(th, td):is(
486
+ [data-kind="select"] + *,
487
+ :first-child:not([data-kind="select"])
488
+ ):not([data-slot="table-message"])::after {
489
+ content: "";
490
+ position: absolute;
491
+ inset-block: 0;
492
+ inset-inline-start: 100%;
493
+ inline-size: var(--kumiko-table-pin-shadow-size);
494
+ background: linear-gradient(
495
+ to var(--_edge, right),
496
+ var(--kumiko-table-pin-shadow),
497
+ transparent
498
+ );
499
+ opacity: 0;
500
+ pointer-events: none;
501
+ animation: kumiko-table-edge linear both;
502
+ animation-timeline: scroll(nearest inline);
503
+ animation-range: 0 var(--kumiko-table-pin-shadow-size);
504
+ }
505
+
506
+ & :is(th, td):dir(rtl) {
507
+ --_edge: left;
508
+ }
509
+ }
510
+ }
511
+
512
+ &:where([data-narrow="cards"], :not([data-narrow]):is([data-kumiko-table~="cards"] *)) {
513
+ & [data-slot="table-scroll"] {
514
+ overflow: visible;
515
+ max-block-size: none;
516
+ border: 0;
517
+ border-radius: 0;
518
+ background: transparent;
519
+ }
520
+
521
+ & :is(table, tbody, tr, td) {
522
+ display: block;
523
+ }
524
+
525
+ & thead {
526
+ position: absolute;
527
+ inline-size: 1px;
528
+ block-size: 1px;
529
+ overflow: hidden;
530
+ clip-path: inset(50%);
531
+ }
532
+
533
+ & tbody {
534
+ display: grid;
535
+ gap: var(--kumiko-table-card-gap);
536
+ }
537
+
538
+ & tbody > tr {
539
+ display: grid;
540
+ gap: 0.375rem;
541
+ padding: var(--kumiko-table-card-padding);
542
+ border: var(--kumiko-table-card-border);
543
+ border-radius: var(--kumiko-table-card-radius);
544
+ background: var(--_row-bg, var(--kumiko-table-card-bg));
545
+ }
546
+
547
+ & tbody td {
548
+ display: flex;
549
+ flex-wrap: wrap;
550
+ align-items: center;
551
+ justify-content: space-between;
552
+ gap: 0.25rem 1rem;
553
+ padding: 0;
554
+ border: 0;
555
+ text-align: end;
556
+ background: transparent;
557
+ }
558
+
559
+ & td[data-slot="table-message"] {
560
+ display: block;
561
+ text-align: center;
562
+ }
563
+
564
+ & td[data-kind="actions"] {
565
+ justify-content: flex-end;
566
+ }
567
+
568
+ & td[data-kind="select"] {
569
+ inline-size: auto;
570
+ justify-content: flex-start;
571
+ }
572
+
573
+ & [data-slot="table-cell-label"] {
574
+ display: inline;
575
+ color: var(--kumiko-table-muted);
576
+ font-size: var(--kumiko-table-header-font-size);
577
+ font-weight: var(--kumiko-table-header-weight);
578
+ text-align: start;
579
+ }
580
+
581
+ & [data-card-label="off"] > [data-slot="table-cell-label"] {
582
+ display: none;
583
+ }
584
+
585
+ & [data-slot="table-cell-value"] {
586
+ min-inline-size: 0;
587
+ margin-inline-start: auto;
588
+ overflow-wrap: anywhere;
589
+ }
590
+ }
591
+ }
592
+ }
593
+
594
+ @container kumiko-table (inline-size < 40rem) {
595
+ :where(
596
+ [data-slot="table"]:is(
597
+ [data-narrow-at="md"],
598
+ :not([data-narrow-at]):not(
599
+ :is([data-kumiko-table~="narrow-sm"], [data-kumiko-table~="narrow-lg"]) *
600
+ )
601
+ )
602
+ ) {
603
+ & [data-priority="low"] {
604
+ display: none;
605
+ }
606
+
607
+ &:where(
608
+ [data-narrow="scroll"],
609
+ :not([data-narrow]):not([data-kumiko-table~="cards"] *)
610
+ ) {
611
+ & table {
612
+ min-inline-size: max-content;
613
+ }
614
+
615
+ &
616
+ :is(th, td):is(
617
+ [data-kind="select"],
618
+ [data-kind="select"] + *,
619
+ :first-child
620
+ ):not([data-slot="table-message"]) {
621
+ position: sticky;
622
+ z-index: 2;
623
+ background: var(--_row-bg, var(--kumiko-table-bg));
624
+ }
625
+
626
+ & th:is([data-kind="select"], [data-kind="select"] + *, :first-child) {
627
+ z-index: 4;
628
+ background: var(--kumiko-table-header-bg, var(--kumiko-table-bg));
629
+ }
630
+
631
+ & :is(th, td):first-child {
632
+ inset-inline-start: 0;
633
+ }
634
+
635
+ & :is(th, td):is([data-kind="select"] + *) {
636
+ inset-inline-start: var(--kumiko-table-select-width);
637
+ }
638
+
639
+ /* The first data column casts a shadow on what scrolls under it, once the box has scrolled. */
640
+ @supports (animation-timeline: scroll()) {
641
+ &
642
+ :is(th, td):is(
643
+ [data-kind="select"] + *,
644
+ :first-child:not([data-kind="select"])
645
+ ):not([data-slot="table-message"])::after {
646
+ content: "";
647
+ position: absolute;
648
+ inset-block: 0;
649
+ inset-inline-start: 100%;
650
+ inline-size: var(--kumiko-table-pin-shadow-size);
651
+ background: linear-gradient(
652
+ to var(--_edge, right),
653
+ var(--kumiko-table-pin-shadow),
654
+ transparent
655
+ );
656
+ opacity: 0;
657
+ pointer-events: none;
658
+ animation: kumiko-table-edge linear both;
659
+ animation-timeline: scroll(nearest inline);
660
+ animation-range: 0 var(--kumiko-table-pin-shadow-size);
661
+ }
662
+
663
+ & :is(th, td):dir(rtl) {
664
+ --_edge: left;
665
+ }
666
+ }
667
+ }
668
+
669
+ &:where([data-narrow="cards"], :not([data-narrow]):is([data-kumiko-table~="cards"] *)) {
670
+ & [data-slot="table-scroll"] {
671
+ overflow: visible;
672
+ max-block-size: none;
673
+ border: 0;
674
+ border-radius: 0;
675
+ background: transparent;
676
+ }
677
+
678
+ & :is(table, tbody, tr, td) {
679
+ display: block;
680
+ }
681
+
682
+ & thead {
683
+ position: absolute;
684
+ inline-size: 1px;
685
+ block-size: 1px;
686
+ overflow: hidden;
687
+ clip-path: inset(50%);
688
+ }
689
+
690
+ & tbody {
691
+ display: grid;
692
+ gap: var(--kumiko-table-card-gap);
693
+ }
694
+
695
+ & tbody > tr {
696
+ display: grid;
697
+ gap: 0.375rem;
698
+ padding: var(--kumiko-table-card-padding);
699
+ border: var(--kumiko-table-card-border);
700
+ border-radius: var(--kumiko-table-card-radius);
701
+ background: var(--_row-bg, var(--kumiko-table-card-bg));
702
+ }
703
+
704
+ & tbody td {
705
+ display: flex;
706
+ flex-wrap: wrap;
707
+ align-items: center;
708
+ justify-content: space-between;
709
+ gap: 0.25rem 1rem;
710
+ padding: 0;
711
+ border: 0;
712
+ text-align: end;
713
+ background: transparent;
714
+ }
715
+
716
+ & td[data-slot="table-message"] {
717
+ display: block;
718
+ text-align: center;
719
+ }
720
+
721
+ & td[data-kind="actions"] {
722
+ justify-content: flex-end;
723
+ }
724
+
725
+ & td[data-kind="select"] {
726
+ inline-size: auto;
727
+ justify-content: flex-start;
728
+ }
729
+
730
+ & [data-slot="table-cell-label"] {
731
+ display: inline;
732
+ color: var(--kumiko-table-muted);
733
+ font-size: var(--kumiko-table-header-font-size);
734
+ font-weight: var(--kumiko-table-header-weight);
735
+ text-align: start;
736
+ }
737
+
738
+ & [data-card-label="off"] > [data-slot="table-cell-label"] {
739
+ display: none;
740
+ }
741
+
742
+ & [data-slot="table-cell-value"] {
743
+ min-inline-size: 0;
744
+ margin-inline-start: auto;
745
+ overflow-wrap: anywhere;
746
+ }
747
+ }
748
+ }
749
+ }
750
+
751
+ @container kumiko-table (inline-size < 50rem) {
752
+ :where(
753
+ [data-slot="table"]:is(
754
+ [data-narrow-at="lg"],
755
+ :not([data-narrow-at]):is([data-kumiko-table~="narrow-lg"] *)
756
+ )
757
+ ) {
758
+ & [data-priority="low"] {
759
+ display: none;
760
+ }
761
+
762
+ &:where(
763
+ [data-narrow="scroll"],
764
+ :not([data-narrow]):not([data-kumiko-table~="cards"] *)
765
+ ) {
766
+ & table {
767
+ min-inline-size: max-content;
768
+ }
769
+
770
+ &
771
+ :is(th, td):is(
772
+ [data-kind="select"],
773
+ [data-kind="select"] + *,
774
+ :first-child
775
+ ):not([data-slot="table-message"]) {
776
+ position: sticky;
777
+ z-index: 2;
778
+ background: var(--_row-bg, var(--kumiko-table-bg));
779
+ }
780
+
781
+ & th:is([data-kind="select"], [data-kind="select"] + *, :first-child) {
782
+ z-index: 4;
783
+ background: var(--kumiko-table-header-bg, var(--kumiko-table-bg));
784
+ }
785
+
786
+ & :is(th, td):first-child {
787
+ inset-inline-start: 0;
788
+ }
789
+
790
+ & :is(th, td):is([data-kind="select"] + *) {
791
+ inset-inline-start: var(--kumiko-table-select-width);
792
+ }
793
+
794
+ /* The first data column casts a shadow on what scrolls under it, once the box has scrolled. */
795
+ @supports (animation-timeline: scroll()) {
796
+ &
797
+ :is(th, td):is(
798
+ [data-kind="select"] + *,
799
+ :first-child:not([data-kind="select"])
800
+ ):not([data-slot="table-message"])::after {
801
+ content: "";
802
+ position: absolute;
803
+ inset-block: 0;
804
+ inset-inline-start: 100%;
805
+ inline-size: var(--kumiko-table-pin-shadow-size);
806
+ background: linear-gradient(
807
+ to var(--_edge, right),
808
+ var(--kumiko-table-pin-shadow),
809
+ transparent
810
+ );
811
+ opacity: 0;
812
+ pointer-events: none;
813
+ animation: kumiko-table-edge linear both;
814
+ animation-timeline: scroll(nearest inline);
815
+ animation-range: 0 var(--kumiko-table-pin-shadow-size);
816
+ }
817
+
818
+ & :is(th, td):dir(rtl) {
819
+ --_edge: left;
820
+ }
821
+ }
822
+ }
823
+
824
+ &:where([data-narrow="cards"], :not([data-narrow]):is([data-kumiko-table~="cards"] *)) {
825
+ & [data-slot="table-scroll"] {
826
+ overflow: visible;
827
+ max-block-size: none;
828
+ border: 0;
829
+ border-radius: 0;
830
+ background: transparent;
831
+ }
832
+
833
+ & :is(table, tbody, tr, td) {
834
+ display: block;
835
+ }
836
+
837
+ & thead {
838
+ position: absolute;
839
+ inline-size: 1px;
840
+ block-size: 1px;
841
+ overflow: hidden;
842
+ clip-path: inset(50%);
843
+ }
844
+
845
+ & tbody {
846
+ display: grid;
847
+ gap: var(--kumiko-table-card-gap);
848
+ }
849
+
850
+ & tbody > tr {
851
+ display: grid;
852
+ gap: 0.375rem;
853
+ padding: var(--kumiko-table-card-padding);
854
+ border: var(--kumiko-table-card-border);
855
+ border-radius: var(--kumiko-table-card-radius);
856
+ background: var(--_row-bg, var(--kumiko-table-card-bg));
857
+ }
858
+
859
+ & tbody td {
860
+ display: flex;
861
+ flex-wrap: wrap;
862
+ align-items: center;
863
+ justify-content: space-between;
864
+ gap: 0.25rem 1rem;
865
+ padding: 0;
866
+ border: 0;
867
+ text-align: end;
868
+ background: transparent;
869
+ }
870
+
871
+ & td[data-slot="table-message"] {
872
+ display: block;
873
+ text-align: center;
874
+ }
875
+
876
+ & td[data-kind="actions"] {
877
+ justify-content: flex-end;
878
+ }
879
+
880
+ & td[data-kind="select"] {
881
+ inline-size: auto;
882
+ justify-content: flex-start;
883
+ }
884
+
885
+ & [data-slot="table-cell-label"] {
886
+ display: inline;
887
+ color: var(--kumiko-table-muted);
888
+ font-size: var(--kumiko-table-header-font-size);
889
+ font-weight: var(--kumiko-table-header-weight);
890
+ text-align: start;
891
+ }
892
+
893
+ & [data-card-label="off"] > [data-slot="table-cell-label"] {
894
+ display: none;
895
+ }
896
+
897
+ & [data-slot="table-cell-value"] {
898
+ min-inline-size: 0;
899
+ margin-inline-start: auto;
900
+ overflow-wrap: anywhere;
901
+ }
902
+ }
903
+ }
904
+ }
905
+
906
+ @media (forced-colors: active) {
907
+ :where([data-slot="table"] tbody > tr[data-selected] > :first-child) {
908
+ border-inline-start: 0.25rem solid Highlight;
909
+ }
910
+
911
+ :where([data-slot="table-selection"]:not([data-empty])) {
912
+ border: 1px solid CanvasText;
913
+ }
914
+
915
+ :where([data-slot="table-sort-icon"]) {
916
+ forced-color-adjust: auto;
917
+ }
918
+ }
919
+ }