@saasflare/ui 3.1.2 → 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-56PMDC5F.mjs → chunk-2ONA6OMO.mjs} +29 -40
- package/dist/{chunk-RW2S3KNB.mjs → chunk-5C65JNGY.mjs} +7 -6
- package/dist/{chunk-NPNSPYTX.js → chunk-7UD3SGPP.js} +28 -39
- 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 +2992 -554
- package/dist/index.mjs +2486 -199
- package/dist/{use-saasflare-props-NrM2Glmp.d.mts → use-saasflare-props-BrjMhU0U.d.mts} +53 -4
- package/dist/{use-saasflare-props-NrM2Glmp.d.ts → use-saasflare-props-BrjMhU0U.d.ts} +53 -4
- package/package.json +4 -3
- package/styles/aurora.css +47 -0
- package/styles/palettes.css +483 -3
- package/styles/surfaces.css +89 -10
- package/styles/theme.css +11 -5
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useSaasflareMotion, springBouncy } from './chunk-
|
|
3
|
-
import {
|
|
2
|
+
import { useSaasflareMotion, springBouncy } from './chunk-OZAWULTM.mjs';
|
|
3
|
+
import { XIcon } from './chunk-GI6VN7XU.mjs';
|
|
4
|
+
import { cn, useSaasflareProps } from './chunk-RMQBB72G.mjs';
|
|
4
5
|
import { m } from 'motion/react';
|
|
5
6
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
6
|
-
import { XIcon } from 'lucide-react';
|
|
7
7
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
9
|
function Dialog({
|
|
@@ -48,9 +48,10 @@ function DialogContent({
|
|
|
48
48
|
surface,
|
|
49
49
|
radius,
|
|
50
50
|
animated,
|
|
51
|
+
iconWeight,
|
|
51
52
|
...props
|
|
52
53
|
}) {
|
|
53
|
-
const sf = useSaasflareProps({ surface, radius, animated });
|
|
54
|
+
const sf = useSaasflareProps({ surface, radius, animated, iconWeight });
|
|
54
55
|
const motion = useSaasflareMotion(sf.animated, springBouncy);
|
|
55
56
|
return /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
56
57
|
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
@@ -71,13 +72,13 @@ function DialogContent({
|
|
|
71
72
|
exit: motion.disabled ? { opacity: 0 } : { opacity: 0, scale: 0.95, y: 10 },
|
|
72
73
|
transition: motion.transition,
|
|
73
74
|
className: cn(
|
|
74
|
-
"fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border
|
|
75
|
+
"fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border surface-card p-6 sm:max-w-lg",
|
|
75
76
|
className
|
|
76
77
|
),
|
|
77
78
|
children: [
|
|
78
79
|
children,
|
|
79
80
|
/* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none cursor-pointer [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", children: [
|
|
80
|
-
/* @__PURE__ */ jsx(XIcon, {}),
|
|
81
|
+
/* @__PURE__ */ jsx(XIcon, { weight: sf.iconWeight }),
|
|
81
82
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
82
83
|
] })
|
|
83
84
|
]
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var lucideReact = require('lucide-react');
|
|
4
|
+
var chunkITALEYDI_js = require('./chunk-ITALEYDI.js');
|
|
5
|
+
var chunk2GOPD64T_js = require('./chunk-2GOPD64T.js');
|
|
7
6
|
var react = require('motion/react');
|
|
8
7
|
var classVarianceAuthority = require('class-variance-authority');
|
|
9
8
|
var Slot = require('@radix-ui/react-slot');
|
|
@@ -45,7 +44,8 @@ var buttonVariants = classVarianceAuthority.cva(
|
|
|
45
44
|
outline: "border border-[var(--intent-text)]/30 text-[var(--intent-text)] shadow-xs hover:bg-[var(--intent-text)]/10 dark:border-[var(--intent-text)]/40 dark:hover:bg-[var(--intent-text)]/15",
|
|
46
45
|
ghost: "text-[var(--intent-text)] hover:bg-[var(--intent-text)]/10 dark:hover:bg-[var(--intent-text)]/15",
|
|
47
46
|
link: "text-[var(--intent-text)] underline-offset-4 hover:underline",
|
|
48
|
-
glass: "bg-[var(--
|
|
47
|
+
glass: "bg-[var(--surface-bg)] text-[var(--intent-text)] border border-[var(--surface-border)] [backdrop-filter:var(--surface-backdrop)] [-webkit-backdrop-filter:var(--surface-backdrop)] shadow-[var(--surface-shadow)] hover:brightness-110 dark:hover:brightness-125",
|
|
48
|
+
clay: "bg-[var(--intent)] text-[var(--intent-fg)] shadow-[var(--surface-shadow)] hover:brightness-110 active:translate-y-px dark:hover:brightness-125",
|
|
49
49
|
shadow: "bg-[var(--intent)] text-[var(--intent-fg)] shadow-[var(--btn-shadow)] hover:shadow-[var(--btn-shadow-hover)] hover:brightness-110 dark:hover:brightness-125"
|
|
50
50
|
},
|
|
51
51
|
size: {
|
|
@@ -72,18 +72,18 @@ function Button({
|
|
|
72
72
|
size = "md",
|
|
73
73
|
intent: intentProp = "primary",
|
|
74
74
|
asChild = false,
|
|
75
|
-
loading = false,
|
|
76
75
|
fullWidth = false,
|
|
77
76
|
surface,
|
|
77
|
+
iconWeight,
|
|
78
78
|
radius,
|
|
79
79
|
animated,
|
|
80
80
|
disabled,
|
|
81
81
|
children,
|
|
82
82
|
...props
|
|
83
83
|
}) {
|
|
84
|
-
const sf =
|
|
85
|
-
const motion =
|
|
86
|
-
const effectiveVariant = variantProp ?? (sf.surface === "glass" ? "glass" : "solid");
|
|
84
|
+
const sf = chunk2GOPD64T_js.useSaasflareProps({ surface, radius, animated, iconWeight });
|
|
85
|
+
const motion = chunkITALEYDI_js.useSaasflareMotion(sf.animated, chunkITALEYDI_js.spring, disabled ?? false);
|
|
86
|
+
const effectiveVariant = variantProp ?? (sf.surface === "glass" ? "glass" : sf.surface === "clay" ? "clay" : "solid");
|
|
87
87
|
let resolvedVariant = effectiveVariant;
|
|
88
88
|
let resolvedIntent = intentProp;
|
|
89
89
|
const legacy = LEGACY_VARIANT_MAP[effectiveVariant];
|
|
@@ -93,56 +93,45 @@ function Button({
|
|
|
93
93
|
resolvedIntent = legacy.intent;
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
+
const dataAttrs = {
|
|
97
|
+
"data-slot": "button",
|
|
98
|
+
"data-variant": resolvedVariant,
|
|
99
|
+
"data-intent": resolvedIntent,
|
|
100
|
+
"data-size": size,
|
|
101
|
+
"data-surface": sf.surface,
|
|
102
|
+
"data-radius": sf.radius,
|
|
103
|
+
"data-animated": String(sf.animated)
|
|
104
|
+
};
|
|
105
|
+
const classes = chunk2GOPD64T_js.cn(
|
|
106
|
+
buttonVariants({ variant: resolvedVariant, size }),
|
|
107
|
+
fullWidth && "w-full",
|
|
108
|
+
className
|
|
109
|
+
);
|
|
96
110
|
if (asChild) {
|
|
97
111
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
98
112
|
MotionSlot,
|
|
99
113
|
{
|
|
100
114
|
...props,
|
|
101
|
-
|
|
102
|
-
"data-variant": resolvedVariant,
|
|
103
|
-
"data-intent": resolvedIntent,
|
|
104
|
-
"data-size": size,
|
|
105
|
-
"data-surface": sf.surface,
|
|
106
|
-
"data-radius": sf.radius,
|
|
107
|
-
"data-animated": String(sf.animated),
|
|
115
|
+
...dataAttrs,
|
|
108
116
|
whileHover: motion.disabled ? void 0 : { scale: 1.02 },
|
|
109
117
|
whileTap: motion.disabled ? void 0 : { scale: 0.97 },
|
|
110
118
|
transition: motion.transition,
|
|
111
|
-
className:
|
|
112
|
-
buttonVariants({ variant: resolvedVariant, size }),
|
|
113
|
-
fullWidth && "w-full",
|
|
114
|
-
className
|
|
115
|
-
),
|
|
119
|
+
className: classes,
|
|
116
120
|
children
|
|
117
121
|
}
|
|
118
122
|
);
|
|
119
123
|
}
|
|
120
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
124
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
121
125
|
react.m.button,
|
|
122
126
|
{
|
|
123
|
-
|
|
124
|
-
"data-variant": resolvedVariant,
|
|
125
|
-
"data-intent": resolvedIntent,
|
|
126
|
-
"data-size": size,
|
|
127
|
-
"data-surface": sf.surface,
|
|
128
|
-
"data-radius": sf.radius,
|
|
129
|
-
"data-animated": String(sf.animated),
|
|
127
|
+
...dataAttrs,
|
|
130
128
|
whileHover: motion.disabled ? void 0 : { scale: 1.02 },
|
|
131
129
|
whileTap: motion.disabled ? void 0 : { scale: 0.97 },
|
|
132
130
|
transition: motion.transition,
|
|
133
|
-
className:
|
|
134
|
-
buttonVariants({ variant: resolvedVariant, size }),
|
|
135
|
-
fullWidth && "w-full",
|
|
136
|
-
className
|
|
137
|
-
),
|
|
131
|
+
className: classes,
|
|
138
132
|
disabled,
|
|
139
|
-
"aria-busy": loading || void 0,
|
|
140
|
-
"aria-disabled": disabled || void 0,
|
|
141
133
|
...props,
|
|
142
|
-
children
|
|
143
|
-
loading && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2Icon, { className: "animate-spin", "aria-hidden": "true" }),
|
|
144
|
-
children
|
|
145
|
-
]
|
|
134
|
+
children
|
|
146
135
|
}
|
|
147
136
|
);
|
|
148
137
|
}
|