@vaneui/ui 0.3.1-alpha.20250925201320.8b6a424 → 0.3.1-alpha.20250927164620.fec55bc
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/components/ui/classes/layoutClasses.d.ts +1 -8
- package/dist/components/ui/classes/layoutClasses.d.ts.map +1 -1
- package/dist/components/ui/theme/badgeTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/buttonTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/cardTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/checkboxTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/chipTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/codeTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/colTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/common/ComponentTheme.d.ts +2 -0
- package/dist/components/ui/theme/common/ComponentTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/containerTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/gridTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/inputTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/layout/radiusTheme.d.ts +3 -1
- package/dist/components/ui/theme/layout/radiusTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/rowTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/sectionTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/size/gapTheme.d.ts +7 -7
- package/dist/components/ui/theme/size/gapTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/size/pxTheme.d.ts +1 -1
- package/dist/components/ui/theme/size/pxTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/stackTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/typography/lineHeightTheme.d.ts +21 -0
- package/dist/components/ui/theme/typography/lineHeightTheme.d.ts.map +1 -0
- package/dist/components/ui/theme/typographyTheme.d.ts +2 -1
- package/dist/components/ui/theme/typographyTheme.d.ts.map +1 -1
- package/dist/index.esm.js +201 -189
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +201 -189
- package/dist/index.js.map +1 -1
- package/dist/ui.css +64 -109
- package/dist/vars.css +11 -1
- package/package.json +1 -1
- package/dist/components/ui/classes/radiusClasses.d.ts +0 -4
- package/dist/components/ui/classes/radiusClasses.d.ts.map +0 -1
package/dist/index.esm.js
CHANGED
|
@@ -751,6 +751,64 @@ class TextAlignTheme extends BaseTheme {
|
|
|
751
751
|
}
|
|
752
752
|
}
|
|
753
753
|
|
|
754
|
+
class LineHeightTheme extends BaseTheme {
|
|
755
|
+
constructor(customMapping) {
|
|
756
|
+
super();
|
|
757
|
+
/** Extra-small line height - matches text-xs default line height */
|
|
758
|
+
this.xs = "[--lh-unit:1.333]"; // calc(1 / 0.75) ≈ 1.333
|
|
759
|
+
/** Small line height - matches text-sm default line height */
|
|
760
|
+
this.sm = "[--lh-unit:1.429]"; // calc(1.25 / 0.875) ≈ 1.429
|
|
761
|
+
/** Medium line height - matches text-base default line height */
|
|
762
|
+
this.md = "[--lh-unit:1.5]"; // calc(1.5 / 1) = 1.5
|
|
763
|
+
/** Large line height - matches text-lg default line height */
|
|
764
|
+
this.lg = "[--lh-unit:1.556]"; // calc(1.75 / 1.125) ≈ 1.556
|
|
765
|
+
/** Extra-large line height - matches text-xl default line height */
|
|
766
|
+
this.xl = "[--lh-unit:1.4]"; // calc(1.75 / 1.25) = 1.4
|
|
767
|
+
if (customMapping) {
|
|
768
|
+
this.xs = customMapping.xs || this.xs;
|
|
769
|
+
this.sm = customMapping.sm || this.sm;
|
|
770
|
+
this.md = customMapping.md || this.md;
|
|
771
|
+
this.lg = customMapping.lg || this.lg;
|
|
772
|
+
this.xl = customMapping.xl || this.xl;
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
getClasses(extractedKeys) {
|
|
776
|
+
if (extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.size) {
|
|
777
|
+
const lhUnitClass = this[extractedKeys.size];
|
|
778
|
+
return lhUnitClass ? [lhUnitClass, "leading-(--lh)"] : [];
|
|
779
|
+
}
|
|
780
|
+
return [this.md, "leading-(--lh)"];
|
|
781
|
+
}
|
|
782
|
+
// Static factory methods for different text size ranges
|
|
783
|
+
static createForSectionTitle() {
|
|
784
|
+
return new LineHeightTheme({
|
|
785
|
+
xs: "[--lh-unit:1.333]", // text-2xl: calc(2 / 1.5) ≈ 1.333
|
|
786
|
+
sm: "[--lh-unit:1.2]", // text-3xl: calc(2.25 / 1.875) = 1.2
|
|
787
|
+
md: "[--lh-unit:1.111]", // text-4xl: calc(2.5 / 2.25) ≈ 1.111
|
|
788
|
+
lg: "[--lh-unit:1]", // text-5xl: 1
|
|
789
|
+
xl: "[--lh-unit:1]" // text-6xl+: 1
|
|
790
|
+
});
|
|
791
|
+
}
|
|
792
|
+
static createForPageTitle() {
|
|
793
|
+
return new LineHeightTheme({
|
|
794
|
+
xs: "[--lh-unit:1.2]", // text-3xl: calc(2.25 / 1.875) = 1.2
|
|
795
|
+
sm: "[--lh-unit:1.111]", // text-4xl: calc(2.5 / 2.25) ≈ 1.111
|
|
796
|
+
md: "[--lh-unit:1]", // text-5xl: 1
|
|
797
|
+
lg: "[--lh-unit:1]", // text-6xl: 1
|
|
798
|
+
xl: "[--lh-unit:1]" // text-7xl: 1
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
static createForTitle() {
|
|
802
|
+
return new LineHeightTheme({
|
|
803
|
+
xs: "[--lh-unit:1.556]", // text-lg: calc(1.75 / 1.125) ≈ 1.556
|
|
804
|
+
sm: "[--lh-unit:1.4]", // text-xl: calc(1.75 / 1.25) = 1.4
|
|
805
|
+
md: "[--lh-unit:1.333]", // text-2xl: calc(2 / 1.5) ≈ 1.333
|
|
806
|
+
lg: "[--lh-unit:1.2]", // text-3xl: calc(2.25 / 1.875) = 1.2
|
|
807
|
+
xl: "[--lh-unit:1.111]" // text-4xl: calc(2.5 / 2.25) ≈ 1.111
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
|
|
754
812
|
class DisplayTheme extends BaseTheme {
|
|
755
813
|
constructor() {
|
|
756
814
|
super(...arguments);
|
|
@@ -3569,7 +3627,8 @@ const defaultTypographyThemes = {
|
|
|
3569
3627
|
fontStyle: new FontStyleTheme(),
|
|
3570
3628
|
textDecoration: new TextDecorationTheme(),
|
|
3571
3629
|
textTransform: new TextTransformTheme(),
|
|
3572
|
-
textAlign: new TextAlignTheme()
|
|
3630
|
+
textAlign: new TextAlignTheme(),
|
|
3631
|
+
lineHeight: new LineHeightTheme()
|
|
3573
3632
|
};
|
|
3574
3633
|
class ComponentTheme {
|
|
3575
3634
|
constructor(tag, base, themes, defaults = {}, categories, tagFunction) {
|
|
@@ -3677,6 +3736,7 @@ class SizeTheme extends BaseTheme {
|
|
|
3677
3736
|
}
|
|
3678
3737
|
}
|
|
3679
3738
|
|
|
3739
|
+
// Reusable layout classes used by multiple components
|
|
3680
3740
|
const layoutGapClasses = {
|
|
3681
3741
|
xs: "[--gap-unit:2]",
|
|
3682
3742
|
sm: "[--gap-unit:3]",
|
|
@@ -3691,14 +3751,7 @@ const layoutPaddingClasses = {
|
|
|
3691
3751
|
lg: "[--py-unit:5]",
|
|
3692
3752
|
xl: "[--py-unit:6]",
|
|
3693
3753
|
};
|
|
3694
|
-
|
|
3695
|
-
xs: "[--aspect-ratio:2.5]",
|
|
3696
|
-
sm: "[--aspect-ratio:2]",
|
|
3697
|
-
md: "[--aspect-ratio:1.75]",
|
|
3698
|
-
lg: "[--aspect-ratio:1.6]",
|
|
3699
|
-
xl: "[--aspect-ratio:1.5]",
|
|
3700
|
-
};
|
|
3701
|
-
// UI component classes
|
|
3754
|
+
// Reusable UI component classes used by multiple components
|
|
3702
3755
|
const uiPaddingClasses = {
|
|
3703
3756
|
xs: "[--py-unit:1]",
|
|
3704
3757
|
sm: "[--py-unit:1.5]",
|
|
@@ -3706,123 +3759,72 @@ const uiPaddingClasses = {
|
|
|
3706
3759
|
lg: "[--py-unit:2.5]",
|
|
3707
3760
|
xl: "[--py-unit:3]",
|
|
3708
3761
|
};
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
xl: "[--aspect-ratio:2]", // px-6 vs py-3 = 2
|
|
3716
|
-
};
|
|
3717
|
-
// Badge aspect ratios (same as button)
|
|
3718
|
-
const badgeAspectRatioClasses = {
|
|
3719
|
-
xs: "[--aspect-ratio:2]",
|
|
3720
|
-
sm: "[--aspect-ratio:2]",
|
|
3721
|
-
md: "[--aspect-ratio:2]",
|
|
3722
|
-
lg: "[--aspect-ratio:2]",
|
|
3723
|
-
xl: "[--aspect-ratio:2]",
|
|
3724
|
-
};
|
|
3725
|
-
// Input aspect ratios (same as button)
|
|
3726
|
-
const inputAspectRatioClasses = {
|
|
3727
|
-
xs: "[--aspect-ratio:2]",
|
|
3728
|
-
sm: "[--aspect-ratio:2]",
|
|
3729
|
-
md: "[--aspect-ratio:2]",
|
|
3730
|
-
lg: "[--aspect-ratio:2]",
|
|
3731
|
-
xl: "[--aspect-ratio:2]",
|
|
3732
|
-
};
|
|
3733
|
-
// Code-specific classes (px-1,1.5,1.5,2,2 vs py-0,0.5,1,1,1)
|
|
3734
|
-
const codeAspectRatioClasses = {
|
|
3735
|
-
xs: "[--aspect-ratio:1]", // px-1 vs py-0 (but py-0 is 0, so use py-unit but ratio for px)
|
|
3736
|
-
sm: "[--aspect-ratio:3]", // px-1.5 vs py-0.5 = 3
|
|
3737
|
-
md: "[--aspect-ratio:1.5]", // px-1.5 vs py-1 = 1.5
|
|
3738
|
-
lg: "[--aspect-ratio:2]", // px-2 vs py-1 = 2
|
|
3739
|
-
xl: "[--aspect-ratio:2]", // px-2 vs py-1 = 2
|
|
3740
|
-
};
|
|
3741
|
-
const codePyClasses = {
|
|
3742
|
-
xs: "[--py-unit:0]",
|
|
3743
|
-
sm: "[--py-unit:0.5]",
|
|
3744
|
-
md: "[--py-unit:1]",
|
|
3745
|
-
lg: "[--py-unit:1]",
|
|
3746
|
-
xl: "[--py-unit:1]",
|
|
3747
|
-
};
|
|
3748
|
-
// Chip-specific classes (px-2,2.5,3,3.5,4 vs py-0.5,1,1.5,2,2.5)
|
|
3749
|
-
const chipAspectRatioClasses = {
|
|
3750
|
-
xs: "[--aspect-ratio:4]", // px-2 vs py-0.5 = 4
|
|
3751
|
-
sm: "[--aspect-ratio:2.5]", // px-2.5 vs py-1 = 2.5
|
|
3752
|
-
md: "[--aspect-ratio:2]", // px-3 vs py-1.5 = 2
|
|
3753
|
-
lg: "[--aspect-ratio:1.75]", // px-3.5 vs py-2 = 1.75
|
|
3754
|
-
xl: "[--aspect-ratio:1.6]", // px-4 vs py-2.5 = 1.6
|
|
3755
|
-
};
|
|
3756
|
-
const chipPyClasses = {
|
|
3757
|
-
xs: "[--py-unit:0.5]",
|
|
3758
|
-
sm: "[--py-unit:1]",
|
|
3759
|
-
md: "[--py-unit:1.5]",
|
|
3760
|
-
lg: "[--py-unit:2]",
|
|
3761
|
-
xl: "[--py-unit:2.5]",
|
|
3762
|
+
const uiGapClasses = {
|
|
3763
|
+
xs: "[--gap-unit:1]",
|
|
3764
|
+
sm: "[--gap-unit:1.5]",
|
|
3765
|
+
md: "[--gap-unit:2]",
|
|
3766
|
+
lg: "[--gap-unit:2.5]",
|
|
3767
|
+
xl: "[--gap-unit:3]",
|
|
3762
3768
|
};
|
|
3763
3769
|
|
|
3764
3770
|
class GapTheme extends BaseTheme {
|
|
3765
|
-
constructor(
|
|
3771
|
+
constructor(isUIComponent = false) {
|
|
3766
3772
|
super();
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
this.sm =
|
|
3771
|
-
|
|
3772
|
-
this.
|
|
3773
|
-
|
|
3774
|
-
this.lg = layoutGapClasses.lg;
|
|
3775
|
-
/** Extra-large gap - uses CSS variable --layout-gap-xl */
|
|
3776
|
-
this.xl = layoutGapClasses.xl;
|
|
3777
|
-
this.isUIComponent = isUIComponent;
|
|
3778
|
-
if (sizeMap) {
|
|
3779
|
-
ComponentKeys.size.forEach((key) => {
|
|
3780
|
-
if (sizeMap[key] !== undefined) {
|
|
3781
|
-
this[key] = sizeMap[key];
|
|
3782
|
-
}
|
|
3783
|
-
});
|
|
3784
|
-
}
|
|
3773
|
+
this.gapVarClass = isUIComponent ? "gap-(--ui-gap)" : "gap-(--gap)";
|
|
3774
|
+
const gapClasses = isUIComponent ? uiGapClasses : layoutGapClasses;
|
|
3775
|
+
this.xs = gapClasses.xs;
|
|
3776
|
+
this.sm = gapClasses.sm;
|
|
3777
|
+
this.md = gapClasses.md;
|
|
3778
|
+
this.lg = gapClasses.lg;
|
|
3779
|
+
this.xl = gapClasses.xl;
|
|
3785
3780
|
}
|
|
3786
3781
|
getClasses(extractedKeys) {
|
|
3787
3782
|
var _a;
|
|
3788
3783
|
if ((extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.gap) === 'gap') {
|
|
3789
3784
|
const gapClass = this[(_a = extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.size) !== null && _a !== void 0 ? _a : 'md'];
|
|
3790
|
-
|
|
3791
|
-
return gapClass ? [gapClass, gapVar] : [];
|
|
3785
|
+
return gapClass ? [gapClass, this.gapVarClass] : [];
|
|
3792
3786
|
}
|
|
3793
3787
|
return [];
|
|
3794
3788
|
}
|
|
3795
3789
|
}
|
|
3796
3790
|
|
|
3797
|
-
const uiBorderRadiusClasses = {
|
|
3798
|
-
xs: "rounded-(--ui-br-xs)",
|
|
3799
|
-
sm: "rounded-(--ui-br-sm)",
|
|
3800
|
-
md: "rounded-(--ui-br-md)",
|
|
3801
|
-
lg: "rounded-(--ui-br-lg)",
|
|
3802
|
-
xl: "rounded-(--ui-br-xl)",
|
|
3803
|
-
};
|
|
3804
|
-
const layoutBorderRadiusClasses = {
|
|
3805
|
-
xs: "rounded-(--layout-br-xs)",
|
|
3806
|
-
sm: "rounded-(--layout-br-sm)",
|
|
3807
|
-
md: "rounded-(--layout-br-md)",
|
|
3808
|
-
lg: "rounded-(--layout-br-lg)",
|
|
3809
|
-
xl: "rounded-(--layout-br-xl)",
|
|
3810
|
-
};
|
|
3811
|
-
|
|
3812
3791
|
class RadiusTheme extends BaseTheme {
|
|
3813
|
-
constructor(roundedClasses) {
|
|
3792
|
+
constructor(roundedClasses, isUIComponent = false) {
|
|
3814
3793
|
super();
|
|
3815
3794
|
/** Pill shape - fully rounded corners */
|
|
3816
3795
|
this.pill = "rounded-full";
|
|
3817
3796
|
/** Sharp shape - no rounded corners */
|
|
3818
3797
|
this.sharp = "rounded-none";
|
|
3819
3798
|
this.rounded = roundedClasses;
|
|
3799
|
+
this.isUIComponent = isUIComponent;
|
|
3820
3800
|
}
|
|
3821
|
-
static
|
|
3822
|
-
return new RadiusTheme(
|
|
3801
|
+
static createCheckboxTheme() {
|
|
3802
|
+
return new RadiusTheme({
|
|
3803
|
+
xs: '[--br-unit:1]',
|
|
3804
|
+
sm: '[--br-unit:1.5]',
|
|
3805
|
+
md: '[--br-unit:2]',
|
|
3806
|
+
lg: '[--br-unit:2.5]',
|
|
3807
|
+
xl: '[--br-unit:3]'
|
|
3808
|
+
}, true);
|
|
3809
|
+
}
|
|
3810
|
+
static createUITheme() {
|
|
3811
|
+
return new RadiusTheme({
|
|
3812
|
+
xs: '[--br-unit:1]',
|
|
3813
|
+
sm: '[--br-unit:2]',
|
|
3814
|
+
md: '[--br-unit:3]',
|
|
3815
|
+
lg: '[--br-unit:4]',
|
|
3816
|
+
xl: '[--br-unit:5]'
|
|
3817
|
+
}, true);
|
|
3823
3818
|
}
|
|
3824
3819
|
static createLayoutTheme() {
|
|
3825
|
-
|
|
3820
|
+
const brUnitClasses = {
|
|
3821
|
+
xs: '[--br-unit:3]',
|
|
3822
|
+
sm: '[--br-unit:4]',
|
|
3823
|
+
md: '[--br-unit:5]',
|
|
3824
|
+
lg: '[--br-unit:6]',
|
|
3825
|
+
xl: '[--br-unit:7]'
|
|
3826
|
+
};
|
|
3827
|
+
return new RadiusTheme(brUnitClasses, false);
|
|
3826
3828
|
}
|
|
3827
3829
|
getClasses(extractedKeys) {
|
|
3828
3830
|
var _a, _b;
|
|
@@ -3834,8 +3836,9 @@ class RadiusTheme extends BaseTheme {
|
|
|
3834
3836
|
case 'sharp':
|
|
3835
3837
|
return [this.sharp];
|
|
3836
3838
|
case 'rounded': {
|
|
3837
|
-
const
|
|
3838
|
-
|
|
3839
|
+
const brUnitClass = this.rounded[size];
|
|
3840
|
+
const roundedVar = this.isUIComponent ? "rounded-(--ui-br)" : "rounded-(--br)";
|
|
3841
|
+
return brUnitClass ? [brUnitClass, roundedVar] : [];
|
|
3839
3842
|
}
|
|
3840
3843
|
default:
|
|
3841
3844
|
return [];
|
|
@@ -3952,32 +3955,26 @@ class PaddingTheme extends BaseTheme {
|
|
|
3952
3955
|
|
|
3953
3956
|
/** Horizontal padding theme - controls left and right padding */
|
|
3954
3957
|
class PxTheme extends PaddingTheme {
|
|
3955
|
-
constructor(
|
|
3956
|
-
super(
|
|
3958
|
+
constructor(aspectRatioMap, isUIComponent = false) {
|
|
3959
|
+
super();
|
|
3957
3960
|
this.aspectRatioMap = aspectRatioMap;
|
|
3958
3961
|
this.isUIComponent = isUIComponent;
|
|
3959
|
-
//
|
|
3960
|
-
|
|
3961
|
-
ComponentKeys.size.forEach((key) => {
|
|
3962
|
-
this[key] = layoutPaddingClasses[key];
|
|
3963
|
-
});
|
|
3964
|
-
}
|
|
3962
|
+
// PxTheme should not set any padding classes - that's PyTheme's job
|
|
3963
|
+
// PxTheme only handles aspect-ratio
|
|
3965
3964
|
}
|
|
3966
3965
|
getClasses(extractedKeys) {
|
|
3967
3966
|
var _a, _b;
|
|
3968
3967
|
if ((extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.padding) === 'padding' || (extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.padding) === undefined) {
|
|
3969
3968
|
const size = (_a = extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.size) !== null && _a !== void 0 ? _a : 'md';
|
|
3970
|
-
const paddingClass = this[size];
|
|
3971
3969
|
const aspectRatioClass = (_b = this.aspectRatioMap) === null || _b === void 0 ? void 0 : _b[size];
|
|
3972
3970
|
const classes = [];
|
|
3973
|
-
|
|
3974
|
-
classes.push(paddingClass);
|
|
3971
|
+
// Only add aspect-ratio class - no padding classes
|
|
3975
3972
|
if (aspectRatioClass)
|
|
3976
3973
|
classes.push(aspectRatioClass);
|
|
3977
3974
|
// Use UI or layout CSS variables based on component type
|
|
3978
3975
|
const cssVar = this.isUIComponent ? "px-(--ui-px)" : "px-(--px)";
|
|
3979
3976
|
classes.push(cssVar);
|
|
3980
|
-
return classes
|
|
3977
|
+
return classes;
|
|
3981
3978
|
}
|
|
3982
3979
|
return [];
|
|
3983
3980
|
}
|
|
@@ -4845,11 +4842,19 @@ const themeDefaults = {
|
|
|
4845
4842
|
},
|
|
4846
4843
|
};
|
|
4847
4844
|
|
|
4845
|
+
// Button-specific aspect ratios (px-2,3,4,5,6 vs py-1,1.5,2,2.5,3)
|
|
4846
|
+
const buttonAspectRatioClasses = {
|
|
4847
|
+
xs: "[--aspect-ratio:2]", // px-2 vs py-1 = 2
|
|
4848
|
+
sm: "[--aspect-ratio:2]", // px-3 vs py-1.5 = 2
|
|
4849
|
+
md: "[--aspect-ratio:2]", // px-4 vs py-2 = 2
|
|
4850
|
+
lg: "[--aspect-ratio:2]", // px-5 vs py-2.5 = 2
|
|
4851
|
+
xl: "[--aspect-ratio:2]", // px-6 vs py-3 = 2
|
|
4852
|
+
};
|
|
4848
4853
|
const defaultButtonTheme = new ComponentTheme("button", "w-fit h-fit cursor-pointer transition-all duration-200 whitespace-nowrap", {
|
|
4849
4854
|
size: {
|
|
4850
|
-
px: new PxTheme(
|
|
4855
|
+
px: new PxTheme(buttonAspectRatioClasses, true),
|
|
4851
4856
|
py: new PyTheme(uiPaddingClasses, true),
|
|
4852
|
-
gap: new GapTheme(
|
|
4857
|
+
gap: new GapTheme(true),
|
|
4853
4858
|
text: new SizeTheme({ xs: 'text-xs', sm: 'text-sm', md: 'text-base', lg: 'text-lg', xl: 'text-xl' }),
|
|
4854
4859
|
},
|
|
4855
4860
|
appearance: {
|
|
@@ -4875,11 +4880,19 @@ const defaultButtonTheme = new ComponentTheme("button", "w-fit h-fit cursor-poin
|
|
|
4875
4880
|
return props.href ? "a" : "button";
|
|
4876
4881
|
});
|
|
4877
4882
|
|
|
4883
|
+
// Badge aspect ratios (same as button)
|
|
4884
|
+
const badgeAspectRatioClasses = {
|
|
4885
|
+
xs: "[--aspect-ratio:2]",
|
|
4886
|
+
sm: "[--aspect-ratio:2]",
|
|
4887
|
+
md: "[--aspect-ratio:2]",
|
|
4888
|
+
lg: "[--aspect-ratio:2]",
|
|
4889
|
+
xl: "[--aspect-ratio:2]",
|
|
4890
|
+
};
|
|
4878
4891
|
const defaultBadgeTheme = new ComponentTheme("span", "w-fit h-fit transition-all duration-200 whitespace-nowrap", {
|
|
4879
4892
|
size: {
|
|
4880
|
-
px: new PxTheme(
|
|
4893
|
+
px: new PxTheme(badgeAspectRatioClasses, true),
|
|
4881
4894
|
py: new PyTheme(uiPaddingClasses, true),
|
|
4882
|
-
gap: new GapTheme(
|
|
4895
|
+
gap: new GapTheme(true),
|
|
4883
4896
|
text: new SizeTheme({ xs: 'text-xs', sm: 'text-sm', md: 'text-base', lg: 'text-lg', xl: 'text-xl' })
|
|
4884
4897
|
},
|
|
4885
4898
|
appearance: {
|
|
@@ -4904,12 +4917,26 @@ const defaultBadgeTheme = new ComponentTheme("span", "w-fit h-fit transition-all
|
|
|
4904
4917
|
return props.href ? "a" : "span";
|
|
4905
4918
|
});
|
|
4906
4919
|
|
|
4920
|
+
const chipAspectRatioClasses = {
|
|
4921
|
+
xs: "[--aspect-ratio:2]",
|
|
4922
|
+
sm: "[--aspect-ratio:2]",
|
|
4923
|
+
md: "[--aspect-ratio:2]",
|
|
4924
|
+
lg: "[--aspect-ratio:2]",
|
|
4925
|
+
xl: "[--aspect-ratio:2]",
|
|
4926
|
+
};
|
|
4927
|
+
const chipPyClasses = {
|
|
4928
|
+
xs: "[--py-unit:0.5]",
|
|
4929
|
+
sm: "[--py-unit:1]",
|
|
4930
|
+
md: "[--py-unit:1.5]",
|
|
4931
|
+
lg: "[--py-unit:2]",
|
|
4932
|
+
xl: "[--py-unit:2.5]",
|
|
4933
|
+
};
|
|
4907
4934
|
const defaultChipTheme = new ComponentTheme("span", "w-fit h-fit transition-all duration-200 whitespace-nowrap", {
|
|
4908
4935
|
size: {
|
|
4909
|
-
px: new PxTheme(
|
|
4936
|
+
px: new PxTheme(chipAspectRatioClasses, true),
|
|
4910
4937
|
py: new PyTheme(chipPyClasses, true),
|
|
4911
4938
|
text: new SizeTheme({ xs: 'text-xs', sm: 'text-sm', md: 'text-base', lg: 'text-lg', xl: 'text-xl' }),
|
|
4912
|
-
gap: new GapTheme(
|
|
4939
|
+
gap: new GapTheme(true)
|
|
4913
4940
|
},
|
|
4914
4941
|
appearance: {
|
|
4915
4942
|
background: GenericVariantTheme.createSimpleUIElementBgAppearanceTheme(),
|
|
@@ -4933,12 +4960,26 @@ const defaultChipTheme = new ComponentTheme("span", "w-fit h-fit transition-all
|
|
|
4933
4960
|
return props.href ? "a" : "span";
|
|
4934
4961
|
});
|
|
4935
4962
|
|
|
4963
|
+
const codeAspectRatioClasses = {
|
|
4964
|
+
xs: "[--aspect-ratio:1.5]",
|
|
4965
|
+
sm: "[--aspect-ratio:1.5]",
|
|
4966
|
+
md: "[--aspect-ratio:1.5]",
|
|
4967
|
+
lg: "[--aspect-ratio:1.5]",
|
|
4968
|
+
xl: "[--aspect-ratio:1.5]",
|
|
4969
|
+
};
|
|
4970
|
+
const codePyClasses = {
|
|
4971
|
+
xs: "[--py-unit:0.5]",
|
|
4972
|
+
sm: "[--py-unit:0.5]",
|
|
4973
|
+
md: "[--py-unit:1]",
|
|
4974
|
+
lg: "[--py-unit:1]",
|
|
4975
|
+
xl: "[--py-unit:1]",
|
|
4976
|
+
};
|
|
4936
4977
|
const defaultCodeTheme = new ComponentTheme("code", "", {
|
|
4937
4978
|
size: {
|
|
4938
|
-
px: new PxTheme(
|
|
4979
|
+
px: new PxTheme(codeAspectRatioClasses, true),
|
|
4939
4980
|
py: new PyTheme(codePyClasses, true),
|
|
4940
4981
|
text: new SizeTheme({ xs: 'text-xs', sm: 'text-sm', md: 'text-sm', lg: 'text-base', xl: 'text-lg' }),
|
|
4941
|
-
gap: new GapTheme(
|
|
4982
|
+
gap: new GapTheme(true)
|
|
4942
4983
|
},
|
|
4943
4984
|
appearance: {
|
|
4944
4985
|
background: GenericVariantTheme.createSimpleUIElementBgAppearanceTheme(),
|
|
@@ -5070,7 +5111,10 @@ class ListStyleTheme extends BaseTheme {
|
|
|
5070
5111
|
}
|
|
5071
5112
|
}
|
|
5072
5113
|
|
|
5073
|
-
const createTypographyComponentTheme = (tag, base = "text-balance", textSizeMap = textSizeClasses, defaults = {}) => {
|
|
5114
|
+
const createTypographyComponentTheme = (tag, base = "text-balance", textSizeMap = textSizeClasses, defaults = {}, lineHeightTheme) => {
|
|
5115
|
+
const typographyThemes = lineHeightTheme
|
|
5116
|
+
? { ...defaultTypographyThemes, lineHeight: lineHeightTheme }
|
|
5117
|
+
: defaultTypographyThemes;
|
|
5074
5118
|
return new ComponentTheme(tag, base, {
|
|
5075
5119
|
size: {
|
|
5076
5120
|
text: new SizeTheme(textSizeMap),
|
|
@@ -5078,7 +5122,7 @@ const createTypographyComponentTheme = (tag, base = "text-balance", textSizeMap
|
|
|
5078
5122
|
appearance: {
|
|
5079
5123
|
text: GenericVariantTheme.createTypographyTextTheme(),
|
|
5080
5124
|
},
|
|
5081
|
-
typography:
|
|
5125
|
+
typography: typographyThemes,
|
|
5082
5126
|
layout: defaultLayoutsThemes,
|
|
5083
5127
|
}, defaults, TYPOGRAPHY_CATEGORIES, (props) => {
|
|
5084
5128
|
// Determine tag based on href prop
|
|
@@ -5092,7 +5136,7 @@ const pageTitleTheme = createTypographyComponentTheme("h1", "text-balance tracki
|
|
|
5092
5136
|
md: "text-5xl max-lg:text-4xl max-md:text-3xl",
|
|
5093
5137
|
lg: "text-6xl max-lg:text-5xl max-md:text-4xl",
|
|
5094
5138
|
xl: "text-7xl max-lg:text-6xl max-md:text-5xl"
|
|
5095
|
-
}, mergeDefaults(themeDefaults.pageTitle, { semibold: true }));
|
|
5139
|
+
}, mergeDefaults(themeDefaults.pageTitle, { semibold: true }), LineHeightTheme.createForPageTitle());
|
|
5096
5140
|
// Section title specific theme
|
|
5097
5141
|
const sectionTitleTheme = createTypographyComponentTheme("h2", "text-balance w-fit", {
|
|
5098
5142
|
xs: "text-2xl max-lg:text-xl max-md:text-lg",
|
|
@@ -5100,9 +5144,9 @@ const sectionTitleTheme = createTypographyComponentTheme("h2", "text-balance w-f
|
|
|
5100
5144
|
md: "text-4xl max-lg:text-3xl max-md:text-2xl",
|
|
5101
5145
|
lg: "text-5xl max-lg:text-4xl max-md:text-3xl",
|
|
5102
5146
|
xl: "text-6xl max-lg:text-5xl max-md:text-4xl"
|
|
5103
|
-
}, mergeDefaults(themeDefaults.sectionTitle, { semibold: true }));
|
|
5147
|
+
}, mergeDefaults(themeDefaults.sectionTitle, { semibold: true }), LineHeightTheme.createForSectionTitle());
|
|
5104
5148
|
// Title specific theme
|
|
5105
|
-
const titleTheme = createTypographyComponentTheme("h3", "text-balance w-fit", { xs: "text-lg", sm: "text-xl", md: "text-2xl", lg: "text-3xl", xl: "text-4xl" }, mergeDefaults(themeDefaults.title, { semibold: true }));
|
|
5149
|
+
const titleTheme = createTypographyComponentTheme("h3", "text-balance w-fit", { xs: "text-lg", sm: "text-xl", md: "text-2xl", lg: "text-3xl", xl: "text-4xl" }, mergeDefaults(themeDefaults.title, { semibold: true }), LineHeightTheme.createForTitle());
|
|
5106
5150
|
// Text specific theme
|
|
5107
5151
|
const textTheme = createTypographyComponentTheme("p", "p-0 m-0 w-fit", textSizeClasses, themeDefaults.text);
|
|
5108
5152
|
// Link specific theme
|
|
@@ -5125,6 +5169,7 @@ const listItemTheme = new ComponentTheme("li", "", {
|
|
|
5125
5169
|
text: GenericVariantTheme.createTypographyTextTheme(),
|
|
5126
5170
|
},
|
|
5127
5171
|
typography: defaultTypographyThemes,
|
|
5172
|
+
layout: defaultLayoutsThemes,
|
|
5128
5173
|
}, themeDefaults.listItem, TYPOGRAPHY_CATEGORIES);
|
|
5129
5174
|
// List specific theme
|
|
5130
5175
|
const listTheme = new ComponentTheme("ul", "list-inside", {
|
|
@@ -5169,13 +5214,7 @@ const defaultCardTheme = new ComponentTheme("div", "", {
|
|
|
5169
5214
|
size: {
|
|
5170
5215
|
px: new PxTheme(),
|
|
5171
5216
|
py: new PyTheme(),
|
|
5172
|
-
gap: new GapTheme(
|
|
5173
|
-
xs: "[--gap-unit:1]",
|
|
5174
|
-
sm: "[--gap-unit:1.5]",
|
|
5175
|
-
md: "[--gap-unit:2]",
|
|
5176
|
-
lg: "[--gap-unit:2.5]",
|
|
5177
|
-
xl: "[--gap-unit:3]",
|
|
5178
|
-
}),
|
|
5217
|
+
gap: new GapTheme(true),
|
|
5179
5218
|
},
|
|
5180
5219
|
layout: {
|
|
5181
5220
|
...defaultLayoutsThemes,
|
|
@@ -5198,13 +5237,7 @@ const defaultCardTheme = new ComponentTheme("div", "", {
|
|
|
5198
5237
|
|
|
5199
5238
|
const defaultRowTheme = new ComponentTheme("div", "", {
|
|
5200
5239
|
size: {
|
|
5201
|
-
gap: new GapTheme(
|
|
5202
|
-
xs: "[--gap-unit:2]",
|
|
5203
|
-
sm: "[--gap-unit:3]",
|
|
5204
|
-
md: "[--gap-unit:4]",
|
|
5205
|
-
lg: "[--gap-unit:5]",
|
|
5206
|
-
xl: "[--gap-unit:6]",
|
|
5207
|
-
}),
|
|
5240
|
+
gap: new GapTheme(),
|
|
5208
5241
|
breakpoint: new BreakpointTheme(),
|
|
5209
5242
|
},
|
|
5210
5243
|
layout: {
|
|
@@ -5238,13 +5271,7 @@ const defaultDividerTheme = new ComponentTheme("div", "h-px w-full", {
|
|
|
5238
5271
|
|
|
5239
5272
|
const defaultContainerTheme = new ComponentTheme("div", "flex-col mx-auto w-full", {
|
|
5240
5273
|
size: {
|
|
5241
|
-
gap: new GapTheme(
|
|
5242
|
-
xs: "[--gap-unit:2]",
|
|
5243
|
-
sm: "[--gap-unit:3]",
|
|
5244
|
-
md: "[--gap-unit:4]",
|
|
5245
|
-
lg: "[--gap-unit:5]",
|
|
5246
|
-
xl: "[--gap-unit:6]",
|
|
5247
|
-
}),
|
|
5274
|
+
gap: new GapTheme(),
|
|
5248
5275
|
maxWidth: new SizeTheme({ xs: 'max-w-3xl', sm: 'max-w-4xl', md: 'max-w-5xl', lg: 'max-w-6xl', xl: 'max-w-7xl' }),
|
|
5249
5276
|
},
|
|
5250
5277
|
layout: {
|
|
@@ -5266,13 +5293,7 @@ const defaultContainerTheme = new ComponentTheme("div", "flex-col mx-auto w-full
|
|
|
5266
5293
|
|
|
5267
5294
|
const defaultColTheme = new ComponentTheme("div", "", {
|
|
5268
5295
|
size: {
|
|
5269
|
-
gap: new GapTheme(
|
|
5270
|
-
xs: "[--gap-unit:2]",
|
|
5271
|
-
sm: "[--gap-unit:3]",
|
|
5272
|
-
md: "[--gap-unit:4]",
|
|
5273
|
-
lg: "[--gap-unit:5]",
|
|
5274
|
-
xl: "[--gap-unit:6]",
|
|
5275
|
-
}),
|
|
5296
|
+
gap: new GapTheme(),
|
|
5276
5297
|
},
|
|
5277
5298
|
layout: {
|
|
5278
5299
|
...defaultLayoutsThemes,
|
|
@@ -5295,13 +5316,7 @@ const defaultStackTheme = new ComponentTheme("div", "", {
|
|
|
5295
5316
|
size: {
|
|
5296
5317
|
px: new PxTheme(),
|
|
5297
5318
|
py: new PyTheme(),
|
|
5298
|
-
gap: new GapTheme(
|
|
5299
|
-
xs: "[--gap-unit:2]",
|
|
5300
|
-
sm: "[--gap-unit:3]",
|
|
5301
|
-
md: "[--gap-unit:4]",
|
|
5302
|
-
lg: "[--gap-unit:5]",
|
|
5303
|
-
xl: "[--gap-unit:6]",
|
|
5304
|
-
}),
|
|
5319
|
+
gap: new GapTheme(),
|
|
5305
5320
|
breakpoint: new BreakpointTheme(),
|
|
5306
5321
|
},
|
|
5307
5322
|
layout: {
|
|
@@ -5321,9 +5336,16 @@ const defaultStackTheme = new ComponentTheme("div", "", {
|
|
|
5321
5336
|
}
|
|
5322
5337
|
}, themeDefaults.stack, STACK_CATEGORIES);
|
|
5323
5338
|
|
|
5339
|
+
const sectionAspectRatioClasses = {
|
|
5340
|
+
xs: "[--aspect-ratio:2.5]",
|
|
5341
|
+
sm: "[--aspect-ratio:2]",
|
|
5342
|
+
md: "[--aspect-ratio:1.75]",
|
|
5343
|
+
lg: "[--aspect-ratio:1.6]",
|
|
5344
|
+
xl: "[--aspect-ratio:1.5]",
|
|
5345
|
+
};
|
|
5324
5346
|
const defaultSectionTheme = new ComponentTheme("div", "w-full", {
|
|
5325
5347
|
size: {
|
|
5326
|
-
px: new PxTheme(
|
|
5348
|
+
px: new PxTheme(sectionAspectRatioClasses),
|
|
5327
5349
|
py: new PyTheme({
|
|
5328
5350
|
xs: "[--py-unit:4]",
|
|
5329
5351
|
sm: "[--py-unit:8]",
|
|
@@ -5331,13 +5353,7 @@ const defaultSectionTheme = new ComponentTheme("div", "w-full", {
|
|
|
5331
5353
|
lg: "[--py-unit:16]",
|
|
5332
5354
|
xl: "[--py-unit:20]",
|
|
5333
5355
|
}),
|
|
5334
|
-
gap: new GapTheme(
|
|
5335
|
-
xs: "[--gap-unit:2]",
|
|
5336
|
-
sm: "[--gap-unit:3]",
|
|
5337
|
-
md: "[--gap-unit:4]",
|
|
5338
|
-
lg: "[--gap-unit:5]",
|
|
5339
|
-
xl: "[--gap-unit:6]",
|
|
5340
|
-
}),
|
|
5356
|
+
gap: new GapTheme(),
|
|
5341
5357
|
breakpoint: new BreakpointTheme(),
|
|
5342
5358
|
},
|
|
5343
5359
|
appearance: {
|
|
@@ -5359,13 +5375,7 @@ const defaultSectionTheme = new ComponentTheme("div", "w-full", {
|
|
|
5359
5375
|
|
|
5360
5376
|
const gridSubThemes = {
|
|
5361
5377
|
size: {
|
|
5362
|
-
gap: new GapTheme(
|
|
5363
|
-
xs: "[--gap-unit:2]",
|
|
5364
|
-
sm: "[--gap-unit:3]",
|
|
5365
|
-
md: "[--gap-unit:4]",
|
|
5366
|
-
lg: "[--gap-unit:5]",
|
|
5367
|
-
xl: "[--gap-unit:6]",
|
|
5368
|
-
}),
|
|
5378
|
+
gap: new GapTheme(),
|
|
5369
5379
|
},
|
|
5370
5380
|
appearance: {
|
|
5371
5381
|
background: GenericVariantTheme.createLayoutBgAppearanceTheme(),
|
|
@@ -5400,13 +5410,7 @@ const defaultCheckboxTheme = new ComponentTheme("input", "peer col-start-1 row-s
|
|
|
5400
5410
|
border: new BorderTheme(),
|
|
5401
5411
|
ring: new RingTheme(),
|
|
5402
5412
|
focusVisible: new FocusVisibleTheme(),
|
|
5403
|
-
radius: RadiusTheme.
|
|
5404
|
-
xs: 'rounded-(--ui-br-xs)',
|
|
5405
|
-
sm: 'rounded-(--ui-br-xs)',
|
|
5406
|
-
md: 'rounded-(--ui-br-sm)',
|
|
5407
|
-
lg: 'rounded-(--ui-br-sm)',
|
|
5408
|
-
xl: 'rounded-(--ui-br-md)'
|
|
5409
|
-
}),
|
|
5413
|
+
radius: RadiusTheme.createCheckboxTheme(),
|
|
5410
5414
|
},
|
|
5411
5415
|
appearance: {
|
|
5412
5416
|
accent: GenericVariantTheme.createAccentColorAppearanceTheme(),
|
|
@@ -5452,7 +5456,7 @@ const defaultCheckboxWrapperTheme = new ComponentTheme("span", "", {
|
|
|
5452
5456
|
const defaultLabelTheme = new ComponentTheme("label", "has-[input]:cursor-pointer cursor-default", {
|
|
5453
5457
|
size: {
|
|
5454
5458
|
text: new SizeTheme(textSizeClasses),
|
|
5455
|
-
gap: new GapTheme(
|
|
5459
|
+
gap: new GapTheme(true),
|
|
5456
5460
|
},
|
|
5457
5461
|
appearance: {
|
|
5458
5462
|
text: GenericVariantTheme.createTypographyTextTheme(),
|
|
@@ -5483,11 +5487,19 @@ const defaultImgTheme = new ComponentTheme("img", "object-cover", // Default to
|
|
|
5483
5487
|
}
|
|
5484
5488
|
}, themeDefaults.img, IMG_CATEGORIES);
|
|
5485
5489
|
|
|
5490
|
+
// Input aspect ratios (same as button)
|
|
5491
|
+
const inputAspectRatioClasses = {
|
|
5492
|
+
xs: "[--aspect-ratio:2]",
|
|
5493
|
+
sm: "[--aspect-ratio:2]",
|
|
5494
|
+
md: "[--aspect-ratio:2]",
|
|
5495
|
+
lg: "[--aspect-ratio:2]",
|
|
5496
|
+
xl: "[--aspect-ratio:2]",
|
|
5497
|
+
};
|
|
5486
5498
|
const defaultInputTheme = new ComponentTheme("input", "w-full transition-all duration-200", {
|
|
5487
5499
|
size: {
|
|
5488
|
-
px: new PxTheme(
|
|
5500
|
+
px: new PxTheme(inputAspectRatioClasses, true),
|
|
5489
5501
|
py: new PyTheme(uiPaddingClasses, true),
|
|
5490
|
-
gap: new GapTheme(
|
|
5502
|
+
gap: new GapTheme(true),
|
|
5491
5503
|
text: new SizeTheme({ xs: 'text-xs', sm: 'text-sm', md: 'text-base', lg: 'text-lg', xl: 'text-xl' }),
|
|
5492
5504
|
},
|
|
5493
5505
|
appearance: {
|