@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
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { cn as e } from "../utils/cn.js";
|
|
2
|
+
import { Link as t } from "./Link.js";
|
|
3
|
+
import { createComponent as n, delegateEvents as r, effect as i, insert as a, mergeProps as o, spread as s, template as c } from "solid-js/web";
|
|
4
|
+
import { Show as l, children as u, splitProps as d } from "solid-js";
|
|
5
|
+
// src/primitives/List.tsx
|
|
6
|
+
var f = /*#__PURE__*/ c("<ul>"), p = /*#__PURE__*/ c("<span class=sheen-list-item-leading aria-hidden=true>"), m = /*#__PURE__*/ c("<span class=sheen-list-item-description>"), h = /*#__PURE__*/ c("<span class=sheen-list-item-copy><span class=sheen-list-item-title>"), g = /*#__PURE__*/ c("<span class=sheen-list-item-trailing>"), _ = /*#__PURE__*/ c("<li>"), v = /*#__PURE__*/ c("<div class=sheen-list-item-row>"), y = /*#__PURE__*/ c("<button type=button class=sheen-list-item-row>");
|
|
7
|
+
function b(t) {
|
|
8
|
+
let [n, r] = d(t, [
|
|
9
|
+
"label",
|
|
10
|
+
"dividers",
|
|
11
|
+
"density",
|
|
12
|
+
"inset",
|
|
13
|
+
"class",
|
|
14
|
+
"children"
|
|
15
|
+
]);
|
|
16
|
+
return (() => {
|
|
17
|
+
var t = f();
|
|
18
|
+
return s(t, o(r, {
|
|
19
|
+
role: "list",
|
|
20
|
+
get "aria-label"() {
|
|
21
|
+
return n.label;
|
|
22
|
+
},
|
|
23
|
+
get class() {
|
|
24
|
+
return e("sheen-list", n.class);
|
|
25
|
+
},
|
|
26
|
+
get "data-dividers"() {
|
|
27
|
+
return n.dividers || void 0;
|
|
28
|
+
},
|
|
29
|
+
get "data-density"() {
|
|
30
|
+
return n.density ?? "default";
|
|
31
|
+
},
|
|
32
|
+
get "data-inset"() {
|
|
33
|
+
return n.inset || void 0;
|
|
34
|
+
}
|
|
35
|
+
}), !1, !0), a(t, () => n.children), t;
|
|
36
|
+
})();
|
|
37
|
+
}
|
|
38
|
+
function x(r) {
|
|
39
|
+
let [c, f] = d(r, [
|
|
40
|
+
"title",
|
|
41
|
+
"description",
|
|
42
|
+
"leading",
|
|
43
|
+
"trailing",
|
|
44
|
+
"href",
|
|
45
|
+
"onSelect",
|
|
46
|
+
"current",
|
|
47
|
+
"selected",
|
|
48
|
+
"disabled",
|
|
49
|
+
"class"
|
|
50
|
+
]), b = u(() => c.leading), x = u(() => c.title), S = u(() => c.description), C = u(() => c.trailing), w = () => [
|
|
51
|
+
n(l, {
|
|
52
|
+
get when() {
|
|
53
|
+
return b();
|
|
54
|
+
},
|
|
55
|
+
get children() {
|
|
56
|
+
var e = p();
|
|
57
|
+
return a(e, b), e;
|
|
58
|
+
}
|
|
59
|
+
}),
|
|
60
|
+
(() => {
|
|
61
|
+
var e = h(), t = e.firstChild;
|
|
62
|
+
return a(t, x), a(e, n(l, {
|
|
63
|
+
get when() {
|
|
64
|
+
return S();
|
|
65
|
+
},
|
|
66
|
+
get children() {
|
|
67
|
+
var e = m();
|
|
68
|
+
return a(e, S), e;
|
|
69
|
+
}
|
|
70
|
+
}), null), e;
|
|
71
|
+
})(),
|
|
72
|
+
n(l, {
|
|
73
|
+
get when() {
|
|
74
|
+
return C();
|
|
75
|
+
},
|
|
76
|
+
get children() {
|
|
77
|
+
var e = g();
|
|
78
|
+
return a(e, C), e;
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
];
|
|
82
|
+
return (() => {
|
|
83
|
+
var r = _();
|
|
84
|
+
return s(r, o(f, {
|
|
85
|
+
get class() {
|
|
86
|
+
return e("sheen-list-item", c.class);
|
|
87
|
+
},
|
|
88
|
+
get "data-selected"() {
|
|
89
|
+
return c.selected || void 0;
|
|
90
|
+
},
|
|
91
|
+
get "data-disabled"() {
|
|
92
|
+
return c.disabled || void 0;
|
|
93
|
+
},
|
|
94
|
+
get "data-interactive"() {
|
|
95
|
+
return c.href !== void 0 || c.onSelect !== void 0 || void 0;
|
|
96
|
+
}
|
|
97
|
+
}), !1, !0), a(r, n(l, {
|
|
98
|
+
get when() {
|
|
99
|
+
return c.href;
|
|
100
|
+
},
|
|
101
|
+
get fallback() {
|
|
102
|
+
return n(l, {
|
|
103
|
+
get when() {
|
|
104
|
+
return c.onSelect;
|
|
105
|
+
},
|
|
106
|
+
get fallback() {
|
|
107
|
+
return (() => {
|
|
108
|
+
var e = v();
|
|
109
|
+
return a(e, w), e;
|
|
110
|
+
})();
|
|
111
|
+
},
|
|
112
|
+
children: (e) => (() => {
|
|
113
|
+
var t = y();
|
|
114
|
+
return t.$$click = () => e()(), a(t, w), i(() => t.disabled = c.disabled), t;
|
|
115
|
+
})()
|
|
116
|
+
});
|
|
117
|
+
},
|
|
118
|
+
children: (e) => n(t, {
|
|
119
|
+
variant: "quiet",
|
|
120
|
+
class: "sheen-list-item-row",
|
|
121
|
+
get href() {
|
|
122
|
+
return e();
|
|
123
|
+
},
|
|
124
|
+
get "aria-current"() {
|
|
125
|
+
return c.current ? "page" : void 0;
|
|
126
|
+
},
|
|
127
|
+
get children() {
|
|
128
|
+
return w();
|
|
129
|
+
}
|
|
130
|
+
})
|
|
131
|
+
})), r;
|
|
132
|
+
})();
|
|
133
|
+
}
|
|
134
|
+
r(["click"]);
|
|
135
|
+
export { b as List, x as ListItem };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
export type MessageFrom = "user" | "assistant" | "system";
|
|
3
|
+
export interface MessageProps extends Omit<JSX.HTMLAttributes<HTMLElement>, "ref"> {
|
|
4
|
+
ref?: HTMLElement | ((element: HTMLElement) => void);
|
|
5
|
+
from: MessageFrom;
|
|
6
|
+
author?: JSX.Element;
|
|
7
|
+
avatar?: JSX.Element;
|
|
8
|
+
timestamp?: string;
|
|
9
|
+
timeLabel?: string;
|
|
10
|
+
actions?: JSX.Element;
|
|
11
|
+
}
|
|
12
|
+
/** One conversation turn: optional avatar and author header, the content, and an actions row. */
|
|
13
|
+
export declare function Message(props: MessageProps): JSX.Element;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { cn as e } from "../utils/cn.js";
|
|
2
|
+
import { createComponent as t, effect as n, insert as r, mergeProps as i, setAttribute as a, spread as o, template as s, use as c } from "solid-js/web";
|
|
3
|
+
import { Show as l, children as u, createUniqueId as d, splitProps as f } from "solid-js";
|
|
4
|
+
// src/primitives/Message.tsx
|
|
5
|
+
var p = /*#__PURE__*/ s("<div class=sheen-message-avatar>"), m = /*#__PURE__*/ s("<span class=sheen-message-author>"), h = /*#__PURE__*/ s("<header class=sheen-message-header>"), g = /*#__PURE__*/ s("<div class=sheen-message-actions>"), _ = /*#__PURE__*/ s("<article><div class=sheen-message-body><div class=sheen-message-content>"), v = /*#__PURE__*/ s("<time class=sheen-message-time>");
|
|
6
|
+
function y(s) {
|
|
7
|
+
let [y, b] = f(s, [
|
|
8
|
+
"ref",
|
|
9
|
+
"from",
|
|
10
|
+
"author",
|
|
11
|
+
"avatar",
|
|
12
|
+
"timestamp",
|
|
13
|
+
"timeLabel",
|
|
14
|
+
"actions",
|
|
15
|
+
"class",
|
|
16
|
+
"children"
|
|
17
|
+
]), x = d(), S = u(() => y.avatar), C = u(() => y.author), w = u(() => y.actions), T = u(() => y.children), E = () => C.toArray().length > 0;
|
|
18
|
+
return (() => {
|
|
19
|
+
var s = _(), u = s.firstChild, d = u.firstChild;
|
|
20
|
+
return c((e) => {
|
|
21
|
+
typeof y.ref == "function" && y.ref(e);
|
|
22
|
+
}, s), o(s, i(b, {
|
|
23
|
+
get class() {
|
|
24
|
+
return e("sheen-message", y.class);
|
|
25
|
+
},
|
|
26
|
+
get "data-from"() {
|
|
27
|
+
return y.from;
|
|
28
|
+
},
|
|
29
|
+
get "aria-labelledby"() {
|
|
30
|
+
return b["aria-labelledby"] ?? (E() ? x : void 0);
|
|
31
|
+
}
|
|
32
|
+
}), !1, !0), r(s, t(l, {
|
|
33
|
+
get when() {
|
|
34
|
+
return S.toArray().length > 0;
|
|
35
|
+
},
|
|
36
|
+
get children() {
|
|
37
|
+
var e = p();
|
|
38
|
+
return r(e, S), e;
|
|
39
|
+
}
|
|
40
|
+
}), u), r(u, t(l, {
|
|
41
|
+
get when() {
|
|
42
|
+
return E() || y.timeLabel;
|
|
43
|
+
},
|
|
44
|
+
get children() {
|
|
45
|
+
var e = h();
|
|
46
|
+
return r(e, t(l, {
|
|
47
|
+
get when() {
|
|
48
|
+
return E();
|
|
49
|
+
},
|
|
50
|
+
get children() {
|
|
51
|
+
var e = m();
|
|
52
|
+
return a(e, "id", x), r(e, C), e;
|
|
53
|
+
}
|
|
54
|
+
}), null), r(e, t(l, {
|
|
55
|
+
get when() {
|
|
56
|
+
return y.timeLabel;
|
|
57
|
+
},
|
|
58
|
+
children: (e) => (() => {
|
|
59
|
+
var t = v();
|
|
60
|
+
return r(t, e), n(() => a(t, "datetime", y.timestamp)), t;
|
|
61
|
+
})()
|
|
62
|
+
}), null), e;
|
|
63
|
+
}
|
|
64
|
+
}), d), r(d, T), r(u, t(l, {
|
|
65
|
+
get when() {
|
|
66
|
+
return w.toArray().length > 0;
|
|
67
|
+
},
|
|
68
|
+
get children() {
|
|
69
|
+
var e = g();
|
|
70
|
+
return r(e, w), e;
|
|
71
|
+
}
|
|
72
|
+
}), null), s;
|
|
73
|
+
})();
|
|
74
|
+
}
|
|
75
|
+
export { y as Message };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { cn as e } from "../utils/cn.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { createLinkFocusRecovery as t } from "./link-focus.js";
|
|
3
|
+
import { LinkTooltip as n } from "./LinkTooltip.js";
|
|
4
4
|
import { createComponent as r, effect as i, insert as a, mergeProps as o, setAttribute as s, spread as c, template as l, use as u } from "solid-js/web";
|
|
5
5
|
import { Show as d, children as f, createContext as p, createMemo as m, splitProps as h, useContext as g } from "solid-js";
|
|
6
|
-
|
|
6
|
+
// src/primitives/NavList.tsx
|
|
7
7
|
var _ = /*#__PURE__*/ l("<nav><ul>"), v = /*#__PURE__*/ l("<span class=sheen-nav-item-icon aria-hidden=true>"), y = /*#__PURE__*/ l("<span class=sheen-nav-item-label>"), b = /*#__PURE__*/ l("<span class=sheen-nav-item-badge>"), x = /*#__PURE__*/ l("<span class=sheen-nav-item-actions>"), S = /*#__PURE__*/ l("<li class=sheen-nav-item-row>"), C = /*#__PURE__*/ l("<a>"), w = p(!1);
|
|
8
|
-
function T(
|
|
9
|
-
let [i, s] = h(
|
|
8
|
+
function T(n) {
|
|
9
|
+
let [i, s] = h(n, [
|
|
10
10
|
"label",
|
|
11
11
|
"class",
|
|
12
12
|
"children",
|
|
13
13
|
"ref"
|
|
14
14
|
]), l;
|
|
15
|
-
|
|
15
|
+
t(() => l);
|
|
16
16
|
let d = m(() => {
|
|
17
17
|
if (!i.label.trim()) throw Error("NavList requires a nonempty accessible label");
|
|
18
18
|
return i.label;
|
|
@@ -39,9 +39,9 @@ function T(t) {
|
|
|
39
39
|
})), t;
|
|
40
40
|
})();
|
|
41
41
|
}
|
|
42
|
-
function E(
|
|
42
|
+
function E(t) {
|
|
43
43
|
if (!g(w)) throw Error("NavItem requires a NavList owner");
|
|
44
|
-
let [l, u] = h(
|
|
44
|
+
let [l, u] = h(t, [
|
|
45
45
|
"href",
|
|
46
46
|
"label",
|
|
47
47
|
"current",
|
|
@@ -79,8 +79,8 @@ function E(n) {
|
|
|
79
79
|
})
|
|
80
80
|
]);
|
|
81
81
|
return (() => {
|
|
82
|
-
var
|
|
83
|
-
return a(
|
|
82
|
+
var t = S();
|
|
83
|
+
return a(t, r(d, {
|
|
84
84
|
get when() {
|
|
85
85
|
return l.tooltip !== void 0;
|
|
86
86
|
},
|
|
@@ -101,7 +101,7 @@ function E(n) {
|
|
|
101
101
|
})();
|
|
102
102
|
},
|
|
103
103
|
get children() {
|
|
104
|
-
return r(
|
|
104
|
+
return r(n, o(u, {
|
|
105
105
|
get href() {
|
|
106
106
|
return E();
|
|
107
107
|
},
|
|
@@ -122,7 +122,7 @@ function E(n) {
|
|
|
122
122
|
}
|
|
123
123
|
}));
|
|
124
124
|
}
|
|
125
|
-
}), null), a(
|
|
125
|
+
}), null), a(t, r(d, {
|
|
126
126
|
get when() {
|
|
127
127
|
return T() != null;
|
|
128
128
|
},
|
|
@@ -131,13 +131,12 @@ function E(n) {
|
|
|
131
131
|
return a(e, T), e;
|
|
132
132
|
}
|
|
133
133
|
}), null), i((e) => {
|
|
134
|
-
var
|
|
135
|
-
return
|
|
134
|
+
var n = l.current || void 0, r = T() != null || void 0;
|
|
135
|
+
return n !== e.e && s(t, "data-current", e.e = n), r !== e.t && s(t, "data-has-actions", e.t = r), e;
|
|
136
136
|
}, {
|
|
137
137
|
e: void 0,
|
|
138
138
|
t: void 0
|
|
139
|
-
}),
|
|
139
|
+
}), t;
|
|
140
140
|
})();
|
|
141
141
|
}
|
|
142
|
-
//#endregion
|
|
143
142
|
export { E as NavItem, T as NavList };
|
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
import type { JSX } from "solid-js";
|
|
2
|
+
export type NoticeTone = "info" | "success" | "warning" | "danger";
|
|
2
3
|
export interface CalloutProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
3
|
-
tone?:
|
|
4
|
+
tone?: NoticeTone;
|
|
4
5
|
heading?: string;
|
|
6
|
+
/** Leading icon. Defaults to the tone's status glyph; `false` removes it. */
|
|
7
|
+
icon?: JSX.Element | false;
|
|
8
|
+
/** Follow-up actions such as a Button or Link, placed after the message. */
|
|
9
|
+
actions?: JSX.Element;
|
|
10
|
+
/** Shows a dismiss button. The owner removes the notice in response. */
|
|
11
|
+
onDismiss?: () => void;
|
|
12
|
+
/** Accessible name for the dismiss button. */
|
|
13
|
+
dismissLabel?: string;
|
|
5
14
|
}
|
|
6
15
|
export type AlertProps = CalloutProps;
|
|
16
|
+
export type BannerProps = CalloutProps;
|
|
17
|
+
/** Static, contextual information in the flow of a page. */
|
|
7
18
|
export declare function Callout(props: CalloutProps): JSX.Element;
|
|
19
|
+
/** A live, assertive message for something the user must notice now. */
|
|
8
20
|
export declare function Alert(props: AlertProps): JSX.Element;
|
|
21
|
+
/** A full-width announcement at the top of a page or app shell, such as maintenance or billing state. */
|
|
22
|
+
export declare function Banner(props: BannerProps): JSX.Element;
|
|
@@ -1,64 +1,112 @@
|
|
|
1
1
|
import { cn as e } from "../utils/cn.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { useTheme as t } from "../theme/ThemeProvider.js";
|
|
3
|
+
import { Button as n } from "./Button.js";
|
|
4
|
+
import { Glyph as r } from "./Glyph.js";
|
|
5
|
+
import { createComponent as i, insert as a, memo as o, mergeProps as s, spread as c, template as l } from "solid-js/web";
|
|
6
|
+
import { Show as u, children as d, splitProps as f } from "solid-js";
|
|
7
|
+
// src/primitives/Notice.tsx
|
|
8
|
+
var p = /*#__PURE__*/ l("<span class=sheen-notice-icon aria-hidden=true>"), m = /*#__PURE__*/ l("<strong class=sheen-notice-heading>"), h = /*#__PURE__*/ l("<div class=sheen-notice-actions>"), g = /*#__PURE__*/ l("<div><div class=sheen-notice-body><div class=sheen-notice-content>"), _ = {
|
|
9
|
+
info: "status-info",
|
|
10
|
+
success: "status-success",
|
|
11
|
+
warning: "status-warning",
|
|
12
|
+
danger: "status-danger"
|
|
13
|
+
};
|
|
14
|
+
function v(l) {
|
|
15
|
+
let v = t(), [y, b] = f(l, [
|
|
16
|
+
"kind",
|
|
17
|
+
"fallbackTone",
|
|
18
|
+
"role",
|
|
8
19
|
"class",
|
|
9
20
|
"tone",
|
|
10
21
|
"heading",
|
|
22
|
+
"icon",
|
|
23
|
+
"actions",
|
|
24
|
+
"onDismiss",
|
|
25
|
+
"dismissLabel",
|
|
11
26
|
"children"
|
|
12
|
-
])
|
|
27
|
+
]), x = () => y.tone ?? y.fallbackTone, S = d(() => y.icon === !1 ? void 0 : y.icon ?? i(r, { get name() {
|
|
28
|
+
return _[x()];
|
|
29
|
+
} })), C = d(() => y.actions);
|
|
13
30
|
return (() => {
|
|
14
|
-
var
|
|
15
|
-
return
|
|
31
|
+
var t = g(), l = t.firstChild, d = l.firstChild;
|
|
32
|
+
return c(t, s(b, {
|
|
16
33
|
get class() {
|
|
17
|
-
return e("sheen-notice",
|
|
34
|
+
return e("sheen-notice", y.kind === "banner" && "sheen-banner", y.class);
|
|
18
35
|
},
|
|
19
36
|
get "data-tone"() {
|
|
20
|
-
return
|
|
37
|
+
return x();
|
|
21
38
|
},
|
|
22
|
-
role
|
|
23
|
-
|
|
39
|
+
get role() {
|
|
40
|
+
return y.role;
|
|
41
|
+
},
|
|
42
|
+
get "aria-atomic"() {
|
|
43
|
+
return y.role === "alert" ? "true" : void 0;
|
|
44
|
+
},
|
|
45
|
+
get "aria-label"() {
|
|
46
|
+
return o(() => y.role === "region")() ? y.heading ?? v.messages().announcement : void 0;
|
|
47
|
+
}
|
|
48
|
+
}), !1, !0), a(t, i(u, {
|
|
24
49
|
get when() {
|
|
25
|
-
return
|
|
50
|
+
return y.icon !== !1;
|
|
26
51
|
},
|
|
27
52
|
get children() {
|
|
28
|
-
var e =
|
|
29
|
-
return
|
|
53
|
+
var e = p();
|
|
54
|
+
return a(e, S), e;
|
|
30
55
|
}
|
|
31
|
-
}),
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
function d(a) {
|
|
35
|
-
let [u, d] = s(a, [
|
|
36
|
-
"class",
|
|
37
|
-
"tone",
|
|
38
|
-
"heading",
|
|
39
|
-
"children"
|
|
40
|
-
]);
|
|
41
|
-
return (() => {
|
|
42
|
-
var a = l(), s = a.firstChild;
|
|
43
|
-
return i(a, r(d, {
|
|
44
|
-
get class() {
|
|
45
|
-
return e("sheen-notice", u.class);
|
|
46
|
-
},
|
|
47
|
-
get "data-tone"() {
|
|
48
|
-
return u.tone ?? "danger";
|
|
56
|
+
}), l), a(l, i(u, {
|
|
57
|
+
get when() {
|
|
58
|
+
return y.heading;
|
|
49
59
|
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
60
|
+
get children() {
|
|
61
|
+
var e = m();
|
|
62
|
+
return a(e, () => y.heading), e;
|
|
63
|
+
}
|
|
64
|
+
}), d), a(d, () => y.children), a(l, i(u, {
|
|
53
65
|
get when() {
|
|
54
|
-
return
|
|
66
|
+
return C();
|
|
55
67
|
},
|
|
56
68
|
get children() {
|
|
57
|
-
var e =
|
|
58
|
-
return
|
|
69
|
+
var e = h();
|
|
70
|
+
return a(e, C), e;
|
|
59
71
|
}
|
|
60
|
-
}),
|
|
72
|
+
}), null), a(t, i(u, {
|
|
73
|
+
get when() {
|
|
74
|
+
return y.onDismiss;
|
|
75
|
+
},
|
|
76
|
+
children: (e) => i(n, {
|
|
77
|
+
variant: "ghost",
|
|
78
|
+
size: "sm",
|
|
79
|
+
class: "sheen-notice-dismiss",
|
|
80
|
+
get "aria-label"() {
|
|
81
|
+
return y.dismissLabel ?? v.messages().dismiss;
|
|
82
|
+
},
|
|
83
|
+
onClick: () => e()(),
|
|
84
|
+
get children() {
|
|
85
|
+
return i(r, { name: "close" });
|
|
86
|
+
}
|
|
87
|
+
})
|
|
88
|
+
}), null), t;
|
|
61
89
|
})();
|
|
62
90
|
}
|
|
63
|
-
|
|
64
|
-
|
|
91
|
+
function y(e) {
|
|
92
|
+
return i(v, s(e, {
|
|
93
|
+
kind: "callout",
|
|
94
|
+
fallbackTone: "info",
|
|
95
|
+
role: "note"
|
|
96
|
+
}));
|
|
97
|
+
}
|
|
98
|
+
function b(e) {
|
|
99
|
+
return i(v, s(e, {
|
|
100
|
+
kind: "alert",
|
|
101
|
+
fallbackTone: "danger",
|
|
102
|
+
role: "alert"
|
|
103
|
+
}));
|
|
104
|
+
}
|
|
105
|
+
function x(e) {
|
|
106
|
+
return i(v, s(e, {
|
|
107
|
+
kind: "banner",
|
|
108
|
+
fallbackTone: "info",
|
|
109
|
+
role: "region"
|
|
110
|
+
}));
|
|
111
|
+
}
|
|
112
|
+
export { b as Alert, x as Banner, y as Callout };
|