@42-central/ui-react 0.17.1 → 0.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/biome/no-gray-color.grit +18 -0
- 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-EVVMHTCL.js → chunk-EBREIC3L.js} +4 -3
- 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-YON5Y336.js → chunk-O23Y5ML4.js} +8 -8
- package/dist/{chunk-YON5Y336.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-6I4R3HR6.js → chunk-RQL7FVCS.js} +3 -3
- package/dist/{chunk-6I4R3HR6.js.map → chunk-RQL7FVCS.js.map} +1 -1
- 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-NSOA3GMZ.js → chunk-UHNRAI6V.js} +3 -3
- package/dist/{chunk-NSOA3GMZ.js.map → chunk-UHNRAI6V.js.map} +1 -1
- package/dist/{chunk-JBVFWSRQ.js → chunk-VIYVN4WF.js} +6 -4
- package/dist/chunk-VIYVN4WF.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-S53FHWNG.js → chunk-YWRBG23W.js} +3 -3
- package/dist/chunk-YWRBG23W.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/colors.css +12 -26
- 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 +1 -1
- package/dist/components/alert/alert.d.ts.map +1 -1
- package/dist/components/alert/index.js +16 -4
- 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/avatar/avatar.d.ts +3 -3
- package/dist/components/avatar/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/index.js +3 -2
- package/dist/components/chart/chart.d.ts +1 -1
- package/dist/components/chart/index.js +1 -1
- package/dist/components/chart/index.js.map +1 -1
- 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/index.js +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 +21 -20
- 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/mark/index.js +1 -1
- package/dist/components/mark/mark.d.ts +2 -2
- 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/index.js +4 -3
- package/dist/components/notification/index.js.map +1 -1
- package/dist/components/notification/notification.d.ts +3 -2
- 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 +2 -2
- package/dist/components/schedule/index.js +50 -23
- 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-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-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-toolbar.d.ts +1 -1
- package/dist/components/schedule/schedule-toolbar.d.ts.map +1 -1
- package/dist/components/schedule/schedule-types.d.ts +6 -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/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/theme-icon/index.js +1 -1
- 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/index.js +1 -1
- package/dist/lib/as-child.d.ts +104 -0
- package/dist/lib/as-child.d.ts.map +1 -0
- package/dist/lib/colors.d.ts +1 -1
- package/dist/lib/colors.d.ts.map +1 -1
- package/dist/theme.css +0 -33
- package/package.json +2 -1
- package/src/as-child.contract.test.tsx +809 -0
- package/src/biome-plugins.test.ts +61 -0
- package/src/colors.css +12 -26
- 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 +17 -0
- package/src/components/alert/alert.tsx +21 -2
- package/src/components/app-shell/app-shell.tsx +3 -1
- package/src/components/avatar/avatar.tsx +3 -3
- 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/chart/chart.test.tsx +1 -2
- package/src/components/chart/chart.tsx +1 -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/gutters.test.ts +2 -2
- 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/mark/mark.test.tsx +4 -4
- package/src/components/mark/mark.tsx +3 -3
- 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/notification.tsx +4 -1
- 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/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 +41 -28
- package/src/components/schedule/schedule-dates.test.ts +37 -52
- package/src/components/schedule/schedule-dates.ts +22 -25
- package/src/components/schedule/schedule-days-view.tsx +3 -1
- package/src/components/schedule/schedule-month-view.tsx +3 -1
- package/src/components/schedule/schedule-next-up.tsx +6 -2
- package/src/components/schedule/schedule-toolbar.test.tsx +26 -0
- package/src/components/schedule/schedule-toolbar.tsx +13 -1
- package/src/components/schedule/schedule-types.ts +6 -4
- package/src/components/schedule/schedule-views.ts +4 -5
- package/src/components/schedule/schedule-year-view.tsx +3 -1
- package/src/components/schedule/schedule.test.tsx +66 -22
- package/src/components/schedule/schedule.tsx +22 -13
- package/src/components/slider/slider.tsx +4 -0
- package/src/components/tabs/tabs-data.tsx +17 -14
- package/src/components/theme-icon/theme-icon.tsx +1 -1
- 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/lib/colors.ts +4 -2
- package/src/theme.css +0 -33
- 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-EVVMHTCL.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-JBVFWSRQ.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-S53FHWNG.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
package/src/theme.css
CHANGED
|
@@ -48,34 +48,6 @@
|
|
|
48
48
|
--color-gray-dark-900: #13161b;
|
|
49
49
|
--color-gray-dark-950: #0c0e12;
|
|
50
50
|
|
|
51
|
-
/* Gray Modern */
|
|
52
|
-
--color-gray-modern-25: #fcfcfd;
|
|
53
|
-
--color-gray-modern-50: #f8fafc;
|
|
54
|
-
--color-gray-modern-100: #eef2f6;
|
|
55
|
-
--color-gray-modern-200: #e3e8ef;
|
|
56
|
-
--color-gray-modern-300: #cdd5df;
|
|
57
|
-
--color-gray-modern-400: #9aa4b2;
|
|
58
|
-
--color-gray-modern-500: #697586;
|
|
59
|
-
--color-gray-modern-600: #4b5565;
|
|
60
|
-
--color-gray-modern-700: #364152;
|
|
61
|
-
--color-gray-modern-800: #202939;
|
|
62
|
-
--color-gray-modern-900: #121926;
|
|
63
|
-
--color-gray-modern-950: #0d121c;
|
|
64
|
-
|
|
65
|
-
/* Gray Blue */
|
|
66
|
-
--color-gray-blue-25: #fcfcfd;
|
|
67
|
-
--color-gray-blue-50: #f8f9fc;
|
|
68
|
-
--color-gray-blue-100: #eaecf5;
|
|
69
|
-
--color-gray-blue-200: #d5d9eb;
|
|
70
|
-
--color-gray-blue-300: #b3b8db;
|
|
71
|
-
--color-gray-blue-400: #717bbc;
|
|
72
|
-
--color-gray-blue-500: #4e5ba6;
|
|
73
|
-
--color-gray-blue-600: #3e4784;
|
|
74
|
-
--color-gray-blue-700: #363f72;
|
|
75
|
-
--color-gray-blue-800: #293056;
|
|
76
|
-
--color-gray-blue-900: #101323;
|
|
77
|
-
--color-gray-blue-950: #0d0f1c;
|
|
78
|
-
|
|
79
51
|
/* Gray True */
|
|
80
52
|
--color-gray-true-25: #fcfcfc;
|
|
81
53
|
--color-gray-true-50: #f7f7f7;
|
|
@@ -1274,8 +1246,3 @@ body {
|
|
|
1274
1246
|
|
|
1275
1247
|
/* Variants to use with slider's values */
|
|
1276
1248
|
@custom-variant state-under-or-at (&:is([data-state="under-value"], [data-state="at-value"]));
|
|
1277
|
-
|
|
1278
|
-
*,
|
|
1279
|
-
:root {
|
|
1280
|
-
@apply scrollbar-thumb-gray-300/60 hover:scrollbar-thumb-gray-300 dark:scrollbar-thumb-gray-500/60 dark:hover:scrollbar-thumb-gray-500 scrollbar-track-transparent;
|
|
1281
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/menu/menu.tsx"],"names":["ArkMenu"],"mappings":";;;;;;;;;;;;;;;;;AA4DA,IAAM,WAAA,GAAc,EAAA;AAAA,EAClB,aAAA;AAAA,EACA,kCAAA;AAAA,EACA;AACF,CAAA;AAQA,IAAM,QAAA,GAAW,GAAA;AAAA,EACf;AAAA,IACE,kFAAA;AAAA,IACA,0BAAA;AAAA,IACA,kCAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA;AAAA;AAAA;AAAA,QAIP,KAAA,EAAO;AAAA,UACL,6CAAA;AAAA,UACA;AAAA,SACF;AAAA;AAAA,QAEA,IAAA,EAAM,CAAC,iBAAA,EAAmB,gCAAgC;AAAA;AAC5D,KACF;AAAA,IACA,eAAA,EAAiB,EAAE,OAAA,EAAS,KAAA;AAAM;AAEtC,CAAA;AAMA,IAAM,WAAA,GAAc,2DAAA;AAYpB,IAAM,WAAA,GAAc,aAAA,CAAgC,EAAE,YAAA,EAAc,MAAM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A,EAAiB,QAAA,CAAS,SAAA,GAAY,MAAA,GAAY,QAAQ,eAAe,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAKzE,WAAA,EAAa,CAAC,KAAA,KAAqB,KAAA,CAAM,cAAA;AAAe,SAC1D;AAAA;AAAA;AAAA;AAAA;AAAA,QAKA,EAAE,GAAG,IAAA,EAAM,WAAW,EAAA,CAAG,aAAA,EAAe,SAAS,CAAA;AAAE,OACrD;AAAA,MACA;AAAA;AAAA,GACF;AAEJ;AAGO,IAAM,iBAAiBA,IAAA,CAAQ;AAC/B,IAAM,YAAYA,IAAA,CAAQ;AAC1B,IAAM,UAAUA,IAAA,CAAQ;AAExB,IAAM,SAAA,GAAY;AAElB,IAAM,UAAA,GAAa","file":"chunk-2762HZYX.js","sourcesContent":["\"use client\"\n\nimport { ark } from \"@ark-ui/react/factory\"\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport { Menu as ArkMenu, useMenuContext } from \"@ark-ui/react/menu\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { usePresenceContext } from \"@ark-ui/react/presence\"\nimport { mergeProps } from \"@ark-ui/react/utils\"\nimport { cva } from \"class-variance-authority\"\nimport {\n type ComponentPropsWithoutRef,\n createContext,\n type DragEvent,\n type ReactNode,\n type Ref,\n useContext,\n useId,\n} from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { useOverlayContainer } from \"../../lib/overlay-container\"\nimport { useNestedLayer } from \"../../lib/overlay-layer\"\nimport { type LogicalPosition, resolveLogicalPlacement } from \"../../lib/placement\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { CheckIcon, ChevronIcon } from \"../popover/icons\"\nimport {\n popoverChevron,\n popoverChrome,\n popoverGroupLabel,\n popoverIndicator,\n} from \"../popover/popover\"\n\n/**\n * Menu — the kit's dropdown of actions, a styled layer over Ark UI's Menu.\n * It's the click-triggered sibling of `Popover` (a free-form panel): Ark's Menu\n * machine wires roving focus, type-ahead, `role=\"menu\"` / `menuitem`,\n * `aria-haspopup` / `aria-expanded`, submenus, and checkbox / radio selection.\n *\n * Two ways to use it — the compound parts (this file) give full control; the\n * data-driven `<Menu data={…}>` convenience (see `menu-data.tsx`) covers the\n * common action-menu case and is built on these very parts.\n *\n * <Menu.Root>\n * <Menu.Trigger asChild><Button>Open</Button></Menu.Trigger>\n * <Menu.Content>\n * <Menu.Item startSection={<User />} onClick={openProfile}>Profile</Menu.Item>\n * <Menu.Divider />\n * <Menu.Item color=\"red\" startSection={<Trash />} onClick={remove}>Delete</Menu.Item>\n * </Menu.Content>\n * </Menu.Root>\n *\n * Portaled by default (escapes `overflow:hidden` ancestors), sized to content,\n * and animated via the kit's shared `popover-in/out` tokens.\n */\n\n/** Menu surface — the shared floating chrome, sized to content and scrollable\n * when tall. Unlike the form pickers' `popoverContent` (an `overflow-hidden`\n * clip around a nested scroller) a Menu scrolls natively, so Ark needs no\n * `scrollToIndexFn` workaround. */\nconst menuContent = cn(\n popoverChrome,\n \"flex w-max min-w-40 flex-col p-1\",\n \"max-h-[min(24rem,var(--available-height,24rem))] overflow-y-auto overscroll-contain\",\n)\n\n/** A single menu row — shared by `Item`, `CheckboxItem`, `RadioItem`, and\n * `SubTrigger` so every row is visually identical. Mirrors `popoverOption`'s\n * neutral look, but the `colored` variant swaps the text + highlight tints to\n * the palette slot vars (`--c-text` / `--c-soft`) resolved from `data-color` —\n * e.g. a red \"Delete\". Highlight is `data-highlighted`, selection is\n * `data-[state=checked]`, disabled is `data-disabled`, all owned by Ark. */\nconst menuItem = cva(\n [\n \"relative flex cursor-pointer items-center gap-2 rounded-xs px-2.5 py-1.5 text-md\",\n \"select-none outline-none\",\n \"data-[state=checked]:font-medium\",\n \"data-disabled:pointer-events-none data-disabled:opacity-50\",\n ],\n {\n variants: {\n colored: {\n // Neutral highlight is transparent — a low-opacity black/white wash,\n // not an opaque gray — matching the surface's own background-dependent\n // tint (no Figma reference for this state yet).\n false: [\n \"text-gray-light-900 dark:text-gray-dark-100\",\n \"data-highlighted:bg-black/5 dark:data-highlighted:bg-white/8\",\n ],\n // Slot vars already shift by theme (colors.css), so no `dark:` needed.\n true: [\"text-(--c-text)\", \"data-highlighted:bg-(--c-soft)\"],\n },\n },\n defaultVariants: { colored: false },\n },\n)\n\n/** Hairline between groups of items. Same shade as Popover's own\n * Header/Footer/Body slotEdge dividers (brand-900/20 / white/15) — both are\n * separator lines on the identical popoverChrome panel, so they shouldn't\n * drift to different weights. */\nconst menuDivider = \"-mx-1 my-1 h-px border-0 bg-brand-900/20 dark:bg-white/15\"\n\ntype MenuPlacement = NonNullable<NonNullable<ArkMenu.RootProps[\"positioning\"]>[\"placement\"]>\n\n/** `position` accepts Ark's physical placements plus the logical, RTL-aware\n * horizontal sides `start` / `end` (resolved to `left` / `right` by direction). */\nexport type MenuPosition = LogicalPosition<MenuPlacement>\n\ntype MenuContextValue = {\n withinPortal: boolean\n container?: HTMLElement | null\n}\nconst MenuContext = createContext<MenuContextValue>({ withinPortal: true })\n\nexport type MenuRootProps = Omit<ArkMenu.RootProps, \"positioning\" | \"onOpenChange\"> & {\n /** Dropdown placement relative to the trigger. Prefer the logical `start` / `end`\n * sides (RTL-aware), or use any Ark placement (`bottom-start`, `top`, …).\n * Defaults to `\"bottom-start\"`. */\n position?: MenuPosition\n /** Gap in px between the trigger and the dropdown. */\n offset?: number\n /** Render the dropdown in a Portal so it escapes clipping ancestors. Default `true`. */\n withinPortal?: boolean\n /** Portal target. Defaults to the enclosing `Modal`/`Drawer` when there is\n * one (so the panel stays above it), else `document.body`. */\n container?: HTMLElement | null\n /** Called when the menu opens or closes (flattened from Ark's detail object). */\n onOpenChange?: (open: boolean) => void\n /** Fires on close (any source) — Escape, outside interaction, item selection, or a controlled `onOpenChange`. */\n onClose?: () => void\n}\n\nconst Root = ({\n position = \"bottom\",\n offset,\n withinPortal = true,\n container,\n onOpenChange,\n onClose,\n children,\n ...rest\n}: MenuRootProps) => {\n const { dir } = useLocaleContext()\n return (\n <MenuContext.Provider value={{ withinPortal, container }}>\n <ArkMenu.Root\n positioning={{ placement: resolveLogicalPlacement(position, dir), gutter: offset }}\n onOpenChange={({ open }) => {\n onOpenChange?.(open)\n if (!open) onClose?.()\n }}\n {...rest}\n >\n {children}\n </ArkMenu.Root>\n </MenuContext.Provider>\n )\n}\n\nexport type MenuContentProps = ArkMenu.ContentProps & WithTestId\n\nconst Content = ({ className, children, testId, ...rest }: MenuContentProps) => {\n const { withinPortal, container } = useContext(MenuContext)\n const portalContainer = useOverlayContainer(container)\n // Holds an enclosing Modal/Drawer/Popover open while the menu is; see `lib/overlay-layer.tsx`.\n useNestedLayer(useMenuContext().open)\n const panel = (\n <ArkMenu.Positioner>\n <ArkMenu.Content\n className={cn(menuContent, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {children}\n </ArkMenu.Content>\n </ArkMenu.Positioner>\n )\n if (!withinPortal) return panel\n return <Portal container={portalContainer}>{panel}</Portal>\n}\n\n/** Shared inline-start wrapper for a `startSection`. Sizes a bare icon to 16px\n * (`size-4`, like Button `md` / Input / Accordion) so every row's label starts\n * on the same column whatever icon it carries. Scoped to this slot — not the\n * whole row — so SVGs in `children` / `endSection` and the row's own indicator\n * or chevron keep their sizes. `:where()` drops the rule to zero class\n * specificity, so a size class on the icon itself (`className=\"size-5\"`) still\n * wins; Lucide's `size` prop is only an HTML attribute and does not. */\nconst StartSection = ({ children }: { children: ReactNode }) => (\n <span className=\"inline-flex shrink-0 items-center [:where(&)_svg]:size-4\">{children}</span>\n)\n\n/** Shared inline-end wrapper for a `endSection` (pushes it to the far edge). */\nconst EndSection = ({ children }: { children: ReactNode }) => (\n <span className=\"ms-auto inline-flex shrink-0 items-center gap-2 text-gray-light-500 dark:text-gray-dark-400\">\n {children}\n </span>\n)\n\nexport type MenuItemProps = Omit<ArkMenu.ItemProps, \"value\" | \"onClick\" | \"onSelect\"> &\n WithTestId & {\n /** Unique value — used for type-ahead + the selection detail. Auto-generated\n * when omitted (Mantine-style items need no explicit value). */\n value?: string\n /** Content before the label (usually an icon — a bare SVG is sized to 16px;\n * a size class on the icon overrides it). */\n startSection?: ReactNode\n /** Content after the label, pushed to the inline-end. */\n endSection?: ReactNode\n /** Palette for the row — colors the label + highlight tint (e.g. `\"red\"` for a\n * destructive action). Resolved from `data-color` via the slot vars. */\n color?: Color\n /** Fires when the item is selected — on click *and* keyboard activation\n * (Enter / Space), not just a pointer click. Wraps Ark's `onSelect`. */\n onClick?: () => void\n }\n\nconst Item = ({\n value,\n startSection,\n endSection,\n color,\n onClick,\n className,\n children,\n testId,\n ...rest\n}: MenuItemProps) => {\n const autoId = useId()\n return (\n <ArkMenu.Item\n value={value ?? autoId}\n onSelect={onClick}\n data-color={color}\n className={cn(menuItem({ colored: color != null }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {startSection != null && <StartSection>{startSection}</StartSection>}\n {children}\n {endSection != null && <EndSection>{endSection}</EndSection>}\n </ArkMenu.Item>\n )\n}\n\n/** Optional decorative leader for a section heading — the code-themed `// ` from\n * `Text`'s `prefix`. Hidden from screen readers and the clipboard\n * (`aria-hidden` + `select-none`); renders nothing when unset (off by default). */\nconst HeadingPrefix = ({ prefix }: { prefix: ReactNode }) =>\n prefix === undefined ? null : (\n <span aria-hidden=\"true\" className=\"select-none\">\n {prefix}\n </span>\n )\n\nexport type MenuLabelProps = Omit<ComponentPropsWithoutRef<\"div\">, \"prefix\"> &\n WithTestId & {\n /** Decorative leader before the label (e.g. `\"// \"`). Off by default; hidden\n * from screen readers and the clipboard. */\n prefix?: ReactNode\n }\n\n/** Standalone section heading (Mantine parity). For grouped items with proper\n * ARIA wiring, prefer `Menu.ItemGroup` + `Menu.ItemGroupLabel`. */\nconst Label = ({ className, prefix, children, testId, ...rest }: MenuLabelProps) => (\n <div className={cn(popoverGroupLabel, className)} {...props({ \"data-testid\": testId })} {...rest}>\n <HeadingPrefix prefix={prefix} />\n {children}\n </div>\n)\n\nexport type MenuItemGroupLabelProps = Omit<ArkMenu.ItemGroupLabelProps, \"prefix\"> &\n WithTestId & {\n /** Decorative leader before the label (e.g. `\"// \"`). Off by default; hidden\n * from screen readers and the clipboard. */\n prefix?: ReactNode\n }\n\nconst ItemGroupLabel = ({\n className,\n prefix,\n children,\n testId,\n ...rest\n}: MenuItemGroupLabelProps) => (\n <ArkMenu.ItemGroupLabel\n className={cn(popoverGroupLabel, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n <HeadingPrefix prefix={prefix} />\n {children}\n </ArkMenu.ItemGroupLabel>\n)\n\nconst Divider = ({ className, testId, ...rest }: ArkMenu.SeparatorProps & WithTestId) => (\n <ArkMenu.Separator\n className={cn(menuDivider, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type MenuCheckboxItemProps = ArkMenu.CheckboxItemProps &\n WithTestId & {\n startSection?: ReactNode\n color?: Color\n }\n\nconst CheckboxItem = ({\n startSection,\n color,\n className,\n children,\n testId,\n ...rest\n}: MenuCheckboxItemProps) => (\n <ArkMenu.CheckboxItem\n data-color={color}\n className={cn(menuItem({ colored: color != null }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {startSection != null && <StartSection>{startSection}</StartSection>}\n {children}\n <ArkMenu.ItemIndicator className={popoverIndicator}>\n <CheckIcon />\n </ArkMenu.ItemIndicator>\n </ArkMenu.CheckboxItem>\n)\n\nexport type MenuRadioGroupProps = Omit<\n ArkMenu.RadioItemGroupProps,\n \"onValueChange\" | \"onChange\"\n> & {\n /** Called with the newly selected value (flattened from Ark's detail object). */\n onChange?: (value: string) => void\n}\n\nconst RadioGroup = ({ onChange, ...rest }: MenuRadioGroupProps) => (\n <ArkMenu.RadioItemGroup\n onValueChange={onChange ? ({ value }) => onChange(value) : undefined}\n {...rest}\n />\n)\n\nexport type MenuRadioItemProps = ArkMenu.RadioItemProps &\n WithTestId & {\n startSection?: ReactNode\n color?: Color\n }\n\nconst RadioItem = ({\n startSection,\n color,\n className,\n children,\n testId,\n ...rest\n}: MenuRadioItemProps) => (\n <ArkMenu.RadioItem\n data-color={color}\n className={cn(menuItem({ colored: color != null }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {startSection != null && <StartSection>{startSection}</StartSection>}\n {children}\n <ArkMenu.ItemIndicator className={popoverIndicator}>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className=\"lucide lucide-dot-big\"\n aria-hidden=\"true\"\n >\n <title>Dot big</title>\n <circle cx=\"12.1\" cy=\"12.1\" r=\"4\"></circle>\n </svg>\n </ArkMenu.ItemIndicator>\n </ArkMenu.RadioItem>\n)\n\nexport type MenuSubProps = Omit<ArkMenu.RootProps, \"positioning\"> & {\n /** Gap in px between the trigger row and the submenu. Ark manages submenu\n * *placement* itself (RTL-aware `right-start` / `left-start`, flush to the\n * parent), so only this main-axis gap is adjustable. Defaults to `10`. */\n offset?: number\n}\n\n/** A submenu opens flush to its trigger row, so its first item lands one surface\n * inset *below* the trigger — the `menuContent` top border (1px) + top padding\n * (`p-1` = 4px). Nudging the submenu up by that inset lines the first sub-item\n * up with the trigger row. Cross-axis is the vertical axis for the (Ark-forced)\n * `right-start` / `left-start` placements, and Floating UI maps a negative value\n * to \"up\" in both directions — so one constant covers LTR and RTL. */\nconst SUBMENU_ALIGN_OFFSET = -5\n\n/** Submenu root — a nested Ark Menu whose triggering row is `Menu.SubTrigger`.\n * Inherits the parent's portal settings via context (see `Menu.SubContent`).\n *\n * Ark's menu machine hard-overrides a submenu's placement and `gutter` (to `0`),\n * so a `gutter`-based offset is silently dropped. It leaves `offset` untouched,\n * and Floating UI resolves the axes as `offset.mainAxis ?? gutter` (the gap) and\n * `offset.crossAxis` (the top alignment) — so the whole `offset` object is the\n * one path that survives the override. */\nconst Sub = ({ offset = 10, children, ...rest }: MenuSubProps) => (\n <ArkMenu.Root\n positioning={{ offset: { mainAxis: offset, crossAxis: SUBMENU_ALIGN_OFFSET } }}\n {...rest}\n >\n {children}\n </ArkMenu.Root>\n)\n\nexport type MenuSubTriggerProps = ArkMenu.TriggerItemProps &\n WithTestId & {\n startSection?: ReactNode\n color?: Color\n }\n\nconst SubTrigger = ({\n startSection,\n color,\n className,\n children,\n testId,\n ...rest\n}: MenuSubTriggerProps) => (\n <ArkMenu.TriggerItem\n data-color={color}\n className={cn(menuItem({ colored: color != null }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {startSection != null && <StartSection>{startSection}</StartSection>}\n {children}\n <span className={cn(popoverChevron, \"ms-auto -me-1 -rotate-90 rtl:rotate-90 [&_svg]:size-4\")}>\n <ChevronIcon />\n </span>\n </ArkMenu.TriggerItem>\n)\n\nexport {\n CheckboxItem,\n Content,\n Divider,\n Item,\n ItemGroupLabel,\n Label,\n RadioGroup,\n RadioItem,\n Root,\n Sub,\n SubTrigger,\n}\n\nexport type MenuTriggerProps = ArkMenu.TriggerProps & { ref?: Ref<HTMLButtonElement> }\n\n/** Ark's `Menu.Trigger` minus one handler. Zag's trigger calls `preventDefault()`\n * on `pointerdown`, which cancels the browser's own mouse-down focus of the\n * button. With no pointer-initiated focus on record, Chromium treats every\n * later *programmatic* focus as keyboard-like: Zag's `focus()` on the content\n * when the menu opens, and its `focus()` back on the trigger when it closes,\n * both match `:focus-visible`, so a mouse user gets the keyboard ring on the\n * trigger after every menu interaction (#227).\n *\n * Leaving `pointerdown` alone restores the platform behaviour — the click\n * focuses the button without a ring, and the programmatic focuses that follow\n * inherit that. Keyboard users keep the ring, since a Tab/Enter/Escape still\n * marks the focus as keyboard-driven. It's also how Zag's own Popover trigger\n * behaves (it never cancels `pointerdown`). */\nexport const Trigger = ({ ref, value, className, ...rest }: MenuTriggerProps) => {\n const menu = useMenuContext()\n const presence = usePresenceContext()\n const { onPointerDown: _cancelsNativeFocus, ...trigger } = menu.getTriggerProps({ value })\n return (\n <ark.button\n {...mergeProps(\n {\n ...trigger,\n \"aria-controls\": presence.unmounted ? undefined : trigger[\"aria-controls\"],\n // The canceled `pointerdown` also blocked a native drag as a side\n // effect: an `asChild` `<a href>`, or the `<img>` of an avatar\n // trigger, would otherwise lift a drag ghost off the trigger.\n // Canceling `dragstart` instead leaves the press, and its focus, alone.\n onDragStart: (event: DragEvent) => event.preventDefault(),\n },\n // Same side effect for text: a double-click or drag on a non-button\n // trigger (`asChild` + `<span role=\"button\">`) would select its label.\n // CSS restores that. It lands on the `asChild` child too, and the\n // consumer's `className` comes last so it can override it.\n { ...rest, className: cn(\"select-none\", className) },\n )}\n ref={ref}\n />\n )\n}\n\n/** Ark parts re-exported unchanged (no styling needed). */\nexport const ContextTrigger = ArkMenu.ContextTrigger\nexport const ItemGroup = ArkMenu.ItemGroup\nexport const Context = ArkMenu.Context\n/** Alias for `Divider` (Ark's name for the same part). */\nexport const Separator = Divider\n/** Submenu dropdown — identical surface + portalling to `Menu.Content`. */\nexport const SubContent = Content\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/drawer/drawer.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;AAgCA,IAAM,kBAAA,GAAqB;AAAA,EACzB,KAAA,EAAO,OAAA;AAAA,EACP,GAAA,EAAK,KAAA;AAAA,EACL,GAAA,EAAK,IAAA;AAAA,EACL,MAAA,EAAQ;AACV,CAAA;AAEA,IAAM,QAAA,GAAW,CAAC,CAAA,KAAuB,CAAA,KAAM,WAAW,CAAA,KAAM,KAAA;AAGhE,IAAM,WAAA,GAAoC;AAAA,EACxC,EAAA,EAAI,WAAA;AAAA,EACJ,EAAA,EAAI,WAAA;AAAA,EACJ,EAAA,EAAI,WAAA;AAAA,EACJ,EAAA,EAAI,WAAA;AAAA,EACJ,EAAA,EAAI;AACN,CAAA;AACA,IAAM,UAAA,GAAmC;AAAA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AACd,MAAA,CAAO,MAAA,GAAS,YAAA","file":"chunk-2H46IXW4.js","sourcesContent":["\"use client\"\n\nimport { Drawer as Ark } from \"@ark-ui/react/drawer\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { cva } from \"class-variance-authority\"\nimport { X } from \"lucide-react\"\nimport { type ComponentPropsWithoutRef, type ReactNode, useRef } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { OverlayContainerProvider } from \"../../lib/overlay-container\"\nimport { OverlayLayerProvider, useLayerGuard } from \"../../lib/overlay-layer\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { ActionIcon } from \"../action-icon/action-icon\"\n\n/**\n * Drawer — edge-anchored panel on top of Ark UI's Drawer state machine. Ark\n * owns swipe-to-dismiss, snap points, focus-trap, scroll-lock and the\n * `data-state=\"open|closed\"` attribute; this wrapper adds an RTL-aware\n * `placement` prop (Ark has none) by writing `data-placement` on the positioner\n * + content and deriving Ark's logical `swipeDirection`. Docking, sizing and\n * the slide animation are pure CSS keyed on `[data-placement]` (see\n * `theme.css`), so `start`/`end` flip automatically under `dir=\"rtl\"`.\n *\n * Mirrors `Modal`'s dual API: high-level `<Drawer open placement size … >` plus\n * low-level parts (`Drawer.Root`, `Drawer.Content`, …). Padding flows through\n * the `--drawer-px` CSS var.\n */\n\nexport type DrawerPlacement = \"start\" | \"end\" | \"top\" | \"bottom\"\n\n/** placement → Ark logical swipe axis (RTL handled by Ark for start/end). */\nconst PLACEMENT_TO_SWIPE = {\n start: \"start\",\n end: \"end\",\n top: \"up\",\n bottom: \"down\",\n} as const\n\nconst isInline = (p: DrawerPlacement) => p === \"start\" || p === \"end\"\n\n/** Inline placements size on width; block placements size on height. */\nconst INLINE_SIZE: Record<Size, string> = {\n xs: \"w-[18rem]\",\n sm: \"w-[22rem]\",\n md: \"w-[28rem]\",\n lg: \"w-[34rem]\",\n xl: \"w-[42rem]\",\n}\nconst BLOCK_SIZE: Record<Size, string> = {\n xs: \"h-[30dvh]\",\n sm: \"h-[40dvh]\",\n md: \"h-[55dvh]\",\n lg: \"h-[70dvh]\",\n xl: \"h-[85dvh]\",\n}\n\nconst PADDING: Record<Size, string> = {\n xs: \"0.75rem\",\n sm: \"1rem\",\n md: \"1.25rem\",\n lg: \"1.5rem\",\n xl: \"2rem\",\n}\n\nconst drawerBackdrop = cva([\n \"fixed inset-0 z-[calc(var(--modal-z,150)+var(--layer-index,0))] bg-black/50 backdrop-blur-lg\",\n \"data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out\",\n])\n\nconst drawerPositioner = cva(\n \"fixed inset-0 z-[calc(var(--modal-z,150)+var(--layer-index,0))] flex\",\n {\n variants: {\n placement: {\n start: \"items-stretch justify-start\",\n end: \"items-stretch justify-end\",\n top: \"items-start justify-stretch\",\n bottom: \"items-end justify-stretch\",\n },\n },\n defaultVariants: { placement: \"end\" },\n },\n)\n\nexport type DrawerPositionerProps = ComponentPropsWithoutRef<typeof Ark.Positioner>\n\n/** Publishes itself as the portal target for any overlay opened inside the\n * drawer, so a Menu/Select/DatePicker in a drawer body stays above the panel\n * instead of behind it. See `lib/overlay-container.tsx`. */\nconst DrawerPositioner = ({ children, ...rest }: DrawerPositionerProps) => {\n const positioner = useRef<HTMLDivElement>(null)\n return (\n <Ark.Positioner ref={positioner} {...rest}>\n <OverlayContainerProvider value={positioner}>{children}</OverlayContainerProvider>\n </Ark.Positioner>\n )\n}\n\nconst drawerContent = cva([\n \"relative flex flex-col overflow-hidden\",\n \"bg-brand-50 text-gray-light-900 shadow-2xl\",\n \"dark:bg-brand-950 dark:text-gray-dark-25\",\n \"focus:outline-none\",\n // border on the docked edge only — keyed by data-placement in theme.css\n \"data-[placement=start]:border-e data-[placement=end]:border-s\",\n \"data-[placement=top]:border-b data-[placement=bottom]:border-t\",\n \"border-brand-900/20 dark:border-white/15\",\n \"data-[state=open]:animate-drawer-in data-[state=closed]:animate-drawer-out\",\n])\n\n// ---------------------------------------------------------------------------\n// Low-level parts\n// ---------------------------------------------------------------------------\n\nexport type DrawerRootProps = ComponentPropsWithoutRef<typeof Ark.Root>\n\n/** Ark's root, plus the nested-layer guard: while a picker opened inside the\n * drawer is open, an outside click closes the picker only, not the drawer\n * under it. See `lib/overlay-layer.tsx`. */\nexport const DrawerRoot = ({ onPointerDownOutside, children, ...rest }: DrawerRootProps) => {\n const guard = useLayerGuard(onPointerDownOutside)\n return (\n <Ark.Root onPointerDownOutside={guard.onPointerDownOutside} {...rest}>\n <OverlayLayerProvider value={guard.layers}>{children}</OverlayLayerProvider>\n </Ark.Root>\n )\n}\nexport const DrawerTrigger = Ark.Trigger\nexport const DrawerContext = Ark.Context\n\nexport type DrawerBackdropProps = ComponentPropsWithoutRef<typeof Ark.Backdrop> & WithTestId\n\nexport const DrawerBackdrop = ({ className, testId, ...rest }: DrawerBackdropProps) => (\n <Ark.Backdrop\n className={cn(drawerBackdrop(), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type DrawerTitleProps = ComponentPropsWithoutRef<typeof Ark.Title> & WithTestId\n\nexport const DrawerTitle = ({ className, testId, ...rest }: DrawerTitleProps) => (\n <Ark.Title\n className={cn(\"text-lg font-semibold leading-tight\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type DrawerDescriptionProps = ComponentPropsWithoutRef<typeof Ark.Description> & WithTestId\n\nexport const DrawerDescription = ({ className, testId, ...rest }: DrawerDescriptionProps) => (\n <Ark.Description\n className={cn(\"text-sm text-gray-light-500 dark:text-gray-dark-400\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type DrawerCloseTriggerProps = ComponentPropsWithoutRef<typeof Ark.CloseTrigger> &\n WithTestId & {\n \"aria-label\"?: string\n }\n\nexport const DrawerCloseTrigger = ({\n children,\n className,\n \"aria-label\": ariaLabel = \"Close\",\n testId,\n ...rest\n}: DrawerCloseTriggerProps) => (\n <Ark.CloseTrigger asChild {...rest}>\n <ActionIcon\n variant=\"subtle\"\n color=\"neutral\"\n size=\"sm\"\n aria-label={ariaLabel}\n className={className}\n testId={testId}\n >\n {children ?? <X />}\n </ActionIcon>\n </Ark.CloseTrigger>\n)\n\nexport type DrawerGrabberProps = ComponentPropsWithoutRef<typeof Ark.Grabber> & WithTestId\n\nexport const DrawerGrabber = ({ className, testId, ...rest }: DrawerGrabberProps) => (\n <Ark.Grabber\n className={cn(\n \"flex shrink-0 cursor-grab touch-none items-center justify-center py-2\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n <Ark.GrabberIndicator className=\"h-1.5 w-20 rounded-full bg-gray-light-300 dark:bg-gray-dark-700\" />\n </Ark.Grabber>\n)\n\nexport type DrawerHeaderProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\nexport const DrawerHeader = ({ className, testId, ...rest }: DrawerHeaderProps) => (\n <div\n className={cn(\n \"flex items-start justify-between gap-4 px-(--drawer-px,1.25rem) pt-(--drawer-px,1.25rem) pb-3\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type DrawerBodyProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\nexport const DrawerBody = ({ className, testId, ...rest }: DrawerBodyProps) => (\n <div\n className={cn(\"flex-1 overflow-y-auto px-(--drawer-px,1.25rem) py-1\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type DrawerFooterProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\nexport const DrawerFooter = ({ className, testId, ...rest }: DrawerFooterProps) => (\n <div\n className={cn(\n \"flex items-center justify-end gap-2 px-(--drawer-px,1.25rem) pb-(--drawer-px,1.25rem) pt-4\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\n// ---------------------------------------------------------------------------\n// High-level props-driven Drawer\n// ---------------------------------------------------------------------------\n\ntype ArkRootProps = ComponentPropsWithoutRef<typeof Ark.Root>\n\nexport type DrawerClassNames = Partial<\n Record<\n | \"backdrop\"\n | \"positioner\"\n | \"content\"\n | \"header\"\n | \"title\"\n | \"description\"\n | \"body\"\n | \"grabber\"\n | \"closeButton\",\n string\n >\n>\n\nexport type DrawerProps = Omit<\n ArkRootProps,\n \"open\" | \"defaultOpen\" | \"onOpenChange\" | \"children\" | \"swipeDirection\"\n> &\n WithTestId & {\n /** Controlled open state. */\n open?: boolean\n /** Uncontrolled initial open state. */\n defaultOpen?: boolean\n /** Fires with the next open state. Flattened from Ark's `{ open }`. */\n onOpenChange?: (open: boolean) => void\n /** Fires on close (any source) — Escape, backdrop click, swipe, or a controlled `onOpenChange`. */\n onClose?: () => void\n /** RTL-aware docking edge. @default \"end\" */\n placement?: DrawerPlacement\n size?: Size\n title?: ReactNode\n description?: ReactNode\n /** Render the default close button in the header. @default true */\n withCloseButton?: boolean\n /** Show the drag grabber handle. @default false */\n withGrabber?: boolean\n /**\n * Render the dimming backdrop. Set `false` when an ancestor (e.g. the modals\n * manager) draws a single shared backdrop for the whole overlay stack.\n * @default true\n */\n withBackdrop?: boolean\n /** Inner padding token; sets `--drawer-px`. @default \"md\" */\n padding?: Size\n closeOnEscape?: boolean\n closeOnInteractOutside?: boolean\n /** Fires after the exit animation completes — the manager unmounts on this. */\n onExitComplete?: () => void\n /** Portal target. Defaults to `document.body`. */\n container?: HTMLElement | null\n children?: ReactNode\n className?: string\n classNames?: DrawerClassNames\n }\n\nexport const Drawer = ({\n open,\n defaultOpen,\n onOpenChange,\n onClose,\n placement = \"end\",\n size = \"md\",\n title,\n description,\n withCloseButton = true,\n withGrabber = false,\n withBackdrop = true,\n padding = \"md\",\n closeOnEscape,\n closeOnInteractOutside,\n onExitComplete,\n container,\n children,\n className,\n classNames,\n testId,\n ...rest\n}: DrawerProps) => {\n const hasHeader = title != null || description != null || withCloseButton\n const sizeClass = isInline(placement)\n ? `${INLINE_SIZE[size]} h-full max-w-[90vw]`\n : `${BLOCK_SIZE[size]} w-full max-h-[90dvh]`\n\n return (\n <DrawerRoot\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={({ open: next }) => {\n onOpenChange?.(next)\n if (!next) onClose?.()\n }}\n swipeDirection={PLACEMENT_TO_SWIPE[placement]}\n closeOnEscape={closeOnEscape}\n closeOnInteractOutside={closeOnInteractOutside}\n // Unmount the whole content tree (incl. the `fixed inset-0` positioner)\n // on close — otherwise the positioner lingers as a transparent overlay\n // that swallows page clicks. `lazyMount` keeps it out of the DOM until\n // first open.\n lazyMount\n unmountOnExit\n modal={withBackdrop}\n onExitComplete={onExitComplete}\n {...rest}\n >\n <Portal container={container ? { current: container } : undefined}>\n {withBackdrop && <DrawerBackdrop className={classNames?.backdrop} />}\n <DrawerPositioner\n data-placement={placement}\n className={cn(drawerPositioner({ placement }), classNames?.positioner)}\n >\n <Ark.Content\n data-placement={placement}\n style={{ [\"--drawer-px\" as string]: PADDING[padding] }}\n className={cn(drawerContent(), sizeClass, className, classNames?.content)}\n {...props({ \"data-testid\": testId })}\n >\n {withGrabber && <DrawerGrabber className={classNames?.grabber} />}\n {hasHeader && (\n <DrawerHeader className={classNames?.header}>\n <div className=\"flex flex-col gap-1\">\n {title != null && (\n <DrawerTitle className={classNames?.title}>{title}</DrawerTitle>\n )}\n {description != null && (\n <DrawerDescription className={classNames?.description}>\n {description}\n </DrawerDescription>\n )}\n </div>\n {withCloseButton && <DrawerCloseTrigger className={classNames?.closeButton} />}\n </DrawerHeader>\n )}\n <DrawerBody\n className={cn(\n !hasHeader && !withGrabber && \"pt-(--drawer-px,1.25rem)\",\n \"pb-(--drawer-px,1.25rem)\",\n classNames?.body,\n )}\n >\n {children}\n </DrawerBody>\n </Ark.Content>\n </DrawerPositioner>\n </Portal>\n </DrawerRoot>\n )\n}\n\nDrawer.Root = DrawerRoot\nDrawer.Trigger = DrawerTrigger\nDrawer.Context = DrawerContext\nDrawer.Backdrop = DrawerBackdrop\nDrawer.Positioner = DrawerPositioner\nDrawer.Title = DrawerTitle\nDrawer.Description = DrawerDescription\nDrawer.CloseTrigger = DrawerCloseTrigger\nDrawer.Grabber = DrawerGrabber\nDrawer.Header = DrawerHeader\nDrawer.Body = DrawerBody\nDrawer.Footer = DrawerFooter\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/tooltip/tooltip.tsx"],"names":["ArkTooltip"],"mappings":";;;;;;;;;;;;;AAmDA,IAAM,cAAA,GAAiB,EAAA;AAAA,EACrB,oCAAA;AAAA,EACA,yCAAA;AAAA,EACA,oFAAA;AAAA,EACA,8EAAA;AAAA,EACA,yEAAA;AAAA,EACA;AACF,CAAA;AAWA,IAAM,iBAAA,GAAoB,sBAAA;AAK1B,IAAM,YAAA,GAAe,EAAA,CAAG,mBAAA,EAAqB,2CAA2C,CAAA;AAKxF,IAAM,cAAA,GAAiB,GAAA;AAAA,EACrB;AAAA,IACE,gEAAA;AAAA,IACA,6BAAA;AAAA,IACA,WAAA,EAAY;AAAA,IACZ;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,IAAA,EAAM,4FAAA;AAAA,QACN,MAAA,EAAQ;AAAA;AACV,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,OAAA,EAAS;AAAA;AACX;AAEJ,CAAA;AAYA,IAAM,cAAA,GAAiB,aAAA,CAAmC,EAAE,YAAA,EAAc,MAAM,CAAA;AAkBhF,IAAM,OAAO,CAAC;AAAA,EACZ,QAAA,GAAW,KAAA;AAAA,EACX,MAAA;AAAA,EACA,YAAA,GAAe,IAAA;AAAA,EACf,SAAA;AAAA,EACA,QAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,GAAG;AACL,CAAA,KAAwB;AACtB,EAAA,MAAM,EAAE,GAAA,EAAI,GAAI,gBAAA,EAAiB;AACjC,EAAA,uBACE,GAAA,CAAC,eAAe,QAAA,EAAf,EAAwB,OAAO,EAAE,YAAA,EAAc,WAAU,E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AQ,MAAA,EAC9C,QAAA,EAAA;AAAA,MAAA,SAAA,oBAAa,GAAA,CAAC,KAAA,EAAA,EAAM,SAAA,EAAW,UAAA,EAAY,KAAA,EAAO,CAAA;AAAA,MAClD;AAAA,KAAA,EACH;AAAA,GAAA,EACF,CAAA;AAEJ,CAAA;AAEO,IAAM,OAAA,GAAU,MAAA,CAAO,MAAA,CAAO,gBAAA,EAAkB;AAAA,EACrD,IAAA;AAAA,EACA,SAASA,SAAA,CAAW,OAAA;AAAA,EACpB,OAAA;AAAA,EACA;AACF,CAAC","file":"chunk-6SWK4XG5.js","sourcesContent":["\"use client\"\n\nimport { useLocaleContext } from \"@ark-ui/react/locale\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { Tooltip as ArkTooltip } from \"@ark-ui/react/tooltip\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { createContext, type ReactNode, useContext, useId } from \"react\"\nimport { match } from \"ts-pattern\"\nimport { cn } from \"../../lib/cn\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { useOverlayContainer } from \"../../lib/overlay-container\"\nimport { type LogicalPosition, resolveLogicalPlacement } from \"../../lib/placement\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\n\n/**\n * Tooltip — the kit's hover/focus **hint**, a styled layer over Ark UI's\n * Tooltip. It's the lightweight counterpart to `Popover` (which is a clickable,\n * focus-trapping panel): Ark's Tooltip machine opens on hover *and* keyboard\n * focus, wires `role=\"tooltip\"` + `aria-describedby` automatically, dismisses on\n * `Esc` / scroll / pointer-down, and never traps focus.\n *\n * Two ways to use it — the convenience form drops into running text or wraps any\n * element; the compound parts mirror `Popover.Root` / `Trigger` / `Content`.\n *\n * // 1. Inline — `children` become a focusable inline trigger\n * <Tooltip label=\"A project at 42.\">norm</Tooltip>\n *\n * // 2. Wrap an element — `asChild` makes the child the trigger\n * <Tooltip label=\"Delete\" asChild>\n * <ActionIcon aria-label=\"Delete\"><Trash /></ActionIcon>\n * </Tooltip>\n *\n * // 3. Compound\n * <Tooltip.Root position=\"end\">\n * <Tooltip.Trigger asChild><Button>Hover</Button></Tooltip.Trigger>\n * <Tooltip.Content>\n * <Tooltip.Arrow />\n * Rich <strong>content</strong>\n * </Tooltip.Content>\n * </Tooltip.Root>\n *\n * Visually it reuses the Popover's open/close animation but renders as a small,\n * **inverted** bubble (dark surface in light mode, light in dark) to read as an\n * ephemeral hint rather than a panel. Add `withArrow` (convenience form) or a\n * `Tooltip.Arrow` part (compound) to point the bubble at its trigger.\n */\n\n/** Inverted compact bubble — reuses the shared `popover-in/out` animation tokens\n * (which already honour reduced-motion in `theme.css`) and the placement-origin\n * trick so it grows out of the trigger's edge. */\nconst tooltipContent = cn(\n \"max-w-[16rem] rounded-xs px-2 py-1\",\n \"text-xs leading-snug focus:outline-none\",\n \"bg-gray-light-900 text-gray-light-25 dark:bg-gray-dark-100 dark:text-gray-dark-900\",\n \"data-[state=open]:animate-popover-in data-[state=closed]:animate-popover-out\",\n \"data-[placement^=top]:origin-bottom data-[placement^=bottom]:origin-top\",\n \"data-[placement^=left]:origin-right data-[placement^=right]:origin-left\",\n)\n\n/** The bubble's shadow lives on the *positioner* (this wrapper), not on the\n * content. A `box-shadow` on the content paints as one unit *with* its\n * background, so it lands on top of the behind-arrow (`-z-1`) and smears\n * across the protruding tip. Hosting the shadow here reorders the paint to\n * shadow → arrow → content: the positioner's shadow sits at the back of its\n * stacking context (it's the `isolate` root), the arrow paints above it, and\n * the content background paints last — so the shadow never touches the arrow,\n * the arrow never covers the label, and the bubble keeps its shadow.\n * `rounded-xs` matches the content radius so the shadow's corners line up. */\nconst tooltipPositioner = \"rounded-xs shadow-md\"\n\n/** Inverted arrow matching the bubble surface. The `!` overrides are required\n * because Ark sets the arrow background via an inline style; `-z-1` tucks the\n * square behind the bubble so only the rotated corner pokes out as the tip. */\nconst tooltipArrow = cn(\"-z-1! rounded-xxs\", \"bg-gray-light-900! dark:bg-gray-dark-100!\")\n\n/** Resets the `<button>` Ark renders for the default trigger down to plain inline\n * text, so a Tooltip can sit on a word inside a `<p>` while staying keyboard-\n * focusable. `cursor-help` signals the hint; `[font:inherit]` matches the prose. */\nconst tooltipTrigger = cva(\n [\n \"inline cursor-help appearance-none border-0 bg-transparent p-0\",\n \"[font:inherit] text-inherit\",\n focusStyles(),\n \"rounded-xs\",\n ],\n {\n variants: {\n variant: {\n text: \"underline decoration-dotted underline-offset-2 text-gray-light-900 dark:text-gray-dark-100\",\n inline: \"\",\n },\n },\n defaultVariants: {\n variant: \"inline\",\n },\n },\n)\n\ntype TooltipPlacement = NonNullable<NonNullable<ArkTooltip.RootProps[\"positioning\"]>[\"placement\"]>\n\n/** `position` accepts Ark's physical placements plus the logical, RTL-aware\n * horizontal sides `start` / `end` (resolved to `left` / `right` by direction). */\nexport type TooltipPosition = LogicalPosition<TooltipPlacement>\n\ntype TooltipContextValue = {\n withinPortal: boolean\n container?: HTMLElement | null\n}\nconst TooltipContext = createContext<TooltipContextValue>({ withinPortal: true })\n\nexport type TooltipRootProps = Omit<ArkTooltip.RootProps, \"positioning\"> & {\n /** Bubble placement relative to the trigger. Prefer the logical `start` / `end`\n * sides (RTL-aware), or use any Ark placement (`top`, `bottom`, `top-start`, …).\n * Defaults to `\"top\"`. */\n position?: TooltipPosition\n /** Gap in px between the trigger and the bubble. */\n offset?: number\n /** Render the bubble in a Portal so it escapes clipping ancestors. Default `true`. */\n withinPortal?: boolean\n /** Portal target. Defaults to the enclosing `Modal`/`Drawer` when there is\n * one (so the panel stays above it), else `document.body`. */\n container?: HTMLElement | null\n /** Fires on close (any source) — pointer/focus leaving the trigger, Escape, or a controlled `onOpenChange`. */\n onClose?: () => void\n}\n\nconst Root = ({\n position = \"top\",\n offset,\n withinPortal = true,\n container,\n children,\n onOpenChange,\n onClose,\n ...rest\n}: TooltipRootProps) => {\n const { dir } = useLocaleContext()\n return (\n <TooltipContext.Provider value={{ withinPortal, container }}>\n {/* Mount the bubble only while shown (lazyMount + unmountOnExit): closed →\n nothing rendered, so an inline trigger never emits a positioner <div>\n into a host <p> on SSR. Both are overridable via `...rest`. */}\n <ArkTooltip.Root\n lazyMount\n unmountOnExit\n positioning={{ placement: resolveLogicalPlacement(position, dir), gutter: offset }}\n onOpenChange={(details) => {\n onOpenChange?.(details)\n if (!details.open) onClose?.()\n }}\n {...rest}\n >\n {children}\n </ArkTooltip.Root>\n </TooltipContext.Provider>\n )\n}\n\nexport type TooltipContentProps = ArkTooltip.ContentProps & WithTestId\n\nconst Content = ({ className, children, testId, ...rest }: TooltipContentProps) => {\n const { withinPortal, container } = useContext(TooltipContext)\n const portalContainer = useOverlayContainer(container)\n const bubble = (\n <ArkTooltip.Positioner className={tooltipPositioner}>\n <ArkTooltip.Content\n className={cn(tooltipContent, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {children}\n </ArkTooltip.Content>\n </ArkTooltip.Positioner>\n )\n if (!withinPortal) return bubble\n return <Portal container={portalContainer}>{bubble}</Portal>\n}\n\nexport type TooltipArrowProps = ArkTooltip.ArrowProps & WithTestId\n\n/** The little arrow linking the bubble to its trigger. Compose it inside a\n * `Tooltip.Content` (or let the convenience form's `withArrow` add it for you).\n * The CSS vars size the square (`--arrow-size`) and pull it back under the\n * bubble (`--arrow-offset`) so it reads as a pointer, not a detached diamond. */\nconst Arrow = ({ className, style, testId }: TooltipArrowProps) => (\n <ArkTooltip.Arrow\n style={{ [\"--arrow-size\" as string]: \"12px\", [\"--arrow-offset\" as string]: \"-8px\", ...style }}\n {...props({ \"data-testid\": testId })}\n >\n <ArkTooltip.ArrowTip className={cn(tooltipArrow, className)} />\n </ArkTooltip.Arrow>\n)\n\nexport type TooltipProps = TooltipRootProps &\n WithTestId & {\n /** The hint shown on hover and keyboard focus. Named `label` for parity with\n * the rest of the kit; wired as a description via Ark's `aria-describedby`. */\n label: ReactNode\n /** The trigger. By default it's wrapped in a focusable inline trigger (so it\n * drops into running text); with `asChild`, this element *is* the trigger. */\n children: ReactNode\n /** Render `children` as the trigger instead of wrapping them. */\n asChild?: boolean\n /** Add a small arrow pointing at the trigger. For the compound form, compose\n * `<Tooltip.Arrow />` inside `<Tooltip.Content>` instead. */\n withArrow?: boolean\n variant?: VariantProps<typeof tooltipTrigger>[\"variant\"]\n classNames?: { trigger?: string; content?: string; arrow?: string }\n }\n\n/** Convenience form: `Root` + `Trigger` + `Content` wired from `label`/`children`.\n * `testId` lands on `Content` (the rendered bubble) — `Root` has no DOM node\n * of its own. */\nconst TooltipComponent = ({\n label,\n children,\n asChild,\n classNames,\n withArrow,\n variant = \"inline\",\n testId,\n ...root\n}: TooltipProps) => {\n const id = `tooltip-${useId()}`\n\n return (\n <Root {...root}>\n {match({ asChild })\n .with({ asChild: true }, () => <ArkTooltip.Trigger asChild>{children}</ArkTooltip.Trigger>)\n .otherwise(() => (\n <ArkTooltip.Trigger\n asChild\n className={cn(tooltipTrigger({ variant }), classNames?.trigger)}\n >\n {/** biome-ignore lint/a11y/noNoninteractiveTabindex: This is for text inline display */}\n <span tabIndex={0} aria-describedby={id}>\n {children}\n </span>\n </ArkTooltip.Trigger>\n ))}\n <Content className={classNames?.content} id={id} testId={testId}>\n {withArrow && <Arrow className={classNames?.arrow} />}\n {label}\n </Content>\n </Root>\n )\n}\n\nexport const Tooltip = Object.assign(TooltipComponent, {\n Root,\n Trigger: ArkTooltip.Trigger,\n Content,\n Arrow,\n})\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/notification/notification.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AAgDO,IAAM,mBAAA,GAAsB;AAAA,EACjC,qCAAA;AAAA,EACA;AACF,CAAA;AAMO,IAAM,mBAAmB,GAAA,CAAI;AAAA,EAClC,0EAAA;AAAA,EACA,iEAAA;AAAA;AAAA,EAEA,mCAAA;AAAA,EACA,+BAAA;AAAA;AAAA;AAAA,EAGA,oBAAA;AAAA,EACA,WAAA,CAAY,EAAE,MAAA,EAAQ,KAAA,EAAO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ps } from \"@ark-ui/react\"\nimport { cva } from \"class-variance-authority\"\nimport {\n AlertCircleIcon,\n CheckCircleIcon,\n ChevronDownIcon,\n InfoIcon,\n TriangleAlertIcon,\n} from \"lucide-react\"\nimport { type ComponentPropsWithoutRef, type ReactNode, type Ref, useRef } from \"react\"\nimport { match } from \"ts-pattern\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Collapse } from \"../collapse/collapse\"\nimport { CloseIcon } from \"../popover/icons\"\nimport { Spinner } from \"../spinner/spinner\"\nimport type { ToastFields, ToastHue, ToastType } from \"./types\"\n\n/**\n * Notification — the kit's **toast**: transient, non-blocking feedback spawned\n * imperatively from anywhere (`notify.success(\"Saved\")`) via `createNotifier`.\n *\n * This module holds the *visual* compound (`Notification.Root` / `Icon` /\n * `Title` / `Description` / `ActionTrigger` / `CloseTrigger` /\n * `CollapseTrigger`) and the ready-made `Notification` card composed from a\n * toast-shaped object (`type` → hue + icon, `title` / `description` /\n * `action`). It is deliberately dumb: the toaster behavior that drives it —\n * store, presence, height measurement, swipe-to-dismiss, stacking — lives in\n * `store.ts` / `create-notifier.tsx`, so the card is equally usable on its own\n * (e.g. a page-level alert).\n *\n * The surface is a single outline recipe; `color` (a `data-color` attribute\n * resolved to the `--c-*` slot vars) is the only styling axis. Status presets\n * map a `type` onto a hue + a leading icon.\n * Enter/exit is driven by Ark Presence → `data-state` → the `toast-in/out`\n * keyframes (like modal/drawer/popover).\n */\n\n/** The outline surface. Deliberately opaque and blurred: a toast floats over\n * arbitrary content. `Alert` (the inline sibling) shares the parts but not\n * this surface — it sits on the page and takes a translucent tint instead.\n * `color` tints the border, text and icon through `--c-solid`. */\nexport const notificationSurface = [\n \"bg-brand-50/90 dark:bg-brand-950/85\",\n \"text-(--c-solid) border-(--c-solid) backdrop-blur-lg\",\n]\n\n/** The toast card. Enter/exit via `data-state` keyframes (Ark Presence sets\n * `data-state`); stacking position via the `[data-scope=notifications]` rules\n * in theme.css (driven by the `--index`/`--offset`/`--height` vars the toaster\n * sets on each card — see create-notifier). */\nexport const notificationRoot = cva([\n \"data-[state=open]:animate-toast-in data-[state=closed]:animate-toast-out\",\n \"pointer-events-auto flex flex-col w-88 max-w-[calc(100vw-2rem)]\",\n // Phones (< xs): fill the full-bleed bottom region (see createNotifier).\n \"max-xs:w-full! max-xs:max-w-none!\",\n \"rounded-card border px-3 py-3\",\n // Any-focus outline suppression, matching the other overlay surfaces\n // (Modal, Drawer, Popover, Tooltip) — the card can take programmatic focus.\n \"focus:outline-none\",\n focusStyles({ offset: false }),\n \"[&_svg]:shrink-0 [&_svg]:pointer-events-none\",\n \"shadow-2xl shadow-gray-light-100 dark:shadow-gray-dark-900\",\n \"overflow-clip\",\n notificationSurface,\n])\n\n/** `type` → hue + default leading icon. There are no status color *tokens* in\n * the kit — status maps onto existing hues, reusing the same `--c-*` slots as\n * Badge/Button. `loading` uses the kit Spinner. Exported so `Alert` (which\n * drops the toast-only `loading` type) resolves the same presets. */\nexport const TOAST_STATUS: Record<ToastType, { color: Color; icon: ReactNode }> = {\n success: { color: \"green\", icon: <CheckCircleIcon /> },\n error: { color: \"red\", icon: <AlertCircleIcon /> },\n warning: { color: \"orange\", icon: <TriangleAlertIcon /> },\n info: { color: \"neutral\", icon: <InfoIcon /> },\n loading: { color: \"neutral\", icon: <Spinner size=\"md\" label={null} /> },\n}\n\nexport type NotificationRootProps = HTMLArkProps<\"div\"> &\n WithTestId & {\n /** Accent palette. Drives the `--c-*` slot vars for the whole toast. */\n color?: Color\n /** Forwarded to the underlying element (used by Presence for enter/exit). */\n ref?: Ref<HTMLDivElement>\n }\n\nconst Root = ({ className, color, testId, ...rest }: NotificationRootProps) => (\n <ark.div\n data-color={color}\n className={cn(notificationRoot(), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\n/** Leading-glyph slot. Inherits the Root's text color (the `color` hue) and\n * sizes any child svg to match the text.\n * Exported (like the parts below) so `Alert` reuses it as-is — these are\n * width-agnostic, so nothing about them is toast-specific. */\nexport const Icon = ({\n className,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"span\"> & WithTestId) => (\n <span\n className={cn(\"inline-flex [&_svg]:size-5\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport const Title = ({\n className,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"div\"> & WithTestId) => (\n <div\n className={cn(\"text-sm font-bold text-gray-light-950 dark:text-gray-dark-25\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport const Description = ({\n className,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"div\"> & WithTestId) => (\n <div\n className={cn(\n \"mt-1 text-sm font-normal text-gray-light-700 opacity-90 dark:text-gray-dark-300\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport const ActionTrigger = ({\n className,\n type,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"button\"> & WithTestId) => (\n <button\n type={type ?? \"button\"}\n className={cn(\n \"inline-flex h-7 cursor-pointer items-center rounded-input px-2 text-xs font-medium\",\n \"border border-current/30 hover:bg-current/10\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-current/50\",\n \"transition-colors\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport const CloseTrigger = ({\n className,\n children,\n type,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"button\"> & WithTestId) => (\n <button\n type={type ?? \"button\"}\n aria-label=\"Dismiss\"\n className={cn(\n \"ms-auto inline-flex size-5 shrink-0 cursor-pointer items-center justify-center\",\n \"rounded-full opacity-70 hover:opacity-100 [&_svg]:size-4\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-current/50\",\n \"transition-colors\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {children ?? <CloseIcon />}\n </button>\n)\n\n/**\n * The chevron that folds the card's description and action rows away — the\n * collapse counterpart to `CloseTrigger`, and what the ready-made card renders\n * for `withCollapse`.\n *\n * It is presentational only: `open` drives the label, `aria-expanded` and the\n * chevron's rotation, but the state itself belongs to the caller. The button\n * owns the layout, the opacity and any `className`; the default icon carries\n * nothing but its rotation, so passing a `className` tints or spaces the\n * control once rather than twice.\n */\nexport const CollapseTrigger = ({\n className,\n children,\n type,\n open,\n testId,\n ...rest\n}: ComponentPropsWithoutRef<\"button\"> & WithTestId & { open: boolean }) => (\n <button\n type={type ?? \"button\"}\n aria-label={open ? \"Collapse\" : \"Expand\"}\n aria-expanded={open}\n className={cn(\n \"ms-auto inline-flex size-5 shrink-0 cursor-pointer items-center justify-center\",\n \"rounded-full opacity-70 hover:opacity-100 [&_svg]:size-4\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-current/50\",\n \"transition-colors\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {children ?? (\n <ChevronDownIcon\n data-open={open}\n className=\"data-[open=true]:rotate-0 data-[open=false]:rotate-180 transition-transform\"\n />\n )}\n </button>\n)\n\n/**\n * Props for the ready-made `Notification` card. The presentational fields it\n * shares with a spawned toast (`type` / `title` / `description` / `action` /\n * `color` / `icon` / `withCloseButton`) plus its own collapse controls;\n * the Notifier-managed plumbing (`id` / `status` / `duration`) is optional, so a\n * standalone card is just `<Notification type=\"success\" title=\"Saved\" />`.\n */\nexport type NotificationProps = Omit<NotificationRootProps, \"title\" | \"color\"> &\n Omit<ToastFields, \"id\" | \"status\" | \"duration\"> &\n Partial<Pick<ToastFields, \"id\" | \"status\" | \"duration\">> &\n ToastHue & {\n /** Invoked when the close (×) button is pressed. */\n onClose?: () => void\n /** Swap the close (×) button for a chevron that folds the description and\n * action rows away. `withCloseButton` takes precedence over this. */\n withCollapse?: boolean\n /** Uncontrolled initial open state — collapsed by default when `withCollapse`,\n * open otherwise. Pair with `withCollapse`. */\n defaultOpen?: boolean\n /** Controlled open state — pair with `onOpenChange`. */\n open?: boolean\n /** Fired when the collapse toggle is pressed. */\n onOpenChange?: (open: boolean) => void\n }\n\n/**\n * The ready-made **`Notification` card** — the presentational body composed from\n * a toast-shaped object: resolves `type` → `TOAST_STATUS` (hue + leading icon), lets\n * an explicit `color`/`icon` override (`icon={null}` hides the glyph),\n * and lays out the icon/title/close row plus the independently-collapsing\n * description and action sections.\n *\n * Owns no store, presence or gesture state — the Notifier's render body drives\n * it by forwarding a `ref`, stacking style vars, pointer handlers and `onClose`\n * straight through to the `Root`. Rendered on its own it is just a status card\n * (e.g. a page-level alert). For a bespoke layout, compose the parts directly:\n * `Notification.Root`, `.Icon`, `.Title`, `.Description`, `.ActionTrigger`,\n * `.CloseTrigger`.\n */\nfunction NotificationComponent({\n type,\n title,\n description,\n action,\n color: _color,\n icon: _icon,\n withCloseButton = true,\n withCollapse = false,\n defaultOpen,\n open: _open,\n onOpenChange,\n onClose,\n // Notifier-managed plumbing — not rendered onto the card.\n status: _status,\n duration: _duration,\n ...rest\n}: NotificationProps) {\n const preset = type ? TOAST_STATUS[type] : undefined\n // `type` and `color` are exclusive (see `ToastHue`); the preset wins\n // should a JS caller pass both anyway.\n const color = preset ? preset.color : (_color as Color | undefined)\n // Not `??`: an explicit `icon={null}` (hide the glyph) must not fall\n // through to the preset the way an omitted (`undefined`) icon does.\n const icon = _icon === undefined ? preset?.icon : _icon\n\n const [open, setOpen] = useUncontrolled({\n defaultValue: defaultOpen,\n value: _open,\n finalValue: match({ withCloseButton, withCollapse })\n .with({ withCloseButton: true }, () => true)\n .with({ withCollapse: true }, () => false)\n .with({ withCollapse: false }, () => true)\n .exhaustive(),\n onChange: onOpenChange,\n })\n\n // Keep the last-present description / action mounted through their collapse so\n // each reveal has content to animate *out* (removed content unmounts instantly\n // otherwise). Cached independently so the two sections animate separately.\n const lastDescription = useRef(description)\n if (description != null) lastDescription.current = description\n const lastAction = useRef(action)\n if (action != null) lastAction.current = action\n\n return (\n <Root color={color} {...rest}>\n <div className=\"flex flex-row gap-3\">\n {icon != null && <Icon>{icon}</Icon>}\n {title != null && <Title>{title}</Title>}\n {match({ withCloseButton, withCollapse })\n .with({ withCloseButton: true }, () => <CloseTrigger onClick={onClose} />)\n .with({ withCollapse: true }, () => (\n <CollapseTrigger open={open} onClick={() => setOpen(!open)} />\n ))\n .with({ withCollapse: false }, () => null)\n .exhaustive()}\n </div>\n {/* Description and action are independent Collapse sections. */}\n <Collapse open={description != null && open}>\n <Description>{description ?? lastDescription.current}</Description>\n </Collapse>\n <Collapse open={action != null && open}>\n <div className=\"mt-2 flex flex-wrap items-center gap-2\">{action ?? lastAction.current}</div>\n </Collapse>\n </Root>\n )\n}\n\n/**\n * `Notification` — the ready-made card (batteries-included), with the compound\n * parts attached for bespoke composition. Mirrors `Tooltip`/`Modal`: the bare\n * name is the convenience form; `.Root` and friends are the primitives.\n */\nexport const Notification = Object.assign(NotificationComponent, {\n Root,\n Icon,\n Title,\n Description,\n ActionTrigger,\n CloseTrigger,\n CollapseTrigger,\n})\n"]}
|
package/dist/chunk-HWNPXAEN.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { props } from './chunk-WYCMIIRR.js';
|
|
2
|
-
import { cn } from './chunk-QP4I37PA.js';
|
|
3
|
-
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
var Collapse = ({
|
|
6
|
-
open,
|
|
7
|
-
className,
|
|
8
|
-
classNames,
|
|
9
|
-
children,
|
|
10
|
-
testId,
|
|
11
|
-
...rest
|
|
12
|
-
}) => /* @__PURE__ */ jsx(
|
|
13
|
-
"div",
|
|
14
|
-
{
|
|
15
|
-
className: cn(
|
|
16
|
-
"grid transition-[grid-template-rows] duration-300 ease-[cubic-bezier(0.16,1,0.3,1)]",
|
|
17
|
-
"motion-reduce:transition-none",
|
|
18
|
-
open ? "grid-rows-[1fr]" : "grid-rows-[0fr]",
|
|
19
|
-
className,
|
|
20
|
-
classNames?.root
|
|
21
|
-
),
|
|
22
|
-
...props({ "data-testid": testId }),
|
|
23
|
-
...rest,
|
|
24
|
-
"data-state": open ? "open" : "closed",
|
|
25
|
-
children: /* @__PURE__ */ jsx("div", { className: cn("min-h-0 min-w-0 overflow-clip", classNames?.content), inert: !open, children })
|
|
26
|
-
}
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
export { Collapse };
|
|
30
|
-
//# sourceMappingURL=chunk-HWNPXAEN.js.map
|
|
31
|
-
//# sourceMappingURL=chunk-HWNPXAEN.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/collapse/collapse.tsx"],"names":[],"mappings":";;;;AAsDO,IAAM,WAAW,CAAC;AAAA,EACvB,IAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,GAAG;AACL,CAAA,qBACE,GAAA;AAAA,EAAC,KAAA;AAAA,EAAA;AAAA,IACC,SAAA,EAAW,EAAA;AAAA,MACT,qFAAA;AAAA,MACA,+BAAA;AAAA,MACA,OAAO,iBAAA,GAAoB,iBAAA;AAAA,MAC3B,SAAA;AAAA,MACA,UAAA,EAAY;AAAA,KACd;AAAA,IACC,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,IAClC,GAAG,IAAA;AAAA,IACJ,YAAA,EAAY,OAAO,MAAA,GAAS,QAAA;AAAA,IAI5B,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,EAAA,CAAG,+BAAA,EAAiC,UAAA,EAAY,OAAO,CAAA,EAAG,KAAA,EAAO,CAAC,IAAA,EAC/E,QAAA,EACH;AAAA;AACF","file":"chunk-HWNPXAEN.js","sourcesContent":["import type { ComponentPropsWithoutRef, ReactNode } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\n\nexport type CollapseClassNames = {\n root?: string\n content?: string\n}\n\n/**\n * Collapse — reveal/hide content with a height animation, no JS measurement.\n *\n * The trick is a single-cell grid whose row track animates between `0fr`\n * (collapsed) and `1fr` (revealed). Because the row is a *fraction*, the track\n * resolves to the content's own height — so `auto`-height content animates\n * open and closed cleanly, both ways, without ever reading the DOM. A pure CSS\n * transition on `grid-template-rows` does the work; the inner cell clips its\n * overflow so the content slides under the fold.\n *\n * The cell sets `min-width: 0` as well as `min-height: 0`. A grid item's\n * `min-*: auto` resolves to its content's min-content size, and only a scroll\n * container (`hidden` / `auto` / `scroll`) resets it — `overflow: clip` does\n * not. Without it, the implicit `auto` column grows to the content's\n * min-content width, so a row meant to shrink (a `min-w-0` flex child, a\n * table, a long unbroken string) pushes the `Collapse` past its parent instead.\n *\n * Each `Collapse` animates independently, so sibling sections (e.g. a\n * description and an action row) reveal on their own timelines. Respects\n * `prefers-reduced-motion` (the transition is dropped, the toggle is instant).\n *\n * A closed `Collapse` is `inert`: its content is out of the tab order and out\n * of the accessibility tree, matching what the `hidden` attribute it replaces\n * did. `overflow-clip` is purely visual — without `inert`, a folded panel's\n * buttons and links stay focusable and screen-reader-visible at zero height,\n * which is the one way this primitive is *not* a drop-in for `hidden={!open}`.\n * The switch is deliberately instantaneous rather than deferred to\n * `transitionend`: closed means unreachable from the same frame the state\n * flips, so focus can never enter content on its way out. The content stays\n * mounted either way — only the animation is allowed to lag behind `open`.\n *\n * Override the timing with a `duration-*` / `ease-*` class on `className`\n * (tailwind-merge lets the later class win); style the sliding region — layout,\n * padding — with `classNames.content`.\n */\nexport type CollapseProps = ComponentPropsWithoutRef<\"div\"> &\n WithTestId & {\n /** Whether the content is revealed. Closed content is `inert`. */\n open: boolean\n /** Classes for the inner, clipped cell that holds (and slides) the content. */\n classNames?: CollapseClassNames\n children?: ReactNode\n }\n\nexport const Collapse = ({\n open,\n className,\n classNames,\n children,\n testId,\n ...rest\n}: CollapseProps) => (\n <div\n className={cn(\n \"grid transition-[grid-template-rows] duration-300 ease-[cubic-bezier(0.16,1,0.3,1)]\",\n \"motion-reduce:transition-none\",\n open ? \"grid-rows-[1fr]\" : \"grid-rows-[0fr]\",\n className,\n classNames?.root,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n data-state={open ? \"open\" : \"closed\"}\n >\n {/* `inert` sits on the clipped cell, not the root, so a consumer keeps the\n root's own `inert` (and the rest of its div props) to itself. */}\n <div className={cn(\"min-h-0 min-w-0 overflow-clip\", classNames?.content)} inert={!open}>\n {children}\n </div>\n </div>\n)\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/tabs/tabs.tsx","../src/components/tabs/tabs-data.tsx"],"names":["Ark","jsx"],"mappings":";;;;;;;;;AA6DA,IAAM,QAAA,GAAW,GAAA;AAAA,EACf;AAAA,IACE,6EAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,MAAA,EAAQ,CAAC,yCAAA,EAA2C,oBAAoB,CAAA;AAAA,QACxE,KAAA,EAAO,CAAC,YAAA,EAAc,0CAA0C,CAAA;AAAA,QAChE,OAAA,EAAS,CAAC,mCAAmC,CAAA;AAAA,QAC7C,MAAA,EAAQ,CAAC,mCAAmC,CAAA;AAAA,QAC5C,OAAA,EAAS,CAAC,YAAA,EAAc,0CAA0C;AAAA,OACpE;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,EAAA,EAAI,OAAA;AAAA,QACJ,EAAA,EAAI,SAAA;AAAA,QACJ,EAAA,EAAI,OAAA;AAAA,QACJ,EAAA,EAAI,OAAA;AAAA,QACJ,EAAA,EAAI;AAAA;AACN,KACF;AAAA,IACA,eAAA,EAAiB,EAAE,OAAA,EAAS,SAAA,EAAW,MAAM,IAAA;AAAK;AAEtD,CAAA;AAwBA,IAAM,WAAA,GAAc,GAAA;AAA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A,EACA,SAAA;AAAA,EACA;AACF,CAAC","file":"chunk-IFWCCAQV.js","sourcesContent":["\"use client\"\n\nimport { Tabs as Ark } from \"@ark-ui/react/tabs\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { createContext, useContext } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { useDirectionCheck } from \"../../lib/intl\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\n\n/**\n * Tabs — a navigation control on Ark UI's Tabs machine: a row (or column) of\n * triggers, each revealing its own content panel, with a pill that slides to\n * the active trigger. Visually it's `SegmentGroup`'s twin — the same\n * filled/light/outline/subtle/default variant × color system and the same\n * sliding-indicator mechanics — but built for real content panels instead of\n * a single-choice value, and with no `Field` integration (Tabs is navigation,\n * not a form control, so there's no label/description/error/name).\n *\n * Two ways to use it:\n *\n * // 1. Data-driven — the common case\n * <Tabs\n * variant=\"filled\"\n * color=\"brand\"\n * defaultValue=\"overview\"\n * data={[\n * { value: \"overview\", label: \"Overview\", content: <Overview /> },\n * { value: \"activity\", label: \"Activity\", content: <Activity /> },\n * ]}\n * />\n *\n * // 2. Compound — for anything the data array can't express\n * <Tabs.Root defaultValue=\"overview\">\n * <Tabs.List variant=\"filled\" color=\"brand\">\n * <Tabs.Indicator />\n * <Tabs.Trigger value=\"overview\">Overview</Tabs.Trigger>\n * <Tabs.Trigger value=\"activity\">Activity</Tabs.Trigger>\n * </Tabs.List>\n * <Tabs.Content value=\"overview\"><Overview /></Tabs.Content>\n * <Tabs.Content value=\"activity\"><Activity /></Tabs.Content>\n * </Tabs.Root>\n *\n * `variant`, `size` and `color` all live on `List` and apply to the tray, every\n * trigger, and the indicator — set them once on `List` rather than repeating\n * them on each `Trigger`. `color` is a `data-color` attribute, so it is scoped\n * to the strip: it deliberately does *not* sit on `Root`, which also wraps\n * every `Content` panel and would leak the palette into whatever those panels\n * render — an uncoloured `Button` inside a panel would silently adopt the\n * tab's palette (#140).\n */\n\n/** The tray. `filled` is a heavier neutral fill so the colored pill pops;\n * `light` / `default` frame the pill with the same translucent surface as\n * `Input`'s own `default` shell (`bg-white/4` + the hairline\n * `border-brand-900/20 dark:border-white/15`) rather than an opaque gray\n * step, so the tray reads correctly on any host background; `outline` /\n * `subtle` are chromeless (their cue lives on the sliding pill instead). */\nconst tabsList = cva(\n [\n \"relative inline-flex max-w-fit rounded-input border p-0.5 transition-colors\",\n \"data-[orientation=vertical]:flex-col\",\n ],\n {\n variants: {\n variant: {\n filled: [\"bg-gray-light-100 dark:bg-gray-dark-800\", \"border-transparent\"],\n light: [\"bg-white/4\", \"border-brand-900/20 dark:border-white/15\"],\n outline: [\"bg-transparent border-transparent\"],\n subtle: [\"bg-transparent border-transparent\"],\n default: [\"bg-white/4\", \"border-brand-900/20 dark:border-white/15\"],\n },\n size: {\n xs: \"gap-1\",\n sm: \"gap-1.5\",\n md: \"gap-2\",\n lg: \"gap-3\",\n xl: \"gap-4\",\n },\n },\n defaultVariants: { variant: \"default\", size: \"md\" },\n },\n)\n\n/**\n * Each trigger. Mirrors `segItem`'s checked-color treatment (per variant) and\n * `segItemWrap`'s hairline separator between neighbours — drawn directly on\n * the trigger `<button>` itself (Tabs has no separate item-wrapper the way\n * `SegmentGroup` does for its hidden radio input). The focus ring sits\n * directly on the trigger (unlike `SegmentGroup`'s container-level `:has()`\n * halo) because each trigger is a real, independently-focusable `<button>`.\n *\n * The indicator renders as `List`'s first child (see `Indicator` below), so\n * the first trigger is `:nth-child(2)` — `nth-2:before:hidden` suppresses the\n * separator before it, matching `segItemWrap`'s own comment.\n *\n * The *selected* label must come from the same source as the pill it sits on.\n * `default` and `filled` both paint `bg-(--c-solid)`, so both take\n * `--c-on-solid`; `light` / `outline` / `subtle` sit on a soft or absent fill,\n * so they take `--c-text`. Hard-coding a neutral foreground against a\n * `--c-solid` fill is what broke `default` at any `color` (#140) — the pill\n * moved with the palette and the label stayed put, reaching 3.27:1 on brand.\n * There is deliberately no hover shift on the selected label: `Button`'s\n * `filled` moves only the background (`--c-solid-hover`) and keeps\n * `--c-on-solid`, and no `--c-on-solid-hover` slot exists in `colors.css`.\n */\nconst tabsTrigger = cva(\n [\n \"relative z-1 cursor-pointer rounded-[6px] text-center font-medium whitespace-nowrap select-none\",\n \"text-gray-light-700 dark:text-gray-dark-300\",\n // Only unselected triggers get the hover lift. The selected one already has\n // its variant's foreground (`--c-on-solid` / `--c-text`), and these neutral\n // hover colors carry the same specificity, so an unscoped `hover:` wins on\n // source order alone — in dark theme it did, washing the selected label to\n // near-white over a colored pill (3.41:1 on brand). Mirrors `Button`'s own\n // `not-data-loading:hover:` scoping.\n \"not-data-selected:hover:text-gray-light-950 dark:not-data-selected:hover:text-gray-dark-50\",\n \"transition-colors\",\n focusStyles(),\n \"data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n \"before:absolute before:rounded-full before:bg-gray-light-300 dark:before:bg-gray-dark-600\",\n \"before:transition-opacity before:duration-200\",\n \"before:top-1/2 before:left-0 before:h-1/2 before:w-px before:-translate-x-1/2 before:-translate-y-1/2\",\n \"in-data-[orientation=vertical]:before:top-0 in-data-[orientation=vertical]:before:left-1/2 in-data-[orientation=vertical]:before:h-px in-data-[orientation=vertical]:before:w-1/2\",\n \"nth-2:before:hidden\",\n \"data-selected:before:opacity-0 data-selected:[&+*]:before:opacity-0\",\n ],\n {\n variants: {\n variant: {\n filled: \"data-selected:text-(--c-on-solid)\",\n light: \"data-selected:text-(--c-text)\",\n outline: \"data-selected:text-(--c-text)\",\n subtle: \"data-selected:text-(--c-text)\",\n default: \"data-selected:text-(--c-on-solid)\",\n },\n size: {\n xs: \"px-2 py-0.5 text-xs\",\n sm: \"px-2.5 py-1 text-sm\",\n md: \"px-3 py-1.5 text-md\",\n lg: \"px-4 py-2 text-lg\",\n xl: \"px-5 py-2.5 text-xl\",\n },\n },\n defaultVariants: { variant: \"default\", size: \"md\" },\n },\n)\n\n/** The sliding pill, mirroring each `Button` surface (same as `segIndicator`). */\nconst tabsIndicator = cva(\"z-0\", {\n variants: {\n variant: {\n filled: \"bg-(--c-solid) rounded-xxs\",\n light: \"bg-(--c-soft) border border-(--c-soft-hover) rounded-xxs\",\n outline: \"bg-transparent border border-(--c-solid) rounded-input\",\n subtle: \"bg-(--c-soft-hover) rounded-input\",\n default: \"bg-(--c-solid) rounded-xxs\",\n },\n },\n defaultVariants: { variant: \"default\" },\n})\n\n/** The content panel. Ark makes the active panel focusable (roving from its\n * trigger), so it gets its own focus ring, matching the kit-wide convention. */\nconst tabsContent = cn(\"mt-3 rounded-xs\", focusStyles())\n\nexport type TabsVariant = NonNullable<VariantProps<typeof tabsList>[\"variant\"]>\n\n/** Shared tray configuration, set once on `List` and read by `Trigger` and\n * `Indicator` so callers don't repeat `variant` / `size` on every trigger. */\nconst TabsStyleContext = createContext<{ variant: TabsVariant; size: Size }>({\n variant: \"default\",\n size: \"md\",\n})\n\n/** `color` is deliberately omitted, not merely absent: React's `HTMLAttributes`\n * carries a legacy `color?: string`, so without the `Omit` a stale\n * `<Tabs.Root color=\"brand\">` would still compile and fall through `...rest`\n * onto the div as the deprecated HTML attribute — silently losing the palette.\n * Omitting it turns every such call site into a compile error pointing at the\n * line to change. Same convention as `Button` / `ActionIcon` (code-style.md). */\nexport type TabsRootProps = Omit<Ark.RootProps, \"color\"> & WithTestId\n\nconst Root = ({ orientation = \"horizontal\", testId, ...rest }: TabsRootProps) => {\n const checkDirection = useDirectionCheck()\n return (\n // `key={orientation}` remounts on an axis flip so Ark re-measures the\n // indicator rect for the new layout (it only measures on mount + value\n // change, mirroring the same limitation `SegmentGroup` works around) — at\n // the cost of resetting an *uncontrolled* value on that flip. Pass a\n // controlled `value` if the orientation can change at runtime and the\n // selection must survive it.\n <Ark.Root\n key={orientation}\n orientation={orientation}\n ref={checkDirection}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n )\n}\n\nexport type TabsListProps = Omit<Ark.ListProps, \"color\"> &\n WithTestId & {\n variant?: TabsVariant\n size?: Size\n /** Palette for the sliding indicator + active-trigger text. Sets `data-color`\n * on the list, so the `--c-*` slots reach the tray, the triggers and the\n * indicator without reaching the `Content` panels. */\n color?: Color\n }\n\nconst List = ({\n variant = \"default\",\n size = \"md\",\n color,\n className,\n testId,\n ...rest\n}: TabsListProps) => (\n <TabsStyleContext.Provider value={{ variant, size }}>\n <Ark.List\n className={tabsList({ variant, size, className })}\n data-color={color}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n </TabsStyleContext.Provider>\n)\n\nexport type TabsTriggerProps = Ark.TriggerProps & WithTestId\n\nconst Trigger = ({ className, testId, ...rest }: TabsTriggerProps) => {\n const { variant, size } = useContext(TabsStyleContext)\n return (\n <Ark.Trigger\n className={tabsTrigger({ variant, size, className })}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n )\n}\n\nexport type TabsContentProps = Ark.ContentProps & WithTestId\n\nconst Content = ({ className, testId, ...rest }: TabsContentProps) => (\n <Ark.Content\n className={cn(tabsContent, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type TabsIndicatorProps = Ark.IndicatorProps & WithTestId\n\n/** The sliding pill. Ark sets `position: absolute` + `--left`/`--top`/\n * `--width`/`--height` (the selected trigger's rect) inline, so it sits\n * behind the labels (`z-0`).\n *\n * We drive the slide transition ourselves rather than via Ark's gated\n * `animateIndicator` flag — the same fix `SegmentGroup` uses: Ark sets\n * `transition-property: none` whenever that flag is false, including the\n * instant it receives the `transitionend` of ANY animated property. With\n * several properties of differing end-times (a `left` redirected by an\n * interrupting click vs. a color/width that already settled), that early end\n * would null the transition and snap the pill mid-slide. Overriding the real\n * `transition-*` props (our `style` wins via Ark's `mergeProps`) keeps the\n * transition always on, so interruptions re-target smoothly. */\nconst Indicator = ({ className, style, testId, ...rest }: TabsIndicatorProps) => {\n const { variant } = useContext(TabsStyleContext)\n return (\n <Ark.Indicator\n style={{\n width: \"var(--width)\",\n height: \"var(--height)\",\n transitionProperty: \"left, top, width, height, background-color, border-color\",\n transitionDuration: \"200ms\",\n transitionTimingFunction: \"cubic-bezier(0.32, 0.72, 0, 1)\",\n ...style,\n }}\n className={tabsIndicator({ variant, className })}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n )\n}\n\nexport { Content, Indicator, List, Root, Trigger }\nexport const Context = Ark.Context\n","\"use client\"\n\nimport type { ReactNode } from \"react\"\nimport type { Color } from \"../../lib/colors\"\nimport type { Size } from \"../../lib/sizes\"\nimport {\n Content,\n Context,\n Indicator,\n List,\n Root,\n type TabsRootProps,\n type TabsVariant,\n Trigger,\n} from \"./tabs\"\n\n/**\n * Data-driven Tabs — the convenience wrapper over the composable parts, for\n * the common case of a flat list of label + panel pairs:\n *\n * <Tabs\n * data={[\n * { value: \"overview\", label: \"Overview\", content: <Overview /> },\n * { value: \"activity\", label: \"Activity\", content: <Activity /> },\n * ]}\n * />\n *\n * Generic over `const data`, so an item's `value` narrows `onChange`. The\n * first item is selected by default when neither `value` nor `defaultValue`\n * is given — the low-level `Root` part has no `data` to default from, so this\n * only happens here. Drop to `Tabs.Root` / `Tabs.List` / `Tabs.Trigger` /\n * `Tabs.Content` for anything the flat array can't express (custom trigger\n * content, interleaved non-tab elements, …).\n */\n\n/** One tab: a trigger label and its panel content. */\nexport type TabsItem = {\n value: string\n label: ReactNode\n content: ReactNode\n disabled?: boolean\n /** `data-testid` on the trigger; the matching content panel gets\n * `` `${testId}-panel` ``. Defaults to `` `tab-${value}` `` / `` `tab-${value}-panel` ``\n * when omitted. Ark's own `data-value={value}` is also always present on the\n * trigger as a complementary, zero-config selector. */\n testId?: string\n}\n\n/** The `data` array `Tabs` is generic over. */\nexport type TabsData = ReadonlyArray<TabsItem>\n\n/** Extract the value-string union from a `TabsData` shape, for a typed `onChange`. */\nexport type TabsValue<Data extends TabsData> = Data[number][\"value\"]\n\nexport type TabsProps<Data extends TabsData = TabsData> = Omit<\n TabsRootProps,\n \"children\" | \"onValueChange\"\n> & {\n /** Tabs, in order. Each needs its own `content`. */\n data: Data\n /** Tray + trigger + indicator treatment, mirroring `Button`/`SegmentGroup`. */\n variant?: TabsVariant\n /** Trigger size. */\n size?: Size\n /** Palette for the sliding indicator + active-trigger text. Scoped to the\n * strip (it lands on the `List`), so it never tints the panel content. */\n color?: Color\n /** Fires with the selected value (narrowed to the data value union). */\n onChange?: (value: TabsValue<Data>) => void\n}\n\nconst TabsComponent = <const Data extends TabsData>({\n data,\n variant,\n size,\n color,\n value,\n defaultValue,\n onChange,\n ...root\n}: TabsProps<Data>) => (\n <Root\n value={value}\n defaultValue={defaultValue ?? data[0]?.value}\n onValueChange={onChange ? (d) => onChange(d.value as TabsValue<Data>) : undefined}\n {...root}\n >\n <List variant={variant} size={size} color={color}>\n <Indicator />\n {data.map((item) => (\n <Trigger\n key={item.value}\n value={item.value}\n disabled={item.disabled}\n testId={item.testId ?? `tab-${item.value}`}\n >\n {item.label}\n </Trigger>\n ))}\n </List>\n {data.map((item) => (\n <Content\n key={item.value}\n value={item.value}\n testId={`${item.testId ?? `tab-${item.value}`}-panel`}\n >\n {item.content}\n </Content>\n ))}\n </Root>\n)\n\n/**\n * The public `Tabs` export — callable for the data-driven form, with the\n * composable parts attached (like `Menu`). `<Tabs data={…}>` and\n * `<Tabs.Root>…</Tabs.Root>` both work from one import.\n */\nexport const Tabs = Object.assign(TabsComponent, {\n Root,\n List,\n Trigger,\n Content,\n Indicator,\n Context,\n})\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/code-block/chrome.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAsBA,IAAM,oBAAA,GAA8C;AAAA,EAClD,IAAA,EAAM,MAAA;AAAA,EACN,MAAA,EAAQ,QAAA;AAAA,EACR,MAAA,EAAQ,WAAA;AAAA,EACR,QAAA,EAAU;AACZ,CAAA;AAwBO,IAAM,kBAAkB,CAAC;AAAA,EAC9B,S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;AAAA,eAC7B;AAAA,cAED,cAAA,oBACC,GAAA;AAAA,gBAAC,WAAA;AAAA,gBAAA;AAAA,kBACC,IAAA;AAAA,kBACA,MAAA;AAAA,kBACA,WAAW,CAAA,CAAE,IAAA;AAAA,kBACb,aAAa,CAAA,CAAE,MAAA;AAAA,kBACf,QAAA;AAAA,kBACA,UAAA;AAAA,kBACA,WAAW,UAAA,EAAY,UAAA;AAAA,kBACvB,MAAA,EAAQ,MAAA,IAAU,CAAA,EAAG,MAAM,CAAA,KAAA;AAAA;AAAA;AAC7B;AAAA;AAAA,SAEJ;AAAA,QAGD,WAAA;AAAA,QAEA,aAAA,oBAAiB,GAAA,CAAC,QAAA,EAAA,EAAS,IAAA,EAAM,UAAW,QAAA,EAAA,WAAA,EAAY,CAAA;AAAA,QAExD,aAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBASC,GAAA;AAAA,UAAC,KAAA;AAAA,UAAA;AAAA,YACC,aAAA,EAAW,IAAA;AAAA,YACX,SAAA,EAAW,EAAA;AAAA,cACT,oEAAA;AAAA,cACA,iCAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAOA,uEAAA;AAAA,cACA,WAAW,WAAA,GAAc;AAAA;AAC3B;AAAA;AACF;AAAA;AAAA,GAEJ;AAEJ","file":"chunk-IXKELBJA.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { useClipboard } from \"@ark-ui/react/clipboard\"\nimport { CheckIcon, ChevronDownIcon, ChevronUpIcon, CopyIcon } from \"lucide-react\"\nimport type { ReactNode } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport { Collapse } from \"../collapse/collapse\"\nimport { popoverChrome } from \"../popover/popover\"\nimport { Tooltip } from \"../tooltip/tooltip\"\n\nexport type CodeBlockTranslations = {\n copy: string\n copied: string\n expand: string\n collapse: string\n}\n\nconst DEFAULT_TRANSLATIONS: CodeBlockTranslations = {\n copy: \"Copy\",\n copied: \"Copied\",\n expand: \"Show more\",\n collapse: \"Show less\",\n}\n\nexport type CodeBlockClassNames = {\n root?: string\n pre?: string\n controls?: string\n copyButton?: string\n expandButton?: string\n}\n\nexport type CodeBlockButtonProps = HTMLArkProps<\"button\"> & WithTestId\n\n/**\n * `CodeBlock.Button` — the toolbar's own compact icon-button primitive.\n * `Copy`/expand use it internally, and it's exported so a consumer's own\n * `controls` button matches the exact same size/style instead of hand-\n * rolling one — same composition API as the rest of the kit (`asChild`, via\n * `HTMLArkProps`, so it wraps in a `Tooltip` exactly like the built-in\n * buttons do).\n *\n * A plain hand-rolled button, not an `ActionIcon` wrapper: this toolbar\n * needed something smaller than `ActionIcon`'s own `xs` floor, which is\n * sized for general-purpose use, not a compact floating strip over code.\n */\nexport const CodeBlockButton = ({\n className,\n asChild,\n type,\n testId,\n ...rest\n}: CodeBlockButtonProps) => (\n <ark.button\n asChild={asChild}\n type={asChild ? type : (type ?? \"button\")}\n {...props({ \"data-testid\": testId })}\n className={cn(\n \"inline-flex size-6 shrink-0 items-center justify-center rounded\",\n \"text-(--c-text) [&_svg]:size-3.5 [&_svg]:shrink-0 [&_svg]:pointer-events-none\",\n \"hover:bg-(--c-soft)\",\n focusStyles({ offset: false }),\n \"disabled:pointer-events-none disabled:opacity-50\",\n className,\n )}\n {...rest}\n />\n)\n\ntype CopyTriggerProps = {\n code: string\n onCopy?: () => void\n copyLabel: string\n copiedLabel: string\n copyIcon: ReactNode | null | undefined\n copiedIcon: ReactNode | null | undefined\n className?: string\n testId?: string\n}\n\n/**\n * Uses Ark's `useClipboard` hook directly rather than the `Clipboard.Root`/\n * `Clipboard.Indicator` components — both render their own wrapping `<div>`\n * (`data-part=\"root\"`/`\"indicator\"`), which, sitting as a direct child of the\n * toolbar's flex row, threw off its sizing/alignment next to the plain\n * `ActionIcon` the `ExpandTrigger` renders. The hook gives the same\n * `copied`/`copy` state machine with no imposed DOM structure at all — this\n * renders as a single real `<button>`, exactly like `ExpandTrigger`.\n */\nfunction CopyTrigger({\n code,\n onCopy,\n copyLabel,\n copiedLabel,\n copyIcon,\n copiedIcon,\n className,\n testId,\n}: CopyTriggerProps) {\n const { copied, copy } = useClipboard({\n value: code,\n timeout: 2000,\n onStatusChange: (details) => details.copied && onCopy?.(),\n })\n const label = copied ? copiedLabel : copyLabel\n return (\n <Tooltip label={label} asChild>\n <CodeBlockButton aria-label={label} onClick={copy} className={className} testId={testId}>\n {copied ? (\n copiedIcon === undefined ? (\n <CheckIcon />\n ) : (\n copiedIcon\n )\n ) : copyIcon === undefined ? (\n <CopyIcon />\n ) : (\n copyIcon\n )}\n </CodeBlockButton>\n </Tooltip>\n )\n}\n\ntype ExpandTriggerProps = {\n expanded: boolean\n onToggle: () => void\n expandLabel: string\n collapseLabel: string\n expandIcon: ReactNode | null | undefined\n collapseIcon: ReactNode | null | undefined\n className?: string\n testId?: string\n}\n\n/** Toolbar icon button toggling the collapsed \"tail\" seam — an\n * `aria-expanded` `ActionIcon` with a matching `Tooltip`/accessible name,\n * same shape as `CopyTrigger`. Only rendered when `isCollapsible`. */\nfunction ExpandTrigger({\n expanded,\n onToggle,\n expandLabel,\n collapseLabel,\n expandIcon,\n collapseIcon,\n className,\n testId,\n}: ExpandTriggerProps) {\n const label = expanded ? collapseLabel : expandLabel\n return (\n <Tooltip label={label} asChild>\n <CodeBlockButton\n aria-label={label}\n aria-expanded={expanded}\n onClick={onToggle}\n className={className}\n testId={testId}\n >\n {expanded ? (\n collapseIcon === undefined ? (\n <ChevronUpIcon />\n ) : (\n collapseIcon\n )\n ) : expandIcon === undefined ? (\n <ChevronDownIcon />\n ) : (\n expandIcon\n )}\n </CodeBlockButton>\n </Tooltip>\n )\n}\n\nexport type CodeBlockChromeProps = WithTestId & {\n /** Raw source, used only for the copy button's clipboard value — this\n * component never highlights anything itself. */\n code: string\n /** Whether the tail half exists at all (mirrors the caller's own\n * `collapsedLines`/line-count decision) — controls whether the expand\n * toggle and the `Collapse`-wrapped tail slot render at all. */\n isCollapsible: boolean\n /** The head half's already-rendered content (highlighted HTML, or a\n * loading fallback — this component has no opinion on which). */\n headContent: ReactNode\n /** The tail half's already-rendered content — only read when\n * `isCollapsible`. */\n tailContent?: ReactNode\n\n /** @default true */\n withCopyButton?: boolean\n /** `null` hides it. @default <CopyIcon/> */\n copyIcon?: ReactNode | null\n /** `null` hides it. @default <CheckIcon/> */\n copiedIcon?: ReactNode | null\n onCopy?: () => void\n\n /** @default false */\n defaultExpanded?: boolean\n expanded?: boolean\n onExpandedChange?: (expanded: boolean) => void\n /** `null` hides it. @default <ChevronDownIcon/> */\n expandIcon?: ReactNode | null\n /** `null` hides it. @default <ChevronUpIcon/> */\n collapseIcon?: ReactNode | null\n\n controls?: ReactNode\n translations?: Partial<CodeBlockTranslations>\n className?: string\n classNames?: CodeBlockClassNames\n}\n\n/**\n * The interactive shell shared by `CodeBlock` (client, highlights via\n * `highlightCode` in an effect) and `CodeBlock.Static` (an async Server\n * Component that `await`s `highlightCode` directly during render, for a\n * fully static/SSR'd result with zero client JS spent on Shiki) — this\n * component owns the toolbar/copy/collapse-expand interactivity and\n * nothing about HOW `headContent`/`tailContent` were produced. Kept in its\n * own file specifically so `CodeBlock.Static` (no `\"use client\"`, safe to\n * import from a Server Component) can render it without pulling in\n * `code-block.tsx`'s own client-only highlighting logic.\n */\nexport function CodeBlockChrome({\n code,\n isCollapsible,\n headContent,\n tailContent,\n withCopyButton = true,\n copyIcon,\n copiedIcon,\n onCopy,\n defaultExpanded = false,\n expanded: expandedProp,\n onExpandedChange,\n expandIcon,\n collapseIcon,\n controls,\n translations,\n testId,\n className,\n classNames,\n}: CodeBlockChromeProps) {\n const t = { ...DEFAULT_TRANSLATIONS, ...translations }\n\n const [expanded, setExpanded] = useUncontrolled({\n value: expandedProp,\n defaultValue: defaultExpanded,\n finalValue: false,\n onChange: onExpandedChange,\n })\n\n // A fixed `top-2` reads fine pinned to the corner of a tall, multi-line\n // block, but on a single line there's no \"corner\" to anchor to — it just\n // looks like an arbitrarily offset button. True vertical centering (equal\n // gap above/below) is the correct treatment there instead.\n const isSingleLine = !code.includes(\"\\n\")\n\n return (\n <div\n className={cn(\n \"relative rounded-card border border-brand-900/30 dark:border-white/10 bg-white/4\",\n className,\n classNames?.root,\n )}\n {...props({ \"data-testid\": testId })}\n >\n {(controls != null || withCopyButton || isCollapsible) && (\n <div\n className={cn(\n \"absolute right-2 z-10 flex items-center gap-1 p-0.5\",\n isSingleLine ? \"top-1/2 -translate-y-1/2\" : \"top-2\",\n // Same floating-surface chrome every other overlay panel in the\n // kit uses (Popover/Menu/Select's positioner) — border-brand-900/20\n // dark:border-white/15 + bg-brand-50/90 dark:bg-brand-950/85 +\n // backdrop-blur-sm + shadow-lg — rather than an ad-hoc neutral\n // white/gray-dark tint that doesn't match the kit's own convention\n // for \"a small panel floating over content.\"\n popoverChrome,\n classNames?.controls,\n )}\n >\n {controls}\n {isCollapsible && (\n <ExpandTrigger\n expanded={expanded}\n onToggle={() => setExpanded((prev) => !prev)}\n expandLabel={t.expand}\n collapseLabel={t.collapse}\n expandIcon={expandIcon}\n collapseIcon={collapseIcon}\n className={classNames?.expandButton}\n testId={testId && `${testId}-expand`}\n />\n )}\n {withCopyButton && (\n <CopyTrigger\n code={code}\n onCopy={onCopy}\n copyLabel={t.copy}\n copiedLabel={t.copied}\n copyIcon={copyIcon}\n copiedIcon={copiedIcon}\n className={classNames?.copyButton}\n testId={testId && `${testId}-copy`}\n />\n )}\n </div>\n )}\n\n {headContent}\n\n {isCollapsible && <Collapse open={expanded}>{tailContent}</Collapse>}\n\n {isCollapsible && (\n // Pinned to the *outer* card's own bottom edge (that div is the\n // nearest positioned ancestor), not to the code/Collapse content —\n // so it tracks the container's live height as Collapse animates\n // open/closed instead of sitting at a fixed spot relative to the\n // head/tail boundary, which \"teleported\" relative to the visibly\n // growing/shrinking content. Always mounted; only opacity toggles,\n // in sync with Collapse's own 300ms timing, so it fades together\n // with the reveal instead of popping in/out at the instant of click.\n <div\n aria-hidden\n className={cn(\n \"pointer-events-none absolute inset-x-0 bottom-0 h-8 rounded-b-card\",\n \"transition-opacity duration-300\",\n // Same brand-tinted family as this card's own border\n // (border-brand-900/30 dark:border-white/10) and the toolbar's\n // popoverChrome (bg-brand-50/90 dark:bg-brand-950/85) — a plain\n // neutral white/gray-950 fade doesn't match either, and visibly\n // seams against a brand-tinted page background (dark mode's\n // --color-fd-background is brand-950, not a neutral gray).\n \"bg-linear-to-t from-brand-50/95 to-transparent dark:from-brand-950/95\",\n expanded ? \"opacity-0\" : \"opacity-100\",\n )}\n />\n )}\n </div>\n )\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/modal/modal.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;AAiCA,IAAM,gBAAgB,GAAA,CAAI;AAAA,EACxB,8HAAA;AAAA,EACA;AACF,CAAC,CAAA;AAED,IAAM,eAAA,GAAkB,GAAA;AAAA,EACtB,gHAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,QAAA,EAAU;AAAA,QACR,MAAA,EAAQ,gBAAA;AAAA,QACR,GAAA,EAAK,wBAAA;AAAA,QACL,MAAA,EAAQ;AAAA;AACV,KACF;AAAA,IACA,eAAA,EAAiB,EAAE,QAAA,EAAU,QAAA;AAAS;AAE1C,CAAA;AAEA,IAAM,YAAA,GAAe,GAAA;AAAA,EACnB;AAAA,IACE,+BAAA;AAAA,IACA,2BAAA;AAAA,IACA,uEAAA;AAAA,IACA,+DAAA;AAAA,IACA,oBAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,IAAA,EAAM;AAAA,QACJ,EAAA,EAAI,oBAAA;AAAA;AAAA,QACJ,EAAA,EAAI,oBAAA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AAA,oBACC,eAAA,oBAAmB,GAAA,CAAC,iBAAA,EAAA,EAAkB,SAAA,EAAW,YAAY,WAAA,EAAa;AAAA,mBAAA,EAC7E,CAAA;AAAA,kCAEF,GAAA;AAAA,oBAAC,SAAA;AAAA,oBAAA;AAAA,sBACC,SAAA,EAAW,EAAA;AAAA,wBACT,CAAC,SAAA,IAAa,yBAAA;AAAA,wBACd,yBAAA;AAAA,wBACA,UAAA,EAAY;AAAA,uBACd;AAAA,sBAEC;AAAA;AAAA;AACH;AAAA;AAAA;AACF;AAAA;AACF,OAAA,EACF;AAAA;AAAA,GACF;AAEJ,CAAA;AAEO,IAAM,KAAA,GAAQ,MAAA,CAAO,MAAA,CAAO,cAAA,EAAgB;AAAA,EACjD,IAAA,EAAM,SAAA;AAAA,EACN,OAAA,EAAS,YAAA;AAAA,EACT,OAAA,EAAS,YAAA;AAAA,EACT,QAAA,EAAU,aAAA;AAAA,EACV,UAAA,EAAY,eAAA;AAAA,EACZ,OAAA,EAAS,YAAA;AAAA,EACT,KAAA,EAAO,UAAA;AAAA,EACP,WAAA,EAAa,gBAAA;AAAA,EACb,YAAA,EAAc,iBAAA;AAAA,EACd,MAAA,EAAQ,WAAA;AAAA,EACR,IAAA,EAAM,SAAA;AAAA,EACN,MAAA,EAAQ;AACV,CAAC","file":"chunk-J3PELDH3.js","sourcesContent":["\"use client\"\n\nimport { Dialog as Ark } from \"@ark-ui/react/dialog\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { XIcon } from \"lucide-react\"\nimport { type ComponentPropsWithoutRef, type ReactNode, useRef } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { OverlayContainerProvider } from \"../../lib/overlay-container\"\nimport { OverlayLayerProvider, useLayerGuard } from \"../../lib/overlay-layer\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { ActionIcon } from \"../action-icon/action-icon\"\n\n/**\n * Modal — centered overlay dialog on top of Ark UI's Dialog state machine.\n * Ark owns focus-trap, scroll-lock, RTL, the `Esc` / click-outside behaviour\n * and the `data-state=\"open|closed\"` attribute that drives our enter/exit\n * animations (keyframes live in `theme.css`). This wrapper provides the styled\n * parts and a flatter props API.\n *\n * - High-level form: `<Modal open title size … >children</Modal>` renders the\n * full Portal → Backdrop → Positioner → Content → Header + Body scaffold.\n * This is what the imperative overlays manager mounts.\n * - Low-level parts (`Modal.Root`, `Modal.Content`, `Modal.Title`, …) are\n * exposed for full control / trigger-based composition.\n *\n * Surface padding flows through the `--modal-px` CSS var set on the content, so\n * `Modal.Header` / `Modal.Body` / `Modal.Footer` stay in rhythm without prop\n * plumbing — and keep a sensible fallback when used standalone.\n */\n\nconst modalBackdrop = cva([\n \"fixed inset-0 z-[calc(var(--modal-z,150)+var(--layer-index,0))] bg-black/50 backdrop-blur-lg pointer-events-auto select-none\",\n \"data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out\",\n])\n\nconst modalPositioner = cva(\n \"fixed inset-0 z-[calc(var(--modal-z,150)+var(--layer-index,0))] flex flex-col items-center overflow-y-auto p-4\",\n {\n variants: {\n position: {\n center: \"justify-center\",\n top: \"justify-start mt-[8vh]\",\n bottom: \"justify-end mb-[8vh]\",\n },\n },\n defaultVariants: { position: \"center\" },\n },\n)\n\nconst modalContent = cva(\n [\n \"relative flex w-full flex-col\",\n \"max-h-[calc(100dvh-2rem)]\",\n \"bg-brand-50 text-gray-light-900 border border-brand-900/20 shadow-2xl\",\n \"dark:bg-brand-950 dark:text-gray-dark-25 dark:border-white/15\",\n \"focus:outline-none\",\n \"data-[state=open]:animate-modal-in data-[state=closed]:animate-modal-out\",\n ],\n {\n variants: {\n size: {\n xs: \"max-w-(--width-xs)\", // 24rem\n sm: \"max-w-(--width-sm)\", // 30rem\n md: \"max-w-(--width-md)\", // 35rem\n lg: \"max-w-(--width-lg)\", // 40rem\n xl: \"max-w-(--width-xl)\", // 48rem\n full: \"max-w-[calc(100vw-2rem)] min-h-[calc(100dvh-2rem)]\",\n },\n radius: {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-xl\",\n xl: \"rounded-2xl\",\n },\n },\n defaultVariants: { size: \"md\", radius: \"sm\" },\n },\n)\n\n/** px → CSS length applied as `--modal-px`; vertical rhythm derives from it. */\nconst PADDING: Record<Size, string> = {\n xs: \"0.75rem\",\n sm: \"1rem\",\n md: \"1.25rem\",\n lg: \"1.5rem\",\n xl: \"2rem\",\n}\n\n// ---------------------------------------------------------------------------\n// Low-level parts (styled Ark parts + kit conveniences)\n// ---------------------------------------------------------------------------\n\nexport type ModalRootProps = ComponentPropsWithoutRef<typeof Ark.Root>\n\n/** Ark's root, plus the nested-layer guard: while a picker opened inside the\n * dialog is open, an outside click closes the picker only, not the dialog\n * under it. See `lib/overlay-layer.tsx`. */\nconst ModalRoot = ({ onPointerDownOutside, children, ...rest }: ModalRootProps) => {\n const guard = useLayerGuard(onPointerDownOutside)\n return (\n <Ark.Root onPointerDownOutside={guard.onPointerDownOutside} {...rest}>\n <OverlayLayerProvider value={guard.layers}>{children}</OverlayLayerProvider>\n </Ark.Root>\n )\n}\nconst ModalTrigger = Ark.Trigger\nconst ModalContext = Ark.Context\n\nexport type ModalBackdropProps = ComponentPropsWithoutRef<typeof Ark.Backdrop> & WithTestId\n\nconst ModalBackdrop = ({ className, testId, ...rest }: ModalBackdropProps) => (\n <Ark.Backdrop\n className={cn(modalBackdrop(), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type ModalPosition = VariantProps<typeof modalPositioner>[\"position\"]\nexport type ModalPositionerProps = ComponentPropsWithoutRef<typeof Ark.Positioner> &\n WithTestId & {\n position?: ModalPosition\n }\n\nconst ModalPositioner = ({\n className,\n position,\n testId,\n children,\n ...rest\n}: ModalPositionerProps) => {\n // A ref, not state: overlays read it when they portal, so nothing has to\n // re-render once it attaches (see `lib/overlay-container.tsx`).\n const positioner = useRef<HTMLDivElement>(null)\n return (\n <Ark.Positioner\n ref={positioner}\n className={cn(modalPositioner({ position }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n <OverlayContainerProvider value={positioner}>{children}</OverlayContainerProvider>\n </Ark.Positioner>\n )\n}\n\nexport type ModalContentProps = ComponentPropsWithoutRef<typeof Ark.Content> &\n VariantProps<typeof modalContent> &\n WithTestId\n\nconst ModalContent = ({ className, size, radius, testId, ...rest }: ModalContentProps) => (\n <Ark.Content\n className={cn(modalContent({ size, radius }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type ModalTitleProps = ComponentPropsWithoutRef<typeof Ark.Title> & WithTestId\n\nconst ModalTitle = ({ className, testId, ...rest }: ModalTitleProps) => (\n <Ark.Title\n className={cn(\"text-xl font-semibold leading-tight\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type ModalDescriptionProps = ComponentPropsWithoutRef<typeof Ark.Description> & WithTestId\n\nconst ModalDescription = ({ className, testId, ...rest }: ModalDescriptionProps) => (\n <Ark.Description\n className={cn(\"text-sm text-gray-light-500 dark:text-gray-dark-400\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type ModalCloseTriggerProps = ComponentPropsWithoutRef<typeof Ark.CloseTrigger> &\n WithTestId & {\n \"aria-label\"?: string\n }\n\nconst ModalCloseTrigger = ({\n children,\n className,\n \"aria-label\": ariaLabel = \"Close\",\n testId,\n ...rest\n}: ModalCloseTriggerProps) => (\n <Ark.CloseTrigger asChild {...rest}>\n <ActionIcon\n variant=\"subtle\"\n color=\"neutral\"\n size=\"xs\"\n aria-label={ariaLabel}\n className={className}\n testId={testId}\n >\n {children ?? <XIcon />}\n </ActionIcon>\n </Ark.CloseTrigger>\n)\n\nexport type ModalHeaderProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\nconst ModalHeader = ({ className, testId, ...rest }: ModalHeaderProps) => (\n <div\n className={cn(\n \"flex items-start min-h-15 justify-between gap-4 px-(--modal-px,1.25rem) pt-(--modal-px,1.25rem) pb-3\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type ModalBodyProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\nconst ModalBody = ({ className, testId, ...rest }: ModalBodyProps) => (\n <div\n className={cn(\"flex-1 overflow-y-auto px-(--modal-px,1.25rem) py-1\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type ModalFooterProps = ComponentPropsWithoutRef<\"div\"> & WithTestId\n\nconst ModalFooter = ({ className, testId, ...rest }: ModalFooterProps) => (\n <div\n className={cn(\n \"flex items-center justify-end gap-2 px-(--modal-px,1.25rem) pb-(--modal-px,1.25rem) pt-4\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\n// ---------------------------------------------------------------------------\n// High-level props-driven Modal\n// ---------------------------------------------------------------------------\n\ntype ArkRootProps = ComponentPropsWithoutRef<typeof Ark.Root>\n\nexport type ModalSize = NonNullable<VariantProps<typeof modalContent>[\"size\"]>\nexport type ModalRadius = NonNullable<VariantProps<typeof modalContent>[\"radius\"]>\n\nexport type ModalClassNames = Partial<\n Record<\n | \"backdrop\"\n | \"positioner\"\n | \"content\"\n | \"header\"\n | \"title\"\n | \"description\"\n | \"body\"\n | \"closeButton\",\n string\n >\n>\n\nexport type ModalProps = Omit<\n ArkRootProps,\n \"open\" | \"defaultOpen\" | \"onOpenChange\" | \"children\" | \"role\"\n> &\n WithTestId & {\n /** Controlled open state. */\n open?: boolean\n /** Uncontrolled initial open state. */\n defaultOpen?: boolean\n /** Fires with the next open state. Flattened from Ark's `{ open }`. */\n onOpenChange?: (open: boolean) => void\n /** Header title; renders the header when set. */\n title?: ReactNode\n /** Optional subtitle under the title. */\n description?: ReactNode\n size?: ModalSize\n radius?: ModalRadius\n /** Vertically center the modal (vs. anchored near the top). */\n position?: ModalPosition\n /** Render the default close button in the header. @default true */\n withCloseButton?: boolean\n /**\n * Render the dimming backdrop. Set `false` when an ancestor (e.g. the modals\n * manager) draws a single shared backdrop for the whole overlay stack.\n * @default true\n */\n withBackdrop?: boolean\n /** Inner padding token; sets `--modal-px`. @default \"md\" */\n padding?: Size\n closeOnEscape?: boolean\n closeOnInteractOutside?: boolean\n /** Use `alertdialog` semantics (confirm flows). @default \"dialog\" */\n role?: \"dialog\" | \"alertdialog\"\n /** Fires after the exit animation completes; the manager unmounts on this. */\n onExitComplete?: () => void\n /** Fires on close (any source) */\n onClose?: () => void\n /** Portal target. Defaults to `document.body`. */\n container?: HTMLElement | null\n children?: ReactNode\n className?: string\n classNames?: ModalClassNames\n }\n\nconst ModalComponent = ({\n open,\n defaultOpen,\n onOpenChange,\n onClose,\n title,\n description,\n size,\n radius,\n position,\n withCloseButton = true,\n withBackdrop = true,\n padding = \"md\",\n closeOnEscape,\n closeOnInteractOutside,\n role,\n onExitComplete,\n container,\n children,\n className,\n classNames,\n testId,\n ...rest\n}: ModalProps) => {\n const hasHeader = title != null || description != null || withCloseButton\n\n return (\n <ModalRoot\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={({ open: next }) => {\n onOpenChange?.(next)\n if (!next) onClose?.()\n }}\n closeOnEscape={closeOnEscape}\n // Decoupled from `modal` on purpose: Ark's dialog derives this default\n // from `modal` (`modal && !alertdialog`), so when the overlays manager\n // draws its own shared backdrop and passes `withBackdrop={false}` —\n // forcing `modal={false}` below — outside-click would silently stop\n // dismissing. Default to Ark's intended behaviour instead: dismiss for\n // regular dialogs, keep `alertdialog`s sticky (explicit choice required).\n closeOnInteractOutside={closeOnInteractOutside ?? role !== \"alertdialog\"}\n role={role}\n // Unmount the whole content tree (incl. the `fixed inset-0` positioner)\n // on close — otherwise the positioner lingers as a transparent overlay\n // that swallows page clicks. `lazyMount` keeps it out of the DOM until\n // first open. Both flow to the parts' presence via Ark's Root context.\n lazyMount\n unmountOnExit\n modal={withBackdrop}\n onExitComplete={onExitComplete}\n {...rest}\n >\n <Portal container={container ? { current: container } : undefined}>\n {withBackdrop && <ModalBackdrop className={classNames?.backdrop} />}\n <ModalPositioner\n position={position}\n className={cn(classNames?.positioner, \"overflow-clip\")}\n >\n <ModalContent\n size={size}\n radius={radius}\n style={{ [\"--modal-px\" as string]: PADDING[padding] }}\n className={cn(className, classNames?.content)}\n testId={testId}\n >\n {hasHeader && (\n <ModalHeader className={classNames?.header}>\n <div className=\"flex flex-col gap-1\">\n {title != null && <ModalTitle className={classNames?.title}>{title}</ModalTitle>}\n {description != null && (\n <ModalDescription className={classNames?.description}>\n {description}\n </ModalDescription>\n )}\n </div>\n {withCloseButton && <ModalCloseTrigger className={classNames?.closeButton} />}\n </ModalHeader>\n )}\n <ModalBody\n className={cn(\n !hasHeader && \"pt-(--modal-px,1.25rem)\",\n \"pb-(--modal-px,1.25rem)\",\n classNames?.body,\n )}\n >\n {children}\n </ModalBody>\n </ModalContent>\n </ModalPositioner>\n </Portal>\n </ModalRoot>\n )\n}\n\nexport const Modal = Object.assign(ModalComponent, {\n Root: ModalRoot,\n Trigger: ModalTrigger,\n Context: ModalContext,\n Backdrop: ModalBackdrop,\n Positioner: ModalPositioner,\n Content: ModalContent,\n Title: ModalTitle,\n Description: ModalDescription,\n CloseTrigger: ModalCloseTrigger,\n Header: ModalHeader,\n Body: ModalBody,\n Footer: ModalFooter,\n})\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/colors.ts"],"names":[],"mappings":";AAWO,IAAM,MAAA,GAAS;AAAA,EACpB,OAAA;AAAA,EACA,MAAA;AAAA;AAAA;AAAA,EAGA,SAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF","file":"chunk-JBVFWSRQ.js","sourcesContent":["/**\n * Single source of truth for the `color` prop accepted by colored components\n * (Button, ActionIcon, Slider, …). The const array drives both the type and\n * any runtime iteration (docs swatches, story controls).\n *\n * Adding a new color is a three-step change:\n * 1. Append the name here.\n * 2. Define its `--color-<name>-{25..950}` scale in `theme.css`.\n * 3. Add a `[data-color=\"<name>\"]` block in `colors.css` with the slot vars\n * (and a dark-mode override if the shade should shift).\n */\nexport const COLORS = [\n \"brand\",\n \"gray\",\n // Composed from existing white/gray/brand-950 tokens rather than its own\n // scale — the literal white/dark-navy button from the 42 UI Kit Figma.\n \"neutral\",\n \"red\",\n \"orange\",\n \"yellow\",\n \"green\",\n \"teal\",\n \"cyan\",\n \"blue\",\n \"purple\",\n \"pink\",\n] as const\n\n// Extend the type to allow custom color strings (e.g. `color=\"custom\"`)\n// but still allow complete type safety for the predefined colors\nexport type Color = (typeof COLORS)[number] | (string & {})\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/pill/pill.tsx"],"names":[],"mappings":";;;;;;;;AA4BO,IAAM,gBAAA,GAAmB,cAA4C,IAAI;AAGzE,IAAM,IAAA,GAAO,GAAA;AAAA,EAClB;AAAA,IACE,qCAAA;AAAA,IACA,4CAAA;AAAA,IACA,0BAAA;AAAA;AAAA,IAEA,yEAAA;AAAA,IACA,4CAAA;AAAA,IACA,qDAAA;AAAA,IACA,6BAAA;AAAA,IACA,2DAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,gBAAA,EAAkB;AAAA,QAChB,EAAA,EAAI,eAAA;AAAA,QACJ,EAAA,EAAI,cAAA;AAAA,QACJ,EAAA,EAAI,aAAA;AAAA,QACJ,EAAA,EAAI,cAAA;AAAA,QACJ,EAAA,EAAI;AAAA,OACN;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,EAAA,EAAI,uCAAA;AAAA,QACJ,EAAA,EAAI,wBAAA;AAAA,QACJ,EAAA,EAAI,0BAAA;AAAA,QACJ,EAAA,E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AACd;AAAA;AAAA,GAEJ;AAEJ;AAEA,IAAM,cAAA,GAA2C;AAAA,EAC/C,EAAA,EAAI,OAAA;AAAA,EACJ,EAAA,EAAI,OAAA;AAAA,EACJ,EAAA,EAAI,OAAA;AAAA,EACJ,EAAA,EAAI,SAAA;AAAA,EACJ,EAAA,EAAI;AACN,CAAA;AASO,IAAM,YAAY,CAAC;AAAA,EACxB,IAAA,GAAO,IAAA;AAAA,EACP,QAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA;AAAA,EACA,GAAG;AACL,CAAA,qBACE,GAAA,CAAC,iBAAiB,QAAA,EAAjB,EAA0B,OAAO,EAAE,IAAA,EAAM,UAAS,EACjD,QAAA,kBAAA,GAAA;AAAA,EAAC,GAAA,CAAI,GAAA;AAAA,EAAJ;AAAA,IACC,SAAA,EAAW,EAAA;AAAA,MACT,+CAAA;AAAA,MACA,eAAe,IAAI,CAAA;AAAA,MACnB;AAAA,KACF;AAAA,IACC,GAAG,IAAA;AAAA,IAEH;AAAA;AACH,CAAA,EACF","file":"chunk-NGAQITWP.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { createContext, useContext } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { props } from \"../../lib/props\"\nimport type { RequiredIfTrue } from \"../../lib/required-if\"\nimport type { WithTestId } from \"../../lib/test-id\"\n\n/**\n * Pill — compact, optionally removable chip. The visual the form family renders\n * selected values into (MultiSelect / TagsInput), and a standalone tag/token\n * elsewhere.\n *\n * - Neutral gray by default; pass a `color` to tint it with the palette's\n * soft surface + text slots (`--c-soft` / `--c-text`) via `data-color`.\n * - `withRemoveButton` renders a trailing `×` button that fires `onRemove`.\n * - `size` (and `disabled`) can be set per-pill or inherited once from a\n * wrapping `PillGroup` through context — explicit props win.\n *\n * `asChild` is inherited from the `ark.span` factory for polymorphism.\n */\n\ntype PillGroupContextValue = { size?: PillSize; disabled?: boolean }\n/** Exported so `PillsInput` can size/disable the pills it hosts (same as a group). */\nexport const PillGroupContext = createContext<PillGroupContextValue | null>(null)\n\n/** Exported so TagsInput can style its Ark tag preview to look like a Pill. */\nexport const pill = cva(\n [\n \"inline-flex items-center max-w-full\",\n \"whitespace-nowrap select-none align-middle\",\n \"rounded-pill font-medium\",\n // Neutral default; a `data-color` tint overrides it (higher specificity).\n \"bg-black/8 dark:bg-white/16 text-gray-light-800 dark:text-gray-dark-100\",\n \"border border-black/8 dark:border-white/15\",\n \"data-color:bg-(--c-soft) data-color:text-(--c-text)\",\n \"data-color:bg-(--c-soft)/35\",\n \"data-disabled:cursor-not-allowed data-disabled:opacity-60\",\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0\",\n ],\n {\n variants: {\n withRemoveButton: {\n xs: \"pe-[0.125rem]\",\n sm: \"pe-[0.15rem]\",\n md: \"pe-[0.2rem]\",\n lg: \"pe-[0.25rem]\",\n xl: \"pe-[0.3rem]\",\n },\n size: {\n xs: \"h-4.5 px-1.5 text-[0.6875rem] gap-0.5\",\n sm: \"h-5 px-2 text-xs gap-1\",\n md: \"h-5.5 px-2 text-xs gap-1\",\n lg: \"h-6 px-2.5 text-sm gap-1\",\n xl: \"h-7 px-3 text-sm gap-1.5\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\n/** Exported alongside `pill` for TagsInput's delete trigger. */\nexport const pillRemove = cva(\n [\n \"inline-flex items-center justify-center shrink-0 rounded-full\",\n \"text-current/70 hover:text-current\",\n \"transition-colors hover:bg-black/10 dark:hover:bg-white/10\",\n focusStyles({ ring: \"palette\", offset: false }),\n \"disabled:pointer-events-none\",\n \"cursor-pointer\",\n ],\n {\n variants: {\n size: {\n xs: \"size-3\",\n sm: \"size-3.5\",\n md: \"size-4\",\n lg: \"size-4.5\",\n xl: \"size-5\",\n },\n },\n defaultVariants: { size: \"md\" },\n },\n)\n\nexport type PillSize = NonNullable<VariantProps<typeof pill>[\"size\"]>\n\nconst RemoveIcon = () => (\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={1.5}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18M6 6l12 12\" />\n </svg>\n)\n\ntype PillClassNames = {\n root?: string\n label?: string\n remove?: string\n}\n\nexport type PillProps<WithRemoveButton extends boolean = false> = Omit<\n HTMLArkProps<\"span\">,\n \"color\"\n> &\n WithTestId & {\n size?: PillSize\n /** Accent palette — tints the chip with the soft surface. Neutral when unset. */\n color?: Color\n /**\n * Render a trailing remove (`×`) button that fires `onRemove`. Passing a\n * literal `true` (or otherwise call-site-resolvable value) makes\n * `onRemove` a **compile error** to omit — see `lib/required-if.ts`. A\n * non-literal `withRemoveButton` (a plain `boolean` variable) can't be\n * resolved to a specific value at compile time, so it conservatively\n * requires `onRemove` too, rather than silently allowing its absence.\n */\n withRemoveButton?: WithRemoveButton\n /** Accessible label for the remove button. */\n removeLabel?: string\n disabled?: boolean\n classNames?: PillClassNames\n } & RequiredIfTrue<WithRemoveButton, { onRemove: () => void }>\n\nexport function Pill<const WithRemoveButton extends boolean = false>({\n size: sizeProp,\n color,\n withRemoveButton,\n onRemove,\n removeLabel = \"Remove\",\n disabled: disabledProp,\n children,\n className,\n classNames,\n testId,\n ...rest\n}: PillProps<WithRemoveButton>) {\n const group = useContext(PillGroupContext)\n const size = sizeProp ?? group?.size ?? \"md\"\n const disabled = disabledProp ?? group?.disabled\n\n return (\n <ark.span\n data-color={color}\n data-disabled={disabled || undefined}\n className={cn(\n pill({ size, withRemoveButton: withRemoveButton ? size : undefined }),\n className,\n classNames?.root,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n <span className={cn(\"truncate text-trim\", classNames?.label)}>{children}</span>\n {withRemoveButton && (\n <button\n type=\"button\"\n aria-label={removeLabel}\n disabled={disabled}\n // Keep focus on the host input (e.g. inside a PillsInput) and stop\n // the click from bubbling to an enclosing option / control.\n onMouseDown={(e) => e.preventDefault()}\n onClick={(e) => {\n e.stopPropagation()\n onRemove?.()\n }}\n className={cn(pillRemove({ size }), classNames?.remove)}\n {...props({ \"data-testid\": testId && `${testId}-remove` })}\n >\n <RemoveIcon />\n </button>\n )}\n </ark.span>\n )\n}\n\nconst PILL_GROUP_GAP: Record<PillSize, string> = {\n xs: \"gap-1\",\n sm: \"gap-1\",\n md: \"gap-1\",\n lg: \"gap-1.5\",\n xl: \"gap-1.5\",\n}\n\nexport type PillGroupProps = HTMLArkProps<\"div\"> & {\n /** Shared size for child pills (each pill can still override). */\n size?: PillSize\n /** Disable every pill in the group. */\n disabled?: boolean\n}\n\nexport const PillGroup = ({\n size = \"md\",\n disabled,\n className,\n children,\n ...rest\n}: PillGroupProps) => (\n <PillGroupContext.Provider value={{ size, disabled }}>\n <ark.div\n className={cn(\n \"inline-flex max-w-full flex-wrap items-center\",\n PILL_GROUP_GAP[size],\n className,\n )}\n {...rest}\n >\n {children}\n </ark.div>\n </PillGroupContext.Provider>\n)\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/pills-input/pills-input.tsx"],"names":[],"mappings":";;;;;;;;;AAmDO,IAAM,UAAA,GAAa,GAAG,aAAa;AAMnC,IAAM,YAAA,GAAe,IAAI,2DAAA,EAA6D;AAAA,EAC3F,QAAA,EAAU;AAAA,IACR,IAAA,EAAM;AAAA,MACJ,EAAA,EAAI,SAAA;AAAA,MACJ,EAAA,EAAI,SAAA;AAAA,MACJ,EAAA,EAAI,OAAA;AAAA,MACJ,EAAA,EAAI,SAAA;AAAA,MACJ,EAAA,EAAI;AAAA;AACN,GACF;AAAA,EACA,eAAA,EAAiB,EAAE,IAAA,EAAM,IAAA;AAC3B,CAAC;AAKD,IAAM,kBAAA,GAAqB,OAAO,QAAA,KAAa,WAAA,GAAc,eAAA,GAAkB,SAAA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AACL,CAAA,qBACE,GAAA;AAAA,EAAC,OAAA;AAAA,EAAA;AAAA,IAEC,qBAAA,EAAmB,IAAA;AAAA,IAGnB,SAAA,EAAW,EAAA,CAAG,mBAAA,EAAqB,iBAAA,EAAmB,SAAS,CAAA;AAAA,IAC/D,SAAA,EAAW,CAAC,KAAA,KAAU;AACpB,MAAA,IAAI,gBAAgB,KAAA,CAAM,GAAA,KAAQ,eAAe,KAAA,CAAM,aAAA,CAAc,UAAU,EAAA,EAAI;AACjF,QAAA,YAAA,EAAa;AAAA,MACf;AACA,MAAA,SAAA,GAAY,KAAK,CAAA;AAAA,IACnB,CAAA;AAAA,IACC,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,IAClC,GAAG;AAAA;AACN,CAAA;AAGK,IAAM,UAAA,GAAa,MAAA,CAAO,MAAA,CAAO,cAAA,EAAgB;AAAA,EACtD,KAAA,EAAO;AACT,CAAC","file":"chunk-POKDSVQT.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva } from \"class-variance-authority\"\nimport {\n Children,\n type ComponentPropsWithoutRef,\n cloneElement,\n isValidElement,\n type ReactElement,\n type ReactNode,\n type RefObject,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport {\n type InputSize,\n type InputVariant,\n inputControlClasses,\n inputShell,\n inputSlot,\n} from \"../input/input\"\nimport { PillGroupContext, type PillSize, pill } from \"../pill/pill\"\n\n/**\n * PillsInput — a multi-line input shell that lays out `Pill`s alongside a search\n * field. Same chrome as `Input` (border, focus ring, invalid / disabled states)\n * but it wraps as values accumulate. It's the visual `MultiSelect` and\n * `TagsInput` mount as their target.\n *\n * - It reuses `Input`'s slot layout: a `startSlot` / `endSlot` flank a\n * `pillsContent` region that holds the `Pill`s + the field and is the only\n * thing that wraps, so a trailing control (chevron, clear) pins to the edge\n * instead of wrapping inline with the pills.\n * - Host `Pill`s + a single `PillsInputField` inside it (pills first, field\n * last). The shell sets the pill `size` / `disabled` through context, so the\n * pills match with no prop drilling.\n * - `maxLines` caps the pills at N rows and collapses the rest into a static\n * \"+N\" counter (measured, since pills have variable widths).\n *\n * Presentational by design: the value state lives with the consumer.\n */\n\n/** The pills *row*: same single-line flex shell as `inputShell`, just text-cursor\n * for the click-to-focus affordance. Layout/wrap live on `pillsContent`. */\nexport const pillsShell = cn(\"cursor-text\")\n\n/** The wrapping region inside a pills shell — holds the pills + field, grows to\n * fill the row (`flex-1`), and is the only element that wraps, so the shell's\n * start/end slots stay pinned as `shrink-0` siblings. Gap tracks `inputShell`'s\n * per-size gap so pill spacing is unchanged from the flat layout. */\nexport const pillsContent = cva(\"flex min-w-0 flex-1 flex-wrap items-center py-1 gap-y-0.5\", {\n variants: {\n size: {\n xs: \"gap-1.5\",\n sm: \"gap-1.5\",\n md: \"gap-2\",\n lg: \"gap-2.5\",\n xl: \"gap-3\",\n },\n },\n defaultVariants: { size: \"md\" },\n})\n\n// `useLayoutEffect` measures before paint (no flash); fall back to `useEffect`\n// on the server so SSR doesn't warn. Measurement is client-only anyway — the\n// server render shows every pill, which is the correct no-cap fallback.\nconst useIsoLayoutEffect = typeof document !== \"undefined\" ? useLayoutEffect : useEffect\n\n/**\n * Pure row-grouping math behind `usePillOverflow` (exported for testing).\n *\n * Given each measured pill's `offsetTop` (in document order), count how many\n * fit within `maxLines` wrapped rows. A jump in `offsetTop` (beyond a sub-pixel\n * epsilon) marks a new row. When the pills overflow, reserve one slot on the\n * last visible row for the \"+N\" counter (it's narrower than a typical pill, so\n * dropping one always makes room).\n */\nexport function visiblePillCount(offsetTops: number[], maxLines: number): number {\n let rows = 0\n let lastTop = Number.NEGATIVE_INFINITY\n for (let i = 0; i < offsetTops.length; i++) {\n const top = offsetTops[i] ?? lastTop\n if (top - lastTop > 1) {\n rows += 1\n lastTop = top\n if (rows > maxLines) {\n // `i` begins the row past the cap — keep the rows before it, minus one\n // for the counter.\n return Math.max(0, i - 1)\n }\n }\n }\n return offsetTops.length\n}\n\n/**\n * Like `visiblePillCount`, but also keeps the trailing input field on the last\n * visible row (exported for testing).\n *\n * `visiblePillCount` only reasons about pills, so when the last visible row is\n * packed, the field — which is `min-w-16` and the last flex child — can't claim\n * its minimum width and wraps onto a new line. A flex item wraps exactly when\n * the space left on its row drops below its `min-width`, so we drop pills until\n * the last visible pill leaves room on its row for `gap + fieldMinWidth` (plus\n * the `+N` counter, once anything is hidden). Pills are passed as their measured\n * `{ top, right }` in a single coordinate space; removing a trailing pill never\n * reflows the ones before it, so each drop is checked against real geometry.\n */\nexport function pillCountWithField(\n pills: { top: number; right: number }[],\n maxLines: number,\n rowRight: number,\n trailing: { fieldMinWidth: number; counterWidth: number; gap: number },\n): number {\n const total = pills.length\n const { fieldMinWidth, counterWidth, gap } = trailing\n // Start from the pill-only cap (already reserves one slot for the counter on\n // overflow), then back off until the field's minimum fits on the last row.\n let visible = visiblePillCount(\n pills.map((p) => p.top),\n maxLines,\n )\n while (visible > 0) {\n const last = pills[visible - 1]\n if (last == null) break\n // Hiding any pill surfaces the \"+N\" counter, which shares the last row.\n const needsCounter = visible < total\n const trailingWidth = gap + fieldMinWidth + (needsCounter ? counterWidth + gap : 0)\n if (last.right + trailingWidth <= rowRight) break\n visible--\n }\n return visible\n}\n\n/**\n * Measure how many pills fit within `maxLines` rows and how many overflow.\n *\n * Line caps are width-dependent (pills vary in width), so this measures the DOM.\n * Pills to be measured must carry `data-overflow-item`; the trailing field and\n * the counter must NOT (they would corrupt row detection) — instead the field\n * carries `data-overflow-field` and the counter `data-overflow-counter` so the\n * hook can locate and measure them without mistaking them for pills. The hook\n * renders the full set during a pre-paint \"measuring\" pass, groups pills into\n * rows, then settles on a `visibleCount` — reserving the last row for the \"+N\"\n * chip and, when a field is present, its `min-width` too, so the field never\n * wraps onto a new line (see `pillCountWithField`). Re-measures on width change\n * only (ignoring the height change our own slicing causes, which would loop).\n *\n * `measuring` is exposed so consumers can render the counter during the\n * measuring pass (it is otherwise hidden when nothing overflows), letting the\n * hook measure its real width for the last-row reservation.\n */\nexport function usePillOverflow({\n maxLines,\n count,\n}: {\n /** Cap the rendered pills at this many rows. Omit to render every pill. */\n maxLines?: number\n /** Total number of pills — drives re-measurement on add / remove. */\n count: number\n}): {\n containerRef: RefObject<HTMLDivElement | null>\n visibleCount: number\n hiddenCount: number\n measuring: boolean\n} {\n const containerRef = useRef<HTMLDivElement>(null)\n const [visibleCount, setVisibleCount] = useState(count)\n // While true, every pill is rendered so the DOM reflects the full set; flipped\n // off (pre-paint) once the cutoff is computed.\n const [measuring, setMeasuring] = useState(true)\n const lastWidth = useRef(0)\n\n // Any change to the inputs re-enters a full-render measuring pass.\n useIsoLayoutEffect(() => {\n setMeasuring(true)\n }, [count, maxLines])\n\n useIsoLayoutEffect(() => {\n if (!measuring) return\n const container = containerRef.current\n if (maxLines == null || container == null) {\n setVisibleCount(count)\n setMeasuring(false)\n return\n }\n const items = Array.from(container.querySelectorAll<HTMLElement>(\"[data-overflow-item]\"))\n lastWidth.current = container.clientWidth\n\n const fieldEl = container.querySelector<HTMLElement>(\"[data-overflow-field]\")\n if (fieldEl == null) {\n // No trailing field (e.g. TreeMultiSelect's read-only trigger) — pills +\n // counter only, the original behavior.\n setVisibleCount(\n visiblePillCount(\n items.map((el) => el.offsetTop),\n maxLines,\n ),\n )\n setMeasuring(false)\n return\n }\n\n // Field-aware: reserve the field's min width (and the counter slot) on the\n // last visible row. Measure in viewport coords via `getBoundingClientRect`\n // so pill edges and the row's right edge share one coordinate space\n // regardless of `offsetParent` (the positioned shell, not this container).\n const style = getComputedStyle(container)\n const gap = Number.parseFloat(style.columnGap || style.gap) || 0\n const rowRight = container.getBoundingClientRect().right\n const fieldMinWidth = Number.parseFloat(getComputedStyle(fieldEl).minWidth) || 0\n const counterEl = container.querySelector<HTMLElement>(\"[data-overflow-counter]\")\n const counterWidth = counterEl?.getBoundingClientRect().width ?? 0\n const pills = items.map((el) => {\n const rect = el.getBoundingClientRect()\n return { top: rect.top, right: rect.right }\n })\n setVisibleCount(\n pillCountWithField(pills, maxLines, rowRight, { fieldMinWidth, counterWidth, gap }),\n )\n setMeasuring(false)\n }, [measuring, count, maxLines])\n\n // Re-measure when the field's width changes (a wider field reveals more\n // pills again). Ignore height-only changes — our own slicing shrinks the\n // height and would otherwise feed back into an infinite measure loop.\n useIsoLayoutEffect(() => {\n const container = containerRef.current\n if (maxLines == null || container == null || typeof ResizeObserver === \"undefined\") {\n return\n }\n const observer = new ResizeObserver((entries) => {\n const width = entries[0]?.contentRect.width ?? 0\n if (Math.abs(width - lastWidth.current) < 1) return\n lastWidth.current = width\n setMeasuring(true)\n })\n observer.observe(container)\n return () => observer.disconnect()\n }, [maxLines])\n\n const resolved = maxLines == null || measuring ? count : Math.min(visibleCount, count)\n return {\n containerRef,\n visibleCount: resolved,\n hiddenCount: Math.max(0, count - resolved),\n measuring,\n }\n}\n\nexport type PillOverflowCounterProps = {\n /** How many pills are hidden. */\n count: number\n size?: PillSize\n className?: string\n}\n\n/** Static \"+N\" chip the pill controls render at the end of the visible rows.\n * Non-interactive: the visible \"+N\" is its own accessible text, and the full\n * set stays reachable via the dropdown (where one exists) or the consumer's\n * own state. */\nexport const PillOverflowCounter = ({\n count,\n size = \"md\",\n className,\n}: PillOverflowCounterProps) => (\n <span data-overflow-counter className={cn(pill({ size }), \"tabular-nums\", className)}>\n +{count}\n </span>\n)\n\ntype PillsInputClassNames = {\n root?: string\n content?: string\n startSlot?: string\n endSlot?: string\n}\n\nexport type PillsInputProps = Omit<HTMLArkProps<\"div\">, \"color\"> &\n WithTestId & {\n size?: InputSize\n variant?: InputVariant\n color?: Color\n invalid?: boolean\n disabled?: boolean\n pointer?: boolean\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 any trailing control. */\n endSlot?: ReactNode\n classNames?: PillsInputClassNames\n }\n\n/**\n * PillsInput — the wrapping input shell for multi-value fields. Host `Pill`s\n * and a single `PillsInput.Field` inside; the shell sizes and disables them\n * through context. Presentational by design: it holds no value state.\n *\n * `testId` here lands on the shell `<div>` itself — useful when `PillsInput`\n * is used bare. `PillsInput.Field` has its own `testId`, landing on the real\n * focusable `<input>`; prefer that one when targeting the field.\n */\nconst PillsInputBase = ({\n size = \"md\",\n variant = \"default\",\n color,\n invalid,\n disabled,\n pointer,\n maxLines,\n startSlot,\n endSlot,\n className,\n classNames,\n children,\n testId,\n ...rest\n}: PillsInputProps) => {\n // Convention: pills first, the field last. Only the pills feed the line cap;\n // the field always stays visible (it is never sliced away).\n const items = Children.toArray(children)\n const field = items.length > 0 ? items[items.length - 1] : null\n const pills = items.length > 0 ? items.slice(0, -1) : []\n\n const { containerRef, visibleCount, hiddenCount, measuring } = usePillOverflow({\n maxLines,\n count: pills.length,\n })\n\n const renderedPills = (maxLines == null ? pills : pills.slice(0, visibleCount)).map((child, i) =>\n isValidElement(child)\n ? cloneElement(child as ReactElement<Record<string, unknown>>, {\n key: child.key ?? i,\n \"data-overflow-item\": true,\n })\n : child,\n )\n\n return (\n <PillGroupContext.Provider value={{ size, disabled }}>\n <ark.div\n data-color={color}\n {...props({\n \"data-invalid\": invalid,\n \"data-disabled\": disabled,\n \"data-pointer\": pointer,\n // Slot-aware padding in `inputShell` — see InputBase for the rationale.\n \"data-with-start-slot\": startSlot != null,\n \"data-with-end-slot\": endSlot != null,\n \"data-testid\": testId,\n })}\n className={cn(inputShell({ size, variant }), pillsShell, className, classNames?.root)}\n {...rest}\n >\n {startSlot != null && (\n <span className={cn(inputSlot, classNames?.startSlot)} aria-hidden>\n {startSlot}\n </span>\n )}\n <div ref={containerRef} className={cn(pillsContent({ size }), classNames?.content)}>\n {renderedPills}\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 ? pills.length : hiddenCount}\n size={size}\n className={measuring ? \"invisible\" : undefined}\n />\n )}\n {field}\n </div>\n {endSlot != null && <span className={cn(inputSlot, classNames?.endSlot)}>{endSlot}</span>}\n </ark.div>\n </PillGroupContext.Provider>\n )\n}\n\nexport type PillsInputFieldProps = ComponentPropsWithoutRef<\"input\"> &\n WithTestId & {\n /** Fired on Backspace when the field is empty — pop the last value. */\n onRemoveLast?: () => void\n }\n\nconst PillsInputField = ({\n className,\n onRemoveLast,\n onKeyDown,\n testId,\n ...rest\n}: PillsInputFieldProps) => (\n <input\n // The trailing field the overflow hook keeps on the last visible row.\n data-overflow-field\n // Grow to fill the line, but keep a clickable minimum when empty. Overrides\n // `inputControlClasses`' `w-full min-w-0` so pills can share the row.\n className={cn(inputControlClasses, \"w-auto min-w-16\", className)}\n onKeyDown={(event) => {\n if (onRemoveLast && event.key === \"Backspace\" && event.currentTarget.value === \"\") {\n onRemoveLast()\n }\n onKeyDown?.(event)\n }}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport const PillsInput = Object.assign(PillsInputBase, {\n Field: PillsInputField,\n})\n"]}
|