@chotot/clad-ui 1.2.5 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/components/Announcer/Announcer.d.ts +9 -4
- package/components/Announcer/Announcer.stories.d.ts +142 -0
- package/components/Announcer/{Announcer.stories.js → Announcer.stories.tsx} +36 -31
- package/components/Announcer/Announcer.styles.d.ts +24 -12
- package/components/Announcer/{Announcer.styles.js → Announcer.styles.ts} +43 -18
- package/components/Announcer/Announcer.tsx +62 -47
- package/components/Badge/Badge.d.ts +4 -2
- package/components/Badge/Badge.stories.d.ts +61 -0
- package/components/Badge/{Badge.stories.js → Badge.stories.tsx} +5 -5
- package/components/Badge/Badge.styles.d.ts +20 -5
- package/components/Badge/{Badge.styles.js → Badge.styles.ts} +14 -1
- package/components/Badge/Badge.tsx +8 -4
- package/components/Box/Box.d.ts +3 -3
- package/components/Box/Box.stories.d.ts +240 -0
- package/components/Box/{Box.stories.js → Box.stories.tsx} +2 -2
- package/components/Box/Box.styles.d.ts +19 -4
- package/components/Box/{Box.styles.js → Box.styles.ts} +17 -4
- package/components/Box/Box.tsx +4 -4
- package/components/Breadcrumbs/Breadcrumbs.d.ts +2 -2
- package/components/Breadcrumbs/Breadcrumbs.stories.d.ts +52 -0
- package/components/Breadcrumbs/{Breadcrumbs.stories.js → Breadcrumbs.stories.tsx} +17 -15
- package/components/Breadcrumbs/Breadcrumbs.styles.d.ts +5 -4
- package/components/Breadcrumbs/Breadcrumbs.tsx +2 -2
- package/components/Button/Button.d.ts +21 -6
- package/components/Button/Button.stories.d.ts +103 -0
- package/components/Button/{Button.stories.js → Button.stories.tsx} +5 -1
- package/components/Button/Button.styles.d.ts +1 -1
- package/components/Button/{Button.styles.js → Button.styles.ts} +100 -6
- package/components/Button/Button.tsx +51 -18
- package/components/Button/ButtonLink.d.ts +4 -4
- package/components/Button/ButtonLink.stories.d.ts +30 -0
- package/components/Button/ButtonLink.styles.d.ts +1 -1
- package/components/Button/ButtonLink.tsx +5 -5
- package/components/Button/IconButton.d.ts +3 -29
- package/components/Button/IconButton.stories.d.ts +60 -0
- package/components/Button/{IconButton.stories.js → IconButton.stories.tsx} +27 -0
- package/components/Button/IconButton.tsx +2 -42
- package/components/Checkbox/Checkbox.d.ts +3 -3
- package/components/Checkbox/Checkbox.stories.d.ts +88 -0
- package/components/Checkbox/Checkbox.styles.d.ts +2 -2
- package/components/Checkbox/Checkbox.tsx +3 -6
- package/components/Chip/Chip.d.ts +5 -4
- package/components/Chip/Chip.stories.d.ts +153 -0
- package/components/Chip/{Chip.stories.js → Chip.stories.tsx} +4 -5
- package/components/Chip/Chip.styles.d.ts +11 -8
- package/components/Chip/{Chip.styles.js → Chip.styles.ts} +4 -4
- package/components/Chip/Chip.tsx +19 -12
- package/components/CurrencyInput/CurrencyInput.d.ts +3 -56
- package/components/CurrencyInput/CurrencyInput.stories.d.ts +104 -0
- package/components/CurrencyInput/{CurrencyInput.stories.js → CurrencyInput.stories.tsx} +2 -2
- package/components/CurrencyInput/CurrencyInput.styles.d.ts +16 -10
- package/components/CurrencyInput/{CurrencyInput.styles.js → CurrencyInput.styles.ts} +23 -9
- package/components/CurrencyInput/CurrencyInput.tsx +7 -61
- package/components/Dropdown/Dropdown.d.ts +22 -7
- package/components/Dropdown/Dropdown.stories.d.ts +148 -0
- package/components/Dropdown/{Dropdown.stories.js → Dropdown.stories.tsx} +115 -1
- package/components/Dropdown/Dropdown.styles.d.ts +10 -0
- package/components/Dropdown/Dropdown.styles.ts +42 -0
- package/components/Dropdown/Dropdown.tsx +120 -24
- package/components/Grid/Col.d.ts +2 -2
- package/components/Grid/Col.tsx +6 -3
- package/components/Grid/Grid.styles.d.ts +25 -5
- package/components/Grid/{Grid.styles.js → Grid.styles.ts} +16 -3
- package/components/Grid/aGrid.stories.d.ts +127 -0
- package/components/Grid/bCol.stories.d.ts +74 -0
- package/components/Input/Input.d.ts +14 -10
- package/components/Input/Input.stories.d.ts +226 -0
- package/components/Input/{Input.stories.js → Input.stories.tsx} +20 -16
- package/components/Input/Input.styles.d.ts +22 -11
- package/components/Input/{Input.styles.js → Input.styles.ts} +29 -7
- package/components/Input/Input.tsx +22 -20
- package/components/Popover/Popover.d.ts +44 -0
- package/components/Popover/Popover.stories.d.ts +53 -0
- package/components/Popover/Popover.stories.tsx +133 -0
- package/components/Popover/Popover.tsx +121 -0
- package/components/RadioButton/RadioButton.d.ts +5 -6
- package/components/RadioButton/RadioButton.stories.d.ts +94 -0
- package/components/RadioButton/RadioButton.styles.d.ts +7 -3
- package/components/RadioButton/{RadioButton.styles.js → RadioButton.styles.ts} +1 -1
- package/components/RadioButton/RadioButton.tsx +5 -11
- package/components/RowItem/RowItem.d.ts +27 -9
- package/components/RowItem/RowItem.stories.d.ts +131 -0
- package/components/RowItem/RowItem.stories.tsx +710 -0
- package/components/RowItem/RowItem.styles.d.ts +31 -10
- package/components/RowItem/{RowItem.styles.js → RowItem.styles.ts} +41 -13
- package/components/RowItem/RowItem.tsx +106 -42
- package/components/ShapeIcon/ShapeIcon.d.ts +23 -16
- package/components/ShapeIcon/ShapeIcon.stories.d.ts +91 -0
- package/components/ShapeIcon/{ShapeIcon.stories.js → ShapeIcon.stories.tsx} +21 -8
- package/components/ShapeIcon/ShapeIcon.styles.d.ts +8 -3
- package/components/ShapeIcon/{ShapeIcon.styles.js → ShapeIcon.styles.ts} +6 -3
- package/components/ShapeIcon/ShapeIcon.tsx +25 -21
- package/components/Slider/Slider.d.ts +9 -7
- package/components/Slider/Slider.stories.d.ts +81 -0
- package/components/Slider/{Slider.stories.js → Slider.stories.tsx} +7 -7
- package/components/Slider/Slider.styles.d.ts +15 -11
- package/components/Slider/{Slider.styles.js → Slider.styles.ts} +1 -1
- package/components/Slider/Slider.tsx +21 -16
- package/components/Snack/Snack.d.ts +4 -5
- package/components/Snack/Snack.stories.d.ts +87 -0
- package/components/Snack/Snack.styles.d.ts +9 -8
- package/components/Snack/{Snack.styles.js → Snack.styles.ts} +4 -4
- package/components/Snack/Snack.tsx +14 -11
- package/components/Tabs/Tab.d.ts +6 -6
- package/components/Tabs/Tab.tsx +6 -7
- package/components/Tabs/Tabs.d.ts +7 -4
- package/components/Tabs/Tabs.stories.d.ts +64 -0
- package/components/Tabs/{Tabs.stories.js → Tabs.stories.tsx} +2 -2
- package/components/Tabs/Tabs.styles.d.ts +30 -12
- package/components/Tabs/{Tabs.styles.js → Tabs.styles.ts} +4 -4
- package/components/Tabs/Tabs.tsx +11 -7
- package/components/TextArea/TextArea.d.ts +24 -11
- package/components/TextArea/TextArea.stories.d.ts +151 -0
- package/components/TextArea/{TextArea.stories.js → TextArea.stories.tsx} +5 -96
- package/components/TextArea/TextArea.styles.d.ts +18 -16
- package/components/TextArea/{TextArea.styles.js → TextArea.styles.ts} +39 -19
- package/components/TextArea/TextArea.tsx +85 -31
- package/components/TextLabel/TextLabel.d.ts +35 -0
- package/components/TextLabel/TextLabel.stories.d.ts +40 -0
- package/components/TextLabel/TextLabel.stories.tsx +177 -0
- package/components/TextLabel/TextLabel.styles.d.ts +9 -0
- package/components/TextLabel/TextLabel.styles.ts +24 -0
- package/components/TextLabel/TextLabel.tsx +112 -0
- package/components/ToggleSwitch/ToggleSwitch.d.ts +2 -2
- package/components/ToggleSwitch/ToggleSwitch.stories.d.ts +38 -0
- package/components/ToggleSwitch/ToggleSwitch.styles.d.ts +21 -14
- package/components/ToggleSwitch/{ToggleSwitch.styles.js → ToggleSwitch.styles.ts} +8 -12
- package/components/ToggleSwitch/ToggleSwitch.tsx +12 -6
- package/components/Tooltip/Tooltip.d.ts +9 -3
- package/components/Tooltip/Tooltip.spec.js +5 -3
- package/components/Tooltip/Tooltip.styles.d.ts +7 -8
- package/components/Tooltip/Tooltip.tsx +10 -3
- package/components/index.d.ts +2 -0
- package/components/index.ts +2 -0
- package/icons/PrivateSellerAvatar.d.ts +3 -0
- package/icons/PrivateSellerAvatar.js +3 -0
- package/icons/Sda.d.ts +5 -2
- package/icons/Sda.js +7 -7
- package/icons/VerifiedShop.d.ts +3 -0
- package/icons/VerifiedShop.js +3 -0
- package/package.json +6 -6
- package/patterns/Drawer/Drawer.d.ts +13 -13
- package/patterns/Drawer/Drawer.stories.d.ts +90 -0
- package/patterns/Drawer/{Drawer.stories.js → Drawer.stories.tsx} +25 -0
- package/patterns/Drawer/Drawer.styles.d.ts +30 -26
- package/patterns/Drawer/{Drawer.styles.js → Drawer.styles.ts} +2 -5
- package/patterns/Drawer/Drawer.tsx +20 -41
- package/patterns/EmptyState/EmptyState.d.ts +5 -4
- package/patterns/EmptyState/EmptyState.stories.d.ts +40 -0
- package/patterns/EmptyState/EmptyState.styles.d.ts +10 -10
- package/patterns/EmptyState/{EmptyState.styles.js → EmptyState.styles.ts} +5 -4
- package/patterns/EmptyState/EmptyState.tsx +14 -12
- package/patterns/InputGroup/InputGroup.d.ts +4 -0
- package/patterns/InputGroup/InputGroup.styles.d.ts +5 -4
- package/patterns/InputGroup/InputGroup.tsx +11 -5
- package/patterns/LegacyDialog/DialogMainIcon.d.ts +1 -0
- package/patterns/LegacyDialog/DialogMainIcon.js +51 -0
- package/patterns/LegacyDialog/LegacyDialog.d.ts +3 -3
- package/patterns/LegacyDialog/LegacyDialog.styles.d.ts +8 -10
- package/patterns/LegacyDialog/LegacyDialog.styles.js +1 -46
- package/patterns/LegacyDialog/LegacyDialog.tsx +5 -11
- package/patterns/LegacyPopup/LegacyPopup.d.ts +4 -4
- package/patterns/LegacyPopup/LegacyPopup.styles.d.ts +18 -13
- package/patterns/LegacyPopup/{LegacyPopup.styles.js → LegacyPopup.styles.ts} +3 -1
- package/patterns/LegacyPopup/LegacyPopup.tsx +4 -6
- package/patterns/MultiSearchDropdown/MultiSearchDropdown.d.ts +20 -17
- package/patterns/MultiSearchDropdown/MultiSearchDropdown.stories.d.ts +125 -0
- package/patterns/MultiSearchDropdown/{MultiSearchDropdown.stories.js → MultiSearchDropdown.stories.tsx} +31 -30
- package/patterns/MultiSearchDropdown/MultiSearchDropdown.styles.d.ts +22 -21
- package/patterns/MultiSearchDropdown/{MultiSearchDropdown.styles.js → MultiSearchDropdown.styles.ts} +1 -7
- package/patterns/MultiSearchDropdown/MultiSearchDropdown.tsx +33 -32
- package/patterns/Popup/Popup.d.ts +8 -7
- package/patterns/Popup/Popup.stories.d.ts +102 -0
- package/patterns/Popup/Popup.styles.d.ts +41 -30
- package/patterns/Popup/{Popup.styles.js → Popup.styles.ts} +26 -33
- package/patterns/Popup/Popup.tsx +14 -33
- package/patterns/SearchInput/SearchInput.d.ts +38 -21
- package/patterns/SearchInput/SearchInput.stories.d.ts +186 -0
- package/patterns/SearchInput/{SearchInput.stories.js → SearchInput.stories.tsx} +78 -45
- package/patterns/SearchInput/SearchInput.styles.d.ts +6 -5
- package/patterns/SearchInput/{SearchInput.styles.js → SearchInput.styles.ts} +7 -4
- package/patterns/SearchInput/SearchInput.tsx +53 -34
- package/patterns/TagCloud/TagCloud.d.ts +19 -6
- package/patterns/TagCloud/TagCloud.stories.d.ts +159 -0
- package/patterns/TagCloud/{TagCloud.stories.js → TagCloud.stories.tsx} +59 -14
- package/patterns/TagCloud/TagCloud.styles.d.ts +12 -8
- package/patterns/TagCloud/{TagCloud.styles.js → TagCloud.styles.ts} +6 -7
- package/patterns/TagCloud/TagCloud.tsx +24 -8
- package/patterns/TagCloud/TagCloudMultiActive.d.ts +6 -4
- package/patterns/TagCloud/TagCloudMultiActive.tsx +5 -5
- package/patterns/TagCloud/TagCloudSingleActive.d.ts +5 -2
- package/patterns/TagCloud/TagCloudSingleActive.tsx +18 -5
- package/patterns/patterns-index.spec.js +1 -1
- package/storybook/GuideImage.d.ts +2 -2
- package/storybook/Swatch.d.ts +2 -2
- package/theme/__snapshots__/chotot.spec.js.snap +2 -2
- package/theme/chotot-color1.d.ts +7 -14
- package/theme/chotot.d.ts +32 -32
- package/theme/chotot.js +4 -4
- package/theme/ct-job.d.ts +6 -14
- package/theme/ct-pty.d.ts +6 -8
- package/theme/mudah.d.ts +14 -13
- package/types.d.ts +0 -9
- package/utils/_simulateChangeEvent.d.ts +18 -3
- package/utils/_simulateChangeEvent.js +13 -6
- package/utils/_simulateChangeEvent.spec.js +1 -1
- package/utils/cx.d.ts +8 -4
- package/utils/cx.js +8 -4
- package/utils/sx.d.ts +12 -4192
- package/components/RowItem/RowItem.stories.js +0 -560
- /package/components/Breadcrumbs/{Breadcrumbs.styles.js → Breadcrumbs.styles.ts} +0 -0
- /package/components/Button/{ButtonLink.stories.js → ButtonLink.stories.tsx} +0 -0
- /package/components/Button/{ButtonLink.styles.js → ButtonLink.styles.ts} +0 -0
- /package/components/Checkbox/{Checkbox.stories.js → Checkbox.stories.tsx} +0 -0
- /package/components/Checkbox/{Checkbox.styles.js → Checkbox.styles.ts} +0 -0
- /package/components/Grid/{aGrid.stories.js → aGrid.stories.tsx} +0 -0
- /package/components/Grid/{bCol.stories.js → bCol.stories.tsx} +0 -0
- /package/components/RadioButton/{RadioButton.stories.js → RadioButton.stories.tsx} +0 -0
- /package/components/Snack/{Snack.stories.js → Snack.stories.tsx} +0 -0
- /package/components/ToggleSwitch/{ToggleSwitch.stories.js → ToggleSwitch.stories.tsx} +0 -0
- /package/patterns/EmptyState/{EmptyState.stories.js → EmptyState.stories.tsx} +0 -0
- /package/patterns/InputGroup/{InputGroup.styles.js → InputGroup.styles.ts} +0 -0
- /package/patterns/Popup/{Popup.stories.js → Popup.stories.tsx} +0 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const badgeStory: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: React.FC<import("./Badge").BadgeProps>;
|
|
5
|
+
tags: string[];
|
|
6
|
+
parameters: {
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
args: {
|
|
14
|
+
children: string;
|
|
15
|
+
label: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default badgeStory;
|
|
19
|
+
export declare const Overview: {
|
|
20
|
+
render: (args: any) => JSX.Element;
|
|
21
|
+
};
|
|
22
|
+
export declare const SizeVariants: {
|
|
23
|
+
render: () => JSX.Element;
|
|
24
|
+
parameters: {
|
|
25
|
+
docs: {
|
|
26
|
+
description: {
|
|
27
|
+
story: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export declare const ColorVariants: {
|
|
33
|
+
render: () => JSX.Element;
|
|
34
|
+
parameters: {
|
|
35
|
+
docs: {
|
|
36
|
+
description: {
|
|
37
|
+
story: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export declare const PositionVariants: {
|
|
43
|
+
render: () => JSX.Element;
|
|
44
|
+
parameters: {
|
|
45
|
+
docs: {
|
|
46
|
+
description: {
|
|
47
|
+
story: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export declare const BorderRadiusVariants: {
|
|
53
|
+
render: () => JSX.Element;
|
|
54
|
+
parameters: {
|
|
55
|
+
docs: {
|
|
56
|
+
description: {
|
|
57
|
+
story: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
@@ -67,7 +67,7 @@ export const SizeVariants = {
|
|
|
67
67
|
Without size input :
|
|
68
68
|
<div style={{ marginTop: '24px' }}>
|
|
69
69
|
<Badge label="default sm">
|
|
70
|
-
<Button color="
|
|
70
|
+
<Button color="tertiary"> No size input</Button>
|
|
71
71
|
</Badge>
|
|
72
72
|
</div>
|
|
73
73
|
</Col>
|
|
@@ -75,7 +75,7 @@ export const SizeVariants = {
|
|
|
75
75
|
Small size:
|
|
76
76
|
<div style={{ marginTop: '24px' }}>
|
|
77
77
|
<Badge size="sm" label="9">
|
|
78
|
-
<Button color="
|
|
78
|
+
<Button color="tertiary"> sm Input</Button>
|
|
79
79
|
</Badge>
|
|
80
80
|
</div>
|
|
81
81
|
</Col>
|
|
@@ -83,7 +83,7 @@ export const SizeVariants = {
|
|
|
83
83
|
Medium size:
|
|
84
84
|
<div style={{ marginTop: '24px' }}>
|
|
85
85
|
<Badge size="md" label="999">
|
|
86
|
-
<Button color="
|
|
86
|
+
<Button color="tertiary"> md Input</Button>
|
|
87
87
|
</Badge>
|
|
88
88
|
</div>
|
|
89
89
|
</Col>
|
|
@@ -106,7 +106,7 @@ export const ColorVariants = {
|
|
|
106
106
|
Without color input :
|
|
107
107
|
<div style={{ marginTop: '24px' }}>
|
|
108
108
|
<Badge label="default primary color">
|
|
109
|
-
<Button color="
|
|
109
|
+
<Button color="primary"> No color input</Button>
|
|
110
110
|
</Badge>
|
|
111
111
|
</div>
|
|
112
112
|
</Col>
|
|
@@ -114,7 +114,7 @@ export const ColorVariants = {
|
|
|
114
114
|
With color input:
|
|
115
115
|
<div style={{ marginTop: '24px' }}>
|
|
116
116
|
<Badge backgroundColor="critical" label="critical">
|
|
117
|
-
<Button color="
|
|
117
|
+
<Button color="primary"> With color input </Button>
|
|
118
118
|
</Badge>
|
|
119
119
|
</div>
|
|
120
120
|
</Col>
|
|
@@ -1,9 +1,24 @@
|
|
|
1
|
-
export const badgeSizeSmallClass: import("@linaria/core").LinariaClassName;
|
|
2
|
-
export const badgeSizeMediumClass: import("@linaria/core").LinariaClassName;
|
|
3
|
-
export const StyledBadgeWrapper: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
|
|
4
|
-
as?: import("react").ElementType
|
|
1
|
+
export declare const badgeSizeSmallClass: import("@linaria/core").LinariaClassName;
|
|
2
|
+
export declare const badgeSizeMediumClass: import("@linaria/core").LinariaClassName;
|
|
3
|
+
export declare const StyledBadgeWrapper: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
|
|
4
|
+
as?: import("react").ElementType;
|
|
5
5
|
}>;
|
|
6
6
|
/**
|
|
7
7
|
* @type {any}
|
|
8
8
|
*/
|
|
9
|
-
export const StyledBadge:
|
|
9
|
+
export declare const StyledBadge: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
10
|
+
zIndex: number;
|
|
11
|
+
backgroundColor: string;
|
|
12
|
+
badgePosition: {
|
|
13
|
+
top: string;
|
|
14
|
+
left: string;
|
|
15
|
+
right: string;
|
|
16
|
+
transform: string;
|
|
17
|
+
};
|
|
18
|
+
badgeSizing: {
|
|
19
|
+
borderRadius: string;
|
|
20
|
+
className: string;
|
|
21
|
+
};
|
|
22
|
+
} & {
|
|
23
|
+
as?: import("react").ElementType;
|
|
24
|
+
}>;
|
|
@@ -28,7 +28,20 @@ export const StyledBadgeWrapper = styled.div`
|
|
|
28
28
|
/**
|
|
29
29
|
* @type {any}
|
|
30
30
|
*/
|
|
31
|
-
export const StyledBadge = styled.div
|
|
31
|
+
export const StyledBadge = styled.div<{
|
|
32
|
+
zIndex: number;
|
|
33
|
+
backgroundColor: string;
|
|
34
|
+
badgePosition: {
|
|
35
|
+
top: string;
|
|
36
|
+
left: string;
|
|
37
|
+
right: string;
|
|
38
|
+
transform: string;
|
|
39
|
+
};
|
|
40
|
+
badgeSizing: {
|
|
41
|
+
borderRadius: string;
|
|
42
|
+
className: string;
|
|
43
|
+
};
|
|
44
|
+
}>`
|
|
32
45
|
text-decoration: inherit;
|
|
33
46
|
position: absolute;
|
|
34
47
|
display: block;
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
|
|
10
10
|
const { radii } = theme;
|
|
11
11
|
|
|
12
|
-
export
|
|
12
|
+
export interface BadgeProps {
|
|
13
13
|
/**
|
|
14
14
|
* Size of Badge
|
|
15
15
|
*/
|
|
@@ -46,13 +46,14 @@ export type BadgeProps = {
|
|
|
46
46
|
* z-index
|
|
47
47
|
*/
|
|
48
48
|
zIndex?: number;
|
|
49
|
-
}
|
|
49
|
+
}
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
|
+
* Badge Component for menus and notifications
|
|
53
|
+
*
|
|
52
54
|
* `✅ Stable`
|
|
53
55
|
*/
|
|
54
56
|
|
|
55
|
-
|
|
56
57
|
const Badge: React.FC<BadgeProps> = ({
|
|
57
58
|
size = 'sm',
|
|
58
59
|
children = 'Default Badge Children',
|
|
@@ -108,7 +109,10 @@ const Badge: React.FC<BadgeProps> = ({
|
|
|
108
109
|
borderRadius: _borderRadius ? radii[_borderRadius] : radii.sm,
|
|
109
110
|
};
|
|
110
111
|
default:
|
|
111
|
-
return {
|
|
112
|
+
return {
|
|
113
|
+
className: '',
|
|
114
|
+
borderRadius: '',
|
|
115
|
+
};
|
|
112
116
|
}
|
|
113
117
|
})(size, borderRadius);
|
|
114
118
|
|
package/components/Box/Box.d.ts
CHANGED
|
@@ -5,11 +5,11 @@ declare const getSizes: (value: string[] | string, defaultValue: string) => any[
|
|
|
5
5
|
declare const getBorderWidth: (value: string[] | string, defaultValue: string) => string[];
|
|
6
6
|
declare const getRadiis: (value: string[] | string, defaultValue: string) => any[];
|
|
7
7
|
declare const getShadows: (value: string[] | string, defaultValue: string) => any[];
|
|
8
|
-
export
|
|
8
|
+
export interface BoxProps {
|
|
9
9
|
/**
|
|
10
10
|
* Element or component to be rendered as
|
|
11
11
|
*/
|
|
12
|
-
as?:
|
|
12
|
+
as?: React.ElementType;
|
|
13
13
|
/**
|
|
14
14
|
* Box className
|
|
15
15
|
*/
|
|
@@ -90,7 +90,7 @@ export type BoxProps = {
|
|
|
90
90
|
* Additional inline style object
|
|
91
91
|
*/
|
|
92
92
|
style?: React.CSSProperties;
|
|
93
|
-
}
|
|
93
|
+
}
|
|
94
94
|
/**
|
|
95
95
|
* Clad-UI-s theme-aware replacement for \<div \/\> HTML element
|
|
96
96
|
*
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const boxStories: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: React.FC<import("./Box").BoxProps>;
|
|
5
|
+
tags: string[];
|
|
6
|
+
parameters: {
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
argTypes: {
|
|
14
|
+
borderColor: {
|
|
15
|
+
options: string[];
|
|
16
|
+
};
|
|
17
|
+
borderWidth: {
|
|
18
|
+
options: string[];
|
|
19
|
+
control: {
|
|
20
|
+
type: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
color: {
|
|
24
|
+
options: string[];
|
|
25
|
+
control: {
|
|
26
|
+
type: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
backgroundColor: {
|
|
30
|
+
options: string[];
|
|
31
|
+
control: {
|
|
32
|
+
type: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
padding: {
|
|
36
|
+
options: string[];
|
|
37
|
+
control: {
|
|
38
|
+
type: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
paddingx: {
|
|
42
|
+
options: string[];
|
|
43
|
+
control: {
|
|
44
|
+
type: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
paddingy: {
|
|
48
|
+
options: string[];
|
|
49
|
+
control: {
|
|
50
|
+
type: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
alignItems: {};
|
|
54
|
+
width: {
|
|
55
|
+
options: string[];
|
|
56
|
+
control: {
|
|
57
|
+
type: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
maxWidth: {
|
|
61
|
+
options: string[];
|
|
62
|
+
control: {
|
|
63
|
+
type: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
height: {
|
|
67
|
+
options: string[];
|
|
68
|
+
control: {
|
|
69
|
+
type: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
borderRadius: {
|
|
73
|
+
options: string[];
|
|
74
|
+
control: {
|
|
75
|
+
type: string;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
boxShadow: {
|
|
79
|
+
options: string[];
|
|
80
|
+
control: {
|
|
81
|
+
type: string;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
justifyContent: {};
|
|
85
|
+
textAlign: {};
|
|
86
|
+
style: {
|
|
87
|
+
control: null;
|
|
88
|
+
};
|
|
89
|
+
as: {
|
|
90
|
+
control: null;
|
|
91
|
+
};
|
|
92
|
+
className: {
|
|
93
|
+
control: null;
|
|
94
|
+
};
|
|
95
|
+
backgroundImage: {
|
|
96
|
+
control: null;
|
|
97
|
+
};
|
|
98
|
+
dangerousHtml: {
|
|
99
|
+
control: null;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
args: {
|
|
103
|
+
borderColor: string;
|
|
104
|
+
borderWidth: string;
|
|
105
|
+
color: string;
|
|
106
|
+
backgroundColor: string;
|
|
107
|
+
children: string;
|
|
108
|
+
padding: string;
|
|
109
|
+
paddingx: string;
|
|
110
|
+
paddingy: string;
|
|
111
|
+
alignItems: string;
|
|
112
|
+
width: string;
|
|
113
|
+
maxWidth: string;
|
|
114
|
+
height: string;
|
|
115
|
+
borderRadius: string;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
export default boxStories;
|
|
119
|
+
export declare const Overview: {};
|
|
120
|
+
export declare const WithBackgroundColor: {
|
|
121
|
+
render: () => JSX.Element;
|
|
122
|
+
name: string;
|
|
123
|
+
parameters: {
|
|
124
|
+
docs: {
|
|
125
|
+
description: {
|
|
126
|
+
story: string;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
export declare const WithPadding: {
|
|
132
|
+
render: () => JSX.Element;
|
|
133
|
+
name: string;
|
|
134
|
+
parameters: {
|
|
135
|
+
docs: {
|
|
136
|
+
description: {
|
|
137
|
+
story: string;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
export declare const WithWidth: {
|
|
143
|
+
render: () => JSX.Element;
|
|
144
|
+
name: string;
|
|
145
|
+
parameters: {
|
|
146
|
+
docs: {
|
|
147
|
+
description: {
|
|
148
|
+
story: string;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
export declare const WithHeight: {
|
|
154
|
+
render: () => JSX.Element;
|
|
155
|
+
name: string;
|
|
156
|
+
parameters: {
|
|
157
|
+
docs: {
|
|
158
|
+
description: {
|
|
159
|
+
story: string;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
export declare const WithBorder: {
|
|
165
|
+
render: () => JSX.Element;
|
|
166
|
+
name: string;
|
|
167
|
+
parameters: {
|
|
168
|
+
docs: {
|
|
169
|
+
description: {
|
|
170
|
+
story: string;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
export declare const WithBorderRadius: {
|
|
176
|
+
render: () => JSX.Element;
|
|
177
|
+
name: string;
|
|
178
|
+
parameters: {
|
|
179
|
+
docs: {
|
|
180
|
+
description: {
|
|
181
|
+
story: string;
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
export declare const WithShadows: {
|
|
187
|
+
render: () => JSX.Element;
|
|
188
|
+
name: string;
|
|
189
|
+
parameters: {
|
|
190
|
+
docs: {
|
|
191
|
+
description: {
|
|
192
|
+
story: string;
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
export declare const WithTextAlign: {
|
|
198
|
+
render: () => JSX.Element;
|
|
199
|
+
name: string;
|
|
200
|
+
parameters: {
|
|
201
|
+
docs: {
|
|
202
|
+
description: {
|
|
203
|
+
story: string;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
export declare const WithAlignItems: {
|
|
209
|
+
render: () => JSX.Element;
|
|
210
|
+
name: string;
|
|
211
|
+
parameters: {
|
|
212
|
+
docs: {
|
|
213
|
+
description: {
|
|
214
|
+
story: string;
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
export declare const WithJustifyContent: {
|
|
220
|
+
render: () => JSX.Element;
|
|
221
|
+
name: string;
|
|
222
|
+
parameters: {
|
|
223
|
+
docs: {
|
|
224
|
+
description: {
|
|
225
|
+
story: string;
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
export declare const HtmlContentExample: {
|
|
231
|
+
render: () => JSX.Element;
|
|
232
|
+
name: string;
|
|
233
|
+
parameters: {
|
|
234
|
+
docs: {
|
|
235
|
+
description: {
|
|
236
|
+
story: string;
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
};
|
|
@@ -1,5 +1,20 @@
|
|
|
1
|
+
declare const StyledBox: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
2
|
+
boxColor: string;
|
|
3
|
+
textAlign: string;
|
|
4
|
+
backgroundColor: string;
|
|
5
|
+
paddingy: string[];
|
|
6
|
+
paddingx: string[];
|
|
7
|
+
boxWidth: string[];
|
|
8
|
+
maxWidth: string[];
|
|
9
|
+
boxHeight: string[];
|
|
10
|
+
borderWidth: string[];
|
|
11
|
+
borderColor: string;
|
|
12
|
+
backgroundImage: string;
|
|
13
|
+
borderRadius: string[];
|
|
14
|
+
boxShadow: string[];
|
|
15
|
+
justifyContent: string;
|
|
16
|
+
alignItems: string;
|
|
17
|
+
} & {
|
|
18
|
+
as?: import("react").ElementType;
|
|
19
|
+
}>;
|
|
1
20
|
export default StyledBox;
|
|
2
|
-
/**
|
|
3
|
-
* @type {React.FC<any>}
|
|
4
|
-
*/
|
|
5
|
-
declare const StyledBox: React.FC<any>;
|
|
@@ -3,10 +3,23 @@ import theme from '@clad-ui/theme';
|
|
|
3
3
|
|
|
4
4
|
const { breakpoints, mediaQueries, borderStyles } = theme;
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
const StyledBox = styled.div<{
|
|
7
|
+
boxColor: string;
|
|
8
|
+
textAlign: string;
|
|
9
|
+
backgroundColor: string;
|
|
10
|
+
paddingy: string[];
|
|
11
|
+
paddingx: string[];
|
|
12
|
+
boxWidth: string[];
|
|
13
|
+
maxWidth: string[];
|
|
14
|
+
boxHeight: string[];
|
|
15
|
+
borderWidth: string[];
|
|
16
|
+
borderColor: string;
|
|
17
|
+
backgroundImage: string;
|
|
18
|
+
borderRadius: string[];
|
|
19
|
+
boxShadow: string[];
|
|
20
|
+
justifyContent: string;
|
|
21
|
+
alignItems: string;
|
|
22
|
+
}>`
|
|
10
23
|
color: ${({ boxColor }) => boxColor};
|
|
11
24
|
text-align: ${({ textAlign }) => textAlign};
|
|
12
25
|
background-color: ${({ backgroundColor }) => backgroundColor};
|
package/components/Box/Box.tsx
CHANGED
|
@@ -21,11 +21,11 @@ const getRadiis = (value: string[] | string, defaultValue: string) =>
|
|
|
21
21
|
const getShadows = (value: string[] | string, defaultValue: string) =>
|
|
22
22
|
getBreakpointsValues(value, defaultValue).map((v) => shadows[v] || shadows.none);
|
|
23
23
|
|
|
24
|
-
export
|
|
24
|
+
export interface BoxProps {
|
|
25
25
|
/**
|
|
26
26
|
* Element or component to be rendered as
|
|
27
27
|
*/
|
|
28
|
-
as?:
|
|
28
|
+
as?: React.ElementType;
|
|
29
29
|
/**
|
|
30
30
|
* Box className
|
|
31
31
|
*/
|
|
@@ -127,7 +127,7 @@ export type BoxProps = {
|
|
|
127
127
|
* Additional inline style object
|
|
128
128
|
*/
|
|
129
129
|
style?: React.CSSProperties;
|
|
130
|
-
}
|
|
130
|
+
}
|
|
131
131
|
|
|
132
132
|
/**
|
|
133
133
|
* Clad-UI-s theme-aware replacement for \<div \/\> HTML element
|
|
@@ -138,7 +138,7 @@ export type BoxProps = {
|
|
|
138
138
|
const Box: React.FC<BoxProps> = ({
|
|
139
139
|
as = 'div',
|
|
140
140
|
className = '',
|
|
141
|
-
style =
|
|
141
|
+
style = undefined,
|
|
142
142
|
borderColor = null,
|
|
143
143
|
alignItems = 'initial',
|
|
144
144
|
justifyContent = 'initial',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export
|
|
2
|
+
export interface BreadcrumbsProps {
|
|
3
3
|
/**
|
|
4
4
|
* Breadcrumbs className
|
|
5
5
|
*/
|
|
@@ -12,6 +12,6 @@ export type BreadcrumbsProps = {
|
|
|
12
12
|
* Whether this Breadcrumbs is show or not
|
|
13
13
|
*/
|
|
14
14
|
isShow?: boolean;
|
|
15
|
-
}
|
|
15
|
+
}
|
|
16
16
|
declare const Breadcrumbs: React.FC<BreadcrumbsProps>;
|
|
17
17
|
export default Breadcrumbs;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const breadcrumbsStories: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: React.FC<import("./Breadcrumbs").BreadcrumbsProps>;
|
|
5
|
+
tags: string[];
|
|
6
|
+
parameters: {
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
argTypes: {
|
|
14
|
+
isShow: {};
|
|
15
|
+
children: {
|
|
16
|
+
control: null;
|
|
17
|
+
};
|
|
18
|
+
className: {
|
|
19
|
+
control: null;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export default breadcrumbsStories;
|
|
24
|
+
export declare const Overview: {
|
|
25
|
+
render: (args: any) => JSX.Element;
|
|
26
|
+
};
|
|
27
|
+
export declare const ChildrenWithWrapper: {
|
|
28
|
+
render: () => JSX.Element;
|
|
29
|
+
name: string;
|
|
30
|
+
parameters: {
|
|
31
|
+
docs: {
|
|
32
|
+
description: {
|
|
33
|
+
story: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export declare const WithIsShow: {
|
|
39
|
+
render: () => JSX.Element;
|
|
40
|
+
name: string;
|
|
41
|
+
};
|
|
42
|
+
export declare const LongBreadcrumbsExample: {
|
|
43
|
+
render: () => JSX.Element;
|
|
44
|
+
name: string;
|
|
45
|
+
parameters: {
|
|
46
|
+
docs: {
|
|
47
|
+
description: {
|
|
48
|
+
story: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
};
|
|
@@ -86,21 +86,23 @@ export const Overview = {
|
|
|
86
86
|
/**
|
|
87
87
|
* Mimic `next/link` component
|
|
88
88
|
*/
|
|
89
|
-
const Link = React.forwardRef
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
});
|
|
89
|
+
const Link = React.forwardRef<HTMLElement, { href: string; children: React.ReactElement<any> }>(
|
|
90
|
+
({ href, children }, ref) => {
|
|
91
|
+
const handleClick = (event) => {
|
|
92
|
+
// stop default hyperlink redirection
|
|
93
|
+
event.preventDefault();
|
|
94
|
+
|
|
95
|
+
// eslint-disable-next-line no-alert
|
|
96
|
+
alert(`Simulated Next.js Link click to ${href}`);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
return React.cloneElement(children, {
|
|
100
|
+
href,
|
|
101
|
+
ref,
|
|
102
|
+
onClick: handleClick,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
);
|
|
104
106
|
|
|
105
107
|
export const ChildrenWithWrapper = {
|
|
106
108
|
render: () => (
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
as?: import("react").ElementType
|
|
1
|
+
declare const StyledBreadcrumbs: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLOListElement> & import("react").OlHTMLAttributes<HTMLOListElement> & Record<never, unknown> & {
|
|
2
|
+
as?: import("react").ElementType;
|
|
3
3
|
}>;
|
|
4
|
-
|
|
5
|
-
as?: import("react").ElementType
|
|
4
|
+
declare const Placeholder: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
|
|
5
|
+
as?: import("react").ElementType;
|
|
6
6
|
}>;
|
|
7
|
+
export { StyledBreadcrumbs, Placeholder };
|