@crewlethq/ui 0.18.0 → 0.19.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 +19 -2
- package/dist/AccessDeniedCard/index.js +2 -2
- package/dist/AppShell/index.js +2 -2
- package/dist/ArrangeBoard/ArrangeBoard.d.ts +32 -0
- package/dist/ArrangeBoard/index.d.ts +3 -0
- package/dist/ArrangeBoard/index.js +2 -0
- package/dist/ArrangeBoard-MQE35P6Z.css +80 -0
- package/dist/ArrangeFrame/ArrangeFrame.d.ts +82 -0
- package/dist/ArrangeFrame/index.d.ts +5 -0
- package/dist/ArrangeFrame/index.js +5 -0
- package/dist/ArrangeFrame/useGridResize.d.ts +66 -0
- package/dist/ArrangeFrame-3PLZAG22.css +329 -0
- package/dist/ArrangeGroup/ArrangeGroup.d.ts +42 -0
- package/dist/ArrangeGroup/index.d.ts +3 -0
- package/dist/ArrangeGroup/index.js +4 -0
- package/dist/ArrangeGroup-SHFHA7BE.css +170 -0
- package/dist/ArrangeList/ArrangeList.d.ts +64 -0
- package/dist/ArrangeList/index.d.ts +3 -0
- package/dist/ArrangeList/index.js +10 -0
- package/dist/ArrangeList-NNRTDFI5.css +94 -0
- package/dist/ArtifactCard/index.js +2 -2
- package/dist/AuthLayout/index.js +2 -2
- package/dist/AvatarPicker/index.js +4 -4
- package/dist/Canvas/index.js +2 -2
- package/dist/Card/index.js +1 -1
- package/dist/Checkbox/index.js +3 -3
- package/dist/Combobox/index.js +4 -4
- package/dist/CommandPalette/index.js +6 -6
- package/dist/Composer/index.js +3 -3
- package/dist/ConfirmField/index.js +3 -3
- package/dist/DataTable/index.js +8 -8
- package/dist/DataView/index.js +13 -13
- package/dist/DateTimePicker/index.js +3 -3
- package/dist/Divider/Divider.d.ts +15 -0
- package/dist/Divider/index.d.ts +3 -0
- package/dist/Divider/index.js +2 -0
- package/dist/Divider-3Z77ZAJH.css +37 -0
- package/dist/HuePicker/HuePicker.d.ts +16 -4
- package/dist/HuePicker/index.js +2 -2
- package/dist/{HuePicker-5QIUR6L7.css → HuePicker-PAIGH6LR.css} +6 -0
- package/dist/IconTile/IconTile.d.ts +23 -0
- package/dist/IconTile/index.d.ts +3 -0
- package/dist/IconTile/index.js +2 -0
- package/dist/IconTile-4GNWTLAW.css +30 -0
- package/dist/Input/index.js +2 -2
- package/dist/LinkInterstitial/index.js +4 -4
- package/dist/ListInput/index.js +5 -5
- package/dist/MarkdownEditor/index.js +2 -2
- package/dist/Menu/index.js +2 -2
- package/dist/Modal/Modal.d.ts +20 -0
- package/dist/Modal/index.js +3 -3
- package/dist/{Modal-RQAYGG4L.css → Modal-XOSV6FAH.css} +14 -0
- package/dist/Note/Note.d.ts +23 -0
- package/dist/Note/index.d.ts +3 -0
- package/dist/Note/index.js +2 -0
- package/dist/Note-RT4L6VUT.css +58 -0
- package/dist/OrgTable/index.js +5 -5
- package/dist/PinTile/PinTile.d.ts +37 -0
- package/dist/PinTile/index.d.ts +3 -0
- package/dist/PinTile/index.js +4 -0
- package/dist/PinTile-IIA25MNZ.css +141 -0
- package/dist/PresenceStack/index.js +1 -1
- package/dist/PrincipalPicker/index.js +5 -5
- package/dist/Reorder/index.d.ts +2 -0
- package/dist/Reorder/index.js +4 -0
- package/dist/Reorder/useReorder.d.ts +138 -0
- package/dist/ShareDialog/index.js +7 -7
- package/dist/SheetGrid/index.js +4 -4
- package/dist/StatGroup/StatGroup.d.ts +7 -1
- package/dist/StatGroup/index.js +1 -1
- package/dist/{StatGroup-HVG6O62W.css → StatGroup-PADTJCUQ.css} +7 -0
- package/dist/Switcher/index.js +8 -8
- package/dist/TagsInput/index.js +3 -3
- package/dist/TimeWindowPicker/index.js +5 -5
- package/dist/TreeCanvas/index.js +3 -3
- package/dist/TreeGrid/index.js +2 -2
- package/dist/chunk-35XVR5JQ.js +81 -0
- package/dist/chunk-63WJLRB2.js +24 -0
- package/dist/{chunk-L4ZLXYPO.js → chunk-6A7P6II6.js} +1 -1
- package/dist/chunk-6KWNXIDE.js +18 -0
- package/dist/chunk-6MIXD6IW.js +49 -0
- package/dist/{chunk-NZY77ZDU.js → chunk-7FQEUNHX.js} +4 -4
- package/dist/{chunk-2TZATTIU.js → chunk-7IJARUIF.js} +18 -5
- package/dist/chunk-AIVZVKYZ.js +126 -0
- package/dist/{chunk-76FXDZAZ.js → chunk-AJESMWJS.js} +4 -4
- package/dist/chunk-DEJHAOC5.js +279 -0
- package/dist/{chunk-ERV5BUS3.js → chunk-EIGEIT4O.js} +3 -3
- package/dist/chunk-FFMCMSJB.js +1 -0
- package/dist/{chunk-LFZ45HV2.js → chunk-G3EEUNZQ.js} +1 -1
- package/dist/{chunk-2YR5ZPQ3.js → chunk-HTCJSUIZ.js} +3 -3
- package/dist/{chunk-75CLJNDQ.js → chunk-I6NZKJGK.js} +1 -1
- package/dist/chunk-IXJHTFXG.js +17 -0
- package/dist/{chunk-3UAA4IWJ.js → chunk-JEDWC3GI.js} +1 -1
- package/dist/{chunk-QVAFL2LE.js → chunk-JXRI5YD2.js} +3 -3
- package/dist/{chunk-ZFH7H7GS.js → chunk-LOLELDBW.js} +1 -1
- package/dist/{chunk-KVT3TJVG.js → chunk-OIMAK5AE.js} +6 -6
- package/dist/chunk-QO7QEQKV.js +24 -0
- package/dist/{chunk-A7EBCHEG.js → chunk-RT323I4I.js} +1 -1
- package/dist/{chunk-BOW2VUCH.js → chunk-T7ICFXEC.js} +1 -1
- package/dist/{chunk-2OLCUNG7.js → chunk-TBIZSQHB.js} +1 -1
- package/dist/{chunk-4U3GQ7D2.js → chunk-TODND5AD.js} +1 -1
- package/dist/{chunk-IFKBDRNJ.js → chunk-UXELEORU.js} +3 -3
- package/dist/{chunk-6NIMZ5XC.js → chunk-VJLYGPPE.js} +1 -1
- package/dist/{chunk-7QFAORCY.js → chunk-WHZFDS62.js} +1 -1
- package/dist/chunk-XJ2QEBMM.js +277 -0
- package/dist/{chunk-PA4CYTBY.js → chunk-XU4ZUGLE.js} +19 -4
- package/dist/{chunk-T3ZWBZ65.js → chunk-YSJYWQSP.js} +2 -2
- package/dist/{chunk-CXBAIVYZ.js → chunk-YSY6UJ4F.js} +1 -1
- package/dist/{chunk-EG6NYWVK.js → chunk-YZCJ63JF.js} +1 -1
- package/dist/generated/index.d.ts +9 -0
- package/dist/generated/index.js +80 -71
- package/dist/index.js +80 -71
- package/dist/styles.css +993 -3
- package/package.json +3 -3
- package/dist/chunk-EXHQ2QVW.js +0 -1
- package/dist/{chunk-ESKP3TXM.js → chunk-4Z7PW3L6.js} +0 -0
- package/dist/{chunk-AQCV62K6.js → chunk-7ZNKEPLN.js} +1 -1
- package/dist/{chunk-OYOQU7O5.js → chunk-EDGCPVVD.js} +1 -1
- package/dist/{chunk-NS7BVLL3.js → chunk-JULMZNGT.js} +1 -1
- package/dist/{chunk-5NVKTB6E.js → chunk-L4H7SSWF.js} +1 -1
- package/dist/{chunk-FYXRWBJJ.js → chunk-PUQY4WXR.js} +2 -2
- package/dist/{chunk-4GB57WIT.js → chunk-Q55TXPA3.js} +1 -1
- package/dist/{chunk-B2Z2CDM5.js → chunk-T5TFZ2JB.js} +1 -1
- package/dist/{chunk-AMH67MLM.js → chunk-TXAFKH2A.js} +1 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Count } from './chunk-BHHIIK3M.js';
|
|
2
|
+
import { cx } from './chunk-ODEQTPFM.js';
|
|
3
|
+
import './ArrangeGroup-SHFHA7BE.css';
|
|
4
|
+
import { useId } from 'react';
|
|
5
|
+
import { ChevronDownGlyph } from '@crewlethq/icons/glyphs';
|
|
6
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
var PLACEHOLDER = "Name this group";
|
|
9
|
+
function ArrangeGroup({
|
|
10
|
+
title,
|
|
11
|
+
tone = "none",
|
|
12
|
+
collapsed,
|
|
13
|
+
onCollapsedChange,
|
|
14
|
+
count,
|
|
15
|
+
onTitleChange,
|
|
16
|
+
bodyProps,
|
|
17
|
+
empty,
|
|
18
|
+
columns = 12,
|
|
19
|
+
actions,
|
|
20
|
+
className,
|
|
21
|
+
children,
|
|
22
|
+
...rest
|
|
23
|
+
}) {
|
|
24
|
+
const bodyId = `${useId()}-body`;
|
|
25
|
+
const { className: bodyClass, style: bodyStyle, ...body } = bodyProps ?? {};
|
|
26
|
+
const hasChildren = Array.isArray(children) ? children.some(Boolean) : Boolean(children);
|
|
27
|
+
return /* @__PURE__ */ jsxs(
|
|
28
|
+
"section",
|
|
29
|
+
{
|
|
30
|
+
className: cx("crewlet-arrange-group", `crewlet-arrange-group--${tone}`, collapsed && "is-collapsed", className),
|
|
31
|
+
"aria-label": title || "Untitled group",
|
|
32
|
+
...rest,
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ jsxs("header", { className: "crewlet-arrange-group__head", children: [
|
|
35
|
+
/* @__PURE__ */ jsxs(
|
|
36
|
+
"button",
|
|
37
|
+
{
|
|
38
|
+
type: "button",
|
|
39
|
+
className: cx("crewlet-arrange-group__toggle", onTitleChange && "is-icon"),
|
|
40
|
+
"aria-expanded": !collapsed,
|
|
41
|
+
"aria-controls": bodyId,
|
|
42
|
+
"aria-label": onTitleChange ? `${collapsed ? "Expand" : "Collapse"} ${title || "group"}` : void 0,
|
|
43
|
+
onClick: () => onCollapsedChange(!collapsed),
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ jsx(ChevronDownGlyph, { size: "sm", className: "crewlet-arrange-group__chevron" }),
|
|
46
|
+
onTitleChange ? null : /* @__PURE__ */ jsx("span", { className: "crewlet-arrange-group__title", children: title || "Untitled group" })
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
onTitleChange ? /* @__PURE__ */ jsx(
|
|
51
|
+
"input",
|
|
52
|
+
{
|
|
53
|
+
className: "crewlet-arrange-group__title-field",
|
|
54
|
+
"aria-label": "Group name",
|
|
55
|
+
value: title,
|
|
56
|
+
maxLength: 60,
|
|
57
|
+
placeholder: PLACEHOLDER,
|
|
58
|
+
size: Math.max(3, (title || PLACEHOLDER).length),
|
|
59
|
+
onChange: (e) => onTitleChange(e.target.value)
|
|
60
|
+
}
|
|
61
|
+
) : null,
|
|
62
|
+
count !== void 0 ? /* @__PURE__ */ jsx(Count, { value: count, className: "crewlet-arrange-group__count" }) : null,
|
|
63
|
+
actions ? /* @__PURE__ */ jsx("span", { className: "crewlet-arrange-group__actions", children: actions }) : null
|
|
64
|
+
] }),
|
|
65
|
+
/* @__PURE__ */ jsx(
|
|
66
|
+
"div",
|
|
67
|
+
{
|
|
68
|
+
id: bodyId,
|
|
69
|
+
className: cx("crewlet-arrange-group__body", bodyClass),
|
|
70
|
+
style: { ...bodyStyle, ["--crewlet-arrange-columns"]: columns },
|
|
71
|
+
hidden: collapsed,
|
|
72
|
+
...body,
|
|
73
|
+
children: hasChildren ? children : empty ? /* @__PURE__ */ jsx("div", { className: "crewlet-arrange-group__empty", children: empty }) : null
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export { ArrangeGroup };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { cx } from './chunk-ODEQTPFM.js';
|
|
2
|
+
import './Note-RT4L6VUT.css';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var Note = forwardRef(function Note2({ tone = "amber", align = "start", size = "md", className, children, ...rest }, ref) {
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
"div",
|
|
9
|
+
{
|
|
10
|
+
ref,
|
|
11
|
+
className: cx(
|
|
12
|
+
"crewlet-note",
|
|
13
|
+
`crewlet-note--${tone}`,
|
|
14
|
+
align === "center" && "crewlet-note--center",
|
|
15
|
+
size === "lg" && "crewlet-note--lg",
|
|
16
|
+
className
|
|
17
|
+
),
|
|
18
|
+
...rest,
|
|
19
|
+
children
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export { Note };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { cx } from './chunk-ODEQTPFM.js';
|
|
2
|
+
import './Divider-3Z77ZAJH.css';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
function Divider({ label, align = "start", className, ...rest }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
"div",
|
|
8
|
+
{
|
|
9
|
+
role: "separator",
|
|
10
|
+
"aria-label": label || void 0,
|
|
11
|
+
className: cx("crewlet-divider", label && "crewlet-divider--labelled", label && align === "center" && "crewlet-divider--center", className),
|
|
12
|
+
...rest,
|
|
13
|
+
children: label ? /* @__PURE__ */ jsx("span", { className: "crewlet-divider__label", children: label }) : null
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { Divider };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { IconButton } from './chunk-4FQT6ZAY.js';
|
|
2
|
+
import { cx } from './chunk-ODEQTPFM.js';
|
|
3
|
+
import './PinTile-IIA25MNZ.css';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
import { GripVerticalGlyph, PinGlyph } from '@crewlethq/icons/glyphs';
|
|
6
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
var PinTile = forwardRef(function PinTile2({ title, href, kind, meta, leading, status, figure, onUnpin, handle, className, ...rest }, ref) {
|
|
9
|
+
const { "aria-label": handleName, ...handleRest } = handle ?? { "aria-label": "" };
|
|
10
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: cx("crewlet-pin-tile", className), ...rest, children: [
|
|
11
|
+
handle ? /* @__PURE__ */ jsx(
|
|
12
|
+
IconButton,
|
|
13
|
+
{
|
|
14
|
+
size: "sm",
|
|
15
|
+
variant: "ghost",
|
|
16
|
+
className: "crewlet-pin-tile__handle",
|
|
17
|
+
label: handleName,
|
|
18
|
+
icon: /* @__PURE__ */ jsx(GripVerticalGlyph, { size: "sm" }),
|
|
19
|
+
...handleRest
|
|
20
|
+
}
|
|
21
|
+
) : null,
|
|
22
|
+
leading ? /* @__PURE__ */ jsx("span", { className: "crewlet-pin-tile__leading", "aria-hidden": "true", children: leading }) : null,
|
|
23
|
+
/* @__PURE__ */ jsxs("span", { className: "crewlet-pin-tile__body", children: [
|
|
24
|
+
/* @__PURE__ */ jsxs("span", { className: "crewlet-pin-tile__head", children: [
|
|
25
|
+
/* @__PURE__ */ jsx("a", { className: "crewlet-pin-tile__link", href, children: title }),
|
|
26
|
+
status ? /* @__PURE__ */ jsx("span", { className: "crewlet-pin-tile__status", children: status }) : null
|
|
27
|
+
] }),
|
|
28
|
+
kind || meta ? /* @__PURE__ */ jsxs("span", { className: "crewlet-pin-tile__meta", children: [
|
|
29
|
+
kind ? /* @__PURE__ */ jsx("span", { className: "crewlet-pin-tile__kind", children: kind }) : null,
|
|
30
|
+
kind && meta ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: " \xB7 " }) : null,
|
|
31
|
+
meta
|
|
32
|
+
] }) : null
|
|
33
|
+
] }),
|
|
34
|
+
figure !== void 0 && figure !== null ? /* @__PURE__ */ jsx("span", { className: "crewlet-pin-tile__figure", children: figure }) : null,
|
|
35
|
+
onUnpin ? /* @__PURE__ */ jsx(
|
|
36
|
+
IconButton,
|
|
37
|
+
{
|
|
38
|
+
size: "sm",
|
|
39
|
+
variant: "ghost",
|
|
40
|
+
className: "crewlet-pin-tile__unpin",
|
|
41
|
+
label: `Unpin ${title}`,
|
|
42
|
+
icon: /* @__PURE__ */ jsx(PinGlyph, { size: "sm" }),
|
|
43
|
+
onClick: onUnpin
|
|
44
|
+
}
|
|
45
|
+
) : null
|
|
46
|
+
] });
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export { PinTile };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Skeleton } from './chunk-W5J7R5EB.js';
|
|
2
|
-
import { Modal } from './chunk-
|
|
2
|
+
import { Modal } from './chunk-7IJARUIF.js';
|
|
3
3
|
import { useListbox, useOptionKeys } from './chunk-F73MC7EZ.js';
|
|
4
|
-
import {
|
|
5
|
-
import { Input } from './chunk-4GB57WIT.js';
|
|
4
|
+
import { Input } from './chunk-Q55TXPA3.js';
|
|
6
5
|
import { Popover } from './chunk-BWRGFKJP.js';
|
|
7
|
-
import {
|
|
6
|
+
import { KeyChip, highlightMatch } from './chunk-FYTIJM2T.js';
|
|
8
7
|
import { useMediaMatch } from './chunk-IG75YMUN.js';
|
|
9
8
|
import { focusables, isComposing } from './chunk-R25RGPUB.js';
|
|
9
|
+
import { announce } from './chunk-RSAQOKH3.js';
|
|
10
10
|
import { VisuallyHidden } from './chunk-BZFWDIV6.js';
|
|
11
11
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
12
12
|
import './Switcher-B44Q4WF4.css';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Button } from './chunk-OG6CL3EB.js';
|
|
2
|
-
import {
|
|
2
|
+
import { HeadingLevelProvider } from './chunk-PQADV6P6.js';
|
|
3
3
|
import { useLayerContainer } from './chunk-HMPFGIWM.js';
|
|
4
4
|
import { focusables, useModalLayer, useBodyScrollLock } from './chunk-R25RGPUB.js';
|
|
5
|
-
import {
|
|
5
|
+
import { IconButton } from './chunk-4FQT6ZAY.js';
|
|
6
6
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
7
|
-
import './Modal-
|
|
7
|
+
import './Modal-XOSV6FAH.css';
|
|
8
8
|
import { useId, useRef, useCallback } from 'react';
|
|
9
9
|
import { createPortal } from 'react-dom';
|
|
10
|
-
import { XGlyph } from '@crewlethq/icons/glyphs';
|
|
10
|
+
import { ChevronLeftGlyph, XGlyph } from '@crewlethq/icons/glyphs';
|
|
11
11
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
12
12
|
|
|
13
13
|
function Modal({ open, ...rest }) {
|
|
@@ -35,6 +35,8 @@ function ModalFrame({
|
|
|
35
35
|
footer,
|
|
36
36
|
footerStart,
|
|
37
37
|
headerActions,
|
|
38
|
+
onBack,
|
|
39
|
+
backLabel = "Back",
|
|
38
40
|
children,
|
|
39
41
|
size = "sm",
|
|
40
42
|
variant = "dialog",
|
|
@@ -43,6 +45,7 @@ function ModalFrame({
|
|
|
43
45
|
role = "dialog",
|
|
44
46
|
dismissable = true,
|
|
45
47
|
closeOnBackdrop = true,
|
|
48
|
+
backdrop = "veil",
|
|
46
49
|
showCloseButton = true,
|
|
47
50
|
stackBody = false,
|
|
48
51
|
flush = false,
|
|
@@ -101,7 +104,16 @@ function ModalFrame({
|
|
|
101
104
|
};
|
|
102
105
|
const closes = banded && showCloseButton;
|
|
103
106
|
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
104
|
-
banded && (given(title) || given(subtitle) || given(headerActions) || closes) ? /* @__PURE__ */ jsxs("div", { className: cx("crewlet-modal__header", sheet ? "crewlet-modal__header--sheet" : void 0), children: [
|
|
107
|
+
banded && (given(title) || given(subtitle) || given(headerActions) || closes || onBack) ? /* @__PURE__ */ jsxs("div", { className: cx("crewlet-modal__header", sheet ? "crewlet-modal__header--sheet" : void 0), children: [
|
|
108
|
+
onBack ? /* @__PURE__ */ jsx(
|
|
109
|
+
IconButton,
|
|
110
|
+
{
|
|
111
|
+
className: "crewlet-modal__back",
|
|
112
|
+
label: backLabel,
|
|
113
|
+
icon: /* @__PURE__ */ jsx(ChevronLeftGlyph, { size: "md" }),
|
|
114
|
+
onClick: onBack
|
|
115
|
+
}
|
|
116
|
+
) : null,
|
|
105
117
|
given(icon) ? /* @__PURE__ */ jsx("span", { className: "crewlet-modal__icon", "aria-hidden": "true", children: icon }) : null,
|
|
106
118
|
/* @__PURE__ */ jsxs("div", { className: "crewlet-modal__heading", children: [
|
|
107
119
|
given(title) ? /* @__PURE__ */ jsx(
|
|
@@ -163,6 +175,7 @@ function ModalFrame({
|
|
|
163
175
|
"crewlet-modal-overlay",
|
|
164
176
|
`crewlet-modal-overlay--${variant}`,
|
|
165
177
|
`crewlet-modal-overlay--${place}`,
|
|
178
|
+
backdrop === "clear" && "crewlet-modal-overlay--clear",
|
|
166
179
|
// Fixed against the window, absolute inside a LayerHost: a fullscreen
|
|
167
180
|
// container paints only its own subtree, so a surface drawn there
|
|
168
181
|
// covers the container rather than a viewport it cannot reach.
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { Switch } from './chunk-A722MUNR.js';
|
|
2
|
+
import { useReorder } from './chunk-XJ2QEBMM.js';
|
|
3
|
+
import { Checkbox } from './chunk-I6NZKJGK.js';
|
|
4
|
+
import { IconButton } from './chunk-4FQT6ZAY.js';
|
|
5
|
+
import { VisuallyHidden } from './chunk-BZFWDIV6.js';
|
|
6
|
+
import { cx } from './chunk-ODEQTPFM.js';
|
|
7
|
+
import './ArrangeList-NNRTDFI5.css';
|
|
8
|
+
import { GripVerticalGlyph, ChevronUpGlyph, ChevronDownGlyph } from '@crewlethq/icons/glyphs';
|
|
9
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
10
|
+
|
|
11
|
+
var DEFAULT_ARRANGE_LABELS = {
|
|
12
|
+
handle: (name) => `Move ${name}`,
|
|
13
|
+
hint: "Drag to move, or press the up or down arrow key.",
|
|
14
|
+
moved: (name, position, total) => `${name} moved to position ${position} of ${total}.`,
|
|
15
|
+
moveUp: (name) => `Move ${name} up`,
|
|
16
|
+
moveDown: (name) => `Move ${name} down`,
|
|
17
|
+
atTop: (name) => `${name} is first.`,
|
|
18
|
+
atBottom: (name) => `${name} is last.`
|
|
19
|
+
};
|
|
20
|
+
function ArrangeList({
|
|
21
|
+
label,
|
|
22
|
+
items,
|
|
23
|
+
onReorder,
|
|
24
|
+
onShownChange,
|
|
25
|
+
toggle = "switch",
|
|
26
|
+
moveButtons = true,
|
|
27
|
+
labels: overrides,
|
|
28
|
+
className
|
|
29
|
+
}) {
|
|
30
|
+
const labels = { ...DEFAULT_ARRANGE_LABELS, ...overrides };
|
|
31
|
+
const byKey = new Map(items.map((item) => [item.key, item]));
|
|
32
|
+
const nameOf = (key) => byKey.get(key)?.label ?? key;
|
|
33
|
+
const reorder = useReorder({
|
|
34
|
+
keys: items.map((item) => item.key),
|
|
35
|
+
onReorder,
|
|
36
|
+
nameOf,
|
|
37
|
+
labels
|
|
38
|
+
});
|
|
39
|
+
const last = reorder.order.length - 1;
|
|
40
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
41
|
+
/* @__PURE__ */ jsx(VisuallyHidden, { id: reorder.hintId, children: reorder.hint }),
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
"ul",
|
|
44
|
+
{
|
|
45
|
+
className: cx("crewlet-arrange-list", className),
|
|
46
|
+
"aria-label": label,
|
|
47
|
+
...reorder.containerProps,
|
|
48
|
+
children: reorder.order.map((key, index) => {
|
|
49
|
+
const item = byKey.get(key);
|
|
50
|
+
if (!item) return null;
|
|
51
|
+
const { "aria-label": handleName, ...handle } = reorder.handleProps(key);
|
|
52
|
+
const fixed = item.fixed !== void 0 && item.shown ? item.fixed : void 0;
|
|
53
|
+
const Toggle = toggle === "switch" ? Switch : Checkbox;
|
|
54
|
+
return /* @__PURE__ */ jsxs(
|
|
55
|
+
"li",
|
|
56
|
+
{
|
|
57
|
+
className: cx("crewlet-arrange-list__item", !item.shown && "is-off"),
|
|
58
|
+
...reorder.itemProps(key),
|
|
59
|
+
children: [
|
|
60
|
+
/* @__PURE__ */ jsx(
|
|
61
|
+
IconButton,
|
|
62
|
+
{
|
|
63
|
+
size: "sm",
|
|
64
|
+
variant: "ghost",
|
|
65
|
+
className: "crewlet-arrange-list__handle",
|
|
66
|
+
label: handleName,
|
|
67
|
+
icon: /* @__PURE__ */ jsx(GripVerticalGlyph, { size: "md" }),
|
|
68
|
+
...handle
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ jsx(
|
|
72
|
+
Toggle,
|
|
73
|
+
{
|
|
74
|
+
className: "crewlet-arrange-list__toggle",
|
|
75
|
+
label: item.icon ? /* @__PURE__ */ jsxs("span", { className: "crewlet-arrange-list__label", children: [
|
|
76
|
+
/* @__PURE__ */ jsx("span", { className: "crewlet-arrange-list__icon", "aria-hidden": "true", children: item.icon }),
|
|
77
|
+
item.label
|
|
78
|
+
] }) : item.label,
|
|
79
|
+
description: fixed ?? item.description,
|
|
80
|
+
checked: item.shown,
|
|
81
|
+
...fixed ? { "aria-disabled": true } : {},
|
|
82
|
+
onChange: (event) => {
|
|
83
|
+
if (fixed) {
|
|
84
|
+
event.preventDefault();
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
onShownChange(key, event.target.checked);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
item.trailing ? /* @__PURE__ */ jsx("span", { className: "crewlet-arrange-list__trailing", children: item.trailing }) : null,
|
|
92
|
+
moveButtons ? /* @__PURE__ */ jsxs("span", { className: "crewlet-arrange-list__moves", children: [
|
|
93
|
+
/* @__PURE__ */ jsx(
|
|
94
|
+
IconButton,
|
|
95
|
+
{
|
|
96
|
+
size: "sm",
|
|
97
|
+
variant: "ghost",
|
|
98
|
+
label: labels.moveUp(item.label),
|
|
99
|
+
icon: /* @__PURE__ */ jsx(ChevronUpGlyph, { size: "sm" }),
|
|
100
|
+
...index === 0 ? { disabledReason: labels.atTop(item.label) } : {},
|
|
101
|
+
onClick: () => reorder.move(key, -1)
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
/* @__PURE__ */ jsx(
|
|
105
|
+
IconButton,
|
|
106
|
+
{
|
|
107
|
+
size: "sm",
|
|
108
|
+
variant: "ghost",
|
|
109
|
+
label: labels.moveDown(item.label),
|
|
110
|
+
icon: /* @__PURE__ */ jsx(ChevronDownGlyph, { size: "sm" }),
|
|
111
|
+
...index === last ? { disabledReason: labels.atBottom(item.label) } : {},
|
|
112
|
+
onClick: () => reorder.move(key, 1)
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
] }) : null
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
key
|
|
119
|
+
);
|
|
120
|
+
})
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
] });
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export { ArrangeList, DEFAULT_ARRANGE_LABELS };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Menu } from './chunk-
|
|
2
|
-
import { Modal } from './chunk-2TZATTIU.js';
|
|
3
|
-
import { Checkbox } from './chunk-75CLJNDQ.js';
|
|
1
|
+
import { Menu } from './chunk-JULMZNGT.js';
|
|
4
2
|
import { useClipboard } from './chunk-STJ7QBC3.js';
|
|
3
|
+
import { Modal } from './chunk-7IJARUIF.js';
|
|
5
4
|
import { Button } from './chunk-OG6CL3EB.js';
|
|
6
|
-
import {
|
|
5
|
+
import { Checkbox } from './chunk-I6NZKJGK.js';
|
|
7
6
|
import { EmptyValue } from './chunk-EUCC37WY.js';
|
|
8
7
|
import { useCardHeaderSlot } from './chunk-AV2DXAEL.js';
|
|
8
|
+
import { IconButton } from './chunk-4FQT6ZAY.js';
|
|
9
9
|
import { VisuallyHidden } from './chunk-BZFWDIV6.js';
|
|
10
10
|
import { cx } from './chunk-ODEQTPFM.js';
|
|
11
11
|
import './DataTable-WZK3V62B.css';
|