plass-ui 1.6.0 → 1.7.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 +276 -0
- package/README.md +3 -1
- package/dist/components/accordion/PlAccordion.d.ts +13 -0
- 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/animate-headline/PlAnimateHeadline.d.ts +10 -1
- package/dist/components/animate-marquee/PlAnimateMarquee.d.ts +8 -1
- package/dist/components/animate-marquee/PlAnimateMarquee.js +1 -1
- 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.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 +7 -4
- 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/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/drawer/PlDrawer.js +1 -1
- package/dist/components/fieldset/PlFieldset.js +1 -1
- package/dist/components/file-picker/PlFilePicker.d.ts +3 -1
- package/dist/components/file-picker/PlFilePicker.js +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.js +1 -1
- package/dist/components/footer/PlFooter.d.ts +3 -1
- package/dist/components/gallery/PlGallery.js +1 -1
- 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.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/line-chart/PlLineChart.d.ts +32 -6
- package/dist/components/line-chart/PlLineChart.js +1 -1
- package/dist/components/menu/PlMenu.js +1 -1
- package/dist/components/mockup/PlMockup.d.ts +5 -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 +4 -3
- 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.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.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/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.js +1 -1
- package/dist/components/slider/PlSlider.js +1 -1
- package/dist/components/sparkline/PlSparkline.js +1 -1
- 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/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.js +1 -1
- package/dist/components/window-pane/PlWindowPane.d.ts +13 -3
- package/dist/components/window-pane/PlWindowPane.js +1 -1
- 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 +88 -10
- 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/defaults.d.ts +2 -2
- package/dist/internal/focusable.d.ts +10 -0
- package/dist/internal/focusable.js +1 -1
- package/dist/internal/form.d.ts +29 -0
- package/dist/internal/form.js +1 -1
- package/dist/internal/glow.d.ts +32 -1
- package/dist/internal/glow.js +1 -1
- package/dist/internal/icons.d.ts +24 -0
- package/dist/internal/icons.js +1 -1
- package/dist/internal/labels.d.ts +22 -0
- package/dist/internal/labels.js +1 -1
- package/dist/internal/loading.d.ts +13 -0
- package/dist/internal/loading.js +1 -0
- 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/picker.d.ts +8 -2
- package/dist/internal/picker.js +1 -1
- package/dist/internal/progress.d.ts +17 -6
- package/dist/internal/progress.js +1 -1
- package/dist/internal/sizer.d.ts +12 -11
- 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 +114 -8
- 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/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 +406 -42
- package/dist/tokens.css +406 -42
- package/dist/types.d.ts +217 -13
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -147,6 +147,19 @@ export type PlassCorner = 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end
|
|
|
147
147
|
* it. The label stops being a line of the form and becomes part of the field,
|
|
148
148
|
* which buys back a row of vertical space and ties the name to the box rather
|
|
149
149
|
* than to whatever is above it.
|
|
150
|
+
* - `float` — inside the control, where its value would be written, while the
|
|
151
|
+
* control is empty and nothing in it has the focus; it rises into the notch
|
|
152
|
+
* the moment either stops being true, and comes back down when both are true
|
|
153
|
+
* again. At rest it is set as the placeholder it stands in for is — the
|
|
154
|
+
* control's text size, the regular weight and the muted ink — and the
|
|
155
|
+
* placeholder waits until the label has risen.
|
|
156
|
+
*
|
|
157
|
+
* A `float` label moves on its position, its font size and its weight and
|
|
158
|
+
* never on a `transform`: it is set again at every size on the way, so no
|
|
159
|
+
* frame of it is a scaled picture of the word. A control that draws something at its start —
|
|
160
|
+
* a `startIcon`, a picker's glyph, a number field's split steppers — keeps a
|
|
161
|
+
* `float` label in the notch, because the place it would rest is taken, and so
|
|
162
|
+
* does a `PlFilePicker`, whose box has words of its own there.
|
|
150
163
|
*
|
|
151
164
|
* The cut is a real one — a `<legend>` in a `<fieldset>`, which is the only way
|
|
152
165
|
* to take a segment out of a border without knowing what is behind it. Nothing
|
|
@@ -176,7 +189,7 @@ export type PlassCorner = 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end
|
|
|
176
189
|
* lying across the two after it, which is worse than the label above the row
|
|
177
190
|
* that it keeps.
|
|
178
191
|
*/
|
|
179
|
-
export type PlassFieldLabelPlacement = 'top' | 'notch';
|
|
192
|
+
export type PlassFieldLabelPlacement = 'top' | 'notch' | 'float';
|
|
180
193
|
/**
|
|
181
194
|
* What a surface is made of. This is the library's own name, and the two
|
|
182
195
|
* materials in it are the whole design language.
|
|
@@ -300,7 +313,7 @@ export type PlassColorSlot = 'accent' | 'fill' | 'line' | 'line-hover' | 'on-sol
|
|
|
300
313
|
* sets one is setting the answer rather than the question. `color`, `variant`
|
|
301
314
|
* and `elevation` are the props that decide them.
|
|
302
315
|
*/
|
|
303
|
-
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';
|
|
316
|
+
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-bottom-navigation-height' | '--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-field-strength' | '--plass-glow-on-fill' | '--plass-muted-fg' | '--plass-scrim' | '--plass-stripe' | '--plass-surface' | '--plass-tint-strength' | '--plass-track' | '--plass-well' | '--plass-z-portal';
|
|
304
317
|
/**
|
|
305
318
|
* A set of token overrides, on its own.
|
|
306
319
|
*
|
|
@@ -558,6 +571,17 @@ export interface PlassChartSeries {
|
|
|
558
571
|
* the reader cannot identify.
|
|
559
572
|
*/
|
|
560
573
|
name?: string;
|
|
574
|
+
/**
|
|
575
|
+
* What the chart knows it by from one render to the next, for a series whose
|
|
576
|
+
* name is not enough: one that shares its name with another, or one whose
|
|
577
|
+
* name changes.
|
|
578
|
+
*
|
|
579
|
+
* Its legend entry, whether the legend has it switched off, the pointer
|
|
580
|
+
* resting on that entry and a mark of it being read are held by it. Without
|
|
581
|
+
* one, a series is known by its name and how many series before it have that
|
|
582
|
+
* name, or by its place in the array when it has no name.
|
|
583
|
+
*/
|
|
584
|
+
id?: string;
|
|
561
585
|
/** The values, in category order. */
|
|
562
586
|
data: readonly PlassChartDatum[];
|
|
563
587
|
/**
|
|
@@ -582,7 +606,8 @@ export interface PlassChartSeries {
|
|
|
582
606
|
*
|
|
583
607
|
* Only a line has a line to dash, so it does nothing on a bar, and nothing on
|
|
584
608
|
* a stacked area either, where the band's fill *is* the mark and there is no
|
|
585
|
-
* stroke along its top.
|
|
609
|
+
* stroke along its top. Where the line is dashed, its legend entry is a short
|
|
610
|
+
* dashed rule rather than a square.
|
|
586
611
|
* @default false
|
|
587
612
|
*/
|
|
588
613
|
dashed?: boolean;
|
|
@@ -629,6 +654,27 @@ export interface PlassTimelineSeries {
|
|
|
629
654
|
}
|
|
630
655
|
/** How a line gets from one point to the next. */
|
|
631
656
|
export type PlassChartCurve = 'linear' | 'smooth' | 'step';
|
|
657
|
+
/**
|
|
658
|
+
* What a gap in a series does to the line drawn through it.
|
|
659
|
+
*
|
|
660
|
+
* A `null` in the data means *nothing was measured*, which is a different claim
|
|
661
|
+
* from *nothing happened*, and the three answers here are the three ways a
|
|
662
|
+
* chart can respond to it. Picking the wrong one is how a chart comes to say
|
|
663
|
+
* something the data did not.
|
|
664
|
+
*
|
|
665
|
+
* - `gap` — the line stops at the last reading and starts again at the next
|
|
666
|
+
* one. The default, and the only answer that adds nothing: the blank says the
|
|
667
|
+
* month is missing, which is what the data says.
|
|
668
|
+
* - `connect` — the two sides are joined by one straight segment. Right when the
|
|
669
|
+
* gap is an artefact of how the data was collected — a sensor that missed a
|
|
670
|
+
* reading, a day the export skipped — and wrong otherwise, because the line
|
|
671
|
+
* between the two ends is a number the chart made up.
|
|
672
|
+
* - `zero` — the gap is read as a zero, on the axis, in the tooltip and in the
|
|
673
|
+
* table as well as under the line. Right when a missing row genuinely means
|
|
674
|
+
* none: no orders that day, no errors that hour. It moves the scale, which is
|
|
675
|
+
* the point — a zero is a value, and it has to be somewhere on the axis.
|
|
676
|
+
*/
|
|
677
|
+
export type PlassChartNulls = 'gap' | 'connect' | 'zero';
|
|
632
678
|
/**
|
|
633
679
|
* Which values are written onto the marks themselves.
|
|
634
680
|
*
|
|
@@ -639,19 +685,56 @@ export type PlassChartCurve = 'linear' | 'smooth' | 'step';
|
|
|
639
685
|
*/
|
|
640
686
|
export type PlassChartValueLabels = 'none' | 'last' | 'extremes' | 'all';
|
|
641
687
|
/**
|
|
642
|
-
* What the
|
|
643
|
-
*
|
|
644
|
-
* - `
|
|
645
|
-
* The default
|
|
646
|
-
*
|
|
647
|
-
* - `
|
|
648
|
-
*
|
|
649
|
-
|
|
650
|
-
|
|
688
|
+
* What colour the numbers written on the marks are.
|
|
689
|
+
*
|
|
690
|
+
* - `series` — each label in the colour of the line or the bar it is sitting
|
|
691
|
+
* on. The default: a plot with four labelled series says which number belongs
|
|
692
|
+
* to which mark without the reader tracing it back.
|
|
693
|
+
* - `ink` — the page's own foreground, for every label. The palette clears 4:1
|
|
694
|
+
* against the sheet, which is the floor a chart *mark* is held to rather than
|
|
695
|
+
* the 4.5:1 body text wants, so this is the answer for a chart whose labels
|
|
696
|
+
* have to meet the text contrast rule on their own.
|
|
697
|
+
*/
|
|
698
|
+
export type PlassChartLabelColor = 'series' | 'ink';
|
|
699
|
+
/**
|
|
700
|
+
* Which way a chart's categories are put in order.
|
|
701
|
+
*
|
|
702
|
+
* A bar chart is the one shape whose categories can be shuffled without losing
|
|
703
|
+
* anything — that is the test for reaching for it over a line chart — so
|
|
704
|
+
* sorting them is free, and it is what turns a wall of bars into a ranking a
|
|
705
|
+
* reader can scan down. `none` leaves them in the order they were given, which
|
|
706
|
+
* is right wherever that order already means something: months, sizes, a
|
|
707
|
+
* funnel's steps.
|
|
708
|
+
*/
|
|
709
|
+
export type PlassChartSort = 'none' | 'ascending' | 'descending';
|
|
710
|
+
/**
|
|
711
|
+
* How much of a chart a pointer summons.
|
|
712
|
+
*
|
|
713
|
+
* - `index` — every series at the category the pointer is over, with a
|
|
714
|
+
* crosshair down the column to say which one that is. The default on a chart
|
|
715
|
+
* whose marks sit in a grid, and the right answer when the reader is
|
|
716
|
+
* comparing series *at* a moment.
|
|
717
|
+
* - `item` — the same column narrowed to the one series the pointer is nearest
|
|
718
|
+
* along the value axis. For a plot with more series than a panel can hold.
|
|
719
|
+
* - `nearest` — the one **mark** the pointer is nearest, measured in both
|
|
720
|
+
* directions rather than down a column. It is what a scatter has always done,
|
|
721
|
+
* and on a line or an area it is the answer when two series cross and the
|
|
722
|
+
* reader is pointing at one of them rather than at the month they share.
|
|
723
|
+
* There is no crosshair with it: a crosshair says "these numbers all belong
|
|
724
|
+
* to this column", and there is no column. It measures to the mark, which on
|
|
725
|
+
* a bar is the bar's data end.
|
|
726
|
+
* - `none` — no tooltip at all. The table under the chart still has every
|
|
727
|
+
* number.
|
|
728
|
+
*/
|
|
729
|
+
export type PlassChartTooltipMode = 'index' | 'item' | 'nearest' | 'none';
|
|
651
730
|
/** One series' answer at the category the pointer is on. */
|
|
652
731
|
export interface PlassChartTooltipItem {
|
|
653
732
|
/** Its place in the `series` array — the same index its colour came from. */
|
|
654
733
|
seriesIndex: number;
|
|
734
|
+
/**
|
|
735
|
+
* The series' name. On a `PlTimelineChart`, whose `category` is the row, it
|
|
736
|
+
* is the span's own `label` in words, and absent for a span with none.
|
|
737
|
+
*/
|
|
655
738
|
name?: string;
|
|
656
739
|
color: string;
|
|
657
740
|
value: number | null;
|
|
@@ -700,8 +783,69 @@ export interface PlassChartAxis {
|
|
|
700
783
|
max?: number;
|
|
701
784
|
/** Roughly how many ticks. The scale still rounds to clean numbers. */
|
|
702
785
|
tickCount?: number;
|
|
703
|
-
/**
|
|
786
|
+
/**
|
|
787
|
+
* Whether the axis steps by adding or by multiplying.
|
|
788
|
+
*
|
|
789
|
+
* `log` is the one scale in the library that changes what a distance on the
|
|
790
|
+
* plot means: the same length becomes the same **ratio** rather than the same
|
|
791
|
+
* number of units, so the gap from 10 to 100 is the gap from 100 to 1,000.
|
|
792
|
+
* It is the only way a series that runs from 3 to 3,000,000 can be drawn with
|
|
793
|
+
* the small end still legible, and it has to be labelled as what it is — a
|
|
794
|
+
* reader who takes it for linear reads every shape on it wrong.
|
|
795
|
+
*
|
|
796
|
+
* There is no zero on it, and nothing below one either. An axis whose data
|
|
797
|
+
* reaches either floors at the smallest positive power of ten it needs, or
|
|
798
|
+
* three decades under the top when the data offers none, and those values are
|
|
799
|
+
* drawn on that floor. A bar is the wrong mark for it for the same reason a
|
|
800
|
+
* bar's axis cannot be cropped: what a bar encodes is a length, and on a log
|
|
801
|
+
* axis a bar twice as long is not twice as much.
|
|
802
|
+
*
|
|
803
|
+
* Read on the **value** axis, and on a category axis only where that axis is
|
|
804
|
+
* a second value axis — a `PlScatterChart`'s. A band of categories has no
|
|
805
|
+
* arithmetic to do, and a time axis has its own.
|
|
806
|
+
* @default 'linear'
|
|
807
|
+
*/
|
|
808
|
+
scale?: 'linear' | 'log';
|
|
809
|
+
/**
|
|
810
|
+
* How a tick is written, overriding the chart's own `format`.
|
|
811
|
+
*
|
|
812
|
+
* An element it returns is written as the words in it, so `<b>12</b>` puts
|
|
813
|
+
* `12` on the axis: a tick is SVG text, which holds words and no markup.
|
|
814
|
+
*/
|
|
704
815
|
tickFormat?: (value: PlassChartCategory, index: number) => React.ReactNode;
|
|
816
|
+
/**
|
|
817
|
+
* Turns the labels, in degrees, so long names fit without being cut.
|
|
818
|
+
*
|
|
819
|
+
* An axis runs out of room across and not down, so a name wider than its slot
|
|
820
|
+
* is cut to it — and past about four characters a cut stops telling two names
|
|
821
|
+
* apart, which is when this is the answer instead. A turned label takes one
|
|
822
|
+
* line of text across the axis however long it is, and spends the room under
|
|
823
|
+
* the plot, where a chart usually has some.
|
|
824
|
+
*
|
|
825
|
+
* `-45` is the one to reach for: it reads at a glance, and the negative sign
|
|
826
|
+
* runs the text up towards the right, the way every chart that does this
|
|
827
|
+
* draws it. `-90` stands it on end, which fits the most labels in the least
|
|
828
|
+
* width and is the one that has to be read with a tilted head. A positive
|
|
829
|
+
* angle leans the other way, down to the right.
|
|
830
|
+
*
|
|
831
|
+
* `'auto'` asks the axis: it stays upright while every name fits its slot,
|
|
832
|
+
* and turns to `-45` as soon as one of them would be cut. Upright is the best
|
|
833
|
+
* an axis can do when there is room for it, and a diagonal beats a cut at
|
|
834
|
+
* every width — so this is the setting for a chart whose categories are the
|
|
835
|
+
* caller's data rather than the caller's choice. It settles on one of those
|
|
836
|
+
* two angles and never on a third: an angle fitted to the longest name would
|
|
837
|
+
* be a different angle on every chart on a dashboard, and would change under
|
|
838
|
+
* the reader as the window is dragged.
|
|
839
|
+
*
|
|
840
|
+
* The band under the plot grows to hold whatever is asked for, up to about
|
|
841
|
+
* two fifths of the chart's height; a name longer than that is still cut, and
|
|
842
|
+
* the tooltip and the table still have all of it. Only the **category** axis
|
|
843
|
+
* turns — a value axis' ticks are numbers already rounded to be short — and
|
|
844
|
+
* only where that axis runs along the bottom, so it does nothing on a
|
|
845
|
+
* horizontal bar chart, whose category names are already one to a row.
|
|
846
|
+
* @default 0
|
|
847
|
+
*/
|
|
848
|
+
tickAngle?: number | 'auto';
|
|
705
849
|
/**
|
|
706
850
|
* How much room the axis keeps for its ticks and its label, in pixels.
|
|
707
851
|
* Measured from the ticks themselves otherwise; set it when a long category
|
|
@@ -710,6 +854,50 @@ export interface PlassChartAxis {
|
|
|
710
854
|
*/
|
|
711
855
|
thickness?: number;
|
|
712
856
|
}
|
|
857
|
+
/**
|
|
858
|
+
* A line drawn across the plot at one value — a target, an average, a limit.
|
|
859
|
+
*
|
|
860
|
+
* It is **not data**, and it is drawn as if it knows that: dashed by default,
|
|
861
|
+
* in the muted ink rather than in a palette slot, under the marks rather than
|
|
862
|
+
* over them. A reference that looks like a series is a reference a reader will
|
|
863
|
+
* try to read a value off.
|
|
864
|
+
*
|
|
865
|
+
* It sits on the **value** axis, which means it runs across a vertical chart
|
|
866
|
+
* and down a horizontal one — the same line, drawn on whichever axis the values
|
|
867
|
+
* are on. A marker on the category axis is a different thing and is not this:
|
|
868
|
+
* a band of categories has no value to put a line at, and a column a reader
|
|
869
|
+
* should be looking at is a column that wants its own colour rather than a rule
|
|
870
|
+
* beside it.
|
|
871
|
+
*
|
|
872
|
+
* Every reference is also written into the description a screen reader is given
|
|
873
|
+
* with the chart, because a target is a fact about the picture rather than
|
|
874
|
+
* decoration on it.
|
|
875
|
+
*/
|
|
876
|
+
export interface PlassChartReference {
|
|
877
|
+
/** Where it sits, read on the value axis. */
|
|
878
|
+
value: number;
|
|
879
|
+
/**
|
|
880
|
+
* A short word set at the end of the line — "Target", "Last year". Left out,
|
|
881
|
+
* the line is drawn and says nothing, which is right when the page around the
|
|
882
|
+
* chart has already named it.
|
|
883
|
+
*/
|
|
884
|
+
label?: string;
|
|
885
|
+
/**
|
|
886
|
+
* Overrides the muted ink it is otherwise drawn in. A `PlassColor` family
|
|
887
|
+
* name, or any CSS colour.
|
|
888
|
+
*
|
|
889
|
+
* Reach for it where the line means something the page already has a colour
|
|
890
|
+
* for — a `danger` limit, a `success` target — and not to make it louder: a
|
|
891
|
+
* reference that outshouts the data has inverted the chart.
|
|
892
|
+
*/
|
|
893
|
+
color?: PlassColor | (string & {});
|
|
894
|
+
/**
|
|
895
|
+
* Whether the line is dashed. On, because a solid rule across a plot is what
|
|
896
|
+
* a gridline is, and the two must not be confused.
|
|
897
|
+
* @default true
|
|
898
|
+
*/
|
|
899
|
+
dashed?: boolean;
|
|
900
|
+
}
|
|
713
901
|
/** Where the legend sits, and whether it does anything when clicked. */
|
|
714
902
|
export interface PlassChartLegend {
|
|
715
903
|
/** Which edge of the plot. @default 'bottom' */
|
|
@@ -723,4 +911,20 @@ export interface PlassChartLegend {
|
|
|
723
911
|
interactive?: boolean;
|
|
724
912
|
/** Draws each series' current value beside its name. @default false */
|
|
725
913
|
showValue?: boolean;
|
|
914
|
+
/**
|
|
915
|
+
* Shows this many entries and folds the rest behind a button that opens them.
|
|
916
|
+
*
|
|
917
|
+
* A legend is a key, and a key of twelve names wrapped over four rows is a
|
|
918
|
+
* paragraph the reader has to search — on a card, it is also four rows the
|
|
919
|
+
* plot no longer has. Folding keeps the legend one or two rows tall and
|
|
920
|
+
* leaves the rest one press away, which is the right trade whenever the
|
|
921
|
+
* reader is looking up *one* series rather than reading the list.
|
|
922
|
+
*
|
|
923
|
+
* The entries kept are the first ones, in the order the series were passed,
|
|
924
|
+
* because that is the order their colours were handed out in and the order
|
|
925
|
+
* the reader has already learned. Nothing is hidden from a screen reader by
|
|
926
|
+
* it: the fold is a real button that says how many are behind it, and every
|
|
927
|
+
* series is in the table under the chart either way.
|
|
928
|
+
*/
|
|
929
|
+
maxEntries?: number;
|
|
726
930
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "plass-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.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",
|