@orbitcommerce/constellation-docs 1.0.0 → 1.2.1
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.
- package/dist/docs.css +14764 -2237
- package/dist/index.js +2 -2
- package/dist/pages/{Playground-CNbBbErC.js → Playground-Mk1yIWXb.js} +2 -2
- package/dist/pages/_address-data-L9BR499w.js +161 -0
- package/dist/pages/_builder-demo-C0eJUmPU.js +282 -0
- package/dist/pages/_card-art-0be5ncyV.js +18 -0
- package/dist/pages/_conversation-samples-Bq7cn-4d.js +70 -0
- package/dist/pages/{_figures-data-BDmScEny.js → _figures-data-DaDvB7Nm.js} +5 -5
- package/dist/pages/_kpi-examples-DeGCBB9T.js +208 -0
- package/dist/pages/{_overlays-specimens-Dpn6oiyH.js → _overlays-specimens-bawR331Z.js} +33 -23
- package/dist/pages/_preview-specimens-DKQC9HAo.js +153 -0
- package/dist/pages/accordion-Sg0TUqxB.js +1036 -0
- package/dist/pages/address-autocomplete-DP0PUOlK.js +360 -0
- package/dist/pages/address-block-BvxQWBTy.js +403 -0
- package/dist/pages/address-fields-CwSqro3W.js +277 -0
- package/dist/pages/ai-highlight-D3x2vD83.js +642 -0
- package/dist/pages/{alert-BD4e6QTh.js → alert-D3i7xZTU.js} +195 -50
- package/dist/pages/anchored-overlay-BV0OCu2Q.js +788 -0
- package/dist/pages/{app-shell-KbA-nRqZ.js → app-shell-D4hdlHps.js} +133 -54
- package/dist/pages/{area-chart-B91dLcGo.js → area-chart-BEWFwiB2.js} +183 -27
- package/dist/pages/{avatar-DPPHXJAu.js → avatar-BFEqQViw.js} +194 -12
- package/dist/pages/avatar-upload-BDCzJfyN.js +484 -0
- package/dist/pages/{badge-C9JR0thI.js → badge-0-PyMrih.js} +441 -135
- package/dist/pages/bar-chart-DkLogYlt.js +1060 -0
- package/dist/pages/bar-fold-B-3XeIDZ.js +360 -0
- package/dist/pages/board-card-D2tZY_mU.js +415 -0
- package/dist/pages/brand-mark-BqiLvFSR.js +417 -0
- package/dist/pages/{button-D3V912P4.js → button-DAyfssDY.js} +276 -79
- package/dist/pages/{calendar-DSDZ9nRH.js → calendar-Ds7KsgSI.js} +69 -17
- package/dist/pages/canvas-stage-1KiPspkX.js +472 -0
- package/dist/pages/card-CXZ3V1d4.js +1612 -0
- package/dist/pages/caret-suggestions-oHI6QvqW.js +526 -0
- package/dist/pages/chart-legend-B20AbakD.js +724 -0
- package/dist/pages/chat-composer-CwzUJYIa.js +437 -0
- package/dist/pages/checkbox-BG9Zkb6j.js +1581 -0
- package/dist/pages/checklist-card-DEyykVFS.js +783 -0
- package/dist/pages/chip-Ck-o3Ui6.js +839 -0
- package/dist/pages/chip-list-k1LxXuCi.js +414 -0
- package/dist/pages/clamp-text-n-iE8RDR.js +203 -0
- package/dist/pages/coachmark-Be2ghobT.js +366 -0
- package/dist/pages/code-block-Dv_Y5GYq.js +622 -0
- package/dist/pages/collab-field-CfqqK7d2.js +696 -0
- package/dist/pages/color-field-CZpfcA-A.js +1127 -0
- package/dist/pages/{colour-BwuO8xAv.js → colour-q2ntvI0w.js} +496 -20
- package/dist/pages/column-mapper-TsTG39cl.js +502 -0
- package/dist/pages/combobox-DvK2j5tI.js +1334 -0
- package/dist/pages/{command-palette-xAD7fOg6.js → command-palette-CJ7uBA04.js} +201 -58
- package/dist/pages/comment-box-CDSGYhr5.js +346 -0
- package/dist/pages/composer-D4B0NgpA.js +689 -0
- package/dist/pages/condition-builder-BZy2ZGXe.js +715 -0
- package/dist/pages/conflict-chooser-C--_9UIS.js +210 -0
- package/dist/pages/context-menu-F9DV30ia.js +487 -0
- package/dist/pages/copy-button-Cn7WiKRF.js +568 -0
- package/dist/pages/copy-field-D3Xt3Jq6.js +511 -0
- package/dist/pages/danger-zone-Db_UUeiP.js +564 -0
- package/dist/pages/date-input-GOW067EB.js +956 -0
- package/dist/pages/{date-picker-BYSa816m.js → date-picker-GdBciR99.js} +186 -38
- package/dist/pages/date-time-BLKCXtVZ.js +678 -0
- package/dist/pages/{delta-CtAo0eIM.js → delta-CNAGv8JY.js} +266 -61
- package/dist/pages/description-list-BPeXn1eW.js +1268 -0
- package/dist/pages/device-switcher-BCaN99c1.js +554 -0
- package/dist/pages/dialog-CRpkRC98.js +3164 -0
- package/dist/pages/{docs-BNOb7AqR.js → docs-lM2UBSir.js} +20 -15
- package/dist/pages/doodle-nzkqi2UI.js +201 -0
- package/dist/pages/drag-ghost-B6kpzC3O.js +426 -0
- package/dist/pages/drill-menu-cskH5mol.js +490 -0
- package/dist/pages/dropzone-DOY_Rhw0.js +1069 -0
- package/dist/pages/element-toolbar-DZIhXlCJ.js +498 -0
- package/dist/pages/emoji-picker-CqaWaffD.js +235 -0
- package/dist/pages/empty-state-4U2txFpI.js +1113 -0
- package/dist/pages/facet-filters-McbBeY9e.js +353 -0
- package/dist/pages/figure-D-HF5vCj.js +563 -0
- package/dist/pages/figure-strip-hg7txTc3.js +1381 -0
- package/dist/pages/{figure-tabs-CoPFzzKz.js → figure-tabs-QOeQMY6N.js} +153 -35
- package/dist/pages/file-chip-DMDjtlqQ.js +738 -0
- package/dist/pages/filter-pill-DzqNOsD4.js +1295 -0
- package/dist/pages/font-picker-Bqhu0QMh.js +416 -0
- package/dist/pages/form-grid-BfWCVlie.js +692 -0
- package/dist/pages/gallery-BBk2EOri.js +453 -0
- package/dist/pages/gif-picker-CnoDTCaL.js +270 -0
- package/dist/pages/gradient-editor-Bqxp7Fxj.js +378 -0
- package/dist/pages/grouped-checklist-gNZ0tBKU.js +477 -0
- package/dist/pages/heatmap-BohgIcNk.js +507 -0
- package/dist/pages/highlight-text-BfxzfmvS.js +287 -0
- package/dist/pages/{home-dashboard-CFQwDtC9.js → home-dashboard-CxPmvduE.js} +21 -18
- package/dist/pages/hosted-embed-Jef3aIMP.js +163 -0
- package/dist/pages/hosted-field-BLh-53AE.js +208 -0
- package/dist/pages/hosted-field-DEpI4lVS.js +514 -0
- package/dist/pages/{icon-button-C9eSVPPW.js → icon-button-Bu4Gj5sy.js} +370 -31
- package/dist/pages/icon-picker-DEyoMUTh.js +291 -0
- package/dist/pages/icon-tile-DcgxyXPF.js +592 -0
- package/dist/pages/{icons-sxkTs5Ob.js → icons-CJ9Aar3d.js} +315 -52
- package/dist/pages/image-cropper-NyougqLH.js +466 -0
- package/dist/pages/image-field-7knBv4mJ.js +567 -0
- package/dist/pages/import-result-CmTtGXW_.js +486 -0
- package/dist/pages/inline-confirm-CEcI5Lxo.js +327 -0
- package/dist/pages/inline-edit-Ba39SzhM.js +1125 -0
- package/dist/pages/input-CzLCzfyx.js +2372 -0
- package/dist/pages/{installation-DpsX8G_n.js → installation-DRUWNVHP.js} +112 -29
- package/dist/pages/job-indicator-DOXWbFdl.js +755 -0
- package/dist/pages/kanban-Dy9sPAI0.js +740 -0
- package/dist/pages/{kbd-cNfDoikz.js → kbd-UNj4zqxn.js} +15 -14
- package/dist/pages/layout-primitives-CPRaZeyt.js +483 -0
- package/dist/pages/line-chart-CntWxeMF.js +1117 -0
- package/dist/pages/link-CXqvAg9z.js +689 -0
- package/dist/pages/link-picker-BMFGCC67.js +478 -0
- package/dist/pages/link-row-x8yaUuWc.js +595 -0
- package/dist/pages/{live-globe-ClvLn9Lb.js → live-globe-95ROMhGQ.js} +191 -47
- package/dist/pages/loading-overlay-BeGuXM9G.js +456 -0
- package/dist/pages/loading-state-BNbCo51C.js +556 -0
- package/dist/pages/log-viewer-BQz8I_a2.js +503 -0
- package/dist/pages/{logo-BfGF1Pq9.js → logo-D3a3QGKJ.js} +13 -13
- package/dist/pages/lottie_light-CxEH8eiR.js +9116 -0
- package/dist/pages/markdown-Ied72vMT.js +237 -0
- package/dist/pages/markdown-field-BfnIEKZH.js +193 -0
- package/dist/pages/media-banner-DkStCia0.js +233 -0
- package/dist/pages/{menu-by2sgQ09.js → menu-NrLYKqKp.js} +623 -109
- package/dist/pages/message-thread-Bo4zbxqu.js +731 -0
- package/dist/pages/meta-line-D5p2TycR.js +371 -0
- package/dist/pages/model-viewer-BfokvHoc.js +60288 -0
- package/dist/pages/model-viewer-C8PFO8wk.js +577 -0
- package/dist/pages/month-calendar-T1vw9Rup.js +457 -0
- package/dist/pages/{motion-BvTGc2Dk.js → motion-CrXtiBvA.js} +20 -10
- package/dist/pages/number-input-CuyMZg18.js +968 -0
- package/dist/pages/orbit-loader-DeVBtkFE.js +219 -0
- package/dist/pages/{orbit-spinner-Dil1Z3Oy.js → orbit-spinner-Dxv5qAhr.js} +30 -14
- package/dist/pages/otp-input-CVRoX1mw.js +591 -0
- package/dist/pages/{overview-BPEbZQ6g.js → overview-BSfEqHY8.js} +4 -4
- package/dist/pages/package-dimensions-DFCyZj_T.js +192 -0
- package/dist/pages/{pagination-BBUnGvv5.js → pagination-C1EgVtW4.js} +74 -29
- package/dist/pages/palette-tile-X9ZXu2Z0.js +414 -0
- package/dist/pages/password-field-DHEQKyUC.js +912 -0
- package/dist/pages/person-cell-BmjbADBz.js +564 -0
- package/dist/pages/phone-input-B3G7Qpb2.js +747 -0
- package/dist/pages/plan-card-DRaA6RuB.js +621 -0
- package/dist/pages/plan-card-DtloWvMh.js +258 -0
- package/dist/pages/plan-comparison-BVIGTtbd.js +559 -0
- package/dist/pages/plan-grid-BCPvtP8J.js +251 -0
- package/dist/pages/point-list-BbPmZjsm.js +222 -0
- package/dist/pages/{popover-Db1gLDpb.js → popover-C3Oar9D5.js} +76 -14
- package/dist/pages/presence-avatars-CRZIk8n9.js +328 -0
- package/dist/pages/preview-frame-Bcwk0y_Q.js +1631 -0
- package/dist/pages/price-CRBLoa9h.js +604 -0
- package/dist/pages/{principles-CeAIOIdt.js → principles-pnDyfHpK.js} +9 -9
- package/dist/pages/print-page-BkLv6bW8.js +513 -0
- package/dist/pages/profile-hero-CC9dUzuN.js +498 -0
- package/dist/pages/progress-CP_awmo4.js +904 -0
- package/dist/pages/progress-ring-JuOAwk2T.js +576 -0
- package/dist/pages/{radio-group-CkdBWWfG.js → radio-group-CbiibLwn.js} +581 -18
- package/dist/pages/radius-control-B2kRA2Ch.js +441 -0
- package/dist/pages/rating-CweKN2SX.js +471 -0
- package/dist/pages/record-layout-DUP_X0RL.js +719 -0
- package/dist/pages/record-pager-y9D7JFgb.js +278 -0
- package/dist/pages/registry-CNR7zpf7.js +594 -0
- package/dist/pages/{release-Dvo684UJ.js → release-DYBCY7jm.js} +4 -1
- package/dist/pages/repeater-BRZYKRQa.js +1351 -0
- package/dist/pages/reply-feedback-BDnHprla.js +192 -0
- package/dist/pages/reveal-BygENBbL.js +460 -0
- package/dist/pages/rich-text-DOFQZEpT.js +156 -0
- package/dist/pages/rich-text-editor-BhIM20JI.js +1265 -0
- package/dist/pages/rolldown-runtime-CbKu08Hx.js +25 -0
- package/dist/pages/{rolling-number-qmvH84Mq.js → rolling-number-GR3Cyfpz.js} +12 -12
- package/dist/pages/row-list-Dl6CYhC-.js +1565 -0
- package/dist/pages/rule-list-DTCmIMpT.js +648 -0
- package/dist/pages/save-status-B5KkyMZP.js +378 -0
- package/dist/pages/schedule-YycI95O1.js +243 -0
- package/dist/pages/scroll-area-B2sGm23Q.js +423 -0
- package/dist/pages/{search-field-BN7MWGQ4.js → search-field-D1uG7R6A.js} +15 -15
- package/dist/pages/search-menu-DMuXyUUW.js +580 -0
- package/dist/pages/secret-field-Dj9x3LL8.js +337 -0
- package/dist/pages/section-rail-BtTCETS5.js +637 -0
- package/dist/pages/section-v2Pubup9.js +639 -0
- package/dist/pages/{segmented-control-CTbIpRBW.js → segmented-control-D-FB1K1T.js} +450 -37
- package/dist/pages/{select-DguELoRR.js → select-DZ43NpOm.js} +22 -17
- package/dist/pages/selection-chrome-Czcs6RN6.js +437 -0
- package/dist/pages/{separator-CPZub9pv.js → separator-CFwqRvfO.js} +99 -22
- package/dist/pages/serp-preview-BGwORjmo.js +346 -0
- package/dist/pages/setting-row-Bt-dZV8H.js +913 -0
- package/dist/pages/{shape-DKvA0YKr.js → shape-DzniHAVT.js} +10 -10
- package/dist/pages/share-list-D4wgBxKN.js +926 -0
- package/dist/pages/side-panel-CCtkrZjs.js +811 -0
- package/dist/pages/site-preview-Dj1hM2Yo.js +353 -0
- package/dist/pages/skeleton-C1F5HkAu.js +1325 -0
- package/dist/pages/skip-link-BxznhSkz.js +252 -0
- package/dist/pages/slider-CAoPURKD.js +774 -0
- package/dist/pages/sortable-card-Sr44uCpI.js +424 -0
- package/dist/pages/sortable-list-DUAleYE1.js +1298 -0
- package/dist/pages/sortable-tree-BLzK-hTE.js +737 -0
- package/dist/pages/spacing-box-CtuvzxQu.js +550 -0
- package/dist/pages/{sparkline-DMMYGbHn.js → sparkline-D3aavCly.js} +301 -22
- package/dist/pages/split-bar-DYgZnFID.js +414 -0
- package/dist/pages/split-button-Be08-VI-.js +335 -0
- package/dist/pages/split-pane-lSNZgTKt.js +523 -0
- package/dist/pages/status-badge-DOdNhmzn.js +1074 -0
- package/dist/pages/status-checklist-CWkjCZIC.js +1152 -0
- package/dist/pages/status-dot-D99gAGsV.js +567 -0
- package/dist/pages/stepper-CxKTbEA-.js +1093 -0
- package/dist/pages/success-mark-CqFTOBEu.js +142 -0
- package/dist/pages/swatch-H_kNvHuC.js +565 -0
- package/dist/pages/{switch-B-Qe4kcT.js → switch-C93K6j9h.js} +151 -51
- package/dist/pages/table-mq_pNXza.js +3232 -0
- package/dist/pages/{tabs-B4M-usCV.js → tabs-Cf4MZ8Fq.js} +257 -21
- package/dist/pages/tag-input-BjZWKKRJ.js +1307 -0
- package/dist/pages/task-card-Dv0sR1-w.js +295 -0
- package/dist/pages/{textarea-fTuUZRQb.js → textarea-CCM-SnGN.js} +271 -15
- package/dist/pages/thumbnail-DwFJL_k1.js +1147 -0
- package/dist/pages/time-input-CA9-uZAa.js +442 -0
- package/dist/pages/time-zone-select-CEtMXVYO.js +296 -0
- package/dist/pages/timeline-BsMUTlpR.js +1798 -0
- package/dist/pages/{toast-CKP03zjy.js → toast-zXLRiMRT.js} +240 -25
- package/dist/pages/tool-rail-B1AbTMCP.js +355 -0
- package/dist/pages/toolbar-B9l_fHKy.js +754 -0
- package/dist/pages/{tooltip-CBYil3kt.js → tooltip-LHtCUkF-.js} +162 -33
- package/dist/pages/translation-field-CTRXiF2N.js +251 -0
- package/dist/pages/tree-checklist-CJj3OcLg.js +451 -0
- package/dist/pages/tree-select-DU1qXHy_.js +492 -0
- package/dist/pages/tree-view-g_RjLtAb.js +739 -0
- package/dist/pages/{typography-PCbg8Bhg.js → typography-BSijtiRl.js} +153 -12
- package/dist/pages/unit-input-Dml4fjmK.js +659 -0
- package/dist/pages/upload-rules-yozEzSah.js +419 -0
- package/dist/pages/url-upload-input-SSnMgfpA.js +307 -0
- package/dist/pages/value-change-CnubDKyO.js +489 -0
- package/dist/pages/weekly-hours-i2EpsmTx.js +287 -0
- package/dist/pages/widget-preview-CUJMyZ_k.js +625 -0
- package/dist/pages/working-status-CENemSsw.js +389 -0
- package/manifest.json +10989 -1108
- package/package.json +3 -3
- package/dist/pages/card-DUggbis3.js +0 -659
- package/dist/pages/checkbox-DwimQaK3.js +0 -365
- package/dist/pages/dialog-BRAf4LMh.js +0 -1451
- package/dist/pages/empty-state-C-mLrXW2.js +0 -417
- package/dist/pages/input-KF9Gkawf.js +0 -1093
- package/dist/pages/registry-CroHzK9I.js +0 -244
- package/dist/pages/skeleton-DLuBhP46.js +0 -561
- package/dist/pages/table-AMoODng4.js +0 -607
|
@@ -0,0 +1,689 @@
|
|
|
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, p as SubSection, s as Guidelines, u as PropsTable } from "./docs-lM2UBSir.js";
|
|
4
|
+
import { i as usePretendUploads, t as CHAIR_PHOTO } from "./_conversation-samples-Bq7cn-4d.js";
|
|
5
|
+
import { useEffect, useRef, useState } from "react";
|
|
6
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { Composer, IconTile, Link, Menu, MenuChipTrigger, MenuContent, MenuRadioGroup, MenuRadioItem, matchSuggestions } from "@orbitcommerce/constellation";
|
|
8
|
+
import { GaugeIcon, LightningIcon, PackageIcon, ShoppingCartIcon, SparkleIcon, UserIcon } from "@orbitcommerce/constellation/icons";
|
|
9
|
+
//#region src/pages/components/composer.tsx
|
|
10
|
+
var HINTS = [
|
|
11
|
+
"Which orders are waiting on stock?",
|
|
12
|
+
"Write a description for the Arden chair",
|
|
13
|
+
"How did sales do last week?",
|
|
14
|
+
"Find customers who have not ordered since spring"
|
|
15
|
+
];
|
|
16
|
+
var SKILLS = [
|
|
17
|
+
{
|
|
18
|
+
id: "weekly",
|
|
19
|
+
label: "weekly-report",
|
|
20
|
+
description: "Sales, orders and returns for the last 7 days",
|
|
21
|
+
prompt: "Give me my weekly report: sales, orders and returns for the last 7 days."
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: "restock",
|
|
25
|
+
label: "restock",
|
|
26
|
+
description: "What is running low and how much to reorder",
|
|
27
|
+
prompt: "What is running low, and how much should I reorder?"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: "describe",
|
|
31
|
+
label: "describe",
|
|
32
|
+
description: "A product description in the brand voice",
|
|
33
|
+
prompt: "Write a product description in our brand voice for "
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
var RECORDS = [
|
|
37
|
+
{
|
|
38
|
+
id: "p1",
|
|
39
|
+
label: "Arden ergonomic chair",
|
|
40
|
+
description: "Product",
|
|
41
|
+
icon: /* @__PURE__ */ jsx(PackageIcon, {})
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: "p2",
|
|
45
|
+
label: "Harbour standing desk",
|
|
46
|
+
description: "Product",
|
|
47
|
+
icon: /* @__PURE__ */ jsx(PackageIcon, {})
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: "o1",
|
|
51
|
+
label: "#10482",
|
|
52
|
+
description: "Order · Awaiting stock",
|
|
53
|
+
icon: /* @__PURE__ */ jsx(ShoppingCartIcon, {})
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: "c1",
|
|
57
|
+
label: "Priya Shah",
|
|
58
|
+
description: "Customer",
|
|
59
|
+
icon: /* @__PURE__ */ jsx(UserIcon, {})
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: "c2",
|
|
63
|
+
label: "Rhys Evans",
|
|
64
|
+
description: "Customer",
|
|
65
|
+
icon: /* @__PURE__ */ jsx(UserIcon, {})
|
|
66
|
+
}
|
|
67
|
+
];
|
|
68
|
+
var SOURCES = [{
|
|
69
|
+
trigger: "/",
|
|
70
|
+
at: "start",
|
|
71
|
+
label: "Skills",
|
|
72
|
+
search: (query) => matchSuggestions(SKILLS, query).map((skill) => ({
|
|
73
|
+
...skill,
|
|
74
|
+
icon: /* @__PURE__ */ jsx(LightningIcon, {}),
|
|
75
|
+
label: `/${skill.label}`
|
|
76
|
+
})),
|
|
77
|
+
onSelect: (skill) => skill.prompt,
|
|
78
|
+
empty: "No saved skills yet. Ask Nebula to save one.",
|
|
79
|
+
noMatch: "No skill matches.",
|
|
80
|
+
footer: /* @__PURE__ */ jsx(Link, {
|
|
81
|
+
href: "#suggestions",
|
|
82
|
+
children: "Manage skills"
|
|
83
|
+
})
|
|
84
|
+
}, {
|
|
85
|
+
trigger: "@",
|
|
86
|
+
label: "Mention a product, order or customer",
|
|
87
|
+
minQuery: 2,
|
|
88
|
+
debounce: 250,
|
|
89
|
+
search: async (query, { signal }) => {
|
|
90
|
+
await new Promise((resolve, reject) => {
|
|
91
|
+
const timer = setTimeout(resolve, 300);
|
|
92
|
+
signal.addEventListener("abort", () => {
|
|
93
|
+
clearTimeout(timer);
|
|
94
|
+
reject(new DOMException("Aborted", "AbortError"));
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
return RECORDS.filter((record) => record.label.toLowerCase().includes(query.toLowerCase()));
|
|
98
|
+
},
|
|
99
|
+
hint: "Type to search products, orders and customers",
|
|
100
|
+
noMatch: "No matches",
|
|
101
|
+
chip: true
|
|
102
|
+
}];
|
|
103
|
+
var EFFORTS = [
|
|
104
|
+
{
|
|
105
|
+
id: "low",
|
|
106
|
+
label: "Quick",
|
|
107
|
+
tagline: "Answers straight away"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: "medium",
|
|
111
|
+
label: "Balanced",
|
|
112
|
+
tagline: "Thinks a little first"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
id: "high",
|
|
116
|
+
label: "Thorough",
|
|
117
|
+
tagline: "Thinks it through"
|
|
118
|
+
}
|
|
119
|
+
];
|
|
120
|
+
function EffortPicker() {
|
|
121
|
+
const [effort, setEffort] = useState("medium");
|
|
122
|
+
return /* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsx(MenuChipTrigger, {
|
|
123
|
+
label: "Effort",
|
|
124
|
+
icon: /* @__PURE__ */ jsx(GaugeIcon, {}),
|
|
125
|
+
children: EFFORTS.find((e) => e.id === effort).label
|
|
126
|
+
}), /* @__PURE__ */ jsx(MenuContent, {
|
|
127
|
+
align: "start",
|
|
128
|
+
side: "top",
|
|
129
|
+
width: 240,
|
|
130
|
+
children: /* @__PURE__ */ jsx(MenuRadioGroup, {
|
|
131
|
+
label: "Effort",
|
|
132
|
+
value: effort,
|
|
133
|
+
onValueChange: setEffort,
|
|
134
|
+
children: EFFORTS.map((each) => /* @__PURE__ */ jsx(MenuRadioItem, {
|
|
135
|
+
value: each.id,
|
|
136
|
+
description: each.tagline,
|
|
137
|
+
children: each.label
|
|
138
|
+
}, each.id))
|
|
139
|
+
})
|
|
140
|
+
})] });
|
|
141
|
+
}
|
|
142
|
+
/** The assistant's face, drawn here as an icon tile: the real one is the page's. */
|
|
143
|
+
function Face() {
|
|
144
|
+
return /* @__PURE__ */ jsx(IconTile, {
|
|
145
|
+
size: "sm",
|
|
146
|
+
tone: "accent",
|
|
147
|
+
shape: "circle",
|
|
148
|
+
className: "composer-face",
|
|
149
|
+
"aria-hidden": "true",
|
|
150
|
+
children: /* @__PURE__ */ jsx(SparkleIcon, { weight: "duotone" })
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
/** What was sent, under a demo. */
|
|
154
|
+
function Sent({ messages }) {
|
|
155
|
+
if (messages.length === 0) return null;
|
|
156
|
+
const last = messages[messages.length - 1];
|
|
157
|
+
return /* @__PURE__ */ jsxs("p", {
|
|
158
|
+
className: "composer-sent",
|
|
159
|
+
children: [
|
|
160
|
+
"Sent: “",
|
|
161
|
+
last.text || "an attachment",
|
|
162
|
+
"”",
|
|
163
|
+
last.mentions.length ? ` with ${last.mentions.map((m) => m.label).join(", ")}` : ""
|
|
164
|
+
]
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
function AssistantDemo() {
|
|
168
|
+
const uploads = usePretendUploads();
|
|
169
|
+
const [sent, setSent] = useState([]);
|
|
170
|
+
const [busy, setBusy] = useState(false);
|
|
171
|
+
const timer = useRef(void 0);
|
|
172
|
+
useEffect(() => () => clearTimeout(timer.current), []);
|
|
173
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
174
|
+
className: "composer-demo composer-demo--room",
|
|
175
|
+
children: [/* @__PURE__ */ jsx(Composer, {
|
|
176
|
+
hints: HINTS,
|
|
177
|
+
placeholder: "Ask Nebula anything about your store",
|
|
178
|
+
lead: /* @__PURE__ */ jsx(Face, {}),
|
|
179
|
+
tools: /* @__PURE__ */ jsx(EffortPicker, {}),
|
|
180
|
+
onAttach: uploads.attach,
|
|
181
|
+
accept: "image/jpeg,image/png,image/gif,image/webp,application/pdf",
|
|
182
|
+
attachments: uploads.attachments,
|
|
183
|
+
onRemoveAttachment: uploads.remove,
|
|
184
|
+
suggestions: SOURCES,
|
|
185
|
+
expandable: true,
|
|
186
|
+
busy,
|
|
187
|
+
onStop: () => {
|
|
188
|
+
clearTimeout(timer.current);
|
|
189
|
+
setBusy(false);
|
|
190
|
+
},
|
|
191
|
+
onSend: (message) => {
|
|
192
|
+
setSent((all) => [...all, message]);
|
|
193
|
+
uploads.clear();
|
|
194
|
+
setBusy(true);
|
|
195
|
+
timer.current = setTimeout(() => setBusy(false), 2600);
|
|
196
|
+
},
|
|
197
|
+
status: "Nebula can make mistakes. Check anything important."
|
|
198
|
+
}), /* @__PURE__ */ jsx(Sent, { messages: sent })]
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
function PillDemo() {
|
|
202
|
+
const [sent, setSent] = useState([]);
|
|
203
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
204
|
+
className: "composer-demo composer-demo--pill",
|
|
205
|
+
children: [/* @__PURE__ */ jsx(Composer, {
|
|
206
|
+
variant: "pill",
|
|
207
|
+
lead: /* @__PURE__ */ jsx(SparkleIcon, {
|
|
208
|
+
weight: "duotone",
|
|
209
|
+
className: "composer-orb",
|
|
210
|
+
"aria-hidden": "true"
|
|
211
|
+
}),
|
|
212
|
+
placeholder: "Ask Nebula anything about your store",
|
|
213
|
+
labels: {
|
|
214
|
+
field: "Ask Nebula",
|
|
215
|
+
send: "Send to Nebula"
|
|
216
|
+
},
|
|
217
|
+
prompts: [
|
|
218
|
+
"Show my recent orders",
|
|
219
|
+
"How are sales this week?",
|
|
220
|
+
"Edit my home page"
|
|
221
|
+
],
|
|
222
|
+
onSend: (message) => setSent((all) => [...all, message])
|
|
223
|
+
}), /* @__PURE__ */ jsx(Sent, { messages: sent })]
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
function Preview() {
|
|
227
|
+
return /* @__PURE__ */ jsx("div", {
|
|
228
|
+
className: "composer-preview",
|
|
229
|
+
children: /* @__PURE__ */ jsx(Composer, {
|
|
230
|
+
lead: /* @__PURE__ */ jsx(Face, {}),
|
|
231
|
+
onSend: () => {},
|
|
232
|
+
onAttach: () => {},
|
|
233
|
+
placeholder: "Ask Nebula anything",
|
|
234
|
+
attachments: [{
|
|
235
|
+
id: "chair",
|
|
236
|
+
name: "arden-chair.jpg",
|
|
237
|
+
preview: CHAIR_PHOTO,
|
|
238
|
+
status: "done"
|
|
239
|
+
}],
|
|
240
|
+
onRemoveAttachment: () => {}
|
|
241
|
+
})
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
function Page() {
|
|
245
|
+
return /* @__PURE__ */ jsxs(DocPage, {
|
|
246
|
+
title: "Composer",
|
|
247
|
+
status: "new",
|
|
248
|
+
importNames: ["Composer"],
|
|
249
|
+
lead: "Where a message is written: an assistant's prompt or a conversation's reply. A card with its chips, a field that grows with the text and a row of tools ending in a round send, or the one-line ask pill of a home page.",
|
|
250
|
+
children: [
|
|
251
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
252
|
+
id: "card",
|
|
253
|
+
title: "The composer card",
|
|
254
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
255
|
+
"The field grows with its text to 168px, then scrolls; ",
|
|
256
|
+
/* @__PURE__ */ jsx("code", { children: "expandable" }),
|
|
257
|
+
" adds a toggle for a tall field. Enter sends and Shift and Enter adds a line. Under the field sit the ",
|
|
258
|
+
/* @__PURE__ */ jsx("code", { children: "lead" }),
|
|
259
|
+
" (the assistant's face), attach, your ",
|
|
260
|
+
/* @__PURE__ */ jsx("code", { children: "tools" }),
|
|
261
|
+
" (a model or effort picker, a",
|
|
262
|
+
" ",
|
|
263
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
264
|
+
to: "/components/menu",
|
|
265
|
+
children: "MenuChipTrigger"
|
|
266
|
+
}),
|
|
267
|
+
") and the round send, which is off while there is nothing to send or an upload runs, spins while a reply is under way (",
|
|
268
|
+
/* @__PURE__ */ jsx("code", { children: "busy" }),
|
|
269
|
+
") and turns to Stop given ",
|
|
270
|
+
/* @__PURE__ */ jsx("code", { children: "onStop" }),
|
|
271
|
+
". A press anywhere on the card's empty parts goes to the field, and the card takes the focus ring. While it is empty the placeholder types out its ",
|
|
272
|
+
/* @__PURE__ */ jsx("code", { children: "hints" }),
|
|
273
|
+
" in turn. Try attaching a picture, typing \"/\" or \"@ar\", and sending."
|
|
274
|
+
] }),
|
|
275
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
276
|
+
align: "fill",
|
|
277
|
+
minHeight: 420,
|
|
278
|
+
code: `<Composer
|
|
279
|
+
hints={hints}
|
|
280
|
+
lead={<NebulaFace />}
|
|
281
|
+
tools={<EffortPicker />}
|
|
282
|
+
onAttach={upload}
|
|
283
|
+
accept="image/jpeg,image/png,image/gif,image/webp,application/pdf"
|
|
284
|
+
attachments={attachments}
|
|
285
|
+
onRemoveAttachment={remove}
|
|
286
|
+
suggestions={[skills, mentions]}
|
|
287
|
+
expandable
|
|
288
|
+
busy={replying}
|
|
289
|
+
onStop={stop}
|
|
290
|
+
onSend={({ text, mentions }) => ask(text, { attachments, mentions })}
|
|
291
|
+
status="Nebula can make mistakes. Check anything important."
|
|
292
|
+
/>`,
|
|
293
|
+
children: /* @__PURE__ */ jsx(AssistantDemo, {})
|
|
294
|
+
})
|
|
295
|
+
}),
|
|
296
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
297
|
+
id: "attachments",
|
|
298
|
+
title: "Attachments",
|
|
299
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
300
|
+
/* @__PURE__ */ jsx("code", { children: "onAttach" }),
|
|
301
|
+
" adds the attach button, and the card takes files dropped on it or pasted into the field too. Each choice is held to ",
|
|
302
|
+
/* @__PURE__ */ jsx("code", { children: "accept" }),
|
|
303
|
+
", ",
|
|
304
|
+
/* @__PURE__ */ jsx("code", { children: "maxFiles" }),
|
|
305
|
+
" (5, counting those attached) and",
|
|
306
|
+
" ",
|
|
307
|
+
/* @__PURE__ */ jsx("code", { children: "maxSize" }),
|
|
308
|
+
" (10 MB); what passes goes to ",
|
|
309
|
+
/* @__PURE__ */ jsx("code", { children: "onAttach" }),
|
|
310
|
+
" for the page to upload, and what does not is said in the status line (or handed to ",
|
|
311
|
+
/* @__PURE__ */ jsx("code", { children: "onReject" }),
|
|
312
|
+
"). Hand the files back as",
|
|
313
|
+
" ",
|
|
314
|
+
/* @__PURE__ */ jsx("code", { children: "attachments" }),
|
|
315
|
+
": they show as ",
|
|
316
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
317
|
+
to: "/components/file-chip#pill",
|
|
318
|
+
children: "file chip pills"
|
|
319
|
+
}),
|
|
320
|
+
" over the field, with their pictures, and send is off until every upload has finished. A finished attachment can be sent with no words. A pill whose remove had focus hands it to the field as it goes."
|
|
321
|
+
] }),
|
|
322
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
323
|
+
align: "fill",
|
|
324
|
+
code: `<Composer
|
|
325
|
+
onAttach={upload}
|
|
326
|
+
attachments={[
|
|
327
|
+
{ id: 'chair', name: 'arden-chair.jpg', preview: chairUrl, status: 'done' },
|
|
328
|
+
{ id: 'terms', name: 'trade-terms.pdf', status: 'uploading' },
|
|
329
|
+
]}
|
|
330
|
+
onRemoveAttachment={remove}
|
|
331
|
+
onSend={send}
|
|
332
|
+
/>`,
|
|
333
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
334
|
+
className: "composer-demo",
|
|
335
|
+
children: /* @__PURE__ */ jsx(Composer, {
|
|
336
|
+
onAttach: () => {},
|
|
337
|
+
placeholder: "Add a message, or send the files",
|
|
338
|
+
attachments: [{
|
|
339
|
+
id: "chair",
|
|
340
|
+
name: "arden-chair.jpg",
|
|
341
|
+
preview: CHAIR_PHOTO,
|
|
342
|
+
status: "done"
|
|
343
|
+
}, {
|
|
344
|
+
id: "terms",
|
|
345
|
+
name: "trade-terms-2026.pdf",
|
|
346
|
+
status: "uploading"
|
|
347
|
+
}],
|
|
348
|
+
onRemoveAttachment: () => {},
|
|
349
|
+
onSend: () => {}
|
|
350
|
+
})
|
|
351
|
+
})
|
|
352
|
+
})
|
|
353
|
+
}),
|
|
354
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
355
|
+
id: "suggestions",
|
|
356
|
+
title: "Suggestions and mentions",
|
|
357
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
358
|
+
/* @__PURE__ */ jsx("code", { children: "suggestions" }),
|
|
359
|
+
" are ",
|
|
360
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
361
|
+
to: "/components/caret-suggestions",
|
|
362
|
+
children: "caret suggestion"
|
|
363
|
+
}),
|
|
364
|
+
" sources: \"/\" for skills that replace the draft, \"@\" for a product, an order or a customer. The list sits over the card, as wide as it. A source with ",
|
|
365
|
+
/* @__PURE__ */ jsx("code", { children: "chip" }),
|
|
366
|
+
" also adds a removable chip for each pick, at most",
|
|
367
|
+
" ",
|
|
368
|
+
/* @__PURE__ */ jsx("code", { children: "maxMentions" }),
|
|
369
|
+
" (5) and never the same one twice; the chips go with the words to ",
|
|
370
|
+
/* @__PURE__ */ jsx("code", { children: "onSend" }),
|
|
371
|
+
" ",
|
|
372
|
+
"and clear once sent. Open a source from a button of your own with ",
|
|
373
|
+
/* @__PURE__ */ jsx("code", { children: "suggestionsRef" }),
|
|
374
|
+
"."
|
|
375
|
+
] }),
|
|
376
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
377
|
+
align: "fill",
|
|
378
|
+
code: `const mentions: ComposerSuggestionSource = {
|
|
379
|
+
trigger: '@',
|
|
380
|
+
label: 'Mention a product, order or customer',
|
|
381
|
+
minQuery: 2,
|
|
382
|
+
debounce: 250,
|
|
383
|
+
search: (query, { signal }) => searchStore(query, { signal }),
|
|
384
|
+
chip: true,
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
<Composer suggestions={[skills, mentions]} onSend={({ text, mentions }) => ask(text, mentions)} />`,
|
|
388
|
+
children: /* @__PURE__ */ jsx("p", {
|
|
389
|
+
className: "composer-note",
|
|
390
|
+
children: "The composer card above takes both: type \"/\" or \"@ar\" there."
|
|
391
|
+
})
|
|
392
|
+
})
|
|
393
|
+
}),
|
|
394
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
395
|
+
id: "pill",
|
|
396
|
+
title: "The ask pill",
|
|
397
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
398
|
+
/* @__PURE__ */ jsx("code", { children: "variant=\"pill\"" }),
|
|
399
|
+
" is the home page's front door: a leading orb, a one-line field and a round send that is off until there is text. While it is engaged (focus inside it, or a draft) its",
|
|
400
|
+
" ",
|
|
401
|
+
/* @__PURE__ */ jsx("code", { children: "prompts" }),
|
|
402
|
+
" slide in under it; pressing one sends it as it is."
|
|
403
|
+
] }),
|
|
404
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
405
|
+
align: "fill",
|
|
406
|
+
code: `<Composer
|
|
407
|
+
variant="pill"
|
|
408
|
+
lead={<NebulaOrb />}
|
|
409
|
+
placeholder="Ask Nebula anything about your store"
|
|
410
|
+
prompts={['Show my recent orders', 'How are sales this week?', 'Edit my home page']}
|
|
411
|
+
onSend={({ text }) => openNebulaWith(text)}
|
|
412
|
+
/>`,
|
|
413
|
+
children: /* @__PURE__ */ jsx(PillDemo, {})
|
|
414
|
+
})
|
|
415
|
+
}),
|
|
416
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
417
|
+
id: "states",
|
|
418
|
+
title: "States",
|
|
419
|
+
children: [
|
|
420
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
421
|
+
title: "Busy, with Stop",
|
|
422
|
+
description: /* @__PURE__ */ jsx("p", { children: "The field stays open to write the next message; Enter waits." }),
|
|
423
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
424
|
+
align: "fill",
|
|
425
|
+
code: `<Composer busy onStop={stop} onSend={send} />`,
|
|
426
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
427
|
+
className: "composer-demo",
|
|
428
|
+
children: /* @__PURE__ */ jsx(Composer, {
|
|
429
|
+
busy: true,
|
|
430
|
+
onStop: () => {},
|
|
431
|
+
defaultValue: "And which of those are late?",
|
|
432
|
+
lead: /* @__PURE__ */ jsx(Face, {}),
|
|
433
|
+
onSend: () => {}
|
|
434
|
+
})
|
|
435
|
+
})
|
|
436
|
+
})
|
|
437
|
+
}),
|
|
438
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
439
|
+
title: "Quick prompts over the card",
|
|
440
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
441
|
+
"On the card, ",
|
|
442
|
+
/* @__PURE__ */ jsx("code", { children: "prompts" }),
|
|
443
|
+
" sit over it, always shown, as a rewrite's quick prompts do; a press sends one."
|
|
444
|
+
] }),
|
|
445
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
446
|
+
align: "fill",
|
|
447
|
+
code: `<Composer prompts={['Shorter', 'Friendlier', 'More formal']} onSend={rewrite} />`,
|
|
448
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
449
|
+
className: "composer-demo",
|
|
450
|
+
children: /* @__PURE__ */ jsx(Composer, {
|
|
451
|
+
prompts: [
|
|
452
|
+
"Shorter",
|
|
453
|
+
"Friendlier",
|
|
454
|
+
"More formal"
|
|
455
|
+
],
|
|
456
|
+
placeholder: "Tell Nebula how to rewrite it",
|
|
457
|
+
onSend: () => {}
|
|
458
|
+
})
|
|
459
|
+
})
|
|
460
|
+
})
|
|
461
|
+
}),
|
|
462
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
463
|
+
title: "Off, with a reason",
|
|
464
|
+
description: /* @__PURE__ */ jsx("p", { children: "Focusable, read only, the send and attach saying why." }),
|
|
465
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
466
|
+
align: "fill",
|
|
467
|
+
code: `<Composer disabled disabledReason="Nebula is off for this store." onAttach={upload} onSend={send} />`,
|
|
468
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
469
|
+
className: "composer-demo",
|
|
470
|
+
children: /* @__PURE__ */ jsx(Composer, {
|
|
471
|
+
disabled: true,
|
|
472
|
+
disabledReason: "Nebula is off for this store. Turn it on in Settings.",
|
|
473
|
+
placeholder: "Nebula is off for this store",
|
|
474
|
+
onAttach: () => {},
|
|
475
|
+
lead: /* @__PURE__ */ jsx(Face, {}),
|
|
476
|
+
onSend: () => {}
|
|
477
|
+
})
|
|
478
|
+
})
|
|
479
|
+
})
|
|
480
|
+
})
|
|
481
|
+
]
|
|
482
|
+
}),
|
|
483
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
484
|
+
id: "both-themes",
|
|
485
|
+
title: "In both themes",
|
|
486
|
+
children: /* @__PURE__ */ jsx(ThemePair, { children: /* @__PURE__ */ jsxs("div", {
|
|
487
|
+
className: "composer-stack",
|
|
488
|
+
children: [/* @__PURE__ */ jsx(Composer, {
|
|
489
|
+
lead: /* @__PURE__ */ jsx(Face, {}),
|
|
490
|
+
onAttach: () => {},
|
|
491
|
+
defaultValue: "Write a description for the Arden chair",
|
|
492
|
+
attachments: [{
|
|
493
|
+
id: "chair",
|
|
494
|
+
name: "arden-chair.jpg",
|
|
495
|
+
preview: CHAIR_PHOTO,
|
|
496
|
+
status: "done"
|
|
497
|
+
}],
|
|
498
|
+
onRemoveAttachment: () => {},
|
|
499
|
+
onSend: () => {}
|
|
500
|
+
}), /* @__PURE__ */ jsx(Composer, {
|
|
501
|
+
variant: "pill",
|
|
502
|
+
lead: /* @__PURE__ */ jsx(SparkleIcon, {
|
|
503
|
+
weight: "duotone",
|
|
504
|
+
className: "composer-orb",
|
|
505
|
+
"aria-hidden": "true"
|
|
506
|
+
}),
|
|
507
|
+
placeholder: "Ask Nebula anything",
|
|
508
|
+
onSend: () => {}
|
|
509
|
+
})]
|
|
510
|
+
}) })
|
|
511
|
+
}),
|
|
512
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
513
|
+
id: "guidelines",
|
|
514
|
+
title: "Guidelines",
|
|
515
|
+
children: /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
516
|
+
"Keep the composer at the foot of the conversation it writes into, full width, with the thread above it.",
|
|
517
|
+
"Let people write while a reply is under way: busy holds the send, not the field.",
|
|
518
|
+
"Upload as soon as a file is chosen and show it as a pill, so the send is ready when the words are.",
|
|
519
|
+
"Hints should be things the assistant does well, in the person’s own words."
|
|
520
|
+
] })
|
|
521
|
+
}),
|
|
522
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
523
|
+
id: "accessibility",
|
|
524
|
+
title: "Accessibility",
|
|
525
|
+
children: /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
526
|
+
"The field is named by labels.field (\"Message\"); the hints are a placeholder, never its name.",
|
|
527
|
+
"The send, attach and Stop are named icon buttons. Off, they stay focusable (aria-disabled) and say why on hover and focus; a busy send is aria-busy.",
|
|
528
|
+
"A failed send puts the draft back and says so in the status line, a polite status in the page from the start.",
|
|
529
|
+
"Focus stays in the field through a send, a pick and an expand; a control that goes while it has focus (a pill’s remove, the Stop as a run ends) hands focus to the field.",
|
|
530
|
+
"With toolbarLabel the tools are one toolbar: a single tab stop, the arrow keys moving between them, each with its name as a tip; the send is a stop of its own.",
|
|
531
|
+
"In forced colours the card keeps a real border, and focus a real outline."
|
|
532
|
+
] })
|
|
533
|
+
}),
|
|
534
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
535
|
+
id: "props",
|
|
536
|
+
title: "Props",
|
|
537
|
+
children: /* @__PURE__ */ jsx(PropsTable, {
|
|
538
|
+
title: "Composer",
|
|
539
|
+
rows: [
|
|
540
|
+
{
|
|
541
|
+
name: "onSend",
|
|
542
|
+
type: "({ text, mentions }) => void | Promise",
|
|
543
|
+
required: true,
|
|
544
|
+
description: "Called as a message is sent, the field already cleared. A rejected promise puts the draft back."
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
name: "variant",
|
|
548
|
+
type: "'card' | 'pill'",
|
|
549
|
+
default: "'card'",
|
|
550
|
+
description: "The composer card or the ask pill."
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
name: "value, defaultValue, onValueChange",
|
|
554
|
+
type: "string",
|
|
555
|
+
description: "The draft, kept by the page or by the composer."
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
name: "busy",
|
|
559
|
+
type: "boolean",
|
|
560
|
+
default: "false",
|
|
561
|
+
description: "A reply is under way: the send spins, Enter waits, the field stays open."
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
name: "onStop",
|
|
565
|
+
type: "() => void",
|
|
566
|
+
description: "While busy the send becomes Stop."
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
name: "disabled, disabledReason",
|
|
570
|
+
type: "boolean, ReactNode",
|
|
571
|
+
description: "Off, focusable, with the reason on send and attach."
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
name: "placeholder",
|
|
575
|
+
type: "string",
|
|
576
|
+
description: "The placeholder, shown too while hints are not typing."
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
name: "hints",
|
|
580
|
+
type: "string[]",
|
|
581
|
+
description: "Hints the placeholder types in turn while the field is empty."
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
name: "lead",
|
|
585
|
+
type: "ReactNode",
|
|
586
|
+
description: "The first tool (the assistant’s face); the pill’s orb."
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
name: "tools",
|
|
590
|
+
type: "ReactNode",
|
|
591
|
+
description: "Your tools between attach and send."
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
name: "onAttach",
|
|
595
|
+
type: "(files: File[]) => void",
|
|
596
|
+
description: "Adds attach, drop and paste; hands over the files the rules allow."
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
name: "accept, maxFiles, maxSize",
|
|
600
|
+
type: "string, number, number",
|
|
601
|
+
default: "any file, 5, 10 MB",
|
|
602
|
+
description: "The rules for files."
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
name: "onReject",
|
|
606
|
+
type: "(rejections) => void",
|
|
607
|
+
description: "Files refused, with reasons. Without it the status line says them."
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
name: "attachments",
|
|
611
|
+
type: "ComposerAttachment[]",
|
|
612
|
+
description: "{ id, name, preview?, icon?, status?, error? }, drawn as pills."
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
name: "onRemoveAttachment",
|
|
616
|
+
type: "(id: string) => void",
|
|
617
|
+
description: "Adds a remove to each pill."
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
name: "suggestions",
|
|
621
|
+
type: "ComposerSuggestionSource[]",
|
|
622
|
+
description: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
623
|
+
"Caret suggestion sources; ",
|
|
624
|
+
/* @__PURE__ */ jsx("code", { children: "chip" }),
|
|
625
|
+
" adds a chip per pick."
|
|
626
|
+
] })
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
name: "mentions, onMentionsChange, maxMentions",
|
|
630
|
+
type: "M[], (M[]) => void, number",
|
|
631
|
+
default: "kept by the composer, none, 5",
|
|
632
|
+
description: "The chips the picks added."
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
name: "chips",
|
|
636
|
+
type: "ReactNode",
|
|
637
|
+
description: "Chips of your own after the mentions."
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
name: "status",
|
|
641
|
+
type: "ReactNode",
|
|
642
|
+
description: "A line under the composer, said politely."
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
name: "expandable",
|
|
646
|
+
type: "boolean",
|
|
647
|
+
default: "false",
|
|
648
|
+
description: "The expand toggle."
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
name: "maxHeight",
|
|
652
|
+
type: "number",
|
|
653
|
+
default: "168",
|
|
654
|
+
description: "The tallest the field grows on its own, in px."
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
name: "prompts",
|
|
658
|
+
type: "string[]",
|
|
659
|
+
description: "Prompts that send themselves: under the pill while it is engaged, over the card always."
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
name: "sendAppearance",
|
|
663
|
+
type: "'round' | 'text'",
|
|
664
|
+
default: "'round'",
|
|
665
|
+
description: "The round arrow, or a pill with the send’s words for a reply box."
|
|
666
|
+
},
|
|
667
|
+
{
|
|
668
|
+
name: "toolbarLabel",
|
|
669
|
+
type: "string",
|
|
670
|
+
description: "Makes the tools one Toolbar of this name: one tab stop, the arrows between attach, your tools (ToolbarButton, ToolbarMenu, ToolbarItem) and expand. The send stays apart."
|
|
671
|
+
},
|
|
672
|
+
{
|
|
673
|
+
name: "fieldRef, suggestionsRef",
|
|
674
|
+
type: "Ref",
|
|
675
|
+
description: "The field, and the suggestion list’s handle."
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
name: "labels",
|
|
679
|
+
type: "Partial<ComposerLabels>",
|
|
680
|
+
description: "field, send, stop, attach, attachFull(max), expand, waitForUploads, sendFailed, attachments, mentions, removeMention(label), prompts, and the file refusals."
|
|
681
|
+
}
|
|
682
|
+
]
|
|
683
|
+
})
|
|
684
|
+
})
|
|
685
|
+
]
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
//#endregion
|
|
689
|
+
export { Page, Preview };
|