@tanishraj/ui-kit 2.2.0 → 2.4.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.2.0",
3
+ "version": "2.4.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",
@@ -75,6 +75,7 @@
75
75
  "lucide-react": "^1.17.0",
76
76
  "react": "^19.2.7",
77
77
  "react-dom": "^19.2.7",
78
+ "sonner": "^2.0.7",
78
79
  "tailwind-merge": "^3.6.0"
79
80
  },
80
81
  "devDependencies": {
package/readme.md CHANGED
@@ -75,10 +75,23 @@ import {
75
75
  Divider,
76
76
  Dropdown,
77
77
  Drawer,
78
+ Feedback,
79
+ Input,
80
+ ListBox,
78
81
  Link,
82
+ Modal,
79
83
  OrganizationChart,
80
84
  Popover,
85
+ ProgressBar,
81
86
  Portal,
87
+ Radio,
88
+ RadioGroup,
89
+ Rating,
90
+ Slider,
91
+ Tab,
92
+ TabPanel,
93
+ Tabs,
94
+ TabsList,
82
95
  } from '@tanishraj/ui-kit';
83
96
 
84
97
  export function Demo() {
@@ -110,14 +123,28 @@ import {
110
123
  Divider,
111
124
  Dropdown,
112
125
  Drawer,
126
+ Feedback,
127
+ Input,
128
+ ListBox,
113
129
  Link,
130
+ Modal,
114
131
  Popover,
132
+ ProgressBar,
133
+ Radio,
134
+ RadioGroup,
135
+ Rating,
136
+ Slider,
137
+ Tab,
138
+ TabPanel,
139
+ Tabs,
140
+ TabsList,
115
141
  } from '@tanishraj/ui-kit';
116
142
  import { Plus } from 'lucide-react';
117
143
  import { useState } from 'react';
118
144
 
119
145
  export default function Demo() {
120
146
  const [drawerOpen, setDrawerOpen] = useState(false);
147
+ const [modalOpen, setModalOpen] = useState(false);
121
148
 
122
149
  return (
123
150
  <div className='flex items-center gap-4'>
@@ -128,7 +155,48 @@ export default function Demo() {
128
155
  <Chip icon={Plus} variant='success'>
129
156
  Active
130
157
  </Chip>
158
+ <Input
159
+ caption='There will be a caption text here'
160
+ label='Label'
161
+ placeholder='Placeholder'
162
+ variant='primary'
163
+ />
164
+ <Radio defaultChecked label='Radio' />
165
+ <RadioGroup
166
+ defaultValue='email'
167
+ label='Notification method'
168
+ options={[
169
+ { label: 'Email', value: 'email' },
170
+ { label: 'SMS', value: 'sms' },
171
+ ]}
172
+ />
173
+ <Feedback defaultValue={4} />
174
+ <Rating defaultValue={3.5} precision={0.5} />
175
+ <Slider label='Slider Label' max={10} value={5} />
176
+ <Tabs defaultValue={0}>
177
+ <TabsList>
178
+ <Tab>Overview</Tab>
179
+ <Tab>Details</Tab>
180
+ </TabsList>
181
+ <TabPanel>Overview content</TabPanel>
182
+ <TabPanel>Details content</TabPanel>
183
+ </Tabs>
184
+ <ListBox
185
+ items={[
186
+ { label: 'Item Name', value: 'one' },
187
+ { label: 'Item Name', value: 'two' },
188
+ ]}
189
+ />
131
190
  <Dropdown variant='primary'>Dropdown</Dropdown>
191
+ <Button onClick={() => setModalOpen(true)}>Open Modal</Button>
192
+ <Modal
193
+ footer={<Button onClick={() => setModalOpen(false)}>Close</Button>}
194
+ onClose={() => setModalOpen(false)}
195
+ open={modalOpen}
196
+ title='Title'
197
+ >
198
+ Modal content
199
+ </Modal>
132
200
  <Button onClick={() => setDrawerOpen(true)}>Open Drawer</Button>
133
201
  <Popover
134
202
  title='Title'
@@ -136,6 +204,12 @@ export default function Demo() {
136
204
  >
137
205
  Slot Area
138
206
  </Popover>
207
+ <ProgressBar
208
+ caption='There will be a caption text here'
209
+ label='Label'
210
+ value={30}
211
+ variant='primary'
212
+ />
139
213
  <Drawer
140
214
  footer={<Button onClick={() => setDrawerOpen(false)}>Close</Button>}
141
215
  onClose={() => setDrawerOpen(false)}
@@ -217,8 +291,21 @@ import {
217
291
  Divider,
218
292
  Dropdown,
219
293
  Drawer,
294
+ Feedback,
295
+ Input,
296
+ ListBox,
220
297
  Link,
298
+ Modal,
221
299
  Popover,
300
+ ProgressBar,
301
+ Radio,
302
+ RadioGroup,
303
+ Rating,
304
+ Slider,
305
+ Tab,
306
+ TabPanel,
307
+ Tabs,
308
+ TabsList,
222
309
  } from '@tanishraj/ui-kit';
223
310
  import { Home, Plus, Tag } from 'lucide-react';
224
311
 
@@ -259,6 +346,30 @@ export function ComponentExamples() {
259
346
  shape='square'
260
347
  />
261
348
 
349
+ <Radio defaultChecked label='Radio option' />
350
+
351
+ <RadioGroup
352
+ defaultValue='email'
353
+ label='Notification method'
354
+ options={[
355
+ { label: 'Email', value: 'email' },
356
+ { label: 'SMS', value: 'sms' },
357
+ ]}
358
+ orientation='horizontal'
359
+ />
360
+
361
+ <Feedback defaultValue={4} />
362
+ <Rating defaultValue={3.5} precision={0.5} />
363
+ <Slider label='Slider Label' max={10} value={5} />
364
+ <Tabs defaultValue={0}>
365
+ <TabsList>
366
+ <Tab>Overview</Tab>
367
+ <Tab>Details</Tab>
368
+ </TabsList>
369
+ <TabPanel>Overview content</TabPanel>
370
+ <TabPanel>Details content</TabPanel>
371
+ </Tabs>
372
+
262
373
  <Divider>
263
374
  <Button leadingIcon={Plus} size='sm' variant='default'>
264
375
  Add item
@@ -269,6 +380,35 @@ export function ComponentExamples() {
269
380
  Dropdown
270
381
  </Dropdown>
271
382
 
383
+ <Input
384
+ caption='There will be a caption text here'
385
+ label='Label'
386
+ leadingIcon={Plus}
387
+ placeholder='Placeholder'
388
+ required
389
+ trailingIcon={Plus}
390
+ variant='primary'
391
+ />
392
+
393
+ <ListBox
394
+ items={[
395
+ { label: 'Item Name', value: 'one' },
396
+ { label: 'Item Name', value: 'two' },
397
+ { label: 'Item Name', value: 'three' },
398
+ ]}
399
+ selectedValue='two'
400
+ />
401
+
402
+ <Modal
403
+ footer={<Button variant='primary'>Button</Button>}
404
+ leadingIcon={Plus}
405
+ onClose={() => undefined}
406
+ open={false}
407
+ title='Title'
408
+ >
409
+ Slot Area
410
+ </Modal>
411
+
272
412
  <Popover
273
413
  placement='bottom'
274
414
  title='Title'
@@ -278,6 +418,14 @@ export function ComponentExamples() {
278
418
  Slot Area
279
419
  </Popover>
280
420
 
421
+ <ProgressBar
422
+ caption='There will be a caption text here'
423
+ label='Label'
424
+ showDot
425
+ value={30}
426
+ variant='success'
427
+ />
428
+
281
429
  <AnimatePresence presence>
282
430
  <AnimatePresenceChild>
283
431
  <div className='animate-in slide-in-from-right duration-500'>
@@ -297,11 +445,21 @@ export function ComponentExamples() {
297
445
  - `Checkbox` and `CheckboxGroup` support `shape="square" | "circle"`, with `square` as the default.
298
446
  - `Chip` supports `variant`, `appearance="filled" | "outline"`, `shape`, `size`, `inverted`, optional `icon`, and removable chips via `onClose`.
299
447
  - `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. `DropdownList` and `DropdownItem` are exported for lower-level composition.
448
+ - `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
449
  - `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.
450
+ - `Feedback` supports controlled or uncontrolled five-point sentiment selection with `value`, `defaultValue`, `onValueChange`, `options`, `variant="face" | "emoji"`, `size`, read-only state, disabled state, and custom accessible labels via `getLabelText`.
451
+ - `Input` supports `label`, `caption`, `error`, `variant`, `size`, required marker, disabled state, optional leading/trailing icons, `clearable`, `onClear`, and `fullWidth`.
452
+ - `ListBox` and `ListItem` provide reusable selectable list surfaces with shared row spacing, selected state, disabled state, optional leading icons, and `option` / `menuitem` semantics.
453
+ - `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
454
  - `Portal` renders to `document.body` by default and can target a custom container via `container`, `containerRef`, or `containerId`.
303
455
  - `Link` supports `variant`, `size`, `underline="none" | "hover" | "always"`, `inverted`, `disabled`, `truncate`, optional leading/trailing icons, and `external` links.
304
456
  - `Popover` is powered by Floating UI, supports `placement`, `align`, `variant`, optional arrow/close controls, controlled or uncontrolled open state, and slot-style body content.
457
+ - `ProgressBar` supports `appearance="linear" | "circular"`, semantic `variant`, `size`, labels, captions, visible values, optional linear endpoint dots, custom value formatting, `fullWidth`, and inverted dark-surface styling.
458
+ - `Radio` supports `label`, `description`, `error`, `size`, required marker, disabled state, and native radio input props for single-option composition.
459
+ - `RadioGroup` supports controlled or uncontrolled single selection with `value`, `defaultValue`, `onValueChange`, options, group label, description, error text, `orientation`, `size`, disabled state, and required marker.
460
+ - `Rating` supports controlled or uncontrolled star ratings with `value`, `defaultValue`, `onValueChange`, `max`, `precision={1 | 0.5}`, `size`, read-only state, disabled state, and custom accessible labels.
461
+ - `Slider` supports controlled or uncontrolled single or range selection with `value`, `defaultValue`, `onValueChange`, `min`, `max`, `step`, size variants, visible value markers, labels, captions, and error/disabled states.
462
+ - `Tabs`, `TabsList`, `Tab`, and `TabPanel` provide a compound tabs API with controlled or uncontrolled selection, `variant="underline" | "pill"`, `size`, `orientation`, disabled states, optional adornments, status dots, and close actions.
305
463
 
306
464
  ### Documentation and examples
307
465
 
@@ -426,10 +584,20 @@ src/
426
584
  | Divider | `src/components/Divider` | [Divider](https://tanishraj.github.io/ui-kit/?path=/story/components-divider--playground) | Stable |
427
585
  | Dropdown | `src/components/Dropdown` | [Dropdown](https://tanishraj.github.io/ui-kit/?path=/story/components-dropdown--playground) | Stable |
428
586
  | Drawer | `src/components/Drawer` | [Drawer](https://tanishraj.github.io/ui-kit/?path=/story/components-drawer--playground) | Stable |
587
+ | Feedback | `src/components/Feedback` | [Feedback](https://tanishraj.github.io/ui-kit/?path=/story/components-feedback--playground) | Stable |
588
+ | Input | `src/components/Input` | [Input](https://tanishraj.github.io/ui-kit/?path=/story/components-input--playground) | Stable |
589
+ | ListBox | `src/components/ListBox` | [ListBox](https://tanishraj.github.io/ui-kit/?path=/story/components-listbox--playground) | Stable |
429
590
  | Link | `src/components/Link` | [Link](https://tanishraj.github.io/ui-kit/?path=/story/components-link--playground) | Stable |
591
+ | Modal | `src/components/Modal` | [Modal](https://tanishraj.github.io/ui-kit/?path=/story/components-modal--playground) | Stable |
430
592
  | OrganizationChart | `src/components/OrganizationChart` | [OrganizationChart](https://tanishraj.github.io/ui-kit/?path=/story/components-organizationchart--playground) | Stable |
431
593
  | Popover | `src/components/Popover` | [Popover](https://tanishraj.github.io/ui-kit/?path=/story/components-popover--playground) | Stable |
594
+ | ProgressBar | `src/components/ProgressBar` | [ProgressBar](https://tanishraj.github.io/ui-kit/?path=/story/components-progressbar--playground) | Stable |
432
595
  | Portal | `src/components/Portal` | N/A | Stable |
596
+ | Radio | `src/components/Radio` | [Radio](https://tanishraj.github.io/ui-kit/?path=/story/components-radio--playground) | Stable |
597
+ | RadioGroup | `src/components/RadioGroup` | [RadioGroup](https://tanishraj.github.io/ui-kit/?path=/story/components-radiogroup--playground) | Stable |
598
+ | Rating | `src/components/Rating` | [Rating](https://tanishraj.github.io/ui-kit/?path=/story/components-rating--playground) | Stable |
599
+ | Slider | `src/components/Slider` | [Slider](https://tanishraj.github.io/ui-kit/?path=/story/components-slider--playground) | Stable |
600
+ | Tabs | `src/components/Tabs` | [Tabs](https://tanishraj.github.io/ui-kit/?path=/story/components-tabs--playground) | Stable |
433
601
 
434
602
  ## Versioning and Changelog
435
603