@vaneui/ui 0.1.3 → 0.1.5
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 +6 -6
- package/dist/components/ui/theme/appearance/bgAppearanceTheme.d.ts +8 -0
- package/dist/components/ui/theme/appearance/genericVariantTheme.d.ts +14 -0
- package/dist/components/ui/theme/appearance/textAppearanceTheme.d.ts +3 -4
- package/dist/components/ui/theme/badgeTheme.d.ts +6 -5
- package/dist/components/ui/theme/buttonTheme.d.ts +6 -5
- package/dist/components/ui/theme/cardTheme.d.ts +2 -2
- package/dist/components/ui/theme/chipTheme.d.ts +6 -5
- package/dist/components/ui/theme/containerTheme.d.ts +2 -2
- package/dist/components/ui/theme/sectionTheme.d.ts +7 -5
- package/dist/index.esm.js +122 -214
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +122 -214
- package/dist/index.js.map +1 -1
- package/dist/ui.css +0 -72
- package/package.json +1 -1
- package/dist/components/ui/theme/appearance/layoutAppearanceTheme.d.ts +0 -10
- package/dist/components/ui/theme/appearance/variantTheme.d.ts +0 -15
package/dist/index.esm.js
CHANGED
|
@@ -12,8 +12,8 @@ class BaseTheme {
|
|
|
12
12
|
const MODE_KEYS = ['base', 'hover', 'active'];
|
|
13
13
|
const SIZE_KEYS = ['xs', 'sm', 'md', 'lg', 'xl'];
|
|
14
14
|
const VARIANT_KEYS = ['filled', 'outline'];
|
|
15
|
-
const
|
|
16
|
-
const TEXT_APPEARANCE_KEYS = [...
|
|
15
|
+
const BG_APPEARANCE_KEYS = ['default', 'accent', 'primary', 'secondary', 'tertiary', 'success', 'danger', 'warning', 'info', 'transparent'];
|
|
16
|
+
const TEXT_APPEARANCE_KEYS = [...BG_APPEARANCE_KEYS, 'muted', 'link'];
|
|
17
17
|
const FONT_FAMILY_KEYS = ['sans', 'serif', 'mono'];
|
|
18
18
|
const FONT_WEIGHT_KEYS = ['thin', 'extralight', 'light', 'normal', 'medium', 'semibold', 'bold', 'extrabold', 'black'];
|
|
19
19
|
const FONT_STYLE_KEYS = ['italic', 'notItalic'];
|
|
@@ -43,6 +43,7 @@ const EXCLUSIVE_KEY_GROUPS = [
|
|
|
43
43
|
MODE_KEYS,
|
|
44
44
|
SIZE_KEYS,
|
|
45
45
|
TEXT_APPEARANCE_KEYS,
|
|
46
|
+
BG_APPEARANCE_KEYS,
|
|
46
47
|
VARIANT_KEYS,
|
|
47
48
|
FONT_FAMILY_KEYS,
|
|
48
49
|
FONT_WEIGHT_KEYS,
|
|
@@ -100,13 +101,13 @@ const BUTTON_KEYS = [
|
|
|
100
101
|
...GAP_KEYS,
|
|
101
102
|
...PADDING_KEYS,
|
|
102
103
|
...VARIANT_KEYS,
|
|
103
|
-
...
|
|
104
|
+
...TEXT_APPEARANCE_KEYS
|
|
104
105
|
];
|
|
105
106
|
// Grid keys
|
|
106
107
|
const GRID_KEYS = [
|
|
107
108
|
...BASE_COMPONENT_KEYS,
|
|
108
109
|
...GAP_KEYS,
|
|
109
|
-
...
|
|
110
|
+
...BG_APPEARANCE_KEYS
|
|
110
111
|
];
|
|
111
112
|
// Row keys
|
|
112
113
|
const ROW_KEYS = [
|
|
@@ -115,7 +116,7 @@ const ROW_KEYS = [
|
|
|
115
116
|
...GAP_KEYS,
|
|
116
117
|
...DIRECTION_REVERSE_KEYS,
|
|
117
118
|
...BREAKPOINT_KEYS,
|
|
118
|
-
...
|
|
119
|
+
...BG_APPEARANCE_KEYS
|
|
119
120
|
];
|
|
120
121
|
// Col keys
|
|
121
122
|
const COL_KEYS = [
|
|
@@ -123,7 +124,7 @@ const COL_KEYS = [
|
|
|
123
124
|
...WRAP_KEYS,
|
|
124
125
|
...GAP_KEYS,
|
|
125
126
|
...DIRECTION_REVERSE_KEYS,
|
|
126
|
-
...
|
|
127
|
+
...BG_APPEARANCE_KEYS
|
|
127
128
|
];
|
|
128
129
|
// Card keys
|
|
129
130
|
const CARD_KEYS = [
|
|
@@ -132,7 +133,7 @@ const CARD_KEYS = [
|
|
|
132
133
|
...SHARP_KEYS,
|
|
133
134
|
...ROUNDED_KEYS,
|
|
134
135
|
...BREAKPOINT_KEYS,
|
|
135
|
-
...
|
|
136
|
+
...BG_APPEARANCE_KEYS,
|
|
136
137
|
...BORDER_KEYS,
|
|
137
138
|
...RING_KEYS,
|
|
138
139
|
...SHADOW_KEYS,
|
|
@@ -148,7 +149,7 @@ const STACK_KEYS = [
|
|
|
148
149
|
...GAP_KEYS,
|
|
149
150
|
...DIRECTION_REVERSE_KEYS,
|
|
150
151
|
...BREAKPOINT_KEYS,
|
|
151
|
-
...
|
|
152
|
+
...BG_APPEARANCE_KEYS,
|
|
152
153
|
...FLEX_DIRECTION_KEYS,
|
|
153
154
|
...PADDING_KEYS
|
|
154
155
|
];
|
|
@@ -162,7 +163,7 @@ const BADGE_KEYS = [
|
|
|
162
163
|
...RING_KEYS,
|
|
163
164
|
...GAP_KEYS,
|
|
164
165
|
...PADDING_KEYS,
|
|
165
|
-
...
|
|
166
|
+
...TEXT_APPEARANCE_KEYS
|
|
166
167
|
];
|
|
167
168
|
// Chip keys
|
|
168
169
|
const CHIP_KEYS = [
|
|
@@ -174,17 +175,17 @@ const CHIP_KEYS = [
|
|
|
174
175
|
...RING_KEYS,
|
|
175
176
|
...GAP_KEYS,
|
|
176
177
|
...PADDING_KEYS,
|
|
177
|
-
...
|
|
178
|
+
...TEXT_APPEARANCE_KEYS
|
|
178
179
|
];
|
|
179
180
|
// Divider keys
|
|
180
181
|
const DIVIDER_KEYS = [
|
|
181
182
|
...BASE_COMPONENT_KEYS,
|
|
182
|
-
...
|
|
183
|
+
...BG_APPEARANCE_KEYS
|
|
183
184
|
];
|
|
184
185
|
// Container keys
|
|
185
186
|
const CONTAINER_KEYS = [
|
|
186
187
|
...BASE_COMPONENT_KEYS,
|
|
187
|
-
...
|
|
188
|
+
...BG_APPEARANCE_KEYS,
|
|
188
189
|
...BORDER_KEYS,
|
|
189
190
|
...SHADOW_KEYS,
|
|
190
191
|
...RING_KEYS,
|
|
@@ -195,7 +196,7 @@ const CONTAINER_KEYS = [
|
|
|
195
196
|
const SECTION_KEYS = [
|
|
196
197
|
...BASE_COMPONENT_KEYS,
|
|
197
198
|
...FLEX_DIRECTION_KEYS,
|
|
198
|
-
...
|
|
199
|
+
...BG_APPEARANCE_KEYS,
|
|
199
200
|
...PADDING_KEYS,
|
|
200
201
|
...DIRECTION_REVERSE_KEYS,
|
|
201
202
|
...WRAP_KEYS,
|
|
@@ -3546,7 +3547,34 @@ PyTheme.defaultClasses = {
|
|
|
3546
3547
|
noPadding: "py-0"
|
|
3547
3548
|
};
|
|
3548
3549
|
|
|
3549
|
-
|
|
3550
|
+
class TextAppearanceTheme extends BaseTheme {
|
|
3551
|
+
constructor(config) {
|
|
3552
|
+
super();
|
|
3553
|
+
Object.assign(this, config);
|
|
3554
|
+
}
|
|
3555
|
+
getClasses(props, defaults) {
|
|
3556
|
+
const pickedAppearanceKey = pickFirstTruthyKey(props, defaults, TEXT_APPEARANCE_KEYS) || 'default';
|
|
3557
|
+
const modesForAppearance = this[pickedAppearanceKey];
|
|
3558
|
+
if (!modesForAppearance) {
|
|
3559
|
+
return MODE_KEYS.map(() => '');
|
|
3560
|
+
}
|
|
3561
|
+
return MODE_KEYS.map(mode => modesForAppearance[mode] || '');
|
|
3562
|
+
}
|
|
3563
|
+
static createTheme(src = {}) {
|
|
3564
|
+
const finalConfig = Object.fromEntries(TEXT_APPEARANCE_KEYS.map(textKey => [
|
|
3565
|
+
textKey,
|
|
3566
|
+
Object.fromEntries(MODE_KEYS.map(modeKey => {
|
|
3567
|
+
var _a;
|
|
3568
|
+
return [
|
|
3569
|
+
modeKey,
|
|
3570
|
+
((_a = src[modeKey]) === null || _a === void 0 ? void 0 : _a[textKey]) || ''
|
|
3571
|
+
];
|
|
3572
|
+
})),
|
|
3573
|
+
]));
|
|
3574
|
+
return new TextAppearanceTheme(finalConfig);
|
|
3575
|
+
}
|
|
3576
|
+
}
|
|
3577
|
+
|
|
3550
3578
|
const filledTextAppearanceClasses = {
|
|
3551
3579
|
default: "text-white",
|
|
3552
3580
|
primary: "text-white",
|
|
@@ -3561,7 +3589,6 @@ const filledTextAppearanceClasses = {
|
|
|
3561
3589
|
info: "text-white",
|
|
3562
3590
|
transparent: "text-transparent",
|
|
3563
3591
|
};
|
|
3564
|
-
// Default text appearance classes (for non-button components)
|
|
3565
3592
|
const textAppearanceClasses = {
|
|
3566
3593
|
default: "text-(--text-color-default)",
|
|
3567
3594
|
primary: "text-(--text-color-primary)",
|
|
@@ -3576,7 +3603,6 @@ const textAppearanceClasses = {
|
|
|
3576
3603
|
info: "text-(--text-color-info)",
|
|
3577
3604
|
transparent: "text-transparent",
|
|
3578
3605
|
};
|
|
3579
|
-
// Text size classes
|
|
3580
3606
|
const textSizeClasses = {
|
|
3581
3607
|
xs: "text-xs",
|
|
3582
3608
|
sm: "text-sm",
|
|
@@ -3585,59 +3611,6 @@ const textSizeClasses = {
|
|
|
3585
3611
|
xl: "text-xl",
|
|
3586
3612
|
};
|
|
3587
3613
|
|
|
3588
|
-
class TextAppearanceTheme extends BaseTheme {
|
|
3589
|
-
constructor(initialOverrides) {
|
|
3590
|
-
super();
|
|
3591
|
-
TEXT_APPEARANCE_KEYS.forEach((textKey) => {
|
|
3592
|
-
const defaultModesForKey = TextAppearanceTheme.defaultFullConfig[textKey];
|
|
3593
|
-
const overrideModesForKey = initialOverrides === null || initialOverrides === void 0 ? void 0 : initialOverrides[textKey];
|
|
3594
|
-
this[textKey] = {
|
|
3595
|
-
...defaultModesForKey,
|
|
3596
|
-
...(overrideModesForKey || {}),
|
|
3597
|
-
};
|
|
3598
|
-
});
|
|
3599
|
-
}
|
|
3600
|
-
getClasses(props, defaults) {
|
|
3601
|
-
const pickedAppearanceKey = pickFirstTruthyKey(props, defaults, TEXT_APPEARANCE_KEYS) || 'default';
|
|
3602
|
-
const modesForAppearance = this[pickedAppearanceKey];
|
|
3603
|
-
if (!modesForAppearance) {
|
|
3604
|
-
return MODE_KEYS.map(() => '');
|
|
3605
|
-
}
|
|
3606
|
-
return MODE_KEYS.map(mode => modesForAppearance[mode] || '');
|
|
3607
|
-
}
|
|
3608
|
-
static createDefaultStyle(src = {}) {
|
|
3609
|
-
const initialOverridesForConstructor = {};
|
|
3610
|
-
TEXT_APPEARANCE_KEYS.forEach((textKey) => {
|
|
3611
|
-
const modesForCurrentTextKey = {};
|
|
3612
|
-
let keyHasDataInSrc = false;
|
|
3613
|
-
MODE_KEYS.forEach((modeKey) => {
|
|
3614
|
-
var _a;
|
|
3615
|
-
const classValue = (_a = src[modeKey]) === null || _a === void 0 ? void 0 : _a[textKey];
|
|
3616
|
-
if (classValue !== undefined) {
|
|
3617
|
-
modesForCurrentTextKey[modeKey] = classValue;
|
|
3618
|
-
keyHasDataInSrc = true;
|
|
3619
|
-
}
|
|
3620
|
-
});
|
|
3621
|
-
if (keyHasDataInSrc) {
|
|
3622
|
-
initialOverridesForConstructor[textKey] = modesForCurrentTextKey;
|
|
3623
|
-
}
|
|
3624
|
-
});
|
|
3625
|
-
return new TextAppearanceTheme(initialOverridesForConstructor);
|
|
3626
|
-
}
|
|
3627
|
-
}
|
|
3628
|
-
TextAppearanceTheme.defaultFullConfig = (() => {
|
|
3629
|
-
const config = {};
|
|
3630
|
-
TEXT_APPEARANCE_KEYS.forEach((key) => {
|
|
3631
|
-
config[key] = {
|
|
3632
|
-
base: textAppearanceClasses[key] || '',
|
|
3633
|
-
hover: '',
|
|
3634
|
-
active: '',
|
|
3635
|
-
};
|
|
3636
|
-
});
|
|
3637
|
-
return config;
|
|
3638
|
-
})();
|
|
3639
|
-
|
|
3640
|
-
// Background classes for filled buttons
|
|
3641
3614
|
const filledBackgroundAppearanceClasses = {
|
|
3642
3615
|
default: "bg-(--filled-background-color-default)",
|
|
3643
3616
|
primary: "bg-(--filled-background-color-primary)",
|
|
@@ -3649,10 +3622,7 @@ const filledBackgroundAppearanceClasses = {
|
|
|
3649
3622
|
warning: "bg-(--filled-background-color-warning)",
|
|
3650
3623
|
info: "bg-(--filled-background-color-info)",
|
|
3651
3624
|
transparent: "bg-transparent",
|
|
3652
|
-
muted: "bg-(--filled-background-color-muted)",
|
|
3653
|
-
link: "bg-(--filled-background-color-link)",
|
|
3654
3625
|
};
|
|
3655
|
-
// Hover background classes for filled buttons
|
|
3656
3626
|
const filledHoverBackgroundAppearanceClasses = {
|
|
3657
3627
|
default: "hover:bg-(--filled-background-color-hover-default)",
|
|
3658
3628
|
primary: "hover:bg-(--filled-background-color-hover-primary)",
|
|
@@ -3664,10 +3634,7 @@ const filledHoverBackgroundAppearanceClasses = {
|
|
|
3664
3634
|
warning: "hover:bg-(--filled-background-color-hover-warning)",
|
|
3665
3635
|
info: "hover:bg-(--filled-background-color-hover-info)",
|
|
3666
3636
|
transparent: "hover:bg-transparent",
|
|
3667
|
-
muted: "hover:bg-(--filled-background-color-hover-muted)",
|
|
3668
|
-
link: "hover:bg-(--filled-background-color-hover-link)",
|
|
3669
3637
|
};
|
|
3670
|
-
// Active background classes for filled buttons
|
|
3671
3638
|
const filledActiveBackgroundAppearanceClasses = {
|
|
3672
3639
|
default: "active:bg-(--filled-background-color-active-default)",
|
|
3673
3640
|
primary: "active:bg-(--filled-background-color-active-primary)",
|
|
@@ -3679,10 +3646,7 @@ const filledActiveBackgroundAppearanceClasses = {
|
|
|
3679
3646
|
warning: "active:bg-(--filled-background-color-active-warning)",
|
|
3680
3647
|
info: "active:bg-(--filled-background-color-active-info)",
|
|
3681
3648
|
transparent: "active:bg-transparent",
|
|
3682
|
-
muted: "active:bg-(--filled-background-color-active-muted)",
|
|
3683
|
-
link: "active:bg-(--filled-background-color-active-link)",
|
|
3684
3649
|
};
|
|
3685
|
-
// Default background appearance classes (for non-button components)
|
|
3686
3650
|
const backgroundAppearanceClasses = {
|
|
3687
3651
|
default: "bg-(--background-color-default)",
|
|
3688
3652
|
primary: "bg-(--background-color-primary)",
|
|
@@ -3694,10 +3658,7 @@ const backgroundAppearanceClasses = {
|
|
|
3694
3658
|
warning: "bg-(--background-color-warning)",
|
|
3695
3659
|
info: "bg-(--background-color-info)",
|
|
3696
3660
|
transparent: "bg-transparent",
|
|
3697
|
-
muted: "bg-(--background-color-muted)",
|
|
3698
|
-
link: "bg-(--background-color-link)",
|
|
3699
3661
|
};
|
|
3700
|
-
// Hover background appearance classes for outline buttons
|
|
3701
3662
|
const hoverBackgroundAppearanceClasses = {
|
|
3702
3663
|
default: "hover:bg-(--background-color-hover-default)",
|
|
3703
3664
|
primary: "hover:bg-(--background-color-hover-primary)",
|
|
@@ -3709,10 +3670,7 @@ const hoverBackgroundAppearanceClasses = {
|
|
|
3709
3670
|
warning: "hover:bg-(--background-color-hover-warning)",
|
|
3710
3671
|
info: "hover:bg-(--background-color-hover-info)",
|
|
3711
3672
|
transparent: "hover:bg-transparent",
|
|
3712
|
-
muted: "hover:bg-(--background-color-hover-muted)",
|
|
3713
|
-
link: "hover:bg-(--background-color-hover-link)",
|
|
3714
3673
|
};
|
|
3715
|
-
// Active background appearance classes for outline buttons
|
|
3716
3674
|
const activeBackgroundAppearanceClasses = {
|
|
3717
3675
|
default: "active:bg-(--background-color-active-default)",
|
|
3718
3676
|
primary: "active:bg-(--background-color-active-primary)",
|
|
@@ -3724,8 +3682,6 @@ const activeBackgroundAppearanceClasses = {
|
|
|
3724
3682
|
warning: "active:bg-(--background-color-active-warning)",
|
|
3725
3683
|
info: "active:bg-(--background-color-active-info)",
|
|
3726
3684
|
transparent: "active:bg-transparent",
|
|
3727
|
-
muted: "active:bg-(--background-color-active-muted)",
|
|
3728
|
-
link: "active:bg-(--background-color-active-link)",
|
|
3729
3685
|
};
|
|
3730
3686
|
const layoutBackgroundAppearanceClasses = {
|
|
3731
3687
|
default: "bg-(--layout-background-default)",
|
|
@@ -3749,9 +3705,9 @@ const bgBorderAppearanceClasses = {
|
|
|
3749
3705
|
danger: "bg-(--border-color-danger)",
|
|
3750
3706
|
warning: "bg-(--border-color-warning)",
|
|
3751
3707
|
info: "bg-(--border-color-info)",
|
|
3752
|
-
transparent: "bg-transparent",
|
|
3753
3708
|
muted: "bg-(--border-color-muted)",
|
|
3754
3709
|
link: "bg-(--border-color-link)",
|
|
3710
|
+
transparent: "bg-transparent",
|
|
3755
3711
|
};
|
|
3756
3712
|
const borderAppearanceClasses = {
|
|
3757
3713
|
default: "border-(--border-color-default)",
|
|
@@ -3763,11 +3719,10 @@ const borderAppearanceClasses = {
|
|
|
3763
3719
|
danger: "border-(--border-color-danger)",
|
|
3764
3720
|
warning: "border-(--border-color-warning)",
|
|
3765
3721
|
info: "border-(--border-color-info)",
|
|
3766
|
-
transparent: "border-transparent",
|
|
3767
3722
|
muted: "border-(--border-color-muted)",
|
|
3768
3723
|
link: "border-(--border-color-link)",
|
|
3724
|
+
transparent: "border-transparent",
|
|
3769
3725
|
};
|
|
3770
|
-
// Border classes for filled elements
|
|
3771
3726
|
const filledBorderAppearanceClasses = {
|
|
3772
3727
|
default: "border-(--filled-border-color-default)",
|
|
3773
3728
|
primary: "border-(--filled-border-color-primary)",
|
|
@@ -3778,9 +3733,9 @@ const filledBorderAppearanceClasses = {
|
|
|
3778
3733
|
danger: "border-(--filled-border-color-danger)",
|
|
3779
3734
|
warning: "border-(--filled-border-color-warning)",
|
|
3780
3735
|
info: "border-(--filled-border-color-info)",
|
|
3781
|
-
transparent: "border-transparent",
|
|
3782
3736
|
muted: "border-(--filled-border-color-muted)",
|
|
3783
3737
|
link: "border-(--filled-border-color-link)",
|
|
3738
|
+
transparent: "border-transparent",
|
|
3784
3739
|
};
|
|
3785
3740
|
const ringAppearanceClasses = {
|
|
3786
3741
|
default: "ring-(--border-color-default)",
|
|
@@ -3792,11 +3747,10 @@ const ringAppearanceClasses = {
|
|
|
3792
3747
|
danger: "ring-(--border-color-danger)",
|
|
3793
3748
|
warning: "ring-(--border-color-warning)",
|
|
3794
3749
|
info: "ring-(--border-color-info)",
|
|
3795
|
-
transparent: "ring-transparent",
|
|
3796
3750
|
muted: "ring-(--border-color-muted)",
|
|
3797
3751
|
link: "ring-(--border-color-link)",
|
|
3752
|
+
transparent: "ring-transparent",
|
|
3798
3753
|
};
|
|
3799
|
-
// Ring classes for filled elements
|
|
3800
3754
|
const filledRingAppearanceClasses = {
|
|
3801
3755
|
default: "ring-(--filled-border-color-default)",
|
|
3802
3756
|
primary: "ring-(--filled-border-color-primary)",
|
|
@@ -3807,70 +3761,75 @@ const filledRingAppearanceClasses = {
|
|
|
3807
3761
|
danger: "ring-(--filled-border-color-danger)",
|
|
3808
3762
|
warning: "ring-(--filled-border-color-warning)",
|
|
3809
3763
|
info: "ring-(--filled-border-color-info)",
|
|
3810
|
-
transparent: "ring-transparent",
|
|
3811
3764
|
muted: "ring-(--filled-border-color-muted)",
|
|
3812
3765
|
link: "ring-(--filled-border-color-link)",
|
|
3766
|
+
transparent: "ring-transparent",
|
|
3813
3767
|
};
|
|
3814
3768
|
|
|
3815
|
-
class
|
|
3816
|
-
constructor(variantInstances
|
|
3769
|
+
class GenericVariantTheme extends BaseTheme {
|
|
3770
|
+
constructor(variantInstances) {
|
|
3817
3771
|
super();
|
|
3818
3772
|
VARIANT_KEYS.forEach((variantKey) => {
|
|
3819
|
-
this[variantKey] = variantInstances[variantKey]
|
|
3773
|
+
this[variantKey] = variantInstances[variantKey];
|
|
3820
3774
|
});
|
|
3821
3775
|
}
|
|
3822
3776
|
getClasses(props, defaults) {
|
|
3823
|
-
const
|
|
3824
|
-
const activeTextAppearanceTheme = this[
|
|
3777
|
+
const variantKey = pickFirstTruthyKey(props, defaults, VARIANT_KEYS) || 'outline';
|
|
3778
|
+
const activeTextAppearanceTheme = this[variantKey];
|
|
3825
3779
|
if (!activeTextAppearanceTheme) {
|
|
3826
3780
|
return [];
|
|
3827
3781
|
}
|
|
3828
3782
|
return activeTextAppearanceTheme.getClasses(props, defaults);
|
|
3829
3783
|
}
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3784
|
+
// used for button, bages, chips, etc
|
|
3785
|
+
static createUIElementTextTheme() {
|
|
3786
|
+
//transparent UI elements have a default text color
|
|
3787
|
+
return new GenericVariantTheme({
|
|
3788
|
+
outline: TextAppearanceTheme.createTheme({
|
|
3789
|
+
base: { ...textAppearanceClasses, transparent: textAppearanceClasses.default }
|
|
3790
|
+
}),
|
|
3791
|
+
filled: TextAppearanceTheme.createTheme({
|
|
3792
|
+
base: { ...filledTextAppearanceClasses, transparent: textAppearanceClasses.default }
|
|
3793
|
+
})
|
|
3794
|
+
});
|
|
3795
|
+
}
|
|
3796
|
+
static createBorderAppearanceTheme() {
|
|
3797
|
+
return new GenericVariantTheme({
|
|
3798
|
+
outline: TextAppearanceTheme.createTheme({ base: borderAppearanceClasses }),
|
|
3799
|
+
filled: TextAppearanceTheme.createTheme({ base: filledBorderAppearanceClasses })
|
|
3800
|
+
});
|
|
3836
3801
|
}
|
|
3837
|
-
static
|
|
3838
|
-
return
|
|
3839
|
-
outline: TextAppearanceTheme.
|
|
3802
|
+
static createRingAppearanceTheme() {
|
|
3803
|
+
return new GenericVariantTheme({
|
|
3804
|
+
outline: TextAppearanceTheme.createTheme({ base: ringAppearanceClasses }),
|
|
3805
|
+
filled: TextAppearanceTheme.createTheme({ base: filledRingAppearanceClasses })
|
|
3806
|
+
});
|
|
3807
|
+
}
|
|
3808
|
+
static createBgAppearanceTheme() {
|
|
3809
|
+
return new GenericVariantTheme({
|
|
3810
|
+
outline: TextAppearanceTheme.createTheme({
|
|
3840
3811
|
base: backgroundAppearanceClasses,
|
|
3841
3812
|
hover: hoverBackgroundAppearanceClasses,
|
|
3842
3813
|
active: activeBackgroundAppearanceClasses
|
|
3843
3814
|
}),
|
|
3844
|
-
filled: TextAppearanceTheme.
|
|
3815
|
+
filled: TextAppearanceTheme.createTheme({
|
|
3845
3816
|
base: filledBackgroundAppearanceClasses,
|
|
3846
3817
|
hover: filledHoverBackgroundAppearanceClasses,
|
|
3847
3818
|
active: filledActiveBackgroundAppearanceClasses
|
|
3848
3819
|
})
|
|
3849
3820
|
});
|
|
3850
3821
|
}
|
|
3851
|
-
static
|
|
3852
|
-
return
|
|
3853
|
-
outline: TextAppearanceTheme.
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
outline: TextAppearanceTheme.createDefaultStyle({ base: borderAppearanceClasses }),
|
|
3860
|
-
filled: TextAppearanceTheme.createDefaultStyle({ base: filledBorderAppearanceClasses })
|
|
3861
|
-
});
|
|
3862
|
-
}
|
|
3863
|
-
static createDefaultRing() {
|
|
3864
|
-
return this.createDefault({
|
|
3865
|
-
outline: TextAppearanceTheme.createDefaultStyle({ base: ringAppearanceClasses }),
|
|
3866
|
-
filled: TextAppearanceTheme.createDefaultStyle({ base: filledRingAppearanceClasses })
|
|
3822
|
+
static createSimpleBgAppearanceTheme() {
|
|
3823
|
+
return new GenericVariantTheme({
|
|
3824
|
+
outline: TextAppearanceTheme.createTheme({
|
|
3825
|
+
base: backgroundAppearanceClasses,
|
|
3826
|
+
}),
|
|
3827
|
+
filled: TextAppearanceTheme.createTheme({
|
|
3828
|
+
base: filledBackgroundAppearanceClasses,
|
|
3829
|
+
})
|
|
3867
3830
|
});
|
|
3868
3831
|
}
|
|
3869
3832
|
}
|
|
3870
|
-
VariantTheme.defaultInstances = Object.fromEntries(VARIANT_KEYS.map(variantKey => [
|
|
3871
|
-
variantKey,
|
|
3872
|
-
new TextAppearanceTheme()
|
|
3873
|
-
]));
|
|
3874
3833
|
|
|
3875
3834
|
const defaultButtonTheme = new ComponentTheme("button", "w-fit h-fit cursor-pointer transition-all duration-200 whitespace-nowrap", {
|
|
3876
3835
|
size: {
|
|
@@ -3911,10 +3870,10 @@ const defaultButtonTheme = new ComponentTheme("button", "w-fit h-fit cursor-poin
|
|
|
3911
3870
|
shadow: new ShadowTheme(),
|
|
3912
3871
|
},
|
|
3913
3872
|
appearance: {
|
|
3914
|
-
background:
|
|
3915
|
-
text:
|
|
3916
|
-
border:
|
|
3917
|
-
ring:
|
|
3873
|
+
background: GenericVariantTheme.createBgAppearanceTheme(),
|
|
3874
|
+
text: GenericVariantTheme.createUIElementTextTheme(),
|
|
3875
|
+
border: GenericVariantTheme.createBorderAppearanceTheme(),
|
|
3876
|
+
ring: GenericVariantTheme.createRingAppearanceTheme(),
|
|
3918
3877
|
},
|
|
3919
3878
|
layout: {
|
|
3920
3879
|
border: new BorderTheme(),
|
|
@@ -3986,17 +3945,10 @@ const defaultBadgeTheme = new ComponentTheme("span", "w-fit h-fit transition-all
|
|
|
3986
3945
|
shadow: new ShadowTheme(),
|
|
3987
3946
|
},
|
|
3988
3947
|
appearance: {
|
|
3989
|
-
background:
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
filled: TextAppearanceTheme.createDefaultStyle({
|
|
3994
|
-
base: filledBackgroundAppearanceClasses,
|
|
3995
|
-
})
|
|
3996
|
-
}),
|
|
3997
|
-
text: VariantTheme.createDefaultText(),
|
|
3998
|
-
border: VariantTheme.createDefaultBorder(),
|
|
3999
|
-
ring: VariantTheme.createDefaultRing(),
|
|
3948
|
+
background: GenericVariantTheme.createSimpleBgAppearanceTheme(),
|
|
3949
|
+
text: GenericVariantTheme.createUIElementTextTheme(),
|
|
3950
|
+
border: GenericVariantTheme.createBorderAppearanceTheme(),
|
|
3951
|
+
ring: GenericVariantTheme.createRingAppearanceTheme(),
|
|
4000
3952
|
},
|
|
4001
3953
|
layout: {
|
|
4002
3954
|
border: new BorderTheme(),
|
|
@@ -4065,17 +4017,10 @@ const defaultChipTheme = new ComponentTheme("span", "w-fit h-fit transition-all
|
|
|
4065
4017
|
shadow: new ShadowTheme(),
|
|
4066
4018
|
},
|
|
4067
4019
|
appearance: {
|
|
4068
|
-
background:
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
filled: TextAppearanceTheme.createDefaultStyle({
|
|
4073
|
-
base: filledBackgroundAppearanceClasses,
|
|
4074
|
-
})
|
|
4075
|
-
}),
|
|
4076
|
-
text: VariantTheme.createDefaultText(),
|
|
4077
|
-
border: VariantTheme.createDefaultBorder(),
|
|
4078
|
-
ring: VariantTheme.createDefaultRing(),
|
|
4020
|
+
background: GenericVariantTheme.createSimpleBgAppearanceTheme(),
|
|
4021
|
+
text: GenericVariantTheme.createUIElementTextTheme(),
|
|
4022
|
+
border: GenericVariantTheme.createBorderAppearanceTheme(),
|
|
4023
|
+
ring: GenericVariantTheme.createRingAppearanceTheme(),
|
|
4079
4024
|
},
|
|
4080
4025
|
layout: {
|
|
4081
4026
|
radius: new RadiusTheme({
|
|
@@ -4117,7 +4062,7 @@ const createTypographyComponentTheme = (tag, base = "text-balance", textSizeMap
|
|
|
4117
4062
|
text: new SizeTheme(textSizeMap),
|
|
4118
4063
|
},
|
|
4119
4064
|
appearance: {
|
|
4120
|
-
text: TextAppearanceTheme.
|
|
4065
|
+
text: TextAppearanceTheme.createTheme({ base: textAppearanceClasses }),
|
|
4121
4066
|
}
|
|
4122
4067
|
}, defaults);
|
|
4123
4068
|
};
|
|
@@ -4211,57 +4156,26 @@ const commonGaps = {
|
|
|
4211
4156
|
xl: 'gap-6',
|
|
4212
4157
|
};
|
|
4213
4158
|
|
|
4214
|
-
class
|
|
4215
|
-
constructor(
|
|
4159
|
+
class BgAppearanceTheme extends BaseTheme {
|
|
4160
|
+
constructor() {
|
|
4216
4161
|
super();
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
...(overrideModesForKey || {}),
|
|
4162
|
+
BG_APPEARANCE_KEYS.forEach(key => {
|
|
4163
|
+
this[key] = {
|
|
4164
|
+
base: layoutBackgroundAppearanceClasses[key] || '',
|
|
4165
|
+
hover: '',
|
|
4166
|
+
active: '',
|
|
4223
4167
|
};
|
|
4224
4168
|
});
|
|
4225
4169
|
}
|
|
4226
4170
|
getClasses(props, defaults) {
|
|
4227
|
-
const pickedAppearanceKey = pickFirstTruthyKey(props, defaults,
|
|
4171
|
+
const pickedAppearanceKey = pickFirstTruthyKey(props, defaults, BG_APPEARANCE_KEYS) || 'default';
|
|
4228
4172
|
const modesForAppearance = this[pickedAppearanceKey];
|
|
4229
4173
|
if (!modesForAppearance) {
|
|
4230
4174
|
return MODE_KEYS.map(() => '');
|
|
4231
4175
|
}
|
|
4232
4176
|
return MODE_KEYS.map(mode => modesForAppearance[mode] || '');
|
|
4233
4177
|
}
|
|
4234
|
-
static createDefaultStyle(src = {}) {
|
|
4235
|
-
const initialOverridesForConstructor = {};
|
|
4236
|
-
APPEARANCE_KEYS.forEach((textKey) => {
|
|
4237
|
-
const modesForCurrentTextKey = {};
|
|
4238
|
-
let keyHasDataInSrc = false;
|
|
4239
|
-
MODE_KEYS.forEach((modeKey) => {
|
|
4240
|
-
var _a;
|
|
4241
|
-
const classValue = (_a = src[modeKey]) === null || _a === void 0 ? void 0 : _a[textKey];
|
|
4242
|
-
if (classValue !== undefined) {
|
|
4243
|
-
modesForCurrentTextKey[modeKey] = classValue;
|
|
4244
|
-
keyHasDataInSrc = true;
|
|
4245
|
-
}
|
|
4246
|
-
});
|
|
4247
|
-
if (keyHasDataInSrc) {
|
|
4248
|
-
initialOverridesForConstructor[textKey] = modesForCurrentTextKey;
|
|
4249
|
-
}
|
|
4250
|
-
});
|
|
4251
|
-
return new LayoutAppearanceTheme(initialOverridesForConstructor);
|
|
4252
|
-
}
|
|
4253
4178
|
}
|
|
4254
|
-
LayoutAppearanceTheme.defaultFullConfig = (() => {
|
|
4255
|
-
const config = {};
|
|
4256
|
-
APPEARANCE_KEYS.forEach((key) => {
|
|
4257
|
-
config[key] = {
|
|
4258
|
-
base: textAppearanceClasses[key] || '',
|
|
4259
|
-
hover: '',
|
|
4260
|
-
active: '',
|
|
4261
|
-
};
|
|
4262
|
-
});
|
|
4263
|
-
return config;
|
|
4264
|
-
})();
|
|
4265
4179
|
|
|
4266
4180
|
class BreakpointTheme extends BaseTheme {
|
|
4267
4181
|
constructor(initial) {
|
|
@@ -4326,12 +4240,10 @@ const defaultCardTheme = new ComponentTheme("div", "overflow-hidden", {
|
|
|
4326
4240
|
breakpoint: new BreakpointTheme(),
|
|
4327
4241
|
},
|
|
4328
4242
|
appearance: {
|
|
4329
|
-
background:
|
|
4330
|
-
|
|
4331
|
-
}),
|
|
4332
|
-
|
|
4333
|
-
border: TextAppearanceTheme.createDefaultStyle({ base: borderAppearanceClasses }),
|
|
4334
|
-
ring: TextAppearanceTheme.createDefaultStyle({ base: ringAppearanceClasses }),
|
|
4243
|
+
background: new BgAppearanceTheme(),
|
|
4244
|
+
text: TextAppearanceTheme.createTheme({ base: textAppearanceClasses }),
|
|
4245
|
+
border: TextAppearanceTheme.createTheme({ base: borderAppearanceClasses }),
|
|
4246
|
+
ring: TextAppearanceTheme.createTheme({ base: ringAppearanceClasses }),
|
|
4335
4247
|
}
|
|
4336
4248
|
}, {
|
|
4337
4249
|
md: true,
|
|
@@ -4363,7 +4275,7 @@ const defaultRowTheme = new ComponentTheme("div", "flex-row", {
|
|
|
4363
4275
|
|
|
4364
4276
|
const defaultDividerTheme = new ComponentTheme("div", "h-px w-full", {
|
|
4365
4277
|
appearance: {
|
|
4366
|
-
background: TextAppearanceTheme.
|
|
4278
|
+
background: TextAppearanceTheme.createTheme({
|
|
4367
4279
|
base: bgBorderAppearanceClasses,
|
|
4368
4280
|
}),
|
|
4369
4281
|
}
|
|
@@ -4407,12 +4319,10 @@ const defaultContainerTheme = new ComponentTheme("div", "flex-col mx-auto w-full
|
|
|
4407
4319
|
}),
|
|
4408
4320
|
},
|
|
4409
4321
|
appearance: {
|
|
4410
|
-
background:
|
|
4411
|
-
|
|
4412
|
-
}),
|
|
4413
|
-
|
|
4414
|
-
border: TextAppearanceTheme.createDefaultStyle({ base: borderAppearanceClasses }),
|
|
4415
|
-
ring: TextAppearanceTheme.createDefaultStyle({ base: ringAppearanceClasses }),
|
|
4322
|
+
background: new BgAppearanceTheme(),
|
|
4323
|
+
text: TextAppearanceTheme.createTheme({ base: textAppearanceClasses }),
|
|
4324
|
+
border: TextAppearanceTheme.createTheme({ base: borderAppearanceClasses }),
|
|
4325
|
+
ring: TextAppearanceTheme.createTheme({ base: ringAppearanceClasses }),
|
|
4416
4326
|
}
|
|
4417
4327
|
}, {
|
|
4418
4328
|
transparent: true,
|
|
@@ -4509,12 +4419,10 @@ const defaultSectionTheme = new ComponentTheme("div", "w-full flex-col", {
|
|
|
4509
4419
|
shadow: new ShadowTheme(),
|
|
4510
4420
|
},
|
|
4511
4421
|
appearance: {
|
|
4512
|
-
background:
|
|
4513
|
-
|
|
4514
|
-
}),
|
|
4515
|
-
|
|
4516
|
-
border: TextAppearanceTheme.createDefaultStyle({ base: borderAppearanceClasses }),
|
|
4517
|
-
ring: TextAppearanceTheme.createDefaultStyle({ base: ringAppearanceClasses }),
|
|
4422
|
+
background: new BgAppearanceTheme(),
|
|
4423
|
+
text: TextAppearanceTheme.createTheme({ base: textAppearanceClasses }),
|
|
4424
|
+
border: TextAppearanceTheme.createTheme({ base: borderAppearanceClasses }),
|
|
4425
|
+
ring: TextAppearanceTheme.createTheme({ base: ringAppearanceClasses }),
|
|
4518
4426
|
},
|
|
4519
4427
|
layout: {
|
|
4520
4428
|
wrap: new WrapTheme(),
|
|
@@ -4713,5 +4621,5 @@ const List = (props) => {
|
|
|
4713
4621
|
return jsx(ThemedComponent, { theme: theme.list, propsToOmit: TYPOGRAPHY_COMPONENT_KEYS, ...props });
|
|
4714
4622
|
};
|
|
4715
4623
|
|
|
4716
|
-
export {
|
|
4624
|
+
export { BADGE_KEYS, BASE_COMPONENT_KEYS, BG_APPEARANCE_KEYS, BORDER_KEYS, BREAKPOINT_KEYS, BUTTON_KEYS, Badge, Button, CARD_KEYS, CHIP_KEYS, COL_KEYS, COMPONENT_KEYS, CONTAINER_KEYS, Card, Chip, Col, Container, DIRECTION_REVERSE_KEYS, DISPLAY_KEYS, DIVIDER_KEYS, Divider, EXCLUSIVE_KEY_GROUPS, FLEX_DIRECTION_KEYS, FONT_FAMILY_KEYS, FONT_KEYS, FONT_STYLE_KEYS, FONT_WEIGHT_KEYS, GAP_KEYS, GRID_KEYS, Grid3, Grid4, HIDE_KEYS, ITEMS_KEYS, JUSTIFY_KEYS, Link, List, ListItem, MODE_KEYS, PADDING_KEYS, PILL_KEYS, POSITION_KEYS, PageTitle, RING_KEYS, ROUNDED_KEYS, ROW_KEYS, Row, SECTION_KEYS, SHADOW_KEYS, SHAPE_KEYS, SHARP_KEYS, SIZE_KEYS, STACK_KEYS, Section, SectionTitle, Stack, TEXT_ALIGN_KEYS, TEXT_APPEARANCE_KEYS, TEXT_DECORATION_KEYS, TEXT_TRANSFORM_KEYS, TYPOGRAPHY_COMPONENT_KEYS, Text, ThemeProvider, Title, VARIANT_KEYS, WRAP_KEYS, defaultTheme, useTheme };
|
|
4717
4625
|
//# sourceMappingURL=index.esm.js.map
|