@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
|
@@ -1,28 +1,8 @@
|
|
|
1
|
-
/* eslint-disable jsx-a11y/anchor-is-valid */
|
|
2
1
|
import React, { useState } from 'react';
|
|
3
|
-
import { css } from '@linaria/core';
|
|
4
|
-
import { guideImageClass } from '../../storybook/GuideImage';
|
|
5
2
|
import Breadcrumbs from './Breadcrumbs';
|
|
6
3
|
import Button from '../Button/Button';
|
|
7
4
|
import Box from '../Box/Box';
|
|
8
|
-
|
|
9
|
-
/* stylelint-disable declaration-no-important */
|
|
10
|
-
display: flex;
|
|
11
|
-
justify-content: space-between;
|
|
12
|
-
flex-wrap: wrap;
|
|
13
|
-
margin: 0 -8px !important;
|
|
14
|
-
|
|
15
|
-
& > div {
|
|
16
|
-
padding: 0 8px;
|
|
17
|
-
width: 100%;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
@media screen and (min-width: 992px) {
|
|
21
|
-
& > div {
|
|
22
|
-
width: 50%;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
`;
|
|
5
|
+
import BreadcrumbItem from './BreadcrumbItem';
|
|
26
6
|
const breadcrumbsStories = {
|
|
27
7
|
title: 'Components/Breadcrumbs',
|
|
28
8
|
component: Breadcrumbs,
|
|
@@ -32,7 +12,7 @@ const breadcrumbsStories = {
|
|
|
32
12
|
description: {
|
|
33
13
|
component: `Breadcrumbs displays the current location within a hierarchy. It allows going back to states higher up in the hierarchy.
|
|
34
14
|
|
|
35
|
-
\`🧪Beta\` [\`🎨 Figma Specs\`](https://www.figma.com/
|
|
15
|
+
\`🧪 Beta\` [\`🎨 Figma Specs\`](https://www.figma.com/design/DfQM6G9p8PSNEoOzNGRjWD/v3.0-CHOTOT-Design-System---Processing?node-id=42-33451&t=hz8QJLqNrGvTVY8R-4)
|
|
36
16
|
|
|
37
17
|
## How to use
|
|
38
18
|
|
|
@@ -47,15 +27,13 @@ Elements with wrong format will not be rendered.
|
|
|
47
27
|
|
|
48
28
|
The last item will have its \`a\` tag replaced with \`span\`.
|
|
49
29
|
|
|
50
|
-
<div
|
|
30
|
+
<div>
|
|
51
31
|
<div>
|
|
52
32
|
<p>On mobile, Breadcrumbs is scrollable if necessary.</p>
|
|
53
|
-
<img className="${guideImageClass}" src="./breadcrumbs-how-1.png" />
|
|
54
33
|
</div>
|
|
55
|
-
|
|
34
|
+
|
|
56
35
|
<div>
|
|
57
36
|
<p>On desktop, Breadcrumbs is not scrollable. Overflow text content will be truncated.</p>
|
|
58
|
-
<img className="${guideImageClass}" src="./breadcrumbs-how-2.png" />
|
|
59
37
|
</div>
|
|
60
38
|
</div>
|
|
61
39
|
`,
|
|
@@ -71,58 +49,23 @@ The last item will have its \`a\` tag replaced with \`span\`.
|
|
|
71
49
|
export default breadcrumbsStories;
|
|
72
50
|
export const Overview = {
|
|
73
51
|
render: (args) => (<Breadcrumbs {...args}>
|
|
74
|
-
<
|
|
75
|
-
<
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Mimic `next/link` component
|
|
81
|
-
*/
|
|
82
|
-
const Link = React.forwardRef(function LinkComponent({ href, children = '', legacyBehavior, prefetch, replace }, ref) {
|
|
83
|
-
const handleClick = (event) => {
|
|
84
|
-
// stop default hyperlink redirection
|
|
85
|
-
event.preventDefault();
|
|
86
|
-
// eslint-disable-next-line no-alert
|
|
87
|
-
alert(`Simulated Next.js Link click to ${href} ${legacyBehavior ? 'with legacyBehavior' : ''} ${prefetch ? 'and prefetch' : ''} ${replace ? 'and replace' : ''}`);
|
|
88
|
-
};
|
|
89
|
-
return (<a href={href} onClick={handleClick} ref={ref}>
|
|
90
|
-
{children && children.type === 'a'
|
|
91
|
-
? children.props.children
|
|
92
|
-
: children}
|
|
93
|
-
</a>);
|
|
94
|
-
});
|
|
95
|
-
export const ChildrenWithWrapper = {
|
|
96
|
-
render: () => (<Breadcrumbs>
|
|
97
|
-
<Link href="/">
|
|
98
|
-
<a>Chợ Tốt</a>
|
|
99
|
-
</Link>
|
|
100
|
-
<Link href="/toan-quoc/mua-ban">
|
|
101
|
-
<a>Toàn quốc</a>
|
|
102
|
-
</Link>
|
|
103
|
-
<Link href="/toan-quoc/mua-ban-do-gia-dung-noi-that-cay-canh">
|
|
104
|
-
<a>Đồ gia dụng, nội thất, cây cảnh</a>
|
|
105
|
-
</Link>
|
|
52
|
+
<BreadcrumbItem href="/">Chợ Tốt</BreadcrumbItem>
|
|
53
|
+
<BreadcrumbItem href="/toan-quoc/mua-ban">Toàn quốc</BreadcrumbItem>
|
|
54
|
+
<BreadcrumbItem href="/toan-quoc/mua-ban-do-gia-dung-noi-that-cay-canh">
|
|
55
|
+
Đồ gia dụng, nội thất, cây cảnh
|
|
56
|
+
</BreadcrumbItem>
|
|
106
57
|
</Breadcrumbs>),
|
|
107
|
-
name: 'Children with wrapper',
|
|
108
|
-
parameters: {
|
|
109
|
-
docs: {
|
|
110
|
-
description: {
|
|
111
|
-
story: 'Breadcrumbs will only inject meta data into `a` tags inside wrapper tags, it will not modify original behavior, which means we can safely use `Link` component in Next.js for client-side routing as children.',
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
58
|
};
|
|
116
59
|
export const WithIsShow = {
|
|
117
60
|
render: () => {
|
|
118
61
|
const [open, setOpen] = useState(true);
|
|
119
62
|
return (<>
|
|
120
63
|
<Breadcrumbs isShow={open}>
|
|
121
|
-
<
|
|
122
|
-
<
|
|
123
|
-
<
|
|
64
|
+
<BreadcrumbItem href="/">Chợ Tốt</BreadcrumbItem>
|
|
65
|
+
<BreadcrumbItem href="/toan-quoc/mua-ban">Toàn quốc</BreadcrumbItem>
|
|
66
|
+
<BreadcrumbItem href="/toan-quoc/mua-ban-do-gia-dung-noi-that-cay-canh">
|
|
124
67
|
Đồ gia dụng, nội thất, cây cảnh
|
|
125
|
-
</
|
|
68
|
+
</BreadcrumbItem>
|
|
126
69
|
</Breadcrumbs>
|
|
127
70
|
<br />
|
|
128
71
|
<Button onClick={() => setOpen((prevOpen) => !prevOpen)}>Toggle Breadcrumbs</Button>
|
|
@@ -133,16 +76,22 @@ export const WithIsShow = {
|
|
|
133
76
|
export const LongBreadcrumbsExample = {
|
|
134
77
|
render: () => (<Box maxWidth={['full', '$md']}>
|
|
135
78
|
<Breadcrumbs>
|
|
136
|
-
<
|
|
137
|
-
<
|
|
138
|
-
<
|
|
139
|
-
<
|
|
140
|
-
<
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
<
|
|
79
|
+
<BreadcrumbItem href="/">Chợ Tốt</BreadcrumbItem>
|
|
80
|
+
<BreadcrumbItem href="/ho-chi-minh/">Tp Hồ Chí Minh</BreadcrumbItem>
|
|
81
|
+
<BreadcrumbItem href="/ho-chi-minh/quan-1">Quận 1</BreadcrumbItem>
|
|
82
|
+
<BreadcrumbItem href="/ho-chi-minh/quan-1/phuong-ben-nghe">Phường Bến Nghé</BreadcrumbItem>
|
|
83
|
+
<BreadcrumbItem href="/ho-chi-minh/quan-1/phuong-ben-nghe/do-dien-tu">
|
|
84
|
+
Đồ điện tử
|
|
85
|
+
</BreadcrumbItem>
|
|
86
|
+
<BreadcrumbItem href="/ho-chi-minh/quan-1/phuong-ben-nghe/dien-thoai">
|
|
87
|
+
Điện thoại
|
|
88
|
+
</BreadcrumbItem>
|
|
89
|
+
<BreadcrumbItem href="/ho-chi-minh/quan-1/phuong-ben-nghe/dien-thoai/samsung">
|
|
90
|
+
Samsung
|
|
91
|
+
</BreadcrumbItem>
|
|
92
|
+
<BreadcrumbItem href="/ho-chi-minh/quan-1/phuong-ben-nghe/galaxy-note-fan-edition">
|
|
144
93
|
Galaxy Note Fan Edition
|
|
145
|
-
</
|
|
94
|
+
</BreadcrumbItem>
|
|
146
95
|
</Breadcrumbs>
|
|
147
96
|
</Box>),
|
|
148
97
|
name: 'Ex: Long Breadcrumbs',
|
|
@@ -155,26 +104,28 @@ export const LongBreadcrumbsExample = {
|
|
|
155
104
|
},
|
|
156
105
|
};
|
|
157
106
|
export const WithNextLink = {
|
|
158
|
-
render: () =>
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
107
|
+
render: () => {
|
|
108
|
+
// replace "a" with NextLink
|
|
109
|
+
const NextLink = 'a';
|
|
110
|
+
return (<Box maxWidth={['full', '$md']}>
|
|
111
|
+
<Breadcrumbs>
|
|
112
|
+
<BreadcrumbItem as={NextLink} href="/">
|
|
113
|
+
Chợ Tốt
|
|
114
|
+
</BreadcrumbItem>
|
|
115
|
+
<BreadcrumbItem as={NextLink} href="/do-dien-tu">
|
|
116
|
+
Đồ điện tử
|
|
117
|
+
</BreadcrumbItem>
|
|
118
|
+
<BreadcrumbItem href="/mua-ban-dien-thoai">Điện thoại</BreadcrumbItem>
|
|
119
|
+
<BreadcrumbItem as={NextLink} href="/mua-ban-dien-thoai-apple-sdmd1">
|
|
120
|
+
Apple
|
|
121
|
+
</BreadcrumbItem>
|
|
122
|
+
</Breadcrumbs>
|
|
123
|
+
</Box>);
|
|
124
|
+
},
|
|
174
125
|
parameters: {
|
|
175
126
|
docs: {
|
|
176
127
|
description: {
|
|
177
|
-
story: 'This example demonstrates how to use Breadcrumbs with `next/link
|
|
128
|
+
story: 'This example demonstrates how to use Breadcrumbs with `next/link`',
|
|
178
129
|
},
|
|
179
130
|
},
|
|
180
131
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import { type Sizes } from '@clad-ui/theme';
|
|
2
|
+
import { type HTMLCladUIProps, type ReactRef } from '../../utils/types';
|
|
3
3
|
/**
|
|
4
4
|
* @deprecated
|
|
5
5
|
*/
|
|
@@ -12,7 +12,7 @@ export type ButtonColor = 'error' | 'info' | 'neutral' | 'primary' | 'success' |
|
|
|
12
12
|
* Variant selection for button variant prop
|
|
13
13
|
*/
|
|
14
14
|
export type ButtonVariant = 'default' | 'outline' | 'solid' | 'tonal';
|
|
15
|
-
export interface ButtonProps extends
|
|
15
|
+
export interface ButtonProps extends HTMLCladUIProps<'button'> {
|
|
16
16
|
/**
|
|
17
17
|
* Different looks of button
|
|
18
18
|
*/
|
|
@@ -36,7 +36,7 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
36
36
|
* Button's size
|
|
37
37
|
* @default medium
|
|
38
38
|
*/
|
|
39
|
-
size?: 'large' | 'medium' | 'small';
|
|
39
|
+
size?: 'xlarge' | 'large' | 'medium' | 'small';
|
|
40
40
|
/**
|
|
41
41
|
* Button width
|
|
42
42
|
*/
|
|
@@ -54,19 +54,6 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
54
54
|
* Whether this button stretch to fill up container's width
|
|
55
55
|
*/
|
|
56
56
|
stretch?: boolean;
|
|
57
|
-
/**
|
|
58
|
-
* Element or component to be rendered as
|
|
59
|
-
* @default button
|
|
60
|
-
*/
|
|
61
|
-
as?: React.ElementType;
|
|
62
|
-
/**
|
|
63
|
-
* Children
|
|
64
|
-
*/
|
|
65
|
-
children?: React.ReactNode;
|
|
66
|
-
/**
|
|
67
|
-
* Click event
|
|
68
|
-
*/
|
|
69
|
-
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
70
57
|
/**
|
|
71
58
|
* Additional classes to be added for customization
|
|
72
59
|
*/
|
|
@@ -75,12 +62,16 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
75
62
|
* Display loading icon
|
|
76
63
|
*/
|
|
77
64
|
isLoading?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Ref to the DOM node.
|
|
67
|
+
*/
|
|
68
|
+
ref?: ReactRef<HTMLButtonElement | null>;
|
|
78
69
|
}
|
|
79
70
|
/**
|
|
80
71
|
* Renders a standard button element.
|
|
81
72
|
*
|
|
82
73
|
* `✅ Stable`
|
|
83
74
|
*/
|
|
84
|
-
declare const Button:
|
|
75
|
+
declare const Button: import("../../utils/types").InternalForwardRefRenderFunction<"button", ButtonProps>;
|
|
85
76
|
export default Button;
|
|
86
77
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../components/Button/Button.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../components/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAInD,OAAO,EAAc,KAAK,eAAe,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAIpF;;GAEG;AACH,KAAK,qBAAqB,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAEvF;;GAEG;AACH,MAAM,MAAM,WAAW,GACnB,OAAO,GACP,MAAM,GACN,SAAS,GACT,SAAS,GACT,SAAS,GACT,UAAU,GACV,qBAAqB,CAAC;AAE1B;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;AAEtE,MAAM,WAAW,WAAY,SAAQ,eAAe,CAAC,QAAQ,CAAC;IAC5D;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;;;OAGG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;;OAGG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;IACtC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC3B;;;OAGG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC/C;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,GAAG,CAAC,EAAE,QAAQ,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;CAC1C;AAkBD;;;;GAIG;AACH,QAAA,MAAM,MAAM,qFAkEV,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
|
@@ -3,6 +3,7 @@ import theme from '@clad-ui/theme';
|
|
|
3
3
|
import { cx } from '../../utils';
|
|
4
4
|
import { Loading } from '../../icons';
|
|
5
5
|
import buttonClass from './Button.styles';
|
|
6
|
+
import { forwardRef } from '../../utils/types';
|
|
6
7
|
const { sizes } = theme;
|
|
7
8
|
const variantResolver = (variant, color) => {
|
|
8
9
|
if (variant === 'default') {
|
|
@@ -27,8 +28,9 @@ const variantResolver = (variant, color) => {
|
|
|
27
28
|
*
|
|
28
29
|
* `✅ Stable`
|
|
29
30
|
*/
|
|
30
|
-
const Button =
|
|
31
|
+
const Button = forwardRef((props, ref) => {
|
|
31
32
|
var _a, _b, _c;
|
|
33
|
+
const { as, children, color = 'primary', disabled = false, extraClasses = '', icon = false, onClick, radius = 'normal', size = 'medium', stretch = false, variant = 'solid', weight = 'bold', isLoading = false, width, ...rest } = props;
|
|
32
34
|
let iconClass = '';
|
|
33
35
|
if (icon) {
|
|
34
36
|
// square/circle icon buttons
|
|
@@ -56,8 +58,8 @@ const Button = React.forwardRef(({ as = 'button', children, color = 'primary', d
|
|
|
56
58
|
width: width && `${sizes[width]}`,
|
|
57
59
|
},
|
|
58
60
|
'data-clad': 'Button',
|
|
59
|
-
...
|
|
61
|
+
...rest,
|
|
60
62
|
};
|
|
61
|
-
return React.createElement(as, attrs, isLoading && React.createElement(Loading, { className: 'loading-icon' }), children);
|
|
63
|
+
return React.createElement(as || 'button', attrs, isLoading && React.createElement(Loading, { className: 'loading-icon' }), children);
|
|
62
64
|
});
|
|
63
65
|
export default Button;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
declare const buttonStories: {
|
|
3
2
|
title: string;
|
|
4
|
-
component:
|
|
3
|
+
component: import("../../utils/types").InternalForwardRefRenderFunction<"button", import("./Button").ButtonProps>;
|
|
5
4
|
tags: string[];
|
|
6
5
|
parameters: {
|
|
7
6
|
docs: {
|
|
@@ -11,19 +10,94 @@ declare const buttonStories: {
|
|
|
11
10
|
};
|
|
12
11
|
};
|
|
13
12
|
argTypes: {
|
|
13
|
+
variant: {
|
|
14
|
+
control: {
|
|
15
|
+
type: string;
|
|
16
|
+
};
|
|
17
|
+
options: import("./Button").ButtonVariant[];
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
14
20
|
color: {
|
|
21
|
+
control: {
|
|
22
|
+
type: string;
|
|
23
|
+
};
|
|
24
|
+
options: import("./Button").ButtonColor[];
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
radius: {
|
|
28
|
+
control: {
|
|
29
|
+
type: string;
|
|
30
|
+
};
|
|
15
31
|
options: string[];
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
weight: {
|
|
35
|
+
control: {
|
|
36
|
+
type: string;
|
|
37
|
+
};
|
|
38
|
+
options: string[];
|
|
39
|
+
description: string;
|
|
40
|
+
};
|
|
41
|
+
size: {
|
|
42
|
+
control: {
|
|
43
|
+
type: string;
|
|
44
|
+
};
|
|
45
|
+
options: string[];
|
|
46
|
+
description: string;
|
|
47
|
+
};
|
|
48
|
+
width: {
|
|
49
|
+
control: {
|
|
50
|
+
type: string;
|
|
51
|
+
};
|
|
52
|
+
options: string[];
|
|
53
|
+
description: string;
|
|
54
|
+
};
|
|
55
|
+
disabled: {
|
|
56
|
+
control: {
|
|
57
|
+
type: string;
|
|
58
|
+
};
|
|
59
|
+
description: string;
|
|
60
|
+
};
|
|
61
|
+
icon: {
|
|
62
|
+
control: {
|
|
63
|
+
type: string;
|
|
64
|
+
};
|
|
65
|
+
description: string;
|
|
66
|
+
};
|
|
67
|
+
stretch: {
|
|
68
|
+
control: {
|
|
69
|
+
type: string;
|
|
70
|
+
};
|
|
71
|
+
description: string;
|
|
72
|
+
};
|
|
73
|
+
extraClasses: {
|
|
74
|
+
control: {
|
|
75
|
+
type: string;
|
|
76
|
+
};
|
|
77
|
+
description: string;
|
|
78
|
+
};
|
|
79
|
+
isLoading: {
|
|
80
|
+
control: {
|
|
81
|
+
type: string;
|
|
82
|
+
};
|
|
83
|
+
description: string;
|
|
16
84
|
};
|
|
17
85
|
children: {
|
|
18
86
|
control: {
|
|
19
87
|
type: string;
|
|
20
88
|
};
|
|
89
|
+
description: string;
|
|
21
90
|
};
|
|
22
91
|
as: {
|
|
23
|
-
options: string[];
|
|
24
92
|
control: {
|
|
25
93
|
type: string;
|
|
26
94
|
};
|
|
95
|
+
options: string[];
|
|
96
|
+
description: string;
|
|
97
|
+
};
|
|
98
|
+
onClick: {
|
|
99
|
+
action: string;
|
|
100
|
+
description: string;
|
|
27
101
|
};
|
|
28
102
|
};
|
|
29
103
|
};
|
|
@@ -33,7 +107,6 @@ export declare const Overview: {
|
|
|
33
107
|
args: {
|
|
34
108
|
children: string;
|
|
35
109
|
as: string;
|
|
36
|
-
onClick: () => void;
|
|
37
110
|
};
|
|
38
111
|
};
|
|
39
112
|
export declare const VariantSolid: () => JSX.Element;
|
|
@@ -102,4 +175,5 @@ export declare const ExtraClasses: {
|
|
|
102
175
|
};
|
|
103
176
|
};
|
|
104
177
|
};
|
|
178
|
+
export declare const ButtonWithNextLink: () => JSX.Element;
|
|
105
179
|
//# sourceMappingURL=Button.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../components/Button/Button.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../components/Button/Button.stories.tsx"],"names":[],"mappings":"AAkBA,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+ElB,CAAC;AAEF,eAAe,aAAa,CAAC;AAG7B,eAAO,MAAM,QAAQ;;;;;;CAAiC,CAAC;AAUvD,eAAO,MAAM,YAAY,mBA6BxB,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;CA6C1B,CAAC;AAEF,eAAO,MAAM,YAAY,mBAmCxB,CAAC;AAEF,eAAO,MAAM,KAAK,mBAoDjB,CAAC;AAEF,eAAO,MAAM,KAAK,mBAajB,CAAC;AAEF,eAAO,MAAM,YAAY,mBAexB,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;;;;CAyBpB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;CAoBxB,CAAC;AAEF,eAAO,MAAM,SAAS,mBA0BrB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;CAgFvB,CAAC;AAaF,eAAO,MAAM,OAAO;;;;;;;;;CAsBnB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;CA2BxB,CAAC;AAEF,eAAO,MAAM,kBAAkB,mBA+B9B,CAAC"}
|
|
@@ -7,7 +7,7 @@ import Heart from '../../icons/Heart';
|
|
|
7
7
|
import SpeechBubbles from '../../icons/SpeechBubbles';
|
|
8
8
|
import Download from '../../icons/Download';
|
|
9
9
|
import Location from '../../icons/Location';
|
|
10
|
-
|
|
10
|
+
import { BUTTON_COLORS, BUTTON_RADII, BUTTON_SIZES, BUTTON_VARIANTS, BUTTON_WEIGHTS, SIZE_OPTIONS, } from './constant';
|
|
11
11
|
const buttonStories = {
|
|
12
12
|
title: 'Components/Buttons/Button',
|
|
13
13
|
component: Button,
|
|
@@ -17,33 +17,81 @@ const buttonStories = {
|
|
|
17
17
|
description: {
|
|
18
18
|
component: `Renders a standard button element.
|
|
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=41-12614&t=hz8QJLqNrGvTVY8R-4)
|
|
21
21
|
`,
|
|
22
22
|
},
|
|
23
23
|
},
|
|
24
24
|
},
|
|
25
25
|
argTypes: {
|
|
26
|
+
variant: {
|
|
27
|
+
control: { type: 'select' },
|
|
28
|
+
options: BUTTON_VARIANTS,
|
|
29
|
+
description: 'Different looks of button',
|
|
30
|
+
},
|
|
26
31
|
color: {
|
|
27
|
-
|
|
32
|
+
control: { type: 'select' },
|
|
33
|
+
options: BUTTON_COLORS,
|
|
34
|
+
description: 'Color of the background (solid) or stroke (outline) of the button',
|
|
35
|
+
},
|
|
36
|
+
radius: {
|
|
37
|
+
control: { type: 'select' },
|
|
38
|
+
options: BUTTON_RADII,
|
|
39
|
+
description: 'Border radius',
|
|
40
|
+
},
|
|
41
|
+
weight: {
|
|
42
|
+
control: { type: 'select' },
|
|
43
|
+
options: BUTTON_WEIGHTS,
|
|
44
|
+
description: 'Font weight of label',
|
|
45
|
+
},
|
|
46
|
+
size: {
|
|
47
|
+
control: { type: 'select' },
|
|
48
|
+
options: BUTTON_SIZES,
|
|
49
|
+
description: "Button's size",
|
|
50
|
+
},
|
|
51
|
+
width: {
|
|
52
|
+
control: { type: 'select' },
|
|
53
|
+
options: SIZE_OPTIONS,
|
|
54
|
+
description: 'Button width',
|
|
55
|
+
},
|
|
56
|
+
disabled: {
|
|
57
|
+
control: { type: 'boolean' },
|
|
58
|
+
description: 'Whether this button is disabled. No events triggered.',
|
|
59
|
+
},
|
|
60
|
+
icon: {
|
|
61
|
+
control: { type: 'boolean' },
|
|
62
|
+
description: 'This button has equal and appropriate paddings to cater for icon buttons',
|
|
63
|
+
},
|
|
64
|
+
stretch: {
|
|
65
|
+
control: { type: 'boolean' },
|
|
66
|
+
description: "Whether this button stretch to fill up container's width",
|
|
67
|
+
},
|
|
68
|
+
extraClasses: {
|
|
69
|
+
control: { type: 'text' },
|
|
70
|
+
description: 'Additional classes to be added for customization',
|
|
71
|
+
},
|
|
72
|
+
isLoading: {
|
|
73
|
+
control: { type: 'boolean' },
|
|
74
|
+
description: 'Display loading icon',
|
|
28
75
|
},
|
|
29
76
|
children: {
|
|
30
|
-
control: {
|
|
31
|
-
|
|
32
|
-
},
|
|
77
|
+
control: { type: 'text' },
|
|
78
|
+
description: 'Button content/label',
|
|
33
79
|
},
|
|
34
80
|
as: {
|
|
81
|
+
control: { type: 'select' },
|
|
35
82
|
options: ['button', 'a'],
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
83
|
+
description: 'HTML element or component to render as',
|
|
84
|
+
},
|
|
85
|
+
onClick: {
|
|
86
|
+
action: 'clicked',
|
|
87
|
+
description: 'Click event handler',
|
|
39
88
|
},
|
|
40
89
|
},
|
|
41
90
|
};
|
|
42
91
|
export default buttonStories;
|
|
43
92
|
// top-most story will have the props breakdown
|
|
44
93
|
export const Overview = (args) => <Button {...args}/>;
|
|
45
|
-
|
|
46
|
-
Overview.args = { children: 'Label', as: 'button', onClick: () => alert('clicked') };
|
|
94
|
+
Overview.args = { children: 'Label', as: 'button' };
|
|
47
95
|
const storyClass = css `
|
|
48
96
|
& > * {
|
|
49
97
|
margin: 0.5em 1em 0.5em 0;
|
|
@@ -165,6 +213,9 @@ export const Sizes = ( /* args */) => (<div className={storyClass}>
|
|
|
165
213
|
<Button color="primary" size="large">
|
|
166
214
|
Large
|
|
167
215
|
</Button>
|
|
216
|
+
<Button color="primary" size="xlarge">
|
|
217
|
+
XLarge
|
|
218
|
+
</Button>
|
|
168
219
|
<Button color="error" size="small" weight="normal">
|
|
169
220
|
SMALL
|
|
170
221
|
</Button>
|
|
@@ -174,6 +225,9 @@ export const Sizes = ( /* args */) => (<div className={storyClass}>
|
|
|
174
225
|
<Button color="error" size="large" weight="normal">
|
|
175
226
|
LARGE
|
|
176
227
|
</Button>
|
|
228
|
+
<Button color="error" size="xlarge" weight="normal">
|
|
229
|
+
XLarge
|
|
230
|
+
</Button>
|
|
177
231
|
<br />
|
|
178
232
|
<Button color="info" variant="outline" size="small">
|
|
179
233
|
Small
|
|
@@ -184,6 +238,9 @@ export const Sizes = ( /* args */) => (<div className={storyClass}>
|
|
|
184
238
|
<Button color="info" variant="outline" size="large">
|
|
185
239
|
Large
|
|
186
240
|
</Button>
|
|
241
|
+
<Button color="info" variant="outline" size="xlarge">
|
|
242
|
+
XLarge
|
|
243
|
+
</Button>
|
|
187
244
|
<Button color="success" variant="outline" size="small" weight="normal">
|
|
188
245
|
SMALL
|
|
189
246
|
</Button>
|
|
@@ -193,6 +250,9 @@ export const Sizes = ( /* args */) => (<div className={storyClass}>
|
|
|
193
250
|
<Button color="success" variant="outline" size="large" weight="normal">
|
|
194
251
|
LARGE
|
|
195
252
|
</Button>
|
|
253
|
+
<Button color="info" variant="outline" size="xlarge" weight="normal">
|
|
254
|
+
XLarge
|
|
255
|
+
</Button>
|
|
196
256
|
</div>);
|
|
197
257
|
export const Width = ( /* args */) => (<div className={storyClass}>
|
|
198
258
|
<Button width="xxxl">80px</Button>
|
|
@@ -288,6 +348,22 @@ export const WithIcons = ( /* args */) => (<div className={storyClass}>
|
|
|
288
348
|
</div>);
|
|
289
349
|
export const IconButtons = {
|
|
290
350
|
render: ( /* args */) => (<div className={storyClass}>
|
|
351
|
+
<IconButton color="success" size="xlarge">
|
|
352
|
+
<Phone />
|
|
353
|
+
</IconButton>
|
|
354
|
+
|
|
355
|
+
<IconButton color="success" size="xlarge" variant="outline">
|
|
356
|
+
<Download />
|
|
357
|
+
</IconButton>
|
|
358
|
+
|
|
359
|
+
<IconButton color="error" size="xlarge" radius="circle">
|
|
360
|
+
<SpeechBubbles />
|
|
361
|
+
</IconButton>
|
|
362
|
+
|
|
363
|
+
<IconButton color="error" size="xlarge" radius="circle" variant="outline">
|
|
364
|
+
<Heart />
|
|
365
|
+
</IconButton>
|
|
366
|
+
|
|
291
367
|
<IconButton color="success" size="large">
|
|
292
368
|
<Phone />
|
|
293
369
|
</IconButton>
|
|
@@ -402,3 +478,21 @@ export const ExtraClasses = {
|
|
|
402
478
|
},
|
|
403
479
|
},
|
|
404
480
|
};
|
|
481
|
+
export const ButtonWithNextLink = ( /* args */) => {
|
|
482
|
+
// replace "a" with NextLink
|
|
483
|
+
const NextLink = 'a';
|
|
484
|
+
return (<div className={storyClass}>
|
|
485
|
+
<Button as={NextLink} href="/iframe.html?viewMode=story&id=components-buttons-button--button-with-next-link&example=click-me-1">
|
|
486
|
+
Click me 1
|
|
487
|
+
</Button>
|
|
488
|
+
<Button as={NextLink} href="/iframe.html?viewMode=story&id=components-buttons-button--button-with-next-link&example=click-me-2">
|
|
489
|
+
Click me 2
|
|
490
|
+
</Button>
|
|
491
|
+
<Button as={NextLink} href="/iframe.html?viewMode=story&id=components-buttons-button--button-with-next-link&example=click-me-3">
|
|
492
|
+
Click me 3
|
|
493
|
+
</Button>
|
|
494
|
+
<Button as={NextLink} href="/iframe.html?viewMode=story&id=components-buttons-button--button-with-next-link&example=click-me-4">
|
|
495
|
+
Click me 4
|
|
496
|
+
</Button>
|
|
497
|
+
</div>);
|
|
498
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.styles.d.ts","sourceRoot":"","sources":["../../../components/Button/Button.styles.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"Button.styles.d.ts","sourceRoot":"","sources":["../../../components/Button/Button.styles.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,WAAW,0CA4hBhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|