rockin 0.0.38 → 0.0.40
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/dist/chunk-4ILCWFOE.js +18 -0
- package/dist/chunk-GL2CQ5TR.js +78 -0
- package/dist/{chunk-6JS62NO4.js → chunk-ILKXRTV2.js} +2 -2
- package/dist/chunk-UZGJXAFX.js +41 -0
- package/dist/{chunk-G3RYS466.js → chunk-YA5PSI7E.js} +6 -2
- package/dist/hooks/index.d.ts +5 -1
- package/dist/hooks/index.js +5 -4
- package/dist/index.d.ts +38 -0
- package/dist/index.js +2 -2
- package/dist/layout.js +4 -3
- package/dist/lib/index.d.ts +43 -1
- package/dist/lib/index.js +5 -1
- package/dist/provider.d.ts +0 -1
- package/dist/provider.js +3 -3
- package/dist/sdk/accordion.js +1 -0
- package/dist/sdk/agent.js +1 -0
- package/dist/sdk/alert-dialog.js +1 -0
- package/dist/sdk/async-options.js +1 -0
- package/dist/sdk/autocomplete.js +1 -0
- package/dist/sdk/avatar.js +1 -0
- package/dist/sdk/button.js +1 -0
- package/dist/sdk/calendar.js +1 -0
- package/dist/sdk/carousel.js +1 -0
- package/dist/sdk/checkbox.js +1 -0
- package/dist/sdk/collapsible.js +1 -0
- package/dist/sdk/color-picker.js +1 -0
- package/dist/sdk/color.js +1 -0
- package/dist/sdk/combobox.js +1 -0
- package/dist/sdk/command.js +1 -0
- package/dist/sdk/core/accordion.js +1 -0
- package/dist/sdk/core/agent.js +1 -0
- package/dist/sdk/core/alert-dialog.js +1 -0
- package/dist/sdk/core/async-options.js +1 -0
- package/dist/sdk/core/autocomplete.js +1 -0
- package/dist/sdk/core/avatar.js +1 -0
- package/dist/sdk/core/button.js +1 -0
- package/dist/sdk/core/calendar.js +1 -0
- package/dist/sdk/core/carousel.js +1 -0
- package/dist/sdk/core/checkbox.js +1 -0
- package/dist/sdk/core/collapsible.js +1 -0
- package/dist/sdk/core/color-picker.js +1 -0
- package/dist/sdk/core/color.js +1 -0
- package/dist/sdk/core/combobox.js +1 -0
- package/dist/sdk/core/command.js +1 -0
- package/dist/sdk/core/date-input.js +1 -0
- package/dist/sdk/core/date-picker.js +1 -0
- package/dist/sdk/core/date.js +1 -0
- package/dist/sdk/core/dialog.js +1 -0
- package/dist/sdk/core/drawer.js +1 -0
- package/dist/sdk/core/field.js +1 -0
- package/dist/sdk/core/file-input.js +1 -0
- package/dist/sdk/core/gesture.js +1 -0
- package/dist/sdk/core/history.js +1 -0
- package/dist/sdk/core/hover-card.js +1 -0
- package/dist/sdk/core/image-cropper.js +1 -0
- package/dist/sdk/core/image.js +1 -0
- package/dist/sdk/core/input.js +1 -0
- package/dist/sdk/core/label.js +1 -0
- package/dist/sdk/core/listbox.js +1 -0
- package/dist/sdk/core/menu.js +1 -0
- package/dist/sdk/core/menubar.js +1 -0
- package/dist/sdk/core/meter.js +1 -0
- package/dist/sdk/core/navigation-menu.js +1 -0
- package/dist/sdk/core/number-input.js +1 -0
- package/dist/sdk/core/number.js +1 -0
- package/dist/sdk/core/observe.js +1 -0
- package/dist/sdk/core/otp-input.js +1 -0
- package/dist/sdk/core/overlays.js +1 -0
- package/dist/sdk/core/pagination.js +1 -0
- package/dist/sdk/core/password-input.js +1 -0
- package/dist/sdk/core/popover.js +1 -0
- package/dist/sdk/core/progress.js +1 -0
- package/dist/sdk/core/radio.js +1 -0
- package/dist/sdk/core/rating.js +1 -0
- package/dist/sdk/core/renderer.js +1 -0
- package/dist/sdk/core/resizable.js +1 -0
- package/dist/sdk/core/scroll-area.js +1 -0
- package/dist/sdk/core/segmented-control.js +1 -0
- package/dist/sdk/core/select.js +1 -0
- package/dist/sdk/core/separator.js +1 -0
- package/dist/sdk/core/shortcuts.js +1 -0
- package/dist/sdk/core/slider.js +1 -0
- package/dist/sdk/core/switch.js +1 -0
- package/dist/sdk/core/tabs.js +1 -0
- package/dist/sdk/core/testing.js +1 -0
- package/dist/sdk/core/text-match.js +1 -0
- package/dist/sdk/core/time-input.js +1 -0
- package/dist/sdk/core/timeline.js +1 -0
- package/dist/sdk/core/toast.js +1 -0
- package/dist/sdk/core/toggle.js +1 -0
- package/dist/sdk/core/token-input.js +1 -0
- package/dist/sdk/core/toolbar.js +1 -0
- package/dist/sdk/core/tooltip.js +1 -0
- package/dist/sdk/core/tree.js +1 -0
- package/dist/sdk/core/trigger-menu.js +1 -0
- package/dist/sdk/core/waterfall.js +1 -0
- package/dist/sdk/core.js +1 -0
- package/dist/sdk/date-input.js +1 -0
- package/dist/sdk/date-picker.js +1 -0
- package/dist/sdk/date.js +1 -0
- package/dist/sdk/dialog.js +1 -0
- package/dist/sdk/drawer.js +1 -0
- package/dist/sdk/field.js +1 -0
- package/dist/sdk/file-input.js +1 -0
- package/dist/sdk/gesture.js +1 -0
- package/dist/sdk/history.js +1 -0
- package/dist/sdk/hover-card.js +1 -0
- package/dist/sdk/image-cropper.js +1 -0
- package/dist/sdk/image.js +1 -0
- package/dist/sdk/input.js +1 -0
- package/dist/sdk/label.js +1 -0
- package/dist/sdk/listbox.js +1 -0
- package/dist/sdk/menu.js +1 -0
- package/dist/sdk/menubar.js +1 -0
- package/dist/sdk/meter.js +1 -0
- package/dist/sdk/navigation-menu.js +1 -0
- package/dist/sdk/number-input.js +1 -0
- package/dist/sdk/number.js +1 -0
- package/dist/sdk/observe.js +1 -0
- package/dist/sdk/otp-input.js +1 -0
- package/dist/sdk/overlays.js +1 -0
- package/dist/sdk/pagination.js +1 -0
- package/dist/sdk/password-input.js +1 -0
- package/dist/sdk/popover.js +1 -0
- package/dist/sdk/preferences.js +1 -0
- package/dist/sdk/primitive.js +1 -0
- package/dist/sdk/progress.js +1 -0
- package/dist/sdk/radio.js +1 -0
- package/dist/sdk/rating.js +1 -0
- package/dist/sdk/resizable.js +1 -0
- package/dist/sdk/scroll-area.js +1 -0
- package/dist/sdk/segmented-control.js +1 -0
- package/dist/sdk/select.js +1 -0
- package/dist/sdk/separator.js +1 -0
- package/dist/sdk/shortcuts.js +1 -0
- package/dist/sdk/slider.js +1 -0
- package/dist/sdk/switch.js +1 -0
- package/dist/sdk/tabs.js +1 -0
- package/dist/sdk/text-match.js +1 -0
- package/dist/sdk/textarea.js +1 -0
- package/dist/sdk/time-input.js +1 -0
- package/dist/sdk/timeline.js +1 -0
- package/dist/sdk/toast.js +1 -0
- package/dist/sdk/toggle.js +1 -0
- package/dist/sdk/token-input.js +1 -0
- package/dist/sdk/toolbar.js +1 -0
- package/dist/sdk/tooltip.js +1 -0
- package/dist/sdk/tree.js +1 -0
- package/dist/sdk/trigger-menu.js +1 -0
- package/dist/sdk/waterfall.js +1 -0
- package/dist/ui/bridge.js +1 -1
- package/dist/ui/code-block.js +2 -2
- package/dist/ui/drawer-dialog.js +411 -0
- package/dist/ui/farmer/div.js +4 -2
- package/dist/ui/index.d.ts +61 -1
- package/dist/ui/index.js +1 -0
- package/dist/ui/sonner.js +2 -2
- package/dist/ui/sortable.js +29 -64
- package/dist/ui/tabs.js +1 -1
- package/dist/ui/theme-switcher.js +3 -3
- package/dist/ui/theme-toggle.js +2 -2
- package/package.json +5 -4
- package/dist/chunk-G233W3IR.js +0 -17
- package/dist/chunk-X56ZEDOW.js +0 -46
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
usePreferences
|
|
3
|
+
} from "./chunk-YA5PSI7E.js";
|
|
4
|
+
|
|
5
|
+
// src/hooks/useMediaQuery.ts
|
|
6
|
+
import { usePreference } from "@ui-sdk/react/preferences";
|
|
7
|
+
function useMediaQuery() {
|
|
8
|
+
const device = usePreference(usePreferences().screen);
|
|
9
|
+
return {
|
|
10
|
+
device,
|
|
11
|
+
isMobile: device === "mobile",
|
|
12
|
+
isDesktop: device === "desktop"
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
useMediaQuery
|
|
18
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// src/lib/preferences.ts
|
|
2
|
+
import {
|
|
3
|
+
createColorScheme,
|
|
4
|
+
createCookieStorage,
|
|
5
|
+
createPreference
|
|
6
|
+
} from "@ui-sdk/core";
|
|
7
|
+
var ACCENTS = ["slate", "violet", "mint", "gold"];
|
|
8
|
+
var DEVICES = ["mobile", "desktop"];
|
|
9
|
+
var MOBILE_QUERY = "(max-width: 767px)";
|
|
10
|
+
var PREFERENCE_COOKIES = {
|
|
11
|
+
colorScheme: "color-scheme",
|
|
12
|
+
accent: "accent",
|
|
13
|
+
device: "device"
|
|
14
|
+
};
|
|
15
|
+
function createAppPreferences(cookie) {
|
|
16
|
+
const device = createPreference({
|
|
17
|
+
values: DEVICES,
|
|
18
|
+
defaultValue: "desktop",
|
|
19
|
+
attribute: "data-device",
|
|
20
|
+
global: true,
|
|
21
|
+
storage: createCookieStorage(PREFERENCE_COOKIES.device, { cookie })
|
|
22
|
+
});
|
|
23
|
+
return {
|
|
24
|
+
colorScheme: createColorScheme({
|
|
25
|
+
global: true,
|
|
26
|
+
storage: createCookieStorage(PREFERENCE_COOKIES.colorScheme, { cookie })
|
|
27
|
+
}),
|
|
28
|
+
accent: createPreference({
|
|
29
|
+
values: ACCENTS,
|
|
30
|
+
defaultValue: "slate",
|
|
31
|
+
attribute: "data-accent",
|
|
32
|
+
global: true,
|
|
33
|
+
storage: createCookieStorage(PREFERENCE_COOKIES.accent, { cookie })
|
|
34
|
+
}),
|
|
35
|
+
device,
|
|
36
|
+
screen: createScreen(device)
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function createScreen(device) {
|
|
40
|
+
const read = () => window.matchMedia(MOBILE_QUERY).matches ? "mobile" : "desktop";
|
|
41
|
+
return {
|
|
42
|
+
initialState: device.initialState.value,
|
|
43
|
+
get: () => typeof window === "undefined" ? device.initialState.value : read(),
|
|
44
|
+
subscribe(listener) {
|
|
45
|
+
const list = window.matchMedia(MOBILE_QUERY);
|
|
46
|
+
const sync = () => {
|
|
47
|
+
device.set(read());
|
|
48
|
+
listener();
|
|
49
|
+
};
|
|
50
|
+
device.set(read());
|
|
51
|
+
list.addEventListener("change", sync);
|
|
52
|
+
return () => list.removeEventListener("change", sync);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function preferenceAttributes(cookie) {
|
|
57
|
+
const { colorScheme, accent, device } = createAppPreferences(cookie);
|
|
58
|
+
return {
|
|
59
|
+
[colorScheme.attribute]: colorScheme.initialState.value,
|
|
60
|
+
[accent.attribute]: accent.initialState.value,
|
|
61
|
+
[device.attribute]: device.initialState.value
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function preferencesScript(cookie) {
|
|
65
|
+
return `(()=>{const r=document.documentElement;for(const[k,v]of Object.entries(${JSON.stringify(
|
|
66
|
+
preferenceAttributes(cookie)
|
|
67
|
+
)}))r.setAttribute(k,v)})()`;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export {
|
|
71
|
+
ACCENTS,
|
|
72
|
+
DEVICES,
|
|
73
|
+
MOBILE_QUERY,
|
|
74
|
+
PREFERENCE_COOKIES,
|
|
75
|
+
createAppPreferences,
|
|
76
|
+
preferenceAttributes,
|
|
77
|
+
preferencesScript
|
|
78
|
+
};
|
|
@@ -157,7 +157,7 @@ function TabsList({
|
|
|
157
157
|
shown: overflowing && !(side === "start" ? scroll.atStart : scroll.atEnd),
|
|
158
158
|
"data-no-ring": true,
|
|
159
159
|
className: cn(
|
|
160
|
-
`pointer-events-none absolute inset-y-0 z-10 inline-flex w-9 scale-75 items-center justify-center text-foreground opacity-0 transition-[opacity,scale] duration-200 outline-none data-visible:pointer-events-auto data-visible:scale-100 data-visible:opacity-100 motion-reduce:transition-none ${vertical}:inset-x-0 ${vertical}:inset-y-auto ${vertical}:h-9 ${vertical}:w-auto [&_svg]:size-4.5 [&_svg]:transition-opacity [&_svg]:duration-150 hover:[&_svg]:opacity-70`,
|
|
160
|
+
`pointer-events-none absolute inset-y-0 z-10 inline-flex w-9 scale-75 items-center justify-center text-foreground opacity-0 transition-[opacity,scale] duration-200 outline-none not-supports-[animation-timeline:scroll()]:data-visible:pointer-events-auto not-supports-[animation-timeline:scroll()]:data-visible:scale-100 not-supports-[animation-timeline:scroll()]:data-visible:opacity-100 motion-reduce:transition-none ${vertical}:inset-x-0 ${vertical}:inset-y-auto ${vertical}:h-9 ${vertical}:w-auto [&_svg]:size-4.5 [&_svg]:transition-opacity [&_svg]:duration-150 hover:[&_svg]:opacity-70`,
|
|
161
161
|
ease,
|
|
162
162
|
arrowSide[side]
|
|
163
163
|
),
|
|
@@ -175,7 +175,7 @@ function TabsList({
|
|
|
175
175
|
{
|
|
176
176
|
"data-no-ring": true,
|
|
177
177
|
className: cn(
|
|
178
|
-
"max-h-[inherit] min-w-0 flex-1 scroll-fade-x scrollbar-none outline-none [--scroll-fade-reveal:2.25rem]
|
|
178
|
+
"max-h-[inherit] min-w-0 flex-1 scroll-fade-x scroll-fade scrollbar-none outline-none [--scroll-fade-reveal:2.25rem] in-data-[orientation=vertical]:scroll-fade-y [&::-webkit-scrollbar]:hidden"
|
|
179
179
|
),
|
|
180
180
|
children: /* @__PURE__ */ jsx(Scroll.Content, { className: "w-max min-w-full", children: /* @__PURE__ */ jsx(Arrows.Track, { children: /* @__PURE__ */ jsx(
|
|
181
181
|
Tab.List,
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// src/lib/compose-refs.ts
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
function setRef(ref, value) {
|
|
4
|
+
if (typeof ref === "function") {
|
|
5
|
+
return ref(value);
|
|
6
|
+
}
|
|
7
|
+
if (ref !== null && ref !== void 0) {
|
|
8
|
+
ref.current = value;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function composeRefs(...refs) {
|
|
12
|
+
return (node) => {
|
|
13
|
+
let hasCleanup = false;
|
|
14
|
+
const cleanups = refs.map((ref) => {
|
|
15
|
+
const cleanup = setRef(ref, node);
|
|
16
|
+
if (!hasCleanup && typeof cleanup === "function") {
|
|
17
|
+
hasCleanup = true;
|
|
18
|
+
}
|
|
19
|
+
return cleanup;
|
|
20
|
+
});
|
|
21
|
+
if (hasCleanup) {
|
|
22
|
+
return () => {
|
|
23
|
+
for (let i = 0; i < cleanups.length; i++) {
|
|
24
|
+
const cleanup = cleanups[i];
|
|
25
|
+
if (typeof cleanup === "function") {
|
|
26
|
+
cleanup();
|
|
27
|
+
} else {
|
|
28
|
+
setRef(refs[i], null);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function useComposedRefs(...refs) {
|
|
36
|
+
return React.useCallback(composeRefs(...refs), refs);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export {
|
|
40
|
+
useComposedRefs
|
|
41
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAppPreferences
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GL2CQ5TR.js";
|
|
4
4
|
|
|
5
5
|
// src/theme.tsx
|
|
6
6
|
import { Preferences, usePreference } from "@ui-sdk/react/preferences";
|
|
@@ -16,7 +16,11 @@ function PreferencesProvider({
|
|
|
16
16
|
return /* @__PURE__ */ jsx(PreferencesContext, { value: preferences, children: /* @__PURE__ */ jsx(
|
|
17
17
|
Preferences,
|
|
18
18
|
{
|
|
19
|
-
preferences: [
|
|
19
|
+
preferences: [
|
|
20
|
+
preferences.colorScheme,
|
|
21
|
+
preferences.accent,
|
|
22
|
+
preferences.device
|
|
23
|
+
],
|
|
20
24
|
children
|
|
21
25
|
}
|
|
22
26
|
) });
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -7,7 +7,11 @@ declare function useFullscreen(): {
|
|
|
7
7
|
toggleFullscreen: () => Promise<void>;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
|
-
declare function useMediaQuery(
|
|
10
|
+
declare function useMediaQuery(): {
|
|
11
|
+
device: "mobile" | "desktop";
|
|
12
|
+
isMobile: boolean;
|
|
13
|
+
isDesktop: boolean;
|
|
14
|
+
};
|
|
11
15
|
|
|
12
16
|
declare function useMounted(): {
|
|
13
17
|
mounted: boolean;
|
package/dist/hooks/index.js
CHANGED
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
import {
|
|
3
3
|
useMounted
|
|
4
4
|
} from "../chunk-G4NDAZTB.js";
|
|
5
|
-
import {
|
|
6
|
-
useMediaQuery
|
|
7
|
-
} from "../chunk-G233W3IR.js";
|
|
8
5
|
import {
|
|
9
6
|
useDataGrid,
|
|
10
7
|
useDataTable,
|
|
@@ -12,6 +9,9 @@ import {
|
|
|
12
9
|
useDataTableRows,
|
|
13
10
|
useDataTableSearch
|
|
14
11
|
} from "../chunk-D6TULSM6.js";
|
|
12
|
+
import {
|
|
13
|
+
useMediaQuery
|
|
14
|
+
} from "../chunk-4ILCWFOE.js";
|
|
15
15
|
import "../chunk-VFDNWPOI.js";
|
|
16
16
|
import "../chunk-COPQJFDI.js";
|
|
17
17
|
import "../chunk-MZBLIA6C.js";
|
|
@@ -30,7 +30,8 @@ import {
|
|
|
30
30
|
import {
|
|
31
31
|
isNativeApp
|
|
32
32
|
} from "../chunk-2LD63YUK.js";
|
|
33
|
-
import "../chunk-
|
|
33
|
+
import "../chunk-YA5PSI7E.js";
|
|
34
|
+
import "../chunk-GL2CQ5TR.js";
|
|
34
35
|
|
|
35
36
|
// src/hooks/useSearchParams.ts
|
|
36
37
|
import {
|
package/dist/index.d.ts
CHANGED
|
@@ -73,6 +73,44 @@ declare function usePreferences(): {
|
|
|
73
73
|
value: "gold" | "violet" | "slate" | "mint";
|
|
74
74
|
}>, key: Key) => () => void;
|
|
75
75
|
};
|
|
76
|
+
device: {
|
|
77
|
+
attribute: `data-${string}`;
|
|
78
|
+
global: boolean;
|
|
79
|
+
values: readonly ("mobile" | "desktop")[];
|
|
80
|
+
defaultValue: "mobile" | "desktop";
|
|
81
|
+
storage: {
|
|
82
|
+
id: string;
|
|
83
|
+
kind: "local" | "session" | "cookie";
|
|
84
|
+
readsOnServer: boolean;
|
|
85
|
+
script: (options: _ui_sdk_core.StorageScriptOptions) => string | undefined;
|
|
86
|
+
available: () => boolean;
|
|
87
|
+
get: () => string | null;
|
|
88
|
+
set: (value: string) => boolean;
|
|
89
|
+
remove: () => boolean;
|
|
90
|
+
subscribe(listener: (value: string | null) => void): () => void;
|
|
91
|
+
} | undefined;
|
|
92
|
+
initialState: {
|
|
93
|
+
value: "mobile" | "desktop";
|
|
94
|
+
};
|
|
95
|
+
get: () => {
|
|
96
|
+
value: "mobile" | "desktop";
|
|
97
|
+
};
|
|
98
|
+
set: (next: "mobile" | "desktop", change?: {
|
|
99
|
+
reason?: _ui_sdk_core.ChangeReason;
|
|
100
|
+
event?: Event;
|
|
101
|
+
}) => boolean;
|
|
102
|
+
subscribe: (listener: (state: {
|
|
103
|
+
value: "mobile" | "desktop";
|
|
104
|
+
}) => void) => () => void;
|
|
105
|
+
follow: <Key extends string>(store: _ui_sdk_core.PreferenceStore<Key, {
|
|
106
|
+
value: "mobile" | "desktop";
|
|
107
|
+
}>, key: Key) => () => void;
|
|
108
|
+
};
|
|
109
|
+
screen: {
|
|
110
|
+
initialState: "mobile" | "desktop";
|
|
111
|
+
get: () => "mobile" | "desktop";
|
|
112
|
+
subscribe(listener: () => void): () => void;
|
|
113
|
+
};
|
|
76
114
|
};
|
|
77
115
|
/** The theme as next-themes shaped it, backed by ui-sdk's color scheme. */
|
|
78
116
|
declare function useTheme(): {
|
package/dist/index.js
CHANGED
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
useAccent,
|
|
5
5
|
usePreferences,
|
|
6
6
|
useTheme
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-YA5PSI7E.js";
|
|
8
8
|
import {
|
|
9
9
|
TopLoader
|
|
10
10
|
} from "./chunk-3ZGQJTWY.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-GL2CQ5TR.js";
|
|
12
12
|
import {
|
|
13
13
|
BellIcon,
|
|
14
14
|
IconSwap,
|
package/dist/layout.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
preferencesScript
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GL2CQ5TR.js";
|
|
4
4
|
|
|
5
5
|
// src/layout/layout.tsx
|
|
6
6
|
import { cookies } from "next/headers";
|
|
7
|
+
import { NuqsAdapter } from "nuqs/adapters/next/app";
|
|
7
8
|
import { ClientProvider } from "./provider.js";
|
|
8
|
-
import {
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
10
|
async function Layout({ cookie, ...props }) {
|
|
10
11
|
const header = cookie ?? (await cookies()).toString();
|
|
11
|
-
return /* @__PURE__ */ jsxs(
|
|
12
|
+
return /* @__PURE__ */ jsxs(NuqsAdapter, { children: [
|
|
12
13
|
/* @__PURE__ */ jsx("script", { dangerouslySetInnerHTML: { __html: preferencesScript(header) } }),
|
|
13
14
|
/* @__PURE__ */ jsx(ClientProvider, { cookie: header, ...props })
|
|
14
15
|
] });
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -201,9 +201,13 @@ declare function pickNativeChooserImageFiles({ isNative, limit, title, }: {
|
|
|
201
201
|
|
|
202
202
|
declare const ACCENTS: readonly ["slate", "violet", "mint", "gold"];
|
|
203
203
|
type Accent = (typeof ACCENTS)[number];
|
|
204
|
+
declare const DEVICES: readonly ["mobile", "desktop"];
|
|
205
|
+
type Device = (typeof DEVICES)[number];
|
|
206
|
+
declare const MOBILE_QUERY = "(max-width: 767px)";
|
|
204
207
|
declare const PREFERENCE_COOKIES: {
|
|
205
208
|
readonly colorScheme: "color-scheme";
|
|
206
209
|
readonly accent: "accent";
|
|
210
|
+
readonly device: "device";
|
|
207
211
|
};
|
|
208
212
|
/**
|
|
209
213
|
* The app's saved preferences, kept in cookies so the server renders them too.
|
|
@@ -268,6 +272,44 @@ declare function createAppPreferences(cookie?: string | null): {
|
|
|
268
272
|
value: "gold" | "violet" | "slate" | "mint";
|
|
269
273
|
}>, key: Key) => () => void;
|
|
270
274
|
};
|
|
275
|
+
device: {
|
|
276
|
+
attribute: `data-${string}`;
|
|
277
|
+
global: boolean;
|
|
278
|
+
values: readonly ("mobile" | "desktop")[];
|
|
279
|
+
defaultValue: "mobile" | "desktop";
|
|
280
|
+
storage: {
|
|
281
|
+
id: string;
|
|
282
|
+
kind: "local" | "session" | "cookie";
|
|
283
|
+
readsOnServer: boolean;
|
|
284
|
+
script: (options: _ui_sdk_core.StorageScriptOptions) => string | undefined;
|
|
285
|
+
available: () => boolean;
|
|
286
|
+
get: () => string | null;
|
|
287
|
+
set: (value: string) => boolean;
|
|
288
|
+
remove: () => boolean;
|
|
289
|
+
subscribe(listener: (value: string | null) => void): () => void;
|
|
290
|
+
} | undefined;
|
|
291
|
+
initialState: {
|
|
292
|
+
value: "mobile" | "desktop";
|
|
293
|
+
};
|
|
294
|
+
get: () => {
|
|
295
|
+
value: "mobile" | "desktop";
|
|
296
|
+
};
|
|
297
|
+
set: (next: "mobile" | "desktop", change?: {
|
|
298
|
+
reason?: _ui_sdk_core.ChangeReason;
|
|
299
|
+
event?: Event;
|
|
300
|
+
}) => boolean;
|
|
301
|
+
subscribe: (listener: (state: {
|
|
302
|
+
value: "mobile" | "desktop";
|
|
303
|
+
}) => void) => () => void;
|
|
304
|
+
follow: <Key extends string>(store: _ui_sdk_core.PreferenceStore<Key, {
|
|
305
|
+
value: "mobile" | "desktop";
|
|
306
|
+
}>, key: Key) => () => void;
|
|
307
|
+
};
|
|
308
|
+
screen: {
|
|
309
|
+
initialState: "mobile" | "desktop";
|
|
310
|
+
get: () => "mobile" | "desktop";
|
|
311
|
+
subscribe(listener: () => void): () => void;
|
|
312
|
+
};
|
|
271
313
|
};
|
|
272
314
|
type AppPreferences = ReturnType<typeof createAppPreferences>;
|
|
273
315
|
/** The `<html>` attributes for a request's saved preferences. */
|
|
@@ -275,4 +317,4 @@ declare function preferenceAttributes(cookie?: string | null): Record<`data-${st
|
|
|
275
317
|
/** Sets the saved preferences on `<html>` while the page parses, before it paints. */
|
|
276
318
|
declare function preferencesScript(cookie?: string | null): string;
|
|
277
319
|
|
|
278
|
-
export { ACCENTS, type Accent, type AppPreferences, type NativeSharePayload, type NativeSharedFile, type NativeUpdateInfo, type NativeUpdateState, PREFERENCE_COOKIES, createAppPreferences, getNativeAppPlugin, getNativeAppSettingsPlugin, getNativeBrowserPlugin, getNativeCameraPlugin, getNativeImagePickerPlugin, getNativeInAppUpdatePlugin, getNativePaymentPlugin, getNativePlatform, getNativeShareFilePlugin, getNativeSharePlugin, getNativeShareTargetPlugin, getNativeStatusBarPlugin, getNativeThemePlugin, isNativeApp, nativeSharedFileToFile, openExternalUrl, openNativeAppSettings, openUpiPaymentUrl, pickNativeChooserImageFiles, pickNativeImageFiles, preferenceAttributes, preferencesScript, saveNativeShareImage, shareNativeOrWeb };
|
|
320
|
+
export { ACCENTS, type Accent, type AppPreferences, DEVICES, type Device, MOBILE_QUERY, type NativeSharePayload, type NativeSharedFile, type NativeUpdateInfo, type NativeUpdateState, PREFERENCE_COOKIES, createAppPreferences, getNativeAppPlugin, getNativeAppSettingsPlugin, getNativeBrowserPlugin, getNativeCameraPlugin, getNativeImagePickerPlugin, getNativeInAppUpdatePlugin, getNativePaymentPlugin, getNativePlatform, getNativeShareFilePlugin, getNativeSharePlugin, getNativeShareTargetPlugin, getNativeStatusBarPlugin, getNativeThemePlugin, isNativeApp, nativeSharedFileToFile, openExternalUrl, openNativeAppSettings, openUpiPaymentUrl, pickNativeChooserImageFiles, pickNativeImageFiles, preferenceAttributes, preferencesScript, saveNativeShareImage, shareNativeOrWeb };
|
package/dist/lib/index.js
CHANGED
|
@@ -24,13 +24,17 @@ import {
|
|
|
24
24
|
} from "../chunk-2LD63YUK.js";
|
|
25
25
|
import {
|
|
26
26
|
ACCENTS,
|
|
27
|
+
DEVICES,
|
|
28
|
+
MOBILE_QUERY,
|
|
27
29
|
PREFERENCE_COOKIES,
|
|
28
30
|
createAppPreferences,
|
|
29
31
|
preferenceAttributes,
|
|
30
32
|
preferencesScript
|
|
31
|
-
} from "../chunk-
|
|
33
|
+
} from "../chunk-GL2CQ5TR.js";
|
|
32
34
|
export {
|
|
33
35
|
ACCENTS,
|
|
36
|
+
DEVICES,
|
|
37
|
+
MOBILE_QUERY,
|
|
34
38
|
PREFERENCE_COOKIES,
|
|
35
39
|
createAppPreferences,
|
|
36
40
|
getNativeAppPlugin,
|
package/dist/provider.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ type BrowserTheme = keyof typeof browserThemeColors;
|
|
|
8
8
|
type BrowserThemeColors = Record<BrowserTheme, string>;
|
|
9
9
|
type ClientProviderProps = {
|
|
10
10
|
children?: React.ReactNode;
|
|
11
|
-
/** The request's `Cookie` header, so saved preferences render on the server. */
|
|
12
11
|
cookie?: string | null;
|
|
13
12
|
light?: string;
|
|
14
13
|
dark?: string;
|
package/dist/provider.js
CHANGED
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
PreferencesProvider,
|
|
12
12
|
usePreferences,
|
|
13
13
|
useTheme
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-YA5PSI7E.js";
|
|
15
15
|
import {
|
|
16
16
|
TopLoader
|
|
17
17
|
} from "./chunk-3ZGQJTWY.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-GL2CQ5TR.js";
|
|
19
19
|
|
|
20
20
|
// src/provider.tsx
|
|
21
21
|
import * as React from "react";
|
|
@@ -38,7 +38,7 @@ function BrowserChrome({ light, dark }) {
|
|
|
38
38
|
))
|
|
39
39
|
meta.content = style;
|
|
40
40
|
window.dispatchEvent(
|
|
41
|
-
new CustomEvent("
|
|
41
|
+
new CustomEvent("rockin:theme-change", { detail: { theme: resolved } })
|
|
42
42
|
);
|
|
43
43
|
}, [resolved]);
|
|
44
44
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/react/accordion"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/react/agent"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/react/alert-dialog"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/react/async-options"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/react/autocomplete"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/react/avatar"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/react/button"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/react/calendar"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/react/carousel"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/react/checkbox"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/react/collapsible"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/react/color-picker"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/react/color"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/react/combobox"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/react/command"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/accordion"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/agent"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/alert-dialog"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/async-options"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/autocomplete"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/avatar"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/button"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/calendar"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/carousel"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/checkbox"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/collapsible"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/color-picker"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/color"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/combobox"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/command"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/date-input"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/date-picker"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/date"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/dialog"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/drawer"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/field"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/file-input"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/gesture"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/history"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/hover-card"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/image-cropper"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/image"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/input"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/label"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/listbox"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/menu"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/menubar"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/meter"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/navigation-menu"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/number-input"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/number"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/observe"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/otp-input"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/overlays"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/pagination"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/password-input"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/popover"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/progress"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/radio"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/rating"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/renderer"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/resizable"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@ui-sdk/core/scroll-area"
|