@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/tooltip/tooltip.tsx"],"names":["ArkTooltip"],"mappings":";;;;;;;;;;;;;AAoDA,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,E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AAY,OAAO,CAAA;AAAA,QAG9D,8BAAC,MAAA,EAAA,EAAK,QAAA,EAAU,CAAA,EAAG,kBAAA,EAAkB,IAClC,QAAA,EACH;AAAA;AAAA,KAEH,CAAA;AAAA,yBACF,OAAA,EAAA,EAAQ,SAAA,EAAW,UAAA,EAAY,OAAA,EAAS,IAAQ,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-YXE4B6X3.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 type { NoAsChild } from \"../../lib/as-child\"\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 = NoAsChild<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,10 +1,11 @@
|
|
|
1
|
+
import { composeChildren } from './chunk-I4SQQIP5.js';
|
|
1
2
|
import { props } from './chunk-WYCMIIRR.js';
|
|
2
3
|
import { focusStyles } from './chunk-B2LCHXUB.js';
|
|
3
4
|
import { cn } from './chunk-QP4I37PA.js';
|
|
4
5
|
import { ark } from '@ark-ui/react';
|
|
5
6
|
import { cva } from 'class-variance-authority';
|
|
6
7
|
import { createContext, useContext } from 'react';
|
|
7
|
-
import { jsxs,
|
|
8
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
9
|
|
|
9
10
|
var PillGroupContext = createContext(null);
|
|
10
11
|
var pill = cva(
|
|
@@ -86,14 +87,16 @@ function Pill({
|
|
|
86
87
|
className,
|
|
87
88
|
classNames,
|
|
88
89
|
testId,
|
|
90
|
+
asChild,
|
|
89
91
|
...rest
|
|
90
92
|
}) {
|
|
91
93
|
const group = useContext(PillGroupContext);
|
|
92
94
|
const size = sizeProp ?? group?.size ?? "md";
|
|
93
95
|
const disabled = disabledProp ?? group?.disabled;
|
|
94
|
-
return /* @__PURE__ */
|
|
96
|
+
return /* @__PURE__ */ jsx(
|
|
95
97
|
ark.span,
|
|
96
98
|
{
|
|
99
|
+
asChild,
|
|
97
100
|
"data-color": color,
|
|
98
101
|
"data-disabled": disabled || void 0,
|
|
99
102
|
className: cn(
|
|
@@ -103,8 +106,8 @@ function Pill({
|
|
|
103
106
|
),
|
|
104
107
|
...props({ "data-testid": testId }),
|
|
105
108
|
...rest,
|
|
106
|
-
children: [
|
|
107
|
-
/* @__PURE__ */ jsx("span", { className: cn("truncate text-trim", classNames?.label), children }),
|
|
109
|
+
children: composeChildren(asChild, children, (own) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
110
|
+
/* @__PURE__ */ jsx("span", { className: cn("truncate text-trim", classNames?.label), children: own }),
|
|
108
111
|
withRemoveButton && /* @__PURE__ */ jsx(
|
|
109
112
|
"button",
|
|
110
113
|
{
|
|
@@ -121,7 +124,7 @@ function Pill({
|
|
|
121
124
|
children: /* @__PURE__ */ jsx(RemoveIcon, {})
|
|
122
125
|
}
|
|
123
126
|
)
|
|
124
|
-
]
|
|
127
|
+
] }))
|
|
125
128
|
}
|
|
126
129
|
);
|
|
127
130
|
}
|
|
@@ -152,5 +155,5 @@ var PillGroup = ({
|
|
|
152
155
|
) });
|
|
153
156
|
|
|
154
157
|
export { Pill, PillGroup, PillGroupContext, pill, pillRemove };
|
|
155
|
-
//# sourceMappingURL=chunk-
|
|
156
|
-
//# sourceMappingURL=chunk-
|
|
158
|
+
//# sourceMappingURL=chunk-Z2Z5EXVT.js.map
|
|
159
|
+
//# sourceMappingURL=chunk-Z2Z5EXVT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/pill/pill.tsx"],"names":[],"mappings":";;;;;;;;;AA+BO,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,EAAI,0BAAA;AAAA,QACJ,EAAA,EAAI;AAAA;AACN,KACF;AAAA,IACA,eAAA,EAAiB,EAAE,IAAA,EAAM,IAAA;AAAK;AAElC;AAGO,IAAM,UAAA,GAAa,GAAA;AAAA,EACxB;AAAA,IACE,+DAAA;AAAA,IACA,oCAAA;AAAA,IACA,4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AA2C;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-Z2Z5EXVT.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 { composeChildren } from \"../../lib/as-child\"\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` (from the `ark.span` factory) renders the pill as the consumer's\n * element, a link for a clickable tag, with the label (and remove button)\n * folded inside it.\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 asChild,\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 asChild={asChild}\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 {composeChildren(asChild, children, (own) => (\n <>\n <span className={cn(\"truncate text-trim\", classNames?.label)}>{own}</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 </>\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,7 +1,7 @@
|
|
|
1
|
-
import { Tooltip } from './chunk-
|
|
2
|
-
import { popoverChrome } from './chunk-
|
|
1
|
+
import { Tooltip } from './chunk-YXE4B6X3.js';
|
|
2
|
+
import { popoverChrome } from './chunk-6GDMSENK.js';
|
|
3
3
|
import { useUncontrolled } from './chunk-BEL75C7N.js';
|
|
4
|
-
import { Collapse } from './chunk-
|
|
4
|
+
import { Collapse } from './chunk-WSIVRDRB.js';
|
|
5
5
|
import { props } from './chunk-WYCMIIRR.js';
|
|
6
6
|
import { focusStyles } from './chunk-B2LCHXUB.js';
|
|
7
7
|
import { cn } from './chunk-QP4I37PA.js';
|
|
@@ -85,6 +85,7 @@ function CodeBlockChrome({
|
|
|
85
85
|
isCollapsible,
|
|
86
86
|
headContent,
|
|
87
87
|
tailContent,
|
|
88
|
+
title,
|
|
88
89
|
withCopyButton = true,
|
|
89
90
|
copyIcon,
|
|
90
91
|
copiedIcon,
|
|
@@ -108,6 +109,56 @@ function CodeBlockChrome({
|
|
|
108
109
|
onChange: onExpandedChange
|
|
109
110
|
});
|
|
110
111
|
const isSingleLine = !code.includes("\n");
|
|
112
|
+
const toolbar = (controls != null || withCopyButton || isCollapsible) && /* @__PURE__ */ jsxs(
|
|
113
|
+
"div",
|
|
114
|
+
{
|
|
115
|
+
className: cn(
|
|
116
|
+
"flex items-center gap-1 p-0.5",
|
|
117
|
+
// In a title header the toolbar sits in-flow at the row's end;
|
|
118
|
+
// otherwise it floats over the code's top-right corner.
|
|
119
|
+
title == null && "absolute right-2 z-10",
|
|
120
|
+
title == null && (isSingleLine ? "top-1/2 -translate-y-1/2" : "top-2"),
|
|
121
|
+
// Same floating-surface chrome every other overlay panel in the
|
|
122
|
+
// kit uses (Popover/Menu/Select's positioner) — border-brand-900/20
|
|
123
|
+
// dark:border-white/15 + bg-brand-50/90 dark:bg-brand-950/85 +
|
|
124
|
+
// backdrop-blur-sm + shadow-lg — rather than an ad-hoc neutral
|
|
125
|
+
// white/gray-dark tint that doesn't match the kit's own convention
|
|
126
|
+
// for "a small panel floating over content." Only while floating —
|
|
127
|
+
// inside the title header it's part of the bar, not over content.
|
|
128
|
+
title == null && popoverChrome,
|
|
129
|
+
classNames?.controls
|
|
130
|
+
),
|
|
131
|
+
children: [
|
|
132
|
+
controls,
|
|
133
|
+
isCollapsible && /* @__PURE__ */ jsx(
|
|
134
|
+
ExpandTrigger,
|
|
135
|
+
{
|
|
136
|
+
expanded,
|
|
137
|
+
onToggle: () => setExpanded((prev) => !prev),
|
|
138
|
+
expandLabel: t.expand,
|
|
139
|
+
collapseLabel: t.collapse,
|
|
140
|
+
expandIcon,
|
|
141
|
+
collapseIcon,
|
|
142
|
+
className: classNames?.expandButton,
|
|
143
|
+
testId: testId && `${testId}-expand`
|
|
144
|
+
}
|
|
145
|
+
),
|
|
146
|
+
withCopyButton && /* @__PURE__ */ jsx(
|
|
147
|
+
CopyTrigger,
|
|
148
|
+
{
|
|
149
|
+
code,
|
|
150
|
+
onCopy,
|
|
151
|
+
copyLabel: t.copy,
|
|
152
|
+
copiedLabel: t.copied,
|
|
153
|
+
copyIcon,
|
|
154
|
+
copiedIcon,
|
|
155
|
+
className: classNames?.copyButton,
|
|
156
|
+
testId: testId && `${testId}-copy`
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
);
|
|
111
162
|
return /* @__PURE__ */ jsxs(
|
|
112
163
|
"div",
|
|
113
164
|
{
|
|
@@ -118,52 +169,20 @@ function CodeBlockChrome({
|
|
|
118
169
|
),
|
|
119
170
|
...props({ "data-testid": testId }),
|
|
120
171
|
children: [
|
|
121
|
-
|
|
172
|
+
title != null ? /* @__PURE__ */ jsxs(
|
|
122
173
|
"div",
|
|
123
174
|
{
|
|
124
175
|
className: cn(
|
|
125
|
-
"
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
// kit uses (Popover/Menu/Select's positioner) — border-brand-900/20
|
|
129
|
-
// dark:border-white/15 + bg-brand-50/90 dark:bg-brand-950/85 +
|
|
130
|
-
// backdrop-blur-sm + shadow-lg — rather than an ad-hoc neutral
|
|
131
|
-
// white/gray-dark tint that doesn't match the kit's own convention
|
|
132
|
-
// for "a small panel floating over content."
|
|
133
|
-
popoverChrome,
|
|
134
|
-
classNames?.controls
|
|
176
|
+
"flex min-h-9 items-center gap-2 border-b border-brand-900/30 dark:border-white/10 ps-4 pe-2",
|
|
177
|
+
"text-xs font-mono text-gray-light-500 dark:text-gray-dark-400",
|
|
178
|
+
classNames?.title
|
|
135
179
|
),
|
|
136
180
|
children: [
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
ExpandTrigger,
|
|
140
|
-
{
|
|
141
|
-
expanded,
|
|
142
|
-
onToggle: () => setExpanded((prev) => !prev),
|
|
143
|
-
expandLabel: t.expand,
|
|
144
|
-
collapseLabel: t.collapse,
|
|
145
|
-
expandIcon,
|
|
146
|
-
collapseIcon,
|
|
147
|
-
className: classNames?.expandButton,
|
|
148
|
-
testId: testId && `${testId}-expand`
|
|
149
|
-
}
|
|
150
|
-
),
|
|
151
|
-
withCopyButton && /* @__PURE__ */ jsx(
|
|
152
|
-
CopyTrigger,
|
|
153
|
-
{
|
|
154
|
-
code,
|
|
155
|
-
onCopy,
|
|
156
|
-
copyLabel: t.copy,
|
|
157
|
-
copiedLabel: t.copied,
|
|
158
|
-
copyIcon,
|
|
159
|
-
copiedIcon,
|
|
160
|
-
className: classNames?.copyButton,
|
|
161
|
-
testId: testId && `${testId}-copy`
|
|
162
|
-
}
|
|
163
|
-
)
|
|
181
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: title }),
|
|
182
|
+
toolbar
|
|
164
183
|
]
|
|
165
184
|
}
|
|
166
|
-
),
|
|
185
|
+
) : toolbar,
|
|
167
186
|
headContent,
|
|
168
187
|
isCollapsible && /* @__PURE__ */ jsx(Collapse, { open: expanded, children: tailContent }),
|
|
169
188
|
isCollapsible && // Pinned to the *outer* card's own bottom edge (that div is the
|
|
@@ -198,5 +217,5 @@ function CodeBlockChrome({
|
|
|
198
217
|
}
|
|
199
218
|
|
|
200
219
|
export { CodeBlockButton, CodeBlockChrome };
|
|
201
|
-
//# sourceMappingURL=chunk-
|
|
202
|
-
//# sourceMappingURL=chunk-
|
|
220
|
+
//# sourceMappingURL=chunk-ZDXQ64A7.js.map
|
|
221
|
+
//# sourceMappingURL=chunk-ZDXQ64A7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/code-block/chrome.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAsBA,IAAM,oBAAA,GAA8C;AAAA,EAClD,IAAA,EAAM,MAAA;AAAA,EACN,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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-ZDXQ64A7.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 title?: 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 /** Header row above the code; hosts the toolbar when set. */\n title?: 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 title,\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 const toolbar = (controls != null || withCopyButton || isCollapsible) && (\n <div\n className={cn(\n \"flex items-center gap-1 p-0.5\",\n // In a title header the toolbar sits in-flow at the row's end;\n // otherwise it floats over the code's top-right corner.\n title == null && \"absolute right-2 z-10\",\n title == null && (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.\" Only while floating —\n // inside the title header it's part of the bar, not over content.\n title == null && 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 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 {title != null ? (\n <div\n className={cn(\n \"flex min-h-9 items-center gap-2 border-b border-brand-900/30 dark:border-white/10 ps-4 pe-2\",\n \"text-xs font-mono text-gray-light-500 dark:text-gray-dark-400\",\n classNames?.title,\n )}\n >\n <span className=\"min-w-0 flex-1 truncate\">{title}</span>\n {toolbar}\n </div>\n ) : (\n toolbar\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"]}
|
package/dist/colors.css
CHANGED
|
@@ -21,12 +21,10 @@
|
|
|
21
21
|
* --c-solid-hover : filled hover state (600 light / 400 dark)
|
|
22
22
|
* --c-on-solid : foreground sitting on a solid background. brand-950 (dark navy)
|
|
23
23
|
* for every color, light or dark theme — matches the 42 UI Kit
|
|
24
|
-
* Figma, which uses dark navy text on solid fills. `
|
|
25
|
-
* theme) is the one exception,
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* the 4.5 AA threshold) but keeps brand-950 anyway for
|
|
29
|
-
* consistency with the other nine colors.
|
|
24
|
+
* Figma, which uses dark navy text on solid fills. `neutral`
|
|
25
|
+
* (light theme) is the one exception, white on its black fill.
|
|
26
|
+
* `purple` is a marginal fail (4.29:1 vs the 4.5 AA threshold)
|
|
27
|
+
* but keeps brand-950 anyway for consistency with the others.
|
|
30
28
|
* --c-soft : tinted surface for `light` / hover tints (50 light / 950 dark)
|
|
31
29
|
* --c-soft-hover : a step darker than --c-soft
|
|
32
30
|
* --c-text : text + icon on non-filled surfaces (700 light / 300 dark)
|
|
@@ -94,24 +92,6 @@
|
|
|
94
92
|
--c-text: var(--color-brand-300);
|
|
95
93
|
}
|
|
96
94
|
|
|
97
|
-
[data-color="gray"] {
|
|
98
|
-
/* gray-700 is too dark for brand-950 text (2.05:1, fails WCAG AA) — kept white. */
|
|
99
|
-
--c-solid: var(--color-gray-light-700);
|
|
100
|
-
--c-solid-hover: var(--color-gray-light-800);
|
|
101
|
-
--c-on-solid: var(--color-white);
|
|
102
|
-
--c-soft: var(--color-gray-light-100);
|
|
103
|
-
--c-soft-hover: var(--color-gray-light-200);
|
|
104
|
-
--c-text: var(--color-gray-light-700);
|
|
105
|
-
}
|
|
106
|
-
[data-theme="dark"] [data-color="gray"] {
|
|
107
|
-
--c-solid: var(--color-gray-dark-300);
|
|
108
|
-
--c-solid-hover: var(--color-gray-dark-200);
|
|
109
|
-
--c-on-solid: var(--color-brand-950);
|
|
110
|
-
--c-soft: var(--color-gray-dark-800);
|
|
111
|
-
--c-soft-hover: var(--color-gray-dark-700);
|
|
112
|
-
--c-text: var(--color-gray-dark-300);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
95
|
[data-color="red"] {
|
|
116
96
|
--c-solid: var(--color-red-500);
|
|
117
97
|
--c-solid-hover: var(--color-red-600);
|
|
@@ -268,7 +248,12 @@
|
|
|
268
248
|
--c-text: var(--color-pink-300);
|
|
269
249
|
}
|
|
270
250
|
|
|
271
|
-
|
|
251
|
+
/* `gray` is a deprecated alias of `neutral`: the former mid-gray palette was
|
|
252
|
+
cut (Figma's "gray" Button already draws these exact values). The selector
|
|
253
|
+
stays one minor so `data-color="gray"` doesn't silently inherit its
|
|
254
|
+
ancestor's palette instead. Remove in the next minor. */
|
|
255
|
+
[data-color="neutral"],
|
|
256
|
+
[data-color="gray"] {
|
|
272
257
|
/* Figma "White" hierarchy — the literal white/dark-navy button most of the
|
|
273
258
|
kit defaults to. --c-soft mirrors Figma's own translucent-white overlay
|
|
274
259
|
intent, but a single value shared across themes would go invisible (or
|
|
@@ -286,7 +271,8 @@
|
|
|
286
271
|
--c-soft-hover: color-mix(in oklab, var(--color-black) 35%, transparent);
|
|
287
272
|
--c-text: var(--color-gray-light-700);
|
|
288
273
|
}
|
|
289
|
-
[data-theme="dark"] [data-color="neutral"]
|
|
274
|
+
[data-theme="dark"] [data-color="neutral"],
|
|
275
|
+
[data-theme="dark"] [data-color="gray"] {
|
|
290
276
|
--c-solid: var(--color-white);
|
|
291
277
|
--c-solid-hover: var(--color-gray-light-300);
|
|
292
278
|
--c-on-solid: var(--color-brand-950);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
+
import type { ForbidAsChild } from "../../lib/as-child";
|
|
2
3
|
import { type AccordionRootProps, Item, ItemContent, ItemIndicator, ItemTrigger, Root } from "./accordion";
|
|
3
4
|
/**
|
|
4
5
|
* Data-driven Accordion — the convenience wrapper over the composable parts,
|
|
@@ -30,11 +31,11 @@ export type AccordionItem = {
|
|
|
30
31
|
};
|
|
31
32
|
/** The `data` array `Accordion` is generic over. */
|
|
32
33
|
export type AccordionData = ReadonlyArray<AccordionItem>;
|
|
33
|
-
export type AccordionProps<Data extends AccordionData = AccordionData> = Omit<AccordionRootProps, "children"> & {
|
|
34
|
+
export type AccordionProps<Data extends AccordionData = AccordionData> = Omit<AccordionRootProps, "children" | "asChild"> & ForbidAsChild & {
|
|
34
35
|
/** Sections, in order. Each needs its own `content`. */
|
|
35
36
|
data: Data;
|
|
36
37
|
};
|
|
37
|
-
declare const AccordionComponent: <const Data extends AccordionData>({ data, ...root }: AccordionProps<Data>) => import("react").JSX.Element;
|
|
38
|
+
declare const AccordionComponent: <const Data extends AccordionData>({ data, asChild: _asChild, ...root }: AccordionProps<Data>) => import("react").JSX.Element;
|
|
38
39
|
/**
|
|
39
40
|
* The public `Accordion` export — callable for the data-driven form, with the
|
|
40
41
|
* composable parts attached (like `Tabs`/`Menu`). `<Accordion data={…}>` and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion-data.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/accordion-data.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EACL,KAAK,kBAAkB,EACvB,IAAI,EACJ,WAAW,EAEX,aAAa,EACb,WAAW,EACX,IAAI,EACL,MAAM,aAAa,CAAA;AAEpB;;;;;;;;;;;;;;GAcG;AAEH,0DAA0D;AAC1D,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,SAAS,CAAA;IAChB,OAAO,EAAE,SAAS,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qDAAqD;IACrD,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB;;2DAEuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,oDAAoD;AACpD,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC,aAAa,CAAC,CAAA;AAExD,MAAM,MAAM,cAAc,CAAC,IAAI,SAAS,aAAa,GAAG,aAAa,IAAI,IAAI,CAC3E,kBAAkB,EAClB,UAAU,
|
|
1
|
+
{"version":3,"file":"accordion-data.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/accordion-data.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,EACL,KAAK,kBAAkB,EACvB,IAAI,EACJ,WAAW,EAEX,aAAa,EACb,WAAW,EACX,IAAI,EACL,MAAM,aAAa,CAAA;AAEpB;;;;;;;;;;;;;;GAcG;AAEH,0DAA0D;AAC1D,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,SAAS,CAAA;IAChB,OAAO,EAAE,SAAS,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qDAAqD;IACrD,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB;;2DAEuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,oDAAoD;AACpD,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC,aAAa,CAAC,CAAA;AAExD,MAAM,MAAM,cAAc,CAAC,IAAI,SAAS,aAAa,GAAG,aAAa,IAAI,IAAI,CAC3E,kBAAkB,EAClB,UAAU,GAAG,SAAS,CACvB,GACC,aAAa,GAAG;IACd,wDAAwD;IACxD,IAAI,EAAE,IAAI,CAAA;CACX,CAAA;AAEH,QAAA,MAAM,kBAAkB,GAAI,KAAK,CAAC,IAAI,SAAS,aAAa,wCAIzD,cAAc,CAAC,IAAI,CAAC,gCActB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS;;;;;;;CAOpB,CAAA"}
|
|
@@ -85,7 +85,7 @@ export type AccordionItemTriggerProps = Ark.ItemTriggerProps & WithTestId & {
|
|
|
85
85
|
/** Leading icon, rendered before the label. */
|
|
86
86
|
icon?: ReactNode;
|
|
87
87
|
};
|
|
88
|
-
declare const ItemTrigger: ({ icon, children, className, testId, ...rest }: AccordionItemTriggerProps) => import("react").JSX.Element;
|
|
88
|
+
declare const ItemTrigger: ({ icon, children, className, testId, asChild, ...rest }: AccordionItemTriggerProps) => import("react").JSX.Element;
|
|
89
89
|
export type AccordionItemContentProps = Ark.ItemContentProps & WithTestId & {
|
|
90
90
|
classNames?: CollapseClassNames;
|
|
91
91
|
};
|
|
@@ -109,7 +109,7 @@ export type AccordionItemContentProps = Ark.ItemContentProps & WithTestId & {
|
|
|
109
109
|
* there stalls the `0fr` track a few pixels short of a true collapse (the
|
|
110
110
|
* same pattern `NavLink` already uses for its nested-items padding).
|
|
111
111
|
*/
|
|
112
|
-
declare const ItemContent: ({ children, className, classNames, testId, ...rest }: AccordionItemContentProps) => import("react").JSX.Element;
|
|
112
|
+
declare const ItemContent: ({ children, className, classNames, testId, asChild, ...rest }: AccordionItemContentProps) => import("react").JSX.Element;
|
|
113
113
|
export { Item, ItemContent, ItemIndicator, ItemTrigger, Root };
|
|
114
114
|
export declare const ItemContext: (props: Ark.ItemContextProps) => ReactNode;
|
|
115
115
|
export declare const Context: (props: Ark.ContextProps) => ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/accordion.tsx"],"names":[],"mappings":"AAE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AAO,wCAAc,CAAA"}
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
import { Title } from '../../chunk-IRXZHLUL.js';
|
|
3
3
|
import '../../chunk-2GILNBZW.js';
|
|
4
4
|
import { ChevronIcon } from '../../chunk-IG7FBZVM.js';
|
|
5
|
-
import { Collapse } from '../../chunk-
|
|
5
|
+
import { Collapse } from '../../chunk-WSIVRDRB.js';
|
|
6
|
+
import { composeChildren } from '../../chunk-I4SQQIP5.js';
|
|
6
7
|
import { props } from '../../chunk-WYCMIIRR.js';
|
|
7
8
|
import { focusStyles } from '../../chunk-B2LCHXUB.js';
|
|
8
9
|
import { cn } from '../../chunk-QP4I37PA.js';
|
|
9
10
|
import { Accordion as Accordion$1 } from '@ark-ui/react/accordion';
|
|
10
11
|
import { cva } from 'class-variance-authority';
|
|
11
12
|
import { createContext, useContext } from 'react';
|
|
12
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
13
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
13
14
|
|
|
14
15
|
var accordionRoot = cva(["w-full"], {
|
|
15
16
|
variants: {
|
|
@@ -141,21 +142,29 @@ var ItemIndicator = ({ className, testId, ...rest }) => /* @__PURE__ */ jsx(
|
|
|
141
142
|
...rest
|
|
142
143
|
}
|
|
143
144
|
);
|
|
144
|
-
var ItemTrigger = ({
|
|
145
|
+
var ItemTrigger = ({
|
|
146
|
+
icon,
|
|
147
|
+
children,
|
|
148
|
+
className,
|
|
149
|
+
testId,
|
|
150
|
+
asChild,
|
|
151
|
+
...rest
|
|
152
|
+
}) => {
|
|
145
153
|
const { size, chevronPosition, chevron, order } = useContext(AccordionStyleContext);
|
|
146
154
|
const indicator = chevron === null ? null : /* @__PURE__ */ jsx(ItemIndicator, { children: chevron ?? /* @__PURE__ */ jsx(ChevronIcon, {}) });
|
|
147
|
-
return /* @__PURE__ */ jsx(Title, { order, className: "contents", children: /* @__PURE__ */
|
|
155
|
+
return /* @__PURE__ */ jsx(Title, { order, className: "contents", children: /* @__PURE__ */ jsx(
|
|
148
156
|
Accordion$1.ItemTrigger,
|
|
149
157
|
{
|
|
158
|
+
asChild,
|
|
150
159
|
className: cn(accordionTrigger({ size }), className),
|
|
151
160
|
...props({ "data-testid": testId }),
|
|
152
161
|
...rest,
|
|
153
|
-
children: [
|
|
162
|
+
children: composeChildren(asChild, children, (own) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
154
163
|
chevronPosition === "start" && indicator,
|
|
155
164
|
icon && /* @__PURE__ */ jsx("span", { className: accordionIcon, children: icon }),
|
|
156
|
-
/* @__PURE__ */ jsx("span", { className: accordionLabel, children }),
|
|
165
|
+
/* @__PURE__ */ jsx("span", { className: accordionLabel, children: own }),
|
|
157
166
|
chevronPosition === "end" && indicator
|
|
158
|
-
]
|
|
167
|
+
] }))
|
|
159
168
|
}
|
|
160
169
|
) });
|
|
161
170
|
};
|
|
@@ -164,6 +173,7 @@ var ItemContent = ({
|
|
|
164
173
|
className,
|
|
165
174
|
classNames,
|
|
166
175
|
testId,
|
|
176
|
+
asChild,
|
|
167
177
|
...rest
|
|
168
178
|
}) => {
|
|
169
179
|
const { size } = useContext(AccordionStyleContext);
|
|
@@ -176,7 +186,8 @@ var ItemContent = ({
|
|
|
176
186
|
classNames,
|
|
177
187
|
...props({ "data-testid": testId }),
|
|
178
188
|
...rest,
|
|
179
|
-
|
|
189
|
+
asChild,
|
|
190
|
+
children: composeChildren(asChild, children, (own) => /* @__PURE__ */ jsx("div", { className: accordionContent({ size }), children: own }))
|
|
180
191
|
}
|
|
181
192
|
) }) });
|
|
182
193
|
};
|
|
@@ -184,6 +195,7 @@ var ItemContext = Accordion$1.ItemContext;
|
|
|
184
195
|
Accordion$1.Context;
|
|
185
196
|
var AccordionComponent = ({
|
|
186
197
|
data,
|
|
198
|
+
asChild: _asChild,
|
|
187
199
|
...root
|
|
188
200
|
}) => /* @__PURE__ */ jsx(Root, { ...root, children: data.map((item) => {
|
|
189
201
|
const testId = item.testId ?? `accordion-${item.value}`;
|