@optiaxiom/web-components 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/RichTextEditor/package.json +4 -0
- package/dist/ActionsContent-DCsr6SIb.js +1 -0
- package/dist/ActionsRoot-9nMo-_Xg.js +1 -0
- package/dist/Alert-BW9E72Dy.js +1 -0
- package/dist/AlertDialogAction-CPbw5sHK.js +1 -0
- package/dist/AlertDialogBody-BdibJYAH.js +1 -0
- package/dist/AlertDialogCancel-D716p79g.js +1 -0
- package/dist/AlertDialogContent-DlcUA0xo.js +1 -0
- package/dist/AlertDialogContext-DI3RmWeH.js +1 -0
- package/dist/AlertDialogFooter-BTrrpts1.js +1 -0
- package/dist/AlertDialogHeader-60tTtOKp.js +1 -0
- package/dist/AngleMenuButton-DJMTo2OA.js +1 -0
- package/dist/Avatar-DIknAtGq.js +1 -0
- package/dist/AvatarContext-MyP4qVCF.js +1 -0
- package/dist/Backdrop-DH_KSFKV.js +1 -0
- package/dist/Badge-BBLej_Wg.js +1 -0
- package/dist/Box-BB6icLFu.js +1 -0
- package/dist/Button-B5QHqem8.js +1 -0
- package/dist/ButtonContext-DzBAgKvI.js +1 -0
- package/dist/ButtonGroup.css.ts.vanilla-dwYhKFVX-CwLdBlgM.js +1 -0
- package/dist/ButtonRoot-CHmV_f8Y.js +1 -0
- package/dist/Calendar-CAcLqDzx.js +1 -0
- package/dist/CardContext-NfNuamjs.js +1 -0
- package/dist/Checkbox-CxT3yA7x.js +1 -0
- package/dist/Combination-BuCizIP1.js +41 -0
- package/dist/Cover-DJ8HEwf4.js +1 -0
- package/dist/Cover.css.ts.vanilla-C9GAjYm0-Cn7i4w8P.js +1 -0
- package/dist/DataTableAction-CKYLZeSD.js +1 -0
- package/dist/DataTableContext-D5Tu28Ys.js +1 -0
- package/dist/DataTableRowContext-CdU0Q6r3.js +1 -0
- package/dist/DateRangePickerContext-BzArGjNj.js +1 -0
- package/dist/Dialog-FGr7471J.js +1 -0
- package/dist/DialogClose-CuExbbrf.js +1 -0
- package/dist/DialogContent-Bb9qHlV9.js +1 -0
- package/dist/DialogContext-Dm5Yv4Ta.js +1 -0
- package/dist/DialogHeader-ssBUY5XJ.js +1 -0
- package/dist/DialogKitContext-bUwHho5v.js +1 -0
- package/dist/DialogTrigger-CWBprvgF.js +1 -0
- package/dist/Disclosure-DiFg7CLN.js +1 -0
- package/dist/DisclosureContent-DlyHeIdX.js +1 -0
- package/dist/DisclosureTrigger-CtaGQ6lM.js +1 -0
- package/dist/DropdownMenuContext-CR58fAzW.js +1 -0
- package/dist/DropdownMenuNestedContext-DofV-bdA.js +1 -0
- package/dist/DropdownMenuSubContext-DBPVaX0b.js +1 -0
- package/dist/FieldContext-D_cMZfbh.js +1 -0
- package/dist/FieldLabel-C22_m4pJ.js +1 -0
- package/dist/FilteredSlot-iUebEBh-.js +1 -0
- package/dist/FocusBookmarkProvider-BpLV3UwW.js +1 -0
- package/dist/FocusBookmarkProviderContext-Ddpn3qrR.js +1 -0
- package/dist/Group-BUG9Nm0e.js +1 -0
- package/dist/Heading-CdtA6cQL.js +1 -0
- package/dist/Icon-033ghcOl.js +1 -0
- package/dist/IconOpal-Cla_ML-2.js +1 -0
- package/dist/Input-BQX-ZcnF.js +1 -0
- package/dist/InputAddon-ruV-OO5f.js +1 -0
- package/dist/InputContext-BbRnW9lv.js +1 -0
- package/dist/InputControl-TQwV6a1x.js +1 -0
- package/dist/InputControl.css.ts.vanilla-BkdLq-_K-CwmhMyyr.js +1 -0
- package/dist/InputRoot-BzEMECNX.js +1 -0
- package/dist/Link-CZ2rs641.js +1 -0
- package/dist/Listbox-DKerfs8o.js +1 -0
- package/dist/ListboxCheckboxItem-DNsKX7Gt.js +1 -0
- package/dist/ListboxCheckboxItem-css-BsOlzOy4.js +1 -0
- package/dist/ListboxEmpty-DWvBppJ_.js +1 -0
- package/dist/ListboxGroupContext-yTDkDV4Z.js +1 -0
- package/dist/ListboxItem-C_wvgzSD.js +1 -0
- package/dist/ListboxItemIndicator-CduAr0uw.js +1 -0
- package/dist/ListboxItemized-C4pjILUb.js +1 -0
- package/dist/ListboxLabel-duZB914I.js +1 -0
- package/dist/ListboxRadioItem-CaiAU0UA.js +1 -0
- package/dist/ListboxSeparator-B8BRwndJ.js +1 -0
- package/dist/ListboxSwitchItem-C1Midj0N.js +1 -0
- package/dist/MaterialIcon-CIzSZ4gT.js +1 -0
- package/dist/Menu-Po8ZaRRu.js +1 -0
- package/dist/MenuContent-Be6nnTom.js +1 -0
- package/dist/MenuContext-DE9k1335.js +1 -0
- package/dist/MenuTrigger-Bl7r0ieB.js +1 -0
- package/dist/ModalLayer-q5AavDPs.js +1 -0
- package/dist/ModalListbox-BstdBlvQ.js +9 -0
- package/dist/NavGroupContext-BN53gg3j.js +1 -0
- package/dist/NavItem-BEe07ZOo.js +1 -0
- package/dist/Pagination-DNf7gLWp.js +1 -0
- package/dist/Paper-BHmRuMG_.js +1 -0
- package/dist/Popover-jnkIGeXt.js +1 -0
- package/dist/PopoverAnchor-DUPnlPCn.js +1 -0
- package/dist/PopoverContent-DrtRMrwI.js +1 -0
- package/dist/PopoverTrigger-D42_HqNB.js +1 -0
- package/dist/Portal-CZ29CEMU.js +1 -0
- package/dist/PortalContext-KTGXcxNd.js +1 -0
- package/dist/RadioGroupContext-BX84Sg4u.js +1 -0
- package/dist/Select-CZDWPFXE.js +1 -0
- package/dist/SelectContent-iXaAxiGo.js +1 -0
- package/dist/SelectContext-CidX2hJc.js +1 -0
- package/dist/SelectTrigger-kX5RGHo4.js +1 -0
- package/dist/Separator-BaMzqY5F.js +1 -0
- package/dist/SidebarContext-CAYtVU3z.js +1 -0
- package/dist/Skeleton-Bt2vxSV_.js +1 -0
- package/dist/Spinner-B1qBhszY.js +1 -0
- package/dist/SuggestionPopover-CSDkbeZF.js +1 -0
- package/dist/Switch-BLOyXp5w.js +1 -0
- package/dist/Table-R2oNi-Ls.js +1 -0
- package/dist/TableAction-BRXzB2Yb.js +1 -0
- package/dist/TableBody-BcHwCr3Y.js +1 -0
- package/dist/TableCell-CtwD0hEP.js +1 -0
- package/dist/TableHeader-DIT8DT0t.js +1 -0
- package/dist/TableHeaderCell-BYHXGVsh.js +1 -0
- package/dist/TableRow-B6KHcytU.js +1 -0
- package/dist/TableRow.css.ts.vanilla-Dnj0sUm2-jt1Kts1H.js +1 -0
- package/dist/Text-BVUJUB1o.js +1 -0
- package/dist/ThemeProvider-C9B4tZWc.js +13 -0
- package/dist/ToastProvider-P628drgC.js +1 -0
- package/dist/ToggleInputHiddenInput-_66vwozS.js +1 -0
- package/dist/Tooltip-nDjTmU-D.js +1 -0
- package/dist/TooltipContent-CcKKULRr.js +1 -0
- package/dist/TooltipContext-BgsfNDdA.js +1 -0
- package/dist/TooltipProvider-KZyje1Xq.js +1 -0
- package/dist/TooltipRoot-Dfb4PqWv.js +1 -0
- package/dist/TooltipTrigger-CnE-oY5G.js +1 -0
- package/dist/Transition-H7wDuYSu.js +1 -0
- package/dist/TransitionGlobalConfig-xV-1DAYY.js +1 -0
- package/dist/TransitionGroup-BOixJqBe.js +1 -0
- package/dist/TransitionGroupContext-CVVb4RNw.js +1 -0
- package/dist/VisuallyHidden-B7riQlAq.js +1 -0
- package/dist/calendar_today-DMFJkN6l.js +1 -0
- package/dist/check-CVbDfwxr.js +1 -0
- package/dist/chevron_left-DDWXIhHu.js +1 -0
- package/dist/chevron_right-Da0IJQDZ.js +1 -0
- package/dist/close-DR5oFUx9.js +1 -0
- package/dist/components/Alert.d.ts +11 -15
- package/dist/components/Alert.js +1 -1
- package/dist/components/AlertDialog.d.ts +12 -15
- package/dist/components/AlertDialog.js +1 -1
- package/dist/components/AlertDialogAction.d.ts +21 -25
- package/dist/components/AlertDialogAction.js +1 -1
- package/dist/components/AlertDialogBody.d.ts +8 -12
- package/dist/components/AlertDialogBody.js +1 -1
- package/dist/components/AlertDialogCancel.d.ts +21 -25
- package/dist/components/AlertDialogCancel.js +1 -1
- package/dist/components/AlertDialogContent.d.ts +17 -20
- package/dist/components/AlertDialogContent.js +1 -1
- package/dist/components/AlertDialogFooter.d.ts +8 -12
- package/dist/components/AlertDialogFooter.js +1 -1
- package/dist/components/AlertDialogHeader.d.ts +10 -14
- package/dist/components/AlertDialogHeader.js +1 -1
- package/dist/components/AlertDialogTrigger.d.ts +21 -25
- package/dist/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AngleMenuButton.d.ts +22 -26
- package/dist/components/AngleMenuButton.js +1 -1
- package/dist/components/AuthProvider.d.ts +11 -14
- package/dist/components/AuthProvider.js +1 -1
- package/dist/components/Avatar.d.ts +14 -18
- package/dist/components/Avatar.js +1 -1
- package/dist/components/AvatarGroup.d.ts +10 -14
- package/dist/components/AvatarGroup.js +1 -1
- package/dist/components/AxiomProvider.d.ts +11 -14
- package/dist/components/AxiomProvider.js +1 -1
- package/dist/components/Badge.d.ts +14 -18
- package/dist/components/Badge.js +1 -1
- package/dist/components/Banner.d.ts +11 -15
- package/dist/components/Banner.js +1 -1
- package/dist/components/Box.d.ts +96 -99
- package/dist/components/Box.js +1 -1
- package/dist/components/Breadcrumb.d.ts +17 -16
- package/dist/components/Breadcrumb.js +1 -1
- package/dist/components/Button.d.ts +21 -25
- package/dist/components/Button.js +1 -1
- package/dist/components/ButtonGroup.d.ts +9 -13
- package/dist/components/ButtonGroup.js +1 -1
- package/dist/components/Card.d.ts +8 -12
- package/dist/components/Card.js +1 -1
- package/dist/components/CardAction.d.ts +9 -13
- package/dist/components/CardAction.js +1 -1
- package/dist/components/CardCheckbox.d.ts +13 -17
- package/dist/components/CardCheckbox.js +1 -1
- package/dist/components/CardFooter.d.ts +8 -12
- package/dist/components/CardFooter.js +1 -1
- package/dist/components/CardHeader.d.ts +16 -20
- package/dist/components/CardHeader.js +1 -1
- package/dist/components/CardImage.d.ts +8 -12
- package/dist/components/CardImage.js +1 -1
- package/dist/components/CardLink.d.ts +14 -18
- package/dist/components/CardLink.js +1 -1
- package/dist/components/CardPreview.d.ts +16 -20
- package/dist/components/CardPreview.js +1 -1
- package/dist/components/Checkbox.d.ts +14 -18
- package/dist/components/Checkbox.js +1 -1
- package/dist/components/Code.d.ts +8 -12
- package/dist/components/Code.js +1 -1
- package/dist/components/Cover.d.ts +10 -14
- package/dist/components/Cover.js +1 -1
- package/dist/components/DataTable.d.ts +9 -13
- package/dist/components/DataTable.js +1 -1
- package/dist/components/DataTableAction.d.ts +10 -14
- package/dist/components/DataTableAction.js +1 -1
- package/dist/components/DataTableBody.d.ts +11 -15
- package/dist/components/DataTableBody.js +12 -10
- package/dist/components/DataTableCheckbox.d.ts +15 -19
- package/dist/components/DataTableCheckbox.js +1 -1
- package/dist/components/DataTableFooter.d.ts +19 -17
- package/dist/components/DataTableFooter.js +1 -1
- package/dist/components/DataTableLabel.d.ts +8 -12
- package/dist/components/DataTableLabel.js +1 -1
- package/dist/components/DateInput.d.ts +29 -33
- package/dist/components/DateInput.js +1 -1
- package/dist/components/DateRangePicker.d.ts +18 -21
- package/dist/components/DateRangePicker.js +1 -1
- package/dist/components/DateRangePickerContent.d.ts +35 -38
- package/dist/components/DateRangePickerContent.js +1 -1
- package/dist/components/DateRangePickerTrigger.d.ts +25 -29
- package/dist/components/DateRangePickerTrigger.js +1 -1
- package/dist/components/Dialog.d.ts +12 -15
- package/dist/components/Dialog.js +1 -1
- package/dist/components/DialogBody.d.ts +8 -12
- package/dist/components/DialogBody.js +1 -1
- package/dist/components/DialogClose.d.ts +21 -25
- package/dist/components/DialogClose.js +1 -1
- package/dist/components/DialogContent.d.ts +17 -20
- package/dist/components/DialogContent.js +1 -1
- package/dist/components/DialogFooter.d.ts +8 -12
- package/dist/components/DialogFooter.js +1 -1
- package/dist/components/DialogForm.d.ts +8 -12
- package/dist/components/DialogForm.js +1 -1
- package/dist/components/DialogHeader.d.ts +14 -18
- package/dist/components/DialogHeader.js +1 -1
- package/dist/components/DialogTrigger.d.ts +21 -25
- package/dist/components/DialogTrigger.js +1 -1
- package/dist/components/Disclosure.d.ts +13 -17
- package/dist/components/Disclosure.js +1 -1
- package/dist/components/DisclosureContent.d.ts +10 -14
- package/dist/components/DisclosureContent.js +1 -1
- package/dist/components/DisclosureTrigger.d.ts +14 -18
- package/dist/components/DisclosureTrigger.js +1 -1
- package/dist/components/DropdownMenu.d.ts +13 -16
- package/dist/components/DropdownMenu.js +1 -1
- package/dist/components/DropdownMenuCheckboxItem.d.ts +21 -25
- package/dist/components/DropdownMenuCheckboxItem.js +1 -1
- package/dist/components/DropdownMenuContent.d.ts +22 -25
- package/dist/components/DropdownMenuContent.js +1 -1
- package/dist/components/DropdownMenuGroup.d.ts +8 -12
- package/dist/components/DropdownMenuGroup.js +1 -1
- package/dist/components/DropdownMenuItem.d.ts +19 -23
- package/dist/components/DropdownMenuItem.js +1 -1
- package/dist/components/DropdownMenuLabel.d.ts +8 -12
- package/dist/components/DropdownMenuLabel.js +1 -1
- package/dist/components/DropdownMenuSeparator.d.ts +8 -12
- package/dist/components/DropdownMenuSeparator.js +1 -1
- package/dist/components/DropdownMenuSub.d.ts +12 -15
- package/dist/components/DropdownMenuSub.js +1 -1
- package/dist/components/DropdownMenuSubContent.d.ts +18 -21
- package/dist/components/DropdownMenuSubContent.js +1 -1
- package/dist/components/DropdownMenuTrigger.d.ts +22 -26
- package/dist/components/DropdownMenuTrigger.js +1 -1
- package/dist/components/EllipsisMenuButton.d.ts +22 -26
- package/dist/components/EllipsisMenuButton.js +1 -1
- package/dist/components/Field.d.ts +17 -21
- package/dist/components/Field.js +1 -1
- package/dist/components/FieldLabel.d.ts +14 -18
- package/dist/components/FieldLabel.js +1 -1
- package/dist/components/Flex.d.ts +8 -12
- package/dist/components/Flex.js +1 -1
- package/dist/components/Grid.d.ts +8 -12
- package/dist/components/Grid.js +1 -1
- package/dist/components/Group.d.ts +8 -12
- package/dist/components/Group.js +1 -1
- package/dist/components/Heading.d.ts +12 -16
- package/dist/components/Heading.js +1 -1
- package/dist/components/Indicator.d.ts +18 -22
- package/dist/components/Indicator.js +1 -1
- package/dist/components/Input.d.ts +28 -32
- package/dist/components/Input.js +1 -1
- package/dist/components/InputAddon.d.ts +8 -12
- package/dist/components/InputAddon.js +1 -1
- package/dist/components/InputControl.d.ts +16 -20
- package/dist/components/InputControl.js +1 -1
- package/dist/components/InputRoot.d.ts +11 -15
- package/dist/components/InputRoot.js +1 -1
- package/dist/components/Kbd.d.ts +10 -14
- package/dist/components/Kbd.js +1 -1
- package/dist/components/LabelMenuButton.d.ts +15 -19
- package/dist/components/LabelMenuButton.js +1 -1
- package/dist/components/Link.d.ts +15 -19
- package/dist/components/Link.js +1 -1
- package/dist/components/Listbox.d.ts +8 -12
- package/dist/components/Listbox.js +1 -1
- package/dist/components/ListboxCheckboxItem.d.ts +16 -20
- package/dist/components/ListboxCheckboxItem.js +1 -1
- package/dist/components/ListboxEmpty.d.ts +8 -12
- package/dist/components/ListboxEmpty.js +1 -1
- package/dist/components/ListboxGroup.d.ts +8 -12
- package/dist/components/ListboxGroup.js +1 -1
- package/dist/components/ListboxItem.d.ts +15 -19
- package/dist/components/ListboxItem.js +1 -1
- package/dist/components/ListboxItemIndicator.d.ts +10 -14
- package/dist/components/ListboxItemIndicator.js +1 -1
- package/dist/components/ListboxItemized.d.ts +16 -20
- package/dist/components/ListboxItemized.js +1 -1
- package/dist/components/ListboxLabel.d.ts +8 -12
- package/dist/components/ListboxLabel.js +1 -1
- package/dist/components/ListboxRadioItem.d.ts +15 -19
- package/dist/components/ListboxRadioItem.js +1 -1
- package/dist/components/ListboxSeparator.d.ts +11 -14
- package/dist/components/ListboxSeparator.js +1 -1
- package/dist/components/ListboxSwitchItem.d.ts +16 -20
- package/dist/components/ListboxSwitchItem.js +1 -1
- package/dist/components/Menu.d.ts +23 -26
- package/dist/components/Menu.js +1 -1
- package/dist/components/MenuContent.d.ts +26 -29
- package/dist/components/MenuContent.js +1 -1
- package/dist/components/MenuTrigger.d.ts +22 -26
- package/dist/components/MenuTrigger.js +1 -1
- package/dist/components/ModalLayer.d.ts +8 -13
- package/dist/components/ModalLayer.js +1 -1
- package/dist/components/Nav.d.ts +12 -16
- package/dist/components/Nav.js +1 -1
- package/dist/components/NavAccountItem.d.ts +11 -15
- package/dist/components/NavAccountItem.js +1 -1
- package/dist/components/NavBody.d.ts +8 -12
- package/dist/components/NavBody.js +1 -1
- package/dist/components/NavFooter.d.ts +8 -12
- package/dist/components/NavFooter.js +1 -1
- package/dist/components/NavGroup.d.ts +14 -18
- package/dist/components/NavGroup.js +1 -1
- package/dist/components/NavGroupContent.d.ts +8 -12
- package/dist/components/NavGroupContent.js +1 -1
- package/dist/components/NavGroupTrigger.d.ts +14 -18
- package/dist/components/NavGroupTrigger.js +1 -1
- package/dist/components/NavHeader.d.ts +8 -12
- package/dist/components/NavHeader.js +1 -1
- package/dist/components/NavItem.d.ts +12 -16
- package/dist/components/NavItem.js +1 -1
- package/dist/components/NavList.d.ts +8 -12
- package/dist/components/NavList.js +1 -1
- package/dist/components/NavSeparator.d.ts +11 -14
- package/dist/components/NavSeparator.js +1 -1
- package/dist/components/Pagination.d.ts +14 -18
- package/dist/components/Pagination.js +1 -1
- package/dist/components/Paper.d.ts +9 -13
- package/dist/components/Paper.js +1 -1
- package/dist/components/Popover.d.ts +13 -16
- package/dist/components/Popover.js +1 -1
- package/dist/components/PopoverAnchor.d.ts +8 -12
- package/dist/components/PopoverAnchor.js +1 -1
- package/dist/components/PopoverContent.d.ts +26 -29
- package/dist/components/PopoverContent.js +1 -1
- package/dist/components/PopoverTrigger.d.ts +21 -25
- package/dist/components/PopoverTrigger.js +1 -1
- package/dist/components/Progress.d.ts +13 -17
- package/dist/components/Progress.js +2 -2
- package/dist/components/Radio.d.ts +13 -17
- package/dist/components/Radio.js +1 -1
- package/dist/components/RadioGroup.d.ts +17 -20
- package/dist/components/RadioGroup.js +1 -1
- package/dist/components/RichTextEditor.d.ts +34 -0
- package/dist/components/RichTextEditor.js +139 -0
- package/dist/components/SearchInput.d.ts +29 -33
- package/dist/components/SearchInput.js +1 -1
- package/dist/components/SegmentedControl.d.ts +20 -24
- package/dist/components/SegmentedControl.js +1 -1
- package/dist/components/SegmentedControlItem.d.ts +22 -26
- package/dist/components/SegmentedControlItem.js +1 -1
- package/dist/components/Select.d.ts +21 -25
- package/dist/components/Select.js +1 -1
- package/dist/components/SelectContent.d.ts +15 -19
- package/dist/components/SelectContent.js +1 -1
- package/dist/components/SelectTrigger.d.ts +22 -26
- package/dist/components/SelectTrigger.js +1 -1
- package/dist/components/Separator.d.ts +11 -14
- package/dist/components/Separator.js +1 -1
- package/dist/components/Sidebar.d.ts +12 -16
- package/dist/components/Sidebar.js +1 -1
- package/dist/components/SidebarToggle.d.ts +13 -17
- package/dist/components/SidebarToggle.js +1 -1
- package/dist/components/Skeleton.d.ts +9 -13
- package/dist/components/Skeleton.js +1 -1
- package/dist/components/Spinner.d.ts +9 -13
- package/dist/components/Spinner.js +1 -1
- package/dist/components/SubNav.d.ts +8 -12
- package/dist/components/SubNav.js +1 -1
- package/dist/components/Switch.d.ts +15 -19
- package/dist/components/Switch.js +1 -1
- package/dist/components/Table.d.ts +9 -13
- package/dist/components/Table.js +1 -1
- package/dist/components/TableAction.d.ts +9 -13
- package/dist/components/TableAction.js +1 -1
- package/dist/components/TableBody.d.ts +8 -12
- package/dist/components/TableBody.js +1 -1
- package/dist/components/TableCell.d.ts +9 -13
- package/dist/components/TableCell.js +1 -1
- package/dist/components/TableHeader.d.ts +9 -13
- package/dist/components/TableHeader.js +1 -1
- package/dist/components/TableHeaderCell.d.ts +9 -13
- package/dist/components/TableHeaderCell.js +1 -1
- package/dist/components/TableRow.d.ts +8 -12
- package/dist/components/TableRow.js +1 -1
- package/dist/components/Tabs.d.ts +16 -20
- package/dist/components/Tabs.js +1 -1
- package/dist/components/TabsContent.d.ts +9 -13
- package/dist/components/TabsContent.js +1 -1
- package/dist/components/TabsList.d.ts +9 -13
- package/dist/components/TabsList.js +1 -1
- package/dist/components/TabsTrigger.d.ts +13 -17
- package/dist/components/TabsTrigger.js +1 -1
- package/dist/components/Text.d.ts +11 -15
- package/dist/components/Text.js +1 -1
- package/dist/components/Textarea.d.ts +26 -30
- package/dist/components/Textarea.js +1 -1
- package/dist/components/ThemeProvider.d.ts +9 -14
- package/dist/components/ThemeProvider.js +1 -1
- package/dist/components/ToastProvider.d.ts +19 -22
- package/dist/components/ToastProvider.js +1 -1
- package/dist/components/ToggleButton.d.ts +25 -29
- package/dist/components/ToggleButton.js +1 -1
- package/dist/components/Tooltip.d.ts +113 -115
- package/dist/components/Tooltip.js +1 -1
- package/dist/components/TooltipContent.d.ts +16 -19
- package/dist/components/TooltipContent.js +1 -1
- package/dist/components/TooltipProvider.d.ts +14 -17
- package/dist/components/TooltipProvider.js +1 -1
- package/dist/components/TooltipRoot.d.ts +17 -20
- package/dist/components/TooltipRoot.js +1 -1
- package/dist/components/TooltipTrigger.d.ts +8 -12
- package/dist/components/TooltipTrigger.js +1 -1
- package/dist/components/Transition.d.ts +13 -18
- package/dist/components/Transition.js +1 -1
- package/dist/components/TransitionGroup.d.ts +13 -16
- package/dist/components/TransitionGroup.js +1 -1
- package/dist/context-D0HFIYJ_.js +1 -0
- package/dist/decorateChildren-BhwGPu5S.js +1 -0
- package/dist/dist-AUbtUGaS.js +1 -0
- package/dist/dist-B6QtTKmw.js +1 -0
- package/dist/dist-BCEVT8Sf.js +1 -0
- package/dist/dist-BDMjG5B_.js +1 -0
- package/dist/dist-BFTycqjJ.js +1 -0
- package/dist/dist-BJF1BkL5.js +1 -0
- package/dist/dist-BQmL1Q-D.js +1 -0
- package/dist/dist-BVRPdw5X.js +1 -0
- package/dist/dist-BX0tcvA0.js +1 -0
- package/dist/dist-BiI731xY.js +1 -0
- package/dist/dist-BklWnqEB.js +1 -0
- package/dist/dist-BpmQi_8p.js +1 -0
- package/dist/dist-C-XsYKjl.js +1 -0
- package/dist/dist-CDOj7bN0.js +1 -0
- package/dist/dist-CUTPpVdE.js +1 -0
- package/dist/dist-CmtCufjZ.js +5 -0
- package/dist/dist-Cswf5OE5.js +1 -0
- package/dist/dist-Dbj1CWWr.js +1 -0
- package/dist/dist-Drux-m2s.js +1 -0
- package/dist/dist-G0xCpQtf.js +1 -0
- package/dist/dist-Kg3dfYHZ.js +1 -0
- package/dist/dist-NUxtssLG.js +1 -0
- package/dist/dist-iO5pkZQb.js +1 -0
- package/dist/downshift.esm-BIPNs-SH.js +1 -0
- package/dist/es2015-95pd62YV.js +1 -0
- package/dist/esm-CmD1-y7K.js +4 -0
- package/dist/fallbackSpan-DeAzFY6H.js +1 -0
- package/dist/index.d.ts +2216 -2596
- package/dist/index.js +1 -1
- package/dist/keyboard_arrow_down-BtQPLlqb.js +1 -0
- package/dist/layers.css.ts.vanilla-CGWWihaW-BIYv6PmD.js +1 -0
- package/dist/modal-context-CU0CnG0z.js +1 -0
- package/dist/more_horiz-DceY8TW7.js +1 -0
- package/dist/onReactSelectInputBlur-CEdJvo_p.js +1 -0
- package/dist/open_in_new-CKT2ta5v.js +1 -0
- package/dist/propTypes-BNb4ZFT2.js +1 -0
- package/dist/recipeRuntime-BkylZxVy.js +1 -0
- package/dist/register-CcKBKePR.js +6 -0
- package/dist/runtime-DK3Fl9T5.js +1 -0
- package/dist/search-DBZbXSoq.js +1 -0
- package/dist/shim-CkK-DhWs.js +11 -0
- package/dist/theme-css-Dw2E6J9s.js +1 -0
- package/dist/toPlainDate-C1-yIov4.js +1 -0
- package/dist/tokens-BvXME-4d.js +1 -0
- package/dist/{types-B4RnVKcG.d.ts → types-BYPfSW5W.d.ts} +8 -6
- package/dist/useEffectEvent-DVVhOB2y.js +1 -0
- package/dist/useFieldLabelTrigger-BBcq1sWi.js +1 -0
- package/dist/useMenuSurface-BigMN9vK.js +1 -0
- package/dist/useObserveValue-BuKWrpgx.js +1 -0
- package/dist/usePopoverScope-DMMruP41.js +1 -0
- package/dist/useResponsiveMatches-BWRx826H.js +1 -0
- package/dist/useSuggestions-iYHtNcM6.js +1 -0
- package/dist/useSurface-C1zFO6Wc.js +1 -0
- package/dist/utils-BFpM-tVD.js +1 -0
- package/dist/vanilla-extract-dynamic.esm-BTVburtF.js +1 -0
- package/dist/warning-CQvGv8yJ.js +1 -0
- package/dist/withIcon-DzMirfio.js +1 -0
- package/package.json +6 -6
- package/rolldown.config.mjs +870 -0
- package/dist/ActionsRoot-CoOGKHhO.js +0 -1
- package/dist/Alert-BrFUrf-V.js +0 -1
- package/dist/AlertDialog-DqaXJlCS.js +0 -1
- package/dist/AlertDialogBody-BVBmshuT.js +0 -1
- package/dist/AlertDialogFooter-CD2A9Gck.js +0 -1
- package/dist/AlertDialogHeader-aY4bjEwb.js +0 -1
- package/dist/AlertDialogTrigger-BS-7t9Ih.js +0 -1
- package/dist/AngleMenuButton-DzN0Ab1m.js +0 -1
- package/dist/Avatar-Bbj08UHU.js +0 -1
- package/dist/AvatarContext-dCvbGlDj.js +0 -1
- package/dist/AvatarGroup-oM-XvE0s.js +0 -1
- package/dist/AvatarGroup.css.ts.vanilla-Cw2ao1B0-BnX_Tx4M.js +0 -1
- package/dist/Badge-C3eCMEK3.js +0 -1
- package/dist/Box-CV4CtSQ7.js +0 -1
- package/dist/Button-CUhazaDP.js +0 -1
- package/dist/ButtonContext-DFZkdWkZ.js +0 -1
- package/dist/ButtonGroup-CC9XRuPe.js +0 -1
- package/dist/ButtonRoot-Bb3l1pZH.js +0 -1
- package/dist/Calendar-CJodGZ7W.js +0 -1
- package/dist/CardContext-CXVMpbO5.js +0 -1
- package/dist/Combination-DMxzHxML.js +0 -41
- package/dist/Cover-Df4okq9S.js +0 -1
- package/dist/Cover.css.ts.vanilla-BIGZHESl-DjRUgRLn.js +0 -1
- package/dist/DataTableAction-ftJrGzQI.js +0 -1
- package/dist/DataTableContext-B59kBVoW.js +0 -1
- package/dist/DataTableRowContext-C6lmTVaL.js +0 -1
- package/dist/DateRangePickerContext-CENm6Zdm.js +0 -1
- package/dist/DialogBody-BigLmGc-.js +0 -1
- package/dist/DialogFooter-C6h0g6Ss.js +0 -1
- package/dist/DialogForm-f1wbWL_o.js +0 -1
- package/dist/DialogTrigger-BxH0drX_.js +0 -1
- package/dist/Disclosure-B39kTLoi.js +0 -1
- package/dist/DisclosureContent-C6Dfq0b_.js +0 -1
- package/dist/DisclosureContext-rgj7CRVr.js +0 -1
- package/dist/DisclosureTrigger-DXKPjqWL.js +0 -1
- package/dist/DropdownMenuContext-Dz9dQ90D.js +0 -1
- package/dist/DropdownMenuNestedContext-DRstZmc3.js +0 -1
- package/dist/DropdownMenuSubContext-ChoQF2NR.js +0 -1
- package/dist/FieldContext-DhLL-p5u.js +0 -1
- package/dist/FieldLabel-BL-TUT2s.js +0 -1
- package/dist/FilteredSlot-DudEDOhm.js +0 -1
- package/dist/Group-BZ64vOhC.js +0 -1
- package/dist/Heading-yrECY2iG.js +0 -1
- package/dist/Icon-CX3s8z8w.js +0 -1
- package/dist/IconOpal-C8z7ykpm.js +0 -1
- package/dist/Input-fmuJksMc.js +0 -1
- package/dist/InputAddon-Dj_PsWS7.js +0 -1
- package/dist/InputContext-DzaZHn3j.js +0 -1
- package/dist/InputControl-CATzSsbS.js +0 -1
- package/dist/InputControl.css.ts.vanilla-BKEDBT5_-CRs5-1og.js +0 -1
- package/dist/InputRoot-BsX7CdMt.js +0 -1
- package/dist/Link-DgH5BuqR.js +0 -1
- package/dist/Listbox-q5L-8c3l.js +0 -1
- package/dist/ListboxEmpty-Cnq1LdnZ.js +0 -1
- package/dist/ListboxGroup-D86C580G.js +0 -1
- package/dist/ListboxGroupContext-CJWheMR7.js +0 -1
- package/dist/ListboxItem-D_kmTuEZ.js +0 -1
- package/dist/ListboxItemIndicator-BgaY7DbM.js +0 -1
- package/dist/ListboxItemized-Bnu7Fnpf.js +0 -1
- package/dist/ListboxLabel-DckuhM0j.js +0 -1
- package/dist/ListboxRadioItem-C9wtmXsa.js +0 -1
- package/dist/ListboxSeparator-DwEFeinu.js +0 -1
- package/dist/MaterialIcon-Bk5ioJ2S.js +0 -1
- package/dist/Menu-sh7TPzPq.js +0 -1
- package/dist/MenuContent-CmRcVGFw.js +0 -1
- package/dist/MenuContext-CSa7zhDy.js +0 -1
- package/dist/MenuTrigger-BAhdJlDP.js +0 -1
- package/dist/ModalLayer-ByL0o0Md.js +0 -1
- package/dist/Nav-j-9r0enD.js +0 -1
- package/dist/NavAccountItem-COhseBEo.js +0 -1
- package/dist/NavBody-CGU4BG9Q.js +0 -1
- package/dist/NavFooter-CaKgVSrN.js +0 -1
- package/dist/NavGroup-_jOftmtG.js +0 -1
- package/dist/NavGroupContent-CdspSeyp.js +0 -1
- package/dist/NavGroupContext-CvcR0ced.js +0 -1
- package/dist/NavGroupTrigger-BLowN3Yx.js +0 -1
- package/dist/NavHeader-BpDj8Aj9.js +0 -1
- package/dist/NavItem-i6sAvAkn.js +0 -1
- package/dist/NavList-DaRqUtDD.js +0 -1
- package/dist/NavSeparator-C2Yrq5KI.js +0 -1
- package/dist/Pagination-d1aFMSvn.js +0 -1
- package/dist/Paper-DijuyQQo.js +0 -1
- package/dist/Popover-Dj8sWW7T.js +0 -1
- package/dist/PopoverAnchor-bdcZeaij.js +0 -1
- package/dist/PopoverTrigger-Dzqj87Nq.js +0 -1
- package/dist/Portal-CCLNsZzC.js +0 -1
- package/dist/PortalContext-B40StADY.js +0 -1
- package/dist/RadioGroupContext-BrMQETHs.js +0 -1
- package/dist/SegmentedControlContext-BnpkLYkf.js +0 -1
- package/dist/Select-Bz5JIxX6.js +0 -1
- package/dist/SelectContent-CHiZvJnH.js +0 -1
- package/dist/SelectContext-C_BqJNCZ.js +0 -1
- package/dist/SelectTrigger-CY-26LXy.js +0 -1
- package/dist/Separator-1qXp3fA2.js +0 -1
- package/dist/SidebarContext-D4V60v9o.js +0 -1
- package/dist/Skeleton-BNJ81_0t.js +0 -1
- package/dist/Spinner-BtcHhTum.js +0 -1
- package/dist/SuggestionPopover-DjYLzfyy.js +0 -9
- package/dist/Table-CHcjAYLP.js +0 -1
- package/dist/TableAction-Q9EyRNsp.js +0 -1
- package/dist/TableBody-DBjAdioY.js +0 -1
- package/dist/TableCell-tAQD9nOJ.js +0 -1
- package/dist/TableHeader-B4aqgaXJ.js +0 -1
- package/dist/TableHeaderCell-DkeuQEjb.js +0 -1
- package/dist/TableRow-Brnlqy3m.js +0 -1
- package/dist/TableRow.css.ts.vanilla-EERAOdGT-BCPDwy1C.js +0 -1
- package/dist/Text-Dag_U1Vf.js +0 -1
- package/dist/ThemeProvider-BHWCi0-e.js +0 -13
- package/dist/ToastProvider-DHjd70C6.js +0 -1
- package/dist/ToggleInputLabel-CCR00D23.js +0 -1
- package/dist/Tooltip-7AWPkyPk.js +0 -1
- package/dist/TooltipContent-DgYxSTbi.js +0 -1
- package/dist/TooltipContext-_5JMKAbe.js +0 -1
- package/dist/TooltipProvider-CoPEAacD.js +0 -1
- package/dist/TooltipRoot-BxoGM8XH.js +0 -1
- package/dist/TooltipTrigger-CrhT_82S.js +0 -1
- package/dist/Transition-NSqouGx2.js +0 -1
- package/dist/TransitionGroup-M9RT3XeS.js +0 -1
- package/dist/TransitionGroupContext-B2FTL_jl.js +0 -1
- package/dist/VisuallyHidden-BmklSBLt.js +0 -1
- package/dist/calendar_today.svg-WYgziXw0.js +0 -1
- package/dist/chevron_left.svg-Bch0qJyg.js +0 -1
- package/dist/chevron_right.svg-t21AOvnQ.js +0 -1
- package/dist/close.svg-Bz6wgbqx.js +0 -1
- package/dist/context-C5SMAqJX.js +0 -1
- package/dist/decorateChildren-DceoQfLz.js +0 -1
- package/dist/fallbackSpan-DzjBTaxI.js +0 -1
- package/dist/index-2WYm7pKZ.js +0 -4
- package/dist/index-B6mZRI1I.js +0 -1
- package/dist/index-BC1Z8Guw.js +0 -1
- package/dist/index-BFmupGkL.js +0 -1
- package/dist/index-BV34namC.js +0 -1
- package/dist/index-BkNSa4ky.js +0 -1
- package/dist/index-BzIpwXn1.js +0 -1
- package/dist/index-C5SfZ6cm.js +0 -1
- package/dist/index-CBrz5xtv.js +0 -1
- package/dist/index-CDr5kGHV.js +0 -1
- package/dist/index-CGgkWnDx.js +0 -1
- package/dist/index-CHUhFArm.js +0 -1
- package/dist/index-CRdqsiiJ.js +0 -5
- package/dist/index-C_maKa2n.js +0 -1
- package/dist/index-CfTuczyl.js +0 -1
- package/dist/index-CfWSRbGc.js +0 -1
- package/dist/index-Cnb334T6.js +0 -1
- package/dist/index-DJSJX8vV.js +0 -1
- package/dist/index-DNVp5G2I.js +0 -1
- package/dist/index-DVJ8QmSG.js +0 -1
- package/dist/index-DcfvvjAr.js +0 -1
- package/dist/index-DdDkPouM.js +0 -1
- package/dist/index-Dh0_tMMM.js +0 -1
- package/dist/index-Dm3oMS4e.js +0 -1
- package/dist/isHoverSupported-BWzvcjJQ.js +0 -1
- package/dist/keyboard_arrow_down.svg-5O3cbT-j.js +0 -1
- package/dist/layers.css.ts.vanilla-BnNnDBQ3-yK8eJtnx.js +0 -1
- package/dist/modal-context-DjEp7oJz.js +0 -1
- package/dist/more_horiz.svg-DEJtVDmt.js +0 -1
- package/dist/onReactSelectInputBlur-BqDXHEGb.js +0 -1
- package/dist/open_in_new.svg-BU-nJ9og.js +0 -1
- package/dist/propTypes-DQak6nhg.js +0 -1
- package/dist/recipeRuntime-BvPxdQJv.js +0 -1
- package/dist/register-Jxf4mhRg.js +0 -6
- package/dist/search.svg-BYFmKpit.js +0 -1
- package/dist/theme-css-D9T4e-il.js +0 -1
- package/dist/toPlainDate-B6atItEt.js +0 -1
- package/dist/useEffectEvent-yhfb_y9N.js +0 -1
- package/dist/useFieldLabelTrigger-wsXl-c_m.js +0 -1
- package/dist/useHighlightedIndex-CHeL2gYc.js +0 -1
- package/dist/useMenuSurface-CdJdS9ED.js +0 -1
- package/dist/useObserveValue-CGyaoE8y.js +0 -1
- package/dist/usePopoverScope-DSsqDfAh.js +0 -1
- package/dist/useSuggestions-DPlvL0Y_.js +0 -1
- package/dist/useSurface-mcnxhoAn.js +0 -1
- package/dist/utils-DmL-SVWU.js +0 -1
- package/dist/vanilla-extract-dynamic.esm-eGTknIhu.js +0 -1
- package/dist/warning.svg-DjR1Q1pK.js +0 -1
- package/dist/withIcon-cYL21Bpv.js +0 -1
|
@@ -0,0 +1,870 @@
|
|
|
1
|
+
import { createFilter } from "@rollup/pluginutils";
|
|
2
|
+
import fg from "fast-glob";
|
|
3
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { createRequire } from "node:module";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import postcss from "postcss";
|
|
7
|
+
import postcssrc from "postcss-load-config";
|
|
8
|
+
import docgen from "react-docgen-typescript";
|
|
9
|
+
import { defineConfig } from "rolldown";
|
|
10
|
+
import { dts } from "rolldown-plugin-dts";
|
|
11
|
+
|
|
12
|
+
const external = new RegExp(
|
|
13
|
+
"^(?:" +
|
|
14
|
+
["@stencil/core/internal", "react", "react-dom"].join("|") +
|
|
15
|
+
")(?:/.+)?$",
|
|
16
|
+
);
|
|
17
|
+
const require = createRequire(import.meta.url);
|
|
18
|
+
const env = process.env.NODE_ENV ?? "development";
|
|
19
|
+
const watch = process.env.ROLLDOWN_WATCH === "true";
|
|
20
|
+
const pkg = JSON.parse(readFileSync("./package.json"));
|
|
21
|
+
|
|
22
|
+
const input = Object.fromEntries(
|
|
23
|
+
Object.entries(pkg.exports).map(([key, value]) => [
|
|
24
|
+
key === "." ? "index" : value.replace("./dist/", "").replace(".js", ""),
|
|
25
|
+
value.replace("./dist/", "src/").replace(".js", ".ts"),
|
|
26
|
+
]),
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
export default defineConfig([
|
|
30
|
+
{
|
|
31
|
+
input,
|
|
32
|
+
onwarn(warning, warn) {
|
|
33
|
+
if (warning.code === "MODULE_LEVEL_DIRECTIVE") {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
warn(warning);
|
|
37
|
+
},
|
|
38
|
+
output: {
|
|
39
|
+
dir: "dist",
|
|
40
|
+
format: "es",
|
|
41
|
+
minify: env === "production",
|
|
42
|
+
},
|
|
43
|
+
plugins: [
|
|
44
|
+
aliasPlugin({
|
|
45
|
+
react: "preact/compat",
|
|
46
|
+
"react-dom": "preact/compat",
|
|
47
|
+
"react-dom/client": "preact/compat/client",
|
|
48
|
+
"react-is": "preact/compat",
|
|
49
|
+
"react/jsx-runtime": "preact/jsx-runtime",
|
|
50
|
+
}),
|
|
51
|
+
/**
|
|
52
|
+
* ============================================================================
|
|
53
|
+
* SHADOW DOM COMPATIBILITY PATCHES
|
|
54
|
+
* ============================================================================
|
|
55
|
+
*
|
|
56
|
+
* These rolldown transforms modify third-party libraries (Radix, Downshift) at
|
|
57
|
+
* BUILD TIME to work correctly inside Web Components with Shadow DOM.
|
|
58
|
+
*
|
|
59
|
+
* IMPORTANT: These patches ONLY apply to the web-components package build.
|
|
60
|
+
* The React package, Storybook, and tests use the unmodified libraries.
|
|
61
|
+
*
|
|
62
|
+
* Why not use pnpm patch?
|
|
63
|
+
* - pnpm patch affects ALL packages in the monorepo globally
|
|
64
|
+
* - We only need shadow DOM fixes for web-components, not for React components
|
|
65
|
+
* - Rolldown transforms are scoped to this package's build process
|
|
66
|
+
*
|
|
67
|
+
* Each transform below documents:
|
|
68
|
+
* - What problem it solves
|
|
69
|
+
* - Why it's needed
|
|
70
|
+
* - Examples of when it matters
|
|
71
|
+
* ============================================================================
|
|
72
|
+
*/
|
|
73
|
+
{
|
|
74
|
+
name: "axiom:theme-provider",
|
|
75
|
+
/**
|
|
76
|
+
* Shadow DOM Compatibility: CSS :root selector
|
|
77
|
+
*
|
|
78
|
+
* Problem: In shadow DOM, :root refers to the document root, not the shadow root
|
|
79
|
+
* Solution: Replace :root with :host to target the shadow root host element
|
|
80
|
+
*
|
|
81
|
+
* This ensures theme CSS variables are scoped to each web component instance
|
|
82
|
+
*/
|
|
83
|
+
transform(code, id) {
|
|
84
|
+
if (
|
|
85
|
+
!(
|
|
86
|
+
code.includes(":root") &&
|
|
87
|
+
id.includes("packages/react/src/theme-provider")
|
|
88
|
+
)
|
|
89
|
+
) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return code.replace(":root", ":host");
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: "downshift",
|
|
98
|
+
/**
|
|
99
|
+
* Downshift Library Optimization
|
|
100
|
+
*
|
|
101
|
+
* Problem: Downshift includes class components and PropTypes that don't work with Preact
|
|
102
|
+
* Solution: Strip out the class-based Downshift component and PropTypes validation
|
|
103
|
+
*
|
|
104
|
+
* What's removed:
|
|
105
|
+
* - Class-based Downshift component (we only use useCombobox hook)
|
|
106
|
+
* - react-is dependency (not needed for hooks)
|
|
107
|
+
* - PropTypes declarations and validation calls
|
|
108
|
+
*
|
|
109
|
+
* This reduces bundle size and prevents Preact compatibility issues
|
|
110
|
+
*/
|
|
111
|
+
transform(code, id) {
|
|
112
|
+
if (!id.includes("node_modules/downshift")) {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return (
|
|
117
|
+
code.slice(
|
|
118
|
+
0,
|
|
119
|
+
code.indexOf("var Downshift = /*#__PURE__*/function () {"),
|
|
120
|
+
) +
|
|
121
|
+
"\n" +
|
|
122
|
+
code.slice(code.indexOf("// Shared between all exports."))
|
|
123
|
+
)
|
|
124
|
+
.replace("Downshift as default,", "")
|
|
125
|
+
.replace("import { isForwardRef } from 'react-is';", "")
|
|
126
|
+
.replace(
|
|
127
|
+
/var (propTypes|commonPropTypes|commonDropdownPropTypes|propTypes\$\d)([^;]|\s)+;/g,
|
|
128
|
+
"var $1 = _extends({})",
|
|
129
|
+
)
|
|
130
|
+
.replace(/PropTypes.checkPropTypes[^;]+;/g, "");
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
load(id) {
|
|
135
|
+
if (!id.includes("prop-types")) {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return "export default {}";
|
|
140
|
+
},
|
|
141
|
+
name: "prop-types",
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: "radix-collection:document-querySelectorAll",
|
|
145
|
+
/**
|
|
146
|
+
* Shadow DOM Compatibility: querySelectorAll across shadow boundaries
|
|
147
|
+
*
|
|
148
|
+
* Problem: querySelectorAll() doesn't pierce shadow DOM boundaries
|
|
149
|
+
* Solution: Also search inside slotted elements' shadow roots
|
|
150
|
+
*
|
|
151
|
+
* Why needed: Radix Collection uses querySelectorAll to find items (e.g., menu items).
|
|
152
|
+
* In web components, some items might be slotted from light DOM and have their own
|
|
153
|
+
* shadow roots. We need to search those too.
|
|
154
|
+
*
|
|
155
|
+
* Example: <ax-dropdown-menu-item> is slotted but has its own shadow root with
|
|
156
|
+
* the actual focusable element inside
|
|
157
|
+
*/
|
|
158
|
+
transform(code, id) {
|
|
159
|
+
if (
|
|
160
|
+
!(
|
|
161
|
+
code.includes(".querySelectorAll(") &&
|
|
162
|
+
id.includes("react-collection")
|
|
163
|
+
)
|
|
164
|
+
) {
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return code.replace(
|
|
169
|
+
/(\w+)\.querySelectorAll\(/,
|
|
170
|
+
`((element, selector) => {
|
|
171
|
+
const slots = element.querySelectorAll("slot");
|
|
172
|
+
const result = [...element.querySelectorAll(selector)];
|
|
173
|
+
for (const slot of slots) {
|
|
174
|
+
for (const elem of slot.assignedElements()) {
|
|
175
|
+
result.push(...(elem.shadowRoot ?? elem).querySelectorAll(selector));
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return result;
|
|
179
|
+
})($1,`,
|
|
180
|
+
);
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: "radix-collection:react-useEffect",
|
|
185
|
+
/**
|
|
186
|
+
* Timing Fix: useEffect → useLayoutEffect
|
|
187
|
+
*
|
|
188
|
+
* Problem: useEffect runs AFTER the dropdown menu content gets focus, so Radix
|
|
189
|
+
* Collection's DOM query hasn't run yet and can't find child nodes to focus
|
|
190
|
+
* the first focusable item.
|
|
191
|
+
*
|
|
192
|
+
* Solution: Use useLayoutEffect to run synchronously before paint, ensuring
|
|
193
|
+
* the collection is populated before focus management happens.
|
|
194
|
+
*
|
|
195
|
+
* Why needed: In DropdownMenu, focus moves to the menu content immediately on open.
|
|
196
|
+
* Radix tries to focus the first item, but with useEffect, the collection hasn't
|
|
197
|
+
* been built yet, so there are no items to focus.
|
|
198
|
+
*
|
|
199
|
+
* Original issue: commit 2557cbe2 (Oct 31, 2024)
|
|
200
|
+
*/
|
|
201
|
+
transform(code, id) {
|
|
202
|
+
if (
|
|
203
|
+
!(code.includes("useEffect") && id.includes("react-collection"))
|
|
204
|
+
) {
|
|
205
|
+
return null;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
return code.replace("useEffect", "useLayoutEffect");
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
name: "active-element",
|
|
213
|
+
/**
|
|
214
|
+
* Shadow DOM Compatibility: document.activeElement traversal
|
|
215
|
+
*
|
|
216
|
+
* Problem: document.activeElement stops at shadow host, doesn't show actual focused element
|
|
217
|
+
* Solution: Traverse shadow roots to find the deepest focused element
|
|
218
|
+
*
|
|
219
|
+
* Example:
|
|
220
|
+
* Without patch: document.activeElement = <ax-menu-content>
|
|
221
|
+
* With patch: document.activeElement = <input> (inside shadow root)
|
|
222
|
+
*
|
|
223
|
+
* Why needed: Many libraries check document.activeElement for focus management.
|
|
224
|
+
* In shadow DOM, this needs to traverse into shadow roots to find the real target.
|
|
225
|
+
*/
|
|
226
|
+
transform(code) {
|
|
227
|
+
if (!code.includes("document.activeElement")) {
|
|
228
|
+
return null;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
return code.replaceAll(
|
|
232
|
+
/(\w+\.)?document\.activeElement/g,
|
|
233
|
+
(match) => `(() => {
|
|
234
|
+
let active = ${match};
|
|
235
|
+
while (active?.shadowRoot) {
|
|
236
|
+
active = active.shadowRoot.activeElement;
|
|
237
|
+
}
|
|
238
|
+
return active;
|
|
239
|
+
})()`,
|
|
240
|
+
);
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: "aria-hidden",
|
|
245
|
+
/**
|
|
246
|
+
* Shadow DOM Compatibility: aria-hidden management
|
|
247
|
+
*
|
|
248
|
+
* Problem: @radix-ui/react-aria-hidden sets aria-hidden on siblings to trap focus,
|
|
249
|
+
* but doesn't handle shadow DOM boundaries
|
|
250
|
+
*
|
|
251
|
+
* Solution 1: When keeping elements, also keep slotted elements
|
|
252
|
+
* - If parent is a shadow root, keep all slotted elements (they're outside the shadow)
|
|
253
|
+
* - Navigate through shadow root to host for parent traversal
|
|
254
|
+
*
|
|
255
|
+
* Solution 2: Fix .contains() to work across shadow boundaries
|
|
256
|
+
* - Traverse from target up through shadow roots to find if container contains it
|
|
257
|
+
*
|
|
258
|
+
* Why needed: Focus trap dialogs hide other content with aria-hidden. In shadow DOM,
|
|
259
|
+
* we need to preserve slotted content and check containment across boundaries.
|
|
260
|
+
*/
|
|
261
|
+
transform(code, id) {
|
|
262
|
+
if (!id.includes("aria-hidden")) {
|
|
263
|
+
return null;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
return code
|
|
267
|
+
.replace(
|
|
268
|
+
"keep(el.parentNode)",
|
|
269
|
+
`if (el.parentNode instanceof ShadowRoot) {
|
|
270
|
+
for (const slot of el.parentNode.querySelectorAll('slot')) {
|
|
271
|
+
for (const node of slot.assignedElements()) {
|
|
272
|
+
elementsToKeep.add(node);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
keep(el.parentNode instanceof ShadowRoot ? el.parentNode.host : el.parentNode)`,
|
|
277
|
+
)
|
|
278
|
+
.replaceAll(
|
|
279
|
+
/(\w+)\.contains\(/g,
|
|
280
|
+
`((container, target) => {
|
|
281
|
+
while (target.getRootNode() instanceof ShadowRoot) {
|
|
282
|
+
target = target.getRootNode().host;
|
|
283
|
+
}
|
|
284
|
+
return container.contains(target);
|
|
285
|
+
})($1,`,
|
|
286
|
+
);
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
name: "radix-focus-scope",
|
|
291
|
+
/**
|
|
292
|
+
* Shadow DOM Compatibility: Radix FocusScope focus management
|
|
293
|
+
*
|
|
294
|
+
* This is the most complex patch - it fixes multiple issues with focus trapping in shadow DOM.
|
|
295
|
+
*
|
|
296
|
+
* Patch 1: Track focus through shadow roots
|
|
297
|
+
* - Problem: event.target stops at shadow host
|
|
298
|
+
* - Solution: Use composedPath()[0] to get the actual target inside shadow
|
|
299
|
+
*
|
|
300
|
+
* Patch 2: Scope event listeners to shadow root
|
|
301
|
+
* - Problem: document.addEventListener in shadow DOM won't catch events inside
|
|
302
|
+
* - Solution: Add listeners to the shadow root instead of document
|
|
303
|
+
*
|
|
304
|
+
* Patch 3: Fix .contains() for shadow DOM ⭐ THE MENU FIX
|
|
305
|
+
* - Problem: container.contains() doesn't work across shadow boundaries
|
|
306
|
+
* - Solution: If both elements are in the same shadow root, use native contains().
|
|
307
|
+
* Otherwise check if container's root host contains the target.
|
|
308
|
+
* - Why needed for Menu: When FocusScope opens, downshift has already focused the
|
|
309
|
+
* input via useEffect. FocusScope then checks if a focused element is inside the
|
|
310
|
+
* container with contains(). Without this patch, it incorrectly returns false
|
|
311
|
+
* (because it traverses to the host), so FocusScope re-runs focusFirst() and
|
|
312
|
+
* falls back to focusing the dialog container, stealing focus from the input.
|
|
313
|
+
*
|
|
314
|
+
* Example (Menu):
|
|
315
|
+
* <ax-menu-content shadow>
|
|
316
|
+
* <div role="dialog" tabindex="-1"> ← FocusScope container
|
|
317
|
+
* <input role="combobox"> ← Already focused by downshift
|
|
318
|
+
* → container.contains(input) must return true (same shadow root)
|
|
319
|
+
*
|
|
320
|
+
* Example (cross-boundary):
|
|
321
|
+
* <ax-alert-dialog-content shadow> ← FocusScope container is inside
|
|
322
|
+
* <ax-alert-dialog-cancel> ← Target is in light DOM (slotted)
|
|
323
|
+
* → Must traverse to host to check containment
|
|
324
|
+
*/
|
|
325
|
+
transform(code, id) {
|
|
326
|
+
if (!id.includes("react-focus-scope")) {
|
|
327
|
+
return null;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
return code
|
|
331
|
+
.replace(
|
|
332
|
+
"lastFocusedElementRef.current = target",
|
|
333
|
+
"lastFocusedElementRef.current = event.target.shadowRoot ? event.composedPath()[0] : event.target",
|
|
334
|
+
)
|
|
335
|
+
.replace(
|
|
336
|
+
"document.addEventListener",
|
|
337
|
+
"const root = container?.getRootNode() ?? document; document.addEventListener",
|
|
338
|
+
)
|
|
339
|
+
.replaceAll("document.addEventListener", "root.addEventListener")
|
|
340
|
+
.replaceAll(
|
|
341
|
+
"document.removeEventListener",
|
|
342
|
+
"root.removeEventListener",
|
|
343
|
+
)
|
|
344
|
+
.replaceAll(
|
|
345
|
+
/(\w+)\.contains\(/g,
|
|
346
|
+
`((container, target) => {
|
|
347
|
+
if (container.getRootNode() instanceof ShadowRoot) {
|
|
348
|
+
// If both elements are in the same shadow root, use native contains
|
|
349
|
+
if (container.getRootNode() === target?.getRootNode?.()) {
|
|
350
|
+
return container.contains(target);
|
|
351
|
+
}
|
|
352
|
+
return container.getRootNode().host.contains(target);
|
|
353
|
+
} else {
|
|
354
|
+
return container.contains(target);
|
|
355
|
+
}
|
|
356
|
+
})($1,`,
|
|
357
|
+
);
|
|
358
|
+
},
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
name: "radix-portal:react-Portal",
|
|
362
|
+
/**
|
|
363
|
+
* Shadow DOM Compatibility: Disable React Portal
|
|
364
|
+
*
|
|
365
|
+
* Problem: React Portal renders to document.body, breaking shadow DOM encapsulation
|
|
366
|
+
* Solution: Replace Portal with a simple pass-through component
|
|
367
|
+
*
|
|
368
|
+
* Why needed: In web components, we want everything to stay within the shadow root
|
|
369
|
+
* for proper encapsulation and styling. Radix Portal would break out of the shadow
|
|
370
|
+
* DOM and render at document level, causing:
|
|
371
|
+
* - Style inheritance issues (theme tokens wouldn't apply)
|
|
372
|
+
* - Event handling problems (clicks wouldn't bubble correctly)
|
|
373
|
+
* - Z-index/stacking context issues
|
|
374
|
+
*
|
|
375
|
+
* Our replacement just clones the children with the ref, keeping everything local.
|
|
376
|
+
*/
|
|
377
|
+
transform(_code, id) {
|
|
378
|
+
if (!id.includes("react-portal")) {
|
|
379
|
+
return null;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
return `"use client";
|
|
383
|
+
|
|
384
|
+
import { cloneElement, forwardRef } from "react";
|
|
385
|
+
const PORTAL_NAME = "Portal";
|
|
386
|
+
const Portal = forwardRef((props, ref) => {
|
|
387
|
+
return cloneElement(props.children, { ref });
|
|
388
|
+
});
|
|
389
|
+
Portal.displayName = PORTAL_NAME;
|
|
390
|
+
export { Portal, Portal as Root };`;
|
|
391
|
+
},
|
|
392
|
+
},
|
|
393
|
+
stylePlugin({ include: ["**/*.css"] }),
|
|
394
|
+
webComponentPlugin({
|
|
395
|
+
include: [
|
|
396
|
+
"src/components/**/*.ts",
|
|
397
|
+
"src/index.ts",
|
|
398
|
+
process.cwd() + "/src/mapping",
|
|
399
|
+
process.cwd() + "/src/propTypes",
|
|
400
|
+
],
|
|
401
|
+
}),
|
|
402
|
+
],
|
|
403
|
+
transform: {
|
|
404
|
+
define: {
|
|
405
|
+
"process.env.NODE_ENV": JSON.stringify(env),
|
|
406
|
+
},
|
|
407
|
+
target: "es2022",
|
|
408
|
+
},
|
|
409
|
+
tsconfig: "tsconfig.build.json",
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
external,
|
|
413
|
+
input: Object.fromEntries(
|
|
414
|
+
Object.entries(input).map(([key, value]) => [
|
|
415
|
+
key,
|
|
416
|
+
value.replace(".ts", ".d.ts"),
|
|
417
|
+
]),
|
|
418
|
+
),
|
|
419
|
+
output: {
|
|
420
|
+
dir: "dist",
|
|
421
|
+
format: "es",
|
|
422
|
+
},
|
|
423
|
+
plugins: [
|
|
424
|
+
typeDeclarationPlugin({
|
|
425
|
+
include: ["src/components/**/*.d.ts", "src/index.d.ts"],
|
|
426
|
+
}),
|
|
427
|
+
dts({
|
|
428
|
+
dtsInput: true,
|
|
429
|
+
emitDtsOnly: true,
|
|
430
|
+
sourcemap: false,
|
|
431
|
+
tsconfig: "tsconfig.build.json",
|
|
432
|
+
tsgo: !watch,
|
|
433
|
+
}),
|
|
434
|
+
],
|
|
435
|
+
},
|
|
436
|
+
]);
|
|
437
|
+
|
|
438
|
+
/** @returns {import('rolldown').Plugin} */
|
|
439
|
+
function aliasPlugin(aliases = {}) {
|
|
440
|
+
return {
|
|
441
|
+
name: "rolldown-plugin-alias",
|
|
442
|
+
resolveId(source) {
|
|
443
|
+
const alias = aliases[source];
|
|
444
|
+
return alias ? this.resolve(alias) : null;
|
|
445
|
+
},
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
/** @returns {import('rolldown').Plugin} */
|
|
450
|
+
function stylePlugin({ exclude = [], include = [] } = {}) {
|
|
451
|
+
const filter = createFilter(include ?? [], exclude ?? []);
|
|
452
|
+
|
|
453
|
+
/** @returns {Promise<postcssrc.Result>} */
|
|
454
|
+
const getPostcssConfig = async () => {
|
|
455
|
+
if (getPostcssConfig.cache) {
|
|
456
|
+
return getPostcssConfig.cache;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
getPostcssConfig.cache = await postcssrc({}, process.cwd());
|
|
460
|
+
return getPostcssConfig.cache;
|
|
461
|
+
};
|
|
462
|
+
|
|
463
|
+
return {
|
|
464
|
+
name: "rolldown-plugin-style",
|
|
465
|
+
async transform(code, id) {
|
|
466
|
+
if (!filter(id)) {
|
|
467
|
+
return null;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
const { options, plugins } = await getPostcssConfig();
|
|
471
|
+
const { css } = await postcss(plugins).process(code, {
|
|
472
|
+
...options,
|
|
473
|
+
from: id,
|
|
474
|
+
to: "dist/index.css",
|
|
475
|
+
});
|
|
476
|
+
return {
|
|
477
|
+
code: [
|
|
478
|
+
`import { injectGlobalStyle, injectLocalStyle } from '${require.resolve("./src/styles.ts")}';`,
|
|
479
|
+
id.includes("node_modules")
|
|
480
|
+
? `injectGlobalStyle(${JSON.stringify(css)})`
|
|
481
|
+
: `injectLocalStyle(${JSON.stringify(css)})`,
|
|
482
|
+
].join("\n"),
|
|
483
|
+
moduleType: "js",
|
|
484
|
+
};
|
|
485
|
+
},
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/** @returns {import('rolldown').Plugin} */
|
|
490
|
+
function typeDeclarationPlugin({ include = [] }) {
|
|
491
|
+
const filter = createFilter(include ?? []);
|
|
492
|
+
const docs = docgen
|
|
493
|
+
.withCompilerOptions(
|
|
494
|
+
{ esModuleInterop: true },
|
|
495
|
+
{
|
|
496
|
+
propFilter: (prop) =>
|
|
497
|
+
prop.parent
|
|
498
|
+
? prop.parent.fileName.includes("@types/react")
|
|
499
|
+
? prop.name === "ref"
|
|
500
|
+
: true
|
|
501
|
+
: true,
|
|
502
|
+
savePropValueAsString: true,
|
|
503
|
+
shouldExtractValuesFromUnion: true,
|
|
504
|
+
skipChildrenPropWithoutDoc: false,
|
|
505
|
+
},
|
|
506
|
+
)
|
|
507
|
+
.parse(fg.globSync("../react/dist/**/*.d.ts"));
|
|
508
|
+
const box = docs.find((doc) => doc.displayName === "Box");
|
|
509
|
+
|
|
510
|
+
const generateDts = (id) => {
|
|
511
|
+
const component = path.parse(id).name.replace(".d", "");
|
|
512
|
+
if (!existsSync(component)) {
|
|
513
|
+
mkdirSync(component);
|
|
514
|
+
}
|
|
515
|
+
writeFileSync(
|
|
516
|
+
`${component}/package.json`,
|
|
517
|
+
`{
|
|
518
|
+
"types": "../dist/components/${component}.d.ts",
|
|
519
|
+
"module": "../dist/components/${component}.js"
|
|
520
|
+
}`,
|
|
521
|
+
);
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* For some reason rolldown-plugin-dts is naming Table as Table$1 in the
|
|
525
|
+
* final d.ts. So we check for both names here.
|
|
526
|
+
*/
|
|
527
|
+
const doc =
|
|
528
|
+
docs.find((doc) => doc.displayName === component) ??
|
|
529
|
+
docs.find((doc) => doc.displayName === component + "$1");
|
|
530
|
+
const propTypes = Object.values(doc?.props ?? {})
|
|
531
|
+
.filter(
|
|
532
|
+
({ name, type }) =>
|
|
533
|
+
!(
|
|
534
|
+
type.name.startsWith("RefObject<") ||
|
|
535
|
+
name === "children" ||
|
|
536
|
+
name === "ref"
|
|
537
|
+
),
|
|
538
|
+
)
|
|
539
|
+
.filter(
|
|
540
|
+
({ name, type }) =>
|
|
541
|
+
component === "Box" ||
|
|
542
|
+
name === "asChild" ||
|
|
543
|
+
!("asChild" in doc.props && component !== "ModalLayer") ||
|
|
544
|
+
!(name in box.props) ||
|
|
545
|
+
box.props[name].type.raw !== type.raw,
|
|
546
|
+
)
|
|
547
|
+
.flatMap(({ name, type }) => {
|
|
548
|
+
const props = [
|
|
549
|
+
`"${name}"?: ${
|
|
550
|
+
type.raw === "ReactNode"
|
|
551
|
+
? "string | number | false | true"
|
|
552
|
+
: type.raw
|
|
553
|
+
? type.value
|
|
554
|
+
.map(({ value }) =>
|
|
555
|
+
value.startsWith("ResponsiveArray<")
|
|
556
|
+
? `ResponsiveArray<${type.value
|
|
557
|
+
.map(({ value }) => value)
|
|
558
|
+
.filter(
|
|
559
|
+
(value) =>
|
|
560
|
+
!(
|
|
561
|
+
value.startsWith("ResponsiveArray<") ||
|
|
562
|
+
value.startsWith("{ ")
|
|
563
|
+
),
|
|
564
|
+
)
|
|
565
|
+
.join(" | ")}>`
|
|
566
|
+
: value.startsWith("{ ")
|
|
567
|
+
? `ResponsiveObject<${type.value
|
|
568
|
+
.map(({ value }) => value)
|
|
569
|
+
.filter(
|
|
570
|
+
(value) =>
|
|
571
|
+
!(
|
|
572
|
+
value.startsWith("ResponsiveArray<") ||
|
|
573
|
+
value.startsWith("{ ")
|
|
574
|
+
),
|
|
575
|
+
)
|
|
576
|
+
.join(" | ")}>`
|
|
577
|
+
: value.startsWith("(")
|
|
578
|
+
? `(${value})`
|
|
579
|
+
: value,
|
|
580
|
+
)
|
|
581
|
+
.join(" | ")
|
|
582
|
+
: type.name
|
|
583
|
+
};`,
|
|
584
|
+
];
|
|
585
|
+
if (name.toLowerCase() !== name && !name.startsWith("on")) {
|
|
586
|
+
props.push(
|
|
587
|
+
`"${toKebabCase(name)}"?: ${
|
|
588
|
+
type.raw === "ReactNode"
|
|
589
|
+
? "string"
|
|
590
|
+
: type.raw
|
|
591
|
+
? type.value
|
|
592
|
+
.map(({ value }) => value)
|
|
593
|
+
.filter(
|
|
594
|
+
(value) =>
|
|
595
|
+
!(
|
|
596
|
+
value.startsWith("ResponsiveArray<") ||
|
|
597
|
+
value.startsWith("{ ")
|
|
598
|
+
),
|
|
599
|
+
)
|
|
600
|
+
.join(" | ")
|
|
601
|
+
: type.name
|
|
602
|
+
};`,
|
|
603
|
+
);
|
|
604
|
+
}
|
|
605
|
+
return props;
|
|
606
|
+
});
|
|
607
|
+
|
|
608
|
+
const ref = doc.props.ref?.type.raw
|
|
609
|
+
.match(/<([^>]+)>/)[1]
|
|
610
|
+
.split(" & ")
|
|
611
|
+
.map((instance) =>
|
|
612
|
+
instance
|
|
613
|
+
.replace(/^(HTML|SVG)/, "")
|
|
614
|
+
.replace(/Element$/, "")
|
|
615
|
+
.toLowerCase()
|
|
616
|
+
.replace("anchor", "a")
|
|
617
|
+
.replace("heading", "h1")
|
|
618
|
+
.replace("paragraph", "p")
|
|
619
|
+
.replace("olist", "ol")
|
|
620
|
+
.replace("ulist", "ul"),
|
|
621
|
+
);
|
|
622
|
+
|
|
623
|
+
const extendsBox =
|
|
624
|
+
component !== "Box" &&
|
|
625
|
+
"asChild" in doc.props &&
|
|
626
|
+
component !== "ModalLayer";
|
|
627
|
+
|
|
628
|
+
return `export const ${component} = "ax${toKebabCase(component)}";
|
|
629
|
+
|
|
630
|
+
export type ${component}Props = ${extendsBox ? "BoxProps & " : ""} {
|
|
631
|
+
${propTypes.join("\n")}
|
|
632
|
+
};
|
|
633
|
+
|
|
634
|
+
declare module "@stencil/core" {
|
|
635
|
+
namespace JSX {
|
|
636
|
+
interface IntrinsicElements {
|
|
637
|
+
[${component}]: ${component}Props${
|
|
638
|
+
ref
|
|
639
|
+
? ` & Omit<(${ref
|
|
640
|
+
.map(
|
|
641
|
+
(tagName) =>
|
|
642
|
+
`JSXBase.IntrinsicElements["${tagName || "main"}"]`,
|
|
643
|
+
)
|
|
644
|
+
.join(" | ")}), keyof ${component}Props>`
|
|
645
|
+
: ""
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
declare module "react" {
|
|
652
|
+
namespace JSX {
|
|
653
|
+
interface IntrinsicElements {
|
|
654
|
+
[${component}]: ${component}Props${
|
|
655
|
+
ref
|
|
656
|
+
? ` & Omit<(${ref
|
|
657
|
+
.map(
|
|
658
|
+
(tagName) => `ComponentPropsWithoutRef<"${tagName || "main"}">`,
|
|
659
|
+
)
|
|
660
|
+
.join(" | ")}), keyof ${component}Props>`
|
|
661
|
+
: doc.props.children
|
|
662
|
+
? " & { children?: ReactNode }"
|
|
663
|
+
: ""
|
|
664
|
+
};
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
}`;
|
|
668
|
+
};
|
|
669
|
+
|
|
670
|
+
return {
|
|
671
|
+
load(id) {
|
|
672
|
+
if (!filter(id)) {
|
|
673
|
+
return null;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
return (
|
|
677
|
+
id.endsWith("/index.d.ts")
|
|
678
|
+
? [
|
|
679
|
+
'import type { JSXBase } from "@stencil/core/internal";',
|
|
680
|
+
'import type { ComponentPropsWithoutRef, ReactNode } from "react";',
|
|
681
|
+
'import type { ChangeEventHandler, FocusEventHandler, FocusOutsideEvent, PointerDownOutsideEvent, ResponsiveArray, ResponsiveObject, SwipeEvent, Toaster } from "./types";',
|
|
682
|
+
...Object.entries(input).map(([key, value]) =>
|
|
683
|
+
key === "index" ? "" : generateDts(value),
|
|
684
|
+
),
|
|
685
|
+
]
|
|
686
|
+
: [
|
|
687
|
+
'import type { JSXBase } from "@stencil/core/internal";',
|
|
688
|
+
'import type { ComponentPropsWithoutRef, ReactNode } from "react";',
|
|
689
|
+
'import type { ChangeEventHandler, FocusEventHandler, FocusOutsideEvent, PointerDownOutsideEvent, ResponsiveArray, ResponsiveObject, SwipeEvent, Toaster } from "../types";',
|
|
690
|
+
id.endsWith("/Box.d.ts")
|
|
691
|
+
? ""
|
|
692
|
+
: 'import type { BoxProps } from "./Box";',
|
|
693
|
+
generateDts(id),
|
|
694
|
+
]
|
|
695
|
+
).join("\n");
|
|
696
|
+
},
|
|
697
|
+
name: "rolldown-plugin-type-declaration",
|
|
698
|
+
order: "pre",
|
|
699
|
+
async resolveId(id, importer) {
|
|
700
|
+
const resolved = importer
|
|
701
|
+
? path.resolve(path.dirname(importer), id + ".d.ts")
|
|
702
|
+
: path.resolve(id);
|
|
703
|
+
if (filter(resolved)) {
|
|
704
|
+
return resolved;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
return null;
|
|
708
|
+
},
|
|
709
|
+
};
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
/** @returns {import('rolldown').Plugin} */
|
|
713
|
+
function webComponentPlugin({ include = [] }) {
|
|
714
|
+
const prefix = `\0virtual:`;
|
|
715
|
+
const filter = createFilter(include ?? []);
|
|
716
|
+
const docs = docgen
|
|
717
|
+
.withCompilerOptions(
|
|
718
|
+
{ esModuleInterop: true },
|
|
719
|
+
{
|
|
720
|
+
propFilter: (prop) =>
|
|
721
|
+
prop.parent
|
|
722
|
+
? prop.parent.fileName.includes("@types/react")
|
|
723
|
+
? ["defaultChecked", "defaultValue"].includes(prop.name)
|
|
724
|
+
: true
|
|
725
|
+
: true,
|
|
726
|
+
savePropValueAsString: true,
|
|
727
|
+
shouldExtractValuesFromUnion: true,
|
|
728
|
+
},
|
|
729
|
+
)
|
|
730
|
+
.parse(fg.globSync("../react/dist/**/*.d.ts"));
|
|
731
|
+
|
|
732
|
+
return {
|
|
733
|
+
load(id) {
|
|
734
|
+
if (!id.startsWith(prefix)) {
|
|
735
|
+
return null;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
const component = path.parse(id).name;
|
|
739
|
+
|
|
740
|
+
switch (component) {
|
|
741
|
+
case "index":
|
|
742
|
+
return `import { factory } from "./factory";
|
|
743
|
+
|
|
744
|
+
${Object.entries(input)
|
|
745
|
+
.map(([key, value]) => {
|
|
746
|
+
const component = path.parse(value).name;
|
|
747
|
+
return key === "index"
|
|
748
|
+
? ""
|
|
749
|
+
: `import { ${component}Props } from "./propTypes";
|
|
750
|
+
|
|
751
|
+
export const ${component} = "ax${toKebabCase(component)}"
|
|
752
|
+
if (!customElements.get(${component})) {
|
|
753
|
+
customElements.define(${component}, factory(${component}, "${component}", ${component}Props));
|
|
754
|
+
}`;
|
|
755
|
+
})
|
|
756
|
+
.join("\n")}`;
|
|
757
|
+
case "mapping":
|
|
758
|
+
return `export const components = new Set([${Object.entries(input)
|
|
759
|
+
.map(([key, value]) => {
|
|
760
|
+
const component = path.parse(value).name;
|
|
761
|
+
return key === "index" ? "" : `"ax${toKebabCase(component)}",`;
|
|
762
|
+
})
|
|
763
|
+
.join("\n")}]);`;
|
|
764
|
+
case "propTypes":
|
|
765
|
+
return Object.entries(input)
|
|
766
|
+
.map(([key, value]) => {
|
|
767
|
+
const component = path.parse(value).name;
|
|
768
|
+
const doc = docs.find((doc) => doc.displayName === component);
|
|
769
|
+
const propTypes = Object.fromEntries(
|
|
770
|
+
Object.entries(doc?.props ?? {}).flatMap(([name, value]) => {
|
|
771
|
+
const type = name.startsWith("on")
|
|
772
|
+
? "function"
|
|
773
|
+
: getPropType(value.type);
|
|
774
|
+
return type ? [[name, type]] : [];
|
|
775
|
+
}),
|
|
776
|
+
);
|
|
777
|
+
|
|
778
|
+
return key === "index"
|
|
779
|
+
? ""
|
|
780
|
+
: `export const ${component}Props = ${JSON.stringify(propTypes)};`;
|
|
781
|
+
})
|
|
782
|
+
.join("\n");
|
|
783
|
+
default:
|
|
784
|
+
return `import { ${component} as ${component}Component } from "@optiaxiom/react";
|
|
785
|
+
|
|
786
|
+
import { components } from "../mapping";
|
|
787
|
+
import { ${component}Props } from "../propTypes";
|
|
788
|
+
import { register } from "../register";
|
|
789
|
+
|
|
790
|
+
export const ${component} = "ax${toKebabCase(component)}";
|
|
791
|
+
export default register(
|
|
792
|
+
${component},
|
|
793
|
+
${component}Component,
|
|
794
|
+
${component}Props,
|
|
795
|
+
components,
|
|
796
|
+
);`;
|
|
797
|
+
}
|
|
798
|
+
},
|
|
799
|
+
name: "rolldown-plugin-web-component",
|
|
800
|
+
async resolveId(id, importer, options) {
|
|
801
|
+
if (filter(path.resolve(id))) {
|
|
802
|
+
return prefix + path.resolve(id);
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
if (importer?.startsWith(prefix)) {
|
|
806
|
+
const resolved = path.resolve(
|
|
807
|
+
path.dirname(importer.slice(prefix.length)),
|
|
808
|
+
id,
|
|
809
|
+
);
|
|
810
|
+
if (filter(resolved)) {
|
|
811
|
+
return prefix + resolved;
|
|
812
|
+
}
|
|
813
|
+
return await this.resolve(id, importer.slice(prefix.length), options);
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
return null;
|
|
817
|
+
},
|
|
818
|
+
};
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
/**
|
|
822
|
+
* @param {import('react-docgen-typescript').PropItemType} type
|
|
823
|
+
*/
|
|
824
|
+
const getPropType = (type) => {
|
|
825
|
+
if (type.name === "number") {
|
|
826
|
+
return "number";
|
|
827
|
+
} else if (type.name === "string") {
|
|
828
|
+
return "string";
|
|
829
|
+
} else if (
|
|
830
|
+
type.name === "enum" &&
|
|
831
|
+
(type.raw === "boolean" || type.raw === "Booleanish")
|
|
832
|
+
) {
|
|
833
|
+
return "boolean";
|
|
834
|
+
} else if (type.raw === "ReactNode") {
|
|
835
|
+
return "object";
|
|
836
|
+
} else if (
|
|
837
|
+
type.name === "enum" &&
|
|
838
|
+
type.value.find(
|
|
839
|
+
({ value }) =>
|
|
840
|
+
value.startsWith("ResponsiveArray<") || value.startsWith("{ "),
|
|
841
|
+
)
|
|
842
|
+
) {
|
|
843
|
+
return "object";
|
|
844
|
+
} else if (
|
|
845
|
+
type.name === "enum" &&
|
|
846
|
+
Array.isArray(type.value) &&
|
|
847
|
+
(type.value.find(
|
|
848
|
+
(item) => item.value === "string" || item.value === "string & {}",
|
|
849
|
+
) ||
|
|
850
|
+
type.value.every(
|
|
851
|
+
(item) =>
|
|
852
|
+
(item.value.startsWith('"') && item.value.endsWith('"')) ||
|
|
853
|
+
["false", "true"].includes(item.value) ||
|
|
854
|
+
item.value.endsWith("[]"),
|
|
855
|
+
))
|
|
856
|
+
) {
|
|
857
|
+
return "string";
|
|
858
|
+
} else if (
|
|
859
|
+
type.name === "enum" &&
|
|
860
|
+
Array.isArray(type.value) &&
|
|
861
|
+
type.value.every((item) => item.value === parseInt(item.value).toString())
|
|
862
|
+
) {
|
|
863
|
+
return "number";
|
|
864
|
+
} else if (type.name.startsWith('"') && type.name.endsWith('"')) {
|
|
865
|
+
return "string";
|
|
866
|
+
}
|
|
867
|
+
};
|
|
868
|
+
|
|
869
|
+
const toKebabCase = (str) =>
|
|
870
|
+
str.replace(/[A-Z]/g, (m) => "-" + m.toLowerCase());
|