azamat-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.
Files changed (131) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +323 -0
  3. package/dist/cli/index.js +725 -0
  4. package/dist/components/actions/action-menu.d.ts +26 -0
  5. package/dist/components/actions/copy-button.d.ts +13 -0
  6. package/dist/components/actions/index.d.ts +3 -0
  7. package/dist/components/actions/quick-action-grid.d.ts +27 -0
  8. package/dist/components/calendar/calendar.d.ts +28 -0
  9. package/dist/components/calendar/date-picker.d.ts +15 -0
  10. package/dist/components/calendar/date-range-picker.d.ts +18 -0
  11. package/dist/components/calendar/date-utils.d.ts +12 -0
  12. package/dist/components/calendar/index.d.ts +4 -0
  13. package/dist/components/command/command-palette.d.ts +54 -0
  14. package/dist/components/command/index.d.ts +1 -0
  15. package/dist/components/data-table/data-table-actions-column.d.ts +16 -0
  16. package/dist/components/data-table/data-table-bulk-actions.d.ts +17 -0
  17. package/dist/components/data-table/data-table-column-visibility-menu.d.ts +14 -0
  18. package/dist/components/data-table/data-table-pagination.d.ts +21 -0
  19. package/dist/components/data-table/data-table-row-actions.d.ts +13 -0
  20. package/dist/components/data-table/data-table-select-column.d.ts +13 -0
  21. package/dist/components/data-table/data-table-sortable-header.d.ts +11 -0
  22. package/dist/components/data-table/data-table-toolbar.d.ts +14 -0
  23. package/dist/components/data-table/data-table-view-presets.d.ts +27 -0
  24. package/dist/components/data-table/data-table.d.ts +86 -0
  25. package/dist/components/data-table/index.d.ts +10 -0
  26. package/dist/components/display/activity-feed.d.ts +25 -0
  27. package/dist/components/display/avatar.d.ts +26 -0
  28. package/dist/components/display/data-state.d.ts +16 -0
  29. package/dist/components/display/description-list.d.ts +31 -0
  30. package/dist/components/display/index.d.ts +10 -0
  31. package/dist/components/display/info-card.d.ts +18 -0
  32. package/dist/components/display/metric-grid.d.ts +22 -0
  33. package/dist/components/display/progress.d.ts +35 -0
  34. package/dist/components/display/result.d.ts +18 -0
  35. package/dist/components/display/status-legend.d.ts +27 -0
  36. package/dist/components/display/timeline.d.ts +25 -0
  37. package/dist/components/feedback/empty-state.d.ts +11 -0
  38. package/dist/components/feedback/index.d.ts +3 -0
  39. package/dist/components/feedback/loading-state.d.ts +8 -0
  40. package/dist/components/feedback/status-badge.d.ts +9 -0
  41. package/dist/components/filters/filter-bar.d.ts +14 -0
  42. package/dist/components/filters/filter-chips.d.ts +18 -0
  43. package/dist/components/filters/index.d.ts +2 -0
  44. package/dist/components/form/form-async-select.d.ts +12 -0
  45. package/dist/components/form/form-date-input.d.ts +12 -0
  46. package/dist/components/form/form-date-picker.d.ts +12 -0
  47. package/dist/components/form/form-date-range-input.d.ts +12 -0
  48. package/dist/components/form/form-date-range-picker.d.ts +15 -0
  49. package/dist/components/form/form-field-shell.d.ts +26 -0
  50. package/dist/components/form/form-input.d.ts +13 -0
  51. package/dist/components/form/form-number-input.d.ts +12 -0
  52. package/dist/components/form/form-password-input.d.ts +11 -0
  53. package/dist/components/form/form-phone-input.d.ts +13 -0
  54. package/dist/components/form/form-search-input.d.ts +11 -0
  55. package/dist/components/form/form-select.d.ts +12 -0
  56. package/dist/components/form/form-switch.d.ts +14 -0
  57. package/dist/components/form/form-textarea.d.ts +13 -0
  58. package/dist/components/form/index.d.ts +14 -0
  59. package/dist/components/inputs/async-select.d.ts +106 -0
  60. package/dist/components/inputs/clearable-input.d.ts +16 -0
  61. package/dist/components/inputs/combobox.d.ts +20 -0
  62. package/dist/components/inputs/date-input.d.ts +9 -0
  63. package/dist/components/inputs/date-range-input.d.ts +18 -0
  64. package/dist/components/inputs/index.d.ts +14 -0
  65. package/dist/components/inputs/masked-input.d.ts +11 -0
  66. package/dist/components/inputs/money-input.d.ts +13 -0
  67. package/dist/components/inputs/number-input.d.ts +16 -0
  68. package/dist/components/inputs/password-input.d.ts +17 -0
  69. package/dist/components/inputs/phone-input.d.ts +10 -0
  70. package/dist/components/inputs/quantity-input.d.ts +15 -0
  71. package/dist/components/inputs/search-input.d.ts +7 -0
  72. package/dist/components/inputs/simple-select.d.ts +20 -0
  73. package/dist/components/inputs/tag-input.d.ts +15 -0
  74. package/dist/components/layout/app-header.d.ts +10 -0
  75. package/dist/components/layout/app-shell.d.ts +32 -0
  76. package/dist/components/layout/app-sidebar.d.ts +28 -0
  77. package/dist/components/layout/breadcrumbs.d.ts +18 -0
  78. package/dist/components/layout/index.d.ts +8 -0
  79. package/dist/components/layout/page-container.d.ts +7 -0
  80. package/dist/components/layout/page-header.d.ts +12 -0
  81. package/dist/components/layout/sidebar-nav.d.ts +25 -0
  82. package/dist/components/layout/stat-card.d.ts +18 -0
  83. package/dist/components/navigation/index.d.ts +3 -0
  84. package/dist/components/navigation/page-tabs.d.ts +18 -0
  85. package/dist/components/navigation/pagination.d.ts +21 -0
  86. package/dist/components/navigation/stepper-tabs.d.ts +19 -0
  87. package/dist/components/notifications/index.d.ts +1 -0
  88. package/dist/components/notifications/toast.d.ts +42 -0
  89. package/dist/components/overlay/confirm-dialog.d.ts +17 -0
  90. package/dist/components/overlay/dialog-actions.d.ts +14 -0
  91. package/dist/components/overlay/index.d.ts +4 -0
  92. package/dist/components/overlay/modal-shell.d.ts +20 -0
  93. package/dist/components/overlay/sheet-shell.d.ts +34 -0
  94. package/dist/components/patterns/form-builder-presets.d.ts +23 -0
  95. package/dist/components/patterns/form-builder.d.ts +95 -0
  96. package/dist/components/patterns/index.d.ts +4 -0
  97. package/dist/components/patterns/resource-detail-page.d.ts +39 -0
  98. package/dist/components/patterns/resource-page.d.ts +34 -0
  99. package/dist/components/ui/badge.d.ts +7 -0
  100. package/dist/components/ui/button.d.ts +8 -0
  101. package/dist/components/ui/card.d.ts +11 -0
  102. package/dist/components/ui/checkbox.d.ts +13 -0
  103. package/dist/components/ui/component-preview.d.ts +10 -0
  104. package/dist/components/ui/dialog.d.ts +17 -0
  105. package/dist/components/ui/dropdown-menu.d.ts +29 -0
  106. package/dist/components/ui/input.d.ts +3 -0
  107. package/dist/components/ui/popover.d.ts +9 -0
  108. package/dist/components/ui/select.d.ts +15 -0
  109. package/dist/components/ui/switch.d.ts +12 -0
  110. package/dist/components/ui/table.d.ts +10 -0
  111. package/dist/components/ui/tabs.d.ts +6 -0
  112. package/dist/components/ui/textarea.d.ts +3 -0
  113. package/dist/components/upload/file-upload.d.ts +61 -0
  114. package/dist/components/upload/image-upload.d.ts +14 -0
  115. package/dist/components/upload/index.d.ts +2 -0
  116. package/dist/components/wizard/index.d.ts +2 -0
  117. package/dist/components/wizard/stepper.d.ts +16 -0
  118. package/dist/components/wizard/wizard.d.ts +17 -0
  119. package/dist/hooks/index.d.ts +6 -0
  120. package/dist/hooks/use-before-unload-when-dirty.d.ts +2 -0
  121. package/dist/hooks/use-data-table-view-state.d.ts +20 -0
  122. package/dist/hooks/use-debounce.d.ts +3 -0
  123. package/dist/hooks/use-disclosure.d.ts +13 -0
  124. package/dist/hooks/use-is-mobile.d.ts +3 -0
  125. package/dist/hooks/use-session-storage-state.d.ts +8 -0
  126. package/dist/index.cjs +9 -0
  127. package/dist/index.d.ts +34 -0
  128. package/dist/index.js +23213 -0
  129. package/dist/lib/utils.d.ts +2 -0
  130. package/package.json +118 -0
  131. package/registry.json +185 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Azamat Jurayev
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,323 @@
1
+ # azamat-ui-kit
2
+
3
+ Personal React + TypeScript UI kit for dashboard projects. The goal is to keep shadcn-style copyable components, Ant-style universal wrappers, and project-specific business logic separate.
4
+
5
+ ## What belongs here
6
+
7
+ This package contains UI primitives, reusable wrappers, generic hooks, formatting helpers, CLI/registry helpers, and dashboard-ready components.
8
+
9
+ Good candidates:
10
+
11
+ - Button, Input, Textarea, Checkbox, Switch, Select, Dialog, Popover, Table, Badge, Card
12
+ - AppShell, AppHeader, AppSidebar, ActionMenu, PageHeader, FilterBar, StatCard
13
+ - ModalShell, SheetShell, ConfirmDialog, DialogActions
14
+ - Pagination, SimpleSelect, AsyncSelect, AsyncMultiSelect
15
+ - ClearableInput, SearchInput, PasswordInput, NumberInput, MoneyInput, QuantityInput, MaskedInput, PhoneInput, DateInput, DateRangeInput
16
+ - FormFieldShell, FormInput, FormSelect, FormAsyncSelect, FormTextarea, FormSwitch
17
+ - FormSearchInput, FormPasswordInput, FormNumberInput, FormPhoneInput, FormDateInput, FormDateRangeInput
18
+ - DataTable, DataTablePagination, DataTableToolbar, DataTableColumnVisibilityMenu, DataTableSortableHeader
19
+ - DataTableRowActions, createDataTableActionsColumn, DataTableBulkActions
20
+ - ToastProvider, useToast, CommandPalette, useCommandPaletteShortcut
21
+ - EmptyState, LoadingState, StatusBadge
22
+ - useSessionStorageState, useBeforeUnloadWhenDirty, useIsMobile, useDisclosure, useDebouncedValue
23
+
24
+ Do not put project-specific Kassa, LMS, Restaurant, tenant, billing, permission, branch, or API logic into the core UI kit.
25
+
26
+ ## Install
27
+
28
+ ```bash
29
+ npm install azamat-ui-kit
30
+ ```
31
+
32
+ Alternative GitHub install:
33
+
34
+ ```bash
35
+ npm install github:AzamatJurayev-dev/azamat-ui-kit#master
36
+ ```
37
+
38
+ Initialize the project once:
39
+
40
+ ```bash
41
+ npx azamat-ui-kit init
42
+ ```
43
+
44
+ The package entry does **not** import global CSS. During `init`, the CLI can write Azamat UI Kit theme tokens directly into your app global CSS file, for example `src/index.css`.
45
+
46
+ Do not import package CSS manually:
47
+
48
+ ```ts
49
+ // not needed
50
+ // import "azamat-ui-kit/style.css"
51
+ ```
52
+
53
+ Use components:
54
+
55
+ ```tsx
56
+ import {
57
+ ActionMenu,
58
+ AppHeader,
59
+ AppShell,
60
+ AppSidebar,
61
+ AsyncMultiSelect,
62
+ AsyncSelect,
63
+ Button,
64
+ CommandPalette,
65
+ DataTable,
66
+ DataTableBulkActions,
67
+ FilterBar,
68
+ FormDateInput,
69
+ FormInput,
70
+ FormPhoneInput,
71
+ FormSearchInput,
72
+ FormSwitch,
73
+ ModalShell,
74
+ PageHeader,
75
+ PasswordInput,
76
+ PhoneInput,
77
+ SearchInput,
78
+ StatCard,
79
+ StatusBadge,
80
+ ToastProvider,
81
+ useCommandPaletteShortcut,
82
+ useToast,
83
+ } from "azamat-ui-kit"
84
+ ```
85
+
86
+ ## Router integration
87
+
88
+ The package is router-agnostic by default. Navigation-oriented components render regular `<a>` tags unless you provide a custom link renderer.
89
+
90
+ Example with Next.js:
91
+
92
+ ```tsx
93
+ import Link from "next/link"
94
+ import { Breadcrumbs, SidebarNav } from "azamat-ui-kit"
95
+
96
+ <Breadcrumbs
97
+ items={[
98
+ { key: "home", label: "Home", href: "/" },
99
+ { key: "components", label: "Components", href: "/components" },
100
+ ]}
101
+ renderLink={({ item, ...props }) => <Link {...props} href={item.href || "#"} />}
102
+ />
103
+
104
+ <SidebarNav
105
+ items={[
106
+ { key: "dashboard", label: "Dashboard", href: "/dashboard" },
107
+ { key: "settings", label: "Settings", href: "/settings" },
108
+ ]}
109
+ renderLink={({ item, ...props }) => <Link {...props} href={item.href || "#"} />}
110
+ />
111
+ ```
112
+
113
+ ## Local development
114
+
115
+ ```bash
116
+ npm install
117
+ npm run dev
118
+ npm run build
119
+ ```
120
+
121
+ ## Release
122
+
123
+ Useful commands before public release:
124
+
125
+ ```bash
126
+ npm run test:run
127
+ npm pack --dry-run
128
+ ```
129
+
130
+ Release notes live in `CHANGELOG.md`, and the publish flow is documented in `RELEASE.md`.
131
+
132
+ ## Component rules
133
+
134
+ 1. Components must be generic and reusable.
135
+ 2. Components must not import project API clients, route paths, auth stores, or business types.
136
+ 3. Data loading must be passed through props like `loadOptions`, `data`, `onSubmit`, `onConfirm`.
137
+ 4. Business wrappers stay in the app project, not in the UI kit.
138
+ 5. Primitive UI and form wrappers should stay separate.
139
+ 6. Every reusable component should export from `src/index.ts`.
140
+
141
+ ## Current layers
142
+
143
+ ```txt
144
+ src/components/ui/ Base primitives
145
+ src/components/actions/ Generic action menus
146
+ src/components/layout/ App shell, sidebar, headers and stat cards
147
+ src/components/filters/ Filter bars
148
+ src/components/overlay/ Modal, sheet, confirm dialog wrappers
149
+ src/components/navigation/ Pagination and navigation widgets
150
+ src/components/inputs/ Simple, async, masked, phone, date and numeric inputs
151
+ src/components/form/ React Hook Form wrappers
152
+ src/components/feedback/ Empty, loading and status states
153
+ src/components/data-table/ Generic TanStack Table wrapper and helpers
154
+ src/components/notifications/ Toast provider and hook
155
+ src/components/command/ Command palette and shortcut hook
156
+ src/hooks/ Generic React hooks
157
+ src/lib/ Utilities
158
+ ```
159
+
160
+ ## Theme / dark mode
161
+
162
+ Consumer apps own the global CSS. The UI kit only uses token-based classes like `bg-background`, `text-foreground`, `border-border`, `bg-card`, `bg-popover`, `text-muted-foreground`.
163
+
164
+ ```bash
165
+ npx azamat-ui-kit theme src/index.css
166
+ ```
167
+
168
+ Dark mode works by toggling the `.dark` class on the root/html element.
169
+
170
+ ## Notifications example
171
+
172
+ ```tsx
173
+ function App() {
174
+ return (
175
+ <ToastProvider position="top-right">
176
+ <Routes />
177
+ </ToastProvider>
178
+ )
179
+ }
180
+
181
+ function SaveButton() {
182
+ const { addToast } = useToast()
183
+
184
+ return (
185
+ <Button
186
+ onClick={() =>
187
+ addToast({
188
+ tone: "success",
189
+ title: "Saved",
190
+ description: "Changes were saved successfully.",
191
+ })
192
+ }
193
+ >
194
+ Save
195
+ </Button>
196
+ )
197
+ }
198
+ ```
199
+
200
+ ## Command palette example
201
+
202
+ ```tsx
203
+ const [open, setOpen] = React.useState(false)
204
+
205
+ useCommandPaletteShortcut(setOpen)
206
+
207
+ <CommandPalette
208
+ open={open}
209
+ onOpenChange={setOpen}
210
+ groups={[
211
+ {
212
+ id: "navigation",
213
+ label: "Navigation",
214
+ items: [
215
+ { id: "dashboard", label: "Dashboard", onSelect: () => navigate("/dashboard") },
216
+ { id: "products", label: "Products", onSelect: () => navigate("/products") },
217
+ ],
218
+ },
219
+ ]}
220
+ />
221
+ ```
222
+
223
+ ## Advanced inputs example
224
+
225
+ ```tsx
226
+ <SearchInput value={search} onValueChange={setSearch} placeholder="Search products..." />
227
+ <PasswordInput value={password} onValueChange={setPassword} />
228
+ <NumberInput value={price} min={0} step={1000} onNumberChange={setPrice} />
229
+ ```
230
+
231
+ ## DataTable example
232
+
233
+ ```tsx
234
+ import type { ColumnDef } from "@tanstack/react-table"
235
+ import {
236
+ ActionMenu,
237
+ DataTable,
238
+ DataTableBulkActions,
239
+ DataTableColumnVisibilityMenu,
240
+ DataTableSortableHeader,
241
+ FilterBar,
242
+ SearchInput,
243
+ StatusBadge,
244
+ createDataTableActionsColumn,
245
+ createDataTableSelectColumn,
246
+ } from "azamat-ui-kit"
247
+
248
+ type Product = {
249
+ id: string
250
+ name: string
251
+ status: "active" | "inactive"
252
+ }
253
+
254
+ const columns: ColumnDef<Product>[] = [
255
+ createDataTableSelectColumn<Product>(),
256
+ {
257
+ accessorKey: "name",
258
+ header: ({ column }) => <DataTableSortableHeader column={column}>Name</DataTableSortableHeader>,
259
+ },
260
+ {
261
+ accessorKey: "status",
262
+ header: "Status",
263
+ cell: ({ row }) => (
264
+ <StatusBadge tone={row.original.status === "active" ? "success" : "muted"} dot>
265
+ {row.original.status}
266
+ </StatusBadge>
267
+ ),
268
+ },
269
+ createDataTableActionsColumn<Product>({
270
+ getActions: (_row, product) => [
271
+ { key: "edit", label: "Edit", onSelect: () => edit(product) },
272
+ { key: "delete", label: "Delete", destructive: true, onSelect: () => remove(product) },
273
+ ],
274
+ }),
275
+ ]
276
+
277
+ function ProductsTable() {
278
+ return (
279
+ <DataTable
280
+ columns={columns}
281
+ data={products}
282
+ isLoading={isLoading}
283
+ emptyState={{ title: "No products" }}
284
+ toolbarProps={(table) => ({
285
+ title: "Products",
286
+ search: <FilterBar search={<SearchInput placeholder="Search" />} />,
287
+ actions: <DataTableColumnVisibilityMenu table={table} />,
288
+ selectionActions: (
289
+ <DataTableBulkActions
290
+ rows={table.getSelectedRowModel().rows.map((row) => row.original)}
291
+ actions={[{ key: "delete", label: "Delete selected", destructive: true, onSelect: deleteMany }]}
292
+ />
293
+ ),
294
+ })}
295
+ pagination={{ pageIndex, pageSize, pageCount, rowCount, onPageChange: setPageIndex, onPageSizeChange: setPageSize }}
296
+ />
297
+ )
298
+ }
299
+ ```
300
+
301
+ ## Migration plan
302
+
303
+ Phase 1 added low-risk generic wrappers: ModalShell, SheetShell, ConfirmDialog, DialogActions, Pagination, SimpleSelect, MoneyInput, QuantityInput, useSessionStorageState, useBeforeUnloadWhenDirty, useIsMobile.
304
+
305
+ Phase 2 added form and async-select layer: AsyncSelect base, FormFieldShell, FormInput, FormSelect, FormAsyncSelect, FormTextarea, FormSwitch, Textarea/Switch exports and react-hook-form peer dependency.
306
+
307
+ Phase 3 improved async select: AsyncMultiSelect, grouped options, quick create, selected option preload, local option cache, selected count labels.
308
+
309
+ Phase 4 added data display layer: DataTable, DataTablePagination, DataTableToolbar, EmptyState, LoadingState, StatusBadge.
310
+
311
+ Phase 5 added dashboard helpers: ActionMenu, PageHeader, FilterBar, StatCard, DataTableColumnVisibilityMenu.
312
+
313
+ Phase 6 added layout/table/input/hook helpers: AppShell, AppHeader, AppSidebar, Checkbox, createDataTableSelectColumn, DataTableSortableHeader, MaskedInput, PhoneInput, useDisclosure, useDebouncedValue, useDebouncedCallback.
314
+
315
+ Phase 7 changed CSS strategy: package entry no longer imports global CSS; `azamat-ui-kit init` writes theme/dark-light tokens into the consumer app global CSS file.
316
+
317
+ Phase 8 added advanced inputs and form wrappers: ClearableInput, SearchInput, PasswordInput, NumberInput, DateInput, DateRangeInput, FormSearchInput, FormPasswordInput, FormNumberInput, FormPhoneInput, FormDateInput, FormDateRangeInput.
318
+
319
+ Phase 9 added data table action helpers: DataTableRowActions, createDataTableActionsColumn, DataTableBulkActions.
320
+
321
+ Phase 10 added notification and command helpers: ToastProvider, useToast, CommandPalette, useCommandPaletteShortcut.
322
+
323
+ Next phase should add calendar / popover date picker and demo playground.