@vaneui/ui 0.3.1-alpha.20250926201820.1b8c4ca → 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 +2 -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/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 +171 -154
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +171 -154
- package/dist/index.js.map +1 -1
- package/dist/ui.css +35 -100
- package/dist/vars.css +3 -0
- 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,89 +3759,30 @@ 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
|
}
|
|
@@ -3804,15 +3798,23 @@ class RadiusTheme extends BaseTheme {
|
|
|
3804
3798
|
this.rounded = roundedClasses;
|
|
3805
3799
|
this.isUIComponent = isUIComponent;
|
|
3806
3800
|
}
|
|
3807
|
-
static
|
|
3808
|
-
|
|
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({
|
|
3809
3812
|
xs: '[--br-unit:1]',
|
|
3810
3813
|
sm: '[--br-unit:2]',
|
|
3811
3814
|
md: '[--br-unit:3]',
|
|
3812
3815
|
lg: '[--br-unit:4]',
|
|
3813
3816
|
xl: '[--br-unit:5]'
|
|
3814
|
-
};
|
|
3815
|
-
return new RadiusTheme(customRounded || brUnitClasses, true);
|
|
3817
|
+
}, true);
|
|
3816
3818
|
}
|
|
3817
3819
|
static createLayoutTheme() {
|
|
3818
3820
|
const brUnitClasses = {
|
|
@@ -4840,11 +4842,19 @@ const themeDefaults = {
|
|
|
4840
4842
|
},
|
|
4841
4843
|
};
|
|
4842
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
|
+
};
|
|
4843
4853
|
const defaultButtonTheme = new ComponentTheme("button", "w-fit h-fit cursor-pointer transition-all duration-200 whitespace-nowrap", {
|
|
4844
4854
|
size: {
|
|
4845
4855
|
px: new PxTheme(buttonAspectRatioClasses, true),
|
|
4846
4856
|
py: new PyTheme(uiPaddingClasses, true),
|
|
4847
|
-
gap: new GapTheme(
|
|
4857
|
+
gap: new GapTheme(true),
|
|
4848
4858
|
text: new SizeTheme({ xs: 'text-xs', sm: 'text-sm', md: 'text-base', lg: 'text-lg', xl: 'text-xl' }),
|
|
4849
4859
|
},
|
|
4850
4860
|
appearance: {
|
|
@@ -4870,11 +4880,19 @@ const defaultButtonTheme = new ComponentTheme("button", "w-fit h-fit cursor-poin
|
|
|
4870
4880
|
return props.href ? "a" : "button";
|
|
4871
4881
|
});
|
|
4872
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
|
+
};
|
|
4873
4891
|
const defaultBadgeTheme = new ComponentTheme("span", "w-fit h-fit transition-all duration-200 whitespace-nowrap", {
|
|
4874
4892
|
size: {
|
|
4875
4893
|
px: new PxTheme(badgeAspectRatioClasses, true),
|
|
4876
4894
|
py: new PyTheme(uiPaddingClasses, true),
|
|
4877
|
-
gap: new GapTheme(
|
|
4895
|
+
gap: new GapTheme(true),
|
|
4878
4896
|
text: new SizeTheme({ xs: 'text-xs', sm: 'text-sm', md: 'text-base', lg: 'text-lg', xl: 'text-xl' })
|
|
4879
4897
|
},
|
|
4880
4898
|
appearance: {
|
|
@@ -4899,12 +4917,26 @@ const defaultBadgeTheme = new ComponentTheme("span", "w-fit h-fit transition-all
|
|
|
4899
4917
|
return props.href ? "a" : "span";
|
|
4900
4918
|
});
|
|
4901
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
|
+
};
|
|
4902
4934
|
const defaultChipTheme = new ComponentTheme("span", "w-fit h-fit transition-all duration-200 whitespace-nowrap", {
|
|
4903
4935
|
size: {
|
|
4904
4936
|
px: new PxTheme(chipAspectRatioClasses, true),
|
|
4905
4937
|
py: new PyTheme(chipPyClasses, true),
|
|
4906
4938
|
text: new SizeTheme({ xs: 'text-xs', sm: 'text-sm', md: 'text-base', lg: 'text-lg', xl: 'text-xl' }),
|
|
4907
|
-
gap: new GapTheme(
|
|
4939
|
+
gap: new GapTheme(true)
|
|
4908
4940
|
},
|
|
4909
4941
|
appearance: {
|
|
4910
4942
|
background: GenericVariantTheme.createSimpleUIElementBgAppearanceTheme(),
|
|
@@ -4928,12 +4960,26 @@ const defaultChipTheme = new ComponentTheme("span", "w-fit h-fit transition-all
|
|
|
4928
4960
|
return props.href ? "a" : "span";
|
|
4929
4961
|
});
|
|
4930
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
|
+
};
|
|
4931
4977
|
const defaultCodeTheme = new ComponentTheme("code", "", {
|
|
4932
4978
|
size: {
|
|
4933
4979
|
px: new PxTheme(codeAspectRatioClasses, true),
|
|
4934
4980
|
py: new PyTheme(codePyClasses, true),
|
|
4935
4981
|
text: new SizeTheme({ xs: 'text-xs', sm: 'text-sm', md: 'text-sm', lg: 'text-base', xl: 'text-lg' }),
|
|
4936
|
-
gap: new GapTheme(
|
|
4982
|
+
gap: new GapTheme(true)
|
|
4937
4983
|
},
|
|
4938
4984
|
appearance: {
|
|
4939
4985
|
background: GenericVariantTheme.createSimpleUIElementBgAppearanceTheme(),
|
|
@@ -5065,7 +5111,10 @@ class ListStyleTheme extends BaseTheme {
|
|
|
5065
5111
|
}
|
|
5066
5112
|
}
|
|
5067
5113
|
|
|
5068
|
-
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;
|
|
5069
5118
|
return new ComponentTheme(tag, base, {
|
|
5070
5119
|
size: {
|
|
5071
5120
|
text: new SizeTheme(textSizeMap),
|
|
@@ -5073,7 +5122,7 @@ const createTypographyComponentTheme = (tag, base = "text-balance", textSizeMap
|
|
|
5073
5122
|
appearance: {
|
|
5074
5123
|
text: GenericVariantTheme.createTypographyTextTheme(),
|
|
5075
5124
|
},
|
|
5076
|
-
typography:
|
|
5125
|
+
typography: typographyThemes,
|
|
5077
5126
|
layout: defaultLayoutsThemes,
|
|
5078
5127
|
}, defaults, TYPOGRAPHY_CATEGORIES, (props) => {
|
|
5079
5128
|
// Determine tag based on href prop
|
|
@@ -5087,7 +5136,7 @@ const pageTitleTheme = createTypographyComponentTheme("h1", "text-balance tracki
|
|
|
5087
5136
|
md: "text-5xl max-lg:text-4xl max-md:text-3xl",
|
|
5088
5137
|
lg: "text-6xl max-lg:text-5xl max-md:text-4xl",
|
|
5089
5138
|
xl: "text-7xl max-lg:text-6xl max-md:text-5xl"
|
|
5090
|
-
}, mergeDefaults(themeDefaults.pageTitle, { semibold: true }));
|
|
5139
|
+
}, mergeDefaults(themeDefaults.pageTitle, { semibold: true }), LineHeightTheme.createForPageTitle());
|
|
5091
5140
|
// Section title specific theme
|
|
5092
5141
|
const sectionTitleTheme = createTypographyComponentTheme("h2", "text-balance w-fit", {
|
|
5093
5142
|
xs: "text-2xl max-lg:text-xl max-md:text-lg",
|
|
@@ -5095,9 +5144,9 @@ const sectionTitleTheme = createTypographyComponentTheme("h2", "text-balance w-f
|
|
|
5095
5144
|
md: "text-4xl max-lg:text-3xl max-md:text-2xl",
|
|
5096
5145
|
lg: "text-5xl max-lg:text-4xl max-md:text-3xl",
|
|
5097
5146
|
xl: "text-6xl max-lg:text-5xl max-md:text-4xl"
|
|
5098
|
-
}, mergeDefaults(themeDefaults.sectionTitle, { semibold: true }));
|
|
5147
|
+
}, mergeDefaults(themeDefaults.sectionTitle, { semibold: true }), LineHeightTheme.createForSectionTitle());
|
|
5099
5148
|
// Title specific theme
|
|
5100
|
-
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());
|
|
5101
5150
|
// Text specific theme
|
|
5102
5151
|
const textTheme = createTypographyComponentTheme("p", "p-0 m-0 w-fit", textSizeClasses, themeDefaults.text);
|
|
5103
5152
|
// Link specific theme
|
|
@@ -5120,6 +5169,7 @@ const listItemTheme = new ComponentTheme("li", "", {
|
|
|
5120
5169
|
text: GenericVariantTheme.createTypographyTextTheme(),
|
|
5121
5170
|
},
|
|
5122
5171
|
typography: defaultTypographyThemes,
|
|
5172
|
+
layout: defaultLayoutsThemes,
|
|
5123
5173
|
}, themeDefaults.listItem, TYPOGRAPHY_CATEGORIES);
|
|
5124
5174
|
// List specific theme
|
|
5125
5175
|
const listTheme = new ComponentTheme("ul", "list-inside", {
|
|
@@ -5164,13 +5214,7 @@ const defaultCardTheme = new ComponentTheme("div", "", {
|
|
|
5164
5214
|
size: {
|
|
5165
5215
|
px: new PxTheme(),
|
|
5166
5216
|
py: new PyTheme(),
|
|
5167
|
-
gap: new GapTheme(
|
|
5168
|
-
xs: "[--gap-unit:1]",
|
|
5169
|
-
sm: "[--gap-unit:1.5]",
|
|
5170
|
-
md: "[--gap-unit:2]",
|
|
5171
|
-
lg: "[--gap-unit:2.5]",
|
|
5172
|
-
xl: "[--gap-unit:3]",
|
|
5173
|
-
}),
|
|
5217
|
+
gap: new GapTheme(true),
|
|
5174
5218
|
},
|
|
5175
5219
|
layout: {
|
|
5176
5220
|
...defaultLayoutsThemes,
|
|
@@ -5193,13 +5237,7 @@ const defaultCardTheme = new ComponentTheme("div", "", {
|
|
|
5193
5237
|
|
|
5194
5238
|
const defaultRowTheme = new ComponentTheme("div", "", {
|
|
5195
5239
|
size: {
|
|
5196
|
-
gap: new GapTheme(
|
|
5197
|
-
xs: "[--gap-unit:2]",
|
|
5198
|
-
sm: "[--gap-unit:3]",
|
|
5199
|
-
md: "[--gap-unit:4]",
|
|
5200
|
-
lg: "[--gap-unit:5]",
|
|
5201
|
-
xl: "[--gap-unit:6]",
|
|
5202
|
-
}),
|
|
5240
|
+
gap: new GapTheme(),
|
|
5203
5241
|
breakpoint: new BreakpointTheme(),
|
|
5204
5242
|
},
|
|
5205
5243
|
layout: {
|
|
@@ -5233,13 +5271,7 @@ const defaultDividerTheme = new ComponentTheme("div", "h-px w-full", {
|
|
|
5233
5271
|
|
|
5234
5272
|
const defaultContainerTheme = new ComponentTheme("div", "flex-col mx-auto w-full", {
|
|
5235
5273
|
size: {
|
|
5236
|
-
gap: new GapTheme(
|
|
5237
|
-
xs: "[--gap-unit:2]",
|
|
5238
|
-
sm: "[--gap-unit:3]",
|
|
5239
|
-
md: "[--gap-unit:4]",
|
|
5240
|
-
lg: "[--gap-unit:5]",
|
|
5241
|
-
xl: "[--gap-unit:6]",
|
|
5242
|
-
}),
|
|
5274
|
+
gap: new GapTheme(),
|
|
5243
5275
|
maxWidth: new SizeTheme({ xs: 'max-w-3xl', sm: 'max-w-4xl', md: 'max-w-5xl', lg: 'max-w-6xl', xl: 'max-w-7xl' }),
|
|
5244
5276
|
},
|
|
5245
5277
|
layout: {
|
|
@@ -5261,13 +5293,7 @@ const defaultContainerTheme = new ComponentTheme("div", "flex-col mx-auto w-full
|
|
|
5261
5293
|
|
|
5262
5294
|
const defaultColTheme = new ComponentTheme("div", "", {
|
|
5263
5295
|
size: {
|
|
5264
|
-
gap: new GapTheme(
|
|
5265
|
-
xs: "[--gap-unit:2]",
|
|
5266
|
-
sm: "[--gap-unit:3]",
|
|
5267
|
-
md: "[--gap-unit:4]",
|
|
5268
|
-
lg: "[--gap-unit:5]",
|
|
5269
|
-
xl: "[--gap-unit:6]",
|
|
5270
|
-
}),
|
|
5296
|
+
gap: new GapTheme(),
|
|
5271
5297
|
},
|
|
5272
5298
|
layout: {
|
|
5273
5299
|
...defaultLayoutsThemes,
|
|
@@ -5290,13 +5316,7 @@ const defaultStackTheme = new ComponentTheme("div", "", {
|
|
|
5290
5316
|
size: {
|
|
5291
5317
|
px: new PxTheme(),
|
|
5292
5318
|
py: new PyTheme(),
|
|
5293
|
-
gap: new GapTheme(
|
|
5294
|
-
xs: "[--gap-unit:2]",
|
|
5295
|
-
sm: "[--gap-unit:3]",
|
|
5296
|
-
md: "[--gap-unit:4]",
|
|
5297
|
-
lg: "[--gap-unit:5]",
|
|
5298
|
-
xl: "[--gap-unit:6]",
|
|
5299
|
-
}),
|
|
5319
|
+
gap: new GapTheme(),
|
|
5300
5320
|
breakpoint: new BreakpointTheme(),
|
|
5301
5321
|
},
|
|
5302
5322
|
layout: {
|
|
@@ -5316,6 +5336,13 @@ const defaultStackTheme = new ComponentTheme("div", "", {
|
|
|
5316
5336
|
}
|
|
5317
5337
|
}, themeDefaults.stack, STACK_CATEGORIES);
|
|
5318
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
|
+
};
|
|
5319
5346
|
const defaultSectionTheme = new ComponentTheme("div", "w-full", {
|
|
5320
5347
|
size: {
|
|
5321
5348
|
px: new PxTheme(sectionAspectRatioClasses),
|
|
@@ -5326,13 +5353,7 @@ const defaultSectionTheme = new ComponentTheme("div", "w-full", {
|
|
|
5326
5353
|
lg: "[--py-unit:16]",
|
|
5327
5354
|
xl: "[--py-unit:20]",
|
|
5328
5355
|
}),
|
|
5329
|
-
gap: new GapTheme(
|
|
5330
|
-
xs: "[--gap-unit:2]",
|
|
5331
|
-
sm: "[--gap-unit:3]",
|
|
5332
|
-
md: "[--gap-unit:4]",
|
|
5333
|
-
lg: "[--gap-unit:5]",
|
|
5334
|
-
xl: "[--gap-unit:6]",
|
|
5335
|
-
}),
|
|
5356
|
+
gap: new GapTheme(),
|
|
5336
5357
|
breakpoint: new BreakpointTheme(),
|
|
5337
5358
|
},
|
|
5338
5359
|
appearance: {
|
|
@@ -5354,13 +5375,7 @@ const defaultSectionTheme = new ComponentTheme("div", "w-full", {
|
|
|
5354
5375
|
|
|
5355
5376
|
const gridSubThemes = {
|
|
5356
5377
|
size: {
|
|
5357
|
-
gap: new GapTheme(
|
|
5358
|
-
xs: "[--gap-unit:2]",
|
|
5359
|
-
sm: "[--gap-unit:3]",
|
|
5360
|
-
md: "[--gap-unit:4]",
|
|
5361
|
-
lg: "[--gap-unit:5]",
|
|
5362
|
-
xl: "[--gap-unit:6]",
|
|
5363
|
-
}),
|
|
5378
|
+
gap: new GapTheme(),
|
|
5364
5379
|
},
|
|
5365
5380
|
appearance: {
|
|
5366
5381
|
background: GenericVariantTheme.createLayoutBgAppearanceTheme(),
|
|
@@ -5395,13 +5410,7 @@ const defaultCheckboxTheme = new ComponentTheme("input", "peer col-start-1 row-s
|
|
|
5395
5410
|
border: new BorderTheme(),
|
|
5396
5411
|
ring: new RingTheme(),
|
|
5397
5412
|
focusVisible: new FocusVisibleTheme(),
|
|
5398
|
-
radius: RadiusTheme.
|
|
5399
|
-
xs: 'rounded-(--ui-br-xs)',
|
|
5400
|
-
sm: 'rounded-(--ui-br-xs)',
|
|
5401
|
-
md: 'rounded-(--ui-br-sm)',
|
|
5402
|
-
lg: 'rounded-(--ui-br-sm)',
|
|
5403
|
-
xl: 'rounded-(--ui-br-md)'
|
|
5404
|
-
}),
|
|
5413
|
+
radius: RadiusTheme.createCheckboxTheme(),
|
|
5405
5414
|
},
|
|
5406
5415
|
appearance: {
|
|
5407
5416
|
accent: GenericVariantTheme.createAccentColorAppearanceTheme(),
|
|
@@ -5447,7 +5456,7 @@ const defaultCheckboxWrapperTheme = new ComponentTheme("span", "", {
|
|
|
5447
5456
|
const defaultLabelTheme = new ComponentTheme("label", "has-[input]:cursor-pointer cursor-default", {
|
|
5448
5457
|
size: {
|
|
5449
5458
|
text: new SizeTheme(textSizeClasses),
|
|
5450
|
-
gap: new GapTheme(
|
|
5459
|
+
gap: new GapTheme(true),
|
|
5451
5460
|
},
|
|
5452
5461
|
appearance: {
|
|
5453
5462
|
text: GenericVariantTheme.createTypographyTextTheme(),
|
|
@@ -5478,11 +5487,19 @@ const defaultImgTheme = new ComponentTheme("img", "object-cover", // Default to
|
|
|
5478
5487
|
}
|
|
5479
5488
|
}, themeDefaults.img, IMG_CATEGORIES);
|
|
5480
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
|
+
};
|
|
5481
5498
|
const defaultInputTheme = new ComponentTheme("input", "w-full transition-all duration-200", {
|
|
5482
5499
|
size: {
|
|
5483
5500
|
px: new PxTheme(inputAspectRatioClasses, true),
|
|
5484
5501
|
py: new PyTheme(uiPaddingClasses, true),
|
|
5485
|
-
gap: new GapTheme(
|
|
5502
|
+
gap: new GapTheme(true),
|
|
5486
5503
|
text: new SizeTheme({ xs: 'text-xs', sm: 'text-sm', md: 'text-base', lg: 'text-lg', xl: 'text-xl' }),
|
|
5487
5504
|
},
|
|
5488
5505
|
appearance: {
|