@crewlethq/ui 0.50.0 → 0.52.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/README.md +34 -0
- package/dist/AgentHandoffPanel/index.js +3 -3
- package/dist/ArrangeList/index.js +3 -3
- package/dist/ArtifactCard/index.js +3 -3
- package/dist/{ArtifactCard-SOB63NV5.css → ArtifactCard-F7IVRL3A.css} +3 -0
- package/dist/AvatarPicker/index.js +2 -2
- package/dist/BrandSample/index.js +3 -3
- package/dist/BrandScope/index.js +2 -2
- package/dist/Callout/index.js +1 -1
- package/dist/{Callout-ZAVG3P66.css → Callout-G3N3IE6M.css} +9 -0
- package/dist/Checkbox/index.js +2 -2
- package/dist/ChoiceButtons/ChoiceButtons.d.ts +21 -1
- package/dist/ChoiceButtons/index.d.ts +1 -1
- package/dist/ChoiceButtons/index.js +1 -1
- package/dist/{ChoiceButtons-FLIFXFFS.css → ChoiceButtons-HWXEF2H3.css} +60 -0
- package/dist/ColorChip/ColorChip.d.ts +26 -0
- package/dist/ColorChip/index.d.ts +3 -0
- package/dist/ColorChip/index.js +3 -0
- package/dist/ColorChip-A5XHTH3J.css +46 -0
- package/dist/ColorField/ColorField.d.ts +16 -8
- package/dist/ColorField/index.js +3 -3
- package/dist/ColorSwatch/index.js +2 -2
- package/dist/Combobox/index.js +2 -2
- package/dist/CommandPalette/index.js +2 -2
- package/dist/CommentThread/index.js +3 -3
- package/dist/Composer/index.js +2 -2
- package/dist/ConfirmField/index.js +2 -2
- package/dist/ContrastBadge/ContrastBadge.d.ts +13 -0
- package/dist/ContrastBadge/index.d.ts +2 -2
- package/dist/ContrastBadge/index.js +2 -2
- package/dist/ContrastHelp/ContrastHelp.d.ts +40 -0
- package/dist/ContrastHelp/index.d.ts +3 -0
- package/dist/ContrastHelp/index.js +12 -0
- package/dist/ContrastHelp-MZCAW5WQ.css +43 -0
- package/dist/DataGrid/index.js +3 -3
- package/dist/DataTable/index.js +3 -3
- package/dist/DataView/index.js +4 -4
- package/dist/DocTabsEditor/index.js +2 -2
- package/dist/EditingStatus/EditingStatus.d.ts +3 -5
- package/dist/EditingStatus/index.js +1 -1
- package/dist/{EditingStatus-NNA2CKIL.css → EditingStatus-YU7EGM6Y.css} +22 -7
- package/dist/{Editor-MLGK3KOG.js → Editor-SZFWVDAU.js} +2 -2
- package/dist/FolderTile/index.js +1 -1
- package/dist/{FolderTile-FDT5Y63Z.css → FolderTile-MIUEB7SO.css} +12 -5
- package/dist/FollowBanner/index.js +2 -2
- package/dist/InlineEditor/index.js +2 -2
- package/dist/Input/FormField.d.ts +7 -1
- package/dist/Input/index.js +1 -1
- package/dist/{Input-VDSV7VWJ.css → Input-GMOWHZRG.css} +9 -0
- package/dist/LinkInterstitial/index.js +2 -2
- package/dist/ListInput/ListInput.d.ts +5 -1
- package/dist/ListInput/index.js +2 -2
- package/dist/{ListInput-WUP2YITQ.css → ListInput-RLQND5QK.css} +30 -6
- package/dist/LogoSlot/LogoSlot.d.ts +9 -1
- package/dist/LogoSlot/LogoSlotGroup.d.ts +38 -0
- package/dist/LogoSlot/index.d.ts +3 -1
- package/dist/LogoSlot/index.js +3 -3
- package/dist/{LogoSlot-T2UFOJXU.css → LogoSlot-ETD74ELF.css} +98 -0
- package/dist/PrincipalPicker/index.js +3 -3
- package/dist/RichEditor/index.js +2 -2
- package/dist/SandboxedFrame/index.js +2 -2
- package/dist/SetupWizard/SetupWizard.d.ts +13 -3
- package/dist/SetupWizard/index.js +1 -1
- package/dist/{SetupWizard-Y5BTXZX5.css → SetupWizard-GZK5UDKC.css} +27 -1
- package/dist/ShareDialog/index.js +2 -2
- package/dist/SheetColumnEditor/index.js +3 -3
- package/dist/Switcher/index.js +2 -2
- package/dist/TimeWindowPicker/index.js +2 -2
- package/dist/{chunk-ZCIL5IHU.js → chunk-2GIWL7IS.js} +1 -1
- package/dist/{chunk-4A4QG6UC.js → chunk-34C7NYIQ.js} +1 -1
- package/dist/{chunk-V7GOOXPK.js → chunk-3NXWH5NC.js} +1 -1
- package/dist/{chunk-WQ7S7CKZ.js → chunk-5O72FSOK.js} +1 -1
- package/dist/{chunk-W6FOEBIL.js → chunk-5WYPSVRX.js} +24 -15
- package/dist/chunk-6GTTRJWJ.js +24 -0
- package/dist/{chunk-QGRA2RHC.js → chunk-6RMZH7P7.js} +1 -1
- package/dist/{chunk-R6R2UHVG.js → chunk-6VQA2LZC.js} +1 -1
- package/dist/{chunk-FB5CFQTG.js → chunk-7PE56HHD.js} +1 -1
- package/dist/chunk-7W3LYIOC.js +27 -0
- package/dist/{chunk-OEEYL2CM.js → chunk-AVMQMY66.js} +2 -2
- package/dist/{chunk-SZZRIHGT.js → chunk-BPCY7ZID.js} +1 -1
- package/dist/{chunk-P5JBDHWC.js → chunk-C6Z3MLSA.js} +1 -1
- package/dist/{chunk-PGR2PKH6.js → chunk-CQEYF3UW.js} +14 -12
- package/dist/{chunk-Q44X36QC.js → chunk-CUL5XV6O.js} +2 -2
- package/dist/chunk-DTSZUH6H.js +124 -0
- package/dist/chunk-EJWPYEG4.js +38 -0
- package/dist/{chunk-H7NMJ5AI.js → chunk-EZ43L6T7.js} +1 -1
- package/dist/{chunk-627KFRON.js → chunk-FNPZ3LLQ.js} +1 -1
- package/dist/{chunk-M4QM477B.js → chunk-FXHWOXGD.js} +1 -1
- package/dist/{chunk-KHZYAEGZ.js → chunk-G5SUSCWL.js} +1 -1
- package/dist/{chunk-VBIM6HFC.js → chunk-GPZXBJFU.js} +1 -1
- package/dist/{chunk-NAWUXCBC.js → chunk-GRKGLZFM.js} +2 -2
- package/dist/{chunk-VTSJMDGP.js → chunk-J53T2QAH.js} +2 -2
- package/dist/{chunk-JWNYI7UD.js → chunk-KFR75JOK.js} +2 -2
- package/dist/chunk-KIRQZG3G.js +53 -0
- package/dist/{chunk-EXRRTKWT.js → chunk-LJHH4WWB.js} +8 -4
- package/dist/{chunk-MIEBOO7Y.js → chunk-NMR7AJSB.js} +1 -1
- package/dist/{chunk-JFDIMO3A.js → chunk-PGYIDNGG.js} +1 -1
- package/dist/{chunk-WLSEAIVC.js → chunk-RHPBTE3F.js} +1 -1
- package/dist/{chunk-NCHKKYPQ.js → chunk-RQI43UJ7.js} +1 -1
- package/dist/{chunk-H55D66IK.js → chunk-SSHDQBHR.js} +1 -1
- package/dist/{chunk-GP4YWZFO.js → chunk-U3LNU4B2.js} +1 -1
- package/dist/{chunk-GHY63X4C.js → chunk-UJ4VVK7R.js} +1 -1
- package/dist/{chunk-BEAXJARF.js → chunk-UKE7LTFZ.js} +29 -12
- package/dist/{chunk-356JNSER.js → chunk-WQQ5T5SA.js} +1 -1
- package/dist/{chunk-NSSOWQCJ.js → chunk-WW7TU6HE.js} +15 -12
- package/dist/chunk-WXRH7NZW.js +80 -0
- package/dist/{chunk-P3OIM6OC.js → chunk-X7WEE3EK.js} +1 -1
- package/dist/generated/index.d.ts +2 -0
- package/dist/generated/index.js +82 -80
- package/dist/index.js +82 -80
- package/dist/styles.css +374 -28
- package/dist/utils/hexColour.d.ts +13 -0
- package/package.json +3 -3
- package/dist/chunk-BWOIUOO3.js +0 -62
- package/dist/chunk-KKHCUHWS.js +0 -107
- package/dist/chunk-MMOXWAUG.js +0 -42
- package/dist/chunk-UZMNR366.js +0 -9
- package/dist/{chunk-3QSKDZR5.js → chunk-EW2N4FOD.js} +1 -1
- /package/dist/{chunk-HNQ2EIMR.js → chunk-P432I5DQ.js} +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { toISO, useNow, formatRelative } from './chunk-3CZ7XAVY.js';
|
|
2
|
+
import { cx } from './chunk-ODEQTPFM.js';
|
|
3
|
+
import './EditingStatus-YU7EGM6Y.css';
|
|
4
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var LABELS = {
|
|
7
|
+
editing: "Editing",
|
|
8
|
+
unsaved: "Unsaved changes",
|
|
9
|
+
saving: "Saving",
|
|
10
|
+
saved: "Saved"
|
|
11
|
+
};
|
|
12
|
+
function EditingStatus({ dirty, saving = false, savedAt, labels, className }) {
|
|
13
|
+
const text = { ...LABELS, ...labels };
|
|
14
|
+
const showSaved = !saving && !dirty && savedAt !== void 0 && savedAt !== null && toISO(savedAt) !== null;
|
|
15
|
+
const state = saving ? text.saving : dirty ? text.unsaved : showSaved ? text.saved : null;
|
|
16
|
+
return /* @__PURE__ */ jsxs("span", { className: cx("crewlet-editing-status", dirty && "crewlet-editing-status--dirty", className), children: [
|
|
17
|
+
/* @__PURE__ */ jsx("span", { className: "crewlet-editing-status__dot", "aria-hidden": "true" }),
|
|
18
|
+
/* @__PURE__ */ jsxs("span", { className: "crewlet-editing-status__text", children: [
|
|
19
|
+
/* @__PURE__ */ jsxs("span", { role: "status", "aria-live": "polite", className: "crewlet-editing-status__live", children: [
|
|
20
|
+
/* @__PURE__ */ jsx("span", { className: "crewlet-editing-status__label", children: text.editing }),
|
|
21
|
+
state ? " " : null,
|
|
22
|
+
state ? /* @__PURE__ */ jsx("span", { className: "crewlet-editing-status__state", children: state }) : null
|
|
23
|
+
] }),
|
|
24
|
+
showSaved ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
25
|
+
" ",
|
|
26
|
+
/* @__PURE__ */ jsx(SavedAgo, { at: savedAt })
|
|
27
|
+
] }) : null
|
|
28
|
+
] })
|
|
29
|
+
] });
|
|
30
|
+
}
|
|
31
|
+
function SavedAgo({ at }) {
|
|
32
|
+
const now = useNow();
|
|
33
|
+
const ago = formatRelative(at, now);
|
|
34
|
+
if (ago === null) return null;
|
|
35
|
+
return /* @__PURE__ */ jsx("time", { className: "crewlet-editing-status__ago", dateTime: toISO(at) ?? void 0, children: ago });
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { EditingStatus };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PrincipalAvatar } from './chunk-CI3VPIJN.js';
|
|
2
2
|
import { toInstant, RelativeTime, formatExact, toISO } from './chunk-3CZ7XAVY.js';
|
|
3
3
|
import { Document } from './chunk-PWG3VHRQ.js';
|
|
4
|
-
import { Composer } from './chunk-
|
|
4
|
+
import { Composer } from './chunk-UJ4VVK7R.js';
|
|
5
5
|
import { Count } from './chunk-BHHIIK3M.js';
|
|
6
6
|
import { useHeadingLevel, headingTag } from './chunk-PQADV6P6.js';
|
|
7
7
|
import { Button } from './chunk-OG6CL3EB.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useReorder } from './chunk-XJ2QEBMM.js';
|
|
2
|
-
import { Input } from './chunk-
|
|
2
|
+
import { Input } from './chunk-LJHH4WWB.js';
|
|
3
3
|
import { Menu } from './chunk-TMM32U7D.js';
|
|
4
4
|
import { IconButton } from './chunk-LACA4JGC.js';
|
|
5
5
|
import { VisuallyHidden } from './chunk-BZFWDIV6.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Card } from './chunk-INHXF2CL.js';
|
|
2
2
|
import { VisuallyHidden } from './chunk-BZFWDIV6.js';
|
|
3
3
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
4
|
-
import './FolderTile-
|
|
4
|
+
import './FolderTile-MIUEB7SO.css';
|
|
5
5
|
import { useId } from 'react';
|
|
6
6
|
import { FolderGlyph } from '@crewlethq/icons/glyphs';
|
|
7
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
@@ -3,7 +3,7 @@ import { useListbox, useOptionKeys } from './chunk-7KHM2FZH.js';
|
|
|
3
3
|
import { Popover } from './chunk-KHJIEPZV.js';
|
|
4
4
|
import { KeyChip, highlightMatch } from './chunk-FYTIJM2T.js';
|
|
5
5
|
import { Skeleton } from './chunk-TEUQWOWZ.js';
|
|
6
|
-
import { Input } from './chunk-
|
|
6
|
+
import { Input } from './chunk-LJHH4WWB.js';
|
|
7
7
|
import { announce } from './chunk-RSAQOKH3.js';
|
|
8
8
|
import { useMediaMatch } from './chunk-RTPQDNW3.js';
|
|
9
9
|
import { focusables, isComposing } from './chunk-H5XTJ7GJ.js';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { PageHeader } from './chunk-DKB73KZI.js';
|
|
2
|
+
import { DataTable } from './chunk-5O72FSOK.js';
|
|
2
3
|
import { DateTimePicker } from './chunk-ZFM5L7M4.js';
|
|
3
|
-
import { DataTable } from './chunk-WQ7S7CKZ.js';
|
|
4
4
|
import { useListbox, useOptionKeys } from './chunk-7KHM2FZH.js';
|
|
5
5
|
import { Toolbar } from './chunk-NR4CPM4T.js';
|
|
6
6
|
import { Popover } from './chunk-KHJIEPZV.js';
|
|
7
7
|
import { RelativeTime } from './chunk-3CZ7XAVY.js';
|
|
8
8
|
import { Kbd } from './chunk-SMBKXWML.js';
|
|
9
|
-
import { Input } from './chunk-
|
|
9
|
+
import { Input } from './chunk-LJHH4WWB.js';
|
|
10
10
|
import { Count } from './chunk-BHHIIK3M.js';
|
|
11
11
|
import { Menu } from './chunk-TMM32U7D.js';
|
|
12
12
|
import { Button } from './chunk-OG6CL3EB.js';
|
|
@@ -2,9 +2,9 @@ import { Select } from './chunk-XQZ6EWOE.js';
|
|
|
2
2
|
import { SHEET_LABELS, SHEET_COLUMN_TYPES, optionHue, retypeColumn } from './chunk-LFSIKGRQ.js';
|
|
3
3
|
import { HueSwatch } from './chunk-34RMTXDZ.js';
|
|
4
4
|
import { NODE_HUES, NODE_HUE_NAMES } from './chunk-AYKXMIOR.js';
|
|
5
|
-
import { Checkbox } from './chunk-
|
|
5
|
+
import { Checkbox } from './chunk-RQI43UJ7.js';
|
|
6
6
|
import { Kbd } from './chunk-SMBKXWML.js';
|
|
7
|
-
import { FormField, Input } from './chunk-
|
|
7
|
+
import { FormField, Input } from './chunk-LJHH4WWB.js';
|
|
8
8
|
import { Menu } from './chunk-TMM32U7D.js';
|
|
9
9
|
import { Button } from './chunk-OG6CL3EB.js';
|
|
10
10
|
import { IconButton } from './chunk-LACA4JGC.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { richEditorLabels } from './chunk-CSQTDGTS.js';
|
|
2
|
-
import { Callout } from './chunk-
|
|
2
|
+
import { Callout } from './chunk-BPCY7ZID.js';
|
|
3
3
|
import { Skeleton } from './chunk-TEUQWOWZ.js';
|
|
4
4
|
import { Button } from './chunk-OG6CL3EB.js';
|
|
5
5
|
import './RichEditor-NPD2KAPS.css';
|
|
@@ -9,7 +9,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
9
9
|
var engine = null;
|
|
10
10
|
var loading = null;
|
|
11
11
|
function loadEngine() {
|
|
12
|
-
loading ??= import('./Editor-
|
|
12
|
+
loading ??= import('./Editor-SZFWVDAU.js').then(
|
|
13
13
|
(module) => {
|
|
14
14
|
engine = module.Editor;
|
|
15
15
|
return engine;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ContrastLevelTag } from './chunk-WW7TU6HE.js';
|
|
2
|
+
import { Popover } from './chunk-KHJIEPZV.js';
|
|
3
|
+
import { IconButton } from './chunk-LACA4JGC.js';
|
|
4
|
+
import { cx } from './chunk-ODEQTPFM.js';
|
|
5
|
+
import './ContrastHelp-MZCAW5WQ.css';
|
|
6
|
+
import { InfoGlyph } from '@crewlethq/icons/glyphs';
|
|
7
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
var LABELS = {
|
|
10
|
+
trigger: "About contrast levels",
|
|
11
|
+
title: "Contrast levels",
|
|
12
|
+
intro: "Contrast compares two colours, from 1:1 to 21:1.",
|
|
13
|
+
aa: { term: "AA", meaning: "At least 4.5:1 for text, 3:1 for large text, icons and buttons." },
|
|
14
|
+
aaa: { term: "AAA", meaning: "At least 7:1 for text, 4.5:1 for large text." },
|
|
15
|
+
low: { term: "Low or Fails", meaning: "Below AA." }
|
|
16
|
+
};
|
|
17
|
+
function ContrastHelp({ align = "start", className, labels }) {
|
|
18
|
+
const text = { ...LABELS, ...labels };
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
20
|
+
Popover,
|
|
21
|
+
{
|
|
22
|
+
role: "dialog",
|
|
23
|
+
label: text.title,
|
|
24
|
+
align,
|
|
25
|
+
className: cx("crewlet-contrast-help__panel", className),
|
|
26
|
+
trigger: (_, toggle) => /* @__PURE__ */ jsx(
|
|
27
|
+
IconButton,
|
|
28
|
+
{
|
|
29
|
+
size: "sm",
|
|
30
|
+
variant: "ghost",
|
|
31
|
+
label: text.trigger,
|
|
32
|
+
icon: /* @__PURE__ */ jsx(InfoGlyph, { size: "sm" }),
|
|
33
|
+
className: "crewlet-contrast-help__trigger",
|
|
34
|
+
onClick: toggle
|
|
35
|
+
}
|
|
36
|
+
),
|
|
37
|
+
children: /* @__PURE__ */ jsxs("div", { className: "crewlet-contrast-help", children: [
|
|
38
|
+
/* @__PURE__ */ jsx("p", { className: "crewlet-contrast-help__title", children: text.title }),
|
|
39
|
+
/* @__PURE__ */ jsx("p", { className: "crewlet-contrast-help__intro", children: text.intro }),
|
|
40
|
+
/* @__PURE__ */ jsxs("dl", { className: "crewlet-contrast-help__levels", children: [
|
|
41
|
+
/* @__PURE__ */ jsx("dt", { children: /* @__PURE__ */ jsx(ContrastLevelTag, { level: "aa", children: text.aa.term }) }),
|
|
42
|
+
/* @__PURE__ */ jsx("dd", { children: text.aa.meaning }),
|
|
43
|
+
/* @__PURE__ */ jsx("dt", { children: /* @__PURE__ */ jsx(ContrastLevelTag, { level: "aaa", children: text.aaa.term }) }),
|
|
44
|
+
/* @__PURE__ */ jsx("dd", { children: text.aaa.meaning }),
|
|
45
|
+
/* @__PURE__ */ jsx("dt", { children: /* @__PURE__ */ jsx(ContrastLevelTag, { level: "low", children: text.low.term }) }),
|
|
46
|
+
/* @__PURE__ */ jsx("dd", { children: text.low.meaning })
|
|
47
|
+
] })
|
|
48
|
+
] })
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { ContrastHelp };
|
|
@@ -6,7 +6,7 @@ import { IconButton } from './chunk-LACA4JGC.js';
|
|
|
6
6
|
import { useFocusModality } from './chunk-NUZHC6MM.js';
|
|
7
7
|
import { VisuallyHidden } from './chunk-BZFWDIV6.js';
|
|
8
8
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
9
|
-
import './Input-
|
|
9
|
+
import './Input-GMOWHZRG.css';
|
|
10
10
|
import './VisuallyHidden-L552H7OA.css';
|
|
11
11
|
import { forwardRef, useRef, useState, useImperativeHandle, useEffect, useId } from 'react';
|
|
12
12
|
import { XGlyph } from '@crewlethq/icons/glyphs';
|
|
@@ -208,6 +208,7 @@ var FormField = ({
|
|
|
208
208
|
helperOnFocus = false,
|
|
209
209
|
error,
|
|
210
210
|
limit,
|
|
211
|
+
tally,
|
|
211
212
|
labelAction,
|
|
212
213
|
hideLabel = false,
|
|
213
214
|
as = "div",
|
|
@@ -222,9 +223,11 @@ var FormField = ({
|
|
|
222
223
|
const helperId = helper ? `${id}-helper` : void 0;
|
|
223
224
|
const errorId = error ? `${id}-error` : void 0;
|
|
224
225
|
const countId = limit ? `${id}-count` : void 0;
|
|
226
|
+
const hasTally = tally !== void 0 && tally !== null && tally !== false;
|
|
227
|
+
const tallyId = hasTally ? `${id}-tally` : void 0;
|
|
225
228
|
const over = limit !== void 0 && characterCountState(limit.length, limit.max) === "over";
|
|
226
229
|
const extra = describedBy === void 0 ? [] : typeof describedBy === "string" ? [describedBy] : [...describedBy];
|
|
227
|
-
const described = [...extra, helperId, countId, errorId].filter(Boolean).join(" ");
|
|
230
|
+
const described = [...extra, helperId, tallyId, countId, errorId].filter(Boolean).join(" ");
|
|
228
231
|
const invalid = Boolean(error) || over;
|
|
229
232
|
const field = {
|
|
230
233
|
id,
|
|
@@ -235,9 +238,10 @@ var FormField = ({
|
|
|
235
238
|
const help = helper ? /* @__PURE__ */ jsx("div", { id: helperId, className: "crewlet-form-field__helper", children: helper }) : null;
|
|
236
239
|
const body = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
237
240
|
typeof children === "function" ? children(field) : children,
|
|
238
|
-
limit ? /* @__PURE__ */ jsxs("div", { className: "crewlet-form-field__meta", children: [
|
|
241
|
+
limit || hasTally ? /* @__PURE__ */ jsxs("div", { className: "crewlet-form-field__meta", children: [
|
|
239
242
|
help ?? /* @__PURE__ */ jsx("span", { className: "crewlet-form-field__meta-spacer" }),
|
|
240
|
-
/* @__PURE__ */ jsx(
|
|
243
|
+
hasTally ? /* @__PURE__ */ jsx("span", { id: tallyId, className: "crewlet-form-field__tally", children: tally }) : null,
|
|
244
|
+
limit ? /* @__PURE__ */ jsx(CharacterCount, { id: countId, length: limit.length, max: limit.max, labels: limit.labels }) : null
|
|
241
245
|
] }) : help,
|
|
242
246
|
error ? /* @__PURE__ */ jsx("div", { id: errorId, className: "crewlet-form-field__error", role: "alert", children: error }) : null
|
|
243
247
|
] });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Modal } from './chunk-YCC2S7DF.js';
|
|
2
2
|
import { useListbox, useHighlightRest } from './chunk-7KHM2FZH.js';
|
|
3
3
|
import { Kbd } from './chunk-SMBKXWML.js';
|
|
4
|
-
import { Input } from './chunk-
|
|
4
|
+
import { Input } from './chunk-LJHH4WWB.js';
|
|
5
5
|
import { Count } from './chunk-BHHIIK3M.js';
|
|
6
6
|
import { HIT_AREA_CLASS } from './chunk-2YTOOH3A.js';
|
|
7
7
|
import { isComposing } from './chunk-H5XTJ7GJ.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Select } from './chunk-XQZ6EWOE.js';
|
|
2
2
|
import { Modal } from './chunk-YCC2S7DF.js';
|
|
3
3
|
import { CopyButton } from './chunk-7SHAFLEX.js';
|
|
4
|
-
import { Callout } from './chunk-
|
|
4
|
+
import { Callout } from './chunk-BPCY7ZID.js';
|
|
5
5
|
import { PrincipalAvatar } from './chunk-CI3VPIJN.js';
|
|
6
6
|
import { useHeadingLevel, headingTag } from './chunk-PQADV6P6.js';
|
|
7
7
|
import { useMediaMatch } from './chunk-RTPQDNW3.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Copyable } from './chunk-7SHAFLEX.js';
|
|
2
|
-
import { normalizeHex } from './chunk-
|
|
2
|
+
import { normalizeHex } from './chunk-7W3LYIOC.js';
|
|
3
3
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
4
4
|
import './ColorSwatch-DNMUFHNS.css';
|
|
5
5
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Switch } from './chunk-A722MUNR.js';
|
|
2
2
|
import { useReorder } from './chunk-XJ2QEBMM.js';
|
|
3
|
-
import { Checkbox } from './chunk-
|
|
3
|
+
import { Checkbox } from './chunk-RQI43UJ7.js';
|
|
4
4
|
import { IconButton } from './chunk-LACA4JGC.js';
|
|
5
5
|
import { VisuallyHidden } from './chunk-BZFWDIV6.js';
|
|
6
6
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConfirmModal } from './chunk-YCC2S7DF.js';
|
|
2
2
|
import { InlineCode } from './chunk-5CLW2CXT.js';
|
|
3
|
-
import { Callout } from './chunk-
|
|
3
|
+
import { Callout } from './chunk-BPCY7ZID.js';
|
|
4
4
|
import './LinkInterstitial-ET4MSVSV.css';
|
|
5
5
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
6
|
|
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
import { FileDrop, FilePickButton } from './chunk-THDGBD6Y.js';
|
|
2
|
-
import { contrastRatio } from './chunk-
|
|
3
|
-
import { normalizeHex } from './chunk-
|
|
2
|
+
import { contrastRatio } from './chunk-WW7TU6HE.js';
|
|
3
|
+
import { normalizeHex } from './chunk-7W3LYIOC.js';
|
|
4
4
|
import { Button } from './chunk-OG6CL3EB.js';
|
|
5
5
|
import { VisuallyHidden } from './chunk-BZFWDIV6.js';
|
|
6
6
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
7
|
-
import './LogoSlot-
|
|
8
|
-
import { useId } from 'react';
|
|
7
|
+
import './LogoSlot-ETD74ELF.css';
|
|
8
|
+
import { createContext, useId, useContext } from 'react';
|
|
9
9
|
import { ImageGlyph, CircleAlertGlyph, UploadGlyph, TrashGlyph } from '@crewlethq/icons/glyphs';
|
|
10
10
|
import { themes } from '@crewlethq/tokens';
|
|
11
11
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
12
12
|
|
|
13
|
+
var LogoSlotGroupContext = createContext(null);
|
|
14
|
+
function useLogoSlotGroup() {
|
|
15
|
+
return useContext(LogoSlotGroupContext);
|
|
16
|
+
}
|
|
17
|
+
function LogoSlotGroup({ children, label, hint, className, ...rest }) {
|
|
18
|
+
const id = useId();
|
|
19
|
+
const hasHint = hint !== void 0 && hint !== null && hint !== false;
|
|
20
|
+
const hintId = hasHint ? `${id}-hint` : void 0;
|
|
21
|
+
return /* @__PURE__ */ jsx(LogoSlotGroupContext.Provider, { value: { hintId }, children: /* @__PURE__ */ jsxs("div", { ...rest, role: "group", "aria-label": label, className: cx("crewlet-logo-slot-group", className), children: [
|
|
22
|
+
/* @__PURE__ */ jsx("div", { className: "crewlet-logo-slot-group__slots", children }),
|
|
23
|
+
hasHint ? /* @__PURE__ */ jsx("p", { id: hintId, className: "crewlet-logo-slot-group__hint", children: hint }) : null
|
|
24
|
+
] }) });
|
|
25
|
+
}
|
|
13
26
|
var LABELS = {
|
|
14
27
|
choose: "Choose a file",
|
|
15
28
|
replace: "Replace",
|
|
@@ -42,6 +55,7 @@ function LogoSlot({
|
|
|
42
55
|
ground,
|
|
43
56
|
groundColor,
|
|
44
57
|
shape = "wide",
|
|
58
|
+
size = "md",
|
|
45
59
|
src,
|
|
46
60
|
alt,
|
|
47
61
|
guide = true,
|
|
@@ -57,6 +71,7 @@ function LogoSlot({
|
|
|
57
71
|
labels
|
|
58
72
|
}) {
|
|
59
73
|
const text = { ...LABELS, ...labels };
|
|
74
|
+
const group = useLogoSlotGroup();
|
|
60
75
|
const labelId = useId();
|
|
61
76
|
const descriptionId = useId();
|
|
62
77
|
const groundValue = normalizeHex(groundColor) ?? DEFAULT_GROUNDS[ground];
|
|
@@ -86,7 +101,7 @@ function LogoSlot({
|
|
|
86
101
|
"aria-labelledby": labelId,
|
|
87
102
|
"aria-describedby": description ? descriptionId : void 0,
|
|
88
103
|
"aria-busy": uploading || void 0,
|
|
89
|
-
className: cx("crewlet-logo-slot", className),
|
|
104
|
+
className: cx("crewlet-logo-slot", size === "sm" && "crewlet-logo-slot--sm", className),
|
|
90
105
|
children: [
|
|
91
106
|
/* @__PURE__ */ jsxs("div", { className: "crewlet-logo-slot__head", children: [
|
|
92
107
|
/* @__PURE__ */ jsxs("span", { className: "crewlet-logo-slot__words", children: [
|
|
@@ -96,10 +111,12 @@ function LogoSlot({
|
|
|
96
111
|
download && filled ? /* @__PURE__ */ jsx("span", { className: "crewlet-logo-slot__download", children: download }) : null
|
|
97
112
|
] }),
|
|
98
113
|
editable ? /* @__PURE__ */ jsx(FileDrop, { title: text.drop, onFiles: take, disabled: uploading, children: stage }) : stage,
|
|
99
|
-
!filled && (!editable || emptyNote) ? /* @__PURE__ */
|
|
100
|
-
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
|
|
114
|
+
!filled && (!editable || emptyNote) || error ? /* @__PURE__ */ jsxs("div", { className: "crewlet-logo-slot__notes", children: [
|
|
115
|
+
!filled && (!editable || emptyNote) ? /* @__PURE__ */ jsx("p", { className: "crewlet-logo-slot__empty", children: emptyNote ?? text.empty }) : null,
|
|
116
|
+
error ? /* @__PURE__ */ jsxs("p", { className: "crewlet-logo-slot__error", role: "alert", children: [
|
|
117
|
+
/* @__PURE__ */ jsx(CircleAlertGlyph, { size: "sm", "aria-hidden": "true" }),
|
|
118
|
+
/* @__PURE__ */ jsx("span", { children: error })
|
|
119
|
+
] }) : null
|
|
103
120
|
] }) : null,
|
|
104
121
|
editable ? /* @__PURE__ */ jsxs("div", { className: "crewlet-logo-slot__foot", children: [
|
|
105
122
|
/* @__PURE__ */ jsx(
|
|
@@ -111,7 +128,7 @@ function LogoSlot({
|
|
|
111
128
|
accept,
|
|
112
129
|
multiple: false,
|
|
113
130
|
loading: uploading,
|
|
114
|
-
"aria-describedby": labelId,
|
|
131
|
+
"aria-describedby": [labelId, group?.hintId].filter(Boolean).join(" "),
|
|
115
132
|
onFiles: take,
|
|
116
133
|
children: filled ? text.replace : text.choose
|
|
117
134
|
}
|
|
@@ -128,7 +145,7 @@ function LogoSlot({
|
|
|
128
145
|
children: text.remove
|
|
129
146
|
}
|
|
130
147
|
) : null,
|
|
131
|
-
/* @__PURE__ */ jsx("span", { className: "crewlet-logo-slot__hint", children: text.hint })
|
|
148
|
+
group ? null : /* @__PURE__ */ jsx("span", { className: "crewlet-logo-slot__hint", children: text.hint })
|
|
132
149
|
] }) : null,
|
|
133
150
|
/* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx("span", { role: "status", children: uploading ? text.uploading : "" }) })
|
|
134
151
|
]
|
|
@@ -136,4 +153,4 @@ function LogoSlot({
|
|
|
136
153
|
);
|
|
137
154
|
}
|
|
138
155
|
|
|
139
|
-
export { LogoSlot };
|
|
156
|
+
export { LogoSlot, LogoSlotGroup };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { frameThemeMessage, readFrameHello, frameOriginMatches, negotiateBridge, FRAME_MESSAGE, portTargetOrigin, checkFrameSandbox, httpOrigin, isFrameNonce, frameFragment, readOpenLink, externalUrl, isFocusExit } from './chunk-F6V2PTN6.js';
|
|
2
|
-
import { Callout } from './chunk-
|
|
2
|
+
import { Callout } from './chunk-BPCY7ZID.js';
|
|
3
3
|
import { Skeleton } from './chunk-TEUQWOWZ.js';
|
|
4
4
|
import { Button } from './chunk-OG6CL3EB.js';
|
|
5
5
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Tag } from './chunk-KYIAFNU7.js';
|
|
2
|
-
import { normalizeHex } from './chunk-
|
|
2
|
+
import { normalizeHex } from './chunk-7W3LYIOC.js';
|
|
3
3
|
import { VisuallyHidden } from './chunk-BZFWDIV6.js';
|
|
4
4
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
5
5
|
import './ContrastBadge-CBZPGG3G.css';
|
|
6
6
|
import { CircleAlertGlyph, TriangleAlertGlyph, CircleCheckGlyph } from '@crewlethq/icons/glyphs';
|
|
7
7
|
import { WCAG_CONTRAST, parseHex, contrast } from '@crewlethq/tokens';
|
|
8
|
-
import {
|
|
8
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
9
9
|
|
|
10
10
|
function contrastLevel(ratio, scale = "body") {
|
|
11
11
|
if (scale === "large") {
|
|
@@ -40,6 +40,17 @@ var TONE = {
|
|
|
40
40
|
fail: "danger",
|
|
41
41
|
low: "warning"
|
|
42
42
|
};
|
|
43
|
+
function ContrastLevelTag({ level, children }) {
|
|
44
|
+
return /* @__PURE__ */ jsx(
|
|
45
|
+
Tag,
|
|
46
|
+
{
|
|
47
|
+
size: "xs",
|
|
48
|
+
variant: TONE[level],
|
|
49
|
+
leadingIcon: level === "fail" ? /* @__PURE__ */ jsx(CircleAlertGlyph, { size: "xs" }) : level === "aa-large" || level === "low" ? /* @__PURE__ */ jsx(TriangleAlertGlyph, { size: "xs" }) : /* @__PURE__ */ jsx(CircleCheckGlyph, { size: "xs" }),
|
|
50
|
+
children
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
43
54
|
function ContrastBadge({
|
|
44
55
|
foreground,
|
|
45
56
|
background,
|
|
@@ -65,17 +76,9 @@ function ContrastBadge({
|
|
|
65
76
|
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: `${printed}:1` }),
|
|
66
77
|
/* @__PURE__ */ jsx(VisuallyHidden, { children: text.ratio(printed) })
|
|
67
78
|
] }),
|
|
68
|
-
/* @__PURE__ */ jsx(
|
|
69
|
-
Tag,
|
|
70
|
-
{
|
|
71
|
-
size: "xs",
|
|
72
|
-
variant: TONE[level],
|
|
73
|
-
leadingIcon: level === "fail" ? /* @__PURE__ */ jsx(CircleAlertGlyph, { size: "xs" }) : level === "aa-large" || level === "low" ? /* @__PURE__ */ jsx(TriangleAlertGlyph, { size: "xs" }) : /* @__PURE__ */ jsx(CircleCheckGlyph, { size: "xs" }),
|
|
74
|
-
children: text.levels[level]
|
|
75
|
-
}
|
|
76
|
-
)
|
|
79
|
+
/* @__PURE__ */ jsx(ContrastLevelTag, { level, children: text.levels[level] })
|
|
77
80
|
] }) : /* @__PURE__ */ jsx("span", { className: "crewlet-contrast-badge__unmeasured", children: text.unmeasured })
|
|
78
81
|
] });
|
|
79
82
|
}
|
|
80
83
|
|
|
81
|
-
export { ContrastBadge, contrastLevel, contrastRatio, formatContrastRatio };
|
|
84
|
+
export { ContrastBadge, ContrastLevelTag, contrastLevel, contrastRatio, formatContrastRatio };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { VisuallyHidden } from './chunk-BZFWDIV6.js';
|
|
2
|
+
import { cx } from './chunk-ODEQTPFM.js';
|
|
3
|
+
import './ChoiceButtons-HWXEF2H3.css';
|
|
4
|
+
import { useId } from 'react';
|
|
5
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
function ChoiceButtons({
|
|
8
|
+
label,
|
|
9
|
+
options,
|
|
10
|
+
recommended,
|
|
11
|
+
recommendedLabel = "Recommended",
|
|
12
|
+
onChoose,
|
|
13
|
+
pending,
|
|
14
|
+
disabledReason,
|
|
15
|
+
size = "md",
|
|
16
|
+
chosen,
|
|
17
|
+
className,
|
|
18
|
+
...rest
|
|
19
|
+
}) {
|
|
20
|
+
const reasonId = useId();
|
|
21
|
+
const first = options.find((o) => o.value === recommended);
|
|
22
|
+
const ordered = first ? [first, ...options.filter((o) => o !== first)] : options;
|
|
23
|
+
const busy = pending !== void 0 && pending !== null;
|
|
24
|
+
const inert = busy || disabledReason !== void 0;
|
|
25
|
+
return /* @__PURE__ */ jsxs(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
...rest,
|
|
29
|
+
role: "group",
|
|
30
|
+
"aria-label": label,
|
|
31
|
+
className: cx("crewlet-choice-buttons", size === "sm" && "crewlet-choice-buttons--sm", className),
|
|
32
|
+
children: [
|
|
33
|
+
ordered.map((option) => {
|
|
34
|
+
const isRecommended = option === first;
|
|
35
|
+
const isChosen = chosen !== void 0 && chosen !== null && option.value === chosen;
|
|
36
|
+
return /* @__PURE__ */ jsxs(
|
|
37
|
+
"button",
|
|
38
|
+
{
|
|
39
|
+
type: "button",
|
|
40
|
+
className: cx(
|
|
41
|
+
"crewlet-choice-buttons__option",
|
|
42
|
+
isRecommended && "crewlet-choice-buttons__option--recommended",
|
|
43
|
+
isChosen && "is-chosen"
|
|
44
|
+
),
|
|
45
|
+
"aria-pressed": chosen === void 0 ? void 0 : isChosen,
|
|
46
|
+
"aria-disabled": inert || void 0,
|
|
47
|
+
"aria-busy": pending === option.value || void 0,
|
|
48
|
+
"aria-describedby": disabledReason === void 0 ? void 0 : reasonId,
|
|
49
|
+
onClick: (event) => {
|
|
50
|
+
if (inert) {
|
|
51
|
+
event.preventDefault();
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
onChoose(option.value);
|
|
55
|
+
},
|
|
56
|
+
children: [
|
|
57
|
+
option.media === void 0 || option.media === null ? null : /* @__PURE__ */ jsx("span", { className: "crewlet-choice-buttons__media", "aria-hidden": "true", children: option.media }),
|
|
58
|
+
/* @__PURE__ */ jsxs("span", { className: "crewlet-choice-buttons__text", children: [
|
|
59
|
+
/* @__PURE__ */ jsx("span", { className: "crewlet-choice-buttons__label", children: option.label }),
|
|
60
|
+
option.detail === void 0 ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
61
|
+
" ",
|
|
62
|
+
/* @__PURE__ */ jsx("span", { className: "crewlet-choice-buttons__detail", children: option.detail })
|
|
63
|
+
] })
|
|
64
|
+
] }),
|
|
65
|
+
isRecommended ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
66
|
+
" ",
|
|
67
|
+
/* @__PURE__ */ jsx("span", { className: "crewlet-choice-buttons__note", children: recommendedLabel })
|
|
68
|
+
] }) : null
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
option.value
|
|
72
|
+
);
|
|
73
|
+
}),
|
|
74
|
+
disabledReason === void 0 ? null : /* @__PURE__ */ jsx(VisuallyHidden, { id: reasonId, children: disabledReason })
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export { ChoiceButtons };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { safeFontFamily, fontStack } from './chunk-5SGHW42B.js';
|
|
2
|
-
import { normalizeHex } from './chunk-
|
|
2
|
+
import { normalizeHex } from './chunk-7W3LYIOC.js';
|
|
3
3
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
4
4
|
import '@crewlethq/tokens/css/brand-scope';
|
|
5
5
|
import './BrandScope-H2KZHGT7.css';
|
|
@@ -45,6 +45,7 @@ export * from '../Checkbox/index.js';
|
|
|
45
45
|
export * from '../ChoiceButtons/index.js';
|
|
46
46
|
export * from '../ChoiceList/index.js';
|
|
47
47
|
export * from '../CodeBlock/index.js';
|
|
48
|
+
export * from '../ColorChip/index.js';
|
|
48
49
|
export * from '../ColorField/index.js';
|
|
49
50
|
export * from '../ColorSwatch/index.js';
|
|
50
51
|
export * from '../Combobox/index.js';
|
|
@@ -55,6 +56,7 @@ export * from '../ConfirmField/index.js';
|
|
|
55
56
|
export * from '../ConflictNote/index.js';
|
|
56
57
|
export * from '../Container/index.js';
|
|
57
58
|
export * from '../ContrastBadge/index.js';
|
|
59
|
+
export * from '../ContrastHelp/index.js';
|
|
58
60
|
export * from '../Copyable/index.js';
|
|
59
61
|
export * from '../Count/index.js';
|
|
60
62
|
export * from '../CursorFlag/index.js';
|