infinity-ui-elements 1.5.1-beta.1 → 1.5.1-beta.3

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 (31) hide show
  1. package/README.md +826 -223
  2. package/dist/components/Table/DetailPanel.d.ts +10 -0
  3. package/dist/components/Table/DetailPanel.d.ts.map +1 -0
  4. package/dist/components/Table/Table.d.ts +9 -65
  5. package/dist/components/Table/Table.d.ts.map +1 -1
  6. package/dist/components/Table/Table.refactored.d.ts +39 -0
  7. package/dist/components/Table/Table.refactored.d.ts.map +1 -0
  8. package/dist/components/Table/Table.stories.d.ts +2 -0
  9. package/dist/components/Table/Table.stories.d.ts.map +1 -1
  10. package/dist/components/Table/TableBody.d.ts +18 -0
  11. package/dist/components/Table/TableBody.d.ts.map +1 -0
  12. package/dist/components/Table/TableCellTypes.d.ts +32 -0
  13. package/dist/components/Table/TableCellTypes.d.ts.map +1 -0
  14. package/dist/components/Table/TableDetailPanel.d.ts +25 -0
  15. package/dist/components/Table/TableDetailPanel.d.ts.map +1 -0
  16. package/dist/components/Table/TableHeader.d.ts +18 -0
  17. package/dist/components/Table/TableHeader.d.ts.map +1 -0
  18. package/dist/components/Table/index.d.ts +3 -0
  19. package/dist/components/Table/index.d.ts.map +1 -1
  20. package/dist/components/Table/tableHelpers.d.ts +7 -0
  21. package/dist/components/Table/tableHelpers.d.ts.map +1 -0
  22. package/dist/components/Table/tableVariants.d.ts +12 -0
  23. package/dist/components/Table/tableVariants.d.ts.map +1 -0
  24. package/dist/index.css +1 -1
  25. package/dist/index.esm.js +191 -38
  26. package/dist/index.esm.js.map +1 -1
  27. package/dist/index.js +196 -37
  28. package/dist/index.js.map +1 -1
  29. package/dist/lib/icons.d.ts +1 -0
  30. package/dist/lib/icons.d.ts.map +1 -1
  31. package/package.json +1 -1
package/README.md CHANGED
@@ -1,82 +1,97 @@
1
- # infinity-ui-elements
1
+ # Infinity UI Elements
2
2
 
3
- A React TypeScript component library with Tailwind CSS design system for Infinity products.
3
+ A comprehensive React TypeScript component library with a modern design system built on Tailwind CSS. Perfect for building consistent, accessible, and beautiful user interfaces for Infinity products.
4
4
 
5
- ## Features
5
+ ## 🎯 Features
6
6
 
7
- - 🎨 **Design System**: Consistent styling with custom Tailwind CSS tokens
8
- - 📦 **Tree-shakable**: ESM + CJS builds with Rollup
9
- - 📚 **Storybook**: Isolated development and documentation
10
- - 🔧 **TypeScript**: Full type safety and IntelliSense support
11
- - **Hot Reload**: Fast development with Vite-powered Storybook
7
+ - 🎨 **Comprehensive Design System**: 25+ production-ready components with consistent styling
8
+ - 📦 **Tree-shakable**: ESM + CJS builds optimized with Rollup
9
+ - 🔒 **TypeScript**: Full type safety and IntelliSense support
10
+ - **Accessible**: ARIA compliant components following WAI-ARIA guidelines
11
+ - 🎭 **Flexible**: Support for variants, sizes, colors, and custom styling
12
+ - 📚 **Well Documented**: Interactive Storybook documentation
13
+ - ⚡ **Performance**: Optimized bundle size with zero runtime overhead
14
+ - 🌈 **Theme Support**: CSS custom properties for easy theming
12
15
 
13
- ## Installation
16
+ ---
17
+
18
+ ## 📦 Installation
14
19
 
15
20
  ```bash
16
21
  yarn add infinity-ui-elements
22
+ # or
23
+ npm install infinity-ui-elements
17
24
  ```
18
25
 
19
- ## Usage
26
+ ### Peer Dependencies
27
+
28
+ Install the required peer dependencies:
20
29
 
21
- ### Basic Usage
30
+ ```bash
31
+ yarn add react react-dom clsx tailwind-merge class-variance-authority
32
+ # or
33
+ npm install react react-dom clsx tailwind-merge class-variance-authority
34
+ ```
35
+
36
+ For Table component (optional):
37
+ ```bash
38
+ yarn add @tanstack/react-table
39
+ ```
40
+
41
+ ---
42
+
43
+ ## 🚀 Quick Start
44
+
45
+ ### 1. Import CSS
46
+
47
+ In your main application file (e.g., `App.tsx` or `index.tsx`):
22
48
 
23
49
  ```tsx
24
- import { Button, Checkbox } from 'infinity-ui-elements';
50
+ import 'infinity-ui-elements/dist/index.css';
51
+ ```
52
+
53
+ ### 2. Use Components
54
+
55
+ ```tsx
56
+ import { Button, TextField, Badge } from 'infinity-ui-elements';
25
57
 
26
58
  function App() {
27
59
  return (
28
60
  <div>
29
- <Button variant="primary" onClick={() => console.log('Clicked!')}>
30
- Click me
31
- </Button>
32
- <Button variant="secondary">
33
- Secondary Button
61
+ <Button variant="primary" color="primary">
62
+ Get Started
34
63
  </Button>
35
64
 
36
- <Checkbox
37
- label="Accept terms and conditions"
38
- onChange={(e) => console.log(e.target.checked)}
65
+ <TextField
66
+ label="Email"
67
+ placeholder="Enter your email"
68
+ type="email"
39
69
  />
70
+
71
+ <Badge color="positive" variant="light">
72
+ Active
73
+ </Badge>
40
74
  </div>
41
75
  );
42
76
  }
43
77
  ```
44
78
 
45
- ### Required Setup
46
-
47
- **Step 1**: Install peer dependencies:
48
-
49
- ```bash
50
- yarn add clsx tailwind-merge class-variance-authority
51
- # or
52
- npm install clsx tailwind-merge class-variance-authority
53
- ```
54
-
55
- **Step 2**: Import the CSS file in your application:
56
-
57
- ```tsx
58
- // In your main App.tsx or index.tsx
59
- import 'infinity-ui-elements/dist/index.css';
60
- ```
61
-
62
- **Step 3**: Configure Tailwind CSS (CRITICAL - Required for styles to work):
79
+ ### 3. Configure Tailwind CSS
63
80
 
64
- The library uses custom utility classes that are pre-built in the CSS file. You need to prevent Tailwind from purging these classes in your consuming project.
81
+ The library uses custom utility classes that are pre-built. Configure your Tailwind setup to avoid conflicts:
65
82
 
66
83
  #### For Tailwind CSS v4:
67
-
68
84
  ```js
69
- // tailwind.config.js or postcss.config.js
85
+ // tailwind.config.js
70
86
  export default {
71
87
  content: [
72
88
  './src/**/*.{js,ts,jsx,tsx}',
89
+ // Don't include node_modules - CSS is already compiled
73
90
  ],
74
- // Don't scan node_modules - the CSS is already compiled
75
91
  }
76
92
  ```
77
93
 
78
94
  #### For Tailwind CSS v3:
79
-
80
95
  ```js
81
96
  // tailwind.config.js
82
97
  module.exports = {
@@ -84,153 +99,730 @@ module.exports = {
84
99
  './src/**/*.{js,ts,jsx,tsx}',
85
100
  ],
86
101
  safelist: [
87
- // Safelist the component library classes
88
102
  { pattern: /^(font-size|leading|font-functional|font-display|text-surface|text-action|bg-action|border-action)/ },
89
103
  ],
90
- theme: {
91
- extend: {},
92
- },
93
- plugins: [],
94
- };
104
+ }
95
105
  ```
96
106
 
97
- **Important Notes:**
98
- - The library's CSS contains all pre-compiled styles
99
- - Do NOT add `node_modules/infinity-ui-elements` to your Tailwind content paths
100
- - The safelist (for v3) ensures Tailwind doesn't purge the library's custom classes
107
+ ---
101
108
 
102
- ## Development
109
+ ## 🧩 Components
103
110
 
104
- ### Prerequisites
111
+ ### Form Components
105
112
 
106
- - Node.js 18+
107
- - Yarn 4.5.2 (managed via Corepack)
113
+ #### Button
114
+ A versatile button component with multiple variants, colors, sizes, and loading states.
108
115
 
109
- ### Setup
116
+ **Key Features:**
117
+ - 3 variants: `primary`, `secondary`, `tertiary`
118
+ - 6 color options: `primary`, `positive`, `negative`, `notice`, `info`, `neutral`
119
+ - 4 sizes: `xsmall`, `small`, `medium`, `large`
120
+ - Leading/trailing icons support
121
+ - Loading states with spinners
122
+ - Icon-only mode
123
+ - Full-width option
110
124
 
111
- ```bash
112
- # Install dependencies
113
- yarn install
125
+ ```tsx
126
+ import { Button } from 'infinity-ui-elements';
114
127
 
115
- # Start Storybook for development
116
- yarn storybook
128
+ <Button variant="primary" color="positive" size="medium">
129
+ Save Changes
130
+ </Button>
117
131
 
118
- # Build the library
119
- yarn build
132
+ <Button variant="secondary" color="negative" isLoading>
133
+ Deleting...
134
+ </Button>
120
135
 
121
- # Type checking
122
- yarn type-check
136
+ <Button variant="tertiary" leadingIcon={<PlusIcon />}>
137
+ Add Item
138
+ </Button>
123
139
  ```
124
140
 
125
- ### Project Structure
141
+ #### TextField
142
+ A text input component with validation, icons, and helper text.
143
+
144
+ **Key Features:**
145
+ - Label with required/optional indicators
146
+ - Prefix and suffix support
147
+ - Validation states: `positive`, `negative`
148
+ - Clear button option
149
+ - Helper text and error messages
150
+ - Info tooltip integration
151
+ - Link support
152
+
153
+ ```tsx
154
+ import { TextField } from 'infinity-ui-elements';
155
+
156
+ <TextField
157
+ label="Email Address"
158
+ placeholder="Enter your email"
159
+ type="email"
160
+ isRequired
161
+ helperText="We'll never share your email"
162
+ showClearButton
163
+ />
126
164
 
165
+ <TextField
166
+ label="Amount"
167
+ prefix="$"
168
+ suffix="USD"
169
+ validationState="positive"
170
+ successText="Valid amount"
171
+ />
127
172
  ```
128
- src/
129
- ├── components/
130
- │ └── Button/
131
- │ ├── Button.tsx # Component implementation
132
- │ ├── Button.stories.tsx # Storybook stories
133
- │ └── index.ts # Component exports
134
- ├── index.css # Tailwind CSS + CSS variables
135
- └── index.ts # Main barrel export
173
+
174
+ #### TextArea
175
+ A multi-line text input with auto-resize capability.
176
+
177
+ **Key Features:**
178
+ - Auto-resize option
179
+ - Character count display
180
+ - Validation states
181
+ - Helper text support
182
+ - All TextField features
183
+
184
+ ```tsx
185
+ import { TextArea } from 'infinity-ui-elements';
186
+
187
+ <TextArea
188
+ label="Description"
189
+ placeholder="Enter description..."
190
+ rows={4}
191
+ maxLength={500}
192
+ showCharCount
193
+ />
136
194
  ```
137
195
 
138
- ## Components
196
+ #### Select
197
+ A dropdown select component with keyboard navigation.
139
198
 
140
- ### Button
199
+ **Key Features:**
200
+ - Searchable options
201
+ - Custom option rendering
202
+ - Prefix/suffix support
203
+ - Loading state
204
+ - Empty state customization
205
+ - Keyboard navigation
206
+ - Clear button
141
207
 
142
- A versatile button component with multiple variants.
208
+ ```tsx
209
+ import { Select } from 'infinity-ui-elements';
210
+
211
+ const options = [
212
+ { value: 'us', label: 'United States' },
213
+ { value: 'uk', label: 'United Kingdom' },
214
+ { value: 'ca', label: 'Canada' },
215
+ ];
216
+
217
+ <Select
218
+ label="Country"
219
+ options={options}
220
+ placeholder="Select a country"
221
+ onChange={(value, option) => console.log(value)}
222
+ showClearButton
223
+ />
224
+ ```
143
225
 
144
- #### Props
226
+ #### SearchableDropdown
227
+ An advanced dropdown with built-in search functionality.
145
228
 
146
- | Prop | Type | Default | Description |
147
- |------|------|---------|-------------|
148
- | `variant` | `'primary' \| 'secondary'` | `'primary'` | Button style variant |
149
- | `children` | `React.ReactNode` | - | Button content |
150
- | `onClick` | `() => void` | - | Click handler |
151
- | `disabled` | `boolean` | `false` | Disabled state |
152
- | `className` | `string` | `''` | Additional CSS classes |
229
+ **Key Features:**
230
+ - Real-time search filtering
231
+ - Multiple selection support
232
+ - Custom option rendering
233
+ - Grouped options
234
+ - Async data loading
153
235
 
154
- #### Examples
236
+ ```tsx
237
+ import { SearchableDropdown } from 'infinity-ui-elements';
238
+
239
+ <SearchableDropdown
240
+ label="Select Users"
241
+ options={users}
242
+ searchable
243
+ placeholder="Search users..."
244
+ onChange={(selected) => setSelectedUsers(selected)}
245
+ />
246
+ ```
247
+
248
+ #### Checkbox
249
+ A checkbox component with indeterminate state support.
250
+
251
+ **Key Features:**
252
+ - Indeterminate state for "select all"
253
+ - 3 sizes: `small`, `medium`, `large`
254
+ - Validation states
255
+ - Helper text and error messages
256
+ - Disabled state
155
257
 
156
258
  ```tsx
157
- // Primary button
158
- <Button variant="primary" onClick={handleClick}>
159
- Save Changes
160
- </Button>
259
+ import { Checkbox } from 'infinity-ui-elements';
161
260
 
162
- // Secondary button
163
- <Button variant="secondary">
164
- Cancel
165
- </Button>
261
+ <Checkbox
262
+ label="Accept terms and conditions"
263
+ isRequired
264
+ validationState="error"
265
+ errorText="You must accept the terms"
266
+ />
166
267
 
167
- // Disabled button
168
- <Button disabled>
169
- Processing...
170
- </Button>
268
+ <Checkbox
269
+ label="Select all"
270
+ isIndeterminate={someSelected && !allSelected}
271
+ checked={allSelected}
272
+ />
171
273
  ```
172
274
 
173
- ### Checkbox
275
+ #### Radio
276
+ A radio button component for single selection.
174
277
 
175
- A checkbox component for selecting options in forms with support for indeterminate states.
278
+ **Key Features:**
279
+ - Custom styling
280
+ - Validation states
281
+ - Helper text support
282
+ - Disabled state
283
+ - Multiple sizes
176
284
 
177
- #### Props
285
+ ```tsx
286
+ import { Radio } from 'infinity-ui-elements';
287
+
288
+ <Radio
289
+ label="Option 1"
290
+ name="choice"
291
+ value="option1"
292
+ checked={selected === 'option1'}
293
+ onChange={(e) => setSelected(e.target.value)}
294
+ />
295
+ ```
178
296
 
179
- | Prop | Type | Default | Description |
180
- |------|------|---------|-------------|
181
- | `label` | `string` | - | Label text for the checkbox |
182
- | `size` | `'small' \| 'medium' \| 'large'` | `'medium'` | Checkbox size |
183
- | `checked` | `boolean` | - | Controlled checked state |
184
- | `isIndeterminate` | `boolean` | `false` | Indeterminate state (mixed selection) |
185
- | `isDisabled` | `boolean` | `false` | Disabled state |
186
- | `validationState` | `'none' \| 'error'` | `'none'` | Validation state |
187
- | `helperText` | `string` | - | Helper text displayed below checkbox |
188
- | `errorText` | `string` | - | Error text (overrides helperText) |
189
- | `showErrorText` | `boolean` | `true` | Show/hide error text |
190
- | `onChange` | `(e: React.ChangeEvent<HTMLInputElement>) => void` | - | Change handler |
297
+ #### Switch
298
+ A toggle switch component for boolean states.
191
299
 
192
- #### Examples
300
+ **Key Features:**
301
+ - Multiple sizes
302
+ - Disabled state
303
+ - Label support
304
+ - Custom colors
305
+ - Loading state
193
306
 
194
307
  ```tsx
195
- // Basic checkbox
196
- <Checkbox label="Accept terms" />
308
+ import { Switch } from 'infinity-ui-elements';
197
309
 
198
- // Controlled checkbox
199
- <Checkbox
200
- label="Subscribe to newsletter"
201
- checked={isSubscribed}
202
- onChange={(e) => setIsSubscribed(e.target.checked)}
310
+ <Switch
311
+ label="Enable notifications"
312
+ checked={isEnabled}
313
+ onChange={(checked) => setIsEnabled(checked)}
203
314
  />
315
+ ```
204
316
 
205
- // With validation
206
- <Checkbox
207
- label="Required field"
208
- validationState="error"
209
- errorText="This field is required"
317
+ ---
318
+
319
+ ### Data Display Components
320
+
321
+ #### Table
322
+ A powerful data table built on TanStack Table with advanced features.
323
+
324
+ **Key Features:**
325
+ - Sorting, filtering, pagination
326
+ - Row selection
327
+ - Expandable detail panels
328
+ - Sticky headers
329
+ - Loading and empty states
330
+ - Custom cell rendering
331
+ - Horizontal scrolling
332
+ - Row hover effects
333
+
334
+ ```tsx
335
+ import { Table } from 'infinity-ui-elements';
336
+ import { useReactTable, getCoreRowModel, createColumnHelper } from '@tanstack/react-table';
337
+
338
+ const columnHelper = createColumnHelper<User>();
339
+
340
+ const columns = [
341
+ columnHelper.accessor('name', {
342
+ header: 'Name',
343
+ cell: info => info.getValue(),
344
+ }),
345
+ columnHelper.accessor('email', {
346
+ header: 'Email',
347
+ }),
348
+ ];
349
+
350
+ const table = useReactTable({
351
+ data,
352
+ columns,
353
+ getCoreRowModel: getCoreRowModel(),
354
+ });
355
+
356
+ <Table
357
+ table={table}
358
+ enableRowSelection
359
+ showRowHover
360
+ stickyHeader
361
+ detailPanel={(row) => <UserDetails user={row.original} />}
210
362
  />
363
+ ```
211
364
 
212
- // Indeterminate state (for "select all" scenarios)
213
- <Checkbox
214
- label="Select all"
215
- isIndeterminate={someSelected && !allSelected}
216
- checked={allSelected}
217
- onChange={handleSelectAll}
365
+ #### Badge
366
+ A small status indicator component.
367
+
368
+ **Key Features:**
369
+ - 2 variants: `light`, `filled`
370
+ - 6 color options
371
+ - 3 sizes: `small`, `medium`, `large`
372
+ - Optional dot indicator
373
+ - Custom content support
374
+
375
+ ```tsx
376
+ import { Badge } from 'infinity-ui-elements';
377
+
378
+ <Badge variant="filled" color="positive">
379
+ Active
380
+ </Badge>
381
+
382
+ <Badge variant="light" color="notice" showDot>
383
+ Pending
384
+ </Badge>
385
+ ```
386
+
387
+ #### Avatar
388
+ A user avatar component with status indicators.
389
+
390
+ **Key Features:**
391
+ - Image or text initials
392
+ - Status indicator with custom icons
393
+ - 5 color variants
394
+ - 2 sizes: `small`, `medium`
395
+ - Label and trailing component support
396
+ - Fallback for broken images
397
+
398
+ ```tsx
399
+ import { Avatar } from 'infinity-ui-elements';
400
+
401
+ <Avatar
402
+ src="/user-avatar.jpg"
403
+ alt="John Doe"
404
+ size="medium"
405
+ showStatus
406
+ statusColor="positive"
407
+ />
408
+
409
+ <Avatar color="a1" size="small">
410
+ JD
411
+ </Avatar>
412
+
413
+ <Avatar
414
+ src="/user.jpg"
415
+ label="John Doe"
416
+ trailingComponent={<ChevronDown />}
417
+ />
418
+ ```
419
+
420
+ #### Counter
421
+ A numeric counter with increment/decrement controls.
422
+
423
+ **Key Features:**
424
+ - Min/max value constraints
425
+ - Step control
426
+ - Disabled state
427
+ - Custom formatting
428
+ - Size variants
429
+
430
+ ```tsx
431
+ import { Counter } from 'infinity-ui-elements';
432
+
433
+ <Counter
434
+ value={count}
435
+ onChange={setCount}
436
+ min={0}
437
+ max={100}
438
+ step={1}
439
+ />
440
+ ```
441
+
442
+ #### Text
443
+ A typography component with consistent styling.
444
+
445
+ **Key Features:**
446
+ - Multiple variants: `display`, `heading`, `body`, `label`, `caption`
447
+ - Size options for each variant
448
+ - Weight options: `regular`, `medium`, `semibold`, `bold`
449
+ - Color options
450
+ - Polymorphic `as` prop
451
+
452
+ ```tsx
453
+ import { Text } from 'infinity-ui-elements';
454
+
455
+ <Text variant="heading" size="xlarge" weight="bold">
456
+ Welcome Back
457
+ </Text>
458
+
459
+ <Text variant="body" size="medium" color="muted">
460
+ This is a description
461
+ </Text>
462
+
463
+ <Text variant="label" as="label" htmlFor="input-id">
464
+ Field Label
465
+ </Text>
466
+ ```
467
+
468
+ ---
469
+
470
+ ### Navigation Components
471
+
472
+ #### Link
473
+ A styled link component with various visual states.
474
+
475
+ **Key Features:**
476
+ - Multiple variants
477
+ - External link support
478
+ - Disabled state
479
+ - Icon support
480
+ - Underline options
481
+
482
+ ```tsx
483
+ import { Link } from 'infinity-ui-elements';
484
+
485
+ <Link href="/dashboard" variant="primary">
486
+ Go to Dashboard
487
+ </Link>
488
+
489
+ <Link href="https://example.com" external>
490
+ Visit Website
491
+ </Link>
492
+ ```
493
+
494
+ #### Tabs / TabItem
495
+ Tab navigation components for organizing content.
496
+
497
+ **Key Features:**
498
+ - Horizontal and vertical layouts
499
+ - Active state management
500
+ - Icon support
501
+ - Disabled tabs
502
+ - Keyboard navigation
503
+
504
+ ```tsx
505
+ import { Tabs, TabItem } from 'infinity-ui-elements';
506
+
507
+ <Tabs>
508
+ <TabItem active>Overview</TabItem>
509
+ <TabItem>Settings</TabItem>
510
+ <TabItem disabled>Analytics</TabItem>
511
+ </Tabs>
512
+ ```
513
+
514
+ #### Pagination
515
+ A pagination component for navigating through pages.
516
+
517
+ **Key Features:**
518
+ - Page number display
519
+ - Previous/Next buttons
520
+ - First/Last page navigation
521
+ - Custom page size
522
+ - Controlled and uncontrolled modes
523
+
524
+ ```tsx
525
+ import { Pagination } from 'infinity-ui-elements';
526
+
527
+ <Pagination
528
+ currentPage={page}
529
+ totalPages={10}
530
+ onPageChange={setPage}
531
+ showFirstLast
532
+ />
533
+ ```
534
+
535
+ ---
536
+
537
+ ### Layout Components
538
+
539
+ #### ButtonGroup
540
+ A component for grouping related buttons.
541
+
542
+ **Key Features:**
543
+ - Horizontal and vertical layouts
544
+ - Connected or separated styles
545
+ - Size variants
546
+ - Full-width option
547
+
548
+ ```tsx
549
+ import { ButtonGroup, Button } from 'infinity-ui-elements';
550
+
551
+ <ButtonGroup>
552
+ <Button variant="secondary">Cancel</Button>
553
+ <Button variant="primary">Save</Button>
554
+ </ButtonGroup>
555
+ ```
556
+
557
+ #### Divider
558
+ A visual separator component.
559
+
560
+ **Key Features:**
561
+ - Horizontal and vertical orientations
562
+ - With or without text
563
+ - Custom styling
564
+ - Spacing control
565
+
566
+ ```tsx
567
+ import { Divider } from 'infinity-ui-elements';
568
+
569
+ <Divider />
570
+
571
+ <Divider orientation="vertical" />
572
+
573
+ <Divider>OR</Divider>
574
+ ```
575
+
576
+ #### Modal
577
+ A modal dialog component for overlays.
578
+
579
+ **Key Features:**
580
+ - Multiple size options
581
+ - Header with title and description
582
+ - Footer support
583
+ - Close on overlay click
584
+ - Escape key support
585
+ - Scroll locking
586
+ - Animation transitions
587
+
588
+ ```tsx
589
+ import { Modal } from 'infinity-ui-elements';
590
+
591
+ <Modal
592
+ isOpen={isOpen}
593
+ onClose={() => setIsOpen(false)}
594
+ title="Confirm Action"
595
+ description="Are you sure you want to proceed?"
596
+ size="medium"
597
+ footer={
598
+ <>
599
+ <Button variant="secondary" onClick={() => setIsOpen(false)}>
600
+ Cancel
601
+ </Button>
602
+ <Button variant="primary" onClick={handleConfirm}>
603
+ Confirm
604
+ </Button>
605
+ </>
606
+ }
607
+ >
608
+ <p>Modal content goes here...</p>
609
+ </Modal>
610
+ ```
611
+
612
+ #### Tooltip
613
+ A tooltip component for displaying contextual information.
614
+
615
+ **Key Features:**
616
+ - Multiple placement options
617
+ - Trigger on hover or click
618
+ - Delay control
619
+ - Arrow indicator
620
+ - Custom styling
621
+
622
+ ```tsx
623
+ import { Tooltip } from 'infinity-ui-elements';
624
+
625
+ <Tooltip content="This is helpful information">
626
+ <Button>Hover me</Button>
627
+ </Tooltip>
628
+ ```
629
+
630
+ #### ListItem
631
+ A list item component for building lists.
632
+
633
+ **Key Features:**
634
+ - Leading and trailing content
635
+ - Multi-line support
636
+ - Clickable/interactive
637
+ - Custom styling
638
+ - Icon support
639
+
640
+ ```tsx
641
+ import { ListItem } from 'infinity-ui-elements';
642
+
643
+ <ListItem
644
+ leadingIcon={<UserIcon />}
645
+ title="John Doe"
646
+ description="john@example.com"
647
+ trailingContent={<ChevronRight />}
648
+ onClick={() => console.log('Clicked')}
218
649
  />
650
+ ```
651
+
652
+ ---
653
+
654
+ ### Form Layout Components
655
+
656
+ #### FormHeader
657
+ A form header component with label and info tooltip.
219
658
 
220
- // Different sizes
221
- <Checkbox size="small" label="Small" />
222
- <Checkbox size="medium" label="Medium" />
223
- <Checkbox size="large" label="Large" />
659
+ **Key Features:**
660
+ - Required/optional indicators
661
+ - Info tooltip
662
+ - Link support
663
+ - Size variants
664
+ - Custom styling
224
665
 
225
- // Disabled
226
- <Checkbox label="Can't change this" isDisabled checked />
666
+ ```tsx
667
+ import { FormHeader } from 'infinity-ui-elements';
668
+
669
+ <FormHeader
670
+ label="Email Address"
671
+ isRequired
672
+ infoHeading="Why we need this"
673
+ infoDescription="We use your email for account recovery"
674
+ linkText="Privacy Policy"
675
+ linkHref="/privacy"
676
+ />
227
677
  ```
228
678
 
229
- ## Publishing
679
+ #### FormFooter
680
+ A form footer component for helper text and validation messages.
681
+
682
+ **Key Features:**
683
+ - Validation state styling
684
+ - Error/success messages
685
+ - Helper text
686
+ - Size variants
687
+
688
+ ```tsx
689
+ import { FormFooter } from 'infinity-ui-elements';
690
+
691
+ <FormFooter
692
+ helperText="Password must be at least 8 characters"
693
+ validationState="negative"
694
+ />
695
+ ```
230
696
 
231
- ### Automated Publishing Commands
697
+ ---
232
698
 
233
- The package includes automated scripts for versioning and publishing:
699
+ ### Interactive Components
700
+
701
+ #### Dropdown / DropdownMenu
702
+ A flexible dropdown menu component.
703
+
704
+ **Key Features:**
705
+ - Custom trigger
706
+ - Nested menus
707
+ - Keyboard navigation
708
+ - Dividers and sections
709
+ - Icon support
710
+ - Custom item rendering
711
+
712
+ ```tsx
713
+ import { Dropdown } from 'infinity-ui-elements';
714
+
715
+ <Dropdown
716
+ trigger={<Button>Options</Button>}
717
+ items={[
718
+ { title: 'Edit', onClick: handleEdit },
719
+ { title: 'Delete', onClick: handleDelete, color: 'negative' },
720
+ ]}
721
+ />
722
+ ```
723
+
724
+ ---
725
+
726
+ ## 🎨 Theming
727
+
728
+ The library uses CSS custom properties for theming. Override these variables in your CSS:
729
+
730
+ ```css
731
+ :root {
732
+ /* Action Colors */
733
+ --color-action-fill-primary-default: #0066ff;
734
+ --color-action-fill-positive-default: #00c48c;
735
+ --color-action-fill-negative-default: #ff5757;
736
+ --color-action-fill-notice-default: #ffa726;
737
+ --color-action-fill-info-default: #00b8d4;
738
+ --color-action-fill-neutral-default: #8e8e93;
739
+
740
+ /* Surface Colors */
741
+ --color-surface-fill-neutral-intense: #ffffff;
742
+ --color-surface-ink-neutral-normal: #1a1a1a;
743
+ --color-surface-ink-neutral-muted: #8e8e93;
744
+
745
+ /* Spacing */
746
+ --size-20: 1.25rem;
747
+ --size-24: 1.5rem;
748
+ --size-28: 1.75rem;
749
+
750
+ /* Border Radius */
751
+ --radius-medium: 8px;
752
+ --radius-large: 12px;
753
+ --radius-xlarge: 16px;
754
+ }
755
+ ```
756
+
757
+ ---
758
+
759
+ ## 🛠️ Development
760
+
761
+ ### Prerequisites
762
+ - Node.js 18+
763
+ - Yarn 4.5.2 (managed via Corepack)
764
+
765
+ ### Setup
766
+
767
+ ```bash
768
+ # Install dependencies
769
+ yarn install
770
+
771
+ # Start Storybook for development
772
+ yarn storybook
773
+
774
+ # Build the library
775
+ yarn build
776
+
777
+ # Type checking
778
+ yarn type-check
779
+ ```
780
+
781
+ ### Project Structure
782
+
783
+ ```
784
+ src/
785
+ ├── components/ # All UI components
786
+ │ ├── Button/
787
+ │ │ ├── Button.tsx # Component implementation
788
+ │ │ ├── Button.stories.tsx # Storybook stories
789
+ │ │ └── index.ts # Exports
790
+ │ └── ...
791
+ ├── lib/ # Utilities and helpers
792
+ │ ├── utils.ts # Utility functions
793
+ │ └── icons.tsx # Icon system
794
+ ├── styles/ # Global styles
795
+ │ ├── theme/ # Theme variables
796
+ │ ├── animations.css # Animations
797
+ │ └── utilities/ # Utility classes
798
+ └── index.ts # Main entry point
799
+ ```
800
+
801
+ ### Adding New Components
802
+
803
+ 1. Create component folder in `src/components/`
804
+ 2. Implement component with TypeScript
805
+ 3. Add Storybook stories for documentation
806
+ 4. Export from component's `index.ts`
807
+ 5. Add export to main `src/index.ts`
808
+
809
+ ---
810
+
811
+ ## 📚 Storybook
812
+
813
+ View interactive documentation and examples:
814
+
815
+ ```bash
816
+ yarn storybook
817
+ ```
818
+
819
+ Or visit the deployed Storybook (if available).
820
+
821
+ ---
822
+
823
+ ## 📤 Publishing
824
+
825
+ ### Automated Publishing
234
826
 
235
827
  ```bash
236
828
  # For bug fixes (1.0.0 -> 1.0.1)
@@ -241,121 +833,132 @@ yarn publish:minor
241
833
 
242
834
  # For breaking changes (1.0.0 -> 2.0.0)
243
835
  yarn publish:major
244
- ```
245
836
 
246
- ### Manual Publishing Steps
837
+ # For beta releases
838
+ yarn publish:beta
839
+ ```
247
840
 
248
- If you prefer manual control:
841
+ ### Manual Publishing
249
842
 
250
843
  ```bash
251
- # 1. Login to npm (if not already logged in)
844
+ # 1. Login to npm
252
845
  npm login
253
846
 
254
- # 2. Update version and build
255
- yarn version:patch # or version:minor, version:major
847
+ # 2. Update version
848
+ yarn version:patch # or version:minor, version:major
849
+
850
+ # 3. Build
851
+ yarn build
256
852
 
257
- # 3. Publish to npm
853
+ # 4. Publish
258
854
  npm publish
259
855
  ```
260
856
 
261
- ### What Happens During Publishing
857
+ ### Pre-publish Checklist
262
858
 
263
- 1. **Version Update**: Updates `package.json` version
264
- 2. **CSS Build**: Generates `dist/index.css` from Tailwind
265
- 3. **JS Build**: Creates `dist/index.js` and `dist/index.esm.js`
266
- 4. **Type Definitions**: Generates TypeScript declarations
267
- 5. **Publish**: Uploads to npm registry
859
+ - All tests pass
860
+ - Type checking passes (`yarn type-check`)
861
+ - Storybook builds successfully
862
+ - CHANGELOG.md updated
863
+ - Version bumped in package.json
268
864
 
269
- ### Pre-publish Hook
865
+ ---
270
866
 
271
- The `prepublishOnly` script ensures the package is always built before publishing, so you never publish outdated code.
867
+ ## 🤝 Contributing
272
868
 
273
- ### Internal Registry Setup
869
+ Contributions are welcome! Please follow these guidelines:
274
870
 
275
- If using a private registry:
871
+ 1. **Fork the repository**
872
+ 2. **Create a feature branch**: `git checkout -b feature/amazing-feature`
873
+ 3. **Make your changes** following the coding standards
874
+ 4. **Add tests** if applicable
875
+ 5. **Update documentation** (README, Storybook)
876
+ 6. **Commit changes**: `git commit -m 'Add amazing feature'`
877
+ 7. **Push to branch**: `git push origin feature/amazing-feature`
878
+ 8. **Open a Pull Request**
276
879
 
277
- ```bash
278
- # Configure npm registry
279
- npm config set registry https://your-internal-registry.com
880
+ ### Component Guidelines
280
881
 
281
- # Then use normal publish commands
282
- yarn publish:patch
283
- ```
882
+ - Use TypeScript with strict mode
883
+ - Follow existing naming conventions
884
+ - Use Tailwind CSS for styling via class-variance-authority
885
+ - Include proper prop types and JSDoc comments
886
+ - Create comprehensive Storybook stories
887
+ - Ensure accessibility (ARIA attributes, keyboard navigation)
888
+ - Export from barrel files (`index.ts`)
284
889
 
285
- ### Consumer Setup
890
+ ---
286
891
 
287
- After publishing, consumers can install and use the library:
892
+ ## 🔍 Browser Support
288
893
 
289
- ```bash
290
- # Install the package
291
- yarn add infinity-ui-elements
894
+ - Chrome (latest)
895
+ - Firefox (latest)
896
+ - Safari (latest)
897
+ - Edge (latest)
292
898
 
293
- # Import components
294
- import { Button } from 'infinity-ui-elements';
899
+ ---
295
900
 
296
- # Import CSS (required for styling)
297
- import 'infinity-ui-elements/dist/index.css';
298
- ```
901
+ ## 📝 License
902
+
903
+ MIT © Himanshu Barmola
904
+
905
+ ---
906
+
907
+ ## 🔗 Links
299
908
 
300
- ### Tailwind CSS Setup for Consumers
909
+ - [NPM Package](https://www.npmjs.com/package/infinity-ui-elements)
910
+ - [GitHub Repository](https://github.com/yourusername/infinity-ui-elements)
911
+ - [Storybook Documentation](https://your-storybook-url.com)
912
+ - [Report Issues](https://github.com/yourusername/infinity-ui-elements/issues)
301
913
 
302
- See the "Required Setup" section above for the complete Tailwind configuration. The key points are:
914
+ ---
303
915
 
304
- 1. **Import the CSS**: `import 'infinity-ui-elements/dist/index.css'`
305
- 2. **Install peer dependencies**: `clsx`, `tailwind-merge`, `class-variance-authority`
306
- 3. **Configure Tailwind properly**: Do NOT include the library in your content paths (for v4) or use safelist patterns (for v3)
916
+ ## 💡 Tips & Best Practices
307
917
 
308
- ## Design Tokens
918
+ ### Performance
919
+ - Import only the components you need (tree-shaking enabled)
920
+ - Use the `cn()` utility for conditional classes
921
+ - Avoid inline styles when possible
309
922
 
310
- The design system uses CSS custom properties (variables) defined in the CSS file:
923
+ ### Styling
924
+ - Always import the main CSS file: `import 'infinity-ui-elements/dist/index.css'`
925
+ - Use the provided design tokens for consistency
926
+ - Extend with custom classes using `className` prop
311
927
 
312
- **Colors:**
313
- - `--color-primary`: #007bff (Blue)
314
- - `--color-secondary`: #6c757d (Gray)
315
- - `--color-success`: #28a745 (Green)
316
- - `--color-danger`: #dc3545 (Red)
317
- - `--color-warning`: #ffc107 (Yellow)
318
- - `--color-info`: #17a2b8 (Cyan)
319
- - `--color-light`: #f8f9fa (Light Gray)
320
- - `--color-dark`: #343a40 (Dark Gray)
928
+ ### Accessibility
929
+ - Always provide labels for form components
930
+ - Use semantic HTML elements
931
+ - Include ARIA attributes where needed
932
+ - Test with keyboard navigation
321
933
 
322
- **Spacing:**
323
- - `--spacing-18`: 4.5rem
324
- - `--spacing-88`: 22rem
934
+ ### TypeScript
935
+ - All components are fully typed
936
+ - Use IntelliSense for prop discovery
937
+ - Extend interfaces if needed for custom types
325
938
 
326
- These variables are automatically mapped to Tailwind classes (e.g., `bg-primary`, `text-secondary`) and can be customized by overriding the CSS variables in your application.
939
+ ---
327
940
 
328
- ## Contributing
941
+ ## 🆘 Support
329
942
 
330
- 1. **Add new components**:
331
- - Create component folder in `src/components/`
332
- - Implement component with TypeScript
333
- - Add Storybook stories
334
- - Export from main index
943
+ Need help? Have questions?
335
944
 
336
- 2. **Component guidelines**:
337
- - Use Tailwind CSS for styling
338
- - Follow TypeScript strict mode
339
- - Include proper prop types
340
- - Add Storybook stories with controls
341
- - Export from barrel files
945
+ - 📧 Email: support@infinityapp.com
946
+ - 💬 GitHub Discussions
947
+ - 🐛 Report bugs via GitHub Issues
342
948
 
343
- 3. **Example component structure**:
344
- ```
345
- src/components/Input/
346
- ├── Input.tsx
347
- ├── Input.stories.tsx
348
- └── index.ts
349
- ```
949
+ ---
350
950
 
351
- ## Scripts
951
+ ## 🎉 Acknowledgments
352
952
 
353
- - `yarn build` - Build the library for production
354
- - `yarn storybook` - Start Storybook development server
355
- - `yarn build-storybook` - Build static Storybook
356
- - `yarn type-check` - Run TypeScript type checking
357
- - `yarn clean` - Remove build artifacts
953
+ Built with:
954
+ - [React](https://reactjs.org/)
955
+ - [TypeScript](https://www.typescriptlang.org/)
956
+ - [Tailwind CSS](https://tailwindcss.com/)
957
+ - [Storybook](https://storybook.js.org/)
958
+ - [TanStack Table](https://tanstack.com/table)
959
+ - [Lucide Icons](https://lucide.dev/)
960
+ - [Class Variance Authority](https://cva.style/)
358
961
 
359
- ## License
962
+ ---
360
963
 
361
- MIT
964
+ **Made with ❤️ by the Infinity Team**