@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,104 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { UnavailableProps } from "./available-if";
|
|
3
|
+
/**
|
|
4
|
+
* The two sanctioned ways for a kit part to meet Ark's `asChild`.
|
|
5
|
+
*
|
|
6
|
+
* Ark's factory clones **exactly one** valid element under `asChild` and
|
|
7
|
+
* renders `null` otherwise (`isValidElement(children) ? clone : null`). So a
|
|
8
|
+
* part that renders anything besides a bare `{children}` — an icon, a
|
|
9
|
+
* section, an indicator, a default fallback — breaks in one of two ways:
|
|
10
|
+
*
|
|
11
|
+
* - **It renders nothing.** Two or more JSX child expressions become an
|
|
12
|
+
* array, even when some of them evaluate to `false`
|
|
13
|
+
* (`{start && <Start/>}{children}{end && <End/>}`), and an array is not an
|
|
14
|
+
* element.
|
|
15
|
+
* - **Its own content is lost or misplaced.** Under `asChild`, `children`
|
|
16
|
+
* *is* the consumer's element, so `children ?? <DefaultIcon/>` never
|
|
17
|
+
* reaches the fallback, and a wrapper (`<Provider>{children}</Provider>`)
|
|
18
|
+
* is what gets cloned instead of the consumer's element.
|
|
19
|
+
*
|
|
20
|
+
* Every such part must pick one of these:
|
|
21
|
+
*
|
|
22
|
+
* - **`withAsChildContent`** — the part can sensibly *become* the consumer's
|
|
23
|
+
* element (a menu item rendered as a router `<Link>`, a crumb, an alert
|
|
24
|
+
* that links somewhere). The kit's content is folded into the child's own
|
|
25
|
+
* children, so Ark still receives a single element.
|
|
26
|
+
* - **`NoAsChild`** — the part renders structure that cannot live inside an
|
|
27
|
+
* arbitrary element (a slider's track and thumbs, a scheduler grid). The
|
|
28
|
+
* prop becomes a compile error that says why.
|
|
29
|
+
*
|
|
30
|
+
* `as-child.contract.test.tsx` enforces the choice: it derives every public
|
|
31
|
+
* part that accepts `asChild` from the component entries, renders each one
|
|
32
|
+
* with an `<a>` child, and fails the typecheck when a part is in neither its
|
|
33
|
+
* render table nor `NoAsChild`.
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* Rebuilds the single `asChild` child's own children through `render`, so
|
|
37
|
+
* kit content (sections, icons, spinners) lands *inside* the element Ark
|
|
38
|
+
* clones instead of beside it. `extra` is merged onto the child too, for the
|
|
39
|
+
* odd prop the kit has to own (a click guard while loading).
|
|
40
|
+
*
|
|
41
|
+
* A child that isn't a single element falls through unchanged, leaving
|
|
42
|
+
* Ark's own handling of the misuse as it is.
|
|
43
|
+
*
|
|
44
|
+
* ```tsx
|
|
45
|
+
* <ArkMenu.Item asChild {...rest}>
|
|
46
|
+
* {withAsChildContent(children, (own) => (
|
|
47
|
+
* <>
|
|
48
|
+
* <StartSection>{startSection}</StartSection>
|
|
49
|
+
* {own}
|
|
50
|
+
* </>
|
|
51
|
+
* ))}
|
|
52
|
+
* </ArkMenu.Item>
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare const withAsChildContent: (child: ReactNode, render: (own: ReactNode) => ReactNode, extra?: Record<string, unknown>) => ReactNode;
|
|
56
|
+
/**
|
|
57
|
+
* The usual call site: `render` wraps the part's `children` with its own
|
|
58
|
+
* content either way, around `children` normally and inside the consumer's
|
|
59
|
+
* element under `asChild`. One `render` serves both branches, so the two
|
|
60
|
+
* can't drift apart.
|
|
61
|
+
*
|
|
62
|
+
* ```tsx
|
|
63
|
+
* <ArkMenu.Item asChild={asChild} {...rest}>
|
|
64
|
+
* {composeChildren(asChild, children, (own) => <>{icon}{own}</>)}
|
|
65
|
+
* </ArkMenu.Item>
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export declare const composeChildren: (asChild: boolean | undefined, children: ReactNode, render: (own: ReactNode) => ReactNode) => ReactNode;
|
|
69
|
+
/** The sentence a caller reads when passing `asChild` to a `NoAsChild` part. */
|
|
70
|
+
export type NoAsChildReason = "renders its own structure around its children, so asChild is not supported";
|
|
71
|
+
/**
|
|
72
|
+
* The forbid shape on its own: `asChild` typed as a branded `Unavailable`.
|
|
73
|
+
* Intersect it beside a props type (`Omit<RootProps, "children"> &
|
|
74
|
+
* ForbidAsChild & { data }`); `NoAsChild<P>` is the same thing as a wrapper.
|
|
75
|
+
*
|
|
76
|
+
* Uses the brand rather than omitting the key, because omission is silent
|
|
77
|
+
* on a JSX spread (`<Slider {...props} />`), which is exactly how prop bags
|
|
78
|
+
* get forwarded. Either way the error names the reason:
|
|
79
|
+
*
|
|
80
|
+
* Type 'boolean' is not assignable to type 'Unavailable<"renders its own
|
|
81
|
+
* structure around its children, so asChild is not supported">'
|
|
82
|
+
*/
|
|
83
|
+
export type ForbidAsChild = UnavailableProps<{
|
|
84
|
+
asChild?: boolean;
|
|
85
|
+
}, NoAsChildReason>;
|
|
86
|
+
/**
|
|
87
|
+
* `P` with `asChild` forbidden: `P & ForbidAsChild`, so `asChild` resolves
|
|
88
|
+
* to `(boolean & Unavailable<…>) | undefined`, which nothing but `undefined`
|
|
89
|
+
* satisfies.
|
|
90
|
+
*
|
|
91
|
+
* An intersection, not `Omit<P, "asChild"> & …`. `Omit` re-maps every key of
|
|
92
|
+
* a large HTML/Ark props type, and measured on the forbidden parts that cost
|
|
93
|
+
* each importing file about 38k extra type instantiations (+8.6%); the
|
|
94
|
+
* intersection costs nothing measurable. It also leaves a union in `P` (a
|
|
95
|
+
* discriminated `type` / `color` pair, a slot-size union) and any generic
|
|
96
|
+
* untouched, where `Omit` would flatten the one and hide the other from
|
|
97
|
+
* inference.
|
|
98
|
+
*
|
|
99
|
+
* The component destructures `asChild` out before spreading the rest onto
|
|
100
|
+
* its Ark part (`({ asChild: _asChild, ...rest })`), so a JS caller that
|
|
101
|
+
* passes it anyway gets the normal render rather than Ark's `null`.
|
|
102
|
+
*/
|
|
103
|
+
export type NoAsChild<P> = P & ForbidAsChild;
|
|
104
|
+
//# sourceMappingURL=as-child.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"as-child.d.ts","sourceRoot":"","sources":["../../src/lib/as-child.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,kBAAkB,UACtB,SAAS,UACR,CAAC,GAAG,EAAE,SAAS,KAAK,SAAS,UAC7B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC9B,SAGF,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,YACjB,OAAO,GAAG,SAAS,YAClB,SAAS,UACX,CAAC,GAAG,EAAE,SAAS,KAAK,SAAS,KACpC,SAAgF,CAAA;AAEnF,gFAAgF;AAChF,MAAM,MAAM,eAAe,GACzB,4EAA4E,CAAA;AAE9E;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,aAAa,GAAG,gBAAgB,CAAC;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,EAAE,eAAe,CAAC,CAAA;AAEpF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,aAAa,CAAA"}
|
package/dist/lib/colors.d.ts
CHANGED
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
* 3. Add a `[data-color="<name>"]` block in `colors.css` with the slot vars
|
|
10
10
|
* (and a dark-mode override if the shade should shift).
|
|
11
11
|
*/
|
|
12
|
-
export declare const COLORS: readonly ["brand", "
|
|
12
|
+
export declare const COLORS: readonly ["brand", "neutral", "red", "orange", "yellow", "green", "teal", "cyan", "blue", "purple", "pink"];
|
|
13
13
|
export type Color = (typeof COLORS)[number] | (string & {});
|
|
14
14
|
//# sourceMappingURL=colors.d.ts.map
|
package/dist/lib/colors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/lib/colors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,MAAM,YACjB,OAAO,
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/lib/colors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,MAAM,YACjB,OAAO,EAMP,SAAS,EACT,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,MAAM,EACN,MAAM,EACN,MAAM,EACN,QAAQ,EACR,MAAM,CACE,CAAA;AAIV,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA"}
|
package/dist/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
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@42-central/ui-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.1",
|
|
4
4
|
"description": "React UI kit for 42 tools",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
"dist",
|
|
12
12
|
"src",
|
|
13
|
+
"biome",
|
|
13
14
|
"README.md"
|
|
14
15
|
],
|
|
15
16
|
"exports": {
|