plass-ui 1.5.0 → 1.6.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 +60 -0
- package/README.md +27 -7
- package/dist/components/animate-counter/PlAnimateCounter.js +1 -1
- package/dist/components/animate-float/PlAnimateFloat.js +1 -1
- package/dist/components/animate-marquee/PlAnimateMarquee.d.ts +3 -0
- package/dist/components/animate-marquee/PlAnimateMarquee.js +1 -1
- package/dist/components/animate-scramble/PlAnimateScramble.js +1 -1
- package/dist/components/animate-split/PlAnimateSplit.js +1 -1
- package/dist/components/animate-typing/PlAnimateTyping.js +1 -1
- package/dist/components/back-top/PlBackTop.d.ts +6 -0
- package/dist/components/back-top/PlBackTop.js +1 -1
- package/dist/components/blockquote/PlBlockquote.js +1 -1
- package/dist/components/breadcrumb/PlBreadcrumb.js +1 -1
- package/dist/components/button/PlButton.js +1 -1
- package/dist/components/checkbox/PlCheckbox.js +1 -1
- package/dist/components/chip/PlChip.js +1 -1
- package/dist/components/color-picker/PlColorPicker.d.ts +19 -2
- package/dist/components/color-picker/PlColorPicker.js +1 -1
- package/dist/components/combobox/PlCombobox.d.ts +9 -3
- package/dist/components/combobox/PlCombobox.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/empty/PlEmpty.js +1 -1
- package/dist/components/file-picker/PlFilePicker.d.ts +18 -2
- package/dist/components/file-picker/PlFilePicker.js +1 -1
- package/dist/components/heatmap-chart/PlHeatmapChart.js +1 -1
- package/dist/components/highlight/PlHighlight.d.ts +10 -3
- package/dist/components/list/PlList.js +1 -1
- package/dist/components/navigation-menu/PlNavigationMenu.js +1 -1
- package/dist/components/number-field/PlNumberField.d.ts +12 -4
- package/dist/components/number-field/PlNumberField.js +1 -1
- package/dist/components/otp-field/PlOtpField.d.ts +9 -1
- package/dist/components/otp-field/PlOtpField.js +1 -1
- package/dist/components/pie-chart/PlPieChart.js +1 -1
- package/dist/components/pill/PlPill.js +1 -1
- package/dist/components/radio-group/PlRadioGroup.js +1 -1
- package/dist/components/segmented-button/PlSegmentedButton.js +1 -1
- package/dist/components/select/PlSelect.d.ts +8 -2
- package/dist/components/select/PlSelect.js +1 -1
- package/dist/components/stepper/PlStepper.js +1 -1
- package/dist/components/switch/PlSwitch.js +1 -1
- package/dist/components/text-field/PlTextField.d.ts +15 -5
- package/dist/components/text-field/PlTextField.js +1 -1
- package/dist/components/timeline/PlTimeline.js +1 -1
- package/dist/components/toast/PlToast.js +1 -1
- package/dist/components/toggle/PlToggle.js +1 -1
- package/dist/components/tree-select/PlTreeSelect.js +1 -1
- package/dist/components/typography/PlTypography.js +1 -1
- package/dist/components/window-pane/PlWindowPane.d.ts +3 -3
- package/dist/internal/animate.d.ts +0 -25
- package/dist/internal/animate.js +1 -1
- package/dist/internal/chart-frame.d.ts +2 -17
- package/dist/internal/chart-frame.js +1 -1
- package/dist/internal/chart-line.js +1 -1
- package/dist/internal/chart.d.ts +9 -0
- package/dist/internal/chart.js +1 -1
- package/dist/internal/defaults.d.ts +14 -1
- package/dist/internal/glow.d.ts +15 -0
- package/dist/internal/glow.js +1 -1
- package/dist/internal/labels.d.ts +13 -0
- package/dist/internal/labels.js +1 -1
- package/dist/internal/notch.d.ts +83 -0
- package/dist/internal/notch.js +1 -0
- package/dist/internal/picker.d.ts +9 -3
- package/dist/internal/picker.js +1 -1
- package/dist/internal/styles.d.ts +21 -0
- package/dist/internal/styles.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/provider/PlassProvider.d.ts +4 -3
- package/dist/provider/PlassProvider.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +55 -4
- package/dist/tokens.css +55 -4
- package/dist/types.d.ts +55 -0
- package/package.json +1 -1
package/dist/tailwind.css
CHANGED
|
@@ -53,8 +53,11 @@
|
|
|
53
53
|
* surface rather than looked at.
|
|
54
54
|
*
|
|
55
55
|
* Three values are hand-picked per family and everything else is derived with
|
|
56
|
-
* `color-mix()
|
|
57
|
-
* `PlassColor
|
|
56
|
+
* `color-mix()`. Adding a family is still five places, though: one entry in
|
|
57
|
+
* `PlassColor`, those three lines here, an `accent` in each of the three theme
|
|
58
|
+
* blocks below, the eight derived declarations, which are written out per
|
|
59
|
+
* family rather than generated, and the Flutter package's own enum and
|
|
60
|
+
* families.
|
|
58
61
|
*
|
|
59
62
|
* `solid` and `solid-to` are the two ends of the gradient, at 135° — the
|
|
60
63
|
* top-left corner and the bottom-right one. They are a **hue sweep at one
|
|
@@ -564,11 +567,21 @@
|
|
|
564
567
|
* resolves its `var()`s on the element that declares it — declaring these only
|
|
565
568
|
* on `:root` would freeze `--plass-*-tint` to the light theme's
|
|
566
569
|
* `--plass-tint-strength` inside a `.dark` subtree.
|
|
570
|
+
*
|
|
571
|
+
* `.plass-theme` is the same reasoning applied to a *colour* override. Setting
|
|
572
|
+
* `--plass-primary-solid` on a `<div>` changes the base and nothing else,
|
|
573
|
+
* because every value derived from it was computed further up, where the old
|
|
574
|
+
* colour still is. The class re-runs the whole block on that element, so the
|
|
575
|
+
* gradient, the tint, the hairline and the ring follow the base that was just
|
|
576
|
+
* written beside them. It is the one hook here that does not force a theme:
|
|
577
|
+
* `--plass-tint-strength` and the rest inherit from whichever theme root is
|
|
578
|
+
* above, so a scoped family works the same in light and in dark.
|
|
567
579
|
* ------------------------------------------------------------------------- */
|
|
568
580
|
|
|
569
581
|
:root,
|
|
570
582
|
.dark,
|
|
571
583
|
.light,
|
|
584
|
+
.plass-theme,
|
|
572
585
|
[data-theme='dark'],
|
|
573
586
|
[data-theme='light'] {
|
|
574
587
|
/* The elevation ladder. Neutral, wide and faint — it climbs by *blur* far
|
|
@@ -793,6 +806,17 @@
|
|
|
793
806
|
* never re-renders — the component writes the two custom properties directly.
|
|
794
807
|
* ------------------------------------------------------------------------- */
|
|
795
808
|
|
|
809
|
+
/*
|
|
810
|
+
* A stacking context of the surface's own, which is what lets the bloom below
|
|
811
|
+
* sit at a negative depth without falling through the surface it belongs to.
|
|
812
|
+
* `isolation` rather than a `z-index`, because a z-index is a position in a
|
|
813
|
+
* stack somebody else owns and this is only a statement that the two layers are
|
|
814
|
+
* the surface's business.
|
|
815
|
+
*/
|
|
816
|
+
.plass-glow {
|
|
817
|
+
isolation: isolate;
|
|
818
|
+
}
|
|
819
|
+
|
|
796
820
|
.plass-glow::before,
|
|
797
821
|
.plass-glow::after {
|
|
798
822
|
content: '';
|
|
@@ -803,8 +827,20 @@
|
|
|
803
827
|
opacity: 0;
|
|
804
828
|
}
|
|
805
829
|
|
|
806
|
-
/*
|
|
830
|
+
/*
|
|
831
|
+
* The bloom trailing the pointer across the surface.
|
|
832
|
+
*
|
|
833
|
+
* **Under the label, and over the fill.** A positioned pseudo-element otherwise
|
|
834
|
+
* paints above every in-flow thing in the box, so the bloom was laid over the
|
|
835
|
+
* words on a key and over the value in a field — faint enough to miss on a
|
|
836
|
+
* white label and not on dark ink. `z-index: -1` puts it where a stacking
|
|
837
|
+
* context paints a negative layer, which is after the element's own background
|
|
838
|
+
* and before its content: over the gradient, under what is written on it. The
|
|
839
|
+
* flash below stays where it is, over everything, which is the pair the Flutter
|
|
840
|
+
* build draws as two separate widgets on either side of the label.
|
|
841
|
+
*/
|
|
807
842
|
.plass-glow::before {
|
|
843
|
+
z-index: -1;
|
|
808
844
|
background: radial-gradient(
|
|
809
845
|
6rem circle at var(--p-mx, 50%) var(--p-my, 50%),
|
|
810
846
|
var(--p-glow, transparent),
|
|
@@ -1866,13 +1902,28 @@
|
|
|
1866
1902
|
animation-name: plass-anim-lighting;
|
|
1867
1903
|
animation-duration: var(--p-anim-duration, 3s);
|
|
1868
1904
|
animation-delay: var(--p-anim-delay, 0ms);
|
|
1869
|
-
|
|
1905
|
+
/* Linear unless a caller says otherwise, which is what `curve` does in the
|
|
1906
|
+
Flutter build: an arc that eases at both ends of a turn that has no ends
|
|
1907
|
+
reads as a stutter, and that is a default rather than a rule. */
|
|
1908
|
+
animation-timing-function: var(--p-anim-ease, linear);
|
|
1870
1909
|
animation-iteration-count: var(--p-anim-repeat, infinite);
|
|
1871
1910
|
animation-direction: var(--p-anim-direction, normal);
|
|
1872
1911
|
animation-fill-mode: both;
|
|
1873
1912
|
animation-play-state: var(--p-anim-state, running);
|
|
1874
1913
|
}
|
|
1875
1914
|
|
|
1915
|
+
/*
|
|
1916
|
+
* The rewind, for the one effect that runs on a pseudo-element.
|
|
1917
|
+
*
|
|
1918
|
+
* Restarting a CSS animation means clearing its name, forcing the style to
|
|
1919
|
+
* settle and putting the name back, and an inline style cannot reach a
|
|
1920
|
+
* `::before`. So the root carries `data-plass-rewind` for the length of that
|
|
1921
|
+
* read, and this is what answers it. Nothing is painted in between.
|
|
1922
|
+
*/
|
|
1923
|
+
.plass-anim-lighting[data-plass-rewind]::before {
|
|
1924
|
+
animation-name: none;
|
|
1925
|
+
}
|
|
1926
|
+
|
|
1876
1927
|
/*
|
|
1877
1928
|
* Marquee: two identical copies, both moving by exactly one copy plus the gap.
|
|
1878
1929
|
*
|
package/dist/tokens.css
CHANGED
|
@@ -56,8 +56,11 @@
|
|
|
56
56
|
* surface rather than looked at.
|
|
57
57
|
*
|
|
58
58
|
* Three values are hand-picked per family and everything else is derived with
|
|
59
|
-
* `color-mix()
|
|
60
|
-
* `PlassColor
|
|
59
|
+
* `color-mix()`. Adding a family is still five places, though: one entry in
|
|
60
|
+
* `PlassColor`, those three lines here, an `accent` in each of the three theme
|
|
61
|
+
* blocks below, the eight derived declarations, which are written out per
|
|
62
|
+
* family rather than generated, and the Flutter package's own enum and
|
|
63
|
+
* families.
|
|
61
64
|
*
|
|
62
65
|
* `solid` and `solid-to` are the two ends of the gradient, at 135° — the
|
|
63
66
|
* top-left corner and the bottom-right one. They are a **hue sweep at one
|
|
@@ -567,11 +570,21 @@
|
|
|
567
570
|
* resolves its `var()`s on the element that declares it — declaring these only
|
|
568
571
|
* on `:root` would freeze `--plass-*-tint` to the light theme's
|
|
569
572
|
* `--plass-tint-strength` inside a `.dark` subtree.
|
|
573
|
+
*
|
|
574
|
+
* `.plass-theme` is the same reasoning applied to a *colour* override. Setting
|
|
575
|
+
* `--plass-primary-solid` on a `<div>` changes the base and nothing else,
|
|
576
|
+
* because every value derived from it was computed further up, where the old
|
|
577
|
+
* colour still is. The class re-runs the whole block on that element, so the
|
|
578
|
+
* gradient, the tint, the hairline and the ring follow the base that was just
|
|
579
|
+
* written beside them. It is the one hook here that does not force a theme:
|
|
580
|
+
* `--plass-tint-strength` and the rest inherit from whichever theme root is
|
|
581
|
+
* above, so a scoped family works the same in light and in dark.
|
|
570
582
|
* ------------------------------------------------------------------------- */
|
|
571
583
|
|
|
572
584
|
:root,
|
|
573
585
|
.dark,
|
|
574
586
|
.light,
|
|
587
|
+
.plass-theme,
|
|
575
588
|
[data-theme='dark'],
|
|
576
589
|
[data-theme='light'] {
|
|
577
590
|
/* The elevation ladder. Neutral, wide and faint — it climbs by *blur* far
|
|
@@ -796,6 +809,17 @@
|
|
|
796
809
|
* never re-renders — the component writes the two custom properties directly.
|
|
797
810
|
* ------------------------------------------------------------------------- */
|
|
798
811
|
|
|
812
|
+
/*
|
|
813
|
+
* A stacking context of the surface's own, which is what lets the bloom below
|
|
814
|
+
* sit at a negative depth without falling through the surface it belongs to.
|
|
815
|
+
* `isolation` rather than a `z-index`, because a z-index is a position in a
|
|
816
|
+
* stack somebody else owns and this is only a statement that the two layers are
|
|
817
|
+
* the surface's business.
|
|
818
|
+
*/
|
|
819
|
+
.plass-glow {
|
|
820
|
+
isolation: isolate;
|
|
821
|
+
}
|
|
822
|
+
|
|
799
823
|
.plass-glow::before,
|
|
800
824
|
.plass-glow::after {
|
|
801
825
|
content: '';
|
|
@@ -806,8 +830,20 @@
|
|
|
806
830
|
opacity: 0;
|
|
807
831
|
}
|
|
808
832
|
|
|
809
|
-
/*
|
|
833
|
+
/*
|
|
834
|
+
* The bloom trailing the pointer across the surface.
|
|
835
|
+
*
|
|
836
|
+
* **Under the label, and over the fill.** A positioned pseudo-element otherwise
|
|
837
|
+
* paints above every in-flow thing in the box, so the bloom was laid over the
|
|
838
|
+
* words on a key and over the value in a field — faint enough to miss on a
|
|
839
|
+
* white label and not on dark ink. `z-index: -1` puts it where a stacking
|
|
840
|
+
* context paints a negative layer, which is after the element's own background
|
|
841
|
+
* and before its content: over the gradient, under what is written on it. The
|
|
842
|
+
* flash below stays where it is, over everything, which is the pair the Flutter
|
|
843
|
+
* build draws as two separate widgets on either side of the label.
|
|
844
|
+
*/
|
|
810
845
|
.plass-glow::before {
|
|
846
|
+
z-index: -1;
|
|
811
847
|
background: radial-gradient(
|
|
812
848
|
6rem circle at var(--p-mx, 50%) var(--p-my, 50%),
|
|
813
849
|
var(--p-glow, transparent),
|
|
@@ -1869,13 +1905,28 @@
|
|
|
1869
1905
|
animation-name: plass-anim-lighting;
|
|
1870
1906
|
animation-duration: var(--p-anim-duration, 3s);
|
|
1871
1907
|
animation-delay: var(--p-anim-delay, 0ms);
|
|
1872
|
-
|
|
1908
|
+
/* Linear unless a caller says otherwise, which is what `curve` does in the
|
|
1909
|
+
Flutter build: an arc that eases at both ends of a turn that has no ends
|
|
1910
|
+
reads as a stutter, and that is a default rather than a rule. */
|
|
1911
|
+
animation-timing-function: var(--p-anim-ease, linear);
|
|
1873
1912
|
animation-iteration-count: var(--p-anim-repeat, infinite);
|
|
1874
1913
|
animation-direction: var(--p-anim-direction, normal);
|
|
1875
1914
|
animation-fill-mode: both;
|
|
1876
1915
|
animation-play-state: var(--p-anim-state, running);
|
|
1877
1916
|
}
|
|
1878
1917
|
|
|
1918
|
+
/*
|
|
1919
|
+
* The rewind, for the one effect that runs on a pseudo-element.
|
|
1920
|
+
*
|
|
1921
|
+
* Restarting a CSS animation means clearing its name, forcing the style to
|
|
1922
|
+
* settle and putting the name back, and an inline style cannot reach a
|
|
1923
|
+
* `::before`. So the root carries `data-plass-rewind` for the length of that
|
|
1924
|
+
* read, and this is what answers it. Nothing is painted in between.
|
|
1925
|
+
*/
|
|
1926
|
+
.plass-anim-lighting[data-plass-rewind]::before {
|
|
1927
|
+
animation-name: none;
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1879
1930
|
/*
|
|
1880
1931
|
* Marquee: two identical copies, both moving by exactly one copy plus the gap.
|
|
1881
1932
|
*
|
package/dist/types.d.ts
CHANGED
|
@@ -131,6 +131,52 @@ export type PlassOverscroll = 'auto' | 'contain';
|
|
|
131
131
|
* a caller spell `{ vertical: 'left' }`.
|
|
132
132
|
*/
|
|
133
133
|
export type PlassCorner = 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';
|
|
134
|
+
/**
|
|
135
|
+
* Where a **field-shaped** control puts the name of what it holds.
|
|
136
|
+
*
|
|
137
|
+
* The placements a box has to offer, which are not the placements a tick has:
|
|
138
|
+
* a PlCheckbox, a PlRadio and a PlSwitch put their label beside themselves and
|
|
139
|
+
* take `labelPlacement` out of `PlassAlign` instead — same question, same prop
|
|
140
|
+
* name, the answers each shape actually has. See `PlSwitchLabelPlacement`.
|
|
141
|
+
*
|
|
142
|
+
* - `top` — above the control, on its own line. The default, and the one that
|
|
143
|
+
* is always safe: the label is a block of text in the layout, it can wrap, it
|
|
144
|
+
* can be as long as it needs to be, and nothing about the control's edge has
|
|
145
|
+
* to make room for it.
|
|
146
|
+
* - `notch` — in the control's own top edge, with the hairline cut away behind
|
|
147
|
+
* it. The label stops being a line of the form and becomes part of the field,
|
|
148
|
+
* which buys back a row of vertical space and ties the name to the box rather
|
|
149
|
+
* than to whatever is above it.
|
|
150
|
+
*
|
|
151
|
+
* The cut is a real one — a `<legend>` in a `<fieldset>`, which is the only way
|
|
152
|
+
* to take a segment out of a border without knowing what is behind it. Nothing
|
|
153
|
+
* here paints over the line with the page's colour, because a library that does
|
|
154
|
+
* not paint the page cannot know what colour that is, and a Plass field is
|
|
155
|
+
* translucent besides.
|
|
156
|
+
*
|
|
157
|
+
* Two things follow from the label sitting on the edge, and both are deliberate:
|
|
158
|
+
*
|
|
159
|
+
* - **Focus is the edge thickening rather than a ring.** An outline is a
|
|
160
|
+
* rectangle and would run straight through the label. The edge that is
|
|
161
|
+
* already there goes to 2px and takes the family's colour instead, which is
|
|
162
|
+
* what the flush ring was drawn to look like anyway.
|
|
163
|
+
* - **The label no longer widens the control.** It is out of the flow, so a
|
|
164
|
+
* label longer than a narrow field runs past its end. Give the field
|
|
165
|
+
* `fullWidth`, or keep the word short — a notch is a place for "Email", not
|
|
166
|
+
* for a sentence.
|
|
167
|
+
*
|
|
168
|
+
* Only `glass` has a hairline to cut. On `solid` and `ghost` the label sits in
|
|
169
|
+
* the same place and there is simply nothing there to take out, so a form that
|
|
170
|
+
* mixes the three keeps one baseline for its labels.
|
|
171
|
+
*
|
|
172
|
+
* **`PlOtpField` is the one labelled field that does not take this**, and the
|
|
173
|
+
* reason is the same one that decides everything above: a notch is a segment
|
|
174
|
+
* taken out of one continuous edge, and a row of separate boxes with gaps
|
|
175
|
+
* between them has no such edge. Cutting only the first box leaves the word
|
|
176
|
+
* lying across the two after it, which is worse than the label above the row
|
|
177
|
+
* that it keeps.
|
|
178
|
+
*/
|
|
179
|
+
export type PlassFieldLabelPlacement = 'top' | 'notch';
|
|
134
180
|
/**
|
|
135
181
|
* What a surface is made of. This is the library's own name, and the two
|
|
136
182
|
* materials in it are the whole design language.
|
|
@@ -531,6 +577,15 @@ export interface PlassChartSeries {
|
|
|
531
577
|
* @default false
|
|
532
578
|
*/
|
|
533
579
|
hidden?: boolean;
|
|
580
|
+
/**
|
|
581
|
+
* Draws the line dashed — a forecast, a target, a last year.
|
|
582
|
+
*
|
|
583
|
+
* Only a line has a line to dash, so it does nothing on a bar, and nothing on
|
|
584
|
+
* a stacked area either, where the band's fill *is* the mark and there is no
|
|
585
|
+
* stroke along its top.
|
|
586
|
+
* @default false
|
|
587
|
+
*/
|
|
588
|
+
dashed?: boolean;
|
|
534
589
|
}
|
|
535
590
|
/**
|
|
536
591
|
* One span on a `PlTimelineChart` — a stretch of time with two ends.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "plass-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.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",
|