@alulore/kumiko 0.0.0-stage → 0.14.2

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 (194) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +31 -2
  3. package/dist/badge/badge.css +287 -0
  4. package/dist/badge/badge.d.ts +40 -0
  5. package/dist/badge/badge.js +51 -0
  6. package/dist/badge/index.d.ts +1 -0
  7. package/dist/badge/index.js +1 -0
  8. package/dist/board/board-api.d.ts +147 -0
  9. package/dist/board/board-api.js +139 -0
  10. package/dist/board/board-card-menu.d.ts +17 -0
  11. package/dist/board/board-card-menu.js +53 -0
  12. package/dist/board/board-drag-events.d.ts +12 -0
  13. package/dist/board/board-drag-events.js +86 -0
  14. package/dist/board/board-fold.d.ts +10 -0
  15. package/dist/board/board-fold.js +30 -0
  16. package/dist/board/board-group.d.ts +10 -0
  17. package/dist/board/board-group.js +28 -0
  18. package/dist/board/board-keys.d.ts +16 -0
  19. package/dist/board/board-keys.js +65 -0
  20. package/dist/board/board-locked-rows.d.ts +23 -0
  21. package/dist/board/board-locked-rows.js +77 -0
  22. package/dist/board/board-motion.d.ts +7 -0
  23. package/dist/board/board-motion.js +102 -0
  24. package/dist/board/board-primitive.d.ts +53 -0
  25. package/dist/board/board-primitive.js +66 -0
  26. package/dist/board/board-pull.d.ts +6 -0
  27. package/dist/board/board-pull.js +94 -0
  28. package/dist/board/board-selection.d.ts +42 -0
  29. package/dist/board/board-selection.js +130 -0
  30. package/dist/board/board-slots.d.ts +1003 -0
  31. package/dist/board/board-slots.js +250 -0
  32. package/dist/board/board-types.d.ts +99 -0
  33. package/dist/board/board-types.js +1 -0
  34. package/dist/board/board.css +343 -0
  35. package/dist/board/board.d.ts +290 -0
  36. package/dist/board/board.js +23 -0
  37. package/dist/board/card-menu.d.ts +21 -0
  38. package/dist/board/card-menu.js +79 -0
  39. package/dist/board/cell-key.d.ts +6 -0
  40. package/dist/board/cell-key.js +16 -0
  41. package/dist/board/index.d.ts +6 -0
  42. package/dist/board/index.js +5 -0
  43. package/dist/board/interactive.d.ts +18 -0
  44. package/dist/board/interactive.js +51 -0
  45. package/dist/board/keep-capture.d.ts +16 -0
  46. package/dist/board/keep-capture.js +57 -0
  47. package/dist/board/landing.d.ts +5 -0
  48. package/dist/board/landing.js +10 -0
  49. package/dist/board/press-to-drop.d.ts +9 -0
  50. package/dist/board/press-to-drop.js +28 -0
  51. package/dist/board/refused-home.d.ts +16 -0
  52. package/dist/board/refused-home.js +50 -0
  53. package/dist/board/repeat-gate.d.ts +4 -0
  54. package/dist/board/repeat-gate.js +12 -0
  55. package/dist/board/scrollbar-gutter.d.ts +1 -0
  56. package/dist/board/scrollbar-gutter.js +27 -0
  57. package/dist/board/touch-hold.d.ts +19 -0
  58. package/dist/board/touch-hold.js +103 -0
  59. package/dist/button/button.css +576 -0
  60. package/dist/button/button.d.ts +50 -0
  61. package/dist/button/button.js +70 -0
  62. package/dist/button/index.d.ts +2 -0
  63. package/dist/button/index.js +1 -0
  64. package/dist/checkbox/checkbox-mark.d.ts +8 -0
  65. package/dist/checkbox/checkbox-mark.js +17 -0
  66. package/dist/checkbox/checkbox-marks.d.ts +33 -0
  67. package/dist/checkbox/checkbox-marks.js +30 -0
  68. package/dist/checkbox/checkbox.css +201 -0
  69. package/dist/checkbox/checkbox.d.ts +26 -0
  70. package/dist/checkbox/checkbox.js +11 -0
  71. package/dist/checkbox/index.d.ts +3 -0
  72. package/dist/checkbox/index.js +3 -0
  73. package/dist/chip/chip.css +251 -0
  74. package/dist/chip/chip.d.ts +39 -0
  75. package/dist/chip/chip.js +25 -0
  76. package/dist/chip/index.d.ts +1 -0
  77. package/dist/chip/index.js +1 -0
  78. package/dist/dialog/dialog.css +247 -0
  79. package/dist/dialog/index.d.ts +3 -0
  80. package/dist/dialog/index.js +3 -0
  81. package/dist/hover-card/hover-card.css +149 -0
  82. package/dist/hover-card/hover-card.d.ts +3 -0
  83. package/dist/hover-card/hover-card.js +8 -0
  84. package/dist/hover-card/index.d.ts +2 -0
  85. package/dist/hover-card/index.js +2 -0
  86. package/dist/input/index.d.ts +5 -0
  87. package/dist/input/index.js +5 -0
  88. package/dist/input/input-attributes.d.ts +12 -0
  89. package/dist/input/input-attributes.js +9 -0
  90. package/dist/input/input.css +752 -0
  91. package/dist/input/input.d.ts +28 -0
  92. package/dist/input/input.js +9 -0
  93. package/dist/input/search-input.d.ts +41 -0
  94. package/dist/input/search-input.js +47 -0
  95. package/dist/kbd/index.d.ts +1 -0
  96. package/dist/kbd/index.js +1 -0
  97. package/dist/kbd/kbd.css +77 -0
  98. package/dist/kbd/kbd.d.ts +21 -0
  99. package/dist/kbd/kbd.js +37 -0
  100. package/dist/label/index.d.ts +1 -0
  101. package/dist/label/index.js +1 -0
  102. package/dist/label/label.css +37 -0
  103. package/dist/label/label.d.ts +13 -0
  104. package/dist/label/label.js +10 -0
  105. package/dist/menu/index.d.ts +3 -0
  106. package/dist/menu/index.js +3 -0
  107. package/dist/menu/menu.css +349 -0
  108. package/dist/menu/menu.d.ts +11 -0
  109. package/dist/menu/menu.js +86 -0
  110. package/dist/menu/point-menu.d.ts +26 -0
  111. package/dist/menu/point-menu.js +51 -0
  112. package/dist/motion/flip-math.d.ts +19 -0
  113. package/dist/motion/flip-math.js +33 -0
  114. package/dist/motion/flip.d.ts +40 -0
  115. package/dist/motion/flip.js +203 -0
  116. package/dist/motion/index.d.ts +2 -0
  117. package/dist/motion/index.js +2 -0
  118. package/dist/motion/motion.css +169 -0
  119. package/dist/popover/index.d.ts +1 -0
  120. package/dist/popover/index.js +1 -0
  121. package/dist/popover/popover.css +208 -0
  122. package/dist/progress/index.d.ts +2 -0
  123. package/dist/progress/index.js +2 -0
  124. package/dist/progress/progress.css +390 -0
  125. package/dist/progress/progress.d.ts +36 -0
  126. package/dist/progress/progress.js +107 -0
  127. package/dist/select/index.d.ts +3 -0
  128. package/dist/select/index.js +2 -0
  129. package/dist/select/select-labels.d.ts +6 -0
  130. package/dist/select/select-labels.js +64 -0
  131. package/dist/select/select-search.d.ts +18 -0
  132. package/dist/select/select-search.js +10 -0
  133. package/dist/select/select.css +470 -0
  134. package/dist/select/select.d.ts +44 -0
  135. package/dist/select/select.js +92 -0
  136. package/dist/separator/index.d.ts +2 -0
  137. package/dist/separator/index.js +1 -0
  138. package/dist/separator/separator.css +32 -0
  139. package/dist/separator/separator.d.ts +17 -0
  140. package/dist/separator/separator.js +10 -0
  141. package/dist/slider/index.d.ts +2 -0
  142. package/dist/slider/index.js +2 -0
  143. package/dist/slider/slider-bubble.css +203 -0
  144. package/dist/slider/slider-feel.d.ts +33 -0
  145. package/dist/slider/slider-feel.js +153 -0
  146. package/dist/slider/slider-format.d.ts +13 -0
  147. package/dist/slider/slider-format.js +15 -0
  148. package/dist/slider/slider-marks.d.ts +16 -0
  149. package/dist/slider/slider-marks.js +32 -0
  150. package/dist/slider/slider.css +335 -0
  151. package/dist/slider/slider.d.ts +34 -0
  152. package/dist/slider/slider.js +94 -0
  153. package/dist/smooth-caret/caret-box.d.ts +7 -0
  154. package/dist/smooth-caret/caret-box.js +8 -0
  155. package/dist/smooth-caret/caret-controller.d.ts +7 -0
  156. package/dist/smooth-caret/caret-controller.js +222 -0
  157. package/dist/smooth-caret/caret-geometry.d.ts +11 -0
  158. package/dist/smooth-caret/caret-geometry.js +230 -0
  159. package/dist/smooth-caret/caret-glide.d.ts +13 -0
  160. package/dist/smooth-caret/caret-glide.js +76 -0
  161. package/dist/smooth-caret/caret-host.d.ts +5 -0
  162. package/dist/smooth-caret/caret-host.js +40 -0
  163. package/dist/smooth-caret/index.d.ts +7 -0
  164. package/dist/smooth-caret/index.js +7 -0
  165. package/dist/smooth-caret/remote-carets.d.ts +40 -0
  166. package/dist/smooth-caret/remote-carets.js +130 -0
  167. package/dist/smooth-caret/smooth-caret.css +157 -0
  168. package/dist/smooth-caret/smooth-caret.d.ts +5 -0
  169. package/dist/smooth-caret/smooth-caret.js +9 -0
  170. package/dist/smooth-caret/use-smooth-caret.d.ts +5 -0
  171. package/dist/smooth-caret/use-smooth-caret.js +9 -0
  172. package/dist/switch/index.d.ts +2 -0
  173. package/dist/switch/index.js +2 -0
  174. package/dist/switch/switch-drag.d.ts +21 -0
  175. package/dist/switch/switch-drag.js +23 -0
  176. package/dist/switch/switch-gesture.d.ts +28 -0
  177. package/dist/switch/switch-gesture.js +131 -0
  178. package/dist/switch/switch.css +189 -0
  179. package/dist/switch/switch.d.ts +15 -0
  180. package/dist/switch/switch.js +24 -0
  181. package/dist/textarea/index.d.ts +2 -0
  182. package/dist/textarea/index.js +2 -0
  183. package/dist/textarea/textarea.css +37 -0
  184. package/dist/textarea/textarea.d.ts +35 -0
  185. package/dist/textarea/textarea.js +11 -0
  186. package/dist/toast/index.d.ts +2 -0
  187. package/dist/toast/index.js +2 -0
  188. package/dist/toast/toast.css +293 -0
  189. package/dist/tooltip/index.d.ts +2 -0
  190. package/dist/tooltip/index.js +2 -0
  191. package/dist/tooltip/tooltip.css +143 -0
  192. package/dist/tooltip/tooltip.d.ts +14 -0
  193. package/dist/tooltip/tooltip.js +13 -0
  194. package/package.json +243 -5
@@ -0,0 +1,189 @@
1
+ @import "../motion/motion.css";
2
+
3
+ @layer kumiko {
4
+ :where(:root) {
5
+ --kumiko-touch-target: 2.75rem;
6
+ --kumiko-switch-width: 4rem;
7
+ --kumiko-switch-height: 2.375rem;
8
+ --kumiko-switch-thumb-size: 1.375rem;
9
+ --kumiko-switch-inset: 0.5rem;
10
+ --kumiko-switch-width-sm: 2.875rem;
11
+ --kumiko-switch-height-sm: 1.75rem;
12
+ --kumiko-switch-thumb-size-sm: 1rem;
13
+ --kumiko-switch-inset-sm: 0.375rem;
14
+ --kumiko-switch-border-width: 1.5px;
15
+ --kumiko-switch-bg: color-mix(in oklab, CanvasText 10%, Canvas);
16
+ --kumiko-switch-border: color-mix(in oklab, CanvasText 45%, transparent);
17
+ --kumiko-switch-thumb-bg: CanvasText;
18
+ --kumiko-switch-checked-bg: Highlight;
19
+ --kumiko-switch-checked-thumb-bg: HighlightText;
20
+ --kumiko-switch-focus-ring: Highlight;
21
+ --kumiko-switch-disabled-opacity: 0.5;
22
+ }
23
+
24
+ [data-slot="switch"] {
25
+ --_width: var(--kumiko-switch-width);
26
+ --_height: var(--kumiko-switch-height);
27
+ --_thumb: var(--kumiko-switch-thumb-size);
28
+ --_inset: var(--kumiko-switch-inset);
29
+ --_travel: calc(var(--_width) - 2 * var(--_inset) - var(--_thumb));
30
+ --_direction: 1;
31
+
32
+ position: relative;
33
+ display: inline-flex;
34
+ box-sizing: border-box;
35
+ inline-size: var(--_width);
36
+ block-size: var(--_height);
37
+ flex: none;
38
+ align-items: center;
39
+ padding: calc(var(--_inset) - var(--kumiko-switch-border-width));
40
+ border: var(--kumiko-switch-border-width) solid var(--kumiko-switch-border);
41
+ border-radius: 999px;
42
+ background: var(--kumiko-switch-bg);
43
+ font: inherit;
44
+ cursor: var(--kumiko-press-cursor, pointer);
45
+ touch-action: pan-y;
46
+ transition:
47
+ background-color var(--kumiko-fade-duration) var(--kumiko-fade-ease),
48
+ border-color var(--kumiko-fade-duration) var(--kumiko-fade-ease);
49
+ }
50
+
51
+ [data-slot="switch"]:dir(rtl) {
52
+ --_direction: -1;
53
+ }
54
+
55
+ [data-slot="switch"][data-size="sm"] {
56
+ --_width: var(--kumiko-switch-width-sm);
57
+ --_height: var(--kumiko-switch-height-sm);
58
+ --_thumb: var(--kumiko-switch-thumb-size-sm);
59
+ --_inset: var(--kumiko-switch-inset-sm);
60
+ }
61
+
62
+ [data-slot="switch"][data-checked] {
63
+ border-color: var(--kumiko-switch-checked-border, var(--kumiko-switch-checked-bg));
64
+ background: var(--kumiko-switch-checked-bg);
65
+ }
66
+
67
+ [data-slot="switch"]:focus-visible {
68
+ outline: 2px solid var(--kumiko-switch-focus-ring);
69
+ outline-offset: 2px;
70
+ }
71
+
72
+ [data-slot="switch"][data-disabled] {
73
+ opacity: var(--kumiko-switch-disabled-opacity);
74
+ cursor: not-allowed;
75
+ }
76
+
77
+ /* Read-only is a status, not a control: no fill, just an outline, and the state is told by colour alone. It is not dimmed, so it never looks like disabled. */
78
+ [data-slot="switch"][data-readonly] {
79
+ border-color: var(--kumiko-switch-readonly-border, var(--kumiko-switch-border));
80
+ background: var(--kumiko-switch-readonly-bg, transparent);
81
+ cursor: default;
82
+ }
83
+
84
+ [data-slot="switch"][data-readonly][data-disabled] {
85
+ cursor: not-allowed;
86
+ }
87
+
88
+ [data-slot="switch"][data-readonly][data-checked] {
89
+ border-color: var(--kumiko-switch-readonly-checked-border, var(--kumiko-switch-checked-bg));
90
+ }
91
+
92
+ [data-slot="switch-thumb"] {
93
+ display: block;
94
+ inline-size: var(--_thumb);
95
+ block-size: var(--_thumb);
96
+ border-radius: 999px;
97
+ background: var(--kumiko-switch-thumb-bg);
98
+ translate: 0 0;
99
+ transition:
100
+ background-color var(--kumiko-fade-duration) var(--kumiko-fade-ease),
101
+ translate var(--kumiko-move-duration) var(--kumiko-move-ease),
102
+ scale var(--kumiko-press-duration) var(--kumiko-press-ease);
103
+ }
104
+
105
+ [data-slot="switch"][data-checked] [data-slot="switch-thumb"] {
106
+ background: var(--kumiko-switch-checked-thumb-bg);
107
+ translate: calc(var(--_travel) * var(--_direction)) 0;
108
+ }
109
+
110
+ [data-slot="switch"][data-readonly] [data-slot="switch-thumb"] {
111
+ background: var(--kumiko-switch-readonly-thumb-bg, var(--kumiko-switch-border));
112
+ }
113
+
114
+ [data-slot="switch"][data-readonly][data-checked] [data-slot="switch-thumb"] {
115
+ background: var(--kumiko-switch-readonly-checked-thumb-bg, var(--kumiko-switch-checked-bg));
116
+ }
117
+
118
+ /* While the thumb is dragged it sits where the pointer put it, so it never lags behind. */
119
+ [data-slot="switch"][data-dragging] [data-slot="switch-thumb"] {
120
+ translate: calc(var(--kumiko-switch-drag-x, 0px) * var(--_direction)) 0;
121
+ transition-property: background-color, scale;
122
+ }
123
+
124
+ [data-slot="switch"]:not([data-disabled], [data-readonly]):active [data-slot="switch-thumb"] {
125
+ scale: var(--kumiko-squash-x) var(--kumiko-squash-y);
126
+ }
127
+
128
+ @media (hover: hover) and (pointer: fine) {
129
+ [data-slot="switch"]:not([data-disabled], [data-readonly]):hover:not(:active)
130
+ [data-slot="switch-thumb"] {
131
+ scale: calc(1 + (var(--kumiko-hover-scale) - 1) * 1.5);
132
+ }
133
+ }
134
+
135
+ /* Forced colours replace colours that are not system colours, so the track and thumb keep to the system palette. */
136
+ @media (forced-colors: active) {
137
+ [data-slot="switch"] {
138
+ border-color: ButtonText;
139
+ background: Canvas;
140
+ }
141
+
142
+ [data-slot="switch-thumb"] {
143
+ background: ButtonText;
144
+ }
145
+
146
+ [data-slot="switch"][data-checked] {
147
+ border-color: Highlight;
148
+ background: Highlight;
149
+ }
150
+
151
+ [data-slot="switch"][data-checked] [data-slot="switch-thumb"] {
152
+ background: HighlightText;
153
+ }
154
+
155
+ [data-slot="switch"][data-readonly] {
156
+ border-color: ButtonText;
157
+ background: Canvas;
158
+ }
159
+
160
+ [data-slot="switch"][data-readonly] [data-slot="switch-thumb"] {
161
+ background: ButtonText;
162
+ }
163
+
164
+ [data-slot="switch"][data-readonly][data-checked] {
165
+ border-color: Highlight;
166
+ }
167
+
168
+ [data-slot="switch"][data-readonly][data-checked] [data-slot="switch-thumb"] {
169
+ background: Highlight;
170
+ }
171
+ }
172
+
173
+ /* On a finger, an invisible area around the track reaches the touch target, and the track itself does not grow. */
174
+ @media (pointer: coarse) {
175
+ [data-slot="switch"]::after {
176
+ content: "";
177
+ position: absolute;
178
+ inset-block-start: 50%;
179
+ inset-inline-start: 50%;
180
+ inline-size: max(var(--_width), var(--kumiko-touch-target));
181
+ block-size: max(var(--_height), var(--kumiko-touch-target));
182
+ translate: -50% -50%;
183
+ }
184
+
185
+ [data-slot="switch"]:dir(rtl)::after {
186
+ translate: 50% -50%;
187
+ }
188
+ }
189
+ }
@@ -0,0 +1,15 @@
1
+ import { Switch as SdkSwitch } from "@ui-sdk/react/switch";
2
+ type SdkSwitchProps = Parameters<typeof SdkSwitch>[0];
3
+ export type SwitchProps = Omit<SdkSwitchProps, "children"> & {
4
+ /**
5
+ * The size of the track and thumb.
6
+ * @defaultValue "md"
7
+ */
8
+ size?: "sm" | "md";
9
+ };
10
+ /**
11
+ * The ui-sdk switch with Kumiko's look and motion. A tap flips it, and the thumb can also be dragged: it
12
+ * follows the pointer along the track, and the switch ends on the side where the thumb's centre is.
13
+ */
14
+ export declare function Switch({ size, controller, ...props }: SwitchProps): React.JSX.Element;
15
+ export {};
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createSwitchController, Switch as SdkSwitch, SwitchThumb } from "@ui-sdk/react/switch";
3
+ import { useState } from "react";
4
+ import { useSwitchDrag } from "./switch-gesture";
5
+ function dragStyle(offset) {
6
+ return { "--kumiko-switch-drag-x": `${offset}px` };
7
+ }
8
+ /** Runs the caller's handler first, then Kumiko's, so the caller can still see every event. */
9
+ function alongside(callers, ours) {
10
+ return (event) => {
11
+ callers?.(event);
12
+ ours(event);
13
+ };
14
+ }
15
+ /**
16
+ * The ui-sdk switch with Kumiko's look and motion. A tap flips it, and the thumb can also be dragged: it
17
+ * follows the pointer along the track, and the switch ends on the side where the thumb's centre is.
18
+ */
19
+ export function Switch({ size = "md", controller, ...props }) {
20
+ const [own] = useState(createSwitchController);
21
+ const used = controller ?? own;
22
+ const drag = useSwitchDrag(used);
23
+ return (_jsx(SdkSwitch, { "data-size": size, "data-dragging": drag.offset === null ? undefined : "", ...props, controller: used, onPointerDown: alongside(props.onPointerDown, drag.down), onPointerMove: alongside(props.onPointerMove, drag.move), onPointerUp: alongside(props.onPointerUp, drag.up), onPointerCancel: alongside(props.onPointerCancel, drag.cancel), onClick: alongside(props.onClick, drag.click), children: _jsx(SwitchThumb, { style: drag.offset === null ? undefined : dragStyle(drag.offset) }) }));
24
+ }
@@ -0,0 +1,2 @@
1
+ export { Textarea, type TextareaProps } from "./textarea";
2
+ export { type TextareaOptions, type TextareaPrimitive, type TextareaState, type TextareaSubmitDetails } from "@ui-sdk/react/textarea";
@@ -0,0 +1,2 @@
1
+ export { Textarea } from "./textarea";
2
+ export {} from "@ui-sdk/react/textarea";
@@ -0,0 +1,37 @@
1
+ @import "../input/input.css";
2
+
3
+ @layer kumiko {
4
+ :where(:root) {
5
+ --kumiko-textarea-min-height: 5rem;
6
+ --kumiko-textarea-max-height: 12rem;
7
+ }
8
+
9
+ :where([data-slot="textarea"]) {
10
+ display: block;
11
+ line-height: 1.45;
12
+ resize: vertical;
13
+ }
14
+
15
+ :where([data-slot="textarea"]:not([data-variant="bare"])) {
16
+ min-block-size: var(--kumiko-textarea-min-height);
17
+ padding-block: var(--_py);
18
+ }
19
+
20
+ :where([data-slot="textarea"][data-variant="bare"]) {
21
+ resize: none;
22
+ }
23
+
24
+ /* Growth. It grows to a maximum height, then scrolls. */
25
+ :where([data-slot="textarea"][data-auto-resize]) {
26
+ max-block-size: var(--kumiko-textarea-max-height);
27
+ overflow-y: auto;
28
+ }
29
+
30
+ /* No drag handle, as a container word or on one textarea. */
31
+ :where(
32
+ [data-kumiko-field~="no-drag"] [data-slot="textarea"],
33
+ [data-slot="textarea"][data-no-drag]
34
+ ) {
35
+ resize: none;
36
+ }
37
+ }
@@ -0,0 +1,35 @@
1
+ import { Textarea as SdkTextarea } from "@ui-sdk/react/textarea";
2
+ import type { InputLook, InputSize } from "../input/input-attributes";
3
+ type SdkTextareaProps = Parameters<typeof SdkTextarea>[0];
4
+ export type TextareaProps = Omit<SdkTextareaProps, "size"> & {
5
+ /** @defaultValue "default" */
6
+ size?: InputSize;
7
+ /**
8
+ * Grows and shrinks with the text, up to `--kumiko-textarea-max-height`.
9
+ * @defaultValue true
10
+ */
11
+ autoResize?: boolean;
12
+ /** The look of this field, as on `Input`. */
13
+ look?: InputLook;
14
+ /**
15
+ * Whether the drag handle shows. Off, or the `no-drag` container word, hides it.
16
+ * @defaultValue true
17
+ */
18
+ resizable?: boolean;
19
+ /**
20
+ * `bare` has no border or background, for text edited in place.
21
+ * @defaultValue "field"
22
+ */
23
+ variant?: "field" | "bare";
24
+ /**
25
+ * Whether the gliding caret follows this field. Off keeps the browser's caret.
26
+ * @defaultValue true
27
+ */
28
+ smoothCaret?: boolean;
29
+ };
30
+ /**
31
+ * The ui-sdk textarea with the shared field look. It grows with its text up to `--kumiko-textarea-max-height`,
32
+ * then scrolls; `autoResize={false}` keeps its size.
33
+ */
34
+ export declare function Textarea({ size, look, variant, autoResize, resizable, smoothCaret, ...props }: TextareaProps): React.JSX.Element;
35
+ export {};
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Textarea as SdkTextarea } from "@ui-sdk/react/textarea";
3
+ import { useSmoothCaret } from "../smooth-caret/use-smooth-caret";
4
+ /**
5
+ * The ui-sdk textarea with the shared field look. It grows with its text up to `--kumiko-textarea-max-height`,
6
+ * then scrolls; `autoResize={false}` keeps its size.
7
+ */
8
+ export function Textarea({ size = "default", look, variant = "field", autoResize = true, resizable = true, smoothCaret = true, ...props }) {
9
+ useSmoothCaret(smoothCaret);
10
+ return (_jsx(SdkTextarea, { ...props, autoResize: autoResize, "data-slot": "textarea", "data-size": size, "data-look": look, "data-native-caret": smoothCaret ? undefined : "", "data-no-drag": resizable ? undefined : "", "data-variant": variant === "bare" ? "bare" : undefined, "data-auto-resize": autoResize ? "" : undefined }));
11
+ }
@@ -0,0 +1,2 @@
1
+ export { createToaster, Toast, toast, ToastAction, ToastClose, ToastDescription, ToastRegion, ToastTitle, type ToastActionData, type ToastActionDetails, type ToastActionProps, type ToastButtonState, type ToastCancel, type ToastCloseProps, type ToastData, type ToastDismissDetails, type ToastDismissReason, type Toaster, type ToastItem, type ToastOptions, type ToastPauseReason, type ToastRegionOptions, type ToastRegionProps, type ToastRegionState, type ToastState, type ToastType } from "@ui-sdk/react/toast";
2
+ export { OverlayHost, type OverlayHostProps } from "@ui-sdk/react/overlays";
@@ -0,0 +1,2 @@
1
+ export { createToaster, Toast, toast, ToastAction, ToastClose, ToastDescription, ToastRegion, ToastTitle } from "@ui-sdk/react/toast";
2
+ export { OverlayHost } from "@ui-sdk/react/overlays";
@@ -0,0 +1,293 @@
1
+ @import "../motion/motion.css";
2
+
3
+ /*
4
+ * Styles ui-sdk's toasts: the region (a popover="manual" in the top layer), its list and each toast.
5
+ * The stack is laid out with the block edges (inset-block-*), so a toast at rest has no translate
6
+ * or scale: anything but "none" would make it a containing block for fixed-position descendants.
7
+ */
8
+ @layer kumiko {
9
+ :where(:root) {
10
+ --kumiko-toast-bg: Canvas;
11
+ --kumiko-toast-fg: CanvasText;
12
+ --kumiko-toast-border-width: 1px;
13
+ --kumiko-toast-radius: 0.75rem;
14
+ --kumiko-toast-shadow: 0 12px 32px -10px color-mix(in oklab, CanvasText 32%, transparent);
15
+ --kumiko-toast-padding: 0.75rem 1rem;
16
+ --kumiko-toast-width: 22rem;
17
+ --kumiko-toast-gap: 0.75rem;
18
+ --kumiko-toast-inset: 1rem;
19
+ --kumiko-toast-font-size: 0.875rem;
20
+ --kumiko-toast-title-weight: 600;
21
+ --kumiko-toast-description-size: 0.93em;
22
+ --kumiko-toast-description-weight: 400;
23
+ --kumiko-toast-action-radius: 0.5rem;
24
+ --kumiko-toast-focus-ring: Highlight;
25
+ --kumiko-toast-accent-width: 3px;
26
+ --kumiko-toast-success: #1f9d55;
27
+ --kumiko-toast-error: #d64545;
28
+ --kumiko-toast-warning: #d98e04;
29
+ --kumiko-toast-info: #3b82c4;
30
+ --kumiko-toast-peek: 0.5rem;
31
+ --kumiko-toast-stack-step: 0.05;
32
+ }
33
+
34
+ /*
35
+ * ui-sdk resets the region, a popover, to no inset, margin, border or padding, and puts it on its
36
+ * side and alignment edges (a centred one with left: 50% and a translate). Kumiko sizes it, and
37
+ * keeps it off the screen edges with a margin, which ui-sdk's edges don't use.
38
+ */
39
+ :where([data-slot="toast-region"]) {
40
+ --_toast-away: 1;
41
+
42
+ box-sizing: border-box;
43
+ inline-size: min(var(--kumiko-toast-width), 100vw - 2 * var(--kumiko-toast-inset));
44
+ block-size: var(--toast-front-height);
45
+ margin: var(--kumiko-toast-inset);
46
+ }
47
+
48
+ :where([data-slot="toast-region"][data-expanded]) {
49
+ block-size: calc(
50
+ var(--toast-stack-height) + (var(--toast-count) - 1) * var(--kumiko-toast-gap)
51
+ );
52
+ }
53
+
54
+ :where([data-slot="toast-region"][data-side="top"]) {
55
+ --_toast-away: -1;
56
+ }
57
+
58
+ /* A centred region is placed by ui-sdk's left: 50% and translate, so a margin would push it off centre. */
59
+ :where([data-slot="toast-region"][data-align="center"]) {
60
+ margin-inline: 0;
61
+ }
62
+
63
+ :where([data-slot="toast-list"]) {
64
+ margin: 0;
65
+ padding: 0;
66
+ list-style: none;
67
+ }
68
+
69
+ :where([data-slot="toast"]) {
70
+ /* Derived colours resolve on the toast, so they follow a fg and bg set on any container. */
71
+ --_toast-border: var(
72
+ --kumiko-toast-border,
73
+ color-mix(in oklab, var(--kumiko-toast-fg) 14%, transparent)
74
+ );
75
+ --_toast-muted-fg: var(
76
+ --kumiko-toast-muted-fg,
77
+ color-mix(in oklab, var(--kumiko-toast-fg) 64%, var(--kumiko-toast-bg))
78
+ );
79
+ --_toast-accent: transparent;
80
+ --_toast-slide: var(--kumiko-toast-slide, calc(var(--kumiko-pop-distance) * 4));
81
+ --_toast-edge: calc(var(--toast-index, 0) * var(--kumiko-toast-peek));
82
+
83
+ position: absolute;
84
+ inset-inline: 0;
85
+ z-index: calc(100 - var(--toast-index, 0));
86
+ display: flex;
87
+ align-items: center;
88
+ gap: 0.25rem 0.75rem;
89
+ box-sizing: border-box;
90
+ block-size: var(--toast-height);
91
+ margin: 0;
92
+ padding: var(--kumiko-toast-padding);
93
+ overflow: hidden;
94
+ border: var(--kumiko-toast-border-width) solid var(--_toast-border);
95
+ border-radius: var(--kumiko-toast-radius);
96
+ background: var(--kumiko-toast-bg);
97
+ box-shadow: var(--kumiko-toast-shadow);
98
+ color: var(--kumiko-toast-fg);
99
+ font-size: var(--kumiko-toast-font-size);
100
+ line-height: 1.4;
101
+ list-style: none;
102
+ transform-origin: center bottom;
103
+ user-select: none;
104
+
105
+ /* Moving takes the move tokens and fading the fade tokens. */
106
+ transition-property:
107
+ translate, scale, opacity, block-size, inset-block-start, inset-block-end;
108
+ transition-duration:
109
+ var(--kumiko-move-duration), var(--kumiko-move-duration), var(--kumiko-fade-duration),
110
+ var(--kumiko-move-duration), var(--kumiko-move-duration), var(--kumiko-move-duration);
111
+ transition-timing-function:
112
+ var(--kumiko-move-ease), var(--kumiko-move-ease), var(--kumiko-fade-ease),
113
+ var(--kumiko-move-ease), var(--kumiko-move-ease), var(--kumiko-move-ease);
114
+ }
115
+
116
+ /* The type shows as a thin edge on the toast's start side. */
117
+ :where([data-slot="toast"])::before {
118
+ content: "";
119
+ position: absolute;
120
+ inset-block: 0;
121
+ inset-inline-start: 0;
122
+ inline-size: var(--kumiko-toast-accent-width);
123
+ background: var(--_toast-accent);
124
+ pointer-events: none;
125
+ }
126
+
127
+ :where([data-slot="toast"][data-type="success"]) {
128
+ --_toast-accent: var(--kumiko-toast-success);
129
+ }
130
+
131
+ :where([data-slot="toast"][data-type="error"]) {
132
+ --_toast-accent: var(--kumiko-toast-error);
133
+ }
134
+
135
+ :where([data-slot="toast"][data-type="warning"]) {
136
+ --_toast-accent: var(--kumiko-toast-warning);
137
+ }
138
+
139
+ :where([data-slot="toast"][data-type="info"]) {
140
+ --_toast-accent: var(--kumiko-toast-info);
141
+ }
142
+
143
+ :where([data-slot="toast"][data-type="loading"]) {
144
+ --_toast-accent: var(
145
+ --kumiko-toast-loading,
146
+ color-mix(in oklab, var(--kumiko-toast-fg) 40%, var(--kumiko-toast-bg))
147
+ );
148
+ }
149
+
150
+ /* The newest toast is on top of the stack, and those behind it peek out beyond it. */
151
+ :where([data-slot="toast-region"][data-side="bottom"] [data-slot="toast"]) {
152
+ inset-block-end: var(--_toast-edge);
153
+ }
154
+
155
+ :where([data-slot="toast-region"][data-side="top"] [data-slot="toast"]) {
156
+ inset-block-start: var(--_toast-edge);
157
+ transform-origin: center top;
158
+ }
159
+
160
+ /* Only a toast behind the newest, in a closed stack, is scaled: the newest and every toast in an open stack rest at "none". */
161
+ :where([data-slot="toast"]:not([data-front], [data-expanded])) {
162
+ block-size: var(--toast-front-height);
163
+ scale: calc(1 - var(--toast-index, 0) * var(--kumiko-toast-stack-step));
164
+ }
165
+
166
+ :where([data-slot="toast"][data-expanded]) {
167
+ --_toast-edge: calc(
168
+ var(--toast-offset, 0px) + var(--toast-index, 0) * var(--kumiko-toast-gap)
169
+ );
170
+ }
171
+
172
+ /* The newest toast rises into place with the pop tokens. */
173
+ :where([data-slot="toast"][data-front]) {
174
+ transition-duration:
175
+ var(--kumiko-pop-duration), var(--kumiko-pop-duration), var(--kumiko-fade-duration),
176
+ var(--kumiko-move-duration), var(--kumiko-move-duration), var(--kumiko-move-duration);
177
+ transition-timing-function:
178
+ var(--kumiko-pop-ease), var(--kumiko-pop-ease), var(--kumiko-fade-ease),
179
+ var(--kumiko-move-ease), var(--kumiko-move-ease), var(--kumiko-move-ease);
180
+ }
181
+
182
+ /* Coming in, a toast fades and slides from its region's edge. Those behind only fade. */
183
+ :where([data-slot="toast"][data-starting-style]) {
184
+ opacity: 0;
185
+ }
186
+
187
+ :where([data-slot="toast"][data-starting-style][data-front]) {
188
+ translate: 0 calc(var(--_toast-away) * var(--_toast-slide));
189
+ }
190
+
191
+ /* Going out, it fades and slides back to the edge. A swiped toast carries on the way it went. */
192
+ :where([data-slot="toast"][data-ending-style]) {
193
+ opacity: 0;
194
+ translate: 0 calc(var(--_toast-away) * var(--_toast-slide));
195
+ }
196
+
197
+ :where([data-slot="toast"][data-ending-style][data-swipe-direction]) {
198
+ translate: var(--toast-swipe-x, 0px) var(--toast-swipe-y, 0px);
199
+ }
200
+
201
+ :where([data-slot="toast"][data-ending-style][data-swipe-direction="left"]) {
202
+ translate: calc(var(--toast-swipe-x, 0px) - var(--_toast-slide)) var(--toast-swipe-y, 0px);
203
+ }
204
+
205
+ :where([data-slot="toast"][data-ending-style][data-swipe-direction="right"]) {
206
+ translate: calc(var(--toast-swipe-x, 0px) + var(--_toast-slide)) var(--toast-swipe-y, 0px);
207
+ }
208
+
209
+ /* A swipe follows the pointer, with no easing. */
210
+ :where([data-slot="toast"][data-swiping]) {
211
+ translate: var(--toast-swipe-x, 0px) var(--toast-swipe-y, 0px);
212
+ transition: none;
213
+ }
214
+
215
+ /* The text. The default markup wraps the title and description in a plain div. */
216
+ :where([data-slot="toast"] > :not([data-slot], button, a)),
217
+ :where([data-slot="toast"] > [data-slot="toast-title"]:first-child) {
218
+ flex: 1 1 0;
219
+ min-inline-size: 0;
220
+ }
221
+
222
+ :where([data-slot="toast-title"]) {
223
+ margin: 0;
224
+ font-weight: var(--kumiko-toast-title-weight);
225
+ overflow-wrap: anywhere;
226
+ }
227
+
228
+ :where([data-slot="toast-description"]) {
229
+ margin: 0;
230
+ color: var(--kumiko-toast-description-fg, var(--_toast-muted-fg));
231
+ font-size: var(--kumiko-toast-description-size);
232
+ font-weight: var(--kumiko-toast-description-weight);
233
+ overflow-wrap: anywhere;
234
+ }
235
+
236
+ /* The action is filled, and the cancel and close buttons are quiet. */
237
+ :where([data-slot="toast-action"], [data-slot="toast-close"]) {
238
+ display: inline-flex;
239
+ flex: none;
240
+ align-items: center;
241
+ justify-content: center;
242
+ box-sizing: border-box;
243
+ min-block-size: 2rem;
244
+ margin: 0;
245
+ padding: 0 0.75rem;
246
+ border: 0;
247
+ border-radius: var(--kumiko-toast-action-radius);
248
+ font: inherit;
249
+ font-weight: 600;
250
+ line-height: 1;
251
+ text-decoration: none;
252
+ cursor: var(--kumiko-press-cursor, pointer);
253
+ }
254
+
255
+ :where([data-slot="toast-action"]) {
256
+ background: var(--kumiko-toast-action-bg, var(--kumiko-toast-fg));
257
+ color: var(--kumiko-toast-action-fg, var(--kumiko-toast-bg));
258
+ }
259
+
260
+ :where([data-slot="toast-close"]) {
261
+ background: transparent;
262
+ color: var(--kumiko-toast-cancel-fg, var(--_toast-muted-fg));
263
+ font-weight: 500;
264
+ }
265
+
266
+ :where([data-slot="toast-close"]:hover) {
267
+ background: color-mix(in oklab, var(--kumiko-toast-fg) 10%, transparent);
268
+ color: var(--kumiko-toast-fg);
269
+ }
270
+
271
+ :where([data-slot="toast-action"][data-pending], [data-slot="toast-close"][data-pending]) {
272
+ opacity: 0.6;
273
+ cursor: progress;
274
+ }
275
+
276
+ :where([data-slot="toast-action"]:focus-visible, [data-slot="toast-close"]:focus-visible) {
277
+ outline: 2px solid var(--kumiko-toast-focus-ring);
278
+ outline-offset: 1px;
279
+ }
280
+
281
+ /* Leaving, everything moves for as long as the fade lasts and on its curve, so nothing stops mid-fade. */
282
+ :where([data-slot="toast"][data-ending-style]) {
283
+ transition-duration: var(--kumiko-fade-duration);
284
+ transition-timing-function: var(--kumiko-exit-ease);
285
+ }
286
+
287
+ /* With reduced motion a toast only fades. */
288
+ @media (prefers-reduced-motion: reduce) {
289
+ :where([data-slot="toast"]) {
290
+ transition-property: opacity;
291
+ }
292
+ }
293
+ }
@@ -0,0 +1,2 @@
1
+ export { Tooltip, TooltipContent, type TooltipContentProps } from "./tooltip";
2
+ export { createTooltipController, TooltipArrow, TooltipShortcut, TooltipTrigger, type TooltipApi, type TooltipArrowState, type TooltipContentState, type TooltipController, type TooltipOpenChangeReason, type TooltipOptions, type TooltipPayloadChangeReason, type TooltipPrimitive, type TooltipProps, type TooltipShortcutProps, type TooltipShortcutState, type TooltipTriggerProps, type TooltipTriggerState } from "@ui-sdk/react/tooltip";
@@ -0,0 +1,2 @@
1
+ export { Tooltip, TooltipContent } from "./tooltip";
2
+ export { createTooltipController, TooltipArrow, TooltipShortcut, TooltipTrigger } from "@ui-sdk/react/tooltip";