@tanishraj/ui-kit 2.1.0 → 2.1.1
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/package.json +1 -1
- package/readme.md +40 -4
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
[](https://github.com/tanishraj/ui-kit/blob/develop/LICENSE)
|
|
6
6
|
[](https://tanishraj.github.io/ui-kit/)
|
|
7
7
|
|
|
8
|
-
A production-ready React + TypeScript UI component library built with Vite, Storybook, Tailwind CSS, CVA, and strict quality gates.
|
|
8
|
+
A production-ready React + TypeScript UI component library built with Vite, Storybook, Tailwind CSS, CVA, Floating UI, and strict quality gates.
|
|
9
9
|
|
|
10
10
|
## Table of Contents
|
|
11
11
|
|
|
12
12
|
- [About](#about)
|
|
13
13
|
- [Installation](#installation)
|
|
14
14
|
- [Usage](#usage)
|
|
15
|
+
- [Setup for app consumers](#setup-for-app-consumers)
|
|
15
16
|
- [Component Library API](#component-library-api)
|
|
16
17
|
- [Theming](#theming)
|
|
17
18
|
- [Accessibility](#accessibility)
|
|
@@ -21,6 +22,7 @@ A production-ready React + TypeScript UI component library built with Vite, Stor
|
|
|
21
22
|
- [Publishing](#publishing)
|
|
22
23
|
- [Release Process](#release-process)
|
|
23
24
|
- [Repository Structure](#repository-structure)
|
|
25
|
+
- [Components](#components)
|
|
24
26
|
- [Contributing](#contributing)
|
|
25
27
|
- [License](#license)
|
|
26
28
|
- [Changelog](#changelog)
|
|
@@ -57,20 +59,25 @@ pnpm add @tanishraj/ui-kit
|
|
|
57
59
|
|
|
58
60
|
```tsx
|
|
59
61
|
import {
|
|
62
|
+
Accordion,
|
|
63
|
+
Alert,
|
|
60
64
|
AnimatePresence,
|
|
61
65
|
AnimatePresenceChild,
|
|
62
|
-
Button,
|
|
63
66
|
Badge,
|
|
64
67
|
Avatar,
|
|
65
68
|
AvatarGroup,
|
|
66
69
|
Breadcrumb,
|
|
70
|
+
Button,
|
|
71
|
+
ButtonGroup,
|
|
67
72
|
Checkbox,
|
|
68
73
|
CheckboxGroup,
|
|
69
74
|
Chip,
|
|
70
75
|
Divider,
|
|
71
76
|
Drawer,
|
|
72
|
-
Portal,
|
|
73
77
|
Link,
|
|
78
|
+
OrganizationChart,
|
|
79
|
+
Popover,
|
|
80
|
+
Portal,
|
|
74
81
|
} from '@tanishraj/ui-kit';
|
|
75
82
|
|
|
76
83
|
export function Demo() {
|
|
@@ -100,8 +107,9 @@ import {
|
|
|
100
107
|
Button,
|
|
101
108
|
Chip,
|
|
102
109
|
Divider,
|
|
103
|
-
Link,
|
|
104
110
|
Drawer,
|
|
111
|
+
Link,
|
|
112
|
+
Popover,
|
|
105
113
|
} from '@tanishraj/ui-kit';
|
|
106
114
|
import { Plus } from 'lucide-react';
|
|
107
115
|
import { useState } from 'react';
|
|
@@ -119,6 +127,12 @@ export default function Demo() {
|
|
|
119
127
|
Active
|
|
120
128
|
</Chip>
|
|
121
129
|
<Button onClick={() => setDrawerOpen(true)}>Open Drawer</Button>
|
|
130
|
+
<Popover
|
|
131
|
+
title='Title'
|
|
132
|
+
trigger={<Button appearance='filled'>Open Popover</Button>}
|
|
133
|
+
>
|
|
134
|
+
Slot Area
|
|
135
|
+
</Popover>
|
|
122
136
|
<Drawer
|
|
123
137
|
footer={<Button onClick={() => setDrawerOpen(false)}>Close</Button>}
|
|
124
138
|
onClose={() => setDrawerOpen(false)}
|
|
@@ -146,6 +160,12 @@ export default function Demo() {
|
|
|
146
160
|
### Theme file options
|
|
147
161
|
|
|
148
162
|
```ts
|
|
163
|
+
// Optional: import globals explicitly when your bundler does not auto-include package CSS
|
|
164
|
+
import '@tanishraj/ui-kit/globals.css';
|
|
165
|
+
|
|
166
|
+
// Optional: import base color tokens directly
|
|
167
|
+
import '@tanishraj/ui-kit/base.css';
|
|
168
|
+
|
|
149
169
|
// Optional: import this only when you want secondary theme
|
|
150
170
|
import '@tanishraj/ui-kit/theme-secondary.css';
|
|
151
171
|
```
|
|
@@ -163,6 +183,7 @@ To add a new packaged theme later:
|
|
|
163
183
|
You can also import through:
|
|
164
184
|
|
|
165
185
|
```ts
|
|
186
|
+
import '@tanishraj/ui-kit/themes/primary.css';
|
|
166
187
|
import '@tanishraj/ui-kit/themes/secondary.css';
|
|
167
188
|
```
|
|
168
189
|
|
|
@@ -193,6 +214,7 @@ import {
|
|
|
193
214
|
Divider,
|
|
194
215
|
Drawer,
|
|
195
216
|
Link,
|
|
217
|
+
Popover,
|
|
196
218
|
} from '@tanishraj/ui-kit';
|
|
197
219
|
import { Home, Plus, Tag } from 'lucide-react';
|
|
198
220
|
|
|
@@ -239,6 +261,15 @@ export function ComponentExamples() {
|
|
|
239
261
|
</Button>
|
|
240
262
|
</Divider>
|
|
241
263
|
|
|
264
|
+
<Popover
|
|
265
|
+
placement='bottom'
|
|
266
|
+
title='Title'
|
|
267
|
+
trigger={<Button variant='primary'>Open popover</Button>}
|
|
268
|
+
variant='primary'
|
|
269
|
+
>
|
|
270
|
+
Slot Area
|
|
271
|
+
</Popover>
|
|
272
|
+
|
|
242
273
|
<AnimatePresence presence>
|
|
243
274
|
<AnimatePresenceChild>
|
|
244
275
|
<div className='animate-in slide-in-from-right duration-500'>
|
|
@@ -261,6 +292,7 @@ export function ComponentExamples() {
|
|
|
261
292
|
- `Drawer` is controlled with `open` and `onClose`, supports `placement="right" | "left" | "top" | "bottom"`, `size="sm" | "md" | "lg" | "full"`, overlay close, Escape close, footer actions, Portal targeting, and placement-aware slide animations.
|
|
262
293
|
- `Portal` renders to `document.body` by default and can target a custom container via `container`, `containerRef`, or `containerId`.
|
|
263
294
|
- `Link` supports `variant`, `size`, `underline="none" | "hover" | "always"`, `inverted`, `disabled`, `truncate`, optional leading/trailing icons, and `external` links.
|
|
295
|
+
- `Popover` is powered by Floating UI, supports `placement`, `align`, `variant`, optional arrow/close controls, controlled or uncontrolled open state, and slot-style body content.
|
|
264
296
|
|
|
265
297
|
### Documentation and examples
|
|
266
298
|
|
|
@@ -271,7 +303,10 @@ export function ComponentExamples() {
|
|
|
271
303
|
|
|
272
304
|
- Component style variants are centralized with CVA + Tailwind utility patterns.
|
|
273
305
|
- Theme tokens are built in and theme files are exported from package entry points:
|
|
306
|
+
- `base.css`
|
|
274
307
|
- `theme-secondary.css`
|
|
308
|
+
- `themes/primary.css`
|
|
309
|
+
- `themes/secondary.css`
|
|
275
310
|
- `globals.css`
|
|
276
311
|
|
|
277
312
|
## Accessibility
|
|
@@ -383,6 +418,7 @@ src/
|
|
|
383
418
|
| Drawer | `src/components/Drawer` | [Drawer](https://tanishraj.github.io/ui-kit/?path=/story/components-drawer--playground) | Stable |
|
|
384
419
|
| Link | `src/components/Link` | [Link](https://tanishraj.github.io/ui-kit/?path=/story/components-link--playground) | Stable |
|
|
385
420
|
| OrganizationChart | `src/components/OrganizationChart` | [OrganizationChart](https://tanishraj.github.io/ui-kit/?path=/story/components-organizationchart--playground) | Stable |
|
|
421
|
+
| Popover | `src/components/Popover` | [Popover](https://tanishraj.github.io/ui-kit/?path=/story/components-popover--playground) | Stable |
|
|
386
422
|
| Portal | `src/components/Portal` | N/A | Stable |
|
|
387
423
|
|
|
388
424
|
## Versioning and Changelog
|