@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.
Files changed (124) hide show
  1. package/README.md +19 -2
  2. package/dist/AccessDeniedCard/index.js +2 -2
  3. package/dist/AppShell/index.js +2 -2
  4. package/dist/ArrangeBoard/ArrangeBoard.d.ts +32 -0
  5. package/dist/ArrangeBoard/index.d.ts +3 -0
  6. package/dist/ArrangeBoard/index.js +2 -0
  7. package/dist/ArrangeBoard-MQE35P6Z.css +80 -0
  8. package/dist/ArrangeFrame/ArrangeFrame.d.ts +82 -0
  9. package/dist/ArrangeFrame/index.d.ts +5 -0
  10. package/dist/ArrangeFrame/index.js +5 -0
  11. package/dist/ArrangeFrame/useGridResize.d.ts +66 -0
  12. package/dist/ArrangeFrame-3PLZAG22.css +329 -0
  13. package/dist/ArrangeGroup/ArrangeGroup.d.ts +42 -0
  14. package/dist/ArrangeGroup/index.d.ts +3 -0
  15. package/dist/ArrangeGroup/index.js +4 -0
  16. package/dist/ArrangeGroup-SHFHA7BE.css +170 -0
  17. package/dist/ArrangeList/ArrangeList.d.ts +64 -0
  18. package/dist/ArrangeList/index.d.ts +3 -0
  19. package/dist/ArrangeList/index.js +10 -0
  20. package/dist/ArrangeList-NNRTDFI5.css +94 -0
  21. package/dist/ArtifactCard/index.js +2 -2
  22. package/dist/AuthLayout/index.js +2 -2
  23. package/dist/AvatarPicker/index.js +4 -4
  24. package/dist/Canvas/index.js +2 -2
  25. package/dist/Card/index.js +1 -1
  26. package/dist/Checkbox/index.js +3 -3
  27. package/dist/Combobox/index.js +4 -4
  28. package/dist/CommandPalette/index.js +6 -6
  29. package/dist/Composer/index.js +3 -3
  30. package/dist/ConfirmField/index.js +3 -3
  31. package/dist/DataTable/index.js +8 -8
  32. package/dist/DataView/index.js +13 -13
  33. package/dist/DateTimePicker/index.js +3 -3
  34. package/dist/Divider/Divider.d.ts +15 -0
  35. package/dist/Divider/index.d.ts +3 -0
  36. package/dist/Divider/index.js +2 -0
  37. package/dist/Divider-3Z77ZAJH.css +37 -0
  38. package/dist/HuePicker/HuePicker.d.ts +16 -4
  39. package/dist/HuePicker/index.js +2 -2
  40. package/dist/{HuePicker-5QIUR6L7.css → HuePicker-PAIGH6LR.css} +6 -0
  41. package/dist/IconTile/IconTile.d.ts +23 -0
  42. package/dist/IconTile/index.d.ts +3 -0
  43. package/dist/IconTile/index.js +2 -0
  44. package/dist/IconTile-4GNWTLAW.css +30 -0
  45. package/dist/Input/index.js +2 -2
  46. package/dist/LinkInterstitial/index.js +4 -4
  47. package/dist/ListInput/index.js +5 -5
  48. package/dist/MarkdownEditor/index.js +2 -2
  49. package/dist/Menu/index.js +2 -2
  50. package/dist/Modal/Modal.d.ts +20 -0
  51. package/dist/Modal/index.js +3 -3
  52. package/dist/{Modal-RQAYGG4L.css → Modal-XOSV6FAH.css} +14 -0
  53. package/dist/Note/Note.d.ts +23 -0
  54. package/dist/Note/index.d.ts +3 -0
  55. package/dist/Note/index.js +2 -0
  56. package/dist/Note-RT4L6VUT.css +58 -0
  57. package/dist/OrgTable/index.js +5 -5
  58. package/dist/PinTile/PinTile.d.ts +37 -0
  59. package/dist/PinTile/index.d.ts +3 -0
  60. package/dist/PinTile/index.js +4 -0
  61. package/dist/PinTile-IIA25MNZ.css +141 -0
  62. package/dist/PresenceStack/index.js +1 -1
  63. package/dist/PrincipalPicker/index.js +5 -5
  64. package/dist/Reorder/index.d.ts +2 -0
  65. package/dist/Reorder/index.js +4 -0
  66. package/dist/Reorder/useReorder.d.ts +138 -0
  67. package/dist/ShareDialog/index.js +7 -7
  68. package/dist/SheetGrid/index.js +4 -4
  69. package/dist/StatGroup/StatGroup.d.ts +7 -1
  70. package/dist/StatGroup/index.js +1 -1
  71. package/dist/{StatGroup-HVG6O62W.css → StatGroup-PADTJCUQ.css} +7 -0
  72. package/dist/Switcher/index.js +8 -8
  73. package/dist/TagsInput/index.js +3 -3
  74. package/dist/TimeWindowPicker/index.js +5 -5
  75. package/dist/TreeCanvas/index.js +3 -3
  76. package/dist/TreeGrid/index.js +2 -2
  77. package/dist/chunk-35XVR5JQ.js +81 -0
  78. package/dist/chunk-63WJLRB2.js +24 -0
  79. package/dist/{chunk-L4ZLXYPO.js → chunk-6A7P6II6.js} +1 -1
  80. package/dist/chunk-6KWNXIDE.js +18 -0
  81. package/dist/chunk-6MIXD6IW.js +49 -0
  82. package/dist/{chunk-NZY77ZDU.js → chunk-7FQEUNHX.js} +4 -4
  83. package/dist/{chunk-2TZATTIU.js → chunk-7IJARUIF.js} +18 -5
  84. package/dist/chunk-AIVZVKYZ.js +126 -0
  85. package/dist/{chunk-76FXDZAZ.js → chunk-AJESMWJS.js} +4 -4
  86. package/dist/chunk-DEJHAOC5.js +279 -0
  87. package/dist/{chunk-ERV5BUS3.js → chunk-EIGEIT4O.js} +3 -3
  88. package/dist/chunk-FFMCMSJB.js +1 -0
  89. package/dist/{chunk-LFZ45HV2.js → chunk-G3EEUNZQ.js} +1 -1
  90. package/dist/{chunk-2YR5ZPQ3.js → chunk-HTCJSUIZ.js} +3 -3
  91. package/dist/{chunk-75CLJNDQ.js → chunk-I6NZKJGK.js} +1 -1
  92. package/dist/chunk-IXJHTFXG.js +17 -0
  93. package/dist/{chunk-3UAA4IWJ.js → chunk-JEDWC3GI.js} +1 -1
  94. package/dist/{chunk-QVAFL2LE.js → chunk-JXRI5YD2.js} +3 -3
  95. package/dist/{chunk-ZFH7H7GS.js → chunk-LOLELDBW.js} +1 -1
  96. package/dist/{chunk-KVT3TJVG.js → chunk-OIMAK5AE.js} +6 -6
  97. package/dist/chunk-QO7QEQKV.js +24 -0
  98. package/dist/{chunk-A7EBCHEG.js → chunk-RT323I4I.js} +1 -1
  99. package/dist/{chunk-BOW2VUCH.js → chunk-T7ICFXEC.js} +1 -1
  100. package/dist/{chunk-2OLCUNG7.js → chunk-TBIZSQHB.js} +1 -1
  101. package/dist/{chunk-4U3GQ7D2.js → chunk-TODND5AD.js} +1 -1
  102. package/dist/{chunk-IFKBDRNJ.js → chunk-UXELEORU.js} +3 -3
  103. package/dist/{chunk-6NIMZ5XC.js → chunk-VJLYGPPE.js} +1 -1
  104. package/dist/{chunk-7QFAORCY.js → chunk-WHZFDS62.js} +1 -1
  105. package/dist/chunk-XJ2QEBMM.js +277 -0
  106. package/dist/{chunk-PA4CYTBY.js → chunk-XU4ZUGLE.js} +19 -4
  107. package/dist/{chunk-T3ZWBZ65.js → chunk-YSJYWQSP.js} +2 -2
  108. package/dist/{chunk-CXBAIVYZ.js → chunk-YSY6UJ4F.js} +1 -1
  109. package/dist/{chunk-EG6NYWVK.js → chunk-YZCJ63JF.js} +1 -1
  110. package/dist/generated/index.d.ts +9 -0
  111. package/dist/generated/index.js +80 -71
  112. package/dist/index.js +80 -71
  113. package/dist/styles.css +993 -3
  114. package/package.json +3 -3
  115. package/dist/chunk-EXHQ2QVW.js +0 -1
  116. package/dist/{chunk-ESKP3TXM.js → chunk-4Z7PW3L6.js} +0 -0
  117. package/dist/{chunk-AQCV62K6.js → chunk-7ZNKEPLN.js} +1 -1
  118. package/dist/{chunk-OYOQU7O5.js → chunk-EDGCPVVD.js} +1 -1
  119. package/dist/{chunk-NS7BVLL3.js → chunk-JULMZNGT.js} +1 -1
  120. package/dist/{chunk-5NVKTB6E.js → chunk-L4H7SSWF.js} +1 -1
  121. package/dist/{chunk-FYXRWBJJ.js → chunk-PUQY4WXR.js} +2 -2
  122. package/dist/{chunk-4GB57WIT.js → chunk-Q55TXPA3.js} +1 -1
  123. package/dist/{chunk-B2Z2CDM5.js → chunk-T5TFZ2JB.js} +1 -1
  124. 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 };
@@ -1,4 +1,4 @@
1
- import { TreeGrid } from './chunk-B2Z2CDM5.js';
1
+ import { TreeGrid } from './chunk-T5TFZ2JB.js';
2
2
  import { createTreeModel, treeParent } from './chunk-MY374UUD.js';
3
3
  import { OrgLabel } from './chunk-AKEZ3G5V.js';
4
4
  import { AddPill } from './chunk-TROLVEZY.js';
@@ -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-2TZATTIU.js';
2
+ import { Modal } from './chunk-7IJARUIF.js';
3
3
  import { useListbox, useOptionKeys } from './chunk-F73MC7EZ.js';
4
- import { KeyChip, highlightMatch } from './chunk-FYTIJM2T.js';
5
- import { Input } from './chunk-4GB57WIT.js';
4
+ import { Input } from './chunk-Q55TXPA3.js';
6
5
  import { Popover } from './chunk-BWRGFKJP.js';
7
- import { announce } from './chunk-RSAQOKH3.js';
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 { IconButton } from './chunk-4FQT6ZAY.js';
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 { HeadingLevelProvider } from './chunk-PQADV6P6.js';
5
+ import { IconButton } from './chunk-4FQT6ZAY.js';
6
6
  import { cx } from './chunk-ODEQTPFM.js';
7
- import './Modal-RQAYGG4L.css';
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-NS7BVLL3.js';
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 { IconButton } from './chunk-4FQT6ZAY.js';
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';