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
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
width: 100%;
|
|
3
|
+
border: var(--border-width) solid var(--card-border);
|
|
4
|
+
border-radius: var(--radius);
|
|
5
|
+
background: var(--card-bg);
|
|
6
|
+
box-shadow: var(--shadow-hard);
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
}
|
|
11
|
+
.container.flat {
|
|
12
|
+
border: none;
|
|
13
|
+
box-shadow: none;
|
|
14
|
+
background: transparent;
|
|
15
|
+
border-radius: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.toolbar {
|
|
19
|
+
padding: var(--spacing-md);
|
|
20
|
+
border-bottom: var(--border-width) solid var(--card-border);
|
|
21
|
+
background: var(--background);
|
|
22
|
+
display: flex;
|
|
23
|
+
justify-content: space-between;
|
|
24
|
+
align-items: center;
|
|
25
|
+
gap: 1rem;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.table {
|
|
29
|
+
width: 100%;
|
|
30
|
+
border-collapse: collapse;
|
|
31
|
+
font-size: var(--text-base);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.th {
|
|
35
|
+
text-align: left;
|
|
36
|
+
padding: 1rem;
|
|
37
|
+
background: var(--secondary);
|
|
38
|
+
border-bottom: var(--border-width) solid var(--card-border);
|
|
39
|
+
font-weight: 700;
|
|
40
|
+
text-transform: uppercase;
|
|
41
|
+
letter-spacing: 0.05em;
|
|
42
|
+
user-select: none;
|
|
43
|
+
white-space: nowrap;
|
|
44
|
+
color: var(--secondary-foreground);
|
|
45
|
+
}
|
|
46
|
+
.th.compact {
|
|
47
|
+
padding: 0.5rem 1rem;
|
|
48
|
+
}
|
|
49
|
+
.th.relaxed {
|
|
50
|
+
padding: 1.5rem 1rem;
|
|
51
|
+
}
|
|
52
|
+
.th.sortable {
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
}
|
|
55
|
+
.th.sortable:hover {
|
|
56
|
+
filter: brightness(0.95);
|
|
57
|
+
color: var(--secondary-foreground);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.td {
|
|
61
|
+
padding: 1rem;
|
|
62
|
+
border-bottom: 1px solid var(--card-border);
|
|
63
|
+
color: var(--foreground);
|
|
64
|
+
}
|
|
65
|
+
.td.compact {
|
|
66
|
+
padding: 0.5rem 1rem;
|
|
67
|
+
}
|
|
68
|
+
.td.relaxed {
|
|
69
|
+
padding: 1.5rem 1rem;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.tr:last-child td {
|
|
73
|
+
border-bottom: none;
|
|
74
|
+
}
|
|
75
|
+
.tr:hover {
|
|
76
|
+
background-color: rgba(113, 128, 150, 0.1);
|
|
77
|
+
}
|
|
78
|
+
.tr.striped:nth-of-type(even) {
|
|
79
|
+
background-color: rgba(113, 128, 150, 0.05);
|
|
80
|
+
}
|
|
81
|
+
.tr.striped:hover {
|
|
82
|
+
background-color: rgba(113, 128, 150, 0.15);
|
|
83
|
+
}
|
|
84
|
+
.tr .row-actions {
|
|
85
|
+
opacity: 0;
|
|
86
|
+
transition: opacity 0.2s ease-in-out;
|
|
87
|
+
}
|
|
88
|
+
.tr:hover .row-actions {
|
|
89
|
+
opacity: 1;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.paginationContainer {
|
|
93
|
+
padding: var(--spacing-md);
|
|
94
|
+
border-top: var(--border-width) solid var(--card-border);
|
|
95
|
+
background: var(--background);
|
|
96
|
+
display: flex;
|
|
97
|
+
justify-content: space-between;
|
|
98
|
+
align-items: center;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.noResults {
|
|
102
|
+
padding: 2rem;
|
|
103
|
+
text-align: center;
|
|
104
|
+
color: var(--muted-foreground);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.headerContent {
|
|
108
|
+
display: flex;
|
|
109
|
+
align-items: center;
|
|
110
|
+
gap: 0.5rem;
|
|
111
|
+
}
|
|
@@ -1,58 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import styles from './Tabs.module.css';
|
|
3
5
|
import { createContext, useContext, useState } from 'react';
|
|
4
|
-
import styled from '@emotion/styled';
|
|
5
|
-
import { keyframes } from '@emotion/react';
|
|
6
|
-
import { Flex } from '../Layout';
|
|
7
6
|
const TabsContext = createContext(null);
|
|
8
|
-
const fadeIn = keyframes `
|
|
9
|
-
from { opacity: 0; transform: translateY(5px); }
|
|
10
|
-
to { opacity: 1; transform: translateY(0); }
|
|
11
|
-
`;
|
|
12
|
-
const StyledTabsList = styled(Flex) `
|
|
13
|
-
margin-bottom: 0;
|
|
14
|
-
padding-left: var(--spacing-md);
|
|
15
|
-
position: relative;
|
|
16
|
-
`;
|
|
17
|
-
const StyledTabsTrigger = styled.button `
|
|
18
|
-
padding: 0.75rem 1.5rem;
|
|
19
|
-
font-size: 0.9rem;
|
|
20
|
-
font-weight: 700;
|
|
21
|
-
text-transform: uppercase;
|
|
22
|
-
letter-spacing: 0.05em;
|
|
23
|
-
background-color: var(--primary);
|
|
24
|
-
color: var(--primary-foreground);
|
|
25
|
-
opacity: ${props => props.isActive ? '1' : '0.6'};
|
|
26
|
-
border: var(--border-width) solid var(--card-border);
|
|
27
|
-
border-bottom: var(--border-width) solid var(--card-border);
|
|
28
|
-
border-radius: var(--radius) var(--radius) 0 0;
|
|
29
|
-
cursor: pointer;
|
|
30
|
-
position: relative;
|
|
31
|
-
z-index: ${props => props.isActive ? 'var(--z-elevated)' : '1'};
|
|
32
|
-
transition: all 0.2s ease;
|
|
33
|
-
transform: ${props => props.isActive ? 'translateY(0)' : 'translateY(4px)'};
|
|
34
|
-
|
|
35
|
-
&:hover {
|
|
36
|
-
${props => !props.isActive && `
|
|
37
|
-
opacity: 0.8;
|
|
38
|
-
transform: translateY(2px);
|
|
39
|
-
`}
|
|
40
|
-
}
|
|
41
|
-
`;
|
|
42
|
-
const StyledTabsBody = styled.div `
|
|
43
|
-
background: var(--card-bg);
|
|
44
|
-
border: var(--border-width) solid var(--card-border);
|
|
45
|
-
border-radius: var(--radius);
|
|
46
|
-
padding: 2.5rem;
|
|
47
|
-
box-shadow: var(--shadow-hard);
|
|
48
|
-
position: relative;
|
|
49
|
-
z-index: var(--z-elevated);
|
|
50
|
-
min-height: 600px;
|
|
51
|
-
margin-top: -3px;
|
|
52
|
-
`;
|
|
53
|
-
const StyledTabsContent = styled.div `
|
|
54
|
-
animation: ${fadeIn} 0.3s ease-out forwards;
|
|
55
|
-
`;
|
|
56
7
|
export function Tabs({ defaultValue, value, onValueChange, children, className }) {
|
|
57
8
|
const [internalActiveTab, setInternalActiveTab] = useState(defaultValue || '');
|
|
58
9
|
const isControlled = value !== undefined;
|
|
@@ -66,20 +17,20 @@ export function Tabs({ defaultValue, value, onValueChange, children, className }
|
|
|
66
17
|
return (_jsx(TabsContext.Provider, { value: { activeTab, setActiveTab }, children: _jsx("div", { className: className, children: children }) }));
|
|
67
18
|
}
|
|
68
19
|
export function TabsList({ children, className }) {
|
|
69
|
-
return _jsx(
|
|
20
|
+
return _jsx("div", { className: clsx(styles.tabsList, className), children: children });
|
|
70
21
|
}
|
|
71
22
|
export function TabsTrigger({ value, children, className, onClick }) {
|
|
72
23
|
const context = useContext(TabsContext);
|
|
73
24
|
if (!context)
|
|
74
25
|
throw new Error('TabsTrigger must be used within Tabs');
|
|
75
26
|
const isActive = context.activeTab === value;
|
|
76
|
-
return (_jsx(
|
|
27
|
+
return (_jsx("button", { className: clsx(styles.tabsTrigger, isActive && styles.active, className), onClick: () => {
|
|
77
28
|
context.setActiveTab(value);
|
|
78
29
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
79
|
-
},
|
|
30
|
+
}, children: children }));
|
|
80
31
|
}
|
|
81
32
|
export function TabsBody({ children, className, style }) {
|
|
82
|
-
return _jsx(
|
|
33
|
+
return _jsx("div", { className: clsx(styles.tabsBody, className), style: style, children: children });
|
|
83
34
|
}
|
|
84
35
|
export function TabsContent({ value, children, className }) {
|
|
85
36
|
const context = useContext(TabsContext);
|
|
@@ -87,5 +38,5 @@ export function TabsContent({ value, children, className }) {
|
|
|
87
38
|
throw new Error('TabsContent must be used within Tabs');
|
|
88
39
|
if (context.activeTab !== value)
|
|
89
40
|
return null;
|
|
90
|
-
return _jsx(
|
|
41
|
+
return _jsx("div", { className: clsx(styles.tabsContent, className), children: children });
|
|
91
42
|
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
@keyframes fadeIn {
|
|
2
|
+
from {
|
|
3
|
+
opacity: 0;
|
|
4
|
+
transform: translateY(5px);
|
|
5
|
+
}
|
|
6
|
+
to {
|
|
7
|
+
opacity: 1;
|
|
8
|
+
transform: translateY(0);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
.tabsList {
|
|
12
|
+
display: flex;
|
|
13
|
+
margin-bottom: 0;
|
|
14
|
+
padding-left: var(--spacing-md);
|
|
15
|
+
position: relative;
|
|
16
|
+
gap: 0.5rem;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.tabsTrigger {
|
|
20
|
+
padding: 0.75rem 1.5rem;
|
|
21
|
+
font-size: 0.9rem;
|
|
22
|
+
font-weight: 700;
|
|
23
|
+
text-transform: uppercase;
|
|
24
|
+
letter-spacing: 0.05em;
|
|
25
|
+
background-color: var(--primary);
|
|
26
|
+
color: var(--primary-foreground);
|
|
27
|
+
opacity: 0.6;
|
|
28
|
+
border: var(--border-width) solid var(--card-border);
|
|
29
|
+
border-bottom: var(--border-width) solid var(--card-border);
|
|
30
|
+
border-radius: var(--radius) var(--radius) 0 0;
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
position: relative;
|
|
33
|
+
z-index: 1;
|
|
34
|
+
transition: all 0.2s ease;
|
|
35
|
+
transform: translateY(4px);
|
|
36
|
+
}
|
|
37
|
+
.tabsTrigger:hover {
|
|
38
|
+
opacity: 0.8;
|
|
39
|
+
transform: translateY(2px);
|
|
40
|
+
}
|
|
41
|
+
.tabsTrigger.active {
|
|
42
|
+
opacity: 1;
|
|
43
|
+
z-index: var(--z-elevated);
|
|
44
|
+
transform: translateY(0);
|
|
45
|
+
}
|
|
46
|
+
.tabsTrigger.active:hover {
|
|
47
|
+
opacity: 1;
|
|
48
|
+
transform: translateY(0);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.tabsBody {
|
|
52
|
+
background: var(--card-bg);
|
|
53
|
+
border: var(--border-width) solid var(--card-border);
|
|
54
|
+
border-radius: var(--radius);
|
|
55
|
+
padding: 2.5rem;
|
|
56
|
+
box-shadow: var(--shadow-hard);
|
|
57
|
+
position: relative;
|
|
58
|
+
z-index: var(--z-elevated);
|
|
59
|
+
min-height: 600px;
|
|
60
|
+
margin-top: -3px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.tabsContent {
|
|
64
|
+
animation: fadeIn 0.3s ease-out forwards;
|
|
65
|
+
}
|
|
@@ -11,113 +11,11 @@ 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
|
-
|
|
16
|
-
/* Variant styles */
|
|
17
|
-
${props => {
|
|
18
|
-
switch (props.$variant) {
|
|
19
|
-
case 'h1':
|
|
20
|
-
return `
|
|
21
|
-
font-size: var(--text-5xl);
|
|
22
|
-
font-weight: var(--font-black);
|
|
23
|
-
line-height: 1.1;
|
|
24
|
-
letter-spacing: -0.02em;
|
|
25
|
-
`;
|
|
26
|
-
case 'h2':
|
|
27
|
-
return `
|
|
28
|
-
font-size: var(--text-4xl);
|
|
29
|
-
font-weight: var(--font-black);
|
|
30
|
-
line-height: 1.1;
|
|
31
|
-
letter-spacing: -0.02em;
|
|
32
|
-
`;
|
|
33
|
-
case 'h3':
|
|
34
|
-
return `
|
|
35
|
-
font-size: var(--text-3xl);
|
|
36
|
-
font-weight: var(--font-black);
|
|
37
|
-
line-height: 1.1;
|
|
38
|
-
`;
|
|
39
|
-
case 'h4':
|
|
40
|
-
return `
|
|
41
|
-
font-size: var(--text-2xl);
|
|
42
|
-
font-weight: var(--font-bold);
|
|
43
|
-
line-height: 1.2;
|
|
44
|
-
`;
|
|
45
|
-
case 'h5':
|
|
46
|
-
return `
|
|
47
|
-
font-size: var(--text-xl);
|
|
48
|
-
font-weight: var(--font-bold);
|
|
49
|
-
line-height: 1.3;
|
|
50
|
-
`;
|
|
51
|
-
case 'h6':
|
|
52
|
-
return `
|
|
53
|
-
font-size: var(--text-lg);
|
|
54
|
-
font-weight: var(--font-bold);
|
|
55
|
-
line-height: 1.4;
|
|
56
|
-
`;
|
|
57
|
-
case 'small':
|
|
58
|
-
return `
|
|
59
|
-
font-size: var(--text-xs);
|
|
60
|
-
line-height: 1.5;
|
|
61
|
-
`;
|
|
62
|
-
case 'caption':
|
|
63
|
-
return `
|
|
64
|
-
font-size: var(--text-xs);
|
|
65
|
-
line-height: 1.5;
|
|
66
|
-
color: var(--muted-foreground);
|
|
67
|
-
`;
|
|
68
|
-
case 'body':
|
|
69
|
-
default:
|
|
70
|
-
return `
|
|
71
|
-
font-size: var(--text-base);
|
|
72
|
-
line-height: 1.6;
|
|
73
|
-
`;
|
|
74
|
-
}
|
|
75
|
-
}}
|
|
76
|
-
|
|
77
|
-
/* Weight styles */
|
|
78
|
-
${props => {
|
|
79
|
-
switch (props.$weight) {
|
|
80
|
-
case 'normal':
|
|
81
|
-
return 'font-weight: var(--font-regular);';
|
|
82
|
-
case 'medium':
|
|
83
|
-
return 'font-weight: var(--font-medium);';
|
|
84
|
-
case 'semibold':
|
|
85
|
-
return 'font-weight: var(--font-bold);'; // Mapping semibold to bold
|
|
86
|
-
case 'bold':
|
|
87
|
-
return 'font-weight: var(--font-bold);';
|
|
88
|
-
case 'black':
|
|
89
|
-
return 'font-weight: var(--font-black);';
|
|
90
|
-
default:
|
|
91
|
-
return '';
|
|
92
|
-
}
|
|
93
|
-
}}
|
|
94
|
-
|
|
95
|
-
/* Color styles */
|
|
96
|
-
${props => {
|
|
97
|
-
switch (props.$color) {
|
|
98
|
-
case 'primary':
|
|
99
|
-
return 'color: var(--primary);';
|
|
100
|
-
case 'secondary':
|
|
101
|
-
return 'color: var(--secondary);';
|
|
102
|
-
case 'muted':
|
|
103
|
-
return 'color: var(--muted-foreground);';
|
|
104
|
-
case 'error':
|
|
105
|
-
return 'color: var(--error);';
|
|
106
|
-
case 'success':
|
|
107
|
-
return 'color: var(--success);';
|
|
108
|
-
case 'warning':
|
|
109
|
-
return 'color: var(--warning);';
|
|
110
|
-
default:
|
|
111
|
-
return 'color: var(--foreground);';
|
|
112
|
-
}
|
|
113
|
-
}}
|
|
114
|
-
|
|
115
|
-
/* Alignment */
|
|
116
|
-
text-align: ${props => props.$align || 'left'};
|
|
117
|
-
`;
|
|
14
|
+
import clsx from 'clsx';
|
|
15
|
+
import styles from './Text.module.css';
|
|
118
16
|
export function Text(_a) {
|
|
119
17
|
var { variant = 'body', weight, color, align, className, style, children, as } = _a, props = __rest(_a, ["variant", "weight", "color", "align", "className", "style", "children", "as"]);
|
|
120
18
|
// Determine the HTML element to use
|
|
121
|
-
const
|
|
122
|
-
return (_jsx(
|
|
19
|
+
const Component = as || ((variant === null || variant === void 0 ? void 0 : variant.startsWith('h')) ? variant : 'span');
|
|
20
|
+
return (_jsx(Component, Object.assign({ className: clsx(styles.text, styles[variant], weight && styles[`weight-${weight}`], color ? styles[`color-${color}`] : (!(variant === null || variant === void 0 ? void 0 : variant.startsWith('caption')) && styles['color-foreground']), align && styles[`align-${align}`], className), style: style }, props, { children: children })));
|
|
123
21
|
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/* Base styles */
|
|
2
|
+
.text {
|
|
3
|
+
text-align: left;
|
|
4
|
+
/* Default align */
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/* Alignment */
|
|
8
|
+
.align-left {
|
|
9
|
+
text-align: left;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.align-center {
|
|
13
|
+
text-align: center;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.align-right {
|
|
17
|
+
text-align: right;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* Variants */
|
|
21
|
+
.h1 {
|
|
22
|
+
font-size: var(--text-5xl);
|
|
23
|
+
font-weight: var(--font-black);
|
|
24
|
+
line-height: 1.1;
|
|
25
|
+
letter-spacing: -0.02em;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.h2 {
|
|
29
|
+
font-size: var(--text-4xl);
|
|
30
|
+
font-weight: var(--font-black);
|
|
31
|
+
line-height: 1.1;
|
|
32
|
+
letter-spacing: -0.02em;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.h3 {
|
|
36
|
+
font-size: var(--text-3xl);
|
|
37
|
+
font-weight: var(--font-black);
|
|
38
|
+
line-height: 1.1;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.h4 {
|
|
42
|
+
font-size: var(--text-2xl);
|
|
43
|
+
font-weight: var(--font-bold);
|
|
44
|
+
line-height: 1.2;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.h5 {
|
|
48
|
+
font-size: var(--text-xl);
|
|
49
|
+
font-weight: var(--font-bold);
|
|
50
|
+
line-height: 1.3;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.h6 {
|
|
54
|
+
font-size: var(--text-lg);
|
|
55
|
+
font-weight: var(--font-bold);
|
|
56
|
+
line-height: 1.4;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.small {
|
|
60
|
+
font-size: var(--text-xs);
|
|
61
|
+
line-height: 1.5;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.caption {
|
|
65
|
+
font-size: var(--text-xs);
|
|
66
|
+
line-height: 1.5;
|
|
67
|
+
color: var(--muted-foreground);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.body {
|
|
71
|
+
font-size: var(--text-base);
|
|
72
|
+
line-height: 1.6;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* Weights */
|
|
76
|
+
.weight-normal {
|
|
77
|
+
font-weight: var(--font-regular);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.weight-medium {
|
|
81
|
+
font-weight: var(--font-medium);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.weight-semibold {
|
|
85
|
+
font-weight: var(--font-bold);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.weight-bold {
|
|
89
|
+
font-weight: var(--font-bold);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.weight-black {
|
|
93
|
+
font-weight: var(--font-black);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* Colors */
|
|
97
|
+
.color-primary {
|
|
98
|
+
color: var(--primary);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.color-secondary {
|
|
102
|
+
color: var(--secondary);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.color-muted {
|
|
106
|
+
color: var(--muted-foreground);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.color-error {
|
|
110
|
+
color: var(--error);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.color-success {
|
|
114
|
+
color: var(--success);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.color-warning {
|
|
118
|
+
color: var(--warning);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.color-foreground {
|
|
122
|
+
color: var(--foreground);
|
|
123
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement>;
|
|
3
|
-
export declare function Textarea(props: TextareaProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function Textarea({ className, ...props }: TextareaProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
2
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
font-size: var(--text-base);
|
|
9
|
-
background: var(--card-bg);
|
|
10
|
-
color: var(--foreground);
|
|
11
|
-
font-family: inherit;
|
|
12
|
-
resize: vertical;
|
|
13
|
-
|
|
14
|
-
${baseInteractiveStyles}
|
|
15
|
-
${focusStyles}
|
|
16
|
-
|
|
17
|
-
&::placeholder {
|
|
18
|
-
color: var(--muted);
|
|
19
|
-
}
|
|
20
|
-
`;
|
|
21
|
-
export function Textarea(props) {
|
|
22
|
-
return _jsx(StyledTextarea, Object.assign({}, props));
|
|
14
|
+
import clsx from 'clsx';
|
|
15
|
+
import styles from './Textarea.module.css';
|
|
16
|
+
export function Textarea(_a) {
|
|
17
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
18
|
+
return _jsx("textarea", Object.assign({ className: clsx(styles.textarea, className) }, props));
|
|
23
19
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.textarea {
|
|
2
|
+
width: 100%;
|
|
3
|
+
padding: 0.75rem 1rem;
|
|
4
|
+
font-size: var(--text-base);
|
|
5
|
+
background: var(--card-bg);
|
|
6
|
+
color: var(--foreground);
|
|
7
|
+
font-family: inherit;
|
|
8
|
+
resize: vertical;
|
|
9
|
+
border: var(--border-width) solid var(--card-border);
|
|
10
|
+
border-radius: var(--radius);
|
|
11
|
+
box-shadow: var(--shadow-hard);
|
|
12
|
+
transition: all 0.1s ease;
|
|
13
|
+
outline: none;
|
|
14
|
+
}
|
|
15
|
+
.textarea:focus, .textarea:focus-visible, .textarea[aria-expanded=true] {
|
|
16
|
+
outline: none;
|
|
17
|
+
transform: translate(-2px, -2px);
|
|
18
|
+
box-shadow: 7px 7px 0px 0px var(--shadow-primary);
|
|
19
|
+
border-color: var(--primary);
|
|
20
|
+
}
|
|
21
|
+
.textarea::placeholder {
|
|
22
|
+
color: var(--muted);
|
|
23
|
+
}
|
|
@@ -1,76 +1,12 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, useContext, useState, useCallback, useEffect } from 'react';
|
|
4
|
-
import
|
|
4
|
+
import clsx from 'clsx';
|
|
5
5
|
import { createPortal } from 'react-dom';
|
|
6
6
|
import { CheckCircle2, XCircle, AlertTriangle, Info, X } from 'lucide-react';
|
|
7
|
+
import styles from './Toast.module.css';
|
|
7
8
|
// Context
|
|
8
9
|
const ToastContext = createContext(undefined);
|
|
9
|
-
// Styled Components
|
|
10
|
-
const ToastContainer = styled.div `
|
|
11
|
-
position: fixed;
|
|
12
|
-
bottom: 2rem;
|
|
13
|
-
right: 2rem;
|
|
14
|
-
display: flex;
|
|
15
|
-
flex-direction: column;
|
|
16
|
-
gap: 1rem;
|
|
17
|
-
z-index: var(--z-tooltip);
|
|
18
|
-
pointer-events: none; /* Allow clicking through the container area */
|
|
19
|
-
`;
|
|
20
|
-
const ToastItem = styled.div `
|
|
21
|
-
min-width: 300px;
|
|
22
|
-
background: var(--card-bg);
|
|
23
|
-
border: var(--border-width) solid var(--card-border);
|
|
24
|
-
color: var(--foreground);
|
|
25
|
-
box-shadow: var(--shadow-hard);
|
|
26
|
-
padding: var(--spacing-md);
|
|
27
|
-
display: flex;
|
|
28
|
-
align-items: center;
|
|
29
|
-
gap: 0.75rem;
|
|
30
|
-
animation: ${props => props.isExiting ? 'slideOut 0.3s ease-in forwards' : 'slideIn 0.3s ease-out forwards'};
|
|
31
|
-
position: relative;
|
|
32
|
-
overflow: hidden;
|
|
33
|
-
pointer-events: auto; /* Re-enable pointer events for the toast itself */
|
|
34
|
-
border-radius: var(--radius);
|
|
35
|
-
|
|
36
|
-
&::before {
|
|
37
|
-
content: '';
|
|
38
|
-
position: absolute;
|
|
39
|
-
left: 0;
|
|
40
|
-
top: 0;
|
|
41
|
-
bottom: 0;
|
|
42
|
-
width: 6px;
|
|
43
|
-
background-color: ${props => {
|
|
44
|
-
switch (props.type) {
|
|
45
|
-
case 'success': return 'var(--success)';
|
|
46
|
-
case 'error': return 'var(--error)';
|
|
47
|
-
case 'warning': return 'var(--warning)';
|
|
48
|
-
default: return 'var(--primary)';
|
|
49
|
-
}
|
|
50
|
-
}};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
@keyframes slideIn {
|
|
54
|
-
from { transform: translateX(100%); opacity: 0; }
|
|
55
|
-
to { transform: translateX(0); opacity: 1; }
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
@keyframes slideOut {
|
|
59
|
-
from { transform: translateX(0); opacity: 1; }
|
|
60
|
-
to { transform: translateX(100%); opacity: 0; }
|
|
61
|
-
}
|
|
62
|
-
`;
|
|
63
|
-
const CloseButton = styled.button `
|
|
64
|
-
background: none;
|
|
65
|
-
border: none;
|
|
66
|
-
margin-left: auto;
|
|
67
|
-
cursor: pointer;
|
|
68
|
-
font-size: 1.25rem;
|
|
69
|
-
color: var(--foreground);
|
|
70
|
-
opacity: 0.5;
|
|
71
|
-
transition: opacity 0.2s;
|
|
72
|
-
&:hover { opacity: 1; }
|
|
73
|
-
`;
|
|
74
10
|
// Provider
|
|
75
11
|
export function ToastProvider({ children }) {
|
|
76
12
|
const [toasts, setToasts] = useState([]);
|
|
@@ -97,7 +33,7 @@ export function ToastProvider({ children }) {
|
|
|
97
33
|
const toastError = useCallback((message) => addToast(message, 'error'), [addToast]);
|
|
98
34
|
const toastWarning = useCallback((message) => addToast(message, 'warning'), [addToast]);
|
|
99
35
|
const toastInfo = useCallback((message) => addToast(message, 'info'), [addToast]);
|
|
100
|
-
return (_jsxs(ToastContext.Provider, { value: { toast, toastSuccess, toastError, toastWarning, toastInfo }, children: [children, isMounted && createPortal(_jsx(
|
|
36
|
+
return (_jsxs(ToastContext.Provider, { value: { toast, toastSuccess, toastError, toastWarning, toastInfo }, children: [children, isMounted && createPortal(_jsx("div", { className: styles.container, children: toasts.map(t => (_jsxs("div", { className: clsx(styles.toast, styles[t.type], t.isExiting && styles.exiting), children: [t.type === 'success' && _jsx(CheckCircle2, { size: 20, strokeWidth: 2.5, color: "var(--success)" }), t.type === 'error' && _jsx(XCircle, { size: 20, strokeWidth: 2.5, color: "var(--error)" }), t.type === 'warning' && _jsx(AlertTriangle, { size: 20, strokeWidth: 2.5, color: "var(--warning)" }), t.type === 'info' && _jsx(Info, { size: 20, strokeWidth: 2.5, color: "var(--primary)" }), _jsx("span", { className: "font-semibold", children: t.message }), _jsx("button", { className: styles.closeButton, onClick: () => removeToast(t.id), children: _jsx(X, { size: 16, strokeWidth: 2.5 }) })] }, t.id))) }), document.body)] }));
|
|
101
37
|
}
|
|
102
38
|
// Hook
|
|
103
39
|
export function useToast() {
|