@redvars/peacock 3.3.0 → 3.3.2
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/{IndividualComponent-tDnXrOLV.js → IndividualComponent-Dt5xirYG.js} +2 -2
- package/dist/{IndividualComponent-tDnXrOLV.js.map → IndividualComponent-Dt5xirYG.js.map} +1 -1
- package/dist/array-D5vjT2Xm.js +14 -0
- package/dist/array-D5vjT2Xm.js.map +1 -0
- package/dist/assets/components.css +1 -1
- package/dist/assets/components.css.map +1 -1
- package/dist/assets/styles.css +1 -1
- package/dist/assets/styles.css.map +1 -1
- package/dist/{button-BGFJfbT2.js → button-ClzS8JLq.js} +3 -4
- package/dist/{button-BGFJfbT2.js.map → button-ClzS8JLq.js.map} +1 -1
- package/dist/button-group-BMS5WvaF.js +292 -0
- package/dist/button-group-BMS5WvaF.js.map +1 -0
- package/dist/button-group.js +6 -107
- package/dist/button-group.js.map +1 -1
- package/dist/button.js +3 -4
- package/dist/button.js.map +1 -1
- package/dist/card.js +104 -0
- package/dist/card.js.map +1 -0
- package/dist/chart-bar-DbnXQgvS.js +1121 -0
- package/dist/chart-bar-DbnXQgvS.js.map +1 -0
- package/dist/chart-bar.js +259 -0
- package/dist/chart-bar.js.map +1 -0
- package/dist/chart-donut.js +4 -2
- package/dist/chart-donut.js.map +1 -1
- package/dist/chart-doughnut.js +4 -2
- package/dist/chart-doughnut.js.map +1 -1
- package/dist/chart-pie.js +4 -2
- package/dist/chart-pie.js.map +1 -1
- package/dist/chart-stacked-bar.js +401 -0
- package/dist/chart-stacked-bar.js.map +1 -0
- package/dist/{class-map-DpeNtqCn.js → class-map-59YGWLnx.js} +9 -3
- package/dist/class-map-59YGWLnx.js.map +1 -0
- package/dist/clock.js +1 -1
- package/dist/code-editor.js +7 -7
- package/dist/code-editor.js.map +1 -1
- package/dist/code-highlighter.js +7 -25
- package/dist/code-highlighter.js.map +1 -1
- package/dist/custom-elements-jsdocs.json +8824 -5047
- package/dist/custom-elements.json +7468 -4147
- package/dist/index.js +16 -10
- package/dist/index.js.map +1 -1
- package/dist/number-counter.js +2 -2
- package/dist/{observe-theme-change-BISF-Gl5.js → observe-theme-change-pALI5fmV.js} +2 -2
- package/dist/{observe-theme-change-BISF-Gl5.js.map → observe-theme-change-pALI5fmV.js.map} +1 -1
- package/dist/peacock-loader.js +42 -1016
- package/dist/peacock-loader.js.map +1 -1
- package/dist/pie-Dz0IDiPt.js +537 -0
- package/dist/pie-Dz0IDiPt.js.map +1 -0
- package/dist/{slider-Dk9CFWTG.js → snackbar-74YCdMPL.js} +6205 -3206
- package/dist/snackbar-74YCdMPL.js.map +1 -0
- package/dist/src/accordion/accordion-item.d.ts +1 -0
- package/dist/src/breadcrumb/breadcrumb/breadcrumb.d.ts +2 -0
- package/dist/src/breadcrumb/breadcrumb-item/breadcrumb-item.d.ts +1 -0
- package/dist/src/button/button-group/button-group.d.ts +4 -0
- package/dist/src/card/card.d.ts +27 -0
- package/dist/src/card/index.d.ts +1 -0
- package/dist/src/chart-bar/chart-bar.d.ts +53 -0
- package/dist/src/chart-bar/chart-stacked-bar.d.ts +78 -0
- package/dist/src/chart-bar/index.d.ts +2 -0
- package/dist/src/code-editor/code-editor.d.ts +4 -3
- package/dist/src/code-highlighter/code-highlighter.d.ts +4 -7
- package/dist/src/index.d.ts +9 -0
- package/dist/src/menu/index.d.ts +3 -0
- package/dist/src/menu/menu/MenuSurfaceController.d.ts +18 -0
- package/dist/src/menu/menu/menu.d.ts +54 -12
- package/dist/src/menu/menu-item/menu-item.d.ts +12 -5
- package/dist/src/menu/sub-menu/sub-menu.d.ts +36 -0
- package/dist/src/pagination/index.d.ts +1 -0
- package/dist/src/pagination/pagination.d.ts +38 -0
- package/dist/src/popover/PopoverController.d.ts +4 -1
- package/dist/src/snackbar/index.d.ts +1 -0
- package/dist/src/snackbar/snackbar.d.ts +40 -0
- package/dist/src/table/index.d.ts +1 -0
- package/dist/src/table/table.d.ts +110 -0
- package/dist/src/tabs/tab-group.d.ts +5 -1
- package/dist/src/tabs/tab-panel.d.ts +2 -0
- package/dist/src/tabs/tab.d.ts +3 -1
- package/dist/src/tabs/tabs.d.ts +2 -0
- package/dist/src/tooltip/tooltip.d.ts +1 -3
- package/dist/src/tree-view/index.d.ts +2 -0
- package/dist/src/tree-view/tree-node.d.ts +69 -0
- package/dist/src/tree-view/tree-view.d.ts +40 -0
- package/dist/src/tree-view/wc-tree-view.d.ts +6 -0
- package/dist/{style-map-CfNHEkQp.js → style-map-DcB52w-l.js} +2 -2
- package/dist/{style-map-CfNHEkQp.js.map → style-map-DcB52w-l.js.map} +1 -1
- package/dist/test/card.test.d.ts +1 -0
- package/dist/test/chart-bar.test.d.ts +1 -0
- package/dist/test/icon.test.d.ts +1 -1
- package/dist/test/menu.test.d.ts +1 -0
- package/dist/test/snackbar.test.d.ts +1 -0
- package/dist/test/sub-menu.test.d.ts +1 -0
- package/dist/test/tree-view.test.d.ts +1 -0
- package/dist/{transform-DRuHEvar.js → transform-DSwFSqzD.js} +13 -558
- package/dist/transform-DSwFSqzD.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{unsafe-html-CV6Je6HL.js → unsafe-html-C2r3PyzF.js} +2 -2
- package/dist/{unsafe-html-CV6Je6HL.js.map → unsafe-html-C2r3PyzF.js.map} +1 -1
- package/package.json +1 -1
- package/readme.md +40 -40
- package/src/accordion/accordion-item.ts +2 -1
- package/src/breadcrumb/breadcrumb/breadcrumb.ts +3 -0
- package/src/breadcrumb/breadcrumb-item/breadcrumb-item.ts +1 -0
- package/src/button/button-group/button-group.ts +6 -0
- package/src/card/card.scss +61 -0
- package/src/card/card.ts +38 -0
- package/src/card/index.ts +1 -0
- package/src/chart-bar/chart-bar.scss +58 -0
- package/src/chart-bar/chart-bar.ts +306 -0
- package/src/chart-bar/chart-stacked-bar.ts +402 -0
- package/src/chart-bar/index.ts +2 -0
- package/src/code-editor/code-editor.ts +4 -3
- package/src/code-highlighter/code-highlighter.ts +4 -22
- package/src/divider/divider.scss +2 -2
- package/src/empty-state/empty-state.scss +1 -1
- package/src/empty-state/empty-state.ts +1 -1
- package/src/index.ts +11 -2
- package/src/menu/index.ts +3 -0
- package/src/menu/menu/MenuSurfaceController.ts +61 -0
- package/src/menu/{menu-list/menu-list.scss → menu/menu.scss} +19 -4
- package/src/menu/menu/menu.ts +389 -81
- package/src/menu/menu-item/menu-item.ts +115 -36
- package/src/menu/sub-menu/sub-menu.scss +7 -0
- package/src/menu/sub-menu/sub-menu.ts +243 -0
- package/src/pagination/index.ts +1 -0
- package/src/pagination/pagination.scss +59 -0
- package/src/pagination/pagination.ts +135 -0
- package/src/peacock-loader.ts +39 -11
- package/src/popover/PopoverController.ts +13 -7
- package/src/snackbar/demo/index.html +29 -0
- package/src/snackbar/index.ts +1 -0
- package/src/snackbar/snackbar.scss +73 -0
- package/src/snackbar/snackbar.ts +151 -0
- package/src/table/index.ts +1 -0
- package/src/table/table.scss +174 -0
- package/src/table/table.ts +475 -0
- package/src/tabs/tab-group.ts +63 -28
- package/src/tabs/tab-panel.scss +3 -3
- package/src/tabs/tab-panel.ts +3 -0
- package/src/tabs/tab.scss +76 -2
- package/src/tabs/tab.ts +29 -6
- package/src/tabs/tabs.scss +6 -5
- package/src/tabs/tabs.ts +19 -5
- package/src/text/text.css-component.scss +6 -3
- package/src/tooltip/tooltip.scss +16 -13
- package/src/tooltip/tooltip.ts +7 -9
- package/src/tree-view/demo/index.html +57 -0
- package/src/tree-view/index.ts +2 -0
- package/src/tree-view/tree-node.scss +101 -0
- package/src/tree-view/tree-node.ts +268 -0
- package/src/tree-view/tree-view.scss +12 -0
- package/src/tree-view/tree-view.ts +182 -0
- package/src/tree-view/wc-tree-view.ts +9 -0
- package/dist/class-map-DpeNtqCn.js.map +0 -1
- package/dist/slider-Dk9CFWTG.js.map +0 -1
- package/dist/src/menu/menu-list/menu-list.d.ts +0 -22
- package/dist/state-8v48Exzh.js +0 -10
- package/dist/state-8v48Exzh.js.map +0 -1
- package/dist/transform-DRuHEvar.js.map +0 -1
- package/src/menu/menu-list/menu-list.ts +0 -48
|
@@ -44,7 +44,7 @@ import styles from './code-editor.scss';
|
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* @label Code Editor
|
|
47
|
-
* @tag code-editor
|
|
47
|
+
* @tag wc-code-editor
|
|
48
48
|
* @rawTag code-editor
|
|
49
49
|
*
|
|
50
50
|
* @summary A Monaco-based code editing component with syntax highlighting and theming.
|
|
@@ -55,12 +55,13 @@ import styles from './code-editor.scss';
|
|
|
55
55
|
*
|
|
56
56
|
* @example
|
|
57
57
|
* ```html
|
|
58
|
-
* <code-editor
|
|
58
|
+
* <wc-code-editor
|
|
59
59
|
* language="javascript"
|
|
60
|
+
* style="width: 100%; --code-editor-height: 10rem;"
|
|
60
61
|
* value="function hello() { console.log('Hello'); }"
|
|
61
62
|
* lineNumbers="on"
|
|
62
63
|
* minimap="false">
|
|
63
|
-
* </code-editor>
|
|
64
|
+
* </wc-code-editor>
|
|
64
65
|
* ```
|
|
65
66
|
* @tags input, editor
|
|
66
67
|
*/
|
|
@@ -16,21 +16,6 @@ import IndividualComponent from 'src/IndividualComponent.js';
|
|
|
16
16
|
import { copyToClipboard } from '../utils/copy-to-clipboard.js';
|
|
17
17
|
import styles from './code-highlighter.scss';
|
|
18
18
|
|
|
19
|
-
/**
|
|
20
|
-
* @label Code Highlighter
|
|
21
|
-
* @tag wc-code-highlighter
|
|
22
|
-
* @rawTag code-highlighter
|
|
23
|
-
* @summary A component that provides syntax highlighting for code snippets.
|
|
24
|
-
* @tags display
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```html
|
|
28
|
-
* <wc-code-highlighter language="javascript">
|
|
29
|
-
* <pre><code>console.log('Hello');</code></pre>
|
|
30
|
-
* </wc-code-highlighter>
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
19
|
const locale = {
|
|
35
20
|
loading: 'Loading code...',
|
|
36
21
|
copyToClipboard: 'Copy to clipboard',
|
|
@@ -40,21 +25,18 @@ const locale = {
|
|
|
40
25
|
|
|
41
26
|
/**
|
|
42
27
|
* @label Code Highlighter
|
|
43
|
-
* @tag code-highlighter
|
|
28
|
+
* @tag wc-code-highlighter
|
|
44
29
|
* @rawTag code-highlighter
|
|
45
30
|
*
|
|
46
|
-
* @summary
|
|
47
|
-
* @overview
|
|
48
|
-
* - CodeHighlighter is a component that provides syntax highlighting for code snippets.
|
|
49
|
-
* - It supports various programming languages and can display line numbers for better readability.
|
|
31
|
+
* @summary A component that provides syntax highlighting for code snippets.
|
|
50
32
|
*
|
|
51
33
|
* @example
|
|
52
34
|
* ```html
|
|
53
|
-
* <code-highlighter language="javascript" style="height: 9rem"><pre><code>
|
|
35
|
+
* <wc-code-highlighter language="javascript" style="height: 9rem"><pre><code>
|
|
54
36
|
* function helloWorld() {
|
|
55
37
|
* console.log('Hello, world!');
|
|
56
38
|
* }</code></pre>
|
|
57
|
-
* </code-highlighter>
|
|
39
|
+
* </wc-code-highlighter>
|
|
58
40
|
* ```
|
|
59
41
|
* @tags display
|
|
60
42
|
*/
|
package/src/divider/divider.scss
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
--divider-color: var(--color-outline-variant);
|
|
9
9
|
--divider-spacing: var(--spacing-200);
|
|
10
|
-
--divider-line-
|
|
10
|
+
--divider-line-thickness: 1px;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.divider {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
@include mixin.get-typography(body-medium);
|
|
17
17
|
color: var(--divider-color);
|
|
18
18
|
|
|
19
|
-
--_line-border: var(--divider-line-
|
|
19
|
+
--_line-border: var(--divider-line-thickness) solid var(--divider-color);
|
|
20
20
|
|
|
21
21
|
&:not(.vertical) {
|
|
22
22
|
width: 100%;
|
|
@@ -76,7 +76,7 @@ export class EmptyState extends LitElement {
|
|
|
76
76
|
<div class="${classMap(classes)}">
|
|
77
77
|
<div class="empty-state-container">
|
|
78
78
|
<div class="illustration">
|
|
79
|
-
<wc-icon src="${illustrationPath}"></wc-icon>
|
|
79
|
+
<wc-icon class="illustration-svg" src="${illustrationPath}"></wc-icon>
|
|
80
80
|
</div>
|
|
81
81
|
|
|
82
82
|
<div class="content">
|
package/src/index.ts
CHANGED
|
@@ -22,18 +22,27 @@ export { DatePicker } from './date-picker/index.js';
|
|
|
22
22
|
export { TimePicker } from './time-picker/index.js';
|
|
23
23
|
export { Textarea } from './textarea/index.js';
|
|
24
24
|
export { Switch } from './switch/index.js';
|
|
25
|
+
export { Checkbox } from './checkbox/index.js';
|
|
25
26
|
export { Spinner } from './spinner/index.js';
|
|
26
|
-
export { Container } from './container/index.js'
|
|
27
|
+
export { Container } from './container/index.js';
|
|
27
28
|
|
|
28
29
|
export { NumberCounter } from './number-counter/index.js';
|
|
29
30
|
export { EmptyState } from './empty-state/index.js';
|
|
30
31
|
export { Tooltip } from './popover/index.js';
|
|
31
32
|
export { Breadcrumb, BreadcrumbItem } from './breadcrumb/index.js';
|
|
33
|
+
export { Menu, MenuItem, SubMenu } from './menu/index.js';
|
|
32
34
|
|
|
33
35
|
export { CodeHighlighter } from './code-highlighter/index.js';
|
|
34
36
|
export { CodeEditor } from './code-editor/index.js';
|
|
35
37
|
export { Image } from './image/index.js';
|
|
36
38
|
export { Tab, TabGroup, TabPanel, Tabs } from './tabs/index.js';
|
|
37
39
|
export { Slider } from './slider/index.js';
|
|
40
|
+
export { ChartDonut } from './chart-donut/index.js';
|
|
38
41
|
export { ChartDoughnut } from './chart-doughnut/index.js';
|
|
39
|
-
export { ChartPie } from './chart-pie/index.js';
|
|
42
|
+
export { ChartPie } from './chart-pie/index.js';
|
|
43
|
+
export { ChartBar, ChartStackedBar } from './chart-bar/index.js';
|
|
44
|
+
export { Table } from './table/index.js';
|
|
45
|
+
export { Pagination } from './pagination/index.js';
|
|
46
|
+
export { TreeView, TreeNode } from './tree-view/index.js';
|
|
47
|
+
export { Card } from './card/index.js';
|
|
48
|
+
export { Snackbar } from './snackbar/index.js';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
import {
|
|
3
|
+
autoUpdate,
|
|
4
|
+
computePosition,
|
|
5
|
+
flip,
|
|
6
|
+
offset,
|
|
7
|
+
shift,
|
|
8
|
+
type Placement,
|
|
9
|
+
type Strategy,
|
|
10
|
+
} from '@floating-ui/dom';
|
|
11
|
+
|
|
12
|
+
type PositionOptions = {
|
|
13
|
+
reference: HTMLElement;
|
|
14
|
+
floating: HTMLElement;
|
|
15
|
+
placement: Placement;
|
|
16
|
+
offset: number;
|
|
17
|
+
strategy?: Strategy;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
async function updateSurfacePosition(options: PositionOptions & { strategy: Strategy }) {
|
|
21
|
+
const { x, y } = await computePosition(options.reference, options.floating, {
|
|
22
|
+
strategy: options.strategy,
|
|
23
|
+
placement: options.placement,
|
|
24
|
+
middleware: [offset(options.offset), flip(), shift({ padding: 8 })],
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
Object.assign(options.floating.style, {
|
|
28
|
+
position: options.strategy,
|
|
29
|
+
left: `${x}px`,
|
|
30
|
+
top: `${y}px`,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export class MenuSurfaceController implements ReactiveController {
|
|
35
|
+
private cleanup?: () => void;
|
|
36
|
+
|
|
37
|
+
constructor(private host: ReactiveControllerHost) {
|
|
38
|
+
this.host.addController(this);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
start(options: PositionOptions) {
|
|
42
|
+
this.stop();
|
|
43
|
+
|
|
44
|
+
const strategy = options.strategy ?? 'fixed';
|
|
45
|
+
|
|
46
|
+
this.cleanup = autoUpdate(options.reference, options.floating, () => {
|
|
47
|
+
updateSurfacePosition({ ...options, strategy });
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
updateSurfacePosition({ ...options, strategy });
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
stop() {
|
|
54
|
+
this.cleanup?.();
|
|
55
|
+
this.cleanup = undefined;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
hostDisconnected() {
|
|
59
|
+
this.stop();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -2,13 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
@include mixin.base-styles;
|
|
4
4
|
|
|
5
|
-
.menu
|
|
5
|
+
.menu {
|
|
6
6
|
display: flex;
|
|
7
7
|
position: relative;
|
|
8
|
+
z-index: var(--menu-z-index, 1000);
|
|
8
9
|
min-width: 112px;
|
|
9
10
|
padding-block: var(--spacing-050);
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
&.closed {
|
|
13
|
+
display: none;
|
|
14
|
+
opacity: 0;
|
|
15
|
+
visibility: hidden;
|
|
16
|
+
pointer-events: none;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&.open {
|
|
20
|
+
display: flex;
|
|
21
|
+
opacity: 1;
|
|
22
|
+
visibility: visible;
|
|
23
|
+
pointer-events: auto;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.menu-content {
|
|
12
27
|
display: flex;
|
|
13
28
|
flex-direction: column;
|
|
14
29
|
gap: var(--spacing-050);
|
|
@@ -24,7 +39,7 @@
|
|
|
24
39
|
--menu-item-container-shape-end-end: var(--shape-corner-medium);
|
|
25
40
|
}
|
|
26
41
|
|
|
27
|
-
::slotted(
|
|
42
|
+
::slotted(wc-divider) {
|
|
28
43
|
--divider-spacing: var(--spacing-100);
|
|
29
44
|
padding-inline: var(--spacing-050);
|
|
30
45
|
}
|
|
@@ -58,7 +73,7 @@
|
|
|
58
73
|
}
|
|
59
74
|
}
|
|
60
75
|
|
|
61
|
-
.menu
|
|
76
|
+
.menu {
|
|
62
77
|
--_container-shape-start-start: var(--shape-corner-large);
|
|
63
78
|
--_container-shape-start-end: var(--shape-corner-large);
|
|
64
79
|
--_container-shape-end-start: var(--shape-corner-large);
|