@thesage/ui 1.1.0 → 1.3.1

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/.claude/CLAUDE.md +3 -3
  2. package/LICENSE +21 -0
  3. package/README.md +3 -4
  4. package/dist/dates.js +15 -5
  5. package/dist/dates.js.map +1 -1
  6. package/dist/dates.mjs +15 -5
  7. package/dist/dates.mjs.map +1 -1
  8. package/dist/{fontThemes-Cum0S1DI.d.mts → fontThemes-Dh8mtXES.d.mts} +27 -1
  9. package/dist/{fontThemes-Cum0S1DI.d.ts → fontThemes-Dh8mtXES.d.ts} +27 -1
  10. package/dist/forms.js +1 -1
  11. package/dist/forms.js.map +1 -1
  12. package/dist/forms.mjs +1 -1
  13. package/dist/forms.mjs.map +1 -1
  14. package/dist/{hooks-CobTQpCg.d.mts → hooks-1b8WaQf1.d.mts} +2 -2
  15. package/dist/{hooks-DHPlUx3T.d.ts → hooks-CKW8vE9H.d.ts} +2 -2
  16. package/dist/hooks.d.mts +2 -2
  17. package/dist/hooks.d.ts +2 -2
  18. package/dist/hooks.js +3 -375
  19. package/dist/hooks.js.map +1 -1
  20. package/dist/hooks.mjs +3 -375
  21. package/dist/hooks.mjs.map +1 -1
  22. package/dist/index-DscTIrZ2.d.mts +29 -0
  23. package/dist/index-DscTIrZ2.d.ts +29 -0
  24. package/dist/index.d.mts +62 -36
  25. package/dist/index.d.ts +62 -36
  26. package/dist/index.js +617 -331
  27. package/dist/index.js.map +1 -1
  28. package/dist/index.mjs +634 -348
  29. package/dist/index.mjs.map +1 -1
  30. package/dist/providers-aJW1AKg6.d.mts +30 -0
  31. package/dist/providers-qfyBVcPW.d.ts +30 -0
  32. package/dist/providers.d.mts +2 -1
  33. package/dist/providers.d.ts +2 -1
  34. package/dist/providers.js +226 -375
  35. package/dist/providers.js.map +1 -1
  36. package/dist/providers.mjs +226 -375
  37. package/dist/providers.mjs.map +1 -1
  38. package/dist/tables.js +5 -5
  39. package/dist/tables.js.map +1 -1
  40. package/dist/tables.mjs +5 -5
  41. package/dist/tables.mjs.map +1 -1
  42. package/dist/tokens.d.mts +165 -3
  43. package/dist/tokens.d.ts +165 -3
  44. package/dist/tokens.js +219 -1
  45. package/dist/tokens.js.map +1 -1
  46. package/dist/tokens.mjs +217 -1
  47. package/dist/tokens.mjs.map +1 -1
  48. package/dist/{utils-xrpHqxXR.d.ts → utils-CIIM7dAC.d.ts} +1 -1
  49. package/dist/{utils-DlJKRVzQ.d.mts → utils-Cs04sxth.d.mts} +1 -1
  50. package/dist/utils.d.mts +1 -1
  51. package/dist/utils.d.ts +1 -1
  52. package/package.json +22 -10
  53. package/dist/index-L8R3gyuQ.d.mts +0 -23
  54. package/dist/index-L8R3gyuQ.d.ts +0 -23
  55. package/dist/providers-Dv3LFGtJ.d.mts +0 -17
  56. package/dist/providers-Dv3LFGtJ.d.ts +0 -17
package/dist/hooks.mjs CHANGED
@@ -42,378 +42,6 @@ import { useEffect } from "react";
42
42
  import { create as create2 } from "zustand";
43
43
  import { persist as persist2 } from "zustand/middleware";
44
44
 
45
- // ../tokens/src/base.ts
46
- var baseTokens = {
47
- /**
48
- * Spacing scale (based on 4px grid)
49
- */
50
- spacing: {
51
- "0": "0",
52
- "0.5": "0.125rem",
53
- // 2px
54
- "1": "0.25rem",
55
- // 4px
56
- "2": "0.5rem",
57
- // 8px
58
- "3": "0.75rem",
59
- // 12px
60
- "4": "1rem",
61
- // 16px
62
- "5": "1.25rem",
63
- // 20px
64
- "6": "1.5rem",
65
- // 24px
66
- "8": "2rem",
67
- // 32px
68
- "10": "2.5rem",
69
- // 40px
70
- "12": "3rem",
71
- // 48px
72
- "16": "4rem",
73
- // 64px
74
- "20": "5rem",
75
- // 80px
76
- "24": "6rem",
77
- // 96px
78
- "32": "8rem"
79
- // 128px
80
- },
81
- /**
82
- * Typography scales
83
- */
84
- fontSize: {
85
- "xs": "0.75rem",
86
- // 12px
87
- "sm": "0.875rem",
88
- // 14px
89
- "base": "1rem",
90
- // 16px
91
- "lg": "1.125rem",
92
- // 18px
93
- "xl": "1.25rem",
94
- // 20px
95
- "2xl": "1.5rem",
96
- // 24px
97
- "3xl": "1.875rem",
98
- // 30px
99
- "4xl": "2.25rem",
100
- // 36px
101
- "5xl": "3rem",
102
- // 48px
103
- "6xl": "3.75rem",
104
- // 60px
105
- "7xl": "4.5rem",
106
- // 72px
107
- "8xl": "6rem"
108
- // 96px
109
- },
110
- fontWeight: {
111
- light: "300",
112
- normal: "400",
113
- medium: "500",
114
- semibold: "600",
115
- bold: "700",
116
- extrabold: "800",
117
- black: "900"
118
- },
119
- lineHeight: {
120
- none: "1",
121
- tight: "1.25",
122
- snug: "1.375",
123
- normal: "1.5",
124
- relaxed: "1.625",
125
- loose: "2"
126
- },
127
- /**
128
- * Border radius
129
- */
130
- borderRadius: {
131
- none: "0",
132
- sm: "0.125rem",
133
- // 2px
134
- DEFAULT: "0.25rem",
135
- // 4px
136
- md: "0.375rem",
137
- // 6px
138
- lg: "0.5rem",
139
- // 8px
140
- xl: "0.75rem",
141
- // 12px
142
- "2xl": "1rem",
143
- // 16px
144
- "3xl": "1.5rem",
145
- // 24px
146
- full: "9999px"
147
- },
148
- /**
149
- * Motion durations (base values - themes can override)
150
- */
151
- duration: {
152
- instant: "0ms",
153
- fast: "150ms",
154
- normal: "300ms",
155
- slow: "500ms",
156
- slower: "800ms"
157
- },
158
- /**
159
- * Easing curves (base values - themes can override)
160
- */
161
- ease: {
162
- linear: "linear",
163
- in: "cubic-bezier(0.4, 0, 1, 1)",
164
- out: "cubic-bezier(0, 0, 0.2, 1)",
165
- inOut: "cubic-bezier(0.4, 0, 0.2, 1)"
166
- },
167
- /**
168
- * Z-index scale
169
- */
170
- zIndex: {
171
- "auto": "auto",
172
- "0": "0",
173
- "10": "10",
174
- "20": "20",
175
- "30": "30",
176
- "40": "40",
177
- "50": "50",
178
- dropdown: "1000",
179
- sticky: "1020",
180
- fixed: "1030",
181
- modalBackdrop: "1040",
182
- modal: "1050",
183
- popover: "1060",
184
- tooltip: "1070"
185
- },
186
- /**
187
- * Focus ring configuration
188
- */
189
- focus: {
190
- width: "2px",
191
- offset: "2px",
192
- style: "solid"
193
- }
194
- };
195
- var spacing = {
196
- xs: baseTokens.spacing["1"],
197
- // 4px — Tight internal padding
198
- sm: baseTokens.spacing["2"],
199
- // 8px — Default gap
200
- md: baseTokens.spacing["4"],
201
- // 16px — Section padding
202
- lg: baseTokens.spacing["6"],
203
- // 24px — Card padding
204
- xl: baseTokens.spacing["8"],
205
- // 32px — Section margins
206
- "2xl": baseTokens.spacing["12"],
207
- // 48px — Page sections
208
- "3xl": baseTokens.spacing["16"]
209
- // 64px — Major divisions
210
- };
211
- var typography = {
212
- fonts: {
213
- sans: "var(--font-body)",
214
- serif: "var(--font-heading)",
215
- mono: "var(--font-mono)"
216
- },
217
- sizes: {
218
- xs: baseTokens.fontSize.xs,
219
- // 12px — Fine print
220
- sm: baseTokens.fontSize.sm,
221
- // 14px — Secondary text
222
- base: baseTokens.fontSize.base,
223
- // 16px — Body text
224
- lg: baseTokens.fontSize.lg,
225
- // 18px — Lead paragraphs
226
- xl: baseTokens.fontSize.xl,
227
- // 20px — Section headers
228
- "2xl": baseTokens.fontSize["2xl"],
229
- // 24px — Page headers
230
- "3xl": baseTokens.fontSize["3xl"]
231
- // 30px — Hero text
232
- },
233
- weights: {
234
- normal: baseTokens.fontWeight.normal,
235
- // 400
236
- medium: baseTokens.fontWeight.medium,
237
- // 500
238
- semibold: baseTokens.fontWeight.semibold,
239
- // 600
240
- bold: baseTokens.fontWeight.bold
241
- // 700
242
- },
243
- leading: {
244
- tight: baseTokens.lineHeight.tight,
245
- // 1.25 — Headings
246
- normal: baseTokens.lineHeight.normal,
247
- // 1.5 — Body
248
- relaxed: baseTokens.lineHeight.relaxed
249
- // 1.625 — Spacious reading
250
- }
251
- };
252
- var motion = {
253
- duration: baseTokens.duration,
254
- easing: {
255
- default: baseTokens.ease.out,
256
- // Most transitions
257
- spring: "cubic-bezier(0.16, 1, 0.3, 1)",
258
- // Playful interactions
259
- linear: baseTokens.ease.linear
260
- // Progress indicators
261
- }
262
- };
263
-
264
- // ../tokens/src/typography.ts
265
- var fontSizes = {
266
- // Body text scale
267
- xs: { base: "0.75rem", mobile: "0.75rem" },
268
- // 12px
269
- sm: { base: "0.875rem", mobile: "0.875rem" },
270
- // 14px
271
- base: { base: "1rem", mobile: "1rem" },
272
- // 16px
273
- lg: { base: "1.125rem", mobile: "1rem" },
274
- // 18px / 16px mobile
275
- xl: { base: "1.25rem", mobile: "1.125rem" },
276
- // 20px / 18px mobile
277
- "2xl": { base: "1.5rem", mobile: "1.25rem" },
278
- // 24px / 20px mobile
279
- "3xl": { base: "1.875rem", mobile: "1.5rem" },
280
- // 30px / 24px mobile
281
- // Heading scale (h6 → h1)
282
- "4xl": { base: "2.25rem", mobile: "1.875rem" },
283
- // 36px / 30px - h3
284
- "5xl": { base: "3rem", mobile: "2.25rem" },
285
- // 48px / 36px - h2
286
- "6xl": { base: "3.75rem", mobile: "2.5rem" },
287
- // 60px / 40px - h1
288
- "7xl": { base: "4.5rem", mobile: "3rem" },
289
- // 72px / 48px - Display
290
- "8xl": { base: "6rem", mobile: "3.75rem" },
291
- // 96px / 60px - Hero
292
- "9xl": { base: "8rem", mobile: "4.5rem" }
293
- // 128px / 72px - Ultra
294
- };
295
- var fontWeights = {
296
- thin: "100",
297
- extralight: "200",
298
- light: "300",
299
- normal: "400",
300
- medium: "500",
301
- semibold: "600",
302
- bold: "700",
303
- extrabold: "800",
304
- black: "900"
305
- };
306
- var lineHeights = {
307
- none: "1",
308
- tight: "1.25",
309
- snug: "1.375",
310
- normal: "1.5",
311
- relaxed: "1.625",
312
- loose: "1.75",
313
- extraloose: "2"
314
- };
315
- var letterSpacing = {
316
- tighter: "-0.05em",
317
- tight: "-0.025em",
318
- normal: "0",
319
- wide: "0.025em",
320
- wider: "0.05em",
321
- widest: "0.1em"
322
- };
323
- var typePresets = {
324
- "display-large": {
325
- size: fontSizes["8xl"],
326
- weight: fontWeights.bold,
327
- lineHeight: lineHeights.none,
328
- letterSpacing: letterSpacing.tighter,
329
- description: "Large hero text, landing pages"
330
- },
331
- "display": {
332
- size: fontSizes["7xl"],
333
- weight: fontWeights.bold,
334
- lineHeight: lineHeights.tight,
335
- letterSpacing: letterSpacing.tight,
336
- description: "Hero sections, major headings"
337
- },
338
- "heading-1": {
339
- size: fontSizes["6xl"],
340
- weight: fontWeights.bold,
341
- lineHeight: lineHeights.tight,
342
- letterSpacing: letterSpacing.tight,
343
- description: "Page titles, h1"
344
- },
345
- "heading-2": {
346
- size: fontSizes["5xl"],
347
- weight: fontWeights.bold,
348
- lineHeight: lineHeights.tight,
349
- letterSpacing: letterSpacing.normal,
350
- description: "Section titles, h2"
351
- },
352
- "heading-3": {
353
- size: fontSizes["4xl"],
354
- weight: fontWeights.semibold,
355
- lineHeight: lineHeights.snug,
356
- letterSpacing: letterSpacing.normal,
357
- description: "Subsection titles, h3"
358
- },
359
- "heading-4": {
360
- size: fontSizes["2xl"],
361
- weight: fontWeights.semibold,
362
- lineHeight: lineHeights.snug,
363
- letterSpacing: letterSpacing.normal,
364
- description: "Component titles, h4"
365
- },
366
- "heading-5": {
367
- size: fontSizes.xl,
368
- weight: fontWeights.medium,
369
- lineHeight: lineHeights.normal,
370
- letterSpacing: letterSpacing.normal,
371
- description: "Small headings, h5"
372
- },
373
- "heading-6": {
374
- size: fontSizes.lg,
375
- weight: fontWeights.medium,
376
- lineHeight: lineHeights.normal,
377
- letterSpacing: letterSpacing.normal,
378
- description: "Tiny headings, h6"
379
- },
380
- "body-large": {
381
- size: fontSizes.lg,
382
- weight: fontWeights.normal,
383
- lineHeight: lineHeights.relaxed,
384
- letterSpacing: letterSpacing.normal,
385
- description: "Lead paragraphs, intro text"
386
- },
387
- "body": {
388
- size: fontSizes.base,
389
- weight: fontWeights.normal,
390
- lineHeight: lineHeights.normal,
391
- letterSpacing: letterSpacing.normal,
392
- description: "Default body text"
393
- },
394
- "body-small": {
395
- size: fontSizes.sm,
396
- weight: fontWeights.normal,
397
- lineHeight: lineHeights.normal,
398
- letterSpacing: letterSpacing.normal,
399
- description: "Small body text, fine print"
400
- },
401
- "caption": {
402
- size: fontSizes.xs,
403
- weight: fontWeights.normal,
404
- lineHeight: lineHeights.snug,
405
- letterSpacing: letterSpacing.wide,
406
- description: "Captions, labels, metadata"
407
- },
408
- "overline": {
409
- size: fontSizes.xs,
410
- weight: fontWeights.semibold,
411
- lineHeight: lineHeights.normal,
412
- letterSpacing: letterSpacing.widest,
413
- description: "Eyebrows, categories, all-caps labels"
414
- }
415
- };
416
-
417
45
  // ../tokens/src/color-utils.ts
418
46
  function hexToRgb(hex) {
419
47
  const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
@@ -1146,7 +774,7 @@ var useCustomizer = create2()(
1146
774
 
1147
775
  // src/hooks/useMotionPreference.ts
1148
776
  function useMotionPreference() {
1149
- const { motion: motion2, prefersReducedMotion, setPrefersReducedMotion } = useCustomizer();
777
+ const { motion, prefersReducedMotion, setPrefersReducedMotion } = useCustomizer();
1150
778
  useEffect(() => {
1151
779
  if (typeof window === "undefined") return;
1152
780
  const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
@@ -1158,8 +786,8 @@ function useMotionPreference() {
1158
786
  return () => mediaQuery.removeEventListener("change", handleChange);
1159
787
  }, [setPrefersReducedMotion]);
1160
788
  return {
1161
- scale: motion2,
1162
- shouldAnimate: motion2 > 0 && !prefersReducedMotion,
789
+ scale: motion,
790
+ shouldAnimate: motion > 0 && !prefersReducedMotion,
1163
791
  prefersReducedMotion
1164
792
  };
1165
793
  }