@splenddev/kreativ-ui 0.2.5 → 0.2.7
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/README.md +1586 -128
- package/dist/index.cjs +347 -335
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +197 -10
- package/dist/index.d.ts +197 -10
- package/dist/index.js +328 -335
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -300,6 +300,177 @@ 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/typography/defineTypography.ts
|
|
376
|
+
function defineTypography(typography) {
|
|
377
|
+
return typography;
|
|
378
|
+
}
|
|
379
|
+
__name(defineTypography, "defineTypography");
|
|
380
|
+
|
|
381
|
+
// src/theme/token/defineToken.ts
|
|
382
|
+
function defineToken(value) {
|
|
383
|
+
return {
|
|
384
|
+
value
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
__name(defineToken, "defineToken");
|
|
388
|
+
function defineSemanticToken(light, dark) {
|
|
389
|
+
return { value: { light, dark } };
|
|
390
|
+
}
|
|
391
|
+
__name(defineSemanticToken, "defineSemanticToken");
|
|
392
|
+
var BREAKPOINTS = {
|
|
393
|
+
sm: 640,
|
|
394
|
+
md: 768,
|
|
395
|
+
lg: 1024,
|
|
396
|
+
xl: 1280,
|
|
397
|
+
"2xl": 1536
|
|
398
|
+
};
|
|
399
|
+
function useBreakpoint(breakpoint) {
|
|
400
|
+
const query = `(min-width: ${BREAKPOINTS[breakpoint]}px)`;
|
|
401
|
+
const [matches, setMatches] = useState(
|
|
402
|
+
() => typeof window !== "undefined" && window.matchMedia(query).matches
|
|
403
|
+
);
|
|
404
|
+
useEffect(() => {
|
|
405
|
+
const mql = window.matchMedia(query);
|
|
406
|
+
const listener = /* @__PURE__ */ __name((e) => setMatches(e.matches), "listener");
|
|
407
|
+
mql.addEventListener("change", listener);
|
|
408
|
+
setMatches(mql.matches);
|
|
409
|
+
return () => mql.removeEventListener("change", listener);
|
|
410
|
+
}, [query]);
|
|
411
|
+
return matches;
|
|
412
|
+
}
|
|
413
|
+
__name(useBreakpoint, "useBreakpoint");
|
|
414
|
+
var VIEWPORT_PADDING = 8;
|
|
415
|
+
function useFloatingSide(triggerRef, open) {
|
|
416
|
+
const contentRef = useRef(null);
|
|
417
|
+
const [side, setSide] = useState("bottom");
|
|
418
|
+
useLayoutEffect(() => {
|
|
419
|
+
if (!open) return;
|
|
420
|
+
const trigger = triggerRef.current;
|
|
421
|
+
const content = contentRef.current;
|
|
422
|
+
if (!trigger || !content) return;
|
|
423
|
+
function measure() {
|
|
424
|
+
const triggerRect = trigger.getBoundingClientRect();
|
|
425
|
+
const contentHeight = content.offsetHeight;
|
|
426
|
+
const spaceBelow = window.innerHeight - triggerRect.bottom - VIEWPORT_PADDING;
|
|
427
|
+
const spaceAbove = triggerRect.top - VIEWPORT_PADDING;
|
|
428
|
+
setSide(contentHeight > spaceBelow && spaceAbove > spaceBelow ? "top" : "bottom");
|
|
429
|
+
}
|
|
430
|
+
__name(measure, "measure");
|
|
431
|
+
measure();
|
|
432
|
+
window.addEventListener("resize", measure);
|
|
433
|
+
window.addEventListener("scroll", measure, true);
|
|
434
|
+
return () => {
|
|
435
|
+
window.removeEventListener("resize", measure);
|
|
436
|
+
window.removeEventListener("scroll", measure, true);
|
|
437
|
+
};
|
|
438
|
+
}, [open, triggerRef]);
|
|
439
|
+
return { contentRef, side };
|
|
440
|
+
}
|
|
441
|
+
__name(useFloatingSide, "useFloatingSide");
|
|
442
|
+
var TRANSITION_DURATION = 1500;
|
|
443
|
+
function useStateTransition(state) {
|
|
444
|
+
const previousState = useRef(state);
|
|
445
|
+
const [transitionState, setTransitionState] = useState();
|
|
446
|
+
useEffect(() => {
|
|
447
|
+
if (state === previousState.current) {
|
|
448
|
+
return;
|
|
449
|
+
}
|
|
450
|
+
previousState.current = state;
|
|
451
|
+
if (state === "none") {
|
|
452
|
+
setTransitionState(void 0);
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
setTransitionState(state);
|
|
456
|
+
const timeout = window.setTimeout(() => {
|
|
457
|
+
setTransitionState(void 0);
|
|
458
|
+
}, TRANSITION_DURATION);
|
|
459
|
+
return () => window.clearTimeout(timeout);
|
|
460
|
+
}, [state]);
|
|
461
|
+
return transitionState;
|
|
462
|
+
}
|
|
463
|
+
__name(useStateTransition, "useStateTransition");
|
|
464
|
+
|
|
465
|
+
// src/hooks/useTypography.ts
|
|
466
|
+
function useTypography(name) {
|
|
467
|
+
const { theme } = useTheme();
|
|
468
|
+
return resolveTypography(
|
|
469
|
+
name ? theme.typography[name] : void 0,
|
|
470
|
+
theme.tokens
|
|
471
|
+
);
|
|
472
|
+
}
|
|
473
|
+
__name(useTypography, "useTypography");
|
|
303
474
|
var ACTIVATION_KEYS = /* @__PURE__ */ new Set(["Enter", " "]);
|
|
304
475
|
var Button = forwardRef(
|
|
305
476
|
({
|
|
@@ -311,6 +482,7 @@ var Button = forwardRef(
|
|
|
311
482
|
rightIcon,
|
|
312
483
|
fullWidth = false,
|
|
313
484
|
disabled,
|
|
485
|
+
typography: typographyName = "body",
|
|
314
486
|
className,
|
|
315
487
|
style,
|
|
316
488
|
iconOnly,
|
|
@@ -321,6 +493,7 @@ var Button = forwardRef(
|
|
|
321
493
|
...rest
|
|
322
494
|
}, ref) => {
|
|
323
495
|
const { theme } = useTheme();
|
|
496
|
+
const typography = useTypography(typographyName);
|
|
324
497
|
const { style: sizeStyle, iconSize } = useSizeStyle(
|
|
325
498
|
size,
|
|
326
499
|
iconOnly,
|
|
@@ -354,6 +527,7 @@ var Button = forwardRef(
|
|
|
354
527
|
className
|
|
355
528
|
);
|
|
356
529
|
const resolvedStyle = {
|
|
530
|
+
...typography,
|
|
357
531
|
...sizeStyle,
|
|
358
532
|
...style
|
|
359
533
|
};
|
|
@@ -409,33 +583,6 @@ var Button = forwardRef(
|
|
|
409
583
|
}
|
|
410
584
|
);
|
|
411
585
|
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
586
|
var defaultTransition = {
|
|
440
587
|
type: "none",
|
|
441
588
|
duration: 300,
|
|
@@ -617,28 +764,6 @@ function ThemeToggler({
|
|
|
617
764
|
return /* @__PURE__ */ jsx("div", { role: "group", "aria-label": "Theme selector", className: containerClasses, children: buttons });
|
|
618
765
|
}
|
|
619
766
|
__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
767
|
var inputKindIcons = {
|
|
643
768
|
email: Mail,
|
|
644
769
|
tel: Phone,
|
|
@@ -735,28 +860,6 @@ var inputKindDefaults = {
|
|
|
735
860
|
placeholder: "YYYY-Www"
|
|
736
861
|
}
|
|
737
862
|
};
|
|
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
863
|
var FormFieldContext = createContext(
|
|
761
864
|
null
|
|
762
865
|
);
|
|
@@ -1256,7 +1359,7 @@ var SelectTrigger = forwardRef(
|
|
|
1256
1359
|
}
|
|
1257
1360
|
);
|
|
1258
1361
|
SelectTrigger.displayName = "SelectTrigger";
|
|
1259
|
-
var
|
|
1362
|
+
var VIEWPORT_PADDING2 = 8;
|
|
1260
1363
|
function SelectContent({
|
|
1261
1364
|
className,
|
|
1262
1365
|
children,
|
|
@@ -1273,8 +1376,8 @@ function SelectContent({
|
|
|
1273
1376
|
function measure() {
|
|
1274
1377
|
const triggerRect = trigger.getBoundingClientRect();
|
|
1275
1378
|
const contentHeight = content?.offsetHeight;
|
|
1276
|
-
const spaceBelow = window.innerHeight - triggerRect.bottom -
|
|
1277
|
-
const spaceAbove = triggerRect.top -
|
|
1379
|
+
const spaceBelow = window.innerHeight - triggerRect.bottom - VIEWPORT_PADDING2;
|
|
1380
|
+
const spaceAbove = triggerRect.top - VIEWPORT_PADDING2;
|
|
1278
1381
|
setSide(
|
|
1279
1382
|
contentHeight && contentHeight > spaceBelow && spaceAbove > spaceBelow ? "top" : "bottom"
|
|
1280
1383
|
);
|
|
@@ -2723,34 +2826,6 @@ function ComboboxItem({
|
|
|
2723
2826
|
);
|
|
2724
2827
|
}
|
|
2725
2828
|
__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
2829
|
function ComboboxContent({
|
|
2755
2830
|
className,
|
|
2756
2831
|
children
|
|
@@ -3310,235 +3385,185 @@ MultiSelect.Item = MultiSelectItem;
|
|
|
3310
3385
|
var defaultTokens = {
|
|
3311
3386
|
colors: {
|
|
3312
3387
|
blue: {
|
|
3313
|
-
300:
|
|
3314
|
-
400:
|
|
3315
|
-
500:
|
|
3316
|
-
600:
|
|
3388
|
+
300: defineToken("#5EA6ED"),
|
|
3389
|
+
400: defineToken("#4799EB"),
|
|
3390
|
+
500: defineToken("#1A80E6"),
|
|
3391
|
+
600: defineToken("#1773CF")
|
|
3317
3392
|
},
|
|
3318
3393
|
red: {
|
|
3319
|
-
300:
|
|
3320
|
-
400:
|
|
3321
|
-
500:
|
|
3322
|
-
600:
|
|
3394
|
+
300: defineToken("#EB4747"),
|
|
3395
|
+
400: defineToken("#E83030"),
|
|
3396
|
+
500: defineToken("#E61A1A"),
|
|
3397
|
+
600: defineToken("#CF1717")
|
|
3323
3398
|
},
|
|
3324
3399
|
green: {
|
|
3325
|
-
300:
|
|
3326
|
-
400:
|
|
3327
|
-
500:
|
|
3328
|
-
600:
|
|
3400
|
+
300: defineToken("#26D997"),
|
|
3401
|
+
400: defineToken("#22C388"),
|
|
3402
|
+
500: defineToken("#16A249"),
|
|
3403
|
+
600: defineToken("#12875C")
|
|
3329
3404
|
},
|
|
3330
3405
|
amber: {
|
|
3331
|
-
300:
|
|
3332
|
-
400:
|
|
3333
|
-
500:
|
|
3334
|
-
600:
|
|
3406
|
+
300: defineToken("#F7B23B"),
|
|
3407
|
+
400: defineToken("#F6A823"),
|
|
3408
|
+
500: defineToken("#F59F0A"),
|
|
3409
|
+
600: defineToken("#D38909")
|
|
3335
3410
|
},
|
|
3336
3411
|
cyan: {
|
|
3337
|
-
300:
|
|
3338
|
-
400:
|
|
3339
|
-
500:
|
|
3340
|
-
600:
|
|
3412
|
+
300: defineToken("#6CC3EF"),
|
|
3413
|
+
400: defineToken("#47B4EB"),
|
|
3414
|
+
500: defineToken("#1791CF"),
|
|
3415
|
+
600: defineToken("#137BAE")
|
|
3341
3416
|
},
|
|
3342
3417
|
gray: {
|
|
3343
|
-
50:
|
|
3344
|
-
100:
|
|
3345
|
-
200:
|
|
3346
|
-
300:
|
|
3347
|
-
400:
|
|
3348
|
-
500:
|
|
3349
|
-
600:
|
|
3350
|
-
700:
|
|
3351
|
-
800:
|
|
3352
|
-
900:
|
|
3353
|
-
950:
|
|
3354
|
-
1e3:
|
|
3355
|
-
},
|
|
3356
|
-
white: {
|
|
3357
|
-
value: "#FFFFFF"
|
|
3418
|
+
50: defineToken("#FAFAFA"),
|
|
3419
|
+
100: defineToken("#EBEBEB"),
|
|
3420
|
+
200: defineToken("#D9D9D9"),
|
|
3421
|
+
300: defineToken("#BDBDBD"),
|
|
3422
|
+
400: defineToken("#999999"),
|
|
3423
|
+
500: defineToken("#666666"),
|
|
3424
|
+
600: defineToken("#4D4D4D"),
|
|
3425
|
+
700: defineToken("#333333"),
|
|
3426
|
+
800: defineToken("#2E2E2E"),
|
|
3427
|
+
900: defineToken("#1F1F1F"),
|
|
3428
|
+
950: defineToken("#141414"),
|
|
3429
|
+
1e3: defineToken("#0A0A0A")
|
|
3358
3430
|
},
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
}
|
|
3431
|
+
white: defineToken("#FFFFFF"),
|
|
3432
|
+
black: defineToken("#000000")
|
|
3362
3433
|
},
|
|
3363
3434
|
spacing: {
|
|
3364
|
-
1:
|
|
3365
|
-
2:
|
|
3366
|
-
3:
|
|
3367
|
-
4:
|
|
3368
|
-
5:
|
|
3369
|
-
6:
|
|
3370
|
-
8:
|
|
3371
|
-
10:
|
|
3372
|
-
12:
|
|
3373
|
-
16:
|
|
3435
|
+
1: defineToken("0.25rem"),
|
|
3436
|
+
2: defineToken("0.5rem"),
|
|
3437
|
+
3: defineToken("0.75rem"),
|
|
3438
|
+
4: defineToken("1rem"),
|
|
3439
|
+
5: defineToken("1.25rem"),
|
|
3440
|
+
6: defineToken("1.5rem"),
|
|
3441
|
+
8: defineToken("2rem"),
|
|
3442
|
+
10: defineToken("2.5rem"),
|
|
3443
|
+
12: defineToken("3rem"),
|
|
3444
|
+
16: defineToken("4rem")
|
|
3374
3445
|
},
|
|
3375
3446
|
radii: {
|
|
3376
|
-
none:
|
|
3377
|
-
sm:
|
|
3378
|
-
md:
|
|
3379
|
-
lg:
|
|
3380
|
-
xl:
|
|
3381
|
-
full:
|
|
3447
|
+
none: defineToken("0"),
|
|
3448
|
+
sm: defineToken("0.25rem"),
|
|
3449
|
+
md: defineToken("0.5rem"),
|
|
3450
|
+
lg: defineToken("0.75rem"),
|
|
3451
|
+
xl: defineToken("1rem"),
|
|
3452
|
+
full: defineToken("9999px")
|
|
3382
3453
|
},
|
|
3383
3454
|
fonts: {
|
|
3384
|
-
body:
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
heading: {
|
|
3388
|
-
value: "Inter, sans-serif"
|
|
3389
|
-
},
|
|
3390
|
-
mono: {
|
|
3391
|
-
value: "ui-monospace, SFMono-Regular, Menlo, monospace"
|
|
3392
|
-
}
|
|
3455
|
+
body: defineToken("Inter, sans-serif"),
|
|
3456
|
+
heading: defineToken("Inter, sans-serif"),
|
|
3457
|
+
mono: defineToken("ui-monospace, SFMono-Regular, Menlo, monospace")
|
|
3393
3458
|
},
|
|
3394
3459
|
fontSizes: {
|
|
3395
|
-
xs:
|
|
3396
|
-
sm:
|
|
3397
|
-
md:
|
|
3398
|
-
lg:
|
|
3399
|
-
xl:
|
|
3400
|
-
"2xl":
|
|
3401
|
-
"3xl":
|
|
3402
|
-
"4xl":
|
|
3460
|
+
xs: defineToken("0.75rem"),
|
|
3461
|
+
sm: defineToken("0.875rem"),
|
|
3462
|
+
md: defineToken("1rem"),
|
|
3463
|
+
lg: defineToken("1.125rem"),
|
|
3464
|
+
xl: defineToken("1.25rem"),
|
|
3465
|
+
"2xl": defineToken("1.5rem"),
|
|
3466
|
+
"3xl": defineToken("1.875rem"),
|
|
3467
|
+
"4xl": defineToken("2.25rem")
|
|
3403
3468
|
},
|
|
3404
3469
|
fontWeights: {
|
|
3405
|
-
normal:
|
|
3406
|
-
medium:
|
|
3407
|
-
semibold:
|
|
3408
|
-
bold:
|
|
3470
|
+
normal: defineToken("400"),
|
|
3471
|
+
medium: defineToken("500"),
|
|
3472
|
+
semibold: defineToken("600"),
|
|
3473
|
+
bold: defineToken("700")
|
|
3409
3474
|
},
|
|
3410
3475
|
lineHeights: {
|
|
3411
|
-
tight:
|
|
3412
|
-
normal:
|
|
3413
|
-
relaxed:
|
|
3476
|
+
tight: defineToken("1.25"),
|
|
3477
|
+
normal: defineToken("1.5"),
|
|
3478
|
+
relaxed: defineToken("1.75")
|
|
3414
3479
|
},
|
|
3415
3480
|
letterSpacings: {
|
|
3416
|
-
tighter:
|
|
3417
|
-
tight:
|
|
3418
|
-
normal:
|
|
3419
|
-
wide:
|
|
3481
|
+
tighter: defineToken("-0.025em"),
|
|
3482
|
+
tight: defineToken("-0.01em"),
|
|
3483
|
+
normal: defineToken("0"),
|
|
3484
|
+
wide: defineToken("0.025em")
|
|
3420
3485
|
},
|
|
3421
3486
|
animations: {
|
|
3422
|
-
"slide-in-right":
|
|
3423
|
-
value: "slide-in-right 0.5s ease-in-out"
|
|
3424
|
-
}
|
|
3487
|
+
"slide-in-right": defineToken("slide-in-right 0.5s ease-in-out")
|
|
3425
3488
|
}
|
|
3426
3489
|
};
|
|
3427
3490
|
|
|
3428
3491
|
// src/theme/defaults/semanticTokens.ts
|
|
3429
3492
|
var defaultSemanticTokens = {
|
|
3430
3493
|
colors: {
|
|
3431
|
-
brand: {
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
},
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
},
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
},
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
},
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
},
|
|
3503
|
-
|
|
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
|
-
}
|
|
3494
|
+
brand: defineSemanticToken("{colors.blue.500}", "{colors.blue.400}"),
|
|
3495
|
+
brandHover: defineSemanticToken("{colors.blue.600}", "{colors.blue.300}"),
|
|
3496
|
+
brandFg: defineToken("{colors.white}"),
|
|
3497
|
+
surface: defineSemanticToken("{colors.gray.50}", "{colors.gray.900}"),
|
|
3498
|
+
surfaceRaised: defineSemanticToken("{colors.white}", "{colors.gray.800}"),
|
|
3499
|
+
surfaceSunken: defineSemanticToken(
|
|
3500
|
+
"{colors.gray.100}",
|
|
3501
|
+
"{colors.gray.950}"
|
|
3502
|
+
),
|
|
3503
|
+
border: defineSemanticToken("{colors.gray.200}", "{colors.gray.600}"),
|
|
3504
|
+
text: defineSemanticToken("{colors.gray.900}", "{colors.gray.50}"),
|
|
3505
|
+
textMuted: defineSemanticToken("{colors.gray.500}", "{colors.gray.400}"),
|
|
3506
|
+
destructive: defineSemanticToken("{colors.red.500}", "{colors.red.400}"),
|
|
3507
|
+
destructiveFg: defineToken("{colors.white}"),
|
|
3508
|
+
destructiveHover: defineSemanticToken(
|
|
3509
|
+
"{colors.red.600}",
|
|
3510
|
+
"{colors.red.300}"
|
|
3511
|
+
),
|
|
3512
|
+
success: defineSemanticToken("{colors.green.500}", "{colors.green.400}"),
|
|
3513
|
+
successFg: defineToken("{colors.white}"),
|
|
3514
|
+
successHover: defineSemanticToken(
|
|
3515
|
+
"{colors.green.600}",
|
|
3516
|
+
"{colors.green.300}"
|
|
3517
|
+
),
|
|
3518
|
+
warning: defineSemanticToken("{colors.amber.500}", "{colors.amber.400}"),
|
|
3519
|
+
warningFg: defineToken("{colors.black}"),
|
|
3520
|
+
warningHover: defineSemanticToken(
|
|
3521
|
+
"{colors.amber.600}",
|
|
3522
|
+
"{colors.amber.300}"
|
|
3523
|
+
),
|
|
3524
|
+
info: defineSemanticToken("{colors.cyan.500}", "{colors.cyan.400}"),
|
|
3525
|
+
infoFg: defineToken("{colors.white}"),
|
|
3526
|
+
infoHover: defineSemanticToken("{colors.cyan.600}", "{colors.cyan.300}")
|
|
3527
|
+
}
|
|
3528
|
+
};
|
|
3529
|
+
|
|
3530
|
+
// src/theme/defaults/typography.ts
|
|
3531
|
+
var defaultTypography = {
|
|
3532
|
+
body: {
|
|
3533
|
+
fontFamily: "{fonts.body}",
|
|
3534
|
+
fontSize: "{fontSizes.md}",
|
|
3535
|
+
fontWeight: "{fontWeights.normal}",
|
|
3536
|
+
lineHeight: "{lineHeights.normal}"
|
|
3537
|
+
},
|
|
3538
|
+
bodySmall: {
|
|
3539
|
+
fontFamily: "{fonts.body}",
|
|
3540
|
+
fontSize: "{fontSizes.sm}",
|
|
3541
|
+
fontWeight: "{fontWeights.normal}",
|
|
3542
|
+
lineHeight: "{lineHeights.normal}"
|
|
3543
|
+
},
|
|
3544
|
+
heading: {
|
|
3545
|
+
fontFamily: "{fonts.heading}",
|
|
3546
|
+
fontSize: "{fontSizes.2xl}",
|
|
3547
|
+
fontWeight: "{fontWeights.bold}",
|
|
3548
|
+
lineHeight: "{lineHeights.tight}"
|
|
3549
|
+
},
|
|
3550
|
+
headingSmall: {
|
|
3551
|
+
fontFamily: "{fonts.heading}",
|
|
3552
|
+
fontSize: "{fontSizes.xl}",
|
|
3553
|
+
fontWeight: "{fontWeights.semibold}",
|
|
3554
|
+
lineHeight: "{lineHeights.tight}"
|
|
3555
|
+
},
|
|
3556
|
+
caption: {
|
|
3557
|
+
fontFamily: "{fonts.body}",
|
|
3558
|
+
fontSize: "{fontSizes.xs}",
|
|
3559
|
+
fontWeight: "{fontWeights.normal}",
|
|
3560
|
+
lineHeight: "{lineHeights.normal}"
|
|
3561
|
+
},
|
|
3562
|
+
mono: {
|
|
3563
|
+
fontFamily: "{fonts.mono}",
|
|
3564
|
+
fontSize: "{fontSizes.xs}",
|
|
3565
|
+
fontWeight: "{fontWeights.normal}",
|
|
3566
|
+
lineHeight: "{lineHeights.normal}"
|
|
3542
3567
|
}
|
|
3543
3568
|
};
|
|
3544
3569
|
|
|
@@ -3577,38 +3602,6 @@ var defaultSizes = {
|
|
|
3577
3602
|
radius: "1.15rem"
|
|
3578
3603
|
}
|
|
3579
3604
|
};
|
|
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
3605
|
var defaultRecipes = {
|
|
3613
3606
|
Button: buttonRecipe,
|
|
3614
3607
|
FormControl: formControlRecipe,
|
|
@@ -3617,7 +3610,7 @@ var defaultRecipes = {
|
|
|
3617
3610
|
var defaultTheme = {
|
|
3618
3611
|
tokens: defaultTokens,
|
|
3619
3612
|
semanticTokens: defaultSemanticTokens,
|
|
3620
|
-
|
|
3613
|
+
typography: defaultTypography,
|
|
3621
3614
|
recipes: defaultRecipes,
|
|
3622
3615
|
intensity: 50,
|
|
3623
3616
|
sizes: defaultSizes
|
|
@@ -3891,10 +3884,10 @@ function mergeSemanticTokens(base, override) {
|
|
|
3891
3884
|
return deepMerge(base, override);
|
|
3892
3885
|
}
|
|
3893
3886
|
__name(mergeSemanticTokens, "mergeSemanticTokens");
|
|
3894
|
-
function
|
|
3887
|
+
function mergeTypography(base, override) {
|
|
3895
3888
|
return deepMerge(base, override);
|
|
3896
3889
|
}
|
|
3897
|
-
__name(
|
|
3890
|
+
__name(mergeTypography, "mergeTypography");
|
|
3898
3891
|
function mergeSizes(base, override) {
|
|
3899
3892
|
if (!override) {
|
|
3900
3893
|
return base;
|
|
@@ -3923,7 +3916,7 @@ function mergeTheme(base, override) {
|
|
|
3923
3916
|
base.semanticTokens,
|
|
3924
3917
|
override.semanticTokens
|
|
3925
3918
|
),
|
|
3926
|
-
|
|
3919
|
+
typography: mergeTypography(base.typography, override.typography),
|
|
3927
3920
|
recipes: mergeRecipes(base.recipes, override.recipes),
|
|
3928
3921
|
intensity: override.intensity ?? base.intensity,
|
|
3929
3922
|
sizes: mergeSizes(base.sizes, override.sizes)
|
|
@@ -3999,6 +3992,6 @@ function UIProvider({
|
|
|
3999
3992
|
}
|
|
4000
3993
|
__name(UIProvider, "UIProvider");
|
|
4001
3994
|
|
|
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,
|
|
3995
|
+
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, buttonBase, buttonColors, buttonRecipe, buttonVariants, cn, defaultRecipes, defaultSizes, defaultTheme, defineRecipe, defineSemanticToken, defineToken, defineTypography, formControlBase, formControlRecipe, formControlStates, formControlVariants, hexToRgbString, inputBase, inputKindDefaults, inputRecipe, mergeRecipes, resolveRecipe, resolveTypography, rgbToHex, tokensToCssVars, useBreakpoint, useFloatingSide, useMultiSelectContext, useSelectContext, useSizeStyle, useStateTransition, useTheme, useTypography };
|
|
4003
3996
|
//# sourceMappingURL=index.js.map
|
|
4004
3997
|
//# sourceMappingURL=index.js.map
|