@vaneui/ui 0.2.1-alpha.20250820172812.236c9ec → 0.2.1-alpha.20250820175637.a4cda09

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.
@@ -1,10 +1,10 @@
1
- import { SizeKey, PaddingKey } from "../../props";
1
+ import { SizeKey } from "../../props";
2
2
  import { BaseTheme } from "../common/baseTheme";
3
3
  import type { CategoryProps } from "../../props";
4
- export interface PaddingTheme extends Record<PaddingKey, string | Record<SizeKey, string>> {
4
+ export interface PaddingTheme extends Record<SizeKey, string> {
5
5
  }
6
6
  export declare class PaddingTheme extends BaseTheme {
7
- readonly defaultClasses: Record<PaddingKey, string | Record<SizeKey, string>>;
8
- constructor(initial?: Partial<Record<PaddingKey, string | Record<SizeKey, string>>>);
7
+ readonly defaultClasses: Record<SizeKey, string>;
8
+ constructor(initial?: Partial<Record<SizeKey, string>>);
9
9
  getClasses(extractedKeys: CategoryProps): string[];
10
10
  }
@@ -1,8 +1,8 @@
1
- import { SizeKey, PaddingKey } from "../../props";
1
+ import { SizeKey } from "../../props";
2
2
  import { PaddingTheme } from "./paddingTheme";
3
- export interface PlTheme extends Record<PaddingKey, string | Record<SizeKey, string>> {
3
+ export interface PlTheme extends Record<SizeKey, string> {
4
4
  }
5
5
  export declare class PlTheme extends PaddingTheme {
6
- readonly defaultClasses: Record<PaddingKey, string | Record<SizeKey, string>>;
7
- constructor(initial?: Partial<Record<PaddingKey, string | Record<SizeKey, string>>>);
6
+ readonly defaultClasses: Record<SizeKey, string>;
7
+ constructor(sizeMap?: Record<SizeKey, string>);
8
8
  }
@@ -1,8 +1,8 @@
1
- import { SizeKey, PaddingKey } from "../../props";
1
+ import { SizeKey } from "../../props";
2
2
  import { PaddingTheme } from "./paddingTheme";
3
- export interface PxTheme extends Record<PaddingKey, string | Record<SizeKey, string>> {
3
+ export interface PxTheme extends Record<SizeKey, string> {
4
4
  }
5
5
  export declare class PxTheme extends PaddingTheme {
6
- readonly defaultClasses: Record<PaddingKey, string | Record<SizeKey, string>>;
6
+ readonly defaultClasses: Record<SizeKey, string>;
7
7
  constructor(sizeMap?: Record<SizeKey, string>);
8
8
  }
@@ -1,8 +1,8 @@
1
- import { SizeKey, PaddingKey } from "../../props";
1
+ import { SizeKey } from "../../props";
2
2
  import { PaddingTheme } from "./paddingTheme";
3
- export interface PyTheme extends Record<PaddingKey, string | Record<SizeKey, string>> {
3
+ export interface PyTheme extends Record<SizeKey, string> {
4
4
  }
5
5
  export declare class PyTheme extends PaddingTheme {
6
- readonly defaultClasses: Record<PaddingKey, string | Record<SizeKey, string>>;
6
+ readonly defaultClasses: Record<SizeKey, string>;
7
7
  constructor(sizeMap?: Record<SizeKey, string>);
8
8
  }
package/dist/index.esm.js CHANGED
@@ -3390,65 +3390,57 @@ class PaddingTheme extends BaseTheme {
3390
3390
  constructor(initial) {
3391
3391
  super();
3392
3392
  this.defaultClasses = {
3393
- padding: { xs: "", sm: "", md: "", lg: "", xl: "" },
3394
- noPadding: ""
3393
+ xs: "", sm: "", md: "", lg: "", xl: ""
3395
3394
  };
3396
- ComponentKeys.padding.forEach((key) => {
3395
+ ComponentKeys.size.forEach((key) => {
3397
3396
  var _a;
3398
3397
  this[key] = (_a = initial === null || initial === void 0 ? void 0 : initial[key]) !== null && _a !== void 0 ? _a : this.defaultClasses[key];
3399
3398
  });
3400
3399
  }
3401
3400
  getClasses(extractedKeys) {
3402
- var _a, _b;
3401
+ var _a;
3403
3402
  const size = (_a = extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.size) !== null && _a !== void 0 ? _a : 'md';
3404
- const key = (_b = extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.padding) !== null && _b !== void 0 ? _b : 'padding';
3405
- const paddingValue = this[key];
3406
- if (paddingValue === undefined) {
3407
- return [''];
3403
+ const padding = extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.padding;
3404
+ // If noPadding is true, return empty array (no padding classes)
3405
+ if (padding === 'noPadding') {
3406
+ return [];
3407
+ }
3408
+ // If padding is true or undefined, apply padding classes based on size
3409
+ if (padding === 'padding' || padding === undefined) {
3410
+ const paddingClass = this[size];
3411
+ return paddingClass ? [paddingClass] : [];
3408
3412
  }
3409
- return [typeof paddingValue === 'string' ? paddingValue : paddingValue[size] || ''];
3413
+ return [];
3410
3414
  }
3411
3415
  }
3412
3416
 
3413
3417
  class PxTheme extends PaddingTheme {
3414
3418
  constructor(sizeMap) {
3415
- // If a simple size map is provided, convert it to the expected format
3416
- const initial = sizeMap ? { padding: sizeMap } : undefined;
3417
- super(initial);
3419
+ super(sizeMap);
3418
3420
  this.defaultClasses = {
3419
- padding: { xs: "px-2", sm: "px-4", md: "px-6", lg: "px-8", xl: "px-10" },
3420
- noPadding: "px-0"
3421
+ xs: "px-2", sm: "px-4", md: "px-6", lg: "px-8", xl: "px-10"
3421
3422
  };
3422
- // Override with PxTheme's default classes
3423
- ComponentKeys.padding.forEach((key) => {
3424
- if (key === 'padding' && (initial === null || initial === void 0 ? void 0 : initial.padding)) {
3425
- this[key] = initial.padding;
3426
- }
3427
- else {
3423
+ // Override with PxTheme's default classes if no custom sizeMap provided
3424
+ if (!sizeMap) {
3425
+ ComponentKeys.size.forEach((key) => {
3428
3426
  this[key] = this.defaultClasses[key];
3429
- }
3430
- });
3427
+ });
3428
+ }
3431
3429
  }
3432
3430
  }
3433
3431
 
3434
3432
  class PyTheme extends PaddingTheme {
3435
3433
  constructor(sizeMap) {
3436
- // If a simple size map is provided, convert it to the expected format
3437
- const initial = sizeMap ? { padding: sizeMap } : undefined;
3438
- super(initial);
3434
+ super(sizeMap);
3439
3435
  this.defaultClasses = {
3440
- padding: { xs: "py-2", sm: "py-4", md: "py-6", lg: "py-8", xl: "py-10" },
3441
- noPadding: "py-0"
3436
+ xs: "py-2", sm: "py-4", md: "py-6", lg: "py-8", xl: "py-10"
3442
3437
  };
3443
- // Override with PyTheme's default classes
3444
- ComponentKeys.padding.forEach((key) => {
3445
- if (key === 'padding' && (initial === null || initial === void 0 ? void 0 : initial.padding)) {
3446
- this[key] = initial.padding;
3447
- }
3448
- else {
3438
+ // Override with PyTheme's default classes if no custom sizeMap provided
3439
+ if (!sizeMap) {
3440
+ ComponentKeys.size.forEach((key) => {
3449
3441
  this[key] = this.defaultClasses[key];
3450
- }
3451
- });
3442
+ });
3443
+ }
3452
3444
  }
3453
3445
  }
3454
3446
 
@@ -4399,17 +4391,17 @@ const mergeDefaults = (baseDefaults, overrideDefaults) => {
4399
4391
  };
4400
4392
 
4401
4393
  class PlTheme extends PaddingTheme {
4402
- constructor(initial) {
4403
- super(initial);
4394
+ constructor(sizeMap) {
4395
+ super(sizeMap);
4404
4396
  this.defaultClasses = {
4405
- padding: { xs: "pl-2", sm: "pl-4", md: "pl-6", lg: "pl-8", xl: "pl-10" },
4406
- noPadding: "pl-0"
4397
+ xs: "pl-2", sm: "pl-4", md: "pl-6", lg: "pl-8", xl: "pl-10"
4407
4398
  };
4408
- // Override with PlTheme's default classes
4409
- ComponentKeys.padding.forEach((key) => {
4410
- var _a;
4411
- this[key] = (_a = initial === null || initial === void 0 ? void 0 : initial[key]) !== null && _a !== void 0 ? _a : this.defaultClasses[key];
4412
- });
4399
+ // Override with PlTheme's default classes if no custom sizeMap provided
4400
+ if (!sizeMap) {
4401
+ ComponentKeys.size.forEach((key) => {
4402
+ this[key] = this.defaultClasses[key];
4403
+ });
4404
+ }
4413
4405
  }
4414
4406
  }
4415
4407