@vaneui/ui 0.2.1-alpha.20250820182348.d8e8551 → 0.2.1-alpha.20250820194940.1d9162d

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,11 +1,17 @@
1
- import { ShapeKey, SizeKey } from "../../props";
1
+ import { SizeKey } from "../../props";
2
2
  import { BaseTheme } from "../common/baseTheme";
3
3
  import type { CategoryProps } from "../../props";
4
- export interface RadiusTheme extends Record<ShapeKey, string | Record<SizeKey, string>> {
4
+ export interface RadiusTheme {
5
+ pill: string;
6
+ sharp: string;
7
+ rounded: Record<SizeKey, string>;
5
8
  }
6
9
  export declare class RadiusTheme extends BaseTheme {
10
+ pill: string;
11
+ sharp: string;
12
+ rounded: Record<SizeKey, string>;
7
13
  private constructor();
8
- static createUITheme(sizeMap?: Record<SizeKey, string>): RadiusTheme;
9
- static createLayoutTheme(sizeMap?: Record<SizeKey, string>): RadiusTheme;
14
+ static createUITheme(customRounded?: Record<SizeKey, string>): RadiusTheme;
15
+ static createLayoutTheme(customRounded?: Record<SizeKey, string>): RadiusTheme;
10
16
  getClasses(extractedKeys: CategoryProps): string[];
11
17
  }
package/dist/index.esm.js CHANGED
@@ -3278,44 +3278,35 @@ const layoutBorderRadiusClasses = {
3278
3278
  lg: "rounded-(--layout-border-radius-lg)",
3279
3279
  xl: "rounded-(--layout-border-radius-xl)",
3280
3280
  };
3281
- const uiBorderRadiusShapeClasses = {
3282
- pill: "rounded-full",
3283
- sharp: "rounded-none",
3284
- rounded: uiBorderRadiusClasses,
3285
- };
3286
- const layoutBorderRadiusShapeClasses = {
3287
- pill: "rounded-full",
3288
- sharp: "rounded-none",
3289
- rounded: layoutBorderRadiusClasses,
3290
- };
3291
3281
 
3292
3282
  class RadiusTheme extends BaseTheme {
3293
- constructor(shapeClasses, sizeMap) {
3283
+ constructor(roundedClasses) {
3294
3284
  super();
3295
- ComponentKeys.shape.forEach((key) => {
3296
- if (key === 'rounded' && sizeMap) {
3297
- this[key] = sizeMap;
3298
- }
3299
- else {
3300
- this[key] = shapeClasses[key];
3301
- }
3302
- });
3285
+ this.pill = "rounded-full";
3286
+ this.sharp = "rounded-none";
3287
+ this.rounded = roundedClasses;
3303
3288
  }
3304
- static createUITheme(sizeMap) {
3305
- return new RadiusTheme(uiBorderRadiusShapeClasses, sizeMap);
3289
+ static createUITheme(customRounded) {
3290
+ return new RadiusTheme(customRounded || uiBorderRadiusClasses);
3306
3291
  }
3307
- static createLayoutTheme(sizeMap) {
3308
- return new RadiusTheme(layoutBorderRadiusShapeClasses, sizeMap);
3292
+ static createLayoutTheme(customRounded) {
3293
+ return new RadiusTheme(customRounded || layoutBorderRadiusClasses);
3309
3294
  }
3310
3295
  getClasses(extractedKeys) {
3311
3296
  var _a, _b;
3312
3297
  const size = (_a = extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.size) !== null && _a !== void 0 ? _a : 'md';
3313
3298
  const shape = (_b = extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.shape) !== null && _b !== void 0 ? _b : 'rounded';
3314
- const shapeValue = this[shape];
3315
- if (shapeValue === undefined) {
3316
- return [''];
3299
+ switch (shape) {
3300
+ case 'pill':
3301
+ return [this.pill];
3302
+ case 'sharp':
3303
+ return [this.sharp];
3304
+ case 'rounded':
3305
+ const roundedClass = this.rounded[size];
3306
+ return roundedClass ? [roundedClass] : [];
3307
+ default:
3308
+ return [];
3317
3309
  }
3318
- return [typeof shapeValue === 'string' ? shapeValue : shapeValue[size] || ''];
3319
3310
  }
3320
3311
  }
3321
3312