@mkbabb/glass-ui 8.0.0 → 10.0.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 (264) hide show
  1. package/MIGRATION.md +4768 -0
  2. package/README.md +57 -13
  3. package/dist/DialogContent-CwIBvou_.js +157 -0
  4. package/dist/{DropdownMenuTrigger-8UZsBtZ8.js → DropdownMenuTrigger-CKRnhDSQ.js} +1 -1
  5. package/dist/{Surface-i1tWC-Ga.js → Surface-1nPoabc3.js} +1 -1
  6. package/dist/{accent-tone-solve-Cw7WkRD9.js → accent-tone-solve-5H6FY2QO.js} +1 -1
  7. package/dist/aurora.js +386 -355
  8. package/dist/{badge-owUOaaba.js → badge-BO6BC4G5.js} +1 -1
  9. package/dist/badge.js +1 -1
  10. package/dist/blob.js +44 -44
  11. package/dist/{button-yvGPb0Bx.js → button-BOFTUPyU.js} +1 -1
  12. package/dist/button.js +1 -1
  13. package/dist/{card-3HFFpC7_.js → card-ByyqRBvK.js} +2 -2
  14. package/dist/card.js +1 -1
  15. package/dist/carousel.js +3 -3
  16. package/dist/{checkbox-BnXuGgJ3.js → checkbox-B1qn65se.js} +1 -1
  17. package/dist/checkbox.js +1 -1
  18. package/dist/chip.js +8 -3
  19. package/dist/{class-names-q-UGOkHH.js → class-names-FlXcvRRT.js} +65 -18
  20. package/dist/{collapsible-B7O6m-Ch.js → collapsible-DFzK29Oh.js} +5 -2
  21. package/dist/collapsible.js +1 -1
  22. package/dist/color.glsl-DTJhdekG.js +34 -0
  23. package/dist/color.js +11 -11
  24. package/dist/color.wgsl-BTszLY39.js +398 -0
  25. package/dist/{command-BuBnYpxF.js → command-C-5xSEJ2.js} +8 -8
  26. package/dist/command.js +1 -1
  27. package/dist/component-styles.css +1 -0
  28. package/dist/components/_shared/class-names.d.ts +10 -1
  29. package/dist/components/_shared/control.d.ts +0 -1
  30. package/dist/components/_shared/index.d.ts +0 -1
  31. package/dist/components/_shared/menu/menu.css +1 -1
  32. package/dist/components/_shared/overlay/index.d.ts +1 -0
  33. package/dist/components/_shared/overlay/shortcuts.d.ts +12 -0
  34. package/dist/components/aurora/Aurora.vue.d.ts +1 -0
  35. package/dist/components/aurora/composables/atoms.d.ts +22 -6
  36. package/dist/components/aurora/composables/frameLoop.d.ts +6 -5
  37. package/dist/components/aurora/composables/runtime.d.ts +28 -1
  38. package/dist/components/aurora/composables/useAurora.d.ts +28 -0
  39. package/dist/components/aurora/composables/wgpuSetup.d.ts +1 -1
  40. package/dist/components/aurora/constants/presets.d.ts +62 -5
  41. package/dist/components/aurora/index.d.ts +1 -1
  42. package/dist/components/blob/Blob.vue.d.ts +3 -3
  43. package/dist/components/card/Card.vue.d.ts +8 -2
  44. package/dist/components/chip/Chip.vue.d.ts +1 -7
  45. package/dist/components/chip/chipVariants.d.ts +1 -0
  46. package/dist/components/collapsible/Collapsible.vue.d.ts +1 -0
  47. package/dist/components/command/CommandDialog.vue.d.ts +1 -1
  48. package/dist/components/configurator/Configurator.vue.d.ts +25 -2
  49. package/dist/components/configurator/ConfiguratorRow.vue.d.ts +4 -2
  50. package/dist/components/configurator/styles.css +1 -1
  51. package/dist/components/dark-mode-toggle/dark-mode-toggle.css +1 -1
  52. package/dist/components/deck/styles/capture.css +1 -1
  53. package/dist/components/dialog/styles.css +1 -1
  54. package/dist/components/dock/DockSeparator.vue.d.ts +2 -3
  55. package/dist/components/dock/GlassDock.vue.d.ts +1 -0
  56. package/dist/components/dock/composables/dockContext.d.ts +1 -8
  57. package/dist/components/dock/composables/dockCrossfadeContext.d.ts +0 -2
  58. package/dist/components/dock/composables/index.d.ts +1 -1
  59. package/dist/components/dock/composables/useDockHold.d.ts +16 -12
  60. package/dist/components/dock/composables/useDockRun.d.ts +20 -0
  61. package/dist/components/dock/composables/useDockSearch.d.ts +1 -1
  62. package/dist/components/dock/composables/useDockShellProps.d.ts +18 -101
  63. package/dist/components/dock/composables/useDockState.d.ts +2 -9
  64. package/dist/components/dock/constants.d.ts +15 -0
  65. package/dist/components/dock/index.d.ts +2 -2
  66. package/dist/components/dock/styles/controls/icon-button.css +1 -1
  67. package/dist/components/dock/styles/controls/tab-button.css +1 -1
  68. package/dist/components/dock/styles/controls/triggers.css +1 -1
  69. package/dist/components/dock/styles/controls.css +1 -1
  70. package/dist/components/dock/styles/density.css +1 -1
  71. package/dist/components/dock/styles/index.css +1 -1
  72. package/dist/components/dock/styles/layer-group.css +1 -1
  73. package/dist/components/dock/styles/layers.css +1 -1
  74. package/dist/components/dock/styles/morph.css +1 -1
  75. package/dist/components/dock/styles/run.css +1 -0
  76. package/dist/components/dock/styles/search.css +1 -1
  77. package/dist/components/dock/styles/shape.css +1 -1
  78. package/dist/components/dock/styles/shell-regions.css +1 -1
  79. package/dist/components/dock/styles/shell.css +1 -1
  80. package/dist/components/fourier-field/FourierField.vue.d.ts +29 -26
  81. package/dist/components/fourier-field/clock.d.ts +35 -0
  82. package/dist/components/fourier-field/constants.d.ts +80 -104
  83. package/dist/components/fourier-field/index.d.ts +3 -28
  84. package/dist/components/fourier-field/math.d.ts +69 -77
  85. package/dist/components/fourier-field/renderer/mint.d.ts +50 -0
  86. package/dist/components/fourier-field/renderer/uniforms.d.ts +84 -0
  87. package/dist/components/fourier-field/renderer/wgpu.d.ts +28 -0
  88. package/dist/components/fourier-field/shaders/compute.wgsl.d.ts +1 -0
  89. package/dist/components/fourier-field/shaders/render.wgsl.d.ts +1 -0
  90. package/dist/components/fourier-field/useFourierField.d.ts +49 -0
  91. package/dist/components/handmark/HandMark.vue.d.ts +18 -14
  92. package/dist/components/handmark/index.d.ts +4 -23
  93. package/dist/components/handmark/stroke.d.ts +92 -0
  94. package/dist/components/labeled-field/LabeledSwitch.vue.d.ts +3 -1
  95. package/dist/components/labeled-field/types.d.ts +1 -1
  96. package/dist/components/menu/DropdownMenu.vue.d.ts +1 -1
  97. package/dist/components/metric/coalesce-metric.d.ts +6 -1
  98. package/dist/components/metric/styles.css +1 -1
  99. package/dist/components/popover/Popover.vue.d.ts +1 -1
  100. package/dist/components/scroll-progress-rim/styles.css +1 -1
  101. package/dist/components/sheet/styles.css +1 -1
  102. package/dist/components/slider/styles.css +1 -1
  103. package/dist/components/tabs/SegmentedTabs.vue.d.ts +25 -112
  104. package/dist/components/tabs/composables/useTabDragMorph.d.ts +1 -1
  105. package/dist/components/tabs/composables/useTabResponsive.d.ts +11 -11
  106. package/dist/components/tabs/index.d.ts +1 -1
  107. package/dist/components/tabs/styles/drag.css +1 -1
  108. package/dist/components/tabs/styles/segmented.css +1 -1
  109. package/dist/components/tabs/types.d.ts +85 -0
  110. package/dist/components/timeline/index.d.ts +2 -0
  111. package/dist/components/toast/Toast.vue.d.ts +2 -2
  112. package/dist/composables/color/index.d.ts +0 -15
  113. package/dist/composables/dark/darkModeSyncScript.d.ts +42 -0
  114. package/dist/composables/dom/useResolveTokenColor.d.ts +1 -1
  115. package/dist/composables/glass/index.d.ts +2 -0
  116. package/dist/composables/keyboard/useKeyboardShortcuts.d.ts +47 -1
  117. package/dist/composables/motion/pointer/pointerFieldMappings.d.ts +0 -41
  118. package/dist/{components/search/composables → composables/search}/index.d.ts +2 -2
  119. package/dist/{components/search/composables/fuzzySearchIndex.d.ts → composables/search/match.d.ts} +8 -3
  120. package/dist/composables/sidebar/types.d.ts +5 -1
  121. package/dist/configurator-DiwVN573.js +339 -0
  122. package/dist/configurator.js +1 -1
  123. package/dist/constellation.js +5 -5
  124. package/dist/{content-CWO-XL7o.js → content-So3j6SOe.js} +1 -1
  125. package/dist/control-DJp15L4U.js +7 -0
  126. package/dist/dark-mode-toggle.js +2 -2
  127. package/dist/{dark-z_P5QwqI.js → dark-pONY3x93.js} +2 -2
  128. package/dist/dark.js +1 -1
  129. package/dist/{data-table-_RrOEdiw.js → data-table-Ba_uTfPc.js} +3 -3
  130. package/dist/data-table.js +1 -1
  131. package/dist/{deck-Ci6YjB5e.js → deck-Cm_VmyNL.js} +1 -1
  132. package/dist/deck.js +1 -1
  133. package/dist/{dialog-CbRnTRtg.js → dialog-BZoFG0j8.js} +1 -1
  134. package/dist/dialog.js +2 -2
  135. package/dist/dock.js +718 -496
  136. package/dist/dom.js +90 -8
  137. package/dist/easing.js +5 -5
  138. package/dist/expandable-container-CZUj9BzY.js +142 -0
  139. package/dist/expandable-container.js +2 -142
  140. package/dist/fourier-field.js +638 -855
  141. package/dist/fourier-math.js +6 -6
  142. package/dist/glass-ui.css +1 -1
  143. package/dist/glass-ui.js +88 -75
  144. package/dist/handmark.js +330 -718
  145. package/dist/index.d.ts +2 -2
  146. package/dist/infinite-scroll.js +16 -17
  147. package/dist/{input-Bls2A4Tt.js → input-eLZ_AU7l.js} +1 -1
  148. package/dist/input.js +1 -1
  149. package/dist/keyboard.js +64 -21
  150. package/dist/{label-BQEZhnK_.js → label-CE03H1KL.js} +2 -2
  151. package/dist/label.js +1 -1
  152. package/dist/labeled-field.js +9 -6
  153. package/dist/{menu-wLu1XGKn.js → menu-BnmCOa3y.js} +93 -90
  154. package/dist/menu.js +2 -2
  155. package/dist/metric.js +12 -7
  156. package/dist/{motion-D4uYE0UM.js → motion-BvV1_24p.js} +1 -1
  157. package/dist/motion-core.js +35 -35
  158. package/dist/{number-field-NFAwQ0HK.js → number-field-RP89046a.js} +2 -2
  159. package/dist/number-field.js +1 -1
  160. package/dist/pager-dots.js +3 -3
  161. package/dist/{participation-B0hdsIRo.js → participation-Di4UHbzk.js} +8 -8
  162. package/dist/{pointerFieldMappings-DP5tla5z.js → pointerFieldMappings-DXwlU5uj.js} +7 -23
  163. package/dist/popover-DA87hFBx.js +184 -0
  164. package/dist/popover.js +1 -1
  165. package/dist/{progress-DF8dWZIX.js → progress-eVa-mc7J.js} +1 -1
  166. package/dist/progress.js +1 -1
  167. package/dist/{radio-group-Ci8o-pDx.js → radio-group-B58Bz16F.js} +2 -2
  168. package/dist/radio-group.js +1 -1
  169. package/dist/{select-CDgwGH_P.js → select-fy3vtArm.js} +13 -13
  170. package/dist/select.js +1 -1
  171. package/dist/{separator-CN11t406.js → separator-D4EZM10u.js} +2 -2
  172. package/dist/separator.js +1 -1
  173. package/dist/{sheet-BEFvnO_u.js → sheet-BQJyER59.js} +120 -115
  174. package/dist/sheet.js +2 -2
  175. package/dist/shortcuts-DGGWNRNe.js +13 -0
  176. package/dist/sidebar.js +4 -4
  177. package/dist/{slider-gsc8jDIo.js → slider-5ChjjWSR.js} +1 -1
  178. package/dist/slider.js +1 -1
  179. package/dist/{status-dot-BpnqOP5N.js → status-dot-W4LFiJps.js} +2 -2
  180. package/dist/status-dot.js +1 -1
  181. package/dist/styles/accessibility.css +1 -1
  182. package/dist/styles/animations.css +1 -1
  183. package/dist/styles/components.css +1 -1
  184. package/dist/styles/glass/a11y-fallback.css +1 -1
  185. package/dist/styles/glass/dissolve.css +1 -1
  186. package/dist/styles/glass/focus-veil.css +1 -1
  187. package/dist/styles/glass/ladder.css +1 -1
  188. package/dist/styles/glass/material.css +1 -1
  189. package/dist/styles/glass/overlay-plate.css +1 -1
  190. package/dist/styles/glass/reveal.css +1 -1
  191. package/dist/styles/glass-specular-track.css +1 -1
  192. package/dist/styles/paper.css +1 -1
  193. package/dist/styles/scroll-choreography.css +1 -1
  194. package/dist/styles/scroll-chrome.css +1 -1
  195. package/dist/styles/scroll-driven.css +1 -1
  196. package/dist/styles/theme/literals.css +1 -1
  197. package/dist/styles/tokens/color-radius.css +1 -1
  198. package/dist/styles/tokens/dark-arm-glass.css +1 -1
  199. package/dist/styles/tokens/light-dark.css +1 -1
  200. package/dist/styles/tokens/offsets.css +1 -1
  201. package/dist/styles/tokens/scheme-motion.css +1 -1
  202. package/dist/styles/tokens/sizing.css +1 -1
  203. package/dist/styles/typography/semantic.css +1 -1
  204. package/dist/styles/typography/utilities.css +1 -1
  205. package/dist/styles/utilities/a11y-overrides.css +1 -1
  206. package/dist/styles/utilities/responsive.css +1 -1
  207. package/dist/styles/view-transition.css +1 -1
  208. package/dist/styles/viz-reveal.css +1 -1
  209. package/dist/surface.js +1 -1
  210. package/dist/{switch-DxZzDrmV.js → switch-BYUZ6g9G.js} +2 -2
  211. package/dist/switch.js +1 -1
  212. package/dist/{tabs-CYscnq5H.js → tabs-rdRXKXxd.js} +4 -3
  213. package/dist/tabs.js +1 -1
  214. package/dist/textarea.js +1 -1
  215. package/dist/timeline.js +44 -42
  216. package/dist/{toast-9c6Kp58L.js → toast-DVOwo6GB.js} +1 -1
  217. package/dist/toast.js +1 -1
  218. package/dist/{toggle-group-11aPGMfE.js → toggle-group-CC5b3o1R.js} +2 -2
  219. package/dist/toggle-group.js +1 -1
  220. package/dist/{tooltip-DqKMZ4dn.js → tooltip-DhTHhtJN.js} +2 -2
  221. package/dist/tooltip.js +1 -1
  222. package/dist/typewriter.js +1 -1
  223. package/dist/{useAccentTone-DFAh1osB.js → useAccentTone-DitmKfGL.js} +1 -1
  224. package/dist/{resolveCanvasColor-6MCrswTB.js → useCanvas2D-CQRElMyE.js} +1 -11
  225. package/dist/{usePointerVelocityField-DsIf7yyq.js → usePointerVelocityField-Lx26_Yap.js} +1 -1
  226. package/dist/useResolveTokenColor-B2FfJnd9.js +24 -0
  227. package/package.json +5 -21
  228. package/dist/DialogContent-4hzLiaCQ.js +0 -152
  229. package/dist/canvas.d.ts +0 -1
  230. package/dist/canvas.js +0 -2
  231. package/dist/color.wgsl-B0N3mKMb.js +0 -412
  232. package/dist/compile-D7VYG3gi.js +0 -19
  233. package/dist/components/dock/composables/useDockOverflowFit.d.ts +0 -20
  234. package/dist/components/dock/composables/useDockTouchGate.d.ts +0 -42
  235. package/dist/components/dock/styles/overflow.css +0 -1
  236. package/dist/components/fourier-field/composables/fourierFieldGLSetup.d.ts +0 -24
  237. package/dist/components/fourier-field/composables/fourierFieldWGPUSetup.d.ts +0 -31
  238. package/dist/components/fourier-field/composables/uniformBridgeWGPU.d.ts +0 -39
  239. package/dist/components/fourier-field/composables/useFourierField.d.ts +0 -56
  240. package/dist/components/fourier-field/shaders/fourier-field.compute.wgsl.d.ts +0 -1
  241. package/dist/components/fourier-field/shaders/fourier-field.glsl.d.ts +0 -4
  242. package/dist/components/fourier-field/shaders/fourier-field.render.wgsl.d.ts +0 -1
  243. package/dist/components/fourier-field/shaders/fourier-field.ribbon.d.ts +0 -51
  244. package/dist/components/handmark/brush.d.ts +0 -269
  245. package/dist/components/handmark/composables/useHandMark.d.ts +0 -99
  246. package/dist/components/handmark/constants.d.ts +0 -69
  247. package/dist/components/handmark/freehand.d.ts +0 -69
  248. package/dist/components/handmark/geometry.d.ts +0 -62
  249. package/dist/components/handmark/ink.d.ts +0 -11
  250. package/dist/components/handmark/noise.d.ts +0 -30
  251. package/dist/components/handmark/texture.d.ts +0 -39
  252. package/dist/components/handmark/types.d.ts +0 -70
  253. package/dist/components/search/SearchBar.vue.d.ts +0 -38
  254. package/dist/components/search/index.d.ts +0 -8
  255. package/dist/components/search/searchVariants.d.ts +0 -16
  256. package/dist/configurator-BoeScnDL.js +0 -311
  257. package/dist/control-Da4XeT43.js +0 -11
  258. package/dist/popover-DBMKTPkL.js +0 -181
  259. package/dist/search.d.ts +0 -1
  260. package/dist/search.js +0 -61
  261. package/dist/useFuzzySearch-CUnZknpm.js +0 -177
  262. package/dist/useResolveTokenColor-CspQv_ik.js +0 -107
  263. /package/dist/{components/search/composables → composables/search}/types.d.ts +0 -0
  264. /package/dist/{components/search/composables → composables/search}/useFuzzySearch.d.ts +0 -0
@@ -1,69 +0,0 @@
1
- /**
2
- * freehand.ts — the VENDORED perfect-freehand geometry core (MIT, tldraw).
3
- * ─────────────────────────────────────────────────────────────────────────────
4
- * SPEC §1.1 / §11: glass-ui ships ZERO hard deps. `perfect-freehand` is an
5
- * OPTIONAL peer; its `getStroke` is the only one of the four engines that
6
- * produces TRUE variable width (the swelling/tapering crayon nib). We vendor only
7
- * its *geometry* core (a few hundred LOC, MIT) behind this L2 seam so:
8
- *
9
- * - the default pen/crayon presets (`ribbon: 'stroke'`) NEVER import it — the
10
- * bundle treeshakes it away (the shipped stroke-crayon, `ds-crayon-handmark`),
11
- * - the `ribbon: 'hull'` opt-in (the future width-variance upgrade) has a
12
- * dependency-free, deterministic body engine already in place,
13
- * - the pointer-capture half of the library (dead weight to us) never ships.
14
- *
15
- * This is the `getStroke` + `getStrokeOutlinePoints` + `getStrokePoints` core
16
- * from perfect-freehand@1.2.3 (Steve Ruiz, MIT), transcribed to TypeScript with
17
- * the `getSvgPathFromStroke` median-quad serialiser the references use. The
18
- * algorithm is verbatim; only the module shape (named exports, vendored vec math)
19
- * is glass-ui-local.
20
- *
21
- * @license MIT — perfect-freehand © Stephen Ruiz Ltd. https://github.com/steveruizok/perfect-freehand
22
- */
23
- /** A point: [x, y] or [x, y, pressure]. */
24
- export type InputPoint = [number, number] | [number, number, number];
25
- export interface StrokeOptions {
26
- size?: number;
27
- thinning?: number;
28
- smoothing?: number;
29
- streamline?: number;
30
- easing?: (t: number) => number;
31
- simulatePressure?: boolean;
32
- start?: {
33
- cap?: boolean;
34
- taper?: number | boolean;
35
- easing?: (t: number) => number;
36
- };
37
- end?: {
38
- cap?: boolean;
39
- taper?: number | boolean;
40
- easing?: (t: number) => number;
41
- };
42
- last?: boolean;
43
- }
44
- interface StrokePoint {
45
- point: number[];
46
- pressure: number;
47
- distance: number;
48
- vector: number[];
49
- runningLength: number;
50
- }
51
- /**
52
- * getStrokePoints — resample the raw input into smoothed StrokePoints with
53
- * running length + per-segment unit vectors (the streamline low-pass).
54
- */
55
- export declare function getStrokePoints(points: InputPoint[], options?: StrokeOptions): StrokePoint[];
56
- /**
57
- * getStrokeOutlinePoints — walk the StrokePoints, emit left/right offset points
58
- * (the variable-width hull), with tapered caps.
59
- */
60
- export declare function getStrokeOutlinePoints(points: StrokePoint[], options?: StrokeOptions): number[][];
61
- /** getStroke — the public entry: raw input → variable-width hull outline points. */
62
- export declare function getStroke(points: InputPoint[], options?: StrokeOptions): number[][];
63
- /**
64
- * getSvgPathFromStroke — the canonical median-quad serialiser the references use:
65
- * each segment's control point is the midpoint of two consecutive outline points,
66
- * yielding a smooth closed fill `d`-string.
67
- */
68
- export declare function getSvgPathFromStroke(stroke: number[][], closed?: boolean): string;
69
- export {};
@@ -1,62 +0,0 @@
1
- /**
2
- * geometry.ts — SEMANTIC shape → pencil-boil centerlines (L1, pure; SPEC §3).
3
- * ─────────────────────────────────────────────────────────────────────────────
4
- * A shape is a pure mapper: (semantic target) → L1 geometry. The renderer never
5
- * knows what it drew — it sees only `Point[]`. Adding a shape = adding one switch
6
- * arm; nothing downstream changes (texture + animation are shape-blind). This is
7
- * the generality lever (Brush ⟂ Path).
8
- *
9
- * The marking coordinate space is 0..100 × 0..40, with `preserveAspectRatio="none"`
10
- * so the <svg> stretches to the slotted word box (the SPEC §6.2 width-invariance
11
- * contract). Two usage modes:
12
- * - text mode (box == null): use the full viewBox (single-line underline/strike)
13
- * - positioned mode (box = {x,y,w,h}): map an explicit rect (circle a datum)
14
- *
15
- * The circle arm rides pencil-boil's `ellipsePoints` (the hand-circle
16
- * overshoot ring — the sole upstream geometry delta this component required).
17
- *
18
- * THE SEED RECONCILE ( [S2]): the wobble centerlines are seeded from
19
- * the HOUSE prng leaf (`src/composables/glass/procedural/prng.ts` mulberry32 + hashString — the
20
- * single-source). The family FEEDS pencil-boil a house-derived integer seed; glass-
21
- * ui code imports ZERO `mulberry32` from pencil-boil (its internal mulberry32 stays
22
- * inside its OWN perturb math). ONE seed leaf, the house identity.
23
- */
24
- import { type WobbleOptions } from "@mkbabb/pencil-boil";
25
- import type { HandShape, MarkBox } from "./types.js";
26
- /** A shape maps to one or more centerlines (open polylines) or one closed ring. */
27
- export interface ShapeGeom {
28
- lines: [number, number][][];
29
- closed: boolean;
30
- }
31
- /**
32
- * Semantic shape → { lines, closed } in the marking space (or a positioned box).
33
- *
34
- * The text-mode underline anchors to a MEASURED baseline: `baselineFrac` is the
35
- * slotted word's alphabetic baseline as a fraction of the `.hm` box height (the SFC
36
- * measures it via ResizeObserver + `document.fonts.ready`). The underline y is then
37
- * `H × (baselineFrac + UNDERLINE_GAP)` — not a hardcoded fraction (a fixed `32`,
38
- * 80% of the box, strikes through tight-leading headings). `null` ⇒ not yet measured: fall
39
- * back to a fixed `H − 8` constant so first paint (and jsdom/SSR) still renders a
40
- * line, replaced the instant the measure lands.
41
- *
42
- * `natural` routes the underline through the φ-incommensurate value-noise
43
- * `naturalUnderlinePoints` morphology instead of pencil-boil's `wobbleLinePoints`
44
- * (the masthead `boil` voice); the default underline keeps the pencil-boil line.
45
- *
46
- * The aspect-correct viewBox: `vbH` is the SFC-measured
47
- * marking-space HEIGHT (`VB_W, boxAspect`) for the TEXT-MODE underline/strikethrough/
48
- * highlight, so `preserveAspectRatio="none"` scales the wobble SHAPE uniformly (the x
49
- * and y scales EQUAL → the humps stop being x-stretched flat). It defaults to `VB_H`,
50
- * and is used ONLY for the measured text-mode y — the positioned/box/circle/bracket
51
- * path keeps `VB_H` byte-for-byte (it DEPENDS on the none-stretch to fill the datum
52
- * rect; the text-mode fix must not touch it).
53
- *
54
- * The amplitude knob: `ampScale` multiplies the natural-
55
- * underline excursion (default 1 ⇒ byte-identical; the SFC derives it from the brush
56
- * `wobble` scalar, decoupling excursion from stroke `weight`).
57
- */
58
- export declare function shapeGeom(shape: HandShape, opts: WobbleOptions, box?: MarkBox | null, baselineFrac?: number | null, natural?: boolean, vbH?: number, ampScale?: number): ShapeGeom;
59
- /** Boil one geometry: re-perturb the CACHED centerlines (anchored → no draw-on pop). */
60
- export declare function boilLines({ lines, closed }: ShapeGeom, amount: number, seed: number): [number, number][][];
61
- /** Serialize centerlines → one SVG `d` (multi-line shapes concat with a space). */
62
- export declare function serialize(lines: [number, number][][], jagged?: boolean): string;
@@ -1,11 +0,0 @@
1
- import type { Brush, InkPath } from "./brush.js";
2
- export interface SVGFragment {
3
- paths: InkPath[];
4
- filterId: string | null;
5
- defs: string[];
6
- }
7
- /**
8
- * ink — the only stage the brush fully drives. `jagged` serialises the stroke body
9
- * with angular kinks (pointsToLinear) instead of the smooth Catmull-Rom bezier.
10
- */
11
- export declare function ink(centerline: [number, number][], b: Brush, seed: number, color: string, filterId: string, jagged?: boolean): SVGFragment;
@@ -1,30 +0,0 @@
1
- /** smootherstep (6t⁵−15t⁴+10t³) — the C² fairing for the value-noise lerp. */
2
- export declare function smootherstep(t: number): number;
3
- /**
4
- * The boil voice — φ-incommensurate fractal value-noise (the masthead morphology):
5
- *
6
- * disp(t) = Σ_{k=0..OCT-1} aₖ · vnoiseₖ(t·fₖ + φₖ) normalised by Σaₖ
7
- * fₖ = NOISE_F0 · φ^k (φ mutually-irrational steps → the sum NEVER closes
8
- * into a period — the non-periodicity mechanism)
9
- * aₖ = (1/φ)^k (per-octave decay)
10
- * φₖ = seeded per-octave phase (house mulberry32)
11
- * vnoiseₖ = seeded lattice value-noise, smootherstep-faired
12
- *
13
- * The four brush axes:
14
- * - amplitude SCALES with the rendered span (`(x2−x1) × NOISE_AMP_FRAC × ampScale`),
15
- * not a viewBox-stretched constant (a long word and a short word wobble in
16
- * proportion); `ampScale` is the excursion knob (default 1
17
- * ⇒ byte-identical; the SFC derives it from the brush `wobble` scalar, decoupling
18
- * excursion from stroke `weight`);
19
- * - the hump-to-hump spacing is IRREGULAR (the φ-incommensurate octave sum — the
20
- * honest non-periodicity teeth, spacing-CV ~0.41 at the paint count vs a
21
- * sinusoid's ~0.14, over 400 seeds);
22
- * - the non-uniform body gives the pf hull a pressure-taper-friendly point stream;
23
- * - the seed is the HOUSE mulberry32.
24
- *
25
- * ENDPOINT anchor (NOT a body-wide envelope): a narrow cosine taper at the very ends
26
- * only (`NOISE_EDGE`), so the ends settle to baseline (no draw-on pop) while the BODY
27
- * amplitude stays irregular hump-to-hump. FILTER-FREE: the wander is in the control
28
- * points + the hull width, never a feTurbulence.
29
- */
30
- export declare function naturalUnderlinePoints(x1: number, y: number, x2: number, seed: number, segments: number, ampScale?: number): [number, number][];
@@ -1,39 +0,0 @@
1
- /**
2
- * texture.ts — the L3 grain as ONE parameterized SVG <filter> (pure; SPEC §4.2).
3
- * ─────────────────────────────────────────────────────────────────────────────
4
- * `grainFilter(id, b, seed)` returns the markup for ONE static, seeded <filter>
5
- * driven entirely by the brush vector. The KISS invariant (the PEN-is-free law,
6
- * SPEC §12 acc-4):
7
- *
8
- * grain <= 0 && grainScale <= 0 ⇒ returns '' ⇒ NO filter emitted ⇒ bare <path>.
9
- *
10
- * So pen/marker-lite get the cleanest vector edge at zero filter cost; pencil/
11
- * crayon get a real broken-edge filter. SAME code path, field delta only — never
12
- * an instrument `if`.
13
- *
14
- * The graph is the proven 5-stage pipeline from the `proto/_final` sandbox (it
15
- * supersets the bare SPEC §4.2 graph with a trailing re-break displacement —
16
- * `ds-crayon-handmark §4.4` keeps the proven one):
17
- * 1. feTurbulence (warp) — low-freq fractal noise for edge wobble
18
- * 2. feDisplacementMap (wob) — push the stroke edge by grainScale
19
- * 3. feTurbulence (grain) — high-freq noise = paper tooth / wax grain
20
- * 4. feColorMatrix (grainA) — threshold the grain into a hard alpha mask
21
- * 5. feComposite + feDisplace — knock paper-through holes (operator="in") + re-break
22
- *
23
- * CRITICAL (the Δ4 gate, `ds-crayon-handmark §3`): this filter is STATIC + SEEDED.
24
- * It rasters ONCE per (mount, resize, scheme flip) and is cached. The draw-on is a
25
- * `clip-path: inset()` wipe that mutates only the clip — it NEVER animates
26
- * `stroke-dashoffset` under the filter (which would re-raster the graph per frame).
27
- * Boil does NOT ship on this register (`ds-crayon-handmark §5.3`).
28
- *
29
- * `id` MUST be per-instance (the component's `useId()`) so two marks never collide
30
- * their <filter> namespaces — the house per-instance SVG-namespace idiom.
31
- *
32
- * The grain sub-seed is derived (`seed ^ 0x85eb`) per SPEC §7, so one top seed
33
- * re-rolls the grain coherently with the centerline wobble.
34
- */
35
- import type { Brush } from "./brush.js";
36
- /** @returns SVG <filter> markup, or '' when the brush is clean ink (pen). */
37
- export declare function grainFilter(id: string, b: Brush, seed: number): string;
38
- /** Does this brush emit a grain filter? (the pen-is-free predicate). */
39
- export declare function hasGrain(b: Brush): boolean;
@@ -1,70 +0,0 @@
1
- /**
2
- * types.ts — the public API surface (SPEC §6). Pure types, 0 runtime.
3
- * ─────────────────────────────────────────────────────────────────────────────
4
- * The L5 surface steals rough-notation's *vocabulary* (annotate-style props +
5
- * ordered groups), not its code. Every prop has a per-brush default, so the
6
- * common call is one tag: <HandMark>who pays in</HandMark>.
7
- */
8
- import type { Brush, BrushName } from "./brush.js";
9
- /** A target rect in the 0..100 × 0..40 marking space (positioned mode). */
10
- export interface MarkBox {
11
- x: number;
12
- y: number;
13
- w: number;
14
- h: number;
15
- }
16
- export type HandShape = "underline" | "strikethrough" | "highlight" | "circle" | "box" | "bracket" | "path";
17
- export type HandAnimation = "none" | "draw-on" | "boil" | "draw-then-boil";
18
- export interface HandMarkProps {
19
- /** 'pen'(default) | preset name | full/partial Brush object. */
20
- brush?: BrushName | Partial<Brush>;
21
- /** default 'underline'. */
22
- shape?: HandShape;
23
- /** ANY CSS color. default 'currentColor'. */
24
- color?: string;
25
- /** procedural variant — deterministic. default 1. */
26
- seed?: number;
27
- /** spread over the resolved brush (3rd resolution level). */
28
- overrides?: Partial<Brush>;
29
- /** default 'none' (the static-masthead default). */
30
- animation?: HandAnimation;
31
- /** draw-on duration. default 800. */
32
- drawMs?: number;
33
- /** draw-on start delay. default 0. */
34
- drawDelayMs?: number;
35
- /** draw-on trigger. default 'visible' (IntersectionObserver). */
36
- appear?: "mount" | "visible" | "manual";
37
- /** boil frame rate. default 8 (≈125ms). */
38
- boilFps?: number;
39
- /** distinct boil frames. default 3. */
40
- boilFrames?: number;
41
- /** override brush.roughness. */
42
- roughness?: number;
43
- /** wobble resolution. default per-brush. */
44
- segments?: number;
45
- /** angular kinks vs smooth bezier. default false. */
46
- jagged?: boolean;
47
- /**
48
- * NATURAL-underline excursion knob ( (c)). Multiplies the
49
- * scale-relative wobble amplitude (`span × NOISE_AMP_FRAC × amplitude`). Default is
50
- * unset ⇒ the amplitude is derived from the brush `wobble` scalar (byte-identical at
51
- * the shipped default); an explicit value WINS (e.g. `1.4` for a bolder hand line,
52
- * font-proportional). Only the natural/boil underline reads it.
53
- */
54
- amplitude?: number;
55
- /**
56
- * NATURAL underline morphology ( C-2). When true (the masthead
57
- * `boil` voice), the underline geometry goes PROCEDURAL — scale-relative
58
- * amplitude, an IRREGULAR seeded period count, off the house prng leaf feeding
59
- * pencil-boil — instead of pencil-boil's single `wobbleLinePoints` line. The
60
- * `boil` brush auto-engages it; the default underline keeps the pencil-boil line.
61
- * Ignored on non-underline shapes.
62
- */
63
- natural?: boolean;
64
- /** POSITIONED mode (circle a datum): explicit target rect. */
65
- box?: MarkBox;
66
- /** shape:'path' escape hatch — arbitrary SVG `d` (wins over shape). */
67
- path?: string;
68
- /** arbitrary point stream → brush ink. */
69
- points?: [number, number][];
70
- }
@@ -1,38 +0,0 @@
1
- import { type Component } from "vue";
2
- import type { Surface } from "../_shared/axes.js";
3
- import { type ControlSize, type SearchVariant } from "./searchVariants.js";
4
- type __VLS_Props = {
5
- modelValue?: string;
6
- placeholder?: string;
7
- icon?: Component;
8
- tag?: string;
9
- size?: ControlSize;
10
- surface?: Surface;
11
- variant?: SearchVariant;
12
- };
13
- declare var __VLS_13: {};
14
- type __VLS_Slots = {} & {
15
- default?: (props: typeof __VLS_13) => any;
16
- };
17
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
18
- inputRef: import("vue").Ref<HTMLInputElement | null, HTMLInputElement | null>;
19
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
- "update:modelValue": (value: string) => any;
21
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
22
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
23
- }>, {
24
- size: ControlSize;
25
- placeholder: string;
26
- modelValue: string;
27
- variant: SearchVariant;
28
- surface: Surface;
29
- tag: string;
30
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
31
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
32
- declare const _default: typeof __VLS_export;
33
- export default _default;
34
- type __VLS_WithSlots<T, S> = T & {
35
- new (): {
36
- $slots: S;
37
- };
38
- };
@@ -1,8 +0,0 @@
1
- export { default as SearchBar } from "./SearchBar.vue.js";
2
- export { searchFieldVariants } from "./searchVariants.js";
3
- export type { SearchVariant, SearchVariants } from "./searchVariants.js";
4
- export { useFuzzySearch } from "./composables/useFuzzySearch.js";
5
- export type { UseFuzzySearchOptions } from "./composables/useFuzzySearch.js";
6
- export { buildIndex, searchIndex, fuzzyMatch, clearSearchCache } from "./composables/fuzzySearchIndex.js";
7
- export type { SearchIndex } from "./composables/fuzzySearchIndex.js";
8
- export type { SearchableItem, SearchResult, FuzzySearchState } from "./composables/types.js";
@@ -1,16 +0,0 @@
1
- import { type ClassValue } from "../_shared/class-names.js";
2
- import { type ControlSize } from "../_shared/control.js";
3
- declare const VARIANT: {
4
- readonly inline: "";
5
- readonly floating: "";
6
- readonly bare: "border-none bg-transparent p-0 rounded-none";
7
- };
8
- export type SearchVariant = keyof typeof VARIANT;
9
- export interface SearchVariants {
10
- variant?: SearchVariant | null;
11
- class?: ClassValue;
12
- className?: ClassValue;
13
- }
14
- /** Search field chrome; size remains on the shared control-size axis. */
15
- export declare function searchFieldVariants(options?: SearchVariants): string;
16
- export type { ControlSize };
@@ -1,311 +0,0 @@
1
- import { t as e } from "./class-names-q-UGOkHH.js";
2
- import { t } from "./createContext-BhkE9mLH.js";
3
- import { t as n } from "./_plugin-vue_export-helper-B3ysoDQm.js";
4
- import { t as r } from "./label-BQEZhnK_.js";
5
- import { t as i } from "./fading-scroll-CTeW3KNS.js";
6
- import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, mergeModels as m, normalizeClass as h, normalizeStyle as g, openBlock as _, reactive as v, ref as y, renderList as b, renderSlot as x, toDisplayString as S, toRaw as C, unref as w, useId as T, useModel as E, withCtx as D, withModifiers as ee } from "vue";
7
- import { ChevronDown as O, RotateCcw as k } from "@lucide/vue";
8
- //#region src/components/configurator/size.ts
9
- var A = t("configuratorSize"), j = A.KEY;
10
- function M(e) {
11
- A.provide(e);
12
- }
13
- var N = A.use, P = ["data-aside-side", "data-gallery"], F = {
14
- key: 0,
15
- "data-gallery-dock": "",
16
- class: "configurator-presets shrink-0 px-3 py-2"
17
- }, I = [
18
- "data-active",
19
- "aria-pressed",
20
- "onClick"
21
- ], L = { class: "configurator-stage relative min-h-0 min-w-0 overflow-hidden" }, R = { class: "flex flex-col" }, z = {
22
- key: 1,
23
- class: "configurator-controls flex-1 min-h-0 overflow-visible"
24
- }, B = { class: "flex flex-col" }, V = {
25
- key: 2,
26
- class: "configurator-footer shrink-0 border-t px-3 py-2"
27
- }, H = /* @__PURE__ */ p({
28
- __name: "Configurator",
29
- props: {
30
- presets: {},
31
- activePreset: {},
32
- layers: {},
33
- activeLayer: {},
34
- scrollMode: { default: "auto" },
35
- size: { default: "md" },
36
- asideSide: { default: "right" },
37
- galleryPlacement: { default: "aside" },
38
- asideWidth: {},
39
- class: { type: [
40
- Boolean,
41
- null,
42
- String,
43
- Object,
44
- Array
45
- ] }
46
- },
47
- emits: [
48
- "select-preset",
49
- "select-layer",
50
- "reset"
51
- ],
52
- setup(t, { emit: n }) {
53
- let r = t;
54
- M(o(() => r.size));
55
- let d = n, p = o(() => e("configurator glass-floating rounded-panel border border-border/60 overflow-hidden", "grid grid-cols-1", "grid-rows-[auto_minmax(var(--configurator-stage-min,18rem),auto)_minmax(0,1fr)]", "min-h-0", r.class)), m = o(() => {
56
- let e = {
57
- "--radius-ctx": "var(--radius-panel)",
58
- "--radius-inset": "var(--configurator-pad-inline)"
59
- };
60
- if (r.asideWidth != null) {
61
- let [t, n] = Array.isArray(r.asideWidth) ? r.asideWidth : [r.asideWidth, r.asideWidth];
62
- e["--configurator-aside-min"] = t, e["--configurator-aside-max"] = n;
63
- }
64
- return e;
65
- }), v = o(() => r.asideSide === "left" ? "lg:border-r lg:border-l-0" : "lg:border-l"), y = o(() => r.scrollMode !== "never");
66
- return (n, r) => (_(), l("section", {
67
- "data-slot": "configurator",
68
- "data-aside-side": t.asideSide,
69
- "data-gallery": t.galleryPlacement,
70
- class: h(p.value),
71
- style: g(m.value)
72
- }, [
73
- n.$slots.presets || t.presets && t.presets.length > 0 ? (_(), l("div", F, [x(n.$slots, "presets", {
74
- presets: t.presets,
75
- activePreset: t.activePreset
76
- }, () => [f(w(i), {
77
- axis: "x",
78
- class: "configurator-gallery-track flex gap-2 scrollbar-hidden",
79
- role: "group",
80
- "aria-label": "Presets"
81
- }, {
82
- default: D(() => [(_(!0), l(a, null, b(t.presets, (n) => (_(), l("button", {
83
- key: n.key,
84
- type: "button",
85
- "data-preset-tile": "",
86
- "data-active": n.key === t.activePreset || void 0,
87
- "aria-pressed": n.key === t.activePreset,
88
- class: h(w(e)("configurator-preset-chip glass-capsule glass-capsule-hover shadow-cartoon focus-ring shrink-0 px-3 py-1 text-micro font-medium text-foreground", n.key === t.activePreset && "is-active")),
89
- onClick: ee((e) => d("select-preset", n.key), ["stop"])
90
- }, S(n.label), 11, I))), 128))]),
91
- _: 1
92
- })])])) : c("", !0),
93
- u("div", L, [x(n.$slots, "stage")]),
94
- u("aside", { class: h(w(e)("configurator-aside flex min-h-0 min-w-0 flex-col border-t lg:border-t-0", v.value)) }, [y.value ? (_(), s(w(i), {
95
- key: 0,
96
- axis: "y",
97
- class: "configurator-controls flex-1 min-h-0 scrollbar-thin"
98
- }, {
99
- default: D(() => [x(n.$slots, "controls", {
100
- layers: t.layers,
101
- activeLayer: t.activeLayer,
102
- selectLayer: (e) => d("select-layer", e)
103
- }, () => [u("div", R, [x(n.$slots, "default")])])]),
104
- _: 3
105
- })) : (_(), l("div", z, [x(n.$slots, "controls", {
106
- layers: t.layers,
107
- activeLayer: t.activeLayer,
108
- selectLayer: (e) => d("select-layer", e)
109
- }, () => [u("div", B, [x(n.$slots, "default")])])])), n.$slots.footer ? (_(), l("div", V, [x(n.$slots, "footer", { reset: () => d("reset") })])) : c("", !0)], 2)
110
- ], 14, P));
111
- }
112
- }), U = ["data-state"], te = [
113
- "aria-expanded",
114
- "aria-controls",
115
- "data-state"
116
- ], W = { class: "flex min-w-0 items-baseline gap-2" }, G = { class: "configurator-section-label truncate" }, K = {
117
- key: 0,
118
- class: "truncate text-micro font-mono text-muted-foreground/70"
119
- }, q = [
120
- "id",
121
- "aria-hidden",
122
- "inert",
123
- "data-state"
124
- ], J = { class: "min-h-0 overflow-hidden" }, Y = ["data-dividers"], X = /*#__PURE__*/ n(/* @__PURE__ */ p({
125
- __name: "ConfiguratorLayer",
126
- props: /*@__PURE__*/ m({
127
- label: {},
128
- sub: {},
129
- id: {},
130
- defaultOpen: {
131
- type: Boolean,
132
- default: !0
133
- },
134
- dividers: { type: Boolean },
135
- class: { type: [
136
- Boolean,
137
- null,
138
- String,
139
- Object,
140
- Array
141
- ] },
142
- bodyClass: { type: [
143
- Boolean,
144
- null,
145
- String,
146
- Object,
147
- Array
148
- ] }
149
- }, {
150
- open: {
151
- type: Boolean,
152
- default: void 0
153
- },
154
- openModifiers: {}
155
- }),
156
- emits: ["update:open"],
157
- setup(t) {
158
- let n = t, r = E(t, "open");
159
- r.value === void 0 && (r.value = n.defaultOpen);
160
- let i = `configurator-layer-body-${T()}`, a = o(() => n.id ?? i);
161
- function s() {
162
- r.value = !r.value;
163
- }
164
- let d = o(() => r.value ? "open" : "closed");
165
- return (i, o) => (_(), l("div", {
166
- "data-slot": "configurator-layer",
167
- class: h(w(e)("configurator-layer border", n.class)),
168
- "data-state": d.value
169
- }, [u("button", {
170
- type: "button",
171
- "data-slot": "configurator-layer-trigger",
172
- class: h(w(e)("configurator-layer-trigger", "group flex w-full items-center justify-between gap-2 py-2", "tap-squish transition-control text-left hover:bg-foreground/5 focus-ring")),
173
- "aria-expanded": r.value,
174
- "aria-controls": a.value,
175
- "data-state": d.value,
176
- onClick: s
177
- }, [u("div", W, [u("span", G, S(t.label), 1), t.sub ? (_(), l("span", K, S(t.sub), 1)) : c("", !0)]), f(w(O), {
178
- class: "h-4 w-4 shrink-0 text-muted-foreground group-data-[state=open]:rotate-180 transition-disclosure",
179
- "aria-hidden": "true"
180
- })], 10, te), u("div", {
181
- id: a.value,
182
- role: "region",
183
- "aria-hidden": !r.value,
184
- inert: !r.value || void 0,
185
- "data-state": d.value,
186
- class: "configurator-layer-region grid motion-reduce:transition-none",
187
- style: g({ gridTemplateRows: r.value ? "1fr" : "0fr" })
188
- }, [u("div", J, [u("div", {
189
- "data-dividers": n.dividers || void 0,
190
- class: h(w(e)("configurator-layer-body py-2 space-y-2", n.dividers && "[&>*+*]:border-t [&>*+*]:pt-2", n.bodyClass))
191
- }, [x(i.$slots, "default", {}, void 0, !0)], 10, Y)])], 12, q)], 10, U));
192
- }
193
- }), [["__scopeId", "data-v-22ad90dd"]]), Z = ["data-size"], Q = { class: "flex items-baseline justify-between gap-3" }, ne = { class: "flex min-w-0 items-baseline gap-2" }, re = {
194
- key: 0,
195
- class: "truncate text-small font-normal text-muted-foreground"
196
- }, ie = {
197
- key: 1,
198
- class: "truncate text-micro font-mono text-muted-foreground/70"
199
- }, ae = ["aria-label"], oe = { class: "flex w-full min-w-0 items-center [&>*]:min-w-0 [&>*]:w-full [&>*]:flex-1" }, $ = {
200
- key: 0,
201
- class: "text-micro leading-snug text-muted-foreground/80"
202
- }, se = /*#__PURE__*/ n(/* @__PURE__ */ p({
203
- __name: "ConfiguratorRow",
204
- props: {
205
- label: {},
206
- sub: {},
207
- name: {},
208
- description: {},
209
- canReset: { type: Boolean },
210
- size: {},
211
- class: { type: [
212
- Boolean,
213
- null,
214
- String,
215
- Object,
216
- Array
217
- ] }
218
- },
219
- emits: ["reset"],
220
- setup(t, { emit: n }) {
221
- let i = t, a = n, s = N(), p = o(() => i.size ?? s?.value ?? void 0);
222
- return (n, o) => (_(), l("div", {
223
- "data-slot": "configurator-row",
224
- class: h(w(e)("configurator-row flex flex-col gap-1.5 py-2", i.class)),
225
- "data-size": p.value
226
- }, [
227
- u("div", Q, [u("div", ne, [
228
- f(w(r), { class: "truncate text-small font-medium text-foreground" }, {
229
- default: D(() => [d(S(t.label), 1)]),
230
- _: 1
231
- }),
232
- t.sub ? (_(), l("span", re, S(t.sub), 1)) : c("", !0),
233
- t.name ? (_(), l("span", ie, S(t.name), 1)) : c("", !0)
234
- ]), t.canReset ? (_(), l("button", {
235
- key: 0,
236
- type: "button",
237
- "data-slot": "configurator-reset",
238
- class: "tap-squish transition-control focus-ring inline-flex h-6 w-6 items-center justify-center rounded-pill text-muted-foreground/60 hover:bg-foreground/5 hover:text-foreground",
239
- "aria-label": `Reset ${t.label}`,
240
- onClick: o[0] ||= (e) => a("reset")
241
- }, [f(w(k), {
242
- class: "h-3 w-3",
243
- "aria-hidden": "true"
244
- })], 8, ae)) : c("", !0)]),
245
- u("div", oe, [x(n.$slots, "default", {}, void 0, !0)]),
246
- t.description ? (_(), l("p", $, S(t.description), 1)) : c("", !0)
247
- ], 10, Z));
248
- }
249
- }), [["__scopeId", "data-v-7044aa73"]]);
250
- //#endregion
251
- //#region src/components/configurator/useConfiguratorState.ts
252
- function ce(e) {
253
- let t = C(e);
254
- if (typeof structuredClone != "function") throw Error("[glass-ui:configurator] structuredClone is unavailable in this runtime. Pass a custom clone via ConfiguratorStateOptions.clone for environments without structured-clone support.");
255
- try {
256
- return structuredClone(t);
257
- } catch (e) {
258
- throw Error("[glass-ui:configurator] structuredClone failed: " + (e instanceof Error ? e.message : String(e)) + ". Preset values must be structured-cloneable (no functions, symbols, DOM nodes, or class instances). Pass a custom clone via ConfiguratorStateOptions.clone if the data shape requires it.");
259
- }
260
- }
261
- function le(e, t) {
262
- return JSON.stringify(e) === JSON.stringify(t);
263
- }
264
- function ue(e) {
265
- let t = e.clone ?? ce, n = e.equals ?? le, r = e.presets, i = e.cloneMode ?? "commit-on-write", a = e.initialPreset ?? (r.length > 0 ? r[0].key : void 0), s = a ? r.find((e) => e.key === a) : void 0, c = v(s ? t(s.config) : {}), l = y(a), u = i === "per-preset" ? Object.fromEntries(r.map((e) => [e.key, t(e.config)])) : null, d = o(() => l.value), f = o(() => {
266
- let e = l.value;
267
- if (!e) return !1;
268
- let t = r.find((t) => t.key === e);
269
- return t ? !n(c, t.config) : !1;
270
- });
271
- function p(e) {
272
- return r.find((t) => t.key === e);
273
- }
274
- function m(e) {
275
- let t = c, n = e;
276
- for (let e of Object.keys(t)) e in n || delete t[e];
277
- for (let e of Object.keys(n)) t[e] = n[e];
278
- }
279
- function h(e) {
280
- u && (u[e] = t(c));
281
- }
282
- function g(e) {
283
- let n = p(e);
284
- if (n) if (i === "per-preset" && u) {
285
- let t = l.value;
286
- t && t !== e && t in u && h(t), l.value = e, m(u[e]);
287
- } else l.value = e, m(t(n.config));
288
- }
289
- function _() {
290
- let e = l.value;
291
- if (!e) return;
292
- let n = p(e);
293
- n && (i === "per-preset" && u ? (u[e] = t(n.config), m(u[e])) : m(t(n.config)));
294
- }
295
- function b(e = 1) {
296
- if (r.length === 0) return;
297
- let t = l.value, n = t ? r.findIndex((e) => e.key === t) : -1, i = r.length, a = r[(n + e + i) % i];
298
- g(a.key);
299
- }
300
- return {
301
- config: c,
302
- activePreset: d,
303
- isDirty: f,
304
- selectPreset: g,
305
- resetCurrent: _,
306
- cyclePreset: b,
307
- getPreset: p
308
- };
309
- }
310
- //#endregion
311
- export { j as a, H as i, se as n, M as o, X as r, N as s, ue as t };