@tanishraj/ui-kit 2.2.0 → 2.3.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/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +90 -29
- package/dist/index.es.js +49 -42
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/readme.md +67 -1
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -75,7 +75,10 @@ import {
|
|
|
75
75
|
Divider,
|
|
76
76
|
Dropdown,
|
|
77
77
|
Drawer,
|
|
78
|
+
Input,
|
|
79
|
+
ListBox,
|
|
78
80
|
Link,
|
|
81
|
+
Modal,
|
|
79
82
|
OrganizationChart,
|
|
80
83
|
Popover,
|
|
81
84
|
Portal,
|
|
@@ -110,7 +113,10 @@ import {
|
|
|
110
113
|
Divider,
|
|
111
114
|
Dropdown,
|
|
112
115
|
Drawer,
|
|
116
|
+
Input,
|
|
117
|
+
ListBox,
|
|
113
118
|
Link,
|
|
119
|
+
Modal,
|
|
114
120
|
Popover,
|
|
115
121
|
} from '@tanishraj/ui-kit';
|
|
116
122
|
import { Plus } from 'lucide-react';
|
|
@@ -118,6 +124,7 @@ import { useState } from 'react';
|
|
|
118
124
|
|
|
119
125
|
export default function Demo() {
|
|
120
126
|
const [drawerOpen, setDrawerOpen] = useState(false);
|
|
127
|
+
const [modalOpen, setModalOpen] = useState(false);
|
|
121
128
|
|
|
122
129
|
return (
|
|
123
130
|
<div className='flex items-center gap-4'>
|
|
@@ -128,7 +135,28 @@ export default function Demo() {
|
|
|
128
135
|
<Chip icon={Plus} variant='success'>
|
|
129
136
|
Active
|
|
130
137
|
</Chip>
|
|
138
|
+
<Input
|
|
139
|
+
caption='There will be a caption text here'
|
|
140
|
+
label='Label'
|
|
141
|
+
placeholder='Placeholder'
|
|
142
|
+
variant='primary'
|
|
143
|
+
/>
|
|
144
|
+
<ListBox
|
|
145
|
+
items={[
|
|
146
|
+
{ label: 'Item Name', value: 'one' },
|
|
147
|
+
{ label: 'Item Name', value: 'two' },
|
|
148
|
+
]}
|
|
149
|
+
/>
|
|
131
150
|
<Dropdown variant='primary'>Dropdown</Dropdown>
|
|
151
|
+
<Button onClick={() => setModalOpen(true)}>Open Modal</Button>
|
|
152
|
+
<Modal
|
|
153
|
+
footer={<Button onClick={() => setModalOpen(false)}>Close</Button>}
|
|
154
|
+
onClose={() => setModalOpen(false)}
|
|
155
|
+
open={modalOpen}
|
|
156
|
+
title='Title'
|
|
157
|
+
>
|
|
158
|
+
Modal content
|
|
159
|
+
</Modal>
|
|
132
160
|
<Button onClick={() => setDrawerOpen(true)}>Open Drawer</Button>
|
|
133
161
|
<Popover
|
|
134
162
|
title='Title'
|
|
@@ -217,7 +245,10 @@ import {
|
|
|
217
245
|
Divider,
|
|
218
246
|
Dropdown,
|
|
219
247
|
Drawer,
|
|
248
|
+
Input,
|
|
249
|
+
ListBox,
|
|
220
250
|
Link,
|
|
251
|
+
Modal,
|
|
221
252
|
Popover,
|
|
222
253
|
} from '@tanishraj/ui-kit';
|
|
223
254
|
import { Home, Plus, Tag } from 'lucide-react';
|
|
@@ -269,6 +300,35 @@ export function ComponentExamples() {
|
|
|
269
300
|
Dropdown
|
|
270
301
|
</Dropdown>
|
|
271
302
|
|
|
303
|
+
<Input
|
|
304
|
+
caption='There will be a caption text here'
|
|
305
|
+
label='Label'
|
|
306
|
+
leadingIcon={Plus}
|
|
307
|
+
placeholder='Placeholder'
|
|
308
|
+
required
|
|
309
|
+
trailingIcon={Plus}
|
|
310
|
+
variant='primary'
|
|
311
|
+
/>
|
|
312
|
+
|
|
313
|
+
<ListBox
|
|
314
|
+
items={[
|
|
315
|
+
{ label: 'Item Name', value: 'one' },
|
|
316
|
+
{ label: 'Item Name', value: 'two' },
|
|
317
|
+
{ label: 'Item Name', value: 'three' },
|
|
318
|
+
]}
|
|
319
|
+
selectedValue='two'
|
|
320
|
+
/>
|
|
321
|
+
|
|
322
|
+
<Modal
|
|
323
|
+
footer={<Button variant='primary'>Button</Button>}
|
|
324
|
+
leadingIcon={Plus}
|
|
325
|
+
onClose={() => undefined}
|
|
326
|
+
open={false}
|
|
327
|
+
title='Title'
|
|
328
|
+
>
|
|
329
|
+
Slot Area
|
|
330
|
+
</Modal>
|
|
331
|
+
|
|
272
332
|
<Popover
|
|
273
333
|
placement='bottom'
|
|
274
334
|
title='Title'
|
|
@@ -297,8 +357,11 @@ export function ComponentExamples() {
|
|
|
297
357
|
- `Checkbox` and `CheckboxGroup` support `shape="square" | "circle"`, with `square` as the default.
|
|
298
358
|
- `Chip` supports `variant`, `appearance="filled" | "outline"`, `shape`, `size`, `inverted`, optional `icon`, and removable chips via `onClose`.
|
|
299
359
|
- `Divider` supports `orientation="horizontal" | "vertical"` and optional centered content through `children`.
|
|
300
|
-
- `Dropdown` opens a Floating UI menu-style popover list. It shares Button `variant`, `appearance`, `size`, `loading`, `disabled`, `inverted`, and `fullWidth` props, with default chevron, optional icon-only mode, `items`, `selectedValue`, `onItemSelect`, custom `trigger` / `menuContent`, `triggerAction="click" | "hover"`, `menuPlacement`, `menuOffset`, optional arrow, and Portal targeting.
|
|
360
|
+
- `Dropdown` opens a Floating UI menu-style popover list. It shares Button `variant`, `appearance`, `size`, `loading`, `disabled`, `inverted`, and `fullWidth` props, with default chevron, optional icon-only mode, `items`, `selectedValue`, `onItemSelect`, custom `trigger` / `menuContent`, `triggerAction="click" | "hover"`, `menuPlacement`, `menuOffset`, optional arrow, and Portal targeting. It uses `ListBox` internally for list rendering.
|
|
301
361
|
- `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.
|
|
362
|
+
- `Input` supports `label`, `caption`, `error`, `variant`, `size`, required marker, disabled state, optional leading/trailing icons, `clearable`, `onClear`, and `fullWidth`.
|
|
363
|
+
- `ListBox` and `ListItem` provide reusable selectable list surfaces with shared row spacing, selected state, disabled state, optional leading icons, and `option` / `menuitem` semantics.
|
|
364
|
+
- `Modal` is controlled with `open` and `onClose`, supports `size="sm" | "md" | "lg"`, optional leading header icon, overlay close, Escape close, footer actions, Portal targeting, and centered fade/scale animations.
|
|
302
365
|
- `Portal` renders to `document.body` by default and can target a custom container via `container`, `containerRef`, or `containerId`.
|
|
303
366
|
- `Link` supports `variant`, `size`, `underline="none" | "hover" | "always"`, `inverted`, `disabled`, `truncate`, optional leading/trailing icons, and `external` links.
|
|
304
367
|
- `Popover` is powered by Floating UI, supports `placement`, `align`, `variant`, optional arrow/close controls, controlled or uncontrolled open state, and slot-style body content.
|
|
@@ -426,7 +489,10 @@ src/
|
|
|
426
489
|
| Divider | `src/components/Divider` | [Divider](https://tanishraj.github.io/ui-kit/?path=/story/components-divider--playground) | Stable |
|
|
427
490
|
| Dropdown | `src/components/Dropdown` | [Dropdown](https://tanishraj.github.io/ui-kit/?path=/story/components-dropdown--playground) | Stable |
|
|
428
491
|
| Drawer | `src/components/Drawer` | [Drawer](https://tanishraj.github.io/ui-kit/?path=/story/components-drawer--playground) | Stable |
|
|
492
|
+
| Input | `src/components/Input` | [Input](https://tanishraj.github.io/ui-kit/?path=/story/components-input--playground) | Stable |
|
|
493
|
+
| ListBox | `src/components/ListBox` | [ListBox](https://tanishraj.github.io/ui-kit/?path=/story/components-listbox--playground) | Stable |
|
|
429
494
|
| Link | `src/components/Link` | [Link](https://tanishraj.github.io/ui-kit/?path=/story/components-link--playground) | Stable |
|
|
495
|
+
| Modal | `src/components/Modal` | [Modal](https://tanishraj.github.io/ui-kit/?path=/story/components-modal--playground) | Stable |
|
|
430
496
|
| OrganizationChart | `src/components/OrganizationChart` | [OrganizationChart](https://tanishraj.github.io/ui-kit/?path=/story/components-organizationchart--playground) | Stable |
|
|
431
497
|
| Popover | `src/components/Popover` | [Popover](https://tanishraj.github.io/ui-kit/?path=/story/components-popover--playground) | Stable |
|
|
432
498
|
| Portal | `src/components/Portal` | N/A | Stable |
|