@saasflare/ui 3.1.1 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -2
- package/dist/{button-0Bdl7Nqm.d.ts → button-BA7OcXqy.d.mts} +12 -17
- package/dist/{button-Brb4BhPO.d.mts → button-Bfg2Tnvx.d.ts} +12 -17
- package/dist/{chunk-D5LKWKG7.js → chunk-2GOPD64T.js} +117 -89
- package/dist/{chunk-WPOOC2FX.mjs → chunk-2ONA6OMO.mjs} +33 -44
- package/dist/{chunk-RW2S3KNB.mjs → chunk-5C65JNGY.mjs} +7 -6
- package/dist/{chunk-DNLCSV5M.js → chunk-7UD3SGPP.js} +32 -43
- package/dist/chunk-GI6VN7XU.mjs +2143 -0
- package/dist/{chunk-FT66KYRN.js → chunk-ITALEYDI.js} +2 -2
- package/dist/{chunk-4BOMMZEY.js → chunk-JC7EIEGI.js} +14 -13
- package/dist/chunk-N65HIOBD.js +234 -0
- package/dist/{chunk-EJHYM2HP.mjs → chunk-OZAWULTM.mjs} +1 -1
- package/dist/chunk-R3AVBLJ3.js +2207 -0
- package/dist/{chunk-WRONFPRI.mjs → chunk-RMQBB72G.mjs} +118 -91
- package/dist/chunk-XNDTCYSO.mjs +211 -0
- package/dist/{dialog-BmY55WSX.d.ts → dialog-CZRwrqDa.d.ts} +2 -2
- package/dist/{dialog-CcaHMAsS.d.mts → dialog-Cr0becOL.d.mts} +2 -2
- package/dist/entries/calendar.d.mts +3 -3
- package/dist/entries/calendar.d.ts +3 -3
- package/dist/entries/calendar.js +13 -214
- package/dist/entries/calendar.mjs +5 -196
- package/dist/entries/carousel.d.mts +3 -3
- package/dist/entries/carousel.d.ts +3 -3
- package/dist/entries/carousel.js +17 -14
- package/dist/entries/carousel.mjs +10 -7
- package/dist/entries/chart.d.mts +1 -1
- package/dist/entries/chart.d.ts +1 -1
- package/dist/entries/chart.js +11 -11
- package/dist/entries/chart.mjs +1 -1
- package/dist/entries/command.d.mts +3 -3
- package/dist/entries/command.d.ts +3 -3
- package/dist/entries/command.js +21 -19
- package/dist/entries/command.mjs +8 -6
- package/dist/entries/drawer.d.mts +1 -1
- package/dist/entries/drawer.d.ts +1 -1
- package/dist/entries/drawer.js +9 -9
- package/dist/entries/drawer.mjs +2 -2
- package/dist/entries/input-otp.d.mts +2 -2
- package/dist/entries/input-otp.d.ts +2 -2
- package/dist/entries/input-otp.js +10 -8
- package/dist/entries/input-otp.mjs +6 -4
- package/dist/entries/resizable.d.mts +3 -2
- package/dist/entries/resizable.d.ts +3 -2
- package/dist/entries/resizable.js +8 -6
- package/dist/entries/resizable.mjs +6 -4
- package/dist/index.d.mts +974 -31
- package/dist/index.d.ts +974 -31
- package/dist/index.js +2994 -556
- package/dist/index.mjs +2488 -201
- package/dist/{use-saasflare-props-NrM2Glmp.d.ts → use-saasflare-props-BrjMhU0U.d.mts} +53 -4
- package/dist/{use-saasflare-props-NrM2Glmp.d.mts → use-saasflare-props-BrjMhU0U.d.ts} +53 -4
- package/package.json +4 -3
- package/styles/aurora.css +47 -0
- package/styles/palettes.css +487 -3
- package/styles/surfaces.css +89 -10
- package/styles/theme.css +41 -19
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
3
|
import { twMerge } from 'tailwind-merge';
|
|
4
4
|
import * as React2 from 'react';
|
|
5
|
-
import { createContext,
|
|
5
|
+
import { createContext, useRef, useCallback, useState, useEffect, useContext } from 'react';
|
|
6
6
|
import 'class-variance-authority';
|
|
7
7
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
8
8
|
import { ThemeProvider, useTheme } from 'next-themes';
|
|
@@ -68,6 +68,99 @@ var getServerSnapshot = () => false;
|
|
|
68
68
|
function useReducedMotion() {
|
|
69
69
|
return React2.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
70
70
|
}
|
|
71
|
+
var SYNC_PREFIX = "sf-ls:";
|
|
72
|
+
function useLocalStorage(key, initialValue, options) {
|
|
73
|
+
const initialRef = useRef(initialValue);
|
|
74
|
+
const optionsRef = useRef(options);
|
|
75
|
+
optionsRef.current = options;
|
|
76
|
+
const serialize = useCallback(
|
|
77
|
+
(value) => (optionsRef.current?.serializer ?? JSON.stringify)(value),
|
|
78
|
+
[]
|
|
79
|
+
);
|
|
80
|
+
const deserialize = useCallback(
|
|
81
|
+
(raw) => (optionsRef.current?.deserializer ?? JSON.parse)(raw),
|
|
82
|
+
[]
|
|
83
|
+
);
|
|
84
|
+
const handleError = useCallback(
|
|
85
|
+
(error, operation) => {
|
|
86
|
+
if (optionsRef.current?.onError) {
|
|
87
|
+
optionsRef.current.onError(error, operation);
|
|
88
|
+
} else {
|
|
89
|
+
console.warn(`useLocalStorage: ${operation} failed for "${key}"`, error);
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
[key]
|
|
93
|
+
);
|
|
94
|
+
const readValue = useCallback(() => {
|
|
95
|
+
if (typeof window === "undefined") return initialRef.current;
|
|
96
|
+
try {
|
|
97
|
+
const item = window.localStorage.getItem(key);
|
|
98
|
+
return item !== null ? deserialize(item) : initialRef.current;
|
|
99
|
+
} catch (error) {
|
|
100
|
+
handleError(error, "read");
|
|
101
|
+
return initialRef.current;
|
|
102
|
+
}
|
|
103
|
+
}, [key, deserialize, handleError]);
|
|
104
|
+
const [storedValue, setStoredValue] = useState(initialValue);
|
|
105
|
+
const setValue = useCallback(
|
|
106
|
+
(value) => {
|
|
107
|
+
let prev;
|
|
108
|
+
if (typeof window === "undefined") {
|
|
109
|
+
prev = initialRef.current;
|
|
110
|
+
} else {
|
|
111
|
+
try {
|
|
112
|
+
const raw = window.localStorage.getItem(key);
|
|
113
|
+
prev = raw !== null ? deserialize(raw) : initialRef.current;
|
|
114
|
+
} catch {
|
|
115
|
+
prev = initialRef.current;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
const next = typeof value === "function" ? value(prev) : value;
|
|
119
|
+
setStoredValue(next);
|
|
120
|
+
if (typeof window === "undefined") return;
|
|
121
|
+
try {
|
|
122
|
+
window.localStorage.setItem(key, serialize(next));
|
|
123
|
+
} catch (err) {
|
|
124
|
+
handleError(err, "write");
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
setTimeout(() => {
|
|
128
|
+
window.dispatchEvent(new CustomEvent(`${SYNC_PREFIX}${key}`));
|
|
129
|
+
}, 0);
|
|
130
|
+
},
|
|
131
|
+
[key, serialize, deserialize, handleError]
|
|
132
|
+
);
|
|
133
|
+
const removeValue = useCallback(() => {
|
|
134
|
+
setStoredValue(initialRef.current);
|
|
135
|
+
if (typeof window === "undefined") return;
|
|
136
|
+
try {
|
|
137
|
+
window.localStorage.removeItem(key);
|
|
138
|
+
} catch (err) {
|
|
139
|
+
handleError(err, "remove");
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
setTimeout(() => {
|
|
143
|
+
window.dispatchEvent(new CustomEvent(`${SYNC_PREFIX}${key}`));
|
|
144
|
+
}, 0);
|
|
145
|
+
}, [key, handleError]);
|
|
146
|
+
useEffect(() => {
|
|
147
|
+
const onStorage = (e) => {
|
|
148
|
+
if (e.key === key) setStoredValue(readValue());
|
|
149
|
+
};
|
|
150
|
+
const onSync = () => setStoredValue(readValue());
|
|
151
|
+
const syncEvent = `${SYNC_PREFIX}${key}`;
|
|
152
|
+
window.addEventListener("storage", onStorage);
|
|
153
|
+
window.addEventListener(syncEvent, onSync);
|
|
154
|
+
return () => {
|
|
155
|
+
window.removeEventListener("storage", onStorage);
|
|
156
|
+
window.removeEventListener(syncEvent, onSync);
|
|
157
|
+
};
|
|
158
|
+
}, [key, readValue]);
|
|
159
|
+
useEffect(() => {
|
|
160
|
+
setStoredValue(readValue());
|
|
161
|
+
}, [readValue]);
|
|
162
|
+
return [storedValue, setValue, removeValue];
|
|
163
|
+
}
|
|
71
164
|
var AnimationContext = createContext(
|
|
72
165
|
void 0
|
|
73
166
|
);
|
|
@@ -130,95 +223,18 @@ function SaasflareScript({ nonce, palette, surface, radius, animated, storageKey
|
|
|
130
223
|
}
|
|
131
224
|
);
|
|
132
225
|
}
|
|
133
|
-
var SYNC_PREFIX = "sf-ls:";
|
|
134
|
-
function useLocalStorage(key, initialValue, options) {
|
|
135
|
-
const initialRef = useRef(initialValue);
|
|
136
|
-
const optionsRef = useRef(options);
|
|
137
|
-
optionsRef.current = options;
|
|
138
|
-
const serialize = useCallback(
|
|
139
|
-
(value) => (optionsRef.current?.serializer ?? JSON.stringify)(value),
|
|
140
|
-
[]
|
|
141
|
-
);
|
|
142
|
-
const deserialize = useCallback(
|
|
143
|
-
(raw) => (optionsRef.current?.deserializer ?? JSON.parse)(raw),
|
|
144
|
-
[]
|
|
145
|
-
);
|
|
146
|
-
const handleError = useCallback(
|
|
147
|
-
(error, operation) => {
|
|
148
|
-
if (optionsRef.current?.onError) {
|
|
149
|
-
optionsRef.current.onError(error, operation);
|
|
150
|
-
} else {
|
|
151
|
-
console.warn(`useLocalStorage: ${operation} failed for "${key}"`, error);
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
[key]
|
|
155
|
-
);
|
|
156
|
-
const readValue = useCallback(() => {
|
|
157
|
-
if (typeof window === "undefined") return initialRef.current;
|
|
158
|
-
try {
|
|
159
|
-
const item = window.localStorage.getItem(key);
|
|
160
|
-
return item !== null ? deserialize(item) : initialRef.current;
|
|
161
|
-
} catch (error) {
|
|
162
|
-
handleError(error, "read");
|
|
163
|
-
return initialRef.current;
|
|
164
|
-
}
|
|
165
|
-
}, [key, deserialize, handleError]);
|
|
166
|
-
const [storedValue, setStoredValue] = useState(() => readValue());
|
|
167
|
-
const setValue = useCallback(
|
|
168
|
-
(value) => {
|
|
169
|
-
try {
|
|
170
|
-
setStoredValue((prev) => {
|
|
171
|
-
const next = typeof value === "function" ? value(prev) : value;
|
|
172
|
-
if (typeof window !== "undefined") {
|
|
173
|
-
window.localStorage.setItem(key, serialize(next));
|
|
174
|
-
window.dispatchEvent(new CustomEvent(`${SYNC_PREFIX}${key}`));
|
|
175
|
-
}
|
|
176
|
-
return next;
|
|
177
|
-
});
|
|
178
|
-
} catch (error) {
|
|
179
|
-
handleError(error, "write");
|
|
180
|
-
}
|
|
181
|
-
},
|
|
182
|
-
[key, serialize, handleError]
|
|
183
|
-
);
|
|
184
|
-
const removeValue = useCallback(() => {
|
|
185
|
-
try {
|
|
186
|
-
if (typeof window !== "undefined") {
|
|
187
|
-
window.localStorage.removeItem(key);
|
|
188
|
-
window.dispatchEvent(new CustomEvent(`${SYNC_PREFIX}${key}`));
|
|
189
|
-
}
|
|
190
|
-
setStoredValue(initialRef.current);
|
|
191
|
-
} catch (error) {
|
|
192
|
-
handleError(error, "remove");
|
|
193
|
-
}
|
|
194
|
-
}, [key, handleError]);
|
|
195
|
-
useEffect(() => {
|
|
196
|
-
const onStorage = (e) => {
|
|
197
|
-
if (e.key === key) setStoredValue(readValue());
|
|
198
|
-
};
|
|
199
|
-
const onSync = () => setStoredValue(readValue());
|
|
200
|
-
const syncEvent = `${SYNC_PREFIX}${key}`;
|
|
201
|
-
window.addEventListener("storage", onStorage);
|
|
202
|
-
window.addEventListener(syncEvent, onSync);
|
|
203
|
-
return () => {
|
|
204
|
-
window.removeEventListener("storage", onStorage);
|
|
205
|
-
window.removeEventListener(syncEvent, onSync);
|
|
206
|
-
};
|
|
207
|
-
}, [key, readValue]);
|
|
208
|
-
useEffect(() => {
|
|
209
|
-
setStoredValue(readValue());
|
|
210
|
-
}, [readValue]);
|
|
211
|
-
return [storedValue, setValue, removeValue];
|
|
212
|
-
}
|
|
213
226
|
var DEFAULT_CONTEXT = {
|
|
214
227
|
palette: null,
|
|
215
228
|
surface: "flat",
|
|
216
|
-
radius: "
|
|
229
|
+
radius: "soft",
|
|
230
|
+
iconWeight: "regular",
|
|
217
231
|
setPalette: () => {
|
|
218
232
|
},
|
|
219
233
|
setSurface: () => {
|
|
220
234
|
},
|
|
221
235
|
setRadius: () => {
|
|
236
|
+
},
|
|
237
|
+
setIconWeight: () => {
|
|
222
238
|
}
|
|
223
239
|
};
|
|
224
240
|
var SaasflareThemeContext = createContext(DEFAULT_CONTEXT);
|
|
@@ -278,7 +294,8 @@ var PERSISTED_DEFAULTS = {
|
|
|
278
294
|
palette: null,
|
|
279
295
|
surface: null,
|
|
280
296
|
radius: null,
|
|
281
|
-
animated: null
|
|
297
|
+
animated: null,
|
|
298
|
+
iconWeight: null
|
|
282
299
|
};
|
|
283
300
|
function SaasflareProvider({
|
|
284
301
|
children,
|
|
@@ -286,8 +303,9 @@ function SaasflareProvider({
|
|
|
286
303
|
palette,
|
|
287
304
|
surface,
|
|
288
305
|
radius,
|
|
289
|
-
|
|
290
|
-
|
|
306
|
+
iconWeight,
|
|
307
|
+
animated,
|
|
308
|
+
smoothScrolling = true,
|
|
291
309
|
disableScript = false,
|
|
292
310
|
scriptNonce,
|
|
293
311
|
storageKey = UI_PREFS_STORAGE_KEY,
|
|
@@ -304,7 +322,9 @@ function SaasflareProvider({
|
|
|
304
322
|
);
|
|
305
323
|
const currentPalette = isCustomPalette ? palette.name : palette ?? persisted.palette;
|
|
306
324
|
const currentStyle = surface ?? persisted.surface ?? "flat";
|
|
307
|
-
const currentRadius = radius ?? persisted.radius ?? "
|
|
325
|
+
const currentRadius = radius ?? persisted.radius ?? "soft";
|
|
326
|
+
const currentIconWeight = iconWeight ?? persisted.iconWeight ?? "regular";
|
|
327
|
+
const currentAnimated = animated ?? persisted.animated ?? true;
|
|
308
328
|
const setPalette = useCallback(
|
|
309
329
|
(id) => setPersisted((prev) => ({ ...prev, palette: id })),
|
|
310
330
|
[setPersisted]
|
|
@@ -317,8 +337,12 @@ function SaasflareProvider({
|
|
|
317
337
|
(r) => setPersisted((prev) => ({ ...prev, radius: r })),
|
|
318
338
|
[setPersisted]
|
|
319
339
|
);
|
|
340
|
+
const setIconWeight = useCallback(
|
|
341
|
+
(w) => setPersisted((prev) => ({ ...prev, iconWeight: w })),
|
|
342
|
+
[setPersisted]
|
|
343
|
+
);
|
|
320
344
|
const prefersReduced = useReducedMotion();
|
|
321
|
-
const effectiveAnimated =
|
|
345
|
+
const effectiveAnimated = currentAnimated && !prefersReduced;
|
|
322
346
|
useEffect(() => {
|
|
323
347
|
const root = document.documentElement;
|
|
324
348
|
if (currentPalette) {
|
|
@@ -335,7 +359,7 @@ function SaasflareProvider({
|
|
|
335
359
|
{
|
|
336
360
|
attribute: "class",
|
|
337
361
|
defaultTheme: theme,
|
|
338
|
-
enableSystem:
|
|
362
|
+
enableSystem: true,
|
|
339
363
|
storageKey: themeStorageKey,
|
|
340
364
|
disableTransitionOnChange: true,
|
|
341
365
|
children: [
|
|
@@ -353,9 +377,11 @@ function SaasflareProvider({
|
|
|
353
377
|
palette: currentPalette,
|
|
354
378
|
surface: currentStyle,
|
|
355
379
|
radius: currentRadius,
|
|
380
|
+
iconWeight: currentIconWeight,
|
|
356
381
|
setPalette,
|
|
357
382
|
setSurface,
|
|
358
|
-
setRadius
|
|
383
|
+
setRadius,
|
|
384
|
+
setIconWeight
|
|
359
385
|
},
|
|
360
386
|
children: /* @__PURE__ */ jsxs(AnimationContext.Provider, { value: { animated: effectiveAnimated }, children: [
|
|
361
387
|
isCustomPalette && /* @__PURE__ */ jsx(CustomPaletteInjector, { palette }),
|
|
@@ -422,8 +448,9 @@ function useSaasflareProps(props = {}) {
|
|
|
422
448
|
surface: props.surface ?? ctx.surface,
|
|
423
449
|
radius: props.radius ?? ctx.radius,
|
|
424
450
|
animated: props.animated ?? anim?.animated ?? true,
|
|
425
|
-
palette: ctx.palette
|
|
451
|
+
palette: ctx.palette,
|
|
452
|
+
iconWeight: props.iconWeight ?? ctx.iconWeight
|
|
426
453
|
};
|
|
427
454
|
}
|
|
428
455
|
|
|
429
|
-
export { SaasflareProvider, SaasflareScript, SaasflareShell, SmoothScrollProvider, cn, useAnimation, useReducedMotion, useSaasflareProps, useSaasflareTheme };
|
|
456
|
+
export { SaasflareProvider, SaasflareScript, SaasflareShell, SmoothScrollProvider, cn, useAnimation, useLocalStorage, useReducedMotion, useSaasflareProps, useSaasflareTheme };
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { buttonVariants, Button } from './chunk-2ONA6OMO.mjs';
|
|
3
|
+
import { CaretLeftIcon, CaretRightIcon, CaretDownIcon } from './chunk-GI6VN7XU.mjs';
|
|
4
|
+
import { useSaasflareProps, cn } from './chunk-RMQBB72G.mjs';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { getDefaultClassNames, DayPicker } from 'react-day-picker';
|
|
7
|
+
import { jsx } from 'react/jsx-runtime';
|
|
8
|
+
|
|
9
|
+
function Calendar({
|
|
10
|
+
className,
|
|
11
|
+
classNames,
|
|
12
|
+
showOutsideDays = true,
|
|
13
|
+
captionLayout = "label",
|
|
14
|
+
buttonVariant = "ghost",
|
|
15
|
+
formatters,
|
|
16
|
+
components,
|
|
17
|
+
surface,
|
|
18
|
+
radius,
|
|
19
|
+
animated,
|
|
20
|
+
iconWeight,
|
|
21
|
+
...props
|
|
22
|
+
}) {
|
|
23
|
+
const sf = useSaasflareProps({ surface, radius, animated, iconWeight });
|
|
24
|
+
const defaultClassNames = getDefaultClassNames();
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
DayPicker,
|
|
27
|
+
{
|
|
28
|
+
"data-slot": "calendar",
|
|
29
|
+
"data-surface": sf.surface,
|
|
30
|
+
"data-radius": sf.radius,
|
|
31
|
+
"data-animated": String(sf.animated),
|
|
32
|
+
showOutsideDays,
|
|
33
|
+
className: cn(
|
|
34
|
+
"group/calendar bg-background p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
35
|
+
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
36
|
+
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
37
|
+
className
|
|
38
|
+
),
|
|
39
|
+
captionLayout,
|
|
40
|
+
formatters: {
|
|
41
|
+
formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
|
|
42
|
+
...formatters
|
|
43
|
+
},
|
|
44
|
+
classNames: {
|
|
45
|
+
root: cn("w-fit", defaultClassNames.root),
|
|
46
|
+
months: cn(
|
|
47
|
+
"relative flex flex-col gap-4 md:flex-row",
|
|
48
|
+
defaultClassNames.months
|
|
49
|
+
),
|
|
50
|
+
month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
|
|
51
|
+
nav: cn(
|
|
52
|
+
"absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
|
|
53
|
+
defaultClassNames.nav
|
|
54
|
+
),
|
|
55
|
+
button_previous: cn(
|
|
56
|
+
buttonVariants({ variant: buttonVariant }),
|
|
57
|
+
"size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
|
|
58
|
+
defaultClassNames.button_previous
|
|
59
|
+
),
|
|
60
|
+
button_next: cn(
|
|
61
|
+
buttonVariants({ variant: buttonVariant }),
|
|
62
|
+
"size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
|
|
63
|
+
defaultClassNames.button_next
|
|
64
|
+
),
|
|
65
|
+
month_caption: cn(
|
|
66
|
+
"flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",
|
|
67
|
+
defaultClassNames.month_caption
|
|
68
|
+
),
|
|
69
|
+
dropdowns: cn(
|
|
70
|
+
"flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium",
|
|
71
|
+
defaultClassNames.dropdowns
|
|
72
|
+
),
|
|
73
|
+
dropdown_root: cn(
|
|
74
|
+
"relative rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-[3px] has-focus:ring-ring/50",
|
|
75
|
+
defaultClassNames.dropdown_root
|
|
76
|
+
),
|
|
77
|
+
dropdown: cn(
|
|
78
|
+
"absolute inset-0 bg-popover opacity-0",
|
|
79
|
+
defaultClassNames.dropdown
|
|
80
|
+
),
|
|
81
|
+
caption_label: cn(
|
|
82
|
+
"font-medium select-none",
|
|
83
|
+
captionLayout === "label" ? "text-sm" : "flex h-8 items-center gap-1 rounded-md pr-1 pl-2 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground",
|
|
84
|
+
defaultClassNames.caption_label
|
|
85
|
+
),
|
|
86
|
+
table: "w-full border-collapse",
|
|
87
|
+
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
88
|
+
weekday: cn(
|
|
89
|
+
"flex-1 rounded-md text-[0.8rem] font-normal text-muted-foreground select-none",
|
|
90
|
+
defaultClassNames.weekday
|
|
91
|
+
),
|
|
92
|
+
week: cn("mt-2 flex w-full", defaultClassNames.week),
|
|
93
|
+
week_number_header: cn(
|
|
94
|
+
"w-(--cell-size) select-none",
|
|
95
|
+
defaultClassNames.week_number_header
|
|
96
|
+
),
|
|
97
|
+
week_number: cn(
|
|
98
|
+
"text-[0.8rem] text-muted-foreground select-none",
|
|
99
|
+
defaultClassNames.week_number
|
|
100
|
+
),
|
|
101
|
+
day: cn(
|
|
102
|
+
"group/day relative aspect-square h-full w-full p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-md",
|
|
103
|
+
props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md" : "[&:first-child[data-selected=true]_button]:rounded-l-md",
|
|
104
|
+
defaultClassNames.day
|
|
105
|
+
),
|
|
106
|
+
range_start: cn(
|
|
107
|
+
"rounded-l-md bg-accent",
|
|
108
|
+
defaultClassNames.range_start
|
|
109
|
+
),
|
|
110
|
+
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
111
|
+
range_end: cn("rounded-r-md bg-accent", defaultClassNames.range_end),
|
|
112
|
+
today: cn(
|
|
113
|
+
"rounded-md bg-accent text-accent-foreground data-[selected=true]:rounded-none",
|
|
114
|
+
defaultClassNames.today
|
|
115
|
+
),
|
|
116
|
+
outside: cn(
|
|
117
|
+
"text-muted-foreground aria-selected:text-muted-foreground",
|
|
118
|
+
defaultClassNames.outside
|
|
119
|
+
),
|
|
120
|
+
disabled: cn(
|
|
121
|
+
"text-muted-foreground opacity-50",
|
|
122
|
+
defaultClassNames.disabled
|
|
123
|
+
),
|
|
124
|
+
hidden: cn("invisible", defaultClassNames.hidden),
|
|
125
|
+
...classNames
|
|
126
|
+
},
|
|
127
|
+
components: {
|
|
128
|
+
Root: ({ className: className2, rootRef, ...props2 }) => {
|
|
129
|
+
return /* @__PURE__ */ jsx(
|
|
130
|
+
"div",
|
|
131
|
+
{
|
|
132
|
+
"data-slot": "calendar",
|
|
133
|
+
ref: rootRef,
|
|
134
|
+
className: cn(className2),
|
|
135
|
+
...props2
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
},
|
|
139
|
+
Chevron: ({ className: className2, orientation, ...props2 }) => {
|
|
140
|
+
if (orientation === "left") {
|
|
141
|
+
return /* @__PURE__ */ jsx(
|
|
142
|
+
CaretLeftIcon,
|
|
143
|
+
{
|
|
144
|
+
weight: sf.iconWeight,
|
|
145
|
+
className: cn("size-4", className2),
|
|
146
|
+
...props2
|
|
147
|
+
}
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
if (orientation === "right") {
|
|
151
|
+
return /* @__PURE__ */ jsx(
|
|
152
|
+
CaretRightIcon,
|
|
153
|
+
{
|
|
154
|
+
weight: sf.iconWeight,
|
|
155
|
+
className: cn("size-4", className2),
|
|
156
|
+
...props2
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
return /* @__PURE__ */ jsx(
|
|
161
|
+
CaretDownIcon,
|
|
162
|
+
{
|
|
163
|
+
weight: sf.iconWeight,
|
|
164
|
+
className: cn("size-4", className2),
|
|
165
|
+
...props2
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
},
|
|
169
|
+
DayButton: CalendarDayButton,
|
|
170
|
+
WeekNumber: ({ children, ...props2 }) => {
|
|
171
|
+
return /* @__PURE__ */ jsx("td", { ...props2, children: /* @__PURE__ */ jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children }) });
|
|
172
|
+
},
|
|
173
|
+
...components
|
|
174
|
+
},
|
|
175
|
+
...props
|
|
176
|
+
}
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
function CalendarDayButton({
|
|
180
|
+
className,
|
|
181
|
+
day,
|
|
182
|
+
modifiers,
|
|
183
|
+
...props
|
|
184
|
+
}) {
|
|
185
|
+
const defaultClassNames = getDefaultClassNames();
|
|
186
|
+
const ref = React.useRef(null);
|
|
187
|
+
React.useEffect(() => {
|
|
188
|
+
if (modifiers.focused) ref.current?.focus();
|
|
189
|
+
}, [modifiers.focused]);
|
|
190
|
+
return /* @__PURE__ */ jsx(
|
|
191
|
+
Button,
|
|
192
|
+
{
|
|
193
|
+
ref,
|
|
194
|
+
variant: "ghost",
|
|
195
|
+
size: "icon",
|
|
196
|
+
"data-day": day.date.toLocaleDateString(),
|
|
197
|
+
"data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
|
|
198
|
+
"data-range-start": modifiers.range_start,
|
|
199
|
+
"data-range-end": modifiers.range_end,
|
|
200
|
+
"data-range-middle": modifiers.range_middle,
|
|
201
|
+
className: cn(
|
|
202
|
+
"flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-accent-foreground [&>span]:text-xs [&>span]:opacity-70",
|
|
203
|
+
defaultClassNames.day,
|
|
204
|
+
className
|
|
205
|
+
),
|
|
206
|
+
...props
|
|
207
|
+
}
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export { Calendar, CalendarDayButton };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
4
|
-
import {
|
|
4
|
+
import { d as SaasflareComponentProps } from './use-saasflare-props-BrjMhU0U.js';
|
|
5
5
|
|
|
6
6
|
declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
7
7
|
declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
|
|
@@ -16,7 +16,7 @@ interface DialogContentProps extends Omit<React.ComponentProps<typeof DialogPrim
|
|
|
16
16
|
* @component
|
|
17
17
|
* @layer core
|
|
18
18
|
*/
|
|
19
|
-
declare function DialogContent({ className, children, surface, radius, animated, ...props }: DialogContentProps): react_jsx_runtime.JSX.Element;
|
|
19
|
+
declare function DialogContent({ className, children, surface, radius, animated, iconWeight, ...props }: DialogContentProps): react_jsx_runtime.JSX.Element;
|
|
20
20
|
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
21
21
|
declare function DialogFooter({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
22
22
|
declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): react_jsx_runtime.JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
4
|
-
import {
|
|
4
|
+
import { d as SaasflareComponentProps } from './use-saasflare-props-BrjMhU0U.mjs';
|
|
5
5
|
|
|
6
6
|
declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
7
7
|
declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
|
|
@@ -16,7 +16,7 @@ interface DialogContentProps extends Omit<React.ComponentProps<typeof DialogPrim
|
|
|
16
16
|
* @component
|
|
17
17
|
* @layer core
|
|
18
18
|
*/
|
|
19
|
-
declare function DialogContent({ className, children, surface, radius, animated, ...props }: DialogContentProps): react_jsx_runtime.JSX.Element;
|
|
19
|
+
declare function DialogContent({ className, children, surface, radius, animated, iconWeight, ...props }: DialogContentProps): react_jsx_runtime.JSX.Element;
|
|
20
20
|
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
21
21
|
declare function DialogFooter({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
|
|
22
22
|
declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): react_jsx_runtime.JSX.Element;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { DayPicker, DayButton } from 'react-day-picker';
|
|
4
|
-
import {
|
|
5
|
-
import { B as Button } from '../button-
|
|
4
|
+
import { d as SaasflareComponentProps } from '../use-saasflare-props-BrjMhU0U.mjs';
|
|
5
|
+
import { B as Button } from '../button-BA7OcXqy.mjs';
|
|
6
6
|
import 'class-variance-authority/types';
|
|
7
7
|
import 'class-variance-authority';
|
|
8
8
|
|
|
9
9
|
type CalendarProps = React.ComponentProps<typeof DayPicker> & SaasflareComponentProps & {
|
|
10
10
|
buttonVariant?: React.ComponentProps<typeof Button>["variant"];
|
|
11
11
|
};
|
|
12
|
-
declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, surface, radius, animated, ...props }: CalendarProps): react_jsx_runtime.JSX.Element;
|
|
12
|
+
declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, surface, radius, animated, iconWeight, ...props }: CalendarProps): react_jsx_runtime.JSX.Element;
|
|
13
13
|
declare function CalendarDayButton({ className, day, modifiers, ...props }: React.ComponentProps<typeof DayButton>): react_jsx_runtime.JSX.Element;
|
|
14
14
|
|
|
15
15
|
export { Calendar, CalendarDayButton };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { DayPicker, DayButton } from 'react-day-picker';
|
|
4
|
-
import {
|
|
5
|
-
import { B as Button } from '../button-
|
|
4
|
+
import { d as SaasflareComponentProps } from '../use-saasflare-props-BrjMhU0U.js';
|
|
5
|
+
import { B as Button } from '../button-Bfg2Tnvx.js';
|
|
6
6
|
import 'class-variance-authority/types';
|
|
7
7
|
import 'class-variance-authority';
|
|
8
8
|
|
|
9
9
|
type CalendarProps = React.ComponentProps<typeof DayPicker> & SaasflareComponentProps & {
|
|
10
10
|
buttonVariant?: React.ComponentProps<typeof Button>["variant"];
|
|
11
11
|
};
|
|
12
|
-
declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, surface, radius, animated, ...props }: CalendarProps): react_jsx_runtime.JSX.Element;
|
|
12
|
+
declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, formatters, components, surface, radius, animated, iconWeight, ...props }: CalendarProps): react_jsx_runtime.JSX.Element;
|
|
13
13
|
declare function CalendarDayButton({ className, day, modifiers, ...props }: React.ComponentProps<typeof DayButton>): react_jsx_runtime.JSX.Element;
|
|
14
14
|
|
|
15
15
|
export { Calendar, CalendarDayButton };
|