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