ownui-system 0.1.10 → 1.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/README.md +49 -67
- package/dist/components/Accordion/Accordion.stories.d.ts +3 -2
- package/dist/components/Accordion/accordion-body.d.ts +0 -1
- package/dist/components/Accordion/accordion-context.d.ts +2 -3
- package/dist/components/Accordion/accordion-header.d.ts +0 -1
- package/dist/components/Accordion/accordion-item.d.ts +0 -1
- package/dist/components/Accordion/accordion.d.ts +4 -4
- package/dist/components/Accordion/index.d.ts +2 -1
- package/dist/components/Badge/Badge.stories.d.ts +3 -2
- package/dist/components/Badge/Badge.style.d.ts +7 -26
- package/dist/components/Badge/index.d.ts +3 -4
- package/dist/components/BottomSheet/BottomSheet.stories.d.ts +2 -1
- package/dist/components/BottomSheet/bottomsheet-body.d.ts +0 -1
- package/dist/components/BottomSheet/bottomsheet-contents.d.ts +2 -1
- package/dist/components/BottomSheet/bottomsheet-context.d.ts +2 -3
- package/dist/components/BottomSheet/bottomsheet-header.d.ts +2 -1
- package/dist/components/BottomSheet/bottomsheet.d.ts +0 -1
- package/dist/components/BottomSheet/index.d.ts +1 -1
- package/dist/components/Button/Button.stories.d.ts +36 -41
- package/dist/components/Button/Button.style.d.ts +8 -26
- package/dist/components/Button/index.d.ts +6 -6
- package/dist/components/Checkbox/Checkbox.stories.d.ts +13 -27
- package/dist/components/Checkbox/index.d.ts +1 -2
- package/dist/components/Dimmed/index.d.ts +2 -1
- package/dist/components/Divider/Divider.stories.d.ts +3 -2
- package/dist/components/Drawer/Drawer.stories.d.ts +3 -2
- package/dist/components/Drawer/drawer-content.d.ts +0 -1
- package/dist/components/Drawer/drawer-context.d.ts +7 -6
- package/dist/components/Drawer/drawer.d.ts +4 -4
- package/dist/components/Drawer/hook/useDrawer.d.ts +3 -2
- package/dist/components/Drawer/index.d.ts +2 -1
- package/dist/components/Dropdown/Dropdown.stories.d.ts +3 -2
- package/dist/components/Dropdown/dropdown-body.d.ts +0 -1
- package/dist/components/Dropdown/dropdown-content.d.ts +0 -1
- package/dist/components/Dropdown/dropdown-context.d.ts +4 -4
- package/dist/components/Dropdown/dropdown-header.d.ts +2 -1
- package/dist/components/Dropdown/dropdown-item.d.ts +0 -1
- package/dist/components/Dropdown/dropdown-trigger.d.ts +0 -1
- package/dist/components/Dropdown/dropdown.d.ts +12 -8
- package/dist/components/Dropdown/index.d.ts +4 -1
- package/dist/components/InfiniteSlider/InfiniteSlider-item.d.ts +2 -1
- package/dist/components/InfiniteSlider/InfiniteSlider.d.ts +3 -3
- package/dist/components/InfiniteSlider/InfiniteSlider.stories.d.ts +3 -2
- package/dist/components/InfiniteSlider/index.d.ts +2 -1
- package/dist/components/Input/Input.stories.d.ts +28 -35
- package/dist/components/Input/Input.style.d.ts +8 -7
- package/dist/components/Input/index.d.ts +5 -4
- package/dist/components/Modal/Modal.stories.d.ts +2 -1
- package/dist/components/Modal/hook/useModal.d.ts +4 -4
- package/dist/components/Modal/index.d.ts +8 -5
- package/dist/components/Modal/modal-body.d.ts +2 -1
- package/dist/components/Modal/modal-content.d.ts +0 -1
- package/dist/components/Modal/modal-context.d.ts +6 -5
- package/dist/components/Modal/modal-footer.d.ts +2 -1
- package/dist/components/Modal/modal-header.d.ts +2 -1
- package/dist/components/Modal/modal.d.ts +12 -2
- package/dist/components/Pagination/Pagination.stories.d.ts +3 -2
- package/dist/components/Popover/Popover.stories.d.ts +2 -1
- package/dist/components/Popover/hook/usePopover.d.ts +4 -3
- package/dist/components/Popover/index.d.ts +3 -3
- package/dist/components/Popover/popover-content.d.ts +0 -1
- package/dist/components/Popover/popover-context.d.ts +7 -6
- package/dist/components/Popover/popover-trigger.d.ts +3 -2
- package/dist/components/Popover/popover.d.ts +4 -3
- package/dist/components/Radio/Radio.stories.d.ts +28 -12
- package/dist/components/Radio/index.d.ts +2 -4
- package/dist/components/Radio/radio-context.d.ts +10 -8
- package/dist/components/Radio/radio-group.d.ts +8 -3
- package/dist/components/Radio/radio-item.d.ts +6 -7
- package/dist/components/Radio/radio-style.d.ts +4 -4
- package/dist/components/Skeleton/index.d.ts +2 -1
- package/dist/components/SnackBar/SnackBar.stories.d.ts +3 -2
- package/dist/components/SnackBar/index.d.ts +3 -3
- package/dist/components/SnackBar/snackbar-context.d.ts +2 -3
- package/dist/components/SnackBar/snackbar-provider.d.ts +2 -1
- package/dist/components/SnackBar/snackbar.d.ts +2 -1
- package/dist/components/Switch/Switch.stories.d.ts +3 -2
- package/dist/components/Switch/index.d.ts +0 -1
- package/dist/components/Tab/Tab.stories.d.ts +12 -15
- package/dist/components/Tab/index.d.ts +3 -3
- package/dist/components/Tab/tab-context.d.ts +3 -3
- package/dist/components/Tab/tab-group.d.ts +3 -3
- package/dist/components/Tab/tab-item.d.ts +2 -3
- package/dist/components/Text/Text.stories.d.ts +16 -0
- package/dist/components/Text/index.d.ts +2 -1
- package/dist/components/TextArea/TextArea.stories.d.ts +24 -31
- package/dist/components/TextArea/TextArea.style.d.ts +8 -6
- package/dist/components/TextArea/index.d.ts +5 -4
- package/dist/components/TextField/TextField.stories.d.ts +15 -27
- package/dist/components/TextField/index.d.ts +3 -2
- package/dist/components/Tooltip/Tooltip.stories.d.ts +3 -2
- package/dist/components/Tooltip/index.d.ts +3 -2
- package/dist/components/index.d.ts +26 -24
- package/dist/components/shared/Flex.d.ts +2 -1
- package/dist/components/shared/Icon/Icon.stories.d.ts +20 -0
- package/dist/components/shared/Icon/index.d.ts +11 -0
- package/dist/components/shared/Portal.d.ts +0 -1
- package/dist/components/shared/SwitchCase.d.ts +0 -1
- package/dist/hooks/index.d.ts +4 -4
- package/dist/hooks/useDomRef.d.ts +2 -2
- package/dist/hooks/useIsomorphicLayoutEffect.d.ts +3 -2
- package/dist/hooks/useTimeout.d.ts +2 -1
- package/dist/index.d.ts +5 -5
- package/dist/ownui-system.js +30515 -6299
- package/dist/ownui-system.js.map +1 -1
- package/dist/ownui-system.umd.cjs +7756 -28
- package/dist/ownui-system.umd.cjs.map +1 -1
- package/dist/styles/util.d.ts +2 -1
- package/dist/types/index.d.ts +1 -0
- package/package.json +21 -13
package/README.md
CHANGED
|
@@ -1,113 +1,95 @@
|
|
|
1
|
-
# ownui-
|
|
1
|
+
# ownui-system
|
|
2
2
|
|
|
3
|
-
-
|
|
3
|
+
A React-based UI component library built with Tailwind CSS and Framer Motion.
|
|
4
4
|
|
|
5
|
-
## Getting
|
|
5
|
+
## Getting Started
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### 1. Install the package
|
|
8
8
|
|
|
9
|
-
-
|
|
9
|
+
Install the `ownui-system` package along with its peer dependencies.
|
|
10
10
|
|
|
11
|
+
```bash
|
|
12
|
+
npm install ownui-system
|
|
13
|
+
# or
|
|
14
|
+
yarn add ownui-system
|
|
15
|
+
# or
|
|
16
|
+
pnpm add ownui-system
|
|
11
17
|
```
|
|
12
|
-
|
|
13
|
-
|
|
18
|
+
|
|
19
|
+
### 2. Setup Tailwind CSS
|
|
20
|
+
|
|
21
|
+
If your project doesn't have Tailwind CSS set up yet, install the necessary dependencies:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install -D autoprefixer postcss tailwindcss
|
|
14
25
|
npx tailwindcss init -p
|
|
15
26
|
```
|
|
16
27
|
|
|
17
|
-
|
|
28
|
+
### 3. Configure `tailwind.config.js`
|
|
18
29
|
|
|
19
|
-
|
|
30
|
+
You need to include the library's paths in your `content` array so Tailwind can process the styles. Also, include the `colors` and `twTypographyMap` plugins provided by `ownui-system`.
|
|
31
|
+
|
|
32
|
+
```javascript
|
|
20
33
|
const plugin = require("tailwindcss/plugin");
|
|
21
34
|
const { colors, twTypographyMap } = require("ownui-system");
|
|
22
35
|
|
|
23
|
-
|
|
24
36
|
/** @type {import('tailwindcss').Config} */
|
|
25
37
|
export default {
|
|
26
38
|
content: [
|
|
27
39
|
"./index.html",
|
|
28
40
|
"./src/**/*.{js,ts,jsx,tsx}",
|
|
41
|
+
// Important: Include ownui-system dist to purge classes correctly
|
|
42
|
+
"./node_modules/ownui-system/dist/**/*.{js,jsx,ts,tsx}"
|
|
29
43
|
],
|
|
30
44
|
theme: {
|
|
31
|
-
colors,
|
|
45
|
+
colors, // Injects ownui-system default colors
|
|
32
46
|
extend: {},
|
|
33
47
|
},
|
|
34
48
|
plugins: [
|
|
35
49
|
plugin(function ({ addUtilities }) {
|
|
36
|
-
// Add
|
|
50
|
+
// Add custom typography utilities
|
|
37
51
|
addUtilities(twTypographyMap, ["responsive", "hover"]);
|
|
38
52
|
}),
|
|
39
53
|
],
|
|
40
54
|
};
|
|
41
|
-
|
|
42
55
|
```
|
|
43
56
|
|
|
44
|
-
|
|
57
|
+
### 4. Add Tailwind CSS Directives
|
|
45
58
|
|
|
46
|
-
|
|
59
|
+
Add the basic Tailwind directives to your global CSS file (e.g., `index.css` or `global.css`):
|
|
60
|
+
|
|
61
|
+
```css
|
|
47
62
|
@tailwind base;
|
|
48
63
|
@tailwind components;
|
|
49
64
|
@tailwind utilities;
|
|
50
65
|
```
|
|
51
66
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
npm i ownui-system
|
|
56
|
-
#
|
|
57
|
-
yarn add ownui-system
|
|
58
|
-
#
|
|
59
|
-
pnpm add ownui-system
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
- include "./node\*modules/ownui-system/dist/\*\*/\_.{js,jsx,ts,tsx}" to tailwind.config content
|
|
63
|
-
|
|
64
|
-
```
|
|
65
|
-
/** @type {import('tailwindcss').Config} */
|
|
66
|
-
export default {
|
|
67
|
-
content: [
|
|
68
|
-
"./index.html",
|
|
69
|
-
"./src/**/*.{js,ts,jsx,tsx}",
|
|
70
|
-
"./node_modules/ownui-system/dist/**/*.{js,jsx,ts,tsx}"
|
|
71
|
-
],
|
|
72
|
-
theme: {
|
|
73
|
-
colors,
|
|
74
|
-
extend: {},
|
|
75
|
-
},
|
|
76
|
-
plugins: [
|
|
77
|
-
plugin(function ({ addUtilities }) {
|
|
78
|
-
// Add your custom styles here
|
|
79
|
-
addUtilities(twTypographyMap, ["responsive", "hover"]);
|
|
80
|
-
}),
|
|
81
|
-
],
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
## UI Components
|
|
67
|
+
## Available UI Components
|
|
87
68
|
|
|
69
|
+
- [x] Accordion
|
|
70
|
+
- [x] Badge
|
|
71
|
+
- [x] BottomSheet
|
|
88
72
|
- [x] Button
|
|
89
|
-
- [x]
|
|
90
|
-
- [x] TextField
|
|
91
|
-
- [x] Spacing
|
|
92
|
-
- [x] Flex
|
|
93
|
-
- [x] Skeleton
|
|
94
|
-
- [x] TextArea
|
|
95
|
-
- [x] Text
|
|
73
|
+
- [x] Checkbox
|
|
96
74
|
- [x] Dimmed
|
|
97
|
-
- [x] Modal
|
|
98
75
|
- [x] Divider
|
|
99
|
-
- [x] PopOver
|
|
100
|
-
- [x] Tab / TabGroup
|
|
101
|
-
- [x] Badge
|
|
102
|
-
- [x] Checkbox
|
|
103
76
|
- [x] Drawer
|
|
104
77
|
- [x] Dropdown
|
|
105
|
-
- [x]
|
|
106
|
-
- [x]
|
|
78
|
+
- [x] Flex
|
|
79
|
+
- [x] Icon
|
|
80
|
+
- [x] InfiniteSlider
|
|
81
|
+
- [x] Input
|
|
82
|
+
- [x] Modal
|
|
107
83
|
- [x] Pagination
|
|
108
|
-
- [x]
|
|
84
|
+
- [x] PopOver
|
|
109
85
|
- [x] Radio / RadioGroup
|
|
110
|
-
- [x]
|
|
111
|
-
- [x] Tooltip
|
|
86
|
+
- [x] Skeleton
|
|
112
87
|
- [x] SnackBar
|
|
88
|
+
- [x] Spacing
|
|
89
|
+
- [x] Switch
|
|
90
|
+
- [x] Tab / TabGroup
|
|
91
|
+
- [x] Text
|
|
92
|
+
- [x] TextArea
|
|
93
|
+
- [x] TextField
|
|
94
|
+
- [x] Tooltip
|
|
113
95
|
- [ ] Step
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
type AccordionContextValue = {
|
|
3
2
|
selected?: string | number;
|
|
4
3
|
defaultSelected?: string | number;
|
|
@@ -9,8 +8,8 @@ type AccordionContextValue = {
|
|
|
9
8
|
};
|
|
10
9
|
declare function useContext(): AccordionContextValue;
|
|
11
10
|
export declare function useAccordionContext(): {
|
|
12
|
-
AccordionProvider: import(
|
|
11
|
+
AccordionProvider: import('react').Provider<AccordionContextValue | undefined>;
|
|
13
12
|
useContext: typeof useContext;
|
|
14
|
-
Context: import(
|
|
13
|
+
Context: import('react').Context<AccordionContextValue | undefined>;
|
|
15
14
|
};
|
|
16
15
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { default as AccordionBody } from './accordion-body';
|
|
2
|
+
import { default as AccordionHeader } from './accordion-header';
|
|
3
|
+
import { default as AccordionItem } from './accordion-item';
|
|
4
|
+
|
|
5
5
|
interface AccordionProps {
|
|
6
6
|
defaultSelected?: string | number;
|
|
7
7
|
type?: "single" | "multi";
|
|
@@ -1,26 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
medium
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
export
|
|
8
|
-
small: {
|
|
9
|
-
"top-left": string;
|
|
10
|
-
"top-right": string;
|
|
11
|
-
"bottom-left": string;
|
|
12
|
-
"bottom-right": string;
|
|
13
|
-
};
|
|
14
|
-
medium: {
|
|
15
|
-
"top-left": string;
|
|
16
|
-
"top-right": string;
|
|
17
|
-
"bottom-left": string;
|
|
18
|
-
"bottom-right": string;
|
|
19
|
-
};
|
|
20
|
-
large: {
|
|
21
|
-
"top-left": string;
|
|
22
|
-
"top-right": string;
|
|
23
|
-
"bottom-left": string;
|
|
24
|
-
"bottom-right": string;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
|
|
3
|
+
export declare const badgeVariants: (props?: ({
|
|
4
|
+
size?: "small" | "large" | "medium" | null | undefined;
|
|
5
|
+
placement?: "top-left" | "top-right" | "bottom-left" | "bottom-right" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export type BadgeVariants = VariantProps<typeof badgeVariants>;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { BadgeVariants } from './Badge.style';
|
|
2
|
+
|
|
3
|
+
export interface BadgeProps extends BadgeVariants {
|
|
3
4
|
content?: React.ReactNode;
|
|
4
5
|
color: string;
|
|
5
6
|
children?: React.ReactNode;
|
|
6
|
-
size?: "large" | "medium" | "small";
|
|
7
|
-
placement?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
8
7
|
className?: string;
|
|
9
8
|
radius?: string | number;
|
|
10
9
|
isVisible?: boolean;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
type BottomSheetContextValue = {
|
|
3
2
|
isOpen: boolean;
|
|
4
3
|
zIndex: number;
|
|
@@ -9,8 +8,8 @@ type BottomSheetContextValue = {
|
|
|
9
8
|
};
|
|
10
9
|
declare function useContext(): BottomSheetContextValue;
|
|
11
10
|
export declare function useBottomSheetContext(): {
|
|
12
|
-
BottomSheetProvider: import(
|
|
11
|
+
BottomSheetProvider: import('react').Provider<BottomSheetContextValue | undefined>;
|
|
13
12
|
useContext: typeof useContext;
|
|
14
|
-
Context: import(
|
|
13
|
+
Context: import('react').Context<BottomSheetContextValue | undefined>;
|
|
15
14
|
};
|
|
16
15
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as BottomSheet } from
|
|
1
|
+
export { default as BottomSheet } from './bottomsheet';
|
|
@@ -1,43 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
argTypes: {
|
|
10
|
-
type: {
|
|
11
|
-
if: {
|
|
12
|
-
arg: string;
|
|
13
|
-
exists: true;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
children: {
|
|
17
|
-
control: {
|
|
18
|
-
type: string;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
disabled: {
|
|
22
|
-
control: {
|
|
23
|
-
type: string;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
startContent: {
|
|
27
|
-
if: {
|
|
28
|
-
arg: string;
|
|
29
|
-
exists: true;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
endContent: {
|
|
33
|
-
if: {
|
|
34
|
-
arg: string;
|
|
35
|
-
exists: true;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
tags: string[];
|
|
40
|
-
};
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { default as Button } from './index';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* `Button` component is a flexible button component that supports various sizes, variants, and icon placements.
|
|
6
|
+
*/
|
|
7
|
+
declare const meta: Meta<typeof Button>;
|
|
41
8
|
export default meta;
|
|
42
|
-
type Story = StoryObj<typeof
|
|
9
|
+
type Story = StoryObj<typeof Button>;
|
|
43
10
|
export declare const Default: Story;
|
|
11
|
+
/**
|
|
12
|
+
* Various visual variants of the button.
|
|
13
|
+
*/
|
|
14
|
+
export declare const Variants: Story;
|
|
15
|
+
/**
|
|
16
|
+
* All available sizes.
|
|
17
|
+
*/
|
|
18
|
+
export declare const Sizes: Story;
|
|
19
|
+
/**
|
|
20
|
+
* Buttons with icons on the left or right.
|
|
21
|
+
*/
|
|
22
|
+
export declare const WithIcons: Story;
|
|
23
|
+
/**
|
|
24
|
+
* Icon-only button variants.
|
|
25
|
+
*/
|
|
26
|
+
export declare const OnlyIcon: Story;
|
|
27
|
+
/**
|
|
28
|
+
* The button in a disabled state.
|
|
29
|
+
*/
|
|
30
|
+
export declare const Disabled: Story;
|
|
31
|
+
/**
|
|
32
|
+
* A full-width button.
|
|
33
|
+
*/
|
|
34
|
+
export declare const FullWidth: Story;
|
|
35
|
+
/**
|
|
36
|
+
* Example of controlling typography externally via `className`.
|
|
37
|
+
*/
|
|
38
|
+
export declare const ExternalTypography: Story;
|
|
@@ -1,29 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
xlarge: string;
|
|
10
|
-
};
|
|
11
|
-
icon: {
|
|
12
|
-
xsmall: string;
|
|
13
|
-
small: string;
|
|
14
|
-
medium: string;
|
|
15
|
-
large: string;
|
|
16
|
-
xlarge: string;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export declare const buttonTextSize: {
|
|
20
|
-
xsmall: string;
|
|
21
|
-
small: string;
|
|
22
|
-
medium: string;
|
|
23
|
-
large: string;
|
|
24
|
-
xlarge: string;
|
|
25
|
-
};
|
|
26
|
-
export declare function buttonHoverStyle(variant: "normal" | "line" | "text"): "hover:text-white hover:bg-[var(--border-color)] disabled:bg-[var(--bg-color)] disabled:text-current" | "hover:opacity-[0.9] hover:brightness-[0.9] disabled:bg-[var(--bg-color)]";
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
|
|
3
|
+
export declare const buttonVariants: (props?: ({
|
|
4
|
+
size?: "small" | "large" | "medium" | "xsmall" | "xlarge" | null | undefined;
|
|
5
|
+
variant?: "line" | "text" | "normal" | null | undefined;
|
|
6
|
+
isOnlyIcon?: boolean | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
export type ButtonVariants = VariantProps<typeof buttonVariants>;
|
|
27
9
|
export declare function buttonTypeMap(color: string): {
|
|
28
10
|
normal: {
|
|
29
11
|
"--bg-color": string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import { ButtonVariants } from './Button.style';
|
|
3
|
+
|
|
4
|
+
export interface ButtonProps extends Omit<ComponentProps<"button">, "color">, ButtonVariants {
|
|
5
|
+
color?: string;
|
|
5
6
|
width?: string;
|
|
6
7
|
className?: string;
|
|
7
8
|
startContent?: ReactNode;
|
|
8
9
|
endContent?: ReactNode;
|
|
9
|
-
isOnlyIcon?: boolean;
|
|
10
10
|
}
|
|
11
|
-
declare const Button: import(
|
|
11
|
+
declare const Button: import('react').ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
12
12
|
export default Button;
|
|
@@ -1,30 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
argTypes: {
|
|
10
|
-
isChecked: {
|
|
11
|
-
if: {
|
|
12
|
-
arg: string;
|
|
13
|
-
exists: true;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
radius: {
|
|
17
|
-
control: string;
|
|
18
|
-
options: string[];
|
|
19
|
-
};
|
|
20
|
-
size: {
|
|
21
|
-
control: string;
|
|
22
|
-
options: string[];
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
};
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { default as Checkbox } from './index';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* `Checkbox` component for multi-selection.
|
|
6
|
+
*/
|
|
7
|
+
declare const meta: Meta<typeof Checkbox>;
|
|
26
8
|
export default meta;
|
|
27
|
-
type Story = StoryObj<typeof
|
|
9
|
+
type Story = StoryObj<typeof Checkbox>;
|
|
28
10
|
export declare const Default: Story;
|
|
11
|
+
export declare const Sizes: Story;
|
|
12
|
+
export declare const Colors: Story;
|
|
13
|
+
export declare const Radius: Story;
|
|
14
|
+
export declare const States: Story;
|
|
15
|
+
export declare const CustomIcon: Story;
|
|
29
16
|
export declare const Controlled: Story;
|
|
30
|
-
export declare const Disabled: Story;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export interface CheckboxProps {
|
|
3
2
|
size?: "small" | "medium" | "large";
|
|
4
3
|
isChecked?: boolean;
|
|
@@ -13,5 +12,5 @@ export interface CheckboxProps {
|
|
|
13
12
|
name?: string;
|
|
14
13
|
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
15
14
|
}
|
|
16
|
-
declare const Checkbox: import(
|
|
15
|
+
declare const Checkbox: import('react').ForwardRefExoticComponent<CheckboxProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
17
16
|
export default Checkbox;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { HTMLMotionProps } from
|
|
3
|
-
import { ComponentProps } from
|
|
4
|
-
import Drawer from
|
|
1
|
+
import { ComponentPosition } from '../../types';
|
|
2
|
+
import { HTMLMotionProps } from 'framer-motion';
|
|
3
|
+
import { ComponentProps } from 'react';
|
|
4
|
+
import { default as Drawer } from './drawer';
|
|
5
|
+
|
|
5
6
|
type DrawerProps = ComponentProps<typeof Drawer>;
|
|
6
7
|
type DrawerContextValue = {
|
|
7
8
|
isOpen: DrawerProps["isOpen"];
|
|
@@ -13,8 +14,8 @@ type DrawerContextValue = {
|
|
|
13
14
|
};
|
|
14
15
|
declare function useContext(): DrawerContextValue;
|
|
15
16
|
export declare function useDrawerContext(): {
|
|
16
|
-
DrawerProvider: import(
|
|
17
|
+
DrawerProvider: import('react').Provider<DrawerContextValue | undefined>;
|
|
17
18
|
useContext: typeof useContext;
|
|
18
|
-
Context: import(
|
|
19
|
+
Context: import('react').Context<DrawerContextValue | undefined>;
|
|
19
20
|
};
|
|
20
21
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { ComponentPosition } from '../../types';
|
|
2
|
+
import { HTMLMotionProps } from 'framer-motion';
|
|
3
|
+
import { default as DrawerContent } from './drawer-content';
|
|
4
|
+
|
|
5
5
|
export type DrawerProps = {
|
|
6
6
|
onOpenChange: (isOpen: boolean) => void;
|
|
7
7
|
isOpen: boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { HTMLMotionProps } from
|
|
1
|
+
import { HTMLMotionProps } from 'framer-motion';
|
|
2
|
+
|
|
2
3
|
type UseDrawerProps = {
|
|
3
4
|
isOpen: boolean;
|
|
4
5
|
placement?: "top" | "bottom" | "left" | "right";
|
|
@@ -12,7 +13,7 @@ type UseDrawerProps = {
|
|
|
12
13
|
declare function useDrawer({ isOpen, placement, motionVariant, zIndex, drawerId, onOpen, onClose, onOpenChange, }: UseDrawerProps): {
|
|
13
14
|
isOpen: boolean;
|
|
14
15
|
placement: "bottom" | "left" | "right" | "top" | undefined;
|
|
15
|
-
motionVariant: import(
|
|
16
|
+
motionVariant: import('framer-motion').Variants | undefined;
|
|
16
17
|
zIndex: number | undefined;
|
|
17
18
|
drawerId: string;
|
|
18
19
|
onOpenChange: (isOpen: boolean) => void;
|