@g4rcez/components 4.1.3 → 5.0.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/docs/AnimatedList.md +1 -1
- package/ai/docs/Autocomplete.md +2 -2
- package/ai/docs/Button.md +1 -1
- package/ai/docs/Card.md +7 -7
- package/ai/docs/DatePicker.md +2 -2
- package/ai/docs/Dropdown.md +7 -7
- package/ai/docs/Expand.md +5 -5
- package/ai/docs/Input.md +3 -3
- package/ai/docs/InputField.md +24 -14
- package/ai/docs/List.md +1 -1
- package/ai/docs/Modal.md +4 -4
- package/ai/docs/MultiSelect.md +2 -2
- package/ai/docs/PageCalendar.md +2 -2
- package/ai/docs/Polymorph.md +1 -1
- package/ai/docs/Resizable.md +3 -3
- package/ai/docs/Select.md +2 -2
- package/ai/docs/Skeleton.md +1 -1
- package/ai/docs/Slot.md +3 -3
- package/ai/docs/Spinner.md +1 -1
- package/ai/docs/Stats.md +1 -1
- package/ai/docs/Step.md +1 -1
- package/ai/docs/Tabs.md +1 -1
- package/ai/docs/Tag.md +1 -1
- package/ai/docs/TaskList.md +3 -3
- package/ai/docs/Textarea.md +2 -2
- package/ai/docs/Tooltip.md +13 -9
- package/ai/docs/Typography.md +1 -1
- package/ai/docs/index.md +17 -17
- package/dist/CaretDown.es-BXl0Ixp3.js +23 -0
- package/dist/CaretDown.es-BXl0Ixp3.js.map +1 -0
- package/dist/CaretRight.es-B2mpMfqU.js +23 -0
- package/dist/CaretRight.es-B2mpMfqU.js.map +1 -0
- package/dist/CheckCircle.es-BB91gLT-.js +23 -0
- package/dist/CheckCircle.es-BB91gLT-.js.map +1 -0
- package/dist/File.es-CjNVQ00B.js +23 -0
- package/dist/File.es-CjNVQ00B.js.map +1 -0
- package/dist/IconBase.es-BlJQ9IXo.js +27 -0
- package/dist/IconBase.es-BlJQ9IXo.js.map +1 -0
- package/dist/Info.es-Dvln8pws.js +23 -0
- package/dist/Info.es-Dvln8pws.js.map +1 -0
- package/dist/MotionConfig-DKKYqBH2.js +27 -0
- package/dist/MotionConfig-DKKYqBH2.js.map +1 -0
- package/dist/MotionConfigContext-BORpSKe8.js +2571 -0
- package/dist/MotionConfigContext-BORpSKe8.js.map +1 -0
- package/dist/Warning.es-B_xCn-P5.js +23 -0
- package/dist/Warning.es-B_xCn-P5.js.map +1 -0
- package/dist/X.es-Cjq2a_OA.js +23 -0
- package/dist/X.es-Cjq2a_OA.js.map +1 -0
- package/dist/animate-BNYgkk_j.js +387 -0
- package/dist/animate-BNYgkk_j.js.map +1 -0
- package/dist/autocomplete-D3VOTihi.js +415 -0
- package/dist/autocomplete-D3VOTihi.js.map +1 -0
- package/dist/calendar-PCCZDUIL.js +1678 -0
- package/dist/calendar-PCCZDUIL.js.map +1 -0
- package/dist/components/core/button.js +75 -75
- package/dist/components/core/button.js.map +1 -1
- package/dist/components/core/tag.js +66 -66
- package/dist/components/core/tag.js.map +1 -1
- package/dist/components/display/alert.js +133 -95
- package/dist/components/display/alert.js.map +1 -1
- package/dist/components/display/calendar.js +3 -15
- package/dist/components/display/card.js +73 -82
- package/dist/components/display/card.js.map +1 -1
- package/dist/components/display/list.js +153 -93
- package/dist/components/display/list.js.map +1 -1
- package/dist/components/display/notifications.js +3 -15
- package/dist/components/display/stats.js +30 -16
- package/dist/components/display/stats.js.map +1 -1
- package/dist/components/display/tabs.js +3 -12
- package/dist/components/display/timeline.js +47 -28
- package/dist/components/display/timeline.js.map +1 -1
- package/dist/components/floating/dropdown.js +76 -65
- package/dist/components/floating/dropdown.js.map +1 -1
- package/dist/components/floating/expand.js +62 -40
- package/dist/components/floating/expand.js.map +1 -1
- package/dist/components/floating/menu.js +195 -177
- package/dist/components/floating/menu.js.map +1 -1
- package/dist/components/floating/modal.js +3 -301
- package/dist/components/floating/tooltip.js +63 -73
- package/dist/components/floating/tooltip.js.map +1 -1
- package/dist/components/form/autocomplete.js +3 -16
- package/dist/components/form/checkbox.js +34 -44
- package/dist/components/form/checkbox.js.map +1 -1
- package/dist/components/form/date-picker.js +3 -12
- package/dist/components/form/file-upload.js +3 -11
- package/dist/components/form/form.js +16 -7
- package/dist/components/form/form.js.map +1 -1
- package/dist/components/form/input.js +3 -5
- package/dist/components/form/radiobox.js +19 -30
- package/dist/components/form/radiobox.js.map +1 -1
- package/dist/components/form/select.js +77 -106
- package/dist/components/form/select.js.map +1 -1
- package/dist/components/form/switch.js +73 -64
- package/dist/components/form/switch.js.map +1 -1
- package/dist/components/form/task-list.js +3 -68
- package/dist/components/table/table.js +3 -10
- package/dist/date-picker-BhKEFZew.js +1498 -0
- package/dist/date-picker-BhKEFZew.js.map +1 -0
- package/dist/dist-BHFtgf5x.js +2593 -0
- package/dist/dist-BHFtgf5x.js.map +1 -0
- package/dist/dist-BrGpYRaj.js +178 -0
- package/dist/dist-BrGpYRaj.js.map +1 -0
- package/dist/dist-NmFtbuK4.js +35 -0
- package/dist/dist-NmFtbuK4.js.map +1 -0
- package/dist/dom-Bn4wY_Zx.js +2168 -0
- package/dist/dom-Bn4wY_Zx.js.map +1 -0
- package/dist/file-upload-DWbZfeG5.js +2966 -0
- package/dist/file-upload-DWbZfeG5.js.map +1 -0
- package/dist/floating-ui.react-CwXtBJ_y.js +3381 -0
- package/dist/floating-ui.react-CwXtBJ_y.js.map +1 -0
- package/dist/floating-ui.utils-CUrVRSbA.js +204 -0
- package/dist/floating-ui.utils-CUrVRSbA.js.map +1 -0
- package/dist/fns-KbsWlOTG.js +29 -0
- package/dist/fns-KbsWlOTG.js.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.js +7932 -20
- package/dist/index.js.map +1 -1
- package/dist/input-B7jqwPG4.js +473 -0
- package/dist/input-B7jqwPG4.js.map +1 -0
- package/dist/input-field-B_whI66Q.js +137 -0
- package/dist/input-field-B_whI66Q.js.map +1 -0
- package/dist/modal-Bz-61ays.js +373 -0
- package/dist/modal-Bz-61ays.js.map +1 -0
- package/dist/notifications-MT4XkLov.js +2203 -0
- package/dist/notifications-MT4XkLov.js.map +1 -0
- package/dist/polymorph-BLXhrn9n.js +14 -0
- package/dist/polymorph-BLXhrn9n.js.map +1 -0
- package/dist/preset/preset.tailwind.d.ts.map +1 -1
- package/dist/preset/preset.tailwind.js +40 -4
- package/dist/preset/src/styles/common.d.ts +0 -2
- package/dist/preset/src/styles/common.d.ts.map +1 -1
- package/dist/preset/src/styles/common.js +0 -9
- package/dist/preset/src/styles/components.d.ts +3 -0
- package/dist/preset/src/styles/components.d.ts.map +1 -0
- package/dist/preset/src/styles/components.js +400 -0
- package/dist/preset/src/styles/dark.d.ts.map +1 -1
- package/dist/preset/src/styles/dark.js +5 -3
- package/dist/preset/src/styles/default-tokens.d.ts +74 -0
- package/dist/preset/src/styles/default-tokens.d.ts.map +1 -0
- package/dist/preset/src/styles/default-tokens.js +44 -0
- package/dist/preset/src/styles/design-tokens.d.ts +1 -1
- package/dist/preset/src/styles/design-tokens.d.ts.map +1 -1
- package/dist/preset/src/styles/design-tokens.js +6 -2
- package/dist/preset/src/styles/light.d.ts.map +1 -1
- package/dist/preset/src/styles/light.js +22 -20
- package/dist/preset/src/styles/theme.types.d.ts +433 -8
- package/dist/preset/src/styles/theme.types.d.ts.map +1 -1
- package/dist/proxy-BcJ_5Dwq.js +2530 -0
- package/dist/proxy-BcJ_5Dwq.js.map +1 -0
- package/dist/skeleton-CBYEq3lM.js +26 -0
- package/dist/skeleton-CBYEq3lM.js.map +1 -0
- package/dist/slot-pC8kH9De.js +96 -0
- package/dist/slot-pC8kH9De.js.map +1 -0
- package/dist/styles/common.d.ts +0 -2
- package/dist/styles/common.d.ts.map +1 -1
- package/dist/styles/common.js +0 -9
- package/dist/styles/components.d.ts +3 -0
- package/dist/styles/components.d.ts.map +1 -0
- package/dist/styles/components.js +400 -0
- package/dist/styles/dark.d.ts.map +1 -1
- package/dist/styles/dark.js +5 -3
- package/dist/styles/default-tokens.d.ts +74 -0
- package/dist/styles/default-tokens.d.ts.map +1 -0
- package/dist/styles/default-tokens.js +44 -0
- package/dist/styles/design-tokens.d.ts +1 -1
- package/dist/styles/design-tokens.d.ts.map +1 -1
- package/dist/styles/design-tokens.js +6 -2
- package/dist/styles/light.d.ts.map +1 -1
- package/dist/styles/light.js +22 -20
- package/dist/styles/theme.types.d.ts +433 -8
- package/dist/styles/theme.types.d.ts.map +1 -1
- package/dist/table-CUFbAI2k.js +1914 -0
- package/dist/table-CUFbAI2k.js.map +1 -0
- package/dist/tabs-Ciy0l9OF.js +122 -0
- package/dist/tabs-Ciy0l9OF.js.map +1 -0
- package/dist/task-list-tKumO4WH.js +96 -0
- package/dist/task-list-tKumO4WH.js.map +1 -0
- package/dist/use-motion-value-BqPF1j90.js +15 -0
- package/dist/use-motion-value-BqPF1j90.js.map +1 -0
- package/dist/use-stable-ref-D5LFCx0u.js +12 -0
- package/dist/use-stable-ref-D5LFCx0u.js.map +1 -0
- package/dist/use-translations-DTLfPE3_.js +177 -0
- package/dist/use-translations-DTLfPE3_.js.map +1 -0
- package/package.json +17 -17
- package/dist/CaretDown.es-Cj7klWI3.js +0 -33
- package/dist/CaretDown.es-Cj7klWI3.js.map +0 -1
- package/dist/CaretRight.es-0-M8D9y8.js +0 -33
- package/dist/CaretRight.es-0-M8D9y8.js.map +0 -1
- package/dist/CheckCircle.es-C6QWLfk_.js +0 -33
- package/dist/CheckCircle.es-C6QWLfk_.js.map +0 -1
- package/dist/File.es-CA-vuPED.js +0 -33
- package/dist/File.es-CA-vuPED.js.map +0 -1
- package/dist/IconBase.es-DJ1oCtpo.js +0 -50
- package/dist/IconBase.es-DJ1oCtpo.js.map +0 -1
- package/dist/Info.es-CrZKs4q4.js +0 -33
- package/dist/Info.es-CrZKs4q4.js.map +0 -1
- package/dist/MotionConfigContext-C7MqlSdv.js +0 -2713
- package/dist/MotionConfigContext-C7MqlSdv.js.map +0 -1
- package/dist/Warning.es-D_eI6tLe.js +0 -39
- package/dist/Warning.es-D_eI6tLe.js.map +0 -1
- package/dist/X.es-BJ1O93El.js +0 -39
- package/dist/X.es-BJ1O93El.js.map +0 -1
- package/dist/autocomplete-DcTNOwyg.js +0 -393
- package/dist/autocomplete-DcTNOwyg.js.map +0 -1
- package/dist/calendar-BJMHRoy2.js +0 -1746
- package/dist/calendar-BJMHRoy2.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/button.jsx +0 -79
- package/dist/components/core/heading.d.ts +0 -3
- package/dist/components/core/heading.d.ts.map +0 -1
- package/dist/components/core/heading.jsx +0 -4
- package/dist/components/core/polymorph.d.ts +0 -10
- package/dist/components/core/polymorph.d.ts.map +0 -1
- package/dist/components/core/polymorph.jsx +0 -5
- 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/render-on-view.jsx +0 -31
- package/dist/components/core/resizable.d.ts +0 -3
- package/dist/components/core/resizable.d.ts.map +0 -1
- package/dist/components/core/resizable.jsx +0 -51
- package/dist/components/core/slot.d.ts +0 -16
- package/dist/components/core/slot.d.ts.map +0 -1
- package/dist/components/core/slot.jsx +0 -156
- package/dist/components/core/tag.d.ts +0 -35
- package/dist/components/core/tag.d.ts.map +0 -1
- package/dist/components/core/tag.jsx +0 -51
- package/dist/components/core/typography.d.ts +0 -25
- package/dist/components/core/typography.d.ts.map +0 -1
- package/dist/components/core/typography.jsx +0 -18
- package/dist/components/display/alert.d.ts +0 -28
- package/dist/components/display/alert.d.ts.map +0 -1
- package/dist/components/display/alert.jsx +0 -61
- package/dist/components/display/calendar.d.ts +0 -42
- package/dist/components/display/calendar.d.ts.map +0 -1
- package/dist/components/display/calendar.js.map +0 -1
- package/dist/components/display/calendar.jsx +0 -299
- package/dist/components/display/card.d.ts +0 -29
- package/dist/components/display/card.d.ts.map +0 -1
- package/dist/components/display/card.jsx +0 -43
- package/dist/components/display/empty.d.ts +0 -8
- package/dist/components/display/empty.d.ts.map +0 -1
- package/dist/components/display/empty.jsx +0 -11
- package/dist/components/display/list.d.ts +0 -16
- package/dist/components/display/list.d.ts.map +0 -1
- package/dist/components/display/list.jsx +0 -81
- package/dist/components/display/notifications.d.ts +0 -27
- package/dist/components/display/notifications.d.ts.map +0 -1
- package/dist/components/display/notifications.js.map +0 -1
- package/dist/components/display/notifications.jsx +0 -126
- package/dist/components/display/progress.d.ts +0 -13
- package/dist/components/display/progress.d.ts.map +0 -1
- package/dist/components/display/progress.jsx +0 -11
- package/dist/components/display/shortcut.d.ts +0 -4
- package/dist/components/display/shortcut.d.ts.map +0 -1
- package/dist/components/display/shortcut.jsx +0 -23
- package/dist/components/display/skeleton.d.ts +0 -12
- package/dist/components/display/skeleton.d.ts.map +0 -1
- package/dist/components/display/skeleton.jsx +0 -19
- package/dist/components/display/spinner.d.ts +0 -5
- package/dist/components/display/spinner.d.ts.map +0 -1
- package/dist/components/display/spinner.jsx +0 -11
- package/dist/components/display/stats.d.ts +0 -12
- package/dist/components/display/stats.d.ts.map +0 -1
- package/dist/components/display/stats.jsx +0 -20
- package/dist/components/display/step.d.ts +0 -24
- package/dist/components/display/step.d.ts.map +0 -1
- package/dist/components/display/step.jsx +0 -131
- package/dist/components/display/tabs.d.ts +0 -24
- package/dist/components/display/tabs.d.ts.map +0 -1
- package/dist/components/display/tabs.js.map +0 -1
- package/dist/components/display/tabs.jsx +0 -125
- package/dist/components/display/timeline.d.ts +0 -10
- package/dist/components/display/timeline.d.ts.map +0 -1
- package/dist/components/display/timeline.jsx +0 -25
- 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/command-palette.jsx +0 -197
- package/dist/components/floating/dropdown.d.ts +0 -15
- package/dist/components/floating/dropdown.d.ts.map +0 -1
- package/dist/components/floating/dropdown.jsx +0 -56
- package/dist/components/floating/expand.d.ts +0 -11
- package/dist/components/floating/expand.d.ts.map +0 -1
- package/dist/components/floating/expand.jsx +0 -44
- package/dist/components/floating/menu.d.ts +0 -52
- package/dist/components/floating/menu.d.ts.map +0 -1
- package/dist/components/floating/menu.jsx +0 -147
- package/dist/components/floating/modal.d.ts +0 -60
- package/dist/components/floating/modal.d.ts.map +0 -1
- package/dist/components/floating/modal.js.map +0 -1
- package/dist/components/floating/modal.jsx +0 -301
- package/dist/components/floating/toolbar.d.ts +0 -6
- package/dist/components/floating/toolbar.d.ts.map +0 -1
- package/dist/components/floating/toolbar.jsx +0 -5
- package/dist/components/floating/tooltip.d.ts +0 -17
- package/dist/components/floating/tooltip.d.ts.map +0 -1
- package/dist/components/floating/tooltip.jsx +0 -58
- package/dist/components/floating/wizard.d.ts +0 -26
- package/dist/components/floating/wizard.d.ts.map +0 -1
- package/dist/components/floating/wizard.jsx +0 -161
- package/dist/components/form/autocomplete.d.ts +0 -16
- package/dist/components/form/autocomplete.d.ts.map +0 -1
- package/dist/components/form/autocomplete.js.map +0 -1
- package/dist/components/form/autocomplete.jsx +0 -278
- package/dist/components/form/checkbox.d.ts +0 -12
- package/dist/components/form/checkbox.d.ts.map +0 -1
- package/dist/components/form/checkbox.jsx +0 -12
- 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/date-picker.js.map +0 -1
- package/dist/components/form/date-picker.jsx +0 -115
- 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/file-upload.js.map +0 -1
- package/dist/components/form/file-upload.jsx +0 -134
- package/dist/components/form/form.d.ts +0 -3
- package/dist/components/form/form.d.ts.map +0 -1
- package/dist/components/form/form.jsx +0 -10
- package/dist/components/form/formReset.d.ts +0 -2
- package/dist/components/form/formReset.d.ts.map +0 -1
- package/dist/components/form/formReset.jsx +0 -17
- 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/free-text.jsx +0 -41
- 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-field.jsx +0 -58
- package/dist/components/form/input.d.ts +0 -52
- package/dist/components/form/input.d.ts.map +0 -1
- package/dist/components/form/input.js.map +0 -1
- package/dist/components/form/input.jsx +0 -36
- 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/multi-select.jsx +0 -336
- package/dist/components/form/radiobox.d.ts +0 -7
- package/dist/components/form/radiobox.d.ts.map +0 -1
- package/dist/components/form/radiobox.jsx +0 -6
- package/dist/components/form/select.d.ts +0 -13
- package/dist/components/form/select.d.ts.map +0 -1
- package/dist/components/form/select.jsx +0 -42
- package/dist/components/form/slider.d.ts +0 -7
- package/dist/components/form/slider.d.ts.map +0 -1
- package/dist/components/form/slider.jsx +0 -45
- package/dist/components/form/switch.d.ts +0 -9
- package/dist/components/form/switch.d.ts.map +0 -1
- package/dist/components/form/switch.jsx +0 -46
- 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/task-list.js.map +0 -1
- package/dist/components/form/task-list.jsx +0 -26
- package/dist/components/form/textarea.d.ts +0 -6
- package/dist/components/form/textarea.d.ts.map +0 -1
- package/dist/components/form/textarea.jsx +0 -12
- package/dist/components/index.d.ts +0 -45
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/index.js +0 -44
- 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/calendar-header.jsx +0 -83
- 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/day-view.jsx +0 -94
- 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/event-pill.jsx +0 -25
- 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/index.js +0 -2
- 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/month-view.jsx +0 -46
- 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.jsx +0 -41
- 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.types.js +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/page-calendar.utils.js +0 -93
- 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/page-calendar/week-view.jsx +0 -71
- package/dist/components/table/filter.d.ts +0 -42
- package/dist/components/table/filter.d.ts.map +0 -1
- package/dist/components/table/filter.jsx +0 -141
- package/dist/components/table/group.d.ts +0 -17
- package/dist/components/table/group.d.ts.map +0 -1
- package/dist/components/table/group.jsx +0 -68
- package/dist/components/table/index.d.ts +0 -19
- package/dist/components/table/index.d.ts.map +0 -1
- package/dist/components/table/index.jsx +0 -60
- 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/inner-table.jsx +0 -102
- package/dist/components/table/metadata.d.ts +0 -4
- package/dist/components/table/metadata.d.ts.map +0 -1
- package/dist/components/table/metadata.jsx +0 -36
- package/dist/components/table/pagination.d.ts +0 -5
- package/dist/components/table/pagination.d.ts.map +0 -1
- package/dist/components/table/pagination.jsx +0 -74
- package/dist/components/table/row.d.ts +0 -11
- package/dist/components/table/row.d.ts.map +0 -1
- package/dist/components/table/row.jsx +0 -49
- package/dist/components/table/sort.d.ts +0 -28
- package/dist/components/table/sort.d.ts.map +0 -1
- package/dist/components/table/sort.jsx +0 -109
- 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-lib.js +0 -83
- 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/table.context.jsx +0 -4
- package/dist/components/table/table.js.map +0 -1
- package/dist/components/table/thead.d.ts +0 -9
- package/dist/components/table/thead.d.ts.map +0 -1
- package/dist/components/table/thead.jsx +0 -103
- package/dist/config/context.d.ts +0 -21
- package/dist/config/context.d.ts.map +0 -1
- package/dist/config/context.js +0 -12
- package/dist/config/default-translations.d.ts +0 -94
- package/dist/config/default-translations.d.ts.map +0 -1
- package/dist/config/default-translations.jsx +0 -87
- package/dist/config/default-tweaks.d.ts +0 -13
- package/dist/config/default-tweaks.d.ts.map +0 -1
- package/dist/config/default-tweaks.js +0 -4
- package/dist/constants-r-AHn273.js +0 -6
- package/dist/constants-r-AHn273.js.map +0 -1
- package/dist/constants.d.ts +0 -3
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -2
- package/dist/date-picker-Bnl07nd8.js +0 -1628
- package/dist/date-picker-Bnl07nd8.js.map +0 -1
- package/dist/dom-CyQHY7ID.js +0 -2838
- package/dist/dom-CyQHY7ID.js.map +0 -1
- package/dist/file-upload-93d5DR4q.js +0 -3255
- package/dist/file-upload-93d5DR4q.js.map +0 -1
- package/dist/floating-ui.react-M2PGXLDp.js +0 -3706
- package/dist/floating-ui.react-M2PGXLDp.js.map +0 -1
- package/dist/fns-C7Dt27Qd.js +0 -33
- package/dist/fns-C7Dt27Qd.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-click-outside.js +0 -17
- 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-color-parser.js +0 -9
- 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-components-provider.jsx +0 -22
- package/dist/hooks/use-debounce.d.ts +0 -5
- package/dist/hooks/use-debounce.d.ts.map +0 -1
- package/dist/hooks/use-debounce.js +0 -12
- 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-floating-ref.js +0 -6
- package/dist/hooks/use-form.d.ts +0 -394
- package/dist/hooks/use-form.d.ts.map +0 -1
- package/dist/hooks/use-form.js +0 -563
- package/dist/hooks/use-hover.d.ts +0 -3
- package/dist/hooks/use-hover.d.ts.map +0 -1
- package/dist/hooks/use-hover.js +0 -18
- 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-input-id.js +0 -5
- 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-is-coarse-device.js +0 -12
- package/dist/hooks/use-locale.d.ts +0 -3
- package/dist/hooks/use-locale.d.ts.map +0 -1
- package/dist/hooks/use-locale.js +0 -10
- 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-media-query.js +0 -25
- 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-on-event.js +0 -7
- package/dist/hooks/use-parent.d.ts +0 -3
- package/dist/hooks/use-parent.d.ts.map +0 -1
- package/dist/hooks/use-parent.js +0 -21
- package/dist/hooks/use-preferences.d.ts +0 -2
- package/dist/hooks/use-preferences.d.ts.map +0 -1
- package/dist/hooks/use-preferences.js +0 -23
- package/dist/hooks/use-previous.d.ts +0 -2
- package/dist/hooks/use-previous.d.ts.map +0 -1
- package/dist/hooks/use-previous.js +0 -9
- package/dist/hooks/use-reactive.d.ts +0 -2
- package/dist/hooks/use-reactive.d.ts.map +0 -1
- package/dist/hooks/use-reactive.js +0 -9
- 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-remove-scroll.js +0 -48
- 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-resize-observer.js +0 -17
- 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-stable-ref.js +0 -9
- package/dist/hooks/use-swipe.d.ts +0 -8
- package/dist/hooks/use-swipe.d.ts.map +0 -1
- package/dist/hooks/use-swipe.js +0 -17
- package/dist/hooks/use-translations.d.ts +0 -92
- package/dist/hooks/use-translations.d.ts.map +0 -1
- package/dist/hooks/use-translations.js +0 -9
- package/dist/hooks/use-tweaks.d.ts +0 -3
- package/dist/hooks/use-tweaks.d.ts.map +0 -1
- package/dist/hooks/use-tweaks.js +0 -9
- package/dist/hooks/use-window-size.d.ts +0 -5
- package/dist/hooks/use-window-size.d.ts.map +0 -1
- package/dist/hooks/use-window-size.js +0 -14
- package/dist/index-0YMC-_Lt.js +0 -20
- package/dist/index-0YMC-_Lt.js.map +0 -1
- package/dist/index-BJ1ayTam.js +0 -126
- package/dist/index-BJ1ayTam.js.map +0 -1
- package/dist/index-C-PuFUZi.js +0 -3416
- package/dist/index-C-PuFUZi.js.map +0 -1
- package/dist/index-DDeQW0JW.js +0 -1816
- package/dist/index-DDeQW0JW.js.map +0 -1
- package/dist/index-DE4shK8D.js +0 -215
- package/dist/index-DE4shK8D.js.map +0 -1
- package/dist/index-DlJ_2RBL.js +0 -35
- package/dist/index-DlJ_2RBL.js.map +0 -1
- package/dist/index-t1qLJTt5.js +0 -351
- package/dist/index-t1qLJTt5.js.map +0 -1
- package/dist/index.d.ts +0 -22
- package/dist/index.d.ts.map +0 -1
- package/dist/index.esm-BaIwleSE.js +0 -343
- package/dist/index.esm-BaIwleSE.js.map +0 -1
- package/dist/input-_MVxmIpu.js +0 -443
- package/dist/input-_MVxmIpu.js.map +0 -1
- package/dist/input-field-CDCOODOl.js +0 -182
- package/dist/input-field-CDCOODOl.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/combi-keys.js +0 -60
- package/dist/lib/dict.d.ts +0 -9
- package/dist/lib/dict.d.ts.map +0 -1
- package/dist/lib/dict.js +0 -28
- package/dist/lib/dom.d.ts +0 -20
- package/dist/lib/dom.d.ts.map +0 -1
- package/dist/lib/dom.js +0 -66
- package/dist/lib/fns.d.ts +0 -11
- package/dist/lib/fns.d.ts.map +0 -1
- package/dist/lib/fns.js +0 -46
- package/dist/lib/fzf.d.ts +0 -16
- package/dist/lib/fzf.d.ts.map +0 -1
- package/dist/lib/fzf.js +0 -115
- package/dist/lib/keyboard-area.d.ts +0 -16
- package/dist/lib/keyboard-area.d.ts.map +0 -1
- package/dist/lib/keyboard-area.js +0 -14
- package/dist/notifications-Dp0ydKJS.js +0 -2576
- package/dist/notifications-Dp0ydKJS.js.map +0 -1
- package/dist/polymorph-B5n9fs_K.js +0 -10
- package/dist/polymorph-B5n9fs_K.js.map +0 -1
- package/dist/proxy-BZcQiBrp.js +0 -2495
- package/dist/proxy-BZcQiBrp.js.map +0 -1
- package/dist/skeleton-BjJobYYf.js +0 -24
- package/dist/skeleton-BjJobYYf.js.map +0 -1
- package/dist/slot-CRyweuj0.js +0 -79
- package/dist/slot-CRyweuj0.js.map +0 -1
- package/dist/tabs-B0g7YtQv.js +0 -123
- package/dist/tabs-B0g7YtQv.js.map +0 -1
- package/dist/tsconfig.lib.tsbuildinfo +0 -1
- package/dist/types.d.ts +0 -26
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -1
- package/dist/use-motion-value-eGwNuWuw.js +0 -14
- package/dist/use-motion-value-eGwNuWuw.js.map +0 -1
- package/dist/use-stable-ref-CYh-YkID.js +0 -11
- package/dist/use-stable-ref-CYh-YkID.js.map +0 -1
- package/dist/use-translations-DSltA7H_.js +0 -169
- package/dist/use-translations-DSltA7H_.js.map +0 -1
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import React, { createContext, useContext, useEffect, useRef } from "react";
|
|
3
|
-
import { Is } from "sidekicker";
|
|
4
|
-
import { useReactive } from "../../hooks/use-reactive";
|
|
5
|
-
import { useStableRef } from "../../hooks/use-stable-ref";
|
|
6
|
-
import { css } from "../../lib/dom";
|
|
7
|
-
import { keyboardKeys } from "../../lib/keyboard-area";
|
|
8
|
-
import { Polymorph } from "../core/polymorph";
|
|
9
|
-
import { Card } from "./card";
|
|
10
|
-
const Context = createContext("");
|
|
11
|
-
const isElementDisabled = (element) => element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true";
|
|
12
|
-
const getNElement = (elements, currentIndex, direction) => {
|
|
13
|
-
const step = direction === "forward" ? 1 : -1;
|
|
14
|
-
const startIndex = currentIndex + step;
|
|
15
|
-
for (let i = startIndex; i >= 0 && i < elements.length; i += step) {
|
|
16
|
-
const element = elements[i];
|
|
17
|
-
if (!isElementDisabled(element))
|
|
18
|
-
return element;
|
|
19
|
-
}
|
|
20
|
-
return direction === "backward" ? getNElement(elements, elements.length - 1, "backward") : getNElement(elements, -1, "forward");
|
|
21
|
-
};
|
|
22
|
-
const moveOn = (ul, direction) => {
|
|
23
|
-
const items = Array.from(ul.querySelectorAll("li"));
|
|
24
|
-
const find = items.findIndex((x) => x.dataset.active === "true");
|
|
25
|
-
if (find === -1)
|
|
26
|
-
return null;
|
|
27
|
-
const item = getNElement(items, find, direction);
|
|
28
|
-
if (item === null)
|
|
29
|
-
return null;
|
|
30
|
-
item.querySelector("button")?.focus({ preventScroll: false });
|
|
31
|
-
return item.getAttribute("data-id") || "";
|
|
32
|
-
};
|
|
33
|
-
const moveToEdge = (ul, edge) => {
|
|
34
|
-
const items = Array.from(ul.querySelectorAll("li"));
|
|
35
|
-
const ordered = edge === "first" ? items : [...items].reverse();
|
|
36
|
-
for (const item of ordered) {
|
|
37
|
-
if (!isElementDisabled(item)) {
|
|
38
|
-
item.querySelector("button")?.focus({ preventScroll: false });
|
|
39
|
-
return item.getAttribute("data-id") || "";
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return null;
|
|
43
|
-
};
|
|
44
|
-
const actionKeys = {
|
|
45
|
-
[keyboardKeys.ArrowLeft]: (_, ul) => moveOn(ul, "backward"),
|
|
46
|
-
[keyboardKeys.ArrowRight]: (_, ul) => moveOn(ul, "forward"),
|
|
47
|
-
};
|
|
48
|
-
export const Tabs = (props) => {
|
|
49
|
-
const [active, setActive] = useReactive(props.active);
|
|
50
|
-
const ref = useRef(null);
|
|
51
|
-
const onChangeRef = useStableRef(props.onChange);
|
|
52
|
-
useEffect(() => {
|
|
53
|
-
const header = ref.current;
|
|
54
|
-
if (header === null)
|
|
55
|
-
return;
|
|
56
|
-
let first = header.querySelector(`li[data-active=true]`);
|
|
57
|
-
if (first === null) {
|
|
58
|
-
first = header.querySelector(`li[data-id]`);
|
|
59
|
-
const id = first.getAttribute("data-id") || "";
|
|
60
|
-
setActive(id);
|
|
61
|
-
}
|
|
62
|
-
}, [props.active, setActive]);
|
|
63
|
-
useEffect(() => {
|
|
64
|
-
if (onChangeRef.current)
|
|
65
|
-
onChangeRef.current(active);
|
|
66
|
-
}, [onChangeRef, active]);
|
|
67
|
-
const items = React.Children.toArray(props.children);
|
|
68
|
-
const onClick = (e) => {
|
|
69
|
-
const anchor = e.currentTarget;
|
|
70
|
-
setActive(anchor.dataset.id || "");
|
|
71
|
-
};
|
|
72
|
-
const onKeyDown = (e) => {
|
|
73
|
-
if (ref.current === null)
|
|
74
|
-
return;
|
|
75
|
-
const k = e.key;
|
|
76
|
-
if (Is.keyof(actionKeys, k)) {
|
|
77
|
-
const fn = actionKeys[k];
|
|
78
|
-
const result = fn(e, ref.current);
|
|
79
|
-
if (result === null)
|
|
80
|
-
return;
|
|
81
|
-
setActive(result);
|
|
82
|
-
}
|
|
83
|
-
else if (k === "Home") {
|
|
84
|
-
e.preventDefault();
|
|
85
|
-
const result = moveToEdge(ref.current, "first");
|
|
86
|
-
if (result)
|
|
87
|
-
setActive(result);
|
|
88
|
-
}
|
|
89
|
-
else if (k === "End") {
|
|
90
|
-
e.preventDefault();
|
|
91
|
-
const result = moveToEdge(ref.current, "last");
|
|
92
|
-
if (result)
|
|
93
|
-
setActive(result);
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
return (<Context.Provider value={active}>
|
|
97
|
-
<Card className={props.className} container={css("pt-0 max-w-full w-full min-w-0", props.container)} header={<header className="relative mb-2 overflow-x-auto">
|
|
98
|
-
<div className="absolute bottom-0 h-[1px] w-full bg-card-border"/>
|
|
99
|
-
<nav className="min-w-0">
|
|
100
|
-
<ul role="tablist" onKeyDown={onKeyDown} ref={ref} className="flex w-0 min-w-full flex-1 justify-start overflow-x-auto">
|
|
101
|
-
{items.map((x) => {
|
|
102
|
-
const inner = x.props;
|
|
103
|
-
const current = active === inner.id;
|
|
104
|
-
return (<li data-id={inner.id} data-active={current} key={`tab-header-${inner.id}`} className={css("relative w-fit border-b border-transparent transition-all", current ? "border-primary font-medium text-primary" : "", inner.disabled ? "aria-disabled:text-disabled" : "")}>
|
|
105
|
-
<Polymorph role="tab" as="button" type="button" data-id={inner.id} id={`${inner.id}-tab`} aria-selected={current} disabled={inner.disabled} tabIndex={current ? 0 : -1} aria-controls={`${inner.id}-panel`} onClick={inner.disabled ? undefined : onClick} className="block w-full whitespace-nowrap px-10 py-4 disabled:cursor-not-allowed">
|
|
106
|
-
{inner.title}
|
|
107
|
-
</Polymorph>
|
|
108
|
-
</li>);
|
|
109
|
-
})}
|
|
110
|
-
</ul>
|
|
111
|
-
</nav>
|
|
112
|
-
</header>}>
|
|
113
|
-
{props.children}
|
|
114
|
-
</Card>
|
|
115
|
-
</Context.Provider>);
|
|
116
|
-
};
|
|
117
|
-
const useTabs = () => useContext(Context);
|
|
118
|
-
export const Tab = (props) => {
|
|
119
|
-
const active = useTabs();
|
|
120
|
-
if (props.id !== active)
|
|
121
|
-
return null;
|
|
122
|
-
return (<div role="tabpanel" tabIndex={0} id={`${props.id}-panel`} aria-labelledby={`${props.id}-tab`}>
|
|
123
|
-
{props.children}
|
|
124
|
-
</div>);
|
|
125
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React, { ComponentProps, ElementType, PropsWithChildren } from "react";
|
|
2
|
-
import { PolymorphicProps } from "../core/polymorph";
|
|
3
|
-
export declare const TimelineItem: {
|
|
4
|
-
(props: PropsWithChildren): React.JSX.Element;
|
|
5
|
-
Icon(props: PropsWithChildren<ComponentProps<"header">>): React.JSX.Element;
|
|
6
|
-
Body<T extends ElementType = "section">(props: PropsWithChildren<PolymorphicProps<object, T>>): React.JSX.Element;
|
|
7
|
-
Right<T extends ElementType = "button">(props: PolymorphicProps<object, T>): React.JSX.Element;
|
|
8
|
-
};
|
|
9
|
-
export declare const Timeline: (props: PropsWithChildren) => React.JSX.Element;
|
|
10
|
-
//# sourceMappingURL=timeline.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../../../src/components/display/timeline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,cAAc,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE9E,OAAO,EAAa,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEhE,eAAO,MAAM,YAAY;YAAW,iBAAiB;gBAOJ,iBAAiB,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;SAW9C,CAAC,SAAS,WAAW,qBAAqB,iBAAiB,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;UAQtF,CAAC,SAAS,WAAW,oBAAoB,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAC;CArBnH,CAAC;AA6BF,eAAO,MAAM,QAAQ,GAAI,OAAO,iBAAiB,sBAIhD,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { css } from "../../lib/dom";
|
|
3
|
-
import { Polymorph } from "../core/polymorph";
|
|
4
|
-
export const TimelineItem = (props) => (<li data-component="timeline-item" className="relative pb-12" role="listitem">
|
|
5
|
-
<span aria-hidden="true" className="absolute left-6 top-8 -ml-px h-full w-0.5 bg-card-border"/>
|
|
6
|
-
<div className="relative flex items-stretch justify-start space-x-3">{props.children}</div>
|
|
7
|
-
</li>);
|
|
8
|
-
TimelineItem.Icon = function TimelineIcon(props) {
|
|
9
|
-
return (<header {...props} className={css("flex size-12 items-center justify-center rounded-full bg-primary p-2 text-warn-foreground", props.className)}>
|
|
10
|
-
{props.children}
|
|
11
|
-
</header>);
|
|
12
|
-
};
|
|
13
|
-
TimelineItem.Body = function TimelineItemBody(props) {
|
|
14
|
-
return (<Polymorph {...props} className={css("min-w-0 flex-1", props.className)}>
|
|
15
|
-
{props.children}
|
|
16
|
-
</Polymorph>);
|
|
17
|
-
};
|
|
18
|
-
TimelineItem.Right = function TimelineItemRight(props) {
|
|
19
|
-
return (<footer className="flex gap-6 self-stretch px-4 align-baseline">
|
|
20
|
-
<Polymorph {...props} type="button"/>
|
|
21
|
-
</footer>);
|
|
22
|
-
};
|
|
23
|
-
export const Timeline = (props) => (<ul data-component="timeline" role="list" className="flow-root [&>li:last-child>span[aria-hidden=true]]:hidden">
|
|
24
|
-
{props.children}
|
|
25
|
-
</ul>);
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { type Icon, type IconProps } from "@phosphor-icons/react";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { Label } from "../../types";
|
|
4
|
-
type ViewProps = {
|
|
5
|
-
text: string;
|
|
6
|
-
};
|
|
7
|
-
type CommandItem<T extends string, P extends object> = P & {
|
|
8
|
-
type: T;
|
|
9
|
-
hint?: string | string[];
|
|
10
|
-
Icon?: React.ReactElement;
|
|
11
|
-
enabled?: ((props: ViewProps) => boolean) | boolean;
|
|
12
|
-
};
|
|
13
|
-
type View = string | ((props: ViewProps) => string);
|
|
14
|
-
type CommandShortcutItem = CommandItem<"shortcut", {
|
|
15
|
-
title: View;
|
|
16
|
-
shortcut?: string;
|
|
17
|
-
action: (args: {
|
|
18
|
-
text: string;
|
|
19
|
-
setText: (state: string) => void;
|
|
20
|
-
setOpen: (state: boolean) => void;
|
|
21
|
-
event: KeyboardEvent | React.MouseEvent | React.KeyboardEvent;
|
|
22
|
-
}) => void | Promise<void>;
|
|
23
|
-
}>;
|
|
24
|
-
type CommandGroupItem = CommandItem<"group", {
|
|
25
|
-
title: View;
|
|
26
|
-
items: CommandItemTypes[];
|
|
27
|
-
}>;
|
|
28
|
-
export type CommandItemTypes = CommandGroupItem | CommandShortcutItem;
|
|
29
|
-
export type CommandPaletteProps = {
|
|
30
|
-
bind?: string;
|
|
31
|
-
open: boolean;
|
|
32
|
-
loading?: boolean;
|
|
33
|
-
emptyMessage?: Label;
|
|
34
|
-
footer?: React.ReactElement;
|
|
35
|
-
commands: CommandItemTypes[];
|
|
36
|
-
onChangeText?: (text: string) => void;
|
|
37
|
-
onChangeVisibility: (next: boolean) => void;
|
|
38
|
-
Preview?: React.FC<{
|
|
39
|
-
command: CommandItemTypes;
|
|
40
|
-
text: string;
|
|
41
|
-
}>;
|
|
42
|
-
Icon?: React.FC<IconProps & {
|
|
43
|
-
text: string;
|
|
44
|
-
Default: Icon;
|
|
45
|
-
}>;
|
|
46
|
-
};
|
|
47
|
-
export declare const CommandPalette: (props: CommandPaletteProps) => React.JSX.Element;
|
|
48
|
-
export {};
|
|
49
|
-
//# sourceMappingURL=command-palette.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"command-palette.d.ts","sourceRoot":"","sources":["../../../src/components/floating/command-palette.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,KAAmE,MAAM,OAAO,CAAC;AAQxF,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAKpC,KAAK,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAElC,KAAK,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,IAAI,CAAC,GAAG;IACvD,IAAI,EAAE,CAAC,CAAC;IACR,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1B,OAAO,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,SAAS,KAAK,OAAO,CAAC,GAAG,OAAO,CAAC;CACvD,CAAC;AAEF,KAAK,IAAI,GAAG,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,SAAS,KAAK,MAAM,CAAC,CAAC;AAEpD,KAAK,mBAAmB,GAAG,WAAW,CAClC,UAAU,EACV;IACI,KAAK,EAAE,IAAI,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,CAAC,IAAI,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QACjC,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;QAClC,KAAK,EAAE,aAAa,GAAG,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,aAAa,CAAC;KACjE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B,CACJ,CAAC;AAEF,KAAK,gBAAgB,GAAG,WAAW,CAAC,OAAO,EAAE;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,gBAAgB,EAAE,CAAA;CAAE,CAAC,CAAC;AAEzF,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,GAAG,mBAAmB,CAAC;AA8CtE,MAAM,MAAM,mBAAmB,GAAG;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,MAAM,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC5B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,kBAAkB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;QAAE,OAAO,EAAE,gBAAgB,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChE,IAAI,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,IAAI,CAAA;KAAE,CAAC,CAAC;CAChE,CAAC;AAgCF,eAAO,MAAM,cAAc,GAAI,OAAO,mBAAmB,sBA6LxD,CAAC"}
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { autoUpdate, useFloating, useInteractions, useListNavigation } from "@floating-ui/react";
|
|
3
|
-
import { FunnelIcon } from "@phosphor-icons/react";
|
|
4
|
-
import React, { forwardRef, Fragment, useEffect, useId, useRef, useState } from "react";
|
|
5
|
-
import { Is } from "sidekicker";
|
|
6
|
-
import { useStableRef } from "../../hooks/use-stable-ref";
|
|
7
|
-
import { useTranslations } from "../../hooks/use-translations";
|
|
8
|
-
import { CombiKeys } from "../../lib/combi-keys";
|
|
9
|
-
import { Dict } from "../../lib/dict";
|
|
10
|
-
import { css, isChildVisible, isReactFC } from "../../lib/dom";
|
|
11
|
-
import { fzf } from "../../lib/fzf";
|
|
12
|
-
import { Shortcut } from "../display/shortcut";
|
|
13
|
-
import { SkeletonCell } from "../display/skeleton";
|
|
14
|
-
import { Modal } from "./modal";
|
|
15
|
-
const Group = (props) => (<span className="flex h-full items-center text-left text-sm font-medium text-secondary">
|
|
16
|
-
{isReactFC(props.item.title) ? <props.item.title text={props.text}/> : props.item.title}
|
|
17
|
-
</span>);
|
|
18
|
-
const Item = forwardRef((props, ref) => {
|
|
19
|
-
const id = useId();
|
|
20
|
-
const active = props.active;
|
|
21
|
-
const item = props.item;
|
|
22
|
-
if (item.type === "group")
|
|
23
|
-
return (<div id={id} className="h-10 px-2 pb-1 pt-2">
|
|
24
|
-
<Group text={props.text} item={item}/>
|
|
25
|
-
</div>);
|
|
26
|
-
if (item.type !== "shortcut")
|
|
27
|
-
return <Fragment />;
|
|
28
|
-
return (<button {...props} id={id} ref={ref} role="option" type="button" aria-selected={active} data-component="command-palette-item" className={css("flex h-10 items-center justify-between rounded-lg p-2 hover:bg-floating-hover", active ? "bg-floating-hover" : "")}>
|
|
29
|
-
<span className="flex items-center gap-2">
|
|
30
|
-
{item.Icon ? item.Icon : null}
|
|
31
|
-
<span>{isReactFC(item.title) ? <item.title text={props.text}/> : item.title}</span>
|
|
32
|
-
</span>
|
|
33
|
-
{item.shortcut ? <Shortcut value={item.shortcut}/> : null}
|
|
34
|
-
</button>);
|
|
35
|
-
});
|
|
36
|
-
const getFuzzyData = (commands, value) => {
|
|
37
|
-
if (value.length === 0)
|
|
38
|
-
return commands;
|
|
39
|
-
const rules = [
|
|
40
|
-
{ key: "title", value },
|
|
41
|
-
{ key: "shortcut", value },
|
|
42
|
-
{ key: "hint", value },
|
|
43
|
-
];
|
|
44
|
-
const normalize = commands.map((x) => ({ ...x, title: Is.function(x.title) ? x.title({ text: value }) : x.title }));
|
|
45
|
-
const target = normalize.reduce((acc, x) => {
|
|
46
|
-
const enabled = Is.function(x.enabled) ? x.enabled({ text: value }) : (x.enabled ?? true);
|
|
47
|
-
if (enabled)
|
|
48
|
-
acc.push({ ...x, enabled: enabled });
|
|
49
|
-
return acc;
|
|
50
|
-
}, []);
|
|
51
|
-
const filter = fzf(target, "title", rules);
|
|
52
|
-
const withEnabled = normalize.filter((x) => (Is.function(x.enabled) ? x.enabled({ text: value }) : false));
|
|
53
|
-
return Dict.unique(filter.concat(withEnabled), (x) => x.title);
|
|
54
|
-
};
|
|
55
|
-
const loadingSkeleton = [0, 0, 0, 0, 0];
|
|
56
|
-
const findFirstClickable = (items) => {
|
|
57
|
-
for (let index = 0; index < items.length; index++) {
|
|
58
|
-
const element = items[index];
|
|
59
|
-
if (element.type === "shortcut")
|
|
60
|
-
return element;
|
|
61
|
-
const recursive = findFirstClickable(element.items);
|
|
62
|
-
if (recursive)
|
|
63
|
-
return recursive;
|
|
64
|
-
}
|
|
65
|
-
return null;
|
|
66
|
-
};
|
|
67
|
-
export const CommandPalette = (props) => {
|
|
68
|
-
const id = useId();
|
|
69
|
-
const scrollContainerRef = useRef(null);
|
|
70
|
-
const [text, setText] = useState("");
|
|
71
|
-
const listRef = useRef([]);
|
|
72
|
-
const translations = useTranslations();
|
|
73
|
-
const valueRef = useStableRef(text);
|
|
74
|
-
const [activeIndex, setActiveIndex] = useState(null);
|
|
75
|
-
useEffect(() => {
|
|
76
|
-
setActiveIndex(null);
|
|
77
|
-
}, [text]);
|
|
78
|
-
const bindKey = props.bind ?? "Mod + k";
|
|
79
|
-
const root = useFloating({
|
|
80
|
-
open: props.open,
|
|
81
|
-
strategy: "absolute",
|
|
82
|
-
whileElementsMounted: autoUpdate,
|
|
83
|
-
onOpenChange: props.onChangeVisibility,
|
|
84
|
-
});
|
|
85
|
-
const commands = props.commands.flatMap((x) => (x.type === "group" ? [x, ...x.items] : [x]));
|
|
86
|
-
const fuzzy = getFuzzyData(commands, text);
|
|
87
|
-
const displayItems = text === ""
|
|
88
|
-
? commands
|
|
89
|
-
: [
|
|
90
|
-
{
|
|
91
|
-
type: "group",
|
|
92
|
-
title: "Results",
|
|
93
|
-
items: [],
|
|
94
|
-
},
|
|
95
|
-
...fuzzy.filter((x) => x.type !== "group"),
|
|
96
|
-
];
|
|
97
|
-
const listNav = useListNavigation(root.context, {
|
|
98
|
-
listRef,
|
|
99
|
-
loop: true,
|
|
100
|
-
activeIndex,
|
|
101
|
-
virtual: true,
|
|
102
|
-
allowEscape: false,
|
|
103
|
-
focusItemOnOpen: true,
|
|
104
|
-
focusItemOnHover: true,
|
|
105
|
-
openOnArrowKeyDown: true,
|
|
106
|
-
scrollItemIntoView: false,
|
|
107
|
-
selectedIndex: activeIndex,
|
|
108
|
-
disabledIndices: (n) => {
|
|
109
|
-
const item = displayItems[n];
|
|
110
|
-
if (item)
|
|
111
|
-
return item.type === "group";
|
|
112
|
-
return false;
|
|
113
|
-
},
|
|
114
|
-
onNavigate: (n) => {
|
|
115
|
-
if (Is.number(n)) {
|
|
116
|
-
if (!isChildVisible(scrollContainerRef.current, listRef.current[n]))
|
|
117
|
-
listRef.current[n]?.scrollIntoView({ block: "start", inline: "start" });
|
|
118
|
-
}
|
|
119
|
-
setActiveIndex((prev) => {
|
|
120
|
-
if (Is.number(n))
|
|
121
|
-
return n;
|
|
122
|
-
return props.open ? (prev ?? 0) : null;
|
|
123
|
-
});
|
|
124
|
-
},
|
|
125
|
-
});
|
|
126
|
-
const { getItemProps, getReferenceProps, getFloatingProps } = useInteractions([listNav]);
|
|
127
|
-
useEffect(() => {
|
|
128
|
-
const combi = new CombiKeys();
|
|
129
|
-
combi.add(bindKey, () => props.onChangeVisibility?.(true));
|
|
130
|
-
commands.forEach((cmd) => {
|
|
131
|
-
if (cmd.type === "group")
|
|
132
|
-
return;
|
|
133
|
-
if (cmd.type === "shortcut" && cmd.shortcut !== undefined)
|
|
134
|
-
combi.add(cmd.shortcut, (event) => cmd.action({
|
|
135
|
-
event,
|
|
136
|
-
setText,
|
|
137
|
-
text: valueRef.current,
|
|
138
|
-
setOpen: props.onChangeVisibility,
|
|
139
|
-
}));
|
|
140
|
-
});
|
|
141
|
-
return combi.register();
|
|
142
|
-
}, [bindKey, commands, props, valueRef]);
|
|
143
|
-
const Icon = props.Icon ?? FunnelIcon;
|
|
144
|
-
return (<Fragment>
|
|
145
|
-
<Modal {...getFloatingProps()} animated={false} closable={false} open={props.open} overlayClickClose ariaTitle="Command palette" bodyClassName="px-0 py-0 pt-0" data-component="command-palette" onChange={props.onChangeVisibility} className="container relative overflow-clip py-0 md:max-w-screen-sm lg:max-w-screen-md">
|
|
146
|
-
<header className="sticky top-0 isolate z-floating flex h-12 w-full items-center overflow-clip border-b border-floating-border bg-floating-background">
|
|
147
|
-
<div className="flex size-10 items-center justify-center">
|
|
148
|
-
{props.Icon ? <Icon Default={FunnelIcon} text={text} size={16}/> : <FunnelIcon size={16}/>}
|
|
149
|
-
</div>
|
|
150
|
-
<input {...getReferenceProps({
|
|
151
|
-
ref: root.refs.setReference,
|
|
152
|
-
onKeyDown: (e) => {
|
|
153
|
-
const item = Is.number(activeIndex) ? displayItems[activeIndex] : null;
|
|
154
|
-
const key = e.key;
|
|
155
|
-
if (key === "Enter") {
|
|
156
|
-
if (item) {
|
|
157
|
-
if (item.type === "shortcut")
|
|
158
|
-
item.action({ event: e, text: text, setOpen: props.onChangeVisibility, setText });
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
const item = findFirstClickable(fuzzy);
|
|
162
|
-
if (item?.type === "shortcut")
|
|
163
|
-
item.action({ event: e, text: text, setOpen: props.onChangeVisibility, setText });
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
},
|
|
167
|
-
})} autoFocus value={text} data-combikeysbypass="true" placeholder="Search for..." onChange={(e) => setText(e.target.value)} className="h-12 w-full items-center bg-transparent px-2 py-2 pb-2 text-left text-lg outline-none"/>
|
|
168
|
-
</header>
|
|
169
|
-
{props.loading ? (<ul role="listbox" data-component="command-palette-list" className="my-2 flex max-h-96 w-full origin-[top_center] flex-col gap-1 overflow-y-auto px-2">
|
|
170
|
-
<div className="h-10 px-2 pb-1 pt-2">{translations.commandPaletteLoading}</div>
|
|
171
|
-
{loadingSkeleton.map((_, i) => (<li key={`${id}-${i}-skeleton-index`} className={css("flex h-10 items-center justify-between rounded-lg p-2 hover:bg-primary hover:text-primary-foreground")}>
|
|
172
|
-
{SkeletonCell}
|
|
173
|
-
</li>))}
|
|
174
|
-
</ul>) : (<div className="flex min-w-full flex-row flex-nowrap" data-component="command-palette-container">
|
|
175
|
-
<ul role="listbox" ref={scrollContainerRef} data-component="command-palette-list" className="my-2 flex h-fit max-h-96 w-full origin-[top_center] flex-col gap-1 overflow-y-auto px-2">
|
|
176
|
-
{displayItems.map((item, index) => (<Item {...getItemProps({
|
|
177
|
-
onMouseEnter: () => setActiveIndex(index),
|
|
178
|
-
ref(node) {
|
|
179
|
-
listRef.current[index] = node;
|
|
180
|
-
},
|
|
181
|
-
onClick(e) {
|
|
182
|
-
e.preventDefault();
|
|
183
|
-
props.onChangeVisibility(false);
|
|
184
|
-
if (item.type === "shortcut")
|
|
185
|
-
item.action({ event: e, text: text, setOpen: props.onChangeVisibility, setText });
|
|
186
|
-
},
|
|
187
|
-
})} item={item} text={text} active={activeIndex === index} key={`${id}-${item.type}-${index}`}/>))}
|
|
188
|
-
{displayItems.length === 1 ? (<div className={css("flex items-center justify-between rounded-lg p-2 text-secondary")}>
|
|
189
|
-
{translations.commandPaletteEmpty ?? props.emptyMessage}
|
|
190
|
-
</div>) : null}
|
|
191
|
-
</ul>
|
|
192
|
-
{props.Preview && Is.number(activeIndex) ? <props.Preview command={displayItems[activeIndex]} text={text}/> : null}
|
|
193
|
-
</div>)}
|
|
194
|
-
{props.footer ? (<footer className="flex h-8 items-center rounded-b-lg border-t border-floating-border p-2">{props.footer}</footer>) : null}
|
|
195
|
-
</Modal>
|
|
196
|
-
</Fragment>);
|
|
197
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from "react";
|
|
2
|
-
type DropdownProps = {
|
|
3
|
-
open?: boolean;
|
|
4
|
-
arrow?: boolean;
|
|
5
|
-
hover?: boolean;
|
|
6
|
-
returnFocus?: boolean;
|
|
7
|
-
restoreFocus?: boolean;
|
|
8
|
-
buttonProps?: React.HTMLProps<"button">;
|
|
9
|
-
onChange?: (nextValue: boolean) => void;
|
|
10
|
-
trigger: React.ReactElement | React.ReactNode;
|
|
11
|
-
title?: React.ReactNode | React.ReactElement | string;
|
|
12
|
-
};
|
|
13
|
-
export declare const Dropdown: (props: PropsWithChildren<DropdownProps>) => React.JSX.Element;
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=dropdown.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../../src/components/floating/dropdown.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,EAAY,iBAAiB,EAA+C,MAAM,OAAO,CAAC;AAExG,KAAK,aAAa,GAAG;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,OAAO,EAAE,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,SAAS,CAAC;IAC9C,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,YAAY,GAAG,MAAM,CAAC;CACzD,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,OAAO,iBAAiB,CAAC,aAAa,CAAC,sBA4E/D,CAAC"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { arrow, autoUpdate, flip, FloatingArrow, FloatingFocusManager, FloatingPortal, offset, shift, useClick, useDismiss, useFloating, useHover, useInteractions, useRole, } from "@floating-ui/react";
|
|
3
|
-
import React, { Fragment, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
4
|
-
export const Dropdown = (props) => {
|
|
5
|
-
const headingId = useId();
|
|
6
|
-
const [open, setOpen] = useState(props.open);
|
|
7
|
-
useEffect(() => setOpen(props.open), [props.open]);
|
|
8
|
-
const arrowRef = useRef(null);
|
|
9
|
-
const middleware = useMemo(() => [
|
|
10
|
-
offset(10),
|
|
11
|
-
flip({ fallbackAxisSideDirection: "end" }),
|
|
12
|
-
shift(),
|
|
13
|
-
arrow({
|
|
14
|
-
padding: 5,
|
|
15
|
-
element: arrowRef,
|
|
16
|
-
}),
|
|
17
|
-
], [props.arrow]);
|
|
18
|
-
const { refs, floatingStyles, context } = useFloating({
|
|
19
|
-
open,
|
|
20
|
-
middleware,
|
|
21
|
-
transform: true,
|
|
22
|
-
whileElementsMounted: autoUpdate,
|
|
23
|
-
onOpenChange: (nextValue, event) => {
|
|
24
|
-
const element = event?.relatedTarget;
|
|
25
|
-
if (element) {
|
|
26
|
-
if (element.dataset.floating === "true" && !nextValue)
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
setOpen(nextValue);
|
|
30
|
-
props.onChange?.(nextValue);
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
const click = useClick(context);
|
|
34
|
-
const hover = useHover(context, { enabled: props.hover ?? false });
|
|
35
|
-
const dismiss = useDismiss(context);
|
|
36
|
-
const role = useRole(context, { role: "dialog" });
|
|
37
|
-
const { getReferenceProps, getFloatingProps } = useInteractions([click, dismiss, role, hover]);
|
|
38
|
-
return (<Fragment>
|
|
39
|
-
<button ref={refs.setReference} {...getReferenceProps(props.buttonProps)} type="button">
|
|
40
|
-
{props.trigger}
|
|
41
|
-
</button>
|
|
42
|
-
{open && (<FloatingPortal preserveTabOrder id={`${headingId}-portal`}>
|
|
43
|
-
<FloatingFocusManager guards restoreFocus={true} returnFocus={true} visuallyHiddenDismiss context={context} modal={false}>
|
|
44
|
-
<div className="relative isolate z-floating rounded-lg border border-floating-border bg-floating-background p-4 shadow-shadow-floating" ref={refs.setFloating} aria-labelledby={headingId} style={floatingStyles} {...getFloatingProps()}>
|
|
45
|
-
<FloatingArrow ref={arrowRef} context={context} strokeWidth={0.1} className="fill-floating-background stroke-floating-border"/>
|
|
46
|
-
<header className="mb-2">
|
|
47
|
-
<h3 id={headingId} className="text-left text-2xl font-medium leading-snug tracking-wide">
|
|
48
|
-
{props.title}
|
|
49
|
-
</h3>
|
|
50
|
-
</header>
|
|
51
|
-
{props.children}
|
|
52
|
-
</div>
|
|
53
|
-
</FloatingFocusManager>
|
|
54
|
-
</FloatingPortal>)}
|
|
55
|
-
</Fragment>);
|
|
56
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { motion } from "motion/react";
|
|
2
|
-
import { PropsWithChildren } from "react";
|
|
3
|
-
import { Label, Override } from "../../types";
|
|
4
|
-
import { ButtonProps } from "../core/button";
|
|
5
|
-
export type ExpandProps = Override<ButtonProps<typeof motion.button>, {
|
|
6
|
-
trigger: Label;
|
|
7
|
-
open?: boolean;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
}>;
|
|
10
|
-
export declare const Expand: (props: PropsWithChildren<ExpandProps>) => import("react").JSX.Element;
|
|
11
|
-
//# sourceMappingURL=expand.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"expand.d.ts","sourceRoot":"","sources":["../../../src/components/floating/expand.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAmB,MAAM,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAsC,MAAM,OAAO,CAAC;AAC9E,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAU,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,MAAM,WAAW,GAAG,QAAQ,CAC9B,WAAW,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,EACjC;IACI,OAAO,EAAE,KAAK,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,CACJ,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,OAAO,iBAAiB,CAAC,WAAW,CAAC,gCAmD3D,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { FloatingFocusManager, FloatingPortal, useClick, useDismiss, useFloating, useInteractions, useRole } from "@floating-ui/react";
|
|
3
|
-
import { AnimatePresence, motion } from "motion/react";
|
|
4
|
-
import { useEffect, useId, useRef, useState } from "react";
|
|
5
|
-
import { Button } from "../core/button";
|
|
6
|
-
export const Expand = (props) => {
|
|
7
|
-
const root = useRef(null);
|
|
8
|
-
const id = useId();
|
|
9
|
-
const wrapperId = `${id}:wrapper`;
|
|
10
|
-
const titleId = `${id}:title`;
|
|
11
|
-
const [open, setOpen] = useState(props.open ?? false);
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
setOpen(props.open ?? false);
|
|
14
|
-
}, [props.open]);
|
|
15
|
-
const { context, refs } = useFloating({
|
|
16
|
-
transform: true,
|
|
17
|
-
open: open !== null,
|
|
18
|
-
nodeId: id,
|
|
19
|
-
onOpenChange: setOpen,
|
|
20
|
-
strategy: "absolute",
|
|
21
|
-
});
|
|
22
|
-
const click = useClick(context, { enabled: !(props.disabled ?? false) });
|
|
23
|
-
const role = useRole(context, { role: "dialog" });
|
|
24
|
-
const dismiss = useDismiss(context, {
|
|
25
|
-
escapeKey: true,
|
|
26
|
-
referencePress: true,
|
|
27
|
-
outsidePress: true,
|
|
28
|
-
});
|
|
29
|
-
const { getFloatingProps, getReferenceProps } = useInteractions([click, role, dismiss]);
|
|
30
|
-
return (<div className="relative inline-flex items-center justify-center" ref={root}>
|
|
31
|
-
<Button {...getReferenceProps(props)} as={motion.button} layoutId={wrapperId} ref={refs.setReference} size="small" onClick={() => setOpen(true)}>
|
|
32
|
-
<motion.span layoutId={titleId}>{props.trigger}</motion.span>
|
|
33
|
-
</Button>
|
|
34
|
-
<AnimatePresence>
|
|
35
|
-
{open ? (<FloatingPortal root={root}>
|
|
36
|
-
<FloatingFocusManager visuallyHiddenDismiss modal closeOnFocusOut context={context}>
|
|
37
|
-
<motion.div {...getFloatingProps()} ref={refs.setFloating} layoutId={wrapperId} className="absolute -left-1/4 -top-3/4">
|
|
38
|
-
{props.children}
|
|
39
|
-
</motion.div>
|
|
40
|
-
</FloatingFocusManager>
|
|
41
|
-
</FloatingPortal>) : null}
|
|
42
|
-
</AnimatePresence>
|
|
43
|
-
</div>);
|
|
44
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { type Icon } from "@phosphor-icons/react";
|
|
2
|
-
import React from "react";
|
|
3
|
-
export type MenuProps = Partial<{
|
|
4
|
-
hover: boolean;
|
|
5
|
-
open?: boolean;
|
|
6
|
-
nested: boolean;
|
|
7
|
-
asChild: boolean;
|
|
8
|
-
isParent: boolean;
|
|
9
|
-
restoreFocus: boolean;
|
|
10
|
-
children: React.ReactNode;
|
|
11
|
-
floatingClassName: string;
|
|
12
|
-
FloatingComponent: React.ElementType;
|
|
13
|
-
} & ({
|
|
14
|
-
label: string;
|
|
15
|
-
} | {
|
|
16
|
-
label: React.ReactElement;
|
|
17
|
-
title: string;
|
|
18
|
-
})>;
|
|
19
|
-
type MenuItemProps = {
|
|
20
|
-
title: string;
|
|
21
|
-
disabled?: boolean;
|
|
22
|
-
Right?: Icon;
|
|
23
|
-
};
|
|
24
|
-
export declare const MenuItem: React.ForwardRefExoticComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof MenuItemProps> & MenuItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
25
|
-
export declare const Menu: React.ForwardRefExoticComponent<(Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "children" | "hover" | "open" | "asChild" | "restoreFocus" | "nested" | "isParent" | "floatingClassName" | "FloatingComponent"> & Partial<{
|
|
26
|
-
hover: boolean;
|
|
27
|
-
open?: boolean;
|
|
28
|
-
nested: boolean;
|
|
29
|
-
asChild: boolean;
|
|
30
|
-
isParent: boolean;
|
|
31
|
-
restoreFocus: boolean;
|
|
32
|
-
children: React.ReactNode;
|
|
33
|
-
floatingClassName: string;
|
|
34
|
-
FloatingComponent: React.ElementType;
|
|
35
|
-
} & {
|
|
36
|
-
label: string;
|
|
37
|
-
}>, "ref"> | Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "label" | "children" | "hover" | "open" | "asChild" | "restoreFocus" | "nested" | "isParent" | "floatingClassName" | "FloatingComponent"> & Partial<{
|
|
38
|
-
hover: boolean;
|
|
39
|
-
open?: boolean;
|
|
40
|
-
nested: boolean;
|
|
41
|
-
asChild: boolean;
|
|
42
|
-
isParent: boolean;
|
|
43
|
-
restoreFocus: boolean;
|
|
44
|
-
children: React.ReactNode;
|
|
45
|
-
floatingClassName: string;
|
|
46
|
-
FloatingComponent: React.ElementType;
|
|
47
|
-
} & {
|
|
48
|
-
label: React.ReactElement;
|
|
49
|
-
title: string;
|
|
50
|
-
}>, "ref">) & React.RefAttributes<HTMLButtonElement>>;
|
|
51
|
-
export {};
|
|
52
|
-
//# sourceMappingURL=menu.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../src/components/floating/menu.tsx"],"names":[],"mappings":"AA0BA,OAAO,EAAkB,KAAK,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAA2E,MAAM,OAAO,CAAC;AA6BhG,MAAM,MAAM,SAAS,GAAG,OAAO,CAC3B;IACI,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,KAAK,CAAC,WAAW,CAAC;CACxC,GAAG,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CACzE,CAAC;AA0KF,KAAK,aAAa,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAEzE,eAAO,MAAM,QAAQ,oKAkCpB,CAAC;AAEF,eAAO,MAAM,IAAI;WA1NF,OAAO;WACP,OAAO;YACN,OAAO;aACN,OAAO;cACN,OAAO;kBACH,OAAO;cACX,KAAK,CAAC,SAAS;uBACN,MAAM;uBACN,KAAK,CAAC,WAAW;;WAC1B,MAAM;;WATT,OAAO;WACP,OAAO;YACN,OAAO;aACN,OAAO;cACN,OAAO;kBACH,OAAO;cACX,KAAK,CAAC,SAAS;uBACN,MAAM;uBACN,KAAK,CAAC,WAAW;;WACN,KAAK,CAAC,YAAY;WAAS,MAAM;qDA0NrE,CAAC"}
|