@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,9 +1,9 @@
1
1
  "use client";
2
- import { useSaasflareMotion, springBouncy } from './chunk-EJHYM2HP.mjs';
3
- import { cn, useSaasflareProps } from './chunk-WRONFPRI.mjs';
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 bg-background p-6 shadow-lg sm:max-w-lg",
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 chunkFT66KYRN_js = require('./chunk-FT66KYRN.js');
5
- var chunkD5LKWKG7_js = require('./chunk-D5LKWKG7.js');
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');
@@ -41,11 +40,12 @@ var buttonVariants = classVarianceAuthority.cva(
41
40
  variants: {
42
41
  variant: {
43
42
  solid: "bg-[var(--intent)] text-[var(--intent-fg)] shadow-xs hover:brightness-110 dark:hover:brightness-125",
44
- soft: "bg-[var(--intent)]/15 text-[var(--intent)] hover:bg-[var(--intent)]/25 dark:bg-[var(--intent)]/20 dark:hover:bg-[var(--intent)]/30",
45
- outline: "border border-[var(--intent)]/30 text-[var(--intent)] shadow-xs hover:bg-[var(--intent)]/10 dark:border-[var(--intent)]/40 dark:hover:bg-[var(--intent)]/15",
46
- ghost: "text-[var(--intent)] hover:bg-[var(--intent)]/10 dark:hover:bg-[var(--intent)]/15",
47
- link: "text-[var(--intent)] underline-offset-4 hover:underline",
48
- glass: "bg-[var(--glass-bg)] text-[var(--intent)] border border-[var(--glass-border)] backdrop-blur-lg shadow-[var(--glass-shadow)] hover:bg-[var(--glass-bg-hover)] hover:border-[var(--glass-border-hover)]",
43
+ soft: "bg-[var(--intent)]/15 text-[var(--intent-text)] hover:bg-[var(--intent)]/25 dark:bg-[var(--intent)]/20 dark:hover:bg-[var(--intent)]/30",
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",
45
+ ghost: "text-[var(--intent-text)] hover:bg-[var(--intent-text)]/10 dark:hover:bg-[var(--intent-text)]/15",
46
+ link: "text-[var(--intent-text)] underline-offset-4 hover:underline",
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 = chunkD5LKWKG7_js.useSaasflareProps({ surface, radius, animated });
85
- const motion = chunkFT66KYRN_js.useSaasflareMotion(sf.animated, chunkFT66KYRN_js.spring, disabled ?? false, loading);
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
- "data-slot": "button",
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: chunkD5LKWKG7_js.cn(
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.jsxs(
124
+ return /* @__PURE__ */ jsxRuntime.jsx(
121
125
  react.m.button,
122
126
  {
123
- "data-slot": "button",
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: chunkD5LKWKG7_js.cn(
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
  }