@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
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: FileUpload
|
|
3
|
+
description: Drag-and-drop file upload area with file preview, modal viewer, and per-file deletion.
|
|
4
|
+
package: "@g4rcez/components"
|
|
5
|
+
export: "{ FileUpload }"
|
|
6
|
+
import: "import { FileUpload } from '@g4rcez/components/file-upload'"
|
|
7
|
+
category: form
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# FileUpload
|
|
11
|
+
|
|
12
|
+
Drag-and-drop file upload area with file preview, modal viewer, and per-file deletion.
|
|
13
|
+
|
|
14
|
+
## Import
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import { FileUpload } from "@g4rcez/components/file-upload";
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Props
|
|
21
|
+
|
|
22
|
+
| Prop | Type | Default | Description |
|
|
23
|
+
| ------------------ | ------------------------------------ | --------------- | -------------------------------------------------------------------- |
|
|
24
|
+
| `files` | `File[]` | - | Controlled files array |
|
|
25
|
+
| `onDrop` | `(files: File[]) => void` | - | Called when files are dropped or selected |
|
|
26
|
+
| `onDeleteFile` | `(file: File) => void` | - | Called when the delete button on a file item is clicked |
|
|
27
|
+
| `idle` | `React.ReactElement` | Default idle UI | Content to show when no files are present and the area is not active |
|
|
28
|
+
| `File` | `React.FC<{ file: File }>` | - | Custom component rendered below each file's name/size row |
|
|
29
|
+
| `accept` | `string \| Record<string, string[]>` | - | Accepted file types (forwarded to `react-dropzone`) |
|
|
30
|
+
| `multiple` | `boolean` | `false` | Allow selecting more than one file |
|
|
31
|
+
| `maxFiles` | `number` | - | Maximum number of files |
|
|
32
|
+
| `maxSize` | `number` | - | Maximum file size in bytes |
|
|
33
|
+
| `disabled` | `boolean` | `false` | Disable the drop zone |
|
|
34
|
+
| `name` | `string` | - | Name for the underlying `<input>` |
|
|
35
|
+
| `...DropzoneProps` | | | All `react-dropzone` props are supported |
|
|
36
|
+
|
|
37
|
+
## Design Tokens
|
|
38
|
+
|
|
39
|
+
Tokens this component reads. Customize by overriding these CSS variables in your theme.
|
|
40
|
+
|
|
41
|
+
| Token | CSS Variable | Purpose |
|
|
42
|
+
| -------------------- | ------------------- | --------------------------------------------------------------- |
|
|
43
|
+
| `border-card-border` | `--card-border` | Border between file list items and default drop zone border |
|
|
44
|
+
| `bg-card-background` | `--card-background` | Drop zone background when files are present |
|
|
45
|
+
| `text-foreground` | `--foreground` | General text color |
|
|
46
|
+
| `text-primary` | `--primary` | Folder icon color and "browse" link color in default idle state |
|
|
47
|
+
| `text-danger` | `--danger` | Delete button hover color |
|
|
48
|
+
|
|
49
|
+
## Drag and Drop States
|
|
50
|
+
|
|
51
|
+
| State | Description |
|
|
52
|
+
| ------------- | -------------------------------------------------------------------------- |
|
|
53
|
+
| Idle (empty) | Displays the `idle` prop or the default folder icon with an upload prompt |
|
|
54
|
+
| Drag active | Replaces the idle UI with an open folder icon while dragging |
|
|
55
|
+
| Files present | Renders the file list; drop zone border becomes solid and background fills |
|
|
56
|
+
|
|
57
|
+
## File Type Rendering
|
|
58
|
+
|
|
59
|
+
The component automatically selects an icon based on file extension:
|
|
60
|
+
|
|
61
|
+
| Extension(s) | Icon |
|
|
62
|
+
| -------------- | ------------------------ |
|
|
63
|
+
| csv, xls, xlsx | `SheetIcon` |
|
|
64
|
+
| pdf, txt | `FileTextIcon` |
|
|
65
|
+
| json | `FileJsonIcon` |
|
|
66
|
+
| mp3 | `AudioLinesIcon` |
|
|
67
|
+
| mp4, mov | `FileVideo2` |
|
|
68
|
+
| Images | Inline `<img>` thumbnail |
|
|
69
|
+
| Other | Generic `FileIcon` |
|
|
70
|
+
|
|
71
|
+
Clicking a file thumbnail opens a `Modal` viewer with full-size preview for images, `<video>` player for videos, and `<audio>` player for audio files.
|
|
72
|
+
|
|
73
|
+
## Examples
|
|
74
|
+
|
|
75
|
+
### Controlled image upload
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
import { FileUpload } from "@g4rcez/components/file-upload";
|
|
79
|
+
|
|
80
|
+
function ImageUpload() {
|
|
81
|
+
const [images, setImages] = useState<File[]>([]);
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<FileUpload
|
|
85
|
+
files={images}
|
|
86
|
+
onDrop={(added) => setImages((prev) => [...prev, ...added])}
|
|
87
|
+
onDeleteFile={(file) => setImages((prev) => prev.filter((f) => f !== file))}
|
|
88
|
+
accept="image/*"
|
|
89
|
+
multiple
|
|
90
|
+
maxFiles={10}
|
|
91
|
+
maxSize={5 * 1024 * 1024}
|
|
92
|
+
/>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Single file upload
|
|
98
|
+
|
|
99
|
+
```tsx
|
|
100
|
+
function AvatarUpload() {
|
|
101
|
+
const [file, setFile] = useState<File | null>(null);
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<FileUpload
|
|
105
|
+
files={file ? [file] : []}
|
|
106
|
+
onDrop={(files) => setFile(files[0])}
|
|
107
|
+
onDeleteFile={() => setFile(null)}
|
|
108
|
+
accept="image/jpeg,image/png"
|
|
109
|
+
multiple={false}
|
|
110
|
+
maxSize={2 * 1024 * 1024}
|
|
111
|
+
/>
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Custom idle state
|
|
117
|
+
|
|
118
|
+
```tsx
|
|
119
|
+
import { UploadSimpleIcon } from "@phosphor-icons/react";
|
|
120
|
+
|
|
121
|
+
const CustomIdle = () => (
|
|
122
|
+
<div className="flex flex-col items-center gap-2 py-10">
|
|
123
|
+
<UploadSimpleIcon size={48} className="text-primary" />
|
|
124
|
+
<p className="text-foreground font-medium">Drop files here</p>
|
|
125
|
+
<p className="text-muted-foreground text-sm">PDF, DOCX, up to 10 MB each</p>
|
|
126
|
+
</div>
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
<FileUpload files={[]} onDrop={setFiles} idle={<CustomIdle />} accept="application/pdf,.docx" multiple />;
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Custom per-file renderer
|
|
133
|
+
|
|
134
|
+
```tsx
|
|
135
|
+
const ProgressRow = ({ file }: { file: File }) => {
|
|
136
|
+
const progress = useUploadProgress(file);
|
|
137
|
+
return (
|
|
138
|
+
<div className="flex flex-col gap-1 pb-2">
|
|
139
|
+
<div className="flex justify-between text-xs text-muted-foreground">
|
|
140
|
+
<span>{progress < 100 ? "Uploading..." : "Done"}</span>
|
|
141
|
+
<span>{progress}%</span>
|
|
142
|
+
</div>
|
|
143
|
+
<div className="h-1.5 rounded-full bg-muted overflow-hidden">
|
|
144
|
+
<div className="h-full rounded-full bg-primary transition-all" style={{ width: `${progress}%` }} />
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
<FileUpload files={files} onDrop={setFiles} File={ProgressRow} multiple />;
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Inside a form
|
|
154
|
+
|
|
155
|
+
```tsx
|
|
156
|
+
import { Form } from "@g4rcez/components/form";
|
|
157
|
+
import { Button } from "@g4rcez/components/button";
|
|
158
|
+
|
|
159
|
+
function SubmissionForm() {
|
|
160
|
+
const [attachments, setAttachments] = useState<File[]>([]);
|
|
161
|
+
|
|
162
|
+
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
|
163
|
+
const data = new FormData(e.currentTarget);
|
|
164
|
+
attachments.forEach((f) => data.append("attachments", f));
|
|
165
|
+
submitToServer(data);
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
return (
|
|
169
|
+
<Form onSubmit={handleSubmit} className="flex flex-col gap-base">
|
|
170
|
+
<FileUpload
|
|
171
|
+
name="attachments"
|
|
172
|
+
files={attachments}
|
|
173
|
+
onDrop={(added) => setAttachments((prev) => [...prev, ...added])}
|
|
174
|
+
onDeleteFile={(f) => setAttachments((prev) => prev.filter((x) => x !== f))}
|
|
175
|
+
accept="image/*,.pdf"
|
|
176
|
+
multiple
|
|
177
|
+
maxSize={10 * 1024 * 1024}
|
|
178
|
+
/>
|
|
179
|
+
<Button theme="primary" type="submit">
|
|
180
|
+
Submit
|
|
181
|
+
</Button>
|
|
182
|
+
</Form>
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## Do
|
|
188
|
+
|
|
189
|
+
- Always set `accept` to restrict uploads to the file types your server expects.
|
|
190
|
+
- Set `maxSize` to provide immediate client-side feedback for oversized files.
|
|
191
|
+
- Use `multiple` when batch uploads are expected.
|
|
192
|
+
- Use the `File` prop to add progress bars, metadata, or custom actions below each file row.
|
|
193
|
+
- Use design-token classes for wrapper elements (`bg-card-background`, `text-foreground`).
|
|
194
|
+
|
|
195
|
+
## Don't
|
|
196
|
+
|
|
197
|
+
- Don't pass raw Tailwind color classes (`bg-blue-500`, `text-white`, `border-gray-300`) — use theme props or design tokens instead.
|
|
198
|
+
- Don't use arbitrary Tailwind values (`bg-[#abc]`, `bg-[--my-var]`) — override CSS variables in your `@theme` block instead.
|
|
199
|
+
- Don't rely solely on client-side `maxSize`/`accept` — validate files server-side as well.
|
|
200
|
+
- Don't skip `onDeleteFile` when `files` is controlled — without it, users cannot remove files they added.
|
|
201
|
+
|
|
202
|
+
## Accessibility
|
|
203
|
+
|
|
204
|
+
- The drop zone uses `react-dropzone`'s `getRootProps` and `getInputProps`, which include keyboard support (Enter/Space to open the file browser).
|
|
205
|
+
- The hidden `<input type="file">` is accessible by assistive technologies.
|
|
206
|
+
- Delete buttons include a `type="button"` to prevent accidental form submission.
|
|
207
|
+
- The modal viewer opened for file preview is managed by the `Modal` component, which handles focus trapping and Escape to close.
|
|
208
|
+
|
|
209
|
+
## Data Attributes
|
|
210
|
+
|
|
211
|
+
- `data-active="true"` — on the drop zone wrapper when at least one file is present; used to switch between dashed (empty) and solid (filled) border styles.
|
|
212
|
+
|
|
213
|
+
## Notes
|
|
214
|
+
|
|
215
|
+
- When `files` is not provided, the component manages its own internal file state. Pass `files` for fully controlled behavior.
|
|
216
|
+
- Object URLs created for previews are revoked on cleanup via `useEffect` to prevent memory leaks.
|
|
217
|
+
- The `File` prop (custom renderer) is rendered inside the file list item, below the file name and size row, alongside the built-in delete button.
|
|
218
|
+
- The component depends on `react-dropzone` and `pretty-bytes` as peer dependencies.
|
|
@@ -21,12 +21,12 @@ import { Form } from "@g4rcez/components/form";
|
|
|
21
21
|
|
|
22
22
|
`Form` accepts all standard HTML `<form>` attributes.
|
|
23
23
|
|
|
24
|
-
| Prop
|
|
25
|
-
|
|
26
|
-
| `onSubmit`
|
|
27
|
-
| `children`
|
|
28
|
-
| `className` | `string`
|
|
29
|
-
| `...props`
|
|
24
|
+
| Prop | Type | Default | Description |
|
|
25
|
+
| ----------- | --------------------------------------------------- | ------- | ---------------------------------------------------------------------- |
|
|
26
|
+
| `onSubmit` | `(event: React.FormEvent<HTMLFormElement>) => void` | - | Submit handler. `preventDefault()` is called before this. |
|
|
27
|
+
| `children` | `React.ReactNode` | - | Form fields and other content. |
|
|
28
|
+
| `className` | `string` | - | CSS classes for the `<form>` element. |
|
|
29
|
+
| `...props` | `React.ComponentProps<"form">` | - | All standard form attributes (`action`, `method`, `noValidate`, etc.). |
|
|
30
30
|
|
|
31
31
|
## Design Tokens
|
|
32
32
|
|
|
@@ -42,18 +42,20 @@ import { Input } from "@g4rcez/components/input";
|
|
|
42
42
|
import { Button } from "@g4rcez/components/button";
|
|
43
43
|
|
|
44
44
|
function LoginForm() {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
45
|
+
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
|
46
|
+
const data = new FormData(e.currentTarget);
|
|
47
|
+
console.log(Object.fromEntries(data));
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<Form onSubmit={handleSubmit} className="flex flex-col gap-base max-w-sm">
|
|
52
|
+
<Input name="email" type="email" title="Email" required />
|
|
53
|
+
<Input name="password" type="password" title="Password" required />
|
|
54
|
+
<Button theme="primary" type="submit">
|
|
55
|
+
Log in
|
|
56
|
+
</Button>
|
|
57
|
+
</Form>
|
|
58
|
+
);
|
|
57
59
|
}
|
|
58
60
|
```
|
|
59
61
|
|
|
@@ -61,26 +63,30 @@ function LoginForm() {
|
|
|
61
63
|
|
|
62
64
|
```tsx
|
|
63
65
|
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
const formData = new FormData(e.currentTarget);
|
|
67
|
+
const payload = Object.fromEntries(formData);
|
|
68
|
+
await fetch("/api/contact", { method: "POST", body: JSON.stringify(payload) });
|
|
67
69
|
};
|
|
68
70
|
|
|
69
71
|
<Form onSubmit={handleSubmit} className="flex flex-col gap-base">
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
<Input name="name" title="Name" required />
|
|
73
|
+
<Input name="message" title="Message" />
|
|
74
|
+
<Button theme="primary" type="submit">
|
|
75
|
+
Send
|
|
76
|
+
</Button>
|
|
77
|
+
</Form>;
|
|
74
78
|
```
|
|
75
79
|
|
|
76
80
|
### Multi-column layout
|
|
77
81
|
|
|
78
82
|
```tsx
|
|
79
83
|
<Form className="grid grid-cols-2 gap-base max-w-2xl">
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
+
<Input name="firstName" title="First name" required />
|
|
85
|
+
<Input name="lastName" title="Last name" required />
|
|
86
|
+
<Input name="email" type="email" title="Email" container="col-span-2" required />
|
|
87
|
+
<Button type="submit" theme="primary" container="col-start-2">
|
|
88
|
+
Save
|
|
89
|
+
</Button>
|
|
84
90
|
</Form>
|
|
85
91
|
```
|
|
86
92
|
|
|
@@ -20,14 +20,14 @@ import { formReset } from "@g4rcez/components";
|
|
|
20
20
|
## Signature
|
|
21
21
|
|
|
22
22
|
```ts
|
|
23
|
-
function formReset(form?: HTMLFormElement | null): void
|
|
23
|
+
function formReset(form?: HTMLFormElement | null): void;
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
## Parameters
|
|
27
27
|
|
|
28
|
-
| Parameter | Type
|
|
29
|
-
|
|
30
|
-
| `form`
|
|
28
|
+
| Parameter | Type | Description |
|
|
29
|
+
| --------- | -------------------------------------- | ------------------------------------------------------------------ |
|
|
30
|
+
| `form` | `HTMLFormElement \| null \| undefined` | The form element to reset. Safely no-ops if `null` or `undefined`. |
|
|
31
31
|
|
|
32
32
|
## How It Works
|
|
33
33
|
|
|
@@ -48,21 +48,23 @@ import { Button } from "@g4rcez/components/button";
|
|
|
48
48
|
import { formReset } from "@g4rcez/components";
|
|
49
49
|
|
|
50
50
|
function ContactForm() {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
51
|
+
const formRef = useRef<HTMLFormElement>(null);
|
|
52
|
+
|
|
53
|
+
const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
|
|
54
|
+
const data = new FormData(e.currentTarget);
|
|
55
|
+
await submitToServer(Object.fromEntries(data));
|
|
56
|
+
formReset(formRef.current);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<Form ref={formRef} onSubmit={handleSubmit} className="flex flex-col gap-base">
|
|
61
|
+
<Input name="name" title="Name" required />
|
|
62
|
+
<Input name="email" type="email" title="Email" required />
|
|
63
|
+
<Button theme="primary" type="submit">
|
|
64
|
+
Send
|
|
65
|
+
</Button>
|
|
66
|
+
</Form>
|
|
67
|
+
);
|
|
66
68
|
}
|
|
67
69
|
```
|
|
68
70
|
|
|
@@ -70,24 +72,22 @@ function ContactForm() {
|
|
|
70
72
|
|
|
71
73
|
```tsx
|
|
72
74
|
function EditForm({ defaultValues }: { defaultValues: Record<string, string> }) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
</
|
|
88
|
-
|
|
89
|
-
</Form>
|
|
90
|
-
);
|
|
75
|
+
const formRef = useRef<HTMLFormElement>(null);
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<Form ref={formRef} onSubmit={handleSave} className="flex flex-col gap-base">
|
|
79
|
+
<Input name="title" title="Title" defaultValue={defaultValues.title} />
|
|
80
|
+
<Input name="description" title="Description" defaultValue={defaultValues.description} />
|
|
81
|
+
<div className="flex gap-sm">
|
|
82
|
+
<Button theme="primary" type="submit">
|
|
83
|
+
Save
|
|
84
|
+
</Button>
|
|
85
|
+
<Button theme="ghost" type="button" onClick={() => formReset(formRef.current)}>
|
|
86
|
+
Cancel
|
|
87
|
+
</Button>
|
|
88
|
+
</div>
|
|
89
|
+
</Form>
|
|
90
|
+
);
|
|
91
91
|
}
|
|
92
92
|
```
|
|
93
93
|
|
|
@@ -19,9 +19,9 @@ import { Heading } from "@g4rcez/components";
|
|
|
19
19
|
|
|
20
20
|
## Props
|
|
21
21
|
|
|
22
|
-
| Prop
|
|
23
|
-
|
|
24
|
-
| `children` | `React.ReactNode` | -
|
|
22
|
+
| Prop | Type | Default | Description |
|
|
23
|
+
| ---------- | ----------------- | ------- | -------------------------- |
|
|
24
|
+
| `children` | `React.ReactNode` | - | The content of the heading |
|
|
25
25
|
|
|
26
26
|
## Design Tokens
|
|
27
27
|
|
|
@@ -54,9 +54,7 @@ import { Polymorph } from "@g4rcez/components";
|
|
|
54
54
|
### Applying Typography Styles
|
|
55
55
|
|
|
56
56
|
```tsx
|
|
57
|
-
<Heading className="text-2xl font-bold text-foreground">
|
|
58
|
-
Dashboard Overview
|
|
59
|
-
</Heading>
|
|
57
|
+
<Heading className="text-2xl font-bold text-foreground">Dashboard Overview</Heading>
|
|
60
58
|
```
|
|
61
59
|
|
|
62
60
|
## Do
|
package/ai/docs/Input.md
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Input
|
|
3
|
+
description: Text input with optional masking for currencies, percentages, phone numbers, dates, and custom regex patterns.
|
|
4
|
+
package: "@g4rcez/components"
|
|
5
|
+
export: "{ Input }"
|
|
6
|
+
import: "import { Input } from '@g4rcez/components/input'"
|
|
7
|
+
category: form
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Input
|
|
11
|
+
|
|
12
|
+
Text input with optional masking for currencies, percentages, phone numbers, dates, and custom regex patterns.
|
|
13
|
+
|
|
14
|
+
## Import
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import { Input } from "@g4rcez/components/input";
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Props
|
|
21
|
+
|
|
22
|
+
`Input` extends all standard HTML `<input>` attributes plus `InputField` layout props:
|
|
23
|
+
|
|
24
|
+
| Prop | Type | Default | Description |
|
|
25
|
+
| ---------------- | ---------------------------------------------------------------------- | ------- | -------------------------------------------------------------------------------- |
|
|
26
|
+
| `mask` | `AllMasks \| Array<string \| RegExp> \| ((value: string) => AllMasks)` | - | Input mask pattern |
|
|
27
|
+
| `locale` | `Locales` | - | Locale for currency/number formatting |
|
|
28
|
+
| `currency` | `CurrencyCode` | - | Currency code when using `mask="currency"` |
|
|
29
|
+
| `error` | `string` | - | Error message shown below the field |
|
|
30
|
+
| `title` | `string` | - | Field label |
|
|
31
|
+
| `feedback` | `Label` | - | Success or neutral feedback text below the field |
|
|
32
|
+
| `left` | `Label` | - | Content rendered on the left inside the field border |
|
|
33
|
+
| `right` | `Label` | - | Content rendered on the right inside the field border |
|
|
34
|
+
| `required` | `boolean` | `false` | Marks field as required; hides "Optional" label text |
|
|
35
|
+
| `disabled` | `boolean` | `false` | Disabled state |
|
|
36
|
+
| `loading` | `boolean` | `false` | Loading state |
|
|
37
|
+
| `container` | `string` | - | Extra CSS classes for the outer `fieldset` |
|
|
38
|
+
| `labelClassName` | `string` | - | Extra CSS classes for the label/border wrapper |
|
|
39
|
+
| `next` | `string` | - | `id` of the next field to focus when Enter is pressed with `enterKeyHint="next"` |
|
|
40
|
+
| `hiddenLabel` | `boolean` | `false` | Visually hides the label but keeps it for screen readers |
|
|
41
|
+
| `...props` | `React.InputHTMLAttributes<HTMLInputElement>` | - | All standard input attributes |
|
|
42
|
+
|
|
43
|
+
### Mask patterns
|
|
44
|
+
|
|
45
|
+
| Pattern char | Matches |
|
|
46
|
+
| ------------ | ----------------- |
|
|
47
|
+
| `9` | Digit (0–9) |
|
|
48
|
+
| `A` | Letter (a–z, A–Z) |
|
|
49
|
+
| `S` | Alphanumeric |
|
|
50
|
+
| `*` | Any character |
|
|
51
|
+
|
|
52
|
+
### Special mask strings
|
|
53
|
+
|
|
54
|
+
| Value | Description |
|
|
55
|
+
| -------------- | ------------------------------------------------------ |
|
|
56
|
+
| `"currency"` | Currency formatting (requires `locale` and `currency`) |
|
|
57
|
+
| `"percentage"` | Percentage input with `%` symbol |
|
|
58
|
+
| `"decimal"` | Decimal number formatting |
|
|
59
|
+
|
|
60
|
+
## Design Tokens
|
|
61
|
+
|
|
62
|
+
Tokens this component reads. Customize by overriding these CSS variables in your theme.
|
|
63
|
+
|
|
64
|
+
| Token | CSS Variable | Purpose |
|
|
65
|
+
| ------------------------------ | -------------------- | ------------------------------------------------ |
|
|
66
|
+
| `h-input-height` | `--input-height` | Input height |
|
|
67
|
+
| `px-input-x` | `--input-x` | Horizontal padding |
|
|
68
|
+
| `py-input-y` | `--input-y` | Vertical padding |
|
|
69
|
+
| `mt-input-gap` | `--input-gap` | Gap between field border and error/feedback text |
|
|
70
|
+
| `border-input-border` | `--input-border` | Default border color |
|
|
71
|
+
| `text-field-label` | `--field-label` | Label text color |
|
|
72
|
+
| `text-foreground` | `--foreground` | Input text color |
|
|
73
|
+
| `text-primary` | `--primary` | Focus ring, focus/hover border color |
|
|
74
|
+
| `text-danger` | `--danger` | Error state border, text, and label color |
|
|
75
|
+
| `text-disabled` | `--disabled` | Disabled text and border color |
|
|
76
|
+
| `placeholder-input-mask` | `--input-mask` | Placeholder text color |
|
|
77
|
+
| `placeholder-input-mask-error` | `--input-mask-error` | Placeholder color in error state |
|
|
78
|
+
|
|
79
|
+
## Examples
|
|
80
|
+
|
|
81
|
+
### Basic text input
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
import { Input } from "@g4rcez/components/input";
|
|
85
|
+
|
|
86
|
+
<Input name="name" title="Full name" placeholder="Jane Smith" required />;
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Phone number mask
|
|
90
|
+
|
|
91
|
+
```tsx
|
|
92
|
+
<Input name="phone" title="Phone" mask="(99) 99999-9999" placeholder="(00) 00000-0000" />
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Currency input
|
|
96
|
+
|
|
97
|
+
```tsx
|
|
98
|
+
<Input name="price" title="Price" mask="currency" currency="USD" locale="en-US" placeholder="0.00" />
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Dynamic mask (CPF / CNPJ)
|
|
102
|
+
|
|
103
|
+
```tsx
|
|
104
|
+
const docMask = (value: string) => (value.replace(/\D/g, "").length <= 11 ? "999.999.999-99" : "99.999.999/9999-99");
|
|
105
|
+
|
|
106
|
+
<Input name="document" title="CPF or CNPJ" mask={docMask} placeholder="000.000.000-00" />;
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Input with inline left/right slots
|
|
110
|
+
|
|
111
|
+
```tsx
|
|
112
|
+
import { MagnifyingGlassIcon } from "@phosphor-icons/react";
|
|
113
|
+
|
|
114
|
+
<Input name="search" title="Search" left={<MagnifyingGlassIcon size={16} className="text-muted-foreground" />} placeholder="Type to search..." />;
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Input with error and feedback
|
|
118
|
+
|
|
119
|
+
```tsx
|
|
120
|
+
const [email, setEmail] = useState("");
|
|
121
|
+
const error = email && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email) ? "Enter a valid email address" : undefined;
|
|
122
|
+
|
|
123
|
+
<Input
|
|
124
|
+
name="email"
|
|
125
|
+
type="email"
|
|
126
|
+
title="Email"
|
|
127
|
+
value={email}
|
|
128
|
+
onChange={(e) => setEmail(e.target.value)}
|
|
129
|
+
error={error}
|
|
130
|
+
feedback={!error && email ? "Looks good!" : undefined}
|
|
131
|
+
/>;
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Enter-to-advance between fields
|
|
135
|
+
|
|
136
|
+
```tsx
|
|
137
|
+
<Input
|
|
138
|
+
name="first"
|
|
139
|
+
title="First name"
|
|
140
|
+
enterKeyHint="next"
|
|
141
|
+
next="last"
|
|
142
|
+
/>
|
|
143
|
+
<Input
|
|
144
|
+
name="last"
|
|
145
|
+
id="last"
|
|
146
|
+
title="Last name"
|
|
147
|
+
enterKeyHint="done"
|
|
148
|
+
/>
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Inside a form
|
|
152
|
+
|
|
153
|
+
```tsx
|
|
154
|
+
import { Form } from "@g4rcez/components/form";
|
|
155
|
+
import { Button } from "@g4rcez/components/button";
|
|
156
|
+
|
|
157
|
+
function SignUpForm() {
|
|
158
|
+
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
|
159
|
+
const data = new FormData(e.currentTarget);
|
|
160
|
+
console.log(Object.fromEntries(data));
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
return (
|
|
164
|
+
<Form onSubmit={handleSubmit} className="flex flex-col gap-base max-w-md">
|
|
165
|
+
<Input name="name" title="Full name" required />
|
|
166
|
+
<Input name="email" type="email" title="Email" required />
|
|
167
|
+
<Input name="phone" title="Phone" mask="(99) 99999-9999" />
|
|
168
|
+
<Button theme="primary" type="submit">
|
|
169
|
+
Sign up
|
|
170
|
+
</Button>
|
|
171
|
+
</Form>
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Do
|
|
177
|
+
|
|
178
|
+
- Use `mask` patterns that match user expectations for the data type.
|
|
179
|
+
- Provide a `placeholder` that shows the expected format (e.g., `"(00) 00000-0000"`).
|
|
180
|
+
- Use the `error` prop to surface validation messages from your form library or manual validation.
|
|
181
|
+
- Use the `next` prop with `enterKeyHint="next"` to create smooth keyboard flows on mobile.
|
|
182
|
+
- Use design-token classes for wrapper elements (`bg-background`, `text-foreground`, `border-border`).
|
|
183
|
+
|
|
184
|
+
## Don't
|
|
185
|
+
|
|
186
|
+
- Don't pass raw Tailwind color classes (`bg-blue-500`, `text-white`, `border-gray-300`) — use theme props or design tokens instead.
|
|
187
|
+
- Don't use arbitrary Tailwind values (`bg-[#abc]`, `bg-[--my-var]`) — override CSS variables in your `@theme` block instead.
|
|
188
|
+
- Don't use a mask that blocks valid input variations — prefer dynamic masks for formats with variable length.
|
|
189
|
+
- Don't forget that the mask formats the display value; if your backend expects raw data, strip formatting before sending.
|
|
190
|
+
- Don't use `Input` for long-form text — use `Textarea` instead.
|
|
191
|
+
|
|
192
|
+
## Accessibility
|
|
193
|
+
|
|
194
|
+
- Renders a semantic `<input>` wrapped in a `<fieldset>` with an associated `<label>` (via `InputField`).
|
|
195
|
+
- `aria-disabled`, `aria-readonly`, and `aria-busy` are set automatically from props.
|
|
196
|
+
- Error messages appear as a visible `<p>` below the field after the user has interacted with it (`data-initialized="true"`).
|
|
197
|
+
- Focus ring uses `focus:ring-primary` for consistent, visible keyboard indication.
|
|
198
|
+
- The `hiddenLabel` prop keeps the label in the accessibility tree while hiding it visually.
|
|
199
|
+
|
|
200
|
+
## Data Attributes
|
|
201
|
+
|
|
202
|
+
- `data-initialized` — managed by `initializeInputDataset`; switches from `"false"` to `"true"` after first user interaction, enabling validation display.
|
|
203
|
+
- `data-next` — set from the `next` prop; used to focus the next field on Enter.
|
|
204
|
+
- `data-component="input"` — set on the outer `fieldset` by `InputField`.
|
|
205
|
+
- `data-error` — on the `fieldset`: `"true"` when an `error` string is present.
|
|
206
|
+
|
|
207
|
+
## Notes
|
|
208
|
+
|
|
209
|
+
- Built on top of `the-mask-input`. All mask features from that library are available.
|
|
210
|
+
- The component automatically manages cursor positioning during masked input.
|
|
211
|
+
- Works with both controlled (`value` + `onChange`) and uncontrolled (`defaultValue`) patterns.
|
|
212
|
+
- `Input` is created via the `createFreeText` factory, which also powers `Textarea`. Both share the same styling tokens.
|