@redvars/peacock 3.5.0 → 3.5.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.
Files changed (148) hide show
  1. package/dist/BaseButton-DuASuVth.js +219 -0
  2. package/dist/BaseButton-DuASuVth.js.map +1 -0
  3. package/dist/BaseHyperlinkMixin-BNuwbiEf.js +65 -0
  4. package/dist/BaseHyperlinkMixin-BNuwbiEf.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/banner.js +12 -27
  10. package/dist/banner.js.map +1 -1
  11. package/dist/{button-DMN1dPAg.js → button-DouvOfEU.js} +77 -251
  12. package/dist/button-DouvOfEU.js.map +1 -0
  13. package/dist/{button-group-CX9CUUXk.js → button-group-CEdMwvJJ.js} +71 -42
  14. package/dist/button-group-CEdMwvJJ.js.map +1 -0
  15. package/dist/button-group.js +5 -5
  16. package/dist/button.js +3 -3
  17. package/dist/card.js +18 -73
  18. package/dist/card.js.map +1 -1
  19. package/dist/chart-bar.js.map +1 -1
  20. package/dist/chart-doughnut.js +2 -2
  21. package/dist/chart-doughnut.js.map +1 -1
  22. package/dist/chart-pie.js +2 -2
  23. package/dist/chart-pie.js.map +1 -1
  24. package/dist/chart-stacked-bar.js.map +1 -1
  25. package/dist/code-highlighter.js +2 -1
  26. package/dist/code-highlighter.js.map +1 -1
  27. package/dist/custom-elements-jsdocs.json +3105 -1494
  28. package/dist/custom-elements.json +9244 -7829
  29. package/dist/fab.js +421 -9
  30. package/dist/fab.js.map +1 -1
  31. package/dist/index.js +6 -6
  32. package/dist/{select-4pl4XBj7.js → navigation-rail-Lxetd5-Z.js} +2214 -1090
  33. package/dist/navigation-rail-Lxetd5-Z.js.map +1 -0
  34. package/dist/notification.js +3 -2
  35. package/dist/notification.js.map +1 -1
  36. package/dist/peacock-loader.js +22 -10
  37. package/dist/peacock-loader.js.map +1 -1
  38. package/dist/search.js +4 -0
  39. package/dist/search.js.map +1 -1
  40. package/dist/src/__mixins/BaseButtonMixin.d.ts +20 -0
  41. package/dist/src/__mixins/BaseHyperlinkMixin.d.ts +18 -0
  42. package/dist/src/__mixins/MixinConstructor.d.ts +1 -0
  43. package/dist/src/banner/banner.d.ts +0 -4
  44. package/dist/src/button/BaseButton.d.ts +4 -47
  45. package/dist/src/button/button/button.d.ts +32 -3
  46. package/dist/src/button/button-group/button-group.d.ts +2 -2
  47. package/dist/src/button/icon-button/icon-button.d.ts +33 -8
  48. package/dist/src/card/card.d.ts +4 -15
  49. package/dist/src/fab/fab.d.ts +4 -35
  50. package/dist/src/focus-ring/focus-ring.d.ts +11 -5
  51. package/dist/src/index.d.ts +3 -1
  52. package/dist/src/link/link.d.ts +1 -1
  53. package/dist/src/navigation-rail/index.d.ts +2 -0
  54. package/dist/src/navigation-rail/navigation-rail-item.d.ts +55 -0
  55. package/dist/src/navigation-rail/navigation-rail.d.ts +71 -0
  56. package/dist/src/sidebar-menu/index.d.ts +3 -0
  57. package/dist/src/sidebar-menu/sidebar-menu-item.d.ts +58 -0
  58. package/dist/src/sidebar-menu/sidebar-menu.d.ts +38 -0
  59. package/dist/src/sidebar-menu/sidebar-sub-menu.d.ts +35 -0
  60. package/dist/src/toolbar/toolbar.d.ts +10 -10
  61. package/dist/src/tooltip/tooltip.d.ts +3 -0
  62. package/dist/src/url-field/index.d.ts +1 -0
  63. package/dist/src/url-field/url-field.d.ts +48 -0
  64. package/dist/test/sidebar-menu.test.d.ts +1 -0
  65. package/dist/toolbar.js +10 -10
  66. package/dist/toolbar.js.map +1 -1
  67. package/dist/tsconfig.tsbuildinfo +1 -1
  68. package/package.json +1 -1
  69. package/readme.md +73 -65
  70. package/scss/mixin.scss +16 -0
  71. package/src/__mixins/BaseButtonMixin.ts +83 -0
  72. package/src/__mixins/BaseHyperlinkMixin.ts +68 -0
  73. package/src/__mixins/MixinConstructor.ts +1 -0
  74. package/src/{__base_element → __mixins}/README.md +2 -2
  75. package/src/banner/banner.scss +18 -22
  76. package/src/banner/banner.ts +1 -7
  77. package/src/button/BaseButton.ts +11 -100
  78. package/src/button/button/button-sizes.scss +4 -2
  79. package/src/button/button/button.ts +76 -23
  80. package/src/button/button-group/button-group.ts +2 -2
  81. package/src/button/icon-button/icon-button.ts +75 -33
  82. package/src/card/card.ts +11 -71
  83. package/src/chart-bar/chart-bar.ts +9 -14
  84. package/src/chart-bar/chart-stacked-bar.ts +12 -18
  85. package/src/chart-doughnut/chart-doughnut.ts +23 -27
  86. package/src/chart-pie/chart-pie.ts +19 -23
  87. package/src/checkbox/checkbox.scss +17 -34
  88. package/src/checkbox/checkbox.ts +3 -1
  89. package/src/code-highlighter/code-highlighter.scss +1 -0
  90. package/src/code-highlighter/code-highlighter.ts +1 -1
  91. package/src/date-picker/date-picker.ts +1 -1
  92. package/src/elevation/elevation.scss +5 -5
  93. package/src/fab/fab.ts +29 -100
  94. package/src/focus-ring/focus-ring.ts +47 -40
  95. package/src/index.ts +3 -1
  96. package/src/input/input.ts +3 -1
  97. package/src/link/link.ts +2 -2
  98. package/src/menu/menu-item/menu-item.ts +3 -1
  99. package/src/navigation-rail/index.ts +2 -0
  100. package/src/navigation-rail/navigation-rail-item.scss +216 -0
  101. package/src/navigation-rail/navigation-rail-item.ts +223 -0
  102. package/src/navigation-rail/navigation-rail.scss +72 -0
  103. package/src/navigation-rail/navigation-rail.ts +149 -0
  104. package/src/notification/notification.ts +3 -2
  105. package/src/number-field/number-field.ts +6 -4
  106. package/src/pagination/pagination.ts +6 -4
  107. package/src/peacock-loader.ts +22 -5
  108. package/src/search/search.ts +4 -0
  109. package/src/sidebar-menu/demo/index.html +68 -0
  110. package/src/sidebar-menu/index.ts +3 -0
  111. package/src/sidebar-menu/sidebar-menu-item.scss +102 -0
  112. package/src/sidebar-menu/sidebar-menu-item.ts +151 -0
  113. package/src/{tree-view/tree-view.scss → sidebar-menu/sidebar-menu.scss} +1 -1
  114. package/src/sidebar-menu/sidebar-menu.ts +182 -0
  115. package/src/sidebar-menu/sidebar-sub-menu.scss +130 -0
  116. package/src/sidebar-menu/sidebar-sub-menu.ts +160 -0
  117. package/src/skeleton/skeleton.scss +18 -24
  118. package/src/snackbar/snackbar.ts +1 -1
  119. package/src/tabs/tab.ts +4 -3
  120. package/src/text/text.css-component.scss +7 -1
  121. package/src/time-picker/time-picker.ts +1 -1
  122. package/src/toolbar/toolbar.ts +10 -10
  123. package/src/tooltip/tooltip.ts +24 -0
  124. package/src/url-field/index.ts +1 -0
  125. package/src/url-field/url-field.scss +50 -0
  126. package/src/url-field/url-field.ts +239 -0
  127. package/dist/button-DMN1dPAg.js.map +0 -1
  128. package/dist/button-group-CX9CUUXk.js.map +0 -1
  129. package/dist/fab-C5Nzxk0E.js +0 -497
  130. package/dist/fab-C5Nzxk0E.js.map +0 -1
  131. package/dist/select-4pl4XBj7.js.map +0 -1
  132. package/dist/spread-B5cgadZl.js +0 -32
  133. package/dist/spread-B5cgadZl.js.map +0 -1
  134. package/dist/src/__base_element/BaseHyperlink.d.ts +0 -20
  135. package/dist/src/tree-view/index.d.ts +0 -2
  136. package/dist/src/tree-view/tree-node.d.ts +0 -69
  137. package/dist/src/tree-view/tree-view.d.ts +0 -40
  138. package/dist/src/tree-view/wc-tree-view.d.ts +0 -6
  139. package/dist/test/tree-view.test.d.ts +0 -1
  140. package/dist/throttle-C7ZAPqtu.js +0 -24
  141. package/dist/throttle-C7ZAPqtu.js.map +0 -1
  142. package/src/__base_element/BaseHyperlink.ts +0 -42
  143. package/src/tree-view/demo/index.html +0 -57
  144. package/src/tree-view/index.ts +0 -2
  145. package/src/tree-view/tree-node.scss +0 -101
  146. package/src/tree-view/tree-node.ts +0 -268
  147. package/src/tree-view/tree-view.ts +0 -182
  148. package/src/tree-view/wc-tree-view.ts +0 -9
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@redvars/peacock",
3
3
  "description": "The foundation for beautiful user interfaces",
4
4
  "license": "Apache-2.0",
5
- "version": "3.5.0",
5
+ "version": "3.5.1",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.js",
package/readme.md CHANGED
@@ -44,9 +44,9 @@ Visit [https://peacock.redvars.com](https://peacock.redvars.com) to view the doc
44
44
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
45
45
  <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Mono:wght@100..900&family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
46
46
 
47
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@redvars/peacock@3.5.0/dist/assets/styles.css"></link>
47
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@redvars/peacock@3.5.1/dist/assets/styles.css"></link>
48
48
  <script type='module'
49
- src='https://cdn.jsdelivr.net/npm/@redvars/peacock@3.5.0/dist/peacock-loader.js'></script>
49
+ src='https://cdn.jsdelivr.net/npm/@redvars/peacock@3.5.1/dist/peacock-loader.js'></script>
50
50
  </head>
51
51
 
52
52
  <wc-button>Button</wc-button>
@@ -65,24 +65,25 @@ Input controls are UI design elements that allow users to input information into
65
65
  collecting data and enabling user interactions. Some common examples of input controls include text fields, dropdown
66
66
  menus, checkboxes, and radio buttons.
67
67
 
68
- | Name | Component | State |
69
- |---------------------------------------------------------------------|-------------------|-------|
68
+ | Name | Component | State |
69
+ |---------------------------------------------------------------------|-----------------|-------|
70
+ | [Checkbox](https://peacock.redvars.com/components/checkbox) | wc-checkbox | 🟢 |
70
71
  | [Code editor](https://peacock.redvars.com/components/code-editor) | wc-code-editor | 🟢 |
71
72
  | Color picker | color-picker | 🔴 |
72
- | [Checkbox](https://peacock.redvars.com/components/checkbox) | wc-checkbox | 🟢 |
73
73
  | [Date picker](https://peacock.redvars.com/components/date-picker) | wc-date-picker | 🟡 |
74
- | Date Time picker | datetime-picker | 🔴 |
75
- | [Form control](https://peacock.redvars.com/components/form-control) | wc-field | 🟡 |
74
+ | Date time picker | datetime-picker | 🔴 |
75
+ | [Field / Form control](https://peacock.redvars.com/components/field) | wc-field | 🟡 |
76
76
  | File picker | file-picker | 🔴 |
77
- | [HTML editor](https://peacock.redvars.com/components/html-editor) | html-editor | 🟢 |
77
+ | HTML editor | html-editor | 🔴 |
78
78
  | [Input](https://peacock.redvars.com/components/input) | wc-input | 🟢 |
79
- | [Input URL](https://peacock.redvars.com/components/input-url) | input-url | 🟢 |
79
+ | Input URL | input-url | 🔴 |
80
80
  | Month picker | month-picker | 🔴 |
81
- | [Number](https://peacock.redvars.com/components/number) | wc-number-field | 🟢 |
82
- | [Select](https://peacock.redvars.com/components/select) | base-select | 🟢 |
81
+ | [Number field](https://peacock.redvars.com/components/number) | wc-number-field | 🟢 |
82
+ | [Radio](https://peacock.redvars.com/components/radio) | wc-radio | 🟢 |
83
+ | [Search](https://peacock.redvars.com/components/search) | wc-search | 🟡 |
84
+ | [Select](https://peacock.redvars.com/components/select) | wc-select | 🟢 |
83
85
  | [Textarea](https://peacock.redvars.com/components/textarea) | wc-textarea | 🟢 |
84
86
  | [Time picker](https://peacock.redvars.com/components/time-picker) | wc-time-picker | 🟡 |
85
- | [URL input](https://peacock.redvars.com/components/url-input) | url-input | 🔴 |
86
87
  | Week picker | week-picker | 🔴 |
87
88
 
88
89
  ## Navigation
@@ -91,12 +92,13 @@ Navigational components are UI elements that help users move around the app or w
91
92
  and intuitive way to navigate through different sections and pages. Some common examples of navigational components
92
93
  include menus, tabs, and breadcrumbs.
93
94
 
94
- | Name | Component | State |
95
- |--------------------------------------------------------|-----------------|-------|
96
- | [Breadcrumb](https://peacock.redvars.com/components/breadcrumb) | wc-breadcrumb | 🟢 |
97
- | [Dropdown](https://peacock.redvars.com/components/dropdown) | base-dropdown | 🟡 |
98
- | [Menu](https://peacock.redvars.com/components/menu) | wc-base-menu | 🟡 |
99
- | [Tabs](https://peacock.redvars.com/components/tabs) | wc-tabs | 🟢 |
95
+ | Name | Component | State |
96
+ |-------------------------------------------------------------------------|---------------|-------|
97
+ | [Breadcrumb](https://peacock.redvars.com/components/breadcrumb) | wc-breadcrumb | 🟢 |
98
+ | Dropdown | wc-dropdown | 🔴 |
99
+ | [Menu](https://peacock.redvars.com/components/menu) | wc-menu | 🟡 |
100
+ | [Tabs](https://peacock.redvars.com/components/tabs) | wc-tabs | 🟢 |
101
+ | [Toolbar](https://peacock.redvars.com/components/toolbar) | wc-toolbar | 🟡 |
100
102
 
101
103
  ## Informational
102
104
 
@@ -104,15 +106,17 @@ Informational components are UI elements that provide information to users. They
104
106
  updates, or instructions within the app or website. Some common examples of informational components
105
107
  include notifications, tooltips, and progress bars.
106
108
 
107
- | Name | Component | State |
108
- |-------------------------------------------------------------------------------------|------------------------|-------|
109
- | [Badge](https://peacock.redvars.com/components/badge) | wc-badge | 🟢 |
110
- | [Linear Progress](https://peacock.redvars.com/components/linear-progress) | wc-linear-progress | 🟢 |
111
- | [Circular Progress](https://peacock.redvars.com/components/circular-progress) | wc-circular-progress | 🟢 |
112
- | [Spinner](https://peacock.redvars.com/components/spinner) | wc-spinner | 🟢 |
113
- | [Tooltip](https://peacock.redvars.com/components/tooltip) | wc-tooltip | 🟢 |
114
- | [Notification](https://peacock.redvars.com/components/notification) | base-notification | 🟢 |
115
- | [Notification Manager](https://peacock.redvars.com/components/notification-manager) | base-notification-manager | 🟢 |
109
+ | Name | Component | State |
110
+ |-------------------------------------------------------------------------------|----------------------|-------|
111
+ | [Badge](https://peacock.redvars.com/components/badge) | wc-badge | 🟢 |
112
+ | [Banner](https://peacock.redvars.com/components/banner) | wc-banner | 🟡 |
113
+ | [Circular Progress](https://peacock.redvars.com/components/circular-progress) | wc-circular-progress | 🟢 |
114
+ | [Linear Progress](https://peacock.redvars.com/components/linear-progress) | wc-linear-progress | 🟢 |
115
+ | [Notification](https://peacock.redvars.com/components/notification) | wc-notification | 🟢 |
116
+ | [Skeleton](https://peacock.redvars.com/components/skeleton) | wc-skeleton | 🟢 |
117
+ | [Snackbar](https://peacock.redvars.com/components/snackbar) | wc-snackbar | 🟡 |
118
+ | [Spinner](https://peacock.redvars.com/components/spinner) | wc-spinner | 🟢 |
119
+ | [Tooltip](https://peacock.redvars.com/components/tooltip) | wc-tooltip | 🟢 |
116
120
 
117
121
 
118
122
  ## Containers
@@ -121,54 +125,58 @@ Containers are UI elements that group similar content together, making it easier
121
125
  the interface. Examples of common containers include cards, carousels, and accordions, which provide structure and
122
126
  organization to the content.
123
127
 
124
- | Name | Component | State |
125
- |---------------------------------------------------------------|----------------|-------|
126
- | [Accordion](https://peacock.redvars.com/components/accordion) | wc-accordion | 🟢 |
127
- | Card | base-card | 🟡 |
128
+ | Name | Component | State |
129
+ |-----------------------------------------------------------------------|------------------|-------|
130
+ | [Accordion](https://peacock.redvars.com/components/accordion) | wc-accordion | 🟢 |
131
+ | [Bottom Sheet](https://peacock.redvars.com/components/bottom-sheet) | wc-bottom-sheet | 🟡 |
132
+ | [Card](https://peacock.redvars.com/components/card) | wc-card | 🟢 |
133
+ | Container | wc-container | 🟡 |
134
+ | [Side Sheet](https://peacock.redvars.com/components/side-sheet) | wc-side-sheet | 🟡 |
128
135
 
129
136
  ## General
130
137
 
131
138
  These components are used for general purpose. They include
132
139
 
133
- | Name | Component | State |
134
- |-------------------------------------------------------------------------------------|---------------------------|-------|
135
- | [Avatar](https://peacock.redvars.com/components/avatar) | wc-avatar | 🟢 |
136
- | [Button](https://peacock.redvars.com/components/button) | wc-button | 🟢 |
137
- | [Button Group](https://peacock.redvars.com/components/button-group) | wc-button-group | 🟢 |
138
- | [Calendar](https://peacock.redvars.com/components/calendar) | base-calendar | 🟢 |
139
- | Card Select | base-cardselect | 🔴 |
140
- | [Code Highlighter](https://peacock.redvars.com/components/code-highlighter) | wc-code-highlighter | 🟢 |
141
- | Column | base-col | 🔴 |
142
- | [Empty State](https://peacock.redvars.com/components/empty-state) | wc-empty-state | 🟡 |
143
- | [Flow Designer ](https://peacock.redvars.com/components/flow-designer) | flow-designer | 🔵 |
144
- | Grid | base-grid | 🔴 |
145
- | Group | base-group | 🔴 |
146
- | [Header](https://peacock.redvars.com/components/header) | base-header | 🟢 |
147
- | [Icon](https://peacock.redvars.com/components/icon) | wc-icon | 🟢 |
148
- | [Link](https://peacock.redvars.com/components/link) | wc-link | 🟢 |
149
- | [Modal](https://peacock.redvars.com/components/modal) | base-modal | 🟢 |
150
- | [Notification Manager](https://peacock.redvars.com/components/notification-manager) | notification-manager | 🟡 |
151
- | Observer | base-observer | 🔴 |
152
- | Pagination | wc-pagination | 🔴 |
153
- | Radio Group | base-radiogroup | 🔴 |
154
- | Row | base-row | 🔴 |
155
- | [Slider](https://peacock.redvars.com/components/slider) | wc-slider | 🟡 |
156
- | Spoiler | base-spoiler | 🔴 |
157
- | Stepper | base-stepper | 🔴 |
158
- | [Table](https://peacock.redvars.com/components/table) | wc-table | 🟡 |
159
- | [Tag](https://peacock.redvars.com/components/tag) / Chip | wc-tag | 🟢 |
160
- | [Text](https://peacock.redvars.com/components/text) | base-text | 🟢 |
161
- | [Tree View](https://peacock.redvars.com/components/tree-view) | wc-tree-view | 🟡 |
162
- | [Switch](https://peacock.redvars.com/components/switch) | wc-switch | 🟢 |
140
+ | Name | Component | State |
141
+ |-----------------------------------------------------------------------------|-----------------------|-------|
142
+ | [Avatar](https://peacock.redvars.com/components/avatar) | wc-avatar | 🟢 |
143
+ | [Button](https://peacock.redvars.com/components/button) | wc-button | 🟢 |
144
+ | [Button Group](https://peacock.redvars.com/components/button-group) | wc-button-group | 🟢 |
145
+ | Calendar | calendar | 🔴 |
146
+ | Card Select | card-select | 🔴 |
147
+ | [Chip](https://peacock.redvars.com/components/chip) | wc-chip | 🟢 |
148
+ | [Clock](https://peacock.redvars.com/components/clock) | wc-clock | 🟡 |
149
+ | [Code Highlighter](https://peacock.redvars.com/components/code-highlighter) | wc-code-highlighter | 🟢 |
150
+ | [Divider](https://peacock.redvars.com/components/divider) | wc-divider | 🟢 |
151
+ | [Empty State](https://peacock.redvars.com/components/empty-state) | wc-empty-state | 🟡 |
152
+ | [FAB](https://peacock.redvars.com/components/fab) | wc-fab | 🟢 |
153
+ | [Flow Designer](https://peacock.redvars.com/components/flow-designer) | flow-designer | 🔵 |
154
+ | Header | header | 🔴 |
155
+ | [Icon](https://peacock.redvars.com/components/icon) | wc-icon | 🟢 |
156
+ | [Icon Button](https://peacock.redvars.com/components/icon-button) | wc-icon-button | 🟢 |
157
+ | [Image](https://peacock.redvars.com/components/image) | wc-image | 🟡 |
158
+ | [Link](https://peacock.redvars.com/components/link) | wc-link | 🟢 |
159
+ | Modal | modal | 🔴 |
160
+ | [Number Counter](https://peacock.redvars.com/components/number-counter) | wc-number-counter | 🟡 |
161
+ | [Pagination](https://peacock.redvars.com/components/pagination) | wc-pagination | 🟡 |
162
+ | [Segmented Button](https://peacock.redvars.com/components/segmented-button) | wc-segmented-button | 🟡 |
163
+ | [Slider](https://peacock.redvars.com/components/slider) | wc-slider | 🟡 |
164
+ | [Switch](https://peacock.redvars.com/components/switch) | wc-switch | 🟢 |
165
+ | [Table](https://peacock.redvars.com/components/table) | wc-table | 🟡 |
166
+ | [Tag](https://peacock.redvars.com/components/tag) | wc-tag | 🟢 |
167
+ | Text | text | 🔴 |
168
+ | [Sidebar Menu](https://peacock.redvars.com/components/sidebar-menu) | wc-sidebar-menu | 🟡 |
163
169
 
164
170
  ## Charts
165
171
 
166
172
  These components are used to display data in a graphical format. They include
167
173
 
168
- | Name | Component | State |
169
- |----------------------------------------------------------------|---------------------|-------|
170
- | [Doughnut Chart](https://peacock.redvars.com/components/chart-doughnut) | wc-chart-doughnut | 🟢 |
171
- | [Pie Chart ](https://peacock.redvars.com/components/chart-pie) | wc-chart-pie | 🟢 |
174
+ | Name | Component | State |
175
+ |---------------------------------------------------------------------------------|------------------------|-------|
176
+ | [Bar Chart](https://peacock.redvars.com/components/chart-bar) | wc-chart-bar | 🟢 |
177
+ | [Doughnut Chart](https://peacock.redvars.com/components/chart-doughnut) | wc-chart-doughnut | 🟢 |
178
+ | [Pie Chart](https://peacock.redvars.com/components/chart-pie) | wc-chart-pie | 🟢 |
179
+ | [Stacked Bar Chart](https://peacock.redvars.com/components/chart-bar) | wc-chart-stacked-bar | 🟢 |
172
180
 
173
181
 
174
182
  ## 📄 License
package/scss/mixin.scss CHANGED
@@ -57,3 +57,19 @@
57
57
  @content;
58
58
  }
59
59
  }
60
+
61
+ @mixin apply-container-shape($name) {
62
+ border-start-start-radius: var(--#{$name}-container-shape-start-start, var(--#{$name}-container-shape));
63
+ border-start-end-radius: var(--#{$name}-container-shape-start-end, var(--#{$name}-container-shape));
64
+ border-end-start-radius: var(--#{$name}-container-shape-end-start, var(--#{$name}-container-shape));
65
+ border-end-end-radius: var(--#{$name}-container-shape-end-end, var(--#{$name}-container-shape));
66
+ corner-shape: var(--#{$name}-container-shape-variant);
67
+ }
68
+
69
+ @mixin copy-container-shape($from, $to) {
70
+ --#{$to}-container-shape-start-start: var(--#{$from}-container-shape-start-start, var(--#{$from}-container-shape));
71
+ --#{$to}-container-shape-start-end: var(--#{$from}-container-shape-start-end, var(--#{$from}-container-shape));
72
+ --#{$to}-container-shape-end-start: var(--#{$from}-container-shape-end-start, var(--#{$from}-container-shape));
73
+ --#{$to}-container-shape-end-end: var(--#{$from}-container-shape-end-end, var(--#{$from}-container-shape));
74
+ --#{$to}-container-shape-variant: var(--#{$from}-container-shape-variant);
75
+ }
@@ -0,0 +1,83 @@
1
+ import { LitElement } from 'lit';
2
+ import { property } from 'lit/decorators.js';
3
+ import type { MixinConstructor } from './MixinConstructor.js';
4
+
5
+
6
+ /**
7
+ * 1. Define an interface for the members the mixin adds.
8
+ * This makes the type annotation much cleaner.
9
+ */
10
+ export interface BaseButtonInterface {
11
+ htmlType: 'button' | 'submit' | 'reset';
12
+ disabled: boolean;
13
+ softDisabled: boolean;
14
+ disabledReason: string;
15
+ form: string;
16
+ name: string;
17
+ value: string;
18
+ }
19
+
20
+ /**
21
+ * 2. Apply the type annotation to the variable.
22
+ */
23
+ const BaseButtonMixin: <T extends MixinConstructor<LitElement>>(superclass: T) => T & MixinConstructor<BaseButtonInterface> = <T extends MixinConstructor<LitElement>>(superclass: T) => {
24
+ // Naming the class (BaseButtonElement) instead of using 'Mixin' or anonymous
25
+ // prevents the "__childPart" visibility error.
26
+ class BaseButtonElement extends superclass implements BaseButtonInterface {
27
+
28
+ /**
29
+ * The type of the underlying `<button>` element. Maps to the native `type` attribute.
30
+ * Possible values are `"button"`, `"submit"`, `"reset"`. Defaults to `"button"`.
31
+ */
32
+ @property({ type: String }) htmlType: 'button' | 'submit' | 'reset' =
33
+ 'button';
34
+
35
+ /**
36
+ * When `true`, the button is disabled and cannot be interacted with. Reflects to the `disabled` attribute. Defaults to `false`.
37
+ */
38
+ @property({ type: Boolean, reflect: true })
39
+ disabled: boolean = false;
40
+
41
+ /**
42
+ * When `true`, the button is visually styled as disabled and cannot be interacted with, but remains focusable.
43
+ * Use this in combination with `disabledReason` to communicate why the button is unavailable.
44
+ * Reflects to the `soft-disabled` attribute. Defaults to `false`.
45
+ */
46
+ @property({ type: Boolean, reflect: true, attribute: 'soft-disabled' })
47
+ softDisabled: boolean = false;
48
+
49
+ /**
50
+ * A human-readable explanation of why the button is disabled or soft-disabled.
51
+ * Rendered as a visually hidden tooltip and linked via `aria-describedby` for accessibility.
52
+ * Maps to the `disabled-reason` attribute.
53
+ */
54
+ @property({ attribute: 'disabled-reason' })
55
+ disabledReason: string = '';
56
+
57
+ /**
58
+ * The `id` of the `<form>` element to associate the button with.
59
+ * If omitted, the button is associated with its nearest ancestor form.
60
+ * Maps to the native `form` attribute.
61
+ */
62
+ @property()
63
+ form: string = '';
64
+
65
+ /**
66
+ * The name of the button, submitted as part of a name/value pair when the associated form is submitted.
67
+ * Maps to the native `name` attribute.
68
+ */
69
+ @property()
70
+ name: string = '';
71
+
72
+ /**
73
+ * The value of the button, submitted as part of a name/value pair when the associated form is submitted.
74
+ * Maps to the native `value` attribute.
75
+ */
76
+ @property()
77
+ value: string = '';
78
+ }
79
+
80
+ return BaseButtonElement as T & MixinConstructor<BaseButtonInterface>;
81
+ };
82
+
83
+ export default BaseButtonMixin;
@@ -0,0 +1,68 @@
1
+ import { LitElement } from 'lit';
2
+ import { property } from 'lit/decorators.js';
3
+ import type { MixinConstructor } from './MixinConstructor.js';
4
+
5
+
6
+ /**
7
+ * 1. Define an interface for the members the mixin adds.
8
+ * This makes the type annotation much cleaner.
9
+ */
10
+ export interface BaseHyperlinkInterface {
11
+ href?: string;
12
+ target: '_self' | '_parent' | '_blank' | '_top' | string;
13
+ rel?: string;
14
+ download?: string;
15
+ __isLink(): boolean;
16
+ }
17
+
18
+ /**
19
+ * 2. Apply the type annotation to the variable.
20
+ */
21
+ const BaseHyperlinkMixin: <T extends MixinConstructor<LitElement>>(superclass: T) => T & MixinConstructor<BaseHyperlinkInterface> = <T extends MixinConstructor<LitElement>>(superclass: T) => {
22
+ // Naming the class (BaseHyperlinkElement) instead of using 'Mixin' or anonymous
23
+ // prevents the "__childPart" visibility error.
24
+ class BaseHyperlinkElement extends superclass implements BaseHyperlinkInterface {
25
+ /**
26
+ * The URL that the hyperlink points to. When set, the component renders as an `<a>` element.
27
+ * Maps to the native `href` attribute.
28
+ */
29
+ @property({ reflect: true })
30
+ href?: string;
31
+
32
+ /**
33
+ * Where to display the linked URL. Maps to the native `target` attribute.
34
+ * Possible values are `"_self"`, `"_blank"`, `"_parent"`, `"_top"`, or a custom frame name.
35
+ * When using `"_blank"`, consider setting `rel="noopener noreferrer"` for security. Defaults to `"_self"`.
36
+ */
37
+ @property()
38
+ target: '_self' | '_parent' | '_blank' | '_top' | string = '_self';
39
+
40
+ /**
41
+ * The relationship between the current document and the linked URL.
42
+ * Maps to the native `rel` attribute on the rendered `<a>` element.
43
+ * When `target="_blank"`, use `"noopener noreferrer"` to prevent tab-napping attacks.
44
+ */
45
+ @property()
46
+ rel?: string;
47
+
48
+ /**
49
+ * Causes the browser to download the linked URL instead of navigating to it.
50
+ * If a string value is provided, it is used as the suggested filename.
51
+ * Omit or leave undefined to preserve normal navigation behaviour.
52
+ * Maps to the native `download` attribute. Only applies when `href` is set.
53
+ */
54
+ @property()
55
+ download?: string;
56
+
57
+ /**
58
+ * Returns `true` when `href` is set, indicating the component should render as a link.
59
+ */
60
+ __isLink(): boolean {
61
+ return !!this.href;
62
+ }
63
+ }
64
+
65
+ return BaseHyperlinkElement as T & MixinConstructor<BaseHyperlinkInterface>;
66
+ };
67
+
68
+ export default BaseHyperlinkMixin;
@@ -0,0 +1 @@
1
+ export type MixinConstructor<T = {}> = new (...args: any[]) => T;
@@ -1,6 +1,6 @@
1
- # Base Element
1
+ # Mixins
2
2
 
3
- The base element is an abstract foundation for component families.
3
+ The mixin element is an abstract foundation for component families.
4
4
 
5
5
  It defines shared component contracts such as:
6
6
 
@@ -4,12 +4,6 @@
4
4
 
5
5
  :host {
6
6
  display: block;
7
-
8
- --banner-container-color: var(--color-tertiary-container);
9
- --banner-label-text-color: var(--color-on-tertiary-container);
10
- --banner-description-text-color: var(--color-on-tertiary-container);
11
- --banner-icon-color: var(--color-on-tertiary-container);
12
- --banner-border-radius: var(--shape-corner-small);
13
7
  }
14
8
 
15
9
  .banner {
@@ -32,26 +26,28 @@
32
26
  }
33
27
 
34
28
  .banner-content {
35
- display: flex;
36
- flex-direction: column;
37
- gap: var(--spacing-050);
38
- }
29
+ .banner-label {
30
+ display: inline;
31
+ @include mixin.get-typography(label-large);
32
+ color: var(--banner-label-text-color);
33
+ margin-inline-end: var(--spacing-050);
34
+ }
39
35
 
40
- .banner-label {
41
- @include mixin.get-typography(label-large);
42
- color: var(--banner-label-text-color);
36
+ .banner-description {
37
+ display: inline;
38
+ @include mixin.get-typography(body-medium);
39
+ color: var(--banner-description-text-color);
40
+ }
43
41
  }
44
42
 
45
- .banner-description {
46
- @include mixin.get-typography(body-medium);
47
- color: var(--banner-description-text-color);
48
- }
49
43
 
50
- .banner-content.inline {
51
- flex-direction: row;
52
- align-items: baseline;
53
- flex-wrap: wrap;
54
- gap: 0.25em;
44
+ // Default styles for the banner and content. These will be overridden by the variant-specific styles below.
45
+ :host {
46
+ --banner-container-color: var(--color-tertiary-container);
47
+ --banner-label-text-color: var(--color-on-tertiary-container);
48
+ --banner-description-text-color: var(--color-on-tertiary-container);
49
+ --banner-icon-color: var(--color-on-tertiary-container);
50
+ --banner-border-radius: var(--shape-corner-small);
55
51
  }
56
52
 
57
53
  .banner.info,
@@ -69,12 +69,6 @@ export class Banner extends LitElement {
69
69
  @property({ type: String })
70
70
  description = '';
71
71
 
72
- /**
73
- * When true, label and description are rendered on a single line.
74
- */
75
- @property({ type: Boolean, reflect: true })
76
- inline = false;
77
-
78
72
  private get resolvedLabel() {
79
73
  return this.label || VARIANT_LABELS[this.variant];
80
74
  }
@@ -92,7 +86,7 @@ export class Banner extends LitElement {
92
86
  </slot>
93
87
  </div>
94
88
 
95
- <div class=${classMap({ 'banner-content': true, [this.variant]: true, inline: this.inline })}>
89
+ <div class=${classMap({ 'banner-content': true, [this.variant]: true })}>
96
90
  <div class="banner-label">
97
91
  <slot name="label">${this.resolvedLabel}:</slot>
98
92
  </div>
@@ -1,81 +1,21 @@
1
1
  import { html, LitElement, nothing } from 'lit';
2
2
  import { property, query, state } from 'lit/decorators.js';
3
3
  import { dispatchActivationClick, isActivationClick } from '../__utils/dispatch-event-utils.js';
4
- import BaseHyperlink from '@/__base_element/BaseHyperlink.js';
4
+ import BaseHyperlinkMixin from '@/__mixins/BaseHyperlinkMixin.js';
5
+ import BaseButtonMixin from '@/__mixins/BaseButtonMixin.js';
5
6
 
6
- export class BaseButton extends BaseHyperlink(LitElement) {
7
- protected static readonly DISABLED_REASON_ID = 'disabled-reason';
8
-
9
- @property({ type: String }) htmlType: 'button' | 'submit' | 'reset' =
10
- 'button';
11
-
12
- /**
13
- * Type is preset of color and variant. Type will be only applied.
14
- *
15
- */
16
- @property({ type: String }) type?: 'primary' | 'secondary' | 'tertiary';
17
-
18
- /**
19
- * The visual style of the button.
20
- *
21
- * Possible variant values:
22
- * `"filled"` is a filled button.
23
- * `"outlined"` is an outlined button.
24
- * `"text"` is a transparent button.
25
- * `"tonal"` is a light color button.
26
- * `"elevated"` is elevated button
27
- */
28
- @property() variant:
29
- | 'elevated'
30
- | 'filled'
31
- | 'tonal'
32
- | 'outlined'
33
- | 'text'
34
- | 'neo' = 'filled';
35
-
36
- /**
37
- * Defines the primary color of the button. This can be set to predefined color names to apply specific color themes.
38
- */
39
- @property({ reflect: true }) color:
40
- | 'primary'
41
- | 'success'
42
- | 'danger'
43
- | 'warning'
44
- | 'surface'
45
- | 'on-surface' = 'primary';
46
-
47
- /**
48
- * Button size.
49
- * Possible values are `"sm"`, `"md"`, `"lg"`. Defaults to `"md"`.
50
- */
51
- @property({ reflect: true }) size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = 'sm';
52
-
53
- /**
54
- * If true, the user cannot interact with the button. Defaults to `false`.
55
- */
56
- @property({ type: Boolean, reflect: true })
57
- disabled: boolean = false;
58
7
 
59
- @property({ type: Boolean, reflect: true }) skeleton: boolean = false;
60
8
 
61
- /**
62
- * If true, the user cannot interact with the button and the button is visually styled as disabled. But the button is still focusable. Defaults to `false`.
63
- */
64
- @property({ type: Boolean, reflect: true, attribute: 'soft-disabled' })
65
- softDisabled: boolean = false;
9
+ export class BaseButton extends BaseButtonMixin(BaseHyperlinkMixin(LitElement)) {
10
+ protected static readonly DISABLED_REASON_ID = 'disabled-reason';
66
11
 
67
- /**
68
- * If button is disabled, the reason why it is disabled.
69
- */
70
- @property({ attribute: 'disabled-reason' })
71
- disabledReason: string = '';
72
12
 
13
+ color?: string;
73
14
 
74
- @property({ reflect: true })
75
- configAria?: { [key: string]: any };
15
+ variant?: string;
76
16
 
17
+ @property({ type: Boolean, reflect: true }) skeleton: boolean = false;
77
18
 
78
-
79
19
  @property({ type: Boolean, reflect: true }) toggle: boolean = false;
80
20
 
81
21
  @property({ type: Boolean, reflect: true }) selected: boolean = false;
@@ -95,14 +35,6 @@ export class BaseButton extends BaseHyperlink(LitElement) {
95
35
 
96
36
  @query('.button') readonly buttonElement!: HTMLElement | null;
97
37
 
98
- override focus() {
99
- this.buttonElement?.focus();
100
- }
101
-
102
- override blur() {
103
- this.buttonElement?.blur();
104
- }
105
-
106
38
  override connectedCallback() {
107
39
  super.connectedCallback();
108
40
  this.addEventListener('click', this.__dispatchClickWithThrottle);
@@ -157,33 +89,12 @@ export class BaseButton extends BaseHyperlink(LitElement) {
157
89
  dispatchActivationClick(this.buttonElement);
158
90
  };
159
91
 
160
- __convertTypeToVariantAndColor() {
161
- if (this.type === 'primary') {
162
- this.color = 'primary';
163
- this.variant = 'filled';
164
- } else if (this.type === 'secondary') {
165
- this.color = 'surface';
166
- this.variant = 'filled';
167
- } else if (this.type === 'tertiary') {
168
- this.color = 'primary';
169
- this.variant = 'text';
170
- } else if (this.type === 'danger') {
171
- this.color = 'danger';
172
- this.variant = 'filled';
173
- }
174
- }
175
-
176
- protected get __disabledReasonID(): string | undefined {
177
- return this.disabled && this.disabledReason
178
- ? BaseButton.DISABLED_REASON_ID
179
- : undefined;
180
- }
92
+
181
93
 
182
- __renderDisabledReason() {
183
- const disabledReasonID = this.__disabledReasonID;
184
- if (disabledReasonID)
94
+ __renderDisabledReason(softDisabled: boolean) {
95
+ if (softDisabled)
185
96
  return html`<div
186
- id=${disabledReasonID}
97
+ id=${BaseButton.DISABLED_REASON_ID}
187
98
  role="tooltip"
188
99
  aria-label=${this.disabledReason}
189
100
  class="screen-reader-only"
@@ -67,11 +67,13 @@
67
67
  letter-spacing: 0 !important;
68
68
  }
69
69
 
70
- :host([size='xl']) {
70
+ :host([size='xl']),
71
+ :host([size='extra-large']) {
71
72
  --button-height: 8.5rem;
72
73
  }
73
74
 
74
- :host([size='xl']) .button {
75
+ :host([size='xl']) .button,
76
+ :host([size='extra-large']) .button {
75
77
  --_button-icon-size: 2.5rem;
76
78
  --_button_container-padding: 4rem;
77
79