@alulore/kumiko 0.20.1 → 0.21.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 (83) hide show
  1. package/dist/avatar/avatar.js +1 -1
  2. package/dist/badge/badge.css +41 -3
  3. package/dist/badge/badge.js +11 -4
  4. package/dist/board/board-slots.js +2 -1
  5. package/dist/board/scrollbar-gutter.js +26 -2
  6. package/dist/button/button.css +21 -7
  7. package/dist/card/card.css +3 -2
  8. package/dist/card/item-card.d.ts +1 -1
  9. package/dist/card/item-card.js +3 -2
  10. package/dist/chip/chip.css +6 -10
  11. package/dist/chip/chip.js +1 -1
  12. package/dist/form/error-line.js +4 -3
  13. package/dist/input/input.css +99 -114
  14. package/dist/list-row/list-row-motion.js +29 -10
  15. package/dist/media-viewer/gesture-press.d.ts +1 -0
  16. package/dist/media-viewer/gesture-press.js +12 -0
  17. package/dist/media-viewer/media-slide.d.ts +3 -1
  18. package/dist/media-viewer/media-slide.js +3 -2
  19. package/dist/media-viewer/media-viewer.css +5 -1
  20. package/dist/media-viewer/media-viewer.js +41 -23
  21. package/dist/media-viewer/stage-rect.d.ts +16 -0
  22. package/dist/media-viewer/stage-rect.js +56 -0
  23. package/dist/media-viewer/view-gesture.d.ts +1 -2
  24. package/dist/media-viewer/view-gesture.js +39 -44
  25. package/dist/media-viewer/viewer-chrome.d.ts +2 -1
  26. package/dist/media-viewer/viewer-chrome.js +3 -1
  27. package/dist/media-viewer/viewer-motion.d.ts +1 -0
  28. package/dist/media-viewer/viewer-motion.js +20 -7
  29. package/dist/media-viewer/zoom-pan.d.ts +1 -0
  30. package/dist/media-viewer/zoom-pan.js +3 -0
  31. package/dist/media-viewer/zoom-store.d.ts +8 -0
  32. package/dist/media-viewer/zoom-store.js +30 -0
  33. package/dist/menu/menu.js +6 -3
  34. package/dist/menu/point-menu.js +32 -12
  35. package/dist/motion/flip.js +33 -20
  36. package/dist/page/page-actions.js +2 -1
  37. package/dist/page/page-breadcrumbs.js +2 -1
  38. package/dist/page/use-measured-fit.d.ts +5 -0
  39. package/dist/page/use-measured-fit.js +47 -5
  40. package/dist/page/use-stuck.js +12 -2
  41. package/dist/pagination/pagination-fit.d.ts +3 -1
  42. package/dist/pagination/pagination-fit.js +4 -3
  43. package/dist/pagination/pagination-motion.js +18 -11
  44. package/dist/pagination/pagination.css +50 -6
  45. package/dist/pagination/pagination.js +20 -3
  46. package/dist/progress/progress.css +3 -2
  47. package/dist/progress/progress.js +15 -3
  48. package/dist/select/select-labels.d.ts +2 -0
  49. package/dist/select/select-labels.js +5 -1
  50. package/dist/select/select.css +7 -11
  51. package/dist/select/select.d.ts +1 -1
  52. package/dist/select/select.js +12 -6
  53. package/dist/shortcuts/hints.js +10 -4
  54. package/dist/shortcuts/provider.d.ts +4 -2
  55. package/dist/shortcuts/provider.js +14 -17
  56. package/dist/skeleton/skeleton.css +22 -9
  57. package/dist/slider/slider-feel.js +18 -6
  58. package/dist/slider/slider.css +9 -10
  59. package/dist/slider/slider.js +13 -10
  60. package/dist/smooth-caret/caret-controller.js +18 -6
  61. package/dist/smooth-caret/caret-geometry.js +18 -7
  62. package/dist/smooth-caret/caret-glide.js +3 -2
  63. package/dist/smooth-caret/remote-carets.js +20 -3
  64. package/dist/smooth-caret/smooth-caret.css +1 -1
  65. package/dist/switch/switch-gesture.d.ts +4 -4
  66. package/dist/switch/switch-gesture.js +52 -14
  67. package/dist/switch/switch.css +12 -13
  68. package/dist/switch/switch.d.ts +2 -1
  69. package/dist/switch/switch.js +4 -6
  70. package/dist/table/data-table.js +32 -12
  71. package/dist/table/table-cells.d.ts +20 -8
  72. package/dist/table/table-cells.js +18 -20
  73. package/dist/table/table-model.d.ts +0 -2
  74. package/dist/table/table-model.js +15 -9
  75. package/dist/table/table-search.d.ts +12 -0
  76. package/dist/table/table-search.js +34 -0
  77. package/dist/table/table-sections.d.ts +3 -2
  78. package/dist/table/table-sections.js +16 -13
  79. package/dist/table/table.css +2 -14
  80. package/dist/table/use-latest.d.ts +6 -0
  81. package/dist/table/use-latest.js +22 -0
  82. package/dist/table/use-table-view.js +36 -24
  83. package/package.json +1 -1
@@ -41,5 +41,5 @@ export function AvatarGroup({ max, size = "md", moreLabel = (hidden) => `${hidde
41
41
  * screen readers.
42
42
  */
43
43
  export function AvatarLabel({ name, detail, src, size = "md", shape, status, avatar, ...props }) {
44
- return (_jsxs("div", { "data-slot": "avatar-label", "data-size": size, ...props, children: [_jsx("span", { "data-slot": "avatar-label-picture", "aria-hidden": true, children: avatar ?? (_jsx(Avatar, { src: src, name: name, size: size, shape: shape, status: status })) }), _jsxs("span", { "data-slot": "avatar-label-text", children: [_jsx("span", { "data-slot": "avatar-label-name", children: name }), detail ? _jsx("span", { "data-slot": "avatar-label-detail", children: detail }) : null] })] }));
44
+ return (_jsxs("div", { "data-slot": "avatar-label", "data-size": size, ...props, children: [avatar ? (_jsx("span", { "data-slot": "avatar-label-picture", "aria-hidden": true, children: avatar })) : (_jsx(Avatar, { src: src, name: name, size: size, shape: shape, status: status, "aria-hidden": true })), _jsxs("span", { "data-slot": "avatar-label-text", children: [_jsx("span", { "data-slot": "avatar-label-name", children: name }), detail ? _jsx("span", { "data-slot": "avatar-label-detail", children: detail }) : null] })] }));
45
45
  }
@@ -131,14 +131,47 @@
131
131
  [data-kumiko-badge~="dot-pulse"] *
132
132
  )
133
133
  ):not([data-kumiko-motion="still"] *) {
134
- animation: kumiko-badge-pulse var(--kumiko-badge-pulse-duration) ease-in-out infinite;
134
+ position: relative;
135
+ background: transparent;
136
+ box-shadow: none;
137
+
138
+ /* The dot and its glow are drawn by two sibling layers: one scales, one fades and scales. A pulse on the dot itself, or on the dot and a layer inside it, is restyled on every frame; siblings run on the compositor. */
139
+ &::before,
140
+ &::after {
141
+ position: absolute;
142
+ inset: 0;
143
+ border-radius: inherit;
144
+ content: "";
145
+ pointer-events: none;
146
+ }
147
+
148
+ &::before {
149
+ background: var(--_dot-fill, var(--_tone));
150
+ box-shadow: 0 0 var(--_glow) calc(var(--_glow) * 0.25)
151
+ color-mix(in oklab, var(--_tone) var(--kumiko-badge-glow-mix), transparent);
152
+ animation: kumiko-badge-pulse var(--kumiko-badge-pulse-duration) ease-in-out
153
+ infinite;
154
+ }
155
+
156
+ &::after {
157
+ box-shadow: 0 0 calc(var(--_glow) * 2) var(--_glow)
158
+ color-mix(in oklab, var(--_tone) var(--kumiko-badge-glow-mix), transparent);
159
+ opacity: 0;
160
+ animation: kumiko-badge-pulse-glow var(--kumiko-badge-pulse-duration) ease-in-out
161
+ infinite;
162
+ }
135
163
  }
136
164
  }
137
165
 
138
166
  @keyframes kumiko-badge-pulse {
139
167
  50% {
140
- box-shadow: 0 0 calc(var(--_glow) * 2) var(--_glow)
141
- color-mix(in oklab, var(--_tone) var(--kumiko-badge-glow-mix), transparent);
168
+ scale: var(--kumiko-badge-pulse-scale);
169
+ }
170
+ }
171
+
172
+ @keyframes kumiko-badge-pulse-glow {
173
+ 50% {
174
+ opacity: 1;
142
175
  scale: var(--kumiko-badge-pulse-scale);
143
176
  }
144
177
  }
@@ -270,12 +303,17 @@
270
303
  }
271
304
 
272
305
  [data-slot="badge"][data-variant="dot"] {
306
+ --_glow: 0px;
307
+ --_dot-fill: CanvasText;
308
+
273
309
  border: 0;
274
310
  background: CanvasText;
275
311
  box-shadow: none;
276
312
  }
277
313
 
278
314
  [data-slot="badge"][data-variant="dot"][data-tone="accent"] {
315
+ --_dot-fill: Highlight;
316
+
279
317
  background: Highlight;
280
318
  }
281
319
 
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState } from "react";
2
+ import { useLayoutEffect, useRef, useState } from "react";
3
3
  /** Remembers the last value, which way a number moved and how many times it changed, and lets the old value go. */
4
4
  function useChange(value) {
5
5
  const [change, setChange] = useState({
@@ -8,8 +8,9 @@ function useChange(value) {
8
8
  direction: "up",
9
9
  tick: 0
10
10
  });
11
+ const settle = () => setChange((latest) => latest.previous === undefined ? latest : { ...latest, previous: undefined });
11
12
  if (change.shown === value) {
12
- return [change, () => setChange({ ...change, previous: undefined })];
13
+ return [change, settle];
13
14
  }
14
15
  const lower = typeof value === "number" && typeof change.shown === "number" && value < change.shown;
15
16
  const next = {
@@ -19,13 +20,19 @@ function useChange(value) {
19
20
  tick: change.tick + 1
20
21
  };
21
22
  setChange(next);
22
- return [next, () => setChange({ ...next, previous: undefined })];
23
+ return [next, settle];
23
24
  }
24
25
  /** A number or text that moves each time it changes, but not when it first appears. The old value is hidden from screen readers. */
25
26
  function Count({ value }) {
26
27
  const [change, settle] = useChange(value);
27
28
  const old = change.previous;
28
- return (_jsx("span", { "data-slot": "badge-clip", children: _jsxs("span", { "data-slot": "badge-value", "data-change": old === undefined ? undefined : change.direction, onAnimationEnd: (event) => {
29
+ const element = useRef(null);
30
+ useLayoutEffect(() => {
31
+ if (old !== undefined && element.current?.getAnimations().length === 0) {
32
+ settle();
33
+ }
34
+ }, [change.tick]);
35
+ return (_jsx("span", { "data-slot": "badge-clip", children: _jsxs("span", { ref: element, "data-slot": "badge-value", "data-change": old === undefined ? undefined : change.direction, onAnimationEnd: (event) => {
29
36
  if (event.target === event.currentTarget) {
30
37
  settle();
31
38
  }
@@ -20,10 +20,11 @@ export function rootSlot(slot) {
20
20
  attrs: (state) => ({ "data-rows": state.rows.length > 0 ? "" : undefined }),
21
21
  on: { click: (event, { api }) => api.selection.clickAway(event) },
22
22
  bind: (el, { store, api }) => {
23
+ /* First: a remembered gutter is written before motion's first read styles the board. */
24
+ const unbindGutter = bindScrollbarGutter(el);
23
25
  const unbindMotion = bindBoardMotion(el, store);
24
26
  const unbindPress = bindPressToDrop(store, api.transfer);
25
27
  const unbindHome = bindRefusedHome(el, store, api);
26
- const unbindGutter = bindScrollbarGutter(el);
27
28
  const unbindCapture = api.capture.bind(el);
28
29
  return () => {
29
30
  unbindCapture();
@@ -5,6 +5,19 @@
5
5
  * --kumiko-board-scrollbar-gutter, which they add above and below.
6
6
  */
7
7
  const px = (value) => Number(value.replace("px", ""));
8
+ /*
9
+ * The last gutter measured in each page. The variable inherits, so setting it
10
+ * after the board has been styled restyles every card. A later board starts
11
+ * from it before it's styled, and measures in its first frame, writing only
12
+ * if its own gutter differs.
13
+ */
14
+ const remembered = new WeakMap();
15
+ function write(root, value) {
16
+ remembered.set(root.ownerDocument, value);
17
+ if (root.style.getPropertyValue("--kumiko-board-scrollbar-gutter") !== value) {
18
+ root.style.setProperty("--kumiko-board-scrollbar-gutter", value);
19
+ }
20
+ }
8
21
  function measure(root) {
9
22
  const cell = root.querySelector('[data-slot="board-cell"]:not([data-folded])');
10
23
  if (!cell) {
@@ -13,15 +26,26 @@ function measure(root) {
13
26
  const style = getComputedStyle(cell);
14
27
  const borders = px(style.borderLeftWidth) + px(style.borderRightWidth);
15
28
  const gutter = (cell.offsetWidth - cell.clientWidth - borders) / 2;
16
- root.style.setProperty("--kumiko-board-scrollbar-gutter", `${Math.max(0, gutter)}px`);
29
+ write(root, `${Math.max(0, gutter)}px`);
17
30
  }
18
31
  export function bindScrollbarGutter(root) {
19
32
  const observer = new ResizeObserver(() => {
20
33
  measure(root);
21
34
  });
22
35
  observer.observe(root);
23
- measure(root);
36
+ const known = remembered.get(root.ownerDocument);
37
+ let first = 0;
38
+ if (known === undefined) {
39
+ measure(root);
40
+ }
41
+ else {
42
+ root.style.setProperty("--kumiko-board-scrollbar-gutter", known);
43
+ first = requestAnimationFrame(() => {
44
+ measure(root);
45
+ });
46
+ }
24
47
  return () => {
48
+ cancelAnimationFrame(first);
25
49
  observer.disconnect();
26
50
  };
27
51
  }
@@ -107,7 +107,8 @@
107
107
  var(--kumiko-button-shimmer-color) 50%,
108
108
  transparent 65%
109
109
  );
110
- --_shimmer-size: 250% 100%;
110
+ --_shimmer-span: 2.5;
111
+ --_shimmer-overflow: clip;
111
112
  --_orbit-animation: kumiko-button-orbit var(--kumiko-button-orbit-duration)
112
113
  var(--kumiko-button-sweep-ease) infinite;
113
114
  --_breathe-animation: kumiko-button-breathe var(--kumiko-button-breathe-duration)
@@ -364,12 +365,23 @@
364
365
  opacity: var(--kumiko-button-loading-dim);
365
366
  }
366
367
 
368
+ /* The band is a strip wider than the face that slides across it, so the sweep runs on the compositor. The face clips it at its outer edge. */
369
+ [data-slot="button"][data-status="loading"][data-loading-style="shimmer"] {
370
+ overflow: var(--_shimmer-overflow);
371
+ overflow-clip-margin: border-box;
372
+ }
373
+
367
374
  [data-slot="button"][data-status="loading"][data-loading-style="shimmer"]::after {
368
375
  content: "";
369
376
  position: absolute;
370
- inset: calc(var(--kumiko-button-border-width) * -1);
377
+ inset-block: calc(var(--kumiko-button-border-width) * -1);
378
+ left: calc(var(--kumiko-button-border-width) * -1);
379
+ right: calc(
380
+ var(--kumiko-button-border-width) * -1 -
381
+ (100% + var(--kumiko-button-border-width) * 2) * (var(--_shimmer-span) - 1)
382
+ );
371
383
  border-radius: inherit;
372
- background: var(--_shimmer-image) 100% 0 / var(--_shimmer-size) no-repeat;
384
+ background: var(--_shimmer-image) 100% 0 / 100% 100% no-repeat;
373
385
  pointer-events: none;
374
386
  animation: var(--_shimmer-animation);
375
387
  }
@@ -452,11 +464,11 @@
452
464
 
453
465
  @keyframes kumiko-button-shimmer {
454
466
  from {
455
- background-position: 100% 0;
467
+ translate: calc((1 / var(--_shimmer-span) - 1) * 100%) 0;
456
468
  }
457
469
 
458
470
  to {
459
- background-position: 0 0;
471
+ translate: 0 0;
460
472
  }
461
473
  }
462
474
 
@@ -524,7 +536,8 @@
524
536
  var(--kumiko-button-shimmer-color),
525
537
  var(--kumiko-button-shimmer-color)
526
538
  );
527
- --_shimmer-size: 100% 100%;
539
+ --_shimmer-span: 1;
540
+ --_shimmer-overflow: visible;
528
541
  --_orbit-animation: kumiko-button-fade var(--kumiko-button-reduced-duration)
529
542
  var(--kumiko-button-pulse-ease) infinite alternate;
530
543
  --_breathe-animation: kumiko-button-breathe var(--kumiko-button-reduced-duration)
@@ -546,7 +559,8 @@
546
559
  var(--kumiko-button-shimmer-color),
547
560
  var(--kumiko-button-shimmer-color)
548
561
  );
549
- --_shimmer-size: 100% 100%;
562
+ --_shimmer-span: 1;
563
+ --_shimmer-overflow: visible;
550
564
  --_orbit-animation: kumiko-button-fade var(--kumiko-button-reduced-duration)
551
565
  var(--kumiko-button-pulse-ease) infinite alternate;
552
566
  --_breathe-animation: kumiko-button-breathe var(--kumiko-button-reduced-duration)
@@ -588,12 +588,13 @@
588
588
  line-height: 1.2;
589
589
  }
590
590
 
591
- [data-slot="item-card-eyebrow"] > i {
591
+ [data-slot="item-card-eyebrow"]::before {
592
+ content: "";
592
593
  flex: none;
593
594
  inline-size: 0.5rem;
594
595
  block-size: 0.5rem;
595
596
  border-radius: 3px;
596
- background: var(--kumiko-item-card-dot);
597
+ background: var(--_eyebrow-dot, var(--kumiko-item-card-dot));
597
598
  rotate: 45deg;
598
599
  }
599
600
 
@@ -63,7 +63,7 @@ export type ItemCardEyebrowProps = React.ComponentPropsWithoutRef<"span"> & {
63
63
  dot?: string;
64
64
  };
65
65
  /** A small line above the title, led by a coloured diamond. */
66
- export declare function ItemCardEyebrow({ dot, children, ...props }: ItemCardEyebrowProps): React.JSX.Element;
66
+ export declare function ItemCardEyebrow({ dot, style, ...props }: ItemCardEyebrowProps): React.JSX.Element;
67
67
  /** The title. A done card shows it quiet, and struck through or drawn through, by its look. */
68
68
  export declare function ItemCardTitle({ children, ...props }: React.ComponentPropsWithoutRef<"span">): React.JSX.Element;
69
69
  export type ItemCardTextProps = React.ComponentPropsWithoutRef<"span"> & {
@@ -53,8 +53,9 @@ export function ItemCard({ asChild = false, pressable: pressableProp, onClick, c
53
53
  });
54
54
  }
55
55
  /** A small line above the title, led by a coloured diamond. */
56
- export function ItemCardEyebrow({ dot, children, ...props }) {
57
- return (_jsxs("span", { "data-slot": "item-card-eyebrow", ...props, children: [_jsx("i", { "aria-hidden": "true", style: dot ? { background: dot } : undefined }), children] }));
56
+ export function ItemCardEyebrow({ dot, style, ...props }) {
57
+ const own = dot ? { "--_eyebrow-dot": dot } : undefined;
58
+ return (_jsx("span", { "data-slot": "item-card-eyebrow", style: own ? { ...style, ...own } : style, ...props }));
58
59
  }
59
60
  /** The title. A done card shows it quiet, and struck through or drawn through, by its look. */
60
61
  export function ItemCardTitle({ children, ...props }) {
@@ -87,10 +87,7 @@
87
87
  /* The tick takes no room until the tint look asks for it. */
88
88
  [data-slot="chip-tick"] {
89
89
  display: none;
90
- }
91
-
92
- [data-slot="chip-tick"] > svg {
93
- display: block;
90
+ flex: none;
94
91
  inline-size: 1em;
95
92
  block-size: 1em;
96
93
  }
@@ -196,15 +193,14 @@
196
193
  )
197
194
  )
198
195
  [data-slot="chip-tick"] {
199
- display: inline-grid;
200
- inline-size: 0;
201
- margin-inline-end: calc(var(--kumiko-chip-gap) * -1);
202
- overflow: hidden;
196
+ display: block;
197
+ margin-inline-end: calc(-1em - var(--kumiko-chip-gap));
198
+ clip-path: inset(0 calc(50% + 50% * var(--_dir)) 0 calc(50% - 50% * var(--_dir)));
203
199
  opacity: 0;
204
200
  translate: calc(-0.5em * var(--_dir)) 0;
205
201
  transition:
206
- inline-size var(--kumiko-move-duration) var(--kumiko-move-ease),
207
202
  margin-inline-end var(--kumiko-move-duration) var(--kumiko-move-ease),
203
+ clip-path var(--kumiko-move-duration) var(--kumiko-move-ease),
208
204
  opacity var(--kumiko-fade-duration) var(--kumiko-fade-ease),
209
205
  translate var(--kumiko-move-duration) var(--kumiko-move-ease);
210
206
  }
@@ -217,8 +213,8 @@
217
213
  )
218
214
  )
219
215
  [data-slot="chip-tick"] {
220
- inline-size: 1em;
221
216
  margin-inline-end: 0;
217
+ clip-path: inset(0);
222
218
  opacity: 1;
223
219
  translate: 0 0;
224
220
  }
package/dist/chip/chip.js CHANGED
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Toggle } from "@ui-sdk/react/toggle";
3
3
  /** The tick of the tint look. It takes no room in the other looks. */
4
4
  function Tick() {
5
- return (_jsx("span", { "data-slot": "chip-tick", "aria-hidden": "true", children: _jsx("svg", { viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: _jsx("path", { d: "M3 8.5 6.5 12 13 4.5", strokeLinecap: "round", strokeLinejoin: "round" }) }) }));
5
+ return (_jsx("svg", { "data-slot": "chip-tick", "aria-hidden": "true", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: _jsx("path", { d: "M3 8.5 6.5 12 13 4.5", strokeLinecap: "round", strokeLinejoin: "round" }) }));
6
6
  }
7
7
  function Icon({ icon }) {
8
8
  return icon ? (_jsx("span", { "data-slot": "chip-icon", "aria-hidden": "true", children: icon })) : null;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useRef, useState } from "react";
2
+ import { useCallback, useEffect, useRef, useState } from "react";
3
3
  import { FieldError } from "../input";
4
4
  function noFade(element) {
5
5
  return getComputedStyle(element)
@@ -14,7 +14,8 @@ function useLeaving(message) {
14
14
  setPrevious(message);
15
15
  setLeaving(message === undefined ? previous : undefined);
16
16
  }
17
- return [leaving, () => setLeaving(undefined)];
17
+ const left = useCallback(() => setLeaving(undefined), []);
18
+ return [leaving, left];
18
19
  }
19
20
  /**
20
21
  * The field's error line. It always keeps one line of room, so an error that comes and goes moves nothing; a
@@ -42,6 +43,6 @@ export function ErrorLine({ message }) {
42
43
  if (fading.current && noFade(fading.current)) {
43
44
  left();
44
45
  }
45
- });
46
+ }, [leaving, left]);
46
47
  return (_jsx("div", { ref: line, "data-kumiko-form-error-line": "", children: _jsxs("div", { ref: content, children: [message === undefined ? null : _jsx(FieldError, { match: true, children: message }), leaving === undefined ? null : (_jsx("p", { ref: fading, "aria-hidden": "true", "data-kumiko-form-error-leaving": "", onTransitionEnd: left, onTransitionCancel: left, children: leaving }))] }) }));
47
48
  }
@@ -99,122 +99,107 @@
99
99
  --kumiko-input-cozy-height: 2.625rem;
100
100
  }
101
101
 
102
- /* The look: the chosen look's tokens become the working values. Cozy is the default; a container word or the field's own `data-look` picks another. */
102
+ /* The look: the chosen look's tokens become the working values. Cozy is the default; the nearest container word or the field's own `data-look` picks another. A word switches its look on and the others off for everything inside it, so the nearest word wins while the field still reads the tokens where it sits. */
103
103
  :where(:is([data-slot="input"], [data-slot="textarea"], [data-slot="input-group"])) {
104
- --_radius: var(--kumiko-input-cozy-radius);
105
- --_bg-rest: var(--kumiko-input-cozy-bg);
106
- --_bg-hover: var(--kumiko-input-cozy-bg-hover);
107
- --_bd-rest: var(--kumiko-input-cozy-border);
108
- --_bd-hover: var(--kumiko-input-cozy-border-hover);
109
- --_bd-focus: var(--kumiko-input-cozy-border-focus, var(--kumiko-input-cozy-border-hover));
110
- --_in-rest: var(--kumiko-input-cozy-inset);
111
- --_in-focus: var(--kumiko-input-cozy-inset-focus, var(--kumiko-input-cozy-inset));
112
- --_sh-rest: var(--kumiko-input-cozy-shadow);
113
- --_sh-hover: var(--kumiko-input-cozy-shadow-hover);
114
- --_sh-focus: var(--kumiko-input-cozy-shadow-focus);
115
- --_ring-w: var(--kumiko-input-cozy-ring-width);
116
- --_ring-c: var(--kumiko-input-cozy-ring);
117
- --_ph: var(--kumiko-input-cozy-placeholder);
118
- --_px: var(--kumiko-input-cozy-padding-inline);
119
- --_py: var(--kumiko-input-cozy-padding-block);
120
- --_fs: var(--kumiko-input-cozy-font-size);
121
- --_h: var(--kumiko-input-cozy-height);
122
- }
123
-
124
- :where(
125
- [data-kumiko-field~="look-cozy"]
126
- :is([data-slot="input"], [data-slot="textarea"], [data-slot="input-group"]),
127
- :is(
128
- [data-slot="input"],
129
- [data-slot="textarea"],
130
- [data-slot="input-group"]
131
- )[data-kumiko-field~="look-cozy"]
132
- ) {
133
- --_radius: var(--kumiko-input-cozy-radius);
134
- --_bg-rest: var(--kumiko-input-cozy-bg);
135
- --_bg-hover: var(--kumiko-input-cozy-bg-hover);
136
- --_bd-rest: var(--kumiko-input-cozy-border);
137
- --_bd-hover: var(--kumiko-input-cozy-border-hover);
138
- --_bd-focus: var(--kumiko-input-cozy-border-focus, var(--kumiko-input-cozy-border-hover));
139
- --_in-rest: var(--kumiko-input-cozy-inset);
140
- --_in-focus: var(--kumiko-input-cozy-inset-focus, var(--kumiko-input-cozy-inset));
141
- --_sh-rest: var(--kumiko-input-cozy-shadow);
142
- --_sh-hover: var(--kumiko-input-cozy-shadow-hover);
143
- --_sh-focus: var(--kumiko-input-cozy-shadow-focus);
144
- --_ring-w: var(--kumiko-input-cozy-ring-width);
145
- --_ring-c: var(--kumiko-input-cozy-ring);
146
- --_ph: var(--kumiko-input-cozy-placeholder);
147
- --_px: var(--kumiko-input-cozy-padding-inline);
148
- --_py: var(--kumiko-input-cozy-padding-block);
149
- --_fs: var(--kumiko-input-cozy-font-size);
150
- --_h: var(--kumiko-input-cozy-height);
151
- }
152
-
153
- :where(
154
- [data-kumiko-field~="look-calm"]
155
- :is([data-slot="input"], [data-slot="textarea"], [data-slot="input-group"]),
156
- :is(
157
- [data-slot="input"],
158
- [data-slot="textarea"],
159
- [data-slot="input-group"]
160
- )[data-kumiko-field~="look-calm"]
161
- ) {
162
- --_radius: var(--kumiko-input-calm-radius);
163
- --_bg-rest: var(--kumiko-input-calm-bg);
164
- --_bg-hover: var(--kumiko-input-calm-bg-hover);
165
- --_bd-rest: var(--kumiko-input-calm-border);
166
- --_bd-hover: var(--kumiko-input-calm-border-hover);
167
- --_bd-focus: var(--kumiko-input-calm-border-focus, var(--kumiko-input-accent));
168
- --_in-rest: var(--kumiko-input-calm-inset);
169
- --_in-focus: var(--kumiko-input-calm-inset-focus, var(--kumiko-input-calm-inset));
170
- --_sh-rest: var(--kumiko-input-calm-shadow);
171
- --_sh-hover: var(--kumiko-input-calm-shadow-hover);
172
- --_sh-focus: var(--kumiko-input-calm-shadow-focus);
173
- --_ring-w: var(--kumiko-input-calm-ring-width);
174
- --_ring-c: var(
175
- --kumiko-input-calm-ring,
176
- color-mix(in oklab, var(--kumiko-input-accent) 28%, transparent)
177
- );
178
- --_ph: var(--kumiko-input-calm-placeholder);
179
- --_px: var(--kumiko-input-calm-padding-inline);
180
- --_py: var(--kumiko-input-calm-padding-block);
181
- --_fs: var(--kumiko-input-calm-font-size);
182
- --_h: var(--kumiko-input-calm-height);
183
- }
184
-
185
- :where(
186
- [data-kumiko-field~="look-raised"]
187
- :is([data-slot="input"], [data-slot="textarea"], [data-slot="input-group"]),
188
- :is(
189
- [data-slot="input"],
190
- [data-slot="textarea"],
191
- [data-slot="input-group"]
192
- )[data-kumiko-field~="look-raised"]
193
- ) {
194
- --_radius: var(--kumiko-input-raised-radius);
195
- --_bg-rest: var(--kumiko-input-raised-bg);
196
- --_bg-hover: var(--kumiko-input-raised-bg-hover);
197
- --_bd-rest: var(--kumiko-input-raised-border);
198
- --_bd-hover: var(--kumiko-input-raised-border-hover);
104
+ --_radius: var(--_on-cozy, var(--kumiko-input-cozy-radius))
105
+ var(--_on-calm, var(--kumiko-input-calm-radius))
106
+ var(--_on-raised, var(--kumiko-input-raised-radius));
107
+ --_bg-rest: var(--_on-cozy, var(--kumiko-input-cozy-bg))
108
+ var(--_on-calm, var(--kumiko-input-calm-bg))
109
+ var(--_on-raised, var(--kumiko-input-raised-bg));
110
+ --_bg-hover: var(--_on-cozy, var(--kumiko-input-cozy-bg-hover))
111
+ var(--_on-calm, var(--kumiko-input-calm-bg-hover))
112
+ var(--_on-raised, var(--kumiko-input-raised-bg-hover));
113
+ --_bd-rest: var(--_on-cozy, var(--kumiko-input-cozy-border))
114
+ var(--_on-calm, var(--kumiko-input-calm-border))
115
+ var(--_on-raised, var(--kumiko-input-raised-border));
116
+ --_bd-hover: var(--_on-cozy, var(--kumiko-input-cozy-border-hover))
117
+ var(--_on-calm, var(--kumiko-input-calm-border-hover))
118
+ var(--_on-raised, var(--kumiko-input-raised-border-hover));
199
119
  --_bd-focus: var(
200
- --kumiko-input-raised-border-focus,
201
- color-mix(in oklab, var(--kumiko-input-accent) 45%, transparent)
202
- );
203
- --_in-rest: var(--kumiko-input-raised-inset);
204
- --_in-focus: var(--kumiko-input-raised-inset-focus, var(--kumiko-input-raised-inset));
205
- --_sh-rest: var(--kumiko-input-raised-shadow);
206
- --_sh-hover: var(--kumiko-input-raised-shadow-hover);
207
- --_sh-focus: var(--kumiko-input-raised-shadow-focus);
208
- --_ring-w: var(--kumiko-input-raised-ring-width);
209
- --_ring-c: var(
210
- --kumiko-input-raised-ring,
211
- color-mix(in oklab, var(--kumiko-input-accent) 50%, transparent)
212
- );
213
- --_ph: var(--kumiko-input-raised-placeholder);
214
- --_px: var(--kumiko-input-raised-padding-inline);
215
- --_py: var(--kumiko-input-raised-padding-block);
216
- --_fs: var(--kumiko-input-raised-font-size);
217
- --_h: var(--kumiko-input-raised-height);
120
+ --_on-cozy,
121
+ var(--kumiko-input-cozy-border-focus, var(--kumiko-input-cozy-border-hover))
122
+ )
123
+ var(--_on-calm, var(--kumiko-input-calm-border-focus, var(--kumiko-input-accent)))
124
+ var(
125
+ --_on-raised,
126
+ var(
127
+ --kumiko-input-raised-border-focus,
128
+ color-mix(in oklab, var(--kumiko-input-accent) 45%, transparent)
129
+ )
130
+ );
131
+ --_in-rest: var(--_on-cozy, var(--kumiko-input-cozy-inset))
132
+ var(--_on-calm, var(--kumiko-input-calm-inset))
133
+ var(--_on-raised, var(--kumiko-input-raised-inset));
134
+ --_in-focus: var(
135
+ --_on-cozy,
136
+ var(--kumiko-input-cozy-inset-focus, var(--kumiko-input-cozy-inset))
137
+ )
138
+ var(--_on-calm, var(--kumiko-input-calm-inset-focus, var(--kumiko-input-calm-inset)))
139
+ var(
140
+ --_on-raised,
141
+ var(--kumiko-input-raised-inset-focus, var(--kumiko-input-raised-inset))
142
+ );
143
+ --_sh-rest: var(--_on-cozy, var(--kumiko-input-cozy-shadow))
144
+ var(--_on-calm, var(--kumiko-input-calm-shadow))
145
+ var(--_on-raised, var(--kumiko-input-raised-shadow));
146
+ --_sh-hover: var(--_on-cozy, var(--kumiko-input-cozy-shadow-hover))
147
+ var(--_on-calm, var(--kumiko-input-calm-shadow-hover))
148
+ var(--_on-raised, var(--kumiko-input-raised-shadow-hover));
149
+ --_sh-focus: var(--_on-cozy, var(--kumiko-input-cozy-shadow-focus))
150
+ var(--_on-calm, var(--kumiko-input-calm-shadow-focus))
151
+ var(--_on-raised, var(--kumiko-input-raised-shadow-focus));
152
+ --_ring-w: var(--_on-cozy, var(--kumiko-input-cozy-ring-width))
153
+ var(--_on-calm, var(--kumiko-input-calm-ring-width))
154
+ var(--_on-raised, var(--kumiko-input-raised-ring-width));
155
+ --_ring-c: var(--_on-cozy, var(--kumiko-input-cozy-ring))
156
+ var(
157
+ --_on-calm,
158
+ var(
159
+ --kumiko-input-calm-ring,
160
+ color-mix(in oklab, var(--kumiko-input-accent) 28%, transparent)
161
+ )
162
+ )
163
+ var(
164
+ --_on-raised,
165
+ var(
166
+ --kumiko-input-raised-ring,
167
+ color-mix(in oklab, var(--kumiko-input-accent) 50%, transparent)
168
+ )
169
+ );
170
+ --_ph: var(--_on-cozy, var(--kumiko-input-cozy-placeholder))
171
+ var(--_on-calm, var(--kumiko-input-calm-placeholder))
172
+ var(--_on-raised, var(--kumiko-input-raised-placeholder));
173
+ --_px: var(--_on-cozy, var(--kumiko-input-cozy-padding-inline))
174
+ var(--_on-calm, var(--kumiko-input-calm-padding-inline))
175
+ var(--_on-raised, var(--kumiko-input-raised-padding-inline));
176
+ --_py: var(--_on-cozy, var(--kumiko-input-cozy-padding-block))
177
+ var(--_on-calm, var(--kumiko-input-calm-padding-block))
178
+ var(--_on-raised, var(--kumiko-input-raised-padding-block));
179
+ --_fs: var(--_on-cozy, var(--kumiko-input-cozy-font-size))
180
+ var(--_on-calm, var(--kumiko-input-calm-font-size))
181
+ var(--_on-raised, var(--kumiko-input-raised-font-size));
182
+ --_h: var(--_on-cozy, var(--kumiko-input-cozy-height))
183
+ var(--_on-calm, var(--kumiko-input-calm-height))
184
+ var(--_on-raised, var(--kumiko-input-raised-height));
185
+ }
186
+
187
+ :where(:root, [data-kumiko-field~="look-cozy"]) {
188
+ --_on-cozy: initial;
189
+ --_on-calm: ;
190
+ --_on-raised: ;
191
+ }
192
+
193
+ :where([data-kumiko-field~="look-calm"]) {
194
+ --_on-cozy: ;
195
+ --_on-calm: initial;
196
+ --_on-raised: ;
197
+ }
198
+
199
+ :where([data-kumiko-field~="look-raised"]) {
200
+ --_on-cozy: ;
201
+ --_on-calm: ;
202
+ --_on-raised: initial;
218
203
  }
219
204
 
220
205
  :where(