@vaneui/ui 0.3.1-alpha.20250930162311.b66aed0 → 0.3.1-alpha.20251001131502.03a0ce2
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/theme/badgeTheme.d.ts +4 -2
- package/dist/components/ui/theme/badgeTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/buttonTheme.d.ts +4 -2
- package/dist/components/ui/theme/buttonTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/cardTheme.d.ts +2 -0
- package/dist/components/ui/theme/cardTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/checkboxTheme.d.ts +2 -1
- package/dist/components/ui/theme/checkboxTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/chipTheme.d.ts +4 -2
- package/dist/components/ui/theme/chipTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/codeTheme.d.ts +4 -2
- package/dist/components/ui/theme/codeTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/common/ComponentTheme.d.ts +0 -2
- package/dist/components/ui/theme/common/ComponentTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/inputTheme.d.ts +4 -2
- package/dist/components/ui/theme/inputTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/labelTheme.d.ts +4 -2
- package/dist/components/ui/theme/labelTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/sectionTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/size/fontSizeTheme.d.ts +21 -0
- package/dist/components/ui/theme/size/fontSizeTheme.d.ts.map +1 -0
- package/dist/components/ui/theme/{typography → size}/lineHeightTheme.d.ts +1 -0
- package/dist/components/ui/theme/size/lineHeightTheme.d.ts.map +1 -0
- 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/size/sizeTheme.d.ts +1 -2
- package/dist/components/ui/theme/size/sizeTheme.d.ts.map +1 -1
- package/dist/components/ui/theme/typographyTheme.d.ts +6 -6
- package/dist/components/ui/theme/typographyTheme.d.ts.map +1 -1
- package/dist/index.esm.js +190 -143
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +190 -143
- package/dist/index.js.map +1 -1
- package/dist/ui.css +62 -75
- package/dist/vars.css +12 -4
- package/package.json +1 -1
- package/dist/components/ui/theme/typography/lineHeightTheme.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -753,64 +753,6 @@ class TextAlignTheme extends BaseTheme {
|
|
|
753
753
|
}
|
|
754
754
|
}
|
|
755
755
|
|
|
756
|
-
class LineHeightTheme extends BaseTheme {
|
|
757
|
-
constructor(customMapping) {
|
|
758
|
-
super();
|
|
759
|
-
/** Extra-small line height - matches text-xs default line height */
|
|
760
|
-
this.xs = "[--lh-unit:1.333]"; // calc(1 / 0.75) ≈ 1.333
|
|
761
|
-
/** Small line height - matches text-sm default line height */
|
|
762
|
-
this.sm = "[--lh-unit:1.429]"; // calc(1.25 / 0.875) ≈ 1.429
|
|
763
|
-
/** Medium line height - matches text-base default line height */
|
|
764
|
-
this.md = "[--lh-unit:1.5]"; // calc(1.5 / 1) = 1.5
|
|
765
|
-
/** Large line height - matches text-lg default line height */
|
|
766
|
-
this.lg = "[--lh-unit:1.556]"; // calc(1.75 / 1.125) ≈ 1.556
|
|
767
|
-
/** Extra-large line height - matches text-xl default line height */
|
|
768
|
-
this.xl = "[--lh-unit:1.4]"; // calc(1.75 / 1.25) = 1.4
|
|
769
|
-
if (customMapping) {
|
|
770
|
-
this.xs = customMapping.xs || this.xs;
|
|
771
|
-
this.sm = customMapping.sm || this.sm;
|
|
772
|
-
this.md = customMapping.md || this.md;
|
|
773
|
-
this.lg = customMapping.lg || this.lg;
|
|
774
|
-
this.xl = customMapping.xl || this.xl;
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
getClasses(extractedKeys) {
|
|
778
|
-
if (extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.size) {
|
|
779
|
-
const lhUnitClass = this[extractedKeys.size];
|
|
780
|
-
return lhUnitClass ? [lhUnitClass, "leading-(--lh)"] : [];
|
|
781
|
-
}
|
|
782
|
-
return [this.md, "leading-(--lh)"];
|
|
783
|
-
}
|
|
784
|
-
// Static factory methods for different text size ranges
|
|
785
|
-
static createForSectionTitle() {
|
|
786
|
-
return new LineHeightTheme({
|
|
787
|
-
xs: "[--lh-unit:1.333]", // text-2xl: calc(2 / 1.5) ≈ 1.333
|
|
788
|
-
sm: "[--lh-unit:1.2]", // text-3xl: calc(2.25 / 1.875) = 1.2
|
|
789
|
-
md: "[--lh-unit:1.111]", // text-4xl: calc(2.5 / 2.25) ≈ 1.111
|
|
790
|
-
lg: "[--lh-unit:1]", // text-5xl: 1
|
|
791
|
-
xl: "[--lh-unit:1]" // text-6xl+: 1
|
|
792
|
-
});
|
|
793
|
-
}
|
|
794
|
-
static createForPageTitle() {
|
|
795
|
-
return new LineHeightTheme({
|
|
796
|
-
xs: "[--lh-unit:1.2]", // text-3xl: calc(2.25 / 1.875) = 1.2
|
|
797
|
-
sm: "[--lh-unit:1.111]", // text-4xl: calc(2.5 / 2.25) ≈ 1.111
|
|
798
|
-
md: "[--lh-unit:1]", // text-5xl: 1
|
|
799
|
-
lg: "[--lh-unit:1]", // text-6xl: 1
|
|
800
|
-
xl: "[--lh-unit:1]" // text-7xl: 1
|
|
801
|
-
});
|
|
802
|
-
}
|
|
803
|
-
static createForTitle() {
|
|
804
|
-
return new LineHeightTheme({
|
|
805
|
-
xs: "[--lh-unit:1.556]", // text-lg: calc(1.75 / 1.125) ≈ 1.556
|
|
806
|
-
sm: "[--lh-unit:1.4]", // text-xl: calc(1.75 / 1.25) = 1.4
|
|
807
|
-
md: "[--lh-unit:1.333]", // text-2xl: calc(2 / 1.5) ≈ 1.333
|
|
808
|
-
lg: "[--lh-unit:1.2]", // text-3xl: calc(2.25 / 1.875) = 1.2
|
|
809
|
-
xl: "[--lh-unit:1.111]" // text-4xl: calc(2.5 / 2.25) ≈ 1.111
|
|
810
|
-
});
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
|
|
814
756
|
class DisplayTheme extends BaseTheme {
|
|
815
757
|
constructor() {
|
|
816
758
|
super(...arguments);
|
|
@@ -3629,8 +3571,7 @@ const defaultTypographyThemes = {
|
|
|
3629
3571
|
fontStyle: new FontStyleTheme(),
|
|
3630
3572
|
textDecoration: new TextDecorationTheme(),
|
|
3631
3573
|
textTransform: new TextTransformTheme(),
|
|
3632
|
-
textAlign: new TextAlignTheme()
|
|
3633
|
-
lineHeight: new LineHeightTheme()
|
|
3574
|
+
textAlign: new TextAlignTheme()
|
|
3634
3575
|
};
|
|
3635
3576
|
class ComponentTheme {
|
|
3636
3577
|
constructor(tag, base, themes, defaults = {}, categories, tagFunction) {
|
|
@@ -3712,29 +3653,122 @@ class ComponentTheme {
|
|
|
3712
3653
|
}
|
|
3713
3654
|
}
|
|
3714
3655
|
|
|
3715
|
-
class
|
|
3716
|
-
constructor(
|
|
3656
|
+
class FontSizeTheme extends BaseTheme {
|
|
3657
|
+
constructor(customMapping) {
|
|
3717
3658
|
super();
|
|
3718
|
-
/** Extra-small size
|
|
3719
|
-
this.xs = "";
|
|
3720
|
-
/** Small size
|
|
3721
|
-
this.sm = "";
|
|
3722
|
-
/** Medium size
|
|
3723
|
-
this.md = "";
|
|
3724
|
-
/** Large size
|
|
3725
|
-
this.lg = "";
|
|
3726
|
-
/** Extra-large size
|
|
3727
|
-
this.xl = "";
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
this
|
|
3659
|
+
/** Extra-small font size - text-xs (0.75rem = 6 * 0.125rem) */
|
|
3660
|
+
this.xs = "[--fs-unit:6]";
|
|
3661
|
+
/** Small font size - text-sm (0.875rem = 7 * 0.125rem) */
|
|
3662
|
+
this.sm = "[--fs-unit:7]";
|
|
3663
|
+
/** Medium font size - text-base (1rem = 8 * 0.125rem) */
|
|
3664
|
+
this.md = "[--fs-unit:8]";
|
|
3665
|
+
/** Large font size - text-lg (1.125rem = 9 * 0.125rem) */
|
|
3666
|
+
this.lg = "[--fs-unit:9]";
|
|
3667
|
+
/** Extra-large font size - text-xl (1.25rem = 10 * 0.125rem) */
|
|
3668
|
+
this.xl = "[--fs-unit:10]";
|
|
3669
|
+
if (customMapping) {
|
|
3670
|
+
this.xs = customMapping.xs || this.xs;
|
|
3671
|
+
this.sm = customMapping.sm || this.sm;
|
|
3672
|
+
this.md = customMapping.md || this.md;
|
|
3673
|
+
this.lg = customMapping.lg || this.lg;
|
|
3674
|
+
this.xl = customMapping.xl || this.xl;
|
|
3675
|
+
}
|
|
3676
|
+
}
|
|
3677
|
+
getClasses(extractedKeys) {
|
|
3678
|
+
if (extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.size) {
|
|
3679
|
+
const fsUnitClass = this[extractedKeys.size];
|
|
3680
|
+
return fsUnitClass ? [fsUnitClass, "text-(length:--fs)"] : [];
|
|
3681
|
+
}
|
|
3682
|
+
return [this.md, "text-(length:--fs)"];
|
|
3683
|
+
}
|
|
3684
|
+
// Static factory methods for different text size ranges
|
|
3685
|
+
static createForPageTitle() {
|
|
3686
|
+
return new FontSizeTheme({
|
|
3687
|
+
xs: "[--fs-unit:15]", // text-3xl: 1.875rem = 15 * 0.125rem
|
|
3688
|
+
sm: "[--fs-unit:18]", // text-4xl: 2.25rem = 18 * 0.125rem
|
|
3689
|
+
md: "[--fs-unit:24]", // text-5xl: 3rem = 24 * 0.125rem
|
|
3690
|
+
lg: "[--fs-unit:30]", // text-6xl: 3.75rem = 30 * 0.125rem
|
|
3691
|
+
xl: "[--fs-unit:36]" // text-7xl: 4.5rem = 36 * 0.125rem
|
|
3692
|
+
});
|
|
3693
|
+
}
|
|
3694
|
+
static createForSectionTitle() {
|
|
3695
|
+
return new FontSizeTheme({
|
|
3696
|
+
xs: "[--fs-unit:12]", // text-2xl: 1.5rem = 12 * 0.125rem
|
|
3697
|
+
sm: "[--fs-unit:15]", // text-3xl: 1.875rem = 15 * 0.125rem
|
|
3698
|
+
md: "[--fs-unit:18]", // text-4xl: 2.25rem = 18 * 0.125rem
|
|
3699
|
+
lg: "[--fs-unit:24]", // text-5xl: 3rem = 24 * 0.125rem
|
|
3700
|
+
xl: "[--fs-unit:30]" // text-6xl: 3.75rem = 30 * 0.125rem
|
|
3732
3701
|
});
|
|
3733
3702
|
}
|
|
3703
|
+
static createForTitle() {
|
|
3704
|
+
return new FontSizeTheme({
|
|
3705
|
+
xs: "[--fs-unit:9]", // text-lg: 1.125rem = 9 * 0.125rem
|
|
3706
|
+
sm: "[--fs-unit:10]", // text-xl: 1.25rem = 10 * 0.125rem
|
|
3707
|
+
md: "[--fs-unit:12]", // text-2xl: 1.5rem = 12 * 0.125rem
|
|
3708
|
+
lg: "[--fs-unit:15]", // text-3xl: 1.875rem = 15 * 0.125rem
|
|
3709
|
+
xl: "[--fs-unit:18]" // text-4xl: 2.25rem = 18 * 0.125rem
|
|
3710
|
+
});
|
|
3711
|
+
}
|
|
3712
|
+
}
|
|
3713
|
+
|
|
3714
|
+
class LineHeightTheme extends BaseTheme {
|
|
3715
|
+
constructor(customMapping) {
|
|
3716
|
+
super();
|
|
3717
|
+
/** Extra-small line height - matches text-xs default line height */
|
|
3718
|
+
this.xs = "[--lh-unit:1.333]"; // calc(1 / 0.75) ≈ 1.333
|
|
3719
|
+
/** Small line height - matches text-sm default line height */
|
|
3720
|
+
this.sm = "[--lh-unit:1.429]"; // calc(1.25 / 0.875) ≈ 1.429
|
|
3721
|
+
/** Medium line height - matches text-base default line height */
|
|
3722
|
+
this.md = "[--lh-unit:1.5]"; // calc(1.5 / 1) = 1.5
|
|
3723
|
+
/** Large line height - matches text-lg default line height */
|
|
3724
|
+
this.lg = "[--lh-unit:1.556]"; // calc(1.75 / 1.125) ≈ 1.556
|
|
3725
|
+
/** Extra-large line height - matches text-xl default line height */
|
|
3726
|
+
this.xl = "[--lh-unit:1.4]"; // calc(1.75 / 1.25) = 1.4
|
|
3727
|
+
if (customMapping) {
|
|
3728
|
+
this.xs = customMapping.xs || this.xs;
|
|
3729
|
+
this.sm = customMapping.sm || this.sm;
|
|
3730
|
+
this.md = customMapping.md || this.md;
|
|
3731
|
+
this.lg = customMapping.lg || this.lg;
|
|
3732
|
+
this.xl = customMapping.xl || this.xl;
|
|
3733
|
+
}
|
|
3734
|
+
}
|
|
3734
3735
|
getClasses(extractedKeys) {
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3736
|
+
if (extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.size) {
|
|
3737
|
+
const lhUnitClass = this[extractedKeys.size];
|
|
3738
|
+
return lhUnitClass ? [lhUnitClass, "leading-(--lh)"] : [];
|
|
3739
|
+
}
|
|
3740
|
+
return [this.md, "leading-(--lh)"];
|
|
3741
|
+
}
|
|
3742
|
+
static createDefault() {
|
|
3743
|
+
return new LineHeightTheme();
|
|
3744
|
+
}
|
|
3745
|
+
// Static factory methods for different text size ranges
|
|
3746
|
+
static createForSectionTitle() {
|
|
3747
|
+
return new LineHeightTheme({
|
|
3748
|
+
xs: "[--lh-unit:1.333]", // text-2xl: calc(2 / 1.5) ≈ 1.333
|
|
3749
|
+
sm: "[--lh-unit:1.2]", // text-3xl: calc(2.25 / 1.875) = 1.2
|
|
3750
|
+
md: "[--lh-unit:1.111]", // text-4xl: calc(2.5 / 2.25) ≈ 1.111
|
|
3751
|
+
lg: "[--lh-unit:1]", // text-5xl: 1
|
|
3752
|
+
xl: "[--lh-unit:1]" // text-6xl+: 1
|
|
3753
|
+
});
|
|
3754
|
+
}
|
|
3755
|
+
static createForPageTitle() {
|
|
3756
|
+
return new LineHeightTheme({
|
|
3757
|
+
xs: "[--lh-unit:1.2]", // text-3xl: calc(2.25 / 1.875) = 1.2
|
|
3758
|
+
sm: "[--lh-unit:1.111]", // text-4xl: calc(2.5 / 2.25) ≈ 1.111
|
|
3759
|
+
md: "[--lh-unit:1]", // text-5xl: 1
|
|
3760
|
+
lg: "[--lh-unit:1]", // text-6xl: 1
|
|
3761
|
+
xl: "[--lh-unit:1]" // text-7xl: 1
|
|
3762
|
+
});
|
|
3763
|
+
}
|
|
3764
|
+
static createForTitle() {
|
|
3765
|
+
return new LineHeightTheme({
|
|
3766
|
+
xs: "[--lh-unit:1.556]", // text-lg: calc(1.75 / 1.125) ≈ 1.556
|
|
3767
|
+
sm: "[--lh-unit:1.4]", // text-xl: calc(1.75 / 1.25) = 1.4
|
|
3768
|
+
md: "[--lh-unit:1.333]", // text-2xl: calc(2 / 1.5) ≈ 1.333
|
|
3769
|
+
lg: "[--lh-unit:1.2]", // text-3xl: calc(2.25 / 1.875) = 1.2
|
|
3770
|
+
xl: "[--lh-unit:1.111]" // text-4xl: calc(2.5 / 2.25) ≈ 1.111
|
|
3771
|
+
});
|
|
3738
3772
|
}
|
|
3739
3773
|
}
|
|
3740
3774
|
|
|
@@ -3811,11 +3845,11 @@ class RadiusTheme extends BaseTheme {
|
|
|
3811
3845
|
}
|
|
3812
3846
|
static createUITheme() {
|
|
3813
3847
|
return new RadiusTheme({
|
|
3814
|
-
xs: '[--br-unit:
|
|
3815
|
-
sm: '[--br-unit:
|
|
3816
|
-
md: '[--br-unit:
|
|
3817
|
-
lg: '[--br-unit:
|
|
3818
|
-
xl: '[--br-unit:
|
|
3848
|
+
xs: '[--br-unit:2]',
|
|
3849
|
+
sm: '[--br-unit:3]',
|
|
3850
|
+
md: '[--br-unit:4]',
|
|
3851
|
+
lg: '[--br-unit:5]',
|
|
3852
|
+
xl: '[--br-unit:6]'
|
|
3819
3853
|
}, true);
|
|
3820
3854
|
}
|
|
3821
3855
|
static createLayoutTheme() {
|
|
@@ -3957,9 +3991,9 @@ class PaddingTheme extends BaseTheme {
|
|
|
3957
3991
|
|
|
3958
3992
|
/** Horizontal padding theme - controls left and right padding */
|
|
3959
3993
|
class PxTheme extends PaddingTheme {
|
|
3960
|
-
constructor(
|
|
3994
|
+
constructor(aspectRatio, isUIComponent = false) {
|
|
3961
3995
|
super();
|
|
3962
|
-
this.aspectRatioMap =
|
|
3996
|
+
this.aspectRatioMap = aspectRatio;
|
|
3963
3997
|
this.isUIComponent = isUIComponent;
|
|
3964
3998
|
// PxTheme should not set any padding classes - that's PyTheme's job
|
|
3965
3999
|
// PxTheme only handles aspect-ratio
|
|
@@ -4095,13 +4129,6 @@ const textAppearanceClasses = {
|
|
|
4095
4129
|
info: "text-(--color-text-info)",
|
|
4096
4130
|
transparent: "text-transparent",
|
|
4097
4131
|
};
|
|
4098
|
-
const textSizeClasses = {
|
|
4099
|
-
xs: "text-xs",
|
|
4100
|
-
sm: "text-sm",
|
|
4101
|
-
md: "text-base",
|
|
4102
|
-
lg: "text-lg",
|
|
4103
|
-
xl: "text-xl",
|
|
4104
|
-
};
|
|
4105
4132
|
|
|
4106
4133
|
const filledBackgroundAppearanceClasses = {
|
|
4107
4134
|
default: "bg-(--color-bg-filled-default)",
|
|
@@ -4844,7 +4871,6 @@ const themeDefaults = {
|
|
|
4844
4871
|
},
|
|
4845
4872
|
};
|
|
4846
4873
|
|
|
4847
|
-
// Button-specific aspect ratios (px-2,3,4,5,6 vs py-1,1.5,2,2.5,3)
|
|
4848
4874
|
const buttonAspectRatioClasses = {
|
|
4849
4875
|
xs: "[--aspect-ratio:2]", // px-2 vs py-1 = 2
|
|
4850
4876
|
sm: "[--aspect-ratio:2]", // px-3 vs py-1.5 = 2
|
|
@@ -4857,7 +4883,14 @@ const defaultButtonTheme = new ComponentTheme("button", "w-fit h-fit cursor-poin
|
|
|
4857
4883
|
px: new PxTheme(buttonAspectRatioClasses, true),
|
|
4858
4884
|
py: new PyTheme(uiPaddingClasses, true),
|
|
4859
4885
|
gap: new GapTheme(true),
|
|
4860
|
-
text: new
|
|
4886
|
+
text: new FontSizeTheme(),
|
|
4887
|
+
lineHeight: new LineHeightTheme({
|
|
4888
|
+
xs: "[--lh-unit:1.3]",
|
|
4889
|
+
sm: "[--lh-unit:1.3]",
|
|
4890
|
+
md: "[--lh-unit:1.3]",
|
|
4891
|
+
lg: "[--lh-unit:1.3]",
|
|
4892
|
+
xl: "[--lh-unit:1.3]"
|
|
4893
|
+
}),
|
|
4861
4894
|
},
|
|
4862
4895
|
appearance: {
|
|
4863
4896
|
background: GenericVariantTheme.createBgAppearanceTheme(),
|
|
@@ -4895,7 +4928,8 @@ const defaultBadgeTheme = new ComponentTheme("span", "w-fit h-fit transition-all
|
|
|
4895
4928
|
px: new PxTheme(badgeAspectRatioClasses, true),
|
|
4896
4929
|
py: new PyTheme(uiPaddingClasses, true),
|
|
4897
4930
|
gap: new GapTheme(true),
|
|
4898
|
-
text: new
|
|
4931
|
+
text: new FontSizeTheme(),
|
|
4932
|
+
lineHeight: LineHeightTheme.createDefault()
|
|
4899
4933
|
},
|
|
4900
4934
|
appearance: {
|
|
4901
4935
|
background: GenericVariantTheme.createSimpleUIElementBgAppearanceTheme(),
|
|
@@ -4937,7 +4971,8 @@ const defaultChipTheme = new ComponentTheme("span", "w-fit h-fit transition-all
|
|
|
4937
4971
|
size: {
|
|
4938
4972
|
px: new PxTheme(chipAspectRatioClasses, true),
|
|
4939
4973
|
py: new PyTheme(chipPyClasses, true),
|
|
4940
|
-
text: new
|
|
4974
|
+
text: new FontSizeTheme(),
|
|
4975
|
+
lineHeight: LineHeightTheme.createDefault(),
|
|
4941
4976
|
gap: new GapTheme(true)
|
|
4942
4977
|
},
|
|
4943
4978
|
appearance: {
|
|
@@ -4980,7 +5015,8 @@ const defaultCodeTheme = new ComponentTheme("code", "", {
|
|
|
4980
5015
|
size: {
|
|
4981
5016
|
px: new PxTheme(codeAspectRatioClasses, true),
|
|
4982
5017
|
py: new PyTheme(codePyClasses, true),
|
|
4983
|
-
text: new
|
|
5018
|
+
text: new FontSizeTheme(),
|
|
5019
|
+
lineHeight: LineHeightTheme.createDefault(),
|
|
4984
5020
|
gap: new GapTheme(true)
|
|
4985
5021
|
},
|
|
4986
5022
|
appearance: {
|
|
@@ -5113,18 +5149,16 @@ class ListStyleTheme extends BaseTheme {
|
|
|
5113
5149
|
}
|
|
5114
5150
|
}
|
|
5115
5151
|
|
|
5116
|
-
const createTypographyComponentTheme = (tag, base = "text-balance",
|
|
5117
|
-
const typographyThemes = lineHeightTheme
|
|
5118
|
-
? { ...defaultTypographyThemes, lineHeight: lineHeightTheme }
|
|
5119
|
-
: defaultTypographyThemes;
|
|
5152
|
+
const createTypographyComponentTheme = (tag, base = "text-balance", fontSizeTheme = new FontSizeTheme(), defaults = {}, lineHeightTheme = LineHeightTheme.createDefault()) => {
|
|
5120
5153
|
return new ComponentTheme(tag, base, {
|
|
5121
5154
|
size: {
|
|
5122
|
-
text:
|
|
5155
|
+
text: fontSizeTheme,
|
|
5156
|
+
lineHeight: lineHeightTheme,
|
|
5123
5157
|
},
|
|
5124
5158
|
appearance: {
|
|
5125
5159
|
text: GenericVariantTheme.createTypographyTextTheme(),
|
|
5126
5160
|
},
|
|
5127
|
-
typography:
|
|
5161
|
+
typography: defaultTypographyThemes,
|
|
5128
5162
|
layout: defaultLayoutsThemes,
|
|
5129
5163
|
}, defaults, TYPOGRAPHY_CATEGORIES, (props) => {
|
|
5130
5164
|
// Determine tag based on href prop
|
|
@@ -5132,29 +5166,17 @@ const createTypographyComponentTheme = (tag, base = "text-balance", textSizeMap
|
|
|
5132
5166
|
});
|
|
5133
5167
|
};
|
|
5134
5168
|
// Page title specific theme
|
|
5135
|
-
const pageTitleTheme = createTypographyComponentTheme("h1", "text-balance tracking-tight w-fit", {
|
|
5136
|
-
xs: "text-3xl max-lg:text-2xl max-md:text-xl",
|
|
5137
|
-
sm: "text-4xl max-lg:text-3xl max-md:text-2xl",
|
|
5138
|
-
md: "text-5xl max-lg:text-4xl max-md:text-3xl",
|
|
5139
|
-
lg: "text-6xl max-lg:text-5xl max-md:text-4xl",
|
|
5140
|
-
xl: "text-7xl max-lg:text-6xl max-md:text-5xl"
|
|
5141
|
-
}, mergeDefaults(themeDefaults.pageTitle, { semibold: true }), LineHeightTheme.createForPageTitle());
|
|
5169
|
+
const pageTitleTheme = createTypographyComponentTheme("h1", "text-balance tracking-tight w-fit", FontSizeTheme.createForPageTitle(), mergeDefaults(themeDefaults.pageTitle, { semibold: true }), LineHeightTheme.createForPageTitle());
|
|
5142
5170
|
// Section title specific theme
|
|
5143
|
-
const sectionTitleTheme = createTypographyComponentTheme("h2", "text-balance w-fit", {
|
|
5144
|
-
xs: "text-2xl max-lg:text-xl max-md:text-lg",
|
|
5145
|
-
sm: "text-3xl max-lg:text-2xl max-md:text-xl",
|
|
5146
|
-
md: "text-4xl max-lg:text-3xl max-md:text-2xl",
|
|
5147
|
-
lg: "text-5xl max-lg:text-4xl max-md:text-3xl",
|
|
5148
|
-
xl: "text-6xl max-lg:text-5xl max-md:text-4xl"
|
|
5149
|
-
}, mergeDefaults(themeDefaults.sectionTitle, { semibold: true }), LineHeightTheme.createForSectionTitle());
|
|
5171
|
+
const sectionTitleTheme = createTypographyComponentTheme("h2", "text-balance w-fit", FontSizeTheme.createForSectionTitle(), mergeDefaults(themeDefaults.sectionTitle, { semibold: true }), LineHeightTheme.createForSectionTitle());
|
|
5150
5172
|
// Title specific theme
|
|
5151
|
-
const titleTheme = createTypographyComponentTheme("h3", "text-balance w-fit",
|
|
5173
|
+
const titleTheme = createTypographyComponentTheme("h3", "text-balance w-fit", FontSizeTheme.createForTitle(), mergeDefaults(themeDefaults.title, { semibold: true }), LineHeightTheme.createForTitle());
|
|
5152
5174
|
// Text specific theme
|
|
5153
|
-
const textTheme = createTypographyComponentTheme("p", "p-0 m-0 w-fit",
|
|
5175
|
+
const textTheme = createTypographyComponentTheme("p", "p-0 m-0 w-fit", new FontSizeTheme(), themeDefaults.text);
|
|
5154
5176
|
// Link specific theme
|
|
5155
5177
|
const linkTheme = new ComponentTheme("a", "hover:underline w-fit cursor-pointer", {
|
|
5156
5178
|
size: {
|
|
5157
|
-
text: new
|
|
5179
|
+
text: new FontSizeTheme(),
|
|
5158
5180
|
},
|
|
5159
5181
|
appearance: {
|
|
5160
5182
|
text: GenericVariantTheme.createTypographyTextTheme(),
|
|
@@ -5165,7 +5187,7 @@ const linkTheme = new ComponentTheme("a", "hover:underline w-fit cursor-pointer"
|
|
|
5165
5187
|
// List specific theme
|
|
5166
5188
|
const listItemTheme = new ComponentTheme("li", "", {
|
|
5167
5189
|
size: {
|
|
5168
|
-
text: new
|
|
5190
|
+
text: new FontSizeTheme(),
|
|
5169
5191
|
},
|
|
5170
5192
|
appearance: {
|
|
5171
5193
|
text: GenericVariantTheme.createTypographyTextTheme(),
|
|
@@ -5176,7 +5198,7 @@ const listItemTheme = new ComponentTheme("li", "", {
|
|
|
5176
5198
|
// List specific theme
|
|
5177
5199
|
const listTheme = new ComponentTheme("ul", "list-inside", {
|
|
5178
5200
|
size: {
|
|
5179
|
-
text: new
|
|
5201
|
+
text: new FontSizeTheme(),
|
|
5180
5202
|
paddingLeft: new PlTheme(),
|
|
5181
5203
|
},
|
|
5182
5204
|
appearance: {
|
|
@@ -5216,6 +5238,7 @@ const defaultCardTheme = new ComponentTheme("div", "", {
|
|
|
5216
5238
|
size: {
|
|
5217
5239
|
px: new PxTheme(),
|
|
5218
5240
|
py: new PyTheme(),
|
|
5241
|
+
lineHeight: LineHeightTheme.createDefault(),
|
|
5219
5242
|
gap: new GapTheme(true),
|
|
5220
5243
|
},
|
|
5221
5244
|
layout: {
|
|
@@ -5271,6 +5294,31 @@ const defaultDividerTheme = new ComponentTheme("div", "h-px w-full", {
|
|
|
5271
5294
|
layout: defaultLayoutsThemes,
|
|
5272
5295
|
}, themeDefaults.divider, DIVIDER_CATEGORIES);
|
|
5273
5296
|
|
|
5297
|
+
class SizeTheme extends BaseTheme {
|
|
5298
|
+
constructor(sizeMap) {
|
|
5299
|
+
super();
|
|
5300
|
+
/** Extra-small size variant */
|
|
5301
|
+
this.xs = "";
|
|
5302
|
+
/** Small size variant */
|
|
5303
|
+
this.sm = "";
|
|
5304
|
+
/** Medium size variant (default) */
|
|
5305
|
+
this.md = "";
|
|
5306
|
+
/** Large size variant */
|
|
5307
|
+
this.lg = "";
|
|
5308
|
+
/** Extra-large size variant */
|
|
5309
|
+
this.xl = "";
|
|
5310
|
+
ComponentKeys.size.forEach((key) => {
|
|
5311
|
+
var _a;
|
|
5312
|
+
this[key] = (_a = sizeMap === null || sizeMap === void 0 ? void 0 : sizeMap[key]) !== null && _a !== void 0 ? _a : "";
|
|
5313
|
+
});
|
|
5314
|
+
}
|
|
5315
|
+
getClasses(extractedKeys) {
|
|
5316
|
+
var _a;
|
|
5317
|
+
const size = (_a = extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.size) !== null && _a !== void 0 ? _a : 'md';
|
|
5318
|
+
return size ? [this[size]] : [''];
|
|
5319
|
+
}
|
|
5320
|
+
}
|
|
5321
|
+
|
|
5274
5322
|
const defaultContainerTheme = new ComponentTheme("div", "flex-col mx-auto w-full", {
|
|
5275
5323
|
size: {
|
|
5276
5324
|
gap: new GapTheme(),
|
|
@@ -5338,16 +5386,15 @@ const defaultStackTheme = new ComponentTheme("div", "", {
|
|
|
5338
5386
|
}
|
|
5339
5387
|
}, themeDefaults.stack, STACK_CATEGORIES);
|
|
5340
5388
|
|
|
5341
|
-
const sectionAspectRatioClasses = {
|
|
5342
|
-
xs: "[--aspect-ratio:2.5]",
|
|
5343
|
-
sm: "[--aspect-ratio:2]",
|
|
5344
|
-
md: "[--aspect-ratio:1.75]",
|
|
5345
|
-
lg: "[--aspect-ratio:1.6]",
|
|
5346
|
-
xl: "[--aspect-ratio:1.5]",
|
|
5347
|
-
};
|
|
5348
5389
|
const defaultSectionTheme = new ComponentTheme("div", "w-full", {
|
|
5349
5390
|
size: {
|
|
5350
|
-
px: new PxTheme(
|
|
5391
|
+
px: new PxTheme({
|
|
5392
|
+
xs: "[--aspect-ratio:2.5]",
|
|
5393
|
+
sm: "[--aspect-ratio:2]",
|
|
5394
|
+
md: "[--aspect-ratio:1.75]",
|
|
5395
|
+
lg: "[--aspect-ratio:1.6]",
|
|
5396
|
+
xl: "[--aspect-ratio:1.5]",
|
|
5397
|
+
}),
|
|
5351
5398
|
py: new PyTheme({
|
|
5352
5399
|
xs: "[--py-unit:4]",
|
|
5353
5400
|
sm: "[--py-unit:8]",
|
|
@@ -5405,7 +5452,7 @@ const defaultCheckboxTheme = new ComponentTheme("input", "peer col-start-1 row-s
|
|
|
5405
5452
|
lg: 'h-4.5 w-4.5',
|
|
5406
5453
|
xl: 'h-5 w-5'
|
|
5407
5454
|
}),
|
|
5408
|
-
text: new
|
|
5455
|
+
text: new FontSizeTheme()
|
|
5409
5456
|
},
|
|
5410
5457
|
layout: {
|
|
5411
5458
|
...defaultLayoutsThemes,
|
|
@@ -5457,7 +5504,8 @@ const defaultCheckboxWrapperTheme = new ComponentTheme("span", "", {
|
|
|
5457
5504
|
|
|
5458
5505
|
const defaultLabelTheme = new ComponentTheme("label", "has-[input]:cursor-pointer cursor-default", {
|
|
5459
5506
|
size: {
|
|
5460
|
-
text: new
|
|
5507
|
+
text: new FontSizeTheme(),
|
|
5508
|
+
lineHeight: LineHeightTheme.createDefault(),
|
|
5461
5509
|
gap: new GapTheme(true),
|
|
5462
5510
|
},
|
|
5463
5511
|
appearance: {
|
|
@@ -5489,20 +5537,19 @@ const defaultImgTheme = new ComponentTheme("img", "object-cover", // Default to
|
|
|
5489
5537
|
}
|
|
5490
5538
|
}, themeDefaults.img, IMG_CATEGORIES);
|
|
5491
5539
|
|
|
5492
|
-
// Input aspect ratios (same as button)
|
|
5493
|
-
const inputAspectRatioClasses = {
|
|
5494
|
-
xs: "[--aspect-ratio:2]",
|
|
5495
|
-
sm: "[--aspect-ratio:2]",
|
|
5496
|
-
md: "[--aspect-ratio:2]",
|
|
5497
|
-
lg: "[--aspect-ratio:2]",
|
|
5498
|
-
xl: "[--aspect-ratio:2]",
|
|
5499
|
-
};
|
|
5500
5540
|
const defaultInputTheme = new ComponentTheme("input", "w-full transition-all duration-200", {
|
|
5501
5541
|
size: {
|
|
5502
|
-
px: new PxTheme(
|
|
5542
|
+
px: new PxTheme({
|
|
5543
|
+
xs: "[--aspect-ratio:2]",
|
|
5544
|
+
sm: "[--aspect-ratio:2]",
|
|
5545
|
+
md: "[--aspect-ratio:2]",
|
|
5546
|
+
lg: "[--aspect-ratio:2]",
|
|
5547
|
+
xl: "[--aspect-ratio:2]",
|
|
5548
|
+
}, true),
|
|
5503
5549
|
py: new PyTheme(uiPaddingClasses, true),
|
|
5504
5550
|
gap: new GapTheme(true),
|
|
5505
|
-
text: new
|
|
5551
|
+
text: new FontSizeTheme(),
|
|
5552
|
+
lineHeight: LineHeightTheme.createDefault(),
|
|
5506
5553
|
},
|
|
5507
5554
|
appearance: {
|
|
5508
5555
|
background: GenericVariantTheme.createSimpleUIElementBgAppearanceTheme(),
|