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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { PlassDirection } from './direction.js';
|
|
3
|
-
import type { PlassBreakpoint, PlassSide } from '../types.js';
|
|
3
|
+
import type { PlassBreakpoint, PlassPosition, PlassSide } from '../types.js';
|
|
4
4
|
/**
|
|
5
5
|
* The vocabulary a page's structure is written in, and the context the four
|
|
6
6
|
* components that build one share.
|
|
@@ -75,6 +75,12 @@ export interface PlPageLayoutContextValue {
|
|
|
75
75
|
* reliably as one that is not.
|
|
76
76
|
*/
|
|
77
77
|
register: (slot: PlPageLayoutSlot, node: HTMLElement | null) => void;
|
|
78
|
+
/**
|
|
79
|
+
* Measures the registered bars again, for the one change to a bar that
|
|
80
|
+
* neither its ref nor the layout's `ResizeObserver` reports: its `position`,
|
|
81
|
+
* which decides what its height is reserved for. See `useSlotPosition`.
|
|
82
|
+
*/
|
|
83
|
+
remeasure: () => void;
|
|
78
84
|
/** Where the sidebars stop being columns. */
|
|
79
85
|
collapseBelow: PlPageLayoutCollapse;
|
|
80
86
|
/** Whether each sidebar's drawer is open. Only meaningful while it is collapsed. */
|
|
@@ -84,6 +90,16 @@ export interface PlPageLayoutContextValue {
|
|
|
84
90
|
scroll: PlPageLayoutScroll;
|
|
85
91
|
}
|
|
86
92
|
export declare const PlPageLayoutContext: React.Context<PlPageLayoutContextValue>;
|
|
93
|
+
/**
|
|
94
|
+
* Tells the layout around a bar that the bar's `position` changed.
|
|
95
|
+
*
|
|
96
|
+
* A bar that turns from `static` to `fixed` keeps its element, so its ref is
|
|
97
|
+
* not handed over again, and usually its size, so the layout's observer has
|
|
98
|
+
* nothing to report either — and the layout went on reserving nothing for a
|
|
99
|
+
* bar that had left the flow, until something else happened to resize it. Not
|
|
100
|
+
* on the first commit, which the layout measures on its own.
|
|
101
|
+
*/
|
|
102
|
+
export declare function useSlotPosition(position: PlassPosition): void;
|
|
87
103
|
/**
|
|
88
104
|
* Which end of the band the sidebar being rendered right now takes.
|
|
89
105
|
*
|
|
@@ -132,16 +148,11 @@ export declare function useCollapsed(breakpoint: PlPageLayoutCollapse): boolean;
|
|
|
132
148
|
* a tooltip above a button is above it in every writing direction — so the two
|
|
133
149
|
* have to be translated.
|
|
134
150
|
*
|
|
135
|
-
* `direction` is what the nearest `PlassProvider` was
|
|
136
|
-
* reason it wins there
|
|
137
|
-
* that runs the other way from the page, and a drawer
|
|
138
|
-
* subtree, so the document is the one place that
|
|
139
|
-
*
|
|
140
|
-
* provider.
|
|
141
|
-
*
|
|
142
|
-
* The document is read during render rather than in an effect, which is safe
|
|
143
|
-
* here for a narrower reason than it looks: the only caller is a sidebar that
|
|
144
|
-
* has already collapsed, and collapsing is a client-side answer. There is no
|
|
145
|
-
* server render of this to disagree with.
|
|
151
|
+
* `direction` is the caller's to resolve: what the nearest `PlassProvider` was
|
|
152
|
+
* told, which wins for the reason it wins there — a provider given a direction
|
|
153
|
+
* is describing a subtree that runs the other way from the page, and a drawer
|
|
154
|
+
* is portalled out of that subtree, so the document is the one place that
|
|
155
|
+
* cannot say which way it runs — and without one, the document's own
|
|
156
|
+
* direction, as it is for the provider.
|
|
146
157
|
*/
|
|
147
|
-
export declare function drawerSide(side: PlassSidebarSide, direction
|
|
158
|
+
export declare function drawerSide(side: PlassSidebarSide, direction: PlassDirection): PlassSide;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";import{belowQuery as t}from"./breakpoints.js";import{useMediaQuery as n}from"./media.js";export const PlPageLayoutContext=/* @__PURE__ */e.createContext({present:!1,register:()=>{},collapseBelow:"none",open:{start:!1,end:!1},setOpen:()=>{},scroll:"page"});export const PlassSidebarSideContext=/* @__PURE__ */e.createContext(null);export const collapsedOnlyClasses={none:"hidden",xs:"hidden",sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden",xl:"xl:hidden"};export const expandedOnlyClasses={none:"",xs:"",sm:"max-sm:hidden",md:"max-md:hidden",lg:"max-lg:hidden",xl:"max-xl:hidden"};export function useCollapsed(e){return n("none"===e?null:function collapseQuery(e){return"xs"===e?null:t(e)}(e))}export function drawerSide(e,t){const n=
|
|
1
|
+
"use client";import*as e from"react";import{belowQuery as t}from"./breakpoints.js";import{useMediaQuery as n}from"./media.js";export const PlPageLayoutContext=/* @__PURE__ */e.createContext({present:!1,register:()=>{},remeasure:()=>{},collapseBelow:"none",open:{start:!1,end:!1},setOpen:()=>{},scroll:"page"});export function useSlotPosition(t){const{remeasure:n}=e.useContext(PlPageLayoutContext),o=e.useRef(t);e.useLayoutEffect(()=>{o.current!==t&&(o.current=t,n())},[t,n])}export const PlassSidebarSideContext=/* @__PURE__ */e.createContext(null);export const collapsedOnlyClasses={none:"hidden",xs:"hidden",sm:"sm:hidden",md:"md:hidden",lg:"lg:hidden",xl:"xl:hidden"};export const expandedOnlyClasses={none:"",xs:"",sm:"max-sm:hidden",md:"max-md:hidden",lg:"max-lg:hidden",xl:"max-xl:hidden"};export function useCollapsed(e){return n("none"===e?null:function collapseQuery(e){return"xs"===e?null:t(e)}(e))}export function drawerSide(e,t){const n="rtl"===t;return"start"===e?n?"right":"left":n?"left":"right"}
|
|
@@ -31,6 +31,9 @@ import type { PlassColor, PlassElevation, PlassFieldClassNames, PlassFieldLabelP
|
|
|
31
31
|
* filled token in the library that has to be found without being read, which is
|
|
32
32
|
* the day you picked. So the sheet stays clear glass and the family arrives in
|
|
33
33
|
* the two fill slots the chosen cell reads.
|
|
34
|
+
*
|
|
35
|
+
* A `PlCalendar` is the same sheet set on the page instead of in a popup, and
|
|
36
|
+
* takes the same slots for the same reason.
|
|
34
37
|
*/
|
|
35
38
|
export declare function popupSlots(color: PlassColor, elevation: PlassElevation): React.CSSProperties;
|
|
36
39
|
/**
|
|
@@ -87,7 +90,10 @@ export interface PlassPickerShellProps extends PlassStyleProps, Omit<React.Compo
|
|
|
87
90
|
/** The name of what the control holds. */
|
|
88
91
|
label?: React.ReactNode;
|
|
89
92
|
/**
|
|
90
|
-
* Where the `label` goes — above the trigger,
|
|
93
|
+
* Where the `label` goes — above the trigger, in its top edge, or inside it
|
|
94
|
+
* where the value would be written until the trigger is focused, open or
|
|
95
|
+
* holds a value. A trigger that draws a glyph at its start keeps a `float`
|
|
96
|
+
* label in the edge, because the glyph is where it would rest.
|
|
91
97
|
* Falls back to the nearest `PlassProvider`, then to `top`.
|
|
92
98
|
* @default 'top'
|
|
93
99
|
*/
|
|
@@ -147,7 +153,7 @@ interface InternalShellProps extends PlassPickerShellProps {
|
|
|
147
153
|
* and the way `invalid` re-points the whole colour family at `danger` so the
|
|
148
154
|
* edge, the ring and the message turn over together.
|
|
149
155
|
*/
|
|
150
|
-
export declare function PickerShell({ variant, size, color, density, elevation, label, labelPlacement: labelPlacementProp, description, error, invalid, startIcon, fullWidth, disabled, readOnly, required, id, className, classNames, style, display, samples, empty, clearable, onClear, open, onOpenChange, labels, name, formValue, children, triggerRef, ...props }: InternalShellProps): React.JSX.Element;
|
|
156
|
+
export declare function PickerShell({ variant, size, color, density, elevation, label, labelPlacement: labelPlacementProp, description, error, invalid, startIcon, fullWidth, disabled: disabledProp, readOnly, required, id, className, classNames, style, display, samples, empty, clearable, onClear, open, onOpenChange, labels, name, formValue, children, triggerRef, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, ...props }: InternalShellProps): React.JSX.Element;
|
|
151
157
|
/**
|
|
152
158
|
* The row of shortcuts under a picker's panel.
|
|
153
159
|
*
|
package/dist/internal/picker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as l from"react";import{Field as a}from"@base-ui/react/field";import{Popover as s}from"@base-ui/react/popover";import{FormControl as r,leaveFormControl as i,useDisabled as o,useFieldsetDisabled as n}from"./form.js";import{glowPointerMove as d}from"./glow.js";import{CloseIcon as p}from"./icons.js";import{WidthSizer as c}from"./sizer.js";import{textOf as m}from"./text.js";import{FieldNotch as u,floatPlaceholderClassName as f,notchShellStyle as h,resolveNotch as g}from"./notch.js";import{useDefaults as x}from"./defaults.js";import{chipRemoveClasses as b,controlHeightClasses as v,controlTextLeadingClasses as y,cx as N,disabledClasses as w,fieldDescriptionClasses as j,fieldReadOnlyClasses as P,fieldRestClasses as k,fieldSlots as $,focusWithinRingClasses as z,gapClasses as C,glassClasses as B,hasContent as D,iconClasses as E,metaTextClasses as I,paddingXClasses as O,radiusClasses as R,stackGapClasses as S,surfaceSlots as q,transitionClasses as F}from"./styles.js";export function popupSlots(e,t){return{...q(e,t),"--p-fill":`var(--plass-${e}-fill)`,"--p-on-solid":`var(--plass-${e}-on-solid)`}}const M=/* @__PURE__ */["relative flex w-full items-center select-none","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",F,E].join(" "),L=z;export const pickerPopupClasses=/* @__PURE__ */[B,"border text-(--plass-fg) bg-(--plass-glass-press)","[border-color:var(--plass-glass-line)]","[box-shadow:var(--plass-shadow-3),var(--plass-gloss-glass)]","[outline:none]","[transition:opacity_var(--plass-duration)_var(--plass-ease)]","motion-reduce:[transition-duration:0ms]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"].join(" ");export const popupPaddingClasses={xs:"p-1.5",sm:"p-2",md:"p-2.5",lg:"p-3",xl:"p-3.5"};const T=/* @__PURE__ */["data-[side=top]:bottom-[-1px]","data-[side=bottom]:top-[-1px] data-[side=bottom]:rotate-180","data-[side=left]:right-[-1px] data-[side=left]:-rotate-90","data-[side=right]:left-[-1px] data-[side=right]:rotate-90"].join(" ");export function PopupArrow({as:l,size:a}){return e(l,{className:T,children:t("svg",{width:a,height:a/2,viewBox:"0 0 10 5","aria-hidden":"true",className:"block",children:[e("path",{d:"M0 0h10L5 5z",fill:"var(--plass-glass-press)"}),e("path",{d:"M0 0 5 5 10 0",fill:"none",stroke:"var(--plass-glass-line)",strokeWidth:"1",vectorEffect:"non-scaling-stroke"})]})})}export function PickerShell({variant:z="glass",size:B="md",color:E="primary",density:q="default",elevation:F=0,label:T,labelPlacement:V,description:W,error:_,invalid:A,startIcon:G,fullWidth:H=!1,disabled:J=!1,readOnly:K=!1,required:Q=!1,id:U,className:X,classNames:Y,style:Z,display:ee,samples:te,empty:le,clearable:ae=!1,onClear:se,open:re,onOpenChange:ie,labels:oe,name:ne,formValue:de,children:pe,triggerRef:ce,"aria-label":me,"aria-labelledby":ue,...fe}){const he=l.useId(),ge=U??`${he}-trigger`,xe=`${he}-label`,be=`${he}-value`,ve=`${he}-description`,ye=`${he}-error`,Ne=ue??(me?ge:T?xe:void 0),we=x(),je=V??we.labelPlacement??"top",{notched:Pe,float:ke}=g(je,T,D(G)),$e=null!=_&&!1!==_&&""!==_,ze=A??$e,Ce=ze?"danger":E,[Be,De]=l.useState(null),Ee=n(Be),Ie=o(J)||Ee,Oe=!Ie&&!K,Re=Ie||K,Se=l.useRef(null),qe=e(a.Label,{id:xe,htmlFor:ge,className:N(I[B],"font-semibold",Ie?"text-(--plass-muted-fg)":"text-(--plass-fg)",Y?.label),children:T});return t(a.Root,{ref:De,disabled:Ie,invalid:ze,className:N("flex-col align-top",S[B],H?"flex w-full":"inline-flex",X),style:{...$(Ce,F),...Z},...fe,children:[D(T)&&!Pe?qe:null,t(s.Root,{open:re,onOpenChange:e=>ie(e),children:[e(u,{notched:Pe,size:B,density:q,variant:z,disabled:Ie,readOnly:K,float:ke,empty:le,label:qe,children:t("span",{style:Pe?h:void 0,onPointerMove:d(Oe),className:N(M,Pe?"":L,v[B],y[B],R[B],C[B],O[q][B],Ie?w[z]:K?P[z]:k[z],Oe?"plass-glow":"",Y?.control),children:[e(a.Validity,{children:({validity:l})=>{const a=!1===l.valid,r=[W?ve:null,$e||a&&!Ie&&!0!==A?ye:null].filter(Boolean).join(" ")||void 0;return t(s.Trigger,{id:ge,ref:ce,disabled:Ie,"aria-label":me,"aria-labelledby":Ne?`${Ne} ${be}`:void 0,"aria-describedby":r,"aria-required":Q||void 0,"aria-invalid":ze||a||void 0,onBlur:()=>{re||i(Se.current)},className:N("flex min-w-0 flex-1 items-center bg-transparent p-0 text-start [font:inherit] text-inherit",C[B],"[outline:none]",Re?"cursor-default":"cursor-pointer"),children:[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",children:[e("span",{id:be,className:N("w-full truncate",le?"text-(--plass-muted-fg)":"text-(--plass-fg)",ke&&f),children:ee}),H?null:e(c,{samples:ke?[...te??[],m(T)].filter(Boolean):te??[]})]})]})}}),!ae||le||Re?null:e("button",{type:"button","aria-label":oe.clear,className:N(b,"text-(--plass-muted-fg)"),onClick:e=>{e.stopPropagation();const t=e.currentTarget,l=t.ownerDocument.activeElement===t;se(),l&&t.ownerDocument.getElementById(ge)?.focus()},children:e(p,{})})]})}),e(s.Portal,{children:e(s.Positioner,{className:"plass-portal z-(--plass-z-portal) [outline:none]",sideOffset:6,align:"start",children:e(s.Popup,{initialFocus:!1,className:N(pickerPopupClasses,R[B],popupPaddingClasses[B],y[B]),style:popupSlots(Ce,3),children:pe})})})]}),W?e(a.Description,{id:ve,className:N(j(B),Y?.description),children:W}):null,e(a.Error,$e?{id:ye,match:!0,className:N(I[B],"text-(--p-accent)",Y?.error),children:_}:{id:ye,className:N(I[B],"text-(--p-accent)",Y?.error)}),e(r,{ref:Se,name:ne,value:de,required:Q&&!K,disabled:Ie,standIn:()=>Se.current?.ownerDocument.getElementById(ge)})]})}export function PickerFooter({size:t,children:l}){return e("div",{className:N("flex items-center justify-end border-t pt-1.5","[border-color:var(--plass-divider)]",C[t]),children:l})}export function PickerDivider(){return e("div",{"aria-hidden":"true",className:"w-px self-stretch bg-(--plass-divider)"})}
|
|
@@ -98,6 +98,30 @@ export declare const barThicknessClasses: Record<PlassSize, string>;
|
|
|
98
98
|
export declare const ringDiameters: Record<PlassSize, number>;
|
|
99
99
|
/** The ring's stroke, thickening with the ring so the hole stays in proportion. */
|
|
100
100
|
export declare const ringStrokes: Record<PlassSize, number>;
|
|
101
|
+
/**
|
|
102
|
+
* The stroke of a ring `diameter` pixels across, read off the ladder rather
|
|
103
|
+
* than given a proportion of its own.
|
|
104
|
+
*
|
|
105
|
+
* Between two rungs it is the straight line between their strokes, so a
|
|
106
|
+
* diameter that lands on a rung draws exactly that rung's ring. Past either end
|
|
107
|
+
* it keeps that end's proportion: `xl`'s, a little under a tenth of the
|
|
108
|
+
* diameter, which keeps the hole in proportion on a ring the size of a loading
|
|
109
|
+
* screen, and `xs`'s below it. So the stroke is always a fraction of the
|
|
110
|
+
* diameter, and the radius it leaves stays above zero however small the ring.
|
|
111
|
+
*/
|
|
112
|
+
export declare function ringStrokeFor(diameter: number): number;
|
|
113
|
+
/**
|
|
114
|
+
* The diameter and the stroke a ring is drawn at: `size`'s rung, or `diameter`
|
|
115
|
+
* when it is a length a ring can be drawn at.
|
|
116
|
+
*
|
|
117
|
+
* Anything but a finite number above zero is ignored rather than drawn, so a
|
|
118
|
+
* `NaN` that arrived from a division somewhere draws the rung. The Dart build
|
|
119
|
+
* resolves the two numbers with the same arithmetic.
|
|
120
|
+
*/
|
|
121
|
+
export declare function ringMetrics(size: PlassSize, diameter: number | undefined): {
|
|
122
|
+
diameter: number;
|
|
123
|
+
stroke: number;
|
|
124
|
+
};
|
|
101
125
|
/**
|
|
102
126
|
* One plate of a `PlProgressBox`, on the tick ladder — an indicator beside a
|
|
103
127
|
* label, not a control you can put one inside.
|
|
@@ -128,7 +152,7 @@ export declare const trackClasses = "bg-(--plass-track) forced-colors:border for
|
|
|
128
152
|
*/
|
|
129
153
|
export declare const fillClasses = "[background-image:var(--p-fill)] forced-colors:[background-color:Highlight] forced-colors:[border-color:Highlight] forced-colors:[color:HighlightText]";
|
|
130
154
|
/** The bar's own duration, one step slower than a control's, so a fill reads as travel. */
|
|
131
|
-
export declare const fillTransitionClasses = "[transition:width_var(--plass-duration-slow)_var(--plass-ease)]";
|
|
155
|
+
export declare const fillTransitionClasses = "[transition:width_var(--plass-duration-slow)_var(--plass-ease)] motion-reduce:[transition-duration:0ms]";
|
|
132
156
|
/**
|
|
133
157
|
* `value` as a fraction of the range, or `null` when there is nothing to say.
|
|
134
158
|
*
|
|
@@ -137,16 +161,27 @@ export declare const fillTransitionClasses = "[transition:width_var(--plass-dura
|
|
|
137
161
|
* one request finished twice is a worse bug than a bar that sits full.
|
|
138
162
|
*/
|
|
139
163
|
export declare function progressFraction(value: number | null | undefined, min: number, max: number): number | null;
|
|
164
|
+
/**
|
|
165
|
+
* The value Base UI is handed: `value` clamped into the range, or `null`
|
|
166
|
+
* wherever `progressFraction` has nothing to say.
|
|
167
|
+
*
|
|
168
|
+
* Base UI clamps a finite value itself, but it reads one that is not finite as
|
|
169
|
+
* indeterminate, where `progressFraction` clamps `Infinity` to full. Handed the
|
|
170
|
+
* raw value, it would leave the fill, the value attributes and the text
|
|
171
|
+
* disagreeing about one number: a bar with neither a fill nor the sweep, and
|
|
172
|
+
* "100%" beside it. Handed this, all three read the fraction.
|
|
173
|
+
*/
|
|
174
|
+
export declare function progressValue(value: number | null | undefined, min: number, max: number): number | null;
|
|
140
175
|
/**
|
|
141
176
|
* What the value reads as, both on screen and to a screen reader.
|
|
142
177
|
*
|
|
143
178
|
* Without `format` it is a percentage of the range rather than of 100 — "3%"
|
|
144
179
|
* for step 3 of 4 is worse than saying nothing — written in `locale`, so a page
|
|
145
|
-
* in German reads "75 %". Base UI's own default is that percentage too,
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
180
|
+
* in German reads "75 %". Base UI's own default is that percentage too, and it
|
|
181
|
+
* is written here from the fraction all the same, so the words cannot read a
|
|
182
|
+
* different number from the fill. A caller who passed `format` gets Base UI's
|
|
183
|
+
* formatted string of `progressValue`, in the same `locale`, because at that
|
|
184
|
+
* point they have said what the number means.
|
|
150
185
|
*/
|
|
151
186
|
export declare function progressText(fraction: number | null, formatted: string | null, hasFormat: boolean, locale: string | undefined): string | null;
|
|
152
187
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{numberFormatter as
|
|
1
|
+
import{numberFormatter as r}from"./format.js";import{forcedFieldEdgeClasses as s,forcedFillClasses as e}from"./styles.js";export function progressSlots(r){return{"--p-fill":`var(--plass-${r}-fill)`,"--p-solid":`var(--plass-${r}-solid)`,"--p-solid-to":`var(--plass-${r}-solid-to)`,"--p-accent":`var(--plass-${r}-accent)`,"--p-soft":`var(--plass-${r}-soft)`,"--p-soft-press":`var(--plass-${r}-soft-press)`}}export const barThicknessClasses={xs:"h-1",sm:"h-1.5",md:"h-1.5",lg:"h-2",xl:"h-2.5"};export const ringDiameters={xs:14,sm:16,md:20,lg:26,xl:32};export const ringStrokes={xs:1.5,sm:1.75,md:2,lg:2.5,xl:3};const t=["xs","sm","md","lg","xl"];export function ringStrokeFor(r){if(r<=ringDiameters.xs)return r*ringStrokes.xs/ringDiameters.xs;if(r>=ringDiameters.xl)return r*ringStrokes.xl/ringDiameters.xl;const s=t.findIndex(s=>ringDiameters[s]>=r),e=t[s-1],n=t[s];return ringStrokes[e]+(r-ringDiameters[e])/(ringDiameters[n]-ringDiameters[e])*(ringStrokes[n]-ringStrokes[e])}export function ringMetrics(r,s){return void 0===s||!Number.isFinite(s)||s<=0?{diameter:ringDiameters[r],stroke:ringStrokes[r]}:{diameter:s,stroke:ringStrokeFor(s)}}export const plateSizeClasses={xs:"size-2",sm:"size-2.5",md:"size-3",lg:"size-4",xl:"size-5"};export const plateRadiusClasses={xs:"rounded-[0.1875rem]",sm:"rounded-[0.25rem]",md:"rounded-[0.28125rem]",lg:"rounded-[0.375rem]",xl:"rounded-[0.4375rem]"};export const plateGapClasses={xs:"gap-1",sm:"gap-1",md:"gap-1.5",lg:"gap-1.5",xl:"gap-2"};export const trackClasses=`bg-(--plass-track) ${s}`;export const fillClasses=`[background-image:var(--p-fill)] ${e}`;export const fillTransitionClasses="[transition:width_var(--plass-duration-slow)_var(--plass-ease)] motion-reduce:[transition-duration:0ms]";export function progressFraction(r,s,e){return null==r||Number.isNaN(r)||e<=s?null:Math.min(1,Math.max(0,(r-s)/(e-s)))}export function progressValue(r,s,e){return null==r||null===progressFraction(r,s,e)?null:Math.min(e,Math.max(s,r))}const n={style:"percent"};export function progressText(s,e,t,o){return null===s?null:t?e:r(o,n).format(s)}export function progressAriaText(r,s,e){if(null!==r)return t=>progressText(r,t,s,e)??""}
|
|
@@ -29,3 +29,15 @@
|
|
|
29
29
|
export declare function searchText(value: unknown): string;
|
|
30
30
|
/** Every string a row can be found by, folded once and joined into one haystack. */
|
|
31
31
|
export declare function searchHaystack(values: readonly unknown[]): string;
|
|
32
|
+
/**
|
|
33
|
+
* `searchText` of what `read` finds on an item, remembered per item.
|
|
34
|
+
*
|
|
35
|
+
* Only the needle changes from one keystroke to the next, so a filter that
|
|
36
|
+
* folds its items as it goes folds every one of them again for every character
|
|
37
|
+
* typed. This folds an item the first time a query reaches it and hands the
|
|
38
|
+
* same text back after that, for as long as `read` finds the same value on it —
|
|
39
|
+
* an item whose text changed is folded again, so nothing it answers is stale.
|
|
40
|
+
* Kept by the item itself, weakly, so an item nobody holds any more takes its
|
|
41
|
+
* text with it.
|
|
42
|
+
*/
|
|
43
|
+
export declare function cachedSearchText<Item extends object>(read: (item: Item) => unknown): (item: Item) => string;
|
package/dist/internal/search.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=/[\u0300-\u036f]/g;export function searchText(t){return null==t||"object"==typeof t?"":String(t).normalize("NFD").replace(e,"").toLowerCase()}export function searchHaystack(e){return e.map(searchText).join("\0")}
|
|
1
|
+
const e=/[\u0300-\u036f]/g;export function searchText(t){return null==t||"object"==typeof t?"":String(t).normalize("NFD").replace(e,"").toLowerCase()}export function searchHaystack(e){return e.map(searchText).join("\0")}export function cachedSearchText(e){const t=new WeakMap;return r=>{const n=e(r),c=t.get(r);if(c&&Object.is(c.value,n))return c.text;const a=searchText(n);return t.set(r,{value:n,text:a}),a}}
|
package/dist/internal/sizer.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type * as React from 'react';
|
|
2
1
|
/**
|
|
3
2
|
* Holds a control open at the width of the widest thing it could ever say.
|
|
4
3
|
*
|
|
@@ -8,9 +7,15 @@ import type * as React from 'react';
|
|
|
8
7
|
* `Washington DC`. Either way the field moves under the pointer that just used
|
|
9
8
|
* it, and the whole row of controls beside it shuffles along.
|
|
10
9
|
*
|
|
11
|
-
* So the alternatives are laid out too,
|
|
12
|
-
* The control's intrinsic width becomes the widest
|
|
13
|
-
* on the value.
|
|
10
|
+
* So the alternatives are laid out too, one to a line in a box clipped to no
|
|
11
|
+
* height. The control's intrinsic width becomes the widest line and stops
|
|
12
|
+
* depending on the value.
|
|
13
|
+
*
|
|
14
|
+
* The lines are one element. Every sample goes into one attribute, a newline
|
|
15
|
+
* between each two, and `white-space: pre` breaks the line there and nowhere
|
|
16
|
+
* else, so the box is as wide as its widest line. An element per sample drew
|
|
17
|
+
* the same box and cost a select of 250 countries 250 elements, each with a
|
|
18
|
+
* generated box of its own to style and lay out.
|
|
14
19
|
*
|
|
15
20
|
* Three things it deliberately is not:
|
|
16
21
|
*
|
|
@@ -18,15 +23,18 @@ import type * as React from 'react';
|
|
|
18
23
|
* and a box that is not laid out reserves nothing.
|
|
19
24
|
* - **Not read out.** `aria-hidden`, or a screen reader would announce every
|
|
20
25
|
* value the control might hold before the one it does.
|
|
21
|
-
* - **Not text.**
|
|
26
|
+
* - **Not text.** The samples are drawn as generated content off a data
|
|
22
27
|
* attribute rather than as a text node. `content: attr(…)` lays out exactly
|
|
23
28
|
* like text, so it reserves the same width — but it leaves nothing for
|
|
24
29
|
* `getByText` or a screen reader's find-in-page to trip over, and a caller's
|
|
25
30
|
* test asking for the option they selected keeps finding one element rather
|
|
26
|
-
* than two.
|
|
27
|
-
*
|
|
28
|
-
*
|
|
31
|
+
* than two.
|
|
32
|
+
*
|
|
33
|
+
* Which is why a sample is a string and never a node. A label that is a node
|
|
34
|
+
* reaches here as its text, through `textOf`: laid out for real, a list of
|
|
35
|
+
* countries with a flag in each would ask for every flag to hold one field
|
|
36
|
+
* open, and a picture carries no width a reader could not do without.
|
|
29
37
|
*/
|
|
30
38
|
export declare function WidthSizer({ samples }: {
|
|
31
|
-
samples: readonly
|
|
32
|
-
}):
|
|
39
|
+
samples: readonly string[];
|
|
40
|
+
}): import("react").JSX.Element | null;
|
package/dist/internal/sizer.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";export function WidthSizer({samples:
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";export function WidthSizer({samples:n}){return 0===n.length?null:e("span",{"aria-hidden":"true","data-sample":n.map(oneLine).join("\n"),className:"invisible block h-0 min-h-0 overflow-hidden whitespace-pre before:content-[attr(data-sample)]"})}function oneLine(e){return e.replace(/[ \t\n\r]+/g," ").replace(/^ | $/g,"")}
|
package/dist/internal/steps.d.ts
CHANGED
|
@@ -40,21 +40,6 @@ export type PlassStepConnector = 'solid' | 'dashed' | 'dotted' | 'none';
|
|
|
40
40
|
export declare const bulletSizeValues: Record<PlassSize, string>;
|
|
41
41
|
/** Between the bullet column and the content beside it. */
|
|
42
42
|
export declare const bulletGapClasses: Record<PlassSize, string>;
|
|
43
|
-
/**
|
|
44
|
-
* The bullet at each of the three states.
|
|
45
|
-
*
|
|
46
|
-
* Every one of them is a different axis, never a different opacity: `complete`
|
|
47
|
-
* is the family's gradient, `current` is that gradient with a halo of the soft
|
|
48
|
-
* tint around it, and `upcoming` is a hairline ring on the page's own surface. A
|
|
49
|
-
* reader who cannot tell the colours apart still has a filled shape, a haloed
|
|
50
|
-
* shape and an empty one.
|
|
51
|
-
*
|
|
52
|
-
* There is no gloss line on the two filled ones, for the reason a filled
|
|
53
|
-
* `PlButton` has none — the gradient is the form. The `upcoming` ring is drawn
|
|
54
|
-
* in the neutral hairline rather than the sheet's white one, the same call a
|
|
55
|
-
* checkbox's edge makes: a bullet is small enough that its edge *is* the object,
|
|
56
|
-
* and white light on a translucent pane disappears on a light card.
|
|
57
|
-
*/
|
|
58
43
|
export declare const bulletStatusClasses: Record<PlassStepStatus, string>;
|
|
59
44
|
/**
|
|
60
45
|
* The line *after* a step, which is what makes it the step's own property: a
|
package/dist/internal/steps.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{forcedFillClasses as e}from"./styles.js";export const bulletSizeValues={xs:"0.875rem",sm:"1rem",md:"1.25rem",lg:"1.5rem",xl:"1.875rem"};export const bulletGapClasses={xs:"gap-2",sm:"gap-2.5",md:"gap-3",lg:"gap-3.5",xl:"gap-4"};export const bulletStatusClasses={complete
|
|
1
|
+
import{forcedFillClasses as e}from"./styles.js";export const bulletSizeValues={xs:"0.875rem",sm:"1rem",md:"1.25rem",lg:"1.5rem",xl:"1.875rem"};export const bulletGapClasses={xs:"gap-2",sm:"gap-2.5",md:"gap-3",lg:"gap-3.5",xl:"gap-4"};const o="plass-fill relative";export const bulletStatusClasses={complete:`${o} [--p-fill-on:1] text-(--p-on-solid) ${e}`,current:`${o} [--p-fill-on:1] text-(--p-on-solid) [box-shadow:0_0_0_0.25rem_var(--p-soft)] ${e} forced-colors:[outline:2px_solid_Highlight] forced-colors:[outline-offset:2px]`,upcoming:`${o} [--p-fill-edge:2px] border-2 bg-(--plass-surface) text-(--plass-muted-fg) [border-color:var(--plass-border)]`};export const connectorColorClasses={complete:"[border-color:var(--p-line-hover)]",current:"[border-color:var(--plass-border)]",upcoming:"[border-color:var(--plass-border)]"};export const connectorStyleClasses={solid:"border-solid",dashed:"border-dashed",dotted:"border-dotted",none:""};export const titleStatusClasses={complete:"text-(--plass-fg)",current:"text-(--p-accent)",upcoming:"text-(--plass-muted-fg)"};export function statusAt(e,o){return null===o?"upcoming":e<o?"complete":e===o?"current":"upcoming"}
|
|
@@ -54,6 +54,17 @@ export declare const controlTextClasses: Record<PlassSize, string>;
|
|
|
54
54
|
export declare const controlTextLeadingClasses: Record<PlassSize, string>;
|
|
55
55
|
/** Labels, descriptions and error messages: one step below the control's text. */
|
|
56
56
|
export declare const metaTextClasses: Record<PlassSize, string>;
|
|
57
|
+
/**
|
|
58
|
+
* The line of help under a field: its `description`.
|
|
59
|
+
*
|
|
60
|
+
* Every field that takes one draws it the same way, on the step below the
|
|
61
|
+
* control and in the muted ink, so it is written once here rather than in each
|
|
62
|
+
* of them. `m-0` is part of it because `Field.Description` renders a `<p>`,
|
|
63
|
+
* which arrives with the UA's block margin and with whatever the host page says
|
|
64
|
+
* about `p` — and the gap between a field's parts is `stackGapClasses`, not a
|
|
65
|
+
* paragraph's margin. A caller's `classNames.description` goes after this.
|
|
66
|
+
*/
|
|
67
|
+
export declare function fieldDescriptionClasses(size: PlassSize): string;
|
|
57
68
|
/**
|
|
58
69
|
* Horizontal padding, and the only thing `density` is allowed to touch. The two
|
|
59
70
|
* tracks are roughly 2:1 so the difference is legible at a glance rather than a
|
|
@@ -201,15 +212,25 @@ export declare const sheetHeaderGapClasses: Record<PlassSize, string>;
|
|
|
201
212
|
*
|
|
202
213
|
* `-webkit-backdrop-filter` is written alongside the standard property because
|
|
203
214
|
* Safari still needs it, and Tailwind will not add it for an arbitrary value.
|
|
215
|
+
*
|
|
216
|
+
* For a reader who has asked for less transparency `--plass-blur` is `none` and
|
|
217
|
+
* the glass tokens are opaque (`styles.css`), so a surface that pairs these with
|
|
218
|
+
* a `--plass-glass*` fill needs nothing of its own for that reader.
|
|
204
219
|
*/
|
|
205
220
|
export declare const glassClasses = "[backdrop-filter:var(--plass-blur)] [-webkit-backdrop-filter:var(--plass-blur)]";
|
|
206
221
|
/**
|
|
207
222
|
* The house transition.
|
|
208
223
|
*
|
|
209
224
|
* One duration and one curve, applied the same way in both directions — a key
|
|
210
|
-
* going down and a key coming back up are the same spring. `
|
|
211
|
-
*
|
|
212
|
-
*
|
|
225
|
+
* going down and a key coming back up are the same spring. `filter` is in the
|
|
226
|
+
* list because that is what hover and press actually move.
|
|
227
|
+
*
|
|
228
|
+
* `background-image` is in it for WebKit, the one engine that eases one
|
|
229
|
+
* gradient into another, which is a solid surface changing family. None of them
|
|
230
|
+
* eases a gradient to or from `none`, and Chromium and Firefox ease no gradient
|
|
231
|
+
* at all, so a fill that comes and goes with a state — a tick, a switch, a
|
|
232
|
+
* chosen day — is not a background but a layer of its own, faded by its
|
|
233
|
+
* opacity: `.plass-fill` in `styles.css`.
|
|
213
234
|
*
|
|
214
235
|
* `opacity` is in it because half the library already writes an opacity as a
|
|
215
236
|
* *state*: `opacity-50` is what disabled looks like everywhere, a `PlBackTop`
|
|
@@ -222,6 +243,10 @@ export declare const glassClasses = "[backdrop-filter:var(--plass-blur)] [-webki
|
|
|
222
243
|
* scaling a key resamples its label, and text that shimmers under the cursor
|
|
223
244
|
* undoes the restraint everything else is spending effort on. A surface that
|
|
224
245
|
* holds content rather than being pressed — a Card — may lift, and does.
|
|
246
|
+
*
|
|
247
|
+
* Under reduced motion the new colours arrive at once instead of easing in, as
|
|
248
|
+
* the Flutter surfaces do. Nothing waits on the end of one of these, so no
|
|
249
|
+
* duration is kept for a `transitionend` to arrive on.
|
|
225
250
|
*/
|
|
226
251
|
export declare const transitionClasses: string;
|
|
227
252
|
/**
|
|
@@ -262,6 +287,28 @@ export declare const focusWithinRingClasses = "has-[:focus-visible]:[outline:2px
|
|
|
262
287
|
* inside the edge instead. Same width, same colour, same absence of a gap.
|
|
263
288
|
*/
|
|
264
289
|
export declare const focusRingInsetClasses = "focus-visible:[outline:2px_solid_var(--p-ring)] focus-visible:[outline-offset:-2px]";
|
|
290
|
+
/**
|
|
291
|
+
* Where a control drawn smaller than 24px is pressed from.
|
|
292
|
+
*
|
|
293
|
+
* WCAG 2.5.8 asks for a target at least 24px square. The `::before` is that
|
|
294
|
+
* square, centred on the control whatever size the control is, and placed out
|
|
295
|
+
* of the flow so nothing around it moves. On a control that is already larger
|
|
296
|
+
* the inset turns positive and the square sits inside it, where it changes
|
|
297
|
+
* nothing.
|
|
298
|
+
*/
|
|
299
|
+
export declare const targetClasses = "relative before:absolute before:inset-[calc(50%-12px)]";
|
|
300
|
+
/**
|
|
301
|
+
* The safe area on the inline edge a pinned control is against, as
|
|
302
|
+
* `--p-safe-inline`.
|
|
303
|
+
*
|
|
304
|
+
* `env()` has only physical names, so which of `left` and `right` is the start
|
|
305
|
+
* is the direction's question, and a style attribute cannot ask it. The `rtl:`
|
|
306
|
+
* variant can, so the class picks the side and the inline inset reads it, with
|
|
307
|
+
* `0px` behind the slot for a class that was never generated. A floating action
|
|
308
|
+
* button and a floating back-to-top button both stand off it, and a landscape
|
|
309
|
+
* cutout would cover either one otherwise.
|
|
310
|
+
*/
|
|
311
|
+
export declare const safeInlineClasses: Record<'Start' | 'End', string>;
|
|
265
312
|
/**
|
|
266
313
|
* The × that takes something off a chip.
|
|
267
314
|
*
|
|
@@ -274,15 +321,35 @@ export declare const focusRingInsetClasses = "focus-visible:[outline:2px_solid_v
|
|
|
274
321
|
* keyboard arrives.
|
|
275
322
|
*
|
|
276
323
|
* Drawn at the size of the label, and pressed from a 24px square, the minimum
|
|
277
|
-
* target size of WCAG 2.5.8
|
|
278
|
-
*
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
*
|
|
324
|
+
* target size of WCAG 2.5.8, through `targetClasses`. It comes after the label
|
|
325
|
+
* or the trigger in the markup and is positioned, so where the square reaches
|
|
326
|
+
* over one of them the × has the press, and the neighbour keeps everything
|
|
327
|
+
* outside the square.
|
|
328
|
+
*
|
|
329
|
+
* `p-0` because a browser pads a button on every side, and
|
|
330
|
+
* `plass-ui/styles.css` does not reset that padding: WebKit's is a pixel deeper
|
|
331
|
+
* below than above, which would sit the × half a pixel high.
|
|
282
332
|
*/
|
|
283
333
|
export declare const chipRemoveClasses: string;
|
|
284
334
|
/** Icons track their label rather than carrying a size of their own. */
|
|
285
335
|
export declare const iconClasses = "[&_svg]:pointer-events-none [&_svg]:size-[1.2em] [&_svg]:shrink-0";
|
|
336
|
+
/**
|
|
337
|
+
* A picture handed over as the whole of a slot: a PlCarousel's slide, the logo
|
|
338
|
+
* standing in for a PlAvatar.
|
|
339
|
+
*
|
|
340
|
+
* Both are documented as taking a bare `<img>`, and a bare `<img>` is inline and
|
|
341
|
+
* as large as its file: a slide would hang a descender gap under the photograph
|
|
342
|
+
* and a logo would overflow the circle. This lays it out the way a page reset
|
|
343
|
+
* lays out every picture — a block no wider than its box, with its height
|
|
344
|
+
* following its width — for these slots only, now that `plass-ui/styles.css`
|
|
345
|
+
* leaves the page's own pictures where the page put them.
|
|
346
|
+
*
|
|
347
|
+
* Inside `:where()`, so at specificity 0 like the reset it replaces: a class the
|
|
348
|
+
* caller put on the picture still wins, and `h-16 object-cover` on a slide keeps
|
|
349
|
+
* its height rather than being handed `auto` back. Written one selector per
|
|
350
|
+
* class, as `PlAspectRatio`'s are, rather than as a comma list in one variant.
|
|
351
|
+
*/
|
|
352
|
+
export declare const pictureSlotClasses: string;
|
|
286
353
|
/**
|
|
287
354
|
* Text for a screen reader and nobody else.
|
|
288
355
|
*
|
|
@@ -290,17 +357,25 @@ export declare const iconClasses = "[&_svg]:pointer-events-none [&_svg]:size-[1.
|
|
|
290
357
|
* text off the accessibility tree along with the screen, and the third leaves a
|
|
291
358
|
* clickable ghost the size of the words. A 1px clipped box is the one form that
|
|
292
359
|
* is invisible to a sighted reader and present to every other kind.
|
|
360
|
+
*
|
|
361
|
+
* The text effects put their line in one of these and draw what a sighted
|
|
362
|
+
* reader sees as generated content beside it, so this copy is the only text
|
|
363
|
+
* there is: the one a crawler indexes and the one a selection copies.
|
|
293
364
|
*/
|
|
294
365
|
export declare const srOnlyClasses = "absolute size-px overflow-hidden whitespace-nowrap [clip-path:inset(50%)]";
|
|
295
366
|
/**
|
|
296
|
-
* The
|
|
367
|
+
* The drawn copy of a text effect whose line changes while it runs, holding the
|
|
368
|
+
* room of the line it arrives at.
|
|
297
369
|
*
|
|
298
|
-
*
|
|
299
|
-
*
|
|
300
|
-
*
|
|
301
|
-
*
|
|
370
|
+
* Two pieces of generated content in one grid cell: `data-text`, the frame
|
|
371
|
+
* being drawn, and `data-sample`, the finished line, laid out and not drawn.
|
|
372
|
+
* The cell is as wide as the wider of the two, so the box has the finished
|
|
373
|
+
* line's width from the first paint, and a frame that is narrower — a count
|
|
374
|
+
* still short of its figure — no longer moves the text around it as it grows.
|
|
375
|
+
* The frame is the first of the two, so it is the one the grid takes its
|
|
376
|
+
* baseline from, and it sits on the line of the text around it.
|
|
302
377
|
*/
|
|
303
|
-
export declare const
|
|
378
|
+
export declare const drawnCopyClasses: string;
|
|
304
379
|
/**
|
|
305
380
|
* Every slot a control reads.
|
|
306
381
|
*
|
|
@@ -337,6 +412,26 @@ export declare function controlSlots(color: PlassColor, elevation: PlassElevatio
|
|
|
337
412
|
* element, and a surface without that class has no layers at all.
|
|
338
413
|
*/
|
|
339
414
|
export declare function surfaceSlots(color: PlassColor, elevation: PlassElevation): React.CSSProperties;
|
|
415
|
+
/**
|
|
416
|
+
* The same slots again for a **field's** shell, with the interaction light
|
|
417
|
+
* turned down.
|
|
418
|
+
*
|
|
419
|
+
* A field is the one lit surface in the library that is not finished with the
|
|
420
|
+
* moment it has been pressed. A key takes a bloom for as long as the pointer is
|
|
421
|
+
* crossing it and then the reader has moved on; a field is clicked once and then
|
|
422
|
+
* written in, and for that minute the light sits under the words being typed and
|
|
423
|
+
* follows a pointer that is no longer being moved. At a key's strength it reads
|
|
424
|
+
* as a stain on the sentence rather than as the surface answering.
|
|
425
|
+
*
|
|
426
|
+
* So both layers are mixed down to `--plass-glow-field-strength` of the family's
|
|
427
|
+
* tint — the colour is dimmed rather than the layer's opacity, because opacity
|
|
428
|
+
* is what `.plass-glow` animates between its two states and what
|
|
429
|
+
* `[data-quiet]` takes over while the field is being typed into.
|
|
430
|
+
*
|
|
431
|
+
* Everything else is `surfaceSlots`. A field's sheet is still undyed glass, and
|
|
432
|
+
* the family still reaches it through the hairline, the ring and the caret.
|
|
433
|
+
*/
|
|
434
|
+
export declare function fieldSlots(color: PlassColor, elevation: PlassElevation): React.CSSProperties;
|
|
340
435
|
/**
|
|
341
436
|
* The edge a surface that is only a fill gets back in forced-colours mode.
|
|
342
437
|
*
|
|
@@ -396,6 +491,13 @@ export declare const forcedCheckedTextClasses = "forced-colors:data-[checked]:[c
|
|
|
396
491
|
export declare const forcedHighlightedClasses: string;
|
|
397
492
|
/** A checked control that is disabled, in the system's colour for unavailable. */
|
|
398
493
|
export declare const forcedDisabledCheckedClasses: string;
|
|
494
|
+
/**
|
|
495
|
+
* `disabledClasses` without the fade, for a control disabled together with a
|
|
496
|
+
* surface around it that is already drawn at that fade, such as a chip in a
|
|
497
|
+
* disabled `PlCombobox`. It keeps the look of a disabled control, and a fade of
|
|
498
|
+
* its own would draw it at a quarter.
|
|
499
|
+
*/
|
|
500
|
+
export declare const disabledLookClasses: Record<PlassVariant, string>;
|
|
399
501
|
/**
|
|
400
502
|
* Disabled is **the light going out.** The key keeps its shape, its colour and
|
|
401
503
|
* its place in the layout, and stops catching any light: no gloss, no tinted
|
|
@@ -441,6 +543,26 @@ export declare const readOnlyFilterClasses = "saturate-[0.55]";
|
|
|
441
543
|
* family reaches the hairline, the focus ring and the caret and stops.
|
|
442
544
|
*/
|
|
443
545
|
export declare const sheetRestClasses: Record<PlassVariant, string>;
|
|
546
|
+
/**
|
|
547
|
+
* The material of a **mark**: a surface that is the thing being coloured and
|
|
548
|
+
* is never pressed — a PlAvatar, a PlBadge, a PlAppLogo's plate. The Flutter
|
|
549
|
+
* build's `markSurface` is the same answer.
|
|
550
|
+
*
|
|
551
|
+
* It sits between a control and a sheet. The sheet takes the tint the way a
|
|
552
|
+
* control's does, because a portrait of one person and a product's icon are
|
|
553
|
+
* each about the thing they are coloured for, and unlike a PlCard's. But there
|
|
554
|
+
* is no pointer to answer, so there is no hover ladder, and the glass edge is
|
|
555
|
+
* the neutral `--plass-border` rather than the sheet's white
|
|
556
|
+
* `--plass-glass-line`: a mark is very often laid on something opaque, a
|
|
557
|
+
* header or a card, where white light on a cut edge draws no edge at all.
|
|
558
|
+
*
|
|
559
|
+
* `solid` carries no gloss line, for the reason a filled PlButton carries none:
|
|
560
|
+
* the gradient is the form. `ghost` keeps a wash at rest rather than being
|
|
561
|
+
* bare, which is the difference between a mark and a control: a ghost button
|
|
562
|
+
* has nothing until the pointer arrives, and a ghost mark with nothing under it
|
|
563
|
+
* is a glyph floating on the page.
|
|
564
|
+
*/
|
|
565
|
+
export declare const markRestClasses: Record<PlassVariant, string>;
|
|
444
566
|
/**
|
|
445
567
|
* The shell a field-shaped control is drawn on — a PlTextField's box and a
|
|
446
568
|
* Select's trigger, which have to be indistinguishable or a form looks like two
|