@expressivecss/expressive 0.12.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +231 -1
- package/README.md +37 -1
- package/dist/css/expressive.css +5111 -36
- package/dist/css/expressive.css.map +1 -1
- package/dist/css/expressive.min.css +1 -1
- package/dist/css/expressive.min.css.map +1 -1
- package/dist/fonts/material-symbols-outlined.woff2 +0 -0
- package/dist/fonts/material-symbols-rounded.woff2 +0 -0
- package/dist/fonts/material-symbols-sharp.woff2 +0 -0
- package/dist/js/chunks/{chunk-HLDXZ7XB.mjs → chunk-3CLXLPYS.mjs} +2 -2
- package/dist/js/chunks/chunk-3DHK5CZU.mjs +105 -0
- package/dist/js/chunks/chunk-3DHK5CZU.mjs.map +7 -0
- package/dist/js/chunks/chunk-4PWAPV6F.mjs +7 -0
- package/dist/js/chunks/chunk-4PWAPV6F.mjs.map +7 -0
- package/dist/js/chunks/{chunk-HB6IW7QQ.mjs → chunk-55IA2XUC.mjs} +2 -2
- package/dist/js/chunks/chunk-CCWDV5CR.mjs +292 -0
- package/dist/js/chunks/chunk-CCWDV5CR.mjs.map +7 -0
- package/dist/js/chunks/chunk-DTKR54I6.mjs +270 -0
- package/dist/js/chunks/chunk-DTKR54I6.mjs.map +7 -0
- package/dist/js/chunks/chunk-GVGT6MIU.mjs +47 -0
- package/dist/js/chunks/chunk-GVGT6MIU.mjs.map +7 -0
- package/dist/js/chunks/chunk-HKT2S7VM.mjs +48 -0
- package/dist/js/chunks/chunk-HKT2S7VM.mjs.map +7 -0
- package/dist/js/chunks/chunk-K4CJCRGE.mjs +262 -0
- package/dist/js/chunks/chunk-K4CJCRGE.mjs.map +7 -0
- package/dist/js/chunks/chunk-LNCCYGPC.mjs +163 -0
- package/dist/js/chunks/chunk-LNCCYGPC.mjs.map +7 -0
- package/dist/js/chunks/chunk-NQLC3YMW.mjs +1 -0
- package/dist/js/chunks/chunk-O5XPWXIQ.mjs +406 -0
- package/dist/js/chunks/chunk-O5XPWXIQ.mjs.map +7 -0
- package/dist/js/chunks/chunk-P3G3QHII.mjs +166 -0
- package/dist/js/chunks/chunk-P3G3QHII.mjs.map +7 -0
- package/dist/js/chunks/{chunk-H2WA4XHH.mjs → chunk-PLYXLSH3.mjs} +4 -4
- package/dist/js/chunks/chunk-QKWPQK5N.mjs +179 -0
- package/dist/js/chunks/chunk-QKWPQK5N.mjs.map +7 -0
- package/dist/js/chunks/chunk-RHRQKTTX.mjs +139 -0
- package/dist/js/chunks/chunk-RHRQKTTX.mjs.map +7 -0
- package/dist/js/chunks/chunk-SPETGK25.mjs +59 -0
- package/dist/js/chunks/chunk-SPETGK25.mjs.map +7 -0
- package/dist/js/chunks/{chunk-YSBCHYXP.mjs → chunk-U2OTHOTI.mjs} +116 -12
- package/dist/js/chunks/chunk-U2OTHOTI.mjs.map +7 -0
- package/dist/js/chunks/chunk-VTLBW7QS.mjs +124 -0
- package/dist/js/chunks/chunk-VTLBW7QS.mjs.map +7 -0
- package/dist/js/chunks/{chunk-RFZZCYVU.mjs → chunk-XGHORT7J.mjs} +2 -2
- package/dist/js/chunks/{chunk-HNFSMIBY.mjs → chunk-XH6BEEMY.mjs} +69 -16
- package/dist/js/chunks/chunk-XH6BEEMY.mjs.map +7 -0
- package/dist/js/expressive.cjs +2209 -32
- package/dist/js/expressive.cjs.map +4 -4
- package/dist/js/expressive.js +2209 -32
- package/dist/js/expressive.js.map +4 -4
- package/dist/js/expressive.min.js +10 -10
- package/dist/js/expressive.min.js.map +4 -4
- package/dist/js/expressive.mjs +68 -20
- package/dist/js/expressive.mjs.map +1 -1
- package/dist/js/internal/behaviors/forms.mjs +1 -1
- package/dist/js/internal/components/autocomplete.mjs +2 -2
- package/dist/js/internal/components/barChart.mjs +10 -0
- package/dist/js/internal/components/barChart.mjs.map +7 -0
- package/dist/js/internal/components/chips.mjs +3 -3
- package/dist/js/internal/components/columnChart.mjs +9 -0
- package/dist/js/internal/components/columnChart.mjs.map +7 -0
- package/dist/js/internal/components/commandPalette.mjs +9 -0
- package/dist/js/internal/components/commandPalette.mjs.map +7 -0
- package/dist/js/internal/components/datepicker.mjs +3 -3
- package/dist/js/internal/components/heatmapChart.mjs +9 -0
- package/dist/js/internal/components/heatmapChart.mjs.map +7 -0
- package/dist/js/internal/components/index.mjs +65 -17
- package/dist/js/internal/components/lineChart.mjs +12 -0
- package/dist/js/internal/components/lineChart.mjs.map +7 -0
- package/dist/js/internal/components/menu.mjs +1 -1
- package/dist/js/internal/components/messageScroller.mjs +9 -0
- package/dist/js/internal/components/messageScroller.mjs.map +7 -0
- package/dist/js/internal/components/mixedChart.mjs +10 -0
- package/dist/js/internal/components/mixedChart.mjs.map +7 -0
- package/dist/js/internal/components/pieChart.mjs +9 -0
- package/dist/js/internal/components/pieChart.mjs.map +7 -0
- package/dist/js/internal/components/questionnaire.mjs +9 -0
- package/dist/js/internal/components/questionnaire.mjs.map +7 -0
- package/dist/js/internal/components/radarChart.mjs +9 -0
- package/dist/js/internal/components/radarChart.mjs.map +7 -0
- package/dist/js/internal/components/radialChart.mjs +9 -0
- package/dist/js/internal/components/radialChart.mjs.map +7 -0
- package/dist/js/internal/components/registry.mjs +23 -11
- package/dist/js/internal/components/richTextEditor.mjs +9 -0
- package/dist/js/internal/components/richTextEditor.mjs.map +7 -0
- package/dist/js/internal/components/select.mjs +2 -2
- package/dist/js/modular.mjs +68 -20
- package/dist/types/behaviors/forms.d.ts +22 -0
- package/dist/types/components/barChart.d.ts +24 -0
- package/dist/types/components/columnChart.d.ts +21 -0
- package/dist/types/components/commandPalette.d.ts +96 -0
- package/dist/types/components/heatmapChart.d.ts +49 -0
- package/dist/types/components/index.d.ts +12 -0
- package/dist/types/components/lineChart.d.ts +134 -0
- package/dist/types/components/menu.d.ts +31 -0
- package/dist/types/components/messageScroller.d.ts +111 -0
- package/dist/types/components/mixedChart.d.ts +25 -0
- package/dist/types/components/pieChart.d.ts +40 -0
- package/dist/types/components/questionnaire.d.ts +96 -0
- package/dist/types/components/radarChart.d.ts +39 -0
- package/dist/types/components/radialChart.d.ts +45 -0
- package/dist/types/components/registry.d.ts +44 -0
- package/dist/types/components/richTextEditor.d.ts +71 -0
- package/dist/types/modular.d.ts +10 -1
- package/package.json +4 -1
- package/src/sass/README.md +3 -6
- package/src/sass/abstracts/_index.scss +1 -1
- package/src/sass/abstracts/_mixins.scss +226 -0
- package/src/sass/abstracts/_variables.scss +14 -0
- package/src/sass/base/_typography.scss +45 -0
- package/src/sass/components/_accordion.scss +161 -0
- package/src/sass/components/_aura.scss +119 -0
- package/src/sass/components/_avatar.scss +86 -0
- package/src/sass/components/_bar-chart.scss +285 -0
- package/src/sass/components/_bottom-sheet.scss +1 -0
- package/src/sass/components/_button-groups.scss +13 -3
- package/src/sass/components/_cards.scss +16 -13
- package/src/sass/components/_column-chart.scss +134 -0
- package/src/sass/components/_command-palette.scss +140 -0
- package/src/sass/components/_countdown.scss +89 -0
- package/src/sass/components/_data-table.scss +188 -0
- package/src/sass/components/_dialog.scss +1 -0
- package/src/sass/components/_empty-state.scss +78 -0
- package/src/sass/components/_expanding-card.scss +3 -0
- package/src/sass/components/_heatmap-chart.scss +156 -0
- package/src/sass/components/_index.scss +27 -0
- package/src/sass/components/_kpi.scss +162 -0
- package/src/sass/components/_line-chart.scss +102 -0
- package/src/sass/components/_marquee.scss +111 -0
- package/src/sass/components/_menu.scss +10 -0
- package/src/sass/components/_message-scroller.scss +66 -0
- package/src/sass/components/_message.scss +202 -0
- package/src/sass/components/_mixed-chart.scss +157 -0
- package/src/sass/components/_navigation-bar.scss +1 -0
- package/src/sass/components/_navigation-rail.scss +9 -0
- package/src/sass/components/_pie-chart.scss +203 -0
- package/src/sass/components/_popover.scss +112 -0
- package/src/sass/components/_questionnaire.scss +144 -0
- package/src/sass/components/_radar-chart.scss +205 -0
- package/src/sass/components/_radial-chart.scss +174 -0
- package/src/sass/components/_rich-text-editor.scss +99 -0
- package/src/sass/components/_search.scss +1 -0
- package/src/sass/components/_side-sheet.scss +1 -0
- package/src/sass/components/_skeleton.scss +81 -0
- package/src/sass/components/_snackbar.scss +1 -0
- package/src/sass/components/_stat.scss +86 -0
- package/src/sass/components/_stepper.scss +190 -0
- package/src/sass/components/_timeline.scss +114 -0
- package/src/sass/components/_toolbar.scss +1 -0
- package/src/sass/components/_tooltip.scss +2 -0
- package/src/sass/components/_tree.scss +139 -0
- package/src/sass/components/forms/_drop-zone.scss +128 -0
- package/src/sass/components/forms/_index.scss +2 -0
- package/src/sass/components/forms/_input-fields.scss +133 -2
- package/src/sass/components/forms/_rating.scss +165 -0
- package/src/sass/tokens/_reference.scss +3 -15
- package/src/sass/utilities/_index.scss +2 -0
- package/src/sass/utilities/_scroll-area.scss +35 -0
- package/src/sass/utilities/_shapes.scss +164 -0
- package/dist/js/chunks/chunk-G3I5H2U3.mjs +0 -7
- package/dist/js/chunks/chunk-G3I5H2U3.mjs.map +0 -7
- package/dist/js/chunks/chunk-HNFSMIBY.mjs.map +0 -7
- package/dist/js/chunks/chunk-PSSHQWCX.mjs +0 -100
- package/dist/js/chunks/chunk-PSSHQWCX.mjs.map +0 -7
- package/dist/js/chunks/chunk-WWPAPHMA.mjs +0 -1
- package/dist/js/chunks/chunk-YSBCHYXP.mjs.map +0 -7
- /package/dist/js/chunks/{chunk-HLDXZ7XB.mjs.map → chunk-3CLXLPYS.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-HB6IW7QQ.mjs.map → chunk-55IA2XUC.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-WWPAPHMA.mjs.map → chunk-NQLC3YMW.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-H2WA4XHH.mjs.map → chunk-PLYXLSH3.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-RFZZCYVU.mjs.map → chunk-XGHORT7J.mjs.map} +0 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { Component, BaseOptions, InitElements, InitElement } from '../core/component';
|
|
2
|
+
export interface MessageScrollerOptions extends BaseOptions {
|
|
3
|
+
/**
|
|
4
|
+
* If true, the viewport follows new content while the reader is at the
|
|
5
|
+
* end, and a newly appended scroll anchor is brought to the top.
|
|
6
|
+
* @default true
|
|
7
|
+
*/
|
|
8
|
+
autoScroll: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Where the transcript opens: `'end'`, `'start'`, or `'last-anchor'`, the
|
|
11
|
+
* start of the last anchored turn. `'last-anchor'` opens at the end when
|
|
12
|
+
* that turn already fits in the viewport.
|
|
13
|
+
* @default 'end'
|
|
14
|
+
*/
|
|
15
|
+
defaultScrollPosition: 'start' | 'end' | 'last-anchor';
|
|
16
|
+
/**
|
|
17
|
+
* Pixels of the previous message left visible above an anchored turn or a
|
|
18
|
+
* message reached with `scrollToMessage()`.
|
|
19
|
+
* @default 64
|
|
20
|
+
*/
|
|
21
|
+
peek: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A chat scroll container: a `.message-scroller` frame holding a scrolling
|
|
25
|
+
* `.message-scroller-viewport` of messages and an optional
|
|
26
|
+
* `.message-scroller-button`. Every child of the viewport is one message.
|
|
27
|
+
*
|
|
28
|
+
* While the reader is at the end, the viewport follows streamed output.
|
|
29
|
+
* Scrolling toward the start releases it; reaching the end again, or the
|
|
30
|
+
* button, resumes it. An appended message marked `data-scroll-anchor` starts a
|
|
31
|
+
* turn and is scrolled to the top, with blank space below it until the reply
|
|
32
|
+
* fills the viewport. Messages added above keep the reader's place.
|
|
33
|
+
*/
|
|
34
|
+
export declare class MessageScroller extends Component<MessageScrollerOptions> {
|
|
35
|
+
/** The scrolling element. */
|
|
36
|
+
viewport: HTMLElement;
|
|
37
|
+
/** The scroll-to-latest button, if present. */
|
|
38
|
+
button: HTMLButtonElement | null;
|
|
39
|
+
private _opened;
|
|
40
|
+
private _following;
|
|
41
|
+
/** A press is down: it may be a tap or a scrollbar drag. */
|
|
42
|
+
private _holding;
|
|
43
|
+
private _lastTop;
|
|
44
|
+
/** Where a programmatic scroll is heading; null when none is running. */
|
|
45
|
+
private _target;
|
|
46
|
+
/** Distance left to the target at the last scroll event. */
|
|
47
|
+
private _distance;
|
|
48
|
+
/** The first visible message and its offset from the viewport top. */
|
|
49
|
+
private _ref;
|
|
50
|
+
private _refOffset;
|
|
51
|
+
/** The latest anchored turn, which the spacer lets reach the top. */
|
|
52
|
+
private _anchor;
|
|
53
|
+
private _spacer;
|
|
54
|
+
private _last;
|
|
55
|
+
private _resizeObserver;
|
|
56
|
+
private _mutationObserver;
|
|
57
|
+
constructor(el: HTMLElement, options: Partial<MessageScrollerOptions>);
|
|
58
|
+
static get defaults(): MessageScrollerOptions;
|
|
59
|
+
/**
|
|
60
|
+
* Initializes instance of MessageScroller.
|
|
61
|
+
* @param el HTML element.
|
|
62
|
+
* @param options Component options.
|
|
63
|
+
*/
|
|
64
|
+
static init(el: HTMLElement, options?: Partial<MessageScrollerOptions>): MessageScroller;
|
|
65
|
+
/**
|
|
66
|
+
* Initializes instances of MessageScroller.
|
|
67
|
+
* @param els HTML elements.
|
|
68
|
+
* @param options Component options.
|
|
69
|
+
*/
|
|
70
|
+
static init(els: InitElements<InitElement>, options?: Partial<MessageScrollerOptions>): MessageScroller[];
|
|
71
|
+
static getInstance(el: HTMLElement): MessageScroller;
|
|
72
|
+
destroy(): void;
|
|
73
|
+
/** Scrolls to the latest message and resumes following. */
|
|
74
|
+
scrollToEnd(): void;
|
|
75
|
+
/** Scrolls to the first message. */
|
|
76
|
+
scrollToStart(): void;
|
|
77
|
+
/**
|
|
78
|
+
* Scrolls the element with this id to the top of the viewport, below the
|
|
79
|
+
* peek, and stops following.
|
|
80
|
+
* @returns false when no such element is inside the viewport.
|
|
81
|
+
*/
|
|
82
|
+
scrollToMessage(id: string): boolean;
|
|
83
|
+
private _open;
|
|
84
|
+
/**
|
|
85
|
+
* Records where the reader is once no programmatic scroll is running.
|
|
86
|
+
* Content can grow between a scroll and the resize that re-pins the end,
|
|
87
|
+
* so only moving toward the start releases following.
|
|
88
|
+
*/
|
|
89
|
+
private _settle;
|
|
90
|
+
private _handleScroll;
|
|
91
|
+
private _handleUserScroll;
|
|
92
|
+
private _handleRelease;
|
|
93
|
+
private _handleButtonClick;
|
|
94
|
+
private _handleMutations;
|
|
95
|
+
private _handleResize;
|
|
96
|
+
private _scrollTo;
|
|
97
|
+
private _resolve;
|
|
98
|
+
private _atEnd;
|
|
99
|
+
/** Offset of an element from the top of the scrolled content. */
|
|
100
|
+
private _top;
|
|
101
|
+
/** Bottom of the content without the spacer, padding included. */
|
|
102
|
+
private _contentEnd;
|
|
103
|
+
/** Remembers the first visible message so prepends can keep it in place. */
|
|
104
|
+
private _capture;
|
|
105
|
+
/** Moves the remembered message back to where the reader last saw it. */
|
|
106
|
+
private _restore;
|
|
107
|
+
/** Sizes the blank space that lets the latest anchored turn reach the top. */
|
|
108
|
+
private _updateSpacer;
|
|
109
|
+
/** The button is inert while there is nothing below. */
|
|
110
|
+
private _sync;
|
|
111
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { InitElements, InitElement } from '../core/component';
|
|
2
|
+
import { ColumnChart } from './columnChart';
|
|
3
|
+
import { LineChartOptions, Series } from './lineChart';
|
|
4
|
+
export type MixedChartOptions = LineChartOptions;
|
|
5
|
+
/**
|
|
6
|
+
* Mixed chart. It reads its <table> like LineChart, and draws each series
|
|
7
|
+
* by its header cell's class: `column` as columns from zero, `area` as a
|
|
8
|
+
* line with a fill under it, and anything else as a line. Series with
|
|
9
|
+
* `end` are drawn against a second scale, set by `data-end-min` and
|
|
10
|
+
* `data-end-max`, so values of different sizes or units share the plot.
|
|
11
|
+
*
|
|
12
|
+
* Re-run `MixedChart.init(el)` after changing the table.
|
|
13
|
+
*/
|
|
14
|
+
export declare class MixedChart extends ColumnChart {
|
|
15
|
+
protected get _type(): string;
|
|
16
|
+
protected get _key(): string;
|
|
17
|
+
protected get _points(): boolean;
|
|
18
|
+
static init(el: HTMLElement, options?: Partial<MixedChartOptions>): MixedChart;
|
|
19
|
+
static init(els: InitElements<InitElement>, options?: Partial<MixedChartOptions>): MixedChart[];
|
|
20
|
+
static getInstance(el: HTMLElement): MixedChart;
|
|
21
|
+
/** The start scale, then the end scale; each includes zero if it has columns. */
|
|
22
|
+
protected _scale(series: Series[], min: number | null, max: number | null): (value: number) => number;
|
|
23
|
+
/** Columns behind, then the lines and areas over them. */
|
|
24
|
+
protected _draw(): Element;
|
|
25
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { InitElements, InitElement } from '../core/component';
|
|
2
|
+
import { LineChart, LineChartOptions } from './lineChart';
|
|
3
|
+
export type PieChartOptions = LineChartOptions;
|
|
4
|
+
/**
|
|
5
|
+
* Pie chart. It reads its <table> like LineChart, but draws each row of the
|
|
6
|
+
* first value column as a slice of the whole, clockwise from the top, with
|
|
7
|
+
* a legend of every row and its share. With `.donut`, a <tfoot> row is the
|
|
8
|
+
* total in the middle. Further columns show in the tooltip.
|
|
9
|
+
*
|
|
10
|
+
* Re-run `PieChart.init(el)` after changing the table.
|
|
11
|
+
*/
|
|
12
|
+
export declare class PieChart extends LineChart {
|
|
13
|
+
/** Each row's start and end, as fractions of a turn clockwise from the top. */
|
|
14
|
+
private _turns;
|
|
15
|
+
/** Each row's color, or undefined for a row with no slice. */
|
|
16
|
+
private _colors;
|
|
17
|
+
private _slices;
|
|
18
|
+
protected get _type(): string;
|
|
19
|
+
protected get _key(): string;
|
|
20
|
+
protected get _points(): boolean;
|
|
21
|
+
protected get _circular(): boolean;
|
|
22
|
+
static init(el: HTMLElement, options?: Partial<PieChartOptions>): PieChart;
|
|
23
|
+
static init(els: InitElements<InitElement>, options?: Partial<PieChartOptions>): PieChart[];
|
|
24
|
+
static getInstance(el: HTMLElement): PieChart;
|
|
25
|
+
show(index: number): void;
|
|
26
|
+
/** CSS places the tooltip on the slice's middle from --turn. */
|
|
27
|
+
protected _place(index: number): void;
|
|
28
|
+
/** The row's share of the whole as a percentage, or '' for none. */
|
|
29
|
+
private _share;
|
|
30
|
+
/** The legend: every row with its color, its cell and its share. */
|
|
31
|
+
protected _guides(): Element[];
|
|
32
|
+
/** The row under the pointer by its angle from the middle, or -1 off the slices. */
|
|
33
|
+
protected _indexAt(e: PointerEvent): number;
|
|
34
|
+
/**
|
|
35
|
+
* An SVG of slices in a -50 to 50 box, under a mask that cuts the gaps
|
|
36
|
+
* between them and the donut's hole, which CSS sizes. The values and the
|
|
37
|
+
* total are HTML over it.
|
|
38
|
+
*/
|
|
39
|
+
protected _draw(): Element;
|
|
40
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Component, BaseOptions, InitElements, InitElement } from '../core/component';
|
|
2
|
+
export interface QuestionnaireOptions extends BaseOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Text above the progress bar. `{current}` and `{total}` are replaced with
|
|
5
|
+
* the question number and the number of questions. `data-progress-label`
|
|
6
|
+
* on the form sets it.
|
|
7
|
+
* @default 'Question {current} of {total}'
|
|
8
|
+
*/
|
|
9
|
+
progressLabel: string;
|
|
10
|
+
/**
|
|
11
|
+
* Error shown when a question has no `.questionnaire-error` of its own and
|
|
12
|
+
* the browser gives no validation message, as for a `data-required` group
|
|
13
|
+
* of checkboxes.
|
|
14
|
+
* @default 'Choose an answer to continue.'
|
|
15
|
+
*/
|
|
16
|
+
requiredMessage: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A multi-step questionnaire: a <form class="questionnaire"> whose
|
|
20
|
+
* <fieldset> children are the questions, shown one at a time, and a <footer>
|
|
21
|
+
* of buttons. `value="previous"`, `value="skip"` and `value="next"` mark the
|
|
22
|
+
* navigation buttons; a submit button sends the form on the last question.
|
|
23
|
+
*
|
|
24
|
+
* A question is required when one of its controls is `required`, or when the
|
|
25
|
+
* fieldset has `data-required` (at least one enabled checkbox, held as a
|
|
26
|
+
* custom validity on the first one). Next and every way of submitting check
|
|
27
|
+
* it with the browser's own validation; an optional question gets Skip, which
|
|
28
|
+
* clears its answer. A disabled fieldset is left out, so a page can switch
|
|
29
|
+
* questions on and off from earlier answers.
|
|
30
|
+
*
|
|
31
|
+
* Without JavaScript every question shows at once and the submit button sends
|
|
32
|
+
* the form. The answers are ordinary form controls, so FormData reads them.
|
|
33
|
+
*/
|
|
34
|
+
export declare class Questionnaire extends Component<QuestionnaireOptions> {
|
|
35
|
+
el: HTMLFormElement;
|
|
36
|
+
private _active;
|
|
37
|
+
private _progress;
|
|
38
|
+
private _progressText;
|
|
39
|
+
private _progressBar;
|
|
40
|
+
private _generated;
|
|
41
|
+
private _generatedIds;
|
|
42
|
+
private _observer;
|
|
43
|
+
/** Set while one submission's invalid events arrive, so only the first opens. */
|
|
44
|
+
private _reporting;
|
|
45
|
+
constructor(el: HTMLFormElement, options: Partial<QuestionnaireOptions>);
|
|
46
|
+
static get defaults(): QuestionnaireOptions;
|
|
47
|
+
/**
|
|
48
|
+
* Initializes instance of Questionnaire.
|
|
49
|
+
* @param el HTML element.
|
|
50
|
+
* @param options Component options.
|
|
51
|
+
*/
|
|
52
|
+
static init(el: HTMLElement, options?: Partial<QuestionnaireOptions>): Questionnaire;
|
|
53
|
+
/**
|
|
54
|
+
* Initializes instances of Questionnaire.
|
|
55
|
+
* @param els HTML elements.
|
|
56
|
+
* @param options Component options.
|
|
57
|
+
*/
|
|
58
|
+
static init(els: InitElements<InitElement>, options?: Partial<QuestionnaireOptions>): Questionnaire[];
|
|
59
|
+
static getInstance(el: HTMLElement): Questionnaire;
|
|
60
|
+
/** The questions that apply: every fieldset child that is not disabled. */
|
|
61
|
+
get items(): HTMLFieldSetElement[];
|
|
62
|
+
/** Position of the shown question in `items`. */
|
|
63
|
+
get index(): number;
|
|
64
|
+
/** Shows the question at `index` without checking the current one. */
|
|
65
|
+
goTo: (index: number) => void;
|
|
66
|
+
/** Checks the shown question and moves to the next one if it is answered. */
|
|
67
|
+
next: () => void;
|
|
68
|
+
/** Moves to the previous question. */
|
|
69
|
+
previous: () => void;
|
|
70
|
+
/** Clears the answer to the shown question and moves to the next one. */
|
|
71
|
+
skip: () => void;
|
|
72
|
+
destroy(): void;
|
|
73
|
+
private _fieldsets;
|
|
74
|
+
/** The footer's navigation and submit buttons. */
|
|
75
|
+
private _buttons;
|
|
76
|
+
private _controls;
|
|
77
|
+
private _required;
|
|
78
|
+
private _ensureId;
|
|
79
|
+
private _render;
|
|
80
|
+
/**
|
|
81
|
+
* Puts "choose at least one" on the first enabled checkbox of each
|
|
82
|
+
* data-required group with none checked, so the browser's validation, and
|
|
83
|
+
* every way of submitting, sees it. A disabled checkbox is not sent, so it
|
|
84
|
+
* does not count.
|
|
85
|
+
*/
|
|
86
|
+
private _syncRequired;
|
|
87
|
+
/** The first control in the question that still needs an answer. */
|
|
88
|
+
private _invalidControl;
|
|
89
|
+
/** Shows the question's error and returns false when it needs an answer. */
|
|
90
|
+
private _validate;
|
|
91
|
+
private _setInvalid;
|
|
92
|
+
private _handleClick;
|
|
93
|
+
private _handleKeydown;
|
|
94
|
+
private _handleInvalid;
|
|
95
|
+
private _handleInput;
|
|
96
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { InitElements, InitElement } from '../core/component';
|
|
2
|
+
import { LineChart, LineChartOptions } from './lineChart';
|
|
3
|
+
export type RadarChartOptions = LineChartOptions;
|
|
4
|
+
/**
|
|
5
|
+
* Radar chart. It reads its <table> like LineChart, but each row is a spoke,
|
|
6
|
+
* clockwise from the top, and each value column is a series drawn as a
|
|
7
|
+
* shape joining its values on the spokes, from zero in the middle to the
|
|
8
|
+
* scale's top at the rim. The row labels sit round the rim.
|
|
9
|
+
*
|
|
10
|
+
* Re-run `RadarChart.init(el)` after changing the table.
|
|
11
|
+
*/
|
|
12
|
+
export declare class RadarChart extends LineChart {
|
|
13
|
+
protected get _type(): string;
|
|
14
|
+
protected get _key(): string;
|
|
15
|
+
/** The scale starts at zero, the middle, so shapes compare by size. */
|
|
16
|
+
protected get _fromZero(): boolean;
|
|
17
|
+
protected get _circular(): boolean;
|
|
18
|
+
static init(el: HTMLElement, options?: Partial<RadarChartOptions>): RadarChart;
|
|
19
|
+
static init(els: InitElements<InitElement>, options?: Partial<RadarChartOptions>): RadarChart[];
|
|
20
|
+
static getInstance(el: HTMLElement): RadarChart;
|
|
21
|
+
/**
|
|
22
|
+
* The cursor is a spoke turned by --turn, and the tooltip sits past its
|
|
23
|
+
* tip. LineChart's points on the spoke keep their top, a share of the
|
|
24
|
+
* radius, which stops at the rim and the middle like the shapes.
|
|
25
|
+
*/
|
|
26
|
+
protected _place(index: number): void;
|
|
27
|
+
/** A row's spoke as a fraction of a turn clockwise from the top. */
|
|
28
|
+
private _turn;
|
|
29
|
+
/** Only the legend; the labels go round the rim in _draw. */
|
|
30
|
+
protected _guides(): Element[];
|
|
31
|
+
/** The nearest spoke to the pointer, by its angle from the middle. */
|
|
32
|
+
protected _indexAt(e: PointerEvent): number;
|
|
33
|
+
/**
|
|
34
|
+
* An SVG in a -50 to 50 box: the rings and spokes of the grid, then each
|
|
35
|
+
* series' shape, with its points for .points. The rim is the box's edge;
|
|
36
|
+
* the labels round it are HTML.
|
|
37
|
+
*/
|
|
38
|
+
protected _draw(): Element;
|
|
39
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { InitElements, InitElement } from '../core/component';
|
|
2
|
+
import { LineChart, LineChartOptions } from './lineChart';
|
|
3
|
+
export type RadialChartOptions = LineChartOptions;
|
|
4
|
+
/**
|
|
5
|
+
* Radial chart. It reads its <table> like LineChart, but draws each row of
|
|
6
|
+
* the first value column as a ring, outermost first, filled clockwise from
|
|
7
|
+
* the top as a share of `data-max` above zero (100 by default). With `.gauge` the rings
|
|
8
|
+
* are half circles over the middle. A <tfoot> row shows in the middle, and
|
|
9
|
+
* a legend lists the rows when there is more than one. Further columns show
|
|
10
|
+
* in the tooltip.
|
|
11
|
+
*
|
|
12
|
+
* Re-run `RadialChart.init(el)` after changing the table or the ring tokens.
|
|
13
|
+
*/
|
|
14
|
+
export declare class RadialChart extends LineChart {
|
|
15
|
+
/** Each ring's middle radius, and their shared width. */
|
|
16
|
+
private _radii;
|
|
17
|
+
private _width;
|
|
18
|
+
/** Each row's share of the maximum, from 0 to 1. */
|
|
19
|
+
private _fractions;
|
|
20
|
+
private _rings;
|
|
21
|
+
protected get _type(): string;
|
|
22
|
+
protected get _key(): string;
|
|
23
|
+
protected get _points(): boolean;
|
|
24
|
+
protected get _circular(): boolean;
|
|
25
|
+
private get _gauge();
|
|
26
|
+
static init(el: HTMLElement, options?: Partial<RadialChartOptions>): RadialChart;
|
|
27
|
+
static init(els: InitElements<InitElement>, options?: Partial<RadialChartOptions>): RadialChart[];
|
|
28
|
+
static getInstance(el: HTMLElement): RadialChart;
|
|
29
|
+
show(index: number): void;
|
|
30
|
+
/** The tooltip sits where the ring's fill ends. */
|
|
31
|
+
protected _place(index: number): void;
|
|
32
|
+
private _color;
|
|
33
|
+
/** A fraction of the ring as a turn clockwise from the top. */
|
|
34
|
+
private _turn;
|
|
35
|
+
/** For more than one row, a legend of every row with its color and cell. */
|
|
36
|
+
protected _guides(): Element[];
|
|
37
|
+
/** The ring under the pointer by its distance from the middle, or -1. */
|
|
38
|
+
protected _indexAt(e: PointerEvent): number;
|
|
39
|
+
/**
|
|
40
|
+
* An SVG of rings in a -50 to 50 box, the top half for a gauge. Each row
|
|
41
|
+
* is a track circle and a fill circle whose dash is its share; CSS draws
|
|
42
|
+
* them from --radial-chart-dash. The total is HTML over it.
|
|
43
|
+
*/
|
|
44
|
+
protected _draw(): Element;
|
|
45
|
+
}
|
|
@@ -43,14 +43,58 @@ export declare const AUTO_INIT_COMPONENTS: {
|
|
|
43
43
|
component: typeof Components.Chips;
|
|
44
44
|
selector: string;
|
|
45
45
|
};
|
|
46
|
+
ColumnChart: {
|
|
47
|
+
component: typeof Components.ColumnChart;
|
|
48
|
+
selector: string;
|
|
49
|
+
};
|
|
50
|
+
BarChart: {
|
|
51
|
+
component: typeof Components.BarChart;
|
|
52
|
+
selector: string;
|
|
53
|
+
};
|
|
54
|
+
PieChart: {
|
|
55
|
+
component: typeof Components.PieChart;
|
|
56
|
+
selector: string;
|
|
57
|
+
};
|
|
58
|
+
HeatmapChart: {
|
|
59
|
+
component: typeof Components.HeatmapChart;
|
|
60
|
+
selector: string;
|
|
61
|
+
};
|
|
62
|
+
RadarChart: {
|
|
63
|
+
component: typeof Components.RadarChart;
|
|
64
|
+
selector: string;
|
|
65
|
+
};
|
|
66
|
+
RadialChart: {
|
|
67
|
+
component: typeof Components.RadialChart;
|
|
68
|
+
selector: string;
|
|
69
|
+
};
|
|
70
|
+
MixedChart: {
|
|
71
|
+
component: typeof Components.MixedChart;
|
|
72
|
+
selector: string;
|
|
73
|
+
};
|
|
74
|
+
CommandPalette: {
|
|
75
|
+
component: typeof Components.CommandPalette;
|
|
76
|
+
selector: string;
|
|
77
|
+
};
|
|
78
|
+
Questionnaire: {
|
|
79
|
+
component: typeof Components.Questionnaire;
|
|
80
|
+
selector: string;
|
|
81
|
+
};
|
|
46
82
|
Datepicker: {
|
|
47
83
|
component: typeof Components.Datepicker;
|
|
48
84
|
selector: string;
|
|
49
85
|
};
|
|
86
|
+
LineChart: {
|
|
87
|
+
component: typeof Components.LineChart;
|
|
88
|
+
selector: string;
|
|
89
|
+
};
|
|
50
90
|
Menu: {
|
|
51
91
|
component: typeof Components.Menu;
|
|
52
92
|
selector: string;
|
|
53
93
|
};
|
|
94
|
+
MessageScroller: {
|
|
95
|
+
component: typeof Components.MessageScroller;
|
|
96
|
+
selector: string;
|
|
97
|
+
};
|
|
54
98
|
Lightbox: {
|
|
55
99
|
component: typeof Components.Lightbox;
|
|
56
100
|
selector: string;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Component, BaseOptions, InitElements, InitElement } from '../core/component';
|
|
2
|
+
/**
|
|
3
|
+
* The parts of a Tiptap `Editor` this component uses. Declared here so the
|
|
4
|
+
* published types do not depend on Tiptap.
|
|
5
|
+
*/
|
|
6
|
+
export interface RichTextEditorInstance {
|
|
7
|
+
commands: object;
|
|
8
|
+
isEditable: boolean;
|
|
9
|
+
isEmpty: boolean;
|
|
10
|
+
chain(): any;
|
|
11
|
+
can(): any;
|
|
12
|
+
isActive(name: string, attributes?: object): boolean;
|
|
13
|
+
getHTML(): string;
|
|
14
|
+
on(event: string, callback: () => void): unknown;
|
|
15
|
+
off(event: string, callback: () => void): unknown;
|
|
16
|
+
destroy(): void;
|
|
17
|
+
}
|
|
18
|
+
export interface RichTextEditorOptions extends BaseOptions {
|
|
19
|
+
/**
|
|
20
|
+
* Tiptap's `Editor` class. ExpressiveCSS does not bundle Tiptap, so the
|
|
21
|
+
* page imports it and passes it in.
|
|
22
|
+
* @default null
|
|
23
|
+
*/
|
|
24
|
+
Editor: (new (options: any) => RichTextEditorInstance) | null;
|
|
25
|
+
/**
|
|
26
|
+
* Tiptap extensions, usually `[StarterKit]`.
|
|
27
|
+
* @default []
|
|
28
|
+
*/
|
|
29
|
+
extensions: unknown[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A rich text editor built on Tiptap: a `.rich-text-editor` holding a
|
|
33
|
+
* `<textarea>` and, usually, a `.toolbar` of `[data-command]` buttons.
|
|
34
|
+
*
|
|
35
|
+
* The textarea's value is the starting HTML. The component hides it, mounts
|
|
36
|
+
* the editor after it and writes the editor's HTML back on every change, so
|
|
37
|
+
* the textarea still submits with its form. A button's `data-command` names a
|
|
38
|
+
* Tiptap command and `data-attributes` holds its JSON argument. Buttons are
|
|
39
|
+
* disabled when their command cannot run, and `toggle*` commands report their
|
|
40
|
+
* state with `aria-pressed` and `.active`.
|
|
41
|
+
*/
|
|
42
|
+
export declare class RichTextEditor extends Component<RichTextEditorOptions> {
|
|
43
|
+
/** The Tiptap editor. */
|
|
44
|
+
editor: RichTextEditorInstance | null;
|
|
45
|
+
/** The form value. */
|
|
46
|
+
textarea: HTMLTextAreaElement | null;
|
|
47
|
+
/** The element the editor is mounted in. */
|
|
48
|
+
content: HTMLElement | null;
|
|
49
|
+
private _actions;
|
|
50
|
+
private _label;
|
|
51
|
+
constructor(el: HTMLElement, options: Partial<RichTextEditorOptions>);
|
|
52
|
+
static get defaults(): RichTextEditorOptions;
|
|
53
|
+
/**
|
|
54
|
+
* Initializes instance of RichTextEditor.
|
|
55
|
+
* @param el HTML element.
|
|
56
|
+
* @param options Component options.
|
|
57
|
+
*/
|
|
58
|
+
static init(el: HTMLElement, options?: Partial<RichTextEditorOptions>): RichTextEditor;
|
|
59
|
+
/**
|
|
60
|
+
* Initializes instances of RichTextEditor.
|
|
61
|
+
* @param els HTML elements.
|
|
62
|
+
* @param options Component options.
|
|
63
|
+
*/
|
|
64
|
+
static init(els: InitElements<InitElement>, options?: Partial<RichTextEditorOptions>): RichTextEditor[];
|
|
65
|
+
static getInstance(el: HTMLElement): RichTextEditor;
|
|
66
|
+
destroy(): void;
|
|
67
|
+
private _handleClick;
|
|
68
|
+
private _handleLabelClick;
|
|
69
|
+
private _handleUpdate;
|
|
70
|
+
private _handleTransaction;
|
|
71
|
+
}
|
package/dist/types/modular.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { SideSheets } from './behaviors/sideSheets';
|
|
|
5
5
|
export { Forms } from './behaviors/forms';
|
|
6
6
|
export { AutoInit } from './components/registry';
|
|
7
7
|
export type { AutoInitOptions } from './components/registry';
|
|
8
|
-
export declare const version = "0.
|
|
8
|
+
export declare const version = "0.13.1";
|
|
9
9
|
export type * from './components/autocomplete';
|
|
10
10
|
export type * from './components/appBar';
|
|
11
11
|
export type * from './components/buttons';
|
|
@@ -15,6 +15,15 @@ export type * from './components/expandingCard';
|
|
|
15
15
|
export type * from './components/carousel';
|
|
16
16
|
export type * from './components/characterCounter';
|
|
17
17
|
export type * from './components/chips';
|
|
18
|
+
export type * from './components/lineChart';
|
|
19
|
+
export type * from './components/columnChart';
|
|
20
|
+
export type * from './components/barChart';
|
|
21
|
+
export type * from './components/pieChart';
|
|
22
|
+
export type * from './components/heatmapChart';
|
|
23
|
+
export type * from './components/radarChart';
|
|
24
|
+
export type * from './components/radialChart';
|
|
25
|
+
export type * from './components/mixedChart';
|
|
26
|
+
export type * from './components/questionnaire';
|
|
18
27
|
export type * from './components/datepicker';
|
|
19
28
|
export type * from './components/menu';
|
|
20
29
|
export type * from './components/lightbox';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expressivecss/expressive",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "ExpressiveCSS - a Material Design 3 front-end framework.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "BaezFJ <baezdevs@gmail.com>",
|
|
@@ -130,6 +130,9 @@
|
|
|
130
130
|
"@fontsource/noto-sans": "^5.3.0",
|
|
131
131
|
"@fontsource/roboto": "^5.3.0",
|
|
132
132
|
"@playwright/test": "^1.56.0",
|
|
133
|
+
"@tiptap/core": "^3.31.4",
|
|
134
|
+
"@tiptap/pm": "^3.31.4",
|
|
135
|
+
"@tiptap/starter-kit": "^3.31.4",
|
|
133
136
|
"astro": "^7.2.8",
|
|
134
137
|
"esbuild": "^0.28.2",
|
|
135
138
|
"fallow": "^3.23.0",
|
package/src/sass/README.md
CHANGED
|
@@ -102,12 +102,9 @@ comparators, so each boundary is written once without fractional max-widths.
|
|
|
102
102
|
each pair onto the live `--md-sys-color-<role>` name with `light-dark()`, in one
|
|
103
103
|
`@each` over `$sys-color-roles`.
|
|
104
104
|
|
|
105
|
-
The shipped seed is `#
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
(0–60°) put primary on top of error — ΔEok 0.07–0.12 against ~0.28 for teal.
|
|
109
|
-
Green is avoided so it stays available for a "settled/paid" role, which Material
|
|
110
|
-
does not supply. See the comment above `$md-source`.
|
|
105
|
+
The shipped seed is `#c6a0f6`, named Mist Iris in the docs picker. The ramps
|
|
106
|
+
derive their hues from this seed, with fixed chroma and tone values. The error
|
|
107
|
+
ramp stays fixed when the seed changes.
|
|
111
108
|
|
|
112
109
|
Setting `--md-source` re-themes the whole system at runtime, with no rebuild:
|
|
113
110
|
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
@forward "elevation"; // z-depth() mixin
|
|
5
5
|
@forward "breakpoints"; // $breakpoints map + bp-up()/bp-down()/bp-between()
|
|
6
6
|
@forward "variables"; // Sass-time knobs: grid, font sizes, flow text
|
|
7
|
-
@forward "mixins"; // btn-*, focus-visible
|
|
7
|
+
@forward "mixins"; // btn-*, focus-visible, chart()
|