@tanishraj/ui-kit 2.1.1 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanishraj/ui-kit",
3
- "version": "2.1.1",
3
+ "version": "2.3.0",
4
4
  "description": "A production-ready React component library with modern tooling, Storybook docs, and TypeScript support.",
5
5
  "author": "Tanishraj",
6
6
  "license": "MIT",
package/readme.md CHANGED
@@ -73,8 +73,12 @@ import {
73
73
  CheckboxGroup,
74
74
  Chip,
75
75
  Divider,
76
+ Dropdown,
76
77
  Drawer,
78
+ Input,
79
+ ListBox,
77
80
  Link,
81
+ Modal,
78
82
  OrganizationChart,
79
83
  Popover,
80
84
  Portal,
@@ -107,8 +111,12 @@ import {
107
111
  Button,
108
112
  Chip,
109
113
  Divider,
114
+ Dropdown,
110
115
  Drawer,
116
+ Input,
117
+ ListBox,
111
118
  Link,
119
+ Modal,
112
120
  Popover,
113
121
  } from '@tanishraj/ui-kit';
114
122
  import { Plus } from 'lucide-react';
@@ -116,6 +124,7 @@ import { useState } from 'react';
116
124
 
117
125
  export default function Demo() {
118
126
  const [drawerOpen, setDrawerOpen] = useState(false);
127
+ const [modalOpen, setModalOpen] = useState(false);
119
128
 
120
129
  return (
121
130
  <div className='flex items-center gap-4'>
@@ -126,6 +135,28 @@ export default function Demo() {
126
135
  <Chip icon={Plus} variant='success'>
127
136
  Active
128
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
+ />
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>
129
160
  <Button onClick={() => setDrawerOpen(true)}>Open Drawer</Button>
130
161
  <Popover
131
162
  title='Title'
@@ -212,8 +243,12 @@ import {
212
243
  CheckboxGroup,
213
244
  Chip,
214
245
  Divider,
246
+ Dropdown,
215
247
  Drawer,
248
+ Input,
249
+ ListBox,
216
250
  Link,
251
+ Modal,
217
252
  Popover,
218
253
  } from '@tanishraj/ui-kit';
219
254
  import { Home, Plus, Tag } from 'lucide-react';
@@ -261,6 +296,39 @@ export function ComponentExamples() {
261
296
  </Button>
262
297
  </Divider>
263
298
 
299
+ <Dropdown appearance='outline' variant='primary'>
300
+ Dropdown
301
+ </Dropdown>
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
+
264
332
  <Popover
265
333
  placement='bottom'
266
334
  title='Title'
@@ -289,7 +357,11 @@ export function ComponentExamples() {
289
357
  - `Checkbox` and `CheckboxGroup` support `shape="square" | "circle"`, with `square` as the default.
290
358
  - `Chip` supports `variant`, `appearance="filled" | "outline"`, `shape`, `size`, `inverted`, optional `icon`, and removable chips via `onClose`.
291
359
  - `Divider` supports `orientation="horizontal" | "vertical"` and optional centered content through `children`.
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.
292
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.
293
365
  - `Portal` renders to `document.body` by default and can target a custom container via `container`, `containerRef`, or `containerId`.
294
366
  - `Link` supports `variant`, `size`, `underline="none" | "hover" | "always"`, `inverted`, `disabled`, `truncate`, optional leading/trailing icons, and `external` links.
295
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.
@@ -415,8 +487,12 @@ src/
415
487
  | CheckboxGroup | `src/components/CheckboxGroup` | [CheckboxGroup](https://tanishraj.github.io/ui-kit/?path=/story/components-checkboxgroup--playground) | Stable |
416
488
  | Chip | `src/components/Chip` | [Chip](https://tanishraj.github.io/ui-kit/?path=/story/components-chip--playground) | Stable |
417
489
  | Divider | `src/components/Divider` | [Divider](https://tanishraj.github.io/ui-kit/?path=/story/components-divider--playground) | Stable |
490
+ | Dropdown | `src/components/Dropdown` | [Dropdown](https://tanishraj.github.io/ui-kit/?path=/story/components-dropdown--playground) | Stable |
418
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 |
419
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 |
420
496
  | OrganizationChart | `src/components/OrganizationChart` | [OrganizationChart](https://tanishraj.github.io/ui-kit/?path=/story/components-organizationchart--playground) | Stable |
421
497
  | Popover | `src/components/Popover` | [Popover](https://tanishraj.github.io/ui-kit/?path=/story/components-popover--playground) | Stable |
422
498
  | Portal | `src/components/Portal` | N/A | Stable |