@juspay/svelte-ui-components 4.40.1 → 4.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Button/Button.svelte +43 -0
- package/dist/Button/properties.d.ts +14 -0
- package/dist-wc/index.js +145 -131
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
size = 'md',
|
|
9
9
|
iconOnly = false,
|
|
10
10
|
fullWidth = false,
|
|
11
|
+
shrinkable = false,
|
|
11
12
|
href,
|
|
12
13
|
target,
|
|
13
14
|
rel,
|
|
@@ -73,6 +74,7 @@
|
|
|
73
74
|
class="button-container variant-{variant} size-{size} {classes ?? ''}"
|
|
74
75
|
class:icon-only={iconOnly}
|
|
75
76
|
class:full-width={fullWidth}
|
|
77
|
+
class:button-shrinkable={shrinkable}
|
|
76
78
|
style={style ?? null}
|
|
77
79
|
>
|
|
78
80
|
{#if showProgressBar}
|
|
@@ -238,6 +240,47 @@
|
|
|
238
240
|
--button-width: 100%;
|
|
239
241
|
}
|
|
240
242
|
|
|
243
|
+
/* Opt-in only. With the default nowrap label, fit-content never drops below the
|
|
244
|
+
label's full width, so a percentage cap on the inner button resolves against
|
|
245
|
+
an already label-wide container and a Button in a parent narrower than its
|
|
246
|
+
label (a flex row, a grid cell or a plain block) cannot shrink. Capping the
|
|
247
|
+
container itself gives that percentage something real to resolve against.
|
|
248
|
+
|
|
249
|
+
The box is `width: 100%` bounded by `max-width: max-content` rather than
|
|
250
|
+
`fit-content`: as wide as the label and never wider than the parent, with no
|
|
251
|
+
intrinsic keyword as its width. Firefox and WebKit size a `1fr` or `auto`
|
|
252
|
+
grid track to at least the content width of an item whose width is such a
|
|
253
|
+
keyword, so the track grew to the label and the Button never shrank in a grid
|
|
254
|
+
cell (Chromium shrinks the track). A percentage is not counted that way.
|
|
255
|
+
`width: auto` would shrink the track too, but it stretches the box across a
|
|
256
|
+
block, stretch or `justify-items: normal` parent, and `margin: auto` on the
|
|
257
|
+
root would stop centring it. As a flex item the box is clamped to the
|
|
258
|
+
label's width, so `flex-grow` on the root does not widen it. A custom
|
|
259
|
+
`--button-width` replaces the max-content bound, and `fullWidth` sets it
|
|
260
|
+
to 100%.
|
|
261
|
+
|
|
262
|
+
Deliberately class-gated rather than a pair of tokens on every container: an
|
|
263
|
+
unconditional declaration here would outrank a consumer's own max-width class
|
|
264
|
+
on the root (the scoped selector is more specific). The class carries the
|
|
265
|
+
component prefix because `classes` lands on this same element, and a
|
|
266
|
+
consumer's own `shrinkable` class must not opt a Button in. */
|
|
267
|
+
.button-container.button-shrinkable {
|
|
268
|
+
min-width: 0;
|
|
269
|
+
width: 100%;
|
|
270
|
+
max-width: var(--button-width, max-content);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.button-container.button-shrinkable > .button-el {
|
|
274
|
+
max-width: var(--button-max-width, 100%);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/* An icon with a percentage max-width (the common `img { max-width: 100% }`
|
|
278
|
+
reset) has a min-content width of zero, so the shrinking button would
|
|
279
|
+
squeeze it along with the label. */
|
|
280
|
+
.button-container.button-shrinkable > .button-el > .button-icon {
|
|
281
|
+
flex-shrink: 0;
|
|
282
|
+
}
|
|
283
|
+
|
|
241
284
|
.button-el {
|
|
242
285
|
max-height: var(--button-max-height);
|
|
243
286
|
max-width: var(--button-max-width);
|
|
@@ -20,6 +20,20 @@ export type OptionalButtonProperties = {
|
|
|
20
20
|
iconOnly?: boolean;
|
|
21
21
|
/** Stretch the button to the full width of its container. */
|
|
22
22
|
fullWidth?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Let the button be narrower than its label. By default a button is as wide as its label
|
|
25
|
+
* (which does not wrap), so inside a parent narrower than the label (a flex row, a grid cell or
|
|
26
|
+
* a plain block) it can never give width back and a long label overflows its parent. With
|
|
27
|
+
* `shrinkable` the button still hugs a label that fits, but a label that does not is truncated
|
|
28
|
+
* with an ellipsis inside whatever width the parent offers. The button is capped at
|
|
29
|
+
* `var(--button-max-width, 100%)` of that width.
|
|
30
|
+
*
|
|
31
|
+
* Only the `text` label is truncated: custom `children` content has to manage its own overflow.
|
|
32
|
+
* Wrapping with `--button-white-space: normal` works without this prop; with it, a single word
|
|
33
|
+
* wider than the parent is clipped instead of overflowing. On an `iconOnly` button it changes
|
|
34
|
+
* nothing while the square fits; in a narrower parent the padding gives way before the glyph does.
|
|
35
|
+
*/
|
|
36
|
+
shrinkable?: boolean;
|
|
23
37
|
/**
|
|
24
38
|
* Render the button as an `<a>` styled identically. Use for button-styled links/navigation.
|
|
25
39
|
* When set, `type` is ignored; a disabled link is rendered inert via `aria-disabled`.
|
package/dist-wc/index.js
CHANGED
|
@@ -4680,19 +4680,19 @@ create_custom_element(Loader, {
|
|
|
4680
4680
|
//#region src/lib/Button/Button.svelte
|
|
4681
4681
|
var root$107 = /* @__PURE__ */ from_html("<div class=\"button-progress-bar svelte-1j9w5l4\"></div>"), root_1$95 = /* @__PURE__ */ from_html("<div class=\"button-loader svelte-1j9w5l4\"><!></div>"), root_2$74 = /* @__PURE__ */ from_html("<div class=\"button-icon svelte-1j9w5l4\"><!></div>"), root_3$66 = /* @__PURE__ */ from_html("<div class=\"button-text svelte-1j9w5l4\"></div>"), root_4$54 = /* @__PURE__ */ from_html("<div class=\"button-text svelte-1j9w5l4\"> </div>"), root_5$42 = /* @__PURE__ */ from_html("<!> <!> <!> <!>", 1), root_6$36 = /* @__PURE__ */ from_html("<div class=\"button-status svelte-1j9w5l4\" role=\"status\" aria-live=\"polite\"> </div>"), root_7$32 = /* @__PURE__ */ from_html("<div><!> <!> <!></div>"), $$css$196 = {
|
|
4682
4682
|
hash: "svelte-1j9w5l4",
|
|
4683
|
-
code: ".button-container.svelte-1j9w5l4 {position:relative;width:var(--button-width, fit-content);}\n\n /* The statusText region: out of flow at 1x1px inside the positioned\n container, so it never moves the button or its row (the visually-hidden\n recipe ChatComposer and Label use). Not named .sr-only: `classes` lands on\n this container, so a consumer's own `sr-only` class would match a rule of\n that name here and hide the whole button. */.button-status.svelte-1j9w5l4 {position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);clip-path:inset(50%);white-space:nowrap;border-width:0;}\n\n /* ---- Variant defaults (set the internal --_btn-* layer; explicit --button-* always wins) ---- */.variant-primary.svelte-1j9w5l4 {--_btn-color: #3a4550;--_btn-text-color: #ffffff;--_btn-border: none;}.variant-secondary.svelte-1j9w5l4 {--_btn-color: transparent;--_btn-text-color: var(--button-secondary-text-color, #3a4550);--_btn-border: 1px solid var(--button-secondary-border-color, #cbd5e1);--_btn-hover-color: var(--button-secondary-hover-background, #f1f5f9);--_btn-hover-text-color: var(--button-secondary-text-color, #3a4550);--_btn-hover-border: 1px solid var(--button-secondary-border-color, #cbd5e1);}.variant-ghost.svelte-1j9w5l4 {--_btn-color: transparent;--_btn-text-color: var(--button-ghost-text-color, #3a4550);--_btn-border: none;--_btn-hover-color: var(--button-ghost-hover-background, #f1f5f9);--_btn-hover-text-color: var(--button-ghost-text-color, #3a4550);--_btn-hover-border: none;}.variant-destructive.svelte-1j9w5l4 {--_btn-color: #e7000b;--_btn-text-color: #ffffff;--_btn-border: none;--_btn-hover-color: #c10007;--_btn-hover-text-color: #ffffff;--_btn-hover-border: none;}\n\n /* Transparent chassis for gradient marketing CTAs — deliberately no background\n of its own. Pair with a --button-background gradient (and usually a matching\n --button-hover-color, since --_btn-hover-color sits before --button-background\n in the hover fallback chain and would otherwise flatten the gradient to\n transparent on hover). Geometry (padding/font-size) is intentionally left to\n the size preset, not this variant. */.variant-brand.svelte-1j9w5l4 {--_btn-color: transparent;--_btn-text-color: #ffffff;--_btn-border: none;--_btn-hover-color: transparent;--_btn-hover-text-color: #ffffff;--_btn-hover-border: none;}\n\n /* ---- Size defaults (md reproduces the legacy 16px padding / 14px font) ---- */.size-sm.svelte-1j9w5l4 {--_btn-padding: 8px 12px;--_btn-font-size: 13px;}.size-md.svelte-1j9w5l4 {--_btn-padding: 16px;--_btn-font-size: 14px;}.size-lg.svelte-1j9w5l4 {--_btn-padding: 20px 28px;--_btn-font-size: 16px;}.icon-only.svelte-1j9w5l4 {--_btn-padding: 8px;}.icon-only.size-sm.svelte-1j9w5l4 {--_btn-padding: 6px;}.icon-only.size-lg.svelte-1j9w5l4 {--_btn-padding: 12px;}.full-width.svelte-1j9w5l4 {--button-width: 100%;}.button-el.svelte-1j9w5l4 {max-height:var(--button-max-height);max-width:var(--button-max-width);min-width:var(--button-min-width);font-family:var(--button-font-family);font-weight:var(--button-font-weight, 500);font-size:var(--button-font-size, var(--_btn-font-size, 14px));background-color:var(--button-color, var(--_btn-color, #3a4550));\n /* Image layer, deliberately not the `background` shorthand — the shorthand\n would reset a consumer's own background-image/position/size layers\n whenever the hook is unset. Gradients go here; solids stay on --button-color. */background-image:var(--button-background, none);color:var(\n --button-text-color,\n var(--_btn-text-color, var(--button-neutral-text-color, white))\n );height:var(--button-height, fit-content);padding:var(--button-padding, var(--_btn-padding, 16px));margin:var(--button-margin);border-radius:var(--button-border-radius, var(--radius, 6px));width:var(--button-width, fit-content);cursor:var(--cursor, pointer);opacity:var(--opacity, 1);border:var(--button-border, var(--_btn-border, none));box-sizing:border-box;text-decoration:var(--button-text-decoration, none);line-height:var(--button-line-height, normal);display:flex;justify-content:var(--button-justify-content, center);align-items:center;flex-direction:var(--button-content-flex-direction, row);gap:var(--button-content-gap, 16px);visibility:var(--button-visibility, visible);box-shadow:var(--button-box-shadow, none);transition:var(--button-transition, none);\n\n /* A button label should never soft-wrap onto a second line as the label text\n changes (e.g. \"Select\" -> \"Select (1)\") — that jitters the layout around it.\n Consumers that genuinely want multi-line buttons opt back in via the var. */white-space:var(--button-white-space, nowrap);}.button-el.disabled.svelte-1j9w5l4,\n .button-el.svelte-1j9w5l4:disabled {cursor:var(--disabled-cursor, not-allowed);opacity:var(--disabled-opacity, 0.4);color:var(--disabled-text-color, var(--button-text-color, var(--_btn-text-color, white)));font-size:var(--disabled-font-size, inherit);font-weight:var(--disabled-font-weight, inherit);text-decoration:var(--button-disabled-text-decoration, var(--button-text-decoration, none));\n /* Preserve the variant border when disabled so secondary (bordered) stays distinct from ghost. */border:var(--disabled-border, var(--button-border, var(--_btn-border, none)));background:var(\n --disabled-background-color,\n var(--button-background, var(--button-color, var(--_btn-color, #3a4550)))\n );box-shadow:var(\n --button-disabled-box-shadow,\n var(--disabled-box-shadow, var(--button-box-shadow, none))\n );}.button-loader.svelte-1j9w5l4 {order:var(--button-loader-order, 1);}.button-icon.svelte-1j9w5l4 {order:var(--button-icon-order, 2);display:var(--button-icon-display);}.button-text.svelte-1j9w5l4 {order:var(--button-text-order, 3);display:var(--button-text-display);\n\n /* With nowrap as the default, a label longer than the button's box would\n otherwise bleed past it — truncate with an ellipsis instead. Full labels\n stay available via the button's accessible name / title at the call site. */overflow:hidden;text-overflow:ellipsis;}.button-el.svelte-1j9w5l4:hover:not(.disabled) {background:var(\n --button-hover-color,\n var(\n --_btn-hover-color,\n var(--button-background, var(--button-color, var(--_btn-color, #3a4550)))\n )\n );color:var(\n --button-hover-text-color,\n var(--_btn-hover-text-color, var(--button-text-color, var(--_btn-text-color, white)))\n );border:var(\n --button-hover-border,\n var(--_btn-hover-border, var(--button-border, var(--_btn-border, none)))\n );transform:var(--button-hover-transform);box-shadow:var(--button-hover-box-shadow, var(--button-box-shadow, none));}.button-el.svelte-1j9w5l4:active:not(.disabled) {transform:var(--button-active-transform);background:var(\n --button-active-background,\n var(--button-background, var(--button-color, var(--_btn-color, #3a4550)))\n );box-shadow:var(--button-active-box-shadow, var(--button-box-shadow, none));}.button-el.svelte-1j9w5l4:focus-visible {box-shadow:var(--button-focus-visible-box-shadow, var(--button-box-shadow, none));}.button-progress-bar.svelte-1j9w5l4 {position:absolute;height:100%;width:100%;background:var(--button-progress-loader-background-color, #00000030);\n animation: svelte-1j9w5l4-fill-loader var(--button-progress-loader-duration, 8s) forwards;z-index:2;}\n\n @keyframes svelte-1j9w5l4-fill-loader {\n 0% {\n width: 0;\n }\n\n 100% {\n width: 100%;\n }\n }\n\n /* This bar is not indefinite like a spinner -- its width IS the meaning:\n \"how much of `--button-progress-loader-duration` has elapsed\", and\n `showProgressBar` keeps the button disabled for that whole span. A bare\n `animation: none` would freeze it at the base rule above (`width: 100%`),\n showing a FULL, \"finished\" bar for up to 8s while the button is actually\n still counting down and still disabled -- a frame that means something\n else is worse than the motion it removed. Freezing at 0% instead would\n lie the other way once the real duration elapses and the bar should read\n complete. Neither static width is honest for the whole span, so motion is\n thinned rather than removed: `steps()` swaps the continuous ease for\n discrete jumps that hold the PRIOR interval's value until each jump (the\n `jump-end` default), so the displayed width can only ever under-report\n elapsed time -- never claim to be further along than it really is -- while\n still losing the smooth per-frame slide prefers-reduced-motion targets.\n The step count is a LITERAL, deliberately not a token. `steps()` is invalid\n for a count below 1, and an invalid value does not fall back to a safer\n stepped default -- the whole declaration is dropped and the property takes\n the base rule's `ease`, restoring exactly the continuous slide this block\n exists to remove. A consumer passing `0` to \"just freeze it\" would silently\n switch the guard off for every user who asked for reduced motion. A guard\n that fails OPEN, quietly, is worse than no guard, and one tunable is not\n worth that. \n This block lives in the component's own <style> because that is the only\n stylesheet that reaches inside the shadow root a custom-element consumer\n gets. */\n @media (prefers-reduced-motion: reduce) {.button-progress-bar.svelte-1j9w5l4 {animation-timing-function:steps(5, jump-end);}\n\n /* The loader is not the only motion here. `--button-transition` defaults to\n `none`, so this rule does nothing until a consumer opts in -- and the\n documented way to opt in is exactly a hover/press animation, which is\n what a user asking for reduced motion is asking not to have. The sweep\n that covered every transition in ThemeSwitcher stopped at the one\n animation the brief named in this file. */.button-el.svelte-1j9w5l4,\n .button-container.svelte-1j9w5l4 {transition:none;}\n }"
|
|
4683
|
+
code: ".button-container.svelte-1j9w5l4 {position:relative;width:var(--button-width, fit-content);}\n\n /* The statusText region: out of flow at 1x1px inside the positioned\n container, so it never moves the button or its row (the visually-hidden\n recipe ChatComposer and Label use). Not named .sr-only: `classes` lands on\n this container, so a consumer's own `sr-only` class would match a rule of\n that name here and hide the whole button. */.button-status.svelte-1j9w5l4 {position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);clip-path:inset(50%);white-space:nowrap;border-width:0;}\n\n /* ---- Variant defaults (set the internal --_btn-* layer; explicit --button-* always wins) ---- */.variant-primary.svelte-1j9w5l4 {--_btn-color: #3a4550;--_btn-text-color: #ffffff;--_btn-border: none;}.variant-secondary.svelte-1j9w5l4 {--_btn-color: transparent;--_btn-text-color: var(--button-secondary-text-color, #3a4550);--_btn-border: 1px solid var(--button-secondary-border-color, #cbd5e1);--_btn-hover-color: var(--button-secondary-hover-background, #f1f5f9);--_btn-hover-text-color: var(--button-secondary-text-color, #3a4550);--_btn-hover-border: 1px solid var(--button-secondary-border-color, #cbd5e1);}.variant-ghost.svelte-1j9w5l4 {--_btn-color: transparent;--_btn-text-color: var(--button-ghost-text-color, #3a4550);--_btn-border: none;--_btn-hover-color: var(--button-ghost-hover-background, #f1f5f9);--_btn-hover-text-color: var(--button-ghost-text-color, #3a4550);--_btn-hover-border: none;}.variant-destructive.svelte-1j9w5l4 {--_btn-color: #e7000b;--_btn-text-color: #ffffff;--_btn-border: none;--_btn-hover-color: #c10007;--_btn-hover-text-color: #ffffff;--_btn-hover-border: none;}\n\n /* Transparent chassis for gradient marketing CTAs — deliberately no background\n of its own. Pair with a --button-background gradient (and usually a matching\n --button-hover-color, since --_btn-hover-color sits before --button-background\n in the hover fallback chain and would otherwise flatten the gradient to\n transparent on hover). Geometry (padding/font-size) is intentionally left to\n the size preset, not this variant. */.variant-brand.svelte-1j9w5l4 {--_btn-color: transparent;--_btn-text-color: #ffffff;--_btn-border: none;--_btn-hover-color: transparent;--_btn-hover-text-color: #ffffff;--_btn-hover-border: none;}\n\n /* ---- Size defaults (md reproduces the legacy 16px padding / 14px font) ---- */.size-sm.svelte-1j9w5l4 {--_btn-padding: 8px 12px;--_btn-font-size: 13px;}.size-md.svelte-1j9w5l4 {--_btn-padding: 16px;--_btn-font-size: 14px;}.size-lg.svelte-1j9w5l4 {--_btn-padding: 20px 28px;--_btn-font-size: 16px;}.icon-only.svelte-1j9w5l4 {--_btn-padding: 8px;}.icon-only.size-sm.svelte-1j9w5l4 {--_btn-padding: 6px;}.icon-only.size-lg.svelte-1j9w5l4 {--_btn-padding: 12px;}.full-width.svelte-1j9w5l4 {--button-width: 100%;}\n\n /* Opt-in only. With the default nowrap label, fit-content never drops below the\n label's full width, so a percentage cap on the inner button resolves against\n an already label-wide container and a Button in a parent narrower than its\n label (a flex row, a grid cell or a plain block) cannot shrink. Capping the\n container itself gives that percentage something real to resolve against.\n\n The box is `width: 100%` bounded by `max-width: max-content` rather than\n `fit-content`: as wide as the label and never wider than the parent, with no\n intrinsic keyword as its width. Firefox and WebKit size a `1fr` or `auto`\n grid track to at least the content width of an item whose width is such a\n keyword, so the track grew to the label and the Button never shrank in a grid\n cell (Chromium shrinks the track). A percentage is not counted that way.\n `width: auto` would shrink the track too, but it stretches the box across a\n block, stretch or `justify-items: normal` parent, and `margin: auto` on the\n root would stop centring it. As a flex item the box is clamped to the\n label's width, so `flex-grow` on the root does not widen it. A custom\n `--button-width` replaces the max-content bound, and `fullWidth` sets it\n to 100%.\n\n Deliberately class-gated rather than a pair of tokens on every container: an\n unconditional declaration here would outrank a consumer's own max-width class\n on the root (the scoped selector is more specific). The class carries the\n component prefix because `classes` lands on this same element, and a\n consumer's own `shrinkable` class must not opt a Button in. */.button-container.button-shrinkable.svelte-1j9w5l4 {min-width:0;width:100%;max-width:var(--button-width, max-content);}.button-container.button-shrinkable.svelte-1j9w5l4 > .button-el:where(.svelte-1j9w5l4) {max-width:var(--button-max-width, 100%);}\n\n /* An icon with a percentage max-width (the common `img { max-width: 100% }`\n reset) has a min-content width of zero, so the shrinking button would\n squeeze it along with the label. */.button-container.button-shrinkable.svelte-1j9w5l4 > .button-el:where(.svelte-1j9w5l4) > .button-icon:where(.svelte-1j9w5l4) {flex-shrink:0;}.button-el.svelte-1j9w5l4 {max-height:var(--button-max-height);max-width:var(--button-max-width);min-width:var(--button-min-width);font-family:var(--button-font-family);font-weight:var(--button-font-weight, 500);font-size:var(--button-font-size, var(--_btn-font-size, 14px));background-color:var(--button-color, var(--_btn-color, #3a4550));\n /* Image layer, deliberately not the `background` shorthand — the shorthand\n would reset a consumer's own background-image/position/size layers\n whenever the hook is unset. Gradients go here; solids stay on --button-color. */background-image:var(--button-background, none);color:var(\n --button-text-color,\n var(--_btn-text-color, var(--button-neutral-text-color, white))\n );height:var(--button-height, fit-content);padding:var(--button-padding, var(--_btn-padding, 16px));margin:var(--button-margin);border-radius:var(--button-border-radius, var(--radius, 6px));width:var(--button-width, fit-content);cursor:var(--cursor, pointer);opacity:var(--opacity, 1);border:var(--button-border, var(--_btn-border, none));box-sizing:border-box;text-decoration:var(--button-text-decoration, none);line-height:var(--button-line-height, normal);display:flex;justify-content:var(--button-justify-content, center);align-items:center;flex-direction:var(--button-content-flex-direction, row);gap:var(--button-content-gap, 16px);visibility:var(--button-visibility, visible);box-shadow:var(--button-box-shadow, none);transition:var(--button-transition, none);\n\n /* A button label should never soft-wrap onto a second line as the label text\n changes (e.g. \"Select\" -> \"Select (1)\") — that jitters the layout around it.\n Consumers that genuinely want multi-line buttons opt back in via the var. */white-space:var(--button-white-space, nowrap);}.button-el.disabled.svelte-1j9w5l4,\n .button-el.svelte-1j9w5l4:disabled {cursor:var(--disabled-cursor, not-allowed);opacity:var(--disabled-opacity, 0.4);color:var(--disabled-text-color, var(--button-text-color, var(--_btn-text-color, white)));font-size:var(--disabled-font-size, inherit);font-weight:var(--disabled-font-weight, inherit);text-decoration:var(--button-disabled-text-decoration, var(--button-text-decoration, none));\n /* Preserve the variant border when disabled so secondary (bordered) stays distinct from ghost. */border:var(--disabled-border, var(--button-border, var(--_btn-border, none)));background:var(\n --disabled-background-color,\n var(--button-background, var(--button-color, var(--_btn-color, #3a4550)))\n );box-shadow:var(\n --button-disabled-box-shadow,\n var(--disabled-box-shadow, var(--button-box-shadow, none))\n );}.button-loader.svelte-1j9w5l4 {order:var(--button-loader-order, 1);}.button-icon.svelte-1j9w5l4 {order:var(--button-icon-order, 2);display:var(--button-icon-display);}.button-text.svelte-1j9w5l4 {order:var(--button-text-order, 3);display:var(--button-text-display);\n\n /* With nowrap as the default, a label longer than the button's box would\n otherwise bleed past it — truncate with an ellipsis instead. Full labels\n stay available via the button's accessible name / title at the call site. */overflow:hidden;text-overflow:ellipsis;}.button-el.svelte-1j9w5l4:hover:not(.disabled) {background:var(\n --button-hover-color,\n var(\n --_btn-hover-color,\n var(--button-background, var(--button-color, var(--_btn-color, #3a4550)))\n )\n );color:var(\n --button-hover-text-color,\n var(--_btn-hover-text-color, var(--button-text-color, var(--_btn-text-color, white)))\n );border:var(\n --button-hover-border,\n var(--_btn-hover-border, var(--button-border, var(--_btn-border, none)))\n );transform:var(--button-hover-transform);box-shadow:var(--button-hover-box-shadow, var(--button-box-shadow, none));}.button-el.svelte-1j9w5l4:active:not(.disabled) {transform:var(--button-active-transform);background:var(\n --button-active-background,\n var(--button-background, var(--button-color, var(--_btn-color, #3a4550)))\n );box-shadow:var(--button-active-box-shadow, var(--button-box-shadow, none));}.button-el.svelte-1j9w5l4:focus-visible {box-shadow:var(--button-focus-visible-box-shadow, var(--button-box-shadow, none));}.button-progress-bar.svelte-1j9w5l4 {position:absolute;height:100%;width:100%;background:var(--button-progress-loader-background-color, #00000030);\n animation: svelte-1j9w5l4-fill-loader var(--button-progress-loader-duration, 8s) forwards;z-index:2;}\n\n @keyframes svelte-1j9w5l4-fill-loader {\n 0% {\n width: 0;\n }\n\n 100% {\n width: 100%;\n }\n }\n\n /* This bar is not indefinite like a spinner -- its width IS the meaning:\n \"how much of `--button-progress-loader-duration` has elapsed\", and\n `showProgressBar` keeps the button disabled for that whole span. A bare\n `animation: none` would freeze it at the base rule above (`width: 100%`),\n showing a FULL, \"finished\" bar for up to 8s while the button is actually\n still counting down and still disabled -- a frame that means something\n else is worse than the motion it removed. Freezing at 0% instead would\n lie the other way once the real duration elapses and the bar should read\n complete. Neither static width is honest for the whole span, so motion is\n thinned rather than removed: `steps()` swaps the continuous ease for\n discrete jumps that hold the PRIOR interval's value until each jump (the\n `jump-end` default), so the displayed width can only ever under-report\n elapsed time -- never claim to be further along than it really is -- while\n still losing the smooth per-frame slide prefers-reduced-motion targets.\n The step count is a LITERAL, deliberately not a token. `steps()` is invalid\n for a count below 1, and an invalid value does not fall back to a safer\n stepped default -- the whole declaration is dropped and the property takes\n the base rule's `ease`, restoring exactly the continuous slide this block\n exists to remove. A consumer passing `0` to \"just freeze it\" would silently\n switch the guard off for every user who asked for reduced motion. A guard\n that fails OPEN, quietly, is worse than no guard, and one tunable is not\n worth that. \n This block lives in the component's own <style> because that is the only\n stylesheet that reaches inside the shadow root a custom-element consumer\n gets. */\n @media (prefers-reduced-motion: reduce) {.button-progress-bar.svelte-1j9w5l4 {animation-timing-function:steps(5, jump-end);}\n\n /* The loader is not the only motion here. `--button-transition` defaults to\n `none`, so this rule does nothing until a consumer opts in -- and the\n documented way to opt in is exactly a hover/press animation, which is\n what a user asking for reduced motion is asking not to have. The sweep\n that covered every transition in ThemeSwitcher stopped at the one\n animation the brief named in this file. */.button-el.svelte-1j9w5l4,\n .button-container.svelte-1j9w5l4 {transition:none;}\n }"
|
|
4684
4684
|
};
|
|
4685
4685
|
function Button(e, t) {
|
|
4686
4686
|
push(t, !0), append_styles$1(e, $$css$196);
|
|
4687
|
-
let n = prop(t, "text", 7), i = prop(t, "variant", 7, "primary"), a = prop(t, "size", 7, "md"), o = prop(t, "iconOnly", 7, !1), s = prop(t, "fullWidth", 7, !1), c = prop(t, "
|
|
4688
|
-
function
|
|
4689
|
-
if (get(
|
|
4690
|
-
|
|
4687
|
+
let n = prop(t, "text", 7), i = prop(t, "variant", 7, "primary"), a = prop(t, "size", 7, "md"), o = prop(t, "iconOnly", 7, !1), s = prop(t, "fullWidth", 7, !1), c = prop(t, "shrinkable", 7, !1), l = prop(t, "href", 7), u = prop(t, "target", 7), f = prop(t, "rel", 7), p = prop(t, "loading", 7, !1), h = prop(t, "allowHtml", 7, !1), S = prop(t, "enable", 7, !0), C = prop(t, "disabled", 7, !1), k = prop(t, "showLoader", 7, !1), R = prop(t, "loaderType", 7), te = prop(t, "showProgressBar", 15, !1), ne = prop(t, "type", 7, "button"), G = prop(t, "testId", 7), re = prop(t, "ariaLabel", 7), be = prop(t, "ariaExpanded", 7), Me = prop(t, "ariaControls", 7), Re = prop(t, "ariaHaspopup", 7), Ue = prop(t, "ariaSelected", 7), it = prop(t, "ariaPressed", 7), at = prop(t, "ariaBusy", 7), ot = prop(t, "role", 7), ct = prop(t, "title", 7), lt = prop(t, "statusText", 7), ut = prop(t, "statusTestId", 7), dt = prop(t, "onclick", 7), ft = prop(t, "onkeydown", 7, () => {}), pt = prop(t, "onkeyup", 7, () => {}), mt = prop(t, "onmousedown", 7), ht = prop(t, "onmouseup", 7), gt = prop(t, "onmouseleave", 7), _t = prop(t, "ontouchstart", 7), vt = prop(t, "ontouchend", 7), yt = prop(t, "icon", 7), bt = prop(t, "children", 7), xt = prop(t, "classes", 7), St = prop(t, "style", 7), Ct = /* @__PURE__ */ user_derived(() => p() || k() && R() === "Circular"), wt = /* @__PURE__ */ user_derived(() => k() && R() === "ProgressBar"), Tt = /* @__PURE__ */ user_derived(() => get(Ct) || te()), Et = /* @__PURE__ */ user_derived(() => C() || !S() || get(Ct) || te()), Dt = /* @__PURE__ */ user_derived(() => f() ?? (u() === "_blank" ? "noopener noreferrer" : null));
|
|
4688
|
+
function Ot(e) {
|
|
4689
|
+
if (get(Et)) {
|
|
4690
|
+
l() && e.preventDefault();
|
|
4691
4691
|
return;
|
|
4692
4692
|
}
|
|
4693
|
-
|
|
4693
|
+
dt()?.(e), get(wt) && te(!0);
|
|
4694
4694
|
}
|
|
4695
|
-
var
|
|
4695
|
+
var kt = {
|
|
4696
4696
|
get text() {
|
|
4697
4697
|
return n();
|
|
4698
4698
|
},
|
|
@@ -4723,271 +4723,277 @@ function Button(e, t) {
|
|
|
4723
4723
|
set fullWidth(e = !1) {
|
|
4724
4724
|
s(e), flushSync();
|
|
4725
4725
|
},
|
|
4726
|
-
get
|
|
4726
|
+
get shrinkable() {
|
|
4727
4727
|
return c();
|
|
4728
4728
|
},
|
|
4729
|
-
set
|
|
4729
|
+
set shrinkable(e = !1) {
|
|
4730
4730
|
c(e), flushSync();
|
|
4731
4731
|
},
|
|
4732
|
-
get
|
|
4732
|
+
get href() {
|
|
4733
4733
|
return l();
|
|
4734
4734
|
},
|
|
4735
|
-
set
|
|
4735
|
+
set href(e) {
|
|
4736
4736
|
l(e), flushSync();
|
|
4737
4737
|
},
|
|
4738
|
-
get
|
|
4738
|
+
get target() {
|
|
4739
4739
|
return u();
|
|
4740
4740
|
},
|
|
4741
|
-
set
|
|
4741
|
+
set target(e) {
|
|
4742
4742
|
u(e), flushSync();
|
|
4743
4743
|
},
|
|
4744
|
-
get
|
|
4744
|
+
get rel() {
|
|
4745
4745
|
return f();
|
|
4746
4746
|
},
|
|
4747
|
-
set
|
|
4747
|
+
set rel(e) {
|
|
4748
4748
|
f(e), flushSync();
|
|
4749
4749
|
},
|
|
4750
|
-
get
|
|
4750
|
+
get loading() {
|
|
4751
4751
|
return p();
|
|
4752
4752
|
},
|
|
4753
|
-
set
|
|
4753
|
+
set loading(e = !1) {
|
|
4754
4754
|
p(e), flushSync();
|
|
4755
4755
|
},
|
|
4756
|
-
get
|
|
4756
|
+
get allowHtml() {
|
|
4757
4757
|
return h();
|
|
4758
4758
|
},
|
|
4759
|
-
set
|
|
4759
|
+
set allowHtml(e = !1) {
|
|
4760
4760
|
h(e), flushSync();
|
|
4761
4761
|
},
|
|
4762
|
-
get
|
|
4762
|
+
get enable() {
|
|
4763
4763
|
return S();
|
|
4764
4764
|
},
|
|
4765
|
-
set
|
|
4765
|
+
set enable(e = !0) {
|
|
4766
4766
|
S(e), flushSync();
|
|
4767
4767
|
},
|
|
4768
|
-
get
|
|
4768
|
+
get disabled() {
|
|
4769
4769
|
return C();
|
|
4770
4770
|
},
|
|
4771
|
-
set
|
|
4771
|
+
set disabled(e = !1) {
|
|
4772
4772
|
C(e), flushSync();
|
|
4773
4773
|
},
|
|
4774
|
-
get
|
|
4774
|
+
get showLoader() {
|
|
4775
4775
|
return k();
|
|
4776
4776
|
},
|
|
4777
|
-
set
|
|
4777
|
+
set showLoader(e = !1) {
|
|
4778
4778
|
k(e), flushSync();
|
|
4779
4779
|
},
|
|
4780
|
-
get
|
|
4780
|
+
get loaderType() {
|
|
4781
4781
|
return R();
|
|
4782
4782
|
},
|
|
4783
|
-
set
|
|
4783
|
+
set loaderType(e) {
|
|
4784
4784
|
R(e), flushSync();
|
|
4785
4785
|
},
|
|
4786
|
-
get
|
|
4786
|
+
get showProgressBar() {
|
|
4787
4787
|
return te();
|
|
4788
4788
|
},
|
|
4789
|
-
set
|
|
4789
|
+
set showProgressBar(e = !1) {
|
|
4790
4790
|
te(e), flushSync();
|
|
4791
4791
|
},
|
|
4792
|
-
get
|
|
4792
|
+
get type() {
|
|
4793
4793
|
return ne();
|
|
4794
4794
|
},
|
|
4795
|
-
set
|
|
4795
|
+
set type(e = "button") {
|
|
4796
4796
|
ne(e), flushSync();
|
|
4797
4797
|
},
|
|
4798
|
-
get
|
|
4798
|
+
get testId() {
|
|
4799
4799
|
return G();
|
|
4800
4800
|
},
|
|
4801
|
-
set
|
|
4801
|
+
set testId(e) {
|
|
4802
4802
|
G(e), flushSync();
|
|
4803
4803
|
},
|
|
4804
|
-
get
|
|
4804
|
+
get ariaLabel() {
|
|
4805
4805
|
return re();
|
|
4806
4806
|
},
|
|
4807
|
-
set
|
|
4807
|
+
set ariaLabel(e) {
|
|
4808
4808
|
re(e), flushSync();
|
|
4809
4809
|
},
|
|
4810
|
-
get
|
|
4810
|
+
get ariaExpanded() {
|
|
4811
4811
|
return be();
|
|
4812
4812
|
},
|
|
4813
|
-
set
|
|
4813
|
+
set ariaExpanded(e) {
|
|
4814
4814
|
be(e), flushSync();
|
|
4815
4815
|
},
|
|
4816
|
-
get
|
|
4816
|
+
get ariaControls() {
|
|
4817
4817
|
return Me();
|
|
4818
4818
|
},
|
|
4819
|
-
set
|
|
4819
|
+
set ariaControls(e) {
|
|
4820
4820
|
Me(e), flushSync();
|
|
4821
4821
|
},
|
|
4822
|
-
get
|
|
4822
|
+
get ariaHaspopup() {
|
|
4823
4823
|
return Re();
|
|
4824
4824
|
},
|
|
4825
|
-
set
|
|
4825
|
+
set ariaHaspopup(e) {
|
|
4826
4826
|
Re(e), flushSync();
|
|
4827
4827
|
},
|
|
4828
|
-
get
|
|
4828
|
+
get ariaSelected() {
|
|
4829
4829
|
return Ue();
|
|
4830
4830
|
},
|
|
4831
|
-
set
|
|
4831
|
+
set ariaSelected(e) {
|
|
4832
4832
|
Ue(e), flushSync();
|
|
4833
4833
|
},
|
|
4834
|
-
get
|
|
4834
|
+
get ariaPressed() {
|
|
4835
4835
|
return it();
|
|
4836
4836
|
},
|
|
4837
|
-
set
|
|
4837
|
+
set ariaPressed(e) {
|
|
4838
4838
|
it(e), flushSync();
|
|
4839
4839
|
},
|
|
4840
|
-
get
|
|
4840
|
+
get ariaBusy() {
|
|
4841
4841
|
return at();
|
|
4842
4842
|
},
|
|
4843
|
-
set
|
|
4843
|
+
set ariaBusy(e) {
|
|
4844
4844
|
at(e), flushSync();
|
|
4845
4845
|
},
|
|
4846
|
-
get
|
|
4846
|
+
get role() {
|
|
4847
4847
|
return ot();
|
|
4848
4848
|
},
|
|
4849
|
-
set
|
|
4849
|
+
set role(e) {
|
|
4850
4850
|
ot(e), flushSync();
|
|
4851
4851
|
},
|
|
4852
|
-
get
|
|
4852
|
+
get title() {
|
|
4853
4853
|
return ct();
|
|
4854
4854
|
},
|
|
4855
|
-
set
|
|
4855
|
+
set title(e) {
|
|
4856
4856
|
ct(e), flushSync();
|
|
4857
4857
|
},
|
|
4858
|
-
get
|
|
4858
|
+
get statusText() {
|
|
4859
4859
|
return lt();
|
|
4860
4860
|
},
|
|
4861
|
-
set
|
|
4861
|
+
set statusText(e) {
|
|
4862
4862
|
lt(e), flushSync();
|
|
4863
4863
|
},
|
|
4864
|
-
get
|
|
4864
|
+
get statusTestId() {
|
|
4865
4865
|
return ut();
|
|
4866
4866
|
},
|
|
4867
|
-
set
|
|
4867
|
+
set statusTestId(e) {
|
|
4868
4868
|
ut(e), flushSync();
|
|
4869
4869
|
},
|
|
4870
|
-
get
|
|
4870
|
+
get onclick() {
|
|
4871
4871
|
return dt();
|
|
4872
4872
|
},
|
|
4873
|
-
set
|
|
4873
|
+
set onclick(e) {
|
|
4874
4874
|
dt(e), flushSync();
|
|
4875
4875
|
},
|
|
4876
|
-
get
|
|
4876
|
+
get onkeydown() {
|
|
4877
4877
|
return ft();
|
|
4878
4878
|
},
|
|
4879
|
-
set
|
|
4879
|
+
set onkeydown(e = () => {}) {
|
|
4880
4880
|
ft(e), flushSync();
|
|
4881
4881
|
},
|
|
4882
|
-
get
|
|
4882
|
+
get onkeyup() {
|
|
4883
4883
|
return pt();
|
|
4884
4884
|
},
|
|
4885
|
-
set
|
|
4885
|
+
set onkeyup(e = () => {}) {
|
|
4886
4886
|
pt(e), flushSync();
|
|
4887
4887
|
},
|
|
4888
|
-
get
|
|
4888
|
+
get onmousedown() {
|
|
4889
4889
|
return mt();
|
|
4890
4890
|
},
|
|
4891
|
-
set
|
|
4891
|
+
set onmousedown(e) {
|
|
4892
4892
|
mt(e), flushSync();
|
|
4893
4893
|
},
|
|
4894
|
-
get
|
|
4894
|
+
get onmouseup() {
|
|
4895
4895
|
return ht();
|
|
4896
4896
|
},
|
|
4897
|
-
set
|
|
4897
|
+
set onmouseup(e) {
|
|
4898
4898
|
ht(e), flushSync();
|
|
4899
4899
|
},
|
|
4900
|
-
get
|
|
4900
|
+
get onmouseleave() {
|
|
4901
4901
|
return gt();
|
|
4902
4902
|
},
|
|
4903
|
-
set
|
|
4903
|
+
set onmouseleave(e) {
|
|
4904
4904
|
gt(e), flushSync();
|
|
4905
4905
|
},
|
|
4906
|
-
get
|
|
4906
|
+
get ontouchstart() {
|
|
4907
4907
|
return _t();
|
|
4908
4908
|
},
|
|
4909
|
-
set
|
|
4909
|
+
set ontouchstart(e) {
|
|
4910
4910
|
_t(e), flushSync();
|
|
4911
4911
|
},
|
|
4912
|
-
get
|
|
4912
|
+
get ontouchend() {
|
|
4913
4913
|
return vt();
|
|
4914
4914
|
},
|
|
4915
|
-
set
|
|
4915
|
+
set ontouchend(e) {
|
|
4916
4916
|
vt(e), flushSync();
|
|
4917
4917
|
},
|
|
4918
|
-
get
|
|
4918
|
+
get icon() {
|
|
4919
4919
|
return yt();
|
|
4920
4920
|
},
|
|
4921
|
-
set
|
|
4921
|
+
set icon(e) {
|
|
4922
4922
|
yt(e), flushSync();
|
|
4923
4923
|
},
|
|
4924
|
-
get
|
|
4924
|
+
get children() {
|
|
4925
4925
|
return bt();
|
|
4926
4926
|
},
|
|
4927
|
-
set
|
|
4927
|
+
set children(e) {
|
|
4928
4928
|
bt(e), flushSync();
|
|
4929
4929
|
},
|
|
4930
|
-
get
|
|
4930
|
+
get classes() {
|
|
4931
4931
|
return xt();
|
|
4932
4932
|
},
|
|
4933
|
-
set
|
|
4933
|
+
set classes(e) {
|
|
4934
4934
|
xt(e), flushSync();
|
|
4935
|
+
},
|
|
4936
|
+
get style() {
|
|
4937
|
+
return St();
|
|
4938
|
+
},
|
|
4939
|
+
set style(e) {
|
|
4940
|
+
St(e), flushSync();
|
|
4935
4941
|
}
|
|
4936
|
-
},
|
|
4937
|
-
let
|
|
4938
|
-
var
|
|
4942
|
+
}, At = root_7$32();
|
|
4943
|
+
let jt;
|
|
4944
|
+
var Mt = child(At), Nt = (e) => {
|
|
4939
4945
|
append(e, root$107());
|
|
4940
4946
|
};
|
|
4941
|
-
if_block(
|
|
4942
|
-
|
|
4947
|
+
if_block(Mt, (e) => {
|
|
4948
|
+
te() && e(Nt);
|
|
4943
4949
|
});
|
|
4944
|
-
var
|
|
4945
|
-
element(
|
|
4950
|
+
var Pt = sibling(Mt, 2);
|
|
4951
|
+
element(Pt, () => l() ? "a" : "button", !1, (e, t) => {
|
|
4946
4952
|
attribute_effect(e, () => ({
|
|
4947
4953
|
class: "button-el",
|
|
4948
|
-
onclick:
|
|
4949
|
-
onkeydown:
|
|
4950
|
-
onkeyup:
|
|
4951
|
-
onmousedown:
|
|
4952
|
-
onmouseup:
|
|
4953
|
-
onmouseleave:
|
|
4954
|
-
ontouchstart:
|
|
4955
|
-
ontouchend:
|
|
4956
|
-
"data-pw":
|
|
4957
|
-
testID:
|
|
4958
|
-
role:
|
|
4959
|
-
"aria-label":
|
|
4960
|
-
"aria-expanded":
|
|
4961
|
-
"aria-controls":
|
|
4962
|
-
"aria-haspopup":
|
|
4963
|
-
"aria-selected":
|
|
4964
|
-
"aria-pressed":
|
|
4965
|
-
"aria-busy": get(
|
|
4966
|
-
title:
|
|
4967
|
-
type:
|
|
4968
|
-
disabled:
|
|
4969
|
-
href:
|
|
4970
|
-
target:
|
|
4971
|
-
rel:
|
|
4972
|
-
"aria-disabled":
|
|
4973
|
-
tabindex:
|
|
4974
|
-
[CLASS]: { disabled: get(
|
|
4954
|
+
onclick: Ot,
|
|
4955
|
+
onkeydown: ft(),
|
|
4956
|
+
onkeyup: pt(),
|
|
4957
|
+
onmousedown: mt(),
|
|
4958
|
+
onmouseup: ht(),
|
|
4959
|
+
onmouseleave: gt(),
|
|
4960
|
+
ontouchstart: _t(),
|
|
4961
|
+
ontouchend: vt(),
|
|
4962
|
+
"data-pw": G(),
|
|
4963
|
+
testID: G(),
|
|
4964
|
+
role: ot() ?? null,
|
|
4965
|
+
"aria-label": re() ?? null,
|
|
4966
|
+
"aria-expanded": be() ?? null,
|
|
4967
|
+
"aria-controls": Me() ?? null,
|
|
4968
|
+
"aria-haspopup": Re() ?? null,
|
|
4969
|
+
"aria-selected": Ue() ?? null,
|
|
4970
|
+
"aria-pressed": it() ?? null,
|
|
4971
|
+
"aria-busy": get(Tt) || at() || null,
|
|
4972
|
+
title: ct() ?? null,
|
|
4973
|
+
type: l() ? null : ne(),
|
|
4974
|
+
disabled: l() ? null : get(Et),
|
|
4975
|
+
href: l() ? get(Et) ? null : l() : null,
|
|
4976
|
+
target: l() ? u() : null,
|
|
4977
|
+
rel: l() ? get(Dt) : null,
|
|
4978
|
+
"aria-disabled": l() && get(Et) ? "true" : null,
|
|
4979
|
+
tabindex: l() && get(Et) ? -1 : null,
|
|
4980
|
+
[CLASS]: { disabled: get(Et) }
|
|
4975
4981
|
}), void 0, void 0, void 0, "svelte-1j9w5l4");
|
|
4976
4982
|
var i = root_5$42(), a = first_child(i), o = (e) => {
|
|
4977
4983
|
var t = root_1$95();
|
|
4978
4984
|
Loader(child(t), {}), reset(t), append(e, t);
|
|
4979
4985
|
};
|
|
4980
4986
|
if_block(a, (e) => {
|
|
4981
|
-
get(
|
|
4987
|
+
get(Ct) && e(o);
|
|
4982
4988
|
});
|
|
4983
|
-
var s = sibling(a, 2),
|
|
4989
|
+
var s = sibling(a, 2), c = (e) => {
|
|
4984
4990
|
var t = root_2$74();
|
|
4985
|
-
snippet(child(t),
|
|
4991
|
+
snippet(child(t), yt), reset(t), append(e, t);
|
|
4986
4992
|
};
|
|
4987
4993
|
if_block(s, (e) => {
|
|
4988
|
-
typeof
|
|
4994
|
+
typeof yt() == "function" && e(c);
|
|
4989
4995
|
});
|
|
4990
|
-
var f = sibling(s, 2),
|
|
4996
|
+
var f = sibling(s, 2), p = (e) => {
|
|
4991
4997
|
var t = comment(), i = first_child(t), a = (e) => {
|
|
4992
4998
|
var t = root_3$66();
|
|
4993
4999
|
html(t, n, !0), reset(t), append(e, t);
|
|
@@ -4996,34 +5002,35 @@ function Button(e, t) {
|
|
|
4996
5002
|
reset(t), template_effect(() => set_text(i, n())), append(e, t);
|
|
4997
5003
|
};
|
|
4998
5004
|
if_block(i, (e) => {
|
|
4999
|
-
|
|
5005
|
+
h() ? e(a) : e(o, -1);
|
|
5000
5006
|
}), append(e, t);
|
|
5001
5007
|
};
|
|
5002
5008
|
if_block(f, (e) => {
|
|
5003
|
-
typeof n() == "string" && n().length > 0 && e(
|
|
5009
|
+
typeof n() == "string" && n().length > 0 && e(p);
|
|
5004
5010
|
});
|
|
5005
5011
|
var S = sibling(f, 2), C = (e) => {
|
|
5006
5012
|
var t = comment();
|
|
5007
|
-
snippet(first_child(t),
|
|
5013
|
+
snippet(first_child(t), bt), append(e, t);
|
|
5008
5014
|
};
|
|
5009
5015
|
if_block(S, (e) => {
|
|
5010
|
-
typeof
|
|
5016
|
+
typeof bt() == "function" && e(C);
|
|
5011
5017
|
}), append(t, i);
|
|
5012
5018
|
});
|
|
5013
|
-
var
|
|
5019
|
+
var It = sibling(Pt, 2), Lt = (e) => {
|
|
5014
5020
|
var t = root_6$36(), n = child(t, !0);
|
|
5015
5021
|
reset(t), template_effect(() => {
|
|
5016
|
-
set_attribute(t, "data-pw",
|
|
5022
|
+
set_attribute(t, "data-pw", ut() ?? null), set_text(n, lt());
|
|
5017
5023
|
}), append(e, t);
|
|
5018
5024
|
};
|
|
5019
|
-
return if_block(
|
|
5020
|
-
typeof
|
|
5021
|
-
}), reset(
|
|
5022
|
-
|
|
5025
|
+
return if_block(It, (e) => {
|
|
5026
|
+
typeof lt() == "string" && e(Lt);
|
|
5027
|
+
}), reset(At), template_effect(() => {
|
|
5028
|
+
jt = set_class(At, 1, `button-container variant-${i() ?? ""} size-${a() ?? ""} ${xt() ?? "" ?? ""}`, "svelte-1j9w5l4", jt, {
|
|
5023
5029
|
"icon-only": o(),
|
|
5024
|
-
"full-width": s()
|
|
5025
|
-
|
|
5026
|
-
|
|
5030
|
+
"full-width": s(),
|
|
5031
|
+
"button-shrinkable": c()
|
|
5032
|
+
}), set_style(At, St() ?? null);
|
|
5033
|
+
}), append(e, At), pop(kt);
|
|
5027
5034
|
}
|
|
5028
5035
|
create_custom_element(Button, {
|
|
5029
5036
|
text: {},
|
|
@@ -5031,6 +5038,7 @@ create_custom_element(Button, {
|
|
|
5031
5038
|
size: {},
|
|
5032
5039
|
iconOnly: {},
|
|
5033
5040
|
fullWidth: {},
|
|
5041
|
+
shrinkable: {},
|
|
5034
5042
|
href: {},
|
|
5035
5043
|
target: {},
|
|
5036
5044
|
rel: {},
|
|
@@ -16858,12 +16866,14 @@ var rest_excludes$59 = new Set([
|
|
|
16858
16866
|
"buttonAriaPressed"
|
|
16859
16867
|
]), $$css$120 = {
|
|
16860
16868
|
hash: "svelte-94kscb",
|
|
16861
|
-
code: "\n /* A custom element defaults to `display: inline`, which has no definite\n width for a percentage to resolve against -- so a component sizing itself\n with `width: 100%` resolved against the wrong ancestor, and layout depended\n on the consumer's surrounding markup rather than on the component. The value\n matches this component's own root element (block-level), and is a token so a\n consumer can change it without reaching inside the shadow root -- which they\n could not do, since a stylesheet cannot add a rule there. */:host {display:var(--sui-button-display, block);}"
|
|
16869
|
+
code: "\n /* A custom element defaults to `display: inline`, which has no definite\n width for a percentage to resolve against -- so a component sizing itself\n with `width: 100%` resolved against the wrong ancestor, and layout depended\n on the consumer's surrounding markup rather than on the component. The value\n matches this component's own root element (block-level), and is a token so a\n consumer can change it without reaching inside the shadow root -- which they\n could not do, since a stylesheet cannot add a rule there. */:host {display:var(--sui-button-display, block);}\n\n /* In a custom-element consumer the host, not the inner container, is the flex\n or grid item, so it is the box that has to be allowed to shrink. The inner\n container's own rule only caps it at the host's width. */:host([shrinkable]) {min-width:0;max-width:100%;}"
|
|
16862
16870
|
};
|
|
16863
16871
|
function Button_wc(e, t) {
|
|
16864
16872
|
push(t, !0), append_styles$1(e, $$css$120);
|
|
16865
16873
|
let n = prop(t, "buttonAriaExpanded", 7), i = prop(t, "buttonAriaLabel", 7), a = prop(t, "buttonAriaPressed", 7), o = /* @__PURE__ */ rest_props(t, rest_excludes$59), s = t.$$host, c = /* @__PURE__ */ user_derived(() => dispatchEvents(s, o));
|
|
16866
|
-
return
|
|
16874
|
+
return user_effect(() => {
|
|
16875
|
+
s.toggleAttribute("shrinkable", t.shrinkable === !0);
|
|
16876
|
+
}), Button(e, spread_props(() => o, () => get(c), {
|
|
16867
16877
|
get ariaLabel() {
|
|
16868
16878
|
return i();
|
|
16869
16879
|
},
|
|
@@ -17000,6 +17010,10 @@ customElements.define("sui-button", create_custom_element(Button_wc, {
|
|
|
17000
17010
|
attribute: "full-width",
|
|
17001
17011
|
type: "Boolean"
|
|
17002
17012
|
},
|
|
17013
|
+
shrinkable: {
|
|
17014
|
+
attribute: "shrinkable",
|
|
17015
|
+
type: "Boolean"
|
|
17016
|
+
},
|
|
17003
17017
|
href: {
|
|
17004
17018
|
attribute: "href",
|
|
17005
17019
|
type: "String"
|