@nuralyui/button 0.0.12 → 0.0.14
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/button.component.d.ts +57 -0
- package/button.component.d.ts.map +1 -0
- package/button.component.js +228 -0
- package/button.component.js.map +1 -0
- package/{nr-button.style.d.ts → button.style.d.ts} +1 -1
- package/button.style.d.ts.map +1 -0
- package/{nr-button.style.js → button.style.js} +180 -2
- package/button.style.js.map +1 -0
- package/{nr-button.style.variables.d.ts → button.style.variables.d.ts} +1 -1
- package/button.style.variables.d.ts.map +1 -0
- package/{nr-button.style.variables.js → button.style.variables.js} +1 -1
- package/button.style.variables.js.map +1 -0
- package/{nr-button.types.d.ts → button.types.d.ts} +9 -2
- package/button.types.d.ts.map +1 -0
- package/button.types.js +2 -0
- package/button.types.js.map +1 -0
- package/demo/{nr-buttons-demo.d.ts → buttons-demo.d.ts} +2 -2
- package/demo/buttons-demo.d.ts.map +1 -0
- package/demo/{nr-buttons-demo.js → buttons-demo.js} +64 -2
- package/demo/buttons-demo.js.map +1 -0
- package/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/mixins/index.d.ts +14 -0
- package/mixins/index.d.ts.map +1 -0
- package/mixins/index.js +10 -0
- package/mixins/index.js.map +1 -0
- package/mixins/keyboard-mixin.d.ts +52 -0
- package/mixins/keyboard-mixin.d.ts.map +1 -0
- package/mixins/keyboard-mixin.js +78 -0
- package/mixins/keyboard-mixin.js.map +1 -0
- package/mixins/link-mixin.d.ts +67 -0
- package/mixins/link-mixin.d.ts.map +1 -0
- package/mixins/link-mixin.js +87 -0
- package/mixins/link-mixin.js.map +1 -0
- package/mixins/ripple-mixin.d.ts +53 -0
- package/mixins/ripple-mixin.d.ts.map +1 -0
- package/mixins/ripple-mixin.js +77 -0
- package/mixins/ripple-mixin.js.map +1 -0
- package/package.json +1 -1
- package/react.d.ts +1 -1
- package/react.d.ts.map +1 -1
- package/react.js +1 -1
- package/react.js.map +1 -1
- package/test/nr-button_test.d.ts +1 -1
- package/test/nr-button_test.d.ts.map +1 -1
- package/test/nr-button_test.js +2 -2
- package/test/nr-button_test.js.map +1 -1
- package/demo/nr-buttons-demo.d.ts.map +0 -1
- package/demo/nr-buttons-demo.js.map +0 -1
- package/nr-button.component.d.ts +0 -36
- package/nr-button.component.d.ts.map +0 -1
- package/nr-button.component.js +0 -99
- package/nr-button.component.js.map +0 -1
- package/nr-button.style.d.ts.map +0 -1
- package/nr-button.style.js.map +0 -1
- package/nr-button.style.variables.d.ts.map +0 -1
- package/nr-button.style.variables.js.map +0 -1
- package/nr-button.types.d.ts.map +0 -1
- package/nr-button.types.js +0 -2
- package/nr-button.types.js.map +0 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
import { LitElement } from 'lit';
|
|
7
|
+
import { ButtonType, ButtonShape, IconPosition } from './button.types.js';
|
|
8
|
+
declare const NrButtonElement_base: (new (...args: any[]) => import("./mixins/ripple-mixin.js").RippleCapable) & (new (...args: any[]) => import("./mixins/keyboard-mixin.js").KeyboardCapable) & (new (...args: any[]) => import("./mixins/link-mixin.js").LinkCapable) & (new (...args: any[]) => import("../../shared/dependency-mixin.js").DependencyAware) & (new (...args: any[]) => import("../../shared/theme-mixin.js").ThemeAware) & (new (...args: any[]) => import("../../shared/event-handler-mixin.js").EventHandlerCapable) & typeof LitElement;
|
|
9
|
+
/**
|
|
10
|
+
* - NuralyUIBaseMixin: Core functionality (theme, dependencies, events)
|
|
11
|
+
* - RippleMixin: Ripple effect handling
|
|
12
|
+
* - KeyboardMixin: Keyboard interaction (Enter/Space activation)
|
|
13
|
+
* - LinkMixin: Link-specific behavior for ButtonType.Link
|
|
14
|
+
*/
|
|
15
|
+
export declare class NrButtonElement extends NrButtonElement_base {
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
loading: boolean;
|
|
18
|
+
size: string;
|
|
19
|
+
type: ButtonType;
|
|
20
|
+
shape: ButtonShape;
|
|
21
|
+
block: boolean;
|
|
22
|
+
dashed: boolean;
|
|
23
|
+
icon: string[];
|
|
24
|
+
iconPosition: IconPosition;
|
|
25
|
+
href: string;
|
|
26
|
+
target: string;
|
|
27
|
+
ripple: boolean;
|
|
28
|
+
buttonAriaLabel: string;
|
|
29
|
+
ariaDescribedBy: string;
|
|
30
|
+
htmlType: string;
|
|
31
|
+
/**
|
|
32
|
+
* Required components that must be registered for this component to work properly
|
|
33
|
+
*/
|
|
34
|
+
requiredComponents: string[];
|
|
35
|
+
/**
|
|
36
|
+
* Check for required dependencies when component is connected to DOM
|
|
37
|
+
*/
|
|
38
|
+
connectedCallback(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Get common attributes for both button and anchor elements
|
|
41
|
+
*/
|
|
42
|
+
private getCommonAttributes;
|
|
43
|
+
/**
|
|
44
|
+
* Renders an icon if the hy-icon component is available
|
|
45
|
+
* @param iconName - The name of the icon to render
|
|
46
|
+
* @returns TemplateResult or nothing
|
|
47
|
+
*/
|
|
48
|
+
private renderIcon;
|
|
49
|
+
/**
|
|
50
|
+
* Handle comprehensive click events with proper event dispatching
|
|
51
|
+
*/
|
|
52
|
+
private handleClick;
|
|
53
|
+
render(): import("lit").TemplateResult<1>;
|
|
54
|
+
static styles: import("lit").CSSResult[];
|
|
55
|
+
}
|
|
56
|
+
export {};
|
|
57
|
+
//# sourceMappingURL=button.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.component.d.ts","sourceRoot":"","sources":["../../../src/components/button/button.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,UAAU,EAAW,MAAM,KAAK,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAgB,YAAY,EAAE,MAAM,mBAAmB,CAAC;;AAKxF;;;;;GAKG;AACH,qBACa,eAAgB,SAAQ,oBAMpC;IAGU,QAAQ,UAAS;IAG1B,OAAO,UAAS;IAGhB,IAAI,SAAgB;IAGX,IAAI,EAAE,UAAU,CAAsB;IAG/C,KAAK,EAAE,WAAW,CAAuB;IAGzC,KAAK,UAAS;IAGd,MAAM,UAAS;IAIf,IAAI,EAAE,MAAM,EAAE,CAAM;IAGpB,YAAY,eAAqB;IAIxB,IAAI,SAAgB;IAGpB,MAAM,SAAgB;IAItB,MAAM,UAAQ;IAIvB,eAAe,SAAgB;IAG/B,eAAe,SAAgB;IAG/B,QAAQ,SAAgB;IAExB;;OAEG;IACM,kBAAkB,WAAe;IAE1C;;OAEG;IACM,iBAAiB;IAK1B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAgB3B;;;;OAIG;IACH,OAAO,CAAC,UAAU;IAWlB;;OAEG;IACH,OAAO,CAAC,WAAW;IA4BV,MAAM;IA8Df,OAAgB,MAAM,4BAAU;CACjC"}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
7
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
9
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
10
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11
|
+
};
|
|
12
|
+
import { html, LitElement, nothing } from 'lit';
|
|
13
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
14
|
+
import { EMPTY_STRING } from './button.types.js';
|
|
15
|
+
import { styles } from './button.style.js';
|
|
16
|
+
import { NuralyUIBaseMixin } from '../../shared/base-mixin.js';
|
|
17
|
+
import { RippleMixin, KeyboardMixin, LinkMixin } from './mixins/index.js';
|
|
18
|
+
/**
|
|
19
|
+
* - NuralyUIBaseMixin: Core functionality (theme, dependencies, events)
|
|
20
|
+
* - RippleMixin: Ripple effect handling
|
|
21
|
+
* - KeyboardMixin: Keyboard interaction (Enter/Space activation)
|
|
22
|
+
* - LinkMixin: Link-specific behavior for ButtonType.Link
|
|
23
|
+
*/
|
|
24
|
+
let NrButtonElement = class NrButtonElement extends RippleMixin(KeyboardMixin(LinkMixin(NuralyUIBaseMixin(LitElement)))) {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(...arguments);
|
|
27
|
+
// Button state properties
|
|
28
|
+
this.disabled = false;
|
|
29
|
+
this.loading = false;
|
|
30
|
+
this.size = EMPTY_STRING;
|
|
31
|
+
this.type = "default" /* ButtonType.Default */;
|
|
32
|
+
this.shape = "default" /* ButtonShape.Default */;
|
|
33
|
+
this.block = false;
|
|
34
|
+
this.dashed = false;
|
|
35
|
+
// Icon properties
|
|
36
|
+
this.icon = [];
|
|
37
|
+
this.iconPosition = "left" /* IconPosition.Left */;
|
|
38
|
+
// Link properties (inherited from LinkMixin)
|
|
39
|
+
this.href = EMPTY_STRING;
|
|
40
|
+
this.target = EMPTY_STRING;
|
|
41
|
+
// Ripple property (inherited from RippleMixin)
|
|
42
|
+
this.ripple = true;
|
|
43
|
+
// Accessibility properties
|
|
44
|
+
this.buttonAriaLabel = EMPTY_STRING;
|
|
45
|
+
this.ariaDescribedBy = EMPTY_STRING;
|
|
46
|
+
this.htmlType = EMPTY_STRING;
|
|
47
|
+
/**
|
|
48
|
+
* Required components that must be registered for this component to work properly
|
|
49
|
+
*/
|
|
50
|
+
this.requiredComponents = ['hy-icon'];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Check for required dependencies when component is connected to DOM
|
|
54
|
+
*/
|
|
55
|
+
connectedCallback() {
|
|
56
|
+
super.connectedCallback();
|
|
57
|
+
this.validateDependencies();
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Get common attributes for both button and anchor elements
|
|
61
|
+
*/
|
|
62
|
+
getCommonAttributes() {
|
|
63
|
+
return {
|
|
64
|
+
'data-type': this.type,
|
|
65
|
+
'data-shape': this.shape,
|
|
66
|
+
'data-size': this.size || nothing,
|
|
67
|
+
'data-state': this.loading ? 'loading' : nothing,
|
|
68
|
+
'data-theme': this.currentTheme,
|
|
69
|
+
'data-block': this.block ? 'true' : nothing,
|
|
70
|
+
'class': this.dashed ? 'button-dashed' : '',
|
|
71
|
+
'aria-disabled': this.disabled ? 'true' : 'false',
|
|
72
|
+
'aria-label': this.buttonAriaLabel || nothing,
|
|
73
|
+
'aria-describedby': this.ariaDescribedBy || nothing,
|
|
74
|
+
'tabindex': this.disabled ? '-1' : '0'
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Renders an icon if the hy-icon component is available
|
|
79
|
+
* @param iconName - The name of the icon to render
|
|
80
|
+
* @returns TemplateResult or nothing
|
|
81
|
+
*/
|
|
82
|
+
renderIcon(iconName) {
|
|
83
|
+
if (!this.isComponentAvailable('hy-icon')) {
|
|
84
|
+
console.warn(`hy-icon component not found. Icon "${iconName}" will not be displayed. ` +
|
|
85
|
+
`Please import hy-icon component.`);
|
|
86
|
+
return nothing;
|
|
87
|
+
}
|
|
88
|
+
return html `<hy-icon name=${iconName}></hy-icon>`;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Handle comprehensive click events with proper event dispatching
|
|
92
|
+
*/
|
|
93
|
+
handleClick(event) {
|
|
94
|
+
if (this.disabled) {
|
|
95
|
+
event.preventDefault();
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
// Use RippleMixin method
|
|
99
|
+
this.handleRippleClick(event);
|
|
100
|
+
// Handle link navigation if it's a link type
|
|
101
|
+
if (this.isLinkType()) {
|
|
102
|
+
this.dispatchCustomEvent('link-navigation', {
|
|
103
|
+
href: this.href,
|
|
104
|
+
target: this.target,
|
|
105
|
+
timestamp: Date.now(),
|
|
106
|
+
originalEvent: event
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
// Dispatch button event with metadata using EventHandlerMixin
|
|
110
|
+
this.dispatchEventWithMetadata('button-clicked', {
|
|
111
|
+
type: this.type,
|
|
112
|
+
disabled: this.disabled,
|
|
113
|
+
loading: this.loading,
|
|
114
|
+
href: this.href || null
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
render() {
|
|
118
|
+
var _a, _b;
|
|
119
|
+
const elementTag = this.getElementTag(); // From LinkMixin
|
|
120
|
+
const commonAttributes = this.getCommonAttributes();
|
|
121
|
+
const linkAttributes = this.getLinkAttributes(); // From LinkMixin
|
|
122
|
+
const content = html `
|
|
123
|
+
<span id="container">
|
|
124
|
+
${((_a = this.icon) === null || _a === void 0 ? void 0 : _a.length) ? this.renderIcon(this.icon[0]) : nothing}
|
|
125
|
+
<slot id="slot"></slot>
|
|
126
|
+
${((_b = this.icon) === null || _b === void 0 ? void 0 : _b.length) === 2 ? this.renderIcon(this.icon[1]) : nothing}
|
|
127
|
+
</span>
|
|
128
|
+
`;
|
|
129
|
+
if (elementTag === 'a') {
|
|
130
|
+
return html `
|
|
131
|
+
<a
|
|
132
|
+
href="${linkAttributes.href}"
|
|
133
|
+
target="${linkAttributes.target || nothing}"
|
|
134
|
+
rel="${linkAttributes.rel || nothing}"
|
|
135
|
+
role="${linkAttributes.role}"
|
|
136
|
+
data-type="${commonAttributes['data-type']}"
|
|
137
|
+
data-shape="${commonAttributes['data-shape']}"
|
|
138
|
+
data-size="${commonAttributes['data-size']}"
|
|
139
|
+
data-state="${commonAttributes['data-state']}"
|
|
140
|
+
data-theme="${commonAttributes['data-theme']}"
|
|
141
|
+
data-block="${commonAttributes['data-block']}"
|
|
142
|
+
class="${commonAttributes.class}"
|
|
143
|
+
aria-disabled="${this.disabled}"
|
|
144
|
+
aria-label="${this.buttonAriaLabel || nothing}"
|
|
145
|
+
aria-describedby="${this.ariaDescribedBy || nothing}"
|
|
146
|
+
tabindex="${this.disabled ? -1 : 0}"
|
|
147
|
+
@click="${this.handleClick}"
|
|
148
|
+
@keydown="${this.handleKeydown}"
|
|
149
|
+
>
|
|
150
|
+
${content}
|
|
151
|
+
</a>
|
|
152
|
+
`;
|
|
153
|
+
}
|
|
154
|
+
return html `
|
|
155
|
+
<button
|
|
156
|
+
?disabled="${this.disabled}"
|
|
157
|
+
type="${(this.htmlType || 'button')}"
|
|
158
|
+
role="${linkAttributes.role}"
|
|
159
|
+
data-type="${commonAttributes['data-type']}"
|
|
160
|
+
data-shape="${commonAttributes['data-shape']}"
|
|
161
|
+
data-size="${commonAttributes['data-size']}"
|
|
162
|
+
data-state="${commonAttributes['data-state']}"
|
|
163
|
+
data-theme="${commonAttributes['data-theme']}"
|
|
164
|
+
data-block="${commonAttributes['data-block']}"
|
|
165
|
+
class="${commonAttributes.class}"
|
|
166
|
+
aria-disabled="${this.disabled}"
|
|
167
|
+
aria-label="${this.buttonAriaLabel || nothing}"
|
|
168
|
+
aria-describedby="${this.ariaDescribedBy || nothing}"
|
|
169
|
+
tabindex="${this.disabled ? -1 : 0}"
|
|
170
|
+
@click="${this.handleClick}"
|
|
171
|
+
@keydown="${this.handleKeydown}"
|
|
172
|
+
>
|
|
173
|
+
${content}
|
|
174
|
+
</button>
|
|
175
|
+
`;
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
NrButtonElement.styles = styles;
|
|
179
|
+
__decorate([
|
|
180
|
+
property({ type: Boolean })
|
|
181
|
+
], NrButtonElement.prototype, "disabled", void 0);
|
|
182
|
+
__decorate([
|
|
183
|
+
property({ type: Boolean })
|
|
184
|
+
], NrButtonElement.prototype, "loading", void 0);
|
|
185
|
+
__decorate([
|
|
186
|
+
property({ type: String })
|
|
187
|
+
], NrButtonElement.prototype, "size", void 0);
|
|
188
|
+
__decorate([
|
|
189
|
+
property({ type: String })
|
|
190
|
+
], NrButtonElement.prototype, "type", void 0);
|
|
191
|
+
__decorate([
|
|
192
|
+
property({ type: String })
|
|
193
|
+
], NrButtonElement.prototype, "shape", void 0);
|
|
194
|
+
__decorate([
|
|
195
|
+
property({ type: Boolean })
|
|
196
|
+
], NrButtonElement.prototype, "block", void 0);
|
|
197
|
+
__decorate([
|
|
198
|
+
property({ type: Boolean })
|
|
199
|
+
], NrButtonElement.prototype, "dashed", void 0);
|
|
200
|
+
__decorate([
|
|
201
|
+
property({ type: Array })
|
|
202
|
+
], NrButtonElement.prototype, "icon", void 0);
|
|
203
|
+
__decorate([
|
|
204
|
+
property({ reflect: true })
|
|
205
|
+
], NrButtonElement.prototype, "iconPosition", void 0);
|
|
206
|
+
__decorate([
|
|
207
|
+
property({ type: String })
|
|
208
|
+
], NrButtonElement.prototype, "href", void 0);
|
|
209
|
+
__decorate([
|
|
210
|
+
property({ type: String })
|
|
211
|
+
], NrButtonElement.prototype, "target", void 0);
|
|
212
|
+
__decorate([
|
|
213
|
+
property({ type: Boolean })
|
|
214
|
+
], NrButtonElement.prototype, "ripple", void 0);
|
|
215
|
+
__decorate([
|
|
216
|
+
property({ type: String })
|
|
217
|
+
], NrButtonElement.prototype, "buttonAriaLabel", void 0);
|
|
218
|
+
__decorate([
|
|
219
|
+
property({ type: String })
|
|
220
|
+
], NrButtonElement.prototype, "ariaDescribedBy", void 0);
|
|
221
|
+
__decorate([
|
|
222
|
+
property({ type: String })
|
|
223
|
+
], NrButtonElement.prototype, "htmlType", void 0);
|
|
224
|
+
NrButtonElement = __decorate([
|
|
225
|
+
customElement('nr-button')
|
|
226
|
+
], NrButtonElement);
|
|
227
|
+
export { NrButtonElement };
|
|
228
|
+
//# sourceMappingURL=button.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.component.js","sourceRoot":"","sources":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'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { ButtonType, ButtonShape, EMPTY_STRING, IconPosition } from './button.types.js';\nimport { styles } from './button.style.js';\nimport { NuralyUIBaseMixin } from '../../shared/base-mixin.js';\nimport { RippleMixin, KeyboardMixin, LinkMixin } from './mixins/index.js';\n\n/**\n * - NuralyUIBaseMixin: Core functionality (theme, dependencies, events)\n * - RippleMixin: Ripple effect handling\n * - KeyboardMixin: Keyboard interaction (Enter/Space activation)\n * - LinkMixin: Link-specific behavior for ButtonType.Link\n */\n@customElement('nr-button')\nexport class NrButtonElement extends RippleMixin(\n KeyboardMixin(\n LinkMixin(\n NuralyUIBaseMixin(LitElement)\n )\n )\n) {\n // Button state properties\n @property({ type: Boolean })\n override disabled = false;\n\n @property({ type: Boolean })\n loading = false;\n\n @property({ type: String })\n size = EMPTY_STRING;\n\n @property({ type: String })\n override type: ButtonType = ButtonType.Default;\n\n @property({ type: String })\n shape: ButtonShape = ButtonShape.Default;\n\n @property({ type: Boolean })\n block = false;\n\n @property({ type: Boolean })\n dashed = false;\n\n // Icon properties\n @property({ type: Array })\n icon: string[] = [];\n\n @property({ reflect: true })\n iconPosition = IconPosition.Left;\n\n // Link properties (inherited from LinkMixin)\n @property({ type: String })\n override href = EMPTY_STRING;\n\n @property({ type: String })\n override target = EMPTY_STRING;\n\n // Ripple property (inherited from RippleMixin)\n @property({ type: Boolean })\n override ripple = true;\n\n // Accessibility properties\n @property({ type: String })\n buttonAriaLabel = EMPTY_STRING;\n\n @property({ type: String })\n ariaDescribedBy = EMPTY_STRING;\n\n @property({ type: String })\n htmlType = EMPTY_STRING;\n\n /**\n * Required components that must be registered for this component to work properly\n */\n override requiredComponents = ['hy-icon'];\n\n /**\n * Check for required dependencies when component is connected to DOM\n */\n override connectedCallback() {\n super.connectedCallback();\n this.validateDependencies();\n }\n\n /**\n * Get common attributes for both button and anchor elements\n */\n private getCommonAttributes() {\n return {\n 'data-type': this.type,\n 'data-shape': this.shape,\n 'data-size': this.size || nothing,\n 'data-state': this.loading ? 'loading' : nothing,\n 'data-theme': this.currentTheme,\n 'data-block': this.block ? 'true' : nothing,\n 'class': this.dashed ? 'button-dashed' : '',\n 'aria-disabled': this.disabled ? 'true' : 'false',\n 'aria-label': this.buttonAriaLabel || nothing,\n 'aria-describedby': this.ariaDescribedBy || nothing,\n 'tabindex': this.disabled ? '-1' : '0'\n };\n }\n\n /**\n * Renders an icon if the hy-icon component is available\n * @param iconName - The name of the icon to render\n * @returns TemplateResult or nothing\n */\n private renderIcon(iconName: string) {\n if (!this.isComponentAvailable('hy-icon')) {\n console.warn(\n `hy-icon component not found. Icon \"${iconName}\" will not be displayed. ` +\n `Please import hy-icon component.`\n );\n return nothing;\n }\n return html`<hy-icon name=${iconName}></hy-icon>`;\n }\n\n /**\n * Handle comprehensive click events with proper event dispatching\n */\n private handleClick(event: MouseEvent) {\n if (this.disabled) {\n event.preventDefault();\n return;\n }\n\n // Use RippleMixin method\n this.handleRippleClick(event);\n \n // Handle link navigation if it's a link type\n if (this.isLinkType()) {\n this.dispatchCustomEvent('link-navigation', {\n href: this.href,\n target: this.target,\n timestamp: Date.now(),\n originalEvent: event\n });\n }\n \n // Dispatch button event with metadata using EventHandlerMixin\n this.dispatchEventWithMetadata('button-clicked', {\n type: this.type,\n disabled: this.disabled,\n loading: this.loading,\n href: this.href || null\n });\n }\n\n override render() {\n const elementTag = this.getElementTag(); // From LinkMixin\n const commonAttributes = this.getCommonAttributes();\n const linkAttributes = this.getLinkAttributes(); // From LinkMixin\n \n const content = html`\n <span id=\"container\">\n ${this.icon?.length ? this.renderIcon(this.icon[0]) : nothing}\n <slot id=\"slot\"></slot>\n ${this.icon?.length === 2 ? this.renderIcon(this.icon[1]) : nothing}\n </span>\n `;\n \n if (elementTag === 'a') {\n return html`\n <a\n href=\"${linkAttributes.href}\"\n target=\"${linkAttributes.target || nothing}\"\n rel=\"${linkAttributes.rel || nothing}\"\n role=\"${linkAttributes.role}\"\n data-type=\"${commonAttributes['data-type']}\"\n data-shape=\"${commonAttributes['data-shape']}\"\n data-size=\"${commonAttributes['data-size']}\"\n data-state=\"${commonAttributes['data-state']}\"\n data-theme=\"${commonAttributes['data-theme']}\"\n data-block=\"${commonAttributes['data-block']}\"\n class=\"${commonAttributes.class}\"\n aria-disabled=\"${this.disabled}\"\n aria-label=\"${this.buttonAriaLabel || nothing}\"\n aria-describedby=\"${this.ariaDescribedBy || nothing}\"\n tabindex=\"${this.disabled ? -1 : 0}\"\n @click=\"${this.handleClick}\"\n @keydown=\"${this.handleKeydown}\"\n >\n ${content}\n </a>\n `;\n }\n \n return html`\n <button\n ?disabled=\"${this.disabled}\"\n type=\"${(this.htmlType || 'button') as 'button' | 'submit' | 'reset'}\"\n role=\"${linkAttributes.role}\"\n data-type=\"${commonAttributes['data-type']}\"\n data-shape=\"${commonAttributes['data-shape']}\"\n data-size=\"${commonAttributes['data-size']}\" \n data-state=\"${commonAttributes['data-state']}\"\n data-theme=\"${commonAttributes['data-theme']}\"\n data-block=\"${commonAttributes['data-block']}\"\n class=\"${commonAttributes.class}\"\n aria-disabled=\"${this.disabled}\"\n aria-label=\"${this.buttonAriaLabel || nothing}\"\n aria-describedby=\"${this.ariaDescribedBy || nothing}\"\n tabindex=\"${this.disabled ? -1 : 0}\"\n @click=\"${this.handleClick}\"\n @keydown=\"${this.handleKeydown}\"\n >\n ${content}\n </button>\n `;\n }\n static override styles = styles;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.style.d.ts","sourceRoot":"","sources":["../../../src/components/button/button.style.ts"],"names":[],"mappings":"AA4mBA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,MAAM,2BAAkC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
import { buttonVariables } from './
|
|
2
|
+
import { buttonVariables } from './button.style.variables.js';
|
|
3
3
|
/**
|
|
4
4
|
* Button component styles for the Hybrid UI Library
|
|
5
5
|
*
|
|
@@ -82,6 +82,10 @@ const buttonStyles = css `
|
|
|
82
82
|
padding-right: var(--hybrid-button-padding-x,var(--hybrid-button-local-padding-x));
|
|
83
83
|
padding-left: var(--hybrid-button-padding-x,var(--hybrid-button-local-padding-x));
|
|
84
84
|
font-size: var(--hybrid-button-font-size,var(--hybrid-button-local-font-size));
|
|
85
|
+
|
|
86
|
+
/* Positioning for ripple effect */
|
|
87
|
+
position: relative;
|
|
88
|
+
overflow: hidden;
|
|
85
89
|
}
|
|
86
90
|
|
|
87
91
|
/* Icon styling within button - inherits text color and size */
|
|
@@ -359,6 +363,113 @@ const buttonStyles = css `
|
|
|
359
363
|
border-style: dashed;
|
|
360
364
|
}
|
|
361
365
|
|
|
366
|
+
/* ========================================
|
|
367
|
+
* NEW BUTTON TYPES
|
|
368
|
+
* ======================================== */
|
|
369
|
+
|
|
370
|
+
/* TEXT BUTTON VARIANT */
|
|
371
|
+
button[data-type='text'] {
|
|
372
|
+
background-color: var(--hybrid-button-text-background-color, var(--hybrid-button-local-text-background-color, transparent));
|
|
373
|
+
color: var(--hybrid-button-text-text-color, var(--hybrid-button-local-text-text-color, #1890ff));
|
|
374
|
+
border: none;
|
|
375
|
+
box-shadow: none;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
button[data-type='text'] hy-icon {
|
|
379
|
+
--hybrid-icon-color: var(--hybrid-button-text-text-color, var(--hybrid-button-local-text-text-color, #1890ff));
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
button[data-type='text']:hover:not(:disabled) {
|
|
383
|
+
background-color: var(--hybrid-button-text-hover-background-color, var(--hybrid-button-local-text-hover-background-color, rgba(24, 144, 255, 0.06)));
|
|
384
|
+
color: var(--hybrid-button-text-hover-text-color, var(--hybrid-button-local-text-hover-text-color, #40a9ff));
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
button[data-type='text']:hover:not(:disabled) hy-icon {
|
|
388
|
+
--hybrid-icon-color: var(--hybrid-button-text-hover-text-color, var(--hybrid-button-local-text-hover-text-color, #40a9ff));
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
button[data-type='text']:active:not(:disabled) {
|
|
392
|
+
background-color: var(--hybrid-button-text-active-background-color, var(--hybrid-button-local-text-active-background-color, rgba(24, 144, 255, 0.15)));
|
|
393
|
+
color: var(--hybrid-button-text-active-text-color, var(--hybrid-button-local-text-active-text-color, #096dd9));
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
button[data-type='text']:disabled {
|
|
397
|
+
background-color: transparent;
|
|
398
|
+
color: var(--hybrid-button-text-disabled-text-color, var(--hybrid-button-local-text-disabled-text-color, rgba(0, 0, 0, 0.25)));
|
|
399
|
+
border: none;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/* LINK BUTTON VARIANT */
|
|
403
|
+
a[data-type='link'], button[data-type='link'] {
|
|
404
|
+
background-color: transparent;
|
|
405
|
+
color: var(--hybrid-button-link-text-color, var(--hybrid-button-local-link-text-color, #1890ff));
|
|
406
|
+
border: none;
|
|
407
|
+
box-shadow: none;
|
|
408
|
+
text-decoration: underline;
|
|
409
|
+
cursor: pointer;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
a[data-type='link'] hy-icon, button[data-type='link'] hy-icon {
|
|
413
|
+
--hybrid-icon-color: var(--hybrid-button-link-text-color, var(--hybrid-button-local-link-text-color, #1890ff));
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
a[data-type='link']:hover, button[data-type='link']:hover:not(:disabled) {
|
|
417
|
+
color: var(--hybrid-button-link-hover-text-color, var(--hybrid-button-local-link-hover-text-color, #40a9ff));
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
a[data-type='link']:hover hy-icon, button[data-type='link']:hover:not(:disabled) hy-icon {
|
|
421
|
+
--hybrid-icon-color: var(--hybrid-button-link-hover-text-color, var(--hybrid-button-local-link-hover-text-color, #40a9ff));
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
a[data-type='link']:active, button[data-type='link']:active:not(:disabled) {
|
|
425
|
+
color: var(--hybrid-button-link-active-text-color, var(--hybrid-button-local-link-active-text-color, #096dd9));
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
button[data-type='link']:disabled {
|
|
429
|
+
color: var(--hybrid-button-link-disabled-text-color, var(--hybrid-button-local-link-disabled-text-color, rgba(0, 0, 0, 0.25)));
|
|
430
|
+
text-decoration: none;
|
|
431
|
+
cursor: not-allowed;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
/* ========================================
|
|
435
|
+
* SHAPE VARIANTS
|
|
436
|
+
* ======================================== */
|
|
437
|
+
|
|
438
|
+
/* Circle button shape */
|
|
439
|
+
button[data-shape='circle'], a[data-shape='circle'] {
|
|
440
|
+
border-radius: 50%;
|
|
441
|
+
width: var(--hybrid-button-circle-size, var(--hybrid-button-local-circle-size, 32px));
|
|
442
|
+
height: var(--hybrid-button-circle-size, var(--hybrid-button-local-circle-size, 32px));
|
|
443
|
+
padding: 0;
|
|
444
|
+
display: inline-flex;
|
|
445
|
+
align-items: center;
|
|
446
|
+
justify-content: center;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
button[data-shape='circle'][data-size='small'], a[data-shape='circle'][data-size='small'] {
|
|
450
|
+
width: var(--hybrid-button-circle-size-small, var(--hybrid-button-local-circle-size-small, 24px));
|
|
451
|
+
height: var(--hybrid-button-circle-size-small, var(--hybrid-button-local-circle-size-small, 24px));
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
button[data-shape='circle'][data-size='large'], a[data-shape='circle'][data-size='large'] {
|
|
455
|
+
width: var(--hybrid-button-circle-size-large, var(--hybrid-button-local-circle-size-large, 40px));
|
|
456
|
+
height: var(--hybrid-button-circle-size-large, var(--hybrid-button-local-circle-size-large, 40px));
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/* Round button shape */
|
|
460
|
+
button[data-shape='round'], a[data-shape='round'] {
|
|
461
|
+
border-radius: var(--hybrid-button-round-border-radius, var(--hybrid-button-local-round-border-radius, 16px));
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/* ========================================
|
|
465
|
+
* BLOCK BUTTON
|
|
466
|
+
* ======================================== */
|
|
467
|
+
|
|
468
|
+
button[data-block='true'], a[data-block='true'] {
|
|
469
|
+
width: 100%;
|
|
470
|
+
display: block;
|
|
471
|
+
}
|
|
472
|
+
|
|
362
473
|
/* ========================================
|
|
363
474
|
* VARIANT STYLES
|
|
364
475
|
* ======================================== */
|
|
@@ -436,6 +547,73 @@ const buttonStyles = css `
|
|
|
436
547
|
--hybrid-button-local-danger-disabled-text-color: #8d8d8d;
|
|
437
548
|
--hybrid-button-local-danger-disabled-border-color: #6f6f6f;
|
|
438
549
|
--hybrid-button-local-danger-dashed-border-color: #ffffff;
|
|
550
|
+
|
|
551
|
+
/* Text button dark theme overrides */
|
|
552
|
+
--hybrid-button-local-text-background-color: transparent;
|
|
553
|
+
--hybrid-button-local-text-text-color: #ffffff;
|
|
554
|
+
--hybrid-button-local-text-border-color: transparent;
|
|
555
|
+
--hybrid-button-local-text-hover-background-color: rgba(255, 255, 255, 0.1);
|
|
556
|
+
--hybrid-button-local-text-hover-text-color: #ffffff;
|
|
557
|
+
--hybrid-button-local-text-hover-border-color: transparent;
|
|
558
|
+
--hybrid-button-local-text-active-background-color: rgba(255, 255, 255, 0.15);
|
|
559
|
+
--hybrid-button-local-text-active-text-color: #ffffff;
|
|
560
|
+
--hybrid-button-local-text-active-border-color: transparent;
|
|
561
|
+
--hybrid-button-local-text-disabled-background-color: transparent;
|
|
562
|
+
--hybrid-button-local-text-disabled-text-color: #6f6f6f;
|
|
563
|
+
--hybrid-button-local-text-disabled-border-color: transparent;
|
|
564
|
+
|
|
565
|
+
/* Link button dark theme overrides */
|
|
566
|
+
--hybrid-button-local-link-background-color: transparent;
|
|
567
|
+
--hybrid-button-local-link-text-color: #78a9ff;
|
|
568
|
+
--hybrid-button-local-link-border-color: transparent;
|
|
569
|
+
--hybrid-button-local-link-hover-background-color: transparent;
|
|
570
|
+
--hybrid-button-local-link-hover-text-color: #a6c8ff;
|
|
571
|
+
--hybrid-button-local-link-hover-border-color: transparent;
|
|
572
|
+
--hybrid-button-local-link-active-background-color: transparent;
|
|
573
|
+
--hybrid-button-local-link-active-text-color: #a6c8ff;
|
|
574
|
+
--hybrid-button-local-link-active-border-color: transparent;
|
|
575
|
+
--hybrid-button-local-link-disabled-background-color: transparent;
|
|
576
|
+
--hybrid-button-local-link-disabled-text-color: #6f6f6f;
|
|
577
|
+
--hybrid-button-local-link-disabled-border-color: transparent;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
/* ========================================
|
|
581
|
+
* RIPPLE EFFECT STYLES
|
|
582
|
+
* ======================================== */
|
|
583
|
+
|
|
584
|
+
/* Ripple effect animation */
|
|
585
|
+
.ripple {
|
|
586
|
+
position: absolute;
|
|
587
|
+
border-radius: 50%;
|
|
588
|
+
background-color: rgba(255, 255, 255, 0.4);
|
|
589
|
+
transform: scale(0);
|
|
590
|
+
animation: ripple-animation 0.6s linear;
|
|
591
|
+
pointer-events: none;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
/* Darker ripple for light buttons */
|
|
595
|
+
button[data-type='default'] .ripple,
|
|
596
|
+
button[data-type='ghost'] .ripple {
|
|
597
|
+
background-color: rgba(0, 0, 0, 0.1);
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
/* Lighter ripple for dark buttons */
|
|
601
|
+
button[data-type='primary'] .ripple,
|
|
602
|
+
button[data-type='danger'] .ripple {
|
|
603
|
+
background-color: rgba(255, 255, 255, 0.3);
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
/* Ripple animation keyframes */
|
|
607
|
+
@keyframes ripple-animation {
|
|
608
|
+
to {
|
|
609
|
+
transform: scale(4);
|
|
610
|
+
opacity: 0;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
/* Disable ripple when component is disabled */
|
|
615
|
+
button:disabled .ripple {
|
|
616
|
+
display: none;
|
|
439
617
|
}
|
|
440
618
|
`;
|
|
441
619
|
/**
|
|
@@ -456,4 +634,4 @@ const buttonStyles = css `
|
|
|
456
634
|
* ```
|
|
457
635
|
*/
|
|
458
636
|
export const styles = [buttonStyles, buttonVariables];
|
|
459
|
-
//# sourceMappingURL=
|
|
637
|
+
//# sourceMappingURL=button.style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.style.js","sourceRoot":"","sources":["../../../src/components/button/button.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D;;;;;;;;;;;;;;GAcG;AACH,MAAM,YAAY,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwlBvB,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC","sourcesContent":["import { css } from 'lit';\nimport { buttonVariables } from './button.style.variables.js';\n\n/**\n * Button component styles for the Hybrid UI Library\n * \n * This file contains all the styling for the nr-button component, including:\n * - Base button styles with CSS custom properties for theming\n * - Multiple button variants (primary, secondary, ghost, danger)\n * - Size variations (small, large)\n * - State styles (hover, active, disabled, loading)\n * - Dark theme support\n * - Icon positioning and styling\n * - Responsive design considerations\n * \n * The styling system uses CSS custom properties with fallbacks to allow\n * for both global and local customization of button appearance.\n */\nconst buttonStyles = css`\n /* Container for button content and icon positioning */\n #container {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n }\n\n /* Icon positioned to the right of text when iconPosition='right' */\n :host([iconPosition='right']) #container {\n flex-direction: row-reverse;\n }\n\n /* Icon styling within button */\n hy-icon {\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 2px;\n }\n\n /* \n * Base button element styles\n * Uses CSS custom properties with fallbacks for comprehensive theming support\n * Properties follow the pattern: --hybrid-button-{property}, --hybrid-button-local-{property}\n */\n\n /* \n * Base button element styles\n * Uses CSS custom properties with fallbacks for comprehensive theming support\n * Properties follow the pattern: --hybrid-button-{property}, --hybrid-button-local-{property}\n */\n button {\n /* Dimensions */\n height: var(--hybrid-button-height,var(--hybrid-button-local-height));\n width: var(--hybrid-button-width,var(--hybrid-button-local-width));\n \n /* Border properties - individual sides for granular control */\n border-left: var(--hybrid-button-border-left,var(--hybrid-button-local-border-left));\n border-right: var(--hybrid-button-border-right,var(--hybrid-button-local-border-right));\n border-top: var(--hybrid-button-border-top,var(--hybrid-button-local-border-top));\n border-bottom: var(--hybrid-button-border-bottom,var(--hybrid-button-local-border-bottom));\n \n /* Border radius - individual corners for design flexibility */\n border-top-left-radius:var(--hybrid-button-border-top-left-radius,var(--hybrid-button-local-border-top-left-radius)) ;\n border-top-right-radius: var(--hybrid-button-border-top-right-radius,var(--hybrid-button-local-border-top-right-radius));\n border-bottom-left-radius: var(--hybrid-button-border-bottom-left-radius,var(--hybrid-button-local-border-bottom-left-radius));\n border-bottom-right-radius: var(--hybrid-button-border-bottom-right-radius,var(--hybrid-button-local-border-bottom-right-radius));\n \n /* Colors */\n background-color: var(--hybrid-button-background-color,var(--hybrid-button-local-background-color));\n color: var(--hybrid-button-text-color,var(--hybrid-button-local-text-color));\n \n /* Typography */\n font-size: var(--hybrid-button-font-size,var(--hybrid-button-local-font-size));\n font-weight: var(--hybrid-button-font-weight,var(--hybrid-button-local-font-weight));\n text-transform: var(--hybrid-button-text-transform,var(--hybrid-button-local-text-transform));\n \n /* Spacing */\n padding-top: var(--hybrid-button-padding-y,var(--hybrid-button-local-padding-y));\n margin-top: var(--hybrid-button-margin-y,var(--hybrid-button-local-margin-y));\n padding-bottom: var(--hybrid-button-padding-y,var(--hybrid-button-local-padding-y));\n padding-right: var(--hybrid-button-padding-x,var(--hybrid-button-local-padding-x));\n padding-left: var(--hybrid-button-padding-x,var(--hybrid-button-local-padding-x));\n font-size: var(--hybrid-button-font-size,var(--hybrid-button-local-font-size));\n\n /* Positioning for ripple effect */\n position: relative;\n overflow: hidden;\n }\n \n /* Icon styling within button - inherits text color and size */\n button hy-icon {\n --hybrid-icon-color: var(--hybrid-button-text-color,var(--hybrid-button-local-text-color));\n --hybrid-icon-width: var(--hybrid-button-icon-width,var(--hybrid-button-local-icon-width));\n --hybrid-icon-height: var(--hybrid-button-icon-height,var(--hybrid-button-local-icon-height));\n }\n\n /* \n * Hover state styles\n * Applied when button is hovered but not disabled\n */\n\n /* \n * Hover state styles\n * Applied when button is hovered but not disabled\n */\n button:hover:not(:disabled) {\n cursor: pointer;\n border-color: var(--hybrid-button-hover-border-color,var(--hybrid-button-local-hover-border-color));\n background-color: var(--hybrid-button-hover-background-color,var(--hybrid-button-local-hover-background-color));\n color: var(--hybrid-button-hover-color,var(--hybrid-button-local-hover-color));\n }\n \n /* Icon color on hover */\n button:hover:not(:disabled) hy-icon {\n --hybrid-icon-color: var(--hybrid-button-hover-color,var(--hybrid-button-local-hover-color));\n }\n\n /* \n * Active state styles\n * Applied when button is being clicked/pressed but not disabled\n */\n button:active:not(:disabled) {\n outline: none;\n border-color: var(--hybrid-button-active-border-color,var(--hybrid-button-local-active-border-color));\n color: var(--hybrid-button-active-color,var(--hybrid-button-local-active-color));\n }\n \n /* Icon color on active state */\n button:active:not(:disabled) hy-icon {\n --hybrid-icon-color: var(--hybrid-button-active-color,var(--hybrid-button-local-active-color));\n }\n\n /* \n * Disabled state styles\n * Applied when button is disabled - removes interactivity and applies muted colors\n */\n\n /* \n * Disabled state styles\n * Applied when button is disabled - removes interactivity and applies muted colors\n */\n button:disabled {\n cursor: auto;\n background-color: var(--hybrid-button-disabled-background-color,var(--hybrid-button-local-disabled-background-color));\n color: var(--hybrid-button-disabled-text-color,var(--hybrid-button-local-disabled-text-color));\n border-color: var(--hybrid-button-disabled-border-color,var(--hybrid-button-local-disabled-border-color));\n }\n\n /* ========================================\n * SIZE VARIATIONS\n * ======================================== */\n\n /* Small button size variant */\n\n /* Small button size variant */\n button[data-size='small'] {\n padding-top: var(--hybrid-small-button-padding-y,var(--hybrid-small-button-local-padding-y));\n padding-bottom: var(--hybrid-small-button-padding-y,var(--hybrid-small-button-local-padding-y));\n padding-right: var(--hybrid-small-button-padding-x,var(--hybrid-small-button-local-padding-x));\n padding-left: var(--hybrid-small-button-padding-x,var(--hybrid-small-button-local-padding-x));\n font-size: var(--hybrid-small-button-font-size,var(--hybrid-small-button-local-font-size));\n }\n\n /* Large button size variant */\n button[data-size='large'] {\n padding-top: var(--hybrid-large-button-padding-y,var(--hybrid-large-button-local-padding-y));\n padding-bottom: var(--hybrid-large-button-padding-y,var(--hybrid-large-button-local-padding-y));\n padding-right: var(--hybrid-large-button-padding-x,var(--hybrid-large-button-local-padding-x));\n padding-left: var(--hybrid-large-button-padding-x,var(--hybrid-large-button-local-padding-x));\n font-size: var(--hybrid-large-button-font-size,var(--hybrid-large-button-local-font-size));\n }\n\n /* ========================================\n * BUTTON STATES\n * ======================================== */\n\n /* Loading state - reduces opacity to indicate processing */\n button[data-state='loading'] {\n opacity: 0.5;\n }\n\n /* ========================================\n * BUTTON TYPE VARIANTS\n * ======================================== */\n\n /* DANGER BUTTON VARIANT */\n /* DANGER BUTTON VARIANT */\n \n /* Danger button base styles and icon */\n button[data-type='danger'] hy-icon {\n --hybrid-icon-color: var(--hybrid-button-danger-text-color,var(--hybrid-button-local-danger-text-color));\n }\n button[data-type='danger'] {\n border-color: var(--hybrid-button-danger-border-color,var(--hybrid-button-local-danger-border-color));\n background-color: var(--hybrid-button-danger-background-color,var(--hybrid-button-local-danger-background-color));\n color: var(--hybrid-button-danger-text-color,var(--hybrid-button-local-danger-text-color));\n }\n \n /* Danger button with dashed border variant */\n button[data-type='danger'].button-dashed {\n border-color: var(--hybrid-button-danger-dashed-border-color,var(--hybrid-button-local-danger-dashed-border-color));\n }\n \n /* Danger button disabled state */\n button[data-type='danger']:disabled {\n border-color: var(--hybrid-button-danger-disabled-border-color,var(--hybrid-button-local-danger-disabled-border-color));\n background-color: var(--hybrid-button-danger-disabled-background-color,var(--hybrid-button-local-danger-disabled-background-color));\n color: var(--hybrid-button-danger-disabled-text-color,var(--hybrid-button-local-danger-disabled-text-color));\n }\n\n /* Danger button hover state */\n button[data-type='danger']:hover:not(:disabled) {\n background-color: var(--hybrid-button-danger-hover-background-color,var(--hybrid-button-local-danger-hover-background-color));\n border-color: var(--hybrid-button-danger-hover-border-color,var(--hybrid-button-local-danger-hover-border-color));\n color: var(--hybrid-button-danger-text-color,var(--hybrid-button-local-danger-text-color));\n }\n button[data-type='danger']:hover:not(:disabled) hy-icon {\n --hybrid-icon-color: var(--hybrid-button-danger-text-color,var(--hybrid-button-local-danger-text-color));\n }\n\n /* Danger button active state */\n button[data-type='danger']:active:not(:disabled) {\n background-color: var(--hybrid-button-danger-active-background-color,var(--hybrid-button-local-danger-active-background-color));\n border-color: var(--hybrid-button-danger-active-border-color,var(--hybrid-button-local-danger-active-border-color));\n outline: var(--hybrid-button-danger-outline,var(--hybrid-button-local-danger-outline));\n outline-offset: var(--hybrid-button-danger-outline-offset,var(--hybrid-button-local-danger-outline-offset));\n }\n\n /* PRIMARY BUTTON VARIANT */\n /* PRIMARY BUTTON VARIANT */\n \n /* Primary button base styles and icon */\n button[data-type='primary'] hy-icon {\n --hybrid-icon-color: var(--hybrid-button-primary-text-color,var(--hybrid-button-local-primary-text-color));\n }\n button[data-type='primary'] {\n border-color: var(--hybrid-button-primary-border-color,var(--hybrid-button-local-primary-border-color));\n background-color: var(--hybrid-button-primary-background-color,var(--hybrid-button-local-primary-background-color));\n color: var(--hybrid-button-primary-text-color,var(--hybrid-button-local-primary-text-color));\n }\n \n /* Primary button with dashed border variant */\n button[data-type='primary'].button-dashed {\n border-color: var(--hybrid-button-primary-dashed-border-color,var(--hybrid-button-local-primary-dashed-border-color));\n }\n\n /* Primary button disabled state */\n button[data-type='primary']:disabled {\n border-color: var(--hybrid-button-primary-disabled-border-color,var(--hybrid-button-local-primary-disabled-border-color));\n background-color: var(--hybrid-button-primary-disabled-background-color,var(--hybrid-button-local-primary-disabled-background-color));\n color: var(--hybrid-button-primary-disabled-text-color,var(--hybrid-button-local-primary-disabled-text-color));\n }\n\n /* Primary button hover state */\n button[data-type='primary']:hover:not(:disabled) {\n background-color: var(--hybrid-button-primary-hover-background-color,var(--hybrid-button-local-primary-hover-background-color));\n border-color: var(--hybrid-button-primary-hover-border-color,var(--hybrid-button-local-primary-hover-border-color));\n color: var(--hybrid-button-primary-text-color,var(--hybrid-button-local-primary-text-color));\n }\n button[data-type='primary']:hover:not(:disabled) hy-icon {\n --hybrid-icon-color: var(--hybrid-button-primary-text-color,var(--hybrid-button-local-primary-text-color));\n }\n \n /* Primary button active state */\n button[data-type='primary']:active:not(:disabled) {\n border-color: var(--hybrid-button-primary-active-border-color,var(--hybrid-button-local-primary-active-border-color));\n background-color: var(--hybrid-button-primary-active-background-color,var(--hybrid-button-local-primary-active-background-color));\n outline: var(--hybrid-button-primary-outline,var(--hybrid-button-local-primary-outline));\n outline-offset: var(--hybrid-button-primary-outline-offset,var(--hybrid-button-local-primary-outline-offset));\n }\n\n /* GHOST BUTTON VARIANT */\n /* GHOST BUTTON VARIANT */\n \n /* Ghost button base styles and icon */\n button[data-type='ghost'] hy-icon {\n --hybrid-icon-color: var(--hybrid-button-ghost-text-color,var(--hybrid-button-local-ghost-text-color));\n }\n button[data-type='ghost'] {\n background-color: var(--hybrid-button-ghost-background-color,var(--hybrid-button-local-ghost-background-color));\n color: var(--hybrid-button-ghost-text-color,var(--hybrid-button-local-ghost-text-color));\n border-color: var(--hybrid-button-ghost-border-color,var(--hybrid-button-local-ghost-border-color));\n }\n \n /* Ghost button with dashed border variant */\n button[data-type='ghost'].button-dashed {\n border-color: var(--hybrid-button-ghost-dashed-border-color,var(--hybrid-button-local-ghost-dashed-border-color));\n }\n \n /* Ghost button disabled state */\n button[data-type='ghost']:disabled {\n background-color: var(--hybrid-button-ghost-disabled-background-color,var(--hybrid-button-local-ghost-disabled-background-color));\n color: var(--hybrid-button-ghost-disabled-text-color,var(--hybrid-button-local-ghost-disabled-text-color));\n border-color: var(--hybrid-button-ghost-disabled-border-color,var(--hybrid-button-local-ghost-disabled-border-color));\n }\n\n /* Ghost button hover state */\n button[data-type='ghost']:hover:not(:disabled) {\n background-color: var(--hybrid-button-ghost-hover-background-color,var(--hybrid-button-local-ghost-hover-background-color));\n color: var(--hybrid-button-ghost-hover-text-color,var(--hybrid-button-local-ghost-hover-text-color));\n border-color: var(--hybrid-button-local-ghost-hover-border-color,var(--hybrid-button-local-ghost-hover-border-color));\n }\n button[data-type='ghost']:hover:not(:disabled) hy-icon {\n --hybrid-icon-color: var(--hybrid-button-ghost-hover-text-color,var(--hybrid-button-local-ghost-hover-text-color));\n }\n \n /* Ghost button active state */\n button[data-type='ghost']:active:not(:disabled) {\n background-color: var(--hybrid-button-ghost-active-background-color,var(--hybrid-button-local-ghost-active-background-color));\n border-color: var(--hybrid-button-ghost-active-border-color,var(--hybrid-button-local-ghost-active-border-color));\n }\n\n /* SECONDARY BUTTON VARIANT */\n /* SECONDARY BUTTON VARIANT */\n \n /* Secondary button base styles and icon */\n button[data-type='secondary'] hy-icon {\n --hybrid-icon-color: var(--hybrid-button-secondary-text-color,var(--hybrid-button-local-secondary-text-color));\n }\n button[data-type='secondary'] {\n background-color: var(--hybrid-button-secondary-background-color,var(--hybrid-button-local-secondary-background-color));\n color: var(--hybrid-button-secondary-text-color,var(--hybrid-button-local-secondary-text-color));\n border-color: var(--hybrid-button-secondary-border-color,var(--hybrid-button-local-secondary-border-color));\n }\n \n /* Secondary button with dashed border variant */\n button[data-type='secondary'].button-dashed {\n border-color: var(--hybrid-button-secondary-dashed-border-color,var(--hybrid-button-local-secondary-dashed-border-color));\n }\n \n /* Secondary button disabled state */\n button[data-type='secondary']:disabled {\n background-color: var(--hybrid-button-secondary-disabled-background-color,var(--hybrid-button-local-secondary-disabled-background-color));\n color: var(--hybrid-button-secondary-disabled-text-color,var(--hybrid-button-local-secondary-disabled-text-color));\n border-color: var(--hybrid-button-secondary-disabled-border-color,var(--hybrid-button-local-secondary-disabled-border-color));\n }\n \n /* Secondary button hover state */\n button[data-type='secondary']:hover:not(:disabled) {\n background-color: var(--hybrid-button-secondary-hover-background-color,var(--hybrid-button-local-secondary-hover-background-color));\n color: var(--hybrid-button-secondary-text-color,var(--hybrid-button-local-secondary-text-color));\n border-color: var(--hybrid-button-secondary-hover-border-color,var(--hybrid-button-local-secondary-hover-border-color));\n }\n button[data-type='secondary']:hover:not(:disabled) hy-icon {\n --hybrid-icon-color: var(--hybrid-button-secondary-text-color,var(--hybrid-button-local-secondary-text-color));\n }\n\n /* Secondary button active state */\n button[data-type='secondary']:active:not(:disabled) {\n background-color: var(--hybrid-button-secondary-active-background-color,var(--hybrid-button-local-secondary-active-background-color));\n border-color: var(--hybrid-button-secondary-active-border-color,var(--hybrid-button-local-secondary-active-border-color));\n outline: var(--hybrid-button-secondary-outline,var(--hybrid-button-local-secondary-outline));\n outline-offset: var(--hybrid-button-secondary-outline-offset,var(--hybrid-button-local-secondary-outline-offset));\n }\n\n /* ========================================\n * UTILITY CLASSES\n * ======================================== */\n\n /* Dashed border style modifier */\n .button-dashed {\n border-style: dashed;\n }\n\n /* ========================================\n * NEW BUTTON TYPES\n * ======================================== */\n\n /* TEXT BUTTON VARIANT */\n button[data-type='text'] {\n background-color: var(--hybrid-button-text-background-color, var(--hybrid-button-local-text-background-color, transparent));\n color: var(--hybrid-button-text-text-color, var(--hybrid-button-local-text-text-color, #1890ff));\n border: none;\n box-shadow: none;\n }\n\n button[data-type='text'] hy-icon {\n --hybrid-icon-color: var(--hybrid-button-text-text-color, var(--hybrid-button-local-text-text-color, #1890ff));\n }\n\n button[data-type='text']:hover:not(:disabled) {\n background-color: var(--hybrid-button-text-hover-background-color, var(--hybrid-button-local-text-hover-background-color, rgba(24, 144, 255, 0.06)));\n color: var(--hybrid-button-text-hover-text-color, var(--hybrid-button-local-text-hover-text-color, #40a9ff));\n }\n\n button[data-type='text']:hover:not(:disabled) hy-icon {\n --hybrid-icon-color: var(--hybrid-button-text-hover-text-color, var(--hybrid-button-local-text-hover-text-color, #40a9ff));\n }\n\n button[data-type='text']:active:not(:disabled) {\n background-color: var(--hybrid-button-text-active-background-color, var(--hybrid-button-local-text-active-background-color, rgba(24, 144, 255, 0.15)));\n color: var(--hybrid-button-text-active-text-color, var(--hybrid-button-local-text-active-text-color, #096dd9));\n }\n\n button[data-type='text']:disabled {\n background-color: transparent;\n color: var(--hybrid-button-text-disabled-text-color, var(--hybrid-button-local-text-disabled-text-color, rgba(0, 0, 0, 0.25)));\n border: none;\n }\n\n /* LINK BUTTON VARIANT */\n a[data-type='link'], button[data-type='link'] {\n background-color: transparent;\n color: var(--hybrid-button-link-text-color, var(--hybrid-button-local-link-text-color, #1890ff));\n border: none;\n box-shadow: none;\n text-decoration: underline;\n cursor: pointer;\n }\n\n a[data-type='link'] hy-icon, button[data-type='link'] hy-icon {\n --hybrid-icon-color: var(--hybrid-button-link-text-color, var(--hybrid-button-local-link-text-color, #1890ff));\n }\n\n a[data-type='link']:hover, button[data-type='link']:hover:not(:disabled) {\n color: var(--hybrid-button-link-hover-text-color, var(--hybrid-button-local-link-hover-text-color, #40a9ff));\n }\n\n a[data-type='link']:hover hy-icon, button[data-type='link']:hover:not(:disabled) hy-icon {\n --hybrid-icon-color: var(--hybrid-button-link-hover-text-color, var(--hybrid-button-local-link-hover-text-color, #40a9ff));\n }\n\n a[data-type='link']:active, button[data-type='link']:active:not(:disabled) {\n color: var(--hybrid-button-link-active-text-color, var(--hybrid-button-local-link-active-text-color, #096dd9));\n }\n\n button[data-type='link']:disabled {\n color: var(--hybrid-button-link-disabled-text-color, var(--hybrid-button-local-link-disabled-text-color, rgba(0, 0, 0, 0.25)));\n text-decoration: none;\n cursor: not-allowed;\n }\n\n /* ========================================\n * SHAPE VARIANTS\n * ======================================== */\n\n /* Circle button shape */\n button[data-shape='circle'], a[data-shape='circle'] {\n border-radius: 50%;\n width: var(--hybrid-button-circle-size, var(--hybrid-button-local-circle-size, 32px));\n height: var(--hybrid-button-circle-size, var(--hybrid-button-local-circle-size, 32px));\n padding: 0;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n }\n\n button[data-shape='circle'][data-size='small'], a[data-shape='circle'][data-size='small'] {\n width: var(--hybrid-button-circle-size-small, var(--hybrid-button-local-circle-size-small, 24px));\n height: var(--hybrid-button-circle-size-small, var(--hybrid-button-local-circle-size-small, 24px));\n }\n\n button[data-shape='circle'][data-size='large'], a[data-shape='circle'][data-size='large'] {\n width: var(--hybrid-button-circle-size-large, var(--hybrid-button-local-circle-size-large, 40px));\n height: var(--hybrid-button-circle-size-large, var(--hybrid-button-local-circle-size-large, 40px));\n }\n\n /* Round button shape */\n button[data-shape='round'], a[data-shape='round'] {\n border-radius: var(--hybrid-button-round-border-radius, var(--hybrid-button-local-round-border-radius, 16px));\n }\n\n /* ========================================\n * BLOCK BUTTON\n * ======================================== */\n\n button[data-block='true'], a[data-block='true'] {\n width: 100%;\n display: block;\n }\n\n /* ========================================\n * VARIANT STYLES\n * ======================================== */\n\n /* Primary button variant */\n\n /* ========================================\n * DARK THEME OVERRIDES\n * ======================================== */\n \n /**\n * Dark theme styles using data-theme attribute on button element\n * These override the light theme defaults when data-theme=\"dark\" is applied\n */\n /**\n * Dark theme styles using data-theme attribute on button element\n * These override the light theme defaults when data-theme=\"dark\" is applied\n */\n button[data-theme=\"dark\"] {\n /* Default button dark theme overrides */\n --hybrid-button-local-background-color: #000000;\n --hybrid-button-local-text-color: #ffffff;\n --hybrid-button-local-hover-border-color: #6f6f6f;\n --hybrid-button-local-hover-color: #6f6f6f;\n --hybrid-button-local-active-border-color: #c6c6c6;\n --hybrid-button-local-active-color: #c6c6c6;\n --hybrid-button-local-disabled-background-color: #c6c6c6;\n\n /* Primary button dark theme overrides */\n --hybrid-button-local-primary-outline: 1px solid black;\n --hybrid-button-local-primary-outline-offset: -3px;\n --hybrid-button-local-primary-active-border-color: #ffffff;\n --hybrid-button-local-primary-disabled-text-color: #c6c6c6;\n --hybrid-button-local-primary-disabled-background-color: #8d8d8d;\n --hybrid-button-local-primary-disabled-border-color: #8d8d8d;\n\n /* Secondary button dark theme overrides */\n --hybrid-button-local-secondary-background-color: #6f6f6f;\n --hybrid-button-local-secondary-border-color: #6f6f6f;\n --hybrid-button-local-secondary-text-color: #ffffff;\n --hybrid-button-local-secondary-active-border-color: #ffffff;\n --hybrid-button-local-secondary-active-background-color: #6f6f6f;\n --hybrid-button-local-secondary-outline: 1px solid black;\n --hybrid-button-local-secondary-outline-offset: -3px;\n --hybrid-button-local-secondary-hover-background-color: #606060;\n --hybrid-button-local-secondary-hover-border-color: #606060;\n --hybrid-button-local-secondary-disabled-background-color: #6f6f6f;\n --hybrid-button-local-secondary-disabled-text-color: #8d8d8d;\n --hybrid-button-local-secondary-disabled-border-color: #6f6f6f;\n --hybrid-button-local-secondary-dashed-border-color: #ffffff;\n\n /* Ghost button dark theme overrides */\n --hybrid-button-local-ghost-background-color: transparent;\n --hybrid-button-local-ghost-text-color: #78a9ff;\n --hybrid-button-local-ghost-border-color: transparent;\n --hybrid-button-local-ghost-active-background-color: transparent;\n --hybrid-button-local-ghost-active-text-color: #a6c8ff;\n --hybrid-button-local-ghost-active-border-color: #ffffff;\n --hybrid-button-local-ghost-hover-background-color: #4c4c4c;\n --hybrid-button-local-ghost-hover-border-color: #4c4c4c;\n --hybrid-button-local-ghost-hover-text-color: #a6c8ff;\n --hybrid-button-local-ghost-disabled-background-color: transparent;\n --hybrid-button-local-ghost-disabled-text-color: #6f6f6f;\n --hybrid-button-local-ghost-disabled-border-color: transparent;\n --hybrid-button-local-ghost-dashed-border-color: #c6c6c6;\n\n /* Danger button dark theme overrides */\n --hybrid-button-local-danger-outline: 1px solid #000000;\n --hybrid-button-local-danger-outline-offset: -3px;\n --hybrid-button-local-danger-hover-background-color: #ba1b23;\n --hybrid-button-local-danger-hover-border-color: #ba1b23;\n --hybrid-button-local-danger-active-background-color: #da1e28;\n --hybrid-button-local-danger-active-border-color: #ffffff;\n --hybrid-button-local-danger-disabled-background-color: #6f6f6f;\n --hybrid-button-local-danger-disabled-text-color: #8d8d8d;\n --hybrid-button-local-danger-disabled-border-color: #6f6f6f;\n --hybrid-button-local-danger-dashed-border-color: #ffffff;\n\n /* Text button dark theme overrides */\n --hybrid-button-local-text-background-color: transparent;\n --hybrid-button-local-text-text-color: #ffffff;\n --hybrid-button-local-text-border-color: transparent;\n --hybrid-button-local-text-hover-background-color: rgba(255, 255, 255, 0.1);\n --hybrid-button-local-text-hover-text-color: #ffffff;\n --hybrid-button-local-text-hover-border-color: transparent;\n --hybrid-button-local-text-active-background-color: rgba(255, 255, 255, 0.15);\n --hybrid-button-local-text-active-text-color: #ffffff;\n --hybrid-button-local-text-active-border-color: transparent;\n --hybrid-button-local-text-disabled-background-color: transparent;\n --hybrid-button-local-text-disabled-text-color: #6f6f6f;\n --hybrid-button-local-text-disabled-border-color: transparent;\n\n /* Link button dark theme overrides */\n --hybrid-button-local-link-background-color: transparent;\n --hybrid-button-local-link-text-color: #78a9ff;\n --hybrid-button-local-link-border-color: transparent;\n --hybrid-button-local-link-hover-background-color: transparent;\n --hybrid-button-local-link-hover-text-color: #a6c8ff;\n --hybrid-button-local-link-hover-border-color: transparent;\n --hybrid-button-local-link-active-background-color: transparent;\n --hybrid-button-local-link-active-text-color: #a6c8ff;\n --hybrid-button-local-link-active-border-color: transparent;\n --hybrid-button-local-link-disabled-background-color: transparent;\n --hybrid-button-local-link-disabled-text-color: #6f6f6f;\n --hybrid-button-local-link-disabled-border-color: transparent;\n }\n\n /* ========================================\n * RIPPLE EFFECT STYLES\n * ======================================== */\n\n /* Ripple effect animation */\n .ripple {\n position: absolute;\n border-radius: 50%;\n background-color: rgba(255, 255, 255, 0.4);\n transform: scale(0);\n animation: ripple-animation 0.6s linear;\n pointer-events: none;\n }\n\n /* Darker ripple for light buttons */\n button[data-type='default'] .ripple,\n button[data-type='ghost'] .ripple {\n background-color: rgba(0, 0, 0, 0.1);\n }\n\n /* Lighter ripple for dark buttons */\n button[data-type='primary'] .ripple,\n button[data-type='danger'] .ripple {\n background-color: rgba(255, 255, 255, 0.3);\n }\n\n /* Ripple animation keyframes */\n @keyframes ripple-animation {\n to {\n transform: scale(4);\n opacity: 0;\n }\n }\n\n /* Disable ripple when component is disabled */\n button:disabled .ripple {\n display: none;\n }\n`;\n\n/**\n * Exported styles for the nr-button component\n * \n * @description\n * This export provides the complete styling system for the button component,\n * including all variants, states, sizes, theme support, and CSS custom properties.\n * \n * @usage\n * Import and use in the component's styles property:\n * ```typescript\n * import { styles } from './nr-button.style.ts';\n * \n * @Component({\n * styles: styles\n * })\n * ```\n */\nexport const styles = [buttonStyles, buttonVariables];\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.style.variables.d.ts","sourceRoot":"","sources":["../../../src/components/button/button.style.variables.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,yBAsL3B,CAAC"}
|