@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,192 @@
1
+ "use client";
2
+ import { t as DocLink } from "./host-B6znjEgQ.js";
3
+ import { d as Section$1, i as DocPage, m as ThemePair, o as Example, s as Guidelines, u as PropsTable } from "./docs-lM2UBSir.js";
4
+ import { useState } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { ReplyFeedback } from "@orbitcommerce/constellation";
7
+ //#region src/pages/components/reply-feedback.tsx
8
+ function Preview() {
9
+ return /* @__PURE__ */ jsxs("div", {
10
+ className: "feedback-preview",
11
+ children: [/* @__PURE__ */ jsx("p", {
12
+ className: "feedback-reply",
13
+ children: "Three orders are waiting on the Arden chair. The next delivery is due on Thursday."
14
+ }), /* @__PURE__ */ jsx(ReplyFeedback, {
15
+ reveal: "always",
16
+ onRate: () => {}
17
+ })]
18
+ });
19
+ }
20
+ /** A reply with its thumbs, and what they sent. */
21
+ function ReplyDemo() {
22
+ const [sent, setSent] = useState(null);
23
+ const [key, setKey] = useState(0);
24
+ return /* @__PURE__ */ jsxs("div", {
25
+ className: "feedback-demo",
26
+ children: [/* @__PURE__ */ jsxs("div", {
27
+ className: "feedback-host",
28
+ "data-reply-feedback-host": "",
29
+ children: [/* @__PURE__ */ jsx("p", {
30
+ className: "feedback-reply",
31
+ children: "Three orders are waiting on the Arden ergonomic chair: #10482, #10491 and #10503. The next delivery from the supplier is due on Thursday, so they should go out on Friday."
32
+ }), /* @__PURE__ */ jsx(ReplyFeedback, { onRate: (rating, reason) => setSent({
33
+ rating,
34
+ reason
35
+ }) }, key)]
36
+ }), /* @__PURE__ */ jsxs("p", {
37
+ className: "feedback-sent",
38
+ children: [
39
+ sent ? `Sent: ${sent.rating === "up" ? "a thumbs up" : `a thumbs down, ${sent.reason?.label ?? "no reason"}`}.` : "Point at the reply, or Tab to it.",
40
+ " ",
41
+ sent ? /* @__PURE__ */ jsx("button", {
42
+ type: "button",
43
+ className: "feedback-again",
44
+ onClick: () => {
45
+ setSent(null);
46
+ setKey((k) => k + 1);
47
+ },
48
+ children: "Try again"
49
+ }) : null
50
+ ]
51
+ })]
52
+ });
53
+ }
54
+ function Page() {
55
+ return /* @__PURE__ */ jsxs(DocPage, {
56
+ title: "Reply feedback",
57
+ status: "new",
58
+ importNames: ["ReplyFeedback", "replyFeedbackReasons"],
59
+ lead: "Thumbs up and down under an assistant's reply, so people can say how it did. A thumbs down asks why with four reasons, and either locks after one vote.",
60
+ children: [
61
+ /* @__PURE__ */ jsx(Section$1, {
62
+ id: "basics",
63
+ title: "Basics",
64
+ description: /* @__PURE__ */ jsxs("p", { children: [
65
+ "The thumbs show while the pointer is over the reply or focus is in them, and stay once used; on a touch screen they are always there. Put them in the ",
66
+ /* @__PURE__ */ jsx(DocLink, {
67
+ to: "/components/message-thread",
68
+ children: "message bubble"
69
+ }),
70
+ "'s ",
71
+ /* @__PURE__ */ jsx("code", { children: "feedback" }),
72
+ " slot, which hides them while the reply streams or after it failed, or mark the reply's element ",
73
+ /* @__PURE__ */ jsx("code", { children: "data-reply-feedback-host" }),
74
+ ". A thumbs up counts at once. A thumbs down opens its reasons and counts once one is picked, focus going back to the thumb; Escape or a second press closes them without a vote. After one vote both lock, the chosen one pressed in its colour, and a polite status says thanks."
75
+ ] }),
76
+ children: /* @__PURE__ */ jsx(Example, {
77
+ align: "fill",
78
+ code: `<ReplyFeedback onRate={(rating, reason) => sendFeedback({ rating, reason: reason?.id, turnId })} />`,
79
+ children: /* @__PURE__ */ jsx(ReplyDemo, {})
80
+ })
81
+ }),
82
+ /* @__PURE__ */ jsx(Section$1, {
83
+ id: "states",
84
+ title: "States",
85
+ description: /* @__PURE__ */ jsxs("p", { children: [
86
+ "Given a ",
87
+ /* @__PURE__ */ jsx("code", { children: "value" }),
88
+ " it shows the vote locked, as for a reply rated in an earlier visit."
89
+ ] }),
90
+ children: /* @__PURE__ */ jsx(Example, {
91
+ align: "start",
92
+ code: `<ReplyFeedback reveal="always" onRate={rate} />
93
+ <ReplyFeedback value="up" onRate={rate} />
94
+ <ReplyFeedback value="down" onRate={rate} />`,
95
+ children: /* @__PURE__ */ jsxs("div", {
96
+ className: "feedback-stack",
97
+ children: [
98
+ /* @__PURE__ */ jsx(ReplyFeedback, {
99
+ reveal: "always",
100
+ onRate: () => {}
101
+ }),
102
+ /* @__PURE__ */ jsx(ReplyFeedback, {
103
+ value: "up",
104
+ onRate: () => {}
105
+ }),
106
+ /* @__PURE__ */ jsx(ReplyFeedback, {
107
+ value: "down",
108
+ onRate: () => {}
109
+ })
110
+ ]
111
+ })
112
+ })
113
+ }),
114
+ /* @__PURE__ */ jsx(Section$1, {
115
+ id: "both-themes",
116
+ title: "In both themes",
117
+ children: /* @__PURE__ */ jsx(ThemePair, { children: /* @__PURE__ */ jsxs("div", {
118
+ className: "feedback-stack",
119
+ children: [
120
+ /* @__PURE__ */ jsx(ReplyFeedback, {
121
+ reveal: "always",
122
+ onRate: () => {}
123
+ }),
124
+ /* @__PURE__ */ jsx(ReplyFeedback, {
125
+ value: "up",
126
+ onRate: () => {}
127
+ }),
128
+ /* @__PURE__ */ jsx(ReplyFeedback, {
129
+ value: "down",
130
+ onRate: () => {}
131
+ })
132
+ ]
133
+ }) })
134
+ }),
135
+ /* @__PURE__ */ jsx(Section$1, {
136
+ id: "guidelines",
137
+ title: "Guidelines",
138
+ children: /* @__PURE__ */ jsx(Guidelines, { items: [
139
+ "Offer feedback on substantive replies only: not on a greeting, a streaming reply or an error.",
140
+ "Send the vote with the turn it is about, so it can be traced to the answer.",
141
+ "Keep the reasons to four, in the person’s words. Pass reasons={[]} to count a thumbs down at once."
142
+ ] })
143
+ }),
144
+ /* @__PURE__ */ jsx(Section$1, {
145
+ id: "accessibility",
146
+ title: "Accessibility",
147
+ children: /* @__PURE__ */ jsx(Guidelines, { items: [
148
+ "The thumbs are a group named \"Rate this reply\", each a named button with a tooltip; they take focus even while hidden, and show as they do.",
149
+ "The thumbs down says whether its reasons are open (aria-expanded) and which row it opens (aria-controls).",
150
+ "After a vote both stay focusable (aria-disabled), the chosen one aria-pressed, so focus is never dropped; picking a reason hands focus back to the thumb.",
151
+ "The thanks is said by a polite status that is in the page from the start."
152
+ ] })
153
+ }),
154
+ /* @__PURE__ */ jsx(Section$1, {
155
+ id: "props",
156
+ title: "Props",
157
+ children: /* @__PURE__ */ jsx(PropsTable, { rows: [
158
+ {
159
+ name: "onRate",
160
+ type: "(rating, reason?) => void",
161
+ required: true,
162
+ description: "Called once with the vote, and the reason for a thumbs down."
163
+ },
164
+ {
165
+ name: "value",
166
+ type: "'up' | 'down' | null",
167
+ description: "A vote already given, shown locked."
168
+ },
169
+ {
170
+ name: "reasons",
171
+ type: "ReplyFeedbackReason[]",
172
+ default: "replyFeedbackReasons",
173
+ description: "The reasons a thumbs down asks for. Empty counts it at once."
174
+ },
175
+ {
176
+ name: "reveal",
177
+ type: "'hover' | 'always'",
178
+ default: "'hover'",
179
+ description: "Shown on hover and focus of the reply, or always."
180
+ },
181
+ {
182
+ name: "labels",
183
+ type: "Partial<ReplyFeedbackLabels>",
184
+ description: "group, up, down, reasons, thanks."
185
+ }
186
+ ] })
187
+ })
188
+ ]
189
+ });
190
+ }
191
+ //#endregion
192
+ export { Page, Preview };
@@ -0,0 +1,460 @@
1
+ "use client";
2
+ import { t as DocLink } from "./host-B6znjEgQ.js";
3
+ import { a as DocTable, d as Section$1, i as DocPage, n as CodeBlock$1, o as Example, p as SubSection, s as Guidelines, u as PropsTable } from "./docs-lM2UBSir.js";
4
+ import { useState } from "react";
5
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
6
+ import { Badge, Button, Card, Reveal, SegmentedControl, useStaggerIn } from "@orbitcommerce/constellation";
7
+ import { ArrowCounterClockwiseIcon, ColumnsIcon, ImageSquareIcon, ListBulletsIcon, MinusIcon, PlayIcon, QuotesIcon, RowsIcon, SquaresFourIcon, StarIcon, TableIcon, TextTIcon } from "@orbitcommerce/constellation/icons";
8
+ //#region src/pages/components/reveal.tsx
9
+ var REVISIONS = [
10
+ {
11
+ id: "r5",
12
+ title: "Winter sale banner added",
13
+ who: "Priya Shah",
14
+ when: "10:42",
15
+ current: true
16
+ },
17
+ {
18
+ id: "r4",
19
+ title: "Best sellers grid reordered",
20
+ who: "Callum Reid",
21
+ when: "09:15"
22
+ },
23
+ {
24
+ id: "r3",
25
+ title: "Delivery note reworded",
26
+ who: "Priya Shah",
27
+ when: "Yesterday"
28
+ },
29
+ {
30
+ id: "r2",
31
+ title: "Hero image changed to the Arden chair",
32
+ who: "Amara Okafor",
33
+ when: "Monday"
34
+ }
35
+ ];
36
+ function Preview() {
37
+ return /* @__PURE__ */ jsx("ul", {
38
+ className: "reveal-preview",
39
+ children: REVISIONS.slice(0, 3).map((revision, index) => /* @__PURE__ */ jsxs(Reveal, {
40
+ as: "li",
41
+ index,
42
+ className: "reveal-preview__card",
43
+ children: [/* @__PURE__ */ jsx("span", {
44
+ className: "reveal-preview__title",
45
+ children: revision.title
46
+ }), /* @__PURE__ */ jsx("span", {
47
+ className: "reveal-preview__meta",
48
+ children: revision.who
49
+ })]
50
+ }, revision.id))
51
+ });
52
+ }
53
+ function Revisions() {
54
+ const [run, setRun] = useState(0);
55
+ return /* @__PURE__ */ jsxs("div", {
56
+ className: "reveal-revisions",
57
+ children: [/* @__PURE__ */ jsx(Button, {
58
+ size: "sm",
59
+ icon: /* @__PURE__ */ jsx(ArrowCounterClockwiseIcon, {}),
60
+ onClick: () => setRun((n) => n + 1),
61
+ children: "Play again"
62
+ }), /* @__PURE__ */ jsx("ul", {
63
+ className: "reveal-list",
64
+ "aria-label": "Revisions",
65
+ children: REVISIONS.map((revision, index) => /* @__PURE__ */ jsx(Reveal, {
66
+ as: "li",
67
+ index,
68
+ children: /* @__PURE__ */ jsx(Card, {
69
+ padding: "sm",
70
+ "data-current": revision.current ? "" : void 0,
71
+ className: "reveal-card",
72
+ children: /* @__PURE__ */ jsxs("div", {
73
+ className: "reveal-card__row",
74
+ children: [/* @__PURE__ */ jsxs("div", {
75
+ className: "reveal-card__text",
76
+ children: [/* @__PURE__ */ jsx("span", {
77
+ className: "reveal-card__title",
78
+ children: revision.title
79
+ }), /* @__PURE__ */ jsxs("span", {
80
+ className: "reveal-card__meta",
81
+ children: [
82
+ revision.who,
83
+ " · ",
84
+ revision.when
85
+ ]
86
+ })]
87
+ }), revision.current ? /* @__PURE__ */ jsx(Badge, {
88
+ size: "sm",
89
+ tone: "accent",
90
+ children: "Current"
91
+ }) : null]
92
+ })
93
+ })
94
+ }, revision.id))
95
+ }, run)]
96
+ });
97
+ }
98
+ var PALETTES = {
99
+ basic: [
100
+ {
101
+ name: "Heading",
102
+ Glyph: TextTIcon
103
+ },
104
+ {
105
+ name: "Text",
106
+ Glyph: ListBulletsIcon
107
+ },
108
+ {
109
+ name: "Image",
110
+ Glyph: ImageSquareIcon
111
+ },
112
+ {
113
+ name: "Video",
114
+ Glyph: PlayIcon
115
+ },
116
+ {
117
+ name: "Quote",
118
+ Glyph: QuotesIcon
119
+ },
120
+ {
121
+ name: "Divider",
122
+ Glyph: MinusIcon
123
+ }
124
+ ],
125
+ structure: [
126
+ {
127
+ name: "Section",
128
+ Glyph: RowsIcon
129
+ },
130
+ {
131
+ name: "Columns",
132
+ Glyph: ColumnsIcon
133
+ },
134
+ {
135
+ name: "Grid",
136
+ Glyph: SquaresFourIcon
137
+ },
138
+ {
139
+ name: "Table",
140
+ Glyph: TableIcon
141
+ }
142
+ ],
143
+ shop: [
144
+ {
145
+ name: "Product grid",
146
+ Glyph: SquaresFourIcon
147
+ },
148
+ {
149
+ name: "Reviews",
150
+ Glyph: StarIcon
151
+ },
152
+ {
153
+ name: "Product image",
154
+ Glyph: ImageSquareIcon
155
+ }
156
+ ]
157
+ };
158
+ function Tiles() {
159
+ const [tab, setTab] = useState("basic");
160
+ const [added, setAdded] = useState(null);
161
+ const riseIn = useStaggerIn();
162
+ return /* @__PURE__ */ jsxs("div", {
163
+ className: "reveal-tiles",
164
+ children: [
165
+ /* @__PURE__ */ jsx(SegmentedControl, {
166
+ className: "reveal-tiles__tabs",
167
+ "aria-label": "Elements",
168
+ size: "sm",
169
+ value: tab,
170
+ onValueChange: setTab,
171
+ options: [
172
+ {
173
+ value: "basic",
174
+ label: "Basic"
175
+ },
176
+ {
177
+ value: "structure",
178
+ label: "Structure"
179
+ },
180
+ {
181
+ value: "shop",
182
+ label: "Shop"
183
+ }
184
+ ]
185
+ }),
186
+ /* @__PURE__ */ jsx("div", {
187
+ className: "reveal-tiles__grid",
188
+ children: PALETTES[tab].map(({ name, Glyph }, index) => /* @__PURE__ */ jsxs("button", {
189
+ type: "button",
190
+ ...riseIn(index, { className: "reveal-tile" }),
191
+ onClick: () => setAdded(name),
192
+ children: [/* @__PURE__ */ jsx(Glyph, { size: 18 }), /* @__PURE__ */ jsx("span", { children: name })]
193
+ }, name))
194
+ }, tab),
195
+ /* @__PURE__ */ jsx("p", {
196
+ className: "reveal-tiles__status",
197
+ role: "status",
198
+ children: added ? `${added} added to the page.` : ""
199
+ })
200
+ ]
201
+ });
202
+ }
203
+ function PageSections() {
204
+ const [run, setRun] = useState(0);
205
+ return /* @__PURE__ */ jsxs("div", {
206
+ className: "reveal-revisions",
207
+ children: [/* @__PURE__ */ jsx(Button, {
208
+ size: "sm",
209
+ icon: /* @__PURE__ */ jsx(ArrowCounterClockwiseIcon, {}),
210
+ onClick: () => setRun((n) => n + 1),
211
+ children: "Play again"
212
+ }), /* @__PURE__ */ jsx("div", {
213
+ className: "reveal-sections",
214
+ children: [
215
+ "Store details",
216
+ "Shipping",
217
+ "Payments"
218
+ ].map((title, index) => /* @__PURE__ */ jsxs(Reveal, {
219
+ as: "section",
220
+ index,
221
+ step: 75,
222
+ className: "reveal-section",
223
+ "aria-label": title,
224
+ children: [
225
+ /* @__PURE__ */ jsx("span", {
226
+ className: "reveal-section__title",
227
+ children: title
228
+ }),
229
+ /* @__PURE__ */ jsx("span", { className: "reveal-section__line" }),
230
+ /* @__PURE__ */ jsx("span", {
231
+ className: "reveal-section__line",
232
+ "data-short": ""
233
+ })
234
+ ]
235
+ }, title))
236
+ }, run)]
237
+ });
238
+ }
239
+ function Page() {
240
+ return /* @__PURE__ */ jsxs(DocPage, {
241
+ title: "Reveal",
242
+ status: "new",
243
+ importNames: [
244
+ "Reveal",
245
+ "useStaggerIn",
246
+ "stagger"
247
+ ],
248
+ lead: "An item that rises into place a step after the one before it: element tiles, revision cards, the groups of a settings page. It fades in and rises 6px, 40ms apart, and leaves nothing behind once it has played.",
249
+ children: [
250
+ /* @__PURE__ */ jsx(Section$1, {
251
+ id: "basics",
252
+ title: "Basics",
253
+ description: /* @__PURE__ */ jsxs("p", { children: [
254
+ "Wrap each item of a list in ",
255
+ /* @__PURE__ */ jsx("code", { children: "Reveal" }),
256
+ " with its ",
257
+ /* @__PURE__ */ jsx("code", { children: "index" }),
258
+ ": the first starts at once and each one after it a step later, so the list assembles in order rather than all at once. The delay stops growing after 15 items, so a long list never keeps anyone waiting. It plays when the item is put on the page."
259
+ ] }),
260
+ children: /* @__PURE__ */ jsx(Example, {
261
+ align: "fill",
262
+ code: `
263
+ <ul aria-label="Revisions">
264
+ {revisions.map((revision, index) => (
265
+ <Reveal key={revision.id} as="li" index={index}>
266
+ <RevisionCard revision={revision} />
267
+ </Reveal>
268
+ ))}
269
+ </ul>`,
270
+ children: /* @__PURE__ */ jsx(Revisions, {})
271
+ })
272
+ }),
273
+ /* @__PURE__ */ jsxs(Section$1, {
274
+ id: "replay",
275
+ title: "Rising in again",
276
+ description: /* @__PURE__ */ jsxs("p", { children: [
277
+ "A list rises in again when its items are new on the page. Give the list a ",
278
+ /* @__PURE__ */ jsx("code", { children: "key" }),
279
+ " that changes with what it shows (a tab, a filter), and each switch plays the entrance for the new items. Without a new key, only items that are new to the list rise in, and the rest stay still."
280
+ ] }),
281
+ children: [/* @__PURE__ */ jsx(Example, {
282
+ align: "fill",
283
+ code: `
284
+ const riseIn = useStaggerIn()
285
+
286
+ <div key={tab}>
287
+ {elements.map((element, index) => (
288
+ <button key={element.name} type="button" {...riseIn(index, { className: 'tile' })}>
289
+ {element.name}
290
+ </button>
291
+ ))}
292
+ </div>`,
293
+ children: /* @__PURE__ */ jsx(Tiles, {})
294
+ }), /* @__PURE__ */ jsx(SubSection, {
295
+ title: "Your own markup",
296
+ description: /* @__PURE__ */ jsxs("p", { children: [
297
+ "Where the item is already the element it must be (a tile that is a button, a table row), spread",
298
+ " ",
299
+ /* @__PURE__ */ jsx("code", { children: "useStaggerIn()" }),
300
+ "'s props on it, passing its own ",
301
+ /* @__PURE__ */ jsx("code", { children: "className" }),
302
+ " and ",
303
+ /* @__PURE__ */ jsx("code", { children: "style" }),
304
+ " ",
305
+ "so they are kept. ",
306
+ /* @__PURE__ */ jsx("code", { children: "<Reveal asChild>" }),
307
+ " does the same for one child."
308
+ ] })
309
+ })]
310
+ }),
311
+ /* @__PURE__ */ jsx(Section$1, {
312
+ id: "sections",
313
+ title: "A page's sections",
314
+ description: /* @__PURE__ */ jsxs("p", { children: [
315
+ "Larger blocks read better further apart. ",
316
+ /* @__PURE__ */ jsx("code", { children: "step" }),
317
+ " sets the milliseconds between items (75 for a page's sections); or set ",
318
+ /* @__PURE__ */ jsx("code", { children: "--o-rise-step" }),
319
+ " on a container, and everything rising in inside it takes that step."
320
+ ] }),
321
+ children: /* @__PURE__ */ jsx(Example, {
322
+ align: "fill",
323
+ code: `
324
+ {sections.map((section, index) => (
325
+ <Reveal key={section.id} as="section" index={index} step={75}>
326
+ <SettingsGroup section={section} />
327
+ </Reveal>
328
+ ))}`,
329
+ children: /* @__PURE__ */ jsx(PageSections, {})
330
+ })
331
+ }),
332
+ /* @__PURE__ */ jsxs(Section$1, {
333
+ id: "css-and-js",
334
+ title: "In CSS and in JavaScript",
335
+ description: /* @__PURE__ */ jsxs("p", { children: [
336
+ "The entrance is the ",
337
+ /* @__PURE__ */ jsx("code", { children: ".o-rise-in" }),
338
+ " class, timed by three custom properties, so plain markup can use it too. For motion of your own in ",
339
+ /* @__PURE__ */ jsx("code", { children: "motion/react" }),
340
+ ", ",
341
+ /* @__PURE__ */ jsx("code", { children: "stagger" }),
342
+ " holds the same step and cap beside ",
343
+ /* @__PURE__ */ jsx("code", { children: "spring" }),
344
+ ", ",
345
+ /* @__PURE__ */ jsx("code", { children: "ease" }),
346
+ " and ",
347
+ /* @__PURE__ */ jsx("code", { children: "duration" }),
348
+ "."
349
+ ] }),
350
+ children: [
351
+ /* @__PURE__ */ jsx(CodeBlock$1, { code: `
352
+ // What Reveal puts on the element; any element can carry it.
353
+ <li className="o-rise-in" style={{ '--o-rise-index': 2 } as CSSProperties}>…</li>` }),
354
+ /* @__PURE__ */ jsx(DocTable, {
355
+ columns: [
356
+ "Custom property",
357
+ "Default",
358
+ "What it sets"
359
+ ],
360
+ rows: [
361
+ [
362
+ /* @__PURE__ */ jsx("code", { children: "--o-rise-index" }),
363
+ "0",
364
+ "Its place in the line. Reveal and useStaggerIn set it."
365
+ ],
366
+ [
367
+ /* @__PURE__ */ jsx("code", { children: "--o-rise-step" }),
368
+ "40ms",
369
+ "The time between items. Set it on a container to space everything inside it."
370
+ ],
371
+ [
372
+ /* @__PURE__ */ jsx("code", { children: "--o-rise-cap" }),
373
+ "15",
374
+ "Where the delay stops growing."
375
+ ]
376
+ ]
377
+ }),
378
+ /* @__PURE__ */ jsx(CodeBlock$1, { code: `
379
+ import { motion, useReducedMotion } from 'motion/react'
380
+ import { spring, stagger } from '@orbitcommerce/constellation'
381
+
382
+ const reduce = useReducedMotion()
383
+ <motion.li
384
+ initial={{ opacity: 0, y: reduce ? 0 : 6 }}
385
+ animate={{ opacity: 1, y: 0 }}
386
+ transition={{ ...spring.soft, delay: Math.min(index, stagger.cap) * stagger.step }}
387
+ />` })
388
+ ]
389
+ }),
390
+ /* @__PURE__ */ jsx(Section$1, {
391
+ id: "accessibility",
392
+ title: "Accessibility and reduced motion",
393
+ children: /* @__PURE__ */ jsx(Guidelines, { items: [
394
+ "Everything is on the page from the start: a screen reader reads the list at once, and nothing waits on the animation.",
395
+ "Focus never moves. A control that rises in can be reached with Tab straight away, even before its turn.",
396
+ /* @__PURE__ */ jsxs(Fragment$1, { children: [
397
+ "Under reduced motion the items fade in, in the same order, with no rise (the",
398
+ " ",
399
+ /* @__PURE__ */ jsx(DocLink, {
400
+ to: "/foundations/motion#reduced-motion",
401
+ children: "Stillness Rule"
402
+ }),
403
+ ")."
404
+ ] }),
405
+ "It fills backwards only: once it has played no transform stays on the element, so a dialog or a menu inside it is never trapped by it.",
406
+ "Use it for what arrives (a list, a page, a tab), not for what updates in place: a figure that changes rolls, a row that is added slides in on its own."
407
+ ] })
408
+ }),
409
+ /* @__PURE__ */ jsxs(Section$1, {
410
+ id: "props",
411
+ title: "Props",
412
+ children: [/* @__PURE__ */ jsx(PropsTable, { rows: [
413
+ {
414
+ name: "index",
415
+ type: "number",
416
+ default: "0",
417
+ description: "Its place in the line: 0 starts at once. The delay stops growing after 15."
418
+ },
419
+ {
420
+ name: "step",
421
+ type: "number",
422
+ default: "40",
423
+ description: "Milliseconds between items. 75 suits a page’s sections."
424
+ },
425
+ {
426
+ name: "as",
427
+ type: "'div' | 'li' | 'section' | 'article' | 'span' | 'tr'",
428
+ default: "'div'",
429
+ description: "The element to render."
430
+ },
431
+ {
432
+ name: "asChild",
433
+ type: "boolean",
434
+ default: "false",
435
+ description: "Puts the entrance on its one child instead of a wrapper."
436
+ },
437
+ {
438
+ name: "...rest",
439
+ type: "HTMLAttributes<HTMLElement>",
440
+ description: "Spread on the element: className, style, aria and data attributes."
441
+ }
442
+ ] }), /* @__PURE__ */ jsx(PropsTable, {
443
+ title: "useStaggerIn",
444
+ rows: [{
445
+ name: "step",
446
+ type: "number",
447
+ default: "40",
448
+ description: "Milliseconds between items."
449
+ }, {
450
+ name: "returns",
451
+ type: "(index, own?) => { className, style }",
452
+ description: "The props to spread on the element at that index, with its own className and style kept."
453
+ }]
454
+ })]
455
+ })
456
+ ]
457
+ });
458
+ }
459
+ //#endregion
460
+ export { Page, Preview };