plass-ui 1.7.0 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +229 -0
- package/README.md +3 -3
- package/dist/components/accordion/PlAccordion.d.ts +11 -4
- package/dist/components/accordion/PlAccordion.js +1 -1
- package/dist/components/alert/PlAlert.d.ts +2 -0
- 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.js +1 -1
- package/dist/components/animate-lighting/PlAnimateLighting.js +1 -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/area-chart/PlAreaChart.js +1 -1
- package/dist/components/avatar/PlAvatar.js +1 -1
- package/dist/components/badge/PlBadge.d.ts +2 -0
- package/dist/components/bar-chart/PlBarChart.js +1 -1
- package/dist/components/blockquote/PlBlockquote.d.ts +2 -0
- package/dist/components/bottom-navigation/PlBottomNavigation.d.ts +17 -5
- package/dist/components/bottom-navigation/PlBottomNavigation.js +1 -1
- package/dist/components/box/PlBox.d.ts +2 -0
- package/dist/components/breadcrumb/PlBreadcrumb.d.ts +16 -3
- package/dist/components/breadcrumb/PlBreadcrumb.js +1 -1
- package/dist/components/button/PlButton.d.ts +2 -0
- package/dist/components/button/PlButton.js +1 -1
- package/dist/components/button-group/PlButtonGroup.d.ts +2 -0
- package/dist/components/calendar/PlCalendar.js +1 -1
- package/dist/components/card/PlCard.d.ts +4 -1
- package/dist/components/card/PlCard.js +1 -1
- package/dist/components/carousel/PlCarousel.d.ts +2 -0
- package/dist/components/carousel/PlCarousel.js +1 -1
- package/dist/components/checkbox/PlCheckbox.js +1 -1
- package/dist/components/chip/PlChip.d.ts +2 -0
- package/dist/components/chip/PlChip.js +1 -1
- package/dist/components/code-block/PlCodeBlock.js +1 -1
- package/dist/components/collapsible/PlCollapsible.d.ts +2 -0
- package/dist/components/collapsible/PlCollapsible.js +1 -1
- package/dist/components/color-picker/PlColorPicker.d.ts +2 -0
- package/dist/components/color-picker/PlColorPicker.js +1 -1
- package/dist/components/combobox/PlCombobox.d.ts +3 -1
- 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 +2 -0
- 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/file-picker/PlFilePicker.d.ts +31 -0
- package/dist/components/file-picker/PlFilePicker.js +1 -1
- package/dist/components/file-picker/index.d.ts +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.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.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/hot-keys/PlHotKeys.d.ts +4 -0
- package/dist/components/image/PlImage.js +1 -1
- package/dist/components/image/PlImagePreview.d.ts +3 -2
- package/dist/components/list/PlList.d.ts +18 -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 +4 -3
- package/dist/components/mockup/PlMockup.js +1 -1
- package/dist/components/modal/PlModal.js +1 -1
- package/dist/components/navigation-menu/PlNavigationMenu.d.ts +52 -8
- package/dist/components/navigation-menu/PlNavigationMenu.js +1 -1
- package/dist/components/number-field/PlNumberField.d.ts +3 -1
- package/dist/components/number-field/PlNumberField.js +1 -1
- package/dist/components/otp-field/PlOtpField.d.ts +2 -0
- package/dist/components/otp-field/PlOtpField.js +1 -1
- package/dist/components/overlay/PlOverlay.js +1 -1
- package/dist/components/page-layout/PlPageLayout.js +1 -1
- package/dist/components/pagination/PlPagination.d.ts +2 -0
- 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 +1 -1
- package/dist/components/pie-chart/PlPieChart.js +1 -1
- package/dist/components/pill/PlPill.d.ts +2 -0
- package/dist/components/pill/PlPill.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/scatter-chart/PlScatterChart.js +1 -1
- package/dist/components/scroll-zone/PlScrollZone.d.ts +2 -0
- package/dist/components/scroll-zone/PlScrollZone.js +1 -1
- package/dist/components/segmented-button/PlSegmentedButton.d.ts +6 -1
- package/dist/components/segmented-button/PlSegmentedButton.js +1 -1
- package/dist/components/select/PlSelect.d.ts +2 -0
- 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/sidebar/PlSidebarTrigger.d.ts +2 -0
- 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 +2 -0
- package/dist/components/tabs/PlTabs.js +1 -1
- package/dist/components/text-field/PlTextField.d.ts +2 -0
- 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.d.ts +2 -0
- package/dist/components/toast/PlToast.js +1 -1
- package/dist/components/toggle/PlToggle.js +1 -1
- package/dist/components/toolbar/PlToolbar.d.ts +2 -0
- package/dist/components/tour/PlTour.js +1 -1
- package/dist/components/transfer/PlTransfer.d.ts +2 -0
- 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 +3 -0
- 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.js +1 -1
- package/dist/internal/calendar.js +1 -1
- package/dist/internal/chart-frame.d.ts +132 -11
- package/dist/internal/chart-frame.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 +34 -1
- 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/form.d.ts +43 -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 +7 -2
- 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/labels.d.ts +5 -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/media.d.ts +6 -0
- package/dist/internal/media.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 +1 -1
- package/dist/internal/picker.js +1 -1
- package/dist/internal/progress.d.ts +24 -0
- 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 +15 -8
- package/dist/internal/sizer.js +1 -1
- package/dist/internal/styles.d.ts +22 -6
- package/dist/internal/styles.js +1 -1
- 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 +758 -40
- package/dist/tokens.css +758 -40
- package/dist/types.d.ts +14 -2
- package/package.json +19 -18
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
/* Scan manifest for <segmented-button>. Needs `plass-ui/css/base.css` first. */
|
|
2
2
|
@source '../components/segmented-button';
|
|
3
|
+
@source '../internal/commit-change.js';
|
|
4
|
+
@source '../internal/defaults.js';
|
|
5
|
+
@source '../internal/form.js';
|
|
6
|
+
@source '../internal/glow.js';
|
|
7
|
+
@source '../internal/styles.js';
|
package/dist/css/select.css
CHANGED
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
/* Scan manifest for <select>. Needs `plass-ui/css/base.css` first. */
|
|
2
2
|
@source '../components/select';
|
|
3
|
+
@source '../internal/defaults.js';
|
|
4
|
+
@source '../internal/form.js';
|
|
5
|
+
@source '../internal/glow.js';
|
|
6
|
+
@source '../internal/icons.js';
|
|
7
|
+
@source '../internal/keys.js';
|
|
8
|
+
@source '../internal/notch.js';
|
|
9
|
+
@source '../internal/sizer.js';
|
|
10
|
+
@source '../internal/styles.js';
|
|
11
|
+
@source '../internal/text.js';
|
package/dist/css/show.css
CHANGED
package/dist/css/sidebar.css
CHANGED
|
@@ -3,3 +3,19 @@
|
|
|
3
3
|
@source '../components/button';
|
|
4
4
|
@source '../components/drawer';
|
|
5
5
|
@source '../components/icon-button';
|
|
6
|
+
@source '../internal/breakpoints.js';
|
|
7
|
+
@source '../internal/button-group.js';
|
|
8
|
+
@source '../internal/defaults.js';
|
|
9
|
+
@source '../internal/direction.js';
|
|
10
|
+
@source '../internal/drag.js';
|
|
11
|
+
@source '../internal/form.js';
|
|
12
|
+
@source '../internal/glow.js';
|
|
13
|
+
@source '../internal/heading.js';
|
|
14
|
+
@source '../internal/icons.js';
|
|
15
|
+
@source '../internal/labels.js';
|
|
16
|
+
@source '../internal/layout-box.js';
|
|
17
|
+
@source '../internal/lazy.js';
|
|
18
|
+
@source '../internal/loading.js';
|
|
19
|
+
@source '../internal/media.js';
|
|
20
|
+
@source '../internal/page-layout.js';
|
|
21
|
+
@source '../internal/styles.js';
|
package/dist/css/skeleton.css
CHANGED
package/dist/css/slider.css
CHANGED
package/dist/css/sparkline.css
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
/* Scan manifest for <sparkline>. Needs `plass-ui/css/base.css` first. */
|
|
2
2
|
@source '../components/sparkline';
|
|
3
3
|
@source '../components/box';
|
|
4
|
+
@source '../hooks/usePlElementSize.js';
|
|
5
|
+
@source '../internal/chart-frame.js';
|
|
6
|
+
@source '../internal/chart.js';
|
|
7
|
+
@source '../internal/defaults.js';
|
|
8
|
+
@source '../internal/format.js';
|
|
9
|
+
@source '../internal/labels.js';
|
|
10
|
+
@source '../internal/layout-box.js';
|
|
11
|
+
@source '../internal/loading.js';
|
|
12
|
+
@source '../internal/styles.js';
|
|
13
|
+
@source '../internal/text.js';
|
package/dist/css/spoiler.css
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
/* Scan manifest for <spoiler>. Needs `plass-ui/css/base.css` first. */
|
|
2
2
|
@source '../components/spoiler';
|
|
3
3
|
@source '../components/button';
|
|
4
|
+
@source '../internal/button-group.js';
|
|
5
|
+
@source '../internal/defaults.js';
|
|
6
|
+
@source '../internal/focusable.js';
|
|
7
|
+
@source '../internal/form.js';
|
|
8
|
+
@source '../internal/glow.js';
|
|
9
|
+
@source '../internal/icons.js';
|
|
10
|
+
@source '../internal/inert.js';
|
|
11
|
+
@source '../internal/labels.js';
|
|
12
|
+
@source '../internal/loading.js';
|
|
13
|
+
@source '../internal/styles.js';
|
package/dist/css/stack.css
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
/* Scan manifest for <stack>. Needs `plass-ui/css/base.css` first. */
|
|
2
2
|
@source '../components/stack';
|
|
3
|
+
@source '../internal/breakpoints.js';
|
|
4
|
+
@source '../internal/defaults.js';
|
|
5
|
+
@source '../internal/media.js';
|
|
6
|
+
@source '../internal/responsive.js';
|
|
7
|
+
@source '../internal/styles.js';
|
package/dist/css/stat.css
CHANGED
package/dist/css/stepper.css
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
/* Scan manifest for <stepper>. Needs `plass-ui/css/base.css` first. */
|
|
2
2
|
@source '../components/stepper';
|
|
3
|
+
@source '../internal/breakpoints.js';
|
|
4
|
+
@source '../internal/defaults.js';
|
|
5
|
+
@source '../internal/labels.js';
|
|
6
|
+
@source '../internal/loading.js';
|
|
7
|
+
@source '../internal/media.js';
|
|
8
|
+
@source '../internal/responsive.js';
|
|
9
|
+
@source '../internal/steps.js';
|
|
10
|
+
@source '../internal/styles.js';
|
package/dist/css/switch.css
CHANGED
package/dist/css/table.css
CHANGED
package/dist/css/tabs.css
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
/* Scan manifest for <tabs>. Needs `plass-ui/css/base.css` first. */
|
|
2
2
|
@source '../components/tabs';
|
|
3
|
+
@source '../internal/breakpoints.js';
|
|
4
|
+
@source '../internal/defaults.js';
|
|
5
|
+
@source '../internal/direction.js';
|
|
6
|
+
@source '../internal/media.js';
|
|
7
|
+
@source '../internal/responsive.js';
|
|
8
|
+
@source '../internal/styles.js';
|
|
9
|
+
@source '../internal/wheel.js';
|
package/dist/css/text-field.css
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
/* Scan manifest for <text-field>. Needs `plass-ui/css/base.css` first. */
|
|
2
2
|
@source '../components/text-field';
|
|
3
|
+
@source '../internal/defaults.js';
|
|
4
|
+
@source '../internal/focusable.js';
|
|
5
|
+
@source '../internal/form.js';
|
|
6
|
+
@source '../internal/glow.js';
|
|
7
|
+
@source '../internal/icons.js';
|
|
8
|
+
@source '../internal/keys.js';
|
|
9
|
+
@source '../internal/notch.js';
|
|
10
|
+
@source '../internal/styles.js';
|
package/dist/css/text-link.css
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
/* Scan manifest for <text-link>. Needs `plass-ui/css/base.css` first. */
|
|
2
2
|
@source '../components/text-link';
|
|
3
|
+
@source '../internal/defaults.js';
|
|
4
|
+
@source '../internal/icons.js';
|
|
5
|
+
@source '../internal/labels.js';
|
|
6
|
+
@source '../internal/link.js';
|
|
7
|
+
@source '../internal/loading.js';
|
|
8
|
+
@source '../internal/styles.js';
|
package/dist/css/time-picker.css
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
1
|
/* Scan manifest for <time-picker>. Needs `plass-ui/css/base.css` first. */
|
|
2
2
|
@source '../components/time-picker';
|
|
3
3
|
@source '../components/button';
|
|
4
|
+
@source '../internal/button-group.js';
|
|
5
|
+
@source '../internal/calendar.js';
|
|
6
|
+
@source '../internal/date.js';
|
|
7
|
+
@source '../internal/defaults.js';
|
|
8
|
+
@source '../internal/form.js';
|
|
9
|
+
@source '../internal/format.js';
|
|
10
|
+
@source '../internal/glow.js';
|
|
11
|
+
@source '../internal/icons.js';
|
|
12
|
+
@source '../internal/labels.js';
|
|
13
|
+
@source '../internal/layout-box.js';
|
|
14
|
+
@source '../internal/loading.js';
|
|
15
|
+
@source '../internal/notch.js';
|
|
16
|
+
@source '../internal/picker.js';
|
|
17
|
+
@source '../internal/sizer.js';
|
|
18
|
+
@source '../internal/styles.js';
|
|
19
|
+
@source '../internal/text.js';
|
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
/* Scan manifest for <timeline-chart>. Needs `plass-ui/css/base.css` first. */
|
|
2
2
|
@source '../components/timeline-chart';
|
|
3
3
|
@source '../components/box';
|
|
4
|
+
@source '../hooks/usePlElementSize.js';
|
|
5
|
+
@source '../internal/chart-frame.js';
|
|
6
|
+
@source '../internal/chart.js';
|
|
7
|
+
@source '../internal/defaults.js';
|
|
8
|
+
@source '../internal/format.js';
|
|
9
|
+
@source '../internal/labels.js';
|
|
10
|
+
@source '../internal/layout-box.js';
|
|
11
|
+
@source '../internal/loading.js';
|
|
12
|
+
@source '../internal/styles.js';
|
|
13
|
+
@source '../internal/text.js';
|
package/dist/css/timeline.css
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
/* Scan manifest for <timeline>. Needs `plass-ui/css/base.css` first. */
|
|
2
2
|
@source '../components/timeline';
|
|
3
|
+
@source '../internal/breakpoints.js';
|
|
4
|
+
@source '../internal/defaults.js';
|
|
5
|
+
@source '../internal/media.js';
|
|
6
|
+
@source '../internal/responsive.js';
|
|
7
|
+
@source '../internal/steps.js';
|
|
8
|
+
@source '../internal/styles.js';
|
package/dist/css/toast.css
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
/* Scan manifest for <toast>. Needs `plass-ui/css/base.css` first. */
|
|
2
2
|
@source '../components/toast';
|
|
3
|
+
@source '../internal/defaults.js';
|
|
4
|
+
@source '../internal/icons.js';
|
|
5
|
+
@source '../internal/labels.js';
|
|
6
|
+
@source '../internal/loading.js';
|
|
7
|
+
@source '../internal/styles.js';
|
package/dist/css/toggle.css
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
/* Scan manifest for <toggle>. Needs `plass-ui/css/base.css` first. */
|
|
2
2
|
@source '../components/toggle';
|
|
3
|
+
@source '../internal/button-group.js';
|
|
4
|
+
@source '../internal/defaults.js';
|
|
5
|
+
@source '../internal/form.js';
|
|
6
|
+
@source '../internal/glow.js';
|
|
7
|
+
@source '../internal/styles.js';
|
package/dist/css/toolbar.css
CHANGED
package/dist/css/tooltip.css
CHANGED
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
/* Scan manifest for <tooltip>. Needs `plass-ui/css/base.css` first. */
|
|
2
2
|
@source '../components/tooltip';
|
|
3
|
+
@source '../internal/defaults.js';
|
|
4
|
+
@source '../internal/form.js';
|
|
5
|
+
@source '../internal/glow.js';
|
|
6
|
+
@source '../internal/icons.js';
|
|
7
|
+
@source '../internal/notch.js';
|
|
8
|
+
@source '../internal/picker.js';
|
|
9
|
+
@source '../internal/sizer.js';
|
|
10
|
+
@source '../internal/styles.js';
|
|
11
|
+
@source '../internal/text.js';
|
package/dist/css/tour.css
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
/* Scan manifest for <tour>. Needs `plass-ui/css/base.css` first. */
|
|
2
2
|
@source '../components/tour';
|
|
3
3
|
@source '../components/button';
|
|
4
|
+
@source '../internal/button-group.js';
|
|
5
|
+
@source '../internal/defaults.js';
|
|
6
|
+
@source '../internal/form.js';
|
|
7
|
+
@source '../internal/glow.js';
|
|
8
|
+
@source '../internal/icons.js';
|
|
9
|
+
@source '../internal/labels.js';
|
|
10
|
+
@source '../internal/loading.js';
|
|
11
|
+
@source '../internal/media.js';
|
|
12
|
+
@source '../internal/styles.js';
|
|
13
|
+
@source '../internal/tour.js';
|
package/dist/css/transfer.css
CHANGED
|
@@ -4,3 +4,16 @@
|
|
|
4
4
|
@source '../components/checkbox';
|
|
5
5
|
@source '../components/icon-button';
|
|
6
6
|
@source '../components/text-field';
|
|
7
|
+
@source '../internal/button-group.js';
|
|
8
|
+
@source '../internal/defaults.js';
|
|
9
|
+
@source '../internal/focusable.js';
|
|
10
|
+
@source '../internal/form.js';
|
|
11
|
+
@source '../internal/glow.js';
|
|
12
|
+
@source '../internal/icons.js';
|
|
13
|
+
@source '../internal/keys.js';
|
|
14
|
+
@source '../internal/labels.js';
|
|
15
|
+
@source '../internal/loading.js';
|
|
16
|
+
@source '../internal/notch.js';
|
|
17
|
+
@source '../internal/search.js';
|
|
18
|
+
@source '../internal/styles.js';
|
|
19
|
+
@source '../internal/text.js';
|
package/dist/css/tree-select.css
CHANGED
|
@@ -2,3 +2,17 @@
|
|
|
2
2
|
@source '../components/tree-select';
|
|
3
3
|
@source '../components/text-field';
|
|
4
4
|
@source '../components/tree';
|
|
5
|
+
@source '../internal/defaults.js';
|
|
6
|
+
@source '../internal/focusable.js';
|
|
7
|
+
@source '../internal/form.js';
|
|
8
|
+
@source '../internal/glow.js';
|
|
9
|
+
@source '../internal/icons.js';
|
|
10
|
+
@source '../internal/keys.js';
|
|
11
|
+
@source '../internal/labels.js';
|
|
12
|
+
@source '../internal/loading.js';
|
|
13
|
+
@source '../internal/notch.js';
|
|
14
|
+
@source '../internal/picker.js';
|
|
15
|
+
@source '../internal/search.js';
|
|
16
|
+
@source '../internal/sizer.js';
|
|
17
|
+
@source '../internal/styles.js';
|
|
18
|
+
@source '../internal/text.js';
|
package/dist/css/tree.css
CHANGED
package/dist/css/window-pane.css
CHANGED
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
/* Scan manifest for <window-pane>. Needs `plass-ui/css/base.css` first. */
|
|
2
2
|
@source '../components/window-pane';
|
|
3
|
+
@source '../internal/defaults.js';
|
|
4
|
+
@source '../internal/drag.js';
|
|
5
|
+
@source '../internal/focusable.js';
|
|
6
|
+
@source '../internal/inert.js';
|
|
7
|
+
@source '../internal/labels.js';
|
|
8
|
+
@source '../internal/layout-box.js';
|
|
9
|
+
@source '../internal/loading.js';
|
|
10
|
+
@source '../internal/styles.js';
|
|
11
|
+
@source '../internal/window.js';
|
|
@@ -131,6 +131,26 @@ export interface AnimationRunOptions {
|
|
|
131
131
|
paused?: boolean;
|
|
132
132
|
/** An infinite effect stops when the pointer leaves; a finite one finishes. */
|
|
133
133
|
infinite: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* Whether the effect runs for ever once it has started: an `'infinite'`
|
|
136
|
+
* repeat, a marquee, a reel that loops.
|
|
137
|
+
*
|
|
138
|
+
* An endless effect **rests while it is off screen** and goes on from the
|
|
139
|
+
* frame it stopped on when it is back. A browser keeps running an animation
|
|
140
|
+
* nobody can see, and a few of these redraw on the main thread on every frame
|
|
141
|
+
* they run, so an endless one left running further up the page costs a reader
|
|
142
|
+
* something on every frame of the rest of their visit. A finite one is left
|
|
143
|
+
* alone: it finishes, and an entrance that played off screen has still
|
|
144
|
+
* delivered its content.
|
|
145
|
+
*/
|
|
146
|
+
endless?: boolean;
|
|
147
|
+
/**
|
|
148
|
+
* Whether the effect moves the element it runs on, so that where the element
|
|
149
|
+
* is drawn is not where it lives. Whether an endless one is on screen is then
|
|
150
|
+
* read off its parent, which stays put: read off the element, a slide that
|
|
151
|
+
* starts outside its mask would rest there, out of sight, for good.
|
|
152
|
+
*/
|
|
153
|
+
moves?: boolean;
|
|
134
154
|
/**
|
|
135
155
|
* A value that plays the effect again whenever it changes, and never on the
|
|
136
156
|
* first render.
|
|
@@ -142,7 +162,30 @@ export interface AnimationRunOptions {
|
|
|
142
162
|
* count of failed attempts already is this.
|
|
143
163
|
*/
|
|
144
164
|
nonce?: unknown;
|
|
165
|
+
/**
|
|
166
|
+
* What the effect arrives at: a counter's figure, a scramble's line. A new
|
|
167
|
+
* one runs the effect again from its start while the trigger has it going,
|
|
168
|
+
* and never on the first render.
|
|
169
|
+
*
|
|
170
|
+
* Unlike `nonce`, it never starts a run the trigger is holding back. A
|
|
171
|
+
* counter waiting to be scrolled to, or for `play`, whose figure changes is
|
|
172
|
+
* still waiting: what changed is what it will count to, and counting there
|
|
173
|
+
* and then is what the trigger was there to stop.
|
|
174
|
+
*/
|
|
175
|
+
target?: unknown;
|
|
145
176
|
}
|
|
177
|
+
/**
|
|
178
|
+
* Whether the element in `node`, or its parent with `parent`, is off screen.
|
|
179
|
+
*
|
|
180
|
+
* `false` until the observer has said otherwise, which is what the server
|
|
181
|
+
* renders and what the first frame shows: an effect runs as it always has, and
|
|
182
|
+
* rests only once something has seen it leave. With no observer to ask, it
|
|
183
|
+
* never rests.
|
|
184
|
+
*
|
|
185
|
+
* Exported for `PlAnimateTyping`'s caret, which blinks for ever after a typing
|
|
186
|
+
* that finishes, and so rests on its own while the typing does not.
|
|
187
|
+
*/
|
|
188
|
+
export declare function useOffScreen(node: React.RefObject<Element | null>, enabled: boolean, parent?: boolean): boolean;
|
|
146
189
|
export interface AnimationRun {
|
|
147
190
|
/** Goes on the animated element. */
|
|
148
191
|
ref: React.RefCallback<HTMLElement>;
|
|
@@ -151,8 +194,14 @@ export interface AnimationRun {
|
|
|
151
194
|
/** Whether the animation has been let go at all. */
|
|
152
195
|
started: boolean;
|
|
153
196
|
/**
|
|
154
|
-
*
|
|
155
|
-
*
|
|
197
|
+
* Whether an endless effect is resting because it is off screen, which
|
|
198
|
+
* `state` already says as `paused`. Typing runs on timers rather than a
|
|
199
|
+
* keyframe, and stops scheduling them while it is true.
|
|
200
|
+
*/
|
|
201
|
+
resting: boolean;
|
|
202
|
+
/**
|
|
203
|
+
* How many times it has been started, counting every hover, every `play`,
|
|
204
|
+
* every change of `nonce` and every change of `target` that started it again.
|
|
156
205
|
*
|
|
157
206
|
* `started` stays `true` from the first start on, so a second hover changes
|
|
158
207
|
* nothing an effect could depend on. A keyframe does not need to know, because
|
|
@@ -171,7 +220,7 @@ export interface AnimationRun {
|
|
|
171
220
|
*/
|
|
172
221
|
handlers: React.HTMLAttributes<HTMLElement>;
|
|
173
222
|
}
|
|
174
|
-
export declare function useAnimationRun({ trigger, play, once, threshold, paused, infinite, nonce }: AnimationRunOptions): AnimationRun;
|
|
223
|
+
export declare function useAnimationRun({ trigger, play, once, threshold, paused, infinite, endless, moves, nonce, target }: AnimationRunOptions): AnimationRun;
|
|
175
224
|
export interface StaggerPosition extends Required<PlassAnimateStaggerProps> {
|
|
176
225
|
index: number;
|
|
177
226
|
count: number;
|
|
@@ -211,7 +260,13 @@ export declare function staggerSlots(slots: AnimationSlotOptions, { index, count
|
|
|
211
260
|
* `<span>`. It is the only case that gets a wrapper.
|
|
212
261
|
*/
|
|
213
262
|
export declare function animateChildren(children: React.ReactNode, className: string, slotsFor: (index: number, count: number) => React.CSSProperties): React.ReactNode[];
|
|
214
|
-
|
|
263
|
+
/**
|
|
264
|
+
* `endless` is left out because it is worked out here, from `repeat`, and
|
|
265
|
+
* `target` because a keyframe has nothing to arrive at but its last frame.
|
|
266
|
+
* `moves` is only needed for a keyframe of the component's own: the named ones
|
|
267
|
+
* are already known.
|
|
268
|
+
*/
|
|
269
|
+
export interface AnimateElementParams extends AnimationSlotOptions, Omit<AnimationRunOptions, 'endless' | 'target'>, PlassAnimateStaggerProps {
|
|
215
270
|
/** Which keyframe. `null` for the components that write their own. */
|
|
216
271
|
effect: PlassAnimation | null;
|
|
217
272
|
/** `transform-origin`, for the two effects that turn about a point. */
|
package/dist/internal/animate.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{
|
|
1
|
+
import*as e from"react";import{prefersReducedMotion as t,reducedMotionQuery as n,useMediaQuery as r}from"./media.js";import{cx as o}from"./styles.js";export const animationClasses={fade:"plass-anim-fade",grow:"plass-anim-scale",slide:"plass-anim-slide",zoom:"plass-anim-scale",rotate:"plass-anim-rotate",blink:"plass-anim-blink",reveal:"plass-anim-reveal"};export const animBaseClass="plass-anim";const i=/* @__PURE__ */new Set(["grow","slide","zoom","rotate"]);export function lengthValue(e){return"number"==typeof e?`${e}px`:e}export function repeatValue(e){return"infinite"===e?"infinite":String(e)}export function isInfinite(e){return"infinite"===e}export function directionValue(e,t){return"out"===e?t?"alternate-reverse":"reverse":t?"alternate":"normal"}export const defaultViewRange="entry 0% cover 45%";export function animationSlots(e){const t={"--p-anim-duration":`${e.duration}ms`,"--p-anim-delay":`${e.delay}ms`,"--p-anim-repeat":repeatValue(e.repeat),"--p-anim-direction":directionValue(e.mode??"in",e.alternate)};return isInfinite(e.repeat)&&(t["--p-anim-still-repeat"]="1"),e.easing&&(t["--p-anim-ease"]=e.easing),"view"===e.timeline&&(t["--p-anim-timeline"]="view()",t["--p-anim-range"]=e.range??defaultViewRange),void 0!==e.opacity&&(t["--p-anim-opacity"]=String(e.opacity)),void 0!==e.scale&&(t["--p-anim-scale"]=String(e.scale)),void 0!==e.x&&(t["--p-anim-x"]=e.x),void 0!==e.y&&(t["--p-anim-y"]=e.y),void 0!==e.angle&&(t["--p-anim-angle"]=e.angle),void 0!==e.angleTo&&(t["--p-anim-angle-to"]=e.angleTo),void 0!==e.clip&&(t["--p-anim-clip"]=e.clip),t}export function revealClip(e){switch(e){case"top":return"inset(0 0 100% 0)";case"bottom":return"inset(100% 0 0 0)";case"right":return"inset(0 0 0 100%)";default:return"inset(0 100% 0 0)"}}export function slideOffsets(e,t){const n=lengthValue(t),r="number"==typeof t?-t+"px":`calc(-1 * ${n})`;switch(e){case"top":return{x:"0px",y:r};case"bottom":return{x:"0px",y:n};case"left":return{x:r,y:"0px"};default:return{x:n,y:"0px"}}}function viewportRect(){const e=document.documentElement;return new DOMRect(0,0,e.clientWidth,e.clientHeight)}const a=["translate","scale","rotate"];function holds(e,t){return null!==e&&t instanceof Node&&e.contains(t)}const s=".plass-anim, .plass-marquee-track";function ownsPart(e,t){return t.closest("[data-plass-animation]")===e}function ownParts(e){const t=[e];for(const n of e.querySelectorAll(s))ownsPart(e,n)&&t.push(n);return t}function ownTarget(e,t){const n=t.target;return t.animationName.startsWith("plass-anim-")&&(n instanceof HTMLElement||n instanceof SVGElement)&&(n===e||n.matches(s)&&ownsPart(e,n))?n:null}const u=new Map;let c=null;function reportAway(e){for(const t of e){const e=t.boundingClientRect,n=!t.isIntersecting&&e.width*e.height>0;for(const e of u.get(t.target)??[])e(n)}}export function useOffScreen(t,n,r=!1){const[o,i]=e.useState(!1);return e.useEffect(()=>{const e=r?t.current?.parentElement:t.current;if(!n||!e||"undefined"==typeof IntersectionObserver)return;const o=function watchAway(e,t){c??=new IntersectionObserver(reportAway);let n=u.get(e);return n?c.unobserve(e):(n=new Set,u.set(e,n)),n.add(t),c.observe(e),()=>{n.delete(t),0===n.size&&(u.delete(e),c?.unobserve(e))}}(e,i);return()=>{o(),i(!1)}},[t,n,r]),n&&o}const l="data-plass-rewind",m="data-plass-landed",f="data-plass-held",p="--p-anim-run-delay";export function useAnimationRun({trigger:o,play:i,once:s,threshold:u,paused:c,infinite:d,endless:g=!1,moves:y=!1,nonce:h,target:v}){const w=e.useRef(null),[{started:b,run:x},E]=e.useState({started:"mount"===o,run:0}),S=e.useCallback(e=>{E(t=>t.started===e?t:{...t,started:e})},[]),P=e.useCallback(()=>{E(e=>({started:!0,run:e.run+1}))},[]),R=e.useCallback(()=>{E(e=>e.started?{started:!0,run:e.run+1}:e)},[]);e.useLayoutEffect(()=>{const e=w.current;if(!e||0===x)return;const t=ownParts(e);e.setAttribute(l,"");for(const e of t)e.removeAttribute(m),e.removeAttribute(f),e.style.removeProperty(p),e.style.animationName="none";e.offsetWidth;for(const e of t)e.style.animationName="";e.removeAttribute(l)},[x]);const A=e.useRef(null),C=e.useRef(d);e.useLayoutEffect(()=>{C.current&&!d&&(A.current=function timelineNow(){return Number(document.timeline.currentTime??performance.now())}()),C.current=d},[d]),e.useLayoutEffect(()=>{const e=w.current;if(!e)return;const hold=t=>{const n=ownTarget(e,t);if(!n||""!==n.style.getPropertyValue(p))return;const r=(n.style.getPropertyValue("--p-anim-delay")||getComputedStyle(n).getPropertyValue("--p-anim-delay")).trim();""!==r&&n.style.setProperty(p,r)},land=n=>{const r=ownTarget(e,n);if(!r||!t())return;const o=getComputedStyle(r);"infinite"===o.getPropertyValue("--p-anim-repeat").trim()||""!==o.getPropertyValue("--p-anim-timeline").trim()||function endedEndless(e,t,n){if(null===n)return!1;const r=e.getAnimations().find(e=>e instanceof CSSAnimation&&e.animationName===t.animationName&&(e.effect?.pseudoElement??"")===(t.pseudoElement||"")),o=r?.startTime;return!(!r?.effect||null==o)&&Number(o)+Number(r.effect.getComputedTiming().endTime??0)<=n}(r,n,A.current)||(n.pseudoElement||r.matches(".plass-marquee-track")?e:r).setAttribute(m,"")};return e.addEventListener("animationstart",hold),e.addEventListener("animationend",land),()=>{e.removeEventListener("animationstart",hold),e.removeEventListener("animationend",land)}},[]);const N=b&&Boolean(c),V=r(N?n:null),O=e.useRef(!1);e.useLayoutEffect(()=>{const e=w.current;if(e)if(N&&V){O.current=!0;for(const t of ownParts(e))t.matches(".plass-anim, .plass-anim-lighting, .plass-marquee")&&""===getComputedStyle(t).getPropertyValue("--p-anim-timeline").trim()&&t.setAttribute(f,"")}else if(!N&&O.current){O.current=!1;for(const t of ownParts(e))t.removeAttribute(f)}},[N,V,x]);const T=e.useRef("mount"!==o);e.useEffect(()=>{T.current=!b},[b]),e.useEffect(()=>{if("visible"!==o)return;const e=w.current;if(!e||"undefined"==typeof IntersectionObserver)return void S(!0);const t=[],n=e.parentElement;let r=n?null:viewportRect(),i=!1;const check=()=>{if(!r)return;const n=function visibleShare(e,t){const n=e.width*e.height;if(n<=0)return 0;const r=Math.min(e.right,t.right)-Math.max(e.left,t.left),o=Math.min(e.bottom,t.bottom)-Math.max(e.top,t.top);return Math.max(0,r)*Math.max(0,o)/n}(function restingRect(e,t){const n=function movedProperties(e){if("function"!=typeof e.getAnimations)return[];const t=new Set;for(const n of e.getAnimations())if(n.effect instanceof KeyframeEffect)for(const e of n.effect.getKeyframes())for(const n of a)n in e&&t.add(n);return[...t]}(e),r=e.style,o=r.animationName,i=n.map(e=>({property:e,value:r.getPropertyValue(e),priority:r.getPropertyPriority(e)}));t&&(r.animationName="none");for(const e of n)r.setProperty(e,"none","important");const s=e.getBoundingClientRect();for(const{property:e,value:t,priority:n}of i)t?r.setProperty(e,t,n):r.removeProperty(e);return t&&(r.animationName=o),s}(e,T.current),r);if(n>0&&n>=u)if(s){P();for(const e of t)e.disconnect()}else i||(i=!0,P());else s||(i=!1,S(!1))},c=function measureSteps(e){const t=Array.from({length:21},(e,t)=>t/20);return e>0&&e<1?[...t,e]:t}(u);if(n){const e=new IntersectionObserver(([e])=>{r=function clipRect(e){const t=e.boundingClientRect;return t.width*t.height>0?e.intersectionRect:e.rootBounds??viewportRect()}(e),check()},{threshold:c});t.push(e),e.observe(n)}const l=new IntersectionObserver(check,{threshold:c});return t.push(l),l.observe(e),()=>{for(const e of t)e.disconnect()}},[o,s,u,P,S]);const L=e.useRef(h);e.useEffect(()=>{Object.is(h,L.current)||(L.current=h,P())},[h,P]),e.useEffect(()=>{"manual"===o&&(i?P():S(!1))},[o,i,P,S]);const M=e.useRef(v);e.useEffect(()=>{Object.is(v,M.current)||(M.current=v,R())},[v,R]);const k="hover"===o?{onPointerEnter:P,onFocus:e=>{holds(w.current,e.relatedTarget)||P()},onPointerLeave:()=>{d&&S(!1)},onBlur:e=>{d&&!holds(w.current,e.relatedTarget)&&S(!1)}}:{},I=useOffScreen(w,g&&b&&!c&&!("visible"===o&&!s),y);return{ref:e.useCallback(e=>{w.current=e},[]),state:!b||c||I?"paused":"running",started:b,resting:I,runs:x,handlers:k}}export function staggerSlots(e,{index:t,count:n,stagger:r,durationStep:o,reverse:i}){const a=i?n-1-t:t;return{...e,delay:e.delay+a*r,duration:Math.max(0,e.duration+a*o)}}export function animateChildren(t,n,r){const i=e.Children.toArray(t);return i.map((t,a)=>{const s=r(a,i.length);if(!e.isValidElement(t))return e.createElement("span",{key:a,className:n,style:s},t);const u=t.props;return e.cloneElement(t,{className:o(n,u.className),style:{...s,...u.style}})})}export function useAnimateElement(e){const{effect:t,trigger:n,play:r,once:o,threshold:a,paused:s,infinite:u,nonce:c,stagger:l=0,durationStep:m=0,reverse:f=!1,origin:p,moves:d,children:g,...y}=e,h=0!==l&&null!==t,v=useAnimationRun({trigger:"view"===y.timeline?"mount":n,play:r,once:o,threshold:a,paused:s,infinite:u,endless:isInfinite(y.repeat)&&"view"!==y.timeline,moves:!h&&(d??(null!==t&&i.has(t))),nonce:c}),w=t?`plass-anim ${animationClasses[t]}`:"",b=void 0===p?null:{transformOrigin:p};return{ref:v.ref,className:h?"":w,style:{...b,...h?null:animationSlots(y),"--p-anim-state":v.state},props:{...v.handlers,"data-plass-animation":t??void 0,"data-state":v.state},children:h?animateChildren(g,w,(e,t)=>({...b,...animationSlots(staggerSlots(y,{index:e,count:t,stagger:l,durationStep:m,reverse:f}))})):g}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";export const bottomBarToken="--plass-bottom-navigation-height";const
|
|
1
|
+
"use client";import*as e from"react";import{layoutBox as t}from"./layout-box.js";export const bottomBarToken="--plass-bottom-navigation-height";const o=new Set;let n=null;function publish(){const e=document.documentElement;if(0===o.size)return void e.style.removeProperty(bottomBarToken);let n=0;for(const e of o){const o=e.getBoundingClientRect().height,r=o*t(e,!1).perPixel;n=Math.max(n,Math.abs(r-o)<.01?o:r)}e.style.setProperty(bottomBarToken,`${n}px`)}export function useBottomBarHeight(t,r){e.useLayoutEffect(()=>{const e=t.current;if(r&&e)return o.add(e),"undefined"!=typeof ResizeObserver&&(n??=new ResizeObserver(publish),n.observe(e,{box:"border-box"})),publish(),()=>{o.delete(e),n?.unobserve(e),0===o.size&&(n?.disconnect(),n=null),publish()}},[r,t])}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as o from"react";import{defaultLabels as t,useLabels as n}from"./labels.js";import{PlButton as l}from"../components/button/PlButton.js";import{ChevronIcon as s}from"./icons.js";import{dateFormatter as a}from"./format.js";import{addDays as i,addMonths as c,addYears as d,calendarWeeks as u,compareDay as m,isDayOutside as h,isMonthBeforeYear as p,isMonthOutside as g,isSameDay as f,isSameMonth as b,isValidDate as v,isYearOutside as y,makeDate as x,meridiemLabels as w,monthLabels as D,startOfDay as N,startOfMonth as S,today as C,weekdayLabels as k,withTime as M,YEAR_PAGE_SIZE as P,yearPageStart as z}from"./date.js";import{controlHeightClasses as A,controlTextClasses as $,cx as Y,forcedFillClasses as j,gapClasses as B,metaTextClasses as E,srOnlyClasses as F,transitionClasses as I}from"./styles.js";export const defaultPickerLabels=t;export function usePickerLabels(e){const r=n();return o.useMemo(()=>e?{...r,...e}:r,[r,e])}const H={year:0,month:1,day:2},T={xs:"1.5rem",sm:"2rem",md:"2.5rem",lg:"3rem",xl:"3.5rem"},R={xs:"rounded-(--plass-radius-xs)",sm:"rounded-(--plass-radius-xs)",md:"rounded-(--plass-radius-sm)",lg:"rounded-(--plass-radius-md)",xl:"rounded-(--plass-radius-lg)"},K={xs:"rounded-s-(--plass-radius-xs)",sm:"rounded-s-(--plass-radius-xs)",md:"rounded-s-(--plass-radius-sm)",lg:"rounded-s-(--plass-radius-md)",xl:"rounded-s-(--plass-radius-lg)"},O={xs:"rounded-e-(--plass-radius-xs)",sm:"rounded-e-(--plass-radius-xs)",md:"rounded-e-(--plass-radius-sm)",lg:"rounded-e-(--plass-radius-md)",xl:"rounded-e-(--plass-radius-lg)"},G=/* @__PURE__ */["relative flex items-center justify-center tabular-nums select-none","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]","plass-fill",I,"focus-visible:z-10 focus-visible:[outline:2px_solid_var(--p-ring)]","focus-visible:[outline-offset:-2px]"].join(" ");function Cell({children:o,label:t,selected:n,inRange:l=!1,rangeEdge:s=null,current:a=!1,muted:i=!1,disabled:c=!1,focused:d=!1,size:u,className:m,onClick:h,onPointerEnter:p,onKeyDown:g}){return r("button",{type:"button",role:"gridcell","aria-label":t,"aria-selected":n,"aria-current":a?"date":void 0,"aria-disabled":c||void 0,tabIndex:d?0:-1,"data-focus-target":d?"true":void 0,className:Y(G,"start"===s?K[u]:"end"===s?O[u]:"middle"===s?"rounded-none":R[u],c?"cursor-not-allowed text-(--plass-muted-fg) opacity-50":n?`cursor-pointer font-semibold text-(--p-on-solid) [--p-fill-on:1] hover:brightness-105 active:brightness-95 ${j}`:l?"cursor-pointer bg-(--p-soft) text-(--plass-fg) hover:bg-(--p-soft-hover) active:bg-(--p-soft-press) forced-colors:border-y forced-colors:[border-color:Highlight]":a?"cursor-pointer font-semibold text-(--p-accent) hover:bg-(--p-soft) active:bg-(--p-soft-hover)":i?"cursor-pointer text-(--plass-muted-fg) hover:bg-(--p-soft) active:bg-(--p-soft-hover)":"cursor-pointer text-(--plass-fg) hover:bg-(--p-soft) active:bg-(--p-soft-hover)",m),onClick:()=>{c||h()},onPointerEnter:p,onKeyDown:g,children:[o,a?e("span",{"aria-hidden":"true",className:Y("absolute bottom-[0.18em] size-[0.22em] rounded-full bg-current",n?"forced-colors:[background-color:HighlightText]":"forced-colors:[background-color:CanvasText]")}):null]})}function headingIds(e,r,o){return"year"===r?`${e}-range`:"month"===r?`${e}-year`:p(o)?`${e}-month ${e}-year`:`${e}-year ${e}-month`}function Header({size:t,color:n,view:a,precision:i,month:c,locale:d,labels:u,showPreviousButton:m,showNextButton:h,onStep:g,onViewChange:f,id:b}){const v=D(d,"long")[c.getMonth()],y=String(c.getFullYear()),x=p(d),w="day"===a?[u.previousMonth,u.nextMonth]:"month"===a?[u.previousYear,u.nextYear]:[u.previousYears,u.nextYears],stepper=(r,o)=>o?e(l,{variant:"ghost",size:t,color:n,density:"compact","aria-label":w[-1===r?0:1],onClick:()=>g(r),startIcon:e("span",{className:Y("flex items-center",-1===r?"rotate-90 rtl:-rotate-90":"-rotate-90 rtl:rotate-90"),children:e(s,{})})}):e("span",{"aria-hidden":"true",className:Y(A[t],"w-(--p-cell)")}),disclosure=r=>e("span",{className:Y("flex items-center text-(--plass-muted-fg)","[transition:rotate_var(--plass-duration)_var(--plass-ease)]","motion-reduce:[transition-duration:0ms]",r&&"rotate-180"),children:e(s,{})}),N=e(l,{id:`${b}-month`,variant:"ghost",size:t,color:n,density:"compact","aria-describedby":`${b}-month-hint`,"aria-expanded":"month"===a,onClick:()=>f("month"===a?i:"month"),endIcon:disclosure("month"===a),children:v},"month"),S=e(l,{id:`${b}-year`,variant:"ghost",size:t,color:n,density:"compact",className:"tabular-nums","aria-describedby":`${b}-year-hint`,"aria-expanded":"year"===a,onClick:()=>f("year"===a?i:"year"),endIcon:disclosure("year"===a),children:y},"year"),C=z(c.getFullYear());return r("div",{className:"flex items-center justify-between gap-1",children:[stepper(-1,m),e("div",{className:Y("flex min-w-0 flex-1 items-center justify-center",B[t]),children:"year"===a?e("span",{id:`${b}-range`,className:Y("flex items-center font-semibold tabular-nums text-(--plass-fg)",A[t],$[t]),children:`${C}–${C+P-1}`}):"month"===a?S:r(o.Fragment,x?{children:[N,S]}:{children:[S,N]})}),stepper(1,h),e("span",{id:`${b}-month-hint`,hidden:!0,children:u.chooseMonth}),e("span",{id:`${b}-year-hint`,hidden:!0,children:u.chooseYear})]})}export function Calendar({size:t,color:n,locale:l,weekStartsOn:s,month:a,onMonthChange:i,precision:u="day",selected:m,rangeStart:p=null,rangeEnd:g=null,onSelect:f,onPreviewChange:y,minDate:w,maxDate:D,shouldDisableDate:k,showOutsideDays:M=!0,autoFocus:z=!1,showPreviousButton:A=!0,showNextButton:$=!0,labels:j,className:E}){const F=o.useId(),[I,R]=o.useState(u),K=H[I]>H[u]?u:I,O=o.useMemo(()=>m.filter(v),[m]),[G,L]=o.useState(()=>{const e=O.find(e=>b(e,a));return e?N(e):b(C(),a)?C():S(a)}),U=o.useRef(z),q=o.useRef(null);o.useEffect(()=>{L(e=>b(e,a)?e:S(a))},[a]),o.useLayoutEffect(()=>{U.current&&(U.current=!1,q.current?.querySelector('[data-focus-target="true"]')?.focus({preventScroll:!0}))});const _=o.useCallback(e=>h(e,w,D)||(k?.(e)??!1),[w,D,k]),changeView=e=>{U.current=!0,R(e)},moveCursor=e=>{U.current=!0,i(e)};return r("div",{ref:q,className:Y("flex flex-col",B[t],E),style:{"--p-cell":T[t]},onPointerLeave:()=>y?.(null),children:[e(Header,{size:t,color:n,view:K,precision:u,month:a,locale:l,labels:j,showPreviousButton:A,showNextButton:$,onStep:e=>{i("day"===K?c(a,e):d(a,"month"===K?e:e*P))},onViewChange:changeView,id:F}),e("div",{className:"h-[calc(var(--p-cell)*7)] w-[calc(var(--p-cell)*7)]",children:"day"===K?e(DayGrid,{labelledBy:headingIds(F,K,l),size:t,locale:l,weekStartsOn:s,month:a,chosen:O,rangeStart:p,rangeEnd:g,focusedDate:G,showOutsideDays:M,isDisabled:_,onSelect:e=>{L(e),f(e)},onPreviewChange:y,onMoveFocus:e=>{U.current=!0,L(e),b(e,a)||i(S(e))}}):"month"===K?e(MonthGrid,{labelledBy:headingIds(F,K,l),size:t,locale:l,month:a,chosen:O,minDate:w,maxDate:D,onMoveCursor:moveCursor,onPick:e=>{const r=x(a.getFullYear(),e,1);i(r),"month"===u?f(r):changeView("day")}}):e(YearGrid,{labelledBy:headingIds(F,K,l),size:t,month:a,chosen:O,minDate:w,maxDate:D,onMoveCursor:moveCursor,onPick:e=>{const r=x(e,"year"===u?0:a.getMonth(),1);i(r),"year"===u?f(r):changeView("month")}})})]})}function DayGrid({labelledBy:o,size:t,locale:n,weekStartsOn:l,month:s,chosen:d,rangeStart:h,rangeEnd:p,focusedDate:g,showOutsideDays:y,isDisabled:x,onSelect:w,onPreviewChange:D,onMoveFocus:N}){const S=u(s,l),M=k(n,l,"short"),P=k(n,l,"long"),z=a(n,{dateStyle:"full"}),A=function orderedRange(e,r){return v(e)&&v(r)?m(e,r)<=0?[e,r]:[r,e]:null}(h,p),j=C();return r("div",{role:"grid","aria-labelledby":o,className:"flex h-full flex-col",children:[e("div",{role:"row",className:"grid grid-cols-7",children:M.map((r,o)=>e("span",{role:"columnheader","aria-label":P[o],className:Y("flex h-(--p-cell) items-center justify-center font-semibold text-(--plass-muted-fg) select-none",E[t]),children:r},o))}),S.map((r,o)=>e("div",{role:"row",className:"grid grid-cols-7",children:r.map(r=>{const o=!b(r,s);if(o&&!y)return e("span",{role:"gridcell","aria-hidden":"true",className:"size-(--p-cell)"},r.getTime());const n=d.some(e=>f(e,r)),a=null!==A&&m(r,A[0])>=0&&m(r,A[1])<=0,u=null!==A&&a&&f(r,A[0]),h=null!==A&&a&&f(r,A[1]);return e(Cell,{size:t,label:z.format(r),selected:n,inRange:a&&!n,rangeEdge:a?u&&h?"both":u?"start":h?"end":"middle":null,current:f(r,j)&&!n,muted:o,disabled:x(r),focused:f(r,g),className:Y("size-(--p-cell)",$[t]),onClick:()=>w(r),onPointerEnter:()=>D?.(r),onKeyDown:e=>((e,r)=>{const o=(r.getDay()-l+7)%7,t={ArrowLeft:()=>i(r,-1),ArrowRight:()=>i(r,1),ArrowUp:()=>i(r,-7),ArrowDown:()=>i(r,7),Home:()=>i(r,-o),End:()=>i(r,6-o),PageUp:()=>c(r,e.shiftKey?-12:-1),PageDown:()=>c(r,e.shiftKey?12:1)}[e.key];t&&(e.preventDefault(),N(t()))})(e,r),children:r.getDate()},r.getTime())})},o))]})}function MonthGrid({labelledBy:r,size:o,locale:t,month:n,chosen:l,minDate:s,maxDate:a,onMoveCursor:i,onPick:d}){const u=D(t,"short"),m=D(t,"long"),h=n.getFullYear(),p=new Date,onKeyDown=e=>{const r={ArrowLeft:-1,ArrowRight:1,ArrowUp:-3,ArrowDown:3,PageUp:-12,PageDown:12}[e.key];void 0!==r&&(e.preventDefault(),i(c(S(n),r)))};return e("div",{role:"grid","aria-labelledby":r,className:"flex h-full flex-col justify-evenly",children:[0,1,2,3].map(r=>e("div",{role:"row",className:"grid grid-cols-3 gap-1",children:[0,1,2].map(t=>{const i=3*r+t;return e(Cell,{size:o,label:`${m[i]} ${h}`,selected:l.some(e=>e.getFullYear()===h&&e.getMonth()===i),current:p.getFullYear()===h&&p.getMonth()===i,disabled:g(x(h,i,1),s,a),focused:i===n.getMonth(),className:Y("h-(--p-cell) w-full",$[o]),onClick:()=>d(i),onKeyDown,children:u[i]},i)})},r))})}function YearGrid({labelledBy:r,size:o,month:t,chosen:n,minDate:l,maxDate:s,onMoveCursor:a,onPick:i}){const c=z(t.getFullYear()),u=(new Date).getFullYear(),onKeyDown=e=>{const r={ArrowLeft:-1,ArrowRight:1,ArrowUp:-4,ArrowDown:4,PageUp:-P,PageDown:P}[e.key];void 0!==r&&(e.preventDefault(),a(d(S(t),r)))};return e("div",{role:"grid","aria-labelledby":r,className:"flex h-full flex-col justify-evenly",children:[0,1,2].map(r=>e("div",{role:"row",className:"grid grid-cols-4 gap-1",children:[0,1,2,3].map(a=>{const d=c+4*r+a;return e(Cell,{size:o,label:String(d),selected:n.some(e=>e.getFullYear()===d),current:d===u,disabled:y(x(d,0,1),l,s),focused:d===t.getFullYear(),className:Y("h-(--p-cell) w-full",$[o]),onClick:()=>i(d),onKeyDown,children:d},d)})},r))})}function revealInColumn(e){const r=e.parentElement;if(!r)return;const o=e.getBoundingClientRect(),t=r.getBoundingClientRect(),n=o.top-t.top-r.clientTop+r.scrollTop,l=n+o.height;n<r.scrollTop?r.scrollTop=n:l>r.scrollTop+r.clientHeight&&(r.scrollTop=l-r.clientHeight)}export function TimeGrid({size:t,density:n,locale:l,value:s,referenceDate:i,onChange:c,hour12:d,showSeconds:u,hourStep:m,minuteStep:h,secondStep:p,shouldDisableTime:g,autoFocus:f=!1,labels:b,className:v}){const y=s??i,x=o.useRef(null),[D,N]=o.useMemo(()=>w(l),[l]);o.useEffect(()=>{const e=x.current;if(e?.querySelectorAll('[data-chosen="true"]').forEach(revealInColumn),f){const r=e?.querySelector('[role="listbox"]');(r?.querySelector('[data-chosen="true"]')??r?.querySelector('[role="option"]'))?.focus({preventScroll:!0})}},[f]);const S=o.useMemo(()=>{const e=Math.ceil((d?12:24)/m),r=Array.from({length:e},(e,r)=>r*m);return d?r.map(e=>0===e?12:e):r},[d,m]),C=o.useMemo(()=>Array.from({length:Math.ceil(60/h)},(e,r)=>r*h),[h]),k=o.useMemo(()=>Array.from({length:Math.ceil(60/p)},(e,r)=>r*p),[p]),candidate=(e,r)=>M(y,"hour"===e?{hours:d?r%12+(y.getHours()>=12?12:0):r}:"minute"===e?{minutes:r}:"second"===e?{seconds:r}:{hours:y.getHours()%12+12*r}),pad=e=>String(e).padStart(2,"0"),P=d?y.getHours()%12||12:y.getHours(),column=(r,o,n,l,a)=>{const i=n.map(e=>g?.(candidate(r,e),r)??!1),d=null===s?-1:n.findIndex(l),u=d>=0?d:Math.max(0,i.indexOf(!1)),nearest=(e,r)=>{for(let o=e;o>=0&&o<n.length;o+=r)if(!i[o])return o;return-1};return e("div",{role:"listbox","aria-label":o,onKeyDown:e=>{const o=[...e.currentTarget.querySelectorAll('[role="option"]')],t=o.indexOf(e.target);if(t<0)return;const l="ArrowDown"===e.key?nearest(t+1,1):"ArrowUp"===e.key?nearest(t-1,-1):"Home"===e.key?nearest(0,1):"End"===e.key?nearest(n.length-1,-1):null;null!==l&&(e.preventDefault(),l<0||l===t||(c(candidate(r,n[l])),o[l].focus({preventScroll:!0}),revealInColumn(o[l])))},className:Y("flex flex-col gap-0.5 overflow-y-auto overscroll-contain","h-[calc(var(--p-cell)*7)] w-[calc(var(--p-cell)*1.75)]","scroll-py-0.5 [scrollbar-width:thin]"),children:n.map((o,n)=>{const d=candidate(r,o),m=null!==s&&l(o),h=i[n];return e("button",{type:"button",role:"option",tabIndex:n===u?0:-1,"aria-selected":m,"aria-disabled":h||void 0,"data-chosen":m?"true":void 0,className:Y(G,R[t],A[t],$[t],"w-full shrink-0",h?"cursor-not-allowed text-(--plass-muted-fg) opacity-50":m?`cursor-pointer font-semibold text-(--p-on-solid) [--p-fill-on:1] hover:brightness-105 active:brightness-95 ${j}`:"cursor-pointer text-(--plass-fg) hover:bg-(--p-soft) active:bg-(--p-soft-hover)"),onClick:()=>{h||c(d)},children:a(o)},o)})},r)};return r("div",{ref:x,className:Y("flex","compact"===n?"gap-0.5":"gap-1",v),style:{"--p-cell":T[t]},children:[column("hour",b.hour,S,e=>e===P,e=>d?String(e):pad(e)),column("minute",b.minute,C,e=>e===y.getMinutes(),pad),u?column("second",b.second,k,e=>e===y.getSeconds(),pad):null,d?column("meridiem",b.meridiem,[0,1],e=>(y.getHours()>=12?1:0)===e,e=>0===e?D:N):null,e("span",{className:F,"aria-live":"polite",children:null===s?"":a(l,{hour:"numeric",minute:"2-digit",...u?{second:"2-digit"}:{}}).format(s)})]})}
|
|
1
|
+
import{jsx as e,jsxs as o}from"react/jsx-runtime";import*as r from"react";import{defaultLabels as t,useLabels as n}from"./labels.js";import{PlButton as l}from"../components/button/PlButton.js";import{ChevronIcon as s}from"./icons.js";import{useRuntimeTimeZone as a}from"./defaults.js";import{dateFormatter as i}from"./format.js";import{layoutBox as c}from"./layout-box.js";import{addDays as d,addMonths as u,addYears as m,calendarWeeks as h,compareDay as p,isDayOutside as g,isMonthBeforeYear as f,isMonthOutside as v,isSameDay as b,isSameMonth as y,isValidDate as x,isYearOutside as w,makeDate as D,meridiemLabels as N,monthLabels as S,startOfDay as C,startOfMonth as k,today as M,todayIn as P,weekdayLabels as z,withTime as A,YEAR_PAGE_SIZE as $,yearPageStart as j}from"./date.js";import{controlHeightClasses as Y,controlTextClasses as E,cx as B,forcedFillClasses as F,gapClasses as I,metaTextClasses as H,srOnlyClasses as T,transitionClasses as R}from"./styles.js";export const defaultPickerLabels=t;export function usePickerLabels(e){const o=n();return r.useMemo(()=>e?{...o,...e}:o,[o,e])}const K={year:0,month:1,day:2},O={xs:"1.5rem",sm:"2rem",md:"2.5rem",lg:"3rem",xl:"3.5rem"},G={xs:"rounded-(--plass-radius-xs)",sm:"rounded-(--plass-radius-xs)",md:"rounded-(--plass-radius-sm)",lg:"rounded-(--plass-radius-md)",xl:"rounded-(--plass-radius-lg)"},L={xs:"rounded-s-(--plass-radius-xs)",sm:"rounded-s-(--plass-radius-xs)",md:"rounded-s-(--plass-radius-sm)",lg:"rounded-s-(--plass-radius-md)",xl:"rounded-s-(--plass-radius-lg)"},U={xs:"rounded-e-(--plass-radius-xs)",sm:"rounded-e-(--plass-radius-xs)",md:"rounded-e-(--plass-radius-sm)",lg:"rounded-e-(--plass-radius-md)",xl:"rounded-e-(--plass-radius-lg)"},q=/* @__PURE__ */["relative flex items-center justify-center p-0 tabular-nums select-none","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]","plass-fill",R,"focus-visible:z-10 focus-visible:[outline:2px_solid_var(--p-ring)]","focus-visible:[outline-offset:-2px]"].join(" ");function Cell({children:r,label:t,selected:n,inRange:l=!1,rangeEdge:s=null,current:a=!1,muted:i=!1,disabled:c=!1,focused:d=!1,size:u,className:m,onClick:h,onPointerEnter:p,onKeyDown:g}){return o("button",{type:"button",role:"gridcell","aria-label":t,"aria-selected":n,"aria-current":a?"date":void 0,"aria-disabled":c||void 0,tabIndex:d?0:-1,"data-focus-target":d?"true":void 0,className:B(q,"start"===s?L[u]:"end"===s?U[u]:"middle"===s?"rounded-none":G[u],c?"cursor-not-allowed text-(--plass-muted-fg) opacity-50":n?`cursor-pointer font-semibold text-(--p-on-solid) [--p-fill-on:1] hover:brightness-105 active:brightness-95 ${F}`:l?"cursor-pointer bg-(--p-soft) text-(--plass-fg) hover:bg-(--p-soft-hover) active:bg-(--p-soft-press) forced-colors:border-y forced-colors:[border-color:Highlight]":a?"cursor-pointer font-semibold text-(--p-accent) hover:bg-(--p-soft) active:bg-(--p-soft-hover)":i?"cursor-pointer text-(--plass-muted-fg) hover:bg-(--p-soft) active:bg-(--p-soft-hover)":"cursor-pointer text-(--plass-fg) hover:bg-(--p-soft) active:bg-(--p-soft-hover)",m),onClick:()=>{c||h()},onPointerEnter:p,onKeyDown:g,children:[r,a?e("span",{"aria-hidden":"true",className:B("absolute bottom-[0.18em] size-[0.22em] rounded-full bg-current",n?"forced-colors:[background-color:HighlightText]":"forced-colors:[background-color:CanvasText]")}):null]})}function headingIds(e,o,r){return"year"===o?`${e}-range`:"month"===o?`${e}-year`:f(r)?`${e}-month ${e}-year`:`${e}-year ${e}-month`}function Header({size:t,color:n,view:a,precision:i,month:c,locale:d,labels:u,showPreviousButton:m,showNextButton:h,onStep:p,onViewChange:g,id:v}){const b=S(d,"long")[c.getMonth()],y=String(c.getFullYear()),x=f(d),w="day"===a?[u.previousMonth,u.nextMonth]:"month"===a?[u.previousYear,u.nextYear]:[u.previousYears,u.nextYears],stepper=(o,r)=>r?e(l,{variant:"ghost",size:t,color:n,density:"compact","aria-label":w[-1===o?0:1],onClick:()=>p(o),startIcon:e("span",{className:B("flex items-center",-1===o?"rotate-90 rtl:-rotate-90":"-rotate-90 rtl:rotate-90"),children:e(s,{})})}):e("span",{"aria-hidden":"true",className:B(Y[t],"w-(--p-cell)")}),disclosure=o=>e("span",{className:B("flex items-center text-(--plass-muted-fg)","[transition:rotate_var(--plass-duration)_var(--plass-ease)]","motion-reduce:[transition-duration:0ms]",o&&"rotate-180"),children:e(s,{})}),D=e(l,{id:`${v}-month`,variant:"ghost",size:t,color:n,density:"compact","aria-describedby":`${v}-month-hint`,"aria-expanded":"month"===a,onClick:()=>g("month"===a?i:"month"),endIcon:disclosure("month"===a),children:b},"month"),N=e(l,{id:`${v}-year`,variant:"ghost",size:t,color:n,density:"compact",className:"tabular-nums","aria-describedby":`${v}-year-hint`,"aria-expanded":"year"===a,onClick:()=>g("year"===a?i:"year"),endIcon:disclosure("year"===a),children:y},"year"),C=j(c.getFullYear());return o("div",{className:"flex items-center justify-between gap-1",children:[stepper(-1,m),e("div",{className:B("flex min-w-0 flex-1 items-center justify-center",I[t]),children:"year"===a?e("span",{id:`${v}-range`,className:B("flex items-center font-semibold tabular-nums text-(--plass-fg)",Y[t],E[t]),children:`${C}–${C+$-1}`}):"month"===a?N:o(r.Fragment,x?{children:[D,N]}:{children:[N,D]})}),stepper(1,h),e("span",{id:`${v}-month-hint`,hidden:!0,children:u.chooseMonth}),e("span",{id:`${v}-year-hint`,hidden:!0,children:u.chooseYear})]})}export function Calendar({size:t,color:n,locale:l,weekStartsOn:s,month:i,onMonthChange:c,precision:d="day",selected:h,rangeStart:p=null,rangeEnd:f=null,onSelect:v,onPreviewChange:w,minDate:N,maxDate:S,shouldDisableDate:z,showOutsideDays:A=!0,autoFocus:j=!1,showPreviousButton:Y=!0,showNextButton:E=!0,labels:F,className:H}){const T=r.useId(),[R,G]=r.useState(d),L=K[R]>K[d]?d:R,U=r.useMemo(()=>h.filter(x),[h]),q=a(),_=P(q),[V,J]=r.useState(()=>{const e=U.find(e=>y(e,i));return e?C(e):y(_,i)?_:k(i)}),Q=r.useRef(void 0===q||U.some(e=>y(e,i))?null:_);r.useEffect(()=>{const e=Q.current;if(void 0!==q||null===e)return;Q.current=null;const o=M();J(r=>b(r,e)&&!b(o,e)&&y(o,i)?o:r)},[q,i]);const W=r.useRef(j),X=r.useRef(null);r.useEffect(()=>{J(e=>y(e,i)?e:k(i))},[i]),r.useLayoutEffect(()=>{W.current&&(W.current=!1,X.current?.querySelector('[data-focus-target="true"]')?.focus({preventScroll:!0}))});const Z=r.useCallback(e=>g(e,N,S)||(z?.(e)??!1),[N,S,z]),changeView=e=>{W.current=!0,G(e)},moveCursor=e=>{W.current=!0,c(e)};return o("div",{ref:X,className:B("flex flex-col",I[t],H),style:{"--p-cell":O[t]},onPointerLeave:()=>w?.(null),children:[e(Header,{size:t,color:n,view:L,precision:d,month:i,locale:l,labels:F,showPreviousButton:Y,showNextButton:E,onStep:e=>{c("day"===L?u(i,e):m(i,"month"===L?e:e*$))},onViewChange:changeView,id:T}),e("div",{className:"h-[calc(var(--p-cell)*7)] w-[calc(var(--p-cell)*7)]",children:"day"===L?e(DayGrid,{labelledBy:headingIds(T,L,l),size:t,locale:l,weekStartsOn:s,month:i,chosen:U,rangeStart:p,rangeEnd:f,focusedDate:V,showOutsideDays:A,isDisabled:Z,onSelect:e=>{J(e),v(e)},onPreviewChange:w,onMoveFocus:e=>{W.current=!0,J(e),y(e,i)||c(k(e))}}):"month"===L?e(MonthGrid,{labelledBy:headingIds(T,L,l),size:t,locale:l,month:i,chosen:U,minDate:N,maxDate:S,onMoveCursor:moveCursor,onPick:e=>{const o=D(i.getFullYear(),e,1);c(o),"month"===d?v(o):changeView("day")}}):e(YearGrid,{labelledBy:headingIds(T,L,l),size:t,month:i,chosen:U,minDate:N,maxDate:S,onMoveCursor:moveCursor,onPick:e=>{const o=D(e,"year"===d?0:i.getMonth(),1);c(o),"year"===d?v(o):changeView("month")}})})]})}function DayGrid({labelledBy:r,size:t,locale:n,weekStartsOn:l,month:s,chosen:c,rangeStart:m,rangeEnd:g,focusedDate:f,showOutsideDays:v,isDisabled:w,onSelect:D,onPreviewChange:N,onMoveFocus:S}){const C=h(s,l),k=z(n,l,"short"),M=z(n,l,"long"),A=i(n,{dateStyle:"full"}),$=function orderedRange(e,o){return x(e)&&x(o)?p(e,o)<=0?[e,o]:[o,e]:null}(m,g),j=P(a());return o("div",{role:"grid","aria-labelledby":r,className:"flex h-full flex-col",children:[e("div",{role:"row",className:"grid grid-cols-7",children:k.map((o,r)=>e("span",{role:"columnheader","aria-label":M[r],className:B("flex h-(--p-cell) items-center justify-center font-semibold text-(--plass-muted-fg) select-none",H[t]),children:o},r))}),C.map((o,r)=>e("div",{role:"row",className:"grid grid-cols-7",children:o.map(o=>{const r=!y(o,s);if(r&&!v)return e("span",{role:"gridcell","aria-hidden":"true",className:"size-(--p-cell)"},o.getTime());const n=c.some(e=>b(e,o)),a=null!==$&&p(o,$[0])>=0&&p(o,$[1])<=0,i=null!==$&&a&&b(o,$[0]),m=null!==$&&a&&b(o,$[1]);return e(Cell,{size:t,label:A.format(o),selected:n,inRange:a&&!n,rangeEdge:a?i&&m?"both":i?"start":m?"end":"middle":null,current:b(o,j)&&!n,muted:r,disabled:w(o),focused:b(o,f),className:B("size-(--p-cell)",E[t]),onClick:()=>D(o),onPointerEnter:()=>N?.(o),onKeyDown:e=>((e,o)=>{const r=(o.getDay()-l+7)%7,t={ArrowLeft:()=>d(o,-1),ArrowRight:()=>d(o,1),ArrowUp:()=>d(o,-7),ArrowDown:()=>d(o,7),Home:()=>d(o,-r),End:()=>d(o,6-r),PageUp:()=>u(o,e.shiftKey?-12:-1),PageDown:()=>u(o,e.shiftKey?12:1)}[e.key];t&&(e.preventDefault(),S(t()))})(e,o),children:o.getDate()},o.getTime())})},r))]})}function MonthGrid({labelledBy:o,size:r,locale:t,month:n,chosen:l,minDate:s,maxDate:i,onMoveCursor:c,onPick:d}){const m=S(t,"short"),h=S(t,"long"),p=n.getFullYear(),g=P(a()),onKeyDown=e=>{const o={ArrowLeft:-1,ArrowRight:1,ArrowUp:-3,ArrowDown:3,PageUp:-12,PageDown:12}[e.key];void 0!==o&&(e.preventDefault(),c(u(k(n),o)))};return e("div",{role:"grid","aria-labelledby":o,className:"flex h-full flex-col justify-evenly",children:[0,1,2,3].map(o=>e("div",{role:"row",className:"grid grid-cols-3 gap-1",children:[0,1,2].map(t=>{const a=3*o+t;return e(Cell,{size:r,label:`${h[a]} ${p}`,selected:l.some(e=>e.getFullYear()===p&&e.getMonth()===a),current:g.getFullYear()===p&&g.getMonth()===a,disabled:v(D(p,a,1),s,i),focused:a===n.getMonth(),className:B("h-(--p-cell) w-full",E[r]),onClick:()=>d(a),onKeyDown,children:m[a]},a)})},o))})}function YearGrid({labelledBy:o,size:r,month:t,chosen:n,minDate:l,maxDate:s,onMoveCursor:i,onPick:c}){const d=j(t.getFullYear()),u=P(a()).getFullYear(),onKeyDown=e=>{const o={ArrowLeft:-1,ArrowRight:1,ArrowUp:-4,ArrowDown:4,PageUp:-$,PageDown:$}[e.key];void 0!==o&&(e.preventDefault(),i(m(k(t),o)))};return e("div",{role:"grid","aria-labelledby":o,className:"flex h-full flex-col justify-evenly",children:[0,1,2].map(o=>e("div",{role:"row",className:"grid grid-cols-4 gap-1",children:[0,1,2,3].map(a=>{const i=d+4*o+a;return e(Cell,{size:r,label:String(i),selected:n.some(e=>e.getFullYear()===i),current:i===u,disabled:w(D(i,0,1),l,s),focused:i===t.getFullYear(),className:B("h-(--p-cell) w-full",E[r]),onClick:()=>c(i),onKeyDown,children:i},i)})},o))})}function revealInColumn(e){const o=e.parentElement;if(!o)return;const r=e.getBoundingClientRect(),t=o.getBoundingClientRect(),{perPixel:n}=c(o,!1),l=(r.top-t.top)*n-o.clientTop+o.scrollTop,s=l+r.height*n;l<o.scrollTop?o.scrollTop=l:s>o.scrollTop+o.clientHeight&&(o.scrollTop=s-o.clientHeight)}export function TimeGrid({size:t,density:n,locale:l,value:s,referenceDate:a,onChange:c,hour12:d,showSeconds:u,hourStep:m,minuteStep:h,secondStep:p,shouldDisableTime:g,autoFocus:f=!1,labels:v,className:b}){const y=s??a,x=r.useRef(null),[w,D]=r.useMemo(()=>N(l),[l]);r.useEffect(()=>{const e=x.current;if(e?.querySelectorAll('[data-chosen="true"]').forEach(revealInColumn),f){const o=e?.querySelector('[role="listbox"]');(o?.querySelector('[data-chosen="true"]')??o?.querySelector('[role="option"]'))?.focus({preventScroll:!0})}},[f]);const S=r.useMemo(()=>{const e=Math.ceil((d?12:24)/m),o=Array.from({length:e},(e,o)=>o*m);return d?o.map(e=>0===e?12:e):o},[d,m]),C=r.useMemo(()=>Array.from({length:Math.ceil(60/h)},(e,o)=>o*h),[h]),k=r.useMemo(()=>Array.from({length:Math.ceil(60/p)},(e,o)=>o*p),[p]),candidate=(e,o)=>A(y,"hour"===e?{hours:d?o%12+(y.getHours()>=12?12:0):o}:"minute"===e?{minutes:o}:"second"===e?{seconds:o}:{hours:y.getHours()%12+12*o}),pad=e=>String(e).padStart(2,"0"),M=d?y.getHours()%12||12:y.getHours(),column=(o,r,n,l,a)=>{const i=n.map(e=>g?.(candidate(o,e),o)??!1),d=null===s?-1:n.findIndex(l),u=d>=0?d:Math.max(0,i.indexOf(!1)),nearest=(e,o)=>{for(let r=e;r>=0&&r<n.length;r+=o)if(!i[r])return r;return-1};return e("div",{role:"listbox","aria-label":r,onKeyDown:e=>{const r=[...e.currentTarget.querySelectorAll('[role="option"]')],t=r.indexOf(e.target);if(t<0)return;const l="ArrowDown"===e.key?nearest(t+1,1):"ArrowUp"===e.key?nearest(t-1,-1):"Home"===e.key?nearest(0,1):"End"===e.key?nearest(n.length-1,-1):null;null!==l&&(e.preventDefault(),l<0||l===t||(c(candidate(o,n[l])),r[l].focus({preventScroll:!0}),revealInColumn(r[l])))},className:B("flex flex-col gap-0.5 overflow-y-auto overscroll-contain","h-[calc(var(--p-cell)*7)] w-[calc(var(--p-cell)*1.75)]","scroll-py-0.5 [scrollbar-width:thin]"),children:n.map((r,n)=>{const d=candidate(o,r),m=null!==s&&l(r),h=i[n];return e("button",{type:"button",role:"option",tabIndex:n===u?0:-1,"aria-selected":m,"aria-disabled":h||void 0,"data-chosen":m?"true":void 0,className:B(q,G[t],Y[t],E[t],"w-full shrink-0",h?"cursor-not-allowed text-(--plass-muted-fg) opacity-50":m?`cursor-pointer font-semibold text-(--p-on-solid) [--p-fill-on:1] hover:brightness-105 active:brightness-95 ${F}`:"cursor-pointer text-(--plass-fg) hover:bg-(--p-soft) active:bg-(--p-soft-hover)"),onClick:()=>{h||c(d)},children:a(r)},r)})},o)};return o("div",{ref:x,className:B("flex","compact"===n?"gap-0.5":"gap-1",b),style:{"--p-cell":O[t]},children:[column("hour",v.hour,S,e=>e===M,e=>d?String(e):pad(e)),column("minute",v.minute,C,e=>e===y.getMinutes(),pad),u?column("second",v.second,k,e=>e===y.getSeconds(),pad):null,d?column("meridiem",v.meridiem,[0,1],e=>(y.getHours()>=12?1:0)===e,e=>0===e?w:D):null,e("span",{className:T,"aria-live":"polite",children:null===s?"":i(l,{hour:"numeric",minute:"2-digit",...u?{second:"2-digit"}:{}}).format(s)})]})}
|