@atom-learning/components 6.16.0-beta.2 → 6.16.0-beta.3
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/dist/components/accordion/Accordion.js.map +1 -1
- package/dist/components/accordion/AccordionContent.js.map +1 -1
- package/dist/components/accordion/AccordionItem.js.map +1 -1
- package/dist/components/accordion/AccordionTrigger.js.map +1 -1
- package/dist/components/action-icon/ActionIcon.constants.js.map +1 -1
- package/dist/components/action-icon/ActionIcon.js.map +1 -1
- package/dist/components/alert-dialog/AlertDialog.js.map +1 -1
- package/dist/components/alert-dialog/AlertDialogContent.js.map +1 -1
- package/dist/components/alert-dialog/alert-context/AlertContext.js.map +1 -1
- package/dist/components/alert-dialog/alert-context/AlertDialog.js.map +1 -1
- package/dist/components/alert-dialog/alert-context/AlertDialogIcon.js.map +1 -1
- package/dist/components/alert-dialog/alert-context/reducer.js.map +1 -1
- package/dist/components/avatar/Avatar.js.map +1 -1
- package/dist/components/avatar/AvatarContext.js.map +1 -1
- package/dist/components/avatar/AvatarIcon.js.map +1 -1
- package/dist/components/avatar/AvatarImage.js.map +1 -1
- package/dist/components/avatar/AvatarInitial.js.map +1 -1
- package/dist/components/avatar/AvatarPlaceholder.js.map +1 -1
- package/dist/components/badge/Badge.colorscheme.config.js.map +1 -1
- package/dist/components/badge/Badge.context.js.map +1 -1
- package/dist/components/badge/Badge.js.map +1 -1
- package/dist/components/badge/BadgeIcon.js.map +1 -1
- package/dist/components/badge/BadgeText.js.map +1 -1
- package/dist/components/banner/Banner.js.map +1 -1
- package/dist/components/banner/BannerContainer.js.map +1 -1
- package/dist/components/banner/BannerContext.js.map +1 -1
- package/dist/components/banner/banner-regular/BannerRegular.js.map +1 -1
- package/dist/components/banner/banner-regular/BannerRegularActions.js.map +1 -1
- package/dist/components/banner/banner-regular/BannerRegularButton.js.map +1 -1
- package/dist/components/banner/banner-regular/BannerRegularContainer.js.map +1 -1
- package/dist/components/banner/banner-regular/BannerRegularContent.js.map +1 -1
- package/dist/components/banner/banner-regular/BannerRegularDismiss.js.map +1 -1
- package/dist/components/banner/banner-regular/BannerRegularHeading.js.map +1 -1
- package/dist/components/banner/banner-regular/BannerRegularImage.js.map +1 -1
- package/dist/components/banner/banner-regular/BannerRegularText.js.map +1 -1
- package/dist/components/banner/banner-slim/BannerSlim.js.map +1 -1
- package/dist/components/banner/banner-slim/BannerSlimActions.js.map +1 -1
- package/dist/components/banner/banner-slim/BannerSlimButton.js.map +1 -1
- package/dist/components/banner/banner-slim/BannerSlimContainer.js.map +1 -1
- package/dist/components/banner/banner-slim/BannerSlimContent.js.map +1 -1
- package/dist/components/banner/banner-slim/BannerSlimDismiss.js.map +1 -1
- package/dist/components/banner/banner-slim/BannerSlimImage.js.map +1 -1
- package/dist/components/banner/banner-slim/BannerSlimText.js.map +1 -1
- package/dist/components/box/Box.js.map +1 -1
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/calendar/Calendar.js.map +1 -1
- package/dist/components/calendar/Day.js.map +1 -1
- package/dist/components/calendar/constants.js.map +1 -1
- package/dist/components/carousel/Carousel.js.map +1 -1
- package/dist/components/carousel/CarouselArrows.js.map +1 -1
- package/dist/components/carousel/CarouselPagination.js.map +1 -1
- package/dist/components/carousel/CarouselSlide.js.map +1 -1
- package/dist/components/carousel/CarouselSlider.js.map +1 -1
- package/dist/components/checkbox/Checkbox.js.map +1 -1
- package/dist/components/checkbox-field/CheckboxField.js +1 -6
- package/dist/components/checkbox-field/CheckboxField.js.map +1 -1
- package/dist/components/checkbox-group/CheckboxGroup.js.map +1 -1
- package/dist/components/checkbox-group/CheckboxGroupAllItem.js.map +1 -1
- package/dist/components/checkbox-group/CheckboxGroupItem.js.map +1 -1
- package/dist/components/checkbox-group/CheckboxGroupSub.js.map +1 -1
- package/dist/components/checkbox-group/context/CheckboxGroupChecked.context.js.map +1 -1
- package/dist/components/checkbox-group/context/CheckboxGroupMounted.context.js.map +1 -1
- package/dist/components/checkbox-tree/CheckboxTree.js.map +1 -1
- package/dist/components/checkbox-tree/CheckboxTreeCollapsible.js.map +1 -1
- package/dist/components/checkbox-tree/CheckboxTreeCollapsibleContent.js.map +1 -1
- package/dist/components/checkbox-tree/CheckboxTreeCollapsibleTrigger.js.map +1 -1
- package/dist/components/checkbox-tree/CheckboxTreeItem.js.map +1 -1
- package/dist/components/checkbox-tree/CheckboxTreeItemContent.js.map +1 -1
- package/dist/components/chip/Chip.js.map +1 -1
- package/dist/components/chip/ChipGroup.js.map +1 -1
- package/dist/components/chip-dismissible-group/ChipDismissibleGroupItem.js.map +1 -1
- package/dist/components/chip-dismissible-group/ChipDismissibleGroupRoot.js.map +1 -1
- package/dist/components/chip-toggle-group/ChipToggleGroupItem.js.map +1 -1
- package/dist/components/chip-toggle-group/ChipToggleGroupRoot.js.map +1 -1
- package/dist/components/combobox/Combobox.js.map +1 -1
- package/dist/components/combobox/ComboboxInput.js.map +1 -1
- package/dist/components/combobox/ComboboxList.js.map +1 -1
- package/dist/components/combobox/ComboboxOption.js.map +1 -1
- package/dist/components/combobox/ComboboxPopover.js.map +1 -1
- package/dist/components/create-password-field/CreatePasswordField.js.map +1 -1
- package/dist/components/data-table/DataTable.js +88 -0
- package/dist/components/data-table/DataTable.js.map +1 -1
- package/dist/components/data-table/DataTable.types.js.map +1 -1
- package/dist/components/data-table/DataTableBody.js.map +1 -1
- package/dist/components/data-table/DataTableBulkActions.js.map +1 -1
- package/dist/components/data-table/DataTableBulkActionsFloating.js.map +1 -1
- package/dist/components/data-table/DataTableBulkActionsSelectedRowActions.js.map +1 -1
- package/dist/components/data-table/DataTableContext.js.map +1 -1
- package/dist/components/data-table/DataTableDataCell.js.map +1 -1
- package/dist/components/data-table/DataTableEmptyState.js.map +1 -1
- package/dist/components/data-table/DataTableError.js.map +1 -1
- package/dist/components/data-table/DataTableGlobalFilter.js.map +1 -1
- package/dist/components/data-table/DataTableHead.js.map +1 -1
- package/dist/components/data-table/DataTableHeaderCell.js.map +1 -1
- package/dist/components/data-table/DataTableLoading.js.map +1 -1
- package/dist/components/data-table/DataTableMetaData.js.map +1 -1
- package/dist/components/data-table/DataTableRow.js.map +1 -1
- package/dist/components/data-table/DataTableRowSelectionCheckbox.js.map +1 -1
- package/dist/components/data-table/DataTableSelectAllRowsCheckbox.js.map +1 -1
- package/dist/components/data-table/DataTableTable.js.map +1 -1
- package/dist/components/data-table/drag-and-drop/DragAndDropTable.js.map +1 -1
- package/dist/components/data-table/drag-and-drop/DragAndDropTableBody.js.map +1 -1
- package/dist/components/data-table/drag-and-drop/DragAndDropTableRow.js.map +1 -1
- package/dist/components/data-table/getNewAsyncData.js.map +1 -1
- package/dist/components/data-table/pagination/Pagination.js.map +1 -1
- package/dist/components/data-table/usePagination.js.map +1 -1
- package/dist/components/data-table/useSorting.js.map +1 -1
- package/dist/components/date-field/DateField.js.map +1 -1
- package/dist/components/date-input/DateInput.js.map +1 -1
- package/dist/components/dialog/Dialog.js.map +1 -1
- package/dist/components/dialog/DialogActionBar.js.map +1 -1
- package/dist/components/dialog/DialogBackground.js.map +1 -1
- package/dist/components/dialog/DialogContent.js.map +1 -1
- package/dist/components/dialog/DialogFooter.js.map +1 -1
- package/dist/components/dialog/DialogHeading.js.map +1 -1
- package/dist/components/dialog/DialogNavigationBar.js.map +1 -1
- package/dist/components/dialog/DialogScrollableContent.js.map +1 -1
- package/dist/components/dismissible/DismissibleRoot.js.map +1 -1
- package/dist/components/dismissible/DismissibleTrigger.js.map +1 -1
- package/dist/components/dismissible/index.js.map +1 -1
- package/dist/components/dismissible-group/DismissibleGroupItem.js.map +1 -1
- package/dist/components/dismissible-group/DismissibleGroupRoot.js.map +1 -1
- package/dist/components/dismissible-group/index.js.map +1 -1
- package/dist/components/divider/Divider.js.map +1 -1
- package/dist/components/drawer/Drawer.context.js.map +1 -1
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/drawer/DrawerClose.js.map +1 -1
- package/dist/components/drawer/DrawerContent.js.map +1 -1
- package/dist/components/drawer/DrawerFooter.js.map +1 -1
- package/dist/components/drawer/DrawerHeader.js.map +1 -1
- package/dist/components/drawer/DrawerMain.js.map +1 -1
- package/dist/components/drawer/DrawerOverlay.js.map +1 -1
- package/dist/components/dropdown-menu/DropdownMenu.js.map +1 -1
- package/dist/components/dropdown-menu/DropdownMenuContent.js.map +1 -1
- package/dist/components/dropdown-menu/DropdownMenuItem.js.map +1 -1
- package/dist/components/dropdown-menu/DropdownMenuLinkItem.js.map +1 -1
- package/dist/components/dropdown-menu/DropdownMenuSeparator.js.map +1 -1
- package/dist/components/dropdown-menu/DropdownMenuTrigger.js.map +1 -1
- package/dist/components/empty-state/EmptyState.context.js.map +1 -1
- package/dist/components/empty-state/EmptyState.js.map +1 -1
- package/dist/components/empty-state/EmptyStateBody.js.map +1 -1
- package/dist/components/empty-state/EmptyStateImage.js.map +1 -1
- package/dist/components/empty-state/EmptyStateTitle.js.map +1 -1
- package/dist/components/field-wrapper/FieldDescription.js.map +1 -1
- package/dist/components/field-wrapper/FieldWrapper.js.map +1 -1
- package/dist/components/field-wrapper/InlineFieldWrapper.js.map +1 -1
- package/dist/components/file-drop/FileDrop.js.map +1 -1
- package/dist/components/file-drop/FileDropContext.js.map +1 -1
- package/dist/components/file-drop/useFileDrop.js.map +1 -1
- package/dist/components/file-input/FileInput.js.map +1 -1
- package/dist/components/flex/Flex.js.map +1 -1
- package/dist/components/form/Form.js.map +1 -1
- package/dist/components/form/useFieldError.js.map +1 -1
- package/dist/components/form/useFormCustomContext.js.map +1 -1
- package/dist/components/grid/Grid.js.map +1 -1
- package/dist/components/heading/Heading.js.map +1 -1
- package/dist/components/icon/Icon.js.map +1 -1
- package/dist/components/image/Image.js.map +1 -1
- package/dist/components/inline-message/InlineMessage.config.js.map +1 -1
- package/dist/components/inline-message/InlineMessage.js.map +1 -1
- package/dist/components/input/Input.js.map +1 -1
- package/dist/components/input-field/InputField.js.map +1 -1
- package/dist/components/keyboard-shortcut/KeyboardShortcut.js.map +1 -1
- package/dist/components/keyboard-shortcut/index.js.map +1 -1
- package/dist/components/label/Label.js.map +1 -1
- package/dist/components/link/Link.js.map +1 -1
- package/dist/components/list/List.js.map +1 -1
- package/dist/components/loader/Loader.js.map +1 -1
- package/dist/components/markdown-content/MarkdownContent.js.map +1 -1
- package/dist/components/markdown-content/components/MarkdownCode.js.map +1 -1
- package/dist/components/markdown-content/components/MarkdownEmphasis.js.map +1 -1
- package/dist/components/markdown-content/components/MarkdownHeading.js.map +1 -1
- package/dist/components/markdown-content/components/MarkdownImage.js.map +1 -1
- package/dist/components/markdown-content/components/MarkdownInlineCode.js.map +1 -1
- package/dist/components/markdown-content/components/MarkdownLink.js.map +1 -1
- package/dist/components/markdown-content/components/MarkdownList.js.map +1 -1
- package/dist/components/markdown-content/components/MarkdownListItem.js.map +1 -1
- package/dist/components/markdown-content/components/MarkdownParagraph.js.map +1 -1
- package/dist/components/markdown-content/components/MarkdownStrong.js.map +1 -1
- package/dist/components/markdown-content/components/MarkdownThematicBreak.js.map +1 -1
- package/dist/components/navigation/NavigationMenu.colorscheme.config.js.map +1 -1
- package/dist/components/navigation/NavigationMenu.d.ts +2 -0
- package/dist/components/navigation/NavigationMenu.js.map +1 -1
- package/dist/components/navigation/NavigationMenu.styles.js.map +1 -1
- package/dist/components/navigation/NavigationMenuContext.js.map +1 -1
- package/dist/components/navigation/NavigationMenuDropdown.js.map +1 -1
- package/dist/components/navigation/NavigationMenuDropdownContent.js.map +1 -1
- package/dist/components/navigation/NavigationMenuDropdownItem.d.ts +1 -0
- package/dist/components/navigation/NavigationMenuDropdownItem.js.map +1 -1
- package/dist/components/navigation/NavigationMenuDropdownTrigger.js.map +1 -1
- package/dist/components/navigation/NavigationMenuLink.d.ts +1 -0
- package/dist/components/navigation/NavigationMenuLink.js +22 -11
- package/dist/components/navigation/NavigationMenuLink.js.map +1 -1
- package/dist/components/navigation-menu-vertical/NavigationMenuVertical.colorscheme.config.js.map +1 -1
- package/dist/components/navigation-menu-vertical/NavigationMenuVertical.js.map +1 -1
- package/dist/components/navigation-menu-vertical/NavigationMenuVertical.styles.js.map +1 -1
- package/dist/components/navigation-menu-vertical/NavigationMenuVerticalAccordion.js.map +1 -1
- package/dist/components/navigation-menu-vertical/NavigationMenuVerticalAccordionContent.js.map +1 -1
- package/dist/components/navigation-menu-vertical/NavigationMenuVerticalAccordionTrigger.js.map +1 -1
- package/dist/components/navigation-menu-vertical/NavigationMenuVerticalIcon.js.map +1 -1
- package/dist/components/navigation-menu-vertical/NavigationMenuVerticalItem.js.map +1 -1
- package/dist/components/navigation-menu-vertical/NavigationMenuVerticalItemContent.js.map +1 -1
- package/dist/components/navigation-menu-vertical/NavigationMenuVerticalLink.js.map +1 -1
- package/dist/components/navigation-menu-vertical/NavigationMenuVerticalList.js.map +1 -1
- package/dist/components/navigation-menu-vertical/NavigationMenuVerticalText.js.map +1 -1
- package/dist/components/notification-badge/NotificationBadge.js.map +1 -1
- package/dist/components/number-input/NumberInput.js.map +1 -1
- package/dist/components/number-input/NumberInputStepper.js.map +1 -1
- package/dist/components/number-input-field/NumberInputField.js.map +1 -1
- package/dist/components/pagination/Pagination.js.map +1 -1
- package/dist/components/pagination/PaginationItems.js.map +1 -1
- package/dist/components/pagination/PaginationNextButton.js.map +1 -1
- package/dist/components/pagination/PaginationPage.js.map +1 -1
- package/dist/components/pagination/PaginationPopover.js.map +1 -1
- package/dist/components/pagination/PaginationPreviousButton.js.map +1 -1
- package/dist/components/pagination/pagination-context/PaginationContext.js.map +1 -1
- package/dist/components/pagination/pagination.constants.js.map +1 -1
- package/dist/components/pagination/pagination.helper.js.map +1 -1
- package/dist/components/pagination/usePagination.js.map +1 -1
- package/dist/components/password-field/PasswordField.js.map +1 -1
- package/dist/components/password-input/PasswordInput.js.map +1 -1
- package/dist/components/popover/Popover.js.map +1 -1
- package/dist/components/popover/PopoverContent.js.map +1 -1
- package/dist/components/progress-bar/ProgressBar.js.map +1 -1
- package/dist/components/radio-button/RadioButton.js.map +1 -1
- package/dist/components/radio-button/RadioButtonGroup.js.map +1 -1
- package/dist/components/radio-button-field/RadioButtonField.js.map +1 -1
- package/dist/components/radio-button-field/RadioField.js.map +1 -1
- package/dist/components/radio-card/RadioCard.js.map +1 -1
- package/dist/components/radio-card/RadioCardGroup.js.map +1 -1
- package/dist/components/router-provider/RouterProvider.js.map +1 -1
- package/dist/components/search-field/SearchField.js.map +1 -1
- package/dist/components/search-input/SearchInput.js +4 -9
- package/dist/components/search-input/SearchInput.js.map +1 -1
- package/dist/components/section-message/SectionMessage.js.map +1 -1
- package/dist/components/section-message/SectionMessageContext.js.map +1 -1
- package/dist/components/section-message/SectionMessageDescription.js.map +1 -1
- package/dist/components/section-message/SectionMessageDismiss.js.map +1 -1
- package/dist/components/section-message/SectionMessageIcon.js.map +1 -1
- package/dist/components/section-message/SectionMessageLayout.js.map +1 -1
- package/dist/components/section-message/SectionMessageTitle.js.map +1 -1
- package/dist/components/segmented-control/SegmentedControl.js.map +1 -1
- package/dist/components/segmented-control/SegmentedControlBadge.js.map +1 -1
- package/dist/components/segmented-control/SegmentedControlContext.js.map +1 -1
- package/dist/components/segmented-control/SegmentedControlDescription.js.map +1 -1
- package/dist/components/segmented-control/SegmentedControlHeading.js.map +1 -1
- package/dist/components/segmented-control/SegmentedControlIcon.js.map +1 -1
- package/dist/components/segmented-control/SegmentedControlItem.js.map +1 -1
- package/dist/components/segmented-control/SegmentedControlItemList.js.map +1 -1
- package/dist/components/segmented-control/SegmentedControlRoot.js.map +1 -1
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/select-field/SelectField.js.map +1 -1
- package/dist/components/side-bar/SideBar.js.map +1 -1
- package/dist/components/side-bar/SideBarComponents.js.map +1 -1
- package/dist/components/side-bar/SideBarContext.js.map +1 -1
- package/dist/components/skeleton-loader/Skeleton.js.map +1 -1
- package/dist/components/skeleton-loader/SkeletonBarChart.js.map +1 -1
- package/dist/components/skeleton-loader/SkeletonButton.js.map +1 -1
- package/dist/components/skeleton-loader/SkeletonCard.js.map +1 -1
- package/dist/components/skeleton-loader/SkeletonColumnChart.js.map +1 -1
- package/dist/components/skeleton-loader/SkeletonDoughnutChart.js.map +1 -1
- package/dist/components/skeleton-loader/SkeletonHeading.js.map +1 -1
- package/dist/components/skeleton-loader/SkeletonPanelList.js.map +1 -1
- package/dist/components/skeleton-loader/SkeletonSubjectList.js.map +1 -1
- package/dist/components/skeleton-loader/SkeletonTable.js.map +1 -1
- package/dist/components/skeleton-loader/SkeletonTabs.js.map +1 -1
- package/dist/components/slider/Slider.js.map +1 -1
- package/dist/components/slider/SliderSteps.js.map +1 -1
- package/dist/components/slider/SliderValue.js.map +1 -1
- package/dist/components/slider-field/SliderField.js.map +1 -1
- package/dist/components/sortable/Handle.js.map +1 -1
- package/dist/components/sortable/SortableHandle.js.map +1 -1
- package/dist/components/sortable/SortableItem.js.map +1 -1
- package/dist/components/sortable/SortableRoot.js.map +1 -1
- package/dist/components/spacer/Spacer.js.map +1 -1
- package/dist/components/stepper/Stepper.js.map +1 -1
- package/dist/components/stepper/StepperStepBack.js.map +1 -1
- package/dist/components/stepper/StepperStepBullet.js.map +1 -1
- package/dist/components/stepper/StepperStepContainer.js.map +1 -1
- package/dist/components/stepper/StepperStepForward.js.map +1 -1
- package/dist/components/stepper/StepperStepLabel.js.map +1 -1
- package/dist/components/stepper/StepperSteps.js.map +1 -1
- package/dist/components/stepper/stepper-context/StepperContext.js.map +1 -1
- package/dist/components/stepper/types.js.map +1 -1
- package/dist/components/switch/Switch.js.map +1 -1
- package/dist/components/table/Table.js.map +1 -1
- package/dist/components/table/TableBody.js.map +1 -1
- package/dist/components/table/TableCell.js.map +1 -1
- package/dist/components/table/TableFooter.js.map +1 -1
- package/dist/components/table/TableFooterCell.js.map +1 -1
- package/dist/components/table/TableHeader.js.map +1 -1
- package/dist/components/table/TableHeaderCell.js.map +1 -1
- package/dist/components/table/TableRow.js.map +1 -1
- package/dist/components/table/TableStickyColumnsContainer.js.map +1 -1
- package/dist/components/table/useStickyColumnsCss.js.map +1 -1
- package/dist/components/tabs/Tabs.js.map +1 -1
- package/dist/components/tabs/TabsContent.js.map +1 -1
- package/dist/components/tabs/TabsTrigger.js.map +1 -1
- package/dist/components/tabs/TabsTriggerList.js.map +1 -1
- package/dist/components/text/Text.js.map +1 -1
- package/dist/components/textarea/Textarea.js.map +1 -1
- package/dist/components/textarea-field/TextareaField.js.map +1 -1
- package/dist/components/tile/Tile.js.map +1 -1
- package/dist/components/tile-interactive/TileInteractive.js.map +1 -1
- package/dist/components/tile-toggle-group/TileToggleGroupItem.js.map +1 -1
- package/dist/components/tile-toggle-group/TileToggleGroupRoot.js.map +1 -1
- package/dist/components/toast/Toast.js.map +1 -1
- package/dist/components/toast/ToastCloseButton.js.map +1 -1
- package/dist/components/toast/ToastContext.js.map +1 -1
- package/dist/components/toast/ToastIcon.js.map +1 -1
- package/dist/components/toast/ToastProvider.js.map +1 -1
- package/dist/components/toggle-group/ToggleGroupButton.js.map +1 -1
- package/dist/components/toggle-group/ToggleGroupItem.js.map +1 -1
- package/dist/components/toggle-group/ToggleGroupRoot.js.map +1 -1
- package/dist/components/toggle-group/index.js.map +1 -1
- package/dist/components/tooltip/Tooltip.js.map +1 -1
- package/dist/components/tooltip/TooltipContent.js.map +1 -1
- package/dist/components/top-bar/TopBar.colorscheme.config.js.map +1 -1
- package/dist/components/top-bar/TopBar.js.map +1 -1
- package/dist/components/top-bar/TopBarActionIcon.js.map +1 -1
- package/dist/components/top-bar/TopBarBrand.js.map +1 -1
- package/dist/components/tree/Tree.js.map +1 -1
- package/dist/components/tree/TreeCollapsible.js.map +1 -1
- package/dist/components/tree/TreeCollapsibleContent.js.map +1 -1
- package/dist/components/tree/TreeCollapsibleTrigger.js.map +1 -1
- package/dist/components/tree/TreeIcon.js.map +1 -1
- package/dist/components/tree/TreeItem.js.map +1 -1
- package/dist/components/tree/TreeItemContent.js.map +1 -1
- package/dist/components/tree/TreeList.js.map +1 -1
- package/dist/components/tree/TreeListItem.js.map +1 -1
- package/dist/components/tree/TreeText.js.map +1 -1
- package/dist/components/video/Video.js.map +1 -1
- package/dist/docgen.json +1 -1
- package/dist/experiments/color-scheme/ColorScheme.config.js.map +1 -1
- package/dist/experiments/color-scheme/ColorScheme.js.map +1 -1
- package/dist/index.cjs.js +133 -46
- package/dist/index.cjs.js.map +1 -1
- package/dist/styled.js +1 -2
- package/dist/styled.js.map +1 -1
- package/dist/utilities/css-wrapper/CSSWrapper.js.map +1 -1
- package/dist/utilities/event/preventEvent.js.map +1 -1
- package/dist/utilities/hooks/useCallbackRef.js.map +1 -1
- package/dist/utilities/hooks/useIsMountedRef.js.map +1 -1
- package/dist/utilities/hooks/useResizeObserver.js.map +1 -1
- package/dist/utilities/hooks/useScrollPosition.js.map +1 -1
- package/dist/utilities/hooks/useSize.js.map +1 -1
- package/dist/utilities/hooks/useWindowScrollPosition.js.map +1 -1
- package/dist/utilities/optional-tooltip-wrapper/OptionalTooltipWrapper.js.map +1 -1
- package/dist/utilities/override-styled-variant-value/overrideStyledVariantValue.js.map +1 -1
- package/dist/utilities/radix-overrides/toggle-group/ToggleGroupRoot.js.map +1 -1
- package/dist/utilities/radix-overrides/toggle-group/index.js.map +1 -1
- package/dist/utilities/style/backdrop-overlay.js.map +1 -1
- package/dist/utilities/style/get-icon-size.js.map +1 -1
- package/dist/utilities/uri/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownStrong.js","names":[],"sources":["../../../../src/components/markdown-content/components/MarkdownStrong.tsx"],"sourcesContent":["import type { Content, Strong } from 'mdast'\nimport * as React from 'react'\n\nimport { styled } from '~/styled'\n\ntype MarkdownStrongProps = {\n node: Strong\n handleNode: (node: Content) => React.ReactElement\n}\n\nconst StyledMarkdownStrong = styled('strong', {\n base: ['font-semibold']\n})\n\nexport const MarkdownStrong = ({ node, handleNode }: MarkdownStrongProps) => (\n <StyledMarkdownStrong>{node.children?.map(handleNode)}</StyledMarkdownStrong>\n)\n"],"mappings":";;;AAUA,IAAM,uBAAuB,OAAO,UAAU,EAC5C,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"MarkdownStrong.js","names":[],"sources":["../../../../src/components/markdown-content/components/MarkdownStrong.tsx"],"sourcesContent":["import type { Content, Strong } from 'mdast'\nimport * as React from 'react'\n\nimport { styled } from '~/styled'\n\ntype MarkdownStrongProps = {\n node: Strong\n handleNode: (node: Content) => React.ReactElement\n}\n\nconst StyledMarkdownStrong = styled('strong', {\n base: ['font-semibold']\n})\n\nexport const MarkdownStrong = ({ node, handleNode }: MarkdownStrongProps) => (\n <StyledMarkdownStrong>{node.children?.map(handleNode)}</StyledMarkdownStrong>\n)\n"],"mappings":";;;AAUA,IAAM,uBAAuB,OAAO,UAAU,EAC5C,MAAM,CAAC,eAAe,EACxB,CAAC;AAED,IAAa,kBAAkB,EAAE,MAAM,iBACrC,wBAAA,cAAC,sBAAA,MAAsB,KAAK,UAAU,IAAI,UAAU,CAAwB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownThematicBreak.js","names":[],"sources":["../../../../src/components/markdown-content/components/MarkdownThematicBreak.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { cn } from '~/styled'\n\nimport { Divider } from '../../divider/Divider'\n\ntype MarkdownThematicBreakProps = {\n className?: string\n}\n\nexport const MarkdownThematicBreak = ({\n className\n}: MarkdownThematicBreakProps) => (\n <Divider className={cn('w-full', className)} />\n)\n"],"mappings":";;;;AAUA,IAAa,yBAAyB,EACpC,gBAEA,wBAAA,cAAC,SAAD,EAAS,WAAW,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"MarkdownThematicBreak.js","names":[],"sources":["../../../../src/components/markdown-content/components/MarkdownThematicBreak.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { cn } from '~/styled'\n\nimport { Divider } from '../../divider/Divider'\n\ntype MarkdownThematicBreakProps = {\n className?: string\n}\n\nexport const MarkdownThematicBreak = ({\n className\n}: MarkdownThematicBreakProps) => (\n <Divider className={cn('w-full', className)} />\n)\n"],"mappings":";;;;AAUA,IAAa,yBAAyB,EACpC,gBAEA,wBAAA,cAAC,SAAD,EAAS,WAAW,GAAG,UAAU,SAAS,EAAI,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenu.colorscheme.config.js","names":[],"sources":["../../../src/components/navigation/NavigationMenu.colorscheme.config.ts"],"sourcesContent":["const light = {\n '--text': 'var(--color-text-subtle)',\n '--text-hover': 'var(--color-grey-1000)',\n '--text-active': 'var(--color-grey-1000)',\n '--text-selected': 'var(--color-primary-800)',\n '--text-selected-hover': 'var(--color-primary-800)',\n '--text-selected-pressed': 'var(--color-primary-800)',\n '--text-selected-focus': 'var(--color-primary-800)',\n '--background': 'white',\n '--background-hover': 'var(--color-grey-100)',\n '--background-active': 'var(--color-grey-200)',\n '--background-selected': 'var(--color-primary-100)',\n '--background-selected-hover': 'var(--color-grey-100)',\n '--background-selected-pressed': 'var(--color-grey-200)',\n '--item-text-selected': 'var(--color-grey-900)',\n '--item-background-selected': 'var(--color-grey-900)',\n '--trigger-background-open': 'var(--color-grey-200)',\n '--dropdown-background': 'white'\n}\n\nexport const colorSchemes = {\n light\n}\n"],"mappings":"AAoBA,IAAa,eAAe,EAC1B
|
|
1
|
+
{"version":3,"file":"NavigationMenu.colorscheme.config.js","names":[],"sources":["../../../src/components/navigation/NavigationMenu.colorscheme.config.ts"],"sourcesContent":["const light = {\n '--text': 'var(--color-text-subtle)',\n '--text-hover': 'var(--color-grey-1000)',\n '--text-active': 'var(--color-grey-1000)',\n '--text-selected': 'var(--color-primary-800)',\n '--text-selected-hover': 'var(--color-primary-800)',\n '--text-selected-pressed': 'var(--color-primary-800)',\n '--text-selected-focus': 'var(--color-primary-800)',\n '--background': 'white',\n '--background-hover': 'var(--color-grey-100)',\n '--background-active': 'var(--color-grey-200)',\n '--background-selected': 'var(--color-primary-100)',\n '--background-selected-hover': 'var(--color-grey-100)',\n '--background-selected-pressed': 'var(--color-grey-200)',\n '--item-text-selected': 'var(--color-grey-900)',\n '--item-background-selected': 'var(--color-grey-900)',\n '--trigger-background-open': 'var(--color-grey-200)',\n '--dropdown-background': 'white'\n}\n\nexport const colorSchemes = {\n light\n}\n"],"mappings":"AAoBA,IAAa,eAAe,EAC1B;CApBA,UAAU;CACV,gBAAgB;CAChB,iBAAiB;CACjB,mBAAmB;CACnB,yBAAyB;CACzB,2BAA2B;CAC3B,yBAAyB;CACzB,gBAAgB;CAChB,sBAAsB;CACtB,uBAAuB;CACvB,yBAAyB;CACzB,+BAA+B;CAC/B,iCAAiC;CACjC,wBAAwB;CACxB,8BAA8B;CAC9B,6BAA6B;CAC7B,yBAAyB;AAIzB,EACF"}
|
|
@@ -18,6 +18,7 @@ export declare const NavigationMenu: {
|
|
|
18
18
|
} & {
|
|
19
19
|
as?: React.ElementType;
|
|
20
20
|
}>>["elementType"];
|
|
21
|
+
reloadDocument?: boolean;
|
|
21
22
|
}, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
22
23
|
Dropdown: {
|
|
23
24
|
({ children, id, ...props }: {
|
|
@@ -44,6 +45,7 @@ export declare const NavigationMenu: {
|
|
|
44
45
|
} & {
|
|
45
46
|
as?: React.ElementType;
|
|
46
47
|
}>>["elementType"];
|
|
48
|
+
reloadDocument?: boolean;
|
|
47
49
|
}, "ref"> & React.RefAttributes<HTMLAnchorElement>>, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
48
50
|
DropdownItemTitle: React.ForwardRefExoticComponent<Omit<Omit<Omit<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & {
|
|
49
51
|
ref?: ((instance: HTMLParagraphElement | null) => void) | React.RefObject<HTMLParagraphElement> | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenu.js","names":[],"sources":["../../../src/components/navigation/NavigationMenu.tsx"],"sourcesContent":["import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu'\nimport React from 'react'\n\nimport { styled } from '~/styled'\nimport { cn } from '~/styled'\n\nimport { colorSchemes as navigationMenuColorSchemes } from './NavigationMenu.colorscheme.config'\nimport { NavigationMenuContext } from './NavigationMenuContext'\nimport { NavigationMenuDropdown } from './NavigationMenuDropdown'\nimport { NavigationMenuDropdownContent } from './NavigationMenuDropdownContent'\nimport {\n NavigationMenuDropdownItem,\n NavigationMenuDropdownItemTitle\n} from './NavigationMenuDropdownItem'\nimport { NavigationMenuDropdownTrigger } from './NavigationMenuDropdownTrigger'\nimport { NavigationMenuLink } from './NavigationMenuLink'\n\nconst StyledMenu = styled(NavigationMenuPrimitive.Root, {\n base: ['flex', 'justify-center', 'relative']\n})\n\nconst StyledList = styled(NavigationMenuPrimitive.List, {\n base: ['flex', 'justify-center', 'items-center', 'gap-1', 'list-none']\n})\n\nconst StyledViewport = styled(NavigationMenuPrimitive.Viewport, {\n base: ['z-2147483647']\n})\n\nconst ViewportPosition = styled('div', {\n base: ['absolute', 'left-0', 'top-full', 'w-full', 'flex', 'justify-center']\n})\n\nconst NavigationMenuComponent = ({\n children,\n className,\n ...props\n}: React.ComponentProps<typeof StyledMenu>) => {\n const [offset, setOffset] = React.useState<number | null | undefined>()\n const [activeItem, setActiveItem] = React.useState<string | undefined>()\n const [listWidth, setListWidth] = React.useState(0)\n const listRef = React.useRef<HTMLUListElement>(null)\n\n React.useLayoutEffect(() => {\n if (listRef.current) {\n setListWidth(listRef.current.offsetWidth)\n }\n }, [React.Children.toArray(children).length])\n\n React.useEffect(() => {\n let timer: ReturnType<typeof setTimeout>\n\n // Delay transitioning back to initial position\n // to allow enough time for fadeOut animation to complete\n if (activeItem === '') {\n timer = setTimeout(() => setOffset(null), 200)\n }\n\n return () => {\n if (timer !== null) {\n clearTimeout(timer)\n }\n }\n }, [activeItem])\n\n // https://github.com/radix-ui/primitives/issues/1462\n const onNodeUpdate = (trigger: HTMLButtonElement, itemValue: string) => {\n if (trigger && listWidth && activeItem === itemValue) {\n const listCenter = listWidth / 2\n\n const triggerOffsetRight =\n listWidth -\n trigger.offsetLeft -\n trigger.offsetWidth +\n trigger.offsetWidth / 2\n\n setOffset(Math.round(listCenter - triggerOffsetRight))\n }\n\n return trigger\n }\n\n return (\n <NavigationMenuContext.Provider value={{ onNodeUpdate }}>\n <StyledMenu\n className={cn(className)}\n style={navigationMenuColorSchemes['light']}\n onValueChange={setActiveItem}\n {...props}\n >\n <StyledList ref={listRef}>{children}</StyledList>\n <ViewportPosition>\n <StyledViewport\n style={{ '--navigation-menu-viewport-offset': `${offset || 0}px` }}\n className={cn([\n 'data-[state=open]:animate-fade-in',\n 'data-[state=closed]:animate-fade-out',\n 'translate-x-(--navigation-menu-viewport-offset)'\n ])}\n />\n </ViewportPosition>\n </StyledMenu>\n </NavigationMenuContext.Provider>\n )\n}\n\nexport const NavigationMenu = Object.assign(NavigationMenuComponent, {\n Link: NavigationMenuLink,\n Dropdown: NavigationMenuDropdown,\n DropdownContent: NavigationMenuDropdownContent,\n DropdownItem: NavigationMenuDropdownItem,\n DropdownItemTitle: NavigationMenuDropdownItemTitle,\n DropdownTrigger: NavigationMenuDropdownTrigger\n})\n\nNavigationMenuComponent.displayName = 'NavigationMenu'\n"],"mappings":";;;;;;;;;;;AAiBA,IAAM,aAAa,OAAO,wBAAwB,MAAM,EACtD,MAAM;CAAC;CAAQ;CAAkB;
|
|
1
|
+
{"version":3,"file":"NavigationMenu.js","names":[],"sources":["../../../src/components/navigation/NavigationMenu.tsx"],"sourcesContent":["import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu'\nimport React from 'react'\n\nimport { styled } from '~/styled'\nimport { cn } from '~/styled'\n\nimport { colorSchemes as navigationMenuColorSchemes } from './NavigationMenu.colorscheme.config'\nimport { NavigationMenuContext } from './NavigationMenuContext'\nimport { NavigationMenuDropdown } from './NavigationMenuDropdown'\nimport { NavigationMenuDropdownContent } from './NavigationMenuDropdownContent'\nimport {\n NavigationMenuDropdownItem,\n NavigationMenuDropdownItemTitle\n} from './NavigationMenuDropdownItem'\nimport { NavigationMenuDropdownTrigger } from './NavigationMenuDropdownTrigger'\nimport { NavigationMenuLink } from './NavigationMenuLink'\n\nconst StyledMenu = styled(NavigationMenuPrimitive.Root, {\n base: ['flex', 'justify-center', 'relative']\n})\n\nconst StyledList = styled(NavigationMenuPrimitive.List, {\n base: ['flex', 'justify-center', 'items-center', 'gap-1', 'list-none']\n})\n\nconst StyledViewport = styled(NavigationMenuPrimitive.Viewport, {\n base: ['z-2147483647']\n})\n\nconst ViewportPosition = styled('div', {\n base: ['absolute', 'left-0', 'top-full', 'w-full', 'flex', 'justify-center']\n})\n\nconst NavigationMenuComponent = ({\n children,\n className,\n ...props\n}: React.ComponentProps<typeof StyledMenu>) => {\n const [offset, setOffset] = React.useState<number | null | undefined>()\n const [activeItem, setActiveItem] = React.useState<string | undefined>()\n const [listWidth, setListWidth] = React.useState(0)\n const listRef = React.useRef<HTMLUListElement>(null)\n\n React.useLayoutEffect(() => {\n if (listRef.current) {\n setListWidth(listRef.current.offsetWidth)\n }\n }, [React.Children.toArray(children).length])\n\n React.useEffect(() => {\n let timer: ReturnType<typeof setTimeout>\n\n // Delay transitioning back to initial position\n // to allow enough time for fadeOut animation to complete\n if (activeItem === '') {\n timer = setTimeout(() => setOffset(null), 200)\n }\n\n return () => {\n if (timer !== null) {\n clearTimeout(timer)\n }\n }\n }, [activeItem])\n\n // https://github.com/radix-ui/primitives/issues/1462\n const onNodeUpdate = (trigger: HTMLButtonElement, itemValue: string) => {\n if (trigger && listWidth && activeItem === itemValue) {\n const listCenter = listWidth / 2\n\n const triggerOffsetRight =\n listWidth -\n trigger.offsetLeft -\n trigger.offsetWidth +\n trigger.offsetWidth / 2\n\n setOffset(Math.round(listCenter - triggerOffsetRight))\n }\n\n return trigger\n }\n\n return (\n <NavigationMenuContext.Provider value={{ onNodeUpdate }}>\n <StyledMenu\n className={cn(className)}\n style={navigationMenuColorSchemes['light']}\n onValueChange={setActiveItem}\n {...props}\n >\n <StyledList ref={listRef}>{children}</StyledList>\n <ViewportPosition>\n <StyledViewport\n style={{ '--navigation-menu-viewport-offset': `${offset || 0}px` }}\n className={cn([\n 'data-[state=open]:animate-fade-in',\n 'data-[state=closed]:animate-fade-out',\n 'translate-x-(--navigation-menu-viewport-offset)'\n ])}\n />\n </ViewportPosition>\n </StyledMenu>\n </NavigationMenuContext.Provider>\n )\n}\n\nexport const NavigationMenu = Object.assign(NavigationMenuComponent, {\n Link: NavigationMenuLink,\n Dropdown: NavigationMenuDropdown,\n DropdownContent: NavigationMenuDropdownContent,\n DropdownItem: NavigationMenuDropdownItem,\n DropdownItemTitle: NavigationMenuDropdownItemTitle,\n DropdownTrigger: NavigationMenuDropdownTrigger\n})\n\nNavigationMenuComponent.displayName = 'NavigationMenu'\n"],"mappings":";;;;;;;;;;;AAiBA,IAAM,aAAa,OAAO,wBAAwB,MAAM,EACtD,MAAM;CAAC;CAAQ;CAAkB;AAAU,EAC7C,CAAC;AAED,IAAM,aAAa,OAAO,wBAAwB,MAAM,EACtD,MAAM;CAAC;CAAQ;CAAkB;CAAgB;CAAS;AAAW,EACvE,CAAC;AAED,IAAM,iBAAiB,OAAO,wBAAwB,UAAU,EAC9D,MAAM,CAAC,cAAc,EACvB,CAAC;AAED,IAAM,mBAAmB,OAAO,OAAO,EACrC,MAAM;CAAC;CAAY;CAAU;CAAY;CAAU;CAAQ;AAAgB,EAC7E,CAAC;AAED,IAAM,2BAA2B,EAC/B,UACA,WACA,GAAG,YAC0C;CAC7C,MAAM,CAAC,QAAQ,aAAa,MAAM,SAAoC;CACtE,MAAM,CAAC,YAAY,iBAAiB,MAAM,SAA6B;CACvE,MAAM,CAAC,WAAW,gBAAgB,MAAM,SAAS,CAAC;CAClD,MAAM,UAAU,MAAM,OAAyB,IAAI;CAEnD,MAAM,sBAAsB;EAC1B,IAAI,QAAQ,SACV,aAAa,QAAQ,QAAQ,WAAW;CAE5C,GAAG,CAAC,MAAM,SAAS,QAAQ,QAAQ,EAAE,MAAM,CAAC;CAE5C,MAAM,gBAAgB;EACpB,IAAI;EAIJ,IAAI,eAAe,IACjB,QAAQ,iBAAiB,UAAU,IAAI,GAAG,GAAG;EAG/C,aAAa;GACX,IAAI,UAAU,MACZ,aAAa,KAAK;EAEtB;CACF,GAAG,CAAC,UAAU,CAAC;CAGf,MAAM,gBAAgB,SAA4B,cAAsB;EACtE,IAAI,WAAW,aAAa,eAAe,WAAW;GACpD,MAAM,aAAa,YAAY;GAE/B,MAAM,qBACJ,YACA,QAAQ,aACR,QAAQ,cACR,QAAQ,cAAc;GAExB,UAAU,KAAK,MAAM,aAAa,kBAAkB,CAAC;EACvD;EAEA,OAAO;CACT;CAEA,OACE,sBAAA,cAAC,sBAAsB,UAAvB,EAAgC,OAAO,EAAE,aAAa,EAmBtB,GAlB9B,sBAAA,cAAC,YAAD;EACE,WAAW,GAAG,SAAS;EACvB,OAAO,aAA2B;EAClC,eAAe;EACf,GAAI;CAaM,GAXV,sBAAA,cAAC,YAAD,EAAY,KAAK,QAA+B,GAArB,QAAqB,GAChD,sBAAA,cAAC,kBAAA,MACC,sBAAA,cAAC,gBAAD;EACE,OAAO,EAAE,qCAAqC,GAAG,UAAU,EAAE,IAAI;EACjE,WAAW,GAAG;GACZ;GACA;GACA;EACF,CAAC;CACF,CAAA,CACe,CACR,CACkB;AAEpC;AAEA,IAAa,iBAAiB,OAAO,OAAO,yBAAyB;CACnE,MAAM;CACN,UAAU;CACV,iBAAiB;CACjB,cAAc;CACd,mBAAmB;CACnB,iBAAiB;AACnB,CAAC;AAED,wBAAwB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenu.styles.js","names":[],"sources":["../../../src/components/navigation/NavigationMenu.styles.ts"],"sourcesContent":["export const navigationMenuBaseItemStyles = [\n 'relative',\n 'text-(--text)',\n 'outline-none',\n 'cursor-pointer',\n 'font-body',\n 'select-none',\n 'p-3',\n 'rounded-md',\n 'bg-(--background)',\n 'hover:bg-(--background-hover)',\n 'hover:text-(--text-hover)',\n 'active:bg-(--background-active)',\n 'active:text-(--text-active)',\n 'focus-visible:inset-shadow-[0_0_0_2px_var(--color-primary-800)]',\n 'disabled:bg-none',\n 'disabled:cursor-default',\n 'disabled:opacity-[30%]',\n 'disabled:text-(--text)'\n]\n\nexport const navigationMenuActiveItemStyles = [\n 'font-semibold',\n 'text-item-(--background-selected)',\n 'after:-translate-x-1/2',\n 'after:absolute',\n 'after:bg-item-(--background-selected)',\n 'after:block',\n 'after:bottom-0',\n 'after:h-0.5',\n 'after:left-1/2',\n 'after:rounded-md',\n 'after:translate-y-0',\n 'after:w-6'\n]\n"],"mappings":";AAAA,IAAa,+BAA+B;CAC1C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;
|
|
1
|
+
{"version":3,"file":"NavigationMenu.styles.js","names":[],"sources":["../../../src/components/navigation/NavigationMenu.styles.ts"],"sourcesContent":["export const navigationMenuBaseItemStyles = [\n 'relative',\n 'text-(--text)',\n 'outline-none',\n 'cursor-pointer',\n 'font-body',\n 'select-none',\n 'p-3',\n 'rounded-md',\n 'bg-(--background)',\n 'hover:bg-(--background-hover)',\n 'hover:text-(--text-hover)',\n 'active:bg-(--background-active)',\n 'active:text-(--text-active)',\n 'focus-visible:inset-shadow-[0_0_0_2px_var(--color-primary-800)]',\n 'disabled:bg-none',\n 'disabled:cursor-default',\n 'disabled:opacity-[30%]',\n 'disabled:text-(--text)'\n]\n\nexport const navigationMenuActiveItemStyles = [\n 'font-semibold',\n 'text-item-(--background-selected)',\n 'after:-translate-x-1/2',\n 'after:absolute',\n 'after:bg-item-(--background-selected)',\n 'after:block',\n 'after:bottom-0',\n 'after:h-0.5',\n 'after:left-1/2',\n 'after:rounded-md',\n 'after:translate-y-0',\n 'after:w-6'\n]\n"],"mappings":";AAAA,IAAa,+BAA+B;CAC1C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,IAAa,iCAAiC;CAC5C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenuContext.js","names":[],"sources":["../../../src/components/navigation/NavigationMenuContext.tsx"],"sourcesContent":["import React from 'react'\n\ninterface NavigationMenuContextValue {\n onNodeUpdate: (\n trigger: HTMLButtonElement,\n itemValue: string\n ) => HTMLButtonElement\n}\n\nexport const NavigationMenuContext = React.createContext<\n NavigationMenuContextValue | undefined\n>(undefined)\n\nexport const useNavigationMenuContext = (): NavigationMenuContextValue => {\n const context = React.useContext(NavigationMenuContext)\n\n if (context === undefined) {\n throw new Error(\n 'useNavigationMenuContext must be used within a NavigationMenuContextProvider'\n )\n }\n\n return context\n}\n"],"mappings":";;AASA,IAAa,wBAAwB,MAAM,cAEzC,KAAA,
|
|
1
|
+
{"version":3,"file":"NavigationMenuContext.js","names":[],"sources":["../../../src/components/navigation/NavigationMenuContext.tsx"],"sourcesContent":["import React from 'react'\n\ninterface NavigationMenuContextValue {\n onNodeUpdate: (\n trigger: HTMLButtonElement,\n itemValue: string\n ) => HTMLButtonElement\n}\n\nexport const NavigationMenuContext = React.createContext<\n NavigationMenuContextValue | undefined\n>(undefined)\n\nexport const useNavigationMenuContext = (): NavigationMenuContextValue => {\n const context = React.useContext(NavigationMenuContext)\n\n if (context === undefined) {\n throw new Error(\n 'useNavigationMenuContext must be used within a NavigationMenuContextProvider'\n )\n }\n\n return context\n}\n"],"mappings":";;AASA,IAAa,wBAAwB,MAAM,cAEzC,KAAA,CAAS;AAEX,IAAa,iCAA6D;CACxE,MAAM,UAAU,MAAM,WAAW,qBAAqB;CAEtD,IAAI,YAAY,KAAA,GACd,MAAM,IAAI,MACR,8EACF;CAGF,OAAO;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenuDropdown.js","names":[],"sources":["../../../src/components/navigation/NavigationMenuDropdown.tsx"],"sourcesContent":["import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu'\nimport React, { ComponentProps, ReactElement } from 'react'\n\nimport { useNavigationMenuContext } from './NavigationMenuContext'\nimport { NavigationMenuDropdownContent } from './NavigationMenuDropdownContent'\nimport { NavigationMenuDropdownTrigger } from './NavigationMenuDropdownTrigger'\n\ntype NavigationMenuDropdownProps = {\n active?: boolean\n className?: string\n id: string\n} & React.HTMLProps<HTMLButtonElement>\n\ntype DropdownTriggerProps = ComponentProps<typeof NavigationMenuDropdownTrigger>\n\nexport const NavigationMenuDropdown = ({\n children,\n id,\n ...props\n}: NavigationMenuDropdownProps) => {\n const { onNodeUpdate } = useNavigationMenuContext()\n\n return (\n <NavigationMenuPrimitive.Item value={id}>\n {React.Children.map(children, (child) => {\n const isTrigger =\n React.isValidElement(child) &&\n child.type === NavigationMenuDropdownTrigger\n const isContent =\n React.isValidElement(child) &&\n child.type === NavigationMenuDropdownContent\n\n if (!isTrigger && !isContent) {\n throw new Error(\n 'Only NavigationMenu.Trigger and NavigationMenu.Content can be the passed as a \"children\" of NavigationMenu.Dropdown'\n )\n }\n return isTrigger\n ? React.cloneElement(\n child as ReactElement<DropdownTriggerProps>,\n {\n ...props,\n ref: (node: HTMLButtonElement) => onNodeUpdate(node, id)\n } as React.PropsWithRef<DropdownTriggerProps>\n )\n : child\n })}\n </NavigationMenuPrimitive.Item>\n )\n}\n\nNavigationMenuDropdown.displayName = 'NavigationMenuDropdown'\n"],"mappings":";;;;;;AAeA,IAAa,0BAA0B,EACrC,UACA,IACA,GAAG,YAC8B;CACjC,MAAM,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"NavigationMenuDropdown.js","names":[],"sources":["../../../src/components/navigation/NavigationMenuDropdown.tsx"],"sourcesContent":["import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu'\nimport React, { ComponentProps, ReactElement } from 'react'\n\nimport { useNavigationMenuContext } from './NavigationMenuContext'\nimport { NavigationMenuDropdownContent } from './NavigationMenuDropdownContent'\nimport { NavigationMenuDropdownTrigger } from './NavigationMenuDropdownTrigger'\n\ntype NavigationMenuDropdownProps = {\n active?: boolean\n className?: string\n id: string\n} & React.HTMLProps<HTMLButtonElement>\n\ntype DropdownTriggerProps = ComponentProps<typeof NavigationMenuDropdownTrigger>\n\nexport const NavigationMenuDropdown = ({\n children,\n id,\n ...props\n}: NavigationMenuDropdownProps) => {\n const { onNodeUpdate } = useNavigationMenuContext()\n\n return (\n <NavigationMenuPrimitive.Item value={id}>\n {React.Children.map(children, (child) => {\n const isTrigger =\n React.isValidElement(child) &&\n child.type === NavigationMenuDropdownTrigger\n const isContent =\n React.isValidElement(child) &&\n child.type === NavigationMenuDropdownContent\n\n if (!isTrigger && !isContent) {\n throw new Error(\n 'Only NavigationMenu.Trigger and NavigationMenu.Content can be the passed as a \"children\" of NavigationMenu.Dropdown'\n )\n }\n return isTrigger\n ? React.cloneElement(\n child as ReactElement<DropdownTriggerProps>,\n {\n ...props,\n ref: (node: HTMLButtonElement) => onNodeUpdate(node, id)\n } as React.PropsWithRef<DropdownTriggerProps>\n )\n : child\n })}\n </NavigationMenuPrimitive.Item>\n )\n}\n\nNavigationMenuDropdown.displayName = 'NavigationMenuDropdown'\n"],"mappings":";;;;;;AAeA,IAAa,0BAA0B,EACrC,UACA,IACA,GAAG,YAC8B;CACjC,MAAM,EAAE,iBAAiB,yBAAyB;CAElD,OACE,sBAAA,cAAC,wBAAwB,MAAzB,EAA8B,OAAO,GAwBP,GAvB3B,MAAM,SAAS,IAAI,WAAW,UAAU;EACvC,MAAM,YACJ,MAAM,eAAe,KAAK,KAC1B,MAAM,SAAS;EACjB,MAAM,YACJ,MAAM,eAAe,KAAK,KAC1B,MAAM,SAAS;EAEjB,IAAI,CAAC,aAAa,CAAC,WACjB,MAAM,IAAI,MACR,uHACF;EAEF,OAAO,YACH,MAAM,aACJ,OACA;GACE,GAAG;GACH,MAAM,SAA4B,aAAa,MAAM,EAAE;EACzD,CACF,IACA;CACN,CAAC,CAC2B;AAElC;AAEA,uBAAuB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenuDropdownContent.js","names":[],"sources":["../../../src/components/navigation/NavigationMenuDropdownContent.tsx"],"sourcesContent":["import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu'\nimport React from 'react'\n\nimport { styled } from '~/styled'\nimport { preventEvent } from '~/utilities/event/preventEvent'\n\nconst StyledContent = styled(NavigationMenuPrimitive.Content, {\n base: ['p-3', 'bg-(--dropdown-background)', 'mt-1', 'shadow-md', 'rounded-md']\n})\n\ntype NavigationMenuDropdownContentProps = React.ComponentProps<\n typeof StyledContent\n>\n\nexport const NavigationMenuDropdownContent = ({\n children,\n ...rest\n}: NavigationMenuDropdownContentProps) => (\n <StyledContent\n onPointerMove={preventEvent}\n onPointerLeave={preventEvent}\n {...rest}\n >\n <ul>{children}</ul>\n </StyledContent>\n)\n\nNavigationMenuDropdownContent.displayName = 'NavigationMenuDropdownContent'\n"],"mappings":";;;;;AAMA,IAAM,gBAAgB,OAAO,wBAAwB,SAAS,EAC5D,MAAM;CAAC;CAAO;CAA8B;CAAQ;CAAa;
|
|
1
|
+
{"version":3,"file":"NavigationMenuDropdownContent.js","names":[],"sources":["../../../src/components/navigation/NavigationMenuDropdownContent.tsx"],"sourcesContent":["import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu'\nimport React from 'react'\n\nimport { styled } from '~/styled'\nimport { preventEvent } from '~/utilities/event/preventEvent'\n\nconst StyledContent = styled(NavigationMenuPrimitive.Content, {\n base: ['p-3', 'bg-(--dropdown-background)', 'mt-1', 'shadow-md', 'rounded-md']\n})\n\ntype NavigationMenuDropdownContentProps = React.ComponentProps<\n typeof StyledContent\n>\n\nexport const NavigationMenuDropdownContent = ({\n children,\n ...rest\n}: NavigationMenuDropdownContentProps) => (\n <StyledContent\n onPointerMove={preventEvent}\n onPointerLeave={preventEvent}\n {...rest}\n >\n <ul>{children}</ul>\n </StyledContent>\n)\n\nNavigationMenuDropdownContent.displayName = 'NavigationMenuDropdownContent'\n"],"mappings":";;;;;AAMA,IAAM,gBAAgB,OAAO,wBAAwB,SAAS,EAC5D,MAAM;CAAC;CAAO;CAA8B;CAAQ;CAAa;AAAY,EAC/E,CAAC;AAMD,IAAa,iCAAiC,EAC5C,UACA,GAAG,WAEH,sBAAA,cAAC,eAAD;CACE,eAAe;CACf,gBAAgB;CAChB,GAAI;AAGS,GADb,sBAAA,cAAC,MAAA,MAAI,QAAa,CACL;AAGjB,8BAA8B,cAAc"}
|
|
@@ -10,6 +10,7 @@ export declare const NavigationMenuDropdownItem: React.ForwardRefExoticComponent
|
|
|
10
10
|
} & {
|
|
11
11
|
as?: React.ElementType;
|
|
12
12
|
}>>["elementType"];
|
|
13
|
+
reloadDocument?: boolean;
|
|
13
14
|
}, "ref"> & React.RefAttributes<HTMLAnchorElement>>, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
14
15
|
export declare const NavigationMenuDropdownItemTitle: React.ForwardRefExoticComponent<Omit<Omit<Omit<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & {
|
|
15
16
|
ref?: ((instance: HTMLParagraphElement | null) => void) | React.RefObject<HTMLParagraphElement> | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenuDropdownItem.js","names":[],"sources":["../../../src/components/navigation/NavigationMenuDropdownItem.tsx"],"sourcesContent":["import React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { Text } from '../text/Text'\nimport { NavigationMenuLink } from './NavigationMenuLink'\n\nexport const NavigationMenuDropdownItem = React.forwardRef<\n HTMLAnchorElement,\n React.PropsWithChildren<React.ComponentProps<typeof NavigationMenuLink>>\n>((props, forwardedRef) => {\n return (\n <NavigationMenuLink ref={forwardedRef} variant=\"dropdownItem\" {...props} />\n )\n})\n\nexport const NavigationMenuDropdownItemTitle = styled(Text, {\n base: ['text-grey-900', 'font-semibold']\n})\n\nNavigationMenuDropdownItem.displayName = 'NavigationMenuDropdownItem'\nNavigationMenuDropdownItemTitle.displayName = 'NavigationMenuDropdownItemTitle'\n"],"mappings":";;;;;AAOA,IAAa,6BAA6B,MAAM,YAG7C,OAAO,iBAAiB;
|
|
1
|
+
{"version":3,"file":"NavigationMenuDropdownItem.js","names":[],"sources":["../../../src/components/navigation/NavigationMenuDropdownItem.tsx"],"sourcesContent":["import React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { Text } from '../text/Text'\nimport { NavigationMenuLink } from './NavigationMenuLink'\n\nexport const NavigationMenuDropdownItem = React.forwardRef<\n HTMLAnchorElement,\n React.PropsWithChildren<React.ComponentProps<typeof NavigationMenuLink>>\n>((props, forwardedRef) => {\n return (\n <NavigationMenuLink ref={forwardedRef} variant=\"dropdownItem\" {...props} />\n )\n})\n\nexport const NavigationMenuDropdownItemTitle = styled(Text, {\n base: ['text-grey-900', 'font-semibold']\n})\n\nNavigationMenuDropdownItem.displayName = 'NavigationMenuDropdownItem'\nNavigationMenuDropdownItemTitle.displayName = 'NavigationMenuDropdownItemTitle'\n"],"mappings":";;;;;AAOA,IAAa,6BAA6B,MAAM,YAG7C,OAAO,iBAAiB;CACzB,OACE,sBAAA,cAAC,oBAAD;EAAoB,KAAK;EAAc,SAAQ;EAAe,GAAI;CAAQ,CAAA;AAE9E,CAAC;AAED,IAAa,kCAAkC,OAAO,MAAM,EAC1D,MAAM,CAAC,iBAAiB,eAAe,EACzC,CAAC;AAED,2BAA2B,cAAc;AACzC,gCAAgC,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenuDropdownTrigger.js","names":[],"sources":["../../../src/components/navigation/NavigationMenuDropdownTrigger.tsx"],"sourcesContent":["import { ChevronDown } from '@atom-learning/icons'\nimport * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu'\nimport React from 'react'\n\nimport { styled } from '~/styled'\nimport { cn } from '~/styled'\nimport { preventEvent } from '~/utilities/event/preventEvent'\n\nimport { Icon } from '../icon/Icon'\nimport {\n navigationMenuActiveItemStyles,\n navigationMenuBaseItemStyles\n} from './NavigationMenu.styles'\n\nconst StyledTrigger = styled(NavigationMenuPrimitive.Trigger, {\n base: [\n ...navigationMenuBaseItemStyles,\n 'flex',\n 'items-center',\n 'rounded-md',\n 'justify-between',\n 'data-[state=open]:bg-(--trigger-background-open)'\n ],\n variants: {\n active: {\n true: navigationMenuActiveItemStyles\n }\n }\n})\n\nexport const NavigationMenuDropdownTrigger = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<typeof StyledTrigger>\n>(({ children, active, ...props }, forwardedRef) => (\n <StyledTrigger\n active={active}\n {...props}\n ref={forwardedRef}\n onPointerMove={preventEvent}\n onPointerLeave={preventEvent}\n >\n {children}\n <Icon\n is={ChevronDown}\n size=\"sm\"\n className={cn(\n 'ml-1',\n 'in-data-[state=open]:-rotate-180',\n 'motion-safe:duration-200',\n 'motion-safe:ease-in',\n 'motion-safe:transition-transform'\n )}\n />\n </StyledTrigger>\n))\n\nNavigationMenuDropdownTrigger.displayName = 'NavigationMenuDropdownTrigger'\n"],"mappings":";;;;;;;;AAcA,IAAM,gBAAgB,OAAO,wBAAwB,SAAS;CAC5D,MAAM;EACJ,GAAG;EACH;EACA;EACA;EACA;EACA;
|
|
1
|
+
{"version":3,"file":"NavigationMenuDropdownTrigger.js","names":[],"sources":["../../../src/components/navigation/NavigationMenuDropdownTrigger.tsx"],"sourcesContent":["import { ChevronDown } from '@atom-learning/icons'\nimport * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu'\nimport React from 'react'\n\nimport { styled } from '~/styled'\nimport { cn } from '~/styled'\nimport { preventEvent } from '~/utilities/event/preventEvent'\n\nimport { Icon } from '../icon/Icon'\nimport {\n navigationMenuActiveItemStyles,\n navigationMenuBaseItemStyles\n} from './NavigationMenu.styles'\n\nconst StyledTrigger = styled(NavigationMenuPrimitive.Trigger, {\n base: [\n ...navigationMenuBaseItemStyles,\n 'flex',\n 'items-center',\n 'rounded-md',\n 'justify-between',\n 'data-[state=open]:bg-(--trigger-background-open)'\n ],\n variants: {\n active: {\n true: navigationMenuActiveItemStyles\n }\n }\n})\n\nexport const NavigationMenuDropdownTrigger = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<typeof StyledTrigger>\n>(({ children, active, ...props }, forwardedRef) => (\n <StyledTrigger\n active={active}\n {...props}\n ref={forwardedRef}\n onPointerMove={preventEvent}\n onPointerLeave={preventEvent}\n >\n {children}\n <Icon\n is={ChevronDown}\n size=\"sm\"\n className={cn(\n 'ml-1',\n 'in-data-[state=open]:-rotate-180',\n 'motion-safe:duration-200',\n 'motion-safe:ease-in',\n 'motion-safe:transition-transform'\n )}\n />\n </StyledTrigger>\n))\n\nNavigationMenuDropdownTrigger.displayName = 'NavigationMenuDropdownTrigger'\n"],"mappings":";;;;;;;;AAcA,IAAM,gBAAgB,OAAO,wBAAwB,SAAS;CAC5D,MAAM;EACJ,GAAG;EACH;EACA;EACA;EACA;EACA;CACF;CACA,UAAU,EACR,QAAQ,EACN,MAAM,+BACR,EACF;AACF,CAAC;AAED,IAAa,gCAAgC,MAAM,YAGhD,EAAE,UAAU,QAAQ,GAAG,SAAS,iBACjC,sBAAA,cAAC,eAAD;CACU;CACR,GAAI;CACJ,KAAK;CACL,eAAe;CACf,gBAAgB;AAcH,GAZZ,UACD,sBAAA,cAAC,MAAD;CACE,IAAI;CACJ,MAAK;CACL,WAAW,GACT,QACA,oCACA,4BACA,uBACA,kCACF;AACD,CAAA,CACY,CAChB;AAED,8BAA8B,cAAc"}
|
|
@@ -12,5 +12,6 @@ export declare const NavigationMenuLink: React.ForwardRefExoticComponent<Omit<Om
|
|
|
12
12
|
}, "elementType"> & {
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
variant?: React.ComponentProps<typeof StyledLink>["elementType"];
|
|
15
|
+
reloadDocument?: boolean;
|
|
15
16
|
}, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
16
17
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { styled } from "../../styled.js";
|
|
2
2
|
import { getExternalAnchorProps } from "../../utilities/uri/index.js";
|
|
3
|
+
import { useRouterLinkProps } from "../router-provider/RouterProvider.js";
|
|
3
4
|
import { navigationMenuBaseItemStyles } from "./NavigationMenu.styles.js";
|
|
4
5
|
import React from "react";
|
|
5
6
|
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
|
|
@@ -46,17 +47,27 @@ var StyledLink = styled(NavigationMenuPrimitive.Link, {
|
|
|
46
47
|
]
|
|
47
48
|
} }
|
|
48
49
|
});
|
|
49
|
-
var NavigationMenuLink = React.forwardRef(({ children, href, disabled, className, variant = "link", ref: _ref, ...props }, forwardedRef) =>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
50
|
+
var NavigationMenuLink = React.forwardRef(({ children, href, disabled, className, variant = "link", ref: _ref, reloadDocument, ...props }, forwardedRef) => {
|
|
51
|
+
const RouterLink = useRouterLinkProps(href, { reloadDocument }).as;
|
|
52
|
+
return /* @__PURE__ */ React.createElement(ListItem, null, disabled ? /* @__PURE__ */ React.createElement(DisabledButton, {
|
|
53
|
+
disabled: true,
|
|
54
|
+
className
|
|
55
|
+
}, children) : RouterLink ? /* @__PURE__ */ React.createElement(StyledLink, {
|
|
56
|
+
href,
|
|
57
|
+
ref: forwardedRef,
|
|
58
|
+
elementType: variant,
|
|
59
|
+
className,
|
|
60
|
+
asChild: true,
|
|
61
|
+
...props
|
|
62
|
+
}, /* @__PURE__ */ React.createElement(RouterLink, { href }, children)) : /* @__PURE__ */ React.createElement(StyledLink, {
|
|
63
|
+
href,
|
|
64
|
+
ref: forwardedRef,
|
|
65
|
+
elementType: variant,
|
|
66
|
+
className,
|
|
67
|
+
...getExternalAnchorProps(href),
|
|
68
|
+
...props
|
|
69
|
+
}, children));
|
|
70
|
+
});
|
|
60
71
|
NavigationMenuLink.displayName = "NavigationMenuLink";
|
|
61
72
|
//#endregion
|
|
62
73
|
export { NavigationMenuLink };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenuLink.js","names":[],"sources":["../../../src/components/navigation/NavigationMenuLink.tsx"],"sourcesContent":["import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu'\nimport React from 'react'\n\nimport { styled } from '~/styled'\nimport { getExternalAnchorProps } from '~/utilities/uri'\n\nimport { navigationMenuBaseItemStyles } from './NavigationMenu.styles'\n\nconst DisabledButton = styled('button', {\n base: [\n ...navigationMenuBaseItemStyles,\n 'disabled:bg-none',\n 'disabled:cursor-default',\n 'disabled:opacity-30',\n 'disabled:text-text'\n ]\n})\n\nconst ListItem = NavigationMenuPrimitive.Item\n\nconst StyledLink = styled(NavigationMenuPrimitive.Link, {\n base: [\n ...navigationMenuBaseItemStyles,\n 'block',\n 'no-underline',\n 'leading-none'\n ],\n variants: {\n elementType: {\n dropdownItem: [\n 'data-active:bg-background-selected',\n 'data-active:text-text-selected',\n 'data-active:hover:bg-background-selected-hover',\n 'data-active:hover:text-text-selected-hover',\n 'data-active:active:bg-background-selected-pressed',\n 'data-active:active:text-text-selected-pressed',\n 'data-active:focus-visible:shadow-[0_0_0_2px_var(--color-primary-800)]',\n 'data-active:focus-visible:text-text-selected-focus'\n ],\n link: [\n 'data-active:font-semibold',\n 'data-active:text-item-(--background-selected)',\n 'data-active:after:-translate-x-1/2',\n 'data-active:after:absolute',\n 'data-active:after:bg-item-(--background-selected)',\n 'data-active:after:block',\n 'data-active:after:bottom-0',\n 'data-active:after:h-0.5',\n 'data-active:after:left-1/2',\n 'data-active:after:rounded-md',\n 'data-active:after:translate-y-0',\n 'data-active:after:w-6'\n ]\n }\n }\n})\n\nexport const NavigationMenuLink = React.forwardRef<\n HTMLAnchorElement,\n Omit<React.ComponentProps<typeof StyledLink>, 'elementType'> & {\n disabled?: boolean\n variant?: React.ComponentProps<typeof StyledLink>['elementType']\n }\n>(\n (\n {\n children,\n href,\n disabled,\n className,\n variant = 'link',\n ref: _ref,\n ...props\n },\n forwardedRef\n ) => (\n <ListItem>\n
|
|
1
|
+
{"version":3,"file":"NavigationMenuLink.js","names":[],"sources":["../../../src/components/navigation/NavigationMenuLink.tsx"],"sourcesContent":["import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu'\nimport React from 'react'\n\nimport { styled } from '~/styled'\nimport { getExternalAnchorProps } from '~/utilities/uri'\n\nimport { useRouterLinkProps } from '../router-provider/RouterProvider'\nimport { navigationMenuBaseItemStyles } from './NavigationMenu.styles'\n\nconst DisabledButton = styled('button', {\n base: [\n ...navigationMenuBaseItemStyles,\n 'disabled:bg-none',\n 'disabled:cursor-default',\n 'disabled:opacity-30',\n 'disabled:text-text'\n ]\n})\n\nconst ListItem = NavigationMenuPrimitive.Item\n\nconst StyledLink = styled(NavigationMenuPrimitive.Link, {\n base: [\n ...navigationMenuBaseItemStyles,\n 'block',\n 'no-underline',\n 'leading-none'\n ],\n variants: {\n elementType: {\n dropdownItem: [\n 'data-active:bg-background-selected',\n 'data-active:text-text-selected',\n 'data-active:hover:bg-background-selected-hover',\n 'data-active:hover:text-text-selected-hover',\n 'data-active:active:bg-background-selected-pressed',\n 'data-active:active:text-text-selected-pressed',\n 'data-active:focus-visible:shadow-[0_0_0_2px_var(--color-primary-800)]',\n 'data-active:focus-visible:text-text-selected-focus'\n ],\n link: [\n 'data-active:font-semibold',\n 'data-active:text-item-(--background-selected)',\n 'data-active:after:-translate-x-1/2',\n 'data-active:after:absolute',\n 'data-active:after:bg-item-(--background-selected)',\n 'data-active:after:block',\n 'data-active:after:bottom-0',\n 'data-active:after:h-0.5',\n 'data-active:after:left-1/2',\n 'data-active:after:rounded-md',\n 'data-active:after:translate-y-0',\n 'data-active:after:w-6'\n ]\n }\n }\n})\n\nexport const NavigationMenuLink = React.forwardRef<\n HTMLAnchorElement,\n Omit<React.ComponentProps<typeof StyledLink>, 'elementType'> & {\n disabled?: boolean\n variant?: React.ComponentProps<typeof StyledLink>['elementType']\n reloadDocument?: boolean\n }\n>(\n (\n {\n children,\n href,\n disabled,\n className,\n variant = 'link',\n ref: _ref,\n reloadDocument,\n ...props\n },\n forwardedRef\n ) => {\n const routerLinkProps = useRouterLinkProps(href, { reloadDocument })\n const RouterLink = routerLinkProps.as\n\n return (\n <ListItem>\n {disabled ? (\n <DisabledButton disabled className={className}>\n {children}\n </DisabledButton>\n ) : RouterLink ? (\n <StyledLink\n href={href}\n ref={forwardedRef as any}\n elementType={variant}\n className={className}\n asChild\n {...props}\n >\n <RouterLink href={href}>{children}</RouterLink>\n </StyledLink>\n ) : (\n <StyledLink\n href={href}\n ref={forwardedRef as any}\n elementType={variant}\n className={className}\n {...getExternalAnchorProps(href)}\n {...props}\n >\n {children}\n </StyledLink>\n )}\n </ListItem>\n )\n }\n)\n\nNavigationMenuLink.displayName = 'NavigationMenuLink'\n"],"mappings":";;;;;;;AASA,IAAM,iBAAiB,OAAO,UAAU,EACtC,MAAM;CACJ,GAAG;CACH;CACA;CACA;CACA;AACF,EACF,CAAC;AAED,IAAM,WAAW,wBAAwB;AAEzC,IAAM,aAAa,OAAO,wBAAwB,MAAM;CACtD,MAAM;EACJ,GAAG;EACH;EACA;EACA;CACF;CACA,UAAU,EACR,aAAa;EACX,cAAc;GACZ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EACA,MAAM;GACJ;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;CACF,EACF;AACF,CAAC;AAED,IAAa,qBAAqB,MAAM,YASpC,EACE,UACA,MACA,UACA,WACA,UAAU,QACV,KAAK,MACL,gBACA,GAAG,SAEL,iBACG;CAEH,MAAM,aADkB,mBAAmB,MAAM,EAAE,eAAe,CAC/C,EAAgB;CAEnC,OACE,sBAAA,cAAC,UAAA,MACE,WACC,sBAAA,cAAC,gBAAD;EAAgB,UAAA;EAAoB;CAEpB,GADb,QACa,IACd,aACF,sBAAA,cAAC,YAAD;EACQ;EACN,KAAK;EACL,aAAa;EACF;EACX,SAAA;EACA,GAAI;CAGM,GADV,sBAAA,cAAC,YAAD,EAAkB,KAA4B,GAArB,QAAqB,CACpC,IAEZ,sBAAA,cAAC,YAAD;EACQ;EACN,KAAK;EACL,aAAa;EACF;EACX,GAAI,uBAAuB,IAAI;EAC/B,GAAI;CAGM,GADT,QACS,CAEN;AAEd,CACF;AAEA,mBAAmB,cAAc"}
|
package/dist/components/navigation-menu-vertical/NavigationMenuVertical.colorscheme.config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenuVertical.colorscheme.config.js","names":[],"sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVertical.colorscheme.config.ts"],"sourcesContent":["const light = {\n '--text': 'var(--foreground)',\n '--background': 'var(--base-1)',\n '--background-hover': 'var(--base-2)',\n '--background-active': 'var(--base-3)',\n '--text-selected': 'var(--accent-9)',\n '--background-selected': 'var(--accent-2)'\n}\n\nexport const colorSchemes = {\n light\n}\n"],"mappings":"AASA,IAAa,eAAe,EAC1B
|
|
1
|
+
{"version":3,"file":"NavigationMenuVertical.colorscheme.config.js","names":[],"sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVertical.colorscheme.config.ts"],"sourcesContent":["const light = {\n '--text': 'var(--foreground)',\n '--background': 'var(--base-1)',\n '--background-hover': 'var(--base-2)',\n '--background-active': 'var(--base-3)',\n '--text-selected': 'var(--accent-9)',\n '--background-selected': 'var(--accent-2)'\n}\n\nexport const colorSchemes = {\n light\n}\n"],"mappings":"AASA,IAAa,eAAe,EAC1B;CATA,UAAU;CACV,gBAAgB;CAChB,sBAAsB;CACtB,uBAAuB;CACvB,mBAAmB;CACnB,yBAAyB;AAIzB,EACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenuVertical.js","names":[],"sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVertical.tsx"],"sourcesContent":["import { Root } from '@radix-ui/react-navigation-menu'\nimport React from 'react'\n\nimport { styled, Theme } from '~/styled'\n\nimport { colorSchemes as navigationMenuVerticalColorSchemes } from './NavigationMenuVertical.colorscheme.config'\nimport { NavigationMenuVerticalAccordion } from './NavigationMenuVerticalAccordion'\nimport { NavigationMenuVerticalAccordionContent } from './NavigationMenuVerticalAccordionContent'\nimport { NavigationMenuVerticalAccordionTrigger } from './NavigationMenuVerticalAccordionTrigger'\nimport { NavigationMenuVerticalIcon } from './NavigationMenuVerticalIcon'\nimport { NavigationMenuVerticalItem } from './NavigationMenuVerticalItem'\nimport { NavigationMenuVerticalItemContent } from './NavigationMenuVerticalItemContent'\nimport { NavigationMenuVerticalLink } from './NavigationMenuVerticalLink'\nimport { NavigationMenuVerticalList } from './NavigationMenuVerticalList'\nimport { NavigationMenuVerticalText } from './NavigationMenuVerticalText'\n\nconst StyledRoot = styled(Root, {\n base: ['w-full']\n})\n\n/*\n * (!)\n * NavigationMenu vertical behaviour was buggy so had to build the\n * opening/closing nested Content(Accordion) based on `Collapsible` instead.\n * This means that the below `value` based props and `Trigger`/`Content`\n * animations do nothing, so removing them from typescript\n */\ntype TNavigationVerticalProps = Omit<\n React.ComponentProps<typeof StyledRoot>,\n | 'delayDuration'\n | 'skipDelayDuration'\n | 'defaultValue'\n | 'value'\n | 'onValueChange'\n>\n\nexport const NavigationMenuVertical = Object.assign(\n ({ children, ...rest }: TNavigationVerticalProps) => (\n <Theme theme={navigationMenuVerticalColorSchemes['light']}>\n <StyledRoot {...rest} orientation=\"vertical\">\n <NavigationMenuVerticalList>{children}</NavigationMenuVerticalList>\n </StyledRoot>\n </Theme>\n ),\n {\n Link: NavigationMenuVerticalLink,\n Accordion: NavigationMenuVerticalAccordion,\n AccordionContent: NavigationMenuVerticalAccordionContent,\n AccordionTrigger: NavigationMenuVerticalAccordionTrigger,\n Item: NavigationMenuVerticalItem,\n ItemContent: NavigationMenuVerticalItemContent,\n Icon: NavigationMenuVerticalIcon,\n Text: NavigationMenuVerticalText\n }\n)\n"],"mappings":";;;;;;;;;;;;;;AAgBA,IAAM,aAAa,OAAO,MAAM,EAC9B,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"NavigationMenuVertical.js","names":[],"sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVertical.tsx"],"sourcesContent":["import { Root } from '@radix-ui/react-navigation-menu'\nimport React from 'react'\n\nimport { styled, Theme } from '~/styled'\n\nimport { colorSchemes as navigationMenuVerticalColorSchemes } from './NavigationMenuVertical.colorscheme.config'\nimport { NavigationMenuVerticalAccordion } from './NavigationMenuVerticalAccordion'\nimport { NavigationMenuVerticalAccordionContent } from './NavigationMenuVerticalAccordionContent'\nimport { NavigationMenuVerticalAccordionTrigger } from './NavigationMenuVerticalAccordionTrigger'\nimport { NavigationMenuVerticalIcon } from './NavigationMenuVerticalIcon'\nimport { NavigationMenuVerticalItem } from './NavigationMenuVerticalItem'\nimport { NavigationMenuVerticalItemContent } from './NavigationMenuVerticalItemContent'\nimport { NavigationMenuVerticalLink } from './NavigationMenuVerticalLink'\nimport { NavigationMenuVerticalList } from './NavigationMenuVerticalList'\nimport { NavigationMenuVerticalText } from './NavigationMenuVerticalText'\n\nconst StyledRoot = styled(Root, {\n base: ['w-full']\n})\n\n/*\n * (!)\n * NavigationMenu vertical behaviour was buggy so had to build the\n * opening/closing nested Content(Accordion) based on `Collapsible` instead.\n * This means that the below `value` based props and `Trigger`/`Content`\n * animations do nothing, so removing them from typescript\n */\ntype TNavigationVerticalProps = Omit<\n React.ComponentProps<typeof StyledRoot>,\n | 'delayDuration'\n | 'skipDelayDuration'\n | 'defaultValue'\n | 'value'\n | 'onValueChange'\n>\n\nexport const NavigationMenuVertical = Object.assign(\n ({ children, ...rest }: TNavigationVerticalProps) => (\n <Theme theme={navigationMenuVerticalColorSchemes['light']}>\n <StyledRoot {...rest} orientation=\"vertical\">\n <NavigationMenuVerticalList>{children}</NavigationMenuVerticalList>\n </StyledRoot>\n </Theme>\n ),\n {\n Link: NavigationMenuVerticalLink,\n Accordion: NavigationMenuVerticalAccordion,\n AccordionContent: NavigationMenuVerticalAccordionContent,\n AccordionTrigger: NavigationMenuVerticalAccordionTrigger,\n Item: NavigationMenuVerticalItem,\n ItemContent: NavigationMenuVerticalItemContent,\n Icon: NavigationMenuVerticalIcon,\n Text: NavigationMenuVerticalText\n }\n)\n"],"mappings":";;;;;;;;;;;;;;AAgBA,IAAM,aAAa,OAAO,MAAM,EAC9B,MAAM,CAAC,QAAQ,EACjB,CAAC;AAkBD,IAAa,yBAAyB,OAAO,QAC1C,EAAE,UAAU,GAAG,WACd,sBAAA,cAAC,OAAD,EAAO,OAAO,aAAmC,SAI1C,GAHL,sBAAA,cAAC,YAAD;CAAY,GAAI;CAAM,aAAY;AAEtB,GADV,sBAAA,cAAC,4BAAA,MAA4B,QAAqC,CACxD,CACP,GAET;CACE,MAAM;CACN,WAAW;CACX,kBAAkB;CAClB,kBAAkB;CAClB,MAAM;CACN,aAAa;CACb,MAAM;CACN,MAAM;AACR,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenuVertical.styles.js","names":[],"sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVertical.styles.ts"],"sourcesContent":["export const navigationMenuVerticalItemStyles = [\n '[--navigation-menu-vertical-item-font-weight:400]',\n 'data-[state=open]:[--navigation-menu-vertical-item-font-weight:600]',\n 'border-none',\n 'outline-none',\n 'bg-none',\n 'decoration-[inherit]',\n 'cursor-pointer',\n 'rounded-md',\n 'flex',\n 'items-center',\n 'p-2',\n 'pl-(--navigation-menu-vertical-item-pl)',\n 'w-full',\n 'text-(--text)',\n 'bg-(--background)',\n 'disabled:cursor-not-allowed',\n '[text-decoration:unset]',\n 'disabled:opacity-30',\n 'not-disabled:active:bg-(--background-active)',\n 'not-disabled:focus-visible:outline-none',\n 'not-disabled:focus-visible:relative',\n 'not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]',\n 'not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px]',\n 'not-disabled:focus-visible:z-1',\n 'not-disabled:hover:bg-(--background-hover)',\n 'data-active:bg-(--background-selected)',\n 'data-active:text-(--text-selected)',\n 'data-active:[--navigation-menu-vertical-item-font-weight:600]'\n]\n"],"mappings":";AAAA,IAAa,mCAAmC;CAC9C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;
|
|
1
|
+
{"version":3,"file":"NavigationMenuVertical.styles.js","names":[],"sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVertical.styles.ts"],"sourcesContent":["export const navigationMenuVerticalItemStyles = [\n '[--navigation-menu-vertical-item-font-weight:400]',\n 'data-[state=open]:[--navigation-menu-vertical-item-font-weight:600]',\n 'border-none',\n 'outline-none',\n 'bg-none',\n 'decoration-[inherit]',\n 'cursor-pointer',\n 'rounded-md',\n 'flex',\n 'items-center',\n 'p-2',\n 'pl-(--navigation-menu-vertical-item-pl)',\n 'w-full',\n 'text-(--text)',\n 'bg-(--background)',\n 'disabled:cursor-not-allowed',\n '[text-decoration:unset]',\n 'disabled:opacity-30',\n 'not-disabled:active:bg-(--background-active)',\n 'not-disabled:focus-visible:outline-none',\n 'not-disabled:focus-visible:relative',\n 'not-disabled:focus-visible:shadow-[var(--color-primary-800)_0px_0px_0px_4px]',\n 'not-disabled:focus-visible:shadow-[white_0px_0px_0px_2px]',\n 'not-disabled:focus-visible:z-1',\n 'not-disabled:hover:bg-(--background-hover)',\n 'data-active:bg-(--background-selected)',\n 'data-active:text-(--text-selected)',\n 'data-active:[--navigation-menu-vertical-item-font-weight:600]'\n]\n"],"mappings":";AAAA,IAAa,mCAAmC;CAC9C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenuVerticalAccordion.js","names":[],"sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalAccordion.tsx"],"sourcesContent":["import { Root } from '@radix-ui/react-collapsible'\nimport * as React from 'react'\n\nimport { useCallbackRef } from '~/utilities/hooks/useCallbackRef'\n\nimport { NavigationMenuVerticalItem } from './NavigationMenuVerticalItem'\n\ntype TNavigationMenuVerticalAccordionContextValue = {\n triggerRef?: React.MutableRefObject<HTMLElement | null>\n setTriggerRef?: (HTMLElement) => void\n}\nexport const NavigationMenuVerticalAccordionContext =\n React.createContext<TNavigationMenuVerticalAccordionContextValue>({})\nconst NavigationMenuVerticalAccordionProvider = ({ children }) => {\n const [triggerRef, setTriggerRef] = useCallbackRef()\n return (\n <NavigationMenuVerticalAccordionContext.Provider\n value={{ triggerRef, setTriggerRef }}\n >\n {children}\n </NavigationMenuVerticalAccordionContext.Provider>\n )\n}\n\ntype TNavigationMenuVerticalAccordionProps = React.ComponentProps<typeof Root> &\n React.ComponentProps<typeof NavigationMenuVerticalItem>\nexport const NavigationMenuVerticalAccordion = ({\n defaultOpen,\n open,\n onOpenChange,\n disabled,\n ...rest\n}: TNavigationMenuVerticalAccordionProps): JSX.Element => {\n const collapsibleProps = { defaultOpen, open, onOpenChange, disabled }\n return (\n <NavigationMenuVerticalAccordionProvider>\n <Root {...collapsibleProps} asChild>\n <NavigationMenuVerticalItem {...rest} />\n </Root>\n </NavigationMenuVerticalAccordionProvider>\n )\n}\n"],"mappings":";;;;;AAWA,IAAa,yCACX,QAAM,cAA4D,
|
|
1
|
+
{"version":3,"file":"NavigationMenuVerticalAccordion.js","names":[],"sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalAccordion.tsx"],"sourcesContent":["import { Root } from '@radix-ui/react-collapsible'\nimport * as React from 'react'\n\nimport { useCallbackRef } from '~/utilities/hooks/useCallbackRef'\n\nimport { NavigationMenuVerticalItem } from './NavigationMenuVerticalItem'\n\ntype TNavigationMenuVerticalAccordionContextValue = {\n triggerRef?: React.MutableRefObject<HTMLElement | null>\n setTriggerRef?: (HTMLElement) => void\n}\nexport const NavigationMenuVerticalAccordionContext =\n React.createContext<TNavigationMenuVerticalAccordionContextValue>({})\nconst NavigationMenuVerticalAccordionProvider = ({ children }) => {\n const [triggerRef, setTriggerRef] = useCallbackRef()\n return (\n <NavigationMenuVerticalAccordionContext.Provider\n value={{ triggerRef, setTriggerRef }}\n >\n {children}\n </NavigationMenuVerticalAccordionContext.Provider>\n )\n}\n\ntype TNavigationMenuVerticalAccordionProps = React.ComponentProps<typeof Root> &\n React.ComponentProps<typeof NavigationMenuVerticalItem>\nexport const NavigationMenuVerticalAccordion = ({\n defaultOpen,\n open,\n onOpenChange,\n disabled,\n ...rest\n}: TNavigationMenuVerticalAccordionProps): JSX.Element => {\n const collapsibleProps = { defaultOpen, open, onOpenChange, disabled }\n return (\n <NavigationMenuVerticalAccordionProvider>\n <Root {...collapsibleProps} asChild>\n <NavigationMenuVerticalItem {...rest} />\n </Root>\n </NavigationMenuVerticalAccordionProvider>\n )\n}\n"],"mappings":";;;;;AAWA,IAAa,yCACX,QAAM,cAA4D,CAAC,CAAC;AACtE,IAAM,2CAA2C,EAAE,eAAe;CAChE,MAAM,CAAC,YAAY,iBAAiB,eAAe;CACnD,OACE,wBAAA,cAAC,uCAAuC,UAAxC,EACE,OAAO;EAAE;EAAY;CAAc,EAGY,GAD9C,QAC8C;AAErD;AAIA,IAAa,mCAAmC,EAC9C,aACA,MACA,cACA,UACA,GAAG,WACqD;CACxD,MAAM,mBAAmB;EAAE;EAAa;EAAM;EAAc;CAAS;CACrE,OACE,wBAAA,cAAC,yCAAA,MACC,wBAAA,cAAC,MAAD;EAAM,GAAI;EAAkB,SAAA;CAEtB,GADJ,wBAAA,cAAC,4BAA+B,IAAO,CACnC,CACiC;AAE7C"}
|
package/dist/components/navigation-menu-vertical/NavigationMenuVerticalAccordionContent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenuVerticalAccordionContent.js","names":[],"sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalAccordionContent.tsx"],"sourcesContent":["import { Content } from '@radix-ui/react-collapsible'\nimport React from 'react'\n\nimport { NavigationMenuVerticalAccordionContext } from './NavigationMenuVerticalAccordion'\nimport { NavigationMenuVerticalList } from './NavigationMenuVerticalList'\n\nconst StyledNavigationMenuVerticalAccordionContent = Content\n\ntype TNavigationMenuVerticalAccordionContentProps = React.ComponentProps<\n typeof StyledNavigationMenuVerticalAccordionContent\n> &\n React.ComponentProps<typeof NavigationMenuVerticalList>\n\nexport const NavigationMenuVerticalAccordionContent = ({\n children,\n ...rest\n}: TNavigationMenuVerticalAccordionContentProps): JSX.Element => {\n const { triggerRef } = React.useContext(\n NavigationMenuVerticalAccordionContext\n )\n\n const handleOnKeydown = (e) => {\n if (!triggerRef?.current) return\n if (e.key === 'Escape') {\n e.stopPropagation()\n e.preventDefault()\n triggerRef.current.focus()\n triggerRef.current.click()\n }\n }\n\n return (\n <StyledNavigationMenuVerticalAccordionContent\n onKeyDown={handleOnKeydown}\n {...rest}\n >\n <NavigationMenuVerticalList>{children}</NavigationMenuVerticalList>\n </StyledNavigationMenuVerticalAccordionContent>\n )\n}\n"],"mappings":";;;;;AAMA,IAAM,+CAA+C;AAOrD,IAAa,0CAA0C,EACrD,UACA,GAAG,WAC4D;CAC/D,MAAM,EAAE,eAAe,MAAM,WAC3B,
|
|
1
|
+
{"version":3,"file":"NavigationMenuVerticalAccordionContent.js","names":[],"sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalAccordionContent.tsx"],"sourcesContent":["import { Content } from '@radix-ui/react-collapsible'\nimport React from 'react'\n\nimport { NavigationMenuVerticalAccordionContext } from './NavigationMenuVerticalAccordion'\nimport { NavigationMenuVerticalList } from './NavigationMenuVerticalList'\n\nconst StyledNavigationMenuVerticalAccordionContent = Content\n\ntype TNavigationMenuVerticalAccordionContentProps = React.ComponentProps<\n typeof StyledNavigationMenuVerticalAccordionContent\n> &\n React.ComponentProps<typeof NavigationMenuVerticalList>\n\nexport const NavigationMenuVerticalAccordionContent = ({\n children,\n ...rest\n}: TNavigationMenuVerticalAccordionContentProps): JSX.Element => {\n const { triggerRef } = React.useContext(\n NavigationMenuVerticalAccordionContext\n )\n\n const handleOnKeydown = (e) => {\n if (!triggerRef?.current) return\n if (e.key === 'Escape') {\n e.stopPropagation()\n e.preventDefault()\n triggerRef.current.focus()\n triggerRef.current.click()\n }\n }\n\n return (\n <StyledNavigationMenuVerticalAccordionContent\n onKeyDown={handleOnKeydown}\n {...rest}\n >\n <NavigationMenuVerticalList>{children}</NavigationMenuVerticalList>\n </StyledNavigationMenuVerticalAccordionContent>\n )\n}\n"],"mappings":";;;;;AAMA,IAAM,+CAA+C;AAOrD,IAAa,0CAA0C,EACrD,UACA,GAAG,WAC4D;CAC/D,MAAM,EAAE,eAAe,MAAM,WAC3B,sCACF;CAEA,MAAM,mBAAmB,MAAM;EAC7B,IAAI,CAAC,YAAY,SAAS;EAC1B,IAAI,EAAE,QAAQ,UAAU;GACtB,EAAE,gBAAgB;GAClB,EAAE,eAAe;GACjB,WAAW,QAAQ,MAAM;GACzB,WAAW,QAAQ,MAAM;EAC3B;CACF;CAEA,OACE,sBAAA,cAAC,8CAAD;EACE,WAAW;EACX,GAAI;CAGwC,GAD5C,sBAAA,cAAC,4BAAA,MAA4B,QAAqC,CACtB;AAElD"}
|
package/dist/components/navigation-menu-vertical/NavigationMenuVerticalAccordionTrigger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenuVerticalAccordionTrigger.js","names":[],"sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalAccordionTrigger.tsx"],"sourcesContent":["import { ChevronDown } from '@atom-learning/icons'\nimport { Trigger } from '@radix-ui/react-collapsible'\nimport { Link } from '@radix-ui/react-navigation-menu'\nimport React from 'react'\n\nimport { Icon } from '~/components/icon/Icon'\nimport { styled } from '~/styled'\n\nimport { navigationMenuVerticalItemStyles } from './NavigationMenuVertical.styles'\nimport { NavigationMenuVerticalAccordionContext } from './NavigationMenuVerticalAccordion'\nimport { NavigationMenuVerticalItemContent } from './NavigationMenuVerticalItemContent'\n\nconst StyledNavigationMenuVerticalAccordionTrigger = styled(Trigger, {\n base: navigationMenuVerticalItemStyles,\n variants: {\n size: {\n md: ['min-h-10'],\n lg: ['min-h-12']\n }\n }\n})\n\nconst StyledIcon = styled(Icon, {\n base: [\n 'transition-transform',\n 'duration-300',\n '[[data-state=open]>&]:rotate-180'\n ]\n})\n\ntype TNavigationMenuAccordionTriggerProps = React.ComponentProps<\n typeof StyledNavigationMenuVerticalAccordionTrigger\n>\n\nexport const NavigationMenuVerticalAccordionTrigger = ({\n children,\n ...rest\n}: TNavigationMenuAccordionTriggerProps) => {\n const { setTriggerRef } = React.useContext(\n NavigationMenuVerticalAccordionContext\n )\n\n return (\n <Link asChild>\n <StyledNavigationMenuVerticalAccordionTrigger size=\"lg\" {...rest} asChild>\n <button\n type=\"button\"\n className=\"flex items-center justify-between gap-3\"\n ref={setTriggerRef}\n >\n <NavigationMenuVerticalItemContent>\n {children}\n </NavigationMenuVerticalItemContent>\n <StyledIcon size=\"sm\" is={ChevronDown} />\n </button>\n </StyledNavigationMenuVerticalAccordionTrigger>\n </Link>\n )\n}\n"],"mappings":";;;;;;;;;;AAYA,IAAM,+CAA+C,OAAO,SAAS;CACnE,MAAM;CACN,UAAU,EACR,MAAM;EACJ,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"NavigationMenuVerticalAccordionTrigger.js","names":[],"sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalAccordionTrigger.tsx"],"sourcesContent":["import { ChevronDown } from '@atom-learning/icons'\nimport { Trigger } from '@radix-ui/react-collapsible'\nimport { Link } from '@radix-ui/react-navigation-menu'\nimport React from 'react'\n\nimport { Icon } from '~/components/icon/Icon'\nimport { styled } from '~/styled'\n\nimport { navigationMenuVerticalItemStyles } from './NavigationMenuVertical.styles'\nimport { NavigationMenuVerticalAccordionContext } from './NavigationMenuVerticalAccordion'\nimport { NavigationMenuVerticalItemContent } from './NavigationMenuVerticalItemContent'\n\nconst StyledNavigationMenuVerticalAccordionTrigger = styled(Trigger, {\n base: navigationMenuVerticalItemStyles,\n variants: {\n size: {\n md: ['min-h-10'],\n lg: ['min-h-12']\n }\n }\n})\n\nconst StyledIcon = styled(Icon, {\n base: [\n 'transition-transform',\n 'duration-300',\n '[[data-state=open]>&]:rotate-180'\n ]\n})\n\ntype TNavigationMenuAccordionTriggerProps = React.ComponentProps<\n typeof StyledNavigationMenuVerticalAccordionTrigger\n>\n\nexport const NavigationMenuVerticalAccordionTrigger = ({\n children,\n ...rest\n}: TNavigationMenuAccordionTriggerProps) => {\n const { setTriggerRef } = React.useContext(\n NavigationMenuVerticalAccordionContext\n )\n\n return (\n <Link asChild>\n <StyledNavigationMenuVerticalAccordionTrigger size=\"lg\" {...rest} asChild>\n <button\n type=\"button\"\n className=\"flex items-center justify-between gap-3\"\n ref={setTriggerRef}\n >\n <NavigationMenuVerticalItemContent>\n {children}\n </NavigationMenuVerticalItemContent>\n <StyledIcon size=\"sm\" is={ChevronDown} />\n </button>\n </StyledNavigationMenuVerticalAccordionTrigger>\n </Link>\n )\n}\n"],"mappings":";;;;;;;;;;AAYA,IAAM,+CAA+C,OAAO,SAAS;CACnE,MAAM;CACN,UAAU,EACR,MAAM;EACJ,IAAI,CAAC,UAAU;EACf,IAAI,CAAC,UAAU;CACjB,EACF;AACF,CAAC;AAED,IAAM,aAAa,OAAO,MAAM,EAC9B,MAAM;CACJ;CACA;CACA;AACF,EACF,CAAC;AAMD,IAAa,0CAA0C,EACrD,UACA,GAAG,WACuC;CAC1C,MAAM,EAAE,kBAAkB,MAAM,WAC9B,sCACF;CAEA,OACE,sBAAA,cAAC,MAAD,EAAM,SAAA,KAaA,GAZJ,sBAAA,cAAC,8CAAD;EAA8C,MAAK;EAAK,GAAI;EAAM,SAAA;CAWpB,GAV5C,sBAAA,cAAC,UAAD;EACE,MAAK;EACL,WAAU;EACV,KAAK;CAMC,GAJN,sBAAA,cAAC,mCAAA,MACE,QACgC,GACnC,sBAAA,cAAC,YAAD;EAAY,MAAK;EAAK,IAAI;CAAc,CAAA,CAClC,CACoC,CAC1C;AAEV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenuVerticalIcon.js","names":[],"sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalIcon.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Icon } from '~/components/icon/Icon'\nimport { styled } from '~/styled'\n\nconst StyledNavigationMenuVerticalIcon = styled(Icon, {\n base: ['self-start']\n})\n\nexport const NavigationMenuVerticalIcon = (\n props: React.ComponentProps<typeof StyledNavigationMenuVerticalIcon>\n): JSX.Element => <StyledNavigationMenuVerticalIcon size=\"md\" {...props} />\n"],"mappings":";;;;AAKA,IAAM,mCAAmC,OAAO,MAAM,EACpD,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"NavigationMenuVerticalIcon.js","names":[],"sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalIcon.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Icon } from '~/components/icon/Icon'\nimport { styled } from '~/styled'\n\nconst StyledNavigationMenuVerticalIcon = styled(Icon, {\n base: ['self-start']\n})\n\nexport const NavigationMenuVerticalIcon = (\n props: React.ComponentProps<typeof StyledNavigationMenuVerticalIcon>\n): JSX.Element => <StyledNavigationMenuVerticalIcon size=\"md\" {...props} />\n"],"mappings":";;;;AAKA,IAAM,mCAAmC,OAAO,MAAM,EACpD,MAAM,CAAC,YAAY,EACrB,CAAC;AAED,IAAa,8BACX,UACgB,wBAAA,cAAC,kCAAD;CAAkC,MAAK;CAAK,GAAI;AAAQ,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenuVerticalItem.js","names":[],"sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalItem.tsx"],"sourcesContent":["import { Item } from '@radix-ui/react-navigation-menu'\nimport React from 'react'\n\nimport { cn } from '~/styled'\n\n/*\n * (!)\n * NavigationMenu vertical behaviour was buggy so had to build the\n * opening/closing nested Content(Accordion) based on `Collapsible` instead.\n * This means that the `value` prop does nothing, so removing it from typescript\n */\ntype TNavigationMenuVerticalItemProps = Omit<\n React.ComponentProps<typeof Item>,\n 'value'\n>\n\nexport const NavigationMenuVerticalItem = (\n props: TNavigationMenuVerticalItemProps\n): JSX.Element => (\n <Item\n className={cn(\n '[ul_li_&]:[--navigation-menu-vertical-item-pl:--spacing(8)]',\n '[ul_li_&_&]:[--navigation-menu-vertical-item-pl:--spacing(12)]',\n '[ul_li_&_&_&]:[--navigation-menu-vertical-item-pl:--spacing(16)]'\n )}\n {...props}\n />\n)\n"],"mappings":";;;;AAgBA,IAAa,8BACX,UAEA,sBAAA,cAAC,MAAD;CACE,WAAW,GACT,+DACA,kEACA,
|
|
1
|
+
{"version":3,"file":"NavigationMenuVerticalItem.js","names":[],"sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalItem.tsx"],"sourcesContent":["import { Item } from '@radix-ui/react-navigation-menu'\nimport React from 'react'\n\nimport { cn } from '~/styled'\n\n/*\n * (!)\n * NavigationMenu vertical behaviour was buggy so had to build the\n * opening/closing nested Content(Accordion) based on `Collapsible` instead.\n * This means that the `value` prop does nothing, so removing it from typescript\n */\ntype TNavigationMenuVerticalItemProps = Omit<\n React.ComponentProps<typeof Item>,\n 'value'\n>\n\nexport const NavigationMenuVerticalItem = (\n props: TNavigationMenuVerticalItemProps\n): JSX.Element => (\n <Item\n className={cn(\n '[ul_li_&]:[--navigation-menu-vertical-item-pl:--spacing(8)]',\n '[ul_li_&_&]:[--navigation-menu-vertical-item-pl:--spacing(12)]',\n '[ul_li_&_&_&]:[--navigation-menu-vertical-item-pl:--spacing(16)]'\n )}\n {...props}\n />\n)\n"],"mappings":";;;;AAgBA,IAAa,8BACX,UAEA,sBAAA,cAAC,MAAD;CACE,WAAW,GACT,+DACA,kEACA,kEACF;CACA,GAAI;AACL,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenuVerticalItemContent.js","names":[],"sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalItemContent.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Icon } from '~/components/icon/Icon'\nimport { cn } from '~/styled'\n\nimport { NavigationMenuVerticalIcon } from './NavigationMenuVerticalIcon'\nimport { NavigationMenuVerticalText } from './NavigationMenuVerticalText'\n\ntype TNavigationMenuVerticalItemContentProps = React.ComponentProps<'div'>\n\nexport const NavigationMenuVerticalItemContent = ({\n children,\n className,\n ...rest\n}: TNavigationMenuVerticalItemContentProps): JSX.Element => (\n <div className={cn('flex', 'gap-2', 'items-center', className)} {...rest}>\n {\n React.Children.map(children, (child) => {\n if (typeof child === 'string' || typeof child === 'number') {\n return (\n <NavigationMenuVerticalText>{child}</NavigationMenuVerticalText>\n )\n }\n if (React.isValidElement(child) && child.type === Icon) {\n return <NavigationMenuVerticalIcon {...child.props} />\n }\n return child\n }) as React.ReactElement[]\n }\n </div>\n)\n"],"mappings":";;;;;;AAUA,IAAa,qCAAqC,EAChD,UACA,WACA,GAAG,WAEH,wBAAA,cAAC,OAAD;CAAK,WAAW,GAAG,QAAQ,SAAS,gBAAgB,
|
|
1
|
+
{"version":3,"file":"NavigationMenuVerticalItemContent.js","names":[],"sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalItemContent.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Icon } from '~/components/icon/Icon'\nimport { cn } from '~/styled'\n\nimport { NavigationMenuVerticalIcon } from './NavigationMenuVerticalIcon'\nimport { NavigationMenuVerticalText } from './NavigationMenuVerticalText'\n\ntype TNavigationMenuVerticalItemContentProps = React.ComponentProps<'div'>\n\nexport const NavigationMenuVerticalItemContent = ({\n children,\n className,\n ...rest\n}: TNavigationMenuVerticalItemContentProps): JSX.Element => (\n <div className={cn('flex', 'gap-2', 'items-center', className)} {...rest}>\n {\n React.Children.map(children, (child) => {\n if (typeof child === 'string' || typeof child === 'number') {\n return (\n <NavigationMenuVerticalText>{child}</NavigationMenuVerticalText>\n )\n }\n if (React.isValidElement(child) && child.type === Icon) {\n return <NavigationMenuVerticalIcon {...child.props} />\n }\n return child\n }) as React.ReactElement[]\n }\n </div>\n)\n"],"mappings":";;;;;;AAUA,IAAa,qCAAqC,EAChD,UACA,WACA,GAAG,WAEH,wBAAA,cAAC,OAAD;CAAK,WAAW,GAAG,QAAQ,SAAS,gBAAgB,SAAS;CAAG,GAAI;AAc/D,GAZD,QAAM,SAAS,IAAI,WAAW,UAAU;CACtC,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,UAChD,OACE,wBAAA,cAAC,4BAAA,MAA4B,KAAkC;CAGnE,IAAI,QAAM,eAAe,KAAK,KAAK,MAAM,SAAS,MAChD,OAAO,wBAAA,cAAC,4BAA+B,MAAM,KAAQ;CAEvD,OAAO;AACT,CAAC,CAEA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenuVerticalLink.js","names":[],"sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalLink.tsx"],"sourcesContent":["import { Link } from '@radix-ui/react-navigation-menu'\nimport React from 'react'\n\nimport { styled } from '~/styled'\nimport { preventEvent } from '~/utilities/event/preventEvent'\nimport { getExternalAnchorProps } from '~/utilities/uri'\n\nimport { useRouterLinkProps } from '../router-provider/RouterProvider'\nimport { navigationMenuVerticalItemStyles } from './NavigationMenuVertical.styles'\nimport { NavigationMenuVerticalItem } from './NavigationMenuVerticalItem'\nimport { NavigationMenuVerticalItemContent } from './NavigationMenuVerticalItemContent'\n\nconst StyledNavigationMenuVerticalLink = styled(Link, {\n base: navigationMenuVerticalItemStyles,\n variants: {\n size: {\n md: ['min-h-10'],\n lg: ['min-h-12']\n }\n }\n})\n\ntype NavigationMenuVerticalItemProps = React.ComponentProps<\n typeof StyledNavigationMenuVerticalLink\n> & { reloadDocument?: boolean }\n\nexport const NavigationMenuVerticalLink = ({\n as,\n href,\n children,\n reloadDocument,\n ...rest\n}: NavigationMenuVerticalItemProps) => {\n const routerLinkProps = useRouterLinkProps(href, { reloadDocument })\n const Component = (as ||\n routerLinkProps.as ||\n (href ? 'a' : 'button')) as React.ElementType\n const componentProps =\n as || routerLinkProps.as\n ? {}\n : href\n ? getExternalAnchorProps(href)\n : { type: 'button' }\n\n return (\n <NavigationMenuVerticalItem>\n <StyledNavigationMenuVerticalLink\n size=\"lg\"\n href={href}\n {...rest}\n {...componentProps}\n onSelect={preventEvent}\n asChild // ?: Can't use `as` for this as we lose `data-active` etc. attributes when we try to. Using `asChild` and `Component` as a workaround.\n >\n <Component>\n <NavigationMenuVerticalItemContent>\n {children}\n </NavigationMenuVerticalItemContent>\n </Component>\n </StyledNavigationMenuVerticalLink>\n </NavigationMenuVerticalItem>\n )\n}\n"],"mappings":";;;;;;;;;;AAYA,IAAM,mCAAmC,OAAO,MAAM;CACpD,MAAM;CACN,UAAU,EACR,MAAM;EACJ,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"NavigationMenuVerticalLink.js","names":[],"sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalLink.tsx"],"sourcesContent":["import { Link } from '@radix-ui/react-navigation-menu'\nimport React from 'react'\n\nimport { styled } from '~/styled'\nimport { preventEvent } from '~/utilities/event/preventEvent'\nimport { getExternalAnchorProps } from '~/utilities/uri'\n\nimport { useRouterLinkProps } from '../router-provider/RouterProvider'\nimport { navigationMenuVerticalItemStyles } from './NavigationMenuVertical.styles'\nimport { NavigationMenuVerticalItem } from './NavigationMenuVerticalItem'\nimport { NavigationMenuVerticalItemContent } from './NavigationMenuVerticalItemContent'\n\nconst StyledNavigationMenuVerticalLink = styled(Link, {\n base: navigationMenuVerticalItemStyles,\n variants: {\n size: {\n md: ['min-h-10'],\n lg: ['min-h-12']\n }\n }\n})\n\ntype NavigationMenuVerticalItemProps = React.ComponentProps<\n typeof StyledNavigationMenuVerticalLink\n> & { reloadDocument?: boolean }\n\nexport const NavigationMenuVerticalLink = ({\n as,\n href,\n children,\n reloadDocument,\n ...rest\n}: NavigationMenuVerticalItemProps) => {\n const routerLinkProps = useRouterLinkProps(href, { reloadDocument })\n const Component = (as ||\n routerLinkProps.as ||\n (href ? 'a' : 'button')) as React.ElementType\n const componentProps =\n as || routerLinkProps.as\n ? {}\n : href\n ? getExternalAnchorProps(href)\n : { type: 'button' }\n\n return (\n <NavigationMenuVerticalItem>\n <StyledNavigationMenuVerticalLink\n size=\"lg\"\n href={href}\n {...rest}\n {...componentProps}\n onSelect={preventEvent}\n asChild // ?: Can't use `as` for this as we lose `data-active` etc. attributes when we try to. Using `asChild` and `Component` as a workaround.\n >\n <Component>\n <NavigationMenuVerticalItemContent>\n {children}\n </NavigationMenuVerticalItemContent>\n </Component>\n </StyledNavigationMenuVerticalLink>\n </NavigationMenuVerticalItem>\n )\n}\n"],"mappings":";;;;;;;;;;AAYA,IAAM,mCAAmC,OAAO,MAAM;CACpD,MAAM;CACN,UAAU,EACR,MAAM;EACJ,IAAI,CAAC,UAAU;EACf,IAAI,CAAC,UAAU;CACjB,EACF;AACF,CAAC;AAMD,IAAa,8BAA8B,EACzC,IACA,MACA,UACA,gBACA,GAAG,WACkC;CACrC,MAAM,kBAAkB,mBAAmB,MAAM,EAAE,eAAe,CAAC;CACnE,MAAM,YAAa,MACjB,gBAAgB,OACf,OAAO,MAAM;CAChB,MAAM,iBACJ,MAAM,gBAAgB,KAClB,CAAC,IACD,OACE,uBAAuB,IAAI,IAC3B,EAAE,MAAM,SAAS;CAEzB,OACE,sBAAA,cAAC,4BAAA,MACC,sBAAA,cAAC,kCAAD;EACE,MAAK;EACC;EACN,GAAI;EACJ,GAAI;EACJ,UAAU;EACV,SAAA;CAOgC,GALhC,sBAAA,cAAC,WAAA,MACC,sBAAA,cAAC,mCAAA,MACE,QACgC,CAC1B,CACqB,CACR;AAEhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenuVerticalList.js","names":[],"sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalList.tsx"],"sourcesContent":["import { List } from '@radix-ui/react-navigation-menu'\n\nimport { styled } from '~/styled'\n\nconst StyledList = styled(List, {\n base: [\n '[--navigation-menu-vertical-item-pl:--spacing(4)]',\n '*:not-first:mt-0.5'\n ]\n})\n\nexport const NavigationMenuVerticalList = StyledList\n"],"mappings":";;AAWA,IAAa,6BAPM,OAAO,MAAM,EAC9B,MAAM,CACJ,qDACA,
|
|
1
|
+
{"version":3,"file":"NavigationMenuVerticalList.js","names":[],"sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalList.tsx"],"sourcesContent":["import { List } from '@radix-ui/react-navigation-menu'\n\nimport { styled } from '~/styled'\n\nconst StyledList = styled(List, {\n base: [\n '[--navigation-menu-vertical-item-pl:--spacing(4)]',\n '*:not-first:mt-0.5'\n ]\n})\n\nexport const NavigationMenuVerticalList = StyledList\n"],"mappings":";;AAWA,IAAa,6BAPM,OAAO,MAAM,EAC9B,MAAM,CACJ,qDACA,oBACF,EACF,CAE0C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenuVerticalText.js","names":[],"sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalText.tsx"],"sourcesContent":["import React from 'react'\n\nimport { Text } from '~/components/text/Text'\nimport { styled } from '~/styled'\n\nimport { useSidebarState } from '../side-bar/SideBarContext'\n\nconst StyledNavigationMenuVerticalText = styled(Text, {\n base: [\n 'font-(--navigation-menu-vertical-item-font-weight)',\n 'w-max',\n 'max-w-40',\n 'text-left',\n 'motion-safe:duration-125',\n 'motion-safe:ease-out',\n 'motion-safe:transition-[opacity,translate]'\n ],\n variants: {\n isExpanded: {\n true: ['opacity-100', 'motion-safe:translate-0'],\n false: ['opacity-0', 'motion-safe:translate-x-2']\n }\n }\n})\n\ntype TStyledNavigationMenuVerticalTextProps = React.ComponentProps<\n typeof StyledNavigationMenuVerticalText\n>\n\nexport const NavigationMenuVerticalText = (\n props: TStyledNavigationMenuVerticalTextProps\n): JSX.Element => {\n const { isExpanded } = useSidebarState()\n\n return (\n <StyledNavigationMenuVerticalText\n size=\"md\"\n as=\"span\"\n {...props}\n isExpanded={isExpanded}\n />\n )\n}\n"],"mappings":";;;;;AAOA,IAAM,mCAAmC,OAAO,MAAM;CACpD,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;
|
|
1
|
+
{"version":3,"file":"NavigationMenuVerticalText.js","names":[],"sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalText.tsx"],"sourcesContent":["import React from 'react'\n\nimport { Text } from '~/components/text/Text'\nimport { styled } from '~/styled'\n\nimport { useSidebarState } from '../side-bar/SideBarContext'\n\nconst StyledNavigationMenuVerticalText = styled(Text, {\n base: [\n 'font-(--navigation-menu-vertical-item-font-weight)',\n 'w-max',\n 'max-w-40',\n 'text-left',\n 'motion-safe:duration-125',\n 'motion-safe:ease-out',\n 'motion-safe:transition-[opacity,translate]'\n ],\n variants: {\n isExpanded: {\n true: ['opacity-100', 'motion-safe:translate-0'],\n false: ['opacity-0', 'motion-safe:translate-x-2']\n }\n }\n})\n\ntype TStyledNavigationMenuVerticalTextProps = React.ComponentProps<\n typeof StyledNavigationMenuVerticalText\n>\n\nexport const NavigationMenuVerticalText = (\n props: TStyledNavigationMenuVerticalTextProps\n): JSX.Element => {\n const { isExpanded } = useSidebarState()\n\n return (\n <StyledNavigationMenuVerticalText\n size=\"md\"\n as=\"span\"\n {...props}\n isExpanded={isExpanded}\n />\n )\n}\n"],"mappings":";;;;;AAOA,IAAM,mCAAmC,OAAO,MAAM;CACpD,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,UAAU,EACR,YAAY;EACV,MAAM,CAAC,eAAe,yBAAyB;EAC/C,OAAO,CAAC,aAAa,2BAA2B;CAClD,EACF;AACF,CAAC;AAMD,IAAa,8BACX,UACgB;CAChB,MAAM,EAAE,eAAe,gBAAgB;CAEvC,OACE,sBAAA,cAAC,kCAAD;EACE,MAAK;EACL,IAAG;EACH,GAAI;EACQ;CACb,CAAA;AAEL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationBadge.js","names":[],"sources":["../../../src/components/notification-badge/NotificationBadge.tsx"],"sourcesContent":["import React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { Badge } from '../badge/Badge'\nimport { Icon } from '../icon/Icon'\n\nconst StyledBadge = styled(Badge, {\n base: [\n 'font-body',\n 'text-sm',\n 'flex-row',\n 'justify-center',\n 'absolute',\n 'top-0',\n 'right-0',\n 'translate-x-3',\n '-translate-y-1/2',\n 'rounded-full',\n 'h-6',\n 'min-w-6',\n 'text-center'\n ]\n})\n\ntype BadgeProps = React.ComponentProps<typeof Badge>\n\ntype NotificationBadgeProps = {\n value: number | string\n emphasis?: BadgeProps['emphasis']\n theme?: BadgeProps['theme']\n icon?: React.FC<React.SVGProps<SVGSVGElement>>\n}\n\nexport const NotificationBadge = ({\n value,\n emphasis = 'bold',\n theme = 'primary',\n icon,\n children\n}: React.PropsWithChildren<NotificationBadgeProps>) => (\n <div className=\"relative\">\n {!!value && (\n <StyledBadge role=\"status\" emphasis={emphasis} theme={theme}>\n {icon && <Icon is={icon} role=\"img\" aria-hidden=\"false\" />}\n {value}\n </StyledBadge>\n )}\n {children}\n </div>\n)\n"],"mappings":";;;;;AAOA,IAAM,cAAc,OAAO,OAAO,EAChC,MAAM;CACJ;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;
|
|
1
|
+
{"version":3,"file":"NotificationBadge.js","names":[],"sources":["../../../src/components/notification-badge/NotificationBadge.tsx"],"sourcesContent":["import React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { Badge } from '../badge/Badge'\nimport { Icon } from '../icon/Icon'\n\nconst StyledBadge = styled(Badge, {\n base: [\n 'font-body',\n 'text-sm',\n 'flex-row',\n 'justify-center',\n 'absolute',\n 'top-0',\n 'right-0',\n 'translate-x-3',\n '-translate-y-1/2',\n 'rounded-full',\n 'h-6',\n 'min-w-6',\n 'text-center'\n ]\n})\n\ntype BadgeProps = React.ComponentProps<typeof Badge>\n\ntype NotificationBadgeProps = {\n value: number | string\n emphasis?: BadgeProps['emphasis']\n theme?: BadgeProps['theme']\n icon?: React.FC<React.SVGProps<SVGSVGElement>>\n}\n\nexport const NotificationBadge = ({\n value,\n emphasis = 'bold',\n theme = 'primary',\n icon,\n children\n}: React.PropsWithChildren<NotificationBadgeProps>) => (\n <div className=\"relative\">\n {!!value && (\n <StyledBadge role=\"status\" emphasis={emphasis} theme={theme}>\n {icon && <Icon is={icon} role=\"img\" aria-hidden=\"false\" />}\n {value}\n </StyledBadge>\n )}\n {children}\n </div>\n)\n"],"mappings":";;;;;AAOA,IAAM,cAAc,OAAO,OAAO,EAChC,MAAM;CACJ;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,EACF,CAAC;AAWD,IAAa,qBAAqB,EAChC,OACA,WAAW,QACX,QAAQ,WACR,MACA,eAEA,sBAAA,cAAC,OAAD,EAAK,WAAU,WAQV,GAPF,CAAC,CAAC,SACD,sBAAA,cAAC,aAAD;CAAa,MAAK;CAAmB;CAAiB;AAGzC,GAFV,QAAQ,sBAAA,cAAC,MAAD;CAAM,IAAI;CAAM,MAAK;CAAM,eAAY;AAAS,CAAA,GACxD,KACU,GAEd,QACE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInput.js","names":[],"sources":["../../../src/components/number-input/NumberInput.tsx"],"sourcesContent":["import { Minus, Plus } from '@atom-learning/icons'\nimport * as React from 'react'\n\nimport { styled } from '~/styled'\nimport { cn } from '~/styled'\nimport { getFieldIconSize } from '~/utilities/style/get-icon-size'\n\nimport { Input } from '../input/Input'\nimport { NumberInputStepper } from './NumberInputStepper'\n\nexport interface NumberInputProps {\n name: string\n min?: number\n max?: number\n step?: number\n value?: number\n defaultValue?: number\n disabled?: boolean\n readonly?: boolean\n size?: 'sm' | 'md' | 'lg'\n appearance?: 'standard' | 'modern'\n theme?: 'white' | 'grey'\n emphasis?: 'bold'\n onValueChange?: (value: number) => void\n stepperButtonLabels?: { increment?: string; decrement?: string }\n disabledTooltipContent?: { increment?: string; decrement?: string }\n className?: string\n}\n\nconst NumberInputContainer = styled('div', {\n base: ['flex'],\n variants: {\n appearance: {\n standard: [],\n modern: ['gap-px']\n },\n emphasis: {\n bold: ['gap-0']\n }\n }\n})\n\nexport const NumberInput = React.forwardRef<HTMLInputElement, NumberInputProps>(\n (\n {\n value,\n defaultValue = 0,\n onValueChange,\n min = 0,\n max = Number.MAX_SAFE_INTEGER,\n step = 1,\n disabled: isDisabled = false,\n readonly: isReadOnly = false,\n size = 'md',\n stepperButtonLabels: stepperButtonLabelsProp,\n disabledTooltipContent: disabledTooltipContentProp,\n className,\n appearance = 'standard',\n theme,\n emphasis,\n ...rest\n },\n ref\n ): JSX.Element => {\n const [internalValue, setInternalValue] = React.useState<number>(\n value || defaultValue\n )\n React.useEffect(() => {\n // Update the internal value to match what is passed in.\n if (typeof value !== 'undefined') setInternalValue(value)\n }, [value])\n\n const inputRef = React.useRef<HTMLInputElement | null>(null)\n\n React.useImperativeHandle(ref, () => inputRef.current as HTMLInputElement)\n\n const iconSize = React.useMemo(() => getFieldIconSize(size), [size])\n\n const stepperButtonLabels = {\n increment: 'increment',\n decrement: 'decrement',\n ...stepperButtonLabelsProp\n }\n\n const disabledTooltipContent = {\n decrement: `Cannot enter values below ${min}`,\n increment: `Cannot enter values above ${max}`,\n ...disabledTooltipContentProp\n }\n\n const isAtMax = internalValue >= max\n const isAtMin = internalValue <= min\n\n const clamp = React.useCallback(\n (internalValue: number) => Math.min(Math.max(internalValue, min), max),\n [max, min]\n )\n\n const updateValue = React.useCallback(\n (newValue: number) => {\n onValueChange?.(newValue)\n setInternalValue(newValue)\n },\n [onValueChange]\n )\n\n const onInputChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const parsedValue = Number(event.target.value.replace(/\\D/g, ''))\n updateValue(parsedValue)\n },\n [updateValue]\n )\n\n const increment = React.useCallback(() => {\n if (isAtMax || isReadOnly) return\n inputRef?.current?.focus()\n const newValue = Number(internalValue) + step\n updateValue(clamp(newValue))\n }, [clamp, isAtMax, isReadOnly, step, updateValue, internalValue])\n\n const decrement = React.useCallback(() => {\n if (isAtMin || isReadOnly) return\n inputRef?.current?.focus()\n const newValue = Number(internalValue) - step\n updateValue(clamp(newValue))\n }, [clamp, isAtMin, isReadOnly, min, step, updateValue, internalValue])\n\n const onKeyDown = React.useCallback(\n (event: React.KeyboardEvent) => {\n if (event.nativeEvent.isComposing) return\n\n /**\n * Keyboard Accessibility\n *\n * We want to increase or decrease the input's value\n * based on if the user the arrow keys.\n *\n * @see https://www.w3.org/TR/wai-aria-practices-1.1/#keyboard-interaction-17\n */\n const eventKey = event.key\n\n const keyMap: Record<string, React.KeyboardEventHandler> = {\n ArrowUp: increment,\n ArrowRight: increment,\n ArrowDown: decrement,\n ArrowLeft: decrement,\n Home: () => updateValue(min),\n End: () => updateValue(max)\n }\n\n const action = keyMap[eventKey]\n\n if (action) {\n event.preventDefault()\n action(event)\n }\n },\n [increment, decrement, updateValue, min, max]\n )\n\n const hasError = internalValue < min || internalValue > max\n const {\n state: externalState,\n 'aria-invalid': externalAriaInvalid,\n ...restProps\n } = rest as { state?: 'error'; 'aria-invalid'?: boolean } & typeof rest\n\n const inputProps: React.ComponentProps<typeof Input> = {\n type: 'number',\n value: internalValue,\n ...restProps,\n onChange: onInputChange,\n onKeyDown,\n size,\n appearance,\n theme,\n state: externalState || (hasError ? 'error' : undefined),\n 'aria-invalid': externalAriaInvalid || hasError || undefined,\n className: cn(\n 'rounded-none',\n 'w-16',\n '[&_>_input]:text-center',\n 'disabled:opacity-30',\n 'disabled:pointer-events-none',\n emphasis === 'bold' && [\n 'rounded-1',\n '[&_>_input[aria-invalid=true]]:text-danger',\n 'focus-within:[&_>_input]:text-grey-1000'\n ],\n emphasis === 'bold' &&\n appearance === 'standard' && [\n 'border-none',\n '[&:has([aria-invalid=true])]:border-2',\n '[&:has([aria-invalid=true])]:border-danger',\n 'focus-within:border-2',\n 'focus-within:border-blue-800'\n ]\n ),\n ref: inputRef,\n readOnly: isReadOnly,\n disabled: isDisabled,\n 'aria-valuemin': min,\n 'aria-valuemax': max,\n 'aria-valuenow': internalValue,\n role: 'spinbutton'\n }\n\n return (\n <NumberInputContainer\n appearance={appearance}\n emphasis={emphasis}\n className={className}\n >\n <NumberInputStepper\n onClick={decrement}\n icon={Minus}\n className={cn(emphasis !== 'bold' && 'border-r-none rounded-r-none')}\n size={iconSize}\n fieldAppearance={appearance}\n fieldTheme={theme}\n emphasis={emphasis}\n disabled={isAtMin || isDisabled}\n showTooltip={isAtMin && !isDisabled}\n disabledTooltipContent={disabledTooltipContent.decrement}\n label={stepperButtonLabels.decrement}\n />\n <Input {...inputProps} />\n <NumberInputStepper\n onClick={increment}\n icon={Plus}\n className={cn(emphasis !== 'bold' && 'border-l-none rounded-l-none')}\n size={iconSize}\n fieldAppearance={appearance}\n fieldTheme={theme}\n emphasis={emphasis}\n disabled={isAtMax || isDisabled}\n showTooltip={isAtMax && !isDisabled}\n disabledTooltipContent={disabledTooltipContent.increment}\n label={stepperButtonLabels.increment}\n />\n </NumberInputContainer>\n )\n }\n)\n\nNumberInput.displayName = 'NumberInput'\n"],"mappings":";;;;;;;AA6BA,IAAM,uBAAuB,OAAO,OAAO;CACzC,MAAM,CAAC,OAAO;CACd,UAAU;EACR,YAAY;GACV,UAAU,EAAE;GACZ,QAAQ,CAAC,SAAS;GACnB;EACD,UAAU,EACR,MAAM,CAAC,QAAQ,EAChB;EACF;CACF,CAAC;AAEF,IAAa,cAAc,QAAM,YAE7B,EACE,OACA,eAAe,GACf,eACA,MAAM,GACN,MAAM,OAAO,kBACb,OAAO,GACP,UAAU,aAAa,OACvB,UAAU,aAAa,OACvB,OAAO,MACP,qBAAqB,yBACrB,wBAAwB,4BACxB,WACA,aAAa,YACb,OACA,UACA,GAAG,QAEL,QACgB;CAChB,MAAM,CAAC,eAAe,oBAAoB,QAAM,SAC9C,SAAS,aACV;AACD,SAAM,gBAAgB;AAEpB,MAAI,OAAO,UAAU,YAAa,kBAAiB,MAAM;IACxD,CAAC,MAAM,CAAC;CAEX,MAAM,WAAW,QAAM,OAAgC,KAAK;AAE5D,SAAM,oBAAoB,WAAW,SAAS,QAA4B;CAE1E,MAAM,WAAW,QAAM,cAAc,iBAAiB,KAAK,EAAE,CAAC,KAAK,CAAC;CAEpE,MAAM,sBAAsB;EAC1B,WAAW;EACX,WAAW;EACX,GAAG;EACJ;CAED,MAAM,yBAAyB;EAC7B,WAAW,6BAA6B;EACxC,WAAW,6BAA6B;EACxC,GAAG;EACJ;CAED,MAAM,UAAU,iBAAiB;CACjC,MAAM,UAAU,iBAAiB;CAEjC,MAAM,QAAQ,QAAM,aACjB,kBAA0B,KAAK,IAAI,KAAK,IAAI,eAAe,IAAI,EAAE,IAAI,EACtE,CAAC,KAAK,IAAI,CACX;CAED,MAAM,cAAc,QAAM,aACvB,aAAqB;AACpB,kBAAgB,SAAS;AACzB,mBAAiB,SAAS;IAE5B,CAAC,cAAc,CAChB;CAED,MAAM,gBAAgB,QAAM,aACzB,UAA+C;AAE9C,cADoB,OAAO,MAAM,OAAO,MAAM,QAAQ,OAAO,GAAG,CAAC,CACzC;IAE1B,CAAC,YAAY,CACd;CAED,MAAM,YAAY,QAAM,kBAAkB;AACxC,MAAI,WAAW,WAAY;AAC3B,YAAU,SAAS,OAAO;AAE1B,cAAY,MADK,OAAO,cAAc,GAAG,KACd,CAAC;IAC3B;EAAC;EAAO;EAAS;EAAY;EAAM;EAAa;EAAc,CAAC;CAElE,MAAM,YAAY,QAAM,kBAAkB;AACxC,MAAI,WAAW,WAAY;AAC3B,YAAU,SAAS,OAAO;AAE1B,cAAY,MADK,OAAO,cAAc,GAAG,KACd,CAAC;IAC3B;EAAC;EAAO;EAAS;EAAY;EAAK;EAAM;EAAa;EAAc,CAAC;CAEvE,MAAM,YAAY,QAAM,aACrB,UAA+B;AAC9B,MAAI,MAAM,YAAY,YAAa;;;;;;;;;EAUnC,MAAM,WAAW,MAAM;EAWvB,MAAM,SATqD;GACzD,SAAS;GACT,YAAY;GACZ,WAAW;GACX,WAAW;GACX,YAAY,YAAY,IAAI;GAC5B,WAAW,YAAY,IAAI;GAC5B,CAEqB;AAEtB,MAAI,QAAQ;AACV,SAAM,gBAAgB;AACtB,UAAO,MAAM;;IAGjB;EAAC;EAAW;EAAW;EAAa;EAAK;EAAI,CAC9C;CAED,MAAM,WAAW,gBAAgB,OAAO,gBAAgB;CACxD,MAAM,EACJ,OAAO,eACP,gBAAgB,qBAChB,GAAG,cACD;CAEJ,MAAM,aAAiD;EACrD,MAAM;EACN,OAAO;EACP,GAAG;EACH,UAAU;EACV;EACA;EACA;EACA;EACA,OAAO,kBAAkB,WAAW,UAAU,KAAA;EAC9C,gBAAgB,uBAAuB,YAAY,KAAA;EACnD,WAAW,GACT,gBACA,QACA,2BACA,uBACA,gCACA,aAAa,UAAU;GACrB;GACA;GACA;GACD,EACD,aAAa,UACX,eAAe,cAAc;GAC3B;GACA;GACA;GACA;GACA;GACD,CACJ;EACD,KAAK;EACL,UAAU;EACV,UAAU;EACV,iBAAiB;EACjB,iBAAiB;EACjB,iBAAiB;EACjB,MAAM;EACP;AAED,QACE,wBAAA,cAAC,sBAAD;EACc;EACF;EACC;EA6BU,EA3BrB,wBAAA,cAAC,oBAAD;EACE,SAAS;EACT,MAAM;EACN,WAAW,GAAG,aAAa,UAAU,+BAA+B;EACpE,MAAM;EACN,iBAAiB;EACjB,YAAY;EACF;EACV,UAAU,WAAW;EACrB,aAAa,WAAW,CAAC;EACzB,wBAAwB,uBAAuB;EAC/C,OAAO,oBAAoB;EAC3B,CAAA,EACF,wBAAA,cAAC,OAAU,WAAc,EACzB,wBAAA,cAAC,oBAAD;EACE,SAAS;EACT,MAAM;EACN,WAAW,GAAG,aAAa,UAAU,+BAA+B;EACpE,MAAM;EACN,iBAAiB;EACjB,YAAY;EACF;EACV,UAAU,WAAW;EACrB,aAAa,WAAW,CAAC;EACzB,wBAAwB,uBAAuB;EAC/C,OAAO,oBAAoB;EAC3B,CAAA,CACmB;EAG5B;AAED,YAAY,cAAc"}
|
|
1
|
+
{"version":3,"file":"NumberInput.js","names":[],"sources":["../../../src/components/number-input/NumberInput.tsx"],"sourcesContent":["import { Minus, Plus } from '@atom-learning/icons'\nimport * as React from 'react'\n\nimport { styled } from '~/styled'\nimport { cn } from '~/styled'\nimport { getFieldIconSize } from '~/utilities/style/get-icon-size'\n\nimport { Input } from '../input/Input'\nimport { NumberInputStepper } from './NumberInputStepper'\n\nexport interface NumberInputProps {\n name: string\n min?: number\n max?: number\n step?: number\n value?: number\n defaultValue?: number\n disabled?: boolean\n readonly?: boolean\n size?: 'sm' | 'md' | 'lg'\n appearance?: 'standard' | 'modern'\n theme?: 'white' | 'grey'\n emphasis?: 'bold'\n onValueChange?: (value: number) => void\n stepperButtonLabels?: { increment?: string; decrement?: string }\n disabledTooltipContent?: { increment?: string; decrement?: string }\n className?: string\n}\n\nconst NumberInputContainer = styled('div', {\n base: ['flex'],\n variants: {\n appearance: {\n standard: [],\n modern: ['gap-px']\n },\n emphasis: {\n bold: ['gap-0']\n }\n }\n})\n\nexport const NumberInput = React.forwardRef<HTMLInputElement, NumberInputProps>(\n (\n {\n value,\n defaultValue = 0,\n onValueChange,\n min = 0,\n max = Number.MAX_SAFE_INTEGER,\n step = 1,\n disabled: isDisabled = false,\n readonly: isReadOnly = false,\n size = 'md',\n stepperButtonLabels: stepperButtonLabelsProp,\n disabledTooltipContent: disabledTooltipContentProp,\n className,\n appearance = 'standard',\n theme,\n emphasis,\n ...rest\n },\n ref\n ): JSX.Element => {\n const [internalValue, setInternalValue] = React.useState<number>(\n value || defaultValue\n )\n React.useEffect(() => {\n // Update the internal value to match what is passed in.\n if (typeof value !== 'undefined') setInternalValue(value)\n }, [value])\n\n const inputRef = React.useRef<HTMLInputElement | null>(null)\n\n React.useImperativeHandle(ref, () => inputRef.current as HTMLInputElement)\n\n const iconSize = React.useMemo(() => getFieldIconSize(size), [size])\n\n const stepperButtonLabels = {\n increment: 'increment',\n decrement: 'decrement',\n ...stepperButtonLabelsProp\n }\n\n const disabledTooltipContent = {\n decrement: `Cannot enter values below ${min}`,\n increment: `Cannot enter values above ${max}`,\n ...disabledTooltipContentProp\n }\n\n const isAtMax = internalValue >= max\n const isAtMin = internalValue <= min\n\n const clamp = React.useCallback(\n (internalValue: number) => Math.min(Math.max(internalValue, min), max),\n [max, min]\n )\n\n const updateValue = React.useCallback(\n (newValue: number) => {\n onValueChange?.(newValue)\n setInternalValue(newValue)\n },\n [onValueChange]\n )\n\n const onInputChange = React.useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const parsedValue = Number(event.target.value.replace(/\\D/g, ''))\n updateValue(parsedValue)\n },\n [updateValue]\n )\n\n const increment = React.useCallback(() => {\n if (isAtMax || isReadOnly) return\n inputRef?.current?.focus()\n const newValue = Number(internalValue) + step\n updateValue(clamp(newValue))\n }, [clamp, isAtMax, isReadOnly, step, updateValue, internalValue])\n\n const decrement = React.useCallback(() => {\n if (isAtMin || isReadOnly) return\n inputRef?.current?.focus()\n const newValue = Number(internalValue) - step\n updateValue(clamp(newValue))\n }, [clamp, isAtMin, isReadOnly, min, step, updateValue, internalValue])\n\n const onKeyDown = React.useCallback(\n (event: React.KeyboardEvent) => {\n if (event.nativeEvent.isComposing) return\n\n /**\n * Keyboard Accessibility\n *\n * We want to increase or decrease the input's value\n * based on if the user the arrow keys.\n *\n * @see https://www.w3.org/TR/wai-aria-practices-1.1/#keyboard-interaction-17\n */\n const eventKey = event.key\n\n const keyMap: Record<string, React.KeyboardEventHandler> = {\n ArrowUp: increment,\n ArrowRight: increment,\n ArrowDown: decrement,\n ArrowLeft: decrement,\n Home: () => updateValue(min),\n End: () => updateValue(max)\n }\n\n const action = keyMap[eventKey]\n\n if (action) {\n event.preventDefault()\n action(event)\n }\n },\n [increment, decrement, updateValue, min, max]\n )\n\n const hasError = internalValue < min || internalValue > max\n const {\n state: externalState,\n 'aria-invalid': externalAriaInvalid,\n ...restProps\n } = rest as { state?: 'error'; 'aria-invalid'?: boolean } & typeof rest\n\n const inputProps: React.ComponentProps<typeof Input> = {\n type: 'number',\n value: internalValue,\n ...restProps,\n onChange: onInputChange,\n onKeyDown,\n size,\n appearance,\n theme,\n state: externalState || (hasError ? 'error' : undefined),\n 'aria-invalid': externalAriaInvalid || hasError || undefined,\n className: cn(\n 'rounded-none',\n 'w-16',\n '[&_>_input]:text-center',\n 'disabled:opacity-30',\n 'disabled:pointer-events-none',\n emphasis === 'bold' && [\n 'rounded-1',\n '[&_>_input[aria-invalid=true]]:text-danger',\n 'focus-within:[&_>_input]:text-grey-1000'\n ],\n emphasis === 'bold' &&\n appearance === 'standard' && [\n 'border-none',\n '[&:has([aria-invalid=true])]:border-2',\n '[&:has([aria-invalid=true])]:border-danger',\n 'focus-within:border-2',\n 'focus-within:border-blue-800'\n ]\n ),\n ref: inputRef,\n readOnly: isReadOnly,\n disabled: isDisabled,\n 'aria-valuemin': min,\n 'aria-valuemax': max,\n 'aria-valuenow': internalValue,\n role: 'spinbutton'\n }\n\n return (\n <NumberInputContainer\n appearance={appearance}\n emphasis={emphasis}\n className={className}\n >\n <NumberInputStepper\n onClick={decrement}\n icon={Minus}\n className={cn(emphasis !== 'bold' && 'border-r-none rounded-r-none')}\n size={iconSize}\n fieldAppearance={appearance}\n fieldTheme={theme}\n emphasis={emphasis}\n disabled={isAtMin || isDisabled}\n showTooltip={isAtMin && !isDisabled}\n disabledTooltipContent={disabledTooltipContent.decrement}\n label={stepperButtonLabels.decrement}\n />\n <Input {...inputProps} />\n <NumberInputStepper\n onClick={increment}\n icon={Plus}\n className={cn(emphasis !== 'bold' && 'border-l-none rounded-l-none')}\n size={iconSize}\n fieldAppearance={appearance}\n fieldTheme={theme}\n emphasis={emphasis}\n disabled={isAtMax || isDisabled}\n showTooltip={isAtMax && !isDisabled}\n disabledTooltipContent={disabledTooltipContent.increment}\n label={stepperButtonLabels.increment}\n />\n </NumberInputContainer>\n )\n }\n)\n\nNumberInput.displayName = 'NumberInput'\n"],"mappings":";;;;;;;AA6BA,IAAM,uBAAuB,OAAO,OAAO;CACzC,MAAM,CAAC,MAAM;CACb,UAAU;EACR,YAAY;GACV,UAAU,CAAC;GACX,QAAQ,CAAC,QAAQ;EACnB;EACA,UAAU,EACR,MAAM,CAAC,OAAO,EAChB;CACF;AACF,CAAC;AAED,IAAa,cAAc,QAAM,YAE7B,EACE,OACA,eAAe,GACf,eACA,MAAM,GACN,MAAM,OAAO,kBACb,OAAO,GACP,UAAU,aAAa,OACvB,UAAU,aAAa,OACvB,OAAO,MACP,qBAAqB,yBACrB,wBAAwB,4BACxB,WACA,aAAa,YACb,OACA,UACA,GAAG,QAEL,QACgB;CAChB,MAAM,CAAC,eAAe,oBAAoB,QAAM,SAC9C,SAAS,YACX;CACA,QAAM,gBAAgB;EAEpB,IAAI,OAAO,UAAU,aAAa,iBAAiB,KAAK;CAC1D,GAAG,CAAC,KAAK,CAAC;CAEV,MAAM,WAAW,QAAM,OAAgC,IAAI;CAE3D,QAAM,oBAAoB,WAAW,SAAS,OAA2B;CAEzE,MAAM,WAAW,QAAM,cAAc,iBAAiB,IAAI,GAAG,CAAC,IAAI,CAAC;CAEnE,MAAM,sBAAsB;EAC1B,WAAW;EACX,WAAW;EACX,GAAG;CACL;CAEA,MAAM,yBAAyB;EAC7B,WAAW,6BAA6B;EACxC,WAAW,6BAA6B;EACxC,GAAG;CACL;CAEA,MAAM,UAAU,iBAAiB;CACjC,MAAM,UAAU,iBAAiB;CAEjC,MAAM,QAAQ,QAAM,aACjB,kBAA0B,KAAK,IAAI,KAAK,IAAI,eAAe,GAAG,GAAG,GAAG,GACrE,CAAC,KAAK,GAAG,CACX;CAEA,MAAM,cAAc,QAAM,aACvB,aAAqB;EACpB,gBAAgB,QAAQ;EACxB,iBAAiB,QAAQ;CAC3B,GACA,CAAC,aAAa,CAChB;CAEA,MAAM,gBAAgB,QAAM,aACzB,UAA+C;EAE9C,YADoB,OAAO,MAAM,OAAO,MAAM,QAAQ,OAAO,EAAE,CACnD,CAAW;CACzB,GACA,CAAC,WAAW,CACd;CAEA,MAAM,YAAY,QAAM,kBAAkB;EACxC,IAAI,WAAW,YAAY;EAC3B,UAAU,SAAS,MAAM;EAEzB,YAAY,MADK,OAAO,aAAa,IAAI,IACf,CAAC;CAC7B,GAAG;EAAC;EAAO;EAAS;EAAY;EAAM;EAAa;CAAa,CAAC;CAEjE,MAAM,YAAY,QAAM,kBAAkB;EACxC,IAAI,WAAW,YAAY;EAC3B,UAAU,SAAS,MAAM;EAEzB,YAAY,MADK,OAAO,aAAa,IAAI,IACf,CAAC;CAC7B,GAAG;EAAC;EAAO;EAAS;EAAY;EAAK;EAAM;EAAa;CAAa,CAAC;CAEtE,MAAM,YAAY,QAAM,aACrB,UAA+B;EAC9B,IAAI,MAAM,YAAY,aAAa;;;;;;;;;EAUnC,MAAM,WAAW,MAAM;EAWvB,MAAM,SAAS;GARb,SAAS;GACT,YAAY;GACZ,WAAW;GACX,WAAW;GACX,YAAY,YAAY,GAAG;GAC3B,WAAW,YAAY,GAAG;EAGb,EAAO;EAEtB,IAAI,QAAQ;GACV,MAAM,eAAe;GACrB,OAAO,KAAK;EACd;CACF,GACA;EAAC;EAAW;EAAW;EAAa;EAAK;CAAG,CAC9C;CAEA,MAAM,WAAW,gBAAgB,OAAO,gBAAgB;CACxD,MAAM,EACJ,OAAO,eACP,gBAAgB,qBAChB,GAAG,cACD;CAEJ,MAAM,aAAiD;EACrD,MAAM;EACN,OAAO;EACP,GAAG;EACH,UAAU;EACV;EACA;EACA;EACA;EACA,OAAO,kBAAkB,WAAW,UAAU,KAAA;EAC9C,gBAAgB,uBAAuB,YAAY,KAAA;EACnD,WAAW,GACT,gBACA,QACA,2BACA,uBACA,gCACA,aAAa,UAAU;GACrB;GACA;GACA;EACF,GACA,aAAa,UACX,eAAe,cAAc;GAC3B;GACA;GACA;GACA;GACA;EACF,CACJ;EACA,KAAK;EACL,UAAU;EACV,UAAU;EACV,iBAAiB;EACjB,iBAAiB;EACjB,iBAAiB;EACjB,MAAM;CACR;CAEA,OACE,wBAAA,cAAC,sBAAD;EACc;EACF;EACC;CA6BS,GA3BpB,wBAAA,cAAC,oBAAD;EACE,SAAS;EACT,MAAM;EACN,WAAW,GAAG,aAAa,UAAU,8BAA8B;EACnE,MAAM;EACN,iBAAiB;EACjB,YAAY;EACF;EACV,UAAU,WAAW;EACrB,aAAa,WAAW,CAAC;EACzB,wBAAwB,uBAAuB;EAC/C,OAAO,oBAAoB;CAC5B,CAAA,GACD,wBAAA,cAAC,OAAU,UAAa,GACxB,wBAAA,cAAC,oBAAD;EACE,SAAS;EACT,MAAM;EACN,WAAW,GAAG,aAAa,UAAU,8BAA8B;EACnE,MAAM;EACN,iBAAiB;EACjB,YAAY;EACF;EACV,UAAU,WAAW;EACrB,aAAa,WAAW,CAAC;EACzB,wBAAwB,uBAAuB;EAC/C,OAAO,oBAAoB;CAC5B,CAAA,CACmB;AAE1B,CACF;AAEA,YAAY,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInputStepper.js","names":[],"sources":["../../../src/components/number-input/NumberInputStepper.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { ActionIcon } from '../action-icon/ActionIcon'\nimport { Icon } from '../icon/Icon'\nimport { Tooltip } from '../tooltip/Tooltip'\n\nconst StyledStepperButton = styled(ActionIcon, {\n base: [\n 'rounded-md',\n 'z-1',\n 'h-full!',\n 'hover:[&_svg]:text-grey-800',\n 'hover:bg-grey-100',\n '[&_svg]:text-grey-700',\n 'active:[&_svg]:text-grey-900',\n 'active:bg-grey-200',\n 'disabled:opacity-30',\n 'disabled:pointer-events-none'\n ],\n variants: {\n fieldAppearance: {\n standard: ['bg-white', 'border-grey-800!'],\n modern: ['bg-grey-100', 'border-grey-100!', 'hover:bg-grey-200!']\n },\n fieldTheme: {\n white: [],\n grey: []\n },\n emphasis: {\n bold: [\n '[&_svg]:text-primary-700',\n 'hover:bg-primary-100!',\n 'hover:[&_svg]:text-primary-800!',\n 'active:bg-primary-200!',\n 'active:[&_svg]:text-primary-900!'\n ]\n }\n },\n compoundVariants: [\n {\n fieldAppearance: 'modern',\n fieldTheme: 'white',\n class: ['bg-white']\n },\n {\n fieldAppearance: 'standard',\n emphasis: 'bold',\n class: ['bg-white', 'border-primary-800!']\n },\n {\n fieldAppearance: 'modern',\n emphasis: 'bold',\n class: ['bg-white!', 'hover:bg-primary-100!']\n }\n ]\n})\n\ntype NumberInputStepperProps = Omit<\n React.ComponentProps<typeof ActionIcon>,\n 'children'\n> &\n Omit<React.ComponentProps<typeof StyledStepperButton>, 'children'> & {\n icon: React.FC<React.SVGProps<SVGSVGElement>>\n showTooltip?: boolean\n disabledTooltipContent?: string\n }\n\nexport const NumberInputStepper = React.forwardRef<\n HTMLButtonElement,\n NumberInputStepperProps\n>((props, forwardedRef) => {\n const {\n icon,\n disabledTooltipContent,\n showTooltip,\n fieldAppearance = 'standard',\n fieldTheme,\n ...rest\n } = props\n\n /**\n * Focus has been removed from the button\n * as the increment and decrement buttons should be keyboard accessible via arrow keys.\n * see MDN docs https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/spinbutton_role\n */\n return (\n <Tooltip>\n <Tooltip.Trigger asChild>\n <span className=\"z-1\" tabIndex={-1}>\n <StyledStepperButton\n hasTooltip={false}\n tabIndex={-1}\n appearance=\"outline\"\n fieldAppearance={fieldAppearance}\n fieldTheme={fieldTheme}\n ref={forwardedRef}\n {...rest}\n >\n <Icon is={icon} />\n </StyledStepperButton>\n </span>\n </Tooltip.Trigger>\n {showTooltip && (\n <Tooltip.Content>{disabledTooltipContent}</Tooltip.Content>\n )}\n </Tooltip>\n )\n})\n"],"mappings":";;;;;;AAQA,IAAM,sBAAsB,OAAO,YAAY;CAC7C,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;
|
|
1
|
+
{"version":3,"file":"NumberInputStepper.js","names":[],"sources":["../../../src/components/number-input/NumberInputStepper.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { ActionIcon } from '../action-icon/ActionIcon'\nimport { Icon } from '../icon/Icon'\nimport { Tooltip } from '../tooltip/Tooltip'\n\nconst StyledStepperButton = styled(ActionIcon, {\n base: [\n 'rounded-md',\n 'z-1',\n 'h-full!',\n 'hover:[&_svg]:text-grey-800',\n 'hover:bg-grey-100',\n '[&_svg]:text-grey-700',\n 'active:[&_svg]:text-grey-900',\n 'active:bg-grey-200',\n 'disabled:opacity-30',\n 'disabled:pointer-events-none'\n ],\n variants: {\n fieldAppearance: {\n standard: ['bg-white', 'border-grey-800!'],\n modern: ['bg-grey-100', 'border-grey-100!', 'hover:bg-grey-200!']\n },\n fieldTheme: {\n white: [],\n grey: []\n },\n emphasis: {\n bold: [\n '[&_svg]:text-primary-700',\n 'hover:bg-primary-100!',\n 'hover:[&_svg]:text-primary-800!',\n 'active:bg-primary-200!',\n 'active:[&_svg]:text-primary-900!'\n ]\n }\n },\n compoundVariants: [\n {\n fieldAppearance: 'modern',\n fieldTheme: 'white',\n class: ['bg-white']\n },\n {\n fieldAppearance: 'standard',\n emphasis: 'bold',\n class: ['bg-white', 'border-primary-800!']\n },\n {\n fieldAppearance: 'modern',\n emphasis: 'bold',\n class: ['bg-white!', 'hover:bg-primary-100!']\n }\n ]\n})\n\ntype NumberInputStepperProps = Omit<\n React.ComponentProps<typeof ActionIcon>,\n 'children'\n> &\n Omit<React.ComponentProps<typeof StyledStepperButton>, 'children'> & {\n icon: React.FC<React.SVGProps<SVGSVGElement>>\n showTooltip?: boolean\n disabledTooltipContent?: string\n }\n\nexport const NumberInputStepper = React.forwardRef<\n HTMLButtonElement,\n NumberInputStepperProps\n>((props, forwardedRef) => {\n const {\n icon,\n disabledTooltipContent,\n showTooltip,\n fieldAppearance = 'standard',\n fieldTheme,\n ...rest\n } = props\n\n /**\n * Focus has been removed from the button\n * as the increment and decrement buttons should be keyboard accessible via arrow keys.\n * see MDN docs https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/spinbutton_role\n */\n return (\n <Tooltip>\n <Tooltip.Trigger asChild>\n <span className=\"z-1\" tabIndex={-1}>\n <StyledStepperButton\n hasTooltip={false}\n tabIndex={-1}\n appearance=\"outline\"\n fieldAppearance={fieldAppearance}\n fieldTheme={fieldTheme}\n ref={forwardedRef}\n {...rest}\n >\n <Icon is={icon} />\n </StyledStepperButton>\n </span>\n </Tooltip.Trigger>\n {showTooltip && (\n <Tooltip.Content>{disabledTooltipContent}</Tooltip.Content>\n )}\n </Tooltip>\n )\n})\n"],"mappings":";;;;;;AAQA,IAAM,sBAAsB,OAAO,YAAY;CAC7C,MAAM;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,UAAU;EACR,iBAAiB;GACf,UAAU,CAAC,YAAY,kBAAkB;GACzC,QAAQ;IAAC;IAAe;IAAoB;GAAoB;EAClE;EACA,YAAY;GACV,OAAO,CAAC;GACR,MAAM,CAAC;EACT;EACA,UAAU,EACR,MAAM;GACJ;GACA;GACA;GACA;GACA;EACF,EACF;CACF;CACA,kBAAkB;EAChB;GACE,iBAAiB;GACjB,YAAY;GACZ,OAAO,CAAC,UAAU;EACpB;EACA;GACE,iBAAiB;GACjB,UAAU;GACV,OAAO,CAAC,YAAY,qBAAqB;EAC3C;EACA;GACE,iBAAiB;GACjB,UAAU;GACV,OAAO,CAAC,aAAa,uBAAuB;EAC9C;CACF;AACF,CAAC;AAYD,IAAa,qBAAqB,QAAM,YAGrC,OAAO,iBAAiB;CACzB,MAAM,EACJ,MACA,wBACA,aACA,kBAAkB,YAClB,YACA,GAAG,SACD;;;;;;CAOJ,OACE,wBAAA,cAAC,SAAA,MACC,wBAAA,cAAC,QAAQ,SAAT,EAAiB,SAAA,KAcA,GAbf,wBAAA,cAAC,QAAD;EAAM,WAAU;EAAM,UAAU;CAY1B,GAXJ,wBAAA,cAAC,qBAAD;EACE,YAAY;EACZ,UAAU;EACV,YAAW;EACM;EACL;EACZ,KAAK;EACL,GAAI;CAGe,GADnB,wBAAA,cAAC,MAAD,EAAM,IAAI,KAAO,CAAA,CACE,CACjB,CACS,GAChB,eACC,wBAAA,cAAC,QAAQ,SAAA,MAAS,sBAAwC,CAErD;AAEb,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInputField.js","names":[],"sources":["../../../src/components/number-input-field/NumberInputField.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useController, useFormContext } from 'react-hook-form'\n\nimport { FieldWrapper } from '~/components/field-wrapper/FieldWrapper'\nimport { useFieldError } from '~/components/form/useFieldError'\nimport { useFormCustomContext } from '~/components/form/useFormCustomContext'\nimport { ValidationOptions } from '~/components/form/validation'\n\nimport type { NumberInputProps } from '../number-input/NumberInput'\nimport { NumberInput } from '../number-input/NumberInput'\n\nexport interface NumberInputFieldProps extends NumberInputProps {\n className?: string\n hideLabel?: boolean\n description?: string\n label: string\n name: string\n prompt?: { link: string; label: string }\n validation?: ValidationOptions\n}\n\nexport const NumberInputField = ({\n className,\n defaultValue = 0,\n hideLabel,\n value,\n prompt,\n description,\n label,\n name,\n validation,\n onValueChange,\n appearance,\n theme,\n ...remainingProps\n}: NumberInputFieldProps) => {\n const { control } = useFormContext()\n const context = useFormCustomContext()\n const {\n field: { ref, onChange, value: innerValue, name: innerName }\n } = useController({\n name,\n control,\n rules: validation,\n defaultValue\n })\n const { error } = useFieldError(name)\n\n const formAppearance = context?.appearance || appearance\n const formTheme = context?.theme ?? theme\n\n React.useEffect(() => {\n // Update the react-hook-form inner value to match what is passed in.\n if (typeof value !== 'undefined') onChange(value)\n }, [value])\n\n return (\n <FieldWrapper\n className={className}\n description={description}\n error={error}\n fieldId={name}\n hideLabel={hideLabel}\n label={label}\n prompt={prompt}\n required={Boolean(validation?.required)}\n appearance={formAppearance}\n >\n <NumberInput\n id={name}\n name={innerName}\n ref={ref}\n {...(error && { state: 'error', 'aria-invalid': true })}\n defaultValue={defaultValue}\n onValueChange={(newValue) => {\n onChange(newValue)\n onValueChange?.(newValue)\n }}\n value={innerValue}\n appearance={formAppearance}\n theme={formTheme}\n {...remainingProps}\n />\n </FieldWrapper>\n )\n}\n\nNumberInputField.displayName = 'NumberInputField'\n"],"mappings":";;;;;;;AAqBA,IAAa,oBAAoB,EAC/B,WACA,eAAe,GACf,WACA,OACA,QACA,aACA,OACA,MACA,YACA,eACA,YACA,OACA,GAAG,qBACwB;CAC3B,MAAM,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"NumberInputField.js","names":[],"sources":["../../../src/components/number-input-field/NumberInputField.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useController, useFormContext } from 'react-hook-form'\n\nimport { FieldWrapper } from '~/components/field-wrapper/FieldWrapper'\nimport { useFieldError } from '~/components/form/useFieldError'\nimport { useFormCustomContext } from '~/components/form/useFormCustomContext'\nimport { ValidationOptions } from '~/components/form/validation'\n\nimport type { NumberInputProps } from '../number-input/NumberInput'\nimport { NumberInput } from '../number-input/NumberInput'\n\nexport interface NumberInputFieldProps extends NumberInputProps {\n className?: string\n hideLabel?: boolean\n description?: string\n label: string\n name: string\n prompt?: { link: string; label: string }\n validation?: ValidationOptions\n}\n\nexport const NumberInputField = ({\n className,\n defaultValue = 0,\n hideLabel,\n value,\n prompt,\n description,\n label,\n name,\n validation,\n onValueChange,\n appearance,\n theme,\n ...remainingProps\n}: NumberInputFieldProps) => {\n const { control } = useFormContext()\n const context = useFormCustomContext()\n const {\n field: { ref, onChange, value: innerValue, name: innerName }\n } = useController({\n name,\n control,\n rules: validation,\n defaultValue\n })\n const { error } = useFieldError(name)\n\n const formAppearance = context?.appearance || appearance\n const formTheme = context?.theme ?? theme\n\n React.useEffect(() => {\n // Update the react-hook-form inner value to match what is passed in.\n if (typeof value !== 'undefined') onChange(value)\n }, [value])\n\n return (\n <FieldWrapper\n className={className}\n description={description}\n error={error}\n fieldId={name}\n hideLabel={hideLabel}\n label={label}\n prompt={prompt}\n required={Boolean(validation?.required)}\n appearance={formAppearance}\n >\n <NumberInput\n id={name}\n name={innerName}\n ref={ref}\n {...(error && { state: 'error', 'aria-invalid': true })}\n defaultValue={defaultValue}\n onValueChange={(newValue) => {\n onChange(newValue)\n onValueChange?.(newValue)\n }}\n value={innerValue}\n appearance={formAppearance}\n theme={formTheme}\n {...remainingProps}\n />\n </FieldWrapper>\n )\n}\n\nNumberInputField.displayName = 'NumberInputField'\n"],"mappings":";;;;;;;AAqBA,IAAa,oBAAoB,EAC/B,WACA,eAAe,GACf,WACA,OACA,QACA,aACA,OACA,MACA,YACA,eACA,YACA,OACA,GAAG,qBACwB;CAC3B,MAAM,EAAE,YAAY,eAAe;CACnC,MAAM,UAAU,qBAAqB;CACrC,MAAM,EACJ,OAAO,EAAE,KAAK,UAAU,OAAO,YAAY,MAAM,gBAC/C,cAAc;EAChB;EACA;EACA,OAAO;EACP;CACF,CAAC;CACD,MAAM,EAAE,UAAU,cAAc,IAAI;CAEpC,MAAM,iBAAiB,SAAS,cAAc;CAC9C,MAAM,YAAY,SAAS,SAAS;CAEpC,QAAM,gBAAgB;EAEpB,IAAI,OAAO,UAAU,aAAa,SAAS,KAAK;CAClD,GAAG,CAAC,KAAK,CAAC;CAEV,OACE,wBAAA,cAAC,cAAD;EACa;EACE;EACN;EACP,SAAS;EACE;EACJ;EACC;EACR,UAAU,QAAQ,YAAY,QAAQ;EACtC,YAAY;CAiBA,GAfZ,wBAAA,cAAC,aAAD;EACE,IAAI;EACJ,MAAM;EACD;EACL,GAAK,SAAS;GAAE,OAAO;GAAS,gBAAgB;EAAK;EACvC;EACd,gBAAgB,aAAa;GAC3B,SAAS,QAAQ;GACjB,gBAAgB,QAAQ;EAC1B;EACA,OAAO;EACP,YAAY;EACZ,OAAO;EACP,GAAI;CACL,CAAA,CACW;AAElB;AAEA,iBAAiB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.js","names":[],"sources":["../../../src/components/pagination/Pagination.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { cn } from '~/styled'\n\nimport { ColorScheme } from '../../experiments/color-scheme/ColorScheme'\nimport { PaginationProvider } from './pagination-context/PaginationContext'\nimport { VisibleElementsAmount } from './pagination.constants'\nimport { PaginationItems } from './PaginationItems'\nimport { PaginationPopover } from './PaginationPopover'\nimport type { PaginationProps, PaginationProviderProps } from './types'\n\nconst PaginationComponent = ({\n colorScheme,\n onSelectedPageChange,\n selectedPage,\n visibleElementsCount = VisibleElementsAmount.LESS,\n pagesCount,\n indicatedPages = [],\n disabledPages = [],\n onItemHover = () => null,\n labels = {},\n children,\n className,\n ...rest\n}: PaginationProps) => {\n if (!pagesCount) return null\n\n const paginationProviderProps: PaginationProviderProps = {\n onSelectedPageChange,\n selectedPage,\n visibleElementsCount,\n pagesCount,\n indicatedPages,\n disabledPages,\n onItemHover,\n labels\n }\n\n return (\n <PaginationProvider {...paginationProviderProps}>\n <ColorScheme base=\"grey1\" accent=\"primary1\" {...colorScheme} asChild>\n <div {...rest} className={cn('flex', 'gap-1', className)}>\n {children || <PaginationItems />}\n </div>\n </ColorScheme>\n </PaginationProvider>\n )\n}\n\nexport const Pagination = Object.assign(PaginationComponent, {\n Popover: PaginationPopover\n})\n\nPaginationComponent.displayName = 'Pagination'\n"],"mappings":";;;;;;;;AAWA,IAAM,uBAAuB,EAC3B,aACA,sBACA,cACA,uBAAuB,sBAAsB,MAC7C,YACA,iBAAiB,
|
|
1
|
+
{"version":3,"file":"Pagination.js","names":[],"sources":["../../../src/components/pagination/Pagination.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { cn } from '~/styled'\n\nimport { ColorScheme } from '../../experiments/color-scheme/ColorScheme'\nimport { PaginationProvider } from './pagination-context/PaginationContext'\nimport { VisibleElementsAmount } from './pagination.constants'\nimport { PaginationItems } from './PaginationItems'\nimport { PaginationPopover } from './PaginationPopover'\nimport type { PaginationProps, PaginationProviderProps } from './types'\n\nconst PaginationComponent = ({\n colorScheme,\n onSelectedPageChange,\n selectedPage,\n visibleElementsCount = VisibleElementsAmount.LESS,\n pagesCount,\n indicatedPages = [],\n disabledPages = [],\n onItemHover = () => null,\n labels = {},\n children,\n className,\n ...rest\n}: PaginationProps) => {\n if (!pagesCount) return null\n\n const paginationProviderProps: PaginationProviderProps = {\n onSelectedPageChange,\n selectedPage,\n visibleElementsCount,\n pagesCount,\n indicatedPages,\n disabledPages,\n onItemHover,\n labels\n }\n\n return (\n <PaginationProvider {...paginationProviderProps}>\n <ColorScheme base=\"grey1\" accent=\"primary1\" {...colorScheme} asChild>\n <div {...rest} className={cn('flex', 'gap-1', className)}>\n {children || <PaginationItems />}\n </div>\n </ColorScheme>\n </PaginationProvider>\n )\n}\n\nexport const Pagination = Object.assign(PaginationComponent, {\n Popover: PaginationPopover\n})\n\nPaginationComponent.displayName = 'Pagination'\n"],"mappings":";;;;;;;;AAWA,IAAM,uBAAuB,EAC3B,aACA,sBACA,cACA,uBAAuB,sBAAsB,MAC7C,YACA,iBAAiB,CAAC,GAClB,gBAAgB,CAAC,GACjB,oBAAoB,MACpB,SAAS,CAAC,GACV,UACA,WACA,GAAG,WACkB;CACrB,IAAI,CAAC,YAAY,OAAO;CAExB,MAAM,0BAAmD;EACvD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CAEA,OACE,wBAAA,cAAC,oBAAuB,yBACtB,wBAAA,cAAC,aAAD;EAAa,MAAK;EAAQ,QAAO;EAAW,GAAI;EAAa,SAAA;CAIhD,GAHX,wBAAA,cAAC,OAAD;EAAK,GAAI;EAAM,WAAW,GAAG,QAAQ,SAAS,SAAS;CAElD,GADF,YAAY,wBAAA,cAAC,iBAAA,IAAiB,CAC5B,CACM,CACK;AAExB;AAEA,IAAa,aAAa,OAAO,OAAO,qBAAqB,EAC3D,SAAS,kBACX,CAAC;AAED,oBAAoB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaginationItems.js","names":[],"sources":["../../../src/components/pagination/PaginationItems.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {\n GO_TO_NEXT_PAGE,\n GO_TO_PREVIOUS_PAGE,\n VIEW_ALL_POPOVER\n} from './pagination.constants'\nimport { PaginationNextButton } from './PaginationNextButton'\nimport { PaginationPage } from './PaginationPage'\nimport { PaginationPopover } from './PaginationPopover'\nimport { PaginationPreviousButton } from './PaginationPreviousButton'\nimport { usePagination } from './usePagination'\n\nexport const PaginationItems = (): JSX.Element => {\n const { paginationItems } = usePagination()\n\n return (\n <>\n {paginationItems.map((paginationItem, i) => {\n switch (paginationItem) {\n case VIEW_ALL_POPOVER:\n return <PaginationPopover key={paginationItem + i} />\n case GO_TO_PREVIOUS_PAGE:\n return <PaginationPreviousButton key={paginationItem} />\n case GO_TO_NEXT_PAGE:\n return <PaginationNextButton key={paginationItem} />\n default:\n return (\n <PaginationPage\n key={paginationItem}\n pageNumber={paginationItem}\n />\n )\n }\n })}\n </>\n )\n}\n"],"mappings":";;;;;;;;AAaA,IAAa,wBAAqC;CAChD,MAAM,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"PaginationItems.js","names":[],"sources":["../../../src/components/pagination/PaginationItems.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport {\n GO_TO_NEXT_PAGE,\n GO_TO_PREVIOUS_PAGE,\n VIEW_ALL_POPOVER\n} from './pagination.constants'\nimport { PaginationNextButton } from './PaginationNextButton'\nimport { PaginationPage } from './PaginationPage'\nimport { PaginationPopover } from './PaginationPopover'\nimport { PaginationPreviousButton } from './PaginationPreviousButton'\nimport { usePagination } from './usePagination'\n\nexport const PaginationItems = (): JSX.Element => {\n const { paginationItems } = usePagination()\n\n return (\n <>\n {paginationItems.map((paginationItem, i) => {\n switch (paginationItem) {\n case VIEW_ALL_POPOVER:\n return <PaginationPopover key={paginationItem + i} />\n case GO_TO_PREVIOUS_PAGE:\n return <PaginationPreviousButton key={paginationItem} />\n case GO_TO_NEXT_PAGE:\n return <PaginationNextButton key={paginationItem} />\n default:\n return (\n <PaginationPage\n key={paginationItem}\n pageNumber={paginationItem}\n />\n )\n }\n })}\n </>\n )\n}\n"],"mappings":";;;;;;;;AAaA,IAAa,wBAAqC;CAChD,MAAM,EAAE,oBAAoB,cAAc;CAE1C,OACE,wBAAA,cAAA,QAAA,UAAA,MACG,gBAAgB,KAAK,gBAAgB,MAAM;EAC1C,QAAQ,gBAAR;GACE,KAAK,kBACH,OAAO,wBAAA,cAAC,mBAAD,EAAmB,KAAK,iBAAiB,EAAI,CAAA;GACtD,KAAK,qBACH,OAAO,wBAAA,cAAC,0BAAD,EAA0B,KAAK,eAAiB,CAAA;GACzD,KAAK,iBACH,OAAO,wBAAA,cAAC,sBAAD,EAAsB,KAAK,eAAiB,CAAA;GACrD,SACE,OACE,wBAAA,cAAC,gBAAD;IACE,KAAK;IACL,YAAY;GACb,CAAA;EAEP;CACF,CAAC,CACD;AAEN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaginationNextButton.js","names":[],"sources":["../../../src/components/pagination/PaginationNextButton.tsx"],"sourcesContent":["import { ChevronRight } from '@atom-learning/icons'\nimport * as React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { ActionIcon } from '../action-icon/ActionIcon'\nimport { Icon } from '../icon/Icon'\nimport { usePagination } from './usePagination'\n\nconst StyledActionIcon = styled(ActionIcon, {\n base: ['ml-1', 'disabled:opacity-30']\n})\n\nexport const PaginationNextButton = (\n props: Partial<React.ComponentProps<typeof StyledActionIcon>>\n) => {\n const { goToNextPage, labels, nextAvailablePage } = usePagination()\n\n const isDisabled = !nextAvailablePage\n\n return (\n <StyledActionIcon\n hasTooltip={false}\n size=\"md\"\n theme=\"neutral\"\n onClick={goToNextPage}\n disabled={isDisabled}\n {...props}\n label={labels?.nextPageButtonLabel || 'Next page'}\n >\n <Icon is={ChevronRight} />\n </StyledActionIcon>\n )\n}\n"],"mappings":";;;;;;;AASA,IAAM,mBAAmB,OAAO,YAAY,EAC1C,MAAM,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"PaginationNextButton.js","names":[],"sources":["../../../src/components/pagination/PaginationNextButton.tsx"],"sourcesContent":["import { ChevronRight } from '@atom-learning/icons'\nimport * as React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { ActionIcon } from '../action-icon/ActionIcon'\nimport { Icon } from '../icon/Icon'\nimport { usePagination } from './usePagination'\n\nconst StyledActionIcon = styled(ActionIcon, {\n base: ['ml-1', 'disabled:opacity-30']\n})\n\nexport const PaginationNextButton = (\n props: Partial<React.ComponentProps<typeof StyledActionIcon>>\n) => {\n const { goToNextPage, labels, nextAvailablePage } = usePagination()\n\n const isDisabled = !nextAvailablePage\n\n return (\n <StyledActionIcon\n hasTooltip={false}\n size=\"md\"\n theme=\"neutral\"\n onClick={goToNextPage}\n disabled={isDisabled}\n {...props}\n label={labels?.nextPageButtonLabel || 'Next page'}\n >\n <Icon is={ChevronRight} />\n </StyledActionIcon>\n )\n}\n"],"mappings":";;;;;;;AASA,IAAM,mBAAmB,OAAO,YAAY,EAC1C,MAAM,CAAC,QAAQ,qBAAqB,EACtC,CAAC;AAED,IAAa,wBACX,UACG;CACH,MAAM,EAAE,cAAc,QAAQ,sBAAsB,cAAc;CAElE,MAAM,aAAa,CAAC;CAEpB,OACE,wBAAA,cAAC,kBAAD;EACE,YAAY;EACZ,MAAK;EACL,OAAM;EACN,SAAS;EACT,UAAU;EACV,GAAI;EACJ,OAAO,QAAQ,uBAAuB;CAGtB,GADhB,wBAAA,cAAC,MAAD,EAAM,IAAI,aAAe,CAAA,CACT;AAEtB"}
|