ui-ingredients 0.0.12 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,7 +18,7 @@
18
18
  <script lang="ts">
19
19
  import {useEnvironmentContext} from '../environment-provider/index.js';
20
20
  import {useLocaleContext} from '../locale-provider/index.js';
21
- import {uuid} from '../utils.svelte.js';
21
+ import {createUniqueId} from '../utils.svelte.js';
22
22
  import {mergeProps} from '@zag-js/svelte';
23
23
  import {
24
24
  createAccordionContext,
@@ -45,7 +45,7 @@
45
45
  let environmentContext = useEnvironmentContext();
46
46
 
47
47
  let context = createAccordionContext({
48
- id: id ?? uuid(),
48
+ id: id ?? createUniqueId(),
49
49
  ids,
50
50
  dir: dir ?? localeContext?.dir,
51
51
  value: $state.snapshot(value),
@@ -18,7 +18,7 @@
18
18
  <script lang="ts">
19
19
  import {useEnvironmentContext} from '../environment-provider/index.js';
20
20
  import {useLocaleContext} from '../locale-provider/index.js';
21
- import {uuid} from '../utils.svelte.js';
21
+ import {createUniqueId} from '../utils.svelte.js';
22
22
  import {mergeProps} from '@zag-js/svelte';
23
23
  import {createAvatarContext, setAvatarContext} from './context.svelte.js';
24
24
 
@@ -36,7 +36,7 @@
36
36
  let environmentContext = useEnvironmentContext();
37
37
 
38
38
  let context = createAvatarContext({
39
- id: id ?? uuid(),
39
+ id: id ?? createUniqueId(),
40
40
  ids,
41
41
  dir: dir ?? localeContext?.dir,
42
42
  onStatusChange,
@@ -18,7 +18,7 @@
18
18
  <script lang="ts">
19
19
  import {useEnvironmentContext} from '../environment-provider/index.js';
20
20
  import {useLocaleContext} from '../locale-provider/index.js';
21
- import {uuid} from '../utils.svelte.js';
21
+ import {createUniqueId} from '../utils.svelte.js';
22
22
  import {mergeProps} from '@zag-js/svelte';
23
23
  import {createCarouselContext, setCarouselContext} from './context.svelte.js';
24
24
 
@@ -42,7 +42,7 @@
42
42
  let environmentContext = useEnvironmentContext();
43
43
 
44
44
  let context = createCarouselContext({
45
- id: id ?? uuid(),
45
+ id: id ?? createUniqueId(),
46
46
  ids,
47
47
  dir: dir ?? localeContext?.dir,
48
48
  loop,
@@ -18,7 +18,7 @@
18
18
  <script lang="ts">
19
19
  import {useEnvironmentContext} from '../environment-provider/index.js';
20
20
  import {useLocaleContext} from '../locale-provider/index.js';
21
- import {uuid} from '../utils.svelte.js';
21
+ import {createUniqueId} from '../utils.svelte.js';
22
22
  import {mergeProps} from '@zag-js/svelte';
23
23
  import {createCheckboxContext, setCheckboxContext} from './context.svelte.js';
24
24
 
@@ -44,7 +44,7 @@
44
44
  let environmentContext = useEnvironmentContext();
45
45
 
46
46
  let context = createCheckboxContext({
47
- id: id ?? uuid(),
47
+ id: id ?? createUniqueId(),
48
48
  ids,
49
49
  dir: dir ?? localeContext?.dir,
50
50
  form,
@@ -17,7 +17,7 @@
17
17
 
18
18
  <script lang="ts">
19
19
  import {useEnvironmentContext} from '../environment-provider/index.js';
20
- import {uuid} from '../utils.svelte.js';
20
+ import {createUniqueId} from '../utils.svelte.js';
21
21
  import {mergeProps} from '@zag-js/svelte';
22
22
  import {
23
23
  createClipboardContext,
@@ -38,7 +38,7 @@
38
38
  let environmentContext = useEnvironmentContext();
39
39
 
40
40
  let context = createClipboardContext({
41
- id: id ?? uuid(),
41
+ id: id ?? createUniqueId(),
42
42
  ids,
43
43
  value: $state.snapshot(value),
44
44
  timeout,
@@ -18,7 +18,7 @@
18
18
  <script lang="ts">
19
19
  import {useEnvironmentContext} from '../environment-provider/index.js';
20
20
  import {useLocaleContext} from '../locale-provider/index.js';
21
- import {uuid} from '../utils.svelte.js';
21
+ import {createUniqueId} from '../utils.svelte.js';
22
22
  import {mergeProps} from '@zag-js/svelte';
23
23
  import {
24
24
  createCollapsibleContext,
@@ -43,7 +43,7 @@
43
43
  let environmentContext = useEnvironmentContext();
44
44
 
45
45
  let context = createCollapsibleContext({
46
- id: id ?? uuid(),
46
+ id: id ?? createUniqueId(),
47
47
  ids,
48
48
  dir: dir ?? localeContext?.dir,
49
49
  open,
@@ -7,7 +7,7 @@
7
7
  </script>
8
8
 
9
9
  <script lang="ts">
10
- import {uuid} from '../utils.svelte.js';
10
+ import {createUniqueId} from '../utils.svelte.js';
11
11
  import {mergeProps} from '@zag-js/svelte';
12
12
  import {
13
13
  setComboboxItemGroupPropsContext,
@@ -18,7 +18,7 @@
18
18
 
19
19
  let context = useComboboxContext();
20
20
 
21
- let uid = uuid();
21
+ let uid = createUniqueId();
22
22
 
23
23
  let attrs = $derived(
24
24
  mergeProps(props, context.getItemGroupProps({id: id ?? uid})),
@@ -18,7 +18,7 @@
18
18
  <script lang="ts" generics="T">
19
19
  import {useEnvironmentContext} from '../environment-provider/index.js';
20
20
  import {useLocaleContext} from '../locale-provider/index.js';
21
- import {uuid} from '../utils.svelte.js';
21
+ import {createUniqueId} from '../utils.svelte.js';
22
22
  import {mergeProps} from '@zag-js/svelte';
23
23
  import {createComboboxContext, setComboboxContext} from './context.svelte.js';
24
24
 
@@ -74,7 +74,7 @@
74
74
  let environmentContext = useEnvironmentContext();
75
75
 
76
76
  let context = createComboboxContext({
77
- id: id ?? uuid(),
77
+ id: id ?? createUniqueId(),
78
78
  ids,
79
79
  dir: dir ?? localeContext?.dir,
80
80
  name,
@@ -14,7 +14,7 @@
14
14
  <script lang="ts">
15
15
  import {useEnvironmentContext} from '../environment-provider/index.js';
16
16
  import {useLocaleContext} from '../locale-provider/index.js';
17
- import {uuid} from '../utils.svelte.js';
17
+ import {createUniqueId} from '../utils.svelte.js';
18
18
  import {createDialogContext, setDialogContext} from './context.svelte.js';
19
19
 
20
20
  let {id, dir, getRootNode, children, ...props}: DialogProps = $props();
@@ -23,7 +23,7 @@
23
23
  let environmentContext = useEnvironmentContext();
24
24
 
25
25
  let context = createDialogContext({
26
- id: id ?? uuid(),
26
+ id: id ?? createUniqueId(),
27
27
  dir: dir ?? localeContext?.dir,
28
28
  getRootNode: getRootNode ?? environmentContext?.getRootNode,
29
29
  ...props,
@@ -15,7 +15,7 @@
15
15
  <script lang="ts">
16
16
  import {useEnvironmentContext} from '../environment-provider/index.js';
17
17
  import {useLocaleContext} from '../locale-provider/index.js';
18
- import {uuid} from '../utils.svelte.js';
18
+ import {createUniqueId} from '../utils.svelte.js';
19
19
  import {createEditableContext, setEditableContext} from './context.svelte.js';
20
20
 
21
21
  let {id, dir, getRootNode, children, ...props}: EditableProps = $props();
@@ -24,7 +24,7 @@
24
24
  let environmentContext = useEnvironmentContext();
25
25
 
26
26
  let context = createEditableContext({
27
- id: id ?? uuid(),
27
+ id: id ?? createUniqueId(),
28
28
  dir: dir ?? localeContext?.dir,
29
29
  getRootNode: getRootNode ?? environmentContext?.getRootNode,
30
30
  ...props,
@@ -15,7 +15,7 @@
15
15
  <script lang="ts">
16
16
  import {useEnvironmentContext} from '../environment-provider/index.js';
17
17
  import {useLocaleContext} from '../locale-provider/index.js';
18
- import {uuid} from '../utils.svelte.js';
18
+ import {createUniqueId} from '../utils.svelte.js';
19
19
  import {
20
20
  createHoverCardContext,
21
21
  setHoverCardContext,
@@ -27,7 +27,7 @@
27
27
  let environmentContext = useEnvironmentContext();
28
28
 
29
29
  let context = createHoverCardContext({
30
- id: id ?? uuid(),
30
+ id: id ?? createUniqueId(),
31
31
  dir: dir ?? localeContext?.dir,
32
32
  getRootNode: getRootNode ?? environmentContext?.getRootNode,
33
33
  ...props,
@@ -18,7 +18,7 @@
18
18
  <script lang="ts">
19
19
  import {useEnvironmentContext} from '../environment-provider/index.js';
20
20
  import {useLocaleContext} from '../locale-provider/index.js';
21
- import {uuid} from '../utils.svelte.js';
21
+ import {createUniqueId} from '../utils.svelte.js';
22
22
  import {mergeProps} from '@zag-js/svelte';
23
23
  import {
24
24
  createNumberInputContext,
@@ -61,7 +61,7 @@
61
61
  let environmentContext = useEnvironmentContext();
62
62
 
63
63
  let context = createNumberInputContext({
64
- id: id ?? uuid(),
64
+ id: id ?? createUniqueId(),
65
65
  ids,
66
66
  dir: dir ?? localeContext?.dir,
67
67
  max,
@@ -18,7 +18,7 @@
18
18
  <script lang="ts">
19
19
  import {useEnvironmentContext} from '../environment-provider/index.js';
20
20
  import {useLocaleContext} from '../locale-provider/index.js';
21
- import {uuid} from '../utils.svelte.js';
21
+ import {createUniqueId} from '../utils.svelte.js';
22
22
  import {mergeProps} from '@zag-js/svelte';
23
23
  import {
24
24
  createPaginationContext,
@@ -46,7 +46,7 @@
46
46
  let environmentContext = useEnvironmentContext();
47
47
 
48
48
  let context = createPaginationContext({
49
- id: id ?? uuid(),
49
+ id: id ?? createUniqueId(),
50
50
  ids,
51
51
  dir: dir ?? localeContext?.dir,
52
52
  type,
@@ -18,7 +18,7 @@
18
18
  <script lang="ts">
19
19
  import {useEnvironmentContext} from '../environment-provider/index.js';
20
20
  import {useLocaleContext} from '../locale-provider/index.js';
21
- import {uuid} from '../utils.svelte.js';
21
+ import {createUniqueId} from '../utils.svelte.js';
22
22
  import {mergeProps} from '@zag-js/svelte';
23
23
  import {createPinInputContext, setPinInputContext} from './context.svelte.js';
24
24
 
@@ -54,7 +54,7 @@
54
54
  let environmentContext = useEnvironmentContext();
55
55
 
56
56
  let context = createPinInputContext({
57
- id: id ?? uuid(),
57
+ id: id ?? createUniqueId(),
58
58
  ids,
59
59
  dir: dir ?? localeContext?.dir,
60
60
  otp,
@@ -14,7 +14,7 @@
14
14
  <script lang="ts">
15
15
  import {useEnvironmentContext} from '../environment-provider/index.js';
16
16
  import {useLocaleContext} from '../locale-provider/index.js';
17
- import {uuid} from '../utils.svelte.js';
17
+ import {createUniqueId} from '../utils.svelte.js';
18
18
  import {createPopoverContext, setPopoverContext} from './context.svelte.js';
19
19
 
20
20
  let {id, dir, getRootNode, children, ...props}: PopoverProps = $props();
@@ -23,7 +23,7 @@
23
23
  let environmentContext = useEnvironmentContext();
24
24
 
25
25
  let context = createPopoverContext({
26
- id: id ?? uuid(),
26
+ id: id ?? createUniqueId(),
27
27
  dir: dir ?? localeContext?.dir,
28
28
  getRootNode: getRootNode ?? environmentContext?.getRootNode,
29
29
  ...props,
@@ -10,11 +10,19 @@
10
10
  </script>
11
11
 
12
12
  <script lang="ts">
13
+ import {useEnvironmentContext} from '../environment-provider/index.js';
13
14
  import {portal} from '@zag-js/svelte';
14
15
 
15
- let {children, ...props}: PortalProps = $props();
16
+ let {container, disabled, getRootNode, children}: PortalProps = $props();
17
+ let environmentContext = useEnvironmentContext();
16
18
  </script>
17
19
 
18
- <div use:portal={props}>
20
+ <div
21
+ use:portal={{
22
+ container,
23
+ disabled,
24
+ getRootNode: getRootNode ?? environmentContext?.getRootNode,
25
+ }}
26
+ >
19
27
  {@render children?.()}
20
28
  </div>
@@ -28,16 +28,10 @@
28
28
  );
29
29
 
30
30
  let api = $derived(presence.connect(machineState, send, normalizeProps));
31
-
32
- let node: HTMLElement | null = $state(null);
33
-
34
- $effect(() => {
35
- api.setNode(node);
36
- });
37
31
  </script>
38
32
 
39
33
  <div
40
- bind:this={node}
34
+ use:api.setNode
41
35
  hidden={!api.present}
42
36
  data-state={api.skip ? undefined : present ? 'open' : 'closed'}
43
37
  {...props}
@@ -18,7 +18,7 @@
18
18
  <script lang="ts">
19
19
  import {useEnvironmentContext} from '../environment-provider/index.js';
20
20
  import {useLocaleContext} from '../locale-provider/index.js';
21
- import {uuid} from '../utils.svelte.js';
21
+ import {createUniqueId} from '../utils.svelte.js';
22
22
  import {mergeProps} from '@zag-js/svelte';
23
23
  import {createProgressContext, setProgressContext} from './context.svelte.js';
24
24
 
@@ -40,7 +40,7 @@
40
40
  let environmentContext = useEnvironmentContext();
41
41
 
42
42
  let context = createProgressContext({
43
- id: id ?? uuid(),
43
+ id: id ?? createUniqueId(),
44
44
  ids,
45
45
  dir: dir ?? localeContext?.dir,
46
46
  max,
@@ -18,7 +18,7 @@
18
18
  <script lang="ts">
19
19
  import {useEnvironmentContext} from '../environment-provider/index.js';
20
20
  import {useLocaleContext} from '../locale-provider/index.js';
21
- import {uuid} from '../utils.svelte.js';
21
+ import {createUniqueId} from '../utils.svelte.js';
22
22
  import {mergeProps} from '@zag-js/svelte';
23
23
  import {createQRCodeContext, setQRCodeContext} from './context.svelte.js';
24
24
 
@@ -37,7 +37,7 @@
37
37
  let environmentContext = useEnvironmentContext();
38
38
 
39
39
  let context = createQRCodeContext({
40
- id: id ?? uuid(),
40
+ id: id ?? createUniqueId(),
41
41
  ids,
42
42
  dir: dir ?? localeContext?.dir,
43
43
  value: $state.snapshot(value),
@@ -18,7 +18,7 @@
18
18
  <script lang="ts">
19
19
  import {useEnvironmentContext} from '../environment-provider/index.js';
20
20
  import {useLocaleContext} from '../locale-provider/index.js';
21
- import {uuid} from '../utils.svelte.js';
21
+ import {createUniqueId} from '../utils.svelte.js';
22
22
  import {mergeProps} from '@zag-js/svelte';
23
23
  import {
24
24
  createRadioGroupContext,
@@ -45,7 +45,7 @@
45
45
  let environmentContext = useEnvironmentContext();
46
46
 
47
47
  let context = createRadioGroupContext({
48
- id: id ?? uuid(),
48
+ id: id ?? createUniqueId(),
49
49
  ids,
50
50
  dir: dir ?? localeContext?.dir,
51
51
  form,
@@ -18,7 +18,7 @@
18
18
  <script lang="ts">
19
19
  import {useEnvironmentContext} from '../environment-provider/index.js';
20
20
  import {useLocaleContext} from '../locale-provider/index.js';
21
- import {uuid} from '../utils.svelte.js';
21
+ import {createUniqueId} from '../utils.svelte.js';
22
22
  import {mergeProps} from '@zag-js/svelte';
23
23
  import {
24
24
  createRatingGroupContext,
@@ -50,7 +50,7 @@
50
50
  let environmentContext = useEnvironmentContext();
51
51
 
52
52
  let context = createRatingGroupContext({
53
- id: id ?? uuid(),
53
+ id: id ?? createUniqueId(),
54
54
  ids,
55
55
  dir: dir ?? localeContext?.dir,
56
56
  form,
@@ -18,7 +18,7 @@
18
18
  <script lang="ts">
19
19
  import {useEnvironmentContext} from '../environment-provider/index.js';
20
20
  import {useLocaleContext} from '../locale-provider/index.js';
21
- import {uuid} from '../utils.svelte.js';
21
+ import {createUniqueId} from '../utils.svelte.js';
22
22
  import {mergeProps} from '@zag-js/svelte';
23
23
  import {
24
24
  createSegmentGroupContext,
@@ -45,7 +45,7 @@
45
45
  let environmentContext = useEnvironmentContext();
46
46
 
47
47
  let context = createSegmentGroupContext({
48
- id: id ?? uuid(),
48
+ id: id ?? createUniqueId(),
49
49
  ids,
50
50
  dir: dir ?? localeContext?.dir,
51
51
  form,
@@ -7,7 +7,7 @@
7
7
  </script>
8
8
 
9
9
  <script lang="ts">
10
- import {uuid} from '../utils.svelte.js';
10
+ import {createUniqueId} from '../utils.svelte.js';
11
11
  import {mergeProps} from '@zag-js/svelte';
12
12
  import {
13
13
  setSelectItemGroupPropsContext,
@@ -18,7 +18,7 @@
18
18
 
19
19
  let context = useSelectContext();
20
20
 
21
- let uid = uuid();
21
+ let uid = createUniqueId();
22
22
 
23
23
  let attrs = $derived(
24
24
  mergeProps(props, context.getItemGroupProps({id: id ?? uid})),
@@ -18,7 +18,7 @@
18
18
  <script lang="ts" generics="T">
19
19
  import {useEnvironmentContext} from '../environment-provider/index.js';
20
20
  import {useLocaleContext} from '../locale-provider/index.js';
21
- import {uuid} from '../utils.svelte.js';
21
+ import {createUniqueId} from '../utils.svelte.js';
22
22
  import {mergeProps} from '@zag-js/svelte';
23
23
  import {createSelectContext, setSelectContext} from './context.svelte.js';
24
24
 
@@ -61,7 +61,7 @@
61
61
  let environmentContext = useEnvironmentContext();
62
62
 
63
63
  let context = createSelectContext({
64
- id: id ?? uuid(),
64
+ id: id ?? createUniqueId(),
65
65
  ids,
66
66
  dir: dir ?? localeContext?.dir,
67
67
  form,
@@ -18,7 +18,7 @@
18
18
  <script lang="ts">
19
19
  import {useEnvironmentContext} from '../environment-provider/index.js';
20
20
  import {useLocaleContext} from '../locale-provider/index.js';
21
- import {uuid} from '../utils.svelte.js';
21
+ import {createUniqueId} from '../utils.svelte.js';
22
22
  import {mergeProps} from '@zag-js/svelte';
23
23
  import {createSliderContext, setSliderContext} from './context.svelte.js';
24
24
 
@@ -55,7 +55,7 @@
55
55
  let environmentContext = useEnvironmentContext();
56
56
 
57
57
  let context = createSliderContext({
58
- id: id ?? uuid(),
58
+ id: id ?? createUniqueId(),
59
59
  ids,
60
60
  dir: dir ?? localeContext?.dir,
61
61
  max,
@@ -18,7 +18,7 @@
18
18
  <script lang="ts">
19
19
  import {useEnvironmentContext} from '../environment-provider/index.js';
20
20
  import {useLocaleContext} from '../locale-provider/index.js';
21
- import {uuid} from '../utils.svelte.js';
21
+ import {createUniqueId} from '../utils.svelte.js';
22
22
  import {mergeProps} from '@zag-js/svelte';
23
23
  import {createStepsContext, setStepsContext} from './context.svelte.js';
24
24
 
@@ -40,7 +40,7 @@
40
40
  let localeContext = useLocaleContext();
41
41
 
42
42
  let context = createStepsContext({
43
- id: id ?? uuid(),
43
+ id: id ?? createUniqueId(),
44
44
  ids,
45
45
  dir: dir ?? localeContext?.dir,
46
46
  step,
@@ -18,7 +18,7 @@
18
18
  <script lang="ts">
19
19
  import {useEnvironmentContext} from '../environment-provider/index.js';
20
20
  import {useLocaleContext} from '../locale-provider/index.js';
21
- import {uuid} from '../utils.svelte.js';
21
+ import {createUniqueId} from '../utils.svelte.js';
22
22
  import {mergeProps} from '@zag-js/svelte';
23
23
  import {createSwitchContext, setSwitchContext} from './context.svelte.js';
24
24
 
@@ -45,7 +45,7 @@
45
45
  let environmentContext = useEnvironmentContext();
46
46
 
47
47
  let context = createSwitchContext({
48
- id: id ?? uuid(),
48
+ id: id ?? createUniqueId(),
49
49
  ids,
50
50
  dir: dir ?? localeContext?.dir,
51
51
  form,
@@ -18,7 +18,7 @@
18
18
  <script lang="ts">
19
19
  import {useEnvironmentContext} from '../environment-provider/index.js';
20
20
  import {useLocaleContext} from '../locale-provider/index.js';
21
- import {uuid} from '../utils.svelte.js';
21
+ import {createUniqueId} from '../utils.svelte.js';
22
22
  import {mergeProps} from '@zag-js/svelte';
23
23
  import {createTabsContext, setTabsContext} from './context.svelte.js';
24
24
 
@@ -43,7 +43,7 @@
43
43
  let environmentContext = useEnvironmentContext();
44
44
 
45
45
  let context = createTabsContext({
46
- id: id ?? uuid(),
46
+ id: id ?? createUniqueId(),
47
47
  ids,
48
48
  dir: dir ?? localeContext?.dir,
49
49
  value: $state.snapshot(value),
@@ -18,7 +18,7 @@
18
18
  <script lang="ts">
19
19
  import {useEnvironmentContext} from '../environment-provider/index.js';
20
20
  import {useLocaleContext} from '../locale-provider/index.js';
21
- import {uuid} from '../utils.svelte.js';
21
+ import {createUniqueId} from '../utils.svelte.js';
22
22
  import {mergeProps} from '@zag-js/svelte';
23
23
  import {
24
24
  createTagsInputContext,
@@ -63,7 +63,7 @@
63
63
  let environmentContext = useEnvironmentContext();
64
64
 
65
65
  let context = createTagsInputContext({
66
- id: id ?? uuid(),
66
+ id: id ?? createUniqueId(),
67
67
  ids,
68
68
  dir: dir ?? localeContext?.dir,
69
69
  max,
@@ -17,7 +17,7 @@
17
17
 
18
18
  <script lang="ts">
19
19
  import {useEnvironmentContext} from '../environment-provider/index.js';
20
- import {uuid} from '../utils.svelte.js';
20
+ import {createUniqueId} from '../utils.svelte.js';
21
21
  import {mergeProps} from '@zag-js/svelte';
22
22
  import {createTimerContext, setTimerContext} from './context.svelte.js';
23
23
 
@@ -38,7 +38,7 @@
38
38
  let environmentContext = useEnvironmentContext();
39
39
 
40
40
  let context = createTimerContext({
41
- id: id ?? uuid(),
41
+ id: id ?? createUniqueId(),
42
42
  startMs,
43
43
  targetMs,
44
44
  interval,
@@ -1,12 +1,12 @@
1
1
  import { useEnvironmentContext } from '../environment-provider/index.js';
2
2
  import { useLocaleContext } from '../locale-provider/index.js';
3
- import { uuid } from '../utils.svelte.js';
3
+ import { createUniqueId } from '../utils.svelte.js';
4
4
  import { normalizeProps, reflect } from '@zag-js/svelte';
5
5
  import * as toast from '@zag-js/toast';
6
6
  export default function createToaster(props) {
7
7
  const localContext = useLocaleContext();
8
8
  const environmentContext = useEnvironmentContext();
9
- const id = $derived(props?.id ?? uuid());
9
+ const id = $derived(props?.id ?? createUniqueId());
10
10
  const dir = $derived(props?.dir ?? localContext?.dir);
11
11
  const getRootNode = $derived(props?.getRootNode ?? environmentContext?.getRootNode);
12
12
  const machine = $derived(toast.group.machine({
@@ -18,7 +18,7 @@
18
18
  <script lang="ts">
19
19
  import {useEnvironmentContext} from '../environment-provider/index.js';
20
20
  import {useLocaleContext} from '../locale-provider/index.js';
21
- import {uuid} from '../utils.svelte.js';
21
+ import {createUniqueId} from '../utils.svelte.js';
22
22
  import {mergeProps} from '@zag-js/svelte';
23
23
  import {
24
24
  createToggleGroupContext,
@@ -45,7 +45,7 @@
45
45
  let environmentContext = useEnvironmentContext();
46
46
 
47
47
  let context = createToggleGroupContext({
48
- id: id ?? uuid(),
48
+ id: id ?? createUniqueId(),
49
49
  ids,
50
50
  dir: dir ?? localeContext?.dir,
51
51
  value: $state.snapshot(value),
@@ -14,7 +14,7 @@
14
14
  <script lang="ts">
15
15
  import {useEnvironmentContext} from '../environment-provider/index.js';
16
16
  import {useLocaleContext} from '../locale-provider/index.js';
17
- import {uuid} from '../utils.svelte.js';
17
+ import {createUniqueId} from '../utils.svelte.js';
18
18
  import {createTooltipContext, setTooltipContext} from './context.svelte.js';
19
19
 
20
20
  let {id, dir, getRootNode, children, ...props}: TooltipProps = $props();
@@ -23,7 +23,7 @@
23
23
  let environmentContext = useEnvironmentContext();
24
24
 
25
25
  let context = createTooltipContext({
26
- id: id ?? uuid(),
26
+ id: id ?? createUniqueId(),
27
27
  dir: dir ?? localeContext?.dir,
28
28
  getRootNode: getRootNode ?? environmentContext?.getRootNode,
29
29
  ...props,
@@ -1 +1 @@
1
- export declare const uuid: () => string;
1
+ export declare const createUniqueId: () => string;
@@ -1,2 +1,2 @@
1
- import { nanoid } from 'nanoid/non-secure';
2
- export const uuid = () => nanoid(8);
1
+ import { uid } from 'uid';
2
+ export const createUniqueId = () => uid();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ui-ingredients",
3
3
  "type": "module",
4
- "version": "0.0.12",
4
+ "version": "0.0.14",
5
5
  "packageManager": "pnpm@9.7.0",
6
6
  "svelte": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -123,7 +123,7 @@
123
123
  "@zag-js/toggle-group": "0.65.1",
124
124
  "@zag-js/tooltip": "0.65.1",
125
125
  "@zag-js/tree-view": "0.65.1",
126
- "nanoid": "5.0.7"
126
+ "uid": "2.0.2"
127
127
  },
128
128
  "peerDependencies": {
129
129
  "svelte": "^5.0.0-next.1"