@jordan-mace/chaser-design-system 1.2.8 → 1.2.9
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/index.d.mts +1834 -0
- package/dist/index.mjs +4729 -0
- package/dist/styles/layers.css.d.mts +6 -0
- package/dist/styles/layers.css.mjs +7 -0
- package/dist/styles/reset.css.d.mts +1 -0
- package/dist/styles/reset.css.mjs +24 -0
- package/dist/styles/sprinkles.css.d.mts +246 -0
- package/dist/styles/sprinkles.css.mjs +200 -0
- package/dist/styles/theme.css.d.mts +41 -0
- package/dist/styles/theme.css.mjs +50 -0
- package/package.json +18 -9
- package/src/components/Box/reset.css.ts +2 -2
- package/src/index.ts +6 -1
- package/dist/components/Accordion/Accordion.d.ts +0 -15
- package/dist/components/Accordion/Accordion.js +0 -43
- package/dist/components/Accordion/index.d.ts +0 -1
- package/dist/components/Accordion/index.js +0 -1
- package/dist/components/Accordion/styles.css.d.ts +0 -7
- package/dist/components/Accordion/styles.css.js +0 -65
- package/dist/components/Alert/Alert.d.ts +0 -10
- package/dist/components/Alert/Alert.js +0 -8
- package/dist/components/Alert/index.d.ts +0 -1
- package/dist/components/Alert/index.js +0 -1
- package/dist/components/Alert/styles.css.d.ts +0 -4
- package/dist/components/Alert/styles.css.js +0 -54
- package/dist/components/AspectRatio/AspectRatio.d.ts +0 -9
- package/dist/components/AspectRatio/AspectRatio.js +0 -12
- package/dist/components/AspectRatio/index.d.ts +0 -2
- package/dist/components/AspectRatio/index.js +0 -1
- package/dist/components/Avatar/Avatar.d.ts +0 -11
- package/dist/components/Avatar/Avatar.js +0 -13
- package/dist/components/Avatar/index.d.ts +0 -1
- package/dist/components/Avatar/index.js +0 -1
- package/dist/components/Avatar/styles.css.d.ts +0 -4
- package/dist/components/Avatar/styles.css.js +0 -151
- package/dist/components/Badge/Badge.d.ts +0 -12
- package/dist/components/Badge/Badge.js +0 -8
- package/dist/components/Badge/index.d.ts +0 -2
- package/dist/components/Badge/index.js +0 -1
- package/dist/components/Badge/styles.css.d.ts +0 -5
- package/dist/components/Badge/styles.css.js +0 -77
- package/dist/components/Box/Box.d.ts +0 -11
- package/dist/components/Box/Box.js +0 -54
- package/dist/components/Box/index.d.ts +0 -2
- package/dist/components/Box/index.js +0 -1
- package/dist/components/Box/reset.css.d.ts +0 -1
- package/dist/components/Box/reset.css.js +0 -15
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +0 -13
- package/dist/components/Breadcrumb/Breadcrumb.js +0 -8
- package/dist/components/Breadcrumb/index.d.ts +0 -1
- package/dist/components/Breadcrumb/index.js +0 -1
- package/dist/components/Breadcrumb/styles.css.d.ts +0 -6
- package/dist/components/Breadcrumb/styles.css.js +0 -50
- package/dist/components/Button/Button.d.ts +0 -10
- package/dist/components/Button/Button.js +0 -8
- package/dist/components/Button/index.d.ts +0 -1
- package/dist/components/Button/index.js +0 -1
- package/dist/components/Button/styles.css.d.ts +0 -2
- package/dist/components/Button/styles.css.js +0 -30
- package/dist/components/Card/Card.d.ts +0 -9
- package/dist/components/Card/Card.js +0 -8
- package/dist/components/Card/index.d.ts +0 -1
- package/dist/components/Card/index.js +0 -1
- package/dist/components/Card/styles.css.d.ts +0 -2
- package/dist/components/Card/styles.css.js +0 -25
- package/dist/components/Checkbox/Checkbox.d.ts +0 -151
- package/dist/components/Checkbox/Checkbox.js +0 -25
- package/dist/components/Checkbox/index.d.ts +0 -1
- package/dist/components/Checkbox/index.js +0 -1
- package/dist/components/Checkbox/styles.css.d.ts +0 -3
- package/dist/components/Checkbox/styles.css.js +0 -31
- package/dist/components/Collapse/Collapse.d.ts +0 -12
- package/dist/components/Collapse/Collapse.js +0 -56
- package/dist/components/Collapse/index.d.ts +0 -2
- package/dist/components/Collapse/index.js +0 -1
- package/dist/components/Collapse/styles.css.d.ts +0 -3
- package/dist/components/Collapse/styles.css.js +0 -36
- package/dist/components/Combobox/Combobox.d.ts +0 -24
- package/dist/components/Combobox/Combobox.js +0 -111
- package/dist/components/Combobox/index.d.ts +0 -2
- package/dist/components/Combobox/index.js +0 -1
- package/dist/components/Combobox/styles.css.d.ts +0 -13
- package/dist/components/Combobox/styles.css.js +0 -142
- package/dist/components/Container/Container.d.ts +0 -163
- package/dist/components/Container/Container.js +0 -21
- package/dist/components/Container/index.d.ts +0 -2
- package/dist/components/Container/index.js +0 -1
- package/dist/components/Divider/Divider.d.ts +0 -10
- package/dist/components/Divider/Divider.js +0 -10
- package/dist/components/Divider/index.d.ts +0 -2
- package/dist/components/Divider/index.js +0 -1
- package/dist/components/Divider/styles.css.d.ts +0 -4
- package/dist/components/Divider/styles.css.js +0 -41
- package/dist/components/Drawer/Drawer.d.ts +0 -18
- package/dist/components/Drawer/Drawer.js +0 -65
- package/dist/components/Drawer/index.d.ts +0 -2
- package/dist/components/Drawer/index.js +0 -1
- package/dist/components/Drawer/styles.css.d.ts +0 -8
- package/dist/components/Drawer/styles.css.js +0 -125
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +0 -24
- package/dist/components/DropdownMenu/DropdownMenu.js +0 -46
- package/dist/components/DropdownMenu/index.d.ts +0 -2
- package/dist/components/DropdownMenu/index.js +0 -1
- package/dist/components/DropdownMenu/styles.css.d.ts +0 -9
- package/dist/components/DropdownMenu/styles.css.js +0 -93
- package/dist/components/EmptyState/EmptyState.d.ts +0 -10
- package/dist/components/EmptyState/EmptyState.js +0 -8
- package/dist/components/EmptyState/index.d.ts +0 -2
- package/dist/components/EmptyState/index.js +0 -1
- package/dist/components/EmptyState/styles.css.d.ts +0 -5
- package/dist/components/EmptyState/styles.css.js +0 -30
- package/dist/components/FileUpload/FileUpload.d.ts +0 -28
- package/dist/components/FileUpload/FileUpload.js +0 -106
- package/dist/components/FileUpload/index.d.ts +0 -2
- package/dist/components/FileUpload/index.js +0 -1
- package/dist/components/FileUpload/styles.css.d.ts +0 -19
- package/dist/components/FileUpload/styles.css.js +0 -145
- package/dist/components/Form/Form.d.ts +0 -7
- package/dist/components/Form/Form.js +0 -8
- package/dist/components/Form/FormInput.d.ts +0 -5
- package/dist/components/Form/FormInput.js +0 -9
- package/dist/components/Form/index.d.ts +0 -2
- package/dist/components/Form/index.js +0 -2
- package/dist/components/Form/styles.css.d.ts +0 -2
- package/dist/components/Form/styles.css.js +0 -11
- package/dist/components/Grid/Grid.d.ts +0 -162
- package/dist/components/Grid/Grid.js +0 -25
- package/dist/components/Grid/index.d.ts +0 -2
- package/dist/components/Grid/index.js +0 -1
- package/dist/components/Icon/Icon.d.ts +0 -12
- package/dist/components/Icon/Icon.js +0 -21
- package/dist/components/Icon/index.d.ts +0 -1
- package/dist/components/Icon/index.js +0 -1
- package/dist/components/Icon/styles.css.d.ts +0 -1
- package/dist/components/Icon/styles.css.js +0 -9
- package/dist/components/Input/Input.d.ts +0 -8
- package/dist/components/Input/Input.js +0 -9
- package/dist/components/Input/index.d.ts +0 -1
- package/dist/components/Input/index.js +0 -1
- package/dist/components/Input/styles.css.d.ts +0 -2
- package/dist/components/Input/styles.css.js +0 -8
- package/dist/components/Kbd/Kbd.d.ts +0 -7
- package/dist/components/Kbd/Kbd.js +0 -6
- package/dist/components/Kbd/index.d.ts +0 -2
- package/dist/components/Kbd/index.js +0 -1
- package/dist/components/Kbd/styles.css.d.ts +0 -1
- package/dist/components/Kbd/styles.css.js +0 -16
- package/dist/components/List/List.d.ts +0 -6
- package/dist/components/List/List.js +0 -7
- package/dist/components/List/ListItem.d.ts +0 -6
- package/dist/components/List/ListItem.js +0 -7
- package/dist/components/List/index.d.ts +0 -2
- package/dist/components/List/index.js +0 -2
- package/dist/components/List/styles.css.d.ts +0 -2
- package/dist/components/List/styles.css.js +0 -11
- package/dist/components/Modal/Modal.d.ts +0 -15
- package/dist/components/Modal/Modal.js +0 -35
- package/dist/components/Modal/index.d.ts +0 -2
- package/dist/components/Modal/index.js +0 -1
- package/dist/components/Modal/styles.css.d.ts +0 -7
- package/dist/components/Modal/styles.css.js +0 -92
- package/dist/components/Navbar/Navbar.d.ts +0 -7
- package/dist/components/Navbar/Navbar.js +0 -8
- package/dist/components/Navbar/NavbarItem.d.ts +0 -7
- package/dist/components/Navbar/NavbarItem.js +0 -8
- package/dist/components/Navbar/index.d.ts +0 -2
- package/dist/components/Navbar/index.js +0 -2
- package/dist/components/Navbar/styles.css.d.ts +0 -2
- package/dist/components/Navbar/styles.css.js +0 -3
- package/dist/components/NumberInput/NumberInput.d.ts +0 -21
- package/dist/components/NumberInput/NumberInput.js +0 -39
- package/dist/components/NumberInput/index.d.ts +0 -2
- package/dist/components/NumberInput/index.js +0 -1
- package/dist/components/NumberInput/styles.css.d.ts +0 -10
- package/dist/components/NumberInput/styles.css.js +0 -117
- package/dist/components/Pagination/Pagination.d.ts +0 -12
- package/dist/components/Pagination/Pagination.js +0 -50
- package/dist/components/Pagination/index.d.ts +0 -2
- package/dist/components/Pagination/index.js +0 -1
- package/dist/components/Pagination/styles.css.d.ts +0 -4
- package/dist/components/Pagination/styles.css.js +0 -44
- package/dist/components/Popover/Popover.d.ts +0 -19
- package/dist/components/Popover/Popover.js +0 -56
- package/dist/components/Popover/index.d.ts +0 -2
- package/dist/components/Popover/index.js +0 -1
- package/dist/components/Popover/styles.css.d.ts +0 -11
- package/dist/components/Popover/styles.css.js +0 -185
- package/dist/components/Progress/Progress.d.ts +0 -11
- package/dist/components/Progress/Progress.js +0 -9
- package/dist/components/Progress/index.d.ts +0 -1
- package/dist/components/Progress/index.js +0 -1
- package/dist/components/Progress/styles.css.d.ts +0 -4
- package/dist/components/Progress/styles.css.js +0 -71
- package/dist/components/Radio/Radio.d.ts +0 -161
- package/dist/components/Radio/Radio.js +0 -25
- package/dist/components/Radio/index.d.ts +0 -1
- package/dist/components/Radio/index.js +0 -1
- package/dist/components/Radio/styles.css.d.ts +0 -5
- package/dist/components/Radio/styles.css.js +0 -42
- package/dist/components/ScrollArea/ScrollArea.d.ts +0 -11
- package/dist/components/ScrollArea/ScrollArea.js +0 -12
- package/dist/components/ScrollArea/index.d.ts +0 -2
- package/dist/components/ScrollArea/index.js +0 -1
- package/dist/components/ScrollArea/styles.css.d.ts +0 -3
- package/dist/components/ScrollArea/styles.css.js +0 -25
- package/dist/components/Select/Select.d.ts +0 -158
- package/dist/components/Select/Select.js +0 -10
- package/dist/components/Select/index.d.ts +0 -1
- package/dist/components/Select/index.js +0 -1
- package/dist/components/Select/styles.css.d.ts +0 -4
- package/dist/components/Select/styles.css.js +0 -82
- package/dist/components/Separator/Separator.d.ts +0 -9
- package/dist/components/Separator/Separator.js +0 -8
- package/dist/components/Separator/index.d.ts +0 -2
- package/dist/components/Separator/index.js +0 -1
- package/dist/components/Separator/styles.css.d.ts +0 -4
- package/dist/components/Separator/styles.css.js +0 -28
- package/dist/components/Skeleton/Skeleton.d.ts +0 -15
- package/dist/components/Skeleton/Skeleton.js +0 -13
- package/dist/components/Skeleton/index.d.ts +0 -2
- package/dist/components/Skeleton/index.js +0 -1
- package/dist/components/Skeleton/styles.css.d.ts +0 -4
- package/dist/components/Skeleton/styles.css.js +0 -56
- package/dist/components/Spinner/Spinner.d.ts +0 -11
- package/dist/components/Spinner/Spinner.js +0 -8
- package/dist/components/Spinner/index.d.ts +0 -2
- package/dist/components/Spinner/index.js +0 -1
- package/dist/components/Spinner/styles.css.d.ts +0 -4
- package/dist/components/Spinner/styles.css.js +0 -55
- package/dist/components/Stack/Stack.d.ts +0 -167
- package/dist/components/Stack/Stack.js +0 -24
- package/dist/components/Stack/index.d.ts +0 -2
- package/dist/components/Stack/index.js +0 -1
- package/dist/components/Stepper/Stepper.d.ts +0 -19
- package/dist/components/Stepper/Stepper.js +0 -25
- package/dist/components/Stepper/index.d.ts +0 -2
- package/dist/components/Stepper/index.js +0 -1
- package/dist/components/Stepper/styles.css.d.ts +0 -14
- package/dist/components/Stepper/styles.css.js +0 -104
- package/dist/components/Table/Table.d.ts +0 -41
- package/dist/components/Table/Table.js +0 -39
- package/dist/components/Table/index.d.ts +0 -1
- package/dist/components/Table/index.js +0 -1
- package/dist/components/Table/styles.css.d.ts +0 -8
- package/dist/components/Table/styles.css.js +0 -49
- package/dist/components/Tabs/Tabs.d.ts +0 -29
- package/dist/components/Tabs/Tabs.js +0 -52
- package/dist/components/Tabs/index.d.ts +0 -1
- package/dist/components/Tabs/index.js +0 -1
- package/dist/components/Tabs/styles.css.d.ts +0 -6
- package/dist/components/Tabs/styles.css.js +0 -100
- package/dist/components/Tag/Tag.d.ts +0 -16
- package/dist/components/Tag/Tag.js +0 -18
- package/dist/components/Tag/index.d.ts +0 -1
- package/dist/components/Tag/index.js +0 -1
- package/dist/components/Tag/styles.css.d.ts +0 -3
- package/dist/components/Tag/styles.css.js +0 -93
- package/dist/components/Text/Header.d.ts +0 -8
- package/dist/components/Text/Header.js +0 -8
- package/dist/components/Text/P.d.ts +0 -7
- package/dist/components/Text/P.js +0 -8
- package/dist/components/Text/index.d.ts +0 -2
- package/dist/components/Text/index.js +0 -2
- package/dist/components/Text/styles.css.d.ts +0 -2
- package/dist/components/Text/styles.css.js +0 -13
- package/dist/components/TextArea/TextArea.d.ts +0 -8
- package/dist/components/TextArea/TextArea.js +0 -9
- package/dist/components/TextArea/index.d.ts +0 -2
- package/dist/components/TextArea/index.js +0 -1
- package/dist/components/TextArea/styles.css.d.ts +0 -2
- package/dist/components/TextArea/styles.css.js +0 -10
- package/dist/components/Toast/Toast.d.ts +0 -34
- package/dist/components/Toast/Toast.js +0 -177
- package/dist/components/Toast/index.d.ts +0 -1
- package/dist/components/Toast/index.js +0 -1
- package/dist/components/Toast/styles.css.d.ts +0 -21
- package/dist/components/Toast/styles.css.js +0 -192
- package/dist/components/Toggle/Toggle.d.ts +0 -11
- package/dist/components/Toggle/Toggle.js +0 -17
- package/dist/components/Toggle/index.d.ts +0 -2
- package/dist/components/Toggle/index.js +0 -1
- package/dist/components/Toggle/styles.css.d.ts +0 -12
- package/dist/components/Toggle/styles.css.js +0 -118
- package/dist/components/Tooltip/Tooltip.d.ts +0 -11
- package/dist/components/Tooltip/Tooltip.js +0 -16
- package/dist/components/Tooltip/index.d.ts +0 -2
- package/dist/components/Tooltip/index.js +0 -1
- package/dist/components/Tooltip/styles.css.d.ts +0 -8
- package/dist/components/Tooltip/styles.css.js +0 -86
- package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +0 -8
- package/dist/components/VisuallyHidden/VisuallyHidden.js +0 -9
- package/dist/components/VisuallyHidden/index.d.ts +0 -2
- package/dist/components/VisuallyHidden/index.js +0 -1
- package/dist/components/VisuallyHidden/styles.css.d.ts +0 -1
- package/dist/components/VisuallyHidden/styles.css.js +0 -12
- package/dist/components/index.d.ts +0 -68
- package/dist/components/index.js +0 -47
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/styles/layers.css.d.ts +0 -3
- package/dist/styles/layers.css.js +0 -3
- package/dist/styles/sprinkles.css.d.ts +0 -241
- package/dist/styles/sprinkles.css.js +0 -165
- package/dist/styles/theme.css.d.ts +0 -38
- package/dist/styles/theme.css.js +0 -51
- package/dist/styles/utils.d.ts +0 -2
- package/dist/styles/utils.js +0 -7
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jordan-mace/chaser-design-system",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
6
|
+
"*.css.mjs",
|
|
6
7
|
"*.css.js"
|
|
7
8
|
],
|
|
8
9
|
"repository": {
|
|
@@ -11,16 +12,24 @@
|
|
|
11
12
|
},
|
|
12
13
|
"exports": {
|
|
13
14
|
".": {
|
|
14
|
-
"types": "./dist/index.d.
|
|
15
|
-
"import": "./dist/index.
|
|
15
|
+
"types": "./dist/index.d.mts",
|
|
16
|
+
"import": "./dist/index.mjs"
|
|
16
17
|
},
|
|
17
18
|
"./layers.css": {
|
|
18
|
-
"types": "./dist/styles/layers.css.d.
|
|
19
|
-
"import": "./dist/styles/layers.css.
|
|
19
|
+
"types": "./dist/styles/layers.css.d.mts",
|
|
20
|
+
"import": "./dist/styles/layers.css.mjs"
|
|
21
|
+
},
|
|
22
|
+
"./reset.css": {
|
|
23
|
+
"types": "./dist/styles/reset.css.d.mts",
|
|
24
|
+
"import": "./dist/styles/reset.css.mjs"
|
|
20
25
|
},
|
|
21
26
|
"./theme.css": {
|
|
22
|
-
"types": "./dist/styles/theme.css.d.
|
|
23
|
-
"import": "./dist/styles/theme.css.
|
|
27
|
+
"types": "./dist/styles/theme.css.d.mts",
|
|
28
|
+
"import": "./dist/styles/theme.css.mjs"
|
|
29
|
+
},
|
|
30
|
+
"./sprinkles.css": {
|
|
31
|
+
"types": "./dist/styles/sprinkles.css.d.mts",
|
|
32
|
+
"import": "./dist/styles/sprinkles.css.mjs"
|
|
24
33
|
}
|
|
25
34
|
},
|
|
26
35
|
"files": [
|
|
@@ -75,8 +84,8 @@
|
|
|
75
84
|
"@rsbuild/core": "^1.6.14"
|
|
76
85
|
},
|
|
77
86
|
"scripts": {
|
|
78
|
-
"build": "
|
|
79
|
-
"dev": "
|
|
87
|
+
"build": "tsdown src/index.ts src/styles/layers.css.ts src/styles/reset.css.ts src/styles/theme.css.ts src/styles/sprinkles.css.ts --format esm --dts --clean",
|
|
88
|
+
"dev": "tsdown src/index.ts src/styles/layers.css.ts src/styles/reset.css.ts src/styles/theme.css.ts src/styles/sprinkles.css.ts --format esm --dts --watch",
|
|
80
89
|
"format": "prettier --write .",
|
|
81
90
|
"lint": "eslint .",
|
|
82
91
|
"test": "vitest --config=vitest.browser.config.ts",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { style } from '@vanilla-extract/css';
|
|
2
|
-
import {
|
|
2
|
+
import { resetLayer } from '../../styles/layers.css';
|
|
3
3
|
|
|
4
4
|
export const reset = style({
|
|
5
5
|
'@layer': {
|
|
6
|
-
[
|
|
6
|
+
[resetLayer]: {
|
|
7
7
|
margin: 0,
|
|
8
8
|
padding: 0,
|
|
9
9
|
border: 0,
|
package/src/index.ts
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Sprinkles } from '../../styles/sprinkles.css';
|
|
3
|
-
type AccordionProps = React.HTMLAttributes<HTMLDivElement> & Sprinkles & {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
allowMultiple?: boolean;
|
|
6
|
-
};
|
|
7
|
-
type AccordionItemProps = React.HTMLAttributes<HTMLDivElement> & Sprinkles & {
|
|
8
|
-
value: string;
|
|
9
|
-
title: string;
|
|
10
|
-
children: React.ReactNode;
|
|
11
|
-
};
|
|
12
|
-
declare const AccordionComponent: (({ children, allowMultiple, ...props }: AccordionProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
13
|
-
Item: ({ value, title, children, ...props }: AccordionItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
};
|
|
15
|
-
export default AccordionComponent;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
import { createContext, useContext, useState, useCallback } from 'react';
|
|
4
|
-
import { accordionItem, accordionHeader, accordionContent, accordionIcon, accordionIconExpanded, accordionGroup, } from './styles.css';
|
|
5
|
-
import Box from '../Box';
|
|
6
|
-
const AccordionContext = createContext({
|
|
7
|
-
allowMultiple: false,
|
|
8
|
-
expandedItems: new Set(),
|
|
9
|
-
toggleItem: () => { },
|
|
10
|
-
});
|
|
11
|
-
const Accordion = ({ children, allowMultiple = false, ...props }) => {
|
|
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)) {
|
|
17
|
-
newSet.delete(value);
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
if (allowMultiple) {
|
|
21
|
-
newSet.add(value);
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
return new Set([value]);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return newSet;
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
return (_jsx(AccordionContext.Provider, { value: { allowMultiple, expandedItems, toggleItem }, children: _jsx(Box, { className: clsx(accordionGroup, props.className), width: "100%", ...props, children: children }) }));
|
|
31
|
-
};
|
|
32
|
-
const AccordionItem = ({ value, title, children, ...props }) => {
|
|
33
|
-
const { expandedItems, toggleItem } = useContext(AccordionContext);
|
|
34
|
-
const isExpanded = expandedItems.has(value);
|
|
35
|
-
const toggleExpanded = useCallback(() => {
|
|
36
|
-
toggleItem(value);
|
|
37
|
-
}, [value, toggleItem]);
|
|
38
|
-
return (_jsxs(Box, { as: "div", className: clsx(accordionItem, props.className), width: "100%", marginBottom: "small", border: "small", borderRadius: "large", overflow: "hidden", ...props, children: [_jsxs(Box, { as: "button", onClick: toggleExpanded, className: accordionHeader, display: "flex", alignItems: "center", justifyContent: "space-between", padding: "small", cursor: "pointer", style: { userSelect: 'none' }, fontSize: "14px", fontWeight: "500", color: "c5-700", "aria-expanded": isExpanded, "aria-controls": `accordion-content-${value}`, children: [_jsx(Box, { as: "span", children: title }), _jsx(Box, { as: "span", className: clsx(accordionIcon, isExpanded && accordionIconExpanded), fontSize: "12px", display: "flex", alignItems: "center", justifyContent: "center", "aria-hidden": "true", children: "\u25BC" })] }), _jsx(Box, { as: "div", id: `accordion-content-${value}`, className: clsx(accordionContent[isExpanded ? 'expanded' : 'collapsed']), padding: "small", fontSize: "14px", color: "c5-700", role: "region", children: children })] }));
|
|
39
|
-
};
|
|
40
|
-
const AccordionComponent = Object.assign(Accordion, {
|
|
41
|
-
Item: AccordionItem,
|
|
42
|
-
});
|
|
43
|
-
export default AccordionComponent;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Accordion } from './Accordion';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Accordion } from './Accordion';
|
|
@@ -1,7 +0,0 @@
|
|
|
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;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { style, styleVariants } from '@vanilla-extract/css';
|
|
2
|
-
import { vars } from '../../styles/theme.css';
|
|
3
|
-
import { styleWithLayer } from '../../styles/utils';
|
|
4
|
-
export const accordion = styleWithLayer({
|
|
5
|
-
width: '100%',
|
|
6
|
-
fontFamily: vars.fontFamily.body,
|
|
7
|
-
});
|
|
8
|
-
export const accordionItem = style({
|
|
9
|
-
width: '100%',
|
|
10
|
-
marginBottom: '4px',
|
|
11
|
-
border: `1px solid ${vars.colors.borderDefault}`,
|
|
12
|
-
borderRadius: '8px',
|
|
13
|
-
overflow: 'hidden',
|
|
14
|
-
});
|
|
15
|
-
export 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
|
-
export 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
|
-
export const accordionIcon = style({
|
|
54
|
-
fontSize: '12px',
|
|
55
|
-
transition: 'transform 0.2s ease',
|
|
56
|
-
display: 'flex',
|
|
57
|
-
alignItems: 'center',
|
|
58
|
-
justifyContent: 'center',
|
|
59
|
-
});
|
|
60
|
-
export const accordionIconExpanded = style({
|
|
61
|
-
transform: 'rotate(180deg)',
|
|
62
|
-
});
|
|
63
|
-
export const accordionGroup = styleWithLayer({
|
|
64
|
-
width: '100%',
|
|
65
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Sprinkles } from '../../styles/sprinkles.css';
|
|
3
|
-
type AlertProps = React.HTMLAttributes<HTMLDivElement> & Sprinkles & {
|
|
4
|
-
severity?: 'success' | 'warning' | 'error' | 'info';
|
|
5
|
-
dismissible?: boolean;
|
|
6
|
-
onDismiss?: () => void;
|
|
7
|
-
children?: React.ReactNode;
|
|
8
|
-
};
|
|
9
|
-
declare const Alert: ({ severity, dismissible, onDismiss, children, ...props }: AlertProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export default Alert;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
import { alert, alertVariants, alertContent, alertDismissButton, } from './styles.css';
|
|
4
|
-
import Box from '../Box';
|
|
5
|
-
const Alert = ({ severity = 'info', dismissible = false, onDismiss, children, ...props }) => {
|
|
6
|
-
return (_jsxs(Box, { as: "div", role: "alert", className: clsx(alert, alertVariants[severity], props.className), ...props, children: [_jsx(Box, { as: "div", className: alertContent, children: children }), dismissible && onDismiss && (_jsx(Box, { as: "button", className: alertDismissButton, onClick: onDismiss, "aria-label": "Dismiss alert", type: "button", children: "\u00D7" }))] }));
|
|
7
|
-
};
|
|
8
|
-
export default Alert;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Alert } from './Alert';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Alert } from './Alert';
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { styleVariants } from '@vanilla-extract/css';
|
|
2
|
-
import { vars } from '../../styles/theme.css';
|
|
3
|
-
import { styleWithLayer } from '../../styles/utils';
|
|
4
|
-
export 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
|
-
export const 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
|
-
export const alertContent = styleWithLayer({
|
|
38
|
-
flex: 1,
|
|
39
|
-
});
|
|
40
|
-
export 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
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
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;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import Box from '../Box';
|
|
4
|
-
const AspectRatio = forwardRef(({ ratio = '1/1', children, ...props }, ref) => {
|
|
5
|
-
const aspectRatio = typeof ratio === 'number' ? ratio : ratio;
|
|
6
|
-
return (_jsx(Box, { ref: ref, position: "relative", style: {
|
|
7
|
-
aspectRatio,
|
|
8
|
-
overflow: 'hidden',
|
|
9
|
-
}, ...props, children: _jsx(Box, { position: "absolute", width: "100%", height: "100%", display: "flex", alignItems: "center", justifyContent: "center", children: children }) }));
|
|
10
|
-
});
|
|
11
|
-
AspectRatio.displayName = 'AspectRatio';
|
|
12
|
-
export default AspectRatio;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as AspectRatio } from './AspectRatio';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Sprinkles } from '../../styles/sprinkles.css';
|
|
3
|
-
type AvatarProps = React.HTMLAttributes<HTMLDivElement> & Sprinkles & {
|
|
4
|
-
alt?: 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) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export default Avatar;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
import { avatar, avatarImage, avatarWithImage, avatarWrapper, } from './styles.css';
|
|
4
|
-
import Box from '../Box';
|
|
5
|
-
const Avatar = ({ alt, className, src, size = 'medium', children, fallback, }) => {
|
|
6
|
-
const sizeClass = avatar[size];
|
|
7
|
-
if (src) {
|
|
8
|
-
return (_jsx(Box, { className: clsx(avatarWrapper, className), display: "inline", children: _jsx(Box, { as: "img", src: src, alt: alt || 'Avatar', className: clsx(avatarWithImage[size], avatarImage) }) }));
|
|
9
|
-
}
|
|
10
|
-
const initials = children || fallback;
|
|
11
|
-
return (_jsx(Box, { className: clsx(sizeClass, className), role: "img", "aria-label": alt, children: initials }));
|
|
12
|
-
};
|
|
13
|
-
export default Avatar;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Avatar } from './Avatar';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Avatar } from './Avatar';
|
|
@@ -1,4 +0,0 @@
|
|
|
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;
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { style, styleVariants } from '@vanilla-extract/css';
|
|
2
|
-
import { vars } from '../../styles/theme.css';
|
|
3
|
-
import { styleWithLayer } from '../../styles/utils';
|
|
4
|
-
export 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
|
-
export const avatarImage = style({
|
|
103
|
-
width: '100%',
|
|
104
|
-
height: '100%',
|
|
105
|
-
objectFit: 'cover',
|
|
106
|
-
});
|
|
107
|
-
export 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
|
-
export const avatarWrapper = styleWithLayer({
|
|
150
|
-
display: 'inline-flex',
|
|
151
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Sprinkles } from '../../styles/sprinkles.css';
|
|
3
|
-
export type BadgeVariant = 'default' | 'success' | 'warning' | 'error' | 'info';
|
|
4
|
-
export type BadgeSize = 'small' | 'medium' | 'large';
|
|
5
|
-
export type BadgeProps = React.HTMLAttributes<HTMLSpanElement> & Sprinkles & {
|
|
6
|
-
variant?: BadgeVariant;
|
|
7
|
-
size?: BadgeSize;
|
|
8
|
-
dot?: boolean;
|
|
9
|
-
children?: React.ReactNode;
|
|
10
|
-
};
|
|
11
|
-
declare const Badge: ({ variant, size, dot, children, ...props }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export default Badge;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
import { badge, badgeVariants, badgeSizes, badgeDot, badgeDotSizes, } from './styles.css';
|
|
4
|
-
import Box from '../Box';
|
|
5
|
-
const Badge = ({ variant = 'default', size = 'medium', dot = false, children, ...props }) => {
|
|
6
|
-
return (_jsx(Box, { as: "span", className: clsx(badge, badgeVariants[variant], dot ? badgeDot : badgeSizes[size], dot && badgeDotSizes[size], props.className), ...props, children: dot ? null : children }));
|
|
7
|
-
};
|
|
8
|
-
export default Badge;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Badge } from './Badge';
|
|
@@ -1,5 +0,0 @@
|
|
|
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>;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { styleVariants } from '@vanilla-extract/css';
|
|
2
|
-
import { vars } from '../../styles/theme.css';
|
|
3
|
-
import { styleWithLayer } from '../../styles/utils';
|
|
4
|
-
export const badgeVariants = styleVariants({
|
|
5
|
-
default: {
|
|
6
|
-
backgroundColor: vars.colors.borderDefault,
|
|
7
|
-
color: vars.colors.textPrimary,
|
|
8
|
-
},
|
|
9
|
-
success: {
|
|
10
|
-
backgroundColor: vars.colors.alertSuccessBackground,
|
|
11
|
-
color: vars.colors.alertSuccessText,
|
|
12
|
-
border: `1px solid ${vars.colors.alertSuccessBorder}`,
|
|
13
|
-
},
|
|
14
|
-
warning: {
|
|
15
|
-
backgroundColor: vars.colors.alertWarningBackground,
|
|
16
|
-
color: vars.colors.alertWarningText,
|
|
17
|
-
border: `1px solid ${vars.colors.alertWarningBorder}`,
|
|
18
|
-
},
|
|
19
|
-
error: {
|
|
20
|
-
backgroundColor: vars.colors.alertErrorBackground,
|
|
21
|
-
color: vars.colors.alertErrorText,
|
|
22
|
-
border: `1px solid ${vars.colors.alertErrorBorder}`,
|
|
23
|
-
},
|
|
24
|
-
info: {
|
|
25
|
-
backgroundColor: vars.colors.alertInfoBackground,
|
|
26
|
-
color: vars.colors.alertInfoText,
|
|
27
|
-
border: `1px solid ${vars.colors.alertInfoBorder}`,
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
export const badgeSizes = styleVariants({
|
|
31
|
-
small: {
|
|
32
|
-
fontSize: '0.7rem',
|
|
33
|
-
padding: '0.125rem 0.375rem',
|
|
34
|
-
borderRadius: '0.25rem',
|
|
35
|
-
},
|
|
36
|
-
medium: {
|
|
37
|
-
fontSize: '0.75rem',
|
|
38
|
-
padding: '0.25rem 0.5rem',
|
|
39
|
-
borderRadius: '0.375rem',
|
|
40
|
-
},
|
|
41
|
-
large: {
|
|
42
|
-
fontSize: '0.875rem',
|
|
43
|
-
padding: '0.375rem 0.625rem',
|
|
44
|
-
borderRadius: '0.5rem',
|
|
45
|
-
},
|
|
46
|
-
});
|
|
47
|
-
export const badge = styleWithLayer({
|
|
48
|
-
display: 'inline-flex',
|
|
49
|
-
alignItems: 'center',
|
|
50
|
-
justifyContent: 'center',
|
|
51
|
-
fontWeight: '500',
|
|
52
|
-
whiteSpace: 'nowrap',
|
|
53
|
-
fontFamily: vars.fontFamily.body,
|
|
54
|
-
transition: 'background-color 0.2s ease-in-out, color 0.2s ease-in-out, border-color 0.2s ease-in-out',
|
|
55
|
-
});
|
|
56
|
-
export const badgeDot = styleWithLayer({
|
|
57
|
-
width: '0.5rem',
|
|
58
|
-
height: '0.5rem',
|
|
59
|
-
borderRadius: '50%',
|
|
60
|
-
display: 'inline-block',
|
|
61
|
-
padding: 0,
|
|
62
|
-
minWidth: 'auto',
|
|
63
|
-
});
|
|
64
|
-
export const badgeDotSizes = styleVariants({
|
|
65
|
-
small: {
|
|
66
|
-
width: '0.375rem',
|
|
67
|
-
height: '0.375rem',
|
|
68
|
-
},
|
|
69
|
-
medium: {
|
|
70
|
-
width: '0.5rem',
|
|
71
|
-
height: '0.5rem',
|
|
72
|
-
},
|
|
73
|
-
large: {
|
|
74
|
-
width: '0.625rem',
|
|
75
|
-
height: '0.625rem',
|
|
76
|
-
},
|
|
77
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type Sprinkles } from '../../styles/sprinkles.css';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
type BoxProps = Sprinkles & {
|
|
4
|
-
as?: React.ElementType;
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
className?: string;
|
|
7
|
-
[key: string]: unknown;
|
|
8
|
-
};
|
|
9
|
-
declare const Box: React.ForwardRefExoticComponent<Omit<BoxProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
10
|
-
export default Box;
|
|
11
|
-
export type { BoxProps };
|