@webstrail/ui-library 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.ts +4 -6
  4. package/dist/index.js +1248 -817
  5. package/dist/index.js.map +1 -1
  6. package/dist/style.css +1 -1
  7. package/package.json +3 -19
  8. package/dist/UIProvider-C3ae0nQV.cjs +0 -2
  9. package/dist/UIProvider-C3ae0nQV.cjs.map +0 -1
  10. package/dist/UIProvider-CHECrDaZ.js +0 -466
  11. package/dist/UIProvider-CHECrDaZ.js.map +0 -1
  12. package/dist/core/config/globalConfig.d.ts +0 -54
  13. package/dist/core/config/index.d.ts +0 -1
  14. package/dist/core/index.d.ts +0 -4
  15. package/dist/core/theme/defaultTheme.d.ts +0 -7
  16. package/dist/core/theme/deriveTokens.d.ts +0 -16
  17. package/dist/core/theme/index.d.ts +0 -2
  18. package/dist/core/types/common.d.ts +0 -32
  19. package/dist/core/types/config.d.ts +0 -70
  20. package/dist/core/types/index.d.ts +0 -3
  21. package/dist/core/types/tokens.d.ts +0 -65
  22. package/dist/core/utils/styles.d.ts +0 -19
  23. package/dist/core.cjs +0 -2
  24. package/dist/core.cjs.map +0 -1
  25. package/dist/core.js +0 -344
  26. package/dist/core.js.map +0 -1
  27. package/dist/react/components/Button/Button.d.ts +0 -2
  28. package/dist/react/components/Button/Button.types.d.ts +0 -52
  29. package/dist/react/components/Button/index.d.ts +0 -2
  30. package/dist/react/index.d.ts +0 -6
  31. package/dist/react.cjs +0 -2
  32. package/dist/react.cjs.map +0 -1
  33. package/dist/react.js +0 -9
  34. package/dist/react.js.map +0 -1
  35. package/dist/web-components/button/button.element.d.ts +0 -59
  36. package/dist/web-components/button/button.styles.d.ts +0 -1
  37. package/dist/web-components/button/button.types.d.ts +0 -21
  38. package/dist/web-components/button/index.d.ts +0 -3
  39. package/dist/web-components/index.d.ts +0 -1
  40. package/dist/web-components.cjs +0 -269
  41. package/dist/web-components.cjs.map +0 -1
  42. package/dist/web-components.js +0 -503
  43. package/dist/web-components.js.map +0 -1
@@ -1,269 +0,0 @@
1
- "use strict";var p=Object.defineProperty;var g=(a,i,t)=>i in a?p(a,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[i]=t;var n=(a,i,t)=>g(a,typeof i!="symbol"?i+"":i,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./core.cjs"),u=`
2
- :host {
3
- display: inline-block;
4
- vertical-align: middle;
5
- box-sizing: border-box;
6
- font-family: var(
7
- --wb-button-font-family,
8
- var(
9
- --wui-button-font-family,
10
- var(
11
- --wui-font-family,
12
- system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif
13
- )
14
- )
15
- );
16
- outline: none;
17
- }
18
-
19
- :host([full-width]),
20
- :host([fullwidth]) {
21
- display: block;
22
- width: 100%;
23
- }
24
-
25
- :host([hidden]) {
26
- display: none !important;
27
- }
28
-
29
- *, *::before, *::after {
30
- box-sizing: border-box;
31
- }
32
-
33
- .button {
34
- display: inline-flex;
35
- align-items: center;
36
- justify-content: center;
37
- gap: 8px;
38
- position: relative;
39
- font-family: inherit;
40
- font-size: var(--wb-button-font-size, var(--wui-button-font-size, 14px));
41
- font-weight: var(--wb-button-font-weight, var(--wui-button-font-weight, 500));
42
- line-height: 1;
43
- text-decoration: none;
44
- white-space: nowrap;
45
- vertical-align: middle;
46
- cursor: pointer;
47
- user-select: none;
48
- border: 1px solid transparent;
49
- border-radius: var(--wb-button-radius, var(--wb-button-border-radius, var(--wui-button-border-radius, 8px)));
50
- padding: var(--wb-button-padding, var(--wui-button-padding, 0 16px));
51
- height: var(--wb-button-height, var(--wui-button-height, 40px));
52
- transition: var(--wb-button-transition, var(--wui-button-transition, all 0.15s ease-in-out));
53
- outline: none;
54
- width: 100%;
55
- }
56
-
57
- :host(:not([full-width]):not([fullwidth])) .button {
58
- width: auto;
59
- }
60
-
61
- .button:focus-visible {
62
- box-shadow: var(--wb-button-focus-shadow, var(--wui-button-focus-shadow, 0 0 0 3px var(--wb-button-focus-ring, var(--wui-button-focus-ring-color, rgba(36, 145, 235, 0.35)))));
63
- }
64
-
65
- /* Sizes */
66
- .sizeSmall {
67
- height: var(--wb-button-height-sm, 32px);
68
- padding: var(--wb-button-padding-sm, 0 12px);
69
- font-size: var(--wb-button-font-size-sm, 12px);
70
- gap: 6px;
71
- }
72
-
73
- .sizeMedium {
74
- height: var(--wb-button-height, var(--wui-button-height, 40px));
75
- padding: var(--wb-button-padding, var(--wui-button-padding, 0 16px));
76
- font-size: var(--wb-button-font-size, var(--wui-button-font-size, 14px));
77
- gap: 8px;
78
- }
79
-
80
- .sizeLarge {
81
- height: var(--wb-button-height-lg, 48px);
82
- padding: var(--wb-button-padding-lg, 0 24px);
83
- font-size: var(--wb-button-font-size-lg, 16px);
84
- gap: 10px;
85
- }
86
-
87
- /* Variants */
88
- .variantPrimary {
89
- background-color: var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, #2491eb)));
90
- color: var(--wb-button-text-color, var(--wui-button-text-color, #ffffff));
91
- border-color: var(--wb-button-border-color, var(--wui-button-border-color, transparent));
92
- }
93
-
94
- .variantPrimary:hover:not(:disabled):not(.loading) {
95
- background-color: var(
96
- --wb-button-hover-background-color,
97
- var(
98
- --wui-button-hover-background-color,
99
- color-mix(in srgb, var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, #2491eb))) 88%, #000000)
100
- )
101
- );
102
- color: var(--wb-button-hover-text-color, var(--wui-button-hover-text-color, #ffffff));
103
- }
104
-
105
- .variantPrimary:active:not(:disabled):not(.loading) {
106
- background-color: var(
107
- --wb-button-active-background-color,
108
- var(
109
- --wui-button-active-background-color,
110
- color-mix(in srgb, var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, #2491eb))) 78%, #000000)
111
- )
112
- );
113
- }
114
-
115
- .variantSecondary {
116
- background-color: var(--wb-button-secondary, var(--wb-button-secondary-background-color, #406993));
117
- color: #ffffff;
118
- border-color: transparent;
119
- }
120
-
121
- .variantSecondary:hover:not(:disabled):not(.loading) {
122
- background-color: var(--wb-button-secondary-hover-background-color, #345679);
123
- }
124
-
125
- .variantSecondary:active:not(:disabled):not(.loading) {
126
- background-color: var(--wb-button-secondary-active-background-color, #284460);
127
- }
128
-
129
- .variantOutline {
130
- background-color: transparent;
131
- color: var(
132
- --wb-button-outline-color,
133
- var(
134
- --wui-button-outline-color,
135
- var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, var(--wui-color-primary, #2491eb))))
136
- )
137
- );
138
- border: 1.5px solid
139
- var(
140
- --wb-button-outline-border-color,
141
- var(
142
- --wui-button-outline-border-color,
143
- var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, var(--wui-color-primary, #2491eb))))
144
- )
145
- );
146
- }
147
-
148
- .variantOutline:hover:not(:disabled):not(.loading) {
149
- background-color: var(
150
- --wb-button-outline-hover-background-color,
151
- var(
152
- --wui-button-outline-hover-background-color,
153
- color-mix(in srgb, var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, #2491eb))) 10%, transparent)
154
- )
155
- );
156
- }
157
-
158
- .variantOutline:active:not(:disabled):not(.loading) {
159
- background-color: color-mix(
160
- in srgb,
161
- var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, #2491eb))) 18%,
162
- transparent
163
- );
164
- }
165
-
166
- .variantGhost {
167
- background-color: transparent;
168
- color: var(
169
- --wb-button-ghost-color,
170
- var(
171
- --wui-button-ghost-color,
172
- var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, var(--wui-color-primary, #2491eb))))
173
- )
174
- );
175
- border-color: transparent;
176
- }
177
-
178
- .variantGhost:hover:not(:disabled):not(.loading) {
179
- background-color: var(
180
- --wb-button-ghost-hover-background-color,
181
- var(
182
- --wui-button-ghost-hover-background-color,
183
- color-mix(in srgb, var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, #2491eb))) 10%, transparent)
184
- )
185
- );
186
- }
187
-
188
- .variantGhost:active:not(:disabled):not(.loading) {
189
- background-color: color-mix(
190
- in srgb,
191
- var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, #2491eb))) 18%,
192
- transparent
193
- );
194
- }
195
-
196
- .variantDanger {
197
- background-color: var(--wb-button-danger, #dc2626);
198
- color: #ffffff;
199
- border-color: transparent;
200
- }
201
-
202
- .variantDanger:hover:not(:disabled):not(.loading) {
203
- background-color: var(--wb-button-danger-hover, #b91c1c);
204
- }
205
-
206
- .variantDanger:active:not(:disabled):not(.loading) {
207
- background-color: var(--wb-button-danger-active, #991b1b);
208
- }
209
-
210
- /* Full Width */
211
- .fullWidth {
212
- width: 100%;
213
- }
214
-
215
- /* Disabled */
216
- .disabled,
217
- .button:disabled {
218
- cursor: not-allowed;
219
- opacity: 0.65;
220
- background-color: var(--wb-button-disabled-background-color, var(--wui-button-disabled-background-color, #f3f4f6));
221
- color: var(--wb-button-disabled-text-color, var(--wui-button-disabled-text-color, #9ca3af));
222
- border-color: var(--wb-button-disabled-border-color, var(--wui-button-disabled-border-color, #e5e7eb));
223
- box-shadow: none;
224
- }
225
-
226
- /* Loading */
227
- .loading {
228
- cursor: wait;
229
- pointer-events: none;
230
- }
231
-
232
- /* Spinner */
233
- .spinner {
234
- display: inline-block;
235
- width: 1em;
236
- height: 1em;
237
- border: 2px solid currentColor;
238
- border-right-color: transparent;
239
- border-radius: 50%;
240
- animation: spin 0.75s linear infinite;
241
- }
242
-
243
- .icon {
244
- display: inline-flex;
245
- align-items: center;
246
- justify-content: center;
247
- flex-shrink: 0;
248
- font-size: 1.1em;
249
- }
250
-
251
- .label {
252
- display: inline-flex;
253
- align-items: center;
254
- }
255
-
256
- .hidden {
257
- display: none !important;
258
- }
259
-
260
- @keyframes spin {
261
- from {
262
- transform: rotate(0deg);
263
- }
264
- to {
265
- transform: rotate(360deg);
266
- }
267
- }
268
- `;class b extends HTMLElement{constructor(){super();n(this,"_internals");n(this,"_buttonElement");n(this,"_spinnerElement");n(this,"_startIconWrapper");n(this,"_startIconSlot");n(this,"_endIconWrapper");n(this,"_endIconSlot");n(this,"_labelWrapper");n(this,"_defaultSlot");n(this,"_unsubscribeConfig");n(this,"_stylesObj");if(typeof this.attachInternals=="function")try{this._internals=this.attachInternals()}catch{}const t=this.attachShadow({mode:"open",delegatesFocus:!0}),e=document.createElement("style");e.textContent=u,t.appendChild(e),this._buttonElement=document.createElement("button"),this._buttonElement.setAttribute("part","button"),this._buttonElement.className="button",this._spinnerElement=document.createElement("span"),this._spinnerElement.setAttribute("part","spinner"),this._spinnerElement.className="spinner hidden",this._spinnerElement.setAttribute("aria-hidden","true"),this._buttonElement.appendChild(this._spinnerElement),this._startIconWrapper=document.createElement("span"),this._startIconWrapper.setAttribute("part","start-icon"),this._startIconWrapper.className="icon hidden",this._startIconSlot=document.createElement("slot"),this._startIconSlot.name="start-icon",this._startIconWrapper.appendChild(this._startIconSlot),this._buttonElement.appendChild(this._startIconWrapper),this._labelWrapper=document.createElement("span"),this._labelWrapper.setAttribute("part","label"),this._labelWrapper.className="label",this._defaultSlot=document.createElement("slot"),this._labelWrapper.appendChild(this._defaultSlot),this._buttonElement.appendChild(this._labelWrapper),this._endIconWrapper=document.createElement("span"),this._endIconWrapper.setAttribute("part","end-icon"),this._endIconWrapper.className="icon hidden",this._endIconSlot=document.createElement("slot"),this._endIconSlot.name="end-icon",this._endIconWrapper.appendChild(this._endIconSlot),this._buttonElement.appendChild(this._endIconWrapper),t.appendChild(this._buttonElement),this._startIconSlot.addEventListener("slotchange",()=>this._handleSlotChange()),this._endIconSlot.addEventListener("slotchange",()=>this._handleSlotChange()),this._buttonElement.addEventListener("click",o=>this._handleInternalClick(o)),this.addEventListener("click",o=>{(this.disabled||this.loading)&&(o.preventDefault(),o.stopImmediatePropagation())},!0),this.addEventListener("keydown",o=>{(o.key==="Enter"||o.key===" ")&&(this.disabled||this.loading)&&(o.preventDefault(),o.stopImmediatePropagation())})}static get observedAttributes(){return["variant","size","disabled","loading","loading-text","loadingtext","label","full-width","fullwidth","type","styles"]}connectedCallback(){this._unsubscribeConfig=s.subscribeWebstrailConfig(()=>{this._render()}),this._handleSlotChange(),this._render()}disconnectedCallback(){this._unsubscribeConfig&&(this._unsubscribeConfig(),this._unsubscribeConfig=void 0)}attributeChangedCallback(t,e,o){e!==o&&this._render()}get variant(){const t=this.getAttribute("variant");return t||s.getWebstrailConfig().components.button.variant||"primary"}set variant(t){t?this.setAttribute("variant",t):this.removeAttribute("variant")}get size(){const t=this.getAttribute("size");return t?s.normalizeButtonSize(t):s.normalizeButtonSize(s.getWebstrailConfig().components.button.size)}set size(t){t?this.setAttribute("size",t):this.removeAttribute("size")}get disabled(){return this.hasAttribute("disabled")}set disabled(t){t?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get loading(){return this.hasAttribute("loading")}set loading(t){t?this.setAttribute("loading",""):this.removeAttribute("loading")}get loadingText(){return this.getAttribute("loading-text")||this.getAttribute("loadingtext")}set loadingText(t){t!=null?this.setAttribute("loading-text",t):(this.removeAttribute("loading-text"),this.removeAttribute("loadingtext"))}get label(){return this.getAttribute("label")}set label(t){t!=null?this.setAttribute("label",t):this.removeAttribute("label")}get fullWidth(){return this.hasAttribute("full-width")||this.hasAttribute("fullwidth")}set fullWidth(t){t?this.setAttribute("full-width",""):(this.removeAttribute("full-width"),this.removeAttribute("fullwidth"))}get type(){const t=this.getAttribute("type");return t==="submit"||t==="reset"?t:"button"}set type(t){this.setAttribute("type",t)}get styles(){if(this._stylesObj)return this._stylesObj;const t=this.getAttribute("styles");if(t)try{return JSON.parse(t)}catch{return}}set styles(t){if(typeof t=="object"&&t!==null)this._stylesObj=t,this.setAttribute("styles",JSON.stringify(t));else if(typeof t=="string"){try{this._stylesObj=JSON.parse(t)}catch{this._stylesObj=void 0}this.setAttribute("styles",t)}else this._stylesObj=void 0,this.removeAttribute("styles")}get button(){return this._buttonElement}focus(t){var e;(e=this._buttonElement)==null||e.focus(t)}blur(){var t;(t=this._buttonElement)==null||t.blur()}_handleSlotChange(){const e=this._startIconSlot.assignedNodes({flatten:!0}).filter(r=>r.nodeType===Node.ELEMENT_NODE||r.textContent&&r.textContent.trim().length>0).length>0,d=this._endIconSlot.assignedNodes({flatten:!0}).filter(r=>r.nodeType===Node.ELEMENT_NODE||r.textContent&&r.textContent.trim().length>0).length>0;!this.loading&&e?this._startIconWrapper.classList.remove("hidden"):this._startIconWrapper.classList.add("hidden"),!this.loading&&d?this._endIconWrapper.classList.remove("hidden"):this._endIconWrapper.classList.add("hidden")}_handleInternalClick(t){if(this.disabled||this.loading){t.preventDefault(),t.stopImmediatePropagation();return}const e=new CustomEvent("wb-click",{bubbles:!0,composed:!0,cancelable:!0,detail:{originalEvent:t,target:this,variant:this.variant,size:this.size}});if(!this.dispatchEvent(e)){t.preventDefault();return}this.type==="submit"?this._submitAssociatedForm():this.type==="reset"&&this._resetAssociatedForm()}_submitAssociatedForm(){var e;const t=((e=this._internals)==null?void 0:e.form)||this.closest("form");if(t)if(typeof t.requestSubmit=="function")t.requestSubmit();else{const o=document.createElement("button");o.type="submit",o.style.display="none",t.appendChild(o),o.click(),t.removeChild(o)}}_resetAssociatedForm(){var e;const t=((e=this._internals)==null?void 0:e.form)||this.closest("form");t&&t.reset()}_render(){const t=s.resolveEffectiveButtonConfig({variant:this.getAttribute("variant")||void 0,size:this.getAttribute("size")||void 0,fullWidth:this.fullWidth,styles:this.styles}),e=this.disabled||this.loading;for(const[c,h]of Object.entries(t.cssVars))this.style.setProperty(c,h);const d={small:"sizeSmall",medium:"sizeMedium",large:"sizeLarge",sm:"sizeSmall",md:"sizeMedium",lg:"sizeLarge"}[t.size]||"sizeMedium",r={primary:"variantPrimary",secondary:"variantSecondary",outline:"variantOutline",ghost:"variantGhost",danger:"variantDanger"}[t.variant]||"variantPrimary",l=["button",d,r];t.fullWidth&&l.push("fullWidth"),e&&l.push("disabled"),this.loading&&l.push("loading"),this._buttonElement.className=l.join(" "),this._buttonElement.type=this.type,this._buttonElement.disabled=e,this.loading?this._buttonElement.setAttribute("aria-busy","true"):this._buttonElement.removeAttribute("aria-busy"),e?this._buttonElement.setAttribute("aria-disabled","true"):this._buttonElement.removeAttribute("aria-disabled"),this.loading?(this._spinnerElement.classList.remove("hidden"),this._startIconWrapper.classList.add("hidden"),this._endIconWrapper.classList.add("hidden")):(this._spinnerElement.classList.add("hidden"),this._handleSlotChange()),this.loading&&this.loadingText?this._labelWrapper.textContent=this.loadingText:this.label!==null&&this.label!==void 0?this._labelWrapper.textContent=this.label:this._labelWrapper.firstChild!==this._defaultSlot&&this._labelWrapper.replaceChildren(this._defaultSlot)}}n(b,"formAssociated",!0);function v(){typeof customElements<"u"&&!customElements.get("wb-button")&&customElements.define("wb-button",b)}typeof customElements<"u"&&!customElements.get("wb-button")&&customElements.define("wb-button",b);exports.WbButton=b;exports.buttonStyles=u;exports.registerWbButton=v;
269
- //# sourceMappingURL=web-components.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"web-components.cjs","sources":["../src/web-components/button/button.styles.ts","../src/web-components/button/button.element.ts"],"sourcesContent":["export const buttonStyles = `\n:host {\n display: inline-block;\n vertical-align: middle;\n box-sizing: border-box;\n font-family: var(\n --wb-button-font-family,\n var(\n --wui-button-font-family,\n var(\n --wui-font-family,\n system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif\n )\n )\n );\n outline: none;\n}\n\n:host([full-width]),\n:host([fullwidth]) {\n display: block;\n width: 100%;\n}\n\n:host([hidden]) {\n display: none !important;\n}\n\n*, *::before, *::after {\n box-sizing: border-box;\n}\n\n.button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n position: relative;\n font-family: inherit;\n font-size: var(--wb-button-font-size, var(--wui-button-font-size, 14px));\n font-weight: var(--wb-button-font-weight, var(--wui-button-font-weight, 500));\n line-height: 1;\n text-decoration: none;\n white-space: nowrap;\n vertical-align: middle;\n cursor: pointer;\n user-select: none;\n border: 1px solid transparent;\n border-radius: var(--wb-button-radius, var(--wb-button-border-radius, var(--wui-button-border-radius, 8px)));\n padding: var(--wb-button-padding, var(--wui-button-padding, 0 16px));\n height: var(--wb-button-height, var(--wui-button-height, 40px));\n transition: var(--wb-button-transition, var(--wui-button-transition, all 0.15s ease-in-out));\n outline: none;\n width: 100%;\n}\n\n:host(:not([full-width]):not([fullwidth])) .button {\n width: auto;\n}\n\n.button:focus-visible {\n box-shadow: var(--wb-button-focus-shadow, var(--wui-button-focus-shadow, 0 0 0 3px var(--wb-button-focus-ring, var(--wui-button-focus-ring-color, rgba(36, 145, 235, 0.35)))));\n}\n\n/* Sizes */\n.sizeSmall {\n height: var(--wb-button-height-sm, 32px);\n padding: var(--wb-button-padding-sm, 0 12px);\n font-size: var(--wb-button-font-size-sm, 12px);\n gap: 6px;\n}\n\n.sizeMedium {\n height: var(--wb-button-height, var(--wui-button-height, 40px));\n padding: var(--wb-button-padding, var(--wui-button-padding, 0 16px));\n font-size: var(--wb-button-font-size, var(--wui-button-font-size, 14px));\n gap: 8px;\n}\n\n.sizeLarge {\n height: var(--wb-button-height-lg, 48px);\n padding: var(--wb-button-padding-lg, 0 24px);\n font-size: var(--wb-button-font-size-lg, 16px);\n gap: 10px;\n}\n\n/* Variants */\n.variantPrimary {\n background-color: var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, #2491eb)));\n color: var(--wb-button-text-color, var(--wui-button-text-color, #ffffff));\n border-color: var(--wb-button-border-color, var(--wui-button-border-color, transparent));\n}\n\n.variantPrimary:hover:not(:disabled):not(.loading) {\n background-color: var(\n --wb-button-hover-background-color,\n var(\n --wui-button-hover-background-color,\n color-mix(in srgb, var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, #2491eb))) 88%, #000000)\n )\n );\n color: var(--wb-button-hover-text-color, var(--wui-button-hover-text-color, #ffffff));\n}\n\n.variantPrimary:active:not(:disabled):not(.loading) {\n background-color: var(\n --wb-button-active-background-color,\n var(\n --wui-button-active-background-color,\n color-mix(in srgb, var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, #2491eb))) 78%, #000000)\n )\n );\n}\n\n.variantSecondary {\n background-color: var(--wb-button-secondary, var(--wb-button-secondary-background-color, #406993));\n color: #ffffff;\n border-color: transparent;\n}\n\n.variantSecondary:hover:not(:disabled):not(.loading) {\n background-color: var(--wb-button-secondary-hover-background-color, #345679);\n}\n\n.variantSecondary:active:not(:disabled):not(.loading) {\n background-color: var(--wb-button-secondary-active-background-color, #284460);\n}\n\n.variantOutline {\n background-color: transparent;\n color: var(\n --wb-button-outline-color,\n var(\n --wui-button-outline-color,\n var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, var(--wui-color-primary, #2491eb))))\n )\n );\n border: 1.5px solid\n var(\n --wb-button-outline-border-color,\n var(\n --wui-button-outline-border-color,\n var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, var(--wui-color-primary, #2491eb))))\n )\n );\n}\n\n.variantOutline:hover:not(:disabled):not(.loading) {\n background-color: var(\n --wb-button-outline-hover-background-color,\n var(\n --wui-button-outline-hover-background-color,\n color-mix(in srgb, var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, #2491eb))) 10%, transparent)\n )\n );\n}\n\n.variantOutline:active:not(:disabled):not(.loading) {\n background-color: color-mix(\n in srgb,\n var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, #2491eb))) 18%,\n transparent\n );\n}\n\n.variantGhost {\n background-color: transparent;\n color: var(\n --wb-button-ghost-color,\n var(\n --wui-button-ghost-color,\n var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, var(--wui-color-primary, #2491eb))))\n )\n );\n border-color: transparent;\n}\n\n.variantGhost:hover:not(:disabled):not(.loading) {\n background-color: var(\n --wb-button-ghost-hover-background-color,\n var(\n --wui-button-ghost-hover-background-color,\n color-mix(in srgb, var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, #2491eb))) 10%, transparent)\n )\n );\n}\n\n.variantGhost:active:not(:disabled):not(.loading) {\n background-color: color-mix(\n in srgb,\n var(--wb-button-primary, var(--wb-button-background-color, var(--wui-button-background-color, #2491eb))) 18%,\n transparent\n );\n}\n\n.variantDanger {\n background-color: var(--wb-button-danger, #dc2626);\n color: #ffffff;\n border-color: transparent;\n}\n\n.variantDanger:hover:not(:disabled):not(.loading) {\n background-color: var(--wb-button-danger-hover, #b91c1c);\n}\n\n.variantDanger:active:not(:disabled):not(.loading) {\n background-color: var(--wb-button-danger-active, #991b1b);\n}\n\n/* Full Width */\n.fullWidth {\n width: 100%;\n}\n\n/* Disabled */\n.disabled,\n.button:disabled {\n cursor: not-allowed;\n opacity: 0.65;\n background-color: var(--wb-button-disabled-background-color, var(--wui-button-disabled-background-color, #f3f4f6));\n color: var(--wb-button-disabled-text-color, var(--wui-button-disabled-text-color, #9ca3af));\n border-color: var(--wb-button-disabled-border-color, var(--wui-button-disabled-border-color, #e5e7eb));\n box-shadow: none;\n}\n\n/* Loading */\n.loading {\n cursor: wait;\n pointer-events: none;\n}\n\n/* Spinner */\n.spinner {\n display: inline-block;\n width: 1em;\n height: 1em;\n border: 2px solid currentColor;\n border-right-color: transparent;\n border-radius: 50%;\n animation: spin 0.75s linear infinite;\n}\n\n.icon {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n font-size: 1.1em;\n}\n\n.label {\n display: inline-flex;\n align-items: center;\n}\n\n.hidden {\n display: none !important;\n}\n\n@keyframes spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n`;\n","import {\n normalizeButtonSize,\n type ButtonSize,\n type ButtonType,\n type ButtonVariant,\n type ComponentSize,\n} from '../../core/types/common';\nimport type { ButtonStyles } from '../../core/types/tokens';\nimport {\n getWebstrailConfig,\n resolveEffectiveButtonConfig,\n subscribeWebstrailConfig,\n} from '../../core/config/globalConfig';\nimport { buttonStyles } from './button.styles';\nimport type { WbClickEventDetail } from './button.types';\n\nexport class WbButton extends HTMLElement {\n static readonly formAssociated = true;\n\n private _internals?: ElementInternals;\n private _buttonElement!: HTMLButtonElement;\n private _spinnerElement!: HTMLElement;\n private _startIconWrapper!: HTMLElement;\n private _startIconSlot!: HTMLSlotElement;\n private _endIconWrapper!: HTMLElement;\n private _endIconSlot!: HTMLSlotElement;\n private _labelWrapper!: HTMLElement;\n private _defaultSlot!: HTMLSlotElement;\n private _unsubscribeConfig?: () => void;\n\n private _stylesObj?: ButtonStyles;\n\n static get observedAttributes(): string[] {\n return [\n 'variant',\n 'size',\n 'disabled',\n 'loading',\n 'loading-text',\n 'loadingtext',\n 'label',\n 'full-width',\n 'fullwidth',\n 'type',\n 'styles',\n ];\n }\n\n constructor() {\n super();\n\n if (typeof this.attachInternals === 'function') {\n try {\n this._internals = this.attachInternals();\n } catch {\n // ElementInternals may throw if not registered with formAssociated\n }\n }\n\n const shadow = this.attachShadow({ mode: 'open', delegatesFocus: true });\n\n // Inject styles\n const styleEl = document.createElement('style');\n styleEl.textContent = buttonStyles;\n shadow.appendChild(styleEl);\n\n // Build DOM structure\n this._buttonElement = document.createElement('button');\n this._buttonElement.setAttribute('part', 'button');\n this._buttonElement.className = 'button';\n\n // Spinner\n this._spinnerElement = document.createElement('span');\n this._spinnerElement.setAttribute('part', 'spinner');\n this._spinnerElement.className = 'spinner hidden';\n this._spinnerElement.setAttribute('aria-hidden', 'true');\n this._buttonElement.appendChild(this._spinnerElement);\n\n // Start icon wrapper and slot\n this._startIconWrapper = document.createElement('span');\n this._startIconWrapper.setAttribute('part', 'start-icon');\n this._startIconWrapper.className = 'icon hidden';\n this._startIconSlot = document.createElement('slot');\n this._startIconSlot.name = 'start-icon';\n this._startIconWrapper.appendChild(this._startIconSlot);\n this._buttonElement.appendChild(this._startIconWrapper);\n\n // Label / Children slot\n this._labelWrapper = document.createElement('span');\n this._labelWrapper.setAttribute('part', 'label');\n this._labelWrapper.className = 'label';\n this._defaultSlot = document.createElement('slot');\n this._labelWrapper.appendChild(this._defaultSlot);\n this._buttonElement.appendChild(this._labelWrapper);\n\n // End icon wrapper and slot\n this._endIconWrapper = document.createElement('span');\n this._endIconWrapper.setAttribute('part', 'end-icon');\n this._endIconWrapper.className = 'icon hidden';\n this._endIconSlot = document.createElement('slot');\n this._endIconSlot.name = 'end-icon';\n this._endIconWrapper.appendChild(this._endIconSlot);\n this._buttonElement.appendChild(this._endIconWrapper);\n\n shadow.appendChild(this._buttonElement);\n\n // Listen to slot changes to toggle icon wrapper visibility\n this._startIconSlot.addEventListener('slotchange', () => this._handleSlotChange());\n this._endIconSlot.addEventListener('slotchange', () => this._handleSlotChange());\n\n // Internal click handler\n this._buttonElement.addEventListener('click', (e) => this._handleInternalClick(e));\n\n // Capture click on host to suppress native click propagation when disabled or loading\n this.addEventListener(\n 'click',\n (e) => {\n if (this.disabled || this.loading) {\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n },\n true\n );\n\n // Keyboard support for Enter / Space\n this.addEventListener('keydown', (e: KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n if (this.disabled || this.loading) {\n e.preventDefault();\n e.stopImmediatePropagation();\n }\n }\n });\n }\n\n connectedCallback(): void {\n // Subscribe to global configuration changes\n this._unsubscribeConfig = subscribeWebstrailConfig(() => {\n this._render();\n });\n\n this._handleSlotChange();\n this._render();\n }\n\n disconnectedCallback(): void {\n if (this._unsubscribeConfig) {\n this._unsubscribeConfig();\n this._unsubscribeConfig = undefined;\n }\n }\n\n attributeChangedCallback(_name: string, oldValue: string | null, newValue: string | null): void {\n if (oldValue === newValue) return;\n this._render();\n }\n\n /* ------------------- Properties (Getters / Setters) ------------------- */\n\n get variant(): ButtonVariant {\n const attr = this.getAttribute('variant');\n if (attr) return attr as ButtonVariant;\n return getWebstrailConfig().components.button.variant || 'primary';\n }\n\n set variant(value: ButtonVariant) {\n if (value) {\n this.setAttribute('variant', value);\n } else {\n this.removeAttribute('variant');\n }\n }\n\n get size(): ComponentSize {\n const attr = this.getAttribute('size');\n if (attr) return normalizeButtonSize(attr);\n return normalizeButtonSize(getWebstrailConfig().components.button.size);\n }\n\n set size(value: ButtonSize) {\n if (value) {\n this.setAttribute('size', value);\n } else {\n this.removeAttribute('size');\n }\n }\n\n get disabled(): boolean {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value: boolean) {\n if (value) {\n this.setAttribute('disabled', '');\n } else {\n this.removeAttribute('disabled');\n }\n }\n\n get loading(): boolean {\n return this.hasAttribute('loading');\n }\n\n set loading(value: boolean) {\n if (value) {\n this.setAttribute('loading', '');\n } else {\n this.removeAttribute('loading');\n }\n }\n\n get loadingText(): string | null {\n return this.getAttribute('loading-text') || this.getAttribute('loadingtext');\n }\n\n set loadingText(value: string | null) {\n if (value !== null && value !== undefined) {\n this.setAttribute('loading-text', value);\n } else {\n this.removeAttribute('loading-text');\n this.removeAttribute('loadingtext');\n }\n }\n\n get label(): string | null {\n return this.getAttribute('label');\n }\n\n set label(value: string | null) {\n if (value !== null && value !== undefined) {\n this.setAttribute('label', value);\n } else {\n this.removeAttribute('label');\n }\n }\n\n get fullWidth(): boolean {\n return this.hasAttribute('full-width') || this.hasAttribute('fullwidth');\n }\n\n set fullWidth(value: boolean) {\n if (value) {\n this.setAttribute('full-width', '');\n } else {\n this.removeAttribute('full-width');\n this.removeAttribute('fullwidth');\n }\n }\n\n get type(): ButtonType {\n const attr = this.getAttribute('type');\n if (attr === 'submit' || attr === 'reset') return attr;\n return 'button';\n }\n\n set type(value: ButtonType) {\n this.setAttribute('type', value);\n }\n\n get styles(): ButtonStyles | undefined {\n if (this._stylesObj) return this._stylesObj;\n const attr = this.getAttribute('styles');\n if (attr) {\n try {\n return JSON.parse(attr) as ButtonStyles;\n } catch {\n return undefined;\n }\n }\n return undefined;\n }\n\n set styles(value: ButtonStyles | string | undefined) {\n if (typeof value === 'object' && value !== null) {\n this._stylesObj = value;\n this.setAttribute('styles', JSON.stringify(value));\n } else if (typeof value === 'string') {\n try {\n this._stylesObj = JSON.parse(value);\n } catch {\n this._stylesObj = undefined;\n }\n this.setAttribute('styles', value);\n } else {\n this._stylesObj = undefined;\n this.removeAttribute('styles');\n }\n }\n\n /**\n * Reference to inner button for focus/blur integration.\n */\n get button(): HTMLButtonElement {\n return this._buttonElement;\n }\n\n override focus(options?: FocusOptions): void {\n this._buttonElement?.focus(options);\n }\n\n override blur(): void {\n this._buttonElement?.blur();\n }\n\n /* ------------------- Slot Change Detection ------------------- */\n\n private _handleSlotChange(): void {\n const startNodes = this._startIconSlot\n .assignedNodes({ flatten: true })\n .filter(\n (n) =>\n n.nodeType === Node.ELEMENT_NODE || (n.textContent && n.textContent.trim().length > 0)\n );\n const hasStartIcon = startNodes.length > 0;\n\n const endNodes = this._endIconSlot\n .assignedNodes({ flatten: true })\n .filter(\n (n) =>\n n.nodeType === Node.ELEMENT_NODE || (n.textContent && n.textContent.trim().length > 0)\n );\n const hasEndIcon = endNodes.length > 0;\n\n if (!this.loading && hasStartIcon) {\n this._startIconWrapper.classList.remove('hidden');\n } else {\n this._startIconWrapper.classList.add('hidden');\n }\n\n if (!this.loading && hasEndIcon) {\n this._endIconWrapper.classList.remove('hidden');\n } else {\n this._endIconWrapper.classList.add('hidden');\n }\n }\n\n /* ------------------- Event & Form Handling ------------------- */\n\n private _handleInternalClick(event: MouseEvent): void {\n if (this.disabled || this.loading) {\n event.preventDefault();\n event.stopImmediatePropagation();\n return;\n }\n\n // Dispatch custom wb-click event\n const wbClickEvent = new CustomEvent<WbClickEventDetail>('wb-click', {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail: {\n originalEvent: event,\n target: this,\n variant: this.variant,\n size: this.size,\n },\n });\n\n const notCancelled = this.dispatchEvent(wbClickEvent);\n\n if (!notCancelled) {\n event.preventDefault();\n return;\n }\n\n // Form submission / reset handling\n if (this.type === 'submit') {\n this._submitAssociatedForm();\n } else if (this.type === 'reset') {\n this._resetAssociatedForm();\n }\n }\n\n private _submitAssociatedForm(): void {\n const form = this._internals?.form || this.closest('form');\n if (!form) return;\n\n if (typeof form.requestSubmit === 'function') {\n form.requestSubmit();\n } else {\n const submitBtn = document.createElement('button');\n submitBtn.type = 'submit';\n submitBtn.style.display = 'none';\n form.appendChild(submitBtn);\n submitBtn.click();\n form.removeChild(submitBtn);\n }\n }\n\n private _resetAssociatedForm(): void {\n const form = this._internals?.form || this.closest('form');\n if (form) {\n form.reset();\n }\n }\n\n /* ------------------- Render Method ------------------- */\n\n private _render(): void {\n const effective = resolveEffectiveButtonConfig({\n variant: this.getAttribute('variant') || undefined,\n size: this.getAttribute('size') || undefined,\n fullWidth: this.fullWidth,\n styles: this.styles,\n });\n\n const isActuallyDisabled = this.disabled || this.loading;\n\n // Apply resolved CSS variables to host element\n for (const [varName, varVal] of Object.entries(effective.cssVars)) {\n this.style.setProperty(varName, varVal);\n }\n\n // Size class\n const sizeMap: Record<string, string> = {\n small: 'sizeSmall',\n medium: 'sizeMedium',\n large: 'sizeLarge',\n sm: 'sizeSmall',\n md: 'sizeMedium',\n lg: 'sizeLarge',\n };\n const sizeClassName = sizeMap[effective.size] || 'sizeMedium';\n\n // Variant class\n const variantClassName =\n {\n primary: 'variantPrimary',\n secondary: 'variantSecondary',\n outline: 'variantOutline',\n ghost: 'variantGhost',\n danger: 'variantDanger',\n }[effective.variant] || 'variantPrimary';\n\n // Build class list for inner button\n const classes = ['button', sizeClassName, variantClassName];\n if (effective.fullWidth) classes.push('fullWidth');\n if (isActuallyDisabled) classes.push('disabled');\n if (this.loading) classes.push('loading');\n\n this._buttonElement.className = classes.join(' ');\n this._buttonElement.type = this.type;\n this._buttonElement.disabled = isActuallyDisabled;\n\n // Accessibility attributes\n if (this.loading) {\n this._buttonElement.setAttribute('aria-busy', 'true');\n } else {\n this._buttonElement.removeAttribute('aria-busy');\n }\n\n if (isActuallyDisabled) {\n this._buttonElement.setAttribute('aria-disabled', 'true');\n } else {\n this._buttonElement.removeAttribute('aria-disabled');\n }\n\n // Spinner vs start icon\n if (this.loading) {\n this._spinnerElement.classList.remove('hidden');\n this._startIconWrapper.classList.add('hidden');\n this._endIconWrapper.classList.add('hidden');\n } else {\n this._spinnerElement.classList.add('hidden');\n this._handleSlotChange();\n }\n\n // Label / Loading text / Children\n if (this.loading && this.loadingText) {\n this._labelWrapper.textContent = this.loadingText;\n } else if (this.label !== null && this.label !== undefined) {\n this._labelWrapper.textContent = this.label;\n } else {\n // Slotted default content\n if (this._labelWrapper.firstChild !== this._defaultSlot) {\n this._labelWrapper.replaceChildren(this._defaultSlot);\n }\n }\n }\n}\n\n/**\n * Registers the 'wb-button' custom element if not already registered.\n */\nexport function registerWbButton(): void {\n if (typeof customElements !== 'undefined' && !customElements.get('wb-button')) {\n customElements.define('wb-button', WbButton);\n }\n}\n\n// Auto-register in browser environment\nif (typeof customElements !== 'undefined' && !customElements.get('wb-button')) {\n customElements.define('wb-button', WbButton);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'wb-button': WbButton;\n }\n}\n"],"names":["buttonStyles","WbButton","__publicField","shadow","styleEl","e","subscribeWebstrailConfig","_name","oldValue","newValue","attr","getWebstrailConfig","value","normalizeButtonSize","options","_a","hasStartIcon","n","hasEndIcon","event","wbClickEvent","form","submitBtn","effective","resolveEffectiveButtonConfig","isActuallyDisabled","varName","varVal","sizeClassName","variantClassName","classes","registerWbButton"],"mappings":"kRAAaA,EAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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