viewkitjs 0.22.0 → 0.24.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 (231) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/package.json +2 -4
  3. package/views/dist/contract.d.ts +6 -289
  4. package/views/dist/contract.js +1 -96
  5. package/views/dist/controls/atoms.d.ts +8 -0
  6. package/views/dist/controls/atoms.js +8 -0
  7. package/views/dist/controls/button/tokens.d.ts +351 -0
  8. package/views/dist/controls/button/tokens.js +90 -0
  9. package/views/dist/controls/checkbox/checkbox.d.ts +28 -0
  10. package/views/dist/controls/checkbox/checkbox.js +15 -0
  11. package/views/dist/controls/checkbox/looks.d.ts +3 -0
  12. package/views/dist/controls/checkbox/looks.js +8 -0
  13. package/views/dist/controls/checkbox/map-checkbox.d.ts +2 -0
  14. package/views/dist/controls/checkbox/map-checkbox.js +5 -0
  15. package/views/dist/controls/checkbox/tokens.d.ts +131 -0
  16. package/views/dist/controls/checkbox/tokens.js +35 -0
  17. package/views/dist/controls/checkbox.css +133 -0
  18. package/views/dist/controls/controls.d.ts +12 -3
  19. package/views/dist/controls/controls.js +13 -1
  20. package/views/dist/controls/field/field.d.ts +94 -0
  21. package/views/dist/controls/field/field.js +46 -0
  22. package/views/dist/controls/field/looks.d.ts +13 -0
  23. package/views/dist/controls/field/looks.js +22 -0
  24. package/views/dist/controls/field/tokens.d.ts +75 -0
  25. package/views/dist/controls/field/tokens.js +21 -0
  26. package/views/dist/controls/field.css +98 -0
  27. package/views/dist/controls/glass-button/glass-button.d.ts +40 -0
  28. package/views/dist/controls/glass-button/glass-button.js +16 -0
  29. package/views/dist/controls/glass-button/looks.d.ts +4 -0
  30. package/views/dist/controls/glass-button/looks.js +4 -0
  31. package/views/dist/controls/glass-button/tokens.d.ts +127 -0
  32. package/views/dist/controls/glass-button/tokens.js +34 -0
  33. package/views/dist/controls/glass-button.css +111 -0
  34. package/views/dist/controls/grip/grip.d.ts +14 -0
  35. package/views/dist/controls/grip/grip.js +9 -0
  36. package/views/dist/controls/index.d.ts +32 -0
  37. package/views/dist/controls/index.js +31 -0
  38. package/views/dist/controls/inline-input/inline-input.d.ts +14 -0
  39. package/views/dist/controls/inline-input/inline-input.js +10 -0
  40. package/views/dist/controls/inline-input/looks.d.ts +3 -0
  41. package/views/dist/controls/inline-input/looks.js +16 -0
  42. package/views/dist/controls/inline-input/tokens.d.ts +79 -0
  43. package/views/dist/controls/inline-input/tokens.js +22 -0
  44. package/views/dist/controls/inline-input.css +78 -0
  45. package/views/dist/controls/input/autofill.d.ts +25 -0
  46. package/views/dist/controls/input/autofill.js +17 -0
  47. package/views/dist/controls/input/input.d.ts +119 -0
  48. package/views/dist/controls/input/input.js +127 -0
  49. package/views/dist/controls/input/looks.d.ts +41 -0
  50. package/views/dist/controls/input/looks.js +48 -0
  51. package/views/dist/controls/input/map-input.d.ts +2 -0
  52. package/views/dist/controls/input/map-input.js +5 -0
  53. package/views/dist/controls/input/tokens.d.ts +171 -0
  54. package/views/dist/controls/input/tokens.js +45 -0
  55. package/views/dist/controls/input.css +381 -0
  56. package/views/dist/controls/internal/anchor.d.ts +16 -0
  57. package/views/dist/controls/internal/anchor.js +8 -0
  58. package/views/dist/controls/internal/close-reason.d.ts +5 -0
  59. package/views/dist/controls/internal/close-reason.js +2 -0
  60. package/views/dist/controls/internal/hold.d.ts +25 -0
  61. package/views/dist/controls/internal/hold.js +81 -0
  62. package/views/dist/controls/internal/icons.d.ts +8 -0
  63. package/views/dist/controls/internal/icons.js +65 -0
  64. package/views/dist/controls/internal/popup-host.d.ts +7 -0
  65. package/views/dist/controls/internal/popup-host.js +10 -0
  66. package/views/dist/controls/internal/read-token.d.ts +6 -0
  67. package/views/dist/controls/internal/read-token.js +11 -0
  68. package/views/dist/controls/internal/reorder.d.ts +44 -0
  69. package/views/dist/controls/internal/reorder.js +83 -0
  70. package/views/dist/controls/internal/scroll.d.ts +11 -0
  71. package/views/dist/controls/internal/scroll.js +14 -0
  72. package/views/dist/controls/kbd/kbd.d.ts +13 -0
  73. package/views/dist/controls/kbd/kbd.js +10 -0
  74. package/views/dist/controls/kbd/looks.d.ts +4 -0
  75. package/views/dist/controls/kbd/looks.js +4 -0
  76. package/views/dist/controls/kbd/tokens.d.ts +47 -0
  77. package/views/dist/controls/kbd/tokens.js +14 -0
  78. package/views/dist/controls/kbd.css +46 -0
  79. package/views/dist/controls/list/tokens.d.ts +139 -0
  80. package/views/dist/controls/list/tokens.js +37 -0
  81. package/views/dist/controls/list.css +188 -0
  82. package/views/dist/controls/menu-list/keys.d.ts +7 -0
  83. package/views/dist/controls/menu-list/keys.js +29 -0
  84. package/views/dist/controls/menu-list/looks.d.ts +4 -0
  85. package/views/dist/controls/menu-list/looks.js +20 -0
  86. package/views/dist/controls/menu-list/menu-list.d.ts +196 -0
  87. package/views/dist/controls/menu-list/menu-list.js +346 -0
  88. package/views/dist/controls/menu-list/tokens.d.ts +187 -0
  89. package/views/dist/controls/menu-list/tokens.js +49 -0
  90. package/views/dist/controls/menu-list.css +259 -0
  91. package/views/dist/controls/number-field/number-field.d.ts +48 -0
  92. package/views/dist/controls/number-field/number-field.js +34 -0
  93. package/views/dist/controls/number-field/tokens.d.ts +47 -0
  94. package/views/dist/controls/number-field/tokens.js +14 -0
  95. package/views/dist/controls/number-field.css +54 -0
  96. package/views/dist/controls/option/atom-tag.d.ts +6 -0
  97. package/views/dist/controls/option/atom-tag.js +6 -0
  98. package/views/dist/controls/option/looks.d.ts +7 -0
  99. package/views/dist/controls/option/looks.js +21 -0
  100. package/views/dist/controls/option/option.d.ts +35 -0
  101. package/views/dist/controls/option/option.js +32 -0
  102. package/views/dist/controls/option/tokens.d.ts +223 -0
  103. package/views/dist/controls/option/tokens.js +58 -0
  104. package/views/dist/controls/option.css +92 -0
  105. package/views/dist/controls/phone-header/header-bar.d.ts +18 -0
  106. package/views/dist/controls/phone-header/header-bar.js +9 -0
  107. package/views/dist/controls/phone-header/looks.d.ts +4 -0
  108. package/views/dist/controls/phone-header/looks.js +4 -0
  109. package/views/dist/controls/phone-header/soft-edge.d.ts +5 -0
  110. package/views/dist/controls/phone-header/soft-edge.js +3 -0
  111. package/views/dist/controls/phone-header/tokens.d.ts +59 -0
  112. package/views/dist/controls/phone-header/tokens.js +17 -0
  113. package/views/dist/controls/phone-header.css +51 -0
  114. package/views/dist/controls/popover/looks.d.ts +4 -0
  115. package/views/dist/controls/popover/looks.js +10 -0
  116. package/views/dist/controls/popover/map-popover.d.ts +3 -0
  117. package/views/dist/controls/popover/map-popover.js +5 -0
  118. package/views/dist/controls/popover/popover.d.ts +74 -0
  119. package/views/dist/controls/popover/popover.js +106 -0
  120. package/views/dist/controls/popover/tokens.d.ts +83 -0
  121. package/views/dist/controls/popover/tokens.js +23 -0
  122. package/views/dist/controls/popover.css +94 -0
  123. package/views/dist/controls/scrollbar/scrollbar.d.ts +10 -0
  124. package/views/dist/controls/scrollbar/scrollbar.js +143 -0
  125. package/views/dist/controls/scrollbar/tokens.d.ts +43 -0
  126. package/views/dist/controls/scrollbar/tokens.js +13 -0
  127. package/views/dist/controls/scrollbar.css +47 -0
  128. package/views/dist/controls/sheet/bottom-sheet.d.ts +98 -0
  129. package/views/dist/controls/sheet/bottom-sheet.js +375 -0
  130. package/views/dist/controls/sheet/forms.d.ts +38 -0
  131. package/views/dist/controls/sheet/forms.js +26 -0
  132. package/views/dist/controls/sheet/looks.d.ts +4 -0
  133. package/views/dist/controls/sheet/looks.js +10 -0
  134. package/views/dist/controls/sheet/map-sheet.d.ts +3 -0
  135. package/views/dist/controls/sheet/map-sheet.js +12 -0
  136. package/views/dist/controls/sheet/spring.d.ts +22 -0
  137. package/views/dist/controls/sheet/spring.js +48 -0
  138. package/views/dist/controls/sheet/tokens.d.ts +143 -0
  139. package/views/dist/controls/sheet/tokens.js +38 -0
  140. package/views/dist/controls/sheet.css +223 -0
  141. package/views/dist/controls/spinner/tokens.d.ts +55 -0
  142. package/views/dist/controls/spinner/tokens.js +16 -0
  143. package/views/dist/controls/status/atom-status-badge.d.ts +10 -0
  144. package/views/dist/controls/status/atom-status-badge.js +13 -0
  145. package/views/dist/controls/status/looks.d.ts +4 -0
  146. package/views/dist/controls/status/looks.js +22 -0
  147. package/views/dist/controls/status/marks.d.ts +26 -0
  148. package/views/dist/controls/status/marks.js +73 -0
  149. package/views/dist/controls/status/status.d.ts +43 -0
  150. package/views/dist/controls/status/status.js +26 -0
  151. package/views/dist/controls/status/tokens.d.ts +407 -0
  152. package/views/dist/controls/status/tokens.js +104 -0
  153. package/views/dist/controls/status.css +164 -0
  154. package/views/dist/controls/switch/looks.d.ts +4 -0
  155. package/views/dist/controls/switch/looks.js +19 -0
  156. package/views/dist/controls/switch/switch.d.ts +15 -0
  157. package/views/dist/controls/switch/switch.js +11 -0
  158. package/views/dist/controls/switch/tokens.d.ts +139 -0
  159. package/views/dist/controls/switch/tokens.js +37 -0
  160. package/views/dist/controls/switch.css +169 -0
  161. package/views/dist/controls/tag/atom-cell-more.d.ts +3 -0
  162. package/views/dist/controls/tag/atom-cell-more.js +5 -0
  163. package/views/dist/controls/tag/looks.d.ts +4 -0
  164. package/views/dist/controls/tag/looks.js +4 -0
  165. package/views/dist/controls/tag/tag.d.ts +25 -0
  166. package/views/dist/controls/tag/tag.js +19 -0
  167. package/views/dist/controls/tag/tokens.d.ts +63 -0
  168. package/views/dist/controls/tag/tokens.js +18 -0
  169. package/views/dist/controls/tag.css +81 -0
  170. package/views/dist/controls/toggle/looks.d.ts +3 -0
  171. package/views/dist/controls/toggle/looks.js +12 -0
  172. package/views/dist/controls/toggle/toggle.d.ts +47 -0
  173. package/views/dist/controls/toggle/toggle.js +23 -0
  174. package/views/dist/controls/toggle/tokens.d.ts +55 -0
  175. package/views/dist/controls/toggle/tokens.js +16 -0
  176. package/views/dist/controls/toggle.css +67 -0
  177. package/views/dist/controls/tokens.d.ts +16 -0
  178. package/views/dist/controls/tokens.js +49 -0
  179. package/views/dist/controls/tooltip/looks.d.ts +4 -0
  180. package/views/dist/controls/tooltip/looks.js +4 -0
  181. package/views/dist/controls/tooltip/map-tooltip.d.ts +3 -0
  182. package/views/dist/controls/tooltip/map-tooltip.js +5 -0
  183. package/views/dist/controls/tooltip/tokens.d.ts +75 -0
  184. package/views/dist/controls/tooltip/tokens.js +21 -0
  185. package/views/dist/controls/tooltip/tooltip.d.ts +54 -0
  186. package/views/dist/controls/tooltip/tooltip.js +78 -0
  187. package/views/dist/controls/tooltip.css +94 -0
  188. package/views/dist/grid/chrome/GridTable.js +21 -19
  189. package/views/dist/grid/chrome/grid-caret-keys.d.ts +7 -0
  190. package/views/dist/grid/chrome/grid-caret-keys.js +22 -0
  191. package/views/dist/grid/chrome/grid-row-window.js +3 -0
  192. package/views/dist/grid/chrome/useGridColumnLayout.d.ts +4 -1
  193. package/views/dist/grid/chrome/useGridColumnLayout.js +17 -2
  194. package/views/dist/grid/chrome/useGridFittedWidths.d.ts +32 -0
  195. package/views/dist/grid/chrome/useGridFittedWidths.js +59 -0
  196. package/views/dist/grid/chrome/useGridKeyboard.js +3 -0
  197. package/views/dist/looks/index.d.ts +16 -0
  198. package/views/dist/looks/index.js +16 -0
  199. package/views/dist/looks/looks.d.ts +10 -9
  200. package/views/dist/looks/pieces.js +38 -2
  201. package/views/dist/model/column-schema.d.ts +3 -2
  202. package/views/dist/model/column-state.d.ts +11 -1
  203. package/views/dist/model/column-state.js +8 -2
  204. package/views/dist/styles.css +2362 -7
  205. package/views/dist/styles.unlayered.css +2362 -7
  206. package/views/docs/contract.md +5 -97
  207. package/views/docs/controls/button.md +93 -0
  208. package/views/docs/controls/checkbox.md +38 -0
  209. package/views/docs/controls/field.md +26 -0
  210. package/views/docs/controls/glass-button.md +37 -0
  211. package/views/docs/controls/inline-input.md +27 -0
  212. package/views/docs/controls/input.md +48 -0
  213. package/views/docs/controls/kbd.md +17 -0
  214. package/views/docs/controls/list.md +40 -0
  215. package/views/docs/controls/menu-list.md +52 -0
  216. package/views/docs/controls/number-field.md +17 -0
  217. package/views/docs/controls/option.md +61 -0
  218. package/views/docs/controls/phone-header.md +20 -0
  219. package/views/docs/controls/popover.md +26 -0
  220. package/views/docs/controls/scrollbar.md +16 -0
  221. package/views/docs/controls/sheet.md +41 -0
  222. package/views/docs/controls/spinner.md +19 -0
  223. package/views/docs/controls/status.md +107 -0
  224. package/views/docs/controls/switch.md +40 -0
  225. package/views/docs/controls/tag.md +21 -0
  226. package/views/docs/controls/toggle.md +19 -0
  227. package/views/docs/controls/tooltip.md +24 -0
  228. package/views/docs/getting-started.md +1 -1
  229. package/views/docs/reference/controls.md +213 -2
  230. package/views/docs/reference/looks.md +70 -3
  231. package/views/docs/reference/views.md +7 -2
@@ -0,0 +1,25 @@
1
+ import * as React from "react";
2
+ export interface TagProps {
3
+ /** The word. A long one is cut at 200px; the whole word is its tooltip. */
4
+ children?: React.ReactNode;
5
+ /** sm in dense rows. */
6
+ size?: "md" | "sm";
7
+ /** The rest of a row's tags, "+4": the same edge, the number, no icon. */
8
+ count?: number;
9
+ /** In a field: a remove button named "Remove <tag>". */
10
+ onRemove?: () => void;
11
+ className?: string;
12
+ /** Its remove button drawn as under the pointer or in focus, as a design page shows it. */
13
+ "data-force"?: "hover" | "focus";
14
+ }
15
+ /** A free word in a plain edge, the tag icon in front. */
16
+ export declare function Tag({ children, size, count, onRemove, className, "data-force": force }: TagProps): import("react/jsx-runtime").JSX.Element;
17
+ /** A chip's cut: its first child, which draws its ground and edge with the smooth outline under Corner smoothing's Smooth,
18
+ * the chip itself never clipped (tag.css). The Tag's and the Option's. */
19
+ export declare function TagCut(): import("react/jsx-runtime").JSX.Element;
20
+ /** A chip's remove button, named "Remove <word>", on Base UI's button: the Tag's and the Option's. */
21
+ export declare function TagRemove({ word, onRemove, force }: {
22
+ word?: string;
23
+ onRemove: () => void;
24
+ force?: "hover" | "focus";
25
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button as BaseButton } from "@base-ui/react/button";
3
+ import { cx } from "../../internal/cx.js";
4
+ const TAG = ["M7.5 7.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", "M3 6v5.172a2 2 0 0 0 .586 1.414l7.71 7.71a2.41 2.41 0 0 0 3.408 0l5.592 -5.592a2.41 2.41 0 0 0 0 -3.408l-7.71 -7.71a2 2 0 0 0 -1.414 -.586h-5.172a3 3 0 0 0 -3 3z"];
5
+ const X = ["M18 6l-12 12", "M6 6l12 12"];
6
+ const glyph = (paths, className, strokeWidth) => (_jsx("svg", { className: className, viewBox: "0 0 24 24", strokeWidth: strokeWidth, "aria-hidden": "true", children: paths.map((d) => _jsx("path", { d: d }, d)) }));
7
+ export function Tag({ children, size = "md", count, onRemove, className, "data-force": force }) {
8
+ const cls = cx("o-tag", size === "sm" && "o-tag-sm", count != null && "o-tag-count", className);
9
+ if (count != null)
10
+ return _jsxs("span", { className: cls, "data-kit": "tag", children: [_jsx(TagCut, {}), "+", count] });
11
+ const word = typeof children === "string" ? children : undefined;
12
+ return (_jsxs("span", { className: cls, title: word, "data-kit": "tag", children: [_jsx(TagCut, {}), glyph(TAG, "o-tag-icon", 2), _jsx("span", { className: "o-tag-word", children: children }), onRemove && _jsx(TagRemove, { word: word, onRemove: onRemove, force: force })] }));
13
+ }
14
+ export function TagCut() {
15
+ return _jsx("span", { className: "o-tag-cut o-smooth o-smooth-ease", "aria-hidden": "true" });
16
+ }
17
+ export function TagRemove({ word, onRemove, force }) {
18
+ return _jsx(BaseButton, { type: "button", className: "o-tag-remove", "aria-label": word ? `Remove ${word}` : "Remove", "data-force": force, onClick: onRemove, children: glyph(X, "", 2.5) });
19
+ }
@@ -0,0 +1,63 @@
1
+ export declare const TAG_TOKENS: readonly [{
2
+ readonly name: "--vk-border-bold";
3
+ readonly kind: "colour";
4
+ readonly outright: "--border-bold";
5
+ }, {
6
+ readonly name: "--vk-border-brand";
7
+ readonly kind: "colour";
8
+ readonly outright: "--border-focused";
9
+ }, {
10
+ readonly name: "--vk-fg";
11
+ readonly kind: "colour";
12
+ readonly outright: "--text";
13
+ }, {
14
+ readonly name: "--vk-fg-subtle";
15
+ readonly kind: "colour";
16
+ readonly outright: "--text-subtle";
17
+ }, {
18
+ readonly name: "--vk-neutral-hovered";
19
+ readonly kind: "colour";
20
+ readonly outright: "--background-neutral-hovered";
21
+ }, {
22
+ readonly name: "--vk-border-width";
23
+ readonly kind: "size";
24
+ readonly outright: "--border-width";
25
+ }, {
26
+ readonly name: "--vk-corner-smoothing";
27
+ readonly kind: "size";
28
+ readonly outright: "--corner-smoothing";
29
+ }, {
30
+ readonly name: "--vk-focus-width";
31
+ readonly kind: "size";
32
+ readonly outright: "--focus-width";
33
+ }, {
34
+ readonly name: "--vk-font-size-xs";
35
+ readonly kind: "size";
36
+ readonly outright: "--text-xs";
37
+ }, {
38
+ readonly name: "--vk-font-weight-medium";
39
+ readonly kind: "size";
40
+ readonly outright: "--font-weight-medium";
41
+ }, {
42
+ readonly name: "--vk-radius-md";
43
+ readonly kind: "size";
44
+ readonly outright: "--radius-md";
45
+ }, {
46
+ readonly name: "--vk-radius-xs";
47
+ readonly kind: "size";
48
+ readonly outright: "--radius-xs";
49
+ }, {
50
+ readonly name: "--vk-spacing";
51
+ readonly kind: "size";
52
+ readonly outright: "--spacing";
53
+ }, {
54
+ readonly name: "--vk-duration-fast";
55
+ readonly kind: "motion";
56
+ readonly outright: "--duration-fast";
57
+ }, {
58
+ readonly name: "--vk-ease-out";
59
+ readonly kind: "motion";
60
+ readonly outright: "--ease-out";
61
+ }];
62
+ /** The prefixes of the Tag's own machinery, set and read by it alone: not public. */
63
+ export declare const TAG_PRIVATE: readonly ["--tag-"];
@@ -0,0 +1,18 @@
1
+ export const TAG_TOKENS = [
2
+ { name: "--vk-border-bold", kind: "colour", outright: "--border-bold" },
3
+ { name: "--vk-border-brand", kind: "colour", outright: "--border-focused" },
4
+ { name: "--vk-fg", kind: "colour", outright: "--text" },
5
+ { name: "--vk-fg-subtle", kind: "colour", outright: "--text-subtle" },
6
+ { name: "--vk-neutral-hovered", kind: "colour", outright: "--background-neutral-hovered" },
7
+ { name: "--vk-border-width", kind: "size", outright: "--border-width" },
8
+ { name: "--vk-corner-smoothing", kind: "size", outright: "--corner-smoothing" },
9
+ { name: "--vk-focus-width", kind: "size", outright: "--focus-width" },
10
+ { name: "--vk-font-size-xs", kind: "size", outright: "--text-xs" },
11
+ { name: "--vk-font-weight-medium", kind: "size", outright: "--font-weight-medium" },
12
+ { name: "--vk-radius-md", kind: "size", outright: "--radius-md" },
13
+ { name: "--vk-radius-xs", kind: "size", outright: "--radius-xs" },
14
+ { name: "--vk-spacing", kind: "size", outright: "--spacing" },
15
+ { name: "--vk-duration-fast", kind: "motion", outright: "--duration-fast" },
16
+ { name: "--vk-ease-out", kind: "motion", outright: "--ease-out" },
17
+ ];
18
+ export const TAG_PRIVATE = ["--tag-"];
@@ -0,0 +1,81 @@
1
+ /* The Tag, as the Outright kit draws it. Every value it draws with is a
2
+ public name (its tokens list); this file only says which token each part takes. No fill and no colour: a plain
3
+ edge, the tag icon, the word. The Option (option.css) is the same chip without the icon.
4
+
5
+ The rules sit in the components layer, so a utility class on a tag still wins. */
6
+ @layer components {
7
+
8
+ /* ── A tag: 22px, its edge drawn inside, the icon then the word; a long word cut at 200px. Its ground, edge, height and corner
9
+ are variables, which the Option's looks and states set, so its cut draws them under Smooth: --tag-ground (none),
10
+ --tag-edge, --tag-h, --tag-r, and --tag-rr, the corner its height leaves room for; --tag-shadow: none where a look draws no
11
+ edge, which a colour look's own edge outweighs (initial) ──────────────────────────────────────────────────────────────── */
12
+ .o-tag {
13
+ --tag-ground: transparent; --tag-edge: var(--vk-border-bold); --tag-h: calc(var(--vk-spacing) * 5.5); --tag-r: var(--vk-radius-md);
14
+ --tag-rr: min(var(--tag-r), var(--tag-h) / 2);
15
+ flex: none; display: inline-flex; align-items: center; gap: calc(var(--vk-spacing) * 1); box-sizing: border-box; max-width: calc(var(--vk-spacing) * 50);
16
+ height: var(--tag-h); padding: 0 calc(var(--vk-spacing) * 2);
17
+ border-radius: var(--tag-r); background-color: var(--tag-ground); box-shadow: var(--tag-shadow, inset 0 0 0 var(--vk-border-width) var(--tag-edge));
18
+ color: var(--vk-fg); font-size: var(--vk-font-size-xs); line-height: 1; font-weight: var(--vk-font-weight-medium); white-space: nowrap;
19
+ }
20
+ /* Its word is cropped so a long one ends in "…". The box that crops it stands as tall as the chip, never only as tall as its
21
+ letters: at the chip's line-height of 1 the crop took the foot of every g, y and p. The word stays where it was. */
22
+ .o-tag-word { overflow: hidden; text-overflow: ellipsis; line-height: var(--tag-h); }
23
+ .o-tag-icon { flex: none; width: calc(var(--vk-spacing) * 3); height: calc(var(--vk-spacing) * 3); margin-left: calc(var(--vk-spacing) * -0.25); fill: none; stroke: var(--vk-fg-subtle); stroke-linecap: round; stroke-linejoin: round; }
24
+ /* Small, in dense rows; a count for the rest, its number in the quieter colour. */
25
+ .o-tag.o-tag-sm { --tag-h: calc(var(--vk-spacing) * 5); padding: 0 calc(var(--vk-spacing) * 1.5); }
26
+ .o-tag.o-tag-count { color: var(--vk-fg-subtle); font-variant-numeric: tabular-nums; }
27
+
28
+ /* ── Its remove button, in a field ─────────────────────────────────────────────────────────────────── */
29
+ .o-tag-remove {
30
+ display: inline-grid; place-items: center; width: calc(var(--vk-spacing) * 4); height: calc(var(--vk-spacing) * 4); margin: 0 calc(var(--vk-spacing) * -1.25) 0 0; padding: 0;
31
+ border: 0; border-radius: var(--vk-radius-xs); background-color: transparent; color: var(--vk-fg-subtle); cursor: pointer; outline: none;
32
+ transition: background-color var(--vk-duration-fast) var(--vk-ease-out), color var(--vk-duration-fast) var(--vk-ease-out);
33
+ }
34
+ /* A hover only on a screen with a pointer (iOS keeps :hover on what was last tapped); a press and the forced state stay out. */
35
+ .o-tag-remove[data-force="hover"] { background-color: var(--vk-neutral-hovered); color: var(--vk-fg); }
36
+ @media (hover: hover) { .o-tag-remove:hover { background-color: var(--vk-neutral-hovered); color: var(--vk-fg); } }
37
+ .o-tag-remove:is(:focus-visible, [data-force="focus"]) { outline: var(--vk-focus-width) solid var(--vk-border-brand); outline-offset: calc(var(--vk-spacing) * 0.25); }
38
+ .o-tag-remove svg { width: calc(var(--vk-spacing) * 2.5); height: calc(var(--vk-spacing) * 2.5); fill: none; stroke: currentColor; stroke-linecap: round; }
39
+
40
+ /* ── Corner smoothing, the Tag's and the Option's, each its own (data-tag-smoothing, data-option-smoothing; looks.ts): The
41
+ app's, with nothing set, follows the token corner-smoothing (Round is the token at 0), Smooth and Round set the
42
+ chip apart. Under Smooth or The app's the chip is drawn with the kit's smooth outline (ViewKit's smooth.css), eased on its side, in
43
+ every browser that knows shape(); one that doesn't keeps the corners above, and so do Round and an Option at Full (a pill has no
44
+ corner to smooth), which paint the chip as before. The chip itself is never clipped: its remove button's focus ring reaches its
45
+ edge, and a link Option's ring and pressing area stand outside it. Its ground and edge are handed to its cut (.o-tag-cut, the
46
+ chip's first child): the ground (::before) clipped by the outline, the edge (::after) a ring along it. The amount is set on the
47
+ cut, never the chip, which may hold an Avatar of its own (an Option's mark). ───────────────────────────────────────────────── */
48
+ .o-tag-cut { display: none; --smooth-amount: var(--vk-corner-smoothing); }
49
+ /* Its layers' colours move as a link's ground does, a rule light enough that reduced motion (at the file's end) stops it. */
50
+ .o-tag-cut::before, .o-tag-cut::after { transition: background-color var(--vk-duration-fast) var(--vk-ease-out); }
51
+ [data-tag-smoothing="smooth"] .o-tag:not(.o-option) > .o-tag-cut, [data-option-smoothing="smooth"] .o-option > .o-tag-cut { --smooth-amount: initial; }
52
+ @supports (clip-path: shape(evenodd from 0 0, curve by 1px 1px with 1px 0 / 1px 0, close, move to 0 0, hline to 1px, close)) and (width: calc(tan(atan2(1px, 1px)) * 1px)) {
53
+ /* Its own corner is its ground's, so a link Option's focus ring stands on the fitted corner: worked from the token,
54
+ or the full 0.7 under its own Smooth, never from the cut's amount, which stays on the cut. */
55
+ .o-tag:not(.o-option, [data-tag-smoothing="round"] *):has(> .o-tag-cut),
56
+ .o-option:not([data-option-smoothing="round"] *, [data-option-radius="full"] *):has(> .o-tag-cut) {
57
+ --smooth-side: var(--tag-h);
58
+ position: relative; isolation: isolate; background-color: transparent; box-shadow: none;
59
+ border-radius: min(var(--tag-rr), var(--tag-h) / (2 + 2 * var(--vk-corner-smoothing)));
60
+ }
61
+ [data-tag-smoothing="smooth"] .o-tag:not(.o-option, [data-tag-smoothing="round"] *):has(> .o-tag-cut),
62
+ [data-option-smoothing="smooth"] .o-option:not([data-option-smoothing="round"] *, [data-option-radius="full"] *):has(> .o-tag-cut) {
63
+ border-radius: min(var(--tag-rr), var(--tag-h) / 3.4);
64
+ }
65
+ .o-tag:not(.o-option, [data-tag-smoothing="round"] *) > .o-tag-cut,
66
+ .o-option:not([data-option-smoothing="round"] *, [data-option-radius="full"] *) > .o-tag-cut {
67
+ --tag-fit: min(var(--tag-rr), var(--tag-h) / (2 + 2 * var(--smooth-amount, 0.7))); --smooth-t: var(--tag-fit);
68
+ display: block; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
69
+ .o-tag:not(.o-option, [data-tag-smoothing="round"] *) > .o-tag-cut::before,
70
+ .o-option:not([data-option-smoothing="round"] *, [data-option-radius="full"] *) > .o-tag-cut::before {
71
+ content: ""; position: absolute; inset: 0; background-color: var(--tag-ground); clip-path: shape(var(--smooth-outline));
72
+ }
73
+ .o-tag:not(.o-option, [data-tag-smoothing="round"] *) > .o-tag-cut::after,
74
+ .o-option:not([data-option-smoothing="round"] *, [data-option-radius="full"] *) > .o-tag-cut::after {
75
+ --smooth-t: max(0px, var(--tag-fit) - var(--vk-border-width)); --smooth-in: var(--vk-border-width);
76
+ content: ""; position: absolute; inset: 0; background-color: var(--tag-edge); clip-path: shape(var(--smooth-ring));
77
+ }
78
+ }
79
+
80
+ @media (prefers-reduced-motion: reduce) { .o-tag-remove, .o-tag-cut::before, .o-tag-cut::after { transition: none; } }
81
+ }
@@ -0,0 +1,3 @@
1
+ import type { PieceLooks } from "../../looks/looks.js";
2
+ export type ToggleLookOptionId = "mark";
3
+ export declare const TOGGLE_LOOKS: PieceLooks<ToggleLookOptionId>;
@@ -0,0 +1,12 @@
1
+ export const TOGGLE_LOOKS = {
2
+ id: "toggle",
3
+ name: "Toggle",
4
+ options: [
5
+ { id: "mark", name: "A filled icon", def: "brand", values: [{ id: "brand", name: "Brand" }, { id: "amber", name: "Amber" }, { id: "text", name: "Text colour" }] },
6
+ ],
7
+ looks: [
8
+ { id: "brand", name: "Brand", picks: { mark: "brand" } },
9
+ { id: "amber", name: "Amber", picks: { mark: "amber" } },
10
+ { id: "text", name: "Text colour", picks: { mark: "text" } },
11
+ ],
12
+ };
@@ -0,0 +1,47 @@
1
+ import * as React from "react";
2
+ import { Toggle as BaseToggle } from "@base-ui/react/toggle";
3
+ import { ToggleGroup as BaseToggleGroup } from "@base-ui/react/toggle-group";
4
+ import { type ButtonProps } from "../button/button.js";
5
+ import type { ButtonOwnLook } from "../button/own-look.js";
6
+ /** What a group gives every toggle in it: its kind and size. The pill is drawn as the outline Button, fully round, off on no
7
+ * ground with a light edge and quiet words (toggle.css). */
8
+ type Look = {
9
+ kind?: "quiet" | "outline" | "pill";
10
+ size?: ButtonProps["size"];
11
+ };
12
+ export interface ToggleProps extends Omit<BaseToggle.Props, "className" | "render" | "children">, Look {
13
+ /** Icon only (a square) or round, as the Button's; an icon-only toggle needs an aria-label, the name its tooltip shows too. */
14
+ shape?: ButtonProps["shape"];
15
+ /** An icon before the words; an icon-only toggle's one icon. */
16
+ icon?: React.ReactNode;
17
+ /** The icon it shows while on, filled (a star, a pin, a bell): on, it takes no fill, its icon carries it, in the colour the
18
+ * app picks (the Toggle's `mark` option), or its own `tone`. */
19
+ iconOn?: React.ReactNode;
20
+ /** Its filled icon's own colour, whatever the app picks: a favourite's star in amber. */
21
+ tone?: "brand" | "amber" | "text";
22
+ iconEnd?: React.ReactNode;
23
+ /** Shown, never pressed: on, it keeps its on fill; nothing dims; the pointer finds nothing and a press or a key changes
24
+ * nothing. It stays in the tab order and says it can't be pressed (aria-disabled: ARIA gives a button no read-only). A
25
+ * group's makes every toggle in it so. */
26
+ readOnly?: boolean;
27
+ /** A Button's own look, set on the Button it is drawn as: room at its end for a menu laid over a saved look's chip. */
28
+ look?: ButtonOwnLook;
29
+ children?: React.ReactNode;
30
+ className?: string;
31
+ }
32
+ /** A button that stays on until pressed again: a text's Bold, a list's filter, a star. Quiet by default (only its icon or words
33
+ * until the pointer finds it), outline, or a pill. */
34
+ export declare const Toggle: React.ForwardRefExoticComponent<Omit<ToggleProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
35
+ export interface ToggleGroupProps extends Omit<BaseToggleGroup.Props, "className" | "render" | "style">, Look {
36
+ /** Its toggles shown, never pressed: each read-only (the Toggle's readOnly). */
37
+ readOnly?: boolean;
38
+ /** How far apart its toggles stand, in spacing steps (1, 4px, by default); 0 joins them into one control, as a ButtonGroup:
39
+ * the corners between them square, the edges shared. */
40
+ spacing?: number;
41
+ className?: string;
42
+ style?: React.CSSProperties;
43
+ }
44
+ /** Toggles that belong together: one on at a time (a list's view, a text's alignment), or several with `multiple` (Bold,
45
+ * Italic, Underline). In a row, or a column with `orientation="vertical"`. Every toggle in it takes its kind and size. */
46
+ export declare function ToggleGroup({ kind, size, readOnly, spacing, orientation, className, style, children, ...props }: ToggleGroupProps): import("react/jsx-runtime").JSX.Element;
47
+ export {};
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { Toggle as BaseToggle } from "@base-ui/react/toggle";
4
+ import { ToggleGroup as BaseToggleGroup } from "@base-ui/react/toggle-group";
5
+ import { cx } from "../../internal/cx.js";
6
+ import { Button } from "../button/button.js";
7
+ const GroupLook = React.createContext({});
8
+ export const Toggle = React.forwardRef(function Toggle({ kind, size, shape, icon, iconOn, tone, iconEnd, readOnly, look: own, onPressedChange, className, children, ...props }, ref) {
9
+ const group = React.useContext(GroupLook), still = readOnly || group.readOnly;
10
+ const drawn = group.kind ?? kind ?? "quiet", pill = drawn === "pill";
11
+ const look = { kind: pill ? "outline" : drawn, size: group.size ?? size, shape, iconEnd, look: own, className: cx("o-toggle", pill && "o-toggle-pill", iconOn != null && "o-toggle-mark", className) };
12
+ const render = iconOn == null ? _jsx(Button, { ...look, icon: icon, "data-kit": "toggle" })
13
+ : (p, state) => _jsx(Button, { ...p, ...look, icon: state.pressed ? iconOn : icon, "data-tone": tone, "data-kit": "toggle" });
14
+ const held = still ? { "data-readonly": "", "aria-disabled": true } : {};
15
+ return (_jsx(BaseToggle, { ref: ref, ...props, ...held, render: render, onPressedChange: (p, details) => { if (still) {
16
+ details.cancel();
17
+ return;
18
+ } onPressedChange?.(p, details); }, children: children }));
19
+ });
20
+ export function ToggleGroup({ kind, size, readOnly, spacing = 1, orientation = "horizontal", className, style, children, ...props }) {
21
+ const look = React.useMemo(() => ({ kind, size, readOnly }), [kind, size, readOnly]);
22
+ return (_jsx(GroupLook.Provider, { value: look, children: _jsx(BaseToggleGroup, { orientation: orientation, className: cx("o-toggle-group", spacing === 0 && "o-button-group", className), style: { ...style, "--o-toggle-gap": spacing }, ...props, children: children }) }));
23
+ }
@@ -0,0 +1,55 @@
1
+ export declare const TOGGLE_TOKENS: readonly [{
2
+ readonly name: "--vk-border";
3
+ readonly kind: "colour";
4
+ readonly outright: "--border";
5
+ }, {
6
+ readonly name: "--vk-border-danger";
7
+ readonly kind: "colour";
8
+ readonly outright: "--border-danger";
9
+ }, {
10
+ readonly name: "--vk-border-input";
11
+ readonly kind: "colour";
12
+ readonly outright: "--border-input";
13
+ }, {
14
+ readonly name: "--vk-brand";
15
+ readonly kind: "colour";
16
+ readonly outright: "--background-brand-bold";
17
+ }, {
18
+ readonly name: "--vk-fg";
19
+ readonly kind: "colour";
20
+ readonly outright: "--text";
21
+ }, {
22
+ readonly name: "--vk-fg-subtle";
23
+ readonly kind: "colour";
24
+ readonly outright: "--text-subtle";
25
+ }, {
26
+ readonly name: "--vk-ground";
27
+ readonly kind: "colour";
28
+ readonly outright: "--surface";
29
+ }, {
30
+ readonly name: "--vk-hovered";
31
+ readonly kind: "colour";
32
+ readonly outright: "--surface-hovered";
33
+ }, {
34
+ readonly name: "--vk-label-amber";
35
+ readonly kind: "colour";
36
+ readonly outright: "--label-amber";
37
+ }, {
38
+ readonly name: "--vk-neutral";
39
+ readonly kind: "colour";
40
+ readonly outright: "--background-neutral";
41
+ }, {
42
+ readonly name: "--vk-neutral-hovered";
43
+ readonly kind: "colour";
44
+ readonly outright: "--background-neutral-hovered";
45
+ }, {
46
+ readonly name: "--vk-radius-full";
47
+ readonly kind: "size";
48
+ readonly outright: "--radius-full";
49
+ }, {
50
+ readonly name: "--vk-spacing";
51
+ readonly kind: "size";
52
+ readonly outright: "--spacing";
53
+ }];
54
+ /** The prefixes of the Toggle's own machinery, set and read by it alone: not public. */
55
+ export declare const TOGGLE_PRIVATE: readonly ["--o-toggle-"];
@@ -0,0 +1,16 @@
1
+ export const TOGGLE_TOKENS = [
2
+ { name: "--vk-border", kind: "colour", outright: "--border" },
3
+ { name: "--vk-border-danger", kind: "colour", outright: "--border-danger" },
4
+ { name: "--vk-border-input", kind: "colour", outright: "--border-input" },
5
+ { name: "--vk-brand", kind: "colour", outright: "--background-brand-bold" },
6
+ { name: "--vk-fg", kind: "colour", outright: "--text" },
7
+ { name: "--vk-fg-subtle", kind: "colour", outright: "--text-subtle" },
8
+ { name: "--vk-ground", kind: "colour", outright: "--surface" },
9
+ { name: "--vk-hovered", kind: "colour", outright: "--surface-hovered" },
10
+ { name: "--vk-label-amber", kind: "colour", outright: "--label-amber" },
11
+ { name: "--vk-neutral", kind: "colour", outright: "--background-neutral" },
12
+ { name: "--vk-neutral-hovered", kind: "colour", outright: "--background-neutral-hovered" },
13
+ { name: "--vk-radius-full", kind: "size", outright: "--radius-full" },
14
+ { name: "--vk-spacing", kind: "size", outright: "--spacing" },
15
+ ];
16
+ export const TOGGLE_PRIVATE = ["--o-toggle-"];
@@ -0,0 +1,67 @@
1
+ /* The Toggle and the ToggleGroup. A toggle is the Button (button.css): its kinds, sizes, forms, looks and
2
+ states are the Button's own; this file only says what being on looks like, and how a group stands. Every
3
+ value is a public name. Base UI marks a toggle that is on data-pressed (and aria-pressed), a group's direction
4
+ data-orientation.
5
+
6
+ The rules sit in the components layer, so a utility class on a toggle still wins. */
7
+ @layer components {
8
+
9
+ /* ── On: the neutral fill a step up (background-neutral-hovered), its words and icon in the text colour.
10
+ The surface's own selected fill sits 2% from its hover in light, so a toggle under the pointer would
11
+ read as on; this one is clear of it in both themes. It keeps it under the pointer and while pressed, in
12
+ every look; only a toggle that can't be used drops it (a quiet one keeps the neutral fill, so it still
13
+ reads as on) ──────────────────────────────────────────────────────────────────────────────────────── */
14
+ .o-toggle.o-button[data-pressed]:not(:disabled, [data-disabled]) { --button-ground: var(--vk-neutral-hovered); --button-light: none; color: var(--vk-fg); }
15
+ .o-toggle.o-button-quiet[data-pressed]:is(:disabled, [data-disabled]) { --button-ground: var(--vk-neutral); }
16
+
17
+ /* ── With an icon of its own for on (a star, a pin, a bell): on, it takes no fill (the quiet kind none, the
18
+ outline its surface), the pointer's fill still shows, and the filled icon carries it in its colour:
19
+ the brand by default; amber (a label's, a colour someone chose) or the text colour as the app picks
20
+ (data-toggle-mark); or the toggle's own tone, whatever the app picks. Off, or can't be used, it is
21
+ the toggle's own colour ────────────────────────────────────────────────────────────────────────────── */
22
+ .o-toggle-mark { --o-toggle-mark: var(--vk-brand); }
23
+ [data-toggle-mark="amber"] .o-toggle-mark { --o-toggle-mark: var(--vk-label-amber); }
24
+ [data-toggle-mark="text"] .o-toggle-mark { --o-toggle-mark: var(--vk-fg); }
25
+ .o-toggle-mark[data-tone="brand"] { --o-toggle-mark: var(--vk-brand); }
26
+ .o-toggle-mark[data-tone="amber"] { --o-toggle-mark: var(--vk-label-amber); }
27
+ .o-toggle-mark[data-tone="text"] { --o-toggle-mark: var(--vk-fg); }
28
+ .o-toggle.o-toggle-mark.o-button-quiet[data-pressed] { --button-ground: transparent; }
29
+ .o-toggle.o-toggle-mark.o-button-outline[data-pressed]:not(:disabled, [data-disabled]) { --button-ground: var(--vk-ground); }
30
+ .o-toggle.o-toggle-mark.o-button[data-pressed][data-force="hover"]:not(:disabled, [data-disabled]) { --button-ground: var(--vk-hovered); }
31
+ /* The pointer's fill only on a screen that has one: iOS keeps :hover on what was last tapped, so on a phone the
32
+ fill would stay after the tap. The sheets' forced state, above, shows on any screen. */
33
+ @media (hover: hover) {
34
+ .o-toggle.o-toggle-mark.o-button[data-pressed]:hover:not(:disabled, [data-disabled], [data-readonly]) { --button-ground: var(--vk-hovered); }
35
+ }
36
+ .o-toggle-mark[data-pressed]:not(:disabled, [data-disabled]) > [data-slot="vk-button-icon"] { color: var(--o-toggle-mark); }
37
+
38
+ /* ── Read-only: shown, never pressed. On, it keeps its fill; nothing dims; the pointer's fill and the press's
39
+ never come (button.css and the rule above pass data-readonly by), and the pointer is the page's own ────────────── */
40
+ .o-toggle.o-button[data-readonly] { cursor: default; }
41
+
42
+ /* ── In error (aria-invalid, or inside a FieldSet in error): the outline kind's edge turns red, and the
43
+ pointer never takes it away ───────────────────────────────────────────────────────────────────────── */
44
+ .o-toggle.o-button-outline:is([aria-invalid="true"], .o-fieldset[data-invalid] *):not(:disabled, [data-disabled]) { --button-edge: var(--vk-border-danger); --button-edge-foot: var(--vk-border-danger); }
45
+
46
+ /* ── The pill: the outline Button, fully round at every
47
+ size (over the frame's Corners), its words padded as the Pill look pads them. Off, no ground, the light edge and its words
48
+ quiet; under the pointer its words the text's and its edge a step up; on, the Toggle's own on fill above, its words the text's
49
+ and the outline's edge. Its error edge, focus, and the frame's depth and hover looks are the outline's ──────────────────── */
50
+ .o-toggle.o-toggle-pill.o-button:not(.o-button-round) { --button-r: var(--vk-radius-full); }
51
+ .o-toggle-pill.o-button:not(.o-button-icon, .o-button-round) { padding: 0 calc(var(--vk-spacing) * 4.5); }
52
+ .o-toggle-pill.o-button-2xs:not(.o-button-icon, .o-button-round) { padding: 0 calc(var(--vk-spacing) * 2.5); }
53
+ .o-toggle-pill.o-button-xs:not(.o-button-icon, .o-button-round) { padding: 0 calc(var(--vk-spacing) * 3); }
54
+ .o-toggle-pill.o-button-sm:not(.o-button-icon, .o-button-round) { padding: 0 calc(var(--vk-spacing) * 3.5); }
55
+ .o-toggle-pill.o-button-lg:not(.o-button-icon, .o-button-round) { padding: 0 calc(var(--vk-spacing) * 5.5); }
56
+ .o-toggle.o-toggle-pill:not([data-pressed], :disabled, [data-disabled]) { --button-ground: transparent; --button-edge: var(--vk-border); --button-edge-foot: var(--vk-border); color: var(--vk-fg-subtle); }
57
+ .o-toggle.o-toggle-pill[data-force="hover"]:not([data-pressed], :disabled, [data-disabled], [data-readonly]) { --button-edge: var(--vk-border-input); --button-edge-foot: var(--vk-border-input); color: var(--vk-fg); }
58
+ @media (hover: hover) {
59
+ .o-toggle.o-toggle-pill:hover:not([data-pressed], :disabled, [data-disabled], [data-readonly]) { --button-edge: var(--vk-border-input); --button-edge-foot: var(--vk-border-input); color: var(--vk-fg); }
60
+ }
61
+
62
+ /* ── A group: its toggles in a row, or a column, apart by its spacing (in spacing steps). Joined, it is a
63
+ ButtonGroup (button.css): only the group's outer corners round, the edges between shared ──────────── */
64
+ .o-toggle-group { display: inline-flex; align-items: stretch; width: fit-content; gap: calc(var(--vk-spacing) * var(--o-toggle-gap)); }
65
+ .o-toggle-group[data-orientation="vertical"] { flex-direction: column; }
66
+ .o-toggle-group.o-button-group { gap: 0; }
67
+ }
@@ -0,0 +1,16 @@
1
+ /** One name a control reads: its kind (a colour and a shadow are declared in the dark too) and the Outright token it stands for. */
2
+ export type ControlToken = {
3
+ readonly name: `--vk-${string}`;
4
+ readonly kind: "colour" | "shadow" | "size" | "motion";
5
+ readonly outright: `--${string}`;
6
+ };
7
+ /** Each control's own list, by its piece: what its stylesheet reads. */
8
+ export declare const VK_CONTROL_TOKENS_BY_PIECE: Readonly<Record<string, readonly ControlToken[]>>;
9
+ /** Every name the controls read, once, with the piece that names it first. */
10
+ export declare const VK_CONTROL_TOKENS: readonly (ControlToken & {
11
+ readonly piece: string;
12
+ })[];
13
+ /** The controls' own machinery, set and read by a control alone: not public, and not prefixed, because the names came with
14
+ * the controls from the Outright kit and other pieces still set them. The smooth corner's and the pressing room's are every
15
+ * control's; each control names its own beside its tokens. An app neither sets nor reads them. */
16
+ export declare const VK_CONTROL_PRIVATE_FAMILIES: readonly string[];
@@ -0,0 +1,49 @@
1
+ import { BUTTON_PRIVATE, BUTTON_TOKENS } from "./button/tokens.js";
2
+ import { SPINNER_PRIVATE, SPINNER_TOKENS } from "./spinner/tokens.js";
3
+ import { SCROLLBAR_PRIVATE, SCROLLBAR_TOKENS } from "./scrollbar/tokens.js";
4
+ import { KBD_PRIVATE, KBD_TOKENS } from "./kbd/tokens.js";
5
+ import { TOOLTIP_PRIVATE, TOOLTIP_TOKENS } from "./tooltip/tokens.js";
6
+ import { GLASS_BUTTON_PRIVATE, GLASS_BUTTON_TOKENS } from "./glass-button/tokens.js";
7
+ import { POPOVER_PRIVATE, POPOVER_TOKENS } from "./popover/tokens.js";
8
+ import { PHONE_HEADER_PRIVATE, PHONE_HEADER_TOKENS } from "./phone-header/tokens.js";
9
+ import { SHEET_PRIVATE, SHEET_TOKENS } from "./sheet/tokens.js";
10
+ import { CHECKBOX_PRIVATE, CHECKBOX_TOKENS } from "./checkbox/tokens.js";
11
+ import { FIELD_PRIVATE, FIELD_TOKENS } from "./field/tokens.js";
12
+ import { INLINE_INPUT_PRIVATE, INLINE_INPUT_TOKENS } from "./inline-input/tokens.js";
13
+ import { INPUT_PRIVATE, INPUT_TOKENS } from "./input/tokens.js";
14
+ import { NUMBER_FIELD_PRIVATE, NUMBER_FIELD_TOKENS } from "./number-field/tokens.js";
15
+ import { TOGGLE_PRIVATE, TOGGLE_TOKENS } from "./toggle/tokens.js";
16
+ import { OPTION_PRIVATE, OPTION_TOKENS } from "./option/tokens.js";
17
+ import { STATUS_PRIVATE, STATUS_TOKENS } from "./status/tokens.js";
18
+ import { SWITCH_PRIVATE, SWITCH_TOKENS } from "./switch/tokens.js";
19
+ import { TAG_PRIVATE, TAG_TOKENS } from "./tag/tokens.js";
20
+ import { LIST_PRIVATE, LIST_TOKENS } from "./list/tokens.js";
21
+ import { MENU_LIST_PRIVATE, MENU_LIST_TOKENS } from "./menu-list/tokens.js";
22
+ const CONTROLS_OWN = {
23
+ button: { tokens: BUTTON_TOKENS, private: BUTTON_PRIVATE },
24
+ spinner: { tokens: SPINNER_TOKENS, private: SPINNER_PRIVATE },
25
+ scrollbar: { tokens: SCROLLBAR_TOKENS, private: SCROLLBAR_PRIVATE },
26
+ kbd: { tokens: KBD_TOKENS, private: KBD_PRIVATE },
27
+ tooltip: { tokens: TOOLTIP_TOKENS, private: TOOLTIP_PRIVATE },
28
+ "glass-button": { tokens: GLASS_BUTTON_TOKENS, private: GLASS_BUTTON_PRIVATE },
29
+ popover: { tokens: POPOVER_TOKENS, private: POPOVER_PRIVATE },
30
+ "phone-header": { tokens: PHONE_HEADER_TOKENS, private: PHONE_HEADER_PRIVATE },
31
+ sheet: { tokens: SHEET_TOKENS, private: SHEET_PRIVATE },
32
+ input: { tokens: INPUT_TOKENS, private: INPUT_PRIVATE },
33
+ "inline-input": { tokens: INLINE_INPUT_TOKENS, private: INLINE_INPUT_PRIVATE },
34
+ field: { tokens: FIELD_TOKENS, private: FIELD_PRIVATE },
35
+ toggle: { tokens: TOGGLE_TOKENS, private: TOGGLE_PRIVATE },
36
+ "number-field": { tokens: NUMBER_FIELD_TOKENS, private: NUMBER_FIELD_PRIVATE },
37
+ checkbox: { tokens: CHECKBOX_TOKENS, private: CHECKBOX_PRIVATE },
38
+ tag: { tokens: TAG_TOKENS, private: TAG_PRIVATE },
39
+ option: { tokens: OPTION_TOKENS, private: OPTION_PRIVATE },
40
+ status: { tokens: STATUS_TOKENS, private: STATUS_PRIVATE },
41
+ switch: { tokens: SWITCH_TOKENS, private: SWITCH_PRIVATE },
42
+ list: { tokens: LIST_TOKENS, private: LIST_PRIVATE },
43
+ "menu-list": { tokens: MENU_LIST_TOKENS, private: MENU_LIST_PRIVATE },
44
+ };
45
+ export const VK_CONTROL_TOKENS_BY_PIECE = Object.fromEntries(Object.entries(CONTROLS_OWN).map(([piece, own]) => [piece, own.tokens]));
46
+ export const VK_CONTROL_TOKENS = Object.entries(VK_CONTROL_TOKENS_BY_PIECE)
47
+ .flatMap(([piece, list]) => list.map((token) => ({ ...token, piece })))
48
+ .filter((token, i, all) => all.findIndex((other) => other.name === token.name) === i);
49
+ export const VK_CONTROL_PRIVATE_FAMILIES = ["--smooth-", "--pressing-room-", ...Object.values(CONTROLS_OWN).flatMap((own) => own.private)];
@@ -0,0 +1,4 @@
1
+ import type { PieceLooks } from "../../looks/looks.js";
2
+ export type TooltipLookOptionId = "arrow";
3
+ /** The Tooltip's option. */
4
+ export declare const TOOLTIP_LOOKS: PieceLooks<TooltipLookOptionId>;
@@ -0,0 +1,4 @@
1
+ const options = [
2
+ { id: "arrow", name: "Arrow", def: "none", values: [{ id: "none", name: "None" }, { id: "soft", name: "Soft point" }] },
3
+ ];
4
+ export const TOOLTIP_LOOKS = { id: "tooltip", name: "Tooltip", options, looks: [] };
@@ -0,0 +1,3 @@
1
+ import type { ViewsTooltipProps } from "../../provider/components.js";
2
+ /** ViewKit's tooltip, drawn as the kit's Tooltip: what it names is its child itself, no element round it. */
3
+ export declare function MapTooltip({ content, children, side }: ViewsTooltipProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Tooltip } from "./tooltip.js";
3
+ export function MapTooltip({ content, children, side }) {
4
+ return _jsx(Tooltip, { label: content, side: side, children: children });
5
+ }
@@ -0,0 +1,75 @@
1
+ export declare const TOOLTIP_TOKENS: readonly [{
2
+ readonly name: "--vk-fg";
3
+ readonly kind: "colour";
4
+ readonly outright: "--text";
5
+ }, {
6
+ readonly name: "--vk-ground";
7
+ readonly kind: "colour";
8
+ readonly outright: "--surface";
9
+ }, {
10
+ readonly name: "--vk-border-width";
11
+ readonly kind: "size";
12
+ readonly outright: "--border-width";
13
+ }, {
14
+ readonly name: "--vk-corner-smoothing";
15
+ readonly kind: "size";
16
+ readonly outright: "--corner-smoothing";
17
+ }, {
18
+ readonly name: "--vk-duration-fast";
19
+ readonly kind: "motion";
20
+ readonly outright: "--duration-fast";
21
+ }, {
22
+ readonly name: "--vk-ease-out";
23
+ readonly kind: "motion";
24
+ readonly outright: "--ease-out";
25
+ }, {
26
+ readonly name: "--vk-font-size-2xs";
27
+ readonly kind: "size";
28
+ readonly outright: "--text-2xs";
29
+ }, {
30
+ readonly name: "--vk-font-size-xs";
31
+ readonly kind: "size";
32
+ readonly outright: "--text-xs";
33
+ }, {
34
+ readonly name: "--vk-line-height-xs";
35
+ readonly kind: "size";
36
+ readonly outright: "--text-xs--line-height";
37
+ }, {
38
+ readonly name: "--vk-font-weight-medium";
39
+ readonly kind: "size";
40
+ readonly outright: "--font-weight-medium";
41
+ }, {
42
+ readonly name: "--vk-font-weight-normal";
43
+ readonly kind: "size";
44
+ readonly outright: "--font-weight-normal";
45
+ }, {
46
+ readonly name: "--vk-layer-popup";
47
+ readonly kind: "size";
48
+ readonly outright: "--layer-popup";
49
+ }, {
50
+ readonly name: "--vk-radius-md";
51
+ readonly kind: "size";
52
+ readonly outright: "--radius-md";
53
+ }, {
54
+ readonly name: "--vk-radius-xs";
55
+ readonly kind: "size";
56
+ readonly outright: "--radius-xs";
57
+ }, {
58
+ readonly name: "--vk-spacing";
59
+ readonly kind: "size";
60
+ readonly outright: "--spacing";
61
+ }, {
62
+ readonly name: "--vk-tooltip-delay";
63
+ readonly kind: "motion";
64
+ readonly outright: "--tooltip-delay";
65
+ }, {
66
+ readonly name: "--vk-tooltip-warm";
67
+ readonly kind: "motion";
68
+ readonly outright: "--tooltip-warm";
69
+ }, {
70
+ readonly name: "--vk-toast-duration";
71
+ readonly kind: "motion";
72
+ readonly outright: "--toast-duration";
73
+ }];
74
+ /** The prefix of the tooltip's own machinery, set and read by it alone: not public. */
75
+ export declare const TOOLTIP_PRIVATE: readonly ["--tooltip-"];