bits-ui 0.21.2 → 0.21.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.
package/README.md CHANGED
@@ -25,7 +25,7 @@ This project is supported by the following beautiful people/organizations:
25
25
 
26
26
  <p align="center">
27
27
  <a href="https://github.com/sponsors/huntabyte">
28
- <img src='https://cdn.jsdelivr.net/gh/huntabyte/static@main/sponsors.svg' alt="Logos from Sponsors" />
28
+ <img src='https://github.com/huntabyte/static/blob/main/sponsors.svg?raw=true' alt="Logos from Sponsors" />
29
29
  </a>
30
30
  </p>
31
31
 
@@ -1,5 +1,6 @@
1
1
  <script>import { melt } from "@melt-ui/svelte";
2
2
  import { setGroupCtx } from "../ctx.js";
3
+ import { arraysAreEqual } from "../../../internal/arrays.js";
3
4
  export let type = "single";
4
5
  export let disabled = void 0;
5
6
  export let value = void 0;
@@ -17,8 +18,11 @@ const {
17
18
  defaultValue: value,
18
19
  onValueChange: ({ next }) => {
19
20
  if (Array.isArray(next)) {
20
- onValueChange?.(next);
21
- value = next;
21
+ if (!Array.isArray(value) || !arraysAreEqual(value, next)) {
22
+ onValueChange?.(next);
23
+ value = next;
24
+ return next;
25
+ }
22
26
  return next;
23
27
  }
24
28
  if (value !== next) {
@@ -30,7 +34,7 @@ const {
30
34
  });
31
35
  const attrs = getAttrs("group");
32
36
  $:
33
- value !== void 0 && localValue.set(value);
37
+ value !== void 0 && localValue.set(Array.isArray(value) ? [...value] : value);
34
38
  $:
35
39
  updateOption("disabled", disabled);
36
40
  $:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bits-ui",
3
- "version": "0.21.2",
3
+ "version": "0.21.3",
4
4
  "license": "MIT",
5
5
  "repository": "github:huntabyte/bits-ui",
6
6
  "funding": "https://github.com/sponsors/huntabyte",