bits-ui 1.0.0-next.13 → 1.0.0-next.15

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.
@@ -661,7 +661,7 @@ class CommandItemState {
661
661
  this.id.current;
662
662
  this.#group?.id.current;
663
663
  if (!this.#forceMount.current) {
664
- untrack(() => {
664
+ return untrack(() => {
665
665
  return this.root.registerItem(this.id.current, this.#group?.id.current);
666
666
  });
667
667
  }
@@ -76,7 +76,7 @@ class PinInputRootState {
76
76
  });
77
77
  $effect(() => {
78
78
  let unsub = noop;
79
- untrack(() => {
79
+ return untrack(() => {
80
80
  const input = this.#inputRef.current;
81
81
  const container = this.#ref.current;
82
82
  if (!input || !container)
@@ -275,7 +275,7 @@ export class SelectContentState {
275
275
  });
276
276
  $effect(() => {
277
277
  this.root.open.current;
278
- untrack(() => {
278
+ return untrack(() => {
279
279
  let cleanup = [noop];
280
280
  afterTick(() => {
281
281
  const node = document.getElementById(this.id.current);
@@ -114,7 +114,7 @@ class TabsTriggerState {
114
114
  // we want to track the value & id
115
115
  const id = this.#id.current;
116
116
  const value = this.#value.current;
117
- untrack(() => {
117
+ return untrack(() => {
118
118
  const deregister = this.#root.registerTrigger(id, value);
119
119
  return () => {
120
120
  deregister();
@@ -113,9 +113,9 @@ export function useFocusScope({ id, loop, enabled, onOpenAutoFocus, onCloseAutoF
113
113
  return () => {
114
114
  if (!container)
115
115
  return;
116
- container.removeEventListener(AUTOFOCUS_ON_MOUNT, untrack(() => onOpenAutoFocus.current));
116
+ container.removeEventListener(AUTOFOCUS_ON_MOUNT, onOpenAutoFocus.current);
117
117
  const destroyEvent = new CustomEvent(AUTOFOCUS_ON_DESTROY, EVENT_OPTIONS);
118
- container.addEventListener(AUTOFOCUS_ON_DESTROY, untrack(() => onCloseAutoFocus.current));
118
+ container.addEventListener(AUTOFOCUS_ON_DESTROY, onCloseAutoFocus.current);
119
119
  container.dispatchEvent(destroyEvent);
120
120
  setTimeout(() => {
121
121
  if (!destroyEvent.defaultPrevented && previouslyFocusedElement) {
@@ -1,11 +1,11 @@
1
1
  import type { HTMLAnchorAttributes, HTMLAttributes, HTMLButtonAttributes, HTMLImgAttributes, HTMLInputAttributes, HTMLLabelAttributes, HTMLLiAttributes, HTMLTableAttributes, HTMLTdAttributes, HTMLThAttributes, SVGAttributes } from "svelte/elements";
2
- export type BitsHTMLDivAttributes = HTMLAttributes<HTMLDivElement>;
3
- export type BitsHTMLSpanAttributes = HTMLAttributes<HTMLSpanElement>;
4
- export type BitsHTMLHeadingAttributes = HTMLAttributes<HTMLHeadingElement>;
5
- export type BitsHTMLUListAttributes = HTMLAttributes<HTMLUListElement>;
6
- export type BitsHTMLElementAttributes = HTMLAttributes<HTMLElement>;
7
- export type BitsHTMLTableSectionAttributes = HTMLAttributes<HTMLTableSectionElement>;
8
- export type BitsHTMLTableRowAttributes = HTMLAttributes<HTMLTableRowElement>;
2
+ export type BitsDivAttributes = HTMLAttributes<HTMLDivElement>;
3
+ export type BitsSpanAttributes = HTMLAttributes<HTMLSpanElement>;
4
+ export type BitsHeadingAttributes = HTMLAttributes<HTMLHeadingElement>;
5
+ export type BitsUListAttributes = HTMLAttributes<HTMLUListElement>;
6
+ export type BitsElementAttributes = HTMLAttributes<HTMLElement>;
7
+ export type BitsTableSectionAttributes = HTMLAttributes<HTMLTableSectionElement>;
8
+ export type BitsTableRowAttributes = HTMLAttributes<HTMLTableRowElement>;
9
9
  export type BitsSVGElementAttributes = SVGAttributes<SVGElement>;
10
10
  /**
11
11
  * We override the `id` prop type to not allow it to be `null`. We rely on the
@@ -17,22 +17,22 @@ type BitsPrimitive<T> = Omit<T, "style" | "id" | "children"> & {
17
17
  id?: string;
18
18
  };
19
19
  export type BitsPrimitiveButtonAttributes = BitsPrimitive<HTMLButtonAttributes>;
20
- export type BitsPrimitiveDivAttributes = BitsPrimitive<BitsHTMLDivAttributes>;
20
+ export type BitsPrimitiveDivAttributes = BitsPrimitive<BitsDivAttributes>;
21
21
  export type BitsPrimitiveInputAttributes = BitsPrimitive<HTMLInputAttributes>;
22
- export type BitsPrimitiveSpanAttributes = BitsPrimitive<BitsHTMLSpanAttributes>;
22
+ export type BitsPrimitiveSpanAttributes = BitsPrimitive<BitsSpanAttributes>;
23
23
  export type BitsPrimitiveImgAttributes = BitsPrimitive<HTMLImgAttributes>;
24
- export type BitsPrimitiveHeadingAttributes = BitsPrimitive<BitsHTMLHeadingAttributes>;
24
+ export type BitsPrimitiveHeadingAttributes = BitsPrimitive<BitsHeadingAttributes>;
25
25
  export type BitsPrimitiveLabelAttributes = BitsPrimitive<HTMLLabelAttributes>;
26
26
  export type BitsPrimitiveSVGAttributes = BitsPrimitive<BitsSVGElementAttributes>;
27
27
  export type BitsPrimitiveAnchorAttributes = BitsPrimitive<HTMLAnchorAttributes>;
28
28
  export type BitsPrimitiveLiAttributes = BitsPrimitive<HTMLLiAttributes>;
29
- export type BitsPrimitiveElementAttributes = BitsPrimitive<BitsHTMLElementAttributes>;
30
- export type BitsPrimitiveUListAttributes = BitsPrimitive<BitsHTMLUListAttributes>;
29
+ export type BitsPrimitiveElementAttributes = BitsPrimitive<BitsElementAttributes>;
30
+ export type BitsPrimitiveUListAttributes = BitsPrimitive<BitsUListAttributes>;
31
31
  export type BitsPrimitiveTdAttributes = BitsPrimitive<HTMLTdAttributes>;
32
32
  export type BitsPrimitiveThAttributes = BitsPrimitive<HTMLThAttributes>;
33
33
  export type BitsPrimitiveTableAttributes = BitsPrimitive<HTMLTableAttributes>;
34
- export type BitsPrimitiveTbodyAttributes = BitsPrimitive<BitsHTMLTableSectionAttributes>;
35
- export type BitsPrimitiveTrAttributes = BitsPrimitive<BitsHTMLTableRowAttributes>;
36
- export type BitsPrimitiveTheadAttributes = BitsPrimitive<BitsHTMLTableSectionAttributes>;
37
- export type BitsPrimitiveHeaderAttributes = BitsPrimitive<BitsHTMLElementAttributes>;
34
+ export type BitsPrimitiveTbodyAttributes = BitsPrimitive<BitsTableSectionAttributes>;
35
+ export type BitsPrimitiveTrAttributes = BitsPrimitive<BitsTableRowAttributes>;
36
+ export type BitsPrimitiveTheadAttributes = BitsPrimitive<BitsTableSectionAttributes>;
37
+ export type BitsPrimitiveHeaderAttributes = BitsPrimitive<BitsElementAttributes>;
38
38
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bits-ui",
3
- "version": "1.0.0-next.13",
3
+ "version": "1.0.0-next.15",
4
4
  "license": "MIT",
5
5
  "repository": "github:huntabyte/bits-ui",
6
6
  "funding": "https://github.com/sponsors/huntabyte",