@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,1558 @@
1
+ "use client";
2
+ import { r as ForAudience, 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, n as CodeBlock$1, o as Example, p as SubSection, r as DoDont, s as Guidelines, u as PropsTable } from "./docs-lM2UBSir.js";
4
+ import { d as formatGbp, o as TODAY } from "./_figures-data-DaDvB7Nm.js";
5
+ import { useState } from "react";
6
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
+ import { AppShell, Avatar, Badge, Breadcrumbs, Button, Canvas, CommandEmpty, CommandGroup, CommandItem, CommandPalette, IconButton, Kbd, Menu, MenuContent, MenuItem, MenuLabel, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuTrigger, OrbitLogo, SearchTrigger, ShellBrand, Sidebar, SidebarFooter, SidebarHeader, SidebarItem, SidebarNav, SidebarSection, SidebarToggle, StoreButton, Tooltip, TopBar, useShell } from "@orbitcommerce/constellation";
8
+ import { BellIcon, ChartLineUpIcon, CreditCardIcon, GearSixIcon, HouseIcon, ImageSquareIcon, MegaphoneIcon, PackageIcon, PlusIcon, PuzzlePieceIcon, ReceiptIcon, SparkleIcon, StorefrontIcon, TagIcon, UsersThreeIcon } from "@orbitcommerce/constellation/icons";
9
+ //#region src/pages/patterns/app-shell.tsx
10
+ var NAV = [
11
+ {
12
+ id: "start",
13
+ items: [{
14
+ id: "home",
15
+ label: "Home",
16
+ icon: HouseIcon,
17
+ page: true
18
+ }]
19
+ },
20
+ {
21
+ id: "commerce",
22
+ title: "Commerce",
23
+ items: [
24
+ {
25
+ id: "orders",
26
+ label: "Orders",
27
+ icon: ReceiptIcon,
28
+ page: true,
29
+ children: [
30
+ {
31
+ id: "drafts",
32
+ label: "Drafts"
33
+ },
34
+ {
35
+ id: "abandoned",
36
+ label: "Abandoned checkouts"
37
+ },
38
+ {
39
+ id: "returns",
40
+ label: "Returns"
41
+ }
42
+ ]
43
+ },
44
+ {
45
+ id: "catalogue",
46
+ label: "Catalogue",
47
+ icon: PackageIcon,
48
+ children: [
49
+ {
50
+ id: "products",
51
+ label: "Products"
52
+ },
53
+ {
54
+ id: "categories",
55
+ label: "Categories"
56
+ },
57
+ {
58
+ id: "inventory",
59
+ label: "Inventory"
60
+ }
61
+ ]
62
+ },
63
+ {
64
+ id: "customers",
65
+ label: "Customers",
66
+ icon: UsersThreeIcon,
67
+ page: true
68
+ },
69
+ {
70
+ id: "discounts",
71
+ label: "Discounts",
72
+ icon: TagIcon,
73
+ page: true
74
+ },
75
+ {
76
+ id: "payments",
77
+ label: "Payments",
78
+ icon: CreditCardIcon,
79
+ page: true
80
+ }
81
+ ]
82
+ },
83
+ {
84
+ id: "content",
85
+ title: "Content",
86
+ items: [{
87
+ id: "media",
88
+ label: "Media library",
89
+ icon: ImageSquareIcon,
90
+ page: true
91
+ }, {
92
+ id: "storefront",
93
+ label: "Storefront",
94
+ icon: StorefrontIcon,
95
+ page: true
96
+ }]
97
+ },
98
+ {
99
+ id: "insights",
100
+ title: "Insights",
101
+ items: [{
102
+ id: "analytics",
103
+ label: "Analytics",
104
+ icon: ChartLineUpIcon,
105
+ page: true
106
+ }, {
107
+ id: "marketing",
108
+ label: "Marketing",
109
+ icon: MegaphoneIcon,
110
+ page: true
111
+ }]
112
+ },
113
+ {
114
+ id: "configuration",
115
+ title: "Configuration",
116
+ items: [{
117
+ id: "plugins",
118
+ label: "Plugins",
119
+ icon: PuzzlePieceIcon,
120
+ page: true
121
+ }, {
122
+ id: "settings",
123
+ label: "Settings",
124
+ icon: GearSixIcon,
125
+ page: true
126
+ }]
127
+ }
128
+ ];
129
+ var STORES = [
130
+ {
131
+ name: "Harbour Desk Co",
132
+ detail: "harbourdesk.co.uk"
133
+ },
134
+ {
135
+ name: "Fernside Lighting",
136
+ detail: "fernsidelighting.co.uk"
137
+ },
138
+ {
139
+ name: "Quayside Gifts",
140
+ detail: "quaysidegifts.co.uk"
141
+ }
142
+ ];
143
+ var icons = (I) => ({
144
+ icon: /* @__PURE__ */ jsx(I, {}),
145
+ activeIcon: /* @__PURE__ */ jsx(I, { weight: "duotone" })
146
+ });
147
+ function findPage(id) {
148
+ for (const group of NAV) for (const item of group.items) {
149
+ if (item.id === id) return { label: item.label };
150
+ const child = item.children?.find((c) => c.id === id);
151
+ if (child) return {
152
+ label: child.label,
153
+ parent: item
154
+ };
155
+ }
156
+ return { label: "Home" };
157
+ }
158
+ function Preview() {
159
+ return /* @__PURE__ */ jsxs("div", {
160
+ className: "app-shell-preview",
161
+ children: [/* @__PURE__ */ jsxs("div", {
162
+ className: "app-shell-preview__rail",
163
+ children: [
164
+ /* @__PURE__ */ jsx(OrbitLogo, {
165
+ variant: "mark",
166
+ size: 14,
167
+ className: "app-shell-preview__logo",
168
+ "aria-hidden": "true",
169
+ title: ""
170
+ }),
171
+ /* @__PURE__ */ jsx("span", {
172
+ className: "app-shell-preview__item",
173
+ "data-active": "",
174
+ children: /* @__PURE__ */ jsx(HouseIcon, { weight: "duotone" })
175
+ }),
176
+ /* @__PURE__ */ jsx("span", {
177
+ className: "app-shell-preview__item",
178
+ "data-badge": "",
179
+ children: /* @__PURE__ */ jsx(ReceiptIcon, {})
180
+ }),
181
+ /* @__PURE__ */ jsx("span", {
182
+ className: "app-shell-preview__item",
183
+ children: /* @__PURE__ */ jsx(PackageIcon, {})
184
+ }),
185
+ /* @__PURE__ */ jsx("span", {
186
+ className: "app-shell-preview__item",
187
+ children: /* @__PURE__ */ jsx(UsersThreeIcon, {})
188
+ }),
189
+ /* @__PURE__ */ jsx("span", {
190
+ className: "app-shell-preview__item",
191
+ children: /* @__PURE__ */ jsx(ChartLineUpIcon, {})
192
+ }),
193
+ /* @__PURE__ */ jsx(Avatar, {
194
+ shape: "square",
195
+ size: "xs",
196
+ name: "Harbour Desk Co",
197
+ className: "app-shell-preview__store"
198
+ })
199
+ ]
200
+ }), /* @__PURE__ */ jsxs("div", {
201
+ className: "app-shell-preview__main",
202
+ children: [/* @__PURE__ */ jsxs("div", {
203
+ className: "app-shell-preview__bar",
204
+ children: [
205
+ /* @__PURE__ */ jsx("span", { className: "app-shell-preview__crumb" }),
206
+ /* @__PURE__ */ jsx("span", { className: "app-shell-preview__search" }),
207
+ /* @__PURE__ */ jsx(Avatar, {
208
+ size: "xs",
209
+ name: "Priya Shah"
210
+ })
211
+ ]
212
+ }), /* @__PURE__ */ jsxs("div", {
213
+ className: "app-shell-preview__canvas",
214
+ children: [
215
+ /* @__PURE__ */ jsx("span", {
216
+ className: "app-shell-preview__title",
217
+ children: "Good evening, Priya"
218
+ }),
219
+ /* @__PURE__ */ jsx("span", { className: "app-shell-preview__line" }),
220
+ /* @__PURE__ */ jsx("span", {
221
+ className: "app-shell-preview__line",
222
+ "data-short": ""
223
+ })
224
+ ]
225
+ })]
226
+ })]
227
+ });
228
+ }
229
+ function StoreSwitcher({ store, onStore }) {
230
+ return /* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsx(MenuTrigger, {
231
+ asChild: true,
232
+ children: /* @__PURE__ */ jsx(StoreButton, {
233
+ name: store.name,
234
+ detail: store.detail,
235
+ avatar: /* @__PURE__ */ jsx(Avatar, {
236
+ shape: "square",
237
+ size: "sm",
238
+ name: store.name
239
+ })
240
+ })
241
+ }), /* @__PURE__ */ jsxs(MenuContent, {
242
+ width: 264,
243
+ side: "top",
244
+ align: "start",
245
+ children: [
246
+ /* @__PURE__ */ jsx(MenuLabel, { children: "Switch store" }),
247
+ /* @__PURE__ */ jsx(MenuRadioGroup, {
248
+ value: store.name,
249
+ onValueChange: onStore,
250
+ children: STORES.map((s) => /* @__PURE__ */ jsx(MenuRadioItem, {
251
+ value: s.name,
252
+ children: s.name
253
+ }, s.name))
254
+ }),
255
+ /* @__PURE__ */ jsx(MenuSeparator, {}),
256
+ /* @__PURE__ */ jsx(MenuItem, {
257
+ icon: /* @__PURE__ */ jsx(PlusIcon, {}),
258
+ children: "Add a store"
259
+ })
260
+ ]
261
+ })] });
262
+ }
263
+ function DemoSidebar({ active, navigate, open, setOpen, orders, store, setStore }) {
264
+ const shell = useShell();
265
+ const go = (id) => (event) => {
266
+ event.preventDefault();
267
+ navigate(id);
268
+ if (shell.mode === "mobile") shell.setDrawerOpen(false);
269
+ };
270
+ return /* @__PURE__ */ jsxs(Sidebar, {
271
+ label: store.name,
272
+ children: [
273
+ /* @__PURE__ */ jsxs(SidebarHeader, { children: [/* @__PURE__ */ jsx(ShellBrand, {
274
+ placement: "header",
275
+ name: "Store Dashboard"
276
+ }), /* @__PURE__ */ jsx(SidebarToggle, {})] }),
277
+ /* @__PURE__ */ jsx(SidebarNav, { children: NAV.map((group) => /* @__PURE__ */ jsx(SidebarSection, {
278
+ title: group.title,
279
+ children: group.items.map((item) => {
280
+ const childActive = item.children?.some((c) => c.id === active) ?? false;
281
+ return /* @__PURE__ */ jsx(SidebarItem, {
282
+ itemId: `frame-${item.id}`,
283
+ label: item.label,
284
+ ...icons(item.icon),
285
+ active: active === item.id,
286
+ current: childActive,
287
+ badge: item.id === "orders" ? orders : void 0,
288
+ badgeLabel: item.id === "orders" ? `${orders} orders to fulfil` : void 0,
289
+ link: item.page ? /* @__PURE__ */ jsx("a", { href: `#${item.id}` }) : void 0,
290
+ onSelect: item.page ? go(item.id) : void 0,
291
+ open: item.children ? open[item.id] ?? (active === item.id || childActive) : void 0,
292
+ onOpenChange: (next) => setOpen(item.id, next),
293
+ toggleLabel: `Show ${item.label.toLowerCase()} pages`,
294
+ children: item.children?.map((child) => /* @__PURE__ */ jsx(SidebarItem, {
295
+ itemId: `frame-${child.id}`,
296
+ label: child.label,
297
+ active: active === child.id,
298
+ link: /* @__PURE__ */ jsx("a", { href: `#${child.id}` }),
299
+ onSelect: go(child.id)
300
+ }, child.id))
301
+ }, item.id);
302
+ })
303
+ }, group.id)) }),
304
+ /* @__PURE__ */ jsx(SidebarFooter, { children: /* @__PURE__ */ jsx(StoreSwitcher, {
305
+ store,
306
+ onStore: setStore
307
+ }) })
308
+ ]
309
+ });
310
+ }
311
+ function DemoTopBar({ crumbs, onSearch }) {
312
+ return /* @__PURE__ */ jsx(TopBar, {
313
+ start: /* @__PURE__ */ jsx(Breadcrumbs, { items: crumbs }),
314
+ center: /* @__PURE__ */ jsx(SearchTrigger, {
315
+ hotkey: false,
316
+ width: 200,
317
+ onOpen: onSearch
318
+ }),
319
+ end: /* @__PURE__ */ jsxs(Fragment$1, { children: [
320
+ /* @__PURE__ */ jsx(Tooltip, {
321
+ content: "Ask Nebula",
322
+ children: /* @__PURE__ */ jsx(IconButton, {
323
+ label: "Ask Nebula",
324
+ children: /* @__PURE__ */ jsx(SparkleIcon, {})
325
+ })
326
+ }),
327
+ /* @__PURE__ */ jsx(Tooltip, {
328
+ content: "Notifications",
329
+ children: /* @__PURE__ */ jsx(IconButton, {
330
+ label: "Notifications",
331
+ children: /* @__PURE__ */ jsx(BellIcon, {})
332
+ })
333
+ }),
334
+ /* @__PURE__ */ jsx(Avatar, { name: "Priya Shah" })
335
+ ] })
336
+ });
337
+ }
338
+ var FULFILMENT = [
339
+ "Unfulfilled",
340
+ "Fulfilled",
341
+ "Unfulfilled",
342
+ "Shipped"
343
+ ];
344
+ function DemoPage({ title, orders, onOrder }) {
345
+ const shell = useShell();
346
+ const phone = shell.mode === "mobile";
347
+ const rows = [...TODAY].reverse().slice(0, 9);
348
+ return /* @__PURE__ */ jsxs("div", {
349
+ className: "app-shell-page",
350
+ children: [
351
+ /* @__PURE__ */ jsx("h3", {
352
+ className: "app-shell-page__title",
353
+ children: title
354
+ }),
355
+ /* @__PURE__ */ jsx("p", {
356
+ className: "app-shell-page__lead",
357
+ children: "This is the canvas, the one raised surface. It scrolls on its own while the sidebar and header stay put."
358
+ }),
359
+ /* @__PURE__ */ jsxs("div", {
360
+ className: "app-shell-page__state",
361
+ children: [/* @__PURE__ */ jsxs("dl", {
362
+ className: "app-shell-page__facts",
363
+ children: [
364
+ /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", { children: "Mode" }), /* @__PURE__ */ jsx("dd", { children: shell.mode })] }),
365
+ /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", { children: "Sidebar" }), /* @__PURE__ */ jsx("dd", { children: phone ? shell.drawerOpen ? "drawer open" : "drawer closed" : shell.collapsed ? "icon rail" : "expanded" })] }),
366
+ /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", { children: "Orders to fulfil" }), /* @__PURE__ */ jsx("dd", { children: orders })] })
367
+ ]
368
+ }), /* @__PURE__ */ jsxs("div", {
369
+ className: "app-shell-page__actions",
370
+ children: [phone ? /* @__PURE__ */ jsx(Button, {
371
+ size: "sm",
372
+ onClick: () => shell.setDrawerOpen(true),
373
+ children: "Open the drawer"
374
+ }) : /* @__PURE__ */ jsx(Button, {
375
+ size: "sm",
376
+ onClick: shell.toggleCollapsed,
377
+ children: shell.collapsed ? "Expand the sidebar" : "Fold the sidebar"
378
+ }), /* @__PURE__ */ jsx(Button, {
379
+ size: "sm",
380
+ icon: /* @__PURE__ */ jsx(PlusIcon, {}),
381
+ onClick: onOrder,
382
+ children: "Receive an order"
383
+ })]
384
+ })]
385
+ }),
386
+ /* @__PURE__ */ jsx("ul", {
387
+ className: "app-shell-page__rows",
388
+ children: rows.map((sale, i) => /* @__PURE__ */ jsxs("li", {
389
+ className: "app-shell-page__row",
390
+ children: [
391
+ /* @__PURE__ */ jsx(Avatar, {
392
+ size: "sm",
393
+ name: sale.customer
394
+ }),
395
+ /* @__PURE__ */ jsxs("span", {
396
+ className: "app-shell-page__who",
397
+ children: [/* @__PURE__ */ jsx("span", {
398
+ className: "app-shell-page__name",
399
+ children: sale.customer
400
+ }), /* @__PURE__ */ jsxs("span", {
401
+ className: "app-shell-page__meta",
402
+ children: [
403
+ "#",
404
+ sale.number,
405
+ " · ",
406
+ sale.items,
407
+ " ",
408
+ sale.items === 1 ? "item" : "items"
409
+ ]
410
+ })]
411
+ }),
412
+ /* @__PURE__ */ jsx(Badge, {
413
+ size: "sm",
414
+ tone: sale.status === "refunded" ? "negative" : FULFILMENT[i % 4] === "Unfulfilled" ? "warning" : "positive",
415
+ children: sale.status === "refunded" ? "Refunded" : FULFILMENT[i % 4]
416
+ }),
417
+ /* @__PURE__ */ jsx("span", {
418
+ className: "app-shell-page__amount",
419
+ children: formatGbp(sale.amount)
420
+ })
421
+ ]
422
+ }, sale.id))
423
+ })
424
+ ]
425
+ });
426
+ }
427
+ function HarbourShell({ shellProps }) {
428
+ const [active, setActive] = useState("orders");
429
+ const [open, setOpenState] = useState({});
430
+ const [orders, setOrders] = useState(12);
431
+ const [storeName, setStoreName] = useState(STORES[0].name);
432
+ const [searching, setSearching] = useState(false);
433
+ const store = STORES.find((s) => s.name === storeName) ?? STORES[0];
434
+ const page = findPage(active);
435
+ const crumbs = page.parent ? [{
436
+ key: page.parent.id,
437
+ label: page.parent.label,
438
+ link: page.parent.page ? /* @__PURE__ */ jsx("a", {
439
+ href: `#${page.parent.id}`,
440
+ onClick: (e) => {
441
+ e.preventDefault();
442
+ setActive(page.parent.id);
443
+ }
444
+ }) : void 0
445
+ }, {
446
+ key: active,
447
+ label: page.label
448
+ }] : [{
449
+ key: active,
450
+ label: page.label
451
+ }];
452
+ const state = {
453
+ active,
454
+ navigate: setActive,
455
+ open,
456
+ setOpen: (id, next) => setOpenState((o) => ({
457
+ ...o,
458
+ [id]: next
459
+ })),
460
+ orders,
461
+ store,
462
+ setStore: setStoreName
463
+ };
464
+ return /* @__PURE__ */ jsxs("div", {
465
+ className: "app-shell-frame",
466
+ children: [/* @__PURE__ */ jsx(AppShell, {
467
+ ...shellProps,
468
+ sidebar: /* @__PURE__ */ jsx(DemoSidebar, { ...state }),
469
+ header: /* @__PURE__ */ jsx(DemoTopBar, {
470
+ crumbs,
471
+ onSearch: () => setSearching(true)
472
+ }),
473
+ children: /* @__PURE__ */ jsx(Canvas, { children: /* @__PURE__ */ jsx(DemoPage, {
474
+ title: page.label,
475
+ orders,
476
+ onOrder: () => setOrders((n) => n + 1)
477
+ }) })
478
+ }), /* @__PURE__ */ jsxs(CommandPalette, {
479
+ open: searching,
480
+ onOpenChange: setSearching,
481
+ label: `Search ${store.name}`,
482
+ children: [/* @__PURE__ */ jsx(CommandEmpty, {
483
+ description: "Try a page name, like orders or discounts.",
484
+ children: "No pages match that"
485
+ }), /* @__PURE__ */ jsx(CommandGroup, {
486
+ heading: "Go to",
487
+ children: NAV.flatMap((g) => g.items).flatMap((item) => [...item.page ? [{
488
+ id: item.id,
489
+ label: item.label,
490
+ icon: item.icon
491
+ }] : [], ...(item.children ?? []).map((c) => ({
492
+ ...c,
493
+ icon: item.icon
494
+ }))]).map((entry) => {
495
+ const EntryIcon = entry.icon;
496
+ return /* @__PURE__ */ jsx(CommandItem, {
497
+ value: entry.id,
498
+ keywords: [entry.label],
499
+ icon: /* @__PURE__ */ jsx(EntryIcon, {}),
500
+ onSelect: () => {
501
+ setSearching(false);
502
+ setActive(entry.id);
503
+ },
504
+ children: entry.label
505
+ }, entry.id);
506
+ })
507
+ })]
508
+ })]
509
+ });
510
+ }
511
+ function SpecimenSidebar({ collapsed, orders = 12, children }) {
512
+ const [active, setActive] = useState("returns");
513
+ const [open, setOpen] = useState({});
514
+ const select = (id) => (event) => {
515
+ event.preventDefault();
516
+ setActive(id);
517
+ };
518
+ return /* @__PURE__ */ jsx("div", {
519
+ className: "app-shell-specimen",
520
+ "data-collapsed": collapsed ? "" : void 0,
521
+ children: /* @__PURE__ */ jsxs(Sidebar, {
522
+ collapsed,
523
+ label: `Harbour Desk Co${collapsed ? ", icon rail" : ""}`,
524
+ children: [
525
+ /* @__PURE__ */ jsxs(SidebarHeader, { children: [/* @__PURE__ */ jsx(ShellBrand, {
526
+ placement: "header",
527
+ name: "Store Dashboard"
528
+ }), children] }),
529
+ /* @__PURE__ */ jsxs(SidebarNav, { children: [
530
+ /* @__PURE__ */ jsx(SidebarSection, { children: /* @__PURE__ */ jsx(SidebarItem, {
531
+ itemId: "home",
532
+ label: "Home",
533
+ ...icons(HouseIcon),
534
+ active: active === "home",
535
+ link: /* @__PURE__ */ jsx("a", { href: "#home" }),
536
+ onSelect: select("home")
537
+ }) }),
538
+ /* @__PURE__ */ jsxs(SidebarSection, {
539
+ title: "Commerce",
540
+ children: [
541
+ /* @__PURE__ */ jsxs(SidebarItem, {
542
+ itemId: "orders",
543
+ label: "Orders",
544
+ ...icons(ReceiptIcon),
545
+ active: active === "orders",
546
+ current: ["drafts", "returns"].includes(active),
547
+ badge: orders,
548
+ badgeLabel: `${orders} orders to fulfil`,
549
+ link: /* @__PURE__ */ jsx("a", { href: "#orders" }),
550
+ onSelect: select("orders"),
551
+ open: open.orders ?? true,
552
+ onOpenChange: (v) => setOpen((o) => ({
553
+ ...o,
554
+ orders: v
555
+ })),
556
+ toggleLabel: "Show order pages",
557
+ children: [/* @__PURE__ */ jsx(SidebarItem, {
558
+ itemId: "drafts",
559
+ label: "Drafts",
560
+ active: active === "drafts",
561
+ link: /* @__PURE__ */ jsx("a", { href: "#drafts" }),
562
+ onSelect: select("drafts")
563
+ }), /* @__PURE__ */ jsx(SidebarItem, {
564
+ itemId: "returns",
565
+ label: "Returns",
566
+ active: active === "returns",
567
+ link: /* @__PURE__ */ jsx("a", { href: "#returns" }),
568
+ onSelect: select("returns")
569
+ })]
570
+ }),
571
+ /* @__PURE__ */ jsxs(SidebarItem, {
572
+ itemId: "catalogue",
573
+ label: "Catalogue",
574
+ ...icons(PackageIcon),
575
+ open: open.catalogue ?? false,
576
+ onOpenChange: (v) => setOpen((o) => ({
577
+ ...o,
578
+ catalogue: v
579
+ })),
580
+ children: [/* @__PURE__ */ jsx(SidebarItem, {
581
+ itemId: "products",
582
+ label: "Products",
583
+ active: active === "products",
584
+ link: /* @__PURE__ */ jsx("a", { href: "#products" }),
585
+ onSelect: select("products")
586
+ }), /* @__PURE__ */ jsx(SidebarItem, {
587
+ itemId: "inventory",
588
+ label: "Inventory",
589
+ active: active === "inventory",
590
+ link: /* @__PURE__ */ jsx("a", { href: "#inventory" }),
591
+ onSelect: select("inventory")
592
+ })]
593
+ }),
594
+ /* @__PURE__ */ jsx(SidebarItem, {
595
+ itemId: "customers",
596
+ label: "Customers",
597
+ ...icons(UsersThreeIcon),
598
+ active: active === "customers",
599
+ link: /* @__PURE__ */ jsx("a", { href: "#customers" }),
600
+ onSelect: select("customers")
601
+ })
602
+ ]
603
+ }),
604
+ /* @__PURE__ */ jsx(SidebarSection, {
605
+ title: "Insights",
606
+ children: /* @__PURE__ */ jsx(SidebarItem, {
607
+ itemId: "analytics",
608
+ label: "Analytics",
609
+ ...icons(ChartLineUpIcon),
610
+ active: active === "analytics",
611
+ link: /* @__PURE__ */ jsx("a", { href: "#analytics" }),
612
+ onSelect: select("analytics")
613
+ })
614
+ })
615
+ ] }),
616
+ /* @__PURE__ */ jsx(SidebarFooter, { children: /* @__PURE__ */ jsx(StoreButton, {
617
+ name: "Harbour Desk Co",
618
+ detail: "harbourdesk.co.uk",
619
+ avatar: /* @__PURE__ */ jsx(Avatar, {
620
+ shape: "square",
621
+ size: "sm",
622
+ name: "Harbour Desk Co"
623
+ })
624
+ }) })
625
+ ]
626
+ })
627
+ });
628
+ }
629
+ function ItemsDemo() {
630
+ const [orders, setOrders] = useState(12);
631
+ return /* @__PURE__ */ jsxs("div", {
632
+ className: "app-shell-items",
633
+ children: [
634
+ /* @__PURE__ */ jsx(SpecimenSidebar, {
635
+ collapsed: false,
636
+ orders
637
+ }),
638
+ /* @__PURE__ */ jsx(SpecimenSidebar, {
639
+ collapsed: true,
640
+ orders
641
+ }),
642
+ /* @__PURE__ */ jsxs("div", {
643
+ className: "app-shell-items__side",
644
+ children: [/* @__PURE__ */ jsx(Button, {
645
+ icon: /* @__PURE__ */ jsx(PlusIcon, {}),
646
+ onClick: () => setOrders((n) => n + 1),
647
+ children: "Receive an order"
648
+ }), /* @__PURE__ */ jsx("p", {
649
+ className: "app-shell-items__note",
650
+ children: "The count bumps and the Orders icon sends out one ping. In the rail the count is a teal dot."
651
+ })]
652
+ })
653
+ ]
654
+ });
655
+ }
656
+ function Pair() {
657
+ return /* @__PURE__ */ jsxs("div", {
658
+ className: "app-shell-pair",
659
+ children: [/* @__PURE__ */ jsx(SpecimenSidebar, { collapsed: false }), /* @__PURE__ */ jsx(SpecimenSidebar, { collapsed: true })]
660
+ });
661
+ }
662
+ var ANATOMY = `
663
+ import {
664
+ AppShell, Canvas, Sidebar, SidebarHeader, SidebarNav, SidebarSection, SidebarItem,
665
+ SidebarFooter, StoreButton, ShellBrand, SidebarToggle, TopBar, Breadcrumbs, SearchTrigger, Avatar,
666
+ } from '@orbitcommerce/constellation'
667
+ import { HouseIcon, ReceiptIcon } from '@orbitcommerce/constellation/icons'
668
+ import { Link, NavLink } from 'react-router'
669
+
670
+ <AppShell
671
+ sidebar={
672
+ <Sidebar label="Harbour Desk Co">
673
+ <SidebarHeader>
674
+ <Link to="/">
675
+ <ShellBrand placement="header" name="Store Dashboard" />
676
+ </Link>
677
+ <SidebarToggle />
678
+ </SidebarHeader>
679
+ <SidebarNav>
680
+ <SidebarSection>
681
+ <SidebarItem label="Home" icon={<HouseIcon />} activeIcon={<HouseIcon weight="duotone" />}
682
+ link={<NavLink to="/" />} active={path === '/'} />
683
+ </SidebarSection>
684
+ <SidebarSection title="Commerce">
685
+ <SidebarItem label="Orders" icon={<ReceiptIcon />} activeIcon={<ReceiptIcon weight="duotone" />}
686
+ link={<NavLink to="/orders" />} active={path === '/orders'} current={path.startsWith('/orders/')}
687
+ badge={toFulfil} badgeLabel={\`\${toFulfil} orders to fulfil\`} toggleLabel="Show order pages">
688
+ <SidebarItem label="Drafts" link={<NavLink to="/orders/drafts" />} active={path === '/orders/drafts'} />
689
+ <SidebarItem label="Returns" link={<NavLink to="/orders/returns" />} active={path === '/orders/returns'} />
690
+ </SidebarItem>
691
+ </SidebarSection>
692
+ </SidebarNav>
693
+ <SidebarFooter>
694
+ {/* The host's store switcher: a Menu opening upwards, triggered by the StoreButton. */}
695
+ <StoreButton
696
+ name="Harbour Desk Co"
697
+ detail="harbourdesk.co.uk"
698
+ avatar={<Avatar shape="square" size="sm" name="Harbour Desk Co" />}
699
+ />
700
+ </SidebarFooter>
701
+ </Sidebar>
702
+ }
703
+ header={
704
+ <TopBar
705
+ start={<Breadcrumbs items={[{ label: 'Orders', link: <Link to="/orders" /> }, { label: 'Returns' }]} />}
706
+ center={<SearchTrigger onOpen={() => setSearchOpen(true)} />}
707
+ end={<>{/* ghost icon buttons, View store, the account avatar */}</>}
708
+ />
709
+ }
710
+ >
711
+ <Canvas>{/* the page */}</Canvas>
712
+ </AppShell>`;
713
+ function Page() {
714
+ return /* @__PURE__ */ jsxs(DocPage, {
715
+ title: "App shell",
716
+ status: "new",
717
+ importNames: [
718
+ "AppShell",
719
+ "Canvas",
720
+ "Sidebar",
721
+ "SidebarItem",
722
+ "TopBar"
723
+ ],
724
+ lead: "The Orbit app frame: the merchant's store and navigation on the porcelain ground, a slim header across the top, and every page on one white canvas raised on it. Use it once, at the root of every Orbit dashboard.",
725
+ children: [
726
+ /* @__PURE__ */ jsx(ForAudience, {
727
+ audience: "public",
728
+ children: /* @__PURE__ */ jsx(Note, {
729
+ title: "Building a plugin?",
730
+ children: "A plugin runs inside Orbit Commerce's dashboard, which already draws this frame around it, so a plugin page needs only what goes on the canvas. The shell is shown here so your pages fit the frame they sit in."
731
+ })
732
+ }),
733
+ /* @__PURE__ */ jsxs(Section$1, {
734
+ id: "frame",
735
+ title: "The frame, live",
736
+ description: /* @__PURE__ */ jsxs("p", { children: [
737
+ "A whole shell for an invented shop, Harbour Desk Co, in a fixed-height frame. Move between pages and watch the white pill glide, open the store switcher at the foot, press Receive an order, and fold the sidebar with the toggle beside the logo or the ",
738
+ /* @__PURE__ */ jsx(Kbd, { children: "[" }),
739
+ " key. On this page ",
740
+ /* @__PURE__ */ jsx(Kbd, { children: "[" }),
741
+ " folds this demo frame; the docs site's own sidebar is held open."
742
+ ] }),
743
+ children: [/* @__PURE__ */ jsx(Example, {
744
+ align: "fill",
745
+ children: /* @__PURE__ */ jsx(HarbourShell, {})
746
+ }), /* @__PURE__ */ jsx(Note, {
747
+ title: "Resize to see phones",
748
+ children: "The shell picks its mode from the window width, not its container, so this frame turns into the phone layout when the browser is narrower than 768px. On a phone it shows a menu button and a drawer."
749
+ })]
750
+ }),
751
+ /* @__PURE__ */ jsxs(Section$1, {
752
+ id: "anatomy",
753
+ title: "Anatomy",
754
+ description: /* @__PURE__ */ jsx("p", { children: "Two planes: the ground (sidebar and header) and the raised canvas. Every part is a separate component, so hosts compose their own sidebar and header." }),
755
+ children: [/* @__PURE__ */ jsx(DocTable, {
756
+ columns: ["Part", "What it is"],
757
+ rows: [
758
+ [/* @__PURE__ */ jsx("code", { children: "AppShell" }), "The grid: sidebar on the left, header across the top, the canvas in the rest. Full height (100dvh). Owns the folded rail, the phone drawer and the [ key."],
759
+ [/* @__PURE__ */ jsx("code", { children: "Sidebar" }), "The navigation column on the ground, 256px wide or a 68px icon rail. One white pill marks the page you are on and one soft pill follows the pointer."],
760
+ [/* @__PURE__ */ jsx("code", { children: "SidebarHeader" }), "The 60px row at the top, lined up with the header. Holds the app's lockup (ShellBrand, linking home) and the SidebarToggle."],
761
+ [/* @__PURE__ */ jsx("code", { children: "ShellBrand" }), "The app's lockup, top left: the Orbit mark, the app's name (name=\"Store Dashboard\") and \"by Orbit Commerce\". In the rail it shrinks to the mark, and the toggle shows over it on hover."],
762
+ [/* @__PURE__ */ jsx("code", { children: "SidebarNav" }), "The scrolling list of sections. Items fade under its top and bottom edges rather than being cut off."],
763
+ [/* @__PURE__ */ jsx("code", { children: "SidebarSection" }), "A group with a quiet sentence-case title. In the rail the title becomes a short hairline tick."],
764
+ [/* @__PURE__ */ jsx("code", { children: "SidebarItem" }), "A 32px row: icon, label and an optional count. Holds one level of nested items."],
765
+ [/* @__PURE__ */ jsx("code", { children: "SidebarFooter" }), "The foot of the sidebar: the merchant's store, as a StoreButton that opens the host's store switcher upwards."],
766
+ [/* @__PURE__ */ jsx("code", { children: "StoreButton" }), "The merchant's store: logo or initials, name and domain, with a chevron. In the rail, only the logo."],
767
+ [/* @__PURE__ */ jsx("code", { children: "TopBar" }), "The 60px header on the ground: breadcrumbs at the start, the search pill in the centre, actions at the end."],
768
+ [/* @__PURE__ */ jsx("code", { children: "Breadcrumbs" }), "Where you are, in 28px pills. The last crumb is the current page."],
769
+ [/* @__PURE__ */ jsx("code", { children: "Canvas" }), "The raised white page, inset 8px from the edges with 18px corners. It scrolls inside itself, so the frame never moves."]
770
+ ]
771
+ }), /* @__PURE__ */ jsx(SubSection, {
772
+ title: "Putting it together",
773
+ children: /* @__PURE__ */ jsx(CodeBlock$1, { code: ANATOMY })
774
+ })]
775
+ }),
776
+ /* @__PURE__ */ jsxs(Section$1, {
777
+ id: "items",
778
+ title: "Sidebar items",
779
+ description: /* @__PURE__ */ jsxs("p", { children: [
780
+ /* @__PURE__ */ jsx("code", { children: "active" }),
781
+ " marks the page you are on: the white pill settles there, the label turns ink and the icon swaps to its duotone ",
782
+ /* @__PURE__ */ jsx("code", { children: "activeIcon" }),
783
+ " in teal. ",
784
+ /* @__PURE__ */ jsx("code", { children: "current" }),
785
+ " marks a parent whose child page is active: it reads as current without taking the pill. Here Returns is active and Orders is current."
786
+ ] }),
787
+ children: [
788
+ /* @__PURE__ */ jsx(Example, {
789
+ align: "fill",
790
+ code: `
791
+ <SidebarItem
792
+ label="Orders"
793
+ icon={<ReceiptIcon />}
794
+ activeIcon={<ReceiptIcon weight="duotone" />}
795
+ link={<NavLink to="/orders" />}
796
+ current // a child page is active
797
+ badge={12}
798
+ badgeLabel="12 orders to fulfil"
799
+ toggleLabel="Show order pages"
800
+ >
801
+ <SidebarItem label="Drafts" link={<NavLink to="/orders/drafts" />} />
802
+ <SidebarItem label="Returns" link={<NavLink to="/orders/returns" />} active />
803
+ </SidebarItem>
804
+
805
+ // No page of its own: pressing the row opens its children.
806
+ <SidebarItem label="Catalogue" icon={<PackageIcon />}>
807
+ <SidebarItem label="Products" link={<NavLink to="/products" />} />
808
+ </SidebarItem>`,
809
+ children: /* @__PURE__ */ jsx(ItemsDemo, {})
810
+ }),
811
+ /* @__PURE__ */ jsx(SubSection, {
812
+ title: "Nested items",
813
+ description: /* @__PURE__ */ jsxs("p", { children: [
814
+ "Children hang off a hairline orbit that runs through the icons' centre, and a small teal satellite rides the active nested pill. A parent with its own page (Orders) keeps its link and gets a separate chevron button to open and close; a parent without one (Catalogue) is a button that opens its children. Groups open and close with ",
815
+ /* @__PURE__ */ jsx("code", { children: "open" }),
816
+ ", ",
817
+ /* @__PURE__ */ jsx("code", { children: "defaultOpen" }),
818
+ " and ",
819
+ /* @__PURE__ */ jsx("code", { children: "onOpenChange" }),
820
+ ", and stay closed in the rail. One level of nesting is all there is."
821
+ ] })
822
+ }),
823
+ /* @__PURE__ */ jsx(SubSection, {
824
+ title: "Counts",
825
+ description: /* @__PURE__ */ jsxs("p", { children: [
826
+ /* @__PURE__ */ jsx("code", { children: "badge" }),
827
+ " puts a small count on the right, in teal numerals on a teal tint. When a numeric badge goes up, it bumps and the icon sends out one ping, so a new order is noticed without a toast. The count is hidden from the item's name; ",
828
+ /* @__PURE__ */ jsx("code", { children: "badgeLabel" }),
829
+ " gives screen readers the full meaning, such as \"12 orders to fulfil\". In the rail the count shrinks to a 7px teal dot."
830
+ ] })
831
+ }),
832
+ /* @__PURE__ */ jsx(SubSection, {
833
+ title: "Links",
834
+ description: /* @__PURE__ */ jsxs("p", { children: [
835
+ "Pass your router's link as ",
836
+ /* @__PURE__ */ jsx("code", { children: "link" }),
837
+ ", for example",
838
+ " ",
839
+ /* @__PURE__ */ jsx("code", { children: "link={<NavLink to=\"/orders\" />}" }),
840
+ ". The shell fills it with the icon, label and count, adds its classes, and sets ",
841
+ /* @__PURE__ */ jsx("code", { children: "aria-current=\"page\"" }),
842
+ " when the item is active. Without",
843
+ " ",
844
+ /* @__PURE__ */ jsx("code", { children: "link" }),
845
+ " the row is a button, and ",
846
+ /* @__PURE__ */ jsx("code", { children: "onSelect" }),
847
+ " runs on every press either way."
848
+ ] })
849
+ })
850
+ ]
851
+ }),
852
+ /* @__PURE__ */ jsxs(Section$1, {
853
+ id: "rail",
854
+ title: "Expanded and the icon rail",
855
+ description: /* @__PURE__ */ jsx("p", { children: "Folded, the sidebar becomes a 68px rail: labels fade out, section titles become hairline ticks, counts become dots, the store shows only its logo, and each item's name moves into a tooltip on the right. The columns resize on the settle spring over 480ms. Both states side by side, in both themes:" }),
856
+ children: [
857
+ /* @__PURE__ */ jsx(ThemePair, {
858
+ align: "fill",
859
+ children: /* @__PURE__ */ jsx(Pair, {})
860
+ }),
861
+ /* @__PURE__ */ jsx(Guidelines, { items: [
862
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Kbd, { children: "[" }), " folds and unfolds the rail on desktop and tablet. It is ignored while someone is typing in a field, and when a modifier key is held."] }),
863
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
864
+ /* @__PURE__ */ jsx("code", { children: "SidebarToggle" }),
865
+ " does the same from beside the logo. In the rail it waits over the mark and shows on hover or keyboard focus. Its tooltip shows the ",
866
+ /* @__PURE__ */ jsx(Kbd, { children: "[" }),
867
+ " key."
868
+ ] }),
869
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
870
+ "Leave the state to the shell, or control it with ",
871
+ /* @__PURE__ */ jsx("code", { children: "collapsed" }),
872
+ " and ",
873
+ /* @__PURE__ */ jsx("code", { children: "onCollapsedChange" }),
874
+ ". To keep the merchant's choice from one visit to the next, give the shell a ",
875
+ /* @__PURE__ */ jsx("code", { children: "rememberCollapsed" }),
876
+ " key: it starts as the last visit left it and writes each fold."
877
+ ] })
878
+ ] }),
879
+ /* @__PURE__ */ jsx(CodeBlock$1, { code: `
880
+ // Starts as the last visit left it (open on a first visit), and remembers each fold and unfold.
881
+ <AppShell rememberCollapsed="sidebar-collapsed" sidebar={…} header={…}>` })
882
+ ]
883
+ }),
884
+ /* @__PURE__ */ jsxs(Section$1, {
885
+ id: "hover-rail",
886
+ title: "The rail that opens on hover",
887
+ description: /* @__PURE__ */ jsxs("p", { children: [
888
+ "With ",
889
+ /* @__PURE__ */ jsx("code", { children: "expandOnHover" }),
890
+ " the sidebar rests as the icon rail and opens over the page while the pointer rests on it or keyboard focus is inside it, then folds when they leave. The page keeps its place underneath: the rail's column stays 68px and the sidebar lies over the header and the canvas on the modal shadow, as the phone drawer does. Rest the pointer on the rail below, or Tab into it."
891
+ ] }),
892
+ children: [
893
+ /* @__PURE__ */ jsx(Example, {
894
+ align: "fill",
895
+ code: `
896
+ <AppShell expandOnHover rememberCollapsed="sidebar-collapsed" sidebar={…} header={…}>
897
+ <Canvas id="main-content">…</Canvas>
898
+ </AppShell>`,
899
+ children: /* @__PURE__ */ jsx(HarbourShell, { shellProps: { expandOnHover: true } })
900
+ }),
901
+ /* @__PURE__ */ jsx(Guidelines, { items: [
902
+ "The pointer rests a moment before the rail opens, so a pointer crossing it on its way to the window edge opens nothing, and a pointer that slips off its edge for an instant keeps it open. A touch never opens it.",
903
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
904
+ "While it is open over the page, the rail button reads \"Keep sidebar open\" and pins it: the sidebar takes its column back and the page moves over. Pressing it again folds the rail, which then stays folded under the hand that folded it until the pointer has left and come back. ",
905
+ /* @__PURE__ */ jsx(Kbd, { children: "[" }),
906
+ " pins and folds it too."
907
+ ] }),
908
+ "A menu opened from the rail, such as the store switcher, holds it open while the menu is open. Escape folds it.",
909
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
910
+ "It reads as the rail to the page: ",
911
+ /* @__PURE__ */ jsx("code", { children: "useShell().collapsed" }),
912
+ " is false while it is open over the page (the sidebar draws itself open) and ",
913
+ /* @__PURE__ */ jsx("code", { children: "peeking" }),
914
+ " says why."
915
+ ] })
916
+ ] }),
917
+ /* @__PURE__ */ jsx(Fragment$1, {})
918
+ ]
919
+ }),
920
+ /* @__PURE__ */ jsxs(Section$1, {
921
+ id: "responsive",
922
+ title: "Tablet and phone",
923
+ description: /* @__PURE__ */ jsxs("p", { children: [
924
+ "The shell reads the window width, reports it as ",
925
+ /* @__PURE__ */ jsx("code", { children: "mode" }),
926
+ ", and changes shape only on phones."
927
+ ] }),
928
+ children: [/* @__PURE__ */ jsx(DocTable, {
929
+ columns: [
930
+ "Window",
931
+ "Mode",
932
+ "What changes"
933
+ ],
934
+ rows: [
935
+ [
936
+ "1024px and wider",
937
+ /* @__PURE__ */ jsx("code", { children: "desktop" }),
938
+ "The 256px sidebar, folding to the 68px rail with [ or the toggle."
939
+ ],
940
+ [
941
+ "768 to 1023px",
942
+ /* @__PURE__ */ jsx("code", { children: "tablet" }),
943
+ "Nothing: the sidebar and its rail stay as on desktop. The mode is there if a host wants to fold the sidebar by default."
944
+ ],
945
+ [
946
+ "Below 768px",
947
+ /* @__PURE__ */ jsx("code", { children: "mobile" }),
948
+ "The sidebar becomes a drawer: up to 304px or 86% of the width, rounded 22px on its open edge, on the modal shadow, sliding on the settle spring over a dimmed, lightly blurred scrim. The header gains a 36px menu button and drops its centre, breadcrumbs show only the current page, and the canvas insets 6px with 16px corners."
949
+ ]
950
+ ]
951
+ }), /* @__PURE__ */ jsx(Guidelines, { items: [
952
+ "The menu button opens the drawer; tapping the scrim or pressing Escape closes it, and so does widening the window past 768px.",
953
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
954
+ "Close the drawer yourself when a page is chosen: call ",
955
+ /* @__PURE__ */ jsx("code", { children: "setDrawerOpen(false)" }),
956
+ " from",
957
+ " ",
958
+ /* @__PURE__ */ jsx("code", { children: "useShell()" }),
959
+ " in the item's ",
960
+ /* @__PURE__ */ jsx("code", { children: "onSelect" }),
961
+ ", as the frame above does."
962
+ ] }),
963
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
964
+ "The shell moves focus for you. As the drawer opens, focus goes to the page you are on in it. Closed with nothing chosen (Escape, the scrim), focus goes back to the menu button; closed because a page was chosen, to the page's content: the element with the skip link's id (",
965
+ /* @__PURE__ */ jsx("code", { children: "#main-content" }),
966
+ "), else the canvas, which takes focus without a ring. Focus the person has already put somewhere else stays there, and it never drops to the page body."
967
+ ] }),
968
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
969
+ "On phones the rail does not exist: ",
970
+ /* @__PURE__ */ jsx("code", { children: "collapsed" }),
971
+ " reads false and ",
972
+ /* @__PURE__ */ jsx("code", { children: "[" }),
973
+ " does nothing."
974
+ ] }),
975
+ "Drop the actions that do not fit a phone header, the way Orbit Commerce's store dashboard drops View store, the plan pill and help on phones."
976
+ ] })]
977
+ }),
978
+ /* @__PURE__ */ jsxs(Section$1, {
979
+ id: "use-shell",
980
+ title: "useShell and useOptionalShell",
981
+ description: /* @__PURE__ */ jsxs("p", { children: [
982
+ "Anything inside ",
983
+ /* @__PURE__ */ jsx("code", { children: "AppShell" }),
984
+ " can read and drive the frame. ",
985
+ /* @__PURE__ */ jsx("code", { children: "useShell()" }),
986
+ " throws outside a shell; ",
987
+ /* @__PURE__ */ jsx("code", { children: "useOptionalShell()" }),
988
+ " returns null instead, for parts that also render on their own (the sidebar, the header and the toggle use it). The frame's canvas above reads it to show the mode and to fold the sidebar."
989
+ ] }),
990
+ children: [/* @__PURE__ */ jsx(DocTable, {
991
+ columns: [
992
+ "Value",
993
+ "Type",
994
+ "What it is"
995
+ ],
996
+ rows: [
997
+ [
998
+ /* @__PURE__ */ jsx("code", { children: "mode" }),
999
+ /* @__PURE__ */ jsx("code", { children: "'desktop' | 'tablet' | 'mobile'" }),
1000
+ "From the window width: 1024px and up, 768 to 1023px, below 768px."
1001
+ ],
1002
+ [
1003
+ /* @__PURE__ */ jsx("code", { children: "collapsed" }),
1004
+ /* @__PURE__ */ jsx("code", { children: "boolean" }),
1005
+ "The sidebar is the icon rail. Always false on phones."
1006
+ ],
1007
+ [
1008
+ /* @__PURE__ */ jsx("code", { children: "setCollapsed" }),
1009
+ /* @__PURE__ */ jsx("code", { children: "(next: boolean) => void" }),
1010
+ "Fold or unfold the rail."
1011
+ ],
1012
+ [
1013
+ /* @__PURE__ */ jsx("code", { children: "toggleCollapsed" }),
1014
+ /* @__PURE__ */ jsx("code", { children: "() => void" }),
1015
+ "Flip it."
1016
+ ],
1017
+ [
1018
+ /* @__PURE__ */ jsx("code", { children: "drawerOpen" }),
1019
+ /* @__PURE__ */ jsx("code", { children: "boolean" }),
1020
+ "The phone drawer is open."
1021
+ ],
1022
+ [
1023
+ /* @__PURE__ */ jsx("code", { children: "setDrawerOpen" }),
1024
+ /* @__PURE__ */ jsx("code", { children: "(next: boolean) => void" }),
1025
+ "Open or close the drawer."
1026
+ ],
1027
+ [
1028
+ /* @__PURE__ */ jsx("code", { children: "peeking" }),
1029
+ /* @__PURE__ */ jsx("code", { children: "boolean" }),
1030
+ "With expandOnHover: the folded rail is open over the page. collapsed reads false meanwhile."
1031
+ ]
1032
+ ]
1033
+ }), /* @__PURE__ */ jsx(CodeBlock$1, { code: `
1034
+ import { useShell } from '@orbitcommerce/constellation'
1035
+
1036
+ function PageHeader() {
1037
+ const shell = useShell()
1038
+ return shell.mode === 'mobile' ? null : <Button size="sm">View store</Button>
1039
+ }` })]
1040
+ }),
1041
+ /* @__PURE__ */ jsxs(Section$1, {
1042
+ id: "top-bar",
1043
+ title: "Header, breadcrumbs and brand",
1044
+ description: /* @__PURE__ */ jsxs("p", { children: [
1045
+ /* @__PURE__ */ jsx("code", { children: "TopBar" }),
1046
+ " takes three slots. ",
1047
+ /* @__PURE__ */ jsx("code", { children: "start" }),
1048
+ " holds ",
1049
+ /* @__PURE__ */ jsx("code", { children: "Breadcrumbs" }),
1050
+ " (or a page title),",
1051
+ " ",
1052
+ /* @__PURE__ */ jsx("code", { children: "center" }),
1053
+ " the ",
1054
+ /* @__PURE__ */ jsx(DocLink, {
1055
+ to: "/components/command-palette",
1056
+ children: "search pill"
1057
+ }),
1058
+ " that grows into the command palette, and ",
1059
+ /* @__PURE__ */ jsx("code", { children: "end" }),
1060
+ " the actions: ghost icon buttons 4px apart, the View store pill and the account avatar. ",
1061
+ /* @__PURE__ */ jsx("code", { children: "ShellBrand" }),
1062
+ " is the Orbit logo: ",
1063
+ /* @__PURE__ */ jsx("code", { children: "placement=\"header\"" }),
1064
+ " for the app's logo top left of the sidebar, or the default quiet signature (with an optional ",
1065
+ /* @__PURE__ */ jsx("code", { children: "meta" }),
1066
+ " such as a version) for a footer. Both turn to the mark alone in the rail."
1067
+ ] }),
1068
+ children: [
1069
+ /* @__PURE__ */ jsx(Example, {
1070
+ surface: "ground",
1071
+ code: `
1072
+ <Breadcrumbs
1073
+ items={[
1074
+ { label: 'Orders', link: <Link to="/orders" /> },
1075
+ { label: 'Returns' },
1076
+ ]}
1077
+ />
1078
+
1079
+ <ShellBrand meta="v2.4" />`,
1080
+ children: /* @__PURE__ */ jsxs("div", {
1081
+ className: "app-shell-crumbs",
1082
+ children: [/* @__PURE__ */ jsx(Breadcrumbs, { items: [{
1083
+ key: "orders",
1084
+ label: "Orders",
1085
+ link: /* @__PURE__ */ jsx("a", { href: "#top-bar" })
1086
+ }, {
1087
+ key: "returns",
1088
+ label: "Returns"
1089
+ }] }), /* @__PURE__ */ jsx("div", {
1090
+ className: "app-shell-crumbs__brand",
1091
+ children: /* @__PURE__ */ jsx(ShellBrand, { meta: "v2.4" })
1092
+ })]
1093
+ })
1094
+ }),
1095
+ /* @__PURE__ */ jsx(Fragment$1, {}),
1096
+ /* @__PURE__ */ jsxs(Note, {
1097
+ title: "Narrow headers",
1098
+ children: [
1099
+ "The search pill keeps its full width while there is any room at all, so in a narrow header (a tablet with the sidebar open, or a panel docked beside the canvas) a long row of actions at the end runs into it. Keep the end to a few icon buttons there, or pass the ",
1100
+ /* @__PURE__ */ jsx("code", { children: "SearchTrigger" }),
1101
+ " a smaller ",
1102
+ /* @__PURE__ */ jsx("code", { children: "width" }),
1103
+ ", as the frame above does."
1104
+ ]
1105
+ }),
1106
+ /* @__PURE__ */ jsxs(Note, {
1107
+ title: "Inside this docs site",
1108
+ children: [
1109
+ "The docs site is itself built on ",
1110
+ /* @__PURE__ */ jsx("code", { children: "AppShell" }),
1111
+ ", so the phone rules reach anything on this page: on a phone, the breadcrumbs above show only their last crumb, just as they would in a real header."
1112
+ ]
1113
+ })
1114
+ ]
1115
+ }),
1116
+ /* @__PURE__ */ jsxs(Section$1, {
1117
+ id: "guidelines",
1118
+ title: "Guidelines",
1119
+ children: [/* @__PURE__ */ jsx(DoDont, {
1120
+ do: {
1121
+ children: /* @__PURE__ */ jsx("div", {
1122
+ className: "app-shell-dodont",
1123
+ children: /* @__PURE__ */ jsx(Sidebar, {
1124
+ collapsed: false,
1125
+ label: "Do example",
1126
+ children: /* @__PURE__ */ jsx(SidebarNav, {
1127
+ label: "Do example",
1128
+ children: /* @__PURE__ */ jsxs(SidebarSection, {
1129
+ title: "Commerce",
1130
+ children: [
1131
+ /* @__PURE__ */ jsx(SidebarItem, {
1132
+ itemId: "do-orders",
1133
+ label: "Orders",
1134
+ ...icons(ReceiptIcon),
1135
+ badge: 12,
1136
+ badgeLabel: "12 orders to fulfil"
1137
+ }),
1138
+ /* @__PURE__ */ jsx(SidebarItem, {
1139
+ itemId: "do-products",
1140
+ label: "Products",
1141
+ ...icons(PackageIcon)
1142
+ }),
1143
+ /* @__PURE__ */ jsx(SidebarItem, {
1144
+ itemId: "do-customers",
1145
+ label: "Customers",
1146
+ ...icons(UsersThreeIcon)
1147
+ })
1148
+ ]
1149
+ })
1150
+ })
1151
+ })
1152
+ }),
1153
+ caption: "Counts only for work waiting on the merchant, like orders to fulfil."
1154
+ },
1155
+ dont: {
1156
+ children: /* @__PURE__ */ jsx("div", {
1157
+ className: "app-shell-dodont",
1158
+ children: /* @__PURE__ */ jsx(Sidebar, {
1159
+ collapsed: false,
1160
+ label: "Don't example",
1161
+ children: /* @__PURE__ */ jsx(SidebarNav, {
1162
+ label: "Don't example",
1163
+ children: /* @__PURE__ */ jsxs(SidebarSection, {
1164
+ title: "Commerce",
1165
+ children: [
1166
+ /* @__PURE__ */ jsx(SidebarItem, {
1167
+ itemId: "dont-orders",
1168
+ label: "Orders",
1169
+ ...icons(ReceiptIcon),
1170
+ badge: 12
1171
+ }),
1172
+ /* @__PURE__ */ jsx(SidebarItem, {
1173
+ itemId: "dont-products",
1174
+ label: "Products",
1175
+ ...icons(PackageIcon),
1176
+ badge: 318
1177
+ }),
1178
+ /* @__PURE__ */ jsx(SidebarItem, {
1179
+ itemId: "dont-customers",
1180
+ label: "Customers",
1181
+ ...icons(UsersThreeIcon),
1182
+ badge: 1206
1183
+ })
1184
+ ]
1185
+ })
1186
+ })
1187
+ })
1188
+ }),
1189
+ caption: "Totals on every item are noise, and the one count that needs action gets lost among them."
1190
+ }
1191
+ }), /* @__PURE__ */ jsx(Guidelines, { items: [
1192
+ "One AppShell per app, at the root. Pages render inside Canvas; they never draw their own frame.",
1193
+ "Keep the sidebar and header on the ground: no backgrounds, cards or shadows of their own. The canvas is the only raised surface.",
1194
+ "Group items under short sentence-case section titles, with a Phosphor icon for each top-level item: regular at rest, duotone when active.",
1195
+ "Name items for the place, in a word or two: Orders, Gift cards, Media library.",
1196
+ "Give every icon-only header button a label and a tooltip, and keep the header to a handful of actions."
1197
+ ] })]
1198
+ }),
1199
+ /* @__PURE__ */ jsx(Section$1, {
1200
+ id: "accessibility",
1201
+ title: "Accessibility",
1202
+ children: /* @__PURE__ */ jsx(Guidelines, { items: [
1203
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
1204
+ "Landmarks: the sidebar is an ",
1205
+ /* @__PURE__ */ jsx("code", { children: "aside" }),
1206
+ " named by ",
1207
+ /* @__PURE__ */ jsx("code", { children: "label" }),
1208
+ " (default \"Main\") with a",
1209
+ " ",
1210
+ /* @__PURE__ */ jsx("code", { children: "nav" }),
1211
+ " inside (default \"Primary\"), the top bar is a ",
1212
+ /* @__PURE__ */ jsx("code", { children: "header" }),
1213
+ ", and the canvas is the",
1214
+ " ",
1215
+ /* @__PURE__ */ jsx("code", { children: "main" }),
1216
+ " element unless you change ",
1217
+ /* @__PURE__ */ jsx("code", { children: "as" }),
1218
+ "."
1219
+ ] }),
1220
+ "Sections are groups named by their titles. The active item carries aria-current=\"page\", and its count is left out of its name, with badgeLabel attached as a description.",
1221
+ "A parent without a page is a button with aria-expanded. A parent with a page has a separate toggle named by toggleLabel, with aria-expanded and aria-controls. Closed groups are inert, so their links leave the tab order.",
1222
+ "Items are ordinary links and buttons in tab order. In the rail their names stay in place for screen readers and show as tooltips for everyone else.",
1223
+ "SidebarToggle has aria-expanded and aria-keyshortcuts=\"[\". The phone menu button has aria-expanded, and Escape closes the drawer.",
1224
+ "Breadcrumbs are a nav named \"Breadcrumb\" holding an ordered list, with the current page marked and the separators hidden.",
1225
+ "Focus rings are teal and 2px on every item, toggle, crumb and the store button.",
1226
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
1227
+ /* @__PURE__ */ jsx("code", { children: "skipLink" }),
1228
+ " puts a \"Skip to content\" link first in the shell, so a keyboard user can pass the sidebar and the header; give the ",
1229
+ /* @__PURE__ */ jsx("code", { children: "Canvas" }),
1230
+ " the id it jumps to. See ",
1231
+ /* @__PURE__ */ jsx(DocLink, {
1232
+ to: "/components/skip-link",
1233
+ children: "Skip link"
1234
+ }),
1235
+ "."
1236
+ ] }),
1237
+ "On a phone, focus goes into the drawer as it opens, back to the menu button when it is dismissed, and to the content when a page is chosen in it: never to the page body.",
1238
+ "The hover rail opens for keyboard focus as it does for the pointer, folds when focus leaves it, and folds with Escape.",
1239
+ "With reduced motion the columns, the drawer and the hover rail change at once, the pills jump instead of gliding, groups open without the slide, and counts neither bump nor ping."
1240
+ ] })
1241
+ }),
1242
+ /* @__PURE__ */ jsxs(Section$1, {
1243
+ id: "props",
1244
+ title: "Props",
1245
+ children: [
1246
+ /* @__PURE__ */ jsx(PropsTable, {
1247
+ title: "AppShell",
1248
+ rows: [
1249
+ {
1250
+ name: "sidebar",
1251
+ type: "ReactNode",
1252
+ required: true,
1253
+ description: "The Sidebar."
1254
+ },
1255
+ {
1256
+ name: "header",
1257
+ type: "ReactNode",
1258
+ required: true,
1259
+ description: "The TopBar."
1260
+ },
1261
+ {
1262
+ name: "children",
1263
+ type: "ReactNode",
1264
+ required: true,
1265
+ description: "The page, usually a Canvas."
1266
+ },
1267
+ {
1268
+ name: "collapsed",
1269
+ type: "boolean",
1270
+ description: "Controlled icon rail. Leave undefined to let the shell manage it."
1271
+ },
1272
+ {
1273
+ name: "defaultCollapsed",
1274
+ type: "boolean",
1275
+ default: "false",
1276
+ description: "Starting state when uncontrolled. True by default with expandOnHover."
1277
+ },
1278
+ {
1279
+ name: "onCollapsedChange",
1280
+ type: "(collapsed: boolean) => void",
1281
+ description: "Called when the rail is folded or unfolded."
1282
+ },
1283
+ {
1284
+ name: "rememberCollapsed",
1285
+ type: "string",
1286
+ description: "A localStorage key: an uncontrolled shell starts as the last visit left it and remembers each fold."
1287
+ },
1288
+ {
1289
+ name: "expandOnHover",
1290
+ type: "boolean",
1291
+ default: "false",
1292
+ description: "The folded rail opens over the page under the pointer or keyboard focus; the rail button pins it. Rests folded unless defaultCollapsed says otherwise."
1293
+ },
1294
+ {
1295
+ name: "drawerOpen",
1296
+ type: "boolean",
1297
+ description: "Controlled phone drawer."
1298
+ },
1299
+ {
1300
+ name: "onDrawerOpenChange",
1301
+ type: "(open: boolean) => void",
1302
+ description: "Called when the drawer opens or closes."
1303
+ },
1304
+ {
1305
+ name: "aside",
1306
+ type: "ReactNode",
1307
+ description: "Content docked beside the canvas, e.g. an assistant panel."
1308
+ },
1309
+ {
1310
+ name: "skipLink",
1311
+ type: "boolean | SkipLinkProps",
1312
+ description: "A \"Skip to content\" link as the shell's first stop. true uses the default words and #main-content; an object is passed to SkipLink. Off when omitted."
1313
+ }
1314
+ ]
1315
+ }),
1316
+ /* @__PURE__ */ jsx(PropsTable, {
1317
+ title: "Canvas",
1318
+ rows: [
1319
+ {
1320
+ name: "as",
1321
+ type: "'main' | 'div' | 'section'",
1322
+ default: "'main'",
1323
+ description: "Element for the scroll container. The ref points at it."
1324
+ },
1325
+ {
1326
+ name: "scrollClassName",
1327
+ type: "string",
1328
+ description: "Classes for the inner scroll container."
1329
+ },
1330
+ {
1331
+ name: "top",
1332
+ type: "ReactNode",
1333
+ description: "Content pinned above the scroll area, e.g. banners."
1334
+ }
1335
+ ]
1336
+ }),
1337
+ /* @__PURE__ */ jsx(PropsTable, {
1338
+ title: "Sidebar",
1339
+ rows: [
1340
+ {
1341
+ name: "label",
1342
+ type: "string",
1343
+ default: "'Main'",
1344
+ description: "Accessible name for the sidebar landmark."
1345
+ },
1346
+ {
1347
+ name: "collapsed",
1348
+ type: "boolean",
1349
+ description: "Force the icon rail regardless of the shell, e.g. when rendered on its own."
1350
+ },
1351
+ {
1352
+ name: "children",
1353
+ type: "ReactNode",
1354
+ required: true,
1355
+ description: "Header, nav and footer."
1356
+ }
1357
+ ]
1358
+ }),
1359
+ /* @__PURE__ */ jsx(PropsTable, {
1360
+ title: "SidebarNav and SidebarSection",
1361
+ rows: [{
1362
+ name: "label",
1363
+ type: "string",
1364
+ default: "'Primary'",
1365
+ description: "SidebarNav: accessible name for the nav landmark."
1366
+ }, {
1367
+ name: "title",
1368
+ type: "ReactNode",
1369
+ description: "SidebarSection: quiet heading, sentence case. A tick in the rail."
1370
+ }]
1371
+ }),
1372
+ /* @__PURE__ */ jsx(PropsTable, {
1373
+ title: "SidebarItem",
1374
+ rows: [
1375
+ {
1376
+ name: "label",
1377
+ type: "ReactNode",
1378
+ required: true,
1379
+ description: "The item name. Also the rail tooltip."
1380
+ },
1381
+ {
1382
+ name: "icon",
1383
+ type: "ReactNode",
1384
+ description: "Icon at rest (18px)."
1385
+ },
1386
+ {
1387
+ name: "activeIcon",
1388
+ type: "ReactNode",
1389
+ description: "Icon while active, e.g. the duotone weight. Falls back to icon."
1390
+ },
1391
+ {
1392
+ name: "active",
1393
+ type: "boolean",
1394
+ default: "false",
1395
+ description: "The current page: the active pill settles here."
1396
+ },
1397
+ {
1398
+ name: "current",
1399
+ type: "boolean",
1400
+ default: "false",
1401
+ description: "A child page is active: reads as current without the pill."
1402
+ },
1403
+ {
1404
+ name: "badge",
1405
+ type: "ReactNode",
1406
+ description: "A small count on the right. A rising number bumps and pings."
1407
+ },
1408
+ {
1409
+ name: "badgeLabel",
1410
+ type: "string",
1411
+ description: "What the count means, for screen readers, e.g. \"12 orders to fulfil\"."
1412
+ },
1413
+ {
1414
+ name: "link",
1415
+ type: "ReactElement",
1416
+ description: "The element that navigates, e.g. <NavLink to=\"/orders\" />. Without it the row is a button."
1417
+ },
1418
+ {
1419
+ name: "onSelect",
1420
+ type: "(event: MouseEvent<HTMLElement>) => void",
1421
+ description: "Called when the row is pressed."
1422
+ },
1423
+ {
1424
+ name: "children",
1425
+ type: "ReactNode",
1426
+ description: "Nested items, one level."
1427
+ },
1428
+ {
1429
+ name: "open",
1430
+ type: "boolean",
1431
+ description: "Controlled open state for nested items."
1432
+ },
1433
+ {
1434
+ name: "defaultOpen",
1435
+ type: "boolean",
1436
+ default: "false",
1437
+ description: "Starting open state when uncontrolled."
1438
+ },
1439
+ {
1440
+ name: "onOpenChange",
1441
+ type: "(open: boolean) => void",
1442
+ description: "Called when the group opens or closes."
1443
+ },
1444
+ {
1445
+ name: "toggleLabel",
1446
+ type: "string",
1447
+ default: "'Show more'",
1448
+ description: "Name of the expand toggle on a parent with its own page."
1449
+ },
1450
+ {
1451
+ name: "itemId",
1452
+ type: "string",
1453
+ description: "Stable id for the hover pill. Generated when omitted."
1454
+ }
1455
+ ]
1456
+ }),
1457
+ /* @__PURE__ */ jsx(PropsTable, {
1458
+ title: "TopBar",
1459
+ rows: [
1460
+ {
1461
+ name: "start",
1462
+ type: "ReactNode",
1463
+ description: "Left: breadcrumbs or the page title."
1464
+ },
1465
+ {
1466
+ name: "center",
1467
+ type: "ReactNode",
1468
+ description: "Centre: usually the SearchTrigger. Hidden on phones."
1469
+ },
1470
+ {
1471
+ name: "end",
1472
+ type: "ReactNode",
1473
+ description: "Right: actions, notifications, account."
1474
+ },
1475
+ {
1476
+ name: "menuLabel",
1477
+ type: "string",
1478
+ default: "'Open navigation'",
1479
+ description: "Name of the menu button shown on phones."
1480
+ }
1481
+ ]
1482
+ }),
1483
+ /* @__PURE__ */ jsx(PropsTable, {
1484
+ title: "Breadcrumbs",
1485
+ rows: [{
1486
+ name: "items",
1487
+ type: "BreadcrumbItem[]",
1488
+ required: true,
1489
+ description: "{ label, link?, key? }. The last item is the current page."
1490
+ }, {
1491
+ name: "label",
1492
+ type: "string",
1493
+ default: "'Breadcrumb'",
1494
+ description: "Accessible name for the nav."
1495
+ }]
1496
+ }),
1497
+ /* @__PURE__ */ jsx(PropsTable, {
1498
+ title: "SidebarToggle",
1499
+ rows: [
1500
+ {
1501
+ name: "collapseLabel",
1502
+ type: "string",
1503
+ default: "'Collapse sidebar'",
1504
+ description: "Name while expanded."
1505
+ },
1506
+ {
1507
+ name: "expandLabel",
1508
+ type: "string",
1509
+ default: "'Expand sidebar'",
1510
+ description: "Name while folded. Renders nothing on phones or outside a shell."
1511
+ },
1512
+ {
1513
+ name: "pinLabel",
1514
+ type: "string",
1515
+ default: "'Keep sidebar open'",
1516
+ description: "Name while the hover rail is open over the page, when pressing it pins the sidebar."
1517
+ }
1518
+ ]
1519
+ }),
1520
+ /* @__PURE__ */ jsx(PropsTable, {
1521
+ title: "StoreButton and ShellBrand",
1522
+ rows: [
1523
+ {
1524
+ name: "name",
1525
+ type: "ReactNode",
1526
+ required: true,
1527
+ description: "StoreButton: the store name."
1528
+ },
1529
+ {
1530
+ name: "detail",
1531
+ type: "ReactNode",
1532
+ description: "StoreButton: a second line, e.g. the store's domain."
1533
+ },
1534
+ {
1535
+ name: "avatar",
1536
+ type: "ReactNode",
1537
+ description: "StoreButton: logo or initials, e.g. <Avatar shape=\"square\" />."
1538
+ },
1539
+ {
1540
+ name: "placement",
1541
+ type: "'header' | 'footer'",
1542
+ default: "'footer'",
1543
+ description: "ShellBrand: header is the app logo top left at full strength; footer is a quiet signature."
1544
+ },
1545
+ {
1546
+ name: "meta",
1547
+ type: "ReactNode",
1548
+ description: "ShellBrand: shown beside the logo when expanded, e.g. a version."
1549
+ }
1550
+ ]
1551
+ })
1552
+ ]
1553
+ })
1554
+ ]
1555
+ });
1556
+ }
1557
+ //#endregion
1558
+ export { Page, Preview };