@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/dist/ai/docs/Checkbox.md
DELETED
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Checkbox
|
|
3
|
-
description: Styled checkbox with label support, task mode, error display, loading state, and size variants.
|
|
4
|
-
package: "@g4rcez/components"
|
|
5
|
-
export: "{ Checkbox }"
|
|
6
|
-
import: "import { Checkbox } from '@g4rcez/components/checkbox'"
|
|
7
|
-
category: form
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# Checkbox
|
|
11
|
-
|
|
12
|
-
Styled checkbox with label support, task mode, error display, loading state, and size variants.
|
|
13
|
-
|
|
14
|
-
## Import
|
|
15
|
-
|
|
16
|
-
```tsx
|
|
17
|
-
import { Checkbox } from "@g4rcez/components/checkbox";
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Props
|
|
21
|
-
|
|
22
|
-
| Prop | Type | Default | Description |
|
|
23
|
-
|------|------|---------|-------------|
|
|
24
|
-
| `checked` | `boolean` | - | Controlled checked state |
|
|
25
|
-
| `onChange` | `(e: React.ChangeEvent<HTMLInputElement>) => void` | - | Change handler |
|
|
26
|
-
| `disabled` | `boolean` | `false` | Disabled state |
|
|
27
|
-
| `loading` | `boolean` | `false` | Loading state — disables the checkbox while loading |
|
|
28
|
-
| `error` | `string` | - | Error message rendered below the label |
|
|
29
|
-
| `asTask` | `boolean` | `false` | Task mode: applies strikethrough to the label when checked |
|
|
30
|
-
| `size` | `"medium" \| "large"` | `"medium"` | Checkbox size |
|
|
31
|
-
| `container` | `string` | - | Extra CSS classes for the outer `<label>` wrapper |
|
|
32
|
-
| `labelClassName` | `string` | - | Extra CSS classes for the error text element |
|
|
33
|
-
| `className` | `string` | - | Extra CSS classes for the `<input>` element |
|
|
34
|
-
| `children` | `React.ReactNode` | - | Label content |
|
|
35
|
-
| `...props` | `React.InputHTMLAttributes<HTMLInputElement>` | - | All standard input attributes |
|
|
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
|
-
| `text-primary` | `--primary` | Checkbox accent / checked color |
|
|
44
|
-
| `border-card-border` | `--card-border` | Unchecked border color |
|
|
45
|
-
| `text-danger` | `--danger` | Error message text color |
|
|
46
|
-
| `text-disabled` | `--disabled` | Opacity and cursor on disabled state |
|
|
47
|
-
| `focus:ring-primary` | `--primary` | Focus ring color |
|
|
48
|
-
|
|
49
|
-
## Variants
|
|
50
|
-
|
|
51
|
-
### Size
|
|
52
|
-
|
|
53
|
-
| Value | Description |
|
|
54
|
-
|-------|-------------|
|
|
55
|
-
| `"medium"` | Default size — 1rem × 1rem (`size-4`) |
|
|
56
|
-
| `"large"` | Larger touch target |
|
|
57
|
-
|
|
58
|
-
### Task mode
|
|
59
|
-
|
|
60
|
-
When `asTask={true}`, the label text receives a strikethrough style when the checkbox is checked. This is intended for to-do lists and task management UIs.
|
|
61
|
-
|
|
62
|
-
## Examples
|
|
63
|
-
|
|
64
|
-
### Basic checkbox
|
|
65
|
-
|
|
66
|
-
```tsx
|
|
67
|
-
const [accepted, setAccepted] = useState(false);
|
|
68
|
-
|
|
69
|
-
<Checkbox
|
|
70
|
-
checked={accepted}
|
|
71
|
-
onChange={(e) => setAccepted(e.target.checked)}
|
|
72
|
-
>
|
|
73
|
-
I accept the terms and conditions
|
|
74
|
-
</Checkbox>
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
### Checkbox with error
|
|
78
|
-
|
|
79
|
-
```tsx
|
|
80
|
-
const [agreed, setAgreed] = useState(false);
|
|
81
|
-
const [error, setError] = useState("");
|
|
82
|
-
|
|
83
|
-
<Checkbox
|
|
84
|
-
checked={agreed}
|
|
85
|
-
onChange={(e) => {
|
|
86
|
-
setAgreed(e.target.checked);
|
|
87
|
-
if (e.target.checked) setError("");
|
|
88
|
-
}}
|
|
89
|
-
error={error}
|
|
90
|
-
>
|
|
91
|
-
I agree to the privacy policy
|
|
92
|
-
</Checkbox>
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
### Task list
|
|
96
|
-
|
|
97
|
-
```tsx
|
|
98
|
-
const [tasks, setTasks] = useState([
|
|
99
|
-
{ id: 1, text: "Write release notes", done: false },
|
|
100
|
-
{ id: 2, text: "Merge pull request", done: true },
|
|
101
|
-
]);
|
|
102
|
-
|
|
103
|
-
<div className="flex flex-col gap-sm">
|
|
104
|
-
{tasks.map((task) => (
|
|
105
|
-
<Checkbox
|
|
106
|
-
key={task.id}
|
|
107
|
-
checked={task.done}
|
|
108
|
-
onChange={() =>
|
|
109
|
-
setTasks((prev) =>
|
|
110
|
-
prev.map((t) => (t.id === task.id ? { ...t, done: !t.done } : t))
|
|
111
|
-
)
|
|
112
|
-
}
|
|
113
|
-
asTask
|
|
114
|
-
>
|
|
115
|
-
{task.text}
|
|
116
|
-
</Checkbox>
|
|
117
|
-
))}
|
|
118
|
-
</div>
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
### Loading state
|
|
122
|
-
|
|
123
|
-
```tsx
|
|
124
|
-
const [loading, setLoading] = useState(false);
|
|
125
|
-
const [subscribed, setSubscribed] = useState(false);
|
|
126
|
-
|
|
127
|
-
const handleChange = async (checked: boolean) => {
|
|
128
|
-
setLoading(true);
|
|
129
|
-
await updateSubscription(checked);
|
|
130
|
-
setSubscribed(checked);
|
|
131
|
-
setLoading(false);
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
<Checkbox
|
|
135
|
-
checked={subscribed}
|
|
136
|
-
onChange={(e) => handleChange(e.target.checked)}
|
|
137
|
-
loading={loading}
|
|
138
|
-
>
|
|
139
|
-
Subscribe to newsletter
|
|
140
|
-
</Checkbox>
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
### Notification preferences form
|
|
144
|
-
|
|
145
|
-
```tsx
|
|
146
|
-
function PreferencesForm() {
|
|
147
|
-
const [prefs, setPrefs] = useState({
|
|
148
|
-
email: false,
|
|
149
|
-
push: true,
|
|
150
|
-
sms: false,
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
const toggle = (key: keyof typeof prefs) => (e: React.ChangeEvent<HTMLInputElement>) =>
|
|
154
|
-
setPrefs((prev) => ({ ...prev, [key]: e.target.checked }));
|
|
155
|
-
|
|
156
|
-
return (
|
|
157
|
-
<form className="flex flex-col gap-sm">
|
|
158
|
-
<Checkbox checked={prefs.email} onChange={toggle("email")}>Email notifications</Checkbox>
|
|
159
|
-
<Checkbox checked={prefs.push} onChange={toggle("push")}>Push notifications</Checkbox>
|
|
160
|
-
<Checkbox checked={prefs.sms} onChange={toggle("sms")}>SMS notifications</Checkbox>
|
|
161
|
-
</form>
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
## Do
|
|
167
|
-
|
|
168
|
-
- Use descriptive, actionable labels so users know exactly what they are agreeing to or enabling.
|
|
169
|
-
- Group related checkboxes visually to signal they form a set.
|
|
170
|
-
- Use `asTask` for items in a to-do list or task-tracking UI.
|
|
171
|
-
- Provide an `error` message when the checkbox is part of required validation (e.g., accepting terms).
|
|
172
|
-
|
|
173
|
-
## Don't
|
|
174
|
-
|
|
175
|
-
- Don't pass raw Tailwind color classes (`bg-blue-500`, `text-white`, `border-gray-300`) — use theme props or design tokens instead.
|
|
176
|
-
- Don't use arbitrary Tailwind values (`bg-[#abc]`, `bg-[--my-var]`) — override CSS variables in your `@theme` block instead.
|
|
177
|
-
- Don't use `Checkbox` to trigger an immediate action — use a `Button` or `Switch` instead.
|
|
178
|
-
- Don't use checkboxes for mutually exclusive choices — use `Radiobox` instead.
|
|
179
|
-
|
|
180
|
-
## Accessibility
|
|
181
|
-
|
|
182
|
-
- Renders a native `<input type="checkbox">` for full browser and screen reader support.
|
|
183
|
-
- The outer `<label>` wraps both the input and the label text, so clicking anywhere on the label toggles the checkbox.
|
|
184
|
-
- `aria-disabled` and `data-disabled` are applied when `disabled` or `loading` is true.
|
|
185
|
-
- Error messages are rendered as visible text below the label and are discoverable by screen readers.
|
|
186
|
-
- Focus ring is visible for keyboard navigation.
|
|
187
|
-
|
|
188
|
-
## Data Attributes
|
|
189
|
-
|
|
190
|
-
- `data-component="checkbox"` — on the outer `<label>`.
|
|
191
|
-
- `data-task` — reflects the `asTask` prop value.
|
|
192
|
-
- `data-disabled` — reflects the effective disabled state (`disabled || loading`).
|
|
193
|
-
- `data-name="checkbox-label"` — on the error text `<span>`.
|
|
194
|
-
|
|
195
|
-
## Notes
|
|
196
|
-
|
|
197
|
-
- `loading` sets `disabled` on the underlying input. The two states share the same visual treatment.
|
|
198
|
-
- The component forwards its ref to the `<input>` element.
|
|
199
|
-
- All standard `HTMLInputElement` attributes are forwarded to the native input, so you can use `name`, `value`, `required`, `defaultChecked`, and so on.
|
|
@@ -1,293 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: CommandPalette
|
|
3
|
-
description: Searchable command palette with fuzzy search, keyboard shortcuts, and grouped commands.
|
|
4
|
-
package: "@g4rcez/components"
|
|
5
|
-
export: "{ CommandPalette }"
|
|
6
|
-
import: "import { CommandPalette } from '@g4rcez/components'"
|
|
7
|
-
category: floating
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# CommandPalette
|
|
11
|
-
|
|
12
|
-
Searchable command palette with fuzzy search, keyboard shortcuts, and grouped commands.
|
|
13
|
-
|
|
14
|
-
## Import
|
|
15
|
-
|
|
16
|
-
```tsx
|
|
17
|
-
import { CommandPalette } from "@g4rcez/components";
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Props
|
|
21
|
-
|
|
22
|
-
| Prop | Type | Default | Description |
|
|
23
|
-
|------|------|---------|-------------|
|
|
24
|
-
| `open` | `boolean` | — | Controlled open state |
|
|
25
|
-
| `commands` | `CommandItemTypes[]` | — | Array of commands to display |
|
|
26
|
-
| `onChangeVisibility` | `(next: boolean) => void` | — | Open/close handler |
|
|
27
|
-
| `bind` | `string` | `"Mod + k"` | Global keyboard shortcut to open the palette |
|
|
28
|
-
| `loading` | `boolean` | `false` | Show loading skeleton while commands load |
|
|
29
|
-
| `emptyMessage` | `Label` | — | Message shown when no results match |
|
|
30
|
-
| `footer` | `React.ReactElement` | — | Custom footer content |
|
|
31
|
-
| `onChangeText` | `(text: string) => void` | — | Search text change handler |
|
|
32
|
-
| `Preview` | `React.FC<{ command: CommandItemTypes; text: string }>` | — | Preview panel component for the active command |
|
|
33
|
-
| `Icon` | `React.FC<IconProps & { text: string; Default: React.FC<IconProps> }>` | — | Custom search icon |
|
|
34
|
-
|
|
35
|
-
## Command Types
|
|
36
|
-
|
|
37
|
-
### CommandShortcutItem
|
|
38
|
-
|
|
39
|
-
```tsx
|
|
40
|
-
type CommandShortcutItem = {
|
|
41
|
-
type: "shortcut";
|
|
42
|
-
title: string | ((props: { text: string }) => string);
|
|
43
|
-
hint?: string | string[];
|
|
44
|
-
shortcut?: string;
|
|
45
|
-
Icon?: React.ReactElement;
|
|
46
|
-
enabled?: boolean | ((props: { text: string }) => boolean);
|
|
47
|
-
action: (args: {
|
|
48
|
-
text: string;
|
|
49
|
-
setText: (state: string) => void;
|
|
50
|
-
setOpen: (state: boolean) => void;
|
|
51
|
-
event: KeyboardEvent | React.MouseEvent | React.KeyboardEvent;
|
|
52
|
-
}) => void | Promise<void>;
|
|
53
|
-
};
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### CommandGroupItem
|
|
57
|
-
|
|
58
|
-
```tsx
|
|
59
|
-
type CommandGroupItem = {
|
|
60
|
-
type: "group";
|
|
61
|
-
title: string | ((props: { text: string }) => string);
|
|
62
|
-
items: CommandItemTypes[];
|
|
63
|
-
};
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
## Design Tokens
|
|
67
|
-
|
|
68
|
-
Tokens this component reads. Customize by overriding these CSS variables in your theme.
|
|
69
|
-
|
|
70
|
-
| Token | CSS Variable | Purpose |
|
|
71
|
-
|-------|-------------|---------|
|
|
72
|
-
| `bg-floating-background` | `--floating-background` | Palette surface background |
|
|
73
|
-
| `border-floating-border` | `--floating-border` | Palette surface border |
|
|
74
|
-
| `bg-floating-hover` | `--floating-hover` | Hovered/active command item background |
|
|
75
|
-
| `z-floating` | `--z-floating` | Z-index for the search header |
|
|
76
|
-
| `text-secondary` | `--secondary` | Group label and empty state text color |
|
|
77
|
-
|
|
78
|
-
## Examples
|
|
79
|
-
|
|
80
|
-
### Basic Command Palette
|
|
81
|
-
|
|
82
|
-
```tsx
|
|
83
|
-
import { useState } from "react";
|
|
84
|
-
import { FileTextIcon, FloppyDiskIcon, FolderOpenIcon } from "@phosphor-icons/react";
|
|
85
|
-
import { CommandPalette } from "@g4rcez/components";
|
|
86
|
-
|
|
87
|
-
function BasicCommandPalette() {
|
|
88
|
-
const [open, setOpen] = useState(false);
|
|
89
|
-
|
|
90
|
-
const commands = [
|
|
91
|
-
{
|
|
92
|
-
type: "shortcut" as const,
|
|
93
|
-
title: "New Document",
|
|
94
|
-
shortcut: "Ctrl+N",
|
|
95
|
-
Icon: <FileTextIcon size={16} />,
|
|
96
|
-
action: ({ setOpen }) => {
|
|
97
|
-
console.log("Creating new document");
|
|
98
|
-
setOpen(false);
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
type: "shortcut" as const,
|
|
103
|
-
title: "Save Document",
|
|
104
|
-
shortcut: "Ctrl+S",
|
|
105
|
-
Icon: <FloppyDiskIcon size={16} />,
|
|
106
|
-
action: ({ setOpen }) => {
|
|
107
|
-
console.log("Saving document");
|
|
108
|
-
setOpen(false);
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
type: "shortcut" as const,
|
|
113
|
-
title: "Open File",
|
|
114
|
-
shortcut: "Ctrl+O",
|
|
115
|
-
Icon: <FolderOpenIcon size={16} />,
|
|
116
|
-
action: ({ setOpen }) => {
|
|
117
|
-
console.log("Opening file");
|
|
118
|
-
setOpen(false);
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
];
|
|
122
|
-
|
|
123
|
-
return (
|
|
124
|
-
<CommandPalette
|
|
125
|
-
open={open}
|
|
126
|
-
commands={commands}
|
|
127
|
-
onChangeVisibility={setOpen}
|
|
128
|
-
/>
|
|
129
|
-
);
|
|
130
|
-
}
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### Grouped Commands
|
|
134
|
-
|
|
135
|
-
```tsx
|
|
136
|
-
import { FileIcon, FolderOpenIcon, HouseIcon, GearIcon, MoonIcon } from "@phosphor-icons/react";
|
|
137
|
-
import { CommandPalette } from "@g4rcez/components";
|
|
138
|
-
|
|
139
|
-
function GroupedCommandPalette() {
|
|
140
|
-
const [open, setOpen] = useState(false);
|
|
141
|
-
|
|
142
|
-
const commands = [
|
|
143
|
-
{
|
|
144
|
-
type: "group" as const,
|
|
145
|
-
title: "File Operations",
|
|
146
|
-
items: [
|
|
147
|
-
{
|
|
148
|
-
type: "shortcut" as const,
|
|
149
|
-
title: "New File",
|
|
150
|
-
hint: ["create", "new", "file"],
|
|
151
|
-
shortcut: "Ctrl+N",
|
|
152
|
-
Icon: <FileIcon size={16} />,
|
|
153
|
-
action: ({ setOpen }) => setOpen(false),
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
type: "shortcut" as const,
|
|
157
|
-
title: "Open File",
|
|
158
|
-
hint: ["open", "load"],
|
|
159
|
-
shortcut: "Ctrl+O",
|
|
160
|
-
Icon: <FolderOpenIcon size={16} />,
|
|
161
|
-
action: ({ setOpen }) => setOpen(false),
|
|
162
|
-
},
|
|
163
|
-
],
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
type: "group" as const,
|
|
167
|
-
title: "Navigation",
|
|
168
|
-
items: [
|
|
169
|
-
{
|
|
170
|
-
type: "shortcut" as const,
|
|
171
|
-
title: "Go to Dashboard",
|
|
172
|
-
hint: ["dashboard", "home", "main"],
|
|
173
|
-
Icon: <HouseIcon size={16} />,
|
|
174
|
-
action: ({ setOpen }) => {
|
|
175
|
-
window.location.href = "/dashboard";
|
|
176
|
-
setOpen(false);
|
|
177
|
-
},
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
type: "shortcut" as const,
|
|
181
|
-
title: "Go to Settings",
|
|
182
|
-
hint: ["settings", "preferences", "config"],
|
|
183
|
-
Icon: <GearIcon size={16} />,
|
|
184
|
-
action: ({ setOpen }) => {
|
|
185
|
-
window.location.href = "/settings";
|
|
186
|
-
setOpen(false);
|
|
187
|
-
},
|
|
188
|
-
},
|
|
189
|
-
],
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
type: "group" as const,
|
|
193
|
-
title: "Theme",
|
|
194
|
-
items: [
|
|
195
|
-
{
|
|
196
|
-
type: "shortcut" as const,
|
|
197
|
-
title: "Toggle Dark Mode",
|
|
198
|
-
hint: ["dark", "theme", "mode"],
|
|
199
|
-
Icon: <MoonIcon size={16} />,
|
|
200
|
-
action: ({ setOpen }) => {
|
|
201
|
-
document.documentElement.classList.toggle("dark");
|
|
202
|
-
setOpen(false);
|
|
203
|
-
},
|
|
204
|
-
},
|
|
205
|
-
],
|
|
206
|
-
},
|
|
207
|
-
];
|
|
208
|
-
|
|
209
|
-
return (
|
|
210
|
-
<CommandPalette
|
|
211
|
-
open={open}
|
|
212
|
-
commands={commands}
|
|
213
|
-
onChangeVisibility={setOpen}
|
|
214
|
-
emptyMessage="No commands found"
|
|
215
|
-
/>
|
|
216
|
-
);
|
|
217
|
-
}
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
### Custom Keyboard Shortcut
|
|
221
|
-
|
|
222
|
-
```tsx
|
|
223
|
-
<CommandPalette
|
|
224
|
-
open={open}
|
|
225
|
-
commands={commands}
|
|
226
|
-
onChangeVisibility={setOpen}
|
|
227
|
-
bind="Mod + /"
|
|
228
|
-
/>
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
### Conditional Commands
|
|
232
|
-
|
|
233
|
-
```tsx
|
|
234
|
-
import { UserIcon, ShieldIcon } from "@phosphor-icons/react";
|
|
235
|
-
|
|
236
|
-
const commands = [
|
|
237
|
-
{
|
|
238
|
-
type: "shortcut" as const,
|
|
239
|
-
title: "User Dashboard",
|
|
240
|
-
Icon: <UserIcon size={16} />,
|
|
241
|
-
action: ({ setOpen }) => setOpen(false),
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
type: "shortcut" as const,
|
|
245
|
-
title: "Admin Panel",
|
|
246
|
-
enabled: user.isAdmin,
|
|
247
|
-
Icon: <ShieldIcon size={16} />,
|
|
248
|
-
action: ({ setOpen }) => {
|
|
249
|
-
console.log("Opening admin panel");
|
|
250
|
-
setOpen(false);
|
|
251
|
-
},
|
|
252
|
-
},
|
|
253
|
-
];
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
## Do
|
|
257
|
-
|
|
258
|
-
- Use `hint` arrays to add synonyms so commands match varied search terms (e.g., `["preferences", "config"]` for a "Settings" command).
|
|
259
|
-
- Group related commands with `type: "group"` so users can scan results quickly.
|
|
260
|
-
- Provide a clear `emptyMessage` so users know when nothing matches.
|
|
261
|
-
- Keep command titles short; let `hint` carry the synonym load.
|
|
262
|
-
|
|
263
|
-
## Don't
|
|
264
|
-
|
|
265
|
-
- Don't put every action in the palette — focus on the most useful commands.
|
|
266
|
-
- Don't use raw Tailwind color classes (`bg-blue-500`, `text-white`) in custom `Icon` or `Preview` components — use design-token classes instead.
|
|
267
|
-
- Don't pass arbitrary Tailwind values (`bg-[#abc]`, `z-[9999]`) — override CSS variables in your `@theme` block.
|
|
268
|
-
- Don't omit the global shortcut — the default `Mod+K` is a strong convention users expect.
|
|
269
|
-
|
|
270
|
-
## Accessibility
|
|
271
|
-
|
|
272
|
-
- Full arrow-key navigation within the list with loop support.
|
|
273
|
-
- `Enter` executes the active command; `Escape` closes the palette.
|
|
274
|
-
- Each item renders with `role="option"` and `aria-selected` reflecting the active state.
|
|
275
|
-
- The palette is wrapped in a `Modal` with `ariaTitle="Command palette"` for screen readers.
|
|
276
|
-
- The search input receives `autoFocus` when the palette opens.
|
|
277
|
-
|
|
278
|
-
## Data Attributes
|
|
279
|
-
|
|
280
|
-
| Attribute | Applied to | Description |
|
|
281
|
-
|-----------|-----------|-------------|
|
|
282
|
-
| `data-component="command-palette"` | Root modal container | Identifies the palette root |
|
|
283
|
-
| `data-component="command-palette-list"` | `<ul>` | Identifies the command list |
|
|
284
|
-
| `data-component="command-palette-item"` | Each `<button>` item | Identifies individual command buttons |
|
|
285
|
-
| `data-component="command-palette-container"` | List/preview wrapper | Identifies the content area |
|
|
286
|
-
|
|
287
|
-
## Notes
|
|
288
|
-
|
|
289
|
-
- The component registers global keyboard listeners via `CombiKeys`. All `shortcut` commands are also registered as global hotkeys — they fire even when the palette is closed.
|
|
290
|
-
- Fuzzy search runs over `title`, `shortcut`, and `hint` fields. When `title` is a function, it is called with the current search text to produce a string for matching.
|
|
291
|
-
- Commands with `enabled: false` (or a function returning `false`) are filtered out of results.
|
|
292
|
-
- The `Preview` panel is shown only when `activeIndex` is set and a `Preview` component is provided.
|
|
293
|
-
- The palette is built on top of `Modal`, so it inherits modal accessibility and portal rendering.
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: DatePicker
|
|
3
|
-
description: Date input with locale-aware masked entry and a floating calendar dropdown for visual selection.
|
|
4
|
-
package: "@g4rcez/components"
|
|
5
|
-
export: "{ DatePicker }"
|
|
6
|
-
import: "import { DatePicker } from '@g4rcez/components/date-picker'"
|
|
7
|
-
category: form
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# DatePicker
|
|
11
|
-
|
|
12
|
-
Date input with locale-aware masked entry and a floating calendar dropdown for visual selection.
|
|
13
|
-
|
|
14
|
-
## Import
|
|
15
|
-
|
|
16
|
-
```tsx
|
|
17
|
-
import { DatePicker } from "@g4rcez/components/date-picker";
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Props
|
|
21
|
-
|
|
22
|
-
`DatePicker` inherits all `Input` and `Calendar` props. Notable additions:
|
|
23
|
-
|
|
24
|
-
| Prop | Type | Default | Description |
|
|
25
|
-
|------|------|---------|-------------|
|
|
26
|
-
| `date` | `Date` | - | Controlled selected date |
|
|
27
|
-
| `type` | `"date" \| "datetime"` | `"date"` | Whether to include time (hour + minute) selection |
|
|
28
|
-
| `floating` | `boolean` | `true` | Show the calendar in a floating `Dropdown`; set to `false` to embed it inline |
|
|
29
|
-
| `clickToClose` | `boolean` | `false` | Close the calendar immediately after a date is picked |
|
|
30
|
-
| `locale` | `Locales` | system locale | Locale for mask generation and calendar display |
|
|
31
|
-
| `markToday` | `boolean` | `true` | Highlight today in the calendar |
|
|
32
|
-
| `disabledDate` | `(date: Date) => boolean` | - | Callback that returns `true` for dates that should be unselectable |
|
|
33
|
-
| `onChange` | `(date: Date \| undefined) => void` | - | Called with the new `Date` when input is valid, or `undefined` when cleared |
|
|
34
|
-
| `title` | `string` | - | Field label |
|
|
35
|
-
| `error` | `string` | - | Error message shown below the field |
|
|
36
|
-
| `required` | `boolean` | `true` | Marks field as required (default is `true` for DatePicker) |
|
|
37
|
-
| `name` | `string` | - | Form field name — also the `id` of the hidden `<input type="date">` |
|
|
38
|
-
|
|
39
|
-
## Design Tokens
|
|
40
|
-
|
|
41
|
-
Tokens this component reads. Customize by overriding these CSS variables in your theme.
|
|
42
|
-
|
|
43
|
-
| Token | CSS Variable | Purpose |
|
|
44
|
-
|-------|-------------|---------|
|
|
45
|
-
| `h-input-height` | `--input-height` | Input height |
|
|
46
|
-
| `px-input-x` | `--input-x` | Horizontal input padding |
|
|
47
|
-
| `py-input-y` | `--input-y` | Vertical input padding |
|
|
48
|
-
| `border-input-border` | `--input-border` | Default border color |
|
|
49
|
-
| `text-foreground` | `--foreground` | Input text color |
|
|
50
|
-
| `text-primary` | `--primary` | Focus ring and border on focus/hover |
|
|
51
|
-
| `text-danger` | `--danger` | Error state text and border |
|
|
52
|
-
| `placeholder-input-mask` | `--input-mask` | Placeholder text color |
|
|
53
|
-
| `bg-floating-background` | `--floating-background` | Calendar dropdown background |
|
|
54
|
-
| `border-floating-border` | `--floating-border` | Calendar dropdown border |
|
|
55
|
-
|
|
56
|
-
## Examples
|
|
57
|
-
|
|
58
|
-
### Basic date picker
|
|
59
|
-
|
|
60
|
-
```tsx
|
|
61
|
-
import { DatePicker } from "@g4rcez/components/date-picker";
|
|
62
|
-
|
|
63
|
-
<DatePicker
|
|
64
|
-
name="birthdate"
|
|
65
|
-
title="Date of birth"
|
|
66
|
-
/>
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### Date and time
|
|
70
|
-
|
|
71
|
-
```tsx
|
|
72
|
-
<DatePicker
|
|
73
|
-
name="appointment"
|
|
74
|
-
title="Appointment time"
|
|
75
|
-
type="datetime"
|
|
76
|
-
clickToClose
|
|
77
|
-
/>
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### Disabling past dates
|
|
81
|
-
|
|
82
|
-
```tsx
|
|
83
|
-
import { isBefore, startOfDay } from "date-fns";
|
|
84
|
-
|
|
85
|
-
<DatePicker
|
|
86
|
-
name="event_date"
|
|
87
|
-
title="Event date"
|
|
88
|
-
disabledDate={(date) => isBefore(date, startOfDay(new Date()))}
|
|
89
|
-
/>
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### Controlled value
|
|
93
|
-
|
|
94
|
-
```tsx
|
|
95
|
-
const [date, setDate] = useState<Date | undefined>();
|
|
96
|
-
|
|
97
|
-
<DatePicker
|
|
98
|
-
name="due_date"
|
|
99
|
-
title="Due date"
|
|
100
|
-
date={date}
|
|
101
|
-
onChange={setDate}
|
|
102
|
-
/>
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
### Inline calendar (no dropdown)
|
|
106
|
-
|
|
107
|
-
```tsx
|
|
108
|
-
<DatePicker
|
|
109
|
-
name="check_in"
|
|
110
|
-
title="Check-in"
|
|
111
|
-
floating={false}
|
|
112
|
-
/>
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
### Inside a form
|
|
116
|
-
|
|
117
|
-
```tsx
|
|
118
|
-
import { Form } from "@g4rcez/components/form";
|
|
119
|
-
import { Button } from "@g4rcez/components/button";
|
|
120
|
-
|
|
121
|
-
function BookingForm() {
|
|
122
|
-
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
|
|
123
|
-
const data = new FormData(e.currentTarget);
|
|
124
|
-
console.log(data.get("check_in"), data.get("check_out"));
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
return (
|
|
128
|
-
<Form onSubmit={handleSubmit} className="flex flex-col gap-base">
|
|
129
|
-
<DatePicker name="check_in" title="Check-in" />
|
|
130
|
-
<DatePicker name="check_out" title="Check-out" />
|
|
131
|
-
<Button theme="primary" type="submit">Book</Button>
|
|
132
|
-
</Form>
|
|
133
|
-
);
|
|
134
|
-
}
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
## Do
|
|
138
|
-
|
|
139
|
-
- Use `disabledDate` to prevent invalid date selection (e.g., past dates for future bookings).
|
|
140
|
-
- Use `type="datetime"` when both date and time are required for the use case.
|
|
141
|
-
- Provide a clear `title` label.
|
|
142
|
-
- Rely on `locale` for locale-aware mask and calendar generation rather than hardcoding a format.
|
|
143
|
-
|
|
144
|
-
## Don't
|
|
145
|
-
|
|
146
|
-
- Don't pass raw Tailwind color classes (`bg-blue-500`, `text-white`, `border-gray-300`) — use theme props or design tokens instead.
|
|
147
|
-
- Don't use arbitrary Tailwind values (`bg-[#abc]`, `bg-[--my-var]`) — override CSS variables in your `@theme` block instead.
|
|
148
|
-
- Don't use `DatePicker` when only a year or only a month is needed — a `Select` is more appropriate.
|
|
149
|
-
- Don't assume users will always use the calendar; the masked text input must also be keyboard-friendly.
|
|
150
|
-
|
|
151
|
-
## Accessibility
|
|
152
|
-
|
|
153
|
-
- The calendar icon button includes an `aria-describedby` referencing a visually-hidden `<span>` with a translatable label.
|
|
154
|
-
- The underlying `Input` component handles `aria-disabled`, `aria-readonly`, and `aria-busy`.
|
|
155
|
-
- The calendar (`Calendar` component) is fully keyboard-navigable.
|
|
156
|
-
- The input is masked to prevent invalid character entry, reducing validation friction.
|
|
157
|
-
- Follows the standard `fieldset > label` structure from `InputField`.
|
|
158
|
-
|
|
159
|
-
## Data Attributes
|
|
160
|
-
|
|
161
|
-
- `data-component="date-picker"` — on the visible `Input`.
|
|
162
|
-
- `data-value` — ISO string representation of the selected date (set on the visible input).
|
|
163
|
-
- `data-target` — mirrors the `name` prop; used to link the shadow input to the hidden field.
|
|
164
|
-
- `data-origin` — on the hidden `<input type="date">`: its `name` value, used by `formReset`.
|
|
165
|
-
|
|
166
|
-
## Notes
|
|
167
|
-
|
|
168
|
-
- The component renders two inputs: a visible masked `Input` for user interaction and a hidden `<input type="date">` (with `name`) for native form submission.
|
|
169
|
-
- The input mask is generated dynamically from `Intl.DateTimeFormat.formatToParts`, so it automatically reflects the locale's date order (e.g., MM/DD/YYYY vs DD/MM/YYYY).
|
|
170
|
-
- Date parsing uses `date-fns`. The `placeholder` is derived from the same locale format string.
|
|
171
|
-
- When `floating={true}` (default), the calendar is rendered in a `Dropdown` using `@floating-ui/react` positioned to the right of the input.
|