@42-central/ui-react 0.17.0 → 0.18.0
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/README.md +36 -175
- package/dist/{chunk-FD6P6PLQ.js → chunk-5JHDSVEZ.js} +3 -3
- package/dist/{chunk-FD6P6PLQ.js.map → chunk-5JHDSVEZ.js.map} +1 -1
- package/dist/{chunk-QMW7D5GU.js → chunk-5OQLFX47.js} +4 -3
- package/dist/chunk-5OQLFX47.js.map +1 -0
- package/dist/{chunk-VZ2TPU4B.js → chunk-6GDMSENK.js} +3 -2
- package/dist/chunk-6GDMSENK.js.map +1 -0
- package/dist/{chunk-TNNH3FVQ.js → chunk-6OLTJYSX.js} +24 -8
- package/dist/chunk-6OLTJYSX.js.map +1 -0
- package/dist/{chunk-POKDSVQT.js → chunk-AE7QTLJ5.js} +5 -4
- package/dist/chunk-AE7QTLJ5.js.map +1 -0
- package/dist/{chunk-44OV3PNH.js → chunk-B2YJKRNQ.js} +3 -3
- package/dist/{chunk-44OV3PNH.js.map → chunk-B2YJKRNQ.js.map} +1 -1
- package/dist/{chunk-YIQI2CF3.js → chunk-CTSO6V72.js} +3 -2
- package/dist/chunk-CTSO6V72.js.map +1 -0
- package/dist/{chunk-ACE7FBWE.js → chunk-EBREIC3L.js} +5 -4
- package/dist/chunk-EBREIC3L.js.map +1 -0
- package/dist/{chunk-UNSAA7YG.js → chunk-FHG54IT5.js} +3 -2
- package/dist/chunk-FHG54IT5.js.map +1 -0
- package/dist/{chunk-3GYOIQW7.js → chunk-FZIHZT5R.js} +5 -5
- package/dist/{chunk-3GYOIQW7.js.map → chunk-FZIHZT5R.js.map} +1 -1
- package/dist/{chunk-2H46IXW4.js → chunk-HAQJQFE6.js} +28 -8
- package/dist/chunk-HAQJQFE6.js.map +1 -0
- package/dist/{chunk-IHYFYMHJ.js → chunk-HT5JAHR3.js} +6 -6
- package/dist/{chunk-IHYFYMHJ.js.map → chunk-HT5JAHR3.js.map} +1 -1
- package/dist/chunk-I4SQQIP5.js +12 -0
- package/dist/chunk-I4SQQIP5.js.map +1 -0
- package/dist/{chunk-J3PELDH3.js → chunk-JITF6I7N.js} +22 -6
- package/dist/chunk-JITF6I7N.js.map +1 -0
- package/dist/{chunk-IFWCCAQV.js → chunk-KHMFNH3X.js} +3 -2
- package/dist/chunk-KHMFNH3X.js.map +1 -0
- package/dist/{chunk-SIG4DMNZ.js → chunk-MI2WZRK3.js} +4 -4
- package/dist/{chunk-SIG4DMNZ.js.map → chunk-MI2WZRK3.js.map} +1 -1
- package/dist/{chunk-PJL4ZL5V.js → chunk-O23Y5ML4.js} +8 -8
- package/dist/{chunk-PJL4ZL5V.js.map → chunk-O23Y5ML4.js.map} +1 -1
- package/dist/{chunk-P7A3BCAC.js → chunk-OWG4BCQR.js} +3 -3
- package/dist/{chunk-P7A3BCAC.js.map → chunk-OWG4BCQR.js.map} +1 -1
- package/dist/{chunk-FUWSTUDM.js → chunk-PH354ECN.js} +4 -4
- package/dist/{chunk-FUWSTUDM.js.map → chunk-PH354ECN.js.map} +1 -1
- package/dist/{chunk-U5GW5EBR.js → chunk-RAUOFTUH.js} +12 -20
- package/dist/chunk-RAUOFTUH.js.map +1 -0
- package/dist/{chunk-2762HZYX.js → chunk-S2HWWR2H.js} +47 -25
- package/dist/chunk-S2HWWR2H.js.map +1 -0
- package/dist/{chunk-VLUKI3HL.js → chunk-S7N4LGLZ.js} +6 -13
- package/dist/chunk-S7N4LGLZ.js.map +1 -0
- package/dist/{chunk-TMMEJKLI.js → chunk-UHNRAI6V.js} +17 -4
- package/dist/chunk-UHNRAI6V.js.map +1 -0
- package/dist/{chunk-3NZXWCGF.js → chunk-WHKKN3ZK.js} +6 -6
- package/dist/{chunk-3NZXWCGF.js.map → chunk-WHKKN3ZK.js.map} +1 -1
- package/dist/{chunk-MOI7B3KH.js → chunk-WQN64ZHG.js} +5 -5
- package/dist/{chunk-MOI7B3KH.js.map → chunk-WQN64ZHG.js.map} +1 -1
- package/dist/chunk-WSIVRDRB.js +34 -0
- package/dist/chunk-WSIVRDRB.js.map +1 -0
- package/dist/{chunk-6SWK4XG5.js → chunk-YXE4B6X3.js} +2 -2
- package/dist/chunk-YXE4B6X3.js.map +1 -0
- package/dist/{chunk-NGAQITWP.js → chunk-Z2Z5EXVT.js} +10 -7
- package/dist/chunk-Z2Z5EXVT.js.map +1 -0
- package/dist/{chunk-IXKELBJA.js → chunk-ZDXQ64A7.js} +63 -44
- package/dist/chunk-ZDXQ64A7.js.map +1 -0
- package/dist/components/accordion/accordion-data.d.ts +3 -2
- package/dist/components/accordion/accordion-data.d.ts.map +1 -1
- package/dist/components/accordion/accordion.d.ts +2 -2
- package/dist/components/accordion/accordion.d.ts.map +1 -1
- package/dist/components/accordion/index.js +20 -8
- package/dist/components/accordion/index.js.map +1 -1
- package/dist/components/action-icon/action-icon.d.ts +3 -4
- package/dist/components/action-icon/action-icon.d.ts.map +1 -1
- package/dist/components/action-icon/index.js +2 -1
- package/dist/components/alert/alert.d.ts +18 -10
- package/dist/components/alert/alert.d.ts.map +1 -1
- package/dist/components/alert/index.js +17 -5
- package/dist/components/alert/index.js.map +1 -1
- package/dist/components/app-shell/app-shell.d.ts +3 -2
- package/dist/components/app-shell/app-shell.d.ts.map +1 -1
- package/dist/components/app-shell/index.js +4 -2
- package/dist/components/app-shell/index.js.map +1 -1
- package/dist/components/autocomplete/index.js +5 -4
- package/dist/components/autocomplete/index.js.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.d.ts +3 -2
- package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/dist/components/breadcrumb/index.js +11 -5
- package/dist/components/breadcrumb/index.js.map +1 -1
- package/dist/components/button/button.d.ts +4 -4
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/button/index.js +2 -1
- package/dist/components/button-multi-select/index.js +4 -3
- package/dist/components/button-multi-select/index.js.map +1 -1
- package/dist/components/button-select/index.js +4 -3
- package/dist/components/button-select/index.js.map +1 -1
- package/dist/components/calendar/calendar-body.d.ts.map +1 -1
- package/dist/components/calendar/index.js +3 -2
- package/dist/components/checkbox/index.js +2 -2
- package/dist/components/choice-card-group/index.js +1 -1
- package/dist/components/circular-progress/circular-progress.d.ts +3 -2
- package/dist/components/circular-progress/circular-progress.d.ts.map +1 -1
- package/dist/components/circular-progress/index.js +1 -0
- package/dist/components/circular-progress/index.js.map +1 -1
- package/dist/components/clipboard/clipboard.d.ts +1 -1
- package/dist/components/clipboard/clipboard.d.ts.map +1 -1
- package/dist/components/clipboard/index.js +9 -5
- package/dist/components/clipboard/index.js.map +1 -1
- package/dist/components/code-block/chrome.d.ts +4 -1
- package/dist/components/code-block/chrome.d.ts.map +1 -1
- package/dist/components/code-block/chrome.js +5 -4
- package/dist/components/code-block/code-block.d.ts +7 -1
- package/dist/components/code-block/code-block.d.ts.map +1 -1
- package/dist/components/code-block/index.d.ts +1 -1
- package/dist/components/code-block/index.js +12 -10
- package/dist/components/code-block/index.js.map +1 -1
- package/dist/components/code-block/notation.d.ts +5 -2
- package/dist/components/code-block/notation.d.ts.map +1 -1
- package/dist/components/code-block/static.d.ts +4 -1
- package/dist/components/code-block/static.d.ts.map +1 -1
- package/dist/components/code-block/static.js +5 -4
- package/dist/components/code-block/static.js.map +1 -1
- package/dist/components/collapse/collapse.d.ts +7 -3
- package/dist/components/collapse/collapse.d.ts.map +1 -1
- package/dist/components/collapse/index.js +2 -1
- package/dist/components/combobox/combobox.d.ts +11 -10
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/index.js +5 -4
- package/dist/components/combobox-list/index.js +6 -5
- package/dist/components/data-table/index.js +20 -19
- package/dist/components/data-table/index.js.map +1 -1
- package/dist/components/date-picker/index.js +12 -11
- package/dist/components/date-picker/index.js.map +1 -1
- package/dist/components/divider/divider.d.ts +3 -2
- package/dist/components/divider/divider.d.ts.map +1 -1
- package/dist/components/divider/index.js +1 -1
- package/dist/components/drawer/drawer.d.ts +6 -5
- package/dist/components/drawer/drawer.d.ts.map +1 -1
- package/dist/components/drawer/index.js +3 -2
- package/dist/components/field/field.d.ts +7 -4
- package/dist/components/field/field.d.ts.map +1 -1
- package/dist/components/field/index.js +1 -1
- package/dist/components/file-upload/index.js +3 -2
- package/dist/components/file-upload/index.js.map +1 -1
- package/dist/components/hover-card/index.js +1 -1
- package/dist/components/input/index.js +2 -2
- package/dist/components/input/input.d.ts +3 -2
- package/dist/components/input/input.d.ts.map +1 -1
- package/dist/components/menu/index.js +3 -2
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/menu/menu-data.d.ts +6 -1
- package/dist/components/menu/menu-data.d.ts.map +1 -1
- package/dist/components/menu/menu.d.ts +5 -5
- package/dist/components/menu/menu.d.ts.map +1 -1
- package/dist/components/modal/index.js +3 -2
- package/dist/components/modal/modal.d.ts +4 -3
- package/dist/components/modal/modal.d.ts.map +1 -1
- package/dist/components/multi-combobox-list/index.js +6 -5
- package/dist/components/multi-select/index.js +7 -6
- package/dist/components/multi-select/index.js.map +1 -1
- package/dist/components/nav-link/index.js +3 -2
- package/dist/components/nav-link/tanstack.js +3 -2
- package/dist/components/nav-link/tanstack.js.map +1 -1
- package/dist/components/notification/create-notifier.d.ts.map +1 -1
- package/dist/components/notification/index.js +8 -7
- package/dist/components/notification/index.js.map +1 -1
- package/dist/components/notification/notification.d.ts +7 -6
- package/dist/components/notification/notification.d.ts.map +1 -1
- package/dist/components/number-input/index.js +4 -4
- package/dist/components/overlays/index.js +5 -4
- package/dist/components/overlays/index.js.map +1 -1
- package/dist/components/password-input/index.js +2 -2
- package/dist/components/pill/index.js +2 -1
- package/dist/components/pill/pill.d.ts +4 -2
- package/dist/components/pill/pill.d.ts.map +1 -1
- package/dist/components/pills-input/index.js +5 -4
- package/dist/components/pills-input/pills-input.d.ts +3 -2
- package/dist/components/pills-input/pills-input.d.ts.map +1 -1
- package/dist/components/pin-input/index.js +2 -2
- package/dist/components/popover/index.js +1 -1
- package/dist/components/popover/popover.d.ts +3 -2
- package/dist/components/popover/popover.d.ts.map +1 -1
- package/dist/components/progress/index.js +1 -0
- package/dist/components/progress/index.js.map +1 -1
- package/dist/components/progress/progress.d.ts +3 -2
- package/dist/components/progress/progress.d.ts.map +1 -1
- package/dist/components/radio-group/index.js +1 -1
- package/dist/components/rating/index.js +2 -1
- package/dist/components/rating/index.js.map +1 -1
- package/dist/components/rating/rating.d.ts +3 -2
- package/dist/components/rating/rating.d.ts.map +1 -1
- package/dist/components/schedule/index.d.ts +4 -4
- package/dist/components/schedule/index.js +211 -110
- package/dist/components/schedule/index.js.map +1 -1
- package/dist/components/schedule/schedule-agenda-list.d.ts +6 -7
- package/dist/components/schedule/schedule-agenda-list.d.ts.map +1 -1
- package/dist/components/schedule/schedule-agenda-view.d.ts +19 -16
- package/dist/components/schedule/schedule-agenda-view.d.ts.map +1 -1
- package/dist/components/schedule/schedule-create-draft.d.ts +3 -2
- package/dist/components/schedule/schedule-create-draft.d.ts.map +1 -1
- package/dist/components/schedule/schedule-dates.d.ts.map +1 -1
- package/dist/components/schedule/schedule-days-view.d.ts +3 -2
- package/dist/components/schedule/schedule-days-view.d.ts.map +1 -1
- package/dist/components/schedule/schedule-drag-ghost.d.ts +12 -5
- package/dist/components/schedule/schedule-drag-ghost.d.ts.map +1 -1
- package/dist/components/schedule/schedule-event-chip.d.ts.map +1 -1
- package/dist/components/schedule/schedule-geometry.d.ts +16 -0
- package/dist/components/schedule/schedule-geometry.d.ts.map +1 -1
- package/dist/components/schedule/schedule-grid-gesture.d.ts +29 -6
- package/dist/components/schedule/schedule-grid-gesture.d.ts.map +1 -1
- package/dist/components/schedule/schedule-month-view.d.ts +3 -2
- package/dist/components/schedule/schedule-month-view.d.ts.map +1 -1
- package/dist/components/schedule/schedule-next-up.d.ts +4 -3
- package/dist/components/schedule/schedule-next-up.d.ts.map +1 -1
- package/dist/components/schedule/schedule-timed-grid.d.ts.map +1 -1
- package/dist/components/schedule/schedule-toolbar.d.ts +3 -3
- package/dist/components/schedule/schedule-toolbar.d.ts.map +1 -1
- package/dist/components/schedule/schedule-types.d.ts +9 -4
- package/dist/components/schedule/schedule-types.d.ts.map +1 -1
- package/dist/components/schedule/schedule-views.d.ts +2 -2
- package/dist/components/schedule/schedule-views.d.ts.map +1 -1
- package/dist/components/schedule/schedule-year-view.d.ts +3 -2
- package/dist/components/schedule/schedule-year-view.d.ts.map +1 -1
- package/dist/components/schedule/schedule.d.ts +9 -6
- package/dist/components/schedule/schedule.d.ts.map +1 -1
- package/dist/components/schedule/use-event-create.d.ts.map +1 -1
- package/dist/components/schedule/use-event-drag.d.ts.map +1 -1
- package/dist/components/schedule/use-event-resize.d.ts.map +1 -1
- package/dist/components/segment-group/index.js +2 -2
- package/dist/components/select/index.js +4 -4
- package/dist/components/slider/index.js +2 -1
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/slider/slider.d.ts +3 -2
- package/dist/components/slider/slider.d.ts.map +1 -1
- package/dist/components/switch/index.js +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tabs/tabs-data.d.ts +3 -2
- package/dist/components/tabs/tabs-data.d.ts.map +1 -1
- package/dist/components/tags-input/index.js +6 -5
- package/dist/components/tags-input/index.js.map +1 -1
- package/dist/components/text-input/index.js +2 -2
- package/dist/components/textarea/index.js +2 -2
- package/dist/components/time-input/index.js +6 -6
- package/dist/components/timeline/index.js +8 -5
- package/dist/components/timeline/index.js.map +1 -1
- package/dist/components/timeline/timeline.d.ts +1 -1
- package/dist/components/timeline/timeline.d.ts.map +1 -1
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/tooltip.d.ts +2 -1
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/tree-multi-select/index.js +6 -5
- package/dist/components/tree-multi-select/index.js.map +1 -1
- package/dist/components/tree-select/index.js +3 -3
- package/dist/lib/as-child.d.ts +104 -0
- package/dist/lib/as-child.d.ts.map +1 -0
- package/dist/theme.css +9 -3
- package/package.json +1 -1
- package/src/as-child.contract.test.tsx +809 -0
- package/src/components/accordion/accordion-data.tsx +8 -5
- package/src/components/accordion/accordion.test.tsx +40 -0
- package/src/components/accordion/accordion.tsx +23 -6
- package/src/components/action-icon/action-icon.tsx +9 -24
- package/src/components/alert/alert.test.tsx +25 -2
- package/src/components/alert/alert.tsx +39 -13
- package/src/components/app-shell/app-shell.tsx +3 -1
- package/src/components/breadcrumb/breadcrumb.test.tsx +30 -0
- package/src/components/breadcrumb/breadcrumb.tsx +21 -12
- package/src/components/button/button.tsx +21 -50
- package/src/components/calendar/calendar-body.tsx +8 -1
- package/src/components/circular-progress/circular-progress.tsx +4 -1
- package/src/components/clipboard/clipboard.test.tsx +18 -0
- package/src/components/clipboard/clipboard.tsx +8 -2
- package/src/components/code-block/chrome.tsx +60 -36
- package/src/components/code-block/code-block.test.tsx +27 -0
- package/src/components/code-block/code-block.tsx +13 -3
- package/src/components/code-block/notation.test.ts +8 -0
- package/src/components/code-block/notation.ts +6 -3
- package/src/components/code-block/static.tsx +8 -2
- package/src/components/collapse/collapse.tsx +33 -15
- package/src/components/combobox/combobox.test.tsx +38 -0
- package/src/components/combobox/combobox.tsx +24 -10
- package/src/components/divider/divider.tsx +3 -1
- package/src/components/drawer/drawer.tsx +37 -16
- package/src/components/field/field.tsx +7 -3
- package/src/components/input/input.tsx +3 -1
- package/src/components/menu/menu-data.tsx +8 -1
- package/src/components/menu/menu.test.tsx +52 -0
- package/src/components/menu/menu.tsx +83 -35
- package/src/components/modal/close-trigger.test.tsx +38 -0
- package/src/components/modal/modal.tsx +29 -13
- package/src/components/notification/create-notifier.tsx +6 -5
- package/src/components/notification/notification.test.tsx +15 -0
- package/src/components/notification/notification.tsx +8 -5
- package/src/components/pill/pill.tsx +29 -20
- package/src/components/pills-input/pills-input.tsx +3 -1
- package/src/components/popover/popover.tsx +3 -1
- package/src/components/progress/progress.tsx +4 -1
- package/src/components/rating/rating.tsx +27 -23
- package/src/components/schedule/index.ts +1 -1
- package/src/components/schedule/now-cursor-line.tsx +1 -1
- package/src/components/schedule/schedule-agenda-list.tsx +6 -7
- package/src/components/schedule/schedule-agenda-view.test.tsx +105 -28
- package/src/components/schedule/schedule-agenda-view.tsx +46 -31
- package/src/components/schedule/schedule-all-day-row.tsx +1 -1
- package/src/components/schedule/schedule-create-draft.tsx +14 -5
- package/src/components/schedule/schedule-dates.test.ts +37 -52
- package/src/components/schedule/schedule-dates.ts +25 -27
- package/src/components/schedule/schedule-days-view.tsx +9 -5
- package/src/components/schedule/schedule-drag-ghost.tsx +27 -12
- package/src/components/schedule/schedule-event-chip.tsx +9 -2
- package/src/components/schedule/schedule-event-list-popover-content.tsx +1 -1
- package/src/components/schedule/schedule-geometry.ts +21 -0
- package/src/components/schedule/schedule-grid-gesture.test.ts +83 -1
- package/src/components/schedule/schedule-grid-gesture.ts +67 -28
- package/src/components/schedule/schedule-month-view.tsx +10 -6
- package/src/components/schedule/schedule-next-up.tsx +11 -5
- package/src/components/schedule/schedule-timed-grid.tsx +41 -3
- package/src/components/schedule/schedule-toolbar.test.tsx +26 -0
- package/src/components/schedule/schedule-toolbar.tsx +35 -17
- package/src/components/schedule/schedule-types.ts +9 -4
- package/src/components/schedule/schedule-views.ts +4 -5
- package/src/components/schedule/schedule-year-view.tsx +10 -6
- package/src/components/schedule/schedule.test.tsx +198 -36
- package/src/components/schedule/schedule.tsx +28 -17
- package/src/components/schedule/use-event-create.ts +7 -6
- package/src/components/schedule/use-event-drag.ts +10 -4
- package/src/components/schedule/use-event-resize.ts +4 -2
- package/src/components/slider/slider.tsx +4 -0
- package/src/components/tabs/tabs-data.tsx +17 -14
- package/src/components/timeline/timeline.tsx +102 -95
- package/src/components/tooltip/tooltip.tsx +2 -1
- package/src/lib/as-child.test.tsx +70 -0
- package/src/lib/as-child.ts +119 -0
- package/src/theme.css +9 -3
- package/dist/chunk-2762HZYX.js.map +0 -1
- package/dist/chunk-2H46IXW4.js.map +0 -1
- package/dist/chunk-6SWK4XG5.js.map +0 -1
- package/dist/chunk-ACE7FBWE.js.map +0 -1
- package/dist/chunk-HWNPXAEN.js +0 -31
- package/dist/chunk-HWNPXAEN.js.map +0 -1
- package/dist/chunk-IFWCCAQV.js.map +0 -1
- package/dist/chunk-IXKELBJA.js.map +0 -1
- package/dist/chunk-J3PELDH3.js.map +0 -1
- package/dist/chunk-NGAQITWP.js.map +0 -1
- package/dist/chunk-POKDSVQT.js.map +0 -1
- package/dist/chunk-QMW7D5GU.js.map +0 -1
- package/dist/chunk-TMMEJKLI.js.map +0 -1
- package/dist/chunk-TNNH3FVQ.js.map +0 -1
- package/dist/chunk-U5GW5EBR.js.map +0 -1
- package/dist/chunk-UNSAA7YG.js.map +0 -1
- package/dist/chunk-VLUKI3HL.js.map +0 -1
- package/dist/chunk-VZ2TPU4B.js.map +0 -1
- package/dist/chunk-YIQI2CF3.js.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Dialog as Ark } from "@ark-ui/react/dialog";
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
import { type ComponentPropsWithoutRef, type ReactNode } from "react";
|
|
4
|
+
import type { NoAsChild } from "../../lib/as-child";
|
|
4
5
|
import type { Size } from "../../lib/sizes";
|
|
5
6
|
import type { WithTestId } from "../../lib/test-id";
|
|
6
7
|
declare const modalPositioner: (props?: ({
|
|
@@ -18,10 +19,10 @@ declare const ModalRoot: ({ onPointerDownOutside, children, ...rest }: ModalRoot
|
|
|
18
19
|
export type ModalBackdropProps = ComponentPropsWithoutRef<typeof Ark.Backdrop> & WithTestId;
|
|
19
20
|
declare const ModalBackdrop: ({ className, testId, ...rest }: ModalBackdropProps) => import("react").JSX.Element;
|
|
20
21
|
export type ModalPosition = VariantProps<typeof modalPositioner>["position"];
|
|
21
|
-
export type ModalPositionerProps = ComponentPropsWithoutRef<typeof Ark.Positioner
|
|
22
|
+
export type ModalPositionerProps = NoAsChild<ComponentPropsWithoutRef<typeof Ark.Positioner>> & WithTestId & {
|
|
22
23
|
position?: ModalPosition;
|
|
23
24
|
};
|
|
24
|
-
declare const ModalPositioner: ({ className, position, testId, children, ...rest }: ModalPositionerProps) => import("react").JSX.Element;
|
|
25
|
+
declare const ModalPositioner: ({ className, position, testId, children, asChild: _asChild, ...rest }: ModalPositionerProps) => import("react").JSX.Element;
|
|
25
26
|
export type ModalContentProps = ComponentPropsWithoutRef<typeof Ark.Content> & VariantProps<typeof modalContent> & WithTestId;
|
|
26
27
|
declare const ModalContent: ({ className, size, radius, testId, ...rest }: ModalContentProps) => import("react").JSX.Element;
|
|
27
28
|
export type ModalTitleProps = ComponentPropsWithoutRef<typeof Ark.Title> & WithTestId;
|
|
@@ -31,7 +32,7 @@ declare const ModalDescription: ({ className, testId, ...rest }: ModalDescriptio
|
|
|
31
32
|
export type ModalCloseTriggerProps = ComponentPropsWithoutRef<typeof Ark.CloseTrigger> & WithTestId & {
|
|
32
33
|
"aria-label"?: string;
|
|
33
34
|
};
|
|
34
|
-
declare const ModalCloseTrigger: ({ children, className, "aria-label": ariaLabel, testId, ...rest }: ModalCloseTriggerProps) => import("react").JSX.Element;
|
|
35
|
+
declare const ModalCloseTrigger: ({ children, className, "aria-label": ariaLabel, testId, asChild, ...rest }: ModalCloseTriggerProps) => import("react").JSX.Element;
|
|
35
36
|
export type ModalHeaderProps = ComponentPropsWithoutRef<"div"> & WithTestId;
|
|
36
37
|
declare const ModalHeader: ({ className, testId, ...rest }: ModalHeaderProps) => import("react").JSX.Element;
|
|
37
38
|
export type ModalBodyProps = ComponentPropsWithoutRef<"div"> & WithTestId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../../src/components/modal/modal.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,IAAI,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAEpD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,SAAS,EAA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B,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,eAAe,CAAA;CAC7B,CAAA;AAEH,QAAA,MAAM,cAAc,+PAuBjB,UAAU,gCAsEZ,CAAA;AAED,eAAO,MAAM,KAAK;;;;;;;;;;;;;CAahB,CAAA"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { MultiComboboxList } from '../../chunk-
|
|
2
|
+
export { MultiComboboxList } from '../../chunk-HT5JAHR3.js';
|
|
3
3
|
import '../../chunk-TWGCWKRV.js';
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import '../../chunk-
|
|
6
|
-
import '../../chunk-
|
|
7
|
-
import '../../chunk-
|
|
4
|
+
import '../../chunk-6OLTJYSX.js';
|
|
5
|
+
import '../../chunk-5OQLFX47.js';
|
|
6
|
+
import '../../chunk-FHG54IT5.js';
|
|
7
|
+
import '../../chunk-6GDMSENK.js';
|
|
8
8
|
import '../../chunk-AIQG7IIT.js';
|
|
9
9
|
import '../../chunk-7P32XCEU.js';
|
|
10
10
|
import '../../chunk-BUIHQJGE.js';
|
|
11
11
|
import '../../chunk-BEL75C7N.js';
|
|
12
12
|
import '../../chunk-IG7FBZVM.js';
|
|
13
|
+
import '../../chunk-I4SQQIP5.js';
|
|
13
14
|
import '../../chunk-WYCMIIRR.js';
|
|
14
15
|
import '../../chunk-QP4I37PA.js';
|
|
15
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { usePillOverflow, PillOverflowCounter, pillsContent, pillsShell } from '../../chunk-
|
|
3
|
-
import { Pill } from '../../chunk-
|
|
2
|
+
import { usePillOverflow, PillOverflowCounter, pillsContent, pillsShell } from '../../chunk-AE7QTLJ5.js';
|
|
3
|
+
import { Pill } from '../../chunk-Z2Z5EXVT.js';
|
|
4
4
|
import { controlOpenProps } from '../../chunk-5FDOOG4J.js';
|
|
5
5
|
import { normalizeSelectData, filterSelectData } from '../../chunk-TWGCWKRV.js';
|
|
6
|
-
import { Combobox } from '../../chunk-
|
|
7
|
-
import { inputSlot, inputControlClasses, placeholderColor, inputShell } from '../../chunk-
|
|
8
|
-
import { FieldShell } from '../../chunk-
|
|
9
|
-
import '../../chunk-
|
|
6
|
+
import { Combobox } from '../../chunk-6OLTJYSX.js';
|
|
7
|
+
import { inputSlot, inputControlClasses, placeholderColor, inputShell } from '../../chunk-5OQLFX47.js';
|
|
8
|
+
import { FieldShell } from '../../chunk-FHG54IT5.js';
|
|
9
|
+
import '../../chunk-6GDMSENK.js';
|
|
10
10
|
import '../../chunk-AIQG7IIT.js';
|
|
11
11
|
import '../../chunk-7P32XCEU.js';
|
|
12
12
|
import '../../chunk-BUIHQJGE.js';
|
|
13
13
|
import { useUncontrolled } from '../../chunk-BEL75C7N.js';
|
|
14
14
|
import '../../chunk-IG7FBZVM.js';
|
|
15
|
+
import '../../chunk-I4SQQIP5.js';
|
|
15
16
|
import { props } from '../../chunk-WYCMIIRR.js';
|
|
16
17
|
import '../../chunk-B2LCHXUB.js';
|
|
17
18
|
import { cn } from '../../chunk-QP4I37PA.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/multi-select/multi-select.tsx"],"names":["ArkCombobox"],"mappings":";;;;;;;;;;;;;;;;;;;;AAuHO,IAAM,cAAc,CAAgC;AAAA,EACzD,IAAA;AAAA,EACA,KAAA,EAAO,SAAA;AAAA,EACP,YAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,UAAA,GAAa,IAAA;AAAA,EACb,iBAAA;AAAA,EACA,SAAA;AAAA,EACA,gBAAA,GAAmB,SAAA;AAAA,EACnB,SAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAA;AAAA,EACA,iBAAA;AAAA,EACA,KAAA,GAAQ,eAAA;AAAA,E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6BAEC,QAAA,CAAS,OAAA,EAAT,EAAiB,SAAA,EAAW,YAAY,OAAA,EACtC,QAAA,EAAA;AAAA,UAAA,MAAA,GACG,MAAA,CAAO,IAAI,CAAC,KAAA,yBACT,QAAA,CAAS,KAAA,EAAT,EAAiC,KAAA,EAAO,KAAA,CAAM,KAAA,EAC5C,gBAAM,KAAA,CAAM,GAAA,CAAI,YAAY,CAAA,EAAA,EADV,KAAA,CAAM,KAE3B,CACD,CAAA,GACD,KAAA,CAAM,GAAA,CAAI,YAAY,CAAA;AAAA,UACzB,SAAS,IAAA,oBAAQ,GAAA,CAAC,QAAA,CAAS,KAAA,EAAT,EAAgB,QAAA,EAAA,KAAA,EAAM;AAAA,SAAA,EAC3C;AAAA;AAAA;AAAA,GACF;AAGF,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,WAAA;AAAA,MACA,KAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,IAAA;AAAA,MACA,WAAW,UAAA,EAAY,KAAA;AAAA,MAEtB,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"index.js","sourcesContent":["\"use client\"\n\nimport { Combobox as ArkCombobox } from \"@ark-ui/react/combobox\"\nimport { type FocusEvent, type ReactNode, type Ref, useMemo, useState } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { controlOpenProps } from \"../../lib/control-open\"\nimport { props } from \"../../lib/props\"\nimport {\n type ClearSectionMode,\n filterSelectData,\n type NormalizedItem,\n normalizeSelectData,\n type RenderableItem,\n type RenderItem,\n type SelectData,\n type SelectValue,\n} from \"../../lib/select-data\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Combobox } from \"../combobox/combobox\"\nimport { type FieldProps, FieldShell } from \"../field/field\"\nimport {\n type InputSize,\n type InputVariant,\n inputControlClasses,\n inputShell,\n inputSlot,\n placeholderColor,\n} from \"../input/input\"\nimport { Pill } from \"../pill/pill\"\nimport {\n PillOverflowCounter,\n pillsContent,\n pillsShell,\n usePillOverflow,\n} from \"../pills-input/pills-input\"\n\n/**\n * MultiSelect — pick several values, shown as removable pills in a wrapping\n * input, searchable by default. It's the whole family working together:\n * Combobox (`multiple`) drives selection, the control is the PillsInput shell,\n * and each value renders as a `Pill`.\n *\n * - `data` matches `Select` (strings / objects / groups); `value` is `string[]`.\n * - Type to filter; pick to add (a check marks selected options); remove via a\n * pill's ×, Backspace on the empty field, or the clear button.\n * - `maxValues` caps selections; `hidePickedOptions` drops chosen options from\n * the list; `searchable={false}` turns it into a click-to-open multi-picker.\n * - Label / description / error come from the built-in `Field`.\n */\n\ntype MultiSelectClassNames = {\n root?: string\n field?: string\n control?: string\n input?: string\n option?: string\n popover?: string\n pill?: string\n}\n\nexport type MultiSelectProps<Data extends SelectData> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n WithTestId & {\n /** Options: `string[]`, `{ value, label?, disabled?, color? }[]`, or `{ group, items }[]`. */\n data: Data\n /** Controlled selected values. */\n value?: SelectValue<Data>[]\n /** Uncontrolled initial selection. */\n defaultValue?: SelectValue<Data>[]\n /** Fires with the full selection on every add / remove. */\n onChange?: (value: SelectValue<Data>[]) => void\n /**\n * Render each option yourself. Receives the (value-narrowed) item and its live\n * `{ selected, highlighted }` state; you own the whole row, including any check\n * affordance. Omit it to render the label + selected check.\n */\n renderItem?: RenderItem<Data>\n /** Placeholder shown while nothing is selected. */\n placeholder?: string\n /** Type to filter the options. Default `true`. */\n searchable?: boolean\n /** Placeholder for the search field once a value is already picked — before that, the\n * field shows `placeholder` instead. No default; omit it to show nothing, as today. */\n searchPlaceholder?: string\n /** Show a button that clears all values. */\n clearable?: boolean\n /** Whether the clear button replaces the chevron (`\"replace\"`, default) or sits beside it (`\"both\"`). */\n clearSectionMode?: ClearSectionMode\n /** Cap the number of selected values. */\n maxValues?: number\n /** Cap the pills at N rows; the rest collapse into a static \"+N\" counter. */\n maxLines?: number\n /** Inline-start adornment (icon, label). */\n startSlot?: ReactNode\n /** Inline-end adornment — rendered before the clear button / chevron. */\n endSlot?: ReactNode\n /** Hide options that are already selected. */\n hidePickedOptions?: boolean\n /** Message shown when no option matches. Pass `null` to render nothing. */\n empty?: ReactNode\n size?: InputSize\n variant?: InputVariant\n disabled?: boolean\n readOnly?: boolean\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Wires hidden inputs into native form submission. */\n name?: string\n /** Forwarded to the search input; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n /** Lands on the focusable search `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n className?: string\n classNames?: MultiSelectClassNames\n }\n\nexport const MultiSelect = <const Data extends SelectData>({\n data,\n value: valueProp,\n defaultValue,\n onChange,\n renderItem,\n placeholder,\n searchable = true,\n searchPlaceholder,\n clearable,\n clearSectionMode = \"replace\",\n maxValues,\n maxLines,\n startSlot,\n endSlot,\n hidePickedOptions,\n empty = \"Nothing found\",\n size = \"md\",\n variant = \"default\",\n disabled,\n readOnly,\n required,\n invalid,\n name,\n onBlur,\n ref,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n}: MultiSelectProps<Data>) => {\n type Item = SelectValue<Data>\n\n // Red state is driven independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n\n const [value, setSelected] = useUncontrolled<Item[]>({\n value: valueProp,\n defaultValue: defaultValue ?? [],\n onChange,\n })\n const [search, setSearch] = useState(\"\")\n\n const setValues = (next: Item[]) => {\n // Adding past the cap is rejected; removals always pass.\n if (maxValues != null && next.length > value.length && next.length > maxValues) {\n return\n }\n setSelected(next)\n }\n const removeValue = (v: Item) => setValues(value.filter((x) => x !== v))\n\n const { containerRef, visibleCount, hiddenCount, measuring } = usePillOverflow({\n maxLines,\n count: value.length,\n })\n\n // Normalize once per `data`; the item map and the filter both derive from it.\n const normalized = useMemo(() => normalizeSelectData(data), [data])\n // value -> full item, so a selected pill can pull both its label and its\n // color from one lookup instead of two parallel maps.\n const itemMap = useMemo(() => new Map(normalized.items.map((i) => [i.value, i])), [normalized])\n const { collection, items, groups } = useMemo(() => {\n const q = searchable ? search.trim().toLowerCase() : \"\"\n const picked = new Set<string>(value)\n return filterSelectData(\n normalized,\n (item) =>\n (!hidePickedOptions || !picked.has(item.value)) &&\n (q === \"\" || item.label.toLowerCase().includes(q)),\n )\n }, [normalized, search, searchable, hidePickedOptions, value])\n\n const renderOption = (item: NormalizedItem) => (\n <Combobox.Item\n key={item.value}\n item={item}\n data-testid={item.testId}\n className={classNames?.option}\n >\n {renderItem\n ? (state) => renderItem(item as unknown as RenderableItem<Data>, state)\n : item.label}\n </Combobox.Item>\n )\n\n const control = (\n <Combobox.Root<NormalizedItem>\n multiple\n collection={collection}\n value={value}\n // Ark types the values as `string[]`; they always originate from `data`,\n // so narrow back to the caller's value union.\n onValueChange={(details) => setValues(details.value as Item[])}\n inputValue={search}\n onInputValueChange={(details) => {\n if (searchable) setSearch(details.inputValue)\n }}\n selectionBehavior=\"clear\"\n closeOnSelect={false}\n openOnClick\n disabled={disabled}\n readOnly={readOnly}\n size={size}\n variant={variant}\n className={cn(className, classNames?.root)}\n >\n <ArkCombobox.Context>\n {(api) => {\n const showClear = Boolean(clearable) && api.hasSelectedItems && !disabled && !readOnly\n return (\n <ArkCombobox.Control\n {...props({\n \"data-invalid\": isInvalid,\n \"data-with-start-slot\": startSlot != null,\n // The composed Trigger always sits at the end. for now.\n \"data-with-end-slot\": true,\n })}\n // Tablet affordance: a tap on the field's dead zones (padding, empty\n // space, pill gaps) opens the list and focuses the search input. The\n // input, pill ✕, clear ✕ and chevron all manage their own taps.\n // Inert when disabled / readOnly, so it never opens where the input won't.\n {...(disabled || readOnly ? {} : controlOpenProps(() => api.setOpen(true)))}\n className={cn(inputShell({ size, variant }), pillsShell, classNames?.control)}\n >\n {startSlot != null && (\n <span className={inputSlot} aria-hidden>\n {startSlot}\n </span>\n )}\n <div ref={containerRef} className={pillsContent({ size })}>\n {value.slice(0, visibleCount).map((v) => (\n <Pill\n key={v}\n size={size}\n color={itemMap.get(v)?.color}\n disabled={disabled}\n withRemoveButton={!readOnly}\n onRemove={() => removeValue(v)}\n className={classNames?.pill}\n data-overflow-item\n >\n {itemMap.get(v)?.label ?? v}\n </Pill>\n ))}\n {/* Mounted during the measuring pass so the hook can size the last-row\n reservation off the real counter, but kept `invisible` then (still\n measurable) so it never paints on the SSR HTML before the first\n measure. Only mounts while measuring when a cap is configured. */}\n {(hiddenCount > 0 || (measuring && maxLines != null)) && (\n <PillOverflowCounter\n count={measuring ? value.length : hiddenCount}\n size={size}\n className={measuring ? \"invisible\" : undefined}\n />\n )}\n {/* Ark's own Input (a forwardRef) so the caller's `ref` lands on\n the real focusable `<input>` for RHF focus-on-error; the kit's\n `Combobox.Input` wrapper only adds `inputControlClasses`,\n replicated here. `name` is intentionally NOT here — it would\n submit the typed search text, not the selection (see the hidden\n inputs below). */}\n {searchable ? (\n <ArkCombobox.Input\n data-overflow-field\n placeholder={value.length === 0 ? placeholder : searchPlaceholder}\n readOnly={!searchable || readOnly}\n onBlur={onBlur}\n ref={ref}\n aria-invalid={isInvalid || undefined}\n {...props({ \"data-testid\": testId })}\n className={cn(inputControlClasses, \"w-auto min-w-16\", classNames?.input)}\n onKeyDown={(event) => {\n const last = value[value.length - 1]\n if (\n event.key === \"Backspace\" &&\n event.currentTarget.value === \"\" &&\n last !== undefined &&\n !readOnly\n ) {\n removeValue(last)\n }\n }}\n />\n ) : (\n value.length <= 0 && (\n <span className={cn(placeholderColor, \"truncate\")}>{placeholder}</span>\n )\n )}\n </div>\n {endSlot != null && <span className={inputSlot}>{endSlot}</span>}\n {showClear && <Combobox.ClearTrigger />}\n {(clearSectionMode === \"both\" || !showClear) && (\n <Combobox.Trigger aria-label=\"Show options\" data-chevron />\n )}\n {/* Hidden inputs carry the real selection so a native `<form>`\n submits the value array (the search input is unnamed). When\n controlled by a form library the value flows through `onChange`\n instead, and these are just submitted alongside it. */}\n {name != null &&\n value.map((v) => <input key={v} type=\"hidden\" name={name} value={v} />)}\n </ArkCombobox.Control>\n )\n }}\n </ArkCombobox.Context>\n\n <Combobox.Content className={classNames?.popover}>\n {groups\n ? groups.map((group) => (\n <Combobox.Group key={group.group} label={group.group}>\n {group.items.map(renderOption)}\n </Combobox.Group>\n ))\n : items.map(renderOption)}\n {empty != null && <Combobox.Empty>{empty}</Combobox.Empty>}\n </Combobox.Content>\n </Combobox.Root>\n )\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n >\n {control}\n </FieldShell>\n )\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/multi-select/multi-select.tsx"],"names":["ArkCombobox"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuHO,IAAM,cAAc,CAAgC;AAAA,EACzD,IAAA;AAAA,EACA,KAAA,EAAO,SAAA;AAAA,EACP,YAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,UAAA,GAAa,IAAA;AAAA,EACb,iBAAA;AAAA,EACA,SAAA;AAAA,EACA,gBAAA,GAAmB,SAAA;AAAA,EACnB,SAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAA;AAAA,EACA,iBAAA;AAAA,EACA,KAAA,GAAQ,eAAA;AAAA,EACR,IAAA,GAAO,IAAA;AAAA,EACP,OAAA,GAAU,SAAA;AAAA,EACV,QAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,GAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAA,KAA8B;AAK5B,EAAA,MAA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AAA,CAAM,GAAA,CAAI,YAAY,CAAA;AAAA,UACzB,SAAS,IAAA,oBAAQ,GAAA,CAAC,QAAA,CAAS,KAAA,EAAT,EAAgB,QAAA,EAAA,KAAA,EAAM;AAAA,SAAA,EAC3C;AAAA;AAAA;AAAA,GACF;AAGF,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,WAAA;AAAA,MACA,KAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,IAAA;AAAA,MACA,WAAW,UAAA,EAAY,KAAA;AAAA,MAEtB,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"index.js","sourcesContent":["\"use client\"\n\nimport { Combobox as ArkCombobox } from \"@ark-ui/react/combobox\"\nimport { type FocusEvent, type ReactNode, type Ref, useMemo, useState } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { controlOpenProps } from \"../../lib/control-open\"\nimport { props } from \"../../lib/props\"\nimport {\n type ClearSectionMode,\n filterSelectData,\n type NormalizedItem,\n normalizeSelectData,\n type RenderableItem,\n type RenderItem,\n type SelectData,\n type SelectValue,\n} from \"../../lib/select-data\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Combobox } from \"../combobox/combobox\"\nimport { type FieldProps, FieldShell } from \"../field/field\"\nimport {\n type InputSize,\n type InputVariant,\n inputControlClasses,\n inputShell,\n inputSlot,\n placeholderColor,\n} from \"../input/input\"\nimport { Pill } from \"../pill/pill\"\nimport {\n PillOverflowCounter,\n pillsContent,\n pillsShell,\n usePillOverflow,\n} from \"../pills-input/pills-input\"\n\n/**\n * MultiSelect — pick several values, shown as removable pills in a wrapping\n * input, searchable by default. It's the whole family working together:\n * Combobox (`multiple`) drives selection, the control is the PillsInput shell,\n * and each value renders as a `Pill`.\n *\n * - `data` matches `Select` (strings / objects / groups); `value` is `string[]`.\n * - Type to filter; pick to add (a check marks selected options); remove via a\n * pill's ×, Backspace on the empty field, or the clear button.\n * - `maxValues` caps selections; `hidePickedOptions` drops chosen options from\n * the list; `searchable={false}` turns it into a click-to-open multi-picker.\n * - Label / description / error come from the built-in `Field`.\n */\n\ntype MultiSelectClassNames = {\n root?: string\n field?: string\n control?: string\n input?: string\n option?: string\n popover?: string\n pill?: string\n}\n\nexport type MultiSelectProps<Data extends SelectData> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n WithTestId & {\n /** Options: `string[]`, `{ value, label?, disabled?, color? }[]`, or `{ group, items }[]`. */\n data: Data\n /** Controlled selected values. */\n value?: SelectValue<Data>[]\n /** Uncontrolled initial selection. */\n defaultValue?: SelectValue<Data>[]\n /** Fires with the full selection on every add / remove. */\n onChange?: (value: SelectValue<Data>[]) => void\n /**\n * Render each option yourself. Receives the (value-narrowed) item and its live\n * `{ selected, highlighted }` state; you own the whole row, including any check\n * affordance. Omit it to render the label + selected check.\n */\n renderItem?: RenderItem<Data>\n /** Placeholder shown while nothing is selected. */\n placeholder?: string\n /** Type to filter the options. Default `true`. */\n searchable?: boolean\n /** Placeholder for the search field once a value is already picked — before that, the\n * field shows `placeholder` instead. No default; omit it to show nothing, as today. */\n searchPlaceholder?: string\n /** Show a button that clears all values. */\n clearable?: boolean\n /** Whether the clear button replaces the chevron (`\"replace\"`, default) or sits beside it (`\"both\"`). */\n clearSectionMode?: ClearSectionMode\n /** Cap the number of selected values. */\n maxValues?: number\n /** Cap the pills at N rows; the rest collapse into a static \"+N\" counter. */\n maxLines?: number\n /** Inline-start adornment (icon, label). */\n startSlot?: ReactNode\n /** Inline-end adornment — rendered before the clear button / chevron. */\n endSlot?: ReactNode\n /** Hide options that are already selected. */\n hidePickedOptions?: boolean\n /** Message shown when no option matches. Pass `null` to render nothing. */\n empty?: ReactNode\n size?: InputSize\n variant?: InputVariant\n disabled?: boolean\n readOnly?: boolean\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Wires hidden inputs into native form submission. */\n name?: string\n /** Forwarded to the search input; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n /** Lands on the focusable search `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n className?: string\n classNames?: MultiSelectClassNames\n }\n\nexport const MultiSelect = <const Data extends SelectData>({\n data,\n value: valueProp,\n defaultValue,\n onChange,\n renderItem,\n placeholder,\n searchable = true,\n searchPlaceholder,\n clearable,\n clearSectionMode = \"replace\",\n maxValues,\n maxLines,\n startSlot,\n endSlot,\n hidePickedOptions,\n empty = \"Nothing found\",\n size = \"md\",\n variant = \"default\",\n disabled,\n readOnly,\n required,\n invalid,\n name,\n onBlur,\n ref,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n}: MultiSelectProps<Data>) => {\n type Item = SelectValue<Data>\n\n // Red state is driven independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n\n const [value, setSelected] = useUncontrolled<Item[]>({\n value: valueProp,\n defaultValue: defaultValue ?? [],\n onChange,\n })\n const [search, setSearch] = useState(\"\")\n\n const setValues = (next: Item[]) => {\n // Adding past the cap is rejected; removals always pass.\n if (maxValues != null && next.length > value.length && next.length > maxValues) {\n return\n }\n setSelected(next)\n }\n const removeValue = (v: Item) => setValues(value.filter((x) => x !== v))\n\n const { containerRef, visibleCount, hiddenCount, measuring } = usePillOverflow({\n maxLines,\n count: value.length,\n })\n\n // Normalize once per `data`; the item map and the filter both derive from it.\n const normalized = useMemo(() => normalizeSelectData(data), [data])\n // value -> full item, so a selected pill can pull both its label and its\n // color from one lookup instead of two parallel maps.\n const itemMap = useMemo(() => new Map(normalized.items.map((i) => [i.value, i])), [normalized])\n const { collection, items, groups } = useMemo(() => {\n const q = searchable ? search.trim().toLowerCase() : \"\"\n const picked = new Set<string>(value)\n return filterSelectData(\n normalized,\n (item) =>\n (!hidePickedOptions || !picked.has(item.value)) &&\n (q === \"\" || item.label.toLowerCase().includes(q)),\n )\n }, [normalized, search, searchable, hidePickedOptions, value])\n\n const renderOption = (item: NormalizedItem) => (\n <Combobox.Item\n key={item.value}\n item={item}\n data-testid={item.testId}\n className={classNames?.option}\n >\n {renderItem\n ? (state) => renderItem(item as unknown as RenderableItem<Data>, state)\n : item.label}\n </Combobox.Item>\n )\n\n const control = (\n <Combobox.Root<NormalizedItem>\n multiple\n collection={collection}\n value={value}\n // Ark types the values as `string[]`; they always originate from `data`,\n // so narrow back to the caller's value union.\n onValueChange={(details) => setValues(details.value as Item[])}\n inputValue={search}\n onInputValueChange={(details) => {\n if (searchable) setSearch(details.inputValue)\n }}\n selectionBehavior=\"clear\"\n closeOnSelect={false}\n openOnClick\n disabled={disabled}\n readOnly={readOnly}\n size={size}\n variant={variant}\n className={cn(className, classNames?.root)}\n >\n <ArkCombobox.Context>\n {(api) => {\n const showClear = Boolean(clearable) && api.hasSelectedItems && !disabled && !readOnly\n return (\n <ArkCombobox.Control\n {...props({\n \"data-invalid\": isInvalid,\n \"data-with-start-slot\": startSlot != null,\n // The composed Trigger always sits at the end. for now.\n \"data-with-end-slot\": true,\n })}\n // Tablet affordance: a tap on the field's dead zones (padding, empty\n // space, pill gaps) opens the list and focuses the search input. The\n // input, pill ✕, clear ✕ and chevron all manage their own taps.\n // Inert when disabled / readOnly, so it never opens where the input won't.\n {...(disabled || readOnly ? {} : controlOpenProps(() => api.setOpen(true)))}\n className={cn(inputShell({ size, variant }), pillsShell, classNames?.control)}\n >\n {startSlot != null && (\n <span className={inputSlot} aria-hidden>\n {startSlot}\n </span>\n )}\n <div ref={containerRef} className={pillsContent({ size })}>\n {value.slice(0, visibleCount).map((v) => (\n <Pill\n key={v}\n size={size}\n color={itemMap.get(v)?.color}\n disabled={disabled}\n withRemoveButton={!readOnly}\n onRemove={() => removeValue(v)}\n className={classNames?.pill}\n data-overflow-item\n >\n {itemMap.get(v)?.label ?? v}\n </Pill>\n ))}\n {/* Mounted during the measuring pass so the hook can size the last-row\n reservation off the real counter, but kept `invisible` then (still\n measurable) so it never paints on the SSR HTML before the first\n measure. Only mounts while measuring when a cap is configured. */}\n {(hiddenCount > 0 || (measuring && maxLines != null)) && (\n <PillOverflowCounter\n count={measuring ? value.length : hiddenCount}\n size={size}\n className={measuring ? \"invisible\" : undefined}\n />\n )}\n {/* Ark's own Input (a forwardRef) so the caller's `ref` lands on\n the real focusable `<input>` for RHF focus-on-error; the kit's\n `Combobox.Input` wrapper only adds `inputControlClasses`,\n replicated here. `name` is intentionally NOT here — it would\n submit the typed search text, not the selection (see the hidden\n inputs below). */}\n {searchable ? (\n <ArkCombobox.Input\n data-overflow-field\n placeholder={value.length === 0 ? placeholder : searchPlaceholder}\n readOnly={!searchable || readOnly}\n onBlur={onBlur}\n ref={ref}\n aria-invalid={isInvalid || undefined}\n {...props({ \"data-testid\": testId })}\n className={cn(inputControlClasses, \"w-auto min-w-16\", classNames?.input)}\n onKeyDown={(event) => {\n const last = value[value.length - 1]\n if (\n event.key === \"Backspace\" &&\n event.currentTarget.value === \"\" &&\n last !== undefined &&\n !readOnly\n ) {\n removeValue(last)\n }\n }}\n />\n ) : (\n value.length <= 0 && (\n <span className={cn(placeholderColor, \"truncate\")}>{placeholder}</span>\n )\n )}\n </div>\n {endSlot != null && <span className={inputSlot}>{endSlot}</span>}\n {showClear && <Combobox.ClearTrigger />}\n {(clearSectionMode === \"both\" || !showClear) && (\n <Combobox.Trigger aria-label=\"Show options\" data-chevron />\n )}\n {/* Hidden inputs carry the real selection so a native `<form>`\n submits the value array (the search input is unnamed). When\n controlled by a form library the value flows through `onChange`\n instead, and these are just submitted alongside it. */}\n {name != null &&\n value.map((v) => <input key={v} type=\"hidden\" name={name} value={v} />)}\n </ArkCombobox.Control>\n )\n }}\n </ArkCombobox.Context>\n\n <Combobox.Content className={classNames?.popover}>\n {groups\n ? groups.map((group) => (\n <Combobox.Group key={group.group} label={group.group}>\n {group.items.map(renderOption)}\n </Combobox.Group>\n ))\n : items.map(renderOption)}\n {empty != null && <Combobox.Empty>{empty}</Combobox.Empty>}\n </Combobox.Content>\n </Combobox.Root>\n )\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n >\n {control}\n </FieldShell>\n )\n}\n"]}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export { NavLink, Navigation } from '../../chunk-
|
|
2
|
+
export { NavLink, Navigation } from '../../chunk-5JHDSVEZ.js';
|
|
3
3
|
import '../../chunk-GTKKRV5N.js';
|
|
4
4
|
import '../../chunk-BEL75C7N.js';
|
|
5
5
|
import '../../chunk-IG7FBZVM.js';
|
|
6
|
-
import '../../chunk-
|
|
6
|
+
import '../../chunk-WSIVRDRB.js';
|
|
7
|
+
import '../../chunk-I4SQQIP5.js';
|
|
7
8
|
import '../../chunk-WYCMIIRR.js';
|
|
8
9
|
import '../../chunk-B2LCHXUB.js';
|
|
9
10
|
import '../../chunk-QP4I37PA.js';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { NavLink, Navigation } from '../../chunk-
|
|
2
|
+
import { NavLink, Navigation } from '../../chunk-5JHDSVEZ.js';
|
|
3
3
|
import '../../chunk-GTKKRV5N.js';
|
|
4
4
|
import '../../chunk-BEL75C7N.js';
|
|
5
5
|
import '../../chunk-IG7FBZVM.js';
|
|
6
|
-
import '../../chunk-
|
|
6
|
+
import '../../chunk-WSIVRDRB.js';
|
|
7
|
+
import '../../chunk-I4SQQIP5.js';
|
|
7
8
|
import '../../chunk-WYCMIIRR.js';
|
|
8
9
|
import '../../chunk-B2LCHXUB.js';
|
|
9
10
|
import '../../chunk-QP4I37PA.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/nav-link/tanstack.tsx"],"names":["NavLink","Navigation"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/nav-link/tanstack.tsx"],"names":["NavLink","Navigation"],"mappings":";;;;;;;;;;;AA0CO,SAASA,SAAQ,KAAA,EAAgC;AACtD,EAAA,uBAAO,GAAA,CAAC,OAAA,EAAA,EAAa,GAAG,KAAA,EAAO,CAAA;AACjC;AAoBO,SAASC,YAAW,KAAA,EAAmC;AAC5D,EAAA,uBAAO,GAAA,CAAC,UAAA,EAAA,EAAgB,GAAG,KAAA,EAAO,CAAA;AACpC","file":"tanstack.js","sourcesContent":["\"use client\"\n\nimport type { RegisteredRouter, ValidateLinkOptions } from \"@tanstack/react-router\"\nimport type { ReactNode } from \"react\"\nimport { NavLink as CoreNavLink, type NavLinkProps } from \"./nav-link\"\nimport {\n Navigation as CoreNavigation,\n type NavigationItem,\n type NavigationProps,\n} from \"./navigation\"\n\n/**\n * TanStack Router–typed `NavLink`/`Navigation` — opt-in only, never imported\n * by `nav-link.tsx`/`navigation.tsx` themselves, so the core components stay\n * dependency-free for everyone else. Import from here instead of `./nav-link`\n * / `./navigation` when the app is on TanStack Router, to get every\n * `linkOptions` validated/autocompleted against the app's real route tree.\n *\n * Built on TanStack Router's own documented pattern for exactly this case\n * (`RegisteredRouter` + `ValidateLinkOptions`, see its \"Type Utilities for\n * Generic Components\" guide) — a generic public overload preserves full\n * per-call-site inference for callers, while the implementation delegates to\n * the untyped core component.\n *\n * import { NavLink } from \"@42/ui-react/nav-link/tanstack\"\n * import { Link } from \"@tanstack/react-router\"\n *\n * <NavLink label=\"Post\" linkComponent={Link}\n * linkOptions={{ to: \"/posts/$postId\", params: { postId: \"1\" } }} />\n */\n\ntype TanStackNavLinkProps<\n TRouter extends RegisteredRouter = RegisteredRouter,\n TOptions = unknown,\n> = Omit<NavLinkProps, \"linkOptions\" | \"children\"> & {\n linkOptions?: ValidateLinkOptions<TRouter, TOptions>\n children?: ReactNode\n}\n\nexport function NavLink<TRouter extends RegisteredRouter = RegisteredRouter, TOptions = unknown>(\n props: TanStackNavLinkProps<TRouter, TOptions>,\n): ReactNode\nexport function NavLink(props: NavLinkProps): ReactNode {\n return <CoreNavLink {...props} />\n}\n\ntype TanStackNavigationItem<\n TRouter extends RegisteredRouter = RegisteredRouter,\n TOptions = unknown,\n> = Omit<NavigationItem, \"linkOptions\" | \"items\"> & {\n linkOptions?: ValidateLinkOptions<TRouter, TOptions>\n items?: readonly TanStackNavigationItem<TRouter, TOptions>[]\n}\n\ntype TanStackNavigationProps<\n TRouter extends RegisteredRouter = RegisteredRouter,\n TOptions = unknown,\n> = Omit<NavigationProps, \"data\"> & {\n data: readonly TanStackNavigationItem<TRouter, TOptions>[]\n}\n\nexport function Navigation<TRouter extends RegisteredRouter = RegisteredRouter, TOptions = unknown>(\n props: TanStackNavigationProps<TRouter, TOptions>,\n): ReactNode\nexport function Navigation(props: NavigationProps): ReactNode {\n return <CoreNavigation {...props} />\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-notifier.d.ts","sourceRoot":"","sources":["../../../src/components/notification/create-notifier.tsx"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAE9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAI7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAY,OAAO,EAAa,MAAM,SAAS,CAAA;AAE3F;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,MAAM,eAAe,GACvB,WAAW,GACX,KAAK,GACL,SAAS,GACT,cAAc,GACd,QAAQ,GACR,YAAY,CAAA;AAEhB;oCACoC;AACpC,KAAK,YAAY,GAAG;IAClB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB;0BACsB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;iDAC6C;IAC7C,EAAE,CAAC,EAAE,OAAO,CAAA;IACZ,2CAA2C;IAC3C,eAA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,SAAS,CAAA;CAC/B,CAAA;
|
|
1
|
+
{"version":3,"file":"create-notifier.d.ts","sourceRoot":"","sources":["../../../src/components/notification/create-notifier.tsx"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAE9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAI7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAY,OAAO,EAAa,MAAM,SAAS,CAAA;AAE3F;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,MAAM,eAAe,GACvB,WAAW,GACX,KAAK,GACL,SAAS,GACT,cAAc,GACd,QAAQ,GACR,YAAY,CAAA;AAEhB;oCACoC;AACpC,KAAK,YAAY,GAAG;IAClB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB;0BACsB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;iDAC6C;IAC7C,EAAE,CAAC,EAAE,OAAO,CAAA;IACZ,2CAA2C;IAC3C,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;qDACiD;IACjD,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,kEAAkE;IAClE,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;CACxB,CAAA;AAED;+CAC+C;AAC/C,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG;IACzC,yCAAyC;IACzC,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAED;uDACuD;AACvD,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAC5C,gBAAgB,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,EAAE,mBAAmB,CAAC,CAAA;AAErE;sEACsE;AACtE,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAC5C,gBAAgB,CACd,IAAI,CAAC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O,EAAE,KAAK,EAAE,iBAAiB,KAAK,OAAO,CAAA;AAE7E;wDACwD;AACxD,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,WAAW,KAAK,OAAO,CAAC,GAAG;IACvD,OAAO,EAAE,QAAQ,CAAA;IACjB,KAAK,EAAE,QAAQ,CAAA;IACf,OAAO,EAAE,QAAQ,CAAA;IACjB,IAAI,EAAE,QAAQ,CAAA;IACd,OAAO,EAAE,QAAQ,CAAA;IACjB,OAAO,EAAE,aAAa,CAAA;IACtB,MAAM,EAAE,YAAY,CAAA;IACpB,6DAA6D;IAC7D,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;IAC/B,sDAAsD;IACtD,MAAM,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,CAAA;IAC7B,uEAAuE;IACvE,GAAG,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,OAAO,CAAA;IAC7B,wDAAwD;IACxD,SAAS,EAAE,MAAM,SAAS,EAAE,CAAA;CAC7B,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,MAAM,SAAS,CAAA;CAC/B,CAAA;AAiKD,wBAAgB,cAAc,CAAC,OAAO,GAAE,qBAA0B,GAAG,QAAQ,CAyM5E"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { mergeRefs } from '../../chunk-UVYTJQTJ.js';
|
|
3
|
-
import { Notification } from '../../chunk-
|
|
4
|
-
export { Notification, notificationRoot } from '../../chunk-
|
|
3
|
+
import { Notification } from '../../chunk-EBREIC3L.js';
|
|
4
|
+
export { Notification, notificationRoot } from '../../chunk-EBREIC3L.js';
|
|
5
5
|
import '../../chunk-BEL75C7N.js';
|
|
6
6
|
import '../../chunk-IG7FBZVM.js';
|
|
7
|
-
import '../../chunk-
|
|
7
|
+
import '../../chunk-WSIVRDRB.js';
|
|
8
8
|
import '../../chunk-NSDM3FEB.js';
|
|
9
|
+
import '../../chunk-I4SQQIP5.js';
|
|
9
10
|
import '../../chunk-WYCMIIRR.js';
|
|
10
11
|
import '../../chunk-B2LCHXUB.js';
|
|
11
12
|
import { cn } from '../../chunk-QP4I37PA.js';
|
|
@@ -126,12 +127,12 @@ var nanoid = customAlphabet("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmno
|
|
|
126
127
|
var generateId = () => nanoid();
|
|
127
128
|
var GAP = 12;
|
|
128
129
|
var REGION_POSITION = {
|
|
129
|
-
"top-start": "top-4
|
|
130
|
+
"top-start": "top-4 inset-s-4",
|
|
130
131
|
top: "top-4 left-1/2 -translate-x-1/2",
|
|
131
|
-
"top-end": "top-4
|
|
132
|
-
"bottom-start": "bottom-4
|
|
132
|
+
"top-end": "top-4 inset-e-4",
|
|
133
|
+
"bottom-start": "bottom-4 inset-s-4",
|
|
133
134
|
bottom: "bottom-4 left-1/2 -translate-x-1/2",
|
|
134
|
-
"bottom-end": "bottom-4
|
|
135
|
+
"bottom-end": "bottom-4 inset-e-4"
|
|
135
136
|
};
|
|
136
137
|
var NOTIFICATION_REMOVABLE_PROPS = [
|
|
137
138
|
"title",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/notification/store.ts","../../../src/components/notification/create-notifier.tsx"],"names":["promise","max"],"mappings":";;;;;;;;;;;;;;;;;AA4CA,IAAM,kBAAmC,MAAA,CAAO,MAAA,CAAO,EAAE,MAAA,EAAQ,IAAI,CAAA;AAI9D,SAAS,gBAAA,CAAiB,MAAA,GAA0B,EAAE,GAAA,EAAK,GAAE,EAAe;AACjF,EAAA,IAAI,KAAA,GAAyB,EAAE,MAAA,EAAQ,EAAC,EAAE;AAC1C,EAAA,MAAM,SAAA,uBAAgB,GAAA,EAAgB;AACtC,EAAA,MAAM,MAAA,uBAAa,GAAA,EAAoB;AACvC,EAAA,IAAI,MAAA,GAAS,KAAA;AAEb,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EACpF,CAAA;AAEA,EAAA,OAAO,EAAE,QAAQ,aAAA,EAAc;AACjC","file":"index.js","sourcesContent":["import type { ToastData, ToastId } from \"./types\"\n\n/**\n * Framework-agnostic toast store — a tiny vanilla pub/sub modelled on the kit's\n * overlay store (`components/overlays/store.ts`). Holds the live toast stack;\n * the React renderer (`Notifications`) subscribes via `useSyncExternalStore`,\n * and the bound `notify` controller wraps its mutators. No React here, so it's\n * safe to call from anywhere (event handlers, utils).\n *\n * Every mutation produces a fresh `state` + `toasts` array, so `getSnapshot`\n * returns a stable reference between mutations — the contract\n * `useSyncExternalStore` relies on to avoid tearing / render loops.\n *\n * Auto-dismiss timers live here (plain `setTimeout`), with remaining-time\n * bookkeeping so `pauseAll`/`resumeAll` (driven by the renderer on hover /\n * tab-hidden) can freeze and resume them. DOM listeners do NOT live here.\n */\n\nexport interface ToastStoreState {\n toasts: ToastData[]\n}\n\nexport interface ToastStore {\n subscribe: (listener: () => void) => () => void\n getSnapshot: () => ToastStoreState\n getServerSnapshot: () => ToastStoreState\n /** Upsert by id: a new id prepends (and starts its timer); an existing id\n * merges in place and restarts its timer (used for status transitions). */\n create: (data: ToastData) => ToastId\n /** Shallow-merge a patch into a live toast without touching its timer/status. */\n update: (id: ToastId, patch: Partial<ToastData>) => void\n /** Flip a toast to `dismissing` so its exit animation plays (all if no id). */\n dismiss: (id?: ToastId) => void\n /** Hard-remove a toast — called once its exit animation completes. */\n remove: (id: ToastId) => void\n /** Freeze every auto-dismiss timer (hover / tab hidden). */\n pauseAll: () => void\n /** Resume every frozen timer from its remaining time. */\n resumeAll: () => void\n has: (id: ToastId) => boolean\n}\n\n/** Frozen, module-stable empty stack for SSR — toasts are runtime-only, so the\n * server snapshot is always empty and matches the client's first render. */\nconst SERVER_SNAPSHOT: ToastStoreState = Object.freeze({ toasts: [] })\n\ntype Timer = { remaining: number; startedAt: number; handle: ReturnType<typeof setTimeout> | null }\n\nexport function createToastStore(config: { max: number } = { max: 5 }): ToastStore {\n let state: ToastStoreState = { toasts: [] }\n const listeners = new Set<() => void>()\n const timers = new Map<ToastId, Timer>()\n let paused = false\n\n const emit = () => {\n for (const listener of listeners) listener()\n }\n const set = (toasts: ToastData[]) => {\n state = { toasts }\n emit()\n }\n\n const clearTimer = (id: ToastId) => {\n const timer = timers.get(id)\n if (timer?.handle) clearTimeout(timer.handle)\n timers.delete(id)\n }\n\n const startTimer = (id: ToastId, duration: number) => {\n clearTimer(id)\n if (!Number.isFinite(duration)) return // loading / sticky toasts never expire\n const timer: Timer = { remaining: duration, startedAt: Date.now(), handle: null }\n if (!paused) timer.handle = setTimeout(() => dismiss(id), duration)\n timers.set(id, timer)\n }\n\n const dismiss: ToastStore[\"dismiss\"] = (id) => {\n if (id == null) {\n for (const toast of state.toasts) clearTimer(toast.id)\n set(state.toasts.map((t) => (t.status === \"open\" ? { ...t, status: \"dismissing\" } : t)))\n return\n }\n if (!state.toasts.some((t) => t.id === id)) return\n clearTimer(id)\n set(state.toasts.map((t) => (t.id === id ? { ...t, status: \"dismissing\" } : t)))\n }\n\n return {\n subscribe(listener) {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n },\n getSnapshot() {\n return state\n },\n getServerSnapshot() {\n return SERVER_SNAPSHOT\n },\n create(data) {\n const exists = state.toasts.some((t) => t.id === data.id)\n if (exists) {\n set(state.toasts.map((t) => (t.id === data.id ? { ...t, ...data } : t)))\n } else {\n // Newest first (index 0 = front). Cap the number of *open* toasts at\n // `max` by dismissing the oldest beyond the limit.\n const next = [data, ...state.toasts]\n const open = next.filter((t) => t.status === \"open\")\n if (open.length > config.max) {\n const overflow = new Set(open.slice(config.max).map((t) => t.id))\n for (const id of overflow) clearTimer(id)\n set(next.map((t) => (overflow.has(t.id) ? { ...t, status: \"dismissing\" } : t)))\n } else {\n set(next)\n }\n }\n startTimer(data.id, data.duration)\n return data.id\n },\n update(id, patch) {\n if (!state.toasts.some((t) => t.id === id)) return\n set(state.toasts.map((t) => (t.id === id ? { ...t, ...patch } : t)))\n },\n dismiss,\n remove(id) {\n clearTimer(id)\n if (!state.toasts.some((t) => t.id === id)) return\n set(state.toasts.filter((t) => t.id !== id))\n },\n pauseAll() {\n if (paused) return\n paused = true\n const now = Date.now()\n for (const timer of timers.values()) {\n if (!timer.handle) continue\n clearTimeout(timer.handle)\n timer.remaining -= now - timer.startedAt\n timer.handle = null\n }\n },\n resumeAll() {\n if (!paused) return\n paused = false\n const now = Date.now()\n for (const [id, timer] of timers) {\n if (timer.remaining <= 0) {\n dismiss(id)\n continue\n }\n timer.startedAt = now\n timer.handle = setTimeout(() => dismiss(id), timer.remaining)\n }\n },\n has(id) {\n return state.toasts.some((t) => t.id === id)\n },\n }\n}\n","\"use client\"\n\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { usePresence } from \"@ark-ui/react/presence\"\nimport { customAlphabet } from \"nanoid\"\nimport {\n isValidElement,\n type PointerEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState,\n useSyncExternalStore,\n} from \"react\"\nimport type { UnavailableProps } from \"../../lib/available-if\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { mergeRefs } from \"../../lib/merge-refs\"\nimport { Notification } from \"./notification\"\nimport { createToastStore, type ToastStore } from \"./store\"\nimport type { ColorWithTypeReason, ToastData, ToastHue, ToastId, ToastType } from \"./types\"\n\n/**\n * `createNotifier` — the imperative toast manager, modelled on the kit's\n * `createOverlays` (a framework-agnostic `useSyncExternalStore` store + a\n * once-mounted renderer + a bound controller).\n *\n * ```tsx\n * // notifier.ts — one instance for the app\n * export const { notify, Notifications } = createNotifier({ placement: \"bottom-end\" })\n *\n * // app root — mount the region once\n * <Notifications />\n *\n * // anywhere\n * notify(\"Copied to clipboard\") // neutral / custom toast\n * notify.success(\"Saved\")\n * notify.error({ title: \"Upload failed\", action: { label: \"Retry\", onClick: retry } })\n * notify.promise(save(), { loading: \"Saving…\", success: \"Saved\", error: \"Failed\" })\n *\n * const id = notify.loading(\"Uploading…\") // keep the id to update it\n * notify.update(id, { description: \"Halfway…\" }) // patch in place\n * notify.success({ id, title: \"Uploaded\" }) // …or transition its status\n * ```\n */\n\nexport type NotifyPlacement =\n | \"top-start\"\n | \"top\"\n | \"top-end\"\n | \"bottom-start\"\n | \"bottom\"\n | \"bottom-end\"\n\n/** The fields every toast input shares. A bare `ReactNode` (string/element)\n * is shorthand for `{ title }`. */\ntype NotifyFields = {\n title?: ReactNode\n description?: ReactNode\n /** ms until auto-dismiss. Omit for the notifier default; `loading` never\n * auto-dismisses. */\n duration?: number\n /** Provide to update/dedupe an existing toast (mint via a returned id, or\n * cast your own: `\"upload\" as ToastId`). */\n id?: ToastId\n /** Render a close button. @default true */\n withCloseButton?: boolean\n /** The action section — any `ReactNode` (e.g. an Undo `Notification.ActionTrigger`),\n * revealed independently of the description. */\n action?: ReactNode\n /** Custom leading glyph; `null` hides the default status icon. */\n icon?: ReactNode | null\n}\n\n/** Full options for a neutral `notify(...)` toast — the one call with no\n * status, so the one that takes a `color`. */\nexport type NotifyOptions = NotifyFields & {\n /** Accent palette for a custom toast. */\n color?: Color\n}\n\n/** Options for a status helper (`notify.success(...)`, …). The status sets\n * the hue, so `color` is refused — see `ToastHue`. */\nexport type NotifyStatusOptions = NotifyFields &\n UnavailableProps<Pick<NotifyOptions, \"color\">, ColorWithTypeReason>\n\n/** Options for `notify.update`. It keeps the toast's status and hue, so\n * `color` is refused; re-call `notify({ id, color })` to recolor. */\nexport type NotifyUpdateOptions = NotifyFields &\n UnavailableProps<\n Pick<NotifyOptions, \"color\">,\n \"`update` keeps the hue — re-call `notify({ id, color })` to recolor\"\n >\n\nexport type NotifyInput = ReactNode | NotifyOptions\nexport type NotifyStatusInput = ReactNode | NotifyStatusOptions\nexport type NotifyUpdateInput = ReactNode | NotifyUpdateOptions\n\nexport type CreateNotifierOptions = {\n /** Corner/edge the stack anchors to. @default \"bottom-end\" */\n placement?: NotifyPlacement\n /** Max toasts on screen before the oldest is dismissed. @default 5 */\n max?: number\n /** Default auto-dismiss duration (ms). @default 5000 */\n duration?: number\n /** Expand the collapsed deck into a column on hover/focus. @default true */\n expand?: boolean\n /** Render the region in a Portal (escape clipping ancestors). @default true */\n withinPortal?: boolean\n /** Portal target. @default document.body */\n container?: HTMLElement | null\n}\n\ntype StatusFn = (input: NotifyStatusInput) => ToastId\n\n/** The `promise` sugar: a single toast tracking an async lifecycle. */\nexport type NotifyPromise = <T>(\n promise: Promise<T> | (() => Promise<T>),\n messages: {\n loading: NotifyStatusInput\n success?: NotifyStatusInput | ((value: T) => NotifyStatusInput)\n error?: NotifyStatusInput | ((error: unknown) => NotifyStatusInput)\n },\n) => { id: ToastId; unwrap: () => Promise<T> }\n\n/** Patch a live toast by id, accepting the same shorthand. Only the fields you\n * pass change (title/description/icon/duration/withCloseButton);\n * status/type and the hue are preserved. To change status, re-call a status helper with\n * the same `id` (e.g. `notify.success({ id })`). */\nexport type NotifyUpdate = (id: ToastId, input: NotifyUpdateInput) => ToastId\n\n/** The bound controller. Callable for a neutral toast; status helpers +\n * `promise` + `update` + `dismiss`/`remove` on top. */\nexport type Notify = ((input: NotifyInput) => ToastId) & {\n success: StatusFn\n error: StatusFn\n warning: StatusFn\n info: StatusFn\n loading: StatusFn\n promise: NotifyPromise\n update: NotifyUpdate\n /** Dismiss a toast (plays its exit); all toasts if no id. */\n dismiss: (id?: ToastId) => void\n /** Immediately remove a toast (no exit animation). */\n remove: (id: ToastId) => void\n /** Whether a toast with this id is still live (open or dismissing). */\n has: (id: ToastId) => boolean\n /** Snapshot of the live toasts (advanced / testing). */\n getToasts: () => ToastData[]\n}\n\nexport type Notifier = {\n notify: Notify\n Notifications: () => ReactNode\n}\n\n/** A bare node (string/number/element/array) is a title; any other object is\n * a full `NotifyOptions`. */\n/** Any of the three option shapes; they differ only in whether `color` is accepted. */\ntype AnyOptions = NotifyOptions | NotifyStatusOptions | NotifyUpdateOptions\n\nconst isOptions = <O extends AnyOptions>(input: ReactNode | O): input is O =>\n input != null && typeof input === \"object\" && !isValidElement(input) && !Array.isArray(input)\n\nconst nanoid = customAlphabet(\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\", 8)\n/** Mint a branded `ToastId` (the one place a plain string becomes a `ToastId`). */\nconst generateId = (): ToastId => nanoid() as ToastId\n\n/** px gap between toasts when the stack is expanded. */\nconst GAP = 12\n\n/** Region positioning (fixed + anchored edge) per placement. The stacking\n * geometry itself lives in theme.css, keyed on `data-placement`. */\nconst REGION_POSITION = {\n \"top-start\": \"top-4 left-4\",\n top: \"top-4 left-1/2 -translate-x-1/2\",\n \"top-end\": \"top-4 right-4\",\n \"bottom-start\": \"bottom-4 left-4\",\n bottom: \"bottom-4 left-1/2 -translate-x-1/2\",\n \"bottom-end\": \"bottom-4 right-4\",\n} as const satisfies Record<NotifyPlacement, string>\n/** Fields `notify.update` copies from the input onto a live toast — the keys\n * shared by `NotifyOptions` and `ToastData` (excludes `id`/`status`/`type`). */\nconst NOTIFICATION_REMOVABLE_PROPS = [\n \"title\",\n \"description\",\n \"action\",\n \"icon\",\n \"duration\",\n \"withCloseButton\",\n] as const satisfies (keyof NotifyUpdateOptions & keyof ToastData)[]\n\n/** px a pointer must travel to count as a dismiss-swipe. */\nconst SWIPE_THRESHOLD = 60\n/** px of movement under which a press counts as a click (→ dismiss). */\nconst CLICK_SLOP = 5\n\ntype ToasterItemProps = {\n toast: ToastData\n store: ToastStore\n /** Position from the front (0 = newest). */\n index: number\n /** Σ heights + gaps of the newer toasts in front (expanded-column offset), px. */\n offset: number\n /** This toast's measured height, px. */\n height: number\n /** The front toast's height, px (for top-aligned collapsed peeks). */\n frontHeight: number\n onMeasure: (id: string, height: number) => void\n}\n\n/**\n * A single live toast inside the stack. Owns the toaster behavior the card\n * itself stays free of — enter/exit via Ark Presence, height measurement for the\n * stacking layout, and swipe/click-to-dismiss — then renders the presentational\n * `Notification`, forwarding the merged ref, stacking style vars and gesture\n * handlers straight onto its `Root`.\n */\nfunction ToasterItem({\n toast,\n store,\n index,\n offset,\n height,\n frontHeight,\n onMeasure,\n}: ToasterItemProps) {\n const { id } = toast\n // The store keeps `type` and `color` side by side; the card takes one or the\n // other. At most one is ever set (see `toData`), so pick whichever is.\n const { type, color, ...fields } = toast\n const hue: ToastHue = type ? { type } : { color }\n\n const presence = usePresence({\n present: toast.status === \"open\",\n lazyMount: true,\n unmountOnExit: true,\n onExitComplete: () => store.remove(id),\n })\n\n // Report the card's natural height so the renderer can lay out the stack.\n const measureRef = useRef<HTMLDivElement | null>(null)\n useEffect(() => {\n const node = measureRef.current\n if (!node) return\n onMeasure(id, node.offsetHeight)\n const observer = new ResizeObserver(() => onMeasure(id, node.offsetHeight))\n observer.observe(node)\n return () => observer.disconnect()\n }, [id, onMeasure])\n\n // Swipe / click to dismiss. Dragging past the threshold flicks the toast away\n // (`--swipe-x`/`--swipe-opacity` track the pointer, transition off for 1:1);\n // a click that barely moves dismisses too. Presses that start on an\n // interactive child (close / action) are left to that control.\n const drag = useRef<{ startX: number; interactive: boolean } | null>(null)\n const onPointerDown = (event: PointerEvent<HTMLDivElement>) => {\n if (event.button !== 0) return\n const interactive =\n (event.target as Element).closest(\"button, a, input, [role='button']\") != null\n drag.current = { startX: event.clientX, interactive }\n if (!interactive) event.currentTarget.setPointerCapture(event.pointerId)\n }\n const onPointerMove = (event: PointerEvent<HTMLDivElement>) => {\n const state = drag.current\n if (!state || state.interactive) return\n const dx = event.clientX - state.startX\n const el = event.currentTarget\n el.style.transition = \"none\"\n el.style.setProperty(\"--swipe-x\", `${dx}px`)\n el.style.setProperty(\"--swipe-opacity\", `${Math.max(0.15, 1 - Math.abs(dx) / 240)}`)\n }\n const onPointerEnd = (event: PointerEvent<HTMLDivElement>) => {\n const state = drag.current\n drag.current = null\n if (!state || state.interactive) return\n const dx = event.clientX - state.startX\n const el = event.currentTarget\n el.style.transition = \"\"\n if (Math.abs(dx) > SWIPE_THRESHOLD || Math.abs(dx) < CLICK_SLOP) {\n store.dismiss(id)\n } else {\n el.style.setProperty(\"--swipe-x\", \"0px\")\n el.style.setProperty(\"--swipe-opacity\", \"1\")\n }\n }\n\n if (presence.unmounted) return null\n\n return (\n <Notification\n ref={mergeRefs(presence.ref, measureRef)}\n {...fields}\n {...hue}\n {...presence.getPresenceProps()}\n data-part=\"toast\"\n onClose={() => store.dismiss(id)}\n // `cursor-grab` lives here (not in the shared cva) so only swipeable\n // toaster toasts show it — a standalone `Notification.Root` doesn't.\n className=\"cursor-grab touch-none select-none active:cursor-grabbing\"\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={onPointerEnd}\n onPointerCancel={onPointerEnd}\n style={{\n [\"--index\" as string]: index,\n [\"--offset\" as string]: `${offset}px`,\n [\"--height\" as string]: `${height}px`,\n [\"--front-height\" as string]: `${frontHeight}px`,\n }}\n />\n )\n}\n\nexport function createNotifier(options: CreateNotifierOptions = {}): Notifier {\n const {\n placement = \"bottom-end\",\n max = 5,\n duration: defaultDuration = 5000,\n expand = true,\n withinPortal = true,\n container,\n } = options\n\n const store = createToastStore({ max })\n\n // Generic so each call site keeps its own shape (a status input stays a\n // status input). `{ title }` alone is a valid instance of every shape.\n const normalize = <O extends AnyOptions>(input: ReactNode | O): O =>\n isOptions(input) ? input : ({ title: input as ReactNode } as O)\n\n const toData = (input: NotifyInput | NotifyStatusInput, type?: ToastType): ToastData => {\n const o = normalize(input)\n return {\n id: o.id ?? generateId(),\n status: \"open\",\n type,\n title: o.title,\n description: o.description,\n action: o.action,\n // A status sets the hue: drop any `color` a JS caller slipped past the\n // types, and clear a previous one when a status re-call dedupes by id.\n color: type === undefined ? (o as NotifyOptions).color : undefined,\n icon: o.icon,\n duration: o.duration ?? (type === \"loading\" ? Number.POSITIVE_INFINITY : defaultDuration),\n withCloseButton: o.withCloseButton ?? true,\n }\n }\n\n const status =\n (type: ToastType): StatusFn =>\n (input) =>\n store.create(toData(input, type))\n\n const show = (input: NotifyInput) => store.create(toData(input))\n\n const update: NotifyUpdate = (id, input) => {\n const o = normalize(input)\n // Copy keys that are *present* (not just defined) so an explicit\n // `{ description: undefined }` clears the field rather than being ignored.\n // An omitted key leaves the current value untouched.\n const patch: Partial<ToastData> = {}\n for (const prop of NOTIFICATION_REMOVABLE_PROPS) {\n // TS can't correlate `prop` with `o[prop]`/`patch[prop]` across a union\n // key on writes (the target collapses to their intersection, `undefined`).\n // The prop list is constrained to keys shared by NotifyOptions & ToastData\n // with compatible value types, so this write is safe.\n if (prop in o) (patch as Record<string, unknown>)[prop] = o[prop]\n }\n store.update(id, patch)\n return id\n }\n\n const promise: NotifyPromise = (promise, messages) => {\n const id = generateId()\n const resolve = (input: NotifyStatusInput, type: ToastType) =>\n store.create(toData({ ...normalize(input), id }, type))\n status(\"loading\")({ ...normalize(messages.loading), id })\n const run = typeof promise === \"function\" ? promise() : promise\n run.then(\n (value) => {\n if (messages.success === undefined) return store.dismiss(id)\n resolve(\n typeof messages.success === \"function\" ? messages.success(value) : messages.success,\n \"success\",\n )\n },\n (error) => {\n if (messages.error === undefined) return store.dismiss(id)\n resolve(\n typeof messages.error === \"function\" ? messages.error(error) : messages.error,\n \"error\",\n )\n },\n )\n return { id, unwrap: () => run }\n }\n\n const notify = Object.assign(show, {\n success: status(\"success\"),\n error: status(\"error\"),\n warning: status(\"warning\"),\n info: status(\"info\"),\n loading: status(\"loading\"),\n promise,\n update,\n dismiss: store.dismiss,\n remove: store.remove,\n has: store.has,\n getToasts: () => store.getSnapshot().toasts,\n }) as Notify\n\n const Notifications = () => {\n const { toasts } = useSyncExternalStore(\n store.subscribe,\n store.getSnapshot,\n store.getServerSnapshot,\n )\n const [heights, setHeights] = useState<Record<string, number>>({})\n\n const onMeasure = useCallback((id: string, height: number) => {\n setHeights((prev) => (prev[id] === height ? prev : { ...prev, [id]: height }))\n }, [])\n\n // Pause auto-dismiss while the tab is hidden so toasts don't expire unseen.\n useEffect(() => {\n const onVisibility = () => (document.hidden ? store.pauseAll() : store.resumeAll())\n document.addEventListener(\"visibilitychange\", onVisibility)\n return () => document.removeEventListener(\"visibilitychange\", onVisibility)\n }, [])\n\n // Toasts are absolutely stacked; the collapsed deck (top-aligned peeks) and\n // the hover-expanded column are both derived in CSS (theme.css) from these\n // measured px vars. `offset` = Σ heights + gaps of the *newer* toasts in\n // front of this one (its position in the expanded column).\n const heightOf = (toast: ToastData) => heights[toast.id] ?? 0\n const frontHeight = toasts[0] ? heightOf(toasts[0]) : 0\n const items = toasts.map((toast, index) => ({\n toast,\n index,\n height: heightOf(toast),\n offset: toasts.slice(0, index).reduce((sum, newer) => sum + heightOf(newer) + GAP, 0),\n }))\n const expandedHeight =\n toasts.reduce((sum, toast) => sum + heightOf(toast), 0) + GAP * Math.max(0, toasts.length - 1)\n // A toast behind the front that's taller overflows *below* it (toward the\n // bottom edge) in bottom placements. That strip is a hit target collapsed,\n // but expanding slides it into the column as the stack grows the other way,\n // stranding the pointer over a gap → the deck blinks open/closed. Size a\n // stationary ghost hover-bridge under the front toast to cover the strip\n // (overestimates by the peek offsets, which is harmless — see theme.css).\n const maxHeight = toasts.reduce((max, toast) => Math.max(max, heightOf(toast)), 0)\n const stackOverflow = placement.startsWith(\"bottom\") ? Math.max(0, maxHeight - frontHeight) : 0\n\n const region = (\n <section\n aria-label=\"Notifications\"\n data-scope=\"notifications\"\n data-placement={placement}\n data-expand={expand ? \"\" : undefined}\n // Slide direction for the enter/exit keyframes: from below for bottom\n // placements, from above for top.\n style={{ [\"--toast-from\" as string]: placement.startsWith(\"top\") ? \"-100%\" : \"100%\" }}\n className={cn(\n \"pointer-events-none fixed z-(--toast-z,100) justify-center flex\",\n REGION_POSITION[placement],\n // Phones (< xs): pin to the bottom, full-bleed, above the safe area.\n \"max-xs:inset-x-0! max-xs:bottom-[calc(1rem+env(safe-area-inset-bottom))]! max-xs:top-auto! max-xs:translate-x-0!\",\n )}\n >\n {/* pointer-events-auto only on the stack, so the region never blocks the\n page. Hover here pauses timers + expands the deck (enter/leave don't\n fire when moving between toasts inside). */}\n <div\n data-part=\"stack\"\n onPointerEnter={() => store.pauseAll()}\n onPointerLeave={() => store.resumeAll()}\n style={{\n [\"--stack-collapsed-h\" as string]: `${frontHeight}px`,\n [\"--stack-expanded-h\" as string]: `${expandedHeight}px`,\n }}\n className=\"pointer-events-auto relative min-w-88 max-xs:min-w-0 max-w-[calc(100vw-2rem)] max-xs:w-screen\"\n >\n {items.map(({ toast, index, offset, height }) => (\n <ToasterItem\n key={toast.id}\n toast={toast}\n store={store}\n index={index}\n offset={offset}\n height={height}\n frontHeight={frontHeight}\n onMeasure={onMeasure}\n />\n ))}\n {/* The stationary ghost hover-bridge sized by `stackOverflow` above:\n an invisible hit-area glued just below the front toast so `:hover`\n on the stack stays put through the collapse↔expand morph (see\n theme.css). Nonzero only for bottom placements with overflow. */}\n {stackOverflow > 0 && (\n <span\n aria-hidden\n data-part=\"ghost\"\n style={{ [\"--ghost-h\" as string]: `${stackOverflow}px` }}\n />\n )}\n </div>\n </section>\n )\n\n if (!withinPortal) return region\n return <Portal container={container ? { current: container } : undefined}>{region}</Portal>\n }\n\n return { notify, Notifications }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/notification/store.ts","../../../src/components/notification/create-notifier.tsx"],"names":["promise","max"],"mappings":";;;;;;;;;;;;;;;;;;AA4CA,IAAM,kBAAmC,MAAA,CAAO,MAAA,CAAO,EAAE,MAAA,EAAQ,IAAI,CAAA;AAI9D,SAAS,gBAAA,CAAiB,MAAA,GAA0B,EAAE,GAAA,EAAK,GAAE,EAAe;AACjF,EAAA,IAAI,KAAA,GAAyB,EAAE,MAAA,EAAQ,EAAC,EAAE;AAC1C,EAAA,MAAM,SAAA,uBAAgB,GAAA,EAAgB;AACtC,EAAA,MAAM,MAAA,uBAAa,GAAA,EAAoB;AACvC,EAAA,IAAI,MAAA,GAAS,KAAA;AAEb,EAAA,MAAM,OAAO,MAAM;AACjB,IAAA,KAAA,MAAW,QAAA,IAAY,WAAW,QAAA,EAAS;AA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["import type { ToastData, ToastId } from \"./types\"\n\n/**\n * Framework-agnostic toast store — a tiny vanilla pub/sub modelled on the kit's\n * overlay store (`components/overlays/store.ts`). Holds the live toast stack;\n * the React renderer (`Notifications`) subscribes via `useSyncExternalStore`,\n * and the bound `notify` controller wraps its mutators. No React here, so it's\n * safe to call from anywhere (event handlers, utils).\n *\n * Every mutation produces a fresh `state` + `toasts` array, so `getSnapshot`\n * returns a stable reference between mutations — the contract\n * `useSyncExternalStore` relies on to avoid tearing / render loops.\n *\n * Auto-dismiss timers live here (plain `setTimeout`), with remaining-time\n * bookkeeping so `pauseAll`/`resumeAll` (driven by the renderer on hover /\n * tab-hidden) can freeze and resume them. DOM listeners do NOT live here.\n */\n\nexport interface ToastStoreState {\n toasts: ToastData[]\n}\n\nexport interface ToastStore {\n subscribe: (listener: () => void) => () => void\n getSnapshot: () => ToastStoreState\n getServerSnapshot: () => ToastStoreState\n /** Upsert by id: a new id prepends (and starts its timer); an existing id\n * merges in place and restarts its timer (used for status transitions). */\n create: (data: ToastData) => ToastId\n /** Shallow-merge a patch into a live toast without touching its timer/status. */\n update: (id: ToastId, patch: Partial<ToastData>) => void\n /** Flip a toast to `dismissing` so its exit animation plays (all if no id). */\n dismiss: (id?: ToastId) => void\n /** Hard-remove a toast — called once its exit animation completes. */\n remove: (id: ToastId) => void\n /** Freeze every auto-dismiss timer (hover / tab hidden). */\n pauseAll: () => void\n /** Resume every frozen timer from its remaining time. */\n resumeAll: () => void\n has: (id: ToastId) => boolean\n}\n\n/** Frozen, module-stable empty stack for SSR — toasts are runtime-only, so the\n * server snapshot is always empty and matches the client's first render. */\nconst SERVER_SNAPSHOT: ToastStoreState = Object.freeze({ toasts: [] })\n\ntype Timer = { remaining: number; startedAt: number; handle: ReturnType<typeof setTimeout> | null }\n\nexport function createToastStore(config: { max: number } = { max: 5 }): ToastStore {\n let state: ToastStoreState = { toasts: [] }\n const listeners = new Set<() => void>()\n const timers = new Map<ToastId, Timer>()\n let paused = false\n\n const emit = () => {\n for (const listener of listeners) listener()\n }\n const set = (toasts: ToastData[]) => {\n state = { toasts }\n emit()\n }\n\n const clearTimer = (id: ToastId) => {\n const timer = timers.get(id)\n if (timer?.handle) clearTimeout(timer.handle)\n timers.delete(id)\n }\n\n const startTimer = (id: ToastId, duration: number) => {\n clearTimer(id)\n if (!Number.isFinite(duration)) return // loading / sticky toasts never expire\n const timer: Timer = { remaining: duration, startedAt: Date.now(), handle: null }\n if (!paused) timer.handle = setTimeout(() => dismiss(id), duration)\n timers.set(id, timer)\n }\n\n const dismiss: ToastStore[\"dismiss\"] = (id) => {\n if (id == null) {\n for (const toast of state.toasts) clearTimer(toast.id)\n set(state.toasts.map((t) => (t.status === \"open\" ? { ...t, status: \"dismissing\" } : t)))\n return\n }\n if (!state.toasts.some((t) => t.id === id)) return\n clearTimer(id)\n set(state.toasts.map((t) => (t.id === id ? { ...t, status: \"dismissing\" } : t)))\n }\n\n return {\n subscribe(listener) {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n },\n getSnapshot() {\n return state\n },\n getServerSnapshot() {\n return SERVER_SNAPSHOT\n },\n create(data) {\n const exists = state.toasts.some((t) => t.id === data.id)\n if (exists) {\n set(state.toasts.map((t) => (t.id === data.id ? { ...t, ...data } : t)))\n } else {\n // Newest first (index 0 = front). Cap the number of *open* toasts at\n // `max` by dismissing the oldest beyond the limit.\n const next = [data, ...state.toasts]\n const open = next.filter((t) => t.status === \"open\")\n if (open.length > config.max) {\n const overflow = new Set(open.slice(config.max).map((t) => t.id))\n for (const id of overflow) clearTimer(id)\n set(next.map((t) => (overflow.has(t.id) ? { ...t, status: \"dismissing\" } : t)))\n } else {\n set(next)\n }\n }\n startTimer(data.id, data.duration)\n return data.id\n },\n update(id, patch) {\n if (!state.toasts.some((t) => t.id === id)) return\n set(state.toasts.map((t) => (t.id === id ? { ...t, ...patch } : t)))\n },\n dismiss,\n remove(id) {\n clearTimer(id)\n if (!state.toasts.some((t) => t.id === id)) return\n set(state.toasts.filter((t) => t.id !== id))\n },\n pauseAll() {\n if (paused) return\n paused = true\n const now = Date.now()\n for (const timer of timers.values()) {\n if (!timer.handle) continue\n clearTimeout(timer.handle)\n timer.remaining -= now - timer.startedAt\n timer.handle = null\n }\n },\n resumeAll() {\n if (!paused) return\n paused = false\n const now = Date.now()\n for (const [id, timer] of timers) {\n if (timer.remaining <= 0) {\n dismiss(id)\n continue\n }\n timer.startedAt = now\n timer.handle = setTimeout(() => dismiss(id), timer.remaining)\n }\n },\n has(id) {\n return state.toasts.some((t) => t.id === id)\n },\n }\n}\n","\"use client\"\n\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { usePresence } from \"@ark-ui/react/presence\"\nimport { customAlphabet } from \"nanoid\"\nimport {\n isValidElement,\n type PointerEvent,\n type ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState,\n useSyncExternalStore,\n} from \"react\"\nimport type { UnavailableProps } from \"../../lib/available-if\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { mergeRefs } from \"../../lib/merge-refs\"\nimport { Notification } from \"./notification\"\nimport { createToastStore, type ToastStore } from \"./store\"\nimport type { ColorWithTypeReason, ToastData, ToastHue, ToastId, ToastType } from \"./types\"\n\n/**\n * `createNotifier` — the imperative toast manager, modelled on the kit's\n * `createOverlays` (a framework-agnostic `useSyncExternalStore` store + a\n * once-mounted renderer + a bound controller).\n *\n * ```tsx\n * // notifier.ts — one instance for the app\n * export const { notify, Notifications } = createNotifier({ placement: \"bottom-end\" })\n *\n * // app root — mount the region once\n * <Notifications />\n *\n * // anywhere\n * notify(\"Copied to clipboard\") // neutral / custom toast\n * notify.success(\"Saved\")\n * notify.error({ title: \"Upload failed\", action: { label: \"Retry\", onClick: retry } })\n * notify.promise(save(), { loading: \"Saving…\", success: \"Saved\", error: \"Failed\" })\n *\n * const id = notify.loading(\"Uploading…\") // keep the id to update it\n * notify.update(id, { description: \"Halfway…\" }) // patch in place\n * notify.success({ id, title: \"Uploaded\" }) // …or transition its status\n * ```\n */\n\nexport type NotifyPlacement =\n | \"top-start\"\n | \"top\"\n | \"top-end\"\n | \"bottom-start\"\n | \"bottom\"\n | \"bottom-end\"\n\n/** The fields every toast input shares. A bare `ReactNode` (string/element)\n * is shorthand for `{ title }`. */\ntype NotifyFields = {\n title?: ReactNode\n description?: ReactNode\n /** ms until auto-dismiss. Omit for the notifier default; `loading` never\n * auto-dismisses. */\n duration?: number\n /** Provide to update/dedupe an existing toast (mint via a returned id, or\n * cast your own: `\"upload\" as ToastId`). */\n id?: ToastId\n /** Render a close button. @default true */\n withCloseButton?: boolean\n /** The action section — any `ReactNode` (e.g. an Undo `Notification.ActionTrigger`),\n * revealed independently of the description. */\n action?: ReactNode\n /** Custom leading glyph; `null` hides the default status icon. */\n icon?: ReactNode | null\n}\n\n/** Full options for a neutral `notify(...)` toast — the one call with no\n * status, so the one that takes a `color`. */\nexport type NotifyOptions = NotifyFields & {\n /** Accent palette for a custom toast. */\n color?: Color\n}\n\n/** Options for a status helper (`notify.success(...)`, …). The status sets\n * the hue, so `color` is refused — see `ToastHue`. */\nexport type NotifyStatusOptions = NotifyFields &\n UnavailableProps<Pick<NotifyOptions, \"color\">, ColorWithTypeReason>\n\n/** Options for `notify.update`. It keeps the toast's status and hue, so\n * `color` is refused; re-call `notify({ id, color })` to recolor. */\nexport type NotifyUpdateOptions = NotifyFields &\n UnavailableProps<\n Pick<NotifyOptions, \"color\">,\n \"`update` keeps the hue — re-call `notify({ id, color })` to recolor\"\n >\n\nexport type NotifyInput = ReactNode | NotifyOptions\nexport type NotifyStatusInput = ReactNode | NotifyStatusOptions\nexport type NotifyUpdateInput = ReactNode | NotifyUpdateOptions\n\nexport type CreateNotifierOptions = {\n /** Corner/edge the stack anchors to. @default \"bottom-end\" */\n placement?: NotifyPlacement\n /** Max toasts on screen before the oldest is dismissed. @default 5 */\n max?: number\n /** Default auto-dismiss duration (ms). @default 5000 */\n duration?: number\n /** Expand the collapsed deck into a column on hover/focus. @default true */\n expand?: boolean\n /** Render the region in a Portal (escape clipping ancestors). @default true */\n withinPortal?: boolean\n /** Portal target. @default document.body */\n container?: HTMLElement | null\n}\n\ntype StatusFn = (input: NotifyStatusInput) => ToastId\n\n/** The `promise` sugar: a single toast tracking an async lifecycle. */\nexport type NotifyPromise = <T>(\n promise: Promise<T> | (() => Promise<T>),\n messages: {\n loading: NotifyStatusInput\n success?: NotifyStatusInput | ((value: T) => NotifyStatusInput)\n error?: NotifyStatusInput | ((error: unknown) => NotifyStatusInput)\n },\n) => { id: ToastId; unwrap: () => Promise<T> }\n\n/** Patch a live toast by id, accepting the same shorthand. Only the fields you\n * pass change (title/description/icon/duration/withCloseButton);\n * status/type and the hue are preserved. To change status, re-call a status helper with\n * the same `id` (e.g. `notify.success({ id })`). */\nexport type NotifyUpdate = (id: ToastId, input: NotifyUpdateInput) => ToastId\n\n/** The bound controller. Callable for a neutral toast; status helpers +\n * `promise` + `update` + `dismiss`/`remove` on top. */\nexport type Notify = ((input: NotifyInput) => ToastId) & {\n success: StatusFn\n error: StatusFn\n warning: StatusFn\n info: StatusFn\n loading: StatusFn\n promise: NotifyPromise\n update: NotifyUpdate\n /** Dismiss a toast (plays its exit); all toasts if no id. */\n dismiss: (id?: ToastId) => void\n /** Immediately remove a toast (no exit animation). */\n remove: (id: ToastId) => void\n /** Whether a toast with this id is still live (open or dismissing). */\n has: (id: ToastId) => boolean\n /** Snapshot of the live toasts (advanced / testing). */\n getToasts: () => ToastData[]\n}\n\nexport type Notifier = {\n notify: Notify\n Notifications: () => ReactNode\n}\n\n/** A bare node (string/number/element/array) is a title; any other object is\n * a full `NotifyOptions`. */\n/** Any of the three option shapes; they differ only in whether `color` is accepted. */\ntype AnyOptions = NotifyOptions | NotifyStatusOptions | NotifyUpdateOptions\n\nconst isOptions = <O extends AnyOptions>(input: ReactNode | O): input is O =>\n input != null && typeof input === \"object\" && !isValidElement(input) && !Array.isArray(input)\n\nconst nanoid = customAlphabet(\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\", 8)\n/** Mint a branded `ToastId` (the one place a plain string becomes a `ToastId`). */\nconst generateId = (): ToastId => nanoid() as ToastId\n\n/** px gap between toasts when the stack is expanded. */\nconst GAP = 12\n\n/** Region positioning (fixed + anchored edge) per placement. The stacking\n * geometry itself lives in theme.css, keyed on `data-placement`. `start`/`end`\n * are logical insets, so they follow the document's `dir` (end = left in RTL). */\nconst REGION_POSITION = {\n \"top-start\": \"top-4 inset-s-4\",\n top: \"top-4 left-1/2 -translate-x-1/2\",\n \"top-end\": \"top-4 inset-e-4\",\n \"bottom-start\": \"bottom-4 inset-s-4\",\n bottom: \"bottom-4 left-1/2 -translate-x-1/2\",\n \"bottom-end\": \"bottom-4 inset-e-4\",\n} as const satisfies Record<NotifyPlacement, string>\n/** Fields `notify.update` copies from the input onto a live toast — the keys\n * shared by `NotifyOptions` and `ToastData` (excludes `id`/`status`/`type`). */\nconst NOTIFICATION_REMOVABLE_PROPS = [\n \"title\",\n \"description\",\n \"action\",\n \"icon\",\n \"duration\",\n \"withCloseButton\",\n] as const satisfies (keyof NotifyUpdateOptions & keyof ToastData)[]\n\n/** px a pointer must travel to count as a dismiss-swipe. */\nconst SWIPE_THRESHOLD = 60\n/** px of movement under which a press counts as a click (→ dismiss). */\nconst CLICK_SLOP = 5\n\ntype ToasterItemProps = {\n toast: ToastData\n store: ToastStore\n /** Position from the front (0 = newest). */\n index: number\n /** Σ heights + gaps of the newer toasts in front (expanded-column offset), px. */\n offset: number\n /** This toast's measured height, px. */\n height: number\n /** The front toast's height, px (for top-aligned collapsed peeks). */\n frontHeight: number\n onMeasure: (id: string, height: number) => void\n}\n\n/**\n * A single live toast inside the stack. Owns the toaster behavior the card\n * itself stays free of — enter/exit via Ark Presence, height measurement for the\n * stacking layout, and swipe/click-to-dismiss — then renders the presentational\n * `Notification`, forwarding the merged ref, stacking style vars and gesture\n * handlers straight onto its `Root`.\n */\nfunction ToasterItem({\n toast,\n store,\n index,\n offset,\n height,\n frontHeight,\n onMeasure,\n}: ToasterItemProps) {\n const { id } = toast\n // The store keeps `type` and `color` side by side; the card takes one or the\n // other. At most one is ever set (see `toData`), so pick whichever is.\n const { type, color, ...fields } = toast\n const hue: ToastHue = type ? { type } : { color }\n\n const presence = usePresence({\n present: toast.status === \"open\",\n lazyMount: true,\n unmountOnExit: true,\n onExitComplete: () => store.remove(id),\n })\n\n // Report the card's natural height so the renderer can lay out the stack.\n const measureRef = useRef<HTMLDivElement | null>(null)\n useEffect(() => {\n const node = measureRef.current\n if (!node) return\n onMeasure(id, node.offsetHeight)\n const observer = new ResizeObserver(() => onMeasure(id, node.offsetHeight))\n observer.observe(node)\n return () => observer.disconnect()\n }, [id, onMeasure])\n\n // Swipe / click to dismiss. Dragging past the threshold flicks the toast away\n // (`--swipe-x`/`--swipe-opacity` track the pointer, transition off for 1:1);\n // a click that barely moves dismisses too. Presses that start on an\n // interactive child (close / action) are left to that control.\n const drag = useRef<{ startX: number; interactive: boolean } | null>(null)\n const onPointerDown = (event: PointerEvent<HTMLDivElement>) => {\n if (event.button !== 0) return\n const interactive =\n (event.target as Element).closest(\"button, a, input, [role='button']\") != null\n drag.current = { startX: event.clientX, interactive }\n if (!interactive) event.currentTarget.setPointerCapture(event.pointerId)\n }\n const onPointerMove = (event: PointerEvent<HTMLDivElement>) => {\n const state = drag.current\n if (!state || state.interactive) return\n const dx = event.clientX - state.startX\n const el = event.currentTarget\n el.style.transition = \"none\"\n el.style.setProperty(\"--swipe-x\", `${dx}px`)\n el.style.setProperty(\"--swipe-opacity\", `${Math.max(0.15, 1 - Math.abs(dx) / 240)}`)\n }\n const onPointerEnd = (event: PointerEvent<HTMLDivElement>) => {\n const state = drag.current\n drag.current = null\n if (!state || state.interactive) return\n const dx = event.clientX - state.startX\n const el = event.currentTarget\n el.style.transition = \"\"\n if (Math.abs(dx) > SWIPE_THRESHOLD || Math.abs(dx) < CLICK_SLOP) {\n store.dismiss(id)\n } else {\n el.style.setProperty(\"--swipe-x\", \"0px\")\n el.style.setProperty(\"--swipe-opacity\", \"1\")\n }\n }\n\n if (presence.unmounted) return null\n\n return (\n <Notification\n ref={mergeRefs(presence.ref, measureRef)}\n {...fields}\n {...hue}\n {...presence.getPresenceProps()}\n data-part=\"toast\"\n onClose={() => store.dismiss(id)}\n // `cursor-grab` lives here (not in the shared cva) so only swipeable\n // toaster toasts show it — a standalone `Notification.Root` doesn't.\n className=\"cursor-grab touch-none select-none active:cursor-grabbing\"\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={onPointerEnd}\n onPointerCancel={onPointerEnd}\n style={{\n [\"--index\" as string]: index,\n [\"--offset\" as string]: `${offset}px`,\n [\"--height\" as string]: `${height}px`,\n [\"--front-height\" as string]: `${frontHeight}px`,\n }}\n />\n )\n}\n\nexport function createNotifier(options: CreateNotifierOptions = {}): Notifier {\n const {\n placement = \"bottom-end\",\n max = 5,\n duration: defaultDuration = 5000,\n expand = true,\n withinPortal = true,\n container,\n } = options\n\n const store = createToastStore({ max })\n\n // Generic so each call site keeps its own shape (a status input stays a\n // status input). `{ title }` alone is a valid instance of every shape.\n const normalize = <O extends AnyOptions>(input: ReactNode | O): O =>\n isOptions(input) ? input : ({ title: input as ReactNode } as O)\n\n const toData = (input: NotifyInput | NotifyStatusInput, type?: ToastType): ToastData => {\n const o = normalize(input)\n return {\n id: o.id ?? generateId(),\n status: \"open\",\n type,\n title: o.title,\n description: o.description,\n action: o.action,\n // A status sets the hue: drop any `color` a JS caller slipped past the\n // types, and clear a previous one when a status re-call dedupes by id.\n color: type === undefined ? (o as NotifyOptions).color : undefined,\n icon: o.icon,\n duration: o.duration ?? (type === \"loading\" ? Number.POSITIVE_INFINITY : defaultDuration),\n withCloseButton: o.withCloseButton ?? true,\n }\n }\n\n const status =\n (type: ToastType): StatusFn =>\n (input) =>\n store.create(toData(input, type))\n\n const show = (input: NotifyInput) => store.create(toData(input))\n\n const update: NotifyUpdate = (id, input) => {\n const o = normalize(input)\n // Copy keys that are *present* (not just defined) so an explicit\n // `{ description: undefined }` clears the field rather than being ignored.\n // An omitted key leaves the current value untouched.\n const patch: Partial<ToastData> = {}\n for (const prop of NOTIFICATION_REMOVABLE_PROPS) {\n // TS can't correlate `prop` with `o[prop]`/`patch[prop]` across a union\n // key on writes (the target collapses to their intersection, `undefined`).\n // The prop list is constrained to keys shared by NotifyOptions & ToastData\n // with compatible value types, so this write is safe.\n if (prop in o) (patch as Record<string, unknown>)[prop] = o[prop]\n }\n store.update(id, patch)\n return id\n }\n\n const promise: NotifyPromise = (promise, messages) => {\n const id = generateId()\n const resolve = (input: NotifyStatusInput, type: ToastType) =>\n store.create(toData({ ...normalize(input), id }, type))\n status(\"loading\")({ ...normalize(messages.loading), id })\n const run = typeof promise === \"function\" ? promise() : promise\n run.then(\n (value) => {\n if (messages.success === undefined) return store.dismiss(id)\n resolve(\n typeof messages.success === \"function\" ? messages.success(value) : messages.success,\n \"success\",\n )\n },\n (error) => {\n if (messages.error === undefined) return store.dismiss(id)\n resolve(\n typeof messages.error === \"function\" ? messages.error(error) : messages.error,\n \"error\",\n )\n },\n )\n return { id, unwrap: () => run }\n }\n\n const notify = Object.assign(show, {\n success: status(\"success\"),\n error: status(\"error\"),\n warning: status(\"warning\"),\n info: status(\"info\"),\n loading: status(\"loading\"),\n promise,\n update,\n dismiss: store.dismiss,\n remove: store.remove,\n has: store.has,\n getToasts: () => store.getSnapshot().toasts,\n }) as Notify\n\n const Notifications = () => {\n const { toasts } = useSyncExternalStore(\n store.subscribe,\n store.getSnapshot,\n store.getServerSnapshot,\n )\n const [heights, setHeights] = useState<Record<string, number>>({})\n\n const onMeasure = useCallback((id: string, height: number) => {\n setHeights((prev) => (prev[id] === height ? prev : { ...prev, [id]: height }))\n }, [])\n\n // Pause auto-dismiss while the tab is hidden so toasts don't expire unseen.\n useEffect(() => {\n const onVisibility = () => (document.hidden ? store.pauseAll() : store.resumeAll())\n document.addEventListener(\"visibilitychange\", onVisibility)\n return () => document.removeEventListener(\"visibilitychange\", onVisibility)\n }, [])\n\n // Toasts are absolutely stacked; the collapsed deck (top-aligned peeks) and\n // the hover-expanded column are both derived in CSS (theme.css) from these\n // measured px vars. `offset` = Σ heights + gaps of the *newer* toasts in\n // front of this one (its position in the expanded column).\n const heightOf = (toast: ToastData) => heights[toast.id] ?? 0\n const frontHeight = toasts[0] ? heightOf(toasts[0]) : 0\n const items = toasts.map((toast, index) => ({\n toast,\n index,\n height: heightOf(toast),\n offset: toasts.slice(0, index).reduce((sum, newer) => sum + heightOf(newer) + GAP, 0),\n }))\n const expandedHeight =\n toasts.reduce((sum, toast) => sum + heightOf(toast), 0) + GAP * Math.max(0, toasts.length - 1)\n // A toast behind the front that's taller overflows *below* it (toward the\n // bottom edge) in bottom placements. That strip is a hit target collapsed,\n // but expanding slides it into the column as the stack grows the other way,\n // stranding the pointer over a gap → the deck blinks open/closed. Size a\n // stationary ghost hover-bridge under the front toast to cover the strip\n // (overestimates by the peek offsets, which is harmless — see theme.css).\n const maxHeight = toasts.reduce((max, toast) => Math.max(max, heightOf(toast)), 0)\n const stackOverflow = placement.startsWith(\"bottom\") ? Math.max(0, maxHeight - frontHeight) : 0\n\n const region = (\n <section\n aria-label=\"Notifications\"\n data-scope=\"notifications\"\n data-placement={placement}\n data-expand={expand ? \"\" : undefined}\n // Slide direction for the enter/exit keyframes: from below for bottom\n // placements, from above for top.\n style={{ [\"--toast-from\" as string]: placement.startsWith(\"top\") ? \"-100%\" : \"100%\" }}\n className={cn(\n \"pointer-events-none fixed z-(--toast-z,100) justify-center flex\",\n REGION_POSITION[placement],\n // Phones (< xs): pin to the bottom, full-bleed, above the safe area.\n \"max-xs:inset-x-0! max-xs:bottom-[calc(1rem+env(safe-area-inset-bottom))]! max-xs:top-auto! max-xs:translate-x-0!\",\n )}\n >\n {/* pointer-events-auto only on the stack, so the region never blocks the\n page. Hover here pauses timers + expands the deck (enter/leave don't\n fire when moving between toasts inside). */}\n <div\n data-part=\"stack\"\n onPointerEnter={() => store.pauseAll()}\n onPointerLeave={() => store.resumeAll()}\n style={{\n [\"--stack-collapsed-h\" as string]: `${frontHeight}px`,\n [\"--stack-expanded-h\" as string]: `${expandedHeight}px`,\n }}\n className=\"pointer-events-auto relative min-w-88 max-xs:min-w-0 max-w-[calc(100vw-2rem)] max-xs:w-screen\"\n >\n {items.map(({ toast, index, offset, height }) => (\n <ToasterItem\n key={toast.id}\n toast={toast}\n store={store}\n index={index}\n offset={offset}\n height={height}\n frontHeight={frontHeight}\n onMeasure={onMeasure}\n />\n ))}\n {/* The stationary ghost hover-bridge sized by `stackOverflow` above:\n an invisible hit-area glued just below the front toast so `:hover`\n on the stack stays put through the collapse↔expand morph (see\n theme.css). Nonzero only for bottom placements with overflow. */}\n {stackOverflow > 0 && (\n <span\n aria-hidden\n data-part=\"ghost\"\n style={{ [\"--ghost-h\" as string]: `${stackOverflow}px` }}\n />\n )}\n </div>\n </section>\n )\n\n if (!withinPortal) return region\n return <Portal container={container ? { current: container } : undefined}>{region}</Portal>\n }\n\n return { notify, Notifications }\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type HTMLArkProps } from "@ark-ui/react";
|
|
2
2
|
import { type ComponentPropsWithoutRef, type ReactNode, type Ref } from "react";
|
|
3
|
+
import type { ForbidAsChild } from "../../lib/as-child";
|
|
3
4
|
import type { Color } from "../../lib/colors";
|
|
4
5
|
import type { WithTestId } from "../../lib/test-id";
|
|
5
6
|
import type { ToastFields, ToastHue, ToastType } from "./types";
|
|
@@ -22,10 +23,10 @@ import type { ToastFields, ToastHue, ToastType } from "./types";
|
|
|
22
23
|
* Enter/exit is driven by Ark Presence → `data-state` → the `toast-in/out`
|
|
23
24
|
* keyframes (like modal/drawer/popover).
|
|
24
25
|
*/
|
|
25
|
-
/** The outline surface
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* the border, text and icon through `--c-solid`. */
|
|
26
|
+
/** The outline surface. Deliberately opaque and blurred: a toast floats over
|
|
27
|
+
* arbitrary content. `Alert` (the inline sibling) shares the parts but not
|
|
28
|
+
* this surface — it sits on the page and takes a translucent tint instead.
|
|
29
|
+
* `color` tints the border, text and icon through `--c-solid`. */
|
|
29
30
|
export declare const notificationSurface: string[];
|
|
30
31
|
/** The toast card. Enter/exit via `data-state` keyframes (Ark Presence sets
|
|
31
32
|
* `data-state`); stacking position via the `[data-scope=notifications]` rules
|
|
@@ -77,7 +78,7 @@ export declare const CollapseTrigger: ({ className, children, type, open, testId
|
|
|
77
78
|
* the Notifier-managed plumbing (`id` / `status` / `duration`) is optional, so a
|
|
78
79
|
* standalone card is just `<Notification type="success" title="Saved" />`.
|
|
79
80
|
*/
|
|
80
|
-
export type NotificationProps = Omit<NotificationRootProps, "title" | "color"> & Omit<ToastFields, "id" | "status" | "duration"> & Partial<Pick<ToastFields, "id" | "status" | "duration">> & ToastHue & {
|
|
81
|
+
export type NotificationProps = Omit<NotificationRootProps, "title" | "color" | "asChild"> & ForbidAsChild & Omit<ToastFields, "id" | "status" | "duration"> & Partial<Pick<ToastFields, "id" | "status" | "duration">> & ToastHue & {
|
|
81
82
|
/** Invoked when the close (×) button is pressed. */
|
|
82
83
|
onClose?: () => void;
|
|
83
84
|
/** Swap the close (×) button for a chevron that folds the description and
|
|
@@ -105,7 +106,7 @@ export type NotificationProps = Omit<NotificationRootProps, "title" | "color"> &
|
|
|
105
106
|
* `Notification.Root`, `.Icon`, `.Title`, `.Description`, `.ActionTrigger`,
|
|
106
107
|
* `.CloseTrigger`.
|
|
107
108
|
*/
|
|
108
|
-
declare function NotificationComponent({ type, title, description, action, color: _color, icon: _icon, withCloseButton, withCollapse, defaultOpen, open: _open, onOpenChange, onClose, status: _status, duration: _duration, ...rest }: NotificationProps): import("react").JSX.Element;
|
|
109
|
+
declare function NotificationComponent({ type, title, description, action, color: _color, icon: _icon, withCloseButton, withCollapse, defaultOpen, open: _open, onOpenChange, onClose, status: _status, duration: _duration, asChild: _asChild, ...rest }: NotificationProps): import("react").JSX.Element;
|
|
109
110
|
/**
|
|
110
111
|
* `Notification` — the ready-made card (batteries-included), with the compound
|
|
111
112
|
* parts attached for bespoke composition. Mirrors `Tooltip`/`Modal`: the bare
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../../src/components/notification/notification.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAStD,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,EAAU,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../../src/components/notification/notification.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAStD,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,EAAU,MAAM,OAAO,CAAA;AAEvF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAG7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAKnD,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAE/D;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;mEAGmE;AACnE,eAAO,MAAM,mBAAmB,UAG/B,CAAA;AAED;;;gDAGgD;AAChD,eAAO,MAAM,gBAAgB,oFAc3B,CAAA;AAEF;;;sEAGsE;AACtE,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,SAAS,EAAE;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,SAAS,CAAA;CAAE,CAM7E,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG,YAAY,CAAC,KAAK,CAAC,G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O,CAAA;IACrB,wDAAwD;IACxD,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,iDAAiD;IACjD,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;CACvC,CAAA;AAEH;;;;;;;;;;;;;GAaG;AACH,iBAAS,qBAAqB,CAAC,EAC7B,IAAI,EACJ,KAAK,EACL,WAAW,EACX,MAAM,EACN,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,KAAK,EACX,eAAsB,EACtB,YAAoB,EACpB,WAAW,EACX,IAAI,EAAE,KAAK,EACX,YAAY,EACZ,OAAO,EAEP,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,SAAS,EACnB,OAAO,EAAE,QAAQ,EACjB,GAAG,IAAI,EACR,EAAE,iBAAiB,+BAkDnB;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY;;;;;;;;CAQvB,CAAA"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import '../../chunk-R5GMMWAY.js';
|
|
3
|
-
export { NumberInput } from '../../chunk-
|
|
3
|
+
export { NumberInput } from '../../chunk-FZIHZT5R.js';
|
|
4
4
|
import '../../chunk-UVYTJQTJ.js';
|
|
5
|
-
import '../../chunk-
|
|
6
|
-
import '../../chunk-
|
|
7
|
-
import '../../chunk-
|
|
5
|
+
import '../../chunk-5OQLFX47.js';
|
|
6
|
+
import '../../chunk-FHG54IT5.js';
|
|
7
|
+
import '../../chunk-6GDMSENK.js';
|
|
8
8
|
import '../../chunk-AIQG7IIT.js';
|
|
9
9
|
import '../../chunk-7P32XCEU.js';
|
|
10
10
|
import '../../chunk-BUIHQJGE.js';
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Modal } from '../../chunk-
|
|
3
|
-
import { Drawer } from '../../chunk-
|
|
4
|
-
import { Button } from '../../chunk-
|
|
2
|
+
import { Modal } from '../../chunk-JITF6I7N.js';
|
|
3
|
+
import { Drawer } from '../../chunk-HAQJQFE6.js';
|
|
4
|
+
import { Button } from '../../chunk-RAUOFTUH.js';
|
|
5
5
|
import '../../chunk-AIQG7IIT.js';
|
|
6
6
|
import '../../chunk-7P32XCEU.js';
|
|
7
7
|
import '../../chunk-BUIHQJGE.js';
|
|
8
|
-
import '../../chunk-
|
|
8
|
+
import '../../chunk-S7N4LGLZ.js';
|
|
9
9
|
import '../../chunk-NSDM3FEB.js';
|
|
10
|
+
import '../../chunk-I4SQQIP5.js';
|
|
10
11
|
import '../../chunk-WYCMIIRR.js';
|
|
11
12
|
import '../../chunk-B2LCHXUB.js';
|
|
12
13
|
import { cn } from '../../chunk-QP4I37PA.js';
|