@jordan-mace/chaser-design-system 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordion/Accordion.d.ts +16 -0
- package/dist/components/Accordion/Accordion.js +108 -0
- package/dist/components/Accordion/index.d.ts +1 -0
- package/dist/components/Accordion/index.js +2 -0
- package/dist/components/Accordion/styles.css.d.ts +7 -0
- package/dist/components/Accordion/styles.css.js +66 -0
- package/dist/components/Alert/Alert.d.ts +9 -0
- package/dist/components/Alert/Alert.js +28 -0
- package/dist/components/Alert/index.d.ts +1 -0
- package/dist/components/Alert/index.js +2 -0
- package/dist/components/Alert/styles.css.d.ts +4 -0
- package/dist/components/Alert/styles.css.js +55 -0
- package/dist/components/AspectRatio/AspectRatio.d.ts +9 -0
- package/dist/components/AspectRatio/AspectRatio.js +27 -0
- package/dist/components/AspectRatio/index.d.ts +2 -0
- package/dist/components/AspectRatio/index.js +2 -0
- package/dist/components/Avatar/Avatar.d.ts +11 -0
- package/dist/components/Avatar/Avatar.js +27 -0
- package/dist/components/Avatar/index.d.ts +1 -0
- package/dist/components/Avatar/index.js +2 -0
- package/dist/components/Avatar/styles.css.d.ts +4 -0
- package/dist/components/Avatar/styles.css.js +152 -0
- package/dist/components/Badge/Badge.d.ts +11 -0
- package/dist/components/Badge/Badge.js +13 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Badge/index.js +2 -0
- package/dist/components/Badge/styles.css.d.ts +5 -0
- package/dist/components/Badge/styles.css.js +78 -0
- package/dist/components/Box/Box.d.ts +11 -0
- package/dist/components/Box/Box.js +53 -0
- package/dist/components/Box/index.d.ts +2 -0
- package/dist/components/Box/index.js +2 -0
- package/dist/components/Box/reset.css.d.ts +1 -0
- package/dist/components/Box/reset.css.js +16 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +13 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +66 -0
- package/dist/components/Breadcrumb/index.d.ts +1 -0
- package/dist/components/Breadcrumb/index.js +2 -0
- package/dist/components/Breadcrumb/styles.css.d.ts +6 -0
- package/dist/components/Breadcrumb/styles.css.js +51 -0
- package/dist/components/Button/Button.d.ts +9 -0
- package/dist/components/Button/Button.js +15 -0
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/Button/index.js +2 -0
- package/dist/components/Button/styles.css.d.ts +2 -0
- package/dist/components/Button/styles.css.js +31 -0
- package/dist/components/Card/Card.d.ts +8 -0
- package/dist/components/Card/Card.js +15 -0
- package/dist/components/Card/index.d.ts +1 -0
- package/dist/components/Card/index.js +2 -0
- package/dist/components/Card/styles.css.d.ts +2 -0
- package/dist/components/Card/styles.css.js +26 -0
- package/dist/components/Checkbox/Checkbox.d.ts +6 -0
- package/dist/components/Checkbox/Checkbox.js +50 -0
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/Checkbox/index.js +2 -0
- package/dist/components/Checkbox/styles.css.d.ts +3 -0
- package/dist/components/Checkbox/styles.css.js +32 -0
- package/dist/components/Collapse/Collapse.d.ts +12 -0
- package/dist/components/Collapse/Collapse.js +58 -0
- package/dist/components/Collapse/index.d.ts +2 -0
- package/dist/components/Collapse/index.js +2 -0
- package/dist/components/Collapse/styles.css.d.ts +3 -0
- package/dist/components/Collapse/styles.css.js +37 -0
- package/dist/components/Combobox/Combobox.d.ts +23 -0
- package/dist/components/Combobox/Combobox.js +171 -0
- package/dist/components/Combobox/index.d.ts +2 -0
- package/dist/components/Combobox/index.js +2 -0
- package/dist/components/Combobox/styles.css.d.ts +13 -0
- package/dist/components/Combobox/styles.css.js +143 -0
- package/dist/components/Container/Container.d.ts +11 -0
- package/dist/components/Container/Container.js +31 -0
- package/dist/components/Container/index.d.ts +2 -0
- package/dist/components/Container/index.js +2 -0
- package/dist/components/Divider/Divider.d.ts +9 -0
- package/dist/components/Divider/Divider.js +14 -0
- package/dist/components/Divider/index.d.ts +2 -0
- package/dist/components/Divider/index.js +2 -0
- package/dist/components/Divider/styles.css.d.ts +4 -0
- package/dist/components/Divider/styles.css.js +42 -0
- package/dist/components/Drawer/Drawer.d.ts +16 -0
- package/dist/components/Drawer/Drawer.js +113 -0
- package/dist/components/Drawer/index.d.ts +2 -0
- package/dist/components/Drawer/index.js +2 -0
- package/dist/components/Drawer/styles.css.d.ts +8 -0
- package/dist/components/Drawer/styles.css.js +146 -0
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +23 -0
- package/dist/components/DropdownMenu/DropdownMenu.js +98 -0
- package/dist/components/DropdownMenu/index.d.ts +2 -0
- package/dist/components/DropdownMenu/index.js +2 -0
- package/dist/components/DropdownMenu/styles.css.d.ts +9 -0
- package/dist/components/DropdownMenu/styles.css.js +94 -0
- package/dist/components/EmptyState/EmptyState.d.ts +10 -0
- package/dist/components/EmptyState/EmptyState.js +32 -0
- package/dist/components/EmptyState/index.d.ts +2 -0
- package/dist/components/EmptyState/index.js +2 -0
- package/dist/components/EmptyState/styles.css.d.ts +5 -0
- package/dist/components/EmptyState/styles.css.js +31 -0
- package/dist/components/FileUpload/FileUpload.d.ts +27 -0
- package/dist/components/FileUpload/FileUpload.js +214 -0
- package/dist/components/FileUpload/index.d.ts +2 -0
- package/dist/components/FileUpload/index.js +2 -0
- package/dist/components/FileUpload/styles.css.d.ts +19 -0
- package/dist/components/FileUpload/styles.css.js +146 -0
- package/dist/components/Form/Form.d.ts +7 -0
- package/dist/components/Form/Form.js +15 -0
- package/dist/components/Form/FormInput.d.ts +5 -0
- package/dist/components/Form/FormInput.js +15 -0
- package/dist/components/Form/index.d.ts +2 -0
- package/dist/components/Form/index.js +3 -0
- package/dist/components/Form/styles.css.d.ts +2 -0
- package/dist/components/Form/styles.css.js +12 -0
- package/dist/components/Grid/Grid.d.ts +13 -0
- package/dist/components/Grid/Grid.js +30 -0
- package/dist/components/Grid/index.d.ts +2 -0
- package/dist/components/Grid/index.js +2 -0
- package/dist/components/Icon/Icon.d.ts +12 -0
- package/dist/components/Icon/Icon.js +29 -0
- package/dist/components/Icon/index.d.ts +1 -0
- package/dist/components/Icon/index.js +2 -0
- package/dist/components/Icon/styles.css.d.ts +1 -0
- package/dist/components/Icon/styles.css.js +10 -0
- package/dist/components/Input/Input.d.ts +7 -0
- package/dist/components/Input/Input.js +38 -0
- package/dist/components/Input/index.d.ts +1 -0
- package/dist/components/Input/index.js +2 -0
- package/dist/components/Input/styles.css.d.ts +2 -0
- package/dist/components/Input/styles.css.js +9 -0
- package/dist/components/Kbd/Kbd.d.ts +7 -0
- package/dist/components/Kbd/Kbd.js +10 -0
- package/dist/components/Kbd/index.d.ts +2 -0
- package/dist/components/Kbd/index.js +2 -0
- package/dist/components/Kbd/styles.css.d.ts +1 -0
- package/dist/components/Kbd/styles.css.js +17 -0
- package/dist/components/List/List.d.ts +5 -0
- package/dist/components/List/List.js +11 -0
- package/dist/components/List/ListItem.d.ts +5 -0
- package/dist/components/List/ListItem.js +11 -0
- package/dist/components/List/index.d.ts +2 -0
- package/dist/components/List/index.js +3 -0
- package/dist/components/List/styles.css.d.ts +2 -0
- package/dist/components/List/styles.css.js +12 -0
- package/dist/components/Modal/Modal.d.ts +13 -0
- package/dist/components/Modal/Modal.js +71 -0
- package/dist/components/Modal/index.d.ts +2 -0
- package/dist/components/Modal/index.js +2 -0
- package/dist/components/Modal/styles.css.d.ts +7 -0
- package/dist/components/Modal/styles.css.js +93 -0
- package/dist/components/Navbar/Navbar.d.ts +6 -0
- package/dist/components/Navbar/Navbar.js +16 -0
- package/dist/components/Navbar/NavbarItem.d.ts +6 -0
- package/dist/components/Navbar/NavbarItem.js +12 -0
- package/dist/components/Navbar/index.d.ts +2 -0
- package/dist/components/Navbar/index.js +3 -0
- package/dist/components/Navbar/styles.css.d.ts +2 -0
- package/dist/components/Navbar/styles.css.js +4 -0
- package/dist/components/NumberInput/NumberInput.d.ts +20 -0
- package/dist/components/NumberInput/NumberInput.js +108 -0
- package/dist/components/NumberInput/index.d.ts +2 -0
- package/dist/components/NumberInput/index.js +2 -0
- package/dist/components/NumberInput/styles.css.d.ts +10 -0
- package/dist/components/NumberInput/styles.css.js +118 -0
- package/dist/components/Pagination/Pagination.d.ts +11 -0
- package/dist/components/Pagination/Pagination.js +70 -0
- package/dist/components/Pagination/index.d.ts +2 -0
- package/dist/components/Pagination/index.js +2 -0
- package/dist/components/Pagination/styles.css.d.ts +4 -0
- package/dist/components/Pagination/styles.css.js +45 -0
- package/dist/components/Popover/Popover.d.ts +18 -0
- package/dist/components/Popover/Popover.js +105 -0
- package/dist/components/Popover/index.d.ts +2 -0
- package/dist/components/Popover/index.js +2 -0
- package/dist/components/Popover/styles.css.d.ts +11 -0
- package/dist/components/Popover/styles.css.js +192 -0
- package/dist/components/Progress/Progress.d.ts +11 -0
- package/dist/components/Progress/Progress.js +55 -0
- package/dist/components/Progress/index.d.ts +1 -0
- package/dist/components/Progress/index.js +2 -0
- package/dist/components/Progress/styles.css.d.ts +4 -0
- package/dist/components/Progress/styles.css.js +72 -0
- package/dist/components/Radio/Radio.d.ts +16 -0
- package/dist/components/Radio/Radio.js +60 -0
- package/dist/components/Radio/index.d.ts +1 -0
- package/dist/components/Radio/index.js +2 -0
- package/dist/components/Radio/styles.css.d.ts +5 -0
- package/dist/components/Radio/styles.css.js +43 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts +11 -0
- package/dist/components/ScrollArea/ScrollArea.js +22 -0
- package/dist/components/ScrollArea/index.d.ts +2 -0
- package/dist/components/ScrollArea/index.js +2 -0
- package/dist/components/ScrollArea/styles.css.d.ts +3 -0
- package/dist/components/ScrollArea/styles.css.js +26 -0
- package/dist/components/Select/Select.d.ts +13 -0
- package/dist/components/Select/Select.js +36 -0
- package/dist/components/Select/index.d.ts +1 -0
- package/dist/components/Select/index.js +2 -0
- package/dist/components/Select/styles.css.d.ts +4 -0
- package/dist/components/Select/styles.css.js +83 -0
- package/dist/components/Separator/Separator.d.ts +9 -0
- package/dist/components/Separator/Separator.js +13 -0
- package/dist/components/Separator/index.d.ts +2 -0
- package/dist/components/Separator/index.js +2 -0
- package/dist/components/Separator/styles.css.d.ts +4 -0
- package/dist/components/Separator/styles.css.js +29 -0
- package/dist/components/Skeleton/Skeleton.d.ts +14 -0
- package/dist/components/Skeleton/Skeleton.js +28 -0
- package/dist/components/Skeleton/index.d.ts +2 -0
- package/dist/components/Skeleton/index.js +2 -0
- package/dist/components/Skeleton/styles.css.d.ts +4 -0
- package/dist/components/Skeleton/styles.css.js +65 -0
- package/dist/components/Spinner/Spinner.d.ts +10 -0
- package/dist/components/Spinner/Spinner.js +14 -0
- package/dist/components/Spinner/index.d.ts +2 -0
- package/dist/components/Spinner/index.js +2 -0
- package/dist/components/Spinner/styles.css.d.ts +4 -0
- package/dist/components/Spinner/styles.css.js +60 -0
- package/dist/components/Stack/Stack.d.ts +16 -0
- package/dist/components/Stack/Stack.js +39 -0
- package/dist/components/Stack/index.d.ts +2 -0
- package/dist/components/Stack/index.js +2 -0
- package/dist/components/Stepper/Stepper.d.ts +18 -0
- package/dist/components/Stepper/Stepper.js +70 -0
- package/dist/components/Stepper/index.d.ts +2 -0
- package/dist/components/Stepper/index.js +2 -0
- package/dist/components/Stepper/styles.css.d.ts +14 -0
- package/dist/components/Stepper/styles.css.js +105 -0
- package/dist/components/Table/Table.d.ts +42 -0
- package/dist/components/Table/Table.js +65 -0
- package/dist/components/Table/index.d.ts +1 -0
- package/dist/components/Table/index.js +2 -0
- package/dist/components/Table/styles.css.d.ts +8 -0
- package/dist/components/Table/styles.css.js +50 -0
- package/dist/components/Tabs/Tabs.d.ts +29 -0
- package/dist/components/Tabs/Tabs.js +71 -0
- package/dist/components/Tabs/index.d.ts +1 -0
- package/dist/components/Tabs/index.js +2 -0
- package/dist/components/Tabs/styles.css.d.ts +6 -0
- package/dist/components/Tabs/styles.css.js +101 -0
- package/dist/components/Tag/Tag.d.ts +16 -0
- package/dist/components/Tag/Tag.js +40 -0
- package/dist/components/Tag/index.d.ts +1 -0
- package/dist/components/Tag/index.js +2 -0
- package/dist/components/Tag/styles.css.d.ts +3 -0
- package/dist/components/Tag/styles.css.js +94 -0
- package/dist/components/Text/Header.d.ts +8 -0
- package/dist/components/Text/Header.js +12 -0
- package/dist/components/Text/P.d.ts +7 -0
- package/dist/components/Text/P.js +12 -0
- package/dist/components/Text/index.d.ts +2 -0
- package/dist/components/Text/index.js +3 -0
- package/dist/components/Text/styles.css.d.ts +2 -0
- package/dist/components/Text/styles.css.js +14 -0
- package/dist/components/TextArea/TextArea.d.ts +7 -0
- package/dist/components/TextArea/TextArea.js +38 -0
- package/dist/components/TextArea/index.d.ts +2 -0
- package/dist/components/TextArea/index.js +2 -0
- package/dist/components/TextArea/styles.css.d.ts +2 -0
- package/dist/components/TextArea/styles.css.js +11 -0
- package/dist/components/Toast/Toast.d.ts +34 -0
- package/dist/components/Toast/Toast.js +236 -0
- package/dist/components/Toast/index.d.ts +1 -0
- package/dist/components/Toast/index.js +2 -0
- package/dist/components/Toast/styles.css.d.ts +21 -0
- package/dist/components/Toast/styles.css.js +217 -0
- package/dist/components/Toggle/Toggle.d.ts +10 -0
- package/dist/components/Toggle/Toggle.js +62 -0
- package/dist/components/Toggle/index.d.ts +2 -0
- package/dist/components/Toggle/index.js +2 -0
- package/dist/components/Toggle/styles.css.d.ts +12 -0
- package/dist/components/Toggle/styles.css.js +119 -0
- package/dist/components/Tooltip/Tooltip.d.ts +10 -0
- package/dist/components/Tooltip/Tooltip.js +41 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/components/Tooltip/index.js +2 -0
- package/dist/components/Tooltip/styles.css.d.ts +8 -0
- package/dist/components/Tooltip/styles.css.js +87 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +8 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.js +8 -0
- package/dist/components/VisuallyHidden/index.d.ts +2 -0
- package/dist/components/VisuallyHidden/index.js +2 -0
- package/dist/components/VisuallyHidden/styles.css.d.ts +1 -0
- package/dist/components/VisuallyHidden/styles.css.js +13 -0
- package/dist/components/index.d.ts +68 -0
- package/dist/components/index.js +48 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/layers.css.js +9 -0
- package/dist/reset.css.js +57 -0
- package/dist/styles/layers.css.d.ts +3 -0
- package/dist/styles/layers.css.js +9 -0
- package/dist/styles/reset.css.js +57 -0
- package/dist/styles/sprinkles.css.d.ts +241 -0
- package/dist/styles/sprinkles.css.js +220 -0
- package/dist/styles/theme.css.d.ts +38 -0
- package/dist/styles/theme.css.js +50 -0
- package/dist/styles/utils.d.ts +2 -0
- package/dist/styles/utils.js +8 -0
- package/dist/theme.css.js +50 -0
- package/package.json +4 -4
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type AccordionProps = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
allowMultiple?: boolean;
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
type AccordionItemProps = {
|
|
8
|
+
value: string;
|
|
9
|
+
title: string;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
declare const AccordionComponent: (({ children, allowMultiple, className, }: AccordionProps) => React.JSX.Element) & {
|
|
14
|
+
Item: ({ value, title, children, className, }: AccordionItemProps) => React.JSX.Element;
|
|
15
|
+
};
|
|
16
|
+
export default AccordionComponent;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { createContext, useCallback, useContext, useState } from "react";
|
|
4
|
+
import { accordionContent, accordionGroup, accordionHeader, accordionIcon, accordionIconExpanded, accordionItem } from "./styles.css.js";
|
|
5
|
+
import Box from "../Box/index.js";
|
|
6
|
+
const AccordionContext = /*#__PURE__*/ createContext({
|
|
7
|
+
allowMultiple: false,
|
|
8
|
+
expandedItems: new Set(),
|
|
9
|
+
toggleItem: ()=>{}
|
|
10
|
+
});
|
|
11
|
+
const Accordion = ({ children, allowMultiple = false, className })=>{
|
|
12
|
+
const [expandedItems, setExpandedItems] = useState(new Set());
|
|
13
|
+
const toggleItem = (value)=>{
|
|
14
|
+
setExpandedItems((prev)=>{
|
|
15
|
+
const newSet = new Set(prev);
|
|
16
|
+
if (newSet.has(value)) newSet.delete(value);
|
|
17
|
+
else {
|
|
18
|
+
if (!allowMultiple) return new Set([
|
|
19
|
+
value
|
|
20
|
+
]);
|
|
21
|
+
newSet.add(value);
|
|
22
|
+
}
|
|
23
|
+
return newSet;
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
return /*#__PURE__*/ jsx(AccordionContext.Provider, {
|
|
27
|
+
value: {
|
|
28
|
+
allowMultiple,
|
|
29
|
+
expandedItems,
|
|
30
|
+
toggleItem
|
|
31
|
+
},
|
|
32
|
+
children: /*#__PURE__*/ jsx(Box, {
|
|
33
|
+
className: clsx(accordionGroup, className),
|
|
34
|
+
width: "100%",
|
|
35
|
+
children: children
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
const AccordionItem = ({ value, title, children, className })=>{
|
|
40
|
+
const { expandedItems, toggleItem } = useContext(AccordionContext);
|
|
41
|
+
const isExpanded = expandedItems.has(value);
|
|
42
|
+
const toggleExpanded = useCallback(()=>{
|
|
43
|
+
toggleItem(value);
|
|
44
|
+
}, [
|
|
45
|
+
value,
|
|
46
|
+
toggleItem
|
|
47
|
+
]);
|
|
48
|
+
return /*#__PURE__*/ jsxs(Box, {
|
|
49
|
+
as: "div",
|
|
50
|
+
className: clsx(accordionItem, className),
|
|
51
|
+
width: "100%",
|
|
52
|
+
marginBottom: "small",
|
|
53
|
+
border: "small",
|
|
54
|
+
borderRadius: "large",
|
|
55
|
+
overflow: "hidden",
|
|
56
|
+
children: [
|
|
57
|
+
/*#__PURE__*/ jsxs(Box, {
|
|
58
|
+
as: "button",
|
|
59
|
+
onClick: toggleExpanded,
|
|
60
|
+
className: accordionHeader,
|
|
61
|
+
display: "flex",
|
|
62
|
+
alignItems: "center",
|
|
63
|
+
justifyContent: "space-between",
|
|
64
|
+
padding: "small",
|
|
65
|
+
cursor: "pointer",
|
|
66
|
+
style: {
|
|
67
|
+
userSelect: 'none'
|
|
68
|
+
},
|
|
69
|
+
fontSize: "14px",
|
|
70
|
+
fontWeight: "500",
|
|
71
|
+
color: "c5-700",
|
|
72
|
+
"aria-expanded": isExpanded,
|
|
73
|
+
"aria-controls": `accordion-content-${value}`,
|
|
74
|
+
children: [
|
|
75
|
+
/*#__PURE__*/ jsx(Box, {
|
|
76
|
+
as: "span",
|
|
77
|
+
children: title
|
|
78
|
+
}),
|
|
79
|
+
/*#__PURE__*/ jsx(Box, {
|
|
80
|
+
as: "span",
|
|
81
|
+
className: clsx(accordionIcon, isExpanded && accordionIconExpanded),
|
|
82
|
+
fontSize: "12px",
|
|
83
|
+
display: "flex",
|
|
84
|
+
alignItems: "center",
|
|
85
|
+
justifyContent: "center",
|
|
86
|
+
"aria-hidden": "true",
|
|
87
|
+
children: "▼"
|
|
88
|
+
})
|
|
89
|
+
]
|
|
90
|
+
}),
|
|
91
|
+
/*#__PURE__*/ jsx(Box, {
|
|
92
|
+
as: "div",
|
|
93
|
+
id: `accordion-content-${value}`,
|
|
94
|
+
className: clsx(accordionContent[isExpanded ? 'expanded' : 'collapsed']),
|
|
95
|
+
padding: "small",
|
|
96
|
+
fontSize: "14px",
|
|
97
|
+
color: "c5-700",
|
|
98
|
+
role: "region",
|
|
99
|
+
children: children
|
|
100
|
+
})
|
|
101
|
+
]
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
const AccordionComponent = Object.assign(Accordion, {
|
|
105
|
+
Item: AccordionItem
|
|
106
|
+
});
|
|
107
|
+
const Accordion_Accordion = AccordionComponent;
|
|
108
|
+
export { Accordion_Accordion as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Accordion } from './Accordion';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const accordion: string;
|
|
2
|
+
export declare const accordionItem: string;
|
|
3
|
+
export declare const accordionHeader: string;
|
|
4
|
+
export declare const accordionContent: Record<"expanded" | "collapsed", string>;
|
|
5
|
+
export declare const accordionIcon: string;
|
|
6
|
+
export declare const accordionIconExpanded: string;
|
|
7
|
+
export declare const accordionGroup: string;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { style, styleVariants } from "@vanilla-extract/css";
|
|
2
|
+
import { vars } from "../../styles/theme.css.js";
|
|
3
|
+
import { styleWithLayer } from "../../styles/utils.js";
|
|
4
|
+
const accordion = styleWithLayer({
|
|
5
|
+
width: '100%',
|
|
6
|
+
fontFamily: vars.fontFamily.body
|
|
7
|
+
});
|
|
8
|
+
const accordionItem = style({
|
|
9
|
+
width: '100%',
|
|
10
|
+
marginBottom: '4px',
|
|
11
|
+
border: `1px solid ${vars.colors.borderDefault}`,
|
|
12
|
+
borderRadius: '8px',
|
|
13
|
+
overflow: 'hidden'
|
|
14
|
+
});
|
|
15
|
+
const accordionHeader = style({
|
|
16
|
+
width: '100%',
|
|
17
|
+
display: 'flex',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
justifyContent: 'space-between',
|
|
20
|
+
padding: '12px 16px',
|
|
21
|
+
backgroundColor: vars.colors.backgroundMuted,
|
|
22
|
+
cursor: 'pointer',
|
|
23
|
+
userSelect: 'none',
|
|
24
|
+
fontSize: '14px',
|
|
25
|
+
fontWeight: '500',
|
|
26
|
+
color: vars.colors.textPrimary,
|
|
27
|
+
transition: 'background-color 0.2s ease',
|
|
28
|
+
':hover': {
|
|
29
|
+
backgroundColor: vars.colors.backgroundDefault
|
|
30
|
+
},
|
|
31
|
+
':focus-visible': {
|
|
32
|
+
outline: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
|
|
33
|
+
outlineOffset: '-2px'
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const accordionContent = styleVariants({
|
|
37
|
+
collapsed: {
|
|
38
|
+
display: 'none',
|
|
39
|
+
padding: '0 16px',
|
|
40
|
+
fontSize: '14px',
|
|
41
|
+
color: vars.colors.textPrimary,
|
|
42
|
+
backgroundColor: vars.colors.backgroundDefault
|
|
43
|
+
},
|
|
44
|
+
expanded: {
|
|
45
|
+
display: 'block',
|
|
46
|
+
padding: '12px 16px',
|
|
47
|
+
fontSize: '14px',
|
|
48
|
+
color: vars.colors.textPrimary,
|
|
49
|
+
backgroundColor: vars.colors.backgroundDefault,
|
|
50
|
+
animation: 'slideDown 0.2s ease'
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
const accordionIcon = style({
|
|
54
|
+
fontSize: '12px',
|
|
55
|
+
transition: 'transform 0.2s ease',
|
|
56
|
+
display: 'flex',
|
|
57
|
+
alignItems: 'center',
|
|
58
|
+
justifyContent: 'center'
|
|
59
|
+
});
|
|
60
|
+
const accordionIconExpanded = style({
|
|
61
|
+
transform: 'rotate(180deg)'
|
|
62
|
+
});
|
|
63
|
+
const accordionGroup = styleWithLayer({
|
|
64
|
+
width: '100%'
|
|
65
|
+
});
|
|
66
|
+
export { accordion, accordionContent, accordionGroup, accordionHeader, accordionIcon, accordionIconExpanded, accordionItem };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type AlertProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
3
|
+
severity?: 'success' | 'warning' | 'error' | 'info';
|
|
4
|
+
dismissible?: boolean;
|
|
5
|
+
onDismiss?: () => void;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
declare const Alert: ({ severity, dismissible, onDismiss, children, ...props }: AlertProps) => React.JSX.Element;
|
|
9
|
+
export default Alert;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { alert as external_styles_css_js_alert, alertContent, alertDismissButton, alertVariants } from "./styles.css.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import Box from "../Box/index.js";
|
|
6
|
+
const Alert = ({ severity = 'info', dismissible = false, onDismiss, children, ...props })=>/*#__PURE__*/ jsxs(Box, {
|
|
7
|
+
as: "div",
|
|
8
|
+
role: "alert",
|
|
9
|
+
className: clsx(external_styles_css_js_alert, alertVariants[severity], props.className),
|
|
10
|
+
...props,
|
|
11
|
+
children: [
|
|
12
|
+
/*#__PURE__*/ jsx(Box, {
|
|
13
|
+
as: "div",
|
|
14
|
+
className: alertContent,
|
|
15
|
+
children: children
|
|
16
|
+
}),
|
|
17
|
+
dismissible && onDismiss && /*#__PURE__*/ jsx(Box, {
|
|
18
|
+
as: "button",
|
|
19
|
+
className: alertDismissButton,
|
|
20
|
+
onClick: onDismiss,
|
|
21
|
+
"aria-label": "Dismiss alert",
|
|
22
|
+
type: "button",
|
|
23
|
+
children: "\xd7"
|
|
24
|
+
})
|
|
25
|
+
]
|
|
26
|
+
});
|
|
27
|
+
const Alert_Alert = Alert;
|
|
28
|
+
export { Alert_Alert as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Alert } from './Alert';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { styleVariants } from "@vanilla-extract/css";
|
|
2
|
+
import { vars } from "../../styles/theme.css.js";
|
|
3
|
+
import { styleWithLayer } from "../../styles/utils.js";
|
|
4
|
+
const alertVariants = styleVariants({
|
|
5
|
+
success: {
|
|
6
|
+
backgroundColor: vars.colors.alertSuccessBackground,
|
|
7
|
+
borderLeftColor: vars.colors.alertSuccessBorder,
|
|
8
|
+
color: vars.colors.alertSuccessText
|
|
9
|
+
},
|
|
10
|
+
warning: {
|
|
11
|
+
backgroundColor: vars.colors.alertWarningBackground,
|
|
12
|
+
borderLeftColor: vars.colors.alertWarningBorder,
|
|
13
|
+
color: vars.colors.alertWarningText
|
|
14
|
+
},
|
|
15
|
+
error: {
|
|
16
|
+
backgroundColor: vars.colors.alertErrorBackground,
|
|
17
|
+
borderLeftColor: vars.colors.alertErrorBorder,
|
|
18
|
+
color: vars.colors.alertErrorText
|
|
19
|
+
},
|
|
20
|
+
info: {
|
|
21
|
+
backgroundColor: vars.colors.alertInfoBackground,
|
|
22
|
+
borderLeftColor: vars.colors.alertInfoBorder,
|
|
23
|
+
color: vars.colors.alertInfoText
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
const styles_css_alert = styleWithLayer({
|
|
27
|
+
padding: '1rem',
|
|
28
|
+
borderLeft: '4px solid',
|
|
29
|
+
borderRadius: '0.5rem',
|
|
30
|
+
display: 'flex',
|
|
31
|
+
alignItems: 'flex-start',
|
|
32
|
+
gap: '0.5rem',
|
|
33
|
+
fontFamily: vars.fontFamily.body,
|
|
34
|
+
fontSize: '0.875rem',
|
|
35
|
+
lineHeight: '1.5'
|
|
36
|
+
});
|
|
37
|
+
const alertContent = styleWithLayer({
|
|
38
|
+
flex: 1
|
|
39
|
+
});
|
|
40
|
+
const alertDismissButton = styleWithLayer({
|
|
41
|
+
background: 'none',
|
|
42
|
+
border: 'none',
|
|
43
|
+
padding: '0.25rem',
|
|
44
|
+
cursor: 'pointer',
|
|
45
|
+
borderRadius: '0.25rem',
|
|
46
|
+
display: 'flex',
|
|
47
|
+
alignItems: 'center',
|
|
48
|
+
justifyContent: 'center',
|
|
49
|
+
opacity: 0.7,
|
|
50
|
+
transition: 'opacity 0.2s ease-in-out',
|
|
51
|
+
':hover': {
|
|
52
|
+
opacity: 1
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
export { styles_css_alert as alert, alertContent, alertDismissButton, alertVariants };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type BoxProps } from '../Box';
|
|
3
|
+
export type AspectRatioValue = '1/1' | '4/3' | '16/9' | '21/9' | number;
|
|
4
|
+
export interface AspectRatioProps extends BoxProps {
|
|
5
|
+
ratio?: AspectRatioValue;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare const AspectRatio: React.ForwardRefExoticComponent<Omit<AspectRatioProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
9
|
+
export default AspectRatio;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import Box from "../Box/index.js";
|
|
4
|
+
const AspectRatio = /*#__PURE__*/ forwardRef(({ ratio = '1/1', children, ...props }, ref)=>{
|
|
5
|
+
const aspectRatio = 'number' == typeof ratio ? ratio : ratio;
|
|
6
|
+
return /*#__PURE__*/ jsx(Box, {
|
|
7
|
+
ref: ref,
|
|
8
|
+
position: "relative",
|
|
9
|
+
style: {
|
|
10
|
+
aspectRatio,
|
|
11
|
+
overflow: 'hidden'
|
|
12
|
+
},
|
|
13
|
+
...props,
|
|
14
|
+
children: /*#__PURE__*/ jsx(Box, {
|
|
15
|
+
position: "absolute",
|
|
16
|
+
width: "100%",
|
|
17
|
+
height: "100%",
|
|
18
|
+
display: "flex",
|
|
19
|
+
alignItems: "center",
|
|
20
|
+
justifyContent: "center",
|
|
21
|
+
children: children
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
AspectRatio.displayName = 'AspectRatio';
|
|
26
|
+
const AspectRatio_AspectRatio = AspectRatio;
|
|
27
|
+
export { AspectRatio_AspectRatio as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type AvatarProps = {
|
|
3
|
+
alt?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
src?: string;
|
|
6
|
+
size?: 'small' | 'medium' | 'large' | 'xlarge';
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
fallback?: string;
|
|
9
|
+
};
|
|
10
|
+
declare const Avatar: ({ alt, className, src, size, children, fallback, }: AvatarProps) => React.JSX.Element;
|
|
11
|
+
export default Avatar;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import "react";
|
|
4
|
+
import { avatar, avatarImage, avatarWithImage, avatarWrapper } from "./styles.css.js";
|
|
5
|
+
import Box from "../Box/index.js";
|
|
6
|
+
const Avatar = ({ alt, className, src, size = 'medium', children, fallback })=>{
|
|
7
|
+
const sizeClass = avatar[size];
|
|
8
|
+
if (src) return /*#__PURE__*/ jsx(Box, {
|
|
9
|
+
className: clsx(avatarWrapper, className),
|
|
10
|
+
display: "inline",
|
|
11
|
+
children: /*#__PURE__*/ jsx(Box, {
|
|
12
|
+
as: "img",
|
|
13
|
+
src: src,
|
|
14
|
+
alt: alt || 'Avatar',
|
|
15
|
+
className: clsx(avatarWithImage[size], avatarImage)
|
|
16
|
+
})
|
|
17
|
+
});
|
|
18
|
+
const initials = children || fallback;
|
|
19
|
+
return /*#__PURE__*/ jsx(Box, {
|
|
20
|
+
className: clsx(sizeClass, className),
|
|
21
|
+
role: "img",
|
|
22
|
+
"aria-label": alt,
|
|
23
|
+
children: initials
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
const Avatar_Avatar = Avatar;
|
|
27
|
+
export { Avatar_Avatar as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Avatar } from './Avatar';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const avatar: Record<"medium" | "large" | "small" | "base" | "xlarge", string>;
|
|
2
|
+
export declare const avatarImage: string;
|
|
3
|
+
export declare const avatarWithImage: Record<"medium" | "large" | "small" | "xlarge", string>;
|
|
4
|
+
export declare const avatarWrapper: string;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { style, styleVariants } from "@vanilla-extract/css";
|
|
2
|
+
import { vars } from "../../styles/theme.css.js";
|
|
3
|
+
import { styleWithLayer } from "../../styles/utils.js";
|
|
4
|
+
const avatar = styleVariants({
|
|
5
|
+
base: {
|
|
6
|
+
display: 'inline-flex',
|
|
7
|
+
alignItems: 'center',
|
|
8
|
+
justifyContent: 'center',
|
|
9
|
+
backgroundColor: vars.colors.backgroundMuted,
|
|
10
|
+
color: vars.colors.textPrimary,
|
|
11
|
+
fontFamily: vars.fontFamily.body,
|
|
12
|
+
fontWeight: '500',
|
|
13
|
+
overflow: 'hidden',
|
|
14
|
+
userSelect: 'none',
|
|
15
|
+
textDecoration: 'none',
|
|
16
|
+
':focus-visible': {
|
|
17
|
+
outline: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
|
|
18
|
+
outlineOffset: '2px'
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
small: {
|
|
22
|
+
display: 'inline-flex',
|
|
23
|
+
alignItems: 'center',
|
|
24
|
+
justifyContent: 'center',
|
|
25
|
+
backgroundColor: vars.colors.backgroundMuted,
|
|
26
|
+
color: vars.colors.textPrimary,
|
|
27
|
+
fontFamily: vars.fontFamily.body,
|
|
28
|
+
fontWeight: '500',
|
|
29
|
+
overflow: 'hidden',
|
|
30
|
+
userSelect: 'none',
|
|
31
|
+
textDecoration: 'none',
|
|
32
|
+
width: '24px',
|
|
33
|
+
height: '24px',
|
|
34
|
+
fontSize: '12px',
|
|
35
|
+
borderRadius: '12px',
|
|
36
|
+
':focus-visible': {
|
|
37
|
+
outline: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
|
|
38
|
+
outlineOffset: '2px'
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
medium: {
|
|
42
|
+
display: 'inline-flex',
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
justifyContent: 'center',
|
|
45
|
+
backgroundColor: vars.colors.backgroundMuted,
|
|
46
|
+
color: vars.colors.textPrimary,
|
|
47
|
+
fontFamily: vars.fontFamily.body,
|
|
48
|
+
fontWeight: '500',
|
|
49
|
+
overflow: 'hidden',
|
|
50
|
+
userSelect: 'none',
|
|
51
|
+
textDecoration: 'none',
|
|
52
|
+
width: '32px',
|
|
53
|
+
height: '32px',
|
|
54
|
+
fontSize: '14px',
|
|
55
|
+
borderRadius: '16px',
|
|
56
|
+
':focus-visible': {
|
|
57
|
+
outline: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
|
|
58
|
+
outlineOffset: '2px'
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
large: {
|
|
62
|
+
display: 'inline-flex',
|
|
63
|
+
alignItems: 'center',
|
|
64
|
+
justifyContent: 'center',
|
|
65
|
+
backgroundColor: vars.colors.backgroundMuted,
|
|
66
|
+
color: vars.colors.textPrimary,
|
|
67
|
+
fontFamily: vars.fontFamily.body,
|
|
68
|
+
fontWeight: '500',
|
|
69
|
+
overflow: 'hidden',
|
|
70
|
+
userSelect: 'none',
|
|
71
|
+
textDecoration: 'none',
|
|
72
|
+
width: '40px',
|
|
73
|
+
height: '40px',
|
|
74
|
+
fontSize: '16px',
|
|
75
|
+
borderRadius: '20px',
|
|
76
|
+
':focus-visible': {
|
|
77
|
+
outline: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
|
|
78
|
+
outlineOffset: '2px'
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
xlarge: {
|
|
82
|
+
display: 'inline-flex',
|
|
83
|
+
alignItems: 'center',
|
|
84
|
+
justifyContent: 'center',
|
|
85
|
+
backgroundColor: vars.colors.backgroundMuted,
|
|
86
|
+
color: vars.colors.textPrimary,
|
|
87
|
+
fontFamily: vars.fontFamily.body,
|
|
88
|
+
fontWeight: '500',
|
|
89
|
+
overflow: 'hidden',
|
|
90
|
+
userSelect: 'none',
|
|
91
|
+
textDecoration: 'none',
|
|
92
|
+
width: '64px',
|
|
93
|
+
height: '64px',
|
|
94
|
+
fontSize: '24px',
|
|
95
|
+
borderRadius: '32px',
|
|
96
|
+
':focus-visible': {
|
|
97
|
+
outline: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
|
|
98
|
+
outlineOffset: '2px'
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
const avatarImage = style({
|
|
103
|
+
width: '100%',
|
|
104
|
+
height: '100%',
|
|
105
|
+
objectFit: 'cover'
|
|
106
|
+
});
|
|
107
|
+
const avatarWithImage = styleVariants({
|
|
108
|
+
small: {
|
|
109
|
+
width: '24px',
|
|
110
|
+
height: '24px',
|
|
111
|
+
borderRadius: '12px',
|
|
112
|
+
overflow: 'hidden',
|
|
113
|
+
':focus-visible': {
|
|
114
|
+
outline: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
|
|
115
|
+
outlineOffset: '2px'
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
medium: {
|
|
119
|
+
width: '32px',
|
|
120
|
+
height: '32px',
|
|
121
|
+
borderRadius: '16px',
|
|
122
|
+
overflow: 'hidden',
|
|
123
|
+
':focus-visible': {
|
|
124
|
+
outline: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
|
|
125
|
+
outlineOffset: '2px'
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
large: {
|
|
129
|
+
width: '40px',
|
|
130
|
+
height: '40px',
|
|
131
|
+
borderRadius: '20px',
|
|
132
|
+
overflow: 'hidden',
|
|
133
|
+
':focus-visible': {
|
|
134
|
+
outline: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
|
|
135
|
+
outlineOffset: '2px'
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
xlarge: {
|
|
139
|
+
width: '64px',
|
|
140
|
+
height: '64px',
|
|
141
|
+
borderRadius: '32px',
|
|
142
|
+
overflow: 'hidden',
|
|
143
|
+
':focus-visible': {
|
|
144
|
+
outline: `2px solid ${vars.colors.buttonBackgroundPrimary}`,
|
|
145
|
+
outlineOffset: '2px'
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
const avatarWrapper = styleWithLayer({
|
|
150
|
+
display: 'inline-flex'
|
|
151
|
+
});
|
|
152
|
+
export { avatar, avatarImage, avatarWithImage, avatarWrapper };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type BadgeVariant = 'default' | 'success' | 'warning' | 'error' | 'info';
|
|
3
|
+
export type BadgeSize = 'small' | 'medium' | 'large';
|
|
4
|
+
export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
5
|
+
variant?: BadgeVariant;
|
|
6
|
+
size?: BadgeSize;
|
|
7
|
+
dot?: boolean;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare const Badge: ({ variant, size, dot, children, ...props }: BadgeProps) => React.JSX.Element;
|
|
11
|
+
export default Badge;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { badge, badgeDot, badgeDotSizes, badgeSizes, badgeVariants } from "./styles.css.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import Box from "../Box/index.js";
|
|
6
|
+
const Badge = ({ variant = 'default', size = 'medium', dot = false, children, ...props })=>/*#__PURE__*/ jsx(Box, {
|
|
7
|
+
as: "span",
|
|
8
|
+
className: clsx(badge, badgeVariants[variant], dot ? badgeDot : badgeSizes[size], dot && badgeDotSizes[size], props.className),
|
|
9
|
+
...props,
|
|
10
|
+
children: dot ? null : children
|
|
11
|
+
});
|
|
12
|
+
const Badge_Badge = Badge;
|
|
13
|
+
export { Badge_Badge as default };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const badgeVariants: Record<"default" | "success" | "warning" | "error" | "info", string>;
|
|
2
|
+
export declare const badgeSizes: Record<"medium" | "large" | "small", string>;
|
|
3
|
+
export declare const badge: string;
|
|
4
|
+
export declare const badgeDot: string;
|
|
5
|
+
export declare const badgeDotSizes: Record<"medium" | "large" | "small", string>;
|