doom-design-system 0.1.7 → 0.1.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/README.md +23 -20
- package/dist/DesignSystemProvider.d.ts +1 -0
- package/dist/DesignSystemProvider.js +3 -4
- package/dist/components/Accordion/Accordion.js +5 -63
- package/dist/components/Accordion/Accordion.module.css +69 -0
- package/dist/components/ActionRow/ActionRow.js +3 -28
- package/dist/components/ActionRow/ActionRow.module.css +24 -0
- package/dist/components/Alert/Alert.js +3 -58
- package/dist/components/Alert/Alert.module.css +77 -0
- package/dist/components/Avatar/Avatar.js +3 -45
- package/dist/components/Avatar/Avatar.module.css +67 -0
- package/dist/components/Badge/Badge.d.ts +1 -1
- package/dist/components/Badge/Badge.js +4 -42
- package/dist/components/Badge/Badge.module.css +31 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +6 -38
- package/dist/components/Breadcrumbs/Breadcrumbs.module.css +34 -0
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.js +5 -129
- package/dist/components/Button/Button.module.css +112 -0
- package/dist/components/Card/Card.d.ts +1 -1
- package/dist/components/Card/Card.js +4 -13
- package/dist/components/Card/Card.module.css +8 -0
- package/dist/components/Drawer/Drawer.js +5 -71
- package/dist/components/Drawer/Drawer.module.css +75 -0
- package/dist/components/Dropdown/Dropdown.d.ts +2 -1
- package/dist/components/Dropdown/Dropdown.js +6 -39
- package/dist/components/Dropdown/Dropdown.module.css +33 -0
- package/dist/components/Form/Form.d.ts +4 -9
- package/dist/components/Form/Form.js +9 -43
- package/dist/components/Form/Form.module.css +41 -0
- package/dist/components/Input/Input.js +3 -59
- package/dist/components/Input/Input.module.css +86 -0
- package/dist/components/Label/Label.d.ts +1 -1
- package/dist/components/Label/Label.js +4 -23
- package/dist/components/Label/Label.module.css +16 -0
- package/dist/components/Layout/Layout.d.ts +2 -2
- package/dist/components/Layout/Layout.js +5 -20
- package/dist/components/Layout/Layout.module.css +7 -0
- package/dist/components/Link/Link.d.ts +2 -1
- package/dist/components/Link/Link.js +4 -62
- package/dist/components/Link/Link.module.css +48 -0
- package/dist/components/Modal/Modal.js +9 -52
- package/dist/components/Modal/Modal.module.css +57 -0
- package/dist/components/Page/Page.js +3 -23
- package/dist/components/Page/Page.module.css +23 -0
- package/dist/components/Pagination/Pagination.js +4 -42
- package/dist/components/Pagination/Pagination.module.css +43 -0
- package/dist/components/Popover/Popover.js +21 -26
- package/dist/components/Popover/Popover.module.css +19 -0
- package/dist/components/ProgressBar/ProgressBar.js +7 -37
- package/dist/components/ProgressBar/ProgressBar.module.css +31 -0
- package/dist/components/RadioGroup/RadioGroup.js +4 -79
- package/dist/components/RadioGroup/RadioGroup.module.css +81 -0
- package/dist/components/Select/Select.js +6 -80
- package/dist/components/Select/Select.module.css +89 -0
- package/dist/components/Sheet/Sheet.js +5 -56
- package/dist/components/Sheet/Sheet.module.css +64 -0
- package/dist/components/Skeleton/Skeleton.js +4 -49
- package/dist/components/Skeleton/Skeleton.module.css +29 -0
- package/dist/components/Slider/Slider.js +3 -140
- package/dist/components/Slider/Slider.module.css +130 -0
- package/dist/components/SplitButton/SplitButton.d.ts +2 -1
- package/dist/components/SplitButton/SplitButton.js +6 -82
- package/dist/components/SplitButton/SplitButton.module.css +79 -0
- package/dist/components/Switch/Switch.js +3 -54
- package/dist/components/Switch/Switch.module.css +64 -0
- package/dist/components/Table/Table.d.ts +1 -1
- package/dist/components/Table/Table.js +13 -109
- package/dist/components/Table/Table.module.css +111 -0
- package/dist/components/Tabs/Tabs.js +7 -56
- package/dist/components/Tabs/Tabs.module.css +65 -0
- package/dist/components/Text/Text.js +4 -106
- package/dist/components/Text/Text.module.css +123 -0
- package/dist/components/Textarea/Textarea.d.ts +1 -1
- package/dist/components/Textarea/Textarea.js +16 -20
- package/dist/components/Textarea/Textarea.module.css +23 -0
- package/dist/components/Toast/Toast.js +3 -67
- package/dist/components/Toast/Toast.module.css +87 -0
- package/dist/components/Tooltip/Tooltip.js +3 -19
- package/dist/components/Tooltip/Tooltip.module.css +17 -0
- package/dist/styles/globals.css +788 -0
- package/dist/styles/themes/ThemeProvider.js +4 -9
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -5
- package/dist/styles/index.d.ts +0 -3
- package/dist/styles/index.js +0 -3
- package/dist/styles/mixins.d.ts +0 -3
- package/dist/styles/mixins.js +0 -25
- package/dist/styles/reset.d.ts +0 -1
- package/dist/styles/reset.js +0 -29
- package/dist/styles/theme.d.ts +0 -1
- package/dist/styles/theme.js +0 -11
- package/dist/styles/utilities.d.ts +0 -1
- package/dist/styles/utilities.js +0 -184
|
@@ -12,85 +12,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
};
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { useState, useRef, useEffect, useId } from 'react';
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
15
|
+
import clsx from 'clsx';
|
|
16
|
+
import { Text } from '../Text/Text';
|
|
17
|
+
import { Popover } from '../Popover/Popover';
|
|
18
18
|
import { Check, ChevronDown } from 'lucide-react';
|
|
19
|
-
|
|
20
|
-
display: flex;
|
|
21
|
-
flex-direction: column;
|
|
22
|
-
width: 100%;
|
|
23
|
-
position: relative;
|
|
24
|
-
`;
|
|
25
|
-
const SelectTrigger = styled.button `
|
|
26
|
-
width: 100%;
|
|
27
|
-
background: var(--card-bg);
|
|
28
|
-
color: var(--foreground);
|
|
29
|
-
padding: 0.75rem 1rem;
|
|
30
|
-
font-size: var(--text-base);
|
|
31
|
-
cursor: pointer;
|
|
32
|
-
display: flex;
|
|
33
|
-
justify-content: space-between;
|
|
34
|
-
align-items: center;
|
|
35
|
-
font-weight: 700;
|
|
36
|
-
text-transform: uppercase;
|
|
37
|
-
letter-spacing: 0.05em;
|
|
38
|
-
min-height: 42px;
|
|
39
|
-
|
|
40
|
-
${baseInteractiveStyles}
|
|
41
|
-
|
|
42
|
-
&:hover {
|
|
43
|
-
transform: translate(-2px, -2px);
|
|
44
|
-
box-shadow: var(--shadow-hover);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
${focusStyles}
|
|
48
|
-
`;
|
|
49
|
-
const OptionsList = styled.ul `
|
|
50
|
-
background: var(--card-bg);
|
|
51
|
-
border: var(--border-width) solid var(--primary);
|
|
52
|
-
border-radius: var(--radius);
|
|
53
|
-
box-shadow: none;
|
|
54
|
-
min-width: 200px;
|
|
55
|
-
max-height: 300px;
|
|
56
|
-
overflow-y: auto;
|
|
57
|
-
display: flex;
|
|
58
|
-
flex-direction: column;
|
|
59
|
-
gap: 0.25rem;
|
|
60
|
-
padding: 0.25rem;
|
|
61
|
-
margin: 0;
|
|
62
|
-
list-style: none;
|
|
63
|
-
`;
|
|
64
|
-
const OptionItem = styled.li `
|
|
65
|
-
text-align: left;
|
|
66
|
-
padding: 0.75rem 1rem;
|
|
67
|
-
background: ${props => props.isSelected ? 'var(--primary)' : (props.isHighlighted ? 'color-mix(in srgb, var(--primary), transparent 85%)' : 'transparent')};
|
|
68
|
-
border: none;
|
|
69
|
-
border-radius: calc(var(--radius) - 2px);
|
|
70
|
-
color: ${props => props.isSelected ? 'var(--primary-foreground)' : (props.isHighlighted ? 'var(--primary)' : 'var(--foreground)')};
|
|
71
|
-
cursor: pointer;
|
|
72
|
-
font-size: var(--text-base);
|
|
73
|
-
font-weight: ${props => props.isSelected ? '700' : '400'};
|
|
74
|
-
transition: all 0.1s ease;
|
|
75
|
-
width: 100%;
|
|
76
|
-
display: flex;
|
|
77
|
-
align-items: center;
|
|
78
|
-
justify-content: space-between;
|
|
79
|
-
user-select: none;
|
|
80
|
-
|
|
81
|
-
&:hover {
|
|
82
|
-
background-color: color-mix(in srgb, var(--primary), transparent 85%);
|
|
83
|
-
color: var(--primary);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
${props => props.isSelected && `
|
|
87
|
-
&:hover {
|
|
88
|
-
background-color: var(--primary);
|
|
89
|
-
color: var(--primary-foreground);
|
|
90
|
-
filter: brightness(1.1);
|
|
91
|
-
}
|
|
92
|
-
`}
|
|
93
|
-
`;
|
|
19
|
+
import styles from './Select.module.css';
|
|
94
20
|
export function Select(_a) {
|
|
95
21
|
var _b;
|
|
96
22
|
var { options, className, label, style, value, defaultValue, onChange, placeholder, id, required, disabled, name, form, autoFocus } = _a, props = __rest(_a, ["options", "className", "label", "style", "value", "defaultValue", "onChange", "placeholder", "id", "required", "disabled", "name", "form", "autoFocus"]);
|
|
@@ -174,10 +100,10 @@ export function Select(_a) {
|
|
|
174
100
|
break;
|
|
175
101
|
}
|
|
176
102
|
};
|
|
177
|
-
return (_jsxs(
|
|
103
|
+
return (_jsxs("div", { className: clsx(styles.container, className), style: style, children: [label && (_jsx(Text, { as: "label", id: labelId, variant: "small", weight: "bold", color: "muted", className: "mb-1 block", htmlFor: id, children: label })), _jsx(Popover, { isOpen: isOpen, onClose: () => setIsOpen(false), placement: "bottom-start", trigger: _jsxs("button", Object.assign({ ref: triggerRef, className: styles.trigger, type: "button", id: id, onClick: () => setIsOpen(!isOpen), onKeyDown: handleKeyDown, "aria-haspopup": "listbox", "aria-expanded": isOpen, "aria-controls": listboxId, "aria-labelledby": label ? labelId : undefined, disabled: disabled, autoFocus: autoFocus }, props, { children: [_jsx("span", { children: selectedOption ? selectedOption.label : (placeholder || 'Select...') }), _jsx(ChevronDown, { size: 16, strokeWidth: 2.5, style: { marginLeft: '0.5rem' } })] })), content: _jsx("ul", { id: listboxId, role: "listbox", "aria-labelledby": label ? labelId : undefined, className: styles.optionsList, style: { width: (_b = triggerRef.current) === null || _b === void 0 ? void 0 : _b.offsetWidth }, children: options.map((opt, index) => {
|
|
178
104
|
const isSelected = String(opt.value) === String(currentValue);
|
|
179
105
|
const isHighlighted = index === highlightedIndex;
|
|
180
|
-
return (_jsxs(
|
|
106
|
+
return (_jsxs("li", { id: `${listboxId}-option-${index}`, role: "option", "aria-selected": isSelected, className: clsx(styles.optionItem, isSelected && styles.selected, isHighlighted && styles.highlighted), onClick: () => handleSelect(opt.value), onMouseEnter: () => setHighlightedIndex(index), children: [_jsx("span", { children: opt.label }), isSelected && _jsx(Check, { size: 14, strokeWidth: 3 })] }, opt.value));
|
|
181
107
|
}) }) }), _jsx("input", { type: "text", name: name, value: currentValue, required: required, form: form, tabIndex: -1, readOnly: true, style: {
|
|
182
108
|
opacity: 0,
|
|
183
109
|
height: '1px',
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
width: 100%;
|
|
5
|
+
position: relative;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.trigger {
|
|
9
|
+
width: 100%;
|
|
10
|
+
background: var(--card-bg);
|
|
11
|
+
color: var(--foreground);
|
|
12
|
+
padding: 0.75rem 1rem;
|
|
13
|
+
font-size: var(--text-base);
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
display: flex;
|
|
16
|
+
justify-content: space-between;
|
|
17
|
+
align-items: center;
|
|
18
|
+
font-weight: 700;
|
|
19
|
+
text-transform: uppercase;
|
|
20
|
+
letter-spacing: 0.05em;
|
|
21
|
+
min-height: 42px;
|
|
22
|
+
border: var(--border-width) solid var(--card-border);
|
|
23
|
+
border-radius: var(--radius);
|
|
24
|
+
box-shadow: var(--shadow-hard);
|
|
25
|
+
transition: all 0.1s ease;
|
|
26
|
+
outline: none;
|
|
27
|
+
}
|
|
28
|
+
.trigger:hover {
|
|
29
|
+
transform: translate(-2px, -2px);
|
|
30
|
+
box-shadow: var(--shadow-hover);
|
|
31
|
+
}
|
|
32
|
+
.trigger:focus, .trigger:focus-visible, .trigger[aria-expanded=true] {
|
|
33
|
+
outline: none;
|
|
34
|
+
transform: translate(-2px, -2px);
|
|
35
|
+
box-shadow: 7px 7px 0px 0px var(--shadow-primary);
|
|
36
|
+
border-color: var(--primary);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.optionsList {
|
|
40
|
+
background: var(--card-bg);
|
|
41
|
+
border: var(--border-width) solid var(--primary);
|
|
42
|
+
border-radius: var(--radius);
|
|
43
|
+
box-shadow: none;
|
|
44
|
+
min-width: 200px;
|
|
45
|
+
max-height: 300px;
|
|
46
|
+
overflow-y: auto;
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
gap: 0.25rem;
|
|
50
|
+
padding: 0.25rem;
|
|
51
|
+
margin: 0;
|
|
52
|
+
list-style: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.optionItem {
|
|
56
|
+
text-align: left;
|
|
57
|
+
padding: 0.75rem 1rem;
|
|
58
|
+
background: transparent;
|
|
59
|
+
border: none;
|
|
60
|
+
border-radius: calc(var(--radius) - 2px);
|
|
61
|
+
color: var(--foreground);
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
font-size: var(--text-base);
|
|
64
|
+
font-weight: 400;
|
|
65
|
+
transition: all 0.1s ease;
|
|
66
|
+
width: 100%;
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
justify-content: space-between;
|
|
70
|
+
user-select: none;
|
|
71
|
+
}
|
|
72
|
+
.optionItem:hover {
|
|
73
|
+
background-color: color-mix(in srgb, var(--primary), transparent 85%);
|
|
74
|
+
color: var(--primary);
|
|
75
|
+
}
|
|
76
|
+
.optionItem.highlighted {
|
|
77
|
+
background: color-mix(in srgb, var(--primary), transparent 85%);
|
|
78
|
+
color: var(--primary);
|
|
79
|
+
}
|
|
80
|
+
.optionItem.selected {
|
|
81
|
+
background: var(--primary);
|
|
82
|
+
color: var(--primary-foreground);
|
|
83
|
+
font-weight: 700;
|
|
84
|
+
}
|
|
85
|
+
.optionItem.selected:hover {
|
|
86
|
+
background-color: var(--primary);
|
|
87
|
+
color: var(--primary-foreground);
|
|
88
|
+
filter: brightness(1.1);
|
|
89
|
+
}
|
|
@@ -2,62 +2,11 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useState } from 'react';
|
|
4
4
|
import { createPortal } from 'react-dom';
|
|
5
|
-
import
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import { Button } from '../Button/Button';
|
|
7
|
+
import { Flex } from '../Layout/Layout';
|
|
8
|
+
import styles from './Sheet.module.css';
|
|
6
9
|
import { X } from 'lucide-react';
|
|
7
|
-
import { Button } from '../Button';
|
|
8
|
-
import { Flex } from '../Layout';
|
|
9
|
-
const Overlay = styled.div `
|
|
10
|
-
position: fixed;
|
|
11
|
-
inset: 0;
|
|
12
|
-
background-color: rgba(0, 0, 0, var(--overlay-opacity));
|
|
13
|
-
backdrop-filter: blur(4px);
|
|
14
|
-
opacity: ${props => props.isOpen ? 1 : 0};
|
|
15
|
-
transition: opacity 0.2s ease-in-out;
|
|
16
|
-
pointer-events: ${props => props.isOpen ? 'auto' : 'none'};
|
|
17
|
-
z-index: var(--z-dropdown);
|
|
18
|
-
`;
|
|
19
|
-
const Panel = styled.div `
|
|
20
|
-
position: fixed;
|
|
21
|
-
bottom: 0;
|
|
22
|
-
left: 0;
|
|
23
|
-
right: 0;
|
|
24
|
-
max-height: 96vh;
|
|
25
|
-
min-height: 50vh;
|
|
26
|
-
background-color: var(--card-bg);
|
|
27
|
-
border-top: var(--border-width) solid var(--card-border);
|
|
28
|
-
border-left: var(--border-width) solid var(--card-border);
|
|
29
|
-
border-right: var(--border-width) solid var(--card-border);
|
|
30
|
-
border-top-left-radius: var(--radius);
|
|
31
|
-
border-top-right-radius: var(--radius);
|
|
32
|
-
box-shadow: var(--shadow-lg);
|
|
33
|
-
display: flex;
|
|
34
|
-
flex-direction: column;
|
|
35
|
-
z-index: var(--z-modal);
|
|
36
|
-
transform: ${props => props.isOpen ? 'translateY(0)' : 'translateY(100%)'};
|
|
37
|
-
transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
|
38
|
-
`;
|
|
39
|
-
const HandleBar = styled.div `
|
|
40
|
-
width: 48px;
|
|
41
|
-
height: 6px;
|
|
42
|
-
background-color: var(--card-border);
|
|
43
|
-
border-radius: 99px;
|
|
44
|
-
margin: 0.75rem auto;
|
|
45
|
-
opacity: 0.5;
|
|
46
|
-
`;
|
|
47
|
-
const Header = styled(Flex) `
|
|
48
|
-
padding: 0 var(--spacing-lg) var(--spacing-md) var(--spacing-lg);
|
|
49
|
-
`;
|
|
50
|
-
const Title = styled.h2 `
|
|
51
|
-
margin: 0;
|
|
52
|
-
font-family: var(--font-heading);
|
|
53
|
-
font-size: var(--text-xl);
|
|
54
|
-
font-weight: 700;
|
|
55
|
-
`;
|
|
56
|
-
const Content = styled.div `
|
|
57
|
-
flex: 1;
|
|
58
|
-
padding: 0 var(--spacing-lg) var(--spacing-lg) var(--spacing-lg);
|
|
59
|
-
overflow-y: auto;
|
|
60
|
-
`;
|
|
61
10
|
export function Sheet({ isOpen, onClose, title, children, className }) {
|
|
62
11
|
const [mounted, setMounted] = useState(false);
|
|
63
12
|
useEffect(() => {
|
|
@@ -83,5 +32,5 @@ export function Sheet({ isOpen, onClose, title, children, className }) {
|
|
|
83
32
|
}, [isOpen, onClose]);
|
|
84
33
|
if (!mounted)
|
|
85
34
|
return null;
|
|
86
|
-
return createPortal(_jsxs(_Fragment, { children: [_jsx(
|
|
35
|
+
return createPortal(_jsxs(_Fragment, { children: [_jsx("div", { className: clsx(styles.overlay, isOpen && styles.isOpen), onClick: onClose, "aria-hidden": "true" }), _jsxs("div", { className: clsx(styles.panel, isOpen && styles.isOpen, className), role: "dialog", "aria-modal": "true", children: [_jsx("div", { className: styles.handleBar }), _jsxs(Flex, { align: "center", justify: "space-between", className: styles.header, children: [_jsx("h2", { className: styles.title, children: title }), _jsx(Button, { variant: "ghost", size: "sm", onClick: onClose, "aria-label": "Close sheet", children: _jsx(X, { size: 24 }) })] }), _jsx("div", { className: styles.content, children: children })] })] }), document.body);
|
|
87
36
|
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
.overlay {
|
|
2
|
+
position: fixed;
|
|
3
|
+
inset: 0;
|
|
4
|
+
background-color: rgba(0, 0, 0, var(--overlay-opacity));
|
|
5
|
+
backdrop-filter: blur(4px);
|
|
6
|
+
opacity: 0;
|
|
7
|
+
transition: opacity 0.2s ease-in-out;
|
|
8
|
+
pointer-events: none;
|
|
9
|
+
z-index: var(--z-dropdown);
|
|
10
|
+
}
|
|
11
|
+
.overlay.isOpen {
|
|
12
|
+
opacity: 1;
|
|
13
|
+
pointer-events: auto;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.panel {
|
|
17
|
+
position: fixed;
|
|
18
|
+
bottom: 0;
|
|
19
|
+
left: 0;
|
|
20
|
+
right: 0;
|
|
21
|
+
max-height: 96vh;
|
|
22
|
+
min-height: 50vh;
|
|
23
|
+
background-color: var(--card-bg);
|
|
24
|
+
border-top: var(--border-width) solid var(--card-border);
|
|
25
|
+
border-left: var(--border-width) solid var(--card-border);
|
|
26
|
+
border-right: var(--border-width) solid var(--card-border);
|
|
27
|
+
border-top-left-radius: var(--radius);
|
|
28
|
+
border-top-right-radius: var(--radius);
|
|
29
|
+
box-shadow: var(--shadow-lg);
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
z-index: var(--z-modal);
|
|
33
|
+
transform: translateY(100%);
|
|
34
|
+
transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
|
35
|
+
}
|
|
36
|
+
.panel.isOpen {
|
|
37
|
+
transform: translateY(0);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.handleBar {
|
|
41
|
+
width: 48px;
|
|
42
|
+
height: 6px;
|
|
43
|
+
background-color: var(--card-border);
|
|
44
|
+
border-radius: 99px;
|
|
45
|
+
margin: 0.75rem auto;
|
|
46
|
+
opacity: 0.5;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.header {
|
|
50
|
+
padding: 0 var(--spacing-lg) var(--spacing-md) var(--spacing-lg);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.title {
|
|
54
|
+
margin: 0;
|
|
55
|
+
font-family: var(--font-heading);
|
|
56
|
+
font-size: var(--text-xl);
|
|
57
|
+
font-weight: 700;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.content {
|
|
61
|
+
flex: 1;
|
|
62
|
+
padding: 0 var(--spacing-lg) var(--spacing-lg) var(--spacing-lg);
|
|
63
|
+
overflow-y: auto;
|
|
64
|
+
}
|
|
@@ -11,55 +11,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
const shimmer = keyframes `
|
|
17
|
-
0% {
|
|
18
|
-
background-position: -200% 0;
|
|
19
|
-
}
|
|
20
|
-
100% {
|
|
21
|
-
background-position: 200% 0;
|
|
22
|
-
}
|
|
23
|
-
`;
|
|
24
|
-
const StyledSkeleton = styled.div `
|
|
25
|
-
background: linear-gradient(
|
|
26
|
-
90deg,
|
|
27
|
-
rgba(0, 0, 0, 0.06) 25%,
|
|
28
|
-
rgba(0, 0, 0, 0.12) 37%,
|
|
29
|
-
rgba(0, 0, 0, 0.06) 63%
|
|
30
|
-
);
|
|
31
|
-
background-size: 200% 100%;
|
|
32
|
-
animation: ${shimmer} 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
|
33
|
-
|
|
34
|
-
/* Dimensions */
|
|
35
|
-
width: ${props => props.$width || '100%'};
|
|
36
|
-
height: ${props => props.$height || 'auto'};
|
|
37
|
-
|
|
38
|
-
/* Variant Styles */
|
|
39
|
-
${props => {
|
|
40
|
-
switch (props.$variant) {
|
|
41
|
-
case 'circular':
|
|
42
|
-
return `
|
|
43
|
-
border-radius: 50%;
|
|
44
|
-
height: ${props.$height || props.$width || '3rem'};
|
|
45
|
-
width: ${props.$width || props.$height || '3rem'};
|
|
46
|
-
`;
|
|
47
|
-
case 'text':
|
|
48
|
-
return `
|
|
49
|
-
height: ${props.$height || '1em'};
|
|
50
|
-
border-radius: var(--radius);
|
|
51
|
-
margin-bottom: 0.5rem;
|
|
52
|
-
`;
|
|
53
|
-
case 'rectangular':
|
|
54
|
-
default:
|
|
55
|
-
return `
|
|
56
|
-
height: ${props.$height || '10rem'};
|
|
57
|
-
border-radius: var(--radius);
|
|
58
|
-
`;
|
|
59
|
-
}
|
|
60
|
-
}}
|
|
61
|
-
`;
|
|
14
|
+
import clsx from 'clsx';
|
|
15
|
+
import styles from './Skeleton.module.css';
|
|
62
16
|
export function Skeleton(_a) {
|
|
63
17
|
var { width, height, variant = 'rectangular', className, style } = _a, props = __rest(_a, ["width", "height", "variant", "className", "style"]);
|
|
64
|
-
|
|
18
|
+
const customStyle = Object.assign({ '--width': width, '--height': height }, style);
|
|
19
|
+
return (_jsx("div", Object.assign({ className: clsx(styles.skeleton, styles[variant], className), style: customStyle }, props)));
|
|
65
20
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
@keyframes shimmer {
|
|
2
|
+
0% {
|
|
3
|
+
background-position: -200% 0;
|
|
4
|
+
}
|
|
5
|
+
100% {
|
|
6
|
+
background-position: 200% 0;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
.skeleton {
|
|
10
|
+
background: linear-gradient(90deg, rgba(0, 0, 0, 0.06) 25%, rgba(0, 0, 0, 0.12) 37%, rgba(0, 0, 0, 0.06) 63%);
|
|
11
|
+
background-size: 200% 100%;
|
|
12
|
+
animation: shimmer 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
|
13
|
+
width: var(--width, 100%);
|
|
14
|
+
height: var(--height, auto);
|
|
15
|
+
}
|
|
16
|
+
.skeleton.text {
|
|
17
|
+
height: var(--height, 1em);
|
|
18
|
+
border-radius: var(--radius);
|
|
19
|
+
margin-bottom: 0.5rem;
|
|
20
|
+
}
|
|
21
|
+
.skeleton.circular {
|
|
22
|
+
border-radius: 50%;
|
|
23
|
+
height: var(--height, var(--width, 3rem));
|
|
24
|
+
width: var(--width, var(--height, 3rem));
|
|
25
|
+
}
|
|
26
|
+
.skeleton.rectangular {
|
|
27
|
+
height: var(--height, 10rem);
|
|
28
|
+
border-radius: var(--radius);
|
|
29
|
+
}
|
|
@@ -11,146 +11,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import clsx from 'clsx';
|
|
15
|
+
import styles from './Slider.module.css';
|
|
14
16
|
import React from 'react';
|
|
15
|
-
import styled from '@emotion/styled';
|
|
16
|
-
const SliderContainer = styled.div `
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
gap: 0.75rem;
|
|
20
|
-
width: 100%;
|
|
21
|
-
`;
|
|
22
|
-
const LabelRow = styled.div `
|
|
23
|
-
display: flex;
|
|
24
|
-
justify-content: space-between;
|
|
25
|
-
align-items: center;
|
|
26
|
-
font-family: var(--font-heading);
|
|
27
|
-
font-weight: 600;
|
|
28
|
-
font-size: var(--text-sm);
|
|
29
|
-
color: var(--foreground);
|
|
30
|
-
`;
|
|
31
|
-
const ValueDisplay = styled.span `
|
|
32
|
-
font-family: var(--font-mono, monospace);
|
|
33
|
-
font-weight: 700;
|
|
34
|
-
color: var(--primary);
|
|
35
|
-
font-size: var(--text-base);
|
|
36
|
-
min-width: 3ch;
|
|
37
|
-
text-align: right;
|
|
38
|
-
`;
|
|
39
|
-
const TrackWrapper = styled.div `
|
|
40
|
-
position: relative;
|
|
41
|
-
width: 100%;
|
|
42
|
-
height: 8px;
|
|
43
|
-
border-radius: 999px;
|
|
44
|
-
background: var(--muted);
|
|
45
|
-
overflow: visible;
|
|
46
|
-
`;
|
|
47
|
-
const ProgressFill = styled.div `
|
|
48
|
-
position: absolute;
|
|
49
|
-
left: 0;
|
|
50
|
-
top: 0;
|
|
51
|
-
height: 100%;
|
|
52
|
-
width: ${props => props.percentage}%;
|
|
53
|
-
background: var(--primary);
|
|
54
|
-
border-radius: 999px;
|
|
55
|
-
z-index: 1;
|
|
56
|
-
`;
|
|
57
|
-
const RangeInput = styled.input `
|
|
58
|
-
-webkit-appearance: none;
|
|
59
|
-
position: absolute;
|
|
60
|
-
top: 0;
|
|
61
|
-
left: 0;
|
|
62
|
-
width: 100%;
|
|
63
|
-
height: 100%;
|
|
64
|
-
background: transparent;
|
|
65
|
-
cursor: pointer;
|
|
66
|
-
margin: 0;
|
|
67
|
-
z-index: 10;
|
|
68
|
-
|
|
69
|
-
&::-webkit-slider-runnable-track {
|
|
70
|
-
width: 100%;
|
|
71
|
-
height: 8px;
|
|
72
|
-
background: transparent;
|
|
73
|
-
border: none;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
&::-moz-range-track {
|
|
77
|
-
width: 100%;
|
|
78
|
-
height: 8px;
|
|
79
|
-
background: transparent;
|
|
80
|
-
border: none;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
&::-webkit-slider-thumb {
|
|
84
|
-
-webkit-appearance: none;
|
|
85
|
-
height: 20px;
|
|
86
|
-
width: 20px;
|
|
87
|
-
background: var(--primary);
|
|
88
|
-
border: 3px solid var(--background);
|
|
89
|
-
border-radius: 50%;
|
|
90
|
-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 0 1px var(--card-border);
|
|
91
|
-
transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
|
|
92
|
-
margin-top: -6px;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
&::-moz-range-thumb {
|
|
96
|
-
height: 20px;
|
|
97
|
-
width: 20px;
|
|
98
|
-
background: var(--primary);
|
|
99
|
-
border: 3px solid var(--background);
|
|
100
|
-
border-radius: 50%;
|
|
101
|
-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 0 1px var(--card-border);
|
|
102
|
-
transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
&:hover::-webkit-slider-thumb {
|
|
106
|
-
transform: scale(1.15);
|
|
107
|
-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), 0 0 0 4px color-mix(in srgb, var(--primary) 20%, transparent);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
&:hover::-moz-range-thumb {
|
|
111
|
-
transform: scale(1.15);
|
|
112
|
-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), 0 0 0 4px color-mix(in srgb, var(--primary) 20%, transparent);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
&:active::-webkit-slider-thumb {
|
|
116
|
-
transform: scale(1.05);
|
|
117
|
-
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 0 0 6px color-mix(in srgb, var(--primary) 25%, transparent);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
&:active::-moz-range-thumb {
|
|
121
|
-
transform: scale(1.05);
|
|
122
|
-
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 0 0 6px color-mix(in srgb, var(--primary) 25%, transparent);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
&:focus {
|
|
126
|
-
outline: none;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
&:focus-visible::-webkit-slider-thumb {
|
|
130
|
-
outline: 2px solid var(--primary);
|
|
131
|
-
outline-offset: 2px;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
&:focus-visible::-moz-range-thumb {
|
|
135
|
-
outline: 2px solid var(--primary);
|
|
136
|
-
outline-offset: 2px;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
&:disabled {
|
|
140
|
-
cursor: not-allowed;
|
|
141
|
-
opacity: 0.5;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
&:disabled::-webkit-slider-thumb {
|
|
145
|
-
background: var(--muted-foreground);
|
|
146
|
-
cursor: not-allowed;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
&:disabled::-moz-range-thumb {
|
|
150
|
-
background: var(--muted-foreground);
|
|
151
|
-
cursor: not-allowed;
|
|
152
|
-
}
|
|
153
|
-
`;
|
|
154
17
|
export function Slider(_a) {
|
|
155
18
|
var { label, showValue, value, defaultValue, onChange, min = 0, max = 100, step = 1, className } = _a, props = __rest(_a, ["label", "showValue", "value", "defaultValue", "onChange", "min", "max", "step", "className"]);
|
|
156
19
|
const [internalValue, setInternalValue] = React.useState(defaultValue !== undefined ? defaultValue : min);
|
|
@@ -164,5 +27,5 @@ export function Slider(_a) {
|
|
|
164
27
|
onChange === null || onChange === void 0 ? void 0 : onChange(newVal);
|
|
165
28
|
};
|
|
166
29
|
const percentage = ((currentValue - min) / (max - min)) * 100;
|
|
167
|
-
return (_jsxs(
|
|
30
|
+
return (_jsxs("div", { className: clsx(styles.container, className), children: [(label || showValue) && (_jsxs("div", { className: styles.labelRow, children: [label && _jsx("span", { children: label }), showValue && _jsx("span", { className: styles.valueDisplay, children: currentValue })] })), _jsxs("div", { className: styles.trackWrapper, children: [_jsx("div", { className: styles.progressFill, style: { '--percentage': `${percentage}%` } }), _jsx("input", Object.assign({ className: styles.rangeInput, type: "range", min: min, max: max, step: step, value: currentValue, onChange: handleChange }, props))] })] }));
|
|
168
31
|
}
|