@juspay/svelte-ui-components 3.2.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -38,6 +38,53 @@ This library takes a different approach: **components are unstyled by default**
38
38
 
39
39
  ---
40
40
 
41
+ ## Coming in 4.0.0: one breaking change
42
+
43
+ Advance notice, not a change in this release. **Nothing below has happened yet** —
44
+ the current 3.x line still accepts everything it always did.
45
+
46
+ In 4.0.0, `children` stops being a declared property on `sui-chat-bubble`,
47
+ `sui-draggable` and `sui-resizable`. Assigning it will set an inert expando and
48
+ the content will silently disappear. Pass the content as light-DOM children
49
+ instead, which those wrappers will forward through their default slot:
50
+
51
+ ```js
52
+ el.children = mySnippet; // before — no longer works
53
+ ```
54
+
55
+ ```html
56
+ <sui-draggable><div>…</div></sui-draggable>
57
+ <!-- after -->
58
+ ```
59
+
60
+ **Reading `element.children` is what the change fixes.** Declaring the property
61
+ replaces the inherited accessor, so on those three elements `element.children`
62
+ returns `undefined` rather than an `HTMLCollection` today and
63
+ `el.children.length` throws. That is why the declaration has to go, and why it
64
+ cannot go before a major.
65
+
66
+ You can find affected call sites now, well before the major — this reports and
67
+ writes nothing:
68
+
69
+ ```sh
70
+ npx sui-codemod --dry-run ./src
71
+ ```
72
+
73
+ It flags `.children =` assignments only in files that also mention one of the
74
+ three elements, so ordinary DOM code is not reported. The fix moves content from
75
+ a JavaScript assignment into markup, which is a decision about where content is
76
+ authored, so the tool deliberately does not rewrite it for you. Requires Node
77
+ &ge;&nbsp;22.18; `typescript` is an optional peer dependency that the codemod's
78
+ Svelte-parsing paths need.
79
+
80
+ Nothing else in the custom-element surface breaks. Everything this release adds —
81
+ 185 wrapper props, three previously unregistered elements, the `spellcheck` and
82
+ `aria-haspopup` mappings, the snippet props on Banner, ListItem, Menu, Modal and
83
+ Button, Accordion's `disabled`, LottiePlayer's callbacks — is new surface or a
84
+ fix to something that did not work.
85
+
86
+ ---
87
+
41
88
  ## Quick Start
42
89
 
43
90
  ```svelte
@@ -165,8 +212,14 @@ component.
165
212
  <script type="module" src="https://juspay.github.io/svelte-ui-components/wc/index.js"></script>
166
213
 
167
214
  <!-- Pinned to an npm version, via jsDelivr or unpkg -->
168
- <script type="module" src="https://cdn.jsdelivr.net/npm/@juspay/svelte-ui-components@latest/dist-wc/index.js"></script>
169
- <script type="module" src="https://unpkg.com/@juspay/svelte-ui-components@latest/dist-wc/index.js"></script>
215
+ <script
216
+ type="module"
217
+ src="https://cdn.jsdelivr.net/npm/@juspay/svelte-ui-components@latest/dist-wc/index.js"
218
+ ></script>
219
+ <script
220
+ type="module"
221
+ src="https://unpkg.com/@juspay/svelte-ui-components@latest/dist-wc/index.js"
222
+ ></script>
170
223
 
171
224
  <sui-button>Click me</sui-button>
172
225
  <sui-input placeholder="Type here"></sui-input>
@@ -183,6 +183,10 @@
183
183
  background-color: var(--theme-switcher-bg-hover, #f3f4f6);
184
184
  }
185
185
 
186
+ .toggle-button:active {
187
+ background-color: var(--theme-switcher-bg-pressed, #e5e7eb);
188
+ }
189
+
186
190
  .icon {
187
191
  display: inline-flex;
188
192
  align-items: center;