@askrjs/themes 0.0.11 → 0.0.13
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 +5 -5
- package/THEMING.md +2 -2
- package/dist/components/_internal/block-layout.d.ts +1 -2
- package/dist/components/_internal/block-layout.js +1 -3
- package/dist/components/_internal/block-layout.js.map +1 -1
- package/dist/components/_internal/classes.js +0 -2
- package/dist/components/_internal/jsx.js +9 -3
- package/dist/components/_internal/jsx.js.map +1 -1
- package/dist/components/_internal/merge-props.js +0 -2
- package/dist/components/_internal/pathname.js +0 -2
- package/dist/components/_internal/style.js +0 -2
- package/dist/components/alert/alert.d.ts +1 -3
- package/dist/components/alert/alert.js +0 -2
- package/dist/components/alert/alert.js.map +1 -1
- package/dist/components/alert/alert.types.d.ts +1 -3
- package/dist/components/alert/index.d.ts +2 -1
- package/dist/components/aside/aside.d.ts +1 -3
- package/dist/components/aside/aside.js +0 -2
- package/dist/components/aside/aside.types.d.ts +2 -2
- package/dist/components/aside/index.d.ts +2 -1
- package/dist/components/aspect-ratio/aspect-ratio.d.ts +1 -3
- package/dist/components/aspect-ratio/aspect-ratio.js +2 -6
- package/dist/components/aspect-ratio/aspect-ratio.js.map +1 -1
- package/dist/components/aspect-ratio/aspect-ratio.types.d.ts +1 -3
- package/dist/components/aspect-ratio/index.d.ts +2 -1
- package/dist/components/badge/badge.d.ts +1 -3
- package/dist/components/badge/badge.js +2 -6
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/components/badge/badge.types.d.ts +1 -3
- package/dist/components/badge/index.d.ts +2 -1
- package/dist/components/block/block.d.ts +1 -3
- package/dist/components/block/block.js +2 -6
- package/dist/components/block/block.js.map +1 -1
- package/dist/components/block/block.types.d.ts +2 -4
- package/dist/components/block/index.d.ts +2 -1
- package/dist/components/brand/brand.d.ts +1 -3
- package/dist/components/brand/brand.js +4 -7
- package/dist/components/brand/brand.js.map +1 -1
- package/dist/components/brand/brand.types.d.ts +1 -3
- package/dist/components/brand/index.d.ts +2 -1
- package/dist/components/button-group/button-group.d.ts +1 -3
- package/dist/components/button-group/button-group.js +0 -2
- package/dist/components/button-group/button-group.js.map +1 -1
- package/dist/components/button-group/button-group.types.d.ts +1 -3
- package/dist/components/button-group/index.d.ts +2 -1
- package/dist/components/card/card.d.ts +1 -3
- package/dist/components/card/card.js +0 -2
- package/dist/components/card/card.types.d.ts +1 -3
- package/dist/components/card/index.d.ts +2 -1
- package/dist/components/catalog.d.ts +1 -3
- package/dist/components/catalog.js +2 -3
- package/dist/components/catalog.js.map +1 -1
- package/dist/components/close/close.d.ts +1 -3
- package/dist/components/close/close.js +0 -2
- package/dist/components/close/close.types.d.ts +1 -3
- package/dist/components/close/index.d.ts +2 -1
- package/dist/components/container/container.d.ts +1 -3
- package/dist/components/container/container.js +0 -2
- package/dist/components/container/container.types.d.ts +2 -2
- package/dist/components/container/index.d.ts +2 -1
- package/dist/components/empty-state/empty-state.d.ts +1 -3
- package/dist/components/empty-state/empty-state.js +0 -2
- package/dist/components/empty-state/empty-state.types.d.ts +2 -2
- package/dist/components/empty-state/index.d.ts +2 -1
- package/dist/components/field/field.d.ts +1 -3
- package/dist/components/field/field.js +0 -2
- package/dist/components/field/field.types.d.ts +1 -3
- package/dist/components/field/index.d.ts +2 -1
- package/dist/components/footer/footer.d.ts +1 -3
- package/dist/components/footer/footer.js +0 -2
- package/dist/components/footer/footer.types.d.ts +2 -3
- package/dist/components/footer/index.d.ts +2 -1
- package/dist/components/grid/grid.d.ts +1 -3
- package/dist/components/grid/grid.js +2 -7
- package/dist/components/grid/grid.js.map +1 -1
- package/dist/components/grid/grid.types.d.ts +1 -3
- package/dist/components/grid/index.d.ts +2 -1
- package/dist/components/header/header.d.ts +1 -3
- package/dist/components/header/header.js +0 -2
- package/dist/components/header/header.types.d.ts +2 -2
- package/dist/components/header/index.d.ts +2 -1
- package/dist/components/input-group/index.d.ts +2 -1
- package/dist/components/input-group/input-group.d.ts +1 -3
- package/dist/components/input-group/input-group.js +2 -6
- package/dist/components/input-group/input-group.js.map +1 -1
- package/dist/components/input-group/input-group.types.d.ts +1 -3
- package/dist/components/main/index.d.ts +2 -1
- package/dist/components/main/main.d.ts +1 -3
- package/dist/components/main/main.js +0 -2
- package/dist/components/main/main.types.d.ts +2 -2
- package/dist/components/nav/index.d.ts +2 -1
- package/dist/components/nav/nav.d.ts +1 -3
- package/dist/components/nav/nav.js +22 -17
- package/dist/components/nav/nav.js.map +1 -1
- package/dist/components/nav/nav.types.d.ts +1 -3
- package/dist/components/navbar/index.d.ts +3 -1
- package/dist/components/navbar/navbar.d.ts +1 -3
- package/dist/components/navbar/navbar.js +9 -10
- package/dist/components/navbar/navbar.js.map +1 -1
- package/dist/components/navbar/navbar.types.d.ts +2 -3
- package/dist/components/overlays/dropdown-content.d.ts +1 -3
- package/dist/components/overlays/dropdown-content.js +0 -2
- package/dist/components/page/index.d.ts +2 -1
- package/dist/components/page/page.d.ts +1 -3
- package/dist/components/page/page.js +0 -2
- package/dist/components/page/page.types.d.ts +2 -2
- package/dist/components/page-header/index.d.ts +2 -1
- package/dist/components/page-header/page-header.d.ts +1 -3
- package/dist/components/page-header/page-header.js +0 -2
- package/dist/components/page-header/page-header.types.d.ts +2 -2
- package/dist/components/section/index.d.ts +2 -1
- package/dist/components/section/section.d.ts +1 -3
- package/dist/components/section/section.js +0 -2
- package/dist/components/section/section.types.d.ts +2 -2
- package/dist/components/separator/index.d.ts +2 -1
- package/dist/components/separator/separator.d.ts +1 -3
- package/dist/components/separator/separator.js +2 -6
- package/dist/components/separator/separator.js.map +1 -1
- package/dist/components/separator/separator.types.d.ts +1 -3
- package/dist/components/sidebar/index.d.ts +2 -1
- package/dist/components/sidebar/sidebar.d.ts +2 -4
- package/dist/components/sidebar/sidebar.js +5 -10
- package/dist/components/sidebar/sidebar.js.map +1 -1
- package/dist/components/sidebar/sidebar.types.d.ts +2 -2
- package/dist/components/skeleton/index.d.ts +2 -1
- package/dist/components/skeleton/skeleton.d.ts +1 -3
- package/dist/components/skeleton/skeleton.js +8 -10
- package/dist/components/skeleton/skeleton.js.map +1 -1
- package/dist/components/skeleton/skeleton.types.d.ts +1 -3
- package/dist/components/spinner/index.d.ts +2 -1
- package/dist/components/spinner/spinner.d.ts +1 -3
- package/dist/components/spinner/spinner.js +0 -2
- package/dist/components/spinner/spinner.types.d.ts +1 -3
- package/dist/components/stat/index.d.ts +2 -1
- package/dist/components/stat/stat.d.ts +1 -3
- package/dist/components/stat/stat.js +0 -2
- package/dist/components/stat/stat.types.d.ts +1 -3
- package/dist/components/text/index.d.ts +2 -1
- package/dist/components/text/text.d.ts +1 -3
- package/dist/components/text/text.js +2 -7
- package/dist/components/text/text.js.map +1 -1
- package/dist/components/text/text.types.d.ts +1 -3
- package/dist/components/theme/index.d.ts +2 -1
- package/dist/components/theme/theme.d.ts +5 -7
- package/dist/components/theme/theme.js +102 -72
- package/dist/components/theme/theme.js.map +1 -1
- package/dist/components/toolbar/index.d.ts +2 -1
- package/dist/components/toolbar/toolbar.d.ts +1 -3
- package/dist/components/toolbar/toolbar.js +0 -2
- package/dist/components/toolbar/toolbar.types.d.ts +2 -2
- package/dist/components.d.ts +34 -4
- package/dist/components.js +4 -4
- package/dist/controls.d.ts +4 -0
- package/dist/core.d.ts +18 -2
- package/dist/navs.d.ts +1 -0
- package/dist/overlays.d.ts +2 -2
- package/dist/overlays.js +2 -2
- package/dist/surfaces.d.ts +8 -0
- package/dist/theme.d.ts +3 -2
- package/dist/theme.js +2 -2
- package/dist/themes/default/index.css +3 -3
- package/package.json +39 -16
- package/src/components/_internal/jsx.ts +11 -0
- package/src/components/alert/alert.tsx +1 -1
- package/src/components/aspect-ratio/aspect-ratio.tsx +2 -1
- package/src/components/badge/badge.tsx +2 -1
- package/src/components/block/block.tsx +2 -2
- package/src/components/brand/brand.tsx +3 -3
- package/src/components/button-group/button-group.tsx +1 -1
- package/src/components/catalog.tsx +3 -1
- package/src/components/grid/grid.tsx +2 -2
- package/src/components/input-group/input-group.tsx +3 -2
- package/src/components/nav/nav.tsx +25 -19
- package/src/components/navbar/navbar.tsx +22 -14
- package/src/components/separator/separator.tsx +2 -1
- package/src/components/sidebar/index.ts +1 -1
- package/src/components/sidebar/sidebar.tsx +7 -7
- package/src/components/skeleton/skeleton.tsx +8 -10
- package/src/components/text/text.tsx +2 -2
- package/src/components/theme/index.ts +4 -4
- package/src/components/theme/theme.tsx +135 -99
- package/src/components.ts +4 -4
- package/src/overlays.ts +3 -3
- package/src/theme.ts +4 -4
- package/src/themes/default/styles/display/coverage.css +1 -1
- package/src/themes/default/styles/overlays/toast.css +1 -1
- package/src/themes/default/styles/shell/sidebar.css +1 -1
- package/templates/theme/styles/display/coverage.css +1 -1
- package/templates/theme/styles/overlays/toast.css +1 -1
- package/templates/theme/styles/shell/sidebar.css +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Button } from "@askrjs/ui";
|
|
2
|
-
import { jsx
|
|
3
|
-
import {
|
|
4
|
-
import { resource } from "@askrjs/askr/resources";
|
|
2
|
+
import { jsx } from "@askrjs/askr/jsx-runtime";
|
|
3
|
+
import { defineScope, getSignal, readScope, state } from "@askrjs/askr";
|
|
5
4
|
//#region src/components/theme/theme.tsx
|
|
6
5
|
const CAT_THEME_NAMES = [
|
|
7
6
|
"tabby",
|
|
@@ -49,80 +48,116 @@ const CAT_THEME_OPTIONS = [
|
|
|
49
48
|
const DEFAULT_STORAGE_KEY = "askr-theme";
|
|
50
49
|
const STATIC_CHILDREN = Symbol.for("askr.static-children");
|
|
51
50
|
const STATIC_CHILD_SLOTS_CACHE = Symbol.for("__askrStaticChildSlots");
|
|
52
|
-
|
|
53
|
-
let explicitRootThemeOwner;
|
|
54
|
-
const registeredProviderSignals = /* @__PURE__ */ new WeakSet();
|
|
55
|
-
const ThemeContext = defineContext({
|
|
51
|
+
const ThemeScopeContext = defineScope({
|
|
56
52
|
theme: () => "system",
|
|
57
53
|
setTheme: () => void 0,
|
|
58
54
|
themes: DEFAULT_THEME_OPTIONS,
|
|
59
|
-
storageKey: DEFAULT_STORAGE_KEY
|
|
55
|
+
storageKey: DEFAULT_STORAGE_KEY,
|
|
56
|
+
coordinator: null,
|
|
57
|
+
depth: -1
|
|
60
58
|
});
|
|
61
|
-
function
|
|
62
|
-
return
|
|
59
|
+
function theme() {
|
|
60
|
+
return readScope(ThemeScopeContext);
|
|
63
61
|
}
|
|
64
|
-
function
|
|
62
|
+
function ThemeScope(props) {
|
|
65
63
|
const { children, defaultTheme = "system", themes = DEFAULT_THEME_OPTIONS, storageKey = DEFAULT_STORAGE_KEY } = props;
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
const themeState = state(
|
|
64
|
+
const scopeId = state(Symbol("ThemeScope"))();
|
|
65
|
+
const scopeSignal = getSignal();
|
|
66
|
+
const themeState = state(defaultTheme);
|
|
67
|
+
const persistenceAdoption = state({ complete: false })();
|
|
69
68
|
const currentTheme = themeState();
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
69
|
+
const parentScope = readScope(ThemeScopeContext);
|
|
70
|
+
const ownedCoordinator = state(createThemeCoordinator())();
|
|
71
|
+
const coordinator = parentScope.coordinator ?? ownedCoordinator;
|
|
72
|
+
const scopeDepth = parentScope.depth + 1;
|
|
73
|
+
coordinator.register(scopeId, scopeDepth, currentTheme, scopeSignal);
|
|
76
74
|
const setTheme = (nextTheme) => {
|
|
77
75
|
themeState.set(nextTheme);
|
|
78
76
|
writeStoredTheme(storageKey, nextTheme);
|
|
79
|
-
|
|
80
|
-
rootThemeRevision += 1;
|
|
81
|
-
syncThemeRoot(nextTheme);
|
|
82
|
-
};
|
|
83
|
-
const value = {
|
|
84
|
-
theme: themeState,
|
|
85
|
-
setTheme,
|
|
86
|
-
themes,
|
|
87
|
-
storageKey
|
|
77
|
+
coordinator.activate(scopeId, nextTheme);
|
|
88
78
|
};
|
|
89
|
-
return /* @__PURE__ */
|
|
90
|
-
value
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
79
|
+
return /* @__PURE__ */ jsx(ThemeScopeContext, {
|
|
80
|
+
value: {
|
|
81
|
+
theme: themeState,
|
|
82
|
+
setTheme,
|
|
83
|
+
themes,
|
|
84
|
+
storageKey,
|
|
85
|
+
coordinator,
|
|
86
|
+
depth: scopeDepth
|
|
87
|
+
},
|
|
88
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
89
|
+
"data-slot": "theme-scope",
|
|
90
|
+
ref: parentScope.coordinator === null ? (element) => {
|
|
91
|
+
coordinator.attach(element);
|
|
92
|
+
if (!element || persistenceAdoption.complete) return;
|
|
93
|
+
persistenceAdoption.complete = true;
|
|
94
|
+
const storedTheme = readStoredTheme(storageKey);
|
|
95
|
+
if (storedTheme && storedTheme !== themeState()) {
|
|
96
|
+
themeState.set(storedTheme);
|
|
97
|
+
coordinator.activate(scopeId, storedTheme);
|
|
98
|
+
}
|
|
99
|
+
} : void 0,
|
|
96
100
|
children
|
|
97
|
-
})
|
|
101
|
+
})
|
|
98
102
|
});
|
|
99
103
|
}
|
|
100
|
-
function
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
104
|
+
function createThemeCoordinator() {
|
|
105
|
+
const scopes = /* @__PURE__ */ new Map();
|
|
106
|
+
let nextSequence = 0;
|
|
107
|
+
let explicitOwner;
|
|
108
|
+
let root = null;
|
|
109
|
+
let scheduled = false;
|
|
110
|
+
const target = () => {
|
|
111
|
+
if (root?.nodeType === 9) return root.documentElement;
|
|
112
|
+
if (root && "host" in root) return root.host;
|
|
113
|
+
return typeof document === "undefined" ? null : document.documentElement;
|
|
114
|
+
};
|
|
115
|
+
const syncActive = () => {
|
|
116
|
+
if (explicitOwner !== void 0) return;
|
|
117
|
+
let candidate;
|
|
118
|
+
for (const scope of scopes.values()) if (!candidate || scope.depth > candidate.depth || scope.depth === candidate.depth && scope.sequence > candidate.sequence) candidate = scope;
|
|
119
|
+
if (candidate) syncThemeTarget(target(), candidate.theme);
|
|
120
|
+
};
|
|
121
|
+
const schedule = () => {
|
|
122
|
+
if (typeof document === "undefined" || scheduled) return;
|
|
123
|
+
scheduled = true;
|
|
124
|
+
setTimeout(() => {
|
|
125
|
+
scheduled = false;
|
|
126
|
+
syncActive();
|
|
114
127
|
}, 0);
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
128
|
+
};
|
|
129
|
+
return Object.freeze({
|
|
130
|
+
attach(element) {
|
|
131
|
+
if (element) root = element.getRootNode();
|
|
132
|
+
schedule();
|
|
133
|
+
},
|
|
134
|
+
register(id, depth, themeName, signal) {
|
|
135
|
+
const existing = scopes.get(id);
|
|
136
|
+
scopes.set(id, {
|
|
137
|
+
depth,
|
|
138
|
+
sequence: existing?.sequence ?? nextSequence++,
|
|
139
|
+
theme: themeName,
|
|
140
|
+
signal
|
|
141
|
+
});
|
|
142
|
+
if (!existing) signal.addEventListener("abort", () => {
|
|
143
|
+
scopes.delete(id);
|
|
144
|
+
if (explicitOwner === id) explicitOwner = void 0;
|
|
145
|
+
schedule();
|
|
146
|
+
}, { once: true });
|
|
147
|
+
schedule();
|
|
148
|
+
},
|
|
149
|
+
activate(id, themeName) {
|
|
150
|
+
const scope = scopes.get(id);
|
|
151
|
+
if (scope) scope.theme = themeName;
|
|
152
|
+
explicitOwner = id;
|
|
153
|
+
syncThemeTarget(target(), themeName);
|
|
154
|
+
}
|
|
155
|
+
});
|
|
121
156
|
}
|
|
122
157
|
function ThemePicker(props) {
|
|
123
|
-
const
|
|
124
|
-
const { themes =
|
|
125
|
-
const currentTheme =
|
|
158
|
+
const activeTheme = theme();
|
|
159
|
+
const { themes = activeTheme.themes, label = "Theme", ...rest } = props;
|
|
160
|
+
const currentTheme = activeTheme.theme();
|
|
126
161
|
return /* @__PURE__ */ jsx("select", {
|
|
127
162
|
...rest,
|
|
128
163
|
"aria-label": rest["aria-label"] ?? label,
|
|
@@ -130,7 +165,7 @@ function ThemePicker(props) {
|
|
|
130
165
|
value: currentTheme,
|
|
131
166
|
onChange: (event) => {
|
|
132
167
|
const target = getThemePickerTarget(event);
|
|
133
|
-
if (target)
|
|
168
|
+
if (target) activeTheme.setTheme(target.value);
|
|
134
169
|
},
|
|
135
170
|
children: themes.map((option) => /* @__PURE__ */ jsx("option", {
|
|
136
171
|
value: option.value,
|
|
@@ -151,9 +186,9 @@ function getThemePickerTarget(event) {
|
|
|
151
186
|
return null;
|
|
152
187
|
}
|
|
153
188
|
function ThemeToggle(props) {
|
|
154
|
-
const
|
|
189
|
+
const activeTheme = theme();
|
|
155
190
|
const { children, lightIcon, darkIcon, systemIcon, themes = ["light", "dark"], onPress, ...rest } = props;
|
|
156
|
-
const currentTheme =
|
|
191
|
+
const currentTheme = activeTheme.theme();
|
|
157
192
|
const nextTheme = getNextTheme(currentTheme, themes, getResolvedSystemTheme());
|
|
158
193
|
const renderContext = {
|
|
159
194
|
theme: currentTheme,
|
|
@@ -179,7 +214,7 @@ function ThemeToggle(props) {
|
|
|
179
214
|
"data-next-theme": nextTheme,
|
|
180
215
|
onPress: (event) => {
|
|
181
216
|
onPress?.(event);
|
|
182
|
-
if (!event.defaultPrevented && !Object.is(nextTheme, currentTheme))
|
|
217
|
+
if (!event.defaultPrevented && !Object.is(nextTheme, currentTheme)) activeTheme.setTheme(nextTheme);
|
|
183
218
|
},
|
|
184
219
|
children: /* @__PURE__ */ jsx("span", {
|
|
185
220
|
"data-slot": "theme-toggle-content",
|
|
@@ -247,11 +282,8 @@ function cloneThemeToggleIcon(icon, key) {
|
|
|
247
282
|
delete clonedIcon[STATIC_CHILD_SLOTS_CACHE];
|
|
248
283
|
return clonedIcon;
|
|
249
284
|
}
|
|
250
|
-
function
|
|
251
|
-
if (
|
|
252
|
-
const html = document.documentElement;
|
|
253
|
-
if (options?.passive && options.expectedRevision !== void 0 && options.expectedRevision !== rootThemeRevision) return;
|
|
254
|
-
if (options?.passive && explicitRootThemeOwner !== void 0 && explicitRootThemeOwner !== options.providerId) return;
|
|
285
|
+
function syncThemeTarget(html, themeChoice) {
|
|
286
|
+
if (!html) return;
|
|
255
287
|
if (themeChoice == null) {
|
|
256
288
|
html.removeAttribute("data-theme");
|
|
257
289
|
html.removeAttribute("data-theme-choice");
|
|
@@ -277,6 +309,4 @@ function writeStoredTheme(storageKey, theme) {
|
|
|
277
309
|
} catch {}
|
|
278
310
|
}
|
|
279
311
|
//#endregion
|
|
280
|
-
export { CAT_THEME_NAMES, CAT_THEME_OPTIONS, DEFAULT_THEME_OPTIONS, ThemePicker,
|
|
281
|
-
|
|
282
|
-
//# sourceMappingURL=theme.js.map
|
|
312
|
+
export { CAT_THEME_NAMES, CAT_THEME_OPTIONS, DEFAULT_THEME_OPTIONS, ThemePicker, ThemeScope, ThemeToggle, resolveThemeToggleIcon, theme };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","names":[],"sources":["../../../src/components/theme/theme.tsx"],"sourcesContent":["import { defineContext, getSignal, readContext, state } from \"@askrjs/askr\";\nimport type { JSXElement } from \"@askrjs/askr/foundations/structures\";\nimport { resource } from \"@askrjs/askr/resources\";\nimport { Button } from \"@askrjs/ui\";\nimport type { ButtonNativeProps, PressEvent } from \"@askrjs/ui\";\n\nexport const CAT_THEME_NAMES = [\"tabby\", \"ginger\", \"tuxedo\", \"calico\", \"torty\"] as const;\n\nexport type CatThemeName = (typeof CAT_THEME_NAMES)[number];\nexport type ThemeName = \"light\" | \"dark\" | \"system\" | CatThemeName | (string & {});\n\nexport type ThemeOption = {\n value: ThemeName;\n label: string;\n};\n\nexport type ThemeContextValue = {\n theme: () => ThemeName;\n setTheme: (theme: ThemeName) => void;\n themes: readonly ThemeOption[];\n storageKey: string;\n};\n\nexport type ThemeProviderProps = {\n children?: unknown;\n defaultTheme?: ThemeName;\n themes?: readonly ThemeOption[];\n storageKey?: string;\n};\n\nexport type ThemePickerProps = Omit<\n JSX.IntrinsicElements[\"select\"],\n \"children\" | \"value\" | \"defaultValue\" | \"onChange\"\n> & {\n themes?: readonly ThemeOption[];\n label?: string;\n};\n\nexport type ThemeToggleRenderContext = {\n theme: ThemeName;\n nextTheme: ThemeName;\n};\n\nexport type ThemeToggleProps = Omit<ButtonNativeProps, \"children\" | \"onPress\"> & {\n children?: unknown | ((context: ThemeToggleRenderContext) => unknown);\n lightIcon?: unknown;\n darkIcon?: unknown;\n systemIcon?: unknown;\n themes?: readonly ThemeName[];\n onPress?: (event: PressEvent) => void;\n};\n\nexport const DEFAULT_THEME_OPTIONS: readonly ThemeOption[] = [\n { value: \"system\", label: \"System\" },\n { value: \"light\", label: \"Light\" },\n { value: \"dark\", label: \"Dark\" },\n];\n\nexport const CAT_THEME_OPTIONS: readonly ThemeOption[] = [\n { value: \"tabby\", label: \"Tabby\" },\n { value: \"ginger\", label: \"Ginger\" },\n { value: \"tuxedo\", label: \"Tuxedo\" },\n { value: \"calico\", label: \"Calico\" },\n { value: \"torty\", label: \"Torty\" },\n];\n\nconst DEFAULT_STORAGE_KEY = \"askr-theme\";\nconst STATIC_CHILDREN = Symbol.for(\"askr.static-children\");\nconst STATIC_CHILD_SLOTS_CACHE = Symbol.for(\"__askrStaticChildSlots\");\n// Passive mount sync should not overwrite a newer user/provider-initiated change.\nlet rootThemeRevision = 0;\nlet explicitRootThemeOwner: symbol | undefined;\nconst registeredProviderSignals = new WeakSet<AbortSignal>();\n\nconst ThemeContext = defineContext<ThemeContextValue>({\n theme: () => \"system\",\n setTheme: () => undefined,\n themes: DEFAULT_THEME_OPTIONS,\n storageKey: DEFAULT_STORAGE_KEY,\n});\n\nexport function useTheme(): ThemeContextValue {\n return readContext(ThemeContext);\n}\n\nexport function ThemeProvider(props: ThemeProviderProps): JSX.Element {\n const {\n children,\n defaultTheme = \"system\",\n themes = DEFAULT_THEME_OPTIONS,\n storageKey = DEFAULT_STORAGE_KEY,\n } = props;\n\n const providerId = state<symbol>(Symbol(\"ThemeProvider\"))();\n const providerSignal = getSignal();\n const themeState = state<ThemeName>(readStoredTheme(storageKey) ?? defaultTheme);\n const currentTheme = themeState();\n\n if (!registeredProviderSignals.has(providerSignal)) {\n registeredProviderSignals.add(providerSignal);\n providerSignal.addEventListener(\n \"abort\",\n () => {\n if (explicitRootThemeOwner === providerId) {\n explicitRootThemeOwner = undefined;\n }\n },\n { once: true },\n );\n }\n\n const setTheme = (nextTheme: ThemeName) => {\n themeState.set(nextTheme);\n writeStoredTheme(storageKey, nextTheme);\n explicitRootThemeOwner = providerId;\n rootThemeRevision += 1;\n syncThemeRoot(nextTheme);\n };\n\n const value: ThemeContextValue = {\n theme: themeState,\n setTheme,\n themes,\n storageKey,\n };\n\n return (\n <ThemeContext.Scope value={value}>\n <ThemeRootSync providerId={providerId} theme={currentTheme} />\n <div data-slot=\"theme-provider\">{children}</div>\n </ThemeContext.Scope>\n );\n}\n\nfunction ThemeRootSync(props: { providerId: symbol; theme: ThemeName }): JSX.Element | null {\n const { providerId, theme } = props;\n const expectedRootThemeRevision = rootThemeRevision;\n\n resource(\n ({ signal }: { signal: AbortSignal }) => {\n if (typeof window === \"undefined\") {\n syncThemeRoot(theme);\n return null;\n }\n\n const timeoutId = window.setTimeout(() => {\n if (!signal.aborted) {\n syncThemeRoot(theme, {\n expectedRevision: expectedRootThemeRevision,\n passive: true,\n providerId,\n });\n }\n }, 0);\n\n signal.addEventListener(\n \"abort\",\n () => {\n window.clearTimeout(timeoutId);\n },\n { once: true },\n );\n\n return null;\n },\n [theme],\n );\n\n return null;\n}\n\nexport function ThemePicker(props: ThemePickerProps): JSX.Element {\n const theme = useTheme();\n const { themes = theme.themes, label = \"Theme\", ...rest } = props;\n const currentTheme = theme.theme();\n\n return (\n <select\n {...rest}\n aria-label={rest[\"aria-label\"] ?? label}\n data-slot=\"theme-picker\"\n value={currentTheme}\n onChange={(event: Event) => {\n const target = getThemePickerTarget(event);\n if (target) {\n theme.setTheme(target.value as ThemeName);\n }\n }}\n >\n {themes.map((option) => (\n <option key={option.value} value={option.value} selected={option.value === currentTheme}>\n {option.label}\n </option>\n ))}\n </select>\n );\n}\n\nfunction getThemePickerTarget(event: Event): HTMLSelectElement | null {\n if (typeof HTMLSelectElement === \"undefined\") {\n return null;\n }\n\n const path = typeof event.composedPath === \"function\" ? event.composedPath() : [];\n const candidates = [event.target, event.currentTarget, ...path];\n\n for (const candidate of candidates) {\n if (candidate instanceof HTMLSelectElement) {\n return candidate;\n }\n }\n\n return null;\n}\n\nexport function ThemeToggle(props: ThemeToggleProps): JSX.Element {\n const theme = useTheme();\n const {\n children,\n lightIcon,\n darkIcon,\n systemIcon,\n themes = [\"light\", \"dark\"],\n onPress,\n ...rest\n } = props;\n\n const currentTheme = theme.theme();\n const nextTheme = getNextTheme(currentTheme, themes, getResolvedSystemTheme());\n const renderContext = { theme: currentTheme, nextTheme };\n const ariaLabel = (rest as Record<string, unknown>)[\"aria-label\"];\n const themedIcon = resolveThemeToggleIcon(currentTheme, nextTheme, {\n lightIcon,\n darkIcon,\n systemIcon,\n });\n const renderedIcon = cloneThemeToggleIcon(themedIcon, currentTheme);\n const renderedIconSlots =\n renderThemeToggleIconSlots(currentTheme, {\n lightIcon,\n darkIcon,\n systemIcon,\n }) ?? renderedIcon;\n const content =\n typeof children === \"function\" ? children(renderContext) : (children ?? renderedIconSlots);\n\n return (\n <Button\n {...(rest as ButtonNativeProps)}\n aria-label={typeof ariaLabel === \"string\" ? ariaLabel : `Switch to ${nextTheme} theme`}\n data-theme-control=\"toggle\"\n data-theme-choice={currentTheme}\n data-next-theme={nextTheme}\n onPress={(event) => {\n onPress?.(event);\n if (!event.defaultPrevented && !Object.is(nextTheme, currentTheme)) {\n theme.setTheme(nextTheme);\n }\n }}\n >\n <span data-slot=\"theme-toggle-content\">{content}</span>\n </Button>\n );\n}\n\nfunction getNextTheme(\n currentTheme: ThemeName,\n themes: readonly ThemeName[],\n resolvedSystemTheme: \"light\" | \"dark\" = \"light\",\n): ThemeName {\n if (themes.length === 0) return currentTheme;\n const index = themes.indexOf(currentTheme);\n if (index < 0 && currentTheme === \"system\") {\n if (themes.includes(\"light\") && themes.includes(\"dark\")) {\n return resolvedSystemTheme === \"dark\" ? \"light\" : \"dark\";\n }\n }\n return themes[index >= 0 && index < themes.length - 1 ? index + 1 : 0]!;\n}\n\nfunction getResolvedSystemTheme(): \"light\" | \"dark\" {\n if (typeof window === \"undefined\" || typeof window.matchMedia !== \"function\") {\n return \"light\";\n }\n\n return window.matchMedia(\"(prefers-color-scheme: dark)\").matches ? \"dark\" : \"light\";\n}\n\nfunction getThemeIcon(\n theme: ThemeName,\n icons: Pick<ThemeToggleProps, \"lightIcon\" | \"darkIcon\" | \"systemIcon\">,\n): unknown {\n if (theme === \"light\") return icons.lightIcon;\n if (theme === \"dark\") return icons.darkIcon;\n if (theme === \"system\") return icons.systemIcon;\n return undefined;\n}\n\nexport function resolveThemeToggleIcon(\n theme: ThemeName,\n nextTheme: ThemeName,\n icons: Pick<ThemeToggleProps, \"lightIcon\" | \"darkIcon\" | \"systemIcon\">,\n): unknown {\n return getThemeIcon(theme, icons) ?? getThemeIcon(nextTheme, icons);\n}\n\nfunction renderThemeToggleIconSlots(\n theme: ThemeName,\n icons: Pick<ThemeToggleProps, \"lightIcon\" | \"darkIcon\" | \"systemIcon\">,\n): unknown {\n if (getThemeIcon(theme, icons) === undefined) {\n return undefined;\n }\n\n const slots = [\n [\"light\", icons.lightIcon],\n [\"dark\", icons.darkIcon],\n [\"system\", icons.systemIcon],\n ] as const;\n const availableSlots = slots.filter(([, icon]) => icon !== undefined && icon !== null);\n\n if (availableSlots.length <= 1) {\n return undefined;\n }\n\n return availableSlots.map(([slotTheme, icon]) => (\n <span\n key={slotTheme}\n data-slot=\"theme-toggle-icon\"\n data-theme-toggle-icon={slotTheme}\n hidden={slotTheme === theme ? undefined : true}\n >\n {cloneThemeToggleIcon(icon, slotTheme)}\n </span>\n ));\n}\n\nfunction isJSXElement(value: unknown): value is JSXElement {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"$$typeof\" in value &&\n \"type\" in value &&\n \"props\" in value\n );\n}\n\nfunction cloneThemeToggleIcon(icon: unknown, key?: string): unknown {\n if (Array.isArray(icon)) {\n const clonedChildren = icon.map((child) => cloneThemeToggleIcon(child));\n if ((icon as Record<symbol, unknown>)[STATIC_CHILDREN] === true) {\n Object.defineProperty(clonedChildren, STATIC_CHILDREN, {\n value: true,\n configurable: true,\n });\n }\n return clonedChildren;\n }\n\n if (!isJSXElement(icon)) return icon;\n\n const props = icon.props as Record<string, unknown> | undefined;\n const clonedProps = props ? { ...props } : {};\n\n if (\"children\" in clonedProps) {\n clonedProps.children = cloneThemeToggleIcon(clonedProps.children);\n }\n\n const iconKey = (icon.key ?? key ?? null) as string | number | null;\n const clonedIcon = {\n ...icon,\n key: iconKey,\n props: clonedProps,\n };\n\n delete (clonedIcon as Record<symbol, unknown>)[STATIC_CHILD_SLOTS_CACHE];\n return clonedIcon;\n}\n\nfunction syncThemeRoot(\n themeChoice: ThemeName | null | undefined,\n options?: { expectedRevision?: number; passive?: boolean; providerId?: symbol },\n): void {\n if (typeof document === \"undefined\") {\n return;\n }\n\n const html = document.documentElement;\n\n if (\n options?.passive &&\n options.expectedRevision !== undefined &&\n options.expectedRevision !== rootThemeRevision\n ) {\n return;\n }\n\n if (\n options?.passive &&\n explicitRootThemeOwner !== undefined &&\n explicitRootThemeOwner !== options.providerId\n ) {\n return;\n }\n\n if (themeChoice == null) {\n html.removeAttribute(\"data-theme\");\n html.removeAttribute(\"data-theme-choice\");\n return;\n }\n\n html.setAttribute(\"data-theme-choice\", themeChoice);\n\n if (themeChoice === \"system\") {\n html.removeAttribute(\"data-theme\");\n } else {\n html.setAttribute(\"data-theme\", themeChoice);\n }\n}\n\nfunction readStoredTheme(storageKey: string): ThemeName | undefined {\n if (typeof window === \"undefined\") return undefined;\n try {\n const storedTheme = window.localStorage.getItem(storageKey);\n return storedTheme ? (storedTheme as ThemeName) : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction writeStoredTheme(storageKey: string, theme: ThemeName): void {\n if (typeof window === \"undefined\") return;\n try {\n window.localStorage.setItem(storageKey, theme);\n } catch {\n // Storage can be unavailable in private or locked-down browser contexts.\n }\n}\n"],"mappings":";;;;;AAMA,MAAa,kBAAkB;CAAC;CAAS;CAAU;CAAU;CAAU;AAAO;AA8C9E,MAAa,wBAAgD;CAC3D;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAS,OAAO;CAAQ;CACjC;EAAE,OAAO;EAAQ,OAAO;CAAO;AACjC;AAEA,MAAa,oBAA4C;CACvD;EAAE,OAAO;EAAS,OAAO;CAAQ;CACjC;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAS,OAAO;CAAQ;AACnC;AAEA,MAAM,sBAAsB;AAC5B,MAAM,kBAAkB,OAAO,IAAI,sBAAsB;AACzD,MAAM,2BAA2B,OAAO,IAAI,wBAAwB;AAEpE,IAAI,oBAAoB;AACxB,IAAI;AACJ,MAAM,4CAA4B,IAAI,QAAqB;AAE3D,MAAM,eAAe,cAAiC;CACpD,aAAa;CACb,gBAAgB,KAAA;CAChB,QAAQ;CACR,YAAY;AACd,CAAC;AAED,SAAgB,WAA8B;CAC5C,OAAO,YAAY,YAAY;AACjC;AAEA,SAAgB,cAAc,OAAwC;CACpE,MAAM,EACJ,UACA,eAAe,UACf,SAAS,uBACT,aAAa,wBACX;CAEJ,MAAM,aAAa,MAAc,OAAO,eAAe,CAAC,CAAC,CAAC;CAC1D,MAAM,iBAAiB,UAAU;CACjC,MAAM,aAAa,MAAiB,gBAAgB,UAAU,KAAK,YAAY;CAC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AAe,cAA4B,KAAA;CACpD,QAAQ;EACN;CACF;AACF;AAEA,SAAS,iBAAiB,YAAoB,OAAwB;CACpE,IAAI,OAAO,WAAW,aAAa;CACnC,IAAI;EACF,OAAO,aAAa,QAAQ,YAAY,KAAK;CAC/C,QAAQ,CAER;AACF"}
|
|
1
|
+
{"version":3,"file":"theme.js","names":[],"sources":["../../../src/components/theme/theme.tsx"],"sourcesContent":["import { defineScope, getSignal, readScope, state } from \"@askrjs/askr\";\nimport type { JSXElement } from \"@askrjs/askr/foundations/structures\";\nimport { Button } from \"@askrjs/ui\";\nimport type { ButtonNativeProps, PressEvent } from \"@askrjs/ui\";\n\nexport const CAT_THEME_NAMES = [\"tabby\", \"ginger\", \"tuxedo\", \"calico\", \"torty\"] as const;\n\nexport type CatThemeName = (typeof CAT_THEME_NAMES)[number];\nexport type ThemeName = \"light\" | \"dark\" | \"system\" | CatThemeName | (string & {});\n\nexport type ThemeOption = {\n value: ThemeName;\n label: string;\n};\n\nexport type ThemeScopeValue = {\n theme: () => ThemeName;\n setTheme: (theme: ThemeName) => void;\n themes: readonly ThemeOption[];\n storageKey: string;\n};\n\nexport type ThemeScopeProps = {\n children?: unknown;\n defaultTheme?: ThemeName;\n themes?: readonly ThemeOption[];\n storageKey?: string;\n};\n\nexport type ThemePickerProps = Omit<\n JSX.IntrinsicElements[\"select\"],\n \"children\" | \"value\" | \"defaultValue\" | \"onChange\"\n> & {\n themes?: readonly ThemeOption[];\n label?: string;\n};\n\nexport type ThemeToggleRenderContext = {\n theme: ThemeName;\n nextTheme: ThemeName;\n};\n\nexport type ThemeToggleProps = Omit<ButtonNativeProps, \"children\" | \"onPress\"> & {\n children?: unknown | ((context: ThemeToggleRenderContext) => unknown);\n lightIcon?: unknown;\n darkIcon?: unknown;\n systemIcon?: unknown;\n themes?: readonly ThemeName[];\n onPress?: (event: PressEvent) => void;\n};\n\nexport const DEFAULT_THEME_OPTIONS: readonly ThemeOption[] = [\n { value: \"system\", label: \"System\" },\n { value: \"light\", label: \"Light\" },\n { value: \"dark\", label: \"Dark\" },\n];\n\nexport const CAT_THEME_OPTIONS: readonly ThemeOption[] = [\n { value: \"tabby\", label: \"Tabby\" },\n { value: \"ginger\", label: \"Ginger\" },\n { value: \"tuxedo\", label: \"Tuxedo\" },\n { value: \"calico\", label: \"Calico\" },\n { value: \"torty\", label: \"Torty\" },\n];\n\nconst DEFAULT_STORAGE_KEY = \"askr-theme\";\nconst STATIC_CHILDREN = Symbol.for(\"askr.static-children\");\nconst STATIC_CHILD_SLOTS_CACHE = Symbol.for(\"__askrStaticChildSlots\");\ntype ThemeCoordinator = ReturnType<typeof createThemeCoordinator>;\ntype InternalThemeScopeValue = ThemeScopeValue & {\n readonly coordinator: ThemeCoordinator | null;\n readonly depth: number;\n};\n\nconst ThemeScopeContext = defineScope<InternalThemeScopeValue>({\n theme: () => \"system\",\n setTheme: () => undefined,\n themes: DEFAULT_THEME_OPTIONS,\n storageKey: DEFAULT_STORAGE_KEY,\n coordinator: null,\n depth: -1,\n});\n\nexport function theme(): ThemeScopeValue {\n return readScope(ThemeScopeContext);\n}\n\nexport function ThemeScope(props: ThemeScopeProps): JSX.Element {\n const {\n children,\n defaultTheme = \"system\",\n themes = DEFAULT_THEME_OPTIONS,\n storageKey = DEFAULT_STORAGE_KEY,\n } = props;\n\n const scopeId = state<symbol>(Symbol(\"ThemeScope\"))();\n const scopeSignal = getSignal();\n // The first render must be identical on the server and in the browser.\n // Browser persistence is adopted from the committed root ref, after Askr's\n // hydration verifier has accepted the server markup.\n const themeState = state<ThemeName>(defaultTheme);\n const persistenceAdoption = state({ complete: false })();\n const currentTheme = themeState();\n const parentScope = readScope(ThemeScopeContext);\n const ownedCoordinator = state<ThemeCoordinator>(createThemeCoordinator())();\n const coordinator = parentScope.coordinator ?? ownedCoordinator;\n const scopeDepth = parentScope.depth + 1;\n coordinator.register(scopeId, scopeDepth, currentTheme, scopeSignal);\n\n const setTheme = (nextTheme: ThemeName) => {\n themeState.set(nextTheme);\n writeStoredTheme(storageKey, nextTheme);\n coordinator.activate(scopeId, nextTheme);\n };\n\n const value: InternalThemeScopeValue = {\n theme: themeState,\n setTheme,\n themes,\n storageKey,\n coordinator,\n depth: scopeDepth,\n };\n\n return (\n <ThemeScopeContext value={value}>\n <div\n data-slot=\"theme-scope\"\n ref={\n parentScope.coordinator === null\n ? (element: HTMLElement | null) => {\n coordinator.attach(element);\n if (!element || persistenceAdoption.complete) return;\n persistenceAdoption.complete = true;\n const storedTheme = readStoredTheme(storageKey);\n if (storedTheme && storedTheme !== themeState()) {\n themeState.set(storedTheme);\n coordinator.activate(scopeId, storedTheme);\n }\n }\n : undefined\n }\n >\n {children}\n </div>\n </ThemeScopeContext>\n );\n}\n\nfunction createThemeCoordinator() {\n const scopes = new Map<\n symbol,\n {\n depth: number;\n sequence: number;\n theme: ThemeName;\n signal: AbortSignal;\n }\n >();\n let nextSequence = 0;\n let explicitOwner: symbol | undefined;\n let root: Node | null = null;\n let scheduled = false;\n\n const target = (): HTMLElement | null => {\n if (root?.nodeType === 9) return (root as Document).documentElement;\n if (root && \"host\" in root) return (root as ShadowRoot).host as HTMLElement;\n return typeof document === \"undefined\" ? null : document.documentElement;\n };\n const syncActive = (): void => {\n if (explicitOwner !== undefined) return;\n let candidate: { depth: number; sequence: number; theme: ThemeName } | undefined;\n for (const scope of scopes.values()) {\n if (\n !candidate ||\n scope.depth > candidate.depth ||\n (scope.depth === candidate.depth && scope.sequence > candidate.sequence)\n ) {\n candidate = scope;\n }\n }\n if (candidate) syncThemeTarget(target(), candidate.theme);\n };\n const schedule = (): void => {\n if (typeof document === \"undefined\" || scheduled) return;\n scheduled = true;\n setTimeout(() => {\n scheduled = false;\n syncActive();\n }, 0);\n };\n\n return Object.freeze({\n attach(element: HTMLElement | null) {\n if (element) root = element.getRootNode();\n schedule();\n },\n register(id: symbol, depth: number, themeName: ThemeName, signal: AbortSignal) {\n const existing = scopes.get(id);\n scopes.set(id, {\n depth,\n sequence: existing?.sequence ?? nextSequence++,\n theme: themeName,\n signal,\n });\n if (!existing) {\n signal.addEventListener(\n \"abort\",\n () => {\n scopes.delete(id);\n if (explicitOwner === id) explicitOwner = undefined;\n schedule();\n },\n { once: true },\n );\n }\n schedule();\n },\n activate(id: symbol, themeName: ThemeName) {\n const scope = scopes.get(id);\n if (scope) scope.theme = themeName;\n explicitOwner = id;\n syncThemeTarget(target(), themeName);\n },\n });\n}\n\nexport function ThemePicker(props: ThemePickerProps): JSX.Element {\n const activeTheme = theme();\n const { themes = activeTheme.themes, label = \"Theme\", ...rest } = props;\n const currentTheme = activeTheme.theme();\n\n return (\n <select\n {...rest}\n aria-label={rest[\"aria-label\"] ?? label}\n data-slot=\"theme-picker\"\n value={currentTheme}\n onChange={(event: Event) => {\n const target = getThemePickerTarget(event);\n if (target) {\n activeTheme.setTheme(target.value as ThemeName);\n }\n }}\n >\n {themes.map((option) => (\n <option key={option.value} value={option.value} selected={option.value === currentTheme}>\n {option.label}\n </option>\n ))}\n </select>\n );\n}\n\nfunction getThemePickerTarget(event: Event): HTMLSelectElement | null {\n if (typeof HTMLSelectElement === \"undefined\") {\n return null;\n }\n\n const path = typeof event.composedPath === \"function\" ? event.composedPath() : [];\n const candidates = [event.target, event.currentTarget, ...path];\n\n for (const candidate of candidates) {\n if (candidate instanceof HTMLSelectElement) {\n return candidate;\n }\n }\n\n return null;\n}\n\nexport function ThemeToggle(props: ThemeToggleProps): JSX.Element {\n const activeTheme = theme();\n const {\n children,\n lightIcon,\n darkIcon,\n systemIcon,\n themes = [\"light\", \"dark\"],\n onPress,\n ...rest\n } = props;\n\n const currentTheme = activeTheme.theme();\n const nextTheme = getNextTheme(currentTheme, themes, getResolvedSystemTheme());\n const renderContext = { theme: currentTheme, nextTheme };\n const ariaLabel = (rest as Record<string, unknown>)[\"aria-label\"];\n const themedIcon = resolveThemeToggleIcon(currentTheme, nextTheme, {\n lightIcon,\n darkIcon,\n systemIcon,\n });\n const renderedIcon = cloneThemeToggleIcon(themedIcon, currentTheme);\n const renderedIconSlots =\n renderThemeToggleIconSlots(currentTheme, {\n lightIcon,\n darkIcon,\n systemIcon,\n }) ?? renderedIcon;\n const content =\n typeof children === \"function\" ? children(renderContext) : (children ?? renderedIconSlots);\n\n return (\n <Button\n {...(rest as ButtonNativeProps)}\n aria-label={typeof ariaLabel === \"string\" ? ariaLabel : `Switch to ${nextTheme} theme`}\n data-theme-control=\"toggle\"\n data-theme-choice={currentTheme}\n data-next-theme={nextTheme}\n onPress={(event) => {\n onPress?.(event);\n if (!event.defaultPrevented && !Object.is(nextTheme, currentTheme)) {\n activeTheme.setTheme(nextTheme);\n }\n }}\n >\n <span data-slot=\"theme-toggle-content\">{content}</span>\n </Button>\n );\n}\n\nfunction getNextTheme(\n currentTheme: ThemeName,\n themes: readonly ThemeName[],\n resolvedSystemTheme: \"light\" | \"dark\" = \"light\",\n): ThemeName {\n if (themes.length === 0) return currentTheme;\n const index = themes.indexOf(currentTheme);\n if (index < 0 && currentTheme === \"system\") {\n if (themes.includes(\"light\") && themes.includes(\"dark\")) {\n return resolvedSystemTheme === \"dark\" ? \"light\" : \"dark\";\n }\n }\n return themes[index >= 0 && index < themes.length - 1 ? index + 1 : 0]!;\n}\n\nfunction getResolvedSystemTheme(): \"light\" | \"dark\" {\n if (typeof window === \"undefined\" || typeof window.matchMedia !== \"function\") {\n return \"light\";\n }\n\n return window.matchMedia(\"(prefers-color-scheme: dark)\").matches ? \"dark\" : \"light\";\n}\n\nfunction getThemeIcon(\n theme: ThemeName,\n icons: Pick<ThemeToggleProps, \"lightIcon\" | \"darkIcon\" | \"systemIcon\">,\n): unknown {\n if (theme === \"light\") return icons.lightIcon;\n if (theme === \"dark\") return icons.darkIcon;\n if (theme === \"system\") return icons.systemIcon;\n return undefined;\n}\n\nexport function resolveThemeToggleIcon(\n theme: ThemeName,\n nextTheme: ThemeName,\n icons: Pick<ThemeToggleProps, \"lightIcon\" | \"darkIcon\" | \"systemIcon\">,\n): unknown {\n return getThemeIcon(theme, icons) ?? getThemeIcon(nextTheme, icons);\n}\n\nfunction renderThemeToggleIconSlots(\n theme: ThemeName,\n icons: Pick<ThemeToggleProps, \"lightIcon\" | \"darkIcon\" | \"systemIcon\">,\n): unknown {\n if (getThemeIcon(theme, icons) === undefined) {\n return undefined;\n }\n\n const slots = [\n [\"light\", icons.lightIcon],\n [\"dark\", icons.darkIcon],\n [\"system\", icons.systemIcon],\n ] as const;\n const availableSlots = slots.filter(([, icon]) => icon !== undefined && icon !== null);\n\n if (availableSlots.length <= 1) {\n return undefined;\n }\n\n return availableSlots.map(([slotTheme, icon]) => (\n <span\n key={slotTheme}\n data-slot=\"theme-toggle-icon\"\n data-theme-toggle-icon={slotTheme}\n hidden={slotTheme === theme ? undefined : true}\n >\n {cloneThemeToggleIcon(icon, slotTheme)}\n </span>\n ));\n}\n\nfunction isJSXElement(value: unknown): value is JSXElement {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"$$typeof\" in value &&\n \"type\" in value &&\n \"props\" in value\n );\n}\n\nfunction cloneThemeToggleIcon(icon: unknown, key?: string): unknown {\n if (Array.isArray(icon)) {\n const clonedChildren = icon.map((child) => cloneThemeToggleIcon(child));\n if ((icon as unknown as Record<symbol, unknown>)[STATIC_CHILDREN] === true) {\n Object.defineProperty(clonedChildren, STATIC_CHILDREN, {\n value: true,\n configurable: true,\n });\n }\n return clonedChildren;\n }\n\n if (!isJSXElement(icon)) return icon;\n\n const props = icon.props as Record<string, unknown> | undefined;\n const clonedProps = props ? { ...props } : {};\n\n if (\"children\" in clonedProps) {\n clonedProps.children = cloneThemeToggleIcon(clonedProps.children);\n }\n\n const iconKey = (icon.key ?? key ?? null) as string | number | null;\n const clonedIcon = {\n ...icon,\n key: iconKey,\n props: clonedProps,\n };\n\n delete (clonedIcon as Record<symbol, unknown>)[STATIC_CHILD_SLOTS_CACHE];\n return clonedIcon;\n}\n\nfunction syncThemeTarget(\n html: HTMLElement | null,\n themeChoice: ThemeName | null | undefined,\n): void {\n if (!html) return;\n\n if (themeChoice == null) {\n html.removeAttribute(\"data-theme\");\n html.removeAttribute(\"data-theme-choice\");\n return;\n }\n\n html.setAttribute(\"data-theme-choice\", themeChoice);\n\n if (themeChoice === \"system\") {\n html.removeAttribute(\"data-theme\");\n } else {\n html.setAttribute(\"data-theme\", themeChoice);\n }\n}\n\nfunction readStoredTheme(storageKey: string): ThemeName | undefined {\n if (typeof window === \"undefined\") return undefined;\n try {\n const storedTheme = window.localStorage.getItem(storageKey);\n return storedTheme ? (storedTheme as ThemeName) : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction writeStoredTheme(storageKey: string, theme: ThemeName): void {\n if (typeof window === \"undefined\") return;\n try {\n window.localStorage.setItem(storageKey, theme);\n } catch {\n // Storage can be unavailable in private or locked-down browser contexts.\n }\n}\n"],"mappings":";;;;AAKA,MAAa,kBAAkB;CAAC;CAAS;CAAU;CAAU;CAAU;AAAO;AA8C9E,MAAa,wBAAgD;CAC3D;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAS,OAAO;CAAQ;CACjC;EAAE,OAAO;EAAQ,OAAO;CAAO;AACjC;AAEA,MAAa,oBAA4C;CACvD;EAAE,OAAO;EAAS,OAAO;CAAQ;CACjC;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAS,OAAO;CAAQ;AACnC;AAEA,MAAM,sBAAsB;AAC5B,MAAM,kBAAkB,OAAO,IAAI,sBAAsB;AACzD,MAAM,2BAA2B,OAAO,IAAI,wBAAwB;AAOpE,MAAM,oBAAoB,YAAqC;CAC7D,aAAa;CACb,gBAAgB,KAAA;CAChB,QAAQ;CACR,YAAY;CACZ,aAAa;CACb,OAAO;AACT,CAAC;AAED,SAAgB,QAAyB;CACvC,OAAO,UAAU,iBAAiB;AACpC;AAEA,SAAgB,WAAW,OAAqC;CAC9D,MAAM,EACJ,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CAC/C,QAAQ,CAER;AACF"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BlockDivProps } from "../block/block.types.js";
|
|
2
|
+
import "../block/index.js";
|
|
2
3
|
//#region src/components/toolbar/toolbar.types.d.ts
|
|
3
4
|
type ToolbarProps = BlockDivProps & {
|
|
4
5
|
title: unknown;
|
|
5
6
|
actions?: unknown;
|
|
6
7
|
};
|
|
7
8
|
//#endregion
|
|
8
|
-
export { ToolbarProps };
|
|
9
|
-
//# sourceMappingURL=toolbar.types.d.ts.map
|
|
9
|
+
export { ToolbarProps };
|
package/dist/components.d.ts
CHANGED
|
@@ -1,60 +1,90 @@
|
|
|
1
1
|
import { AlertHeadingTag, AlertProps, AlertVariant } from "./components/alert/alert.types.js";
|
|
2
2
|
import { Alert } from "./components/alert/alert.js";
|
|
3
|
+
import "./components/alert/index.js";
|
|
3
4
|
import { AspectRatioAsChildProps, AspectRatioProps } from "./components/aspect-ratio/aspect-ratio.types.js";
|
|
4
5
|
import { AspectRatio } from "./components/aspect-ratio/aspect-ratio.js";
|
|
6
|
+
import "./components/aspect-ratio/index.js";
|
|
5
7
|
import { BadgeAsChildProps, BadgeOwnProps, BadgeProps } from "./components/badge/badge.types.js";
|
|
6
8
|
import { Badge } from "./components/badge/badge.js";
|
|
9
|
+
import "./components/badge/index.js";
|
|
7
10
|
import { BlockAlign, BlockBackground, BlockDirection, BlockJustify, BlockMargin, BlockRadius, BlockRowFrom, BlockShadow, BlockSize, BlockSpace, BlockZIndex, ResponsiveValue } from "./components/_internal/block-layout.js";
|
|
8
11
|
import { BlockAsChildProps, BlockDivProps, BlockElement, BlockElementProps, BlockNativeProps, BlockOwnProps, BlockProps, BlockSpanProps } from "./components/block/block.types.js";
|
|
9
12
|
import { Block } from "./components/block/block.js";
|
|
13
|
+
import "./components/block/index.js";
|
|
10
14
|
import { Brand, BrandLabel, BrandMark } from "./components/brand/brand.js";
|
|
15
|
+
import "./components/brand/index.js";
|
|
11
16
|
import { ButtonGroupOrientation, ButtonGroupProps } from "./components/button-group/button-group.types.js";
|
|
12
17
|
import { ButtonGroup } from "./components/button-group/button-group.js";
|
|
18
|
+
import "./components/button-group/index.js";
|
|
13
19
|
import { CardActionProps, CardContentProps, CardDescriptionProps, CardFooterProps, CardHeaderProps, CardProps, CardTitleProps, CardVariant } from "./components/card/card.types.js";
|
|
14
20
|
import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./components/card/card.js";
|
|
21
|
+
import "./components/card/index.js";
|
|
15
22
|
import { CloseNativeProps, CloseOwnProps } from "./components/close/close.types.js";
|
|
16
23
|
import { Close } from "./components/close/close.js";
|
|
24
|
+
import "./components/close/index.js";
|
|
17
25
|
import { ContainerProps } from "./components/container/container.types.js";
|
|
18
26
|
import { Container } from "./components/container/container.js";
|
|
27
|
+
import "./components/container/index.js";
|
|
19
28
|
import { EmptyStateHeadingTag, EmptyStateProps } from "./components/empty-state/empty-state.types.js";
|
|
20
29
|
import { EmptyState } from "./components/empty-state/empty-state.js";
|
|
30
|
+
import "./components/empty-state/index.js";
|
|
21
31
|
import { FieldErrorProps, FieldHintProps, FieldProps } from "./components/field/field.types.js";
|
|
22
32
|
import { Field, FieldError, FieldHint } from "./components/field/field.js";
|
|
33
|
+
import "./components/field/index.js";
|
|
23
34
|
import { FooterContentProps, FooterDescriptionProps, FooterLinkProps, FooterLinksProps, FooterProps, FooterSectionProps, FooterTitleProps } from "./components/footer/footer.types.js";
|
|
24
35
|
import { Footer, FooterContent, FooterDescription, FooterLink, FooterLinks, FooterSection, FooterTitle } from "./components/footer/footer.js";
|
|
36
|
+
import "./components/footer/index.js";
|
|
25
37
|
import { Grid } from "./components/grid/grid.js";
|
|
38
|
+
import "./components/grid/index.js";
|
|
26
39
|
import { HeaderProps } from "./components/header/header.types.js";
|
|
27
40
|
import { Header } from "./components/header/header.js";
|
|
41
|
+
import "./components/header/index.js";
|
|
28
42
|
import { InputGroupOrientation, InputGroupProps, InputGroupTextAsChildProps, InputGroupTextProps } from "./components/input-group/input-group.types.js";
|
|
29
43
|
import { InputGroup, InputGroupText } from "./components/input-group/input-group.js";
|
|
44
|
+
import "./components/input-group/index.js";
|
|
30
45
|
import { MainProps } from "./components/main/main.types.js";
|
|
31
46
|
import { Main } from "./components/main/main.js";
|
|
47
|
+
import "./components/main/index.js";
|
|
32
48
|
import { AsideProps } from "./components/aside/aside.types.js";
|
|
33
49
|
import { Aside } from "./components/aside/aside.js";
|
|
50
|
+
import "./components/aside/index.js";
|
|
34
51
|
import { DropdownContent } from "./components/overlays/dropdown-content.js";
|
|
35
52
|
import { NavBrandProps, NavDropdownProps, NavGroupProps, NavbarCollapseBreakpoint, NavbarProps } from "./components/navbar/navbar.types.js";
|
|
36
53
|
import { NavBrand, NavDropdown, NavGroup, Navbar } from "./components/navbar/navbar.js";
|
|
37
54
|
import { NavItemAsChildProps, NavItemProps, NavLinkProps, PillProps, PillsAsChildProps, PillsProps, TabProps, TabsAsChildProps, TabsProps } from "./components/nav/nav.types.js";
|
|
38
55
|
import { NavItem, NavLink, Pill, Pills, Tab, Tabs } from "./components/nav/nav.js";
|
|
56
|
+
import "./components/nav/index.js";
|
|
57
|
+
import "./components/navbar/index.js";
|
|
39
58
|
import { PageProps } from "./components/page/page.types.js";
|
|
40
59
|
import { Page } from "./components/page/page.js";
|
|
60
|
+
import "./components/page/index.js";
|
|
41
61
|
import { PageHeaderProps } from "./components/page-header/page-header.types.js";
|
|
42
62
|
import { PageHeader } from "./components/page-header/page-header.js";
|
|
63
|
+
import "./components/page-header/index.js";
|
|
43
64
|
import { SectionProps } from "./components/section/section.types.js";
|
|
44
65
|
import { Section } from "./components/section/section.js";
|
|
66
|
+
import "./components/section/index.js";
|
|
45
67
|
import { SeparatorAsChildProps, SeparatorNativeProps, SeparatorOwnProps, SeparatorProps } from "./components/separator/separator.types.js";
|
|
46
68
|
import { Separator } from "./components/separator/separator.js";
|
|
69
|
+
import "./components/separator/index.js";
|
|
47
70
|
import { SidebarButtonProps, SidebarCollapsible, SidebarPartProps, SidebarProps, SidebarSide, SidebarTooltipSide, SidebarVariant } from "./components/sidebar/sidebar.types.js";
|
|
48
|
-
import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem,
|
|
71
|
+
import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarRail, SidebarScope, SidebarTrigger } from "./components/sidebar/sidebar.js";
|
|
72
|
+
import "./components/sidebar/index.js";
|
|
49
73
|
import { SkeletonAsChildProps, SkeletonOwnProps, SkeletonProps } from "./components/skeleton/skeleton.types.js";
|
|
50
74
|
import { Skeleton } from "./components/skeleton/skeleton.js";
|
|
75
|
+
import "./components/skeleton/index.js";
|
|
51
76
|
import { SpinnerOwnProps, SpinnerProps, SpinnerSize } from "./components/spinner/spinner.types.js";
|
|
52
77
|
import { Spinner } from "./components/spinner/spinner.js";
|
|
78
|
+
import "./components/spinner/index.js";
|
|
53
79
|
import { Stat, StatDescription, StatLabel, StatValue } from "./components/stat/stat.js";
|
|
80
|
+
import "./components/stat/index.js";
|
|
54
81
|
import { Text } from "./components/text/text.js";
|
|
82
|
+
import "./components/text/index.js";
|
|
55
83
|
import { ToolbarProps } from "./components/toolbar/toolbar.types.js";
|
|
56
84
|
import { Toolbar } from "./components/toolbar/toolbar.js";
|
|
57
|
-
import
|
|
85
|
+
import "./components/toolbar/index.js";
|
|
86
|
+
import { CAT_THEME_NAMES, CAT_THEME_OPTIONS, CatThemeName, DEFAULT_THEME_OPTIONS, ThemeName, ThemeOption, ThemePicker, ThemePickerProps, ThemeScope, ThemeScopeProps, ThemeScopeValue, ThemeToggle, ThemeToggleProps, ThemeToggleRenderContext, theme } from "./components/theme/theme.js";
|
|
87
|
+
import "./components/theme/index.js";
|
|
58
88
|
import { AlertDescription, AlertTitle, Box, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Calendar, CalendarBody, CalendarCaption, CalendarCell, CalendarDay, CalendarGrid, CalendarHead, CalendarHeader, CalendarNav, CalendarNextButton, CalendarPreviousButton, CalendarRow, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, CatalogComponentProps, Combobox, ComboboxInput, ComboboxList, ComboboxOption, Command, CommandDialog, CommandEmpty, CommandGroup, CommandGroupHeading, CommandHeader, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DataTable, DatePicker, DatePickerInput, Direction, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, FieldContent, FieldDescription, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Inline, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemTitle, Kbd, NativeSelect, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, ResizableHandle, ResizablePanel, ResizablePanelGroup, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, Shell, ShellMain, ShellNav, Sonner, Stack, TabsContent, TabsList, TabsTrigger, Toaster, Typography, TypographyBlockquote, TypographyH1, TypographyH2, TypographyH3, TypographyH4, TypographyLead, TypographyList, TypographyMuted, TypographyP } from "./components/catalog.js";
|
|
59
|
-
import { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Button, ButtonAsChildElement, ButtonAsChildProps, ButtonNativeProps, ButtonProps, ButtonSize, ButtonVariant, ButtonWidth, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, DebouncedInput, Dialog, Dialog as Drawer, Dialog as Sheet, DialogClose, DialogClose as DrawerClose, DialogClose as SheetClose, DialogContent, DialogContent as DrawerContent, DialogDescription, DialogDescription as DrawerDescription, DialogOverlay, DialogOverlay as DrawerOverlay, DialogOverlay as SheetOverlay, DialogPortal, DialogPortal as DrawerPortal, DialogPortal as SheetPortal, DialogTitle, DialogTitle as DrawerTitle, DialogTrigger, DialogTrigger as DrawerTrigger, DialogTrigger as SheetTrigger, Dropdown, Dropdown as ContextMenu, Dropdown as DropdownMenu, DropdownGroup, DropdownGroup as ContextMenuGroup, DropdownGroup as DropdownMenuGroup, DropdownItem, DropdownItem as ContextMenuItem, DropdownItem as DropdownMenuItem, DropdownItemVariant, DropdownLabel, DropdownLabel as ContextMenuLabel, DropdownLabel as DropdownMenuLabel, DropdownPortal, DropdownPortal as ContextMenuPortal, DropdownPortal as DropdownMenuPortal, DropdownSeparator, DropdownSeparator as ContextMenuSeparator, DropdownSeparator as DropdownMenuSeparator, DropdownTrigger, DropdownTrigger as ContextMenuTrigger, DropdownTrigger as DropdownMenuTrigger, DropdownTriggerSize, DropdownTriggerVariant, Form, HoverCard, HoverCardContent, HoverCardPortal, HoverCardTrigger, Input, Label, Menubar, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Popover, PopoverClose, PopoverContent, PopoverContentWidth, PopoverPortal, PopoverTrigger, Progress, ProgressCircle, ProgressCircleIndicator, ProgressIndicator, RadioGroup, RadioGroupItem, ScrollArea, ScrollAreaCorner, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, Select, SelectContent, SelectGroup, SelectItem, SelectItemText, SelectLabel, SelectPortal, SelectSeparator, SelectTrigger, SelectTriggerSize, SelectValue, Slider, SliderRange, SliderThumb, SliderTrack, Switch, Table, TableBody, TableCaption, TableCell, TableFoot, TableHead, TableHeaderCell, TableRow, Textarea, Toast, ToastAction, ToastClose, ToastDescription,
|
|
60
|
-
export { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AlertHeadingTag, type AlertProps, AlertTitle, type AlertVariant, Aside, type AsideProps, AspectRatio, type AspectRatioAsChildProps, type AspectRatioProps, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeAsChildProps, type BadgeOwnProps, type BadgeProps, Block, type BlockAlign, type BlockAsChildProps, type BlockBackground, type BlockDirection, type BlockDivProps, type BlockElement, type BlockElementProps, type BlockJustify, type BlockMargin, type BlockNativeProps, type BlockOwnProps, type BlockProps, type BlockRadius, type ResponsiveValue as BlockResponsiveValue, type BlockRowFrom, type BlockShadow, type BlockSize, type BlockSpace, type BlockSpanProps, type BlockZIndex, Box, Brand, BrandLabel, BrandMark, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonAsChildElement, type ButtonAsChildProps, ButtonGroup, type ButtonGroupOrientation, type ButtonGroupProps, type ButtonNativeProps, type ButtonProps, type ButtonSize, type ButtonVariant, type ButtonWidth, CAT_THEME_NAMES, CAT_THEME_OPTIONS, Calendar, CalendarBody, CalendarCaption, CalendarCell, CalendarDay, CalendarGrid, CalendarHead, CalendarHeader, CalendarNav, CalendarNextButton, CalendarPreviousButton, CalendarRow, Card, CardAction, type CardActionProps, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, type CardVariant, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type CatThemeName, CatalogComponentProps, Checkbox, Close, type CloseNativeProps, type CloseOwnProps, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxInput, ComboboxList, ComboboxOption, Command, CommandDialog, CommandEmpty, CommandGroup, CommandGroupHeading, CommandHeader, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Container, type ContainerProps, ContextMenu, DropdownContent as ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuSeparator, ContextMenuTrigger, DEFAULT_THEME_OPTIONS, DataTable, DatePicker, DatePickerInput, DebouncedInput, Dialog, DialogClose, DialogContent, DialogDescription, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Direction, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, Dropdown, DropdownContent, DropdownGroup, DropdownItem, type DropdownItemVariant, DropdownLabel, DropdownMenu, DropdownContent as DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuTrigger, DropdownPortal, DropdownSeparator, DropdownTrigger, type DropdownTriggerSize, type DropdownTriggerVariant, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateHeadingTag, type EmptyStateProps, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, type FieldErrorProps, FieldGroup, FieldHint, type FieldHintProps, FieldLabel, FieldLegend, type FieldProps, FieldSeparator, FieldSet, FieldTitle, Footer, FooterContent, type FooterContentProps, FooterDescription, type FooterDescriptionProps, FooterLink, type FooterLinkProps, FooterLinks, type FooterLinksProps, type FooterProps, FooterSection, type FooterSectionProps, FooterTitle, type FooterTitleProps, Form, Grid, Header, type HeaderProps, HoverCard, HoverCardContent, HoverCardPortal, HoverCardTrigger, Inline, Input, InputGroup, type InputGroupOrientation, type InputGroupProps, InputGroupText, type InputGroupTextAsChildProps, type InputGroupTextProps, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemTitle, Kbd, Label, Main, type MainProps, Menubar, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NativeSelect, Navbar as Nav, NavBrand, type NavBrandProps, NavDropdown, type NavDropdownProps, NavGroup, type NavGroupProps, NavItem, type NavItemAsChildProps, type NavItemProps, NavLink, type NavLinkProps, Navbar, type NavbarCollapseBreakpoint, type NavbarProps, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Page, PageHeader, type PageHeaderProps, type PageProps, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Pill, type PillProps, Pills, type PillsAsChildProps, type PillsProps, Popover, PopoverClose, PopoverContent, type PopoverContentWidth, PopoverPortal, PopoverTrigger, Progress, ProgressCircle, ProgressCircleIndicator, ProgressIndicator, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollAreaCorner, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, Section, type SectionProps, Select, SelectContent, SelectGroup, SelectItem, SelectItemText, SelectLabel, SelectPortal, SelectSeparator, SelectTrigger, type SelectTriggerSize, SelectValue, Separator, type SeparatorAsChildProps, type SeparatorNativeProps, type SeparatorOwnProps, type SeparatorProps, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Shell, ShellMain, ShellNav, Sidebar, type SidebarButtonProps, type SidebarCollapsible, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, type SidebarPartProps, type SidebarProps,
|
|
89
|
+
import { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Button, ButtonAsChildElement, ButtonAsChildProps, ButtonNativeProps, ButtonProps, ButtonSize, ButtonVariant, ButtonWidth, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, DebouncedInput, Dialog, Dialog as Drawer, Dialog as Sheet, DialogClose, DialogClose as DrawerClose, DialogClose as SheetClose, DialogContent, DialogContent as DrawerContent, DialogDescription, DialogDescription as DrawerDescription, DialogOverlay, DialogOverlay as DrawerOverlay, DialogOverlay as SheetOverlay, DialogPortal, DialogPortal as DrawerPortal, DialogPortal as SheetPortal, DialogTitle, DialogTitle as DrawerTitle, DialogTrigger, DialogTrigger as DrawerTrigger, DialogTrigger as SheetTrigger, Dropdown, Dropdown as ContextMenu, Dropdown as DropdownMenu, DropdownGroup, DropdownGroup as ContextMenuGroup, DropdownGroup as DropdownMenuGroup, DropdownItem, DropdownItem as ContextMenuItem, DropdownItem as DropdownMenuItem, DropdownItemVariant, DropdownLabel, DropdownLabel as ContextMenuLabel, DropdownLabel as DropdownMenuLabel, DropdownPortal, DropdownPortal as ContextMenuPortal, DropdownPortal as DropdownMenuPortal, DropdownSeparator, DropdownSeparator as ContextMenuSeparator, DropdownSeparator as DropdownMenuSeparator, DropdownTrigger, DropdownTrigger as ContextMenuTrigger, DropdownTrigger as DropdownMenuTrigger, DropdownTriggerSize, DropdownTriggerVariant, Form, HoverCard, HoverCardContent, HoverCardPortal, HoverCardTrigger, Input, Label, Menubar, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Popover, PopoverClose, PopoverContent, PopoverContentWidth, PopoverPortal, PopoverTrigger, Progress, ProgressCircle, ProgressCircleIndicator, ProgressIndicator, RadioGroup, RadioGroupItem, ScrollArea, ScrollAreaCorner, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, Select, SelectContent, SelectGroup, SelectItem, SelectItemText, SelectLabel, SelectPortal, SelectSeparator, SelectTrigger, SelectTriggerSize, SelectValue, Slider, SliderRange, SliderThumb, SliderTrack, Switch, Table, TableBody, TableCaption, TableCell, TableFoot, TableHead, TableHeaderCell, TableRow, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastHost, ToastTitle, ToastViewport, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipPortal, TooltipTrigger, VirtualList, VirtualListApi, VirtualListAsChildProps, VirtualListProps, VirtualListRowComponent, VirtualListRowComponentProps, VirtualListRowElement, VirtualListState, VirtualListViewport, VirtualTable, VirtualTableApi, VirtualTableAsChildProps, VirtualTableCellComponent, VirtualTableCellComponentProps, VirtualTableCellElement, VirtualTableColumn, VirtualTableProps, VirtualTableState, VirtualTableViewport, VirtualTableWidth, VisuallyHidden } from "@askrjs/ui";
|
|
90
|
+
export { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AlertHeadingTag, type AlertProps, AlertTitle, type AlertVariant, Aside, type AsideProps, AspectRatio, type AspectRatioAsChildProps, type AspectRatioProps, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeAsChildProps, type BadgeOwnProps, type BadgeProps, Block, type BlockAlign, type BlockAsChildProps, type BlockBackground, type BlockDirection, type BlockDivProps, type BlockElement, type BlockElementProps, type BlockJustify, type BlockMargin, type BlockNativeProps, type BlockOwnProps, type BlockProps, type BlockRadius, type ResponsiveValue as BlockResponsiveValue, type BlockRowFrom, type BlockShadow, type BlockSize, type BlockSpace, type BlockSpanProps, type BlockZIndex, Box, Brand, BrandLabel, BrandMark, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonAsChildElement, type ButtonAsChildProps, ButtonGroup, type ButtonGroupOrientation, type ButtonGroupProps, type ButtonNativeProps, type ButtonProps, type ButtonSize, type ButtonVariant, type ButtonWidth, CAT_THEME_NAMES, CAT_THEME_OPTIONS, Calendar, CalendarBody, CalendarCaption, CalendarCell, CalendarDay, CalendarGrid, CalendarHead, CalendarHeader, CalendarNav, CalendarNextButton, CalendarPreviousButton, CalendarRow, Card, CardAction, type CardActionProps, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardFooter, type CardFooterProps, CardHeader, type CardHeaderProps, type CardProps, CardTitle, type CardTitleProps, type CardVariant, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type CatThemeName, CatalogComponentProps, Checkbox, Close, type CloseNativeProps, type CloseOwnProps, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxInput, ComboboxList, ComboboxOption, Command, CommandDialog, CommandEmpty, CommandGroup, CommandGroupHeading, CommandHeader, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Container, type ContainerProps, ContextMenu, DropdownContent as ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuSeparator, ContextMenuTrigger, DEFAULT_THEME_OPTIONS, DataTable, DatePicker, DatePickerInput, DebouncedInput, Dialog, DialogClose, DialogContent, DialogDescription, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Direction, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, Dropdown, DropdownContent, DropdownGroup, DropdownItem, type DropdownItemVariant, DropdownLabel, DropdownMenu, DropdownContent as DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuTrigger, DropdownPortal, DropdownSeparator, DropdownTrigger, type DropdownTriggerSize, type DropdownTriggerVariant, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateHeadingTag, type EmptyStateProps, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, type FieldErrorProps, FieldGroup, FieldHint, type FieldHintProps, FieldLabel, FieldLegend, type FieldProps, FieldSeparator, FieldSet, FieldTitle, Footer, FooterContent, type FooterContentProps, FooterDescription, type FooterDescriptionProps, FooterLink, type FooterLinkProps, FooterLinks, type FooterLinksProps, type FooterProps, FooterSection, type FooterSectionProps, FooterTitle, type FooterTitleProps, Form, Grid, Header, type HeaderProps, HoverCard, HoverCardContent, HoverCardPortal, HoverCardTrigger, Inline, Input, InputGroup, type InputGroupOrientation, type InputGroupProps, InputGroupText, type InputGroupTextAsChildProps, type InputGroupTextProps, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemTitle, Kbd, Label, Main, type MainProps, Menubar, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NativeSelect, Navbar as Nav, NavBrand, type NavBrandProps, NavDropdown, type NavDropdownProps, NavGroup, type NavGroupProps, NavItem, type NavItemAsChildProps, type NavItemProps, NavLink, type NavLinkProps, Navbar, type NavbarCollapseBreakpoint, type NavbarProps, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Page, PageHeader, type PageHeaderProps, type PageProps, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Pill, type PillProps, Pills, type PillsAsChildProps, type PillsProps, Popover, PopoverClose, PopoverContent, type PopoverContentWidth, PopoverPortal, PopoverTrigger, Progress, ProgressCircle, ProgressCircleIndicator, ProgressIndicator, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollAreaCorner, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, Section, type SectionProps, Select, SelectContent, SelectGroup, SelectItem, SelectItemText, SelectLabel, SelectPortal, SelectSeparator, SelectTrigger, type SelectTriggerSize, SelectValue, Separator, type SeparatorAsChildProps, type SeparatorNativeProps, type SeparatorOwnProps, type SeparatorProps, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Shell, ShellMain, ShellNav, Sidebar, type SidebarButtonProps, type SidebarCollapsible, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, type SidebarPartProps, type SidebarProps, SidebarRail, SidebarScope, type SidebarSide, type SidebarTooltipSide, SidebarTrigger, type SidebarVariant, Skeleton, type SkeletonAsChildProps, type SkeletonOwnProps, type SkeletonProps, Slider, SliderRange, SliderThumb, SliderTrack, Sonner, Spinner, type SpinnerOwnProps, type SpinnerProps, type SpinnerSize, Stack, Stat, StatDescription, StatLabel, StatValue, Switch, Tab, type TabProps, Table, TableBody, TableCaption, TableCell, TableFoot, TableHead, TableHeaderCell, TableRow, Tabs, type TabsAsChildProps, TabsContent, TabsList, type TabsProps, TabsTrigger, Text, Textarea, type ThemeName, type ThemeOption, ThemePicker, type ThemePickerProps, ThemeScope, type ThemeScopeProps, type ThemeScopeValue, ThemeToggle, type ThemeToggleProps, type ThemeToggleRenderContext, Toast, ToastAction, ToastClose, ToastDescription, ToastHost, ToastTitle, ToastViewport, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Toolbar, type ToolbarProps, Tooltip, TooltipContent, TooltipPortal, TooltipTrigger, Typography, TypographyBlockquote, TypographyH1, TypographyH2, TypographyH3, TypographyH4, TypographyLead, TypographyList, TypographyMuted, TypographyP, VirtualList, type VirtualListApi, type VirtualListAsChildProps, type VirtualListProps, type VirtualListRowComponent, type VirtualListRowComponentProps, type VirtualListRowElement, type VirtualListState, type VirtualListViewport, VirtualTable, type VirtualTableApi, type VirtualTableAsChildProps, type VirtualTableCellComponent, type VirtualTableCellComponentProps, type VirtualTableCellElement, type VirtualTableColumn, type VirtualTableProps, type VirtualTableState, type VirtualTableViewport, type VirtualTableWidth, VisuallyHidden, theme };
|
package/dist/components.js
CHANGED
|
@@ -23,13 +23,13 @@ import { Page } from "./components/page/page.js";
|
|
|
23
23
|
import { PageHeader } from "./components/page-header/page-header.js";
|
|
24
24
|
import { Section } from "./components/section/section.js";
|
|
25
25
|
import { Separator } from "./components/separator/separator.js";
|
|
26
|
-
import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem,
|
|
26
|
+
import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarRail, SidebarScope, SidebarTrigger } from "./components/sidebar/sidebar.js";
|
|
27
27
|
import { Skeleton } from "./components/skeleton/skeleton.js";
|
|
28
28
|
import { Spinner } from "./components/spinner/spinner.js";
|
|
29
29
|
import { Stat, StatDescription, StatLabel, StatValue } from "./components/stat/stat.js";
|
|
30
30
|
import { Text } from "./components/text/text.js";
|
|
31
31
|
import { Toolbar } from "./components/toolbar/toolbar.js";
|
|
32
|
-
import { CAT_THEME_NAMES, CAT_THEME_OPTIONS, DEFAULT_THEME_OPTIONS, ThemePicker,
|
|
32
|
+
import { CAT_THEME_NAMES, CAT_THEME_OPTIONS, DEFAULT_THEME_OPTIONS, ThemePicker, ThemeScope, ThemeToggle, theme } from "./components/theme/theme.js";
|
|
33
33
|
import { AlertDescription, AlertTitle, Box, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Calendar, CalendarBody, CalendarCaption, CalendarCell, CalendarDay, CalendarGrid, CalendarHead, CalendarHeader, CalendarNav, CalendarNextButton, CalendarPreviousButton, CalendarRow, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Combobox, ComboboxInput, ComboboxList, ComboboxOption, Command, CommandDialog, CommandEmpty, CommandGroup, CommandGroupHeading, CommandHeader, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DataTable, DatePicker, DatePickerInput, Direction, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, FieldContent, FieldDescription, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Inline, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemTitle, Kbd, NativeSelect, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, ResizableHandle, ResizablePanel, ResizablePanelGroup, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, Shell, ShellMain, ShellNav, Sonner, Stack, TabsContent, TabsList, TabsTrigger, Toaster, Typography, TypographyBlockquote, TypographyH1, TypographyH2, TypographyH3, TypographyH4, TypographyLead, TypographyList, TypographyMuted, TypographyP } from "./components/catalog.js";
|
|
34
|
-
import { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Button, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, DebouncedInput, Dialog, Dialog as Drawer, Dialog as Sheet, DialogClose, DialogClose as DrawerClose, DialogClose as SheetClose, DialogContent, DialogContent as DrawerContent, DialogDescription, DialogDescription as DrawerDescription, DialogOverlay, DialogOverlay as DrawerOverlay, DialogOverlay as SheetOverlay, DialogPortal, DialogPortal as DrawerPortal, DialogPortal as SheetPortal, DialogTitle, DialogTitle as DrawerTitle, DialogTrigger, DialogTrigger as DrawerTrigger, DialogTrigger as SheetTrigger, Dropdown, Dropdown as ContextMenu, Dropdown as DropdownMenu, DropdownGroup, DropdownGroup as ContextMenuGroup, DropdownGroup as DropdownMenuGroup, DropdownItem, DropdownItem as ContextMenuItem, DropdownItem as DropdownMenuItem, DropdownLabel, DropdownLabel as ContextMenuLabel, DropdownLabel as DropdownMenuLabel, DropdownPortal, DropdownPortal as ContextMenuPortal, DropdownPortal as DropdownMenuPortal, DropdownSeparator, DropdownSeparator as ContextMenuSeparator, DropdownSeparator as DropdownMenuSeparator, DropdownTrigger, DropdownTrigger as ContextMenuTrigger, DropdownTrigger as DropdownMenuTrigger, Form, HoverCard, HoverCardContent, HoverCardPortal, HoverCardTrigger, Input, Label, Menubar, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Popover, PopoverClose, PopoverContent, PopoverPortal, PopoverTrigger, Progress, ProgressCircle, ProgressCircleIndicator, ProgressIndicator, RadioGroup, RadioGroupItem, ScrollArea, ScrollAreaCorner, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, Select, SelectContent, SelectGroup, SelectItem, SelectItemText, SelectLabel, SelectPortal, SelectSeparator, SelectTrigger, SelectValue, Slider, SliderRange, SliderThumb, SliderTrack, Switch, Table, TableBody, TableCaption, TableCell, TableFoot, TableHead, TableHeaderCell, TableRow, Textarea, Toast, ToastAction, ToastClose, ToastDescription,
|
|
35
|
-
export { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, Aside, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, Block, Box, Brand, BrandLabel, BrandMark, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, CAT_THEME_NAMES, CAT_THEME_OPTIONS, Calendar, CalendarBody, CalendarCaption, CalendarCell, CalendarDay, CalendarGrid, CalendarHead, CalendarHeader, CalendarNav, CalendarNextButton, CalendarPreviousButton, CalendarRow, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, Close, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxInput, ComboboxList, ComboboxOption, Command, CommandDialog, CommandEmpty, CommandGroup, CommandGroupHeading, CommandHeader, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Container, ContextMenu, DropdownContent as ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuSeparator, ContextMenuTrigger, DEFAULT_THEME_OPTIONS, DataTable, DatePicker, DatePickerInput, DebouncedInput, Dialog, DialogClose, DialogContent, DialogDescription, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Direction, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, Dropdown, DropdownContent, DropdownGroup, DropdownItem, DropdownLabel, DropdownMenu, DropdownContent as DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuTrigger, DropdownPortal, DropdownSeparator, DropdownTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldHint, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Footer, FooterContent, FooterDescription, FooterLink, FooterLinks, FooterSection, FooterTitle, Form, Grid, Header, HoverCard, HoverCardContent, HoverCardPortal, HoverCardTrigger, Inline, Input, InputGroup, InputGroupText, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemTitle, Kbd, Label, Main, Menubar, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NativeSelect, Navbar as Nav, NavBrand, NavDropdown, NavGroup, NavItem, NavLink, Navbar, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Page, PageHeader, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Pill, Pills, Popover, PopoverClose, PopoverContent, PopoverPortal, PopoverTrigger, Progress, ProgressCircle, ProgressCircleIndicator, ProgressIndicator, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollAreaCorner, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, Section, Select, SelectContent, SelectGroup, SelectItem, SelectItemText, SelectLabel, SelectPortal, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Shell, ShellMain, ShellNav, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem,
|
|
34
|
+
import { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Button, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, DebouncedInput, Dialog, Dialog as Drawer, Dialog as Sheet, DialogClose, DialogClose as DrawerClose, DialogClose as SheetClose, DialogContent, DialogContent as DrawerContent, DialogDescription, DialogDescription as DrawerDescription, DialogOverlay, DialogOverlay as DrawerOverlay, DialogOverlay as SheetOverlay, DialogPortal, DialogPortal as DrawerPortal, DialogPortal as SheetPortal, DialogTitle, DialogTitle as DrawerTitle, DialogTrigger, DialogTrigger as DrawerTrigger, DialogTrigger as SheetTrigger, Dropdown, Dropdown as ContextMenu, Dropdown as DropdownMenu, DropdownGroup, DropdownGroup as ContextMenuGroup, DropdownGroup as DropdownMenuGroup, DropdownItem, DropdownItem as ContextMenuItem, DropdownItem as DropdownMenuItem, DropdownLabel, DropdownLabel as ContextMenuLabel, DropdownLabel as DropdownMenuLabel, DropdownPortal, DropdownPortal as ContextMenuPortal, DropdownPortal as DropdownMenuPortal, DropdownSeparator, DropdownSeparator as ContextMenuSeparator, DropdownSeparator as DropdownMenuSeparator, DropdownTrigger, DropdownTrigger as ContextMenuTrigger, DropdownTrigger as DropdownMenuTrigger, Form, HoverCard, HoverCardContent, HoverCardPortal, HoverCardTrigger, Input, Label, Menubar, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Popover, PopoverClose, PopoverContent, PopoverPortal, PopoverTrigger, Progress, ProgressCircle, ProgressCircleIndicator, ProgressIndicator, RadioGroup, RadioGroupItem, ScrollArea, ScrollAreaCorner, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, Select, SelectContent, SelectGroup, SelectItem, SelectItemText, SelectLabel, SelectPortal, SelectSeparator, SelectTrigger, SelectValue, Slider, SliderRange, SliderThumb, SliderTrack, Switch, Table, TableBody, TableCaption, TableCell, TableFoot, TableHead, TableHeaderCell, TableRow, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastHost, ToastTitle, ToastViewport, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipPortal, TooltipTrigger, VirtualList, VirtualTable, VisuallyHidden } from "@askrjs/ui";
|
|
35
|
+
export { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, Aside, AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, Block, Box, Brand, BrandLabel, BrandMark, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, CAT_THEME_NAMES, CAT_THEME_OPTIONS, Calendar, CalendarBody, CalendarCaption, CalendarCell, CalendarDay, CalendarGrid, CalendarHead, CalendarHeader, CalendarNav, CalendarNextButton, CalendarPreviousButton, CalendarRow, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, Close, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxInput, ComboboxList, ComboboxOption, Command, CommandDialog, CommandEmpty, CommandGroup, CommandGroupHeading, CommandHeader, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Container, ContextMenu, DropdownContent as ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuSeparator, ContextMenuTrigger, DEFAULT_THEME_OPTIONS, DataTable, DatePicker, DatePickerInput, DebouncedInput, Dialog, DialogClose, DialogContent, DialogDescription, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Direction, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, Dropdown, DropdownContent, DropdownGroup, DropdownItem, DropdownLabel, DropdownMenu, DropdownContent as DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuSeparator, DropdownMenuTrigger, DropdownPortal, DropdownSeparator, DropdownTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldHint, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Footer, FooterContent, FooterDescription, FooterLink, FooterLinks, FooterSection, FooterTitle, Form, Grid, Header, HoverCard, HoverCardContent, HoverCardPortal, HoverCardTrigger, Inline, Input, InputGroup, InputGroupText, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemTitle, Kbd, Label, Main, Menubar, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NativeSelect, Navbar as Nav, NavBrand, NavDropdown, NavGroup, NavItem, NavLink, Navbar, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Page, PageHeader, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Pill, Pills, Popover, PopoverClose, PopoverContent, PopoverPortal, PopoverTrigger, Progress, ProgressCircle, ProgressCircleIndicator, ProgressIndicator, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollAreaCorner, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, Section, Select, SelectContent, SelectGroup, SelectItem, SelectItemText, SelectLabel, SelectPortal, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Shell, ShellMain, ShellNav, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarRail, SidebarScope, SidebarTrigger, Skeleton, Slider, SliderRange, SliderThumb, SliderTrack, Sonner, Spinner, Stack, Stat, StatDescription, StatLabel, StatValue, Switch, Tab, Table, TableBody, TableCaption, TableCell, TableFoot, TableHead, TableHeaderCell, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Text, Textarea, ThemePicker, ThemeScope, ThemeToggle, Toast, ToastAction, ToastClose, ToastDescription, ToastHost, ToastTitle, ToastViewport, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Toolbar, Tooltip, TooltipContent, TooltipPortal, TooltipTrigger, Typography, TypographyBlockquote, TypographyH1, TypographyH2, TypographyH3, TypographyH4, TypographyLead, TypographyList, TypographyMuted, TypographyP, VirtualList, VirtualTable, VisuallyHidden, theme };
|
package/dist/controls.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { ButtonGroupOrientation, ButtonGroupProps } from "./components/button-group/button-group.types.js";
|
|
2
2
|
import { ButtonGroup } from "./components/button-group/button-group.js";
|
|
3
|
+
import "./components/button-group/index.js";
|
|
3
4
|
import { CloseNativeProps, CloseOwnProps } from "./components/close/close.types.js";
|
|
4
5
|
import { Close } from "./components/close/close.js";
|
|
6
|
+
import "./components/close/index.js";
|
|
5
7
|
import { FieldErrorProps, FieldHintProps, FieldProps } from "./components/field/field.types.js";
|
|
6
8
|
import { Field, FieldError, FieldHint } from "./components/field/field.js";
|
|
9
|
+
import "./components/field/index.js";
|
|
7
10
|
import { InputGroupOrientation, InputGroupProps, InputGroupTextAsChildProps, InputGroupTextProps } from "./components/input-group/input-group.types.js";
|
|
8
11
|
import { InputGroup, InputGroupText } from "./components/input-group/input-group.js";
|
|
12
|
+
import "./components/input-group/index.js";
|
|
9
13
|
import { Button, ButtonAsChildProps, ButtonNativeProps, ButtonOwnProps, ButtonProps, Checkbox, CheckboxAsChildProps, CheckboxInputProps, CheckboxOwnProps, CheckboxProps, Input, InputAsChildProps, InputEvent, InputInputProps, InputOwnProps, InputProps, Label, LabelAsChildProps, LabelLabelProps, LabelOwnProps, LabelProps, PressEvent, RadioGroup, RadioGroupItem, RadioGroupItemAsChildProps, RadioGroupItemOwnProps, RadioGroupItemProps, RadioGroupOwnProps, RadioGroupProps, Select, SelectContent, SelectContentAsChildProps, SelectContentOwnProps, SelectContentProps, SelectGroup, SelectGroupAsChildProps, SelectGroupProps, SelectItem, SelectItemAsChildProps, SelectItemOwnProps, SelectItemProps, SelectItemText, SelectItemTextAsChildProps, SelectItemTextProps, SelectLabel, SelectLabelAsChildProps, SelectLabelProps, SelectOwnProps, SelectPortal, SelectPortalProps, SelectProps, SelectSeparator, SelectSeparatorAsChildProps, SelectSeparatorProps, SelectTrigger, SelectTriggerAsChildProps, SelectTriggerProps, SelectValue, SelectValueAsChildProps, SelectValueOwnProps, SelectValueProps, Switch, SwitchAsChildProps, SwitchButtonProps, SwitchOwnProps, SwitchProps, Textarea, TextareaAsChildProps, TextareaElementProps, TextareaOwnProps, TextareaProps } from "@askrjs/ui";
|
|
10
14
|
export { Button, type ButtonAsChildProps, ButtonGroup, type ButtonGroupOrientation, type ButtonGroupProps, type ButtonNativeProps, type ButtonOwnProps, type ButtonProps, Checkbox, type CheckboxAsChildProps, type CheckboxInputProps, type CheckboxOwnProps, type CheckboxProps, Close, type CloseNativeProps, type CloseOwnProps, Field, FieldError, type FieldErrorProps, FieldHint, type FieldHintProps, type FieldProps, Input, type InputAsChildProps, type InputEvent, InputGroup, type InputGroupOrientation, type InputGroupProps, InputGroupText, type InputGroupTextAsChildProps, type InputGroupTextProps, type InputInputProps, type InputOwnProps, type InputProps, Label, type LabelAsChildProps, type LabelLabelProps, type LabelOwnProps, type LabelProps, type PressEvent, RadioGroup, RadioGroupItem, type RadioGroupItemAsChildProps, type RadioGroupItemOwnProps, type RadioGroupItemProps, type RadioGroupOwnProps, type RadioGroupProps, Select, SelectContent, type SelectContentAsChildProps, type SelectContentOwnProps, type SelectContentProps, SelectGroup, type SelectGroupAsChildProps, type SelectGroupProps, SelectItem, type SelectItemAsChildProps, type SelectItemOwnProps, type SelectItemProps, SelectItemText, type SelectItemTextAsChildProps, type SelectItemTextProps, SelectLabel, type SelectLabelAsChildProps, type SelectLabelProps, type SelectOwnProps, SelectPortal, type SelectPortalProps, type SelectProps, SelectSeparator, type SelectSeparatorAsChildProps, type SelectSeparatorProps, SelectTrigger, type SelectTriggerAsChildProps, type SelectTriggerProps, SelectValue, type SelectValueAsChildProps, type SelectValueOwnProps, type SelectValueProps, Switch, type SwitchAsChildProps, type SwitchButtonProps, type SwitchOwnProps, type SwitchProps, Textarea, type TextareaAsChildProps, type TextareaElementProps, type TextareaOwnProps, type TextareaProps };
|