@gemologic/sheen 0.2.1 → 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
package/dist/primitives/Toast.js
CHANGED
|
@@ -1,69 +1,71 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { Button as e } from "./Button.js";
|
|
2
|
+
import { useTheme as t } from "../theme/ThemeProvider.js";
|
|
3
|
+
import { cn as n } from "../utils/cn.js";
|
|
4
|
+
import { Glyph as r } from "./Glyph.js";
|
|
5
|
+
import { className as i, createComponent as a, effect as o, insert as s, memo as c, setAttribute as l, template as u } from "solid-js/web";
|
|
6
|
+
import { Show as d, createUniqueId as f } from "solid-js";
|
|
7
|
+
// src/primitives/Toast.tsx
|
|
8
|
+
var p = /*#__PURE__*/ u("<p class=sheen-toast-description>"), m = /*#__PURE__*/ u("<p class=sheen-toast-error>"), h = /*#__PURE__*/ u("<div role=group><strong class=sheen-toast-title>"), g = /*#__PURE__*/ u("<span class=sheen-toast-pending>"), _ = /*#__PURE__*/ u("<div class=sheen-toast-actions>");
|
|
9
|
+
function v(u) {
|
|
10
|
+
let v = t(), y = f(), b = () => u.notification.options, x = () => u.notification.state === "pending", S = () => u.notification.state === "failed", C = () => [b().description ? `${y}-description` : "", S() && b().action ? `${y}-error` : ""].filter(Boolean).join(" ") || void 0;
|
|
10
11
|
return (() => {
|
|
11
|
-
var
|
|
12
|
-
return
|
|
12
|
+
var t = h(), f = t.firstChild;
|
|
13
|
+
return l(t, "aria-labelledby", `${y}-title`), l(f, "id", `${y}-title`), s(f, () => b().title), s(t, a(e, {
|
|
14
|
+
variant: "ghost",
|
|
13
15
|
class: "sheen-toast-close",
|
|
14
16
|
size: "sm",
|
|
15
17
|
get "aria-label"() {
|
|
16
|
-
return
|
|
18
|
+
return v.messages().close;
|
|
17
19
|
},
|
|
18
|
-
onClick: () =>
|
|
20
|
+
onClick: () => u.onDismiss(),
|
|
19
21
|
get children() {
|
|
20
|
-
return
|
|
22
|
+
return a(r, { name: "close" });
|
|
21
23
|
}
|
|
22
|
-
}), null),
|
|
24
|
+
}), null), s(t, a(d, {
|
|
23
25
|
get when() {
|
|
24
|
-
return
|
|
26
|
+
return b().description;
|
|
25
27
|
},
|
|
26
28
|
get children() {
|
|
27
|
-
var e =
|
|
28
|
-
return
|
|
29
|
+
var e = p();
|
|
30
|
+
return l(e, "id", `${y}-description`), s(e, () => b().description), e;
|
|
29
31
|
}
|
|
30
|
-
}), null),
|
|
32
|
+
}), null), s(t, a(d, {
|
|
31
33
|
get when() {
|
|
32
|
-
return
|
|
34
|
+
return c(() => !!S())() && b().action;
|
|
33
35
|
},
|
|
34
36
|
get children() {
|
|
35
|
-
var e =
|
|
36
|
-
return
|
|
37
|
+
var e = m();
|
|
38
|
+
return l(e, "id", `${y}-error`), s(e, () => b().action?.errorMessage), e;
|
|
37
39
|
}
|
|
38
|
-
}), null),
|
|
40
|
+
}), null), s(t, a(d, {
|
|
39
41
|
get when() {
|
|
40
|
-
return
|
|
42
|
+
return b().action;
|
|
41
43
|
},
|
|
42
|
-
children: (
|
|
43
|
-
var
|
|
44
|
-
return
|
|
44
|
+
children: (t) => (() => {
|
|
45
|
+
var n = _();
|
|
46
|
+
return s(n, a(e, {
|
|
45
47
|
variant: "outline",
|
|
46
48
|
size: "sm",
|
|
47
49
|
get loading() {
|
|
48
|
-
return
|
|
50
|
+
return x();
|
|
49
51
|
},
|
|
50
|
-
onClick: () =>
|
|
52
|
+
onClick: () => u.onAction(),
|
|
51
53
|
get children() {
|
|
52
|
-
return
|
|
54
|
+
return c(() => !!S())() ? t().retryLabel ?? v.messages().retry : t().label;
|
|
53
55
|
}
|
|
54
|
-
}), null),
|
|
56
|
+
}), null), s(n, a(d, {
|
|
55
57
|
get when() {
|
|
56
|
-
return
|
|
58
|
+
return x();
|
|
57
59
|
},
|
|
58
60
|
get children() {
|
|
59
|
-
var e =
|
|
60
|
-
return
|
|
61
|
+
var e = g();
|
|
62
|
+
return s(e, () => v.messages().loading), e;
|
|
61
63
|
}
|
|
62
|
-
}), null),
|
|
64
|
+
}), null), n;
|
|
63
65
|
})()
|
|
64
|
-
}), null),
|
|
65
|
-
var
|
|
66
|
-
return
|
|
66
|
+
}), null), o((e) => {
|
|
67
|
+
var r = n("sheen-toast", u.class), a = C(), o = x() || void 0, s = x() || void 0, c = S() || void 0, d = S() ? "danger" : b().tone;
|
|
68
|
+
return r !== e.e && i(t, e.e = r), a !== e.t && l(t, "aria-describedby", e.t = a), o !== e.a && l(t, "aria-busy", e.a = o), s !== e.o && l(t, "data-pending", e.o = s), c !== e.i && l(t, "data-invalid", e.i = c), d !== e.n && l(t, "data-tone", e.n = d), e;
|
|
67
69
|
}, {
|
|
68
70
|
e: void 0,
|
|
69
71
|
t: void 0,
|
|
@@ -71,8 +73,7 @@ function _(l) {
|
|
|
71
73
|
o: void 0,
|
|
72
74
|
i: void 0,
|
|
73
75
|
n: void 0
|
|
74
|
-
}),
|
|
76
|
+
}), t;
|
|
75
77
|
})();
|
|
76
78
|
}
|
|
77
|
-
|
|
78
|
-
export { _ as Toast };
|
|
79
|
+
export { v as Toast };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { useTheme as e } from "../theme/ThemeProvider.js";
|
|
2
2
|
import { cn as t } from "../utils/cn.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Toast as n } from "./Toast.js";
|
|
4
|
+
import { toasterPresenter as r } from "./create-toaster.js";
|
|
5
5
|
import { Portal as i, className as a, createComponent as o, delegateEvents as s, effect as c, insert as l, setAttribute as u, setStyleProperty as d, template as f, use as p } from "solid-js/web";
|
|
6
6
|
import { For as m, Show as h, createEffect as g, createMemo as _, createSignal as v, onCleanup as y, onMount as b } from "solid-js";
|
|
7
|
-
|
|
7
|
+
// src/primitives/Toaster.tsx
|
|
8
8
|
var x = /*#__PURE__*/ f("<li class=sheen-toast-entry>"), S = /*#__PURE__*/ f("<div role=region tabindex=-1 data-kb-top-layer=true><div class=sheen-toast-announcer role=status aria-live=polite aria-atomic=true></div><div class=sheen-toast-announcer role=alert aria-atomic=true></div><ol class=sheen-toast-list>");
|
|
9
9
|
function C(e) {
|
|
10
|
-
let t,
|
|
10
|
+
let t, r = e.entry.lifetime, i = () => {
|
|
11
11
|
if (t?.contains(t.ownerDocument.activeElement)) {
|
|
12
12
|
let t = e.entry.opener;
|
|
13
13
|
if (t?.isConnected && !t.closest("[inert]") && (t.focus({ preventScroll: !0 }), t.ownerDocument.activeElement === t)) return;
|
|
@@ -20,10 +20,10 @@ function C(e) {
|
|
|
20
20
|
};
|
|
21
21
|
return g(() => {
|
|
22
22
|
let t = e.entry.notification.options;
|
|
23
|
-
if (t !==
|
|
24
|
-
let
|
|
23
|
+
if (t !== r.options && (r.options = t, r.remaining = t.duration ?? 0), !e.entry.open || e.paused || e.entry.notification.state !== "idle" || r.options.duration === null) return;
|
|
24
|
+
let n = performance.now(), i = window.setTimeout(a, r.remaining);
|
|
25
25
|
y(() => {
|
|
26
|
-
window.clearTimeout(i),
|
|
26
|
+
window.clearTimeout(i), r.remaining = Math.max(0, r.remaining - (performance.now() - n));
|
|
27
27
|
});
|
|
28
28
|
}), g(() => {
|
|
29
29
|
if (e.entry.open || !t) return;
|
|
@@ -35,41 +35,41 @@ function C(e) {
|
|
|
35
35
|
n = !0;
|
|
36
36
|
});
|
|
37
37
|
}), (() => {
|
|
38
|
-
var
|
|
39
|
-
|
|
38
|
+
var r = x();
|
|
39
|
+
r.$$keydown = (e) => {
|
|
40
40
|
e.key === "Escape" && !e.defaultPrevented && (e.preventDefault(), e.stopPropagation(), a());
|
|
41
|
-
},
|
|
41
|
+
}, r.addEventListener("animationend", (t) => {
|
|
42
42
|
t.target === t.currentTarget && !e.entry.open && e.onExit();
|
|
43
43
|
});
|
|
44
44
|
var i = t;
|
|
45
|
-
return typeof i == "function" ? p(i,
|
|
45
|
+
return typeof i == "function" ? p(i, r) : t = r, l(r, o(n, {
|
|
46
46
|
get notification() {
|
|
47
47
|
return e.entry.notification;
|
|
48
48
|
},
|
|
49
49
|
onDismiss: a,
|
|
50
50
|
onAction: s
|
|
51
51
|
})), c((t) => {
|
|
52
|
-
var
|
|
53
|
-
return
|
|
52
|
+
var n = e.entry.open, i = !e.entry.open || void 0, a = !e.entry.open;
|
|
53
|
+
return n !== t.e && u(r, "data-open", t.e = n), i !== t.t && u(r, "aria-hidden", t.t = i), a !== t.a && (r.inert = t.a = a), t;
|
|
54
54
|
}, {
|
|
55
55
|
e: void 0,
|
|
56
56
|
t: void 0,
|
|
57
57
|
a: void 0
|
|
58
|
-
}),
|
|
58
|
+
}), r;
|
|
59
59
|
})();
|
|
60
60
|
}
|
|
61
|
-
function w(
|
|
61
|
+
function w(n) {
|
|
62
62
|
let s = e();
|
|
63
|
-
_(() => (y(
|
|
63
|
+
_(() => (y(n.controller[r]()), n.controller));
|
|
64
64
|
let [f, x] = v(), [w, T] = v([]), [E, D] = v(!1), [O, k] = v(!1), [A, j] = v(!1), [M, N] = v(""), [P, F] = v(""), I = /* @__PURE__ */ new Map(), L = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map(), z, B = !1, V = _(() => {
|
|
65
|
-
let e =
|
|
65
|
+
let e = n.limit ?? 3;
|
|
66
66
|
if (!Number.isSafeInteger(e) || e < 1) throw Error("Toaster: limit must be a positive integer");
|
|
67
67
|
return e;
|
|
68
68
|
});
|
|
69
69
|
g(() => {
|
|
70
|
-
let e =
|
|
70
|
+
let e = n.controller.notifications(), t = new Map(e.map((e) => [e.id, e]));
|
|
71
71
|
for (let e of L.keys()) t.has(e) || L.delete(e);
|
|
72
|
-
let
|
|
72
|
+
let r = w(), i = r.map((e, n) => {
|
|
73
73
|
let r = t.get(e.notification.id), i = r !== void 0 && n < V(), a = r ?? e.notification;
|
|
74
74
|
return a === e.notification && i === e.open ? e : {
|
|
75
75
|
...e,
|
|
@@ -91,7 +91,7 @@ function w(r) {
|
|
|
91
91
|
opener: n
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
-
(i.length !==
|
|
94
|
+
(i.length !== r.length || i.some((e, t) => e !== r[t])) && T(i);
|
|
95
95
|
}), g(() => {
|
|
96
96
|
if (!f()) return;
|
|
97
97
|
let e = new Set(w().filter((e) => e.open).map((e) => e.notification.id));
|
|
@@ -137,10 +137,10 @@ function w(r) {
|
|
|
137
137
|
return e();
|
|
138
138
|
},
|
|
139
139
|
get children() {
|
|
140
|
-
var e = S(),
|
|
140
|
+
var e = S(), r = e.firstChild, i = r.nextSibling, g = i.nextSibling;
|
|
141
141
|
return e.$$focusout = (e) => {
|
|
142
|
-
|
|
143
|
-
}, e.$$focusin = () => k(!0), e.addEventListener("pointerleave", () => D(!1)), e.addEventListener("pointerenter", () => D(!0)), p(x, e), l(
|
|
142
|
+
e.relatedTarget instanceof Node && e.currentTarget.contains(e.relatedTarget) || k(!1);
|
|
143
|
+
}, e.$$focusin = () => k(!0), e.addEventListener("pointerleave", () => D(!1)), e.addEventListener("pointerenter", () => D(!0)), p(x, e), l(r, M), l(i, P), l(g, o(m, {
|
|
144
144
|
get each() {
|
|
145
145
|
return [...H().keys()];
|
|
146
146
|
},
|
|
@@ -153,7 +153,7 @@ function w(r) {
|
|
|
153
153
|
return t();
|
|
154
154
|
},
|
|
155
155
|
get controller() {
|
|
156
|
-
return
|
|
156
|
+
return n.controller;
|
|
157
157
|
},
|
|
158
158
|
get paused() {
|
|
159
159
|
return E() || O() || A();
|
|
@@ -162,9 +162,9 @@ function w(r) {
|
|
|
162
162
|
fallback: () => f()?.focus({ preventScroll: !0 })
|
|
163
163
|
})
|
|
164
164
|
})
|
|
165
|
-
})), c((
|
|
166
|
-
var i =
|
|
167
|
-
return i !==
|
|
165
|
+
})), c((r) => {
|
|
166
|
+
var i = n.label ?? s.messages().notifications, o = t("sheen-toaster", n.class), c = s.layers.aboveAll();
|
|
167
|
+
return i !== r.e && u(e, "aria-label", r.e = i), o !== r.t && a(e, r.t = o), c !== r.a && d(e, "z-index", r.a = c), r;
|
|
168
168
|
}, {
|
|
169
169
|
e: void 0,
|
|
170
170
|
t: void 0,
|
|
@@ -179,5 +179,4 @@ s([
|
|
|
179
179
|
"focusin",
|
|
180
180
|
"focusout"
|
|
181
181
|
]);
|
|
182
|
-
//#endregion
|
|
183
182
|
export { w as Toaster };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Button as e } from "./Button.js";
|
|
2
2
|
import { TooltipLayer as t, createTooltipLayer as n } from "./tooltip-layer.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import { useShortcutLabel as r } from "./ShortcutProvider.js";
|
|
4
|
+
import { createComponent as i, mergeProps as a } from "solid-js/web";
|
|
5
|
+
import { splitProps as o } from "solid-js";
|
|
6
|
+
import * as s from "#sheen-kobalte/tooltip";
|
|
7
|
+
// src/primitives/Tooltip.tsx
|
|
8
|
+
function c(c) {
|
|
9
|
+
let [l, u] = o(c, [
|
|
9
10
|
"content",
|
|
10
11
|
"shortcut",
|
|
11
12
|
"placement",
|
|
@@ -14,71 +15,70 @@ function s(s) {
|
|
|
14
15
|
"ref",
|
|
15
16
|
"children",
|
|
16
17
|
"aria-describedby"
|
|
17
|
-
]),
|
|
18
|
-
return
|
|
18
|
+
]), d, f = () => u.disabled || u.loading || !1, p = n(() => d, f), m = () => typeof l.shortcut == "string" ? void 0 : l.shortcut, h = r(() => typeof l.shortcut == "string" ? l.shortcut : l.shortcut?.keys), g = () => (p.open(), typeof l.shortcut == "string" ? h() : d?.getAttribute("data-sheen-shortcut") ?? h());
|
|
19
|
+
return i(s.Root, {
|
|
19
20
|
get open() {
|
|
20
|
-
return
|
|
21
|
+
return p.open();
|
|
21
22
|
},
|
|
22
23
|
get onOpenChange() {
|
|
23
|
-
return
|
|
24
|
+
return p.change;
|
|
24
25
|
},
|
|
25
26
|
get disabled() {
|
|
26
|
-
return
|
|
27
|
+
return f();
|
|
27
28
|
},
|
|
28
29
|
get placement() {
|
|
29
|
-
return
|
|
30
|
+
return l.placement ?? "top";
|
|
30
31
|
},
|
|
31
32
|
get openDelay() {
|
|
32
|
-
return
|
|
33
|
+
return l.openDelay ?? 500;
|
|
33
34
|
},
|
|
34
35
|
get closeDelay() {
|
|
35
|
-
return
|
|
36
|
+
return l.closeDelay ?? 100;
|
|
36
37
|
},
|
|
37
38
|
gutter: 6,
|
|
38
39
|
get children() {
|
|
39
|
-
return [
|
|
40
|
+
return [i(s.Trigger, a({ as: e }, u, {
|
|
40
41
|
get shortcut() {
|
|
41
|
-
return
|
|
42
|
+
return m();
|
|
42
43
|
},
|
|
43
44
|
get type() {
|
|
44
|
-
return
|
|
45
|
+
return u.type ?? "button";
|
|
45
46
|
},
|
|
46
47
|
get "aria-describedby"() {
|
|
47
|
-
return [
|
|
48
|
+
return [l["aria-describedby"], p.open() ? `${p.id}-content` : void 0].filter(Boolean).join(" ") || void 0;
|
|
48
49
|
},
|
|
49
50
|
get onClick() {
|
|
50
|
-
return
|
|
51
|
+
return u.onClick ?? (() => {});
|
|
51
52
|
},
|
|
52
53
|
get onFocus() {
|
|
53
|
-
return
|
|
54
|
+
return u.onFocus ?? (() => {});
|
|
54
55
|
},
|
|
55
56
|
get onBlur() {
|
|
56
|
-
return
|
|
57
|
+
return u.onBlur ?? (() => {});
|
|
57
58
|
},
|
|
58
59
|
get onPointerDown() {
|
|
59
|
-
return
|
|
60
|
+
return u.onPointerDown ?? (() => {});
|
|
60
61
|
},
|
|
61
62
|
get onPointerEnter() {
|
|
62
|
-
return
|
|
63
|
+
return u.onPointerEnter ?? (() => {});
|
|
63
64
|
},
|
|
64
65
|
get onPointerLeave() {
|
|
65
|
-
return
|
|
66
|
+
return u.onPointerLeave ?? (() => {});
|
|
66
67
|
},
|
|
67
68
|
ref: (e) => {
|
|
68
|
-
|
|
69
|
+
d = e, typeof l.ref == "function" && l.ref(e);
|
|
69
70
|
},
|
|
70
71
|
get children() {
|
|
71
|
-
return
|
|
72
|
+
return l.children;
|
|
72
73
|
}
|
|
73
|
-
})),
|
|
74
|
-
state:
|
|
74
|
+
})), i(t, {
|
|
75
|
+
state: p,
|
|
75
76
|
get content() {
|
|
76
|
-
return
|
|
77
|
+
return l.content;
|
|
77
78
|
},
|
|
78
|
-
shortcut:
|
|
79
|
+
shortcut: g
|
|
79
80
|
})];
|
|
80
81
|
}
|
|
81
82
|
});
|
|
82
83
|
}
|
|
83
|
-
|
|
84
|
-
export { s as Tooltip };
|
|
84
|
+
export { c as Tooltip };
|
package/dist/primitives/Tree.js
CHANGED
|
@@ -2,7 +2,7 @@ import { useTheme as e } from "../theme/ThemeProvider.js";
|
|
|
2
2
|
import { cn as t } from "../utils/cn.js";
|
|
3
3
|
import { createComponent as n, delegateEvents 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";
|
|
4
4
|
import { createContext as f, createEffect as p, createMemo as m, createSignal as h, createUniqueId as g, onCleanup as _, onMount as v, splitProps as y, useContext as b } from "solid-js";
|
|
5
|
-
|
|
5
|
+
// src/primitives/Tree.tsx
|
|
6
6
|
var x = /*#__PURE__*/ u("<ul>"), S = /*#__PURE__*/ u("<li><div class=sheen-tree-item-row><span class=sheen-tree-item-label>"), C = /*#__PURE__*/ u("<button type=button tabindex=-1 class=sheen-tree-expander><span aria-hidden=true>"), w = /*#__PURE__*/ u("<span class=sheen-tree-leaf aria-hidden=true>"), T = /*#__PURE__*/ u("<ul role=group class=sheen-tree-group>"), E = f();
|
|
7
7
|
function D(e, t) {
|
|
8
8
|
if (t.some((e) => !e.trim())) throw Error(`Tree ${e} values must be nonempty`);
|
|
@@ -271,5 +271,4 @@ function M(n) {
|
|
|
271
271
|
})();
|
|
272
272
|
}
|
|
273
273
|
r(["click"]);
|
|
274
|
-
//#endregion
|
|
275
274
|
export { j as Tree, M as TreeItem };
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import type { JSX } from "solid-js";
|
|
2
2
|
export interface TextProps extends JSX.HTMLAttributes<HTMLSpanElement> {
|
|
3
|
-
size?: "caption" | "ui-sm" | "ui" | "body";
|
|
3
|
+
size?: "caption" | "ui-sm" | "ui" | "body" | "lead";
|
|
4
4
|
tone?: "default" | "muted";
|
|
5
5
|
numeric?: boolean;
|
|
6
6
|
}
|
|
7
7
|
export declare function Text(props: TextProps): JSX.Element;
|
|
8
8
|
export interface HeadingProps extends JSX.HTMLAttributes<HTMLHeadingElement> {
|
|
9
9
|
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
10
|
-
size
|
|
10
|
+
/** Visual size, independent of the outline level. Display sizes are for marketing and empty-state hero titles. */
|
|
11
|
+
size?: "display-1" | "display-2" | "h1" | "h2" | "h3" | "h4";
|
|
11
12
|
}
|
|
12
13
|
export declare function Heading(props: HeadingProps): JSX.Element;
|
|
13
14
|
export type CodeProps = JSX.HTMLAttributes<HTMLElement>;
|
|
14
15
|
export declare function Code(props: CodeProps): JSX.Element;
|
|
15
16
|
export type KbdProps = JSX.HTMLAttributes<HTMLElement>;
|
|
16
17
|
export declare function Kbd(props: KbdProps): JSX.Element;
|
|
18
|
+
export type ProseProps = JSX.HTMLAttributes<HTMLDivElement>;
|
|
19
|
+
/** Long-form reading typography for rendered Markdown, help articles, and legal text. Styles native descendants only. */
|
|
20
|
+
export declare function Prose(props: ProseProps): JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { cn as e } from "../utils/cn.js";
|
|
2
2
|
import { Dynamic as t, createComponent as n, mergeProps as r, spread as i, template as a } from "solid-js/web";
|
|
3
3
|
import { splitProps as o } from "solid-js";
|
|
4
|
-
|
|
5
|
-
var s = /*#__PURE__*/ a("<span>"), c = /*#__PURE__*/ a("<code>"), l = /*#__PURE__*/ a("<kbd>");
|
|
6
|
-
function
|
|
4
|
+
// src/primitives/Typography.tsx
|
|
5
|
+
var s = /*#__PURE__*/ a("<span>"), c = /*#__PURE__*/ a("<code>"), l = /*#__PURE__*/ a("<kbd>"), u = /*#__PURE__*/ a("<div>");
|
|
6
|
+
function d(t) {
|
|
7
7
|
let [n, a] = o(t, [
|
|
8
8
|
"class",
|
|
9
9
|
"size",
|
|
@@ -28,14 +28,14 @@ function u(t) {
|
|
|
28
28
|
}), !1, !1), t;
|
|
29
29
|
})();
|
|
30
30
|
}
|
|
31
|
-
var
|
|
31
|
+
var f = {
|
|
32
32
|
1: "h1",
|
|
33
33
|
2: "h2",
|
|
34
34
|
3: "h3",
|
|
35
35
|
4: "h4",
|
|
36
36
|
5: "h5",
|
|
37
37
|
6: "h6"
|
|
38
|
-
},
|
|
38
|
+
}, p = {
|
|
39
39
|
1: "h1",
|
|
40
40
|
2: "h2",
|
|
41
41
|
3: "h3",
|
|
@@ -43,24 +43,24 @@ var d = {
|
|
|
43
43
|
5: "h4",
|
|
44
44
|
6: "h4"
|
|
45
45
|
};
|
|
46
|
-
function
|
|
46
|
+
function m(i) {
|
|
47
47
|
let [a, s] = o(i, [
|
|
48
48
|
"class",
|
|
49
49
|
"level",
|
|
50
50
|
"size"
|
|
51
51
|
]);
|
|
52
52
|
return n(t, r({ get component() {
|
|
53
|
-
return
|
|
53
|
+
return f[a.level];
|
|
54
54
|
} }, s, {
|
|
55
55
|
get class() {
|
|
56
56
|
return e("sheen-heading", a.class);
|
|
57
57
|
},
|
|
58
58
|
get "data-size"() {
|
|
59
|
-
return a.size ??
|
|
59
|
+
return a.size ?? p[a.level];
|
|
60
60
|
}
|
|
61
61
|
}));
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function h(t) {
|
|
64
64
|
let [n, a] = o(t, ["class"]);
|
|
65
65
|
return (() => {
|
|
66
66
|
var t = c();
|
|
@@ -69,7 +69,7 @@ function m(t) {
|
|
|
69
69
|
} }), !1, !1), t;
|
|
70
70
|
})();
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function g(t) {
|
|
73
73
|
let [n, a] = o(t, ["class"]);
|
|
74
74
|
return (() => {
|
|
75
75
|
var t = l();
|
|
@@ -78,5 +78,13 @@ function h(t) {
|
|
|
78
78
|
} }), !1, !1), t;
|
|
79
79
|
})();
|
|
80
80
|
}
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
function _(t) {
|
|
82
|
+
let [n, a] = o(t, ["class"]);
|
|
83
|
+
return (() => {
|
|
84
|
+
var t = u();
|
|
85
|
+
return i(t, r(a, { get class() {
|
|
86
|
+
return e("sheen-prose", n.class);
|
|
87
|
+
} }), !1, !1), t;
|
|
88
|
+
})();
|
|
89
|
+
}
|
|
90
|
+
export { h as Code, m as Heading, g as Kbd, _ as Prose, d as Text };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createEffect as e, createMemo as t, createSignal as n, onCleanup as r, onMount as i } from "solid-js";
|
|
2
|
-
|
|
2
|
+
// src/primitives/boolean-input-state.ts
|
|
3
3
|
function a(a, o) {
|
|
4
4
|
let s = a.defaultChecked ?? !1, [c, l] = n(s), u = t(() => a.checked), d = () => u() ?? c(), [f, p] = n(!1), m, h = (e) => {
|
|
5
5
|
e !== d() && (u() === void 0 && l(e), o(e));
|
|
@@ -11,7 +11,7 @@ function a(a, o) {
|
|
|
11
11
|
let n = /* @__PURE__ */ new Set(), i = (r) => {
|
|
12
12
|
if (r.target !== e.form) return;
|
|
13
13
|
let i = t.setTimeout(() => {
|
|
14
|
-
n.delete(i),
|
|
14
|
+
n.delete(i), r.defaultPrevented || (u() === void 0 && h(s), e.checked = d(), e.indeterminate = a.indeterminate ?? !1);
|
|
15
15
|
}, 0);
|
|
16
16
|
n.add(i);
|
|
17
17
|
};
|
|
@@ -24,16 +24,11 @@ function a(a, o) {
|
|
|
24
24
|
}), {
|
|
25
25
|
checked: d,
|
|
26
26
|
requestChange: (e) => {
|
|
27
|
-
|
|
28
|
-
e.checked = d();
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
h(e.checked), e.checked = d();
|
|
27
|
+
a.disabled || a.readOnly || h(e.checked), e.checked = d();
|
|
32
28
|
},
|
|
33
29
|
setInput: (e) => {
|
|
34
30
|
m = e;
|
|
35
31
|
}
|
|
36
32
|
};
|
|
37
33
|
}
|
|
38
|
-
//#endregion
|
|
39
34
|
export { a as createBooleanInputState };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { cn as e } from "../utils/cn.js";
|
|
2
|
-
|
|
2
|
+
// src/primitives/button-variants.ts
|
|
3
3
|
function t(t = {}) {
|
|
4
|
-
return e("sheen-button", `sheen-button-${t.variant ?? "
|
|
4
|
+
return e("sheen-button", `sheen-button-${t.variant ?? "outline"}`, `sheen-button-${t.tone ?? "neutral"}`, `sheen-button-${t.size ?? "md"}`, t.class);
|
|
5
5
|
}
|
|
6
|
-
//#endregion
|
|
7
6
|
export { t as buttonVariants };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createMemo as e, onCleanup as t } from "solid-js";
|
|
2
|
-
|
|
2
|
+
// src/primitives/choice-options.ts
|
|
3
3
|
function n(n, r, i) {
|
|
4
4
|
let a = !1;
|
|
5
5
|
t(() => {
|
|
@@ -31,5 +31,4 @@ function n(n, r, i) {
|
|
|
31
31
|
})
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
//#endregion
|
|
35
34
|
export { n as createChoiceOptions };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ConfirmDialog as e } from "./ConfirmDialog.js";
|
|
2
2
|
import { createComponent as t, mergeProps as n } from "solid-js/web";
|
|
3
3
|
import { Show as r, createSignal as i, getOwner as a, onCleanup as o } from "solid-js";
|
|
4
|
-
|
|
4
|
+
// src/primitives/create-confirm.tsx
|
|
5
5
|
function s() {
|
|
6
6
|
if (!a()) throw Error("createConfirm requires a Solid owner");
|
|
7
7
|
let s = !1, [c, l] = i();
|
|
@@ -45,5 +45,4 @@ function s() {
|
|
|
45
45
|
Dialog: d
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
|
-
//#endregion
|
|
49
48
|
export { s as createConfirm };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createSignal as e, getOwner as t, onCleanup as n } from "solid-js";
|
|
2
|
-
|
|
2
|
+
// src/primitives/create-toaster.ts
|
|
3
3
|
var r = Symbol("sheen toaster presenter");
|
|
4
4
|
function i(e) {
|
|
5
5
|
if (!e.title.trim()) throw Error("Toast: title must be nonempty");
|
|
@@ -83,5 +83,4 @@ function a() {
|
|
|
83
83
|
runAction: m
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
-
//#endregion
|
|
87
86
|
export { a as createToaster, r as toasterPresenter };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { onCleanup as e, onMount as t } from "solid-js";
|
|
2
|
-
|
|
2
|
+
// src/primitives/link-focus.ts
|
|
3
3
|
function n(n) {
|
|
4
4
|
t(() => {
|
|
5
5
|
let t = n();
|
|
@@ -34,5 +34,4 @@ function n(n) {
|
|
|
34
34
|
});
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
|
-
//#endregion
|
|
38
37
|
export { n as createLinkFocusRecovery };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createEffect as e, onCleanup as t } from "solid-js";
|
|
2
|
-
|
|
2
|
+
// src/primitives/menu-focus.ts
|
|
3
3
|
function n(n, r) {
|
|
4
4
|
e(() => {
|
|
5
5
|
let e = n();
|
|
@@ -28,5 +28,4 @@ function n(n, r) {
|
|
|
28
28
|
});
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
//#endregion
|
|
32
31
|
export { n as createMenuFocusRecovery };
|