@orbitcommerce/constellation-docs 0.0.0-stage → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. package/LICENSE.md +6 -0
  2. package/README.md +6 -2
  3. package/dist/docs.css +20787 -0
  4. package/dist/index.d.ts +33 -0
  5. package/dist/index.js +308 -0
  6. package/dist/pages/Playground-Mk1yIWXb.js +129 -0
  7. package/dist/pages/_address-data-L9BR499w.js +161 -0
  8. package/dist/pages/_builder-demo-C0eJUmPU.js +282 -0
  9. package/dist/pages/_card-art-0be5ncyV.js +18 -0
  10. package/dist/pages/_conversation-samples-Bq7cn-4d.js +70 -0
  11. package/dist/pages/_figures-data-DaDvB7Nm.js +606 -0
  12. package/dist/pages/_foundations-blXWyYh8.js +30 -0
  13. package/dist/pages/_kpi-examples-DeGCBB9T.js +208 -0
  14. package/dist/pages/_overlays-specimens-bawR331Z.js +320 -0
  15. package/dist/pages/_preview-specimens-DKQC9HAo.js +153 -0
  16. package/dist/pages/accordion-Sg0TUqxB.js +1036 -0
  17. package/dist/pages/address-autocomplete-DP0PUOlK.js +360 -0
  18. package/dist/pages/address-block-BZOOOPA9.js +368 -0
  19. package/dist/pages/address-fields-CwSqro3W.js +277 -0
  20. package/dist/pages/ai-highlight-D3x2vD83.js +642 -0
  21. package/dist/pages/alert-D3i7xZTU.js +914 -0
  22. package/dist/pages/anchored-overlay-BV0OCu2Q.js +788 -0
  23. package/dist/pages/app-shell-D4hdlHps.js +1558 -0
  24. package/dist/pages/area-chart-BEWFwiB2.js +718 -0
  25. package/dist/pages/avatar-BFEqQViw.js +895 -0
  26. package/dist/pages/avatar-upload-BDCzJfyN.js +484 -0
  27. package/dist/pages/badge-0-PyMrih.js +1035 -0
  28. package/dist/pages/bar-chart-DkLogYlt.js +1060 -0
  29. package/dist/pages/bar-fold-B-3XeIDZ.js +360 -0
  30. package/dist/pages/board-card-D2tZY_mU.js +415 -0
  31. package/dist/pages/brand-mark-BqiLvFSR.js +417 -0
  32. package/dist/pages/button-DAyfssDY.js +715 -0
  33. package/dist/pages/calendar-Ds7KsgSI.js +682 -0
  34. package/dist/pages/canvas-stage-1KiPspkX.js +472 -0
  35. package/dist/pages/card-CQEM1_wc.js +1567 -0
  36. package/dist/pages/caret-suggestions-oHI6QvqW.js +526 -0
  37. package/dist/pages/chart-legend-B20AbakD.js +724 -0
  38. package/dist/pages/chat-composer-CwzUJYIa.js +437 -0
  39. package/dist/pages/checkbox-BG9Zkb6j.js +1581 -0
  40. package/dist/pages/checklist-card-DEyykVFS.js +783 -0
  41. package/dist/pages/chip-Ck-o3Ui6.js +839 -0
  42. package/dist/pages/chip-list-k1LxXuCi.js +414 -0
  43. package/dist/pages/clamp-text-n-iE8RDR.js +203 -0
  44. package/dist/pages/coachmark-Be2ghobT.js +366 -0
  45. package/dist/pages/code-block-Dv_Y5GYq.js +622 -0
  46. package/dist/pages/collab-field-CfqqK7d2.js +696 -0
  47. package/dist/pages/color-field-CZpfcA-A.js +1127 -0
  48. package/dist/pages/colour-q2ntvI0w.js +1974 -0
  49. package/dist/pages/column-mapper-TsTG39cl.js +502 -0
  50. package/dist/pages/combobox-DvK2j5tI.js +1334 -0
  51. package/dist/pages/command-palette-CJ7uBA04.js +1386 -0
  52. package/dist/pages/comment-box-CDSGYhr5.js +346 -0
  53. package/dist/pages/composer-D4B0NgpA.js +689 -0
  54. package/dist/pages/condition-builder-BZy2ZGXe.js +715 -0
  55. package/dist/pages/conflict-chooser-C--_9UIS.js +210 -0
  56. package/dist/pages/context-menu-F9DV30ia.js +487 -0
  57. package/dist/pages/copy-button-Cn7WiKRF.js +568 -0
  58. package/dist/pages/copy-field-D3Xt3Jq6.js +511 -0
  59. package/dist/pages/danger-zone-Db_UUeiP.js +564 -0
  60. package/dist/pages/date-input-GOW067EB.js +956 -0
  61. package/dist/pages/date-picker-GdBciR99.js +1569 -0
  62. package/dist/pages/date-time-BLKCXtVZ.js +678 -0
  63. package/dist/pages/delta-CNAGv8JY.js +779 -0
  64. package/dist/pages/description-list-BPeXn1eW.js +1268 -0
  65. package/dist/pages/device-switcher-BCaN99c1.js +554 -0
  66. package/dist/pages/dialog-CRpkRC98.js +3164 -0
  67. package/dist/pages/docs-lM2UBSir.js +520 -0
  68. package/dist/pages/doodle-nzkqi2UI.js +201 -0
  69. package/dist/pages/drag-ghost-B6kpzC3O.js +426 -0
  70. package/dist/pages/drill-menu-cskH5mol.js +490 -0
  71. package/dist/pages/dropzone-DOY_Rhw0.js +1069 -0
  72. package/dist/pages/element-toolbar-DZIhXlCJ.js +498 -0
  73. package/dist/pages/emoji-picker-CqaWaffD.js +235 -0
  74. package/dist/pages/empty-state-4U2txFpI.js +1113 -0
  75. package/dist/pages/facet-filters-McbBeY9e.js +353 -0
  76. package/dist/pages/figure-D-HF5vCj.js +563 -0
  77. package/dist/pages/figure-strip-BB3mNl7D.js +1364 -0
  78. package/dist/pages/figure-tabs-QOeQMY6N.js +578 -0
  79. package/dist/pages/file-chip-DMDjtlqQ.js +738 -0
  80. package/dist/pages/filter-pill-DzqNOsD4.js +1295 -0
  81. package/dist/pages/font-picker-Bqhu0QMh.js +416 -0
  82. package/dist/pages/form-grid-BfWCVlie.js +692 -0
  83. package/dist/pages/gallery-BBk2EOri.js +453 -0
  84. package/dist/pages/gif-picker-CnoDTCaL.js +270 -0
  85. package/dist/pages/gradient-editor-Bqxp7Fxj.js +378 -0
  86. package/dist/pages/grouped-checklist-gNZ0tBKU.js +477 -0
  87. package/dist/pages/heatmap-BohgIcNk.js +507 -0
  88. package/dist/pages/highlight-text-BfxzfmvS.js +287 -0
  89. package/dist/pages/home-dashboard-CxPmvduE.js +962 -0
  90. package/dist/pages/host-B6znjEgQ.js +109 -0
  91. package/dist/pages/hosted-embed-Jef3aIMP.js +163 -0
  92. package/dist/pages/hosted-field-BLh-53AE.js +208 -0
  93. package/dist/pages/hosted-field-DEpI4lVS.js +514 -0
  94. package/dist/pages/icon-button-Bu4Gj5sy.js +1200 -0
  95. package/dist/pages/icon-picker-DEyoMUTh.js +291 -0
  96. package/dist/pages/icon-tile-DcgxyXPF.js +592 -0
  97. package/dist/pages/icons-CJ9Aar3d.js +736 -0
  98. package/dist/pages/image-cropper-NyougqLH.js +466 -0
  99. package/dist/pages/image-field-7knBv4mJ.js +567 -0
  100. package/dist/pages/import-result-CmTtGXW_.js +486 -0
  101. package/dist/pages/inline-confirm-CEcI5Lxo.js +327 -0
  102. package/dist/pages/inline-edit-Ba39SzhM.js +1125 -0
  103. package/dist/pages/input-CzLCzfyx.js +2372 -0
  104. package/dist/pages/installation-C3UcpQJT.js +528 -0
  105. package/dist/pages/job-indicator-DOXWbFdl.js +755 -0
  106. package/dist/pages/kanban-Dy9sPAI0.js +740 -0
  107. package/dist/pages/kbd-UNj4zqxn.js +545 -0
  108. package/dist/pages/layout-primitives-CPRaZeyt.js +483 -0
  109. package/dist/pages/line-chart-CntWxeMF.js +1117 -0
  110. package/dist/pages/link-CXqvAg9z.js +689 -0
  111. package/dist/pages/link-picker-BMFGCC67.js +478 -0
  112. package/dist/pages/link-row-x8yaUuWc.js +595 -0
  113. package/dist/pages/live-globe-95ROMhGQ.js +715 -0
  114. package/dist/pages/loading-overlay-BeGuXM9G.js +456 -0
  115. package/dist/pages/loading-state-BNbCo51C.js +556 -0
  116. package/dist/pages/log-viewer-BQz8I_a2.js +503 -0
  117. package/dist/pages/logo-B38rnzoq.js +571 -0
  118. package/dist/pages/lottie_light-CxEH8eiR.js +9116 -0
  119. package/dist/pages/markdown-Ied72vMT.js +237 -0
  120. package/dist/pages/markdown-field-BfnIEKZH.js +193 -0
  121. package/dist/pages/media-banner-DkStCia0.js +233 -0
  122. package/dist/pages/menu-NrLYKqKp.js +2132 -0
  123. package/dist/pages/message-thread-Bo4zbxqu.js +731 -0
  124. package/dist/pages/meta-line-D5p2TycR.js +371 -0
  125. package/dist/pages/model-viewer-BfokvHoc.js +60288 -0
  126. package/dist/pages/model-viewer-C8PFO8wk.js +577 -0
  127. package/dist/pages/month-calendar-T1vw9Rup.js +457 -0
  128. package/dist/pages/motion-CrXtiBvA.js +865 -0
  129. package/dist/pages/number-input-CuyMZg18.js +968 -0
  130. package/dist/pages/orbit-loader-DeVBtkFE.js +219 -0
  131. package/dist/pages/orbit-spinner-Dxv5qAhr.js +348 -0
  132. package/dist/pages/otp-input-CVRoX1mw.js +591 -0
  133. package/dist/pages/overview-LA9XRhZc.js +130 -0
  134. package/dist/pages/package-dimensions-DFCyZj_T.js +192 -0
  135. package/dist/pages/pagination-C1EgVtW4.js +294 -0
  136. package/dist/pages/palette-tile-X9ZXu2Z0.js +414 -0
  137. package/dist/pages/password-field-DHEQKyUC.js +912 -0
  138. package/dist/pages/person-cell-BmjbADBz.js +564 -0
  139. package/dist/pages/phone-input-B3G7Qpb2.js +747 -0
  140. package/dist/pages/plan-card-DRaA6RuB.js +621 -0
  141. package/dist/pages/plan-card-DtloWvMh.js +258 -0
  142. package/dist/pages/plan-comparison-BVIGTtbd.js +559 -0
  143. package/dist/pages/plan-grid-cfPVTB5V.js +251 -0
  144. package/dist/pages/point-list-BbPmZjsm.js +222 -0
  145. package/dist/pages/popover-C3Oar9D5.js +1198 -0
  146. package/dist/pages/presence-avatars-CRZIk8n9.js +328 -0
  147. package/dist/pages/preview-frame-Bcwk0y_Q.js +1631 -0
  148. package/dist/pages/price-CRBLoa9h.js +604 -0
  149. package/dist/pages/principles-pnDyfHpK.js +483 -0
  150. package/dist/pages/print-page-BkLv6bW8.js +513 -0
  151. package/dist/pages/profile-hero-CC9dUzuN.js +498 -0
  152. package/dist/pages/progress-CP_awmo4.js +904 -0
  153. package/dist/pages/progress-ring-JuOAwk2T.js +576 -0
  154. package/dist/pages/radio-group-C-4tg6FS.js +1639 -0
  155. package/dist/pages/radius-control-B2kRA2Ch.js +441 -0
  156. package/dist/pages/rating-CweKN2SX.js +471 -0
  157. package/dist/pages/record-layout-DUP_X0RL.js +719 -0
  158. package/dist/pages/record-pager-y9D7JFgb.js +278 -0
  159. package/dist/pages/registry-BZg-xAbi.js +594 -0
  160. package/dist/pages/release-Cs6tl16C.js +16 -0
  161. package/dist/pages/repeater-BRZYKRQa.js +1351 -0
  162. package/dist/pages/reply-feedback-BDnHprla.js +192 -0
  163. package/dist/pages/reveal-BygENBbL.js +460 -0
  164. package/dist/pages/rich-text-DOFQZEpT.js +156 -0
  165. package/dist/pages/rich-text-editor-BhIM20JI.js +1265 -0
  166. package/dist/pages/rolldown-runtime-CbKu08Hx.js +25 -0
  167. package/dist/pages/rolling-number-GR3Cyfpz.js +529 -0
  168. package/dist/pages/row-list-Dl6CYhC-.js +1565 -0
  169. package/dist/pages/rule-list-DTCmIMpT.js +648 -0
  170. package/dist/pages/save-status-B5KkyMZP.js +378 -0
  171. package/dist/pages/schedule-YycI95O1.js +243 -0
  172. package/dist/pages/scroll-area-B2sGm23Q.js +423 -0
  173. package/dist/pages/search-field-D1uG7R6A.js +693 -0
  174. package/dist/pages/search-menu-DMuXyUUW.js +580 -0
  175. package/dist/pages/secret-field-Dj9x3LL8.js +337 -0
  176. package/dist/pages/section-rail-BtTCETS5.js +637 -0
  177. package/dist/pages/section-v2Pubup9.js +639 -0
  178. package/dist/pages/segmented-control-D-FB1K1T.js +1190 -0
  179. package/dist/pages/select-DZ43NpOm.js +1434 -0
  180. package/dist/pages/selection-chrome-Czcs6RN6.js +437 -0
  181. package/dist/pages/separator-CFwqRvfO.js +428 -0
  182. package/dist/pages/serp-preview-BGwORjmo.js +346 -0
  183. package/dist/pages/setting-row-Bt-dZV8H.js +913 -0
  184. package/dist/pages/shape-DzniHAVT.js +627 -0
  185. package/dist/pages/share-list-D4wgBxKN.js +926 -0
  186. package/dist/pages/side-panel-CCtkrZjs.js +811 -0
  187. package/dist/pages/site-preview-Dj1hM2Yo.js +353 -0
  188. package/dist/pages/skeleton-C1F5HkAu.js +1325 -0
  189. package/dist/pages/skip-link-BxznhSkz.js +252 -0
  190. package/dist/pages/slider-CAoPURKD.js +774 -0
  191. package/dist/pages/sortable-card-Sr44uCpI.js +424 -0
  192. package/dist/pages/sortable-list-DUAleYE1.js +1298 -0
  193. package/dist/pages/sortable-tree-BLzK-hTE.js +737 -0
  194. package/dist/pages/spacing-box-CtuvzxQu.js +550 -0
  195. package/dist/pages/sparkline-D3aavCly.js +947 -0
  196. package/dist/pages/split-bar-DYgZnFID.js +414 -0
  197. package/dist/pages/split-button-Be08-VI-.js +335 -0
  198. package/dist/pages/split-pane-lSNZgTKt.js +523 -0
  199. package/dist/pages/status-badge-DOdNhmzn.js +1074 -0
  200. package/dist/pages/status-checklist-CWkjCZIC.js +1152 -0
  201. package/dist/pages/status-dot-D99gAGsV.js +567 -0
  202. package/dist/pages/stepper-CxKTbEA-.js +1093 -0
  203. package/dist/pages/success-mark-CqFTOBEu.js +142 -0
  204. package/dist/pages/swatch-H_kNvHuC.js +565 -0
  205. package/dist/pages/switch-C93K6j9h.js +617 -0
  206. package/dist/pages/table-CL0vomno.js +3225 -0
  207. package/dist/pages/tabs-Dh0mUsLw.js +1690 -0
  208. package/dist/pages/tag-input-BjZWKKRJ.js +1307 -0
  209. package/dist/pages/task-card-Dv0sR1-w.js +295 -0
  210. package/dist/pages/textarea-CCM-SnGN.js +949 -0
  211. package/dist/pages/thumbnail-DwFJL_k1.js +1147 -0
  212. package/dist/pages/time-input-CA9-uZAa.js +442 -0
  213. package/dist/pages/time-zone-select-CEtMXVYO.js +296 -0
  214. package/dist/pages/timeline-BsMUTlpR.js +1798 -0
  215. package/dist/pages/toast-zXLRiMRT.js +1391 -0
  216. package/dist/pages/tool-rail-B1AbTMCP.js +355 -0
  217. package/dist/pages/toolbar-B9l_fHKy.js +754 -0
  218. package/dist/pages/tooltip-LHtCUkF-.js +826 -0
  219. package/dist/pages/translation-field-CTRXiF2N.js +251 -0
  220. package/dist/pages/tree-checklist-CJj3OcLg.js +451 -0
  221. package/dist/pages/tree-select-DU1qXHy_.js +492 -0
  222. package/dist/pages/tree-view-g_RjLtAb.js +739 -0
  223. package/dist/pages/typography-BSijtiRl.js +876 -0
  224. package/dist/pages/unit-input-Dml4fjmK.js +659 -0
  225. package/dist/pages/upload-rules-yozEzSah.js +419 -0
  226. package/dist/pages/url-upload-input-SSnMgfpA.js +307 -0
  227. package/dist/pages/value-change-CnubDKyO.js +489 -0
  228. package/dist/pages/weekly-hours-i2EpsmTx.js +287 -0
  229. package/dist/pages/widget-preview-CUJMyZ_k.js +625 -0
  230. package/dist/pages/working-status-CENemSsw.js +389 -0
  231. package/manifest.json +13001 -0
  232. package/package.json +35 -4
@@ -0,0 +1,282 @@
1
+ "use client";
2
+ import { useRef, useState } from "react";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ import { DragGhost, DropIndicator, PaletteGrid, PaletteTile } from "@orbitcommerce/constellation";
5
+ //#region src/pages/components/_builder-demo.tsx
6
+ var DEMO_ELEMENTS = [
7
+ {
8
+ id: "heading",
9
+ label: "Heading",
10
+ description: "A title for a section",
11
+ icon: "Heading"
12
+ },
13
+ {
14
+ id: "text",
15
+ label: "Text",
16
+ description: "A paragraph of rich text",
17
+ icon: "Type"
18
+ },
19
+ {
20
+ id: "image",
21
+ label: "Image",
22
+ description: "A picture with alt text",
23
+ icon: "Image"
24
+ },
25
+ {
26
+ id: "button",
27
+ label: "Button",
28
+ description: "A link styled as a button",
29
+ icon: "MousePointerClick"
30
+ },
31
+ {
32
+ id: "columns",
33
+ label: "Columns",
34
+ description: "Content side by side",
35
+ icon: "Columns"
36
+ },
37
+ {
38
+ id: "spacer",
39
+ label: "Spacer",
40
+ description: "Room between two blocks",
41
+ icon: "MoveVertical"
42
+ },
43
+ {
44
+ id: "gallery",
45
+ label: "Image gallery",
46
+ description: "Pictures in a sliding row",
47
+ icon: "GalleryHorizontal"
48
+ },
49
+ {
50
+ id: "video",
51
+ label: "Video",
52
+ description: "A video from YouTube or Vimeo",
53
+ icon: "Video"
54
+ },
55
+ {
56
+ id: "testimonial",
57
+ label: "Customer testimonial",
58
+ description: "A quote from a happy customer",
59
+ icon: "Quote"
60
+ }
61
+ ];
62
+ var DEMO_PAGE = [
63
+ {
64
+ id: "hero",
65
+ name: "Hero banner",
66
+ kind: "hero"
67
+ },
68
+ {
69
+ id: "best-sellers",
70
+ name: "Best sellers",
71
+ kind: "grid"
72
+ },
73
+ {
74
+ id: "newsletter",
75
+ name: "Newsletter sign-up",
76
+ kind: "newsletter"
77
+ }
78
+ ];
79
+ /** A block's look on the canvas: drawn shapes, no images. */
80
+ function DemoShapes({ kind }) {
81
+ if (kind === "hero") return /* @__PURE__ */ jsxs("span", {
82
+ className: "builder-demo-shapes",
83
+ "data-hero": "",
84
+ children: [
85
+ /* @__PURE__ */ jsx("span", {
86
+ className: "builder-demo-shape",
87
+ "data-w": "60",
88
+ "data-strong": "",
89
+ "data-tall": ""
90
+ }),
91
+ /* @__PURE__ */ jsx("span", {
92
+ className: "builder-demo-shape",
93
+ "data-w": "40"
94
+ }),
95
+ /* @__PURE__ */ jsx("span", {
96
+ className: "builder-demo-shape",
97
+ "data-w": "20",
98
+ "data-pill": ""
99
+ })
100
+ ]
101
+ });
102
+ if (kind === "grid") return /* @__PURE__ */ jsx("span", {
103
+ className: "builder-demo-tiles",
104
+ children: [
105
+ 0,
106
+ 1,
107
+ 2,
108
+ 3
109
+ ].map((tile) => /* @__PURE__ */ jsx("span", { className: "builder-demo-tile" }, tile))
110
+ });
111
+ if (kind === "newsletter") return /* @__PURE__ */ jsxs("span", {
112
+ className: "builder-demo-shapes",
113
+ "data-row": "",
114
+ children: [/* @__PURE__ */ jsx("span", {
115
+ className: "builder-demo-shape",
116
+ "data-w": "40",
117
+ "data-strong": ""
118
+ }), /* @__PURE__ */ jsx("span", {
119
+ className: "builder-demo-shape",
120
+ "data-w": "20",
121
+ "data-pill": ""
122
+ })]
123
+ });
124
+ if (kind === "header") return /* @__PURE__ */ jsxs("span", {
125
+ className: "builder-demo-shapes",
126
+ "data-row": "",
127
+ "data-spread": "",
128
+ children: [/* @__PURE__ */ jsx("span", {
129
+ className: "builder-demo-shape",
130
+ "data-w": "20",
131
+ "data-strong": ""
132
+ }), /* @__PURE__ */ jsx("span", {
133
+ className: "builder-demo-shape",
134
+ "data-w": "40"
135
+ })]
136
+ });
137
+ if (kind === "footer") return /* @__PURE__ */ jsx("span", {
138
+ className: "builder-demo-shapes",
139
+ "data-columns": "",
140
+ children: [
141
+ 0,
142
+ 1,
143
+ 2
144
+ ].map((column) => /* @__PURE__ */ jsxs("span", {
145
+ className: "builder-demo-shapes",
146
+ children: [/* @__PURE__ */ jsx("span", {
147
+ className: "builder-demo-shape",
148
+ "data-w": "60",
149
+ "data-strong": ""
150
+ }), /* @__PURE__ */ jsx("span", {
151
+ className: "builder-demo-shape",
152
+ "data-w": "40"
153
+ })]
154
+ }, column))
155
+ });
156
+ return /* @__PURE__ */ jsxs("span", {
157
+ className: "builder-demo-shapes",
158
+ children: [
159
+ /* @__PURE__ */ jsx("span", {
160
+ className: "builder-demo-shape",
161
+ "data-w": "60",
162
+ "data-strong": ""
163
+ }),
164
+ /* @__PURE__ */ jsx("span", {
165
+ className: "builder-demo-shape",
166
+ "data-w": "80"
167
+ }),
168
+ /* @__PURE__ */ jsx("span", {
169
+ className: "builder-demo-shape",
170
+ "data-w": "60"
171
+ })
172
+ ]
173
+ });
174
+ }
175
+ var ELEMENT_TYPE = "application/x-orbit-element";
176
+ /**
177
+ * A palette beside an invented page: drag a tile onto the page and a line shows where it lands (DropIndicator), the
178
+ * tile's copy riding under the pointer (DragGhost); a press, Enter or Space adds it at the end. A polite status says
179
+ * what was added, where.
180
+ */
181
+ function PaletteDropDemo({ columns = 2 }) {
182
+ const [blocks, setBlocks] = useState(DEMO_PAGE);
183
+ const [drop, setDrop] = useState(null);
184
+ const [said, setSaid] = useState("");
185
+ const count = useRef(0);
186
+ const add = (element, index) => {
187
+ count.current += 1;
188
+ const block = {
189
+ id: `${element.id}-${count.current}`,
190
+ name: element.label,
191
+ kind: "text"
192
+ };
193
+ setBlocks((current) => [
194
+ ...current.slice(0, index),
195
+ block,
196
+ ...current.slice(index)
197
+ ]);
198
+ const after = blocks[index - 1];
199
+ setSaid(after ? `${element.label} added after ${after.name}` : `${element.label} added at the top`);
200
+ };
201
+ const onDragOver = (event) => {
202
+ if (!event.dataTransfer.types.includes(ELEMENT_TYPE)) return;
203
+ event.preventDefault();
204
+ event.dataTransfer.dropEffect = "copy";
205
+ const under = event.target.closest("[data-block]");
206
+ const rows = [...event.currentTarget.querySelectorAll("[data-block]")];
207
+ const target = under ?? rows[rows.length - 1];
208
+ if (!target) return;
209
+ const box = target.getBoundingClientRect();
210
+ const placement = event.clientY < box.top + box.height / 2 ? "before" : "after";
211
+ const index = rows.indexOf(target) + (placement === "after" ? 1 : 0);
212
+ if (drop && drop.target === target && drop.placement === placement) return;
213
+ setDrop({
214
+ target,
215
+ placement,
216
+ index
217
+ });
218
+ };
219
+ const onDrop = (event) => {
220
+ const id = event.dataTransfer.getData(ELEMENT_TYPE);
221
+ const element = DEMO_ELEMENTS.find((item) => item.id === id);
222
+ event.preventDefault();
223
+ if (element) add(element, drop?.index ?? blocks.length);
224
+ setDrop(null);
225
+ };
226
+ return /* @__PURE__ */ jsxs("div", {
227
+ className: "builder-demo",
228
+ "data-columns": columns,
229
+ children: [
230
+ /* @__PURE__ */ jsxs("div", {
231
+ className: "builder-demo__panel",
232
+ children: [/* @__PURE__ */ jsx("p", {
233
+ className: "builder-demo__panel-title",
234
+ children: "Elements"
235
+ }), /* @__PURE__ */ jsx(PaletteGrid, {
236
+ label: "Basic",
237
+ columns,
238
+ children: DEMO_ELEMENTS.slice(0, columns === 3 ? 9 : 6).map((element, index) => /* @__PURE__ */ jsx(PaletteTile, {
239
+ label: element.label,
240
+ description: element.description,
241
+ icon: element.icon,
242
+ index,
243
+ dragData: { [ELEMENT_TYPE]: element.id },
244
+ dragId: element.id,
245
+ dragImage: "none",
246
+ onAdd: () => add(element, blocks.length),
247
+ onDragEnd: () => setDrop(null)
248
+ }, element.id))
249
+ })]
250
+ }),
251
+ /* @__PURE__ */ jsx("div", {
252
+ className: "builder-demo__canvas",
253
+ onDragOver,
254
+ onDragLeave: (event) => {
255
+ if (!event.currentTarget.contains(event.relatedTarget)) setDrop(null);
256
+ },
257
+ onDrop,
258
+ children: blocks.map((block) => /* @__PURE__ */ jsxs("div", {
259
+ className: "builder-demo__block",
260
+ "data-block": block.id,
261
+ "data-kind": block.kind,
262
+ children: [/* @__PURE__ */ jsx("span", {
263
+ className: "builder-demo__block-name",
264
+ children: block.name
265
+ }), /* @__PURE__ */ jsx(DemoShapes, { kind: block.kind })]
266
+ }, block.id))
267
+ }),
268
+ /* @__PURE__ */ jsx(DropIndicator, {
269
+ target: drop?.target,
270
+ placement: drop?.placement
271
+ }),
272
+ /* @__PURE__ */ jsx(DragGhost, { variant: "tile" }),
273
+ /* @__PURE__ */ jsx("span", {
274
+ className: "o-sr-only",
275
+ role: "status",
276
+ children: said
277
+ })
278
+ ]
279
+ });
280
+ }
281
+ //#endregion
282
+ export { PaletteDropDemo as i, DEMO_PAGE as n, DemoShapes as r, DEMO_ELEMENTS as t };
@@ -0,0 +1,18 @@
1
+ "use client";
2
+ //#region src/pages/components/_card-art.tsx
3
+ var svgUrl = (markup) => `data:image/svg+xml,${encodeURIComponent(markup)}`;
4
+ /** A showroom: a warm wall, a window of light, a desk and a lamp. 16:9. */
5
+ var showroomUrl = svgUrl("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 180\"><rect width=\"320\" height=\"180\" fill=\"#e9dfd0\"/><rect x=\"196\" y=\"22\" width=\"92\" height=\"96\" rx=\"4\" fill=\"#f6efe4\"/><path d=\"M242 22v96M196 70h92\" stroke=\"#dccfbb\" stroke-width=\"3\"/><rect y=\"132\" width=\"320\" height=\"48\" fill=\"#c9b79c\"/><rect x=\"58\" y=\"96\" width=\"132\" height=\"10\" rx=\"3\" fill=\"#8a6033\"/><path d=\"M70 106v40M178 106v40\" stroke=\"#6f4d29\" stroke-width=\"6\" stroke-linecap=\"round\"/><path d=\"M98 96V58\" stroke=\"#5a6b74\" stroke-width=\"3\"/><path d=\"M84 66h28l-6-16H90z\" fill=\"#d8a94e\"/><rect x=\"132\" y=\"70\" width=\"40\" height=\"26\" rx=\"3\" fill=\"#3f4e57\"/></svg>");
6
+ svgUrl("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 180\"><rect width=\"320\" height=\"180\" fill=\"#dfe8e6\"/><rect x=\"92\" y=\"44\" width=\"128\" height=\"84\" rx=\"8\" fill=\"#3f4e57\"/><rect x=\"100\" y=\"52\" width=\"112\" height=\"64\" rx=\"3\" fill=\"#9fc3bd\"/><circle cx=\"262\" cy=\"56\" r=\"22\" fill=\"#7d9c88\"/><circle cx=\"252\" cy=\"48\" r=\"12\" fill=\"#5f8a6c\"/><rect x=\"246\" y=\"78\" width=\"32\" height=\"28\" rx=\"6\" fill=\"#c97a4a\"/><circle cx=\"58\" cy=\"130\" r=\"16\" fill=\"#f4f1ea\"/><circle cx=\"58\" cy=\"130\" r=\"10\" fill=\"#8a6033\"/></svg>");
7
+ /** A storefront home page, as a theme's screenshot: a header, a hero, a row of products. 16:10. */
8
+ var storefrontShotUrl = svgUrl("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 200\"><rect width=\"320\" height=\"200\" fill=\"#fbfaf7\"/><rect width=\"320\" height=\"22\" fill=\"#ffffff\"/><rect x=\"14\" y=\"8\" width=\"44\" height=\"6\" rx=\"3\" fill=\"#1f2a30\"/><rect x=\"214\" y=\"8\" width=\"24\" height=\"6\" rx=\"3\" fill=\"#b7bfc4\"/><rect x=\"246\" y=\"8\" width=\"24\" height=\"6\" rx=\"3\" fill=\"#b7bfc4\"/><rect x=\"278\" y=\"8\" width=\"28\" height=\"6\" rx=\"3\" fill=\"#b7bfc4\"/><rect y=\"22\" width=\"320\" height=\"92\" fill=\"#e4d9c8\"/><rect x=\"24\" y=\"48\" width=\"120\" height=\"12\" rx=\"4\" fill=\"#2b2420\"/><rect x=\"24\" y=\"66\" width=\"88\" height=\"7\" rx=\"3\" fill=\"#6e6358\"/><rect x=\"24\" y=\"84\" width=\"56\" height=\"16\" rx=\"8\" fill=\"#2b2420\"/><rect x=\"186\" y=\"36\" width=\"104\" height=\"70\" rx=\"4\" fill=\"#c9b79c\"/><rect x=\"14\" y=\"128\" width=\"66\" height=\"56\" rx=\"4\" fill=\"#eee9e1\"/><rect x=\"90\" y=\"128\" width=\"66\" height=\"56\" rx=\"4\" fill=\"#eee9e1\"/><rect x=\"166\" y=\"128\" width=\"66\" height=\"56\" rx=\"4\" fill=\"#eee9e1\"/><rect x=\"242\" y=\"128\" width=\"66\" height=\"56\" rx=\"4\" fill=\"#eee9e1\"/></svg>");
9
+ /** A section of a page, as the section library draws it: a split banner with a picture and words. 16:10. */
10
+ var sectionShotUrl = svgUrl("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 200\"><rect width=\"320\" height=\"200\" fill=\"#f3efe8\"/><rect x=\"20\" y=\"24\" width=\"140\" height=\"152\" rx=\"6\" fill=\"#7d9c88\"/><circle cx=\"90\" cy=\"84\" r=\"26\" fill=\"#a9c2b0\"/><path d=\"M20 176l56-52 34 30 50-40v62z\" fill=\"#5f8a6c\"/><rect x=\"184\" y=\"62\" width=\"112\" height=\"12\" rx=\"4\" fill=\"#1f2a30\"/><rect x=\"184\" y=\"82\" width=\"96\" height=\"7\" rx=\"3\" fill=\"#8b949a\"/><rect x=\"184\" y=\"95\" width=\"80\" height=\"7\" rx=\"3\" fill=\"#8b949a\"/><rect x=\"184\" y=\"116\" width=\"62\" height=\"18\" rx=\"9\" fill=\"#1f2a30\"/></svg>");
11
+ /** The Arden ergonomic chair, on a clear ground, for a product shown whole on white. Square. */
12
+ var chairUrl = svgUrl("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 120 120\"><path d=\"M42 18c0-4 3-7 7-7h22c4 0 7 3 7 7v44H42z\" fill=\"#2f3a40\"/><rect x=\"34\" y=\"62\" width=\"52\" height=\"10\" rx=\"4\" fill=\"#1f2a30\"/><path d=\"M60 72v22\" stroke=\"#5a6b74\" stroke-width=\"5\"/><path d=\"M36 104l24-10 24 10\" stroke=\"#5a6b74\" stroke-width=\"5\" stroke-linecap=\"round\" fill=\"none\"/><circle cx=\"36\" cy=\"106\" r=\"4\" fill=\"#1f2a30\"/><circle cx=\"84\" cy=\"106\" r=\"4\" fill=\"#1f2a30\"/><circle cx=\"60\" cy=\"100\" r=\"4\" fill=\"#1f2a30\"/><path d=\"M34 44v18M86 44v18\" stroke=\"#2f3a40\" stroke-width=\"4\" stroke-linecap=\"round\"/></svg>");
13
+ /** Harbour Desk Co's mark: a wave over a line, on white. */
14
+ var harbourLogoUrl = svgUrl("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 64\"><rect width=\"64\" height=\"64\" fill=\"#ffffff\"/><path d=\"M12 36c6-8 12-8 18 0s12 8 22 0\" stroke=\"#1f5f7a\" stroke-width=\"5\" stroke-linecap=\"round\" fill=\"none\"/><path d=\"M14 46h36\" stroke=\"#1f5f7a\" stroke-width=\"5\" stroke-linecap=\"round\"/><circle cx=\"44\" cy=\"20\" r=\"5\" fill=\"#e6b85c\"/></svg>");
15
+ /** Fernhill Workspace's mark: a leaf, on white. */
16
+ var fernhillLogoUrl = svgUrl("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 64\"><rect width=\"64\" height=\"64\" fill=\"#ffffff\"/><path d=\"M18 46c0-18 12-28 30-30 0 18-10 30-30 30z\" fill=\"#2f6f5e\"/><path d=\"M18 46l20-20\" stroke=\"#ffffff\" stroke-width=\"3\" stroke-linecap=\"round\"/></svg>");
17
+ //#endregion
18
+ export { showroomUrl as a, sectionShotUrl as i, fernhillLogoUrl as n, storefrontShotUrl as o, harbourLogoUrl as r, chairUrl as t };
@@ -0,0 +1,70 @@
1
+ "use client";
2
+ import { useCallback, useEffect, useRef, useState } from "react";
3
+ //#region src/pages/components/_conversation-samples.tsx
4
+ /** An SVG picture as a data URI. The colours are the picture's own, as a photo's are, not the theme's. */
5
+ var svg = (body, background) => `data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 160 160"><defs><linearGradient id="g" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="${background[0]}"/><stop offset="1" stop-color="${background[1]}"/></linearGradient></defs><rect width="160" height="160" fill="url(#g)"/>${body}</svg>`)}`;
6
+ /** A desk chair on a pale studio wall. */
7
+ var CHAIR_PHOTO = svg("<rect x=\"52\" y=\"30\" width=\"56\" height=\"58\" rx=\"16\" fill=\"#2f4b47\"/><rect x=\"46\" y=\"86\" width=\"68\" height=\"14\" rx=\"7\" fill=\"#3b5d58\"/><rect x=\"77\" y=\"100\" width=\"6\" height=\"26\" fill=\"#56615f\"/><path d=\"M50 134h60\" stroke=\"#56615f\" stroke-width=\"6\" stroke-linecap=\"round\"/><circle cx=\"52\" cy=\"138\" r=\"5\" fill=\"#2a2f2e\"/><circle cx=\"108\" cy=\"138\" r=\"5\" fill=\"#2a2f2e\"/>", ["#eef1ee", "#d7ddd8"]);
8
+ /** A brass desk lamp on a warm wall. */
9
+ var LAMP_PHOTO = svg("<path d=\"M60 52l34-18 16 22-34 18z\" fill=\"#b8893d\"/><path d=\"M78 66l-14 52\" stroke=\"#8a6a35\" stroke-width=\"5\" stroke-linecap=\"round\"/><ellipse cx=\"64\" cy=\"124\" rx=\"26\" ry=\"7\" fill=\"#6e5530\"/><circle cx=\"100\" cy=\"48\" r=\"7\" fill=\"#f7e2a8\"/>", ["#f6efe4", "#e6d8c2"]);
10
+ /** An oak desk under a window. */
11
+ var DESK_PHOTO = svg("<rect x=\"24\" y=\"22\" width=\"112\" height=\"56\" rx=\"4\" fill=\"#cfe0e6\"/><path d=\"M80 22v56M24 50h112\" stroke=\"#f4f8f9\" stroke-width=\"3\"/><rect x=\"18\" y=\"92\" width=\"124\" height=\"10\" rx=\"3\" fill=\"#a77b4f\"/><rect x=\"26\" y=\"102\" width=\"8\" height=\"40\" fill=\"#8b643f\"/><rect x=\"126\" y=\"102\" width=\"8\" height=\"40\" fill=\"#8b643f\"/>", ["#eef2f3", "#dbe2e4"]);
12
+ /**
13
+ * Attachments for the composer demos: each file chosen shows at once with a picture of it (an object URL), "uploads"
14
+ * for a moment and is done. A name with "fail" in it fails, to show that state. Nothing leaves the page.
15
+ */
16
+ function usePretendUploads(ms = 1400) {
17
+ const [attachments, setAttachments] = useState([]);
18
+ const urls = useRef(/* @__PURE__ */ new Map());
19
+ const timers = useRef(/* @__PURE__ */ new Set());
20
+ const attach = useCallback((files) => {
21
+ const added = files.map((file) => {
22
+ const id = `${file.name}-${Math.random().toString(36).slice(2, 8)}`;
23
+ const preview = file.type.startsWith("image/") ? URL.createObjectURL(file) : void 0;
24
+ if (preview) urls.current.set(id, preview);
25
+ const timer = setTimeout(() => {
26
+ timers.current.delete(timer);
27
+ setAttachments((all) => all.map((a) => a.id === id ? /fail/i.test(file.name) ? {
28
+ ...a,
29
+ status: "error",
30
+ error: "The upload did not finish."
31
+ } : {
32
+ ...a,
33
+ status: "done"
34
+ } : a));
35
+ }, ms);
36
+ timers.current.add(timer);
37
+ return {
38
+ id,
39
+ name: file.name,
40
+ preview,
41
+ status: "uploading"
42
+ };
43
+ });
44
+ setAttachments((all) => [...all, ...added]);
45
+ }, [ms]);
46
+ const remove = useCallback((id) => {
47
+ const url = urls.current.get(id);
48
+ if (url) URL.revokeObjectURL(url);
49
+ urls.current.delete(id);
50
+ setAttachments((all) => all.filter((a) => a.id !== id));
51
+ }, []);
52
+ const clear = useCallback(() => {
53
+ for (const url of urls.current.values()) URL.revokeObjectURL(url);
54
+ urls.current.clear();
55
+ setAttachments([]);
56
+ }, []);
57
+ useEffect(() => () => {
58
+ for (const timer of timers.current) clearTimeout(timer);
59
+ for (const url of urls.current.values()) URL.revokeObjectURL(url);
60
+ }, []);
61
+ return {
62
+ attachments,
63
+ attach,
64
+ remove,
65
+ clear,
66
+ setAttachments
67
+ };
68
+ }
69
+ //#endregion
70
+ export { usePretendUploads as i, DESK_PHOTO as n, LAMP_PHOTO as r, CHAIR_PHOTO as t };