plass-ui 0.0.1 → 1.0.0
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/PlAccordion.d.ts +98 -0
- package/dist/components/accordion/PlAccordion.js +131 -0
- package/dist/components/accordion/index.d.ts +2 -0
- package/dist/components/accordion/index.js +1 -0
- package/dist/components/alert/PlAlert.d.ts +50 -0
- package/dist/components/alert/PlAlert.js +109 -0
- package/dist/components/alert/index.d.ts +2 -0
- package/dist/components/alert/index.js +1 -0
- package/dist/components/animate-appear/PlAnimateAppear.d.ts +55 -0
- package/dist/components/animate-appear/PlAnimateAppear.js +71 -0
- package/dist/components/animate-appear/index.d.ts +2 -0
- package/dist/components/animate-appear/index.js +1 -0
- package/dist/components/animate-blink/PlAnimateBlink.d.ts +30 -0
- package/dist/components/animate-blink/PlAnimateBlink.js +47 -0
- package/dist/components/animate-blink/index.d.ts +2 -0
- package/dist/components/animate-blink/index.js +1 -0
- package/dist/components/animate-fade/PlAnimateFade.d.ts +35 -0
- package/dist/components/animate-fade/PlAnimateFade.js +48 -0
- package/dist/components/animate-fade/index.d.ts +2 -0
- package/dist/components/animate-fade/index.js +1 -0
- package/dist/components/animate-grow/PlAnimateGrow.d.ts +45 -0
- package/dist/components/animate-grow/PlAnimateGrow.js +49 -0
- package/dist/components/animate-grow/index.d.ts +2 -0
- package/dist/components/animate-grow/index.js +1 -0
- package/dist/components/animate-headline/PlAnimateHeadline.d.ts +55 -0
- package/dist/components/animate-headline/PlAnimateHeadline.js +120 -0
- package/dist/components/animate-headline/index.d.ts +2 -0
- package/dist/components/animate-headline/index.js +1 -0
- package/dist/components/animate-lighting/PlAnimateLighting.d.ts +67 -0
- package/dist/components/animate-lighting/PlAnimateLighting.js +65 -0
- package/dist/components/animate-lighting/index.d.ts +2 -0
- package/dist/components/animate-lighting/index.js +1 -0
- package/dist/components/animate-marquee/PlAnimateMarquee.d.ts +65 -0
- package/dist/components/animate-marquee/PlAnimateMarquee.js +94 -0
- package/dist/components/animate-marquee/index.d.ts +2 -0
- package/dist/components/animate-marquee/index.js +1 -0
- package/dist/components/animate-rotate/PlAnimateRotate.d.ts +52 -0
- package/dist/components/animate-rotate/PlAnimateRotate.js +50 -0
- package/dist/components/animate-rotate/index.d.ts +2 -0
- package/dist/components/animate-rotate/index.js +1 -0
- package/dist/components/animate-slide/PlAnimateSlide.d.ts +47 -0
- package/dist/components/animate-slide/PlAnimateSlide.js +49 -0
- package/dist/components/animate-slide/index.d.ts +2 -0
- package/dist/components/animate-slide/index.js +1 -0
- package/dist/components/animate-typing/PlAnimateTyping.d.ts +56 -0
- package/dist/components/animate-typing/PlAnimateTyping.js +177 -0
- package/dist/components/animate-typing/index.d.ts +2 -0
- package/dist/components/animate-typing/index.js +1 -0
- package/dist/components/animate-zoom/PlAnimateZoom.d.ts +37 -0
- package/dist/components/animate-zoom/PlAnimateZoom.js +45 -0
- package/dist/components/animate-zoom/index.d.ts +2 -0
- package/dist/components/animate-zoom/index.js +1 -0
- package/dist/components/aspect-ratio/PlAspectRatio.d.ts +64 -0
- package/dist/components/aspect-ratio/PlAspectRatio.js +58 -0
- package/dist/components/aspect-ratio/index.d.ts +2 -0
- package/dist/components/aspect-ratio/index.js +1 -0
- package/dist/components/avatar/PlAvatar.d.ts +102 -0
- package/dist/components/avatar/PlAvatar.js +121 -0
- package/dist/components/avatar/index.d.ts +2 -0
- package/dist/components/avatar/index.js +1 -0
- package/dist/components/badge/PlBadge.d.ts +86 -0
- package/dist/components/badge/PlBadge.js +168 -0
- package/dist/components/badge/index.d.ts +2 -0
- package/dist/components/badge/index.js +1 -0
- package/dist/components/blockquote/PlBlockquote.d.ts +64 -0
- package/dist/components/blockquote/PlBlockquote.js +112 -0
- package/dist/components/blockquote/index.d.ts +2 -0
- package/dist/components/blockquote/index.js +1 -0
- package/dist/components/bottom-navigation/PlBottomNavigation.d.ts +111 -0
- package/dist/components/bottom-navigation/PlBottomNavigation.js +141 -0
- package/dist/components/bottom-navigation/index.d.ts +2 -0
- package/dist/components/bottom-navigation/index.js +1 -0
- package/dist/components/box/PlBox.d.ts +50 -0
- package/dist/components/box/PlBox.js +46 -0
- package/dist/components/box/index.d.ts +2 -0
- package/dist/components/box/index.js +1 -0
- package/dist/components/breadcrumb/PlBreadcrumb.d.ts +138 -0
- package/dist/components/breadcrumb/PlBreadcrumb.js +201 -0
- package/dist/components/breadcrumb/index.d.ts +2 -0
- package/dist/components/breadcrumb/index.js +1 -0
- package/dist/components/button/{Button.d.ts → PlButton.d.ts} +3 -3
- package/dist/components/button/PlButton.js +196 -0
- package/dist/components/button/index.d.ts +2 -2
- package/dist/components/button/index.js +1 -1
- package/dist/components/button-group/PlButtonGroup.d.ts +32 -0
- package/dist/components/button-group/PlButtonGroup.js +64 -0
- package/dist/components/button-group/index.d.ts +2 -0
- package/dist/components/button-group/index.js +1 -0
- package/dist/components/card/PlCard.d.ts +81 -0
- package/dist/components/card/PlCard.js +102 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/card/index.js +1 -0
- package/dist/components/carousel/PlCarousel.d.ts +78 -0
- package/dist/components/carousel/PlCarousel.js +177 -0
- package/dist/components/carousel/index.d.ts +2 -0
- package/dist/components/carousel/index.js +1 -0
- package/dist/components/chat-bubble/PlChatBubble.d.ts +127 -0
- package/dist/components/chat-bubble/PlChatBubble.js +206 -0
- package/dist/components/chat-bubble/index.d.ts +2 -0
- package/dist/components/chat-bubble/index.js +1 -0
- package/dist/components/checkbox/PlCheckbox.d.ts +39 -0
- package/dist/components/checkbox/PlCheckbox.js +100 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/checkbox/index.js +1 -0
- package/dist/components/chip/PlChip.d.ts +55 -0
- package/dist/components/chip/PlChip.js +144 -0
- package/dist/components/chip/index.d.ts +2 -0
- package/dist/components/chip/index.js +1 -0
- package/dist/components/collapsible/PlCollapsible.d.ts +84 -0
- package/dist/components/collapsible/PlCollapsible.js +65 -0
- package/dist/components/collapsible/index.d.ts +2 -0
- package/dist/components/collapsible/index.js +1 -0
- package/dist/components/combobox/PlCombobox.d.ts +140 -0
- package/dist/components/combobox/PlCombobox.js +199 -0
- package/dist/components/combobox/index.d.ts +2 -0
- package/dist/components/combobox/index.js +1 -0
- package/dist/components/container/PlContainer.d.ts +66 -0
- package/dist/components/container/PlContainer.js +47 -0
- package/dist/components/container/index.d.ts +2 -0
- package/dist/components/container/index.js +1 -0
- package/dist/components/date-picker/PlDatePicker.d.ts +73 -0
- package/dist/components/date-picker/PlDatePicker.js +87 -0
- package/dist/components/date-picker/index.d.ts +2 -0
- package/dist/components/date-picker/index.js +1 -0
- package/dist/components/date-range-picker/PlDateRangePicker.d.ts +91 -0
- package/dist/components/date-range-picker/PlDateRangePicker.js +152 -0
- package/dist/components/date-range-picker/index.d.ts +2 -0
- package/dist/components/date-range-picker/index.js +1 -0
- package/dist/components/date-time-picker/PlDateTimePicker.d.ts +74 -0
- package/dist/components/date-time-picker/PlDateTimePicker.js +106 -0
- package/dist/components/date-time-picker/index.d.ts +2 -0
- package/dist/components/date-time-picker/index.js +1 -0
- package/dist/components/divider/PlDivider.d.ts +73 -0
- package/dist/components/divider/PlDivider.js +107 -0
- package/dist/components/divider/index.d.ts +2 -0
- package/dist/components/divider/index.js +1 -0
- package/dist/components/drawer/PlDrawer.d.ts +144 -0
- package/dist/components/drawer/PlDrawer.js +190 -0
- package/dist/components/drawer/index.d.ts +2 -0
- package/dist/components/drawer/index.js +1 -0
- package/dist/components/file-picker/PlFilePicker.d.ts +105 -0
- package/dist/components/file-picker/PlFilePicker.js +274 -0
- package/dist/components/file-picker/index.d.ts +2 -0
- package/dist/components/file-picker/index.js +1 -0
- package/dist/components/floating-bottom-navigation/PlFloatingBottomNavigation.d.ts +118 -0
- package/dist/components/floating-bottom-navigation/PlFloatingBottomNavigation.js +291 -0
- package/dist/components/floating-bottom-navigation/index.d.ts +2 -0
- package/dist/components/floating-bottom-navigation/index.js +1 -0
- package/dist/components/grid/PlGrid.d.ts +67 -0
- package/dist/components/grid/PlGrid.js +51 -0
- package/dist/components/grid/PlGridItem.d.ts +50 -0
- package/dist/components/grid/PlGridItem.js +34 -0
- package/dist/components/grid/index.d.ts +4 -0
- package/dist/components/grid/index.js +2 -0
- package/dist/components/highlight/PlHighlight.d.ts +90 -0
- package/dist/components/highlight/PlHighlight.js +185 -0
- package/dist/components/highlight/index.d.ts +2 -0
- package/dist/components/highlight/index.js +1 -0
- package/dist/components/hot-keys/PlHotKeys.d.ts +93 -0
- package/dist/components/hot-keys/PlHotKeys.js +294 -0
- package/dist/components/hot-keys/index.d.ts +2 -0
- package/dist/components/hot-keys/index.js +1 -0
- package/dist/components/icon/PlIcon.d.ts +62 -0
- package/dist/components/icon/PlIcon.js +58 -0
- package/dist/components/icon/index.d.ts +2 -0
- package/dist/components/icon/index.js +1 -0
- package/dist/components/icon-button/PlIconButton.d.ts +39 -0
- package/dist/components/icon-button/PlIconButton.js +37 -0
- package/dist/components/icon-button/index.d.ts +2 -0
- package/dist/components/icon-button/index.js +1 -0
- package/dist/components/list/PlList.d.ts +82 -0
- package/dist/components/list/PlList.js +160 -0
- package/dist/components/list/index.d.ts +2 -0
- package/dist/components/list/index.js +1 -0
- package/dist/components/menu/PlMenu.d.ts +210 -0
- package/dist/components/menu/PlMenu.js +209 -0
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/menu/index.js +1 -0
- package/dist/components/modal/PlModal.d.ts +112 -0
- package/dist/components/modal/PlModal.js +150 -0
- package/dist/components/modal/index.d.ts +2 -0
- package/dist/components/modal/index.js +1 -0
- package/dist/components/number-field/PlNumberField.d.ts +133 -0
- package/dist/components/number-field/PlNumberField.js +111 -0
- package/dist/components/number-field/index.d.ts +2 -0
- package/dist/components/number-field/index.js +1 -0
- package/dist/components/otp-field/PlOtpField.d.ts +82 -0
- package/dist/components/otp-field/PlOtpField.js +109 -0
- package/dist/components/otp-field/index.d.ts +2 -0
- package/dist/components/otp-field/index.js +1 -0
- package/dist/components/overlay/PlOverlay.d.ts +96 -0
- package/dist/components/overlay/PlOverlay.js +77 -0
- package/dist/components/overlay/index.d.ts +2 -0
- package/dist/components/overlay/index.js +1 -0
- package/dist/components/pagination/PlPagination.d.ts +88 -0
- package/dist/components/pagination/PlPagination.js +159 -0
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/pagination/index.js +1 -0
- package/dist/components/panes/PlPanes.d.ts +79 -0
- package/dist/components/panes/PlPanes.js +324 -0
- package/dist/components/panes/index.d.ts +2 -0
- package/dist/components/panes/index.js +1 -0
- package/dist/components/pill/PlPill.d.ts +81 -0
- package/dist/components/pill/PlPill.js +154 -0
- package/dist/components/pill/index.d.ts +2 -0
- package/dist/components/pill/index.js +1 -0
- package/dist/components/popover/PlPopover.d.ts +107 -0
- package/dist/components/popover/PlPopover.js +113 -0
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/popover/index.js +1 -0
- package/dist/components/progress-box/PlProgressBox.d.ts +32 -0
- package/dist/components/progress-box/PlProgressBox.js +34 -0
- package/dist/components/progress-box/index.d.ts +2 -0
- package/dist/components/progress-box/index.js +1 -0
- package/dist/components/progress-circular/PlProgressCircular.d.ts +22 -0
- package/dist/components/progress-circular/PlProgressCircular.js +47 -0
- package/dist/components/progress-circular/index.d.ts +2 -0
- package/dist/components/progress-circular/index.js +1 -0
- package/dist/components/progress-linear/PlProgressLinear.d.ts +31 -0
- package/dist/components/progress-linear/PlProgressLinear.js +40 -0
- package/dist/components/progress-linear/index.d.ts +2 -0
- package/dist/components/progress-linear/index.js +1 -0
- package/dist/components/radio-group/PlRadioGroup.d.ts +54 -0
- package/dist/components/radio-group/PlRadioGroup.js +99 -0
- package/dist/components/radio-group/index.d.ts +2 -0
- package/dist/components/radio-group/index.js +1 -0
- package/dist/components/rating/PlRating.d.ts +90 -0
- package/dist/components/rating/PlRating.js +101 -0
- package/dist/components/rating/index.d.ts +2 -0
- package/dist/components/rating/index.js +1 -0
- package/dist/components/scroll-zone/PlScrollZone.d.ts +132 -0
- package/dist/components/scroll-zone/PlScrollZone.js +411 -0
- package/dist/components/scroll-zone/index.d.ts +2 -0
- package/dist/components/scroll-zone/index.js +1 -0
- package/dist/components/segmented-button/PlSegmentedButton.d.ts +79 -0
- package/dist/components/segmented-button/PlSegmentedButton.js +206 -0
- package/dist/components/segmented-button/index.d.ts +2 -0
- package/dist/components/segmented-button/index.js +1 -0
- package/dist/components/select/PlSelect.d.ts +77 -0
- package/dist/components/select/PlSelect.js +115 -0
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/index.js +1 -0
- package/dist/components/skeleton/PlSkeleton.d.ts +73 -0
- package/dist/components/skeleton/PlSkeleton.js +142 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/skeleton/index.js +1 -0
- package/dist/components/slider/PlSlider.d.ts +44 -0
- package/dist/components/slider/PlSlider.js +132 -0
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/slider/index.js +1 -0
- package/dist/components/spoiler/PlSpoiler.d.ts +84 -0
- package/dist/components/spoiler/PlSpoiler.js +74 -0
- package/dist/components/spoiler/index.d.ts +2 -0
- package/dist/components/spoiler/index.js +1 -0
- package/dist/components/switch/PlSwitch.d.ts +42 -0
- package/dist/components/switch/PlSwitch.js +131 -0
- package/dist/components/switch/index.d.ts +2 -0
- package/dist/components/switch/index.js +1 -0
- package/dist/components/table/PlTable.d.ts +112 -0
- package/dist/components/table/PlTable.js +210 -0
- package/dist/components/table/index.d.ts +2 -0
- package/dist/components/table/index.js +1 -0
- package/dist/components/tabs/PlTabs.d.ts +94 -0
- package/dist/components/tabs/PlTabs.js +182 -0
- package/dist/components/tabs/index.d.ts +2 -0
- package/dist/components/tabs/index.js +1 -0
- package/dist/components/text-field/{TextField.d.ts → PlTextField.d.ts} +5 -5
- package/dist/components/text-field/PlTextField.js +126 -0
- package/dist/components/text-field/index.d.ts +2 -2
- package/dist/components/text-field/index.js +1 -1
- package/dist/components/text-link/PlTextLink.d.ts +80 -0
- package/dist/components/text-link/PlTextLink.js +136 -0
- package/dist/components/text-link/index.d.ts +2 -0
- package/dist/components/text-link/index.js +1 -0
- package/dist/components/time-picker/PlTimePicker.d.ts +88 -0
- package/dist/components/time-picker/PlTimePicker.js +97 -0
- package/dist/components/time-picker/index.d.ts +2 -0
- package/dist/components/time-picker/index.js +1 -0
- package/dist/components/timeline/PlTimeline.d.ts +98 -0
- package/dist/components/timeline/PlTimeline.js +207 -0
- package/dist/components/timeline/index.d.ts +2 -0
- package/dist/components/timeline/index.js +1 -0
- package/dist/components/toast/PlToast.d.ts +122 -0
- package/dist/components/toast/PlToast.js +174 -0
- package/dist/components/toast/index.d.ts +2 -0
- package/dist/components/toast/index.js +1 -0
- package/dist/components/toolbar/PlToolbar.d.ts +68 -0
- package/dist/components/toolbar/PlToolbar.js +65 -0
- package/dist/components/toolbar/index.d.ts +2 -0
- package/dist/components/toolbar/index.js +1 -0
- package/dist/components/tooltip/PlTooltip.d.ts +92 -0
- package/dist/components/tooltip/PlTooltip.js +117 -0
- package/dist/components/tooltip/index.d.ts +2 -0
- package/dist/components/tooltip/index.js +1 -0
- package/dist/components/typography/PlTypography.d.ts +66 -0
- package/dist/components/typography/PlTypography.js +143 -0
- package/dist/components/typography/index.d.ts +2 -0
- package/dist/components/typography/index.js +1 -0
- package/dist/css/accordion.css +2 -0
- package/dist/css/alert.css +2 -0
- package/dist/css/animate-appear.css +2 -0
- package/dist/css/animate-blink.css +2 -0
- package/dist/css/animate-fade.css +2 -0
- package/dist/css/animate-grow.css +2 -0
- package/dist/css/animate-headline.css +2 -0
- package/dist/css/animate-lighting.css +2 -0
- package/dist/css/animate-marquee.css +2 -0
- package/dist/css/animate-rotate.css +2 -0
- package/dist/css/animate-slide.css +2 -0
- package/dist/css/animate-typing.css +2 -0
- package/dist/css/animate-zoom.css +2 -0
- package/dist/css/aspect-ratio.css +2 -0
- package/dist/css/avatar.css +2 -0
- package/dist/css/badge.css +2 -0
- package/dist/css/base.css +4 -0
- package/dist/css/blockquote.css +2 -0
- package/dist/css/bottom-navigation.css +2 -0
- package/dist/css/box.css +2 -0
- package/dist/css/breadcrumb.css +2 -0
- package/dist/css/button-group.css +2 -0
- package/dist/css/button.css +2 -0
- package/dist/css/card.css +2 -0
- package/dist/css/carousel.css +2 -0
- package/dist/css/chat-bubble.css +2 -0
- package/dist/css/checkbox.css +2 -0
- package/dist/css/chip.css +2 -0
- package/dist/css/collapsible.css +2 -0
- package/dist/css/combobox.css +2 -0
- package/dist/css/container.css +2 -0
- package/dist/css/date-picker.css +2 -0
- package/dist/css/date-range-picker.css +2 -0
- package/dist/css/date-time-picker.css +2 -0
- package/dist/css/divider.css +2 -0
- package/dist/css/drawer.css +2 -0
- package/dist/css/file-picker.css +2 -0
- package/dist/css/floating-bottom-navigation.css +2 -0
- package/dist/css/grid.css +2 -0
- package/dist/css/highlight.css +2 -0
- package/dist/css/hot-keys.css +2 -0
- package/dist/css/icon-button.css +2 -0
- package/dist/css/icon.css +2 -0
- package/dist/css/list.css +2 -0
- package/dist/css/menu.css +2 -0
- package/dist/css/modal.css +2 -0
- package/dist/css/number-field.css +2 -0
- package/dist/css/otp-field.css +2 -0
- package/dist/css/overlay.css +2 -0
- package/dist/css/pagination.css +2 -0
- package/dist/css/panes.css +2 -0
- package/dist/css/pill.css +2 -0
- package/dist/css/popover.css +2 -0
- package/dist/css/progress-box.css +2 -0
- package/dist/css/progress-circular.css +2 -0
- package/dist/css/progress-linear.css +2 -0
- package/dist/css/radio-group.css +2 -0
- package/dist/css/rating.css +2 -0
- package/dist/css/scroll-zone.css +2 -0
- package/dist/css/segmented-button.css +2 -0
- package/dist/css/select.css +2 -0
- package/dist/css/skeleton.css +2 -0
- package/dist/css/slider.css +2 -0
- package/dist/css/spoiler.css +2 -0
- package/dist/css/switch.css +2 -0
- package/dist/css/table.css +2 -0
- package/dist/css/tabs.css +2 -0
- package/dist/css/text-field.css +2 -0
- package/dist/css/text-link.css +2 -0
- package/dist/css/time-picker.css +2 -0
- package/dist/css/timeline.css +2 -0
- package/dist/css/toast.css +2 -0
- package/dist/css/toolbar.css +2 -0
- package/dist/css/tooltip.css +2 -0
- package/dist/css/typography.css +2 -0
- package/dist/index.d.ts +75 -3
- package/dist/index.js +75 -1
- package/dist/internal/animate.d.ts +161 -0
- package/dist/internal/animate.js +318 -0
- package/dist/internal/button-group.d.ts +27 -0
- package/dist/internal/button-group.js +19 -0
- package/dist/internal/calendar.d.ts +148 -0
- package/dist/internal/calendar.js +501 -0
- package/dist/internal/date.d.ts +173 -0
- package/dist/internal/date.js +353 -0
- package/dist/internal/format.d.ts +24 -0
- package/dist/internal/format.js +41 -0
- package/dist/internal/grid.d.ts +67 -0
- package/dist/internal/grid.js +143 -0
- package/dist/internal/icons.d.ts +86 -1
- package/dist/internal/icons.js +138 -1
- package/dist/internal/menu.d.ts +20 -0
- package/dist/internal/menu.js +18 -0
- package/dist/internal/picker.d.ts +118 -0
- package/dist/internal/picker.js +139 -0
- package/dist/internal/progress.d.ts +145 -0
- package/dist/internal/progress.js +167 -0
- package/dist/internal/sizer.d.ts +32 -0
- package/dist/internal/sizer.js +35 -0
- package/dist/internal/styles.d.ts +198 -8
- package/dist/internal/styles.js +636 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +899 -125
- package/dist/tokens.css +1275 -0
- package/dist/types.d.ts +150 -8
- package/dist/types.js +1 -1
- package/package.json +31 -27
- package/README.md +0 -111
- package/dist/components/button/Button.js +0 -1
- package/dist/components/text-field/TextField.js +0 -1
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { CloseIcon } from '../../internal/icons.js';
|
|
4
|
+
import { controlTextLeadingClasses, disabledClasses, focusRingClasses, gapClasses, glassClasses, hasContent, iconClasses, metaTextClasses, radiusClasses, readOnlyFilterClasses, sheetTitleClasses, stackGapClasses, surfaceSlots, transitionClasses } from '../../internal/styles.js';
|
|
5
|
+
/**
|
|
6
|
+
* The box's inner padding. Its own ladder rather than the sheet's, because a
|
|
7
|
+
* dropzone is sized by the gesture it has to catch rather than by what is
|
|
8
|
+
* written in it: a target the height of one line of text is a target you miss.
|
|
9
|
+
*/
|
|
10
|
+
const zonePaddingClasses = {
|
|
11
|
+
default: { xs: 'p-4', sm: 'p-5', md: 'p-6', lg: 'p-8', xl: 'p-10' },
|
|
12
|
+
compact: { xs: 'p-2', sm: 'p-3', md: 'p-4', lg: 'p-5', xl: 'p-6' }
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The three materials, said the way a *container* says them — the sheet is
|
|
16
|
+
* never dyed. What is dropped on it is other people's content.
|
|
17
|
+
*
|
|
18
|
+
* The dashed edge is the one thing all three share, and the one place the
|
|
19
|
+
* library draws a line that is not solid. It is not decoration: a dashed
|
|
20
|
+
* rectangle is the established sign for "this area accepts a drop", and a
|
|
21
|
+
* dropzone that looks like a PlCard is a PlCard nobody tries to drop on.
|
|
22
|
+
*
|
|
23
|
+
* The edge is neutral at rest and takes the family only once the pointer is on
|
|
24
|
+
* it, which is the same arrangement a `glass` PlButton has: the colour is what
|
|
25
|
+
* happens when you engage with the thing, not what the thing is.
|
|
26
|
+
*/
|
|
27
|
+
const zoneRestClasses = {
|
|
28
|
+
solid: /* @__PURE__ */ [
|
|
29
|
+
glassClasses,
|
|
30
|
+
'border-2 border-dashed text-(--plass-fg) bg-(--plass-glass-press)',
|
|
31
|
+
'[border-color:var(--plass-border)]',
|
|
32
|
+
'[box-shadow:var(--p-elev),var(--plass-gloss-glass)]'
|
|
33
|
+
].join(' '),
|
|
34
|
+
glass: /* @__PURE__ */ [
|
|
35
|
+
glassClasses,
|
|
36
|
+
'border-2 border-dashed text-(--plass-fg) bg-(--plass-glass)',
|
|
37
|
+
'[border-color:var(--plass-border)]',
|
|
38
|
+
'[box-shadow:var(--p-elev),var(--plass-gloss-glass)]'
|
|
39
|
+
].join(' '),
|
|
40
|
+
ghost: 'border-2 border-dashed text-(--plass-fg) bg-transparent [border-color:var(--plass-border)]'
|
|
41
|
+
};
|
|
42
|
+
const zoneHoverClasses = {
|
|
43
|
+
solid: 'hover:bg-(--plass-glass-hover) hover:[border-color:var(--p-line-hover)]',
|
|
44
|
+
glass: 'hover:bg-(--plass-glass-hover) hover:[border-color:var(--p-line-hover)]',
|
|
45
|
+
ghost: 'hover:bg-(--p-soft) hover:[border-color:var(--p-line-hover)]'
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* While a file is over the box.
|
|
49
|
+
*
|
|
50
|
+
* Colour and edge only, and the same two the hover state already uses, one step
|
|
51
|
+
* further along — a dropzone that grows or lifts under the pointer moves the
|
|
52
|
+
* target while the reader is aiming at it.
|
|
53
|
+
*/
|
|
54
|
+
const zoneOverClasses = 'bg-(--p-soft-hover) [border-color:var(--p-ring)]';
|
|
55
|
+
function UploadIcon() {
|
|
56
|
+
return (_jsxs("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [_jsx("path", { d: "M8 10.5V2.75m0 0L5.25 5.5M8 2.75 10.75 5.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M2.75 9.75v1.75a1.75 1.75 0 0 0 1.75 1.75h7a1.75 1.75 0 0 0 1.75-1.75V9.75", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })] }));
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* `1.4 MB`, in the units a person reading a file list expects.
|
|
60
|
+
*
|
|
61
|
+
* Base 1000 rather than 1024, and `MB` rather than `MiB`: it is the number
|
|
62
|
+
* every operating system's file browser shows, and a picker that disagrees with
|
|
63
|
+
* the Finder about how big the file is has picked a fight it cannot win.
|
|
64
|
+
*/
|
|
65
|
+
export function formatFileSize(bytes) {
|
|
66
|
+
if (bytes < 1000) {
|
|
67
|
+
return `${bytes} B`;
|
|
68
|
+
}
|
|
69
|
+
const units = ['kB', 'MB', 'GB', 'TB'];
|
|
70
|
+
let value = bytes / 1000;
|
|
71
|
+
let unit = 0;
|
|
72
|
+
while (value >= 1000 && unit < units.length - 1) {
|
|
73
|
+
value /= 1000;
|
|
74
|
+
unit += 1;
|
|
75
|
+
}
|
|
76
|
+
return `${value < 10 ? value.toFixed(1) : Math.round(value)} ${units[unit]}`;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Whether a file matches an `accept` string.
|
|
80
|
+
*
|
|
81
|
+
* The browser applies `accept` to its own picker and to nothing else, so a file
|
|
82
|
+
* that arrives by drag has never been checked against it. This is that check:
|
|
83
|
+
* the same three forms the attribute takes — `.ext`, `type/subtype`, `type/*`.
|
|
84
|
+
*/
|
|
85
|
+
function matchesAccept(file, accept) {
|
|
86
|
+
const name = file.name.toLowerCase();
|
|
87
|
+
const type = file.type.toLowerCase();
|
|
88
|
+
return accept
|
|
89
|
+
.split(',')
|
|
90
|
+
.map((entry) => entry.trim().toLowerCase())
|
|
91
|
+
.filter(Boolean)
|
|
92
|
+
.some((entry) => {
|
|
93
|
+
if (entry.startsWith('.')) {
|
|
94
|
+
return name.endsWith(entry);
|
|
95
|
+
}
|
|
96
|
+
if (entry.endsWith('/*')) {
|
|
97
|
+
return type.startsWith(entry.slice(0, -1));
|
|
98
|
+
}
|
|
99
|
+
return type === entry;
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* A box you drop files on, or click to open the file dialog.
|
|
104
|
+
*
|
|
105
|
+
* There is no Base UI primitive under this, and the fallback the library allows
|
|
106
|
+
* — plain React and DOM — is the right one: a dropzone is a `<div>` listening
|
|
107
|
+
* for four drag events and an `<input type="file">` it clicks for you. There is
|
|
108
|
+
* no popup to position, no focus to trap and no roving anything.
|
|
109
|
+
*
|
|
110
|
+
* What that leaves is the part every hand-rolled dropzone gets wrong. The drag
|
|
111
|
+
* counter is one: `dragenter` and `dragleave` both fire as the pointer crosses
|
|
112
|
+
* a *child* of the zone, so a zone that toggles a boolean flickers the whole
|
|
113
|
+
* time a file is dragged across its own contents. Counting them is the fix. The
|
|
114
|
+
* other is `accept`, which the browser enforces on its own dialog and never on
|
|
115
|
+
* a drop, so a dropzone that only sets the attribute accepts anything the
|
|
116
|
+
* moment a file arrives by drag.
|
|
117
|
+
*
|
|
118
|
+
* The shell is a `<div>` and the pressable area inside it is a real `<button>`,
|
|
119
|
+
* with the file list outside that button — the remove buttons cannot be nested
|
|
120
|
+
* inside the browse button.
|
|
121
|
+
*/
|
|
122
|
+
export const PlFilePicker = /* @__PURE__ */ React.forwardRef(function PlFilePicker({ variant = 'glass', size = 'md', color = 'primary', density = 'default', elevation = 0, accept, multiple = false, maxSize, maxFiles, value, defaultValue, onFilesChange, onReject, label, description, error, invalid, title, hint, icon, showList = true, removeLabel = (name) => `Remove ${name}`, fullWidth = true, disabled = false, readOnly = false, required = false, name, id, className, style, ...props }, ref) {
|
|
123
|
+
const inputRef = React.useRef(null);
|
|
124
|
+
React.useImperativeHandle(ref, () => inputRef.current);
|
|
125
|
+
const [uncontrolled, setUncontrolled] = React.useState(() => [...(defaultValue ?? [])]);
|
|
126
|
+
// The copy is what stops a caller's array being the one held here, and it
|
|
127
|
+
// has to be memoised: the handlers below close over this list, and a fresh
|
|
128
|
+
// array every render would rebuild all of them every render.
|
|
129
|
+
const files = React.useMemo(() => (value ? [...value] : uncontrolled), [value, uncontrolled]);
|
|
130
|
+
// `dragenter`/`dragleave` fire for every child the pointer crosses, so a
|
|
131
|
+
// boolean flickers the whole time a file is over the box. The depth counter
|
|
132
|
+
// is the only thing that survives a zone with content in it.
|
|
133
|
+
const dragDepth = React.useRef(0);
|
|
134
|
+
const [over, setOver] = React.useState(false);
|
|
135
|
+
const hasError = hasContent(error);
|
|
136
|
+
const isInvalid = invalid ?? hasError;
|
|
137
|
+
// Invalid re-points the whole slot family at `danger`, so the edge, the ring
|
|
138
|
+
// and the message all turn over together — the same wiring PlTextField uses.
|
|
139
|
+
const family = isInvalid ? 'danger' : color;
|
|
140
|
+
const inert = disabled || readOnly;
|
|
141
|
+
const descriptionId = React.useId();
|
|
142
|
+
const commit = React.useCallback((next) => {
|
|
143
|
+
if (!value) {
|
|
144
|
+
setUncontrolled(next);
|
|
145
|
+
}
|
|
146
|
+
onFilesChange?.(next);
|
|
147
|
+
}, [onFilesChange, value]);
|
|
148
|
+
/**
|
|
149
|
+
* Sorts an incoming batch into kept and rejected.
|
|
150
|
+
*
|
|
151
|
+
* The count is checked against what is *already* held rather than against
|
|
152
|
+
* the batch, which is the difference between "you may drop five files" and
|
|
153
|
+
* "you may end up with five files" — only the second is what `maxFiles`
|
|
154
|
+
* means.
|
|
155
|
+
*/
|
|
156
|
+
const accepting = React.useCallback((incoming) => {
|
|
157
|
+
const kept = [];
|
|
158
|
+
const rejections = [];
|
|
159
|
+
const room = multiple ? (maxFiles ?? Number.POSITIVE_INFINITY) : 1;
|
|
160
|
+
const held = multiple ? files.length : 0;
|
|
161
|
+
for (const file of incoming) {
|
|
162
|
+
if (accept && !matchesAccept(file, accept)) {
|
|
163
|
+
rejections.push({ file, reason: 'type' });
|
|
164
|
+
}
|
|
165
|
+
else if (maxSize !== undefined && file.size > maxSize) {
|
|
166
|
+
rejections.push({ file, reason: 'size' });
|
|
167
|
+
}
|
|
168
|
+
else if (held + kept.length >= room) {
|
|
169
|
+
rejections.push({ file, reason: 'count' });
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
kept.push(file);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return { kept, rejections };
|
|
176
|
+
}, [accept, files.length, maxFiles, maxSize, multiple]);
|
|
177
|
+
const add = React.useCallback((incoming) => {
|
|
178
|
+
const { kept, rejections } = accepting(incoming);
|
|
179
|
+
if (rejections.length > 0) {
|
|
180
|
+
onReject?.(rejections);
|
|
181
|
+
}
|
|
182
|
+
if (kept.length > 0) {
|
|
183
|
+
commit(multiple ? [...files, ...kept] : kept);
|
|
184
|
+
}
|
|
185
|
+
}, [accepting, commit, files, multiple, onReject]);
|
|
186
|
+
const browse = () => {
|
|
187
|
+
if (inert) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
// Cleared first, so choosing the same file twice in a row still fires
|
|
191
|
+
// `change` — the input holds its value otherwise and the second pick is
|
|
192
|
+
// silently dropped.
|
|
193
|
+
if (inputRef.current) {
|
|
194
|
+
inputRef.current.value = '';
|
|
195
|
+
inputRef.current.click();
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
const zoneClassNames = [
|
|
199
|
+
'flex w-full flex-col items-center justify-center text-center',
|
|
200
|
+
'cursor-pointer select-none',
|
|
201
|
+
zonePaddingClasses[density][size],
|
|
202
|
+
radiusClasses[size],
|
|
203
|
+
gapClasses[size],
|
|
204
|
+
transitionClasses,
|
|
205
|
+
iconClasses,
|
|
206
|
+
focusRingClasses,
|
|
207
|
+
// An if/else rather than stacked variants: two Tailwind classes of equal
|
|
208
|
+
// specificity resolve by their order in the generated stylesheet.
|
|
209
|
+
disabled
|
|
210
|
+
? `${disabledClasses[variant]} border-2 border-dashed`
|
|
211
|
+
: readOnly
|
|
212
|
+
? `${zoneRestClasses[variant]} ${readOnlyFilterClasses} cursor-default`
|
|
213
|
+
: zoneRestClasses[variant],
|
|
214
|
+
!inert ? zoneHoverClasses[variant] : '',
|
|
215
|
+
over && !inert ? zoneOverClasses : ''
|
|
216
|
+
]
|
|
217
|
+
.filter(Boolean)
|
|
218
|
+
.join(' ');
|
|
219
|
+
return (_jsxs("div", { className: [
|
|
220
|
+
'flex-col align-top',
|
|
221
|
+
stackGapClasses[size],
|
|
222
|
+
fullWidth ? 'flex w-full' : 'inline-flex',
|
|
223
|
+
className ?? ''
|
|
224
|
+
]
|
|
225
|
+
.filter(Boolean)
|
|
226
|
+
.join(' '), style: { ...surfaceSlots(family, elevation), ...style }, ...props, children: [hasContent(label) ? (_jsx("span", { className: [
|
|
227
|
+
metaTextClasses[size],
|
|
228
|
+
'font-semibold',
|
|
229
|
+
disabled ? 'text-(--plass-muted-fg)' : 'text-(--plass-fg)'
|
|
230
|
+
].join(' '), children: label })) : null, _jsxs("div", { className: "flex w-full flex-col", onDragEnter: (event) => {
|
|
231
|
+
if (inert) {
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
event.preventDefault();
|
|
235
|
+
dragDepth.current += 1;
|
|
236
|
+
setOver(true);
|
|
237
|
+
}, onDragOver: (event) => {
|
|
238
|
+
if (inert) {
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
// Without this the browser navigates to the file instead of
|
|
242
|
+
// dropping it, which is the default and is never what anybody wants.
|
|
243
|
+
event.preventDefault();
|
|
244
|
+
event.dataTransfer.dropEffect = 'copy';
|
|
245
|
+
}, onDragLeave: () => {
|
|
246
|
+
if (inert) {
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
dragDepth.current = Math.max(0, dragDepth.current - 1);
|
|
250
|
+
if (dragDepth.current === 0) {
|
|
251
|
+
setOver(false);
|
|
252
|
+
}
|
|
253
|
+
}, onDrop: (event) => {
|
|
254
|
+
if (inert) {
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
event.preventDefault();
|
|
258
|
+
dragDepth.current = 0;
|
|
259
|
+
setOver(false);
|
|
260
|
+
add(Array.from(event.dataTransfer.files));
|
|
261
|
+
}, children: [_jsxs("button", { type: "button", id: id, disabled: disabled, "aria-describedby": hasContent(description) || hasError ? descriptionId : undefined, "aria-invalid": isInvalid || undefined, className: zoneClassNames, onClick: browse, children: [icon === undefined ? (_jsx("span", { className: "flex items-center text-(--p-accent) [&_svg]:size-[1.8em]", children: _jsx(UploadIcon, {}) })) : hasContent(icon) ? (_jsx("span", { className: "flex items-center text-(--p-accent) [&_svg]:size-[1.8em]", children: icon })) : null, _jsx("span", { className: `font-semibold ${sheetTitleClasses[size]}`, children: title ?? 'Drop files here, or click to browse' }), hasContent(hint) ? (_jsx("span", { className: `text-(--plass-muted-fg) ${metaTextClasses[size]}`, children: hint })) : null] }), _jsx("input", { ref: inputRef, type: "file", name: name, accept: accept, multiple: multiple, required: required && files.length === 0, disabled: inert, tabIndex: -1, "aria-hidden": "true", className: "absolute size-px overflow-hidden opacity-0 [clip-path:inset(50%)]", onChange: (event) => add(Array.from(event.target.files ?? [])) })] }), showList && files.length > 0 ? (_jsx("ul", { role: "list", className: `flex w-full flex-col ${stackGapClasses[size]} m-0 list-none p-0`, children: files.map((file, index) => (_jsxs("li", { className: [
|
|
262
|
+
'flex w-full items-center gap-2 px-2 py-1.5',
|
|
263
|
+
radiusClasses.xs,
|
|
264
|
+
controlTextLeadingClasses[size],
|
|
265
|
+
'bg-(--p-soft) text-(--plass-fg)'
|
|
266
|
+
].join(' '), children: [_jsx("span", { className: "min-w-0 flex-1 truncate", children: file.name }), _jsx("span", { className: `shrink-0 text-(--plass-muted-fg) tabular-nums ${metaTextClasses[size]}`, children: formatFileSize(file.size) }), inert ? null : (_jsx("button", { type: "button", "aria-label": removeLabel(file.name), className: [
|
|
267
|
+
'inline-flex shrink-0 cursor-pointer items-center justify-center rounded-full',
|
|
268
|
+
'size-[1.3em] text-(--plass-muted-fg) opacity-70',
|
|
269
|
+
'[transition:opacity_var(--plass-duration)_var(--plass-ease),color_var(--plass-duration)_var(--plass-ease)]',
|
|
270
|
+
'[&_svg]:size-[0.9em]',
|
|
271
|
+
'hover:text-(--plass-fg) hover:opacity-100 focus-visible:opacity-100',
|
|
272
|
+
focusRingClasses
|
|
273
|
+
].join(' '), onClick: () => commit(files.filter((_, at) => at !== index)), children: _jsx(CloseIcon, {}) }))] }, `${file.name}-${file.size}-${file.lastModified}-${index}`))) })) : null, hasContent(description) && !hasError ? (_jsx("span", { id: descriptionId, className: `${metaTextClasses[size]} text-(--plass-muted-fg)`, children: description })) : null, hasError ? (_jsx("span", { id: descriptionId, className: `${metaTextClasses[size]} text-(--p-accent)`, children: error })) : null] }));
|
|
274
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PlFilePicker, formatFileSize } from './PlFilePicker.js';
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import type { PlassElevation, PlassPosition, PlassStyleProps } from '../../types.js';
|
|
4
|
+
/** A destination's value. The same restraint `PlBottomNavigation` puts on its own. */
|
|
5
|
+
export type PlFloatingBottomNavigationValue = string | number;
|
|
6
|
+
export interface PlFloatingBottomNavigationProps extends Omit<PlassStyleProps, 'variant'>, Omit<React.ComponentPropsWithoutRef<'nav'>, 'color' | 'defaultValue' | 'onChange'> {
|
|
7
|
+
/**
|
|
8
|
+
* What the capsule is made of.
|
|
9
|
+
*
|
|
10
|
+
* `glass` is the default and the whole point: a clear sheet over a blurred
|
|
11
|
+
* backdrop with a hairline around it, floating clear of the page. `solid` is
|
|
12
|
+
* the same sheet at its most opaque, for a bar that sits over photography.
|
|
13
|
+
* `ghost` has no capsule at all — the discs float on their own.
|
|
14
|
+
* @default 'glass'
|
|
15
|
+
*/
|
|
16
|
+
variant?: PlassStyleProps['variant'];
|
|
17
|
+
/** The destination the reader is on. Use with `onValueChange` for a controlled bar. */
|
|
18
|
+
value?: PlFloatingBottomNavigationValue | null;
|
|
19
|
+
/** Which starts current, for an uncontrolled bar. */
|
|
20
|
+
defaultValue?: PlFloatingBottomNavigationValue | null;
|
|
21
|
+
onValueChange?: (value: PlFloatingBottomNavigationValue) => void;
|
|
22
|
+
/**
|
|
23
|
+
* How the bar sits in the page's scroll.
|
|
24
|
+
* @default 'fixed'
|
|
25
|
+
*/
|
|
26
|
+
position?: PlassPosition;
|
|
27
|
+
/**
|
|
28
|
+
* Keeps the bar clear of the home indicator on a phone, by adding
|
|
29
|
+
* `env(safe-area-inset-bottom)` to the gap under it.
|
|
30
|
+
* @default true
|
|
31
|
+
*/
|
|
32
|
+
safeArea?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Drop shadow depth. `2`, against the `0` a bar attached to the window edge
|
|
35
|
+
* takes.
|
|
36
|
+
*
|
|
37
|
+
* That is not an inconsistency: this bar is defined by **not** being part of
|
|
38
|
+
* the page. Every other sheet in the library rests on the page and earns its
|
|
39
|
+
* separation from the glass edge, so a shadow is opt-in; this one hovers over
|
|
40
|
+
* whatever is underneath it, and a capsule lying flat on the content it is
|
|
41
|
+
* floating over reads as a mistake.
|
|
42
|
+
* @default 2
|
|
43
|
+
*/
|
|
44
|
+
elevation?: PlassElevation;
|
|
45
|
+
/** Every destination stops answering. */
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
/** The name the bar is announced by — "Main", "Sections". */
|
|
48
|
+
label?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Renders something other than a `<nav>`. Rarely what you want here: a row of
|
|
51
|
+
* destinations is navigation.
|
|
52
|
+
*/
|
|
53
|
+
render?: useRender.RenderProp;
|
|
54
|
+
/** The `PlFloatingBottomNavigationItem`s. */
|
|
55
|
+
children?: React.ReactNode;
|
|
56
|
+
}
|
|
57
|
+
export interface PlFloatingBottomNavigationItemProps extends Omit<React.ComponentPropsWithoutRef<'button'>, 'value' | 'color'> {
|
|
58
|
+
/** Identifies the destination. What `onValueChange` reports. */
|
|
59
|
+
value: PlFloatingBottomNavigationValue;
|
|
60
|
+
/** The glyph. It is the whole of what a reader sees. */
|
|
61
|
+
icon?: React.ReactNode;
|
|
62
|
+
/** Renders the item as a link rather than as a button. */
|
|
63
|
+
href?: string;
|
|
64
|
+
/** Unavailable, but still part of the set. */
|
|
65
|
+
disabled?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* The destination's name.
|
|
68
|
+
*
|
|
69
|
+
* **Never drawn, always read.** A row of glyphs with no names is a row of
|
|
70
|
+
* unnamed buttons, which is the defect this prop exists to make impossible.
|
|
71
|
+
*/
|
|
72
|
+
children?: React.ReactNode;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* A row of round destinations floating clear of the bottom edge of the window.
|
|
76
|
+
*
|
|
77
|
+
* The other half of `PlBottomNavigation`, and a different object rather than a
|
|
78
|
+
* variant of one: that bar is **attached** to the edge of the window — full
|
|
79
|
+
* width, a hairline against the content, its sheet running under the home
|
|
80
|
+
* indicator — and this one is **not part of the page at all**. Everything that
|
|
81
|
+
* follows comes from that one difference: the capsule, the gap under it, the
|
|
82
|
+
* shadow it defaults to, and the pill corners it is allowed.
|
|
83
|
+
*
|
|
84
|
+
* Every destination is a disc with a glyph in it and no name drawn, which is
|
|
85
|
+
* what keeps a row of five inside the width of a phone. The name is still
|
|
86
|
+
* required and still read out — a row of glyphs with no accessible names is the
|
|
87
|
+
* defect `PlIconButton`'s `label` exists to make impossible, and it would be
|
|
88
|
+
* exactly as easy to ship here.
|
|
89
|
+
*
|
|
90
|
+
* The current destination is a key of **tinted glass** riding in the clear
|
|
91
|
+
* sheet, which is the design language's own sentence with nothing added to it.
|
|
92
|
+
* The key is **one element that travels**, measured off whichever disc is
|
|
93
|
+
* current and animated the way a `PlSegmentedButton`'s tile is — not a fill
|
|
94
|
+
* that appears on one disc while it disappears from another. Two discs
|
|
95
|
+
* cross-fading is two objects; a bar with a key in it has one, and where it
|
|
96
|
+
* goes is the whole of what the component has to say.
|
|
97
|
+
*
|
|
98
|
+
* Nothing is transformed: the key is an empty box, and no glyph is resampled
|
|
99
|
+
* while it travels. That is what lets the house no-transform rule survive a
|
|
100
|
+
* component whose entire point is that something moves.
|
|
101
|
+
*
|
|
102
|
+
* It reads `controlSlots` and not the `surfaceSlots` every other container
|
|
103
|
+
* takes, which is the one place this bar is not a container: the slots a
|
|
104
|
+
* container is given are deliberately undyed — no `--p-fill`, no `--p-on-solid`
|
|
105
|
+
* and no `--p-lift` — and the key is made of all three. Asking a container's
|
|
106
|
+
* slot set for a control's colours is asking for `var(--p-fill)` to resolve to
|
|
107
|
+
* nothing, which is a `background-image` the browser drops on the floor and a
|
|
108
|
+
* current destination that looks exactly like the four beside it.
|
|
109
|
+
*/
|
|
110
|
+
export declare const PlFloatingBottomNavigation: React.ForwardRefExoticComponent<PlFloatingBottomNavigationProps & React.RefAttributes<HTMLElement>>;
|
|
111
|
+
/**
|
|
112
|
+
* One destination, as a disc.
|
|
113
|
+
*
|
|
114
|
+
* It has no `size`, no `color` and no `variant` of its own: all three belong to
|
|
115
|
+
* the bar, which is the only place they can be set once and mean the same thing
|
|
116
|
+
* for every disc.
|
|
117
|
+
*/
|
|
118
|
+
export declare const PlFloatingBottomNavigationItem: React.ForwardRefExoticComponent<PlFloatingBottomNavigationItemProps & React.RefAttributes<HTMLElement>>;
|