@lazar-ui/kit 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/README.md +182 -0
- package/dist/Overlay-RmiBtqDR.mjs +1011 -0
- package/dist/accordion.css +1 -0
- package/dist/accordion.d.ts +53 -0
- package/dist/accordion.js +48 -0
- package/dist/alert.css +1 -0
- package/dist/alert.d.ts +33 -0
- package/dist/alert.js +20 -0
- package/dist/avatar.css +1 -0
- package/dist/avatar.d.ts +34 -0
- package/dist/avatar.js +41 -0
- package/dist/badge.css +1 -0
- package/dist/badge.d.ts +33 -0
- package/dist/badge.js +23 -0
- package/dist/breadcrumbs.css +1 -0
- package/dist/breadcrumbs.d.ts +80 -0
- package/dist/breadcrumbs.js +63 -0
- package/dist/button.css +1 -0
- package/dist/button.d.ts +66 -0
- package/dist/button.js +46 -0
- package/dist/camelCase-PtIYufW8.mjs +528 -0
- package/dist/card.css +1 -0
- package/dist/card.d.ts +42 -0
- package/dist/card.js +24 -0
- package/dist/checkbox.css +1 -0
- package/dist/checkbox.d.ts +41 -0
- package/dist/checkbox.js +42 -0
- package/dist/clsx-OuTLNxxd.mjs +16 -0
- package/dist/config-provider.d.ts +78 -0
- package/dist/config-provider.js +14 -0
- package/dist/css/palettes/indigo.css +104 -0
- package/dist/css/palettes/monochrome.css +104 -0
- package/dist/css/semantic.css +113 -0
- package/dist/dialog.css +1 -0
- package/dist/dialog.d.ts +91 -0
- package/dist/dialog.js +75 -0
- package/dist/drawer.css +1 -0
- package/dist/drawer.d.ts +128 -0
- package/dist/drawer.js +106 -0
- package/dist/empty-state.css +1 -0
- package/dist/empty-state.d.ts +33 -0
- package/dist/empty-state.js +52 -0
- package/dist/error-boundary.css +1 -0
- package/dist/error-boundary.d.ts +55 -0
- package/dist/error-boundary.js +37 -0
- package/dist/flex.css +1 -0
- package/dist/flex.d.ts +68 -0
- package/dist/flex.js +73 -0
- package/dist/form-field.css +1 -0
- package/dist/form-field.d.ts +27 -0
- package/dist/form-field.js +22 -0
- package/dist/getComponentSlots-DwAYUFNk.mjs +16 -0
- package/dist/getVariantClassName-D7Nhpuec.mjs +8 -0
- package/dist/input.css +1 -0
- package/dist/input.d.ts +39 -0
- package/dist/input.js +146 -0
- package/dist/isValidReactNode-CmYwTWCE.mjs +18 -0
- package/dist/menu.css +1 -0
- package/dist/menu.d.ts +94 -0
- package/dist/menu.js +135 -0
- package/dist/pagination.css +1 -0
- package/dist/pagination.d.ts +40 -0
- package/dist/pagination.js +74 -0
- package/dist/popover.css +1 -0
- package/dist/popover.d.ts +54 -0
- package/dist/popover.js +65 -0
- package/dist/select.css +1 -0
- package/dist/select.d.ts +64 -0
- package/dist/select.js +170 -0
- package/dist/separator.css +1 -0
- package/dist/separator.d.ts +25 -0
- package/dist/separator.js +24 -0
- package/dist/skeleton.css +1 -0
- package/dist/skeleton.d.ts +38 -0
- package/dist/skeleton.js +27 -0
- package/dist/spinner.css +1 -0
- package/dist/spinner.d.ts +31 -0
- package/dist/spinner.js +29 -0
- package/dist/switch.css +1 -0
- package/dist/switch.d.ts +44 -0
- package/dist/switch.js +37 -0
- package/dist/table.css +1 -0
- package/dist/table.d.ts +60 -0
- package/dist/table.js +40 -0
- package/dist/tabs.css +1 -0
- package/dist/tabs.d.ts +69 -0
- package/dist/tabs.js +79 -0
- package/dist/textarea.css +1 -0
- package/dist/textarea.d.ts +53 -0
- package/dist/textarea.js +46 -0
- package/dist/tooltip.css +1 -0
- package/dist/tooltip.d.ts +38 -0
- package/dist/tooltip.js +99 -0
- package/dist/useLocale-D2Z0JH0l.mjs +70 -0
- package/dist/useModalOverlay-D5Bs9FCB.mjs +486 -0
- package/dist/useOverlayPosition-DVu1Qziq.mjs +451 -0
- package/dist/useOverlayTriggerState-BIo1Jcba.mjs +221 -0
- package/dist/utils.d.ts +58 -0
- package/dist/utils.js +18 -0
- package/package.json +76 -0
package/README.md
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# @lazar-ui/kit
|
|
2
|
+
|
|
3
|
+
A component library for building admin panels, dashboards, and internal tools.
|
|
4
|
+
Focuses on practical UI patterns commonly needed in B2B applications:
|
|
5
|
+
data-heavy layouts, modals, menus, forms, and navigation.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
**28+ production-ready components** — from buttons and tables to compound menus
|
|
10
|
+
and slot-based dialogs. Every component is designed for the admin panel context:
|
|
11
|
+
Actionable tables, pagination, filterable selects, and more.
|
|
12
|
+
|
|
13
|
+
**4 component patterns** to cover different composition needs:
|
|
14
|
+
|
|
15
|
+
- **Simple** — Button, Badge, Card, Table, Pagination, etc.
|
|
16
|
+
- **Compound** — Accordion, Menu, Popover, Tabs
|
|
17
|
+
- **Slot-based** — Dialog, Drawer (Title / Content / Actions)
|
|
18
|
+
- **Context-based** — ConfigProvider, Breadcrumbs, Tabs
|
|
19
|
+
|
|
20
|
+
**Tree-shakeable by default.** Each component is a separate subpath export.
|
|
21
|
+
Import exactly what you need, nothing more:
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { Button } from '@lazar-ui/kit/button';
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Only `@lazar-ui/kit/button` ends up in your bundle — not the entire library.
|
|
28
|
+
|
|
29
|
+
**Isolated CSS.** Styles are injected per-component at build time.
|
|
30
|
+
No global CSS, no style conflicts, no unused rules.
|
|
31
|
+
|
|
32
|
+
**Light and dark themes** via `data-theme` and CSS custom properties.
|
|
33
|
+
Wrap your app in `ConfigProvider` and toggle with a single attribute.
|
|
34
|
+
|
|
35
|
+
**Custom color palettes.** Two palettes included (monochrome, indigo).
|
|
36
|
+
Replace them with your own: copy a palette file, override the `--palette-*`
|
|
37
|
+
variables, and import it instead.
|
|
38
|
+
|
|
39
|
+
**Localization ready.** Interface ships with `en` and `ru` locales.
|
|
40
|
+
Add any language through `ILocaleMessages` module augmentation
|
|
41
|
+
— no forks, no patches, just type-safe extension.
|
|
42
|
+
|
|
43
|
+
**Accessible by default.** Built on `react-aria` and `react-stately`.
|
|
44
|
+
Keyboard navigation, screen reader support, focus management
|
|
45
|
+
— all handled at the component level.
|
|
46
|
+
|
|
47
|
+
**Fully typed.** TypeScript strict mode. Every component exports `IProps`.
|
|
48
|
+
Every import is typed. No undocumented props, no surprise `any`.
|
|
49
|
+
|
|
50
|
+
**Typed SCSS Modules.** All styles are typed via `typed-scss-modules`.
|
|
51
|
+
Import styles with full type safety — class name typos are caught at build time.
|
|
52
|
+
|
|
53
|
+
**Vite-powered build.** ES output with automatic declaration generation (`dts`)
|
|
54
|
+
and CSS injection. No bundler lock-in — works with any Vite/Next/Rspack setup.
|
|
55
|
+
|
|
56
|
+
## Installation
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npm install @lazar-ui/kit
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Peer dependencies
|
|
63
|
+
|
|
64
|
+
| Package | Version |
|
|
65
|
+
| --------------- | -------- |
|
|
66
|
+
| `react` | ^19.2.0 |
|
|
67
|
+
| `react-dom` | ^19.2.0 |
|
|
68
|
+
| `react-aria` | ^3.44.0 |
|
|
69
|
+
| `react-stately` | ^3.42.0 |
|
|
70
|
+
| `clsx` | ^2.1.1 |
|
|
71
|
+
| `lodash` | ^4.17.21 |
|
|
72
|
+
|
|
73
|
+
## Quick start
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
import { ConfigProvider } from '@lazar-ui/kit';
|
|
77
|
+
import '@lazar-ui/kit/css/palettes/monochrome.css';
|
|
78
|
+
import '@lazar-ui/kit/css/semantic.css';
|
|
79
|
+
|
|
80
|
+
function App() {
|
|
81
|
+
return (
|
|
82
|
+
<ConfigProvider theme="light" locale="en">
|
|
83
|
+
<YourApp />
|
|
84
|
+
</ConfigProvider>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Then use any component:
|
|
90
|
+
|
|
91
|
+
```tsx
|
|
92
|
+
import { Button } from '@lazar-ui/kit/button';
|
|
93
|
+
import { Table } from '@lazar-ui/kit/table';
|
|
94
|
+
|
|
95
|
+
function UsersPage() {
|
|
96
|
+
return <Button onClick={() => console.log('clicked')}>Add User</Button>;
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Component list
|
|
101
|
+
|
|
102
|
+
| Component | Pattern | Description |
|
|
103
|
+
| -------------- | ------------- | ----------------------------- |
|
|
104
|
+
| Accordion | Compound | Collapsible sections |
|
|
105
|
+
| Alert | Simple | Inline notifications |
|
|
106
|
+
| Avatar | Simple | User avatar with fallback |
|
|
107
|
+
| Badge | Simple | Status / count indicator |
|
|
108
|
+
| Breadcrumbs | Context-based | Navigation trail |
|
|
109
|
+
| Button | Simple | Action trigger |
|
|
110
|
+
| Card | Simple | Content container |
|
|
111
|
+
| Checkbox | Simple | Binary input |
|
|
112
|
+
| ConfigProvider | Context-based | Theme + locale provider |
|
|
113
|
+
| Dialog | Slot-based | Modal dialog |
|
|
114
|
+
| Drawer | Slot-based | Side panel |
|
|
115
|
+
| EmptyState | Simple | Empty / no-data state |
|
|
116
|
+
| ErrorBoundary | Simple | React error boundary |
|
|
117
|
+
| Flex | Simple | Flexbox layout helper |
|
|
118
|
+
| FormField | Simple | Field wrapper (label + error) |
|
|
119
|
+
| Input | Simple | Text input variants |
|
|
120
|
+
| Menu | Compound | Dropdown menu |
|
|
121
|
+
| Pagination | Simple | Page navigation |
|
|
122
|
+
| Popover | Compound | Floating panel |
|
|
123
|
+
| Select | Simple | Dropdown selector |
|
|
124
|
+
| Separator | Simple | Visual divider |
|
|
125
|
+
| Skeleton | Simple | Loading placeholder |
|
|
126
|
+
| Spinner | Simple | Loading indicator |
|
|
127
|
+
| Switch | Simple | Toggle control |
|
|
128
|
+
| Table | Simple | Data table |
|
|
129
|
+
| Tabs | Compound | Tabbed navigation |
|
|
130
|
+
| Textarea | Simple | Multi-line input |
|
|
131
|
+
| Tooltip | Simple | Hover hint |
|
|
132
|
+
|
|
133
|
+
## Theming
|
|
134
|
+
|
|
135
|
+
Wrap your app with `ConfigProvider` and pass a `theme` prop:
|
|
136
|
+
|
|
137
|
+
```tsx
|
|
138
|
+
<ConfigProvider theme="dark" locale="en">
|
|
139
|
+
<YourApp />
|
|
140
|
+
</ConfigProvider>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Available themes: `light`, `dark`.
|
|
144
|
+
|
|
145
|
+
To create a custom palette, copy one of the bundled palettes
|
|
146
|
+
from `node_modules/@lazar-ui/kit/css/palettes/`, adjust the
|
|
147
|
+
`--palette-*` variables, and import your file before `semantic.css`.
|
|
148
|
+
|
|
149
|
+
## Localization
|
|
150
|
+
|
|
151
|
+
Pass a locale to `ConfigProvider`. Built-in: `en`, `ru`.
|
|
152
|
+
|
|
153
|
+
```tsx
|
|
154
|
+
<ConfigProvider locale="ru">
|
|
155
|
+
<YourApp />
|
|
156
|
+
</ConfigProvider>
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Add a new language by augmenting `ILocaleMessages`:
|
|
160
|
+
|
|
161
|
+
```tsx
|
|
162
|
+
declare module '@lazar-ui/kit' {
|
|
163
|
+
interface ILocaleMessages {
|
|
164
|
+
myCustomSection: {
|
|
165
|
+
greeting: string;
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Then pass your locale object:
|
|
172
|
+
|
|
173
|
+
```tsx
|
|
174
|
+
<ConfigProvider locale={{ myCustomSection: { greeting: 'Hello' } }}>
|
|
175
|
+
<YourApp />
|
|
176
|
+
</ConfigProvider>
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Contacts
|
|
180
|
+
|
|
181
|
+
Telegram: [@vasiliylazarev](https://t.me/vasiliylazarev)
|
|
182
|
+
Email: [vasiliylazarev@gmail.com](mailto:vasiliylazarev@gmail.com)
|