@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,2576 +0,0 @@
|
|
|
1
|
-
import { jsx as x, jsxs as U } from "react/jsx-runtime";
|
|
2
|
-
import { c as an } from "./index-DlJ_2RBL.js";
|
|
3
|
-
import { c as cn } from "./CheckCircle.es-C6QWLfk_.js";
|
|
4
|
-
import * as u from "react";
|
|
5
|
-
import { createElement as et, useState as un, useEffect as ln, createContext as dn, useContext as fn, useCallback as tt, useRef as pn } from "react";
|
|
6
|
-
import { p as hn } from "./IconBase.es-DJ1oCtpo.js";
|
|
7
|
-
import { e as ae } from "./Info.es-CrZKs4q4.js";
|
|
8
|
-
import { r as nt } from "./Warning.es-D_eI6tLe.js";
|
|
9
|
-
import { e as mn } from "./X.es-BJ1O93El.js";
|
|
10
|
-
import { c as st } from "./dom-CyQHY7ID.js";
|
|
11
|
-
import { A as gn, m as yt } from "./proxy-BZcQiBrp.js";
|
|
12
|
-
import { w as bn, s as yn } from "./index-DE4shK8D.js";
|
|
13
|
-
import { a as vn, t as vt, g as rt, b as wn, c as En } from "./index.esm-BaIwleSE.js";
|
|
14
|
-
import * as de from "react-dom";
|
|
15
|
-
const xn = /* @__PURE__ */ new Map([
|
|
16
|
-
[
|
|
17
|
-
"bold",
|
|
18
|
-
/* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement("path", { d: "M236,128a108,108,0,0,1-216,0c0-42.52,24.73-81.34,63-98.9A12,12,0,1,1,93,50.91C63.24,64.57,44,94.83,44,128a84,84,0,0,0,168,0c0-33.17-19.24-63.43-49-77.09A12,12,0,1,1,173,29.1C211.27,46.66,236,85.48,236,128Z" }))
|
|
19
|
-
],
|
|
20
|
-
[
|
|
21
|
-
"duotone",
|
|
22
|
-
/* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement("path", { d: "M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z", opacity: "0.2" }), /* @__PURE__ */ u.createElement("path", { d: "M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z" }))
|
|
23
|
-
],
|
|
24
|
-
[
|
|
25
|
-
"fill",
|
|
26
|
-
/* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement("path", { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,176A72,72,0,0,1,92,65.64a8,8,0,0,1,8,13.85,56,56,0,1,0,56,0,8,8,0,0,1,8-13.85A72,72,0,0,1,128,200Z" }))
|
|
27
|
-
],
|
|
28
|
-
[
|
|
29
|
-
"light",
|
|
30
|
-
/* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement("path", { d: "M230,128a102,102,0,0,1-204,0c0-40.18,23.35-76.86,59.5-93.45a6,6,0,0,1,5,10.9C58.61,60.09,38,92.49,38,128a90,90,0,0,0,180,0c0-35.51-20.61-67.91-52.5-82.55a6,6,0,0,1,5-10.9C206.65,51.14,230,87.82,230,128Z" }))
|
|
31
|
-
],
|
|
32
|
-
[
|
|
33
|
-
"regular",
|
|
34
|
-
/* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement("path", { d: "M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z" }))
|
|
35
|
-
],
|
|
36
|
-
[
|
|
37
|
-
"thin",
|
|
38
|
-
/* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement("path", { d: "M228,128a100,100,0,0,1-200,0c0-39.4,22.9-75.37,58.33-91.63a4,4,0,1,1,3.34,7.27C57.07,58.6,36,91.71,36,128a92,92,0,0,0,184,0c0-36.29-21.07-69.4-53.67-84.36a4,4,0,1,1,3.34-7.27C205.1,52.63,228,88.6,228,128Z" }))
|
|
39
|
-
]
|
|
40
|
-
]), wt = u.forwardRef((t, e) => /* @__PURE__ */ u.createElement(hn, { ref: e, ...t, weights: xn }));
|
|
41
|
-
wt.displayName = "CircleNotchIcon";
|
|
42
|
-
function K(t) {
|
|
43
|
-
return t?.ownerDocument || document;
|
|
44
|
-
}
|
|
45
|
-
const ot = {};
|
|
46
|
-
function se(t, e) {
|
|
47
|
-
const n = u.useRef(ot);
|
|
48
|
-
return n.current === ot && (n.current = t(e)), n;
|
|
49
|
-
}
|
|
50
|
-
const Me = u[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0, -3)], Sn = (
|
|
51
|
-
// React 17 doesn't have useInsertionEffect.
|
|
52
|
-
Me && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late.
|
|
53
|
-
Me !== u.useLayoutEffect ? Me : (t) => t()
|
|
54
|
-
);
|
|
55
|
-
function X(t) {
|
|
56
|
-
const e = se(Tn).current;
|
|
57
|
-
return e.next = t, Sn(e.effect), e.trampoline;
|
|
58
|
-
}
|
|
59
|
-
function Tn() {
|
|
60
|
-
const t = {
|
|
61
|
-
next: void 0,
|
|
62
|
-
callback: Cn,
|
|
63
|
-
trampoline: (...e) => t.callback?.(...e),
|
|
64
|
-
effect: () => {
|
|
65
|
-
t.callback = t.next;
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
return t;
|
|
69
|
-
}
|
|
70
|
-
function Cn() {
|
|
71
|
-
if (process.env.NODE_ENV !== "production")
|
|
72
|
-
throw (
|
|
73
|
-
/* minify-error-disabled */
|
|
74
|
-
new Error("Base UI: Cannot call an event handler while rendering.")
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
const Nn = () => {
|
|
78
|
-
}, $ = typeof document < "u" ? u.useLayoutEffect : Nn;
|
|
79
|
-
function Dn() {
|
|
80
|
-
}
|
|
81
|
-
const W = Object.freeze({}), In = {
|
|
82
|
-
clipPath: "inset(50%)",
|
|
83
|
-
position: "fixed",
|
|
84
|
-
top: 0,
|
|
85
|
-
left: 0
|
|
86
|
-
}, Sr = "none", Tr = "track-press", Cr = "input-change", Rn = "focus-out", Nr = "keyboard", Dr = "drag";
|
|
87
|
-
function On(t, e, n, s) {
|
|
88
|
-
let r = !1, o = !1;
|
|
89
|
-
const c = s ?? W;
|
|
90
|
-
return {
|
|
91
|
-
reason: t,
|
|
92
|
-
event: e ?? new Event("base-ui"),
|
|
93
|
-
cancel() {
|
|
94
|
-
r = !0;
|
|
95
|
-
},
|
|
96
|
-
allowPropagation() {
|
|
97
|
-
o = !0;
|
|
98
|
-
},
|
|
99
|
-
get isCanceled() {
|
|
100
|
-
return r;
|
|
101
|
-
},
|
|
102
|
-
get isPropagationAllowed() {
|
|
103
|
-
return o;
|
|
104
|
-
},
|
|
105
|
-
trigger: n,
|
|
106
|
-
...c
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
function Ir(t, e, n) {
|
|
110
|
-
const s = W;
|
|
111
|
-
return {
|
|
112
|
-
reason: t,
|
|
113
|
-
event: e ?? new Event("base-ui"),
|
|
114
|
-
...s
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
const Le = {
|
|
118
|
-
...u
|
|
119
|
-
};
|
|
120
|
-
let it = 0;
|
|
121
|
-
function Pn(t, e = "mui") {
|
|
122
|
-
const [n, s] = u.useState(t), r = t || n;
|
|
123
|
-
return u.useEffect(() => {
|
|
124
|
-
n == null && (it += 1, s(`${e}-${it}`));
|
|
125
|
-
}, [n, e]), r;
|
|
126
|
-
}
|
|
127
|
-
const at = Le.useId;
|
|
128
|
-
function He(t, e) {
|
|
129
|
-
if (at !== void 0) {
|
|
130
|
-
const n = at();
|
|
131
|
-
return t ?? (e ? `${e}-${n}` : n);
|
|
132
|
-
}
|
|
133
|
-
return Pn(t, e);
|
|
134
|
-
}
|
|
135
|
-
function Y(t, ...e) {
|
|
136
|
-
const n = new URL("https://base-ui.com/production-error");
|
|
137
|
-
return n.searchParams.set("code", t.toString()), e.forEach((s) => n.searchParams.append("args[]", s)), `Base UI error #${t}; visit ${n} for the full message.`;
|
|
138
|
-
}
|
|
139
|
-
function ct(t, e, n, s) {
|
|
140
|
-
const r = se(Et).current;
|
|
141
|
-
return Fn(r, t, e, n, s) && xt(r, [t, e, n, s]), r.callback;
|
|
142
|
-
}
|
|
143
|
-
function kn(t) {
|
|
144
|
-
const e = se(Et).current;
|
|
145
|
-
return Mn(e, t) && xt(e, t), e.callback;
|
|
146
|
-
}
|
|
147
|
-
function Et() {
|
|
148
|
-
return {
|
|
149
|
-
callback: null,
|
|
150
|
-
cleanup: null,
|
|
151
|
-
refs: []
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
function Fn(t, e, n, s, r) {
|
|
155
|
-
return t.refs[0] !== e || t.refs[1] !== n || t.refs[2] !== s || t.refs[3] !== r;
|
|
156
|
-
}
|
|
157
|
-
function Mn(t, e) {
|
|
158
|
-
return t.refs.length !== e.length || t.refs.some((n, s) => n !== e[s]);
|
|
159
|
-
}
|
|
160
|
-
function xt(t, e) {
|
|
161
|
-
if (t.refs = e, e.every((n) => n == null)) {
|
|
162
|
-
t.callback = null;
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
t.callback = (n) => {
|
|
166
|
-
if (t.cleanup && (t.cleanup(), t.cleanup = null), n != null) {
|
|
167
|
-
const s = Array(e.length).fill(null);
|
|
168
|
-
for (let r = 0; r < e.length; r += 1) {
|
|
169
|
-
const o = e[r];
|
|
170
|
-
if (o != null)
|
|
171
|
-
switch (typeof o) {
|
|
172
|
-
case "function": {
|
|
173
|
-
const c = o(n);
|
|
174
|
-
typeof c == "function" && (s[r] = c);
|
|
175
|
-
break;
|
|
176
|
-
}
|
|
177
|
-
case "object": {
|
|
178
|
-
o.current = n;
|
|
179
|
-
break;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
t.cleanup = () => {
|
|
184
|
-
for (let r = 0; r < e.length; r += 1) {
|
|
185
|
-
const o = e[r];
|
|
186
|
-
if (o != null)
|
|
187
|
-
switch (typeof o) {
|
|
188
|
-
case "function": {
|
|
189
|
-
const c = s[r];
|
|
190
|
-
typeof c == "function" ? c() : o(null);
|
|
191
|
-
break;
|
|
192
|
-
}
|
|
193
|
-
case "object": {
|
|
194
|
-
o.current = null;
|
|
195
|
-
break;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
const An = parseInt(u.version, 10);
|
|
204
|
-
function We(t) {
|
|
205
|
-
return An >= t;
|
|
206
|
-
}
|
|
207
|
-
function ut(t) {
|
|
208
|
-
if (!/* @__PURE__ */ u.isValidElement(t))
|
|
209
|
-
return null;
|
|
210
|
-
const e = t, n = e.props;
|
|
211
|
-
return (We(19) ? n?.ref : e.ref) ?? null;
|
|
212
|
-
}
|
|
213
|
-
function $e(t, e) {
|
|
214
|
-
if (t && !e)
|
|
215
|
-
return t;
|
|
216
|
-
if (!t && e)
|
|
217
|
-
return e;
|
|
218
|
-
if (t || e)
|
|
219
|
-
return {
|
|
220
|
-
...t,
|
|
221
|
-
...e
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
function Vn(t, e) {
|
|
225
|
-
const n = {};
|
|
226
|
-
for (const s in t) {
|
|
227
|
-
const r = t[s];
|
|
228
|
-
if (e?.hasOwnProperty(s)) {
|
|
229
|
-
const o = e[s](r);
|
|
230
|
-
o != null && Object.assign(n, o);
|
|
231
|
-
continue;
|
|
232
|
-
}
|
|
233
|
-
r === !0 ? n[`data-${s.toLowerCase()}`] = "" : r && (n[`data-${s.toLowerCase()}`] = r.toString());
|
|
234
|
-
}
|
|
235
|
-
return n;
|
|
236
|
-
}
|
|
237
|
-
function _n(t, e) {
|
|
238
|
-
return typeof t == "function" ? t(e) : t;
|
|
239
|
-
}
|
|
240
|
-
function Ln(t, e) {
|
|
241
|
-
return typeof t == "function" ? t(e) : t;
|
|
242
|
-
}
|
|
243
|
-
const ce = {};
|
|
244
|
-
function St(t, e, n, s, r) {
|
|
245
|
-
let o = {
|
|
246
|
-
...Ue(t, ce)
|
|
247
|
-
};
|
|
248
|
-
return e && (o = Se(o, e)), n && (o = Se(o, n)), s && (o = Se(o, s)), o;
|
|
249
|
-
}
|
|
250
|
-
function $n(t) {
|
|
251
|
-
if (t.length === 0)
|
|
252
|
-
return ce;
|
|
253
|
-
if (t.length === 1)
|
|
254
|
-
return Ue(t[0], ce);
|
|
255
|
-
let e = {
|
|
256
|
-
...Ue(t[0], ce)
|
|
257
|
-
};
|
|
258
|
-
for (let n = 1; n < t.length; n += 1)
|
|
259
|
-
e = Se(e, t[n]);
|
|
260
|
-
return e;
|
|
261
|
-
}
|
|
262
|
-
function Se(t, e) {
|
|
263
|
-
return Tt(e) ? e(t) : Un(t, e);
|
|
264
|
-
}
|
|
265
|
-
function Un(t, e) {
|
|
266
|
-
if (!e)
|
|
267
|
-
return t;
|
|
268
|
-
for (const n in e) {
|
|
269
|
-
const s = e[n];
|
|
270
|
-
switch (n) {
|
|
271
|
-
case "style": {
|
|
272
|
-
t[n] = $e(t.style, s);
|
|
273
|
-
break;
|
|
274
|
-
}
|
|
275
|
-
case "className": {
|
|
276
|
-
t[n] = Ct(t.className, s);
|
|
277
|
-
break;
|
|
278
|
-
}
|
|
279
|
-
default:
|
|
280
|
-
jn(n, s) ? t[n] = Bn(t[n], s) : t[n] = s;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
return t;
|
|
284
|
-
}
|
|
285
|
-
function jn(t, e) {
|
|
286
|
-
const n = t.charCodeAt(0), s = t.charCodeAt(1), r = t.charCodeAt(2);
|
|
287
|
-
return n === 111 && s === 110 && r >= 65 && r <= 90 && (typeof e == "function" || typeof e > "u");
|
|
288
|
-
}
|
|
289
|
-
function Tt(t) {
|
|
290
|
-
return typeof t == "function";
|
|
291
|
-
}
|
|
292
|
-
function Ue(t, e) {
|
|
293
|
-
return Tt(t) ? t(e) : t ?? ce;
|
|
294
|
-
}
|
|
295
|
-
function Bn(t, e) {
|
|
296
|
-
return e ? t ? (n) => {
|
|
297
|
-
if (zn(n)) {
|
|
298
|
-
const r = n;
|
|
299
|
-
je(r);
|
|
300
|
-
const o = e(r);
|
|
301
|
-
return r.baseUIHandlerPrevented || t?.(r), o;
|
|
302
|
-
}
|
|
303
|
-
const s = e(n);
|
|
304
|
-
return t?.(n), s;
|
|
305
|
-
} : e : t;
|
|
306
|
-
}
|
|
307
|
-
function je(t) {
|
|
308
|
-
return t.preventBaseUIHandler = () => {
|
|
309
|
-
t.baseUIHandlerPrevented = !0;
|
|
310
|
-
}, t;
|
|
311
|
-
}
|
|
312
|
-
function Ct(t, e) {
|
|
313
|
-
return e ? t ? e + " " + t : e : t;
|
|
314
|
-
}
|
|
315
|
-
function zn(t) {
|
|
316
|
-
return t != null && typeof t == "object" && "nativeEvent" in t;
|
|
317
|
-
}
|
|
318
|
-
function Q(t, e, n = {}) {
|
|
319
|
-
const s = e.render, r = Hn(e, n);
|
|
320
|
-
if (n.enabled === !1)
|
|
321
|
-
return null;
|
|
322
|
-
const o = n.state ?? W;
|
|
323
|
-
return Kn(t, s, r, o);
|
|
324
|
-
}
|
|
325
|
-
function Hn(t, e = {}) {
|
|
326
|
-
const {
|
|
327
|
-
className: n,
|
|
328
|
-
style: s,
|
|
329
|
-
render: r
|
|
330
|
-
} = t, {
|
|
331
|
-
state: o = W,
|
|
332
|
-
ref: c,
|
|
333
|
-
props: i,
|
|
334
|
-
stateAttributesMapping: l,
|
|
335
|
-
enabled: a = !0
|
|
336
|
-
} = e, d = a ? _n(n, o) : void 0, f = a ? Ln(s, o) : void 0, p = a ? Vn(o, l) : W, h = a ? $e(p, Array.isArray(i) ? $n(i) : i) ?? W : W;
|
|
337
|
-
return typeof document < "u" && (a ? Array.isArray(c) ? h.ref = kn([h.ref, ut(r), ...c]) : h.ref = ct(h.ref, ut(r), c) : ct(null, null)), a ? (d !== void 0 && (h.className = Ct(h.className, d)), f !== void 0 && (h.style = $e(h.style, f)), h) : W;
|
|
338
|
-
}
|
|
339
|
-
const Wn = /* @__PURE__ */ Symbol.for("react.lazy");
|
|
340
|
-
function Kn(t, e, n, s) {
|
|
341
|
-
if (e) {
|
|
342
|
-
if (typeof e == "function")
|
|
343
|
-
return e(n, s);
|
|
344
|
-
const r = St(n, e.props);
|
|
345
|
-
r.ref = n.ref;
|
|
346
|
-
let o = e;
|
|
347
|
-
if (o?.$$typeof === Wn && (o = u.Children.toArray(e)[0]), process.env.NODE_ENV !== "production" && !/* @__PURE__ */ u.isValidElement(o))
|
|
348
|
-
throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.", "A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.", "https://base-ui.com/r/invalid-render-prop"].join(`
|
|
349
|
-
`));
|
|
350
|
-
return /* @__PURE__ */ u.cloneElement(o, r);
|
|
351
|
-
}
|
|
352
|
-
if (t && typeof t == "string")
|
|
353
|
-
return qn(t, n);
|
|
354
|
-
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: Render element or function are not defined." : Y(8));
|
|
355
|
-
}
|
|
356
|
-
function qn(t, e) {
|
|
357
|
-
return t === "button" ? /* @__PURE__ */ et("button", {
|
|
358
|
-
type: "button",
|
|
359
|
-
...e,
|
|
360
|
-
key: e.key
|
|
361
|
-
}) : t === "img" ? /* @__PURE__ */ et("img", {
|
|
362
|
-
alt: "",
|
|
363
|
-
...e,
|
|
364
|
-
key: e.key
|
|
365
|
-
}) : /* @__PURE__ */ u.createElement(t, e);
|
|
366
|
-
}
|
|
367
|
-
const fe = typeof navigator < "u", Ae = Jn(), Yn = es(), Gn = Qn();
|
|
368
|
-
typeof CSS > "u" || !CSS.supports || CSS.supports("-webkit-backdrop-filter:none");
|
|
369
|
-
Ae.platform === "MacIntel" && Ae.maxTouchPoints > 1 || /iP(hone|ad|od)|iOS/.test(Ae.platform);
|
|
370
|
-
const Zn = fe && /apple/i.test(navigator.vendor);
|
|
371
|
-
fe && Yn.toLowerCase().startsWith("mac") && navigator.maxTouchPoints;
|
|
372
|
-
const Xn = Gn.includes("jsdom/");
|
|
373
|
-
function Jn() {
|
|
374
|
-
if (!fe)
|
|
375
|
-
return {
|
|
376
|
-
platform: "",
|
|
377
|
-
maxTouchPoints: -1
|
|
378
|
-
};
|
|
379
|
-
const t = navigator.userAgentData;
|
|
380
|
-
return t?.platform ? {
|
|
381
|
-
platform: t.platform,
|
|
382
|
-
maxTouchPoints: navigator.maxTouchPoints
|
|
383
|
-
} : {
|
|
384
|
-
platform: navigator.platform ?? "",
|
|
385
|
-
maxTouchPoints: navigator.maxTouchPoints ?? -1
|
|
386
|
-
};
|
|
387
|
-
}
|
|
388
|
-
function Qn() {
|
|
389
|
-
if (!fe)
|
|
390
|
-
return "";
|
|
391
|
-
const t = navigator.userAgentData;
|
|
392
|
-
return t && Array.isArray(t.brands) ? t.brands.map(({
|
|
393
|
-
brand: e,
|
|
394
|
-
version: n
|
|
395
|
-
}) => `${e}/${n}`).join(" ") : navigator.userAgent;
|
|
396
|
-
}
|
|
397
|
-
function es() {
|
|
398
|
-
if (!fe)
|
|
399
|
-
return "";
|
|
400
|
-
const t = navigator.userAgentData;
|
|
401
|
-
return t?.platform ? t.platform : navigator.platform ?? "";
|
|
402
|
-
}
|
|
403
|
-
function ue(t) {
|
|
404
|
-
let e = t.activeElement;
|
|
405
|
-
for (; e?.shadowRoot?.activeElement != null; )
|
|
406
|
-
e = e.shadowRoot.activeElement;
|
|
407
|
-
return e;
|
|
408
|
-
}
|
|
409
|
-
function J(t, e) {
|
|
410
|
-
if (!t || !e)
|
|
411
|
-
return !1;
|
|
412
|
-
const n = e.getRootNode?.();
|
|
413
|
-
if (t.contains(e))
|
|
414
|
-
return !0;
|
|
415
|
-
if (n && vn(n)) {
|
|
416
|
-
let s = e;
|
|
417
|
-
for (; s; ) {
|
|
418
|
-
if (t === s)
|
|
419
|
-
return !0;
|
|
420
|
-
s = s.parentNode || s.host;
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
return !1;
|
|
424
|
-
}
|
|
425
|
-
function Ke(t) {
|
|
426
|
-
return "composedPath" in t ? t.composedPath()[0] : t.target;
|
|
427
|
-
}
|
|
428
|
-
function Be(t) {
|
|
429
|
-
if (!t || Xn)
|
|
430
|
-
return !0;
|
|
431
|
-
try {
|
|
432
|
-
return t.matches(":focus-visible");
|
|
433
|
-
} catch {
|
|
434
|
-
return !0;
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
const Nt = () => ({
|
|
438
|
-
getShadowRoot: !0,
|
|
439
|
-
displayCheck: (
|
|
440
|
-
// JSDOM does not support the `tabbable` library. To solve this we can
|
|
441
|
-
// check if `ResizeObserver` is a real function (not polyfilled), which
|
|
442
|
-
// determines if the current environment is JSDOM-like.
|
|
443
|
-
typeof ResizeObserver == "function" && ResizeObserver.toString().includes("[native code]") ? "full" : "none"
|
|
444
|
-
)
|
|
445
|
-
});
|
|
446
|
-
function Dt(t, e) {
|
|
447
|
-
const n = vt(t, Nt()), s = n.length;
|
|
448
|
-
if (s === 0)
|
|
449
|
-
return;
|
|
450
|
-
const r = ue(K(t)), o = n.indexOf(r), c = o === -1 ? e === 1 ? 0 : s - 1 : o + e;
|
|
451
|
-
return n[c];
|
|
452
|
-
}
|
|
453
|
-
function ts(t) {
|
|
454
|
-
return Dt(K(t).body, 1) || t;
|
|
455
|
-
}
|
|
456
|
-
function ns(t) {
|
|
457
|
-
return Dt(K(t).body, -1) || t;
|
|
458
|
-
}
|
|
459
|
-
function Ve(t, e) {
|
|
460
|
-
const n = e || t.currentTarget, s = t.relatedTarget;
|
|
461
|
-
return !s || !J(n, s);
|
|
462
|
-
}
|
|
463
|
-
function ss(t) {
|
|
464
|
-
vt(t, Nt()).forEach((n) => {
|
|
465
|
-
n.dataset.tabindex = n.getAttribute("tabindex") || "", n.setAttribute("tabindex", "-1");
|
|
466
|
-
});
|
|
467
|
-
}
|
|
468
|
-
function lt(t) {
|
|
469
|
-
t.querySelectorAll("[data-tabindex]").forEach((n) => {
|
|
470
|
-
const s = n.dataset.tabindex;
|
|
471
|
-
delete n.dataset.tabindex, s ? n.setAttribute("tabindex", s) : n.removeAttribute("tabindex");
|
|
472
|
-
});
|
|
473
|
-
}
|
|
474
|
-
const rs = [];
|
|
475
|
-
function qe(t) {
|
|
476
|
-
u.useEffect(t, rs);
|
|
477
|
-
}
|
|
478
|
-
const ve = null;
|
|
479
|
-
let dt = globalThis.requestAnimationFrame;
|
|
480
|
-
class os {
|
|
481
|
-
/* This implementation uses an array as a backing data-structure for frame callbacks.
|
|
482
|
-
* It allows `O(1)` callback cancelling by inserting a `null` in the array, though it
|
|
483
|
-
* never calls the native `cancelAnimationFrame` if there are no frames left. This can
|
|
484
|
-
* be much more efficient if there is a call pattern that alterns as
|
|
485
|
-
* "request-cancel-request-cancel-…".
|
|
486
|
-
* But in the case of "request-request-…-cancel-cancel-…", it leaves the final animation
|
|
487
|
-
* frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */
|
|
488
|
-
callbacks = [];
|
|
489
|
-
callbacksCount = 0;
|
|
490
|
-
nextId = 1;
|
|
491
|
-
startId = 1;
|
|
492
|
-
isScheduled = !1;
|
|
493
|
-
tick = (e) => {
|
|
494
|
-
this.isScheduled = !1;
|
|
495
|
-
const n = this.callbacks, s = this.callbacksCount;
|
|
496
|
-
if (this.callbacks = [], this.callbacksCount = 0, this.startId = this.nextId, s > 0)
|
|
497
|
-
for (let r = 0; r < n.length; r += 1)
|
|
498
|
-
n[r]?.(e);
|
|
499
|
-
};
|
|
500
|
-
request(e) {
|
|
501
|
-
const n = this.nextId;
|
|
502
|
-
this.nextId += 1, this.callbacks.push(e), this.callbacksCount += 1;
|
|
503
|
-
const s = process.env.NODE_ENV !== "production" && dt !== requestAnimationFrame && (dt = requestAnimationFrame, !0);
|
|
504
|
-
return (!this.isScheduled || s) && (requestAnimationFrame(this.tick), this.isScheduled = !0), n;
|
|
505
|
-
}
|
|
506
|
-
cancel(e) {
|
|
507
|
-
const n = e - this.startId;
|
|
508
|
-
n < 0 || n >= this.callbacks.length || (this.callbacks[n] = null, this.callbacksCount -= 1);
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
const we = new os();
|
|
512
|
-
class Ye {
|
|
513
|
-
static create() {
|
|
514
|
-
return new Ye();
|
|
515
|
-
}
|
|
516
|
-
static request(e) {
|
|
517
|
-
return we.request(e);
|
|
518
|
-
}
|
|
519
|
-
static cancel(e) {
|
|
520
|
-
return we.cancel(e);
|
|
521
|
-
}
|
|
522
|
-
currentId = ve;
|
|
523
|
-
/**
|
|
524
|
-
* Executes `fn` after `delay`, clearing any previously scheduled call.
|
|
525
|
-
*/
|
|
526
|
-
request(e) {
|
|
527
|
-
this.cancel(), this.currentId = we.request(() => {
|
|
528
|
-
this.currentId = ve, e();
|
|
529
|
-
});
|
|
530
|
-
}
|
|
531
|
-
cancel = () => {
|
|
532
|
-
this.currentId !== ve && (we.cancel(this.currentId), this.currentId = ve);
|
|
533
|
-
};
|
|
534
|
-
disposeEffect = () => this.cancel;
|
|
535
|
-
}
|
|
536
|
-
function is() {
|
|
537
|
-
const t = se(Ye.create).current;
|
|
538
|
-
return qe(t.disposeEffect), t;
|
|
539
|
-
}
|
|
540
|
-
const as = {
|
|
541
|
-
clipPath: "inset(50%)",
|
|
542
|
-
overflow: "hidden",
|
|
543
|
-
whiteSpace: "nowrap",
|
|
544
|
-
border: 0,
|
|
545
|
-
padding: 0,
|
|
546
|
-
width: 1,
|
|
547
|
-
height: 1,
|
|
548
|
-
margin: -1
|
|
549
|
-
}, It = {
|
|
550
|
-
...as,
|
|
551
|
-
position: "fixed",
|
|
552
|
-
top: 0,
|
|
553
|
-
left: 0
|
|
554
|
-
}, Ce = /* @__PURE__ */ u.createContext(void 0);
|
|
555
|
-
process.env.NODE_ENV !== "production" && (Ce.displayName = "ToastContext");
|
|
556
|
-
function Ge() {
|
|
557
|
-
const t = u.useContext(Ce);
|
|
558
|
-
if (!t)
|
|
559
|
-
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: useToastManager must be used within <Toast.Provider>." : Y(73));
|
|
560
|
-
return t;
|
|
561
|
-
}
|
|
562
|
-
var cs = (t, e, n) => {
|
|
563
|
-
if (e.length === 1 && e[0] === n) {
|
|
564
|
-
let s = !1;
|
|
565
|
-
try {
|
|
566
|
-
const r = {};
|
|
567
|
-
t(r) === r && (s = !0);
|
|
568
|
-
} catch {
|
|
569
|
-
}
|
|
570
|
-
if (s) {
|
|
571
|
-
let r;
|
|
572
|
-
try {
|
|
573
|
-
throw new Error();
|
|
574
|
-
} catch (o) {
|
|
575
|
-
({ stack: r } = o);
|
|
576
|
-
}
|
|
577
|
-
console.warn(
|
|
578
|
-
`The result function returned its own inputs without modification. e.g
|
|
579
|
-
\`createSelector([state => state.todos], todos => todos)\`
|
|
580
|
-
This could lead to inefficient memoization and unnecessary re-renders.
|
|
581
|
-
Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,
|
|
582
|
-
{ stack: r }
|
|
583
|
-
);
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
}, us = (t, e, n) => {
|
|
587
|
-
const { memoize: s, memoizeOptions: r } = e, { inputSelectorResults: o, inputSelectorResultsCopy: c } = t, i = s(() => ({}), ...r);
|
|
588
|
-
if (!(i.apply(null, o) === i.apply(null, c))) {
|
|
589
|
-
let a;
|
|
590
|
-
try {
|
|
591
|
-
throw new Error();
|
|
592
|
-
} catch (d) {
|
|
593
|
-
({ stack: a } = d);
|
|
594
|
-
}
|
|
595
|
-
console.warn(
|
|
596
|
-
`An input selector returned a different result when passed same arguments.
|
|
597
|
-
This means your output selector will likely run more frequently than intended.
|
|
598
|
-
Avoid returning a new reference inside your input selector, e.g.
|
|
599
|
-
\`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,
|
|
600
|
-
{
|
|
601
|
-
arguments: n,
|
|
602
|
-
firstInputs: o,
|
|
603
|
-
secondInputs: c,
|
|
604
|
-
stack: a
|
|
605
|
-
}
|
|
606
|
-
);
|
|
607
|
-
}
|
|
608
|
-
}, ls = {
|
|
609
|
-
inputStabilityCheck: "once",
|
|
610
|
-
identityFunctionCheck: "once"
|
|
611
|
-
}, Te = /* @__PURE__ */ Symbol("NOT_FOUND");
|
|
612
|
-
function ds(t, e = `expected a function, instead received ${typeof t}`) {
|
|
613
|
-
if (typeof t != "function")
|
|
614
|
-
throw new TypeError(e);
|
|
615
|
-
}
|
|
616
|
-
function fs(t, e = `expected an object, instead received ${typeof t}`) {
|
|
617
|
-
if (typeof t != "object")
|
|
618
|
-
throw new TypeError(e);
|
|
619
|
-
}
|
|
620
|
-
function ps(t, e = "expected all items to be functions, instead received the following types: ") {
|
|
621
|
-
if (!t.every((n) => typeof n == "function")) {
|
|
622
|
-
const n = t.map(
|
|
623
|
-
(s) => typeof s == "function" ? `function ${s.name || "unnamed"}()` : typeof s
|
|
624
|
-
).join(", ");
|
|
625
|
-
throw new TypeError(`${e}[${n}]`);
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
var ft = (t) => Array.isArray(t) ? t : [t];
|
|
629
|
-
function hs(t) {
|
|
630
|
-
const e = Array.isArray(t[0]) ? t[0] : t;
|
|
631
|
-
return ps(
|
|
632
|
-
e,
|
|
633
|
-
"createSelector expects all input-selectors to be functions, but received the following types: "
|
|
634
|
-
), e;
|
|
635
|
-
}
|
|
636
|
-
function pt(t, e) {
|
|
637
|
-
const n = [], { length: s } = t;
|
|
638
|
-
for (let r = 0; r < s; r++)
|
|
639
|
-
n.push(t[r].apply(null, e));
|
|
640
|
-
return n;
|
|
641
|
-
}
|
|
642
|
-
var ms = (t, e) => {
|
|
643
|
-
const { identityFunctionCheck: n, inputStabilityCheck: s } = {
|
|
644
|
-
...ls,
|
|
645
|
-
...e
|
|
646
|
-
};
|
|
647
|
-
return {
|
|
648
|
-
identityFunctionCheck: {
|
|
649
|
-
shouldRun: n === "always" || n === "once" && t,
|
|
650
|
-
run: cs
|
|
651
|
-
},
|
|
652
|
-
inputStabilityCheck: {
|
|
653
|
-
shouldRun: s === "always" || s === "once" && t,
|
|
654
|
-
run: us
|
|
655
|
-
}
|
|
656
|
-
};
|
|
657
|
-
};
|
|
658
|
-
function gs(t) {
|
|
659
|
-
let e;
|
|
660
|
-
return {
|
|
661
|
-
get(n) {
|
|
662
|
-
return e && t(e.key, n) ? e.value : Te;
|
|
663
|
-
},
|
|
664
|
-
put(n, s) {
|
|
665
|
-
e = { key: n, value: s };
|
|
666
|
-
},
|
|
667
|
-
getEntries() {
|
|
668
|
-
return e ? [e] : [];
|
|
669
|
-
},
|
|
670
|
-
clear() {
|
|
671
|
-
e = void 0;
|
|
672
|
-
}
|
|
673
|
-
};
|
|
674
|
-
}
|
|
675
|
-
function bs(t, e) {
|
|
676
|
-
let n = [];
|
|
677
|
-
function s(i) {
|
|
678
|
-
const l = n.findIndex((a) => e(i, a.key));
|
|
679
|
-
if (l > -1) {
|
|
680
|
-
const a = n[l];
|
|
681
|
-
return l > 0 && (n.splice(l, 1), n.unshift(a)), a.value;
|
|
682
|
-
}
|
|
683
|
-
return Te;
|
|
684
|
-
}
|
|
685
|
-
function r(i, l) {
|
|
686
|
-
s(i) === Te && (n.unshift({ key: i, value: l }), n.length > t && n.pop());
|
|
687
|
-
}
|
|
688
|
-
function o() {
|
|
689
|
-
return n;
|
|
690
|
-
}
|
|
691
|
-
function c() {
|
|
692
|
-
n = [];
|
|
693
|
-
}
|
|
694
|
-
return { get: s, put: r, getEntries: o, clear: c };
|
|
695
|
-
}
|
|
696
|
-
var ys = (t, e) => t === e;
|
|
697
|
-
function vs(t) {
|
|
698
|
-
return function(n, s) {
|
|
699
|
-
if (n === null || s === null || n.length !== s.length)
|
|
700
|
-
return !1;
|
|
701
|
-
const { length: r } = n;
|
|
702
|
-
for (let o = 0; o < r; o++)
|
|
703
|
-
if (!t(n[o], s[o]))
|
|
704
|
-
return !1;
|
|
705
|
-
return !0;
|
|
706
|
-
};
|
|
707
|
-
}
|
|
708
|
-
function ws(t, e) {
|
|
709
|
-
const n = typeof e == "object" ? e : { equalityCheck: e }, {
|
|
710
|
-
equalityCheck: s = ys,
|
|
711
|
-
maxSize: r = 1,
|
|
712
|
-
resultEqualityCheck: o
|
|
713
|
-
} = n, c = vs(s);
|
|
714
|
-
let i = 0;
|
|
715
|
-
const l = r <= 1 ? gs(c) : bs(r, c);
|
|
716
|
-
function a() {
|
|
717
|
-
let d = l.get(arguments);
|
|
718
|
-
if (d === Te) {
|
|
719
|
-
if (d = t.apply(null, arguments), i++, o) {
|
|
720
|
-
const p = l.getEntries().find(
|
|
721
|
-
(h) => o(h.value, d)
|
|
722
|
-
);
|
|
723
|
-
p && (d = p.value, i !== 0 && i--);
|
|
724
|
-
}
|
|
725
|
-
l.put(arguments, d);
|
|
726
|
-
}
|
|
727
|
-
return d;
|
|
728
|
-
}
|
|
729
|
-
return a.clearCache = () => {
|
|
730
|
-
l.clear(), a.resetResultsCount();
|
|
731
|
-
}, a.resultsCount = () => i, a.resetResultsCount = () => {
|
|
732
|
-
i = 0;
|
|
733
|
-
}, a;
|
|
734
|
-
}
|
|
735
|
-
var Es = class {
|
|
736
|
-
constructor(t) {
|
|
737
|
-
this.value = t;
|
|
738
|
-
}
|
|
739
|
-
deref() {
|
|
740
|
-
return this.value;
|
|
741
|
-
}
|
|
742
|
-
}, xs = typeof WeakRef < "u" ? WeakRef : Es, Ss = 0, ht = 1;
|
|
743
|
-
function Ee() {
|
|
744
|
-
return {
|
|
745
|
-
s: Ss,
|
|
746
|
-
v: void 0,
|
|
747
|
-
o: null,
|
|
748
|
-
p: null
|
|
749
|
-
};
|
|
750
|
-
}
|
|
751
|
-
function Rt(t, e = {}) {
|
|
752
|
-
let n = Ee();
|
|
753
|
-
const { resultEqualityCheck: s } = e;
|
|
754
|
-
let r, o = 0;
|
|
755
|
-
function c() {
|
|
756
|
-
let i = n;
|
|
757
|
-
const { length: l } = arguments;
|
|
758
|
-
for (let f = 0, p = l; f < p; f++) {
|
|
759
|
-
const h = arguments[f];
|
|
760
|
-
if (typeof h == "function" || typeof h == "object" && h !== null) {
|
|
761
|
-
let m = i.o;
|
|
762
|
-
m === null && (i.o = m = /* @__PURE__ */ new WeakMap());
|
|
763
|
-
const v = m.get(h);
|
|
764
|
-
v === void 0 ? (i = Ee(), m.set(h, i)) : i = v;
|
|
765
|
-
} else {
|
|
766
|
-
let m = i.p;
|
|
767
|
-
m === null && (i.p = m = /* @__PURE__ */ new Map());
|
|
768
|
-
const v = m.get(h);
|
|
769
|
-
v === void 0 ? (i = Ee(), m.set(h, i)) : i = v;
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
const a = i;
|
|
773
|
-
let d;
|
|
774
|
-
if (i.s === ht)
|
|
775
|
-
d = i.v;
|
|
776
|
-
else if (d = t.apply(null, arguments), o++, s) {
|
|
777
|
-
const f = r?.deref?.() ?? r;
|
|
778
|
-
f != null && s(f, d) && (d = f, o !== 0 && o--), r = typeof d == "object" && d !== null || typeof d == "function" ? new xs(d) : d;
|
|
779
|
-
}
|
|
780
|
-
return a.s = ht, a.v = d, d;
|
|
781
|
-
}
|
|
782
|
-
return c.clearCache = () => {
|
|
783
|
-
n = Ee(), c.resetResultsCount();
|
|
784
|
-
}, c.resultsCount = () => o, c.resetResultsCount = () => {
|
|
785
|
-
o = 0;
|
|
786
|
-
}, c;
|
|
787
|
-
}
|
|
788
|
-
function Ot(t, ...e) {
|
|
789
|
-
const n = typeof t == "function" ? {
|
|
790
|
-
memoize: t,
|
|
791
|
-
memoizeOptions: e
|
|
792
|
-
} : t, s = (...r) => {
|
|
793
|
-
let o = 0, c = 0, i, l = {}, a = r.pop();
|
|
794
|
-
typeof a == "object" && (l = a, a = r.pop()), ds(
|
|
795
|
-
a,
|
|
796
|
-
`createSelector expects an output function after the inputs, but received: [${typeof a}]`
|
|
797
|
-
);
|
|
798
|
-
const d = {
|
|
799
|
-
...n,
|
|
800
|
-
...l
|
|
801
|
-
}, {
|
|
802
|
-
memoize: f,
|
|
803
|
-
memoizeOptions: p = [],
|
|
804
|
-
argsMemoize: h = Rt,
|
|
805
|
-
argsMemoizeOptions: m = [],
|
|
806
|
-
devModeChecks: v = {}
|
|
807
|
-
} = d, S = ft(p), R = ft(m), O = hs(r), F = f(function() {
|
|
808
|
-
return o++, a.apply(
|
|
809
|
-
null,
|
|
810
|
-
arguments
|
|
811
|
-
);
|
|
812
|
-
}, ...S);
|
|
813
|
-
let g = !0;
|
|
814
|
-
const T = h(function() {
|
|
815
|
-
c++;
|
|
816
|
-
const P = pt(
|
|
817
|
-
O,
|
|
818
|
-
arguments
|
|
819
|
-
);
|
|
820
|
-
if (i = F.apply(null, P), process.env.NODE_ENV !== "production") {
|
|
821
|
-
const { identityFunctionCheck: j, inputStabilityCheck: ee } = ms(g, v);
|
|
822
|
-
if (j.shouldRun && j.run(
|
|
823
|
-
a,
|
|
824
|
-
P,
|
|
825
|
-
i
|
|
826
|
-
), ee.shouldRun) {
|
|
827
|
-
const G = pt(
|
|
828
|
-
O,
|
|
829
|
-
arguments
|
|
830
|
-
);
|
|
831
|
-
ee.run(
|
|
832
|
-
{ inputSelectorResults: P, inputSelectorResultsCopy: G },
|
|
833
|
-
{ memoize: f, memoizeOptions: S },
|
|
834
|
-
arguments
|
|
835
|
-
);
|
|
836
|
-
}
|
|
837
|
-
g && (g = !1);
|
|
838
|
-
}
|
|
839
|
-
return i;
|
|
840
|
-
}, ...R);
|
|
841
|
-
return Object.assign(T, {
|
|
842
|
-
resultFunc: a,
|
|
843
|
-
memoizedResultFunc: F,
|
|
844
|
-
dependencies: O,
|
|
845
|
-
dependencyRecomputations: () => c,
|
|
846
|
-
resetDependencyRecomputations: () => {
|
|
847
|
-
c = 0;
|
|
848
|
-
},
|
|
849
|
-
lastResult: () => i,
|
|
850
|
-
recomputations: () => o,
|
|
851
|
-
resetRecomputations: () => {
|
|
852
|
-
o = 0;
|
|
853
|
-
},
|
|
854
|
-
memoize: f,
|
|
855
|
-
argsMemoize: h
|
|
856
|
-
});
|
|
857
|
-
};
|
|
858
|
-
return Object.assign(s, {
|
|
859
|
-
withTypes: () => s
|
|
860
|
-
}), s;
|
|
861
|
-
}
|
|
862
|
-
var Ts = /* @__PURE__ */ Ot(Rt), Cs = Object.assign(
|
|
863
|
-
(t, e = Ts) => {
|
|
864
|
-
fs(
|
|
865
|
-
t,
|
|
866
|
-
`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof t}`
|
|
867
|
-
);
|
|
868
|
-
const n = Object.keys(t), s = n.map(
|
|
869
|
-
(o) => t[o]
|
|
870
|
-
);
|
|
871
|
-
return e(
|
|
872
|
-
s,
|
|
873
|
-
(...o) => o.reduce((c, i, l) => (c[n[l]] = i, c), {})
|
|
874
|
-
);
|
|
875
|
-
},
|
|
876
|
-
{ withTypes: () => Cs }
|
|
877
|
-
);
|
|
878
|
-
const Ns = Ot({
|
|
879
|
-
memoize: ws,
|
|
880
|
-
memoizeOptions: {
|
|
881
|
-
maxSize: 1,
|
|
882
|
-
equalityCheck: Object.is
|
|
883
|
-
}
|
|
884
|
-
}), L = (t, e, n, s, r, o, ...c) => {
|
|
885
|
-
if (c.length > 0)
|
|
886
|
-
throw new Error(process.env.NODE_ENV !== "production" ? "Unsupported number of selectors" : Y(1));
|
|
887
|
-
let i;
|
|
888
|
-
if (t && e)
|
|
889
|
-
i = (l, a, d, f) => {
|
|
890
|
-
const p = t(l, a, d, f);
|
|
891
|
-
return e(p, a, d, f);
|
|
892
|
-
};
|
|
893
|
-
else if (t)
|
|
894
|
-
i = t;
|
|
895
|
-
else
|
|
896
|
-
throw (
|
|
897
|
-
/* minify-error-disabled */
|
|
898
|
-
new Error("Missing arguments")
|
|
899
|
-
);
|
|
900
|
-
return i;
|
|
901
|
-
}, Ds = (...t) => {
|
|
902
|
-
const e = /* @__PURE__ */ new WeakMap();
|
|
903
|
-
let n = 1;
|
|
904
|
-
const s = t[t.length - 1], r = t.length - 1 || 1, o = s.length - r;
|
|
905
|
-
if (o > 3)
|
|
906
|
-
throw new Error(process.env.NODE_ENV !== "production" ? "Unsupported number of arguments" : Y(2));
|
|
907
|
-
return (i, l, a, d) => {
|
|
908
|
-
let f = i.__cacheKey__;
|
|
909
|
-
f || (f = {
|
|
910
|
-
id: n
|
|
911
|
-
}, i.__cacheKey__ = f, n += 1);
|
|
912
|
-
let p = e.get(f);
|
|
913
|
-
if (!p) {
|
|
914
|
-
let h = t;
|
|
915
|
-
const m = [void 0, void 0, void 0];
|
|
916
|
-
switch (o) {
|
|
917
|
-
case 0:
|
|
918
|
-
break;
|
|
919
|
-
case 1: {
|
|
920
|
-
h = [...t.slice(0, -1), () => m[0], s];
|
|
921
|
-
break;
|
|
922
|
-
}
|
|
923
|
-
case 2: {
|
|
924
|
-
h = [...t.slice(0, -1), () => m[0], () => m[1], s];
|
|
925
|
-
break;
|
|
926
|
-
}
|
|
927
|
-
case 3: {
|
|
928
|
-
h = [...t.slice(0, -1), () => m[0], () => m[1], () => m[2], s];
|
|
929
|
-
break;
|
|
930
|
-
}
|
|
931
|
-
default:
|
|
932
|
-
throw new Error(process.env.NODE_ENV !== "production" ? "Unsupported number of arguments" : Y(2));
|
|
933
|
-
}
|
|
934
|
-
p = Ns(...h), p.selectorArgs = m, e.set(f, p);
|
|
935
|
-
}
|
|
936
|
-
switch (p.selectorArgs[0] = l, p.selectorArgs[1] = a, p.selectorArgs[2] = d, o) {
|
|
937
|
-
case 0:
|
|
938
|
-
return p(i);
|
|
939
|
-
case 1:
|
|
940
|
-
return p(i, l);
|
|
941
|
-
case 2:
|
|
942
|
-
return p(i, l, a);
|
|
943
|
-
case 3:
|
|
944
|
-
return p(i, l, a, d);
|
|
945
|
-
default:
|
|
946
|
-
throw (
|
|
947
|
-
/* minify-error-disabled */
|
|
948
|
-
new Error("unreachable")
|
|
949
|
-
);
|
|
950
|
-
}
|
|
951
|
-
};
|
|
952
|
-
}, Is = We(19), Rs = Is ? Ps : ks;
|
|
953
|
-
function Pt(t, e, n, s, r) {
|
|
954
|
-
return Rs(t, e, n, s, r);
|
|
955
|
-
}
|
|
956
|
-
function Os(t, e, n, s, r) {
|
|
957
|
-
const o = u.useCallback(() => e(t.getSnapshot(), n, s, r), [t, e, n, s, r]);
|
|
958
|
-
return yn.useSyncExternalStore(t.subscribe, o, o);
|
|
959
|
-
}
|
|
960
|
-
function Ps(t, e, n, s, r) {
|
|
961
|
-
return Os(t, e, n, s, r);
|
|
962
|
-
}
|
|
963
|
-
function ks(t, e, n, s, r) {
|
|
964
|
-
return bn.useSyncExternalStoreWithSelector(t.subscribe, t.getSnapshot, t.getSnapshot, (o) => e(o, n, s, r));
|
|
965
|
-
}
|
|
966
|
-
class Fs {
|
|
967
|
-
/**
|
|
968
|
-
* The current state of the store.
|
|
969
|
-
* This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}.
|
|
970
|
-
* To subscribe to state changes, use the {@link useState} method. The value returned by {@link useState} is updated after the component renders (similarly to React's useState).
|
|
971
|
-
* The values can be used directly (to avoid subscribing to the store) in effects or event handlers.
|
|
972
|
-
*
|
|
973
|
-
* Do not modify properties in state directly. Instead, use the provided methods to ensure proper state management and listener notification.
|
|
974
|
-
*/
|
|
975
|
-
// Internal state to handle recursive `setState()` calls
|
|
976
|
-
constructor(e) {
|
|
977
|
-
this.state = e, this.listeners = /* @__PURE__ */ new Set(), this.updateTick = 0;
|
|
978
|
-
}
|
|
979
|
-
/**
|
|
980
|
-
* Registers a listener that will be called whenever the store's state changes.
|
|
981
|
-
*
|
|
982
|
-
* @param fn The listener function to be called on state changes.
|
|
983
|
-
* @returns A function to unsubscribe the listener.
|
|
984
|
-
*/
|
|
985
|
-
subscribe = (e) => (this.listeners.add(e), () => {
|
|
986
|
-
this.listeners.delete(e);
|
|
987
|
-
});
|
|
988
|
-
/**
|
|
989
|
-
* Returns the current state of the store.
|
|
990
|
-
*/
|
|
991
|
-
getSnapshot = () => this.state;
|
|
992
|
-
/**
|
|
993
|
-
* Updates the entire store's state and notifies all registered listeners.
|
|
994
|
-
*
|
|
995
|
-
* @param newState The new state to set for the store.
|
|
996
|
-
*/
|
|
997
|
-
setState(e) {
|
|
998
|
-
if (this.state === e)
|
|
999
|
-
return;
|
|
1000
|
-
this.state = e, this.updateTick += 1;
|
|
1001
|
-
const n = this.updateTick;
|
|
1002
|
-
for (const s of this.listeners) {
|
|
1003
|
-
if (n !== this.updateTick)
|
|
1004
|
-
return;
|
|
1005
|
-
s(e);
|
|
1006
|
-
}
|
|
1007
|
-
}
|
|
1008
|
-
/**
|
|
1009
|
-
* Merges the provided changes into the current state and notifies listeners if there are changes.
|
|
1010
|
-
*
|
|
1011
|
-
* @param changes An object containing the changes to apply to the current state.
|
|
1012
|
-
*/
|
|
1013
|
-
update(e) {
|
|
1014
|
-
for (const n in e)
|
|
1015
|
-
if (!Object.is(this.state[n], e[n])) {
|
|
1016
|
-
this.setState({
|
|
1017
|
-
...this.state,
|
|
1018
|
-
...e
|
|
1019
|
-
});
|
|
1020
|
-
return;
|
|
1021
|
-
}
|
|
1022
|
-
}
|
|
1023
|
-
/**
|
|
1024
|
-
* Sets a specific key in the store's state to a new value and notifies listeners if the value has changed.
|
|
1025
|
-
*
|
|
1026
|
-
* @param key The key in the store's state to update.
|
|
1027
|
-
* @param value The new value to set for the specified key.
|
|
1028
|
-
*/
|
|
1029
|
-
set(e, n) {
|
|
1030
|
-
Object.is(this.state[e], n) || this.setState({
|
|
1031
|
-
...this.state,
|
|
1032
|
-
[e]: n
|
|
1033
|
-
});
|
|
1034
|
-
}
|
|
1035
|
-
/**
|
|
1036
|
-
* Gives the state a new reference and updates all registered listeners.
|
|
1037
|
-
*/
|
|
1038
|
-
notifyAll() {
|
|
1039
|
-
const e = {
|
|
1040
|
-
...this.state
|
|
1041
|
-
};
|
|
1042
|
-
this.setState(e);
|
|
1043
|
-
}
|
|
1044
|
-
use(e, n, s, r) {
|
|
1045
|
-
return Pt(this, e, n, s, r);
|
|
1046
|
-
}
|
|
1047
|
-
}
|
|
1048
|
-
class Ms extends Fs {
|
|
1049
|
-
/**
|
|
1050
|
-
* Creates a new ReactStore instance.
|
|
1051
|
-
*
|
|
1052
|
-
* @param state Initial state of the store.
|
|
1053
|
-
* @param context Non-reactive context values.
|
|
1054
|
-
* @param selectors Optional selectors for use with `useState`.
|
|
1055
|
-
*/
|
|
1056
|
-
constructor(e, n = {}, s) {
|
|
1057
|
-
super(e), this.context = n, this.selectors = s;
|
|
1058
|
-
}
|
|
1059
|
-
/**
|
|
1060
|
-
* Non-reactive values such as refs, callbacks, etc.
|
|
1061
|
-
*/
|
|
1062
|
-
/**
|
|
1063
|
-
* Synchronizes a single external value into the store.
|
|
1064
|
-
*
|
|
1065
|
-
* Note that the while the value in `state` is updated immediately, the value returned
|
|
1066
|
-
* by `useState` is updated before the next render (similarly to React's `useState`).
|
|
1067
|
-
*/
|
|
1068
|
-
useSyncedValue(e, n) {
|
|
1069
|
-
u.useDebugValue(e), $(() => {
|
|
1070
|
-
this.state[e] !== n && this.set(e, n);
|
|
1071
|
-
}, [e, n]);
|
|
1072
|
-
}
|
|
1073
|
-
/**
|
|
1074
|
-
* Synchronizes a single external value into the store and
|
|
1075
|
-
* cleans it up (sets to `undefined`) on unmount.
|
|
1076
|
-
*
|
|
1077
|
-
* Note that the while the value in `state` is updated immediately, the value returned
|
|
1078
|
-
* by `useState` is updated before the next render (similarly to React's `useState`).
|
|
1079
|
-
*/
|
|
1080
|
-
useSyncedValueWithCleanup(e, n) {
|
|
1081
|
-
const s = this;
|
|
1082
|
-
$(() => (s.state[e] !== n && s.set(e, n), () => {
|
|
1083
|
-
s.set(e, void 0);
|
|
1084
|
-
}), [s, e, n]);
|
|
1085
|
-
}
|
|
1086
|
-
/**
|
|
1087
|
-
* Synchronizes multiple external values into the store.
|
|
1088
|
-
*
|
|
1089
|
-
* Note that the while the values in `state` are updated immediately, the values returned
|
|
1090
|
-
* by `useState` are updated before the next render (similarly to React's `useState`).
|
|
1091
|
-
*/
|
|
1092
|
-
useSyncedValues(e) {
|
|
1093
|
-
const n = this;
|
|
1094
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1095
|
-
u.useDebugValue(e, (c) => Object.keys(c));
|
|
1096
|
-
const r = u.useRef(Object.keys(e)).current, o = Object.keys(e);
|
|
1097
|
-
(r.length !== o.length || r.some((c, i) => c !== o[i])) && console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.");
|
|
1098
|
-
}
|
|
1099
|
-
const s = Object.values(e);
|
|
1100
|
-
$(() => {
|
|
1101
|
-
n.update(e);
|
|
1102
|
-
}, [n, ...s]);
|
|
1103
|
-
}
|
|
1104
|
-
/**
|
|
1105
|
-
* Registers a controllable prop pair (`controlled`, `defaultValue`) for a specific key. If `controlled`
|
|
1106
|
-
* is non-undefined, the store's state at `key` is updated to match `controlled`.
|
|
1107
|
-
*/
|
|
1108
|
-
useControlledProp(e, n) {
|
|
1109
|
-
u.useDebugValue(e);
|
|
1110
|
-
const s = n !== void 0;
|
|
1111
|
-
if ($(() => {
|
|
1112
|
-
s && !Object.is(this.state[e], n) && super.setState({
|
|
1113
|
-
...this.state,
|
|
1114
|
-
[e]: n
|
|
1115
|
-
});
|
|
1116
|
-
}, [e, n, s]), process.env.NODE_ENV !== "production") {
|
|
1117
|
-
const r = this.controlledValues ??= /* @__PURE__ */ new Map();
|
|
1118
|
-
r.has(e) || r.set(e, s);
|
|
1119
|
-
const o = r.get(e);
|
|
1120
|
-
o !== void 0 && o !== s && console.error(`A component is changing the ${s ? "" : "un"}controlled state of ${e.toString()} to be ${s ? "un" : ""}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`);
|
|
1121
|
-
}
|
|
1122
|
-
}
|
|
1123
|
-
/** Gets the current value from the store using a selector with the provided key.
|
|
1124
|
-
*
|
|
1125
|
-
* @param key Key of the selector to use.
|
|
1126
|
-
*/
|
|
1127
|
-
select(e, n, s, r) {
|
|
1128
|
-
const o = this.selectors[e];
|
|
1129
|
-
return o(this.state, n, s, r);
|
|
1130
|
-
}
|
|
1131
|
-
/**
|
|
1132
|
-
* Returns a value from the store's state using a selector function.
|
|
1133
|
-
* Used to subscribe to specific parts of the state.
|
|
1134
|
-
* This methods causes a rerender whenever the selected state changes.
|
|
1135
|
-
*
|
|
1136
|
-
* @param key Key of the selector to use.
|
|
1137
|
-
*/
|
|
1138
|
-
useState(e, n, s, r) {
|
|
1139
|
-
return u.useDebugValue(e), Pt(this, this.selectors[e], n, s, r);
|
|
1140
|
-
}
|
|
1141
|
-
/**
|
|
1142
|
-
* Wraps a function with `useStableCallback` to ensure it has a stable reference
|
|
1143
|
-
* and assigns it to the context.
|
|
1144
|
-
*
|
|
1145
|
-
* @param key Key of the event callback. Must be a function in the context.
|
|
1146
|
-
* @param fn Function to assign.
|
|
1147
|
-
*/
|
|
1148
|
-
useContextCallback(e, n) {
|
|
1149
|
-
u.useDebugValue(e);
|
|
1150
|
-
const s = X(n ?? Dn);
|
|
1151
|
-
this.context[e] = s;
|
|
1152
|
-
}
|
|
1153
|
-
/**
|
|
1154
|
-
* Returns a stable setter function for a specific key in the store's state.
|
|
1155
|
-
* It's commonly used to pass as a ref callback to React elements.
|
|
1156
|
-
*
|
|
1157
|
-
* @param key Key of the state to set.
|
|
1158
|
-
*/
|
|
1159
|
-
useStateSetter(e) {
|
|
1160
|
-
const n = u.useRef(void 0);
|
|
1161
|
-
return n.current === void 0 && (n.current = (s) => {
|
|
1162
|
-
this.set(e, s);
|
|
1163
|
-
}), n.current;
|
|
1164
|
-
}
|
|
1165
|
-
/**
|
|
1166
|
-
* Observes changes derived from the store's selectors and calls the listener when the selected value changes.
|
|
1167
|
-
*
|
|
1168
|
-
* @param key Key of the selector to observe.
|
|
1169
|
-
* @param listener Listener function called when the selector result changes.
|
|
1170
|
-
*/
|
|
1171
|
-
observe(e, n) {
|
|
1172
|
-
let s;
|
|
1173
|
-
typeof e == "function" ? s = e : s = this.selectors[e];
|
|
1174
|
-
let r = s(this.state);
|
|
1175
|
-
return n(r, r, this), this.subscribe((o) => {
|
|
1176
|
-
const c = s(o);
|
|
1177
|
-
if (!Object.is(r, c)) {
|
|
1178
|
-
const i = r;
|
|
1179
|
-
r = c, n(c, i, this);
|
|
1180
|
-
}
|
|
1181
|
-
});
|
|
1182
|
-
}
|
|
1183
|
-
}
|
|
1184
|
-
const oe = 0;
|
|
1185
|
-
class le {
|
|
1186
|
-
static create() {
|
|
1187
|
-
return new le();
|
|
1188
|
-
}
|
|
1189
|
-
currentId = oe;
|
|
1190
|
-
/**
|
|
1191
|
-
* Executes `fn` after `delay`, clearing any previously scheduled call.
|
|
1192
|
-
*/
|
|
1193
|
-
start(e, n) {
|
|
1194
|
-
this.clear(), this.currentId = setTimeout(() => {
|
|
1195
|
-
this.currentId = oe, n();
|
|
1196
|
-
}, e);
|
|
1197
|
-
}
|
|
1198
|
-
isStarted() {
|
|
1199
|
-
return this.currentId !== oe;
|
|
1200
|
-
}
|
|
1201
|
-
clear = () => {
|
|
1202
|
-
this.currentId !== oe && (clearTimeout(this.currentId), this.currentId = oe);
|
|
1203
|
-
};
|
|
1204
|
-
disposeEffect = () => this.clear;
|
|
1205
|
-
}
|
|
1206
|
-
function As() {
|
|
1207
|
-
const t = se(le.create).current;
|
|
1208
|
-
return qe(t.disposeEffect), t;
|
|
1209
|
-
}
|
|
1210
|
-
let mt = 0;
|
|
1211
|
-
function Vs(t) {
|
|
1212
|
-
return mt += 1, `${t}-${Math.random().toString(36).slice(2, 6)}-${mt}`;
|
|
1213
|
-
}
|
|
1214
|
-
function _e(t, e) {
|
|
1215
|
-
if (typeof t == "string")
|
|
1216
|
-
return {
|
|
1217
|
-
description: t
|
|
1218
|
-
};
|
|
1219
|
-
if (typeof t == "function") {
|
|
1220
|
-
const n = t(e);
|
|
1221
|
-
return typeof n == "string" ? {
|
|
1222
|
-
description: n
|
|
1223
|
-
} : n;
|
|
1224
|
-
}
|
|
1225
|
-
return t;
|
|
1226
|
-
}
|
|
1227
|
-
const xe = Ds((t) => t.toasts, (t) => {
|
|
1228
|
-
const e = /* @__PURE__ */ new Map();
|
|
1229
|
-
let n = 0, s = 0;
|
|
1230
|
-
return t.forEach((r, o) => {
|
|
1231
|
-
const c = r.transitionStatus === "ending";
|
|
1232
|
-
e.set(r.id, {
|
|
1233
|
-
value: r,
|
|
1234
|
-
domIndex: o,
|
|
1235
|
-
visibleIndex: c ? -1 : n,
|
|
1236
|
-
offsetY: s
|
|
1237
|
-
}), s += r.height || 0, c || (n += 1);
|
|
1238
|
-
}), e;
|
|
1239
|
-
}), H = {
|
|
1240
|
-
toasts: L((t) => t.toasts),
|
|
1241
|
-
isEmpty: L((t) => t.toasts.length === 0),
|
|
1242
|
-
toast: L(xe, (t, e) => t.get(e)?.value),
|
|
1243
|
-
toastIndex: L(xe, (t, e) => t.get(e)?.domIndex ?? -1),
|
|
1244
|
-
toastOffsetY: L(xe, (t, e) => t.get(e)?.offsetY ?? 0),
|
|
1245
|
-
toastVisibleIndex: L(xe, (t, e) => t.get(e)?.visibleIndex ?? -1),
|
|
1246
|
-
hovering: L((t) => t.hovering),
|
|
1247
|
-
focused: L((t) => t.focused),
|
|
1248
|
-
expanded: L((t) => t.hovering || t.focused),
|
|
1249
|
-
expandedOrOutOfFocus: L((t) => t.hovering || t.focused || !t.isWindowFocused),
|
|
1250
|
-
prevFocusElement: L((t) => t.prevFocusElement)
|
|
1251
|
-
};
|
|
1252
|
-
class _s extends Ms {
|
|
1253
|
-
timers = /* @__PURE__ */ new Map();
|
|
1254
|
-
areTimersPaused = !1;
|
|
1255
|
-
constructor(e) {
|
|
1256
|
-
super(e, {}, H);
|
|
1257
|
-
}
|
|
1258
|
-
setFocused(e) {
|
|
1259
|
-
this.set("focused", e);
|
|
1260
|
-
}
|
|
1261
|
-
setHovering(e) {
|
|
1262
|
-
this.set("hovering", e);
|
|
1263
|
-
}
|
|
1264
|
-
setIsWindowFocused(e) {
|
|
1265
|
-
this.set("isWindowFocused", e);
|
|
1266
|
-
}
|
|
1267
|
-
setPrevFocusElement(e) {
|
|
1268
|
-
this.set("prevFocusElement", e);
|
|
1269
|
-
}
|
|
1270
|
-
setViewport = (e) => {
|
|
1271
|
-
this.set("viewport", e);
|
|
1272
|
-
};
|
|
1273
|
-
disposeEffect = () => () => {
|
|
1274
|
-
this.timers.forEach((e) => {
|
|
1275
|
-
e.timeout?.clear();
|
|
1276
|
-
}), this.timers.clear();
|
|
1277
|
-
};
|
|
1278
|
-
removeToast(e) {
|
|
1279
|
-
const n = H.toastIndex(this.state, e);
|
|
1280
|
-
if (n === -1)
|
|
1281
|
-
return;
|
|
1282
|
-
this.state.toasts[n]?.onRemove?.();
|
|
1283
|
-
const r = [...this.state.toasts];
|
|
1284
|
-
r.splice(n, 1), this.setToasts(r);
|
|
1285
|
-
}
|
|
1286
|
-
addToast = (e) => {
|
|
1287
|
-
const {
|
|
1288
|
-
toasts: n,
|
|
1289
|
-
timeout: s,
|
|
1290
|
-
limit: r
|
|
1291
|
-
} = this.state, o = e.id || Vs("toast"), c = {
|
|
1292
|
-
...e,
|
|
1293
|
-
id: o,
|
|
1294
|
-
transitionStatus: "starting"
|
|
1295
|
-
}, i = [c, ...n], l = i.filter((d) => d.transitionStatus !== "ending");
|
|
1296
|
-
if (l.length > r) {
|
|
1297
|
-
const d = l.length - r, f = l.slice(-d), p = new Set(f.map((h) => h.id));
|
|
1298
|
-
this.setToasts(i.map((h) => {
|
|
1299
|
-
const m = p.has(h.id);
|
|
1300
|
-
return h.limited !== m ? {
|
|
1301
|
-
...h,
|
|
1302
|
-
limited: m
|
|
1303
|
-
} : h;
|
|
1304
|
-
}));
|
|
1305
|
-
} else
|
|
1306
|
-
this.setToasts(i.map((d) => d.limited ? {
|
|
1307
|
-
...d,
|
|
1308
|
-
limited: !1
|
|
1309
|
-
} : d));
|
|
1310
|
-
const a = c.timeout ?? s;
|
|
1311
|
-
return c.type !== "loading" && a > 0 && this.scheduleTimer(o, a, () => this.closeToast(o)), H.expandedOrOutOfFocus(this.state) && this.pauseTimers(), o;
|
|
1312
|
-
};
|
|
1313
|
-
updateToast = (e, n) => {
|
|
1314
|
-
this.updateToastInternal(e, n);
|
|
1315
|
-
};
|
|
1316
|
-
updateToastInternal = (e, n) => {
|
|
1317
|
-
const {
|
|
1318
|
-
timeout: s,
|
|
1319
|
-
toasts: r
|
|
1320
|
-
} = this.state, o = H.toast(this.state, e) ?? null;
|
|
1321
|
-
if (!o || o.transitionStatus === "ending")
|
|
1322
|
-
return;
|
|
1323
|
-
const c = {
|
|
1324
|
-
...o,
|
|
1325
|
-
...n
|
|
1326
|
-
};
|
|
1327
|
-
this.setToasts(r.map((m) => m.id === e ? {
|
|
1328
|
-
...m,
|
|
1329
|
-
...n
|
|
1330
|
-
} : m));
|
|
1331
|
-
const i = c.timeout ?? s, l = o?.timeout ?? s, a = Object.hasOwn(n, "timeout"), d = c.transitionStatus !== "ending" && c.type !== "loading" && i > 0, f = this.timers.has(e), p = l !== i, h = o?.type === "loading";
|
|
1332
|
-
if (!d && f) {
|
|
1333
|
-
this.timers.get(e)?.timeout?.clear(), this.timers.delete(e);
|
|
1334
|
-
return;
|
|
1335
|
-
}
|
|
1336
|
-
if (d && (!f || p || a || h)) {
|
|
1337
|
-
const m = this.timers.get(e);
|
|
1338
|
-
m && (m.timeout?.clear(), this.timers.delete(e)), this.scheduleTimer(e, i, () => this.closeToast(e)), H.expandedOrOutOfFocus(this.state) && this.pauseTimers();
|
|
1339
|
-
}
|
|
1340
|
-
};
|
|
1341
|
-
closeToast = (e) => {
|
|
1342
|
-
H.toast(this.state, e)?.onClose?.();
|
|
1343
|
-
const {
|
|
1344
|
-
limit: s,
|
|
1345
|
-
toasts: r
|
|
1346
|
-
} = this.state;
|
|
1347
|
-
let o = 0;
|
|
1348
|
-
const c = r.map((l) => {
|
|
1349
|
-
if (l.id === e)
|
|
1350
|
-
return {
|
|
1351
|
-
...l,
|
|
1352
|
-
transitionStatus: "ending",
|
|
1353
|
-
height: 0
|
|
1354
|
-
};
|
|
1355
|
-
if (l.transitionStatus === "ending")
|
|
1356
|
-
return l;
|
|
1357
|
-
const a = o >= s;
|
|
1358
|
-
return o += 1, l.limited !== a ? {
|
|
1359
|
-
...l,
|
|
1360
|
-
limited: a
|
|
1361
|
-
} : l;
|
|
1362
|
-
}), i = this.timers.get(e);
|
|
1363
|
-
i && i.timeout && (i.timeout.clear(), this.timers.delete(e)), this.handleFocusManagement(e), this.setToasts(c);
|
|
1364
|
-
};
|
|
1365
|
-
promiseToast = (e, n) => {
|
|
1366
|
-
const s = _e(n.loading), r = this.addToast({
|
|
1367
|
-
...s,
|
|
1368
|
-
type: "loading"
|
|
1369
|
-
}), o = e.then((c) => {
|
|
1370
|
-
const i = _e(n.success, c);
|
|
1371
|
-
return this.updateToast(r, {
|
|
1372
|
-
...i,
|
|
1373
|
-
type: "success",
|
|
1374
|
-
timeout: i.timeout
|
|
1375
|
-
}), c;
|
|
1376
|
-
}).catch((c) => {
|
|
1377
|
-
const i = _e(n.error, c);
|
|
1378
|
-
return this.updateToast(r, {
|
|
1379
|
-
...i,
|
|
1380
|
-
type: "error",
|
|
1381
|
-
timeout: i.timeout
|
|
1382
|
-
}), Promise.reject(c);
|
|
1383
|
-
});
|
|
1384
|
-
return {}.hasOwnProperty.call(n, "setPromise") && n.setPromise(o), o;
|
|
1385
|
-
};
|
|
1386
|
-
pauseTimers() {
|
|
1387
|
-
this.areTimersPaused || (this.areTimersPaused = !0, this.timers.forEach((e) => {
|
|
1388
|
-
if (e.timeout) {
|
|
1389
|
-
e.timeout.clear();
|
|
1390
|
-
const n = Date.now() - e.start, s = e.delay - n;
|
|
1391
|
-
e.remaining = s > 0 ? s : 0;
|
|
1392
|
-
}
|
|
1393
|
-
}));
|
|
1394
|
-
}
|
|
1395
|
-
resumeTimers() {
|
|
1396
|
-
this.areTimersPaused && (this.areTimersPaused = !1, this.timers.forEach((e, n) => {
|
|
1397
|
-
e.remaining = e.remaining > 0 ? e.remaining : e.delay, e.timeout ??= le.create(), e.timeout.start(e.remaining, () => {
|
|
1398
|
-
this.timers.delete(n), e.callback();
|
|
1399
|
-
}), e.start = Date.now();
|
|
1400
|
-
}));
|
|
1401
|
-
}
|
|
1402
|
-
restoreFocusToPrevElement() {
|
|
1403
|
-
this.state.prevFocusElement?.focus({
|
|
1404
|
-
preventScroll: !0
|
|
1405
|
-
});
|
|
1406
|
-
}
|
|
1407
|
-
handleDocumentPointerDown = (e) => {
|
|
1408
|
-
if (e.pointerType !== "touch")
|
|
1409
|
-
return;
|
|
1410
|
-
const n = Ke(e);
|
|
1411
|
-
J(this.state.viewport, n) || (this.resumeTimers(), this.update({
|
|
1412
|
-
hovering: !1,
|
|
1413
|
-
focused: !1
|
|
1414
|
-
}));
|
|
1415
|
-
};
|
|
1416
|
-
scheduleTimer(e, n, s) {
|
|
1417
|
-
const r = Date.now(), o = !H.expandedOrOutOfFocus(this.state), c = o ? le.create() : void 0;
|
|
1418
|
-
c?.start(n, () => {
|
|
1419
|
-
this.timers.delete(e), s();
|
|
1420
|
-
}), this.timers.set(e, {
|
|
1421
|
-
timeout: c,
|
|
1422
|
-
start: o ? r : 0,
|
|
1423
|
-
delay: n,
|
|
1424
|
-
remaining: n,
|
|
1425
|
-
callback: s
|
|
1426
|
-
});
|
|
1427
|
-
}
|
|
1428
|
-
setToasts(e) {
|
|
1429
|
-
const n = {
|
|
1430
|
-
toasts: e
|
|
1431
|
-
};
|
|
1432
|
-
e.length === 0 && (n.hovering = !1, n.focused = !1), this.update(n);
|
|
1433
|
-
}
|
|
1434
|
-
handleFocusManagement(e) {
|
|
1435
|
-
const n = ue(K(this.state.viewport));
|
|
1436
|
-
if (!this.state.viewport || !J(this.state.viewport, n) || !Be(n))
|
|
1437
|
-
return;
|
|
1438
|
-
const s = H.toasts(this.state), r = H.toastIndex(this.state, e);
|
|
1439
|
-
let o = null, c = r + 1;
|
|
1440
|
-
for (; c < s.length; ) {
|
|
1441
|
-
if (s[c].transitionStatus !== "ending") {
|
|
1442
|
-
o = s[c];
|
|
1443
|
-
break;
|
|
1444
|
-
}
|
|
1445
|
-
c += 1;
|
|
1446
|
-
}
|
|
1447
|
-
if (!o)
|
|
1448
|
-
for (c = r - 1; c >= 0; ) {
|
|
1449
|
-
if (s[c].transitionStatus !== "ending") {
|
|
1450
|
-
o = s[c];
|
|
1451
|
-
break;
|
|
1452
|
-
}
|
|
1453
|
-
c -= 1;
|
|
1454
|
-
}
|
|
1455
|
-
o ? o.ref?.current?.focus() : this.restoreFocusToPrevElement();
|
|
1456
|
-
}
|
|
1457
|
-
}
|
|
1458
|
-
const kt = function(e) {
|
|
1459
|
-
const {
|
|
1460
|
-
children: n,
|
|
1461
|
-
timeout: s = 5e3,
|
|
1462
|
-
limit: r = 3,
|
|
1463
|
-
toastManager: o
|
|
1464
|
-
} = e, c = se(() => new _s({
|
|
1465
|
-
timeout: s,
|
|
1466
|
-
limit: r,
|
|
1467
|
-
viewport: null,
|
|
1468
|
-
toasts: [],
|
|
1469
|
-
hovering: !1,
|
|
1470
|
-
focused: !1,
|
|
1471
|
-
isWindowFocused: !0,
|
|
1472
|
-
prevFocusElement: null
|
|
1473
|
-
})).current;
|
|
1474
|
-
return qe(c.disposeEffect), u.useEffect(function() {
|
|
1475
|
-
return o ? o[" subscribe"](({
|
|
1476
|
-
action: a,
|
|
1477
|
-
options: d
|
|
1478
|
-
}) => {
|
|
1479
|
-
const f = d.id;
|
|
1480
|
-
a === "promise" && d.promise ? c.promiseToast(d.promise, d) : a === "update" && f ? c.updateToast(f, d) : a === "close" && f ? c.closeToast(f) : c.addToast(d);
|
|
1481
|
-
}) : void 0;
|
|
1482
|
-
}, [c, s, o]), c.useSyncedValues({
|
|
1483
|
-
timeout: s,
|
|
1484
|
-
limit: r
|
|
1485
|
-
}), /* @__PURE__ */ x(Ce.Provider, {
|
|
1486
|
-
value: c,
|
|
1487
|
-
children: n
|
|
1488
|
-
});
|
|
1489
|
-
};
|
|
1490
|
-
process.env.NODE_ENV !== "production" && (kt.displayName = "ToastProvider");
|
|
1491
|
-
const ne = /* @__PURE__ */ u.forwardRef(function(e, n) {
|
|
1492
|
-
const [s, r] = u.useState();
|
|
1493
|
-
return $(() => {
|
|
1494
|
-
Zn && r("button");
|
|
1495
|
-
}, []), /* @__PURE__ */ x("span", {
|
|
1496
|
-
...e,
|
|
1497
|
-
ref: n,
|
|
1498
|
-
style: It,
|
|
1499
|
-
"aria-hidden": s ? void 0 : !0,
|
|
1500
|
-
...{
|
|
1501
|
-
tabIndex: 0,
|
|
1502
|
-
// Role is only for VoiceOver
|
|
1503
|
-
role: s
|
|
1504
|
-
},
|
|
1505
|
-
"data-base-ui-focus-guard": ""
|
|
1506
|
-
});
|
|
1507
|
-
});
|
|
1508
|
-
process.env.NODE_ENV !== "production" && (ne.displayName = "FocusGuard");
|
|
1509
|
-
let Ls = /* @__PURE__ */ (function(t) {
|
|
1510
|
-
return t.frontmostHeight = "--toast-frontmost-height", t;
|
|
1511
|
-
})({});
|
|
1512
|
-
const Ft = /* @__PURE__ */ u.forwardRef(function(e, n) {
|
|
1513
|
-
const {
|
|
1514
|
-
render: s,
|
|
1515
|
-
className: r,
|
|
1516
|
-
children: o,
|
|
1517
|
-
...c
|
|
1518
|
-
} = e, i = Ge(), l = As(), a = u.useRef(!1), d = u.useRef(!1), f = i.useState("isEmpty"), p = i.useState("toasts"), h = i.useState("focused"), m = i.useState("expanded"), v = i.useState("prevFocusElement"), S = p[0]?.height ?? 0, R = u.useMemo(() => p.some((b) => b.transitionStatus === "ending"), [p]);
|
|
1519
|
-
u.useEffect(() => {
|
|
1520
|
-
const b = i.state.viewport;
|
|
1521
|
-
if (!b)
|
|
1522
|
-
return;
|
|
1523
|
-
function C(k) {
|
|
1524
|
-
f || k.key === "F6" && k.target !== b && (k.preventDefault(), i.setPrevFocusElement(ue(K(b))), b?.focus({
|
|
1525
|
-
preventScroll: !0
|
|
1526
|
-
}), i.pauseTimers(), i.setFocused(!0));
|
|
1527
|
-
}
|
|
1528
|
-
const D = rt(b);
|
|
1529
|
-
return D.addEventListener("keydown", C), () => {
|
|
1530
|
-
D.removeEventListener("keydown", C);
|
|
1531
|
-
};
|
|
1532
|
-
}, [i, f]), u.useEffect(() => {
|
|
1533
|
-
const b = i.state.viewport;
|
|
1534
|
-
if (!b || f)
|
|
1535
|
-
return;
|
|
1536
|
-
const C = rt(b);
|
|
1537
|
-
function D(B) {
|
|
1538
|
-
B.target === C && (i.setIsWindowFocused(!1), i.pauseTimers());
|
|
1539
|
-
}
|
|
1540
|
-
function k(B) {
|
|
1541
|
-
if (B.relatedTarget || B.target === C)
|
|
1542
|
-
return;
|
|
1543
|
-
const te = Ke(B), re = ue(K(b));
|
|
1544
|
-
(!J(b, te) || !Be(re)) && i.resumeTimers(), l.start(0, () => i.setIsWindowFocused(!0));
|
|
1545
|
-
}
|
|
1546
|
-
return C.addEventListener("blur", D, !0), C.addEventListener("focus", k, !0), () => {
|
|
1547
|
-
C.removeEventListener("blur", D, !0), C.removeEventListener("focus", k, !0);
|
|
1548
|
-
};
|
|
1549
|
-
}, [
|
|
1550
|
-
i,
|
|
1551
|
-
l,
|
|
1552
|
-
// `store.state.viewport` isn't available on the first render,
|
|
1553
|
-
// since the portal node hasn't yet been created.
|
|
1554
|
-
// By adding this dependency, we ensure the window listeners
|
|
1555
|
-
// are added when toasts have been created, once the ref is available.
|
|
1556
|
-
f
|
|
1557
|
-
]), u.useEffect(() => {
|
|
1558
|
-
const b = i.state.viewport;
|
|
1559
|
-
if (!b || f)
|
|
1560
|
-
return;
|
|
1561
|
-
const C = K(b);
|
|
1562
|
-
return C.addEventListener("pointerdown", i.handleDocumentPointerDown, !0), () => {
|
|
1563
|
-
C.removeEventListener("pointerdown", i.handleDocumentPointerDown, !0);
|
|
1564
|
-
};
|
|
1565
|
-
}, [f, i]);
|
|
1566
|
-
function O(b) {
|
|
1567
|
-
const C = i.state.viewport;
|
|
1568
|
-
C && (a.current = !0, b.relatedTarget === C ? p[0]?.ref?.current?.focus() : i.restoreFocusToPrevElement());
|
|
1569
|
-
}
|
|
1570
|
-
function F(b) {
|
|
1571
|
-
b.key === "Tab" && b.shiftKey && b.target === i.state.viewport && (b.preventDefault(), i.restoreFocusToPrevElement(), i.resumeTimers());
|
|
1572
|
-
}
|
|
1573
|
-
u.useEffect(() => {
|
|
1574
|
-
!i.state.isWindowFocused || R || !d.current || (i.resumeTimers(), i.setHovering(!1), d.current = !1);
|
|
1575
|
-
}, [R, i]);
|
|
1576
|
-
function g() {
|
|
1577
|
-
i.pauseTimers(), i.setHovering(!0), d.current = !1;
|
|
1578
|
-
}
|
|
1579
|
-
function T() {
|
|
1580
|
-
R ? d.current = !0 : (i.resumeTimers(), i.setHovering(!1));
|
|
1581
|
-
}
|
|
1582
|
-
function E() {
|
|
1583
|
-
if (a.current) {
|
|
1584
|
-
a.current = !1;
|
|
1585
|
-
return;
|
|
1586
|
-
}
|
|
1587
|
-
h || Be(K(i.state.viewport).activeElement) && (i.setFocused(!0), i.pauseTimers());
|
|
1588
|
-
}
|
|
1589
|
-
function P(b) {
|
|
1590
|
-
!h || J(i.state.viewport, b.relatedTarget) || (i.setFocused(!1), i.resumeTimers());
|
|
1591
|
-
}
|
|
1592
|
-
const j = {
|
|
1593
|
-
tabIndex: -1,
|
|
1594
|
-
role: "region",
|
|
1595
|
-
"aria-live": "polite",
|
|
1596
|
-
"aria-atomic": !1,
|
|
1597
|
-
"aria-relevant": "additions text",
|
|
1598
|
-
"aria-label": "Notifications",
|
|
1599
|
-
onMouseEnter: g,
|
|
1600
|
-
onMouseMove: g,
|
|
1601
|
-
onMouseLeave: T,
|
|
1602
|
-
onFocus: E,
|
|
1603
|
-
onBlur: P,
|
|
1604
|
-
onKeyDown: F,
|
|
1605
|
-
onClick: E
|
|
1606
|
-
}, ee = {
|
|
1607
|
-
expanded: m
|
|
1608
|
-
}, G = Q("div", e, {
|
|
1609
|
-
ref: [n, i.setViewport],
|
|
1610
|
-
state: ee,
|
|
1611
|
-
props: [j, {
|
|
1612
|
-
style: {
|
|
1613
|
-
[Ls.frontmostHeight]: S ? `${S}px` : void 0
|
|
1614
|
-
}
|
|
1615
|
-
}, c, {
|
|
1616
|
-
children: /* @__PURE__ */ U(u.Fragment, {
|
|
1617
|
-
children: [!f && v && /* @__PURE__ */ x(ne, {
|
|
1618
|
-
onFocus: O
|
|
1619
|
-
}), o, !f && v && /* @__PURE__ */ x(ne, {
|
|
1620
|
-
onFocus: O
|
|
1621
|
-
})]
|
|
1622
|
-
})
|
|
1623
|
-
}]
|
|
1624
|
-
}), pe = u.useMemo(() => p.filter((b) => b.priority === "high"), [p]);
|
|
1625
|
-
return /* @__PURE__ */ U(u.Fragment, {
|
|
1626
|
-
children: [!f && v && /* @__PURE__ */ x(ne, {
|
|
1627
|
-
onFocus: O
|
|
1628
|
-
}), G, !h && pe.length > 0 && /* @__PURE__ */ x("div", {
|
|
1629
|
-
style: It,
|
|
1630
|
-
children: pe.map((b) => /* @__PURE__ */ U("div", {
|
|
1631
|
-
role: "alert",
|
|
1632
|
-
"aria-atomic": !0,
|
|
1633
|
-
children: [/* @__PURE__ */ x("div", {
|
|
1634
|
-
children: b.title
|
|
1635
|
-
}), /* @__PURE__ */ x("div", {
|
|
1636
|
-
children: b.description
|
|
1637
|
-
})]
|
|
1638
|
-
}, b.id))
|
|
1639
|
-
})]
|
|
1640
|
-
});
|
|
1641
|
-
});
|
|
1642
|
-
process.env.NODE_ENV !== "production" && (Ft.displayName = "ToastViewport");
|
|
1643
|
-
function $s(t) {
|
|
1644
|
-
return We(19) ? t : t ? "true" : void 0;
|
|
1645
|
-
}
|
|
1646
|
-
const Ze = /* @__PURE__ */ u.createContext(void 0);
|
|
1647
|
-
process.env.NODE_ENV !== "production" && (Ze.displayName = "ToastRootContext");
|
|
1648
|
-
function Ne() {
|
|
1649
|
-
const t = u.useContext(Ze);
|
|
1650
|
-
if (!t)
|
|
1651
|
-
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: ToastRootContext is missing. Toast parts must be used within <Toast.Root>." : Y(66));
|
|
1652
|
-
return t;
|
|
1653
|
-
}
|
|
1654
|
-
let Xe = /* @__PURE__ */ (function(t) {
|
|
1655
|
-
return t.startingStyle = "data-starting-style", t.endingStyle = "data-ending-style", t;
|
|
1656
|
-
})({});
|
|
1657
|
-
const Us = {
|
|
1658
|
-
[Xe.startingStyle]: ""
|
|
1659
|
-
}, js = {
|
|
1660
|
-
[Xe.endingStyle]: ""
|
|
1661
|
-
}, Bs = {
|
|
1662
|
-
transitionStatus(t) {
|
|
1663
|
-
return t === "starting" ? Us : t === "ending" ? js : null;
|
|
1664
|
-
}
|
|
1665
|
-
};
|
|
1666
|
-
function zs(t) {
|
|
1667
|
-
return t == null ? t : "current" in t ? t.current : t;
|
|
1668
|
-
}
|
|
1669
|
-
function Hs(t, e = !1, n = !0) {
|
|
1670
|
-
const s = is();
|
|
1671
|
-
return X((r, o = null) => {
|
|
1672
|
-
s.cancel();
|
|
1673
|
-
function c() {
|
|
1674
|
-
de.flushSync(r);
|
|
1675
|
-
}
|
|
1676
|
-
const i = zs(t);
|
|
1677
|
-
if (i == null)
|
|
1678
|
-
return;
|
|
1679
|
-
const l = i;
|
|
1680
|
-
if (typeof l.getAnimations != "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED)
|
|
1681
|
-
r();
|
|
1682
|
-
else {
|
|
1683
|
-
let a = function() {
|
|
1684
|
-
const f = Xe.startingStyle;
|
|
1685
|
-
if (!l.hasAttribute(f)) {
|
|
1686
|
-
s.request(d);
|
|
1687
|
-
return;
|
|
1688
|
-
}
|
|
1689
|
-
const p = new MutationObserver(() => {
|
|
1690
|
-
l.hasAttribute(f) || (p.disconnect(), d());
|
|
1691
|
-
});
|
|
1692
|
-
p.observe(l, {
|
|
1693
|
-
attributes: !0,
|
|
1694
|
-
attributeFilter: [f]
|
|
1695
|
-
}), o?.addEventListener("abort", () => p.disconnect(), {
|
|
1696
|
-
once: !0
|
|
1697
|
-
});
|
|
1698
|
-
}, d = function() {
|
|
1699
|
-
Promise.all(l.getAnimations().map((f) => f.finished)).then(() => {
|
|
1700
|
-
o?.aborted || c();
|
|
1701
|
-
}).catch(() => {
|
|
1702
|
-
const f = l.getAnimations();
|
|
1703
|
-
if (n) {
|
|
1704
|
-
if (o?.aborted)
|
|
1705
|
-
return;
|
|
1706
|
-
c();
|
|
1707
|
-
} else f.length > 0 && f.some((p) => p.pending || p.playState !== "finished") && d();
|
|
1708
|
-
});
|
|
1709
|
-
};
|
|
1710
|
-
if (e) {
|
|
1711
|
-
a();
|
|
1712
|
-
return;
|
|
1713
|
-
}
|
|
1714
|
-
s.request(d);
|
|
1715
|
-
}
|
|
1716
|
-
});
|
|
1717
|
-
}
|
|
1718
|
-
function Ws(t) {
|
|
1719
|
-
const {
|
|
1720
|
-
enabled: e = !0,
|
|
1721
|
-
open: n,
|
|
1722
|
-
ref: s,
|
|
1723
|
-
onComplete: r
|
|
1724
|
-
} = t, o = X(r), c = Hs(s, n, !1);
|
|
1725
|
-
u.useEffect(() => {
|
|
1726
|
-
if (!e)
|
|
1727
|
-
return;
|
|
1728
|
-
const i = new AbortController();
|
|
1729
|
-
return c(o, i.signal), () => {
|
|
1730
|
-
i.abort();
|
|
1731
|
-
};
|
|
1732
|
-
}, [e, n, o, c]);
|
|
1733
|
-
}
|
|
1734
|
-
let Z = /* @__PURE__ */ (function(t) {
|
|
1735
|
-
return t.index = "--toast-index", t.offsetY = "--toast-offset-y", t.height = "--toast-height", t.swipeMovementX = "--toast-swipe-movement-x", t.swipeMovementY = "--toast-swipe-movement-y", t;
|
|
1736
|
-
})({});
|
|
1737
|
-
const Ks = {
|
|
1738
|
-
...Bs,
|
|
1739
|
-
swipeDirection(t) {
|
|
1740
|
-
return t ? {
|
|
1741
|
-
"data-swipe-direction": t
|
|
1742
|
-
} : null;
|
|
1743
|
-
}
|
|
1744
|
-
}, ie = 40, qs = 10, q = 0.5, Ys = 1;
|
|
1745
|
-
function gt(t, e, n) {
|
|
1746
|
-
switch (t) {
|
|
1747
|
-
case "up":
|
|
1748
|
-
return -n;
|
|
1749
|
-
case "down":
|
|
1750
|
-
return n;
|
|
1751
|
-
case "left":
|
|
1752
|
-
return -e;
|
|
1753
|
-
case "right":
|
|
1754
|
-
return e;
|
|
1755
|
-
default:
|
|
1756
|
-
return 0;
|
|
1757
|
-
}
|
|
1758
|
-
}
|
|
1759
|
-
function Gs(t) {
|
|
1760
|
-
const n = window.getComputedStyle(t).transform;
|
|
1761
|
-
let s = 0, r = 0, o = 1;
|
|
1762
|
-
if (n && n !== "none") {
|
|
1763
|
-
const c = n.match(/matrix(?:3d)?\(([^)]+)\)/);
|
|
1764
|
-
if (c) {
|
|
1765
|
-
const i = c[1].split(", ").map(parseFloat);
|
|
1766
|
-
i.length === 6 ? (s = i[4], r = i[5], o = Math.sqrt(i[0] * i[0] + i[1] * i[1])) : i.length === 16 && (s = i[12], r = i[13], o = i[0]);
|
|
1767
|
-
}
|
|
1768
|
-
}
|
|
1769
|
-
return {
|
|
1770
|
-
x: s,
|
|
1771
|
-
y: r,
|
|
1772
|
-
scale: o
|
|
1773
|
-
};
|
|
1774
|
-
}
|
|
1775
|
-
const Mt = /* @__PURE__ */ u.forwardRef(function(e, n) {
|
|
1776
|
-
const {
|
|
1777
|
-
toast: s,
|
|
1778
|
-
render: r,
|
|
1779
|
-
className: o,
|
|
1780
|
-
swipeDirection: c = ["down", "right"],
|
|
1781
|
-
...i
|
|
1782
|
-
} = e, l = s.positionerProps?.anchor !== void 0;
|
|
1783
|
-
let a = [];
|
|
1784
|
-
l || (a = Array.isArray(c) ? c : [c]);
|
|
1785
|
-
const d = a.length > 0, f = Ge(), [p, h] = u.useState(void 0), [m, v] = u.useState(!1), [S, R] = u.useState(!1), [O, F] = u.useState(!1), [g, T] = u.useState({
|
|
1786
|
-
x: 0,
|
|
1787
|
-
y: 0
|
|
1788
|
-
}), [E, P] = u.useState({
|
|
1789
|
-
x: 0,
|
|
1790
|
-
y: 0,
|
|
1791
|
-
scale: 1
|
|
1792
|
-
}), [j, ee] = u.useState(), [G, pe] = u.useState(), [b, C] = u.useState(null), D = u.useRef(null), k = u.useRef({
|
|
1793
|
-
x: 0,
|
|
1794
|
-
y: 0
|
|
1795
|
-
}), B = u.useRef({
|
|
1796
|
-
x: 0,
|
|
1797
|
-
y: 0,
|
|
1798
|
-
scale: 1
|
|
1799
|
-
}), te = u.useRef(void 0), re = u.useRef(0), he = u.useRef(!1), M = u.useRef({
|
|
1800
|
-
x: 0,
|
|
1801
|
-
y: 0
|
|
1802
|
-
}), De = u.useRef(!1), Ie = f.useState("toastIndex", s.id), Re = f.useState("toastVisibleIndex", s.id), Ht = f.useState("toastOffsetY", s.id), Wt = f.useState("focused"), Oe = f.useState("expanded");
|
|
1803
|
-
Ws({
|
|
1804
|
-
open: s.transitionStatus !== "ending",
|
|
1805
|
-
ref: D,
|
|
1806
|
-
onComplete() {
|
|
1807
|
-
s.transitionStatus === "ending" && f.removeToast(s.id);
|
|
1808
|
-
}
|
|
1809
|
-
});
|
|
1810
|
-
const me = X((w = !1) => {
|
|
1811
|
-
const y = D.current;
|
|
1812
|
-
if (!y)
|
|
1813
|
-
return;
|
|
1814
|
-
const N = y.style.height;
|
|
1815
|
-
y.style.height = "auto";
|
|
1816
|
-
const I = y.offsetHeight;
|
|
1817
|
-
y.style.height = N;
|
|
1818
|
-
function A() {
|
|
1819
|
-
f.updateToastInternal(s.id, {
|
|
1820
|
-
ref: D,
|
|
1821
|
-
height: I,
|
|
1822
|
-
...s.transitionStatus === "starting" ? {
|
|
1823
|
-
transitionStatus: void 0
|
|
1824
|
-
} : {}
|
|
1825
|
-
});
|
|
1826
|
-
}
|
|
1827
|
-
w ? de.flushSync(A) : A();
|
|
1828
|
-
});
|
|
1829
|
-
$(me, [me]);
|
|
1830
|
-
function Kt(w, y) {
|
|
1831
|
-
let N = w, I = y;
|
|
1832
|
-
return !a.includes("left") && !a.includes("right") ? N = w > 0 ? w ** q : -(Math.abs(w) ** q) : (!a.includes("right") && w > 0 && (N = w ** q), !a.includes("left") && w < 0 && (N = -(Math.abs(w) ** q))), !a.includes("up") && !a.includes("down") ? I = y > 0 ? y ** q : -(Math.abs(y) ** q) : (!a.includes("down") && y > 0 && (I = y ** q), !a.includes("up") && y < 0 && (I = -(Math.abs(y) ** q))), {
|
|
1833
|
-
x: N,
|
|
1834
|
-
y: I
|
|
1835
|
-
};
|
|
1836
|
-
}
|
|
1837
|
-
function qt(w) {
|
|
1838
|
-
if (w.button !== 0)
|
|
1839
|
-
return;
|
|
1840
|
-
w.pointerType === "touch" && f.pauseTimers();
|
|
1841
|
-
const y = Ke(w.nativeEvent);
|
|
1842
|
-
if (!(y && y.closest('button,a,input,textarea,[role="button"],[data-swipe-ignore]'))) {
|
|
1843
|
-
if (he.current = !1, te.current = void 0, re.current = 0, k.current = {
|
|
1844
|
-
x: w.clientX,
|
|
1845
|
-
y: w.clientY
|
|
1846
|
-
}, M.current = k.current, D.current) {
|
|
1847
|
-
const I = Gs(D.current);
|
|
1848
|
-
B.current = I, P(I), T({
|
|
1849
|
-
x: I.x,
|
|
1850
|
-
y: I.y
|
|
1851
|
-
});
|
|
1852
|
-
}
|
|
1853
|
-
f.setHovering(!0), v(!0), R(!1), C(null), De.current = !0, D.current?.setPointerCapture(w.pointerId);
|
|
1854
|
-
}
|
|
1855
|
-
}
|
|
1856
|
-
function Yt(w) {
|
|
1857
|
-
if (!m)
|
|
1858
|
-
return;
|
|
1859
|
-
w.preventDefault(), De.current && (k.current = {
|
|
1860
|
-
x: w.clientX,
|
|
1861
|
-
y: w.clientY
|
|
1862
|
-
}, De.current = !1);
|
|
1863
|
-
const {
|
|
1864
|
-
clientY: y,
|
|
1865
|
-
clientX: N,
|
|
1866
|
-
movementX: I,
|
|
1867
|
-
movementY: A
|
|
1868
|
-
} = w;
|
|
1869
|
-
(A < 0 && y > M.current.y || A > 0 && y < M.current.y) && (M.current = {
|
|
1870
|
-
x: M.current.x,
|
|
1871
|
-
y
|
|
1872
|
-
}), (I < 0 && N > M.current.x || I > 0 && N < M.current.x) && (M.current = {
|
|
1873
|
-
x: N,
|
|
1874
|
-
y: M.current.y
|
|
1875
|
-
});
|
|
1876
|
-
const V = N - k.current.x, z = y - k.current.y, tn = y - M.current.y, nn = N - M.current.x;
|
|
1877
|
-
if (!S && Math.sqrt(V * V + z * z) >= Ys && (R(!0), b === null)) {
|
|
1878
|
-
const ye = a.includes("left") || a.includes("right"), sn = a.includes("up") || a.includes("down");
|
|
1879
|
-
if (ye && sn) {
|
|
1880
|
-
const rn = Math.abs(V), on = Math.abs(z);
|
|
1881
|
-
C(rn > on ? "horizontal" : "vertical");
|
|
1882
|
-
}
|
|
1883
|
-
}
|
|
1884
|
-
let _;
|
|
1885
|
-
if (!te.current)
|
|
1886
|
-
b === "vertical" ? z > 0 ? _ = "down" : z < 0 && (_ = "up") : b === "horizontal" ? V > 0 ? _ = "right" : V < 0 && (_ = "left") : Math.abs(V) >= Math.abs(z) ? _ = V > 0 ? "right" : "left" : _ = z > 0 ? "down" : "up", _ && a.includes(_) && (te.current = _, re.current = gt(_, V, z), h(_));
|
|
1887
|
-
else {
|
|
1888
|
-
const Fe = te.current, ye = gt(Fe, nn, tn);
|
|
1889
|
-
ye > ie ? (he.current = !1, h(Fe)) : !(a.includes("left") && a.includes("right")) && !(a.includes("up") && a.includes("down")) && re.current - ye >= qs && (he.current = !0);
|
|
1890
|
-
}
|
|
1891
|
-
const be = Kt(V, z);
|
|
1892
|
-
let Pe = B.current.x, ke = B.current.y;
|
|
1893
|
-
b === "horizontal" ? (a.includes("left") || a.includes("right")) && (Pe += be.x) : (b === "vertical" || (a.includes("left") || a.includes("right")) && (Pe += be.x), (a.includes("up") || a.includes("down")) && (ke += be.y)), T({
|
|
1894
|
-
x: Pe,
|
|
1895
|
-
y: ke
|
|
1896
|
-
});
|
|
1897
|
-
}
|
|
1898
|
-
function Gt(w) {
|
|
1899
|
-
if (!m)
|
|
1900
|
-
return;
|
|
1901
|
-
if (v(!1), R(!1), C(null), D.current?.releasePointerCapture(w.pointerId), he.current) {
|
|
1902
|
-
T({
|
|
1903
|
-
x: E.x,
|
|
1904
|
-
y: E.y
|
|
1905
|
-
}), h(void 0);
|
|
1906
|
-
return;
|
|
1907
|
-
}
|
|
1908
|
-
let y = !1;
|
|
1909
|
-
const N = g.x - E.x, I = g.y - E.y;
|
|
1910
|
-
let A;
|
|
1911
|
-
for (const V of a) {
|
|
1912
|
-
switch (V) {
|
|
1913
|
-
case "right":
|
|
1914
|
-
N > ie && (y = !0, A = "right");
|
|
1915
|
-
break;
|
|
1916
|
-
case "left":
|
|
1917
|
-
N < -ie && (y = !0, A = "left");
|
|
1918
|
-
break;
|
|
1919
|
-
case "down":
|
|
1920
|
-
I > ie && (y = !0, A = "down");
|
|
1921
|
-
break;
|
|
1922
|
-
case "up":
|
|
1923
|
-
I < -ie && (y = !0, A = "up");
|
|
1924
|
-
break;
|
|
1925
|
-
}
|
|
1926
|
-
if (y)
|
|
1927
|
-
break;
|
|
1928
|
-
}
|
|
1929
|
-
y ? (h(A), F(!0), f.closeToast(s.id)) : (T({
|
|
1930
|
-
x: E.x,
|
|
1931
|
-
y: E.y
|
|
1932
|
-
}), h(void 0));
|
|
1933
|
-
}
|
|
1934
|
-
function Zt(w) {
|
|
1935
|
-
if (w.key === "Escape") {
|
|
1936
|
-
if (!D.current || !J(D.current, ue(K(D.current))))
|
|
1937
|
-
return;
|
|
1938
|
-
f.closeToast(s.id);
|
|
1939
|
-
}
|
|
1940
|
-
}
|
|
1941
|
-
u.useEffect(() => {
|
|
1942
|
-
if (!d)
|
|
1943
|
-
return;
|
|
1944
|
-
const w = D.current;
|
|
1945
|
-
if (!w)
|
|
1946
|
-
return;
|
|
1947
|
-
function y(N) {
|
|
1948
|
-
J(w, N.target) && N.preventDefault();
|
|
1949
|
-
}
|
|
1950
|
-
return w.addEventListener("touchmove", y, {
|
|
1951
|
-
passive: !1
|
|
1952
|
-
}), () => {
|
|
1953
|
-
w.removeEventListener("touchmove", y);
|
|
1954
|
-
};
|
|
1955
|
-
}, [d]);
|
|
1956
|
-
function Xt() {
|
|
1957
|
-
if (!m && g.x === E.x && g.y === E.y && !O)
|
|
1958
|
-
return {
|
|
1959
|
-
[Z.swipeMovementX]: "0px",
|
|
1960
|
-
[Z.swipeMovementY]: "0px"
|
|
1961
|
-
};
|
|
1962
|
-
const w = g.x - E.x, y = g.y - E.y;
|
|
1963
|
-
return {
|
|
1964
|
-
transition: m ? "none" : void 0,
|
|
1965
|
-
// While swiping, freeze the element at its current visual transform so it doesn't snap to the
|
|
1966
|
-
// end position.
|
|
1967
|
-
transform: m ? `translateX(${g.x}px) translateY(${g.y}px) scale(${E.scale})` : void 0,
|
|
1968
|
-
[Z.swipeMovementX]: `${w}px`,
|
|
1969
|
-
[Z.swipeMovementY]: `${y}px`
|
|
1970
|
-
};
|
|
1971
|
-
}
|
|
1972
|
-
const Qe = s.priority === "high", Jt = {
|
|
1973
|
-
role: Qe ? "alertdialog" : "dialog",
|
|
1974
|
-
tabIndex: 0,
|
|
1975
|
-
"aria-modal": !1,
|
|
1976
|
-
"aria-labelledby": j,
|
|
1977
|
-
"aria-describedby": G,
|
|
1978
|
-
"aria-hidden": Qe && !Wt ? !0 : void 0,
|
|
1979
|
-
onPointerDown: d ? qt : void 0,
|
|
1980
|
-
onPointerMove: d ? Yt : void 0,
|
|
1981
|
-
onPointerUp: d ? Gt : void 0,
|
|
1982
|
-
onKeyDown: Zt,
|
|
1983
|
-
inert: $s(s.limited),
|
|
1984
|
-
style: {
|
|
1985
|
-
...Xt(),
|
|
1986
|
-
[Z.index]: s.transitionStatus === "ending" ? Ie : Re,
|
|
1987
|
-
[Z.offsetY]: `${Ht}px`,
|
|
1988
|
-
[Z.height]: s.height ? `${s.height}px` : void 0
|
|
1989
|
-
}
|
|
1990
|
-
}, ge = u.useMemo(() => ({
|
|
1991
|
-
rootRef: D,
|
|
1992
|
-
toast: s,
|
|
1993
|
-
titleId: j,
|
|
1994
|
-
setTitleId: ee,
|
|
1995
|
-
descriptionId: G,
|
|
1996
|
-
setDescriptionId: pe,
|
|
1997
|
-
swiping: m,
|
|
1998
|
-
swipeDirection: p,
|
|
1999
|
-
recalculateHeight: me,
|
|
2000
|
-
index: Ie,
|
|
2001
|
-
visibleIndex: Re,
|
|
2002
|
-
expanded: Oe
|
|
2003
|
-
}), [s, j, G, m, p, me, Ie, Re, Oe]), Qt = {
|
|
2004
|
-
transitionStatus: s.transitionStatus,
|
|
2005
|
-
expanded: Oe,
|
|
2006
|
-
limited: s.limited || !1,
|
|
2007
|
-
type: s.type,
|
|
2008
|
-
swiping: ge.swiping,
|
|
2009
|
-
swipeDirection: ge.swipeDirection
|
|
2010
|
-
}, en = Q("div", e, {
|
|
2011
|
-
ref: [n, ge.rootRef],
|
|
2012
|
-
state: Qt,
|
|
2013
|
-
stateAttributesMapping: Ks,
|
|
2014
|
-
props: [Jt, i]
|
|
2015
|
-
});
|
|
2016
|
-
return /* @__PURE__ */ x(Ze.Provider, {
|
|
2017
|
-
value: ge,
|
|
2018
|
-
children: en
|
|
2019
|
-
});
|
|
2020
|
-
});
|
|
2021
|
-
process.env.NODE_ENV !== "production" && (Mt.displayName = "ToastRoot");
|
|
2022
|
-
const At = /* @__PURE__ */ u.forwardRef(function(e, n) {
|
|
2023
|
-
const {
|
|
2024
|
-
render: s,
|
|
2025
|
-
className: r,
|
|
2026
|
-
...o
|
|
2027
|
-
} = e, {
|
|
2028
|
-
visibleIndex: c,
|
|
2029
|
-
expanded: i,
|
|
2030
|
-
recalculateHeight: l
|
|
2031
|
-
} = Ne(), a = u.useRef(null);
|
|
2032
|
-
$(() => {
|
|
2033
|
-
const h = a.current;
|
|
2034
|
-
if (!h || (l(), typeof ResizeObserver != "function" || typeof MutationObserver != "function"))
|
|
2035
|
-
return;
|
|
2036
|
-
const m = new ResizeObserver(() => l(!0)), v = new MutationObserver(() => l(!0));
|
|
2037
|
-
return m.observe(h), v.observe(h, {
|
|
2038
|
-
childList: !0,
|
|
2039
|
-
subtree: !0,
|
|
2040
|
-
characterData: !0
|
|
2041
|
-
}), () => {
|
|
2042
|
-
m.disconnect(), v.disconnect();
|
|
2043
|
-
};
|
|
2044
|
-
}, [l]);
|
|
2045
|
-
const d = c > 0;
|
|
2046
|
-
return Q("div", e, {
|
|
2047
|
-
ref: [n, a],
|
|
2048
|
-
state: {
|
|
2049
|
-
expanded: i,
|
|
2050
|
-
behind: d
|
|
2051
|
-
},
|
|
2052
|
-
props: o
|
|
2053
|
-
});
|
|
2054
|
-
});
|
|
2055
|
-
process.env.NODE_ENV !== "production" && (At.displayName = "ToastContent");
|
|
2056
|
-
const Vt = /* @__PURE__ */ u.forwardRef(function(e, n) {
|
|
2057
|
-
const {
|
|
2058
|
-
render: s,
|
|
2059
|
-
className: r,
|
|
2060
|
-
id: o,
|
|
2061
|
-
children: c,
|
|
2062
|
-
...i
|
|
2063
|
-
} = e, {
|
|
2064
|
-
toast: l,
|
|
2065
|
-
setDescriptionId: a
|
|
2066
|
-
} = Ne(), d = c ?? l.description, f = !!d, p = He(o);
|
|
2067
|
-
$(() => {
|
|
2068
|
-
if (f)
|
|
2069
|
-
return a(p), () => {
|
|
2070
|
-
a(void 0);
|
|
2071
|
-
};
|
|
2072
|
-
}, [f, p, a]);
|
|
2073
|
-
const h = {
|
|
2074
|
-
type: l.type
|
|
2075
|
-
}, m = Q("p", e, {
|
|
2076
|
-
ref: n,
|
|
2077
|
-
state: h,
|
|
2078
|
-
props: {
|
|
2079
|
-
...i,
|
|
2080
|
-
id: p,
|
|
2081
|
-
children: d
|
|
2082
|
-
}
|
|
2083
|
-
});
|
|
2084
|
-
return f ? m : null;
|
|
2085
|
-
});
|
|
2086
|
-
process.env.NODE_ENV !== "production" && (Vt.displayName = "ToastDescription");
|
|
2087
|
-
const _t = /* @__PURE__ */ u.forwardRef(function(e, n) {
|
|
2088
|
-
const {
|
|
2089
|
-
render: s,
|
|
2090
|
-
className: r,
|
|
2091
|
-
id: o,
|
|
2092
|
-
children: c,
|
|
2093
|
-
...i
|
|
2094
|
-
} = e, {
|
|
2095
|
-
toast: l,
|
|
2096
|
-
setTitleId: a
|
|
2097
|
-
} = Ne(), d = c ?? l.title, f = !!d, p = He(o);
|
|
2098
|
-
$(() => {
|
|
2099
|
-
if (f)
|
|
2100
|
-
return a(p), () => {
|
|
2101
|
-
a(void 0);
|
|
2102
|
-
};
|
|
2103
|
-
}, [f, p, a]);
|
|
2104
|
-
const h = {
|
|
2105
|
-
type: l.type
|
|
2106
|
-
}, m = Q("h2", e, {
|
|
2107
|
-
ref: n,
|
|
2108
|
-
state: h,
|
|
2109
|
-
props: {
|
|
2110
|
-
...i,
|
|
2111
|
-
id: p,
|
|
2112
|
-
children: d
|
|
2113
|
-
}
|
|
2114
|
-
});
|
|
2115
|
-
return f ? m : null;
|
|
2116
|
-
});
|
|
2117
|
-
process.env.NODE_ENV !== "production" && (_t.displayName = "ToastTitle");
|
|
2118
|
-
let ze;
|
|
2119
|
-
process.env.NODE_ENV !== "production" && (ze = /* @__PURE__ */ new Set());
|
|
2120
|
-
function bt(...t) {
|
|
2121
|
-
if (process.env.NODE_ENV !== "production") {
|
|
2122
|
-
const e = t.join(" ");
|
|
2123
|
-
ze.has(e) || (ze.add(e), console.error(`Base UI: ${e}`));
|
|
2124
|
-
}
|
|
2125
|
-
}
|
|
2126
|
-
const Lt = /* @__PURE__ */ u.createContext(void 0);
|
|
2127
|
-
process.env.NODE_ENV !== "production" && (Lt.displayName = "CompositeRootContext");
|
|
2128
|
-
function Zs(t = !1) {
|
|
2129
|
-
const e = u.useContext(Lt);
|
|
2130
|
-
if (e === void 0 && !t)
|
|
2131
|
-
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>." : Y(16));
|
|
2132
|
-
return e;
|
|
2133
|
-
}
|
|
2134
|
-
function Xs(t) {
|
|
2135
|
-
const {
|
|
2136
|
-
focusableWhenDisabled: e,
|
|
2137
|
-
disabled: n,
|
|
2138
|
-
composite: s = !1,
|
|
2139
|
-
tabIndex: r = 0,
|
|
2140
|
-
isNativeButton: o
|
|
2141
|
-
} = t, c = s && e !== !1, i = s && e === !1;
|
|
2142
|
-
return {
|
|
2143
|
-
props: u.useMemo(() => {
|
|
2144
|
-
const a = {
|
|
2145
|
-
// allow Tabbing away from focusableWhenDisabled elements
|
|
2146
|
-
onKeyDown(d) {
|
|
2147
|
-
n && e && d.key !== "Tab" && d.preventDefault();
|
|
2148
|
-
}
|
|
2149
|
-
};
|
|
2150
|
-
return s || (a.tabIndex = r, !o && n && (a.tabIndex = e ? r : -1)), (o && (e || c) || !o && n) && (a["aria-disabled"] = n), o && (!e || i) && (a.disabled = n), a;
|
|
2151
|
-
}, [s, n, e, c, i, o, r])
|
|
2152
|
-
};
|
|
2153
|
-
}
|
|
2154
|
-
function Js(t = {}) {
|
|
2155
|
-
const {
|
|
2156
|
-
disabled: e = !1,
|
|
2157
|
-
focusableWhenDisabled: n,
|
|
2158
|
-
tabIndex: s = 0,
|
|
2159
|
-
native: r = !0
|
|
2160
|
-
} = t, o = u.useRef(null), c = Zs(!0) !== void 0, i = X(() => {
|
|
2161
|
-
const p = o.current;
|
|
2162
|
-
return !!(p?.tagName === "A" && p?.href);
|
|
2163
|
-
}), {
|
|
2164
|
-
props: l
|
|
2165
|
-
} = Xs({
|
|
2166
|
-
focusableWhenDisabled: n,
|
|
2167
|
-
disabled: e,
|
|
2168
|
-
composite: c,
|
|
2169
|
-
tabIndex: s,
|
|
2170
|
-
isNativeButton: r
|
|
2171
|
-
});
|
|
2172
|
-
process.env.NODE_ENV !== "production" && u.useEffect(() => {
|
|
2173
|
-
if (!o.current)
|
|
2174
|
-
return;
|
|
2175
|
-
const p = o.current.tagName === "BUTTON";
|
|
2176
|
-
if (r) {
|
|
2177
|
-
if (!p) {
|
|
2178
|
-
const h = Le.captureOwnerStack?.() || "";
|
|
2179
|
-
bt(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${h}`);
|
|
2180
|
-
}
|
|
2181
|
-
} else if (p) {
|
|
2182
|
-
const h = Le.captureOwnerStack?.() || "";
|
|
2183
|
-
bt(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${h}`);
|
|
2184
|
-
}
|
|
2185
|
-
}, [r]);
|
|
2186
|
-
const a = u.useCallback(() => {
|
|
2187
|
-
const p = o.current;
|
|
2188
|
-
Qs(p) && c && e && l.disabled === void 0 && p.disabled && (p.disabled = !1);
|
|
2189
|
-
}, [e, l.disabled, c]);
|
|
2190
|
-
$(a, [a]);
|
|
2191
|
-
const d = u.useCallback((p = {}) => {
|
|
2192
|
-
const {
|
|
2193
|
-
onClick: h,
|
|
2194
|
-
onMouseDown: m,
|
|
2195
|
-
onKeyUp: v,
|
|
2196
|
-
onKeyDown: S,
|
|
2197
|
-
onPointerDown: R,
|
|
2198
|
-
...O
|
|
2199
|
-
} = p;
|
|
2200
|
-
return St({
|
|
2201
|
-
type: r ? "button" : void 0,
|
|
2202
|
-
onClick(g) {
|
|
2203
|
-
if (e) {
|
|
2204
|
-
g.preventDefault();
|
|
2205
|
-
return;
|
|
2206
|
-
}
|
|
2207
|
-
h?.(g);
|
|
2208
|
-
},
|
|
2209
|
-
onMouseDown(g) {
|
|
2210
|
-
e || m?.(g);
|
|
2211
|
-
},
|
|
2212
|
-
onKeyDown(g) {
|
|
2213
|
-
if (e || (je(g), S?.(g)), g.baseUIHandlerPrevented)
|
|
2214
|
-
return;
|
|
2215
|
-
const T = g.target === g.currentTarget && !r && !i() && !e, E = g.key === "Enter", P = g.key === " ";
|
|
2216
|
-
T && ((P || E) && g.preventDefault(), E && h?.(g));
|
|
2217
|
-
},
|
|
2218
|
-
onKeyUp(g) {
|
|
2219
|
-
e || (je(g), v?.(g)), !g.baseUIHandlerPrevented && g.target === g.currentTarget && !r && !e && g.key === " " && h?.(g);
|
|
2220
|
-
},
|
|
2221
|
-
onPointerDown(g) {
|
|
2222
|
-
if (e) {
|
|
2223
|
-
g.preventDefault();
|
|
2224
|
-
return;
|
|
2225
|
-
}
|
|
2226
|
-
R?.(g);
|
|
2227
|
-
}
|
|
2228
|
-
}, r ? void 0 : {
|
|
2229
|
-
role: "button"
|
|
2230
|
-
}, l, O);
|
|
2231
|
-
}, [e, l, r, i]), f = X((p) => {
|
|
2232
|
-
o.current = p, a();
|
|
2233
|
-
});
|
|
2234
|
-
return {
|
|
2235
|
-
getButtonProps: d,
|
|
2236
|
-
buttonRef: f
|
|
2237
|
-
};
|
|
2238
|
-
}
|
|
2239
|
-
function Qs(t) {
|
|
2240
|
-
return wn(t) && t.tagName === "BUTTON";
|
|
2241
|
-
}
|
|
2242
|
-
const $t = /* @__PURE__ */ u.forwardRef(function(e, n) {
|
|
2243
|
-
const {
|
|
2244
|
-
render: s,
|
|
2245
|
-
className: r,
|
|
2246
|
-
disabled: o,
|
|
2247
|
-
nativeButton: c = !0,
|
|
2248
|
-
...i
|
|
2249
|
-
} = e, l = Ge(), {
|
|
2250
|
-
toast: a
|
|
2251
|
-
} = Ne(), d = l.useState("expanded"), [f, p] = u.useState(!1), {
|
|
2252
|
-
getButtonProps: h,
|
|
2253
|
-
buttonRef: m
|
|
2254
|
-
} = Js({
|
|
2255
|
-
disabled: o,
|
|
2256
|
-
native: c
|
|
2257
|
-
}), v = {
|
|
2258
|
-
type: a.type
|
|
2259
|
-
};
|
|
2260
|
-
return Q("button", e, {
|
|
2261
|
-
ref: [n, m],
|
|
2262
|
-
state: v,
|
|
2263
|
-
props: [{
|
|
2264
|
-
"aria-hidden": !d && !f,
|
|
2265
|
-
onClick() {
|
|
2266
|
-
l.closeToast(a.id);
|
|
2267
|
-
},
|
|
2268
|
-
onFocus() {
|
|
2269
|
-
p(!0);
|
|
2270
|
-
},
|
|
2271
|
-
onBlur() {
|
|
2272
|
-
p(!1);
|
|
2273
|
-
}
|
|
2274
|
-
}, i, h]
|
|
2275
|
-
});
|
|
2276
|
-
});
|
|
2277
|
-
process.env.NODE_ENV !== "production" && ($t.displayName = "ToastClose");
|
|
2278
|
-
function er(t) {
|
|
2279
|
-
return `data-base-ui-${t}`;
|
|
2280
|
-
}
|
|
2281
|
-
const Je = /* @__PURE__ */ u.createContext(null);
|
|
2282
|
-
process.env.NODE_ENV !== "production" && (Je.displayName = "PortalContext");
|
|
2283
|
-
const tr = () => u.useContext(Je), nr = er("portal");
|
|
2284
|
-
function Ut(t = {}) {
|
|
2285
|
-
const {
|
|
2286
|
-
ref: e,
|
|
2287
|
-
container: n,
|
|
2288
|
-
componentProps: s = W,
|
|
2289
|
-
elementProps: r
|
|
2290
|
-
} = t, o = He(), i = tr()?.portalNode, [l, a] = u.useState(null), [d, f] = u.useState(null), p = X((S) => {
|
|
2291
|
-
S !== null && f(S);
|
|
2292
|
-
}), h = u.useRef(null);
|
|
2293
|
-
$(() => {
|
|
2294
|
-
if (n === null) {
|
|
2295
|
-
h.current && (h.current = null, f(null), a(null));
|
|
2296
|
-
return;
|
|
2297
|
-
}
|
|
2298
|
-
if (o == null)
|
|
2299
|
-
return;
|
|
2300
|
-
const S = (n && (En(n) ? n : n.current)) ?? i ?? document.body;
|
|
2301
|
-
if (S == null) {
|
|
2302
|
-
h.current && (h.current = null, f(null), a(null));
|
|
2303
|
-
return;
|
|
2304
|
-
}
|
|
2305
|
-
h.current !== S && (h.current = S, f(null), a(S));
|
|
2306
|
-
}, [n, i, o]);
|
|
2307
|
-
const m = Q("div", s, {
|
|
2308
|
-
ref: [e, p],
|
|
2309
|
-
props: [{
|
|
2310
|
-
id: o,
|
|
2311
|
-
[nr]: ""
|
|
2312
|
-
}, r]
|
|
2313
|
-
});
|
|
2314
|
-
return {
|
|
2315
|
-
portalNode: d,
|
|
2316
|
-
portalSubtree: l && m ? /* @__PURE__ */ de.createPortal(m, l) : null
|
|
2317
|
-
};
|
|
2318
|
-
}
|
|
2319
|
-
const sr = /* @__PURE__ */ u.forwardRef(function(e, n) {
|
|
2320
|
-
const {
|
|
2321
|
-
children: s,
|
|
2322
|
-
container: r,
|
|
2323
|
-
className: o,
|
|
2324
|
-
render: c,
|
|
2325
|
-
renderGuards: i,
|
|
2326
|
-
...l
|
|
2327
|
-
} = e, {
|
|
2328
|
-
portalNode: a,
|
|
2329
|
-
portalSubtree: d
|
|
2330
|
-
} = Ut({
|
|
2331
|
-
container: r,
|
|
2332
|
-
ref: n,
|
|
2333
|
-
componentProps: e,
|
|
2334
|
-
elementProps: l
|
|
2335
|
-
}), f = u.useRef(null), p = u.useRef(null), h = u.useRef(null), m = u.useRef(null), [v, S] = u.useState(null), R = v?.modal, O = v?.open, F = typeof i == "boolean" ? i : !!v && !v.modal && v.open && !!a;
|
|
2336
|
-
u.useEffect(() => {
|
|
2337
|
-
if (!a || R)
|
|
2338
|
-
return;
|
|
2339
|
-
function T(E) {
|
|
2340
|
-
a && E.relatedTarget && Ve(E) && (E.type === "focusin" ? lt : ss)(a);
|
|
2341
|
-
}
|
|
2342
|
-
return a.addEventListener("focusin", T, !0), a.addEventListener("focusout", T, !0), () => {
|
|
2343
|
-
a.removeEventListener("focusin", T, !0), a.removeEventListener("focusout", T, !0);
|
|
2344
|
-
};
|
|
2345
|
-
}, [a, R]), u.useEffect(() => {
|
|
2346
|
-
!a || O || lt(a);
|
|
2347
|
-
}, [O, a]);
|
|
2348
|
-
const g = u.useMemo(() => ({
|
|
2349
|
-
beforeOutsideRef: f,
|
|
2350
|
-
afterOutsideRef: p,
|
|
2351
|
-
beforeInsideRef: h,
|
|
2352
|
-
afterInsideRef: m,
|
|
2353
|
-
portalNode: a,
|
|
2354
|
-
setFocusManagerState: S
|
|
2355
|
-
}), [a]);
|
|
2356
|
-
return /* @__PURE__ */ U(u.Fragment, {
|
|
2357
|
-
children: [d, /* @__PURE__ */ U(Je.Provider, {
|
|
2358
|
-
value: g,
|
|
2359
|
-
children: [F && a && /* @__PURE__ */ x(ne, {
|
|
2360
|
-
"data-type": "outside",
|
|
2361
|
-
ref: f,
|
|
2362
|
-
onFocus: (T) => {
|
|
2363
|
-
if (Ve(T, a))
|
|
2364
|
-
h.current?.focus();
|
|
2365
|
-
else {
|
|
2366
|
-
const E = v ? v.domReference : null;
|
|
2367
|
-
ns(E)?.focus();
|
|
2368
|
-
}
|
|
2369
|
-
}
|
|
2370
|
-
}), F && a && /* @__PURE__ */ x("span", {
|
|
2371
|
-
"aria-owns": a.id,
|
|
2372
|
-
style: In
|
|
2373
|
-
}), a && /* @__PURE__ */ de.createPortal(s, a), F && a && /* @__PURE__ */ x(ne, {
|
|
2374
|
-
"data-type": "outside",
|
|
2375
|
-
ref: p,
|
|
2376
|
-
onFocus: (T) => {
|
|
2377
|
-
if (Ve(T, a))
|
|
2378
|
-
m.current?.focus();
|
|
2379
|
-
else {
|
|
2380
|
-
const E = v ? v.domReference : null;
|
|
2381
|
-
ts(E)?.focus(), v?.closeOnFocusOut && v?.onOpenChange(!1, On(Rn, T.nativeEvent));
|
|
2382
|
-
}
|
|
2383
|
-
}
|
|
2384
|
-
})]
|
|
2385
|
-
})]
|
|
2386
|
-
});
|
|
2387
|
-
});
|
|
2388
|
-
process.env.NODE_ENV !== "production" && (sr.displayName = "FloatingPortal");
|
|
2389
|
-
const jt = /* @__PURE__ */ u.forwardRef(function(e, n) {
|
|
2390
|
-
const {
|
|
2391
|
-
children: s,
|
|
2392
|
-
container: r,
|
|
2393
|
-
className: o,
|
|
2394
|
-
render: c,
|
|
2395
|
-
...i
|
|
2396
|
-
} = e, {
|
|
2397
|
-
portalNode: l,
|
|
2398
|
-
portalSubtree: a
|
|
2399
|
-
} = Ut({
|
|
2400
|
-
container: r,
|
|
2401
|
-
ref: n,
|
|
2402
|
-
componentProps: e,
|
|
2403
|
-
elementProps: i
|
|
2404
|
-
});
|
|
2405
|
-
return !a && !l ? null : /* @__PURE__ */ U(u.Fragment, {
|
|
2406
|
-
children: [a, l && /* @__PURE__ */ de.createPortal(s, l)]
|
|
2407
|
-
});
|
|
2408
|
-
});
|
|
2409
|
-
process.env.NODE_ENV !== "production" && (jt.displayName = "FloatingPortalLite");
|
|
2410
|
-
const rr = jt;
|
|
2411
|
-
function Bt() {
|
|
2412
|
-
const t = u.useContext(Ce);
|
|
2413
|
-
if (!t)
|
|
2414
|
-
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: useToastManager must be used within <Toast.Provider>." : Y(73));
|
|
2415
|
-
const e = t.useState("toasts");
|
|
2416
|
-
return u.useMemo(() => ({
|
|
2417
|
-
toasts: e,
|
|
2418
|
-
add: t.addToast,
|
|
2419
|
-
close: t.closeToast,
|
|
2420
|
-
update: t.updateToast,
|
|
2421
|
-
promise: t.promiseToast
|
|
2422
|
-
}), [e, t]);
|
|
2423
|
-
}
|
|
2424
|
-
const or = (t) => {
|
|
2425
|
-
const [e, n] = un(!1), s = () => n(!0), r = () => n(!1);
|
|
2426
|
-
return ln(() => {
|
|
2427
|
-
const o = t.current;
|
|
2428
|
-
if (o)
|
|
2429
|
-
return o.addEventListener("mouseenter", s), o.addEventListener("mouseleave", r), () => {
|
|
2430
|
-
o.removeEventListener("mouseenter", s), o.removeEventListener("mouseleave", r);
|
|
2431
|
-
};
|
|
2432
|
-
}, []), e;
|
|
2433
|
-
}, ir = an(
|
|
2434
|
-
"shadow-notification relative isolate z-tooltip flex w-full flex-col overflow-hidden rounded-xl border bg-card-background text-sm backdrop-blur-md transition-all duration-300",
|
|
2435
|
-
{
|
|
2436
|
-
variants: {
|
|
2437
|
-
theme: {
|
|
2438
|
-
default: "border-card-border text-foreground shadow-black/5",
|
|
2439
|
-
info: "border-alert-info-border bg-alert-info-bg text-alert-info-text",
|
|
2440
|
-
warn: "border-alert-warn-border bg-alert-warn-bg text-alert-warn-text",
|
|
2441
|
-
muted: "border-alert-muted-border bg-alert-muted-bg text-alert-muted-text",
|
|
2442
|
-
danger: "border-alert-danger-border bg-alert-danger-bg text-alert-danger-text",
|
|
2443
|
-
success: "border-alert-success-border bg-alert-success-bg text-alert-success-text",
|
|
2444
|
-
secondary: "border-alert-secondary-border bg-alert-secondary-bg text-alert-secondary-text"
|
|
2445
|
-
}
|
|
2446
|
-
},
|
|
2447
|
-
defaultVariants: { theme: "default" }
|
|
2448
|
-
}
|
|
2449
|
-
), ar = {
|
|
2450
|
-
default: ae,
|
|
2451
|
-
info: ae,
|
|
2452
|
-
warn: nt,
|
|
2453
|
-
muted: ae,
|
|
2454
|
-
danger: nt,
|
|
2455
|
-
success: cn,
|
|
2456
|
-
secondary: ae
|
|
2457
|
-
}, zt = dn(() => {
|
|
2458
|
-
throw new Error("Not implemented");
|
|
2459
|
-
}), Rr = () => fn(zt);
|
|
2460
|
-
function cr(t) {
|
|
2461
|
-
const e = t.toast.data?.closable ?? !0, n = t.toast.data?.loading ?? !1, s = t.toast.data?.theme || "default", r = ir({ theme: s }), o = n ? wt : ar[s] || ae;
|
|
2462
|
-
return /* @__PURE__ */ x(Mt, { toast: t.toast, swipeDirection: "right", children: /* @__PURE__ */ x(
|
|
2463
|
-
yt.li,
|
|
2464
|
-
{
|
|
2465
|
-
layout: !0,
|
|
2466
|
-
initial: { opacity: 0, y: -20, scale: 0.95 },
|
|
2467
|
-
animate: { opacity: 1, y: 0, scale: 1 },
|
|
2468
|
-
exit: { opacity: 0, scale: 0.9, y: -20, transition: { duration: 0.2 } },
|
|
2469
|
-
transition: {
|
|
2470
|
-
type: "spring",
|
|
2471
|
-
damping: 25,
|
|
2472
|
-
stiffness: 300
|
|
2473
|
-
},
|
|
2474
|
-
className: "pointer-events-auto w-full list-none",
|
|
2475
|
-
children: /* @__PURE__ */ x(At, { className: st(r, "shadow-lg"), children: /* @__PURE__ */ U("div", { className: "flex items-start gap-3 p-4", children: [
|
|
2476
|
-
/* @__PURE__ */ x("div", { className: st("mt-0.5 shrink-0 opacity-80", n && "animate-spin"), children: /* @__PURE__ */ x(o, { className: "size-4" }) }),
|
|
2477
|
-
/* @__PURE__ */ U("div", { className: "flex flex-1 flex-col gap-1 overflow-hidden", children: [
|
|
2478
|
-
t.toast.title ? /* @__PURE__ */ x(_t, { className: "select-text truncate font-semibold leading-tight tracking-tight" }) : null,
|
|
2479
|
-
/* @__PURE__ */ x(Vt, { className: "line-clamp-2 select-text text-xs font-medium leading-relaxed opacity-90" })
|
|
2480
|
-
] }),
|
|
2481
|
-
e && !n ? /* @__PURE__ */ x($t, { className: "-mr-1 -mt-1 shrink-0 rounded-lg p-1.5 text-foreground/40 transition hover:bg-foreground/10 hover:text-foreground", children: /* @__PURE__ */ x(mn, { className: "size-3.5" }) }) : null
|
|
2482
|
-
] }) })
|
|
2483
|
-
}
|
|
2484
|
-
) });
|
|
2485
|
-
}
|
|
2486
|
-
function ur({ max: t = 5 }) {
|
|
2487
|
-
const e = pn(null), n = or(e), s = Bt(), r = t ? s.toasts.slice(0, t) : s.toasts, o = n ? r : r.slice(0, 3), c = r.length - o.length;
|
|
2488
|
-
return /* @__PURE__ */ U(
|
|
2489
|
-
Ft,
|
|
2490
|
-
{
|
|
2491
|
-
ref: e,
|
|
2492
|
-
className: "pointer-events-none fixed left-1/2 top-6 z-[100] flex w-full max-w-[380px] -translate-x-1/2 flex-col gap-3 overflow-visible outline-none",
|
|
2493
|
-
children: [
|
|
2494
|
-
/* @__PURE__ */ x(gn, { mode: "popLayout", initial: !1, children: o.map((i) => /* @__PURE__ */ x(cr, { toast: i }, i.id)) }),
|
|
2495
|
-
!n && c > 0 && /* @__PURE__ */ U(
|
|
2496
|
-
yt.div,
|
|
2497
|
-
{
|
|
2498
|
-
layout: !0,
|
|
2499
|
-
initial: { opacity: 0, y: -10 },
|
|
2500
|
-
animate: { opacity: 1, y: 0 },
|
|
2501
|
-
exit: { opacity: 0, y: -10 },
|
|
2502
|
-
className: "pointer-events-auto cursor-default self-center rounded-full border border-card-border bg-card-background/80 px-3 py-1 text-[10px] font-bold uppercase tracking-wider text-foreground/50 shadow-sm backdrop-blur transition-all hover:bg-card-background hover:text-foreground/80",
|
|
2503
|
-
children: [
|
|
2504
|
-
"+",
|
|
2505
|
-
c,
|
|
2506
|
-
" more"
|
|
2507
|
-
]
|
|
2508
|
-
}
|
|
2509
|
-
)
|
|
2510
|
-
]
|
|
2511
|
-
}
|
|
2512
|
-
);
|
|
2513
|
-
}
|
|
2514
|
-
function lr({ children: t, max: e = 5 }) {
|
|
2515
|
-
const n = Bt(), s = tt(() => {
|
|
2516
|
-
n.toasts.forEach((o) => n.close(o.id));
|
|
2517
|
-
}, [n]), r = tt(
|
|
2518
|
-
(o, c) => {
|
|
2519
|
-
const i = { theme: c?.theme, closable: c?.closable, loading: c?.loading };
|
|
2520
|
-
if (c?.id && n.toasts.find((d) => d.id === c.id))
|
|
2521
|
-
return n.update(c.id, {
|
|
2522
|
-
description: o,
|
|
2523
|
-
title: c.title,
|
|
2524
|
-
timeout: c.timeout,
|
|
2525
|
-
data: i
|
|
2526
|
-
}), { close: () => n.close(c.id), clear: s };
|
|
2527
|
-
const l = n.add({
|
|
2528
|
-
description: o,
|
|
2529
|
-
id: c?.id,
|
|
2530
|
-
title: c?.title,
|
|
2531
|
-
timeout: c?.timeout,
|
|
2532
|
-
data: i
|
|
2533
|
-
});
|
|
2534
|
-
return {
|
|
2535
|
-
close: () => n.close(l),
|
|
2536
|
-
clear: s
|
|
2537
|
-
};
|
|
2538
|
-
},
|
|
2539
|
-
[n, s]
|
|
2540
|
-
);
|
|
2541
|
-
return /* @__PURE__ */ U(zt.Provider, { value: r, children: [
|
|
2542
|
-
t,
|
|
2543
|
-
/* @__PURE__ */ x(rr, { children: /* @__PURE__ */ x(ur, { max: e }) })
|
|
2544
|
-
] });
|
|
2545
|
-
}
|
|
2546
|
-
function Or({ children: t, max: e = 5, timeout: n = 5e3 }) {
|
|
2547
|
-
return /* @__PURE__ */ x(kt, { limit: e, timeout: n, children: /* @__PURE__ */ x(lr, { max: e, children: t }) });
|
|
2548
|
-
}
|
|
2549
|
-
export {
|
|
2550
|
-
W as E,
|
|
2551
|
-
Dn as N,
|
|
2552
|
-
$ as a,
|
|
2553
|
-
X as b,
|
|
2554
|
-
He as c,
|
|
2555
|
-
ue as d,
|
|
2556
|
-
Q as e,
|
|
2557
|
-
Y as f,
|
|
2558
|
-
On as g,
|
|
2559
|
-
Ir as h,
|
|
2560
|
-
Cr as i,
|
|
2561
|
-
is as j,
|
|
2562
|
-
Nr as k,
|
|
2563
|
-
Dr as l,
|
|
2564
|
-
J as m,
|
|
2565
|
-
Sr as n,
|
|
2566
|
-
K as o,
|
|
2567
|
-
qe as p,
|
|
2568
|
-
St as q,
|
|
2569
|
-
ct as r,
|
|
2570
|
-
Rr as s,
|
|
2571
|
-
Tr as t,
|
|
2572
|
-
se as u,
|
|
2573
|
-
It as v,
|
|
2574
|
-
Or as w
|
|
2575
|
-
};
|
|
2576
|
-
//# sourceMappingURL=notifications-Dp0ydKJS.js.map
|