@jameskabz/nextcraft-ui 0.6.7 → 0.6.9
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/craft-alert.d.cts +1 -1
- package/dist/components/craft-alert.d.ts +1 -1
- package/dist/components/craft-badge.d.cts +1 -1
- package/dist/components/craft-badge.d.ts +1 -1
- package/dist/components/craft-button.d.cts +1 -1
- package/dist/components/craft-button.d.ts +1 -1
- package/dist/components/craft-card.d.cts +1 -1
- package/dist/components/craft-card.d.ts +1 -1
- package/dist/components/craft-checkbox.d.cts +1 -1
- package/dist/components/craft-checkbox.d.ts +1 -1
- package/dist/components/craft-command-palette.d.cts +1 -1
- package/dist/components/craft-command-palette.d.ts +1 -1
- package/dist/components/craft-confirm-dialog.d.cts +1 -1
- package/dist/components/craft-confirm-dialog.d.ts +1 -1
- package/dist/components/craft-create-edit-drawer.d.cts +1 -1
- package/dist/components/craft-create-edit-drawer.d.ts +1 -1
- package/dist/components/craft-currency-input.d.cts +1 -1
- package/dist/components/craft-currency-input.d.ts +1 -1
- package/dist/components/craft-data-table.d.cts +1 -1
- package/dist/components/craft-data-table.d.ts +1 -1
- package/dist/components/craft-date-picker.d.cts +1 -1
- package/dist/components/craft-date-picker.d.ts +1 -1
- package/dist/components/craft-drawer.d.cts +1 -1
- package/dist/components/craft-drawer.d.ts +1 -1
- package/dist/components/craft-dropdown-menu.d.cts +1 -1
- package/dist/components/craft-dropdown-menu.d.ts +1 -1
- package/dist/components/craft-empty-state.d.cts +1 -1
- package/dist/components/craft-empty-state.d.ts +1 -1
- package/dist/components/craft-error-state.d.cts +1 -1
- package/dist/components/craft-error-state.d.ts +1 -1
- package/dist/components/craft-filter-bar.d.cts +1 -1
- package/dist/components/craft-filter-bar.d.ts +1 -1
- package/dist/components/craft-form-builder.d.cts +1 -1
- package/dist/components/craft-form-builder.d.ts +1 -1
- package/dist/components/craft-form-field.d.cts +1 -1
- package/dist/components/craft-form-field.d.ts +1 -1
- package/dist/components/craft-form.d.cts +1 -1
- package/dist/components/craft-form.d.ts +1 -1
- package/dist/components/craft-icon.cjs +6 -3
- package/dist/components/craft-icon.cjs.map +1 -1
- package/dist/components/craft-icon.js +6 -3
- package/dist/components/craft-icon.js.map +1 -1
- package/dist/components/craft-input.d.cts +1 -1
- package/dist/components/craft-input.d.ts +1 -1
- package/dist/components/craft-link.d.cts +1 -1
- package/dist/components/craft-link.d.ts +1 -1
- package/dist/components/craft-loading-state.d.cts +1 -1
- package/dist/components/craft-loading-state.d.ts +1 -1
- package/dist/components/craft-modal.d.cts +1 -1
- package/dist/components/craft-modal.d.ts +1 -1
- package/dist/components/craft-number-input.d.cts +1 -1
- package/dist/components/craft-number-input.d.ts +1 -1
- package/dist/components/craft-pagination.d.cts +1 -1
- package/dist/components/craft-pagination.d.ts +1 -1
- package/dist/components/craft-popover.d.cts +1 -1
- package/dist/components/craft-popover.d.ts +1 -1
- package/dist/components/craft-select.d.cts +1 -1
- package/dist/components/craft-select.d.ts +1 -1
- package/dist/components/craft-skeleton.d.cts +1 -1
- package/dist/components/craft-skeleton.d.ts +1 -1
- package/dist/components/craft-stat-card.d.cts +1 -1
- package/dist/components/craft-stat-card.d.ts +1 -1
- package/dist/components/craft-submit-button.d.cts +1 -1
- package/dist/components/craft-submit-button.d.ts +1 -1
- package/dist/components/craft-switch.d.cts +1 -1
- package/dist/components/craft-switch.d.ts +1 -1
- package/dist/components/craft-table-toolbar.d.cts +1 -1
- package/dist/components/craft-table-toolbar.d.ts +1 -1
- package/dist/components/craft-tabs.d.cts +1 -1
- package/dist/components/craft-tabs.d.ts +1 -1
- package/dist/components/craft-textarea.d.cts +1 -1
- package/dist/components/craft-textarea.d.ts +1 -1
- package/dist/components/craft-toast.d.cts +1 -1
- package/dist/components/craft-toast.d.ts +1 -1
- package/dist/components/craft-tooltip.d.cts +1 -1
- package/dist/components/craft-tooltip.d.ts +1 -1
- package/dist/components/glass-card.d.cts +1 -1
- package/dist/components/glass-card.d.ts +1 -1
- package/dist/components/layout/sidebar.cjs +2 -1
- package/dist/components/layout/sidebar.cjs.map +1 -1
- package/dist/components/layout/sidebar.d.cts +1 -1
- package/dist/components/layout/sidebar.d.ts +1 -1
- package/dist/components/layout/sidebar.js +2 -1
- package/dist/components/layout/sidebar.js.map +1 -1
- package/dist/components/theme-switcher.cjs +1 -1
- package/dist/components/theme-switcher.js +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/theme/theme-context.cjs +115 -0
- package/dist/theme/theme-context.cjs.map +1 -0
- package/dist/{theme-context-EVI9PfKv.d.cts → theme/theme-context.d.cts} +2 -1
- package/dist/{theme-context-EVI9PfKv.d.ts → theme/theme-context.d.ts} +2 -1
- package/dist/theme/theme-context.js +79 -0
- package/dist/theme/theme-context.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeName } from '../theme/theme-context.cjs';
|
|
4
4
|
|
|
5
5
|
type CraftAlertVariant = "info" | "success" | "warning" | "error";
|
|
6
6
|
type CraftAlertProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeName } from '../theme/theme-context.js';
|
|
4
4
|
|
|
5
5
|
type CraftAlertVariant = "info" | "success" | "warning" | "error";
|
|
6
6
|
type CraftAlertProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeName } from '../theme/theme-context.cjs';
|
|
4
4
|
|
|
5
5
|
type CraftBadgeVariant = "solid" | "soft" | "outline";
|
|
6
6
|
type CraftBadgeProps = React.HTMLAttributes<HTMLSpanElement> & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeName } from '../theme/theme-context.js';
|
|
4
4
|
|
|
5
5
|
type CraftBadgeVariant = "solid" | "soft" | "outline";
|
|
6
6
|
type CraftBadgeProps = React.HTMLAttributes<HTMLSpanElement> & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeName } from '../theme/theme-context.cjs';
|
|
4
4
|
|
|
5
5
|
type CraftButtonVariant = "solid" | "ghost" | "outline" | "gradient";
|
|
6
6
|
type CraftButtonSize = "sm" | "md" | "lg";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeName } from '../theme/theme-context.js';
|
|
4
4
|
|
|
5
5
|
type CraftButtonVariant = "solid" | "ghost" | "outline" | "gradient";
|
|
6
6
|
type CraftButtonSize = "sm" | "md" | "lg";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ThemeName } from '../theme/theme-context.cjs';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
type CraftCheckboxProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "type"> & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ThemeName } from '../theme/theme-context.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
type CraftCheckboxProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "type"> & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeName } from '../theme/theme-context.cjs';
|
|
4
4
|
|
|
5
5
|
type CraftConfirmDialogProps = {
|
|
6
6
|
open?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { FieldValues, UseFormReturn } from 'react-hook-form';
|
|
4
|
-
import {
|
|
4
|
+
import { ThemeName } from '../theme/theme-context.cjs';
|
|
5
5
|
|
|
6
6
|
type CraftCreateEditDrawerProps<TValues extends FieldValues> = {
|
|
7
7
|
mode?: "create" | "edit";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { FieldValues, UseFormReturn } from 'react-hook-form';
|
|
4
|
-
import {
|
|
4
|
+
import { ThemeName } from '../theme/theme-context.js';
|
|
5
5
|
|
|
6
6
|
type CraftCreateEditDrawerProps<TValues extends FieldValues> = {
|
|
7
7
|
mode?: "create" | "edit";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ThemeName } from '../theme/theme-context.cjs';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
type CraftCurrencyInputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "type"> & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ThemeName } from '../theme/theme-context.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
type CraftCurrencyInputProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "type"> & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeName } from '../theme/theme-context.cjs';
|
|
4
4
|
|
|
5
5
|
type CraftEmptyStateProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
6
6
|
tone?: ThemeName;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeName } from '../theme/theme-context.js';
|
|
4
4
|
|
|
5
5
|
type CraftEmptyStateProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
6
6
|
tone?: ThemeName;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeName } from '../theme/theme-context.cjs';
|
|
4
4
|
|
|
5
5
|
type CraftErrorStateProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
6
6
|
title?: React.ReactNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeName } from '../theme/theme-context.js';
|
|
4
4
|
|
|
5
5
|
type CraftErrorStateProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
6
6
|
title?: React.ReactNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeName } from '../theme/theme-context.cjs';
|
|
4
4
|
|
|
5
5
|
type CraftFilterBarProps = {
|
|
6
6
|
title?: React.ReactNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeName } from '../theme/theme-context.js';
|
|
4
4
|
|
|
5
5
|
type CraftFilterBarProps = {
|
|
6
6
|
title?: React.ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
4
|
-
import {
|
|
4
|
+
import { ThemeName } from '../theme/theme-context.cjs';
|
|
5
5
|
import { CraftFormFieldType, CraftFormFieldOption } from './craft-form-field.cjs';
|
|
6
6
|
|
|
7
7
|
type CraftFormBuilderField<TValues extends FieldValues> = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
4
|
-
import {
|
|
4
|
+
import { ThemeName } from '../theme/theme-context.js';
|
|
5
5
|
import { CraftFormFieldType, CraftFormFieldOption } from './craft-form-field.js';
|
|
6
6
|
|
|
7
7
|
type CraftFormBuilderField<TValues extends FieldValues> = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
4
|
-
import {
|
|
4
|
+
import { ThemeName } from '../theme/theme-context.cjs';
|
|
5
5
|
|
|
6
6
|
type CraftFormFieldOption = {
|
|
7
7
|
label: React.ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
4
|
-
import {
|
|
4
|
+
import { ThemeName } from '../theme/theme-context.js';
|
|
5
5
|
|
|
6
6
|
type CraftFormFieldOption = {
|
|
7
7
|
label: React.ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { FieldValues, UseFormReturn } from 'react-hook-form';
|
|
4
|
-
import {
|
|
4
|
+
import { ThemeName } from '../theme/theme-context.cjs';
|
|
5
5
|
|
|
6
6
|
type CraftFormProps<TValues extends FieldValues> = {
|
|
7
7
|
form: UseFormReturn<TValues>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { FieldValues, UseFormReturn } from 'react-hook-form';
|
|
4
|
-
import {
|
|
4
|
+
import { ThemeName } from '../theme/theme-context.js';
|
|
5
5
|
|
|
6
6
|
type CraftFormProps<TValues extends FieldValues> = {
|
|
7
7
|
form: UseFormReturn<TValues>;
|
|
@@ -58,14 +58,17 @@ function CraftIcon({
|
|
|
58
58
|
let mounted = true;
|
|
59
59
|
(async () => {
|
|
60
60
|
try {
|
|
61
|
-
const mod = await
|
|
62
|
-
"return import('lucide-react/dynamic')"
|
|
63
|
-
)();
|
|
61
|
+
const mod = await import("lucide-react/dynamic");
|
|
64
62
|
if (mounted) {
|
|
65
63
|
setLucideIcon(() => mod.DynamicIcon);
|
|
66
64
|
}
|
|
67
65
|
} catch {
|
|
68
66
|
if (mounted) setLucideIcon(null);
|
|
67
|
+
if (process.env.NODE_ENV !== "production") {
|
|
68
|
+
console.warn(
|
|
69
|
+
"[CraftIcon] Failed to load lucide-react/dynamic. Ensure lucide-react is installed."
|
|
70
|
+
);
|
|
71
|
+
}
|
|
69
72
|
}
|
|
70
73
|
})();
|
|
71
74
|
return () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/craft-icon.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"@/utils/cn\";\n\nexport type CraftIconRegistry = Record<string, React.ReactNode>;\n\nconst CraftIconContext = React.createContext<CraftIconRegistry | null>(null);\n\nexport type CraftIconProviderProps = {\n icons: CraftIconRegistry;\n children: React.ReactNode;\n};\n\nexport function CraftIconProvider({ icons, children }: CraftIconProviderProps) {\n return <CraftIconContext.Provider value={icons}>{children}</CraftIconContext.Provider>;\n}\n\nexport type CraftIconProps = {\n name: string;\n className?: string;\n \"aria-label\"?: string;\n icons?: CraftIconRegistry;\n useLucide?: boolean;\n};\n\ntype DynamicIconComponent = React.ComponentType<{\n name: string;\n className?: string;\n \"aria-hidden\"?: boolean;\n \"aria-label\"?: string;\n}>;\n\nexport function CraftIcon({\n name,\n className,\n \"aria-label\": ariaLabel,\n icons,\n useLucide = true,\n}: CraftIconProps) {\n const contextRegistry = React.useContext(CraftIconContext);\n const registry = icons ?? contextRegistry;\n const icon = registry?.[name];\n const [LucideIcon, setLucideIcon] = React.useState<DynamicIconComponent | null>(\n null\n );\n\n React.useEffect(() => {\n if (!useLucide || icon || LucideIcon) return;\n let mounted = true;\n (async () => {\n try {\n const mod = await (
|
|
1
|
+
{"version":3,"sources":["../../src/components/craft-icon.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"@/utils/cn\";\n\nexport type CraftIconRegistry = Record<string, React.ReactNode>;\n\nconst CraftIconContext = React.createContext<CraftIconRegistry | null>(null);\n\nexport type CraftIconProviderProps = {\n icons: CraftIconRegistry;\n children: React.ReactNode;\n};\n\nexport function CraftIconProvider({ icons, children }: CraftIconProviderProps) {\n return <CraftIconContext.Provider value={icons}>{children}</CraftIconContext.Provider>;\n}\n\nexport type CraftIconProps = {\n name: string;\n className?: string;\n \"aria-label\"?: string;\n icons?: CraftIconRegistry;\n useLucide?: boolean;\n};\n\ntype DynamicIconComponent = React.ComponentType<{\n name: string;\n className?: string;\n \"aria-hidden\"?: boolean;\n \"aria-label\"?: string;\n}>;\n\nexport function CraftIcon({\n name,\n className,\n \"aria-label\": ariaLabel,\n icons,\n useLucide = true,\n}: CraftIconProps) {\n const contextRegistry = React.useContext(CraftIconContext);\n const registry = icons ?? contextRegistry;\n const icon = registry?.[name];\n const [LucideIcon, setLucideIcon] = React.useState<DynamicIconComponent | null>(\n null\n );\n\n React.useEffect(() => {\n if (!useLucide || icon || LucideIcon) return;\n let mounted = true;\n (async () => {\n try {\n const mod = await import(\"lucide-react/dynamic\");\n if (mounted) {\n setLucideIcon(() => mod.DynamicIcon as DynamicIconComponent);\n }\n } catch {\n if (mounted) setLucideIcon(null);\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n \"[CraftIcon] Failed to load lucide-react/dynamic. Ensure lucide-react is installed.\"\n );\n }\n }\n })();\n return () => {\n mounted = false;\n };\n }, [LucideIcon, icon, useLucide]);\n\n if (!icon) {\n if (!useLucide) return null;\n if (!LucideIcon) return null;\n return (\n <LucideIcon\n name={name}\n className={className}\n aria-hidden={ariaLabel ? undefined : true}\n aria-label={ariaLabel}\n />\n );\n }\n\n type IconElementProps = {\n className?: string;\n \"aria-hidden\"?: boolean;\n \"aria-label\"?: string;\n };\n\n if (React.isValidElement<IconElementProps>(icon)) {\n return React.cloneElement(icon, {\n className: cn(icon.props.className, className),\n \"aria-hidden\": ariaLabel ? undefined : true,\n \"aria-label\": ariaLabel,\n });\n }\n\n return (\n <span className={className} aria-label={ariaLabel}>\n {icon}\n </span>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBS;AAdT,YAAuB;AAEvB,gBAAmB;AAInB,MAAM,mBAAmB,MAAM,cAAwC,IAAI;AAOpE,SAAS,kBAAkB,EAAE,OAAO,SAAS,GAA2B;AAC7E,SAAO,4CAAC,iBAAiB,UAAjB,EAA0B,OAAO,OAAQ,UAAS;AAC5D;AAiBO,SAAS,UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA,YAAY;AACd,GAAmB;AACjB,QAAM,kBAAkB,MAAM,WAAW,gBAAgB;AACzD,QAAM,WAAW,wBAAS;AAC1B,QAAM,OAAO,qCAAW;AACxB,QAAM,CAAC,YAAY,aAAa,IAAI,MAAM;AAAA,IACxC;AAAA,EACF;AAEA,QAAM,UAAU,MAAM;AACpB,QAAI,CAAC,aAAa,QAAQ,WAAY;AACtC,QAAI,UAAU;AACd,KAAC,YAAY;AACX,UAAI;AACF,cAAM,MAAM,MAAM,OAAO,sBAAsB;AAC/C,YAAI,SAAS;AACX,wBAAc,MAAM,IAAI,WAAmC;AAAA,QAC7D;AAAA,MACF,QAAQ;AACN,YAAI,QAAS,eAAc,IAAI;AAC/B,YAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,kBAAQ;AAAA,YACN;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF,GAAG;AACH,WAAO,MAAM;AACX,gBAAU;AAAA,IACZ;AAAA,EACF,GAAG,CAAC,YAAY,MAAM,SAAS,CAAC;AAEhC,MAAI,CAAC,MAAM;AACT,QAAI,CAAC,UAAW,QAAO;AACvB,QAAI,CAAC,WAAY,QAAO;AACxB,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,eAAa,YAAY,SAAY;AAAA,QACrC,cAAY;AAAA;AAAA,IACd;AAAA,EAEJ;AAQA,MAAI,MAAM,eAAiC,IAAI,GAAG;AAChD,WAAO,MAAM,aAAa,MAAM;AAAA,MAC9B,eAAW,cAAG,KAAK,MAAM,WAAW,SAAS;AAAA,MAC7C,eAAe,YAAY,SAAY;AAAA,MACvC,cAAc;AAAA,IAChB,CAAC;AAAA,EACH;AAEA,SACE,4CAAC,UAAK,WAAsB,cAAY,WACrC,gBACH;AAEJ;","names":[]}
|
|
@@ -24,14 +24,17 @@ function CraftIcon({
|
|
|
24
24
|
let mounted = true;
|
|
25
25
|
(async () => {
|
|
26
26
|
try {
|
|
27
|
-
const mod = await
|
|
28
|
-
"return import('lucide-react/dynamic')"
|
|
29
|
-
)();
|
|
27
|
+
const mod = await import("lucide-react/dynamic");
|
|
30
28
|
if (mounted) {
|
|
31
29
|
setLucideIcon(() => mod.DynamicIcon);
|
|
32
30
|
}
|
|
33
31
|
} catch {
|
|
34
32
|
if (mounted) setLucideIcon(null);
|
|
33
|
+
if (process.env.NODE_ENV !== "production") {
|
|
34
|
+
console.warn(
|
|
35
|
+
"[CraftIcon] Failed to load lucide-react/dynamic. Ensure lucide-react is installed."
|
|
36
|
+
);
|
|
37
|
+
}
|
|
35
38
|
}
|
|
36
39
|
})();
|
|
37
40
|
return () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/craft-icon.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"@/utils/cn\";\n\nexport type CraftIconRegistry = Record<string, React.ReactNode>;\n\nconst CraftIconContext = React.createContext<CraftIconRegistry | null>(null);\n\nexport type CraftIconProviderProps = {\n icons: CraftIconRegistry;\n children: React.ReactNode;\n};\n\nexport function CraftIconProvider({ icons, children }: CraftIconProviderProps) {\n return <CraftIconContext.Provider value={icons}>{children}</CraftIconContext.Provider>;\n}\n\nexport type CraftIconProps = {\n name: string;\n className?: string;\n \"aria-label\"?: string;\n icons?: CraftIconRegistry;\n useLucide?: boolean;\n};\n\ntype DynamicIconComponent = React.ComponentType<{\n name: string;\n className?: string;\n \"aria-hidden\"?: boolean;\n \"aria-label\"?: string;\n}>;\n\nexport function CraftIcon({\n name,\n className,\n \"aria-label\": ariaLabel,\n icons,\n useLucide = true,\n}: CraftIconProps) {\n const contextRegistry = React.useContext(CraftIconContext);\n const registry = icons ?? contextRegistry;\n const icon = registry?.[name];\n const [LucideIcon, setLucideIcon] = React.useState<DynamicIconComponent | null>(\n null\n );\n\n React.useEffect(() => {\n if (!useLucide || icon || LucideIcon) return;\n let mounted = true;\n (async () => {\n try {\n const mod = await (
|
|
1
|
+
{"version":3,"sources":["../../src/components/craft-icon.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"@/utils/cn\";\n\nexport type CraftIconRegistry = Record<string, React.ReactNode>;\n\nconst CraftIconContext = React.createContext<CraftIconRegistry | null>(null);\n\nexport type CraftIconProviderProps = {\n icons: CraftIconRegistry;\n children: React.ReactNode;\n};\n\nexport function CraftIconProvider({ icons, children }: CraftIconProviderProps) {\n return <CraftIconContext.Provider value={icons}>{children}</CraftIconContext.Provider>;\n}\n\nexport type CraftIconProps = {\n name: string;\n className?: string;\n \"aria-label\"?: string;\n icons?: CraftIconRegistry;\n useLucide?: boolean;\n};\n\ntype DynamicIconComponent = React.ComponentType<{\n name: string;\n className?: string;\n \"aria-hidden\"?: boolean;\n \"aria-label\"?: string;\n}>;\n\nexport function CraftIcon({\n name,\n className,\n \"aria-label\": ariaLabel,\n icons,\n useLucide = true,\n}: CraftIconProps) {\n const contextRegistry = React.useContext(CraftIconContext);\n const registry = icons ?? contextRegistry;\n const icon = registry?.[name];\n const [LucideIcon, setLucideIcon] = React.useState<DynamicIconComponent | null>(\n null\n );\n\n React.useEffect(() => {\n if (!useLucide || icon || LucideIcon) return;\n let mounted = true;\n (async () => {\n try {\n const mod = await import(\"lucide-react/dynamic\");\n if (mounted) {\n setLucideIcon(() => mod.DynamicIcon as DynamicIconComponent);\n }\n } catch {\n if (mounted) setLucideIcon(null);\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n \"[CraftIcon] Failed to load lucide-react/dynamic. Ensure lucide-react is installed.\"\n );\n }\n }\n })();\n return () => {\n mounted = false;\n };\n }, [LucideIcon, icon, useLucide]);\n\n if (!icon) {\n if (!useLucide) return null;\n if (!LucideIcon) return null;\n return (\n <LucideIcon\n name={name}\n className={className}\n aria-hidden={ariaLabel ? undefined : true}\n aria-label={ariaLabel}\n />\n );\n }\n\n type IconElementProps = {\n className?: string;\n \"aria-hidden\"?: boolean;\n \"aria-label\"?: string;\n };\n\n if (React.isValidElement<IconElementProps>(icon)) {\n return React.cloneElement(icon, {\n className: cn(icon.props.className, className),\n \"aria-hidden\": ariaLabel ? undefined : true,\n \"aria-label\": ariaLabel,\n });\n }\n\n return (\n <span className={className} aria-label={ariaLabel}>\n {icon}\n </span>\n );\n}\n"],"mappings":";AAgBS;AAdT,YAAY,WAAW;AAEvB,SAAS,UAAU;AAInB,MAAM,mBAAmB,MAAM,cAAwC,IAAI;AAOpE,SAAS,kBAAkB,EAAE,OAAO,SAAS,GAA2B;AAC7E,SAAO,oBAAC,iBAAiB,UAAjB,EAA0B,OAAO,OAAQ,UAAS;AAC5D;AAiBO,SAAS,UAAU;AAAA,EACxB;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA,YAAY;AACd,GAAmB;AACjB,QAAM,kBAAkB,MAAM,WAAW,gBAAgB;AACzD,QAAM,WAAW,wBAAS;AAC1B,QAAM,OAAO,qCAAW;AACxB,QAAM,CAAC,YAAY,aAAa,IAAI,MAAM;AAAA,IACxC;AAAA,EACF;AAEA,QAAM,UAAU,MAAM;AACpB,QAAI,CAAC,aAAa,QAAQ,WAAY;AACtC,QAAI,UAAU;AACd,KAAC,YAAY;AACX,UAAI;AACF,cAAM,MAAM,MAAM,OAAO,sBAAsB;AAC/C,YAAI,SAAS;AACX,wBAAc,MAAM,IAAI,WAAmC;AAAA,QAC7D;AAAA,MACF,QAAQ;AACN,YAAI,QAAS,eAAc,IAAI;AAC/B,YAAI,QAAQ,IAAI,aAAa,cAAc;AACzC,kBAAQ;AAAA,YACN;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF,GAAG;AACH,WAAO,MAAM;AACX,gBAAU;AAAA,IACZ;AAAA,EACF,GAAG,CAAC,YAAY,MAAM,SAAS,CAAC;AAEhC,MAAI,CAAC,MAAM;AACT,QAAI,CAAC,UAAW,QAAO;AACvB,QAAI,CAAC,WAAY,QAAO;AACxB,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,eAAa,YAAY,SAAY;AAAA,QACrC,cAAY;AAAA;AAAA,IACd;AAAA,EAEJ;AAQA,MAAI,MAAM,eAAiC,IAAI,GAAG;AAChD,WAAO,MAAM,aAAa,MAAM;AAAA,MAC9B,WAAW,GAAG,KAAK,MAAM,WAAW,SAAS;AAAA,MAC7C,eAAe,YAAY,SAAY;AAAA,MACvC,cAAc;AAAA,IAChB,CAAC;AAAA,EACH;AAEA,SACE,oBAAC,UAAK,WAAsB,cAAY,WACrC,gBACH;AAEJ;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { LinkProps } from 'next/link';
|
|
4
|
-
import {
|
|
4
|
+
import { ThemeName } from '../theme/theme-context.cjs';
|
|
5
5
|
|
|
6
6
|
type CraftLinkVariant = "default" | "muted" | "button" | "ghost";
|
|
7
7
|
type CraftLinkProps = LinkProps & React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { LinkProps } from 'next/link';
|
|
4
|
-
import {
|
|
4
|
+
import { ThemeName } from '../theme/theme-context.js';
|
|
5
5
|
|
|
6
6
|
type CraftLinkVariant = "default" | "muted" | "button" | "ghost";
|
|
7
7
|
type CraftLinkProps = LinkProps & React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeName } from '../theme/theme-context.cjs';
|
|
4
4
|
|
|
5
5
|
type CraftLoadingSize = "sm" | "md" | "lg";
|
|
6
6
|
type CraftLoadingStateProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeName } from '../theme/theme-context.js';
|
|
4
4
|
|
|
5
5
|
type CraftLoadingSize = "sm" | "md" | "lg";
|
|
6
6
|
type CraftLoadingStateProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeName } from '../theme/theme-context.cjs';
|
|
4
4
|
|
|
5
5
|
type PopoverAlign = "start" | "center" | "end";
|
|
6
6
|
type CraftPopoverProps = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeName } from '../theme/theme-context.js';
|
|
4
4
|
|
|
5
5
|
type PopoverAlign = "start" | "center" | "end";
|
|
6
6
|
type CraftPopoverProps = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeName } from '../theme/theme-context.cjs';
|
|
4
4
|
|
|
5
5
|
type CraftSkeletonProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
6
6
|
tone?: ThemeName;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeName } from '../theme/theme-context.js';
|
|
4
4
|
|
|
5
5
|
type CraftSkeletonProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
6
6
|
tone?: ThemeName;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ThemeName } from '../theme/theme-context.cjs';
|
|
4
4
|
|
|
5
5
|
type CraftStatTrend = "up" | "down" | "neutral";
|
|
6
6
|
type CraftStatCardProps = React.HTMLAttributes<HTMLDivElement> & {
|