@vaneui/ui 0.3.1-alpha.20250930203841.cec91ca → 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.
Files changed (38) hide show
  1. package/dist/components/ui/theme/badgeTheme.d.ts +4 -2
  2. package/dist/components/ui/theme/badgeTheme.d.ts.map +1 -1
  3. package/dist/components/ui/theme/buttonTheme.d.ts +4 -2
  4. package/dist/components/ui/theme/buttonTheme.d.ts.map +1 -1
  5. package/dist/components/ui/theme/cardTheme.d.ts +2 -0
  6. package/dist/components/ui/theme/cardTheme.d.ts.map +1 -1
  7. package/dist/components/ui/theme/checkboxTheme.d.ts +1 -1
  8. package/dist/components/ui/theme/checkboxTheme.d.ts.map +1 -1
  9. package/dist/components/ui/theme/chipTheme.d.ts +4 -2
  10. package/dist/components/ui/theme/chipTheme.d.ts.map +1 -1
  11. package/dist/components/ui/theme/codeTheme.d.ts +4 -2
  12. package/dist/components/ui/theme/codeTheme.d.ts.map +1 -1
  13. package/dist/components/ui/theme/common/ComponentTheme.d.ts +0 -2
  14. package/dist/components/ui/theme/common/ComponentTheme.d.ts.map +1 -1
  15. package/dist/components/ui/theme/inputTheme.d.ts +4 -2
  16. package/dist/components/ui/theme/inputTheme.d.ts.map +1 -1
  17. package/dist/components/ui/theme/labelTheme.d.ts +3 -1
  18. package/dist/components/ui/theme/labelTheme.d.ts.map +1 -1
  19. package/dist/components/ui/theme/sectionTheme.d.ts.map +1 -1
  20. package/dist/components/ui/theme/size/fontSizeTheme.d.ts.map +1 -0
  21. package/dist/components/ui/theme/{typography → size}/lineHeightTheme.d.ts +1 -0
  22. package/dist/components/ui/theme/size/lineHeightTheme.d.ts.map +1 -0
  23. package/dist/components/ui/theme/size/pxTheme.d.ts +1 -1
  24. package/dist/components/ui/theme/size/pxTheme.d.ts.map +1 -1
  25. package/dist/components/ui/theme/size/sizeTheme.d.ts +1 -4
  26. package/dist/components/ui/theme/size/sizeTheme.d.ts.map +1 -1
  27. package/dist/components/ui/theme/typographyTheme.d.ts +3 -2
  28. package/dist/components/ui/theme/typographyTheme.d.ts.map +1 -1
  29. package/dist/index.esm.js +118 -121
  30. package/dist/index.esm.js.map +1 -1
  31. package/dist/index.js +118 -121
  32. package/dist/index.js.map +1 -1
  33. package/dist/ui.css +27 -7
  34. package/dist/vars.css +9 -5
  35. package/package.json +1 -1
  36. package/dist/components/ui/theme/typography/fontSizeTheme.d.ts.map +0 -1
  37. package/dist/components/ui/theme/typography/lineHeightTheme.d.ts.map +0 -1
  38. /package/dist/components/ui/theme/{typography → size}/fontSizeTheme.d.ts +0 -0
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) {
@@ -3736,9 +3677,9 @@ class FontSizeTheme extends BaseTheme {
3736
3677
  getClasses(extractedKeys) {
3737
3678
  if (extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.size) {
3738
3679
  const fsUnitClass = this[extractedKeys.size];
3739
- return fsUnitClass ? [fsUnitClass, "text-(--fs)"] : [];
3680
+ return fsUnitClass ? [fsUnitClass, "text-(length:--fs)"] : [];
3740
3681
  }
3741
- return [this.md, "text-(--fs)"];
3682
+ return [this.md, "text-(length:--fs)"];
3742
3683
  }
3743
3684
  // Static factory methods for different text size ranges
3744
3685
  static createForPageTitle() {
@@ -3770,40 +3711,64 @@ class FontSizeTheme extends BaseTheme {
3770
3711
  }
3771
3712
  }
3772
3713
 
3773
- class SizeTheme extends BaseTheme {
3774
- constructor(sizeMap, useDefaultKey = true) {
3714
+ class LineHeightTheme extends BaseTheme {
3715
+ constructor(customMapping) {
3775
3716
  super();
3776
- /** Extra-small size variant */
3777
- this.xs = "";
3778
- /** Small size variant */
3779
- this.sm = "";
3780
- /** Medium size variant (default) */
3781
- this.md = "";
3782
- /** Large size variant */
3783
- this.lg = "";
3784
- /** Extra-large size variant */
3785
- this.xl = "";
3786
- this.useDefaultKey = useDefaultKey;
3787
- if (sizeMap instanceof FontSizeTheme) {
3788
- this.fontSizeTheme = sizeMap;
3789
- ComponentKeys.size.forEach((key) => {
3790
- this[key] = sizeMap[key];
3791
- });
3792
- }
3793
- else {
3794
- ComponentKeys.size.forEach((key) => {
3795
- var _a;
3796
- this[key] = (_a = sizeMap === null || sizeMap === void 0 ? void 0 : sizeMap[key]) !== null && _a !== void 0 ? _a : "";
3797
- });
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;
3798
3733
  }
3799
3734
  }
3800
3735
  getClasses(extractedKeys) {
3801
- var _a;
3802
- if (this.fontSizeTheme) {
3803
- return this.fontSizeTheme.getClasses(extractedKeys);
3736
+ if (extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.size) {
3737
+ const lhUnitClass = this[extractedKeys.size];
3738
+ return lhUnitClass ? [lhUnitClass, "leading-(--lh)"] : [];
3804
3739
  }
3805
- const size = (_a = extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.size) !== null && _a !== void 0 ? _a : (this.useDefaultKey ? 'md' : undefined);
3806
- return size ? [this[size]] : [''];
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
+ });
3807
3772
  }
3808
3773
  }
3809
3774
 
@@ -4026,9 +3991,9 @@ class PaddingTheme extends BaseTheme {
4026
3991
 
4027
3992
  /** Horizontal padding theme - controls left and right padding */
4028
3993
  class PxTheme extends PaddingTheme {
4029
- constructor(aspectRatioMap, isUIComponent = false) {
3994
+ constructor(aspectRatio, isUIComponent = false) {
4030
3995
  super();
4031
- this.aspectRatioMap = aspectRatioMap;
3996
+ this.aspectRatioMap = aspectRatio;
4032
3997
  this.isUIComponent = isUIComponent;
4033
3998
  // PxTheme should not set any padding classes - that's PyTheme's job
4034
3999
  // PxTheme only handles aspect-ratio
@@ -4906,7 +4871,6 @@ const themeDefaults = {
4906
4871
  },
4907
4872
  };
4908
4873
 
4909
- // Button-specific aspect ratios (px-2,3,4,5,6 vs py-1,1.5,2,2.5,3)
4910
4874
  const buttonAspectRatioClasses = {
4911
4875
  xs: "[--aspect-ratio:2]", // px-2 vs py-1 = 2
4912
4876
  sm: "[--aspect-ratio:2]", // px-3 vs py-1.5 = 2
@@ -4919,7 +4883,14 @@ const defaultButtonTheme = new ComponentTheme("button", "w-fit h-fit cursor-poin
4919
4883
  px: new PxTheme(buttonAspectRatioClasses, true),
4920
4884
  py: new PyTheme(uiPaddingClasses, true),
4921
4885
  gap: new GapTheme(true),
4922
- text: new SizeTheme({ xs: 'text-xs', sm: 'text-sm', md: 'text-base', lg: 'text-lg', xl: 'text-xl' }),
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
+ }),
4923
4894
  },
4924
4895
  appearance: {
4925
4896
  background: GenericVariantTheme.createBgAppearanceTheme(),
@@ -4957,7 +4928,8 @@ const defaultBadgeTheme = new ComponentTheme("span", "w-fit h-fit transition-all
4957
4928
  px: new PxTheme(badgeAspectRatioClasses, true),
4958
4929
  py: new PyTheme(uiPaddingClasses, true),
4959
4930
  gap: new GapTheme(true),
4960
- text: new SizeTheme({ xs: 'text-xs', sm: 'text-sm', md: 'text-base', lg: 'text-lg', xl: 'text-xl' })
4931
+ text: new FontSizeTheme(),
4932
+ lineHeight: LineHeightTheme.createDefault()
4961
4933
  },
4962
4934
  appearance: {
4963
4935
  background: GenericVariantTheme.createSimpleUIElementBgAppearanceTheme(),
@@ -4999,7 +4971,8 @@ const defaultChipTheme = new ComponentTheme("span", "w-fit h-fit transition-all
4999
4971
  size: {
5000
4972
  px: new PxTheme(chipAspectRatioClasses, true),
5001
4973
  py: new PyTheme(chipPyClasses, true),
5002
- text: new SizeTheme({ xs: 'text-xs', sm: 'text-sm', md: 'text-base', lg: 'text-lg', xl: 'text-xl' }),
4974
+ text: new FontSizeTheme(),
4975
+ lineHeight: LineHeightTheme.createDefault(),
5003
4976
  gap: new GapTheme(true)
5004
4977
  },
5005
4978
  appearance: {
@@ -5042,7 +5015,8 @@ const defaultCodeTheme = new ComponentTheme("code", "", {
5042
5015
  size: {
5043
5016
  px: new PxTheme(codeAspectRatioClasses, true),
5044
5017
  py: new PyTheme(codePyClasses, true),
5045
- text: new SizeTheme({ xs: 'text-xs', sm: 'text-sm', md: 'text-sm', lg: 'text-base', xl: 'text-lg' }),
5018
+ text: new FontSizeTheme(),
5019
+ lineHeight: LineHeightTheme.createDefault(),
5046
5020
  gap: new GapTheme(true)
5047
5021
  },
5048
5022
  appearance: {
@@ -5175,18 +5149,16 @@ class ListStyleTheme extends BaseTheme {
5175
5149
  }
5176
5150
  }
5177
5151
 
5178
- const createTypographyComponentTheme = (tag, base = "text-balance", fontSizeTheme = new FontSizeTheme(), defaults = {}, lineHeightTheme) => {
5179
- const typographyThemes = lineHeightTheme
5180
- ? { ...defaultTypographyThemes, lineHeight: lineHeightTheme }
5181
- : defaultTypographyThemes;
5152
+ const createTypographyComponentTheme = (tag, base = "text-balance", fontSizeTheme = new FontSizeTheme(), defaults = {}, lineHeightTheme = LineHeightTheme.createDefault()) => {
5182
5153
  return new ComponentTheme(tag, base, {
5183
5154
  size: {
5184
5155
  text: fontSizeTheme,
5156
+ lineHeight: lineHeightTheme,
5185
5157
  },
5186
5158
  appearance: {
5187
5159
  text: GenericVariantTheme.createTypographyTextTheme(),
5188
5160
  },
5189
- typography: typographyThemes,
5161
+ typography: defaultTypographyThemes,
5190
5162
  layout: defaultLayoutsThemes,
5191
5163
  }, defaults, TYPOGRAPHY_CATEGORIES, (props) => {
5192
5164
  // Determine tag based on href prop
@@ -5266,6 +5238,7 @@ const defaultCardTheme = new ComponentTheme("div", "", {
5266
5238
  size: {
5267
5239
  px: new PxTheme(),
5268
5240
  py: new PyTheme(),
5241
+ lineHeight: LineHeightTheme.createDefault(),
5269
5242
  gap: new GapTheme(true),
5270
5243
  },
5271
5244
  layout: {
@@ -5321,6 +5294,31 @@ const defaultDividerTheme = new ComponentTheme("div", "h-px w-full", {
5321
5294
  layout: defaultLayoutsThemes,
5322
5295
  }, themeDefaults.divider, DIVIDER_CATEGORIES);
5323
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
+
5324
5322
  const defaultContainerTheme = new ComponentTheme("div", "flex-col mx-auto w-full", {
5325
5323
  size: {
5326
5324
  gap: new GapTheme(),
@@ -5388,16 +5386,15 @@ const defaultStackTheme = new ComponentTheme("div", "", {
5388
5386
  }
5389
5387
  }, themeDefaults.stack, STACK_CATEGORIES);
5390
5388
 
5391
- const sectionAspectRatioClasses = {
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
- };
5398
5389
  const defaultSectionTheme = new ComponentTheme("div", "w-full", {
5399
5390
  size: {
5400
- px: new PxTheme(sectionAspectRatioClasses),
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
+ }),
5401
5398
  py: new PyTheme({
5402
5399
  xs: "[--py-unit:4]",
5403
5400
  sm: "[--py-unit:8]",
@@ -5508,6 +5505,7 @@ const defaultCheckboxWrapperTheme = new ComponentTheme("span", "", {
5508
5505
  const defaultLabelTheme = new ComponentTheme("label", "has-[input]:cursor-pointer cursor-default", {
5509
5506
  size: {
5510
5507
  text: new FontSizeTheme(),
5508
+ lineHeight: LineHeightTheme.createDefault(),
5511
5509
  gap: new GapTheme(true),
5512
5510
  },
5513
5511
  appearance: {
@@ -5539,20 +5537,19 @@ const defaultImgTheme = new ComponentTheme("img", "object-cover", // Default to
5539
5537
  }
5540
5538
  }, themeDefaults.img, IMG_CATEGORIES);
5541
5539
 
5542
- // Input aspect ratios (same as button)
5543
- const inputAspectRatioClasses = {
5544
- xs: "[--aspect-ratio:2]",
5545
- sm: "[--aspect-ratio:2]",
5546
- md: "[--aspect-ratio:2]",
5547
- lg: "[--aspect-ratio:2]",
5548
- xl: "[--aspect-ratio:2]",
5549
- };
5550
5540
  const defaultInputTheme = new ComponentTheme("input", "w-full transition-all duration-200", {
5551
5541
  size: {
5552
- px: new PxTheme(inputAspectRatioClasses, true),
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),
5553
5549
  py: new PyTheme(uiPaddingClasses, true),
5554
5550
  gap: new GapTheme(true),
5555
- text: new SizeTheme({ xs: 'text-xs', sm: 'text-sm', md: 'text-base', lg: 'text-lg', xl: 'text-xl' }),
5551
+ text: new FontSizeTheme(),
5552
+ lineHeight: LineHeightTheme.createDefault(),
5556
5553
  },
5557
5554
  appearance: {
5558
5555
  background: GenericVariantTheme.createSimpleUIElementBgAppearanceTheme(),