@orbitcommerce/constellation-docs 1.0.0 → 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.
- 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-BZOOOPA9.js +368 -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-CQEM1_wc.js +1567 -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-BB3mNl7D.js +1364 -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-C3UcpQJT.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-B38rnzoq.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-LA9XRhZc.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-cfPVTB5V.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-C-4tg6FS.js} +580 -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-BZg-xAbi.js +594 -0
- package/dist/pages/{release-Dvo684UJ.js → release-Cs6tl16C.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-CL0vomno.js +3225 -0
- package/dist/pages/{tabs-B4M-usCV.js → tabs-Dh0mUsLw.js} +256 -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 +10984 -1108
- package/package.json +2 -2
- 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,471 @@
|
|
|
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 { Field, Rating, RatingInput } from "@orbitcommerce/constellation";
|
|
6
|
+
//#region src/pages/components/rating.tsx
|
|
7
|
+
function Preview() {
|
|
8
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
9
|
+
className: "rating-preview",
|
|
10
|
+
children: [
|
|
11
|
+
/* @__PURE__ */ jsx(Rating, {
|
|
12
|
+
value: 4.5,
|
|
13
|
+
count: 128,
|
|
14
|
+
size: "lg"
|
|
15
|
+
}),
|
|
16
|
+
/* @__PURE__ */ jsx(Rating, {
|
|
17
|
+
value: 3,
|
|
18
|
+
count: 12
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ jsx(RatingInput, {
|
|
21
|
+
"aria-label": "Your rating",
|
|
22
|
+
defaultValue: 4,
|
|
23
|
+
size: "sm"
|
|
24
|
+
})
|
|
25
|
+
]
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
function Review() {
|
|
29
|
+
const [rating, setRating] = useState(null);
|
|
30
|
+
return /* @__PURE__ */ jsx("div", {
|
|
31
|
+
className: "rating-stack",
|
|
32
|
+
children: /* @__PURE__ */ jsx(Field, {
|
|
33
|
+
label: "Your rating",
|
|
34
|
+
hint: "Press the chosen star again to clear it.",
|
|
35
|
+
children: /* @__PURE__ */ jsx(RatingInput, {
|
|
36
|
+
value: rating,
|
|
37
|
+
onValueChange: setRating,
|
|
38
|
+
size: "lg",
|
|
39
|
+
readout: true
|
|
40
|
+
})
|
|
41
|
+
})
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function Csat() {
|
|
45
|
+
const [score, setScore] = useState(4);
|
|
46
|
+
return /* @__PURE__ */ jsx("div", {
|
|
47
|
+
className: "rating-stack",
|
|
48
|
+
children: /* @__PURE__ */ jsx(Field, {
|
|
49
|
+
label: "How did we do?",
|
|
50
|
+
children: /* @__PURE__ */ jsx(RatingInput, {
|
|
51
|
+
symbol: "face",
|
|
52
|
+
value: score,
|
|
53
|
+
onValueChange: setScore,
|
|
54
|
+
size: "lg"
|
|
55
|
+
})
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function Page() {
|
|
60
|
+
return /* @__PURE__ */ jsxs(DocPage, {
|
|
61
|
+
title: "Rating",
|
|
62
|
+
status: "new",
|
|
63
|
+
importNames: ["Rating", "RatingInput"],
|
|
64
|
+
lead: "How well something was rated, read or chosen: a plugin's stars on its listing, a review's rating, a rating custom field, how a chat went. Stars in the kit's amber over a quiet track, so a half star reads as half.",
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
67
|
+
id: "read",
|
|
68
|
+
title: "Reading a rating",
|
|
69
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
70
|
+
/* @__PURE__ */ jsx("code", { children: "Rating" }),
|
|
71
|
+
" fills its stars to the ",
|
|
72
|
+
/* @__PURE__ */ jsx("code", { children: "value" }),
|
|
73
|
+
", to the nearest half, and writes the figure and the ",
|
|
74
|
+
/* @__PURE__ */ jsx("code", { children: "count" }),
|
|
75
|
+
" beside them. It is named as one picture, \"4.5 out of 5, 128 ratings\", so a screen reader hears one sentence, not five stars. Nothing rated (a ",
|
|
76
|
+
/* @__PURE__ */ jsx("code", { children: "null" }),
|
|
77
|
+
" value or a count of 0) says \"No ratings\", never a row of empty stars that reads as a bad score."
|
|
78
|
+
] }),
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ jsx(Example, {
|
|
81
|
+
align: "start",
|
|
82
|
+
code: `
|
|
83
|
+
<Rating value={4.5} count={128} />
|
|
84
|
+
<Rating value={3.2} count={9} valueFormat="fraction" />
|
|
85
|
+
<Rating value={4.8} count={2140} size="lg" />
|
|
86
|
+
<Rating value={null} />`,
|
|
87
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
88
|
+
className: "rating-rows",
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ jsx(Rating, {
|
|
91
|
+
value: 4.5,
|
|
92
|
+
count: 128
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ jsx(Rating, {
|
|
95
|
+
value: 3.2,
|
|
96
|
+
count: 9,
|
|
97
|
+
valueFormat: "fraction"
|
|
98
|
+
}),
|
|
99
|
+
/* @__PURE__ */ jsx(Rating, {
|
|
100
|
+
value: 4.8,
|
|
101
|
+
count: 2140,
|
|
102
|
+
size: "lg"
|
|
103
|
+
}),
|
|
104
|
+
/* @__PURE__ */ jsx(Rating, { value: null })
|
|
105
|
+
]
|
|
106
|
+
})
|
|
107
|
+
}),
|
|
108
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
109
|
+
title: "Compact",
|
|
110
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
111
|
+
/* @__PURE__ */ jsx("code", { children: "compact" }),
|
|
112
|
+
" draws one star beside the figure (always with one decimal): the form for a table row, a marketplace card's meta line or an option's label. ",
|
|
113
|
+
/* @__PURE__ */ jsx("code", { children: "size=\"sm\"" }),
|
|
114
|
+
" sets it at 12px for dense rows."
|
|
115
|
+
] }),
|
|
116
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
117
|
+
align: "start",
|
|
118
|
+
code: `
|
|
119
|
+
<Rating value={4.8} count={312} compact size="sm" />
|
|
120
|
+
<Rating value={4} count={18} compact />`,
|
|
121
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
122
|
+
className: "rating-rows",
|
|
123
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
124
|
+
className: "rating-row",
|
|
125
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
126
|
+
className: "rating-row__label",
|
|
127
|
+
children: "Stock sync"
|
|
128
|
+
}), /* @__PURE__ */ jsx(Rating, {
|
|
129
|
+
value: 4.8,
|
|
130
|
+
count: 312,
|
|
131
|
+
compact: true,
|
|
132
|
+
size: "sm"
|
|
133
|
+
})]
|
|
134
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
135
|
+
className: "rating-row",
|
|
136
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
137
|
+
className: "rating-row__label",
|
|
138
|
+
children: "Gift cards"
|
|
139
|
+
}), /* @__PURE__ */ jsx(Rating, {
|
|
140
|
+
value: 4,
|
|
141
|
+
count: 18,
|
|
142
|
+
compact: true
|
|
143
|
+
})]
|
|
144
|
+
})]
|
|
145
|
+
})
|
|
146
|
+
})
|
|
147
|
+
}),
|
|
148
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
149
|
+
title: "Faces",
|
|
150
|
+
description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "symbol=\"face\"" }), " draws one face for the value, from angry to delighted, with the figure as \"n/5\": how a customer rated a chat."] }),
|
|
151
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
152
|
+
align: "start",
|
|
153
|
+
code: `
|
|
154
|
+
<Rating value={5} symbol="face" />
|
|
155
|
+
<Rating value={3} symbol="face" />
|
|
156
|
+
<Rating value={1} symbol="face" />`,
|
|
157
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
158
|
+
className: "rating-row",
|
|
159
|
+
children: [
|
|
160
|
+
/* @__PURE__ */ jsx(Rating, {
|
|
161
|
+
value: 5,
|
|
162
|
+
symbol: "face"
|
|
163
|
+
}),
|
|
164
|
+
/* @__PURE__ */ jsx(Rating, {
|
|
165
|
+
value: 3,
|
|
166
|
+
symbol: "face"
|
|
167
|
+
}),
|
|
168
|
+
/* @__PURE__ */ jsx(Rating, {
|
|
169
|
+
value: 1,
|
|
170
|
+
symbol: "face"
|
|
171
|
+
})
|
|
172
|
+
]
|
|
173
|
+
})
|
|
174
|
+
})
|
|
175
|
+
})
|
|
176
|
+
]
|
|
177
|
+
}),
|
|
178
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
179
|
+
id: "input",
|
|
180
|
+
title: "Choosing a rating",
|
|
181
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
182
|
+
/* @__PURE__ */ jsx("code", { children: "RatingInput" }),
|
|
183
|
+
" is a radiogroup of stars: one tab stop, the arrow keys move and choose, and each star is named (\"3 stars\"). The pointer previews the stars it is over; a press sets the rating, and pressing the chosen star again (or Backspace) clears it. ",
|
|
184
|
+
/* @__PURE__ */ jsx("code", { children: "readout" }),
|
|
185
|
+
" shows \"n/max\" beside it. Put it in a",
|
|
186
|
+
" ",
|
|
187
|
+
/* @__PURE__ */ jsx("code", { children: "Field" }),
|
|
188
|
+
", which names it."
|
|
189
|
+
] }),
|
|
190
|
+
children: [
|
|
191
|
+
/* @__PURE__ */ jsx(Example, {
|
|
192
|
+
align: "fill",
|
|
193
|
+
code: `
|
|
194
|
+
const [rating, setRating] = useState<number | null>(null)
|
|
195
|
+
|
|
196
|
+
<Field label="Your rating" hint="Press the chosen star again to clear it.">
|
|
197
|
+
<RatingInput value={rating} onValueChange={setRating} size="lg" readout />
|
|
198
|
+
</Field>`,
|
|
199
|
+
children: /* @__PURE__ */ jsx(Review, {})
|
|
200
|
+
}),
|
|
201
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
202
|
+
title: "Faces",
|
|
203
|
+
description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "symbol=\"face\"" }), " chooses from five faces, the chosen one in teal; each is named by its place on the scale (\"4 out of 5\")."] }),
|
|
204
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
205
|
+
align: "fill",
|
|
206
|
+
code: `
|
|
207
|
+
<Field label="How did we do?">
|
|
208
|
+
<RatingInput symbol="face" value={score} onValueChange={setScore} size="lg" />
|
|
209
|
+
</Field>`,
|
|
210
|
+
children: /* @__PURE__ */ jsx(Csat, {})
|
|
211
|
+
})
|
|
212
|
+
}),
|
|
213
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
214
|
+
title: "Range, required, read only and disabled",
|
|
215
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
216
|
+
/* @__PURE__ */ jsx("code", { children: "min" }),
|
|
217
|
+
" and ",
|
|
218
|
+
/* @__PURE__ */ jsx("code", { children: "max" }),
|
|
219
|
+
" set the scale (a custom field's 1 to 10). ",
|
|
220
|
+
/* @__PURE__ */ jsx("code", { children: "required" }),
|
|
221
|
+
" keeps a rating from being cleared and says so to assistive tech. ",
|
|
222
|
+
/* @__PURE__ */ jsx("code", { children: "readOnly" }),
|
|
223
|
+
" shows the rating and stays in the tab order; ",
|
|
224
|
+
/* @__PURE__ */ jsx("code", { children: "disabled" }),
|
|
225
|
+
" switches every star off. Sizes are ",
|
|
226
|
+
/* @__PURE__ */ jsx("code", { children: "sm" }),
|
|
227
|
+
", ",
|
|
228
|
+
/* @__PURE__ */ jsx("code", { children: "md" }),
|
|
229
|
+
" and",
|
|
230
|
+
" ",
|
|
231
|
+
/* @__PURE__ */ jsx("code", { children: "lg" }),
|
|
232
|
+
", and every star is at least a 24px target."
|
|
233
|
+
] }),
|
|
234
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
235
|
+
align: "start",
|
|
236
|
+
code: `
|
|
237
|
+
<RatingInput aria-label="Quality, 1 to 10" max={10} defaultValue={7} readout size="sm" />
|
|
238
|
+
<RatingInput aria-label="Required rating" required defaultValue={3} />
|
|
239
|
+
<RatingInput aria-label="Read-only rating" readOnly value={4} />
|
|
240
|
+
<RatingInput aria-label="Disabled rating" disabled value={2} />`,
|
|
241
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
242
|
+
className: "rating-rows",
|
|
243
|
+
children: [
|
|
244
|
+
/* @__PURE__ */ jsx(RatingInput, {
|
|
245
|
+
"aria-label": "Quality, 1 to 10",
|
|
246
|
+
max: 10,
|
|
247
|
+
defaultValue: 7,
|
|
248
|
+
readout: true,
|
|
249
|
+
size: "sm"
|
|
250
|
+
}),
|
|
251
|
+
/* @__PURE__ */ jsx(RatingInput, {
|
|
252
|
+
"aria-label": "Required rating",
|
|
253
|
+
required: true,
|
|
254
|
+
defaultValue: 3
|
|
255
|
+
}),
|
|
256
|
+
/* @__PURE__ */ jsx(RatingInput, {
|
|
257
|
+
"aria-label": "Read-only rating",
|
|
258
|
+
readOnly: true,
|
|
259
|
+
value: 4
|
|
260
|
+
}),
|
|
261
|
+
/* @__PURE__ */ jsx(RatingInput, {
|
|
262
|
+
"aria-label": "Disabled rating",
|
|
263
|
+
disabled: true,
|
|
264
|
+
value: 2
|
|
265
|
+
})
|
|
266
|
+
]
|
|
267
|
+
})
|
|
268
|
+
})
|
|
269
|
+
})
|
|
270
|
+
]
|
|
271
|
+
}),
|
|
272
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
273
|
+
id: "both-themes",
|
|
274
|
+
title: "In both themes",
|
|
275
|
+
children: /* @__PURE__ */ jsx(ThemePair, {
|
|
276
|
+
align: "start",
|
|
277
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
278
|
+
className: "rating-rows",
|
|
279
|
+
children: [
|
|
280
|
+
/* @__PURE__ */ jsx(Rating, {
|
|
281
|
+
value: 4.5,
|
|
282
|
+
count: 128
|
|
283
|
+
}),
|
|
284
|
+
/* @__PURE__ */ jsx(Rating, {
|
|
285
|
+
value: 4.8,
|
|
286
|
+
count: 312,
|
|
287
|
+
compact: true,
|
|
288
|
+
size: "sm"
|
|
289
|
+
}),
|
|
290
|
+
/* @__PURE__ */ jsx(RatingInput, {
|
|
291
|
+
"aria-label": "Your rating",
|
|
292
|
+
defaultValue: 3
|
|
293
|
+
}),
|
|
294
|
+
/* @__PURE__ */ jsx(RatingInput, {
|
|
295
|
+
"aria-label": "How did we do?",
|
|
296
|
+
symbol: "face",
|
|
297
|
+
defaultValue: 4
|
|
298
|
+
})
|
|
299
|
+
]
|
|
300
|
+
})
|
|
301
|
+
})
|
|
302
|
+
}),
|
|
303
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
304
|
+
id: "guidelines",
|
|
305
|
+
title: "Guidelines",
|
|
306
|
+
children: /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
307
|
+
"Show the count beside an average: 4.9 from 3 ratings is not 4.9 from 3,000.",
|
|
308
|
+
"Say \"No ratings\" for a listing nobody has rated; an empty row of stars reads as a bad score.",
|
|
309
|
+
"Use the compact form in rows and option labels, the full row on a listing or a review.",
|
|
310
|
+
"Faces are for how something felt (a chat, a delivery); stars for how good something is."
|
|
311
|
+
] })
|
|
312
|
+
}),
|
|
313
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
314
|
+
id: "accessibility",
|
|
315
|
+
title: "Accessibility",
|
|
316
|
+
children: /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
317
|
+
"A rating read is one picture (role img) named in words: \"4.5 out of 5, 128 ratings\".",
|
|
318
|
+
"A rating chosen is a radiogroup: one tab stop, the arrow keys move and choose (flipped right to left), each star named \"3 stars\" and each face \"3 out of 5\". Backspace or Delete clears it.",
|
|
319
|
+
"The preview under the pointer changes only the look; the value changes on a press. A touch has no preview.",
|
|
320
|
+
"Read only stays focusable with aria-readonly; required sets aria-required and keeps the rating from being cleared.",
|
|
321
|
+
"Under forced colours the chosen stars take the system highlight, so the rating does not rest on amber alone."
|
|
322
|
+
] })
|
|
323
|
+
}),
|
|
324
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
325
|
+
id: "props",
|
|
326
|
+
title: "Props",
|
|
327
|
+
children: [/* @__PURE__ */ jsx(PropsTable, {
|
|
328
|
+
title: "Rating",
|
|
329
|
+
rows: [
|
|
330
|
+
{
|
|
331
|
+
name: "value",
|
|
332
|
+
type: "number | null",
|
|
333
|
+
required: true,
|
|
334
|
+
description: "The rating, 0 to max. null shows No ratings."
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
name: "max",
|
|
338
|
+
type: "number",
|
|
339
|
+
default: "5",
|
|
340
|
+
description: "The top of the scale."
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
name: "count",
|
|
344
|
+
type: "number",
|
|
345
|
+
description: "How many ratings: \"(128)\". 0 shows No ratings."
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
name: "showValue",
|
|
349
|
+
type: "boolean",
|
|
350
|
+
default: "true",
|
|
351
|
+
description: "The figure beside the stars."
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
name: "valueFormat",
|
|
355
|
+
type: "'decimal' | 'fraction'",
|
|
356
|
+
default: "'decimal'",
|
|
357
|
+
description: "\"4.5\" or \"4.5/5\"."
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
name: "compact",
|
|
361
|
+
type: "boolean",
|
|
362
|
+
default: "false",
|
|
363
|
+
description: "One star beside the figure, for rows and labels."
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
name: "symbol",
|
|
367
|
+
type: "'star' | 'face'",
|
|
368
|
+
default: "'star'",
|
|
369
|
+
description: "Stars, or one face for the value."
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
name: "size",
|
|
373
|
+
type: "'sm' | 'md' | 'lg'",
|
|
374
|
+
default: "'md'",
|
|
375
|
+
description: "12, 16 or 20px stars."
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
name: "locale",
|
|
379
|
+
type: "string",
|
|
380
|
+
description: "The language the figure is written in. British English by default."
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
name: "labels",
|
|
384
|
+
type: "Partial<RatingLabels>",
|
|
385
|
+
description: "Its sentences in another language: outOf, count, none, star."
|
|
386
|
+
}
|
|
387
|
+
]
|
|
388
|
+
}), /* @__PURE__ */ jsx(PropsTable, {
|
|
389
|
+
title: "RatingInput",
|
|
390
|
+
rows: [
|
|
391
|
+
{
|
|
392
|
+
name: "value / defaultValue",
|
|
393
|
+
type: "number | null",
|
|
394
|
+
description: "The rating, controlled or at first. null for none."
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
name: "onValueChange",
|
|
398
|
+
type: "(value: number | null) => void",
|
|
399
|
+
description: "Called with the new rating, or null when cleared."
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
name: "min / max",
|
|
403
|
+
type: "number",
|
|
404
|
+
default: "1 / 5",
|
|
405
|
+
description: "The scale."
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
name: "clearable",
|
|
409
|
+
type: "boolean",
|
|
410
|
+
default: "true",
|
|
411
|
+
description: "Pressing the chosen star again, or Backspace, clears it. Never while required."
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
name: "required",
|
|
415
|
+
type: "boolean",
|
|
416
|
+
default: "false",
|
|
417
|
+
description: "A rating must be given."
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
name: "readOnly",
|
|
421
|
+
type: "boolean",
|
|
422
|
+
default: "false",
|
|
423
|
+
description: "Shows the rating, changes nothing, stays focusable."
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
name: "disabled",
|
|
427
|
+
type: "boolean",
|
|
428
|
+
default: "false",
|
|
429
|
+
description: "Every star off."
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
name: "invalid",
|
|
433
|
+
type: "boolean",
|
|
434
|
+
description: "Error look and aria-invalid. In a Field, follows its error."
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
name: "readout",
|
|
438
|
+
type: "boolean",
|
|
439
|
+
default: "false",
|
|
440
|
+
description: "\"n/max\" beside the stars."
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
name: "symbol",
|
|
444
|
+
type: "'star' | 'face'",
|
|
445
|
+
default: "'star'",
|
|
446
|
+
description: "Stars, or five faces."
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
name: "size",
|
|
450
|
+
type: "'sm' | 'md' | 'lg'",
|
|
451
|
+
default: "'md'",
|
|
452
|
+
description: "18, 24 or 28px."
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
name: "name",
|
|
456
|
+
type: "string",
|
|
457
|
+
description: "A hidden input carries the rating for a form."
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
name: "labels",
|
|
461
|
+
type: "Partial<RatingLabels>",
|
|
462
|
+
description: "Its sentences in another language."
|
|
463
|
+
}
|
|
464
|
+
]
|
|
465
|
+
})]
|
|
466
|
+
})
|
|
467
|
+
]
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
//#endregion
|
|
471
|
+
export { Page, Preview };
|