@vaneui/ui 0.2.1-alpha.20250820172812.236c9ec → 0.2.1-alpha.20250820182348.d8e8551

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
1
  import { BaseTheme } from "../common/baseTheme";
2
2
  import type { CategoryProps } from "../../props";
3
- import { ModeKey, BorderKey } from "../../props";
4
- export interface BorderTheme extends Record<BorderKey, Record<ModeKey, string>> {
3
+ import { ModeKey } from "../../props";
4
+ export interface BorderTheme extends Record<ModeKey, string> {
5
5
  }
6
6
  export declare class BorderTheme extends BaseTheme {
7
- static readonly defaultClasses: Record<BorderKey, Record<ModeKey, string>>;
8
- constructor(initial?: Partial<Record<BorderKey, Record<ModeKey, string>>>);
7
+ readonly defaultClasses: Record<ModeKey, string>;
8
+ constructor(initial?: Partial<Record<ModeKey, string>>);
9
9
  getClasses(extractedKeys: CategoryProps): string[];
10
10
  }
@@ -1,10 +1,10 @@
1
1
  import { BaseTheme } from "../common/baseTheme";
2
2
  import type { CategoryProps } from "../../props";
3
- import { ModeKey, RingKey } from "../../props";
4
- export interface RingTheme extends Record<RingKey, Record<ModeKey, string>> {
3
+ import { ModeKey } from "../../props";
4
+ export interface RingTheme extends Record<ModeKey, string> {
5
5
  }
6
6
  export declare class RingTheme extends BaseTheme {
7
- static readonly defaultClasses: Record<RingKey, Record<ModeKey, string>>;
8
- constructor(initial?: Partial<Record<RingKey, Record<ModeKey, string>>>);
7
+ readonly defaultClasses: Record<ModeKey, string>;
8
+ constructor(initial?: Partial<Record<ModeKey, string>>);
9
9
  getClasses(extractedKeys: CategoryProps): string[];
10
10
  }
@@ -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
@@ -3322,133 +3322,112 @@ class RadiusTheme extends BaseTheme {
3322
3322
  class BorderTheme extends BaseTheme {
3323
3323
  constructor(initial) {
3324
3324
  super();
3325
- ComponentKeys.border.forEach((key) => {
3326
- this[key] = {
3327
- ...BorderTheme.defaultClasses[key],
3328
- ...((initial === null || initial === void 0 ? void 0 : initial[key]) || {}),
3329
- };
3325
+ this.defaultClasses = {
3326
+ base: "border",
3327
+ hover: "",
3328
+ active: "",
3329
+ };
3330
+ ComponentKeys.mode.forEach((key) => {
3331
+ var _a;
3332
+ this[key] = (_a = initial === null || initial === void 0 ? void 0 : initial[key]) !== null && _a !== void 0 ? _a : this.defaultClasses[key];
3330
3333
  });
3331
3334
  }
3332
3335
  getClasses(extractedKeys) {
3333
- const key = extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.border;
3334
- if (!key || !this[key]) {
3335
- return ComponentKeys.mode.map(() => '');
3336
+ const border = extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.border;
3337
+ // If noBorder is true, return empty array (no border classes)
3338
+ if (border === 'noBorder') {
3339
+ return [];
3340
+ }
3341
+ // Only apply border classes if border is explicitly true
3342
+ if (border === 'border') {
3343
+ return ComponentKeys.mode.map(mode => this[mode] || '').filter(Boolean);
3336
3344
  }
3337
- return ComponentKeys.mode.map(mode => this[key][mode] || '');
3345
+ return [];
3338
3346
  }
3339
3347
  }
3340
- BorderTheme.defaultClasses = {
3341
- border: {
3342
- base: "border",
3343
- hover: "", //"hover:border",
3344
- active: "", //"active:border",
3345
- },
3346
- noBorder: {
3347
- base: "",
3348
- hover: "",
3349
- active: "",
3350
- },
3351
- };
3352
3348
 
3353
3349
  class RingTheme extends BaseTheme {
3354
3350
  constructor(initial) {
3355
3351
  super();
3356
- ComponentKeys.ring.forEach((key) => {
3357
- this[key] = {
3358
- ...RingTheme.defaultClasses[key],
3359
- ...((initial === null || initial === void 0 ? void 0 : initial[key]) || {}),
3360
- };
3352
+ this.defaultClasses = {
3353
+ base: "ring ring-inset",
3354
+ hover: "hover:ring hover:ring-inset",
3355
+ active: "active:ring active:ring-inset",
3356
+ };
3357
+ ComponentKeys.mode.forEach((key) => {
3358
+ var _a;
3359
+ this[key] = (_a = initial === null || initial === void 0 ? void 0 : initial[key]) !== null && _a !== void 0 ? _a : this.defaultClasses[key];
3361
3360
  });
3362
3361
  }
3363
3362
  getClasses(extractedKeys) {
3364
- const key = extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.ring;
3365
- if (!key || !this[key]) {
3366
- return ComponentKeys.mode.map(() => '');
3363
+ const ring = extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.ring;
3364
+ // If noRing is true, return empty array (no ring classes)
3365
+ if (ring === 'noRing') {
3366
+ return [];
3367
3367
  }
3368
- return ComponentKeys.mode.map(mode => this[key][mode] || '');
3368
+ // Only apply ring classes if ring is explicitly true
3369
+ if (ring === 'ring') {
3370
+ return ComponentKeys.mode.map(mode => this[mode] || '').filter(Boolean);
3371
+ }
3372
+ return [];
3369
3373
  }
3370
3374
  }
3371
- RingTheme.defaultClasses = {
3372
- ring: {
3373
- base: "ring ring-inset",
3374
- hover: "hover:ring hover:ring-inset",
3375
- active: "active:ring active:ring-inset",
3376
- },
3377
- noRing: {
3378
- base: "",
3379
- hover: "",
3380
- active: "",
3381
- },
3382
- //noRing: {
3383
- // base: "ring-0",
3384
- // hover: "hover:ring-0",
3385
- // active: "active:ring-0",
3386
- //},
3387
- };
3388
3375
 
3389
3376
  class PaddingTheme extends BaseTheme {
3390
3377
  constructor(initial) {
3391
3378
  super();
3392
3379
  this.defaultClasses = {
3393
- padding: { xs: "", sm: "", md: "", lg: "", xl: "" },
3394
- noPadding: ""
3380
+ xs: "", sm: "", md: "", lg: "", xl: ""
3395
3381
  };
3396
- ComponentKeys.padding.forEach((key) => {
3382
+ ComponentKeys.size.forEach((key) => {
3397
3383
  var _a;
3398
3384
  this[key] = (_a = initial === null || initial === void 0 ? void 0 : initial[key]) !== null && _a !== void 0 ? _a : this.defaultClasses[key];
3399
3385
  });
3400
3386
  }
3401
3387
  getClasses(extractedKeys) {
3402
- var _a, _b;
3388
+ var _a;
3403
3389
  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 [''];
3390
+ const padding = extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.padding;
3391
+ // If noPadding is true, return empty array (no padding classes)
3392
+ if (padding === 'noPadding') {
3393
+ return [];
3394
+ }
3395
+ // If padding is true or undefined, apply padding classes based on size
3396
+ if (padding === 'padding' || padding === undefined) {
3397
+ const paddingClass = this[size];
3398
+ return paddingClass ? [paddingClass] : [];
3408
3399
  }
3409
- return [typeof paddingValue === 'string' ? paddingValue : paddingValue[size] || ''];
3400
+ return [];
3410
3401
  }
3411
3402
  }
3412
3403
 
3413
3404
  class PxTheme extends PaddingTheme {
3414
3405
  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);
3406
+ super(sizeMap);
3418
3407
  this.defaultClasses = {
3419
- padding: { xs: "px-2", sm: "px-4", md: "px-6", lg: "px-8", xl: "px-10" },
3420
- noPadding: "px-0"
3408
+ xs: "px-2", sm: "px-4", md: "px-6", lg: "px-8", xl: "px-10"
3421
3409
  };
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 {
3410
+ // Override with PxTheme's default classes if no custom sizeMap provided
3411
+ if (!sizeMap) {
3412
+ ComponentKeys.size.forEach((key) => {
3428
3413
  this[key] = this.defaultClasses[key];
3429
- }
3430
- });
3414
+ });
3415
+ }
3431
3416
  }
3432
3417
  }
3433
3418
 
3434
3419
  class PyTheme extends PaddingTheme {
3435
3420
  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);
3421
+ super(sizeMap);
3439
3422
  this.defaultClasses = {
3440
- padding: { xs: "py-2", sm: "py-4", md: "py-6", lg: "py-8", xl: "py-10" },
3441
- noPadding: "py-0"
3423
+ xs: "py-2", sm: "py-4", md: "py-6", lg: "py-8", xl: "py-10"
3442
3424
  };
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 {
3425
+ // Override with PyTheme's default classes if no custom sizeMap provided
3426
+ if (!sizeMap) {
3427
+ ComponentKeys.size.forEach((key) => {
3449
3428
  this[key] = this.defaultClasses[key];
3450
- }
3451
- });
3429
+ });
3430
+ }
3452
3431
  }
3453
3432
  }
3454
3433
 
@@ -4399,17 +4378,17 @@ const mergeDefaults = (baseDefaults, overrideDefaults) => {
4399
4378
  };
4400
4379
 
4401
4380
  class PlTheme extends PaddingTheme {
4402
- constructor(initial) {
4403
- super(initial);
4381
+ constructor(sizeMap) {
4382
+ super(sizeMap);
4404
4383
  this.defaultClasses = {
4405
- padding: { xs: "pl-2", sm: "pl-4", md: "pl-6", lg: "pl-8", xl: "pl-10" },
4406
- noPadding: "pl-0"
4384
+ xs: "pl-2", sm: "pl-4", md: "pl-6", lg: "pl-8", xl: "pl-10"
4407
4385
  };
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
- });
4386
+ // Override with PlTheme's default classes if no custom sizeMap provided
4387
+ if (!sizeMap) {
4388
+ ComponentKeys.size.forEach((key) => {
4389
+ this[key] = this.defaultClasses[key];
4390
+ });
4391
+ }
4413
4392
  }
4414
4393
  }
4415
4394