@chotot/clad-ui 2.0.0-next.4 β 2.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 +5 -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.stories.d.ts.map +1 -1
- package/dist/components/Badge/Badge.stories.js +1 -2
- 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 +10 -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 +28 -83
- package/dist/components/Button/Button.d.ts +7 -16
- 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 +2 -2
- package/dist/components/Button/Button.stories.d.ts.map +1 -1
- package/dist/components/Button/Button.stories.js +19 -1
- package/dist/components/Button/Button.styles.d.ts.map +1 -1
- package/dist/components/Button/Button.styles.js +14 -11
- package/dist/components/Button/GhostButton.d.ts +5 -25
- 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 +2 -2
- package/dist/components/Button/GhostButton.stories.d.ts.map +1 -1
- package/dist/components/Button/GhostButton.stories.js +19 -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 +2 -2
- package/dist/components/Button/IconButton.stories.d.ts.map +1 -1
- package/dist/components/Button/IconButton.stories.js +18 -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/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/Input.js +2 -13
- 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.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 +5 -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/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 +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -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.stories.js +1 -1
- 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/SearchInput/SearchInput.stories.d.ts.map +1 -1
- package/dist/patterns/SearchInput/SearchInput.stories.js +1 -3
- package/dist/patterns/TagCloud/TagCloud.stories.d.ts.map +1 -1
- package/dist/patterns/TagCloud/TagCloud.stories.js +1 -5
- package/dist/theme/chotot.d.ts +49 -48
- package/dist/theme/chotot.d.ts.map +1 -1
- package/dist/theme/chotot.js +8 -7
- package/dist/theme/ct-job.d.ts +48 -47
- package/dist/theme/ct-job.d.ts.map +1 -1
- package/dist/theme/ct-pty.d.ts +48 -47
- package/dist/theme/ct-pty.d.ts.map +1 -1
- package/dist/theme/ct-veh.d.ts +49 -48
- package/dist/theme/ct-veh.d.ts.map +1 -1
- package/dist/theme/ct-veh.js +1 -1
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GhostButton.d.ts","sourceRoot":"","sources":["../../../components/Button/GhostButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GhostButton.d.ts","sourceRoot":"","sources":["../../../components/Button/GhostButton.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAc,KAAK,eAAe,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAEpF,MAAM,WAAW,gBAAiB,SAAQ,eAAe,CAAC,GAAG,CAAC;IAC5D;;OAEG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAC;IACjC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;IACtD;;OAEG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;IACtC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC3B;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,GAAG,CAAC,EAAE,QAAQ,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;CAC1C;AAED;;;;GAIG;AAEH,eAAO,MAAM,MAAM,qFAsCjB,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { cx } from '../../utils';
|
|
3
3
|
import buttonClass from './GhostButton.styles';
|
|
4
|
+
import { forwardRef } from '../../utils/types';
|
|
4
5
|
/**
|
|
5
6
|
* Renders a standard button element.
|
|
6
7
|
*
|
|
7
8
|
* `β
Stable`
|
|
8
9
|
*/
|
|
9
10
|
// Why have 'export' here? https://github.com/storybookjs/storybook/issues/9511
|
|
10
|
-
export const Button =
|
|
11
|
+
export const Button = forwardRef((props, ref) => {
|
|
12
|
+
const { as = 'a', children, disabled = false, className, onClick, radius = 'normal', size = 'medium', stretch = false, variant = 'button', weight = 'bold', color = 'link', ...rest } = props;
|
|
11
13
|
const extraClasses = cx(buttonClass, variant === 'button' ? color : 'hyperlink h-' + color, `r-${radius}`, size, `w-${weight}`, `t-${color}`, stretch && 'stretch', disabled && 'disabled', className);
|
|
12
14
|
const attrs = {
|
|
13
15
|
ref,
|
|
14
16
|
className: extraClasses,
|
|
15
|
-
href,
|
|
16
|
-
target,
|
|
17
17
|
disabled: disabled && true,
|
|
18
18
|
onClick: !disabled && onClick ? onClick : undefined,
|
|
19
19
|
'data-clad': 'Ghost Button',
|
|
20
|
-
...
|
|
20
|
+
...rest,
|
|
21
21
|
};
|
|
22
22
|
return React.createElement(as, attrs, children);
|
|
23
23
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
declare const ghostButtonStories: {
|
|
3
2
|
title: string;
|
|
4
|
-
component:
|
|
3
|
+
component: import("../../utils/types").InternalForwardRefRenderFunction<"a", import("./GhostButton").GhostButtonProps>;
|
|
5
4
|
tags: string[];
|
|
6
5
|
parameters: {
|
|
7
6
|
docs: {
|
|
@@ -27,5 +26,6 @@ export declare const Overview: {
|
|
|
27
26
|
};
|
|
28
27
|
export declare const ButtonVariant: () => JSX.Element;
|
|
29
28
|
export declare const HyperlinkVariant: () => JSX.Element;
|
|
29
|
+
export declare const ButtonWithNextLink: () => JSX.Element;
|
|
30
30
|
export declare const Disabled: () => JSX.Element;
|
|
31
31
|
//# sourceMappingURL=GhostButton.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GhostButton.stories.d.ts","sourceRoot":"","sources":["../../../components/Button/GhostButton.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GhostButton.stories.d.ts","sourceRoot":"","sources":["../../../components/Button/GhostButton.stories.tsx"],"names":[],"mappings":"AAGA,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;CAsBvB,CAAC;AACF,eAAe,kBAAkB,CAAC;AAElC,eAAO,MAAM,QAAQ;;;;;CAGpB,CAAC;AAEF,eAAO,MAAM,aAAa,mBA8BzB,CAAC;AAEF,eAAO,MAAM,gBAAgB,mBAmC5B,CAAC;AAEF,eAAO,MAAM,kBAAkB,mBAuC9B,CAAC;AAEF,eAAO,MAAM,QAAQ,mBASpB,CAAC"}
|
|
@@ -10,7 +10,7 @@ const ghostButtonStories = {
|
|
|
10
10
|
component: `Hypelinks (anchor tags) that appear like buttons. It has the same props list as [Button component](../?path=/docs/components-buttons-button--overview)
|
|
11
11
|
except the \`as\` prop is always \`a\`.
|
|
12
12
|
|
|
13
|
-
\`β
Stable\` [\`π¨ Figma Specs\`](https://www.figma.com/
|
|
13
|
+
\`β
Stable\` [\`π¨ Figma Specs\`](https://www.figma.com/design/DfQM6G9p8PSNEoOzNGRjWD/v3.0-CHOTOT-Design-System---Processing?node-id=41-12614&t=hz8QJLqNrGvTVY8R-4)
|
|
14
14
|
`,
|
|
15
15
|
},
|
|
16
16
|
},
|
|
@@ -56,6 +56,24 @@ export const HyperlinkVariant = ( /* args */) => (<div>
|
|
|
56
56
|
Hyperlink Variant
|
|
57
57
|
</GhostButton>
|
|
58
58
|
</div>);
|
|
59
|
+
export const ButtonWithNextLink = ( /* args */) => {
|
|
60
|
+
// replace "a" with NextLink
|
|
61
|
+
const NextLink = 'a';
|
|
62
|
+
return (<div>
|
|
63
|
+
<GhostButton as={NextLink} href="/iframe.html?viewMode=story&id=components-buttons-ghost-button-button-link--button-with-next-link&example=click-me-1" variant="button" color="link">
|
|
64
|
+
Click me 1
|
|
65
|
+
</GhostButton>
|
|
66
|
+
<GhostButton as={NextLink} href="/iframe.html?viewMode=story&id=components-buttons-ghost-button-button-link--button-with-next-link&example=click-me-2" variant="button" color="primary">
|
|
67
|
+
Click me 2
|
|
68
|
+
</GhostButton>
|
|
69
|
+
<GhostButton as={NextLink} href="/iframe.html?viewMode=story&id=components-buttons-ghost-button-button-link--button-with-next-link&example=click-me-3" variant="button" color="secondary">
|
|
70
|
+
Click me 3
|
|
71
|
+
</GhostButton>
|
|
72
|
+
<GhostButton as={NextLink} href="/iframe.html?viewMode=story&id=components-buttons-ghost-button-button-link--button-with-next-link&example=click-me-4" variant="button" color="tertiary">
|
|
73
|
+
Click me 4
|
|
74
|
+
</GhostButton>
|
|
75
|
+
</div>);
|
|
76
|
+
};
|
|
59
77
|
export const Disabled = ( /* args */) => (<div>
|
|
60
78
|
<GhostButton variant="button" href="https://clad-ui.chotot.org/" target="_blank" disabled>
|
|
61
79
|
Disabled Button Variant
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import { type ButtonProps } from './Button';
|
|
3
2
|
export interface IconButtonProps extends Omit<ButtonProps, 'stretch' | 'icon'> {
|
|
4
3
|
}
|
|
@@ -7,6 +6,6 @@ export interface IconButtonProps extends Omit<ButtonProps, 'stretch' | 'icon'> {
|
|
|
7
6
|
*
|
|
8
7
|
* `β
Stable`
|
|
9
8
|
*/
|
|
10
|
-
declare const IconButton:
|
|
9
|
+
declare const IconButton: import("../../utils/types").InternalForwardRefRenderFunction<"button", IconButtonProps>;
|
|
11
10
|
export default IconButton;
|
|
12
11
|
//# sourceMappingURL=IconButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../components/Button/IconButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../components/Button/IconButton.tsx"],"names":[],"mappings":"AACA,OAAe,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAGpD,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,MAAM,CAAC;CAAG;AAEjF;;;;GAIG;AAEH,QAAA,MAAM,UAAU,yFAEd,CAAC;AAEH,eAAe,UAAU,CAAC"}
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import Button from './Button';
|
|
3
|
+
import { forwardRef } from '../../utils/types';
|
|
3
4
|
/**
|
|
4
5
|
* Icons as interactive buttons / links. It has the same props list as [Button component](/docs/components-shapeicon--docs)
|
|
5
6
|
*
|
|
6
7
|
* `β
Stable`
|
|
7
8
|
*/
|
|
8
|
-
const IconButton =
|
|
9
|
-
const props = { color, variant, radius, size, children, disabled, extraClasses, onClick };
|
|
10
|
-
if (as !== 'a' && as !== 'button') {
|
|
11
|
-
throw new Error(`IconButton must be rendered as <a> or <button>. It is currently rendered as ${as}`);
|
|
12
|
-
}
|
|
13
|
-
return <Button icon as={as} {...props} data-clad="Icon Button" ref={ref}/>;
|
|
14
|
-
});
|
|
9
|
+
const IconButton = forwardRef((props, ref) => (<Button icon ref={ref} data-clad="Icon Button" {...props}/>));
|
|
15
10
|
export default IconButton;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
declare const iconButtonStories: {
|
|
3
2
|
title: string;
|
|
4
|
-
component:
|
|
3
|
+
component: import("../../utils/types").InternalForwardRefRenderFunction<"button", import("./IconButton").IconButtonProps>;
|
|
5
4
|
tags: string[];
|
|
6
5
|
parameters: {
|
|
7
6
|
docs: {
|
|
@@ -58,4 +57,5 @@ export declare const ExtraClasses: {
|
|
|
58
57
|
};
|
|
59
58
|
};
|
|
60
59
|
};
|
|
60
|
+
export declare const ButtonWithNextLink: () => JSX.Element;
|
|
61
61
|
//# sourceMappingURL=IconButton.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.stories.d.ts","sourceRoot":"","sources":["../../../components/Button/IconButton.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IconButton.stories.d.ts","sourceRoot":"","sources":["../../../components/Button/IconButton.stories.tsx"],"names":[],"mappings":"AAUA,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;CAsBtB,CAAC;AAEF,eAAe,iBAAiB,CAAC;AAEjC,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;CA0BpB,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;;;;CAyBpB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;CAgCxB,CAAC;AAEF,eAAO,MAAM,kBAAkB,mBA2C9B,CAAC"}
|
|
@@ -105,3 +105,21 @@ export const ExtraClasses = {
|
|
|
105
105
|
},
|
|
106
106
|
},
|
|
107
107
|
};
|
|
108
|
+
export const ButtonWithNextLink = ( /* args */) => {
|
|
109
|
+
// replace "a" with NextLink
|
|
110
|
+
const NextLink = 'a';
|
|
111
|
+
return (<div style={{ display: 'flex', gap: '8px' }}>
|
|
112
|
+
<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">
|
|
113
|
+
<iconComponents.Heart />
|
|
114
|
+
</IconButton>
|
|
115
|
+
<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">
|
|
116
|
+
<iconComponents.Heart />
|
|
117
|
+
</IconButton>
|
|
118
|
+
<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">
|
|
119
|
+
<iconComponents.Heart />
|
|
120
|
+
</IconButton>
|
|
121
|
+
<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">
|
|
122
|
+
<iconComponents.Heart />
|
|
123
|
+
</IconButton>
|
|
124
|
+
</div>);
|
|
125
|
+
};
|
|
@@ -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":"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,gBAAgB,CAAC,CAAC;IACpD;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IACpD;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;IACzC;;OAEG;IACH,QAAQ,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,
|
|
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,gBAAgB,CAAC,CAAC;IACpD;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IACpD;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;IACzC;;OAEG;IACH,QAAQ,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,CAoO/B,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -53,7 +53,6 @@ const Input = ({ id = '', name = '', type = 'text', label = '', value = '', onCh
|
|
|
53
53
|
const [isShowIconPassword, setIsShowIconPassword] = useState(false);
|
|
54
54
|
const IconPassword = isShowIconPassword ? Unhide : Hide;
|
|
55
55
|
const handleShowPassword = () => {
|
|
56
|
-
console.log('handleShowPassword');
|
|
57
56
|
const currentInput = ref === null || ref === void 0 ? void 0 : ref.current;
|
|
58
57
|
const passwordToggle = showPasswordRef.current;
|
|
59
58
|
if (currentInput && passwordToggle && currentInput.type === 'password') {
|
|
@@ -143,23 +142,13 @@ const Input = ({ id = '', name = '', type = 'text', label = '', value = '', onCh
|
|
|
143
142
|
{!!isAllowClear && (<button tabIndex={-1} type="button" onClick={handleClearInput}>
|
|
144
143
|
<CloseFilled width="20px" height="30px" color={colors.iconTertiary}/>
|
|
145
144
|
</button>)}
|
|
146
|
-
{!!isShowPassword && (<button type="button" onClick={handleShowPassword} ref={showPasswordRef}>
|
|
145
|
+
{!!isShowPassword && (<button tabIndex={-1} type="button" onClick={handleShowPassword} ref={showPasswordRef}>
|
|
147
146
|
<ValidationIcon>
|
|
148
147
|
<ShapeIcon bg="none" size="lg">
|
|
149
148
|
<IconPassword className="password-icon"/>
|
|
150
149
|
</ShapeIcon>
|
|
151
150
|
</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
|
-
)}
|
|
151
|
+
</button>)}
|
|
163
152
|
{!!isWithTooltip && (<TooltipWrapper className={tooltipClassname}>
|
|
164
153
|
<span ref={tooltipIconRef}>
|
|
165
154
|
<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
|
`,
|
|
@@ -82,14 +82,4 @@ export declare const Colors: {
|
|
|
82
82
|
};
|
|
83
83
|
};
|
|
84
84
|
};
|
|
85
|
-
export declare const UsageGuide: {
|
|
86
|
-
render: () => JSX.Element;
|
|
87
|
-
parameters: {
|
|
88
|
-
docs: {
|
|
89
|
-
source: {
|
|
90
|
-
code: never[];
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
85
|
//# sourceMappingURL=RadioButton.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioButton.stories.d.ts","sourceRoot":"","sources":["../../../components/RadioButton/RadioButton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"RadioButton.stories.d.ts","sourceRoot":"","sources":["../../../components/RadioButton/RadioButton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAOxC,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCjB,CAAC;AAEF,eAAe,YAAY,CAAC;AAE5B,eAAO,MAAM,QAAQ;;CAsBpB,CAAC;AAEF,eAAO,MAAM,YAAY,mBAyBxB,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;;;;CAsCrB,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;CAqC1B,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;;;;CAuCpB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;CA4BlB,CAAC"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import theme from '@clad-ui/theme';
|
|
3
|
-
import { css } from '@linaria/core';
|
|
4
|
-
import GuideImage, { guideImageClass } from '../../storybook/GuideImage';
|
|
5
3
|
import RadioButton from './RadioButton';
|
|
6
|
-
import Grid from '../Grid/Grid';
|
|
7
|
-
import Col from '../Grid/Col';
|
|
8
4
|
const { sizes } = theme;
|
|
9
5
|
const THEME_SIZES = Object.keys(sizes);
|
|
10
6
|
const radioStories = {
|
|
@@ -16,14 +12,13 @@ const radioStories = {
|
|
|
16
12
|
description: {
|
|
17
13
|
component: `Clad UI Radio Button Component
|
|
18
14
|
|
|
19
|
-
\`β
Stable\` [\`π¨ Figma Specs\`](https://www.figma.com/
|
|
15
|
+
\`β
Stable\` [\`π¨ Figma Specs\`](https://www.figma.com/design/DfQM6G9p8PSNEoOzNGRjWD/v3.0-CHOTOT-Design-System---Processing?node-id=1464-9753&t=hz8QJLqNrGvTVY8R-4)
|
|
20
16
|
|
|
21
17
|
## How to use
|
|
22
18
|
- Use case: When we want user to select **ONE AND ONLY ONE** option
|
|
23
19
|
- Position: Placing it on the right hand side of label text is preferred (support majority of right-handed users).
|
|
24
20
|
- Colors: Default is **primary** (orange300), but, we can change it via \`color\` prop.
|
|
25
21
|
|
|
26
|
-
<img className="${guideImageClass}" src="./radio-how.png" />
|
|
27
22
|
`,
|
|
28
23
|
},
|
|
29
24
|
},
|
|
@@ -165,35 +160,3 @@ export const Colors = {
|
|
|
165
160
|
},
|
|
166
161
|
},
|
|
167
162
|
};
|
|
168
|
-
const paddingTopClass = css `
|
|
169
|
-
padding-top: 32px;
|
|
170
|
-
`;
|
|
171
|
-
export const UsageGuide = {
|
|
172
|
-
render: () => (<>
|
|
173
|
-
<h4>DO's</h4>
|
|
174
|
-
<GuideImage isGood src="./radio-do.png" alt="Radio - Do"/>
|
|
175
|
-
<h4 className={paddingTopClass}>DON'Ts</h4>
|
|
176
|
-
<Grid rowCols={[1, 3]} gutterx="sm" align="center">
|
|
177
|
-
<Col>
|
|
178
|
-
<GuideImage isBad src="./radio-dont-1.png" alt="Radio - Dont_1"/>
|
|
179
|
-
<p>
|
|
180
|
-
Placing radio buttons on the right hand side of label text is preferred (support
|
|
181
|
-
majority of right-handed users and to be more consistent in other cases).
|
|
182
|
-
</p>
|
|
183
|
-
</Col>
|
|
184
|
-
<Col>
|
|
185
|
-
<GuideImage isBad src="./radio-dont-2.png" alt="Radio - Dont_2"/>
|
|
186
|
-
<p>Use radio buttons instead of check mark.</p>
|
|
187
|
-
</Col>
|
|
188
|
-
<Col>
|
|
189
|
-
<GuideImage isBad src="./radio-dont-3.png" alt="Radio - Dont_3"/>
|
|
190
|
-
<p>There should be no shadow.</p>
|
|
191
|
-
</Col>
|
|
192
|
-
</Grid>
|
|
193
|
-
</>),
|
|
194
|
-
parameters: {
|
|
195
|
-
docs: {
|
|
196
|
-
source: { code: [] },
|
|
197
|
-
},
|
|
198
|
-
},
|
|
199
|
-
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RowItem.stories.d.ts","sourceRoot":"","sources":["../../../components/RowItem/RowItem.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAgBxC,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"RowItem.stories.d.ts","sourceRoot":"","sources":["../../../components/RowItem/RowItem.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAgBxC,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;CAqCnB,CAAC;AAEF,eAAe,cAAc,CAAC;AAE9B,eAAO,MAAM,QAAQ;;CAapB,CAAC;AAEF,eAAO,MAAM,IAAI;;;;;;;;;CA8BhB,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;;;;CAsErB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;CA4ExB,CAAC;AAEF,eAAO,MAAM,IAAI;;;;;;;;;CAgChB,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;;;;CAkFpB,CAAC;AAEF,eAAO,MAAM,IAAI;;;;;;;;;CAiFhB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;CAmDvB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;CAgFxB,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;CAqD1B,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;;;;CA+DpB,CAAC"}
|
|
@@ -19,7 +19,7 @@ const rowItemStories = {
|
|
|
19
19
|
description: {
|
|
20
20
|
component: `Row item component for menus and Popups
|
|
21
21
|
|
|
22
|
-
\`β
Stable\` [\`π¨ Figma Specs\`](https://www.figma.com/
|
|
22
|
+
\`β
Stable\` [\`π¨ Figma Specs\`](https://www.figma.com/design/DfQM6G9p8PSNEoOzNGRjWD/v3.0-CHOTOT-Design-System---Processing?node-id=52-15432&t=hz8QJLqNrGvTVY8R-4)
|
|
23
23
|
|
|
24
24
|
## How to use
|
|
25
25
|
Row Items are interactive components which are often used as children in menus or Popups[link to popup].
|
|
@@ -29,7 +29,6 @@ const rowItemStories = {
|
|
|
29
29
|
- Menu items: clickable menus with customizable icon and label and an optional description line
|
|
30
30
|
- Checkboxes: behave like a checkbox with additional \`name\`, \`value\` and \`checked\` props
|
|
31
31
|
- Radio buttons: behave like a radio button with additional \`name\`, \`value\` and \`checked\` props. **A radio button group share a same name.**
|
|
32
|
-
<img src="./row-item-how.png" />
|
|
33
32
|
`,
|
|
34
33
|
},
|
|
35
34
|
},
|
|
@@ -15,7 +15,7 @@ const sliderStories = {
|
|
|
15
15
|
component: `A Slider component for displaying current value and intervals in range. Use when you need to input a value in a range
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
\`β
Stable\` [\`π¨ Figma Specs\`](https://www.figma.com/
|
|
18
|
+
\`β
Stable\` [\`π¨ Figma Specs\`](https://www.figma.com/design/DfQM6G9p8PSNEoOzNGRjWD/v3.0-CHOTOT-Design-System---Processing?node-id=50-15328&t=hz8QJLqNrGvTVY8R-4)
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
## Usage
|
|
@@ -14,7 +14,7 @@ const snackStories = {
|
|
|
14
14
|
description: {
|
|
15
15
|
component: `Snack is used to inform user of a process that has just been performed or will perform.
|
|
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=1349-31595&t=hz8QJLqNrGvTVY8R-4)
|
|
18
18
|
|
|
19
19
|
Snack appears temporarily, at the bottom of the screen and doesn't require user input to disappear. Snack shouldnβt interrupt the user experience, and doesnβt require user input to disappear.
|
|
20
20
|
`,
|