@chotot/clad-ui 2.0.0-next.4 โ 2.1.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 +7 -9
- package/dist/components/Announcer/Announcer.stories.d.ts.map +1 -1
- package/dist/components/Announcer/Announcer.stories.js +1 -26
- package/dist/components/Badge/Badge.d.ts +1 -1
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/Badge/Badge.js +34 -24
- package/dist/components/Badge/Badge.stories.d.ts.map +1 -1
- package/dist/components/Badge/Badge.stories.js +61 -54
- package/dist/components/Badge/Badge.styles.d.ts +1 -0
- package/dist/components/Badge/Badge.styles.d.ts.map +1 -1
- package/dist/components/Badge/Badge.styles.js +17 -8
- package/dist/components/Breadcrumbs/BreadcrumbItem.d.ts +6 -0
- package/dist/components/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -0
- package/dist/components/Breadcrumbs/BreadcrumbItem.js +11 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +7 -25
- package/dist/components/Breadcrumbs/Breadcrumbs.stories.d.ts +0 -11
- package/dist/components/Breadcrumbs/Breadcrumbs.stories.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.stories.js +47 -96
- package/dist/components/Button/Button.d.ts +8 -17
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +5 -3
- package/dist/components/Button/Button.stories.d.ts +78 -4
- package/dist/components/Button/Button.stories.d.ts.map +1 -1
- package/dist/components/Button/Button.stories.js +105 -11
- package/dist/components/Button/Button.styles.d.ts.map +1 -1
- package/dist/components/Button/Button.styles.js +30 -11
- package/dist/components/Button/GhostButton.d.ts +6 -26
- package/dist/components/Button/GhostButton.d.ts.map +1 -1
- package/dist/components/Button/GhostButton.js +4 -4
- package/dist/components/Button/GhostButton.stories.d.ts +80 -2
- package/dist/components/Button/GhostButton.stories.d.ts.map +1 -1
- package/dist/components/Button/GhostButton.stories.js +80 -7
- package/dist/components/Button/GhostButton.styles.d.ts.map +1 -1
- package/dist/components/Button/GhostButton.styles.js +17 -1
- package/dist/components/Button/IconButton.d.ts +1 -2
- package/dist/components/Button/IconButton.d.ts.map +1 -1
- package/dist/components/Button/IconButton.js +2 -7
- package/dist/components/Button/IconButton.stories.d.ts +75 -3
- package/dist/components/Button/IconButton.stories.d.ts.map +1 -1
- package/dist/components/Button/IconButton.stories.js +74 -7
- package/dist/components/Button/constant.d.ts +10 -0
- package/dist/components/Button/constant.d.ts.map +1 -0
- package/dist/components/Button/constant.js +21 -0
- package/dist/components/Checkbox/Checkbox.stories.d.ts +0 -10
- package/dist/components/Checkbox/Checkbox.stories.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.stories.js +1 -34
- package/dist/components/Chip/Chip.stories.js +1 -1
- package/dist/components/CurrencyInput/CurrencyInput.stories.js +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +4 -0
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.js +4 -1
- package/dist/components/DatePicker/DatePicker.stories.d.ts +1 -0
- package/dist/components/DatePicker/DatePicker.stories.d.ts.map +1 -1
- package/dist/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/components/Dropdown/Dropdown.js +5 -0
- package/dist/components/Dropdown/Dropdown.styles.d.ts.map +1 -1
- package/dist/components/Dropdown/Dropdown.styles.js +27 -3
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/Input.js +17 -15
- package/dist/components/Input/Input.stories.js +1 -1
- package/dist/components/Pagination/PageItem.d.ts +6 -11
- package/dist/components/Pagination/PageItem.d.ts.map +1 -1
- package/dist/components/Pagination/PageItem.js +11 -5
- package/dist/components/Pagination/Pagination.stories.d.ts +0 -3
- package/dist/components/Pagination/Pagination.stories.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.stories.js +5 -15
- package/dist/components/Popover/Popover.stories.d.ts.map +1 -1
- package/dist/components/Popover/Popover.stories.js +1 -0
- package/dist/components/RadioButton/RadioButton.stories.d.ts +0 -10
- package/dist/components/RadioButton/RadioButton.stories.d.ts.map +1 -1
- package/dist/components/RadioButton/RadioButton.stories.js +1 -38
- package/dist/components/RowItem/RowItem.d.ts.map +1 -1
- package/dist/components/RowItem/RowItem.js +3 -6
- package/dist/components/RowItem/RowItem.stories.d.ts.map +1 -1
- package/dist/components/RowItem/RowItem.stories.js +1 -2
- package/dist/components/Slider/Slider.stories.js +1 -1
- package/dist/components/Snack/Snack.stories.js +1 -1
- package/dist/components/Tabs/Tab.d.ts +7 -14
- package/dist/components/Tabs/Tab.d.ts.map +1 -1
- package/dist/components/Tabs/Tab.js +6 -9
- package/dist/components/Tabs/Tabs.stories.d.ts +3 -3
- package/dist/components/Tabs/Tabs.stories.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.stories.js +32 -10
- package/dist/components/Tabs/Tabs.styles.js +1 -1
- package/dist/components/TextArea/TextArea.d.ts +1 -1
- package/dist/components/TextArea/TextArea.stories.js +1 -1
- package/dist/components/TextLabel/TextLabel.stories.js +1 -1
- package/dist/components/ToggleSwitch/ToggleSwitch.stories.js +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.js +2 -1
- package/dist/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.stories.js +1 -30
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/patterns/Drawer/Drawer.d.ts +1 -0
- package/dist/patterns/Drawer/Drawer.d.ts.map +1 -1
- package/dist/patterns/Drawer/Drawer.js +7 -16
- package/dist/patterns/Drawer/Drawer.stories.d.ts +6 -0
- package/dist/patterns/Drawer/Drawer.stories.d.ts.map +1 -1
- package/dist/patterns/Drawer/Drawer.stories.js +23 -24
- package/dist/patterns/Drawer/Drawer.styles.d.ts +1 -2
- package/dist/patterns/Drawer/Drawer.styles.d.ts.map +1 -1
- package/dist/patterns/Drawer/Drawer.styles.js +1 -6
- package/dist/patterns/EmptyState/EmptyState.d.ts +1 -1
- package/dist/patterns/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/patterns/EmptyState/EmptyState.js +52 -47
- package/dist/patterns/EmptyState/EmptyState.stories.d.ts +11 -1
- package/dist/patterns/EmptyState/EmptyState.stories.d.ts.map +1 -1
- package/dist/patterns/EmptyState/EmptyState.stories.js +51 -12
- package/dist/patterns/EmptyState/EmptyState.styles.d.ts +3 -15
- package/dist/patterns/EmptyState/EmptyState.styles.d.ts.map +1 -1
- package/dist/patterns/EmptyState/EmptyState.styles.js +23 -40
- package/dist/patterns/InputGroup/InputGroup.d.ts +1 -1
- package/dist/patterns/InputGroup/InputGroup.styles.d.ts.map +1 -1
- package/dist/patterns/InputGroup/InputGroup.styles.js +3 -2
- package/dist/patterns/MultiSearchDropdown/MultiSearchDropdown.d.ts +1 -1
- package/dist/patterns/MultiSearchDropdown/MultiSearchDropdown.d.ts.map +1 -1
- package/dist/patterns/MultiSearchDropdown/MultiSearchDropdown.js +4 -0
- package/dist/patterns/MultiSearchDropdown/MultiSearchDropdown.stories.js +1 -1
- package/dist/patterns/Popup/Popup.d.ts +1 -0
- package/dist/patterns/Popup/Popup.d.ts.map +1 -1
- package/dist/patterns/Popup/Popup.js +6 -15
- package/dist/patterns/Popup/Popup.stories.d.ts +6 -0
- package/dist/patterns/Popup/Popup.stories.d.ts.map +1 -1
- package/dist/patterns/Popup/Popup.stories.js +29 -30
- package/dist/patterns/Popup/Popup.styles.d.ts +1 -2
- package/dist/patterns/Popup/Popup.styles.d.ts.map +1 -1
- package/dist/patterns/Popup/Popup.styles.js +1 -6
- package/dist/patterns/RangeInput/RangeInput.d.ts +30 -0
- package/dist/patterns/RangeInput/RangeInput.d.ts.map +1 -0
- package/dist/patterns/RangeInput/RangeInput.js +27 -0
- package/dist/patterns/RangeInput/RangeInput.stories.d.ts +68 -0
- package/dist/patterns/RangeInput/RangeInput.stories.d.ts.map +1 -0
- package/dist/patterns/RangeInput/RangeInput.stories.js +121 -0
- package/dist/patterns/RangeInput/RangeInput.styles.d.ts +5 -0
- package/dist/patterns/RangeInput/RangeInput.styles.d.ts.map +1 -0
- package/dist/patterns/RangeInput/RangeInput.styles.js +32 -0
- package/dist/patterns/SearchInput/SearchInput.d.ts +1 -1
- package/dist/patterns/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/patterns/SearchInput/SearchInput.js +7 -8
- package/dist/patterns/SearchInput/SearchInput.stories.d.ts.map +1 -1
- package/dist/patterns/SearchInput/SearchInput.stories.js +1 -3
- package/dist/patterns/Searchbar/Searchbar.d.ts +28 -0
- package/dist/patterns/Searchbar/Searchbar.d.ts.map +1 -0
- package/dist/patterns/Searchbar/Searchbar.js +37 -0
- package/dist/patterns/Searchbar/Searchbar.stories.d.ts +70 -0
- package/dist/patterns/Searchbar/Searchbar.stories.d.ts.map +1 -0
- package/dist/patterns/Searchbar/Searchbar.stories.js +80 -0
- package/dist/patterns/Searchbar/Searchbar.styles.d.ts +3 -0
- package/dist/patterns/Searchbar/Searchbar.styles.d.ts.map +1 -0
- package/dist/patterns/Searchbar/Searchbar.styles.js +48 -0
- package/dist/patterns/TagCloud/TagCloud.d.ts +1 -1
- package/dist/patterns/TagCloud/TagCloud.stories.d.ts.map +1 -1
- package/dist/patterns/TagCloud/TagCloud.stories.js +1 -5
- package/dist/patterns/index.d.ts +4 -0
- package/dist/patterns/index.d.ts.map +1 -1
- package/dist/patterns/index.js +2 -0
- package/dist/storybook/ColorFoundationList.js +2 -2
- package/dist/theme/chotot.d.ts +57 -52
- package/dist/theme/chotot.d.ts.map +1 -1
- package/dist/theme/chotot.js +18 -13
- package/dist/theme/ct-job.d.ts +56 -51
- package/dist/theme/ct-job.d.ts.map +1 -1
- package/dist/theme/ct-pty.d.ts +56 -51
- package/dist/theme/ct-pty.d.ts.map +1 -1
- package/dist/theme/ct-veh.d.ts +57 -52
- package/dist/theme/ct-veh.d.ts.map +1 -1
- package/dist/theme/ct-veh.js +1 -1
- package/dist/theme/mudah.js +1 -1
- package/dist/typography/HeaderAnnotation.d.ts +19 -0
- package/dist/typography/HeaderAnnotation.d.ts.map +1 -0
- package/dist/typography/HeaderAnnotation.js +15 -0
- package/dist/typography/index.d.ts +2 -0
- package/dist/typography/index.d.ts.map +1 -1
- package/dist/typography/index.js +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/scrollLock/index.d.ts +7 -0
- package/dist/utils/scrollLock/index.d.ts.map +1 -0
- package/dist/utils/scrollLock/index.js +7 -0
- package/dist/utils/scrollLock/scrollLock.styles.d.ts +6 -0
- package/dist/utils/scrollLock/scrollLock.styles.d.ts.map +1 -0
- package/dist/utils/scrollLock/scrollLock.styles.js +9 -0
- package/dist/utils/scrollLock/useBodyScrollLock.d.ts +10 -0
- package/dist/utils/scrollLock/useBodyScrollLock.d.ts.map +1 -0
- package/dist/utils/scrollLock/useBodyScrollLock.js +41 -0
- package/dist/utils/sx.d.ts +8 -8
- package/dist/utils/types.d.ts +23 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/utils/types.js +5 -0
- package/package.json +4 -3
- package/dist/storybook/GuideImage.d.ts +0 -9
- package/dist/storybook/GuideImage.d.ts.map +0 -1
- package/dist/storybook/GuideImage.js +0 -40
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { css } from '@linaria/core';
|
|
3
3
|
import IconButton from './IconButton';
|
|
4
4
|
import * as iconComponents from '../../icons';
|
|
5
|
+
import { BUTTON_COLORS, BUTTON_RADII, BUTTON_SIZES, BUTTON_VARIANTS, BUTTON_WEIGHTS, SIZE_OPTIONS, } from './constant';
|
|
5
6
|
// get the list of monochrome icon names
|
|
6
7
|
const icons = Object.keys(iconComponents).filter((iconName) => iconComponents[iconName].type === 'monochrome');
|
|
7
8
|
const iconButtonStories = {
|
|
@@ -19,11 +20,61 @@ const iconButtonStories = {
|
|
|
19
20
|
},
|
|
20
21
|
},
|
|
21
22
|
argTypes: {
|
|
23
|
+
variant: {
|
|
24
|
+
control: { type: 'select' },
|
|
25
|
+
options: BUTTON_VARIANTS,
|
|
26
|
+
description: 'Different looks of button',
|
|
27
|
+
},
|
|
28
|
+
color: {
|
|
29
|
+
control: { type: 'select' },
|
|
30
|
+
options: BUTTON_COLORS,
|
|
31
|
+
description: 'Color of the background (solid) or stroke (outline) of the button',
|
|
32
|
+
},
|
|
33
|
+
radius: {
|
|
34
|
+
control: { type: 'select' },
|
|
35
|
+
options: BUTTON_RADII,
|
|
36
|
+
description: 'Border radius',
|
|
37
|
+
},
|
|
38
|
+
weight: {
|
|
39
|
+
control: { type: 'select' },
|
|
40
|
+
options: BUTTON_WEIGHTS,
|
|
41
|
+
description: 'Font weight of label',
|
|
42
|
+
},
|
|
43
|
+
size: {
|
|
44
|
+
control: { type: 'select' },
|
|
45
|
+
options: BUTTON_SIZES,
|
|
46
|
+
description: "Button's size",
|
|
47
|
+
},
|
|
48
|
+
width: {
|
|
49
|
+
control: { type: 'select' },
|
|
50
|
+
options: SIZE_OPTIONS,
|
|
51
|
+
description: 'Button width',
|
|
52
|
+
},
|
|
53
|
+
disabled: {
|
|
54
|
+
control: { type: 'boolean' },
|
|
55
|
+
description: 'Whether this button is disabled. No events triggered.',
|
|
56
|
+
},
|
|
57
|
+
extraClasses: {
|
|
58
|
+
control: { type: 'text' },
|
|
59
|
+
description: 'Additional classes to be added for customization',
|
|
60
|
+
},
|
|
61
|
+
isLoading: {
|
|
62
|
+
control: { type: 'boolean' },
|
|
63
|
+
description: 'Display loading icon',
|
|
64
|
+
},
|
|
65
|
+
children: {
|
|
66
|
+
control: { type: 'select' },
|
|
67
|
+
options: icons,
|
|
68
|
+
description: 'Icon component to display',
|
|
69
|
+
},
|
|
22
70
|
as: {
|
|
71
|
+
control: { type: 'select' },
|
|
23
72
|
options: ['button', 'a'],
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
73
|
+
description: 'HTML element or component to render as',
|
|
74
|
+
},
|
|
75
|
+
onClick: {
|
|
76
|
+
action: 'clicked',
|
|
77
|
+
description: 'Click event handler',
|
|
27
78
|
},
|
|
28
79
|
},
|
|
29
80
|
};
|
|
@@ -52,9 +103,7 @@ export const Overview = {
|
|
|
52
103
|
},
|
|
53
104
|
};
|
|
54
105
|
export const Variants = {
|
|
55
|
-
render: (
|
|
56
|
-
// Below is sample class definition, colors should be from theme
|
|
57
|
-
<div style={{ display: 'flex', gap: '8px' }}>
|
|
106
|
+
render: () => (<div style={{ display: 'flex', gap: '8px' }}>
|
|
58
107
|
<IconButton variant="default" color="primary" size="large">
|
|
59
108
|
<iconComponents.Heart />
|
|
60
109
|
</IconButton>
|
|
@@ -77,7 +126,7 @@ export const Variants = {
|
|
|
77
126
|
},
|
|
78
127
|
};
|
|
79
128
|
export const ExtraClasses = {
|
|
80
|
-
render: (
|
|
129
|
+
render: () => {
|
|
81
130
|
// Below is sample class definition, colors should be from theme
|
|
82
131
|
const extraClass = css `
|
|
83
132
|
border: none;
|
|
@@ -105,3 +154,21 @@ export const ExtraClasses = {
|
|
|
105
154
|
},
|
|
106
155
|
},
|
|
107
156
|
};
|
|
157
|
+
export const ButtonWithNextLink = () => {
|
|
158
|
+
// replace "a" with NextLink
|
|
159
|
+
const NextLink = 'a';
|
|
160
|
+
return (<div style={{ display: 'flex', gap: '8px' }}>
|
|
161
|
+
<IconButton as={NextLink} href="/iframe.html?viewMode=story&id=components-buttons-iconbutton--button-with-next-link&example=click-me-1" variant="default" color="primary" size="large">
|
|
162
|
+
<iconComponents.Heart />
|
|
163
|
+
</IconButton>
|
|
164
|
+
<IconButton as={NextLink} href="/iframe.html?viewMode=story&id=components-buttons-iconbutton--button-with-next-link&example=click-me-2" variant="solid" color="primary" size="large">
|
|
165
|
+
<iconComponents.Heart />
|
|
166
|
+
</IconButton>
|
|
167
|
+
<IconButton as={NextLink} href="/iframe.html?viewMode=story&id=components-buttons-iconbutton--button-with-next-link&example=click-me-3" variant="tonal" color="primary" size="large">
|
|
168
|
+
<iconComponents.Heart />
|
|
169
|
+
</IconButton>
|
|
170
|
+
<IconButton as={NextLink} href="/iframe.html?viewMode=story&id=components-buttons-iconbutton--button-with-next-link&example=click-me-4" variant="outline" color="primary" size="large">
|
|
171
|
+
<iconComponents.Heart />
|
|
172
|
+
</IconButton>
|
|
173
|
+
</div>);
|
|
174
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ButtonColor, type ButtonVariant } from './Button';
|
|
2
|
+
export declare const BUTTON_VARIANTS: ButtonVariant[];
|
|
3
|
+
export declare const BUTTON_COLORS: ButtonColor[];
|
|
4
|
+
export declare const BUTTON_SIZES: string[];
|
|
5
|
+
export declare const BUTTON_RADII: string[];
|
|
6
|
+
export declare const BUTTON_WEIGHTS: string[];
|
|
7
|
+
export declare const SIZE_OPTIONS: string[];
|
|
8
|
+
export declare const GHOST_BUTTON_VARIANTS: string[];
|
|
9
|
+
export declare const GHOST_BUTTON_COLORS: string[];
|
|
10
|
+
//# sourceMappingURL=constant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constant.d.ts","sourceRoot":"","sources":["../../../components/Button/constant.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAEhE,eAAO,MAAM,eAAe,EAAE,aAAa,EAA6C,CAAC;AACzF,eAAO,MAAM,aAAa,EAAE,WAAW,EAYtC,CAAC;AACF,eAAO,MAAM,YAAY,UAAyC,CAAC;AACnE,eAAO,MAAM,YAAY,UAA+B,CAAC;AACzD,eAAO,MAAM,cAAc,UAAqB,CAAC;AACjD,eAAO,MAAM,YAAY,UAA2B,CAAC;AACrD,eAAO,MAAM,qBAAqB,UAA0B,CAAC;AAC7D,eAAO,MAAM,mBAAmB,UAA+C,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import theme from '@clad-ui/theme';
|
|
2
|
+
export const BUTTON_VARIANTS = ['default', 'outline', 'solid', 'tonal'];
|
|
3
|
+
export const BUTTON_COLORS = [
|
|
4
|
+
'error',
|
|
5
|
+
'info',
|
|
6
|
+
'neutral',
|
|
7
|
+
'primary',
|
|
8
|
+
'success',
|
|
9
|
+
'tertiary',
|
|
10
|
+
'chotot',
|
|
11
|
+
'accent',
|
|
12
|
+
'caution',
|
|
13
|
+
'critical',
|
|
14
|
+
'positive',
|
|
15
|
+
];
|
|
16
|
+
export const BUTTON_SIZES = ['xlarge', 'large', 'medium', 'small'];
|
|
17
|
+
export const BUTTON_RADII = ['circle', 'normal', 'pill'];
|
|
18
|
+
export const BUTTON_WEIGHTS = ['bold', 'normal'];
|
|
19
|
+
export const SIZE_OPTIONS = Object.keys(theme.sizes);
|
|
20
|
+
export const GHOST_BUTTON_VARIANTS = ['button', 'hyperlink'];
|
|
21
|
+
export const GHOST_BUTTON_COLORS = ['link', 'primary', 'secondary', 'tertiary'];
|
|
@@ -76,14 +76,4 @@ export declare const Colors: {
|
|
|
76
76
|
};
|
|
77
77
|
};
|
|
78
78
|
};
|
|
79
|
-
export declare const UsageGuide: {
|
|
80
|
-
render: () => JSX.Element;
|
|
81
|
-
parameters: {
|
|
82
|
-
docs: {
|
|
83
|
-
source: {
|
|
84
|
-
code: never[];
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
79
|
//# sourceMappingURL=Checkbox.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.stories.d.ts","sourceRoot":"","sources":["../../../components/Checkbox/Checkbox.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Checkbox.stories.d.ts","sourceRoot":"","sources":["../../../components/Checkbox/Checkbox.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BpB,CAAC;AAEF,eAAe,eAAe,CAAC;AAE/B,eAAO,MAAM,QAAQ;;CAsBpB,CAAC;AAEF,eAAO,MAAM,YAAY,mBAgBxB,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;;;;CA2BrB,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;CA4C1B,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;;;;CA+BpB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;CA0BlB,CAAC"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { css } from '@linaria/core';
|
|
3
|
-
import GuideImage, { guideImageClass } from '../../storybook/GuideImage';
|
|
4
2
|
import Checkbox from './Checkbox';
|
|
5
|
-
import Grid from '../Grid/Grid';
|
|
6
|
-
import Col from '../Grid/Col';
|
|
7
3
|
const checkboxStories = {
|
|
8
4
|
title: 'Components/Checkbox',
|
|
9
5
|
component: Checkbox,
|
|
@@ -13,14 +9,13 @@ const checkboxStories = {
|
|
|
13
9
|
description: {
|
|
14
10
|
component: `Clad UI Checkbox Component
|
|
15
11
|
|
|
16
|
-
\`โ
Stable\` [\`๐จ Figma Specs\`](https://www.figma.com/
|
|
12
|
+
\`โ
Stable\` [\`๐จ Figma Specs\`](https://www.figma.com/design/DfQM6G9p8PSNEoOzNGRjWD/v3.0-CHOTOT-Design-System---Processing?node-id=52-47704&t=hz8QJLqNrGvTVY8R-4)
|
|
17
13
|
|
|
18
14
|
## How to use
|
|
19
15
|
- Use case: When we want user to select **ONE OR MORE** option.
|
|
20
16
|
- Position: Placing it on the right hand side of label text is preferred (support majority of right-handed users).
|
|
21
17
|
- Colors: Default is **primary** (orange300), but, we can change it via \`color\` prop.
|
|
22
18
|
|
|
23
|
-
<img className="${guideImageClass}" src="./checkbox-how.png" />
|
|
24
19
|
`,
|
|
25
20
|
},
|
|
26
21
|
},
|
|
@@ -171,31 +166,3 @@ export const Colors = {
|
|
|
171
166
|
},
|
|
172
167
|
},
|
|
173
168
|
};
|
|
174
|
-
const paddingTopClass = css `
|
|
175
|
-
padding-top: 32px;
|
|
176
|
-
`;
|
|
177
|
-
export const UsageGuide = {
|
|
178
|
-
render: () => (<>
|
|
179
|
-
<h4>DO's</h4>
|
|
180
|
-
<GuideImage isGood src="./checkbox-do.png" alt="Checkbox - Do"/>
|
|
181
|
-
<h4 className={paddingTopClass}>DON'Ts</h4>
|
|
182
|
-
<Grid rowCols={[1, 2]} gutterx="sm" align="center">
|
|
183
|
-
<Col>
|
|
184
|
-
<GuideImage isBad src="./checkbox-dont-1.png" alt="Checkbox - Dont_1"/>
|
|
185
|
-
<p>Our checkboxes don't have hover state.</p>
|
|
186
|
-
</Col>
|
|
187
|
-
<Col>
|
|
188
|
-
<GuideImage isBad src="./checkbox-dont-2.png" alt="Checkbox - Dont_2"/>
|
|
189
|
-
<ul>
|
|
190
|
-
<li>Wrong checkbox shape (these round shapes make them look like Radio Button).</li>
|
|
191
|
-
<li>Unchecked state should be gray.</li>
|
|
192
|
-
</ul>
|
|
193
|
-
</Col>
|
|
194
|
-
</Grid>
|
|
195
|
-
</>),
|
|
196
|
-
parameters: {
|
|
197
|
-
docs: {
|
|
198
|
-
source: { code: [] },
|
|
199
|
-
},
|
|
200
|
-
},
|
|
201
|
-
};
|
|
@@ -13,7 +13,7 @@ const chipStories = {
|
|
|
13
13
|
description: {
|
|
14
14
|
component: `Chip is the atom component to be used as stand-alone Badges, or in patterns like Tag Cloud, Tabs.
|
|
15
15
|
|
|
16
|
-
\`๐งช Revamped in 1.2+ \` [\`๐จ Figma Specs\`](https://www.figma.com/
|
|
16
|
+
\`๐งช Revamped in 1.2+ \` [\`๐จ Figma Specs\`](https://www.figma.com/design/DfQM6G9p8PSNEoOzNGRjWD/v3.0-CHOTOT-Design-System---Processing?node-id=44-8749&t=hz8QJLqNrGvTVY8R-4)
|
|
17
17
|
`,
|
|
18
18
|
},
|
|
19
19
|
},
|
|
@@ -14,7 +14,7 @@ const currencyInputStories = {
|
|
|
14
14
|
description: {
|
|
15
15
|
component: `CurrencyInput component allows users to input money amount with numeric keyboard, automatic thousand separators, currency indicator
|
|
16
16
|
|
|
17
|
-
\`โ
Stable\` [\`๐จ Figma Specs\`](https://www.figma.com/
|
|
17
|
+
\`โ
Stable\` [\`๐จ Figma Specs\`](https://www.figma.com/design/DfQM6G9p8PSNEoOzNGRjWD/v3.0-CHOTOT-Design-System---Processing?node-id=865-13593&t=hz8QJLqNrGvTVY8R-4)
|
|
18
18
|
`,
|
|
19
19
|
},
|
|
20
20
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../components/DatePicker/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA2B/B,KAAK,UAAU,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAGxE,oBAAY,UAAU;IACpB,QAAQ,eAAe;IACvB,IAAI,UAAU;IACd,MAAM,YAAY;CACnB;AAED,KAAK,eAAe,GAAG;IACrB;;OAEG;IACH,KAAK,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB;;OAEG;IACH,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC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IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,aAAa,CAAC,EAAE,IAAI,EAAE,CAAC;IACvB;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;IAC1C;;OAEG;IACH,kBAAkB,CAAC,EAAE,UAAU,EAAE,CAAC;IAClC;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACtB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,CAAC;AAyBF,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../components/DatePicker/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA2B/B,KAAK,UAAU,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAGxE,oBAAY,UAAU;IACpB,QAAQ,eAAe;IACvB,IAAI,UAAU;IACd,MAAM,YAAY;CACnB;AAED,KAAK,eAAe,GAAG;IACrB;;OAEG;IACH,KAAK,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB;;OAEG;IACH,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH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AAC;IAC7B;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,aAAa,CAAC,EAAE,IAAI,EAAE,CAAC;IACvB;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;IAC1C;;OAEG;IACH,kBAAkB,CAAC,EAAE,UAAU,EAAE,CAAC;IAClC;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACtB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,CAAC;AAyBF,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAumBzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -37,7 +37,7 @@ const generateDateValue = (date) => {
|
|
|
37
37
|
date: (_c = date === null || date === void 0 ? void 0 : date.getDate()) !== null && _c !== void 0 ? _c : null,
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
|
-
const DatePicker = ({ value, defaultValue = new Date(2025, 1, 1), label, required, onChange, onBlur = noop, onFocus = noop, onClickOutside = noop, onInputFocus = noop, onYearSelect = noop, onMonthSelect = noop, onNextMonthSelect = noop, onPrevMonthSelect = noop, onCalendarOpen = noop, onCalendarClose = noop, icon, disabled, disabledDates = [], disabledDatesFn, defaultOpen = false, minYear = 1900, maxYear = 2100, minDate = null, maxDate = null, allowClear = true, format = DateFormat.DdMmYyyy, helptext = '', hightlightCurrentDate = true, }) => {
|
|
40
|
+
const DatePicker = ({ value, defaultValue = new Date(2025, 1, 1), label, required, onChange, onBlur = noop, onFocus = noop, onClickOutside = noop, onInputFocus = noop, onYearSelect = noop, onMonthSelect = noop, onNextMonthSelect = noop, onPrevMonthSelect = noop, onCalendarOpen = noop, onCalendarClose = noop, icon, disabled, disabledDates = [], disabledDatesFn, defaultOpen = false, minYear = 1900, maxYear = 2100, minDate = null, maxDate = null, allowClear = true, allowInput = true, format = DateFormat.DdMmYyyy, helptext = '', hightlightCurrentDate = true, }) => {
|
|
41
41
|
const today = new Date();
|
|
42
42
|
const yearPanelRef = React.useRef(null);
|
|
43
43
|
const [showingMonth, setShowingMonth] = React.useState((value === null || value === void 0 ? void 0 : value.getMonth()) || defaultValue.getMonth());
|
|
@@ -361,8 +361,11 @@ const DatePicker = ({ value, defaultValue = new Date(2025, 1, 1), label, require
|
|
|
361
361
|
</CalendarBody>);
|
|
362
362
|
}, [value, showingMonth, showingYear, hightlightCurrentDate]);
|
|
363
363
|
const handleInputDate = (e) => {
|
|
364
|
+
if (!allowInput)
|
|
365
|
+
return;
|
|
364
366
|
const { value: valueTarget } = e.target;
|
|
365
367
|
const filteredValue = valueTarget.replace(/[^0-9/]/g, ''); // only allow number or "/"
|
|
368
|
+
setShowCalendar(false);
|
|
366
369
|
setInputValue(filteredValue);
|
|
367
370
|
};
|
|
368
371
|
const handleValidateInputValue = (e) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.stories.d.ts","sourceRoot":"","sources":["../../../components/DatePicker/DatePicker.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAmB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAMtD,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;gBAiDoD,CAAC
|
|
1
|
+
{"version":3,"file":"DatePicker.stories.d.ts","sourceRoot":"","sources":["../../../components/DatePicker/DatePicker.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAmB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAMtD,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;gBAiDoD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAnC3E,CAAC;AAEF,eAAe,iBAAiB,CAAC;AAajC,eAAO,MAAM,iBAAiB;;;;;;;;;;CAwB7B,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;CA2FlB,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;CAyBnC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;CA4BnC,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;;CAsCpC,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;CA6BzB,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;CA+BhC,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;CAqC1B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;CAqC5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../components/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Dropdown.d.ts","sourceRoot":"","sources":["../../../components/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,QAAA,MAAM,WAAW,mBAAmC,CAAC;AAErD,KAAK,IAAI,GAAG,CAAC,O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AC,EAAE,IAAI,CAAC;IACb,aAAa,CAAC,EAAE,KAAK,CAAC;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1B;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAuNrC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -7,6 +7,7 @@ import noop from '../../utils/noop';
|
|
|
7
7
|
import ChevronDownFilled from '../../icons/ChevronDownFilled';
|
|
8
8
|
import inputClasses, { Container, InputWrapper, Paragraph } from '../Input/Input.styles';
|
|
9
9
|
import { Menu, Item, LeftIcon } from './Dropdown.styles';
|
|
10
|
+
import SvgCheck from '../../icons/Check';
|
|
10
11
|
const { sizes, colors } = theme;
|
|
11
12
|
const keysOfSizes = [...Object.keys(sizes)];
|
|
12
13
|
/**
|
|
@@ -129,6 +130,10 @@ const Dropdown = ({ className = '', id = '', name = '', label = '', value = '',
|
|
|
129
130
|
{options.map((option) => (<Item role="menuitem" key={option.value} value={option.value} onClick={handleOptionClick} className={option.value === value ? 'selected' : ''}>
|
|
130
131
|
{option.icon}
|
|
131
132
|
{option.label}
|
|
133
|
+
|
|
134
|
+
{option.value === value ? (<span className="check-icon">
|
|
135
|
+
<SvgCheck />
|
|
136
|
+
</span>) : null}
|
|
132
137
|
</Item>))}
|
|
133
138
|
</Menu>)
|
|
134
139
|
: null}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.styles.d.ts","sourceRoot":"","sources":["../../../components/Dropdown/Dropdown.styles.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,IAAI;;EAYT,CAAC;AAEF,QAAA,MAAM,IAAI;;
|
|
1
|
+
{"version":3,"file":"Dropdown.styles.d.ts","sourceRoot":"","sources":["../../../components/Dropdown/Dropdown.styles.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,IAAI;;EAYT,CAAC;AAEF,QAAA,MAAM,IAAI;;EAoCT,CAAC;AAEF,QAAA,MAAM,QAAQ;;EAMb,CAAC;AAEF,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { styled } from '@linaria/react';
|
|
2
2
|
import theme from '@clad-ui/theme';
|
|
3
|
-
const { colors, space, radii, borders, zIndices } = theme;
|
|
3
|
+
const { colors, space, radii, borders, zIndices, typo, sizes } = theme;
|
|
4
4
|
const Menu = styled.ul `
|
|
5
5
|
background: white;
|
|
6
6
|
border: ${borders.sm};
|
|
@@ -22,10 +22,34 @@ const Item = styled.li `
|
|
|
22
22
|
cursor: pointer;
|
|
23
23
|
padding: ${space.xs} ${space.md};
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
${typo.body.section}
|
|
26
|
+
|
|
27
|
+
label {
|
|
28
|
+
margin-bottom: ${space.none};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&:hover {
|
|
27
32
|
background-color: ${colors.backgroundSecondary};
|
|
28
33
|
}
|
|
34
|
+
|
|
35
|
+
&.selected {
|
|
36
|
+
${typo.label.section}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.check-icon {
|
|
40
|
+
background-color: ${colors.backgroundBrand};
|
|
41
|
+
width: ${sizes.xs};
|
|
42
|
+
height: ${sizes.xs};
|
|
43
|
+
border-radius: ${radii.circle};
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
margin-left: auto;
|
|
48
|
+
|
|
49
|
+
svg {
|
|
50
|
+
color: ${colors.iconOnBackground};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
29
53
|
`;
|
|
30
54
|
const LeftIcon = styled.div `
|
|
31
55
|
display: flex;
|
|
@@ -67,7 +67,7 @@ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>
|
|
|
67
67
|
*/
|
|
68
68
|
status?: 'default' | 'error' | 'success';
|
|
69
69
|
/**
|
|
70
|
-
*
|
|
70
|
+
* Prompt a helptext below input (useful when implemented with form validation)
|
|
71
71
|
*/
|
|
72
72
|
helptext?: string;
|
|
73
73
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../components/Input/Input.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAc,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAgBnD,MAAM,WAAW,UAAW,SAAQ,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC;IAC7E;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,KAAK,GAAG,MAAM,CAAC;IACxD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IACnF;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IACtD;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IACnD;;OAEG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IACzD;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IACvD;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,gB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,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC;IACzF;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IACd;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAGD;;;;GAIG;AAEH,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAgP/B,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -44,7 +44,20 @@ const Input = ({ id = '', name = '', type = 'text', label = '', value = '', onCh
|
|
|
44
44
|
const className = cx(inputClasses, inputFocusClasses, value && 'hasValue', !label && 'noLabel', required && 'required', (allowClear || tooltip || showValidationIcon) && 'showRightIcon', placeholder && 'hasPlaceholder');
|
|
45
45
|
const handleClearInput = (e) => {
|
|
46
46
|
if (allowClear) {
|
|
47
|
-
|
|
47
|
+
if (type === 'number' && (ref === null || ref === void 0 ? void 0 : ref.current)) {
|
|
48
|
+
// For number inputs, manually clear and trigger onChange
|
|
49
|
+
// since onNumberInputChange blocks empty string changes unless from keyboard events
|
|
50
|
+
ref.current.value = '';
|
|
51
|
+
const syntheticEvent = {
|
|
52
|
+
target: ref.current,
|
|
53
|
+
currentTarget: ref.current,
|
|
54
|
+
};
|
|
55
|
+
onChange(syntheticEvent);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
// For other input types, use simulateChangeEvent which triggers onChange via dispatchEvent
|
|
59
|
+
simulateChangeEvent(ref, '');
|
|
60
|
+
}
|
|
48
61
|
}
|
|
49
62
|
if (onClear) {
|
|
50
63
|
onClear(e);
|
|
@@ -53,7 +66,6 @@ const Input = ({ id = '', name = '', type = 'text', label = '', value = '', onCh
|
|
|
53
66
|
const [isShowIconPassword, setIsShowIconPassword] = useState(false);
|
|
54
67
|
const IconPassword = isShowIconPassword ? Unhide : Hide;
|
|
55
68
|
const handleShowPassword = () => {
|
|
56
|
-
console.log('handleShowPassword');
|
|
57
69
|
const currentInput = ref === null || ref === void 0 ? void 0 : ref.current;
|
|
58
70
|
const passwordToggle = showPasswordRef.current;
|
|
59
71
|
if (currentInput && passwordToggle && currentInput.type === 'password') {
|
|
@@ -140,26 +152,16 @@ const Input = ({ id = '', name = '', type = 'text', label = '', value = '', onCh
|
|
|
140
152
|
{icon ? <LeftIcon>{icon}</LeftIcon> : null}
|
|
141
153
|
<input {...attrs} onBlur={type === 'number' ? onNumberInputBlur : onBlur} onChange={type === 'number' ? onNumberInputChange : onChange} onKeyDown={handleKeyDown} ref={ref} {...props}/>
|
|
142
154
|
{!!label && <label htmlFor={id}>{label}</label>}
|
|
143
|
-
{!!isAllowClear && (<button tabIndex={-1} type="button" onClick={handleClearInput}>
|
|
155
|
+
{!!isAllowClear && !disabled && (<button tabIndex={-1} type="button" onClick={handleClearInput}>
|
|
144
156
|
<CloseFilled width="20px" height="30px" color={colors.iconTertiary}/>
|
|
145
157
|
</button>)}
|
|
146
|
-
{!!isShowPassword && (<button type="button" onClick={handleShowPassword} ref={showPasswordRef}>
|
|
158
|
+
{!!isShowPassword && (<button tabIndex={-1} type="button" onClick={handleShowPassword} ref={showPasswordRef}>
|
|
147
159
|
<ValidationIcon>
|
|
148
160
|
<ShapeIcon bg="none" size="lg">
|
|
149
161
|
<IconPassword className="password-icon"/>
|
|
150
162
|
</ShapeIcon>
|
|
151
163
|
</ValidationIcon>
|
|
152
|
-
</button>
|
|
153
|
-
// <button
|
|
154
|
-
// className="password"
|
|
155
|
-
// tabIndex={-1}
|
|
156
|
-
// type="button"
|
|
157
|
-
// onClick={handleShowPassword}
|
|
158
|
-
// ref={showPasswordRef}
|
|
159
|
-
// >
|
|
160
|
-
// <IconPassword />
|
|
161
|
-
// </button>
|
|
162
|
-
)}
|
|
164
|
+
</button>)}
|
|
163
165
|
{!!isWithTooltip && (<TooltipWrapper className={tooltipClassname}>
|
|
164
166
|
<span ref={tooltipIconRef}>
|
|
165
167
|
<Info width="20px" height="20px" color={colors.iconTertiary}/>
|
|
@@ -17,7 +17,7 @@ const inputStories = {
|
|
|
17
17
|
description: {
|
|
18
18
|
component: `Text Input component that has floating label, caption, and info tooltip.
|
|
19
19
|
|
|
20
|
-
\`๐งช Revamped in 1.2+ \` [\`๐จ Figma Specs\`](https://www.figma.com/
|
|
20
|
+
\`๐งช Revamped in 1.2+ \` [\`๐จ Figma Specs\`](https://www.figma.com/design/DfQM6G9p8PSNEoOzNGRjWD/v3.0-CHOTOT-Design-System---Processing?node-id=865-13593&t=hz8QJLqNrGvTVY8R-4)
|
|
21
21
|
`,
|
|
22
22
|
},
|
|
23
23
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
export
|
|
1
|
+
import type { HTMLCladUIProps, ReactRef } from '../../utils/types';
|
|
2
|
+
export interface PageItemProps extends HTMLCladUIProps<'button'> {
|
|
3
3
|
/**
|
|
4
4
|
* Page number
|
|
5
5
|
*/
|
|
@@ -13,15 +13,10 @@ export type PageItemProps<T extends React.ElementType> = {
|
|
|
13
13
|
*/
|
|
14
14
|
className?: string;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
* @default 'button'
|
|
16
|
+
* Ref to the DOM node.
|
|
18
17
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*/
|
|
23
|
-
children?: React.ReactNode;
|
|
24
|
-
} & React.ComponentPropsWithoutRef<T>;
|
|
25
|
-
declare const PageItem: <T extends React.ElementType = "button">({ page, isActive, className, as, children, ...props }: PageItemProps<T>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
18
|
+
ref?: ReactRef<HTMLButtonElement | null>;
|
|
19
|
+
}
|
|
20
|
+
declare const PageItem: import("../../utils/types").InternalForwardRefRenderFunction<"button", PageItemProps>;
|
|
26
21
|
export default PageItem;
|
|
27
22
|
//# sourceMappingURL=PageItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageItem.d.ts","sourceRoot":"","sources":["../../../components/Pagination/PageItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PageItem.d.ts","sourceRoot":"","sources":["../../../components/Pagination/PageItem.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGnE,MAAM,WAAW,aAAc,SAAQ,eAAe,CAAC,QAAQ,CAAC;IAC9D;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,GAAG,CAAC,EAAE,QAAQ,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;CAC1C;AAED,QAAA,MAAM,QAAQ,uFAWZ,CAAC;AAEH,eAAe,QAAQ,CAAC"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { cx } from '../../utils';
|
|
3
3
|
import { pageItemClass } from './Pagination.style';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import { forwardRef } from '../../utils/types';
|
|
5
|
+
const PageItem = forwardRef((props, ref) => {
|
|
6
|
+
const { page, isActive, className, as, children, ...rest } = props;
|
|
7
|
+
const attributes = {
|
|
8
|
+
className: cx(pageItemClass, className, isActive && 'active', rest.disabled && 'disabled'),
|
|
9
|
+
'data-clad': 'PaginationItem',
|
|
10
|
+
ref,
|
|
11
|
+
...rest,
|
|
12
|
+
};
|
|
13
|
+
return React.createElement(as || 'button', attributes, page || children);
|
|
14
|
+
});
|
|
9
15
|
export default PageItem;
|
|
@@ -55,9 +55,6 @@ export declare const Default: {
|
|
|
55
55
|
export declare const RenderPageItemWithNextLink: {
|
|
56
56
|
render: () => JSX.Element;
|
|
57
57
|
};
|
|
58
|
-
export declare const RenderPageItemWithOtherReactElement: {
|
|
59
|
-
render: () => JSX.Element;
|
|
60
|
-
};
|
|
61
58
|
export declare const ManyPages: {
|
|
62
59
|
render: () => JSX.Element;
|
|
63
60
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.stories.d.ts","sourceRoot":"","sources":["../../../components/Pagination/Pagination.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCtB,CAAC;AAEF,eAAe,iBAAiB,CAAC;AAEjC,eAAO,MAAM,OAAO;;CAcnB,CAAC;AAEF,eAAO,MAAM,0BAA0B;;CAwBtC,CAAC;AAEF,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"Pagination.stories.d.ts","sourceRoot":"","sources":["../../../components/Pagination/Pagination.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCtB,CAAC;AAEF,eAAe,iBAAiB,CAAC;AAEjC,eAAO,MAAM,OAAO;;CAcnB,CAAC;AAEF,eAAO,MAAM,0BAA0B;;CAwBtC,CAAC;AAEF,eAAO,MAAM,SAAS;;CAcrB,CAAC;AAEF,eAAO,MAAM,QAAQ;;CAcpB,CAAC;AAEF,eAAO,MAAM,iBAAiB;;CAe7B,CAAC;AAEF,eAAO,MAAM,kBAAkB;;CAe9B,CAAC"}
|
|
@@ -10,7 +10,7 @@ const paginationStories = {
|
|
|
10
10
|
description: {
|
|
11
11
|
component: `Pagination component for navigating through pages of content.
|
|
12
12
|
|
|
13
|
-
\`๐งช Beta\` [\`๐จ Figma Specs\`](https://www.figma.com/design/DfQM6G9p8PSNEoOzNGRjWD/v3.0-CHOTOT-Design-System---Processing?node-id=
|
|
13
|
+
\`๐งช Beta\` [\`๐จ Figma Specs\`](https://www.figma.com/design/DfQM6G9p8PSNEoOzNGRjWD/v3.0-CHOTOT-Design-System---Processing?node-id=50-15382&t=hz8QJLqNrGvTVY8R-4)
|
|
14
14
|
|
|
15
15
|
The Pagination component provides a user interface for navigating through multiple pages of content. It includes previous/next buttons and page numbers with ellipsis for large page ranges.
|
|
16
16
|
`,
|
|
@@ -55,25 +55,15 @@ export const RenderPageItemWithNextLink = {
|
|
|
55
55
|
const [currentPage, setCurrentPage] = React.useState(Number(window.location.hash.replace('#', '')) || 1);
|
|
56
56
|
return (<Pagination totalPages={10} currentPage={currentPage} onChange={(page) => {
|
|
57
57
|
setCurrentPage(page);
|
|
58
|
-
}} renderPageItem={({ page, ...rest }) => {
|
|
58
|
+
}} renderPageItem={({ page, key, ...rest }) => {
|
|
59
59
|
// Replace with Link component from nextjs
|
|
60
60
|
const NextLink = 'a';
|
|
61
|
-
return (<NextLink key={
|
|
62
|
-
|
|
63
|
-
</
|
|
61
|
+
return (<PageItem as={NextLink} key={key} href={`#${page}`} {...rest}>
|
|
62
|
+
{page}
|
|
63
|
+
</PageItem>);
|
|
64
64
|
}}/>);
|
|
65
65
|
},
|
|
66
66
|
};
|
|
67
|
-
export const RenderPageItemWithOtherReactElement = {
|
|
68
|
-
render: () => {
|
|
69
|
-
const [currentPage, setCurrentPage] = React.useState(Number(window.location.hash.replace('#', '')) || 1);
|
|
70
|
-
return (<Pagination totalPages={10} currentPage={currentPage} onChange={(page) => {
|
|
71
|
-
setCurrentPage(page);
|
|
72
|
-
}} renderPageItem={({ page, ...rest }) => (<PageItem {...rest} as="a" href={`#${page}`}>
|
|
73
|
-
{page}
|
|
74
|
-
</PageItem>)}/>);
|
|
75
|
-
},
|
|
76
|
-
};
|
|
77
67
|
export const ManyPages = {
|
|
78
68
|
render: () => {
|
|
79
69
|
const [currentPage, setCurrentPage] = useState(5);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.stories.d.ts","sourceRoot":"","sources":["../../../components/Popover/Popover.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAehD,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Popover.stories.d.ts","sourceRoot":"","sources":["../../../components/Popover/Popover.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAehD,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8DnB,CAAC;AAEF,eAAe,cAAc,CAAC;AAE9B,eAAO,MAAM,WAAW;;CAyBvB,CAAC;AAEF,eAAO,MAAM,WAAW;;CAyBvB,CAAC"}
|
|
@@ -19,6 +19,7 @@ const popoverStories = {
|
|
|
19
19
|
docs: {
|
|
20
20
|
description: {
|
|
21
21
|
component: `Clad UI Popover Component
|
|
22
|
+
\`โ
Stable\` [\`๐จ Figma Specs\`](https://www.figma.com/design/DfQM6G9p8PSNEoOzNGRjWD/v3.0-CHOTOT-Design-System---Processing?node-id=1250-14697&t=hz8QJLqNrGvTVY8R-4)
|
|
22
23
|
## How to use
|
|
23
24
|
- Use case: When you want to show additional information or options on hover or click.
|
|
24
25
|
`,
|