@vaneui/ui 0.3.1-alpha.20250921204254.9cfeae4 → 0.3.1-alpha.20250925201320.8b6a424

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
@@ -3687,11 +3687,11 @@ const layoutGapClasses = {
3687
3687
  xl: "[--gap-unit:6]",
3688
3688
  };
3689
3689
  const layoutPaddingClasses = {
3690
- xs: "[--h-unit:2]",
3691
- sm: "[--h-unit:3]",
3692
- md: "[--h-unit:4]",
3693
- lg: "[--h-unit:5]",
3694
- xl: "[--h-unit:6]",
3690
+ xs: "[--py-unit:2]",
3691
+ sm: "[--py-unit:3]",
3692
+ md: "[--py-unit:4]",
3693
+ lg: "[--py-unit:5]",
3694
+ xl: "[--py-unit:6]",
3695
3695
  };
3696
3696
  const sectionAspectRatioClasses = {
3697
3697
  xs: "[--aspect-ratio:2.5]",
@@ -3700,9 +3700,71 @@ const sectionAspectRatioClasses = {
3700
3700
  lg: "[--aspect-ratio:1.6]",
3701
3701
  xl: "[--aspect-ratio:1.5]",
3702
3702
  };
3703
+ // UI component classes
3704
+ const uiPaddingClasses = {
3705
+ xs: "[--py-unit:1]",
3706
+ sm: "[--py-unit:1.5]",
3707
+ md: "[--py-unit:2]",
3708
+ lg: "[--py-unit:2.5]",
3709
+ xl: "[--py-unit:3]",
3710
+ };
3711
+ // Button-specific aspect ratios (px-2,3,4,5,6 vs py-1,1.5,2,2.5,3)
3712
+ const buttonAspectRatioClasses = {
3713
+ xs: "[--aspect-ratio:2]", // px-2 vs py-1 = 2
3714
+ sm: "[--aspect-ratio:2]", // px-3 vs py-1.5 = 2
3715
+ md: "[--aspect-ratio:2]", // px-4 vs py-2 = 2
3716
+ lg: "[--aspect-ratio:2]", // px-5 vs py-2.5 = 2
3717
+ xl: "[--aspect-ratio:2]", // px-6 vs py-3 = 2
3718
+ };
3719
+ // Badge aspect ratios (same as button)
3720
+ const badgeAspectRatioClasses = {
3721
+ xs: "[--aspect-ratio:2]",
3722
+ sm: "[--aspect-ratio:2]",
3723
+ md: "[--aspect-ratio:2]",
3724
+ lg: "[--aspect-ratio:2]",
3725
+ xl: "[--aspect-ratio:2]",
3726
+ };
3727
+ // Input aspect ratios (same as button)
3728
+ const inputAspectRatioClasses = {
3729
+ xs: "[--aspect-ratio:2]",
3730
+ sm: "[--aspect-ratio:2]",
3731
+ md: "[--aspect-ratio:2]",
3732
+ lg: "[--aspect-ratio:2]",
3733
+ xl: "[--aspect-ratio:2]",
3734
+ };
3735
+ // Code-specific classes (px-1,1.5,1.5,2,2 vs py-0,0.5,1,1,1)
3736
+ const codeAspectRatioClasses = {
3737
+ xs: "[--aspect-ratio:1]", // px-1 vs py-0 (but py-0 is 0, so use py-unit but ratio for px)
3738
+ sm: "[--aspect-ratio:3]", // px-1.5 vs py-0.5 = 3
3739
+ md: "[--aspect-ratio:1.5]", // px-1.5 vs py-1 = 1.5
3740
+ lg: "[--aspect-ratio:2]", // px-2 vs py-1 = 2
3741
+ xl: "[--aspect-ratio:2]", // px-2 vs py-1 = 2
3742
+ };
3743
+ const codePyClasses = {
3744
+ xs: "[--py-unit:0]",
3745
+ sm: "[--py-unit:0.5]",
3746
+ md: "[--py-unit:1]",
3747
+ lg: "[--py-unit:1]",
3748
+ xl: "[--py-unit:1]",
3749
+ };
3750
+ // Chip-specific classes (px-2,2.5,3,3.5,4 vs py-0.5,1,1.5,2,2.5)
3751
+ const chipAspectRatioClasses = {
3752
+ xs: "[--aspect-ratio:4]", // px-2 vs py-0.5 = 4
3753
+ sm: "[--aspect-ratio:2.5]", // px-2.5 vs py-1 = 2.5
3754
+ md: "[--aspect-ratio:2]", // px-3 vs py-1.5 = 2
3755
+ lg: "[--aspect-ratio:1.75]", // px-3.5 vs py-2 = 1.75
3756
+ xl: "[--aspect-ratio:1.6]", // px-4 vs py-2.5 = 1.6
3757
+ };
3758
+ const chipPyClasses = {
3759
+ xs: "[--py-unit:0.5]",
3760
+ sm: "[--py-unit:1]",
3761
+ md: "[--py-unit:1.5]",
3762
+ lg: "[--py-unit:2]",
3763
+ xl: "[--py-unit:2.5]",
3764
+ };
3703
3765
 
3704
3766
  class GapTheme extends BaseTheme {
3705
- constructor(sizeMap) {
3767
+ constructor(sizeMap, isUIComponent = false) {
3706
3768
  super();
3707
3769
  /** Extra-small gap - uses CSS variable --layout-gap-xs */
3708
3770
  this.xs = layoutGapClasses.xs;
@@ -3714,6 +3776,7 @@ class GapTheme extends BaseTheme {
3714
3776
  this.lg = layoutGapClasses.lg;
3715
3777
  /** Extra-large gap - uses CSS variable --layout-gap-xl */
3716
3778
  this.xl = layoutGapClasses.xl;
3779
+ this.isUIComponent = isUIComponent;
3717
3780
  if (sizeMap) {
3718
3781
  ComponentKeys.size.forEach((key) => {
3719
3782
  if (sizeMap[key] !== undefined) {
@@ -3726,7 +3789,8 @@ class GapTheme extends BaseTheme {
3726
3789
  var _a;
3727
3790
  if ((extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.gap) === 'gap') {
3728
3791
  const gapClass = this[(_a = extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.size) !== null && _a !== void 0 ? _a : 'md'];
3729
- return gapClass ? [gapClass, "gap-(--gap)"] : [];
3792
+ const gapVar = this.isUIComponent ? "gap-(--ui-gap)" : "gap-(--gap)";
3793
+ return gapClass ? [gapClass, gapVar] : [];
3730
3794
  }
3731
3795
  return [];
3732
3796
  }
@@ -3890,9 +3954,10 @@ class PaddingTheme extends BaseTheme {
3890
3954
 
3891
3955
  /** Horizontal padding theme - controls left and right padding */
3892
3956
  class PxTheme extends PaddingTheme {
3893
- constructor(sizeMap, aspectRatioMap) {
3957
+ constructor(sizeMap, aspectRatioMap, isUIComponent = false) {
3894
3958
  super(sizeMap);
3895
3959
  this.aspectRatioMap = aspectRatioMap;
3960
+ this.isUIComponent = isUIComponent;
3896
3961
  // Override with PxTheme's default classes if no custom sizeMap provided
3897
3962
  if (!sizeMap) {
3898
3963
  ComponentKeys.size.forEach((key) => {
@@ -3911,7 +3976,9 @@ class PxTheme extends PaddingTheme {
3911
3976
  classes.push(paddingClass);
3912
3977
  if (aspectRatioClass)
3913
3978
  classes.push(aspectRatioClass);
3914
- classes.push("px-(--px)");
3979
+ // Use UI or layout CSS variables based on component type
3980
+ const cssVar = this.isUIComponent ? "px-(--ui-px)" : "px-(--px)";
3981
+ classes.push(cssVar);
3915
3982
  return classes.length > 1 ? classes : [];
3916
3983
  }
3917
3984
  return [];
@@ -3920,8 +3987,9 @@ class PxTheme extends PaddingTheme {
3920
3987
 
3921
3988
  /** Vertical padding theme - controls top and bottom padding */
3922
3989
  class PyTheme extends PaddingTheme {
3923
- constructor(sizeMap) {
3990
+ constructor(sizeMap, isUIComponent = false) {
3924
3991
  super(sizeMap);
3992
+ this.isUIComponent = isUIComponent;
3925
3993
  // Override with PyTheme's default classes if no custom sizeMap provided
3926
3994
  if (!sizeMap) {
3927
3995
  ComponentKeys.size.forEach((key) => {
@@ -3933,7 +4001,11 @@ class PyTheme extends PaddingTheme {
3933
4001
  var _a;
3934
4002
  if ((extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.padding) === 'padding' || (extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.padding) === undefined) {
3935
4003
  const paddingClass = this[(_a = extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.size) !== null && _a !== void 0 ? _a : 'md'];
3936
- return paddingClass ? [paddingClass, "py-(--py)"] : [];
4004
+ if (!paddingClass)
4005
+ return [];
4006
+ // Use UI or layout CSS variables based on component type
4007
+ const cssVar = this.isUIComponent ? "py-(--ui-py)" : "py-(--py)";
4008
+ return [paddingClass, cssVar];
3937
4009
  }
3938
4010
  return [];
3939
4011
  }
@@ -4609,6 +4681,7 @@ const themeDefaults = {
4609
4681
  section: {
4610
4682
  md: true,
4611
4683
  flex: true,
4684
+ column: true,
4612
4685
  default: true,
4613
4686
  itemsStart: true,
4614
4687
  gap: true,
@@ -4776,9 +4849,9 @@ const themeDefaults = {
4776
4849
 
4777
4850
  const defaultButtonTheme = new ComponentTheme("button", "w-fit h-fit cursor-pointer transition-all duration-200 whitespace-nowrap", {
4778
4851
  size: {
4779
- px: new PxTheme({ xs: 'px-2', sm: 'px-3', md: 'px-4', lg: 'px-5', xl: 'px-6', }),
4780
- py: new PyTheme({ xs: 'py-1', sm: 'py-1.5', md: 'py-2', lg: 'py-2.5', xl: 'py-3' }),
4781
- gap: new GapTheme({ xs: 'gap-1', sm: 'gap-1.5', md: 'gap-2', lg: 'gap-2.5', xl: 'gap-3' }),
4852
+ px: new PxTheme(uiPaddingClasses, buttonAspectRatioClasses, true),
4853
+ py: new PyTheme(uiPaddingClasses, true),
4854
+ gap: new GapTheme({ xs: '[--gap-unit:1]', sm: '[--gap-unit:1.5]', md: '[--gap-unit:2]', lg: '[--gap-unit:2.5]', xl: '[--gap-unit:3]' }, true),
4782
4855
  text: new SizeTheme({ xs: 'text-xs', sm: 'text-sm', md: 'text-base', lg: 'text-lg', xl: 'text-xl' }),
4783
4856
  },
4784
4857
  appearance: {
@@ -4806,9 +4879,9 @@ const defaultButtonTheme = new ComponentTheme("button", "w-fit h-fit cursor-poin
4806
4879
 
4807
4880
  const defaultBadgeTheme = new ComponentTheme("span", "w-fit h-fit transition-all duration-200 whitespace-nowrap", {
4808
4881
  size: {
4809
- px: new PxTheme({ xs: "px-2", sm: "px-3", md: "px-4", lg: "px-5", xl: "px-6" }),
4810
- py: new PyTheme({ xs: 'py-1', sm: 'py-1.5', md: 'py-2', lg: 'py-2.5', xl: 'py-3' }),
4811
- gap: new GapTheme({ xs: 'gap-1', sm: 'gap-1.5', md: 'gap-2', lg: 'gap-2.5', xl: 'gap-3' }),
4882
+ px: new PxTheme(uiPaddingClasses, badgeAspectRatioClasses, true),
4883
+ py: new PyTheme(uiPaddingClasses, true),
4884
+ gap: new GapTheme({ xs: '[--gap-unit:1]', sm: '[--gap-unit:1.5]', md: '[--gap-unit:2]', lg: '[--gap-unit:2.5]', xl: '[--gap-unit:3]' }, true),
4812
4885
  text: new SizeTheme({ xs: 'text-xs', sm: 'text-sm', md: 'text-base', lg: 'text-lg', xl: 'text-xl' })
4813
4886
  },
4814
4887
  appearance: {
@@ -4835,10 +4908,10 @@ const defaultBadgeTheme = new ComponentTheme("span", "w-fit h-fit transition-all
4835
4908
 
4836
4909
  const defaultChipTheme = new ComponentTheme("span", "w-fit h-fit transition-all duration-200 whitespace-nowrap", {
4837
4910
  size: {
4838
- px: new PxTheme({ xs: 'px-2', sm: 'px-2.5', md: 'px-3', lg: 'px-3.5', xl: 'px-4' }),
4839
- py: new PyTheme({ xs: 'py-0.5', sm: 'py-1', md: 'py-1.5', lg: 'py-2', xl: 'py-2.5' }),
4911
+ px: new PxTheme(chipPyClasses, chipAspectRatioClasses, true),
4912
+ py: new PyTheme(chipPyClasses, true),
4840
4913
  text: new SizeTheme({ xs: 'text-xs', sm: 'text-sm', md: 'text-base', lg: 'text-lg', xl: 'text-xl' }),
4841
- gap: new GapTheme({ xs: 'gap-1', sm: 'gap-1.5', md: 'gap-2', lg: 'gap-2.5', xl: 'gap-3' })
4914
+ gap: new GapTheme({ xs: '[--gap-unit:1]', sm: '[--gap-unit:1.5]', md: '[--gap-unit:2]', lg: '[--gap-unit:2.5]', xl: '[--gap-unit:3]' }, true)
4842
4915
  },
4843
4916
  appearance: {
4844
4917
  background: GenericVariantTheme.createSimpleUIElementBgAppearanceTheme(),
@@ -4864,10 +4937,10 @@ const defaultChipTheme = new ComponentTheme("span", "w-fit h-fit transition-all
4864
4937
 
4865
4938
  const defaultCodeTheme = new ComponentTheme("code", "", {
4866
4939
  size: {
4867
- px: new PxTheme({ xs: 'px-1', sm: 'px-1.5', md: 'px-1.5', lg: 'px-2', xl: 'px-2' }),
4868
- py: new PyTheme({ xs: 'py-0', sm: 'py-0.5', md: 'py-1', lg: 'py-1', xl: 'py-1' }),
4940
+ px: new PxTheme(codePyClasses, codeAspectRatioClasses, true),
4941
+ py: new PyTheme(codePyClasses, true),
4869
4942
  text: new SizeTheme({ xs: 'text-xs', sm: 'text-sm', md: 'text-sm', lg: 'text-base', xl: 'text-lg' }),
4870
- gap: new GapTheme({ xs: 'gap-0.5', sm: 'gap-1', md: 'gap-1.5', lg: 'gap-2', xl: 'gap-2.5' })
4943
+ gap: new GapTheme({ xs: '[--gap-unit:0.5]', sm: '[--gap-unit:1]', md: '[--gap-unit:1.5]', lg: '[--gap-unit:2]', xl: '[--gap-unit:2.5]' }, true)
4871
4944
  },
4872
4945
  appearance: {
4873
4946
  background: GenericVariantTheme.createSimpleUIElementBgAppearanceTheme(),
@@ -5155,7 +5228,7 @@ const defaultRowTheme = new ComponentTheme("div", "", {
5155
5228
 
5156
5229
  const defaultDividerTheme = new ComponentTheme("div", "h-px w-full", {
5157
5230
  size: {
5158
- py: new PyTheme(),
5231
+ py: new PyTheme(), // Uses layout spacing by default
5159
5232
  },
5160
5233
  appearance: {
5161
5234
  background: AppearanceTheme.createTheme({
@@ -5250,15 +5323,15 @@ const defaultStackTheme = new ComponentTheme("div", "", {
5250
5323
  }
5251
5324
  }, themeDefaults.stack, STACK_CATEGORIES);
5252
5325
 
5253
- const defaultSectionTheme = new ComponentTheme("div", "w-full flex-col", {
5326
+ const defaultSectionTheme = new ComponentTheme("div", "w-full", {
5254
5327
  size: {
5255
5328
  px: new PxTheme(layoutPaddingClasses, sectionAspectRatioClasses),
5256
5329
  py: new PyTheme({
5257
- xs: "[--h-unit:4]",
5258
- sm: "[--h-unit:8]",
5259
- md: "[--h-unit:12]",
5260
- lg: "[--h-unit:16]",
5261
- xl: "[--h-unit:20]",
5330
+ xs: "[--py-unit:4]",
5331
+ sm: "[--py-unit:8]",
5332
+ md: "[--py-unit:12]",
5333
+ lg: "[--py-unit:16]",
5334
+ xl: "[--py-unit:20]",
5262
5335
  }),
5263
5336
  gap: new GapTheme({
5264
5337
  xs: "[--gap-unit:2]",
@@ -5414,9 +5487,9 @@ const defaultImgTheme = new ComponentTheme("img", "object-cover", // Default to
5414
5487
 
5415
5488
  const defaultInputTheme = new ComponentTheme("input", "w-full transition-all duration-200", {
5416
5489
  size: {
5417
- px: new PxTheme({ xs: 'px-2', sm: 'px-3', md: 'px-4', lg: 'px-5', xl: 'px-6', }),
5418
- py: new PyTheme({ xs: 'py-1', sm: 'py-1.5', md: 'py-2', lg: 'py-2.5', xl: 'py-3' }),
5419
- gap: new GapTheme({ xs: 'gap-1', sm: 'gap-1.5', md: 'gap-2', lg: 'gap-2.5', xl: 'gap-3' }),
5490
+ px: new PxTheme(uiPaddingClasses, inputAspectRatioClasses, true),
5491
+ py: new PyTheme(uiPaddingClasses, true),
5492
+ gap: new GapTheme({ xs: '[--gap-unit:1]', sm: '[--gap-unit:1.5]', md: '[--gap-unit:2]', lg: '[--gap-unit:2.5]', xl: '[--gap-unit:3]' }, true),
5420
5493
  text: new SizeTheme({ xs: 'text-xs', sm: 'text-sm', md: 'text-base', lg: 'text-lg', xl: 'text-xl' }),
5421
5494
  },
5422
5495
  appearance: {