@true-tech-team/react-components 0.0.5 → 0.0.7

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 (111) hide show
  1. package/index.css +1 -1
  2. package/index.js +1 -1
  3. package/index.mjs +14032 -8735
  4. package/lib/components/display/List/List.d.ts +6 -0
  5. package/lib/components/display/List/ListContext.d.ts +15 -0
  6. package/lib/components/display/List/ListEmpty.d.ts +25 -0
  7. package/lib/components/display/List/ListGroup.d.ts +36 -0
  8. package/lib/components/display/List/ListHeader.d.ts +62 -0
  9. package/lib/components/display/List/ListItem.d.ts +19 -0
  10. package/lib/components/display/List/ListSearch.d.ts +32 -0
  11. package/lib/components/display/List/ListSkeleton.d.ts +27 -0
  12. package/lib/components/display/List/hooks/index.d.ts +5 -0
  13. package/lib/components/display/List/hooks/useListExpand.d.ts +6 -0
  14. package/lib/components/display/List/hooks/useListFilter.d.ts +6 -0
  15. package/lib/components/display/List/hooks/useListGroups.d.ts +6 -0
  16. package/lib/components/display/List/hooks/useListKeyboardNav.d.ts +6 -0
  17. package/lib/components/display/List/hooks/useListSelection.d.ts +6 -0
  18. package/lib/components/display/List/index.d.ts +11 -0
  19. package/lib/components/display/List/types.d.ts +485 -0
  20. package/lib/components/display/List/utils.d.ts +47 -0
  21. package/lib/components/display/Table/Table.d.ts +6 -0
  22. package/lib/components/display/Table/TableBody.d.ts +4 -0
  23. package/lib/components/display/Table/TableCell.d.ts +12 -0
  24. package/lib/components/display/Table/TableContext.d.ts +10 -0
  25. package/lib/components/display/Table/TableHeader.d.ts +4 -0
  26. package/lib/components/display/Table/TableRow.d.ts +9 -0
  27. package/lib/components/display/Table/TableSearch.d.ts +32 -0
  28. package/lib/components/display/Table/TableSkeleton.d.ts +12 -0
  29. package/lib/components/display/Table/hooks/index.d.ts +10 -0
  30. package/lib/components/display/Table/hooks/useInfiniteScroll.d.ts +11 -0
  31. package/lib/components/display/Table/hooks/useTableExpand.d.ts +10 -0
  32. package/lib/components/display/Table/hooks/useTableFilter.d.ts +22 -0
  33. package/lib/components/display/Table/hooks/useTableSelection.d.ts +16 -0
  34. package/lib/components/display/Table/hooks/useTableSort.d.ts +11 -0
  35. package/lib/components/display/Table/index.d.ts +13 -0
  36. package/lib/components/display/Table/types.d.ts +295 -0
  37. package/lib/components/display/Table/utils.d.ts +37 -0
  38. package/lib/components/display/index.d.ts +1 -0
  39. package/lib/components/dnd/DndProvider/DndContext.d.ts +91 -0
  40. package/lib/components/dnd/DndProvider/DndProvider.d.ts +37 -0
  41. package/lib/components/dnd/DndProvider/index.d.ts +3 -0
  42. package/lib/components/dnd/DragHandle/DragHandle.d.ts +41 -0
  43. package/lib/components/dnd/DragHandle/index.d.ts +2 -0
  44. package/lib/components/dnd/DragOverlay/DragOverlay.d.ts +39 -0
  45. package/lib/components/dnd/DragOverlay/index.d.ts +2 -0
  46. package/lib/components/dnd/KanbanBoard/KanbanBoard.d.ts +126 -0
  47. package/lib/components/dnd/KanbanBoard/KanbanBoardContext.d.ts +62 -0
  48. package/lib/components/dnd/KanbanBoard/KanbanCard.d.ts +76 -0
  49. package/lib/components/dnd/KanbanBoard/KanbanColumn.d.ts +43 -0
  50. package/lib/components/dnd/KanbanBoard/index.d.ts +5 -0
  51. package/lib/components/dnd/ResizablePanels/ResizablePanel.d.ts +53 -0
  52. package/lib/components/dnd/ResizablePanels/ResizablePanels.d.ts +43 -0
  53. package/lib/components/dnd/ResizablePanels/ResizablePanelsContext.d.ts +64 -0
  54. package/lib/components/dnd/ResizablePanels/ResizeHandle.d.ts +28 -0
  55. package/lib/components/dnd/ResizablePanels/index.d.ts +5 -0
  56. package/lib/components/dnd/SortableGrid/SortableGrid.d.ts +76 -0
  57. package/lib/components/dnd/SortableGrid/SortableGridItem.d.ts +47 -0
  58. package/lib/components/dnd/SortableGrid/index.d.ts +3 -0
  59. package/lib/components/dnd/SortableList/SortableItem.d.ts +76 -0
  60. package/lib/components/dnd/SortableList/SortableList.d.ts +98 -0
  61. package/lib/components/dnd/SortableList/SortableListContext.d.ts +42 -0
  62. package/lib/components/dnd/SortableList/index.d.ts +4 -0
  63. package/lib/components/dnd/hooks/index.d.ts +3 -0
  64. package/lib/components/dnd/hooks/useDraggable.d.ts +66 -0
  65. package/lib/components/dnd/hooks/useDroppable.d.ts +73 -0
  66. package/lib/components/dnd/hooks/useSortable.d.ts +94 -0
  67. package/lib/components/dnd/index.d.ts +8 -0
  68. package/lib/components/filters/FilterContext.d.ts +34 -0
  69. package/lib/components/filters/core/ActiveFilters/ActiveFilters.d.ts +16 -0
  70. package/lib/components/filters/core/ActiveFilters/index.d.ts +2 -0
  71. package/lib/components/filters/core/FilterField/FilterField.d.ts +17 -0
  72. package/lib/components/filters/core/FilterField/index.d.ts +2 -0
  73. package/lib/components/filters/core/FilterProvider/FilterProvider.d.ts +4 -0
  74. package/lib/components/filters/core/FilterProvider/index.d.ts +2 -0
  75. package/lib/components/filters/core/FilterSection/FilterSection.d.ts +16 -0
  76. package/lib/components/filters/core/FilterSection/index.d.ts +2 -0
  77. package/lib/components/filters/core/index.d.ts +7 -0
  78. package/lib/components/filters/fields/CheckboxFilter.d.ts +17 -0
  79. package/lib/components/filters/fields/DateFilter.d.ts +21 -0
  80. package/lib/components/filters/fields/DateRangeFilter.d.ts +19 -0
  81. package/lib/components/filters/fields/ListSelectFilter.d.ts +19 -0
  82. package/lib/components/filters/fields/MultiSelectFilter.d.ts +19 -0
  83. package/lib/components/filters/fields/NumberFilter.d.ts +19 -0
  84. package/lib/components/filters/fields/NumberRangeFilter.d.ts +19 -0
  85. package/lib/components/filters/fields/RatingFilter.d.ts +19 -0
  86. package/lib/components/filters/fields/SelectFilter.d.ts +21 -0
  87. package/lib/components/filters/fields/TextFilter.d.ts +21 -0
  88. package/lib/components/filters/fields/ToggleFilter.d.ts +17 -0
  89. package/lib/components/filters/fields/index.d.ts +25 -0
  90. package/lib/components/filters/hooks/index.d.ts +9 -0
  91. package/lib/components/filters/hooks/useFilter.d.ts +57 -0
  92. package/lib/components/filters/hooks/useFilterDependencies.d.ts +40 -0
  93. package/lib/components/filters/hooks/useFilterOptions.d.ts +70 -0
  94. package/lib/components/filters/index.d.ts +43 -0
  95. package/lib/components/filters/layouts/FilterAccordion/FilterAccordion.d.ts +15 -0
  96. package/lib/components/filters/layouts/FilterAccordion/index.d.ts +2 -0
  97. package/lib/components/filters/layouts/FilterBar/FilterBar.d.ts +18 -0
  98. package/lib/components/filters/layouts/FilterBar/index.d.ts +2 -0
  99. package/lib/components/filters/layouts/FilterModal/FilterModal.d.ts +24 -0
  100. package/lib/components/filters/layouts/FilterModal/index.d.ts +2 -0
  101. package/lib/components/filters/layouts/FilterPopover/FilterPopover.d.ts +19 -0
  102. package/lib/components/filters/layouts/FilterPopover/index.d.ts +2 -0
  103. package/lib/components/filters/layouts/FilterSidebar/FilterSidebar.d.ts +20 -0
  104. package/lib/components/filters/layouts/FilterSidebar/index.d.ts +2 -0
  105. package/lib/components/filters/layouts/index.d.ts +8 -0
  106. package/lib/components/filters/types.d.ts +937 -0
  107. package/lib/components/index.d.ts +8 -0
  108. package/lib/components/inputs/Checkbox/Checkbox.d.ts +2 -2
  109. package/lib/components/inputs/NumberInput/NumberInput.d.ts +3 -1
  110. package/package.json +1 -2
  111. package/README.md +0 -826
package/README.md DELETED
@@ -1,826 +0,0 @@
1
- # @true-tech-team/ui-components
2
-
3
- A comprehensive React component library built with TypeScript, SCSS Modules, and featuring a robust theming system with dark/light mode support.
4
-
5
- ## Features
6
-
7
- - 🎨 **Comprehensive Theming** - 37 color families with 10 shades each (370+ colors)
8
- - 🌓 **Dark/Light Mode** - Built-in theme switching with CSS variables
9
- - 📏 **4px Grid System** - Consistent spacing throughout
10
- - 🎯 **Type-Safe** - Full TypeScript support with comprehensive types
11
- - 🧩 **Component Library** - Reusable, customizable components
12
- - 🎭 **Icon System** - SVG-based icons with easy customization
13
- - 🛠️ **Utility Classes** - 500+ utility classes for rapid development
14
- - 📦 **Tree-Shakeable** - Optimized bundle sizes
15
- - ♿ **Accessible** - Built with accessibility in mind
16
-
17
- ## Installation
18
-
19
- ```bash
20
- npm install @true-tech-team/ui-components
21
- ```
22
-
23
- ## Quick Start
24
-
25
- ### Wrap your app with GlobalProvider
26
-
27
- ```tsx
28
- import { GlobalProvider } from '@true-tech-team/ui-components';
29
-
30
- function App() {
31
- return (
32
- <GlobalProvider themeConfig={{ mode: 'light' }}>
33
- <YourApp />
34
- </GlobalProvider>
35
- );
36
- }
37
- ```
38
-
39
- ### Use components
40
-
41
- ```tsx
42
- import { Button, Icon } from '@true-tech-team/ui-components';
43
-
44
- function MyComponent() {
45
- return (
46
- <div>
47
- <Button variant="primary" size="md">
48
- Click me
49
- </Button>
50
-
51
- <Button
52
- variant="outline"
53
- startIcon={<Icon name="check" size={16} />}
54
- >
55
- Save
56
- </Button>
57
- </div>
58
- );
59
- }
60
- ```
61
-
62
- ## Components
63
-
64
- ### Buttons
65
-
66
- #### Button
67
- Versatile button component with multiple variants and sizes.
68
-
69
- ```tsx
70
- <Button variant="primary" size="md" onClick={() => console.log('clicked')}>
71
- Click me
72
- </Button>
73
-
74
- <Button variant="outline" startIcon={<Icon name="check" />}>
75
- With Icon
76
- </Button>
77
- ```
78
-
79
- **Variants:** primary, secondary, outline, ghost
80
- **Sizes:** sm, md, lg
81
-
82
- #### IconButton
83
- Button component optimized for icon-only display.
84
-
85
- ```tsx
86
- <IconButton aria-label="Close" size="md">
87
- <Icon name="close" />
88
- </IconButton>
89
- ```
90
-
91
- ### Display
92
-
93
- #### Icon
94
- SVG-based icon system with customizable size and color.
95
-
96
- ```tsx
97
- <Icon name="check" size={24} color="var(--theme-primary)" />
98
- ```
99
-
100
- **Available icons:** chevron-down, chevron-up, chevron-left, chevron-right, close, check, info, warning, error, eye, eye-off, user, users, building, dollar, chart-line, chart-bar, trending-down, and more
101
-
102
- #### Avatar
103
- User profile avatars with image, initials, and icon variants.
104
-
105
- ```tsx
106
- <Avatar src="/path/to/image.jpg" alt="User name" size="md" />
107
- <Avatar initials="JD" size="lg" />
108
- <Avatar icon={<Icon name="user" />} variant="secondary" />
109
- ```
110
-
111
- **Sizes:** xs, sm, md, lg, xl
112
- **Variants:** primary, secondary, tertiary
113
-
114
- #### Badge
115
- Notification badges with count display.
116
-
117
- ```tsx
118
- <Badge count={5} variant="primary" />
119
- <Badge count={99} max={99} variant="error" />
120
- ```
121
-
122
- #### Chip
123
- Interactive chips for tags and selections.
124
-
125
- ```tsx
126
- <Chip label="React" onDelete={() => {}} />
127
- <Chip label="TypeScript" variant="outlined" />
128
- ```
129
-
130
- #### Pill
131
- Status and category pills.
132
-
133
- ```tsx
134
- <Pill label="Active" variant="success" />
135
- <Pill label="Pending" variant="warning" />
136
- ```
137
-
138
- #### Tag
139
- Labeling and categorization tags.
140
-
141
- ```tsx
142
- <Tag>New</Tag>
143
- <Tag variant="success">Available</Tag>
144
- ```
145
-
146
- #### StatusIndicator
147
- Status indicator dots with labels.
148
-
149
- ```tsx
150
- <StatusIndicator status="online" label="Online" />
151
- <StatusIndicator status="offline" label="Offline" />
152
- ```
153
-
154
- #### ProgressBar
155
- Linear progress bars with labels and variants.
156
-
157
- ```tsx
158
- <ProgressBar value={75} max={100} variant="primary" />
159
- <ProgressBar value={50} label="50%" showLabel />
160
- ```
161
-
162
- #### CircularProgress
163
- Circular progress indicators.
164
-
165
- ```tsx
166
- <CircularProgress value={75} size={64} />
167
- <CircularProgress indeterminate size={48} />
168
- ```
169
-
170
- #### Skeleton
171
- Loading skeleton screens for content placeholders.
172
-
173
- ```tsx
174
- <Skeleton variant="text" width="100%" />
175
- <Skeleton variant="circular" width={40} height={40} />
176
- <Skeleton variant="rectangular" width={200} height={100} />
177
- ```
178
-
179
- #### KPI
180
- Key Performance Indicator display component.
181
-
182
- ```tsx
183
- <KPI
184
- value="$45,231"
185
- label="Total Revenue"
186
- trend={12.5}
187
- trendDirection="up"
188
- icon={<Icon name="dollar" />}
189
- />
190
- ```
191
-
192
- #### Stat
193
- Statistical display component for metrics.
194
-
195
- ```tsx
196
- <Stat
197
- label="Total Users"
198
- value="1,234"
199
- change="+12.5%"
200
- changeType="increase"
201
- />
202
- ```
203
-
204
- ### Inputs
205
-
206
- #### Input
207
- Text input with validation, formatting, and various configurations.
208
-
209
- ```tsx
210
- <Input
211
- label="Email"
212
- type="email"
213
- placeholder="Enter your email"
214
- validation={(value) => value.includes('@') ? { valid: true } : { valid: false, message: 'Invalid email' }}
215
- />
216
- ```
217
-
218
- #### Autocomplete
219
- Input with dropdown suggestions and filtering.
220
-
221
- ```tsx
222
- <Autocomplete
223
- options={[
224
- { value: '1', label: 'Option 1' },
225
- { value: '2', label: 'Option 2' }
226
- ]}
227
- placeholder="Search..."
228
- />
229
- ```
230
-
231
- #### Select
232
- Dropdown select component with search and custom rendering.
233
-
234
- ```tsx
235
- <Select
236
- options={[
237
- { value: 'us', label: 'United States' },
238
- { value: 'ca', label: 'Canada' }
239
- ]}
240
- placeholder="Select country"
241
- />
242
- ```
243
-
244
- #### Checkbox
245
- Checkbox input with labels and indeterminate state.
246
-
247
- ```tsx
248
- <Checkbox label="Accept terms" checked={accepted} onChange={setAccepted} />
249
- ```
250
-
251
- #### Radio & RadioGroup
252
- Radio button inputs with group management.
253
-
254
- ```tsx
255
- <RadioGroup value={selected} onChange={setSelected}>
256
- <Radio value="option1" label="Option 1" />
257
- <Radio value="option2" label="Option 2" />
258
- </RadioGroup>
259
- ```
260
-
261
- #### Toggle
262
- Switch/toggle component for boolean states.
263
-
264
- ```tsx
265
- <Toggle checked={enabled} onChange={setEnabled} label="Enable feature" />
266
- ```
267
-
268
- #### Textarea
269
- Multi-line text input with auto-resize.
270
-
271
- ```tsx
272
- <Textarea
273
- label="Description"
274
- placeholder="Enter description"
275
- rows={4}
276
- maxLength={500}
277
- />
278
- ```
279
-
280
- #### NumberInput
281
- Numeric input with increment/decrement controls.
282
-
283
- ```tsx
284
- <NumberInput
285
- label="Quantity"
286
- min={0}
287
- max={100}
288
- step={1}
289
- value={quantity}
290
- onChange={setQuantity}
291
- />
292
- ```
293
-
294
- #### PhoneInput
295
- International phone number input with country selection.
296
-
297
- ```tsx
298
- <PhoneInput
299
- value={phone}
300
- onChange={setPhone}
301
- defaultCountry="US"
302
- />
303
- ```
304
-
305
- #### Slider
306
- Range slider with marks and custom formatting.
307
-
308
- ```tsx
309
- <Slider
310
- min={0}
311
- max={100}
312
- value={volume}
313
- onChange={setVolume}
314
- marks={[0, 25, 50, 75, 100]}
315
- />
316
- ```
317
-
318
- #### Rating
319
- Star rating input component.
320
-
321
- ```tsx
322
- <Rating value={rating} onChange={setRating} max={5} />
323
- ```
324
-
325
- #### TagInput
326
- Input for managing multiple tags.
327
-
328
- ```tsx
329
- <TagInput
330
- tags={tags}
331
- onChange={setTags}
332
- placeholder="Add tag..."
333
- />
334
- ```
335
-
336
- #### FilePicker
337
- File upload component with drag-and-drop support.
338
-
339
- ```tsx
340
- <FilePicker
341
- accept=".pdf,.doc,.docx"
342
- maxSize={5 * 1024 * 1024}
343
- onChange={(files) => console.log(files)}
344
- />
345
- ```
346
-
347
- #### ColorPicker
348
- Color selection with multiple format support (hex, rgb, hsl).
349
-
350
- ```tsx
351
- <ColorPicker
352
- value={color}
353
- onChange={setColor}
354
- format="hex"
355
- />
356
- ```
357
-
358
- #### DatePicker
359
- Single date selection with calendar interface.
360
-
361
- ```tsx
362
- <DatePicker
363
- value={date}
364
- onChange={setDate}
365
- minDate={new Date()}
366
- />
367
- ```
368
-
369
- #### DateRangePicker
370
- Date range selection with presets.
371
-
372
- ```tsx
373
- <DateRangePicker
374
- startDate={startDate}
375
- endDate={endDate}
376
- onChange={(start, end) => {
377
- setStartDate(start);
378
- setEndDate(end);
379
- }}
380
- presets={[
381
- { label: 'Last 7 days', value: { start: -7, end: 0 } }
382
- ]}
383
- />
384
- ```
385
-
386
- ### Overlays
387
-
388
- #### Portal
389
- Render children in a different part of the DOM.
390
-
391
- ```tsx
392
- <Portal>
393
- <div>This renders at document.body</div>
394
- </Portal>
395
- ```
396
-
397
- #### Popover
398
- Floating content positioned relative to a trigger.
399
-
400
- ```tsx
401
- <Popover
402
- trigger={<Button>Open Popover</Button>}
403
- content={<div>Popover content</div>}
404
- />
405
- ```
406
-
407
- #### Tooltip
408
- Hover tooltip with customizable positioning.
409
-
410
- ```tsx
411
- <Tooltip content="Helpful information" position="top">
412
- <Button>Hover me</Button>
413
- </Tooltip>
414
- ```
415
-
416
- #### Dropdown
417
- Dropdown menu with trigger and content.
418
-
419
- ```tsx
420
- <Dropdown
421
- trigger={<Button>Options</Button>}
422
- content={
423
- <MenuList>
424
- <MenuItem>Action 1</MenuItem>
425
- <MenuItem>Action 2</MenuItem>
426
- </MenuList>
427
- }
428
- />
429
- ```
430
-
431
- #### Menu
432
- Flexible menu system with items, groups, and dividers.
433
-
434
- ```tsx
435
- <Menu>
436
- <MenuList>
437
- <MenuItem onClick={() => console.log('Edit')}>Edit</MenuItem>
438
- <MenuItem onClick={() => console.log('Delete')}>Delete</MenuItem>
439
- <MenuDivider />
440
- <MenuGroup label="More options">
441
- <MenuItem>Settings</MenuItem>
442
- </MenuGroup>
443
- </MenuList>
444
- </Menu>
445
- ```
446
-
447
- ### Navigation
448
-
449
- #### Stepper
450
- Multi-step progress indicator for wizard-like interfaces.
451
-
452
- ```tsx
453
- <Stepper activeStep={1}>
454
- <Step label="Account" description="Create your account" />
455
- <Step label="Profile" description="Set up your profile" />
456
- <Step label="Review" description="Review and submit" />
457
- </Stepper>
458
- ```
459
-
460
- #### Breadcrumbs
461
- Navigation breadcrumb trail for hierarchical page structure.
462
-
463
- ```tsx
464
- <Breadcrumbs>
465
- <BreadcrumbItem href="/">Home</BreadcrumbItem>
466
- <BreadcrumbItem href="/products">Products</BreadcrumbItem>
467
- <BreadcrumbItem>Current Page</BreadcrumbItem>
468
- </Breadcrumbs>
469
- ```
470
-
471
- #### Navbar
472
- Responsive navigation bar with collapsible menu support.
473
-
474
- ```tsx
475
- <Navbar>
476
- <NavbarBrand>My App</NavbarBrand>
477
- <NavbarToggle />
478
- <NavbarCollapse>
479
- <NavbarNav>
480
- <NavLink href="/">Home</NavLink>
481
- <NavLink href="/about">About</NavLink>
482
- </NavbarNav>
483
- <NavbarActions>
484
- <Button>Sign In</Button>
485
- </NavbarActions>
486
- </NavbarCollapse>
487
- </Navbar>
488
- ```
489
-
490
- #### SideNav
491
- Sidebar navigation with groups, items, and dividers.
492
-
493
- ```tsx
494
- <SideNav>
495
- <SideNavGroup label="Main">
496
- <SideNavItem icon={<Icon name="home" />} href="/">Dashboard</SideNavItem>
497
- <SideNavItem icon={<Icon name="users" />} href="/users">Users</SideNavItem>
498
- </SideNavGroup>
499
- <SideNavDivider />
500
- <SideNavItem icon={<Icon name="settings" />} href="/settings">Settings</SideNavItem>
501
- </SideNav>
502
- ```
503
-
504
- #### Pagination
505
- Page navigation with customizable controls.
506
-
507
- ```tsx
508
- <Pagination
509
- currentPage={page}
510
- totalPages={10}
511
- onPageChange={setPage}
512
- showFirstLast
513
- />
514
- ```
515
-
516
- #### BottomNavigation
517
- Mobile-friendly bottom navigation bar.
518
-
519
- ```tsx
520
- <BottomNavigation value={tab} onChange={setTab}>
521
- <BottomNavigationItem icon={<Icon name="home" />} label="Home" value="home" />
522
- <BottomNavigationItem icon={<Icon name="search" />} label="Search" value="search" />
523
- <BottomNavigationItem icon={<Icon name="user" />} label="Profile" value="profile" />
524
- </BottomNavigation>
525
- ```
526
-
527
- #### Tabs
528
- Tabbed content navigation.
529
-
530
- ```tsx
531
- <Tabs defaultValue="tab1">
532
- <TabList>
533
- <Tab value="tab1">Tab 1</Tab>
534
- <Tab value="tab2">Tab 2</Tab>
535
- </TabList>
536
- <TabPanel value="tab1">Content 1</TabPanel>
537
- <TabPanel value="tab2">Content 2</TabPanel>
538
- </Tabs>
539
- ```
540
-
541
- ### Layout
542
-
543
- #### Panes
544
- Resizable split pane layouts.
545
-
546
- ```tsx
547
- <Panes direction="horizontal">
548
- <Pane minSize={200}>Left Panel</Pane>
549
- <Pane>Right Panel</Pane>
550
- </Panes>
551
- ```
552
-
553
- #### ResponsiveStack
554
- Stack layout that adapts to screen size.
555
-
556
- ```tsx
557
- <ResponsiveStack breakpoint={768} spacing={4}>
558
- <Card>Item 1</Card>
559
- <Card>Item 2</Card>
560
- </ResponsiveStack>
561
- ```
562
-
563
- #### AdaptiveGrid
564
- Auto-adjusting grid layout based on container width.
565
-
566
- ```tsx
567
- <AdaptiveGrid minItemWidth={250} gap={16}>
568
- <Card>Item 1</Card>
569
- <Card>Item 2</Card>
570
- <Card>Item 3</Card>
571
- </AdaptiveGrid>
572
- ```
573
-
574
- #### MasonryLayout
575
- Pinterest-style masonry grid for variable-height items.
576
-
577
- ```tsx
578
- <MasonryLayout columns={3} gap={16}>
579
- <Card>Short content</Card>
580
- <Card>Much longer content that takes more space</Card>
581
- <Card>Medium content</Card>
582
- </MasonryLayout>
583
- ```
584
-
585
- ### Forms
586
-
587
- #### FormBuilder
588
- Dynamic form builder with validation and state management.
589
-
590
- ```tsx
591
- <FormBuilder
592
- fields={[
593
- {
594
- name: 'email',
595
- label: 'Email',
596
- type: 'email',
597
- required: true,
598
- validation: { pattern: /^[^\s@]+@[^\s@]+\.[^\s@]+$/ }
599
- },
600
- {
601
- name: 'password',
602
- label: 'Password',
603
- type: 'password',
604
- required: true
605
- }
606
- ]}
607
- onSubmit={(values) => console.log(values)}
608
- />
609
- ```
610
-
611
- ## Theming
612
-
613
- ### Theme Configuration
614
-
615
- The library includes a comprehensive theming system with 37 color families and 10 shades each, providing 370+ colors out of the box.
616
-
617
- ```tsx
618
- import { GlobalProvider } from '@true-tech-team/ui-components';
619
-
620
- function App() {
621
- return (
622
- <GlobalProvider
623
- themeConfig={{
624
- mode: 'light',
625
- // Optional: override theme values
626
- overrides: {
627
- colors: {
628
- primary: '#007bff'
629
- }
630
- }
631
- }}
632
- >
633
- <YourApp />
634
- </GlobalProvider>
635
- );
636
- }
637
- ```
638
-
639
- ### Toggle Theme
640
-
641
- ```tsx
642
- import { useTheme } from '@true-tech-team/ui-components';
643
-
644
- function ThemeToggle() {
645
- const { mode, toggleMode } = useTheme();
646
- return <button onClick={toggleMode}>Current: {mode}</button>;
647
- }
648
- ```
649
-
650
- ### CSS Variables
651
-
652
- All theme values are exposed as CSS variables for easy customization:
653
-
654
- ```css
655
- .custom-element {
656
- color: var(--theme-primary);
657
- background: var(--theme-surface);
658
- border-radius: var(--theme-radius-md);
659
- padding: var(--theme-spacing-4);
660
- }
661
- ```
662
-
663
- ### Utility Classes
664
-
665
- **Spacing (4px grid):**
666
- ```html
667
- <div class="m-4 p-2">Margin 16px, Padding 8px</div>
668
- <div class="mt-2 mb-4 px-6">Margin top 8px, bottom 16px, padding x 24px</div>
669
- ```
670
-
671
- **Flexbox:**
672
- ```html
673
- <div class="flex items-center justify-between gap-4">...</div>
674
- <div class="flex-col items-start">...</div>
675
- ```
676
-
677
- **Grid:**
678
- ```html
679
- <div class="grid grid-cols-3 gap-4">...</div>
680
- ```
681
-
682
- **Colors:**
683
- ```html
684
- <div class="bg-primary text-on-primary">...</div>
685
- <div class="bg-surface text-on-surface">...</div>
686
- ```
687
-
688
- **Typography:**
689
- ```html
690
- <h1 class="text-2xl font-bold">Heading</h1>
691
- <p class="text-sm text-secondary">Small text</p>
692
- ```
693
-
694
- ## Utility Functions
695
-
696
- ### Theme Utils
697
-
698
- ```tsx
699
- import { getThemeValue, setThemeValue, pxToRem, gridSpacing } from '@true-tech-team/ui-components';
700
-
701
- // Get theme values
702
- const primaryColor = getThemeValue('--theme-primary');
703
-
704
- // Convert pixels to rem
705
- const remValue = pxToRem(16); // '1rem'
706
-
707
- // Grid-based spacing
708
- const spacing = gridSpacing(4); // '16px' (4 * 4px grid)
709
- ```
710
-
711
- ### Color Utils
712
-
713
- ```tsx
714
- import {
715
- hexToRgb,
716
- rgbToHsl,
717
- isLightColor,
718
- getBrightness
719
- } from '@true-tech-team/ui-components';
720
-
721
- const rgb = hexToRgb('#ff0000'); // { r: 255, g: 0, b: 0 }
722
- const hsl = rgbToHsl(255, 0, 0); // { h: 0, s: 100, l: 50 }
723
- const isLight = isLightColor('#ffffff'); // true
724
- ```
725
-
726
- ### Date Utils
727
-
728
- ```tsx
729
- import {
730
- formatDate,
731
- getDaysInMonth,
732
- isDateInRange,
733
- addDays
734
- } from '@true-tech-team/ui-components';
735
-
736
- const formatted = formatDate(new Date(), 'YYYY-MM-DD');
737
- const daysInMonth = getDaysInMonth(2024, 0); // January 2024
738
- const inRange = isDateInRange(date, startDate, endDate);
739
- const futureDate = addDays(new Date(), 7);
740
- ```
741
-
742
- ### Validation Utils
743
-
744
- ```tsx
745
- import { validators, combineValidators } from '@true-tech-team/ui-components';
746
-
747
- const emailValidator = validators.email();
748
- const requiredValidator = validators.required('This field is required');
749
- const combined = combineValidators([requiredValidator, emailValidator]);
750
-
751
- const result = combined('test@example.com');
752
- ```
753
-
754
- ## Development
755
-
756
- ### Building
757
-
758
- ```bash
759
- # Build library for production
760
- nx build ui-components --configuration=production
761
-
762
- # Build for development
763
- nx build ui-components --configuration=development
764
- ```
765
-
766
- The build output will be in `dist/libs/ui-components/`.
767
-
768
- ### Testing
769
-
770
- ```bash
771
- # Run tests
772
- nx test ui-components
773
-
774
- # Run tests in watch mode
775
- nx test ui-components --watch
776
-
777
- # Run tests with coverage
778
- nx test ui-components --coverage
779
- ```
780
-
781
- ### Linting
782
-
783
- ```bash
784
- # Lint
785
- nx lint ui-components
786
-
787
- # Lint and fix
788
- nx lint ui-components --fix
789
- ```
790
-
791
- ### Storybook
792
-
793
- View and interact with all components in Storybook:
794
-
795
- ```bash
796
- # Start Storybook dev server
797
- nx storybook ui-components
798
-
799
- # Build Storybook static site
800
- nx build-storybook ui-components
801
- ```
802
-
803
- Storybook will be available at [http://localhost:6006](http://localhost:6006).
804
-
805
- ## Browser Support
806
-
807
- - Chrome (latest)
808
- - Firefox (latest)
809
- - Safari (latest)
810
- - Edge (latest)
811
-
812
- ## TypeScript
813
-
814
- This library is written in TypeScript and includes type definitions. All components, props, and utilities are fully typed for the best development experience.
815
-
816
- ## Contributing
817
-
818
- Contributions are welcome! Please ensure all tests pass and follow the existing code style.
819
-
820
- ## Repository
821
-
822
- [https://github.com/true-tech-team/true-tech-team](https://github.com/true-tech-team/true-tech-team)
823
-
824
- ## License
825
-
826
- MIT