@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.
- package/dist/components/ui/theme/layout/radiusTheme.d.ts +10 -4
- package/dist/index.esm.js +18 -27
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +18 -27
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SizeKey } from "../../props";
|
|
2
2
|
import { BaseTheme } from "../common/baseTheme";
|
|
3
3
|
import type { CategoryProps } from "../../props";
|
|
4
|
-
export interface RadiusTheme
|
|
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(
|
|
9
|
-
static createLayoutTheme(
|
|
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(
|
|
3283
|
+
constructor(roundedClasses) {
|
|
3294
3284
|
super();
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
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(
|
|
3305
|
-
return new RadiusTheme(
|
|
3289
|
+
static createUITheme(customRounded) {
|
|
3290
|
+
return new RadiusTheme(customRounded || uiBorderRadiusClasses);
|
|
3306
3291
|
}
|
|
3307
|
-
static createLayoutTheme(
|
|
3308
|
-
return new RadiusTheme(
|
|
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
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
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
|
|