@phpsoftbox/react-softbox 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +271 -0
- package/dist/components/Alert/Alert.d.ts +11 -0
- package/dist/components/Alert/Alert.js +15 -0
- package/dist/components/Alert/Alert.js.map +1 -0
- package/dist/components/Alert/Alert.module.css +73 -0
- package/dist/components/Badge/Badge.d.ts +8 -0
- package/dist/components/Badge/Badge.js +15 -0
- package/dist/components/Badge/Badge.js.map +1 -0
- package/dist/components/Badge/Badge.module.css +47 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +24 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +15 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js.map +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.module.css +55 -0
- package/dist/components/Button/Button.d.ts +10 -0
- package/dist/components/Button/Button.js +37 -0
- package/dist/components/Button/Button.js.map +1 -0
- package/dist/components/Button/Button.module.css +130 -0
- package/dist/components/Card/Card.d.ts +15 -0
- package/dist/components/Card/Card.js +26 -0
- package/dist/components/Card/Card.js.map +1 -0
- package/dist/components/Card/Card.module.css +55 -0
- package/dist/components/CollapseButton/CollapseButton.d.ts +9 -0
- package/dist/components/CollapseButton/CollapseButton.js +11 -0
- package/dist/components/CollapseButton/CollapseButton.js.map +1 -0
- package/dist/components/CollapseButton/CollapseButton.module.css +57 -0
- package/dist/components/Drawer/Drawer.d.ts +19 -0
- package/dist/components/Drawer/Drawer.js +42 -0
- package/dist/components/Drawer/Drawer.js.map +1 -0
- package/dist/components/Drawer/Drawer.module.css +104 -0
- package/dist/components/Flex/Flex.module.css +11 -0
- package/dist/components/Flex/Row.d.ts +9 -0
- package/dist/components/Flex/Row.js +14 -0
- package/dist/components/Flex/Row.js.map +1 -0
- package/dist/components/Flex/Stack.d.ts +8 -0
- package/dist/components/Flex/Stack.js +13 -0
- package/dist/components/Flex/Stack.js.map +1 -0
- package/dist/components/Grid/Grid.d.ts +11 -0
- package/dist/components/Grid/Grid.js +16 -0
- package/dist/components/Grid/Grid.js.map +1 -0
- package/dist/components/Grid/Grid.module.css +32 -0
- package/dist/components/Input/DatePicker.d.ts +6 -0
- package/dist/components/Input/DatePicker.js +6 -0
- package/dist/components/Input/DatePicker.js.map +1 -0
- package/dist/components/Input/DateRangePicker.d.ts +16 -0
- package/dist/components/Input/DateRangePicker.js +16 -0
- package/dist/components/Input/DateRangePicker.js.map +1 -0
- package/dist/components/Input/Field.d.ts +5 -0
- package/dist/components/Input/Field.js +25 -0
- package/dist/components/Input/Field.js.map +1 -0
- package/dist/components/Input/FloatLabel/FloatLabel.d.ts +9 -0
- package/dist/components/Input/FloatLabel/FloatLabel.js +22 -0
- package/dist/components/Input/FloatLabel/FloatLabel.js.map +1 -0
- package/dist/components/Input/FloatLabel/FloatLabel.module.css +41 -0
- package/dist/components/Input/FormField/FormField.d.ts +29 -0
- package/dist/components/Input/FormField/FormField.js +60 -0
- package/dist/components/Input/FormField/FormField.js.map +1 -0
- package/dist/components/Input/FormField/FormField.module.css +30 -0
- package/dist/components/Input/Input.d.ts +59 -0
- package/dist/components/Input/Input.js +34 -0
- package/dist/components/Input/Input.js.map +1 -0
- package/dist/components/Input/Input.module.css +31 -0
- package/dist/components/Input/InputGroup.d.ts +11 -0
- package/dist/components/Input/InputGroup.js +25 -0
- package/dist/components/Input/InputGroup.js.map +1 -0
- package/dist/components/Input/InputGroup.module.css +38 -0
- package/dist/components/Input/MaskedInput.d.ts +9 -0
- package/dist/components/Input/MaskedInput.js +82 -0
- package/dist/components/Input/MaskedInput.js.map +1 -0
- package/dist/components/Input/NumberInput.d.ts +10 -0
- package/dist/components/Input/NumberInput.js +44 -0
- package/dist/components/Input/NumberInput.js.map +1 -0
- package/dist/components/Input/Radio/Radio.d.ts +7 -0
- package/dist/components/Input/Radio/Radio.js +9 -0
- package/dist/components/Input/Radio/Radio.js.map +1 -0
- package/dist/components/Input/Radio/Radio.module.css +83 -0
- package/dist/components/Input/Select/Select.d.ts +38 -0
- package/dist/components/Input/Select/Select.js +200 -0
- package/dist/components/Input/Select/Select.js.map +1 -0
- package/dist/components/Input/Select/Select.module.css +194 -0
- package/dist/components/Input/Switch/Switch.d.ts +6 -0
- package/dist/components/Input/Switch/Switch.js +9 -0
- package/dist/components/Input/Switch/Switch.js.map +1 -0
- package/dist/components/Input/Switch/Switch.module.css +62 -0
- package/dist/components/Input/Textarea/Textarea.d.ts +6 -0
- package/dist/components/Input/Textarea/Textarea.js +21 -0
- package/dist/components/Input/Textarea/Textarea.js.map +1 -0
- package/dist/components/Input/Textarea/Textarea.module.css +39 -0
- package/dist/components/Input/TimePicker.d.ts +4 -0
- package/dist/components/Input/TimePicker.js +6 -0
- package/dist/components/Input/TimePicker.js.map +1 -0
- package/dist/components/Menu/Dropdown.d.ts +13 -0
- package/dist/components/Menu/Dropdown.js +58 -0
- package/dist/components/Menu/Dropdown.js.map +1 -0
- package/dist/components/Menu/Menu.d.ts +31 -0
- package/dist/components/Menu/Menu.js +161 -0
- package/dist/components/Menu/Menu.js.map +1 -0
- package/dist/components/Menu/Menu.module.css +240 -0
- package/dist/components/Modal/Modal.d.ts +12 -0
- package/dist/components/Modal/Modal.js +31 -0
- package/dist/components/Modal/Modal.js.map +1 -0
- package/dist/components/Modal/Modal.module.css +90 -0
- package/dist/components/Notifier/Notifier.d.ts +17 -0
- package/dist/components/Notifier/Notifier.js +210 -0
- package/dist/components/Notifier/Notifier.js.map +1 -0
- package/dist/components/Notifier/Notifier.module.css +182 -0
- package/dist/components/Pagination/Pagination.d.ts +28 -0
- package/dist/components/Pagination/Pagination.js +70 -0
- package/dist/components/Pagination/Pagination.js.map +1 -0
- package/dist/components/Pagination/Pagination.module.css +93 -0
- package/dist/components/Progress/Progress.d.ts +16 -0
- package/dist/components/Progress/Progress.js +32 -0
- package/dist/components/Progress/Progress.js.map +1 -0
- package/dist/components/Progress/Progress.module.css +110 -0
- package/dist/components/Tabs/Tabs.d.ts +20 -0
- package/dist/components/Tabs/Tabs.js +115 -0
- package/dist/components/Tabs/Tabs.js.map +1 -0
- package/dist/components/Tabs/Tabs.module.css +101 -0
- package/dist/components/Typography/Heading.d.ts +13 -0
- package/dist/components/Typography/Heading.js +38 -0
- package/dist/components/Typography/Heading.js.map +1 -0
- package/dist/components/Typography/Text.d.ts +20 -0
- package/dist/components/Typography/Text.js +43 -0
- package/dist/components/Typography/Text.js.map +1 -0
- package/dist/components/Typography/Typography.module.css +132 -0
- package/dist/foundations/index.css +3 -0
- package/dist/foundations/layout.css +78 -0
- package/dist/foundations/tokens.css +236 -0
- package/dist/foundations/typography.css +49 -0
- package/dist/hooks/useDropdownPosition.d.ts +14 -0
- package/dist/hooks/useDropdownPosition.js +61 -0
- package/dist/hooks/useDropdownPosition.js.map +1 -0
- package/dist/hooks/useMediaQuery.d.ts +1 -0
- package/dist/hooks/useMediaQuery.js +33 -0
- package/dist/hooks/useMediaQuery.js.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/theme.d.ts +12 -0
- package/dist/theme.js +133 -0
- package/dist/theme.js.map +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/docs/README.md +40 -0
- package/docs/breadcrumbs.md +47 -0
- package/docs/card.md +18 -0
- package/docs/feedback.md +38 -0
- package/docs/forms.md +166 -0
- package/docs/layout.md +39 -0
- package/docs/navigation.md +80 -0
- package/docs/overlays.md +31 -0
- package/docs/pagination.md +50 -0
- package/docs/progress.md +18 -0
- package/docs/tabs.md +34 -0
- package/docs/theme.md +49 -0
- package/docs/typography.md +26 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 PhpSoftBox
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
# ReactSoftBox
|
|
2
|
+
|
|
3
|
+
Минимальный набор UI‑компонентов для админки PhpSoftBox.
|
|
4
|
+
|
|
5
|
+
## Подключение
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import '@phpsoftbox/react-softbox/foundations/index.css';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { Alert, Badge, Breadcrumbs, Button, Card, CollapseButton, Drawer, Dropdown, FloatLabel, FormField, Grid, Heading, Input, Menu, Modal, Notifier, Pagination, Progress, Radio, Row, Select, Stack, Switch, Tabs, Text, Textarea } from '@phpsoftbox/react-softbox';
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Тема
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { initTheme, setThemeMode } from '@phpsoftbox/react-softbox';
|
|
19
|
+
|
|
20
|
+
initTheme({ defaultMode: 'system' });
|
|
21
|
+
setThemeMode('dark');
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Документация
|
|
25
|
+
|
|
26
|
+
- `docs/README.md`
|
|
27
|
+
- `docs/layout.md`
|
|
28
|
+
- `docs/navigation.md`
|
|
29
|
+
- `docs/forms.md`
|
|
30
|
+
- `docs/overlays.md`
|
|
31
|
+
- `docs/feedback.md`
|
|
32
|
+
- `docs/card.md`
|
|
33
|
+
- `docs/typography.md`
|
|
34
|
+
- `docs/theme.md`
|
|
35
|
+
- `docs/pagination.md`
|
|
36
|
+
- `docs/tabs.md`
|
|
37
|
+
- `docs/progress.md`
|
|
38
|
+
- `docs/breadcrumbs.md`
|
|
39
|
+
|
|
40
|
+
## Playground
|
|
41
|
+
|
|
42
|
+
Локальная площадка для проверки компонентов:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
cd packages-js/ReactSoftBox/playground
|
|
46
|
+
yarn install
|
|
47
|
+
yarn dev --host 0.0.0.0 --port 5174
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Сборка пакета
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
yarn install
|
|
54
|
+
yarn build
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Краткий обзор компонентов
|
|
58
|
+
|
|
59
|
+
### Button
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
<Button variant="primary">Primary</Button>
|
|
63
|
+
<Button variant="info" appearance="outline">Info</Button>
|
|
64
|
+
<Button variant="danger" appearance="ghost">Danger</Button>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Input / FloatLabel
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
<Input>
|
|
71
|
+
<Input.Label>Email</Input.Label>
|
|
72
|
+
<Input.Field type="email" name="email" />
|
|
73
|
+
</Input>
|
|
74
|
+
|
|
75
|
+
<Input>
|
|
76
|
+
<Input.FloatLabel label="Password">
|
|
77
|
+
<Input.Field type="password" name="password" />
|
|
78
|
+
</Input.FloatLabel>
|
|
79
|
+
</Input>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Textarea / Radio
|
|
83
|
+
|
|
84
|
+
```tsx
|
|
85
|
+
<Textarea placeholder="Комментарий" />
|
|
86
|
+
<Radio name="mode" label="Основной" />
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Switch
|
|
90
|
+
|
|
91
|
+
```tsx
|
|
92
|
+
<Switch label="Автообновления" defaultChecked />
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Select
|
|
96
|
+
|
|
97
|
+
```tsx
|
|
98
|
+
<Select label="Окружение" options={[{ value: 'dev', label: 'Development' }]} />
|
|
99
|
+
<Select label="Сервисы" options={options} multiple searchable />
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Grid / Flex
|
|
103
|
+
|
|
104
|
+
```tsx
|
|
105
|
+
<Grid columns={12} columnsLg={8} columnsMd={4} columnsSm={1} gap="16px">
|
|
106
|
+
<div>One</div>
|
|
107
|
+
<div>Two</div>
|
|
108
|
+
<div>Three</div>
|
|
109
|
+
</Grid>
|
|
110
|
+
|
|
111
|
+
<Row gap="12px">
|
|
112
|
+
<div>A</div>
|
|
113
|
+
<div>B</div>
|
|
114
|
+
</Row>
|
|
115
|
+
|
|
116
|
+
<Stack gap="12px">
|
|
117
|
+
<div>Item</div>
|
|
118
|
+
<div>Item</div>
|
|
119
|
+
</Stack>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Menu / Dropdown
|
|
123
|
+
|
|
124
|
+
```tsx
|
|
125
|
+
const items = [
|
|
126
|
+
{ label: 'Главная', href: '/', active: true },
|
|
127
|
+
{ label: 'Документы', href: '#' },
|
|
128
|
+
{ divider: true },
|
|
129
|
+
{ label: 'Настройки', href: '#' },
|
|
130
|
+
];
|
|
131
|
+
|
|
132
|
+
<Menu items={items} />
|
|
133
|
+
<Menu items={items} orientation="horizontal" />
|
|
134
|
+
|
|
135
|
+
<Dropdown trigger={<span>Открыть</span>} items={items} orientation="vertical" />
|
|
136
|
+
|
|
137
|
+
// Dropdown внутри горизонтального меню
|
|
138
|
+
const topMenu = [
|
|
139
|
+
{ label: 'Главная', href: '/' },
|
|
140
|
+
{ label: 'Команда', children: [{ label: 'Участники' }, { label: 'Роли' }] },
|
|
141
|
+
];
|
|
142
|
+
<Menu items={topMenu} orientation="horizontal" />
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Collapsible Menu
|
|
146
|
+
|
|
147
|
+
```tsx
|
|
148
|
+
const collapsible = [
|
|
149
|
+
{
|
|
150
|
+
label: 'Сервисы',
|
|
151
|
+
open: true,
|
|
152
|
+
children: [
|
|
153
|
+
{ label: 'Database' },
|
|
154
|
+
{ label: 'Cache' },
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
];
|
|
158
|
+
|
|
159
|
+
<Menu items={collapsible} />
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Badge
|
|
163
|
+
|
|
164
|
+
```tsx
|
|
165
|
+
<Badge>Default</Badge>
|
|
166
|
+
<Badge variant="primary">Primary</Badge>
|
|
167
|
+
<Badge variant="info">Info</Badge>
|
|
168
|
+
<Badge variant="success">Success</Badge>
|
|
169
|
+
<Badge variant="warning">Warning</Badge>
|
|
170
|
+
<Badge variant="danger">Danger</Badge>
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Typography
|
|
174
|
+
|
|
175
|
+
```tsx
|
|
176
|
+
<Heading level={2}>Заголовок</Heading>
|
|
177
|
+
<Text muted>Подпись</Text>
|
|
178
|
+
<Text code>npm run dev</Text>
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Alert
|
|
182
|
+
|
|
183
|
+
```tsx
|
|
184
|
+
<Alert title="Info">Синхронизация завершится через 3 минуты.</Alert>
|
|
185
|
+
<Alert variant="danger" title="Ошибка" onClose={() => {}}>
|
|
186
|
+
Ошибка доступа к сервису хранения.
|
|
187
|
+
</Alert>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Notifier
|
|
191
|
+
|
|
192
|
+
```tsx
|
|
193
|
+
<Notifier items={items} onDismiss={(id) => remove(id)} />
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Card
|
|
197
|
+
|
|
198
|
+
```tsx
|
|
199
|
+
<Card>
|
|
200
|
+
<Card.Header title="Заголовок" right={<Button appearance="ghost">...</Button>} />
|
|
201
|
+
<Card.Body>
|
|
202
|
+
Контент карточки
|
|
203
|
+
</Card.Body>
|
|
204
|
+
<Card.Footer>
|
|
205
|
+
<Button appearance="ghost">Отмена</Button>
|
|
206
|
+
<Button>Сохранить</Button>
|
|
207
|
+
</Card.Footer>
|
|
208
|
+
</Card>
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### CollapseButton
|
|
212
|
+
|
|
213
|
+
```tsx
|
|
214
|
+
<CollapseButton targetId="filters-panel" open={open} onClick={() => setOpen((prev) => !prev)}>
|
|
215
|
+
Фильтры
|
|
216
|
+
</CollapseButton>
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Breadcrumbs
|
|
220
|
+
|
|
221
|
+
```tsx
|
|
222
|
+
<Breadcrumbs
|
|
223
|
+
items={[
|
|
224
|
+
{ label: 'Главная', href: '/' },
|
|
225
|
+
{ label: 'Проекты', href: '#' },
|
|
226
|
+
{ label: 'Project', current: true },
|
|
227
|
+
]}
|
|
228
|
+
/>
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Tabs
|
|
232
|
+
|
|
233
|
+
```tsx
|
|
234
|
+
const items = [
|
|
235
|
+
{ id: 'overview', label: 'Обзор', content: 'Основная информация' },
|
|
236
|
+
{ id: 'metrics', label: 'Метрики', content: 'Показатели' },
|
|
237
|
+
];
|
|
238
|
+
|
|
239
|
+
<Tabs items={items} />
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Progress
|
|
243
|
+
|
|
244
|
+
```tsx
|
|
245
|
+
<Progress value={72} label="Сборка" variant="primary" />
|
|
246
|
+
<Progress label="Синхронизация" indeterminate />
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### Pagination
|
|
250
|
+
|
|
251
|
+
```tsx
|
|
252
|
+
<Pagination meta={pagination.meta} links={pagination.links} onNavigate={(page) => setPage(page)} />
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### Modal / Drawer
|
|
256
|
+
|
|
257
|
+
```tsx
|
|
258
|
+
<Modal open={open} title="Новый релиз" onClose={() => setOpen(false)}>
|
|
259
|
+
Контент модалки
|
|
260
|
+
</Modal>
|
|
261
|
+
|
|
262
|
+
<Drawer open={open} title="Меню" onClose={() => setOpen(false)}>
|
|
263
|
+
Контент шторки
|
|
264
|
+
</Drawer>
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
## Базовые состояния
|
|
268
|
+
|
|
269
|
+
- `Button`: hover, focus-visible, active, disabled
|
|
270
|
+
- `Input`: focus, error, placeholder, disabled
|
|
271
|
+
- `Menu`: hover, active, disabled, divider, keyboard arrows
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { UiVariant } from '../../types';
|
|
3
|
+
export type AlertVariant = UiVariant;
|
|
4
|
+
type Props = React.HTMLAttributes<HTMLDivElement> & {
|
|
5
|
+
variant?: AlertVariant;
|
|
6
|
+
title?: React.ReactNode;
|
|
7
|
+
actions?: React.ReactNode;
|
|
8
|
+
onClose?: () => void;
|
|
9
|
+
};
|
|
10
|
+
export default function Alert({ variant, title, actions, onClose, className, children, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styles from './Alert.module.css';
|
|
3
|
+
const classMap = {
|
|
4
|
+
default: styles.default,
|
|
5
|
+
primary: styles.primary,
|
|
6
|
+
info: styles.info,
|
|
7
|
+
success: styles.success,
|
|
8
|
+
warning: styles.warning,
|
|
9
|
+
danger: styles.danger,
|
|
10
|
+
};
|
|
11
|
+
export default function Alert({ variant = 'info', title, actions, onClose, className, children, ...props }) {
|
|
12
|
+
const classes = [styles.alert, classMap[variant], className].filter(Boolean).join(' ');
|
|
13
|
+
return (_jsxs("div", { className: classes, role: "status", ...props, children: [_jsxs("div", { className: styles.main, children: [title ? _jsx("div", { className: styles.title, children: title }) : null, children ? _jsx("div", { className: styles.message, children: children }) : null, actions ? _jsx("div", { className: styles.actions, children: actions }) : null] }), onClose ? (_jsx("button", { type: "button", className: styles.close, onClick: onClose, "aria-label": "\u0417\u0430\u043A\u0440\u044B\u0442\u044C", children: "\u00D7" })) : null] }));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=Alert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Alert.js","sourceRoot":"","sources":["../../../src/components/Alert/Alert.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAYxC,MAAM,QAAQ,GAAiC;IAC7C,OAAO,EAAE,MAAM,CAAC,OAAO;IACvB,OAAO,EAAE,MAAM,CAAC,OAAO;IACvB,IAAI,EAAE,MAAM,CAAC,IAAI;IACjB,OAAO,EAAE,MAAM,CAAC,OAAO;IACvB,OAAO,EAAE,MAAM,CAAC,OAAO;IACvB,MAAM,EAAE,MAAM,CAAC,MAAM;CACtB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAS;IAC/G,MAAM,OAAO,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEvF,OAAO,CACL,eAAK,SAAS,EAAE,OAAO,EAAE,IAAI,EAAC,QAAQ,KAAK,KAAK,aAC9C,eAAK,SAAS,EAAE,MAAM,CAAC,IAAI,aACxB,KAAK,CAAC,CAAC,CAAC,cAAK,SAAS,EAAE,MAAM,CAAC,KAAK,YAAG,KAAK,GAAO,CAAC,CAAC,CAAC,IAAI,EAC1D,QAAQ,CAAC,CAAC,CAAC,cAAK,SAAS,EAAE,MAAM,CAAC,OAAO,YAAG,QAAQ,GAAO,CAAC,CAAC,CAAC,IAAI,EAClE,OAAO,CAAC,CAAC,CAAC,cAAK,SAAS,EAAE,MAAM,CAAC,OAAO,YAAG,OAAO,GAAO,CAAC,CAAC,CAAC,IAAI,IAC7D,EACL,OAAO,CAAC,CAAC,CAAC,CACT,iBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAE,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,gBAAa,4CAAS,uBAE5E,CACV,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
.alert {
|
|
2
|
+
display: flex;
|
|
3
|
+
gap: var(--spacing-4);
|
|
4
|
+
align-items: flex-start;
|
|
5
|
+
padding: var(--spacing-4);
|
|
6
|
+
border-radius: var(--radius-md);
|
|
7
|
+
border: 1px solid transparent;
|
|
8
|
+
background: var(--surface-panel-soft);
|
|
9
|
+
color: var(--color-text);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.main {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
gap: var(--spacing-2);
|
|
16
|
+
flex: 1;
|
|
17
|
+
min-width: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.title {
|
|
21
|
+
font-weight: 600;
|
|
22
|
+
font-size: 15px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.message {
|
|
26
|
+
font-size: 14px;
|
|
27
|
+
color: var(--color-muted);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.actions {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-wrap: wrap;
|
|
33
|
+
gap: var(--spacing-2);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.close {
|
|
37
|
+
border: none;
|
|
38
|
+
background: transparent;
|
|
39
|
+
color: var(--color-muted);
|
|
40
|
+
font-size: 20px;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
line-height: 1;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.default {
|
|
46
|
+
border-color: rgba(30, 51, 85, 0.6);
|
|
47
|
+
box-shadow: 0 0 0 1px rgba(30, 51, 85, 0.2);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.primary {
|
|
51
|
+
border-color: rgba(20, 201, 214, 0.5);
|
|
52
|
+
box-shadow: 0 0 0 1px rgba(20, 201, 214, 0.2);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.info {
|
|
56
|
+
border-color: rgba(30, 99, 233, 0.4);
|
|
57
|
+
box-shadow: 0 0 0 1px rgba(30, 99, 233, 0.2);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.success {
|
|
61
|
+
border-color: rgba(79, 230, 163, 0.5);
|
|
62
|
+
box-shadow: 0 0 0 1px rgba(79, 230, 163, 0.2);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.warning {
|
|
66
|
+
border-color: rgba(246, 200, 106, 0.5);
|
|
67
|
+
box-shadow: 0 0 0 1px rgba(246, 200, 106, 0.2);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.danger {
|
|
71
|
+
border-color: rgba(255, 107, 107, 0.5);
|
|
72
|
+
box-shadow: 0 0 0 1px rgba(255, 107, 107, 0.2);
|
|
73
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { UiVariant } from '../../types';
|
|
3
|
+
type BadgeVariant = UiVariant;
|
|
4
|
+
type Props = React.HTMLAttributes<HTMLSpanElement> & {
|
|
5
|
+
variant?: BadgeVariant;
|
|
6
|
+
};
|
|
7
|
+
export default function Badge({ variant, className, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import styles from './Badge.module.css';
|
|
3
|
+
const classMap = {
|
|
4
|
+
default: styles.default,
|
|
5
|
+
primary: styles.primary,
|
|
6
|
+
info: styles.info,
|
|
7
|
+
success: styles.success,
|
|
8
|
+
warning: styles.warning,
|
|
9
|
+
danger: styles.danger,
|
|
10
|
+
};
|
|
11
|
+
export default function Badge({ variant = 'default', className, ...props }) {
|
|
12
|
+
const classes = [styles.badge, classMap[variant], className].filter(Boolean).join(' ');
|
|
13
|
+
return _jsx("span", { className: classes, ...props });
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=Badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AASxC,MAAM,QAAQ,GAAiC;IAC7C,OAAO,EAAE,MAAM,CAAC,OAAO;IACvB,OAAO,EAAE,MAAM,CAAC,OAAO;IACvB,IAAI,EAAE,MAAM,CAAC,IAAI;IACjB,OAAO,EAAE,MAAM,CAAC,OAAO;IACvB,OAAO,EAAE,MAAM,CAAC,OAAO;IACvB,MAAM,EAAE,MAAM,CAAC,MAAM;CACtB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,EAAE,SAAS,EAAE,GAAG,KAAK,EAAS;IAC/E,MAAM,OAAO,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEvF,OAAO,eAAM,SAAS,EAAE,OAAO,KAAM,KAAK,GAAI,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
.badge {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: 6px;
|
|
5
|
+
padding: 4px 10px;
|
|
6
|
+
border-radius: 999px;
|
|
7
|
+
font-size: 12px;
|
|
8
|
+
letter-spacing: 0.08em;
|
|
9
|
+
text-transform: uppercase;
|
|
10
|
+
border: 1px solid transparent;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.default {
|
|
14
|
+
background: var(--badge-default-bg, rgba(30, 51, 85, 0.45));
|
|
15
|
+
color: var(--badge-default-color, var(--color-muted));
|
|
16
|
+
border-color: var(--badge-default-border, rgba(30, 51, 85, 0.7));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.primary {
|
|
20
|
+
background: var(--badge-primary-bg, rgba(79, 230, 163, 0.2));
|
|
21
|
+
color: var(--badge-primary-color, var(--color-mint));
|
|
22
|
+
border-color: var(--badge-primary-border, rgba(79, 230, 163, 0.4));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.info {
|
|
26
|
+
background: var(--badge-info-bg, rgba(30, 99, 233, 0.2));
|
|
27
|
+
color: var(--badge-info-color, #9cc0ff);
|
|
28
|
+
border-color: var(--badge-info-border, rgba(30, 99, 233, 0.45));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.success {
|
|
32
|
+
background: var(--badge-success-bg, rgba(79, 230, 163, 0.14));
|
|
33
|
+
color: var(--badge-success-color, var(--color-mint));
|
|
34
|
+
border-color: var(--badge-success-border, rgba(79, 230, 163, 0.4));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.warning {
|
|
38
|
+
background: var(--badge-warning-bg, rgba(246, 200, 106, 0.18));
|
|
39
|
+
color: var(--badge-warning-color, #f6c86a);
|
|
40
|
+
border-color: var(--badge-warning-border, rgba(246, 200, 106, 0.45));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.danger {
|
|
44
|
+
background: var(--badge-danger-bg, rgba(255, 107, 107, 0.18));
|
|
45
|
+
color: var(--badge-danger-color, #ff6b6b);
|
|
46
|
+
border-color: var(--badge-danger-border, rgba(255, 107, 107, 0.45));
|
|
47
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type LinkComponent = React.ElementType<{
|
|
3
|
+
href?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
}>;
|
|
8
|
+
export type BreadcrumbItem = {
|
|
9
|
+
id?: string;
|
|
10
|
+
label: React.ReactNode;
|
|
11
|
+
href?: string;
|
|
12
|
+
onClick?: () => void;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
current?: boolean;
|
|
15
|
+
as?: LinkComponent;
|
|
16
|
+
};
|
|
17
|
+
type Props = {
|
|
18
|
+
items: BreadcrumbItem[];
|
|
19
|
+
separator?: React.ReactNode;
|
|
20
|
+
className?: string;
|
|
21
|
+
as?: LinkComponent;
|
|
22
|
+
};
|
|
23
|
+
export default function Breadcrumbs({ items, separator, className, as }: Props): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styles from './Breadcrumbs.module.css';
|
|
3
|
+
export default function Breadcrumbs({ items, separator = '›', className, as }) {
|
|
4
|
+
const hasExplicitCurrent = items.some((item) => item.current);
|
|
5
|
+
return (_jsx("nav", { className: [styles.breadcrumbs, className].filter(Boolean).join(' '), "aria-label": "Breadcrumbs", children: _jsx("ol", { className: styles.list, children: items.map((item, index) => {
|
|
6
|
+
const key = item.id ?? `${index}-${typeof item.label === 'string' ? item.label : 'item'}`;
|
|
7
|
+
const isLast = index === items.length - 1;
|
|
8
|
+
const isCurrent = item.current ?? (!hasExplicitCurrent && isLast);
|
|
9
|
+
const isDisabled = item.disabled ?? false;
|
|
10
|
+
const LinkTag = item.as ?? as ?? 'a';
|
|
11
|
+
const content = (_jsx("span", { className: styles.label, "aria-current": isCurrent ? 'page' : undefined, children: item.label }));
|
|
12
|
+
return (_jsxs("li", { className: styles.item, children: [item.href && !isDisabled && !isCurrent ? (_jsx(LinkTag, { href: item.href, className: styles.link, onClick: item.onClick, children: content })) : (_jsx("span", { className: [styles.link, isDisabled ? styles.disabled : null].filter(Boolean).join(' '), onClick: isDisabled ? undefined : item.onClick, "aria-disabled": isDisabled ? 'true' : undefined, children: content })), !isLast ? _jsx("span", { className: styles.separator, "aria-hidden": "true", children: separator }) : null] }, key));
|
|
13
|
+
}) }) }));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=Breadcrumbs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.js","sourceRoot":"","sources":["../../../src/components/Breadcrumbs/Breadcrumbs.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,0BAA0B,CAAC;AA0B9C,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAAE,KAAK,EAAE,SAAS,GAAG,GAAG,EAAE,SAAS,EAAE,EAAE,EAAS;IAClF,MAAM,kBAAkB,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAE9D,OAAO,CACL,cAAK,SAAS,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,gBAAa,aAAa,YACjG,aAAI,SAAS,EAAE,MAAM,CAAC,IAAI,YACvB,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;gBACzB,MAAM,GAAG,GAAG,IAAI,CAAC,EAAE,IAAI,GAAG,KAAK,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;gBAC1F,MAAM,MAAM,GAAG,KAAK,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;gBAC1C,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC,kBAAkB,IAAI,MAAM,CAAC,CAAC;gBAClE,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAC;gBAC1C,MAAM,OAAO,GAAG,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,CAAC;gBAErC,MAAM,OAAO,GAAG,CACd,eAAM,SAAS,EAAE,MAAM,CAAC,KAAK,kBAAgB,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,YACxE,IAAI,CAAC,KAAK,GACN,CACR,CAAC;gBAEF,OAAO,CACL,cAAc,SAAS,EAAE,MAAM,CAAC,IAAI,aACjC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CACxC,KAAC,OAAO,IAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,YACpE,OAAO,GACA,CACX,CAAC,CAAC,CAAC,CACF,eACE,SAAS,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EACvF,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,mBAC/B,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,YAE7C,OAAO,GACH,CACR,EACA,CAAC,MAAM,CAAC,CAAC,CAAC,eAAM,SAAS,EAAE,MAAM,CAAC,SAAS,iBAAc,MAAM,YAAE,SAAS,GAAQ,CAAC,CAAC,CAAC,IAAI,KAdnF,GAAG,CAeP,CACN,CAAC;YACJ,CAAC,CAAC,GACC,GACD,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
.breadcrumbs {
|
|
2
|
+
width: 100%;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.list {
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
flex-wrap: wrap;
|
|
9
|
+
gap: 6px;
|
|
10
|
+
list-style: none;
|
|
11
|
+
padding: 0;
|
|
12
|
+
margin: 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.item {
|
|
16
|
+
display: inline-flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
gap: 6px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.link {
|
|
22
|
+
color: var(--color-muted);
|
|
23
|
+
text-decoration: none;
|
|
24
|
+
font-size: 13px;
|
|
25
|
+
transition: color 0.2s ease;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.link:hover {
|
|
29
|
+
color: var(--color-teal);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.label {
|
|
33
|
+
display: inline-flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.separator {
|
|
38
|
+
color: var(--color-muted-2);
|
|
39
|
+
font-size: 12px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.disabled {
|
|
43
|
+
opacity: 0.5;
|
|
44
|
+
cursor: not-allowed;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
[aria-current="page"] {
|
|
48
|
+
color: var(--color-text);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@media (prefers-reduced-motion: reduce) {
|
|
52
|
+
.link {
|
|
53
|
+
transition: none;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { UiVariant } from '../../types';
|
|
3
|
+
type ButtonVariant = UiVariant;
|
|
4
|
+
type ButtonAppearance = 'solid' | 'outline' | 'ghost';
|
|
5
|
+
type Props = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
6
|
+
variant?: ButtonVariant | 'ghost' | 'outline';
|
|
7
|
+
appearance?: ButtonAppearance;
|
|
8
|
+
};
|
|
9
|
+
export default function Button({ variant, appearance, className, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import styles from './Button.module.css';
|
|
3
|
+
const variantClass = {
|
|
4
|
+
default: styles.variantDefault,
|
|
5
|
+
primary: styles.variantPrimary,
|
|
6
|
+
info: styles.variantInfo,
|
|
7
|
+
success: styles.variantSuccess,
|
|
8
|
+
warning: styles.variantWarning,
|
|
9
|
+
danger: styles.variantDanger,
|
|
10
|
+
};
|
|
11
|
+
const appearanceClass = {
|
|
12
|
+
solid: styles.solid,
|
|
13
|
+
outline: styles.outline,
|
|
14
|
+
ghost: styles.ghost,
|
|
15
|
+
};
|
|
16
|
+
const normalizeVariant = (variant, appearance) => {
|
|
17
|
+
if (variant === 'ghost' || variant === 'outline') {
|
|
18
|
+
return { variant: 'primary', appearance: variant };
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
variant: variant ?? 'primary',
|
|
22
|
+
appearance: appearance ?? 'solid',
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export default function Button({ variant, appearance, className, ...props }) {
|
|
26
|
+
const resolved = normalizeVariant(variant, appearance);
|
|
27
|
+
const classes = [
|
|
28
|
+
styles.button,
|
|
29
|
+
variantClass[resolved.variant],
|
|
30
|
+
appearanceClass[resolved.appearance],
|
|
31
|
+
className,
|
|
32
|
+
]
|
|
33
|
+
.filter(Boolean)
|
|
34
|
+
.join(' ');
|
|
35
|
+
return _jsx("button", { className: classes, ...props });
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=Button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAWzC,MAAM,YAAY,GAAkC;IAClD,OAAO,EAAE,MAAM,CAAC,cAAc;IAC9B,OAAO,EAAE,MAAM,CAAC,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC,WAAW;IACxB,OAAO,EAAE,MAAM,CAAC,cAAc;IAC9B,OAAO,EAAE,MAAM,CAAC,cAAc;IAC9B,MAAM,EAAE,MAAM,CAAC,aAAa;CAC7B,CAAC;AAEF,MAAM,eAAe,GAAqC;IACxD,KAAK,EAAE,MAAM,CAAC,KAAK;IACnB,OAAO,EAAE,MAAM,CAAC,OAAO;IACvB,KAAK,EAAE,MAAM,CAAC,KAAK;CACpB,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAC,OAA6C,EAAE,UAA6B,EAAE,EAAE;IACxG,IAAI,OAAO,KAAK,OAAO,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QACjD,OAAO,EAAE,OAAO,EAAE,SAA0B,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;IACtE,CAAC;IAED,OAAO;QACL,OAAO,EAAE,OAAO,IAAI,SAAS;QAC7B,UAAU,EAAE,UAAU,IAAI,OAAO;KAClC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,KAAK,EAAS;IAChF,MAAM,QAAQ,GAAG,gBAAgB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG;QACd,MAAM,CAAC,MAAM;QACb,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC;QAC9B,eAAe,CAAC,QAAQ,CAAC,UAAU,CAAC;QACpC,SAAS;KACV;SACE,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,iBAAQ,SAAS,EAAE,OAAO,KAAM,KAAK,GAAI,CAAC;AACnD,CAAC"}
|