adnbn-ui 0.1.0 → 0.1.1

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.
Files changed (34) hide show
  1. package/package.json +1 -1
  2. package/.prettierignore +0 -3
  3. package/.prettierrc +0 -28
  4. package/.storybook/main.ts +0 -22
  5. package/.storybook/preview.tsx +0 -100
  6. package/.storybook/styles/custom.scss +0 -59
  7. package/.storybook/styles/preview.css +0 -58
  8. package/.storybook/vitest.setup.ts +0 -9
  9. package/eslint.config.js +0 -39
  10. package/src/components/Avatar/Avatar.stories.tsx +0 -118
  11. package/src/components/Button/Button.stories.tsx +0 -148
  12. package/src/components/Checkbox/Checkbox.stories.tsx +0 -180
  13. package/src/components/Drawer/Drawer.stories.tsx +0 -89
  14. package/src/components/Footer/Footer.stories.tsx +0 -118
  15. package/src/components/Header/Header.stories.tsx +0 -49
  16. package/src/components/Highlight/Highlight.stories.tsx +0 -83
  17. package/src/components/IconButton/IconButton.stories.tsx +0 -179
  18. package/src/components/Layout/Layout.stories.tsx +0 -88
  19. package/src/components/List/List.stories.tsx +0 -81
  20. package/src/components/Modal/Modal.stories.tsx +0 -95
  21. package/src/components/Odometer/Odometer.stories.tsx +0 -66
  22. package/src/components/ScrollArea/ScrollArea.stories.tsx +0 -58
  23. package/src/components/Switch/Switch.stories.tsx +0 -25
  24. package/src/components/Tag/Tag.stories.tsx +0 -157
  25. package/src/components/TextArea/TextArea.stories.tsx +0 -145
  26. package/src/components/TextField/TextField.stories.tsx +0 -177
  27. package/src/components/Toast/Toast.stories.tsx +0 -209
  28. package/src/components/Tooltip/Tooltip.stories.tsx +0 -80
  29. package/src/components/View/View.stories.tsx +0 -47
  30. package/src/components/ViewDrawer/ViewDrawer.stories.tsx +0 -75
  31. package/src/components/ViewModal/ViewModal.stories.tsx +0 -68
  32. package/tsconfig.json +0 -18
  33. package/vite.config.ts +0 -11
  34. package/vitest.workspace.ts +0 -19
@@ -1,145 +0,0 @@
1
- import {Fragment} from "react";
2
- import {Meta, StoryObj} from "@storybook/react";
3
-
4
- import {capitalizeFirstLetter, hideInTable} from "../../utils";
5
-
6
- import TextAreaComponent, {TextAreaRadius, TextAreaSize, TextAreaVariant} from "./TextArea";
7
-
8
- const variants: TextAreaVariant[] = [TextAreaVariant.Regular, TextAreaVariant.Outlined, TextAreaVariant.Filled];
9
- const sizes: (TextAreaSize | "default")[] = [TextAreaSize.Small, "default", TextAreaSize.Medium, TextAreaSize.Large];
10
- const radius: (TextAreaRadius | "default")[] = [
11
- TextAreaRadius.None,
12
- TextAreaRadius.Small,
13
- "default",
14
- TextAreaRadius.Medium,
15
- TextAreaRadius.Large,
16
- ];
17
-
18
- const meta: Meta<typeof TextAreaComponent> = {
19
- title: "Components/TextArea",
20
- component: TextAreaComponent,
21
- tags: ["autodocs"],
22
- argTypes: {
23
- variant: {
24
- options: variants,
25
- control: {type: "select"},
26
- },
27
- size: {
28
- options: sizes,
29
- control: {type: "select"},
30
- },
31
- radius: {
32
- options: radius,
33
- control: {type: "select"},
34
- },
35
-
36
- label: hideInTable,
37
- children: hideInTable,
38
- },
39
- };
40
-
41
- export default meta;
42
-
43
- export const TextArea: StoryObj<typeof TextAreaComponent> = {
44
- args: {
45
- placeholder: "Enter text",
46
- disabled: false,
47
- fullWidth: false,
48
- },
49
- };
50
-
51
- export const Variant = () => {
52
- return (
53
- <div className="grid-wrapper" style={{gridTemplateColumns: "repeat(3, auto)"}}>
54
- {variants.map(variant => (
55
- <div key={variant}>
56
- <TextAreaComponent variant={variant} placeholder={capitalizeFirstLetter(variant)} />
57
- </div>
58
- ))}
59
- </div>
60
- );
61
- };
62
-
63
- export const Size = () => {
64
- return (
65
- <div className="grid-wrapper" style={{gridTemplateColumns: "repeat(4, auto)"}}>
66
- {sizes.map(size => (
67
- <div key={size}>
68
- <TextAreaComponent
69
- size={size !== "default" ? size : undefined}
70
- placeholder={capitalizeFirstLetter(size)}
71
- />
72
- </div>
73
- ))}
74
- </div>
75
- );
76
- };
77
-
78
- export const Radius = () => {
79
- return (
80
- <div className="grid-wrapper" style={{gridTemplateColumns: "repeat(3, auto)"}}>
81
- {radius.map(radius => (
82
- <div key={radius}>
83
- <TextAreaComponent
84
- radius={radius !== "default" ? radius : undefined}
85
- placeholder={capitalizeFirstLetter(radius)}
86
- />
87
- </div>
88
- ))}
89
- </div>
90
- );
91
- };
92
-
93
- export const VariantRadius = () => {
94
- return (
95
- <div className="grid-wrapper" style={{gridTemplateColumns: "repeat(5, auto)"}}>
96
- <span className="item-card__title"> Variant \ Radius</span>
97
- {radius.slice(1).map(radius => (
98
- <span key={radius} className="item-card__title">
99
- {capitalizeFirstLetter(radius)} radius
100
- </span>
101
- ))}
102
- {variants.map(variant => (
103
- <Fragment key={variant}>
104
- <span className="item-card__title">{capitalizeFirstLetter(variant)}</span>
105
- {radius.slice(1).map(radius => (
106
- <div key={`${radius}-${variant}`} className="item-card">
107
- <TextAreaComponent
108
- variant={variant}
109
- radius={radius !== "default" ? radius : undefined}
110
- placeholder="Enter value"
111
- />
112
- </div>
113
- ))}
114
- </Fragment>
115
- ))}
116
- </div>
117
- );
118
- };
119
-
120
- export const VariantSize = () => {
121
- return (
122
- <div className="grid-wrapper" style={{gridTemplateColumns: "repeat(5, auto)"}}>
123
- <span className="item-card__title"> Variant \ Size</span>
124
- {sizes.map(size => (
125
- <span key={size} className="item-card__title">
126
- {capitalizeFirstLetter(size)} size
127
- </span>
128
- ))}
129
- {variants.map(variant => (
130
- <Fragment key={variant}>
131
- <span className="item-card__title">{capitalizeFirstLetter(variant)}</span>
132
- {sizes.map(size => (
133
- <div key={`${size}-${variant}`} className="item-card">
134
- <TextAreaComponent
135
- variant={variant}
136
- size={size !== "default" ? size : undefined}
137
- placeholder="Enter value"
138
- />
139
- </div>
140
- ))}
141
- </Fragment>
142
- ))}
143
- </div>
144
- );
145
- };
@@ -1,177 +0,0 @@
1
- import {Fragment} from "react";
2
- import {Meta, StoryObj} from "@storybook/react";
3
-
4
- import {capitalizeFirstLetter, hideInTable} from "../../utils";
5
-
6
- import TextFieldComponent, {TextFieldAccent, TextFieldRadius, TextFieldSize, TextFieldVariant} from "./TextField";
7
-
8
- const variants: TextFieldVariant[] = [TextFieldVariant.Regular, TextFieldVariant.Outlined, TextFieldVariant.Filled];
9
- const sizes: (TextFieldSize | "default")[] = [
10
- TextFieldSize.Small,
11
- "default",
12
- TextFieldSize.Medium,
13
- TextFieldSize.Large,
14
- ];
15
- const radius: (TextFieldRadius | "default")[] = [
16
- TextFieldRadius.None,
17
- TextFieldRadius.Small,
18
- "default",
19
- TextFieldRadius.Medium,
20
- TextFieldRadius.Large,
21
- TextFieldRadius.Full,
22
- ];
23
- const accents: (TextFieldAccent | "default")[] = ["default", TextFieldAccent.Success, TextFieldAccent.Error];
24
-
25
- const meta: Meta<typeof TextFieldComponent> = {
26
- title: "Components/TextField",
27
- component: TextFieldComponent,
28
- tags: ["autodocs"],
29
- argTypes: {
30
- variant: {
31
- options: variants,
32
- control: {type: "select"},
33
- },
34
- customSize: {
35
- options: sizes,
36
- control: {type: "select"},
37
- },
38
- radius: {
39
- options: radius,
40
- control: {type: "select"},
41
- },
42
- accent: {
43
- options: accents,
44
- control: {type: "select"},
45
- },
46
-
47
- label: hideInTable,
48
- value: hideInTable,
49
- defaultValue: hideInTable,
50
- inputClassName: hideInTable,
51
- afterClassName: hideInTable,
52
- beforeClassName: hideInTable,
53
- },
54
- };
55
-
56
- export default meta;
57
-
58
- export const TextField: StoryObj<typeof TextFieldComponent> = {
59
- args: {
60
- placeholder: "Enter text",
61
- disabled: false,
62
- fullWidth: false,
63
- before: "🔍",
64
- after: "🔑",
65
- },
66
- };
67
-
68
- export const Variant = () => {
69
- return (
70
- <div className="grid-wrapper" style={{gridTemplateColumns: "repeat(3, auto)"}}>
71
- {variants.map(variant => (
72
- <div key={variant}>
73
- <TextFieldComponent variant={variant} placeholder={capitalizeFirstLetter(variant)} />
74
- </div>
75
- ))}
76
- </div>
77
- );
78
- };
79
-
80
- export const Size = () => {
81
- return (
82
- <div className="grid-wrapper" style={{gridTemplateColumns: "repeat(4, auto)"}}>
83
- {sizes.map(size => (
84
- <div key={size}>
85
- <TextFieldComponent
86
- customSize={size !== "default" ? size : undefined}
87
- placeholder={capitalizeFirstLetter(size)}
88
- />
89
- </div>
90
- ))}
91
- </div>
92
- );
93
- };
94
-
95
- export const Accent = () => {
96
- return (
97
- <div className="grid-wrapper" style={{gridTemplateColumns: "repeat(3, auto)"}}>
98
- {accents.map(accent => (
99
- <div key={accent}>
100
- <TextFieldComponent
101
- accent={accent !== "default" ? accent : undefined}
102
- placeholder={capitalizeFirstLetter(accent)}
103
- />
104
- </div>
105
- ))}
106
- </div>
107
- );
108
- };
109
-
110
- export const Radius = () => {
111
- return (
112
- <div className="grid-wrapper" style={{gridTemplateColumns: "repeat(6, auto)"}}>
113
- {radius.map(radius => (
114
- <div key={radius}>
115
- <TextFieldComponent
116
- radius={radius !== "default" ? radius : undefined}
117
- placeholder={capitalizeFirstLetter(radius)}
118
- />
119
- </div>
120
- ))}
121
- </div>
122
- );
123
- };
124
-
125
- export const VariantRadius = () => {
126
- return (
127
- <div className="grid-wrapper" style={{gridTemplateColumns: "repeat(7, auto)"}}>
128
- <span className="item-card__title"> Variant \ Radius</span>
129
- {radius.map(radius => (
130
- <span key={radius} className="item-card__title">
131
- {capitalizeFirstLetter(radius)} radius
132
- </span>
133
- ))}
134
- {variants.map(variant => (
135
- <Fragment key={variant}>
136
- <span className="item-card__title">{capitalizeFirstLetter(variant)}</span>
137
- {radius.map(radius => (
138
- <div key={`${radius}-${variant}`} className="item-card">
139
- <TextFieldComponent
140
- variant={variant}
141
- radius={radius !== "default" ? radius : undefined}
142
- placeholder="Enter value"
143
- />
144
- </div>
145
- ))}
146
- </Fragment>
147
- ))}
148
- </div>
149
- );
150
- };
151
-
152
- export const VariantSize = () => {
153
- return (
154
- <div className="grid-wrapper" style={{gridTemplateColumns: "repeat(5, auto)"}}>
155
- <span className="item-card__title"> Variant \ Size</span>
156
- {sizes.map(size => (
157
- <span key={size} className="item-card__title">
158
- {capitalizeFirstLetter(size)} size
159
- </span>
160
- ))}
161
- {variants.map(variant => (
162
- <Fragment key={variant}>
163
- <span className="item-card__title">{capitalizeFirstLetter(variant)}</span>
164
- {sizes.map(size => (
165
- <div key={`${size}-${variant}`} className="item-card">
166
- <TextFieldComponent
167
- variant={variant}
168
- customSize={size !== "default" ? size : undefined}
169
- placeholder="Enter value"
170
- />
171
- </div>
172
- ))}
173
- </Fragment>
174
- ))}
175
- </div>
176
- );
177
- };
@@ -1,209 +0,0 @@
1
- import {FC, useState} from "react";
2
- import {Meta, StoryObj} from "@storybook/react";
3
-
4
- import {hideInTable} from "../../utils";
5
-
6
- import {Button, ButtonColor, ButtonVariant} from "../index";
7
-
8
- import ToastComponent, {ToastColor, ToastProps, ToastRadius, ToastSide} from "./Toast";
9
-
10
- const sides: ToastSide[] = [
11
- ToastSide.TopLeft,
12
- ToastSide.TopCenter,
13
- ToastSide.TopRight,
14
- ToastSide.BottomRight,
15
- ToastSide.BottomCenter,
16
- ToastSide.BottomLeft,
17
- ];
18
- const colors: (ToastColor | "default")[] = ["default", ToastColor.Success, ToastColor.Error];
19
- const radius: (ToastRadius | "default")[] = [
20
- ToastRadius.None,
21
- ToastRadius.Small,
22
- "default",
23
- ToastRadius.Medium,
24
- ToastRadius.Large,
25
- ];
26
-
27
- const meta: Meta<typeof ToastComponent> = {
28
- title: "Components/Toast",
29
- component: ToastComponent,
30
- tags: ["autodocs"],
31
- argTypes: {
32
- duration: {
33
- description: "The time in milliseconds that should elapse before automatically closing each toast.",
34
- },
35
- swipeDirection: {
36
- options: ["right", "left", "up", "down"],
37
- control: {type: "select"},
38
- description: "The direction of the pointer swipe that should close the toast.",
39
- },
40
- swipeThreshold: {
41
- description: "The distance in pixels that the swipe gesture must travel before a close is triggered.",
42
- control: {type: "number"},
43
- },
44
- side: {
45
- options: sides,
46
- control: {type: "select"},
47
- },
48
- radius: {
49
- options: radius,
50
- control: {type: "select"},
51
- },
52
- color: {
53
- options: colors,
54
- control: {type: "select"},
55
- },
56
-
57
- action: hideInTable,
58
- closeIcon: hideInTable,
59
- closeProps: hideInTable,
60
- onClose: hideInTable,
61
- children: hideInTable,
62
- className: hideInTable,
63
- titleClassName: hideInTable,
64
- actionClassName: hideInTable,
65
- viewportClassName: hideInTable,
66
- descriptionClassName: hideInTable,
67
- },
68
- };
69
-
70
- export default meta;
71
-
72
- export const Toast: StoryObj<typeof ToastComponent> = {
73
- args: {
74
- open: true,
75
- sticky: false,
76
- fullWidth: false,
77
- children: (
78
- <Button variant={ButtonVariant.Contained} color={ButtonColor.Primary}>
79
- Show toast
80
- </Button>
81
- ),
82
- title: "New notification",
83
- description: "Description",
84
- side: ToastSide.BottomRight,
85
- duration: 5000,
86
- onClose: () => undefined,
87
- },
88
- };
89
-
90
- const ToastClickable: FC<ToastProps> = ({children, ...props}) => {
91
- const [open, setOpen] = useState(false);
92
- const handleClick = () => setOpen(prev => !prev);
93
- const handleClose = () => setOpen(false);
94
-
95
- return (
96
- <ToastComponent
97
- open={open}
98
- title="New notification"
99
- description="Description"
100
- onOpenChange={setOpen}
101
- onClose={handleClose}
102
- {...props}
103
- >
104
- <Button variant={ButtonVariant.Contained} color={ButtonColor.Primary} onClick={handleClick}>
105
- {children}
106
- </Button>
107
- </ToastComponent>
108
- );
109
- };
110
-
111
- export const Side = () => {
112
- return (
113
- <div style={{display: "grid", gridTemplateColumns: "repeat(6, auto)", gap: "10px"}}>
114
- <ToastClickable side={ToastSide.TopLeft} description="Top Left">
115
- Top Left
116
- </ToastClickable>
117
-
118
- <ToastClickable side={ToastSide.TopCenter} description="Top Center">
119
- Top Center
120
- </ToastClickable>
121
-
122
- <ToastClickable side={ToastSide.TopRight} description="Top Right">
123
- Top Right
124
- </ToastClickable>
125
-
126
- <ToastClickable side={ToastSide.BottomLeft} description="Bottom Left">
127
- Bottom Left
128
- </ToastClickable>
129
-
130
- <ToastClickable side={ToastSide.BottomCenter} description="Bottom Center">
131
- Bottom Center
132
- </ToastClickable>
133
-
134
- <ToastClickable side={ToastSide.BottomRight} description="Bottom Right">
135
- Bottom Right
136
- </ToastClickable>
137
- </div>
138
- );
139
- };
140
-
141
- export const Radius = () => {
142
- return (
143
- <div style={{display: "flex", gap: "10px"}}>
144
- <ToastClickable side={ToastSide.TopLeft} radius={ToastRadius.None} description="None Radius">
145
- None
146
- </ToastClickable>
147
-
148
- <ToastClickable side={ToastSide.TopCenter} radius={ToastRadius.Small} description="Small Radius">
149
- Small
150
- </ToastClickable>
151
-
152
- <ToastClickable side={ToastSide.TopRight} description="Default Radius">
153
- Default
154
- </ToastClickable>
155
-
156
- <ToastClickable side={ToastSide.BottomLeft} radius={ToastRadius.Medium} description="Medium Radius">
157
- Medium
158
- </ToastClickable>
159
-
160
- <ToastClickable side={ToastSide.BottomRight} radius={ToastRadius.Large} description="Large Radius">
161
- Large
162
- </ToastClickable>
163
- </div>
164
- );
165
- };
166
-
167
- export const FullWidth = () => {
168
- return (
169
- <div style={{display: "flex", flexDirection: "column", gap: "10px"}}>
170
- <ToastClickable
171
- side={ToastSide.TopCenter}
172
- radius={ToastRadius.None}
173
- fullWidth
174
- sticky
175
- description="Top full width without padding"
176
- >
177
- Top
178
- </ToastClickable>
179
-
180
- <ToastClickable
181
- side={ToastSide.BottomCenter}
182
- radius={ToastRadius.None}
183
- fullWidth
184
- sticky
185
- description="Bottom full width without padding"
186
- >
187
- Bottom
188
- </ToastClickable>
189
- </div>
190
- );
191
- };
192
-
193
- export const Color = () => {
194
- return (
195
- <div style={{display: "flex", gap: "10px"}}>
196
- <ToastClickable side={ToastSide.TopLeft} color={ToastColor.Error} description="Error color">
197
- Error
198
- </ToastClickable>
199
-
200
- <ToastClickable side={ToastSide.TopCenter} description="Default color">
201
- Default
202
- </ToastClickable>
203
-
204
- <ToastClickable side={ToastSide.TopRight} color={ToastColor.Success} description="Success color">
205
- Success
206
- </ToastClickable>
207
- </div>
208
- );
209
- };
@@ -1,80 +0,0 @@
1
- import {Meta, StoryObj} from "@storybook/react";
2
-
3
- import {hideInTable} from "../../utils";
4
-
5
- import {Button} from "../index";
6
-
7
- import TooltipComponent from "./Tooltip";
8
-
9
- const meta: Meta<typeof TooltipComponent> = {
10
- title: "Components/Tooltip",
11
- component: TooltipComponent,
12
- tags: ["autodocs"],
13
- argTypes: {
14
- open: {
15
- options: [true, false, undefined],
16
- control: "select",
17
- type: "boolean",
18
- description: "The controlled open state of the tooltip. Must be used in conjunction with onOpenChange.",
19
- },
20
- side: {
21
- options: ["top", "right", "bottom", "left"],
22
- control: "select",
23
- description:
24
- "The preferred side of the trigger to render against when open. Will be reversed when collisions occur and avoidCollisions is enabled.",
25
- },
26
- align: {
27
- options: ["start", "center", "end"],
28
- control: "select",
29
- description: "The preferred alignment against the trigger. May change when collisions occur.",
30
- },
31
- delayDuration: {
32
- description:
33
- "Override the duration given to the `Provider` to customise the open delay for a specific tooltip.",
34
- },
35
- arrowWidth: {
36
- description: "The width of the arrow in pixels.",
37
- },
38
- arrowHeight: {
39
- description: "The height of the arrow in pixels.",
40
- },
41
- arrowPadding: {
42
- description:
43
- "The padding between the arrow and the edges of the content. If your content has border-radius, this will prevent it from overflowing the corners.",
44
- },
45
- alignOffset: {
46
- description: 'An offset in pixels from the "start" or "end" alignment options.',
47
- },
48
- avoidCollisions: {
49
- description:
50
- "When true, overrides the side and align preferences to prevent collisions with boundary edges.",
51
- },
52
- matchTriggerWidth: {
53
- description: "Whether to set the content width equal to the trigger width",
54
- },
55
-
56
- arrowClassName: hideInTable,
57
- contentClassName: hideInTable,
58
- children: hideInTable,
59
- },
60
- };
61
-
62
- export default meta;
63
-
64
- export const Tooltip: StoryObj<typeof TooltipComponent> = {
65
- args: {
66
- content: "Tooltip content",
67
- open: undefined,
68
- align: "center",
69
- alignOffset: 0,
70
- side: "top",
71
- sideOffset: 0,
72
- arrowHeight: 5,
73
- arrowWidth: 10,
74
- arrowPadding: 0,
75
- delayDuration: 700,
76
- matchTriggerWidth: false,
77
- avoidCollisions: true,
78
- children: <Button style={{marginTop: "40px"}}>Button</Button>,
79
- },
80
- };
@@ -1,47 +0,0 @@
1
- import {Meta, StoryObj} from "@storybook/react";
2
-
3
- import {hideInTable} from "../../utils";
4
-
5
- import ViewComponent from "./View";
6
-
7
- const meta: Meta<typeof ViewComponent> = {
8
- title: "Components/View",
9
- component: ViewComponent,
10
- tags: ["autodocs"],
11
- argTypes: {
12
- before: hideInTable,
13
- after: hideInTable,
14
- className: hideInTable,
15
- wrapClassName: hideInTable,
16
- titleClassName: hideInTable,
17
- bodyClassName: hideInTable,
18
- headerClassName: hideInTable,
19
- beforeClassName: hideInTable,
20
- afterClassName: hideInTable,
21
- subtitleClassName: hideInTable,
22
- childrenClassName: hideInTable,
23
- },
24
- decorators: [
25
- Story => (
26
- <div
27
- style={{background: "var(--bg-secondary-color", width: "380px", height: "400px", borderRadius: "10px"}}
28
- >
29
- <Story />
30
- </div>
31
- ),
32
- ],
33
- };
34
-
35
- export default meta;
36
-
37
- export const View: StoryObj<typeof ViewComponent> = {
38
- args: {
39
- title: "Volume Up Plus",
40
- subtitle: "Adjust the current tab's volume with the slider. Switch to any audio tab in one click.",
41
- before: "❤️",
42
- alignCenter: true,
43
- center: true,
44
- showSeparate: true,
45
- children: "children",
46
- },
47
- };