@jordan-mace/chaser-design-system 1.2.9 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-manifest.json +12797 -0
- package/dist/chunk-23CHBI4O.mjs +92 -0
- package/dist/chunk-265HFPSB.mjs +75 -0
- package/dist/chunk-2B6QHVPB.mjs +0 -0
- package/dist/chunk-2D54Z56T.mjs +119 -0
- package/dist/chunk-2GXDW577.mjs +8 -0
- package/dist/chunk-3LJMSR5N.mjs +0 -0
- package/dist/chunk-44TZLEZ7.mjs +44 -0
- package/dist/chunk-4FZIKPNK.mjs +0 -0
- package/dist/chunk-4H42TV7W.mjs +137 -0
- package/dist/chunk-54H4HXDY.mjs +0 -0
- package/dist/chunk-5GW3EWPT.mjs +8 -0
- package/dist/chunk-5IIKGFRC.mjs +69 -0
- package/dist/chunk-5LIOEN4L.mjs +214 -0
- package/dist/chunk-5MWWVBIZ.mjs +20 -0
- package/dist/chunk-7AY5WUX4.mjs +0 -0
- package/dist/chunk-7NAAMXLS.mjs +18 -0
- package/dist/chunk-7UZS7ZPM.mjs +31 -0
- package/dist/chunk-AIBPYS7I.mjs +55 -0
- package/dist/chunk-AIY7XRLG.mjs +0 -0
- package/dist/chunk-ARTXRQO6.mjs +0 -0
- package/dist/chunk-BTENJUDF.mjs +0 -0
- package/dist/chunk-BUO6V4ZK.mjs +0 -0
- package/dist/chunk-CBKQEKIK.mjs +0 -0
- package/dist/chunk-CHNB6YGZ.mjs +35 -0
- package/dist/chunk-CICFJYOG.mjs +20 -0
- package/dist/chunk-CMNJMZXX.mjs +0 -0
- package/dist/chunk-CW4EIBFG.mjs +0 -0
- package/dist/chunk-DAGHRIC3.mjs +0 -0
- package/dist/chunk-DGWDQRZU.mjs +42 -0
- package/dist/chunk-E74W45DC.mjs +0 -0
- package/dist/chunk-E7OMF6QW.mjs +0 -0
- package/dist/chunk-E7VYLVBQ.mjs +84 -0
- package/dist/chunk-EOGH5LUH.mjs +8 -0
- package/dist/chunk-EOH5NK67.mjs +0 -0
- package/dist/chunk-EOXTRIQ7.mjs +0 -0
- package/dist/chunk-EPFXGPPF.mjs +62 -0
- package/dist/chunk-ERWDS6PF.mjs +32 -0
- package/dist/chunk-FCW25RIV.mjs +117 -0
- package/dist/chunk-FSIRD5AM.mjs +57 -0
- package/dist/chunk-FUN4ITNZ.mjs +0 -0
- package/dist/chunk-G2SNFO2A.mjs +41 -0
- package/dist/chunk-GP2LGGIN.mjs +207 -0
- package/dist/chunk-GP5UECUC.mjs +0 -0
- package/dist/chunk-HGOZPEWG.mjs +39 -0
- package/dist/chunk-HJCAHUC5.mjs +45 -0
- package/dist/chunk-HPP5HXXH.mjs +51 -0
- package/dist/chunk-HUED26BN.mjs +0 -0
- package/dist/chunk-HY4GCFFE.mjs +41 -0
- package/dist/chunk-IGKJYJTY.mjs +0 -0
- package/dist/chunk-IMHQ73HA.mjs +0 -0
- package/dist/chunk-J7OJPUGH.mjs +26 -0
- package/dist/chunk-JFYMSGSU.mjs +0 -0
- package/dist/chunk-JG27KRP3.mjs +41 -0
- package/dist/chunk-JIKAPQBJ.mjs +0 -0
- package/dist/chunk-JJMLW4EM.mjs +32 -0
- package/dist/chunk-KEHMUWQ5.mjs +19 -0
- package/dist/chunk-KT7CGXAH.mjs +0 -0
- package/dist/chunk-LV54XRPR.mjs +0 -0
- package/dist/chunk-LVVXUOBP.mjs +49 -0
- package/dist/chunk-LZLK7IOL.mjs +0 -0
- package/dist/chunk-MI63MVYQ.mjs +53 -0
- package/dist/chunk-MWP3WUVH.mjs +0 -0
- package/dist/chunk-N725HZEB.mjs +0 -0
- package/dist/chunk-NIZNDR6T.mjs +0 -0
- package/dist/chunk-NXJKX4QQ.mjs +126 -0
- package/dist/chunk-O3AMXQTY.mjs +0 -0
- package/dist/chunk-OGXD2YVI.mjs +96 -0
- package/dist/chunk-OTC2PREM.mjs +64 -0
- package/dist/chunk-P7WZRYQP.mjs +34 -0
- package/dist/chunk-PK7I6RMV.mjs +0 -0
- package/dist/chunk-PQZZHZIA.mjs +0 -0
- package/dist/chunk-PTU7HTXL.mjs +0 -0
- package/dist/chunk-QNJKEBIF.mjs +0 -0
- package/dist/chunk-R2GRRFQS.mjs +0 -0
- package/dist/chunk-RESHDXF5.mjs +0 -0
- package/dist/chunk-RG5W2FNQ.mjs +42 -0
- package/dist/chunk-RWSFDIB7.mjs +0 -0
- package/dist/chunk-S4M6HQWR.mjs +76 -0
- package/dist/chunk-SGEVTBAH.mjs +80 -0
- package/dist/chunk-SIGP4IGV.mjs +0 -0
- package/dist/chunk-SZ25BX44.mjs +0 -0
- package/dist/chunk-T4CX5DQW.mjs +0 -0
- package/dist/chunk-TNDJWHSF.mjs +0 -0
- package/dist/chunk-UAOAQXIP.mjs +18 -0
- package/dist/chunk-UVITSUYL.mjs +21 -0
- package/dist/chunk-V35FRMOQ.mjs +0 -0
- package/dist/chunk-VGHEJ76E.mjs +0 -0
- package/dist/chunk-VMZLIR3R.mjs +122 -0
- package/dist/chunk-VVJYGPZF.mjs +85 -0
- package/dist/chunk-W2PKPRKR.mjs +51 -0
- package/dist/chunk-WO4QVNEQ.mjs +15 -0
- package/dist/chunk-WPMNFQUN.mjs +0 -0
- package/dist/chunk-WQO4PWCK.mjs +0 -0
- package/dist/chunk-WUO4DJIA.mjs +30 -0
- package/dist/chunk-WX76GCR5.mjs +0 -0
- package/dist/chunk-WXCMK5GH.mjs +141 -0
- package/dist/chunk-X4TLQAME.mjs +118 -0
- package/dist/chunk-X5ENABHC.mjs +6 -0
- package/dist/chunk-XN3QS4PQ.mjs +262 -0
- package/dist/chunk-YHWKSBUV.mjs +93 -0
- package/dist/chunk-YPTRIIDI.mjs +101 -0
- package/dist/chunk-Z3N6BHKG.mjs +43 -0
- package/dist/chunk-ZSRWE6QR.mjs +0 -0
- package/dist/components/Accordion/Accordion.css +2065 -0
- package/dist/components/Accordion/Accordion.mjs +10 -0
- package/dist/components/Accordion/index.css +2065 -0
- package/dist/components/Accordion/index.mjs +11 -0
- package/dist/components/Alert/Alert.css +2054 -0
- package/dist/components/Alert/Alert.mjs +10 -0
- package/dist/components/Alert/index.css +2054 -0
- package/dist/components/Alert/index.mjs +11 -0
- package/dist/components/AspectRatio/AspectRatio.css +1950 -0
- package/dist/components/AspectRatio/AspectRatio.mjs +9 -0
- package/dist/components/AspectRatio/index.css +1950 -0
- package/dist/components/AspectRatio/index.mjs +10 -0
- package/dist/components/Avatar/Avatar.css +2149 -0
- package/dist/components/Avatar/Avatar.mjs +10 -0
- package/dist/components/Avatar/index.css +2149 -0
- package/dist/components/Avatar/index.mjs +11 -0
- package/dist/components/Badge/Badge.css +2076 -0
- package/dist/components/Badge/Badge.mjs +10 -0
- package/dist/components/Badge/index.css +2076 -0
- package/dist/components/Badge/index.mjs +11 -0
- package/dist/components/Box/Box.css +1950 -0
- package/dist/components/Box/Box.mjs +7 -0
- package/dist/components/Box/index.css +1950 -0
- package/dist/components/Box/index.mjs +8 -0
- package/dist/components/Breadcrumb/Breadcrumb.css +2052 -0
- package/dist/components/Breadcrumb/Breadcrumb.mjs +10 -0
- package/dist/components/Breadcrumb/index.css +2052 -0
- package/dist/components/Breadcrumb/index.mjs +11 -0
- package/dist/components/Button/Button.css +2030 -0
- package/dist/components/Button/Button.mjs +10 -0
- package/dist/components/Button/index.css +2030 -0
- package/dist/components/Button/index.mjs +11 -0
- package/dist/components/Card/Card.css +2025 -0
- package/dist/components/Card/Card.mjs +10 -0
- package/dist/components/Card/index.css +2025 -0
- package/dist/components/Card/index.mjs +11 -0
- package/dist/components/Checkbox/Checkbox.css +2033 -0
- package/dist/components/Checkbox/Checkbox.mjs +10 -0
- package/dist/components/Checkbox/index.css +2033 -0
- package/dist/components/Checkbox/index.mjs +11 -0
- package/dist/components/Collapse/Collapse.css +1987 -0
- package/dist/components/Collapse/Collapse.mjs +9 -0
- package/dist/components/Collapse/index.css +1987 -0
- package/dist/components/Collapse/index.mjs +10 -0
- package/dist/components/Combobox/Combobox.css +2139 -0
- package/dist/components/Combobox/Combobox.mjs +10 -0
- package/dist/components/Combobox/index.css +2139 -0
- package/dist/components/Combobox/index.mjs +11 -0
- package/dist/components/Container/Container.css +1950 -0
- package/dist/components/Container/Container.mjs +9 -0
- package/dist/components/Container/index.css +1950 -0
- package/dist/components/Container/index.mjs +10 -0
- package/dist/components/Divider/Divider.css +2037 -0
- package/dist/components/Divider/Divider.mjs +10 -0
- package/dist/components/Divider/index.css +2037 -0
- package/dist/components/Divider/index.mjs +11 -0
- package/dist/components/Drawer/Drawer.css +2143 -0
- package/dist/components/Drawer/Drawer.mjs +10 -0
- package/dist/components/Drawer/index.css +2143 -0
- package/dist/components/Drawer/index.mjs +11 -0
- package/dist/components/DropdownMenu/DropdownMenu.css +2090 -0
- package/dist/components/DropdownMenu/DropdownMenu.mjs +10 -0
- package/dist/components/DropdownMenu/index.css +2090 -0
- package/dist/components/DropdownMenu/index.mjs +11 -0
- package/dist/components/EmptyState/EmptyState.css +2033 -0
- package/dist/components/EmptyState/EmptyState.mjs +10 -0
- package/dist/components/EmptyState/index.css +2033 -0
- package/dist/components/EmptyState/index.mjs +11 -0
- package/dist/components/FileUpload/FileUpload.css +2142 -0
- package/dist/components/FileUpload/FileUpload.mjs +10 -0
- package/dist/components/FileUpload/index.css +2142 -0
- package/dist/components/FileUpload/index.mjs +11 -0
- package/dist/components/Form/Form.css +1965 -0
- package/dist/components/Form/Form.mjs +9 -0
- package/dist/components/Form/FormInput.css +4893 -0
- package/dist/components/Form/FormInput.mjs +108 -0
- package/dist/components/Form/index.css +4893 -0
- package/dist/components/Form/index.mjs +111 -0
- package/dist/components/Grid/Grid.css +1950 -0
- package/dist/components/Grid/Grid.mjs +9 -0
- package/dist/components/Grid/index.css +1950 -0
- package/dist/components/Grid/index.mjs +10 -0
- package/dist/components/Icon/Icon.css +1963 -0
- package/dist/components/Icon/Icon.mjs +9 -0
- package/dist/components/Icon/index.css +1963 -0
- package/dist/components/Icon/index.mjs +10 -0
- package/dist/components/Input/Input.css +2025 -0
- package/dist/components/Input/Input.mjs +11 -0
- package/dist/components/Input/index.css +2025 -0
- package/dist/components/Input/index.mjs +12 -0
- package/dist/components/Kbd/Kbd.css +2005 -0
- package/dist/components/Kbd/Kbd.mjs +8 -0
- package/dist/components/Kbd/index.css +2005 -0
- package/dist/components/Kbd/index.mjs +9 -0
- package/dist/components/List/List.css +2011 -0
- package/dist/components/List/List.mjs +11 -0
- package/dist/components/List/ListItem.css +2011 -0
- package/dist/components/List/ListItem.mjs +11 -0
- package/dist/components/List/index.css +2011 -0
- package/dist/components/List/index.mjs +16 -0
- package/dist/components/Modal/Modal.css +2088 -0
- package/dist/components/Modal/Modal.mjs +10 -0
- package/dist/components/Modal/index.css +2088 -0
- package/dist/components/Modal/index.mjs +11 -0
- package/dist/components/Navbar/Navbar.css +1955 -0
- package/dist/components/Navbar/Navbar.mjs +10 -0
- package/dist/components/Navbar/NavbarItem.css +1955 -0
- package/dist/components/Navbar/NavbarItem.mjs +10 -0
- package/dist/components/Navbar/index.css +1955 -0
- package/dist/components/Navbar/index.mjs +15 -0
- package/dist/components/NumberInput/NumberInput.css +2112 -0
- package/dist/components/NumberInput/NumberInput.mjs +10 -0
- package/dist/components/NumberInput/index.css +2112 -0
- package/dist/components/NumberInput/index.mjs +11 -0
- package/dist/components/Pagination/Pagination.css +2044 -0
- package/dist/components/Pagination/Pagination.mjs +10 -0
- package/dist/components/Pagination/index.css +2044 -0
- package/dist/components/Pagination/index.mjs +11 -0
- package/dist/components/Popover/Popover.css +2189 -0
- package/dist/components/Popover/Popover.mjs +10 -0
- package/dist/components/Popover/index.css +2189 -0
- package/dist/components/Popover/index.mjs +11 -0
- package/dist/components/Progress/Progress.css +2069 -0
- package/dist/components/Progress/Progress.mjs +10 -0
- package/dist/components/Progress/index.css +2069 -0
- package/dist/components/Progress/index.mjs +11 -0
- package/dist/components/Radio/Radio.css +2044 -0
- package/dist/components/Radio/Radio.mjs +10 -0
- package/dist/components/Radio/index.css +2044 -0
- package/dist/components/Radio/index.mjs +11 -0
- package/dist/components/ScrollArea/ScrollArea.css +2025 -0
- package/dist/components/ScrollArea/ScrollArea.mjs +10 -0
- package/dist/components/ScrollArea/index.css +2025 -0
- package/dist/components/ScrollArea/index.mjs +11 -0
- package/dist/components/Select/Select.css +2082 -0
- package/dist/components/Select/Select.mjs +10 -0
- package/dist/components/Select/index.css +2082 -0
- package/dist/components/Select/index.mjs +11 -0
- package/dist/components/Separator/Separator.css +2023 -0
- package/dist/components/Separator/Separator.mjs +10 -0
- package/dist/components/Separator/index.css +2023 -0
- package/dist/components/Separator/index.mjs +11 -0
- package/dist/components/Skeleton/Skeleton.css +2060 -0
- package/dist/components/Skeleton/Skeleton.mjs +10 -0
- package/dist/components/Skeleton/index.css +2060 -0
- package/dist/components/Skeleton/index.mjs +11 -0
- package/dist/components/Spinner/Spinner.css +2055 -0
- package/dist/components/Spinner/Spinner.mjs +10 -0
- package/dist/components/Spinner/index.css +2055 -0
- package/dist/components/Spinner/index.mjs +11 -0
- package/dist/components/Stack/Stack.css +1950 -0
- package/dist/components/Stack/Stack.mjs +9 -0
- package/dist/components/Stack/index.css +1950 -0
- package/dist/components/Stack/index.mjs +10 -0
- package/dist/components/Stepper/Stepper.css +2104 -0
- package/dist/components/Stepper/Stepper.mjs +10 -0
- package/dist/components/Stepper/index.css +2104 -0
- package/dist/components/Stepper/index.mjs +11 -0
- package/dist/components/Table/Table.css +2049 -0
- package/dist/components/Table/Table.mjs +10 -0
- package/dist/components/Table/index.css +2049 -0
- package/dist/components/Table/index.mjs +11 -0
- package/dist/components/Tabs/Tabs.css +2100 -0
- package/dist/components/Tabs/Tabs.mjs +10 -0
- package/dist/components/Tabs/index.css +2100 -0
- package/dist/components/Tabs/index.mjs +11 -0
- package/dist/components/Tag/Tag.css +2093 -0
- package/dist/components/Tag/Tag.mjs +10 -0
- package/dist/components/Tag/index.css +2093 -0
- package/dist/components/Tag/index.mjs +11 -0
- package/dist/components/Text/Header.css +2013 -0
- package/dist/components/Text/Header.mjs +11 -0
- package/dist/components/Text/P.css +2013 -0
- package/dist/components/Text/P.mjs +11 -0
- package/dist/components/Text/index.css +2013 -0
- package/dist/components/Text/index.mjs +16 -0
- package/dist/components/TextArea/TextArea.css +2027 -0
- package/dist/components/TextArea/TextArea.mjs +11 -0
- package/dist/components/TextArea/index.css +2027 -0
- package/dist/components/TextArea/index.mjs +12 -0
- package/dist/components/Toast/Toast.css +2229 -0
- package/dist/components/Toast/Toast.mjs +16 -0
- package/dist/components/Toast/index.css +2229 -0
- package/dist/components/Toast/index.mjs +17 -0
- package/dist/components/Toggle/Toggle.css +2106 -0
- package/dist/components/Toggle/Toggle.mjs +10 -0
- package/dist/components/Toggle/index.css +2106 -0
- package/dist/components/Toggle/index.mjs +11 -0
- package/dist/components/Tooltip/Tooltip.css +2084 -0
- package/dist/components/Tooltip/Tooltip.mjs +10 -0
- package/dist/components/Tooltip/index.css +2084 -0
- package/dist/components/Tooltip/index.mjs +11 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.css +15 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.mjs +6 -0
- package/dist/components/VisuallyHidden/index.css +15 -0
- package/dist/components/VisuallyHidden/index.mjs +7 -0
- package/dist/components/index.css +4893 -0
- package/dist/components/index.mjs +262 -0
- package/dist/index.core.mjs +262 -0
- package/dist/index.css +4893 -0
- package/dist/index.mjs +2 -4729
- package/dist/styles/layers.css +0 -0
- package/dist/styles/reset.css +126 -0
- package/dist/styles/reset.css.js +0 -0
- package/dist/styles/sprinkles.css +1938 -0
- package/dist/styles/sprinkles.css.js +220 -0
- package/dist/styles/theme.css +1986 -0
- package/dist/styles/theme.css.js +5 -0
- package/dist/styles/utils.mjs +14 -0
- package/package.json +14 -25
- package/dist/index.d.mts +0 -1834
- package/dist/styles/layers.css.d.mts +0 -6
- package/dist/styles/layers.css.mjs +0 -7
- package/dist/styles/reset.css.d.mts +0 -1
- package/dist/styles/reset.css.mjs +0 -24
- package/dist/styles/sprinkles.css.d.mts +0 -246
- package/dist/styles/sprinkles.css.mjs +0 -200
- package/dist/styles/theme.css.d.mts +0 -41
- package/dist/styles/theme.css.mjs +0 -50
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Box_default
|
|
3
|
+
} from "./chunk-23CHBI4O.mjs";
|
|
4
|
+
|
|
5
|
+
// src/components/Pagination/Pagination.tsx
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
import React from "react";
|
|
8
|
+
|
|
9
|
+
// src/components/Pagination/styles.css.ts
|
|
10
|
+
var ellipsis = "styles__10tz47n4";
|
|
11
|
+
var pageButton = "styles__10tz47n1";
|
|
12
|
+
var pageButtonVariants = { "default": "styles_pageButtonVariants_default__10tz47n2", active: "styles_pageButtonVariants_active__10tz47n3" };
|
|
13
|
+
var paginationContainer = "styles__10tz47n0";
|
|
14
|
+
|
|
15
|
+
// src/components/Pagination/Pagination.tsx
|
|
16
|
+
var Pagination = ({
|
|
17
|
+
currentPage,
|
|
18
|
+
totalPages,
|
|
19
|
+
onPageChange,
|
|
20
|
+
siblingCount = 1,
|
|
21
|
+
showFirstLast = true,
|
|
22
|
+
showPrevNext = true,
|
|
23
|
+
...props
|
|
24
|
+
}) => {
|
|
25
|
+
const generatePageNumbers = () => {
|
|
26
|
+
const pages2 = [];
|
|
27
|
+
const leftSiblingIndex = Math.max(currentPage - siblingCount, 1);
|
|
28
|
+
const rightSiblingIndex = Math.min(currentPage + siblingCount, totalPages);
|
|
29
|
+
const shouldShowLeftEllipsis = leftSiblingIndex > 2;
|
|
30
|
+
const shouldShowRightEllipsis = rightSiblingIndex < totalPages - 1;
|
|
31
|
+
if (totalPages <= 7) {
|
|
32
|
+
for (let i = 1; i <= totalPages; i++) {
|
|
33
|
+
pages2.push(i);
|
|
34
|
+
}
|
|
35
|
+
} else {
|
|
36
|
+
pages2.push(1);
|
|
37
|
+
if (shouldShowLeftEllipsis) {
|
|
38
|
+
pages2.push("left-ellipsis");
|
|
39
|
+
} else if (currentPage > 3) {
|
|
40
|
+
for (let i = 2; i < leftSiblingIndex; i++) {
|
|
41
|
+
pages2.push(i);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
for (let i = leftSiblingIndex; i <= rightSiblingIndex; i++) {
|
|
45
|
+
if (i !== 1 && i !== totalPages) {
|
|
46
|
+
pages2.push(i);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (shouldShowRightEllipsis) {
|
|
50
|
+
pages2.push("right-ellipsis");
|
|
51
|
+
} else if (currentPage < totalPages - 2) {
|
|
52
|
+
for (let i = rightSiblingIndex + 1; i < totalPages; i++) {
|
|
53
|
+
pages2.push(i);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
pages2.push(totalPages);
|
|
57
|
+
}
|
|
58
|
+
return pages2;
|
|
59
|
+
};
|
|
60
|
+
const pages = generatePageNumbers();
|
|
61
|
+
const { className, ...restProps } = props;
|
|
62
|
+
return /* @__PURE__ */ React.createElement(Box_default, { className: clsx(paginationContainer, className), ...restProps }, showFirstLast && /* @__PURE__ */ React.createElement(
|
|
63
|
+
Box_default,
|
|
64
|
+
{
|
|
65
|
+
as: "button",
|
|
66
|
+
className: clsx(pageButton, pageButtonVariants.default),
|
|
67
|
+
onClick: () => onPageChange(1),
|
|
68
|
+
disabled: currentPage === 1
|
|
69
|
+
},
|
|
70
|
+
"<<"
|
|
71
|
+
), showPrevNext && /* @__PURE__ */ React.createElement(
|
|
72
|
+
Box_default,
|
|
73
|
+
{
|
|
74
|
+
as: "button",
|
|
75
|
+
className: clsx(pageButton, pageButtonVariants.default),
|
|
76
|
+
onClick: () => onPageChange(currentPage - 1),
|
|
77
|
+
disabled: currentPage === 1
|
|
78
|
+
},
|
|
79
|
+
"<"
|
|
80
|
+
), pages.map(
|
|
81
|
+
(page, index) => typeof page === "number" ? /* @__PURE__ */ React.createElement(
|
|
82
|
+
Box_default,
|
|
83
|
+
{
|
|
84
|
+
key: `page-${page}`,
|
|
85
|
+
as: "button",
|
|
86
|
+
className: clsx(
|
|
87
|
+
pageButton,
|
|
88
|
+
page === currentPage ? pageButtonVariants.active : pageButtonVariants.default
|
|
89
|
+
),
|
|
90
|
+
onClick: () => onPageChange(page)
|
|
91
|
+
},
|
|
92
|
+
page
|
|
93
|
+
) : /* @__PURE__ */ React.createElement(Box_default, { key: `${page}-${index}`, className: ellipsis }, "...")
|
|
94
|
+
), showPrevNext && /* @__PURE__ */ React.createElement(
|
|
95
|
+
Box_default,
|
|
96
|
+
{
|
|
97
|
+
as: "button",
|
|
98
|
+
className: clsx(pageButton, pageButtonVariants.default),
|
|
99
|
+
onClick: () => onPageChange(currentPage + 1),
|
|
100
|
+
disabled: currentPage === totalPages
|
|
101
|
+
},
|
|
102
|
+
">"
|
|
103
|
+
), showFirstLast && /* @__PURE__ */ React.createElement(
|
|
104
|
+
Box_default,
|
|
105
|
+
{
|
|
106
|
+
as: "button",
|
|
107
|
+
className: clsx(pageButton, pageButtonVariants.default),
|
|
108
|
+
onClick: () => onPageChange(totalPages),
|
|
109
|
+
disabled: currentPage === totalPages
|
|
110
|
+
},
|
|
111
|
+
">>"
|
|
112
|
+
));
|
|
113
|
+
};
|
|
114
|
+
var Pagination_default = Pagination;
|
|
115
|
+
|
|
116
|
+
export {
|
|
117
|
+
Pagination_default
|
|
118
|
+
};
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Icon_default
|
|
3
|
+
} from "./chunk-DGWDQRZU.mjs";
|
|
4
|
+
|
|
5
|
+
// src/components/Toast/Toast.tsx
|
|
6
|
+
import React, { createContext, useContext, useState, useEffect, useCallback, useRef } from "react";
|
|
7
|
+
import { createPortal } from "react-dom";
|
|
8
|
+
import clsx from "clsx";
|
|
9
|
+
|
|
10
|
+
// src/components/Toast/styles.css.ts
|
|
11
|
+
var fadeOutError = "styles_fadeOutError__u0czf5a";
|
|
12
|
+
var fadeOutInfo = "styles_fadeOutInfo__u0czf5c";
|
|
13
|
+
var fadeOutSuccess = "styles_fadeOutSuccess__u0czf59";
|
|
14
|
+
var fadeOutWarning = "styles_fadeOutWarning__u0czf5b";
|
|
15
|
+
var slideInRight = "styles_slideInRight__u0czf50";
|
|
16
|
+
var toastCloseButton = "styles_toastCloseButton__u0czf5m";
|
|
17
|
+
var toastContainer = "styles_toastContainer__u0czf5e";
|
|
18
|
+
var toastContent = "styles__u0czf5p";
|
|
19
|
+
var toastItem = "styles_toastItem__u0czf5l";
|
|
20
|
+
var toastProgressBar = "styles_toastProgressBar__u0czf5o";
|
|
21
|
+
var toastProgressBarContainer = "styles_toastProgressBarContainer__u0czf5n";
|
|
22
|
+
var toastWrapper = { topLeft: "styles_toastWrapper_topLeft__u0czf5f", topCenter: "styles_toastWrapper_topCenter__u0czf5g", topRight: "styles_toastWrapper_topRight__u0czf5h", bottomLeft: "styles_toastWrapper_bottomLeft__u0czf5i", bottomCenter: "styles_toastWrapper_bottomCenter__u0czf5j", bottomRight: "styles_toastWrapper_bottomRight__u0czf5k" };
|
|
23
|
+
|
|
24
|
+
// src/components/Toast/Toast.tsx
|
|
25
|
+
var ToastContext = createContext({
|
|
26
|
+
addToast: () => "",
|
|
27
|
+
removeToast: () => {
|
|
28
|
+
},
|
|
29
|
+
handleDismissAll: () => {
|
|
30
|
+
},
|
|
31
|
+
handleResumeAll: () => {
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
var getFadeOutForVariant = (variant) => {
|
|
35
|
+
const fadeOutMap = {
|
|
36
|
+
success: fadeOutSuccess,
|
|
37
|
+
error: fadeOutError,
|
|
38
|
+
warning: fadeOutWarning,
|
|
39
|
+
info: fadeOutInfo
|
|
40
|
+
};
|
|
41
|
+
return fadeOutMap[variant] || fadeOutInfo;
|
|
42
|
+
};
|
|
43
|
+
var positionToClassKey = {
|
|
44
|
+
"top-left": "topLeft",
|
|
45
|
+
"top-center": "topCenter",
|
|
46
|
+
"top-right": "topRight",
|
|
47
|
+
"bottom-left": "bottomLeft",
|
|
48
|
+
"bottom-center": "bottomCenter",
|
|
49
|
+
"bottom-right": "bottomRight"
|
|
50
|
+
};
|
|
51
|
+
var ToastProvider = ({
|
|
52
|
+
children,
|
|
53
|
+
position = "top-right",
|
|
54
|
+
maxVisible = 5,
|
|
55
|
+
stacking = "stack"
|
|
56
|
+
}) => {
|
|
57
|
+
const [toasts, setToasts] = useState([]);
|
|
58
|
+
const [pauseId, setPauseId] = useState(null);
|
|
59
|
+
const timeoutsRef = useRef(/* @__PURE__ */ new Map());
|
|
60
|
+
const pauseTimeoutRef = useRef(null);
|
|
61
|
+
const toastsRef = useRef([]);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
toastsRef.current = toasts;
|
|
64
|
+
}, [toasts]);
|
|
65
|
+
const removeToastInternal = useCallback((id) => {
|
|
66
|
+
setToasts((prev) => {
|
|
67
|
+
const toast = prev.find((t) => t.id === id);
|
|
68
|
+
if (toast) {
|
|
69
|
+
toast.options.onClose?.();
|
|
70
|
+
}
|
|
71
|
+
return prev.filter((t) => t.id !== id);
|
|
72
|
+
});
|
|
73
|
+
const timeout = timeoutsRef.current.get(id);
|
|
74
|
+
if (timeout) {
|
|
75
|
+
clearTimeout(timeout);
|
|
76
|
+
timeoutsRef.current.delete(id);
|
|
77
|
+
}
|
|
78
|
+
}, []);
|
|
79
|
+
const addToast = useCallback(
|
|
80
|
+
(message, variant = "info", options = {}) => {
|
|
81
|
+
const id = `toast-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
82
|
+
const duration = options.duration ?? 5e3;
|
|
83
|
+
const startTime = Date.now();
|
|
84
|
+
const newToast = {
|
|
85
|
+
id,
|
|
86
|
+
message,
|
|
87
|
+
variant,
|
|
88
|
+
options: { ...options, duration, position: options.position ?? position },
|
|
89
|
+
startTime,
|
|
90
|
+
paused: false,
|
|
91
|
+
duration
|
|
92
|
+
};
|
|
93
|
+
setToasts((prev) => {
|
|
94
|
+
if (stacking === "replace") {
|
|
95
|
+
return [newToast];
|
|
96
|
+
}
|
|
97
|
+
const filtered = prev.filter((t) => {
|
|
98
|
+
const elapsed = Date.now() - t.startTime;
|
|
99
|
+
return elapsed < (t.options.duration ?? 5e3);
|
|
100
|
+
});
|
|
101
|
+
return [...filtered, newToast].slice(-maxVisible);
|
|
102
|
+
});
|
|
103
|
+
const timeoutId = setTimeout(() => {
|
|
104
|
+
removeToastInternal(id);
|
|
105
|
+
}, duration);
|
|
106
|
+
timeoutsRef.current.set(id, timeoutId);
|
|
107
|
+
return id;
|
|
108
|
+
},
|
|
109
|
+
[maxVisible, stacking, position, removeToastInternal]
|
|
110
|
+
);
|
|
111
|
+
const dismissInternal = useCallback((id) => {
|
|
112
|
+
const toast = toastsRef.current.find((t) => t.id === id);
|
|
113
|
+
if (!toast) return;
|
|
114
|
+
setToasts(
|
|
115
|
+
(prev) => prev.map((t) => {
|
|
116
|
+
if (t.id === id) {
|
|
117
|
+
return { ...t, paused: true };
|
|
118
|
+
}
|
|
119
|
+
return t;
|
|
120
|
+
})
|
|
121
|
+
);
|
|
122
|
+
if (pauseTimeoutRef.current) {
|
|
123
|
+
clearTimeout(pauseTimeoutRef.current);
|
|
124
|
+
}
|
|
125
|
+
setPauseId(id);
|
|
126
|
+
pauseTimeoutRef.current = setTimeout(() => {
|
|
127
|
+
setPauseId(null);
|
|
128
|
+
removeToastInternal(id);
|
|
129
|
+
}, 500);
|
|
130
|
+
const timeout = timeoutsRef.current.get(id);
|
|
131
|
+
if (timeout) {
|
|
132
|
+
clearTimeout(timeout);
|
|
133
|
+
timeoutsRef.current.delete(id);
|
|
134
|
+
}
|
|
135
|
+
}, [removeToastInternal]);
|
|
136
|
+
const dismissAllInternal = useCallback(() => {
|
|
137
|
+
setPauseId("all");
|
|
138
|
+
toastsRef.current.forEach((toast) => {
|
|
139
|
+
const timeout = timeoutsRef.current.get(toast.id);
|
|
140
|
+
if (timeout) {
|
|
141
|
+
clearTimeout(timeout);
|
|
142
|
+
timeoutsRef.current.delete(toast.id);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}, []);
|
|
146
|
+
const resumeAllInternal = useCallback(() => {
|
|
147
|
+
setPauseId(null);
|
|
148
|
+
toastsRef.current.forEach((toast) => {
|
|
149
|
+
if (toast.paused && toast.duration > 500) {
|
|
150
|
+
const timeout = setTimeout(() => {
|
|
151
|
+
removeToastInternal(toast.id);
|
|
152
|
+
}, toast.duration - (Date.now() - toast.startTime));
|
|
153
|
+
timeoutsRef.current.set(toast.id, timeout);
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
}, [removeToastInternal]);
|
|
157
|
+
useEffect(() => {
|
|
158
|
+
return () => {
|
|
159
|
+
timeoutsRef.current.forEach((timeout) => clearTimeout(timeout));
|
|
160
|
+
if (pauseTimeoutRef.current) {
|
|
161
|
+
clearTimeout(pauseTimeoutRef.current);
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
}, []);
|
|
165
|
+
const value = {
|
|
166
|
+
addToast,
|
|
167
|
+
removeToast: removeToastInternal,
|
|
168
|
+
handleDismissAll: dismissAllInternal,
|
|
169
|
+
handleResumeAll: resumeAllInternal
|
|
170
|
+
};
|
|
171
|
+
return /* @__PURE__ */ React.createElement(ToastContext.Provider, { value }, children, /* @__PURE__ */ React.createElement(
|
|
172
|
+
ToastContainer,
|
|
173
|
+
{
|
|
174
|
+
toasts,
|
|
175
|
+
position,
|
|
176
|
+
pauseId,
|
|
177
|
+
onDismiss: dismissInternal,
|
|
178
|
+
onDismissAll: dismissAllInternal,
|
|
179
|
+
onResumeAll: resumeAllInternal
|
|
180
|
+
}
|
|
181
|
+
));
|
|
182
|
+
};
|
|
183
|
+
var ToastContainer = ({
|
|
184
|
+
toasts,
|
|
185
|
+
position,
|
|
186
|
+
pauseId,
|
|
187
|
+
onDismiss,
|
|
188
|
+
onDismissAll,
|
|
189
|
+
onResumeAll
|
|
190
|
+
}) => {
|
|
191
|
+
const [container, setContainer] = useState(null);
|
|
192
|
+
useEffect(() => {
|
|
193
|
+
const existingContainer = document.getElementById("toast-container");
|
|
194
|
+
if (existingContainer) {
|
|
195
|
+
setContainer(existingContainer);
|
|
196
|
+
} else {
|
|
197
|
+
const el = document.createElement("div");
|
|
198
|
+
el.id = "toast-container";
|
|
199
|
+
document.body.appendChild(el);
|
|
200
|
+
setContainer(el);
|
|
201
|
+
}
|
|
202
|
+
}, []);
|
|
203
|
+
if (!container) return null;
|
|
204
|
+
return createPortal(
|
|
205
|
+
/* @__PURE__ */ React.createElement(
|
|
206
|
+
"div",
|
|
207
|
+
{
|
|
208
|
+
className: clsx(toastContainer, toastWrapper[positionToClassKey[position]]),
|
|
209
|
+
onMouseEnter: onDismissAll,
|
|
210
|
+
onMouseLeave: onResumeAll
|
|
211
|
+
},
|
|
212
|
+
toasts.map((toast) => {
|
|
213
|
+
const elapsed = Date.now() - toast.startTime;
|
|
214
|
+
const progress = (toast.duration - elapsed) / toast.duration * 100;
|
|
215
|
+
const fadeOutAnimation = getFadeOutForVariant(toast.variant);
|
|
216
|
+
return /* @__PURE__ */ React.createElement(
|
|
217
|
+
"div",
|
|
218
|
+
{
|
|
219
|
+
key: toast.id,
|
|
220
|
+
className: toastItem,
|
|
221
|
+
style: {
|
|
222
|
+
opacity: toast.paused || pauseId !== null ? 0.7 : 1,
|
|
223
|
+
animation: `${slideInRight} 0.2s ease, 0.2s ease ${fadeOutAnimation} forwards`
|
|
224
|
+
},
|
|
225
|
+
onMouseEnter: () => onDismiss(toast.id)
|
|
226
|
+
},
|
|
227
|
+
/* @__PURE__ */ React.createElement("div", { className: toastContent }, /* @__PURE__ */ React.createElement(Icon_default, { name: toast.variant === "success" ? "check" : toast.variant === "error" ? "error" : "info" }), /* @__PURE__ */ React.createElement("span", { style: { marginLeft: "8px" } }, toast.message), toast.options.closable !== false && /* @__PURE__ */ React.createElement(
|
|
228
|
+
"button",
|
|
229
|
+
{
|
|
230
|
+
type: "button",
|
|
231
|
+
className: toastCloseButton,
|
|
232
|
+
onClick: () => onDismiss(toast.id),
|
|
233
|
+
"aria-label": "Close toast"
|
|
234
|
+
},
|
|
235
|
+
/* @__PURE__ */ React.createElement(Icon_default, { name: "close" })
|
|
236
|
+
), toast.duration > 0 && /* @__PURE__ */ React.createElement("div", { className: toastProgressBarContainer }, /* @__PURE__ */ React.createElement(
|
|
237
|
+
"div",
|
|
238
|
+
{
|
|
239
|
+
className: toastProgressBar,
|
|
240
|
+
style: { width: `${progress}%` }
|
|
241
|
+
}
|
|
242
|
+
)))
|
|
243
|
+
);
|
|
244
|
+
})
|
|
245
|
+
),
|
|
246
|
+
container
|
|
247
|
+
);
|
|
248
|
+
};
|
|
249
|
+
var useToast = () => {
|
|
250
|
+
const context = useContext(ToastContext);
|
|
251
|
+
return context;
|
|
252
|
+
};
|
|
253
|
+
var Toast = ({ message, variant = "info", options, className }) => {
|
|
254
|
+
return null;
|
|
255
|
+
};
|
|
256
|
+
Toast.displayName = "Toast";
|
|
257
|
+
|
|
258
|
+
export {
|
|
259
|
+
ToastProvider,
|
|
260
|
+
useToast,
|
|
261
|
+
Toast
|
|
262
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Box_default
|
|
3
|
+
} from "./chunk-23CHBI4O.mjs";
|
|
4
|
+
|
|
5
|
+
// src/components/Toggle/Toggle.tsx
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
|
|
8
|
+
// src/components/Toggle/styles.css.ts
|
|
9
|
+
var toggle = "styles__13ijp634";
|
|
10
|
+
var toggleFocusRing = "styles__13ijp63f";
|
|
11
|
+
var toggleInput = "styles__13ijp635";
|
|
12
|
+
var toggleLabel = "styles__13ijp633";
|
|
13
|
+
var toggleSizes = { small: "styles_toggleSizes_small__13ijp630", medium: "styles_toggleSizes_medium__13ijp631", large: "styles_toggleSizes_large__13ijp632" };
|
|
14
|
+
var toggleThumb = "styles__13ijp639";
|
|
15
|
+
var toggleThumbChecked = "styles__13ijp63d";
|
|
16
|
+
var toggleThumbSizes = { small: "styles_toggleThumbSizes_small__13ijp63a", medium: "styles_toggleThumbSizes_medium__13ijp63b", large: "styles_toggleThumbSizes_large__13ijp63c" };
|
|
17
|
+
var toggleThumbUnchecked = "styles__13ijp63e";
|
|
18
|
+
var toggleTrack = "styles__13ijp636";
|
|
19
|
+
var toggleTrackChecked = "styles__13ijp637";
|
|
20
|
+
var toggleTrackUnchecked = "styles__13ijp638";
|
|
21
|
+
|
|
22
|
+
// src/components/Toggle/Toggle.tsx
|
|
23
|
+
import React, { useState, useId } from "react";
|
|
24
|
+
var Toggle = ({
|
|
25
|
+
checked = false,
|
|
26
|
+
onChange,
|
|
27
|
+
size = "medium",
|
|
28
|
+
label,
|
|
29
|
+
disabled = false,
|
|
30
|
+
id,
|
|
31
|
+
...props
|
|
32
|
+
}) => {
|
|
33
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
34
|
+
const generatedId = useId();
|
|
35
|
+
const toggleId = id || `toggle-${generatedId}`;
|
|
36
|
+
const handleChange = (e) => {
|
|
37
|
+
if (!disabled && onChange) {
|
|
38
|
+
onChange(e.target.checked);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
return /* @__PURE__ */ React.createElement(Box_default, { as: "div", className: toggle }, /* @__PURE__ */ React.createElement(Box_default, { as: "label", htmlFor: toggleId, className: toggleLabel }, /* @__PURE__ */ React.createElement(
|
|
42
|
+
Box_default,
|
|
43
|
+
{
|
|
44
|
+
as: "input",
|
|
45
|
+
type: "checkbox",
|
|
46
|
+
id: toggleId,
|
|
47
|
+
checked,
|
|
48
|
+
onChange: handleChange,
|
|
49
|
+
disabled,
|
|
50
|
+
className: toggleInput,
|
|
51
|
+
onFocus: () => setIsFocused(true),
|
|
52
|
+
onBlur: () => setIsFocused(false),
|
|
53
|
+
"aria-checked": checked,
|
|
54
|
+
role: "switch",
|
|
55
|
+
...props
|
|
56
|
+
}
|
|
57
|
+
), /* @__PURE__ */ React.createElement(
|
|
58
|
+
Box_default,
|
|
59
|
+
{
|
|
60
|
+
as: "span",
|
|
61
|
+
className: clsx(
|
|
62
|
+
toggleTrack,
|
|
63
|
+
toggleSizes[size],
|
|
64
|
+
checked ? toggleTrackChecked : toggleTrackUnchecked
|
|
65
|
+
),
|
|
66
|
+
"data-size": size
|
|
67
|
+
},
|
|
68
|
+
/* @__PURE__ */ React.createElement(
|
|
69
|
+
Box_default,
|
|
70
|
+
{
|
|
71
|
+
as: "span",
|
|
72
|
+
className: clsx(
|
|
73
|
+
toggleThumb,
|
|
74
|
+
toggleThumbSizes[size],
|
|
75
|
+
checked ? toggleThumbChecked : toggleThumbUnchecked
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
), /* @__PURE__ */ React.createElement(
|
|
80
|
+
Box_default,
|
|
81
|
+
{
|
|
82
|
+
as: "span",
|
|
83
|
+
className: toggleFocusRing,
|
|
84
|
+
"data-focused": isFocused,
|
|
85
|
+
"aria-hidden": "true"
|
|
86
|
+
}
|
|
87
|
+
)), label && /* @__PURE__ */ React.createElement(Box_default, { as: "span", marginLeft: "small" }, label));
|
|
88
|
+
};
|
|
89
|
+
var Toggle_default = Toggle;
|
|
90
|
+
|
|
91
|
+
export {
|
|
92
|
+
Toggle_default
|
|
93
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Box_default
|
|
3
|
+
} from "./chunk-23CHBI4O.mjs";
|
|
4
|
+
|
|
5
|
+
// src/components/Tabs/Tabs.tsx
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
import React, { createContext, useContext, useState } from "react";
|
|
8
|
+
|
|
9
|
+
// src/components/Tabs/styles.css.ts
|
|
10
|
+
var tabContent = "styles__1btv2dn7";
|
|
11
|
+
var tabItem = { base: "styles_tabItem_base__1btv2dn4", active: "styles_tabItem_active__1btv2dn5", verticalActive: "styles_tabItem_verticalActive__1btv2dn6" };
|
|
12
|
+
var tabsContainer = "styles__1btv2dn0";
|
|
13
|
+
var tabsList = "styles__1btv2dn1";
|
|
14
|
+
var tabsListHorizontal = "styles__1btv2dn2";
|
|
15
|
+
var tabsListVertical = "styles__1btv2dn3";
|
|
16
|
+
|
|
17
|
+
// src/components/Tabs/Tabs.tsx
|
|
18
|
+
var TabsContext = createContext({
|
|
19
|
+
activeTab: "",
|
|
20
|
+
setActiveTab: () => {
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
var Tabs = ({
|
|
24
|
+
children,
|
|
25
|
+
defaultValue = "",
|
|
26
|
+
orientation = "horizontal",
|
|
27
|
+
onChange,
|
|
28
|
+
className,
|
|
29
|
+
...props
|
|
30
|
+
}) => {
|
|
31
|
+
const [activeTab, setActiveTab] = useState(defaultValue);
|
|
32
|
+
const handleTabChange = (value) => {
|
|
33
|
+
setActiveTab(value);
|
|
34
|
+
if (onChange) {
|
|
35
|
+
onChange(value);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
return /* @__PURE__ */ React.createElement(
|
|
39
|
+
TabsContext.Provider,
|
|
40
|
+
{
|
|
41
|
+
value: { activeTab, setActiveTab: handleTabChange, orientation }
|
|
42
|
+
},
|
|
43
|
+
/* @__PURE__ */ React.createElement(Box_default, { className: clsx(tabsContainer, className), width: "100%", ...props }, children)
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
var TabList = ({ children, className }) => {
|
|
47
|
+
const { orientation } = useContext(TabsContext);
|
|
48
|
+
return /* @__PURE__ */ React.createElement(
|
|
49
|
+
Box_default,
|
|
50
|
+
{
|
|
51
|
+
as: "div",
|
|
52
|
+
role: "tablist",
|
|
53
|
+
className: clsx(
|
|
54
|
+
tabsList,
|
|
55
|
+
orientation === "vertical" ? tabsListVertical : tabsListHorizontal,
|
|
56
|
+
className
|
|
57
|
+
)
|
|
58
|
+
},
|
|
59
|
+
children
|
|
60
|
+
);
|
|
61
|
+
};
|
|
62
|
+
var Tab = ({ value, children, disabled = false, className }) => {
|
|
63
|
+
const { activeTab, setActiveTab, orientation } = useContext(TabsContext);
|
|
64
|
+
const isActive = activeTab === value;
|
|
65
|
+
const handleClick = () => {
|
|
66
|
+
if (!disabled) {
|
|
67
|
+
setActiveTab(value);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
return /* @__PURE__ */ React.createElement(
|
|
71
|
+
Box_default,
|
|
72
|
+
{
|
|
73
|
+
as: "button",
|
|
74
|
+
role: "tab",
|
|
75
|
+
"aria-selected": isActive,
|
|
76
|
+
disabled,
|
|
77
|
+
onClick: handleClick,
|
|
78
|
+
className: clsx(
|
|
79
|
+
tabItem[orientation === "vertical" ? isActive ? "verticalActive" : "base" : isActive ? "active" : "base"],
|
|
80
|
+
className
|
|
81
|
+
)
|
|
82
|
+
},
|
|
83
|
+
children
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
var TabPanel = ({ value, children, className }) => {
|
|
87
|
+
const { activeTab } = useContext(TabsContext);
|
|
88
|
+
const isActive = activeTab === value;
|
|
89
|
+
if (!isActive) return null;
|
|
90
|
+
return /* @__PURE__ */ React.createElement(Box_default, { as: "div", role: "tabpanel", className: clsx(tabContent, className) }, children);
|
|
91
|
+
};
|
|
92
|
+
var TabsComponent = Object.assign(Tabs, {
|
|
93
|
+
List: TabList,
|
|
94
|
+
Tab,
|
|
95
|
+
Panel: TabPanel
|
|
96
|
+
});
|
|
97
|
+
var Tabs_default = TabsComponent;
|
|
98
|
+
|
|
99
|
+
export {
|
|
100
|
+
Tabs_default
|
|
101
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Box_default
|
|
3
|
+
} from "./chunk-23CHBI4O.mjs";
|
|
4
|
+
|
|
5
|
+
// src/components/Avatar/Avatar.tsx
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
import React from "react";
|
|
8
|
+
|
|
9
|
+
// src/components/Avatar/styles.css.ts
|
|
10
|
+
var avatar = { base: "styles_avatar_base__1vp5m1q0", small: "styles_avatar_small__1vp5m1q1", medium: "styles_avatar_medium__1vp5m1q2", large: "styles_avatar_large__1vp5m1q3", xlarge: "styles_avatar_xlarge__1vp5m1q4" };
|
|
11
|
+
var avatarImage = "styles_avatarImage__1vp5m1q5";
|
|
12
|
+
var avatarWithImage = { small: "styles_avatarWithImage_small__1vp5m1q6", medium: "styles_avatarWithImage_medium__1vp5m1q7", large: "styles_avatarWithImage_large__1vp5m1q8", xlarge: "styles_avatarWithImage_xlarge__1vp5m1q9" };
|
|
13
|
+
var avatarWrapper = "styles__1vp5m1qa";
|
|
14
|
+
|
|
15
|
+
// src/components/Avatar/Avatar.tsx
|
|
16
|
+
var Avatar = ({
|
|
17
|
+
alt,
|
|
18
|
+
className,
|
|
19
|
+
src,
|
|
20
|
+
size = "medium",
|
|
21
|
+
children,
|
|
22
|
+
fallback
|
|
23
|
+
}) => {
|
|
24
|
+
const sizeClass = avatar[size];
|
|
25
|
+
if (src) {
|
|
26
|
+
return /* @__PURE__ */ React.createElement(Box_default, { className: clsx(avatarWrapper, className), display: "inline" }, /* @__PURE__ */ React.createElement(
|
|
27
|
+
Box_default,
|
|
28
|
+
{
|
|
29
|
+
as: "img",
|
|
30
|
+
src,
|
|
31
|
+
alt: alt || "Avatar",
|
|
32
|
+
className: clsx(avatarWithImage[size], avatarImage)
|
|
33
|
+
}
|
|
34
|
+
));
|
|
35
|
+
}
|
|
36
|
+
const initials = children || fallback;
|
|
37
|
+
return /* @__PURE__ */ React.createElement(Box_default, { className: clsx(sizeClass, className), role: "img", "aria-label": alt }, initials);
|
|
38
|
+
};
|
|
39
|
+
var Avatar_default = Avatar;
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
Avatar_default
|
|
43
|
+
};
|
|
File without changes
|