@jordan-mace/chaser-design-system 2.1.2 → 2.2.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/build-manifest.json +3311 -1978
- package/dist/{chunk-DGP64SMQ.mjs → chunk-5EXQ5OSW.mjs} +1 -1
- package/dist/{chunk-HIODYNPY.mjs → chunk-CGKVSHV7.mjs} +0 -1
- package/dist/{chunk-VXRFKQMB.mjs → chunk-CJ5OBPQ7.mjs} +1 -0
- package/dist/{chunk-D62WZ7PJ.mjs → chunk-DLVBLJS5.mjs} +1 -1
- package/dist/{chunk-3AD3E4FY.mjs → chunk-GJTMCP2V.mjs} +1 -4
- package/dist/{chunk-HOWN3CZF.mjs → chunk-GWMUTYRW.mjs} +1 -1
- package/dist/{chunk-DB7I3V3C.mjs → chunk-P6ITY5TK.mjs} +0 -1
- package/dist/{chunk-HG3TXGUV.mjs → chunk-WBE75WTG.mjs} +1 -2
- package/dist/{chunk-P6A62GCQ.mjs → chunk-WV2TDE35.mjs} +1 -4
- package/dist/{chunk-IU6IODBX.mjs → chunk-YKUJ2KUN.mjs} +1 -1
- package/dist/{chunk-KVXPG4QT.mjs → chunk-ZT5III36.mjs} +0 -1
- package/dist/components/Accordion/Accordion.mjs +3 -1
- package/dist/components/Accordion/Accordion.types.mjs +0 -0
- package/dist/components/Accordion/index.mjs +4 -2
- package/dist/components/Alert/Alert.types.mjs +0 -0
- package/dist/components/AspectRatio/AspectRatio.types.mjs +0 -0
- package/dist/components/Avatar/Avatar.types.mjs +0 -0
- package/dist/components/Badge/Badge.mjs +1 -1
- package/dist/components/Badge/Badge.types.mjs +0 -0
- package/dist/components/Badge/index.mjs +1 -1
- package/dist/components/Box/Box.types.mjs +0 -0
- package/dist/components/Breadcrumb/Breadcrumb.mjs +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.types.mjs +0 -0
- package/dist/components/Breadcrumb/index.mjs +1 -1
- package/dist/components/Button/Button.types.mjs +0 -0
- package/dist/components/Card/Card.types.mjs +0 -0
- package/dist/components/Checkbox/Checkbox.types.mjs +0 -0
- package/dist/components/Collapse/Collapse.mjs +1 -1
- package/dist/components/Collapse/Collapse.types.mjs +0 -0
- package/dist/components/Collapse/index.mjs +1 -1
- package/dist/components/Combobox/Combobox.mjs +1 -1
- package/dist/components/Combobox/Combobox.types.mjs +0 -0
- package/dist/components/Combobox/index.mjs +1 -1
- package/dist/components/Container/Container.types.mjs +0 -0
- package/dist/components/Divider/Divider.mjs +1 -1
- package/dist/components/Divider/Divider.types.mjs +0 -0
- package/dist/components/Divider/index.mjs +1 -1
- package/dist/components/Drawer/Drawer.types.mjs +0 -0
- package/dist/components/DropdownMenu/DropdownMenu.types.mjs +0 -0
- package/dist/components/EmptyState/EmptyState.types.mjs +0 -0
- package/dist/components/FileUpload/FileUpload.mjs +1 -1
- package/dist/components/FileUpload/FileUpload.types.mjs +0 -0
- package/dist/components/FileUpload/index.mjs +1 -1
- package/dist/components/Form/Form.types.mjs +0 -0
- package/dist/components/Form/FormInput.mjs +38 -38
- package/dist/components/Form/FormInput.types.mjs +0 -0
- package/dist/components/Form/index.mjs +38 -38
- package/dist/components/Grid/Grid.types.mjs +0 -0
- package/dist/components/Icon/Icon.types.mjs +0 -0
- package/dist/components/Input/Input.types.mjs +0 -0
- package/dist/components/Kbd/Kbd.types.mjs +0 -0
- package/dist/components/List/List.mjs +1 -1
- package/dist/components/List/List.types.mjs +0 -0
- package/dist/components/List/ListItem.mjs +1 -1
- package/dist/components/List/ListItem.types.mjs +0 -0
- package/dist/components/List/index.mjs +2 -2
- package/dist/components/Modal/Modal.types.mjs +0 -0
- package/dist/components/Navbar/Navbar.types.mjs +0 -0
- package/dist/components/Navbar/NavbarItem.types.mjs +0 -0
- package/dist/components/Navbar/index.mjs +3 -3
- package/dist/components/NumberInput/NumberInput.types.mjs +0 -0
- package/dist/components/Pagination/Pagination.types.mjs +0 -0
- package/dist/components/Popover/Popover.types.mjs +0 -0
- package/dist/components/Progress/Progress.types.mjs +0 -0
- package/dist/components/Radio/Radio.types.mjs +0 -0
- package/dist/components/ScrollArea/ScrollArea.types.mjs +0 -0
- package/dist/components/Select/Select.mjs +1 -1
- package/dist/components/Select/Select.types.mjs +0 -0
- package/dist/components/Select/index.mjs +1 -1
- package/dist/components/Separator/Separator.types.mjs +0 -0
- package/dist/components/Skeleton/Skeleton.types.mjs +0 -0
- package/dist/components/Spinner/Spinner.types.mjs +0 -0
- package/dist/components/Stack/Stack.types.mjs +0 -0
- package/dist/components/Stepper/Stepper.types.mjs +0 -0
- package/dist/components/Table/Table.types.mjs +0 -0
- package/dist/components/Tabs/Tabs.types.mjs +0 -0
- package/dist/components/Tag/Tag.types.mjs +0 -0
- package/dist/components/Text/Text.types.mjs +0 -0
- package/dist/components/TextArea/TextArea.types.mjs +0 -0
- package/dist/components/Toast/Toast.mjs +1 -1
- package/dist/components/Toast/Toast.types.mjs +0 -0
- package/dist/components/Toast/index.mjs +1 -1
- package/dist/components/Toggle/Toggle.types.mjs +0 -0
- package/dist/components/Tooltip/Tooltip.types.mjs +0 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.types.mjs +0 -0
- package/dist/components/index.mjs +65 -65
- package/dist/index.core.mjs +65 -65
- package/package.json +1 -1
- package/src/components/Accordion/Accordion.tsx +7 -22
- package/src/components/Accordion/Accordion.types.ts +21 -0
- package/src/components/Accordion/index.ts +2 -1
- package/src/components/Alert/Alert.tsx +1 -9
- package/src/components/Alert/Alert.types.ts +12 -0
- package/src/components/AspectRatio/AspectRatio.tsx +2 -8
- package/src/components/AspectRatio/AspectRatio.types.ts +9 -0
- package/src/components/Avatar/Avatar.tsx +1 -10
- package/src/components/Avatar/Avatar.types.ts +13 -0
- package/src/components/Badge/Badge.tsx +1 -13
- package/src/components/Badge/Badge.types.ts +13 -0
- package/src/components/Box/Box.tsx +2 -8
- package/src/components/Box/Box.types.ts +9 -0
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +0 -2
- package/src/components/Breadcrumb/Breadcrumb.tsx +1 -14
- package/src/components/Breadcrumb/Breadcrumb.types.ts +14 -0
- package/src/components/Button/Button.tsx +1 -9
- package/src/components/Button/Button.types.ts +12 -0
- package/src/components/Card/Card.tsx +1 -8
- package/src/components/Card/Card.types.ts +12 -0
- package/src/components/Checkbox/Checkbox.tsx +1 -7
- package/src/components/Checkbox/Checkbox.types.ts +8 -0
- package/src/components/Collapse/Collapse.stories.tsx +0 -2
- package/src/components/Collapse/Collapse.tsx +2 -14
- package/src/components/Collapse/Collapse.types.ts +13 -0
- package/src/components/Collapse/styles.css.ts +1 -2
- package/src/components/Combobox/Combobox.stories.tsx +1 -1
- package/src/components/Combobox/Combobox.tsx +2 -28
- package/src/components/Combobox/Combobox.types.ts +28 -0
- package/src/components/Combobox/styles.css.ts +1 -1
- package/src/components/Container/Container.tsx +1 -11
- package/src/components/Container/Container.types.ts +12 -0
- package/src/components/Divider/Divider.tsx +1 -11
- package/src/components/Divider/Divider.types.ts +11 -0
- package/src/components/Drawer/Drawer.tsx +1 -18
- package/src/components/Drawer/Drawer.types.ts +19 -0
- package/src/components/Drawer/styles.css.ts +1 -1
- package/src/components/DropdownMenu/DropdownMenu.tsx +5 -30
- package/src/components/DropdownMenu/DropdownMenu.types.ts +31 -0
- package/src/components/DropdownMenu/styles.css.ts +1 -1
- package/src/components/EmptyState/EmptyState.tsx +1 -9
- package/src/components/EmptyState/EmptyState.types.ts +10 -0
- package/src/components/EmptyState/styles.css.ts +1 -1
- package/src/components/FileUpload/FileUpload.stories.tsx +1 -1
- package/src/components/FileUpload/FileUpload.tsx +2 -30
- package/src/components/FileUpload/FileUpload.types.ts +31 -0
- package/src/components/FileUpload/styles.css.ts +1 -1
- package/src/components/Form/Form.stories.tsx +0 -4
- package/src/components/Form/Form.tsx +1 -6
- package/src/components/Form/Form.types.ts +7 -0
- package/src/components/Form/FormInput.tsx +1 -3
- package/src/components/Form/FormInput.types.ts +4 -0
- package/src/components/Grid/Grid.tsx +1 -12
- package/src/components/Grid/Grid.types.ts +13 -0
- package/src/components/Icon/Icon.tsx +1 -8
- package/src/components/Icon/Icon.types.ts +9 -0
- package/src/components/Icon/styles.css.ts +1 -1
- package/src/components/Input/Input.stories.tsx +0 -3
- package/src/components/Input/Input.tsx +1 -7
- package/src/components/Input/Input.types.ts +8 -0
- package/src/components/Input/index.ts +1 -0
- package/src/components/Kbd/Kbd.tsx +1 -6
- package/src/components/Kbd/Kbd.types.ts +7 -0
- package/src/components/Kbd/styles.css.ts +1 -1
- package/src/components/List/List.tsx +2 -5
- package/src/components/List/List.types.ts +6 -0
- package/src/components/List/ListItem.tsx +2 -5
- package/src/components/List/ListItem.types.ts +6 -0
- package/src/components/Modal/Modal.tsx +1 -15
- package/src/components/Modal/Modal.types.ts +16 -0
- package/src/components/Navbar/Navbar.stories.tsx +0 -3
- package/src/components/Navbar/Navbar.tsx +1 -5
- package/src/components/Navbar/Navbar.types.ts +6 -0
- package/src/components/Navbar/NavbarItem.tsx +1 -5
- package/src/components/Navbar/NavbarItem.types.ts +6 -0
- package/src/components/NumberInput/NumberInput.stories.tsx +1 -1
- package/src/components/NumberInput/NumberInput.tsx +1 -24
- package/src/components/NumberInput/NumberInput.types.ts +25 -0
- package/src/components/NumberInput/styles.css.ts +1 -1
- package/src/components/Pagination/Pagination.stories.tsx +0 -2
- package/src/components/Pagination/Pagination.tsx +1 -11
- package/src/components/Pagination/Pagination.types.ts +12 -0
- package/src/components/Popover/Popover.stories.tsx +0 -2
- package/src/components/Popover/Popover.tsx +1 -27
- package/src/components/Popover/Popover.types.ts +28 -0
- package/src/components/Popover/styles.css.ts +1 -1
- package/src/components/Progress/Progress.stories.tsx +0 -2
- package/src/components/Progress/Progress.tsx +1 -10
- package/src/components/Progress/Progress.types.ts +13 -0
- package/src/components/Radio/Radio.tsx +5 -25
- package/src/components/Radio/Radio.types.ts +28 -0
- package/src/components/ScrollArea/ScrollArea.tsx +1 -11
- package/src/components/ScrollArea/ScrollArea.types.ts +12 -0
- package/src/components/ScrollArea/styles.css.ts +1 -1
- package/src/components/Select/Select.stories.tsx +0 -2
- package/src/components/Select/Select.tsx +2 -16
- package/src/components/Select/Select.types.ts +16 -0
- package/src/components/Select/styles.css.ts +1 -1
- package/src/components/Separator/Separator.tsx +1 -9
- package/src/components/Separator/Separator.types.ts +10 -0
- package/src/components/Separator/styles.css.ts +1 -1
- package/src/components/Skeleton/Skeleton.tsx +1 -15
- package/src/components/Skeleton/Skeleton.types.ts +16 -0
- package/src/components/Skeleton/styles.css.ts +1 -1
- package/src/components/Spinner/Spinner.tsx +1 -17
- package/src/components/Spinner/Spinner.types.ts +18 -0
- package/src/components/Stack/Stack.tsx +1 -21
- package/src/components/Stack/Stack.types.ts +23 -0
- package/src/components/Stepper/Stepper.stories.tsx +1 -1
- package/src/components/Stepper/Stepper.tsx +1 -20
- package/src/components/Stepper/Stepper.types.ts +21 -0
- package/src/components/Stepper/styles.css.ts +1 -1
- package/src/components/Table/Table.tsx +9 -40
- package/src/components/Table/Table.types.ts +40 -0
- package/src/components/Tabs/Tabs.tsx +7 -33
- package/src/components/Tabs/Tabs.types.ts +36 -0
- package/src/components/Tag/Tag.tsx +1 -14
- package/src/components/Tag/Tag.types.ts +17 -0
- package/src/components/Text/Header.tsx +1 -7
- package/src/components/Text/P.stories.tsx +0 -2
- package/src/components/Text/P.tsx +1 -6
- package/src/components/Text/Text.types.ts +15 -0
- package/src/components/TextArea/TextArea.stories.tsx +0 -2
- package/src/components/TextArea/TextArea.tsx +1 -7
- package/src/components/TextArea/TextArea.types.ts +8 -0
- package/src/components/Toast/Toast.tsx +13 -59
- package/src/components/Toast/Toast.types.ts +58 -0
- package/src/components/Toggle/Toggle.tsx +1 -14
- package/src/components/Toggle/Toggle.types.ts +15 -0
- package/src/components/Tooltip/Tooltip.tsx +1 -11
- package/src/components/Tooltip/Tooltip.types.ts +12 -0
- package/src/components/VisuallyHidden/VisuallyHidden.tsx +1 -6
- package/src/components/VisuallyHidden/VisuallyHidden.types.ts +7 -0
- package/src/components/VisuallyHidden/styles.css.ts +1 -1
- package/src/components/index.ts +96 -21
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Sprinkles } from '../../styles/sprinkles.css';
|
|
3
|
+
|
|
4
|
+
export type DropdownMenuPosition =
|
|
5
|
+
| 'bottomLeft'
|
|
6
|
+
| 'bottomRight'
|
|
7
|
+
| 'topLeft'
|
|
8
|
+
| 'topRight';
|
|
9
|
+
export type DropdownMenuItemVariant = 'default' | 'destructive' | 'disabled';
|
|
10
|
+
|
|
11
|
+
export interface DropdownMenuItemProps {
|
|
12
|
+
label: string;
|
|
13
|
+
onClick?: () => void;
|
|
14
|
+
variant?: DropdownMenuItemVariant;
|
|
15
|
+
icon?: React.ReactNode;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface DropdownMenuGroupProps {
|
|
20
|
+
label?: string;
|
|
21
|
+
items: DropdownMenuItemProps[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type DropdownMenuProps = React.HTMLAttributes<HTMLDivElement> &
|
|
25
|
+
Sprinkles & {
|
|
26
|
+
trigger: React.ReactNode;
|
|
27
|
+
items?: DropdownMenuItemProps[];
|
|
28
|
+
groups?: DropdownMenuGroupProps[];
|
|
29
|
+
position?: DropdownMenuPosition;
|
|
30
|
+
closeOnItemClick?: boolean;
|
|
31
|
+
};
|
|
@@ -8,15 +8,7 @@ import {
|
|
|
8
8
|
emptyStateAction,
|
|
9
9
|
} from './styles.css';
|
|
10
10
|
import Box from '../Box';
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
export type EmptyStateProps = React.HTMLAttributes<HTMLDivElement> &
|
|
14
|
-
Sprinkles & {
|
|
15
|
-
icon?: React.ReactNode;
|
|
16
|
-
title?: string;
|
|
17
|
-
description?: string;
|
|
18
|
-
action?: React.ReactNode;
|
|
19
|
-
};
|
|
11
|
+
import { type EmptyStateProps } from './EmptyState.types';
|
|
20
12
|
|
|
21
13
|
const EmptyState = ({
|
|
22
14
|
icon,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Sprinkles } from '../../styles/sprinkles.css';
|
|
3
|
+
|
|
4
|
+
export type EmptyStateProps = React.HTMLAttributes<HTMLDivElement> &
|
|
5
|
+
Sprinkles & {
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
title?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
action?: React.ReactNode;
|
|
10
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
|
-
import
|
|
2
|
+
import { useState, useRef, useCallback } from 'react';
|
|
3
3
|
import {
|
|
4
4
|
fileUploadContainer,
|
|
5
5
|
fileUploadDropzone,
|
|
@@ -21,34 +21,7 @@ import {
|
|
|
21
21
|
fileUploadProgressFillVariants,
|
|
22
22
|
} from './styles.css';
|
|
23
23
|
import Box from '../Box';
|
|
24
|
-
import {
|
|
25
|
-
|
|
26
|
-
export interface FileUploadFile {
|
|
27
|
-
id: string;
|
|
28
|
-
file: File;
|
|
29
|
-
name: string;
|
|
30
|
-
size: number;
|
|
31
|
-
progress: number;
|
|
32
|
-
status: 'uploading' | 'success' | 'error';
|
|
33
|
-
errorMessage?: string;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export type FileUploadProps = React.HTMLAttributes<HTMLDivElement> &
|
|
37
|
-
Sprinkles & {
|
|
38
|
-
label?: string;
|
|
39
|
-
files?: FileUploadFile[];
|
|
40
|
-
onFilesChange?: (files: FileUploadFile[]) => void;
|
|
41
|
-
onFileAdd?: (files: File[]) => void;
|
|
42
|
-
onFileRemove?: (fileId: string) => void;
|
|
43
|
-
accept?: string;
|
|
44
|
-
multiple?: boolean;
|
|
45
|
-
maxFileSize?: number;
|
|
46
|
-
maxFiles?: number;
|
|
47
|
-
disabled?: boolean;
|
|
48
|
-
dropzoneText?: string;
|
|
49
|
-
hint?: string;
|
|
50
|
-
showProgress?: boolean;
|
|
51
|
-
};
|
|
24
|
+
import { type FileUploadProps } from './FileUpload.types';
|
|
52
25
|
|
|
53
26
|
const formatFileSize = (bytes: number): string => {
|
|
54
27
|
if (bytes === 0) return '0 Bytes';
|
|
@@ -61,7 +34,6 @@ const formatFileSize = (bytes: number): string => {
|
|
|
61
34
|
const FileUpload = ({
|
|
62
35
|
label,
|
|
63
36
|
files = [],
|
|
64
|
-
onFilesChange,
|
|
65
37
|
onFileAdd,
|
|
66
38
|
onFileRemove,
|
|
67
39
|
accept,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Sprinkles } from '../../styles/sprinkles.css';
|
|
3
|
+
|
|
4
|
+
export type FileUploadStatus = 'uploading' | 'success' | 'error';
|
|
5
|
+
|
|
6
|
+
export interface FileUploadFile {
|
|
7
|
+
id: string;
|
|
8
|
+
file: File;
|
|
9
|
+
name: string;
|
|
10
|
+
size: number;
|
|
11
|
+
progress: number;
|
|
12
|
+
status: FileUploadStatus;
|
|
13
|
+
errorMessage?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type FileUploadProps = React.HTMLAttributes<HTMLDivElement> &
|
|
17
|
+
Sprinkles & {
|
|
18
|
+
label?: string;
|
|
19
|
+
files?: FileUploadFile[];
|
|
20
|
+
onFilesChange?: (files: FileUploadFile[]) => void;
|
|
21
|
+
onFileAdd?: (files: File[]) => void;
|
|
22
|
+
onFileRemove?: (fileId: string) => void;
|
|
23
|
+
accept?: string;
|
|
24
|
+
multiple?: boolean;
|
|
25
|
+
maxFileSize?: number;
|
|
26
|
+
maxFiles?: number;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
dropzoneText?: string;
|
|
29
|
+
hint?: string;
|
|
30
|
+
showProgress?: boolean;
|
|
31
|
+
};
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
|
|
3
|
-
import { fn } from 'storybook/test';
|
|
4
|
-
|
|
5
3
|
import { Form } from '.';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import { Input } from '../Input';
|
|
8
4
|
import FormInput from './FormInput';
|
|
9
5
|
|
|
10
6
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
@@ -2,12 +2,7 @@ import clsx from 'clsx';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { formStyle } from './styles.css';
|
|
4
4
|
import Box from '../Box';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
type FormProps = React.FormHTMLAttributes<HTMLFormElement> &
|
|
8
|
-
Sprinkles & {
|
|
9
|
-
children?: React.ReactNode;
|
|
10
|
-
};
|
|
5
|
+
import { type FormProps } from './Form.types';
|
|
11
6
|
|
|
12
7
|
const Form = (props: FormProps) => {
|
|
13
8
|
return (
|
|
@@ -2,10 +2,8 @@ import clsx from 'clsx';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { formInputStyle } from './styles.css';
|
|
4
4
|
import { Input } from '../..';
|
|
5
|
-
import { InputProps } from '../Input/Input';
|
|
6
5
|
import Box from '../Box';
|
|
7
|
-
|
|
8
|
-
type FormInputProps = React.InputHTMLAttributes<HTMLInputElement> & InputProps;
|
|
6
|
+
import { type FormInputProps } from './FormInput.types';
|
|
9
7
|
|
|
10
8
|
const FormInput = (props: FormInputProps) => {
|
|
11
9
|
return (
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import Box from '../Box';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export type GridColumns = 1 | 2 | 3 | 4 | 5 | 6 | 12;
|
|
6
|
-
export type GridGap = 'none' | 'small' | 'medium' | 'large';
|
|
7
|
-
|
|
8
|
-
export type GridProps = React.HTMLAttributes<HTMLDivElement> &
|
|
9
|
-
Sprinkles & {
|
|
10
|
-
columns?: GridColumns;
|
|
11
|
-
gap?: GridGap;
|
|
12
|
-
minChildWidth?: string;
|
|
13
|
-
children?: React.ReactNode;
|
|
14
|
-
};
|
|
3
|
+
import { type GridProps, type GridGap } from './Grid.types';
|
|
15
4
|
|
|
16
5
|
const gapMap: Record<GridGap, string> = {
|
|
17
6
|
none: '0',
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Sprinkles } from '../../styles/sprinkles.css';
|
|
3
|
+
|
|
4
|
+
export type GridColumns = 1 | 2 | 3 | 4 | 5 | 6 | 12;
|
|
5
|
+
export type GridGap = 'none' | 'small' | 'medium' | 'large';
|
|
6
|
+
|
|
7
|
+
export type GridProps = React.HTMLAttributes<HTMLDivElement> &
|
|
8
|
+
Sprinkles & {
|
|
9
|
+
columns?: GridColumns;
|
|
10
|
+
gap?: GridGap;
|
|
11
|
+
minChildWidth?: string;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
};
|
|
@@ -2,14 +2,7 @@ import clsx from 'clsx';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { icon } from './styles.css';
|
|
4
4
|
import Box from '../Box';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
type IconProps = React.HTMLAttributes<HTMLSpanElement> &
|
|
8
|
-
Sprinkles & {
|
|
9
|
-
name?: string;
|
|
10
|
-
children?: React.ReactNode;
|
|
11
|
-
color?: string;
|
|
12
|
-
};
|
|
5
|
+
import { type IconProps } from './Icon.types';
|
|
13
6
|
|
|
14
7
|
const IconComponent = ({ name, children, className, color }: IconProps) => {
|
|
15
8
|
const iconMap: Record<string, string> = {
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
|
|
3
|
-
import { fn } from 'storybook/test';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
|
|
6
3
|
import { Input } from '.';
|
|
7
4
|
|
|
8
5
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
@@ -3,13 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { inputStyle, label } from './styles.css';
|
|
4
4
|
import { text } from '../Text/styles.css';
|
|
5
5
|
import Box from '../Box';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
export type InputProps = React.InputHTMLAttributes<HTMLInputElement> &
|
|
9
|
-
Sprinkles & {
|
|
10
|
-
label?: string;
|
|
11
|
-
fullWidth?: boolean;
|
|
12
|
-
};
|
|
6
|
+
import { type InputProps } from './Input.types';
|
|
13
7
|
|
|
14
8
|
const Input = (props: InputProps) => {
|
|
15
9
|
return (
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { kbd } from './styles.css';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export type KbdProps = React.HTMLAttributes<HTMLElement> &
|
|
6
|
-
Sprinkles & {
|
|
7
|
-
children: React.ReactNode;
|
|
8
|
-
};
|
|
3
|
+
import { type KbdProps } from './Kbd.types';
|
|
9
4
|
|
|
10
5
|
const Kbd = ({ children, className, ...props }: KbdProps) => {
|
|
11
6
|
return (
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { list } from './styles.css';
|
|
3
3
|
import Box from '../Box';
|
|
4
|
-
import {
|
|
4
|
+
import { type ListProps } from './List.types';
|
|
5
5
|
|
|
6
|
-
const List = ({
|
|
7
|
-
children,
|
|
8
|
-
...props
|
|
9
|
-
}: { children: React.ReactNode } & Sprinkles) => {
|
|
6
|
+
const List = ({ children, ...props }: ListProps) => {
|
|
10
7
|
return (
|
|
11
8
|
<Box as="ul" className={list} {...props}>
|
|
12
9
|
{children}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { listItem } from './styles.css';
|
|
3
3
|
import Box from '../Box';
|
|
4
|
-
import {
|
|
4
|
+
import { type ListItemProps } from './ListItem.types';
|
|
5
5
|
|
|
6
|
-
const ListItem = ({
|
|
7
|
-
children,
|
|
8
|
-
...props
|
|
9
|
-
}: { children: React.ReactNode } & Sprinkles) => {
|
|
6
|
+
const ListItem = ({ children, ...props }: ListItemProps) => {
|
|
10
7
|
return (
|
|
11
8
|
<Box as="li" className={listItem} {...props}>
|
|
12
9
|
{children}
|
|
@@ -10,21 +10,7 @@ import {
|
|
|
10
10
|
} from './styles.css';
|
|
11
11
|
import React, { useEffect, useRef } from 'react';
|
|
12
12
|
import Box from '../Box';
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
export type ModalSize = 'small' | 'medium' | 'large' | 'full';
|
|
16
|
-
|
|
17
|
-
type ModalPropsType = React.HTMLAttributes<HTMLDialogElement> & {
|
|
18
|
-
isOpen: boolean;
|
|
19
|
-
onClose: () => void;
|
|
20
|
-
title?: string;
|
|
21
|
-
size?: ModalSize;
|
|
22
|
-
children?: React.ReactNode;
|
|
23
|
-
footer?: React.ReactNode;
|
|
24
|
-
showCloseButton?: boolean;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export type ModalProps = ModalPropsType & Sprinkles;
|
|
13
|
+
import { type ModalProps } from './Modal.types';
|
|
28
14
|
|
|
29
15
|
interface DialogMethods {
|
|
30
16
|
showModal: () => void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Sprinkles } from '../../styles/sprinkles.css';
|
|
3
|
+
|
|
4
|
+
export type ModalSize = 'small' | 'medium' | 'large' | 'full';
|
|
5
|
+
|
|
6
|
+
type ModalPropsType = React.HTMLAttributes<HTMLDialogElement> & {
|
|
7
|
+
isOpen: boolean;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
title?: string;
|
|
10
|
+
size?: ModalSize;
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
footer?: React.ReactNode;
|
|
13
|
+
showCloseButton?: boolean;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type ModalProps = ModalPropsType & Sprinkles;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
|
|
3
|
-
import { fn } from 'storybook/test';
|
|
4
|
-
|
|
5
3
|
import { Navbar, NavbarItem } from './';
|
|
6
|
-
import React from 'react';
|
|
7
4
|
import { P } from '../Text';
|
|
8
5
|
|
|
9
6
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
@@ -2,11 +2,7 @@ import clsx from 'clsx';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { navbarStyle } from './styles.css';
|
|
4
4
|
import Box from '../Box';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
type NavbarProps = React.HTMLAttributes<HTMLElement> & Sprinkles & {
|
|
8
|
-
children?: React.ReactNode;
|
|
9
|
-
};
|
|
5
|
+
import { type NavbarProps } from './Navbar.types';
|
|
10
6
|
|
|
11
7
|
const Navbar = (props: NavbarProps) => {
|
|
12
8
|
return (
|
|
@@ -2,11 +2,7 @@ import clsx from 'clsx';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { navbarItemStyle } from './styles.css';
|
|
4
4
|
import Box from '../Box';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
type NavbarItemProps = React.HTMLAttributes<HTMLDivElement> & Sprinkles & {
|
|
8
|
-
children?: React.ReactNode;
|
|
9
|
-
};
|
|
5
|
+
import { type NavbarItemProps } from './NavbarItem.types';
|
|
10
6
|
|
|
11
7
|
const NavbarItem = (props: NavbarItemProps) => {
|
|
12
8
|
return <Box as="div" className={clsx(navbarItemStyle, props.className)} {...props} />;
|
|
@@ -13,30 +13,7 @@ import {
|
|
|
13
13
|
numberInputErrorMessage,
|
|
14
14
|
} from './styles.css';
|
|
15
15
|
import Box from '../Box';
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
export type NumberInputPosition = 'right' | 'left';
|
|
19
|
-
|
|
20
|
-
export type NumberInputProps = Omit<
|
|
21
|
-
React.InputHTMLAttributes<HTMLInputElement>,
|
|
22
|
-
'onChange' | 'value' | 'min' | 'max'
|
|
23
|
-
> &
|
|
24
|
-
Sprinkles & {
|
|
25
|
-
label?: string;
|
|
26
|
-
value?: number | '';
|
|
27
|
-
onChange?: (value: number | '') => void;
|
|
28
|
-
min?: number;
|
|
29
|
-
max?: number;
|
|
30
|
-
step?: number;
|
|
31
|
-
stepperPosition?: NumberInputPosition;
|
|
32
|
-
placeholder?: string;
|
|
33
|
-
hint?: string;
|
|
34
|
-
error?: boolean;
|
|
35
|
-
errorMessage?: string;
|
|
36
|
-
fullWidth?: boolean;
|
|
37
|
-
disabled?: boolean;
|
|
38
|
-
allowEmpty?: boolean;
|
|
39
|
-
};
|
|
16
|
+
import { type NumberInputProps } from './NumberInput.types';
|
|
40
17
|
|
|
41
18
|
const NumberInput = ({
|
|
42
19
|
label,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Sprinkles } from '../../styles/sprinkles.css';
|
|
3
|
+
|
|
4
|
+
export type NumberInputPosition = 'right' | 'left';
|
|
5
|
+
|
|
6
|
+
export type NumberInputProps = Omit<
|
|
7
|
+
React.InputHTMLAttributes<HTMLInputElement>,
|
|
8
|
+
'onChange' | 'value' | 'min' | 'max'
|
|
9
|
+
> &
|
|
10
|
+
Sprinkles & {
|
|
11
|
+
label?: string;
|
|
12
|
+
value?: number | '';
|
|
13
|
+
onChange?: (value: number | '') => void;
|
|
14
|
+
min?: number;
|
|
15
|
+
max?: number;
|
|
16
|
+
step?: number;
|
|
17
|
+
stepperPosition?: NumberInputPosition;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
hint?: string;
|
|
20
|
+
error?: boolean;
|
|
21
|
+
errorMessage?: string;
|
|
22
|
+
fullWidth?: boolean;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
allowEmpty?: boolean;
|
|
25
|
+
};
|
|
@@ -7,17 +7,7 @@ import {
|
|
|
7
7
|
ellipsis,
|
|
8
8
|
} from './styles.css';
|
|
9
9
|
import Box from '../Box';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
export type PaginationProps = React.HTMLAttributes<HTMLDivElement> &
|
|
13
|
-
Sprinkles & {
|
|
14
|
-
currentPage: number;
|
|
15
|
-
totalPages: number;
|
|
16
|
-
onPageChange: (page: number) => void;
|
|
17
|
-
siblingCount?: number;
|
|
18
|
-
showFirstLast?: boolean;
|
|
19
|
-
showPrevNext?: boolean;
|
|
20
|
-
};
|
|
10
|
+
import { type PaginationProps } from './Pagination.types';
|
|
21
11
|
|
|
22
12
|
const Pagination = ({
|
|
23
13
|
currentPage,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Sprinkles } from '../../styles/sprinkles.css';
|
|
3
|
+
|
|
4
|
+
export type PaginationProps = React.HTMLAttributes<HTMLDivElement> &
|
|
5
|
+
Sprinkles & {
|
|
6
|
+
currentPage: number;
|
|
7
|
+
totalPages: number;
|
|
8
|
+
onPageChange: (page: number) => void;
|
|
9
|
+
siblingCount?: number;
|
|
10
|
+
showFirstLast?: boolean;
|
|
11
|
+
showPrevNext?: boolean;
|
|
12
|
+
};
|