@vaneui/ui 0.1.3 → 0.1.4
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/classes/appearanceClasses.d.ts +8 -8
- package/dist/components/ui/classes/typographyClasses.d.ts +1 -1
- package/dist/components/ui/props/keys.d.ts +12 -10
- package/dist/components/ui/theme/appearance/layoutAppearanceTheme.d.ts +5 -5
- package/dist/components/ui/theme/appearance/variantTheme.d.ts +1 -1
- package/dist/index.esm.js +22 -49
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +23 -49
- package/dist/index.js.map +1 -1
- package/dist/ui.css +0 -81
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14,8 +14,9 @@ class BaseTheme {
|
|
|
14
14
|
const MODE_KEYS = ['base', 'hover', 'active'];
|
|
15
15
|
const SIZE_KEYS = ['xs', 'sm', 'md', 'lg', 'xl'];
|
|
16
16
|
const VARIANT_KEYS = ['filled', 'outline'];
|
|
17
|
-
const
|
|
18
|
-
const
|
|
17
|
+
const UI_APPEARANCE_KEYS = ['default', 'accent', 'primary', 'secondary', 'tertiary', 'success', 'danger', 'warning', 'info'];
|
|
18
|
+
const BG_APPEARANCE_KEYS = [...UI_APPEARANCE_KEYS, 'transparent'];
|
|
19
|
+
const TEXT_APPEARANCE_KEYS = [...UI_APPEARANCE_KEYS, 'muted', 'link'];
|
|
19
20
|
const FONT_FAMILY_KEYS = ['sans', 'serif', 'mono'];
|
|
20
21
|
const FONT_WEIGHT_KEYS = ['thin', 'extralight', 'light', 'normal', 'medium', 'semibold', 'bold', 'extrabold', 'black'];
|
|
21
22
|
const FONT_STYLE_KEYS = ['italic', 'notItalic'];
|
|
@@ -45,6 +46,8 @@ const EXCLUSIVE_KEY_GROUPS = [
|
|
|
45
46
|
MODE_KEYS,
|
|
46
47
|
SIZE_KEYS,
|
|
47
48
|
TEXT_APPEARANCE_KEYS,
|
|
49
|
+
BG_APPEARANCE_KEYS,
|
|
50
|
+
UI_APPEARANCE_KEYS,
|
|
48
51
|
VARIANT_KEYS,
|
|
49
52
|
FONT_FAMILY_KEYS,
|
|
50
53
|
FONT_WEIGHT_KEYS,
|
|
@@ -102,13 +105,13 @@ const BUTTON_KEYS = [
|
|
|
102
105
|
...GAP_KEYS,
|
|
103
106
|
...PADDING_KEYS,
|
|
104
107
|
...VARIANT_KEYS,
|
|
105
|
-
...
|
|
108
|
+
...TEXT_APPEARANCE_KEYS
|
|
106
109
|
];
|
|
107
110
|
// Grid keys
|
|
108
111
|
const GRID_KEYS = [
|
|
109
112
|
...BASE_COMPONENT_KEYS,
|
|
110
113
|
...GAP_KEYS,
|
|
111
|
-
...
|
|
114
|
+
...BG_APPEARANCE_KEYS
|
|
112
115
|
];
|
|
113
116
|
// Row keys
|
|
114
117
|
const ROW_KEYS = [
|
|
@@ -117,7 +120,7 @@ const ROW_KEYS = [
|
|
|
117
120
|
...GAP_KEYS,
|
|
118
121
|
...DIRECTION_REVERSE_KEYS,
|
|
119
122
|
...BREAKPOINT_KEYS,
|
|
120
|
-
...
|
|
123
|
+
...BG_APPEARANCE_KEYS
|
|
121
124
|
];
|
|
122
125
|
// Col keys
|
|
123
126
|
const COL_KEYS = [
|
|
@@ -125,7 +128,7 @@ const COL_KEYS = [
|
|
|
125
128
|
...WRAP_KEYS,
|
|
126
129
|
...GAP_KEYS,
|
|
127
130
|
...DIRECTION_REVERSE_KEYS,
|
|
128
|
-
...
|
|
131
|
+
...BG_APPEARANCE_KEYS
|
|
129
132
|
];
|
|
130
133
|
// Card keys
|
|
131
134
|
const CARD_KEYS = [
|
|
@@ -134,7 +137,7 @@ const CARD_KEYS = [
|
|
|
134
137
|
...SHARP_KEYS,
|
|
135
138
|
...ROUNDED_KEYS,
|
|
136
139
|
...BREAKPOINT_KEYS,
|
|
137
|
-
...
|
|
140
|
+
...BG_APPEARANCE_KEYS,
|
|
138
141
|
...BORDER_KEYS,
|
|
139
142
|
...RING_KEYS,
|
|
140
143
|
...SHADOW_KEYS,
|
|
@@ -150,7 +153,7 @@ const STACK_KEYS = [
|
|
|
150
153
|
...GAP_KEYS,
|
|
151
154
|
...DIRECTION_REVERSE_KEYS,
|
|
152
155
|
...BREAKPOINT_KEYS,
|
|
153
|
-
...
|
|
156
|
+
...BG_APPEARANCE_KEYS,
|
|
154
157
|
...FLEX_DIRECTION_KEYS,
|
|
155
158
|
...PADDING_KEYS
|
|
156
159
|
];
|
|
@@ -164,7 +167,7 @@ const BADGE_KEYS = [
|
|
|
164
167
|
...RING_KEYS,
|
|
165
168
|
...GAP_KEYS,
|
|
166
169
|
...PADDING_KEYS,
|
|
167
|
-
...
|
|
170
|
+
...TEXT_APPEARANCE_KEYS
|
|
168
171
|
];
|
|
169
172
|
// Chip keys
|
|
170
173
|
const CHIP_KEYS = [
|
|
@@ -176,17 +179,17 @@ const CHIP_KEYS = [
|
|
|
176
179
|
...RING_KEYS,
|
|
177
180
|
...GAP_KEYS,
|
|
178
181
|
...PADDING_KEYS,
|
|
179
|
-
...
|
|
182
|
+
...TEXT_APPEARANCE_KEYS
|
|
180
183
|
];
|
|
181
184
|
// Divider keys
|
|
182
185
|
const DIVIDER_KEYS = [
|
|
183
186
|
...BASE_COMPONENT_KEYS,
|
|
184
|
-
...
|
|
187
|
+
...BG_APPEARANCE_KEYS
|
|
185
188
|
];
|
|
186
189
|
// Container keys
|
|
187
190
|
const CONTAINER_KEYS = [
|
|
188
191
|
...BASE_COMPONENT_KEYS,
|
|
189
|
-
...
|
|
192
|
+
...BG_APPEARANCE_KEYS,
|
|
190
193
|
...BORDER_KEYS,
|
|
191
194
|
...SHADOW_KEYS,
|
|
192
195
|
...RING_KEYS,
|
|
@@ -197,7 +200,7 @@ const CONTAINER_KEYS = [
|
|
|
197
200
|
const SECTION_KEYS = [
|
|
198
201
|
...BASE_COMPONENT_KEYS,
|
|
199
202
|
...FLEX_DIRECTION_KEYS,
|
|
200
|
-
...
|
|
203
|
+
...BG_APPEARANCE_KEYS,
|
|
201
204
|
...PADDING_KEYS,
|
|
202
205
|
...DIRECTION_REVERSE_KEYS,
|
|
203
206
|
...WRAP_KEYS,
|
|
@@ -3548,7 +3551,6 @@ PyTheme.defaultClasses = {
|
|
|
3548
3551
|
noPadding: "py-0"
|
|
3549
3552
|
};
|
|
3550
3553
|
|
|
3551
|
-
// Text appearance classes for filled buttons (all white text)
|
|
3552
3554
|
const filledTextAppearanceClasses = {
|
|
3553
3555
|
default: "text-white",
|
|
3554
3556
|
primary: "text-white",
|
|
@@ -3561,9 +3563,7 @@ const filledTextAppearanceClasses = {
|
|
|
3561
3563
|
danger: "text-white",
|
|
3562
3564
|
warning: "text-white",
|
|
3563
3565
|
info: "text-white",
|
|
3564
|
-
transparent: "text-transparent",
|
|
3565
3566
|
};
|
|
3566
|
-
// Default text appearance classes (for non-button components)
|
|
3567
3567
|
const textAppearanceClasses = {
|
|
3568
3568
|
default: "text-(--text-color-default)",
|
|
3569
3569
|
primary: "text-(--text-color-primary)",
|
|
@@ -3576,9 +3576,7 @@ const textAppearanceClasses = {
|
|
|
3576
3576
|
danger: "text-(--text-color-danger)",
|
|
3577
3577
|
warning: "text-(--text-color-warning)",
|
|
3578
3578
|
info: "text-(--text-color-info)",
|
|
3579
|
-
transparent: "text-transparent",
|
|
3580
3579
|
};
|
|
3581
|
-
// Text size classes
|
|
3582
3580
|
const textSizeClasses = {
|
|
3583
3581
|
xs: "text-xs",
|
|
3584
3582
|
sm: "text-sm",
|
|
@@ -3639,7 +3637,6 @@ TextAppearanceTheme.defaultFullConfig = (() => {
|
|
|
3639
3637
|
return config;
|
|
3640
3638
|
})();
|
|
3641
3639
|
|
|
3642
|
-
// Background classes for filled buttons
|
|
3643
3640
|
const filledBackgroundAppearanceClasses = {
|
|
3644
3641
|
default: "bg-(--filled-background-color-default)",
|
|
3645
3642
|
primary: "bg-(--filled-background-color-primary)",
|
|
@@ -3651,10 +3648,7 @@ const filledBackgroundAppearanceClasses = {
|
|
|
3651
3648
|
warning: "bg-(--filled-background-color-warning)",
|
|
3652
3649
|
info: "bg-(--filled-background-color-info)",
|
|
3653
3650
|
transparent: "bg-transparent",
|
|
3654
|
-
muted: "bg-(--filled-background-color-muted)",
|
|
3655
|
-
link: "bg-(--filled-background-color-link)",
|
|
3656
3651
|
};
|
|
3657
|
-
// Hover background classes for filled buttons
|
|
3658
3652
|
const filledHoverBackgroundAppearanceClasses = {
|
|
3659
3653
|
default: "hover:bg-(--filled-background-color-hover-default)",
|
|
3660
3654
|
primary: "hover:bg-(--filled-background-color-hover-primary)",
|
|
@@ -3666,10 +3660,7 @@ const filledHoverBackgroundAppearanceClasses = {
|
|
|
3666
3660
|
warning: "hover:bg-(--filled-background-color-hover-warning)",
|
|
3667
3661
|
info: "hover:bg-(--filled-background-color-hover-info)",
|
|
3668
3662
|
transparent: "hover:bg-transparent",
|
|
3669
|
-
muted: "hover:bg-(--filled-background-color-hover-muted)",
|
|
3670
|
-
link: "hover:bg-(--filled-background-color-hover-link)",
|
|
3671
3663
|
};
|
|
3672
|
-
// Active background classes for filled buttons
|
|
3673
3664
|
const filledActiveBackgroundAppearanceClasses = {
|
|
3674
3665
|
default: "active:bg-(--filled-background-color-active-default)",
|
|
3675
3666
|
primary: "active:bg-(--filled-background-color-active-primary)",
|
|
@@ -3681,10 +3672,7 @@ const filledActiveBackgroundAppearanceClasses = {
|
|
|
3681
3672
|
warning: "active:bg-(--filled-background-color-active-warning)",
|
|
3682
3673
|
info: "active:bg-(--filled-background-color-active-info)",
|
|
3683
3674
|
transparent: "active:bg-transparent",
|
|
3684
|
-
muted: "active:bg-(--filled-background-color-active-muted)",
|
|
3685
|
-
link: "active:bg-(--filled-background-color-active-link)",
|
|
3686
3675
|
};
|
|
3687
|
-
// Default background appearance classes (for non-button components)
|
|
3688
3676
|
const backgroundAppearanceClasses = {
|
|
3689
3677
|
default: "bg-(--background-color-default)",
|
|
3690
3678
|
primary: "bg-(--background-color-primary)",
|
|
@@ -3696,10 +3684,7 @@ const backgroundAppearanceClasses = {
|
|
|
3696
3684
|
warning: "bg-(--background-color-warning)",
|
|
3697
3685
|
info: "bg-(--background-color-info)",
|
|
3698
3686
|
transparent: "bg-transparent",
|
|
3699
|
-
muted: "bg-(--background-color-muted)",
|
|
3700
|
-
link: "bg-(--background-color-link)",
|
|
3701
3687
|
};
|
|
3702
|
-
// Hover background appearance classes for outline buttons
|
|
3703
3688
|
const hoverBackgroundAppearanceClasses = {
|
|
3704
3689
|
default: "hover:bg-(--background-color-hover-default)",
|
|
3705
3690
|
primary: "hover:bg-(--background-color-hover-primary)",
|
|
@@ -3711,10 +3696,7 @@ const hoverBackgroundAppearanceClasses = {
|
|
|
3711
3696
|
warning: "hover:bg-(--background-color-hover-warning)",
|
|
3712
3697
|
info: "hover:bg-(--background-color-hover-info)",
|
|
3713
3698
|
transparent: "hover:bg-transparent",
|
|
3714
|
-
muted: "hover:bg-(--background-color-hover-muted)",
|
|
3715
|
-
link: "hover:bg-(--background-color-hover-link)",
|
|
3716
3699
|
};
|
|
3717
|
-
// Active background appearance classes for outline buttons
|
|
3718
3700
|
const activeBackgroundAppearanceClasses = {
|
|
3719
3701
|
default: "active:bg-(--background-color-active-default)",
|
|
3720
3702
|
primary: "active:bg-(--background-color-active-primary)",
|
|
@@ -3726,8 +3708,6 @@ const activeBackgroundAppearanceClasses = {
|
|
|
3726
3708
|
warning: "active:bg-(--background-color-active-warning)",
|
|
3727
3709
|
info: "active:bg-(--background-color-active-info)",
|
|
3728
3710
|
transparent: "active:bg-transparent",
|
|
3729
|
-
muted: "active:bg-(--background-color-active-muted)",
|
|
3730
|
-
link: "active:bg-(--background-color-active-link)",
|
|
3731
3711
|
};
|
|
3732
3712
|
const layoutBackgroundAppearanceClasses = {
|
|
3733
3713
|
default: "bg-(--layout-background-default)",
|
|
@@ -3751,7 +3731,6 @@ const bgBorderAppearanceClasses = {
|
|
|
3751
3731
|
danger: "bg-(--border-color-danger)",
|
|
3752
3732
|
warning: "bg-(--border-color-warning)",
|
|
3753
3733
|
info: "bg-(--border-color-info)",
|
|
3754
|
-
transparent: "bg-transparent",
|
|
3755
3734
|
muted: "bg-(--border-color-muted)",
|
|
3756
3735
|
link: "bg-(--border-color-link)",
|
|
3757
3736
|
};
|
|
@@ -3765,11 +3744,9 @@ const borderAppearanceClasses = {
|
|
|
3765
3744
|
danger: "border-(--border-color-danger)",
|
|
3766
3745
|
warning: "border-(--border-color-warning)",
|
|
3767
3746
|
info: "border-(--border-color-info)",
|
|
3768
|
-
transparent: "border-transparent",
|
|
3769
3747
|
muted: "border-(--border-color-muted)",
|
|
3770
3748
|
link: "border-(--border-color-link)",
|
|
3771
3749
|
};
|
|
3772
|
-
// Border classes for filled elements
|
|
3773
3750
|
const filledBorderAppearanceClasses = {
|
|
3774
3751
|
default: "border-(--filled-border-color-default)",
|
|
3775
3752
|
primary: "border-(--filled-border-color-primary)",
|
|
@@ -3780,7 +3757,6 @@ const filledBorderAppearanceClasses = {
|
|
|
3780
3757
|
danger: "border-(--filled-border-color-danger)",
|
|
3781
3758
|
warning: "border-(--filled-border-color-warning)",
|
|
3782
3759
|
info: "border-(--filled-border-color-info)",
|
|
3783
|
-
transparent: "border-transparent",
|
|
3784
3760
|
muted: "border-(--filled-border-color-muted)",
|
|
3785
3761
|
link: "border-(--filled-border-color-link)",
|
|
3786
3762
|
};
|
|
@@ -3794,11 +3770,9 @@ const ringAppearanceClasses = {
|
|
|
3794
3770
|
danger: "ring-(--border-color-danger)",
|
|
3795
3771
|
warning: "ring-(--border-color-warning)",
|
|
3796
3772
|
info: "ring-(--border-color-info)",
|
|
3797
|
-
transparent: "ring-transparent",
|
|
3798
3773
|
muted: "ring-(--border-color-muted)",
|
|
3799
3774
|
link: "ring-(--border-color-link)",
|
|
3800
3775
|
};
|
|
3801
|
-
// Ring classes for filled elements
|
|
3802
3776
|
const filledRingAppearanceClasses = {
|
|
3803
3777
|
default: "ring-(--filled-border-color-default)",
|
|
3804
3778
|
primary: "ring-(--filled-border-color-primary)",
|
|
@@ -3809,7 +3783,6 @@ const filledRingAppearanceClasses = {
|
|
|
3809
3783
|
danger: "ring-(--filled-border-color-danger)",
|
|
3810
3784
|
warning: "ring-(--filled-border-color-warning)",
|
|
3811
3785
|
info: "ring-(--filled-border-color-info)",
|
|
3812
|
-
transparent: "ring-transparent",
|
|
3813
3786
|
muted: "ring-(--filled-border-color-muted)",
|
|
3814
3787
|
link: "ring-(--filled-border-color-link)",
|
|
3815
3788
|
};
|
|
@@ -4216,7 +4189,7 @@ const commonGaps = {
|
|
|
4216
4189
|
class LayoutAppearanceTheme extends BaseTheme {
|
|
4217
4190
|
constructor(initialOverrides) {
|
|
4218
4191
|
super();
|
|
4219
|
-
|
|
4192
|
+
BG_APPEARANCE_KEYS.forEach((textKey) => {
|
|
4220
4193
|
const defaultModesForKey = LayoutAppearanceTheme.defaultFullConfig[textKey];
|
|
4221
4194
|
const overrideModesForKey = initialOverrides === null || initialOverrides === void 0 ? void 0 : initialOverrides[textKey];
|
|
4222
4195
|
this[textKey] = {
|
|
@@ -4226,7 +4199,7 @@ class LayoutAppearanceTheme extends BaseTheme {
|
|
|
4226
4199
|
});
|
|
4227
4200
|
}
|
|
4228
4201
|
getClasses(props, defaults) {
|
|
4229
|
-
const pickedAppearanceKey = pickFirstTruthyKey(props, defaults,
|
|
4202
|
+
const pickedAppearanceKey = pickFirstTruthyKey(props, defaults, BG_APPEARANCE_KEYS) || 'default';
|
|
4230
4203
|
const modesForAppearance = this[pickedAppearanceKey];
|
|
4231
4204
|
if (!modesForAppearance) {
|
|
4232
4205
|
return MODE_KEYS.map(() => '');
|
|
@@ -4235,7 +4208,7 @@ class LayoutAppearanceTheme extends BaseTheme {
|
|
|
4235
4208
|
}
|
|
4236
4209
|
static createDefaultStyle(src = {}) {
|
|
4237
4210
|
const initialOverridesForConstructor = {};
|
|
4238
|
-
|
|
4211
|
+
BG_APPEARANCE_KEYS.forEach((textKey) => {
|
|
4239
4212
|
const modesForCurrentTextKey = {};
|
|
4240
4213
|
let keyHasDataInSrc = false;
|
|
4241
4214
|
MODE_KEYS.forEach((modeKey) => {
|
|
@@ -4255,9 +4228,9 @@ class LayoutAppearanceTheme extends BaseTheme {
|
|
|
4255
4228
|
}
|
|
4256
4229
|
LayoutAppearanceTheme.defaultFullConfig = (() => {
|
|
4257
4230
|
const config = {};
|
|
4258
|
-
|
|
4231
|
+
BG_APPEARANCE_KEYS.forEach((key) => {
|
|
4259
4232
|
config[key] = {
|
|
4260
|
-
base:
|
|
4233
|
+
base: backgroundAppearanceClasses[key] || '',
|
|
4261
4234
|
hover: '',
|
|
4262
4235
|
active: '',
|
|
4263
4236
|
};
|
|
@@ -4715,9 +4688,9 @@ const List = (props) => {
|
|
|
4715
4688
|
return jsxRuntime.jsx(ThemedComponent, { theme: theme.list, propsToOmit: TYPOGRAPHY_COMPONENT_KEYS, ...props });
|
|
4716
4689
|
};
|
|
4717
4690
|
|
|
4718
|
-
exports.APPEARANCE_KEYS = APPEARANCE_KEYS;
|
|
4719
4691
|
exports.BADGE_KEYS = BADGE_KEYS;
|
|
4720
4692
|
exports.BASE_COMPONENT_KEYS = BASE_COMPONENT_KEYS;
|
|
4693
|
+
exports.BG_APPEARANCE_KEYS = BG_APPEARANCE_KEYS;
|
|
4721
4694
|
exports.BORDER_KEYS = BORDER_KEYS;
|
|
4722
4695
|
exports.BREAKPOINT_KEYS = BREAKPOINT_KEYS;
|
|
4723
4696
|
exports.BUTTON_KEYS = BUTTON_KEYS;
|
|
@@ -4778,6 +4751,7 @@ exports.TYPOGRAPHY_COMPONENT_KEYS = TYPOGRAPHY_COMPONENT_KEYS;
|
|
|
4778
4751
|
exports.Text = Text;
|
|
4779
4752
|
exports.ThemeProvider = ThemeProvider;
|
|
4780
4753
|
exports.Title = Title;
|
|
4754
|
+
exports.UI_APPEARANCE_KEYS = UI_APPEARANCE_KEYS;
|
|
4781
4755
|
exports.VARIANT_KEYS = VARIANT_KEYS;
|
|
4782
4756
|
exports.WRAP_KEYS = WRAP_KEYS;
|
|
4783
4757
|
exports.defaultTheme = defaultTheme;
|