@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,565 @@
1
+ "use client";
2
+ import { d as Section$1, i as DocPage, m as ThemePair, o as Example, p as SubSection, s as Guidelines, u as PropsTable } from "./docs-lM2UBSir.js";
3
+ import { useState } from "react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { BrandSpecimen, ColorSwatch, SwatchPalette, SwatchPicker, SwatchTokenGrid } from "@orbitcommerce/constellation";
6
+ import { ArrowRightIcon } from "@orbitcommerce/constellation/icons";
7
+ //#region src/pages/components/swatch.tsx
8
+ var TAG_COLOURS = [
9
+ {
10
+ value: "#EF4444",
11
+ name: "Red"
12
+ },
13
+ {
14
+ value: "#F97316",
15
+ name: "Orange"
16
+ },
17
+ {
18
+ value: "#EAB308",
19
+ name: "Yellow"
20
+ },
21
+ {
22
+ value: "#22C55E",
23
+ name: "Green"
24
+ },
25
+ {
26
+ value: "#14B8A6",
27
+ name: "Teal"
28
+ },
29
+ {
30
+ value: "#3B82F6",
31
+ name: "Blue"
32
+ },
33
+ {
34
+ value: "#8B5CF6",
35
+ name: "Violet"
36
+ },
37
+ {
38
+ value: "#6B7280",
39
+ name: "Grey"
40
+ }
41
+ ];
42
+ var KIT = [
43
+ {
44
+ name: "Primary",
45
+ value: "#1F4E46"
46
+ },
47
+ {
48
+ name: "Secondary",
49
+ value: "#C8A27A"
50
+ },
51
+ {
52
+ name: "Background",
53
+ value: "#FBF7F0"
54
+ },
55
+ {
56
+ name: "Text",
57
+ value: "#1E2420"
58
+ },
59
+ {
60
+ name: "Accent",
61
+ value: null
62
+ }
63
+ ];
64
+ var THEME = [
65
+ {
66
+ name: "Primary",
67
+ value: "#1F4E46"
68
+ },
69
+ {
70
+ name: "Secondary",
71
+ value: "#C8A27A"
72
+ },
73
+ {
74
+ name: "Accent",
75
+ value: "#E07A5F"
76
+ },
77
+ {
78
+ name: "Background",
79
+ value: "#FBF7F0"
80
+ },
81
+ {
82
+ name: "Background alt",
83
+ value: "#F1EBE0"
84
+ },
85
+ {
86
+ name: "Text",
87
+ value: "#1E2420"
88
+ },
89
+ {
90
+ name: "Text muted",
91
+ value: "#5D655F"
92
+ },
93
+ {
94
+ name: "Border",
95
+ value: "#E2DACB"
96
+ },
97
+ {
98
+ name: "Success",
99
+ value: "#2F855A"
100
+ },
101
+ {
102
+ name: "Error",
103
+ value: void 0
104
+ }
105
+ ];
106
+ function Preview() {
107
+ return /* @__PURE__ */ jsxs("div", {
108
+ className: "swatch-preview",
109
+ children: [/* @__PURE__ */ jsx(SwatchPalette, {
110
+ "aria-label": "Brand palette",
111
+ colors: KIT.slice(0, 4)
112
+ }), /* @__PURE__ */ jsx(SwatchPicker, {
113
+ "aria-label": "Tag colour",
114
+ colors: TAG_COLOURS.slice(0, 6),
115
+ defaultValue: "#14B8A6",
116
+ size: "sm"
117
+ })]
118
+ });
119
+ }
120
+ function TagColour() {
121
+ const [colour, setColour] = useState("#14B8A6");
122
+ const chosen = TAG_COLOURS.find((option) => option.value === colour);
123
+ return /* @__PURE__ */ jsxs("div", {
124
+ className: "swatch-picker-demo",
125
+ children: [
126
+ /* @__PURE__ */ jsx("span", {
127
+ className: "swatch-picker-demo__label",
128
+ id: "tag-colour",
129
+ children: "Tag colour"
130
+ }),
131
+ /* @__PURE__ */ jsx(SwatchPicker, {
132
+ "aria-labelledby": "tag-colour",
133
+ colors: TAG_COLOURS,
134
+ value: colour,
135
+ onValueChange: setColour
136
+ }),
137
+ /* @__PURE__ */ jsx("span", {
138
+ className: "swatch-picker-demo__chosen",
139
+ children: /* @__PURE__ */ jsx(ColorSwatch, {
140
+ color: colour,
141
+ size: "xs",
142
+ label: `${chosen?.name ?? colour}, ${colour.toLowerCase()}`
143
+ })
144
+ })
145
+ ]
146
+ });
147
+ }
148
+ function Page() {
149
+ return /* @__PURE__ */ jsxs(DocPage, {
150
+ title: "Colour swatches",
151
+ status: "new",
152
+ importNames: [
153
+ "ColorSwatch",
154
+ "SwatchPicker",
155
+ "SwatchPalette",
156
+ "SwatchTokenGrid",
157
+ "BrandSpecimen"
158
+ ],
159
+ lead: "The ways to show a colour that is data, not theme: a brand kit's, a tag's, a theme's. A swatch with its hex, a row of fixed colours to choose from, a palette, a grid of named tokens and a specimen of a brand.",
160
+ children: [
161
+ /* @__PURE__ */ jsxs(Section$1, {
162
+ id: "swatch",
163
+ title: "Swatch",
164
+ description: /* @__PURE__ */ jsxs("p", { children: [
165
+ /* @__PURE__ */ jsx("code", { children: "ColorSwatch" }),
166
+ " is a small square of the colour, held by the theme's hairline so a pale colour still shows on the canvas. ",
167
+ /* @__PURE__ */ jsx("code", { children: "hex" }),
168
+ " writes its value beside it in mono, or ",
169
+ /* @__PURE__ */ jsx("code", { children: "label" }),
170
+ " a name. Every colour is hex; one that is missing or unreadable is not set, a dashed square."
171
+ ] }),
172
+ children: [
173
+ /* @__PURE__ */ jsx(Example, {
174
+ align: "start",
175
+ code: `
176
+ <ColorSwatch color="#1F4E46" size="xs" hex />
177
+ <ColorSwatch color="#1F4E46" hex />
178
+ <ColorSwatch color="#FBF7F0" size="md" label="Background" />
179
+ <ColorSwatch color="#C8A27A" size="lg" label="Secondary" />
180
+ <ColorSwatch color={null} hex />`,
181
+ children: /* @__PURE__ */ jsxs("div", {
182
+ className: "swatch-row",
183
+ children: [
184
+ /* @__PURE__ */ jsx(ColorSwatch, {
185
+ color: "#1F4E46",
186
+ size: "xs",
187
+ hex: true
188
+ }),
189
+ /* @__PURE__ */ jsx(ColorSwatch, {
190
+ color: "#1F4E46",
191
+ hex: true
192
+ }),
193
+ /* @__PURE__ */ jsx(ColorSwatch, {
194
+ color: "#FBF7F0",
195
+ size: "md",
196
+ label: "Background"
197
+ }),
198
+ /* @__PURE__ */ jsx(ColorSwatch, {
199
+ color: "#C8A27A",
200
+ size: "lg",
201
+ label: "Secondary"
202
+ }),
203
+ /* @__PURE__ */ jsx(ColorSwatch, {
204
+ color: null,
205
+ hex: true
206
+ })
207
+ ]
208
+ })
209
+ }),
210
+ /* @__PURE__ */ jsx(SubSection, {
211
+ title: "Before and after",
212
+ description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "muted" }), " draws the value before a change quieter, beside the one after it, as a brand kit's proposed changes are read."] }),
213
+ children: /* @__PURE__ */ jsx(Example, {
214
+ align: "start",
215
+ code: `
216
+ <ColorSwatch color="#2B6CB0" hex muted />
217
+ <ArrowRightIcon />
218
+ <ColorSwatch color="#1F4E46" hex />`,
219
+ children: /* @__PURE__ */ jsxs("div", {
220
+ className: "swatch-diff",
221
+ children: [
222
+ /* @__PURE__ */ jsx("span", {
223
+ className: "swatch-diff__name",
224
+ children: "Primary"
225
+ }),
226
+ /* @__PURE__ */ jsx(ColorSwatch, {
227
+ color: "#2B6CB0",
228
+ hex: true,
229
+ muted: true
230
+ }),
231
+ /* @__PURE__ */ jsx(ArrowRightIcon, {
232
+ className: "swatch-diff__arrow",
233
+ "aria-hidden": "true"
234
+ }),
235
+ /* @__PURE__ */ jsx(ColorSwatch, {
236
+ color: "#1F4E46",
237
+ hex: true
238
+ })
239
+ ]
240
+ })
241
+ })
242
+ }),
243
+ /* @__PURE__ */ jsx(SubSection, {
244
+ title: "Text on a colour",
245
+ description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "foreground" }), " sets \"Aa\" in a text colour on the swatch, so a contrast pair is seen as it reads: the text colour on its background."] }),
246
+ children: /* @__PURE__ */ jsx(Example, {
247
+ align: "start",
248
+ code: `
249
+ <ColorSwatch color="#FBF7F0" foreground="#1E2420" size="lg" label="Text on background" />
250
+ <ColorSwatch color="#C8A27A" foreground="#FBF7F0" size="lg" label="Background on secondary" />`,
251
+ children: /* @__PURE__ */ jsxs("div", {
252
+ className: "swatch-row",
253
+ children: [/* @__PURE__ */ jsx(ColorSwatch, {
254
+ color: "#FBF7F0",
255
+ foreground: "#1E2420",
256
+ size: "lg",
257
+ label: "Text on background"
258
+ }), /* @__PURE__ */ jsx(ColorSwatch, {
259
+ color: "#C8A27A",
260
+ foreground: "#FBF7F0",
261
+ size: "lg",
262
+ label: "Background on secondary"
263
+ })]
264
+ })
265
+ })
266
+ })
267
+ ]
268
+ }),
269
+ /* @__PURE__ */ jsxs(Section$1, {
270
+ id: "picker",
271
+ title: "Picker",
272
+ description: /* @__PURE__ */ jsxs("p", { children: [
273
+ /* @__PURE__ */ jsx("code", { children: "SwatchPicker" }),
274
+ " is a radio group of fixed colours, for a tag's or a team's colour where a full colour picker would be more than the choice needs. The chosen disc is ringed inside its edge and ticked in the ink that reads on it. Give each colour a ",
275
+ /* @__PURE__ */ jsx("code", { children: "name" }),
276
+ " so it is read as \"Teal\", not its hex."
277
+ ] }),
278
+ children: [/* @__PURE__ */ jsx(Example, {
279
+ align: "start",
280
+ code: `
281
+ const [colour, setColour] = useState('#14B8A6')
282
+
283
+ <SwatchPicker
284
+ aria-labelledby="tag-colour"
285
+ colors={[{ value: '#EF4444', name: 'Red' }, { value: '#F97316', name: 'Orange' }, ...]}
286
+ value={colour}
287
+ onValueChange={setColour}
288
+ />`,
289
+ children: /* @__PURE__ */ jsx(TagColour, {})
290
+ }), /* @__PURE__ */ jsx(Example, {
291
+ align: "start",
292
+ caption: "size=\"sm\" is 24px; disabled turns the whole row off.",
293
+ code: `<SwatchPicker size="sm" disabled ... />`,
294
+ children: /* @__PURE__ */ jsxs("div", {
295
+ className: "swatch-stack",
296
+ children: [/* @__PURE__ */ jsx(SwatchPicker, {
297
+ "aria-label": "Team colour",
298
+ size: "sm",
299
+ colors: TAG_COLOURS,
300
+ defaultValue: "#3B82F6"
301
+ }), /* @__PURE__ */ jsx(SwatchPicker, {
302
+ "aria-label": "Team colour, locked",
303
+ size: "sm",
304
+ colors: TAG_COLOURS,
305
+ defaultValue: "#3B82F6",
306
+ disabled: true
307
+ })]
308
+ })
309
+ })]
310
+ }),
311
+ /* @__PURE__ */ jsx(Section$1, {
312
+ id: "palette",
313
+ title: "Palette",
314
+ description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "SwatchPalette" }), " sets out a brand kit's colours: a 36px square each with its name under it, and \"name: hex\" on hover. A colour the kit does not set is a dashed square."] }),
315
+ children: /* @__PURE__ */ jsx(Example, {
316
+ align: "start",
317
+ code: `<SwatchPalette aria-label="Brand palette" colors={[{ name: 'Primary', value: '#1F4E46' }, ...]} />`,
318
+ children: /* @__PURE__ */ jsx(SwatchPalette, {
319
+ "aria-label": "Brand palette",
320
+ colors: KIT
321
+ })
322
+ })
323
+ }),
324
+ /* @__PURE__ */ jsx(Section$1, {
325
+ id: "token-grid",
326
+ title: "Token grid",
327
+ description: /* @__PURE__ */ jsxs("p", { children: [
328
+ /* @__PURE__ */ jsx("code", { children: "SwatchTokenGrid" }),
329
+ " lays a theme's named tokens out as a grid: a bar of each colour, its name and its hex beneath. It fits as many columns as there is room for, or the ",
330
+ /* @__PURE__ */ jsx("code", { children: "columns" }),
331
+ " you give."
332
+ ] }),
333
+ children: /* @__PURE__ */ jsx(Example, {
334
+ align: "fill",
335
+ code: `<SwatchTokenGrid aria-label="Theme colours" tokens={theme} />`,
336
+ children: /* @__PURE__ */ jsx(SwatchTokenGrid, {
337
+ "aria-label": "Theme colours",
338
+ tokens: THEME,
339
+ className: "swatch-grid-demo"
340
+ })
341
+ })
342
+ }),
343
+ /* @__PURE__ */ jsx(Section$1, {
344
+ id: "specimen",
345
+ title: "Brand specimen",
346
+ description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "BrandSpecimen" }), " shows a brand before it is applied: a headline in the heading font, a sentence in the body font and a sample button in the primary colour, on the proposed background and in the proposed text colour. The button is a picture of one, and its words are ink or white, whichever reads on the primary. Given a background and no text colour, the text is ink or white too, whichever reads on the background."] }),
347
+ children: /* @__PURE__ */ jsx(Example, {
348
+ align: "fill",
349
+ code: `
350
+ <BrandSpecimen
351
+ background="#FBF7F0"
352
+ text="#1E2420"
353
+ primary="#1F4E46"
354
+ headingFont="Georgia"
355
+ bodyFont="Geist"
356
+ />
357
+ <BrandSpecimen background="#1E2420" primary="#E8C468" headingFont="Georgia" bodyFont="Geist" />`,
358
+ children: /* @__PURE__ */ jsxs("div", {
359
+ className: "swatch-specimens",
360
+ children: [/* @__PURE__ */ jsx(BrandSpecimen, {
361
+ background: "#FBF7F0",
362
+ text: "#1E2420",
363
+ primary: "#1F4E46",
364
+ headingFont: "Georgia",
365
+ bodyFont: "Geist"
366
+ }), /* @__PURE__ */ jsx(BrandSpecimen, {
367
+ background: "#1E2420",
368
+ primary: "#E8C468",
369
+ headingFont: "Georgia",
370
+ bodyFont: "Geist",
371
+ headline: "Desks that work as hard as you",
372
+ buttonLabel: "Browse desks"
373
+ })]
374
+ })
375
+ })
376
+ }),
377
+ /* @__PURE__ */ jsx(Section$1, {
378
+ id: "both-themes",
379
+ title: "In both themes",
380
+ description: /* @__PURE__ */ jsx("p", { children: "The colours are the data's own; the hairlines, names and rings follow the theme." }),
381
+ children: /* @__PURE__ */ jsx(ThemePair, { children: /* @__PURE__ */ jsxs("div", {
382
+ className: "swatch-stack",
383
+ children: [
384
+ /* @__PURE__ */ jsx(SwatchPalette, {
385
+ "aria-label": "Brand palette",
386
+ colors: KIT
387
+ }),
388
+ /* @__PURE__ */ jsx(SwatchPicker, {
389
+ "aria-label": "Tag colour",
390
+ size: "sm",
391
+ colors: TAG_COLOURS,
392
+ defaultValue: "#EAB308"
393
+ }),
394
+ /* @__PURE__ */ jsxs("div", {
395
+ className: "swatch-row",
396
+ children: [
397
+ /* @__PURE__ */ jsx(ColorSwatch, {
398
+ color: "#2B6CB0",
399
+ hex: true,
400
+ muted: true
401
+ }),
402
+ /* @__PURE__ */ jsx(ColorSwatch, {
403
+ color: "#1F4E46",
404
+ hex: true
405
+ }),
406
+ /* @__PURE__ */ jsx(ColorSwatch, {
407
+ color: null,
408
+ hex: true
409
+ })
410
+ ]
411
+ })
412
+ ]
413
+ }) })
414
+ }),
415
+ /* @__PURE__ */ jsx(Section$1, {
416
+ id: "guidelines",
417
+ title: "Guidelines",
418
+ children: /* @__PURE__ */ jsx(Guidelines, { items: [
419
+ "For colours that are data: a brand's, a tag's, a category's. The theme's own colours are tokens, set out on the colour foundations page.",
420
+ "Write the hex beside a swatch where the value matters (a diff, a theme), and a name where it does not (a tag).",
421
+ "Name every picker colour, so the choice is read by a word and not by a hex.",
422
+ "A fixed row of eight is enough for tags and teams. For any colour, use the colour field."
423
+ ] })
424
+ }),
425
+ /* @__PURE__ */ jsx(Section$1, {
426
+ id: "accessibility",
427
+ title: "Accessibility",
428
+ children: /* @__PURE__ */ jsx(Guidelines, { items: [
429
+ "A swatch is decorative: the hex or the name beside it says the colour. Alone, give it role=\"img\" and an aria-label.",
430
+ "The picker is a radio group: one tab stop, the arrow keys move and choose, each disc named by its colour. The chosen one is ticked, so it never depends on the ring alone.",
431
+ "The palette and the grid are lists. A screen reader hears each name and its value; the hover title is for the pointer.",
432
+ "In forced colours the swatches keep their colours, which are what they show, and the chosen disc takes the system highlight."
433
+ ] })
434
+ }),
435
+ /* @__PURE__ */ jsxs(Section$1, {
436
+ id: "props",
437
+ title: "Props",
438
+ children: [
439
+ /* @__PURE__ */ jsx(PropsTable, {
440
+ title: "ColorSwatch",
441
+ rows: [
442
+ {
443
+ name: "color",
444
+ type: "string | null",
445
+ required: true,
446
+ description: "The colour, as hex. Missing or unreadable is not set: a dashed square."
447
+ },
448
+ {
449
+ name: "size",
450
+ type: "'xs' | 'sm' | 'md' | 'lg'",
451
+ default: "'sm'",
452
+ description: "12, 16, 24 or 32px."
453
+ },
454
+ {
455
+ name: "hex",
456
+ type: "boolean",
457
+ default: "false",
458
+ description: "Writes the hex beside it in mono (\"Not set\" for one that is not)."
459
+ },
460
+ {
461
+ name: "label",
462
+ type: "ReactNode",
463
+ description: "A name beside it instead."
464
+ },
465
+ {
466
+ name: "muted",
467
+ type: "boolean",
468
+ default: "false",
469
+ description: "The value before a change: quieter."
470
+ },
471
+ {
472
+ name: "foreground",
473
+ type: "string | null",
474
+ description: "A text colour: \"Aa\" in it on the swatch, a contrast pair."
475
+ }
476
+ ]
477
+ }),
478
+ /* @__PURE__ */ jsx(PropsTable, {
479
+ title: "SwatchPicker",
480
+ rows: [
481
+ {
482
+ name: "colors",
483
+ type: "(string | { value, name })[]",
484
+ required: true,
485
+ description: "The colours, in order. A name is what each is read by."
486
+ },
487
+ {
488
+ name: "value",
489
+ type: "string",
490
+ description: "The chosen colour, as one of the colors' values."
491
+ },
492
+ {
493
+ name: "defaultValue",
494
+ type: "string",
495
+ description: "The colour chosen at first, when it keeps its own state."
496
+ },
497
+ {
498
+ name: "onValueChange",
499
+ type: "(value: string) => void",
500
+ description: "Called with the value when one is chosen."
501
+ },
502
+ {
503
+ name: "size",
504
+ type: "'sm' | 'md'",
505
+ default: "'md'",
506
+ description: "24 or 28px discs."
507
+ },
508
+ {
509
+ name: "disabled",
510
+ type: "boolean",
511
+ description: "Turns the whole row off."
512
+ },
513
+ {
514
+ name: "dir",
515
+ type: "'ltr' | 'rtl'",
516
+ description: "The reading direction, which the arrow keys follow. Inherited from the page when left out."
517
+ },
518
+ {
519
+ name: "labels",
520
+ type: "Partial<SwatchLabels>",
521
+ default: "swatchLabels",
522
+ description: "swatch(name), each disc's name; notSet."
523
+ }
524
+ ]
525
+ }),
526
+ /* @__PURE__ */ jsx(PropsTable, {
527
+ title: "SwatchPalette and SwatchTokenGrid",
528
+ rows: [{
529
+ name: "colors / tokens",
530
+ type: "{ name, value }[]",
531
+ required: true,
532
+ description: "The colours, each with its name. A value missing or unreadable is not set."
533
+ }, {
534
+ name: "columns",
535
+ type: "number",
536
+ description: "SwatchTokenGrid only: how many across. Without it, as many 96px columns as fit."
537
+ }]
538
+ }),
539
+ /* @__PURE__ */ jsx(PropsTable, {
540
+ title: "BrandSpecimen",
541
+ rows: [
542
+ {
543
+ name: "background, text, primary",
544
+ type: "string | null",
545
+ description: "The proposed colours, as hex. The theme's canvas, ink and accent when left out; with a background and no text, the text is ink or white, whichever reads."
546
+ },
547
+ {
548
+ name: "headingFont, bodyFont",
549
+ type: "string | null",
550
+ description: "A family name (\"Fraunces\") or a whole stack. The kit's display and sans when left out."
551
+ },
552
+ {
553
+ name: "headline, body, buttonLabel",
554
+ type: "ReactNode",
555
+ description: "The words. Default to brandSpecimenLabels, whose sentence names the body font."
556
+ }
557
+ ]
558
+ })
559
+ ]
560
+ })
561
+ ]
562
+ });
563
+ }
564
+ //#endregion
565
+ export { Page, Preview };