@craftzbay/ui 0.3.0 → 0.4.0
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-lib/components/ui/Alert.d.ts +1 -1
- package/dist-lib/components/ui/DesignSystemProvider.d.ts +60 -0
- package/dist-lib/components/ui/EmptyState.d.ts +1 -1
- package/dist-lib/components/ui/ErrorState.d.ts +1 -1
- package/dist-lib/hooks/use-toast.d.ts +4 -4
- package/dist-lib/index.cjs +3 -3
- package/dist-lib/index.cjs.map +1 -1
- package/dist-lib/index.d.ts +1 -0
- package/dist-lib/index.js +140 -96
- package/dist-lib/index.js.map +1 -1
- package/dist-lib/test/setup.d.ts +0 -0
- package/package.json +17 -3
|
@@ -3,7 +3,7 @@ import { VariantProps } from '../../lib/cva';
|
|
|
3
3
|
declare const alert: (props?: ({
|
|
4
4
|
variant?: "default" | "success" | "warning" | "danger" | "info" | null | undefined;
|
|
5
5
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
-
export interface AlertProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof alert> {
|
|
6
|
+
export interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'>, VariantProps<typeof alert> {
|
|
7
7
|
/** Heading. Renders bold above the description. */
|
|
8
8
|
title?: ReactNode;
|
|
9
9
|
/** Show a dismiss (×) button. */
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Per-brand token overrides. Keys are CSS variable names (without the `--`
|
|
4
|
+
* prefix); values are CSS values. Any unspecified token falls back to the
|
|
5
|
+
* design system default.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <DesignSystemProvider tokens={{ 'color-accent': '#ff5555', 'radius-md': '10px' }}>
|
|
9
|
+
* <App />
|
|
10
|
+
* </DesignSystemProvider>
|
|
11
|
+
*
|
|
12
|
+
* @example Multiple brands in one app
|
|
13
|
+
* <DesignSystemProvider tokens={edgelogBrand}>
|
|
14
|
+
* <Card>...</Card>
|
|
15
|
+
* </DesignSystemProvider>
|
|
16
|
+
* <DesignSystemProvider tokens={geregeBrand}>
|
|
17
|
+
* <Card>...</Card>
|
|
18
|
+
* </DesignSystemProvider>
|
|
19
|
+
*/
|
|
20
|
+
export type BrandTokens = Record<string, string>;
|
|
21
|
+
export interface DesignSystemProviderProps extends HTMLAttributes<HTMLDivElement> {
|
|
22
|
+
/** Token overrides (CSS variable name → value). */
|
|
23
|
+
tokens?: BrandTokens;
|
|
24
|
+
/** Children to scope this brand to. */
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
}
|
|
27
|
+
export declare function DesignSystemProvider({ tokens, className, children, style, ...props }: DesignSystemProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
/**
|
|
29
|
+
* Built-in brand presets — drop-in starters showing how a token override
|
|
30
|
+
* map is shaped. Consumers can fork or replace any value.
|
|
31
|
+
*/
|
|
32
|
+
export declare const brandPresets: {
|
|
33
|
+
readonly default: BrandTokens;
|
|
34
|
+
/** Cool indigo accent, slightly rounder corners. */
|
|
35
|
+
readonly edgelog: {
|
|
36
|
+
readonly 'color-accent': "oklch(0.55 0.18 250)";
|
|
37
|
+
readonly 'color-accent-700': "oklch(0.46 0.16 250)";
|
|
38
|
+
readonly 'color-accent-800': "oklch(0.38 0.14 250)";
|
|
39
|
+
readonly 'color-accent-soft': "oklch(0.95 0.04 250)";
|
|
40
|
+
readonly 'radius-md': "8px";
|
|
41
|
+
readonly 'radius-lg': "12px";
|
|
42
|
+
};
|
|
43
|
+
/** Warm copper accent, tighter geometry. */
|
|
44
|
+
readonly gerege: {
|
|
45
|
+
readonly 'color-accent': "oklch(0.62 0.16 45)";
|
|
46
|
+
readonly 'color-accent-700': "oklch(0.54 0.16 45)";
|
|
47
|
+
readonly 'color-accent-800': "oklch(0.46 0.14 45)";
|
|
48
|
+
readonly 'color-accent-soft': "oklch(0.95 0.04 45)";
|
|
49
|
+
readonly 'radius-md': "4px";
|
|
50
|
+
readonly 'radius-lg': "6px";
|
|
51
|
+
};
|
|
52
|
+
/** Forest green accent. */
|
|
53
|
+
readonly forest: {
|
|
54
|
+
readonly 'color-accent': "oklch(0.55 0.14 155)";
|
|
55
|
+
readonly 'color-accent-700': "oklch(0.47 0.14 155)";
|
|
56
|
+
readonly 'color-accent-800': "oklch(0.39 0.12 155)";
|
|
57
|
+
readonly 'color-accent-soft': "oklch(0.95 0.04 155)";
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export type BrandName = keyof typeof brandPresets;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
export interface EmptyStateProps extends HTMLAttributes<HTMLDivElement> {
|
|
2
|
+
export interface EmptyStateProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
3
3
|
/** Visual marker — small Lucide icon or custom illustration. */
|
|
4
4
|
icon?: ReactNode;
|
|
5
5
|
/** Heading. One short sentence. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
export interface ErrorStateProps extends HTMLAttributes<HTMLDivElement> {
|
|
2
|
+
export interface ErrorStateProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
3
3
|
/** `404` not-found, `500` server, or `generic` (catch-all). */
|
|
4
4
|
variant?: '404' | '500' | 'generic';
|
|
5
5
|
/** Override the default title. */
|
|
@@ -34,10 +34,10 @@ interface InternalToast extends ToastDescriptor {
|
|
|
34
34
|
*/
|
|
35
35
|
export declare function useToast(): {
|
|
36
36
|
toasts: InternalToast[];
|
|
37
|
-
push: (t: ToastDescriptor) =>
|
|
38
|
-
dismiss: (id: string) =>
|
|
39
|
-
remove: (id: string) =>
|
|
37
|
+
push: (t: ToastDescriptor) => string;
|
|
38
|
+
dismiss: (id: string) => void;
|
|
39
|
+
remove: (id: string) => void;
|
|
40
40
|
};
|
|
41
41
|
/** Convenience export — dispatch a toast outside React (e.g. from an API client). */
|
|
42
|
-
export declare const toast: (t: ToastDescriptor) =>
|
|
42
|
+
export declare const toast: (t: ToastDescriptor) => string;
|
|
43
43
|
export {};
|