@gemologic/sheen 0.2.0 → 0.3.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 +1 -1
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/ai.d.ts +8 -0
- package/dist/ai.js +5 -0
- package/dist/core.d.ts +11 -4
- package/dist/core.js +32 -28
- package/dist/formisch.js +1 -2
- package/dist/forms.d.ts +2 -0
- package/dist/forms.js +16 -15
- package/dist/index.d.ts +25 -5
- package/dist/index.js +86 -76
- package/dist/layout/Layout.js +1 -2
- package/dist/metadata.js +1 -2
- package/dist/navigation.d.ts +2 -1
- package/dist/navigation.js +16 -16
- package/dist/primitives/Accordion.js +9 -9
- package/dist/primitives/ActivityTimeline.js +57 -49
- package/dist/primitives/AlertDialog.js +1 -2
- package/dist/primitives/Avatar.js +16 -17
- package/dist/primitives/Board.d.ts +39 -0
- package/dist/primitives/Board.js +471 -0
- package/dist/primitives/Breadcrumb.js +1 -2
- package/dist/primitives/Button.js +38 -27
- package/dist/primitives/ButtonGroup.js +1 -2
- package/dist/primitives/Checkbox.js +1 -2
- package/dist/primitives/CheckboxGroup.js +11 -12
- package/dist/primitives/Collapsible.js +6 -6
- package/dist/primitives/Combobox.js +203 -201
- package/dist/primitives/CommandPalette.js +2 -4
- package/dist/primitives/ConfirmDialog.js +5 -6
- package/dist/primitives/ContextMenu.js +7 -8
- package/dist/primitives/Conversation.d.ts +17 -0
- package/dist/primitives/Conversation.js +107 -0
- package/dist/primitives/DescriptionList.js +1 -2
- package/dist/primitives/Dialog.js +101 -68
- package/dist/primitives/Drawer.js +12 -13
- package/dist/primitives/DropdownMenu.js +163 -157
- package/dist/primitives/EditableTextField.js +3 -8
- package/dist/primitives/EmptyState.js +1 -2
- package/dist/primitives/Field.js +1 -2
- package/dist/primitives/FileDropzone.js +19 -18
- package/dist/primitives/Form.d.ts +23 -0
- package/dist/primitives/Form.js +76 -0
- package/dist/primitives/Glyph.d.ts +40 -0
- package/dist/primitives/Glyph.js +65 -0
- package/dist/primitives/IconButton.js +5 -6
- package/dist/primitives/Input.js +1 -2
- package/dist/primitives/InputGroup.js +8 -9
- package/dist/primitives/Link.d.ts +9 -1
- package/dist/primitives/Link.js +23 -17
- package/dist/primitives/LinkTooltip.js +6 -7
- package/dist/primitives/List.d.ts +34 -0
- package/dist/primitives/List.js +135 -0
- package/dist/primitives/Message.d.ts +13 -0
- package/dist/primitives/Message.js +75 -0
- package/dist/primitives/NavList.js +15 -16
- package/dist/primitives/Notice.d.ts +15 -1
- package/dist/primitives/Notice.js +91 -43
- package/dist/primitives/NumberField.js +81 -81
- package/dist/primitives/NumberText.d.ts +4 -0
- package/dist/primitives/NumberText.js +50 -25
- package/dist/primitives/Pagination.js +81 -60
- package/dist/primitives/Popover.js +57 -57
- package/dist/primitives/Progress.js +1 -2
- package/dist/primitives/PromptInput.d.ts +23 -0
- package/dist/primitives/PromptInput.js +135 -0
- package/dist/primitives/RadioGroup.js +12 -17
- package/dist/primitives/Resizable.js +1 -2
- package/dist/primitives/ScrollArea.js +1 -2
- package/dist/primitives/SearchInput.js +45 -38
- package/dist/primitives/SegmentedControl.d.ts +2 -0
- package/dist/primitives/SegmentedControl.js +92 -78
- package/dist/primitives/Select.js +105 -100
- package/dist/primitives/Separator.js +1 -2
- package/dist/primitives/ShortcutPending.js +11 -12
- package/dist/primitives/ShortcutProvider.d.ts +5 -0
- package/dist/primitives/ShortcutProvider.js +71 -65
- package/dist/primitives/ShortcutScope.js +8 -9
- package/dist/primitives/ShortcutSheet.js +30 -24
- package/dist/primitives/Skeleton.js +1 -2
- package/dist/primitives/Slider.js +1 -2
- package/dist/primitives/SortableList.d.ts +19 -0
- package/dist/primitives/SortableList.js +235 -0
- package/dist/primitives/Spinner.js +1 -2
- package/dist/primitives/Status.js +14 -14
- package/dist/primitives/Stepper.js +54 -52
- package/dist/primitives/StreamingText.d.ts +12 -0
- package/dist/primitives/StreamingText.js +42 -0
- package/dist/primitives/Surface.js +1 -2
- package/dist/primitives/Switch.js +1 -2
- package/dist/primitives/Table.js +1 -2
- package/dist/primitives/Tabs.js +20 -17
- package/dist/primitives/TagInput.js +6 -9
- package/dist/primitives/Textarea.js +37 -63
- package/dist/primitives/Toast.js +42 -41
- package/dist/primitives/Toaster.js +27 -28
- package/dist/primitives/Tooltip.js +32 -32
- package/dist/primitives/Tree.js +1 -2
- package/dist/primitives/Typography.d.ts +6 -2
- package/dist/primitives/Typography.js +20 -12
- package/dist/primitives/boolean-input-state.js +3 -8
- package/dist/primitives/button-variants.js +2 -3
- package/dist/primitives/choice-options.js +1 -2
- package/dist/primitives/create-confirm.js +1 -2
- package/dist/primitives/create-toaster.js +1 -2
- package/dist/primitives/link-focus.js +1 -2
- package/dist/primitives/menu-focus.js +1 -2
- package/dist/primitives/sortable-core.d.ts +70 -0
- package/dist/primitives/sortable-core.js +109 -0
- package/dist/primitives/sortable-drag.d.ts +29 -0
- package/dist/primitives/sortable-drag.js +50 -0
- package/dist/primitives/tooltip-layer.js +26 -27
- package/dist/sortable.d.ts +6 -0
- package/dist/sortable.js +4 -0
- package/dist/theme/ThemeProvider.d.ts +6 -1
- package/dist/theme/ThemeProvider.js +65 -58
- package/dist/theme/intl.js +1 -2
- package/dist/theme/keyboard-script.js +1 -2
- package/dist/theme/layers.js +1 -2
- package/dist/theme/messages.d.ts +26 -0
- package/dist/theme/messages.js +9 -2
- package/dist/theme/number-format-cache.js +1 -2
- package/dist/theme/script.d.ts +1 -0
- package/dist/theme/script.js +3 -3
- package/dist/theme/state.d.ts +4 -4
- package/dist/theme/state.js +12 -13
- package/dist/utils/auto-resize.d.ts +6 -0
- package/dist/utils/auto-resize.js +31 -0
- package/dist/utils/browser-status.js +1 -2
- package/dist/utils/change-motion.d.ts +8 -0
- package/dist/utils/change-motion.js +19 -0
- package/dist/utils/cn.js +1 -2
- package/dist/utils/media-query.d.ts +10 -0
- package/dist/utils/media-query.js +16 -0
- package/dist/utils/optimistic.js +1 -2
- package/dist/utils/shortcut-platform.js +1 -2
- package/dist/utils/shortcut-registry.d.ts +5 -0
- package/dist/utils/shortcut-registry.js +61 -51
- package/dist/vite.js +3 -4
- package/package.json +23 -5
- package/src/ai.ts +8 -0
- package/src/core.ts +11 -4
- package/src/forms.ts +2 -0
- package/src/index.ts +25 -5
- package/src/navigation.ts +2 -1
- package/src/primitives/Accordion.tsx +1 -1
- package/src/primitives/ActivityTimeline.tsx +12 -7
- package/src/primitives/Board.tsx +406 -0
- package/src/primitives/Button.tsx +15 -4
- package/src/primitives/Collapsible.tsx +1 -1
- package/src/primitives/Combobox.tsx +2 -1
- package/src/primitives/CommandPalette.tsx +2 -2
- package/src/primitives/Conversation.tsx +108 -0
- package/src/primitives/Dialog.tsx +5 -1
- package/src/primitives/DropdownMenu.tsx +12 -6
- package/src/primitives/FileDropzone.tsx +2 -2
- package/src/primitives/Form.tsx +58 -0
- package/src/primitives/Glyph.tsx +55 -0
- package/src/primitives/Link.tsx +15 -6
- package/src/primitives/List.tsx +68 -0
- package/src/primitives/Message.tsx +40 -0
- package/src/primitives/Notice.tsx +45 -12
- package/src/primitives/NumberField.tsx +3 -2
- package/src/primitives/NumberText.tsx +31 -4
- package/src/primitives/Pagination.tsx +6 -5
- package/src/primitives/Popover.tsx +2 -1
- package/src/primitives/PromptInput.tsx +116 -0
- package/src/primitives/SearchInput.tsx +4 -3
- package/src/primitives/SegmentedControl.tsx +29 -4
- package/src/primitives/Select.tsx +3 -2
- package/src/primitives/ShortcutProvider.tsx +14 -1
- package/src/primitives/ShortcutSheet.tsx +1 -1
- package/src/primitives/SortableList.tsx +208 -0
- package/src/primitives/Status.tsx +1 -1
- package/src/primitives/Stepper.tsx +7 -7
- package/src/primitives/StreamingText.tsx +32 -0
- package/src/primitives/Tabs.tsx +2 -1
- package/src/primitives/TagInput.tsx +1 -1
- package/src/primitives/Textarea.tsx +3 -47
- package/src/primitives/Toast.tsx +2 -1
- package/src/primitives/Tooltip.tsx +4 -2
- package/src/primitives/Typography.tsx +11 -2
- package/src/primitives/button-variants.ts +1 -1
- package/src/primitives/sortable-core.ts +139 -0
- package/src/primitives/sortable-drag.ts +75 -0
- package/src/sortable.ts +6 -0
- package/src/styles/ai.css +57 -0
- package/src/styles/core.css +321 -0
- package/src/styles/forms.css +261 -0
- package/src/styles/navigation.css +137 -0
- package/src/styles/overlays.css +104 -0
- package/src/styles/sortable.css +87 -0
- package/src/styles.css +5 -658
- package/src/theme/ThemeProvider.tsx +20 -8
- package/src/theme/messages.ts +20 -1
- package/src/theme/script.ts +2 -2
- package/src/theme/state.ts +5 -5
- package/src/utils/auto-resize.ts +58 -0
- package/src/utils/change-motion.ts +28 -0
- package/src/utils/media-query.ts +26 -0
- package/src/utils/shortcut-registry.ts +19 -2
- package/src/vite.ts +3 -3
- package/vendor/integrity.json +13 -13
- package/vendor/kobalte-core/chunk/3D6FM2PJ.js +7 -1
- package/vendor/kobalte-core/chunk/G3KI2B4X.js +2 -1
- package/vendor/kobalte-core/chunk/KEL2LLJM.jsx +2 -1
- package/vendor/kobalte-core/chunk/RFN6X5VH.jsx +7 -1
- package/vendor/origins.json +4 -4
- package/vendor/solid-web/dev.cjs +21 -17
- package/vendor/solid-web/dev.js +21 -17
- package/vendor/solid-web/server.cjs +1 -1
- package/vendor/solid-web/server.js +1 -1
- package/vendor/solid-web/web.cjs +21 -17
- package/vendor/solid-web/web.js +21 -17
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { Glyph as e } from "./Glyph.js";
|
|
2
|
+
import { useTheme as t } from "../theme/ThemeProvider.js";
|
|
3
|
+
import { cn as n } from "../utils/cn.js";
|
|
4
|
+
import { createComponent as r, effect as i, insert as a, memo as o, mergeProps as s, setAttribute as c, spread as l, template as u, use as d } from "solid-js/web";
|
|
5
|
+
import { For as f, Show as p, createMemo as m, splitProps as h } from "solid-js";
|
|
6
|
+
// src/primitives/ActivityTimeline.tsx
|
|
7
|
+
var g = /*#__PURE__*/ u("<ol>"), _ = /*#__PURE__*/ u("<time>"), v = /*#__PURE__*/ u("<div class=sheen-activity-timeline-meta>"), y = /*#__PURE__*/ u("<li class=sheen-activity-timeline-item><span class=sheen-workflow-marker aria-hidden=true></span><article class=sheen-activity-timeline-content><header><strong></strong><span class=sheen-workflow-state>"), b = /*#__PURE__*/ u("<p>"), x = /*#__PURE__*/ u("<span class=sheen-activity-timeline-actor>");
|
|
8
|
+
function S(e, t) {
|
|
8
9
|
return e === "completed" ? t.workflowCompleted : e === "current" ? t.workflowCurrent : e === "error" ? t.workflowError : t.workflowUpcoming;
|
|
9
10
|
}
|
|
10
|
-
function
|
|
11
|
-
return
|
|
11
|
+
function C(t) {
|
|
12
|
+
return t === "completed" ? r(e, { name: "check" }) : t === "current" ? r(e, { name: "dot" }) : t === "error" ? r(e, { name: "alert" }) : "";
|
|
12
13
|
}
|
|
13
|
-
function
|
|
14
|
-
let
|
|
14
|
+
function w(e) {
|
|
15
|
+
let u = t(), [w, T] = h(e, [
|
|
15
16
|
"ref",
|
|
16
17
|
"class",
|
|
17
18
|
"label",
|
|
@@ -19,9 +20,9 @@ function S(l) {
|
|
|
19
20
|
"density",
|
|
20
21
|
"refreshing",
|
|
21
22
|
"aria-label"
|
|
22
|
-
]),
|
|
23
|
+
]), E = m(() => {
|
|
23
24
|
let e = /* @__PURE__ */ new Map();
|
|
24
|
-
for (let t of
|
|
25
|
+
for (let t of w.items) {
|
|
25
26
|
if (!t.id.trim()) throw Error("ActivityTimeline: item IDs must be nonempty");
|
|
26
27
|
if (e.has(t.id)) throw Error(`ActivityTimeline: duplicate item ID ${JSON.stringify(t.id)}`);
|
|
27
28
|
if (!t.title.trim()) throw Error(`ActivityTimeline: title must be nonempty for ${JSON.stringify(t.id)}`);
|
|
@@ -29,76 +30,83 @@ function S(l) {
|
|
|
29
30
|
e.set(t.id, t);
|
|
30
31
|
}
|
|
31
32
|
return e;
|
|
32
|
-
}),
|
|
33
|
+
}), D = m(() => [...E().keys()]);
|
|
33
34
|
return (() => {
|
|
34
|
-
var e =
|
|
35
|
-
return
|
|
36
|
-
typeof
|
|
37
|
-
}, e),
|
|
35
|
+
var e = g();
|
|
36
|
+
return d((e) => {
|
|
37
|
+
typeof w.ref == "function" && w.ref(e);
|
|
38
|
+
}, e), l(e, s(T, {
|
|
38
39
|
get class() {
|
|
39
|
-
return
|
|
40
|
+
return n("sheen-activity-timeline", w.class);
|
|
40
41
|
},
|
|
41
42
|
get "aria-label"() {
|
|
42
|
-
return
|
|
43
|
+
return w["aria-label"] ?? w.label;
|
|
43
44
|
},
|
|
44
45
|
get "aria-busy"() {
|
|
45
|
-
return
|
|
46
|
+
return w.refreshing || void 0;
|
|
46
47
|
},
|
|
47
48
|
get "data-density"() {
|
|
48
|
-
return
|
|
49
|
+
return w.density ?? "default";
|
|
49
50
|
},
|
|
50
51
|
get "data-refreshing"() {
|
|
51
|
-
return
|
|
52
|
+
return w.refreshing || void 0;
|
|
52
53
|
}
|
|
53
|
-
}), !1, !0),
|
|
54
|
+
}), !1, !0), a(e, r(f, {
|
|
54
55
|
get each() {
|
|
55
|
-
return
|
|
56
|
+
return D();
|
|
56
57
|
},
|
|
57
58
|
children: (e) => {
|
|
58
|
-
let t = () =>
|
|
59
|
-
return
|
|
59
|
+
let t = () => E().get(e);
|
|
60
|
+
return r(p, {
|
|
60
61
|
get when() {
|
|
61
62
|
return t();
|
|
62
63
|
},
|
|
63
64
|
children: (t) => (() => {
|
|
64
|
-
var
|
|
65
|
-
return
|
|
65
|
+
var n = y(), s = n.firstChild, l = s.nextSibling, d = l.firstChild.firstChild, f = d.nextSibling;
|
|
66
|
+
return c(n, "data-activity-id", e), a(s, () => C(t().state)), a(d, () => t().title), a(f, () => S(t().state, u.messages())), a(l, r(p, {
|
|
66
67
|
get when() {
|
|
67
68
|
return t().description;
|
|
68
69
|
},
|
|
69
70
|
children: (e) => (() => {
|
|
70
|
-
var t =
|
|
71
|
-
return
|
|
71
|
+
var t = b();
|
|
72
|
+
return a(t, e), t;
|
|
72
73
|
})()
|
|
73
|
-
}), null),
|
|
74
|
+
}), null), a(l, r(p, {
|
|
74
75
|
get when() {
|
|
75
|
-
return t().actor;
|
|
76
|
-
},
|
|
77
|
-
children: (e) => (() => {
|
|
78
|
-
var t = y();
|
|
79
|
-
return i(t, e), t;
|
|
80
|
-
})()
|
|
81
|
-
}), null), i(l, n(f, {
|
|
82
|
-
get when() {
|
|
83
|
-
return a(() => !!t().timestamp)() && t().timeLabel;
|
|
76
|
+
return t().actor || t().timestamp && t().timeLabel;
|
|
84
77
|
},
|
|
85
78
|
get children() {
|
|
86
|
-
var e =
|
|
87
|
-
return
|
|
79
|
+
var e = v();
|
|
80
|
+
return a(e, r(p, {
|
|
81
|
+
get when() {
|
|
82
|
+
return t().actor;
|
|
83
|
+
},
|
|
84
|
+
children: (e) => (() => {
|
|
85
|
+
var t = x();
|
|
86
|
+
return a(t, e), t;
|
|
87
|
+
})()
|
|
88
|
+
}), null), a(e, r(p, {
|
|
89
|
+
get when() {
|
|
90
|
+
return o(() => !!t().timestamp)() && t().timeLabel;
|
|
91
|
+
},
|
|
92
|
+
get children() {
|
|
93
|
+
var e = _();
|
|
94
|
+
return a(e, () => t().timeLabel), i(() => c(e, "datetime", t().timestamp)), e;
|
|
95
|
+
}
|
|
96
|
+
}), null), e;
|
|
88
97
|
}
|
|
89
|
-
}), null),
|
|
90
|
-
var
|
|
91
|
-
return
|
|
98
|
+
}), null), i((e) => {
|
|
99
|
+
var r = t().state, i = t().state === "current" ? "true" : void 0, a = t().state;
|
|
100
|
+
return r !== e.e && c(n, "data-state", e.e = r), i !== e.t && c(n, "aria-current", e.t = i), a !== e.a && c(s, "data-state", e.a = a), e;
|
|
92
101
|
}, {
|
|
93
102
|
e: void 0,
|
|
94
103
|
t: void 0,
|
|
95
104
|
a: void 0
|
|
96
|
-
}),
|
|
105
|
+
}), n;
|
|
97
106
|
})()
|
|
98
107
|
});
|
|
99
108
|
}
|
|
100
109
|
})), e;
|
|
101
110
|
})();
|
|
102
111
|
}
|
|
103
|
-
|
|
104
|
-
export { S as ActivityTimeline };
|
|
112
|
+
export { w as ActivityTimeline };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ModalFrame as e } from "./Dialog.js";
|
|
2
2
|
import { createComponent as t, mergeProps as n } from "solid-js/web";
|
|
3
|
-
|
|
3
|
+
// src/primitives/AlertDialog.tsx
|
|
4
4
|
function r(r) {
|
|
5
5
|
return t(e, n(r, { alert: !0 }));
|
|
6
6
|
}
|
|
7
|
-
//#endregion
|
|
8
7
|
export { r as AlertDialog };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { useNumberFormatter as e } from "../theme/intl.js";
|
|
2
|
+
import { useTheme as t } from "../theme/ThemeProvider.js";
|
|
3
|
+
import { cn as n } from "../utils/cn.js";
|
|
4
4
|
import { createComponent as r, effect as i, insert as a, memo as o, mergeProps as s, setAttribute as c, spread as l, template as u, use as d } from "solid-js/web";
|
|
5
5
|
import { For as f, Show as p, createEffect as m, createMemo as h, createSignal as g, on as _, onMount as v, splitProps as y } from "solid-js";
|
|
6
|
-
|
|
6
|
+
// src/primitives/Avatar.tsx
|
|
7
7
|
var b = /*#__PURE__*/ u("<img class=sheen-avatar-image alt>"), x = /*#__PURE__*/ u("<span><span class=sheen-avatar-fallback aria-hidden=true>"), S = /*#__PURE__*/ u("<div>"), C = /*#__PURE__*/ u("<span class=\"sheen-avatar sheen-avatar-overflow\">+");
|
|
8
8
|
function w(e, t) {
|
|
9
9
|
if (t !== void 0) {
|
|
@@ -13,45 +13,45 @@ function w(e, t) {
|
|
|
13
13
|
return e.trim().split(/\s+/u).slice(0, 2).map((e) => Array.from(e)[0] ?? "").join("").toUpperCase();
|
|
14
14
|
}
|
|
15
15
|
function T(e) {
|
|
16
|
-
let [
|
|
16
|
+
let [t, u] = y(e, [
|
|
17
17
|
"label",
|
|
18
18
|
"src",
|
|
19
19
|
"fallback",
|
|
20
20
|
"size",
|
|
21
21
|
"class"
|
|
22
22
|
]);
|
|
23
|
-
if (!
|
|
23
|
+
if (!t.label?.trim()) throw Error("Avatar requires a nonempty label");
|
|
24
24
|
let f = () => {
|
|
25
|
-
let e =
|
|
25
|
+
let e = t.size ?? "md";
|
|
26
26
|
if (e !== "sm" && e !== "md" && e !== "lg") throw Error("Avatar size is invalid");
|
|
27
27
|
return e;
|
|
28
28
|
}, [S, C] = g(!1), T;
|
|
29
|
-
m(_(() =>
|
|
29
|
+
m(_(() => t.src, () => C(!1), { defer: !0 })), v(() => {
|
|
30
30
|
T?.complete && T.naturalWidth === 0 && C(!0);
|
|
31
31
|
});
|
|
32
|
-
let E = h(() => w(
|
|
32
|
+
let E = h(() => w(t.label, t.fallback));
|
|
33
33
|
return (() => {
|
|
34
34
|
var e = x(), m = e.firstChild;
|
|
35
35
|
return l(e, s(u, {
|
|
36
36
|
get class() {
|
|
37
|
-
return
|
|
37
|
+
return n("sheen-avatar", t.class);
|
|
38
38
|
},
|
|
39
39
|
role: "img",
|
|
40
40
|
get "aria-label"() {
|
|
41
|
-
return
|
|
41
|
+
return t.label;
|
|
42
42
|
},
|
|
43
43
|
get "data-size"() {
|
|
44
44
|
return f();
|
|
45
45
|
}
|
|
46
46
|
}), !1, !0), a(m, E), a(e, r(p, {
|
|
47
47
|
get when() {
|
|
48
|
-
return o(() => !!
|
|
48
|
+
return o(() => !!t.src)() && !S();
|
|
49
49
|
},
|
|
50
50
|
get children() {
|
|
51
51
|
var e = b();
|
|
52
52
|
e.addEventListener("error", () => C(!0));
|
|
53
|
-
var
|
|
54
|
-
return typeof
|
|
53
|
+
var n = T;
|
|
54
|
+
return typeof n == "function" ? d(n, e) : T = e, c(e, "draggable", !1), i(() => c(e, "src", t.src)), e;
|
|
55
55
|
}
|
|
56
56
|
}), null), e;
|
|
57
57
|
})();
|
|
@@ -65,7 +65,7 @@ function E(o) {
|
|
|
65
65
|
"class"
|
|
66
66
|
]);
|
|
67
67
|
if (!u.label?.trim()) throw Error("AvatarGroup requires a nonempty label");
|
|
68
|
-
let m =
|
|
68
|
+
let m = t(), g = e(), _ = h(() => {
|
|
69
69
|
let e = /* @__PURE__ */ new Set();
|
|
70
70
|
for (let t of u.avatars) {
|
|
71
71
|
if (!t.id?.trim() || e.has(t.id)) throw Error("AvatarGroup IDs must be unique nonempty strings");
|
|
@@ -81,7 +81,7 @@ function E(o) {
|
|
|
81
81
|
var e = S();
|
|
82
82
|
return l(e, s(d, {
|
|
83
83
|
get class() {
|
|
84
|
-
return
|
|
84
|
+
return n("sheen-avatar-group", u.class);
|
|
85
85
|
},
|
|
86
86
|
role: "group",
|
|
87
87
|
get "aria-label"() {
|
|
@@ -111,5 +111,4 @@ function E(o) {
|
|
|
111
111
|
}), null), e;
|
|
112
112
|
})();
|
|
113
113
|
}
|
|
114
|
-
//#endregion
|
|
115
114
|
export { T as Avatar, E as AvatarGroup };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Accessor, JSX } from "solid-js";
|
|
2
|
+
import type { SortableItem, SortableMessages, SortableReorder } from "./sortable-core.ts";
|
|
3
|
+
export interface BoardColumn<Card extends SortableItem = SortableItem> {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
/** Column title, used by the default header and in announcements. */
|
|
6
|
+
readonly label: string;
|
|
7
|
+
readonly cards: readonly Card[];
|
|
8
|
+
/** A disabled column neither accepts cards nor lets its cards or itself be picked up. */
|
|
9
|
+
readonly disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface BoardMove {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly fromColumn: string;
|
|
14
|
+
readonly fromIndex: number;
|
|
15
|
+
readonly toColumn: string;
|
|
16
|
+
/** Final index in `toColumn`, measured after the card leaves its original position. */
|
|
17
|
+
readonly index: number;
|
|
18
|
+
}
|
|
19
|
+
export type BoardCardOf<Column extends BoardColumn> = Column["cards"][number];
|
|
20
|
+
export type BoardProps<Column extends BoardColumn> = Omit<JSX.HTMLAttributes<HTMLDivElement>, "children" | "ref" | "onDrop"> & {
|
|
21
|
+
ref?: HTMLDivElement | ((element: HTMLDivElement) => void);
|
|
22
|
+
/** Owner-ordered columns. Column and card ids are stable and unique across the board. */
|
|
23
|
+
columns: readonly Column[];
|
|
24
|
+
children: (card: Accessor<BoardCardOf<Column>>, column: Accessor<Column>) => JSX.Element;
|
|
25
|
+
/** Replaces the default title and count inside each column header. The reorder handle stays Sheen-owned. */
|
|
26
|
+
columnHeader?: (column: Accessor<Column>, count: Accessor<number>) => JSX.Element;
|
|
27
|
+
/** Proposes a card move. The board is controlled: nothing moves until the owner passes updated columns back. */
|
|
28
|
+
onMove: (move: BoardMove) => void;
|
|
29
|
+
/** Enables column reordering through each header's handle. */
|
|
30
|
+
onColumnReorder?: (reorder: SortableReorder) => void;
|
|
31
|
+
/** Accessible name for the board. */
|
|
32
|
+
label: string;
|
|
33
|
+
/** Render a grip button on each card that owns pointer and keyboard dragging. Without it the whole card drags and takes focus. */
|
|
34
|
+
handle?: boolean;
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
messages?: Partial<SortableMessages>;
|
|
37
|
+
};
|
|
38
|
+
/** A controlled Kanban board: cards move within and between columns, and columns optionally reorder. */
|
|
39
|
+
export declare function Board<Column extends BoardColumn>(props: BoardProps<Column>): JSX.Element;
|