plass-ui 1.6.0 → 1.8.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/CHANGELOG.md +494 -0
- package/README.md +5 -3
- package/dist/components/accordion/PlAccordion.d.ts +19 -1
- package/dist/components/accordion/PlAccordion.js +1 -1
- package/dist/components/accordion/index.d.ts +1 -1
- package/dist/components/alert/PlAlert.js +1 -1
- package/dist/components/anchor/PlAnchor.js +1 -1
- package/dist/components/animate-appear/PlAnimateAppear.js +1 -1
- package/dist/components/animate-counter/PlAnimateCounter.d.ts +5 -2
- package/dist/components/animate-counter/PlAnimateCounter.js +1 -1
- package/dist/components/animate-float/PlAnimateFloat.js +1 -1
- package/dist/components/animate-headline/PlAnimateHeadline.d.ts +10 -1
- package/dist/components/animate-headline/PlAnimateHeadline.js +1 -1
- package/dist/components/animate-lighting/PlAnimateLighting.js +1 -1
- package/dist/components/animate-marquee/PlAnimateMarquee.d.ts +8 -1
- package/dist/components/animate-marquee/PlAnimateMarquee.js +1 -1
- package/dist/components/animate-scramble/PlAnimateScramble.js +1 -1
- package/dist/components/animate-shake/PlAnimateShake.js +1 -1
- package/dist/components/animate-split/PlAnimateSplit.js +1 -1
- package/dist/components/animate-typing/PlAnimateTyping.js +1 -1
- package/dist/components/app-logo/PlAppLogo.d.ts +51 -15
- package/dist/components/app-logo/PlAppLogo.js +1 -1
- package/dist/components/area-chart/PlAreaChart.d.ts +35 -6
- package/dist/components/area-chart/PlAreaChart.js +1 -1
- package/dist/components/aspect-ratio/PlAspectRatio.js +1 -1
- package/dist/components/avatar/PlAvatar.js +1 -1
- package/dist/components/back-top/PlBackTop.d.ts +5 -5
- package/dist/components/back-top/PlBackTop.js +1 -1
- package/dist/components/badge/PlBadge.js +1 -1
- package/dist/components/bar-chart/PlBarChart.d.ts +54 -2
- package/dist/components/bar-chart/PlBarChart.js +1 -1
- package/dist/components/blockquote/PlBlockquote.d.ts +2 -2
- package/dist/components/blockquote/PlBlockquote.js +1 -1
- package/dist/components/bottom-navigation/PlBottomNavigation.d.ts +15 -5
- package/dist/components/bottom-navigation/PlBottomNavigation.js +1 -1
- package/dist/components/breadcrumb/PlBreadcrumb.d.ts +16 -3
- package/dist/components/breadcrumb/PlBreadcrumb.js +1 -1
- package/dist/components/button/PlButton.d.ts +7 -0
- package/dist/components/button/PlButton.js +1 -1
- package/dist/components/calendar/PlCalendar.js +1 -1
- package/dist/components/card/PlCard.d.ts +9 -5
- package/dist/components/card/PlCard.js +1 -1
- package/dist/components/carousel/PlCarousel.d.ts +14 -4
- package/dist/components/carousel/PlCarousel.js +1 -1
- package/dist/components/chat-bubble/PlChatBubble.js +1 -1
- package/dist/components/checkbox/PlCheckbox.js +1 -1
- package/dist/components/chip/PlChip.d.ts +2 -1
- package/dist/components/chip/PlChip.js +1 -1
- package/dist/components/code-block/PlCodeBlock.js +1 -1
- package/dist/components/collapsible/PlCollapsible.d.ts +11 -0
- package/dist/components/collapsible/PlCollapsible.js +1 -1
- package/dist/components/color-picker/PlColorPicker.d.ts +3 -1
- package/dist/components/color-picker/PlColorPicker.js +1 -1
- package/dist/components/combobox/PlCombobox.d.ts +11 -5
- package/dist/components/combobox/PlCombobox.js +1 -1
- package/dist/components/command-palette/PlCommandPalette.js +1 -1
- package/dist/components/confirm/PlConfirmProvider.js +1 -1
- package/dist/components/data-table/PlDataTable.d.ts +13 -2
- package/dist/components/data-table/PlDataTable.js +1 -1
- package/dist/components/date-picker/PlDatePicker.js +1 -1
- package/dist/components/date-range-picker/PlDateRangePicker.js +1 -1
- package/dist/components/date-time-picker/PlDateTimePicker.js +1 -1
- package/dist/components/drawer/PlDrawer.d.ts +27 -2
- package/dist/components/drawer/PlDrawer.js +1 -1
- package/dist/components/empty/PlEmpty.d.ts +4 -1
- package/dist/components/empty/PlEmpty.js +1 -1
- package/dist/components/fieldset/PlFieldset.js +1 -1
- package/dist/components/file-picker/PlFilePicker.d.ts +32 -1
- package/dist/components/file-picker/PlFilePicker.js +1 -1
- package/dist/components/file-picker/index.d.ts +1 -1
- package/dist/components/floating-action-button/PlFloatingActionButton.d.ts +5 -0
- package/dist/components/floating-action-button/PlFloatingActionButton.js +1 -1
- package/dist/components/floating-bottom-navigation/PlFloatingBottomNavigation.d.ts +10 -0
- package/dist/components/floating-bottom-navigation/PlFloatingBottomNavigation.js +1 -1
- package/dist/components/footer/PlFooter.d.ts +3 -1
- package/dist/components/footer/PlFooter.js +1 -1
- package/dist/components/gallery/PlGallery.js +1 -1
- package/dist/components/gauge-chart/PlGaugeChart.d.ts +11 -2
- package/dist/components/gauge-chart/PlGaugeChart.js +1 -1
- package/dist/components/header/PlHeader.d.ts +4 -2
- package/dist/components/header/PlHeader.js +1 -1
- package/dist/components/heatmap-chart/PlHeatmapChart.d.ts +1 -1
- package/dist/components/heatmap-chart/PlHeatmapChart.js +1 -1
- package/dist/components/hover-card/PlHoverCard.js +1 -1
- package/dist/components/how-to-steps/PlHowToSteps.js +1 -1
- package/dist/components/image/PlImage.js +1 -1
- package/dist/components/image/PlImagePreview.d.ts +3 -2
- package/dist/components/line-chart/PlLineChart.d.ts +32 -6
- package/dist/components/line-chart/PlLineChart.js +1 -1
- package/dist/components/list/PlList.d.ts +16 -5
- package/dist/components/list/PlList.js +1 -1
- package/dist/components/menu/PlMenu.d.ts +19 -7
- package/dist/components/menu/PlMenu.js +1 -1
- package/dist/components/menubar/PlMenubar.js +1 -1
- package/dist/components/meter/PlMeter.js +1 -1
- package/dist/components/mockup/PlMockup.d.ts +6 -0
- package/dist/components/mockup/PlMockup.js +1 -1
- package/dist/components/modal/PlModal.js +1 -1
- package/dist/components/navigation-menu/PlNavigationMenu.d.ts +56 -11
- package/dist/components/navigation-menu/PlNavigationMenu.js +1 -1
- package/dist/components/number-field/PlNumberField.d.ts +7 -5
- package/dist/components/number-field/PlNumberField.js +1 -1
- package/dist/components/otp-field/PlOtpField.js +1 -1
- package/dist/components/overlay/PlOverlay.js +1 -1
- package/dist/components/page-layout/PlPageLayout.d.ts +14 -3
- package/dist/components/page-layout/PlPageLayout.js +1 -1
- package/dist/components/pagination/PlPagination.js +1 -1
- package/dist/components/panes/PlPanes.d.ts +4 -1
- package/dist/components/panes/PlPanes.js +1 -1
- package/dist/components/pie-chart/PlPieChart.d.ts +26 -1
- package/dist/components/pie-chart/PlPieChart.js +1 -1
- package/dist/components/pill/PlPill.js +1 -1
- package/dist/components/popconfirm/PlPopconfirm.d.ts +8 -1
- package/dist/components/popconfirm/PlPopconfirm.js +1 -1
- package/dist/components/popover/PlPopover.js +1 -1
- package/dist/components/progress-box/PlProgressBox.js +1 -1
- package/dist/components/progress-circular/PlProgressCircular.d.ts +11 -1
- package/dist/components/progress-circular/PlProgressCircular.js +1 -1
- package/dist/components/progress-linear/PlProgressLinear.js +1 -1
- package/dist/components/radio-group/PlRadioGroup.js +1 -1
- package/dist/components/rating/PlRating.js +1 -1
- package/dist/components/scatter-chart/PlScatterChart.js +1 -1
- package/dist/components/scroll-area/PlScrollArea.js +1 -1
- package/dist/components/scroll-zone/PlScrollZone.js +1 -1
- package/dist/components/segmented-button/PlSegmentedButton.js +1 -1
- package/dist/components/select/PlSelect.d.ts +4 -1
- package/dist/components/select/PlSelect.js +1 -1
- package/dist/components/sidebar/PlSidebar.d.ts +12 -0
- package/dist/components/sidebar/PlSidebar.js +1 -1
- package/dist/components/slider/PlSlider.d.ts +2 -1
- package/dist/components/slider/PlSlider.js +1 -1
- package/dist/components/sparkline/PlSparkline.d.ts +15 -3
- package/dist/components/sparkline/PlSparkline.js +1 -1
- package/dist/components/stepper/PlStepper.d.ts +11 -0
- package/dist/components/stepper/PlStepper.js +1 -1
- package/dist/components/switch/PlSwitch.js +1 -1
- package/dist/components/table/PlTable.d.ts +11 -1
- package/dist/components/table/PlTable.js +1 -1
- package/dist/components/tabs/PlTabs.d.ts +18 -1
- package/dist/components/tabs/PlTabs.js +1 -1
- package/dist/components/text-field/PlTextField.d.ts +6 -8
- package/dist/components/text-field/PlTextField.js +1 -1
- package/dist/components/text-link/PlTextLink.js +1 -1
- package/dist/components/time-picker/PlTimePicker.js +1 -1
- package/dist/components/timeline-chart/PlTimelineChart.js +1 -1
- package/dist/components/toast/PlToast.js +1 -1
- package/dist/components/toggle/PlToggle.js +1 -1
- package/dist/components/tooltip/PlTooltip.d.ts +4 -0
- package/dist/components/tooltip/PlTooltip.js +1 -1
- package/dist/components/tour/PlTour.js +1 -1
- package/dist/components/transfer/PlTransfer.d.ts +5 -2
- package/dist/components/transfer/PlTransfer.js +1 -1
- package/dist/components/tree/PlTree.d.ts +12 -0
- package/dist/components/tree/PlTree.js +1 -1
- package/dist/components/tree-select/PlTreeSelect.js +1 -1
- package/dist/components/typography/PlTypography.d.ts +20 -7
- package/dist/components/typography/PlTypography.js +1 -1
- package/dist/components/visually-hidden/PlVisuallyHidden.d.ts +12 -3
- package/dist/components/visually-hidden/PlVisuallyHidden.js +1 -1
- package/dist/components/window-pane/PlWindowPane.d.ts +16 -3
- package/dist/components/window-pane/PlWindowPane.js +1 -1
- package/dist/css/accordion.css +4 -0
- package/dist/css/alert.css +5 -0
- package/dist/css/anchor.css +6 -0
- package/dist/css/animate-appear.css +3 -0
- package/dist/css/animate-blink.css +3 -0
- package/dist/css/animate-counter.css +4 -0
- package/dist/css/animate-fade.css +3 -0
- package/dist/css/animate-float.css +3 -0
- package/dist/css/animate-grow.css +3 -0
- package/dist/css/animate-headline.css +3 -0
- package/dist/css/animate-lighting.css +4 -0
- package/dist/css/animate-marquee.css +4 -0
- package/dist/css/animate-reveal.css +3 -0
- package/dist/css/animate-rotate.css +3 -0
- package/dist/css/animate-scramble.css +5 -0
- package/dist/css/animate-shake.css +3 -0
- package/dist/css/animate-slide.css +3 -0
- package/dist/css/animate-split.css +4 -0
- package/dist/css/animate-typing.css +4 -0
- package/dist/css/animate-zoom.css +3 -0
- package/dist/css/app-logo.css +2 -0
- package/dist/css/area-chart.css +12 -0
- package/dist/css/aspect-ratio.css +2 -0
- package/dist/css/avatar.css +2 -0
- package/dist/css/back-top.css +11 -0
- package/dist/css/badge.css +2 -0
- package/dist/css/bar-chart.css +10 -0
- package/dist/css/base.css +2 -3
- package/dist/css/blockquote.css +2 -0
- package/dist/css/bottom-navigation.css +4 -0
- package/dist/css/box.css +2 -0
- package/dist/css/breadcrumb.css +6 -0
- package/dist/css/button-group.css +2 -0
- package/dist/css/button.css +7 -0
- package/dist/css/calendar.css +17 -0
- package/dist/css/card.css +2 -0
- package/dist/css/carousel.css +10 -0
- package/dist/css/chat-bubble.css +6 -0
- package/dist/css/checkbox.css +3 -0
- package/dist/css/chip.css +8 -0
- package/dist/css/code-block.css +6 -0
- package/dist/css/collapsible.css +3 -0
- package/dist/css/color-picker.css +17 -0
- package/dist/css/combobox.css +10 -0
- package/dist/css/command-palette.css +7 -0
- package/dist/css/confirm.css +9 -0
- package/dist/css/container.css +5 -0
- package/dist/css/data-list.css +2 -0
- package/dist/css/data-table.css +15 -0
- package/dist/css/date-picker.css +16 -0
- package/dist/css/date-range-picker.css +16 -0
- package/dist/css/date-time-picker.css +16 -0
- package/dist/css/divider.css +2 -0
- package/dist/css/drawer.css +6 -0
- package/dist/css/empty.css +2 -0
- package/dist/css/fieldset.css +2 -0
- package/dist/css/file-picker.css +8 -0
- package/dist/css/flex.css +5 -0
- package/dist/css/floating-action-button.css +7 -0
- package/dist/css/floating-bottom-navigation.css +5 -0
- package/dist/css/footer.css +6 -0
- package/dist/css/form.css +2 -0
- package/dist/css/gallery.css +15 -0
- package/dist/css/gauge-chart.css +11 -0
- package/dist/css/grid.css +5 -0
- package/dist/css/header.css +6 -0
- package/dist/css/heatmap-chart.css +10 -0
- package/dist/css/highlight.css +2 -0
- package/dist/css/hot-keys.css +3 -0
- package/dist/css/hover-card.css +9 -0
- package/dist/css/how-to-steps.css +3 -0
- package/dist/css/icon-button.css +7 -0
- package/dist/css/icon.css +1 -0
- package/dist/css/image.css +7 -0
- package/dist/css/line-chart.css +12 -0
- package/dist/css/list.css +2 -0
- package/dist/css/menu.css +5 -0
- package/dist/css/menubar.css +5 -0
- package/dist/css/meter.css +6 -0
- package/dist/css/mockup.css +4 -0
- package/dist/css/modal.css +5 -0
- package/dist/css/navigation-menu.css +4 -0
- package/dist/css/number-field.css +10 -0
- package/dist/css/otp-field.css +6 -0
- package/dist/css/overlay.css +4 -0
- package/dist/css/page-layout.css +7 -0
- package/dist/css/pagination.css +8 -0
- package/dist/css/panes.css +7 -0
- package/dist/css/pie-chart.css +10 -0
- package/dist/css/pill.css +4 -0
- package/dist/css/popconfirm.css +12 -0
- package/dist/css/popover.css +11 -0
- package/dist/css/portal.css +1 -0
- package/dist/css/progress-box.css +5 -0
- package/dist/css/progress-circular.css +5 -0
- package/dist/css/progress-linear.css +5 -0
- package/dist/css/radio-group.css +3 -0
- package/dist/css/rating.css +6 -0
- package/dist/css/scatter-chart.css +10 -0
- package/dist/css/scroll-area.css +2 -0
- package/dist/css/scroll-zone.css +15 -0
- package/dist/css/segmented-button.css +5 -0
- package/dist/css/select.css +9 -0
- package/dist/css/show.css +1 -0
- package/dist/css/sidebar.css +16 -0
- package/dist/css/skeleton.css +2 -0
- package/dist/css/slider.css +3 -0
- package/dist/css/sparkline.css +10 -0
- package/dist/css/spoiler.css +10 -0
- package/dist/css/stack.css +5 -0
- package/dist/css/stat.css +2 -0
- package/dist/css/stepper.css +8 -0
- package/dist/css/switch.css +3 -0
- package/dist/css/table.css +3 -0
- package/dist/css/tabs.css +7 -0
- package/dist/css/text-field.css +8 -0
- package/dist/css/text-link.css +6 -0
- package/dist/css/time-picker.css +16 -0
- package/dist/css/timeline-chart.css +10 -0
- package/dist/css/timeline.css +6 -0
- package/dist/css/toast.css +5 -0
- package/dist/css/toggle.css +5 -0
- package/dist/css/toolbar.css +2 -0
- package/dist/css/tooltip.css +9 -0
- package/dist/css/tour.css +10 -0
- package/dist/css/transfer.css +13 -0
- package/dist/css/tree-select.css +14 -0
- package/dist/css/tree.css +3 -0
- package/dist/css/visually-hidden.css +2 -0
- package/dist/css/window-pane.css +9 -0
- package/dist/internal/animate.d.ts +59 -4
- package/dist/internal/animate.js +1 -1
- package/dist/internal/bottom-bar.d.ts +29 -0
- package/dist/internal/bottom-bar.js +1 -0
- package/dist/internal/calendar.js +1 -1
- package/dist/internal/chart-frame.d.ts +216 -19
- package/dist/internal/chart-frame.js +1 -1
- package/dist/internal/chart-line.d.ts +11 -6
- package/dist/internal/chart-line.js +1 -1
- package/dist/internal/chart.d.ts +149 -1
- package/dist/internal/chart.js +1 -1
- package/dist/internal/commit-change.d.ts +38 -0
- package/dist/internal/commit-change.js +1 -0
- package/dist/internal/data-table.d.ts +2 -2
- package/dist/internal/data-table.js +1 -1
- package/dist/internal/date.d.ts +9 -0
- package/dist/internal/date.js +1 -1
- package/dist/internal/defaults.d.ts +36 -3
- package/dist/internal/defaults.js +1 -1
- package/dist/internal/direction.d.ts +8 -2
- package/dist/internal/direction.js +1 -1
- package/dist/internal/focusable.d.ts +10 -0
- package/dist/internal/focusable.js +1 -1
- package/dist/internal/form.d.ts +72 -0
- package/dist/internal/form.js +1 -1
- package/dist/internal/format.d.ts +4 -1
- package/dist/internal/format.js +1 -1
- package/dist/internal/gallery.d.ts +28 -0
- package/dist/internal/gallery.js +1 -1
- package/dist/internal/glow.d.ts +39 -3
- package/dist/internal/glow.js +1 -1
- package/dist/internal/heading.d.ts +11 -0
- package/dist/internal/heading.js +1 -0
- package/dist/internal/highlight.d.ts +4 -2
- package/dist/internal/highlight.js +1 -1
- package/dist/internal/icons.d.ts +24 -0
- package/dist/internal/icons.js +1 -1
- package/dist/internal/labels.d.ts +27 -0
- package/dist/internal/labels.js +1 -1
- package/dist/internal/layout-box.d.ts +35 -0
- package/dist/internal/layout-box.js +1 -0
- package/dist/internal/lazy.d.ts +37 -0
- package/dist/internal/lazy.js +1 -0
- package/dist/internal/loading.d.ts +13 -0
- package/dist/internal/loading.js +1 -0
- package/dist/internal/media.d.ts +6 -0
- package/dist/internal/media.js +1 -1
- package/dist/internal/mockup.js +1 -1
- package/dist/internal/notch.d.ts +57 -3
- package/dist/internal/notch.js +1 -1
- package/dist/internal/page-layout.d.ts +24 -13
- package/dist/internal/page-layout.js +1 -1
- package/dist/internal/picker.d.ts +8 -2
- package/dist/internal/picker.js +1 -1
- package/dist/internal/progress.d.ts +41 -6
- package/dist/internal/progress.js +1 -1
- package/dist/internal/search.d.ts +12 -0
- package/dist/internal/search.js +1 -1
- package/dist/internal/sizer.d.ts +18 -10
- package/dist/internal/sizer.js +1 -1
- package/dist/internal/steps.d.ts +0 -15
- package/dist/internal/steps.js +1 -1
- package/dist/internal/styles.d.ts +136 -14
- package/dist/internal/styles.js +1 -1
- package/dist/internal/table-scroll.d.ts +42 -0
- package/dist/internal/table-scroll.js +1 -0
- package/dist/internal/table.js +1 -1
- package/dist/internal/text.d.ts +8 -5
- package/dist/internal/wheel.d.ts +13 -1
- package/dist/internal/wheel.js +1 -1
- package/dist/internal/window.js +1 -1
- package/dist/locales/de.js +1 -1
- package/dist/locales/es.js +1 -1
- package/dist/locales/fr.js +1 -1
- package/dist/locales/ja.js +1 -1
- package/dist/locales/ko.js +1 -1
- package/dist/locales/zh-Hans.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1163 -81
- package/dist/tokens.css +1163 -81
- package/dist/types.d.ts +226 -13
- package/package.json +18 -17
|
@@ -28,11 +28,11 @@ export interface PlBackTopProps extends Omit<React.ComponentPropsWithoutRef<'but
|
|
|
28
28
|
* the button somewhere of your own — the end of an article, a toolbar — and
|
|
29
29
|
* keep the appearing and the scrolling.
|
|
30
30
|
*
|
|
31
|
-
* A pinned button sits 24px off the bottom end corner, and
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* an inline `position: fixed` with logical insets, so a `style` of
|
|
35
|
-
* replaces it and a class of your own cannot.
|
|
31
|
+
* A pinned button sits 24px off the bottom end corner, and the safe area on
|
|
32
|
+
* both of those edges on top of that, so it clears the home indicator, the
|
|
33
|
+
* navigation bar or a landscape camera cutout of an edge-to-edge screen. The
|
|
34
|
+
* pinning is an inline `position: fixed` with logical insets, so a `style` of
|
|
35
|
+
* your own replaces it and a class of your own cannot.
|
|
36
36
|
* @default true
|
|
37
37
|
*/
|
|
38
38
|
floating?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as o from"react";import{PlIconButton as t}from"../icon-button/PlIconButton.js";import{useDefaults as n}from"../../internal/defaults.js";import{resolveScrollTarget as r}from"../../internal/scroll-target.js";import{useLabels as i}from"../../internal/labels.js";import{focusablesIn as s}from"../../internal/focusable.js";import{usePrefersReducedMotion as l}from"../../internal/media.js";import{cx as a,safeInlineClasses as c,transitionClasses as d}from"../../internal/styles.js";const f="1.5rem";function ChevronUp(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e("path",{d:"M4.5 9.5 8 6l3.5 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export const PlBackTop=/* @__PURE__ */o.forwardRef(function PlBackTop({target:m,visibilityHeight:p=400,label:u,icon:v,floating:b=!0,variant:h="glass",size:j,color:k,elevation:x=2,className:y,style:T,onClick:g,...E},w){const B=n(),C=i(),z=u??C.backToTop,L=j??B.size??"md",P=k??B.color??"primary",I=l(),[N,S]=o.useState(!1);o.useEffect(()=>{const e=r(m);if(!e)return;const read=()=>S(function scrollTopOf(e){return e instanceof Window?e.scrollY:e.scrollTop}(e)>p);return read(),e.addEventListener("scroll",read,{passive:!0}),()=>e.removeEventListener("scroll",read)},[m,p]);const U=b?{position:"fixed",insetInlineEnd:`calc(${f} + var(--p-safe-inline, 0px))`,insetBlockEnd:`calc(${f} + env(safe-area-inset-bottom, 0px))`}:{};return e(t,{ref:w,label:z,icon:v??e(ChevronUp,{}),variant:h,size:L,color:P,elevation:x,onClick:e=>{if(g?.(e),e.defaultPrevented)return;const o=r(m);o?.scrollTo({top:0,behavior:I?"instant":"smooth"});const t=e.currentTarget;if(o&&document.activeElement===t){const e=o===window?document.body:o,n=s(e).find(e=>e!==t&&!e.closest('[aria-hidden="true"]'));n?n.focus({preventScroll:!0}):t.blur()}},"aria-hidden":!N||void 0,tabIndex:N?void 0:-1,className:a(b?"z-30":"",b&&c.End,d,N?"opacity-100":"pointer-events-none opacity-0",y),style:{...U,...T},...E})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,Fragment as t,jsxs as
|
|
1
|
+
"use client";import{jsx as e,Fragment as t,jsxs as m}from"react/jsx-runtime";import*as s from"react";import{useDefaults as n}from"../../internal/defaults.js";import{controlSlots as i,hasContent as l,markRestClasses as o,srOnlyClasses as a,transitionClasses as r}from"../../internal/styles.js";const d={xs:"h-3.5 min-w-3.5",sm:"h-4 min-w-4",md:"h-4.5 min-w-4.5",lg:"h-5 min-w-5",xl:"h-6 min-w-6"},p={xs:"size-1.5",sm:"size-2",md:"size-2.5",lg:"size-2.5",xl:"size-3"},x={xs:"text-[0.5625rem]",sm:"text-[0.625rem]",md:"text-[0.6875rem]",lg:"text-[0.75rem]",xl:"text-[0.8125rem]"},b={default:{xs:"px-1",sm:"px-1",md:"px-1.5",lg:"px-1.5",xl:"px-2"},compact:{xs:"px-0.5",sm:"px-0.5",md:"px-1",lg:"px-1",xl:"px-1.5"}},c="rounded-full",u={xs:{badge:"-mt-1.5 -mb-1.5 -ms-1.5 -me-1.5",dot:"-mt-0.5 -mb-0.5 -ms-0.5 -me-0.5"},sm:{badge:"-mt-2 -mb-2 -ms-2 -me-2",dot:"-mt-1 -mb-1 -ms-1 -me-1"},md:{badge:"-mt-2 -mb-2 -ms-2 -me-2",dot:"-mt-1 -mb-1 -ms-1 -me-1"},lg:{badge:"-mt-2.5 -mb-2.5 -ms-2.5 -me-2.5",dot:"-mt-1 -mb-1 -ms-1 -me-1"},xl:{badge:"-mt-3 -mb-3 -ms-3 -me-3",dot:"-mt-1.5 -mb-1.5 -ms-1.5 -me-1.5"}},f={"top-start":"top-0 start-0","top-end":"top-0 end-0","bottom-start":"bottom-0 start-0","bottom-end":"bottom-0 end-0"},g={"top-start":"mt-[7%] ms-[7%]","top-end":"mt-[7%] me-[7%]","bottom-start":"mb-[7%] ms-[7%]","bottom-end":"mb-[7%] me-[7%]"};export const PlBadge=/* @__PURE__ */s.forwardRef(function PlBadge({variant:s="solid",size:h,color:v,density:w,elevation:j=0,content:y,max:z=99,dot:N=!1,showZero:B=!1,invisible:k=!1,placement:P="top-end",overlap:$="square",label:q,className:C,style:F,children:R,...Z},A){const D=n(),E=h??D.size??"md",G=v??D.color??"primary",H=w??D.density??"default",I=l(R),J=!l(y)||0===y&&!B,K=N||J,L=k||J&&!N,M=["pointer-events-none z-10 inline-flex shrink-0 items-center justify-center","font-semibold tabular-nums whitespace-nowrap",c,r,o[s],K?p[E]:[d[E],x[E],b[H][E]].join(" "),I?`absolute ${f[P]}`:"relative align-middle",I?K?u[E].dot:u[E].badge:"",I&&"circle"===$?g[P]:"",L?"invisible":"",C??""].filter(Boolean).join(" "),O=function capContent(e,t){return"number"==typeof e&&e>t?`${t}+`:e}(y,z),Q=e("span",{ref:A,className:M,style:{...i(G,j,s),...F},"aria-hidden":!!L||void 0,...Z,children:L?null:m(t,{children:[K||q?e("span",{className:a,children:q??O}):null,K?null:e("span",{"aria-hidden":!!q||void 0,children:O})]})});return I?m("span",{className:"relative inline-flex shrink-0 align-middle",children:[R,Q]}):Q});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type CartesianChartProps } from '../../internal/chart-frame.js';
|
|
3
|
-
import type { PlassChartValueLabels, PlassOrientation } from '../../types.js';
|
|
3
|
+
import type { PlassChartCategory, PlassChartLabelColor, PlassChartSort, PlassChartValueLabels, PlassOrientation } from '../../types.js';
|
|
4
4
|
export interface PlBarChartProps extends CartesianChartProps {
|
|
5
5
|
/**
|
|
6
6
|
* Which way the bars run.
|
|
@@ -46,6 +46,58 @@ export interface PlBarChartProps extends CartesianChartProps {
|
|
|
46
46
|
* @default 'none'
|
|
47
47
|
*/
|
|
48
48
|
valueLabels?: PlassChartValueLabels;
|
|
49
|
+
/**
|
|
50
|
+
* What colour those numbers are written in.
|
|
51
|
+
*
|
|
52
|
+
* `series` — the default — gives each label the colour of the bar it is
|
|
53
|
+
* sitting past, so a group of four labelled bars says which number belongs to
|
|
54
|
+
* which series without the reader counting along the group. `ink` writes them
|
|
55
|
+
* all in the page's own foreground: the chart palette clears 4:1 against the
|
|
56
|
+
* sheet, which is the floor a *mark* is held to rather than the 4.5:1 body
|
|
57
|
+
* text wants, so reach for it where the labels have to meet the text contrast
|
|
58
|
+
* rule on their own.
|
|
59
|
+
* @default 'series'
|
|
60
|
+
*/
|
|
61
|
+
valueLabelColor?: PlassChartLabelColor;
|
|
62
|
+
/**
|
|
63
|
+
* Puts the categories in order of size rather than leaving them in the order
|
|
64
|
+
* they were given.
|
|
65
|
+
*
|
|
66
|
+
* A bar chart is the one shape whose categories can be shuffled without
|
|
67
|
+
* losing anything — that is the test for reaching for it over a line chart —
|
|
68
|
+
* so sorting them is free, and it is what turns a wall of bars into a ranking
|
|
69
|
+
* a reader can scan down. Leave it alone where the order already means
|
|
70
|
+
* something: months, sizes, a funnel's steps.
|
|
71
|
+
*
|
|
72
|
+
* With more than one series the size of a category is the **total** across
|
|
73
|
+
* all of them, and each series' magnitude rather than its signed value — a
|
|
74
|
+
* category whose two series are +50 and −50 is a hundred units of chart, not
|
|
75
|
+
* nothing. A series hidden from the legend is still counted, because a chart
|
|
76
|
+
* whose columns rearranged themselves when an entry was clicked is one a
|
|
77
|
+
* reader cannot use.
|
|
78
|
+
* @default 'none'
|
|
79
|
+
*/
|
|
80
|
+
sort?: PlassChartSort;
|
|
81
|
+
/**
|
|
82
|
+
* Keeps the largest this many categories and sums the rest into one.
|
|
83
|
+
*
|
|
84
|
+
* The answer to a chart of ninety countries: a bar too short to see is a bar
|
|
85
|
+
* costing width without saying anything, and eighty of them is a chart of
|
|
86
|
+
* nothing but noise. What is folded is decided by size and never by `sort`,
|
|
87
|
+
* so `ascending` shows the small ones it kept rather than keeping the small
|
|
88
|
+
* ones — and the fold is always last, wherever the sort would otherwise have
|
|
89
|
+
* put it, because it is not a category but what is left.
|
|
90
|
+
*
|
|
91
|
+
* A fold of nothing but gaps stays a gap rather than becoming a zero.
|
|
92
|
+
*/
|
|
93
|
+
maxCategories?: number;
|
|
94
|
+
/**
|
|
95
|
+
* What that fold is called. Falls back to the label pack's own word, which is
|
|
96
|
+
* "Other" in English.
|
|
97
|
+
*/
|
|
98
|
+
otherLabel?: string;
|
|
99
|
+
/** The category axis' labels. Points may carry their own `x` instead. */
|
|
100
|
+
categories?: readonly PlassChartCategory[];
|
|
49
101
|
}
|
|
50
102
|
/**
|
|
51
103
|
* Lengths, compared.
|
|
@@ -60,4 +112,4 @@ export interface PlBarChartProps extends CartesianChartProps {
|
|
|
60
112
|
* is this total made of". They are different questions and the chart should be
|
|
61
113
|
* asked only one of them at a time.
|
|
62
114
|
*/
|
|
63
|
-
export declare function PlBarChart({ orientation, stacked, rounded, barSize, valueLabels, series, yAxis, format, locale, size: sizeProp, density: densityProp, ...props }: PlBarChartProps): React.JSX.Element;
|
|
115
|
+
export declare function PlBarChart({ orientation, stacked, rounded, barSize, valueLabels, valueLabelColor, sort, maxCategories, otherLabel, series, categories, yAxis, format, locale, size: sizeProp, density: densityProp, ...props }: PlBarChartProps): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as t from"react";import{CartesianChart as
|
|
1
|
+
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as t from"react";import{CartesianChart as r,markTransitionClasses as l}from"../../internal/chart-frame.js";import{barBandRatio as o,barMaxThickness as s,barPath as i,barRadius as n,chartFontSizes as c,dimmedByHover as u,labelledPoints as d,markGap as m,rankCategories as h,stackToFull as f,writeChartValue as v}from"../../internal/chart.js";import{useDefaults as x,useLocale as p}from"../../internal/defaults.js";import{useLabels as b}from"../../internal/labels.js";export function PlBarChart({orientation:a="vertical",stacked:l=!1,rounded:i=!0,barSize:n,valueLabels:c="none",valueLabelColor:u="series",sort:d="none",maxCategories:m,otherLabel:g,series:y,categories:z,yAxis:k,format:M,locale:j,size:L,density:C,...B}){const P=x(),S=L??P.size??"md",A=C??P.density??"default",N=p(j),W="horizontal"===a,w="full"===l,F=b(),I=g??F.chartOther,O=t.useMemo(()=>h(y,z,{sort:d,max:m,other:I}),[y,z,d,m,I]),R=t.useMemo(()=>w?f(O.series,e=>v(e,M,N)):O.series,[O.series,w,M,N]);return e(r,{...B,series:R,categories:O.categories,format:M,locale:j,size:S,density:A,horizontal:W,stacked:!1!==l,yAxis:w?{min:0,max:100,tickFormat:e=>`${e}%`,...k}:k,includeZero:!0,bandRatio:o[A],headroom:"none"===c?0:12,children:a=>e(Bars,{context:a,stacked:!1!==l,rounded:i,barSize:n??s[S],valueLabels:c,valueLabelColor:u,size:S})})}function Bars({context:t,stacked:r,rounded:o,barSize:s,valueLabels:h,valueLabelColor:f,size:v}){const{values:x,visible:p,colors:b,hovered:g,activeIndex:y,plot:z,band:k,horizontal:M,valuePx:j,categoryPx:L,zeroPx:C,format:B}=t,P=x.map((e,a)=>({one:e,index:a})).filter(e=>p[e.index]),S=r?1:Math.max(1,P.length),A=Math.min(s,Math.max(1,(k.band-m*(S-1))/S)),N=A*S+m*(S-1),W=[],w=[],F=c[v];return a("g",{children:[P.map(({one:t,index:s},c)=>{const v=b[s],x=u(g,s,p),k=d(t,h);return e("g",{opacity:x?.28:1,className:l,children:t.map((t,s)=>{if(null===t.value)return null;const u=L(s),d=r?0:c*(A+m)-N/2+A/2,h=r?t.value>=0?W[s]??0:w[s]??0:0,x=j(h),p=j(h+t.value);r&&(t.value>=0?W[s]=h+t.value:w[s]=h+t.value);const b=r&&0!==h?m:0,g=Math.abs(p-x)-b;if(g<=0)return null;const C=p<x,P=s===y,S=M?i(Math.min(x,p)+(C?0:b),z.top+u+d-A/2,g,A,o&&!r?n:o?n/2:0,t.value>=0?"right":"left"):i(z.left+u+d-A/2,Math.min(x,p)+(C?0:b),A,g,o&&!r?n:o?n/2:0,t.value>=0?"up":"down");return a("g",{children:[e("path",{d:S,fill:t.color??v,opacity:P?1:.92,className:l}),k(s)?e("text",{x:M?p+(t.value>=0?5:-5):z.left+u+d,y:M?z.top+u+d:t.value>=0?p-5:p+F+2,textAnchor:M?t.value>=0?"start":"end":"middle",dominantBaseline:M?"central":void 0,fontSize:F,fontWeight:600,fill:"ink"===f?"var(--plass-fg)":t.color??v,className:"tabular-nums",children:t.label??B(t.value)}):null]},s)})},s)}),e("line",M?{x1:C,x2:C,y1:z.top,y2:z.top+z.height,stroke:"var(--plass-chart-baseline)",strokeWidth:1}:{x1:z.left,x2:z.left+z.width,y1:C,y2:C,stroke:"var(--plass-chart-baseline)",strokeWidth:1})]})}
|
|
@@ -53,8 +53,8 @@ export interface PlBlockquoteProps extends PlassStyleProps, Omit<React.Component
|
|
|
53
53
|
* name. VitePress's `.vp-doc blockquote` sets a grey `border-left`, a
|
|
54
54
|
* `padding-left` and a `color`, all at a specificity a one-class utility cannot
|
|
55
55
|
* outrank, so a rule drawn on the quote itself would silently come out grey and
|
|
56
|
-
* a pixel too thin.
|
|
57
|
-
*
|
|
56
|
+
* a pixel too thin. Drawn on a wrapper, the quote looks the same whatever a host
|
|
57
|
+
* stylesheet does to `blockquote`.
|
|
58
58
|
*
|
|
59
59
|
* The wrapper is a `<figure>` when there is an attribution and a `<div>` when
|
|
60
60
|
* there is not, because the HTML spec is explicit that the attribution goes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as s}from"react/jsx-runtime";import*as r from"react";import{useDefaults as l}from"../../internal/defaults.js";import{glassClasses as t,hasContent as a,metaTextClasses as o,radiusClasses as n,sheetPaddingXClasses as i,sheetPaddingYClasses as c,surfaceSlots as m,transitionClasses as d}from"../../internal/styles.js";const p={xs:"text-[0.75rem]/[1.25rem]",sm:"text-[0.8125rem]/[1.375rem]",md:"text-[0.9375rem]/[1.625rem]",lg:"text-[1.0625rem]/[1.875rem]",xl:"text-[1.25rem]/[2.125rem]"},f="border-s-2 [border-inline-start-color:var(--p-accent)]",u={solid:/* @__PURE__ */[t,"bg-(--plass-glass-press)","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]"].join(" "),glass:/* @__PURE__ */[t,"border border-s-2 bg-(--plass-glass)","[border-color:var(--plass-glass-line)]","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]"].join(" "),ghost:"bg-transparent"};function QuoteMarkIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e("path",{d:"M6.4 3.6c-2.3.9-3.7 2.8-3.7 5.1 0 2 1.2 3.3 2.8 3.3 1.4 0 2.5-1 2.5-2.4 0-1.3-.9-2.2-2.1-2.2-.2 0-.4 0-.6.1.3-1 1.1-1.8 2.2-2.3l-1.1-1.6ZM13.3 3.6c-2.3.9-3.7 2.8-3.7 5.1 0 2 1.2 3.3 2.8 3.3 1.4 0 2.5-1 2.5-2.4 0-1.3-.9-2.2-2.1-2.2-.2 0-.4 0-.6.1.3-1 1.1-1.8 2.2-2.3l-1.1-1.6Z",fill:"currentColor"})})}export const PlBlockquote=/* @__PURE__ */r.forwardRef(function PlBlockquote({variant:r="ghost",size:t,color:g,density:x,elevation:h=0,author:v,source:b,cite:j,icon:N,className:
|
|
1
|
+
"use client";import{jsx as e,jsxs as s}from"react/jsx-runtime";import*as r from"react";import{useDefaults as l}from"../../internal/defaults.js";import{glassClasses as t,hasContent as a,metaTextClasses as o,radiusClasses as n,sheetPaddingXClasses as i,sheetPaddingYClasses as c,surfaceSlots as m,transitionClasses as d}from"../../internal/styles.js";const p={xs:"text-[0.75rem]/[1.25rem]",sm:"text-[0.8125rem]/[1.375rem]",md:"text-[0.9375rem]/[1.625rem]",lg:"text-[1.0625rem]/[1.875rem]",xl:"text-[1.25rem]/[2.125rem]"},f="border-s-2 [border-inline-start-color:var(--p-accent)]",u={solid:/* @__PURE__ */[t,"bg-(--plass-glass-press)","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]"].join(" "),glass:/* @__PURE__ */[t,"border border-s-2 bg-(--plass-glass)","[border-color:var(--plass-glass-line)]","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]"].join(" "),ghost:"bg-transparent"};function QuoteMarkIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e("path",{d:"M6.4 3.6c-2.3.9-3.7 2.8-3.7 5.1 0 2 1.2 3.3 2.8 3.3 1.4 0 2.5-1 2.5-2.4 0-1.3-.9-2.2-2.1-2.2-.2 0-.4 0-.6.1.3-1 1.1-1.8 2.2-2.3l-1.1-1.6ZM13.3 3.6c-2.3.9-3.7 2.8-3.7 5.1 0 2 1.2 3.3 2.8 3.3 1.4 0 2.5-1 2.5-2.4 0-1.3-.9-2.2-2.1-2.2-.2 0-.4 0-.6.1.3-1 1.1-1.8 2.2-2.3l-1.1-1.6Z",fill:"currentColor"})})}export const PlBlockquote=/* @__PURE__ */r.forwardRef(function PlBlockquote({variant:r="ghost",size:t,color:g,density:x,elevation:h=0,author:v,source:b,cite:j,icon:N,className:k,style:y,children:w,...z},B){const M=l(),q=t??M.size??"md",I=g??M.color??"primary",P=x??M.density??"default",Q=a(v)||a(b),Z=void 0===N?e(QuoteMarkIcon,{}):N,$=["m-0 flex flex-col text-(--plass-fg)",f,"ghost"===r?"":`${n[q]} rounded-s-none`,u[r],i[P][q],c[P][q],d,k??""].filter(Boolean).join(" "),C=s("blockquote",{cite:j,className:`m-0 ${p[q]}`,children:[a(Z)?e("span",{"aria-hidden":"true",className:"mb-1 block size-[2em] text-(--p-soft-press) [&>svg]:block [&>svg]:size-full",children:Z}):null,w]}),R={...m(I,h),...y};return Q?s("figure",{ref:B,className:$,style:R,...z,children:[C,s("figcaption",{className:["mt-2 flex flex-wrap items-baseline gap-x-1.5 text-(--plass-muted-fg)",o[q]].join(" "),children:[a(v)?s("span",{className:"font-medium text-(--plass-fg)",children:[e("span",{"aria-hidden":"true",children:"— "}),v]}):null,a(b)?e("cite",{className:"not-italic",children:b}):null]})]}):e("div",{ref:B,className:$,style:R,...z,children:C})});
|
|
@@ -77,6 +77,16 @@ export interface PlBottomNavigationItemProps extends Omit<React.ComponentPropsWi
|
|
|
77
77
|
icon?: React.ReactNode;
|
|
78
78
|
/** Renders the item as a link rather than as a button. */
|
|
79
79
|
href?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Renders the item's link as something other than an `<a>`: the `Link` a
|
|
82
|
+
* router brings. Base UI's own escape hatch, as on `PlTextLink`.
|
|
83
|
+
*
|
|
84
|
+
* Giving one makes the item a link, as an `href` does, and an `href` on the
|
|
85
|
+
* element wins over the item's own. A disabled item is drawn on a plain `<a>`
|
|
86
|
+
* with no address instead, since the element's own `href` would keep it
|
|
87
|
+
* going somewhere.
|
|
88
|
+
*/
|
|
89
|
+
render?: useRender.RenderProp;
|
|
80
90
|
/** Unavailable, but still part of the set. */
|
|
81
91
|
disabled?: boolean;
|
|
82
92
|
/** The destination's name. Read out even when `labels` keeps it undrawn. */
|
|
@@ -105,10 +115,10 @@ export declare const PlBottomNavigation: React.ForwardRefExoticComponent<PlBotto
|
|
|
105
115
|
* the bar, which is the only place they can be set once and mean the same thing
|
|
106
116
|
* for every item.
|
|
107
117
|
*
|
|
108
|
-
* With an `href` it is a real `<a>`, which is what makes a long
|
|
109
|
-
* "open in a new tab" and what puts the destination in the status
|
|
110
|
-
* of which a `<button>` that calls `router.push` can do. Without
|
|
111
|
-
* `<button>`, because a `<div>` carrying a click handler is
|
|
112
|
-
* keyboard.
|
|
118
|
+
* With an `href` or a `render` it is a real `<a>`, which is what makes a long
|
|
119
|
+
* press offer "open in a new tab" and what puts the destination in the status
|
|
120
|
+
* bar — neither of which a `<button>` that calls `router.push` can do. Without
|
|
121
|
+
* either it is a `<button>`, because a `<div>` carrying a click handler is
|
|
122
|
+
* invisible to a keyboard.
|
|
113
123
|
*/
|
|
114
124
|
export declare const PlBottomNavigationItem: React.ForwardRefExoticComponent<PlBottomNavigationItemProps & React.RefAttributes<HTMLElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,Fragment as a,jsxs as t}from"react/jsx-runtime";import*as l from"react";import{useDefaults as s}from"../../internal/defaults.js";import{useRender as i}from"@base-ui/react/use-render";import{cx as
|
|
1
|
+
"use client";import{jsx as e,Fragment as a,jsxs as t}from"react/jsx-runtime";import*as l from"react";import{useDefaults as s}from"../../internal/defaults.js";import{useRender as i}from"@base-ui/react/use-render";import{useBottomBarHeight as r}from"../../internal/bottom-bar.js";import{cx as n,focusRingInsetClasses as o,hasContent as d,iconSizeClasses as c,metaTextClasses as m,radiusClasses as u,sheetLineClasses as p,sheetRestClasses as f,srOnlyClasses as g,surfaceSlots as h,transitionClasses as x}from"../../internal/styles.js";const b=/* @__PURE__ */l.createContext({value:null,change:()=>{},size:"md",density:"default",labels:"all",disabled:!1}),v={static:"",sticky:"sticky bottom-0 z-20",fixed:"fixed inset-x-0 bottom-0 z-30"},y={xs:"min-h-10",sm:"min-h-12",md:"min-h-14",lg:"min-h-16",xl:"min-h-18"},N={default:{xs:"p-1",sm:"p-1",md:"p-1.5",lg:"p-2",xl:"p-2.5"},compact:{xs:"p-0.5",sm:"p-0.5",md:"p-1",lg:"p-1",xl:"p-1.5"}},z={xs:"gap-0.5",sm:"gap-0.5",md:"gap-1",lg:"gap-1",xl:"gap-1.5"};export const PlBottomNavigation=/* @__PURE__ */l.forwardRef(function PlBottomNavigation({variant:a="glass",size:t,color:o,density:d,elevation:c=0,value:m,defaultValue:g=null,onValueChange:z,position:k="fixed",labels:w="all",divider:j=!0,safeArea:C=!0,disabled:B=!1,label:P,render:R,className:I,style:V,children:A,...D},F){const M=s(),S=t??M.size??"md",q=o??M.color??"primary",E=d??M.density??"default",[G,H]=l.useState(g),J=void 0!==m,K=J?m:G,L=l.useCallback(e=>{J||H(e),z?.(e)},[J,z]),O=l.useMemo(()=>({value:K??null,change:L,size:S,density:E,labels:w,disabled:B}),[K,L,S,E,w,B]),Q=l.useRef(null);r(Q,"fixed"===k);const T=n("w-full min-w-0","static"===k?u[S]:"",f[a],"glass"===a&&"static"!==k?"border-0":"",j?p:"",v[k],C?"pb-[env(safe-area-inset-bottom)]":"",x,I);return i({render:R??e("nav",{}),ref:[F,Q],props:{"aria-label":P,className:T,style:{...h(q,c),...V},children:e(b.Provider,{value:O,children:e("div",{className:n("flex w-full items-stretch",y[S],N[E][S]),children:A})}),...D}})});export const PlBottomNavigationItem=/* @__PURE__ */l.forwardRef(function PlBottomNavigationItem({value:s,icon:r,href:p,render:f,disabled:h=!1,className:v,children:y,onClick:N,...k},w){const j=l.useContext(b),C=h||j.disabled,B=null!==j.value&&j.value===s,P="all"===j.labels||"selected"===j.labels&&B,R=n("flex min-w-0 flex-1 flex-col items-center justify-center px-1 py-1.5",z[j.size],u[j.size],"[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",x,o,C?"cursor-not-allowed opacity-50 saturate-[0.35] text-(--plass-muted-fg)":B?"cursor-pointer font-medium text-(--p-accent) bg-(--p-soft) hover:bg-(--p-soft-hover)":"cursor-pointer text-(--plass-muted-fg) hover:text-(--plass-fg) hover:bg-(--plass-glass-hover)",v),I=t(a,{children:[d(r)?e("span",{className:n("flex shrink-0 items-center justify-center",c[j.size]),children:r}):null,d(y)?e("span",{className:P?n("max-w-full truncate leading-tight",m[j.size]):g,children:y}):null]}),press=e=>{C?e.preventDefault():(j.change(s),N?.(e))};return i({render:C?e("a",{}):f??e("a",{}),enabled:Boolean(p||f),ref:w,props:{href:C?void 0:p,role:C?"link":void 0,"aria-current":B?"page":void 0,"aria-disabled":C||void 0,className:R,onClick:press,...k,children:I}})||e("button",{ref:w,type:"button",disabled:C,"aria-current":B?"page":void 0,className:R,onClick:press,...k,children:I})});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
2
3
|
import type { PlassColor, PlassDensity, PlassSize } from '../../types.js';
|
|
3
4
|
/**
|
|
4
5
|
* What is drawn between two steps of the trail.
|
|
@@ -106,6 +107,16 @@ export interface PlBreadcrumbItemProps extends Omit<React.ComponentPropsWithoutR
|
|
|
106
107
|
current?: boolean;
|
|
107
108
|
/** Unavailable. Stops answering, keeps its place in the trail. */
|
|
108
109
|
disabled?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Renders the step's link as something other than an `<a>`: the `Link` a
|
|
112
|
+
* router brings. Base UI's own escape hatch, as on `PlTextLink`.
|
|
113
|
+
*
|
|
114
|
+
* Giving one makes the step a link, as an `href` does, and an `href` on the
|
|
115
|
+
* element wins over the step's own, both on the anchor and in
|
|
116
|
+
* `structuredData`. The current step is not a link and a disabled one goes
|
|
117
|
+
* nowhere, so neither uses it.
|
|
118
|
+
*/
|
|
119
|
+
render?: useRender.RenderProp;
|
|
109
120
|
/** The step's label. */
|
|
110
121
|
children?: React.ReactNode;
|
|
111
122
|
}
|
|
@@ -131,8 +142,10 @@ export declare const PlBreadcrumb: React.ForwardRefExoticComponent<PlBreadcrumbP
|
|
|
131
142
|
* One step of the trail.
|
|
132
143
|
*
|
|
133
144
|
* It renders three different things and the caller picks by what they pass: an
|
|
134
|
-
* `<a>` with an `href`, a `<button>` with an `onClick`, and a
|
|
135
|
-
* neither — which is what the last step is, because the
|
|
136
|
-
* is not somewhere to go.
|
|
145
|
+
* `<a>` with an `href` or a `render`, a `<button>` with an `onClick`, and a
|
|
146
|
+
* plain `<span>` with neither — which is what the last step is, because the
|
|
147
|
+
* page you are already on is not somewhere to go. A disabled link is still an
|
|
148
|
+
* `<a>`, with no address, and a disabled button is still a `<button>`, with
|
|
149
|
+
* `disabled`.
|
|
137
150
|
*/
|
|
138
151
|
export declare const PlBreadcrumbItem: React.ForwardRefExoticComponent<PlBreadcrumbItemProps & React.RefAttributes<HTMLLIElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import*as a from"react";import{useRender as s}from"@base-ui/react/use-render";import{useDefaults as n}from"../../internal/defaults.js";import{useLabels as l}from"../../internal/labels.js";import{ArrowRightIcon as i,ChevronIcon as c,EllipsisIcon as o}from"../../internal/icons.js";import{textOf as m}from"../../internal/text.js";import{controlTextClasses as d,cx as p,focusRingClasses as u,gapClasses as f,hasContent as h,iconClasses as x,radiusClasses as b,transitionClasses as g}from"../../internal/styles.js";const y=/* @__PURE__ */a.createContext({size:"md",last:!1}),v={default:{xs:"gap-1",sm:"gap-1.5",md:"gap-2",lg:"gap-2.5",xl:"gap-3"},compact:{xs:"gap-0.5",sm:"gap-1",md:"gap-1",lg:"gap-1.5",xl:"gap-2"}},N={xs:b.xs,sm:b.xs,md:b.xs,lg:b.sm,xl:b.sm},k=["chevron","arrow","slash","dot"];function absoluteHref(e,r){if(!r)return e;try{return new URL(e,r).href}catch{return e}}function breadcrumbListData(e,r){const t=e.map((e,t)=>{const s=function stepHref({href:e,render:r}){const t=a.isValidElement(r)?r.props.href:void 0;return"string"==typeof t&&t?t:e}(e.props),{children:n}=e.props;return{"@type":"ListItem",position:t+1,name:m(n),...s?{item:absoluteHref(s,r)}:null}});return JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:t}).replace(/</g,"\\u003c")}export const PlBreadcrumb=/* @__PURE__ */a.forwardRef(function PlBreadcrumb({size:t,color:s,density:m,separator:f="chevron",maxItems:h,itemsBeforeCollapse:b=1,itemsAfterCollapse:N=1,expandable:w=!0,label:j,expandLabel:B,structuredData:C=!1,baseUrl:L,className:I,style:M,children:z,...E},P){const R=n(),S=l(),A=j??S.breadcrumb,H=B??S.breadcrumbExpand,D=t??R.size??"md",$=s??R.color??"primary",F=m??R.density??"default",[U,V]=a.useState(!1),_=a.useRef(null),q=a.useRef(!1);a.useEffect(()=>{if(!U||!q.current)return;q.current=!1;const e=Array.from(_.current?.children??[]).filter(e=>"true"!==e.getAttribute("aria-hidden"));for(const r of e.slice(Math.max(0,b))){const e=r.querySelector("a[href], button:not(:disabled)");if(e)return void e.focus()}},[U,b]);const J=a.Children.toArray(z).filter(a.isValidElement),O=J.length,T=J.some(e=>!0===e.props.current),G=!U&&void 0!==h&&O>Math.max(h,1)&&O-b-N>1?[...J.slice(0,Math.max(0,b)),null,...J.slice(O-Math.max(0,N))]:J,K=function isSeparatorName(e){return"string"==typeof e&&k.includes(e)}(f)?function separatorMark(r){switch(r){case"chevron":return e("span",{className:"flex -rotate-90 items-center rtl:rotate-90",children:e(c,{})});case"arrow":return e("span",{className:"flex items-center rtl:rotate-180",children:e(i,{})});case"slash":return e("span",{className:"opacity-70",children:"/"});case"dot":return e("span",{className:"opacity-70",children:"·"});default:return null}}(f):f,Q=p("inline-flex items-center rounded-(--plass-radius-xs) px-0.5 py-0","text-(--plass-muted-fg)",g,x,w?p("cursor-pointer hover:bg-(--p-soft) hover:text-(--p-accent)",u):"");return r("nav",{ref:P,"aria-label":A,className:p("flex",d[D],x,I),style:{"--p-accent":`var(--plass-${$}-accent)`,"--p-soft":`var(--plass-${$}-soft)`,"--p-ring":`var(--plass-${$}-ring)`,...M},...E,children:[C&&O>0?e("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:breadcrumbListData(J,L)}}):null,e("ol",{ref:_,role:"list",className:p("m-0 flex list-none flex-wrap items-center p-0",v[F][D]),children:G.map((t,s)=>r(a.Fragment,{children:[s>0?e("li",{"aria-hidden":"true",className:"flex shrink-0 items-center text-(--plass-muted-fg) select-none",children:K}):null,t?e(y.Provider,{value:{size:D,last:!T&&s===G.length-1},children:t}):e("li",{className:"flex shrink-0 items-center",children:w?e("button",{type:"button",className:Q,"aria-label":H,onClick:()=>{q.current=!0,V(!0)},children:e(o,{})}):e("span",{className:Q,"aria-hidden":"true",children:e(o,{})})})]},t?t.key??s:"fold"))})]})});export const PlBreadcrumbItem=/* @__PURE__ */a.forwardRef(function PlBreadcrumbItem({href:n,onClick:l,startIcon:i,endIcon:c,current:o,disabled:m=!1,render:d,className:x,children:b,...v},k){const{size:w,last:j}=a.useContext(y),B=o??j,C=Boolean(n||d),L=Boolean(l)&&!C&&!B,I=(C||Boolean(l))&&!B&&!m,M=p("inline-flex min-w-0 items-center px-1 py-0",f[w],N[w],g,m?"cursor-not-allowed text-(--plass-muted-fg) opacity-50":B?"font-medium text-(--plass-fg)":I?p("cursor-pointer text-(--plass-muted-fg)","hover:bg-(--p-soft) hover:text-(--p-accent)",u):"text-(--plass-muted-fg)"),z=r(t,{children:[h(i)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:i}):null,e("span",{className:"truncate",children:b}),h(c)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:c}):null]}),E=s({render:m?e("a",{}):d??e("a",{}),enabled:C&&!B,props:{href:m?void 0:n,role:m?"link":void 0,"aria-disabled":m||void 0,className:M,onClick:m?void 0:l,children:z}});return e("li",{ref:k,className:p("flex min-w-0 items-center",x),...v,children:E||(L?e("button",{type:"button",className:M,disabled:m,onClick:l,children:z}):e("span",{className:M,"aria-current":B?"page":void 0,"aria-disabled":m||void 0,children:z}))})});
|
|
@@ -17,8 +17,15 @@ export interface PlButtonProps extends PlassStyleProps, Omit<React.ComponentProp
|
|
|
17
17
|
/**
|
|
18
18
|
* Shows a spinner in place of `startIcon` and stops the button from
|
|
19
19
|
* activating, while keeping it focusable and visually unchanged otherwise.
|
|
20
|
+
* A screen reader hears the label set's `loading` word after its name.
|
|
20
21
|
*/
|
|
21
22
|
loading?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* The word a screen reader hears after the name while `loading` — "Saving",
|
|
25
|
+
* "Sending". It takes the place of the label set's `loading` for this button.
|
|
26
|
+
* @default 'Loading'
|
|
27
|
+
*/
|
|
28
|
+
loadingLabel?: string;
|
|
22
29
|
/** Inert but not dimmed — the action exists, it just is not available here. */
|
|
23
30
|
readOnly?: boolean;
|
|
24
31
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as s,Fragment as e,jsxs as o}from"react/jsx-runtime";import*as r from"react";import{useDefaults as a}from"../../internal/defaults.js";import{Button as l}from"@base-ui/react/button";import{useRender as t}from"@base-ui/react/use-render";import{ButtonGroupContext as i}from"../../internal/button-group.js";import{
|
|
1
|
+
"use client";import{jsx as s,Fragment as e,jsxs as o}from"react/jsx-runtime";import*as r from"react";import{useDefaults as a}from"../../internal/defaults.js";import{Button as l}from"@base-ui/react/button";import{useRender as t}from"@base-ui/react/use-render";import{ButtonGroupContext as i}from"../../internal/button-group.js";import{useDisabled as n}from"../../internal/form.js";import{glowPointerMove as d}from"../../internal/glow.js";import{Spinner as p}from"../../internal/icons.js";import{loadingLabel as c}from"../../internal/loading.js";import{controlHeightClasses as g,controlSlots as v,controlSquareClasses as m,controlTextClasses as b,cx as f,disabledClasses as h,focusRingClasses as u,forcedEdgeClasses as x,gapClasses as $,glassClasses as j,hasContent as w,iconClasses as y,paddingXClasses as k,radiusClasses as P,readOnlyFilterClasses as B,transitionClasses as z}from"../../internal/styles.js";const C={xs:`${g.xs} ${$.xs} ${P.xs} ${b.xs}`,sm:`${g.sm} ${$.sm} ${P.sm} ${b.sm}`,md:`${g.md} ${$.md} ${P.md} ${b.md}`,lg:`${g.lg} ${$.lg} ${P.lg} ${b.lg}`,xl:`${g.xl} ${$.xl} ${P.xl} ${b.xl}`},D={xs:`${m.xs} px-0`,sm:`${m.sm} px-0`,md:`${m.md} px-0`,lg:`${m.lg} px-0`,xl:`${m.xl} px-0`},I=/* @__PURE__ */["relative inline-flex shrink-0 select-none items-center justify-center p-0","whitespace-nowrap align-middle font-semibold leading-none","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",z,u,y].join(" "),W={solid:/* @__PURE__ */["text-(--p-on-solid) [background-image:var(--p-fill)]","[box-shadow:var(--p-elev),var(--p-lift)]",x].join(" "),glass:/* @__PURE__ */[j,"border text-(--p-accent) bg-(--plass-glass)","[border-color:var(--plass-glass-line)]","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]"].join(" "),ghost:"text-(--p-accent) bg-transparent"},M={solid:/* @__PURE__ */["hover:brightness-105","hover:[box-shadow:var(--p-elev-hover),var(--p-lift-hover)]","active:brightness-95","active:[box-shadow:var(--p-elev-press),var(--p-lift-press)]"].join(" "),glass:/* @__PURE__ */["hover:bg-(--plass-glass-hover) hover:[border-color:var(--p-line)]","hover:[box-shadow:var(--p-elev-hover),var(--plass-gloss-glass)]","active:bg-(--plass-glass-press)","active:[box-shadow:var(--p-elev-press),var(--plass-gloss-glass)]"].join(" "),ghost:"hover:bg-(--p-soft) active:bg-(--p-soft-hover)"},N={solid:/* @__PURE__ */["cursor-default text-(--p-on-solid) [background-image:var(--p-fill)]",`shadow-none ${B}`].join(" "),glass:/* @__PURE__ */[j,"cursor-default border text-(--p-accent) bg-(--plass-glass)","[border-color:var(--plass-glass-line)]",`[box-shadow:var(--plass-gloss-glass)] ${B}`].join(" "),ghost:`cursor-default text-(--p-accent) bg-transparent ${B}`};export const PlButton=/* @__PURE__ */r.forwardRef(function PlButton({variant:g,size:m,color:b,density:u,elevation:x,startIcon:$,endIcon:j,loading:y=!1,loadingLabel:P,readOnly:B=!1,fullWidth:z=!1,disabled:F,focusableWhenDisabled:L=!1,render:O,className:R,style:q,children:A,onClick:E,onPointerMove:G,"aria-describedby":H,...J},K){const Q=a(),S=r.useId(),T=r.useContext(i),U=g??T?.variant??"solid",V=m??T?.size??Q.size??"md",X=b??T?.color??Q.color??"primary",Y=u??T?.density??Q.density??"default",Z=x??T?.elevation??1,_=n(!1),ss=(F??T?.disabled??!1)||_&&!O,es=!w(A),os=y||B,rs=!ss&&!os,as=[I,C[V],es?D[V]:k[Y][V],ss?h[U]:B?N[U]:W[U],rs?`${M[U]} cursor-pointer`:"",rs?"plass-glow":"",y?"cursor-progress":"",z?"w-full":"",R??""].filter(Boolean).join(" ");return t({render:O??s(l,{disabled:ss,focusableWhenDisabled:L}),ref:K,props:{className:as,style:{...v(X,Z,U),...q},"aria-disabled":os||ss&&L||void 0,"aria-busy":y||void 0,"aria-describedby":y?f(H,S):H,"data-loading":y||void 0,"data-readonly":B||void 0,onClick:s=>{if(os)return s.preventDefault(),void s.stopPropagation();E?.(s)},onPointerMove:d(rs,G),...J,children:o(e,{children:[y?s(p,{}):$,A,j,y?s("span",{id:S,hidden:!0,children:P??Q.labels?.loading??c}):null]})}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as t from"react";import{useDefaults as o}from"../../internal/defaults.js";import{Calendar as
|
|
1
|
+
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as t from"react";import{useDefaults as o,useLocale as r,useRuntimeTimeZone as n}from"../../internal/defaults.js";import{Calendar as l,usePickerLabels as s}from"../../internal/calendar.js";import{popupPaddingClasses as i,popupSlots as d}from"../../internal/picker.js";import{FieldsetDisabledContext as m,useDisabled as c,useFormReport as u}from"../../internal/form.js";import{inertProps as f}from"../../internal/inert.js";import{isSameMonth as p,isValidDate as h,localeWeekStart as v,mergeDateAndTime as y,startOfDay as j,startOfMonth as D,today as b,todayIn as x,toISODate as w,toISOMonth as S,toISOYear as g}from"../../internal/date.js";import{controlTextLeadingClasses as C,cx as O,disabledClasses as k,radiusClasses as z,sheetRestClasses as M}from"../../internal/styles.js";const P={day:w,month:S,year:g};export const PlCalendar=/* @__PURE__ */t.forwardRef(function PlCalendar({variant:w="glass",size:S,color:g,elevation:F=1,value:N,defaultValue:R,onValueChange:V,precision:E="day",month:q,defaultMonth:A,onMonthChange:B,minDate:G,maxDate:H,shouldDisableDate:I,locale:J,weekStartsOn:K,showOutsideDays:L=!0,autoFocus:Q=!1,disabled:T=!1,name:U,labels:W,className:X,style:Y,...Z},$){const _=o(),ee=c(T),ae=r(J),te=S??_.size??"md",oe=g??_.color??"primary",re=s(W),ne=K??_.weekStartsOn??v(ae),[le,se]=t.useState(R??null),ie=void 0!==N?N:le,de=n(),[me,ce]=t.useState(()=>D(h(ie)?ie:A??x(de))),ue=q??me,fe=t.useRef(!h(ie)&&void 0===A);t.useEffect(()=>{if(void 0!==de||!fe.current)return;fe.current=!1;const e=D(b());ce(a=>p(a,e)?a:e)},[de]);const setMonth=e=>{void 0===q&&ce(e),B?.(e)},pe=h(ie)?P[E](ie):"";return u(U,()=>pe,!ee),a("div",{ref:$,...f(ee),className:O("inline-flex flex-col",M[w],z[te],i[te],C[te],ee?k[w]:"",X),style:{...d(oe,F),...Y},role:Z["aria-label"]||Z["aria-labelledby"]?"group":void 0,...Z,children:[e(m.Provider,{value:!1,children:e(l,{size:te,color:oe,locale:ae,weekStartsOn:ne,month:ue,onMonthChange:setMonth,precision:E,selected:[ie],onSelect:e=>{const a=h(ie)?y(e,ie):j(e);void 0===N&&se(a),V?.(a),setMonth(D(a))},minDate:G,maxDate:H,shouldDisableDate:I,showOutsideDays:L,autoFocus:Q,labels:re})}),U?e("input",{type:"hidden",name:U,value:pe,disabled:ee}):null]})});
|
|
@@ -20,7 +20,8 @@ export interface PlCardProps extends PlassStyleProps, Omit<React.ComponentPropsW
|
|
|
20
20
|
subtitle?: React.ReactNode;
|
|
21
21
|
/**
|
|
22
22
|
* Content pinned to the end of the header row — a menu button, a status
|
|
23
|
-
* chip.
|
|
23
|
+
* chip. Centred on the title's first line, and stays there while the title
|
|
24
|
+
* wraps beside it. The header grows to hold whichever of the two is taller.
|
|
24
25
|
*/
|
|
25
26
|
headerAction?: React.ReactNode;
|
|
26
27
|
/**
|
|
@@ -51,15 +52,18 @@ export interface PlCardProps extends PlassStyleProps, Omit<React.ComponentPropsW
|
|
|
51
52
|
* pane of glass says it can be picked up.
|
|
52
53
|
*
|
|
53
54
|
* It changes how the card looks and nothing else. A card that is actually
|
|
54
|
-
* clickable
|
|
55
|
-
* `
|
|
56
|
-
*
|
|
55
|
+
* clickable needs a real link: the title's own, stretched over the card by an
|
|
56
|
+
* `::after` with `absolute inset-0` against a `relative` card, so it is
|
|
57
|
+
* focusable, announced, and named by the title alone. A control in a slot
|
|
58
|
+
* takes `relative` and a `z-index` to sit above it. Rendering the whole card
|
|
59
|
+
* as the link puts every slot inside it, and a button in one of them inside a
|
|
60
|
+
* link.
|
|
57
61
|
* @default false
|
|
58
62
|
*/
|
|
59
63
|
interactive?: boolean;
|
|
60
64
|
/**
|
|
61
65
|
* Renders something other than a `<div>`: `render={<section />}`,
|
|
62
|
-
* `render={<li />}`, `render={<
|
|
66
|
+
* `render={<li />}`, `render={<article />}`. Base UI's own escape hatch.
|
|
63
67
|
*/
|
|
64
68
|
render?: useRender.RenderProp;
|
|
65
69
|
/** The card's body. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as s,Fragment as r}from"react/jsx-runtime";import*as a from"react";import{useDefaults as
|
|
1
|
+
"use client";import{jsx as e,jsxs as s,Fragment as r}from"react/jsx-runtime";import*as a from"react";import{useDefaults as l}from"../../internal/defaults.js";import{useRender as o}from"@base-ui/react/use-render";import{focusRingClasses as t,hasContent as n,metaTextClasses as i,radiusClasses as c,sheetBodyClasses as d,sheetHeaderGapClasses as v,sheetLineClasses as p,sheetPaddingXClasses as m,sheetPaddingYClasses as f,sheetRestClasses as u,sheetSectionGapClasses as h,sheetTitleClasses as g,surfaceSlots as x}from"../../internal/styles.js";const b=/* @__PURE__ */["[transition-property:background-color,border-color,box-shadow,color,transform]","[transition-duration:var(--plass-duration)]","[transition-timing-function:var(--plass-ease)]","motion-reduce:[transition-duration:0ms]"].join(" "),y={solid:/* @__PURE__ */["cursor-pointer hover:-translate-y-0.5","hover:[box-shadow:var(--p-elev-hover),var(--plass-gloss-glass)]","active:translate-y-0 active:[box-shadow:var(--p-elev-press),var(--plass-gloss-glass)]"].join(" "),glass:/* @__PURE__ */["cursor-pointer hover:-translate-y-0.5 hover:bg-(--plass-glass-hover)","hover:[border-color:var(--p-line)]","hover:[box-shadow:var(--p-elev-hover),var(--plass-gloss-glass)]","active:translate-y-0 active:[box-shadow:var(--p-elev-press),var(--plass-gloss-glass)]"].join(" "),ghost:"cursor-pointer hover:bg-(--p-soft) active:bg-(--p-soft-hover)"};export const PlCard=/* @__PURE__ */a.forwardRef(function PlCard({variant:a="glass",size:N,color:$,density:j,elevation:w=1,title:k,subtitle:z,headerAction:B,footer:C,dividers:P=!1,padded:A=!0,interactive:F=!1,render:R,className:q,style:D,children:E,...G},H){const I=l(),J=N??I.size??"md",K=$??I.color??"primary",L=j??I.density??"default",M=A?m[L][J]:"",O=A?f[L][J]:"",Q=P?`${M} ${O}`:M,S=n(k)||n(z)||n(B),T=`font-semibold ${g[J]}`,U=i[J],V=n(k)?T:n(z)?U:null,W=s(r,{children:[n(k)||n(z)?s("div",{className:`flex min-w-0 flex-1 flex-col ${v[J]}`,children:[n(k)?e("div",{className:`plass-title ${T}`,children:k}):null,n(z)?e("div",{className:`text-(--plass-muted-fg) ${U}`,children:z}):null]}):null,n(B)?s("div",{className:"ms-auto flex shrink-0 items-center",children:[V?e("span",{"aria-hidden":"true",className:`plass-strut w-0 ${V}`}):null,B]}):null]}),X=[S?{key:"header",className:"flex items-baseline gap-3",content:W}:null,n(E)?{key:"content",className:d[J],content:E}:null,n(C)?{key:"footer",className:`flex flex-wrap items-center gap-2 ${d[J]}`,content:C}:null].filter(e=>null!==e),Y=["flex flex-col",c[J],u[a],b,F?`${y[a]} ${t}`:"",P?"overflow-hidden":`${O} ${h[J]}`,q??""].filter(Boolean).join(" ");return o({render:R??e("div",{}),ref:H,props:{className:Y,style:{...x(K,w),...D},...G,children:X.map((s,r)=>e("div",{className:[Q,s.className,P&&r>0?p:""].filter(Boolean).join(" "),children:s.content},s.key))}})});
|
|
@@ -20,12 +20,18 @@ export interface PlCarouselProps extends PlassStyleProps, Omit<React.ComponentPr
|
|
|
20
20
|
*/
|
|
21
21
|
loop?: boolean;
|
|
22
22
|
/**
|
|
23
|
-
* Advances on its own
|
|
23
|
+
* Advances on its own, with a button over the frame that stops it and starts
|
|
24
|
+
* it again.
|
|
24
25
|
*
|
|
25
26
|
* Off by default and deliberately so: a carousel that moves while it is being
|
|
26
|
-
* read is the most complained-about pattern on the web. It pauses
|
|
27
|
-
*
|
|
28
|
-
*
|
|
27
|
+
* read is the most complained-about pattern on the web. It pauses while the
|
|
28
|
+
* pointer is over it, while a finger is down on the strip, while the tab is
|
|
29
|
+
* in the background, and while it is hidden in a tab panel that is not
|
|
30
|
+
* selected or a closed disclosure; once the finger lifts, or it is shown
|
|
31
|
+
* again, it holds the slide it is on for a whole `interval`. It **stops** once
|
|
32
|
+
* the focus comes into it or an arrow or a dot is clicked, and stays stopped
|
|
33
|
+
* until the button starts it again. For a reader who has asked for reduced
|
|
34
|
+
* motion it starts stopped.
|
|
29
35
|
* @default false
|
|
30
36
|
*/
|
|
31
37
|
autoPlay?: boolean;
|
|
@@ -45,6 +51,10 @@ export interface PlCarouselProps extends PlassStyleProps, Omit<React.ComponentPr
|
|
|
45
51
|
previousLabel?: string;
|
|
46
52
|
/** @default 'Next slide' */
|
|
47
53
|
nextLabel?: string;
|
|
54
|
+
/** What the `autoPlay` button says while the carousel is stopped. @default 'Start slide show' */
|
|
55
|
+
playLabel?: string;
|
|
56
|
+
/** What it says while the carousel is playing. @default 'Stop slide show' */
|
|
57
|
+
stopLabel?: string;
|
|
48
58
|
/**
|
|
49
59
|
* How one slide is named to a screen reader, and how its dot is labelled.
|
|
50
60
|
* @default `Slide {index} of {count}`, from the label pack
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{mergeProps as n}from"@base-ui/react/merge-props";import{useDefaults as s}from"../../internal/defaults.js";import{useLabels as o}from"../../internal/labels.js";import{PlIconButton as a}from"../icon-button/PlIconButton.js";import{ChevronIcon as l,PauseIcon as i,PlayIcon as c}from"../../internal/icons.js";import{layoutBox as u}from"../../internal/layout-box.js";import{usePrefersReducedMotion as d}from"../../internal/media.js";import{cx as f,pictureSlotClasses as m,radiusClasses as h,sheetRestClasses as p,srOnlyClasses as v,surfaceSlots as b,transitionClasses as g}from"../../internal/styles.js";const w={xs:"start-1 end-1",sm:"start-1.5 end-1.5",md:"start-2 end-2",lg:"start-3 end-3",xl:"start-4 end-4"},x={xs:"top-1 start-1",sm:"top-1.5 start-1.5",md:"top-2 start-2",lg:"top-3 start-3",xl:"top-4 start-4"},y={xs:{rest:"h-1 w-1",current:"h-1 w-3"},sm:{rest:"h-1 w-1",current:"h-1 w-3.5"},md:{rest:"h-1.5 w-1.5",current:"h-1.5 w-4"},lg:{rest:"h-1.5 w-1.5",current:"h-1.5 w-5"},xl:{rest:"h-2 w-2",current:"h-2 w-6"}};function scrollTrackTo(e,t,r){const{perPixel:n}=u(e,!0),s=t.getBoundingClientRect().left-e.getBoundingClientRect().left;e.scrollTo({left:e.scrollLeft+s*n,behavior:r})}export const PlCarousel=/* @__PURE__ */r.forwardRef(function PlCarousel({variant:u="glass",size:R,color:T,density:N,elevation:k=0,value:j,defaultValue:C=0,onValueChange:L,loop:E=!0,autoPlay:S=!1,interval:z=5e3,arrows:P=!0,indicators:M=!0,label:B,previousLabel:I,nextLabel:W,playLabel:_,stopLabel:V,slideLabel:O,className:$,style:A,children:F,...q},D){const G=s(),H=o(),J=B??H.carousel,K=I??H.carouselPrevious,Q=W??H.carouselNext,U=_??H.carouselPlay,X=V??H.carouselStop,Y=R??G.size??"md",Z=T??G.color??"primary",ee=N??G.density??"default",te=O??H.carouselSlide,re=r.Children.toArray(F),ne=re.length,[se,oe]=r.useState(C),ae=Math.min(Math.max(j??se,0),Math.max(ne-1,0)),le=r.useRef(null),ie=r.useRef([]),ce=r.useRef(!1),ue=r.useRef(!1),de=r.useRef(!1),fe=r.useRef(!1),me=r.useRef(0),[he,pe]=r.useState(0),[ve,be]=r.useState(!1),ge=r.useRef(new Set),[we,xe]=r.useState(!1),[ye,Re]=r.useState(null),Te=d(),Ne=ye??Te,ke=S&&!Ne,je=r.useRef(null),Ce=r.useRef(!1),Le=r.useCallback((e,t=!1)=>{if(0===ne)return;const r=E?(e%ne+ne)%ne:Math.min(Math.max(e,0),ne-1);ce.current=t,void 0===j&&oe(r),r!==ae&&L?.(r)},[ne,E,j,ae,L]),Ee=r.useRef(ae);r.useLayoutEffect(()=>{Ee.current=ae}),r.useLayoutEffect(()=>{const e=le.current;if(!e)return;const place=()=>{const t=ie.current[Ee.current];t&&scrollTrackTo(e,t,"instant")};if("undefined"==typeof ResizeObserver)return void(Ee.current>0&&place());fe.current=0===e.clientWidth,!fe.current&&Ee.current>0&&place();const t=new ResizeObserver(e=>{0===e[e.length-1].contentRect.width?fe.current=!0:fe.current&&(fe.current=!1,place(),me.current+=1,pe(me.current))});return t.observe(e),()=>t.disconnect()},[]),r.useEffect(()=>{if(ce.current)return void(ce.current=!1);if(!ue.current)return void(ue.current=!0);const e=le.current,t=ie.current[ae];e&&t&&scrollTrackTo(e,t),de.current=!0;const r=window.setTimeout(()=>{de.current=!1},700);return()=>window.clearTimeout(r)},[ae]);const Se=r.useRef(Le);r.useEffect(()=>{Se.current=Le}),r.useEffect(()=>{if(!ke)return;const handleVisibility=()=>{document.hidden||(me.current+=1,pe(me.current))};return document.addEventListener("visibilitychange",handleVisibility),()=>document.removeEventListener("visibilitychange",handleVisibility)},[ke]),r.useEffect(()=>{if(!ke||ve||we||ne<2)return;const e=window.setInterval(()=>{document.hidden||fe.current||me.current!==he||0===le.current?.clientWidth||Se.current(ae+1)},z);return()=>window.clearInterval(e)},[ke,ve,we,ne,z,ae,he]);const handleTouch=e=>{const t="touchstart"===e.type;for(let r=0;r<e.changedTouches.length;r+=1){const{identifier:n}=e.changedTouches[r];t?ge.current.add(n):ge.current.delete(n)}xe(ge.current.size>0)},hold=()=>{S&&!Ce.current&&Re(!0)},steer=e=>{hold(),Le(e)},ze=ae<=0,Pe=ae>=ne-1;return t("div",{ref:D,role:"region","aria-roledescription":H.carousel,"aria-label":J,className:f("flex flex-col",$),style:{...b(Z,k),...A},...n(q,{onPointerEnter:()=>be(!0),onPointerLeave:()=>be(!1),onFocus:e=>{e.currentTarget.contains(e.relatedTarget)||(Ce.current=!1),e.target!==je.current&&hold()},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(Ce.current=!1)}}),children:[t("div",{className:f("relative min-w-0 overflow-hidden",h[Y],p[u],g),children:[S&&ne>1?e("div",{className:f("absolute z-10 flex",x[Y]),children:e(a,{ref:je,variant:"glass",size:Y,color:Z,density:ee,elevation:1,label:Ne?U:X,icon:e(Ne?c:i,{}),onClick:()=>{const e=!Ne;Re(e),Ce.current=!e}})}):null,e("div",{ref:le,tabIndex:0,role:"group","aria-label":J,className:f("flex min-w-0 snap-x snap-mandatory overflow-x-auto scroll-smooth","motion-reduce:scroll-auto","[scrollbar-width:none] [&::-webkit-scrollbar]:hidden","focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:[outline-offset:-2px]"),onScroll:()=>{const e=le.current;if(de.current||fe.current||!e||0===e.clientWidth)return;const t=Math.round(Math.abs(e.scrollLeft)/e.clientWidth);t!==ae&&t>=0&&t<ne&&Le(t,!0)},onTouchStart:handleTouch,onTouchEnd:handleTouch,onTouchCancel:handleTouch,children:re.map((t,n)=>e("div",{ref:e=>{ie.current[n]=e},role:"group","aria-roledescription":H.slide,"aria-label":te(n+1,ne),className:f("w-full shrink-0 grow-0 basis-full snap-start",m),children:t},r.isValidElement(t)?t.key??n:n))}),P&&ne>1?t("div",{className:f("pointer-events-none absolute inset-y-0 flex items-center",w[Y]),children:[e(a,{variant:"glass",size:Y,color:Z,density:ee,elevation:1,label:K,disabled:!E&&ze,className:"pointer-events-auto",icon:e("span",{className:"flex rotate-90 items-center rtl:-rotate-90",children:e(l,{})}),onClick:()=>steer(ae-1)}),e("span",{className:"flex-1"}),e(a,{variant:"glass",size:Y,color:Z,density:ee,elevation:1,label:Q,disabled:!E&&Pe,className:"pointer-events-auto",icon:e("span",{className:"flex -rotate-90 items-center rtl:rotate-90",children:e(l,{})}),onClick:()=>steer(ae+1)})]}):null]}),M&&ne>1?e("div",{className:"flex shrink-0 items-center justify-center",children:re.map((t,r)=>e("button",{type:"button","aria-label":te(r+1,ne),"aria-current":r===ae?"true":void 0,className:f("group flex h-6 min-w-6 cursor-pointer items-center justify-center rounded-full p-0","focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:outline-offset-0"),onClick:()=>steer(r),children:e("span",{"aria-hidden":"true",className:f("rounded-full","[transition-property:width,background-color]","[transition-duration:var(--plass-duration)]","[transition-timing-function:var(--plass-ease)]","motion-reduce:[transition-duration:0ms]",r===ae?`${y[Y].current} bg-(--p-accent)`:`${y[Y].rest} bg-(--plass-border) group-hover:bg-(--p-accent)`)})},r))}):null,e("span",{className:v,"aria-live":ke?"off":"polite",children:ne>0?te(ae+1,ne):""})]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as s,Fragment as a}from"react/jsx-runtime";import*as
|
|
1
|
+
"use client";import{jsx as e,jsxs as s,Fragment as a}from"react/jsx-runtime";import*as r from"react";import{useDefaults as n}from"../../internal/defaults.js";import{useLabels as l}from"../../internal/labels.js";import{CheckIcon as i,ClockIcon as t,LinkIcon as o,severityIcon as d}from"../../internal/icons.js";import{safeHref as c}from"../../internal/link.js";import{controlSlots as p,focusRingClasses as m,forcedFieldEdgeClasses as u,glassClasses as g,hasContent as f,metaTextClasses as v,radiusClasses as h,sheetBodyClasses as x,sheetHeaderGapClasses as b,srOnlyClasses as y,transitionClasses as k}from"../../internal/styles.js";const w={default:{xs:"px-2 py-1",sm:"px-2.5 py-1.5",md:"px-3 py-2",lg:"px-3.5 py-2.5",xl:"px-4 py-3"},compact:{xs:"px-1.5 py-0.5",sm:"px-2 py-1",md:"px-2.5 py-1.5",lg:"px-3 py-1.5",xl:"px-3.5 py-2"}},N={start:"[border-start-start-radius:0.25rem]",end:"[border-start-end-radius:0.25rem]"},j={solid:/* @__PURE__ */["text-(--p-on-solid) [background-image:var(--p-fill)]","[box-shadow:var(--p-elev),var(--p-lift)]",u].join(" "),glass:/* @__PURE__ */[g,"border text-(--plass-fg) bg-(--plass-glass)","[border-color:var(--plass-glass-line)]","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]"].join(" "),ghost:"text-(--plass-fg) bg-(--p-soft) [box-shadow:var(--p-elev)]"};function DoubleCheckIcon(){return s("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[e("path",{d:"m1.5 8.5 2.75 2.75L9.5 6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M7 10.75 8.25 12l5.25-5.25",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})]})}const _={sending:e(t,{}),sent:e(i,{}),delivered:e(DoubleCheckIcon,{}),read:e(DoubleCheckIcon,{}),failed:/* @__PURE__ */d("danger")};function statusWord(e,s){switch(e){case"sending":return s.messageSending;case"sent":return s.messageSent;case"delivered":return s.messageDelivered;case"read":return s.messageRead;case"failed":return s.messageFailed}}const C={sending:"text-(--plass-muted-fg)",sent:"text-(--plass-muted-fg)",delivered:"text-(--plass-muted-fg)",read:"text-(--p-accent)",failed:"text-(--plass-danger-accent)"},L=/* @__PURE__ */["block overflow-hidden rounded-(--plass-radius-sm) border no-underline","[border-color:color-mix(in_oklab,currentColor_18%,transparent)]","[background-color:color-mix(in_oklab,currentColor_7%,transparent)]"].join(" "),z=/* @__PURE__ */[L,"hover:[background-color:color-mix(in_oklab,currentColor_12%,transparent)]","[transition-property:background-color] [transition-duration:var(--plass-duration)]","[transition-timing-function:var(--plass-ease)]","motion-reduce:[transition-duration:0ms]",m].join(" "),D=/* @__PURE__ */["shrink-0 opacity-0","[transition:opacity_var(--plass-duration)_var(--plass-ease)]","motion-reduce:[transition-duration:0ms]","group-hover/bubble:opacity-100 group-focus-within/bubble:opacity-100","[@media(hover:none)]:opacity-100"].join(" ");export const PlChatBubble=/* @__PURE__ */r.forwardRef(function PlChatBubble({side:a="start",name:r,time:i,avatar:t,status:o,statusLabel:d,typing:c=!1,typingLabel:m,media:u,preview:g,actions:L,variant:z="glass",size:B,color:P,density:W,elevation:I=0,className:T,style:F,children:R,...S},M){const $=n(),q=l(),A=m??q.typing,E=B??$.size??"md",G=P??$.color??"primary",H=W??$.density??"default",J="end"===a,K=f(r)||f(i),O=c||f(R)||Boolean(g),Q=["flex min-w-0 flex-col overflow-hidden",h[E],N[a],j[z],k].join(" ");return s("div",{ref:M,className:["group/bubble flex w-full items-start gap-2",J?"flex-row-reverse":"",T??""].filter(Boolean).join(" "),style:{...p(G,I,z),...F},...S,children:[f(t)?e("div",{className:"shrink-0",children:t}):null,s("div",{className:["flex max-w-[min(100%,32rem)] min-w-0 flex-col",b[E],J?"items-end":"items-start"].join(" "),children:[K?s("div",{className:`flex items-baseline gap-2 ${v[E]}`,children:[f(r)?e("span",{className:"font-semibold",children:r}):null,f(i)?e("span",{className:"text-(--plass-muted-fg)",children:i}):null]}):null,s("div",{className:"flex min-w-0 items-center gap-1 "+(J?"flex-row-reverse":""),children:[s("div",{className:Q,children:[f(u)?e("div",{className:"[&_img]:block [&_img]:w-full [&_video]:block [&_video]:w-full [:where(&_img)]:h-auto [:where(&_video)]:h-auto",children:u}):null,O?s("div",{className:[w[H][E],"flex min-w-0 flex-col gap-2",x[E]].join(" "),children:[c?e(TypingDots,{label:A}):f(R)?e("div",{className:"min-w-0 break-words whitespace-pre-line",children:R}):null,g?e(LinkPreview,{preview:g}):null]}):null]}),f(L)?e("div",{className:D,children:L}):null]}),o?s("div",{className:["flex items-center gap-1",v[E],C[o],"[&_svg]:size-[1.15em] [&_svg]:shrink-0"].join(" "),children:[_[o],e("span",{className:y,children:d??statusWord(o,q)})]}):null]})]})});function TypingDots({label:a}){return s("div",{className:"flex items-center gap-1 py-[0.35em]",role:"status",children:[[0,1,2].map(s=>e("span",{"aria-hidden":"true",className:"plass-typing-dot size-[0.45em] rounded-full",style:{"--p-i":s}},s)),e("span",{className:y,children:a})]})}function LinkPreview({preview:r}){const{url:n,title:l,description:i,image:t,site:d,newTab:p=!1}=r,m=c(n),u=s(a,{children:[t?e("img",{src:t,alt:"",loading:"lazy",decoding:"async",className:"block h-28 w-full object-cover"}):null,s("div",{className:"flex flex-col gap-0.5 p-2",children:[f(d)?s("span",{className:"flex items-center gap-1 text-[0.85em] opacity-70 [&_svg]:size-[1em] [&_svg]:shrink-0",children:[e(o,{}),e("span",{className:"truncate",children:d})]}):null,f(l)?e("span",{className:"font-semibold",children:l}):null,f(i)?e("span",{className:"line-clamp-2 text-[0.9em] opacity-80",children:i}):null]})]});return void 0===m?e("div",{className:L,children:u}):e("a",{href:m,target:p?"_blank":void 0,rel:p?"noopener noreferrer":void 0,className:z,children:u})}
|