@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,740 @@
1
+ "use client";
2
+ import { t as DocLink } from "./host-B6znjEgQ.js";
3
+ import { a as DocTable, d as Section$1, i as DocPage, l as Note, m as ThemePair, o as Example, p as SubSection, s as Guidelines, u as PropsTable } from "./docs-lM2UBSir.js";
4
+ import { useState } from "react";
5
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
6
+ import { Badge, BoardCard, DealCard, IconButton, Kanban } from "@orbitcommerce/constellation";
7
+ import { PushPinIcon } from "@orbitcommerce/constellation/icons";
8
+ //#region src/pages/components/kanban.tsx
9
+ /** The day the examples are judged from, so a close date reads the same on every visit. */
10
+ var TODAY = new Date(2026, 9, 14);
11
+ var STAGES = [
12
+ {
13
+ id: "lead",
14
+ title: "Lead",
15
+ cards: [{
16
+ id: "d1",
17
+ title: "Harbour Desk Co refit",
18
+ value: 12400,
19
+ customer: "Priya Shah",
20
+ closes: "2026-11-02",
21
+ owner: "Sam Okafor"
22
+ }, {
23
+ id: "d2",
24
+ title: "Arden chairs for the library",
25
+ value: 3850,
26
+ closes: "2026-10-03",
27
+ owner: "Ellie Ward"
28
+ }]
29
+ },
30
+ {
31
+ id: "qualified",
32
+ title: "Qualified",
33
+ tone: "info",
34
+ cards: [{
35
+ id: "d3",
36
+ title: "Riverside studio fit-out",
37
+ value: 28900,
38
+ customer: "Tom Hughes",
39
+ closes: "2026-12-11",
40
+ owner: "Sam Okafor"
41
+ }]
42
+ },
43
+ {
44
+ id: "proposal",
45
+ title: "Proposal sent",
46
+ tone: "accent",
47
+ cards: [{
48
+ id: "d4",
49
+ title: "Canal Street desks",
50
+ value: 7200,
51
+ customer: "Ana Ribeiro",
52
+ closes: "2026-10-21",
53
+ owner: "Ellie Ward"
54
+ }, {
55
+ id: "d5",
56
+ title: "Moorgate meeting rooms",
57
+ value: 15600,
58
+ closes: "2026-10-09"
59
+ }]
60
+ },
61
+ {
62
+ id: "won",
63
+ title: "Won",
64
+ kind: "won",
65
+ cards: [{
66
+ id: "d6",
67
+ title: "Wharf Lane reception",
68
+ value: 9100,
69
+ customer: "Joe Patel",
70
+ status: "won"
71
+ }]
72
+ },
73
+ {
74
+ id: "lost",
75
+ title: "Lost",
76
+ kind: "lost",
77
+ cards: []
78
+ }
79
+ ];
80
+ /** Moves a card in a page's own state, as onMove asks. */
81
+ function applyMove(columns, move) {
82
+ return columns.map((column) => ({
83
+ ...column,
84
+ cards: column.cards.filter((card) => card.id !== move.id)
85
+ })).map((column) => column.id === move.to ? {
86
+ ...column,
87
+ cards: [
88
+ ...column.cards.slice(0, move.position),
89
+ move.card,
90
+ ...column.cards.slice(move.position)
91
+ ]
92
+ } : column);
93
+ }
94
+ /** The CRM's deals: a column per stage, each with the value of its deals. */
95
+ function Deals({ compact = false }) {
96
+ const [stages, setStages] = useState(STAGES);
97
+ const [opened, setOpened] = useState(null);
98
+ const columns = (compact ? stages.slice(0, 3) : stages).map((stage) => ({
99
+ ...stage,
100
+ value: stage.cards.reduce((sum, deal) => sum + deal.value, 0)
101
+ }));
102
+ return /* @__PURE__ */ jsxs("div", {
103
+ className: "kanban-stage",
104
+ children: [/* @__PURE__ */ jsx(Kanban, {
105
+ "aria-label": "Deals",
106
+ columns,
107
+ getCardId: (deal) => deal.id,
108
+ getCardLabel: (deal) => deal.title,
109
+ onMove: (move) => setStages((was) => applyMove(was, move)),
110
+ onOpen: (deal) => setOpened(deal.title),
111
+ renderCard: (deal, state) => /* @__PURE__ */ jsx(DealCard, {
112
+ title: deal.title,
113
+ value: deal.value,
114
+ status: state.column === "won" ? "won" : state.column === "lost" ? "lost" : "open",
115
+ customer: deal.customer,
116
+ closeDate: deal.closes,
117
+ today: TODAY,
118
+ owner: deal.owner ? { name: deal.owner } : void 0,
119
+ onOpen: state.open
120
+ })
121
+ }), compact ? null : /* @__PURE__ */ jsx("p", {
122
+ className: "kanban-note",
123
+ "aria-live": "polite",
124
+ children: opened ? `Opened ${opened}` : "Click a deal to open it, or drag it to another stage."
125
+ })]
126
+ });
127
+ }
128
+ var CHATS = [
129
+ {
130
+ id: "open",
131
+ title: "Open",
132
+ tone: "warning",
133
+ cards: [{
134
+ id: "c1",
135
+ visitor: "Visitor from Leeds",
136
+ page: "/products/arden-chair"
137
+ }, {
138
+ id: "c2",
139
+ visitor: "Grace Lin",
140
+ page: "/checkout"
141
+ }]
142
+ },
143
+ {
144
+ id: "waiting",
145
+ title: "Waiting on customer",
146
+ tone: "info",
147
+ cards: [{
148
+ id: "c3",
149
+ visitor: "Harbour Desk Co",
150
+ page: "/trade/apply",
151
+ pinned: true
152
+ }]
153
+ },
154
+ {
155
+ id: "resolved",
156
+ title: "Resolved",
157
+ tone: "positive",
158
+ badge: /* @__PURE__ */ jsx(Badge, {
159
+ size: "sm",
160
+ children: "Auto"
161
+ }),
162
+ cards: [{
163
+ id: "c4",
164
+ visitor: "Ravi Mehta",
165
+ page: "/orders/1042"
166
+ }]
167
+ }
168
+ ];
169
+ /** A status board: chats move on to Resolved, and a resolved chat moves nowhere (it reopens when someone replies). */
170
+ function Chats() {
171
+ const [columns, setColumns] = useState(CHATS);
172
+ const [said, setSaid] = useState(null);
173
+ return /* @__PURE__ */ jsxs("div", {
174
+ className: "kanban-stage",
175
+ children: [/* @__PURE__ */ jsx(Kanban, {
176
+ "aria-label": "Chats",
177
+ columns,
178
+ getCardId: (chat) => chat.id,
179
+ getCardLabel: (chat) => chat.visitor,
180
+ canDrop: (from, to) => from !== "resolved" && to !== from,
181
+ lockedHint: "Resolved chats reopen when someone replies.",
182
+ moveBlockedReason: (move) => move.card.pinned && move.to === "resolved" ? "Unpin a chat before you resolve it." : null,
183
+ onMoveBlocked: (reason) => setSaid(reason),
184
+ onMove: (move) => {
185
+ setSaid(null);
186
+ setColumns((was) => applyMove(was, move));
187
+ },
188
+ renderCard: (chat, state) => /* @__PURE__ */ jsx(BoardCard, {
189
+ title: chat.visitor,
190
+ onOpen: state.open,
191
+ meta: chat.page,
192
+ action: chat.pinned ? /* @__PURE__ */ jsx(IconButton, {
193
+ size: "xs",
194
+ variant: "ghost",
195
+ label: `Unpin ${chat.visitor}`,
196
+ pressed: true,
197
+ children: /* @__PURE__ */ jsx(PushPinIcon, {
198
+ size: 14,
199
+ "aria-hidden": "true"
200
+ })
201
+ }) : void 0
202
+ })
203
+ }), /* @__PURE__ */ jsx("p", {
204
+ className: "kanban-note",
205
+ "aria-live": "polite",
206
+ children: said ?? "Drag a chat on to Resolved. A pinned chat is refused, with its reason."
207
+ })]
208
+ });
209
+ }
210
+ var merchant = (id, name, domain, plan) => ({
211
+ id,
212
+ name,
213
+ domain,
214
+ plan
215
+ });
216
+ /** Merchants by lifecycle: sections inside a column, and a long column shown a page at a time. */
217
+ function Merchants() {
218
+ const columns = [{
219
+ id: "trial",
220
+ title: "On trial",
221
+ tone: "info",
222
+ cards: [
223
+ merchant("m1", "Arden Studio", "ardenstudio.co.uk", "Trial"),
224
+ merchant("m2", "Canal Street Interiors", "canalstreet.shop", "Trial"),
225
+ merchant("m3", "Wharf Lane Supplies", "wharflane.co.uk", "Trial"),
226
+ merchant("m4", "Moorgate Office", "moorgate.office", "Trial"),
227
+ merchant("m5", "Riverside Goods", "riversidegoods.uk", "Trial")
228
+ ],
229
+ pageSize: 3
230
+ }, {
231
+ id: "paying",
232
+ title: "Paying",
233
+ tone: "positive",
234
+ badge: /* @__PURE__ */ jsx(Badge, {
235
+ size: "sm",
236
+ children: "Auto"
237
+ }),
238
+ cards: [],
239
+ sections: [{
240
+ key: "pro",
241
+ title: "Pro",
242
+ cards: [merchant("m6", "Harbour Desk Co", "harbourdesk.co.uk", "Pro")]
243
+ }, {
244
+ key: "growth",
245
+ title: "Growth",
246
+ note: "1 payment failed",
247
+ tone: "warning",
248
+ cards: [merchant("m7", "Northfield Chairs", "northfield.shop", "Growth"), merchant("m8", "Oak and Iron", "oakandiron.co.uk", "Growth")]
249
+ }]
250
+ }];
251
+ return /* @__PURE__ */ jsx("div", {
252
+ className: "kanban-stage",
253
+ children: /* @__PURE__ */ jsx(Kanban, {
254
+ "aria-label": "Merchants",
255
+ columns,
256
+ total: 42,
257
+ getCardId: (m) => m.id,
258
+ getCardLabel: (m) => m.name,
259
+ renderCard: (m, state) => /* @__PURE__ */ jsx(BoardCard, {
260
+ title: m.name,
261
+ onOpen: state.open,
262
+ meta: m.domain,
263
+ badges: /* @__PURE__ */ jsx(Badge, {
264
+ size: "sm",
265
+ children: m.plan
266
+ })
267
+ })
268
+ })
269
+ });
270
+ }
271
+ /** The board's other states, side by side. */
272
+ function States() {
273
+ return /* @__PURE__ */ jsxs("div", {
274
+ className: "kanban-states",
275
+ children: [/* @__PURE__ */ jsx(Kanban, {
276
+ "aria-label": "Deals, loading",
277
+ columns: STAGES.slice(0, 2).map((stage) => ({
278
+ ...stage,
279
+ cards: []
280
+ })),
281
+ loading: true,
282
+ getCardId: (d) => d.id,
283
+ getCardLabel: (d) => d.title,
284
+ renderCard: (d) => d.title
285
+ }), /* @__PURE__ */ jsx(Kanban, {
286
+ "aria-label": "Deals, read only",
287
+ canMove: false,
288
+ columns: STAGES.slice(0, 2),
289
+ getCardId: (d) => d.id,
290
+ getCardLabel: (d) => d.title,
291
+ renderCard: (d, state) => /* @__PURE__ */ jsx(DealCard, {
292
+ title: d.title,
293
+ value: d.value,
294
+ onOpen: state.open,
295
+ today: TODAY
296
+ })
297
+ })]
298
+ });
299
+ }
300
+ function Preview() {
301
+ return /* @__PURE__ */ jsx("div", {
302
+ className: "kanban-preview",
303
+ children: /* @__PURE__ */ jsx(Kanban, {
304
+ "aria-label": "Deals",
305
+ columns: STAGES.slice(0, 2).map((stage) => ({
306
+ ...stage,
307
+ cards: stage.cards.slice(0, 1)
308
+ })),
309
+ getCardId: (d) => d.id,
310
+ getCardLabel: (d) => d.title,
311
+ renderCard: (d) => /* @__PURE__ */ jsx(DealCard, {
312
+ title: d.title,
313
+ value: d.value,
314
+ today: TODAY
315
+ })
316
+ })
317
+ });
318
+ }
319
+ function Page() {
320
+ return /* @__PURE__ */ jsxs(DocPage, {
321
+ title: "Kanban",
322
+ status: "new",
323
+ importNames: [
324
+ "Kanban",
325
+ "kanbanLabels",
326
+ "DealCard",
327
+ "BoardCard"
328
+ ],
329
+ lead: "A board of stage columns whose cards move between them and within them, by pointer and by keyboard: a CRM's deals, a help desk's tickets and chats, merchants by lifecycle. Reach for it when where a thing stands is the point and people move it on by hand; a list of records you filter and sort is a table.",
330
+ children: [
331
+ /* @__PURE__ */ jsxs(Section$1, {
332
+ id: "basics",
333
+ title: "Basics",
334
+ description: /* @__PURE__ */ jsxs("p", { children: [
335
+ "Give the board its ",
336
+ /* @__PURE__ */ jsx("code", { children: "columns" }),
337
+ " (each an id, a title and its cards), a ",
338
+ /* @__PURE__ */ jsx("code", { children: "getCardId" }),
339
+ ", a",
340
+ " ",
341
+ /* @__PURE__ */ jsx("code", { children: "getCardLabel" }),
342
+ " that names a card aloud, a ",
343
+ /* @__PURE__ */ jsx("code", { children: "renderCard" }),
344
+ " for the card's content, and an",
345
+ " ",
346
+ /* @__PURE__ */ jsx("code", { children: "onMove" }),
347
+ " that keeps the move. A move is ",
348
+ /* @__PURE__ */ jsx("code", { children: "{ id, card, from, to, position }" }),
349
+ ",",
350
+ " ",
351
+ /* @__PURE__ */ jsx("code", { children: "position" }),
352
+ " its index in the new column. The board draws each card's surface and its move handle; a card drags from anywhere on it once the pointer has moved 6px, so a click still opens it (",
353
+ /* @__PURE__ */ jsx("code", { children: "onOpen" }),
354
+ "), and the column a card from another is over tints. A column heads itself with a dot, its name, a Won or Lost badge for a won or lost stage (with an accent edge), a count and its value total. The cards here are ",
355
+ /* @__PURE__ */ jsx(DocLink, {
356
+ to: "/components/board-card",
357
+ children: "deal cards"
358
+ }),
359
+ "."
360
+ ] }),
361
+ children: [/* @__PURE__ */ jsx(Example, {
362
+ align: "fill",
363
+ caption: "Drag a deal to another stage, or tab to its move handle, press Space, and use the arrows.",
364
+ code: `
365
+ <Kanban
366
+ aria-label="Deals"
367
+ columns={stages.map((stage) => ({ ...stage, value: total(stage.cards) }))}
368
+ getCardId={(deal) => deal.id}
369
+ getCardLabel={(deal) => deal.title}
370
+ onMove={(move) => setStages((was) => applyMove(was, move))}
371
+ onOpen={(deal) => open(deal)}
372
+ renderCard={(deal, state) => (
373
+ <DealCard
374
+ title={deal.title}
375
+ value={deal.value}
376
+ customer={deal.customer}
377
+ closeDate={deal.closes}
378
+ owner={deal.owner ? { name: deal.owner } : undefined}
379
+ onOpen={state.open}
380
+ />
381
+ )}
382
+ />`,
383
+ children: /* @__PURE__ */ jsx(Deals, {})
384
+ }), /* @__PURE__ */ jsx(Note, {
385
+ title: "The card's top end corner",
386
+ children: "The board puts each card's move handle in its top end corner, shown on hover and focus (always on a touch screen). DealCard and BoardCard keep that corner clear; keep it clear in a card of your own."
387
+ })]
388
+ }),
389
+ /* @__PURE__ */ jsx(Section$1, {
390
+ id: "rules",
391
+ title: "Where a card may go",
392
+ description: /* @__PURE__ */ jsxs("p", { children: [
393
+ /* @__PURE__ */ jsx("code", { children: "canDrop(from, to, card)" }),
394
+ " says whether a column takes a card: while one is in flight the columns that would refuse it dim, and the keyboard passes over them. A column whose cards can go nowhere is locked: its cards have no handle and open as ever, and ",
395
+ /* @__PURE__ */ jsx("code", { children: "lockedHint" }),
396
+ " says why under its head.",
397
+ " ",
398
+ /* @__PURE__ */ jsx("code", { children: "moveBlockedReason" }),
399
+ " refuses one move as it drops, with a sentence that is said and handed to",
400
+ " ",
401
+ /* @__PURE__ */ jsx("code", { children: "onMoveBlocked" }),
402
+ " (for a toast). ",
403
+ /* @__PURE__ */ jsxs("code", { children: ["canMove=", "{false}"] }),
404
+ " turns moving off for a person without permission."
405
+ ] }),
406
+ children: /* @__PURE__ */ jsx(Example, {
407
+ align: "fill",
408
+ code: `
409
+ <Kanban
410
+ aria-label="Chats"
411
+ columns={columns}
412
+ getCardId={(chat) => chat.id}
413
+ getCardLabel={(chat) => chat.visitor}
414
+ canDrop={(from, to) => from !== 'resolved' && to !== from}
415
+ lockedHint="Resolved chats reopen when someone replies."
416
+ moveBlockedReason={(move) => (move.card.pinned && move.to === 'resolved' ? 'Unpin a chat before you resolve it.' : null)}
417
+ onMoveBlocked={(reason) => toast(reason)}
418
+ onMove={(move) => setColumns((was) => applyMove(was, move))}
419
+ renderCard={(chat, state) => <BoardCard title={chat.visitor} onOpen={state.open} meta={chat.page} />}
420
+ />`,
421
+ children: /* @__PURE__ */ jsx(Chats, {})
422
+ })
423
+ }),
424
+ /* @__PURE__ */ jsx(Section$1, {
425
+ id: "sections",
426
+ title: "Sections, long columns, and a board that holds some of them",
427
+ description: /* @__PURE__ */ jsxs("p", { children: [
428
+ "A column's ",
429
+ /* @__PURE__ */ jsx("code", { children: "sections" }),
430
+ " group its cards under a title, a count and a note (amber with",
431
+ " ",
432
+ /* @__PURE__ */ jsx("code", { children: "tone=\"warning\"" }),
433
+ "); ",
434
+ /* @__PURE__ */ jsx("code", { children: "pageSize" }),
435
+ " shows a long column a page at a time (\"Show 2 more of 2\"); ",
436
+ /* @__PURE__ */ jsx("code", { children: "total" }),
437
+ ", the number of cards there are in all, puts a notice above a board that holds only the first of them. ",
438
+ /* @__PURE__ */ jsx("code", { children: "badge" }),
439
+ " takes a badge of your own, such as \"Auto\" for a column the system fills."
440
+ ] }),
441
+ children: /* @__PURE__ */ jsx(Example, {
442
+ align: "fill",
443
+ code: `
444
+ <Kanban
445
+ aria-label="Merchants"
446
+ total={42}
447
+ columns={[
448
+ { id: 'trial', title: 'On trial', tone: 'info', cards: trials, pageSize: 3 },
449
+ {
450
+ id: 'paying',
451
+ title: 'Paying',
452
+ tone: 'positive',
453
+ badge: <Badge size="sm">Auto</Badge>,
454
+ cards: [],
455
+ sections: [
456
+ { key: 'pro', title: 'Pro', cards: pro },
457
+ { key: 'growth', title: 'Growth', note: '1 payment failed', tone: 'warning', cards: growth },
458
+ ],
459
+ },
460
+ ]}
461
+ getCardId={(m) => m.id}
462
+ getCardLabel={(m) => m.name}
463
+ renderCard={(m, state) => <BoardCard title={m.name} onOpen={state.open} meta={m.domain} badges={<Badge size="sm">{m.plan}</Badge>} />}
464
+ />`,
465
+ children: /* @__PURE__ */ jsx(Merchants, {})
466
+ })
467
+ }),
468
+ /* @__PURE__ */ jsx(Section$1, {
469
+ id: "states",
470
+ title: "Loading, empty and read only",
471
+ description: /* @__PURE__ */ jsxs("p", { children: [
472
+ "While ",
473
+ /* @__PURE__ */ jsx("code", { children: "loading" }),
474
+ ", a column with no cards yet draws placeholder cards and the board says so. An empty column says \"No cards yet\", and \"Drop here\" while a card it would take is in flight. A board with no columns says it has no stages."
475
+ ] }),
476
+ children: /* @__PURE__ */ jsx(SubSection, {
477
+ title: "Loading, and read only",
478
+ children: /* @__PURE__ */ jsx(Example, {
479
+ align: "fill",
480
+ children: /* @__PURE__ */ jsx(States, {})
481
+ })
482
+ })
483
+ }),
484
+ /* @__PURE__ */ jsx(Section$1, {
485
+ id: "both-themes",
486
+ title: "In both themes",
487
+ description: /* @__PURE__ */ jsx("p", { children: "The board light and dark side by side." }),
488
+ children: /* @__PURE__ */ jsx(ThemePair, { children: /* @__PURE__ */ jsx(Deals, { compact: true }) })
489
+ }),
490
+ /* @__PURE__ */ jsx(Fragment$1, {}),
491
+ /* @__PURE__ */ jsx(Section$1, {
492
+ id: "guidelines",
493
+ title: "Guidelines",
494
+ children: /* @__PURE__ */ jsx(Guidelines, { items: [
495
+ "Name every card aloud with getCardLabel: the handle and every announcement say it.",
496
+ "Say why a column refuses or is locked: a hint under its head, a reason for a refused move.",
497
+ "Keep a card short: its name, a figure, one or two facts. The record page holds the rest.",
498
+ "Keep a card's top end corner clear for the move handle.",
499
+ "A board shows where things stand. Page through every record in a table; say so with total when the board holds only some."
500
+ ] })
501
+ }),
502
+ /* @__PURE__ */ jsx(Section$1, {
503
+ id: "accessibility",
504
+ title: "Accessibility",
505
+ description: /* @__PURE__ */ jsxs("p", { children: [
506
+ "Each column is a region named by its stage, holding a list of cards. Each card has a move handle, a button named \"Move\" and the card, described by the instructions; its own open control (a DealCard's or BoardCard's title) is a separate stop. A lifted card wears a ring and its handle says ",
507
+ /* @__PURE__ */ jsx("code", { children: "aria-pressed" }),
508
+ "; every pick up, move, drop, cancel and refusal is said in a polite status, naming the card and the stage."
509
+ ] }),
510
+ children: /* @__PURE__ */ jsx(DocTable, {
511
+ columns: ["Key", "What it does"],
512
+ rows: [
513
+ ["Space or Enter", "On a move handle: pick the card up. While lifted: drop it where it is."],
514
+ ["Arrow up and down", "While lifted: move the card within its stage."],
515
+ ["Arrow left and right", "While lifted: move it to the stage before or after, in the order the page reads, passing over stages that will not take it."],
516
+ ["Escape, or Tab", "While lifted: cancel, the card back where it was."]
517
+ ]
518
+ })
519
+ }),
520
+ /* @__PURE__ */ jsxs(Section$1, {
521
+ id: "props",
522
+ title: "Props",
523
+ description: /* @__PURE__ */ jsx("p", { children: "Kanban also accepts every native attribute of its root element." }),
524
+ children: [
525
+ /* @__PURE__ */ jsx(PropsTable, {
526
+ title: "Kanban",
527
+ rows: [
528
+ {
529
+ name: "columns",
530
+ type: "KanbanColumn<C>[]",
531
+ required: true,
532
+ description: "The stages, in order (below)."
533
+ },
534
+ {
535
+ name: "getCardId",
536
+ type: "(card) => string",
537
+ required: true,
538
+ description: "A stable id per card, unique on the board."
539
+ },
540
+ {
541
+ name: "getCardLabel",
542
+ type: "(card) => string",
543
+ required: true,
544
+ description: "Words for the card, in its handle's name and the announcements."
545
+ },
546
+ {
547
+ name: "renderCard",
548
+ type: "(card, state) => ReactNode",
549
+ required: true,
550
+ description: "The card's content; the board draws its surface and its move handle."
551
+ },
552
+ {
553
+ name: "onMove",
554
+ type: "(move: KanbanMove) => void",
555
+ description: "A finished move: { id, card, from, to, position, fromPosition }."
556
+ },
557
+ {
558
+ name: "onOpen",
559
+ type: "(card, column) => void",
560
+ description: "A click on a card, or state.open()."
561
+ },
562
+ {
563
+ name: "canMove",
564
+ type: "boolean",
565
+ default: "true",
566
+ description: "False turns moving off: no handles, nothing drags, cards still open."
567
+ },
568
+ {
569
+ name: "canDrop",
570
+ type: "(from, to, card?) => boolean",
571
+ description: "Whether column to takes a card from column from. Refusing columns dim; a column whose cards can go nowhere is locked."
572
+ },
573
+ {
574
+ name: "moveBlockedReason",
575
+ type: "(move) => string | null",
576
+ description: "Refuses one move as it drops, with a sentence that is said."
577
+ },
578
+ {
579
+ name: "onMoveBlocked",
580
+ type: "(reason, move) => void",
581
+ description: "Hears a refused move, for a toast."
582
+ },
583
+ {
584
+ name: "lockedHint",
585
+ type: "ReactNode",
586
+ description: "Why a locked column's cards do not move, under its head."
587
+ },
588
+ {
589
+ name: "loading",
590
+ type: "boolean",
591
+ default: "false",
592
+ description: "Placeholder cards in columns with none yet."
593
+ },
594
+ {
595
+ name: "total",
596
+ type: "number",
597
+ description: "How many cards there are in all; a notice says when the board holds fewer."
598
+ },
599
+ {
600
+ name: "currency",
601
+ type: "string",
602
+ default: "'GBP'",
603
+ description: "The currency a number value total is written in."
604
+ },
605
+ {
606
+ name: "labels",
607
+ type: "Partial<KanbanLabels>",
608
+ default: "English defaults",
609
+ description: "Every word the board says."
610
+ }
611
+ ]
612
+ }),
613
+ /* @__PURE__ */ jsx(PropsTable, {
614
+ title: "KanbanColumn",
615
+ rows: [
616
+ {
617
+ name: "id",
618
+ type: "string",
619
+ required: true,
620
+ description: "The column, as moves name it."
621
+ },
622
+ {
623
+ name: "title",
624
+ type: "string",
625
+ required: true,
626
+ description: "The stage's name: the heading, said as a card moves in."
627
+ },
628
+ {
629
+ name: "cards",
630
+ type: "C[]",
631
+ required: true,
632
+ description: "Its cards, in order (empty when sections hold them)."
633
+ },
634
+ {
635
+ name: "sections",
636
+ type: "KanbanSection<C>[]",
637
+ description: "Titled groups of cards: key, title, cards, note, tone."
638
+ },
639
+ {
640
+ name: "tone",
641
+ type: "KanbanTone",
642
+ default: "'neutral'",
643
+ description: "The dot's tone."
644
+ },
645
+ {
646
+ name: "color",
647
+ type: "string",
648
+ description: "The stage's own colour for the dot."
649
+ },
650
+ {
651
+ name: "kind",
652
+ type: "'open' | 'won' | 'lost'",
653
+ description: "A won or lost stage: its badge and an accent edge."
654
+ },
655
+ {
656
+ name: "badge",
657
+ type: "ReactNode",
658
+ description: "A badge of your own after the name."
659
+ },
660
+ {
661
+ name: "count",
662
+ type: "number",
663
+ default: "the cards",
664
+ description: "The count in the head."
665
+ },
666
+ {
667
+ name: "value",
668
+ type: "number | ReactNode",
669
+ description: "The value total; a number is written as money."
670
+ },
671
+ {
672
+ name: "pageSize",
673
+ type: "number",
674
+ description: "Show this many, then \"Show N more of M\"."
675
+ },
676
+ {
677
+ name: "empty",
678
+ type: "ReactNode",
679
+ default: "'No cards yet'",
680
+ description: "The empty column's line."
681
+ },
682
+ {
683
+ name: "locked",
684
+ type: "boolean",
685
+ default: "from canDrop",
686
+ description: "Its cards cannot move."
687
+ }
688
+ ]
689
+ }),
690
+ /* @__PURE__ */ jsx(DocTable, {
691
+ columns: [
692
+ "KanbanCardState",
693
+ "Type",
694
+ "What it says"
695
+ ],
696
+ rows: [
697
+ [
698
+ "column",
699
+ "string",
700
+ "The column the card is drawn in now."
701
+ ],
702
+ [
703
+ "position",
704
+ "number",
705
+ "Its place there now."
706
+ ],
707
+ [
708
+ "dragging",
709
+ "boolean",
710
+ "Being dragged (its place held open)."
711
+ ],
712
+ [
713
+ "lifted",
714
+ "boolean",
715
+ "Picked up by the keyboard."
716
+ ],
717
+ [
718
+ "overlay",
719
+ "boolean",
720
+ "Drawn in the lifted copy."
721
+ ],
722
+ [
723
+ "locked",
724
+ "boolean",
725
+ "It cannot move."
726
+ ],
727
+ [
728
+ "open",
729
+ "() => void",
730
+ "Opens the card: wire its open button or link."
731
+ ]
732
+ ]
733
+ })
734
+ ]
735
+ })
736
+ ]
737
+ });
738
+ }
739
+ //#endregion
740
+ export { Page, Preview };