@crystallize/design-system 0.0.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/index.css +926 -0
- package/dist/index.d.ts +123 -0
- package/dist/index.js +1023 -0
- package/dist/index.mjs +981 -0
- package/package.json +73 -0
- package/src/action-menu/ActionMenu.stories.tsx +23 -0
- package/src/action-menu/action-item.tsx +24 -0
- package/src/action-menu/action-menu.tsx +37 -0
- package/src/action-menu/index.tsx +1 -0
- package/src/button/Button.stories.tsx +63 -0
- package/src/button/button.tsx +50 -0
- package/src/button/index.ts +3 -0
- package/src/button copy/ButtonCopy.stories.tsx +86 -0
- package/src/button copy/button.tsx +61 -0
- package/src/button copy/index.ts +3 -0
- package/src/card/card.stories.tsx +24 -0
- package/src/card/card.tsx +25 -0
- package/src/card/index.ts +1 -0
- package/src/colors/Colors.stories.mdx +33 -0
- package/src/dialog/Dialog.stories.tsx +165 -0
- package/src/dialog/config.tsx +134 -0
- package/src/dialog/confirm-dialog.tsx +59 -0
- package/src/dialog/destroyFns.ts +1 -0
- package/src/dialog/dialog.tsx +85 -0
- package/src/dialog/index.tsx +40 -0
- package/src/dialog/types.ts +38 -0
- package/src/dropdown-menu/DropdownMenu.stories.tsx +47 -0
- package/src/dropdown-menu/dropdown-menu-item.tsx +24 -0
- package/src/dropdown-menu/dropdown-menu-label.tsx +17 -0
- package/src/dropdown-menu/dropdown-menu-root.tsx +20 -0
- package/src/dropdown-menu/index.ts +9 -0
- package/src/icon-button/IconButton.stories.tsx +35 -0
- package/src/icon-button/icon-button.tsx +42 -0
- package/src/icon-button/index.ts +3 -0
- package/src/icons/Iconography.stories.mdx +45 -0
- package/src/icons/arrow.tsx +15 -0
- package/src/icons/cancel.tsx +26 -0
- package/src/icons/dots.tsx +24 -0
- package/src/icons/error.tsx +50 -0
- package/src/icons/glasses.tsx +62 -0
- package/src/icons/graphQL.tsx +90 -0
- package/src/icons/index.ts +21 -0
- package/src/icons/info.tsx +53 -0
- package/src/icons/nail-polish.tsx +84 -0
- package/src/icons/warning.tsx +62 -0
- package/src/index.css +3 -0
- package/src/index.ts +8 -0
- package/src/vite-env.d.ts +1 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode, ComponentPropsWithRef, RefAttributes } from 'react';
|
|
3
|
+
import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
6
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
7
|
+
|
|
8
|
+
declare type ItemProps = HTMLAttributes<HTMLLIElement> & {
|
|
9
|
+
onSelect?: () => void;
|
|
10
|
+
};
|
|
11
|
+
declare function Item({ children, className, onSelect }: ItemProps): JSX.Element;
|
|
12
|
+
|
|
13
|
+
declare type ActionMenuProps = {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
className?: string;
|
|
16
|
+
tabIndex?: number;
|
|
17
|
+
};
|
|
18
|
+
declare function ActionMenu({ children, className, tabIndex }: ActionMenuProps): JSX.Element;
|
|
19
|
+
declare namespace ActionMenu {
|
|
20
|
+
var Item: typeof Item;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
declare type ButtonStylesProps = VariantProps<typeof buttonStyles>;
|
|
24
|
+
declare const buttonStyles: (props?: ({
|
|
25
|
+
variant?: "primary" | "secondary" | "secondary-dark" | "danger" | null | undefined;
|
|
26
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
27
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
28
|
+
declare type ButtonProps = ComponentPropsWithRef<'button'> & ButtonStylesProps;
|
|
29
|
+
declare const Button: react.ForwardRefExoticComponent<Pick<ButtonProps, "key" | keyof react.ButtonHTMLAttributes<HTMLButtonElement> | "variant" | "size"> & react.RefAttributes<HTMLButtonElement>>;
|
|
30
|
+
|
|
31
|
+
declare type DialogFuncProps = {
|
|
32
|
+
afterClose?: () => void;
|
|
33
|
+
cancelText?: ReactNode;
|
|
34
|
+
className?: string;
|
|
35
|
+
closable?: boolean;
|
|
36
|
+
content?: ReactNode;
|
|
37
|
+
description?: ReactNode;
|
|
38
|
+
okCancel?: boolean;
|
|
39
|
+
okText?: ReactNode;
|
|
40
|
+
onCancel?: (...args: unknown[]) => void;
|
|
41
|
+
onEscapeKeyDown?: (event: Event) => void;
|
|
42
|
+
onInteractOutside?: (event: Event) => void;
|
|
43
|
+
onOk?: (...args: unknown[]) => void;
|
|
44
|
+
onPointerDownOutside?: (event: Event) => void;
|
|
45
|
+
open?: boolean;
|
|
46
|
+
prefixCls?: string;
|
|
47
|
+
title?: ReactNode;
|
|
48
|
+
type?: 'info' | 'error' | 'warning';
|
|
49
|
+
};
|
|
50
|
+
declare type ConfigUpdate = DialogFuncProps | ((prevConfig: DialogFuncProps) => DialogFuncProps);
|
|
51
|
+
|
|
52
|
+
declare type DialogContentStylesProps = VariantProps<typeof dialogContentStyles>;
|
|
53
|
+
declare const dialogContentStyles: (props?: ({
|
|
54
|
+
withIcon?: boolean | null | undefined;
|
|
55
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
56
|
+
declare type DialogContentProps = DialogContentStylesProps & {
|
|
57
|
+
children: ReactNode;
|
|
58
|
+
} & Pick<DialogFuncProps, 'onEscapeKeyDown' | 'onInteractOutside' | 'onPointerDownOutside' | 'closable' | 'type'>;
|
|
59
|
+
declare function DialogContent({ children, closable, type, ...delegated }: DialogContentProps): JSX.Element;
|
|
60
|
+
declare type DialogTitleProps = JSX.IntrinsicAttributes & DialogPrimitive.DialogTitleProps & RefAttributes<HTMLHeadingElement>;
|
|
61
|
+
declare function DialogTitle(delegated: DialogTitleProps): JSX.Element;
|
|
62
|
+
declare type DialogDescriptionProps = JSX.IntrinsicAttributes & DialogPrimitive.DialogDescriptionProps & RefAttributes<HTMLParagraphElement>;
|
|
63
|
+
declare function DialogDescription(delegated: DialogDescriptionProps): JSX.Element;
|
|
64
|
+
declare type DialogBaseProps = {
|
|
65
|
+
children: ReactNode;
|
|
66
|
+
};
|
|
67
|
+
declare function DialogBase({ children }: DialogBaseProps): JSX.Element;
|
|
68
|
+
declare namespace DialogBase {
|
|
69
|
+
var Title: typeof DialogTitle;
|
|
70
|
+
var Trigger: react.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & RefAttributes<HTMLButtonElement>>;
|
|
71
|
+
var Description: typeof DialogDescription;
|
|
72
|
+
var Content: typeof DialogContent;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
declare type DialogType = typeof DialogBase & DialogFuncProps;
|
|
76
|
+
declare const Dialog: DialogType;
|
|
77
|
+
declare function showDialog(delegated: DialogFuncProps): {
|
|
78
|
+
destroy: (...args: any[]) => void;
|
|
79
|
+
update: (configUpdate: ConfigUpdate) => void;
|
|
80
|
+
};
|
|
81
|
+
declare function showWarning(delegated: DialogFuncProps): {
|
|
82
|
+
destroy: (...args: any[]) => void;
|
|
83
|
+
update: (configUpdate: ConfigUpdate) => void;
|
|
84
|
+
};
|
|
85
|
+
declare function showConfirm(delegated: DialogFuncProps): {
|
|
86
|
+
destroy: (...args: any[]) => void;
|
|
87
|
+
update: (configUpdate: ConfigUpdate) => void;
|
|
88
|
+
};
|
|
89
|
+
declare function showError(delegated: DialogFuncProps): {
|
|
90
|
+
destroy: (...args: any[]) => void;
|
|
91
|
+
update: (configUpdate: ConfigUpdate) => void;
|
|
92
|
+
};
|
|
93
|
+
declare function showInfo(delegated: DialogFuncProps): {
|
|
94
|
+
destroy: (...args: any[]) => void;
|
|
95
|
+
update: (configUpdate: ConfigUpdate) => void;
|
|
96
|
+
};
|
|
97
|
+
declare function destroyAll(): void;
|
|
98
|
+
|
|
99
|
+
declare type DropdownMenuRootProps = {
|
|
100
|
+
children: ReactNode;
|
|
101
|
+
content: ReactNode;
|
|
102
|
+
alignContent?: 'start' | 'center' | 'end';
|
|
103
|
+
onOpenChange: (isOpen: boolean) => void;
|
|
104
|
+
};
|
|
105
|
+
declare function DropdownMenuRoot({ children, content, onOpenChange, alignContent }: DropdownMenuRootProps): JSX.Element;
|
|
106
|
+
|
|
107
|
+
declare type DropdownMenuItemProps = DropdownMenuPrimitive.MenuItemProps & {
|
|
108
|
+
children: ReactNode;
|
|
109
|
+
};
|
|
110
|
+
declare function DropdownMenuItem({ children, className, ...delegated }: DropdownMenuItemProps): JSX.Element;
|
|
111
|
+
|
|
112
|
+
declare type DropdownMenuLabelProps = {
|
|
113
|
+
children: ReactNode;
|
|
114
|
+
};
|
|
115
|
+
declare function DropdownMenuLabel({ children }: DropdownMenuLabelProps): JSX.Element;
|
|
116
|
+
|
|
117
|
+
declare const DropdownMenu: {
|
|
118
|
+
Root: typeof DropdownMenuRoot;
|
|
119
|
+
Item: typeof DropdownMenuItem;
|
|
120
|
+
Label: typeof DropdownMenuLabel;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export { ActionMenu, Button, ButtonProps, Dialog, DropdownMenu, destroyAll, showConfirm, showDialog, showError, showInfo, showWarning };
|