@vaneui/ui 0.2.1-alpha.20250830124557.3818ff4 → 0.2.1-alpha.20250831120721.fd71f6f

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/index.js CHANGED
@@ -74,22 +74,22 @@ const BADGE_CATEGORIES = INTERACTIVE_CATEGORIES;
74
74
  const CHIP_CATEGORIES = INTERACTIVE_CATEGORIES;
75
75
  const CODE_CATEGORIES = INTERACTIVE_CATEGORIES;
76
76
  //typography:
77
- const TYPOGRAPHY_CATEGORIES = [...TYPOGRAPHY_FULL, ...LAYOUT_CORE, ...VISUAL_CORE];
78
- const LIST_CATEGORIES = [...TYPOGRAPHY_FULL, ...LIST_STYLE, ...LAYOUT_CORE, ...VISUAL_CORE, ...PADDING];
77
+ const TYPOGRAPHY_CATEGORIES = [...TYPOGRAPHY_FULL, ...LAYOUT_CORE, ...VISUAL_CORE, ...VARIANT];
78
+ const LIST_CATEGORIES = [...TYPOGRAPHY_FULL, ...LIST_STYLE, ...LAYOUT_CORE, ...VISUAL_CORE, ...PADDING, ...VARIANT];
79
79
  //layout:
80
- const GRID_CATEGORIES = [...LAYOUT_FULL, ...VISUAL_CORE];
81
- const CONTAINER_CATEGORIES = [...LAYOUT_FULL, ...VISUAL_FULL];
82
- const COL_CATEGORIES = [...LAYOUT_FULL, ...VISUAL_FULL];
83
- const ROW_CATEGORIES = [...LAYOUT_FULL, ...BREAKPOINT, ...VISUAL_FULL];
84
- const STACK_CATEGORIES = [...LAYOUT_FULL, ...BREAKPOINT, ...PADDING, ...VISUAL_FULL];
85
- const CARD_CATEGORIES = [...TYPOGRAPHY_FULL, ...LAYOUT_FULL, ...BREAKPOINT, ...VISUAL_FULL, ...PADDING];
80
+ const GRID_CATEGORIES = [...LAYOUT_FULL, ...VISUAL_CORE, ...VARIANT];
81
+ const CONTAINER_CATEGORIES = [...LAYOUT_FULL, ...VISUAL_FULL, ...VARIANT];
82
+ const COL_CATEGORIES = [...LAYOUT_FULL, ...VISUAL_FULL, ...VARIANT];
83
+ const ROW_CATEGORIES = [...LAYOUT_FULL, ...BREAKPOINT, ...VISUAL_FULL, ...VARIANT];
84
+ const STACK_CATEGORIES = [...LAYOUT_FULL, ...BREAKPOINT, ...PADDING, ...VISUAL_FULL, ...VARIANT];
85
+ const CARD_CATEGORIES = [...TYPOGRAPHY_FULL, ...LAYOUT_FULL, ...BREAKPOINT, ...VISUAL_FULL, ...PADDING, ...VARIANT];
86
86
  const DIVIDER_CATEGORIES = [...LAYOUT_CORE, ...VISUAL_CORE, ...PADDING];
87
- const SECTION_CATEGORIES = [...LAYOUT_FULL, ...VISUAL_FULL, ...PADDING, ...BREAKPOINT];
87
+ const SECTION_CATEGORIES = [...LAYOUT_FULL, ...VISUAL_FULL, ...PADDING, ...BREAKPOINT, ...VARIANT];
88
88
  // Form component categories
89
89
  const CHECKBOX_CATEGORIES = [...LAYOUT_CORE, ...VISUAL_CORE, ...VISUAL_DECORATION, ...SHAPE, ...VARIANT];
90
- const LABEL_CATEGORIES = [...TYPOGRAPHY_FULL, ...LAYOUT_FULL, ...VISUAL_CORE];
90
+ const LABEL_CATEGORIES = [...TYPOGRAPHY_FULL, ...LAYOUT_FULL, ...VISUAL_CORE, ...VARIANT];
91
91
  // Media component categories
92
- const IMG_CATEGORIES = [...LAYOUT_CORE, ...VISUAL_CORE, ...VISUAL_DECORATION, ...SHAPE];
92
+ const IMG_CATEGORIES = [...LAYOUT_CORE, ...VISUAL_CORE, ...VISUAL_DECORATION, ...SHAPE, ...VARIANT];
93
93
  const COMPONENT = ['button', 'badge', 'chip', 'code', 'card', 'divider', 'container', 'row', 'col', 'stack', 'section',
94
94
  'grid2', 'grid3', 'grid4', 'pageTitle', 'sectionTitle', 'title', 'text', 'link', 'list', 'listItem', 'checkbox', 'label', 'img'];
95
95
  const ComponentCategories = {
@@ -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 {
@@ -4401,7 +4412,7 @@ const createTypographyComponentTheme = (tag, base = "text-balance", textSizeMap
4401
4412
  text: new SizeTheme(textSizeMap),
4402
4413
  },
4403
4414
  appearance: {
4404
- text: AppearanceTheme.createTheme({ base: textAppearanceClasses }),
4415
+ text: GenericVariantTheme.createUIElementTextTheme(),
4405
4416
  },
4406
4417
  typography: defaultTypographyTheme,
4407
4418
  layout: defaultLayoutTheme,
@@ -4436,7 +4447,7 @@ const linkTheme = new ComponentTheme("a", "hover:underline w-fit cursor-pointer"
4436
4447
  text: new SizeTheme(textSizeClasses, false),
4437
4448
  },
4438
4449
  appearance: {
4439
- text: AppearanceTheme.createTheme({ base: textAppearanceClasses }),
4450
+ text: GenericVariantTheme.createUIElementTextTheme(),
4440
4451
  },
4441
4452
  typography: defaultTypographyTheme,
4442
4453
  layout: defaultLayoutTheme,
@@ -4447,7 +4458,7 @@ const listItemTheme = new ComponentTheme("li", "", {
4447
4458
  text: new SizeTheme(textSizeClasses, false),
4448
4459
  },
4449
4460
  appearance: {
4450
- text: AppearanceTheme.createTheme({ base: textAppearanceClasses }),
4461
+ text: GenericVariantTheme.createUIElementTextTheme(),
4451
4462
  },
4452
4463
  typography: defaultTypographyTheme,
4453
4464
  }, themeDefaults.listItem, TYPOGRAPHY_CATEGORIES);
@@ -4458,7 +4469,7 @@ const listTheme = new ComponentTheme("ul", "list-inside", {
4458
4469
  paddingLeft: new PlTheme(),
4459
4470
  },
4460
4471
  appearance: {
4461
- text: AppearanceTheme.createTheme({ base: textAppearanceClasses }),
4472
+ text: GenericVariantTheme.createUIElementTextTheme(),
4462
4473
  },
4463
4474
  typography: defaultTypographyTheme,
4464
4475
  layout: defaultLayoutTheme,
@@ -4524,10 +4535,10 @@ const defaultCardTheme = new ComponentTheme("div", "", {
4524
4535
  shadow: ShadowAppearanceTheme.createLayoutTheme(),
4525
4536
  },
4526
4537
  appearance: {
4527
- background: AppearanceTheme.createLayoutBgTheme(),
4528
- text: AppearanceTheme.createTheme({ base: textAppearanceClasses }),
4529
- border: AppearanceTheme.createTheme({ base: borderAppearanceClasses }),
4530
- ring: AppearanceTheme.createTheme({ base: ringAppearanceClasses }),
4538
+ background: GenericVariantTheme.createLayoutBgAppearanceTheme(),
4539
+ text: GenericVariantTheme.createUIElementTextTheme(),
4540
+ border: GenericVariantTheme.createUIElementBorderTheme(),
4541
+ ring: GenericVariantTheme.createUIElementRingTheme(),
4531
4542
  },
4532
4543
  typography: defaultTypographyTheme,
4533
4544
  }, themeDefaults.card, CARD_CATEGORIES, (props, defaults) => {
@@ -4548,8 +4559,8 @@ const defaultRowTheme = new ComponentTheme("div", "", {
4548
4559
  radius: RadiusTheme.createLayoutTheme(),
4549
4560
  },
4550
4561
  appearance: {
4551
- background: AppearanceTheme.createLayoutBgTheme(),
4552
- text: AppearanceTheme.createTheme({ base: textAppearanceClasses }),
4562
+ background: GenericVariantTheme.createLayoutBgAppearanceTheme(),
4563
+ text: GenericVariantTheme.createUIElementTextTheme(),
4553
4564
  border: GenericVariantTheme.createUIElementBorderTheme(),
4554
4565
  ring: GenericVariantTheme.createUIElementRingTheme(),
4555
4566
  shadow: GenericVariantTheme.createLayoutShadowTheme(),
@@ -4591,10 +4602,10 @@ const defaultContainerTheme = new ComponentTheme("div", "flex-col mx-auto w-full
4591
4602
  radius: RadiusTheme.createLayoutTheme(),
4592
4603
  },
4593
4604
  appearance: {
4594
- background: AppearanceTheme.createLayoutBgTheme(),
4595
- text: AppearanceTheme.createTheme({ base: textAppearanceClasses }),
4596
- border: AppearanceTheme.createTheme({ base: borderAppearanceClasses }),
4597
- ring: AppearanceTheme.createTheme({ base: ringAppearanceClasses }),
4605
+ background: GenericVariantTheme.createLayoutBgAppearanceTheme(),
4606
+ text: GenericVariantTheme.createUIElementTextTheme(),
4607
+ border: GenericVariantTheme.createUIElementBorderTheme(),
4608
+ ring: GenericVariantTheme.createUIElementRingTheme(),
4598
4609
  shadow: GenericVariantTheme.createLayoutShadowTheme(),
4599
4610
  }
4600
4611
  }, themeDefaults.container, CONTAINER_CATEGORIES, (props, defaults) => {
@@ -4614,8 +4625,8 @@ const defaultColTheme = new ComponentTheme("div", "", {
4614
4625
  radius: RadiusTheme.createLayoutTheme(),
4615
4626
  },
4616
4627
  appearance: {
4617
- background: AppearanceTheme.createLayoutBgTheme(),
4618
- text: AppearanceTheme.createTheme({ base: textAppearanceClasses }),
4628
+ background: GenericVariantTheme.createLayoutBgAppearanceTheme(),
4629
+ text: GenericVariantTheme.createUIElementTextTheme(),
4619
4630
  border: GenericVariantTheme.createUIElementBorderTheme(),
4620
4631
  ring: GenericVariantTheme.createUIElementRingTheme(),
4621
4632
  shadow: GenericVariantTheme.createLayoutShadowTheme(),
@@ -4640,8 +4651,8 @@ const defaultStackTheme = new ComponentTheme("div", "", {
4640
4651
  radius: RadiusTheme.createLayoutTheme(),
4641
4652
  },
4642
4653
  appearance: {
4643
- background: AppearanceTheme.createLayoutBgTheme(),
4644
- text: AppearanceTheme.createTheme({ base: textAppearanceClasses }),
4654
+ background: GenericVariantTheme.createLayoutBgAppearanceTheme(),
4655
+ text: GenericVariantTheme.createUIElementTextTheme(),
4645
4656
  border: GenericVariantTheme.createUIElementBorderTheme(),
4646
4657
  ring: GenericVariantTheme.createUIElementRingTheme(),
4647
4658
  shadow: GenericVariantTheme.createLayoutShadowTheme(),
@@ -4670,10 +4681,10 @@ const defaultSectionTheme = new ComponentTheme("div", "w-full flex-col", {
4670
4681
  breakpoint: new BreakpointTheme(),
4671
4682
  },
4672
4683
  appearance: {
4673
- background: AppearanceTheme.createLayoutBgTheme(),
4674
- text: AppearanceTheme.createTheme({ base: textAppearanceClasses }),
4675
- border: AppearanceTheme.createTheme({ base: borderAppearanceClasses }),
4676
- ring: AppearanceTheme.createTheme({ base: ringAppearanceClasses }),
4684
+ background: GenericVariantTheme.createLayoutBgAppearanceTheme(),
4685
+ text: GenericVariantTheme.createUIElementTextTheme(),
4686
+ border: GenericVariantTheme.createUIElementBorderTheme(),
4687
+ ring: GenericVariantTheme.createUIElementRingTheme(),
4677
4688
  shadow: ShadowAppearanceTheme.createLayoutTheme(),
4678
4689
  },
4679
4690
  layout: {
@@ -4699,8 +4710,8 @@ const gridSubThemes = {
4699
4710
  }),
4700
4711
  },
4701
4712
  appearance: {
4702
- background: AppearanceTheme.createLayoutBgTheme(),
4703
- text: AppearanceTheme.createTheme({ base: textAppearanceClasses }),
4713
+ background: GenericVariantTheme.createLayoutBgAppearanceTheme(),
4714
+ text: GenericVariantTheme.createUIElementTextTheme(),
4704
4715
  },
4705
4716
  layout: {
4706
4717
  ...defaultLayoutTheme,
@@ -4780,7 +4791,7 @@ const defaultLabelTheme = new ComponentTheme("label", "has-[input]:cursor-pointe
4780
4791
  gap: new GapTheme({ xs: 'gap-1.5', sm: 'gap-2', md: 'gap-2.5', lg: 'gap-3', xl: 'gap-3' }),
4781
4792
  },
4782
4793
  appearance: {
4783
- text: AppearanceTheme.createTheme({ base: textAppearanceClasses }),
4794
+ text: GenericVariantTheme.createUIElementTextTheme(),
4784
4795
  },
4785
4796
  typography: defaultTypographyTheme,
4786
4797
  layout: {