@vaneui/ui 0.3.1-alpha.20251002123640.8bde935 → 0.3.1-alpha.20251110144303.5af7508

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/index.js CHANGED
@@ -3766,42 +3766,25 @@ class LineHeightTheme extends BaseTheme {
3766
3766
  }
3767
3767
  }
3768
3768
 
3769
- // Reusable layout classes used by multiple components
3770
- const layoutGapClasses = {
3771
- xs: "[--gap-unit:2]",
3772
- sm: "[--gap-unit:3]",
3773
- md: "[--gap-unit:4]",
3774
- lg: "[--gap-unit:5]",
3775
- xl: "[--gap-unit:6]",
3776
- };
3777
- const layoutPaddingClasses = {
3778
- xs: "[--py-unit:2]",
3779
- sm: "[--py-unit:3]",
3780
- md: "[--py-unit:4]",
3781
- lg: "[--py-unit:5]",
3782
- xl: "[--py-unit:6]",
3783
- };
3784
- // Reusable UI component classes used by multiple components
3785
- const uiPaddingClasses = {
3786
- xs: "[--py-unit:1]",
3787
- sm: "[--py-unit:1.5]",
3788
- md: "[--py-unit:2]",
3789
- lg: "[--py-unit:2.5]",
3790
- xl: "[--py-unit:3]",
3791
- };
3792
- const uiGapClasses = {
3793
- xs: "[--gap-unit:1]",
3794
- sm: "[--gap-unit:1.5]",
3795
- md: "[--gap-unit:2]",
3796
- lg: "[--gap-unit:2.5]",
3797
- xl: "[--gap-unit:3]",
3798
- };
3799
-
3800
3769
  class GapTheme extends BaseTheme {
3801
3770
  constructor(isUIComponent = false) {
3802
3771
  super();
3803
3772
  this.gapVarClass = isUIComponent ? "gap-(--ui-gap)" : "gap-(--gap)";
3804
- const gapClasses = isUIComponent ? uiGapClasses : layoutGapClasses;
3773
+ const gapClasses = isUIComponent
3774
+ ? {
3775
+ xs: "[--gap-unit:1]",
3776
+ sm: "[--gap-unit:1.5]",
3777
+ md: "[--gap-unit:2]",
3778
+ lg: "[--gap-unit:2.5]",
3779
+ xl: "[--gap-unit:3]",
3780
+ }
3781
+ : {
3782
+ xs: "[--gap-unit:2]",
3783
+ sm: "[--gap-unit:3]",
3784
+ md: "[--gap-unit:4]",
3785
+ lg: "[--gap-unit:5]",
3786
+ xl: "[--gap-unit:6]",
3787
+ };
3805
3788
  this.xs = gapClasses.xs;
3806
3789
  this.sm = gapClasses.sm;
3807
3790
  this.md = gapClasses.md;
@@ -3987,7 +3970,13 @@ class PaddingTheme extends BaseTheme {
3987
3970
  class PxTheme extends PaddingTheme {
3988
3971
  constructor(aspectRatio, isUIComponent = false) {
3989
3972
  super();
3990
- this.aspectRatioMap = aspectRatio;
3973
+ this.aspectRatioMap = aspectRatio ? aspectRatio : {
3974
+ xs: "[--aspect-ratio:1]",
3975
+ sm: "[--aspect-ratio:1]",
3976
+ md: "[--aspect-ratio:1]",
3977
+ lg: "[--aspect-ratio:1]",
3978
+ xl: "[--aspect-ratio:1]",
3979
+ };
3991
3980
  this.isUIComponent = isUIComponent;
3992
3981
  // PxTheme should not set any padding classes - that's PyTheme's job
3993
3982
  // PxTheme only handles aspect-ratio
@@ -4018,7 +4007,13 @@ class PyTheme extends PaddingTheme {
4018
4007
  // Override with PyTheme's default classes if no custom sizeMap provided
4019
4008
  if (!sizeMap) {
4020
4009
  ComponentKeys.size.forEach((key) => {
4021
- this[key] = layoutPaddingClasses[key];
4010
+ this[key] = {
4011
+ xs: "[--py-unit:2]",
4012
+ sm: "[--py-unit:3]",
4013
+ md: "[--py-unit:4]",
4014
+ lg: "[--py-unit:5]",
4015
+ xl: "[--py-unit:6]",
4016
+ }[key];
4022
4017
  });
4023
4018
  }
4024
4019
  }
@@ -4034,6 +4029,15 @@ class PyTheme extends PaddingTheme {
4034
4029
  }
4035
4030
  return [];
4036
4031
  }
4032
+ static createForUI() {
4033
+ return new PyTheme({
4034
+ xs: "[--py-unit:1]",
4035
+ sm: "[--py-unit:1.5]",
4036
+ md: "[--py-unit:2]",
4037
+ lg: "[--py-unit:2.5]",
4038
+ xl: "[--py-unit:3]",
4039
+ }, true);
4040
+ }
4037
4041
  }
4038
4042
 
4039
4043
  class AppearanceTheme extends BaseTheme {
@@ -4876,7 +4880,7 @@ const buttonAspectRatioClasses = {
4876
4880
  const defaultButtonTheme = new ComponentTheme("button", "w-fit h-fit cursor-pointer transition-all duration-200 whitespace-nowrap", {
4877
4881
  size: {
4878
4882
  px: new PxTheme(buttonAspectRatioClasses, true),
4879
- py: new PyTheme(uiPaddingClasses, true),
4883
+ py: PyTheme.createForUI(),
4880
4884
  gap: new GapTheme(true),
4881
4885
  text: new FontSizeTheme(),
4882
4886
  lineHeight: new LineHeightTheme({
@@ -4921,7 +4925,7 @@ const badgeAspectRatioClasses = {
4921
4925
  const defaultBadgeTheme = new ComponentTheme("span", "w-fit h-fit transition-all duration-200 whitespace-nowrap", {
4922
4926
  size: {
4923
4927
  px: new PxTheme(badgeAspectRatioClasses, true),
4924
- py: new PyTheme(uiPaddingClasses, true),
4928
+ py: PyTheme.createForUI(),
4925
4929
  gap: new GapTheme(true),
4926
4930
  text: new FontSizeTheme(),
4927
4931
  lineHeight: LineHeightTheme.createDefault()
@@ -4948,26 +4952,30 @@ const defaultBadgeTheme = new ComponentTheme("span", "w-fit h-fit transition-all
4948
4952
  return props.href ? "a" : "span";
4949
4953
  });
4950
4954
 
4951
- const chipAspectRatioClasses = {
4952
- xs: "[--aspect-ratio:2]",
4953
- sm: "[--aspect-ratio:2]",
4954
- md: "[--aspect-ratio:2]",
4955
- lg: "[--aspect-ratio:2]",
4956
- xl: "[--aspect-ratio:2]",
4957
- };
4958
- const chipPyClasses = {
4959
- xs: "[--py-unit:0.5]",
4960
- sm: "[--py-unit:1]",
4961
- md: "[--py-unit:1.5]",
4962
- lg: "[--py-unit:2]",
4963
- xl: "[--py-unit:2.5]",
4964
- };
4965
4955
  const defaultChipTheme = new ComponentTheme("span", "w-fit h-fit transition-all duration-200 whitespace-nowrap", {
4966
4956
  size: {
4967
- px: new PxTheme(chipAspectRatioClasses, true),
4968
- py: new PyTheme(chipPyClasses, true),
4957
+ px: new PxTheme({
4958
+ xs: "[--aspect-ratio:2]",
4959
+ sm: "[--aspect-ratio:2]",
4960
+ md: "[--aspect-ratio:2]",
4961
+ lg: "[--aspect-ratio:2]",
4962
+ xl: "[--aspect-ratio:2]",
4963
+ }, true),
4964
+ py: new PyTheme({
4965
+ xs: "[--py-unit:0.5]",
4966
+ sm: "[--py-unit:1]",
4967
+ md: "[--py-unit:1.5]",
4968
+ lg: "[--py-unit:2]",
4969
+ xl: "[--py-unit:2.5]",
4970
+ }, true),
4969
4971
  text: new FontSizeTheme(),
4970
- lineHeight: LineHeightTheme.createDefault(),
4972
+ lineHeight: new LineHeightTheme({
4973
+ xs: "[--lh:1.2]",
4974
+ sm: "[--lh:1.2]",
4975
+ md: "[--lh:1.2]",
4976
+ lg: "[--lh:1.2]",
4977
+ xl: "[--lh:1.2]"
4978
+ }),
4971
4979
  gap: new GapTheme(true)
4972
4980
  },
4973
4981
  appearance: {
@@ -4992,26 +5000,30 @@ const defaultChipTheme = new ComponentTheme("span", "w-fit h-fit transition-all
4992
5000
  return props.href ? "a" : "span";
4993
5001
  });
4994
5002
 
4995
- const codeAspectRatioClasses = {
4996
- xs: "[--aspect-ratio:1.5]",
4997
- sm: "[--aspect-ratio:1.5]",
4998
- md: "[--aspect-ratio:1.5]",
4999
- lg: "[--aspect-ratio:1.5]",
5000
- xl: "[--aspect-ratio:1.5]",
5001
- };
5002
- const codePyClasses = {
5003
- xs: "[--py-unit:0.5]",
5004
- sm: "[--py-unit:0.5]",
5005
- md: "[--py-unit:1]",
5006
- lg: "[--py-unit:1]",
5007
- xl: "[--py-unit:1]",
5008
- };
5009
5003
  const defaultCodeTheme = new ComponentTheme("code", "", {
5010
5004
  size: {
5011
- px: new PxTheme(codeAspectRatioClasses, true),
5012
- py: new PyTheme(codePyClasses, true),
5005
+ px: new PxTheme({
5006
+ xs: "[--aspect-ratio:1.5]",
5007
+ sm: "[--aspect-ratio:1.5]",
5008
+ md: "[--aspect-ratio:1.5]",
5009
+ lg: "[--aspect-ratio:1.5]",
5010
+ xl: "[--aspect-ratio:1.5]",
5011
+ }, true),
5012
+ py: new PyTheme({
5013
+ xs: "[--py-unit:1]",
5014
+ sm: "[--py-unit:1.5]",
5015
+ md: "[--py-unit:1.5]",
5016
+ lg: "[--py-unit:2]",
5017
+ xl: "[--py-unit:2]",
5018
+ }, true),
5013
5019
  text: new FontSizeTheme(),
5014
- lineHeight: LineHeightTheme.createDefault(),
5020
+ lineHeight: new LineHeightTheme({
5021
+ xs: "[--lh:1.2]",
5022
+ sm: "[--lh:1.2]",
5023
+ md: "[--lh:1.2]",
5024
+ lg: "[--lh:1.2]",
5025
+ xl: "[--lh:1.2]"
5026
+ }),
5015
5027
  gap: new GapTheme(true)
5016
5028
  },
5017
5029
  appearance: {
@@ -5369,7 +5381,13 @@ const defaultColTheme = new ComponentTheme("div", "", {
5369
5381
 
5370
5382
  const defaultStackTheme = new ComponentTheme("div", "", {
5371
5383
  size: {
5372
- px: new PxTheme(),
5384
+ px: new PxTheme({
5385
+ xs: "[--aspect-ratio:1]",
5386
+ sm: "[--aspect-ratio:1]",
5387
+ md: "[--aspect-ratio:1]",
5388
+ lg: "[--aspect-ratio:1]",
5389
+ xl: "[--aspect-ratio:1]",
5390
+ }),
5373
5391
  py: new PyTheme(),
5374
5392
  gap: new GapTheme(),
5375
5393
  breakpoint: new BreakpointTheme(),
@@ -5551,7 +5569,7 @@ const defaultInputTheme = new ComponentTheme("input", "w-full transition-all dur
5551
5569
  lg: "[--aspect-ratio:2]",
5552
5570
  xl: "[--aspect-ratio:2]",
5553
5571
  }, true),
5554
- py: new PyTheme(uiPaddingClasses, true),
5572
+ py: PyTheme.createForUI(),
5555
5573
  gap: new GapTheme(true),
5556
5574
  text: new FontSizeTheme(),
5557
5575
  lineHeight: LineHeightTheme.createDefault(),