plass-ui 1.3.0 → 1.4.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 +590 -0
- package/README.md +1 -1
- package/dist/components/alert/PlAlert.js +1 -1
- package/dist/components/anchor/PlAnchor.d.ts +72 -0
- package/dist/components/anchor/PlAnchor.js +1 -0
- package/dist/components/anchor/index.d.ts +2 -0
- package/dist/components/anchor/index.js +1 -0
- package/dist/components/animate-appear/PlAnimateAppear.d.ts +10 -0
- package/dist/components/animate-appear/PlAnimateAppear.js +1 -1
- package/dist/components/animate-blink/PlAnimateBlink.d.ts +2 -2
- package/dist/components/animate-blink/PlAnimateBlink.js +1 -1
- package/dist/components/animate-counter/PlAnimateCounter.d.ts +83 -0
- package/dist/components/animate-counter/PlAnimateCounter.js +1 -0
- package/dist/components/animate-counter/index.d.ts +2 -0
- package/dist/components/animate-counter/index.js +1 -0
- package/dist/components/animate-fade/PlAnimateFade.d.ts +2 -2
- package/dist/components/animate-fade/PlAnimateFade.js +1 -1
- package/dist/components/animate-float/PlAnimateFloat.d.ts +51 -0
- package/dist/components/animate-float/PlAnimateFloat.js +1 -0
- package/dist/components/animate-float/index.d.ts +2 -0
- package/dist/components/animate-float/index.js +1 -0
- package/dist/components/animate-grow/PlAnimateGrow.d.ts +2 -2
- package/dist/components/animate-grow/PlAnimateGrow.js +1 -1
- package/dist/components/animate-reveal/PlAnimateReveal.d.ts +51 -0
- package/dist/components/animate-reveal/PlAnimateReveal.js +1 -0
- package/dist/components/animate-reveal/index.d.ts +2 -0
- package/dist/components/animate-reveal/index.js +1 -0
- package/dist/components/animate-rotate/PlAnimateRotate.d.ts +2 -2
- package/dist/components/animate-rotate/PlAnimateRotate.js +1 -1
- package/dist/components/animate-scramble/PlAnimateScramble.d.ts +75 -0
- package/dist/components/animate-scramble/PlAnimateScramble.js +1 -0
- package/dist/components/animate-scramble/index.d.ts +2 -0
- package/dist/components/animate-scramble/index.js +1 -0
- package/dist/components/animate-shake/PlAnimateShake.d.ts +57 -0
- package/dist/components/animate-shake/PlAnimateShake.js +1 -0
- package/dist/components/animate-shake/index.d.ts +2 -0
- package/dist/components/animate-shake/index.js +1 -0
- package/dist/components/animate-slide/PlAnimateSlide.d.ts +2 -2
- package/dist/components/animate-slide/PlAnimateSlide.js +1 -1
- package/dist/components/animate-split/PlAnimateSplit.d.ts +54 -0
- package/dist/components/animate-split/PlAnimateSplit.js +1 -0
- package/dist/components/animate-split/index.d.ts +2 -0
- package/dist/components/animate-split/index.js +1 -0
- package/dist/components/animate-zoom/PlAnimateZoom.d.ts +2 -2
- package/dist/components/animate-zoom/PlAnimateZoom.js +1 -1
- package/dist/components/app-logo/PlAppLogo.d.ts +78 -0
- package/dist/components/app-logo/PlAppLogo.js +1 -0
- package/dist/components/app-logo/index.d.ts +2 -0
- package/dist/components/app-logo/index.js +1 -0
- package/dist/components/area-chart/PlAreaChart.d.ts +54 -0
- package/dist/components/area-chart/PlAreaChart.js +1 -0
- package/dist/components/area-chart/index.d.ts +2 -0
- package/dist/components/area-chart/index.js +1 -0
- package/dist/components/avatar/PlAvatar.js +1 -1
- package/dist/components/back-top/PlBackTop.js +1 -1
- package/dist/components/bar-chart/PlBarChart.d.ts +63 -0
- package/dist/components/bar-chart/PlBarChart.js +1 -0
- package/dist/components/bar-chart/index.d.ts +2 -0
- package/dist/components/bar-chart/index.js +1 -0
- package/dist/components/breadcrumb/PlBreadcrumb.js +1 -1
- package/dist/components/button-group/PlButtonGroup.js +1 -1
- 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.js +1 -1
- package/dist/components/code-block/PlCodeBlock.d.ts +175 -0
- package/dist/components/code-block/PlCodeBlock.js +1 -0
- package/dist/components/code-block/index.d.ts +2 -0
- package/dist/components/code-block/index.js +1 -0
- package/dist/components/combobox/PlCombobox.d.ts +1 -1
- package/dist/components/combobox/PlCombobox.js +1 -1
- package/dist/components/command-palette/PlCommandPalette.d.ts +1 -1
- package/dist/components/command-palette/PlCommandPalette.js +1 -1
- package/dist/components/container/PlContainer.d.ts +22 -6
- package/dist/components/container/PlContainer.js +1 -1
- package/dist/components/data-list/PlDataList.d.ts +74 -0
- package/dist/components/data-list/PlDataList.js +1 -0
- package/dist/components/data-list/index.d.ts +2 -0
- package/dist/components/data-list/index.js +1 -0
- package/dist/components/data-table/PlDataTable.d.ts +202 -0
- package/dist/components/data-table/PlDataTable.js +1 -0
- package/dist/components/data-table/index.d.ts +2 -0
- package/dist/components/data-table/index.js +1 -0
- package/dist/components/drawer/PlDrawer.d.ts +1 -1
- package/dist/components/drawer/PlDrawer.js +1 -1
- package/dist/components/flex/PlFlex.d.ts +83 -0
- package/dist/components/flex/PlFlex.js +1 -0
- package/dist/components/flex/index.d.ts +2 -0
- package/dist/components/flex/index.js +1 -0
- package/dist/components/floating-action-button/PlFloatingActionButton.d.ts +81 -0
- package/dist/components/floating-action-button/PlFloatingActionButton.js +1 -0
- package/dist/components/floating-action-button/index.d.ts +2 -0
- package/dist/components/floating-action-button/index.js +1 -0
- package/dist/components/footer/PlFooter.d.ts +4 -3
- package/dist/components/footer/PlFooter.js +1 -1
- package/dist/components/gallery/PlGallery.d.ts +154 -0
- package/dist/components/gallery/PlGallery.js +1 -0
- package/dist/components/gallery/PlGalleryViewer.d.ts +31 -0
- package/dist/components/gallery/PlGalleryViewer.js +1 -0
- package/dist/components/gallery/index.d.ts +2 -0
- package/dist/components/gallery/index.js +1 -0
- package/dist/components/gauge-chart/PlGaugeChart.d.ts +64 -0
- package/dist/components/gauge-chart/PlGaugeChart.js +1 -0
- package/dist/components/gauge-chart/index.d.ts +2 -0
- package/dist/components/gauge-chart/index.js +1 -0
- package/dist/components/grid/PlGrid.js +1 -1
- package/dist/components/grid/PlGridItem.js +1 -1
- package/dist/components/header/PlHeader.d.ts +4 -3
- package/dist/components/header/PlHeader.js +1 -1
- package/dist/components/heatmap-chart/PlHeatmapChart.d.ts +69 -0
- package/dist/components/heatmap-chart/PlHeatmapChart.js +1 -0
- package/dist/components/heatmap-chart/index.d.ts +2 -0
- package/dist/components/heatmap-chart/index.js +1 -0
- package/dist/components/hover-card/PlHoverCard.d.ts +94 -0
- package/dist/components/hover-card/PlHoverCard.js +1 -0
- package/dist/components/hover-card/index.d.ts +2 -0
- package/dist/components/hover-card/index.js +1 -0
- package/dist/components/how-to-steps/PlHowToSteps.d.ts +87 -0
- package/dist/components/how-to-steps/PlHowToSteps.js +1 -0
- package/dist/components/how-to-steps/index.d.ts +2 -0
- package/dist/components/how-to-steps/index.js +1 -0
- package/dist/components/image/PlImage.js +1 -1
- package/dist/components/line-chart/PlLineChart.d.ts +74 -0
- package/dist/components/line-chart/PlLineChart.js +1 -0
- package/dist/components/line-chart/index.d.ts +2 -0
- package/dist/components/line-chart/index.js +1 -0
- package/dist/components/meter/PlMeter.d.ts +83 -0
- package/dist/components/meter/PlMeter.js +1 -0
- package/dist/components/meter/index.d.ts +2 -0
- package/dist/components/meter/index.js +1 -0
- package/dist/components/mockup/PlMockup.d.ts +146 -0
- package/dist/components/mockup/PlMockup.js +1 -0
- package/dist/components/mockup/index.d.ts +2 -0
- package/dist/components/mockup/index.js +1 -0
- package/dist/components/modal/PlModal.d.ts +1 -1
- package/dist/components/modal/PlModal.js +1 -1
- package/dist/components/number-field/PlNumberField.d.ts +1 -1
- package/dist/components/number-field/PlNumberField.js +1 -1
- package/dist/components/overlay/PlOverlay.d.ts +1 -1
- package/dist/components/overlay/PlOverlay.js +1 -1
- package/dist/components/page-layout/PlPageLayout.js +1 -1
- package/dist/components/pagination/PlPagination.js +1 -1
- package/dist/components/panes/PlPanes.d.ts +2 -2
- package/dist/components/panes/PlPanes.js +1 -1
- package/dist/components/pie-chart/PlPieChart.d.ts +58 -0
- package/dist/components/pie-chart/PlPieChart.js +1 -0
- package/dist/components/pie-chart/index.d.ts +2 -0
- package/dist/components/pie-chart/index.js +1 -0
- package/dist/components/popconfirm/PlPopconfirm.d.ts +1 -1
- package/dist/components/popconfirm/PlPopconfirm.js +1 -1
- package/dist/components/popover/PlPopover.d.ts +1 -1
- package/dist/components/popover/PlPopover.js +1 -1
- package/dist/components/portal/PlPortal.d.ts +78 -0
- package/dist/components/portal/PlPortal.js +1 -0
- package/dist/components/portal/index.d.ts +2 -0
- package/dist/components/portal/index.js +1 -0
- package/dist/components/radio-group/PlRadioGroup.js +1 -1
- package/dist/components/rating/PlRating.js +1 -1
- package/dist/components/scatter-chart/PlScatterChart.d.ts +46 -0
- package/dist/components/scatter-chart/PlScatterChart.js +1 -0
- package/dist/components/scatter-chart/index.d.ts +2 -0
- package/dist/components/scatter-chart/index.js +1 -0
- package/dist/components/scroll-area/PlScrollArea.d.ts +98 -0
- package/dist/components/scroll-area/PlScrollArea.js +1 -0
- package/dist/components/scroll-area/index.d.ts +2 -0
- package/dist/components/scroll-area/index.js +1 -0
- package/dist/components/scroll-zone/PlScrollZone.d.ts +9 -5
- package/dist/components/scroll-zone/PlScrollZone.js +1 -1
- package/dist/components/select/PlSelect.js +1 -1
- package/dist/components/show/PlShow.d.ts +60 -0
- package/dist/components/show/PlShow.js +1 -0
- package/dist/components/show/index.d.ts +2 -0
- package/dist/components/show/index.js +1 -0
- package/dist/components/sidebar/PlSidebar.js +1 -1
- package/dist/components/slider/PlSlider.js +1 -1
- package/dist/components/sparkline/PlSparkline.d.ts +68 -0
- package/dist/components/sparkline/PlSparkline.js +1 -0
- package/dist/components/sparkline/index.d.ts +2 -0
- package/dist/components/sparkline/index.js +1 -0
- package/dist/components/spoiler/PlSpoiler.d.ts +8 -0
- package/dist/components/spoiler/PlSpoiler.js +1 -1
- package/dist/components/stack/PlStack.d.ts +114 -0
- package/dist/components/stack/PlStack.js +1 -0
- package/dist/components/stack/index.d.ts +2 -0
- package/dist/components/stack/index.js +1 -0
- package/dist/components/stepper/PlStepper.d.ts +2 -2
- package/dist/components/stepper/PlStepper.js +1 -1
- package/dist/components/table/PlTable.js +1 -1
- package/dist/components/tabs/PlTabs.d.ts +2 -2
- package/dist/components/tabs/PlTabs.js +1 -1
- package/dist/components/text-link/PlTextLink.js +1 -1
- package/dist/components/timeline/PlTimeline.d.ts +2 -2
- package/dist/components/timeline/PlTimeline.js +1 -1
- package/dist/components/timeline-chart/PlTimelineChart.d.ts +44 -0
- package/dist/components/timeline-chart/PlTimelineChart.js +1 -0
- package/dist/components/timeline-chart/index.d.ts +2 -0
- package/dist/components/timeline-chart/index.js +1 -0
- package/dist/components/toast/PlToast.d.ts +1 -1
- package/dist/components/toast/PlToast.js +1 -1
- package/dist/components/toggle/PlToggle.js +1 -1
- package/dist/components/toggle/PlToggleGroup.js +1 -1
- package/dist/components/tour/PlTour.d.ts +134 -0
- package/dist/components/tour/PlTour.js +1 -0
- package/dist/components/tour/index.d.ts +2 -0
- package/dist/components/tour/index.js +1 -0
- package/dist/components/transfer/PlTransfer.js +1 -1
- package/dist/components/tree/PlTree.js +1 -1
- package/dist/components/tree-select/PlTreeSelect.d.ts +99 -0
- package/dist/components/tree-select/PlTreeSelect.js +1 -0
- package/dist/components/tree-select/index.d.ts +2 -0
- package/dist/components/tree-select/index.js +1 -0
- package/dist/components/window-pane/PlWindowPane.d.ts +179 -0
- package/dist/components/window-pane/PlWindowPane.js +1 -0
- package/dist/components/window-pane/index.d.ts +2 -0
- package/dist/components/window-pane/index.js +1 -0
- package/dist/css/anchor.css +2 -0
- package/dist/css/animate-counter.css +2 -0
- package/dist/css/animate-float.css +2 -0
- package/dist/css/animate-reveal.css +2 -0
- package/dist/css/animate-scramble.css +2 -0
- package/dist/css/animate-shake.css +2 -0
- package/dist/css/animate-split.css +2 -0
- package/dist/css/app-logo.css +2 -0
- package/dist/css/area-chart.css +2 -0
- package/dist/css/bar-chart.css +2 -0
- package/dist/css/code-block.css +2 -0
- package/dist/css/data-list.css +2 -0
- package/dist/css/data-table.css +2 -0
- package/dist/css/flex.css +2 -0
- package/dist/css/floating-action-button.css +2 -0
- package/dist/css/gallery.css +2 -0
- package/dist/css/gauge-chart.css +2 -0
- package/dist/css/heatmap-chart.css +2 -0
- package/dist/css/hover-card.css +2 -0
- package/dist/css/how-to-steps.css +2 -0
- package/dist/css/line-chart.css +2 -0
- package/dist/css/meter.css +2 -0
- package/dist/css/mockup.css +2 -0
- package/dist/css/pie-chart.css +2 -0
- package/dist/css/portal.css +2 -0
- package/dist/css/scatter-chart.css +2 -0
- package/dist/css/scroll-area.css +2 -0
- package/dist/css/show.css +2 -0
- package/dist/css/sparkline.css +2 -0
- package/dist/css/stack.css +2 -0
- package/dist/css/timeline-chart.css +2 -0
- package/dist/css/tour.css +2 -0
- package/dist/css/tree-select.css +2 -0
- package/dist/css/window-pane.css +2 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/usePlBreakpoint.d.ts +3 -0
- package/dist/hooks/usePlBreakpoint.js +1 -1
- package/dist/hooks/usePlDisclosure.d.ts +44 -0
- package/dist/hooks/usePlDisclosure.js +1 -0
- package/dist/hooks/usePlElementSize.d.ts +31 -0
- package/dist/hooks/usePlElementSize.js +1 -0
- package/dist/hooks/usePlOnScreen.d.ts +50 -0
- package/dist/hooks/usePlOnScreen.js +1 -0
- package/dist/index.d.ts +34 -1
- package/dist/index.js +1 -1
- package/dist/internal/animate.d.ts +91 -5
- package/dist/internal/animate.js +1 -1
- package/dist/internal/breakpoints.d.ts +31 -0
- package/dist/internal/breakpoints.js +1 -0
- package/dist/internal/button-group.d.ts +29 -2
- package/dist/internal/button-group.js +2 -2
- package/dist/internal/calendar.d.ts +11 -36
- package/dist/internal/calendar.js +1 -1
- package/dist/internal/chart-frame.d.ts +458 -0
- package/dist/internal/chart-frame.js +1 -0
- package/dist/internal/chart-line.d.ts +44 -0
- package/dist/internal/chart-line.js +1 -0
- package/dist/internal/chart.d.ts +473 -0
- package/dist/internal/chart.js +1 -0
- package/dist/internal/data-table.d.ts +69 -0
- package/dist/internal/data-table.js +1 -0
- package/dist/internal/defaults.d.ts +8 -3
- package/dist/internal/drag.d.ts +49 -0
- package/dist/internal/drag.js +1 -0
- package/dist/internal/format.d.ts +2 -0
- package/dist/internal/format.js +1 -1
- package/dist/internal/gallery.d.ts +34 -0
- package/dist/internal/gallery.js +1 -0
- package/dist/internal/grid.d.ts +6 -27
- package/dist/internal/grid.js +1 -1
- package/dist/internal/highlight.d.ts +98 -0
- package/dist/internal/highlight.js +1 -0
- package/dist/internal/icons.d.ts +10 -0
- package/dist/internal/icons.js +1 -1
- package/dist/internal/labels.d.ts +138 -0
- package/dist/internal/labels.js +1 -0
- package/dist/internal/mockup.d.ts +193 -0
- package/dist/internal/mockup.js +1 -0
- package/dist/internal/page-layout.js +1 -1
- package/dist/internal/progress.d.ts +6 -0
- package/dist/internal/responsive.d.ts +108 -0
- package/dist/internal/responsive.js +1 -0
- package/dist/internal/scramble.d.ts +31 -0
- package/dist/internal/scramble.js +1 -0
- package/dist/internal/styles.d.ts +15 -0
- package/dist/internal/styles.js +1 -1
- package/dist/internal/table.d.ts +86 -0
- package/dist/internal/table.js +1 -0
- package/dist/internal/threshold.d.ts +19 -0
- package/dist/internal/threshold.js +1 -0
- package/dist/internal/tour.d.ts +42 -0
- package/dist/internal/tour.js +1 -0
- package/dist/internal/window.d.ts +201 -0
- package/dist/internal/window.js +1 -0
- package/dist/locales/de.d.ts +3 -0
- package/dist/locales/de.js +1 -0
- package/dist/locales/en.d.ts +2 -0
- package/dist/locales/en.js +1 -0
- package/dist/locales/es.d.ts +3 -0
- package/dist/locales/es.js +1 -0
- package/dist/locales/fr.d.ts +3 -0
- package/dist/locales/fr.js +1 -0
- package/dist/locales/index.d.ts +33 -0
- package/dist/locales/index.js +1 -0
- package/dist/locales/ja.d.ts +3 -0
- package/dist/locales/ja.js +1 -0
- package/dist/locales/ko.d.ts +3 -0
- package/dist/locales/ko.js +1 -0
- package/dist/locales/zh-Hans.d.ts +3 -0
- package/dist/locales/zh-Hans.js +1 -0
- package/dist/provider/index.d.ts +1 -0
- package/dist/provider/index.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +1104 -19
- package/dist/tokens.css +1104 -19
- package/dist/types.d.ts +381 -2
- package/package.json +14 -4
- package/dist/components/avatar-group/PlAvatarGroup.d.ts +0 -47
- package/dist/components/avatar-group/PlAvatarGroup.js +0 -1
- package/dist/components/avatar-group/index.d.ts +0 -2
- package/dist/components/avatar-group/index.js +0 -1
- package/dist/css/avatar-group.css +0 -2
- package/dist/internal/avatar-group.d.ts +0 -25
- package/dist/internal/avatar-group.js +0 -2
package/dist/types.d.ts
CHANGED
|
@@ -60,6 +60,15 @@ export type PlassWeekday = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
|
60
60
|
* utility change at the same moment.
|
|
61
61
|
*/
|
|
62
62
|
export type PlassBreakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
63
|
+
/**
|
|
64
|
+
* Every rung but `xs`, which is the one with nothing below it.
|
|
65
|
+
*
|
|
66
|
+
* The type of a question about a *floor* — "from here up", "below here". `xs`
|
|
67
|
+
* has no floor to ask about: everything is at or above it, so `from="xs"` would
|
|
68
|
+
* mean "always" and `until="xs"` would mean "never", and a prop with two values
|
|
69
|
+
* that do nothing is a prop that invites them.
|
|
70
|
+
*/
|
|
71
|
+
export type PlassBreakpointFloor = Exclude<PlassBreakpoint, 'xs'>;
|
|
63
72
|
/**
|
|
64
73
|
* A value that may change with the width of the window.
|
|
65
74
|
*
|
|
@@ -134,6 +143,24 @@ export type PlassVariant = 'solid' | 'glass' | 'ghost';
|
|
|
134
143
|
* rather than presses — a field, a well, a panel behind other content.
|
|
135
144
|
*/
|
|
136
145
|
export type PlassElevation = 0 | 1 | 2 | 3;
|
|
146
|
+
/**
|
|
147
|
+
* Where a band starts, and what a reading is made of from there up.
|
|
148
|
+
*
|
|
149
|
+
* Here rather than on a component because two of them read it the same way — a
|
|
150
|
+
* `PlMeter`'s bar and a `PlGaugeChart`'s arc are one idea in two shapes, and a
|
|
151
|
+
* page that moves a reading from the bar to the dial must not have to rewrite
|
|
152
|
+
* its bands to do it.
|
|
153
|
+
*/
|
|
154
|
+
export interface PlassThreshold {
|
|
155
|
+
/**
|
|
156
|
+
* The value the band begins at, in the reading's own units — not a
|
|
157
|
+
* percentage, unless the range happens to be one. A band whose `from` is
|
|
158
|
+
* outside `min`…`max` is simply never reached.
|
|
159
|
+
*/
|
|
160
|
+
from: number;
|
|
161
|
+
/** The family the reading takes while it is in this band. */
|
|
162
|
+
color: PlassColor;
|
|
163
|
+
}
|
|
137
164
|
/** Style props shared by most components; spread into their own prop types. */
|
|
138
165
|
export interface PlassStyleProps {
|
|
139
166
|
/** @default 'solid' */
|
|
@@ -212,7 +239,7 @@ export type PlassColorSlot = 'accent' | 'fill' | 'line' | 'line-hover' | 'on-sol
|
|
|
212
239
|
* sets one is setting the answer rather than the question. `color`, `variant`
|
|
213
240
|
* and `elevation` are the props that decide them.
|
|
214
241
|
*/
|
|
215
|
-
export type PlassToken = `--plass-${PlassColor}-${PlassColorSlot}` | `--plass-radius-${PlassSize}` | `--plass-shadow-${0 | 1 | 2 | 3 | 4}` | '--plass-shadow-ambient' | '--plass-bg-from' | '--plass-bg-to' | '--plass-blur' | '--plass-border' | '--plass-divider' | '--plass-duration' | '--plass-duration-slow' | '--plass-ease' | '--plass-fg' | '--plass-flash-on-fill' | '--plass-glass' | '--plass-glass-hover' | '--plass-glass-line' | '--plass-glass-press' | '--plass-gloss-glass' | '--plass-glow-angle' | '--plass-glow-on-fill' | '--plass-muted-fg' | '--plass-scrim' | '--plass-stripe' | '--plass-surface' | '--plass-tint-strength' | '--plass-track' | '--plass-well' | '--plass-z-portal';
|
|
242
|
+
export type PlassToken = `--plass-${PlassColor}-${PlassColorSlot}` | `--plass-radius-${PlassSize}` | `--plass-shadow-${0 | 1 | 2 | 3 | 4}` | `--plass-chart-${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8}` | `--plass-chart-seq-${1 | 2 | 3 | 4 | 5}` | `--plass-chart-div-${1 | 2 | 3 | 4 | 5}` | `--plass-chart-seq-on-${1 | 2 | 3 | 4 | 5}` | `--plass-chart-div-on-${1 | 2 | 3 | 4 | 5}` | '--plass-chart-grid' | '--plass-chart-axis' | '--plass-chart-baseline' | '--plass-chart-gap' | '--plass-shadow-ambient' | '--plass-bg-from' | '--plass-bg-to' | '--plass-blur' | '--plass-border' | '--plass-breakpoint-sm' | '--plass-breakpoint-md' | '--plass-breakpoint-lg' | '--plass-breakpoint-xl' | '--plass-divider' | '--plass-duration' | '--plass-duration-slow' | '--plass-ease' | '--plass-fg' | '--plass-flash-on-fill' | '--plass-glass' | '--plass-glass-hover' | '--plass-glass-line' | '--plass-glass-press' | '--plass-gloss-glass' | '--plass-glow-angle' | '--plass-glow-on-fill' | '--plass-muted-fg' | '--plass-scrim' | '--plass-stripe' | '--plass-surface' | '--plass-tint-strength' | '--plass-track' | '--plass-well' | '--plass-z-portal';
|
|
216
243
|
/**
|
|
217
244
|
* A set of token overrides, on its own.
|
|
218
245
|
*
|
|
@@ -246,7 +273,7 @@ declare module 'react' {
|
|
|
246
273
|
* marquee and a headline reel have to know what their children *are*, and a
|
|
247
274
|
* name that only picks a keyframe cannot.
|
|
248
275
|
*/
|
|
249
|
-
export type PlassAnimation = 'fade' | 'grow' | 'slide' | 'zoom' | 'rotate' | 'blink';
|
|
276
|
+
export type PlassAnimation = 'fade' | 'grow' | 'slide' | 'zoom' | 'rotate' | 'blink' | 'reveal';
|
|
250
277
|
/**
|
|
251
278
|
* What makes an animation run.
|
|
252
279
|
*
|
|
@@ -258,6 +285,24 @@ export type PlassAnimation = 'fade' | 'grow' | 'slide' | 'zoom' | 'rotate' | 'bl
|
|
|
258
285
|
* - `manual` — never on its own. `play` is what runs it.
|
|
259
286
|
*/
|
|
260
287
|
export type PlassAnimateTrigger = 'mount' | 'visible' | 'hover' | 'manual';
|
|
288
|
+
/**
|
|
289
|
+
* What advances an animation.
|
|
290
|
+
*
|
|
291
|
+
* - `auto` — the clock. The default, and what every effect did before this
|
|
292
|
+
* existed.
|
|
293
|
+
* - `view` — the reader's scroll position. The effect no longer *happens*; it
|
|
294
|
+
* tracks where the element sits in the scrollport, and scrolling back plays
|
|
295
|
+
* it backwards.
|
|
296
|
+
*
|
|
297
|
+
* `view` makes three of the other settings meaningless, and they are ignored
|
|
298
|
+
* rather than quietly half-working: `duration`, `delay` and `repeat` all belong
|
|
299
|
+
* to a clock, and so does the whole idea of a `trigger` — the scroll position
|
|
300
|
+
* *is* the trigger. `range` is what replaces `duration`.
|
|
301
|
+
*
|
|
302
|
+
* A browser without `animation-timeline` falls back to one clock-driven run, so
|
|
303
|
+
* the content still arrives. Degraded is allowed; blank is not.
|
|
304
|
+
*/
|
|
305
|
+
export type PlassAnimateTimeline = 'auto' | 'view';
|
|
261
306
|
/** Whether an effect brings its content in or takes it away. */
|
|
262
307
|
export type PlassAnimateMode = 'in' | 'out';
|
|
263
308
|
/**
|
|
@@ -266,6 +311,63 @@ export type PlassAnimateMode = 'in' | 'out';
|
|
|
266
311
|
* would be surprised by which one worked.
|
|
267
312
|
*/
|
|
268
313
|
export type PlassAnimateRepeat = number | 'infinite';
|
|
314
|
+
/**
|
|
315
|
+
* The three props that turn an effect on a box into the same effect on each of
|
|
316
|
+
* the things inside it.
|
|
317
|
+
*
|
|
318
|
+
* There is deliberately no `PlAnimateStagger`. A stagger is not an effect — it
|
|
319
|
+
* is a *differential*, and every one of the six single-keyframe effects can
|
|
320
|
+
* take one. A wrapper would have been a second way to spell something they can
|
|
321
|
+
* already say, and the rule against two spellings of one idea is the same rule
|
|
322
|
+
* that keeps a `Pulse` (`blink` + `alternate`) and a `Bounce` (`grow` +
|
|
323
|
+
* `alternate`) out of the library.
|
|
324
|
+
*
|
|
325
|
+
* The four effects that do **not** take these are the four that already know
|
|
326
|
+
* what their children are: a `PlAnimateMarquee` lays them down twice, a
|
|
327
|
+
* `PlAnimateHeadline` swaps between them, a `PlAnimateTyping` counts their
|
|
328
|
+
* graphemes, and a `PlAnimateLighting` keeps its motion on a pseudo-element,
|
|
329
|
+
* which there is no way to put on somebody else's child. A
|
|
330
|
+
* `PlAnimateAppear` is a *set* rather than an effect and has had its own
|
|
331
|
+
* `stagger` from the start; these are the same three props under the same
|
|
332
|
+
* names.
|
|
333
|
+
*/
|
|
334
|
+
export interface PlassAnimateStaggerProps {
|
|
335
|
+
/**
|
|
336
|
+
* Milliseconds added to each child's delay, so the children run one after
|
|
337
|
+
* another rather than together.
|
|
338
|
+
*
|
|
339
|
+
* `0` — the default — plays the **box**, which is what an effect does without
|
|
340
|
+
* this and what it should go on doing when it wraps one thing. Anything else
|
|
341
|
+
* moves the effect onto the children and takes it off the box entirely: eight
|
|
342
|
+
* children fading in under a box that is also fading in is the same content
|
|
343
|
+
* faded twice.
|
|
344
|
+
*
|
|
345
|
+
* The step is per *child*, so what is passed matters — eight children are
|
|
346
|
+
* eight steps and one child holding eight things is one step, which is also
|
|
347
|
+
* how to opt part of a set out.
|
|
348
|
+
*
|
|
349
|
+
* The animation is written onto the children themselves rather than onto
|
|
350
|
+
* wrappers, so a row of `<li>`s stays a row of `<li>`s. The cost is that a
|
|
351
|
+
* child has to accept a `className` and a `style`; one that does not is a
|
|
352
|
+
* child that will not animate.
|
|
353
|
+
* @default 0
|
|
354
|
+
*/
|
|
355
|
+
stagger?: number;
|
|
356
|
+
/**
|
|
357
|
+
* Milliseconds added to each child's duration, so later children take longer
|
|
358
|
+
* — or, negative, less long. Floored at `0`.
|
|
359
|
+
* @default 0
|
|
360
|
+
*/
|
|
361
|
+
durationStep?: number;
|
|
362
|
+
/**
|
|
363
|
+
* Runs the set from the last child to the first.
|
|
364
|
+
*
|
|
365
|
+
* The *order* turns round and nothing else: each child still plays forwards.
|
|
366
|
+
* An effect that runs backwards is `mode="out"`.
|
|
367
|
+
* @default false
|
|
368
|
+
*/
|
|
369
|
+
reverse?: boolean;
|
|
370
|
+
}
|
|
269
371
|
/**
|
|
270
372
|
* The settings every `PlAnimate*` component takes.
|
|
271
373
|
*
|
|
@@ -303,3 +405,280 @@ export interface PlassAnimateProps {
|
|
|
303
405
|
*/
|
|
304
406
|
threshold?: number;
|
|
305
407
|
}
|
|
408
|
+
/**
|
|
409
|
+
* The two props that hand an effect to the reader's scroll position.
|
|
410
|
+
*
|
|
411
|
+
* On the same six as `PlassAnimateStaggerProps` and absent from the same four,
|
|
412
|
+
* for a different reason: `animation-timeline` is a property of the element the
|
|
413
|
+
* keyframe is running on, and a marquee's motion is on a duplicated track, a
|
|
414
|
+
* typewriter's is not a keyframe at all, and a lighting's is on a
|
|
415
|
+
* pseudo-element. An endless decoration also has nothing a scroll position
|
|
416
|
+
* could advance it *to*.
|
|
417
|
+
*
|
|
418
|
+
* There is no `PlAnimateOnScroll`, for the reason there is no
|
|
419
|
+
* `PlAnimateStagger`: this changes what advances an effect, not what the effect
|
|
420
|
+
* is, so every effect can take it and none of them needs a twin.
|
|
421
|
+
*/
|
|
422
|
+
export interface PlassAnimateTimelineProps {
|
|
423
|
+
/**
|
|
424
|
+
* What advances the animation: the clock, or the reader's scroll position.
|
|
425
|
+
*
|
|
426
|
+
* `view` ignores `duration`, `delay`, `repeat` and `trigger` — all four
|
|
427
|
+
* belong to a clock, and with a scroll timeline the scroll position *is* the
|
|
428
|
+
* trigger — and runs the effect against `range` instead.
|
|
429
|
+
* @default 'auto'
|
|
430
|
+
*/
|
|
431
|
+
timeline?: PlassAnimateTimeline;
|
|
432
|
+
/**
|
|
433
|
+
* How much of the element's pass through the scrollport the effect is spread
|
|
434
|
+
* over, as CSS writes an `animation-range`. Only read when `timeline` is
|
|
435
|
+
* `view`.
|
|
436
|
+
*
|
|
437
|
+
* The default finishes while the element is still arriving rather than when
|
|
438
|
+
* it reaches the middle of the screen, which is what keeps a reader from
|
|
439
|
+
* scrolling past a half-drawn entrance.
|
|
440
|
+
* @default 'entry 0% cover 45%'
|
|
441
|
+
*/
|
|
442
|
+
range?: string;
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* Where a point sits along the category axis.
|
|
446
|
+
*
|
|
447
|
+
* A `Date` is accepted because a time series is the common case and converting
|
|
448
|
+
* one to a string at the call site is what makes two charts of the same data
|
|
449
|
+
* label their axes differently.
|
|
450
|
+
*/
|
|
451
|
+
export type PlassChartCategory = string | number | Date;
|
|
452
|
+
/**
|
|
453
|
+
* One value, with everything the chart might want to know about it.
|
|
454
|
+
*
|
|
455
|
+
* `y` of `null` is a **gap** and not a zero — a sensor that was offline, a month
|
|
456
|
+
* that has not closed yet. A line breaks across it, an area breaks with it, and
|
|
457
|
+
* a bar is not drawn. This distinction is the whole reason a datum may be
|
|
458
|
+
* `null` at all: a chart that renders missing data as zero is a chart that
|
|
459
|
+
* reports an outage as a collapse.
|
|
460
|
+
*/
|
|
461
|
+
export interface PlassChartPoint {
|
|
462
|
+
/**
|
|
463
|
+
* Its place on the category axis. Optional — without it the point is placed
|
|
464
|
+
* by its index, against `categories` if the chart was given any.
|
|
465
|
+
*/
|
|
466
|
+
x?: PlassChartCategory;
|
|
467
|
+
/** The value. `null` is a gap. */
|
|
468
|
+
y: number | null;
|
|
469
|
+
/**
|
|
470
|
+
* A second magnitude, for the marks that have one: the radius of a bubble,
|
|
471
|
+
* the weight of a tile. Ignored by the charts that do not.
|
|
472
|
+
*/
|
|
473
|
+
z?: number;
|
|
474
|
+
/**
|
|
475
|
+
* Overrides the series' colour for this one point — the slice worth pointing
|
|
476
|
+
* at, the bar that is over budget. Any CSS colour, or a `PlassColor` family.
|
|
477
|
+
*/
|
|
478
|
+
color?: string;
|
|
479
|
+
/** What the tooltip, the legend and any value label say instead of `y`. */
|
|
480
|
+
label?: React.ReactNode;
|
|
481
|
+
}
|
|
482
|
+
/** A number, a gap, or a point that says more about itself. */
|
|
483
|
+
export type PlassChartDatum = number | null | PlassChartPoint;
|
|
484
|
+
/**
|
|
485
|
+
* One line, one band of bars, one ring of slices — and the unit identity is
|
|
486
|
+
* attached to.
|
|
487
|
+
*
|
|
488
|
+
* Colour follows the series, never its position in the drawing: a chart whose
|
|
489
|
+
* legend is filtered keeps every survivor on the colour it had. That is why the
|
|
490
|
+
* slot a series takes is decided by where it sits in this array and not by how
|
|
491
|
+
* many of its neighbours are currently visible.
|
|
492
|
+
*/
|
|
493
|
+
export interface PlassChartSeries {
|
|
494
|
+
/**
|
|
495
|
+
* Its name in the legend, the tooltip and the data table. A chart with two or
|
|
496
|
+
* more series always shows a legend, so a series without a name is a series
|
|
497
|
+
* the reader cannot identify.
|
|
498
|
+
*/
|
|
499
|
+
name?: string;
|
|
500
|
+
/** The values, in category order. */
|
|
501
|
+
data: readonly PlassChartDatum[];
|
|
502
|
+
/**
|
|
503
|
+
* Overrides the palette slot this series would otherwise take. A `PlassColor`
|
|
504
|
+
* family name, or any CSS colour.
|
|
505
|
+
*
|
|
506
|
+
* This is the one place in the library where a colour is not a semantic role,
|
|
507
|
+
* and it is deliberate: a series is an *entity* — a region, a plan, a
|
|
508
|
+
* competitor — and nothing about it means success or danger. Reach for it to
|
|
509
|
+
* match a brand or to hold a colour steady across two charts, not to say how
|
|
510
|
+
* a number should be felt.
|
|
511
|
+
*/
|
|
512
|
+
color?: PlassColor | (string & {});
|
|
513
|
+
/**
|
|
514
|
+
* Starts the series hidden. Only meaningful with an interactive legend, which
|
|
515
|
+
* is what turns it back on.
|
|
516
|
+
* @default false
|
|
517
|
+
*/
|
|
518
|
+
hidden?: boolean;
|
|
519
|
+
}
|
|
520
|
+
/**
|
|
521
|
+
* One span on a [PlTimelineChart] — a stretch of time with two ends.
|
|
522
|
+
*
|
|
523
|
+
* Its own type rather than a `z2` or an `x2` bolted onto `PlassChartPoint`,
|
|
524
|
+
* because a second position on the axis is a field the other six charts would
|
|
525
|
+
* carry and never read. The trade the whole `types.ts` makes is that a name
|
|
526
|
+
* means one thing everywhere; a `PlassChartPoint` that sometimes has an end and
|
|
527
|
+
* usually does not is the opposite of that.
|
|
528
|
+
*
|
|
529
|
+
* `start` and `end` rather than `x` and `end`: a span has two places on the
|
|
530
|
+
* axis, and naming one of them `x` only reads correctly to someone who already
|
|
531
|
+
* knows which one it is.
|
|
532
|
+
*/
|
|
533
|
+
export interface PlassTimelinePoint {
|
|
534
|
+
/** When it begins. A `Date`, or a number of milliseconds. */
|
|
535
|
+
start: PlassChartCategory;
|
|
536
|
+
/** And when it is done. A span that ends before it starts is drawn either way round. */
|
|
537
|
+
end: PlassChartCategory;
|
|
538
|
+
/** What the span is called, in the tooltip and the table. */
|
|
539
|
+
label?: React.ReactNode;
|
|
540
|
+
/** Overrides its row's colour for this one span. */
|
|
541
|
+
color?: PlassColor | (string & {});
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* One row of a PlTimelineChart, and everything on it.
|
|
545
|
+
*
|
|
546
|
+
* A row is a series — one entity, one name, one colour — but its data are
|
|
547
|
+
* spans rather than values, so it cannot be a `PlassChartSeries`. There is no
|
|
548
|
+
* `hidden` here and no legend to pair it with: a Gantt's rows *are* its
|
|
549
|
+
* category axis, already named down the side, and a twenty-entry legend
|
|
550
|
+
* restating them is not a filter anyone wants.
|
|
551
|
+
*/
|
|
552
|
+
export interface PlassTimelineSeries {
|
|
553
|
+
/** Its name on the axis, in the tooltip and in the table. */
|
|
554
|
+
name?: string;
|
|
555
|
+
/** The spans on this row. Overlapping ones are drawn over each other. */
|
|
556
|
+
data: readonly PlassTimelinePoint[];
|
|
557
|
+
/** Overrides the palette slot this row would otherwise take. */
|
|
558
|
+
color?: PlassColor | (string & {});
|
|
559
|
+
}
|
|
560
|
+
/** One stretch of time on a row of a `PlTimelineChart`. */
|
|
561
|
+
export interface PlassTimelinePoint {
|
|
562
|
+
/** When it begins. A `Date`, or a number of milliseconds. */
|
|
563
|
+
start: PlassChartCategory;
|
|
564
|
+
/** And when it is done. A span that ends before it starts is drawn either way round. */
|
|
565
|
+
end: PlassChartCategory;
|
|
566
|
+
/** What the span is called, in the tooltip and the table. */
|
|
567
|
+
label?: React.ReactNode;
|
|
568
|
+
/** Overrides its row's colour for this one span. */
|
|
569
|
+
color?: PlassColor | (string & {});
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* One row of a `PlTimelineChart`, and everything on it.
|
|
573
|
+
*
|
|
574
|
+
* A row is a series — one entity, one name, one colour — but its data are spans
|
|
575
|
+
* rather than values, so it cannot be a `PlassChartSeries`. There is no
|
|
576
|
+
* `hidden` here and no legend to pair it with: the rows *are* the category
|
|
577
|
+
* axis, already named down the side, and a twenty-entry legend restating them
|
|
578
|
+
* is not a filter anyone wants.
|
|
579
|
+
*/
|
|
580
|
+
export interface PlassTimelineSeries {
|
|
581
|
+
/** Its name on the axis, in the tooltip and in the table. */
|
|
582
|
+
name?: string;
|
|
583
|
+
/** The spans on this row. Overlapping ones are moved onto lanes of their own. */
|
|
584
|
+
data: readonly PlassTimelinePoint[];
|
|
585
|
+
/** Overrides the palette slot this row would otherwise take. */
|
|
586
|
+
color?: PlassColor | (string & {});
|
|
587
|
+
}
|
|
588
|
+
/** How a line gets from one point to the next. */
|
|
589
|
+
export type PlassChartCurve = 'linear' | 'smooth' | 'step';
|
|
590
|
+
/**
|
|
591
|
+
* Which values are written onto the marks themselves.
|
|
592
|
+
*
|
|
593
|
+
* The default is `none` everywhere, and that is not timidity — a number beside
|
|
594
|
+
* every point is the most reliable way to make a chart unreadable. Label the
|
|
595
|
+
* end, or the extremes, and let the axis and the tooltip carry the rest;
|
|
596
|
+
* `'all'` is there for the eight-bar chart where it genuinely is the answer.
|
|
597
|
+
*/
|
|
598
|
+
export type PlassChartValueLabels = 'none' | 'last' | 'extremes' | 'all';
|
|
599
|
+
/**
|
|
600
|
+
* What the pointer uncovers.
|
|
601
|
+
*
|
|
602
|
+
* - `index` — every series at the category under the pointer, with a crosshair.
|
|
603
|
+
* The default on anything with a shared x axis, because the question a line
|
|
604
|
+
* chart is asked is "what happened in March", not "what is this pixel".
|
|
605
|
+
* - `item` — the one mark being pointed at.
|
|
606
|
+
* - `none` — no tooltip. The values still have to be readable some other way.
|
|
607
|
+
*/
|
|
608
|
+
export type PlassChartTooltipMode = 'index' | 'item' | 'none';
|
|
609
|
+
/** One series' answer at the category the pointer is on. */
|
|
610
|
+
export interface PlassChartTooltipItem {
|
|
611
|
+
/** Its place in the `series` array — the same index its colour came from. */
|
|
612
|
+
seriesIndex: number;
|
|
613
|
+
name?: string;
|
|
614
|
+
color: string;
|
|
615
|
+
value: number | null;
|
|
616
|
+
/** `value` run through the chart's `format`. */
|
|
617
|
+
formatted: string;
|
|
618
|
+
/** What the point called itself, if it said. */
|
|
619
|
+
label?: React.ReactNode;
|
|
620
|
+
}
|
|
621
|
+
/** What a custom tooltip is handed. */
|
|
622
|
+
export interface PlassChartTooltipContext {
|
|
623
|
+
index: number;
|
|
624
|
+
category: PlassChartCategory;
|
|
625
|
+
/** Only the series that are visible and have a value here. */
|
|
626
|
+
items: readonly PlassChartTooltipItem[];
|
|
627
|
+
}
|
|
628
|
+
/** The tooltip, when a bare `true` or `false` is not enough. */
|
|
629
|
+
export interface PlassChartTooltip {
|
|
630
|
+
/** @default 'index' */
|
|
631
|
+
mode?: PlassChartTooltipMode;
|
|
632
|
+
/**
|
|
633
|
+
* The line dropped through the plot at the active category. On in `index`
|
|
634
|
+
* mode, where it is what says which column the numbers belong to.
|
|
635
|
+
*/
|
|
636
|
+
crosshair?: boolean;
|
|
637
|
+
/** Draws the panel. Without it the chart draws its own. */
|
|
638
|
+
render?: (context: PlassChartTooltipContext) => React.ReactNode;
|
|
639
|
+
}
|
|
640
|
+
/** One axis of a cartesian chart. */
|
|
641
|
+
export interface PlassChartAxis {
|
|
642
|
+
/** Leaves the axis undrawn — its rule, its ticks and its labels. */
|
|
643
|
+
hidden?: boolean;
|
|
644
|
+
/** A name for what the axis measures, set beside it. */
|
|
645
|
+
label?: React.ReactNode;
|
|
646
|
+
/**
|
|
647
|
+
* The gridlines this axis casts across the plot. On by default for the value
|
|
648
|
+
* axis and off for the category axis, which is the only arrangement where the
|
|
649
|
+
* grid helps read a value without turning the plot into graph paper.
|
|
650
|
+
*/
|
|
651
|
+
grid?: boolean;
|
|
652
|
+
/**
|
|
653
|
+
* Where the scale starts and ends. Left out, both are taken from the data —
|
|
654
|
+
* the value axis from zero, so a bar's length stays proportional to its
|
|
655
|
+
* value. Set `min` only when zero is genuinely not the baseline.
|
|
656
|
+
*/
|
|
657
|
+
min?: number;
|
|
658
|
+
max?: number;
|
|
659
|
+
/** Roughly how many ticks. The scale still rounds to clean numbers. */
|
|
660
|
+
tickCount?: number;
|
|
661
|
+
/** How a tick is written, overriding the chart's own `format`. */
|
|
662
|
+
tickFormat?: (value: PlassChartCategory, index: number) => React.ReactNode;
|
|
663
|
+
/**
|
|
664
|
+
* How much room the axis keeps for its ticks and its label, in pixels.
|
|
665
|
+
* Measured from the ticks themselves otherwise; set it when a long category
|
|
666
|
+
* name needs more, or when two charts stacked on a dashboard have to line
|
|
667
|
+
* their plots up.
|
|
668
|
+
*/
|
|
669
|
+
thickness?: number;
|
|
670
|
+
}
|
|
671
|
+
/** Where the legend sits, and whether it does anything when clicked. */
|
|
672
|
+
export interface PlassChartLegend {
|
|
673
|
+
/** Which edge of the plot. @default 'bottom' */
|
|
674
|
+
side?: PlassSide;
|
|
675
|
+
/** Where along that edge. @default 'center' */
|
|
676
|
+
align?: PlassAlign;
|
|
677
|
+
/**
|
|
678
|
+
* Clicking an entry hides and shows its series; hovering one dims the rest.
|
|
679
|
+
* @default true
|
|
680
|
+
*/
|
|
681
|
+
interactive?: boolean;
|
|
682
|
+
/** Draws each series' current value beside its name. @default false */
|
|
683
|
+
showValue?: boolean;
|
|
684
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "plass-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "A React UI component library made of glass and gradients — smooth tinted surfaces, shadows in their own colour, and light that follows the pointer. Accessible and themeable, ESM only, types included, dark mode built in.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,14 +19,15 @@
|
|
|
19
19
|
"url": "https://github.com/jooy2/plass-ui/issues"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
|
-
"build": "npm run format:fix && tsc --project tsconfig.prod.json && node scripts/minify.mjs && node scripts/build-styles.mjs",
|
|
22
|
+
"build": "npm run format:fix && npm run clean && tsc --project tsconfig.prod.json && node scripts/minify.mjs && node scripts/build-styles.mjs",
|
|
23
|
+
"clean": "node scripts/clean.mjs",
|
|
23
24
|
"lint": "eslint . --report-unused-disable-directives",
|
|
24
25
|
"lint:fix": "eslint . --report-unused-disable-directives --fix",
|
|
25
26
|
"prepare": "npm run build",
|
|
26
27
|
"size": "node scripts/size.mjs",
|
|
27
28
|
"format": "prettier .",
|
|
28
29
|
"format:fix": "prettier . --write",
|
|
29
|
-
"test": "
|
|
30
|
+
"test": "node scripts/test.mjs",
|
|
30
31
|
"test:watch": "vitest",
|
|
31
32
|
"typecheck": "tsc --project tsconfig.prod.json --noEmit && tsc --project test/tsconfig.json"
|
|
32
33
|
},
|
|
@@ -50,6 +51,11 @@
|
|
|
50
51
|
"module": "./dist/hooks/index.js",
|
|
51
52
|
"default": "./dist/hooks/index.js"
|
|
52
53
|
},
|
|
54
|
+
"./locales": {
|
|
55
|
+
"types": "./dist/locales/index.d.ts",
|
|
56
|
+
"module": "./dist/locales/index.js",
|
|
57
|
+
"default": "./dist/locales/index.js"
|
|
58
|
+
},
|
|
53
59
|
"./provider": {
|
|
54
60
|
"types": "./dist/provider/index.d.ts",
|
|
55
61
|
"module": "./dist/provider/index.js",
|
|
@@ -74,6 +80,9 @@
|
|
|
74
80
|
"hooks": [
|
|
75
81
|
"dist/hooks/index.d.ts"
|
|
76
82
|
],
|
|
83
|
+
"locales": [
|
|
84
|
+
"dist/locales/index.d.ts"
|
|
85
|
+
],
|
|
77
86
|
"provider": [
|
|
78
87
|
"dist/provider/index.d.ts"
|
|
79
88
|
],
|
|
@@ -148,7 +157,8 @@
|
|
|
148
157
|
"vitest-browser-react": "^2.2.0"
|
|
149
158
|
},
|
|
150
159
|
"dependencies": {
|
|
151
|
-
"@base-ui/react": "^1.7.0"
|
|
160
|
+
"@base-ui/react": "^1.7.0",
|
|
161
|
+
"highlight.js": "^11.11.1"
|
|
152
162
|
},
|
|
153
163
|
"peerDependencies": {
|
|
154
164
|
"@types/react": "^18.0.0 || ^19.0.0",
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { type PlAvatarShape } from '../avatar/PlAvatar.js';
|
|
3
|
-
import type { PlassColor, PlassElevation, PlassSize, PlassVariant } from '../../types.js';
|
|
4
|
-
export interface PlAvatarGroupProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color'> {
|
|
5
|
-
/**
|
|
6
|
-
* How many avatars are drawn before the rest become a count. Left out, every
|
|
7
|
-
* one of them is drawn.
|
|
8
|
-
*/
|
|
9
|
-
max?: number;
|
|
10
|
-
/**
|
|
11
|
-
* How many there are altogether, when the group was handed only the first
|
|
12
|
-
* few. Without it the count is worked out from the children, which is right
|
|
13
|
-
* only when all of them were passed.
|
|
14
|
-
*/
|
|
15
|
-
total?: number;
|
|
16
|
-
/**
|
|
17
|
-
* How far each avatar sits under the one before it — a number of pixels or
|
|
18
|
-
* any CSS length. Left out it is a fraction of `size`, which keeps the
|
|
19
|
-
* overlap looking the same at every step.
|
|
20
|
-
*/
|
|
21
|
-
overlap?: number | string;
|
|
22
|
-
/** Passed to every avatar in the group. @default 'md' */
|
|
23
|
-
size?: PlassSize;
|
|
24
|
-
/** Passed to every avatar in the group. @default 'circle' */
|
|
25
|
-
shape?: PlAvatarShape;
|
|
26
|
-
/** Passed to every avatar in the group. @default 'ghost' */
|
|
27
|
-
variant?: PlassVariant;
|
|
28
|
-
/** Passed to every avatar in the group. @default 'primary' */
|
|
29
|
-
color?: PlassColor;
|
|
30
|
-
/** Passed to every avatar in the group. @default 0 */
|
|
31
|
-
elevation?: PlassElevation;
|
|
32
|
-
/** The avatars. */
|
|
33
|
-
children?: React.ReactNode;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* A stack of avatars, overlapping, with the ones that did not fit as a count.
|
|
37
|
-
*
|
|
38
|
-
* `size`, `shape`, `variant`, `color` and `elevation` are set once here rather
|
|
39
|
-
* than on every avatar — a stack whose fourth face is a size out is not a stack
|
|
40
|
-
* — and an avatar's own prop still wins, which is what lets one of them be
|
|
41
|
-
* marked out from the rest.
|
|
42
|
-
*
|
|
43
|
-
* The order is the DOM order, and each face overlaps the one before it — so the
|
|
44
|
-
* last avatar in the list is the one in front, and the `+n` sits over all of
|
|
45
|
-
* them.
|
|
46
|
-
*/
|
|
47
|
-
export declare const PlAvatarGroup: React.ForwardRefExoticComponent<PlAvatarGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{jsx as r,jsxs as e}from"react/jsx-runtime";import*as a from"react";import{useDefaults as t}from"../../internal/defaults.js";import{PlAvatar as i}from"../avatar/PlAvatar.js";import{AvatarGroupContext as l}from"../../internal/avatar-group.js";import{cx as s,toLength as o}from"../../internal/styles.js";const n={xs:"0.5rem",sm:"0.625rem",md:"0.875rem",lg:"1rem",xl:"1.25rem"};export const PlAvatarGroup=/* @__PURE__ */a.forwardRef(function PlAvatarGroup({max:m,total:c,overlap:p,size:v,shape:f="circle",variant:d="ghost",color:h,elevation:u=0,className:x,style:g,children:j,...y},A){const P=t(),z=v??P.size??"md",M=h??P.color??"primary",G=a.useMemo(()=>({size:z,shape:f,variant:d,color:M,elevation:u}),[z,f,d,M,u]),N=a.Children.toArray(j),w=void 0===m?N:N.slice(0,Math.max(0,m)),C=c??N.length,R=Math.max(0,C-w.length);return r(l.Provider,{value:G,children:e("div",{ref:A,className:s("isolate inline-flex items-center","[&>*:not(:first-child)]:[margin-inline-start:calc(var(--p-overlap)*-1)]","[&>*]:ring-2 [&>*]:ring-(--plass-surface)",x??""),style:{"--p-overlap":void 0===p?n[z]:o(p),...g},...y,children:[w,R>0?r(i,{initials:`+${R}`}):null]})})});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{PlAvatarGroup}from"./PlAvatarGroup.js";
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* What a `PlAvatar` inherits from the `PlAvatarGroup` around it.
|
|
3
|
-
*
|
|
4
|
-
* `button-group.ts`'s arrangement, one component over and for the same two
|
|
5
|
-
* reasons. Cloning the children with `React.cloneElement` stops working the
|
|
6
|
-
* moment a caller wraps one of them in a `PlTooltip`, a `<Fragment>` or a
|
|
7
|
-
* `.map()` — which is most of the time — and a context reaches the avatar
|
|
8
|
-
* wherever it ended up. And it lives here rather than beside the group so that
|
|
9
|
-
* `PlAvatar` can read it without the two components importing each other.
|
|
10
|
-
*
|
|
11
|
-
* Every field is optional, and every one of them means *not specified* rather
|
|
12
|
-
* than a value: an avatar falls back to its own default, so a group with no
|
|
13
|
-
* props of its own changes nothing except the overlap.
|
|
14
|
-
*/
|
|
15
|
-
import * as React from 'react';
|
|
16
|
-
import type { PlAvatarShape } from '../components/avatar/PlAvatar.js';
|
|
17
|
-
import type { PlassColor, PlassElevation, PlassSize, PlassVariant } from '../types.js';
|
|
18
|
-
export interface PlassAvatarGroupContextValue {
|
|
19
|
-
size?: PlassSize;
|
|
20
|
-
shape?: PlAvatarShape;
|
|
21
|
-
variant?: PlassVariant;
|
|
22
|
-
color?: PlassColor;
|
|
23
|
-
elevation?: PlassElevation;
|
|
24
|
-
}
|
|
25
|
-
export declare const AvatarGroupContext: React.Context<PlassAvatarGroupContextValue | null>;
|