@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.
Files changed (159) hide show
  1. package/dist/{IndividualComponent-tDnXrOLV.js → IndividualComponent-Dt5xirYG.js} +2 -2
  2. package/dist/{IndividualComponent-tDnXrOLV.js.map → IndividualComponent-Dt5xirYG.js.map} +1 -1
  3. package/dist/array-D5vjT2Xm.js +14 -0
  4. package/dist/array-D5vjT2Xm.js.map +1 -0
  5. package/dist/assets/components.css +1 -1
  6. package/dist/assets/components.css.map +1 -1
  7. package/dist/assets/styles.css +1 -1
  8. package/dist/assets/styles.css.map +1 -1
  9. package/dist/{button-BGFJfbT2.js → button-ClzS8JLq.js} +3 -4
  10. package/dist/{button-BGFJfbT2.js.map → button-ClzS8JLq.js.map} +1 -1
  11. package/dist/button-group-BMS5WvaF.js +292 -0
  12. package/dist/button-group-BMS5WvaF.js.map +1 -0
  13. package/dist/button-group.js +6 -107
  14. package/dist/button-group.js.map +1 -1
  15. package/dist/button.js +3 -4
  16. package/dist/button.js.map +1 -1
  17. package/dist/card.js +104 -0
  18. package/dist/card.js.map +1 -0
  19. package/dist/chart-bar-DbnXQgvS.js +1121 -0
  20. package/dist/chart-bar-DbnXQgvS.js.map +1 -0
  21. package/dist/chart-bar.js +259 -0
  22. package/dist/chart-bar.js.map +1 -0
  23. package/dist/chart-donut.js +4 -2
  24. package/dist/chart-donut.js.map +1 -1
  25. package/dist/chart-doughnut.js +4 -2
  26. package/dist/chart-doughnut.js.map +1 -1
  27. package/dist/chart-pie.js +4 -2
  28. package/dist/chart-pie.js.map +1 -1
  29. package/dist/chart-stacked-bar.js +401 -0
  30. package/dist/chart-stacked-bar.js.map +1 -0
  31. package/dist/{class-map-DpeNtqCn.js → class-map-59YGWLnx.js} +9 -3
  32. package/dist/class-map-59YGWLnx.js.map +1 -0
  33. package/dist/clock.js +1 -1
  34. package/dist/code-editor.js +7 -7
  35. package/dist/code-editor.js.map +1 -1
  36. package/dist/code-highlighter.js +7 -25
  37. package/dist/code-highlighter.js.map +1 -1
  38. package/dist/custom-elements-jsdocs.json +8824 -5047
  39. package/dist/custom-elements.json +7468 -4147
  40. package/dist/index.js +16 -10
  41. package/dist/index.js.map +1 -1
  42. package/dist/number-counter.js +2 -2
  43. package/dist/{observe-theme-change-BISF-Gl5.js → observe-theme-change-pALI5fmV.js} +2 -2
  44. package/dist/{observe-theme-change-BISF-Gl5.js.map → observe-theme-change-pALI5fmV.js.map} +1 -1
  45. package/dist/peacock-loader.js +42 -1016
  46. package/dist/peacock-loader.js.map +1 -1
  47. package/dist/pie-Dz0IDiPt.js +537 -0
  48. package/dist/pie-Dz0IDiPt.js.map +1 -0
  49. package/dist/{slider-Dk9CFWTG.js → snackbar-74YCdMPL.js} +6205 -3206
  50. package/dist/snackbar-74YCdMPL.js.map +1 -0
  51. package/dist/src/accordion/accordion-item.d.ts +1 -0
  52. package/dist/src/breadcrumb/breadcrumb/breadcrumb.d.ts +2 -0
  53. package/dist/src/breadcrumb/breadcrumb-item/breadcrumb-item.d.ts +1 -0
  54. package/dist/src/button/button-group/button-group.d.ts +4 -0
  55. package/dist/src/card/card.d.ts +27 -0
  56. package/dist/src/card/index.d.ts +1 -0
  57. package/dist/src/chart-bar/chart-bar.d.ts +53 -0
  58. package/dist/src/chart-bar/chart-stacked-bar.d.ts +78 -0
  59. package/dist/src/chart-bar/index.d.ts +2 -0
  60. package/dist/src/code-editor/code-editor.d.ts +4 -3
  61. package/dist/src/code-highlighter/code-highlighter.d.ts +4 -7
  62. package/dist/src/index.d.ts +9 -0
  63. package/dist/src/menu/index.d.ts +3 -0
  64. package/dist/src/menu/menu/MenuSurfaceController.d.ts +18 -0
  65. package/dist/src/menu/menu/menu.d.ts +54 -12
  66. package/dist/src/menu/menu-item/menu-item.d.ts +12 -5
  67. package/dist/src/menu/sub-menu/sub-menu.d.ts +36 -0
  68. package/dist/src/pagination/index.d.ts +1 -0
  69. package/dist/src/pagination/pagination.d.ts +38 -0
  70. package/dist/src/popover/PopoverController.d.ts +4 -1
  71. package/dist/src/snackbar/index.d.ts +1 -0
  72. package/dist/src/snackbar/snackbar.d.ts +40 -0
  73. package/dist/src/table/index.d.ts +1 -0
  74. package/dist/src/table/table.d.ts +110 -0
  75. package/dist/src/tabs/tab-group.d.ts +5 -1
  76. package/dist/src/tabs/tab-panel.d.ts +2 -0
  77. package/dist/src/tabs/tab.d.ts +3 -1
  78. package/dist/src/tabs/tabs.d.ts +2 -0
  79. package/dist/src/tooltip/tooltip.d.ts +1 -3
  80. package/dist/src/tree-view/index.d.ts +2 -0
  81. package/dist/src/tree-view/tree-node.d.ts +69 -0
  82. package/dist/src/tree-view/tree-view.d.ts +40 -0
  83. package/dist/src/tree-view/wc-tree-view.d.ts +6 -0
  84. package/dist/{style-map-CfNHEkQp.js → style-map-DcB52w-l.js} +2 -2
  85. package/dist/{style-map-CfNHEkQp.js.map → style-map-DcB52w-l.js.map} +1 -1
  86. package/dist/test/card.test.d.ts +1 -0
  87. package/dist/test/chart-bar.test.d.ts +1 -0
  88. package/dist/test/icon.test.d.ts +1 -1
  89. package/dist/test/menu.test.d.ts +1 -0
  90. package/dist/test/snackbar.test.d.ts +1 -0
  91. package/dist/test/sub-menu.test.d.ts +1 -0
  92. package/dist/test/tree-view.test.d.ts +1 -0
  93. package/dist/{transform-DRuHEvar.js → transform-DSwFSqzD.js} +13 -558
  94. package/dist/transform-DSwFSqzD.js.map +1 -0
  95. package/dist/tsconfig.tsbuildinfo +1 -1
  96. package/dist/{unsafe-html-CV6Je6HL.js → unsafe-html-C2r3PyzF.js} +2 -2
  97. package/dist/{unsafe-html-CV6Je6HL.js.map → unsafe-html-C2r3PyzF.js.map} +1 -1
  98. package/package.json +1 -1
  99. package/readme.md +40 -40
  100. package/src/accordion/accordion-item.ts +2 -1
  101. package/src/breadcrumb/breadcrumb/breadcrumb.ts +3 -0
  102. package/src/breadcrumb/breadcrumb-item/breadcrumb-item.ts +1 -0
  103. package/src/button/button-group/button-group.ts +6 -0
  104. package/src/card/card.scss +61 -0
  105. package/src/card/card.ts +38 -0
  106. package/src/card/index.ts +1 -0
  107. package/src/chart-bar/chart-bar.scss +58 -0
  108. package/src/chart-bar/chart-bar.ts +306 -0
  109. package/src/chart-bar/chart-stacked-bar.ts +402 -0
  110. package/src/chart-bar/index.ts +2 -0
  111. package/src/code-editor/code-editor.ts +4 -3
  112. package/src/code-highlighter/code-highlighter.ts +4 -22
  113. package/src/divider/divider.scss +2 -2
  114. package/src/empty-state/empty-state.scss +1 -1
  115. package/src/empty-state/empty-state.ts +1 -1
  116. package/src/index.ts +11 -2
  117. package/src/menu/index.ts +3 -0
  118. package/src/menu/menu/MenuSurfaceController.ts +61 -0
  119. package/src/menu/{menu-list/menu-list.scss → menu/menu.scss} +19 -4
  120. package/src/menu/menu/menu.ts +389 -81
  121. package/src/menu/menu-item/menu-item.ts +115 -36
  122. package/src/menu/sub-menu/sub-menu.scss +7 -0
  123. package/src/menu/sub-menu/sub-menu.ts +243 -0
  124. package/src/pagination/index.ts +1 -0
  125. package/src/pagination/pagination.scss +59 -0
  126. package/src/pagination/pagination.ts +135 -0
  127. package/src/peacock-loader.ts +39 -11
  128. package/src/popover/PopoverController.ts +13 -7
  129. package/src/snackbar/demo/index.html +29 -0
  130. package/src/snackbar/index.ts +1 -0
  131. package/src/snackbar/snackbar.scss +73 -0
  132. package/src/snackbar/snackbar.ts +151 -0
  133. package/src/table/index.ts +1 -0
  134. package/src/table/table.scss +174 -0
  135. package/src/table/table.ts +475 -0
  136. package/src/tabs/tab-group.ts +63 -28
  137. package/src/tabs/tab-panel.scss +3 -3
  138. package/src/tabs/tab-panel.ts +3 -0
  139. package/src/tabs/tab.scss +76 -2
  140. package/src/tabs/tab.ts +29 -6
  141. package/src/tabs/tabs.scss +6 -5
  142. package/src/tabs/tabs.ts +19 -5
  143. package/src/text/text.css-component.scss +6 -3
  144. package/src/tooltip/tooltip.scss +16 -13
  145. package/src/tooltip/tooltip.ts +7 -9
  146. package/src/tree-view/demo/index.html +57 -0
  147. package/src/tree-view/index.ts +2 -0
  148. package/src/tree-view/tree-node.scss +101 -0
  149. package/src/tree-view/tree-node.ts +268 -0
  150. package/src/tree-view/tree-view.scss +12 -0
  151. package/src/tree-view/tree-view.ts +182 -0
  152. package/src/tree-view/wc-tree-view.ts +9 -0
  153. package/dist/class-map-DpeNtqCn.js.map +0 -1
  154. package/dist/slider-Dk9CFWTG.js.map +0 -1
  155. package/dist/src/menu/menu-list/menu-list.d.ts +0 -22
  156. package/dist/state-8v48Exzh.js +0 -10
  157. package/dist/state-8v48Exzh.js.map +0 -1
  158. package/dist/transform-DRuHEvar.js.map +0 -1
  159. 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 Highlights code snippets with syntax highlighting and line numbers.
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
  */
@@ -7,7 +7,7 @@
7
7
 
8
8
  --divider-color: var(--color-outline-variant);
9
9
  --divider-spacing: var(--spacing-200);
10
- --divider-line-thinkness: 2px;
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-thinkness) solid var(--divider-color);
19
+ --_line-border: var(--divider-line-thickness) solid var(--divider-color);
20
20
 
21
21
  &:not(.vertical) {
22
22
  width: 100%;
@@ -27,7 +27,7 @@
27
27
  height: 100%;
28
28
  display: flex;
29
29
 
30
- base-icon {
30
+ .illustration-svg {
31
31
  --icon-size: 100%;
32
32
  }
33
33
  }
@@ -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,3 @@
1
+ export { Menu } from './menu/menu.js';
2
+ export { MenuItem } from './menu-item/menu-item.js';
3
+ export { SubMenu } from './sub-menu/sub-menu.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-list {
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
- .menu-list-content {
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(base-divider) {
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-list {
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);