@vaneui/ui 0.2.1-alpha.20250820194940.1d9162d → 0.2.1-alpha.20250820203636.5bf2e74
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/size/gapTheme.d.ts +3 -3
- package/dist/index.esm.js +17 -19
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +17 -19
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { SizeKey
|
|
1
|
+
import { SizeKey } from "../../props";
|
|
2
2
|
import { BaseTheme } from "../common/baseTheme";
|
|
3
3
|
import type { CategoryProps } from "../../props";
|
|
4
|
-
export interface GapTheme extends Record<
|
|
4
|
+
export interface GapTheme extends Record<SizeKey, string> {
|
|
5
5
|
}
|
|
6
6
|
export declare class GapTheme extends BaseTheme {
|
|
7
|
-
|
|
7
|
+
readonly defaultClasses: Record<SizeKey, string>;
|
|
8
8
|
constructor(sizeMap?: Record<SizeKey, string>);
|
|
9
9
|
getClasses(extractedKeys: CategoryProps): string[];
|
|
10
10
|
}
|
package/dist/index.esm.js
CHANGED
|
@@ -3236,33 +3236,31 @@ class SizeTheme extends BaseTheme {
|
|
|
3236
3236
|
|
|
3237
3237
|
class GapTheme extends BaseTheme {
|
|
3238
3238
|
constructor(sizeMap) {
|
|
3239
|
-
// If a simple size map is provided, convert it to the expected format
|
|
3240
|
-
const initial = sizeMap ? { gap: sizeMap } : undefined;
|
|
3241
3239
|
super();
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
}
|
|
3240
|
+
this.defaultClasses = {
|
|
3241
|
+
xs: 'gap-2', sm: 'gap-3', md: 'gap-4', lg: 'gap-5', xl: 'gap-6'
|
|
3242
|
+
};
|
|
3243
|
+
ComponentKeys.size.forEach((key) => {
|
|
3244
|
+
var _a;
|
|
3245
|
+
this[key] = (_a = sizeMap === null || sizeMap === void 0 ? void 0 : sizeMap[key]) !== null && _a !== void 0 ? _a : this.defaultClasses[key];
|
|
3249
3246
|
});
|
|
3250
3247
|
}
|
|
3251
3248
|
getClasses(extractedKeys) {
|
|
3252
|
-
var _a
|
|
3249
|
+
var _a;
|
|
3253
3250
|
const size = (_a = extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.size) !== null && _a !== void 0 ? _a : 'md';
|
|
3254
|
-
const
|
|
3255
|
-
|
|
3256
|
-
if (
|
|
3257
|
-
return [
|
|
3251
|
+
const gap = extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.gap;
|
|
3252
|
+
// If noGap is true, return empty array (no gap classes)
|
|
3253
|
+
if (gap === 'noGap') {
|
|
3254
|
+
return [];
|
|
3258
3255
|
}
|
|
3259
|
-
|
|
3256
|
+
// If gap is true or undefined, apply gap classes based on size
|
|
3257
|
+
if (gap === 'gap') {
|
|
3258
|
+
const gapClass = this[size];
|
|
3259
|
+
return gapClass ? [gapClass] : [];
|
|
3260
|
+
}
|
|
3261
|
+
return [];
|
|
3260
3262
|
}
|
|
3261
3263
|
}
|
|
3262
|
-
GapTheme.defaultClasses = {
|
|
3263
|
-
gap: { xs: 'gap-2', sm: 'gap-3', md: 'gap-4', lg: 'gap-5', xl: 'gap-6' },
|
|
3264
|
-
noGap: "gap-0"
|
|
3265
|
-
};
|
|
3266
3264
|
|
|
3267
3265
|
const uiBorderRadiusClasses = {
|
|
3268
3266
|
xs: "rounded-(--ui-border-radius-xs)",
|