@matushini/clover-view-ui 0.0.0-stage → 0.1.0-beta.2
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 +183 -2
- package/dist/index.css +230 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.js +105 -0
- package/dist/index.js.map +1 -0
- package/package.json +113 -4
package/README.md
CHANGED
|
@@ -1,3 +1,184 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @matushini/clover-view-ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Библиотека React-компонентов с TypeScript, CSS Modules и готовой документацией в Storybook.
|
|
4
|
+
|
|
5
|
+
## Установка
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @matushini/clover-view-ui
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Требования: React 19 (peer-зависимость).
|
|
12
|
+
|
|
13
|
+
### Каналы версий
|
|
14
|
+
|
|
15
|
+
| Команда | Канал | Когда использовать |
|
|
16
|
+
| -------------------------------------------- | -------- | -------------------------------------- |
|
|
17
|
+
| `npm install @matushini/clover-view-ui` | `latest` | стабильные версии для продакшена |
|
|
18
|
+
| `npm install @matushini/clover-view-ui@beta` | `beta` | предварительные версии из ветки `next` |
|
|
19
|
+
|
|
20
|
+
Beta-версии имеют суффикс (`0.1.0-beta.1`) и могут содержать несовместимые изменения API.
|
|
21
|
+
|
|
22
|
+
## Быстрый старт
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import { Button, Input, Checkbox } from '@matushini/clover-view-ui';
|
|
26
|
+
import '@matushini/clover-view-ui/styles.css';
|
|
27
|
+
|
|
28
|
+
export function Example() {
|
|
29
|
+
return (
|
|
30
|
+
<form>
|
|
31
|
+
<Input label="Email" type="email" placeholder="user@example.com" required />
|
|
32
|
+
<Checkbox label="Согласен с условиями" />
|
|
33
|
+
<Button variant="primary" type="submit">
|
|
34
|
+
Отправить
|
|
35
|
+
</Button>
|
|
36
|
+
</form>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
> Стили компонентов подключаются один раз на приложение: `import '@matushini/clover-view-ui/styles.css'`.
|
|
42
|
+
|
|
43
|
+
## Компоненты
|
|
44
|
+
|
|
45
|
+
### Button
|
|
46
|
+
|
|
47
|
+
Кнопка действий. Нативный `<button>`, работает с клавиатуры (Tab, Enter, Space).
|
|
48
|
+
|
|
49
|
+
| Prop | Тип | По умолчанию | Описание |
|
|
50
|
+
| ---------- | ------------------------------------------------- | ------------ | ------------------------------------- |
|
|
51
|
+
| `variant` | `'primary' \| 'secondary' \| 'ghost' \| 'danger'` | `'primary'` | Визуальный вариант |
|
|
52
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Размер |
|
|
53
|
+
| `loading` | `boolean` | `false` | Спиннер, блокирует клики, `aria-busy` |
|
|
54
|
+
| `disabled` | `boolean` | `false` | Отключена |
|
|
55
|
+
| остальные | `ButtonHTMLAttributes` | — | Прокидываются в `<button>` |
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
<Button variant="danger" size="sm" onClick={handleDelete}>
|
|
59
|
+
Удалить
|
|
60
|
+
</Button>
|
|
61
|
+
|
|
62
|
+
<Button loading>Сохранение…</Button>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Input
|
|
66
|
+
|
|
67
|
+
Текстовое поле. Поддерживает controlled (`value` + `onChange`) и uncontrolled (`defaultValue`) сценарии.
|
|
68
|
+
|
|
69
|
+
| Prop | Тип | По умолчанию | Описание |
|
|
70
|
+
| ---------- | --------------------- | ------------ | --------------------------------------------- |
|
|
71
|
+
| `label` | `string` | — | Label над полем (связан через `htmlFor`) |
|
|
72
|
+
| `error` | `string` | — | Текст ошибки; `aria-invalid` + `role="alert"` |
|
|
73
|
+
| `hint` | `string` | — | Подсказка под полем (скрывается при error) |
|
|
74
|
+
| `required` | `boolean` | `false` | Обязательное поле |
|
|
75
|
+
| остальные | `InputHTMLAttributes` | — | Прокидываются в `<input>` |
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
// controlled
|
|
79
|
+
const [email, setEmail] = useState('');
|
|
80
|
+
<Input label="Email" value={email} onChange={(e) => setEmail(e.target.value)} />
|
|
81
|
+
|
|
82
|
+
// error
|
|
83
|
+
<Input label="Пароль" type="password" error="Минимум 8 символов" />
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Checkbox
|
|
87
|
+
|
|
88
|
+
Чекбокс на нативном `<input type="checkbox">`.
|
|
89
|
+
|
|
90
|
+
| Prop | Тип | По умолчанию | Описание |
|
|
91
|
+
| ---------------------------- | --------------------- | ------------ | ------------------------------------------------ |
|
|
92
|
+
| `label` | `ReactNode` | — | Текст рядом (связан через `htmlFor`) |
|
|
93
|
+
| `indeterminate` | `boolean` | `false` | Промежуточное состояние (`aria-checked="mixed"`) |
|
|
94
|
+
| `checked` / `defaultChecked` | `boolean` | — | Controlled / uncontrolled |
|
|
95
|
+
| `disabled` | `boolean` | `false` | Отключен |
|
|
96
|
+
| остальные | `InputHTMLAttributes` | — | Прокидываются в `<input>` |
|
|
97
|
+
|
|
98
|
+
```tsx
|
|
99
|
+
<Checkbox label="Уведомления" checked={on} onChange={(e) => setOn(e.target.checked)} />
|
|
100
|
+
<Checkbox label="Частично" indeterminate />
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Доступность
|
|
104
|
+
|
|
105
|
+
- семантические нативные элементы (`button`, `input`, `label`) — фокус и клавиатура из коробки;
|
|
106
|
+
- ARIA добавляется только там, где это нужно (`aria-busy`, `aria-invalid`, `aria-describedby`, `aria-checked="mixed"`);
|
|
107
|
+
- видимый фокус (`:focus-visible`) и учтён `prefers-reduced-motion`.
|
|
108
|
+
|
|
109
|
+
## Разработка
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
npm install # установка зависимостей (подключает git-хуки)
|
|
113
|
+
npm run storybook # Storybook на http://localhost:6006
|
|
114
|
+
npm run build # сборка библиотеки в dist/
|
|
115
|
+
npm run test # unit-тесты (Vitest + тесты stories)
|
|
116
|
+
npm run test:coverage # unit-тесты с покрытием
|
|
117
|
+
npm run test:visual # скриншотные тесты (Playwright против Storybook)
|
|
118
|
+
npm run typecheck # проверка типов
|
|
119
|
+
npm run lint # ESLint
|
|
120
|
+
npm run format # Prettier
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Pre-commit (husky + lint-staged): авто-fix lint/формата по staged-файлам + прогон unit-тестов.
|
|
124
|
+
|
|
125
|
+
## CI (GitHub Actions)
|
|
126
|
+
|
|
127
|
+
| Workflow | Триггер | Что делает |
|
|
128
|
+
| ----------------------------- | ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
129
|
+
| `ci.yml` | `pull_request` → `main` | Install → параллельно Lint, Typecheck, Unit tests, Build (lib + Storybook + `npm pack`), Visual tests; при падении — артефакты (coverage, скриншоты-диффы, trace) |
|
|
130
|
+
| `update-visual-snapshots.yml` | `workflow_dispatch` (вручную) | Пересъёмка эталонов скриншотов на ubuntu и коммит в выбранную ветку (`[skip ci]`) |
|
|
131
|
+
| `beta-release.yml` | `push` → `next` (+ dispatch) | Guard'ы prerelease-состояния → проверки (lint/typecheck/unit/visual/build) → `changeset publish --no-git-tag` (тег `beta` — из `pre.json`). Без git-записей. Требует secret `NPM_TOKEN` |
|
|
132
|
+
|
|
133
|
+
Публикация пакета и деплой Storybook на обычном PR не выполняются.
|
|
134
|
+
|
|
135
|
+
### Обязательные status checks для merge
|
|
136
|
+
|
|
137
|
+
Настройка репозитория (однократно): **Settings → Branches → branch protection rule для `main`**:
|
|
138
|
+
|
|
139
|
+
1. Enable _Require a pull request before merging_;
|
|
140
|
+
2. Enable _Require status checks to pass before merging_ и выбрать: `Lint`, `Typecheck`, `Unit tests`, `Build`, `Visual tests`;
|
|
141
|
+
3. (опционально) _Require branches to be up to date before merging_.
|
|
142
|
+
|
|
143
|
+
### Эталоны визуальных тестов
|
|
144
|
+
|
|
145
|
+
Эталоны в `tests/visual/__screenshots__/` снимаются в **linux-окружении** (ubuntu, версия Playwright зафиксирована lock-файлом). Локальный запуск `npm run test:visual` на macOS может показывать расхождения по шрифтам — это ожидаемо. Обновление эталонов — только вручную через workflow **Update visual snapshots** (или локально на linux). Автоматическое обновление в CI запрещено.
|
|
146
|
+
|
|
147
|
+
## Релизы
|
|
148
|
+
|
|
149
|
+
Версионирование — SemVer через [Changesets](https://github.com/changesets/changesets). Схема: **`main` → стабильные релизы (`latest`)**, **`next` → beta (`X.Y.Z-beta.N`, dist-tag `beta`)**.
|
|
150
|
+
|
|
151
|
+
### Beta (ветка `next`)
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
# один раз
|
|
155
|
+
git checkout -b next origin/main
|
|
156
|
+
npx changeset pre enter beta && git add .changeset/pre.json && git commit -m "chore: enter beta mode" && git push -u origin next
|
|
157
|
+
|
|
158
|
+
# каждый релиз
|
|
159
|
+
npm run changeset # описать изменение
|
|
160
|
+
npx changeset version # X.Y.Z-beta.N+1 (+ changelog)
|
|
161
|
+
git commit -am "chore(release): X.Y.Z-beta.N+1" && git push # → CI публикует
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Установка beta: `npm install @matushini/clover-view-ui@beta`. Без тега npm ставит стабильную `latest`.
|
|
165
|
+
|
|
166
|
+
**Настройка npm Trusted Publisher** (однократно, npmjs.com → пакет → Settings → Trusted publishing):
|
|
167
|
+
|
|
168
|
+
| Поле | Значение |
|
|
169
|
+
| -------------------- | ----------------------------------------- |
|
|
170
|
+
| Organization or user | `Matushini97` |
|
|
171
|
+
| Repository | `clover-view` |
|
|
172
|
+
| Workflow filename | `beta-release.yml` |
|
|
173
|
+
| Environment | пусто |
|
|
174
|
+
| **Allowed actions** | ✅ **Allow `npm publish`** (обязательно!) |
|
|
175
|
+
|
|
176
|
+
⚠️ Конфигурации, созданные после 03.09.2026, по умолчанию разрешают только `npm stage publish`. Без явного «Allow npm publish» публикация из CI падает с `E403: OIDC permission denied for this action`. Также `repository.url` в `package.json` должен точно совпадать с GitHub-репозиторием.
|
|
177
|
+
|
|
178
|
+
Завершение prerelease (руками, без автомерджа): в `next` — `npx changeset pre exit && npx changeset version`, затем PR `next` → `main`. Подробно — [docs/release-process.md](docs/release-process.md).
|
|
179
|
+
|
|
180
|
+
### Stable
|
|
181
|
+
|
|
182
|
+
Stable-workflow (Changesets Release PR → publish `latest`) настраивается отдельно (Этап 11). Обычный merge в `main` ничего не публикует.
|
|
183
|
+
|
|
184
|
+
Подробная схема CI/CD — в [docs/cicd-theory.md](docs/cicd-theory.md).
|
package/dist/index.css
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
.Button-module_button__2ZuB7 {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
gap: 8px;
|
|
6
|
+
border: 1px solid transparent;
|
|
7
|
+
border-radius: 8px;
|
|
8
|
+
font-family: inherit;
|
|
9
|
+
font-weight: 500;
|
|
10
|
+
line-height: 1.25;
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
transition:
|
|
13
|
+
background-color 0.15s ease,
|
|
14
|
+
border-color 0.15s ease,
|
|
15
|
+
color 0.15s ease;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.Button-module_button__2ZuB7:focus-visible {
|
|
19
|
+
outline: 2px solid #3b82f6;
|
|
20
|
+
outline-offset: 2px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.Button-module_button__2ZuB7:disabled {
|
|
24
|
+
cursor: not-allowed;
|
|
25
|
+
opacity: 0.55;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* Размеры */
|
|
29
|
+
.Button-module_sm__NhG0g {
|
|
30
|
+
padding: 4px 12px;
|
|
31
|
+
font-size: 13px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.Button-module_md__hH4h3 {
|
|
35
|
+
padding: 8px 16px;
|
|
36
|
+
font-size: 14px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.Button-module_lg__2plQf {
|
|
40
|
+
padding: 12px 20px;
|
|
41
|
+
font-size: 16px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Варианты */
|
|
45
|
+
.Button-module_primary__s1sM6 {
|
|
46
|
+
background-color: #2563eb;
|
|
47
|
+
color: #ffffff;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.Button-module_primary__s1sM6:hover:not(:disabled) {
|
|
51
|
+
background-color: #1d4ed8;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.Button-module_secondary__R0waJ {
|
|
55
|
+
background-color: #ffffff;
|
|
56
|
+
border-color: #d1d5db;
|
|
57
|
+
color: #111827;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.Button-module_secondary__R0waJ:hover:not(:disabled) {
|
|
61
|
+
background-color: #f3f4f6;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.Button-module_ghost__1KINV {
|
|
65
|
+
background-color: transparent;
|
|
66
|
+
color: #2563eb;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.Button-module_ghost__1KINV:hover:not(:disabled) {
|
|
70
|
+
background-color: #eff6ff;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.Button-module_danger__V4fX8 {
|
|
74
|
+
background-color: #dc2626;
|
|
75
|
+
color: #ffffff;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.Button-module_danger__V4fX8:hover:not(:disabled) {
|
|
79
|
+
background-color: #b91c1c;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* Loading */
|
|
83
|
+
.Button-module_spinner__ZExvW {
|
|
84
|
+
width: 1em;
|
|
85
|
+
height: 1em;
|
|
86
|
+
flex-shrink: 0;
|
|
87
|
+
border: 2px solid currentColor;
|
|
88
|
+
border-top-color: transparent;
|
|
89
|
+
border-radius: 50%;
|
|
90
|
+
animation: Button-module_button-spin__pv-6a 0.7s linear infinite;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.Button-module_contentHidden__4lBQL {
|
|
94
|
+
visibility: hidden;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.Button-module_content__EKXmF {
|
|
98
|
+
display: inline-flex;
|
|
99
|
+
align-items: center;
|
|
100
|
+
gap: 8px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@keyframes Button-module_button-spin__pv-6a {
|
|
104
|
+
to {
|
|
105
|
+
transform: rotate(360deg);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@media (prefers-reduced-motion: reduce) {
|
|
110
|
+
.Button-module_button__2ZuB7 {
|
|
111
|
+
transition: none;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.Button-module_spinner__ZExvW {
|
|
115
|
+
animation-duration: 1.5s;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.Input-module_wrapper__iHNUs {
|
|
120
|
+
display: flex;
|
|
121
|
+
flex-direction: column;
|
|
122
|
+
gap: 4px;
|
|
123
|
+
font-family: inherit;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.Input-module_label__-OEBL {
|
|
127
|
+
font-size: 14px;
|
|
128
|
+
font-weight: 500;
|
|
129
|
+
color: #111827;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.Input-module_required__CTss- {
|
|
133
|
+
margin-left: 2px;
|
|
134
|
+
color: #dc2626;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.Input-module_input__WjT81 {
|
|
138
|
+
box-sizing: border-box;
|
|
139
|
+
width: 100%;
|
|
140
|
+
padding: 8px 12px;
|
|
141
|
+
border: 1px solid #d1d5db;
|
|
142
|
+
border-radius: 8px;
|
|
143
|
+
background-color: #ffffff;
|
|
144
|
+
font: inherit;
|
|
145
|
+
font-size: 14px;
|
|
146
|
+
color: #111827;
|
|
147
|
+
transition: border-color 0.15s ease;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.Input-module_input__WjT81::placeholder {
|
|
151
|
+
color: #9ca3af;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.Input-module_input__WjT81:hover:not(:disabled):not(.Input-module_inputError__XAjMD) {
|
|
155
|
+
border-color: #9ca3af;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.Input-module_input__WjT81:focus {
|
|
159
|
+
outline: none;
|
|
160
|
+
border-color: #2563eb;
|
|
161
|
+
box-shadow: 0 0 0 3px rgb(37 99 235 / 15%);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.Input-module_input__WjT81:disabled {
|
|
165
|
+
background-color: #f3f4f6;
|
|
166
|
+
cursor: not-allowed;
|
|
167
|
+
color: #6b7280;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.Input-module_inputError__XAjMD,
|
|
171
|
+
.Input-module_inputError__XAjMD:hover {
|
|
172
|
+
border-color: #dc2626;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.Input-module_inputError__XAjMD:focus {
|
|
176
|
+
border-color: #dc2626;
|
|
177
|
+
box-shadow: 0 0 0 3px rgb(220 38 38 / 15%);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.Input-module_error__VLISa {
|
|
181
|
+
margin: 0;
|
|
182
|
+
font-size: 13px;
|
|
183
|
+
color: #dc2626;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.Input-module_hint__VsJst {
|
|
187
|
+
margin: 0;
|
|
188
|
+
font-size: 13px;
|
|
189
|
+
color: #6b7280;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.Checkbox-module_wrapper__rpthW {
|
|
193
|
+
display: inline-flex;
|
|
194
|
+
align-items: center;
|
|
195
|
+
gap: 8px;
|
|
196
|
+
font-family: inherit;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.Checkbox-module_checkbox__lSeQj {
|
|
200
|
+
width: 16px;
|
|
201
|
+
height: 16px;
|
|
202
|
+
margin: 0;
|
|
203
|
+
flex-shrink: 0;
|
|
204
|
+
accent-color: #2563eb;
|
|
205
|
+
cursor: pointer;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.Checkbox-module_checkbox__lSeQj:disabled {
|
|
209
|
+
cursor: not-allowed;
|
|
210
|
+
opacity: 0.55;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.Checkbox-module_checkbox__lSeQj:focus-visible {
|
|
214
|
+
outline: 2px solid #3b82f6;
|
|
215
|
+
outline-offset: 2px;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.Checkbox-module_label__cwRtI {
|
|
219
|
+
font-size: 14px;
|
|
220
|
+
color: #111827;
|
|
221
|
+
cursor: pointer;
|
|
222
|
+
user-select: none;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.Checkbox-module_labelDisabled__EQ5TU {
|
|
226
|
+
cursor: not-allowed;
|
|
227
|
+
color: #6b7280;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/*# sourceMappingURL=index.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Button.module.css","Input.module.css","Checkbox.module.css"],"names":[],"mappings":"AAAA;EACE,oBAAoB;EACpB,mBAAmB;EACnB,uBAAuB;EACvB,QAAQ;EACR,6BAA6B;EAC7B,kBAAkB;EAClB,oBAAoB;EACpB,gBAAgB;EAChB,iBAAiB;EACjB,eAAe;EACf;;;oBAGkB;AACpB;;AAEA;EACE,0BAA0B;EAC1B,mBAAmB;AACrB;;AAEA;EACE,mBAAmB;EACnB,aAAa;AACf;;AAEA,YAAY;AACZ;EACE,iBAAiB;EACjB,eAAe;AACjB;;AAEA;EACE,iBAAiB;EACjB,eAAe;AACjB;;AAEA;EACE,kBAAkB;EAClB,eAAe;AACjB;;AAEA,aAAa;AACb;EACE,yBAAyB;EACzB,cAAc;AAChB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ACE,WAAW;EACX,YAAY;EACZ,SAAS;EACT,cAAc;EACd,qBAAqB;EACrB,eAAe;AACjB;;AAEA;EACE,mBAAmB;EACnB,aAAa;AACf;;AAEA;EACE,0BAA0B;EAC1B,mBAAmB;AACrB;;AAEA;EACE,eAAe;EACf,cAAc;EACd,eAAe;EACf,iBAAiB;AACnB;;AAEA;EACE,mBAAmB;EACnB,cAAc;AAChB","file":"index.css","sourcesContent":[".button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n border: 1px solid transparent;\n border-radius: 8px;\n font-family: inherit;\n font-weight: 500;\n line-height: 1.25;\n cursor: pointer;\n transition:\n background-color 0.15s ease,\n border-color 0.15s ease,\n color 0.15s ease;\n}\n\n.button:focus-visible {\n outline: 2px solid #3b82f6;\n outline-offset: 2px;\n}\n\n.button:disabled {\n cursor: not-allowed;\n opacity: 0.55;\n}\n\n/* Размеры */\n.sm {\n padding: 4px 12px;\n font-size: 13px;\n}\n\n.md {\n padding: 8px 16px;\n font-size: 14px;\n}\n\n.lg {\n padding: 12px 20px;\n font-size: 16px;\n}\n\n/* Варианты */\n.primary {\n background-color: #2563eb;\n color: #ffffff;\n}\n\n.primary:hover:not(:disabled) {\n background-color: #1d4ed8;\n}\n\n.secondary {\n background-color: #ffffff;\n border-color: #d1d5db;\n color: #111827;\n}\n\n.secondary:hover:not(:disabled) {\n background-color: #f3f4f6;\n}\n\n.ghost {\n background-color: transparent;\n color: #2563eb;\n}\n\n.ghost:hover:not(:disabled) {\n background-color: #eff6ff;\n}\n\n.danger {\n background-color: #dc2626;\n color: #ffffff;\n}\n\n.danger:hover:not(:disabled) {\n background-color: #b91c1c;\n}\n\n/* Loading */\n.spinner {\n width: 1em;\n height: 1em;\n flex-shrink: 0;\n border: 2px solid currentColor;\n border-top-color: transparent;\n border-radius: 50%;\n animation: button-spin 0.7s linear infinite;\n}\n\n.contentHidden {\n visibility: hidden;\n}\n\n.content {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n}\n\n@keyframes button-spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .button {\n transition: none;\n }\n\n .spinner {\n animation-duration: 1.5s;\n }\n}\n",".wrapper {\n display: flex;\n flex-direction: column;\n gap: 4px;\n font-family: inherit;\n}\n\n.label {\n font-size: 14px;\n font-weight: 500;\n color: #111827;\n}\n\n.required {\n margin-left: 2px;\n color: #dc2626;\n}\n\n.input {\n box-sizing: border-box;\n width: 100%;\n padding: 8px 12px;\n border: 1px solid #d1d5db;\n border-radius: 8px;\n background-color: #ffffff;\n font: inherit;\n font-size: 14px;\n color: #111827;\n transition: border-color 0.15s ease;\n}\n\n.input::placeholder {\n color: #9ca3af;\n}\n\n.input:hover:not(:disabled):not(.inputError) {\n border-color: #9ca3af;\n}\n\n.input:focus {\n outline: none;\n border-color: #2563eb;\n box-shadow: 0 0 0 3px rgb(37 99 235 / 15%);\n}\n\n.input:disabled {\n background-color: #f3f4f6;\n cursor: not-allowed;\n color: #6b7280;\n}\n\n.inputError,\n.inputError:hover {\n border-color: #dc2626;\n}\n\n.inputError:focus {\n border-color: #dc2626;\n box-shadow: 0 0 0 3px rgb(220 38 38 / 15%);\n}\n\n.error {\n margin: 0;\n font-size: 13px;\n color: #dc2626;\n}\n\n.hint {\n margin: 0;\n font-size: 13px;\n color: #6b7280;\n}\n",".wrapper {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n font-family: inherit;\n}\n\n.checkbox {\n width: 16px;\n height: 16px;\n margin: 0;\n flex-shrink: 0;\n accent-color: #2563eb;\n cursor: pointer;\n}\n\n.checkbox:disabled {\n cursor: not-allowed;\n opacity: 0.55;\n}\n\n.checkbox:focus-visible {\n outline: 2px solid #3b82f6;\n outline-offset: 2px;\n}\n\n.label {\n font-size: 14px;\n color: #111827;\n cursor: pointer;\n user-select: none;\n}\n\n.labelDisabled {\n cursor: not-allowed;\n color: #6b7280;\n}\n"]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ButtonHTMLAttributes, ReactNode, InputHTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
5
|
+
type ButtonSize = 'sm' | 'md' | 'lg';
|
|
6
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
7
|
+
/** Визуальный вариант кнопки */
|
|
8
|
+
variant?: ButtonVariant;
|
|
9
|
+
/** Размер кнопки */
|
|
10
|
+
size?: ButtonSize;
|
|
11
|
+
/** Индикатор загрузки: блокирует клики и показывает спиннер */
|
|
12
|
+
loading?: boolean;
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Кнопка действий.
|
|
17
|
+
* Нативный `<button>`: фокус с клавиатуры, Enter/Space и disabled работают из коробки.
|
|
18
|
+
*/
|
|
19
|
+
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
20
|
+
|
|
21
|
+
interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
22
|
+
/** Текст label над полем. Если не передан, label не рендерится */
|
|
23
|
+
label?: string;
|
|
24
|
+
/** Текст ошибки под полем; поле помечается aria-invalid */
|
|
25
|
+
error?: string;
|
|
26
|
+
/** Дополнительная подсказка под полем */
|
|
27
|
+
hint?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Текстовое поле ввода.
|
|
31
|
+
* Поддерживает controlled/uncontrolled сценарии (через value/defaultValue нативного input),
|
|
32
|
+
* label связан с полем по id, ошибка доступна скринридерам через aria-describedby.
|
|
33
|
+
*/
|
|
34
|
+
declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
|
|
35
|
+
|
|
36
|
+
interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
37
|
+
/** Текст рядом с чекбоксом */
|
|
38
|
+
label?: ReactNode;
|
|
39
|
+
/** Промежуточное состояние (частично отмечено). Устанавливается только кодом */
|
|
40
|
+
indeterminate?: boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Чекбокс.
|
|
44
|
+
* Нативный `<input type="checkbox">`: пробел, фокус и группировка с клавиатуры работают из коробки.
|
|
45
|
+
*/
|
|
46
|
+
declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLInputElement>>;
|
|
47
|
+
|
|
48
|
+
export { Button, Checkbox, Input };
|
|
49
|
+
export type { ButtonProps, ButtonSize, ButtonVariant, CheckboxProps, InputProps };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef, useId, useRef, useEffect } from 'react';
|
|
3
|
+
|
|
4
|
+
var styles$2 = {"button":"Button-module_button__2ZuB7","sm":"Button-module_sm__NhG0g","md":"Button-module_md__hH4h3","lg":"Button-module_lg__2plQf","primary":"Button-module_primary__s1sM6","secondary":"Button-module_secondary__R0waJ","ghost":"Button-module_ghost__1KINV","danger":"Button-module_danger__V4fX8","spinner":"Button-module_spinner__ZExvW","button-spin":"Button-module_button-spin__pv-6a","contentHidden":"Button-module_contentHidden__4lBQL","content":"Button-module_content__EKXmF"};
|
|
5
|
+
|
|
6
|
+
const Button = forwardRef(function Button2({
|
|
7
|
+
variant = "primary",
|
|
8
|
+
size = "md",
|
|
9
|
+
loading = false,
|
|
10
|
+
disabled,
|
|
11
|
+
className,
|
|
12
|
+
children,
|
|
13
|
+
type,
|
|
14
|
+
...rest
|
|
15
|
+
}, ref) {
|
|
16
|
+
const isDisabled = disabled || loading;
|
|
17
|
+
return /* @__PURE__ */ jsxs(
|
|
18
|
+
"button",
|
|
19
|
+
{
|
|
20
|
+
ref,
|
|
21
|
+
type: type ?? "button",
|
|
22
|
+
disabled: isDisabled,
|
|
23
|
+
"aria-busy": loading || void 0,
|
|
24
|
+
className: [styles$2.button, styles$2[variant], styles$2[size], className].filter(Boolean).join(" "),
|
|
25
|
+
...rest,
|
|
26
|
+
children: [
|
|
27
|
+
loading && /* @__PURE__ */ jsx("span", { className: styles$2.spinner, "aria-hidden": "true" }),
|
|
28
|
+
/* @__PURE__ */ jsx("span", { className: loading ? styles$2.contentHidden : styles$2.content, children })
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
var styles$1 = {"wrapper":"Input-module_wrapper__iHNUs","label":"Input-module_label__-OEBL","required":"Input-module_required__CTss-","input":"Input-module_input__WjT81","inputError":"Input-module_inputError__XAjMD","error":"Input-module_error__VLISa","hint":"Input-module_hint__VsJst"};
|
|
35
|
+
|
|
36
|
+
const Input = forwardRef(function Input2({ label, error, hint, id, required, className, ...rest }, ref) {
|
|
37
|
+
const autoId = useId();
|
|
38
|
+
const inputId = id ?? autoId;
|
|
39
|
+
const describedBy = [error && `${inputId}-error`, hint && `${inputId}-hint`].filter(Boolean).join(" ");
|
|
40
|
+
return /* @__PURE__ */ jsxs("div", { className: [styles$1.wrapper, className].filter(Boolean).join(" "), children: [
|
|
41
|
+
label && /* @__PURE__ */ jsxs("label", { className: styles$1.label, htmlFor: inputId, children: [
|
|
42
|
+
label,
|
|
43
|
+
required && /* @__PURE__ */ jsx("span", { className: styles$1.required, "aria-hidden": "true", children: "*" })
|
|
44
|
+
] }),
|
|
45
|
+
/* @__PURE__ */ jsx(
|
|
46
|
+
"input",
|
|
47
|
+
{
|
|
48
|
+
ref,
|
|
49
|
+
id: inputId,
|
|
50
|
+
required,
|
|
51
|
+
"aria-invalid": error ? true : void 0,
|
|
52
|
+
"aria-describedby": describedBy || void 0,
|
|
53
|
+
className: [styles$1.input, error ? styles$1.inputError : null].filter(Boolean).join(" "),
|
|
54
|
+
...rest
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
error && /* @__PURE__ */ jsx("p", { id: `${inputId}-error`, className: styles$1.error, role: "alert", children: error }),
|
|
58
|
+
hint && !error && /* @__PURE__ */ jsx("p", { id: `${inputId}-hint`, className: styles$1.hint, children: hint })
|
|
59
|
+
] });
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
var styles = {"wrapper":"Checkbox-module_wrapper__rpthW","checkbox":"Checkbox-module_checkbox__lSeQj","label":"Checkbox-module_label__cwRtI","labelDisabled":"Checkbox-module_labelDisabled__EQ5TU"};
|
|
63
|
+
|
|
64
|
+
const Checkbox = forwardRef(function Checkbox2({ label, indeterminate = false, id, className, disabled, ...rest }, ref) {
|
|
65
|
+
const autoId = useId();
|
|
66
|
+
const checkboxId = id ?? autoId;
|
|
67
|
+
const innerRef = useRef(null);
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
if (innerRef.current) {
|
|
70
|
+
innerRef.current.indeterminate = indeterminate;
|
|
71
|
+
}
|
|
72
|
+
}, [indeterminate]);
|
|
73
|
+
return /* @__PURE__ */ jsxs("div", { className: [styles.wrapper, className].filter(Boolean).join(" "), children: [
|
|
74
|
+
/* @__PURE__ */ jsx(
|
|
75
|
+
"input",
|
|
76
|
+
{
|
|
77
|
+
ref: (node) => {
|
|
78
|
+
innerRef.current = node;
|
|
79
|
+
if (typeof ref === "function") {
|
|
80
|
+
ref(node);
|
|
81
|
+
} else if (ref) {
|
|
82
|
+
ref.current = node;
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
id: checkboxId,
|
|
86
|
+
type: "checkbox",
|
|
87
|
+
disabled,
|
|
88
|
+
"aria-checked": indeterminate ? "mixed" : void 0,
|
|
89
|
+
className: styles.checkbox,
|
|
90
|
+
...rest
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
label && /* @__PURE__ */ jsx(
|
|
94
|
+
"label",
|
|
95
|
+
{
|
|
96
|
+
htmlFor: checkboxId,
|
|
97
|
+
className: [styles.label, disabled ? styles.labelDisabled : null].filter(Boolean).join(" "),
|
|
98
|
+
children: label
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
] });
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
export { Button, Checkbox, Input };
|
|
105
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/components/Button/Button.tsx","../src/components/Input/Input.tsx","../src/components/Checkbox/Checkbox.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport type { ButtonHTMLAttributes, ReactNode } from 'react';\nimport styles from './Button.module.css';\n\nexport type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';\nexport type ButtonSize = 'sm' | 'md' | 'lg';\n\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /** Визуальный вариант кнопки */\n variant?: ButtonVariant;\n /** Размер кнопки */\n size?: ButtonSize;\n /** Индикатор загрузки: блокирует клики и показывает спиннер */\n loading?: boolean;\n children?: ReactNode;\n}\n\n/**\n * Кнопка действий.\n * Нативный `<button>`: фокус с клавиатуры, Enter/Space и disabled работают из коробки.\n */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n variant = 'primary',\n size = 'md',\n loading = false,\n disabled,\n className,\n children,\n type,\n ...rest\n },\n ref,\n) {\n const isDisabled = disabled || loading;\n\n return (\n <button\n ref={ref}\n type={type ?? 'button'}\n disabled={isDisabled}\n aria-busy={loading || undefined}\n className={[styles.button, styles[variant], styles[size], className]\n .filter(Boolean)\n .join(' ')}\n {...rest}\n >\n {loading && <span className={styles.spinner} aria-hidden=\"true\" />}\n <span className={loading ? styles.contentHidden : styles.content}>{children}</span>\n </button>\n );\n});\n","import { forwardRef, useId } from 'react';\nimport type { InputHTMLAttributes } from 'react';\nimport styles from './Input.module.css';\n\nexport interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {\n /** Текст label над полем. Если не передан, label не рендерится */\n label?: string;\n /** Текст ошибки под полем; поле помечается aria-invalid */\n error?: string;\n /** Дополнительная подсказка под полем */\n hint?: string;\n}\n\n/**\n * Текстовое поле ввода.\n * Поддерживает controlled/uncontrolled сценарии (через value/defaultValue нативного input),\n * label связан с полем по id, ошибка доступна скринридерам через aria-describedby.\n */\nexport const Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n { label, error, hint, id, required, className, ...rest },\n ref,\n) {\n const autoId = useId();\n const inputId = id ?? autoId;\n const describedBy = [error && `${inputId}-error`, hint && `${inputId}-hint`]\n .filter(Boolean)\n .join(' ');\n\n return (\n <div className={[styles.wrapper, className].filter(Boolean).join(' ')}>\n {label && (\n <label className={styles.label} htmlFor={inputId}>\n {label}\n {required && (\n <span className={styles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n <input\n ref={ref}\n id={inputId}\n required={required}\n aria-invalid={error ? true : undefined}\n aria-describedby={describedBy || undefined}\n className={[styles.input, error ? styles.inputError : null].filter(Boolean).join(' ')}\n {...rest}\n />\n {error && (\n <p id={`${inputId}-error`} className={styles.error} role=\"alert\">\n {error}\n </p>\n )}\n {hint && !error && (\n <p id={`${inputId}-hint`} className={styles.hint}>\n {hint}\n </p>\n )}\n </div>\n );\n});\n","import { forwardRef, useEffect, useId, useRef } from 'react';\nimport type { InputHTMLAttributes, ReactNode } from 'react';\nimport styles from './Checkbox.module.css';\n\nexport interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {\n /** Текст рядом с чекбоксом */\n label?: ReactNode;\n /** Промежуточное состояние (частично отмечено). Устанавливается только кодом */\n indeterminate?: boolean;\n}\n\n/**\n * Чекбокс.\n * Нативный `<input type=\"checkbox\">`: пробел, фокус и группировка с клавиатуры работают из коробки.\n */\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n { label, indeterminate = false, id, className, disabled, ...rest },\n ref,\n) {\n const autoId = useId();\n const checkboxId = id ?? autoId;\n const innerRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (innerRef.current) {\n innerRef.current.indeterminate = indeterminate;\n }\n }, [indeterminate]);\n\n return (\n <div className={[styles.wrapper, className].filter(Boolean).join(' ')}>\n <input\n ref={(node) => {\n innerRef.current = node;\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n }}\n id={checkboxId}\n type=\"checkbox\"\n disabled={disabled}\n aria-checked={indeterminate ? 'mixed' : undefined}\n className={styles.checkbox}\n {...rest}\n />\n {label && (\n <label\n htmlFor={checkboxId}\n className={[styles.label, disabled ? styles.labelDisabled : null]\n .filter(Boolean)\n .join(' ')}\n >\n {label}\n </label>\n )}\n </div>\n );\n});\n"],"names":["Button","styles","Input","Checkbox"],"mappings":";;;;;AAqBO,MAAM,MAAA,GAAS,UAAA,CAA2C,SAASA,OAAAA,CACxE;AAAA,EACE,OAAA,GAAU,SAAA;AAAA,EACV,IAAA,GAAO,IAAA;AAAA,EACP,OAAA,GAAU,KAAA;AAAA,EACV,QAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA,EACA,GAAG;AACL,CAAA,EACA,GAAA,EACA;AACA,EAAA,MAAM,aAAa,QAAA,IAAY,OAAA;AAE/B,EAAA,uBACE,IAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,MAAM,IAAA,IAAQ,QAAA;AAAA,MACd,QAAA,EAAU,UAAA;AAAA,MACV,aAAW,OAAA,IAAW,MAAA;AAAA,MACtB,WAAW,CAACC,QAAA,CAAO,MAAA,EAAQA,QAAA,CAAO,OAAO,CAAA,EAAGA,QAAA,CAAO,IAAI,CAAA,EAAG,SAAS,CAAA,CAChE,MAAA,CAAO,OAAO,CAAA,CACd,KAAK,GAAG,CAAA;AAAA,MACV,GAAG,IAAA;AAAA,MAEH,QAAA,EAAA;AAAA,QAAA,OAAA,wBAAY,MAAA,EAAA,EAAK,SAAA,EAAWA,QAAA,CAAO,OAAA,EA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OAAO,CAAA,CAAE,IAAA,CAAK,GAAG,CAAA,EAClE,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,GAAA,EAAK,CAAC,IAAA,KAAS;AACb,UAAA,QAAA,CAAS,OAAA,GAAU,IAAA;AACnB,UAAA,IAAI,OAAO,QAAQ,UAAA,EAAY;AAC7B,YAAA,GAAA,CAAI,IAAI,CAAA;AAAA,UACV,WAAW,GAAA,EAAK;AACd,YAAA,GAAA,CAAI,OAAA,GAAU,IAAA;AAAA,UAChB;AAAA,QACF,CAAA;AAAA,QACA,EAAA,EAAI,UAAA;AAAA,QACJ,IAAA,EAAK,UAAA;AAAA,QACL,QAAA;AAAA,QACA,cAAA,EAAc,gBAAgB,OAAA,GAAU,MAAA;AAAA,QACxC,WAAW,MAAA,CAAO,QAAA;AAAA,QACjB,GAAG;AAAA;AAAA,KACN;AAAA,IACC,KAAA,oBACC,GAAA;AAAA,MAAC,OAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAS,UAAA;AAAA,QACT,SAAA,EAAW,CAAC,MAAA,CAAO,KAAA,EAAO,QAAA,GAAW,MAAA,CAAO,aAAA,GAAgB,IAAI,CAAA,CAC7D,MAAA,CAAO,OAAO,CAAA,CACd,KAAK,GAAG,CAAA;AAAA,QAEV,QAAA,EAAA;AAAA;AAAA;AACH,GAAA,EAEJ,CAAA;AAEJ,CAAC;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,115 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matushini/clover-view-ui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0-beta.2",
|
|
4
|
+
"description": "React UI component library",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/Matushini97/clover-view.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/Matushini97/clover-view#readme",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/Matushini97/clover-view/issues"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"react",
|
|
16
|
+
"ui",
|
|
17
|
+
"components",
|
|
18
|
+
"design-system",
|
|
19
|
+
"typescript"
|
|
20
|
+
],
|
|
21
|
+
"type": "module",
|
|
22
|
+
"packageManager": "npm@11.6.2",
|
|
23
|
+
"sideEffects": [
|
|
24
|
+
"**/*.css"
|
|
25
|
+
],
|
|
26
|
+
"main": "./dist/index.js",
|
|
27
|
+
"module": "./dist/index.js",
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"import": "./dist/index.js",
|
|
33
|
+
"default": "./dist/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./styles.css": "./dist/index.css",
|
|
36
|
+
"./package.json": "./package.json"
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"dist"
|
|
40
|
+
],
|
|
41
|
+
"scripts": {
|
|
42
|
+
"prepare": "husky",
|
|
43
|
+
"build": "rollup -c",
|
|
44
|
+
"lint": "eslint .",
|
|
45
|
+
"lint:fix": "eslint . --fix",
|
|
46
|
+
"format": "prettier --write .",
|
|
47
|
+
"format:check": "prettier --check .",
|
|
48
|
+
"typecheck": "tsc --noEmit",
|
|
49
|
+
"test": "vitest run",
|
|
50
|
+
"test:watch": "vitest",
|
|
51
|
+
"test:coverage": "vitest run --coverage --project=unit",
|
|
52
|
+
"test:visual": "playwright test",
|
|
53
|
+
"storybook": "storybook dev -p 6006",
|
|
54
|
+
"build-storybook": "storybook build",
|
|
55
|
+
"changeset": "changeset",
|
|
56
|
+
"version-packages": "changeset version",
|
|
57
|
+
"release": "npm run build && changeset publish"
|
|
58
|
+
},
|
|
59
|
+
"peerDependencies": {
|
|
60
|
+
"react": "^19.0.0",
|
|
61
|
+
"react-dom": "^19.0.0"
|
|
62
|
+
},
|
|
63
|
+
"engines": {
|
|
64
|
+
"node": ">=20"
|
|
65
|
+
},
|
|
66
|
+
"lint-staged": {
|
|
67
|
+
"*.{ts,tsx}": [
|
|
68
|
+
"eslint --fix",
|
|
69
|
+
"prettier --write"
|
|
70
|
+
],
|
|
71
|
+
"*.{js,mjs,cjs,json,md,yml,yaml,css,scss}": [
|
|
72
|
+
"prettier --write"
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@changesets/cli": "^3.0.3",
|
|
77
|
+
"@eslint/js": "^10.0.1",
|
|
78
|
+
"@playwright/test": "^1.64.0",
|
|
79
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
80
|
+
"@storybook/addon-a11y": "^10.6.2",
|
|
81
|
+
"@storybook/addon-docs": "^10.6.2",
|
|
82
|
+
"@storybook/addon-mcp": "^10.6.2",
|
|
83
|
+
"@storybook/addon-vitest": "^10.6.2",
|
|
84
|
+
"@storybook/react-vite": "^10.6.2",
|
|
85
|
+
"@testing-library/jest-dom": "^7.0.1",
|
|
86
|
+
"@testing-library/react": "^16.3.3",
|
|
87
|
+
"@testing-library/user-event": "^14.6.8",
|
|
88
|
+
"@types/node": "^26.6.5",
|
|
89
|
+
"@types/react": "^19.3.0",
|
|
90
|
+
"@types/react-dom": "^19.3.0",
|
|
91
|
+
"@vitejs/plugin-react": "^6.1.2",
|
|
92
|
+
"@vitest/browser-playwright": "5.0.4",
|
|
93
|
+
"@vitest/coverage-v8": "^5.0.4",
|
|
94
|
+
"eslint": "^10.12.0",
|
|
95
|
+
"eslint-config-prettier": "^10.1.8",
|
|
96
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
97
|
+
"eslint-plugin-storybook": "^10.6.2",
|
|
98
|
+
"globals": "^17.13.0",
|
|
99
|
+
"husky": "^9.1.7",
|
|
100
|
+
"jsdom": "^29.1.1",
|
|
101
|
+
"lint-staged": "^17.6.0",
|
|
102
|
+
"playwright": "latest",
|
|
103
|
+
"prettier": "^3.9.10",
|
|
104
|
+
"react": "^19.3.0",
|
|
105
|
+
"react-dom": "^19.3.0",
|
|
106
|
+
"rollup": "^4.64.6",
|
|
107
|
+
"rollup-plugin-dts": "^6.5.1",
|
|
108
|
+
"rollup-plugin-esbuild": "^6.2.1",
|
|
109
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
110
|
+
"storybook": "^10.6.2",
|
|
111
|
+
"typescript": "^6.0.3",
|
|
112
|
+
"typescript-eslint": "^8.71.2",
|
|
113
|
+
"vitest": "^5.0.4"
|
|
114
|
+
}
|
|
115
|
+
}
|