@axzydev/axzy_ui_system 1.2.1 → 1.2.2
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 +82 -1
- package/dist/index.css.map +1 -1
- package/package.json +2 -2
- package/src/App.tsx +354 -0
- package/src/assets/logo.png +0 -0
- package/src/assets/react.svg +1 -0
- package/src/components/alert/alert.props.ts +13 -0
- package/src/components/alert/alert.stories.tsx +41 -0
- package/src/components/alert/alert.tsx +53 -0
- package/src/components/avatar/avatar.props.ts +14 -0
- package/src/components/avatar/avatar.stories.tsx +46 -0
- package/src/components/avatar/avatar.tsx +53 -0
- package/src/components/badget/badget.props.ts +12 -0
- package/src/components/badget/badget.stories.tsx +76 -0
- package/src/components/badget/badget.tsx +61 -0
- package/src/components/breadcrumbs/breadcrumbs.props.ts +13 -0
- package/src/components/breadcrumbs/breadcrumbs.stories.tsx +21 -0
- package/src/components/breadcrumbs/breadcrumbs.tsx +34 -0
- package/src/components/button/button.props.ts +18 -0
- package/src/components/button/button.stories.tsx +174 -0
- package/src/components/button/button.tsx +117 -0
- package/src/components/calendar/calendar.props.ts +33 -0
- package/src/components/calendar/calendar.stories.tsx +91 -0
- package/src/components/calendar/calendar.tsx +608 -0
- package/src/components/calendar/index.ts +3 -0
- package/src/components/card/card.props.ts +13 -0
- package/src/components/card/card.stories.tsx +58 -0
- package/src/components/card/card.tsx +79 -0
- package/src/components/checkbox/checkbox.props.ts +11 -0
- package/src/components/checkbox/checkbox.stories.tsx +54 -0
- package/src/components/checkbox/checkbox.tsx +52 -0
- package/src/components/confirm-dialog/confirm-dialog.props.ts +14 -0
- package/src/components/confirm-dialog/confirm-dialog.stories.tsx +33 -0
- package/src/components/confirm-dialog/confirm-dialog.tsx +45 -0
- package/src/components/data-table/ITDataTable.stories.tsx +213 -0
- package/src/components/data-table/dataTable.props.ts +69 -0
- package/src/components/data-table/dataTable.tsx +313 -0
- package/src/components/date-picker/date-picker.props.ts +30 -0
- package/src/components/date-picker/date-picker.stories.tsx +90 -0
- package/src/components/date-picker/datePicker.tsx +307 -0
- package/src/components/dialog/dialog.props.ts +9 -0
- package/src/components/dialog/dialog.stories.tsx +80 -0
- package/src/components/dialog/dialog.tsx +88 -0
- package/src/components/divider/divider.props.ts +8 -0
- package/src/components/divider/divider.stories.tsx +34 -0
- package/src/components/divider/divider.tsx +21 -0
- package/src/components/drawer/drawer.props.ts +14 -0
- package/src/components/drawer/drawer.stories.tsx +41 -0
- package/src/components/drawer/drawer.tsx +53 -0
- package/src/components/dropfile/dropfile.stories.tsx +75 -0
- package/src/components/dropfile/dropfile.tsx +407 -0
- package/src/components/empty-state/empty-state.props.ts +9 -0
- package/src/components/empty-state/empty-state.stories.tsx +20 -0
- package/src/components/empty-state/empty-state.tsx +21 -0
- package/src/components/flex/flex.props.ts +22 -0
- package/src/components/flex/flex.stories.tsx +71 -0
- package/src/components/flex/flex.tsx +79 -0
- package/src/components/form-builder/fieldRenderer.tsx +218 -0
- package/src/components/form-builder/formBuilder.context.tsx +70 -0
- package/src/components/form-builder/formBuilder.props.ts +43 -0
- package/src/components/form-builder/formBuilder.stories.tsx +317 -0
- package/src/components/form-builder/formBuilder.tsx +186 -0
- package/src/components/form-builder/useFormBuilder.ts +80 -0
- package/src/components/form-header/form-header.props.ts +5 -0
- package/src/components/form-header/form-header.tsx +38 -0
- package/src/components/grid/grid.props.ts +17 -0
- package/src/components/grid/grid.stories.tsx +72 -0
- package/src/components/grid/grid.tsx +69 -0
- package/src/components/image/image.props.ts +7 -0
- package/src/components/image/image.tsx +38 -0
- package/src/components/input/input.props.ts +49 -0
- package/src/components/input/input.stories.tsx +115 -0
- package/src/components/input/input.tsx +615 -0
- package/src/components/layout/layout.props.ts +10 -0
- package/src/components/layout/layout.stories.tsx +114 -0
- package/src/components/layout/layout.tsx +80 -0
- package/src/components/loader/loader.props.ts +8 -0
- package/src/components/loader/loader.stories.tsx +105 -0
- package/src/components/loader/loader.tsx +108 -0
- package/src/components/navbar/navbar.props.ts +37 -0
- package/src/components/navbar/navbar.tsx +328 -0
- package/src/components/page/page.props.ts +19 -0
- package/src/components/page/page.stories.tsx +98 -0
- package/src/components/page/page.tsx +90 -0
- package/src/components/page-header/page-header.props.ts +11 -0
- package/src/components/page-header/page-header.stories.tsx +61 -0
- package/src/components/page-header/page-header.tsx +62 -0
- package/src/components/pagination/pagination.props.ts +53 -0
- package/src/components/pagination/pagination.stories.tsx +111 -0
- package/src/components/pagination/pagination.tsx +241 -0
- package/src/components/popover/popover.props.ts +12 -0
- package/src/components/popover/popover.stories.tsx +25 -0
- package/src/components/popover/popover.tsx +45 -0
- package/src/components/progress/progress.props.ts +12 -0
- package/src/components/progress/progress.stories.tsx +40 -0
- package/src/components/progress/progress.tsx +52 -0
- package/src/components/radio/radio.props.ts +16 -0
- package/src/components/radio/radio.stories.tsx +50 -0
- package/src/components/radio/radio.tsx +58 -0
- package/src/components/search-select/index.ts +2 -0
- package/src/components/search-select/search-select.props.ts +46 -0
- package/src/components/search-select/search-select.stories.tsx +129 -0
- package/src/components/search-select/search-select.tsx +229 -0
- package/src/components/searchTable/components/EditableCell.tsx +149 -0
- package/src/components/searchTable/components/PaginationControls.tsx +86 -0
- package/src/components/searchTable/components/PaginationInfo.tsx +20 -0
- package/src/components/searchTable/components/SearchAndSortBar.tsx +53 -0
- package/src/components/searchTable/components/SearchInput.tsx +33 -0
- package/src/components/searchTable/components/SortButton.tsx +50 -0
- package/src/components/searchTable/components/TableEmptyState.tsx +22 -0
- package/src/components/searchTable/components/TableHeader.tsx +35 -0
- package/src/components/searchTable/components/TableHeaderCell.tsx +43 -0
- package/src/components/searchTable/components/TableRow.tsx +144 -0
- package/src/components/searchTable/searchTable.props.ts +56 -0
- package/src/components/searchTable/searchTable.tsx +187 -0
- package/src/components/segmented-control/segmented-control.props.ts +18 -0
- package/src/components/segmented-control/segmented-control.stories.tsx +63 -0
- package/src/components/segmented-control/segmented-control.tsx +52 -0
- package/src/components/select/select.props.ts +25 -0
- package/src/components/select/select.stories.tsx +86 -0
- package/src/components/select/select.tsx +150 -0
- package/src/components/sidebar/sidebar.props.ts +28 -0
- package/src/components/sidebar/sidebar.stories.tsx +117 -0
- package/src/components/sidebar/sidebar.tsx +313 -0
- package/src/components/skeleton/skeleton.props.ts +12 -0
- package/src/components/skeleton/skeleton.stories.tsx +30 -0
- package/src/components/skeleton/skeleton.tsx +45 -0
- package/src/components/slide/slide.props.ts +45 -0
- package/src/components/slide/slide.stories.tsx +121 -0
- package/src/components/slide/slide.tsx +109 -0
- package/src/components/slider/slider.props.ts +10 -0
- package/src/components/slider/slider.stories.tsx +30 -0
- package/src/components/slider/slider.tsx +49 -0
- package/src/components/stack/stack.props.ts +19 -0
- package/src/components/stack/stack.stories.tsx +79 -0
- package/src/components/stack/stack.tsx +79 -0
- package/src/components/stat-card/stat-card.props.ts +13 -0
- package/src/components/stat-card/stat-card.stories.tsx +41 -0
- package/src/components/stat-card/stat-card.tsx +44 -0
- package/src/components/stepper/stepper.css +26 -0
- package/src/components/stepper/stepper.props.ts +29 -0
- package/src/components/stepper/stepper.stories.tsx +155 -0
- package/src/components/stepper/stepper.tsx +227 -0
- package/src/components/table/table.props.ts +43 -0
- package/src/components/table/table.stories.tsx +189 -0
- package/src/components/table/table.tsx +376 -0
- package/src/components/tabs/tabs.props.ts +18 -0
- package/src/components/tabs/tabs.stories.tsx +32 -0
- package/src/components/tabs/tabs.tsx +74 -0
- package/src/components/text/text.props.ts +9 -0
- package/src/components/text/text.tsx +20 -0
- package/src/components/textarea/textarea.props.ts +15 -0
- package/src/components/textarea/textarea.stories.tsx +27 -0
- package/src/components/textarea/textarea.tsx +55 -0
- package/src/components/theme-provider/themeProvider.props.ts +28 -0
- package/src/components/theme-provider/themeProvider.tsx +1854 -0
- package/src/components/time-picker/timePicker.props.ts +16 -0
- package/src/components/time-picker/timePicker.stories.tsx +131 -0
- package/src/components/time-picker/timePicker.tsx +317 -0
- package/src/components/toast/toast.css +32 -0
- package/src/components/toast/toast.props.ts +13 -0
- package/src/components/toast/toast.stories.tsx +138 -0
- package/src/components/toast/toast.tsx +87 -0
- package/src/components/tooltip/tooltip.props.ts +11 -0
- package/src/components/tooltip/tooltip.stories.tsx +20 -0
- package/src/components/tooltip/tooltip.tsx +55 -0
- package/src/components/topbar/topbar.props.ts +21 -0
- package/src/components/topbar/topbar.stories.tsx +80 -0
- package/src/components/topbar/topbar.tsx +205 -0
- package/src/components/triple-filter/tripleFilter.props.ts +15 -0
- package/src/components/triple-filter/tripleFilter.stories.tsx +32 -0
- package/src/components/triple-filter/tripleFilter.tsx +50 -0
- package/src/hooks/useClickOutside.ts +21 -0
- package/src/hooks/useDebouncedSearch.ts +55 -0
- package/src/hooks/useEditableRow.ts +157 -0
- package/src/hooks/useTableState.ts +122 -0
- package/src/index.css +168 -0
- package/src/index.ts +165 -0
- package/src/main.tsx +9 -0
- package/src/showcases/DataShowcases.tsx +260 -0
- package/src/showcases/FeedbackShowcases.tsx +268 -0
- package/src/showcases/FormShowcases.tsx +1159 -0
- package/src/showcases/HomeShowcase.tsx +324 -0
- package/src/showcases/LayoutPrimitivesShowcases.tsx +569 -0
- package/src/showcases/NavigationShowcases.tsx +193 -0
- package/src/showcases/PageShowcases.tsx +207 -0
- package/src/showcases/ShowcaseLayout.tsx +139 -0
- package/src/showcases/StructureShowcases.tsx +152 -0
- package/src/types/badget.types.ts +37 -0
- package/src/types/button.types.ts +16 -0
- package/src/types/colors.types.ts +3 -0
- package/src/types/field.types.ts +103 -0
- package/src/types/formik.types.ts +15 -0
- package/src/types/input.types.ts +14 -0
- package/src/types/loader.types.ts +9 -0
- package/src/types/sizes.types.ts +1 -0
- package/src/types/table.types.ts +15 -0
- package/src/types/toast.types.ts +8 -0
- package/src/types/yup.types.ts +11 -0
- package/src/utils/color.utils.ts +99 -0
- package/src/utils/styles.ts +120 -0
- package/src/utils/table.utils.ts +10 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import ITGrid from "./grid";
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof ITGrid> = {
|
|
5
|
+
title: "Layout/ITGrid",
|
|
6
|
+
component: ITGrid,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
argTypes: {
|
|
9
|
+
spacing: { control: { type: "range", min: 0, max: 8, step: 1 } },
|
|
10
|
+
columns: { control: { type: "number", min: 1, max: 12 } },
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
type Story = StoryObj<typeof ITGrid>;
|
|
16
|
+
|
|
17
|
+
const Cell = ({ children }: { children: string }) => (
|
|
18
|
+
<div className="bg-primary-100 text-primary-800 rounded-lg p-4 text-center font-medium h-full flex items-center justify-center">
|
|
19
|
+
{children}
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export const ThreeColumns: Story = {
|
|
24
|
+
args: { container: true, spacing: 2 },
|
|
25
|
+
render: (args) => (
|
|
26
|
+
<ITGrid {...args}>
|
|
27
|
+
<ITGrid item xs={4}>
|
|
28
|
+
<Cell>1/3</Cell>
|
|
29
|
+
</ITGrid>
|
|
30
|
+
<ITGrid item xs={4}>
|
|
31
|
+
<Cell>1/3</Cell>
|
|
32
|
+
</ITGrid>
|
|
33
|
+
<ITGrid item xs={4}>
|
|
34
|
+
<Cell>1/3</Cell>
|
|
35
|
+
</ITGrid>
|
|
36
|
+
</ITGrid>
|
|
37
|
+
),
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const Responsive: Story = {
|
|
41
|
+
args: { container: true, spacing: 3 },
|
|
42
|
+
render: (args) => (
|
|
43
|
+
<ITGrid {...args}>
|
|
44
|
+
<ITGrid item xs={12} sm={6} md={4} lg={3}>
|
|
45
|
+
<Cell>xs=12 sm=6 md=4 lg=3</Cell>
|
|
46
|
+
</ITGrid>
|
|
47
|
+
<ITGrid item xs={12} sm={6} md={4} lg={3}>
|
|
48
|
+
<Cell>xs=12 sm=6 md=4 lg=3</Cell>
|
|
49
|
+
</ITGrid>
|
|
50
|
+
<ITGrid item xs={12} sm={6} md={4} lg={3}>
|
|
51
|
+
<Cell>xs=12 sm=6 md=4 lg=3</Cell>
|
|
52
|
+
</ITGrid>
|
|
53
|
+
<ITGrid item xs={12} sm={6} md={4} lg={3}>
|
|
54
|
+
<Cell>xs=12 sm=6 md=4 lg=3</Cell>
|
|
55
|
+
</ITGrid>
|
|
56
|
+
</ITGrid>
|
|
57
|
+
),
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const SidebarContent: Story = {
|
|
61
|
+
args: { container: true, spacing: 4, columns: 12 },
|
|
62
|
+
render: (args) => (
|
|
63
|
+
<ITGrid {...args}>
|
|
64
|
+
<ITGrid item xs={12} md={3}>
|
|
65
|
+
<Cell>Sidebar (md: 3/12)</Cell>
|
|
66
|
+
</ITGrid>
|
|
67
|
+
<ITGrid item xs={12} md={9}>
|
|
68
|
+
<Cell>Main Content (md: 9/12)</Cell>
|
|
69
|
+
</ITGrid>
|
|
70
|
+
</ITGrid>
|
|
71
|
+
),
|
|
72
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
2
|
+
import { ITGridProps } from "./grid.props";
|
|
3
|
+
|
|
4
|
+
function colSpanClass(span: number | undefined, cols: number) {
|
|
5
|
+
if (span === undefined) return undefined;
|
|
6
|
+
const clamped = Math.min(Math.max(Math.round(span), 1), cols);
|
|
7
|
+
return `col-span-${clamped}`;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function breakpointSpan(span: number | undefined, bp: string, cols: number) {
|
|
11
|
+
if (span === undefined) return undefined;
|
|
12
|
+
const clamped = Math.min(Math.max(Math.round(span), 1), cols);
|
|
13
|
+
return `${bp}:col-span-${clamped}`;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default function ITGrid({
|
|
17
|
+
children,
|
|
18
|
+
container,
|
|
19
|
+
item,
|
|
20
|
+
spacing = 0,
|
|
21
|
+
columns = 12,
|
|
22
|
+
xs,
|
|
23
|
+
sm,
|
|
24
|
+
md,
|
|
25
|
+
lg,
|
|
26
|
+
xl,
|
|
27
|
+
className,
|
|
28
|
+
style,
|
|
29
|
+
as: Component = "div",
|
|
30
|
+
}: ITGridProps) {
|
|
31
|
+
if (container) {
|
|
32
|
+
return (
|
|
33
|
+
<Component
|
|
34
|
+
className={clsx("grid", className)}
|
|
35
|
+
style={{
|
|
36
|
+
gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))`,
|
|
37
|
+
gap: spacing > 0 ? `${spacing * 0.25}rem` : undefined,
|
|
38
|
+
...style,
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
41
|
+
{children}
|
|
42
|
+
</Component>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (item) {
|
|
47
|
+
return (
|
|
48
|
+
<Component
|
|
49
|
+
className={clsx(
|
|
50
|
+
colSpanClass(xs ?? sm, columns),
|
|
51
|
+
sm !== undefined && breakpointSpan(sm, "sm", columns),
|
|
52
|
+
md !== undefined && breakpointSpan(md, "md", columns),
|
|
53
|
+
lg !== undefined && breakpointSpan(lg, "lg", columns),
|
|
54
|
+
xl !== undefined && breakpointSpan(xl, "xl", columns),
|
|
55
|
+
className
|
|
56
|
+
)}
|
|
57
|
+
style={style}
|
|
58
|
+
>
|
|
59
|
+
{children}
|
|
60
|
+
</Component>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<Component className={className} style={style}>
|
|
66
|
+
{children}
|
|
67
|
+
</Component>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { ITImageProps } from "./image.props";
|
|
3
|
+
|
|
4
|
+
const ITImage = ({
|
|
5
|
+
src,
|
|
6
|
+
alt,
|
|
7
|
+
className = "",
|
|
8
|
+
fallback = "",
|
|
9
|
+
}: ITImageProps) => {
|
|
10
|
+
const [imageError, setImageError] = useState(false);
|
|
11
|
+
|
|
12
|
+
const handleImageError = () => {
|
|
13
|
+
setImageError(true);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<div
|
|
18
|
+
className={`${className} flex items-center justify-center bg-transparent`}
|
|
19
|
+
>
|
|
20
|
+
{imageError ? (
|
|
21
|
+
<img
|
|
22
|
+
src={fallback}
|
|
23
|
+
alt="Fallback"
|
|
24
|
+
className="w-full h-full object-cover"
|
|
25
|
+
/>
|
|
26
|
+
) : (
|
|
27
|
+
<img
|
|
28
|
+
src={src}
|
|
29
|
+
alt={alt}
|
|
30
|
+
onError={handleImageError}
|
|
31
|
+
className="w-full h-full object-cover"
|
|
32
|
+
/>
|
|
33
|
+
)}
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default ITImage;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ColorsTypes } from "@app/types/colors.types";
|
|
2
|
+
import { SizesTypes } from "@app/types/sizes.types";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
|
|
5
|
+
export interface ITInputProps {
|
|
6
|
+
name: string;
|
|
7
|
+
type?:
|
|
8
|
+
| "text"
|
|
9
|
+
| "password"
|
|
10
|
+
| "number"
|
|
11
|
+
| "email"
|
|
12
|
+
| "checkbox"
|
|
13
|
+
| "radio"
|
|
14
|
+
| "textarea";
|
|
15
|
+
label?: string;
|
|
16
|
+
currencyFormat?: boolean;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
value?: any;
|
|
19
|
+
onChange: (event: any) => void;
|
|
20
|
+
onBlur?: (
|
|
21
|
+
event:
|
|
22
|
+
| React.FocusEvent<HTMLInputElement>
|
|
23
|
+
| React.FocusEvent<HTMLTextAreaElement, Element>
|
|
24
|
+
) => void;
|
|
25
|
+
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
26
|
+
showHintLength?: boolean;
|
|
27
|
+
maxLength?: number;
|
|
28
|
+
minLength?: number;
|
|
29
|
+
variant?: ColorsTypes;
|
|
30
|
+
size?: SizesTypes;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
containerClassName?: string;
|
|
33
|
+
labelClassName?: string;
|
|
34
|
+
className?: string;
|
|
35
|
+
touched?: boolean;
|
|
36
|
+
error?: string | boolean;
|
|
37
|
+
required?: boolean;
|
|
38
|
+
formatNumber?:boolean;
|
|
39
|
+
autoFocus?: boolean;
|
|
40
|
+
focusContent?:boolean;
|
|
41
|
+
onClick?: () => void;
|
|
42
|
+
iconLeft?: ReactNode;
|
|
43
|
+
iconRight?: ReactNode;
|
|
44
|
+
checked?: boolean;
|
|
45
|
+
rows?: number;
|
|
46
|
+
min?: number;
|
|
47
|
+
max?: number;
|
|
48
|
+
readOnly?: boolean;
|
|
49
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import ITInput from './input';
|
|
3
|
+
import { FaUser, FaLock, FaEnvelope } from 'react-icons/fa';
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Components/Form Elements/ITInput',
|
|
7
|
+
component: ITInput,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'centered',
|
|
10
|
+
},
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
argTypes: {
|
|
13
|
+
type: {
|
|
14
|
+
control: 'select',
|
|
15
|
+
options: ['text', 'password', 'number', 'email', 'textarea'],
|
|
16
|
+
},
|
|
17
|
+
disabled: { control: 'boolean' },
|
|
18
|
+
error: { control: 'text' },
|
|
19
|
+
},
|
|
20
|
+
} satisfies Meta<typeof ITInput>;
|
|
21
|
+
|
|
22
|
+
export default meta;
|
|
23
|
+
type Story = StoryObj<typeof meta>;
|
|
24
|
+
|
|
25
|
+
export const Default: any = {
|
|
26
|
+
args: {
|
|
27
|
+
name: 'default-input',
|
|
28
|
+
placeholder: 'Type something...',
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const WithLabel: any = {
|
|
33
|
+
args: {
|
|
34
|
+
name: 'labeled-input',
|
|
35
|
+
label: 'Username',
|
|
36
|
+
placeholder: 'Enter your username',
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const WithIcons: any = {
|
|
41
|
+
args: {
|
|
42
|
+
name: 'icon-input',
|
|
43
|
+
label: 'Email',
|
|
44
|
+
type: 'email',
|
|
45
|
+
placeholder: 'example@mail.com',
|
|
46
|
+
iconLeft: <FaEnvelope className="text-gray-400" />,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const ClickableIcons: any = {
|
|
51
|
+
args: {
|
|
52
|
+
name: 'search-input',
|
|
53
|
+
label: 'Search',
|
|
54
|
+
placeholder: 'Search...',
|
|
55
|
+
iconRight: (
|
|
56
|
+
<button
|
|
57
|
+
onClick={() => alert('Search clicked!')}
|
|
58
|
+
className="text-gray-500 hover:text-blue-500 transition-colors"
|
|
59
|
+
>
|
|
60
|
+
<FaUser />
|
|
61
|
+
</button>
|
|
62
|
+
),
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const Password: any = {
|
|
67
|
+
args: {
|
|
68
|
+
name: 'password-input',
|
|
69
|
+
label: 'Password',
|
|
70
|
+
type: 'password',
|
|
71
|
+
placeholder: '••••••••',
|
|
72
|
+
iconLeft: <FaLock className="text-gray-400" />,
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const WithError: any = {
|
|
77
|
+
args: {
|
|
78
|
+
name: 'error-input',
|
|
79
|
+
label: 'Email',
|
|
80
|
+
value: 'invalid-email',
|
|
81
|
+
touched: true,
|
|
82
|
+
error: 'Please enter a valid email address',
|
|
83
|
+
iconLeft: <FaEnvelope className="text-gray-400" />,
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export const Disabled: any = {
|
|
88
|
+
args: {
|
|
89
|
+
name: 'disabled-input',
|
|
90
|
+
label: 'Disabled Input',
|
|
91
|
+
value: 'Cannot edit this',
|
|
92
|
+
disabled: true,
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export const TextArea: any = {
|
|
97
|
+
args: {
|
|
98
|
+
name: 'textarea',
|
|
99
|
+
label: 'Description',
|
|
100
|
+
type: 'textarea',
|
|
101
|
+
placeholder: 'Write a detailed description...',
|
|
102
|
+
rows: 4,
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const NumberInput: any = {
|
|
107
|
+
args: {
|
|
108
|
+
name: 'number-input',
|
|
109
|
+
label: 'Quantity',
|
|
110
|
+
type: 'number',
|
|
111
|
+
placeholder: '0',
|
|
112
|
+
min: 0,
|
|
113
|
+
max: 100,
|
|
114
|
+
},
|
|
115
|
+
};
|