@chotot/clad-ui 3.0.0 → 3.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/CHANGELOG.md +21 -0
- package/README.md +9 -9
- package/dist/{chunk-Bmb41Sf3.cjs → _virtual/_rolldown/runtime.cjs} +1 -1
- package/dist/brand/ChototLogoText.cjs +1 -0
- package/dist/brand/ChototLogoText.es.js +15 -0
- package/dist/brand/CtC2C.cjs +1 -0
- package/dist/brand/CtC2C.es.js +18 -0
- package/dist/brand/CtProperty.cjs +1 -0
- package/dist/brand/CtProperty.es.js +204 -0
- package/dist/brand/CtVehicle.cjs +1 -0
- package/dist/brand/CtVehicle.es.js +70 -0
- package/dist/brand/Tot.cjs +1 -0
- package/dist/brand/Tot.es.js +17 -0
- package/dist/components/Announcer/Announcer.cjs +1 -0
- package/dist/components/Announcer/Announcer.es.js +100 -0
- package/dist/components/Announcer/announcer.styles.cjs +1 -0
- package/dist/components/Announcer/announcer.styles.es.js +24 -0
- package/dist/components/Badge/Badge.cjs +1 -0
- package/dist/components/Badge/Badge.es.js +83 -0
- package/dist/components/Badge/badge.styles.cjs +1 -0
- package/dist/components/Badge/badge.styles.es.js +83 -0
- package/dist/components/Box/Box.cjs +1 -0
- package/dist/components/Box/Box.es.js +72 -0
- package/dist/components/Breadcrumbs/BreadcrumbItem.cjs +1 -0
- package/dist/components/Breadcrumbs/BreadcrumbItem.es.js +17 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.cjs +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.es.js +44 -0
- package/dist/components/Breadcrumbs/breadcrumbs.styles.cjs +1 -0
- package/dist/components/Breadcrumbs/breadcrumbs.styles.es.js +5 -0
- package/dist/components/Button/Button.cjs +1 -0
- package/dist/components/Button/Button.es.js +41 -0
- package/dist/components/Button/ButtonLink.cjs +1 -0
- package/dist/components/Button/ButtonLink.es.js +5 -0
- package/dist/components/Button/GhostButton.cjs +1 -0
- package/dist/components/Button/GhostButton.es.js +25 -0
- package/dist/components/Button/IconButton.cjs +1 -0
- package/dist/components/Button/IconButton.es.js +13 -0
- package/dist/components/Button/button.styles.cjs +1 -0
- package/dist/components/Button/button.styles.es.js +100 -0
- package/dist/components/Checkbox/Checkbox.cjs +1 -0
- package/dist/components/Checkbox/Checkbox.es.js +43 -0
- package/dist/components/Checkbox/checkbox.styles.cjs +1 -0
- package/dist/components/Checkbox/checkbox.styles.es.js +15 -0
- package/dist/components/Chip/Chip.cjs +1 -0
- package/dist/components/Chip/Chip.es.js +35 -0
- package/dist/components/Chip/chip.styles.cjs +1 -0
- package/dist/components/Chip/chip.styles.es.js +33 -0
- package/dist/components/CurrencyInput/CurrencyInput.cjs +1 -0
- package/dist/components/CurrencyInput/CurrencyInput.es.js +142 -0
- package/dist/components/CurrencyInput/currency-input.styles.cjs +1 -0
- package/dist/components/CurrencyInput/currency-input.styles.es.js +13 -0
- package/dist/components/CurrencyInput/utils.cjs +1 -0
- package/dist/components/CurrencyInput/utils.es.js +30 -0
- package/dist/components/DatePicker/DatePicker.cjs +1 -0
- package/dist/components/DatePicker/DatePicker.es.js +354 -0
- package/dist/components/DatePicker/DateTimePicker.cjs +1 -0
- package/dist/components/DatePicker/DateTimePicker.es.js +416 -0
- package/dist/components/DatePicker/date-picker.styles.cjs +1 -0
- package/dist/components/DatePicker/date-picker.styles.es.js +8 -0
- package/dist/components/DatePicker/date-time-picker.styles.cjs +1 -0
- package/dist/components/DatePicker/date-time-picker.styles.es.js +8 -0
- package/dist/components/DatePicker/index.d.ts +2 -1
- package/dist/components/DatePicker/types.cjs +1 -0
- package/dist/components/DatePicker/types.es.js +6 -0
- package/dist/components/Drawer/Drawer.cjs +1 -0
- package/dist/components/Drawer/Drawer.es.js +407 -0
- package/dist/components/Dropdown/Dropdown.cjs +1 -0
- package/dist/components/Dropdown/Dropdown.es.js +145 -0
- package/dist/components/Dropdown/dropdown.styles.cjs +1 -0
- package/dist/components/Dropdown/dropdown.styles.es.js +12 -0
- package/dist/components/EmptyState/EmptyState.cjs +2 -0
- package/dist/components/EmptyState/EmptyState.es.js +114 -0
- package/dist/components/EmptyState/empty-state.styles.cjs +1 -0
- package/dist/components/EmptyState/empty-state.styles.es.js +5 -0
- package/dist/components/Grid/Col.cjs +1 -0
- package/dist/components/Grid/Col.es.js +37 -0
- package/dist/components/Grid/Grid.cjs +1 -0
- package/dist/components/Grid/Grid.es.js +66 -0
- package/dist/components/Input/Input.cjs +1 -0
- package/dist/components/Input/Input.es.js +122 -0
- package/dist/components/Input/input.styles.cjs +1 -0
- package/dist/components/Input/input.styles.es.js +14 -0
- package/dist/components/InputGroup/InputGroup.cjs +1 -0
- package/dist/components/InputGroup/InputGroup.es.js +16 -0
- package/dist/components/InputGroup/input-group.styles.cjs +1 -0
- package/dist/components/InputGroup/input-group.styles.es.js +12 -0
- package/dist/components/LegacyDialog/DialogMainIcon.cjs +1 -0
- package/dist/components/LegacyDialog/DialogMainIcon.es.js +52 -0
- package/dist/components/LegacyDialog/LegacyDialog.cjs +1 -0
- package/dist/components/LegacyDialog/LegacyDialog.es.js +54 -0
- package/dist/components/LegacyPopup/LegacyPopup.cjs +1 -0
- package/dist/components/LegacyPopup/LegacyPopup.es.js +72 -0
- package/dist/components/MultiSearchDropdown/MultiSearchDropdown.cjs +1 -0
- package/dist/components/MultiSearchDropdown/MultiSearchDropdown.es.js +215 -0
- package/dist/components/MultiSearchDropdown/multi-search-dropdown.styles.cjs +1 -0
- package/dist/components/MultiSearchDropdown/multi-search-dropdown.styles.es.js +12 -0
- package/dist/components/Pagination/PageItem.cjs +1 -0
- package/dist/components/Pagination/PageItem.es.js +20 -0
- package/dist/components/Pagination/Pagination.cjs +1 -0
- package/dist/components/Pagination/Pagination.es.js +84 -0
- package/dist/components/Pagination/pagination.styles.cjs +1 -0
- package/dist/components/Pagination/pagination.styles.es.js +15 -0
- package/dist/components/Pagination/types.d.ts +1 -1
- package/dist/components/Popover/Popover.cjs +1 -0
- package/dist/components/Popover/Popover.es.js +54 -0
- package/dist/components/Popover/popover.styles.cjs +1 -0
- package/dist/components/Popover/popover.styles.es.js +5 -0
- package/dist/components/Popup/Popup.cjs +1 -0
- package/dist/components/Popup/Popup.es.js +148 -0
- package/dist/components/RadioButton/RadioButton.cjs +1 -0
- package/dist/components/RadioButton/RadioButton.es.js +61 -0
- package/dist/components/RadioButton/radio-button.styles.cjs +1 -0
- package/dist/components/RadioButton/radio-button.styles.es.js +15 -0
- package/dist/components/RangeInput/RangeInput.cjs +1 -0
- package/dist/components/RangeInput/RangeInput.es.js +32 -0
- package/dist/components/RangeInput/range-input.styles.cjs +1 -0
- package/dist/components/RangeInput/range-input.styles.es.js +5 -0
- package/dist/components/RowItem/RowItem.cjs +1 -0
- package/dist/components/RowItem/RowItem.es.js +56 -0
- package/dist/components/RowItem/rowitem.styles.cjs +1 -0
- package/dist/components/RowItem/rowitem.styles.es.js +23 -0
- package/dist/components/SearchInput/SearchInput.cjs +1 -0
- package/dist/components/SearchInput/SearchInput.es.js +129 -0
- package/dist/components/SearchInput/search-input.styles.cjs +1 -0
- package/dist/components/SearchInput/search-input.styles.es.js +12 -0
- package/dist/components/Searchbar/Searchbar.cjs +1 -0
- package/dist/components/Searchbar/Searchbar.es.js +51 -0
- package/dist/components/Searchbar/searchbar.styles.cjs +1 -0
- package/dist/components/Searchbar/searchbar.styles.es.js +5 -0
- package/dist/components/ShapeIcon/ShapeIcon.cjs +1 -0
- package/dist/components/ShapeIcon/ShapeIcon.es.js +22 -0
- package/dist/components/ShapeIcon/shape-icon.styles.cjs +1 -0
- package/dist/components/ShapeIcon/shape-icon.styles.es.js +65 -0
- package/dist/components/Slider/Slider.cjs +1 -0
- package/dist/components/Slider/Slider.es.js +169 -0
- package/dist/components/Slider/slider.styles.cjs +1 -0
- package/dist/components/Slider/slider.styles.es.js +5 -0
- package/dist/components/Snack/Snack.cjs +1 -0
- package/dist/components/Snack/Snack.es.js +69 -0
- package/dist/components/Snack/snack.styles.cjs +1 -0
- package/dist/components/Snack/snack.styles.es.js +13 -0
- package/dist/components/Tabs/Tab.cjs +1 -0
- package/dist/components/Tabs/Tab.es.js +42 -0
- package/dist/components/Tabs/Tabs.cjs +1 -0
- package/dist/components/Tabs/Tabs.es.js +115 -0
- package/dist/components/Tabs/tabs.styles.cjs +1 -0
- package/dist/components/Tabs/tabs.styles.es.js +33 -0
- package/dist/components/TagCloud/TagCloud.cjs +1 -0
- package/dist/components/TagCloud/TagCloud.d.ts +1 -1
- package/dist/components/TagCloud/TagCloud.es.js +48 -0
- package/dist/components/TagCloud/tagcloud.styles.cjs +1 -0
- package/dist/components/TagCloud/tagcloud.styles.es.js +12 -0
- package/dist/components/TagCloud/types.d.ts +5 -0
- package/dist/components/TextArea/TextArea.cjs +1 -0
- package/dist/components/TextArea/TextArea.es.js +104 -0
- package/dist/components/TextArea/text-area.styles.cjs +1 -0
- package/dist/components/TextArea/text-area.styles.es.js +13 -0
- package/dist/components/TextLabel/TextLabel.cjs +1 -0
- package/dist/components/TextLabel/TextLabel.es.js +28 -0
- package/dist/components/TextLabel/textlabel.styles.cjs +1 -0
- package/dist/components/TextLabel/textlabel.styles.es.js +29 -0
- package/dist/components/ToggleSwitch/ToggleSwitch.cjs +1 -0
- package/dist/components/ToggleSwitch/ToggleSwitch.es.js +37 -0
- package/dist/components/ToggleSwitch/toggle-switch.styles.cjs +1 -0
- package/dist/components/ToggleSwitch/toggle-switch.styles.es.js +24 -0
- package/dist/components/Tooltip/Tooltip.cjs +1 -0
- package/dist/components/Tooltip/Tooltip.es.js +103 -0
- package/dist/components/Tooltip/tooltip.styles.cjs +1 -0
- package/dist/components/Tooltip/tooltip.styles.es.js +12 -0
- package/dist/forge/index.cjs +1 -0
- package/dist/icons.cjs +1 -1
- package/dist/index.cjs +1 -0
- package/dist/index.es.js +82 -0
- package/dist/styles.css +1 -1
- package/dist/types/index.cjs +1 -0
- package/dist/types/index.es.js +7 -0
- package/dist/typography/BodyAnnotation.cjs +1 -0
- package/dist/typography/BodyAnnotation.es.js +10 -0
- package/dist/typography/BodyCaption.cjs +1 -0
- package/dist/typography/BodyCaption.es.js +10 -0
- package/dist/typography/BodyPage.cjs +1 -0
- package/dist/typography/BodyPage.es.js +10 -0
- package/dist/typography/BodySection.cjs +1 -0
- package/dist/typography/BodySection.es.js +10 -0
- package/dist/typography/DisplayAnnotation.cjs +1 -0
- package/dist/typography/DisplayAnnotation.es.js +10 -0
- package/dist/typography/DisplayCaption.cjs +1 -0
- package/dist/typography/DisplayCaption.es.js +10 -0
- package/dist/typography/DisplayPage.cjs +1 -0
- package/dist/typography/DisplayPage.es.js +10 -0
- package/dist/typography/DisplayPrice.cjs +1 -0
- package/dist/typography/DisplayPrice.es.js +10 -0
- package/dist/typography/DisplaySection.cjs +1 -0
- package/dist/typography/DisplaySection.es.js +10 -0
- package/dist/typography/HeaderAnnotation.cjs +1 -0
- package/dist/typography/HeaderAnnotation.es.js +10 -0
- package/dist/typography/HeaderCaption.cjs +1 -0
- package/dist/typography/HeaderCaption.es.js +10 -0
- package/dist/typography/HeaderPage.cjs +1 -0
- package/dist/typography/HeaderPage.es.js +10 -0
- package/dist/typography/HeaderSection.cjs +1 -0
- package/dist/typography/HeaderSection.es.js +10 -0
- package/dist/typography/LabelAnnotation.cjs +1 -0
- package/dist/typography/LabelAnnotation.es.js +10 -0
- package/dist/typography/LabelCaption.cjs +1 -0
- package/dist/typography/LabelCaption.es.js +10 -0
- package/dist/typography/LabelPage.cjs +1 -0
- package/dist/typography/LabelPage.es.js +10 -0
- package/dist/typography/LabelSection.cjs +1 -0
- package/dist/typography/LabelSection.es.js +10 -0
- package/dist/typography/NoteCaption.cjs +1 -0
- package/dist/typography/NoteCaption.es.js +10 -0
- package/dist/typography/NotePage.cjs +1 -0
- package/dist/typography/NotePage.es.js +10 -0
- package/dist/typography/NoteSection.cjs +1 -0
- package/dist/typography/NoteSection.es.js +10 -0
- package/dist/typography/TaglineAnnotation.cjs +1 -0
- package/dist/typography/TaglineAnnotation.es.js +10 -0
- package/dist/typography/TaglineCaption.cjs +1 -0
- package/dist/typography/TaglineCaption.es.js +10 -0
- package/dist/typography/TaglineFootext.cjs +1 -0
- package/dist/typography/TaglineFootext.es.js +10 -0
- package/dist/typography/TaglineSection.cjs +1 -0
- package/dist/typography/TaglineSection.es.js +10 -0
- package/dist/utils/bundleCss.cjs +1 -1
- package/dist/utils/cleanHtml.cjs +1 -0
- package/dist/utils/cleanHtml.es.js +6 -0
- package/dist/utils/cn.cjs +1 -0
- package/dist/utils/cn.es.js +59 -0
- package/dist/utils/createUniversalPortal.cjs +1 -0
- package/dist/utils/createUniversalPortal.es.js +17 -0
- package/dist/utils/floating.cjs +1 -0
- package/dist/utils/floating.es.js +374 -0
- package/dist/utils/getBreakpointsValues.cjs +1 -0
- package/dist/utils/getBreakpointsValues.es.js +27 -0
- package/dist/utils/sizes.cjs +1 -0
- package/dist/utils/sizes.es.js +30 -0
- package/dist/utils/themeTokens.cjs +1 -0
- package/dist/utils/themeTokens.es.js +319 -0
- package/dist/utils/useBodyScrollLock.cjs +1 -0
- package/dist/utils/useBodyScrollLock.es.js +24 -0
- package/dist/utils/useScrollTop.cjs +1 -0
- package/dist/utils/useScrollTop.es.js +9 -0
- package/package.json +6 -6
- package/scripts/postinstall.cjs +34 -6
- package/skills/clad-ui/SKILL.md +17 -2
- package/skills/clad-ui/references/components-display-layout.md +1 -0
- package/skills/clad-ui-feedback/SKILL.md +1 -1
- package/skills/migrate-clad-ui-v3/SKILL.md +4 -2
- package/skills/migrate-clad-ui-v3/references/component-api-changes.md +42 -0
- package/skills/migrate-clad-ui-v3/references/token-and-linaria-mapping.md +4 -1
- package/src/styles/base/base.css +1 -0
- package/src/styles/components/button.css +25 -0
- package/src/styles/components/chip.css +35 -0
- package/src/styles/components/drawer.css +9 -0
- package/src/styles/preset.css +1 -1
- package/dist/clad-ui.cjs +0 -2
- package/dist/clad-ui.d.ts +0 -2
- package/dist/clad-ui.es.js +0 -9791
- package/dist/components/Drawer/Drawer.pw.fixtures.d.ts +0 -9
- package/dist/components/Grid/Grid.pw.fixtures.d.ts +0 -3
- package/dist/components/Popover/Popover.pw.fixtures.d.ts +0 -6
- package/dist/components/Popup/Popup.pw.fixtures.d.ts +0 -5
- package/dist/components/Tooltip/Tooltip.pw.fixtures.d.ts +0 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import e from "../../utils/cn.es.js";
|
|
2
|
+
import { forwardRef as t } from "../../types/index.es.js";
|
|
3
|
+
import n from "../Button/Button.es.js";
|
|
4
|
+
import { emptyStateVariants as r } from "./empty-state.styles.es.js";
|
|
5
|
+
import { createElement as i } from "react";
|
|
6
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/EmptyState/EmptyState.tsx
|
|
8
|
+
var s = "https://storage.googleapis.com/static-chotot-com/storage/empty_state/png", c = {
|
|
9
|
+
notFound: {
|
|
10
|
+
title: "Trang không tồn tại",
|
|
11
|
+
description: "Có khi nào bạn nhầm đường dẫn không?",
|
|
12
|
+
buttonLabel: "Trở về trang chủ",
|
|
13
|
+
img: `${s}/404.png`
|
|
14
|
+
},
|
|
15
|
+
maintenance: {
|
|
16
|
+
title: "Tạm nghỉ để bảo trì",
|
|
17
|
+
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!",
|
|
18
|
+
buttonLabel: "Trở về trang chủ",
|
|
19
|
+
img: `${s}/maintenance.png`
|
|
20
|
+
},
|
|
21
|
+
keywordNoResult: {
|
|
22
|
+
title: "Hic! Chưa tìm thấy kết quả nào",
|
|
23
|
+
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!",
|
|
24
|
+
buttonLabel: "Thay đổi từ khóa",
|
|
25
|
+
img: `${s}/keyword-no-result.png`
|
|
26
|
+
},
|
|
27
|
+
filterNoResult: {
|
|
28
|
+
title: "Không có kết quả cho bộ lọc đã chọn",
|
|
29
|
+
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.",
|
|
30
|
+
buttonLabel: "Thay đổi bộ lọc",
|
|
31
|
+
img: `${s}/filter-no-result.png`
|
|
32
|
+
},
|
|
33
|
+
noAvailable: {
|
|
34
|
+
title: "Tin đăng không còn tồn tại",
|
|
35
|
+
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!",
|
|
36
|
+
buttonLabel: "Trở về trang chủ",
|
|
37
|
+
img: `${s}/no-available.png`
|
|
38
|
+
},
|
|
39
|
+
grantAccess: {
|
|
40
|
+
title: "Xin quyền truy cập nha!",
|
|
41
|
+
description: /* @__PURE__ */ o("p", { children: [
|
|
42
|
+
"Cần quyền truy cập Ảnh để sử dụng tính năng đăng tin. Truy cập vào",
|
|
43
|
+
" ",
|
|
44
|
+
/* @__PURE__ */ a("strong", { children: "Cài đặt" }),
|
|
45
|
+
" ",
|
|
46
|
+
">",
|
|
47
|
+
" ",
|
|
48
|
+
/* @__PURE__ */ a("strong", { children: "Ứng dụng" }),
|
|
49
|
+
" ",
|
|
50
|
+
">",
|
|
51
|
+
" Chợ Tốt Bật ",
|
|
52
|
+
/* @__PURE__ */ a("strong", { children: "“Ảnh”" })
|
|
53
|
+
] }),
|
|
54
|
+
buttonLabel: "Cho phép",
|
|
55
|
+
img: `${s}/grant-access.png`
|
|
56
|
+
},
|
|
57
|
+
disconnection: {
|
|
58
|
+
title: "Tạm mất kết nối :(",
|
|
59
|
+
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!",
|
|
60
|
+
buttonLabel: "Thử lại trang",
|
|
61
|
+
img: `${s}/disconnection.png`
|
|
62
|
+
},
|
|
63
|
+
notFoundWhite: {
|
|
64
|
+
title: "Trang không tồn tại",
|
|
65
|
+
description: "Có khi nào bạn nhầm đường dẫn không?",
|
|
66
|
+
buttonLabel: "Trở về trang chủ",
|
|
67
|
+
img: `${s}/404-white.png`
|
|
68
|
+
},
|
|
69
|
+
working: {
|
|
70
|
+
title: "Tính năng đang được phát triển",
|
|
71
|
+
description: "Chút nữa ghé lại nha bạn ơi!",
|
|
72
|
+
buttonLabel: "Trở về trang chủ",
|
|
73
|
+
img: `${s}/working.png`
|
|
74
|
+
},
|
|
75
|
+
waitingCv: {
|
|
76
|
+
title: "Chưa có hồ sơ ứng tuyển",
|
|
77
|
+
description: "Hiện chưa có ứng viên nào nộp hồ sơ cho tin tuyển dụng này.",
|
|
78
|
+
buttonLabel: "Quản lý tin đăng",
|
|
79
|
+
img: `${s}/waiting-cv.png`
|
|
80
|
+
},
|
|
81
|
+
noReward: {
|
|
82
|
+
title: "Chưa có phần thưởng nào",
|
|
83
|
+
description: "Tham gia chương trình để nhận thêm nhiều ưu đãi hấp dẫn nha!",
|
|
84
|
+
buttonLabel: "Khám phá ngay",
|
|
85
|
+
img: `${s}/no-reward.png`
|
|
86
|
+
}
|
|
87
|
+
}, l = t((t, s) => {
|
|
88
|
+
let { type: l, title: u, coverImage: d, description: f, buttonLabel: p, onButtonClick: m, showTitle: h = !0, showDescription: g = !0, showButton: _ = !0, className: v, as: y = "div", ...b } = t, x = l === "other" ? void 0 : c[l], S = d ?? x?.img, C = u ?? x?.title, w = f ?? x?.description, T = p ?? x?.buttonLabel, E = typeof w == "string" ? /* @__PURE__ */ a("p", { children: w }) : w;
|
|
89
|
+
return i(y, {
|
|
90
|
+
ref: s,
|
|
91
|
+
className: e(r(), v),
|
|
92
|
+
"data-clad": "Empty State",
|
|
93
|
+
...b
|
|
94
|
+
}, /* @__PURE__ */ a("img", {
|
|
95
|
+
src: S,
|
|
96
|
+
alt: C,
|
|
97
|
+
width: 200,
|
|
98
|
+
height: 200
|
|
99
|
+
}), /* @__PURE__ */ o("div", {
|
|
100
|
+
className: "empty-state-content",
|
|
101
|
+
children: [/* @__PURE__ */ o("div", {
|
|
102
|
+
className: "empty-state-content-text",
|
|
103
|
+
children: [h && /* @__PURE__ */ a("h3", { children: C }), g && E]
|
|
104
|
+
}), _ && /* @__PURE__ */ a(n, {
|
|
105
|
+
size: "large",
|
|
106
|
+
color: "primary",
|
|
107
|
+
onClick: m,
|
|
108
|
+
children: T
|
|
109
|
+
})]
|
|
110
|
+
}));
|
|
111
|
+
});
|
|
112
|
+
l.displayName = "EmptyState";
|
|
113
|
+
//#endregion
|
|
114
|
+
export { l as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);var e=(0,require(`tailwind-variants/lite`).tv)({base:`empty-state`});exports.emptyStateVariants=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`../../utils/cn.cjs`),n=require(`../../utils/getBreakpointsValues.cjs`);let r=require(`react`);r=e.__toESM(r);let i=require(`react/jsx-runtime`);var a=e=>{let t=parseInt(e,10);return isNaN(t)?`initial`:(t<0&&(t=0),t>12&&(t=12),t===0?`0%`:1/(12/t)*100+`%`)},o=(e,t)=>n.default(e,t).map(e=>a(e)),s=({span:e=null,offset:n=null,align:r=`initial`,order:a=`initial`,className:s=``,style:c,children:l,...u})=>{let d=t.default(`clad-col`,s,!!e&&`withSpan`,!!n&&`withOffset`),f=r===`start`&&`flex-start`||r===`end`&&`flex-end`||r,p=a===`first`&&-1||a===`last`&&13||(typeof a==`number`?a:0),m=o(e,`initial`),h=o(n,`initial`),g={"--col-align":f,"--col-order":p,"--col-span-0":m[0],"--col-span-1":m[1],"--col-span-2":m[2],"--col-span-3":m[3],"--col-span-4":m[4],"--col-offset-0":h[0],"--col-offset-1":h[1],"--col-offset-2":h[2],"--col-offset-3":h[3],"--col-offset-4":h[4]};return(0,i.jsx)(`div`,{...u,className:d,style:{...g,...c},"data-clad":`Col`,children:l})};s.displayName=`Col`,exports.default=s,exports.getSpans=o,exports.getWidthByPctFromSpan=a;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import e from "../../utils/cn.es.js";
|
|
2
|
+
import t from "../../utils/getBreakpointsValues.es.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/Grid/Col.tsx
|
|
6
|
+
var r = (e) => {
|
|
7
|
+
let t = parseInt(e, 10);
|
|
8
|
+
return isNaN(t) ? "initial" : (t < 0 && (t = 0), t > 12 && (t = 12), t === 0 ? "0%" : 1 / (12 / t) * 100 + "%");
|
|
9
|
+
}, i = (e, n) => t(e, n).map((e) => r(e)), a = ({ span: t = null, offset: r = null, align: a = "initial", order: o = "initial", className: s = "", style: c, children: l, ...u }) => {
|
|
10
|
+
let d = e("clad-col", s, !!t && "withSpan", !!r && "withOffset"), f = a === "start" && "flex-start" || a === "end" && "flex-end" || a, p = o === "first" && -1 || o === "last" && 13 || (typeof o == "number" ? o : 0), m = i(t, "initial"), h = i(r, "initial"), g = {
|
|
11
|
+
"--col-align": f,
|
|
12
|
+
"--col-order": p,
|
|
13
|
+
"--col-span-0": m[0],
|
|
14
|
+
"--col-span-1": m[1],
|
|
15
|
+
"--col-span-2": m[2],
|
|
16
|
+
"--col-span-3": m[3],
|
|
17
|
+
"--col-span-4": m[4],
|
|
18
|
+
"--col-offset-0": h[0],
|
|
19
|
+
"--col-offset-1": h[1],
|
|
20
|
+
"--col-offset-2": h[2],
|
|
21
|
+
"--col-offset-3": h[3],
|
|
22
|
+
"--col-offset-4": h[4]
|
|
23
|
+
};
|
|
24
|
+
return /* @__PURE__ */ n("div", {
|
|
25
|
+
...u,
|
|
26
|
+
className: d,
|
|
27
|
+
style: {
|
|
28
|
+
...g,
|
|
29
|
+
...c
|
|
30
|
+
},
|
|
31
|
+
"data-clad": "Col",
|
|
32
|
+
children: l
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
a.displayName = "Col";
|
|
36
|
+
//#endregion
|
|
37
|
+
export { a as default, i as getSpans, r as getWidthByPctFromSpan };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`../../utils/cn.cjs`),n=require(`../../utils/getBreakpointsValues.cjs`),r=require(`../../utils/themeTokens.cjs`);let i=require(`react`);i=e.__toESM(i);let a=require(`react/jsx-runtime`);var o=e=>{let t=parseInt(e,10);return isNaN(t)?`initial`:(t<0&&(t=0),t>12&&(t=12),t===0?`0%`:1/t*100+`%`)},s=(e,t)=>n.default(e,t).map(e=>o(e)),c=e=>{let t=r.SPACE_MAP[e];return t?+t.slice(0,t.length-2):0},l=(e,t)=>n.default(e,t).map(e=>c(e)),u=e=>r.SIZES_TOKENS_MAP[e]??`initial`,d=(e,t)=>n.default(e,t).map(e=>u(e)),f=({width:e=null,align:n=`initial`,justify:r=`initial`,rowCols:i=null,gutter:o=null,gutterx:c=null,guttery:u=null,className:f=``,style:p,children:m,...h})=>{let g=t.default(`clad-grid`,f,!!i&&`withRowCols`),_=n===`start`&&`flex-start`||n===`end`&&`flex-end`||n,v=r===`start`&&`flex-start`||r===`end`&&`flex-end`||r===`between`&&`space-between`||r===`around`&&`space-around`||r,y=s(i,`initial`),b={"--grid-align":_,"--grid-justify":v,"--grid-col-w-0":y[0],"--grid-col-w-1":y[1],"--grid-col-w-2":y[2],"--grid-col-w-3":y[3],"--grid-col-w-4":y[4]},x=t.default(`clad-grid-container`,f,!!e&&`withWidth`,!!(o||c||u)&&`withGutter`),S=d(e,`initial`),C=c??o??`none`,w=u??o??`none`,T=l(C,0),E=l(w,0),D={"--grid-w-0":S[0],"--grid-w-1":S[1],"--grid-w-2":S[2],"--grid-w-3":S[3],"--grid-w-4":S[4],"--grid-gx-half-0":`${T[0]/2}px`,"--grid-gx-half-1":`${T[1]/2}px`,"--grid-gx-half-2":`${T[2]/2}px`,"--grid-gx-half-3":`${T[3]/2}px`,"--grid-gx-half-4":`${T[4]/2}px`,"--grid-gx-neg-0":`${T[0]*-1}px`,"--grid-gx-neg-1":`${T[1]*-1}px`,"--grid-gx-neg-2":`${T[2]*-1}px`,"--grid-gx-neg-3":`${T[3]*-1}px`,"--grid-gx-neg-4":`${T[4]*-1}px`,"--grid-gy-0":`${E[0]}px`,"--grid-gy-1":`${E[1]}px`,"--grid-gy-2":`${E[2]}px`,"--grid-gy-3":`${E[3]}px`,"--grid-gy-4":`${E[4]}px`,"--grid-gy-neg-0":`${E[0]*-1}px`,"--grid-gy-neg-1":`${E[1]*-1}px`,"--grid-gy-neg-2":`${E[2]*-1}px`,"--grid-gy-neg-3":`${E[3]*-1}px`,"--grid-gy-neg-4":`${E[4]*-1}px`};return(0,a.jsx)(`div`,{...h,className:x,style:{...D,...p},"data-clad":`Grid`,children:(0,a.jsx)(`div`,{className:g,style:b,children:m})})};f.displayName=`Grid`,exports.default=f,exports.getColWidths=s,exports.getContainerWidths=d,exports.getGutters=l,exports.getSizesValue=u,exports.getSpaceValue=c,exports.getWidthByPctFromRowCols=o;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import e from "../../utils/cn.es.js";
|
|
2
|
+
import t from "../../utils/getBreakpointsValues.es.js";
|
|
3
|
+
import { SIZES_TOKENS_MAP as n, SPACE_MAP as r } from "../../utils/themeTokens.es.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/Grid/Grid.tsx
|
|
7
|
+
var a = (e) => {
|
|
8
|
+
let t = parseInt(e, 10);
|
|
9
|
+
return isNaN(t) ? "initial" : (t < 0 && (t = 0), t > 12 && (t = 12), t === 0 ? "0%" : 1 / t * 100 + "%");
|
|
10
|
+
}, o = (e, n) => t(e, n).map((e) => a(e)), s = (e) => {
|
|
11
|
+
let t = r[e];
|
|
12
|
+
return t ? +t.slice(0, t.length - 2) : 0;
|
|
13
|
+
}, c = (e, n) => t(e, n).map((e) => s(e)), l = (e) => n[e] ?? "initial", u = (e, n) => t(e, n).map((e) => l(e)), d = ({ width: t = null, align: n = "initial", justify: r = "initial", rowCols: a = null, gutter: s = null, gutterx: l = null, guttery: d = null, className: f = "", style: p, children: m, ...h }) => {
|
|
14
|
+
let g = e("clad-grid", f, !!a && "withRowCols"), _ = n === "start" && "flex-start" || n === "end" && "flex-end" || n, v = r === "start" && "flex-start" || r === "end" && "flex-end" || r === "between" && "space-between" || r === "around" && "space-around" || r, y = o(a, "initial"), b = {
|
|
15
|
+
"--grid-align": _,
|
|
16
|
+
"--grid-justify": v,
|
|
17
|
+
"--grid-col-w-0": y[0],
|
|
18
|
+
"--grid-col-w-1": y[1],
|
|
19
|
+
"--grid-col-w-2": y[2],
|
|
20
|
+
"--grid-col-w-3": y[3],
|
|
21
|
+
"--grid-col-w-4": y[4]
|
|
22
|
+
}, x = e("clad-grid-container", f, !!t && "withWidth", !!(s || l || d) && "withGutter"), S = u(t, "initial"), C = l ?? s ?? "none", w = d ?? s ?? "none", T = c(C, 0), E = c(w, 0), D = {
|
|
23
|
+
"--grid-w-0": S[0],
|
|
24
|
+
"--grid-w-1": S[1],
|
|
25
|
+
"--grid-w-2": S[2],
|
|
26
|
+
"--grid-w-3": S[3],
|
|
27
|
+
"--grid-w-4": S[4],
|
|
28
|
+
"--grid-gx-half-0": `${T[0] / 2}px`,
|
|
29
|
+
"--grid-gx-half-1": `${T[1] / 2}px`,
|
|
30
|
+
"--grid-gx-half-2": `${T[2] / 2}px`,
|
|
31
|
+
"--grid-gx-half-3": `${T[3] / 2}px`,
|
|
32
|
+
"--grid-gx-half-4": `${T[4] / 2}px`,
|
|
33
|
+
"--grid-gx-neg-0": `${T[0] * -1}px`,
|
|
34
|
+
"--grid-gx-neg-1": `${T[1] * -1}px`,
|
|
35
|
+
"--grid-gx-neg-2": `${T[2] * -1}px`,
|
|
36
|
+
"--grid-gx-neg-3": `${T[3] * -1}px`,
|
|
37
|
+
"--grid-gx-neg-4": `${T[4] * -1}px`,
|
|
38
|
+
"--grid-gy-0": `${E[0]}px`,
|
|
39
|
+
"--grid-gy-1": `${E[1]}px`,
|
|
40
|
+
"--grid-gy-2": `${E[2]}px`,
|
|
41
|
+
"--grid-gy-3": `${E[3]}px`,
|
|
42
|
+
"--grid-gy-4": `${E[4]}px`,
|
|
43
|
+
"--grid-gy-neg-0": `${E[0] * -1}px`,
|
|
44
|
+
"--grid-gy-neg-1": `${E[1] * -1}px`,
|
|
45
|
+
"--grid-gy-neg-2": `${E[2] * -1}px`,
|
|
46
|
+
"--grid-gy-neg-3": `${E[3] * -1}px`,
|
|
47
|
+
"--grid-gy-neg-4": `${E[4] * -1}px`
|
|
48
|
+
};
|
|
49
|
+
return /* @__PURE__ */ i("div", {
|
|
50
|
+
...h,
|
|
51
|
+
className: x,
|
|
52
|
+
style: {
|
|
53
|
+
...D,
|
|
54
|
+
...p
|
|
55
|
+
},
|
|
56
|
+
"data-clad": "Grid",
|
|
57
|
+
children: /* @__PURE__ */ i("div", {
|
|
58
|
+
className: g,
|
|
59
|
+
style: b,
|
|
60
|
+
children: m
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
d.displayName = "Grid";
|
|
65
|
+
//#endregion
|
|
66
|
+
export { d as default, o as getColWidths, u as getContainerWidths, c as getGutters, l as getSizesValue, s as getSpaceValue, a as getWidthByPctFromRowCols };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils/cn.cjs`),t=require(`../../types/index.cjs`),n=require(`../../utils/sizes.cjs`),r=require(`../Tooltip/Tooltip.cjs`),i=require(`./input.styles.cjs`);let a=require(`react`),o=require(`@chotot/icons`),s=require(`react/jsx-runtime`);var c=t.forwardRef((t,c)=>{let{id:l,name:u,type:d=`text`,width:f=`full`,label:p,value:m=``,onChange:h,onBlur:g,onFocus:_,onKeyDown:v,onKeyUp:y,disabled:b=!1,required:x=!1,status:S=`default`,helptext:C,helptextClassName:w,allowClear:T=!0,showPassword:E=!1,tooltip:D,inputMode:O=`text`,characterLimit:k,onClear:A,showValidationIcon:j=!1,icon:M,placeholder:N,className:P,inputRef:F,...I}=t,L=(0,a.useRef)(null);(0,a.useImperativeHandle)(c,()=>L.current),(0,a.useImperativeHandle)(F,()=>L.current);let[R,z]=(0,a.useState)(!1),B=R?o.Unhide:o.Hide,V=()=>{L.current&&(L.current.type===`password`?(L.current.type=`text`,z(!0)):(L.current.type=`password`,z(!1)))},H=e=>{T&&L.current&&(L.current.value=``,h?.({target:L.current,currentTarget:L.current})),A?.(e)},U=``,W=!1,G=e=>{d===`number`&&(U=e.key.toLowerCase(),(e.metaKey||e.ctrlKey)&&U===`a`&&(W=!0)),v?.(e)},K=e=>{(e.target.value!==``||U===`backspace`||U===`delete`||W&&U===`-`||W&&U===`+`)&&(h?.(e),W=!1)},q=e=>{g?.(e),e.target.value===``&&L.current&&((Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`)?.set)?.call(L.current,``),L.current.dispatchEvent(new Event(`change`,{bubbles:!0})))},J=!E&&T&&!!m,Y=d===`password`&&E&&!!m,X=!!D&&(T?!m:!0),Z=J||X||j,Q=e.default(i.inputVariants({status:S}),b&&`input--disabled`,!!M&&`input--has-left-icon`,!p&&`input--no-label`,Z&&`input--has-right-icon`),$=e.default(`input-el`,!!m&&`has-value`,!!N&&`has-placeholder`,x&&`is-required`);return(0,s.jsxs)(`div`,{"data-clad":`Input`,className:e.default(`relative w-full`,P),style:f===`full`?void 0:{width:n.SIZES_MAP[f]||f},children:[(0,s.jsxs)(`div`,{className:Q,children:[M?(0,s.jsx)(`div`,{className:`input-icon-left`,children:M}):null,(0,s.jsx)(`input`,{ref:e=>{L.current=e},className:$,type:d,value:m,id:l,name:u,disabled:b,required:x,inputMode:O,maxLength:k||void 0,placeholder:N,"aria-invalid":S===`error`||void 0,"aria-required":x||void 0,onFocus:_,onKeyUp:y,onChange:d===`number`?K:h,onKeyDown:G,onBlur:d===`number`?q:g,...I}),!!p&&(0,s.jsx)(`label`,{htmlFor:l,children:p}),J&&!b?(0,s.jsx)(`button`,{tabIndex:-1,type:`button`,className:`input-clear-btn`,onClick:H,"aria-label":`Clear input`,children:(0,s.jsx)(o.CloseFilled,{width:`20px`,height:`30px`,"aria-hidden":!0})}):null,Y?(0,s.jsx)(`button`,{tabIndex:-1,type:`button`,className:`input-password-btn`,onClick:V,"aria-label":R?`Hide password`:`Show password`,children:(0,s.jsx)(B,{width:`20px`,height:`20px`,"aria-hidden":!0})}):null,X?(0,s.jsx)(`div`,{className:`input-tooltip`,children:(0,s.jsx)(r.default,{text:D,hoverable:!0,placement:`top-center`,children:(0,s.jsx)(o.Info,{width:`20px`,height:`20px`,"aria-hidden":!0})})}):null,j?(0,s.jsx)(`div`,{className:`input-icon-right`,children:S===`error`?(0,s.jsx)(o.WarningFilled,{color:`var(--color-icon-error)`,"aria-hidden":!0}):S===`success`?(0,s.jsx)(o.CircleCheckFilled,{color:`var(--color-icon-success)`,"aria-hidden":!0}):null}):null]}),C?(0,s.jsx)(`p`,{className:e.default(`input-helptext`,S===`error`&&`input-helptext--error`,S===`warning`&&`input-helptext--warning`,w),children:C}):null]})});c.displayName=`Input`,exports.default=c;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import e from "../../utils/cn.es.js";
|
|
3
|
+
import { forwardRef as t } from "../../types/index.es.js";
|
|
4
|
+
import { SIZES_MAP as n } from "../../utils/sizes.es.js";
|
|
5
|
+
import r from "../Tooltip/Tooltip.es.js";
|
|
6
|
+
import { inputVariants as ee } from "./input.styles.es.js";
|
|
7
|
+
import { useImperativeHandle as i, useRef as te, useState as a } from "react";
|
|
8
|
+
import { CircleCheckFilled as o, CloseFilled as s, Hide as c, Info as l, Unhide as u, WarningFilled as d } from "@chotot/icons";
|
|
9
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
10
|
+
//#region src/components/Input/Input.tsx
|
|
11
|
+
var m = t((t, m) => {
|
|
12
|
+
let { id: h, name: g, type: _ = "text", width: v = "full", label: y, value: b = "", onChange: x, onBlur: S, onFocus: C, onKeyDown: w, onKeyUp: T, disabled: E = !1, required: D = !1, status: O = "default", helptext: k, helptextClassName: A, allowClear: j = !0, showPassword: M = !1, tooltip: N, inputMode: P = "text", characterLimit: F, onClear: I, showValidationIcon: L = !1, icon: R, placeholder: z, className: B, inputRef: V, ...H } = t, U = te(null);
|
|
13
|
+
i(m, () => U.current), i(V, () => U.current);
|
|
14
|
+
let [W, G] = a(!1), K = W ? u : c, q = () => {
|
|
15
|
+
U.current && (U.current.type === "password" ? (U.current.type = "text", G(!0)) : (U.current.type = "password", G(!1)));
|
|
16
|
+
}, J = (e) => {
|
|
17
|
+
j && U.current && (U.current.value = "", x?.({
|
|
18
|
+
target: U.current,
|
|
19
|
+
currentTarget: U.current
|
|
20
|
+
})), I?.(e);
|
|
21
|
+
}, Y = "", X = !1, Z = (e) => {
|
|
22
|
+
_ === "number" && (Y = e.key.toLowerCase(), (e.metaKey || e.ctrlKey) && Y === "a" && (X = !0)), w?.(e);
|
|
23
|
+
}, ne = (e) => {
|
|
24
|
+
(e.target.value !== "" || Y === "backspace" || Y === "delete" || X && Y === "-" || X && Y === "+") && (x?.(e), X = !1);
|
|
25
|
+
}, re = (e) => {
|
|
26
|
+
S?.(e), e.target.value === "" && U.current && ((Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set)?.call(U.current, ""), U.current.dispatchEvent(new Event("change", { bubbles: !0 })));
|
|
27
|
+
}, Q = !M && j && !!b, ie = _ === "password" && M && !!b, $ = !!N && (j ? !b : !0), ae = Q || $ || L, oe = e(ee({ status: O }), E && "input--disabled", !!R && "input--has-left-icon", !y && "input--no-label", ae && "input--has-right-icon"), se = e("input-el", !!b && "has-value", !!z && "has-placeholder", D && "is-required");
|
|
28
|
+
return /* @__PURE__ */ p("div", {
|
|
29
|
+
"data-clad": "Input",
|
|
30
|
+
className: e("relative w-full", B),
|
|
31
|
+
style: v === "full" ? void 0 : { width: n[v] || v },
|
|
32
|
+
children: [/* @__PURE__ */ p("div", {
|
|
33
|
+
className: oe,
|
|
34
|
+
children: [
|
|
35
|
+
R ? /* @__PURE__ */ f("div", {
|
|
36
|
+
className: "input-icon-left",
|
|
37
|
+
children: R
|
|
38
|
+
}) : null,
|
|
39
|
+
/* @__PURE__ */ f("input", {
|
|
40
|
+
ref: (e) => {
|
|
41
|
+
U.current = e;
|
|
42
|
+
},
|
|
43
|
+
className: se,
|
|
44
|
+
type: _,
|
|
45
|
+
value: b,
|
|
46
|
+
id: h,
|
|
47
|
+
name: g,
|
|
48
|
+
disabled: E,
|
|
49
|
+
required: D,
|
|
50
|
+
inputMode: P,
|
|
51
|
+
maxLength: F || void 0,
|
|
52
|
+
placeholder: z,
|
|
53
|
+
"aria-invalid": O === "error" || void 0,
|
|
54
|
+
"aria-required": D || void 0,
|
|
55
|
+
onFocus: C,
|
|
56
|
+
onKeyUp: T,
|
|
57
|
+
onChange: _ === "number" ? ne : x,
|
|
58
|
+
onKeyDown: Z,
|
|
59
|
+
onBlur: _ === "number" ? re : S,
|
|
60
|
+
...H
|
|
61
|
+
}),
|
|
62
|
+
!!y && /* @__PURE__ */ f("label", {
|
|
63
|
+
htmlFor: h,
|
|
64
|
+
children: y
|
|
65
|
+
}),
|
|
66
|
+
Q && !E ? /* @__PURE__ */ f("button", {
|
|
67
|
+
tabIndex: -1,
|
|
68
|
+
type: "button",
|
|
69
|
+
className: "input-clear-btn",
|
|
70
|
+
onClick: J,
|
|
71
|
+
"aria-label": "Clear input",
|
|
72
|
+
children: /* @__PURE__ */ f(s, {
|
|
73
|
+
width: "20px",
|
|
74
|
+
height: "30px",
|
|
75
|
+
"aria-hidden": !0
|
|
76
|
+
})
|
|
77
|
+
}) : null,
|
|
78
|
+
ie ? /* @__PURE__ */ f("button", {
|
|
79
|
+
tabIndex: -1,
|
|
80
|
+
type: "button",
|
|
81
|
+
className: "input-password-btn",
|
|
82
|
+
onClick: q,
|
|
83
|
+
"aria-label": W ? "Hide password" : "Show password",
|
|
84
|
+
children: /* @__PURE__ */ f(K, {
|
|
85
|
+
width: "20px",
|
|
86
|
+
height: "20px",
|
|
87
|
+
"aria-hidden": !0
|
|
88
|
+
})
|
|
89
|
+
}) : null,
|
|
90
|
+
$ ? /* @__PURE__ */ f("div", {
|
|
91
|
+
className: "input-tooltip",
|
|
92
|
+
children: /* @__PURE__ */ f(r, {
|
|
93
|
+
text: N,
|
|
94
|
+
hoverable: !0,
|
|
95
|
+
placement: "top-center",
|
|
96
|
+
children: /* @__PURE__ */ f(l, {
|
|
97
|
+
width: "20px",
|
|
98
|
+
height: "20px",
|
|
99
|
+
"aria-hidden": !0
|
|
100
|
+
})
|
|
101
|
+
})
|
|
102
|
+
}) : null,
|
|
103
|
+
L ? /* @__PURE__ */ f("div", {
|
|
104
|
+
className: "input-icon-right",
|
|
105
|
+
children: O === "error" ? /* @__PURE__ */ f(d, {
|
|
106
|
+
color: "var(--color-icon-error)",
|
|
107
|
+
"aria-hidden": !0
|
|
108
|
+
}) : O === "success" ? /* @__PURE__ */ f(o, {
|
|
109
|
+
color: "var(--color-icon-success)",
|
|
110
|
+
"aria-hidden": !0
|
|
111
|
+
}) : null
|
|
112
|
+
}) : null
|
|
113
|
+
]
|
|
114
|
+
}), k ? /* @__PURE__ */ f("p", {
|
|
115
|
+
className: e("input-helptext", O === "error" && "input-helptext--error", O === "warning" && "input-helptext--warning", A),
|
|
116
|
+
children: k
|
|
117
|
+
}) : null]
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
m.displayName = "Input";
|
|
121
|
+
//#endregion
|
|
122
|
+
export { m as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);var e=(0,require(`tailwind-variants/lite`).tv)({base:`input`,defaultVariants:{status:`default`},variants:{status:{default:``,warning:`input--warning`,error:`input--error`,success:``}}});exports.inputVariants=e;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { tv as e } from "tailwind-variants/lite";
|
|
2
|
+
//#region src/components/Input/input.styles.ts
|
|
3
|
+
var t = e({
|
|
4
|
+
base: "input",
|
|
5
|
+
defaultVariants: { status: "default" },
|
|
6
|
+
variants: { status: {
|
|
7
|
+
default: "",
|
|
8
|
+
warning: "input--warning",
|
|
9
|
+
error: "input--error",
|
|
10
|
+
success: ""
|
|
11
|
+
} }
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
export { t as inputVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../utils/cn.cjs`),t=require(`./input-group.styles.cjs`);let n=require(`react/jsx-runtime`);var r=({children:r,status:i=`default`,helptext:a=``,helptextClassName:o=``,className:s=``,...c})=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`div`,{...c,className:e.default(t.inputGroupVariants({status:i}),s),"data-clad":`Input Field - Input Group`,children:r}),a?(0,n.jsx)(`p`,{className:e.default(`input-group-helptext`,o),children:a}):null]});r.displayName=`InputGroup`,exports.default=r;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import e from "../../utils/cn.es.js";
|
|
2
|
+
import { inputGroupVariants as t } from "./input-group.styles.es.js";
|
|
3
|
+
import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/InputGroup/InputGroup.tsx
|
|
5
|
+
var a = ({ children: a, status: o = "default", helptext: s = "", helptextClassName: c = "", className: l = "", ...u }) => /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r("div", {
|
|
6
|
+
...u,
|
|
7
|
+
className: e(t({ status: o }), l),
|
|
8
|
+
"data-clad": "Input Field - Input Group",
|
|
9
|
+
children: a
|
|
10
|
+
}), s ? /* @__PURE__ */ r("p", {
|
|
11
|
+
className: e("input-group-helptext", c),
|
|
12
|
+
children: s
|
|
13
|
+
}) : null] });
|
|
14
|
+
a.displayName = "InputGroup";
|
|
15
|
+
//#endregion
|
|
16
|
+
export { a as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);var e=(0,require(`tailwind-variants/lite`).tv)({base:`input-group`,variants:{status:{default:``,error:`error`}},defaultVariants:{status:`default`}});exports.inputGroupVariants=e;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { tv as e } from "tailwind-variants/lite";
|
|
2
|
+
//#region src/components/InputGroup/input-group.styles.ts
|
|
3
|
+
var t = e({
|
|
4
|
+
base: "input-group",
|
|
5
|
+
variants: { status: {
|
|
6
|
+
default: "",
|
|
7
|
+
error: "error"
|
|
8
|
+
} },
|
|
9
|
+
defaultVariants: { status: "default" }
|
|
10
|
+
});
|
|
11
|
+
//#endregion
|
|
12
|
+
export { t as inputGroupVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../../_virtual/_rolldown/runtime.cjs`);let t=require(`react`);t=e.__toESM(t);let n=require(`react/jsx-runtime`);var r=()=>(0,n.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,xmlnsXlink:`http://www.w3.org/1999/xlink`,width:`1em`,height:`1em`,viewBox:`0 0 80 80`,children:[(0,n.jsx)(`defs`,{children:(0,n.jsx)(`path`,{id:`a`,d:`M0 0h80v80H0z`})}),(0,n.jsxs)(`g`,{fill:`none`,fillRule:`evenodd`,children:[(0,n.jsx)(`mask`,{id:`b`,fill:`var(--color-background-primary)`,children:(0,n.jsx)(`use`,{xlinkHref:`#a`})}),(0,n.jsx)(`path`,{fill:`#F79A1B`,d:`M14.216 12.709L41 1l26.441 9.937A7.033 7.033 0 0172 17.521v30.23C66.2 59.057 55.868 68.807 41 77c-15.343-9.119-25.676-18.868-31-29.25V19.153a7.033 7.033 0 014.216-6.444z`,mask:`url(#b)`}),(0,n.jsx)(`path`,{fill:`var(--color-background-brand)`,d:`M15.026 14.566L39 5.714l23.974 8.852a7.033 7.033 0 014.597 6.598v26.748C62.551 58.108 53.027 66.9 39 74.286c-14.438-8.222-23.962-17.013-28.571-26.374V21.164a7.033 7.033 0 014.597-6.598z`,mask:`url(#b)`}),(0,n.jsx)(`path`,{fill:`var(--color-background-primary)`,d:`M34.41 55.971L19.17 41.138 25.1 35.35l8.446 8.111 16.703-16.718 6.895 6.044z`,mask:`url(#b)`}),(0,n.jsx)(`path`,{fill:`var(--color-text-primary)`,d:`M36.045 54.286L22.857 41.635l4.396-4.215 8.351 8.013L52.312 28.57l4.83 4.216z`,mask:`url(#b)`}),(0,n.jsx)(`path`,{stroke:`var(--color-text-primary)`,strokeWidth:`2.286`,d:`M39 1.22l28.025 10.452a5.883 5.883 0 013.832 5.519h0v31.774C65.185 60.44 54.553 70.332 39.02 78.691 23.023 69.406 12.372 59.518 7.143 48.965h0V17.191a5.883 5.883 0 013.832-5.519h0L39 1.22z`,mask:`url(#b)`})]})]});exports.default=r;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/LegacyDialog/DialogMainIcon.tsx
|
|
4
|
+
var n = () => /* @__PURE__ */ t("svg", {
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
7
|
+
width: "1em",
|
|
8
|
+
height: "1em",
|
|
9
|
+
viewBox: "0 0 80 80",
|
|
10
|
+
children: [/* @__PURE__ */ e("defs", { children: /* @__PURE__ */ e("path", {
|
|
11
|
+
id: "a",
|
|
12
|
+
d: "M0 0h80v80H0z"
|
|
13
|
+
}) }), /* @__PURE__ */ t("g", {
|
|
14
|
+
fill: "none",
|
|
15
|
+
fillRule: "evenodd",
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ e("mask", {
|
|
18
|
+
id: "b",
|
|
19
|
+
fill: "var(--color-background-primary)",
|
|
20
|
+
children: /* @__PURE__ */ e("use", { xlinkHref: "#a" })
|
|
21
|
+
}),
|
|
22
|
+
/* @__PURE__ */ e("path", {
|
|
23
|
+
fill: "#F79A1B",
|
|
24
|
+
d: "M14.216 12.709L41 1l26.441 9.937A7.033 7.033 0 0172 17.521v30.23C66.2 59.057 55.868 68.807 41 77c-15.343-9.119-25.676-18.868-31-29.25V19.153a7.033 7.033 0 014.216-6.444z",
|
|
25
|
+
mask: "url(#b)"
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ e("path", {
|
|
28
|
+
fill: "var(--color-background-brand)",
|
|
29
|
+
d: "M15.026 14.566L39 5.714l23.974 8.852a7.033 7.033 0 014.597 6.598v26.748C62.551 58.108 53.027 66.9 39 74.286c-14.438-8.222-23.962-17.013-28.571-26.374V21.164a7.033 7.033 0 014.597-6.598z",
|
|
30
|
+
mask: "url(#b)"
|
|
31
|
+
}),
|
|
32
|
+
/* @__PURE__ */ e("path", {
|
|
33
|
+
fill: "var(--color-background-primary)",
|
|
34
|
+
d: "M34.41 55.971L19.17 41.138 25.1 35.35l8.446 8.111 16.703-16.718 6.895 6.044z",
|
|
35
|
+
mask: "url(#b)"
|
|
36
|
+
}),
|
|
37
|
+
/* @__PURE__ */ e("path", {
|
|
38
|
+
fill: "var(--color-text-primary)",
|
|
39
|
+
d: "M36.045 54.286L22.857 41.635l4.396-4.215 8.351 8.013L52.312 28.57l4.83 4.216z",
|
|
40
|
+
mask: "url(#b)"
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ e("path", {
|
|
43
|
+
stroke: "var(--color-text-primary)",
|
|
44
|
+
strokeWidth: "2.286",
|
|
45
|
+
d: "M39 1.22l28.025 10.452a5.883 5.883 0 013.832 5.519h0v31.774C65.185 60.44 54.553 70.332 39.02 78.691 23.023 69.406 12.372 59.518 7.143 48.965h0V17.191a5.883 5.883 0 013.832-5.519h0L39 1.22z",
|
|
46
|
+
mask: "url(#b)"
|
|
47
|
+
})
|
|
48
|
+
]
|
|
49
|
+
})]
|
|
50
|
+
});
|
|
51
|
+
//#endregion
|
|
52
|
+
export { n as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`../../utils/cn.cjs`),n=require(`../Button/Button.cjs`),r=require(`../../utils/createUniversalPortal.cjs`),i=require(`./DialogMainIcon.cjs`);let a=require(`react`);a=e.__toESM(a);let o=require(`@chotot/icons`),s=require(`react/jsx-runtime`);var c=()=>{},l=({className:e=``,title:l=``,children:u,btnLabel:d=``,mainIcon:f=(0,s.jsx)(i.default,{}),desktopSize:p=`lg`,open:m=!1,onClose:h=c,closeIcon:g=(0,s.jsx)(o.Close,{}),onButtonClick:_=c,...v})=>{let y=a.useRef(null);a.useEffect(()=>{m?document.body.style.overflow=`hidden`:document.body.style.overflow=`unset`},[m]);let b=t.default(`legacy-dialog-close`,(typeof g==`string`||typeof g==`number`)&&`is-text`),x=t.default(`legacy-dialog-children`,(typeof u==`string`||typeof u==`number`)&&`is-single-string`,typeof d==`string`&&!d.trim()&&`no-button`);return(0,s.jsx)(s.Fragment,{children:!!m&&r.default((0,s.jsxs)(`div`,{ref:y,className:`legacy-dialog-modal`,children:[(0,s.jsx)(`div`,{className:`legacy-popup-backdrop`,onClick:h}),(0,s.jsxs)(`div`,{...v,className:t.default(`legacy-dialog`,e,p),"data-clad":`Legacy Dialog`,children:[(0,s.jsx)(`div`,{className:`main-icon`,children:f}),(0,s.jsx)(`button`,{type:`button`,className:b,onClick:h,children:g}),(0,s.jsx)(`h5`,{children:l}),(0,s.jsx)(`div`,{className:x,children:u}),(0,s.jsx)(n.default,{color:`primary`,className:`legacy-popup-btn`,onClick:_,children:d})]})]}))})};l.displayName=`LegacyDialog`,exports.default=l;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import e from "../../utils/cn.es.js";
|
|
3
|
+
import t from "../Button/Button.es.js";
|
|
4
|
+
import n from "../../utils/createUniversalPortal.es.js";
|
|
5
|
+
import r from "./DialogMainIcon.es.js";
|
|
6
|
+
import * as i from "react";
|
|
7
|
+
import { Close as a } from "@chotot/icons";
|
|
8
|
+
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/LegacyDialog/LegacyDialog.tsx
|
|
10
|
+
var l = () => {}, u = ({ className: u = "", title: d = "", children: f, btnLabel: p = "", mainIcon: m = /* @__PURE__ */ s(r, {}), desktopSize: h = "lg", open: g = !1, onClose: _ = l, closeIcon: v = /* @__PURE__ */ s(a, {}), onButtonClick: y = l, ...b }) => {
|
|
11
|
+
let x = i.useRef(null);
|
|
12
|
+
i.useEffect(() => {
|
|
13
|
+
g ? document.body.style.overflow = "hidden" : document.body.style.overflow = "unset";
|
|
14
|
+
}, [g]);
|
|
15
|
+
let S = e("legacy-dialog-close", (typeof v == "string" || typeof v == "number") && "is-text"), C = e("legacy-dialog-children", (typeof f == "string" || typeof f == "number") && "is-single-string", typeof p == "string" && !p.trim() && "no-button");
|
|
16
|
+
return /* @__PURE__ */ s(o, { children: !!g && n(/* @__PURE__ */ c("div", {
|
|
17
|
+
ref: x,
|
|
18
|
+
className: "legacy-dialog-modal",
|
|
19
|
+
children: [/* @__PURE__ */ s("div", {
|
|
20
|
+
className: "legacy-popup-backdrop",
|
|
21
|
+
onClick: _
|
|
22
|
+
}), /* @__PURE__ */ c("div", {
|
|
23
|
+
...b,
|
|
24
|
+
className: e("legacy-dialog", u, h),
|
|
25
|
+
"data-clad": "Legacy Dialog",
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ s("div", {
|
|
28
|
+
className: "main-icon",
|
|
29
|
+
children: m
|
|
30
|
+
}),
|
|
31
|
+
/* @__PURE__ */ s("button", {
|
|
32
|
+
type: "button",
|
|
33
|
+
className: S,
|
|
34
|
+
onClick: _,
|
|
35
|
+
children: v
|
|
36
|
+
}),
|
|
37
|
+
/* @__PURE__ */ s("h5", { children: d }),
|
|
38
|
+
/* @__PURE__ */ s("div", {
|
|
39
|
+
className: C,
|
|
40
|
+
children: f
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ s(t, {
|
|
43
|
+
color: "primary",
|
|
44
|
+
className: "legacy-popup-btn",
|
|
45
|
+
onClick: y,
|
|
46
|
+
children: p
|
|
47
|
+
})
|
|
48
|
+
]
|
|
49
|
+
})]
|
|
50
|
+
})) });
|
|
51
|
+
};
|
|
52
|
+
u.displayName = "LegacyDialog";
|
|
53
|
+
//#endregion
|
|
54
|
+
export { u as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`../../utils/cn.cjs`),n=require(`../../utils/getBreakpointsValues.cjs`),r=require(`../../utils/themeTokens.cjs`),i=require(`../Button/Button.cjs`),a=require(`../../utils/createUniversalPortal.cjs`);let o=require(`react`);o=e.__toESM(o);let s=require(`@chotot/icons`),c=require(`react/jsx-runtime`);var l=()=>{},u=(e,t)=>n.default(e,t).map(e=>r.SPACE_MAP[e]||r.SPACE_MAP.none),d=({className:e=``,title:n=``,children:r,btnLabel:d=``,desktopSize:f=`lg`,mobileSize:p=`half`,open:m=!1,onClose:h=l,closeIcon:g=(0,c.jsx)(s.Close,{}),rightIcon:_=null,onRightIconClick:v=l,onButtonClick:y=l,padding:b=[`sm`,`sm`,`lg`],childrenOverflowVisible:x=!1,...S})=>{let C=o.useRef(null);o.useEffect(()=>{m?document.body.style.overflow=`hidden`:document.body.style.overflow=`unset`},[m]);let w=t.default((typeof g==`string`||typeof g==`number`)&&`is-text`),T=t.default(_==null&&`hidden`,(typeof _==`string`||typeof _==`number`)&&`is-text`),E=t.default(`legacy-popup-children`,p,(typeof r==`string`||typeof r==`number`)&&`is-single-string`,typeof d==`string`&&!d.trim()&&`no-button`,x&&`children-overflow-visible`),D=u(b,`none`),O={"--legacy-popup-p-0":D[0],"--legacy-popup-p-1":D[1],"--legacy-popup-p-2":D[2],"--legacy-popup-p-3":D[3],"--legacy-popup-p-4":D[4]};return(0,c.jsx)(c.Fragment,{children:!!m&&a.default((0,c.jsxs)(`div`,{ref:C,className:`legacy-popup-modal`,children:[(0,c.jsx)(`div`,{className:`legacy-popup-backdrop`,onClick:h}),(0,c.jsxs)(`div`,{...S,className:t.default(`legacy-popup`,f,e),children:[(0,c.jsxs)(`div`,{className:`legacy-popup-header`,"data-clad":`LegacyPopup`,children:[(0,c.jsx)(`button`,{type:`button`,className:w,onClick:h,children:g}),(0,c.jsx)(`h5`,{children:n}),(0,c.jsx)(`button`,{type:`button`,className:T,onClick:v,children:_})]}),(0,c.jsxs)(`div`,{className:`legacy-popup-content`,style:O,children:[(0,c.jsx)(`div`,{className:E,children:r}),(0,c.jsx)(i.default,{color:`primary`,className:`legacy-popup-btn`,onClick:y,children:d})]})]})]}))})};d.displayName=`LegacyPopup`,exports.default=d;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import e from "../../utils/cn.es.js";
|
|
3
|
+
import t from "../../utils/getBreakpointsValues.es.js";
|
|
4
|
+
import { SPACE_MAP as n } from "../../utils/themeTokens.es.js";
|
|
5
|
+
import r from "../Button/Button.es.js";
|
|
6
|
+
import i from "../../utils/createUniversalPortal.es.js";
|
|
7
|
+
import * as a from "react";
|
|
8
|
+
import { Close as o } from "@chotot/icons";
|
|
9
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
10
|
+
//#region src/components/LegacyPopup/LegacyPopup.tsx
|
|
11
|
+
var u = () => {}, d = (e, r) => t(e, r).map((e) => n[e] || n.none), f = ({ className: t = "", title: n = "", children: f, btnLabel: p = "", desktopSize: m = "lg", mobileSize: h = "half", open: g = !1, onClose: _ = u, closeIcon: v = /* @__PURE__ */ c(o, {}), rightIcon: y = null, onRightIconClick: b = u, onButtonClick: x = u, padding: S = [
|
|
12
|
+
"sm",
|
|
13
|
+
"sm",
|
|
14
|
+
"lg"
|
|
15
|
+
], childrenOverflowVisible: C = !1, ...w }) => {
|
|
16
|
+
let T = a.useRef(null);
|
|
17
|
+
a.useEffect(() => {
|
|
18
|
+
g ? document.body.style.overflow = "hidden" : document.body.style.overflow = "unset";
|
|
19
|
+
}, [g]);
|
|
20
|
+
let E = e((typeof v == "string" || typeof v == "number") && "is-text"), D = e(y == null && "hidden", (typeof y == "string" || typeof y == "number") && "is-text"), O = e("legacy-popup-children", h, (typeof f == "string" || typeof f == "number") && "is-single-string", typeof p == "string" && !p.trim() && "no-button", C && "children-overflow-visible"), k = d(S, "none"), A = {
|
|
21
|
+
"--legacy-popup-p-0": k[0],
|
|
22
|
+
"--legacy-popup-p-1": k[1],
|
|
23
|
+
"--legacy-popup-p-2": k[2],
|
|
24
|
+
"--legacy-popup-p-3": k[3],
|
|
25
|
+
"--legacy-popup-p-4": k[4]
|
|
26
|
+
};
|
|
27
|
+
return /* @__PURE__ */ c(s, { children: !!g && i(/* @__PURE__ */ l("div", {
|
|
28
|
+
ref: T,
|
|
29
|
+
className: "legacy-popup-modal",
|
|
30
|
+
children: [/* @__PURE__ */ c("div", {
|
|
31
|
+
className: "legacy-popup-backdrop",
|
|
32
|
+
onClick: _
|
|
33
|
+
}), /* @__PURE__ */ l("div", {
|
|
34
|
+
...w,
|
|
35
|
+
className: e("legacy-popup", m, t),
|
|
36
|
+
children: [/* @__PURE__ */ l("div", {
|
|
37
|
+
className: "legacy-popup-header",
|
|
38
|
+
"data-clad": "LegacyPopup",
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ c("button", {
|
|
41
|
+
type: "button",
|
|
42
|
+
className: E,
|
|
43
|
+
onClick: _,
|
|
44
|
+
children: v
|
|
45
|
+
}),
|
|
46
|
+
/* @__PURE__ */ c("h5", { children: n }),
|
|
47
|
+
/* @__PURE__ */ c("button", {
|
|
48
|
+
type: "button",
|
|
49
|
+
className: D,
|
|
50
|
+
onClick: b,
|
|
51
|
+
children: y
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
}), /* @__PURE__ */ l("div", {
|
|
55
|
+
className: "legacy-popup-content",
|
|
56
|
+
style: A,
|
|
57
|
+
children: [/* @__PURE__ */ c("div", {
|
|
58
|
+
className: O,
|
|
59
|
+
children: f
|
|
60
|
+
}), /* @__PURE__ */ c(r, {
|
|
61
|
+
color: "primary",
|
|
62
|
+
className: "legacy-popup-btn",
|
|
63
|
+
onClick: x,
|
|
64
|
+
children: p
|
|
65
|
+
})]
|
|
66
|
+
})]
|
|
67
|
+
})]
|
|
68
|
+
})) });
|
|
69
|
+
};
|
|
70
|
+
f.displayName = "LegacyPopup";
|
|
71
|
+
//#endregion
|
|
72
|
+
export { f as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";const e=require(`../../_virtual/_rolldown/runtime.cjs`),t=require(`../../utils/cn.cjs`),n=require(`../../utils/sizes.cjs`),r=require(`../Chip/Chip.cjs`),i=require(`../../utils/floating.cjs`),a=require(`../ShapeIcon/ShapeIcon.cjs`),ee=require(`./multi-search-dropdown.styles.cjs`);let o=require(`react`);o=e.__toESM(o);let s=require(`@chotot/icons`),c=require(`react/jsx-runtime`);var{useState:l,useRef:u,useEffect:d}=o,f=()=>{},p=[];function m(e){return e.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/đ/g,`d`).replace(/Đ/g,`D`)}function h(e,t){if(!Array.isArray(e))return p;if(!Array.isArray(t)||t.length===0)return e;let n=new Set(t.map(e=>e?.text));return e.filter(e=>!n.has(e?.text))}function g(e,t){if(!t)return e;let n=m(t).toLowerCase();return e.filter(e=>e?.text?m(e.text).toLowerCase().includes(n):!1)}function _(e,t){if(e===t)return!0;if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]?.text!==t[n]?.text||e[n]?.html!==t[n]?.html)return!1;return!0}function te(e){let{key:t,keyCode:n}=e;return n>=37&&n<=40&&t.indexOf(`Arrow`)!==0?`Arrow${t}`:t}var v=({id:e,label:m=``,value:v=p,options:y=p,onInput:b=f,onChange:x=f,onSelect:ne=f,onBlur:re=f,onRemoveOption:ie=f,inputRef:S,onClearData:C=f,menuMaxHeight:w=`$sm`,emptyString:T=`Không có lựa chọn khả dụng`,width:E=`full`,disabled:D=!1,required:O=!1,helptext:k=``,helptextClassName:A=``,status:j=`default`,className:M=``,...ae})=>{let N=u(null),[P,F]=l(!1),[I,oe]=l(v),[L,R]=l(!1),[z,B]=l(-1),[V,H]=l(()=>h(y,v)),[U,W]=l(()=>h(y,v)),[G,K]=l(``),q=u(G);q.current=G;let J=P,se=u(null),Y=typeof S==`object`&&S?S:se;o.useImperativeHandle(S,()=>Y?.current),d(()=>{let e=h(y,v),t=g(e,q.current);H(t=>_(t,e)?t:e),W(e=>_(e,t)?e:t),oe(e=>_(e,v)?e:v)},[y,v]);let{renderLayer:ce,triggerProps:{ref:le},layerProps:X,triggerBounds:ue}=i.useLayer({isOpen:J,auto:!0,snap:!0,placement:`bottom-start`,possiblePlacements:[`top-start`,`bottom-start`],triggerOffset:1,onOutsideClick:()=>{F(!1),K(``),R(!1),W(V)}});le(N.current);let de=e=>(P||(F(!0),R(!0),B(-1),Y?.current?.focus()),e),fe=e=>(K(``),R(!1),W(V),e.stopPropagation(),re(e)),Z=(e,t)=>{let n=U[e];return B(-1),n?(K(``),ne?.(n,t),Y?.current?.focus(),x?.(n,t)):t},pe=e=>{e.preventDefault()},Q=(e,t)=>{if(e){t.stopPropagation();let n=[...V],r=y.filter(t=>t?.text===e?.text);return r[0]&&n.push(r[0]),W(g(n,G)),H(n),ie(e,t),Y?.current?.focus(),x?.(e,t)}return t},me=e=>{let t=te(e),n=z;switch(t){case`Enter`:return z>-1?Z(z,e):e;case`Backspace`:return G.length<=0?Q(I[I.length-1],e):e;case`ArrowUp`:--n,n<0&&(n=V.length-1),e.preventDefault();break;case`ArrowDown`:n+=1,n>=V.length&&(n=0),e.preventDefault();break;default:if(/^[a-z0-9]$/i.test(e.key)){let t=e.key,n=setTimeout(()=>{K(``)},1e3);clearTimeout(n);let r=G+t,i=RegExp(`^${r}`,`i`),a=y.findIndex(e=>i.test(e?.text));return a===-1?{typed:r}:{tempFocusedValue:a,typed:r}}break}e.persist(),B(n)},he=e=>{let t=e.currentTarget;return Z(Number(t.getAttribute(`data-index`)),e)},ge=e=>{let t=e.target.value;K(t),b?.(e),W(g(V,t))},_e=e=>{K(``),B(-1),H(y),W(y),C(e),e.stopPropagation()},$=e=>{e.preventDefault();let t=e.target.closest(`[data-index]`)?.getAttribute(`data-index`);t!=null&&B(+t)},ve=()=>{let e=[...I].map(e=>(0,c.jsx)(r.default,{value:{text:e?.text,data:e?.data},onClose:D?f:Q,size:`sm`,className:t.default(D&&`msd-chip-disabled`),children:e?.text},e?.text));return(0,c.jsxs)(`span`,{className:`msd-chips-wrapper`,children:[I.length>0&&e,(0,c.jsx)(`input`,{className:`msd-search-input`,autoComplete:`off`,value:G,onChange:ge,ref:Y})]})},ye=()=>{F(!P)},be=j===`error`,xe=n.SIZES_MAP[E]||E;return(0,c.jsxs)(`div`,{className:t.default(`msd-outer`,M),style:{width:xe},"data-clad":`Multi Select Dropdown`,children:[(0,c.jsxs)(`div`,{id:e,className:t.default(ee.multiSearchDropdownVariants({status:j}),L?`focus`:``,D&&`disabled`,O&&`required`),role:`tab`,tabIndex:0,onClick:D?void 0:de,onKeyUp:D?void 0:pe,onKeyDown:D?void 0:me,ref:N,...ae,children:[(0,c.jsx)(`p`,{className:t.default(`msd-label`,(L||v.length>0)&&`focus`,be&&`error`),children:m}),ve(),!!J&&ce((0,c.jsx)(`ul`,{role:`listbox`,className:`msd-menu`,...X,style:{width:ue?.width,maxHeight:n.SIZES_MAP[w]||w,...X.style},children:U.length>0?U.map((e,n)=>(0,c.jsx)(`li`,{role:`menuitem`,"aria-label":e?.text,onMouseOver:$,onFocus:$,"data-index":n,className:t.default(`msd-option`,n===z&&`highlight`),onClick:he,dangerouslySetInnerHTML:{__html:e?.html}},e?.text)):(0,c.jsx)(`li`,{role:`menuitem`,"aria-label":`no-result`,"data-index":0,className:`msd-option`,dangerouslySetInnerHTML:{__html:T}},`no-result`)})),(0,c.jsxs)(`span`,{className:`msd-action-group`,children:[!D&&!!C&&I.length>0&&(0,c.jsx)(`span`,{className:`msd-clear-icon`,onClick:_e,role:`tab`,tabIndex:0,children:(0,c.jsx)(s.Close,{})}),(0,c.jsx)(`span`,{className:t.default(J?`inverted`:``,`msd-dropdown-icon`),onClick:ye,role:`tab`,tabIndex:0,children:(0,c.jsx)(a.default,{bg:`none`,color:`primary`,radius:`circle`,size:`md`,children:(0,c.jsx)(s.ChevronDownFilled,{className:`arrow`})})})]}),(0,c.jsx)(`input`,{value:v.length?v.length:``,required:O,onBlur:fe,readOnly:!0,hidden:!0})]}),k?(0,c.jsx)(`p`,{className:t.default(`msd-helptext`,A),children:k}):null]})};v.displayName=`MultiSearchDropdown`,exports.default=v;
|