@chotot/clad-ui 2.0.0 → 2.2.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 +4 -2
- package/dist/components/Badge/Badge.d.ts +10 -2
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/Badge/Badge.js +42 -27
- package/dist/components/Badge/Badge.stories.d.ts.map +1 -1
- package/dist/components/Badge/Badge.stories.js +153 -126
- package/dist/components/Badge/Badge.styles.d.ts +2 -1
- package/dist/components/Badge/Badge.styles.d.ts.map +1 -1
- package/dist/components/Badge/Badge.styles.js +77 -18
- package/dist/components/Breadcrumbs/BreadcrumbItem.js +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.stories.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.stories.js +19 -13
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +1 -0
- package/dist/components/Button/Button.stories.d.ts +76 -2
- package/dist/components/Button/Button.stories.d.ts.map +1 -1
- package/dist/components/Button/Button.stories.js +86 -10
- package/dist/components/Button/Button.styles.d.ts.map +1 -1
- package/dist/components/Button/Button.styles.js +16 -0
- package/dist/components/Button/GhostButton.d.ts +1 -1
- package/dist/components/Button/GhostButton.d.ts.map +1 -1
- package/dist/components/Button/GhostButton.js +1 -0
- package/dist/components/Button/GhostButton.stories.d.ts +78 -0
- package/dist/components/Button/GhostButton.stories.d.ts.map +1 -1
- package/dist/components/Button/GhostButton.stories.js +62 -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.map +1 -1
- package/dist/components/Button/IconButton.js +1 -0
- package/dist/components/Button/IconButton.stories.d.ts +73 -1
- package/dist/components/Button/IconButton.stories.d.ts.map +1 -1
- package/dist/components/Button/IconButton.stories.js +57 -8
- 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/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 +15 -2
- package/dist/components/Pagination/PageItem.d.ts.map +1 -1
- package/dist/components/Pagination/PageItem.js +1 -0
- package/dist/components/RowItem/RowItem.d.ts.map +1 -1
- package/dist/components/RowItem/RowItem.js +3 -6
- package/dist/components/Tabs/Tab.d.ts.map +1 -1
- package/dist/components/Tabs/Tab.js +1 -0
- package/dist/components/Tabs/Tabs.styles.js +1 -1
- package/dist/components/TextArea/TextArea.d.ts +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- 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 +50 -11
- 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/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/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/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/storybook/Popover.js +1 -0
- package/dist/theme/chotot.d.ts +8 -4
- package/dist/theme/chotot.d.ts.map +1 -1
- package/dist/theme/chotot.js +10 -6
- package/dist/theme/ct-job.d.ts +8 -4
- package/dist/theme/ct-job.d.ts.map +1 -1
- package/dist/theme/ct-pty.d.ts +8 -4
- package/dist/theme/ct-pty.d.ts.map +1 -1
- package/dist/theme/ct-veh.d.ts +8 -4
- package/dist/theme/ct-veh.d.ts.map +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/package.json +5 -1
|
@@ -135,7 +135,7 @@ const ScrollButton = styled.button `
|
|
|
135
135
|
height: auto;
|
|
136
136
|
width: 52px;
|
|
137
137
|
background-color: ${colors.backgroundPrimary};
|
|
138
|
-
|
|
138
|
+
display: ${({ isHidden }) => (isHidden ? 'none' : 'block')};
|
|
139
139
|
transition: all ease 0.3s;
|
|
140
140
|
|
|
141
141
|
&:hover {
|
|
@@ -46,7 +46,7 @@ export interface TextAreaProps {
|
|
|
46
46
|
*/
|
|
47
47
|
status?: 'default' | 'error';
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* Prompt a helptext below TextArea (useful when implemented with form validation)
|
|
50
50
|
*/
|
|
51
51
|
helptext?: string;
|
|
52
52
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ export { default as MultiSearchDropdown } from './patterns/MultiSearchDropdown/M
|
|
|
37
37
|
export { default as Popup } from './patterns/Popup/Popup';
|
|
38
38
|
export { default as SearchInput } from './patterns/SearchInput/SearchInput';
|
|
39
39
|
export { default as TagCloud } from './patterns/TagCloud/TagCloud';
|
|
40
|
+
export { default as Searchbar } from './patterns/Searchbar/Searchbar';
|
|
41
|
+
export { default as RangeInput } from './patterns/RangeInput/RangeInput';
|
|
40
42
|
export { default as DisplayPage } from './typography/DisplayPage';
|
|
41
43
|
export { default as DisplaySection } from './typography/DisplaySection';
|
|
42
44
|
export { default as DisplayCaption } from './typography/DisplayCaption';
|
|
@@ -44,6 +46,7 @@ export { default as DisplayAnnotation } from './typography/DisplayAnnotation';
|
|
|
44
46
|
export { default as HeaderPage } from './typography/HeaderPage';
|
|
45
47
|
export { default as HeaderSection } from './typography/HeaderSection';
|
|
46
48
|
export { default as HeaderCaption } from './typography/HeaderCaption';
|
|
49
|
+
export { default as HeaderAnnotation } from './typography/HeaderAnnotation';
|
|
47
50
|
export { default as LabelPage } from './typography/LabelPage';
|
|
48
51
|
export { default as LabelSection } from './typography/LabelSection';
|
|
49
52
|
export { default as LabelCaption } from './typography/LabelCaption';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,wBA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ultiSearchDropdown/M
|
|
|
39
39
|
export { default as Popup } from './patterns/Popup/Popup';
|
|
40
40
|
export { default as SearchInput } from './patterns/SearchInput/SearchInput';
|
|
41
41
|
export { default as TagCloud } from './patterns/TagCloud/TagCloud';
|
|
42
|
+
export { default as Searchbar } from './patterns/Searchbar/Searchbar';
|
|
43
|
+
export { default as RangeInput } from './patterns/RangeInput/RangeInput';
|
|
42
44
|
// typography
|
|
43
45
|
export { default as DisplayPage } from './typography/DisplayPage';
|
|
44
46
|
export { default as DisplaySection } from './typography/DisplaySection';
|
|
@@ -47,6 +49,7 @@ export { default as DisplayAnnotation } from './typography/DisplayAnnotation';
|
|
|
47
49
|
export { default as HeaderPage } from './typography/HeaderPage';
|
|
48
50
|
export { default as HeaderSection } from './typography/HeaderSection';
|
|
49
51
|
export { default as HeaderCaption } from './typography/HeaderCaption';
|
|
52
|
+
export { default as HeaderAnnotation } from './typography/HeaderAnnotation';
|
|
50
53
|
export { default as LabelPage } from './typography/LabelPage';
|
|
51
54
|
export { default as LabelSection } from './typography/LabelSection';
|
|
52
55
|
export { default as LabelCaption } from './typography/LabelCaption';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export type EmptyStateType = '
|
|
2
|
+
export type EmptyStateType = 'maintenance' | 'keywordNoResult' | 'filterNoResult' | 'noAvailable' | 'grantAccess' | 'notFound' | 'disconnection' | 'other';
|
|
3
3
|
export interface EmptyStateProps {
|
|
4
4
|
/**
|
|
5
5
|
* Type of Empty State
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../../patterns/EmptyState/EmptyState.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../../patterns/EmptyState/EmptyState.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,MAAM,MAAM,cAAc,GACtB,aAAa,GACb,iBAAiB,GACjB,gBAAgB,GAChB,aAAa,GACb,aAAa,GACb,UAAU,GACV,eAAe,GACf,OAAO,CAAC;AA+DZ,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,IAAI,EAAE,cAAc,CAAC;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAC3D;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AACD;;;;GAIG;AAEH,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAgCzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,52 +1,54 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { emptyStateClass, emptyStateContentClass, emptyStateContentTextClass, } from './EmptyState.styles';
|
|
4
4
|
import Button from '../../components/Button/Button';
|
|
5
5
|
import noop from '../../utils/noop';
|
|
6
|
+
const BASE_IMAGE_URL = 'https://storage.googleapis.com/static-chotot-com/storage/empty_state/png';
|
|
6
7
|
const EMPTY = {
|
|
7
8
|
notFound: {
|
|
8
|
-
title: '
|
|
9
|
-
description: '
|
|
10
|
-
buttonLabel: '
|
|
11
|
-
|
|
9
|
+
title: 'Trang không tồn tại',
|
|
10
|
+
description: 'Có khi nào bạn nhầm đường dẫn không?',
|
|
11
|
+
buttonLabel: 'Trở về trang chủ',
|
|
12
|
+
img: `${BASE_IMAGE_URL}/404.png`,
|
|
12
13
|
},
|
|
13
|
-
|
|
14
|
-
title: '
|
|
15
|
-
description:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
svg: 'https://static.chotot.com/storage/empty_state/svg/no-result-v2.svg',
|
|
14
|
+
maintenance: {
|
|
15
|
+
title: 'Tạm nghỉ để bảo trì',
|
|
16
|
+
description: 'Chút nữa ghé lại nha bạn ơi. \nXin hứa trải nghiệm sẽ mượt hơn nhiều!',
|
|
17
|
+
buttonLabel: 'Trở về trang chủ',
|
|
18
|
+
img: `${BASE_IMAGE_URL}/maintenance.png`,
|
|
19
19
|
},
|
|
20
|
-
|
|
21
|
-
title: '
|
|
22
|
-
description: '
|
|
23
|
-
buttonLabel: '
|
|
24
|
-
|
|
20
|
+
keywordNoResult: {
|
|
21
|
+
title: 'Hic! Chưa tìm thấy kết quả nào',
|
|
22
|
+
description: 'Thử đổi từ khóa, viết đúng chính tả, những deal ngon ‘“sốt xình xịch” sẽ hiện ra nhanh thôi!',
|
|
23
|
+
buttonLabel: 'Thay đổi từ khóa',
|
|
24
|
+
img: `${BASE_IMAGE_URL}/keyword-no-result.png`,
|
|
25
25
|
},
|
|
26
|
-
|
|
27
|
-
title: '
|
|
28
|
-
description: '
|
|
29
|
-
buttonLabel: '
|
|
30
|
-
|
|
26
|
+
filterNoResult: {
|
|
27
|
+
title: 'Không có kết quả cho bộ lọc đã chọn',
|
|
28
|
+
description: 'Không tìm thấy tin đăng cho những gì bạn đã lọc. Hãy thay đổi tiêu chí Lọc hoặc Bỏ lọc.',
|
|
29
|
+
buttonLabel: 'Thay đổi bộ lọc',
|
|
30
|
+
img: `${BASE_IMAGE_URL}/filter-no-result.png`,
|
|
31
31
|
},
|
|
32
|
-
|
|
32
|
+
noAvailable: {
|
|
33
33
|
title: 'Tin đăng không còn tồn tại',
|
|
34
|
-
description:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
svg: 'https://static.chotot.com/storage/empty_state/svg/empty-ad-v2.svg',
|
|
34
|
+
description: 'Một là hết hạn, hai là bị ẩn, ba là đã bán. Xem tiếp các tin khác để không bỏ lỡ deal xịn nha!',
|
|
35
|
+
buttonLabel: 'Trở về trang chủ',
|
|
36
|
+
img: `${BASE_IMAGE_URL}/no-available.png`,
|
|
38
37
|
},
|
|
39
|
-
|
|
40
|
-
title: '
|
|
41
|
-
description:
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
grantAccess: {
|
|
39
|
+
title: 'Xin quyền truy cập nha!',
|
|
40
|
+
description: (<p>
|
|
41
|
+
Cần quyền truy cập Ảnh để sử dụng tính năng đăng tin. Truy cập vào <strong>Cài đặt</strong>{' '}
|
|
42
|
+
{'>'} <strong>Ứng dụng</strong> {'>'} Chợ Tốt Bật <strong>“Ảnh”</strong>
|
|
43
|
+
</p>),
|
|
44
|
+
buttonLabel: 'Cho phép',
|
|
45
|
+
img: `${BASE_IMAGE_URL}/grant-access.png`,
|
|
44
46
|
},
|
|
45
|
-
|
|
46
|
-
title: '
|
|
47
|
-
description: '
|
|
48
|
-
buttonLabel: '
|
|
49
|
-
|
|
47
|
+
disconnection: {
|
|
48
|
+
title: 'Tạm mất kết nối :(',
|
|
49
|
+
description: 'Nhưng không sao! Deal ngon giá tốt vẫn ở đây & được cập nhật liên tục! Nhanh tay kiểm tra lại wifi/4G để không lỡ deal hot nha!',
|
|
50
|
+
buttonLabel: 'Thử lại trang',
|
|
51
|
+
img: `${BASE_IMAGE_URL}/disconnection.png`,
|
|
50
52
|
},
|
|
51
53
|
};
|
|
52
54
|
/**
|
|
@@ -56,21 +58,24 @@ Hãy thử những tin đăng khác, bạn nhé.`,
|
|
|
56
58
|
*/
|
|
57
59
|
const EmptyState = ({ type, title = null, coverImage = null, description = null, buttonLabel = null, onButtonClick = noop, }) => {
|
|
58
60
|
var _a, _b, _c, _d;
|
|
59
|
-
const
|
|
61
|
+
const imgUrl = coverImage !== null && coverImage !== void 0 ? coverImage : (_a = EMPTY === null || EMPTY === void 0 ? void 0 : EMPTY[type]) === null || _a === void 0 ? void 0 : _a.img;
|
|
60
62
|
const headerText = title !== null && title !== void 0 ? title : (_b = EMPTY === null || EMPTY === void 0 ? void 0 : EMPTY[type]) === null || _b === void 0 ? void 0 : _b.title;
|
|
61
63
|
const descriptionText = description !== null && description !== void 0 ? description : (_c = EMPTY === null || EMPTY === void 0 ? void 0 : EMPTY[type]) === null || _c === void 0 ? void 0 : _c.description;
|
|
62
64
|
const buttonLabelText = buttonLabel !== null && buttonLabel !== void 0 ? buttonLabel : (_d = EMPTY === null || EMPTY === void 0 ? void 0 : EMPTY[type]) === null || _d === void 0 ? void 0 : _d.buttonLabel;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
const descriptionHtml = typeof descriptionText === 'string' ? <p>{descriptionText}</p> : descriptionText;
|
|
66
|
+
return (<div className={emptyStateClass} data-clad="Empty State">
|
|
67
|
+
<img src={imgUrl} alt={headerText} width={200} height={200}/>
|
|
68
|
+
|
|
69
|
+
<div className={emptyStateContentClass}>
|
|
70
|
+
<div className={emptyStateContentTextClass}>
|
|
71
|
+
<h3>{headerText}</h3>
|
|
72
|
+
|
|
73
|
+
{descriptionHtml}
|
|
74
|
+
</div>
|
|
75
|
+
<Button size="large" color="primary" onClick={onButtonClick}>
|
|
71
76
|
{buttonLabelText}
|
|
72
77
|
</Button>
|
|
73
|
-
</
|
|
74
|
-
</
|
|
78
|
+
</div>
|
|
79
|
+
</div>);
|
|
75
80
|
};
|
|
76
81
|
export default EmptyState;
|
|
@@ -28,7 +28,17 @@ export declare const OverrideStyle: {
|
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
|
-
export declare const
|
|
31
|
+
export declare const AllTypes: {
|
|
32
|
+
render: () => JSX.Element;
|
|
33
|
+
parameters: {
|
|
34
|
+
docs: {
|
|
35
|
+
description: {
|
|
36
|
+
story: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export declare const OtherType: {
|
|
32
42
|
render: () => JSX.Element;
|
|
33
43
|
parameters: {
|
|
34
44
|
docs: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.stories.d.ts","sourceRoot":"","sources":["../../../patterns/EmptyState/EmptyState.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;CAoCtB,CAAC;AAEF,eAAe,iBAAiB,CAAC;AAEjC,eAAO,MAAM,QAAQ;;CAQpB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;CAuBzB,CAAC;AAEF,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"EmptyState.stories.d.ts","sourceRoot":"","sources":["../../../patterns/EmptyState/EmptyState.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;CAoCtB,CAAC;AAEF,eAAe,iBAAiB,CAAC;AAEjC,eAAO,MAAM,QAAQ;;CAQpB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;CAuBzB,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;;;;;CAyCpB,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;;;;CAyBrB,CAAC"}
|
|
@@ -14,22 +14,22 @@ const emptyStateStories = {
|
|
|
14
14
|
\`✅ Stable\` [\`🎨 Figma Specs\`](https://www.figma.com/design/DfQM6G9p8PSNEoOzNGRjWD/v3.0-CHOTOT-Design-System---Processing?node-id=14424-23223&t=hz8QJLqNrGvTVY8R-4)
|
|
15
15
|
|
|
16
16
|
## How to use
|
|
17
|
-
EmptyState is a component for showing empty UI
|
|
17
|
+
EmptyState is a component for showing empty UI based on type of empty with an interactive button
|
|
18
18
|
|
|
19
19
|
This component is mobile supported
|
|
20
20
|
|
|
21
|
-
It
|
|
21
|
+
It also comes with an 'other' type for dynamic usage customization. See below examples
|
|
22
22
|
|
|
23
23
|
There are 7 main types of Empty State and 1 custom type:
|
|
24
24
|
|
|
25
25
|
- \`notFound\`: For empty page by error 404/ wrong url
|
|
26
|
-
- \`
|
|
27
|
-
- \`
|
|
28
|
-
- \`
|
|
29
|
-
- \`
|
|
30
|
-
- \`
|
|
31
|
-
- \`
|
|
32
|
-
- \`
|
|
26
|
+
- \`maintenance\`: For page which is under maintenance
|
|
27
|
+
- \`keywordNoResult\`: For empty search result
|
|
28
|
+
- \`filterNoResult\`: For empty filter result
|
|
29
|
+
- \`noAvailable\`: For ads which are no longer available
|
|
30
|
+
- \`grantAccess\`: For requesting user permissions
|
|
31
|
+
- \`disconnection\`: For network connection errors
|
|
32
|
+
- \`other\`: Customizable type
|
|
33
33
|
|
|
34
34
|
`,
|
|
35
35
|
},
|
|
@@ -67,7 +67,46 @@ export const OverrideStyle = {
|
|
|
67
67
|
},
|
|
68
68
|
},
|
|
69
69
|
};
|
|
70
|
-
export const
|
|
70
|
+
export const AllTypes = {
|
|
71
|
+
render: () => (<Grid gutter="md">
|
|
72
|
+
<Col span={[12, 6, 4]}>
|
|
73
|
+
<h4>Not Found</h4>
|
|
74
|
+
<EmptyState type="notFound"/>
|
|
75
|
+
</Col>
|
|
76
|
+
<Col span={[12, 6, 4]}>
|
|
77
|
+
<h4>Maintenance</h4>
|
|
78
|
+
<EmptyState type="maintenance"/>
|
|
79
|
+
</Col>
|
|
80
|
+
<Col span={[12, 6, 4]}>
|
|
81
|
+
<h4>Keyword No Result</h4>
|
|
82
|
+
<EmptyState type="keywordNoResult"/>
|
|
83
|
+
</Col>
|
|
84
|
+
<Col span={[12, 6, 4]}>
|
|
85
|
+
<h4>Filter No Result</h4>
|
|
86
|
+
<EmptyState type="filterNoResult"/>
|
|
87
|
+
</Col>
|
|
88
|
+
<Col span={[12, 6, 4]}>
|
|
89
|
+
<h4>No Available</h4>
|
|
90
|
+
<EmptyState type="noAvailable"/>
|
|
91
|
+
</Col>
|
|
92
|
+
<Col span={[12, 6, 4]}>
|
|
93
|
+
<h4>Grant Access</h4>
|
|
94
|
+
<EmptyState type="grantAccess"/>
|
|
95
|
+
</Col>
|
|
96
|
+
<Col span={[12, 6, 4]}>
|
|
97
|
+
<h4>Disconnection</h4>
|
|
98
|
+
<EmptyState type="disconnection"/>
|
|
99
|
+
</Col>
|
|
100
|
+
</Grid>),
|
|
101
|
+
parameters: {
|
|
102
|
+
docs: {
|
|
103
|
+
description: {
|
|
104
|
+
story: 'This shows all available EmptyState types with their default content',
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
export const OtherType = {
|
|
71
110
|
render: () => {
|
|
72
111
|
const props = {
|
|
73
112
|
title: 'Test Custom Type Title',
|
|
@@ -84,7 +123,7 @@ export const OthersType = {
|
|
|
84
123
|
parameters: {
|
|
85
124
|
docs: {
|
|
86
125
|
description: {
|
|
87
|
-
story: 'This
|
|
126
|
+
story: 'This shows how to use customization feature with the other type',
|
|
88
127
|
},
|
|
89
128
|
},
|
|
90
129
|
},
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export declare const StyledEmptyHeaderText: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLHeadingElement> & import("react").HTMLAttributes<HTMLHeadingElement> & Record<never, unknown> & {
|
|
5
|
-
as?: import("react").ElementType;
|
|
6
|
-
}>;
|
|
7
|
-
export declare const StyledEmptyBodyText: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLParagraphElement> & import("react").HTMLAttributes<HTMLParagraphElement> & Record<never, unknown> & {
|
|
8
|
-
as?: import("react").ElementType;
|
|
9
|
-
}>;
|
|
10
|
-
export declare const StyledSVGWrapper: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
|
|
11
|
-
as?: import("react").ElementType;
|
|
12
|
-
}>;
|
|
13
|
-
export declare const StyledButtonWrapper: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown> & {
|
|
14
|
-
as?: import("react").ElementType;
|
|
15
|
-
}>;
|
|
1
|
+
export declare const emptyStateClass: import("@linaria/core").LinariaClassName;
|
|
2
|
+
export declare const emptyStateContentClass: import("@linaria/core").LinariaClassName;
|
|
3
|
+
export declare const emptyStateContentTextClass: import("@linaria/core").LinariaClassName;
|
|
16
4
|
//# sourceMappingURL=EmptyState.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.styles.d.ts","sourceRoot":"","sources":["../../../patterns/EmptyState/EmptyState.styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"EmptyState.styles.d.ts","sourceRoot":"","sources":["../../../patterns/EmptyState/EmptyState.styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe,0CAa3B,CAAC;AAEF,eAAO,MAAM,sBAAsB,0CAMlC,CAAC;AAEF,eAAO,MAAM,0BAA0B,0CAkBtC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import theme from '@clad-ui/theme';
|
|
2
|
-
import {
|
|
3
|
-
const { colors,
|
|
4
|
-
export const
|
|
2
|
+
import { css } from '@linaria/core';
|
|
3
|
+
const { colors, space, typo } = theme;
|
|
4
|
+
export const emptyStateClass = css `
|
|
5
5
|
display: flex;
|
|
6
6
|
justify-content: center;
|
|
7
7
|
align-items: center;
|
|
@@ -10,51 +10,34 @@ export const StyledEmptyState = styled.div `
|
|
|
10
10
|
outline: 1px solid var(--cladebug);
|
|
11
11
|
outline-offset: 1px;
|
|
12
12
|
position: relative;
|
|
13
|
-
`;
|
|
14
|
-
export const StyledEmptyHeaderText = styled.h3 `
|
|
15
|
-
font-size: ${fontSizes.h3};
|
|
16
|
-
line-height: ${lineHeights.md};
|
|
17
|
-
font-weight: ${fontWeights.bold};
|
|
18
|
-
color: ${colors.textPrimary};
|
|
19
|
-
`;
|
|
20
|
-
export const StyledEmptyBodyText = styled.p `
|
|
21
|
-
font-size: ${fontSizes.sm};
|
|
22
|
-
line-height: ${lineHeights.xs};
|
|
23
|
-
color: ${colors.textPrimary};
|
|
24
|
-
text-align: center;
|
|
25
|
-
white-space: break-spaces;
|
|
26
|
-
max-width: ${sizes.$md};
|
|
27
|
-
margin-bottom: ${space.md};
|
|
28
13
|
|
|
29
|
-
|
|
30
|
-
|
|
14
|
+
img {
|
|
15
|
+
object-fit: contain;
|
|
31
16
|
}
|
|
32
17
|
`;
|
|
33
|
-
export const
|
|
18
|
+
export const emptyStateContentClass = css `
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
gap: ${space.xs};
|
|
24
|
+
`;
|
|
25
|
+
export const emptyStateContentTextClass = css `
|
|
34
26
|
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
35
28
|
align-items: center;
|
|
36
29
|
justify-content: center;
|
|
37
|
-
|
|
38
|
-
width:
|
|
39
|
-
|
|
30
|
+
gap: ${space.xxs};
|
|
31
|
+
max-width: 700px;
|
|
32
|
+
text-align: center;
|
|
40
33
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
height: auto;
|
|
44
|
-
max-width: 375px;
|
|
45
|
-
max-height: 245px;
|
|
34
|
+
h3 {
|
|
35
|
+
${typo.display.annotation}
|
|
46
36
|
}
|
|
47
37
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
img {
|
|
53
|
-
max-width: 400px;
|
|
54
|
-
max-height: 260px;
|
|
55
|
-
}
|
|
38
|
+
p {
|
|
39
|
+
${typo.body.section}
|
|
40
|
+
color: ${colors.textSecondary};
|
|
41
|
+
white-space: pre-line;
|
|
56
42
|
}
|
|
57
43
|
`;
|
|
58
|
-
export const StyledButtonWrapper = styled.div `
|
|
59
|
-
min-width: 180px;
|
|
60
|
-
`;
|
|
@@ -9,7 +9,7 @@ export type InputGroupProps = {
|
|
|
9
9
|
*/
|
|
10
10
|
status?: 'default' | 'error';
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Prompt a helptext below input group (useful when implemented with form validation)
|
|
13
13
|
*/
|
|
14
14
|
helptext?: string;
|
|
15
15
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputGroup.styles.d.ts","sourceRoot":"","sources":["../../../patterns/InputGroup/InputGroup.styles.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,OAAO;;
|
|
1
|
+
{"version":3,"file":"InputGroup.styles.d.ts","sourceRoot":"","sources":["../../../patterns/InputGroup/InputGroup.styles.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,OAAO;;EA0EZ,CAAC;AAEF,QAAA,MAAM,SAAS;;EAQd,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -49,8 +49,9 @@ const Wrapper = styled.div `
|
|
|
49
49
|
border-bottom-left-radius: 0;
|
|
50
50
|
border-top-right-radius: 10px;
|
|
51
51
|
border-bottom-right-radius: 10px;
|
|
52
|
+
height: auto;
|
|
52
53
|
|
|
53
|
-
> :first-child {
|
|
54
|
+
> :first-child:not(svg) {
|
|
54
55
|
border: 0;
|
|
55
56
|
border-left: 1px solid ${colors.borderThin};
|
|
56
57
|
border-top-left-radius: 0;
|
|
@@ -59,7 +60,7 @@ const Wrapper = styled.div `
|
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
> :not(:first-child):not(:last-child) {
|
|
62
|
-
> :first-child {
|
|
63
|
+
> :first-child:not(svg) {
|
|
63
64
|
border: 0;
|
|
64
65
|
border-left: 1px solid ${colors.borderThin};
|
|
65
66
|
border-radius: 0;
|
|
@@ -82,7 +82,7 @@ export interface MultiSearchDropdownProps {
|
|
|
82
82
|
*/
|
|
83
83
|
required?: boolean;
|
|
84
84
|
/**
|
|
85
|
-
*
|
|
85
|
+
* Prompt a helptext below input group (useful when implemented with form validation)
|
|
86
86
|
*/
|
|
87
87
|
helptext?: string;
|
|
88
88
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSearchDropdown.d.ts","sourceRoot":"","sources":["../../../patterns/MultiSearchDropdown/MultiSearchDropdown.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAc,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AA6BnD,MAAM,MAAM,yBAAyB,GAAG;IACtC,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,KAAK,CAAC,EAAE,yBAAyB,EAAE,CAAC;IACpC;;OAEG;IACH,OAAO,CAAC,EAAE,yBAAyB,EAAE,CAAC;IACtC;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,yBAAyB,EAAE,CAAC,EAAE,KAAK,CAAC,cAAc,KAAK,IAAI,CAAC;IAC/E;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC3D;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,yBAAyB,EAAE,CAAC,EAAE,KAAK,CAAC,cAAc,KAAK,IAAI,CAAC;IAC/E;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,YAAY,EAAE,yBAAyB,EAAE,CAAC,EAAE,KAAK,CAAC,cAAc,KAAK,IAAI,CAAC;IAC5F;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;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,KAAK,CAAC;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACzD;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC1D;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACzD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,
|
|
1
|
+
{"version":3,"file":"MultiSearchDropdown.d.ts","sourceRoot":"","sources":["../../../patterns/MultiSearchDropdown/MultiSearchDropdown.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,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KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACzD;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC1D;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACzD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CA8X3D,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -57,6 +57,10 @@ const MultiSearchDropdown = ({ id, label = '', value = [], options = [], onInput
|
|
|
57
57
|
setValues(value);
|
|
58
58
|
}
|
|
59
59
|
}, [value.length]);
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
setModifiedOptions(options);
|
|
62
|
+
setFilteredOptions(options);
|
|
63
|
+
}, [options]);
|
|
60
64
|
// the positioning stuff...
|
|
61
65
|
const { renderLayer, triggerProps: { ref: setTriggerRef }, // ref from useLayer is a function
|
|
62
66
|
layerProps, triggerBounds,
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type RangeInputProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Input group content
|
|
5
|
+
*/
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Input group status (useful when implemented with form validation)
|
|
9
|
+
*/
|
|
10
|
+
status?: 'default' | 'error';
|
|
11
|
+
/**
|
|
12
|
+
* Prompt a helptext below input group (useful when implemented with form validation)
|
|
13
|
+
*/
|
|
14
|
+
helptext?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Custom helptext
|
|
17
|
+
*/
|
|
18
|
+
helptextClassName?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Custom class name
|
|
21
|
+
*/
|
|
22
|
+
className?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Custom separator component
|
|
25
|
+
*/
|
|
26
|
+
separatorComponent?: React.ReactNode;
|
|
27
|
+
};
|
|
28
|
+
declare const RangeInput: React.FC<RangeInputProps>;
|
|
29
|
+
export default RangeInput;
|
|
30
|
+
//# sourceMappingURL=RangeInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RangeInput.d.ts","sourceRoot":"","sources":["../../../patterns/RangeInput/RangeInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC7B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACtC,CAAC;AAEF,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAkCzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { cx } from '../../utils';
|
|
3
|
+
import { Paragraph } from '../../components/Input/Input.styles';
|
|
4
|
+
import { containerClass, helptextClass, inputWrapperClass, separatorClass, } from './RangeInput.styles';
|
|
5
|
+
const RangeInput = ({ children, helptext = '', helptextClassName = '', className = '', status = 'default', separatorComponent, }) => {
|
|
6
|
+
const isWithError = status === 'error';
|
|
7
|
+
const containerCss = cx(containerClass, className);
|
|
8
|
+
const helptextCss = cx(helptextClass, helptextClassName, isWithError && 'error');
|
|
9
|
+
return (<div className={containerCss} data-clad="Range Input">
|
|
10
|
+
<div className={inputWrapperClass}>
|
|
11
|
+
{React.Children.map(children, (child, index) => {
|
|
12
|
+
var _a;
|
|
13
|
+
const key = (_a = child === null || child === void 0 ? void 0 : child.key) !== null && _a !== void 0 ? _a : index;
|
|
14
|
+
let renderSeparator = null;
|
|
15
|
+
if (index > 0) {
|
|
16
|
+
renderSeparator = separatorComponent || <p className={separatorClass}>-</p>;
|
|
17
|
+
}
|
|
18
|
+
return (<span key={key} className="separator-wrapper">
|
|
19
|
+
{renderSeparator}
|
|
20
|
+
{child}
|
|
21
|
+
</span>);
|
|
22
|
+
})}
|
|
23
|
+
</div>
|
|
24
|
+
{helptext ? <Paragraph className={helptextCss}>{helptext}</Paragraph> : null}
|
|
25
|
+
</div>);
|
|
26
|
+
};
|
|
27
|
+
export default RangeInput;
|