@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,567 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as DocLink } from "./host-B6znjEgQ.js";
|
|
3
|
+
import { d as Section$1, i as DocPage, l as Note, n as CodeBlock$1, o as Example, p as SubSection, r as DoDont, s as Guidelines, u as PropsTable } from "./docs-lM2UBSir.js";
|
|
4
|
+
import { useEffect, useRef, useState } from "react";
|
|
5
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Field, ImageField } from "@orbitcommerce/constellation";
|
|
7
|
+
//#region src/pages/components/image-field.tsx
|
|
8
|
+
var svgUrl = (markup) => `data:image/svg+xml,${encodeURIComponent(markup)}`;
|
|
9
|
+
var markUrl = svgUrl("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 200 200\"><rect width=\"200\" height=\"200\" fill=\"#ffffff\"/><circle cx=\"100\" cy=\"100\" r=\"62\" fill=\"none\" stroke=\"#2f6f5e\" stroke-width=\"16\"/><path d=\"M70 130l30-64 30 64z\" fill=\"#2f6f5e\"/></svg>");
|
|
10
|
+
var wordmarkUrl = svgUrl("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 400 120\"><circle cx=\"60\" cy=\"60\" r=\"34\" fill=\"none\" stroke=\"#7a4e2d\" stroke-width=\"10\"/><rect x=\"118\" y=\"40\" width=\"220\" height=\"18\" rx=\"9\" fill=\"#7a4e2d\"/><rect x=\"118\" y=\"70\" width=\"150\" height=\"12\" rx=\"6\" fill=\"#c49a73\"/></svg>");
|
|
11
|
+
var coverUrl = svgUrl("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1600 500\"><rect width=\"1600\" height=\"500\" fill=\"#c8d9d3\"/><circle cx=\"1300\" cy=\"140\" r=\"80\" fill=\"#f0c86e\"/><path d=\"M0 500l400-260 260 170 240-140 700 230z\" fill=\"#6f9584\"/></svg>");
|
|
12
|
+
var previewUrl = svgUrl("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1280 720\"><rect width=\"1280\" height=\"720\" fill=\"#f6f1ea\"/><rect x=\"0\" y=\"0\" width=\"1280\" height=\"80\" fill=\"#2b2b2b\"/><rect x=\"80\" y=\"160\" width=\"520\" height=\"40\" rx=\"8\" fill=\"#2b2b2b\"/><rect x=\"80\" y=\"230\" width=\"420\" height=\"20\" rx=\"6\" fill=\"#8b8178\"/><rect x=\"80\" y=\"300\" width=\"200\" height=\"56\" rx=\"28\" fill=\"#b5512e\"/><rect x=\"700\" y=\"140\" width=\"500\" height=\"480\" rx=\"20\" fill=\"#d9c7b0\"/></svg>");
|
|
13
|
+
var LIBRARY = [
|
|
14
|
+
markUrl,
|
|
15
|
+
wordmarkUrl,
|
|
16
|
+
coverUrl,
|
|
17
|
+
previewUrl
|
|
18
|
+
];
|
|
19
|
+
var wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
20
|
+
/** An ImageField with state: Upload keeps the file after a short wait, Library picks a drawn picture, Remove clears. */
|
|
21
|
+
function Live({ initial = null, library = 0, ...props }) {
|
|
22
|
+
const [value, setValue] = useState(initial);
|
|
23
|
+
const made = useRef([]);
|
|
24
|
+
useEffect(() => () => made.current.forEach((url) => URL.revokeObjectURL(url)), []);
|
|
25
|
+
return /* @__PURE__ */ jsx(ImageField, {
|
|
26
|
+
value,
|
|
27
|
+
onUpload: async (file) => {
|
|
28
|
+
await wait(1200);
|
|
29
|
+
const url = URL.createObjectURL(file);
|
|
30
|
+
made.current.push(url);
|
|
31
|
+
setValue(url);
|
|
32
|
+
},
|
|
33
|
+
onPick: () => setValue(LIBRARY[library % LIBRARY.length]),
|
|
34
|
+
onRemove: () => setValue(null),
|
|
35
|
+
...props
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function Preview() {
|
|
39
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
40
|
+
className: "image-field-preview",
|
|
41
|
+
children: [/* @__PURE__ */ jsx(ImageField, {
|
|
42
|
+
label: "Store logo",
|
|
43
|
+
value: markUrl,
|
|
44
|
+
onPick: () => {},
|
|
45
|
+
onRemove: () => {},
|
|
46
|
+
size: 72,
|
|
47
|
+
hint: null
|
|
48
|
+
}), /* @__PURE__ */ jsx(ImageField, {
|
|
49
|
+
label: "Favicon",
|
|
50
|
+
variant: "favicon",
|
|
51
|
+
onUpload: () => {},
|
|
52
|
+
hint: null
|
|
53
|
+
})]
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function Page() {
|
|
57
|
+
return /* @__PURE__ */ jsxs(DocPage, {
|
|
58
|
+
title: "Image field",
|
|
59
|
+
status: "new",
|
|
60
|
+
importNames: ["ImageField"],
|
|
61
|
+
lead: "One picture a form holds, a logo, a favicon, a cover, a feature image, in a slot of a fixed shape, with the buttons that change it beside it. It uploads a file chosen or dropped on the slot, or hands over to your library picker, and can crop a picture first.",
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
64
|
+
id: "basics",
|
|
65
|
+
title: "Basics",
|
|
66
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
67
|
+
"Name the picture with ",
|
|
68
|
+
/* @__PURE__ */ jsx("code", { children: "label" }),
|
|
69
|
+
", give ",
|
|
70
|
+
/* @__PURE__ */ jsx("code", { children: "value" }),
|
|
71
|
+
" (its address), and the actions you have:",
|
|
72
|
+
" ",
|
|
73
|
+
/* @__PURE__ */ jsx("code", { children: "onUpload" }),
|
|
74
|
+
" takes a file chosen or dropped on the slot, ",
|
|
75
|
+
/* @__PURE__ */ jsx("code", { children: "onPick" }),
|
|
76
|
+
" opens your library picker, ",
|
|
77
|
+
/* @__PURE__ */ jsx("code", { children: "onRemove" }),
|
|
78
|
+
" clears it. Empty, the slot is dashed and the guidance under it says what it takes (from ",
|
|
79
|
+
/* @__PURE__ */ jsx("code", { children: "accept" }),
|
|
80
|
+
" and ",
|
|
81
|
+
/* @__PURE__ */ jsx("code", { children: "maxSize" }),
|
|
82
|
+
", 5 MB by default); filled, it shows the picture and the buttons say Replace, Library and Remove. A promise returned from an action keeps its button busy, and the slot shows a spinner while an upload runs. For a person's own photo, use",
|
|
83
|
+
" ",
|
|
84
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
85
|
+
to: "/components/avatar-upload",
|
|
86
|
+
children: "AvatarUpload"
|
|
87
|
+
}),
|
|
88
|
+
" instead."
|
|
89
|
+
] }),
|
|
90
|
+
children: [/* @__PURE__ */ jsx(Example, {
|
|
91
|
+
align: "start",
|
|
92
|
+
code: `
|
|
93
|
+
<ImageField
|
|
94
|
+
label="Store logo"
|
|
95
|
+
value={logo}
|
|
96
|
+
onUpload={async (file) => setLogo(await upload(file))}
|
|
97
|
+
onPick={() => setPickerOpen(true)}
|
|
98
|
+
onRemove={() => setLogo(null)}
|
|
99
|
+
/>`,
|
|
100
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
101
|
+
className: "image-field-stack",
|
|
102
|
+
children: [/* @__PURE__ */ jsx(Live, { label: "Store logo" }), /* @__PURE__ */ jsx(Live, {
|
|
103
|
+
label: "Store logo",
|
|
104
|
+
initial: markUrl
|
|
105
|
+
})]
|
|
106
|
+
})
|
|
107
|
+
}), /* @__PURE__ */ jsx(Fragment$1, {})]
|
|
108
|
+
}),
|
|
109
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
110
|
+
id: "shapes",
|
|
111
|
+
title: "Shapes",
|
|
112
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
113
|
+
/* @__PURE__ */ jsx("code", { children: "variant" }),
|
|
114
|
+
" picks the slot. ",
|
|
115
|
+
/* @__PURE__ */ jsx("code", { children: "square" }),
|
|
116
|
+
" (96px) and ",
|
|
117
|
+
/* @__PURE__ */ jsx("code", { children: "round" }),
|
|
118
|
+
" take a",
|
|
119
|
+
" ",
|
|
120
|
+
/* @__PURE__ */ jsx("code", { children: "size" }),
|
|
121
|
+
" from 32 to 128; ",
|
|
122
|
+
/* @__PURE__ */ jsx("code", { children: "logo" }),
|
|
123
|
+
" is a wide box that holds a logo whole, 200px wide;",
|
|
124
|
+
" ",
|
|
125
|
+
/* @__PURE__ */ jsx("code", { children: "favicon" }),
|
|
126
|
+
" is 40px and takes .ico files; ",
|
|
127
|
+
/* @__PURE__ */ jsx("code", { children: "wide" }),
|
|
128
|
+
" (a 16:9 preview) and ",
|
|
129
|
+
/* @__PURE__ */ jsx("code", { children: "cover" }),
|
|
130
|
+
" (a 16:5 banner) take the room they are given and lay their words and buttons under them. A photo fills a round, wide or cover slot; a logo or a product is contained (",
|
|
131
|
+
/* @__PURE__ */ jsx("code", { children: "fit" }),
|
|
132
|
+
")."
|
|
133
|
+
] }),
|
|
134
|
+
children: [
|
|
135
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
136
|
+
title: "Small shapes",
|
|
137
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
138
|
+
align: "start",
|
|
139
|
+
code: `
|
|
140
|
+
<ImageField label="Feature image" size={64} value={markUrl} onPick={pick} onRemove={remove} hint={null} />
|
|
141
|
+
<ImageField label="Profile photo" variant="round" value={markUrl} onPick={pick} onRemove={remove} hint={null} />
|
|
142
|
+
<ImageField label="Email logo" variant="logo" value={wordmarkUrl} onUpload={upload} onRemove={remove} />
|
|
143
|
+
<ImageField label="Favicon" variant="favicon" onUpload={upload} />`,
|
|
144
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
145
|
+
className: "image-field-stack",
|
|
146
|
+
children: [
|
|
147
|
+
/* @__PURE__ */ jsx(Live, {
|
|
148
|
+
label: "Feature image",
|
|
149
|
+
size: 64,
|
|
150
|
+
initial: markUrl,
|
|
151
|
+
hint: null
|
|
152
|
+
}),
|
|
153
|
+
/* @__PURE__ */ jsx(Live, {
|
|
154
|
+
label: "Profile photo",
|
|
155
|
+
variant: "round",
|
|
156
|
+
initial: markUrl,
|
|
157
|
+
hint: null
|
|
158
|
+
}),
|
|
159
|
+
/* @__PURE__ */ jsx(Live, {
|
|
160
|
+
label: "Email logo",
|
|
161
|
+
variant: "logo",
|
|
162
|
+
initial: wordmarkUrl,
|
|
163
|
+
onPick: void 0
|
|
164
|
+
}),
|
|
165
|
+
/* @__PURE__ */ jsx(Live, {
|
|
166
|
+
label: "Favicon",
|
|
167
|
+
variant: "favicon",
|
|
168
|
+
onPick: void 0
|
|
169
|
+
})
|
|
170
|
+
]
|
|
171
|
+
})
|
|
172
|
+
})
|
|
173
|
+
}),
|
|
174
|
+
/* @__PURE__ */ jsx(SubSection, {
|
|
175
|
+
title: "Wide shapes",
|
|
176
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
177
|
+
align: "fill",
|
|
178
|
+
code: `
|
|
179
|
+
<ImageField label="Social share image" variant="wide" size={480} value={preview} onUpload={upload} onPick={pick} onRemove={remove} />
|
|
180
|
+
<ImageField label="Cover image" variant="cover" name="Northgate Supply" onPick={pick}
|
|
181
|
+
hint="A landscape picture, 1600 by 400 pixels. Keep anything important in the middle." />`,
|
|
182
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
183
|
+
className: "image-field-stack image-field-stack--wide",
|
|
184
|
+
children: [/* @__PURE__ */ jsx(Live, {
|
|
185
|
+
label: "Social share image",
|
|
186
|
+
variant: "wide",
|
|
187
|
+
size: 480,
|
|
188
|
+
initial: previewUrl,
|
|
189
|
+
library: 3
|
|
190
|
+
}), /* @__PURE__ */ jsx(Live, {
|
|
191
|
+
label: "Cover image",
|
|
192
|
+
variant: "cover",
|
|
193
|
+
name: "Northgate Supply",
|
|
194
|
+
library: 2,
|
|
195
|
+
onUpload: void 0,
|
|
196
|
+
hint: "A landscape picture, 1600 by 400 pixels. Keep anything important in the middle."
|
|
197
|
+
})]
|
|
198
|
+
})
|
|
199
|
+
})
|
|
200
|
+
}),
|
|
201
|
+
/* @__PURE__ */ jsxs(Note, {
|
|
202
|
+
title: "A tint from a name",
|
|
203
|
+
children: [
|
|
204
|
+
"Give ",
|
|
205
|
+
/* @__PURE__ */ jsx("code", { children: "name" }),
|
|
206
|
+
" and an empty slot takes a quiet tint from it, so a supplier's empty cover already reads as theirs before a picture is chosen."
|
|
207
|
+
]
|
|
208
|
+
})
|
|
209
|
+
]
|
|
210
|
+
}),
|
|
211
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
212
|
+
id: "crop",
|
|
213
|
+
title: "Cropping before an upload",
|
|
214
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
215
|
+
/* @__PURE__ */ jsx("code", { children: "crop" }),
|
|
216
|
+
" opens the kit's ImageCropper on a chosen picture before it is sent, in the slot's shape (a favicon square, a cover 16:5) or the one you give, and Apply hands ",
|
|
217
|
+
/* @__PURE__ */ jsx("code", { children: "onUpload" }),
|
|
218
|
+
" the cropped file, at the ",
|
|
219
|
+
/* @__PURE__ */ jsx("code", { children: "size" }),
|
|
220
|
+
" you ask for. A vector, an icon file or a moving GIF is sent as it is, since a canvas would spoil it."
|
|
221
|
+
] }),
|
|
222
|
+
children: [/* @__PURE__ */ jsx(Example, {
|
|
223
|
+
align: "start",
|
|
224
|
+
code: `
|
|
225
|
+
<ImageField label="Favicon" variant="favicon" crop={{ shape: 'round', size: 180 }} onUpload={upload} onRemove={remove} />`,
|
|
226
|
+
children: /* @__PURE__ */ jsx(Live, {
|
|
227
|
+
label: "Favicon",
|
|
228
|
+
variant: "favicon",
|
|
229
|
+
crop: {
|
|
230
|
+
shape: "round",
|
|
231
|
+
size: 180
|
|
232
|
+
},
|
|
233
|
+
onPick: void 0
|
|
234
|
+
})
|
|
235
|
+
}), /* @__PURE__ */ jsx(SubSection, {
|
|
236
|
+
title: "Cropping a library pick",
|
|
237
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
238
|
+
"A picture picked from your library is cropped the same way: fetch its file (a blob, so a canvas may read it) and hand it over as ",
|
|
239
|
+
/* @__PURE__ */ jsx("code", { children: "cropRequest" }),
|
|
240
|
+
". The crop step opens on it, Apply sends the cropped file to ",
|
|
241
|
+
/* @__PURE__ */ jsx("code", { children: "onUpload" }),
|
|
242
|
+
", and ",
|
|
243
|
+
/* @__PURE__ */ jsx("code", { children: "onCropEnd" }),
|
|
244
|
+
" says when the step has closed, applied or not, so you can clear the request."
|
|
245
|
+
] }),
|
|
246
|
+
children: /* @__PURE__ */ jsx(CodeBlock$1, {
|
|
247
|
+
lang: "tsx",
|
|
248
|
+
code: `const [request, setRequest] = useState<ImageFieldCropRequest | null>(null)
|
|
249
|
+
|
|
250
|
+
<ImageField
|
|
251
|
+
label="Favicon"
|
|
252
|
+
variant="favicon"
|
|
253
|
+
value={favicon}
|
|
254
|
+
crop={{ shape: 'round', size: 180 }}
|
|
255
|
+
onPick={() => setPickerOpen(true)}
|
|
256
|
+
onUpload={async (file) => setFavicon(await upload(file))}
|
|
257
|
+
cropRequest={request}
|
|
258
|
+
onCropEnd={() => setRequest(null)}
|
|
259
|
+
/>
|
|
260
|
+
// When the picker hands back a picture:
|
|
261
|
+
setRequest({ source: await fetchFile(picked), name: picked.name })`
|
|
262
|
+
})
|
|
263
|
+
})]
|
|
264
|
+
}),
|
|
265
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
266
|
+
id: "default",
|
|
267
|
+
title: "A default of its own",
|
|
268
|
+
description: /* @__PURE__ */ jsxs("p", { children: [/* @__PURE__ */ jsx("code", { children: "inherited" }), " is the picture used while the field has none of its own: an email's logo is the store's unless it is given another. The field shows it and says so, offers a different one, and once it has its own, offers the default back in Remove's place. With neither, it says there is none."] }),
|
|
269
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
270
|
+
align: "start",
|
|
271
|
+
code: `
|
|
272
|
+
<ImageField
|
|
273
|
+
label="Email logo"
|
|
274
|
+
variant="logo"
|
|
275
|
+
value={emailLogo}
|
|
276
|
+
inherited={storeLogo}
|
|
277
|
+
onPick={pick}
|
|
278
|
+
onRemove={() => setEmailLogo(null)}
|
|
279
|
+
labels={{ usingDefault: 'Using your store logo', useDefault: 'Use store logo', useDifferent: 'Use a different logo' }}
|
|
280
|
+
/>`,
|
|
281
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
282
|
+
className: "image-field-stack",
|
|
283
|
+
children: [/* @__PURE__ */ jsx(Live, {
|
|
284
|
+
label: "Email logo",
|
|
285
|
+
variant: "logo",
|
|
286
|
+
inherited: markUrl,
|
|
287
|
+
library: 1,
|
|
288
|
+
onUpload: void 0,
|
|
289
|
+
hint: null,
|
|
290
|
+
labels: {
|
|
291
|
+
usingDefault: "Using your store logo",
|
|
292
|
+
usingDefaultNote: "Emails show the logo from your store settings.",
|
|
293
|
+
custom: "Custom email logo",
|
|
294
|
+
customNote: "Emails show this logo in place of your store logo.",
|
|
295
|
+
useDefault: "Use store logo",
|
|
296
|
+
useDifferent: "Use a different logo"
|
|
297
|
+
}
|
|
298
|
+
}), /* @__PURE__ */ jsx(Live, {
|
|
299
|
+
label: "Email logo",
|
|
300
|
+
variant: "logo",
|
|
301
|
+
inherited: null,
|
|
302
|
+
onUpload: void 0,
|
|
303
|
+
hint: null,
|
|
304
|
+
labels: {
|
|
305
|
+
none: "No logo",
|
|
306
|
+
noneNote: "Add a logo in your store settings, or choose one for emails."
|
|
307
|
+
}
|
|
308
|
+
})]
|
|
309
|
+
})
|
|
310
|
+
})
|
|
311
|
+
}),
|
|
312
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
313
|
+
id: "states",
|
|
314
|
+
title: "States",
|
|
315
|
+
description: /* @__PURE__ */ jsxs("p", { children: [
|
|
316
|
+
"A variable's ",
|
|
317
|
+
/* @__PURE__ */ jsx("code", { children: "{{token}}" }),
|
|
318
|
+
" shows in mono in place of a picture, as an email template's image does.",
|
|
319
|
+
" ",
|
|
320
|
+
/* @__PURE__ */ jsx("code", { children: "onGenerate" }),
|
|
321
|
+
" adds Auto generate (a theme's preview from its pages). ",
|
|
322
|
+
/* @__PURE__ */ jsx("code", { children: "busy" }),
|
|
323
|
+
" says which action runs when you track it yourself; ",
|
|
324
|
+
/* @__PURE__ */ jsx("code", { children: "disabled" }),
|
|
325
|
+
" turns every action off. Inside a",
|
|
326
|
+
" ",
|
|
327
|
+
/* @__PURE__ */ jsx(DocLink, {
|
|
328
|
+
to: "/components/input#field",
|
|
329
|
+
children: "Field"
|
|
330
|
+
}),
|
|
331
|
+
", the Field's label names it and its hint and error sit under it."
|
|
332
|
+
] }),
|
|
333
|
+
children: /* @__PURE__ */ jsx(Example, {
|
|
334
|
+
align: "start",
|
|
335
|
+
code: `
|
|
336
|
+
<ImageField label="Header image" value="{{store.logo}}" onPick={pick} onRemove={remove} hint={null} />
|
|
337
|
+
<ImageField label="Theme preview" variant="wide" size={320} value={preview} onPick={pick} onGenerate={generate} busy="generate" />
|
|
338
|
+
<ImageField label="Store logo" value={markUrl} onPick={pick} onRemove={remove} disabled />
|
|
339
|
+
<Field label="Store logo" error="Add a logo before you publish your store.">
|
|
340
|
+
<ImageField label="Store logo" onUpload={upload} onPick={pick} />
|
|
341
|
+
</Field>`,
|
|
342
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
343
|
+
className: "image-field-stack",
|
|
344
|
+
children: [
|
|
345
|
+
/* @__PURE__ */ jsx(ImageField, {
|
|
346
|
+
label: "Header image",
|
|
347
|
+
value: "{{store.logo}}",
|
|
348
|
+
onPick: () => {},
|
|
349
|
+
onRemove: () => {},
|
|
350
|
+
hint: null
|
|
351
|
+
}),
|
|
352
|
+
/* @__PURE__ */ jsx(ImageField, {
|
|
353
|
+
label: "Theme preview",
|
|
354
|
+
variant: "wide",
|
|
355
|
+
size: 320,
|
|
356
|
+
value: previewUrl,
|
|
357
|
+
onPick: () => {},
|
|
358
|
+
onGenerate: () => {},
|
|
359
|
+
busy: "generate",
|
|
360
|
+
hint: null
|
|
361
|
+
}),
|
|
362
|
+
/* @__PURE__ */ jsx(ImageField, {
|
|
363
|
+
label: "Store logo",
|
|
364
|
+
value: markUrl,
|
|
365
|
+
onPick: () => {},
|
|
366
|
+
onRemove: () => {},
|
|
367
|
+
disabled: true,
|
|
368
|
+
hint: null
|
|
369
|
+
}),
|
|
370
|
+
/* @__PURE__ */ jsx(Field, {
|
|
371
|
+
label: "Store logo",
|
|
372
|
+
error: "Add a logo before you publish your store.",
|
|
373
|
+
children: /* @__PURE__ */ jsx(ImageField, {
|
|
374
|
+
label: "Store logo",
|
|
375
|
+
onUpload: () => {},
|
|
376
|
+
onPick: () => {}
|
|
377
|
+
})
|
|
378
|
+
})
|
|
379
|
+
]
|
|
380
|
+
})
|
|
381
|
+
})
|
|
382
|
+
}),
|
|
383
|
+
/* @__PURE__ */ jsxs(Section$1, {
|
|
384
|
+
id: "guidelines",
|
|
385
|
+
title: "Guidelines",
|
|
386
|
+
children: [/* @__PURE__ */ jsx(DoDont, {
|
|
387
|
+
do: {
|
|
388
|
+
children: /* @__PURE__ */ jsx(ImageField, {
|
|
389
|
+
label: "Store logo",
|
|
390
|
+
value: markUrl,
|
|
391
|
+
onPick: () => {},
|
|
392
|
+
onRemove: () => {},
|
|
393
|
+
hint: "Square, at least 400 by 400 pixels.",
|
|
394
|
+
size: 64
|
|
395
|
+
}),
|
|
396
|
+
caption: "Say what makes a good picture for this place: its shape and its size, in the hint."
|
|
397
|
+
},
|
|
398
|
+
dont: {
|
|
399
|
+
children: /* @__PURE__ */ jsx(ImageField, {
|
|
400
|
+
label: "Store logo",
|
|
401
|
+
variant: "cover",
|
|
402
|
+
value: markUrl,
|
|
403
|
+
onPick: () => {},
|
|
404
|
+
hint: null
|
|
405
|
+
}),
|
|
406
|
+
caption: "A square logo in a cover slot is cropped to a strip. Pick the shape the picture is shown in."
|
|
407
|
+
}
|
|
408
|
+
}), /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
409
|
+
"Match the slot to where the picture is shown: round for a photo shown round, cover for a banner, logo for a wordmark.",
|
|
410
|
+
"Give both Upload and Library where the store has a media library: a new file and a reused one are both common.",
|
|
411
|
+
"Crop where the picture is shown at a fixed shape and size (a favicon), and leave it whole where it is not."
|
|
412
|
+
] })]
|
|
413
|
+
}),
|
|
414
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
415
|
+
id: "accessibility",
|
|
416
|
+
title: "Accessibility",
|
|
417
|
+
children: /* @__PURE__ */ jsx(Guidelines, { items: [
|
|
418
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
419
|
+
"The field is a group named by ",
|
|
420
|
+
/* @__PURE__ */ jsx("code", { children: "label" }),
|
|
421
|
+
", or by the Field around it, and described by its guidance and its error."
|
|
422
|
+
] }),
|
|
423
|
+
"Every action is a button in the tab order beside the slot. The slot is a pointer shortcut for the first of them and a place to drop a file; it takes no focus of its own.",
|
|
424
|
+
"A busy button stays focusable (aria-disabled), and \"Uploading…\" or \"Generating…\" is said in a polite status as the work starts.",
|
|
425
|
+
"When the focused button goes (Remove, once the picture is gone), focus moves to the first button rather than the page.",
|
|
426
|
+
"A refused file is said under the guidance, as an alert, unless you take it with onReject.",
|
|
427
|
+
"The picture is named by the label. A variable’s token is read as it is written."
|
|
428
|
+
] })
|
|
429
|
+
}),
|
|
430
|
+
/* @__PURE__ */ jsx(Section$1, {
|
|
431
|
+
id: "props",
|
|
432
|
+
title: "Props",
|
|
433
|
+
children: /* @__PURE__ */ jsx(PropsTable, {
|
|
434
|
+
title: "ImageField",
|
|
435
|
+
rows: [
|
|
436
|
+
{
|
|
437
|
+
name: "label",
|
|
438
|
+
type: "string",
|
|
439
|
+
required: true,
|
|
440
|
+
description: "What the picture is: names the group and the picture."
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
name: "value",
|
|
444
|
+
type: "string | null",
|
|
445
|
+
description: "The picture's address, or a {{token}}."
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
name: "variant",
|
|
449
|
+
type: "'square' | 'round' | 'wide' | 'cover' | 'logo' | 'favicon'",
|
|
450
|
+
default: "'square'",
|
|
451
|
+
description: "The slot’s shape."
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
name: "size",
|
|
455
|
+
type: "number",
|
|
456
|
+
description: "A square or round side (32 to 128), a logo’s width, a wide or cover slot’s widest."
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
name: "fit",
|
|
460
|
+
type: "'contain' | 'cover'",
|
|
461
|
+
description: "Defaults by the shape: photos fill, logos are contained."
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
name: "kind",
|
|
465
|
+
type: "'image' | 'video'",
|
|
466
|
+
default: "'image'",
|
|
467
|
+
description: "A video is drawn as a muted loop."
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
name: "name",
|
|
471
|
+
type: "string",
|
|
472
|
+
description: "An empty slot takes a tint from it."
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
name: "hint",
|
|
476
|
+
type: "ReactNode",
|
|
477
|
+
description: "The guidance. Defaults to the formats and the size limit; null for none."
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
name: "error",
|
|
481
|
+
type: "ReactNode",
|
|
482
|
+
description: "What is wrong. Inside a Field, give it to the Field."
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
name: "accept",
|
|
486
|
+
type: "string",
|
|
487
|
+
description: "What may be uploaded. Defaults by the shape."
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
name: "maxSize",
|
|
491
|
+
type: "number",
|
|
492
|
+
default: "5 MB",
|
|
493
|
+
description: "The largest file, in bytes (1 GB for a video)."
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
name: "onUpload",
|
|
497
|
+
type: "(file: File) => Promise | void",
|
|
498
|
+
description: "Takes a file chosen or dropped on the slot."
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
name: "onPick",
|
|
502
|
+
type: "() => void",
|
|
503
|
+
description: "Opens your library picker."
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
name: "onRemove",
|
|
507
|
+
type: "() => Promise | void",
|
|
508
|
+
description: "Clears the picture."
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
name: "onGenerate",
|
|
512
|
+
type: "() => Promise | void",
|
|
513
|
+
description: "Makes a picture: adds Auto generate."
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
name: "busy",
|
|
517
|
+
type: "'upload' | 'pick' | 'remove' | 'generate' | null",
|
|
518
|
+
description: "The action running, when you track it."
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
name: "disabled",
|
|
522
|
+
type: "boolean",
|
|
523
|
+
description: "Turns every action off."
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
name: "crop",
|
|
527
|
+
type: "boolean | { aspect?, shape?, size? }",
|
|
528
|
+
description: "Crops a picture before it is uploaded."
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
name: "cropRequest",
|
|
532
|
+
type: "{ source: Blob | string; name: string } | null",
|
|
533
|
+
description: "A picture from elsewhere (a library pick) to crop now, then upload."
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
name: "onCropEnd",
|
|
537
|
+
type: "() => void",
|
|
538
|
+
description: "Called when the crop step for a cropRequest closes."
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
name: "inherited",
|
|
542
|
+
type: "string | null",
|
|
543
|
+
description: "The default picture used while it has none of its own."
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
name: "layout",
|
|
547
|
+
type: "'row' | 'stack'",
|
|
548
|
+
description: "Words beside the slot, or under it. Defaults by the shape."
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
name: "onReject",
|
|
552
|
+
type: "(rejections) => void",
|
|
553
|
+
description: "Files refused by accept or maxSize. Without it, the field says why."
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
name: "labels",
|
|
557
|
+
type: "Partial<ImageFieldLabels>",
|
|
558
|
+
description: "Every word, and the refusals (imageFieldLabels)."
|
|
559
|
+
}
|
|
560
|
+
]
|
|
561
|
+
})
|
|
562
|
+
})
|
|
563
|
+
]
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
//#endregion
|
|
567
|
+
export { Page, Preview };
|