@g4rcez/components 4.0.1 → 4.1.1
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/ai/SKILL.md +233 -0
- package/ai/docs/Alert.md +166 -0
- package/ai/docs/AnimatedList.md +206 -0
- package/ai/docs/Autocomplete.md +221 -0
- package/ai/docs/Button.md +182 -0
- package/ai/docs/Calendar.md +185 -0
- package/ai/docs/Card.md +178 -0
- package/ai/docs/Checkbox.md +194 -0
- package/ai/docs/CommandPalette.md +275 -0
- package/ai/docs/DatePicker.md +152 -0
- package/ai/docs/Dropdown.md +195 -0
- package/{dist/ai → ai}/docs/Empty.md +41 -44
- package/{dist/ai → ai}/docs/Expand.md +40 -54
- package/ai/docs/FileUpload.md +218 -0
- package/{dist/ai → ai}/docs/Form.md +35 -29
- package/{dist/ai → ai}/docs/FormReset.md +37 -37
- package/{dist/ai → ai}/docs/Heading.md +4 -6
- package/ai/docs/Input.md +212 -0
- package/ai/docs/InputField.md +170 -0
- package/ai/docs/List.md +208 -0
- package/ai/docs/Menu.md +168 -0
- package/ai/docs/Modal.md +273 -0
- package/ai/docs/MultiSelect.md +177 -0
- package/ai/docs/Notifications.md +231 -0
- package/ai/docs/PageCalendar.md +262 -0
- package/{dist/ai → ai}/docs/Polymorph.md +25 -41
- package/{dist/ai → ai}/docs/Progress.md +55 -51
- package/{dist/ai → ai}/docs/Radiobox.md +49 -41
- package/{dist/ai → ai}/docs/RenderOnView.md +26 -32
- package/{dist/ai → ai}/docs/Resizable.md +60 -65
- package/ai/docs/Select.md +284 -0
- package/{dist/ai → ai}/docs/Shortcut.md +14 -14
- package/{dist/ai → ai}/docs/Skeleton.md +56 -60
- package/{dist/ai → ai}/docs/Slider.md +26 -49
- package/{dist/ai → ai}/docs/Slot.md +15 -17
- package/{dist/ai → ai}/docs/Spinner.md +17 -15
- package/{dist/ai → ai}/docs/Stats.md +44 -42
- package/ai/docs/Step.md +159 -0
- package/{dist/ai → ai}/docs/Switch.md +44 -54
- package/ai/docs/Table.md +286 -0
- package/ai/docs/Tabs.md +191 -0
- package/ai/docs/Tag.md +222 -0
- package/{dist/ai → ai}/docs/TaskList.md +40 -50
- package/ai/docs/Textarea.md +144 -0
- package/ai/docs/Timeline.md +212 -0
- package/{dist/ai → ai}/docs/Toolbar.md +46 -46
- package/ai/docs/Tooltip.md +231 -0
- package/ai/docs/Typography.md +187 -0
- package/ai/docs/Wizard.md +208 -0
- package/ai/docs/index.md +183 -0
- package/dist/autocomplete-DcTNOwyg.js +393 -0
- package/dist/autocomplete-DcTNOwyg.js.map +1 -0
- package/dist/{calendar-B5lSd0ID.js → calendar-BJMHRoy2.js} +104 -105
- package/dist/calendar-BJMHRoy2.js.map +1 -0
- package/dist/components/core/button.js +10 -10
- package/dist/components/core/button.js.map +1 -1
- package/dist/components/core/tag.js +4 -4
- package/dist/components/core/tag.js.map +1 -1
- package/dist/components/display/alert.js +48 -46
- package/dist/components/display/alert.js.map +1 -1
- package/dist/components/display/calendar.js +6 -6
- package/dist/components/display/card.js +2 -2
- package/dist/components/display/card.js.map +1 -1
- package/dist/components/display/list.js +1 -1
- package/dist/components/display/list.js.map +1 -1
- package/dist/components/display/notifications.js +3 -3
- package/dist/components/display/stats.js +1 -1
- package/dist/components/display/tabs.js +2 -2
- package/dist/components/display/timeline.js +1 -1
- package/dist/components/floating/dropdown.js +25 -17
- package/dist/components/floating/dropdown.js.map +1 -1
- package/dist/components/floating/expand.js +7 -7
- package/dist/components/floating/expand.js.map +1 -1
- package/dist/components/floating/menu.js +10 -10
- package/dist/components/floating/menu.js.map +1 -1
- package/dist/components/floating/modal.js +106 -102
- package/dist/components/floating/modal.js.map +1 -1
- package/dist/components/floating/tooltip.js +14 -14
- package/dist/components/floating/tooltip.js.map +1 -1
- package/dist/components/form/autocomplete.js +6 -6
- package/dist/components/form/checkbox.js +1 -1
- package/dist/components/form/date-picker.js +5 -5
- package/dist/components/form/file-upload.js +2 -2
- package/dist/components/form/form.js.map +1 -1
- package/dist/components/form/input.js +1 -1
- package/dist/components/form/radiobox.js +1 -1
- package/dist/components/form/select.js +3 -3
- package/dist/components/form/switch.js +2 -2
- package/dist/components/form/switch.js.map +1 -1
- package/dist/components/table/table.js +3 -3
- package/dist/{date-picker-DwNo22lx.js → date-picker-Bnl07nd8.js} +8 -6
- package/dist/date-picker-Bnl07nd8.js.map +1 -0
- package/dist/{dom-Dl8XH0CK.js → dom-CyQHY7ID.js} +66 -61
- package/dist/dom-CyQHY7ID.js.map +1 -0
- package/dist/{file-upload-Brf2NkLr.js → file-upload-93d5DR4q.js} +139 -129
- package/dist/file-upload-93d5DR4q.js.map +1 -0
- package/dist/{floating-ui.react-QNHG9W4N.js → floating-ui.react-M2PGXLDp.js} +8 -8
- package/dist/floating-ui.react-M2PGXLDp.js.map +1 -0
- package/dist/{fns-D2eyJKd5.js → fns-C7Dt27Qd.js} +2 -2
- package/dist/fns-C7Dt27Qd.js.map +1 -0
- package/dist/index-BJ1ayTam.js +126 -0
- package/dist/index-BJ1ayTam.js.map +1 -0
- package/dist/index-C-PuFUZi.js.map +1 -1
- package/dist/{index-BelDtX5M.js → index-DDeQW0JW.js} +399 -404
- package/dist/index-DDeQW0JW.js.map +1 -0
- package/dist/index-DE4shK8D.js +215 -0
- package/dist/index-DE4shK8D.js.map +1 -0
- package/dist/{index-DJSMaZR4.js → index-DlJ_2RBL.js} +2 -2
- package/dist/index-DlJ_2RBL.js.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.esm-BaIwleSE.js.map +1 -1
- package/dist/index.js +2826 -2765
- package/dist/index.js.map +1 -1
- package/dist/{input-CrGrSnUt.js → input-_MVxmIpu.js} +116 -114
- package/dist/input-_MVxmIpu.js.map +1 -0
- package/dist/{input-field-5vYcz5tT.js → input-field-CDCOODOl.js} +63 -47
- package/dist/input-field-CDCOODOl.js.map +1 -0
- package/dist/notifications-Dp0ydKJS.js +2576 -0
- package/dist/notifications-Dp0ydKJS.js.map +1 -0
- package/dist/polymorph-B5n9fs_K.js.map +1 -1
- package/dist/preset/plugin.tailwind.d.ts.map +1 -1
- package/dist/preset/plugin.tailwind.js +20 -18
- package/dist/preset/preset.tailwind.js +24 -25
- package/dist/preset/src/styles/common.js +6 -3
- package/dist/preset/src/styles/dark.d.ts.map +1 -1
- package/dist/preset/src/styles/dark.js +9 -5
- package/dist/preset/src/styles/design-tokens.js +68 -89
- package/dist/preset/src/styles/light.d.ts.map +1 -1
- package/dist/preset/src/styles/light.js +9 -5
- package/dist/preset/src/styles/theme.js +7 -4
- package/dist/preset/src/styles/theme.types.d.ts +2 -1
- package/dist/preset/src/styles/theme.types.d.ts.map +1 -1
- package/dist/preset/src/styles/theme.types.js +2 -1
- package/dist/skeleton-BjJobYYf.js +24 -0
- package/dist/skeleton-BjJobYYf.js.map +1 -0
- package/dist/slot-CRyweuj0.js.map +1 -1
- package/dist/styles/common.js +6 -3
- package/dist/styles/dark.d.ts.map +1 -1
- package/dist/styles/dark.js +9 -5
- package/dist/styles/design-tokens.js +68 -89
- package/dist/styles/light.d.ts.map +1 -1
- package/dist/styles/light.js +9 -5
- package/dist/styles/theme.js +7 -4
- package/dist/styles/theme.types.d.ts +2 -1
- package/dist/styles/theme.types.d.ts.map +1 -1
- package/dist/styles/theme.types.js +2 -1
- package/dist/tabs-B0g7YtQv.js +123 -0
- package/dist/tabs-B0g7YtQv.js.map +1 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -0
- package/dist/{context-BFXNJVn2.js → use-translations-DSltA7H_.js} +38 -30
- package/dist/use-translations-DSltA7H_.js.map +1 -0
- package/package.json +101 -88
- package/dist/ai/SKILL.md +0 -266
- package/dist/ai/docs/Alert.md +0 -167
- package/dist/ai/docs/AnimatedList.md +0 -205
- package/dist/ai/docs/Autocomplete.md +0 -225
- package/dist/ai/docs/Button.md +0 -182
- package/dist/ai/docs/Calendar.md +0 -219
- package/dist/ai/docs/Card.md +0 -174
- package/dist/ai/docs/Checkbox.md +0 -199
- package/dist/ai/docs/CommandPalette.md +0 -293
- package/dist/ai/docs/DatePicker.md +0 -171
- package/dist/ai/docs/Dropdown.md +0 -223
- package/dist/ai/docs/FileUpload.md +0 -225
- package/dist/ai/docs/Input.md +0 -237
- package/dist/ai/docs/InputField.md +0 -170
- package/dist/ai/docs/List.md +0 -205
- package/dist/ai/docs/Menu.md +0 -166
- package/dist/ai/docs/Modal.md +0 -280
- package/dist/ai/docs/MultiSelect.md +0 -196
- package/dist/ai/docs/Notifications.md +0 -231
- package/dist/ai/docs/PageCalendar.md +0 -271
- package/dist/ai/docs/Select.md +0 -284
- package/dist/ai/docs/Step.md +0 -159
- package/dist/ai/docs/Table.md +0 -298
- package/dist/ai/docs/Tabs.md +0 -191
- package/dist/ai/docs/Tag.md +0 -224
- package/dist/ai/docs/Textarea.md +0 -167
- package/dist/ai/docs/Timeline.md +0 -210
- package/dist/ai/docs/Tooltip.md +0 -231
- package/dist/ai/docs/TransferList.md +0 -142
- package/dist/ai/docs/Typography.md +0 -187
- package/dist/ai/docs/Wizard.md +0 -213
- package/dist/ai/docs/index.md +0 -183
- package/dist/autocomplete-Cn9Z2hLq.js +0 -375
- package/dist/autocomplete-Cn9Z2hLq.js.map +0 -1
- package/dist/calendar-B5lSd0ID.js.map +0 -1
- package/dist/components/core/button.d.ts +0 -77
- package/dist/components/core/button.d.ts.map +0 -1
- package/dist/components/core/heading.d.ts +0 -3
- package/dist/components/core/heading.d.ts.map +0 -1
- package/dist/components/core/polymorph.d.ts +0 -10
- package/dist/components/core/polymorph.d.ts.map +0 -1
- package/dist/components/core/render-on-view.d.ts +0 -7
- package/dist/components/core/render-on-view.d.ts.map +0 -1
- package/dist/components/core/resizable.d.ts +0 -3
- package/dist/components/core/resizable.d.ts.map +0 -1
- package/dist/components/core/slot.d.ts +0 -16
- package/dist/components/core/slot.d.ts.map +0 -1
- package/dist/components/core/tag.d.ts +0 -35
- package/dist/components/core/tag.d.ts.map +0 -1
- package/dist/components/core/typography.d.ts +0 -24
- package/dist/components/core/typography.d.ts.map +0 -1
- package/dist/components/display/alert.d.ts +0 -28
- package/dist/components/display/alert.d.ts.map +0 -1
- package/dist/components/display/calendar.d.ts +0 -42
- package/dist/components/display/calendar.d.ts.map +0 -1
- package/dist/components/display/card.d.ts +0 -29
- package/dist/components/display/card.d.ts.map +0 -1
- package/dist/components/display/empty.d.ts +0 -8
- package/dist/components/display/empty.d.ts.map +0 -1
- package/dist/components/display/list.d.ts +0 -16
- package/dist/components/display/list.d.ts.map +0 -1
- package/dist/components/display/notifications.d.ts +0 -27
- package/dist/components/display/notifications.d.ts.map +0 -1
- package/dist/components/display/progress.d.ts +0 -13
- package/dist/components/display/progress.d.ts.map +0 -1
- package/dist/components/display/shortcut.d.ts +0 -4
- package/dist/components/display/shortcut.d.ts.map +0 -1
- package/dist/components/display/skeleton.d.ts +0 -12
- package/dist/components/display/skeleton.d.ts.map +0 -1
- package/dist/components/display/spinner.d.ts +0 -5
- package/dist/components/display/spinner.d.ts.map +0 -1
- package/dist/components/display/stats.d.ts +0 -12
- package/dist/components/display/stats.d.ts.map +0 -1
- package/dist/components/display/step.d.ts +0 -24
- package/dist/components/display/step.d.ts.map +0 -1
- package/dist/components/display/tabs.d.ts +0 -24
- package/dist/components/display/tabs.d.ts.map +0 -1
- package/dist/components/display/timeline.d.ts +0 -10
- package/dist/components/display/timeline.d.ts.map +0 -1
- package/dist/components/floating/command-palette.d.ts +0 -49
- package/dist/components/floating/command-palette.d.ts.map +0 -1
- package/dist/components/floating/dropdown.d.ts +0 -15
- package/dist/components/floating/dropdown.d.ts.map +0 -1
- package/dist/components/floating/expand.d.ts +0 -11
- package/dist/components/floating/expand.d.ts.map +0 -1
- package/dist/components/floating/menu.d.ts +0 -52
- package/dist/components/floating/menu.d.ts.map +0 -1
- package/dist/components/floating/modal.d.ts +0 -60
- package/dist/components/floating/modal.d.ts.map +0 -1
- package/dist/components/floating/toolbar.d.ts +0 -6
- package/dist/components/floating/toolbar.d.ts.map +0 -1
- package/dist/components/floating/tooltip.d.ts +0 -17
- package/dist/components/floating/tooltip.d.ts.map +0 -1
- package/dist/components/floating/wizard.d.ts +0 -26
- package/dist/components/floating/wizard.d.ts.map +0 -1
- package/dist/components/form/autocomplete.d.ts +0 -16
- package/dist/components/form/autocomplete.d.ts.map +0 -1
- package/dist/components/form/checkbox.d.ts +0 -12
- package/dist/components/form/checkbox.d.ts.map +0 -1
- package/dist/components/form/date-picker.d.ts +0 -10
- package/dist/components/form/date-picker.d.ts.map +0 -1
- package/dist/components/form/file-upload.d.ts +0 -15
- package/dist/components/form/file-upload.d.ts.map +0 -1
- package/dist/components/form/form.d.ts +0 -3
- package/dist/components/form/form.d.ts.map +0 -1
- package/dist/components/form/formReset.d.ts +0 -2
- package/dist/components/form/formReset.d.ts.map +0 -1
- package/dist/components/form/free-text.d.ts +0 -11
- package/dist/components/form/free-text.d.ts.map +0 -1
- package/dist/components/form/input-field.d.ts +0 -34
- package/dist/components/form/input-field.d.ts.map +0 -1
- package/dist/components/form/input.d.ts +0 -52
- package/dist/components/form/input.d.ts.map +0 -1
- package/dist/components/form/multi-select.d.ts +0 -19
- package/dist/components/form/multi-select.d.ts.map +0 -1
- package/dist/components/form/radiobox.d.ts +0 -7
- package/dist/components/form/radiobox.d.ts.map +0 -1
- package/dist/components/form/select.d.ts +0 -13
- package/dist/components/form/select.d.ts.map +0 -1
- package/dist/components/form/slider.d.ts +0 -7
- package/dist/components/form/slider.d.ts.map +0 -1
- package/dist/components/form/switch.d.ts +0 -9
- package/dist/components/form/switch.d.ts.map +0 -1
- package/dist/components/form/task-list.d.ts +0 -3
- package/dist/components/form/task-list.d.ts.map +0 -1
- package/dist/components/form/textarea.d.ts +0 -6
- package/dist/components/form/textarea.d.ts.map +0 -1
- package/dist/components/form/transfer-list.d.ts +0 -14
- package/dist/components/form/transfer-list.d.ts.map +0 -1
- package/dist/components/form/transfer-list.js +0 -55
- package/dist/components/form/transfer-list.js.map +0 -1
- package/dist/components/index.d.ts +0 -46
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/page-calendar/calendar-header.d.ts +0 -16
- package/dist/components/page-calendar/calendar-header.d.ts.map +0 -1
- package/dist/components/page-calendar/day-view.d.ts +0 -12
- package/dist/components/page-calendar/day-view.d.ts.map +0 -1
- package/dist/components/page-calendar/event-pill.d.ts +0 -9
- package/dist/components/page-calendar/event-pill.d.ts.map +0 -1
- package/dist/components/page-calendar/index.d.ts +0 -4
- package/dist/components/page-calendar/index.d.ts.map +0 -1
- package/dist/components/page-calendar/month-view.d.ts +0 -11
- package/dist/components/page-calendar/month-view.d.ts.map +0 -1
- package/dist/components/page-calendar/page-calendar.d.ts +0 -18
- package/dist/components/page-calendar/page-calendar.d.ts.map +0 -1
- package/dist/components/page-calendar/page-calendar.types.d.ts +0 -18
- package/dist/components/page-calendar/page-calendar.types.d.ts.map +0 -1
- package/dist/components/page-calendar/page-calendar.utils.d.ts +0 -24
- package/dist/components/page-calendar/page-calendar.utils.d.ts.map +0 -1
- package/dist/components/page-calendar/week-view.d.ts +0 -11
- package/dist/components/page-calendar/week-view.d.ts.map +0 -1
- package/dist/components/table/filter.d.ts +0 -42
- package/dist/components/table/filter.d.ts.map +0 -1
- package/dist/components/table/group.d.ts +0 -17
- package/dist/components/table/group.d.ts.map +0 -1
- package/dist/components/table/index.d.ts +0 -20
- package/dist/components/table/index.d.ts.map +0 -1
- package/dist/components/table/inner-table.d.ts +0 -29
- package/dist/components/table/inner-table.d.ts.map +0 -1
- package/dist/components/table/metadata.d.ts +0 -4
- package/dist/components/table/metadata.d.ts.map +0 -1
- package/dist/components/table/pagination.d.ts +0 -3
- package/dist/components/table/pagination.d.ts.map +0 -1
- package/dist/components/table/row.d.ts +0 -12
- package/dist/components/table/row.d.ts.map +0 -1
- package/dist/components/table/sort.d.ts +0 -28
- package/dist/components/table/sort.d.ts.map +0 -1
- package/dist/components/table/table-lib.d.ts +0 -135
- package/dist/components/table/table-lib.d.ts.map +0 -1
- package/dist/components/table/table.context.d.ts +0 -10
- package/dist/components/table/table.context.d.ts.map +0 -1
- package/dist/components/table/thead.d.ts +0 -9
- package/dist/components/table/thead.d.ts.map +0 -1
- package/dist/config/context.d.ts +0 -21
- package/dist/config/context.d.ts.map +0 -1
- package/dist/config/default-translations.d.ts +0 -90
- package/dist/config/default-translations.d.ts.map +0 -1
- package/dist/config/default-tweaks.d.ts +0 -13
- package/dist/config/default-tweaks.d.ts.map +0 -1
- package/dist/constants.d.ts +0 -3
- package/dist/constants.d.ts.map +0 -1
- package/dist/context-BFXNJVn2.js.map +0 -1
- package/dist/date-picker-DwNo22lx.js.map +0 -1
- package/dist/dom-Dl8XH0CK.js.map +0 -1
- package/dist/file-upload-Brf2NkLr.js.map +0 -1
- package/dist/floating-ui.react-QNHG9W4N.js.map +0 -1
- package/dist/fns-D2eyJKd5.js.map +0 -1
- package/dist/hooks/use-click-outside.d.ts +0 -3
- package/dist/hooks/use-click-outside.d.ts.map +0 -1
- package/dist/hooks/use-color-parser.d.ts +0 -2
- package/dist/hooks/use-color-parser.d.ts.map +0 -1
- package/dist/hooks/use-components-provider.d.ts +0 -15
- package/dist/hooks/use-components-provider.d.ts.map +0 -1
- package/dist/hooks/use-debounce.d.ts +0 -5
- package/dist/hooks/use-debounce.d.ts.map +0 -1
- package/dist/hooks/use-floating-ref.d.ts +0 -2
- package/dist/hooks/use-floating-ref.d.ts.map +0 -1
- package/dist/hooks/use-form.d.ts +0 -394
- package/dist/hooks/use-form.d.ts.map +0 -1
- package/dist/hooks/use-hover.d.ts +0 -3
- package/dist/hooks/use-hover.d.ts.map +0 -1
- package/dist/hooks/use-input-id.d.ts +0 -4
- package/dist/hooks/use-input-id.d.ts.map +0 -1
- package/dist/hooks/use-is-coarse-device.d.ts +0 -2
- package/dist/hooks/use-is-coarse-device.d.ts.map +0 -1
- package/dist/hooks/use-locale.d.ts +0 -3
- package/dist/hooks/use-locale.d.ts.map +0 -1
- package/dist/hooks/use-media-query.d.ts +0 -2
- package/dist/hooks/use-media-query.d.ts.map +0 -1
- package/dist/hooks/use-on-event.d.ts +0 -4
- package/dist/hooks/use-on-event.d.ts.map +0 -1
- package/dist/hooks/use-parent.d.ts +0 -3
- package/dist/hooks/use-parent.d.ts.map +0 -1
- package/dist/hooks/use-preferences.d.ts +0 -2
- package/dist/hooks/use-preferences.d.ts.map +0 -1
- package/dist/hooks/use-previous.d.ts +0 -2
- package/dist/hooks/use-previous.d.ts.map +0 -1
- package/dist/hooks/use-reactive.d.ts +0 -2
- package/dist/hooks/use-reactive.d.ts.map +0 -1
- package/dist/hooks/use-remove-scroll.d.ts +0 -4
- package/dist/hooks/use-remove-scroll.d.ts.map +0 -1
- package/dist/hooks/use-resize-observer.d.ts +0 -2
- package/dist/hooks/use-resize-observer.d.ts.map +0 -1
- package/dist/hooks/use-stable-ref.d.ts +0 -2
- package/dist/hooks/use-stable-ref.d.ts.map +0 -1
- package/dist/hooks/use-swipe.d.ts +0 -8
- package/dist/hooks/use-swipe.d.ts.map +0 -1
- package/dist/hooks/use-translations.d.ts +0 -88
- package/dist/hooks/use-translations.d.ts.map +0 -1
- package/dist/hooks/use-tweaks.d.ts +0 -3
- package/dist/hooks/use-tweaks.d.ts.map +0 -1
- package/dist/hooks/use-window-size.d.ts +0 -5
- package/dist/hooks/use-window-size.d.ts.map +0 -1
- package/dist/index-BelDtX5M.js.map +0 -1
- package/dist/index-DJSMaZR4.js.map +0 -1
- package/dist/index-Z-fZHxfJ.js +0 -335
- package/dist/index-Z-fZHxfJ.js.map +0 -1
- package/dist/index.d.ts +0 -22
- package/dist/index.d.ts.map +0 -1
- package/dist/input-CrGrSnUt.js.map +0 -1
- package/dist/input-field-5vYcz5tT.js.map +0 -1
- package/dist/lib/combi-keys.d.ts +0 -15
- package/dist/lib/combi-keys.d.ts.map +0 -1
- package/dist/lib/dict.d.ts +0 -12
- package/dist/lib/dict.d.ts.map +0 -1
- package/dist/lib/dom.d.ts +0 -19
- package/dist/lib/dom.d.ts.map +0 -1
- package/dist/lib/fns.d.ts +0 -11
- package/dist/lib/fns.d.ts.map +0 -1
- package/dist/lib/fzf.d.ts +0 -16
- package/dist/lib/fzf.d.ts.map +0 -1
- package/dist/lib/keyboard-area.d.ts +0 -16
- package/dist/lib/keyboard-area.d.ts.map +0 -1
- package/dist/notifications-cUdVPs-B.js +0 -2786
- package/dist/notifications-cUdVPs-B.js.map +0 -1
- package/dist/skeleton-D75GFBV6.js +0 -10
- package/dist/skeleton-D75GFBV6.js.map +0 -1
- package/dist/tabs-S00a8qq8.js +0 -106
- package/dist/tabs-S00a8qq8.js.map +0 -1
- package/dist/types.d.ts +0 -26
- package/dist/types.d.ts.map +0 -1
- package/dist/use-translations-BwLKTrZv.js +0 -10
- package/dist/use-translations-BwLKTrZv.js.map +0 -1
package/ai/docs/Step.md
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Step
|
|
3
|
+
description: Animated multi-step progress indicator with status tracking for checkout flows, onboarding, and wizards.
|
|
4
|
+
package: "@g4rcez/components"
|
|
5
|
+
export: "{ Step }"
|
|
6
|
+
import: "import { Steps, Step } from '@g4rcez/components'"
|
|
7
|
+
category: display
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Step
|
|
11
|
+
|
|
12
|
+
Animated multi-step progress indicator with status tracking for checkout flows, onboarding, and wizards.
|
|
13
|
+
|
|
14
|
+
## Import
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import { Steps, Step } from "@g4rcez/components";
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Props
|
|
21
|
+
|
|
22
|
+
### Steps (Container)
|
|
23
|
+
|
|
24
|
+
| Prop | Type | Default | Description |
|
|
25
|
+
| ------------- | ----------------- | ------- | ---------------------------------- |
|
|
26
|
+
| `currentStep` | `number` | — | Index of the currently active step |
|
|
27
|
+
| `steps` | `number` | — | Total number of steps |
|
|
28
|
+
| `children` | `React.ReactNode` | — | `Step` components |
|
|
29
|
+
|
|
30
|
+
### Step
|
|
31
|
+
|
|
32
|
+
| Prop | Type | Default | Description |
|
|
33
|
+
| ---------------- | ------------ | ------- | ----------------------------------------------------------------------------- |
|
|
34
|
+
| `step` | `number` | — | Index of this step |
|
|
35
|
+
| `currentStep` | `number` | — | Index of the currently active step (usually from parent) |
|
|
36
|
+
| `title` | `Label` | — | Step label |
|
|
37
|
+
| `status` | `StepStatus` | — | Override automatic status (`"active" \| "inactive" \| "complete" \| "error"`) |
|
|
38
|
+
| `titleClassName` | `string` | — | Additional classes for the title text |
|
|
39
|
+
|
|
40
|
+
Standard `<button>` props are also forwarded (e.g. `onClick`, `disabled`).
|
|
41
|
+
|
|
42
|
+
## Step Statuses
|
|
43
|
+
|
|
44
|
+
| Status | Visual | Icon |
|
|
45
|
+
| ---------- | ------------------ | ------------------- |
|
|
46
|
+
| `active` | Primary color ring | Step number |
|
|
47
|
+
| `inactive` | Muted border | Step number |
|
|
48
|
+
| `complete` | Success color fill | Animated check mark |
|
|
49
|
+
| `error` | Danger color fill | Animated X mark |
|
|
50
|
+
|
|
51
|
+
Status is derived automatically from `step` vs. `currentStep` unless overridden via `status`.
|
|
52
|
+
|
|
53
|
+
## Design Tokens
|
|
54
|
+
|
|
55
|
+
Tokens this component reads. Customize by overriding these CSS variables in your theme.
|
|
56
|
+
|
|
57
|
+
| Token | CSS Variable | Purpose |
|
|
58
|
+
| --------------------------------------- | ------------------------------------- | ---------------------------------- |
|
|
59
|
+
| `bg-primary` / `border-primary` | `--primary-DEFAULT` | Active step fill and border |
|
|
60
|
+
| `text-primary-foreground` | `--primary-foreground` | Active step text |
|
|
61
|
+
| `bg-success` / `border-success` | `--success-DEFAULT` | Complete step fill and border |
|
|
62
|
+
| `text-success-foreground` | `--success-foreground` | Complete step check icon |
|
|
63
|
+
| `bg-danger` / `border-danger` | `--danger-DEFAULT` / `--danger-hover` | Error step fill and border |
|
|
64
|
+
| `text-danger-foreground` | `--danger-foreground` | Error step X icon |
|
|
65
|
+
| `text-disabled` | `--disabled` | Inactive step text |
|
|
66
|
+
| `bg-card-border` / `border-card-border` | `--card-border` | Connector line and inactive border |
|
|
67
|
+
| `bg-background` | `--background` | Inactive step background |
|
|
68
|
+
|
|
69
|
+
## Examples
|
|
70
|
+
|
|
71
|
+
### Basic Steps
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
<Steps currentStep={2} steps={3}>
|
|
75
|
+
<Step step={1} currentStep={2} title="Account" />
|
|
76
|
+
<Step step={2} currentStep={2} title="Profile" />
|
|
77
|
+
<Step step={3} currentStep={2} title="Review" />
|
|
78
|
+
</Steps>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Interactive Wizard
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
function Wizard() {
|
|
85
|
+
const [currentStep, setCurrentStep] = useState(1);
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<div className="space-y-8">
|
|
89
|
+
<Steps currentStep={currentStep} steps={4}>
|
|
90
|
+
<Step step={1} currentStep={currentStep} title="Account" onClick={() => setCurrentStep(1)} />
|
|
91
|
+
<Step step={2} currentStep={currentStep} title="Profile" onClick={() => setCurrentStep(2)} />
|
|
92
|
+
<Step step={3} currentStep={currentStep} title="Payment" onClick={() => setCurrentStep(3)} />
|
|
93
|
+
<Step step={4} currentStep={currentStep} title="Review" onClick={() => setCurrentStep(4)} />
|
|
94
|
+
</Steps>
|
|
95
|
+
|
|
96
|
+
<div className="p-6 rounded-card border border-card-border bg-card-background">
|
|
97
|
+
{currentStep === 1 && <AccountForm />}
|
|
98
|
+
{currentStep === 2 && <ProfileForm />}
|
|
99
|
+
{currentStep === 3 && <PaymentForm />}
|
|
100
|
+
{currentStep === 4 && <ReviewSummary />}
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### With Error State
|
|
108
|
+
|
|
109
|
+
```tsx
|
|
110
|
+
<Steps currentStep={2} steps={3}>
|
|
111
|
+
<Step step={1} currentStep={2} title="Identity" />
|
|
112
|
+
<Step step={2} currentStep={2} title="Payment" status="error" />
|
|
113
|
+
<Step step={3} currentStep={2} title="Finish" />
|
|
114
|
+
</Steps>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Checkout Flow
|
|
118
|
+
|
|
119
|
+
```tsx
|
|
120
|
+
function CheckoutSteps({ step }: { step: number }) {
|
|
121
|
+
return (
|
|
122
|
+
<Steps currentStep={step} steps={3}>
|
|
123
|
+
<Step step={1} currentStep={step} title="Cart" />
|
|
124
|
+
<Step step={2} currentStep={step} title="Shipping" />
|
|
125
|
+
<Step step={3} currentStep={step} title="Confirmation" />
|
|
126
|
+
</Steps>
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Do
|
|
132
|
+
|
|
133
|
+
- Provide clear, concise `title` labels for each step.
|
|
134
|
+
- Keep the total number of steps manageable (3–5 is ideal).
|
|
135
|
+
- Use `status="error"` to clearly indicate where a user needs to return and fix a problem.
|
|
136
|
+
- Use `onClick` on `Step` to enable backward navigation in wizards.
|
|
137
|
+
|
|
138
|
+
## Don't
|
|
139
|
+
|
|
140
|
+
- Don't pass raw Tailwind color classes for step styling — the component derives colors from CSS variables.
|
|
141
|
+
- Don't use arbitrary Tailwind values (`bg-[#abc]`) — override CSS variables in your `@theme` block.
|
|
142
|
+
- Don't hide critical information in steps the user hasn't yet seen.
|
|
143
|
+
- Don't use `Step` for non-linear navigation without a clear sequential intent.
|
|
144
|
+
|
|
145
|
+
## Accessibility
|
|
146
|
+
|
|
147
|
+
- Each `Step` renders as a `<button>` element, making it focusable and keyboard-operable.
|
|
148
|
+
- Icons use `aria-hidden` to prevent redundant screen reader announcements.
|
|
149
|
+
- The `Steps` container provides a logical visual grouping for the process.
|
|
150
|
+
|
|
151
|
+
## Data Attributes
|
|
152
|
+
|
|
153
|
+
- `data-step` — the step index number, applied to each step's `<button>`.
|
|
154
|
+
|
|
155
|
+
## Notes
|
|
156
|
+
|
|
157
|
+
- Connector lines between steps are shown only on `xl` breakpoints (hidden on smaller screens where steps stack vertically).
|
|
158
|
+
- Animations use Framer Motion (`motion/react`): the step circle animates between status colors, and the check/X icons draw in with `pathLength`.
|
|
159
|
+
- The `Steps` component tracks `previousStep` internally to orchestrate staggered transition delays when jumping multiple steps at once.
|
|
@@ -21,27 +21,27 @@ import { Switch } from "@g4rcez/components/switch";
|
|
|
21
21
|
|
|
22
22
|
Inherits all standard HTML `input[type="checkbox"]` attributes, plus:
|
|
23
23
|
|
|
24
|
-
| Prop
|
|
25
|
-
|
|
26
|
-
| `children`
|
|
27
|
-
| `onCheck`
|
|
28
|
-
| `error`
|
|
29
|
-
| `loading`
|
|
30
|
-
| `container` | `string`
|
|
24
|
+
| Prop | Type | Default | Description |
|
|
25
|
+
| ----------- | ------------------------------ | ------- | ---------------------------------------------------- |
|
|
26
|
+
| `children` | `React.ReactNode` | — | Label text or element displayed next to the switch. |
|
|
27
|
+
| `onCheck` | `(nextValue: boolean) => void` | — | Called with the new boolean value after toggling. |
|
|
28
|
+
| `error` | `string` | — | Error message displayed below the switch. |
|
|
29
|
+
| `loading` | `boolean` | `false` | Disables the switch and signals a pending operation. |
|
|
30
|
+
| `container` | `string` | — | Additional CSS classes for the outer `<fieldset>`. |
|
|
31
31
|
|
|
32
32
|
## Design Tokens
|
|
33
33
|
|
|
34
34
|
Tokens this component reads. Customize by overriding these CSS variables in your theme.
|
|
35
35
|
|
|
36
|
-
| Token
|
|
37
|
-
|
|
36
|
+
| Token | CSS Variable | Purpose |
|
|
37
|
+
| -------------------- | ------------------- | ------------------------------- |
|
|
38
38
|
| `bg-input-switch-bg` | `--input-switch-bg` | Track background when unchecked |
|
|
39
|
-
| `bg-primary`
|
|
40
|
-
| `bg-disabled`
|
|
41
|
-
| `bg-input-switch`
|
|
42
|
-
| `focus:ring-primary` | `--primary`
|
|
43
|
-
| `text-danger`
|
|
44
|
-
| `text-foreground`
|
|
39
|
+
| `bg-primary` | `--primary` | Track background when checked |
|
|
40
|
+
| `bg-disabled` | `--disabled` | Thumb fill when unchecked |
|
|
41
|
+
| `bg-input-switch` | `--input-switch` | Thumb fill when checked |
|
|
42
|
+
| `focus:ring-primary` | `--primary` | Focus ring on the toggle button |
|
|
43
|
+
| `text-danger` | `--danger` | Error message color |
|
|
44
|
+
| `text-foreground` | `--foreground` | Label text color |
|
|
45
45
|
|
|
46
46
|
## Themes
|
|
47
47
|
|
|
@@ -55,11 +55,11 @@ The switch appearance is driven entirely by design tokens. Override them in your
|
|
|
55
55
|
import { Switch } from "@g4rcez/components/switch";
|
|
56
56
|
|
|
57
57
|
export default function NotificationsToggle() {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
return (
|
|
59
|
+
<Switch defaultChecked onChange={(e) => console.log(e.target.checked)}>
|
|
60
|
+
Enable notifications
|
|
61
|
+
</Switch>
|
|
62
|
+
);
|
|
63
63
|
}
|
|
64
64
|
```
|
|
65
65
|
|
|
@@ -70,13 +70,13 @@ import { useState } from "react";
|
|
|
70
70
|
import { Switch } from "@g4rcez/components/switch";
|
|
71
71
|
|
|
72
72
|
export default function DarkModeToggle() {
|
|
73
|
-
|
|
73
|
+
const [enabled, setEnabled] = useState(false);
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
75
|
+
return (
|
|
76
|
+
<Switch checked={enabled} onCheck={setEnabled}>
|
|
77
|
+
Dark mode
|
|
78
|
+
</Switch>
|
|
79
|
+
);
|
|
80
80
|
}
|
|
81
81
|
```
|
|
82
82
|
|
|
@@ -86,11 +86,7 @@ export default function DarkModeToggle() {
|
|
|
86
86
|
import { Switch } from "@g4rcez/components/switch";
|
|
87
87
|
|
|
88
88
|
export default function SyncSwitch() {
|
|
89
|
-
|
|
90
|
-
<Switch loading>
|
|
91
|
-
Syncing data…
|
|
92
|
-
</Switch>
|
|
93
|
-
);
|
|
89
|
+
return <Switch loading>Syncing data…</Switch>;
|
|
94
90
|
}
|
|
95
91
|
```
|
|
96
92
|
|
|
@@ -100,11 +96,7 @@ export default function SyncSwitch() {
|
|
|
100
96
|
import { Switch } from "@g4rcez/components/switch";
|
|
101
97
|
|
|
102
98
|
export default function TermsSwitch() {
|
|
103
|
-
|
|
104
|
-
<Switch error="You must accept the terms to continue">
|
|
105
|
-
Accept terms and conditions
|
|
106
|
-
</Switch>
|
|
107
|
-
);
|
|
99
|
+
return <Switch error="You must accept the terms to continue">Accept terms and conditions</Switch>;
|
|
108
100
|
}
|
|
109
101
|
```
|
|
110
102
|
|
|
@@ -114,19 +106,17 @@ export default function TermsSwitch() {
|
|
|
114
106
|
import { Switch } from "@g4rcez/components/switch";
|
|
115
107
|
|
|
116
108
|
export default function PrivacySettings() {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
</div>
|
|
129
|
-
);
|
|
109
|
+
return (
|
|
110
|
+
<div className="flex flex-col gap-base">
|
|
111
|
+
<Switch defaultChecked onCheck={(v) => updateSetting("emails", v)}>
|
|
112
|
+
Receive marketing emails
|
|
113
|
+
</Switch>
|
|
114
|
+
<Switch onCheck={(v) => updateSetting("analytics", v)}>Share analytics data</Switch>
|
|
115
|
+
<Switch defaultChecked onCheck={(v) => updateSetting("notifications", v)}>
|
|
116
|
+
Push notifications
|
|
117
|
+
</Switch>
|
|
118
|
+
</div>
|
|
119
|
+
);
|
|
130
120
|
}
|
|
131
121
|
```
|
|
132
122
|
|
|
@@ -154,11 +144,11 @@ export default function PrivacySettings() {
|
|
|
154
144
|
|
|
155
145
|
## Data Attributes
|
|
156
146
|
|
|
157
|
-
| Attribute
|
|
158
|
-
|
|
159
|
-
| `data-component` | `fieldset`
|
|
160
|
-
| `data-checked`
|
|
161
|
-
| `data-trigger`
|
|
147
|
+
| Attribute | Element | Value | Description |
|
|
148
|
+
| ---------------- | ------------------------------- | ------------------- | ---------------------------------------------------- |
|
|
149
|
+
| `data-component` | `fieldset` | `"switch"` | Identifies the component. |
|
|
150
|
+
| `data-checked` | `input`, `button`, thumb `span` | `"true" \| "false"` | Reflects the checked state for CSS targeting. |
|
|
151
|
+
| `data-trigger` | `input` | `"change"` | Used internally to track the synthetic change event. |
|
|
162
152
|
|
|
163
153
|
## Notes
|
|
164
154
|
|
package/ai/docs/Table.md
ADDED
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Table
|
|
3
|
+
description: Virtualized, sortable, filterable data table with column reordering, grouping, and pagination.
|
|
4
|
+
package: "@g4rcez/components"
|
|
5
|
+
export: "{ Table, createColumns, useTablePreferences, ColType }"
|
|
6
|
+
import: "import { Table, createColumns, useTablePreferences, ColType } from '@g4rcez/components/table'"
|
|
7
|
+
category: table
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Table
|
|
11
|
+
|
|
12
|
+
Virtualized, sortable, filterable data table with column reordering, grouping, and pagination.
|
|
13
|
+
|
|
14
|
+
## Import
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import { Table, createColumns, useTablePreferences, ColType } from "@g4rcez/components/table";
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Props
|
|
21
|
+
|
|
22
|
+
### Table
|
|
23
|
+
|
|
24
|
+
| Prop | Type | Default | Description |
|
|
25
|
+
| -------------- | ---------------------------------- | ------- | -------------------------------------------------------------------------------- |
|
|
26
|
+
| `name` | `string` | — | Unique identifier used to persist user preferences in `localStorage`. |
|
|
27
|
+
| `cols` | `Col<T>[]` | — | Column definitions produced by `createColumns`. |
|
|
28
|
+
| `rows` | `T[]` | — | Data array to render. Each element maps to a table row. |
|
|
29
|
+
| `loading` | `boolean` | `false` | Replaces rows with animated skeleton cells while data loads. |
|
|
30
|
+
| `loadingMore` | `boolean` | `false` | Shows a pulse footer bar for infinite-scroll loading indicators. |
|
|
31
|
+
| `operations` | `boolean` | `true` | Toggles the metadata bar (bulk filter, sort, group controls). |
|
|
32
|
+
| `inlineFilter` | `boolean` | `true` | Enables per-column filter dropdowns in the header row. |
|
|
33
|
+
| `inlineSorter` | `boolean` | `true` | Enables per-column sort toggles in the header row. |
|
|
34
|
+
| `sticky` | `number \| null` | — | `top` offset in px for the sticky header. Pass `null` to disable stickiness. |
|
|
35
|
+
| `Aside` | `React.FC<CellAsideElement<T>>` | — | Component rendered before the first cell in every row (e.g., row-level actions). |
|
|
36
|
+
| `pagination` | `TablePagination` | — | Pagination configuration. When provided, a footer with page controls is shown. |
|
|
37
|
+
| `reference` | `keyof T` | — | Field used as the stable row key. |
|
|
38
|
+
| `useControl` | `boolean` | `false` | When `true`, disables internal filtering/sorting so you can drive it externally. |
|
|
39
|
+
| `onScrollEnd` | `() => void` | — | Called when the user scrolls to the last row (infinite scroll trigger). |
|
|
40
|
+
| `getScrollRef` | `() => HTMLElement \| undefined` | — | Returns a custom scroll container instead of `window`. |
|
|
41
|
+
| `getRowProps` | `(row: T) => ComponentProps<"tr">` | — | Merge arbitrary `<tr>` props (e.g., `onClick`, `className`) per row. |
|
|
42
|
+
| `set` | `(v: TableGetters<T>) => void` | — | External callback invoked whenever internal table state changes. |
|
|
43
|
+
|
|
44
|
+
### createColumns
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
createColumns<T>((c) => {
|
|
48
|
+
c.add(id, thead, options?)
|
|
49
|
+
c.remove(id)
|
|
50
|
+
c.filter(predicate)
|
|
51
|
+
c.getAll()
|
|
52
|
+
})
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
| Builder method | Signature | Description |
|
|
56
|
+
| -------------- | ------------------------------------------------------------------------- | ----------------------------------------- |
|
|
57
|
+
| `add` | `(id: AllPaths<T>, thead: ReactNode, options?: ColOptions<T, K>) => void` | Registers a column. |
|
|
58
|
+
| `remove` | `(id: AllPaths<T>) => void` | Removes a column by id. |
|
|
59
|
+
| `filter` | `(c: (col: Col<T>) => boolean) => Col<T>[]` | Filters the column list in-place. |
|
|
60
|
+
| `getAll` | `() => Col<T>[]` | Returns a copy of all registered columns. |
|
|
61
|
+
|
|
62
|
+
### ColOptions
|
|
63
|
+
|
|
64
|
+
| Option | Type | Default | Description |
|
|
65
|
+
| ------------- | -------------------------------------- | -------------- | ---------------------------------------------------------------------------- |
|
|
66
|
+
| `type` | `ColType` | `ColType.Text` | Data type (`Text`, `Number`, `Boolean`, `Select`). Affects filter operators. |
|
|
67
|
+
| `allowSort` | `boolean` | `true` | Whether this column can be sorted. |
|
|
68
|
+
| `allowFilter` | `boolean` | `true` | Whether this column shows a filter control. |
|
|
69
|
+
| `headerLabel` | `string` | — | Overrides the column header text used in the filter/sort metadata bar. |
|
|
70
|
+
| `Element` | `React.FC<CellPropsElement<T, K>>` | — | Custom cell renderer. Receives `{ row, value, rowIndex, matrix, col }`. |
|
|
71
|
+
| `thProps` | `HTMLAttributes<HTMLTableCellElement>` | — | Extra props forwarded to the `<th>` element. |
|
|
72
|
+
| `cellProps` | `HTMLAttributes<HTMLTableCellElement>` | — | Extra props forwarded to each `<td>` element. |
|
|
73
|
+
|
|
74
|
+
### TablePagination
|
|
75
|
+
|
|
76
|
+
| Field | Type | Description |
|
|
77
|
+
| -------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------- |
|
|
78
|
+
| `size` | `number` | Current page size. |
|
|
79
|
+
| `pages` | `number` | Total number of pages. |
|
|
80
|
+
| `current` | `number` | Current page index (1-based). |
|
|
81
|
+
| `hasNext` | `boolean` | Whether a next page exists. |
|
|
82
|
+
| `hasPrevious` | `boolean` | Whether a previous page exists. |
|
|
83
|
+
| `totalItems` | `number` | Total row count across all pages. |
|
|
84
|
+
| `sizes` | `number[]` | Optional list of selectable page sizes. |
|
|
85
|
+
| `onChangeSize` | `(size: number) => void` | Called when the user selects a different page size. |
|
|
86
|
+
| `asLink` | `React.FC<{ href: number \| "previous" \| "next"; className: string }>` | Polymorphic page button — supply a router `Link` for deep-linkable pages. |
|
|
87
|
+
|
|
88
|
+
### useTablePreferences
|
|
89
|
+
|
|
90
|
+
Persists column order, active filters, sorters, and groups in `localStorage` keyed by `name`.
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
const prefs = useTablePreferences("users-table", columns, options?);
|
|
94
|
+
// Spread into <Table {...prefs} rows={data} />
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
| Parameter | Type | Description |
|
|
98
|
+
| --------- | -------------------------- | -------------------------------------------------------------------------- |
|
|
99
|
+
| `name` | `string` | Storage key (`@components/table-{name}`). |
|
|
100
|
+
| `cols` | `Col<T>[]` | Initial column definitions. |
|
|
101
|
+
| `options` | `Partial<TableGetters<T>>` | Optional initial state overrides for filters, sorters, groups, pagination. |
|
|
102
|
+
|
|
103
|
+
## Design Tokens
|
|
104
|
+
|
|
105
|
+
Tokens this component reads. Customize by overriding these CSS variables in your theme.
|
|
106
|
+
|
|
107
|
+
| Token | CSS Variable | Purpose |
|
|
108
|
+
| --------------------- | -------------------- | --------------------------------------- |
|
|
109
|
+
| `bg-table-header` | `--table-header` | Column header background |
|
|
110
|
+
| `bg-table-background` | `--table-background` | Table body background |
|
|
111
|
+
| `border-table-border` | `--table-border` | Column separator and row divider color |
|
|
112
|
+
| `shadow-shadow-table` | `--shadow-table` | Table card shadow |
|
|
113
|
+
| `bg-card-background` | `--card-background` | Footer and loading-more bar background |
|
|
114
|
+
| `text-foreground` | `--foreground` | Default cell text color |
|
|
115
|
+
| `text-primary` | `--primary` | Active filter / sort accent color |
|
|
116
|
+
| `bg-muted` | `--muted` | Hover background for metadata bar items |
|
|
117
|
+
|
|
118
|
+
The `--table-cell-padding` CSS variable controls cell padding (default `0.75rem`). Override it via `className` on `<Table>`.
|
|
119
|
+
|
|
120
|
+
## Column Types
|
|
121
|
+
|
|
122
|
+
| `ColType` | Enum value | Filter operators available |
|
|
123
|
+
| ----------------- | ----------- | ---------------------------------------- |
|
|
124
|
+
| `ColType.Text` | `"text"` | contains, equals, starts with, ends with |
|
|
125
|
+
| `ColType.Number` | `"number"` | =, ≠, >, <, ≥, ≤ |
|
|
126
|
+
| `ColType.Boolean` | `"boolean"` | is true, is false |
|
|
127
|
+
| `ColType.Select` | `"select"` | equals |
|
|
128
|
+
|
|
129
|
+
## Examples
|
|
130
|
+
|
|
131
|
+
### Basic table
|
|
132
|
+
|
|
133
|
+
```tsx
|
|
134
|
+
import { Table, createColumns } from "@g4rcez/components/table";
|
|
135
|
+
|
|
136
|
+
type User = { id: string; name: string; email: string };
|
|
137
|
+
|
|
138
|
+
const columns = createColumns<User>((c) => {
|
|
139
|
+
c.add("id", "ID");
|
|
140
|
+
c.add("name", "Name");
|
|
141
|
+
c.add("email", "Email");
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
export function UsersTable({ users }: { users: User[] }) {
|
|
145
|
+
return <Table name="users" cols={columns} rows={users} />;
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Custom cell renderer
|
|
150
|
+
|
|
151
|
+
```tsx
|
|
152
|
+
import { Table, createColumns, ColType } from "@g4rcez/components/table";
|
|
153
|
+
import { Tag } from "@g4rcez/components/tag";
|
|
154
|
+
|
|
155
|
+
type Product = { sku: string; name: string; price: number; active: boolean };
|
|
156
|
+
|
|
157
|
+
const columns = createColumns<Product>((c) => {
|
|
158
|
+
c.add("sku", "SKU");
|
|
159
|
+
c.add("name", "Product Name", { allowFilter: true, allowSort: true });
|
|
160
|
+
c.add("price", "Price", {
|
|
161
|
+
type: ColType.Number,
|
|
162
|
+
Element: ({ value }) => (
|
|
163
|
+
<span className="font-mono tabular-nums">{value.toLocaleString("en-US", { style: "currency", currency: "USD" })}</span>
|
|
164
|
+
),
|
|
165
|
+
});
|
|
166
|
+
c.add("active", "Status", {
|
|
167
|
+
type: ColType.Boolean,
|
|
168
|
+
Element: ({ value }) => (
|
|
169
|
+
<Tag theme={value ? "success" : "neutral"} size="small">
|
|
170
|
+
{value ? "Active" : "Inactive"}
|
|
171
|
+
</Tag>
|
|
172
|
+
),
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Persisted preferences
|
|
178
|
+
|
|
179
|
+
```tsx
|
|
180
|
+
import { Table, createColumns, useTablePreferences } from "@g4rcez/components/table";
|
|
181
|
+
|
|
182
|
+
const baseColumns = createColumns<Order>((c) => {
|
|
183
|
+
c.add("id", "Order ID");
|
|
184
|
+
c.add("status", "Status");
|
|
185
|
+
c.add("total", "Total");
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
export function OrdersTable({ orders }: { orders: Order[] }) {
|
|
189
|
+
const prefs = useTablePreferences("orders-table", baseColumns);
|
|
190
|
+
return <Table {...prefs} rows={orders} />;
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Server-side pagination
|
|
195
|
+
|
|
196
|
+
```tsx
|
|
197
|
+
<Table
|
|
198
|
+
name="invoices"
|
|
199
|
+
cols={columns}
|
|
200
|
+
rows={pageData}
|
|
201
|
+
useControl
|
|
202
|
+
pagination={{
|
|
203
|
+
current: page,
|
|
204
|
+
pages: totalPages,
|
|
205
|
+
size: pageSize,
|
|
206
|
+
totalItems: totalCount,
|
|
207
|
+
hasNext: page < totalPages,
|
|
208
|
+
hasPrevious: page > 1,
|
|
209
|
+
sizes: [10, 25, 50],
|
|
210
|
+
onChangeSize: setPageSize,
|
|
211
|
+
asLink: ({ href, className, children }) => (
|
|
212
|
+
<a href={`?page=${href}`} className={className}>
|
|
213
|
+
{children}
|
|
214
|
+
</a>
|
|
215
|
+
),
|
|
216
|
+
}}
|
|
217
|
+
/>
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Row-level actions with Aside
|
|
221
|
+
|
|
222
|
+
```tsx
|
|
223
|
+
import { TrashIcon, PencilIcon } from "@phosphor-icons/react";
|
|
224
|
+
|
|
225
|
+
<Table
|
|
226
|
+
name="contacts"
|
|
227
|
+
cols={columns}
|
|
228
|
+
rows={contacts}
|
|
229
|
+
Aside={({ row }) => (
|
|
230
|
+
<div className="flex gap-1">
|
|
231
|
+
<button onClick={() => edit(row)} aria-label="Edit">
|
|
232
|
+
<PencilIcon size={14} />
|
|
233
|
+
</button>
|
|
234
|
+
<button onClick={() => remove(row)} aria-label="Delete" className="hover:text-danger">
|
|
235
|
+
<TrashIcon size={14} />
|
|
236
|
+
</button>
|
|
237
|
+
</div>
|
|
238
|
+
)}
|
|
239
|
+
/>;
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Infinite scroll
|
|
243
|
+
|
|
244
|
+
```tsx
|
|
245
|
+
<Table name="feed" cols={columns} rows={items} loadingMore={isFetchingNextPage} onScrollEnd={fetchNextPage} />
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
## Do
|
|
249
|
+
|
|
250
|
+
- Provide a unique `name` to ensure each table has its own isolated `localStorage` slot.
|
|
251
|
+
- Use `createColumns` for full TypeScript path inference on deeply nested fields.
|
|
252
|
+
- Supply a custom `Element` for cells that need formatting, interactive controls, or icons.
|
|
253
|
+
- Use `useTablePreferences` when users should be able to persist their column arrangement across sessions.
|
|
254
|
+
- Pass `useControl={true}` and manage data externally when filtering/sorting must happen server-side.
|
|
255
|
+
- Use design-token classes for wrapper elements (`bg-table-header`, `bg-table-background`, `border-table-border`).
|
|
256
|
+
|
|
257
|
+
## Don't
|
|
258
|
+
|
|
259
|
+
- Don't pass raw Tailwind color classes (`bg-blue-500`, `text-white`, `border-gray-300`) — use design tokens instead.
|
|
260
|
+
- Don't use arbitrary Tailwind values (`bg-[#abc]`, `bg-[--my-var]`) — override CSS variables in your `@theme` block instead.
|
|
261
|
+
- Don't render `<Table>` without a `name` — preferences and DOM ids rely on it.
|
|
262
|
+
- Don't put heavy rendering logic directly inside `rows` array transformation; use `Element` cells instead so virtualization can skip off-screen rows.
|
|
263
|
+
- Don't use `Table` for single-row or trivial datasets — a plain list or card layout is more appropriate.
|
|
264
|
+
|
|
265
|
+
## Accessibility
|
|
266
|
+
|
|
267
|
+
- Renders `role="table"`, `role="rowgroup"`, `role="row"`, and `role="columnheader"` for screen-reader semantics.
|
|
268
|
+
- Sort state is exposed via `aria-sort="ascending | descending | none"` on each `<th>`.
|
|
269
|
+
- Column headers are keyboard-accessible drag targets; column resizing also supports `ArrowLeft`/`ArrowRight` keys (hold `Shift` for larger steps; double-click resets to auto width).
|
|
270
|
+
- `aria-busy` on column headers signals loading state to assistive technologies.
|
|
271
|
+
- Empty state renders the `Empty` component with a visible placeholder instead of an empty table body.
|
|
272
|
+
- Virtualization uses `react-virtuoso` with `useWindowScroll` so native keyboard scrolling and focus management continue to work.
|
|
273
|
+
|
|
274
|
+
## Data Attributes
|
|
275
|
+
|
|
276
|
+
- `data-tableheader="{colId}"` — present on every `<th>`, used by the column-resizing logic to update `style.width`.
|
|
277
|
+
- `data-resized="true"` — set on a `<th>` after the user manually resizes that column.
|
|
278
|
+
- `data-type="resizer"` — identifies the drag handle element within each header cell.
|
|
279
|
+
|
|
280
|
+
## Notes
|
|
281
|
+
|
|
282
|
+
- Column reordering uses `motion/react`'s `Reorder.Group` / `Reorder.Item`, so columns animate smoothly to their new positions.
|
|
283
|
+
- Internal filtering uses `linq-arrays`. Numeric filters operate on `Number.isNaN`-safe values; empty string filters are skipped.
|
|
284
|
+
- `useTablePreferences` merges saved columns back against the current definition so new columns added in code always appear, even if a user has a stale snapshot in storage.
|
|
285
|
+
- The `--table-cell-padding` variable can be set per breakpoint by adding it directly to `className`: `className="[--table-cell-padding:0.5rem] @md:[--table-cell-padding:1rem]"`.
|
|
286
|
+
- Pass `getScrollRef={getModalScrollerRef}` (exported from the same subpath) when embedding a `Table` inside a `Modal` to fix virtualization scroll detection.
|