@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
|
@@ -49,6 +49,11 @@ export interface PendingShortcut {
|
|
|
49
49
|
readonly scope: string;
|
|
50
50
|
readonly completed: number;
|
|
51
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Display text for a shortcut definition such as `mod+k` or `g i`, using the platform's
|
|
54
|
+
* modifier names. Text that is not a shortcut definition is returned unchanged.
|
|
55
|
+
*/
|
|
56
|
+
export declare function formatShortcut(keys: string, platform: ShortcutRegistryOptions["platform"]): string;
|
|
52
57
|
/** Pure registry core. The browser owner supplies active scopes, input context, and event prevention. */
|
|
53
58
|
export declare function createShortcutRegistry(options: ShortcutRegistryOptions): {
|
|
54
59
|
cancelPending: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/shortcut-registry.ts
|
|
2
2
|
var e = /* @__PURE__ */ new Map([
|
|
3
3
|
["esc", "escape"],
|
|
4
4
|
["return", "enter"],
|
|
@@ -48,8 +48,29 @@ function i(e, n) {
|
|
|
48
48
|
if (r(l)) throw Error(`Reserved browser shortcut: ${e}`);
|
|
49
49
|
return l;
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
var a = /* @__PURE__ */ new Map([
|
|
52
|
+
["escape", "Esc"],
|
|
53
|
+
[" ", "Space"],
|
|
54
|
+
["enter", "Enter"]
|
|
55
|
+
]);
|
|
56
|
+
function o(e, t) {
|
|
57
|
+
return [
|
|
58
|
+
e.ctrl ? "Ctrl" : "",
|
|
59
|
+
e.alt ? t === "mac" ? "⌥" : "Alt" : "",
|
|
60
|
+
e.shift ? t === "mac" ? "⇧" : "Shift" : "",
|
|
61
|
+
e.meta ? t === "mac" ? "⌘" : "Meta" : "",
|
|
62
|
+
a.get(e.key) ?? e.key.toUpperCase()
|
|
63
|
+
].filter(Boolean).join("+");
|
|
64
|
+
}
|
|
65
|
+
function s(e, t) {
|
|
66
|
+
try {
|
|
67
|
+
return e.trim().replace(/\s*\+\s*/g, "+").split(/\s+/).map((e) => o(i(e, t), t)).join(" → ");
|
|
68
|
+
} catch {
|
|
69
|
+
return e;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function c(e) {
|
|
73
|
+
let a = /* @__PURE__ */ new Map(), s = 0, c = !1, l, u, d = () => Object.freeze([...a].flatMap(([e, t]) => [...t.values()].flatMap((t) => t.map((n, r) => Object.freeze({
|
|
53
74
|
id: n.id,
|
|
54
75
|
scope: e,
|
|
55
76
|
keys: n.definition.keys,
|
|
@@ -58,12 +79,12 @@ function a(e) {
|
|
|
58
79
|
group: n.definition.group,
|
|
59
80
|
characterOnly: n.characterOnly,
|
|
60
81
|
shadowed: r < t.length - 1
|
|
61
|
-
}))))),
|
|
62
|
-
|
|
63
|
-
},
|
|
82
|
+
}))))), f = () => {
|
|
83
|
+
u !== void 0 && clearTimeout(u), u = void 0, l && (l = void 0, e.onPending?.(Object.freeze([])));
|
|
84
|
+
}, p = (t) => {
|
|
64
85
|
let n = t.definition.run();
|
|
65
86
|
n && Promise.resolve(n).catch((n) => {
|
|
66
|
-
if (!
|
|
87
|
+
if (!c && t.active) try {
|
|
67
88
|
e.onError ? e.onError(n) : queueMicrotask(() => {
|
|
68
89
|
throw n;
|
|
69
90
|
});
|
|
@@ -73,16 +94,16 @@ function a(e) {
|
|
|
73
94
|
});
|
|
74
95
|
}
|
|
75
96
|
});
|
|
76
|
-
},
|
|
77
|
-
|
|
97
|
+
}, m = (t, n, r, i, a) => {
|
|
98
|
+
f(), a?.();
|
|
78
99
|
let o = t.find((e) => e.chords.length === n);
|
|
79
|
-
return o ?
|
|
100
|
+
return o ? p(o) : (l = {
|
|
80
101
|
entries: t,
|
|
81
102
|
completed: n,
|
|
82
103
|
scopes: JSON.stringify(r),
|
|
83
104
|
expires: performance.now() + 1e3,
|
|
84
105
|
characterShortcuts: i
|
|
85
|
-
},
|
|
106
|
+
}, u = setTimeout(f, 1e3), e.onPending?.(Object.freeze(t.map((e) => Object.freeze({
|
|
86
107
|
keys: e.definition.keys,
|
|
87
108
|
displayKeys: e.displayKeys,
|
|
88
109
|
label: e.definition.label,
|
|
@@ -91,29 +112,19 @@ function a(e) {
|
|
|
91
112
|
}))))), !0;
|
|
92
113
|
};
|
|
93
114
|
return {
|
|
94
|
-
cancelPending:
|
|
115
|
+
cancelPending: f,
|
|
95
116
|
register(t) {
|
|
96
|
-
if (
|
|
117
|
+
if (c) throw Error("Cannot register a shortcut on a disposed registry");
|
|
97
118
|
if (t.developmentOnly && !e.development) return () => {};
|
|
98
119
|
if (!t.scope.trim() || !t.label.trim() || !t.group.trim()) throw Error("Shortcuts require nonempty scope, label, and group");
|
|
99
120
|
let r = t.keys.trim().replace(/\s*\+\s*/g, "+").split(/\s+/).map((t, n) => {
|
|
100
121
|
let r = i(t, e.platform);
|
|
101
122
|
if (n > 0 && r.key === "escape" && !r.ctrl && !r.meta && !r.alt && !r.shift) throw Error("Escape is reserved for cancelling a pending sequence");
|
|
102
123
|
return r;
|
|
103
|
-
}),
|
|
104
|
-
["escape", "Esc"],
|
|
105
|
-
[" ", "Space"],
|
|
106
|
-
["enter", "Enter"]
|
|
107
|
-
]), p = r.map((t) => [
|
|
108
|
-
t.ctrl ? "Ctrl" : "",
|
|
109
|
-
t.alt ? e.platform === "mac" ? "⌥" : "Alt" : "",
|
|
110
|
-
t.shift ? e.platform === "mac" ? "⇧" : "Shift" : "",
|
|
111
|
-
t.meta ? e.platform === "mac" ? "⌘" : "Meta" : "",
|
|
112
|
-
f.get(t.key) ?? t.key.toUpperCase()
|
|
113
|
-
].filter(Boolean).join("+")).join(" → "), m = r.every((e) => !e.ctrl && !e.meta && !e.alt && Array.from(e.key).length === 1), h = JSON.stringify(l), g = a.get(t.scope) ?? /* @__PURE__ */ new Map();
|
|
124
|
+
}), u = r.map(n), p = r.map((t) => o(t, e.platform)).join(" → "), m = r.every((e) => !e.ctrl && !e.meta && !e.alt && Array.from(e.key).length === 1), h = JSON.stringify(u), g = a.get(t.scope) ?? /* @__PURE__ */ new Map();
|
|
114
125
|
for (let e of g.values()) {
|
|
115
126
|
let n = e.at(-1);
|
|
116
|
-
if (n && n.chords.length !==
|
|
127
|
+
if (n && n.chords.length !== u.length && n.chords.slice(0, Math.min(n.chords.length, u.length)).every((e, t) => e === u[t])) throw Error(`Ambiguous shortcut prefix in ${t.scope}: "${n.definition.label}" and "${t.label}"`);
|
|
117
128
|
}
|
|
118
129
|
let _ = g.get(h) ?? [], v = _.at(-1);
|
|
119
130
|
if (v) {
|
|
@@ -121,66 +132,65 @@ function a(e) {
|
|
|
121
132
|
if (e.development) throw Error(n);
|
|
122
133
|
(e.warn ?? console.warn)(n);
|
|
123
134
|
}
|
|
124
|
-
|
|
135
|
+
f();
|
|
125
136
|
let y = {
|
|
126
137
|
definition: Object.freeze({ ...t }),
|
|
127
|
-
chords:
|
|
138
|
+
chords: u,
|
|
128
139
|
displayKeys: p,
|
|
129
140
|
characterOnly: m,
|
|
130
|
-
id: ++
|
|
141
|
+
id: ++s,
|
|
131
142
|
active: !0
|
|
132
143
|
};
|
|
133
|
-
return _.push(y), g.set(h, _), a.set(t.scope, g), e.onChange?.(
|
|
134
|
-
|
|
144
|
+
return _.push(y), g.set(h, _), a.set(t.scope, g), e.onChange?.(d()), () => {
|
|
145
|
+
l?.entries.includes(y) && f(), y.active = !1;
|
|
135
146
|
let n = _.indexOf(y);
|
|
136
|
-
n < 0 || (_.splice(n, 1), _.length || g.delete(h), g.size || a.delete(t.scope), e.onChange?.(
|
|
147
|
+
n < 0 || (_.splice(n, 1), _.length || g.delete(h), g.size || a.delete(t.scope), e.onChange?.(d()));
|
|
137
148
|
};
|
|
138
149
|
},
|
|
139
150
|
dispatch(e, i, o) {
|
|
140
|
-
if (
|
|
141
|
-
if (e.composing) return
|
|
142
|
-
let
|
|
143
|
-
key:
|
|
151
|
+
if (c || e.repeat) return !1;
|
|
152
|
+
if (e.composing) return f(), !1;
|
|
153
|
+
let s = t(e.key), u = e.characterShortcuts !== !1, d = {
|
|
154
|
+
key: s,
|
|
144
155
|
ctrl: e.ctrlKey,
|
|
145
156
|
meta: e.metaKey,
|
|
146
157
|
alt: e.altKey,
|
|
147
|
-
shift: e.shiftKey && !(
|
|
158
|
+
shift: e.shiftKey && !(s.length === 1 && /[^a-z0-9 ]/.test(s))
|
|
148
159
|
};
|
|
149
|
-
if (r(
|
|
150
|
-
if (
|
|
151
|
-
if (
|
|
160
|
+
if (r(d) || e.editing && !d.ctrl && !d.meta) return f(), !1;
|
|
161
|
+
if (l && (l.characterShortcuts !== u || l.scopes !== JSON.stringify(i) || performance.now() >= l.expires) && f(), l) {
|
|
162
|
+
if (s === "escape" && !d.ctrl && !d.meta && !d.alt && !d.shift) return f(), o?.(), !0;
|
|
152
163
|
if ([
|
|
153
164
|
"control",
|
|
154
165
|
"meta",
|
|
155
166
|
"alt",
|
|
156
167
|
"shift"
|
|
157
|
-
].includes(
|
|
158
|
-
let e =
|
|
159
|
-
if (r.length) return
|
|
160
|
-
|
|
168
|
+
].includes(s)) return !1;
|
|
169
|
+
let e = l, t = e.completed + 1, r = e.entries.filter((t) => t.active && t.chords[e.completed] === n(d));
|
|
170
|
+
if (r.length) return m(r, t, i, u, o);
|
|
171
|
+
f();
|
|
161
172
|
}
|
|
162
173
|
for (let e of [...i].reverse()) {
|
|
163
174
|
let t = [...a.get(e)?.values() ?? []].flatMap((e) => {
|
|
164
175
|
let t = e.at(-1);
|
|
165
|
-
return t?.chords[0] === n(
|
|
176
|
+
return t?.chords[0] === n(d) && (u || !t.characterOnly) ? [t] : [];
|
|
166
177
|
});
|
|
167
|
-
if (t.length) return
|
|
178
|
+
if (t.length) return m(t, 1, i, u, o);
|
|
168
179
|
}
|
|
169
180
|
return !1;
|
|
170
181
|
},
|
|
171
|
-
snapshot:
|
|
182
|
+
snapshot: d,
|
|
172
183
|
run(e) {
|
|
173
|
-
if (
|
|
184
|
+
if (c || !Number.isSafeInteger(e)) return !1;
|
|
174
185
|
for (let t of a.values()) for (let n of t.values()) {
|
|
175
186
|
let t = n.at(-1);
|
|
176
|
-
if (t?.id === e && t.active) return
|
|
187
|
+
if (t?.id === e && t.active) return f(), p(t), !0;
|
|
177
188
|
}
|
|
178
189
|
return !1;
|
|
179
190
|
},
|
|
180
191
|
dispose() {
|
|
181
|
-
|
|
192
|
+
c || (c = !0, f(), a.clear(), e.onChange?.(d()));
|
|
182
193
|
}
|
|
183
194
|
};
|
|
184
195
|
}
|
|
185
|
-
|
|
186
|
-
export { a as createShortcutRegistry };
|
|
196
|
+
export { c as createShortcutRegistry, s as formatShortcut };
|
package/dist/vite.js
CHANGED
|
@@ -2,7 +2,7 @@ import { readFile as e } from "node:fs/promises";
|
|
|
2
2
|
import { createRequire as t } from "node:module";
|
|
3
3
|
import { resolve as n } from "node:path";
|
|
4
4
|
import { fileURLToPath as r } from "node:url";
|
|
5
|
-
|
|
5
|
+
// src/vite.ts
|
|
6
6
|
var i = [
|
|
7
7
|
"solid-js/web",
|
|
8
8
|
"@gemologic/sheen/solid-web",
|
|
@@ -43,12 +43,11 @@ function a() {
|
|
|
43
43
|
try {
|
|
44
44
|
a = i.resolve("solid-js/package.json");
|
|
45
45
|
} catch {
|
|
46
|
-
throw Error("sheenRuntime requires solid-js@1.9.
|
|
46
|
+
throw Error("sheenRuntime requires solid-js@1.9.19 as an application dependency");
|
|
47
47
|
}
|
|
48
48
|
let o = JSON.parse(await e(a, "utf8"));
|
|
49
|
-
if (typeof o != "object" || !o || !("version" in o) || o.version !== "1.9.
|
|
49
|
+
if (typeof o != "object" || !o || !("version" in o) || o.version !== "1.9.19") throw Error("sheenRuntime is qualified for solid-js@1.9.19; install that version before using its vendored DOM renderer");
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
//#endregion
|
|
54
53
|
export { a as sheenRuntime };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gemologic/sheen",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Accessible, themeable SolidJS components for application interfaces.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -108,6 +108,16 @@
|
|
|
108
108
|
"solid": "./src/navigation.ts",
|
|
109
109
|
"import": "./dist/navigation.js"
|
|
110
110
|
},
|
|
111
|
+
"./ai": {
|
|
112
|
+
"types": "./dist/ai.d.ts",
|
|
113
|
+
"solid": "./src/ai.ts",
|
|
114
|
+
"import": "./dist/ai.js"
|
|
115
|
+
},
|
|
116
|
+
"./sortable": {
|
|
117
|
+
"types": "./dist/sortable.d.ts",
|
|
118
|
+
"solid": "./src/sortable.ts",
|
|
119
|
+
"import": "./dist/sortable.js"
|
|
120
|
+
},
|
|
111
121
|
"./formisch": {
|
|
112
122
|
"types": "./dist/formisch.d.ts",
|
|
113
123
|
"solid": "./src/formisch.ts",
|
|
@@ -123,11 +133,17 @@
|
|
|
123
133
|
"solid": "./src/metadata.ts",
|
|
124
134
|
"import": "./dist/metadata.js"
|
|
125
135
|
},
|
|
126
|
-
"./styles.css": "./src/styles.css"
|
|
136
|
+
"./styles.css": "./src/styles.css",
|
|
137
|
+
"./styles/core.css": "./src/styles/core.css",
|
|
138
|
+
"./styles/forms.css": "./src/styles/forms.css",
|
|
139
|
+
"./styles/overlays.css": "./src/styles/overlays.css",
|
|
140
|
+
"./styles/navigation.css": "./src/styles/navigation.css",
|
|
141
|
+
"./styles/ai.css": "./src/styles/ai.css",
|
|
142
|
+
"./styles/sortable.css": "./src/styles/sortable.css"
|
|
127
143
|
},
|
|
128
144
|
"peerDependencies": {
|
|
129
145
|
"@formisch/solid": ">=1 <2",
|
|
130
|
-
"solid-js": "1.9.
|
|
146
|
+
"solid-js": "1.9.19",
|
|
131
147
|
"vite": ">=8 <9"
|
|
132
148
|
},
|
|
133
149
|
"peerDependenciesMeta": {
|
|
@@ -139,8 +155,10 @@
|
|
|
139
155
|
}
|
|
140
156
|
},
|
|
141
157
|
"dependencies": {
|
|
158
|
+
"@atlaskit/pragmatic-drag-and-drop": "3.1.0",
|
|
159
|
+
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "3.1.0",
|
|
142
160
|
"@corvu/resizable": "0.2.5",
|
|
143
|
-
"@gemologic/sheen-tokens": "0.
|
|
161
|
+
"@gemologic/sheen-tokens": "0.3.0",
|
|
144
162
|
"@floating-ui/dom": "^1.5.1",
|
|
145
163
|
"@internationalized/number": "^3.2.1",
|
|
146
164
|
"@solid-primitives/event-listener": "^2.2.14",
|
|
@@ -157,7 +175,7 @@
|
|
|
157
175
|
},
|
|
158
176
|
"devDependencies": {
|
|
159
177
|
"@formisch/solid": "1.0.0",
|
|
160
|
-
"solid-js": "1.9.
|
|
178
|
+
"solid-js": "1.9.19",
|
|
161
179
|
"valibot": "1.4.2"
|
|
162
180
|
},
|
|
163
181
|
"scripts": {
|
package/src/ai.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { PromptInput } from "./primitives/PromptInput.tsx";
|
|
2
|
+
export type { PromptInputProps, PromptInputStatus } from "./primitives/PromptInput.tsx";
|
|
3
|
+
export { Message } from "./primitives/Message.tsx";
|
|
4
|
+
export type { MessageProps, MessageFrom } from "./primitives/Message.tsx";
|
|
5
|
+
export { Conversation } from "./primitives/Conversation.tsx";
|
|
6
|
+
export type { ConversationProps, ConversationItem } from "./primitives/Conversation.tsx";
|
|
7
|
+
export { StreamingText } from "./primitives/StreamingText.tsx";
|
|
8
|
+
export type { StreamingTextProps } from "./primitives/StreamingText.tsx";
|
package/src/core.ts
CHANGED
|
@@ -27,16 +27,23 @@ export type { OptimisticRevert } from "./utils/optimistic.ts";
|
|
|
27
27
|
|
|
28
28
|
export { Stack, Row, Row as Cluster, Grid, Container, Center, Spacer } from "./layout/Layout.tsx";
|
|
29
29
|
export type { StackProps, RowProps, GridProps, ContainerProps, CenterProps, SpacerProps, Spacing, Alignment, Justification } from "./layout/Layout.tsx";
|
|
30
|
-
export { Text, Heading, Code, Kbd } from "./primitives/Typography.tsx";
|
|
31
|
-
export
|
|
30
|
+
export { Text, Heading, Code, Kbd, Prose } from "./primitives/Typography.tsx";
|
|
31
|
+
export { Glyph, glyphNames } from "./primitives/Glyph.tsx";
|
|
32
|
+
export { createMediaQuery, useBreakpoint } from "./utils/media-query.ts";
|
|
33
|
+
export { breakpointNames, breakpointQuery, breakpoints } from "@gemologic/sheen-tokens/catalog";
|
|
34
|
+
export type { BreakpointName } from "@gemologic/sheen-tokens/catalog";
|
|
35
|
+
export { List, ListItem } from "./primitives/List.tsx";
|
|
36
|
+
export type { ListProps, ListItemProps } from "./primitives/List.tsx";
|
|
37
|
+
export type { GlyphName, GlyphProps } from "./primitives/Glyph.tsx";
|
|
38
|
+
export type { TextProps, HeadingProps, CodeProps, KbdProps, ProseProps } from "./primitives/Typography.tsx";
|
|
32
39
|
export { Badge, Tag } from "./primitives/Status.tsx";
|
|
33
40
|
export type { BadgeProps, TagProps, StatusTone } from "./primitives/Status.tsx";
|
|
34
41
|
export { Surface, Card } from "./primitives/Surface.tsx";
|
|
35
42
|
export type { SurfaceProps, CardProps } from "./primitives/Surface.tsx";
|
|
36
43
|
export { Separator } from "./primitives/Separator.tsx";
|
|
37
44
|
export type { SeparatorProps } from "./primitives/Separator.tsx";
|
|
38
|
-
export { Alert, Callout } from "./primitives/Notice.tsx";
|
|
39
|
-
export type { AlertProps, CalloutProps } from "./primitives/Notice.tsx";
|
|
45
|
+
export { Alert, Banner, Callout } from "./primitives/Notice.tsx";
|
|
46
|
+
export type { AlertProps, BannerProps, CalloutProps, NoticeTone } from "./primitives/Notice.tsx";
|
|
40
47
|
export { DescriptionList, DescriptionTerm, DescriptionDetails } from "./primitives/DescriptionList.tsx";
|
|
41
48
|
export type { DescriptionListProps, DescriptionTermProps, DescriptionDetailsProps } from "./primitives/DescriptionList.tsx";
|
|
42
49
|
export { Skeleton } from "./primitives/Skeleton.tsx";
|
package/src/forms.ts
CHANGED
|
@@ -3,6 +3,8 @@ export type { FieldProps, FieldControlProps } from "./primitives/Field.tsx";
|
|
|
3
3
|
export { Input } from "./primitives/Input.tsx";
|
|
4
4
|
export type { InputProps } from "./primitives/Input.tsx";
|
|
5
5
|
export { InputGroup } from "./primitives/InputGroup.tsx";
|
|
6
|
+
export { Form, FormSection, FormActions } from "./primitives/Form.tsx";
|
|
7
|
+
export type { FormProps, FormSectionProps, FormActionsProps } from "./primitives/Form.tsx";
|
|
6
8
|
export type { InputGroupProps } from "./primitives/InputGroup.tsx";
|
|
7
9
|
export { SearchInput } from "./primitives/SearchInput.tsx";
|
|
8
10
|
export type { SearchInputProps } from "./primitives/SearchInput.tsx";
|
package/src/index.ts
CHANGED
|
@@ -23,7 +23,8 @@ export { createConfirm } from "./primitives/create-confirm.tsx";
|
|
|
23
23
|
export type { ConfirmController, ConfirmOptions } from "./primitives/create-confirm.tsx";
|
|
24
24
|
export { Tooltip } from "./primitives/Tooltip.tsx";
|
|
25
25
|
export { createShortcutRegistry } from "./utils/shortcut-registry.ts";
|
|
26
|
-
export { ShortcutProvider, useShortcut, usePendingShortcut, useShortcutBindings, useShortcutCommands } from "./primitives/ShortcutProvider.tsx";
|
|
26
|
+
export { ShortcutProvider, useShortcut, useShortcutLabel, usePendingShortcut, useShortcutBindings, useShortcutCommands } from "./primitives/ShortcutProvider.tsx";
|
|
27
|
+
export { formatShortcut } from "./utils/shortcut-registry.ts";
|
|
27
28
|
export { ShortcutSheet } from "./primitives/ShortcutSheet.tsx";
|
|
28
29
|
export { ShortcutPending } from "./primitives/ShortcutPending.tsx";
|
|
29
30
|
export { ShortcutScope } from "./primitives/ShortcutScope.tsx";
|
|
@@ -44,6 +45,8 @@ export type { ContextMenuProps } from "./primitives/ContextMenu.tsx";
|
|
|
44
45
|
export { CommandPalette, commandPaletteFilter } from "./primitives/CommandPalette.tsx";
|
|
45
46
|
export type { CommandPaletteProps, CommandPaletteCommand, CommandPaletteSource, CommandPaletteStaticSource, CommandPaletteRemoteSource, CommandPaletteRecents } from "./primitives/CommandPalette.tsx";
|
|
46
47
|
export { cn } from "./utils/cn.ts";
|
|
48
|
+
export { flashChange } from "./utils/change-motion.ts";
|
|
49
|
+
export type { ChangeDirection } from "./utils/change-motion.ts";
|
|
47
50
|
export { useOnlineStatus, useIsWindowFocused } from "./utils/browser-status.ts";
|
|
48
51
|
export { optimistic } from "./utils/optimistic.ts";
|
|
49
52
|
export type { OptimisticRevert } from "./utils/optimistic.ts";
|
|
@@ -58,18 +61,25 @@ export type { Messages } from "./theme/messages.ts";
|
|
|
58
61
|
export { useNumberFormatter, useDateFormatter } from "./theme/intl.ts";
|
|
59
62
|
export { Stack, Row, Row as Cluster, Grid, Container, Center, Spacer } from "./layout/Layout.tsx";
|
|
60
63
|
export type { StackProps, RowProps, GridProps, ContainerProps, CenterProps, SpacerProps, Spacing, Alignment, Justification } from "./layout/Layout.tsx";
|
|
61
|
-
export { Text, Heading, Code, Kbd } from "./primitives/Typography.tsx";
|
|
64
|
+
export { Text, Heading, Code, Kbd, Prose } from "./primitives/Typography.tsx";
|
|
65
|
+
export { Glyph, glyphNames } from "./primitives/Glyph.tsx";
|
|
66
|
+
export { createMediaQuery, useBreakpoint } from "./utils/media-query.ts";
|
|
67
|
+
export { breakpointNames, breakpointQuery, breakpoints } from "@gemologic/sheen-tokens/catalog";
|
|
68
|
+
export type { BreakpointName } from "@gemologic/sheen-tokens/catalog";
|
|
69
|
+
export { List, ListItem } from "./primitives/List.tsx";
|
|
70
|
+
export type { ListProps, ListItemProps } from "./primitives/List.tsx";
|
|
71
|
+
export type { GlyphName, GlyphProps } from "./primitives/Glyph.tsx";
|
|
62
72
|
export { NumberText } from "./primitives/NumberText.tsx";
|
|
63
73
|
export type { NumberTextProps } from "./primitives/NumberText.tsx";
|
|
64
|
-
export type { TextProps, HeadingProps, CodeProps, KbdProps } from "./primitives/Typography.tsx";
|
|
74
|
+
export type { TextProps, HeadingProps, CodeProps, KbdProps, ProseProps } from "./primitives/Typography.tsx";
|
|
65
75
|
export { Badge, Tag } from "./primitives/Status.tsx";
|
|
66
76
|
export type { BadgeProps, TagProps, StatusTone } from "./primitives/Status.tsx";
|
|
67
77
|
export { Surface, Card } from "./primitives/Surface.tsx";
|
|
68
78
|
export type { SurfaceProps, CardProps } from "./primitives/Surface.tsx";
|
|
69
79
|
export { Separator } from "./primitives/Separator.tsx";
|
|
70
80
|
export type { SeparatorProps } from "./primitives/Separator.tsx";
|
|
71
|
-
export { Alert, Callout } from "./primitives/Notice.tsx";
|
|
72
|
-
export type { AlertProps, CalloutProps } from "./primitives/Notice.tsx";
|
|
81
|
+
export { Alert, Banner, Callout } from "./primitives/Notice.tsx";
|
|
82
|
+
export type { AlertProps, BannerProps, CalloutProps, NoticeTone } from "./primitives/Notice.tsx";
|
|
73
83
|
export { DescriptionList, DescriptionTerm, DescriptionDetails } from "./primitives/DescriptionList.tsx";
|
|
74
84
|
export type { DescriptionListProps, DescriptionTermProps, DescriptionDetailsProps } from "./primitives/DescriptionList.tsx";
|
|
75
85
|
export { Skeleton } from "./primitives/Skeleton.tsx";
|
|
@@ -81,6 +91,8 @@ export type { SpinnerProps } from "./primitives/Spinner.tsx";
|
|
|
81
91
|
export { Field } from "./primitives/Field.tsx";
|
|
82
92
|
export type { FieldProps, FieldControlProps } from "./primitives/Field.tsx";
|
|
83
93
|
export { InputGroup } from "./primitives/InputGroup.tsx";
|
|
94
|
+
export { Form, FormSection, FormActions } from "./primitives/Form.tsx";
|
|
95
|
+
export type { FormProps, FormSectionProps, FormActionsProps } from "./primitives/Form.tsx";
|
|
84
96
|
export type { InputGroupProps } from "./primitives/InputGroup.tsx";
|
|
85
97
|
export { SearchInput } from "./primitives/SearchInput.tsx";
|
|
86
98
|
export type { SearchInputProps } from "./primitives/SearchInput.tsx";
|
|
@@ -144,3 +156,11 @@ export { Tree, TreeItem } from "./primitives/Tree.tsx";
|
|
|
144
156
|
export type { TreeProps, TreeItemProps, TreeSelectionMode } from "./primitives/Tree.tsx";
|
|
145
157
|
export { Resizable, ResizablePanel, ResizableHandle } from "./primitives/Resizable.tsx";
|
|
146
158
|
export type { ResizableProps, ResizablePanelProps, ResizableHandleProps, ResizablePersistence } from "./primitives/Resizable.tsx";
|
|
159
|
+
export { PromptInput } from "./primitives/PromptInput.tsx";
|
|
160
|
+
export type { PromptInputProps, PromptInputStatus } from "./primitives/PromptInput.tsx";
|
|
161
|
+
export { Message } from "./primitives/Message.tsx";
|
|
162
|
+
export type { MessageProps, MessageFrom } from "./primitives/Message.tsx";
|
|
163
|
+
export { Conversation } from "./primitives/Conversation.tsx";
|
|
164
|
+
export type { ConversationProps, ConversationItem } from "./primitives/Conversation.tsx";
|
|
165
|
+
export { StreamingText } from "./primitives/StreamingText.tsx";
|
|
166
|
+
export type { StreamingTextProps } from "./primitives/StreamingText.tsx";
|
package/src/navigation.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { createShortcutRegistry } from "./utils/shortcut-registry.ts";
|
|
2
2
|
export type { PendingShortcut, ShortcutAction, ShortcutBinding, ShortcutDefinition, ShortcutInput, ShortcutRegistryOptions } from "./utils/shortcut-registry.ts";
|
|
3
|
-
export { ShortcutProvider, useShortcut, usePendingShortcut, useShortcutBindings, useShortcutCommands } from "./primitives/ShortcutProvider.tsx";
|
|
3
|
+
export { ShortcutProvider, useShortcut, useShortcutLabel, usePendingShortcut, useShortcutBindings, useShortcutCommands } from "./primitives/ShortcutProvider.tsx";
|
|
4
|
+
export { formatShortcut } from "./utils/shortcut-registry.ts";
|
|
4
5
|
export type { ShortcutProviderProps } from "./primitives/ShortcutProvider.tsx";
|
|
5
6
|
export { ShortcutSheet } from "./primitives/ShortcutSheet.tsx";
|
|
6
7
|
export type { ShortcutSheetProps } from "./primitives/ShortcutSheet.tsx";
|
|
@@ -134,7 +134,7 @@ export function AccordionItem(props: AccordionItemProps): JSX.Element {
|
|
|
134
134
|
});
|
|
135
135
|
return <Primitive.Item {...others} id={id()} value={local.value} disabled={local.disabled ?? false} class={cn("sheen-accordion-item", local.class)}>
|
|
136
136
|
<Primitive.Header as={heading()} class="sheen-accordion-heading">
|
|
137
|
-
<Primitive.Trigger as={Button} ref={trigger} data-sheen-accordion-trigger="" id={`${id()}-trigger`} aria-controls={`${id()}-content`} aria-disabled={open() && !options.multiple() && !options.collapsible() || undefined} class="sheen-collapsible-trigger">
|
|
137
|
+
<Primitive.Trigger as={Button} variant="ghost" ref={trigger} data-sheen-accordion-trigger="" id={`${id()}-trigger`} aria-controls={`${id()}-content`} aria-disabled={open() && !options.multiple() && !options.collapsible() || undefined} class="sheen-collapsible-trigger">
|
|
138
138
|
<span class="sheen-collapsible-indicator" aria-hidden="true" />{local.label}
|
|
139
139
|
</Primitive.Trigger>
|
|
140
140
|
</Primitive.Header>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { For, Show, createMemo, splitProps } from "solid-js";
|
|
2
|
+
import { Glyph } from "./Glyph.tsx";
|
|
2
3
|
import type { JSX } from "solid-js";
|
|
3
4
|
import { useTheme } from "../theme/ThemeProvider.tsx";
|
|
4
5
|
import type { Messages } from "../theme/messages.ts";
|
|
@@ -31,11 +32,11 @@ function stateLabel(state: WorkflowState, messages: Messages): string {
|
|
|
31
32
|
return messages.workflowUpcoming;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
function marker(state: WorkflowState):
|
|
35
|
-
if (state === "completed") return "
|
|
36
|
-
if (state === "current") return "
|
|
37
|
-
if (state === "error") return "
|
|
38
|
-
return "
|
|
35
|
+
function marker(state: WorkflowState): JSX.Element {
|
|
36
|
+
if (state === "completed") return <Glyph name="check" />;
|
|
37
|
+
if (state === "current") return <Glyph name="dot" />;
|
|
38
|
+
if (state === "error") return <Glyph name="alert" />;
|
|
39
|
+
return "";
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
/** A stable-ID chronological activity list with explicit non-color state labels. */
|
|
@@ -63,8 +64,12 @@ export function ActivityTimeline(props: ActivityTimelineProps): JSX.Element {
|
|
|
63
64
|
<article class="sheen-activity-timeline-content">
|
|
64
65
|
<header><strong>{current().title}</strong><span class="sheen-workflow-state">{stateLabel(current().state, theme.messages())}</span></header>
|
|
65
66
|
<Show when={current().description}>{description => <p>{description()}</p>}</Show>
|
|
66
|
-
<Show when={current().actor
|
|
67
|
-
|
|
67
|
+
<Show when={current().actor || (current().timestamp && current().timeLabel)}>
|
|
68
|
+
<div class="sheen-activity-timeline-meta">
|
|
69
|
+
<Show when={current().actor}>{actor => <span class="sheen-activity-timeline-actor">{actor()}</span>}</Show>
|
|
70
|
+
<Show when={current().timestamp && current().timeLabel}><time dateTime={current().timestamp}>{current().timeLabel}</time></Show>
|
|
71
|
+
</div>
|
|
72
|
+
</Show>
|
|
68
73
|
</article>
|
|
69
74
|
</li>}</Show>;
|
|
70
75
|
}}</For>
|