@vaneui/ui 0.2.1-alpha.20250830140007.8b4cce3 → 0.2.1-alpha.20250901145552.64cbaea
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 +1 -0
- package/dist/components/ui/theme/appearance/appearanceTheme.d.ts +0 -1
- package/dist/components/ui/theme/appearance/genericVariantTheme.d.ts +1 -0
- package/dist/index.esm.js +102 -91
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +102 -91
- package/dist/index.js.map +1 -1
- package/dist/ui.css +87 -3
- package/dist/vars.css +32 -6
- package/package.json +2 -3
package/dist/index.js
CHANGED
|
@@ -3422,6 +3422,78 @@ class PyTheme extends PaddingTheme {
|
|
|
3422
3422
|
}
|
|
3423
3423
|
}
|
|
3424
3424
|
|
|
3425
|
+
class AppearanceTheme extends BaseTheme {
|
|
3426
|
+
constructor(config, transparentClasses) {
|
|
3427
|
+
super();
|
|
3428
|
+
Object.assign(this, config);
|
|
3429
|
+
this.transparentClasses = transparentClasses;
|
|
3430
|
+
}
|
|
3431
|
+
getClasses(extractedKeys) {
|
|
3432
|
+
var _a;
|
|
3433
|
+
// Check for specific transparent styles first
|
|
3434
|
+
if (extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.transparent) {
|
|
3435
|
+
const transparentClass = ((_a = this.transparentClasses) === null || _a === void 0 ? void 0 : _a[extractedKeys.transparent]) || '';
|
|
3436
|
+
return [transparentClass];
|
|
3437
|
+
}
|
|
3438
|
+
// Use appearance (now includes link as an appearance option)
|
|
3439
|
+
const pickedAppearanceKey = extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.appearance;
|
|
3440
|
+
if (pickedAppearanceKey) {
|
|
3441
|
+
const modes = this[pickedAppearanceKey];
|
|
3442
|
+
if (modes) {
|
|
3443
|
+
return ComponentKeys.mode.map(mode => modes[mode] || '');
|
|
3444
|
+
}
|
|
3445
|
+
}
|
|
3446
|
+
return [];
|
|
3447
|
+
}
|
|
3448
|
+
static createTheme(src = {}) {
|
|
3449
|
+
const config = Object.fromEntries(ComponentKeys.appearance.map(textKey => [
|
|
3450
|
+
textKey,
|
|
3451
|
+
Object.fromEntries(ComponentKeys.mode.map(modeKey => {
|
|
3452
|
+
var _a;
|
|
3453
|
+
return [
|
|
3454
|
+
modeKey,
|
|
3455
|
+
((_a = src[modeKey]) === null || _a === void 0 ? void 0 : _a[textKey]) || ''
|
|
3456
|
+
];
|
|
3457
|
+
})),
|
|
3458
|
+
]));
|
|
3459
|
+
return new AppearanceTheme(config, src.base);
|
|
3460
|
+
}
|
|
3461
|
+
}
|
|
3462
|
+
|
|
3463
|
+
const filledTextAppearanceClasses = {
|
|
3464
|
+
default: "text-(--filled-text-color-default)",
|
|
3465
|
+
primary: "text-(--filled-text-color-primary)",
|
|
3466
|
+
secondary: "text-(--filled-text-color-secondary)",
|
|
3467
|
+
tertiary: "text-(--filled-text-color-tertiary)",
|
|
3468
|
+
link: "text-(--filled-text-color-link)",
|
|
3469
|
+
accent: "text-(--filled-text-color-accent)",
|
|
3470
|
+
success: "text-(--filled-text-color-success)",
|
|
3471
|
+
danger: "text-(--filled-text-color-danger)",
|
|
3472
|
+
warning: "text-(--filled-text-color-warning)",
|
|
3473
|
+
info: "text-(--filled-text-color-info)",
|
|
3474
|
+
transparent: "text-(--filled-text-color-transparent)",
|
|
3475
|
+
};
|
|
3476
|
+
const textAppearanceClasses = {
|
|
3477
|
+
default: "text-(--text-color-default)",
|
|
3478
|
+
primary: "text-(--text-color-primary)",
|
|
3479
|
+
secondary: "text-(--text-color-secondary)",
|
|
3480
|
+
tertiary: "text-(--text-color-tertiary)",
|
|
3481
|
+
link: "text-(--text-color-link)",
|
|
3482
|
+
accent: "text-(--text-color-accent)",
|
|
3483
|
+
success: "text-(--text-color-success)",
|
|
3484
|
+
danger: "text-(--text-color-danger)",
|
|
3485
|
+
warning: "text-(--text-color-warning)",
|
|
3486
|
+
info: "text-(--text-color-info)",
|
|
3487
|
+
transparent: "text-transparent",
|
|
3488
|
+
};
|
|
3489
|
+
const textSizeClasses = {
|
|
3490
|
+
xs: "text-xs",
|
|
3491
|
+
sm: "text-sm",
|
|
3492
|
+
md: "text-base",
|
|
3493
|
+
lg: "text-lg",
|
|
3494
|
+
xl: "text-xl",
|
|
3495
|
+
};
|
|
3496
|
+
|
|
3425
3497
|
const filledBackgroundAppearanceClasses = {
|
|
3426
3498
|
default: "bg-(--filled-background-color-default)",
|
|
3427
3499
|
primary: "bg-(--filled-background-color-primary)",
|
|
@@ -3513,6 +3585,19 @@ const layoutBackgroundAppearanceClasses = {
|
|
|
3513
3585
|
transparent: "bg-transparent",
|
|
3514
3586
|
link: "bg-(--layout-background-link)",
|
|
3515
3587
|
};
|
|
3588
|
+
const layoutFilledBackgroundAppearanceClasses = {
|
|
3589
|
+
default: "bg-(--layout-filled-background-color-default)",
|
|
3590
|
+
primary: "bg-(--layout-filled-background-color-primary)",
|
|
3591
|
+
secondary: "bg-(--layout-filled-background-color-secondary)",
|
|
3592
|
+
tertiary: "bg-(--layout-filled-background-color-tertiary)",
|
|
3593
|
+
accent: "bg-(--layout-filled-background-color-accent)",
|
|
3594
|
+
success: "bg-(--layout-filled-background-color-success)",
|
|
3595
|
+
danger: "bg-(--layout-filled-background-color-danger)",
|
|
3596
|
+
warning: "bg-(--layout-filled-background-color-warning)",
|
|
3597
|
+
info: "bg-(--layout-filled-background-color-info)",
|
|
3598
|
+
transparent: "bg-transparent",
|
|
3599
|
+
link: "bg-(--layout-filled-background-color-link)",
|
|
3600
|
+
};
|
|
3516
3601
|
const bgBorderAppearanceClasses = {
|
|
3517
3602
|
default: "bg-(--border-color-default)",
|
|
3518
3603
|
primary: "bg-(--border-color-primary)",
|
|
@@ -3631,90 +3716,6 @@ const filledCheckedBackgroundAppearanceClasses = {
|
|
|
3631
3716
|
link: "checked:bg-(--filled-background-color-link)",
|
|
3632
3717
|
};
|
|
3633
3718
|
|
|
3634
|
-
class AppearanceTheme extends BaseTheme {
|
|
3635
|
-
constructor(config, transparentClasses) {
|
|
3636
|
-
super();
|
|
3637
|
-
Object.assign(this, config);
|
|
3638
|
-
this.transparentClasses = transparentClasses;
|
|
3639
|
-
}
|
|
3640
|
-
getClasses(extractedKeys) {
|
|
3641
|
-
var _a;
|
|
3642
|
-
// Check for specific transparent styles first
|
|
3643
|
-
if (extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.transparent) {
|
|
3644
|
-
const transparentClass = ((_a = this.transparentClasses) === null || _a === void 0 ? void 0 : _a[extractedKeys.transparent]) || '';
|
|
3645
|
-
return [transparentClass];
|
|
3646
|
-
}
|
|
3647
|
-
// Use appearance (now includes link as an appearance option)
|
|
3648
|
-
const pickedAppearanceKey = extractedKeys === null || extractedKeys === void 0 ? void 0 : extractedKeys.appearance;
|
|
3649
|
-
if (pickedAppearanceKey) {
|
|
3650
|
-
const modes = this[pickedAppearanceKey];
|
|
3651
|
-
if (modes) {
|
|
3652
|
-
return ComponentKeys.mode.map(mode => modes[mode] || '');
|
|
3653
|
-
}
|
|
3654
|
-
}
|
|
3655
|
-
return [];
|
|
3656
|
-
}
|
|
3657
|
-
static createTheme(src = {}) {
|
|
3658
|
-
const config = Object.fromEntries(ComponentKeys.appearance.map(textKey => [
|
|
3659
|
-
textKey,
|
|
3660
|
-
Object.fromEntries(ComponentKeys.mode.map(modeKey => {
|
|
3661
|
-
var _a;
|
|
3662
|
-
return [
|
|
3663
|
-
modeKey,
|
|
3664
|
-
((_a = src[modeKey]) === null || _a === void 0 ? void 0 : _a[textKey]) || ''
|
|
3665
|
-
];
|
|
3666
|
-
})),
|
|
3667
|
-
]));
|
|
3668
|
-
return new AppearanceTheme(config, src.base);
|
|
3669
|
-
}
|
|
3670
|
-
static createLayoutBgTheme() {
|
|
3671
|
-
// Creates a theme for layout backgrounds, replacing BgAppearanceTheme
|
|
3672
|
-
const config = Object.fromEntries(ComponentKeys.appearance.map(key => [
|
|
3673
|
-
key,
|
|
3674
|
-
{
|
|
3675
|
-
base: layoutBackgroundAppearanceClasses[key] || '',
|
|
3676
|
-
hover: '',
|
|
3677
|
-
active: '',
|
|
3678
|
-
}
|
|
3679
|
-
]));
|
|
3680
|
-
return new AppearanceTheme(config, layoutBackgroundAppearanceClasses);
|
|
3681
|
-
}
|
|
3682
|
-
}
|
|
3683
|
-
|
|
3684
|
-
const filledTextAppearanceClasses = {
|
|
3685
|
-
default: "text-white",
|
|
3686
|
-
primary: "text-white",
|
|
3687
|
-
secondary: "text-white",
|
|
3688
|
-
tertiary: "text-white",
|
|
3689
|
-
link: "text-white",
|
|
3690
|
-
accent: "text-white",
|
|
3691
|
-
success: "text-white",
|
|
3692
|
-
danger: "text-white",
|
|
3693
|
-
warning: "text-white",
|
|
3694
|
-
info: "text-white",
|
|
3695
|
-
transparent: "text-transparent",
|
|
3696
|
-
};
|
|
3697
|
-
const textAppearanceClasses = {
|
|
3698
|
-
default: "text-(--text-color-default)",
|
|
3699
|
-
primary: "text-(--text-color-primary)",
|
|
3700
|
-
secondary: "text-(--text-color-secondary)",
|
|
3701
|
-
tertiary: "text-(--text-color-tertiary)",
|
|
3702
|
-
link: "text-(--text-color-link)",
|
|
3703
|
-
accent: "text-(--text-color-accent)",
|
|
3704
|
-
success: "text-(--text-color-success)",
|
|
3705
|
-
danger: "text-(--text-color-danger)",
|
|
3706
|
-
warning: "text-(--text-color-warning)",
|
|
3707
|
-
info: "text-(--text-color-info)",
|
|
3708
|
-
transparent: "text-transparent",
|
|
3709
|
-
};
|
|
3710
|
-
const textSizeClasses = {
|
|
3711
|
-
xs: "text-xs",
|
|
3712
|
-
sm: "text-sm",
|
|
3713
|
-
md: "text-base",
|
|
3714
|
-
lg: "text-lg",
|
|
3715
|
-
xl: "text-xl",
|
|
3716
|
-
};
|
|
3717
|
-
|
|
3718
3719
|
class ShadowAppearanceTheme extends BaseTheme {
|
|
3719
3720
|
constructor(initial) {
|
|
3720
3721
|
super();
|
|
@@ -3904,6 +3905,16 @@ class GenericVariantTheme extends BaseTheme {
|
|
|
3904
3905
|
})
|
|
3905
3906
|
});
|
|
3906
3907
|
}
|
|
3908
|
+
static createLayoutBgAppearanceTheme() {
|
|
3909
|
+
return new GenericVariantTheme({
|
|
3910
|
+
outline: AppearanceTheme.createTheme({
|
|
3911
|
+
base: layoutBackgroundAppearanceClasses
|
|
3912
|
+
}),
|
|
3913
|
+
filled: AppearanceTheme.createTheme({
|
|
3914
|
+
base: layoutFilledBackgroundAppearanceClasses
|
|
3915
|
+
})
|
|
3916
|
+
});
|
|
3917
|
+
}
|
|
3907
3918
|
}
|
|
3908
3919
|
|
|
3909
3920
|
class WrapTheme extends BaseTheme {
|
|
@@ -4524,7 +4535,7 @@ const defaultCardTheme = new ComponentTheme("div", "", {
|
|
|
4524
4535
|
shadow: ShadowAppearanceTheme.createLayoutTheme(),
|
|
4525
4536
|
},
|
|
4526
4537
|
appearance: {
|
|
4527
|
-
background: GenericVariantTheme.
|
|
4538
|
+
background: GenericVariantTheme.createLayoutBgAppearanceTheme(),
|
|
4528
4539
|
text: GenericVariantTheme.createUIElementTextTheme(),
|
|
4529
4540
|
border: GenericVariantTheme.createUIElementBorderTheme(),
|
|
4530
4541
|
ring: GenericVariantTheme.createUIElementRingTheme(),
|
|
@@ -4548,7 +4559,7 @@ const defaultRowTheme = new ComponentTheme("div", "", {
|
|
|
4548
4559
|
radius: RadiusTheme.createLayoutTheme(),
|
|
4549
4560
|
},
|
|
4550
4561
|
appearance: {
|
|
4551
|
-
background: GenericVariantTheme.
|
|
4562
|
+
background: GenericVariantTheme.createLayoutBgAppearanceTheme(),
|
|
4552
4563
|
text: GenericVariantTheme.createUIElementTextTheme(),
|
|
4553
4564
|
border: GenericVariantTheme.createUIElementBorderTheme(),
|
|
4554
4565
|
ring: GenericVariantTheme.createUIElementRingTheme(),
|
|
@@ -4591,7 +4602,7 @@ const defaultContainerTheme = new ComponentTheme("div", "flex-col mx-auto w-full
|
|
|
4591
4602
|
radius: RadiusTheme.createLayoutTheme(),
|
|
4592
4603
|
},
|
|
4593
4604
|
appearance: {
|
|
4594
|
-
background: GenericVariantTheme.
|
|
4605
|
+
background: GenericVariantTheme.createLayoutBgAppearanceTheme(),
|
|
4595
4606
|
text: GenericVariantTheme.createUIElementTextTheme(),
|
|
4596
4607
|
border: GenericVariantTheme.createUIElementBorderTheme(),
|
|
4597
4608
|
ring: GenericVariantTheme.createUIElementRingTheme(),
|
|
@@ -4614,7 +4625,7 @@ const defaultColTheme = new ComponentTheme("div", "", {
|
|
|
4614
4625
|
radius: RadiusTheme.createLayoutTheme(),
|
|
4615
4626
|
},
|
|
4616
4627
|
appearance: {
|
|
4617
|
-
background: GenericVariantTheme.
|
|
4628
|
+
background: GenericVariantTheme.createLayoutBgAppearanceTheme(),
|
|
4618
4629
|
text: GenericVariantTheme.createUIElementTextTheme(),
|
|
4619
4630
|
border: GenericVariantTheme.createUIElementBorderTheme(),
|
|
4620
4631
|
ring: GenericVariantTheme.createUIElementRingTheme(),
|
|
@@ -4640,7 +4651,7 @@ const defaultStackTheme = new ComponentTheme("div", "", {
|
|
|
4640
4651
|
radius: RadiusTheme.createLayoutTheme(),
|
|
4641
4652
|
},
|
|
4642
4653
|
appearance: {
|
|
4643
|
-
background: GenericVariantTheme.
|
|
4654
|
+
background: GenericVariantTheme.createLayoutBgAppearanceTheme(),
|
|
4644
4655
|
text: GenericVariantTheme.createUIElementTextTheme(),
|
|
4645
4656
|
border: GenericVariantTheme.createUIElementBorderTheme(),
|
|
4646
4657
|
ring: GenericVariantTheme.createUIElementRingTheme(),
|
|
@@ -4670,7 +4681,7 @@ const defaultSectionTheme = new ComponentTheme("div", "w-full flex-col", {
|
|
|
4670
4681
|
breakpoint: new BreakpointTheme(),
|
|
4671
4682
|
},
|
|
4672
4683
|
appearance: {
|
|
4673
|
-
background: GenericVariantTheme.
|
|
4684
|
+
background: GenericVariantTheme.createLayoutBgAppearanceTheme(),
|
|
4674
4685
|
text: GenericVariantTheme.createUIElementTextTheme(),
|
|
4675
4686
|
border: GenericVariantTheme.createUIElementBorderTheme(),
|
|
4676
4687
|
ring: GenericVariantTheme.createUIElementRingTheme(),
|
|
@@ -4699,7 +4710,7 @@ const gridSubThemes = {
|
|
|
4699
4710
|
}),
|
|
4700
4711
|
},
|
|
4701
4712
|
appearance: {
|
|
4702
|
-
background: GenericVariantTheme.
|
|
4713
|
+
background: GenericVariantTheme.createLayoutBgAppearanceTheme(),
|
|
4703
4714
|
text: GenericVariantTheme.createUIElementTextTheme(),
|
|
4704
4715
|
},
|
|
4705
4716
|
layout: {
|