@redvars/peacock 3.5.1 → 3.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BaseButton-DuASuVth.js → BaseButton-BNFAYn-S.js} +2 -2
- package/dist/{BaseButton-DuASuVth.js.map → BaseButton-BNFAYn-S.js.map} +1 -1
- package/dist/BaseInput-14YmcfK7.js +27 -0
- package/dist/BaseInput-14YmcfK7.js.map +1 -0
- package/dist/banner.js +2 -3
- package/dist/banner.js.map +1 -1
- package/dist/{button-DouvOfEU.js → button-colors-Ccys3hvS.js} +5 -294
- package/dist/button-colors-Ccys3hvS.js.map +1 -0
- package/dist/button-group.js +226 -6
- package/dist/button-group.js.map +1 -1
- package/dist/button.js +294 -8
- package/dist/button.js.map +1 -1
- package/dist/calendar-column-view.js +634 -0
- package/dist/calendar-column-view.js.map +1 -0
- package/dist/calendar-event-BrQ_SEKD.js +199 -0
- package/dist/calendar-event-BrQ_SEKD.js.map +1 -0
- package/dist/calendar-month-view.js +376 -0
- package/dist/calendar-month-view.js.map +1 -0
- package/dist/calendar.js +339 -0
- package/dist/calendar.js.map +1 -0
- package/dist/canvas.js +361 -0
- package/dist/canvas.js.map +1 -0
- package/dist/cb-compound-expression.js +125 -0
- package/dist/cb-compound-expression.js.map +1 -0
- package/dist/cb-divider.js +150 -0
- package/dist/cb-divider.js.map +1 -0
- package/dist/cb-expression.js +75 -0
- package/dist/cb-expression.js.map +1 -0
- package/dist/cb-predicate.js +137 -0
- package/dist/cb-predicate.js.map +1 -0
- package/dist/code-editor.js +2 -1
- package/dist/code-editor.js.map +1 -1
- package/dist/code-highlighter.js +1 -1
- package/dist/code-highlighter.js.map +1 -1
- package/dist/condition-builder.js +58 -0
- package/dist/condition-builder.js.map +1 -0
- package/dist/custom-elements-jsdocs.json +8479 -3965
- package/dist/custom-elements.json +15228 -7544
- package/dist/dropdown-button.js +216 -0
- package/dist/dropdown-button.js.map +1 -0
- package/dist/event-manager-D-QCmUgR.js +113 -0
- package/dist/event-manager-D-QCmUgR.js.map +1 -0
- package/dist/fab.js +1 -1
- package/dist/flow-designer-DvTUrDp5.js +1656 -0
- package/dist/flow-designer-DvTUrDp5.js.map +1 -0
- package/dist/flow-designer-node-BWrPuxAR.js +548 -0
- package/dist/flow-designer-node-BWrPuxAR.js.map +1 -0
- package/dist/flow-designer-node.js +4 -0
- package/dist/flow-designer-node.js.map +1 -0
- package/dist/flow-designer.js +16 -0
- package/dist/flow-designer.js.map +1 -0
- package/dist/html-editor.js +27516 -0
- package/dist/html-editor.js.map +1 -0
- package/dist/icon-button-CK1ZuE-2.js +247 -0
- package/dist/icon-button-CK1ZuE-2.js.map +1 -0
- package/dist/index.js +29 -6
- package/dist/index.js.map +1 -1
- package/dist/{is-dark-mode-DicqGkCJ.js → is-dark-mode-DOcaw4Yq.js} +2 -27
- package/dist/is-dark-mode-DOcaw4Yq.js.map +1 -0
- package/dist/modal.js +412 -0
- package/dist/modal.js.map +1 -0
- package/dist/{navigation-rail-Lxetd5-Z.js → navigation-rail-DTTkqohi.js} +1049 -2391
- package/dist/navigation-rail-DTTkqohi.js.map +1 -0
- package/dist/notification-manager.js +268 -0
- package/dist/notification-manager.js.map +1 -0
- package/dist/peacock-loader.js +93 -8
- package/dist/peacock-loader.js.map +1 -1
- package/dist/popover-NC7b1lTq.js +1971 -0
- package/dist/popover-NC7b1lTq.js.map +1 -0
- package/dist/popover-content.js +125 -0
- package/dist/popover-content.js.map +1 -0
- package/dist/popover.js +4 -0
- package/dist/popover.js.map +1 -0
- package/dist/split-button.js +388 -0
- package/dist/split-button.js.map +1 -0
- package/dist/src/__controllers/floating-controller.d.ts +35 -0
- package/dist/src/calendar/base-event.d.ts +10 -0
- package/dist/src/calendar/calendar-column-view.d.ts +41 -0
- package/dist/src/calendar/calendar-event.d.ts +7 -0
- package/dist/src/calendar/calendar-month-view.d.ts +31 -0
- package/dist/src/calendar/calendar.d.ts +65 -0
- package/dist/src/calendar/event-manager.d.ts +17 -0
- package/dist/src/calendar/index.d.ts +4 -0
- package/dist/src/calendar/types.d.ts +13 -0
- package/dist/src/calendar/utils.d.ts +31 -0
- package/dist/src/canvas/canvas.d.ts +92 -0
- package/dist/src/canvas/index.d.ts +2 -0
- package/dist/src/condition-builder/cb-compound-expression.d.ts +31 -0
- package/dist/src/condition-builder/cb-divider.d.ts +26 -0
- package/dist/src/condition-builder/cb-expression.d.ts +31 -0
- package/dist/src/condition-builder/cb-predicate.d.ts +30 -0
- package/dist/src/condition-builder/condition-builder.d.ts +27 -0
- package/dist/src/condition-builder/index.d.ts +5 -0
- package/dist/src/dropdown-button/dropdown-button.d.ts +68 -0
- package/dist/src/dropdown-button/index.d.ts +1 -0
- package/dist/src/flow-designer/commands.d.ts +66 -0
- package/dist/src/flow-designer/flow-designer-node.d.ts +46 -0
- package/dist/src/flow-designer/flow-designer.d.ts +133 -0
- package/dist/src/flow-designer/index.d.ts +7 -0
- package/dist/src/flow-designer/layout.d.ts +30 -0
- package/dist/src/flow-designer/types.d.ts +142 -0
- package/dist/src/flow-designer/validation.d.ts +43 -0
- package/dist/src/flow-designer/workflow-utils.d.ts +40 -0
- package/dist/src/html-editor/html-editor.d.ts +89 -0
- package/dist/src/html-editor/index.d.ts +2 -0
- package/dist/src/index.d.ts +15 -0
- package/dist/src/list/index.d.ts +2 -0
- package/dist/src/list/list-item.d.ts +35 -0
- package/dist/src/list/list.d.ts +28 -0
- package/dist/src/menu/menu/menu.d.ts +5 -7
- package/dist/src/menu/menu-item/menu-item.d.ts +14 -13
- package/dist/src/modal/index.d.ts +1 -0
- package/dist/src/modal/modal.d.ts +57 -0
- package/dist/src/navigation-rail/navigation-rail.d.ts +3 -7
- package/dist/src/notification-manager/index.d.ts +1 -0
- package/dist/src/notification-manager/notification-manager.d.ts +44 -0
- package/dist/src/number-field/number-field.d.ts +2 -2
- package/dist/src/popover/index.d.ts +2 -0
- package/dist/src/popover/popover-content.d.ts +29 -0
- package/dist/src/popover/popover.d.ts +62 -0
- package/dist/src/split-button/index.d.ts +1 -0
- package/dist/src/split-button/split-button.d.ts +72 -0
- package/dist/src/svg/index.d.ts +1 -0
- package/dist/src/svg/svg.d.ts +38 -0
- package/dist/src/toolbar/toolbar.d.ts +3 -3
- package/dist/src/tooltip/tooltip.d.ts +2 -15
- package/dist/test/flow-designer.test.d.ts +1 -0
- package/dist/toolbar.js +3 -3
- package/dist/toolbar.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -2
- package/readme.md +3 -3
- package/src/__controllers/floating-controller.ts +237 -0
- package/src/banner/banner.scss +2 -3
- package/src/button/button/button.ts +1 -0
- package/src/calendar/base-event.ts +49 -0
- package/src/calendar/calendar-column-view.scss +326 -0
- package/src/calendar/calendar-column-view.ts +392 -0
- package/src/calendar/calendar-event.ts +20 -0
- package/src/calendar/calendar-month-view.scss +192 -0
- package/src/calendar/calendar-month-view.ts +244 -0
- package/src/calendar/calendar.scss +71 -0
- package/src/calendar/calendar.ts +298 -0
- package/src/calendar/event-manager.ts +117 -0
- package/src/calendar/index.ts +4 -0
- package/src/calendar/types.ts +14 -0
- package/src/calendar/utils.ts +180 -0
- package/src/canvas/canvas.scss +60 -0
- package/src/canvas/canvas.ts +391 -0
- package/src/canvas/index.ts +2 -0
- package/src/code-highlighter/code-highlighter.ts +1 -1
- package/src/condition-builder/cb-compound-expression.scss +37 -0
- package/src/condition-builder/cb-compound-expression.ts +80 -0
- package/src/condition-builder/cb-divider.scss +93 -0
- package/src/condition-builder/cb-divider.ts +56 -0
- package/src/condition-builder/cb-expression.scss +14 -0
- package/src/condition-builder/cb-expression.ts +49 -0
- package/src/condition-builder/cb-predicate.scss +35 -0
- package/src/condition-builder/cb-predicate.ts +102 -0
- package/src/condition-builder/condition-builder.scss +13 -0
- package/src/condition-builder/condition-builder.ts +38 -0
- package/src/condition-builder/index.ts +5 -0
- package/src/dropdown-button/demo/index.html +110 -0
- package/src/dropdown-button/dropdown-button.scss +22 -0
- package/src/dropdown-button/dropdown-button.ts +206 -0
- package/src/dropdown-button/index.ts +1 -0
- package/src/flow-designer/DEMO.md +239 -0
- package/src/flow-designer/commands.ts +278 -0
- package/src/flow-designer/flow-designer-node.ts +172 -0
- package/src/flow-designer/flow-designer.scss +457 -0
- package/src/flow-designer/flow-designer.ts +611 -0
- package/src/flow-designer/index.ts +41 -0
- package/src/flow-designer/layout.ts +357 -0
- package/src/flow-designer/types.ts +166 -0
- package/src/flow-designer/validation.ts +284 -0
- package/src/flow-designer/workflow-utils.ts +282 -0
- package/src/html-editor/html-editor.scss +188 -0
- package/src/html-editor/html-editor.ts +491 -0
- package/src/html-editor/index.ts +3 -0
- package/src/index.ts +27 -1
- package/src/list/index.ts +2 -0
- package/src/list/list-item.scss +111 -0
- package/src/list/list-item.ts +175 -0
- package/src/list/list.scss +24 -0
- package/src/list/list.ts +51 -0
- package/src/menu/menu/menu.scss +2 -2
- package/src/menu/menu/menu.ts +91 -101
- package/src/menu/menu-item/menu-item.scss +4 -0
- package/src/menu/menu-item/menu-item.ts +82 -78
- package/src/modal/index.ts +1 -0
- package/src/modal/modal.scss +206 -0
- package/src/modal/modal.ts +195 -0
- package/src/navigation-rail/navigation-rail-item.scss +7 -38
- package/src/navigation-rail/navigation-rail-item.ts +1 -2
- package/src/navigation-rail/navigation-rail.scss +17 -21
- package/src/navigation-rail/navigation-rail.ts +6 -9
- package/src/notification-manager/index.ts +1 -0
- package/src/notification-manager/notification-manager.scss +113 -0
- package/src/notification-manager/notification-manager.ts +199 -0
- package/src/number-field/number-field.ts +2 -2
- package/src/peacock-loader.ts +83 -0
- package/src/popover/index.ts +2 -0
- package/src/popover/popover-content.scss +69 -0
- package/src/popover/popover-content.ts +51 -0
- package/src/popover/popover.scss +7 -0
- package/src/popover/popover.ts +170 -0
- package/src/split-button/index.ts +1 -0
- package/src/split-button/split-button-colors.scss +56 -0
- package/src/split-button/split-button-sizes.scss +28 -0
- package/src/split-button/split-button.scss +79 -0
- package/src/split-button/split-button.ts +236 -0
- package/src/svg/index.ts +1 -0
- package/src/svg/svg.scss +91 -0
- package/src/svg/svg.ts +160 -0
- package/src/table/table.ts +2 -2
- package/src/toolbar/toolbar.ts +3 -3
- package/src/tooltip/tooltip.scss +4 -3
- package/src/tooltip/tooltip.ts +46 -104
- package/dist/button-DouvOfEU.js.map +0 -1
- package/dist/button-group-CEdMwvJJ.js +0 -464
- package/dist/button-group-CEdMwvJJ.js.map +0 -1
- package/dist/is-dark-mode-DicqGkCJ.js.map +0 -1
- package/dist/navigation-rail-Lxetd5-Z.js.map +0 -1
- package/dist/src/menu/menu/MenuSurfaceController.d.ts +0 -18
- package/src/menu/menu/MenuSurfaceController.ts +0 -61
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { a as i, _ as __decorate, b } from './IndividualComponent-DUINtMGK.js';
|
|
2
|
+
import { n } from './property-1psGvXOq.js';
|
|
3
|
+
import { e } from './class-map-YU7g0o3B.js';
|
|
4
|
+
import { B as BaseButton, o, s as spread } from './BaseButton-BNFAYn-S.js';
|
|
5
|
+
import { c as css_248z$1, a as css_248z$2 } from './button-colors-Ccys3hvS.js';
|
|
6
|
+
import { t as throttle } from './BaseHyperlinkMixin-BNuwbiEf.js';
|
|
7
|
+
|
|
8
|
+
var css_248z = i`.button {
|
|
9
|
+
--_container-padding: 0.75rem;
|
|
10
|
+
width: var(--button-height);
|
|
11
|
+
--_container-padding: 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host([size=xs]),
|
|
15
|
+
:host([size=extra-small]) {
|
|
16
|
+
--button-height: 2rem;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:host([size=xs]) .button,
|
|
20
|
+
:host([size=extra-small]) .button {
|
|
21
|
+
--_button-icon-size: 1rem;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:host([size=sm]),
|
|
25
|
+
:host([size=small]) {
|
|
26
|
+
--button-height: 2.5rem;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:host([size=sm]) .button,
|
|
30
|
+
:host([size=small]) .button {
|
|
31
|
+
--_button-icon-size: 1.25rem;
|
|
32
|
+
--_button-icon-label-spacing: 0.5rem;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:host([size=md]),
|
|
36
|
+
:host([size=medium]) {
|
|
37
|
+
--button-height: 3.5rem;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:host([size=md]) .button,
|
|
41
|
+
:host([size=medium]) .button {
|
|
42
|
+
--_button-icon-size: 1.5rem;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:host([size=lg]),
|
|
46
|
+
:host([size=large]) {
|
|
47
|
+
--button-height: 6rem;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
:host([size=lg]) .button,
|
|
51
|
+
:host([size=large]) .button {
|
|
52
|
+
--_button-icon-size: 2rem;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:host([size=xl]) {
|
|
56
|
+
--button-height: 8.5rem;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:host([size=xl]) .button {
|
|
60
|
+
--_button-icon-size: 2.5rem;
|
|
61
|
+
}`;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @label Icon Button
|
|
65
|
+
* @tag wc-icon-button
|
|
66
|
+
* @rawTag icon-button
|
|
67
|
+
*
|
|
68
|
+
* @summary Icon buttons allow users to take actions, and make choices, with a single tap.
|
|
69
|
+
*
|
|
70
|
+
* @overview
|
|
71
|
+
* <p>Icon buttons are clickable elements that are used to trigger actions. They communicate calls to action to the user and allow users to interact with pages in a variety of ways. IconButton labels express what action will occur when the user interacts with it.</p>
|
|
72
|
+
*
|
|
73
|
+
* @cssprop --button-container-shape: Defines the border radius of the button container shape.
|
|
74
|
+
*
|
|
75
|
+
* @cssprop --button-container-shape-start-start: Defines the start position of the button container shape.
|
|
76
|
+
* @cssprop --button-container-shape-start-end: Defines the end position of the button container shape.
|
|
77
|
+
* @cssprop --button-container-shape-end-start: Defines the start position of the button container shape.
|
|
78
|
+
* @cssprop --button-container-shape-end-end: Defines the end position of the button container shape.
|
|
79
|
+
*
|
|
80
|
+
*
|
|
81
|
+
* @cssprop --filled-button-container-color: Color of the filled button container.
|
|
82
|
+
* @cssprop --filled-button-label-text-color: Text color of the filled button label.
|
|
83
|
+
*
|
|
84
|
+
* @cssprop --outlined-button-container-color: Color of the outlined button container.
|
|
85
|
+
* @cssprop --outlined-button-label-text-color: Text color of the outlined button label.
|
|
86
|
+
*
|
|
87
|
+
* @cssprop --text-button-label-text-color: Text color of the text button label.
|
|
88
|
+
*
|
|
89
|
+
* @cssprop --tonal-button-container-color: Color of the tonal button container.
|
|
90
|
+
* @cssprop --tonal-button-label-text-color: Text color of the tonal button label.
|
|
91
|
+
*
|
|
92
|
+
* @cssprop --elevated-button-container-color: Color of the elevated button container.
|
|
93
|
+
* @cssprop --elevated-button-label-text-color: Text color of the elevated button label.
|
|
94
|
+
*
|
|
95
|
+
* @cssprop --neo-button-container-color: Color of the neo button container.
|
|
96
|
+
* @cssprop --neo-button-label-text-color: Text color of the neo button label.
|
|
97
|
+
*
|
|
98
|
+
* @fires {CustomEvent} button:click - Dispatched when the button is clicked.
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```html
|
|
102
|
+
* <wc-icon-button><wc-icon name="home"></wc-icon></wc-icon-button>
|
|
103
|
+
* ```
|
|
104
|
+
* @tags display
|
|
105
|
+
*/
|
|
106
|
+
class IconButton extends BaseButton {
|
|
107
|
+
constructor() {
|
|
108
|
+
super(...arguments);
|
|
109
|
+
/**
|
|
110
|
+
* Button size.
|
|
111
|
+
* Possible values are `"xs"`, `"sm"`, `"md"`, `"lg"`, `"xl"`. Defaults to `"sm"`.
|
|
112
|
+
*/
|
|
113
|
+
this.size = 'sm';
|
|
114
|
+
/**
|
|
115
|
+
* The visual style of the button.
|
|
116
|
+
*
|
|
117
|
+
* Possible variant values:
|
|
118
|
+
* `"filled"` is a filled button.
|
|
119
|
+
* `"outlined"` is an outlined button.
|
|
120
|
+
* `"text"` is a transparent button.
|
|
121
|
+
* `"tonal"` is a light color button.
|
|
122
|
+
* `"elevated"` is elevated button
|
|
123
|
+
*/
|
|
124
|
+
this.variant = 'filled';
|
|
125
|
+
/**
|
|
126
|
+
* Defines the primary color of the button. This can be set to predefined color names to apply specific color themes.
|
|
127
|
+
*/
|
|
128
|
+
this.color = 'primary';
|
|
129
|
+
}
|
|
130
|
+
focus() {
|
|
131
|
+
this.buttonElement?.focus();
|
|
132
|
+
}
|
|
133
|
+
blur() {
|
|
134
|
+
this.buttonElement?.blur();
|
|
135
|
+
}
|
|
136
|
+
firstUpdated() {
|
|
137
|
+
this.__dispatchClickWithThrottle = throttle(this.__dispatchClick, this.throttleDelay);
|
|
138
|
+
this.__convertTypeToVariantAndColor();
|
|
139
|
+
}
|
|
140
|
+
__convertTypeToVariantAndColor() {
|
|
141
|
+
if (this.type === 'primary') {
|
|
142
|
+
this.color = 'primary';
|
|
143
|
+
this.variant = 'filled';
|
|
144
|
+
}
|
|
145
|
+
else if (this.type === 'secondary') {
|
|
146
|
+
this.color = 'surface';
|
|
147
|
+
this.variant = 'filled';
|
|
148
|
+
}
|
|
149
|
+
else if (this.type === 'tertiary') {
|
|
150
|
+
this.color = 'primary';
|
|
151
|
+
this.variant = 'text';
|
|
152
|
+
}
|
|
153
|
+
else if (this.type === 'danger') {
|
|
154
|
+
this.color = 'danger';
|
|
155
|
+
this.variant = 'filled';
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
render() {
|
|
159
|
+
const isLink = this.__isLink();
|
|
160
|
+
const cssClasses = {
|
|
161
|
+
button: true,
|
|
162
|
+
'button-element': true,
|
|
163
|
+
[`size-${this.size}`]: true,
|
|
164
|
+
[`variant-${this.variant}`]: true,
|
|
165
|
+
[`color-${this.color}`]: true,
|
|
166
|
+
disabled: this.disabled || this.softDisabled,
|
|
167
|
+
pressed: this.isPressed,
|
|
168
|
+
skeleton: this.skeleton,
|
|
169
|
+
};
|
|
170
|
+
if (!isLink) {
|
|
171
|
+
return b `<button
|
|
172
|
+
class=${e(cssClasses)}
|
|
173
|
+
id="button"
|
|
174
|
+
type=${this.htmlType}
|
|
175
|
+
@click=${this.__dispatchClickWithThrottle}
|
|
176
|
+
@mousedown=${this.__handlePress}
|
|
177
|
+
@keydown=${this.__handlePress}
|
|
178
|
+
@keyup=${this.__handlePress}
|
|
179
|
+
|
|
180
|
+
aria-describedby=${o(this.softDisabled ? BaseButton.DISABLED_REASON_ID : undefined)}
|
|
181
|
+
?aria-disabled=${this.softDisabled}
|
|
182
|
+
|
|
183
|
+
?disabled=${this.disabled}
|
|
184
|
+
${spread(this.configAria)}
|
|
185
|
+
>
|
|
186
|
+
${this.renderButtonContent()}
|
|
187
|
+
</button>
|
|
188
|
+
${this.__renderTooltip()}`;
|
|
189
|
+
}
|
|
190
|
+
return b `<a
|
|
191
|
+
class=${e(cssClasses)}
|
|
192
|
+
id="button"
|
|
193
|
+
href=${this.href}
|
|
194
|
+
target=${this.target}
|
|
195
|
+
tabindex=${this.disabled ? '-1' : '0'}
|
|
196
|
+
@click=${this.__dispatchClick}
|
|
197
|
+
@mousedown=${this.__handlePress}
|
|
198
|
+
@keydown=${this.__handlePress}
|
|
199
|
+
@keyup=${this.__handlePress}
|
|
200
|
+
role="button"
|
|
201
|
+
|
|
202
|
+
aria-describedby=${o(this.softDisabled ? BaseButton.DISABLED_REASON_ID : undefined)}
|
|
203
|
+
?aria-disabled=${this.softDisabled}
|
|
204
|
+
|
|
205
|
+
${spread(this.configAria)}
|
|
206
|
+
>
|
|
207
|
+
${this.renderButtonContent()}
|
|
208
|
+
</a>
|
|
209
|
+
${this.__renderTooltip()}`;
|
|
210
|
+
}
|
|
211
|
+
renderButtonContent() {
|
|
212
|
+
return b `
|
|
213
|
+
<wc-focus-ring class="focus-ring" for='button'></wc-focus-ring>
|
|
214
|
+
<wc-elevation class="elevation"></wc-elevation>
|
|
215
|
+
<div class="neo-background"></div>
|
|
216
|
+
<div class="background"></div>
|
|
217
|
+
<div class="outline"></div>
|
|
218
|
+
<wc-ripple class="ripple"></wc-ripple>
|
|
219
|
+
<wc-skeleton class="skeleton"></wc-skeleton>
|
|
220
|
+
|
|
221
|
+
<div class="button-content">
|
|
222
|
+
<slot></slot>
|
|
223
|
+
</div>
|
|
224
|
+
|
|
225
|
+
${this.__renderDisabledReason(this.softDisabled)}
|
|
226
|
+
`;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
IconButton.styles = [css_248z$1, css_248z$2, css_248z];
|
|
230
|
+
__decorate([
|
|
231
|
+
n({ reflect: true })
|
|
232
|
+
], IconButton.prototype, "size", void 0);
|
|
233
|
+
__decorate([
|
|
234
|
+
n({ type: String })
|
|
235
|
+
], IconButton.prototype, "type", void 0);
|
|
236
|
+
__decorate([
|
|
237
|
+
n()
|
|
238
|
+
], IconButton.prototype, "variant", void 0);
|
|
239
|
+
__decorate([
|
|
240
|
+
n({ reflect: true })
|
|
241
|
+
], IconButton.prototype, "color", void 0);
|
|
242
|
+
__decorate([
|
|
243
|
+
n({ reflect: true })
|
|
244
|
+
], IconButton.prototype, "configAria", void 0);
|
|
245
|
+
|
|
246
|
+
export { IconButton as I };
|
|
247
|
+
//# sourceMappingURL=icon-button-CK1ZuE-2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-button-CK1ZuE-2.js","sources":["../../src/button/icon-button/icon-button.ts"],"sourcesContent":["import { html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport styles from '../button/button.scss';\nimport colorStyles from '../button/button-colors.scss';\nimport sizeStyles from './icon-button-sizes.scss';\nimport { spread } from '@/__directive/spread.js';\nimport { throttle } from '@/__utils/throttle.js';\nimport { BaseButton } from '../BaseButton.js';\n\n/**\n * @label Icon Button\n * @tag wc-icon-button\n * @rawTag icon-button\n *\n * @summary Icon buttons allow users to take actions, and make choices, with a single tap.\n *\n * @overview\n * <p>Icon buttons are clickable elements that are used to trigger actions. They communicate calls to action to the user and allow users to interact with pages in a variety of ways. IconButton labels express what action will occur when the user interacts with it.</p>\n *\n * @cssprop --button-container-shape: Defines the border radius of the button container shape.\n *\n * @cssprop --button-container-shape-start-start: Defines the start position of the button container shape.\n * @cssprop --button-container-shape-start-end: Defines the end position of the button container shape.\n * @cssprop --button-container-shape-end-start: Defines the start position of the button container shape.\n * @cssprop --button-container-shape-end-end: Defines the end position of the button container shape.\n *\n *\n * @cssprop --filled-button-container-color: Color of the filled button container.\n * @cssprop --filled-button-label-text-color: Text color of the filled button label.\n *\n * @cssprop --outlined-button-container-color: Color of the outlined button container.\n * @cssprop --outlined-button-label-text-color: Text color of the outlined button label.\n *\n * @cssprop --text-button-label-text-color: Text color of the text button label.\n *\n * @cssprop --tonal-button-container-color: Color of the tonal button container.\n * @cssprop --tonal-button-label-text-color: Text color of the tonal button label.\n *\n * @cssprop --elevated-button-container-color: Color of the elevated button container.\n * @cssprop --elevated-button-label-text-color: Text color of the elevated button label.\n *\n * @cssprop --neo-button-container-color: Color of the neo button container.\n * @cssprop --neo-button-label-text-color: Text color of the neo button label.\n *\n * @fires {CustomEvent} button:click - Dispatched when the button is clicked.\n *\n * @example\n * ```html\n * <wc-icon-button><wc-icon name=\"home\"></wc-icon></wc-icon-button>\n * ```\n * @tags display\n */\nexport class IconButton extends BaseButton {\n static override styles = [styles, colorStyles, sizeStyles];\n\n /**\n * Button size.\n * Possible values are `\"xs\"`, `\"sm\"`, `\"md\"`, `\"lg\"`, `\"xl\"`. Defaults to `\"sm\"`.\n */\n @property({ reflect: true }) size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = 'sm';\n\n /**\n * Type is preset of color and variant. Type will be only applied.\n *\n */\n @property({ type: String }) type?: 'primary' | 'secondary' | 'tertiary';\n \n /**\n * The visual style of the button.\n *\n * Possible variant values:\n * `\"filled\"` is a filled button.\n * `\"outlined\"` is an outlined button.\n * `\"text\"` is a transparent button.\n * `\"tonal\"` is a light color button.\n * `\"elevated\"` is elevated button\n */\n @property() variant:\n | 'elevated'\n | 'filled'\n | 'tonal'\n | 'outlined'\n | 'text'\n | 'neo' = 'filled';\n \n /**\n * Defines the primary color of the button. This can be set to predefined color names to apply specific color themes.\n */\n @property({ reflect: true }) color:\n | 'primary'\n | 'success'\n | 'danger'\n | 'warning'\n | 'surface'\n | 'on-surface' = 'primary';\n\n /**\n * Additional ARIA attributes to pass to the inner button/anchor element.\n */\n @property({ reflect: true })\n configAria?: { [key: string]: any };\n\n override focus() {\n this.buttonElement?.focus();\n }\n\n override blur() {\n this.buttonElement?.blur();\n }\n \n override firstUpdated() {\n this.__dispatchClickWithThrottle = throttle(\n this.__dispatchClick,\n this.throttleDelay,\n );\n this.__convertTypeToVariantAndColor();\n }\n\n __convertTypeToVariantAndColor() {\n if (this.type === 'primary') {\n this.color = 'primary';\n this.variant = 'filled';\n } else if (this.type === 'secondary') {\n this.color = 'surface';\n this.variant = 'filled';\n } else if (this.type === 'tertiary') {\n this.color = 'primary';\n this.variant = 'text';\n } else if (this.type === 'danger') {\n this.color = 'danger';\n this.variant = 'filled';\n }\n }\n\n override render() {\n const isLink = this.__isLink();\n\n const cssClasses = {\n button: true,\n 'button-element': true,\n [`size-${this.size}`]: true,\n [`variant-${this.variant}`]: true,\n [`color-${this.color}`]: true,\n disabled: this.disabled || this.softDisabled,\n pressed: this.isPressed,\n skeleton: this.skeleton,\n };\n\n if (!isLink) {\n return html`<button\n class=${classMap(cssClasses)}\n id=\"button\"\n type=${this.htmlType}\n @click=${this.__dispatchClickWithThrottle}\n @mousedown=${this.__handlePress}\n @keydown=${this.__handlePress}\n @keyup=${this.__handlePress}\n \n aria-describedby=${ifDefined(this.softDisabled ? BaseButton.DISABLED_REASON_ID : undefined)}\n ?aria-disabled=${this.softDisabled}\n\n ?disabled=${this.disabled}\n ${spread(this.configAria)}\n >\n ${this.renderButtonContent()}\n </button>\n ${this.__renderTooltip()}`;\n }\n return html`<a\n class=${classMap(cssClasses)}\n id=\"button\"\n href=${this.href}\n target=${this.target}\n tabindex=${this.disabled ? '-1' : '0'}\n @click=${this.__dispatchClick}\n @mousedown=${this.__handlePress}\n @keydown=${this.__handlePress}\n @keyup=${this.__handlePress}\n role=\"button\"\n \n aria-describedby=${ifDefined(this.softDisabled ? BaseButton.DISABLED_REASON_ID : undefined)}\n ?aria-disabled=${this.softDisabled}\n\n ${spread(this.configAria)}\n >\n ${this.renderButtonContent()}\n </a>\n ${this.__renderTooltip()}`;\n }\n\n renderButtonContent() {\n return html`\n <wc-focus-ring class=\"focus-ring\" for='button'></wc-focus-ring>\n <wc-elevation class=\"elevation\"></wc-elevation>\n <div class=\"neo-background\"></div>\n <div class=\"background\"></div>\n <div class=\"outline\"></div>\n <wc-ripple class=\"ripple\"></wc-ripple>\n <wc-skeleton class=\"skeleton\"></wc-skeleton>\n\n <div class=\"button-content\">\n <slot></slot>\n </div>\n\n ${this.__renderDisabledReason(this.softDisabled)}\n `;\n }\n}\n"],"names":["html","classMap","ifDefined","styles","colorStyles","sizeStyles","property"],"mappings":"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"}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { F as FlowDesigner, I as Icon } from './flow-designer-DvTUrDp5.js';
|
|
2
|
+
export { A as Accordion, a as Avatar, B as Badge, b as Breadcrumb, c as BreadcrumbItem, C as Checkbox, d as Chip, e as CircularProgress, f as Container, D as DatePicker, g as Divider, E as Elevation, h as EmptyState, F as Field, i as FocusRing, I as Image, j as Input, L as LinearProgress, k as Link, l as List, m as ListItem, M as Menu, n as MenuItem, N as NavigationRail, o as NavigationRailItem, p as NumberField, P as Pagination, R as Radio, q as Ripple, S as SegmentedButton, r as SegmentedButtonGroup, s as Select, t as SelectOptionElement, u as SidebarMenu, v as SidebarMenuItem, w as SidebarSubMenu, x as Skeleton, y as Slider, z as Snackbar, G as Spinner, H as SubMenu, J as Svg, K as Switch, T as Tab, O as TabGroup, Q as TabPanel, U as Table, V as Tabs, W as Tag, X as Textarea, Y as TimePicker, Z as Tooltip, _ as UrlField } from './navigation-rail-DTTkqohi.js';
|
|
2
3
|
export { Clock } from './clock.js';
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
4
|
+
export { Button } from './button.js';
|
|
5
|
+
export { ButtonGroup } from './button-group.js';
|
|
6
|
+
export { I as IconButton } from './icon-button-CK1ZuE-2.js';
|
|
5
7
|
export { Fab } from './fab.js';
|
|
8
|
+
export { SplitButton } from './split-button.js';
|
|
9
|
+
export { DropdownButton } from './dropdown-button.js';
|
|
6
10
|
export { NumberCounter } from './number-counter.js';
|
|
11
|
+
export { P as Popover } from './popover-NC7b1lTq.js';
|
|
12
|
+
export { PopoverContent } from './popover-content.js';
|
|
7
13
|
export { CodeHighlighter } from './code-highlighter.js';
|
|
8
14
|
export { default as CodeEditor } from './code-editor.js';
|
|
15
|
+
export { HtmlEditor } from './html-editor.js';
|
|
9
16
|
export { ChartDoughnut } from './chart-doughnut.js';
|
|
10
17
|
export { ChartPie } from './chart-pie.js';
|
|
11
18
|
export { ChartBar } from './chart-bar.js';
|
|
@@ -14,25 +21,41 @@ export { Card } from './card.js';
|
|
|
14
21
|
import './card-content.js';
|
|
15
22
|
export { Banner } from './banner.js';
|
|
16
23
|
export { Notification } from './notification.js';
|
|
24
|
+
export { NotificationManager } from './notification-manager.js';
|
|
25
|
+
export { Modal } from './modal.js';
|
|
17
26
|
export { BottomSheet } from './bottom-sheet.js';
|
|
18
27
|
export { SideSheet } from './side-sheet.js';
|
|
19
28
|
export { Search } from './search.js';
|
|
20
29
|
export { Toolbar } from './toolbar.js';
|
|
30
|
+
export { Calendar } from './calendar.js';
|
|
31
|
+
export { CalendarColumnView } from './calendar-column-view.js';
|
|
32
|
+
export { CalendarMonthView } from './calendar-month-view.js';
|
|
33
|
+
export { Canvas } from './canvas.js';
|
|
34
|
+
export { F as FlowDesignerNode } from './flow-designer-node-BWrPuxAR.js';
|
|
35
|
+
export { ConditionBuilder } from './condition-builder.js';
|
|
36
|
+
export { CbPredicate } from './cb-predicate.js';
|
|
37
|
+
export { CbCompoundExpression } from './cb-compound-expression.js';
|
|
38
|
+
export { CbExpression } from './cb-expression.js';
|
|
39
|
+
export { CbDivider } from './cb-divider.js';
|
|
21
40
|
import './IndividualComponent-DUINtMGK.js';
|
|
22
41
|
import './property-1psGvXOq.js';
|
|
23
42
|
import './state-DwbEjqVk.js';
|
|
43
|
+
import './query-QBcUV-L_.js';
|
|
24
44
|
import './directive-ZPhl09Yt.js';
|
|
25
45
|
import './unsafe-html-BsGUjx94.js';
|
|
26
46
|
import './class-map-YU7g0o3B.js';
|
|
27
47
|
import './observe-slot-change-BGJfgg2E.js';
|
|
28
|
-
import './query-QBcUV-L_.js';
|
|
29
48
|
import './BaseHyperlinkMixin-BNuwbiEf.js';
|
|
30
49
|
import './style-map-DVmWOuYy.js';
|
|
31
50
|
import './dispatch-event-utils-CuEqjlPT.js';
|
|
32
|
-
import './BaseButton-
|
|
33
|
-
import './
|
|
51
|
+
import './BaseButton-BNFAYn-S.js';
|
|
52
|
+
import './BaseInput-14YmcfK7.js';
|
|
53
|
+
import './is-dark-mode-DOcaw4Yq.js';
|
|
54
|
+
import './button-colors-Ccys3hvS.js';
|
|
34
55
|
import './transform-DSwFSqzD.js';
|
|
35
56
|
import './pie-Dz0IDiPt.js';
|
|
36
57
|
import './array-D5vjT2Xm.js';
|
|
37
58
|
import './chart-bar-cn6rrna-.js';
|
|
59
|
+
import './calendar-event-BrQ_SEKD.js';
|
|
60
|
+
import './event-manager-D-QCmUgR.js';
|
|
38
61
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,28 +1,3 @@
|
|
|
1
|
-
import { _ as __decorate, i } from './IndividualComponent-DUINtMGK.js';
|
|
2
|
-
import { n } from './property-1psGvXOq.js';
|
|
3
|
-
|
|
4
|
-
class BaseInput extends i {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.disabled = false;
|
|
8
|
-
this.readonly = false;
|
|
9
|
-
this.required = false;
|
|
10
|
-
this.skeleton = false;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
__decorate([
|
|
14
|
-
n({ type: Boolean, reflect: true })
|
|
15
|
-
], BaseInput.prototype, "disabled", void 0);
|
|
16
|
-
__decorate([
|
|
17
|
-
n({ type: Boolean, reflect: true })
|
|
18
|
-
], BaseInput.prototype, "readonly", void 0);
|
|
19
|
-
__decorate([
|
|
20
|
-
n({ type: Boolean, reflect: true })
|
|
21
|
-
], BaseInput.prototype, "required", void 0);
|
|
22
|
-
__decorate([
|
|
23
|
-
n({ type: Boolean, reflect: true })
|
|
24
|
-
], BaseInput.prototype, "skeleton", void 0);
|
|
25
|
-
|
|
26
1
|
const observeThemeChange = (() => {
|
|
27
2
|
const callbacks = new Set();
|
|
28
3
|
const observer = new MutationObserver((records) => {
|
|
@@ -52,5 +27,5 @@ function isDarkMode() {
|
|
|
52
27
|
return document.documentElement.dataset.theme === 'dark';
|
|
53
28
|
}
|
|
54
29
|
|
|
55
|
-
export {
|
|
56
|
-
//# sourceMappingURL=is-dark-mode-
|
|
30
|
+
export { isDarkMode as i, observeThemeChange as o };
|
|
31
|
+
//# sourceMappingURL=is-dark-mode-DOcaw4Yq.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-dark-mode-DOcaw4Yq.js","sources":["../../src/__utils/observe-theme-change.ts","../../src/__utils/is-dark-mode.ts"],"sourcesContent":["type ThemeChangeCallback = () => void;\n\nexport const observeThemeChange = (() => {\n const callbacks = new Set<ThemeChangeCallback>();\n\n const observer = new MutationObserver((records) => {\n const changed = records.some(\n (r) => r.type === \"attributes\" && r.attributeName === \"data-theme\"\n );\n if (!changed) return;\n\n for (const callback of callbacks) {\n try {\n callback();\n } catch (err) {\n console.error(\"[observeThemeChange] callback threw:\", err);\n }\n }\n });\n\n observer.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [\"data-theme\"],\n });\n\n return (callback: ThemeChangeCallback): (() => void) => {\n callbacks.add(callback);\n return () => callbacks.delete(callback);\n };\n})();","export function isDarkMode() {\n return document.documentElement.dataset.theme === 'dark';\n}"],"names":[],"mappings":"AAEO,MAAM,kBAAkB,GAAG,CAAC,MAAK;AACtC,IAAA,MAAM,SAAS,GAAG,IAAI,GAAG,EAAuB;IAEhD,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,CAAC,OAAO,KAAI;QAChD,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAC1B,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,YAAY,IAAI,CAAC,CAAC,aAAa,KAAK,YAAY,CACnE;AACD,QAAA,IAAI,CAAC,OAAO;YAAE;AAEd,QAAA,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;AAChC,YAAA,IAAI;AACF,gBAAA,QAAQ,EAAE;YACZ;YAAE,OAAO,GAAG,EAAE;AACZ,gBAAA,OAAO,CAAC,KAAK,CAAC,sCAAsC,EAAE,GAAG,CAAC;YAC5D;QACF;AACF,IAAA,CAAC,CAAC;AAEF,IAAA,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,eAAe,EAAE;AACzC,QAAA,UAAU,EAAE,IAAI;QAChB,eAAe,EAAE,CAAC,YAAY,CAAC;AAChC,KAAA,CAAC;IAEF,OAAO,CAAC,QAA6B,KAAkB;AACrD,QAAA,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC;QACvB,OAAO,MAAM,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC;AACzC,IAAA,CAAC;AACH,CAAC;;SC7Be,UAAU,GAAA;IACxB,OAAO,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,KAAK,KAAK,MAAM;AAC1D;;;;"}
|