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
package/README.md
CHANGED
|
@@ -55,12 +55,12 @@ If your project already runs Tailwind v4, import the token sheet instead:
|
|
|
55
55
|
|
|
56
56
|
```css
|
|
57
57
|
@import 'tailwindcss';
|
|
58
|
-
@import 'plass-ui/css/base.css'; /* tokens
|
|
58
|
+
@import 'plass-ui/css/base.css'; /* the tokens, once */
|
|
59
59
|
@import 'plass-ui/css/button.css';
|
|
60
60
|
@import 'plass-ui/css/text-field.css';
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
Still one Tailwind pass, so the utilities keep Tailwind's own order, and about
|
|
63
|
+
Still one Tailwind pass, so the utilities keep Tailwind's own order, and about 10 kB gzipped smaller for a small set of components. There is one manifest per component, named after its folder in `dist/components`.
|
|
64
64
|
|
|
65
65
|
### The page under the components
|
|
66
66
|
|
|
@@ -120,7 +120,9 @@ One thing does **not** change with the theme, and it is deliberate: the colour o
|
|
|
120
120
|
|
|
121
121
|
Every component is exported under a `Pl` prefix. `Button`, `Card` and `Table` are the most-taken identifiers in the ecosystem, and a consumer should not have to alias ours on import.
|
|
122
122
|
|
|
123
|
-
130 of them
|
|
123
|
+
130 of them, one for each folder in `dist/components`. The [Flutter package](https://pub.dev/packages/plass_ui) holds 127 of these under the same names, and the other three, `PlFlex`, `PlPortal` and `PlVisuallyHidden`, answer problems only the DOM has. Every component has a page of its own with live previews and the full props table.
|
|
124
|
+
|
|
125
|
+
The list also names two exports that are not counted, because each shares a folder and a page with another component: `PlToggleGroup`, beside `PlToggle`, and `PlContextMenu`, a second trigger onto `PlMenu`'s surface. Flutter has `PlToggleGroup` but not `PlContextMenu`, for a reason of its own: no right-click gesture means the same thing on every platform Flutter runs on, so a Flutter app opens a `PlMenu` from `onLongPress` itself.
|
|
124
126
|
|
|
125
127
|
### Charts
|
|
126
128
|
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { PlassElevation, PlassStyleProps } from '../../types.js';
|
|
2
|
+
import type { PlassElevation, PlassHeadingLevel, PlassStyleProps } from '../../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* The six levels an HTML heading has.
|
|
5
|
+
*
|
|
6
|
+
* @deprecated Use `PlassHeadingLevel`, the same type in the shared vocabulary,
|
|
7
|
+
* which `PlDrawer` takes too.
|
|
8
|
+
*/
|
|
9
|
+
export type PlAccordionHeadingLevel = PlassHeadingLevel;
|
|
3
10
|
export interface PlAccordionProps extends PlassStyleProps, Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'defaultValue' | 'onChange'> {
|
|
4
11
|
/**
|
|
5
12
|
* Drop shadow depth. `0` is the default — an accordion is part of the page it
|
|
@@ -32,6 +39,17 @@ export interface PlAccordionProps extends PlassStyleProps, Omit<React.ComponentP
|
|
|
32
39
|
dividers?: boolean;
|
|
33
40
|
/** Unavailable. Every section stops answering. */
|
|
34
41
|
disabled?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* The level of the heading every section's header is, `1` to `6`.
|
|
44
|
+
*
|
|
45
|
+
* A header is a heading, so a screen reader's list of headings can take the
|
|
46
|
+
* reader from one question to the next — and a heading has to sit one level
|
|
47
|
+
* under the one above it, or the outline skips a step. `3` fits an accordion
|
|
48
|
+
* under a section's `<h2>`; an FAQ directly under the page's `<h1>` wants `2`.
|
|
49
|
+
* Only the element changes: the type scale is the accordion's either way.
|
|
50
|
+
* @default 3
|
|
51
|
+
*/
|
|
52
|
+
headingLevel?: PlassHeadingLevel;
|
|
35
53
|
/**
|
|
36
54
|
* Keeps closed panels in the DOM so the browser's own page search can find
|
|
37
55
|
* and open them. Overrides `keepMounted`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as l from"react";import{useDefaults as s}from"../../internal/defaults.js";import{
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as l from"react";import{useDefaults as s}from"../../internal/defaults.js";import{headingLevelOf as a}from"../../internal/heading.js";import{Accordion as n}from"@base-ui/react/accordion";import{ChevronIcon as i}from"../../internal/icons.js";import{focusRingClasses as r,focusRingInsetClasses as o,gapClasses as d,hasContent as c,iconClasses as m,metaTextClasses as p,radiusClasses as u,sheetBodyClasses as f,sheetHeaderGapClasses as h,sheetPaddingXClasses as x,sheetPaddingYClasses as v,sheetRestClasses as g,sheetTitleClasses as b,surfaceSlots as N,transitionClasses as j}from"../../internal/styles.js";const y=/* @__PURE__ */l.createContext({size:"md",density:"default",dividers:!0,headingLevel:3}),w={xs:u.xs,sm:u.xs,md:u.sm,lg:u.sm,xl:u.md},$={default:{xs:"pt-1.5",sm:"pt-2",md:"pt-3",lg:"pt-3.5",xl:"pt-4"},compact:{xs:"pt-1",sm:"pt-1.5",md:"pt-2",lg:"pt-2.5",xl:"pt-3"}},P={default:{xs:"pb-2.5",sm:"pb-3",md:"pb-5",lg:"pb-6",xl:"pb-7"},compact:{xs:"pb-2",sm:"pb-2.5",md:"pb-3.5",lg:"pb-4",xl:"pb-5"}};export const PlAccordion=/* @__PURE__ */l.forwardRef(function PlAccordion({variant:t="glass",size:i,color:r,density:o,elevation:d=0,multiple:c=!1,value:m,defaultValue:p,onValueChange:f,dividers:h=!0,disabled:x=!1,headingLevel:v=3,hiddenUntilFound:b=!1,keepMounted:w,className:$,style:P,children:k,...z},A){const C=s(),I=i??C.size??"md",L=r??C.color??"primary",V=o??C.density??"default",_=a(v)??3,B=l.useMemo(()=>({size:I,density:V,dividers:h,headingLevel:_}),[I,V,h,_]),M=["flex flex-col",u[I],g[t],j,h?"overflow-hidden [&>div+div]:border-t [&>div+div]:[border-color:var(--plass-divider)]":"p-1",$??""].filter(Boolean).join(" ");return e(y.Provider,{value:B,children:e(n.Root,{ref:A,multiple:c,value:m,defaultValue:p,onValueChange:e=>f?.(e),disabled:x,hiddenUntilFound:b,keepMounted:w,className:M,style:{...N(L,d),...P},...z,children:k})})});export const PlAccordionItem=/* @__PURE__ */l.forwardRef(function PlAccordionItem({value:s,title:a,subtitle:u,startIcon:g,action:N,truncate:k=!1,disabled:z=!1,className:A,children:C,...I},L){const{size:V,density:_,dividers:B,headingLevel:M}=l.useContext(y),R=`h${M}`,F=x[_][V],U=v[_][V],H=k?"truncate":"";return t(n.Item,{ref:L,value:s,disabled:z,className:["flex flex-col",A??""].filter(Boolean).join(" "),...I,children:[t(n.Header,{render:e(R,{}),className:"m-0 flex w-full items-center [font:inherit]",children:[t(n.Trigger,{className:["flex min-w-0 flex-1 cursor-pointer items-center text-start",F,U,d[V],j,m,B?o:`${r} ${w[V]}`,"hover:bg-(--p-soft)","data-[panel-open]:bg-(--p-soft) data-[panel-open]:text-(--p-accent)","disabled:cursor-not-allowed disabled:bg-transparent disabled:opacity-50"].filter(Boolean).join(" "),children:[c(g)?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--plass-muted-fg)",children:g}):null,t("span",{className:`flex min-w-0 flex-1 flex-col ${h[V]}`,children:[c(a)?e("span",{className:`plass-title font-semibold ${H} ${b[V]}`.trim(),children:a}):null,c(u)?e("span",{className:`text-(--plass-muted-fg) ${H} ${p[V]}`.trim(),children:u}):null]}),e("span",{className:["flex h-[1lh] shrink-0 items-center text-(--plass-muted-fg)","[transition:rotate_var(--plass-duration)_var(--plass-ease)]","motion-reduce:[transition-duration:0ms]","data-[panel-open]:rotate-180"].join(" "),children:e(i,{})})]}),c(N)?e("span",{className:`flex shrink-0 items-center ${F}`,children:N}):null]}),e(n.Panel,{className:["h-(--accordion-panel-height) overflow-hidden","[transition:height_var(--plass-duration-slow)_var(--plass-ease)]","motion-reduce:[transition-duration:0ms]","data-[starting-style]:h-0 data-[ending-style]:h-0"].join(" "),children:e("div",{className:["text-(--plass-muted-fg)",f[V],F,$[_][V],P[_][V]].join(" "),children:C})})]})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { PlAccordion, PlAccordionItem } from './PlAccordion.js';
|
|
2
|
-
export type { PlAccordionProps, PlAccordionItemProps } from './PlAccordion.js';
|
|
2
|
+
export type { PlAccordionHeadingLevel, PlAccordionProps, PlAccordionItemProps } from './PlAccordion.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as s,jsxs as e}from"react/jsx-runtime";import*as l from"react";import{useDefaults as t}from"../../internal/defaults.js";import{useLabels as a}from"../../internal/labels.js";import{CloseIcon as i,severityIcon as r}from"../../internal/icons.js";import{controlSlots as o,focusRingClasses as n,forcedFieldEdgeClasses as c,glassClasses as d,hasContent as m,iconClasses as f,radiusClasses as p,sheetBodyClasses as u,sheetHeaderGapClasses as h,sheetPaddingXClasses as v,sheetPaddingYClasses as x,sheetSectionGapClasses as g,sheetTitleClasses as b,transitionClasses as
|
|
1
|
+
"use client";import{jsx as s,jsxs as e}from"react/jsx-runtime";import*as l from"react";import{useDefaults as t}from"../../internal/defaults.js";import{useLabels as a}from"../../internal/labels.js";import{CloseIcon as i,severityIcon as r}from"../../internal/icons.js";import{controlSlots as o,focusRingClasses as n,forcedFieldEdgeClasses as c,glassClasses as d,hasContent as m,iconClasses as f,radiusClasses as p,sheetBodyClasses as u,sheetHeaderGapClasses as h,sheetPaddingXClasses as v,sheetPaddingYClasses as x,sheetSectionGapClasses as g,sheetTitleClasses as b,targetClasses as y,transitionClasses as j}from"../../internal/styles.js";const N={solid:/* @__PURE__ */["text-(--p-on-solid) [background-image:var(--p-fill)]","[box-shadow:var(--p-elev),var(--p-lift)]",c].join(" "),glass:/* @__PURE__ */[d,"border text-(--plass-fg) bg-(--plass-glass)","[border-color:var(--p-line)]","[box-shadow:var(--p-elev),var(--plass-gloss-glass)]"].join(" "),ghost:"text-(--plass-fg) bg-(--p-soft)"},w={solid:"",glass:"text-(--p-accent)",ghost:"text-(--p-accent)"},k={solid:"",glass:"text-(--plass-muted-fg)",ghost:"text-(--plass-muted-fg)"},$={primary:"status",secondary:"status",info:"status",success:"status",warning:"alert",danger:"alert"};export const PlAlert=/* @__PURE__ */l.forwardRef(function PlAlert({variant:l="glass",size:c,color:d,density:z,elevation:A=0,title:C,icon:P,action:_,onClose:B,closeLabel:L,className:R,style:q,children:D,...E},F){const G=t(),H=a(),I=L??H.dismiss,J=c??G.size??"md",K=d??G.color??"info",M=z??G.density??"default",O=void 0===P?r(K):P,Q=w[l],S=m(C);return e("div",{ref:F,role:$[K],className:["flex w-full items-start",v[M][J],x[M][J],p[J],g[J],u[J],j,N[l],f,R??""].filter(Boolean).join(" "),style:{...o(K,A,l),...q},...E,children:[m(O)?s("span",{className:`flex h-[1lh] shrink-0 items-center ${Q}`,children:O}):null,e("div",{className:`flex min-w-0 flex-1 flex-col ${h[J]}`,children:[S?s("div",{className:`plass-title font-semibold ${b[J]} ${Q}`,children:C}):null,m(D)?s("div",{className:S?k[l]:void 0,children:D}):null]}),m(_)?s("div",{className:"flex h-[1lh] shrink-0 items-center",children:_}):null,B?s("span",{className:"flex h-[1lh] shrink-0 items-center",children:s("button",{type:"button","aria-label":I,onClick:B,className:[y,"inline-flex size-[1.15em] cursor-pointer items-center justify-center rounded-full p-0","opacity-70 [transition:opacity_var(--plass-duration)_var(--plass-ease)]","motion-reduce:[transition-duration:0ms]","hover:opacity-100 focus-visible:opacity-100",n].join(" "),children:s(i,{})})}):null]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{useDefaults as n}from"../../internal/defaults.js";import{resolveScrollTarget as s}from"../../internal/scroll-target.js";import{useLabels as
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{useDefaults as n}from"../../internal/defaults.js";import{layoutBox as o}from"../../internal/layout-box.js";import{resolveScrollTarget as s}from"../../internal/scroll-target.js";import{useLabels as l}from"../../internal/labels.js";import{controlTextLeadingClasses as i,cx as a,focusRingClasses as c,surfaceSlots as m,transitionClasses as f}from"../../internal/styles.js";export const PlAnchor=/* @__PURE__ */r.forwardRef(function PlAnchor({items:d,active:p,offset:u=0,target:h,onSelect:g,label:v,navLabel:x,size:b,color:w,className:j,style:y,...E},N){const A=n(),L=l(),z=x??L.onThisPage,H=b??A.size??"sm",P=w??A.color??"primary",[B,C]=r.useState(void 0),R=void 0!==p;r.useEffect(()=>{if(R)return;const e=s(h);if(!e)return;let t=0;const measure=()=>{t=0,C(function readingAt(e,t,r){if(0===e.length)return;const n=r instanceof Window,s=n?document.documentElement.scrollHeight:r.scrollHeight,l=n?window.innerHeight:r.clientHeight,i=n?window.scrollY:r.scrollTop;if(s>l+1&&l+i>=s-2)return e[e.length-1].href;const a=n?0:r.getBoundingClientRect().top,c=n?0:r.clientTop,m=n?1:o(r,!1).perPixel;let f;for(const r of e){const e=document.getElementById(r.href.replace(/^#/,""));e&&(e.getBoundingClientRect().top-a)*m-c-t<=1&&(f=r.href)}return f}(d,u,e))},onScroll=()=>{t||=requestAnimationFrame(measure)};return measure(),e.addEventListener("scroll",onScroll,{passive:!0}),window.addEventListener("resize",onScroll,{passive:!0}),()=>{t&&cancelAnimationFrame(t),e.removeEventListener("scroll",onScroll),window.removeEventListener("resize",onScroll)}},[R,d,u,h]);const S=R?p:B;return t("nav",{ref:N,"aria-label":z,className:a("flex flex-col gap-2",i[H],j),style:{...m(P,0),...y},...E,children:[v?e("span",{className:"font-semibold text-(--plass-fg)",children:v}):null,e("ul",{className:"m-0 flex list-none flex-col gap-0.5 p-0",children:d.map(t=>{const r=t.href===S;return e("li",{className:"min-w-0",children:e("a",{href:t.href,"aria-current":r?"location":void 0,onClick:e=>g?.(t,e),className:a("block truncate rounded-(--plass-radius-xs) px-2 py-1","border-s-2",f,c,r?"[border-color:var(--p-accent)] bg-(--p-soft) font-medium text-(--p-accent)":"border-transparent text-(--plass-muted-fg) hover:bg-(--plass-glass-hover) hover:text-(--plass-fg)"),style:{paddingInlineStart:`calc(0.5rem + ${t.depth??0} * 0.75rem)`},children:t.label})},t.href)})})]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";import{mergeProps as a}from"@base-ui/react/merge-props";import{useRender as r}from"@base-ui/react/use-render";import{animBaseClass as t,animateChildren as n,animationClasses as s,animationSlots as i,isInfinite as o,slideOffsets as p,staggerSlots as d,useAnimationRun as l}from"../../internal/animate.js";export const PlAnimateAppear=/* @__PURE__ */e.forwardRef(function PlAnimateAppear({duration:e=380,delay:m=0,easing:c,repeat:u=1,alternate:f,paused:g,trigger:y="mount",play:h,once:x=!0,threshold:A=.2,stagger:b=70,durationStep:v=0,from:N="bottom",distance:P="0.75rem",fade:S=!0,reverse:$=!1,render:j,className:w,style:R,children:k,...q},z){const B=l({trigger:y,play:h,once:x,threshold:A,paused:g,infinite:o(u)}),{x:C,y:D}=p(N,P),E=n(k,`${t} ${s.slide}`,(a,r)=>i(d({duration:e,delay:m,easing:c,repeat:u,alternate:f,x:C,y:D,opacity:S?0:1},{index:a,count:r,stagger:b,durationStep:v,reverse:$})));return r({render:j,ref:[z,B.ref],props:{...a(q,B.handlers),className:w,style:{"--p-anim-state":B.state,...R},"data-plass-animation":"appear","data-state":B.state,children:E}})});
|
|
1
|
+
"use client";import*as e from"react";import{mergeProps as a}from"@base-ui/react/merge-props";import{useRender as r}from"@base-ui/react/use-render";import{animBaseClass as t,animateChildren as n,animationClasses as s,animationSlots as i,isInfinite as o,slideOffsets as p,staggerSlots as d,useAnimationRun as l}from"../../internal/animate.js";export const PlAnimateAppear=/* @__PURE__ */e.forwardRef(function PlAnimateAppear({duration:e=380,delay:m=0,easing:c,repeat:u=1,alternate:f,paused:g,trigger:y="mount",play:h,once:x=!0,threshold:A=.2,stagger:b=70,durationStep:v=0,from:N="bottom",distance:P="0.75rem",fade:S=!0,reverse:$=!1,render:j,className:w,style:R,children:k,...q},z){const B=l({trigger:y,play:h,once:x,threshold:A,paused:g,infinite:o(u),endless:o(u)}),{x:C,y:D}=p(N,P),E=n(k,`${t} ${s.slide}`,(a,r)=>i(d({duration:e,delay:m,easing:c,repeat:u,alternate:f,x:C,y:D,opacity:S?0:1},{index:a,count:r,stagger:b,durationStep:v,reverse:$})));return r({render:j,ref:[z,B.ref],props:{...a(q,B.handlers),className:w,style:{"--p-anim-state":B.state,...R},"data-plass-animation":"appear","data-state":B.state,children:E}})});
|
|
@@ -5,7 +5,9 @@ export interface PlAnimateCounterProps extends Omit<React.ComponentPropsWithoutR
|
|
|
5
5
|
/** The number it arrives at, and the one a screen reader is told. */
|
|
6
6
|
value: number;
|
|
7
7
|
/**
|
|
8
|
-
* The number
|
|
8
|
+
* The number the first count starts from, and a replay of it: a second
|
|
9
|
+
* hover, a new `play`, a `visible` trigger seen again. A new `value` counts
|
|
10
|
+
* on from the figure on screen instead.
|
|
9
11
|
* @default 0
|
|
10
12
|
*/
|
|
11
13
|
from?: number;
|
|
@@ -18,7 +20,8 @@ export interface PlAnimateCounterProps extends Omit<React.ComponentPropsWithoutR
|
|
|
18
20
|
delay?: number;
|
|
19
21
|
/**
|
|
20
22
|
* How the number is written — `Intl.NumberFormat` options, so a currency, a
|
|
21
|
-
* percentage or a compact `1.2M` all work.
|
|
23
|
+
* percentage or a compact `1.2M` all work. The figures on the way are written
|
|
24
|
+
* with them too, and never with more decimals than the answer has.
|
|
22
25
|
*
|
|
23
26
|
* This is the reason the count is JavaScript rather than a `@property` and a
|
|
24
27
|
* CSS counter, which is otherwise the neater way to animate a number: CSS can
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as r,Fragment as t,jsxs as e}from"react/jsx-runtime";import*as n from"react";import{mergeProps as a}from"@base-ui/react/merge-props";import{useRender as u}from"@base-ui/react/use-render";import{useAnimationRun as i}from"../../internal/animate.js";import{useLocale as o}from"../../internal/defaults.js";import{usePrefersReducedMotion as s}from"../../internal/media.js";import{cx as c,drawnCopyClasses as m,srOnlyClasses as l}from"../../internal/styles.js";function easeOut(r){return 1-(1-r)**3}function fractionDigitsIn(r){return r.reduce((r,t)=>"fraction"===t.type?r+[...t.value].length:r,0)}export const PlAnimateCounter=/* @__PURE__ */n.forwardRef(function PlAnimateCounter({value:f,from:d=0,duration:g=1200,delay:p=0,format:h,easing:F=easeOut,trigger:v="visible",play:y,once:x=!0,threshold:A=.2,paused:b,render:j,className:D,...N},P){const R=o(),w=s(),q=i({trigger:v,play:y,once:x,threshold:A,paused:b,infinite:!1,target:f}),I=`${R??""}\0${JSON.stringify(h??null)}`,k=n.useRef(null);null!==k.current&&k.current.key===I||(k.current={key:I,formatter:new Intl.NumberFormat(R,h)});const M=k.current.formatter,O=M.format(f),S=`${I}\0${f}`,$=n.useRef(null);if(null===$.current||$.current.key!==S){const r=function frameFormatter(r,t,e,n){const a=fractionDigitsIn(r.formatToParts(t)),u=r.resolvedOptions(),i=u.roundingPriority??"auto",o=u.maximumFractionDigits??a,s=void 0!==u.maximumSignificantDigits&&"auto"===i,c="auto"!==i&&void 0===n?.roundingPriority;if(o<=a&&!s&&!c)return r;let m;try{m=new Intl.NumberFormat(e,{...n,...s?{roundingPriority:"lessPrecision"}:{},minimumFractionDigits:Math.min(u.minimumFractionDigits??0,a),maximumFractionDigits:a})}catch{return r}return c?{format(t){const e=r.formatToParts(t);return fractionDigitsIn(e)>a?m.format(t):e.map(r=>r.value).join("")}}:m}(M,f,R,h),t=r.format(-0),e=r.format(0);$.current={key:S,write:n=>{const a=r.format(n);return a===t?e:a}}}const E=$.current,[C,T]=n.useState(()=>w?f:d),[J,z]=n.useState({value:f,from:d,runs:q.runs,origin:d,pending:!1,count:0});J.value!==f||J.from!==d?z({value:f,from:d,runs:q.runs,origin:J.from!==d?d:C,pending:J.pending||J.value!==f,count:J.count+1}):J.runs!==q.runs&&z(J.pending?{...J,runs:q.runs,pending:!1}:{...J,runs:q.runs,origin:d,count:J.count+1});const B=J.origin,G=n.useRef(0),H=n.useRef(null),K=n.useRef(F),L=n.useRef(p);n.useEffect(()=>{K.current=F,L.current=p}),n.useEffect(()=>{G.current=0,H.current=null},[J.count]),n.useEffect(()=>{const r=Math.max(1,g);let t,e=0;if(w){if(T(f),!q.started)return;const land=()=>{H.current??=L.current,G.current=Math.max(G.current,H.current+r)};if(null!==H.current||G.current>=L.current)return void land();if(b)return;const wait=r=>{t??=r-G.current,G.current=r-t,G.current<L.current?e=requestAnimationFrame(wait):land()};return e=requestAnimationFrame(wait),()=>cancelAnimationFrame(e)}if(!q.started)return G.current=0,H.current=null,void T(d);if(b)return;null===H.current&&G.current<L.current&&T(B);const step=n=>{t??=n-G.current,G.current=n-t;const a=Math.min(1,(G.current-(H.current??L.current))/r);a<0?e=requestAnimationFrame(step):(H.current??=L.current,T(B+(f-B)*K.current(a)),a<1&&(e=requestAnimationFrame(step)))};return e=requestAnimationFrame(step),()=>cancelAnimationFrame(e)},[q.started,J.count,w,b,f,d,B,g]);const Q=C===f?O:E.write(C),U=C===f?null:E.write(B);return u({render:j??r("span",{}),ref:[P,q.ref],props:{className:c("tabular-nums",D),"data-plass-animation":"counter","data-state":q.state,children:e(t,{children:[r("span",{className:l,children:O}),r("span",{"aria-hidden":"true","data-text":Q,"data-sample":O,className:m,children:null===U?null:r("span",{"data-text":U,className:"invisible [grid-area:1/1] before:content-[attr(data-text)]"})})]}),...a(N,q.handlers)}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";import{mergeProps as a}from"@base-ui/react/merge-props";import{useRender as r}from"@base-ui/react/use-render";import{animBaseClass as t,lengthValue as n,useAnimateElement as i}from"../../internal/animate.js";import{cx as
|
|
1
|
+
"use client";import*as e from"react";import{mergeProps as a}from"@base-ui/react/merge-props";import{useRender as r}from"@base-ui/react/use-render";import{animBaseClass as t,lengthValue as n,useAnimateElement as i}from"../../internal/animate.js";import{cx as s}from"../../internal/styles.js";export const PlAnimateFloat=/* @__PURE__ */e.forwardRef(function PlAnimateFloat({duration:e=3e3,delay:l=0,easing:o="ease-in-out",repeat:c="infinite",alternate:m,paused:p,trigger:d="mount",play:f,once:u=!0,threshold:y=.2,distance:h=8,orientation:g="vertical",render:b,className:v,style:x,children:N,...j},A){const F=n(h),P="vertical"===g,w=i({effect:null,duration:e,delay:l,easing:o,repeat:c,alternate:m,x:P?"0":F,y:P?"number"==typeof h?-h+"px":`calc(-1 * ${F})`:"0",trigger:d,play:f,once:u,threshold:y,paused:p,infinite:!0,moves:!0,children:N});return r({render:b,ref:[A,w.ref],props:{...a(j,w.props),className:s(t,"plass-anim-float",w.className,v),style:{...w.style,...x},"data-plass-animation":"float",children:w.children}})});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { PlassAnimateProps } from '../../types.js';
|
|
2
|
+
import type { PlassAnimateProps, PlassAnimateRepeat } from '../../types.js';
|
|
3
3
|
export interface PlAnimateHeadlineProps extends Omit<PlassAnimateProps, 'alternate'>, React.ComponentPropsWithoutRef<'div'> {
|
|
4
4
|
/**
|
|
5
5
|
* How long each line is held before the next one comes up, in milliseconds.
|
|
@@ -23,6 +23,15 @@ export interface PlAnimateHeadlineProps extends Omit<PlassAnimateProps, 'alterna
|
|
|
23
23
|
* @default true
|
|
24
24
|
*/
|
|
25
25
|
loop?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* How the headline stops, and nothing else. It counts neither lines nor
|
|
28
|
+
* cycles: `loop` decides whether the lines start again after the last one.
|
|
29
|
+
* With `trigger="hover"`, `'infinite'` stops the reel where it is when the
|
|
30
|
+
* pointer and the focus leave, and a count leaves it turning after they have
|
|
31
|
+
* gone. Under any other `trigger` it changes nothing.
|
|
32
|
+
* @default 'infinite'
|
|
33
|
+
*/
|
|
34
|
+
repeat?: PlassAnimateRepeat;
|
|
26
35
|
/**
|
|
27
36
|
* How far a line travels as it comes up or leaves — a CSS length, or a number
|
|
28
37
|
* in pixels. `'100%'` is one line's own height.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import*as
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{mergeProps as r}from"@base-ui/react/merge-props";import{isInfinite as a,lengthValue as i,useAnimationRun as s}from"../../internal/animate.js";import{usePrefersReducedMotion as l}from"../../internal/media.js";import{cx as o}from"../../internal/styles.js";export const PlAnimateHeadline=/* @__PURE__ */n.forwardRef(function PlAnimateHeadline({duration:u=460,delay:c=0,easing:m,repeat:d="infinite",paused:f,trigger:p="mount",play:h,once:g=!0,threshold:v=.2,interval:x=2600,index:y,defaultIndex:j=0,onIndexChange:E,loop:N=!0,rise:R="100%",className:T,style:w,children:A,...C},M){const b=s({trigger:p,play:h,once:g,threshold:v,paused:f,infinite:a(d),endless:N&&void 0===y}),H=l(),I=n.Children.toArray(A),P=I.length,[S,k]=n.useState(j),F=Math.min(y??S,Math.max(P-1,0)),[V,$]=n.useState(null),q=n.useRef(F);n.useEffect(()=>{q.current!==F&&($(q.current),q.current=F)},[F]),n.useEffect(()=>{if(null===V)return;const e=setTimeout(()=>$(null),u);return()=>clearTimeout(e)},[V,u]);const z=n.useCallback(()=>{const e=F+1;if(e>=P){if(!N)return;return void 0===y&&k(0),void E?.(0)}void 0===y&&k(e),E?.(e)},[F,P,N,y,E]),B=n.useRef(z);n.useEffect(()=>{B.current=z});const D=n.useRef(!1),G=n.useRef({line:F,gone:0});return n.useEffect(()=>{if(!b.started)return void(G.current={line:F,gone:0});if(P<1)return void(G.current={line:F,gone:0});if(void 0!==y)return void(G.current={line:F,gone:0});if("running"!==b.state)return;G.current.line!==F&&(G.current={line:F,gone:0});const e=G.current,t=performance.now(),n=P<2||!N&&F===P-1?void 0:setTimeout(()=>{D.current=!0,B.current()},Math.max(0,x+(D.current?0:c)-e.gone));return()=>{clearTimeout(n),e.gone+=performance.now()-t}},[y,P,b.started,b.state,x,c,N,F]),e("div",{ref:e=>{b.ref(e),"function"==typeof M?M(e):M&&(M.current=e)},className:o("plass-headline",T),style:{"--p-anim-duration":`${u}ms`,"--p-anim-rise":i(R),...m?{"--p-anim-ease":m}:{},"--p-anim-state":b.state,...w},"data-plass-animation":"headline","data-state":b.state,...r(C,b.handlers),children:I.map((r,a)=>{const i=a===F?"active":a!==V||H?void 0:"leaving",s=n.isValidElement(r)?r.props:null,l=s?n.cloneElement(r,{className:o("plass-headline-item",s.className),"data-state":i}):e("span",{className:"plass-headline-item","data-state":i,children:r});return t(n.Fragment,{children:[a>0?" ":null,l]},a)})})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";import{mergeProps as r}from"@base-ui/react/merge-props";import{useDefaults as a}from"../../internal/defaults.js";import{useRender as i}from"@base-ui/react/use-render";import{isInfinite as t,useAnimateElement as n}from"../../internal/animate.js";import{cx as o,radiusClasses as
|
|
1
|
+
"use client";import*as e from"react";import{mergeProps as r}from"@base-ui/react/merge-props";import{useDefaults as a}from"../../internal/defaults.js";import{useRender as i}from"@base-ui/react/use-render";import{isInfinite as t,useAnimateElement as n}from"../../internal/animate.js";import{cx as o,radiusClasses as s}from"../../internal/styles.js";export const PlAnimateLighting=/* @__PURE__ */e.forwardRef(function PlAnimateLighting({duration:e=3e3,delay:l=0,easing:p,repeat:m="infinite",alternate:d,paused:g,trigger:c="mount",play:f,once:u=!0,threshold:h=.2,color:y,glow:w,size:$,spread:b=3,arc:v=50,blur:j=5,reverse:x=!1,render:z,className:A,style:L,children:N,...P},R){const k=a(),q=y??k.color??"primary",B=$??k.size??"md",C=n({effect:null,duration:e,delay:l,easing:p,repeat:m,alternate:d,mode:x?"out":"in",trigger:c,play:f,once:u,threshold:h,paused:g,infinite:t(m)});return i({render:z,ref:[R,C.ref],props:{...r(P,C.props),className:o("plass-anim-lighting",s[B],A),style:{...C.style,"--p-anim-glow-from":w??`var(--plass-${q}-solid)`,"--p-anim-glow-to":w??`var(--plass-${q}-solid-to)`,"--p-anim-glow-width":`${b}px`,"--p-anim-glow-arc":`${v}deg`,"--p-anim-glow-blur":`${j}px`,...L},"data-plass-animation":"lighting","data-plass-finite":t(m)?void 0:"",children:N}})});
|
|
@@ -41,6 +41,13 @@ export interface PlAnimateMarqueeProps extends PlassAnimateProps, React.Componen
|
|
|
41
41
|
* @default true
|
|
42
42
|
*/
|
|
43
43
|
pauseOnHover?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* What the strip is called — "Partners", "Customers". It names the box as a
|
|
46
|
+
* group, and under `prefers-reduced-motion` that box is the tab stop a
|
|
47
|
+
* keyboard reader scrolls it with, which is otherwise announced with no name
|
|
48
|
+
* of its own.
|
|
49
|
+
*/
|
|
50
|
+
label?: string;
|
|
44
51
|
/** The things that scroll past. */
|
|
45
52
|
children?: React.ReactNode;
|
|
46
53
|
}
|
|
@@ -66,7 +73,7 @@ export interface PlAnimateMarqueeProps extends PlassAnimateProps, React.Componen
|
|
|
66
73
|
* the box would be out of sight for good. So the stylesheet draws only the
|
|
67
74
|
* first copy and lets the box scroll along it instead of clipping it, and the
|
|
68
75
|
* box is a tab stop while there is anything to scroll, for a reader with no
|
|
69
|
-
* pointer to scroll it with.
|
|
76
|
+
* pointer to scroll it with. `label` is that stop's name.
|
|
70
77
|
*
|
|
71
78
|
* Only the first copy is read out or reached with Tab. The rest carry
|
|
72
79
|
* `aria-hidden`, or a screen reader would announce everything on the strip as
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import*as t from"react";import{mergeProps as r}from"@base-ui/react/merge-props";import{isInfinite as a,lengthValue as n,repeatValue as i,directionValue as s,useAnimationRun as o}from"../../internal/animate.js";import{inertProps as l}from"../../internal/inert.js";import{usePrefersReducedMotion as
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as t from"react";import{mergeProps as r}from"@base-ui/react/merge-props";import{isInfinite as a,lengthValue as n,repeatValue as i,directionValue as s,useAnimationRun as o}from"../../internal/animate.js";import{inertProps as l}from"../../internal/inert.js";import{usePrefersReducedMotion as u}from"../../internal/media.js";import{cx as m}from"../../internal/styles.js";export const PlAnimateMarquee=/* @__PURE__ */t.forwardRef(function PlAnimateMarquee({duration:d,delay:p=0,easing:c,repeat:f="infinite",alternate:h,paused:v,trigger:g="mount",play:y,once:b=!0,threshold:j=.2,orientation:q="horizontal",reverse:x=!1,speed:R=60,gap:H="2rem",copies:M=2,pauseOnHover:S=!0,label:w,className:z,style:A,children:N,...O},W){const G=void 0===d&&R<=0,P=o({trigger:g,play:y,once:b,threshold:j,paused:v||G,infinite:a(f),endless:a(f)}),$=t.useRef(null),k=t.useRef(null),[B,C]=t.useState(0),[E,F]=t.useState(!1),I="vertical"===q,D=u(),J=P.started&&Boolean(v||G),[K,L]=t.useState(null),Q=J&&(D||K===P.runs),T=Q?P.runs:null;T!==K&&L(T);const U=D||Q;t.useEffect(()=>{const e=$.current,t=k.current;if(!e||!t)return;const measure=()=>{const r=getComputedStyle(e),a=parseFloat(I?r.rowGap:r.columnGap)||0,n=I?t.offsetHeight:t.offsetWidth;C(n+a),F(I?e.scrollHeight>e.clientHeight:e.scrollWidth>e.clientWidth)};if(measure(),"undefined"==typeof ResizeObserver)return;const r=new ResizeObserver(measure);return r.observe(t),r.observe(e),()=>r.disconnect()},[I,U]);const V=d??(B>0&&!G?B/R*1e3:12e3);return e("div",{ref:e=>{$.current=e,P.ref(e),"function"==typeof W?W(e):W&&(W.current=e)},className:m("plass-marquee",I&&"plass-marquee-vertical",z),style:{"--p-anim-gap":n(H),...c?{"--p-anim-ease":c}:{},"--p-anim-duration":`${Math.round(V)}ms`,"--p-anim-delay":`${p}ms`,"--p-anim-repeat":i(f),"--p-anim-direction":s(x?"out":"in",h),"--p-anim-state":P.state,...A},"data-plass-animation":"marquee","data-plass-finite":a(f)?void 0:"","data-state":P.state,"data-pause-on-hover":S?"":void 0,tabIndex:U&&E?0:void 0,role:w?"group":void 0,"aria-label":w,...r(O,P.handlers),children:Array.from({length:Math.max(1,M)},(t,r)=>(t=>e("div",{ref:0===t?k:void 0,className:"plass-marquee-track","aria-hidden":0===t?void 0:"true",...l(0!==t),children:N},t))(r))})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as r,Fragment as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{mergeProps as a}from"@base-ui/react/merge-props";import{useRender as s}from"@base-ui/react/use-render";import{useAnimationRun as c}from"../../internal/animate.js";import{usePrefersReducedMotion as u}from"../../internal/media.js";import{poolOf as i,scrambleAt as m}from"../../internal/scramble.js";import{cx as o,drawnCopyClasses as l,srOnlyClasses as f}from"../../internal/styles.js";export const PlAnimateScramble=/* @__PURE__ */n.forwardRef(function PlAnimateScramble({children:d,characters:p,duration:h=1200,delay:x=0,tick:A=45,trigger:M="visible",play:b,once:g=!0,threshold:j=.2,paused:F,render:q,className:y,...N},R){const v=u(),E=c({trigger:M,play:b,once:g,threshold:j,paused:F,infinite:!1,target:d}),S=n.useMemo(()=>p??i(d),[p,d]),[P,k]=n.useState(()=>d),w=n.useRef(0),z=n.useRef(null),B=n.useRef(x);return n.useEffect(()=>{B.current=x}),n.useEffect(()=>{w.current=0,z.current=null},[E.runs,d]),n.useEffect(()=>{const r=Math.max(1,h);let e,t=0;if(v){if(k(d),!E.started)return;const land=()=>{z.current??=B.current,w.current=Math.max(w.current,z.current+r)};if(null!==z.current||w.current>=B.current)return void land();if(F)return;const wait=r=>{e??=r-w.current,w.current=r-e,w.current<B.current?t=requestAnimationFrame(wait):land()};return t=requestAnimationFrame(wait),()=>cancelAnimationFrame(t)}if(!E.started)return w.current=0,z.current=null,void k(m(d,S,0,0));if(F)return;let n=0,a=-1;const step=s=>{e??=s-w.current,w.current=s-e;const c=w.current-(z.current??B.current),u=Math.min(1,c/r),i=Math.floor(Math.max(0,c)/Math.max(1,A));c>=0&&(z.current??=B.current),i!==a&&(a=i,n+=1,k(m(d,S,Math.max(0,u),n))),u<1?t=requestAnimationFrame(step):k(d)};return t=requestAnimationFrame(step),()=>cancelAnimationFrame(t)},[E.started,E.runs,v,F,d,S,h,A]),s({render:q??r("span",{}),ref:[R,E.ref],props:{className:o(y),"data-plass-animation":"scramble","data-state":E.state,children:t(e,{children:[r("span",{className:f,children:d}),r("span",{"aria-hidden":"true","data-text":P,"data-sample":d,className:l})]}),...a(N,E.handlers)}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";import{mergeProps as a}from"@base-ui/react/merge-props";import{useRender as r}from"@base-ui/react/use-render";import{animBaseClass as t,lengthValue as n,useAnimateElement as s}from"../../internal/animate.js";import{cx as i}from"../../internal/styles.js";export const PlAnimateShake=/* @__PURE__ */e.forwardRef(function PlAnimateShake({duration:e=400,delay:l=0,easing:o,repeat:
|
|
1
|
+
"use client";import*as e from"react";import{mergeProps as a}from"@base-ui/react/merge-props";import{useRender as r}from"@base-ui/react/use-render";import{animBaseClass as t,lengthValue as n,useAnimateElement as s}from"../../internal/animate.js";import{cx as i}from"../../internal/styles.js";export const PlAnimateShake=/* @__PURE__ */e.forwardRef(function PlAnimateShake({duration:e=400,delay:l=0,easing:o,repeat:m=1,alternate:p,paused:c,trigger:d="manual",play:f=!1,once:h=!0,threshold:u=.2,replay:y,distance:g=6,render:k,className:N,style:b,children:j,...x},A){const P=s({effect:null,duration:e,delay:l,easing:o,repeat:m,alternate:p,x:n(g),trigger:d,play:f,once:h,threshold:u,paused:c,infinite:!1,moves:!0,nonce:y,children:j});return r({render:k,ref:[A,P.ref],props:{...a(x,P.props),className:i(t,"plass-anim-shake",P.className,N),style:{...P.style,...b},"data-plass-animation":"shake",children:P.children}})});
|
|
@@ -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 a}from"react/jsx-runtime";import*as r from"react";import{mergeProps as n}from"@base-ui/react/merge-props";import{useRender as i}from"@base-ui/react/use-render";import{animBaseClass as s,animationClasses as o,animationSlots as c,isInfinite as p,revealClip as l,slideOffsets as m,staggerSlots as d,useAnimationRun as u}from"../../internal/animate.js";import{cx as f,srOnlyClasses as g}from"../../internal/styles.js";import{graphemesOf as h}from"../../internal/text.js";const y=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Bopomofo}\p{Script=Thai}\p{Script=Lao}\p{Script=Khmer}\p{Script=Myanmar}]/u;function effectStart(e){switch(e){case"slide":return{opacity:0,...m("bottom","100%")};case"grow":return{opacity:0,scale:.8};case"zoom":return{opacity:0,scale:.4};case"rotate":return{opacity:0,angle:"-180deg",angleTo:"0deg"};case"reveal":return{opacity:1,clip:l("left")};default:return{opacity:0}}}export const PlAnimateSplit=/* @__PURE__ */r.forwardRef(function PlAnimateSplit({children:l,by:m="word",effect:S="fade",mode:w="in",duration:x=400,delay:b=0,easing:j,repeat:N=1,alternate:v,paused:k,trigger:$="mount",play:A,once:F=!0,threshold:H=.2,timeline:K,range:M,stagger:P=40,durationStep:T=0,reverse:z=!1,render:B,className:L,style:O,...R},q){const C=r.useMemo(()=>function piecesOf(e,t){const a=[];for(const r of e.split(/(\s+)/)){if(""===r)continue;if("word"===t||""===r.trim()){a.push([r]);continue}let e=[];for(const t of h(r))0===e.length||y.test(t)?(e=[t],a.push(e)):e.push(t)}return a}(l,m),[l,m]),D=u({trigger:"view"===K?"mount":$,play:A,once:F,threshold:H,paused:k,infinite:p(N),endless:p(N)&&"view"!==K}),E={...effectStart(S),duration:x,delay:b,easing:j,repeat:N,alternate:v,mode:w,timeline:K,range:M},G=C.reduce((e,t)=>""===t[0].trim()?e:e+t.length,0),I=`${s} ${o[S]}`;let J=-1;const renderPart=(t,a)=>(J+=1,e("span",{"data-text":t,className:`${I} inline-block whitespace-normal before:content-[attr(data-text)]`,style:{...c(d(E,{index:J,count:G,stagger:P,durationStep:T,reverse:z})),"--p-anim-state":D.state}},a));return i({render:B??e("span",{}),ref:[q,D.ref],props:{...n(R,D.handlers),className:f(L),style:O,"data-plass-animation":S,"data-state":D.state,children:a(t,{children:[e("span",{className:g,children:l}),e("span",{"aria-hidden":"true",className:"select-none",children:C.map((t,a)=>""===t[0].trim()?e(r.Fragment,{children:t[0]},a):1===t.length?renderPart(t[0],a):e("span",{className:"inline-block",children:t.map((e,t)=>renderPart(e,t))},a))})]})}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as t from"react";import{mergeProps as n}from"@base-ui/react/merge-props";import{isInfinite as a,useAnimationRun as u,useOffScreen as c}from"../../internal/animate.js";import{usePrefersReducedMotion as s}from"../../internal/media.js";import{srOnlyClasses as i}from"../../internal/styles.js";import{graphemesOf as l,textOf as o}from"../../internal/text.js";export const PlAnimateTyping=/* @__PURE__ */t.forwardRef(function PlAnimateTyping({text:m,speed:f=24,hold:d=1400,erase:p=!1,eraseSpeed:h,caret:x=!0,caretChar:y="|",duration:g,delay:v=0,repeat:j=1,paused:b,trigger:R="mount",play:w,once:M=!0,threshold:N=.2,className:T,style:S,children:P,...A},E){const k=u({trigger:R,play:w,once:M,threshold:N,paused:b,infinite:a(j),endless:a(j)}),C=s(),$=t.useRef(null),q=c($,x&&!C),z=m??o(P),B=t.useMemo(()=>l(z),[z]),D=B.length,[F,G]=t.useState(()=>({line:B,count:0})),H=t.useRef(0),I=t.useRef(!1),J=t.useRef(1),K=t.useRef(!1),L=t.useRef(null),O=t.useRef(0),Q=g&&D>0?g/D:1e3/Math.max(f,1),U=1e3/Math.max(h??2*f,1);t.useEffect(()=>{H.current=0,I.current=!1,J.current=1,K.current=!1,L.current=null,O.current=0},[z,k.runs]),t.useEffect(()=>{const show=e=>{G(r=>r.line===B&&r.count===e?r:{line:B,count:e})},e="infinite"===j?1/0:Math.max(1,j);if(C){if(show(D),!k.started||b||e>1||0===D)return;const land=()=>{H.current=D,L.current=null};if(H.current>0)return void land();const r=performance.now(),t=setTimeout(land,Math.max(0,v-O.current));return()=>{clearTimeout(t),O.current+=performance.now()-r}}if(!k.started)return H.current=0,I.current=!1,J.current=1,K.current=!1,L.current=null,O.current=0,void show(0);if(b)return;if(k.resting)return void show(H.current);if(0===D)return void show(0);let r,t=!1,n=H.current,a=I.current,u=0,c=!1;if(n>=D&&!a&&J.current>=e)return;const wait=(e,n)=>{L.current=e,u=performance.now(),r=setTimeout(()=>{t||(L.current=null,c=!1,n())},e)},finish=()=>{J.current>=e||(K.current=!0,wait(d,release))},release=()=>{if(K.current=!1,p)return a=!0,I.current=!0,void step();J.current+=1,n=0,H.current=0,show(0),wait(Q,step)},step=()=>{if(a)return n-=1,H.current=n,show(n),n<=0&&(a=!1,I.current=!1,J.current+=1),void wait(a?U:Q,step);n+=1,H.current=n,show(n),n<D?wait(Q,step):finish()};show(n);const s=L.current;return 0!==n||1!==J.current||a?K.current?wait(s??d,release):n>=D&&!a?finish():wait(s??(0===n?v:a?U:Q),step):(c=!0,wait(Math.max(0,v-O.current),step)),()=>{t=!0,clearTimeout(r);const e=performance.now()-u;c&&(O.current+=e),null!==L.current&&(L.current=Math.max(0,L.current-e))}},[k.started,k.runs,B,b,k.resting,C,D,Q,U,v,d,p,j]);const V="string"==typeof y||"number"==typeof y?String(y):null,caretGlyph=(r,t)=>e("span",null===V?{className:r,style:t,children:y}:{"data-text":V,className:`${r} before:content-[attr(data-text)]`,style:t});return r("div",{ref:e=>{$.current=e,k.ref(e),"function"==typeof E?E(e):E&&(E.current=e)},className:T,style:S,"data-plass-animation":"typing","data-state":k.state,...n(A,k.handlers),children:[e("span",{className:i,children:z}),r("span",{"aria-hidden":"true","data-text":F.line.slice(0,F.count).join(""),className:"relative whitespace-pre-wrap before:content-[attr(data-text)]",children:[x?caretGlyph("plass-caret absolute",q?{animationPlayState:"paused"}:void 0):null,e("span",{"data-sample":F.line.slice(F.count).join(""),className:"invisible before:content-[attr(data-sample)]",children:x?caretGlyph("inline-block"):null})]})]})});
|
|
@@ -15,24 +15,12 @@ import type { PlassColor, PlassSize, PlassVariant } from '../../types.js';
|
|
|
15
15
|
* - `circle` — the same tile, round. For the products whose icon is a disc.
|
|
16
16
|
*/
|
|
17
17
|
export type PlAppLogoShape = 'bare' | 'plate' | 'circle';
|
|
18
|
-
|
|
18
|
+
interface PlAppLogoBaseProps extends Omit<React.ComponentPropsWithoutRef<'span'>, 'color'> {
|
|
19
19
|
/**
|
|
20
20
|
* The mark. An `<img>`, an inline `<svg>`, a `PlIcon` — whatever the product's
|
|
21
|
-
* artwork actually is.
|
|
21
|
+
* artwork actually is. It says what it says itself: `alt` does not reach it.
|
|
22
22
|
*/
|
|
23
23
|
children?: React.ReactNode;
|
|
24
|
-
/** A picture to draw as the mark, instead of `children`. */
|
|
25
|
-
src?: string;
|
|
26
|
-
/**
|
|
27
|
-
* What the picture says, for a reader who cannot see it.
|
|
28
|
-
*
|
|
29
|
-
* Leave it empty when `name` is set: the wordmark beside the mark already
|
|
30
|
-
* says the product's name, and a picture that repeats it is a screen reader
|
|
31
|
-
* saying it twice.
|
|
32
|
-
*/
|
|
33
|
-
alt?: string;
|
|
34
|
-
/** The product's name, set beside the mark. */
|
|
35
|
-
name?: React.ReactNode;
|
|
36
24
|
/** A line under the name — an environment, a tenant, a plan. */
|
|
37
25
|
description?: React.ReactNode;
|
|
38
26
|
/** How the artwork is framed. @default 'bare' */
|
|
@@ -52,6 +40,52 @@ export interface PlAppLogoProps extends Omit<React.ComponentPropsWithoutRef<'spa
|
|
|
52
40
|
*/
|
|
53
41
|
render?: useRender.RenderProp;
|
|
54
42
|
}
|
|
43
|
+
/** A name that is there: anything React draws, short of nothing at all. */
|
|
44
|
+
type PlAppLogoName = Exclude<React.ReactNode, null | undefined | boolean>;
|
|
45
|
+
/** A logo with its name beside it, which makes the picture decorative. */
|
|
46
|
+
interface PlAppLogoNamedProps extends PlAppLogoBaseProps {
|
|
47
|
+
/** The product's name, set beside the mark. */
|
|
48
|
+
name: PlAppLogoName;
|
|
49
|
+
/** A picture to draw as the mark, instead of `children`. */
|
|
50
|
+
src?: string;
|
|
51
|
+
/**
|
|
52
|
+
* What the picture says, for a reader who cannot see it. Leave it out: the
|
|
53
|
+
* wordmark beside the mark already says the product's name, and a picture
|
|
54
|
+
* that repeats it is a screen reader saying it twice.
|
|
55
|
+
* @default ''
|
|
56
|
+
*/
|
|
57
|
+
alt?: string;
|
|
58
|
+
}
|
|
59
|
+
/** A picture with no name beside it, which has to say what it is. */
|
|
60
|
+
interface PlAppLogoPictureProps extends PlAppLogoBaseProps {
|
|
61
|
+
/** The product's name, set beside the mark. */
|
|
62
|
+
name?: React.ReactNode;
|
|
63
|
+
/** A picture to draw as the mark, instead of `children`. */
|
|
64
|
+
src: string;
|
|
65
|
+
/**
|
|
66
|
+
* What the picture says, for a reader who cannot see it. Required here: a
|
|
67
|
+
* logo that is the link home with nothing else in it is named by this alone.
|
|
68
|
+
* `alt=""` says the picture is decorative.
|
|
69
|
+
*/
|
|
70
|
+
alt: string;
|
|
71
|
+
}
|
|
72
|
+
/** Artwork drawn as `children`, which speaks for itself. */
|
|
73
|
+
interface PlAppLogoArtworkProps extends PlAppLogoBaseProps {
|
|
74
|
+
/** The product's name, set beside the mark. */
|
|
75
|
+
name?: React.ReactNode;
|
|
76
|
+
src?: undefined;
|
|
77
|
+
/** Only read with `src`. */
|
|
78
|
+
alt?: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* The props of a `PlAppLogo`.
|
|
82
|
+
*
|
|
83
|
+
* A union, so that a picture with no name beside it cannot leave out `alt`. A
|
|
84
|
+
* `src` with neither is a mark nothing describes, and as the link home it is a
|
|
85
|
+
* link with no name. A call that passes a `name` is the same as before, and a
|
|
86
|
+
* decorative picture says so with `alt=""`.
|
|
87
|
+
*/
|
|
88
|
+
export type PlAppLogoProps = PlAppLogoNamedProps | PlAppLogoPictureProps | PlAppLogoArtworkProps;
|
|
55
89
|
/**
|
|
56
90
|
* A product's mark, and its name beside it.
|
|
57
91
|
*
|
|
@@ -70,9 +104,11 @@ export interface PlAppLogoProps extends Omit<React.ComponentPropsWithoutRef<'spa
|
|
|
70
104
|
* **With a `name`, the mark is decorative.** The wordmark beside it already
|
|
71
105
|
* says what the product is called, and a picture that says it again is a screen
|
|
72
106
|
* reader reading the name twice. That is why `alt` is a prop rather than
|
|
73
|
-
* something derived from `name
|
|
107
|
+
* something derived from `name`, and why the type asks for it only when a `src`
|
|
108
|
+
* has no `name` beside it.
|
|
74
109
|
*
|
|
75
110
|
* A logo is nearly always the way back to the front page. `render={<a href="/"
|
|
76
111
|
* />}` makes it one without changing anything about how it is drawn.
|
|
77
112
|
*/
|
|
78
113
|
export declare const PlAppLogo: React.ForwardRefExoticComponent<PlAppLogoProps & React.RefAttributes<HTMLSpanElement>>;
|
|
114
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as s,Fragment as l}from"react/jsx-runtime";import*as
|
|
1
|
+
"use client";import{jsx as e,jsxs as s,Fragment as l}from"react/jsx-runtime";import*as r from"react";import{useRender as t}from"@base-ui/react/use-render";import{useDefaults as a}from"../../internal/defaults.js";import{controlSlots as n,cx as i,focusRingClasses as o,hasContent as c,markRestClasses as m,metaTextClasses as d,radiusClasses as p,transitionClasses as x}from"../../internal/styles.js";const f={xs:"h-5",sm:"h-6",md:"h-8",lg:"h-10",xl:"h-12"},u={xs:"size-5",sm:"size-6",md:"size-8",lg:"size-10",xl:"size-12"},g={xs:"text-sm",sm:"text-base",md:"text-lg",lg:"text-xl",xl:"text-2xl"},h={xs:"gap-1.5",sm:"gap-2",md:"gap-2.5",lg:"gap-3",xl:"gap-3.5"};export const PlAppLogo=/* @__PURE__ */r.forwardRef(function PlAppLogo({children:r,src:z,alt:j="",name:N,description:b,shape:v="bare",variant:w="solid",size:y,color:A,render:L,className:P,style:$,..._},k){const F=a(),R=y??F.size??"md",q=A??F.color??"primary",B="bare"!==v,C=c(N)||c(b),D=z?e("img",{src:z,alt:j,className:B?"size-[70%] object-contain":"h-full w-auto"}):r;return t({render:L,ref:k,props:{className:i("inline-flex items-center text-(--plass-fg) [&_svg]:h-full [&_svg]:w-auto",h[R],o,P),style:{...n(q,1,w),...$},children:s(l,{children:[e("span",{"aria-hidden":!!c(N)||void 0,className:i("flex shrink-0 items-center justify-center overflow-hidden",B?u[R]:f[R],B?`${x} ${m[w]}`:"","circle"===v?"rounded-full":B?p[R]:""),children:D}),C?s("span",{className:"flex min-w-0 flex-col",children:[c(N)?e("span",{className:i("truncate font-semibold",g[R]),children:N}):null,c(b)?e("span",{className:i("truncate text-(--plass-muted-fg)",d[R]),children:b}):null]}):null]}),..._}})});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type CartesianChartProps } from '../../internal/chart-frame.js';
|
|
3
3
|
import { type ChartMarkers } from '../../internal/chart-line.js';
|
|
4
|
-
import type { PlassChartCurve, PlassChartValueLabels } from '../../types.js';
|
|
4
|
+
import type { PlassChartCurve, PlassChartLabelColor, PlassChartNulls, PlassChartValueLabels } from '../../types.js';
|
|
5
5
|
export interface PlAreaChartProps extends CartesianChartProps {
|
|
6
6
|
/**
|
|
7
7
|
* How the edge of the band gets from one point to the next. The same three
|
|
@@ -30,10 +30,39 @@ export interface PlAreaChartProps extends CartesianChartProps {
|
|
|
30
30
|
/** @default 'none' */
|
|
31
31
|
valueLabels?: PlassChartValueLabels;
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
33
|
+
* What colour those numbers are written in.
|
|
34
|
+
*
|
|
35
|
+
* `series` — the default — gives each label the colour of the band it is
|
|
36
|
+
* sitting on, so a plot with four labelled series says which number belongs
|
|
37
|
+
* to which without the reader tracing it back. `ink` writes them all in the
|
|
38
|
+
* page's own foreground: the chart palette clears 4:1 against the sheet,
|
|
39
|
+
* which is the floor a *mark* is held to rather than the 4.5:1 body text
|
|
40
|
+
* wants, so reach for it where the labels have to meet the text contrast rule
|
|
41
|
+
* on their own.
|
|
42
|
+
* @default 'series'
|
|
43
|
+
*/
|
|
44
|
+
valueLabelColor?: PlassChartLabelColor;
|
|
45
|
+
/**
|
|
46
|
+
* What a gap in a series does to the band.
|
|
47
|
+
*
|
|
48
|
+
* - `gap` — it breaks at the `null`. The default, and the only answer that
|
|
49
|
+
* claims nothing the data did not: the blank says the reading is missing.
|
|
50
|
+
* - `connect` — the two sides are joined. Only when the gap is an artefact of
|
|
51
|
+
* how the data was collected; otherwise the segment is a number the chart
|
|
52
|
+
* made up.
|
|
53
|
+
* - `zero` — the gap is read as a zero, everywhere: on the axis, in the
|
|
54
|
+
* tooltip and in the table as well as under the band. For a missing row
|
|
55
|
+
* that genuinely means none.
|
|
56
|
+
* @default 'gap'
|
|
57
|
+
*/
|
|
58
|
+
nulls?: PlassChartNulls;
|
|
59
|
+
/**
|
|
60
|
+
* Bridges a gap instead of breaking at it. It matters more on an area than on
|
|
61
|
+
* a line: a fill that closes across a missing month paints the made-up number
|
|
62
|
+
* over a larger part of the chart.
|
|
63
|
+
* @deprecated Use `nulls`. `connectNulls` is `nulls="connect"`, and `nulls`
|
|
64
|
+
* also has the third answer — reading the gap as a zero — which a boolean
|
|
65
|
+
* cannot express. It is still honoured when `nulls` is not given.
|
|
37
66
|
*/
|
|
38
67
|
connectNulls?: boolean;
|
|
39
68
|
}
|
|
@@ -51,4 +80,4 @@ export interface PlAreaChartProps extends CartesianChartProps {
|
|
|
51
80
|
* so two of them overlapping stay readable. Stacked bands are opaquer, because
|
|
52
81
|
* there the fill *is* the mark rather than a hint at the line above it.
|
|
53
82
|
*/
|
|
54
|
-
export declare function PlAreaChart({ curve, stacked, markers, valueLabels, connectNulls, series, yAxis, format, locale, ...props }: PlAreaChartProps): React.JSX.Element;
|
|
83
|
+
export declare function PlAreaChart({ curve, stacked, markers, valueLabels, valueLabelColor, nulls: nullsProp, connectNulls, series, yAxis, format, locale, ...props }: PlAreaChartProps): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{CartesianChart as
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{CartesianChart as a}from"../../internal/chart-frame.js";import{LineSeries as t}from"../../internal/chart-line.js";import{stackToFull as o,writeChartValue as l,zeroNulls as n}from"../../internal/chart.js";import{useLocale as s}from"../../internal/defaults.js";export function PlAreaChart({curve:i="linear",stacked:c=!1,markers:m="none",valueLabels:u="none",valueLabelColor:f="series",nulls:d,connectNulls:p=!1,series:x,yAxis:k,format:h,locale:j,...v}){const b=s(j),L=r.useId().replace(/:/g,""),g="full"===c,A=d??(p?"connect":"gap"),C=r.useMemo(()=>{const e="zero"===A?n(x):x;return g?o(e,e=>l(e,h,b)):e},[x,A,g,h,b]);return e(a,{...v,series:C,format:h,locale:j,yAxis:g?{min:0,max:100,tickFormat:e=>`${e}%`,...k}:k,stacked:!1!==c,stroked:!1===c,inset:!0,includeZero:!0,headroom:"none"===u?0:10,children:r=>e(t,{context:r,curve:i,filled:!0,stacked:!1!==c,markers:m,valueLabels:u,valueLabelColor:f,nulls:A,gradient:!1,idPrefix:L})})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";import{useDefaults as i}from"../../internal/defaults.js";import{useRender as o}from"@base-ui/react/use-render";import{cx as t,radiusClasses as
|
|
1
|
+
"use client";import*as e from"react";import{useDefaults as i}from"../../internal/defaults.js";import{useRender as o}from"@base-ui/react/use-render";import{cx as t,focusRingClasses as c,radiusClasses as r}from"../../internal/styles.js";const l=/* @__PURE__ */["[&>img]:size-full","[&>video]:size-full","[&>canvas]:size-full","[&>svg]:size-full","[&>iframe]:size-full","[&>picture]:size-full","[&>picture>img]:size-full"].join(" "),n={cover:"[&>img]:object-cover [&>video]:object-cover [&>picture>img]:object-cover",contain:"[&>img]:object-contain [&>video]:object-contain [&>picture>img]:object-contain",fill:"[&>img]:object-fill [&>video]:object-fill [&>picture>img]:object-fill",none:"[&>img]:object-none [&>video]:object-none [&>picture>img]:object-none","scale-down":"[&>img]:object-scale-down [&>video]:object-scale-down [&>picture>img]:object-scale-down"};export const PlAspectRatio=/* @__PURE__ */e.forwardRef(function PlAspectRatio({ratio:e=1,fit:s="cover",rounded:a=!1,size:m,render:f,className:d,style:u,children:p,...j},b){const v=i(),g=m??v.size??"md",z=v.color??"primary",w=t("relative block w-full overflow-hidden",l,n[s],a?r[g]:"",c,d);return o({render:f,ref:b,props:{className:w,style:{aspectRatio:e,"--p-ring":`var(--plass-${z}-ring)`,...u},children:p,...j}})});
|
|
@@ -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 a from"react";import{useDefaults as n,useRuntimeLocale as r}from"../../internal/defaults.js";import{Avatar as i}from"@base-ui/react/avatar";import{controlHeightClasses as s,controlSlots as l,controlSquareClasses as o,cx as c,hasContent as m,markRestClasses as d,pictureSlotClasses as f,radiusClasses as u,srOnlyClasses as h,transitionClasses as p}from"../../internal/styles.js";const g={xs:"text-[0.5625rem]",sm:"text-[0.6875rem]",md:"text-[0.8125rem]",lg:"text-[1rem]",xl:"text-[1.1875rem]"},v=/* @__PURE__ */["relative inline-flex shrink-0 select-none items-center justify-center overflow-hidden","align-middle leading-none font-semibold tracking-wide whitespace-nowrap","[&_svg]:pointer-events-none [&_svg]:size-[55%]",p].join(" ");function PersonIcon(){return t("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:[e("path",{d:"M12 12a4.5 4.5 0 1 0 0-9 4.5 4.5 0 0 0 0 9Z"}),e("path",{d:"M12 14.25c-4.28 0-7.75 2.42-7.75 5.4 0 .75.6 1.35 1.35 1.35h12.8c.75 0 1.35-.6 1.35-1.35 0-2.98-3.47-5.4-7.75-5.4Z"})]})}export const PlAvatar=/* @__PURE__ */a.forwardRef(function PlAvatar({src:a,srcSet:p,alt:x,name:j,initials:y,shape:N,variant:b,size:w,color:z,elevation:A,delay:C,imageProps:P,onLoadingStatusChange:S,className:k,style:B,children:L,...I},M){const F=n(),R=r(void 0),Z=N??"circle",_=b??"ghost",O=w??F.size??"md",U=z??F.color??"primary",$=A??0,q=j?function initialsOf(e,t){const a=e.normalize("NFC").trim().split(/\s+/).filter(Boolean);return 0===a.length?"":((Array.from(a[0])[0]??"")+(a.length>1?Array.from(a[a.length-1])[0]??"":"")).toLocaleUpperCase(t)}(j,R):"",D=x??j,E=m(L)?L:(y??q)||e(PersonIcon,{}),G=m(L)||Boolean(y??q),{className:H,...J}=P??{},K=H??"size-full object-cover",Q=[v,s[O],o[O],g[O],"circle"===Z?"rounded-full":u[O],d[_],k??""].filter(Boolean).join(" ");return t(i.Root,{ref:M,className:Q,style:{...l(U,$,_),...B},...I,children:[a?e(i.Image,{src:a,srcSet:p,alt:D??"",keepMounted:!0,className:e=>"loaded"===e.imageLoadingStatus?K:c(K,"invisible absolute inset-0"),onLoadingStatusChange:S,...J}):null,t(i.Fallback,{delay:a?C:void 0,className:"flex size-full items-center justify-center",children:[D&&G?e("span",{className:h,children:D}):null,e("span",{"aria-hidden":!(!D||!G)||void 0,className:`contents ${f}`,children:E})]})]})});
|