@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,3 +1,5 @@
1
+ import * as React from 'react';
2
+
1
3
  /**
2
4
  * @fileoverview Theme-related types and constants consumed by SaasflareProvider,
3
5
  * SaasflareShell, and CustomPaletteInjector.
@@ -9,7 +11,7 @@
9
11
  * and paint it with `oklch(var(--primary-l) var(--primary-c) var(--primary-h))`.
10
12
  * Do NOT add a hex `color` field here; it will drift from palettes.css.
11
13
  */
12
- /** All 16 available color palette ids and display names. */
14
+ /** All available color palette ids and display names. */
13
15
  declare const PALETTES: readonly [{
14
16
  readonly id: "ocean";
15
17
  readonly name: "Ocean";
@@ -64,6 +66,12 @@ declare const PALETTES: readonly [{
64
66
  }, {
65
67
  readonly id: "ruby";
66
68
  readonly name: "Ruby";
69
+ }, {
70
+ readonly id: "colorful";
71
+ readonly name: "Colorful";
72
+ }, {
73
+ readonly id: "craivo";
74
+ readonly name: "Craivo";
67
75
  }];
68
76
  /** Union of all preset color palette IDs. */
69
77
  type PaletteId = (typeof PALETTES)[number]["id"];
@@ -75,7 +83,7 @@ type PaletteId = (typeof PALETTES)[number]["id"];
75
83
  * app's globals.css are accepted without a type patch, while preset
76
84
  * ids keep their autocomplete.
77
85
  */
78
- type StyleVariant = "flat" | "glass" | (string & {});
86
+ type StyleVariant = "flat" | "glass" | "clay" | (string & {});
79
87
  /** All available built-in surface style variants. */
80
88
  declare const STYLES: readonly [{
81
89
  readonly id: "flat";
@@ -83,6 +91,9 @@ declare const STYLES: readonly [{
83
91
  }, {
84
92
  readonly id: "glass";
85
93
  readonly name: "Glass";
94
+ }, {
95
+ readonly id: "clay";
96
+ readonly name: "Clay";
86
97
  }];
87
98
  /**
88
99
  * Radius preset — orthogonal to {@link Surface} (geometry vs. material).
@@ -165,7 +176,7 @@ type Palette = PaletteId | (string & {}) | CustomPalette;
165
176
  * Accepted values for the `surface` prop.
166
177
  *
167
178
  * - omit (undefined) → defers to persisted user preference, then "flat" baseline
168
- * - StyleVariant → "flat" | "glass" | app-registered custom surface
179
+ * - StyleVariant → "flat" | "glass" | "clay" | app-registered custom surface
169
180
  */
170
181
  type Surface = StyleVariant;
171
182
  /**
@@ -176,6 +187,34 @@ type Surface = StyleVariant;
176
187
  */
177
188
  type RadiusProp = Radius;
178
189
 
190
+ /**
191
+ * @fileoverview Base SVG icon primitive for Phosphor-derived icons.
192
+ * Provides shared sizing, color, and weight handling for every icon component
193
+ * in this directory. The actual path data is supplied by each icon via the
194
+ * `weights` map.
195
+ * @module @saasflare/ui/components/ui/phosphor/icon-base
196
+ */
197
+
198
+ /** Visual weight provided by Phosphor: thin stroke (regular), heavier stroke (bold), filled glyph, or duotone (filled silhouette + stroke). */
199
+ type IconWeight = "regular" | "bold" | "fill" | "duotone";
200
+ /**
201
+ * Public props accepted by every Phosphor icon component.
202
+ * Mirrors the shape of `@phosphor-icons/react` so usage is familiar.
203
+ */
204
+ interface PhosphorIconProps extends Omit<React.SVGAttributes<SVGSVGElement>, "weight"> {
205
+ /** Visual weight. Defaults to "regular". */
206
+ weight?: IconWeight;
207
+ /** Width and height. Defaults to "1em" so the icon scales with the parent's font-size or Tailwind size-* class. */
208
+ size?: string | number;
209
+ /** Stroke / fill color. Defaults to "currentColor" so the icon inherits text color. */
210
+ color?: string;
211
+ }
212
+ /** Internal props — adds the per-icon `weights` map. */
213
+ interface IconBaseProps extends PhosphorIconProps {
214
+ weights: Record<IconWeight, React.ReactNode>;
215
+ }
216
+ declare const IconBase: React.ForwardRefExoticComponent<IconBaseProps & React.RefAttributes<SVGSVGElement>>;
217
+
179
218
  /** Props that every Saasflare component accepts for theme integration. */
180
219
  interface SaasflareComponentProps {
181
220
  /** Surface style override. Omit to inherit from provider. */
@@ -184,6 +223,14 @@ interface SaasflareComponentProps {
184
223
  radius?: Radius;
185
224
  /** Animation override. Omit to inherit from provider. */
186
225
  animated?: boolean;
226
+ /**
227
+ * Icon weight override for any Phosphor icons rendered inside the component.
228
+ * Omit to inherit from provider (which defaults to "regular").
229
+ *
230
+ * Some components (e.g. Spinner) hardcode a weight that's part of their
231
+ * visual identity and intentionally ignore this prop.
232
+ */
233
+ iconWeight?: IconWeight;
187
234
  }
188
235
  /** Fully resolved theme values — no optionals, no undefined. */
189
236
  interface ResolvedSaasflareProps {
@@ -195,6 +242,8 @@ interface ResolvedSaasflareProps {
195
242
  animated: boolean;
196
243
  /** Active brand palette id (null = global.css baseline). */
197
244
  palette: string | null;
245
+ /** Active icon weight for component-rendered Phosphor icons. */
246
+ iconWeight: IconWeight;
198
247
  }
199
248
  /**
200
249
  * Resolves component-level overrides against the provider context.
@@ -205,4 +254,4 @@ interface ResolvedSaasflareProps {
205
254
  */
206
255
  declare function useSaasflareProps(props?: SaasflareComponentProps): ResolvedSaasflareProps;
207
256
 
208
- export { type CustomPalette as C, type Palette as P, type RadiusProp as R, type Surface as S, type StyleVariant as a, type Radius as b, type SaasflareComponentProps as c, PALETTES as d, type PaletteId as e, RADII as f, type ResolvedSaasflareProps as g, STYLES as h, useSaasflareProps as u };
257
+ export { type CustomPalette as C, type IconWeight as I, type PhosphorIconProps as P, type RadiusProp as R, type Surface as S, type Palette as a, type StyleVariant as b, type Radius as c, type SaasflareComponentProps as d, IconBase as e, PALETTES as f, type PaletteId as g, RADII as h, type ResolvedSaasflareProps as i, STYLES as j, useSaasflareProps as u };
@@ -1,3 +1,5 @@
1
+ import * as React from 'react';
2
+
1
3
  /**
2
4
  * @fileoverview Theme-related types and constants consumed by SaasflareProvider,
3
5
  * SaasflareShell, and CustomPaletteInjector.
@@ -9,7 +11,7 @@
9
11
  * and paint it with `oklch(var(--primary-l) var(--primary-c) var(--primary-h))`.
10
12
  * Do NOT add a hex `color` field here; it will drift from palettes.css.
11
13
  */
12
- /** All 16 available color palette ids and display names. */
14
+ /** All available color palette ids and display names. */
13
15
  declare const PALETTES: readonly [{
14
16
  readonly id: "ocean";
15
17
  readonly name: "Ocean";
@@ -64,6 +66,12 @@ declare const PALETTES: readonly [{
64
66
  }, {
65
67
  readonly id: "ruby";
66
68
  readonly name: "Ruby";
69
+ }, {
70
+ readonly id: "colorful";
71
+ readonly name: "Colorful";
72
+ }, {
73
+ readonly id: "craivo";
74
+ readonly name: "Craivo";
67
75
  }];
68
76
  /** Union of all preset color palette IDs. */
69
77
  type PaletteId = (typeof PALETTES)[number]["id"];
@@ -75,7 +83,7 @@ type PaletteId = (typeof PALETTES)[number]["id"];
75
83
  * app's globals.css are accepted without a type patch, while preset
76
84
  * ids keep their autocomplete.
77
85
  */
78
- type StyleVariant = "flat" | "glass" | (string & {});
86
+ type StyleVariant = "flat" | "glass" | "clay" | (string & {});
79
87
  /** All available built-in surface style variants. */
80
88
  declare const STYLES: readonly [{
81
89
  readonly id: "flat";
@@ -83,6 +91,9 @@ declare const STYLES: readonly [{
83
91
  }, {
84
92
  readonly id: "glass";
85
93
  readonly name: "Glass";
94
+ }, {
95
+ readonly id: "clay";
96
+ readonly name: "Clay";
86
97
  }];
87
98
  /**
88
99
  * Radius preset — orthogonal to {@link Surface} (geometry vs. material).
@@ -165,7 +176,7 @@ type Palette = PaletteId | (string & {}) | CustomPalette;
165
176
  * Accepted values for the `surface` prop.
166
177
  *
167
178
  * - omit (undefined) → defers to persisted user preference, then "flat" baseline
168
- * - StyleVariant → "flat" | "glass" | app-registered custom surface
179
+ * - StyleVariant → "flat" | "glass" | "clay" | app-registered custom surface
169
180
  */
170
181
  type Surface = StyleVariant;
171
182
  /**
@@ -176,6 +187,34 @@ type Surface = StyleVariant;
176
187
  */
177
188
  type RadiusProp = Radius;
178
189
 
190
+ /**
191
+ * @fileoverview Base SVG icon primitive for Phosphor-derived icons.
192
+ * Provides shared sizing, color, and weight handling for every icon component
193
+ * in this directory. The actual path data is supplied by each icon via the
194
+ * `weights` map.
195
+ * @module @saasflare/ui/components/ui/phosphor/icon-base
196
+ */
197
+
198
+ /** Visual weight provided by Phosphor: thin stroke (regular), heavier stroke (bold), filled glyph, or duotone (filled silhouette + stroke). */
199
+ type IconWeight = "regular" | "bold" | "fill" | "duotone";
200
+ /**
201
+ * Public props accepted by every Phosphor icon component.
202
+ * Mirrors the shape of `@phosphor-icons/react` so usage is familiar.
203
+ */
204
+ interface PhosphorIconProps extends Omit<React.SVGAttributes<SVGSVGElement>, "weight"> {
205
+ /** Visual weight. Defaults to "regular". */
206
+ weight?: IconWeight;
207
+ /** Width and height. Defaults to "1em" so the icon scales with the parent's font-size or Tailwind size-* class. */
208
+ size?: string | number;
209
+ /** Stroke / fill color. Defaults to "currentColor" so the icon inherits text color. */
210
+ color?: string;
211
+ }
212
+ /** Internal props — adds the per-icon `weights` map. */
213
+ interface IconBaseProps extends PhosphorIconProps {
214
+ weights: Record<IconWeight, React.ReactNode>;
215
+ }
216
+ declare const IconBase: React.ForwardRefExoticComponent<IconBaseProps & React.RefAttributes<SVGSVGElement>>;
217
+
179
218
  /** Props that every Saasflare component accepts for theme integration. */
180
219
  interface SaasflareComponentProps {
181
220
  /** Surface style override. Omit to inherit from provider. */
@@ -184,6 +223,14 @@ interface SaasflareComponentProps {
184
223
  radius?: Radius;
185
224
  /** Animation override. Omit to inherit from provider. */
186
225
  animated?: boolean;
226
+ /**
227
+ * Icon weight override for any Phosphor icons rendered inside the component.
228
+ * Omit to inherit from provider (which defaults to "regular").
229
+ *
230
+ * Some components (e.g. Spinner) hardcode a weight that's part of their
231
+ * visual identity and intentionally ignore this prop.
232
+ */
233
+ iconWeight?: IconWeight;
187
234
  }
188
235
  /** Fully resolved theme values — no optionals, no undefined. */
189
236
  interface ResolvedSaasflareProps {
@@ -195,6 +242,8 @@ interface ResolvedSaasflareProps {
195
242
  animated: boolean;
196
243
  /** Active brand palette id (null = global.css baseline). */
197
244
  palette: string | null;
245
+ /** Active icon weight for component-rendered Phosphor icons. */
246
+ iconWeight: IconWeight;
198
247
  }
199
248
  /**
200
249
  * Resolves component-level overrides against the provider context.
@@ -205,4 +254,4 @@ interface ResolvedSaasflareProps {
205
254
  */
206
255
  declare function useSaasflareProps(props?: SaasflareComponentProps): ResolvedSaasflareProps;
207
256
 
208
- export { type CustomPalette as C, type Palette as P, type RadiusProp as R, type Surface as S, type StyleVariant as a, type Radius as b, type SaasflareComponentProps as c, PALETTES as d, type PaletteId as e, RADII as f, type ResolvedSaasflareProps as g, STYLES as h, useSaasflareProps as u };
257
+ export { type CustomPalette as C, type IconWeight as I, type PhosphorIconProps as P, type RadiusProp as R, type Surface as S, type Palette as a, type StyleVariant as b, type Radius as c, type SaasflareComponentProps as d, IconBase as e, PALETTES as f, type PaletteId as g, RADII as h, type ResolvedSaasflareProps as i, STYLES as j, useSaasflareProps as u };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saasflare/ui",
3
- "version": "3.1.1",
3
+ "version": "3.2.0",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "description": "The Next.js UI library — App Router-aware Radix primitives with Tailwind v4 and Motion, animated by default.",
@@ -134,7 +134,6 @@
134
134
  "class-variance-authority": "^0.7.1",
135
135
  "clsx": "^2.1.1",
136
136
  "cmdk": "^1.1.1",
137
- "lucide-react": "^1.14.0",
138
137
  "sonner": "^2.0.0",
139
138
  "tailwind-merge": "^3.5.0"
140
139
  },
@@ -195,7 +194,9 @@
195
194
  "typescript": "^6.0.3"
196
195
  },
197
196
  "scripts": {
198
- "build": "tsup",
197
+ "build": "tsup && pnpm build:registry && pnpm build:llms",
198
+ "build:registry": "node scripts/build-registry.mjs",
199
+ "build:llms": "node scripts/build-llms.mjs",
199
200
  "dev": "tsup --watch",
200
201
  "lint": "eslint .",
201
202
  "typecheck": "tsc --noEmit"
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @fileoverview Aurora drift animations for AuroraBackground showcase backdrop.
3
+ * @module packages/ui/styles/aurora
4
+ * @package ui
5
+ *
6
+ * Three independent keyframe cycles with staggered periods (24/28/32s) and
7
+ * negative delays so the blobs never synchronise. Drift is small (max ±6%)
8
+ * to feel like ambient motion, not active animation.
9
+ *
10
+ * Animation only activates when the component sets `data-animated="true"`.
11
+ * `prefers-reduced-motion: reduce` always wins.
12
+ */
13
+
14
+ @keyframes aurora-drift-1 {
15
+ 0%, 100% { transform: translate(0, 0); }
16
+ 50% { transform: translate(4%, 6%); }
17
+ }
18
+
19
+ @keyframes aurora-drift-2 {
20
+ 0%, 100% { transform: translate(0, 0); }
21
+ 50% { transform: translate(-5%, 3%); }
22
+ }
23
+
24
+ @keyframes aurora-drift-3 {
25
+ 0%, 100% { transform: translate(0, 0); }
26
+ 50% { transform: translate(3%, -5%); }
27
+ }
28
+
29
+ [data-slot="aurora-background"][data-animated="true"] .aurora-blob-1 {
30
+ animation: aurora-drift-1 24s ease-in-out infinite;
31
+ }
32
+
33
+ [data-slot="aurora-background"][data-animated="true"] .aurora-blob-2 {
34
+ animation: aurora-drift-2 28s ease-in-out infinite;
35
+ animation-delay: -8s;
36
+ }
37
+
38
+ [data-slot="aurora-background"][data-animated="true"] .aurora-blob-3 {
39
+ animation: aurora-drift-3 32s ease-in-out infinite;
40
+ animation-delay: -16s;
41
+ }
42
+
43
+ @media (prefers-reduced-motion: reduce) {
44
+ [data-slot="aurora-background"] .aurora-blob {
45
+ animation: none !important;
46
+ }
47
+ }