@fakhrirafiki/theme-engine 0.4.0 → 0.4.2
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/README.md +18 -3
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -219,9 +219,24 @@ If you run multiple apps on the same domain, override the keys:
|
|
|
219
219
|
|
|
220
220
|
After importing `@fakhrirafiki/theme-engine/styles`, you can use semantic tokens like:
|
|
221
221
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
222
|
+
| Category | Tailwind class examples | Backed by preset CSS variables | Notes |
|
|
223
|
+
| --- | --- | --- | --- |
|
|
224
|
+
| Surfaces | `bg-background`, `text-foreground` | `--background`, `--foreground` | Base app background + text |
|
|
225
|
+
| Cards | `bg-card`, `text-card-foreground` | `--card`, `--card-foreground` | Cards / panels |
|
|
226
|
+
| Popovers | `bg-popover`, `text-popover-foreground` | `--popover`, `--popover-foreground` | Popovers / dropdowns |
|
|
227
|
+
| Brand / actions | `bg-primary`, `text-primary-foreground` | `--primary`, `--primary-foreground` | Primary buttons / highlights |
|
|
228
|
+
| Secondary | `bg-secondary`, `text-secondary-foreground` | `--secondary`, `--secondary-foreground` | Secondary UI surfaces |
|
|
229
|
+
| Muted | `bg-muted`, `text-muted-foreground` | `--muted`, `--muted-foreground` | Subtle backgrounds / helper text |
|
|
230
|
+
| Accent | `bg-accent`, `text-accent-foreground` | `--accent`, `--accent-foreground` | Emphasis (not status colors) |
|
|
231
|
+
| Destructive | `bg-destructive`, `text-destructive-foreground` | `--destructive`, `--destructive-foreground` | Danger actions |
|
|
232
|
+
| Borders / focus | `border-border`, `border-input`, `ring-ring` | `--border`, `--input`, `--ring` | Also used by `outline-ring/50` in `tailwind.css` |
|
|
233
|
+
| Charts | `bg-chart-1`, `text-chart-2` | `--chart-1` ... `--chart-5` | Data viz palettes |
|
|
234
|
+
| Sidebar | `bg-sidebar`, `text-sidebar-foreground`, `bg-sidebar-primary`, `border-sidebar-border` | `--sidebar-*` | Handy for dashboard layouts |
|
|
235
|
+
| Status accents | `bg-accent-success`, `text-accent-danger-foreground` | `--accent-<name>`, `--accent-<name>-foreground` | Optional: only if your preset defines `accent-*` variables |
|
|
236
|
+
| Radius scale | `rounded-sm`, `rounded-md`, `rounded-lg`, `rounded-xl` | `--radius-sm`, `--radius-md`, `--radius-lg`, `--radius-xl` | Derived from `--radius` |
|
|
237
|
+
| Tracking scale | `tracking-tighter`, `tracking-wide` | `--tracking-*` | Derived from `--letter-spacing` |
|
|
238
|
+
| Fonts | `font-sans`, `font-serif`, `font-mono` | `--font-sans`, `--font-serif`, `--font-mono` | Set in `base.css`, overridable by presets |
|
|
239
|
+
| Shadows | `shadow-sm`, `shadow-md`, `shadow-xl` | `--shadow-*` | Shadow scale derived from `--shadow-*` knobs |
|
|
225
240
|
|
|
226
241
|
## Troubleshooting
|
|
227
242
|
|
package/dist/index.d.mts
CHANGED
|
@@ -356,7 +356,7 @@ interface UnifiedThemeContextValue {
|
|
|
356
356
|
customPresets: Record<string, TweakCNThemePreset>;
|
|
357
357
|
}
|
|
358
358
|
type CustomPresetsRecord$1 = Record<string, TweakCNThemePreset>;
|
|
359
|
-
type CustomPresetId$1<TCustomPresets> = TCustomPresets extends CustomPresetsRecord$1 ? Extract<keyof TCustomPresets, string> : never;
|
|
359
|
+
type CustomPresetId$1<TCustomPresets> = TCustomPresets extends CustomPresetsRecord$1 ? string extends keyof TCustomPresets ? never : Extract<keyof TCustomPresets, string> : never;
|
|
360
360
|
type PresetId<TCustomPresets> = BuiltInPresetId | CustomPresetId$1<TCustomPresets>;
|
|
361
361
|
/**
|
|
362
362
|
* Props for the UnifiedThemeProvider component.
|
|
@@ -493,7 +493,7 @@ declare const ThemeToggle: react.ForwardRefExoticComponent<ThemeToggleProps & re
|
|
|
493
493
|
declare const ThemePresetButtons: ({ animation: animationOverrides, layout: layoutOverrides, renderPreset, renderColorBox, className, categories, maxPresets, showBuiltIn, showCustom, }: ThemePresetButtonsProps) => react_jsx_runtime.JSX.Element;
|
|
494
494
|
|
|
495
495
|
type CustomPresetsRecord = Record<string, TweakCNThemePreset>;
|
|
496
|
-
type CustomPresetId<TCustomPresets> = TCustomPresets extends CustomPresetsRecord ? Extract<keyof TCustomPresets, string> : never;
|
|
496
|
+
type CustomPresetId<TCustomPresets> = TCustomPresets extends CustomPresetsRecord ? string extends keyof TCustomPresets ? never : Extract<keyof TCustomPresets, string> : never;
|
|
497
497
|
type ThemePresetId<TCustomPresets extends CustomPresetsRecord | undefined = undefined> = BuiltInPresetId | CustomPresetId<TCustomPresets>;
|
|
498
498
|
type LooseString = string & {};
|
|
499
499
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -356,7 +356,7 @@ interface UnifiedThemeContextValue {
|
|
|
356
356
|
customPresets: Record<string, TweakCNThemePreset>;
|
|
357
357
|
}
|
|
358
358
|
type CustomPresetsRecord$1 = Record<string, TweakCNThemePreset>;
|
|
359
|
-
type CustomPresetId$1<TCustomPresets> = TCustomPresets extends CustomPresetsRecord$1 ? Extract<keyof TCustomPresets, string> : never;
|
|
359
|
+
type CustomPresetId$1<TCustomPresets> = TCustomPresets extends CustomPresetsRecord$1 ? string extends keyof TCustomPresets ? never : Extract<keyof TCustomPresets, string> : never;
|
|
360
360
|
type PresetId<TCustomPresets> = BuiltInPresetId | CustomPresetId$1<TCustomPresets>;
|
|
361
361
|
/**
|
|
362
362
|
* Props for the UnifiedThemeProvider component.
|
|
@@ -493,7 +493,7 @@ declare const ThemeToggle: react.ForwardRefExoticComponent<ThemeToggleProps & re
|
|
|
493
493
|
declare const ThemePresetButtons: ({ animation: animationOverrides, layout: layoutOverrides, renderPreset, renderColorBox, className, categories, maxPresets, showBuiltIn, showCustom, }: ThemePresetButtonsProps) => react_jsx_runtime.JSX.Element;
|
|
494
494
|
|
|
495
495
|
type CustomPresetsRecord = Record<string, TweakCNThemePreset>;
|
|
496
|
-
type CustomPresetId<TCustomPresets> = TCustomPresets extends CustomPresetsRecord ? Extract<keyof TCustomPresets, string> : never;
|
|
496
|
+
type CustomPresetId<TCustomPresets> = TCustomPresets extends CustomPresetsRecord ? string extends keyof TCustomPresets ? never : Extract<keyof TCustomPresets, string> : never;
|
|
497
497
|
type ThemePresetId<TCustomPresets extends CustomPresetsRecord | undefined = undefined> = BuiltInPresetId | CustomPresetId<TCustomPresets>;
|
|
498
498
|
type LooseString = string & {};
|
|
499
499
|
/**
|
package/dist/index.js
CHANGED
|
@@ -4621,8 +4621,8 @@ var ColorBox = ({ color, className }) => {
|
|
|
4621
4621
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
4622
4622
|
"div",
|
|
4623
4623
|
{
|
|
4624
|
-
className: (0, import_clsx2.clsx)("
|
|
4625
|
-
style: { backgroundColor: formatColor(color, "
|
|
4624
|
+
className: (0, import_clsx2.clsx)("theme-color-box", className),
|
|
4625
|
+
style: { backgroundColor: formatColor(color, "hex"), width: 12, height: 12 }
|
|
4626
4626
|
}
|
|
4627
4627
|
);
|
|
4628
4628
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -4578,8 +4578,8 @@ var ColorBox = ({ color, className }) => {
|
|
|
4578
4578
|
return /* @__PURE__ */ jsx4(
|
|
4579
4579
|
"div",
|
|
4580
4580
|
{
|
|
4581
|
-
className: clsx2("
|
|
4582
|
-
style: { backgroundColor: formatColor(color, "
|
|
4581
|
+
className: clsx2("theme-color-box", className),
|
|
4582
|
+
style: { backgroundColor: formatColor(color, "hex"), width: 12, height: 12 }
|
|
4583
4583
|
}
|
|
4584
4584
|
);
|
|
4585
4585
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fakhrirafiki/theme-engine",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Elegant theming system with smooth transitions, custom presets, semantic accent colors, and complete shadcn/ui support for modern React applications",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|