@juspay/svelte-ui-components 4.54.0 → 4.54.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -134,6 +134,14 @@
134
134
  transform: rotate(90deg);
135
135
  }
136
136
 
137
+ /* The rotate still happens. Only the 120ms slide is removed, so a reduced-motion
138
+ user gets the open or closed chevron immediately instead of watching it turn. */
139
+ @media (prefers-reduced-motion: reduce) {
140
+ .chevron {
141
+ transition: none;
142
+ }
143
+ }
144
+
137
145
  .counts {
138
146
  display: flex;
139
147
  gap: var(--diff-small-gap, 8px);
package/dist/utils.js CHANGED
@@ -444,7 +444,15 @@ export function acquireScrollLock(container = typeof document === 'undefined' ?
444
444
  export function resolveScrollContainer(node, container) {
445
445
  const resolved = typeof container === 'function' ? container() : container;
446
446
  if (typeof resolved === 'object') {
447
- return resolved !== null && resolved.nodeType === 1 && typeof resolved.style === 'object'
447
+ // A custom-element Object property can be a JSON lookalike with nodeType 1
448
+ // and a plain style object. acquireScrollLock calls style.setProperty, so
449
+ // that lookalike must resolve to null instead of throwing.
450
+ return resolved !== null &&
451
+ resolved.nodeType === 1 &&
452
+ typeof resolved.getRootNode === 'function' &&
453
+ typeof resolved.style === 'object' &&
454
+ resolved.style !== null &&
455
+ typeof resolved.style.setProperty === 'function'
448
456
  ? resolved
449
457
  : null;
450
458
  }
package/dist-wc/index.js CHANGED
@@ -7114,7 +7114,7 @@ function acquireScrollLock(e = typeof document > "u" ? null : document.body) {
7114
7114
  }
7115
7115
  function resolveScrollContainer(e, t) {
7116
7116
  let n = typeof t == "function" ? t() : t;
7117
- return typeof n == "object" ? n !== null && n.nodeType === 1 && typeof n.style == "object" ? n : null : t === void 0 ? e?.ownerDocument.body ?? (typeof document > "u" ? null : document.body) : null;
7117
+ return typeof n == "object" ? n !== null && n.nodeType === 1 && typeof n.getRootNode == "function" && typeof n.style == "object" && n.style !== null && typeof n.style.setProperty == "function" ? n : null : t === void 0 ? e?.ownerDocument.body ?? (typeof document > "u" ? null : document.body) : null;
7118
7118
  }
7119
7119
  function lockBodyScroll() {
7120
7120
  typeof document < "u" && bodyScrollReleases.push(acquireScrollLock(document.body));
@@ -12468,129 +12468,152 @@ var rest_excludes$80 = new Set([
12468
12468
  };
12469
12469
  function Input_wc(e, t) {
12470
12470
  push(t, !0), append_styles$1(e, $$css$160);
12471
- let n = prop(t, "inputAriaLabel", 7), i = prop(t, "inputId", 7), a = prop(t, "inputAutofocus", 7), o = /* @__PURE__ */ rest_props(t, rest_excludes$80), s = t.$$host, c = /* @__PURE__ */ user_derived(() => dispatchEvents(s, o)), l = (e) => {
12471
+ let n = (e) => {
12472
+ var n = comment(), i = first_child(n), a = (e) => {
12473
+ var n = comment();
12474
+ snippet(first_child(n), () => t.labelSuffix), append(e, n);
12475
+ }, o = (e) => {
12476
+ var n = comment();
12477
+ slot(first_child(n), t, "label-suffix", {}, null), append(e, n);
12478
+ };
12479
+ if_block(i, (e) => {
12480
+ t.labelSuffix ? e(a) : e(o, -1);
12481
+ }), append(e, n);
12482
+ }, i = prop(t, "inputAriaLabel", 7), a = prop(t, "inputId", 7), o = prop(t, "inputAutofocus", 7), s = /* @__PURE__ */ rest_props(t, rest_excludes$80), c = t.$$host, l = /* @__PURE__ */ user_derived(() => dispatchEvents(c, s)), u = (e) => {
12472
12483
  if (e == null) return null;
12473
12484
  if (typeof e == "boolean") return e;
12474
12485
  let t = String(e).trim().toLowerCase();
12475
12486
  return t === "false" ? !1 : t === "" || t === "true" || t === "spellcheck" ? !0 : null;
12476
- }, u = t.$$host.querySelector("[slot=\"left-icon\"]") !== null, f = t.$$host.querySelector("[slot=\"right-icon\"]") !== null;
12477
- var p = {
12487
+ }, f = t.$$host.querySelector("[slot=\"left-icon\"]") !== null, p = t.$$host.querySelector("[slot=\"right-icon\"]") !== null, h = t.$$host.querySelector("[slot=\"label-suffix\"]") !== null;
12488
+ var S = {
12478
12489
  get inputAriaLabel() {
12479
- return n();
12490
+ return i();
12480
12491
  },
12481
12492
  set inputAriaLabel(e) {
12482
- n(e), flushSync();
12493
+ i(e), flushSync();
12483
12494
  },
12484
12495
  get inputId() {
12485
- return i();
12496
+ return a();
12486
12497
  },
12487
12498
  set inputId(e) {
12488
- i(e), flushSync();
12499
+ a(e), flushSync();
12489
12500
  },
12490
12501
  get inputAutofocus() {
12491
- return a();
12502
+ return o();
12492
12503
  },
12493
12504
  set inputAutofocus(e) {
12494
- a(e), flushSync();
12505
+ o(e), flushSync();
12495
12506
  }
12496
- }, h = comment(), S = first_child(h), C = (e) => {
12507
+ }, C = comment(), k = first_child(C), R = (e) => {
12497
12508
  {
12498
- let s = (e) => {
12509
+ let c = (e) => {
12499
12510
  var n = comment();
12500
12511
  slot(first_child(n), t, "left-icon", {}, null), append(e, n);
12501
- }, u = (e) => {
12512
+ }, f = (e) => {
12502
12513
  var n = comment();
12503
12514
  slot(first_child(n), t, "right-icon", {}, null), append(e, n);
12504
- }, f = /* @__PURE__ */ user_derived(() => l(t.spellcheck));
12505
- Input(e, spread_props(() => o, () => get(c), {
12515
+ }, p = /* @__PURE__ */ user_derived(() => u(t.spellcheck)), S = /* @__PURE__ */ user_derived(() => h ? n : t.labelSuffix);
12516
+ Input(e, spread_props(() => s, () => get(l), {
12506
12517
  get id() {
12507
- return i();
12518
+ return a();
12508
12519
  },
12509
12520
  get ariaLabel() {
12510
- return n();
12521
+ return i();
12511
12522
  },
12512
12523
  get autofocus() {
12513
- return a();
12524
+ return o();
12514
12525
  },
12515
12526
  get spellcheck() {
12516
- return get(f);
12527
+ return get(p);
12528
+ },
12529
+ get labelSuffix() {
12530
+ return get(S);
12517
12531
  },
12518
- leftIcon: s,
12519
- rightIcon: u,
12532
+ leftIcon: c,
12533
+ rightIcon: f,
12520
12534
  $$slots: {
12521
12535
  leftIcon: !0,
12522
12536
  rightIcon: !0
12523
12537
  }
12524
12538
  }));
12525
12539
  }
12526
- }, k = (e) => {
12540
+ }, G = (e) => {
12527
12541
  {
12528
- let s = (e) => {
12542
+ let c = (e) => {
12529
12543
  var n = comment();
12530
12544
  slot(first_child(n), t, "left-icon", {}, null), append(e, n);
12531
- }, u = /* @__PURE__ */ user_derived(() => l(t.spellcheck));
12532
- Input(e, spread_props(() => o, () => get(c), {
12545
+ }, f = /* @__PURE__ */ user_derived(() => u(t.spellcheck)), p = /* @__PURE__ */ user_derived(() => h ? n : t.labelSuffix);
12546
+ Input(e, spread_props(() => s, () => get(l), {
12533
12547
  get id() {
12534
- return i();
12548
+ return a();
12535
12549
  },
12536
12550
  get ariaLabel() {
12537
- return n();
12551
+ return i();
12538
12552
  },
12539
12553
  get autofocus() {
12540
- return a();
12554
+ return o();
12541
12555
  },
12542
12556
  get spellcheck() {
12543
- return get(u);
12557
+ return get(f);
12558
+ },
12559
+ get labelSuffix() {
12560
+ return get(p);
12544
12561
  },
12545
- leftIcon: s,
12562
+ leftIcon: c,
12546
12563
  $$slots: { leftIcon: !0 }
12547
12564
  }));
12548
12565
  }
12549
- }, R = (e) => {
12566
+ }, te = (e) => {
12550
12567
  {
12551
- let s = (e) => {
12568
+ let c = (e) => {
12552
12569
  var n = comment();
12553
12570
  slot(first_child(n), t, "right-icon", {}, null), append(e, n);
12554
- }, u = /* @__PURE__ */ user_derived(() => l(t.spellcheck));
12555
- Input(e, spread_props(() => o, () => get(c), {
12571
+ }, f = /* @__PURE__ */ user_derived(() => u(t.spellcheck)), p = /* @__PURE__ */ user_derived(() => h ? n : t.labelSuffix);
12572
+ Input(e, spread_props(() => s, () => get(l), {
12556
12573
  get id() {
12557
- return i();
12574
+ return a();
12558
12575
  },
12559
12576
  get ariaLabel() {
12560
- return n();
12577
+ return i();
12561
12578
  },
12562
12579
  get autofocus() {
12563
- return a();
12580
+ return o();
12564
12581
  },
12565
12582
  get spellcheck() {
12566
- return get(u);
12583
+ return get(f);
12567
12584
  },
12568
- rightIcon: s,
12585
+ get labelSuffix() {
12586
+ return get(p);
12587
+ },
12588
+ rightIcon: c,
12569
12589
  $$slots: { rightIcon: !0 }
12570
12590
  }));
12571
12591
  }
12572
- }, G = (e) => {
12592
+ }, ne = (e) => {
12573
12593
  {
12574
- let s = /* @__PURE__ */ user_derived(() => l(t.spellcheck));
12575
- Input(e, spread_props(() => o, () => get(c), {
12594
+ let c = /* @__PURE__ */ user_derived(() => u(t.spellcheck)), f = /* @__PURE__ */ user_derived(() => h ? n : t.labelSuffix);
12595
+ Input(e, spread_props(() => s, () => get(l), {
12576
12596
  get id() {
12577
- return i();
12597
+ return a();
12578
12598
  },
12579
12599
  get ariaLabel() {
12580
- return n();
12600
+ return i();
12581
12601
  },
12582
12602
  get autofocus() {
12583
- return a();
12603
+ return o();
12584
12604
  },
12585
12605
  get spellcheck() {
12586
- return get(s);
12606
+ return get(c);
12607
+ },
12608
+ get labelSuffix() {
12609
+ return get(f);
12587
12610
  }
12588
12611
  }));
12589
12612
  }
12590
12613
  };
12591
- return if_block(S, (e) => {
12592
- u && f ? e(C) : u ? e(k, 1) : f ? e(R, 2) : e(G, -1);
12593
- }), append(e, h), pop(p);
12614
+ return if_block(k, (e) => {
12615
+ f && p ? e(R) : f ? e(G, 1) : p ? e(te, 2) : e(ne, -1);
12616
+ }), append(e, C), pop(S);
12594
12617
  }
12595
12618
  customElements.define("sui-input", create_custom_element(Input_wc, {
12596
12619
  value: {
@@ -12765,7 +12788,11 @@ customElements.define("sui-input", create_custom_element(Input_wc, {
12765
12788
  attribute: "input-autofocus",
12766
12789
  type: "Boolean"
12767
12790
  }
12768
- }, ["left-icon", "right-icon"], [], { mode: "open" }, formAssociated({ disabled: "disable" })));
12791
+ }, [
12792
+ "label-suffix",
12793
+ "left-icon",
12794
+ "right-icon"
12795
+ ], [], { mode: "open" }, formAssociated({ disabled: "disable" })));
12769
12796
  //#endregion
12770
12797
  //#region src/lib/KeyboardInput/KeyboardInput.svelte
12771
12798
  var root$82 = /* @__PURE__ */ from_html("<span class=\"separator svelte-14lwsom\"> </span>"), root_1$76 = /* @__PURE__ */ from_html("<!> <kbd class=\"key svelte-14lwsom\"> </kbd>", 1), root_2$60 = /* @__PURE__ */ from_html("<span></span>"), $$css$159 = {
@@ -13520,9 +13547,70 @@ var rest_excludes$74 = new Set([
13520
13547
  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-progress-display, block);}"
13521
13548
  };
13522
13549
  function Progress_wc(e, t) {
13523
- append_styles$1(e, $$css$150);
13524
- let n = /* @__PURE__ */ rest_props(t, rest_excludes$74);
13525
- Progress(e, spread_props(() => n));
13550
+ push(t, !0), append_styles$1(e, $$css$150);
13551
+ let n = (e) => {
13552
+ var n = comment(), i = first_child(n), a = (e) => {
13553
+ var n = comment();
13554
+ snippet(first_child(n), () => t.leadingLabel), append(e, n);
13555
+ }, o = (e) => {
13556
+ var n = comment();
13557
+ slot(first_child(n), t, "leading-label", {}, null), append(e, n);
13558
+ };
13559
+ if_block(i, (e) => {
13560
+ t.leadingLabel ? e(a) : e(o, -1);
13561
+ }), append(e, n);
13562
+ }, i = (e) => {
13563
+ var n = comment(), i = first_child(n), a = (e) => {
13564
+ var n = comment();
13565
+ snippet(first_child(n), () => t.headerStart), append(e, n);
13566
+ }, o = (e) => {
13567
+ var n = comment();
13568
+ slot(first_child(n), t, "header-start", {}, null), append(e, n);
13569
+ };
13570
+ if_block(i, (e) => {
13571
+ t.headerStart ? e(a) : e(o, -1);
13572
+ }), append(e, n);
13573
+ }, a = (e) => {
13574
+ var n = comment(), i = first_child(n), a = (e) => {
13575
+ var n = comment();
13576
+ snippet(first_child(n), () => t.headerEnd), append(e, n);
13577
+ }, o = (e) => {
13578
+ var n = comment();
13579
+ slot(first_child(n), t, "header-end", {}, null), append(e, n);
13580
+ };
13581
+ if_block(i, (e) => {
13582
+ t.headerEnd ? e(a) : e(o, -1);
13583
+ }), append(e, n);
13584
+ }, o = (e) => {
13585
+ var n = comment(), i = first_child(n), a = (e) => {
13586
+ var n = comment();
13587
+ snippet(first_child(n), () => t.note), append(e, n);
13588
+ }, o = (e) => {
13589
+ var n = comment();
13590
+ slot(first_child(n), t, "note", {}, null), append(e, n);
13591
+ };
13592
+ if_block(i, (e) => {
13593
+ t.note ? e(a) : e(o, -1);
13594
+ }), append(e, n);
13595
+ }, s = /* @__PURE__ */ rest_props(t, rest_excludes$74), c = t.$$host.querySelector("[slot=\"leading-label\"]") !== null, l = t.$$host.querySelector("[slot=\"header-start\"]") !== null, u = t.$$host.querySelector("[slot=\"header-end\"]") !== null, f = t.$$host.querySelector("[slot=\"note\"]") !== null;
13596
+ {
13597
+ let p = /* @__PURE__ */ user_derived(() => c ? n : t.leadingLabel), h = /* @__PURE__ */ user_derived(() => l ? i : t.headerStart), S = /* @__PURE__ */ user_derived(() => u ? a : t.headerEnd), C = /* @__PURE__ */ user_derived(() => f ? o : t.note);
13598
+ Progress(e, spread_props(() => s, {
13599
+ get leadingLabel() {
13600
+ return get(p);
13601
+ },
13602
+ get headerStart() {
13603
+ return get(h);
13604
+ },
13605
+ get headerEnd() {
13606
+ return get(S);
13607
+ },
13608
+ get note() {
13609
+ return get(C);
13610
+ }
13611
+ }));
13612
+ }
13613
+ pop();
13526
13614
  }
13527
13615
  customElements.define("sui-progress", create_custom_element(Progress_wc, {
13528
13616
  value: {
@@ -13552,7 +13640,12 @@ customElements.define("sui-progress", create_custom_element(Progress_wc, {
13552
13640
  headerStart: { type: "Object" },
13553
13641
  headerEnd: { type: "Object" },
13554
13642
  note: { type: "Object" }
13555
- }, [], [], { mode: "open" }));
13643
+ }, [
13644
+ "leading-label",
13645
+ "header-start",
13646
+ "header-end",
13647
+ "note"
13648
+ ], [], { mode: "open" }));
13556
13649
  //#endregion
13557
13650
  //#region src/lib/Radio/Radio.svelte
13558
13651
  var root$78 = /* @__PURE__ */ from_html("<span> </span>"), root_1$72 = /* @__PURE__ */ from_html("<div role=\"alert\" class=\"field-error svelte-14bh706\"> </div>"), root_2$57 = /* @__PURE__ */ from_html("<div class=\"field-info svelte-14bh706\"> </div>"), root_3$51 = /* @__PURE__ */ from_html("<label><input type=\"radio\" class=\"radio-input svelte-14bh706\"/> <span><span></span></span> <!></label> <!> <!>", 1), $$css$149 = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/svelte-ui-components",
3
- "version": "4.54.0",
3
+ "version": "4.54.1",
4
4
  "description": "A themeable Svelte 5 UI component library with CSS custom property driven styling",
5
5
  "keywords": [
6
6
  "svelte",