@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.
Files changed (56) hide show
  1. package/README.md +68 -2
  2. package/dist/{button-0Bdl7Nqm.d.ts → button-BA7OcXqy.d.mts} +12 -17
  3. package/dist/{button-Brb4BhPO.d.mts → button-Bfg2Tnvx.d.ts} +12 -17
  4. package/dist/{chunk-D5LKWKG7.js → chunk-2GOPD64T.js} +117 -89
  5. package/dist/{chunk-WPOOC2FX.mjs → chunk-2ONA6OMO.mjs} +33 -44
  6. package/dist/{chunk-RW2S3KNB.mjs → chunk-5C65JNGY.mjs} +7 -6
  7. package/dist/{chunk-DNLCSV5M.js → chunk-7UD3SGPP.js} +32 -43
  8. package/dist/chunk-GI6VN7XU.mjs +2143 -0
  9. package/dist/{chunk-FT66KYRN.js → chunk-ITALEYDI.js} +2 -2
  10. package/dist/{chunk-4BOMMZEY.js → chunk-JC7EIEGI.js} +14 -13
  11. package/dist/chunk-N65HIOBD.js +234 -0
  12. package/dist/{chunk-EJHYM2HP.mjs → chunk-OZAWULTM.mjs} +1 -1
  13. package/dist/chunk-R3AVBLJ3.js +2207 -0
  14. package/dist/{chunk-WRONFPRI.mjs → chunk-RMQBB72G.mjs} +118 -91
  15. package/dist/chunk-XNDTCYSO.mjs +211 -0
  16. package/dist/{dialog-BmY55WSX.d.ts → dialog-CZRwrqDa.d.ts} +2 -2
  17. package/dist/{dialog-CcaHMAsS.d.mts → dialog-Cr0becOL.d.mts} +2 -2
  18. package/dist/entries/calendar.d.mts +3 -3
  19. package/dist/entries/calendar.d.ts +3 -3
  20. package/dist/entries/calendar.js +13 -214
  21. package/dist/entries/calendar.mjs +5 -196
  22. package/dist/entries/carousel.d.mts +3 -3
  23. package/dist/entries/carousel.d.ts +3 -3
  24. package/dist/entries/carousel.js +17 -14
  25. package/dist/entries/carousel.mjs +10 -7
  26. package/dist/entries/chart.d.mts +1 -1
  27. package/dist/entries/chart.d.ts +1 -1
  28. package/dist/entries/chart.js +11 -11
  29. package/dist/entries/chart.mjs +1 -1
  30. package/dist/entries/command.d.mts +3 -3
  31. package/dist/entries/command.d.ts +3 -3
  32. package/dist/entries/command.js +21 -19
  33. package/dist/entries/command.mjs +8 -6
  34. package/dist/entries/drawer.d.mts +1 -1
  35. package/dist/entries/drawer.d.ts +1 -1
  36. package/dist/entries/drawer.js +9 -9
  37. package/dist/entries/drawer.mjs +2 -2
  38. package/dist/entries/input-otp.d.mts +2 -2
  39. package/dist/entries/input-otp.d.ts +2 -2
  40. package/dist/entries/input-otp.js +10 -8
  41. package/dist/entries/input-otp.mjs +6 -4
  42. package/dist/entries/resizable.d.mts +3 -2
  43. package/dist/entries/resizable.d.ts +3 -2
  44. package/dist/entries/resizable.js +8 -6
  45. package/dist/entries/resizable.mjs +6 -4
  46. package/dist/index.d.mts +974 -31
  47. package/dist/index.d.ts +974 -31
  48. package/dist/index.js +2994 -556
  49. package/dist/index.mjs +2488 -201
  50. package/dist/{use-saasflare-props-NrM2Glmp.d.ts → use-saasflare-props-BrjMhU0U.d.mts} +53 -4
  51. package/dist/{use-saasflare-props-NrM2Glmp.d.mts → use-saasflare-props-BrjMhU0U.d.ts} +53 -4
  52. package/package.json +4 -3
  53. package/styles/aurora.css +47 -0
  54. package/styles/palettes.css +487 -3
  55. package/styles/surfaces.css +89 -10
  56. package/styles/theme.css +41 -19
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkD5LKWKG7_js = require('./chunk-D5LKWKG7.js');
3
+ var chunk2GOPD64T_js = require('./chunk-2GOPD64T.js');
4
4
 
5
5
  // src/components/ui/motion-config.ts
6
6
  var spring = { type: "spring", stiffness: 400, damping: 25 };
@@ -13,7 +13,7 @@ var scaleIn = { initial: { opacity: 0, scale: 0.95 }, animate: { opacity: 1, sca
13
13
  var slideUp = { initial: { opacity: 0, y: 8 }, animate: { opacity: 1, y: 0 } };
14
14
  var slideDown = { initial: { opacity: 0, y: -8 }, animate: { opacity: 1, y: 0 } };
15
15
  function useSaasflareMotion(animated, base = spring, ...extraDisablers) {
16
- const reduced = chunkD5LKWKG7_js.useReducedMotion();
16
+ const reduced = chunk2GOPD64T_js.useReducedMotion();
17
17
  const disabled = !animated || reduced || extraDisablers.some(Boolean);
18
18
  return { transition: disabled ? noMotion : base, disabled };
19
19
  }
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkFT66KYRN_js = require('./chunk-FT66KYRN.js');
5
- var chunkD5LKWKG7_js = require('./chunk-D5LKWKG7.js');
4
+ var chunkITALEYDI_js = require('./chunk-ITALEYDI.js');
5
+ var chunkR3AVBLJ3_js = require('./chunk-R3AVBLJ3.js');
6
+ var chunk2GOPD64T_js = require('./chunk-2GOPD64T.js');
6
7
  var react = require('motion/react');
7
8
  var DialogPrimitive = require('@radix-ui/react-dialog');
8
- var lucideReact = require('lucide-react');
9
9
  var jsxRuntime = require('react/jsx-runtime');
10
10
 
11
11
  function _interopNamespace(e) {
@@ -56,7 +56,7 @@ function DialogOverlay({
56
56
  DialogPrimitive__namespace.Overlay,
57
57
  {
58
58
  "data-slot": "dialog-overlay",
59
- className: chunkD5LKWKG7_js.cn(
59
+ className: chunk2GOPD64T_js.cn(
60
60
  "fixed inset-0 z-50 bg-black/50 backdrop-blur-[2px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
61
61
  className
62
62
  ),
@@ -70,10 +70,11 @@ function DialogContent({
70
70
  surface,
71
71
  radius,
72
72
  animated,
73
+ iconWeight,
73
74
  ...props
74
75
  }) {
75
- const sf = chunkD5LKWKG7_js.useSaasflareProps({ surface, radius, animated });
76
- const motion = chunkFT66KYRN_js.useSaasflareMotion(sf.animated, chunkFT66KYRN_js.springBouncy);
76
+ const sf = chunk2GOPD64T_js.useSaasflareProps({ surface, radius, animated, iconWeight });
77
+ const motion = chunkITALEYDI_js.useSaasflareMotion(sf.animated, chunkITALEYDI_js.springBouncy);
77
78
  return /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { children: [
78
79
  /* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
79
80
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -92,14 +93,14 @@ function DialogContent({
92
93
  animate: { opacity: 1, scale: 1, y: 0 },
93
94
  exit: motion.disabled ? { opacity: 0 } : { opacity: 0, scale: 0.95, y: 10 },
94
95
  transition: motion.transition,
95
- className: chunkD5LKWKG7_js.cn(
96
- "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 bg-background p-6 shadow-lg sm:max-w-lg",
96
+ className: chunk2GOPD64T_js.cn(
97
+ "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",
97
98
  className
98
99
  ),
99
100
  children: [
100
101
  children,
101
102
  /* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive__namespace.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: [
102
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, {}),
103
+ /* @__PURE__ */ jsxRuntime.jsx(chunkR3AVBLJ3_js.XIcon, { weight: sf.iconWeight }),
103
104
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
104
105
  ] })
105
106
  ]
@@ -114,7 +115,7 @@ function DialogHeader({ className, ...props }) {
114
115
  "div",
115
116
  {
116
117
  "data-slot": "dialog-header",
117
- className: chunkD5LKWKG7_js.cn("flex flex-col gap-2 text-center sm:text-left", className),
118
+ className: chunk2GOPD64T_js.cn("flex flex-col gap-2 text-center sm:text-left", className),
118
119
  ...props
119
120
  }
120
121
  );
@@ -124,7 +125,7 @@ function DialogFooter({ className, ...props }) {
124
125
  "div",
125
126
  {
126
127
  "data-slot": "dialog-footer",
127
- className: chunkD5LKWKG7_js.cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
128
+ className: chunk2GOPD64T_js.cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
128
129
  ...props
129
130
  }
130
131
  );
@@ -137,7 +138,7 @@ function DialogTitle({
137
138
  DialogPrimitive__namespace.Title,
138
139
  {
139
140
  "data-slot": "dialog-title",
140
- className: chunkD5LKWKG7_js.cn("text-lg leading-none font-semibold", className),
141
+ className: chunk2GOPD64T_js.cn("text-lg leading-none font-semibold", className),
141
142
  ...props
142
143
  }
143
144
  );
@@ -150,7 +151,7 @@ function DialogDescription({
150
151
  DialogPrimitive__namespace.Description,
151
152
  {
152
153
  "data-slot": "dialog-description",
153
- className: chunkD5LKWKG7_js.cn("text-sm text-muted-foreground", className),
154
+ className: chunk2GOPD64T_js.cn("text-sm text-muted-foreground", className),
154
155
  ...props
155
156
  }
156
157
  );
@@ -0,0 +1,234 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ var chunk7UD3SGPP_js = require('./chunk-7UD3SGPP.js');
5
+ var chunkR3AVBLJ3_js = require('./chunk-R3AVBLJ3.js');
6
+ var chunk2GOPD64T_js = require('./chunk-2GOPD64T.js');
7
+ var React = require('react');
8
+ var reactDayPicker = require('react-day-picker');
9
+ var jsxRuntime = require('react/jsx-runtime');
10
+
11
+ function _interopNamespace(e) {
12
+ if (e && e.__esModule) return e;
13
+ var n = Object.create(null);
14
+ if (e) {
15
+ Object.keys(e).forEach(function (k) {
16
+ if (k !== 'default') {
17
+ var d = Object.getOwnPropertyDescriptor(e, k);
18
+ Object.defineProperty(n, k, d.get ? d : {
19
+ enumerable: true,
20
+ get: function () { return e[k]; }
21
+ });
22
+ }
23
+ });
24
+ }
25
+ n.default = e;
26
+ return Object.freeze(n);
27
+ }
28
+
29
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
30
+
31
+ function Calendar({
32
+ className,
33
+ classNames,
34
+ showOutsideDays = true,
35
+ captionLayout = "label",
36
+ buttonVariant = "ghost",
37
+ formatters,
38
+ components,
39
+ surface,
40
+ radius,
41
+ animated,
42
+ iconWeight,
43
+ ...props
44
+ }) {
45
+ const sf = chunk2GOPD64T_js.useSaasflareProps({ surface, radius, animated, iconWeight });
46
+ const defaultClassNames = reactDayPicker.getDefaultClassNames();
47
+ return /* @__PURE__ */ jsxRuntime.jsx(
48
+ reactDayPicker.DayPicker,
49
+ {
50
+ "data-slot": "calendar",
51
+ "data-surface": sf.surface,
52
+ "data-radius": sf.radius,
53
+ "data-animated": String(sf.animated),
54
+ showOutsideDays,
55
+ className: chunk2GOPD64T_js.cn(
56
+ "group/calendar bg-background p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
57
+ String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
58
+ String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
59
+ className
60
+ ),
61
+ captionLayout,
62
+ formatters: {
63
+ formatMonthDropdown: (date) => date.toLocaleString("default", { month: "short" }),
64
+ ...formatters
65
+ },
66
+ classNames: {
67
+ root: chunk2GOPD64T_js.cn("w-fit", defaultClassNames.root),
68
+ months: chunk2GOPD64T_js.cn(
69
+ "relative flex flex-col gap-4 md:flex-row",
70
+ defaultClassNames.months
71
+ ),
72
+ month: chunk2GOPD64T_js.cn("flex w-full flex-col gap-4", defaultClassNames.month),
73
+ nav: chunk2GOPD64T_js.cn(
74
+ "absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
75
+ defaultClassNames.nav
76
+ ),
77
+ button_previous: chunk2GOPD64T_js.cn(
78
+ chunk7UD3SGPP_js.buttonVariants({ variant: buttonVariant }),
79
+ "size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
80
+ defaultClassNames.button_previous
81
+ ),
82
+ button_next: chunk2GOPD64T_js.cn(
83
+ chunk7UD3SGPP_js.buttonVariants({ variant: buttonVariant }),
84
+ "size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
85
+ defaultClassNames.button_next
86
+ ),
87
+ month_caption: chunk2GOPD64T_js.cn(
88
+ "flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",
89
+ defaultClassNames.month_caption
90
+ ),
91
+ dropdowns: chunk2GOPD64T_js.cn(
92
+ "flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium",
93
+ defaultClassNames.dropdowns
94
+ ),
95
+ dropdown_root: chunk2GOPD64T_js.cn(
96
+ "relative rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-[3px] has-focus:ring-ring/50",
97
+ defaultClassNames.dropdown_root
98
+ ),
99
+ dropdown: chunk2GOPD64T_js.cn(
100
+ "absolute inset-0 bg-popover opacity-0",
101
+ defaultClassNames.dropdown
102
+ ),
103
+ caption_label: chunk2GOPD64T_js.cn(
104
+ "font-medium select-none",
105
+ 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",
106
+ defaultClassNames.caption_label
107
+ ),
108
+ table: "w-full border-collapse",
109
+ weekdays: chunk2GOPD64T_js.cn("flex", defaultClassNames.weekdays),
110
+ weekday: chunk2GOPD64T_js.cn(
111
+ "flex-1 rounded-md text-[0.8rem] font-normal text-muted-foreground select-none",
112
+ defaultClassNames.weekday
113
+ ),
114
+ week: chunk2GOPD64T_js.cn("mt-2 flex w-full", defaultClassNames.week),
115
+ week_number_header: chunk2GOPD64T_js.cn(
116
+ "w-(--cell-size) select-none",
117
+ defaultClassNames.week_number_header
118
+ ),
119
+ week_number: chunk2GOPD64T_js.cn(
120
+ "text-[0.8rem] text-muted-foreground select-none",
121
+ defaultClassNames.week_number
122
+ ),
123
+ day: chunk2GOPD64T_js.cn(
124
+ "group/day relative aspect-square h-full w-full p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-md",
125
+ props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md" : "[&:first-child[data-selected=true]_button]:rounded-l-md",
126
+ defaultClassNames.day
127
+ ),
128
+ range_start: chunk2GOPD64T_js.cn(
129
+ "rounded-l-md bg-accent",
130
+ defaultClassNames.range_start
131
+ ),
132
+ range_middle: chunk2GOPD64T_js.cn("rounded-none", defaultClassNames.range_middle),
133
+ range_end: chunk2GOPD64T_js.cn("rounded-r-md bg-accent", defaultClassNames.range_end),
134
+ today: chunk2GOPD64T_js.cn(
135
+ "rounded-md bg-accent text-accent-foreground data-[selected=true]:rounded-none",
136
+ defaultClassNames.today
137
+ ),
138
+ outside: chunk2GOPD64T_js.cn(
139
+ "text-muted-foreground aria-selected:text-muted-foreground",
140
+ defaultClassNames.outside
141
+ ),
142
+ disabled: chunk2GOPD64T_js.cn(
143
+ "text-muted-foreground opacity-50",
144
+ defaultClassNames.disabled
145
+ ),
146
+ hidden: chunk2GOPD64T_js.cn("invisible", defaultClassNames.hidden),
147
+ ...classNames
148
+ },
149
+ components: {
150
+ Root: ({ className: className2, rootRef, ...props2 }) => {
151
+ return /* @__PURE__ */ jsxRuntime.jsx(
152
+ "div",
153
+ {
154
+ "data-slot": "calendar",
155
+ ref: rootRef,
156
+ className: chunk2GOPD64T_js.cn(className2),
157
+ ...props2
158
+ }
159
+ );
160
+ },
161
+ Chevron: ({ className: className2, orientation, ...props2 }) => {
162
+ if (orientation === "left") {
163
+ return /* @__PURE__ */ jsxRuntime.jsx(
164
+ chunkR3AVBLJ3_js.CaretLeftIcon,
165
+ {
166
+ weight: sf.iconWeight,
167
+ className: chunk2GOPD64T_js.cn("size-4", className2),
168
+ ...props2
169
+ }
170
+ );
171
+ }
172
+ if (orientation === "right") {
173
+ return /* @__PURE__ */ jsxRuntime.jsx(
174
+ chunkR3AVBLJ3_js.CaretRightIcon,
175
+ {
176
+ weight: sf.iconWeight,
177
+ className: chunk2GOPD64T_js.cn("size-4", className2),
178
+ ...props2
179
+ }
180
+ );
181
+ }
182
+ return /* @__PURE__ */ jsxRuntime.jsx(
183
+ chunkR3AVBLJ3_js.CaretDownIcon,
184
+ {
185
+ weight: sf.iconWeight,
186
+ className: chunk2GOPD64T_js.cn("size-4", className2),
187
+ ...props2
188
+ }
189
+ );
190
+ },
191
+ DayButton: CalendarDayButton,
192
+ WeekNumber: ({ children, ...props2 }) => {
193
+ return /* @__PURE__ */ jsxRuntime.jsx("td", { ...props2, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center", children }) });
194
+ },
195
+ ...components
196
+ },
197
+ ...props
198
+ }
199
+ );
200
+ }
201
+ function CalendarDayButton({
202
+ className,
203
+ day,
204
+ modifiers,
205
+ ...props
206
+ }) {
207
+ const defaultClassNames = reactDayPicker.getDefaultClassNames();
208
+ const ref = React__namespace.useRef(null);
209
+ React__namespace.useEffect(() => {
210
+ if (modifiers.focused) ref.current?.focus();
211
+ }, [modifiers.focused]);
212
+ return /* @__PURE__ */ jsxRuntime.jsx(
213
+ chunk7UD3SGPP_js.Button,
214
+ {
215
+ ref,
216
+ variant: "ghost",
217
+ size: "icon",
218
+ "data-day": day.date.toLocaleDateString(),
219
+ "data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
220
+ "data-range-start": modifiers.range_start,
221
+ "data-range-end": modifiers.range_end,
222
+ "data-range-middle": modifiers.range_middle,
223
+ className: chunk2GOPD64T_js.cn(
224
+ "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",
225
+ defaultClassNames.day,
226
+ className
227
+ ),
228
+ ...props
229
+ }
230
+ );
231
+ }
232
+
233
+ exports.Calendar = Calendar;
234
+ exports.CalendarDayButton = CalendarDayButton;
@@ -1,4 +1,4 @@
1
- import { useReducedMotion } from './chunk-WRONFPRI.mjs';
1
+ import { useReducedMotion } from './chunk-RMQBB72G.mjs';
2
2
 
3
3
  // src/components/ui/motion-config.ts
4
4
  var spring = { type: "spring", stiffness: 400, damping: 25 };