@pagehub/sdk 0.1.5 → 0.1.7

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 (142) hide show
  1. package/README.md +1 -1
  2. package/dist/chrome/viewport/Viewport/hooks/usePageLoadIndicator.d.ts +2 -2
  3. package/dist/chrome/viewport/design-system/hooks/useDesignSystem.d.ts +2 -2
  4. package/dist/chrome/viewport/design-system/hooks/usePaletteState.d.ts +2 -2
  5. package/dist/chunks/ActionEditorPanel-9v50QUwu.js +89 -0
  6. package/dist/chunks/ActionInput-CTt7sOs6.js +929 -0
  7. package/dist/chunks/ActionsAddPicker-BeTPUUor.js +51 -0
  8. package/dist/chunks/ActionsInput-D0h-zLYj.js +174 -0
  9. package/dist/chunks/AnchoredPopover-CckPTxXu.js +2676 -0
  10. package/dist/chunks/AnimationEditorPanel-CXNmsTqV.js +26 -0
  11. package/dist/chunks/AnimationsInput-Djyz0uXG.js +292 -0
  12. package/dist/chunks/AnimationsInputPopover-B2-oNebx.js +71 -0
  13. package/dist/chunks/AnimationsPanel-DungA9qb.js +25 -0
  14. package/dist/chunks/Audio.render-CsR69fZ9.js +22 -0
  15. package/dist/chunks/AudioMainTab-BljM2NMQ.js +70 -0
  16. package/dist/chunks/BackdropEditorPanel-CA2k-6SR.js +26 -0
  17. package/dist/chunks/BackgroundImageInputPopover-vB_217Ig.js +94 -0
  18. package/dist/chunks/BackgroundImagePanel-BvMhF9eU.js +100 -0
  19. package/dist/chunks/BackgroundMainTab-CI4c5DEF.js +10 -0
  20. package/dist/chunks/BundleRowPanel-BcYfyfGQ.js +33 -0
  21. package/dist/chunks/ButtonMainTab-Civy_DoA.js +43 -0
  22. package/dist/chunks/CSSEditorInput-C1ITwAh3.js +73 -0
  23. package/dist/chunks/ClassNameInput-Ce0fGQES.js +720 -0
  24. package/dist/chunks/CodeEditor-axBXmPH8.js +33370 -0
  25. package/dist/chunks/ColorInput-BSfMNt86.js +187 -0
  26. package/dist/chunks/ColorPanel-DOLrT-gS.js +562 -0
  27. package/dist/chunks/ComponentImportExportPanel-DVcnGhGx.js +161 -0
  28. package/dist/chunks/ComponentImportExportPopover-BY1_oxU8.js +26 -0
  29. package/dist/chunks/ConditionEditorPanel-DLbqYaSF.js +43 -0
  30. package/dist/chunks/ConditionsAddPicker-SsHJlc1E.js +54 -0
  31. package/dist/chunks/ConditionsInput-B_5Nge8o.js +474 -0
  32. package/dist/chunks/ContainerMainTab-kkktm1Ns.js +1107 -0
  33. package/dist/chunks/ContainerOverflowSectionPanel-ibKXf-1N.js +120 -0
  34. package/dist/chunks/ContainerOverflowSectionPopover-CRQ9EPsn.js +24 -0
  35. package/dist/chunks/ContainerPaddingOverlay-Cd3xOv-S.js +340 -0
  36. package/dist/chunks/ContainerScrollEffectSection-Dbztqdnr.js +123 -0
  37. package/dist/chunks/ContainerStateSection-DY_gjBJL.js +478 -0
  38. package/dist/chunks/ConversionFields-Bpfl-SGP.js +135 -0
  39. package/dist/chunks/CraftListEditor-_TIy1ogW.js +73 -0
  40. package/dist/chunks/CreateTokenDialog-DNWtWqJd.js +147 -0
  41. package/dist/chunks/Data.render-DTmaqSyz.js +10 -0
  42. package/dist/chunks/DataAttributesPanel-mYhisO_O.js +125 -0
  43. package/dist/chunks/DataMainTab-Batm515E.js +23 -0
  44. package/dist/chunks/DataSourceSectionSlot-BKoO6Vxn.js +10 -0
  45. package/dist/chunks/EditorEmptyLeafHintView-D3E3UN_0.js +78 -0
  46. package/dist/chunks/EffectRowInputPopover-CYhfjFwJ.js +323 -0
  47. package/dist/chunks/EffectsClassInput-Yujuchwy.js +315 -0
  48. package/dist/chunks/Embed.render-BgKpUV8n.js +17 -0
  49. package/dist/chunks/EmbedMainTab-d_-Bnkug.js +225 -0
  50. package/dist/chunks/FilterEditorPanel-CRa0IpLr.js +26 -0
  51. package/dist/chunks/FlexDirectionInput-C5gYjk5W.js +78 -0
  52. package/dist/chunks/FloatingPanel-DJP5Vhua.js +553 -0
  53. package/dist/chunks/FontFamilyInput-CVNnVylt.js +111 -0
  54. package/dist/chunks/Form.render-6GjcmL2u.js +54 -0
  55. package/dist/chunks/FormElement.render-DWrG-2ID.js +36 -0
  56. package/dist/chunks/FormElementMainTab-DSbF3F6e.js +470 -0
  57. package/dist/chunks/FormMainTab-SHny1HxF.js +240 -0
  58. package/dist/chunks/GradientInputPopover-1K6O9jBq.js +103 -0
  59. package/dist/chunks/GradientPanel-DSRQKkaB.js +194 -0
  60. package/dist/chunks/HTMLCodeInput-CCe4Bj5z.js +69 -0
  61. package/dist/chunks/HandlerEditorPanel-DiOXobsl.js +93 -0
  62. package/dist/chunks/HandlersAddPicker-DWTgjKgo.js +101 -0
  63. package/dist/chunks/HandlersInput-p49STTn8.js +132 -0
  64. package/dist/chunks/IconDialogInput-C-81_L2n.js +105 -0
  65. package/dist/chunks/IconInput-D2Gy7Hvf.js +182 -0
  66. package/dist/chunks/IconMainTab-CNrVjDWP.js +26 -0
  67. package/dist/chunks/IconPickerPanel-BjNOlCh6.js +670 -0
  68. package/dist/chunks/ImageMainTab-C4O7RjX0.js +66 -0
  69. package/dist/chunks/ImageSettingsPanel-dvOmGg3C.js +485 -0
  70. package/dist/chunks/LayoutPresetPanel-CNAVAcvw.js +81 -0
  71. package/dist/chunks/LayoutPresetSlot-BqMTdE33.js +16 -0
  72. package/dist/chunks/LinkMainTab-BfFZx0AU.js +13 -0
  73. package/dist/chunks/ListEditor-mD-CmRNE.js +178 -0
  74. package/dist/chunks/Map.render-DFkmncHz.js +82 -0
  75. package/dist/chunks/MapLeaflet-DOfmZ3Pk.js +6588 -0
  76. package/dist/chunks/MapMainTab-CxI7IS1_.js +165 -0
  77. package/dist/chunks/MapPoint.render-0OAfCZTp.js +16 -0
  78. package/dist/chunks/MapPointMainTab-CmLcaSR5.js +60 -0
  79. package/dist/chunks/MediaInput-DHs3D8TJ.js +672 -0
  80. package/dist/chunks/MediaManagerModal-Dc5PK3dn.js +240 -0
  81. package/dist/chunks/MiniPreviewTile-B4zxTj9Y.js +32 -0
  82. package/dist/chunks/ModifierChipList-CwsWklih.js +33 -0
  83. package/dist/chunks/ModifiersAddPicker-D-vSYw7O.js +74 -0
  84. package/dist/chunks/ModifiersPickerPanel-CTefidBx.js +243 -0
  85. package/dist/chunks/NodeAiContextInputPopover-D5bn5o_T.js +66 -0
  86. package/dist/chunks/NodeAiContextPanel-Bx4rcjiM.js +81 -0
  87. package/dist/chunks/NumberSettingsPanel-DASi_l6V.js +56 -0
  88. package/dist/chunks/PageSettingsModal-D6o450IR.js +2678 -0
  89. package/dist/chunks/PatternInputPopover-qMWBv_nl.js +100 -0
  90. package/dist/chunks/PatternPanel-D2fgWDd-.js +352 -0
  91. package/dist/chunks/PeekTargetButton-ClrJX7zh.js +26 -0
  92. package/dist/chunks/PermissionsSection-DwobrV40.js +82 -0
  93. package/dist/chunks/PresetAddChildList-D6a0xdt8.js +35 -0
  94. package/dist/chunks/PropertiesInput-9O39ngbb.js +125 -0
  95. package/dist/chunks/PropertiesPanel-DO0RlalO.js +76 -0
  96. package/dist/chunks/SaveModifierPanel-B6mjKyrT.js +130 -0
  97. package/dist/chunks/ScrollEffectEditorPanel-CllGUhui.js +26 -0
  98. package/dist/chunks/SearchInput-DRUztbM0.js +76 -0
  99. package/dist/chunks/SearchableMenuPopover-DZKVXiEl.js +1251 -0
  100. package/dist/chunks/SlotRenderer-CaLf_2_C.js +38 -0
  101. package/dist/chunks/StateBindingEditorPanel-DKdcG5py.js +101 -0
  102. package/dist/chunks/StateBindingsAddPicker-DxMNAWAD.js +91 -0
  103. package/dist/chunks/StateBindingsInput-iWiqvAVB.js +103 -0
  104. package/dist/chunks/TailwindInput-660FZtyK.js +24 -0
  105. package/dist/chunks/TextEditor-B2O7DlN8.js +22032 -0
  106. package/dist/chunks/TextMainTab-B5udsXsk.js +260 -0
  107. package/dist/chunks/TextStyleEditorPanel-GRNPGzUL.js +381 -0
  108. package/dist/chunks/TextStylePickerPanel-l108SmGQ.js +140 -0
  109. package/dist/chunks/TextareaSettingsPanel-C1rQuF1O.js +50 -0
  110. package/dist/chunks/TokenPicker-Q0LToF_p.js +291 -0
  111. package/dist/chunks/ToolbarDashedButton-DbUxGmDg.js +23 -0
  112. package/dist/chunks/TransformEditorPanel-BGwyznZ6.js +26 -0
  113. package/dist/chunks/TransitionEditorPanel-BSvk58Ow.js +26 -0
  114. package/dist/chunks/TypographyPresetInput-DqnGSgR2.js +296 -0
  115. package/dist/chunks/ValidationPanel-CmA9SfoF.js +56 -0
  116. package/dist/chunks/Video.render-Dg6xvis4.js +21 -0
  117. package/dist/chunks/VideoMainTab-v5UFhUm-.js +174 -0
  118. package/dist/chunks/YouTube.esm-EbHnLU1Z.js +744 -0
  119. package/dist/chunks/dialogAtoms-CeQ2G05l.js +59 -0
  120. package/dist/chunks/extends-hS2Bh-Yp.js +12 -0
  121. package/dist/chunks/formatStorage-C3o2s3dk.js +22 -0
  122. package/dist/chunks/googleFonts-Dj4AntNi.js +323 -0
  123. package/dist/chunks/helpers-Cll72tMn.js +18 -0
  124. package/dist/chunks/index-B-GJd039.js +2875 -0
  125. package/dist/chunks/index-C66dAl3Q.js +32177 -0
  126. package/dist/chunks/index.esm-mqFx3NOs.js +644 -0
  127. package/dist/chunks/popoverOpenRequestAtom-hBS_siXv.js +22 -0
  128. package/dist/chunks/propertyRegistry-CMhVNOgl.js +38 -0
  129. package/dist/chunks/resolveAnchorsViaCraft-Cixm6ZyJ.js +31 -0
  130. package/dist/chunks/toolboxUtils-DjTMslSn.js +370 -0
  131. package/dist/chunks/uiPrimitives-BtohldWg.js +15 -0
  132. package/dist/chunks/use-event-listener-DO3Sk7g0.js +15 -0
  133. package/dist/chunks/useElementPicker-DoNuXNMQ.js +41 -0
  134. package/dist/chunks/useLayoutPreset-wOMV5YnO.js +528 -0
  135. package/dist/chunks/useMediaManager-CmKDbFfw.js +4629 -0
  136. package/dist/chunks/usePopoverAutoOpen-CxIjt0ez.js +25 -0
  137. package/dist/chunks/usePopoverPosition-83Vti7Aw.js +15 -0
  138. package/dist/render/static/index.js +9 -0
  139. package/dist/theme.css +168 -0
  140. package/package.json +25 -14
  141. package/dist/pagehub-viewer.umd.cjs +0 -574
  142. package/dist/pagehub.umd.cjs +0 -1130
@@ -0,0 +1,2875 @@
1
+ import { jsxs as O, Fragment as Qe, jsx as t } from "react/jsx-runtime";
2
+ import yt, { useState as z, useMemo as X, useRef as ee, useCallback as ie, useEffect as oe, useLayoutEffect as et } from "react";
3
+ import { r as wt, a1 as Nt, b as kt, a2 as St, a3 as ue, a4 as Ct, P as ze, a5 as Tt, G as tt, W as at, C as rt, a6 as Lt, a7 as nt, a8 as st, f as De, a9 as He, aa as Ot, D as Pt, ab as Ue, ac as Ve, ad as At, ae as Mt, af as Et, ag as Be, ah as It, ai as zt, aj as Ht, ak as Dt, al as Ft, am as _t, an as $t, l as Rt, ao as Gt, ap as Wt, aq as Ut, ar as Vt, as as Bt, at as lt, au as Yt, av as Xt, aw as qt, ax as jt, o as ce, ay as it, az as Zt, aA as Kt, aB as Jt, u as Oe, V as Qt, E as ea, M as ta, g as aa, aC as ra, J as na, c as Ye } from "./index-C66dAl3Q.js";
4
+ import { F as ot, u as ct } from "./FloatingPanel-DJP5Vhua.js";
5
+ import ut from "react-dom";
6
+ import { u as dt, A as Xe, a as sa, S as la } from "./AnchoredPopover-CckPTxXu.js";
7
+ import { useEditor as Fe, useNode as ia } from "@craftjs/core";
8
+ import { ROOT_NODE as Se } from "@craftjs/utils";
9
+ const ye = {
10
+ // ── Typography (sourced from theme.typography[] Heading/Body via orchestrator) ──
11
+ headingFontFamily: { label: "Heading Font Family", category: "typography", type: "text" },
12
+ bodyFontFamily: { label: "Body Font Family", category: "typography", type: "text" },
13
+ headingFontWeight: { label: "Heading Font Weight", category: "typography", type: "text" },
14
+ bodyFontWeight: { label: "Body Font Weight", category: "typography", type: "text" },
15
+ // ── Spacing & Layout ──
16
+ contentWidth: {
17
+ label: "Content Width",
18
+ category: "spacing",
19
+ type: "dimension",
20
+ quickPicks: [
21
+ { value: "48rem", label: "Narrow" },
22
+ { value: "64rem", label: "XL" },
23
+ { value: "80rem", label: "2XL" },
24
+ { value: "96rem", label: "3XL" },
25
+ { value: "120rem", label: "4XL" },
26
+ { value: "100%", label: "Full" }
27
+ ]
28
+ },
29
+ containerPadding: {
30
+ label: "Page Gutter",
31
+ category: "spacing",
32
+ type: "text",
33
+ quickPicks: [
34
+ { value: "0.5rem 0.5rem", label: "Tight" },
35
+ { value: "1rem 1rem", label: "Small" },
36
+ { value: "1.5rem 1.5rem", label: "Medium" },
37
+ { value: "2rem 2rem", label: "Large" },
38
+ { value: "3rem 3rem", label: "XL" }
39
+ ]
40
+ },
41
+ sectionGap: {
42
+ label: "Section Gap",
43
+ category: "spacing",
44
+ type: "dimension",
45
+ quickPicks: [
46
+ { value: "0", label: "None" },
47
+ { value: "2rem", label: "Small" },
48
+ { value: "3rem", label: "Medium" },
49
+ { value: "4rem", label: "Large" },
50
+ { value: "6rem", label: "XL" },
51
+ { value: "8rem", label: "2XL" }
52
+ ]
53
+ },
54
+ containerGap: {
55
+ label: "Container Gap",
56
+ category: "spacing",
57
+ type: "dimension",
58
+ quickPicks: [
59
+ { value: "0.5rem", label: "Tight" },
60
+ { value: "1rem", label: "Small" },
61
+ { value: "1.5rem", label: "Medium" },
62
+ { value: "2rem", label: "Large" }
63
+ ]
64
+ },
65
+ buttonPadding: {
66
+ label: "Button Padding",
67
+ category: "spacing",
68
+ type: "text",
69
+ quickPicks: [
70
+ { value: "1rem 0.5rem", label: "Small" },
71
+ { value: "1.25rem 0.625rem", label: "Medium" },
72
+ { value: "1.5rem 0.75rem", label: "Large" },
73
+ { value: "2rem 1rem", label: "XL" }
74
+ ]
75
+ },
76
+ // ── Spatial Scale (clamp() values — text editor) ──
77
+ spaceXs: {
78
+ label: "Space XS",
79
+ category: "spacing",
80
+ type: "text",
81
+ quickPicks: [
82
+ { value: "clamp(0.25rem, 0.125rem + 0.4vw, 0.375rem)", label: "Tight" },
83
+ { value: "clamp(0.375rem, 0.25rem + 0.39vw, 0.5rem)", label: "Default" },
84
+ { value: "clamp(0.5rem, 0.375rem + 0.4vw, 0.625rem)", label: "Loose" }
85
+ ]
86
+ },
87
+ spaceSm: {
88
+ label: "Space SM",
89
+ category: "spacing",
90
+ type: "text",
91
+ quickPicks: [
92
+ { value: "clamp(0.5rem, 0.25rem + 0.75vw, 0.75rem)", label: "Tight" },
93
+ { value: "clamp(0.75rem, 0.5rem + 0.75vw, 1rem)", label: "Default" },
94
+ { value: "clamp(1rem, 0.75rem + 0.75vw, 1.25rem)", label: "Loose" }
95
+ ]
96
+ },
97
+ spaceMd: {
98
+ label: "Space MD",
99
+ category: "spacing",
100
+ type: "text",
101
+ quickPicks: [
102
+ { value: "clamp(1rem, 0.5rem + 1.5vw, 1.5rem)", label: "Tight" },
103
+ { value: "clamp(1.5rem, 1rem + 1.5vw, 2rem)", label: "Default" },
104
+ { value: "clamp(2rem, 1.5rem + 1.5vw, 2.5rem)", label: "Loose" }
105
+ ]
106
+ },
107
+ spaceLg: {
108
+ label: "Space LG",
109
+ category: "spacing",
110
+ type: "text",
111
+ quickPicks: [
112
+ { value: "clamp(2rem, 1rem + 3vw, 3rem)", label: "Tight" },
113
+ { value: "clamp(2.5rem, 1.25rem + 3.75vw, 4rem)", label: "Default" },
114
+ { value: "clamp(3rem, 1.5rem + 4.5vw, 5rem)", label: "Loose" }
115
+ ]
116
+ },
117
+ spaceXl: {
118
+ label: "Space XL",
119
+ category: "spacing",
120
+ type: "text",
121
+ quickPicks: [
122
+ { value: "clamp(2.5rem, 1.25rem + 3.75vw, 4rem)", label: "Tight" },
123
+ { value: "clamp(3.5rem, 1.75rem + 5.25vw, 6rem)", label: "Default" },
124
+ { value: "clamp(4.5rem, 2.25rem + 6.75vw, 8rem)", label: "Loose" }
125
+ ]
126
+ },
127
+ // ── Effects & Borders ──
128
+ radiusBox: {
129
+ label: "Radius Box",
130
+ category: "other",
131
+ type: "dimension",
132
+ quickPicks: [
133
+ { value: "0", label: "Square" },
134
+ { value: "0.25rem", label: "Small" },
135
+ { value: "0.5rem", label: "Default" },
136
+ { value: "0.75rem", label: "Medium" },
137
+ { value: "1rem", label: "Large" },
138
+ { value: "1.5rem", label: "XL" },
139
+ { value: "2rem", label: "2XL" },
140
+ { value: "9999px", label: "Full" }
141
+ ]
142
+ },
143
+ radiusField: {
144
+ label: "Radius Field",
145
+ category: "other",
146
+ type: "dimension",
147
+ quickPicks: [
148
+ { value: "0", label: "Square" },
149
+ { value: "0.25rem", label: "Small" },
150
+ { value: "0.375rem", label: "Default" },
151
+ { value: "0.5rem", label: "Medium" },
152
+ { value: "0.75rem", label: "Large" },
153
+ { value: "1rem", label: "XL" },
154
+ { value: "9999px", label: "Full" }
155
+ ]
156
+ },
157
+ radiusSelector: {
158
+ label: "Radius Selector",
159
+ category: "other",
160
+ type: "dimension",
161
+ quickPicks: [
162
+ { value: "0", label: "Square" },
163
+ { value: "0.25rem", label: "Small" },
164
+ { value: "0.5rem", label: "Default" },
165
+ { value: "0.75rem", label: "Medium" },
166
+ { value: "1rem", label: "Large" },
167
+ { value: "1.5rem", label: "XL" },
168
+ { value: "9999px", label: "Full" }
169
+ ]
170
+ },
171
+ border: {
172
+ label: "Border Width",
173
+ category: "other",
174
+ type: "dimension",
175
+ quickPicks: [
176
+ { value: "0", label: "None" },
177
+ { value: "1px", label: "Default" },
178
+ { value: "2px", label: "Medium" },
179
+ { value: "4px", label: "Thick" }
180
+ ]
181
+ },
182
+ shadowStyle: {
183
+ label: "Shadow Style",
184
+ category: "other",
185
+ type: "text",
186
+ quickPicks: [
187
+ { value: "none", label: "None" },
188
+ { value: "0 1px 2px 0 rgb(0 0 0 / 0.05)", label: "Small" },
189
+ { value: "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)", label: "Default" },
190
+ {
191
+ value: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
192
+ label: "Medium"
193
+ },
194
+ {
195
+ value: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
196
+ label: "Large"
197
+ },
198
+ {
199
+ value: "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)",
200
+ label: "XL"
201
+ },
202
+ { value: "0 25px 50px -12px rgb(0 0 0 / 0.25)", label: "2XL" }
203
+ ]
204
+ },
205
+ depth: {
206
+ label: "Depth",
207
+ category: "other",
208
+ type: "number",
209
+ quickPicks: [
210
+ { value: "0", label: "Flat" },
211
+ { value: "1", label: "Raised" },
212
+ { value: "2", label: "Elevated" }
213
+ ]
214
+ },
215
+ noise: {
216
+ label: "Noise Texture",
217
+ category: "other",
218
+ type: "number",
219
+ quickPicks: [
220
+ { value: "0", label: "Off" },
221
+ { value: "1", label: "On" }
222
+ ]
223
+ },
224
+ // ── Sizing ──
225
+ sizeField: {
226
+ label: "Field Size",
227
+ category: "other",
228
+ type: "dimension",
229
+ quickPicks: [
230
+ { value: "0.2rem", label: "Small" },
231
+ { value: "0.25rem", label: "Default" },
232
+ { value: "0.3rem", label: "Medium" },
233
+ { value: "0.35rem", label: "Large" }
234
+ ]
235
+ },
236
+ sizeSelector: {
237
+ label: "Selector Size",
238
+ category: "other",
239
+ type: "dimension",
240
+ quickPicks: [
241
+ { value: "0.2rem", label: "Small" },
242
+ { value: "0.25rem", label: "Default" },
243
+ { value: "0.3rem", label: "Medium" },
244
+ { value: "0.35rem", label: "Large" }
245
+ ]
246
+ },
247
+ // ── Form Inputs ──
248
+ inputPadding: {
249
+ label: "Input Padding",
250
+ category: "spacing",
251
+ type: "text",
252
+ quickPicks: [
253
+ { value: "0.5rem 0.25rem", label: "Small" },
254
+ { value: "0.75rem 0.5rem", label: "Medium" },
255
+ { value: "1rem 0.5rem", label: "Large" },
256
+ { value: "1rem 0.75rem", label: "XL" }
257
+ ]
258
+ },
259
+ inputBorderColor: { label: "Input Border", category: "colors", type: "color" },
260
+ inputBgColor: { label: "Input Background", category: "colors", type: "color" },
261
+ inputTextColor: { label: "Input Text", category: "colors", type: "color" },
262
+ inputPlaceholderColor: { label: "Input Placeholder", category: "colors", type: "color" },
263
+ inputFocusRing: {
264
+ label: "Input Focus Ring",
265
+ category: "other",
266
+ type: "dimension",
267
+ quickPicks: [
268
+ { value: "0", label: "None" },
269
+ { value: "1px", label: "1px" },
270
+ { value: "2px", label: "2px" },
271
+ { value: "3px", label: "3px" },
272
+ { value: "4px", label: "4px" }
273
+ ]
274
+ },
275
+ inputFocusRingColor: { label: "Input Focus Ring Color", category: "colors", type: "color" },
276
+ // ── Links ──
277
+ linkColor: { label: "Link Color", category: "colors", type: "color" },
278
+ linkHoverColor: { label: "Link Hover Color", category: "colors", type: "color" },
279
+ linkUnderline: {
280
+ label: "Link Underline",
281
+ category: "other",
282
+ type: "text",
283
+ quickPicks: [
284
+ { value: "no-underline", label: "None" },
285
+ { value: "underline", label: "Always" },
286
+ { value: "hover:underline", label: "On Hover" }
287
+ ]
288
+ },
289
+ linkUnderlineOffset: {
290
+ label: "Underline Offset",
291
+ category: "other",
292
+ type: "text",
293
+ quickPicks: [
294
+ { value: "underline-offset-auto", label: "Auto" },
295
+ { value: "underline-offset-1", label: "1px" },
296
+ { value: "underline-offset-2", label: "2px" },
297
+ { value: "underline-offset-4", label: "4px" },
298
+ { value: "underline-offset-8", label: "8px" }
299
+ ]
300
+ }
301
+ }, oa = /* @__PURE__ */ new Set(["spacingDensity"]);
302
+ function mt(e) {
303
+ if (!e) return "text";
304
+ const a = e.trim();
305
+ return /^(#|oklch\(|rgba?\(|hsla?\(|hsl\()/i.test(a) ? "color" : /^-?\d+(\.\d+)?$/.test(a) ? "number" : /^-?\d+(\.\d+)?(px|rem|em|%|vh|vw|vmin|vmax)$/.test(a) ? "dimension" : "text";
306
+ }
307
+ function ca(e) {
308
+ switch (e) {
309
+ case "color":
310
+ return "colors";
311
+ case "dimension":
312
+ return "spacing";
313
+ case "number":
314
+ case "text":
315
+ return "other";
316
+ }
317
+ }
318
+ function qe(e) {
319
+ return `--${e.replace(/([A-Z])/g, "-$1").replace(/\s+/g, "-").toLowerCase().replace(/^-/, "")}`;
320
+ }
321
+ const je = {
322
+ 100: "font-thin",
323
+ 200: "font-extralight",
324
+ 300: "font-light",
325
+ 400: "font-normal",
326
+ 500: "font-medium",
327
+ 600: "font-semibold",
328
+ 700: "font-bold",
329
+ 800: "font-extrabold",
330
+ 900: "font-black"
331
+ };
332
+ function Ze(e) {
333
+ return e.replace(/([A-Z])/g, "-$1").replace(/\s+/g, "-").toLowerCase().replace(/^-/, "");
334
+ }
335
+ function _e() {
336
+ const e = Fe((a) => {
337
+ var c;
338
+ const s = a.nodes[Se], l = wt(((c = s == null ? void 0 : s.data) == null ? void 0 : c.props) || {}), i = l.palette, d = l.typography || [], u = l.styleGuide, o = l.styleGuideMeta || {}, n = [];
339
+ (i.length > 0 ? i : Nt).forEach((r) => {
340
+ if (r != null && r.name && (r != null && r.color)) {
341
+ const b = Ze(r.name);
342
+ n.push({
343
+ name: r.name,
344
+ varName: `--${b}`,
345
+ value: kt(r.color, "").backgroundColor || r.color,
346
+ category: "palette",
347
+ label: `${r.name} (Palette)`,
348
+ key: r.name,
349
+ source: "palette"
350
+ });
351
+ }
352
+ }), d.forEach((r) => {
353
+ if (!(r != null && r.name)) return;
354
+ const b = Ze(r.name);
355
+ n.push({
356
+ name: `${r.name} Font Family`,
357
+ varName: `--${b}-font-family`,
358
+ value: r.fontFamily || "Inter",
359
+ category: "typography",
360
+ label: `${r.name} Font Family`,
361
+ key: r.name,
362
+ source: "typography"
363
+ }), n.push({
364
+ name: `${r.name} Font Size`,
365
+ varName: `--${b}-font-size`,
366
+ value: r.fontSize || "1rem",
367
+ category: "typography",
368
+ label: `${r.name} Font Size`,
369
+ key: r.name,
370
+ source: "typography"
371
+ });
372
+ let h = r.fontWeight || "font-normal";
373
+ je[h] && (h = je[h]), n.push({
374
+ name: `${r.name} Font Weight`,
375
+ varName: `--${b}-font-weight`,
376
+ value: h,
377
+ category: "typography",
378
+ label: `${r.name} Font Weight`,
379
+ key: r.name,
380
+ source: "typography"
381
+ }), n.push({
382
+ name: `${r.name} Line Height`,
383
+ varName: `--${b}-line-height`,
384
+ value: r.lineHeight || "1.5",
385
+ category: "typography",
386
+ label: `${r.name} Line Height`,
387
+ key: r.name,
388
+ source: "typography"
389
+ }), n.push({
390
+ name: `${r.name} Letter Spacing`,
391
+ varName: `--${b}-letter-spacing`,
392
+ value: r.letterSpacing || "normal",
393
+ category: "typography",
394
+ label: `${r.name} Letter Spacing`,
395
+ key: r.name,
396
+ source: "typography"
397
+ }), n.push({
398
+ name: `${r.name} Text Transform`,
399
+ varName: `--${b}-text-transform`,
400
+ value: r.textTransform || "none",
401
+ category: "typography",
402
+ label: `${r.name} Text Transform`,
403
+ key: r.name,
404
+ source: "typography"
405
+ });
406
+ });
407
+ const p = { ...St, ...u };
408
+ return Object.entries(p).forEach(([r, b]) => {
409
+ var P;
410
+ if (b == null || b === "" || oa.has(r)) return;
411
+ const h = ye[r], S = o[r];
412
+ if (!h || (S == null || S.custom), h)
413
+ n.push({
414
+ name: r,
415
+ varName: qe(r),
416
+ value: String(b),
417
+ category: h.category,
418
+ label: h.label,
419
+ custom: (S == null ? void 0 : S.custom) === !0,
420
+ key: r,
421
+ source: "styleGuide"
422
+ });
423
+ else {
424
+ const I = mt(String(b)), L = ((P = S == null ? void 0 : S.appliesTo) == null ? void 0 : P[0]) ?? ca(I), H = r.replace(/([A-Z])/g, " $1").replace(/^./, (W) => W.toUpperCase()).trim();
425
+ n.push({
426
+ name: r,
427
+ varName: qe(r),
428
+ value: String(b),
429
+ category: L,
430
+ label: `${H} (Custom)`,
431
+ custom: !0,
432
+ key: r,
433
+ source: "styleGuide"
434
+ });
435
+ }
436
+ }), n;
437
+ });
438
+ return Array.isArray(e) ? e : e && typeof e == "object" ? Object.keys(e).filter((a) => !isNaN(Number(a))).map((a) => e[a]).filter((a) => a && typeof a == "object" && "varName" in a) : [];
439
+ }
440
+ function ua({
441
+ designVars: e,
442
+ relevantCategories: a,
443
+ tailwindKey: s,
444
+ currentValue: l,
445
+ onSelect: i,
446
+ onEdit: d,
447
+ onCreate: u
448
+ }) {
449
+ const [o, n] = z(""), g = X(() => e.filter((c) => {
450
+ if (a && !a.includes(c.category)) return !1;
451
+ if (!o) return !0;
452
+ const r = o.toLowerCase();
453
+ return c.label.toLowerCase().includes(r) || c.varName.toLowerCase().includes(r) || c.name.toLowerCase().includes(r);
454
+ }), [e, a, o]), p = (c) => s === "fontFamily" ? `font-(${c.varName})` : `var(${c.varName})`;
455
+ return /* @__PURE__ */ O(Qe, { children: [
456
+ /* @__PURE__ */ t(
457
+ "div",
458
+ {
459
+ role: "presentation",
460
+ className: "border-base-300 bg-base-200 shrink-0 border-b p-2",
461
+ onMouseDown: (c) => c.stopPropagation(),
462
+ children: /* @__PURE__ */ t(
463
+ "input",
464
+ {
465
+ type: "text",
466
+ value: o,
467
+ onChange: (c) => n(c.target.value),
468
+ placeholder: "Search variables…",
469
+ className: "input-plain w-full cursor-text py-0 text-xs",
470
+ autoFocus: !0,
471
+ ...ue
472
+ }
473
+ )
474
+ }
475
+ ),
476
+ /* @__PURE__ */ t(Ct, { className: "ph-select-item-host min-h-0 flex-1", children: g.length === 0 ? /* @__PURE__ */ t("div", { className: "text-neutral-content px-3 py-6 text-center text-xs", children: "No variables found" }) : g.map((c) => {
477
+ const r = p(c), b = l === r, h = c.source === "styleGuide";
478
+ return /* @__PURE__ */ O(
479
+ "div",
480
+ {
481
+ className: `group ph-select-item gap-2 text-xs ${b ? "bg-primary text-primary-content font-semibold" : ""}`,
482
+ children: [
483
+ /* @__PURE__ */ O(
484
+ "button",
485
+ {
486
+ type: "button",
487
+ onClick: () => i(r),
488
+ className: "flex min-w-0 flex-1 items-center gap-2 text-left",
489
+ children: [
490
+ /* @__PURE__ */ t(
491
+ "div",
492
+ {
493
+ className: "border-base-300 size-3 shrink-0 rounded border",
494
+ style: {
495
+ backgroundColor: c.category === "palette" ? c.value : "transparent"
496
+ }
497
+ }
498
+ ),
499
+ /* @__PURE__ */ t("span", { className: "flex-1 truncate font-medium", children: c.label })
500
+ ]
501
+ }
502
+ ),
503
+ /* @__PURE__ */ t(
504
+ "span",
505
+ {
506
+ className: `text-neutral-content shrink-0 ${h ? "group-hover:hidden" : ""}`,
507
+ children: c.varName
508
+ }
509
+ ),
510
+ h && /* @__PURE__ */ t(
511
+ "button",
512
+ {
513
+ type: "button",
514
+ onClick: () => d(c),
515
+ "data-tooltip-id": ze,
516
+ "data-tooltip-content": "Edit token",
517
+ className: "text-neutral-content hover:text-base-content hidden size-5 shrink-0 items-center justify-center rounded transition-colors group-hover:flex",
518
+ "aria-label": `Edit ${c.label}`,
519
+ children: /* @__PURE__ */ t(Tt, { className: "size-3.5", "aria-hidden": !0 })
520
+ }
521
+ )
522
+ ]
523
+ },
524
+ c.varName
525
+ );
526
+ }) }),
527
+ /* @__PURE__ */ t("div", { className: "border-base-300 bg-base-200 shrink-0 border-t p-2", children: /* @__PURE__ */ O(
528
+ "button",
529
+ {
530
+ type: "button",
531
+ onClick: u,
532
+ className: "bg-primary text-primary-content hover:bg-primary/90 flex w-full items-center justify-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors",
533
+ children: [
534
+ /* @__PURE__ */ t(tt, { className: "size-3.5", "aria-hidden": !0 }),
535
+ "New Token"
536
+ ]
537
+ }
538
+ ) })
539
+ ] });
540
+ }
541
+ const da = 320, ma = [
542
+ { id: "calc", label: "calc()", example: "calc(100% - 20px)" },
543
+ { id: "clamp", label: "clamp()", example: "clamp(1rem, 5vw, 3rem)" },
544
+ { id: "min", label: "min()", example: "min(50vw, 500px)" },
545
+ { id: "max", label: "max()", example: "max(50vw, 300px)" },
546
+ { id: "var", label: "var()", example: "var(--primary)" }
547
+ ];
548
+ function pa(e) {
549
+ return e.startsWith("clamp(") ? "clamp" : e.startsWith("min(") ? "min" : e.startsWith("max(") ? "max" : e.startsWith("var(") ? "var" : "calc";
550
+ }
551
+ function Pe(e) {
552
+ const a = e.match(/^(?:clamp|min|max)\((.+)\)$/);
553
+ return a ? a[1].split(",").map((s) => s.trim()) : [];
554
+ }
555
+ function ha(e, a) {
556
+ if (typeof window > "u" || !e) return;
557
+ const s = e.getBoundingClientRect(), l = Math.min(Math.max(8, s.left), Math.max(8, window.innerWidth - a - 8)), i = Math.max(8, s.bottom + 6);
558
+ return { x: l, y: i };
559
+ }
560
+ function fa({ value: e, onSave: a, onClose: s, anchorEl: l }) {
561
+ const [i, d] = z(() => pa(e)), [u, o] = z(e), n = X(() => Pe(e), [e]), g = e.startsWith("clamp(") && n.length === 3, p = (e.startsWith("min(") || e.startsWith("max(")) && n.length === 2, [c, r] = z(
562
+ g || p ? n[0] : ""
563
+ ), [b, h] = z(g ? n[1] : ""), [S, P] = z(
564
+ g ? n[2] : p ? n[1] : ""
565
+ ), I = X(
566
+ () => ha(l, da),
567
+ [l]
568
+ ), L = (k, N) => {
569
+ if (d(k), k === "clamp") {
570
+ const x = Pe(u);
571
+ x.length === 3 ? (r(x[0]), h(x[1]), P(x[2])) : !c && !b && !S && (r("1rem"), h("5vw"), P("3rem"));
572
+ } else if (k === "min" || k === "max") {
573
+ const x = Pe(u);
574
+ x.length === 2 ? (r(x[0]), P(x[1])) : !c && !S && (r("50vw"), P(k === "min" ? "500px" : "300px"));
575
+ } else u || o(N);
576
+ }, H = () => i === "clamp" ? `clamp(${c}, ${b}, ${S})` : i === "min" || i === "max" ? `${i}(${c}, ${S})` : u, W = () => a(H()), T = H();
577
+ return /* @__PURE__ */ t(
578
+ ot,
579
+ {
580
+ isOpen: !0,
581
+ onClose: s,
582
+ title: "CSS Function",
583
+ storageKey: "calc-dialog",
584
+ minWidth: 280,
585
+ maxWidth: 520,
586
+ maxHeight: Math.round(typeof window < "u" ? window.innerHeight * 0.8 : 520),
587
+ initialPosition: I,
588
+ zIndex: at,
589
+ scrollable: !0,
590
+ children: /* @__PURE__ */ O("div", { className: "flex flex-col gap-3", children: [
591
+ /* @__PURE__ */ t("div", { className: "bg-neutral flex gap-0.5 rounded-md p-0.5", children: ma.map((k) => /* @__PURE__ */ t(
592
+ "button",
593
+ {
594
+ type: "button",
595
+ onClick: () => L(k.id, k.example),
596
+ className: `flex-1 rounded px-2 py-1 font-mono text-[11px] transition-colors ${i === k.id ? "bg-base-100 text-base-content shadow-sm" : "text-neutral-content hover:text-base-content"}`,
597
+ children: k.label
598
+ },
599
+ k.id
600
+ )) }),
601
+ i === "clamp" ? /* @__PURE__ */ O("div", { className: "flex flex-col gap-1.5", children: [
602
+ /* @__PURE__ */ t(
603
+ ge,
604
+ {
605
+ label: "Min",
606
+ value: c,
607
+ onChange: r,
608
+ placeholder: "1rem",
609
+ autoFocus: !0
610
+ }
611
+ ),
612
+ /* @__PURE__ */ t(
613
+ ge,
614
+ {
615
+ label: "Preferred",
616
+ value: b,
617
+ onChange: h,
618
+ placeholder: "5vw"
619
+ }
620
+ ),
621
+ /* @__PURE__ */ t(ge, { label: "Max", value: S, onChange: P, placeholder: "3rem" })
622
+ ] }) : i === "min" || i === "max" ? /* @__PURE__ */ O("div", { className: "flex flex-col gap-1.5", children: [
623
+ /* @__PURE__ */ t(
624
+ ge,
625
+ {
626
+ label: "Value A",
627
+ value: c,
628
+ onChange: r,
629
+ placeholder: "50vw",
630
+ autoFocus: !0
631
+ }
632
+ ),
633
+ /* @__PURE__ */ t(
634
+ ge,
635
+ {
636
+ label: "Value B",
637
+ value: S,
638
+ onChange: P,
639
+ placeholder: i === "min" ? "500px" : "300px"
640
+ }
641
+ )
642
+ ] }) : /* @__PURE__ */ O("div", { className: "flex flex-col gap-2", children: [
643
+ /* @__PURE__ */ t(
644
+ "textarea",
645
+ {
646
+ value: u,
647
+ onChange: (k) => o(k.target.value),
648
+ placeholder: i === "var" ? "e.g. var(--primary)" : "e.g. calc(100% - 20px)",
649
+ className: "border-base-300 bg-base-200 text-base-content placeholder:text-neutral-content focus:border-primary w-full rounded-md border px-2 py-1.5 font-mono text-xs outline-none focus:ring-0",
650
+ rows: 4,
651
+ autoFocus: !0,
652
+ ...ue
653
+ }
654
+ ),
655
+ /* @__PURE__ */ t("p", { className: "text-neutral-content text-[10px] leading-snug", children: "Examples: calc(100% - 20px), clamp(1rem, 5vw, 3rem), min(50vw, 500px)" })
656
+ ] }),
657
+ /* @__PURE__ */ t("div", { className: "bg-neutral text-neutral-content overflow-x-auto rounded-md px-2 py-1.5 font-mono text-[11px]", children: T || "—" }),
658
+ /* @__PURE__ */ t(
659
+ "button",
660
+ {
661
+ type: "button",
662
+ onClick: W,
663
+ className: "btn btn-primary btn-sm w-full font-semibold",
664
+ children: "Apply"
665
+ }
666
+ )
667
+ ] })
668
+ }
669
+ );
670
+ }
671
+ function ge({
672
+ label: e,
673
+ value: a,
674
+ onChange: s,
675
+ placeholder: l,
676
+ autoFocus: i
677
+ }) {
678
+ return /* @__PURE__ */ t(rt, { label: e, children: /* @__PURE__ */ t(
679
+ "input",
680
+ {
681
+ type: "text",
682
+ value: a,
683
+ onChange: (d) => s(d.target.value),
684
+ placeholder: l,
685
+ autoFocus: i,
686
+ className: "h-full w-full bg-transparent px-1 font-mono text-xs outline-none",
687
+ ...ue
688
+ }
689
+ ) });
690
+ }
691
+ function ba(e) {
692
+ switch (e) {
693
+ case "calc":
694
+ return "Formula (calc)";
695
+ case "var":
696
+ return "Design token / variable";
697
+ case "tailwind":
698
+ return "Tailwind class";
699
+ case "px":
700
+ return "Pixels (px)";
701
+ case "em":
702
+ return "Relative to font size (em)";
703
+ case "rem":
704
+ return "Relative to root font size (rem)";
705
+ case "%":
706
+ return "Percentage (%)";
707
+ case "vh":
708
+ return "Viewport height (vh)";
709
+ case "vw":
710
+ return "Viewport width (vw)";
711
+ case "vmin":
712
+ return "Viewport minimum (vmin)";
713
+ case "vmax":
714
+ return "Viewport maximum (vmax)";
715
+ default:
716
+ return String(e);
717
+ }
718
+ }
719
+ function ga(e) {
720
+ const a = e % 3;
721
+ return a === 0 ? "left" : a === 2 ? "right" : "bottom";
722
+ }
723
+ const pt = yt.forwardRef(
724
+ ({ types: e, selectedType: a, onTypeChange: s, onOpenChange: l }, i) => {
725
+ var W;
726
+ const [d, u] = z(!1), o = ct(), n = o != null ? Math.max(nt, o + 10) : Lt, g = ee(null), p = ee(null), c = ie(() => {
727
+ g.current && (clearTimeout(g.current), g.current = null);
728
+ }, []), r = ie(() => {
729
+ p.current && (clearTimeout(p.current), p.current = null);
730
+ }, []), b = ie(() => {
731
+ r(), c(), g.current = setTimeout(() => {
732
+ u(!0), g.current = null;
733
+ }, 400);
734
+ }, [r, c]), h = ie(() => {
735
+ c(), r(), p.current = setTimeout(() => {
736
+ u(!1), p.current = null;
737
+ }, 280);
738
+ }, [r, c]);
739
+ oe(
740
+ () => () => {
741
+ c(), r();
742
+ },
743
+ [c, r]
744
+ ), oe(() => {
745
+ l == null || l(d);
746
+ }, [d, l]);
747
+ const S = ee(null), P = ie(
748
+ (T) => {
749
+ S.current = T, typeof i == "function" ? i(T) : i && (i.current = T);
750
+ },
751
+ [i]
752
+ ), I = dt({
753
+ open: d,
754
+ placement: "bottom-end",
755
+ mainAxisOffset: 4,
756
+ maxHeightCeiling: 300,
757
+ maxHeightMin: 0,
758
+ dismiss: {
759
+ onDismiss: () => u(!1)
760
+ }
761
+ }), L = ie(
762
+ (T) => {
763
+ P(T), I.refs.setReference(T);
764
+ },
765
+ [P, I.refs]
766
+ );
767
+ et(() => {
768
+ d && I.update();
769
+ }, [d]);
770
+ const H = ((W = e.find((T) => T.id === a)) == null ? void 0 : W.label) || "?";
771
+ return /* @__PURE__ */ O(Qe, { children: [
772
+ /* @__PURE__ */ t(
773
+ "div",
774
+ {
775
+ ref: L,
776
+ className: "relative",
777
+ onMouseEnter: b,
778
+ onMouseLeave: h,
779
+ children: /* @__PURE__ */ t("div", { className: "bg-base-200 flex h-5 items-center gap-0 rounded-md", children: /* @__PURE__ */ t(
780
+ "button",
781
+ {
782
+ onClick: (T) => {
783
+ T.stopPropagation(), u(!d);
784
+ },
785
+ className: "text-neutral-content hover:text-base-content flex min-w-5 items-center justify-center p-0 text-[9px] font-medium",
786
+ ...d ? {} : {
787
+ "data-tooltip-id": ze,
788
+ "data-tooltip-content": "Change type",
789
+ "data-tooltip-place": "bottom"
790
+ },
791
+ children: H
792
+ }
793
+ ) })
794
+ }
795
+ ),
796
+ d && ut.createPortal(
797
+ /* @__PURE__ */ t(
798
+ "div",
799
+ {
800
+ "data-type-selector-dropdown": !0,
801
+ ref: I.refs.setFloating,
802
+ style: {
803
+ ...I.floatingStyles,
804
+ zIndex: n
805
+ },
806
+ className: "pagehub-sdk-root scrollbar-light ph-panel-soft pointer-events-auto grid min-w-32 grid-cols-3 gap-1 overflow-hidden p-0.5",
807
+ onMouseEnter: b,
808
+ onMouseLeave: h,
809
+ children: e.map((T, k) => /* @__PURE__ */ t(
810
+ "button",
811
+ {
812
+ onClick: () => {
813
+ s(T.id), u(!1);
814
+ },
815
+ className: `hover:bg-neutral flex w-full items-center justify-center rounded-md px-3 py-1.5 text-xs ${a === T.id ? "bg-neutral font-semibold" : ""}`,
816
+ "data-tooltip-id": ze,
817
+ "data-tooltip-content": ba(T.id),
818
+ "data-tooltip-place": ga(k),
819
+ children: T.label
820
+ },
821
+ T.id
822
+ ))
823
+ }
824
+ ),
825
+ document.querySelector(".pagehub-sdk-root") || document.body
826
+ )
827
+ ] });
828
+ }
829
+ );
830
+ pt.displayName = "TypeSelector";
831
+ const xa = [
832
+ "w-auto shrink-0 min-w-14",
833
+ "w-auto shrink-0 min-w-14",
834
+ "min-w-0 flex-1"
835
+ ], xe = {
836
+ layout: "left-right",
837
+ columns: {
838
+ count: 3,
839
+ widths: [...xa]
840
+ },
841
+ leftSection: {
842
+ title: "",
843
+ groups: ["named"],
844
+ showHints: !0,
845
+ hintType: "pixel"
846
+ },
847
+ middleSection: {
848
+ title: "",
849
+ groups: ["numeric"],
850
+ showHints: !0,
851
+ hintType: "pixel"
852
+ },
853
+ rightSection: {
854
+ title: "",
855
+ groups: ["fractions"],
856
+ showHints: !0,
857
+ hintType: "percentage"
858
+ }
859
+ }, se = ["w-auto shrink-0 min-w-11", "min-w-0 flex-1"], V = {
860
+ layout: "left-right",
861
+ columns: {
862
+ count: 2,
863
+ widths: [...se]
864
+ },
865
+ leftSection: {
866
+ title: "",
867
+ groups: ["numeric"],
868
+ showHints: !1,
869
+ disableSubgroups: !0
870
+ },
871
+ rightSection: {
872
+ title: "",
873
+ groups: ["named", "fractions", "other"],
874
+ showHints: !1
875
+ }
876
+ }, Ae = {
877
+ layout: "left-right",
878
+ columns: {
879
+ count: 2,
880
+ widths: [...se]
881
+ },
882
+ leftSection: {
883
+ title: "",
884
+ groups: ["numeric"],
885
+ showHints: !1
886
+ },
887
+ rightSection: {
888
+ title: "",
889
+ groups: ["named", "fractions", "other"],
890
+ showHints: !1
891
+ }
892
+ }, pe = {
893
+ layout: "left-right",
894
+ columns: {
895
+ count: 2,
896
+ widths: [...se]
897
+ },
898
+ leftSection: {
899
+ title: "",
900
+ groups: ["named"],
901
+ showHints: !1
902
+ },
903
+ rightSection: {
904
+ title: "",
905
+ groups: ["other"],
906
+ showHints: !1
907
+ }
908
+ }, ve = {
909
+ layout: "left-right",
910
+ columns: {
911
+ count: 2,
912
+ widths: [...se]
913
+ },
914
+ leftSection: {
915
+ title: "",
916
+ groups: ["tokens", "named"],
917
+ showHints: !0,
918
+ hintType: "pixel"
919
+ },
920
+ rightSection: {
921
+ title: "",
922
+ groups: ["numeric"],
923
+ showHints: !0,
924
+ hintType: "pixel"
925
+ }
926
+ }, Me = {
927
+ layout: "stacked",
928
+ stackedOrder: ["named"],
929
+ columns: {
930
+ count: 2,
931
+ widths: ["w-full", "w-0"]
932
+ },
933
+ leftSection: {
934
+ title: "",
935
+ groups: ["named"],
936
+ showHints: !1
937
+ }
938
+ }, Ke = {
939
+ layout: "left-right",
940
+ columns: {
941
+ count: 2,
942
+ widths: [...se]
943
+ },
944
+ leftSection: {
945
+ title: "",
946
+ groups: ["numeric"],
947
+ showHints: !0,
948
+ hintType: "ms",
949
+ disableSubgroups: !0
950
+ },
951
+ rightSection: {
952
+ title: "",
953
+ groups: ["named", "other"],
954
+ showHints: !1
955
+ }
956
+ }, K = {
957
+ layout: "left-right",
958
+ columns: {
959
+ count: 2,
960
+ widths: ["w-full", "w-0"]
961
+ },
962
+ leftSection: {
963
+ title: "",
964
+ groups: ["named", "other"],
965
+ showHints: !1
966
+ }
967
+ }, Ee = {
968
+ layout: "left-right",
969
+ columns: {
970
+ count: 2,
971
+ widths: [...se]
972
+ },
973
+ leftSection: {
974
+ title: "",
975
+ groups: ["named", "other"],
976
+ showHints: !1
977
+ },
978
+ rightSection: {
979
+ title: "",
980
+ groups: ["numeric"],
981
+ showHints: !0,
982
+ hintType: "pixel"
983
+ }
984
+ }, Ne = {
985
+ // ========== SIZING PROPERTIES (with fractions) ==========
986
+ width: xe,
987
+ height: xe,
988
+ maxWidth: xe,
989
+ minHeight: xe,
990
+ size: xe,
991
+ // ========== SPACING PROPERTIES (no fractions) ==========
992
+ margin: ve,
993
+ padding: ve,
994
+ gap: ve,
995
+ gapX: ve,
996
+ gapY: ve,
997
+ ringWidth: Ee,
998
+ ringOffsetWidth: Ee,
999
+ outlineWidth: Ee,
1000
+ // ========== BORDER & SHADOW PROPERTIES ==========
1001
+ radius: {
1002
+ layout: "left-right",
1003
+ columns: {
1004
+ count: 2,
1005
+ widths: [...se]
1006
+ },
1007
+ leftSection: {
1008
+ title: "",
1009
+ groups: ["named"],
1010
+ showHints: !1
1011
+ },
1012
+ rightSection: {
1013
+ title: "",
1014
+ // sm/md/lg/xl/2xl/3xl land in "other" (not the numeric bucket); include both columns
1015
+ groups: ["numeric", "other"],
1016
+ showHints: !1
1017
+ }
1018
+ },
1019
+ border: {
1020
+ layout: "left-right",
1021
+ columns: {
1022
+ count: 2,
1023
+ widths: [...se]
1024
+ },
1025
+ leftSection: {
1026
+ title: "",
1027
+ groups: ["named"],
1028
+ showHints: !1
1029
+ },
1030
+ rightSection: {
1031
+ title: "",
1032
+ groups: ["numeric"],
1033
+ showHints: !0,
1034
+ hintType: "pixel"
1035
+ }
1036
+ },
1037
+ shadow: {
1038
+ layout: "left-right",
1039
+ columns: {
1040
+ count: 2,
1041
+ widths: ["w-full", "w-0"]
1042
+ },
1043
+ leftSection: {
1044
+ title: "",
1045
+ groups: ["named", "other"],
1046
+ showHints: !1,
1047
+ showPreview: "shadow"
1048
+ }
1049
+ },
1050
+ borderStyle: K,
1051
+ // ========== OPACITY ==========
1052
+ opacity: {
1053
+ layout: "left-right",
1054
+ columns: {
1055
+ count: 2,
1056
+ widths: ["w-full", "w-0"]
1057
+ },
1058
+ leftSection: {
1059
+ title: "",
1060
+ groups: ["numeric"],
1061
+ showHints: !0,
1062
+ hintType: "percentage",
1063
+ disableSubgroups: !0
1064
+ }
1065
+ },
1066
+ bgOpacity: {
1067
+ layout: "left-right",
1068
+ columns: {
1069
+ count: 2,
1070
+ widths: [...se]
1071
+ },
1072
+ leftSection: {
1073
+ title: "",
1074
+ groups: ["named"],
1075
+ showHints: !0,
1076
+ hintType: "percentage"
1077
+ },
1078
+ rightSection: {
1079
+ title: "",
1080
+ groups: ["numeric"],
1081
+ showHints: !0,
1082
+ hintType: "percentage",
1083
+ disableSubgroups: !0
1084
+ }
1085
+ },
1086
+ // ========== LAYOUT & DISPLAY ==========
1087
+ display: K,
1088
+ position: K,
1089
+ cursor: {
1090
+ layout: "left-right",
1091
+ columns: {
1092
+ count: 2,
1093
+ widths: [...se]
1094
+ },
1095
+ leftSection: {
1096
+ title: "",
1097
+ groups: ["named"],
1098
+ showHints: !1,
1099
+ showPreview: "cursor"
1100
+ },
1101
+ rightSection: {
1102
+ title: "",
1103
+ groups: ["other"],
1104
+ showHints: !1,
1105
+ showPreview: "cursor"
1106
+ }
1107
+ },
1108
+ // Like shadow: most overflow-* utilities bucket to "other" (hidden, scroll, x/y); only a few
1109
+ // keywords match "named" (e.g. auto). COMMON_NAMED_ONLY_LAYOUT hid the whole "other" column.
1110
+ overflow: {
1111
+ layout: "left-right",
1112
+ columns: {
1113
+ count: 2,
1114
+ widths: ["w-full", "w-0"]
1115
+ },
1116
+ leftSection: {
1117
+ title: "",
1118
+ groups: ["named", "other"],
1119
+ showHints: !1
1120
+ }
1121
+ },
1122
+ scrollBehavior: K,
1123
+ scrollSnapType: pe,
1124
+ scrollSnapAlign: pe,
1125
+ scrollSnapStop: pe,
1126
+ overscrollBehavior: pe,
1127
+ overscrollBehaviorX: pe,
1128
+ overscrollBehaviorY: pe,
1129
+ // ========== FLEXBOX ==========
1130
+ flexDirection: Me,
1131
+ alignItems: Me,
1132
+ justifyContent: Me,
1133
+ // ========== TYPOGRAPHY ==========
1134
+ // Most typography scale values (text-xs / text-sm / text-base / font-bold / …)
1135
+ // bucket into `other` after the prefix is stripped, so we need both groups.
1136
+ fontSize: K,
1137
+ fontWeight: K,
1138
+ textAlign: K,
1139
+ // ========== CLASS EFFECTS (Tailwind transition / transform / filter / backdrop) ==========
1140
+ transitionProperty: K,
1141
+ duration: Ke,
1142
+ delay: Ke,
1143
+ ease: K,
1144
+ twAnimate: K,
1145
+ scale: V,
1146
+ scaleX: V,
1147
+ scaleY: V,
1148
+ rotate: Ae,
1149
+ translateX: Ae,
1150
+ translateY: Ae,
1151
+ skewX: V,
1152
+ skewY: V,
1153
+ transformOrigin: K,
1154
+ twTransform: K,
1155
+ blur: V,
1156
+ brightness: V,
1157
+ contrast: V,
1158
+ grayscale: V,
1159
+ hueRotate: V,
1160
+ invert: V,
1161
+ saturate: V,
1162
+ sepia: V,
1163
+ willChange: K,
1164
+ backdropBlur: V,
1165
+ backdropOpacity: V,
1166
+ backdropBrightness: V,
1167
+ backdropContrast: V,
1168
+ backdropGrayscale: V,
1169
+ backdropHueRotate: V,
1170
+ backdropInvert: V,
1171
+ backdropSaturate: V,
1172
+ backdropSepia: V
1173
+ }, va = {
1174
+ // Width & Height
1175
+ w: "width",
1176
+ h: "height",
1177
+ size: "size",
1178
+ // Margin
1179
+ m: "margin",
1180
+ mt: "margin",
1181
+ mb: "margin",
1182
+ ml: "margin",
1183
+ mr: "margin",
1184
+ mx: "margin",
1185
+ my: "margin",
1186
+ // Padding
1187
+ p: "padding",
1188
+ pt: "padding",
1189
+ pb: "padding",
1190
+ pl: "padding",
1191
+ pr: "padding",
1192
+ px: "padding",
1193
+ py: "padding",
1194
+ // Border & Radius
1195
+ rounded: "radius",
1196
+ "rounded-t": "radius",
1197
+ "rounded-b": "radius",
1198
+ "rounded-l": "radius",
1199
+ "rounded-r": "radius",
1200
+ "rounded-tl": "radius",
1201
+ "rounded-tr": "radius",
1202
+ "rounded-bl": "radius",
1203
+ "rounded-br": "radius",
1204
+ border: "border",
1205
+ "border-t": "border",
1206
+ "border-b": "border",
1207
+ "border-l": "border",
1208
+ "border-r": "border",
1209
+ // Max/Min sizing
1210
+ "max-w": "maxWidth",
1211
+ "min-h": "minHeight",
1212
+ // Other
1213
+ gap: "gap",
1214
+ "gap-x": "gap",
1215
+ "gap-y": "gap",
1216
+ shadow: "shadow",
1217
+ opacity: "opacity",
1218
+ "bg-opacity": "bgOpacity",
1219
+ cursor: "cursor",
1220
+ overflow: "overflow",
1221
+ transition: "transitionProperty",
1222
+ duration: "duration",
1223
+ delay: "delay",
1224
+ ease: "ease",
1225
+ animate: "twAnimate",
1226
+ scale: "scale",
1227
+ "scale-x": "scaleX",
1228
+ "scale-y": "scaleY",
1229
+ rotate: "rotate",
1230
+ "translate-x": "translateX",
1231
+ "translate-y": "translateY",
1232
+ "skew-x": "skewX",
1233
+ "skew-y": "skewY",
1234
+ origin: "transformOrigin",
1235
+ blur: "blur",
1236
+ brightness: "brightness",
1237
+ contrast: "contrast",
1238
+ grayscale: "grayscale",
1239
+ "hue-rotate": "hueRotate",
1240
+ invert: "invert",
1241
+ saturate: "saturate",
1242
+ sepia: "sepia",
1243
+ "will-change": "willChange",
1244
+ "backdrop-blur": "backdropBlur",
1245
+ "backdrop-opacity": "backdropOpacity",
1246
+ "backdrop-brightness": "backdropBrightness",
1247
+ "backdrop-contrast": "backdropContrast",
1248
+ "backdrop-grayscale": "backdropGrayscale",
1249
+ "backdrop-hue-rotate": "backdropHueRotate",
1250
+ "backdrop-invert": "backdropInvert",
1251
+ "backdrop-saturate": "backdropSaturate",
1252
+ "backdrop-sepia": "backdropSepia"
1253
+ }, ya = (e, a) => {
1254
+ if (e) {
1255
+ const s = va[e];
1256
+ if (s && Ne[s])
1257
+ return Ne[s];
1258
+ }
1259
+ return a && Ne[a] ? Ne[a] : K;
1260
+ }, wa = (e) => {
1261
+ const a = {};
1262
+ return e.forEach((s) => {
1263
+ const l = s.match(/(\w+)-(\d+)\/(\d+)$/);
1264
+ if (l) {
1265
+ const [, i, d, u] = l, o = `${u}ths`;
1266
+ a[o] || (a[o] = []), a[o].push(s);
1267
+ }
1268
+ }), a;
1269
+ }, le = {
1270
+ SMALL: "S",
1271
+ MEDIUM: "M",
1272
+ LARGE: "L",
1273
+ XLARGE: "XL"
1274
+ }, Na = (e) => {
1275
+ const a = {
1276
+ [le.SMALL]: [],
1277
+ [le.MEDIUM]: [],
1278
+ [le.LARGE]: [],
1279
+ [le.XLARGE]: []
1280
+ };
1281
+ return e.forEach((s) => {
1282
+ const l = s.match(/(\w+)-(\d+(?:\.\d+)?)$/);
1283
+ if (l) {
1284
+ const [, , i] = l, d = parseFloat(i);
1285
+ d <= 3 ? a[le.SMALL].push(s) : d <= 8 ? a[le.MEDIUM].push(s) : d <= 24 ? a[le.LARGE].push(s) : a[le.XLARGE].push(s);
1286
+ } else (s.includes("-0") || s.includes("-px")) && a[le.SMALL].push(s);
1287
+ }), a;
1288
+ }, ka = 4;
1289
+ function Sa({
1290
+ isVisible: e,
1291
+ anchorElement: a,
1292
+ options: s,
1293
+ onSelect: l,
1294
+ onMouseEnter: i,
1295
+ onMouseLeave: d,
1296
+ propTag: u
1297
+ }) {
1298
+ const o = (p) => De(p, u), n = dt({
1299
+ open: e,
1300
+ placement: "right-start",
1301
+ mainAxisOffset: ka,
1302
+ shiftPadding: 8,
1303
+ boundary: [],
1304
+ rootBoundary: "viewport"
1305
+ });
1306
+ if (et(() => {
1307
+ n.refs.setReference(a), e && n.update();
1308
+ }, [a, e]), !e || !a) return null;
1309
+ const g = {
1310
+ ...n.floatingStyles,
1311
+ zIndex: st + 1
1312
+ };
1313
+ return ut.createPortal(
1314
+ /* @__PURE__ */ t(
1315
+ "div",
1316
+ {
1317
+ ref: n.refs.setFloating,
1318
+ role: "presentation",
1319
+ style: g,
1320
+ className: "border-base-300 bg-base-200 max-w-[350px] min-w-[200px] rounded-md border p-0.5 shadow-xl",
1321
+ onMouseEnter: i,
1322
+ onMouseLeave: d,
1323
+ children: /* @__PURE__ */ t("div", { className: "scrollbar grid max-h-40 grid-cols-6 flex-row gap-1 overflow-y-auto", children: s.map((p) => /* @__PURE__ */ t(
1324
+ "button",
1325
+ {
1326
+ className: "border-base-300/50 hover:border-accent hover:bg-accent hover:text-accent-content rounded border px-2 py-1.5 text-left text-xs transition-colors",
1327
+ onClick: () => l(p),
1328
+ children: /* @__PURE__ */ t("span", { className: "text-xs", children: o(p) })
1329
+ },
1330
+ p
1331
+ )) })
1332
+ }
1333
+ ),
1334
+ document.body
1335
+ );
1336
+ }
1337
+ function Ca({ subgroupName: e, options: a, onSelect: s, propTag: l }) {
1338
+ const [i, d] = z(!1), [u, o] = z(null), n = ee(null), g = () => {
1339
+ n.current && (clearTimeout(n.current), n.current = null), d(!0);
1340
+ }, p = () => {
1341
+ n.current = setTimeout(() => {
1342
+ d(!1);
1343
+ }, 150);
1344
+ }, c = () => {
1345
+ n.current && (clearTimeout(n.current), n.current = null), d(!0);
1346
+ }, r = () => {
1347
+ d(!1);
1348
+ };
1349
+ oe(() => () => {
1350
+ n.current && clearTimeout(n.current);
1351
+ }, []);
1352
+ const b = () => {
1353
+ a.length > 0 && s(a[0]);
1354
+ };
1355
+ return /* @__PURE__ */ O("div", { className: "relative", children: [
1356
+ /* @__PURE__ */ t(
1357
+ "div",
1358
+ {
1359
+ ref: o,
1360
+ role: "button",
1361
+ tabIndex: 0,
1362
+ className: "text-neutral-content hover:bg-neutral w-full cursor-pointer rounded px-2 py-1 text-left text-xs font-medium transition-colors",
1363
+ onMouseEnter: g,
1364
+ onMouseLeave: p,
1365
+ onClick: b,
1366
+ onKeyDown: (h) => {
1367
+ (h.key === "Enter" || h.key === " ") && (h.preventDefault(), b());
1368
+ },
1369
+ children: e
1370
+ }
1371
+ ),
1372
+ /* @__PURE__ */ t(
1373
+ Sa,
1374
+ {
1375
+ isVisible: i,
1376
+ anchorElement: u,
1377
+ options: a,
1378
+ onSelect: s,
1379
+ onMouseEnter: c,
1380
+ onMouseLeave: r,
1381
+ propTag: l
1382
+ }
1383
+ )
1384
+ ] });
1385
+ }
1386
+ function Ta({
1387
+ options: e,
1388
+ filteredOptions: a,
1389
+ selectedIndex: s,
1390
+ onSelect: l,
1391
+ inputRef: i,
1392
+ showVarSelector: d,
1393
+ propTag: u,
1394
+ tailwindKey: o,
1395
+ currentValue: n,
1396
+ selectedType: g,
1397
+ highlightedOption: p
1398
+ }) {
1399
+ const c = ya(u, o), r = ct(), b = r != null ? Math.max(nt, r + 10) : st, S = !!(e && (e.named.length > 0 || e.numeric.length > 0 || e.fractions.length > 0 || e.tokens.length > 0 || e.other.length > 0)), P = typeof window < "u" ? window.innerWidth : 1536, L = { width: "fit-content", maxWidth: Math.min(P - 16, 320) }, H = (N) => De(N, u), W = (N, x) => {
1400
+ if (!x) return null;
1401
+ switch (x) {
1402
+ case "cursor": {
1403
+ const f = N.replace("cursor-", "");
1404
+ return /* @__PURE__ */ t(
1405
+ "div",
1406
+ {
1407
+ className: "border-base-300 bg-neutral flex size-4 shrink-0 items-center justify-center rounded border",
1408
+ style: { cursor: f },
1409
+ children: (() => {
1410
+ switch (f) {
1411
+ case "pointer":
1412
+ return /* @__PURE__ */ t(Vt, { className: "size-3" });
1413
+ case "default":
1414
+ case "auto":
1415
+ return /* @__PURE__ */ t(Be, { className: "size-3" });
1416
+ case "text":
1417
+ case "vertical-text":
1418
+ return /* @__PURE__ */ t(Ut, { className: "size-3" });
1419
+ case "move":
1420
+ case "all-scroll":
1421
+ return /* @__PURE__ */ t(Wt, { className: "size-3" });
1422
+ case "grab":
1423
+ case "grabbing":
1424
+ return /* @__PURE__ */ t(Gt, { className: "size-3" });
1425
+ case "not-allowed":
1426
+ case "no-drop":
1427
+ return /* @__PURE__ */ t(Rt, { className: "size-3" });
1428
+ case "wait":
1429
+ case "progress":
1430
+ return /* @__PURE__ */ t($t, { className: "size-3" });
1431
+ case "help":
1432
+ case "context-menu":
1433
+ return /* @__PURE__ */ t(_t, { className: "size-3" });
1434
+ case "crosshair":
1435
+ case "cell":
1436
+ return /* @__PURE__ */ t(tt, { className: "size-3" });
1437
+ case "copy":
1438
+ case "alias":
1439
+ return /* @__PURE__ */ t(Ft, { className: "size-3" });
1440
+ case "zoom-in":
1441
+ return /* @__PURE__ */ t(Dt, { className: "size-3" });
1442
+ case "zoom-out":
1443
+ return /* @__PURE__ */ t(Ht, { className: "size-3" });
1444
+ case "col-resize":
1445
+ case "ew-resize":
1446
+ return /* @__PURE__ */ t(zt, { className: "size-3" });
1447
+ case "row-resize":
1448
+ case "ns-resize":
1449
+ return /* @__PURE__ */ t(It, { className: "size-3" });
1450
+ case "n-resize":
1451
+ return /* @__PURE__ */ t(Be, { className: "size-3" });
1452
+ case "s-resize":
1453
+ return /* @__PURE__ */ t(Et, { className: "size-3" });
1454
+ case "e-resize":
1455
+ return /* @__PURE__ */ t(Mt, { className: "size-3" });
1456
+ case "w-resize":
1457
+ return /* @__PURE__ */ t(At, { className: "size-3" });
1458
+ case "ne-resize":
1459
+ case "nesw-resize":
1460
+ return /* @__PURE__ */ t(Ve, { className: "size-3 rotate-45" });
1461
+ case "nw-resize":
1462
+ case "nwse-resize":
1463
+ return /* @__PURE__ */ t(Ue, { className: "size-3 rotate-45" });
1464
+ case "se-resize":
1465
+ return /* @__PURE__ */ t(Ve, { className: "size-3 -rotate-45" });
1466
+ case "sw-resize":
1467
+ return /* @__PURE__ */ t(Ue, { className: "size-3 -rotate-45" });
1468
+ case "none":
1469
+ return /* @__PURE__ */ t(Pt, { className: "size-3 opacity-30" });
1470
+ default:
1471
+ return /* @__PURE__ */ t(Ot, { className: "size-3" });
1472
+ }
1473
+ })()
1474
+ }
1475
+ );
1476
+ }
1477
+ case "shadow": {
1478
+ const f = He(N);
1479
+ return /* @__PURE__ */ O("div", { className: "flex size-9 shrink-0 items-center justify-center gap-1", children: [
1480
+ f ? /* @__PURE__ */ t(
1481
+ "span",
1482
+ {
1483
+ className: "border-base-300 size-3 shrink-0 rounded-sm border",
1484
+ style: { backgroundColor: f },
1485
+ "aria-hidden": !0
1486
+ }
1487
+ ) : null,
1488
+ /* @__PURE__ */ t("div", { className: "flex flex-1 items-center justify-center", children: /* @__PURE__ */ t("div", { className: `bg-base-100 size-7 rounded ${N}` }) })
1489
+ ] });
1490
+ }
1491
+ default:
1492
+ return null;
1493
+ }
1494
+ }, T = (N, x, f = !1, w = "custom", v = !1, B) => {
1495
+ const D = (e == null ? void 0 : e[N]) || [];
1496
+ if (D.length === 0) return null;
1497
+ if (v && (N === "numeric" || N === "fractions")) {
1498
+ let m = {};
1499
+ return N === "numeric" ? m = Na(D) : N === "fractions" && (m = wa(D)), /* @__PURE__ */ t("div", { className: "p-2", children: /* @__PURE__ */ t("div", { className: "space-y-1", children: Object.entries(m).filter(([, A]) => A.length > 0).map(([A, U]) => /* @__PURE__ */ t(
1500
+ Ca,
1501
+ {
1502
+ subgroupName: A,
1503
+ options: U,
1504
+ showHints: !1,
1505
+ hintType: w,
1506
+ onSelect: l,
1507
+ propTag: u
1508
+ },
1509
+ A
1510
+ )) }) }, N);
1511
+ }
1512
+ return /* @__PURE__ */ t("div", { className: "p-2", children: /* @__PURE__ */ t("div", { className: "ph-select-item-host overflow-y-auto", children: D.map((m) => {
1513
+ const A = W(m, B), U = n === m;
1514
+ return /* @__PURE__ */ O(
1515
+ "button",
1516
+ {
1517
+ type: "button",
1518
+ className: `ph-select-item text-base-content text-xs ${U ? "bg-primary text-primary-content font-semibold" : !U && p === m ? "bg-primary/10 text-primary font-semibold" : ""}`,
1519
+ onClick: () => l(m),
1520
+ children: [
1521
+ A,
1522
+ /* @__PURE__ */ t("span", { className: "flex-1", children: H(m) })
1523
+ ]
1524
+ },
1525
+ m
1526
+ );
1527
+ }) }) }, N);
1528
+ };
1529
+ return a ? /* @__PURE__ */ t(
1530
+ Xe,
1531
+ {
1532
+ open: S,
1533
+ onOpenChange: () => {
1534
+ },
1535
+ anchor: i,
1536
+ placement: "bottom-start",
1537
+ mainAxisOffset: 4,
1538
+ maxHeightCeiling: 400,
1539
+ matchAnchorWidth: { min: 120, max: 200 },
1540
+ boundary: [],
1541
+ zIndex: b,
1542
+ disableDismiss: !0,
1543
+ style: L,
1544
+ className: "pagehub-sdk-root ph-panel text-base-content flex w-fit flex-col",
1545
+ children: /* @__PURE__ */ O("div", { "data-unified-dropdown": !0, className: "ph-select-item-host flex flex-1 flex-col", children: [
1546
+ /* @__PURE__ */ t(
1547
+ "button",
1548
+ {
1549
+ type: "button",
1550
+ onClick: () => l(""),
1551
+ className: "ph-select-item border-base-300 text-neutral-content shrink-0 rounded-none border-b",
1552
+ children: "None"
1553
+ }
1554
+ ),
1555
+ /* @__PURE__ */ t("div", { className: "scrollbar-light flex-1 overflow-y-auto", children: a.length === 0 ? /* @__PURE__ */ t("div", { className: "text-neutral-content px-3 py-6 text-center text-xs", children: "No matches found" }) : a.map((N, x) => {
1556
+ const f = x === s, w = u === "shadow" ? He(N) : null;
1557
+ return /* @__PURE__ */ O(
1558
+ "button",
1559
+ {
1560
+ type: "button",
1561
+ onClick: () => l(N),
1562
+ className: `ph-select-item text-base-content flex items-center gap-2 ${f ? "bg-primary/10 text-primary font-semibold" : ""}`,
1563
+ children: [
1564
+ w ? /* @__PURE__ */ t(
1565
+ "span",
1566
+ {
1567
+ className: "border-base-300 size-3 shrink-0 rounded-sm border",
1568
+ style: { backgroundColor: w },
1569
+ "aria-hidden": !0
1570
+ }
1571
+ ) : null,
1572
+ /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate", children: H(N) })
1573
+ ]
1574
+ },
1575
+ N
1576
+ );
1577
+ }) })
1578
+ ] })
1579
+ }
1580
+ ) : /* @__PURE__ */ t(
1581
+ Xe,
1582
+ {
1583
+ open: S,
1584
+ onOpenChange: () => {
1585
+ },
1586
+ anchor: i,
1587
+ placement: "bottom-start",
1588
+ mainAxisOffset: 4,
1589
+ maxHeightCeiling: 400,
1590
+ matchAnchorWidth: { min: 120, max: 200 },
1591
+ boundary: [],
1592
+ zIndex: b,
1593
+ disableDismiss: !0,
1594
+ style: L,
1595
+ className: "pagehub-sdk-root ph-panel text-base-content flex w-fit flex-col overflow-hidden",
1596
+ children: /* @__PURE__ */ O(
1597
+ "div",
1598
+ {
1599
+ "data-unified-dropdown": !0,
1600
+ className: "ph-select-item-host flex min-h-0 flex-1 flex-col overflow-hidden",
1601
+ children: [
1602
+ (() => {
1603
+ const N = c.columns || { count: 3, widths: ["w-2/5", "w-1/5", "w-2/5"] }, x = [];
1604
+ N.count === 3 ? x.push(
1605
+ { section: c.leftSection, width: N.widths[0], key: "left" },
1606
+ { section: c.middleSection, width: N.widths[1], key: "middle" },
1607
+ { section: c.rightSection, width: N.widths[2], key: "right" }
1608
+ ) : N.count === 2 && x.push(
1609
+ { section: c.leftSection, width: N.widths[0], key: "left" },
1610
+ { section: c.rightSection, width: N.widths[1], key: "right" }
1611
+ );
1612
+ const f = x.filter(
1613
+ (m) => m.section != null
1614
+ ), w = (m) => e != null && m.groups.some((A) => {
1615
+ var U;
1616
+ return (((U = e[A]) == null ? void 0 : U.length) ?? 0) > 0;
1617
+ }), v = f.filter((m) => w(m.section)), B = v.length > 0 && v.length < f.length, D = v.length > 0 ? v : f;
1618
+ return /* @__PURE__ */ t("div", { className: "flex h-full flex-col", children: /* @__PURE__ */ t("div", { className: "flex h-full", children: D.map((m, A) => {
1619
+ if (!m.section) return null;
1620
+ const q = A === D.length - 1 ? "" : "border-r border-base-300", te = B && v.length > 0 && D.length === 1 ? "w-max min-w-0 max-w-full shrink-0" : m.width;
1621
+ return /* @__PURE__ */ t(
1622
+ "div",
1623
+ {
1624
+ className: `scrollbar-light ${te} overflow-y-auto ${q}`,
1625
+ children: m.section.groups.map((F, y) => {
1626
+ var E, _, J, j, ae, Q, de, me, fe, R, $, Z, G, Y, re, ne;
1627
+ const M = "flex-1";
1628
+ return F === "named" ? /* @__PURE__ */ t("div", { className: M, children: T(
1629
+ "named",
1630
+ m.section.title,
1631
+ ((E = m.section) == null ? void 0 : E.showHints) || !1,
1632
+ ((_ = m.section) == null ? void 0 : _.hintType) || "custom",
1633
+ !1,
1634
+ (J = m.section) == null ? void 0 : J.showPreview
1635
+ ) }, "named") : F === "numeric" ? /* @__PURE__ */ t("div", { className: M, children: T(
1636
+ "numeric",
1637
+ m.section.title,
1638
+ ((j = m.section) == null ? void 0 : j.showHints) || !1,
1639
+ ((ae = m.section) == null ? void 0 : ae.hintType) || "pixel",
1640
+ !((Q = m.section) != null && Q.disableSubgroups),
1641
+ // Enable subgroups unless disabled
1642
+ (de = m.section) == null ? void 0 : de.showPreview
1643
+ ) }, "numeric") : F === "fractions" ? /* @__PURE__ */ t("div", { className: M, children: T(
1644
+ "fractions",
1645
+ "Fractions",
1646
+ (me = m.section) == null ? void 0 : me.showHints,
1647
+ ((fe = m.section) == null ? void 0 : fe.hintType) || "percentage",
1648
+ !((R = m.section) != null && R.disableSubgroups),
1649
+ // Enable subgroups unless disabled
1650
+ ($ = m.section) == null ? void 0 : $.showPreview
1651
+ ) }, "fractions") : F === "tokens" ? /* @__PURE__ */ t("div", { className: M, children: T(
1652
+ "tokens",
1653
+ m.section.title,
1654
+ !1,
1655
+ ((Z = m.section) == null ? void 0 : Z.hintType) || "custom",
1656
+ !1,
1657
+ (G = m.section) == null ? void 0 : G.showPreview
1658
+ ) }, "tokens") : F === "other" ? /* @__PURE__ */ t("div", { className: M, children: T(
1659
+ "other",
1660
+ "Other",
1661
+ ((Y = m.section) == null ? void 0 : Y.showHints) || !1,
1662
+ ((re = m.section) == null ? void 0 : re.hintType) || "custom",
1663
+ !1,
1664
+ (ne = m.section) == null ? void 0 : ne.showPreview
1665
+ ) }, "other") : null;
1666
+ })
1667
+ },
1668
+ m.key
1669
+ );
1670
+ }) }) });
1671
+ })(),
1672
+ /* @__PURE__ */ t(
1673
+ "button",
1674
+ {
1675
+ type: "button",
1676
+ onClick: () => l(""),
1677
+ className: "ph-select-item border-base-300 bg-base-200 text-neutral-content sticky top-0 z-10 shrink-0 rounded-none border-t",
1678
+ children: "Reset to Default"
1679
+ }
1680
+ )
1681
+ ]
1682
+ }
1683
+ )
1684
+ }
1685
+ );
1686
+ }
1687
+ const he = ["px", "em", "rem", "%", "vh", "vw", "vmin", "vmax"];
1688
+ function ht({
1689
+ label: e,
1690
+ labelPrefix: a,
1691
+ labelSuffix: s,
1692
+ labelHide: l = !1,
1693
+ labelWidth: i = "",
1694
+ inputWidth: d = "",
1695
+ placeholder: u = "Enter value",
1696
+ showVarSelector: o = !0,
1697
+ allowedTypes: n,
1698
+ wrap: g = "",
1699
+ index: p = null,
1700
+ propItemKey: c,
1701
+ propType: r = "class",
1702
+ propKey: b,
1703
+ propTag: h,
1704
+ tailwindKey: S,
1705
+ hideTypeSelector: P = !1,
1706
+ renderBreakpointPills: I = !0,
1707
+ state: L,
1708
+ handlers: H,
1709
+ designVars: W
1710
+ }) {
1711
+ const {
1712
+ showAutocomplete: T,
1713
+ setShowAutocomplete: k,
1714
+ showCalcDialog: N,
1715
+ setShowCalcDialog: x,
1716
+ inputValue: f,
1717
+ setInputValue: w,
1718
+ selectedType: v,
1719
+ setSelectedType: B,
1720
+ inputRef: D,
1721
+ typeSelectorRef: m,
1722
+ currentValue: A,
1723
+ organizedOptions: U,
1724
+ filteredOptions: q,
1725
+ selectedIndex: te,
1726
+ availableTailwindOptions: F,
1727
+ kbdNavActive: y,
1728
+ handleChange: M,
1729
+ parsed: E,
1730
+ isEditing: _,
1731
+ setIsEditing: J,
1732
+ isTypeSelectorOpen: j,
1733
+ setIsTypeSelectorOpen: ae
1734
+ } = L, {
1735
+ handleInputChange: Q,
1736
+ handleInputFocus: de,
1737
+ handleInputBlur: me,
1738
+ handleKeyDown: fe,
1739
+ handleAutocompleteSelect: R
1740
+ } = H, $ = q || !y ? void 0 : F[te], Z = X(() => {
1741
+ const C = [];
1742
+ return (!n || n.includes("calc")) && C.push({ id: "calc", label: /* @__PURE__ */ t(Bt, { className: "size-3" }) }), C.push({ id: "var", label: /* @__PURE__ */ t(lt, { className: "size-3" }) }), C.push({ id: "tailwind", label: /* @__PURE__ */ t(Yt, { className: "size-3" }) }), (!n || n.includes("em")) && C.push({ id: "em", label: "em" }), (!n || n.includes("px")) && C.push({ id: "px", label: "px" }), (!n || n.includes("rem")) && C.push({ id: "rem", label: "rem" }), (!n || n.includes("%")) && C.push({ id: "%", label: "%" }), (!n || n.includes("vh")) && C.push({ id: "vh", label: "vh" }), (!n || n.includes("vw")) && C.push({ id: "vw", label: "vw" }), (!n || n.includes("vmin")) && C.push({ id: "vmin", label: "vmin" }), (!n || n.includes("vmax")) && C.push({ id: "vmax", label: "vmax" }), C;
1743
+ }, [n]), G = X(() => {
1744
+ if (_ || !f) return f;
1745
+ if (r === "class" && v === "tailwind")
1746
+ return De(f, h);
1747
+ if (v === "var") {
1748
+ const C = f.match(/^(?:var|font)\s*\(\s*(--[\w-]+)\s*\)$/), be = C == null ? void 0 : C[1];
1749
+ if (be) {
1750
+ const we = W.find((Te) => Te.varName === be);
1751
+ if (we) return we.label;
1752
+ }
1753
+ }
1754
+ return f;
1755
+ }, [_, f, v, r, h, W]), Y = X(
1756
+ () => [D, m],
1757
+ [D, m]
1758
+ ), re = X(() => h !== "shadow" ? null : He(f || A), [h, f, A]), ne = X(() => {
1759
+ const C = ["%", "vh", "vw", "vmin", "vmax"];
1760
+ return v === "calc" ? "" : C.includes(v) ? ` (${v})` : he.includes(v) ? ` (${v})` : v === "tailwind" ? "" : u;
1761
+ }, [v, u]), Ce = (C) => {
1762
+ var We;
1763
+ const be = v;
1764
+ if (k(!1), C === "calc") {
1765
+ B("calc"), x(!0);
1766
+ return;
1767
+ }
1768
+ B(C), J(C === "tailwind" || C === "var"), (C === "tailwind" || C === "var") && k(!0);
1769
+ const we = he.includes(be), Te = he.includes(C);
1770
+ if (C !== be)
1771
+ if (we && Te) {
1772
+ const Le = ((We = E.numeric) == null ? void 0 : We.toString()) || "";
1773
+ Le ? (w(Le), M(Le, C)) : w("");
1774
+ } else
1775
+ w("");
1776
+ }, $e = /* @__PURE__ */ O("div", { className: "relative min-w-0 flex-1", children: [
1777
+ /* @__PURE__ */ t(
1778
+ "input",
1779
+ {
1780
+ id: b ? `input-${b}` : void 0,
1781
+ ref: D,
1782
+ type: "text",
1783
+ value: G,
1784
+ onChange: Q,
1785
+ onBlur: me,
1786
+ onKeyDown: fe,
1787
+ onFocus: de,
1788
+ placeholder: ne,
1789
+ className: "input-plain h-8 w-full",
1790
+ "aria-label": e || b,
1791
+ ...ue
1792
+ }
1793
+ ),
1794
+ T && !j && v !== "var" && /* @__PURE__ */ t(
1795
+ Ta,
1796
+ {
1797
+ options: U,
1798
+ filteredOptions: q,
1799
+ selectedIndex: te,
1800
+ onSelect: R,
1801
+ inputRef: D,
1802
+ showVarSelector: o,
1803
+ propTag: h,
1804
+ tailwindKey: S,
1805
+ currentValue: A,
1806
+ selectedType: v,
1807
+ highlightedOption: $
1808
+ }
1809
+ ),
1810
+ o && v === "var" && T && !j && /* @__PURE__ */ t(
1811
+ Ga,
1812
+ {
1813
+ open: !0,
1814
+ onOpenChange: (C) => {
1815
+ C || (k(!1), J(!1));
1816
+ },
1817
+ anchor: m,
1818
+ ignoreOutsideClicks: Y,
1819
+ onSelect: R,
1820
+ currentValue: A,
1821
+ propTag: h,
1822
+ tailwindKey: S
1823
+ }
1824
+ )
1825
+ ] }), Re = P ? null : /* @__PURE__ */ t(
1826
+ pt,
1827
+ {
1828
+ ref: m,
1829
+ types: Z,
1830
+ selectedType: v,
1831
+ onCalcClick: () => x(!0),
1832
+ onOpenChange: (C) => {
1833
+ ae(C), C && k(!1);
1834
+ },
1835
+ onTypeChange: Ce
1836
+ }
1837
+ ), Ge = A ? /* @__PURE__ */ t(
1838
+ qt,
1839
+ {
1840
+ onClick: (C) => {
1841
+ C.preventDefault(), w(""), J(!1), k(!1), M("", v);
1842
+ },
1843
+ tooltip: "Clear"
1844
+ }
1845
+ ) : null, vt = g ? /* @__PURE__ */ O("div", { className: "flex w-full min-w-0 items-center gap-1.5", children: [
1846
+ $e,
1847
+ Re,
1848
+ Ge
1849
+ ] }) : /* @__PURE__ */ O(rt, { trailing: Ge, children: [
1850
+ re ? /* @__PURE__ */ t(
1851
+ "span",
1852
+ {
1853
+ className: "border-base-300 ml-0.5 size-3.5 shrink-0 self-center rounded-sm border",
1854
+ style: { backgroundColor: re },
1855
+ "aria-hidden": !0
1856
+ }
1857
+ ) : null,
1858
+ $e,
1859
+ Re
1860
+ ] });
1861
+ return /* @__PURE__ */ O("div", { className: "flex w-full flex-col", children: [
1862
+ /* @__PURE__ */ O("div", { className: "flex w-full items-center gap-0.5", children: [
1863
+ e && !l && /* @__PURE__ */ O("div", { className: `flex flex-col items-start gap-0.5 ${i || "w-20"}`, children: [
1864
+ /* @__PURE__ */ t(
1865
+ "label",
1866
+ {
1867
+ htmlFor: b ? `input-${b}` : void 0,
1868
+ className: "w-full cursor-pointer truncate text-xs whitespace-nowrap",
1869
+ children: e
1870
+ }
1871
+ ),
1872
+ I && r === "class" && /* @__PURE__ */ t(
1873
+ Xt,
1874
+ {
1875
+ propKey: b,
1876
+ propType: r,
1877
+ index: p,
1878
+ propItemKey: c,
1879
+ label: b
1880
+ }
1881
+ )
1882
+ ] }),
1883
+ /* @__PURE__ */ t("div", { className: `flex min-w-0 items-center gap-0.5 ${d || "flex-1"}`, children: vt })
1884
+ ] }),
1885
+ N && /* @__PURE__ */ t(
1886
+ fa,
1887
+ {
1888
+ value: v === "calc" ? f : "",
1889
+ onSave: (C) => {
1890
+ M(C, "calc"), B("calc"), w(C), x(!1), setTimeout(() => J(!1), 100);
1891
+ },
1892
+ onClose: () => x(!1),
1893
+ anchorEl: m.current
1894
+ }
1895
+ )
1896
+ ] });
1897
+ }
1898
+ const Je = /* @__PURE__ */ new Set([
1899
+ "space-3xs",
1900
+ "space-2xs",
1901
+ "space-xs",
1902
+ "space-sm",
1903
+ "space-md",
1904
+ "space-lg",
1905
+ "space-xl",
1906
+ "container",
1907
+ "container-x",
1908
+ "container-y",
1909
+ "section",
1910
+ "density"
1911
+ ]);
1912
+ function ft(e, a) {
1913
+ if (!a) return Je.has(e);
1914
+ const s = `${a}-`;
1915
+ return e.startsWith(s) ? Je.has(e.slice(s.length)) : !1;
1916
+ }
1917
+ function bt(e, a) {
1918
+ var n, g, p;
1919
+ if (!e || typeof e != "string")
1920
+ return { type: "custom", value: "" };
1921
+ if (e.match(/^var\(/i))
1922
+ return {
1923
+ type: "var",
1924
+ value: e
1925
+ };
1926
+ const l = e.match(/^(\w+)-\[var\([^\]]+\)\]$/i);
1927
+ if (l)
1928
+ return {
1929
+ type: "var",
1930
+ value: ((n = e.match(/\[(.*)\]/)) == null ? void 0 : n[1]) || e,
1931
+ prefix: l[1]
1932
+ };
1933
+ if (e.match(/^(calc|clamp|max|min)\(/i))
1934
+ return {
1935
+ type: "calc",
1936
+ value: e
1937
+ };
1938
+ const d = e.match(/^(\w+)-\[(calc|clamp|max|min)\([^\]]+\)\]$/i);
1939
+ if (d)
1940
+ return {
1941
+ type: "calc",
1942
+ value: ((g = e.match(/\[(.*)\]/)) == null ? void 0 : g[1]) || e,
1943
+ prefix: d[1]
1944
+ };
1945
+ const u = e.match(/^(\w+)-\[([0-9.]+)(px|em|rem|%|vh|vw|vmin|vmax)\]$/);
1946
+ if (u)
1947
+ return {
1948
+ type: u[3],
1949
+ numeric: parseFloat(u[2]),
1950
+ value: u[2],
1951
+ unit: u[3],
1952
+ prefix: u[1]
1953
+ };
1954
+ const o = e.match(/^([0-9.]+)(px|em|rem|%|vh|vw|vmin|vmax)$/);
1955
+ if (o)
1956
+ return {
1957
+ type: o[2],
1958
+ numeric: parseFloat(o[1]),
1959
+ value: o[1],
1960
+ unit: o[2]
1961
+ };
1962
+ if (jt(e))
1963
+ return {
1964
+ type: "tailwind",
1965
+ value: e
1966
+ };
1967
+ if (a) {
1968
+ const c = Object.keys(ce).find((r) => {
1969
+ const b = ce[r];
1970
+ return Array.isArray(b) && b.some((h) => typeof h == "string" && h.startsWith(`${a}-`));
1971
+ });
1972
+ if (c && ((p = ce[c]) != null && p.includes(e)))
1973
+ return {
1974
+ type: "tailwind",
1975
+ value: e,
1976
+ prefix: a
1977
+ };
1978
+ }
1979
+ return {
1980
+ type: "custom",
1981
+ value: e
1982
+ };
1983
+ }
1984
+ function gt(e, a, s) {
1985
+ switch (a) {
1986
+ case "tailwind":
1987
+ return e;
1988
+ case "var":
1989
+ return s ? `${s}-[${e}]` : e;
1990
+ case "calc":
1991
+ return s ? `${s}-[${e}]` : e;
1992
+ case "px":
1993
+ case "em":
1994
+ case "rem":
1995
+ case "%":
1996
+ case "vh":
1997
+ case "vw":
1998
+ case "vmin":
1999
+ case "vmax":
2000
+ return s ? `${s}-[${e}${a}]` : `${e}${a}`;
2001
+ default:
2002
+ return e;
2003
+ }
2004
+ }
2005
+ const La = (e) => {
2006
+ const {
2007
+ value: a,
2008
+ onChange: s,
2009
+ propTag: l = "",
2010
+ tailwindKey: i,
2011
+ tailwindOptions: d,
2012
+ allowedTypes: u,
2013
+ overrideType: o
2014
+ } = e, [n, g] = z(!1), [p, c] = z(!1), [r, b] = z(""), [h, S] = z(!1), [P, I] = z(0), [L, H] = z(!1), [W, T] = z(!1), k = ee(null), N = ee(null), x = ee(!1), f = ee(!1), w = a || "", v = X(() => bt(w, l), [w, l]), B = !u || u.includes("tailwind") ? "tailwind" : u[0] || "px", [D, m] = z(B);
2015
+ oe(() => {
2016
+ o && !w && m(o);
2017
+ }, [o]), oe(() => {
2018
+ w ? m(v.type) : o && m(o);
2019
+ }, [v.type, w, o]), oe(() => {
2020
+ var y;
2021
+ const F = document.activeElement === k.current;
2022
+ if (f.current && w && (f.current = !1), !(h || F || f.current))
2023
+ switch (v.type) {
2024
+ case "tailwind":
2025
+ case "var":
2026
+ case "calc":
2027
+ b(v.value);
2028
+ break;
2029
+ case "px":
2030
+ case "em":
2031
+ case "rem":
2032
+ case "%":
2033
+ case "vh":
2034
+ case "vw":
2035
+ case "vmin":
2036
+ case "vmax":
2037
+ b(((y = v.numeric) == null ? void 0 : y.toString()) || v.value);
2038
+ break;
2039
+ default:
2040
+ b(w || "");
2041
+ }
2042
+ }, [w, v, h]);
2043
+ const A = X(() => d || (i && ce[i] ? ce[i] : l ? it.filter(
2044
+ (F) => typeof F == "string" && F.startsWith(`${l}-`)
2045
+ ) : []), [d, i, l]), U = X(() => {
2046
+ var M;
2047
+ if (!A.length) return null;
2048
+ const F = l || ((M = A[0]) == null ? void 0 : M.split("-")[0]) || "", y = {
2049
+ named: [],
2050
+ numeric: [],
2051
+ fractions: [],
2052
+ tokens: [],
2053
+ other: []
2054
+ };
2055
+ return A.forEach((E) => {
2056
+ const _ = E.replace(`${F}-`, ""), J = _ === E;
2057
+ ft(E, F) ? y.tokens.push(E) : J || ["full", "screen", "auto", "min", "max", "fit", "none"].includes(_) ? y.named.push(E) : _.includes("/") ? y.fractions.push(E) : /^[\d.]+$/.test(_) || _ === "px" ? y.numeric.push(E) : y.other.push(E);
2058
+ }), y;
2059
+ }, [A, l]), q = X(() => {
2060
+ if (!r || !h || r === w || r === v.value)
2061
+ return null;
2062
+ const F = r.toLowerCase();
2063
+ return A.filter((y) => y.toLowerCase().includes(F));
2064
+ }, [r, A, h, w, v.value]);
2065
+ return {
2066
+ showAutocomplete: n,
2067
+ setShowAutocomplete: g,
2068
+ showCalcDialog: p,
2069
+ setShowCalcDialog: c,
2070
+ inputValue: r,
2071
+ setInputValue: b,
2072
+ isEditing: h,
2073
+ setIsEditing: S,
2074
+ selectedIndex: P,
2075
+ setSelectedIndex: I,
2076
+ kbdNavActive: L,
2077
+ setKbdNavActive: H,
2078
+ isTypeSelectorOpen: W,
2079
+ setIsTypeSelectorOpen: T,
2080
+ selectedType: D,
2081
+ setSelectedType: m,
2082
+ inputRef: k,
2083
+ typeSelectorRef: N,
2084
+ skipBlurCommitRef: x,
2085
+ pendingUpdateRef: f,
2086
+ currentValue: w,
2087
+ parsed: v,
2088
+ availableTailwindOptions: A,
2089
+ organizedOptions: U,
2090
+ filteredOptions: q,
2091
+ handleChange: (F, y) => {
2092
+ const M = y || D;
2093
+ let E = M, _ = F;
2094
+ if (!y && F && M !== "calc" && M !== "tailwind") {
2095
+ if (F.endsWith("%"))
2096
+ E = "%", _ = F.slice(0, -1);
2097
+ else
2098
+ for (const j of he)
2099
+ if (j !== "%" && F.endsWith(j)) {
2100
+ E = j, _ = F.slice(0, -j.length);
2101
+ break;
2102
+ }
2103
+ }
2104
+ E !== D && m(E);
2105
+ const J = gt(_, E, l);
2106
+ f.current = !0, s(J), setTimeout(() => {
2107
+ f.current && (f.current = !1);
2108
+ }, 500);
2109
+ }
2110
+ };
2111
+ }, xt = (e) => {
2112
+ const {
2113
+ inputValue: a,
2114
+ setInputValue: s,
2115
+ selectedType: l,
2116
+ setSelectedType: i,
2117
+ setIsEditing: d,
2118
+ setShowAutocomplete: u,
2119
+ setSelectedIndex: o,
2120
+ setKbdNavActive: n,
2121
+ skipBlurCommitRef: g,
2122
+ currentValue: p,
2123
+ parsed: c,
2124
+ availableTailwindOptions: r,
2125
+ showVarSelector: b,
2126
+ showAutocomplete: h,
2127
+ filteredOptions: S,
2128
+ selectedIndex: P,
2129
+ handleChange: I,
2130
+ inputRef: L
2131
+ } = e, H = (x) => {
2132
+ const f = x.target.value, w = he.includes(l), v = f.match(/^(-?[0-9.]+)(px|em|rem|%|vh|vw|vmin|vmax)$/);
2133
+ if (v) {
2134
+ const [, m, A] = v;
2135
+ i(A), s(m), d(!0), u(!1);
2136
+ return;
2137
+ }
2138
+ if (w && f !== "") {
2139
+ const m = f.match(/^(-?[0-9.]+)([a-z%]*)$/i);
2140
+ if (m) {
2141
+ const [, U, q] = m;
2142
+ if (!(q === "" || q === "%" || ["px", "em", "rem", "%", "vh", "vw", "vmin", "vmax"].some((y) => y.startsWith(q.toLowerCase())))) if (f.match(/^[a-z]+-/i)) {
2143
+ i("tailwind"), s(f), d(!0), u(!0), o(0);
2144
+ return;
2145
+ } else
2146
+ return;
2147
+ } else
2148
+ return;
2149
+ if (["%", "vh", "vw", "vmin", "vmax"].includes(l)) {
2150
+ const U = parseFloat(f);
2151
+ if (!isNaN(U) && (U < -200 || U > 1e3))
2152
+ return;
2153
+ }
2154
+ }
2155
+ s(f), d(!0);
2156
+ const B = f.match(/^[a-z]+-/i), D = /^-?\d+\.?\d*$/.test(f);
2157
+ B && l !== "tailwind" && l !== "calc" ? (i("tailwind"), u(!0), o(0)) : l === "tailwind" ? (u(!0), o(0)) : D && u(!1);
2158
+ }, W = () => {
2159
+ d(!0), n(!1), (r.length > 0 || b) && u(!0);
2160
+ }, T = (x) => {
2161
+ const f = x.relatedTarget;
2162
+ f && (f.closest("[data-unified-dropdown]") || f.closest("[data-type-selector-dropdown]") || f.closest('[role="dialog"]')) || setTimeout(() => {
2163
+ if (g.current) {
2164
+ g.current = !1, d(!1), u(!1);
2165
+ return;
2166
+ }
2167
+ a !== p && I(a, l), d(!1), u(!1);
2168
+ }, 200);
2169
+ }, k = (x) => {
2170
+ var v;
2171
+ g.current = !0;
2172
+ const f = x.startsWith("var(");
2173
+ s(x);
2174
+ let w = l;
2175
+ x === "" ? w = l : f ? (w = "var", i("var")) : (w = "tailwind", i("tailwind")), I(x, w), u(!1), d(!1), (v = L.current) == null || v.blur();
2176
+ };
2177
+ return {
2178
+ handleInputChange: H,
2179
+ handleInputFocus: W,
2180
+ handleInputBlur: T,
2181
+ handleAutocompleteSelect: k,
2182
+ handleKeyDown: (x) => {
2183
+ var w, v, B;
2184
+ if (!h && x.key !== "Enter") return;
2185
+ const f = S || r;
2186
+ switch (x.key) {
2187
+ case "ArrowDown":
2188
+ x.preventDefault(), n(!0), o(Math.min(P + 1, f.length - 1));
2189
+ break;
2190
+ case "ArrowUp":
2191
+ x.preventDefault(), n(!0), o(Math.max(P - 1, 0));
2192
+ break;
2193
+ case "Enter":
2194
+ x.preventDefault(), h && f[P] ? k(f[P]) : (I(a || "", l), d(!1), u(!1), (w = L.current) == null || w.blur());
2195
+ break;
2196
+ case "Escape":
2197
+ x.preventDefault(), u(!1), d(!1), s(((v = c.numeric) == null ? void 0 : v.toString()) || c.value || p || ""), (B = L.current) == null || B.blur();
2198
+ break;
2199
+ }
2200
+ }
2201
+ };
2202
+ };
2203
+ function Oa(e) {
2204
+ const {
2205
+ value: a,
2206
+ onChange: s,
2207
+ label: l,
2208
+ labelHide: i = !1,
2209
+ labelWidth: d = "",
2210
+ inputWidth: u = "",
2211
+ placeholder: o = "Enter value",
2212
+ showVarSelector: n = !0,
2213
+ allowedTypes: g,
2214
+ wrap: p = "",
2215
+ inline: c = !0,
2216
+ propTag: r,
2217
+ tailwindKey: b,
2218
+ tailwindOptions: h,
2219
+ overrideType: S,
2220
+ hideTypeSelector: P = !1
2221
+ } = e, I = La({
2222
+ value: a,
2223
+ onChange: s,
2224
+ propTag: r,
2225
+ tailwindKey: b,
2226
+ tailwindOptions: h,
2227
+ allowedTypes: g,
2228
+ overrideType: S
2229
+ }), L = xt({ ...I, showVarSelector: n }), H = _e();
2230
+ return /* @__PURE__ */ t(
2231
+ ht,
2232
+ {
2233
+ label: l,
2234
+ labelHide: i,
2235
+ labelWidth: d,
2236
+ inputWidth: u,
2237
+ placeholder: o,
2238
+ showVarSelector: n,
2239
+ allowedTypes: g,
2240
+ wrap: p,
2241
+ inline: c,
2242
+ propType: "controlled",
2243
+ propTag: r,
2244
+ tailwindKey: b,
2245
+ hideTypeSelector: P,
2246
+ renderBreakpointPills: !1,
2247
+ state: I,
2248
+ handlers: L,
2249
+ designVars: H
2250
+ }
2251
+ );
2252
+ }
2253
+ function Pa() {
2254
+ const { actions: e } = Fe(), a = ie(
2255
+ ({ key: i, value: d, meta: u }) => {
2256
+ e.setProp(Se, (o) => {
2257
+ o.theme || (o.theme = {}), o.theme.styleGuide || (o.theme.styleGuide = {}), o.theme.styleGuide[i] = d, u && (o.theme.styleGuideMeta || (o.theme.styleGuideMeta = {}), o.theme.styleGuideMeta[i] = {
2258
+ ...o.theme.styleGuideMeta[i] || {},
2259
+ ...u
2260
+ });
2261
+ });
2262
+ },
2263
+ [e]
2264
+ ), s = ie(
2265
+ (i) => {
2266
+ ye[i] || e.setProp(Se, (d) => {
2267
+ var u, o;
2268
+ (u = d.theme) != null && u.styleGuide && delete d.theme.styleGuide[i], (o = d.theme) != null && o.styleGuideMeta && delete d.theme.styleGuideMeta[i];
2269
+ });
2270
+ },
2271
+ [e]
2272
+ ), l = ie(
2273
+ ({ oldKey: i, newKey: d }) => {
2274
+ ye[i] || i !== d && e.setProp(Se, (u) => {
2275
+ var g, p;
2276
+ const o = (g = u.theme) == null ? void 0 : g.styleGuide, n = (p = u.theme) == null ? void 0 : p.styleGuideMeta;
2277
+ !o || !(i in o) || (o[d] = o[i], delete o[i], n && i in n && (n[d] = n[i], delete n[i]));
2278
+ });
2279
+ },
2280
+ [e]
2281
+ );
2282
+ return { upsertToken: a, deleteToken: s, renameToken: l };
2283
+ }
2284
+ const Aa = [
2285
+ { value: "spacing", label: "Spacing" },
2286
+ { value: "colors", label: "Colors" },
2287
+ { value: "typography", label: "Typography" },
2288
+ { value: "other", label: "Other" }
2289
+ ], Ma = [
2290
+ { value: "color", label: "Color" },
2291
+ { value: "dimension", label: "Dimension" },
2292
+ { value: "number", label: "Number" },
2293
+ { value: "text", label: "Text" }
2294
+ ], Ea = ["px", "em", "rem", "%", "vh", "vw"];
2295
+ function ke(e) {
2296
+ return e.trim().replace(/[^a-zA-Z0-9 _-]/g, "").split(/[\s_-]+/).filter(Boolean).map((a, s) => {
2297
+ const l = a.toLowerCase();
2298
+ return s === 0 ? l : l.charAt(0).toUpperCase() + l.slice(1);
2299
+ }).join("");
2300
+ }
2301
+ function Ia({ mode: e, token: a, onBack: s }) {
2302
+ const { upsertToken: l, deleteToken: i, renameToken: d } = Pa(), u = sa(a == null ? void 0 : a.varName), o = u.count > 0, n = e === "edit" && !!a, g = a == null ? void 0 : a.key, p = g ? ye[g] : void 0, c = !!p && !(a != null && a.custom), r = n ? (p == null ? void 0 : p.label) ?? a.label.replace(/\s*\(Custom\)$/, "") : "", b = n ? (p == null ? void 0 : p.type) ?? mt(a.value) : "color", h = n ? (p == null ? void 0 : p.category) ?? a.category : "colors", S = n ? a.value : "", [P, I] = z(r), [L, H] = z(b), [W, T] = z([h]), [k, N] = z(S), x = p == null ? void 0 : p.quickPicks, f = c || n && o, w = n, v = c, B = n && !c && !o, D = P.trim(), m = n ? g : ke(D), A = !n && m in ye, U = X(() => !(!D || A || !k && L !== "text"), [D, A, k, L]), q = (y) => {
2303
+ T((M) => M.includes(y) ? M.filter((E) => E !== y) : [...M, y]);
2304
+ }, te = () => {
2305
+ if (U) {
2306
+ if (n) {
2307
+ const y = !c && D && ke(D) !== g;
2308
+ y && d({ oldKey: g, newKey: ke(D) });
2309
+ const M = y ? ke(D) : g;
2310
+ l({
2311
+ key: M,
2312
+ value: k,
2313
+ meta: c ? void 0 : { custom: !0, appliesTo: W }
2314
+ });
2315
+ } else
2316
+ l({
2317
+ key: m,
2318
+ value: k,
2319
+ meta: { custom: !0, appliesTo: W }
2320
+ });
2321
+ s();
2322
+ }
2323
+ }, F = () => {
2324
+ B && (i(g), s());
2325
+ };
2326
+ return /* @__PURE__ */ O("div", { className: "flex min-h-0 flex-1 flex-col overflow-hidden", children: [
2327
+ /* @__PURE__ */ O("div", { className: "border-base-300 bg-base-200 flex shrink-0 items-center gap-2 border-b p-2", children: [
2328
+ /* @__PURE__ */ t(
2329
+ "button",
2330
+ {
2331
+ type: "button",
2332
+ onClick: s,
2333
+ className: "text-neutral-content hover:text-base-content flex size-6 items-center justify-center rounded",
2334
+ "aria-label": "Back to list",
2335
+ children: /* @__PURE__ */ t(Zt, { className: "size-3.5", "aria-hidden": !0 })
2336
+ }
2337
+ ),
2338
+ /* @__PURE__ */ t("span", { className: "text-base-content text-xs font-semibold", children: n ? c ? "Edit Built-in Token" : "Edit Custom Token" : "New Token" })
2339
+ ] }),
2340
+ /* @__PURE__ */ O("div", { className: "scrollbar-light flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto p-3", children: [
2341
+ n && o && /* @__PURE__ */ O("div", { className: "border-warning bg-warning/10 text-warning rounded-md border px-2 py-1.5 text-[11px]", children: [
2342
+ "Used by ",
2343
+ u.count,
2344
+ " node",
2345
+ u.count === 1 ? "" : "s",
2346
+ ". Remove references in the canvas before renaming or deleting."
2347
+ ] }),
2348
+ /* @__PURE__ */ O("label", { className: "flex flex-col gap-1", children: [
2349
+ /* @__PURE__ */ t("span", { className: "text-neutral-content text-[11px] tracking-wide uppercase", children: "Name" }),
2350
+ /* @__PURE__ */ t(
2351
+ "input",
2352
+ {
2353
+ type: "text",
2354
+ value: P,
2355
+ onChange: (y) => I(y.target.value),
2356
+ placeholder: "e.g. Hero Gap",
2357
+ disabled: f,
2358
+ className: "border-base-300 bg-base-100 text-base-content placeholder:text-neutral-content focus:border-ring focus:ring-ring rounded-md border px-2 py-1.5 text-xs outline-none focus:ring-1 disabled:cursor-not-allowed disabled:opacity-50",
2359
+ ...ue
2360
+ }
2361
+ ),
2362
+ A && /* @__PURE__ */ t("span", { className: "text-error text-[11px]", children: "Name conflicts with a built-in token. Choose another." })
2363
+ ] }),
2364
+ /* @__PURE__ */ O("div", { className: "flex flex-col gap-1", children: [
2365
+ /* @__PURE__ */ t("span", { className: "text-neutral-content text-[11px] tracking-wide uppercase", children: "Type" }),
2366
+ /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1", children: Ma.map((y) => /* @__PURE__ */ t(
2367
+ "button",
2368
+ {
2369
+ type: "button",
2370
+ onClick: () => !w && H(y.value),
2371
+ disabled: w,
2372
+ className: `rounded-md px-2 py-1 text-[11px] transition-colors disabled:cursor-not-allowed ${L === y.value ? "bg-primary text-primary-content" : "bg-base-200 text-base-content hover:bg-base-300"} ${w && L !== y.value ? "opacity-30" : ""}`,
2373
+ children: y.label
2374
+ },
2375
+ y.value
2376
+ )) })
2377
+ ] }),
2378
+ /* @__PURE__ */ O("div", { className: "flex flex-col gap-1", children: [
2379
+ /* @__PURE__ */ t("span", { className: "text-neutral-content text-[11px] tracking-wide uppercase", children: "Applies To" }),
2380
+ /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1", children: Aa.map((y) => {
2381
+ const M = W.includes(y.value);
2382
+ return /* @__PURE__ */ t(
2383
+ "button",
2384
+ {
2385
+ type: "button",
2386
+ onClick: () => !v && q(y.value),
2387
+ disabled: v,
2388
+ className: `rounded-md px-2 py-1 text-[11px] transition-colors disabled:cursor-not-allowed ${M ? "bg-primary text-primary-content" : "bg-base-200 text-base-content hover:bg-base-300"} ${v && !M ? "opacity-30" : ""}`,
2389
+ children: y.label
2390
+ },
2391
+ y.value
2392
+ );
2393
+ }) })
2394
+ ] }),
2395
+ x && x.length > 0 && /* @__PURE__ */ O("div", { className: "flex flex-col gap-1", children: [
2396
+ /* @__PURE__ */ t("span", { className: "text-neutral-content text-[11px] tracking-wide uppercase", children: "Presets" }),
2397
+ /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1", children: x.map((y) => /* @__PURE__ */ t(
2398
+ "button",
2399
+ {
2400
+ type: "button",
2401
+ onClick: () => N(y.value),
2402
+ className: `rounded-md px-2 py-1 text-[11px] transition-colors ${k === y.value ? "bg-primary text-primary-content" : "bg-base-200 text-base-content hover:bg-base-300"}`,
2403
+ children: y.label
2404
+ },
2405
+ y.value
2406
+ )) })
2407
+ ] }),
2408
+ /* @__PURE__ */ O("div", { className: "flex flex-col gap-1", children: [
2409
+ /* @__PURE__ */ t("span", { className: "text-neutral-content text-[11px] tracking-wide uppercase", children: "Value" }),
2410
+ L === "color" ? /* @__PURE__ */ t(za, { value: k, onChange: N }) : L === "dimension" ? /* @__PURE__ */ t(
2411
+ Oa,
2412
+ {
2413
+ value: k,
2414
+ onChange: N,
2415
+ allowedTypes: Ea,
2416
+ placeholder: "e.g. 1rem",
2417
+ labelHide: !0
2418
+ }
2419
+ ) : L === "number" ? /* @__PURE__ */ t(
2420
+ "input",
2421
+ {
2422
+ type: "number",
2423
+ value: k,
2424
+ onChange: (y) => N(y.target.value),
2425
+ placeholder: "0",
2426
+ className: "border-base-300 bg-base-100 text-base-content focus:border-ring focus:ring-ring rounded-md border px-2 py-1.5 text-xs outline-none focus:ring-1"
2427
+ }
2428
+ ) : /* @__PURE__ */ t(
2429
+ "input",
2430
+ {
2431
+ type: "text",
2432
+ value: k,
2433
+ onChange: (y) => N(y.target.value),
2434
+ placeholder: "Enter value…",
2435
+ className: "border-base-300 bg-base-100 text-base-content focus:border-ring focus:ring-ring rounded-md border px-2 py-1.5 text-xs outline-none focus:ring-1",
2436
+ ...ue
2437
+ }
2438
+ )
2439
+ ] })
2440
+ ] }),
2441
+ /* @__PURE__ */ O("div", { className: "border-base-300 bg-base-200 flex shrink-0 items-center gap-2 border-t p-2", children: [
2442
+ /* @__PURE__ */ O(
2443
+ "button",
2444
+ {
2445
+ type: "button",
2446
+ onClick: te,
2447
+ disabled: !U,
2448
+ className: "bg-primary text-primary-content hover:bg-primary/90 flex flex-1 items-center justify-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-50",
2449
+ children: [
2450
+ /* @__PURE__ */ t(Kt, { className: "size-3", "aria-hidden": !0 }),
2451
+ n ? "Save" : "Create Token"
2452
+ ]
2453
+ }
2454
+ ),
2455
+ n && !c && /* @__PURE__ */ t(
2456
+ "button",
2457
+ {
2458
+ type: "button",
2459
+ onClick: F,
2460
+ disabled: !B,
2461
+ className: "border-base-300 text-neutral-content hover:border-error hover:text-error flex size-8 shrink-0 items-center justify-center rounded-md border transition-colors disabled:cursor-not-allowed disabled:opacity-50",
2462
+ "aria-label": o ? "Cannot delete — token is in use" : "Delete token",
2463
+ children: /* @__PURE__ */ t(Jt, { className: "size-3.5", "aria-hidden": !0 })
2464
+ }
2465
+ )
2466
+ ] })
2467
+ ] });
2468
+ }
2469
+ function za({ value: e, onChange: a }) {
2470
+ return /* @__PURE__ */ O("div", { className: "flex flex-col gap-2", children: [
2471
+ /* @__PURE__ */ O("div", { className: "flex items-center gap-2", children: [
2472
+ /* @__PURE__ */ t(
2473
+ "div",
2474
+ {
2475
+ className: "border-base-300 size-8 shrink-0 rounded-md border-2",
2476
+ style: { backgroundColor: e || "transparent" }
2477
+ }
2478
+ ),
2479
+ /* @__PURE__ */ t(
2480
+ "input",
2481
+ {
2482
+ type: "text",
2483
+ value: e,
2484
+ onChange: (s) => a(s.target.value),
2485
+ placeholder: "#3b82f6",
2486
+ className: "border-base-300 bg-base-100 text-base-content focus:border-ring focus:ring-ring flex-1 rounded-md border px-2 py-1.5 text-xs outline-none focus:ring-1",
2487
+ ...ue
2488
+ }
2489
+ )
2490
+ ] }),
2491
+ /* @__PURE__ */ t("div", { className: "overflow-hidden rounded-md", children: /* @__PURE__ */ t(
2492
+ la,
2493
+ {
2494
+ width: "100%",
2495
+ presetColors: [],
2496
+ styles: {
2497
+ picker: {},
2498
+ saturation: {
2499
+ width: "100%",
2500
+ height: "80px",
2501
+ paddingBottom: "",
2502
+ position: "relative",
2503
+ overflow: "hidden"
2504
+ }
2505
+ },
2506
+ color: e || "#000000",
2507
+ onChangeComplete: (s) => a(s.hex)
2508
+ }
2509
+ ) })
2510
+ ] });
2511
+ }
2512
+ const Ie = 360, Ha = 480, Da = /* @__PURE__ */ new Set([
2513
+ "fontSize",
2514
+ "fontWeight",
2515
+ "fontFamily",
2516
+ "lineHeight",
2517
+ "tracking",
2518
+ "letterSpacing",
2519
+ "indent"
2520
+ ]), Fa = /* @__PURE__ */ new Set([
2521
+ "textColor",
2522
+ "backgroundColor",
2523
+ "borderColor",
2524
+ "ringColor",
2525
+ "ringOffsetColor",
2526
+ "outlineColor",
2527
+ "divideColor",
2528
+ "fill",
2529
+ "stroke",
2530
+ "accentColor",
2531
+ "caretColor"
2532
+ ]), _a = /* @__PURE__ */ new Set([
2533
+ "padding",
2534
+ "margin",
2535
+ "gap",
2536
+ "gapX",
2537
+ "gapY",
2538
+ "spaceX",
2539
+ "spaceY",
2540
+ "width",
2541
+ "height",
2542
+ "maxWidth",
2543
+ "maxHeight",
2544
+ "minWidth",
2545
+ "minHeight",
2546
+ "inset",
2547
+ "top",
2548
+ "right",
2549
+ "bottom",
2550
+ "left",
2551
+ "translate",
2552
+ "translateX",
2553
+ "translateY"
2554
+ ]), $a = /* @__PURE__ */ new Set([
2555
+ "w",
2556
+ "h",
2557
+ "m",
2558
+ "p",
2559
+ "mt",
2560
+ "mb",
2561
+ "ml",
2562
+ "mr",
2563
+ "mx",
2564
+ "my",
2565
+ "pt",
2566
+ "pb",
2567
+ "pl",
2568
+ "pr",
2569
+ "px",
2570
+ "py",
2571
+ "gap"
2572
+ ]);
2573
+ function Ra(e, a) {
2574
+ return a && Da.has(a) ? ["typography"] : a && Fa.has(a) ? ["palette", "colors"] : a && _a.has(a) ? ["spacing", "other"] : e && $a.has(e) ? ["spacing", "other"] : e && (e === "bg" || e === "border") ? ["palette", "colors"] : e === "font" ? ["typography"] : null;
2575
+ }
2576
+ function Ga({
2577
+ open: e,
2578
+ onOpenChange: a,
2579
+ anchor: s,
2580
+ ignoreOutsideClicks: l,
2581
+ onSelect: i,
2582
+ currentValue: d,
2583
+ propTag: u,
2584
+ tailwindKey: o
2585
+ }) {
2586
+ const [n, g] = z({ mode: "list" }), p = _e(), [c] = z(() => {
2587
+ var H;
2588
+ const h = (H = s == null ? void 0 : s.current) == null ? void 0 : H.getBoundingClientRect();
2589
+ if (!h) return;
2590
+ const S = typeof window < "u" ? window.innerWidth : 1200, I = h.right + 8 + Ie <= S ? h.right + 8 : Math.max(8, h.left - Ie - 8), L = Math.max(8, h.top);
2591
+ return { x: I, y: L };
2592
+ });
2593
+ if (!e) return null;
2594
+ const r = Ra(u, o), b = n.mode === "list" ? "Design Variables" : n.mode === "create" ? "New Token" : "Edit Token";
2595
+ return /* @__PURE__ */ t(
2596
+ ot,
2597
+ {
2598
+ isOpen: e,
2599
+ onClose: () => a(!1),
2600
+ title: b,
2601
+ icon: /* @__PURE__ */ t(lt, { className: "size-3.5", "aria-hidden": !0 }),
2602
+ storageKey: "universal-input-var-picker",
2603
+ defaultWidth: Ie,
2604
+ defaultHeight: Ha,
2605
+ minWidth: 300,
2606
+ maxWidth: 520,
2607
+ minHeight: 280,
2608
+ maxHeight: 680,
2609
+ initialPosition: c,
2610
+ zIndex: at,
2611
+ autoSize: !1,
2612
+ persistSize: !1,
2613
+ scrollable: !1,
2614
+ ignoreOutsideClicks: l,
2615
+ children: n.mode === "list" ? /* @__PURE__ */ t(
2616
+ ua,
2617
+ {
2618
+ designVars: p,
2619
+ relevantCategories: r,
2620
+ tailwindKey: o,
2621
+ currentValue: d,
2622
+ onSelect: (h) => {
2623
+ i == null || i(h), a(!1);
2624
+ },
2625
+ onEdit: (h) => g({ mode: "edit", token: h }),
2626
+ onCreate: () => g({ mode: "create" })
2627
+ }
2628
+ ) : /* @__PURE__ */ t(
2629
+ Ia,
2630
+ {
2631
+ mode: n.mode,
2632
+ token: n.mode === "edit" ? n.token : void 0,
2633
+ onBack: () => g({ mode: "list" })
2634
+ }
2635
+ )
2636
+ }
2637
+ );
2638
+ }
2639
+ const Wa = (e) => {
2640
+ const {
2641
+ propKey: a,
2642
+ propType: s = "class",
2643
+ propTag: l = "",
2644
+ allowedTypes: i,
2645
+ tailwindOptions: d,
2646
+ tailwindKey: u,
2647
+ index: o = null,
2648
+ propItemKey: n,
2649
+ onChange: g = null,
2650
+ overrideType: p
2651
+ } = e, c = Oe(Qt), r = Oe(ea), b = Oe(ta), h = r.dark ?? !1, {
2652
+ actions: { setProp: S },
2653
+ propValue: P,
2654
+ id: I
2655
+ } = ia((R) => {
2656
+ var G;
2657
+ let $;
2658
+ const Z = ((G = R.data) == null ? void 0 : G.props) || {};
2659
+ return s === "class" ? $ = aa(
2660
+ { propKey: a, propType: s, propItemKey: n, index: o },
2661
+ c,
2662
+ Z,
2663
+ h
2664
+ ).value : $ = ra({ propKey: a, propType: s, propItemKey: n, index: o }, c, Z), {
2665
+ propValue: $,
2666
+ id: R.id
2667
+ };
2668
+ }), { query: L, actions: H } = Fe(), [W, T] = z(!1), [k, N] = z(!1), [x, f] = z(""), [w, v] = z(!1), [B, D] = z(0), [m, A] = z(!1), [U, q] = z(!1), te = ee(null), F = ee(null), y = ee(!1), M = ee(!1), E = P || "", _ = X(() => bt(E, l), [E, l]), J = !i || i.includes("tailwind") ? "tailwind" : i[0] || "px", [j, ae] = z(J);
2669
+ oe(() => {
2670
+ p && !E && ae(p);
2671
+ }, [p]), oe(() => {
2672
+ E ? ae(_.type) : p && ae(p);
2673
+ }, [_.type, E, p]), oe(() => {
2674
+ var $;
2675
+ const R = document.activeElement === te.current;
2676
+ if (M.current && E && (M.current = !1), !(w || R || M.current))
2677
+ switch (_.type) {
2678
+ case "tailwind":
2679
+ f(_.value);
2680
+ break;
2681
+ case "var":
2682
+ f(_.value);
2683
+ break;
2684
+ case "calc":
2685
+ f(_.value);
2686
+ break;
2687
+ case "px":
2688
+ case "em":
2689
+ case "rem":
2690
+ case "%":
2691
+ case "vh":
2692
+ case "vw":
2693
+ case "vmin":
2694
+ case "vmax":
2695
+ f((($ = _.numeric) == null ? void 0 : $.toString()) || _.value);
2696
+ break;
2697
+ default:
2698
+ f(E || "");
2699
+ }
2700
+ }, [E, _, w]);
2701
+ const Q = X(() => d || (u && ce[u] ? ce[u] : l ? it.filter(
2702
+ (R) => typeof R == "string" && R.startsWith(`${l}-`)
2703
+ ) : []), [d, u, l]), de = X(() => {
2704
+ var Z;
2705
+ if (!Q.length) return null;
2706
+ const R = l || ((Z = Q[0]) == null ? void 0 : Z.split("-")[0]) || "", $ = {
2707
+ named: [],
2708
+ numeric: [],
2709
+ fractions: [],
2710
+ tokens: [],
2711
+ other: []
2712
+ };
2713
+ if (l === "cursor" || a === "cursor") {
2714
+ const G = [
2715
+ "cursor-auto",
2716
+ "cursor-default",
2717
+ "cursor-pointer",
2718
+ "cursor-wait",
2719
+ "cursor-text",
2720
+ "cursor-move",
2721
+ "cursor-not-allowed",
2722
+ "cursor-grab",
2723
+ "cursor-grabbing"
2724
+ ];
2725
+ return Q.forEach((Y) => {
2726
+ G.includes(Y) ? $.named.push(Y) : $.other.push(Y);
2727
+ }), $;
2728
+ }
2729
+ return Q.forEach((G) => {
2730
+ const Y = G.replace(`${R}-`, ""), re = Y === G;
2731
+ ft(G, R) ? $.tokens.push(G) : re || ["full", "screen", "auto", "min", "max", "fit", "none"].includes(Y) ? $.named.push(G) : Y.includes("/") ? $.fractions.push(G) : /^[\d.]+$/.test(Y) || Y === "px" ? $.numeric.push(G) : $.other.push(G);
2732
+ }), $;
2733
+ }, [Q, l, a]), me = X(() => {
2734
+ if (!x || !w || x === E || x === _.value)
2735
+ return null;
2736
+ const R = x.toLowerCase();
2737
+ return Q.filter(($) => $.toLowerCase().includes(R));
2738
+ }, [x, Q, w, E, _.value]);
2739
+ return {
2740
+ // State
2741
+ showAutocomplete: W,
2742
+ setShowAutocomplete: T,
2743
+ showCalcDialog: k,
2744
+ setShowCalcDialog: N,
2745
+ inputValue: x,
2746
+ setInputValue: f,
2747
+ isEditing: w,
2748
+ setIsEditing: v,
2749
+ selectedIndex: B,
2750
+ setSelectedIndex: D,
2751
+ kbdNavActive: m,
2752
+ setKbdNavActive: A,
2753
+ isTypeSelectorOpen: U,
2754
+ setIsTypeSelectorOpen: q,
2755
+ selectedType: j,
2756
+ setSelectedType: ae,
2757
+ // Refs
2758
+ inputRef: te,
2759
+ typeSelectorRef: F,
2760
+ skipBlurCommitRef: y,
2761
+ pendingUpdateRef: M,
2762
+ // Computed values
2763
+ currentValue: E,
2764
+ parsed: _,
2765
+ availableTailwindOptions: Q,
2766
+ organizedOptions: de,
2767
+ filteredOptions: me,
2768
+ // Handlers
2769
+ handleChange: (R, $) => {
2770
+ const Z = $ || j;
2771
+ let G = Z, Y = R;
2772
+ if (!$ && R && Z !== "calc" && Z !== "tailwind") {
2773
+ if (R.endsWith("%"))
2774
+ G = "%", Y = R.slice(0, -1);
2775
+ else
2776
+ for (const ne of he)
2777
+ if (ne !== "%" && R.endsWith(ne)) {
2778
+ G = ne, Y = R.slice(0, -ne.length);
2779
+ break;
2780
+ }
2781
+ }
2782
+ G !== j && ae(G);
2783
+ const re = gt(Y, G, l);
2784
+ M.current = !0, s === "class" ? na(r, c, b).forEach((Ce) => {
2785
+ Ye({
2786
+ setProp: S,
2787
+ propKey: a,
2788
+ value: re,
2789
+ propType: s,
2790
+ view: Ce,
2791
+ index: o,
2792
+ propItemKey: n,
2793
+ onChange: g,
2794
+ query: L,
2795
+ actions: H,
2796
+ nodeId: I,
2797
+ classDark: h
2798
+ });
2799
+ }) : Ye({
2800
+ setProp: S,
2801
+ propKey: a,
2802
+ value: re,
2803
+ propType: s,
2804
+ view: c,
2805
+ index: o,
2806
+ propItemKey: n,
2807
+ onChange: g,
2808
+ query: L,
2809
+ actions: H,
2810
+ nodeId: I
2811
+ }), setTimeout(() => {
2812
+ M.current && (M.current = !1);
2813
+ }, 500);
2814
+ },
2815
+ // CraftJS data
2816
+ id: I,
2817
+ view: c,
2818
+ modifiers: r,
2819
+ multiScope: b,
2820
+ query: L,
2821
+ actions: H
2822
+ };
2823
+ };
2824
+ function Ka(e) {
2825
+ const {
2826
+ label: a,
2827
+ labelPrefix: s,
2828
+ labelSuffix: l,
2829
+ labelHide: i = !1,
2830
+ labelWidth: d = "",
2831
+ inputWidth: u = "",
2832
+ placeholder: o = "Enter value",
2833
+ showVarSelector: n = !0,
2834
+ allowedTypes: g,
2835
+ wrap: p = "",
2836
+ index: c = null,
2837
+ propItemKey: r,
2838
+ inline: b = !0,
2839
+ propType: h = "class",
2840
+ propKey: S,
2841
+ propTag: P,
2842
+ tailwindKey: I,
2843
+ hideTypeSelector: L = !1
2844
+ } = e, H = Wa(e), W = xt({ ...H, showVarSelector: n }), T = _e();
2845
+ return /* @__PURE__ */ t(
2846
+ ht,
2847
+ {
2848
+ label: a,
2849
+ labelPrefix: s,
2850
+ labelSuffix: l,
2851
+ labelHide: i,
2852
+ labelWidth: d,
2853
+ inputWidth: u,
2854
+ placeholder: o,
2855
+ showVarSelector: n,
2856
+ allowedTypes: g,
2857
+ wrap: p,
2858
+ index: c,
2859
+ propItemKey: r,
2860
+ inline: b,
2861
+ propType: h,
2862
+ propKey: S,
2863
+ propTag: P,
2864
+ tailwindKey: I,
2865
+ hideTypeSelector: L,
2866
+ renderBreakpointPills: !0,
2867
+ state: H,
2868
+ handlers: W,
2869
+ designVars: T
2870
+ }
2871
+ );
2872
+ }
2873
+ export {
2874
+ Ka as U
2875
+ };