@redvars/peacock 3.16.0 → 3.17.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/dist/assets/styles.css +1 -1
- package/dist/assets/styles.css.map +1 -1
- package/dist/assets/theme.js +19 -19
- package/dist/assets/tokens.css +1 -1
- package/dist/assets/tokens.css.map +1 -1
- package/dist/card-content.js +8 -7
- package/dist/card-content.js.map +1 -1
- package/dist/card.js +142 -98
- package/dist/card.js.map +1 -1
- package/dist/{chart-bar-D5dGFJfK.js → cartesian-chart-DgE4USyC.js} +529 -312
- package/dist/cartesian-chart-DgE4USyC.js.map +1 -0
- package/dist/chart-area.js +78 -0
- package/dist/chart-area.js.map +1 -0
- package/dist/chart-bar.js +283 -213
- package/dist/chart-bar.js.map +1 -1
- package/dist/{transform-DSwFSqzD.js → chart-base-C2qRMF48.js} +771 -102
- package/dist/chart-base-C2qRMF48.js.map +1 -0
- package/dist/chart-doughnut.js +55 -287
- package/dist/chart-doughnut.js.map +1 -1
- package/dist/chart-line.js +626 -0
- package/dist/chart-line.js.map +1 -0
- package/dist/chart-pie.js +637 -195
- package/dist/chart-pie.js.map +1 -1
- package/dist/code-editor.js +704 -131
- package/dist/code-editor.js.map +1 -1
- package/dist/code-group.js +188 -0
- package/dist/code-group.js.map +1 -0
- package/dist/code-highlighter.js +895 -257
- package/dist/code-highlighter.js.map +1 -1
- package/dist/custom-elements-jsdocs.json +1675 -222
- package/dist/custom-elements.json +13351 -3970
- package/dist/image.js +5 -1
- package/dist/image.js.map +1 -1
- package/dist/index.js +8 -7
- package/dist/index.js.map +1 -1
- package/dist/loader-full.js +1 -1
- package/dist/loader.js +9 -3
- package/dist/loader.js.map +1 -1
- package/dist/{is-dark-mode-DOcaw4Yq.js → observe-theme-change-DCifz1uv.js} +2 -6
- package/dist/observe-theme-change-DCifz1uv.js.map +1 -0
- package/dist/path-CJ0Arqcy.js +166 -0
- package/dist/path-CJ0Arqcy.js.map +1 -0
- package/dist/snackbar.js +89 -34
- package/dist/snackbar.js.map +1 -1
- package/dist/src/__internal/chart/cartesian-chart.d.ts +80 -0
- package/dist/src/__internal/chart/chart-base.d.ts +113 -0
- package/dist/src/__internal/chart/paths.d.ts +5 -0
- package/dist/src/__internal/chart/types.d.ts +42 -0
- package/dist/src/card/card-content.d.ts +2 -3
- package/dist/src/card/card.d.ts +31 -17
- package/dist/src/chart-area/chart-area.d.ts +54 -0
- package/dist/src/chart-area/index.d.ts +1 -0
- package/dist/src/chart-bar/chart-bar.d.ts +44 -33
- package/dist/src/chart-bar/index.d.ts +0 -1
- package/dist/src/chart-doughnut/chart-doughnut.d.ts +33 -39
- package/dist/src/chart-line/chart-line.d.ts +69 -0
- package/dist/src/chart-line/index.d.ts +1 -0
- package/dist/src/chart-pie/chart-pie.d.ts +63 -28
- package/dist/src/code-editor/code-editor.d.ts +52 -13
- package/dist/src/code-editor/editor-theme.d.ts +60 -0
- package/dist/src/code-highlighter/code-group.d.ts +52 -0
- package/dist/src/code-highlighter/code-highlighter.d.ts +122 -15
- package/dist/src/code-highlighter/index.d.ts +1 -0
- package/dist/src/code-highlighter/line-ranges.d.ts +24 -0
- package/dist/src/code-highlighter/local.d.ts +4 -1
- package/dist/src/code-highlighter/token-colors.d.ts +8 -0
- package/dist/src/index.d.ts +4 -2
- package/dist/src/snackbar/snackbar.d.ts +13 -1
- package/dist/src/toolbar/toolbar.d.ts +56 -51
- package/dist/table.js +9 -4
- package/dist/table.js.map +1 -1
- package/dist/test/chart.test.d.ts +1 -0
- package/dist/test/code-highlighter.test.d.ts +1 -0
- package/dist/token-colors-0TFHWbcq.js +81 -0
- package/dist/token-colors-0TFHWbcq.js.map +1 -0
- package/dist/toolbar.js +195 -184
- package/dist/toolbar.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -2
- package/readme.md +7 -6
- package/scss/_code-block.scss +139 -0
- package/scss/tokens.css +24 -0
- package/src/__internal/chart/cartesian-chart.ts +404 -0
- package/src/__internal/chart/chart-base.scss +252 -0
- package/src/__internal/chart/chart-base.ts +474 -0
- package/src/__internal/chart/paths.ts +28 -0
- package/src/__internal/chart/types.ts +49 -0
- package/src/card/card-content.ts +12 -9
- package/src/card/card.scss +66 -54
- package/src/card/card.ts +109 -73
- package/src/chart-area/chart-area.ts +82 -0
- package/src/chart-area/index.ts +1 -0
- package/src/chart-bar/chart-bar.ts +336 -250
- package/src/chart-bar/index.ts +0 -1
- package/src/chart-doughnut/chart-doughnut.ts +62 -262
- package/src/chart-doughnut/demo/index.html +14 -22
- package/src/chart-line/chart-line.scss +25 -0
- package/src/chart-line/chart-line.ts +346 -0
- package/src/chart-line/index.ts +1 -0
- package/src/chart-pie/chart-pie.scss +35 -16
- package/src/chart-pie/chart-pie.ts +282 -188
- package/src/chart-pie/demo/index.html +13 -21
- package/src/code-editor/code-editor.scss +132 -36
- package/src/code-editor/code-editor.ts +308 -88
- package/src/code-editor/demo/index.html +39 -12
- package/src/code-editor/editor-theme.ts +213 -0
- package/src/code-highlighter/code-group.scss +34 -0
- package/src/code-highlighter/code-group.ts +173 -0
- package/src/code-highlighter/code-highlighter.scss +226 -111
- package/src/code-highlighter/code-highlighter.ts +554 -199
- package/src/code-highlighter/demo/index.html +68 -4
- package/src/code-highlighter/index.ts +1 -0
- package/src/code-highlighter/line-ranges.ts +81 -0
- package/src/code-highlighter/local.ts +9 -3
- package/src/code-highlighter/token-colors.ts +42 -0
- package/src/index.ts +4 -2
- package/src/loader.ts +8 -2
- package/src/snackbar/demo/index.html +39 -4
- package/src/snackbar/snackbar.scss +27 -10
- package/src/snackbar/snackbar.ts +80 -37
- package/src/table/table.scss +7 -1
- package/src/table/table.ts +4 -3
- package/src/toolbar/toolbar-colors.scss +6 -7
- package/src/toolbar/toolbar.scss +35 -106
- package/src/toolbar/toolbar.ts +180 -80
- package/dist/array-D5vjT2Xm.js +0 -14
- package/dist/array-D5vjT2Xm.js.map +0 -1
- package/dist/chart-bar-D5dGFJfK.js.map +0 -1
- package/dist/chart-stacked-bar.js +0 -403
- package/dist/chart-stacked-bar.js.map +0 -1
- package/dist/copy-to-clipboard-upGx-Ueo.js +0 -39
- package/dist/copy-to-clipboard-upGx-Ueo.js.map +0 -1
- package/dist/is-dark-mode-DOcaw4Yq.js.map +0 -1
- package/dist/pie-Dz0IDiPt.js +0 -537
- package/dist/pie-Dz0IDiPt.js.map +0 -1
- package/dist/pierre-dark-DFWl0m-C.js +0 -4
- package/dist/pierre-dark-DFWl0m-C.js.map +0 -1
- package/dist/pierre-light-BEkAPImt.js +0 -4
- package/dist/pierre-light-BEkAPImt.js.map +0 -1
- package/dist/src/chart-bar/chart-stacked-bar.d.ts +0 -78
- package/dist/src/code-highlighter/constants.d.ts +0 -1
- package/dist/transform-DSwFSqzD.js.map +0 -1
- package/src/chart-bar/chart-bar.scss +0 -58
- package/src/chart-bar/chart-stacked-bar.ts +0 -398
- package/src/chart-doughnut/chart-donut.scss +0 -37
- package/src/code-highlighter/constants.ts +0 -117
- /package/dist/test/{chart-bar.test.d.ts → card.test.d.ts} +0 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* @label Code Group
|
|
4
|
+
* @tag wc-code-group
|
|
5
|
+
* @rawTag code-group
|
|
6
|
+
*
|
|
7
|
+
* @summary Shows several code blocks in one frame, with a tab for each block.
|
|
8
|
+
* @overview
|
|
9
|
+
* <p>Put <code>wc-code-highlighter</code> elements inside. Each block's <code>label</code> names its tab,
|
|
10
|
+
* and only the selected block is shown. The group draws the frame, so the blocks drop their own
|
|
11
|
+
* border and header, and their actions float at the top end.</p>
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```html
|
|
15
|
+
* <wc-code-group>
|
|
16
|
+
* <wc-code-highlighter label="greeting.ts" language="typescript"><pre><code>
|
|
17
|
+
* export const greeting = 'Hello';</code></pre></wc-code-highlighter>
|
|
18
|
+
* <wc-code-highlighter label="greeting.css" language="css"><pre><code>
|
|
19
|
+
* p { color: var(--color-primary); }</code></pre></wc-code-highlighter>
|
|
20
|
+
* </wc-code-group>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @slot - `wc-code-highlighter` elements, one per tab.
|
|
24
|
+
*
|
|
25
|
+
* @csspart container - The outer frame.
|
|
26
|
+
* @csspart header - The tab bar.
|
|
27
|
+
*
|
|
28
|
+
* @fires {CustomEvent<{index: number}>} change - Dispatched when the user selects another tab.
|
|
29
|
+
*
|
|
30
|
+
* @tags display
|
|
31
|
+
*/
|
|
32
|
+
export declare class CodeGroup extends LitElement {
|
|
33
|
+
static styles: import("lit").CSSResultGroup[];
|
|
34
|
+
/** Index of the shown block. */
|
|
35
|
+
selectedIndex: number;
|
|
36
|
+
/** The grouped code blocks, in slot order. */
|
|
37
|
+
private _blocks;
|
|
38
|
+
/** Re-renders the tabs when a block's label changes. */
|
|
39
|
+
private __labelObserver?;
|
|
40
|
+
connectedCallback(): void;
|
|
41
|
+
disconnectedCallback(): void;
|
|
42
|
+
protected updated(changed: Map<PropertyKey, unknown>): void;
|
|
43
|
+
/** The selected index, kept within the blocks. */
|
|
44
|
+
private get __activeIndex();
|
|
45
|
+
/** Marks every block as grouped and shows only the selected one. */
|
|
46
|
+
private __syncBlocks;
|
|
47
|
+
private __handleSlotChange;
|
|
48
|
+
private __handleTabChange;
|
|
49
|
+
private __stopEvent;
|
|
50
|
+
private __tabLabel;
|
|
51
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
52
|
+
}
|
|
@@ -1,40 +1,147 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
import type { BundledLanguage } from 'shiki';
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
import type { BundledLanguage, SpecialLanguage } from 'shiki';
|
|
3
|
+
export type CodeHighlighterLanguage = BundledLanguage | SpecialLanguage;
|
|
4
|
+
export type CodeHighlighterSize = 'sm' | 'md';
|
|
5
|
+
export type CodeHighlighterVariant = 'default' | 'error';
|
|
3
6
|
/**
|
|
4
7
|
* @label Code Highlighter
|
|
5
8
|
* @tag wc-code-highlighter
|
|
6
9
|
* @rawTag code-highlighter
|
|
7
10
|
*
|
|
8
|
-
* @summary
|
|
11
|
+
* @summary Displays a block of code with syntax highlighting, line numbers, line highlights, diffs and a copy button.
|
|
9
12
|
*
|
|
10
13
|
* @example
|
|
11
14
|
* ```html
|
|
12
|
-
* <wc-code-highlighter language="javascript"
|
|
15
|
+
* <wc-code-highlighter language="javascript" label="hello.js" line-numbers highlight-lines="2"><pre><code>
|
|
13
16
|
* function helloWorld() {
|
|
14
17
|
* console.log('Hello, world!');
|
|
15
18
|
* }</code></pre>
|
|
16
19
|
* </wc-code-highlighter>
|
|
17
20
|
* ```
|
|
21
|
+
*
|
|
22
|
+
* @slot title - Header title content. Overrides `label` and shows the header.
|
|
23
|
+
* @slot icon - Icon shown before the title in the header.
|
|
24
|
+
* @slot actions - Extra action buttons, shown in the header or floating at the top end.
|
|
25
|
+
*
|
|
26
|
+
* @csspart container - The outer block.
|
|
27
|
+
* @csspart header - The header row.
|
|
28
|
+
* @csspart title - The header title.
|
|
29
|
+
* @csspart actions - The action buttons group.
|
|
30
|
+
* @csspart content - The scrollable code area (`pre`).
|
|
31
|
+
* @csspart line - Each code line.
|
|
32
|
+
* @csspart footer - The footer holding the show more button.
|
|
33
|
+
*
|
|
34
|
+
* @cssprop --code-highlighter-background - Block background. Defaults to `--color-surface-container-low`.
|
|
35
|
+
* @cssprop --code-highlighter-border-color - Block border color. Defaults to `--color-outline-variant`.
|
|
36
|
+
* @cssprop --code-highlighter-shape - Block corner radius. Defaults to `--shape-corner-medium`.
|
|
37
|
+
* @cssprop --code-highlighter-max-height - Caps the code area height; it scrolls beyond. Defaults to `none`.
|
|
38
|
+
* @cssprop --code-highlighter-collapsed-height - Height of a collapsed `collapsible` block. Defaults to `16rem`.
|
|
39
|
+
* @cssprop --code-highlighter-foreground - Plain code color. Defaults to `--color-on-surface`.
|
|
40
|
+
* @cssprop --code-highlighter-token-keyword - Keyword color. Defaults to `--color-purple`.
|
|
41
|
+
* @cssprop --code-highlighter-token-string - String color. Defaults to `--color-green`.
|
|
42
|
+
* @cssprop --code-highlighter-token-function - Function color. Defaults to `--color-blue`.
|
|
43
|
+
* @cssprop --code-highlighter-token-constant - Constant and number color. Defaults to `--color-orange`.
|
|
44
|
+
* @cssprop --code-highlighter-token-comment - Comment color. Defaults to `--color-on-surface-variant`.
|
|
45
|
+
* @cssprop --code-highlighter-token-punctuation - Punctuation color. Defaults to `--color-on-surface-variant`.
|
|
46
|
+
*
|
|
47
|
+
* @fires {CustomEvent<{value: string}>} copied - Dispatched after the copy button copies the code.
|
|
48
|
+
* @fires {CustomEvent<{expanded: boolean}>} expanded-change - Dispatched when a collapsible block is expanded or collapsed.
|
|
49
|
+
*
|
|
18
50
|
* @tags display
|
|
19
51
|
*/
|
|
20
52
|
export declare class CodeHighlighter extends LitElement {
|
|
21
53
|
static styles: import("lit").CSSResultGroup[];
|
|
22
54
|
private static readonly COPY_FEEDBACK_DURATION;
|
|
23
|
-
|
|
24
|
-
|
|
55
|
+
/** Language of the code. Unknown languages render as plain text. */
|
|
56
|
+
language: CodeHighlighterLanguage;
|
|
57
|
+
/** Code to display. When empty, the code is read from a light-DOM `<pre><code>`. */
|
|
25
58
|
value: string;
|
|
26
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Formats JavaScript, HTML and CSS with Prettier before display.
|
|
61
|
+
* Set `format="false"` to show the code as written.
|
|
62
|
+
*/
|
|
63
|
+
format: boolean;
|
|
64
|
+
/** Header title, such as a file path. Shows the header. */
|
|
65
|
+
label: string;
|
|
66
|
+
/** Shows line numbers. */
|
|
67
|
+
lineNumbers: boolean;
|
|
68
|
+
/** Number of the first line when line numbers are shown. */
|
|
69
|
+
startLine: number;
|
|
70
|
+
/** Wraps long lines instead of scrolling horizontally. */
|
|
71
|
+
wrap: boolean;
|
|
72
|
+
/** Shows a button that turns line wrapping on and off. */
|
|
73
|
+
wrapToggle: boolean;
|
|
74
|
+
/** Lines to highlight, such as `"1, 3-5"`. Counts displayed lines, after formatting. */
|
|
75
|
+
highlightLines: string;
|
|
76
|
+
/** Lines shown as added in a diff, such as `"4-6"`. */
|
|
77
|
+
addedLines: string;
|
|
78
|
+
/** Lines shown as removed in a diff, such as `"3"`. */
|
|
79
|
+
removedLines: string;
|
|
80
|
+
/** Caps the height and adds a show more button when the code is taller. */
|
|
81
|
+
collapsible: boolean;
|
|
82
|
+
/** Whether a collapsible block is expanded. */
|
|
83
|
+
expanded: boolean;
|
|
84
|
+
/** Size of the block. `sm` suits tool output and dense layouts. */
|
|
85
|
+
size: CodeHighlighterSize;
|
|
86
|
+
/** Visual variant. `error` tints the block for failure output. */
|
|
87
|
+
variant: CodeHighlighterVariant;
|
|
88
|
+
/** Hides the copy button. */
|
|
27
89
|
hideCopy: boolean;
|
|
28
|
-
|
|
90
|
+
/** Text the copy button copies instead of the displayed code. */
|
|
91
|
+
copyValue?: string;
|
|
92
|
+
/** Renders the code inline, as a compact chip within text. */
|
|
93
|
+
inline: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Set by `wc-code-group`. The group draws the frame and shows the label as a
|
|
96
|
+
* tab, so the block drops its border and header.
|
|
97
|
+
*/
|
|
98
|
+
grouped: boolean;
|
|
99
|
+
/** The code as displayed, after formatting, without a trailing newline. */
|
|
100
|
+
private _code;
|
|
101
|
+
/** Tokens per line, or `null` until highlighting finishes. */
|
|
102
|
+
private _tokens;
|
|
103
|
+
/** Whether the copy button shows its copied feedback. */
|
|
29
104
|
private _copied;
|
|
30
|
-
|
|
31
|
-
private
|
|
32
|
-
|
|
105
|
+
/** Whether the collapsed code is taller than the collapsed height. */
|
|
106
|
+
private _overflowing;
|
|
107
|
+
private __content?;
|
|
108
|
+
private __codeElement?;
|
|
109
|
+
/** Source read from `value` or the light DOM, before formatting. */
|
|
110
|
+
private __source;
|
|
111
|
+
/** Line variants keyed by 1-based line number. */
|
|
112
|
+
private __lineVariants;
|
|
113
|
+
/** Increments per highlight run so stale async results are dropped. */
|
|
114
|
+
private __run;
|
|
115
|
+
/** Timer that resets the copy feedback. */
|
|
116
|
+
private __copyFeedbackTimeout;
|
|
117
|
+
/** Measures whether collapsed code overflows. */
|
|
118
|
+
private __resizeObserver?;
|
|
119
|
+
/** Element currently measured by the resize observer. */
|
|
120
|
+
private __observedContent?;
|
|
121
|
+
/** Re-renders when slotted header content is added or removed. */
|
|
122
|
+
private __childObserver?;
|
|
123
|
+
connectedCallback(): void;
|
|
33
124
|
disconnectedCallback(): void;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
125
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
126
|
+
protected updated(): void;
|
|
127
|
+
/** Reads the source from `value`, or from the light DOM. */
|
|
128
|
+
private __readSource;
|
|
129
|
+
/** Formats then tokenizes the source; plain lines stay until both finish. */
|
|
130
|
+
private __highlight;
|
|
131
|
+
/** Watches the code area so the show more button appears only when needed. */
|
|
132
|
+
private __observeContent;
|
|
133
|
+
/** Checks whether the collapsed code is taller than its cap. */
|
|
134
|
+
private __measure;
|
|
135
|
+
/** Whether light-DOM children are assigned to the named slot. */
|
|
136
|
+
private __hasSlotted;
|
|
38
137
|
private __handleCopyClick;
|
|
138
|
+
private __handleWrapClick;
|
|
139
|
+
private __handleExpandClick;
|
|
140
|
+
private __renderToken;
|
|
141
|
+
private __renderLine;
|
|
142
|
+
private __renderActions;
|
|
143
|
+
private __renderHeader;
|
|
144
|
+
private __renderFooter;
|
|
145
|
+
private __renderInline;
|
|
39
146
|
render(): import("lit-html").TemplateResult<1>;
|
|
40
147
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type LineVariant = 'highlighted' | 'added' | 'removed';
|
|
2
|
+
/**
|
|
3
|
+
* Parses a line range list such as `"1, 3-5"` into 1-based line numbers.
|
|
4
|
+
* Blank or malformed parts are skipped; a reversed range such as `"5-3"` is read as `3-5`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function parseLineRanges(value: string | null | undefined): Set<number>;
|
|
7
|
+
/**
|
|
8
|
+
* Maps 1-based line numbers to their variant. Where ranges overlap,
|
|
9
|
+
* `removed` wins over `added`, and `added` wins over `highlighted`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function buildLineVariants(ranges: {
|
|
12
|
+
highlighted?: string | null;
|
|
13
|
+
added?: string | null;
|
|
14
|
+
removed?: string | null;
|
|
15
|
+
}): Map<number, LineVariant>;
|
|
16
|
+
/**
|
|
17
|
+
* Removes leading and trailing blank lines and the indentation common to
|
|
18
|
+
* every non-blank line, so indented markup reads as written.
|
|
19
|
+
*/
|
|
20
|
+
export declare function dedent(source: string): string;
|
|
21
|
+
/** Decodes the entities `innerHTML` produces for text, ending with `&`. */
|
|
22
|
+
export declare function decodeEntities(source: string): string;
|
|
23
|
+
/** Splits code into display lines, ignoring one trailing newline. */
|
|
24
|
+
export declare function splitLines(code: string): string[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Syntax colors shared by wc-code-highlighter and wc-code-editor. Each is a CSS variable,
|
|
3
|
+
* `--code-highlighter-<name>`, that falls back to a Peacock color role, so light, dark and
|
|
4
|
+
* custom themes all follow the tokens, and one override restyles both components.
|
|
5
|
+
*/
|
|
6
|
+
export declare const TOKEN_DEFAULTS: Record<string, string>;
|
|
7
|
+
/** The CSS value for a syntax color: its public variable, falling back to the color role. */
|
|
8
|
+
export declare function tokenColor(name: string): string;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export { Menu, MenuItem, SubMenu } from './menu/index.js';
|
|
|
39
39
|
export { List, ListItem } from './list/index.js';
|
|
40
40
|
export { Timeline, TimelineItem } from './timeline/index.js';
|
|
41
41
|
export { Item } from './item/index.js';
|
|
42
|
-
export { CodeHighlighter } from './code-highlighter/index.js';
|
|
42
|
+
export { CodeHighlighter, CodeGroup } from './code-highlighter/index.js';
|
|
43
43
|
export { CodeEditor } from './code-editor/index.js';
|
|
44
44
|
export { HtmlEditor } from './html-editor/index.js';
|
|
45
45
|
export { MarkdownEditor } from './markdown-editor/index.js';
|
|
@@ -51,7 +51,9 @@ export { ColorPicker } from './color-picker/index.js';
|
|
|
51
51
|
export { ColorField } from './color-field/index.js';
|
|
52
52
|
export { ChartDoughnut } from './chart-doughnut/index.js';
|
|
53
53
|
export { ChartPie } from './chart-pie/index.js';
|
|
54
|
-
export { ChartBar
|
|
54
|
+
export { ChartBar } from './chart-bar/index.js';
|
|
55
|
+
export { ChartLine } from './chart-line/index.js';
|
|
56
|
+
export { ChartArea } from './chart-area/index.js';
|
|
55
57
|
export { Table } from './table/index.js';
|
|
56
58
|
export { Pagination } from './pagination/index.js';
|
|
57
59
|
export { SidebarMenu, SidebarMenuItem, SidebarSubMenu, } from './sidebar-menu/index.js';
|
|
@@ -5,6 +5,11 @@ import { LitElement } from 'lit';
|
|
|
5
5
|
* @rawTag snackbar
|
|
6
6
|
* @summary Snackbars provide brief messages about app processes at the bottom of the screen.
|
|
7
7
|
*
|
|
8
|
+
* @overview
|
|
9
|
+
* <p>An open snackbar is shown as a manual popover, so it renders in the browser's top layer, above sticky
|
|
10
|
+
* headers, app bars and open modals whatever their <code>z-index</code>. Opening it again while it is
|
|
11
|
+
* visible brings it back in front of anything opened since.</p>
|
|
12
|
+
*
|
|
8
13
|
* @cssprop --snackbar-container-color - Container color for the snackbar.
|
|
9
14
|
* @cssprop --snackbar-label-text-color - Label text color for the snackbar.
|
|
10
15
|
* @cssprop --snackbar-action-text-color - Action text color.
|
|
@@ -12,7 +17,7 @@ import { LitElement } from 'lit';
|
|
|
12
17
|
* @cssprop --snackbar-border-radius - Border radius of the snackbar surface.
|
|
13
18
|
* @cssprop --snackbar-offset-inline - Inline offset from viewport edges.
|
|
14
19
|
* @cssprop --snackbar-offset-bottom - Bottom offset from viewport edge.
|
|
15
|
-
* @cssprop --snackbar-z-index - Stacking order for the snackbar.
|
|
20
|
+
* @cssprop --snackbar-z-index - Stacking order for the snackbar in browsers without the Popover API.
|
|
16
21
|
*
|
|
17
22
|
* @example
|
|
18
23
|
* ```html
|
|
@@ -40,6 +45,8 @@ export declare class Snackbar extends LitElement {
|
|
|
40
45
|
preview: boolean;
|
|
41
46
|
/** True while the exit animation is running before the snackbar fully closes. */
|
|
42
47
|
private dismissing;
|
|
48
|
+
/** The positioned layer that is shown in the top layer as a popover. */
|
|
49
|
+
private layer?;
|
|
43
50
|
/** Timer handle for the auto-hide timeout. */
|
|
44
51
|
private hideTimer;
|
|
45
52
|
/** Timer handle for the exit animation duration timeout. */
|
|
@@ -58,6 +65,11 @@ export declare class Snackbar extends LitElement {
|
|
|
58
65
|
private clearTimer;
|
|
59
66
|
private clearExitTimer;
|
|
60
67
|
private handleAnimationEnd;
|
|
68
|
+
/**
|
|
69
|
+
* Shows the layer in the top layer while the snackbar is open, and hides it otherwise.
|
|
70
|
+
* With `raise`, an already showing layer is shown again so it moves above newer top-layer elements.
|
|
71
|
+
*/
|
|
72
|
+
private syncLayer;
|
|
61
73
|
private scheduleAutoHide;
|
|
62
74
|
render(): import("lit-html").TemplateResult<1>;
|
|
63
75
|
}
|
|
@@ -1,89 +1,94 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
-
import { type LegacySize, type Size } from '@/__internal/utils/size.js';
|
|
3
2
|
/**
|
|
4
3
|
* @label Toolbar
|
|
5
4
|
* @tag wc-toolbar
|
|
6
5
|
* @rawTag toolbar
|
|
7
6
|
*
|
|
8
|
-
* @summary A
|
|
7
|
+
* @summary A group of related actions, such as editor formatting controls.
|
|
9
8
|
* @overview
|
|
10
|
-
* <p>The toolbar
|
|
11
|
-
*
|
|
12
|
-
* variant
|
|
9
|
+
* <p>The toolbar groups related actions into one control. The <code>floating</code> variant
|
|
10
|
+
* (default) is an elevated pill that sits over content, such as a canvas or a selection. The
|
|
11
|
+
* <code>flat</code> variant has no container of its own, for embedding in existing chrome like a
|
|
12
|
+
* card or editor header. Both variants lay their actions out horizontally or vertically.</p>
|
|
13
13
|
*
|
|
14
|
-
* <p>Render
|
|
15
|
-
*
|
|
16
|
-
*
|
|
14
|
+
* <p>Render actions directly as children. Use a <code>wc-divider</code> to separate groups of
|
|
15
|
+
* actions; in a horizontal toolbar give it the <code>vertical</code> attribute.</p>
|
|
16
|
+
*
|
|
17
|
+
* <p>The toolbar follows the WAI-ARIA toolbar pattern: it is a single tab stop, and the arrow
|
|
18
|
+
* keys along its orientation move focus between actions (Home and End jump to the first and last).
|
|
19
|
+
* Disabled actions and dividers are skipped. Give the toolbar an <code>aria-label</code>.</p>
|
|
17
20
|
*
|
|
18
21
|
* @cssprop --toolbar-container-color - Background color of the toolbar.
|
|
19
|
-
* @cssprop --toolbar-container-shape - Border radius of the
|
|
20
|
-
* @cssprop --toolbar-
|
|
21
|
-
* @cssprop --toolbar-
|
|
22
|
-
* @cssprop --toolbar-
|
|
23
|
-
* @cssprop --toolbar-
|
|
24
|
-
* @cssprop --toolbar-title-color - Color of the title (default slot) text.
|
|
25
|
-
* @cssprop --toolbar-shadow - Box-shadow of the toolbar.
|
|
22
|
+
* @cssprop --toolbar-container-shape - Border radius of the floating toolbar.
|
|
23
|
+
* @cssprop --toolbar-padding - Padding of the floating toolbar.
|
|
24
|
+
* @cssprop --toolbar-gap - Gap between toolbar actions.
|
|
25
|
+
* @cssprop --toolbar-icon-color - Color of icons inside the toolbar.
|
|
26
|
+
* @cssprop --toolbar-content-color - Color of text inside the toolbar.
|
|
26
27
|
*
|
|
27
28
|
* @example
|
|
28
29
|
* ```html
|
|
29
|
-
* <!--
|
|
30
|
-
* <wc-toolbar>
|
|
31
|
-
* <wc-icon-button variant="text" color="surface"><wc-icon name="
|
|
32
|
-
* <wc-icon-button variant="
|
|
33
|
-
* <wc-
|
|
34
|
-
* <wc-icon-button variant="
|
|
30
|
+
* <!-- Floating toolbar -->
|
|
31
|
+
* <wc-toolbar aria-label="Formatting">
|
|
32
|
+
* <wc-icon-button variant="text" color="surface" aria-label="Undo"><wc-icon name="undo"></wc-icon></wc-icon-button>
|
|
33
|
+
* <wc-icon-button variant="text" color="surface" aria-label="Redo"><wc-icon name="redo"></wc-icon></wc-icon-button>
|
|
34
|
+
* <wc-divider vertical></wc-divider>
|
|
35
|
+
* <wc-icon-button variant="tonal" aria-label="Bold"><wc-icon name="format_bold"></wc-icon></wc-icon-button>
|
|
36
|
+
* <wc-icon-button variant="text" color="surface" aria-label="Italic"><wc-icon name="format_italic"></wc-icon></wc-icon-button>
|
|
35
37
|
* </wc-toolbar>
|
|
36
38
|
* ```
|
|
37
39
|
*
|
|
38
40
|
* @example
|
|
39
41
|
* ```html
|
|
40
|
-
* <!--
|
|
41
|
-
* <wc-toolbar
|
|
42
|
-
* <wc-icon-button variant="tonal"><wc-icon name="
|
|
43
|
-
* <wc-icon-button variant="text"><wc-icon name="
|
|
44
|
-
* <wc-icon-button variant="text"><wc-icon name="
|
|
42
|
+
* <!-- Vertical floating toolbar -->
|
|
43
|
+
* <wc-toolbar orientation="vertical" aria-label="Tools">
|
|
44
|
+
* <wc-icon-button variant="tonal" aria-label="Select"><wc-icon name="arrow_selector_tool"></wc-icon></wc-icon-button>
|
|
45
|
+
* <wc-icon-button variant="text" color="surface" aria-label="Draw"><wc-icon name="draw"></wc-icon></wc-icon-button>
|
|
46
|
+
* <wc-icon-button variant="text" color="surface" aria-label="Text"><wc-icon name="text_fields"></wc-icon></wc-icon-button>
|
|
45
47
|
* </wc-toolbar>
|
|
46
48
|
* ```
|
|
47
49
|
*
|
|
48
50
|
* @example
|
|
49
51
|
* ```html
|
|
50
|
-
* <!--
|
|
51
|
-
* <wc-toolbar variant="
|
|
52
|
-
* <wc-icon-button variant="
|
|
53
|
-
* <wc-icon-button variant="text"><wc-icon name="
|
|
54
|
-
* <wc-icon-button variant="text"><wc-icon name="favorite"></wc-icon></wc-icon-button>
|
|
52
|
+
* <!-- Flat toolbar inside existing chrome -->
|
|
53
|
+
* <wc-toolbar variant="flat" aria-label="Row actions">
|
|
54
|
+
* <wc-icon-button variant="text" color="surface" aria-label="Edit"><wc-icon name="edit"></wc-icon></wc-icon-button>
|
|
55
|
+
* <wc-icon-button variant="text" color="surface" aria-label="Delete"><wc-icon name="delete"></wc-icon></wc-icon-button>
|
|
55
56
|
* </wc-toolbar>
|
|
56
57
|
* ```
|
|
57
|
-
* @tags display
|
|
58
|
+
* @tags display
|
|
58
59
|
*/
|
|
59
60
|
export declare class Toolbar extends LitElement {
|
|
60
61
|
static styles: import("lit").CSSResultGroup[];
|
|
61
62
|
/**
|
|
62
|
-
* Visual
|
|
63
|
-
* - `"
|
|
64
|
-
* - `"
|
|
63
|
+
* Visual variant of the toolbar.
|
|
64
|
+
* - `"floating"`: An elevated pill that floats over content (default).
|
|
65
|
+
* - `"flat"`: No container, fill or elevation; for embedding in existing chrome.
|
|
65
66
|
*/
|
|
66
|
-
variant: '
|
|
67
|
+
variant: 'floating' | 'flat';
|
|
67
68
|
/**
|
|
68
|
-
* Orientation of the toolbar
|
|
69
|
-
*
|
|
70
|
-
* - `"vertical"`: Items are stacked top to bottom. Primarily useful for the floating variant.
|
|
69
|
+
* Orientation of the toolbar. It sets the layout direction and the arrow keys that move focus
|
|
70
|
+
* (Left/Right for horizontal, Up/Down for vertical).
|
|
71
71
|
*/
|
|
72
72
|
orientation: 'horizontal' | 'vertical';
|
|
73
73
|
/**
|
|
74
|
-
*
|
|
75
|
-
* - `"sm"`: 80dp height (default).
|
|
76
|
-
* - `"md"`: 96dp height.
|
|
77
|
-
* - `"lg"`: 112dp height.
|
|
78
|
-
*
|
|
79
|
-
* The long names `"small"`, `"medium"` and `"large"` still work but are deprecated.
|
|
80
|
-
*/
|
|
81
|
-
size: Size | LegacySize;
|
|
82
|
-
/**
|
|
83
|
-
* Whether the toolbar is visually elevated (adds a shadow).
|
|
74
|
+
* Raises the floating toolbar to a higher elevation. Has no effect on the flat variant.
|
|
84
75
|
*/
|
|
85
76
|
elevated: boolean;
|
|
77
|
+
/** The item that holds the toolbar's single tab stop. */
|
|
78
|
+
private __activeItem;
|
|
79
|
+
connectedCallback(): void;
|
|
80
|
+
firstUpdated(): void;
|
|
81
|
+
updated(changed: Map<string, unknown>): void;
|
|
82
|
+
/** Actions that can take focus, in slot order. */
|
|
83
|
+
private __getItems;
|
|
84
|
+
/** Gives the active item `tabindex="0"` and every other item `tabindex="-1"`. */
|
|
85
|
+
private __syncTabStops;
|
|
86
|
+
/** Makes `item` the tab stop and focuses it. */
|
|
87
|
+
private __focusItem;
|
|
88
|
+
/** Finds the toolbar item an event came from. */
|
|
89
|
+
private __itemFromEvent;
|
|
90
|
+
private __handleSlotChange;
|
|
91
|
+
private __handleFocusIn;
|
|
92
|
+
private __handleKeyDown;
|
|
86
93
|
render(): import("lit-html").TemplateResult<1>;
|
|
87
|
-
private static __renderDocked;
|
|
88
|
-
private static __renderFloating;
|
|
89
94
|
}
|
package/dist/table.js
CHANGED
|
@@ -70,7 +70,7 @@ var css_248z = i`* {
|
|
|
70
70
|
--_cell-background: var(--table-background);
|
|
71
71
|
display: flex;
|
|
72
72
|
width: max-content;
|
|
73
|
-
min-width: 100
|
|
73
|
+
min-width: max(100%, var(--_row-min-width, 0rem));
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
.columns {
|
|
@@ -261,6 +261,10 @@ var css_248z = i`* {
|
|
|
261
261
|
cursor: default;
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
+
.has-footer .body .row:last-child .cell {
|
|
265
|
+
border-bottom-color: transparent;
|
|
266
|
+
}
|
|
267
|
+
|
|
264
268
|
:host([striped]) .body .row:nth-child(even):not(.selected) {
|
|
265
269
|
--_cell-background: color-mix(
|
|
266
270
|
in srgb,
|
|
@@ -896,7 +900,7 @@ let Table = Table_1 = class Table extends i$1 {
|
|
|
896
900
|
class="row"
|
|
897
901
|
role="row"
|
|
898
902
|
aria-rowindex="1"
|
|
899
|
-
style="min-width: ${this.totalColumnsWidth}rem"
|
|
903
|
+
style="--_row-min-width: ${this.totalColumnsWidth}rem"
|
|
900
904
|
>
|
|
901
905
|
${this.renderRowGroups(columns, (entry, index) => {
|
|
902
906
|
const { column } = entry;
|
|
@@ -997,7 +1001,7 @@ let Table = Table_1 = class Table extends i$1 {
|
|
|
997
1001
|
role="row"
|
|
998
1002
|
aria-rowindex=${rowOffset + rowIndex + 2}
|
|
999
1003
|
aria-selected=${selectable ? String(selected) : A}
|
|
1000
|
-
style="min-width: ${this.totalColumnsWidth}rem"
|
|
1004
|
+
style="--_row-min-width: ${this.totalColumnsWidth}rem"
|
|
1001
1005
|
>
|
|
1002
1006
|
${this.renderRowGroups(columns, (entry, index) => {
|
|
1003
1007
|
const { column } = entry;
|
|
@@ -1053,7 +1057,7 @@ let Table = Table_1 = class Table extends i$1 {
|
|
|
1053
1057
|
<div
|
|
1054
1058
|
class="row skeleton-row"
|
|
1055
1059
|
role="row"
|
|
1056
|
-
style="min-width: ${this.totalColumnsWidth}rem"
|
|
1060
|
+
style="--_row-min-width: ${this.totalColumnsWidth}rem"
|
|
1057
1061
|
>
|
|
1058
1062
|
${this.renderRowGroups(columns, (entry, index) => b `
|
|
1059
1063
|
<div
|
|
@@ -1164,6 +1168,7 @@ let Table = Table_1 = class Table extends i$1 {
|
|
|
1164
1168
|
'scrolled-from-start': this.scrolledFromStart,
|
|
1165
1169
|
'scrolled-from-end': this.scrolledFromEnd,
|
|
1166
1170
|
'has-selection': this.selectedRowKeys.length > 0,
|
|
1171
|
+
'has-footer': this.paginate,
|
|
1167
1172
|
})}
|
|
1168
1173
|
>
|
|
1169
1174
|
${this.renderBulkBar(pageRows)}
|