@splenddev/kreativ-ui 0.2.5 → 0.2.6

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/dist/index.cjs CHANGED
@@ -303,6 +303,171 @@ var formControlRecipe = defineRecipe({
303
303
  hasAdornment: false
304
304
  }
305
305
  });
306
+
307
+ // src/utils/color.ts
308
+ var HEX_RE = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
309
+ function rgbToHex(value) {
310
+ const trimmed = value.trim();
311
+ if (HEX_RE.test(trimmed)) {
312
+ if (trimmed.length === 4) {
313
+ return ("#" + [...trimmed.slice(1)].map((char) => char + char).join("")).toUpperCase();
314
+ }
315
+ return trimmed.toUpperCase();
316
+ }
317
+ const values = trimmed.replace(/[^\d,]/g, "").split(",").map(Number);
318
+ if (values.length !== 3 || values.some(Number.isNaN)) {
319
+ return "#000000";
320
+ }
321
+ return "#" + values.map((x) => x.toString(16).padStart(2, "0")).join("").toUpperCase();
322
+ }
323
+ __name(rgbToHex, "rgbToHex");
324
+ function hexToRgbString(hex) {
325
+ if (!HEX_RE.test(hex)) return null;
326
+ const full = hex.length === 4 ? "#" + [...hex.slice(1)].map((c) => c + c).join("") : hex;
327
+ const r = parseInt(full.slice(1, 3), 16);
328
+ const g = parseInt(full.slice(3, 5), 16);
329
+ const b = parseInt(full.slice(5, 7), 16);
330
+ return `${r} ${g} ${b}`;
331
+ }
332
+ __name(hexToRgbString, "hexToRgbString");
333
+
334
+ // src/utils/resolveTokenReference.ts
335
+ function resolveTokenReference(value, tokens) {
336
+ if (typeof value !== "string") {
337
+ return typeof value === "number" ? value : "";
338
+ }
339
+ const match = value.match(/^\{(.+)\}$/);
340
+ if (!match) {
341
+ return value;
342
+ }
343
+ const path = match[1].split(".");
344
+ let current = tokens;
345
+ for (const key of path) {
346
+ if (typeof current !== "object" || current === null || !(key in current)) {
347
+ return "";
348
+ }
349
+ current = current[key];
350
+ }
351
+ if (typeof current === "object" && current !== null && "value" in current) {
352
+ const tokenValue = current.value;
353
+ if (typeof tokenValue === "string" || typeof tokenValue === "number") {
354
+ return tokenValue;
355
+ }
356
+ return "";
357
+ }
358
+ return typeof current === "string" || typeof current === "number" ? current : "";
359
+ }
360
+ __name(resolveTokenReference, "resolveTokenReference");
361
+
362
+ // src/theme/typography/resolveTypography.ts
363
+ function resolveTypography(typography, tokens) {
364
+ if (!typography) return {};
365
+ return {
366
+ fontFamily: resolveTokenReference(typography.fontFamily, tokens),
367
+ fontSize: resolveTokenReference(typography.fontSize, tokens),
368
+ fontWeight: resolveTokenReference(typography.fontWeight, tokens),
369
+ lineHeight: resolveTokenReference(typography.lineHeight, tokens),
370
+ letterSpacing: resolveTokenReference(
371
+ typography.letterSpacing,
372
+ tokens
373
+ )
374
+ };
375
+ }
376
+ __name(resolveTypography, "resolveTypography");
377
+
378
+ // src/theme/token/defineToken.ts
379
+ function defineToken(value) {
380
+ return {
381
+ value
382
+ };
383
+ }
384
+ __name(defineToken, "defineToken");
385
+ function defineSemanticToken(light, dark) {
386
+ return { value: { light, dark } };
387
+ }
388
+ __name(defineSemanticToken, "defineSemanticToken");
389
+ var BREAKPOINTS = {
390
+ sm: 640,
391
+ md: 768,
392
+ lg: 1024,
393
+ xl: 1280,
394
+ "2xl": 1536
395
+ };
396
+ function useBreakpoint(breakpoint) {
397
+ const query = `(min-width: ${BREAKPOINTS[breakpoint]}px)`;
398
+ const [matches, setMatches] = react.useState(
399
+ () => typeof window !== "undefined" && window.matchMedia(query).matches
400
+ );
401
+ react.useEffect(() => {
402
+ const mql = window.matchMedia(query);
403
+ const listener = /* @__PURE__ */ __name((e) => setMatches(e.matches), "listener");
404
+ mql.addEventListener("change", listener);
405
+ setMatches(mql.matches);
406
+ return () => mql.removeEventListener("change", listener);
407
+ }, [query]);
408
+ return matches;
409
+ }
410
+ __name(useBreakpoint, "useBreakpoint");
411
+ var VIEWPORT_PADDING = 8;
412
+ function useFloatingSide(triggerRef, open) {
413
+ const contentRef = react.useRef(null);
414
+ const [side, setSide] = react.useState("bottom");
415
+ react.useLayoutEffect(() => {
416
+ if (!open) return;
417
+ const trigger = triggerRef.current;
418
+ const content = contentRef.current;
419
+ if (!trigger || !content) return;
420
+ function measure() {
421
+ const triggerRect = trigger.getBoundingClientRect();
422
+ const contentHeight = content.offsetHeight;
423
+ const spaceBelow = window.innerHeight - triggerRect.bottom - VIEWPORT_PADDING;
424
+ const spaceAbove = triggerRect.top - VIEWPORT_PADDING;
425
+ setSide(contentHeight > spaceBelow && spaceAbove > spaceBelow ? "top" : "bottom");
426
+ }
427
+ __name(measure, "measure");
428
+ measure();
429
+ window.addEventListener("resize", measure);
430
+ window.addEventListener("scroll", measure, true);
431
+ return () => {
432
+ window.removeEventListener("resize", measure);
433
+ window.removeEventListener("scroll", measure, true);
434
+ };
435
+ }, [open, triggerRef]);
436
+ return { contentRef, side };
437
+ }
438
+ __name(useFloatingSide, "useFloatingSide");
439
+ var TRANSITION_DURATION = 1500;
440
+ function useStateTransition(state) {
441
+ const previousState = react.useRef(state);
442
+ const [transitionState, setTransitionState] = react.useState();
443
+ react.useEffect(() => {
444
+ if (state === previousState.current) {
445
+ return;
446
+ }
447
+ previousState.current = state;
448
+ if (state === "none") {
449
+ setTransitionState(void 0);
450
+ return;
451
+ }
452
+ setTransitionState(state);
453
+ const timeout = window.setTimeout(() => {
454
+ setTransitionState(void 0);
455
+ }, TRANSITION_DURATION);
456
+ return () => window.clearTimeout(timeout);
457
+ }, [state]);
458
+ return transitionState;
459
+ }
460
+ __name(useStateTransition, "useStateTransition");
461
+
462
+ // src/hooks/useTypography.ts
463
+ function useTypography(name) {
464
+ const { theme } = useTheme();
465
+ return resolveTypography(
466
+ name ? theme.typography[name] : void 0,
467
+ theme.tokens
468
+ );
469
+ }
470
+ __name(useTypography, "useTypography");
306
471
  var ACTIVATION_KEYS = /* @__PURE__ */ new Set(["Enter", " "]);
307
472
  var Button = react.forwardRef(
308
473
  ({
@@ -314,6 +479,7 @@ var Button = react.forwardRef(
314
479
  rightIcon,
315
480
  fullWidth = false,
316
481
  disabled,
482
+ typography: typographyName = "body",
317
483
  className,
318
484
  style,
319
485
  iconOnly,
@@ -324,6 +490,7 @@ var Button = react.forwardRef(
324
490
  ...rest
325
491
  }, ref) => {
326
492
  const { theme } = useTheme();
493
+ const typography = useTypography(typographyName);
327
494
  const { style: sizeStyle, iconSize } = useSizeStyle(
328
495
  size,
329
496
  iconOnly,
@@ -357,6 +524,7 @@ var Button = react.forwardRef(
357
524
  className
358
525
  );
359
526
  const resolvedStyle = {
527
+ ...typography,
360
528
  ...sizeStyle,
361
529
  ...style
362
530
  };
@@ -412,33 +580,6 @@ var Button = react.forwardRef(
412
580
  }
413
581
  );
414
582
  Button.displayName = "Button";
415
-
416
- // src/utils/color.ts
417
- var HEX_RE = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
418
- function rgbToHex(value) {
419
- const trimmed = value.trim();
420
- if (HEX_RE.test(trimmed)) {
421
- if (trimmed.length === 4) {
422
- return ("#" + [...trimmed.slice(1)].map((char) => char + char).join("")).toUpperCase();
423
- }
424
- return trimmed.toUpperCase();
425
- }
426
- const values = trimmed.replace(/[^\d,]/g, "").split(",").map(Number);
427
- if (values.length !== 3 || values.some(Number.isNaN)) {
428
- return "#000000";
429
- }
430
- return "#" + values.map((x) => x.toString(16).padStart(2, "0")).join("").toUpperCase();
431
- }
432
- __name(rgbToHex, "rgbToHex");
433
- function hexToRgbString(hex) {
434
- if (!HEX_RE.test(hex)) return null;
435
- const full = hex.length === 4 ? "#" + [...hex.slice(1)].map((c) => c + c).join("") : hex;
436
- const r = parseInt(full.slice(1, 3), 16);
437
- const g = parseInt(full.slice(3, 5), 16);
438
- const b = parseInt(full.slice(5, 7), 16);
439
- return `${r} ${g} ${b}`;
440
- }
441
- __name(hexToRgbString, "hexToRgbString");
442
583
  var defaultTransition = {
443
584
  type: "none",
444
585
  duration: 300,
@@ -620,28 +761,6 @@ function ThemeToggler({
620
761
  return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "group", "aria-label": "Theme selector", className: containerClasses, children: buttons });
621
762
  }
622
763
  __name(ThemeToggler, "ThemeToggler");
623
- var BREAKPOINTS = {
624
- sm: 640,
625
- md: 768,
626
- lg: 1024,
627
- xl: 1280,
628
- "2xl": 1536
629
- };
630
- function useBreakpoint(breakpoint) {
631
- const query = `(min-width: ${BREAKPOINTS[breakpoint]}px)`;
632
- const [matches, setMatches] = react.useState(
633
- () => typeof window !== "undefined" && window.matchMedia(query).matches
634
- );
635
- react.useEffect(() => {
636
- const mql = window.matchMedia(query);
637
- const listener = /* @__PURE__ */ __name((e) => setMatches(e.matches), "listener");
638
- mql.addEventListener("change", listener);
639
- setMatches(mql.matches);
640
- return () => mql.removeEventListener("change", listener);
641
- }, [query]);
642
- return matches;
643
- }
644
- __name(useBreakpoint, "useBreakpoint");
645
764
  var inputKindIcons = {
646
765
  email: lucideReact.Mail,
647
766
  tel: lucideReact.Phone,
@@ -738,28 +857,6 @@ var inputKindDefaults = {
738
857
  placeholder: "YYYY-Www"
739
858
  }
740
859
  };
741
- var TRANSITION_DURATION = 1500;
742
- function useStateTransition(state) {
743
- const previousState = react.useRef(state);
744
- const [transitionState, setTransitionState] = react.useState();
745
- react.useEffect(() => {
746
- if (state === previousState.current) {
747
- return;
748
- }
749
- previousState.current = state;
750
- if (state === "none") {
751
- setTransitionState(void 0);
752
- return;
753
- }
754
- setTransitionState(state);
755
- const timeout = window.setTimeout(() => {
756
- setTransitionState(void 0);
757
- }, TRANSITION_DURATION);
758
- return () => window.clearTimeout(timeout);
759
- }, [state]);
760
- return transitionState;
761
- }
762
- __name(useStateTransition, "useStateTransition");
763
860
  var FormFieldContext = react.createContext(
764
861
  null
765
862
  );
@@ -1259,7 +1356,7 @@ var SelectTrigger = react.forwardRef(
1259
1356
  }
1260
1357
  );
1261
1358
  SelectTrigger.displayName = "SelectTrigger";
1262
- var VIEWPORT_PADDING = 8;
1359
+ var VIEWPORT_PADDING2 = 8;
1263
1360
  function SelectContent({
1264
1361
  className,
1265
1362
  children,
@@ -1276,8 +1373,8 @@ function SelectContent({
1276
1373
  function measure() {
1277
1374
  const triggerRect = trigger.getBoundingClientRect();
1278
1375
  const contentHeight = content?.offsetHeight;
1279
- const spaceBelow = window.innerHeight - triggerRect.bottom - VIEWPORT_PADDING;
1280
- const spaceAbove = triggerRect.top - VIEWPORT_PADDING;
1376
+ const spaceBelow = window.innerHeight - triggerRect.bottom - VIEWPORT_PADDING2;
1377
+ const spaceAbove = triggerRect.top - VIEWPORT_PADDING2;
1281
1378
  setSide(
1282
1379
  contentHeight && contentHeight > spaceBelow && spaceAbove > spaceBelow ? "top" : "bottom"
1283
1380
  );
@@ -2726,34 +2823,6 @@ function ComboboxItem({
2726
2823
  );
2727
2824
  }
2728
2825
  __name(ComboboxItem, "ComboboxItem");
2729
- var VIEWPORT_PADDING2 = 8;
2730
- function useFloatingSide(triggerRef, open) {
2731
- const contentRef = react.useRef(null);
2732
- const [side, setSide] = react.useState("bottom");
2733
- react.useLayoutEffect(() => {
2734
- if (!open) return;
2735
- const trigger = triggerRef.current;
2736
- const content = contentRef.current;
2737
- if (!trigger || !content) return;
2738
- function measure() {
2739
- const triggerRect = trigger.getBoundingClientRect();
2740
- const contentHeight = content.offsetHeight;
2741
- const spaceBelow = window.innerHeight - triggerRect.bottom - VIEWPORT_PADDING2;
2742
- const spaceAbove = triggerRect.top - VIEWPORT_PADDING2;
2743
- setSide(contentHeight > spaceBelow && spaceAbove > spaceBelow ? "top" : "bottom");
2744
- }
2745
- __name(measure, "measure");
2746
- measure();
2747
- window.addEventListener("resize", measure);
2748
- window.addEventListener("scroll", measure, true);
2749
- return () => {
2750
- window.removeEventListener("resize", measure);
2751
- window.removeEventListener("scroll", measure, true);
2752
- };
2753
- }, [open, triggerRef]);
2754
- return { contentRef, side };
2755
- }
2756
- __name(useFloatingSide, "useFloatingSide");
2757
2826
  function ComboboxContent({
2758
2827
  className,
2759
2828
  children
@@ -3313,235 +3382,185 @@ MultiSelect.Item = MultiSelectItem;
3313
3382
  var defaultTokens = {
3314
3383
  colors: {
3315
3384
  blue: {
3316
- 300: { value: "#5EA6ED" },
3317
- 400: { value: "#4799EB" },
3318
- 500: { value: "#1A80E6" },
3319
- 600: { value: "#1773CF" }
3385
+ 300: defineToken("#5EA6ED"),
3386
+ 400: defineToken("#4799EB"),
3387
+ 500: defineToken("#1A80E6"),
3388
+ 600: defineToken("#1773CF")
3320
3389
  },
3321
3390
  red: {
3322
- 300: { value: "#EB4747" },
3323
- 400: { value: "#E83030" },
3324
- 500: { value: "#E61A1A" },
3325
- 600: { value: "#CF1717" }
3391
+ 300: defineToken("#EB4747"),
3392
+ 400: defineToken("#E83030"),
3393
+ 500: defineToken("#E61A1A"),
3394
+ 600: defineToken("#CF1717")
3326
3395
  },
3327
3396
  green: {
3328
- 300: { value: "#26D997" },
3329
- 400: { value: "#22C388" },
3330
- 500: { value: "#16A249" },
3331
- 600: { value: "#12875C" }
3397
+ 300: defineToken("#26D997"),
3398
+ 400: defineToken("#22C388"),
3399
+ 500: defineToken("#16A249"),
3400
+ 600: defineToken("#12875C")
3332
3401
  },
3333
3402
  amber: {
3334
- 300: { value: "#F7B23B" },
3335
- 400: { value: "#F6A823" },
3336
- 500: { value: "#F59F0A" },
3337
- 600: { value: "#D38909" }
3403
+ 300: defineToken("#F7B23B"),
3404
+ 400: defineToken("#F6A823"),
3405
+ 500: defineToken("#F59F0A"),
3406
+ 600: defineToken("#D38909")
3338
3407
  },
3339
3408
  cyan: {
3340
- 300: { value: "#6CC3EF" },
3341
- 400: { value: "#47B4EB" },
3342
- 500: { value: "#1791CF" },
3343
- 600: { value: "#137BAE" }
3409
+ 300: defineToken("#6CC3EF"),
3410
+ 400: defineToken("#47B4EB"),
3411
+ 500: defineToken("#1791CF"),
3412
+ 600: defineToken("#137BAE")
3344
3413
  },
3345
3414
  gray: {
3346
- 50: { value: "#FAFAFA" },
3347
- 100: { value: "#EBEBEB" },
3348
- 200: { value: "#D9D9D9" },
3349
- 300: { value: "#BDBDBD" },
3350
- 400: { value: "#999999" },
3351
- 500: { value: "#666666" },
3352
- 600: { value: "#4D4D4D" },
3353
- 700: { value: "#333333" },
3354
- 800: { value: "#2E2E2E" },
3355
- 900: { value: "#1F1F1F" },
3356
- 950: { value: "#141414" },
3357
- 1e3: { value: "#0A0A0A" }
3358
- },
3359
- white: {
3360
- value: "#FFFFFF"
3415
+ 50: defineToken("#FAFAFA"),
3416
+ 100: defineToken("#EBEBEB"),
3417
+ 200: defineToken("#D9D9D9"),
3418
+ 300: defineToken("#BDBDBD"),
3419
+ 400: defineToken("#999999"),
3420
+ 500: defineToken("#666666"),
3421
+ 600: defineToken("#4D4D4D"),
3422
+ 700: defineToken("#333333"),
3423
+ 800: defineToken("#2E2E2E"),
3424
+ 900: defineToken("#1F1F1F"),
3425
+ 950: defineToken("#141414"),
3426
+ 1e3: defineToken("#0A0A0A")
3361
3427
  },
3362
- black: {
3363
- value: "#000000"
3364
- }
3428
+ white: defineToken("#FFFFFF"),
3429
+ black: defineToken("#000000")
3365
3430
  },
3366
3431
  spacing: {
3367
- 1: { value: "0.25rem" },
3368
- 2: { value: "0.5rem" },
3369
- 3: { value: "0.75rem" },
3370
- 4: { value: "1rem" },
3371
- 5: { value: "1.25rem" },
3372
- 6: { value: "1.5rem" },
3373
- 8: { value: "2rem" },
3374
- 10: { value: "2.5rem" },
3375
- 12: { value: "3rem" },
3376
- 16: { value: "4rem" }
3432
+ 1: defineToken("0.25rem"),
3433
+ 2: defineToken("0.5rem"),
3434
+ 3: defineToken("0.75rem"),
3435
+ 4: defineToken("1rem"),
3436
+ 5: defineToken("1.25rem"),
3437
+ 6: defineToken("1.5rem"),
3438
+ 8: defineToken("2rem"),
3439
+ 10: defineToken("2.5rem"),
3440
+ 12: defineToken("3rem"),
3441
+ 16: defineToken("4rem")
3377
3442
  },
3378
3443
  radii: {
3379
- none: { value: "0" },
3380
- sm: { value: "0.25rem" },
3381
- md: { value: "0.5rem" },
3382
- lg: { value: "0.75rem" },
3383
- xl: { value: "1rem" },
3384
- full: { value: "9999px" }
3444
+ none: defineToken("0"),
3445
+ sm: defineToken("0.25rem"),
3446
+ md: defineToken("0.5rem"),
3447
+ lg: defineToken("0.75rem"),
3448
+ xl: defineToken("1rem"),
3449
+ full: defineToken("9999px")
3385
3450
  },
3386
3451
  fonts: {
3387
- body: {
3388
- value: "Inter, sans-serif"
3389
- },
3390
- heading: {
3391
- value: "Inter, sans-serif"
3392
- },
3393
- mono: {
3394
- value: "ui-monospace, SFMono-Regular, Menlo, monospace"
3395
- }
3452
+ body: defineToken("Inter, sans-serif"),
3453
+ heading: defineToken("Inter, sans-serif"),
3454
+ mono: defineToken("ui-monospace, SFMono-Regular, Menlo, monospace")
3396
3455
  },
3397
3456
  fontSizes: {
3398
- xs: { value: "0.75rem" },
3399
- sm: { value: "0.875rem" },
3400
- md: { value: "1rem" },
3401
- lg: { value: "1.125rem" },
3402
- xl: { value: "1.25rem" },
3403
- "2xl": { value: "1.5rem" },
3404
- "3xl": { value: "1.875rem" },
3405
- "4xl": { value: "2.25rem" }
3457
+ xs: defineToken("0.75rem"),
3458
+ sm: defineToken("0.875rem"),
3459
+ md: defineToken("1rem"),
3460
+ lg: defineToken("1.125rem"),
3461
+ xl: defineToken("1.25rem"),
3462
+ "2xl": defineToken("1.5rem"),
3463
+ "3xl": defineToken("1.875rem"),
3464
+ "4xl": defineToken("2.25rem")
3406
3465
  },
3407
3466
  fontWeights: {
3408
- normal: { value: "400" },
3409
- medium: { value: "500" },
3410
- semibold: { value: "600" },
3411
- bold: { value: "700" }
3467
+ normal: defineToken("400"),
3468
+ medium: defineToken("500"),
3469
+ semibold: defineToken("600"),
3470
+ bold: defineToken("700")
3412
3471
  },
3413
3472
  lineHeights: {
3414
- tight: { value: "1.25" },
3415
- normal: { value: "1.5" },
3416
- relaxed: { value: "1.75" }
3473
+ tight: defineToken("1.25"),
3474
+ normal: defineToken("1.5"),
3475
+ relaxed: defineToken("1.75")
3417
3476
  },
3418
3477
  letterSpacings: {
3419
- tighter: { value: "-0.025em" },
3420
- tight: { value: "-0.01em" },
3421
- normal: { value: "0" },
3422
- wide: { value: "0.025em" }
3478
+ tighter: defineToken("-0.025em"),
3479
+ tight: defineToken("-0.01em"),
3480
+ normal: defineToken("0"),
3481
+ wide: defineToken("0.025em")
3423
3482
  },
3424
3483
  animations: {
3425
- "slide-in-right": {
3426
- value: "slide-in-right 0.5s ease-in-out"
3427
- }
3484
+ "slide-in-right": defineToken("slide-in-right 0.5s ease-in-out")
3428
3485
  }
3429
3486
  };
3430
3487
 
3431
3488
  // src/theme/defaults/semanticTokens.ts
3432
3489
  var defaultSemanticTokens = {
3433
3490
  colors: {
3434
- brand: {
3435
- value: {
3436
- light: "{colors.blue.500}",
3437
- dark: "{colors.blue.400}"
3438
- }
3439
- },
3440
- brandHover: {
3441
- value: {
3442
- light: "{colors.blue.600}",
3443
- dark: "{colors.blue.300}"
3444
- }
3445
- },
3446
- brandFg: {
3447
- value: "{colors.white}"
3448
- },
3449
- surface: {
3450
- value: {
3451
- light: "{colors.gray.50}",
3452
- dark: "{colors.gray.900}"
3453
- }
3454
- },
3455
- surfaceRaised: {
3456
- value: {
3457
- light: "{colors.white}",
3458
- dark: "{colors.gray.800}"
3459
- }
3460
- },
3461
- surfaceSunken: {
3462
- value: {
3463
- light: "{colors.gray.100}",
3464
- dark: "{colors.gray.950}"
3465
- }
3466
- },
3467
- border: {
3468
- value: {
3469
- light: "{colors.gray.200}",
3470
- dark: "{colors.gray.600}"
3471
- }
3472
- },
3473
- text: {
3474
- value: {
3475
- light: "{colors.gray.900}",
3476
- dark: "{colors.gray.50}"
3477
- }
3478
- },
3479
- textMuted: {
3480
- value: {
3481
- light: "{colors.gray.500}",
3482
- dark: "{colors.gray.400}"
3483
- }
3484
- },
3485
- destructive: {
3486
- value: {
3487
- light: "{colors.red.500}",
3488
- dark: "{colors.red.400}"
3489
- }
3490
- },
3491
- destructiveFg: {
3492
- value: "{colors.white}"
3493
- },
3494
- destructiveHover: {
3495
- value: {
3496
- light: "{colors.red.600}",
3497
- dark: "{colors.red.300}"
3498
- }
3499
- },
3500
- success: {
3501
- value: {
3502
- light: "{colors.green.500}",
3503
- dark: "{colors.green.400}"
3504
- }
3505
- },
3506
- successFg: {
3507
- value: "{colors.white}"
3508
- },
3509
- successHover: {
3510
- value: {
3511
- light: "{colors.green.600}",
3512
- dark: "{colors.green.300}"
3513
- }
3514
- },
3515
- warning: {
3516
- value: {
3517
- light: "{colors.amber.500}",
3518
- dark: "{colors.amber.400}"
3519
- }
3520
- },
3521
- warningFg: {
3522
- value: "{colors.black}"
3523
- },
3524
- warningHover: {
3525
- value: {
3526
- light: "{colors.amber.600}",
3527
- dark: "{colors.amber.300}"
3528
- }
3529
- },
3530
- info: {
3531
- value: {
3532
- light: "{colors.cyan.500}",
3533
- dark: "{colors.cyan.400}"
3534
- }
3535
- },
3536
- infoFg: {
3537
- value: "{colors.white}"
3538
- },
3539
- infoHover: {
3540
- value: {
3541
- light: "{colors.cyan.600}",
3542
- dark: "{colors.cyan.300}"
3543
- }
3544
- }
3491
+ brand: defineSemanticToken("{colors.blue.500}", "{colors.blue.400}"),
3492
+ brandHover: defineSemanticToken("{colors.blue.600}", "{colors.blue.300}"),
3493
+ brandFg: defineToken("{colors.white}"),
3494
+ surface: defineSemanticToken("{colors.gray.50}", "{colors.gray.900}"),
3495
+ surfaceRaised: defineSemanticToken("{colors.white}", "{colors.gray.800}"),
3496
+ surfaceSunken: defineSemanticToken(
3497
+ "{colors.gray.100}",
3498
+ "{colors.gray.950}"
3499
+ ),
3500
+ border: defineSemanticToken("{colors.gray.200}", "{colors.gray.600}"),
3501
+ text: defineSemanticToken("{colors.gray.900}", "{colors.gray.50}"),
3502
+ textMuted: defineSemanticToken("{colors.gray.500}", "{colors.gray.400}"),
3503
+ destructive: defineSemanticToken("{colors.red.500}", "{colors.red.400}"),
3504
+ destructiveFg: defineToken("{colors.white}"),
3505
+ destructiveHover: defineSemanticToken(
3506
+ "{colors.red.600}",
3507
+ "{colors.red.300}"
3508
+ ),
3509
+ success: defineSemanticToken("{colors.green.500}", "{colors.green.400}"),
3510
+ successFg: defineToken("{colors.white}"),
3511
+ successHover: defineSemanticToken(
3512
+ "{colors.green.600}",
3513
+ "{colors.green.300}"
3514
+ ),
3515
+ warning: defineSemanticToken("{colors.amber.500}", "{colors.amber.400}"),
3516
+ warningFg: defineToken("{colors.black}"),
3517
+ warningHover: defineSemanticToken(
3518
+ "{colors.amber.600}",
3519
+ "{colors.amber.300}"
3520
+ ),
3521
+ info: defineSemanticToken("{colors.cyan.500}", "{colors.cyan.400}"),
3522
+ infoFg: defineToken("{colors.white}"),
3523
+ infoHover: defineSemanticToken("{colors.cyan.600}", "{colors.cyan.300}")
3524
+ }
3525
+ };
3526
+
3527
+ // src/theme/defaults/typography.ts
3528
+ var defaultTypography = {
3529
+ body: {
3530
+ fontFamily: "{fonts.body}",
3531
+ fontSize: "{fontSizes.md}",
3532
+ fontWeight: "{fontWeights.normal}",
3533
+ lineHeight: "{lineHeights.normal}"
3534
+ },
3535
+ bodySmall: {
3536
+ fontFamily: "{fonts.body}",
3537
+ fontSize: "{fontSizes.sm}",
3538
+ fontWeight: "{fontWeights.normal}",
3539
+ lineHeight: "{lineHeights.normal}"
3540
+ },
3541
+ heading: {
3542
+ fontFamily: "{fonts.heading}",
3543
+ fontSize: "{fontSizes.2xl}",
3544
+ fontWeight: "{fontWeights.bold}",
3545
+ lineHeight: "{lineHeights.tight}"
3546
+ },
3547
+ headingSmall: {
3548
+ fontFamily: "{fonts.heading}",
3549
+ fontSize: "{fontSizes.xl}",
3550
+ fontWeight: "{fontWeights.semibold}",
3551
+ lineHeight: "{lineHeights.tight}"
3552
+ },
3553
+ caption: {
3554
+ fontFamily: "{fonts.body}",
3555
+ fontSize: "{fontSizes.xs}",
3556
+ fontWeight: "{fontWeights.normal}",
3557
+ lineHeight: "{lineHeights.normal}"
3558
+ },
3559
+ mono: {
3560
+ fontFamily: "{fonts.mono}",
3561
+ fontSize: "{fontSizes.xs}",
3562
+ fontWeight: "{fontWeights.normal}",
3563
+ lineHeight: "{lineHeights.normal}"
3545
3564
  }
3546
3565
  };
3547
3566
 
@@ -3580,38 +3599,6 @@ var defaultSizes = {
3580
3599
  radius: "1.15rem"
3581
3600
  }
3582
3601
  };
3583
- var defaultTextStyles = {
3584
- body: {
3585
- fontFamily: "{fonts.body}",
3586
- fontSize: "{fontSizes.md}",
3587
- fontWeight: "{fontWeights.normal}",
3588
- lineHeight: "{lineHeights.normal}"
3589
- },
3590
- bodySmall: {
3591
- fontFamily: "{fonts.body}",
3592
- fontSize: "{fontSizes.sm}",
3593
- fontWeight: "{fontWeights.normal}",
3594
- lineHeight: "{lineHeights.normal}"
3595
- },
3596
- heading: {
3597
- fontFamily: "{fonts.heading}",
3598
- fontSize: "{fontSizes.2xl}",
3599
- fontWeight: "{fontWeights.bold}",
3600
- lineHeight: "{lineHeights.tight}"
3601
- },
3602
- headingSmall: {
3603
- fontFamily: "{fonts.heading}",
3604
- fontSize: "{fontSizes.xl}",
3605
- fontWeight: "{fontWeights.semibold}",
3606
- lineHeight: "{lineHeights.tight}"
3607
- },
3608
- caption: {
3609
- fontFamily: "{fonts.body}",
3610
- fontSize: "{fontSizes.xs}",
3611
- fontWeight: "{fontWeights.normal}",
3612
- lineHeight: "{lineHeights.normal}"
3613
- }
3614
- };
3615
3602
  var defaultRecipes = {
3616
3603
  Button: buttonRecipe,
3617
3604
  FormControl: formControlRecipe,
@@ -3620,7 +3607,7 @@ var defaultRecipes = {
3620
3607
  var defaultTheme = {
3621
3608
  tokens: defaultTokens,
3622
3609
  semanticTokens: defaultSemanticTokens,
3623
- textStyles: defaultTextStyles,
3610
+ typography: defaultTypography,
3624
3611
  recipes: defaultRecipes,
3625
3612
  intensity: 50,
3626
3613
  sizes: defaultSizes
@@ -3894,10 +3881,10 @@ function mergeSemanticTokens(base, override) {
3894
3881
  return deepMerge(base, override);
3895
3882
  }
3896
3883
  __name(mergeSemanticTokens, "mergeSemanticTokens");
3897
- function mergeTextStyles(base, override) {
3884
+ function mergeTypography(base, override) {
3898
3885
  return deepMerge(base, override);
3899
3886
  }
3900
- __name(mergeTextStyles, "mergeTextStyles");
3887
+ __name(mergeTypography, "mergeTypography");
3901
3888
  function mergeSizes(base, override) {
3902
3889
  if (!override) {
3903
3890
  return base;
@@ -3926,7 +3913,7 @@ function mergeTheme(base, override) {
3926
3913
  base.semanticTokens,
3927
3914
  override.semanticTokens
3928
3915
  ),
3929
- textStyles: mergeTextStyles(base.textStyles, override.textStyles),
3916
+ typography: mergeTypography(base.typography, override.typography),
3930
3917
  recipes: mergeRecipes(base.recipes, override.recipes),
3931
3918
  intensity: override.intensity ?? base.intensity,
3932
3919
  sizes: mergeSizes(base.sizes, override.sizes)
@@ -4039,16 +4026,18 @@ exports.UIProvider = UIProvider;
4039
4026
  exports.cn = cn;
4040
4027
  exports.defaultRecipes = defaultRecipes;
4041
4028
  exports.defaultSizes = defaultSizes;
4042
- exports.defaultTextStyles = defaultTextStyles;
4043
4029
  exports.defaultTheme = defaultTheme;
4044
4030
  exports.hexToRgbString = hexToRgbString;
4045
4031
  exports.inputKindDefaults = inputKindDefaults;
4046
4032
  exports.rgbToHex = rgbToHex;
4047
4033
  exports.tokensToCssVars = tokensToCssVars;
4048
4034
  exports.useBreakpoint = useBreakpoint;
4035
+ exports.useFloatingSide = useFloatingSide;
4049
4036
  exports.useMultiSelectContext = useMultiSelectContext;
4050
4037
  exports.useSelectContext = useSelectContext;
4051
4038
  exports.useSizeStyle = useSizeStyle;
4039
+ exports.useStateTransition = useStateTransition;
4052
4040
  exports.useTheme = useTheme;
4041
+ exports.useTypography = useTypography;
4053
4042
  //# sourceMappingURL=index.cjs.map
4054
4043
  //# sourceMappingURL=index.cjs.map