@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
|
@@ -19,12 +19,12 @@ import { RenderOnView } from "@g4rcez/components";
|
|
|
19
19
|
|
|
20
20
|
## Props
|
|
21
21
|
|
|
22
|
-
| Prop
|
|
23
|
-
|
|
24
|
-
| `onIntersection` | `() => void`
|
|
25
|
-
| `children`
|
|
26
|
-
| `as`
|
|
27
|
-
| `...props`
|
|
22
|
+
| Prop | Type | Default | Description |
|
|
23
|
+
| ---------------- | ----------------------------------- | ------- | ---------------------------------------------------------------- |
|
|
24
|
+
| `onIntersection` | `() => void` | - | Callback fired once when the container first enters the viewport |
|
|
25
|
+
| `children` | `React.ReactNode` | - | Content to render when the container is visible |
|
|
26
|
+
| `as` | `React.ElementType` | `"div"` | HTML element to render the container as |
|
|
27
|
+
| `...props` | `React.ComponentPropsWithoutRef<T>` | - | All props valid for the chosen element type |
|
|
28
28
|
|
|
29
29
|
## Design Tokens
|
|
30
30
|
|
|
@@ -44,13 +44,11 @@ None — `RenderOnView` is a layout/performance primitive that applies no styles
|
|
|
44
44
|
|
|
45
45
|
```tsx
|
|
46
46
|
<div>
|
|
47
|
-
|
|
48
|
-
Scroll down to see lazy content
|
|
49
|
-
</div>
|
|
47
|
+
<div className="h-screen flex items-center justify-center text-foreground">Scroll down to see lazy content</div>
|
|
50
48
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
<RenderOnView>
|
|
50
|
+
<ExpensiveChart data={largeDataset} />
|
|
51
|
+
</RenderOnView>
|
|
54
52
|
</div>
|
|
55
53
|
```
|
|
56
54
|
|
|
@@ -58,11 +56,7 @@ None — `RenderOnView` is a layout/performance primitive that applies no styles
|
|
|
58
56
|
|
|
59
57
|
```tsx
|
|
60
58
|
const TrackableSection = ({ sectionName, children }: { sectionName: string; children: React.ReactNode }) => (
|
|
61
|
-
|
|
62
|
-
onIntersection={() => analytics.track("Section Viewed", { section: sectionName })}
|
|
63
|
-
>
|
|
64
|
-
{children}
|
|
65
|
-
</RenderOnView>
|
|
59
|
+
<RenderOnView onIntersection={() => analytics.track("Section Viewed", { section: sectionName })}>{children}</RenderOnView>
|
|
66
60
|
);
|
|
67
61
|
```
|
|
68
62
|
|
|
@@ -70,19 +64,19 @@ const TrackableSection = ({ sectionName, children }: { sectionName: string; chil
|
|
|
70
64
|
|
|
71
65
|
```tsx
|
|
72
66
|
<main>
|
|
73
|
-
|
|
67
|
+
<HeroSection />
|
|
74
68
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
69
|
+
<RenderOnView>
|
|
70
|
+
<FeaturesSection />
|
|
71
|
+
</RenderOnView>
|
|
78
72
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
73
|
+
<RenderOnView>
|
|
74
|
+
<TestimonialsSection />
|
|
75
|
+
</RenderOnView>
|
|
82
76
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
77
|
+
<RenderOnView>
|
|
78
|
+
<ContactForm />
|
|
79
|
+
</RenderOnView>
|
|
86
80
|
</main>
|
|
87
81
|
```
|
|
88
82
|
|
|
@@ -90,7 +84,7 @@ const TrackableSection = ({ sectionName, children }: { sectionName: string; chil
|
|
|
90
84
|
|
|
91
85
|
```tsx
|
|
92
86
|
<RenderOnView as="section" aria-label="Analytics charts">
|
|
93
|
-
|
|
87
|
+
<RevenueChart />
|
|
94
88
|
</RenderOnView>
|
|
95
89
|
```
|
|
96
90
|
|
|
@@ -103,10 +97,10 @@ import { Spinner } from "@g4rcez/components";
|
|
|
103
97
|
const HeavyComponent = lazy(() => import("./HeavyComponent"));
|
|
104
98
|
|
|
105
99
|
<RenderOnView>
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
</RenderOnView
|
|
100
|
+
<Suspense fallback={<Spinner />}>
|
|
101
|
+
<HeavyComponent />
|
|
102
|
+
</Suspense>
|
|
103
|
+
</RenderOnView>;
|
|
110
104
|
```
|
|
111
105
|
|
|
112
106
|
## Do
|
|
@@ -19,9 +19,9 @@ import { Resizable } 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` | - | Content rendered inside the animated container |
|
|
25
25
|
|
|
26
26
|
## Design Tokens
|
|
27
27
|
|
|
@@ -42,27 +42,23 @@ None — `Resizable` is a layout animation primitive that applies no color or sp
|
|
|
42
42
|
import { useState } from "react";
|
|
43
43
|
|
|
44
44
|
const CollapsiblePanel = () => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
) : null}
|
|
63
|
-
</Resizable>
|
|
64
|
-
</div>
|
|
65
|
-
);
|
|
45
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<div className="border border-border rounded-card">
|
|
49
|
+
<button type="button" className="w-full px-4 py-3 text-left font-medium text-foreground" onClick={() => setIsOpen((v) => !v)}>
|
|
50
|
+
Toggle Details
|
|
51
|
+
</button>
|
|
52
|
+
<Resizable>
|
|
53
|
+
{isOpen ? (
|
|
54
|
+
<div className="px-4 pb-4 text-foreground">
|
|
55
|
+
<p>This content expands and collapses with a smooth height animation.</p>
|
|
56
|
+
<p>Additional paragraphs will also animate smoothly.</p>
|
|
57
|
+
</div>
|
|
58
|
+
) : null}
|
|
59
|
+
</Resizable>
|
|
60
|
+
</div>
|
|
61
|
+
);
|
|
66
62
|
};
|
|
67
63
|
```
|
|
68
64
|
|
|
@@ -73,27 +69,24 @@ import { useState } from "react";
|
|
|
73
69
|
import { Button } from "@g4rcez/components/button";
|
|
74
70
|
|
|
75
71
|
const GrowingList = () => {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
</
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
</Resizable>
|
|
95
|
-
</div>
|
|
96
|
-
);
|
|
72
|
+
const [items, setItems] = useState(["Item 1"]);
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<div className="flex flex-col gap-base">
|
|
76
|
+
<Button theme="primary" onClick={() => setItems((prev) => [...prev, `Item ${prev.length + 1}`])}>
|
|
77
|
+
Add Item
|
|
78
|
+
</Button>
|
|
79
|
+
<Resizable>
|
|
80
|
+
<ul className="flex flex-col gap-sm">
|
|
81
|
+
{items.map((item) => (
|
|
82
|
+
<li key={item} className="text-foreground">
|
|
83
|
+
{item}
|
|
84
|
+
</li>
|
|
85
|
+
))}
|
|
86
|
+
</ul>
|
|
87
|
+
</Resizable>
|
|
88
|
+
</div>
|
|
89
|
+
);
|
|
97
90
|
};
|
|
98
91
|
```
|
|
99
92
|
|
|
@@ -101,13 +94,13 @@ const GrowingList = () => {
|
|
|
101
94
|
|
|
102
95
|
```tsx
|
|
103
96
|
const TabbedContent = ({ activeTab }: { activeTab: string }) => (
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
97
|
+
<Resizable>
|
|
98
|
+
<div className="p-4 text-foreground">
|
|
99
|
+
{activeTab === "overview" && <OverviewPanel />}
|
|
100
|
+
{activeTab === "settings" && <SettingsPanel />}
|
|
101
|
+
{activeTab === "history" && <HistoryPanel />}
|
|
102
|
+
</div>
|
|
103
|
+
</Resizable>
|
|
111
104
|
);
|
|
112
105
|
```
|
|
113
106
|
|
|
@@ -115,19 +108,21 @@ const TabbedContent = ({ activeTab }: { activeTab: string }) => (
|
|
|
115
108
|
|
|
116
109
|
```tsx
|
|
117
110
|
const AsyncCard = ({ data }: { data: string[] | null }) => (
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
111
|
+
<div className="rounded-card border border-border bg-card-background shadow-shadow-card">
|
|
112
|
+
<Resizable>
|
|
113
|
+
{data === null ? (
|
|
114
|
+
<div className="p-4 text-muted-foreground">Loading…</div>
|
|
115
|
+
) : (
|
|
116
|
+
<ul className="p-4 flex flex-col gap-sm">
|
|
117
|
+
{data.map((item) => (
|
|
118
|
+
<li key={item} className="text-foreground">
|
|
119
|
+
{item}
|
|
120
|
+
</li>
|
|
121
|
+
))}
|
|
122
|
+
</ul>
|
|
123
|
+
)}
|
|
124
|
+
</Resizable>
|
|
125
|
+
</div>
|
|
131
126
|
);
|
|
132
127
|
```
|
|
133
128
|
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Select
|
|
3
|
+
description: Styled native select component with validation, loading state, and form integration.
|
|
4
|
+
package: "@g4rcez/components"
|
|
5
|
+
export: "{ Select }"
|
|
6
|
+
import: "import { Select } from '@g4rcez/components/select'"
|
|
7
|
+
category: form
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Select
|
|
11
|
+
|
|
12
|
+
Styled native select component with validation, loading state, and form integration.
|
|
13
|
+
|
|
14
|
+
## Import
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import { Select } from "@g4rcez/components/select";
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Props
|
|
21
|
+
|
|
22
|
+
| Prop | Type | Default | Description |
|
|
23
|
+
| -------------------- | --------------------------------------------- | ------- | ------------------------------------------------------------ |
|
|
24
|
+
| `options` | `OptionProps[]` | — | Array of option objects. |
|
|
25
|
+
| `selectContainer` | `string` | `""` | Additional CSS classes for the select container. |
|
|
26
|
+
| `required` | `boolean` | `true` | Whether the field is required. |
|
|
27
|
+
| `error` | `string` | — | Error message to display. |
|
|
28
|
+
| `loading` | `boolean` | `false` | Shows a loading indicator and disables the field. |
|
|
29
|
+
| `disabled` | `boolean` | `false` | Disables the select. |
|
|
30
|
+
| `placeholder` | `string` | — | Placeholder shown as a disabled hidden option. |
|
|
31
|
+
| `value` | `string` | — | Controlled selected value. |
|
|
32
|
+
| `onChange` | `(e: ChangeEvent<HTMLSelectElement>) => void` | — | Change handler. |
|
|
33
|
+
| `...inputFieldProps` | `InputFieldProps` | — | All `InputField` props (title, left, right, feedback, etc.). |
|
|
34
|
+
|
|
35
|
+
### OptionProps
|
|
36
|
+
|
|
37
|
+
| Prop | Type | Description |
|
|
38
|
+
| -------------- | --------- | ------------------------------------------------------- |
|
|
39
|
+
| `value` | `string` | Option value (required). |
|
|
40
|
+
| `label` | `string` | Display text (falls back to `value` if omitted). |
|
|
41
|
+
| `disabled` | `boolean` | Disables this individual option. |
|
|
42
|
+
| `data-dynamic` | `string` | Marks a dynamically generated option. |
|
|
43
|
+
| `data-*` | `string` | Any custom data attributes forwarded to the `<option>`. |
|
|
44
|
+
|
|
45
|
+
## Design Tokens
|
|
46
|
+
|
|
47
|
+
Tokens this component reads. Customize by overriding these CSS variables in your theme.
|
|
48
|
+
|
|
49
|
+
| Token | CSS Variable | Purpose |
|
|
50
|
+
| ----------------------------------------- | --------------------- | -------------------------------- |
|
|
51
|
+
| `text-foreground` | `--foreground` | Selected option text color |
|
|
52
|
+
| `text-input-placeholder` | `--input-placeholder` | Color when no option is selected |
|
|
53
|
+
| `placeholder-input-placeholder` | `--input-placeholder` | Placeholder styling |
|
|
54
|
+
| `bg-input-mask-error` (via `group-error`) | `--input-mask-error` | Placeholder tint in error state |
|
|
55
|
+
| `text-danger` (via `group-error`) | `--danger` | Text color in error state |
|
|
56
|
+
| `hover:text-primary` | `--primary` | Caret icon hover color |
|
|
57
|
+
| `h-input-height` | `--input-height` | Control height (2.5 rem) |
|
|
58
|
+
| `px-input-x` | `--input-x` | Horizontal padding |
|
|
59
|
+
| `py-input-y` | `--input-y` | Vertical padding |
|
|
60
|
+
|
|
61
|
+
## Examples
|
|
62
|
+
|
|
63
|
+
### Basic usage
|
|
64
|
+
|
|
65
|
+
```tsx
|
|
66
|
+
import { useState } from "react";
|
|
67
|
+
import { Select } from "@g4rcez/components/select";
|
|
68
|
+
|
|
69
|
+
export default function FruitPicker() {
|
|
70
|
+
const [value, setValue] = useState("");
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<Select
|
|
74
|
+
title="Fruit"
|
|
75
|
+
options={[
|
|
76
|
+
{ value: "apple", label: "Apple" },
|
|
77
|
+
{ value: "banana", label: "Banana" },
|
|
78
|
+
{ value: "orange", label: "Orange" },
|
|
79
|
+
]}
|
|
80
|
+
placeholder="Select a fruit"
|
|
81
|
+
value={value}
|
|
82
|
+
onChange={(e) => setValue(e.target.value)}
|
|
83
|
+
/>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### With validation error
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
import { useState } from "react";
|
|
92
|
+
import { Select } from "@g4rcez/components/select";
|
|
93
|
+
|
|
94
|
+
export default function CountrySelect() {
|
|
95
|
+
const [country, setCountry] = useState("");
|
|
96
|
+
const [error, setError] = useState("");
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<Select
|
|
100
|
+
title="Country"
|
|
101
|
+
options={[
|
|
102
|
+
{ value: "us", label: "United States" },
|
|
103
|
+
{ value: "ca", label: "Canada" },
|
|
104
|
+
{ value: "uk", label: "United Kingdom" },
|
|
105
|
+
]}
|
|
106
|
+
placeholder="Select country"
|
|
107
|
+
value={country}
|
|
108
|
+
error={error}
|
|
109
|
+
required
|
|
110
|
+
onChange={(e) => {
|
|
111
|
+
setCountry(e.target.value);
|
|
112
|
+
setError(e.target.value ? "" : "Please select a country");
|
|
113
|
+
}}
|
|
114
|
+
/>
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### With disabled options
|
|
120
|
+
|
|
121
|
+
```tsx
|
|
122
|
+
import { Select } from "@g4rcez/components/select";
|
|
123
|
+
|
|
124
|
+
export default function StatusSelect() {
|
|
125
|
+
return (
|
|
126
|
+
<Select
|
|
127
|
+
title="Status"
|
|
128
|
+
options={[
|
|
129
|
+
{ value: "active", label: "Active" },
|
|
130
|
+
{ value: "pending", label: "Pending" },
|
|
131
|
+
{ value: "legacy", label: "Legacy (deprecated)", disabled: true },
|
|
132
|
+
{ value: "inactive", label: "Inactive" },
|
|
133
|
+
]}
|
|
134
|
+
placeholder="Select status"
|
|
135
|
+
/>
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Async options with loading state
|
|
141
|
+
|
|
142
|
+
```tsx
|
|
143
|
+
import { useEffect, useState } from "react";
|
|
144
|
+
import { Select } from "@g4rcez/components/select";
|
|
145
|
+
|
|
146
|
+
export default function AsyncSelect() {
|
|
147
|
+
const [options, setOptions] = useState<{ value: string; label: string }[]>([]);
|
|
148
|
+
const [loading, setLoading] = useState(false);
|
|
149
|
+
const [value, setValue] = useState("");
|
|
150
|
+
|
|
151
|
+
useEffect(() => {
|
|
152
|
+
setLoading(true);
|
|
153
|
+
fetchOptions().then((data) => {
|
|
154
|
+
setOptions(data);
|
|
155
|
+
setLoading(false);
|
|
156
|
+
});
|
|
157
|
+
}, []);
|
|
158
|
+
|
|
159
|
+
return (
|
|
160
|
+
<Select
|
|
161
|
+
title="Region"
|
|
162
|
+
options={options}
|
|
163
|
+
placeholder={loading ? "Loading..." : "Select a region"}
|
|
164
|
+
value={value}
|
|
165
|
+
loading={loading}
|
|
166
|
+
disabled={loading}
|
|
167
|
+
onChange={(e) => setValue(e.target.value)}
|
|
168
|
+
/>
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Form integration with `useForm`
|
|
174
|
+
|
|
175
|
+
```tsx
|
|
176
|
+
import { Select } from "@g4rcez/components/select";
|
|
177
|
+
import { useForm } from "@g4rcez/components/form";
|
|
178
|
+
|
|
179
|
+
export default function UserForm() {
|
|
180
|
+
const form = useForm(schema, "userForm");
|
|
181
|
+
|
|
182
|
+
return (
|
|
183
|
+
<form {...form.props}>
|
|
184
|
+
<Select
|
|
185
|
+
{...form.select("role")}
|
|
186
|
+
options={[
|
|
187
|
+
{ value: "admin", label: "Administrator" },
|
|
188
|
+
{ value: "editor", label: "Editor" },
|
|
189
|
+
{ value: "viewer", label: "Viewer" },
|
|
190
|
+
]}
|
|
191
|
+
placeholder="Select role"
|
|
192
|
+
/>
|
|
193
|
+
</form>
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Cascading selects
|
|
199
|
+
|
|
200
|
+
```tsx
|
|
201
|
+
import { useState } from "react";
|
|
202
|
+
import { Select } from "@g4rcez/components/select";
|
|
203
|
+
|
|
204
|
+
const subcategories: Record<string, { value: string; label: string }[]> = {
|
|
205
|
+
electronics: [
|
|
206
|
+
{ value: "phones", label: "Phones" },
|
|
207
|
+
{ value: "laptops", label: "Laptops" },
|
|
208
|
+
],
|
|
209
|
+
clothing: [
|
|
210
|
+
{ value: "shirts", label: "Shirts" },
|
|
211
|
+
{ value: "pants", label: "Pants" },
|
|
212
|
+
],
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
export default function CascadingSelect() {
|
|
216
|
+
const [category, setCategory] = useState("");
|
|
217
|
+
const [subcategory, setSubcategory] = useState("");
|
|
218
|
+
|
|
219
|
+
return (
|
|
220
|
+
<div className="flex flex-col gap-base">
|
|
221
|
+
<Select
|
|
222
|
+
title="Category"
|
|
223
|
+
options={[
|
|
224
|
+
{ value: "electronics", label: "Electronics" },
|
|
225
|
+
{ value: "clothing", label: "Clothing" },
|
|
226
|
+
]}
|
|
227
|
+
placeholder="Select category"
|
|
228
|
+
value={category}
|
|
229
|
+
onChange={(e) => {
|
|
230
|
+
setCategory(e.target.value);
|
|
231
|
+
setSubcategory("");
|
|
232
|
+
}}
|
|
233
|
+
/>
|
|
234
|
+
|
|
235
|
+
{category && (
|
|
236
|
+
<Select
|
|
237
|
+
title="Subcategory"
|
|
238
|
+
options={subcategories[category] ?? []}
|
|
239
|
+
placeholder="Select subcategory"
|
|
240
|
+
value={subcategory}
|
|
241
|
+
onChange={(e) => setSubcategory(e.target.value)}
|
|
242
|
+
/>
|
|
243
|
+
)}
|
|
244
|
+
</div>
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## Do
|
|
250
|
+
|
|
251
|
+
- Use descriptive `label` values for each option.
|
|
252
|
+
- Order options logically (alphabetically or by usage frequency).
|
|
253
|
+
- Provide a `placeholder` so users know what to select.
|
|
254
|
+
- Use `loading` and `disabled` together while fetching options asynchronously.
|
|
255
|
+
- Use design-token classes for wrapper elements (`bg-background`, `text-foreground`, `border-border`).
|
|
256
|
+
|
|
257
|
+
## Don't
|
|
258
|
+
|
|
259
|
+
- Don't use `Select` for only 2–3 options — prefer `Radiobox` or `Switch` for better visibility.
|
|
260
|
+
- Don't use `Select` for large searchable lists — use `Autocomplete` instead.
|
|
261
|
+
- Don't use long option labels that may truncate on small viewports.
|
|
262
|
+
- Don't pass raw Tailwind color classes (`bg-blue-500`, `text-white`, `border-gray-300`) — use design tokens instead.
|
|
263
|
+
- Don't use arbitrary Tailwind values (`bg-[#abc]`, `bg-[--my-var]`) — override CSS variables in your `@theme` block instead.
|
|
264
|
+
|
|
265
|
+
## Accessibility
|
|
266
|
+
|
|
267
|
+
- Uses a native `<select>` element for full keyboard support and screen-reader compatibility.
|
|
268
|
+
- The `placeholder` renders as a `disabled hidden` option so it is never submitted.
|
|
269
|
+
- A `CaretDownIcon` caret is rendered inside a `<label>` pointing to the select id, giving it a larger click target.
|
|
270
|
+
- `data-selected` is set to `"false"` until the user selects an option, which toggles the placeholder color class.
|
|
271
|
+
|
|
272
|
+
## Data Attributes
|
|
273
|
+
|
|
274
|
+
| Attribute | Element | Value | Description |
|
|
275
|
+
| ---------------- | ----------------- | ------------------- | --------------------------------------------- |
|
|
276
|
+
| `data-component` | `InputField` root | `"select"` | Identifies the component. |
|
|
277
|
+
| `data-selected` | `<select>` | `"true" \| "false"` | Whether a non-placeholder option is selected. |
|
|
278
|
+
|
|
279
|
+
## Notes
|
|
280
|
+
|
|
281
|
+
- Built on `InputField` for layout, label, error, and loading handling.
|
|
282
|
+
- Supports all standard HTML `<select>` attributes via prop spread.
|
|
283
|
+
- `required` defaults to `true` — pass `required={false}` when the field is optional.
|
|
284
|
+
- Custom data attributes on `OptionProps` (e.g., `data-price`) are forwarded to each `<option>` and accessible via `e.target.selectedOptions[0].dataset`.
|
|
@@ -19,9 +19,9 @@ import { Shortcut } from "@g4rcez/components";
|
|
|
19
19
|
|
|
20
20
|
## Props
|
|
21
21
|
|
|
22
|
-
| Prop
|
|
23
|
-
|
|
24
|
-
| `value` | `string` | —
|
|
22
|
+
| Prop | Type | Default | Description |
|
|
23
|
+
| ------- | -------- | ------- | ------------------------------------------------------------------- |
|
|
24
|
+
| `value` | `string` | — | Shortcut string to display, e.g. `"Mod + K"` or `"Shift + Alt + P"` |
|
|
25
25
|
|
|
26
26
|
## Design Tokens
|
|
27
27
|
|
|
@@ -31,10 +31,10 @@ The `Shortcut` component inherits text color and size from its parent. No compon
|
|
|
31
31
|
|
|
32
32
|
The component automatically maps keys based on the user's operating system:
|
|
33
33
|
|
|
34
|
-
| Key token | macOS
|
|
35
|
-
|
|
36
|
-
| `Mod`
|
|
37
|
-
| `Alt`
|
|
34
|
+
| Key token | macOS | Other |
|
|
35
|
+
| --------- | ------------------------------ | ------ |
|
|
36
|
+
| `Mod` | `⌘` (CommandIcon, `size={12}`) | `Ctrl` |
|
|
37
|
+
| `Alt` | `⌥` (OptionIcon, `size={12}`) | `Alt` |
|
|
38
38
|
|
|
39
39
|
All other key tokens are rendered as-is.
|
|
40
40
|
|
|
@@ -50,9 +50,9 @@ All other key tokens are rendered as-is.
|
|
|
50
50
|
|
|
51
51
|
```tsx
|
|
52
52
|
<Tooltip title="Save changes">
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
<div className="flex gap-2 items-center">
|
|
54
|
+
Save <Shortcut value="Mod + S" />
|
|
55
|
+
</div>
|
|
56
56
|
</Tooltip>
|
|
57
57
|
```
|
|
58
58
|
|
|
@@ -60,8 +60,8 @@ All other key tokens are rendered as-is.
|
|
|
60
60
|
|
|
61
61
|
```tsx
|
|
62
62
|
<div className="flex items-center justify-between w-full">
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
<span>Open command palette</span>
|
|
64
|
+
<Shortcut value="Mod + K" />
|
|
65
65
|
</div>
|
|
66
66
|
```
|
|
67
67
|
|
|
@@ -76,8 +76,8 @@ All other key tokens are rendered as-is.
|
|
|
76
76
|
|
|
77
77
|
```tsx
|
|
78
78
|
<div className="flex items-center justify-between px-4 py-2">
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
<span className="text-foreground">New File</span>
|
|
80
|
+
<Shortcut value="Mod + N" />
|
|
81
81
|
</div>
|
|
82
82
|
```
|
|
83
83
|
|