@vertz/theme-shadcn 0.2.38 → 0.2.41

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/base.d.ts CHANGED
@@ -17,12 +17,11 @@ interface ThemeConfig {
17
17
  radius?: "sm" | "md" | "lg";
18
18
  /** Visual style preset. Default: 'nova'. */
19
19
  style?: ThemeStyle;
20
- /** Token overrides — deep-merged into the selected palette. */
21
- overrides?: {
22
- tokens?: {
23
- colors?: Record<string, Record<string, string> | undefined>;
24
- };
25
- };
20
+ /**
21
+ * Color token overrides — deep-merged into the selected palette.
22
+ * @example colors: { primary: { DEFAULT: 'oklch(0.55 0.2 260)', _dark: 'oklch(0.65 0.25 260)' } }
23
+ */
24
+ colors?: Record<string, Record<string, string> | undefined>;
26
25
  }
27
26
  /** Return type of configureThemeBase(). */
28
27
  interface ResolvedThemeBase {
package/dist/base.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  RADIUS_VALUES,
3
3
  configureThemeBase
4
- } from "./shared/chunk-f0wk9320.js";
4
+ } from "./shared/chunk-58ghrcqw.js";
5
5
  export {
6
6
  configureThemeBase,
7
7
  RADIUS_VALUES
package/dist/index.d.ts CHANGED
@@ -20,12 +20,11 @@ interface ThemeConfig {
20
20
  radius?: "sm" | "md" | "lg";
21
21
  /** Visual style preset. Default: 'nova'. */
22
22
  style?: ThemeStyle;
23
- /** Token overrides — deep-merged into the selected palette. */
24
- overrides?: {
25
- tokens?: {
26
- colors?: Record<string, Record<string, string> | undefined>;
27
- };
28
- };
23
+ /**
24
+ * Color token overrides — deep-merged into the selected palette.
25
+ * @example colors: { primary: { DEFAULT: 'oklch(0.55 0.2 260)', _dark: 'oklch(0.65 0.25 260)' } }
26
+ */
27
+ colors?: Record<string, Record<string, string> | undefined>;
29
28
  }
30
29
  /** Return type of configureThemeBase(). */
31
30
  interface ResolvedThemeBase {
@@ -1212,7 +1211,7 @@ interface ResolvedTheme extends ResolvedThemeBase {
1212
1211
  /**
1213
1212
  * Configure the shadcn theme.
1214
1213
  *
1215
- * Single entry point — selects palette, applies overrides, builds globals, styles, and components.
1214
+ * Single entry point — selects palette, applies color overrides, builds globals, styles, and components.
1216
1215
  *
1217
1216
  * For a lightweight alternative that only returns `{ theme, globals }` without
1218
1217
  * component styles, use `configureThemeBase()` from `@vertz/theme-shadcn/base`.
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  RADIUS_VALUES,
11
11
  configureThemeBase,
12
12
  palettes
13
- } from "./shared/chunk-f0wk9320.js";
13
+ } from "./shared/chunk-58ghrcqw.js";
14
14
  // src/configure.ts
15
15
  import { injectCSS as injectCSS2 } from "@vertz/ui";
16
16
  import {
@@ -3864,11 +3864,11 @@ function configureTheme(config) {
3864
3864
  function defineLazyStyle(key, factory) {
3865
3865
  Object.defineProperty(styles, key, {
3866
3866
  get() {
3867
- const result2 = getOrInit(key, factory);
3868
- const cssText = result2.css;
3867
+ const result = getOrInit(key, factory);
3868
+ const cssText = result.css;
3869
3869
  if (cssText)
3870
3870
  injectCSS2(cssText);
3871
- return result2;
3871
+ return result;
3872
3872
  },
3873
3873
  enumerable: true,
3874
3874
  configurable: true
@@ -3919,56 +3919,21 @@ function configureTheme(config) {
3919
3919
  defineLazyStyle("scrollArea", createScrollAreaStyles);
3920
3920
  defineLazyStyle("toggle", createToggleStyles);
3921
3921
  defineLazyStyle("toggleGroup", createToggleGroupStyles);
3922
- let cachedComponents;
3923
- function buildComponents() {
3924
- const alertS = getOrInit("alert", createAlertStyles);
3925
- const buttonS = getOrInit("button", createButton);
3926
- const badgeS = getOrInit("badge", createBadge);
3927
- const cardS = getOrInit("card", createCard);
3928
- const inputS = getOrInit("input", createInput);
3929
- const textareaS = getOrInit("textarea", createTextarea);
3930
- const labelS = getOrInit("label", createLabel);
3931
- const separatorS = getOrInit("separator", createSeparator);
3932
- const formGroupS = getOrInit("formGroup", createFormGroup);
3933
- const breadcrumbS = getOrInit("breadcrumb", createBreadcrumbStyles);
3934
- const paginationS = getOrInit("pagination", createPaginationStyles);
3935
- const avatarS = getOrInit("avatar", createAvatarStyles);
3936
- const emptyStateS = getOrInit("emptyState", createEmptyStateStyles);
3937
- const skeletonS = getOrInit("skeleton", createSkeletonStyles);
3938
- const tableS = getOrInit("table", createTableStyles);
3939
- const dropdownMenuS = getOrInit("dropdownMenu", createDropdownMenuStyles);
3940
- const selectS = getOrInit("select", createSelectStyles);
3941
- const tabsS = getOrInit("tabs", createTabsStyles);
3942
- const checkboxS = getOrInit("checkbox", createCheckboxStyles);
3943
- const switchS = getOrInit("switch", createSwitchStyles);
3944
- const popoverS = getOrInit("popover", createPopoverStyles);
3945
- const progressS = getOrInit("progress", createProgressStyles);
3946
- const radioGroupS = getOrInit("radioGroup", createRadioGroupStyles);
3947
- const sliderS = getOrInit("slider", createSliderStyles);
3948
- const accordionS = getOrInit("accordion", createAccordionStyles);
3949
- const toastS = getOrInit("toast", createToastStyles);
3950
- const tooltipS = getOrInit("tooltip", createTooltipStyles);
3951
- const sheetS = getOrInit("sheet", createSheetStyles);
3952
- const calendarS = getOrInit("calendar", createCalendarStyles);
3953
- const carouselS = getOrInit("carousel", createCarouselStyles);
3954
- const collapsibleS = getOrInit("collapsible", createCollapsibleStyles);
3955
- const commandS = getOrInit("command", createCommandStyles);
3956
- const contextMenuS = getOrInit("contextMenu", createContextMenuStyles);
3957
- const datePickerS = getOrInit("datePicker", createDatePickerStyles);
3958
- const drawerS = getOrInit("drawer", createDrawerStyles);
3959
- const hoverCardS = getOrInit("hoverCard", createHoverCardStyles);
3960
- const listS = getOrInit("list", createListStyles);
3961
- const menubarS = getOrInit("menubar", createMenubarStyles);
3962
- const navigationMenuS = getOrInit("navigationMenu", createNavigationMenuStyles);
3963
- const resizablePanelS = getOrInit("resizablePanel", createResizablePanelStyles);
3964
- const scrollAreaS = getOrInit("scrollArea", createScrollAreaStyles);
3965
- const toggleS = getOrInit("toggle", createToggleStyles);
3966
- const toggleGroupS = getOrInit("toggleGroup", createToggleGroupStyles);
3967
- const badgeColorInlineStyles = {
3968
- blue: { backgroundColor: "oklch(0.55 0.15 250)", color: "#fff" },
3969
- green: { backgroundColor: "oklch(0.55 0.15 155)", color: "#fff" },
3970
- yellow: { backgroundColor: "oklch(0.75 0.15 85)", color: "oklch(0.25 0.05 85)" }
3971
- };
3922
+ const components = {};
3923
+ function lazyComp(key, factory) {
3924
+ let cached;
3925
+ Object.defineProperty(components, key, {
3926
+ get() {
3927
+ if (cached === undefined)
3928
+ cached = factory();
3929
+ return cached;
3930
+ },
3931
+ enumerable: true,
3932
+ configurable: true
3933
+ });
3934
+ }
3935
+ lazyComp("Alert", () => {
3936
+ const alertS = styles.alert;
3972
3937
  const DefaultAlert = withStyles19(ComposedAlert, {
3973
3938
  root: alertS.root,
3974
3939
  title: alertS.title,
@@ -3982,137 +3947,168 @@ function configureTheme(config) {
3982
3947
  function ThemedAlert({ variant, ...rest }) {
3983
3948
  return (variant === "destructive" ? DestructiveAlert : DefaultAlert)(rest);
3984
3949
  }
3985
- const Alert = Object.assign(ThemedAlert, {
3950
+ return Object.assign(ThemedAlert, {
3986
3951
  Title: ComposedAlert.Title,
3987
3952
  Description: ComposedAlert.Description
3988
3953
  });
3989
- return {
3990
- Alert,
3991
- Button: ({ intent, size, ...rest }) => ComposedButton({ ...rest, classes: { base: buttonS({ intent, size }) } }),
3992
- Badge: ({ color, ...rest }) => {
3993
- const style = color ? badgeColorInlineStyles[color] : undefined;
3994
- return ComposedBadge({ ...rest, classes: { base: badgeS({ color }) }, style });
3995
- },
3996
- Breadcrumb: withStyles19(ComposedBreadcrumb, {
3997
- nav: breadcrumbS.nav,
3998
- list: breadcrumbS.list,
3999
- item: breadcrumbS.item,
4000
- link: breadcrumbS.link,
4001
- page: breadcrumbS.page,
4002
- separator: breadcrumbS.separator
4003
- }),
4004
- Card: withStyles19(ComposedCard, {
4005
- root: cardS.root,
4006
- header: cardS.header,
4007
- title: cardS.title,
4008
- description: cardS.description,
4009
- content: cardS.content,
4010
- footer: cardS.footer,
4011
- action: cardS.action
4012
- }),
4013
- Input: withStyles19(ComposedInput, { base: inputS.base }),
4014
- Textarea: withStyles19(ComposedTextarea, { base: textareaS.base }),
4015
- Label: withStyles19(ComposedLabel, { base: labelS.base }),
4016
- Pagination: (props) => ComposedPagination({
4017
- ...props,
4018
- classes: {
4019
- nav: paginationS.nav,
4020
- list: paginationS.list,
4021
- item: paginationS.item,
4022
- link: paginationS.link,
4023
- linkActive: paginationS.linkActive,
4024
- navButton: paginationS.navButton,
4025
- ellipsis: paginationS.ellipsis
4026
- }
4027
- }),
4028
- Separator: withStyles19(ComposedSeparator, {
4029
- base: separatorS.base,
4030
- horizontal: separatorS.horizontal,
4031
- vertical: separatorS.vertical
4032
- }),
4033
- FormGroup: withStyles19(ComposedFormGroup, {
4034
- base: formGroupS.base,
4035
- error: formGroupS.error
4036
- }),
4037
- Avatar: withStyles19(ComposedAvatar, {
4038
- root: avatarS.root,
4039
- image: avatarS.image,
4040
- fallback: avatarS.fallback
4041
- }),
4042
- EmptyState: withStyles19(ComposedEmptyState, {
4043
- root: emptyStateS.root,
4044
- icon: emptyStateS.icon,
4045
- title: emptyStateS.title,
4046
- description: emptyStateS.description,
4047
- action: emptyStateS.action
4048
- }),
4049
- Skeleton: Object.assign(withStyles19(ComposedSkeleton, { root: skeletonS.root }), {
4050
- Text: withStyles19(ComposedSkeleton.Text, {
4051
- root: skeletonS.textRoot,
4052
- line: skeletonS.textLine
4053
- }),
4054
- Circle: withStyles19(ComposedSkeleton.Circle, {
4055
- root: skeletonS.circleRoot
4056
- })
4057
- }),
4058
- Table: withStyles19(ComposedTable, {
4059
- root: tableS.root,
4060
- header: tableS.header,
4061
- body: tableS.body,
4062
- row: tableS.row,
4063
- head: tableS.head,
4064
- cell: tableS.cell,
4065
- caption: tableS.caption,
4066
- footer: tableS.footer
4067
- }),
4068
- primitives: {
4069
- Dialog: createThemedDialog(),
4070
- DropdownMenu: createThemedDropdownMenu(dropdownMenuS),
4071
- Select: createThemedSelect(selectS),
4072
- Tabs: createThemedTabs(tabsS),
4073
- Checkbox: createThemedCheckbox(checkboxS),
4074
- Switch: createThemedSwitch(switchS),
4075
- Popover: createThemedPopover(popoverS),
4076
- Progress: createThemedProgress(progressS),
4077
- RadioGroup: createThemedRadioGroup(radioGroupS),
4078
- Slider: createThemedSlider(sliderS),
4079
- Accordion: createThemedAccordion(accordionS),
4080
- Toast: createThemedToast(toastS),
4081
- Tooltip: createThemedTooltip(tooltipS),
4082
- Sheet: createThemedSheet(sheetS),
4083
- Calendar: createThemedCalendar(calendarS),
4084
- Carousel: createThemedCarousel(carouselS),
4085
- Collapsible: createThemedCollapsible(collapsibleS),
4086
- Command: createThemedCommand(commandS),
4087
- ContextMenu: createThemedContextMenu(contextMenuS),
4088
- DatePicker: createThemedDatePicker(datePickerS, {
4089
- ...calendarS,
4090
- root: calendarS.rootNoBorder
4091
- }),
4092
- Drawer: createThemedDrawer(drawerS),
4093
- HoverCard: createThemedHoverCard(hoverCardS),
4094
- List: createThemedList(listS),
4095
- Menubar: createThemedMenubar(menubarS),
4096
- NavigationMenu: createThemedNavigationMenu(navigationMenuS),
4097
- ResizablePanel: createThemedResizablePanel(resizablePanelS),
4098
- ScrollArea: createThemedScrollArea(scrollAreaS),
4099
- Toggle: createThemedToggle(toggleS),
4100
- ToggleGroup: createThemedToggleGroup(toggleGroupS)
4101
- }
3954
+ });
3955
+ lazyComp("Button", () => {
3956
+ const buttonS = styles.button;
3957
+ return ({ intent, size, ...rest }) => ComposedButton({ ...rest, classes: { base: buttonS({ intent, size }) } });
3958
+ });
3959
+ lazyComp("Badge", () => {
3960
+ const badgeS = styles.badge;
3961
+ const badgeColorInlineStyles = {
3962
+ blue: { backgroundColor: "oklch(0.55 0.15 250)", color: "#fff" },
3963
+ green: { backgroundColor: "oklch(0.55 0.15 155)", color: "#fff" },
3964
+ yellow: { backgroundColor: "oklch(0.75 0.15 85)", color: "oklch(0.25 0.05 85)" }
4102
3965
  };
4103
- }
4104
- const result = { theme, globals, styles };
4105
- Object.defineProperty(result, "components", {
4106
- get() {
4107
- if (cachedComponents === undefined) {
4108
- cachedComponents = buildComponents();
3966
+ return ({ color, ...rest }) => {
3967
+ const style = color ? badgeColorInlineStyles[color] : undefined;
3968
+ return ComposedBadge({ ...rest, classes: { base: badgeS({ color }) }, style });
3969
+ };
3970
+ });
3971
+ lazyComp("Breadcrumb", () => {
3972
+ const s = styles.breadcrumb;
3973
+ return withStyles19(ComposedBreadcrumb, {
3974
+ nav: s.nav,
3975
+ list: s.list,
3976
+ item: s.item,
3977
+ link: s.link,
3978
+ page: s.page,
3979
+ separator: s.separator
3980
+ });
3981
+ });
3982
+ lazyComp("Card", () => {
3983
+ const s = styles.card;
3984
+ return withStyles19(ComposedCard, {
3985
+ root: s.root,
3986
+ header: s.header,
3987
+ title: s.title,
3988
+ description: s.description,
3989
+ content: s.content,
3990
+ footer: s.footer,
3991
+ action: s.action
3992
+ });
3993
+ });
3994
+ lazyComp("Input", () => withStyles19(ComposedInput, { base: styles.input.base }));
3995
+ lazyComp("Textarea", () => withStyles19(ComposedTextarea, { base: styles.textarea.base }));
3996
+ lazyComp("Label", () => withStyles19(ComposedLabel, { base: styles.label.base }));
3997
+ lazyComp("Pagination", () => {
3998
+ const s = styles.pagination;
3999
+ return (props) => ComposedPagination({
4000
+ ...props,
4001
+ classes: {
4002
+ nav: s.nav,
4003
+ list: s.list,
4004
+ item: s.item,
4005
+ link: s.link,
4006
+ linkActive: s.linkActive,
4007
+ navButton: s.navButton,
4008
+ ellipsis: s.ellipsis
4109
4009
  }
4110
- return cachedComponents;
4111
- },
4010
+ });
4011
+ });
4012
+ lazyComp("Separator", () => {
4013
+ const s = styles.separator;
4014
+ return withStyles19(ComposedSeparator, {
4015
+ base: s.base,
4016
+ horizontal: s.horizontal,
4017
+ vertical: s.vertical
4018
+ });
4019
+ });
4020
+ lazyComp("FormGroup", () => {
4021
+ const s = styles.formGroup;
4022
+ return withStyles19(ComposedFormGroup, { base: s.base, error: s.error });
4023
+ });
4024
+ lazyComp("Avatar", () => {
4025
+ const s = styles.avatar;
4026
+ return withStyles19(ComposedAvatar, { root: s.root, image: s.image, fallback: s.fallback });
4027
+ });
4028
+ lazyComp("EmptyState", () => {
4029
+ const s = styles.emptyState;
4030
+ return withStyles19(ComposedEmptyState, {
4031
+ root: s.root,
4032
+ icon: s.icon,
4033
+ title: s.title,
4034
+ description: s.description,
4035
+ action: s.action
4036
+ });
4037
+ });
4038
+ lazyComp("Skeleton", () => {
4039
+ const s = styles.skeleton;
4040
+ return Object.assign(withStyles19(ComposedSkeleton, { root: s.root }), {
4041
+ Text: withStyles19(ComposedSkeleton.Text, { root: s.textRoot, line: s.textLine }),
4042
+ Circle: withStyles19(ComposedSkeleton.Circle, { root: s.circleRoot })
4043
+ });
4044
+ });
4045
+ lazyComp("Table", () => {
4046
+ const s = styles.table;
4047
+ return withStyles19(ComposedTable, {
4048
+ root: s.root,
4049
+ header: s.header,
4050
+ body: s.body,
4051
+ row: s.row,
4052
+ head: s.head,
4053
+ cell: s.cell,
4054
+ caption: s.caption,
4055
+ footer: s.footer
4056
+ });
4057
+ });
4058
+ const primitives = {};
4059
+ function lazyPrim(key, factory) {
4060
+ let cached;
4061
+ Object.defineProperty(primitives, key, {
4062
+ get() {
4063
+ if (cached === undefined)
4064
+ cached = factory();
4065
+ return cached;
4066
+ },
4067
+ enumerable: true,
4068
+ configurable: true
4069
+ });
4070
+ }
4071
+ lazyPrim("Dialog", () => createThemedDialog());
4072
+ lazyPrim("DropdownMenu", () => createThemedDropdownMenu(styles.dropdownMenu));
4073
+ lazyPrim("Select", () => createThemedSelect(styles.select));
4074
+ lazyPrim("Tabs", () => createThemedTabs(styles.tabs));
4075
+ lazyPrim("Checkbox", () => createThemedCheckbox(styles.checkbox));
4076
+ lazyPrim("Switch", () => createThemedSwitch(styles.switch));
4077
+ lazyPrim("Popover", () => createThemedPopover(styles.popover));
4078
+ lazyPrim("Progress", () => createThemedProgress(styles.progress));
4079
+ lazyPrim("RadioGroup", () => createThemedRadioGroup(styles.radioGroup));
4080
+ lazyPrim("Slider", () => createThemedSlider(styles.slider));
4081
+ lazyPrim("Accordion", () => createThemedAccordion(styles.accordion));
4082
+ lazyPrim("Toast", () => createThemedToast(styles.toast));
4083
+ lazyPrim("Tooltip", () => createThemedTooltip(styles.tooltip));
4084
+ lazyPrim("Sheet", () => createThemedSheet(styles.sheet));
4085
+ lazyPrim("Calendar", () => createThemedCalendar(styles.calendar));
4086
+ lazyPrim("Carousel", () => createThemedCarousel(styles.carousel));
4087
+ lazyPrim("Collapsible", () => createThemedCollapsible(styles.collapsible));
4088
+ lazyPrim("Command", () => createThemedCommand(styles.command));
4089
+ lazyPrim("ContextMenu", () => createThemedContextMenu(styles.contextMenu));
4090
+ lazyPrim("DatePicker", () => {
4091
+ const calendarS = styles.calendar;
4092
+ return createThemedDatePicker(styles.datePicker, {
4093
+ ...calendarS,
4094
+ root: calendarS.rootNoBorder
4095
+ });
4096
+ });
4097
+ lazyPrim("Drawer", () => createThemedDrawer(styles.drawer));
4098
+ lazyPrim("HoverCard", () => createThemedHoverCard(styles.hoverCard));
4099
+ lazyPrim("List", () => createThemedList(styles.list));
4100
+ lazyPrim("Menubar", () => createThemedMenubar(styles.menubar));
4101
+ lazyPrim("NavigationMenu", () => createThemedNavigationMenu(styles.navigationMenu));
4102
+ lazyPrim("ResizablePanel", () => createThemedResizablePanel(styles.resizablePanel));
4103
+ lazyPrim("ScrollArea", () => createThemedScrollArea(styles.scrollArea));
4104
+ lazyPrim("Toggle", () => createThemedToggle(styles.toggle));
4105
+ lazyPrim("ToggleGroup", () => createThemedToggleGroup(styles.toggleGroup));
4106
+ Object.defineProperty(components, "primitives", {
4107
+ value: primitives,
4112
4108
  enumerable: true,
4113
4109
  configurable: true
4114
4110
  });
4115
- return result;
4111
+ return { theme, globals, styles, components };
4116
4112
  }
4117
4113
  export {
4118
4114
  palettes,
@@ -2,17 +2,17 @@
2
2
  import { defineTheme, globalCss } from "@vertz/ui";
3
3
 
4
4
  // src/merge.ts
5
- function deepMergeTokens(base, overrides) {
5
+ function deepMergeTokens(base, colors) {
6
6
  const result = {};
7
7
  for (const [key, values] of Object.entries(base)) {
8
- const override = overrides[key];
8
+ const override = colors[key];
9
9
  if (override) {
10
10
  result[key] = { ...values, ...override };
11
11
  } else {
12
12
  result[key] = { ...values };
13
13
  }
14
14
  }
15
- for (const [key, values] of Object.entries(overrides)) {
15
+ for (const [key, values] of Object.entries(colors)) {
16
16
  if (!(key in result) && values) {
17
17
  result[key] = { ...values };
18
18
  }
@@ -356,7 +356,7 @@ function configureThemeBase(config) {
356
356
  const palette = config?.palette ?? "zinc";
357
357
  const radius = config?.radius ?? "md";
358
358
  const baseTokens = palettes[palette];
359
- const colorOverrides = config?.overrides?.tokens?.colors ?? {};
359
+ const colorOverrides = config?.colors ?? {};
360
360
  const mergedTokens = deepMergeTokens(baseTokens, colorOverrides);
361
361
  const theme = defineTheme({ colors: mergedTokens });
362
362
  const globals = globalCss({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertz/theme-shadcn",
3
- "version": "0.2.38",
3
+ "version": "0.2.41",
4
4
  "description": "Shadcn-inspired theme for Vertz — pre-built style definitions using variants() and css()",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -40,12 +40,12 @@
40
40
  "typecheck": "tsc --noEmit"
41
41
  },
42
42
  "dependencies": {
43
- "@vertz/ui": "^0.2.35",
44
- "@vertz/ui-primitives": "^0.2.35"
43
+ "@vertz/ui": "^0.2.39",
44
+ "@vertz/ui-primitives": "^0.2.39"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@happy-dom/global-registrator": "^20.7.0",
48
- "@vertz/ui-compiler": "^0.2.35",
48
+ "@vertz/ui-compiler": "^0.2.39",
49
49
  "bunup": "^0.16.31",
50
50
  "happy-dom": "^20.7.0",
51
51
  "typescript": "^5.7.0"