@vaneui/ui 0.1.6 → 0.1.7
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/props/keys.d.ts +15 -14
- package/dist/components/ui/theme/common/ComponentTheme.d.ts +2 -0
- package/dist/components/ui/theme/layout/displayTheme.d.ts +1 -1
- package/dist/components/ui/theme/layout/overflowTheme.d.ts +9 -0
- package/dist/index.esm.js +40 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +40 -4
- package/dist/index.js.map +1 -1
- package/dist/ui.css +45 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -40,6 +40,7 @@ const ITEMS_KEYS = ['itemsStart', 'itemsEnd', 'itemsCenter', 'itemsBaseline', 'i
|
|
|
40
40
|
const JUSTIFY_KEYS = ['justifyStart', 'justifyEnd', 'justifyCenter', 'justifyBetween', 'justifyAround', 'justifyEvenly', 'justifyStretch', 'justifyBaseline'];
|
|
41
41
|
const WRAP_KEYS = ['flexWrap', 'flexNoWrap', 'flexWrapReverse'];
|
|
42
42
|
const DISPLAY_KEYS = ['inline', 'block', 'inlineBlock', 'flex', 'inlineFlex', 'grid', 'inlineGrid', 'contents', 'table', 'tableCell', 'hidden'];
|
|
43
|
+
const OVERFLOW_KEYS = ['overflowAuto', 'overflowHidden', 'overflowClip', 'overflowVisible', 'overflowScroll', 'overflowXAuto', 'overflowYAuto', 'overflowXHidden', 'overflowYHidden', 'overflowXClip', 'overflowYClip', 'overflowXVisible', 'overflowYVisible', 'overflowXScroll', 'overflowYScroll'];
|
|
43
44
|
// A master list of all groups where only one key can be 'true' at a time.
|
|
44
45
|
const EXCLUSIVE_KEY_GROUPS = [
|
|
45
46
|
MODE_KEYS,
|
|
@@ -76,7 +77,8 @@ const BASE_COMPONENT_KEYS = [
|
|
|
76
77
|
...ITEMS_KEYS,
|
|
77
78
|
...JUSTIFY_KEYS,
|
|
78
79
|
...POSITION_KEYS,
|
|
79
|
-
...DISPLAY_KEYS
|
|
80
|
+
...DISPLAY_KEYS,
|
|
81
|
+
...OVERFLOW_KEYS,
|
|
80
82
|
];
|
|
81
83
|
// Font keys
|
|
82
84
|
const FONT_KEYS = [
|
|
@@ -448,8 +450,8 @@ class DisplayTheme extends BaseTheme {
|
|
|
448
450
|
});
|
|
449
451
|
}
|
|
450
452
|
getClasses(props, defaults) {
|
|
451
|
-
const
|
|
452
|
-
return [
|
|
453
|
+
const key = pickFirstTruthyKey(props, defaults, DISPLAY_KEYS);
|
|
454
|
+
return [key && this[key] ? this[key] : ''];
|
|
453
455
|
}
|
|
454
456
|
}
|
|
455
457
|
DisplayTheme.defaultClasses = {
|
|
@@ -3177,12 +3179,44 @@ const getDefaultConfig = () => {
|
|
|
3177
3179
|
};
|
|
3178
3180
|
const twMerge = /*#__PURE__*/createTailwindMerge(getDefaultConfig);
|
|
3179
3181
|
|
|
3182
|
+
class OverflowTheme extends BaseTheme {
|
|
3183
|
+
constructor(initialConfig) {
|
|
3184
|
+
super();
|
|
3185
|
+
OVERFLOW_KEYS.forEach((key) => {
|
|
3186
|
+
var _a;
|
|
3187
|
+
this[key] = (_a = initialConfig === null || initialConfig === void 0 ? void 0 : initialConfig[key]) !== null && _a !== void 0 ? _a : OverflowTheme.defaultClasses[key];
|
|
3188
|
+
});
|
|
3189
|
+
}
|
|
3190
|
+
getClasses(props, defaults) {
|
|
3191
|
+
const key = pickFirstTruthyKey(props, defaults, OVERFLOW_KEYS);
|
|
3192
|
+
return [key && this[key] ? this[key] : ''];
|
|
3193
|
+
}
|
|
3194
|
+
}
|
|
3195
|
+
OverflowTheme.defaultClasses = {
|
|
3196
|
+
overflowAuto: 'overflow-auto',
|
|
3197
|
+
overflowHidden: 'overflow-hidden',
|
|
3198
|
+
overflowClip: 'overflow-clip',
|
|
3199
|
+
overflowVisible: 'overflow-visible',
|
|
3200
|
+
overflowScroll: 'overflow-scroll',
|
|
3201
|
+
overflowXAuto: 'overflow-x-auto',
|
|
3202
|
+
overflowYAuto: 'overflow-y-auto',
|
|
3203
|
+
overflowXHidden: 'overflow-x-hidden',
|
|
3204
|
+
overflowYHidden: 'overflow-y-hidden',
|
|
3205
|
+
overflowXClip: 'overflow-x-clip',
|
|
3206
|
+
overflowYClip: 'overflow-y-clip',
|
|
3207
|
+
overflowXVisible: 'overflow-x-visible',
|
|
3208
|
+
overflowYVisible: 'overflow-y-visible',
|
|
3209
|
+
overflowXScroll: 'overflow-x-scroll',
|
|
3210
|
+
overflowYScroll: 'overflow-y-scroll',
|
|
3211
|
+
};
|
|
3212
|
+
|
|
3180
3213
|
const defaultLayoutTheme = {
|
|
3181
3214
|
hide: new HideTheme(),
|
|
3182
3215
|
items: new ItemsTheme(),
|
|
3183
3216
|
justify: new JustifyTheme(),
|
|
3184
3217
|
position: new PositionTheme(),
|
|
3185
|
-
display: new DisplayTheme()
|
|
3218
|
+
display: new DisplayTheme(),
|
|
3219
|
+
overflow: new OverflowTheme(),
|
|
3186
3220
|
};
|
|
3187
3221
|
const defaultTypographyTheme = {
|
|
3188
3222
|
fontFamily: new FontFamilyTheme(),
|
|
@@ -4467,6 +4501,7 @@ const gridSubThemes = {
|
|
|
4467
4501
|
}
|
|
4468
4502
|
}),
|
|
4469
4503
|
},
|
|
4504
|
+
layout: defaultLayoutTheme,
|
|
4470
4505
|
};
|
|
4471
4506
|
const defaultGrid3Theme = new ComponentTheme("div", "grid-cols-1 md:grid-cols-3", gridSubThemes, gridDefaults);
|
|
4472
4507
|
const defaultGrid4Theme = new ComponentTheme("div", "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4", gridSubThemes, gridDefaults);
|
|
@@ -4657,6 +4692,7 @@ exports.Link = Link;
|
|
|
4657
4692
|
exports.List = List;
|
|
4658
4693
|
exports.ListItem = ListItem;
|
|
4659
4694
|
exports.MODE_KEYS = MODE_KEYS;
|
|
4695
|
+
exports.OVERFLOW_KEYS = OVERFLOW_KEYS;
|
|
4660
4696
|
exports.PADDING_KEYS = PADDING_KEYS;
|
|
4661
4697
|
exports.PILL_KEYS = PILL_KEYS;
|
|
4662
4698
|
exports.POSITION_KEYS = POSITION_KEYS;
|