@ark-ui/solid 3.0.0-4 → 3.0.0-6

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.
Files changed (110) hide show
  1. package/dist/cjs/index.js +304 -235
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/esm/index.js +306 -237
  4. package/dist/esm/index.js.map +1 -1
  5. package/dist/source/components/accordion/accordion-item-content.jsx +7 -2
  6. package/dist/source/components/accordion/accordion-root.jsx +1 -0
  7. package/dist/source/components/accordion/use-accordion.js +12 -3
  8. package/dist/source/components/avatar/use-avatar.js +9 -3
  9. package/dist/source/components/carousel/carousel-root.jsx +1 -0
  10. package/dist/source/components/carousel/use-carousel.js +10 -3
  11. package/dist/source/components/checkbox/checkbox-root.jsx +1 -0
  12. package/dist/source/components/checkbox/use-checkbox.js +10 -3
  13. package/dist/source/components/clipboard/clipboard-indicator.jsx +0 -1
  14. package/dist/source/components/clipboard/use-clipboard.js +8 -3
  15. package/dist/source/components/collapsible/collapsible-root.jsx +1 -0
  16. package/dist/source/components/collapsible/use-collapsible.js +8 -5
  17. package/dist/source/components/color-picker/color-picker-root.jsx +2 -0
  18. package/dist/source/components/color-picker/use-color-picker.js +14 -8
  19. package/dist/source/components/combobox/combobox-root.jsx +4 -2
  20. package/dist/source/components/combobox/combobox-trigger.jsx +3 -1
  21. package/dist/source/components/combobox/use-combobox.js +12 -10
  22. package/dist/source/components/date-picker/date-picker-root.jsx +2 -0
  23. package/dist/source/components/date-picker/use-date-picker.js +17 -11
  24. package/dist/source/components/dialog/dialog-root.jsx +2 -0
  25. package/dist/source/components/dialog/use-dialog.js +8 -5
  26. package/dist/source/components/editable/editable-root.jsx +1 -0
  27. package/dist/source/components/editable/use-editable.js +10 -3
  28. package/dist/source/components/factory.jsx +8 -11
  29. package/dist/source/components/file-upload/use-file-upload.js +9 -3
  30. package/dist/source/components/hover-card/hover-card-root.jsx +1 -0
  31. package/dist/source/components/hover-card/use-hover-card.js +8 -5
  32. package/dist/source/components/menu/menu-root.jsx +2 -0
  33. package/dist/source/components/menu/use-menu.js +8 -5
  34. package/dist/source/components/number-input/number-input-root.jsx +1 -0
  35. package/dist/source/components/number-input/use-number-input.js +10 -3
  36. package/dist/source/components/pagination/pagination-root.jsx +1 -0
  37. package/dist/source/components/pagination/use-pagination.js +10 -3
  38. package/dist/source/components/pin-input/pin-input-root.jsx +1 -0
  39. package/dist/source/components/pin-input/use-pin-input.js +10 -3
  40. package/dist/source/components/popover/popover-root.jsx +3 -1
  41. package/dist/source/components/popover/use-popover.js +8 -5
  42. package/dist/source/components/presence/index.js +4 -5
  43. package/dist/source/components/progress/use-progress.js +9 -3
  44. package/dist/source/components/radio-group/radio-group-root.jsx +1 -0
  45. package/dist/source/components/radio-group/use-radio-group.js +10 -3
  46. package/dist/source/components/rating-group/rating-group-root.jsx +1 -0
  47. package/dist/source/components/rating-group/use-rating-group.js +10 -3
  48. package/dist/source/components/segment-group/segment-group-root.jsx +1 -0
  49. package/dist/source/components/segment-group/use-segment-group.js +12 -5
  50. package/dist/source/components/select/select-item.jsx +1 -1
  51. package/dist/source/components/select/select-root.jsx +3 -0
  52. package/dist/source/components/select/use-select.js +12 -10
  53. package/dist/source/components/slider/slider-root.jsx +1 -0
  54. package/dist/source/components/slider/use-slider.js +10 -3
  55. package/dist/source/components/splitter/splitter-root.jsx +1 -0
  56. package/dist/source/components/splitter/use-splitter.js +10 -3
  57. package/dist/source/components/switch/switch-root.jsx +1 -0
  58. package/dist/source/components/switch/use-switch.js +10 -3
  59. package/dist/source/components/tabs/tabs-root.jsx +2 -0
  60. package/dist/source/components/tabs/use-tabs.js +10 -3
  61. package/dist/source/components/tags-input/tags-input-root.jsx +1 -0
  62. package/dist/source/components/tags-input/use-tags-input.js +10 -3
  63. package/dist/source/components/toggle-group/toggle-group-root.jsx +1 -0
  64. package/dist/source/components/toggle-group/use-toggle-group.js +10 -3
  65. package/dist/source/components/tooltip/tooltip-root.jsx +2 -1
  66. package/dist/source/components/tooltip/use-tooltip.js +8 -5
  67. package/dist/source/components/tree-view/tree-view-root.jsx +3 -1
  68. package/dist/source/components/tree-view/use-tree-view.js +11 -3
  69. package/dist/source/providers/environment/{environment.jsx → environment-provider.jsx} +4 -4
  70. package/dist/source/providers/environment/index.js +1 -1
  71. package/dist/source/providers/environment/use-environment-context.js +1 -1
  72. package/dist/source/providers/locale/locale-provider.jsx +5 -19
  73. package/dist/types/components/accordion/accordion-item.d.ts +1 -2
  74. package/dist/types/components/accordion/use-accordion.d.ts +5 -0
  75. package/dist/types/components/carousel/use-carousel.d.ts +5 -0
  76. package/dist/types/components/checkbox/checkbox-hidden-input.d.ts +1 -1
  77. package/dist/types/components/checkbox/use-checkbox.d.ts +5 -0
  78. package/dist/types/components/collapsible/use-collapsible.d.ts +5 -0
  79. package/dist/types/components/color-picker/use-color-picker.d.ts +10 -0
  80. package/dist/types/components/combobox/combobox-trigger.d.ts +3 -1
  81. package/dist/types/components/combobox/use-combobox.d.ts +10 -0
  82. package/dist/types/components/date-picker/use-date-picker.d.ts +14 -4
  83. package/dist/types/components/dialog/use-dialog.d.ts +5 -0
  84. package/dist/types/components/editable/use-editable.d.ts +5 -0
  85. package/dist/types/components/factory.d.ts +2 -3
  86. package/dist/types/components/hover-card/use-hover-card.d.ts +5 -0
  87. package/dist/types/components/menu/use-menu.d.ts +5 -0
  88. package/dist/types/components/number-input/use-number-input.d.ts +5 -0
  89. package/dist/types/components/pagination/use-pagination.d.ts +5 -0
  90. package/dist/types/components/pin-input/use-pin-input.d.ts +5 -0
  91. package/dist/types/components/popover/use-popover.d.ts +5 -0
  92. package/dist/types/components/presence/index.d.ts +4 -6
  93. package/dist/types/components/radio-group/use-radio-group.d.ts +5 -0
  94. package/dist/types/components/rating-group/use-rating-group.d.ts +5 -0
  95. package/dist/types/components/segment-group/use-segment-group.d.ts +8 -3
  96. package/dist/types/components/select/use-select.d.ts +10 -0
  97. package/dist/types/components/slider/use-slider.d.ts +5 -0
  98. package/dist/types/components/splitter/use-splitter.d.ts +5 -0
  99. package/dist/types/components/switch/use-switch.d.ts +5 -0
  100. package/dist/types/components/tabs/use-tabs.d.ts +5 -0
  101. package/dist/types/components/tags-input/use-tags-input.d.ts +5 -0
  102. package/dist/types/components/toggle-group/use-toggle-group.d.ts +5 -0
  103. package/dist/types/components/tooltip/use-tooltip.d.ts +5 -0
  104. package/dist/types/components/tree-view/use-tree-view.d.ts +10 -0
  105. package/dist/types/providers/environment/{environment.d.ts → environment-provider.d.ts} +2 -2
  106. package/dist/types/providers/environment/index.d.ts +1 -1
  107. package/dist/types/providers/environment/use-environment-context.d.ts +4 -1
  108. package/dist/types/providers/locale/locale-provider.d.ts +3 -4
  109. package/package.json +48 -48
  110. /package/dist/source/providers/locale/{use-locale-context.jsx → use-locale-context.js} +0 -0
@@ -1,24 +1,10 @@
1
- import { isRTL, trackLocale } from '@zag-js/i18n-utils';
2
- import { createEffect, createMemo, createSignal, onCleanup, splitProps, } from 'solid-js';
3
- import { useEnvironmentContext } from '../environment';
1
+ import { isRTL } from '@zag-js/i18n-utils';
2
+ import { createMemo } from 'solid-js';
4
3
  import { LocaleContextProvider } from './use-locale-context';
5
4
  export const LocaleProvider = (props) => {
6
- const [localeProps, restProps] = splitProps(props, ['locale', 'defaultLocale']);
7
- const [locale, setLocale] = createSignal(localeProps.defaultLocale || localeProps.locale || 'en-US');
8
- const environment = useEnvironmentContext();
9
- createEffect(() => {
10
- const cleanup = trackLocale({
11
- locale: localeProps.locale,
12
- getRootNode: environment().getRootNode,
13
- onLocaleChange(locale) {
14
- setLocale(locale.locale);
15
- },
16
- });
17
- onCleanup(cleanup);
18
- });
19
5
  const context = createMemo(() => ({
20
- locale: locale(),
21
- dir: isRTL(locale()) ? 'rtl' : 'ltr',
6
+ locale: props.locale,
7
+ dir: isRTL(props.locale) ? 'rtl' : 'ltr',
22
8
  }));
23
- return <LocaleContextProvider value={context}>{restProps.children}</LocaleContextProvider>;
9
+ return <LocaleContextProvider value={context}>{props.children}</LocaleContextProvider>;
24
10
  };
@@ -1,7 +1,6 @@
1
1
  import type { ItemProps } from '@zag-js/accordion';
2
2
  import type { Assign } from '../../types';
3
- import type { UseCollapsibleProps } from '../collapsible/use-collapsible';
4
3
  import type { HTMLArkProps } from '../factory';
5
- export interface AccordionItemProps extends Assign<HTMLArkProps<'div'>, UseCollapsibleProps>, ItemProps {
4
+ export interface AccordionItemProps extends Assign<HTMLArkProps<'div'>, ItemProps> {
6
5
  }
7
6
  export declare const AccordionItem: (props: AccordionItemProps) => import("solid-js").JSX.Element;
@@ -3,6 +3,11 @@ import { type PropTypes } from '@zag-js/solid';
3
3
  import { type Accessor } from 'solid-js';
4
4
  import type { Optional } from '../../types';
5
5
  export interface UseAccordionProps extends Optional<Omit<accordion.Context, 'dir' | 'getRootNode'>, 'id'> {
6
+ /**
7
+ * The initial value of the accordion when it is first rendered.
8
+ * Use when you do not need to control the state of the color picker.
9
+ */
10
+ defaultValue?: accordion.Context['value'];
6
11
  }
7
12
  export interface UseAccordionReturn extends Accessor<accordion.Api<PropTypes>> {
8
13
  }
@@ -3,6 +3,11 @@ import { type PropTypes } from '@zag-js/solid';
3
3
  import { type Accessor } from 'solid-js';
4
4
  import type { Optional } from '../../types';
5
5
  export interface UseCarouselProps extends Optional<Omit<carousel.Context, 'dir' | 'getRootNode'>, 'id'> {
6
+ /**
7
+ * The initial index of the carousel when it is first rendered.
8
+ * Use this when you do not need to control the state of the carousel.
9
+ */
10
+ defaultIndex?: carousel.Context['index'];
6
11
  }
7
12
  export interface UseCarouselReturn extends Accessor<carousel.Api<PropTypes>> {
8
13
  }
@@ -1,4 +1,4 @@
1
1
  import { type HTMLArkProps } from '../factory';
2
- export interface CheckboxHiddenInputProps extends HTMLArkProps<'div'> {
2
+ export interface CheckboxHiddenInputProps extends HTMLArkProps<'input'> {
3
3
  }
4
4
  export declare const CheckboxHiddenInput: (props: CheckboxHiddenInputProps) => import("solid-js").JSX.Element;
@@ -3,6 +3,11 @@ import { type PropTypes } from '@zag-js/solid';
3
3
  import { type Accessor } from 'solid-js';
4
4
  import type { Optional } from '../../types';
5
5
  export interface UseCheckboxProps extends Optional<Omit<checkbox.Context, 'dir' | 'getRootNode'>, 'id'> {
6
+ /**
7
+ * The checked state of the checkbox when it is first rendered.
8
+ * Use this when you do not need to control the state of the checkbox.
9
+ */
10
+ defaultChecked?: checkbox.Context['checked'];
6
11
  }
7
12
  export interface UseCheckboxReturn extends Accessor<checkbox.Api<PropTypes>> {
8
13
  }
@@ -4,6 +4,11 @@ import { type Accessor } from 'solid-js';
4
4
  import type { Optional } from '../../types';
5
5
  import { type RenderStrategyProps } from '../../utils/render-strategy';
6
6
  export interface UseCollapsibleProps extends Optional<Omit<collapsible.Context, 'dir' | 'getRootNode' | 'open.controlled'>, 'id'>, RenderStrategyProps {
7
+ /**
8
+ * The initial open state of the collapsible when it is first rendered.
9
+ * Use when you do not need to control its open state.
10
+ */
11
+ defaultOpen?: collapsible.Context['open'];
7
12
  }
8
13
  export interface UseCollapsibleReturn extends Accessor<collapsible.Api<PropTypes> & {
9
14
  /**
@@ -3,6 +3,16 @@ import { type PropTypes } from '@zag-js/solid';
3
3
  import { type Accessor } from 'solid-js';
4
4
  import type { Optional } from '../../types';
5
5
  export interface UseColorPickerProps extends Optional<Omit<colorPicker.Context, 'dir' | 'getRootNode' | 'open.controlled' | 'value'>, 'id'> {
6
+ /**
7
+ * The initial open state of the color picker when it is first rendered.
8
+ * Use when you do not need to control its open state.
9
+ */
10
+ defaultOpen?: colorPicker.Context['open'];
11
+ /**
12
+ * The initial value of the color picker when it is first rendered.
13
+ * Use when you do not need to control the state of the color picker.
14
+ */
15
+ defaultValue?: string;
6
16
  /**
7
17
  * The current value of the color picker.
8
18
  */
@@ -1,4 +1,6 @@
1
+ import type { TriggerProps } from '@zag-js/combobox';
2
+ import type { Assign } from '../../types';
1
3
  import { type HTMLArkProps } from '../factory';
2
- export interface ComboboxTriggerProps extends HTMLArkProps<'button'> {
4
+ export interface ComboboxTriggerProps extends Assign<HTMLArkProps<'button'>, TriggerProps> {
3
5
  }
4
6
  export declare const ComboboxTrigger: (props: ComboboxTriggerProps) => import("solid-js").JSX.Element;
@@ -4,6 +4,16 @@ import { type PropTypes } from '@zag-js/solid';
4
4
  import { type Accessor } from 'solid-js';
5
5
  import type { CollectionItem, Optional } from '../../types';
6
6
  export interface UseComboboxProps<T extends CollectionItem> extends CollectionOptions<T>, Optional<Omit<combobox.Context<T>, 'collection' | 'dir' | 'getRootNode' | 'open.controlled'>, 'id'> {
7
+ /**
8
+ * The initial open state of the combobox when it is first rendered.
9
+ * Use when you do not need to control its open state.
10
+ */
11
+ defaultOpen?: combobox.Context['open'];
12
+ /**
13
+ * The initial value of the combobox when it is first rendered.
14
+ * Use when you do not need to control the state of the combobox.
15
+ */
16
+ defaultValue?: combobox.Context<T>['value'];
7
17
  }
8
18
  export interface UseComboboxReturn<T extends CollectionItem> extends Accessor<combobox.Api<PropTypes, T>> {
9
19
  }
@@ -3,22 +3,32 @@ import { type PropTypes } from '@zag-js/solid';
3
3
  import { type Accessor } from 'solid-js';
4
4
  import type { Optional } from '../../types';
5
5
  export interface UseDatePickerProps extends Optional<Omit<datePicker.Context, 'dir' | 'getRootNode' | 'value' | 'min' | 'max' | 'parse' | 'focusedValue' | 'open.controlled'>, 'id'> {
6
+ /**
7
+ * The initial open state of the date picker when it is first rendered.
8
+ * Use when you do not need to control its open state.
9
+ */
10
+ defaultOpen?: datePicker.Context['open'];
11
+ /**
12
+ * The initial value of the date picker when it is first rendered.
13
+ * Use when you do not need to control the state of the date picker.
14
+ */
15
+ defaultValue?: string[];
6
16
  /**
7
17
  * The focused date.
8
18
  */
9
19
  focusedValue?: string;
10
20
  /**
11
- * The value of the date picker
21
+ * The maximum date for the date picker in the format yyyy-mm-dd
12
22
  */
13
- value?: string[];
23
+ max?: string;
14
24
  /**
15
25
  * The minimum date for the date picker in the format yyyy-mm-dd
16
26
  */
17
27
  min?: string;
18
28
  /**
19
- * The maximum date for the date picker in the format yyyy-mm-dd
29
+ * The value of the date picker
20
30
  */
21
- max?: string;
31
+ value?: string[];
22
32
  }
23
33
  export interface UseDatePickerReturn extends Accessor<datePicker.Api<PropTypes>> {
24
34
  }
@@ -3,6 +3,11 @@ import { type PropTypes } from '@zag-js/solid';
3
3
  import { type Accessor } from 'solid-js';
4
4
  import type { Optional } from '../../types';
5
5
  export interface UseDialogProps extends Optional<Omit<dialog.Context, 'dir' | 'getRootNode' | 'open.controlled'>, 'id'> {
6
+ /**
7
+ * The initial open state of the dialog when it is first rendered.
8
+ * Use when you do not need to control its open state.
9
+ */
10
+ defaultOpen?: dialog.Context['open'];
6
11
  }
7
12
  export interface UseDialogReturn extends Accessor<dialog.Api<PropTypes>> {
8
13
  }
@@ -3,6 +3,11 @@ import { type PropTypes } from '@zag-js/solid';
3
3
  import { type Accessor } from 'solid-js';
4
4
  import type { Optional } from '../../types';
5
5
  export interface UseEditableProps extends Optional<Omit<editable.Context, 'dir' | 'getRootNode'>, 'id'> {
6
+ /**
7
+ * The initial value of the editable when it is first rendered.
8
+ * Use when you do not need to control the state of the editable.
9
+ */
10
+ defaultValue?: editable.Context['value'];
6
11
  }
7
12
  export interface UseEditableReturn extends Accessor<editable.Api<PropTypes>> {
8
13
  }
@@ -4,10 +4,9 @@ type ElementType = keyof JSX.IntrinsicElements;
4
4
  type JsxElements = {
5
5
  [E in ElementType]: ArkComponent<E>;
6
6
  };
7
- type PropsFn<T extends ElementType> = (userProps?: JSX.IntrinsicElements[T]) => JSX.HTMLAttributes<HTMLElement>;
7
+ type ParentProps<T extends ElementType> = (userProps?: JSX.IntrinsicElements[T]) => JSX.HTMLAttributes<any>;
8
8
  type PolymorphicProps<T extends ElementType> = {
9
- asChild?: boolean;
10
- children?: JSX.Element | ((props: PropsFn<T>) => JSX.Element);
9
+ asChild?: (props: ParentProps<T>) => JSX.Element;
11
10
  };
12
11
  type HTMLArkProps<E extends ElementType> = Assign<ComponentProps<E>, PolymorphicProps<E>>;
13
12
  type ArkComponent<E extends ElementType> = (props: HTMLArkProps<E>) => JSX.Element;
@@ -3,6 +3,11 @@ import { type PropTypes } from '@zag-js/solid';
3
3
  import { type Accessor } from 'solid-js';
4
4
  import type { Optional } from '../../types';
5
5
  export interface UseHoverCardProps extends Optional<Omit<hoverCard.Context, 'dir' | 'getRootNode' | 'open.controlled'>, 'id'> {
6
+ /**
7
+ * The initial open state of the hover card when it is first rendered.
8
+ * Use when you do not need to control its open state.
9
+ */
10
+ defaultOpen?: hoverCard.Context['open'];
6
11
  }
7
12
  export interface UseHoverCardReturn extends Accessor<hoverCard.Api<PropTypes>> {
8
13
  }
@@ -3,6 +3,11 @@ import { type PropTypes } from '@zag-js/solid';
3
3
  import { type Accessor } from 'solid-js';
4
4
  import type { Optional } from '../../types';
5
5
  export interface UseMenuProps extends Optional<Omit<menu.Context, 'dir' | 'getRootNode' | 'open.controlled'>, 'id'> {
6
+ /**
7
+ * The initial open state of the menu when it is first rendered.
8
+ * Use when you do not need to control its open state.
9
+ */
10
+ defaultOpen?: menu.Context['open'];
6
11
  }
7
12
  export interface UseMenuReturn {
8
13
  machine: menu.Service;
@@ -3,6 +3,11 @@ import { type PropTypes } from '@zag-js/solid';
3
3
  import { type Accessor } from 'solid-js';
4
4
  import type { Optional } from '../../types';
5
5
  export interface UseNumberInputProps extends Optional<Omit<numberInput.Context, 'dir' | 'getRootNode'>, 'id'> {
6
+ /**
7
+ * The initial value of the number input when it is first rendered.
8
+ * Use when you do not need to control the state of the number input.
9
+ */
10
+ defaultValue?: numberInput.Context['value'];
6
11
  }
7
12
  export interface UseNumberInputReturn extends Accessor<numberInput.Api<PropTypes>> {
8
13
  }
@@ -3,6 +3,11 @@ import { type PropTypes } from '@zag-js/solid';
3
3
  import { type Accessor } from 'solid-js';
4
4
  import type { Optional } from '../../types';
5
5
  export interface UsePaginationProps extends Optional<Omit<pagination.Context, 'dir' | 'getRootNode'>, 'id'> {
6
+ /**
7
+ * The initial page of the pagination when it is first rendered.
8
+ * Use when you do not need to control the state of the pagination.
9
+ */
10
+ defaultPage?: pagination.Context['page'];
6
11
  }
7
12
  export interface UsePaginationReturn extends Accessor<pagination.Api<PropTypes>> {
8
13
  }
@@ -3,6 +3,11 @@ import { type PropTypes } from '@zag-js/solid';
3
3
  import { type Accessor } from 'solid-js';
4
4
  import type { Optional } from '../../types';
5
5
  export interface UsePinInputProps extends Optional<Omit<pinInput.Context, 'dir' | 'getRootNode'>, 'id'> {
6
+ /**
7
+ * The initial value of the pin input when it is first rendered.
8
+ * Use when you do not need to control the state of the pin input
9
+ */
10
+ defaultValue?: pinInput.Context['value'];
6
11
  }
7
12
  export interface UsePinInputReturn extends Accessor<pinInput.Api<PropTypes>> {
8
13
  }
@@ -3,6 +3,11 @@ import { type PropTypes } from '@zag-js/solid';
3
3
  import { type Accessor } from 'solid-js';
4
4
  import type { Optional } from '../../types';
5
5
  export interface UsePopoverProps extends Optional<Omit<popover.Context, 'dir' | 'getRootNode' | 'open.controlled'>, 'id'> {
6
+ /**
7
+ * The initial open state of the popover when it is first rendered.
8
+ * Use when you do not need to control its open state.
9
+ */
10
+ defaultOpen?: popover.Context['open'];
6
11
  }
7
12
  export interface UsePopoverReturn extends Accessor<popover.Api<PropTypes>> {
8
13
  }
@@ -1,6 +1,4 @@
1
- import { Presence, type PresenceProps } from './presence';
2
- import { splitPresenceProps } from './split-presence-props';
3
- import { type UsePresenceProps, type UsePresenceReturn, usePresence } from './use-presence';
4
- import { PresenceProvider, type UsePresenceContext, usePresenceContext } from './use-presence-context';
5
- export { Presence, PresenceProvider, splitPresenceProps, usePresence, usePresenceContext };
6
- export type { PresenceProps, UsePresenceContext, UsePresenceProps, UsePresenceReturn };
1
+ export { Presence, type PresenceProps } from './presence';
2
+ export { splitPresenceProps } from './split-presence-props';
3
+ export { type UsePresenceProps, type UsePresenceReturn, usePresence } from './use-presence';
4
+ export { PresenceProvider, type UsePresenceContext, usePresenceContext, } from './use-presence-context';
@@ -3,6 +3,11 @@ import { type PropTypes } from '@zag-js/solid';
3
3
  import { type Accessor } from 'solid-js';
4
4
  import type { Optional } from '../../types';
5
5
  export interface UseRadioGroupProps extends Optional<Omit<radio.Context, 'dir' | 'getRootNode'>, 'id'> {
6
+ /**
7
+ * The initial value of the radio group when it is first rendered.
8
+ * Use when you do not need to control the state of the radio group.
9
+ */
10
+ defaultValue?: radio.Context['value'];
6
11
  }
7
12
  export interface UseRadioGroupReturn extends Accessor<radio.Api<PropTypes>> {
8
13
  }
@@ -3,6 +3,11 @@ import { type PropTypes } from '@zag-js/solid';
3
3
  import { type Accessor } from 'solid-js';
4
4
  import type { Optional } from '../../types';
5
5
  export interface UseRatingGroupProps extends Optional<Omit<rating.Context, 'dir' | 'getRootNode'>, 'id'> {
6
+ /**
7
+ * The initial value of the rating group when it is first rendered.
8
+ * Use when you do not need to control the state of the rating group.
9
+ */
10
+ defaultValue?: rating.Context['value'];
6
11
  }
7
12
  export interface UseRatingGroupReturn extends Accessor<rating.Api<PropTypes>> {
8
13
  }
@@ -1,9 +1,14 @@
1
- import * as segment from '@zag-js/radio-group';
1
+ import * as segmentGroup from '@zag-js/radio-group';
2
2
  import { type PropTypes } from '@zag-js/solid';
3
3
  import { type Accessor } from 'solid-js';
4
4
  import type { Optional } from '../../types';
5
- export interface UseSegmentGroupProps extends Optional<Omit<segment.Context, 'dir' | 'getRootNode'>, 'id'> {
5
+ export interface UseSegmentGroupProps extends Optional<Omit<segmentGroup.Context, 'dir' | 'getRootNode'>, 'id'> {
6
+ /**
7
+ * The initial value of the segment group when it is first rendered.
8
+ * Use when you do not need to control the state of the segment group.
9
+ */
10
+ defaultValue?: segmentGroup.Context['value'];
6
11
  }
7
- export interface UseSegmentGroupReturn extends Accessor<segment.Api<PropTypes>> {
12
+ export interface UseSegmentGroupReturn extends Accessor<segmentGroup.Api<PropTypes>> {
8
13
  }
9
14
  export declare const useSegmentGroup: (props: UseSegmentGroupProps) => UseSegmentGroupReturn;
@@ -4,6 +4,16 @@ import { type PropTypes } from '@zag-js/solid';
4
4
  import { type Accessor } from 'solid-js';
5
5
  import type { CollectionItem, Optional } from '../../types';
6
6
  export interface UseSelectProps<T extends CollectionItem> extends CollectionOptions<T>, Optional<Omit<select.Context<T>, 'collection' | 'dir' | 'getRootNode' | 'open.controlled'>, 'id'> {
7
+ /**
8
+ * The initial open state of the select when it is first rendered.
9
+ * Use when you do not need to control its open state.
10
+ */
11
+ defaultOpen?: select.Context['open'];
12
+ /**
13
+ * The initial value of the select when it is first rendered.
14
+ * Use when you do not need to control the state of the select.
15
+ */
16
+ defaultValue?: select.Context<T>['value'];
7
17
  }
8
18
  export interface UseSelectReturn<T extends CollectionItem> extends Accessor<select.Api<PropTypes, T>> {
9
19
  }
@@ -3,6 +3,11 @@ import { type PropTypes } from '@zag-js/solid';
3
3
  import { type Accessor } from 'solid-js';
4
4
  import type { Optional } from '../../types';
5
5
  export interface UseSliderProps extends Optional<Omit<slider.Context, 'dir' | 'getRootNode'>, 'id'> {
6
+ /**
7
+ * The initial value of the slider when it is first rendered.
8
+ * Use when you do not need to control the state of the slider picker.
9
+ */
10
+ defaultValue?: slider.Context['value'];
6
11
  }
7
12
  export interface UseSliderReturn extends Accessor<slider.Api<PropTypes>> {
8
13
  }
@@ -3,6 +3,11 @@ import * as splitter from '@zag-js/splitter';
3
3
  import { type Accessor } from 'solid-js';
4
4
  import type { Optional } from '../../types';
5
5
  export interface UseSplitterProps extends Optional<Omit<splitter.Context, 'dir' | 'getRootNode'>, 'id'> {
6
+ /**
7
+ * The initial size of the panels when it is first rendered.
8
+ * Use this when you do not need to control the state of the carousel.
9
+ */
10
+ defaultSize?: splitter.Context['size'];
6
11
  }
7
12
  export interface UseSplitterReturn extends Accessor<splitter.Api<PropTypes>> {
8
13
  }
@@ -3,6 +3,11 @@ import * as zagSwitch from '@zag-js/switch';
3
3
  import { type Accessor } from 'solid-js';
4
4
  import type { Optional } from '../../types';
5
5
  export interface UseSwitchProps extends Optional<Omit<zagSwitch.Context, 'dir' | 'getRootNode'>, 'id'> {
6
+ /**
7
+ * The checked state of the switch when it is first rendered.
8
+ * Use this when you do not need to control the state of the switch.
9
+ */
10
+ defaultChecked?: zagSwitch.Context['checked'];
6
11
  }
7
12
  export interface UseSwitchReturn extends Accessor<zagSwitch.Api<PropTypes>> {
8
13
  }
@@ -3,6 +3,11 @@ import * as tabs from '@zag-js/tabs';
3
3
  import { type Accessor } from 'solid-js';
4
4
  import type { Optional } from '../../types';
5
5
  export interface UseTabsProps extends Optional<Omit<tabs.Context, 'dir' | 'getRootNode'>, 'id'> {
6
+ /**
7
+ * The initial value of the tabs when it is first rendered.
8
+ * Use when you do not need to control the state of the tabs.
9
+ */
10
+ defaultValue?: tabs.Context['value'];
6
11
  }
7
12
  export interface UseTabsReturn extends Accessor<tabs.Api<PropTypes>> {
8
13
  }
@@ -3,6 +3,11 @@ import * as tagsInput from '@zag-js/tags-input';
3
3
  import { type Accessor } from 'solid-js';
4
4
  import type { Optional } from '../../types';
5
5
  export interface UseTagsInputProps extends Optional<Omit<tagsInput.Context, 'dir' | 'getRootNode'>, 'id'> {
6
+ /**
7
+ * The initial value of the tags input when it is first rendered.
8
+ * Use when you do not need to control the state of the tags input.
9
+ */
10
+ defaultValue?: tagsInput.Context['value'];
6
11
  }
7
12
  export interface UseTagsInputReturn extends Accessor<tagsInput.Api<PropTypes>> {
8
13
  }
@@ -3,6 +3,11 @@ import * as toggleGroup from '@zag-js/toggle-group';
3
3
  import { type Accessor } from 'solid-js';
4
4
  import type { Optional } from '../../types';
5
5
  export interface UseToggleGroupProps extends Optional<Omit<toggleGroup.Context, 'dir' | 'getRootNode'>, 'id'> {
6
+ /**
7
+ * The initial value of the toggle group when it is first rendered.
8
+ * Use when you do not need to control the state of the toggle group.
9
+ */
10
+ defaultValue?: toggleGroup.Context['value'];
6
11
  }
7
12
  export interface UseToggleGroupReturn extends Accessor<toggleGroup.Api<PropTypes>> {
8
13
  }
@@ -3,6 +3,11 @@ import * as tooltip from '@zag-js/tooltip';
3
3
  import { type Accessor } from 'solid-js';
4
4
  import type { Optional } from '../../types';
5
5
  export interface UseTooltipProps extends Optional<Omit<tooltip.Context, 'dir' | 'getRootNode' | 'open.controlled'>, 'id'> {
6
+ /**
7
+ * The initial open state of the tooltip when it is first rendered.
8
+ * Use when you do not need to control its open state.
9
+ */
10
+ defaultOpen?: tooltip.Context['open'];
6
11
  }
7
12
  export interface UseTooltipReturn extends Accessor<tooltip.Api<PropTypes>> {
8
13
  }
@@ -3,6 +3,16 @@ import * as treeView from '@zag-js/tree-view';
3
3
  import { type Accessor } from 'solid-js';
4
4
  import type { Optional } from '../../types';
5
5
  export interface UseTreeViewProps extends Optional<Omit<treeView.Context, 'dir' | 'getRootNode'>, 'id'> {
6
+ /**
7
+ * The initial selected items of the tree view.
8
+ * Use this when you do not need to control the state of the tree view.
9
+ */
10
+ defaultSelectedValue?: treeView.Context['selectedValue'];
11
+ /**
12
+ * The initial expanded items of the tree view.
13
+ * Use this when you do not need to control the state of the tree view.
14
+ */
15
+ defaultExpandedValue?: treeView.Context['expandedValue'];
6
16
  }
7
17
  export interface UseTreeViewReturn extends Accessor<treeView.Api<PropTypes>> {
8
18
  }
@@ -1,7 +1,7 @@
1
1
  import { type JSX } from 'solid-js';
2
2
  import { type RootNode } from './use-environment-context';
3
- export interface EnvironmentProps {
3
+ export interface EnvironmentProviderProps {
4
4
  children?: JSX.Element;
5
5
  value?: RootNode | (() => RootNode);
6
6
  }
7
- export declare const Environment: (props: EnvironmentProps) => JSX.Element;
7
+ export declare const EnvironmentProvider: (props: EnvironmentProviderProps) => JSX.Element;
@@ -1,2 +1,2 @@
1
- export { Environment, type EnvironmentProps } from './environment';
1
+ export { EnvironmentProvider, type EnvironmentProviderProps } from './environment-provider';
2
2
  export { useEnvironmentContext, type EnvironmentContext, type RootNode, } from './use-environment-context';
@@ -4,15 +4,18 @@ export interface EnvironmentContext {
4
4
  /**
5
5
  * The root node of the application.
6
6
  * This is used to determine the window and document objects.
7
+ * @default document
7
8
  */
8
9
  getRootNode(): RootNode;
9
10
  /**
10
11
  * The document context for the root node.
12
+ * @default document
11
13
  */
12
14
  getDocument(): Document;
13
15
  /**
14
16
  * The window context for the root node.
17
+ * @default window
15
18
  */
16
19
  getWindow(): Window & typeof globalThis;
17
20
  }
18
- export declare const EnvironmentProvider: import("solid-js").ContextProviderComponent<Accessor<EnvironmentContext>>, useEnvironmentContext: () => Accessor<EnvironmentContext>;
21
+ export declare const EnvironmentContextProvider: import("solid-js").ContextProviderComponent<Accessor<EnvironmentContext>>, useEnvironmentContext: () => Accessor<EnvironmentContext>;
@@ -1,10 +1,9 @@
1
- import { type LocaleOptions } from '@zag-js/i18n-utils';
2
1
  import { type ParentProps } from 'solid-js';
3
- export interface LocaleProviderProps extends LocaleOptions, ParentProps {
2
+ export interface LocaleProviderProps extends ParentProps {
4
3
  /**
5
- * The default locale to use if no locale is provided via props.
4
+ * The locale to use for the application.
6
5
  * @default 'en-US'
7
6
  */
8
- defaultLocale?: string;
7
+ locale: string;
9
8
  }
10
9
  export declare const LocaleProvider: (props: LocaleProviderProps) => import("solid-js").JSX.Element;