@vaneui/ui 0.3.1-alpha.20250925201320.8b6a424 → 0.3.1-alpha.20250926201820.1b8c4ca
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/layout/radiusTheme.d.ts +1 -0
- package/dist/components/ui/theme/layout/radiusTheme.d.ts.map +1 -1
- 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/index.esm.js +34 -39
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +34 -39
- package/dist/index.js.map +1 -1
- package/dist/ui.css +33 -13
- package/dist/vars.css +8 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3796,35 +3796,35 @@ class GapTheme extends BaseTheme {
|
|
|
3796
3796
|
}
|
|
3797
3797
|
}
|
|
3798
3798
|
|
|
3799
|
-
const uiBorderRadiusClasses = {
|
|
3800
|
-
xs: "rounded-(--ui-br-xs)",
|
|
3801
|
-
sm: "rounded-(--ui-br-sm)",
|
|
3802
|
-
md: "rounded-(--ui-br-md)",
|
|
3803
|
-
lg: "rounded-(--ui-br-lg)",
|
|
3804
|
-
xl: "rounded-(--ui-br-xl)",
|
|
3805
|
-
};
|
|
3806
|
-
const layoutBorderRadiusClasses = {
|
|
3807
|
-
xs: "rounded-(--layout-br-xs)",
|
|
3808
|
-
sm: "rounded-(--layout-br-sm)",
|
|
3809
|
-
md: "rounded-(--layout-br-md)",
|
|
3810
|
-
lg: "rounded-(--layout-br-lg)",
|
|
3811
|
-
xl: "rounded-(--layout-br-xl)",
|
|
3812
|
-
};
|
|
3813
|
-
|
|
3814
3799
|
class RadiusTheme extends BaseTheme {
|
|
3815
|
-
constructor(roundedClasses) {
|
|
3800
|
+
constructor(roundedClasses, isUIComponent = false) {
|
|
3816
3801
|
super();
|
|
3817
3802
|
/** Pill shape - fully rounded corners */
|
|
3818
3803
|
this.pill = "rounded-full";
|
|
3819
3804
|
/** Sharp shape - no rounded corners */
|
|
3820
3805
|
this.sharp = "rounded-none";
|
|
3821
3806
|
this.rounded = roundedClasses;
|
|
3807
|
+
this.isUIComponent = isUIComponent;
|
|
3822
3808
|
}
|
|
3823
3809
|
static createUITheme(customRounded) {
|
|
3824
|
-
|
|
3810
|
+
const brUnitClasses = {
|
|
3811
|
+
xs: '[--br-unit:1]',
|
|
3812
|
+
sm: '[--br-unit:2]',
|
|
3813
|
+
md: '[--br-unit:3]',
|
|
3814
|
+
lg: '[--br-unit:4]',
|
|
3815
|
+
xl: '[--br-unit:5]'
|
|
3816
|
+
};
|
|
3817
|
+
return new RadiusTheme(customRounded || brUnitClasses, true);
|
|
3825
3818
|
}
|
|
3826
3819
|
static createLayoutTheme() {
|
|
3827
|
-
|
|
3820
|
+
const brUnitClasses = {
|
|
3821
|
+
xs: '[--br-unit:3]',
|
|
3822
|
+
sm: '[--br-unit:4]',
|
|
3823
|
+
md: '[--br-unit:5]',
|
|
3824
|
+
lg: '[--br-unit:6]',
|
|
3825
|
+
xl: '[--br-unit:7]'
|
|
3826
|
+
};
|
|
3827
|
+
return new RadiusTheme(brUnitClasses, false);
|
|
3828
3828
|
}
|
|
3829
3829
|
getClasses(extractedKeys) {
|
|
3830
3830
|
var _a, _b;
|
|
@@ -3836,8 +3836,9 @@ class RadiusTheme extends BaseTheme {
|
|
|
3836
3836
|
case 'sharp':
|
|
3837
3837
|
return [this.sharp];
|
|
3838
3838
|
case 'rounded': {
|
|
3839
|
-
const
|
|
3840
|
-
|
|
3839
|
+
const brUnitClass = this.rounded[size];
|
|
3840
|
+
const roundedVar = this.isUIComponent ? "rounded-(--ui-br)" : "rounded-(--br)";
|
|
3841
|
+
return brUnitClass ? [brUnitClass, roundedVar] : [];
|
|
3841
3842
|
}
|
|
3842
3843
|
default:
|
|
3843
3844
|
return [];
|
|
@@ -3954,32 +3955,26 @@ class PaddingTheme extends BaseTheme {
|
|
|
3954
3955
|
|
|
3955
3956
|
/** Horizontal padding theme - controls left and right padding */
|
|
3956
3957
|
class PxTheme extends PaddingTheme {
|
|
3957
|
-
constructor(
|
|
3958
|
-
super(
|
|
3958
|
+
constructor(aspectRatioMap, isUIComponent = false) {
|
|
3959
|
+
super();
|
|
3959
3960
|
this.aspectRatioMap = aspectRatioMap;
|
|
3960
3961
|
this.isUIComponent = isUIComponent;
|
|
3961
|
-
//
|
|
3962
|
-
|
|
3963
|
-
ComponentKeys.size.forEach((key) => {
|
|
3964
|
-
this[key] = layoutPaddingClasses[key];
|
|
3965
|
-
});
|
|
3966
|
-
}
|
|
3962
|
+
// PxTheme should not set any padding classes - that's PyTheme's job
|
|
3963
|
+
// PxTheme only handles aspect-ratio
|
|
3967
3964
|
}
|
|
3968
3965
|
getClasses(extractedKeys) {
|
|
3969
3966
|
var _a, _b;
|
|
3970
3967
|
if ((extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.padding) === 'padding' || (extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.padding) === undefined) {
|
|
3971
3968
|
const size = (_a = extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.size) !== null && _a !== void 0 ? _a : 'md';
|
|
3972
|
-
const paddingClass = this[size];
|
|
3973
3969
|
const aspectRatioClass = (_b = this.aspectRatioMap) === null || _b === void 0 ? void 0 : _b[size];
|
|
3974
3970
|
const classes = [];
|
|
3975
|
-
|
|
3976
|
-
classes.push(paddingClass);
|
|
3971
|
+
// Only add aspect-ratio class - no padding classes
|
|
3977
3972
|
if (aspectRatioClass)
|
|
3978
3973
|
classes.push(aspectRatioClass);
|
|
3979
3974
|
// Use UI or layout CSS variables based on component type
|
|
3980
3975
|
const cssVar = this.isUIComponent ? "px-(--ui-px)" : "px-(--px)";
|
|
3981
3976
|
classes.push(cssVar);
|
|
3982
|
-
return classes
|
|
3977
|
+
return classes;
|
|
3983
3978
|
}
|
|
3984
3979
|
return [];
|
|
3985
3980
|
}
|
|
@@ -4849,7 +4844,7 @@ const themeDefaults = {
|
|
|
4849
4844
|
|
|
4850
4845
|
const defaultButtonTheme = new ComponentTheme("button", "w-fit h-fit cursor-pointer transition-all duration-200 whitespace-nowrap", {
|
|
4851
4846
|
size: {
|
|
4852
|
-
px: new PxTheme(
|
|
4847
|
+
px: new PxTheme(buttonAspectRatioClasses, true),
|
|
4853
4848
|
py: new PyTheme(uiPaddingClasses, true),
|
|
4854
4849
|
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),
|
|
4855
4850
|
text: new SizeTheme({ xs: 'text-xs', sm: 'text-sm', md: 'text-base', lg: 'text-lg', xl: 'text-xl' }),
|
|
@@ -4879,7 +4874,7 @@ const defaultButtonTheme = new ComponentTheme("button", "w-fit h-fit cursor-poin
|
|
|
4879
4874
|
|
|
4880
4875
|
const defaultBadgeTheme = new ComponentTheme("span", "w-fit h-fit transition-all duration-200 whitespace-nowrap", {
|
|
4881
4876
|
size: {
|
|
4882
|
-
px: new PxTheme(
|
|
4877
|
+
px: new PxTheme(badgeAspectRatioClasses, true),
|
|
4883
4878
|
py: new PyTheme(uiPaddingClasses, true),
|
|
4884
4879
|
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),
|
|
4885
4880
|
text: new SizeTheme({ xs: 'text-xs', sm: 'text-sm', md: 'text-base', lg: 'text-lg', xl: 'text-xl' })
|
|
@@ -4908,7 +4903,7 @@ const defaultBadgeTheme = new ComponentTheme("span", "w-fit h-fit transition-all
|
|
|
4908
4903
|
|
|
4909
4904
|
const defaultChipTheme = new ComponentTheme("span", "w-fit h-fit transition-all duration-200 whitespace-nowrap", {
|
|
4910
4905
|
size: {
|
|
4911
|
-
px: new PxTheme(
|
|
4906
|
+
px: new PxTheme(chipAspectRatioClasses, true),
|
|
4912
4907
|
py: new PyTheme(chipPyClasses, true),
|
|
4913
4908
|
text: new SizeTheme({ xs: 'text-xs', sm: 'text-sm', md: 'text-base', lg: 'text-lg', xl: 'text-xl' }),
|
|
4914
4909
|
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)
|
|
@@ -4937,7 +4932,7 @@ const defaultChipTheme = new ComponentTheme("span", "w-fit h-fit transition-all
|
|
|
4937
4932
|
|
|
4938
4933
|
const defaultCodeTheme = new ComponentTheme("code", "", {
|
|
4939
4934
|
size: {
|
|
4940
|
-
px: new PxTheme(
|
|
4935
|
+
px: new PxTheme(codeAspectRatioClasses, true),
|
|
4941
4936
|
py: new PyTheme(codePyClasses, true),
|
|
4942
4937
|
text: new SizeTheme({ xs: 'text-xs', sm: 'text-sm', md: 'text-sm', lg: 'text-base', xl: 'text-lg' }),
|
|
4943
4938
|
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)
|
|
@@ -5325,7 +5320,7 @@ const defaultStackTheme = new ComponentTheme("div", "", {
|
|
|
5325
5320
|
|
|
5326
5321
|
const defaultSectionTheme = new ComponentTheme("div", "w-full", {
|
|
5327
5322
|
size: {
|
|
5328
|
-
px: new PxTheme(
|
|
5323
|
+
px: new PxTheme(sectionAspectRatioClasses),
|
|
5329
5324
|
py: new PyTheme({
|
|
5330
5325
|
xs: "[--py-unit:4]",
|
|
5331
5326
|
sm: "[--py-unit:8]",
|
|
@@ -5454,7 +5449,7 @@ const defaultCheckboxWrapperTheme = new ComponentTheme("span", "", {
|
|
|
5454
5449
|
const defaultLabelTheme = new ComponentTheme("label", "has-[input]:cursor-pointer cursor-default", {
|
|
5455
5450
|
size: {
|
|
5456
5451
|
text: new SizeTheme(textSizeClasses),
|
|
5457
|
-
gap: new GapTheme({ xs: 'gap-1.5', sm: 'gap-2', md: 'gap-2.5', lg: 'gap-3', xl: 'gap-3' }),
|
|
5452
|
+
gap: new GapTheme({ xs: '[--gap-unit:1.5]', sm: '[--gap-unit:2]', md: '[--gap-unit:2.5]', lg: '[--gap-unit:3]', xl: '[--gap-unit:3]' }, true),
|
|
5458
5453
|
},
|
|
5459
5454
|
appearance: {
|
|
5460
5455
|
text: GenericVariantTheme.createTypographyTextTheme(),
|
|
@@ -5487,7 +5482,7 @@ const defaultImgTheme = new ComponentTheme("img", "object-cover", // Default to
|
|
|
5487
5482
|
|
|
5488
5483
|
const defaultInputTheme = new ComponentTheme("input", "w-full transition-all duration-200", {
|
|
5489
5484
|
size: {
|
|
5490
|
-
px: new PxTheme(
|
|
5485
|
+
px: new PxTheme(inputAspectRatioClasses, true),
|
|
5491
5486
|
py: new PyTheme(uiPaddingClasses, true),
|
|
5492
5487
|
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),
|
|
5493
5488
|
text: new SizeTheme({ xs: 'text-xs', sm: 'text-sm', md: 'text-base', lg: 'text-lg', xl: 'text-xl' }),
|