ui-ingredients 0.0.1 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -71,3 +71,5 @@ npm install ui-ingredients
71
71
  - 🟢 Toast
72
72
  - 🟢 ToggleGroup
73
73
  - 🟢 Tooltip
74
+
75
+ View components demo [here](https://ui-ingredients.vercel.app/)
@@ -1,10 +1,10 @@
1
1
  <script lang="ts" context="module"></script>
2
2
 
3
- <script lang="ts">import { mergeProps } from "@zag-js/svelte";
4
- import { nanoid } from "nanoid/non-secure";
3
+ <script lang="ts">import { uuid } from "../utils.svelte.js";
4
+ import { mergeProps } from "@zag-js/svelte";
5
5
  import { createAccordionContext, setAccordionContext } from "./context.svelte.js";
6
6
  let {
7
- id = nanoid(),
7
+ id = uuid(),
8
8
  ids,
9
9
  dir,
10
10
  value,
@@ -1,11 +1,11 @@
1
1
  <script lang="ts" context="module">import {} from "./context.svelte.js";
2
2
  </script>
3
3
 
4
- <script lang="ts">import { mergeProps } from "@zag-js/svelte";
5
- import { nanoid } from "nanoid/non-secure";
4
+ <script lang="ts">import { uuid } from "../utils.svelte.js";
5
+ import { mergeProps } from "@zag-js/svelte";
6
6
  import { createAvatarContext, setAvatarContext } from "./context.svelte.js";
7
7
  let {
8
- id = nanoid(),
8
+ id = uuid(),
9
9
  ids,
10
10
  dir,
11
11
  getRootNode,
@@ -1,10 +1,10 @@
1
1
  <script lang="ts" context="module"></script>
2
2
 
3
- <script lang="ts">import { mergeProps } from "@zag-js/svelte";
4
- import { nanoid } from "nanoid/non-secure";
3
+ <script lang="ts">import { uuid } from "../utils.svelte.js";
4
+ import { mergeProps } from "@zag-js/svelte";
5
5
  import { createCarouselContext, setCarouselContext } from "./context.svelte.js";
6
6
  let {
7
- id = nanoid(),
7
+ id = uuid(),
8
8
  ids,
9
9
  dir,
10
10
  loop,
@@ -1,10 +1,10 @@
1
1
  <script lang="ts" context="module"></script>
2
2
 
3
- <script lang="ts">import { mergeProps } from "@zag-js/svelte";
4
- import { nanoid } from "nanoid/non-secure";
3
+ <script lang="ts">import { uuid } from "../utils.svelte.js";
4
+ import { mergeProps } from "@zag-js/svelte";
5
5
  import { createCheckboxContext, setCheckboxContext } from "./context.svelte.js";
6
6
  let {
7
- id = nanoid(),
7
+ id = uuid(),
8
8
  ids,
9
9
  dir,
10
10
  form,
@@ -1,10 +1,10 @@
1
1
  <script lang="ts" context="module"></script>
2
2
 
3
- <script lang="ts">import { mergeProps } from "@zag-js/svelte";
4
- import { nanoid } from "nanoid/non-secure";
3
+ <script lang="ts">import { uuid } from "../utils.svelte.js";
4
+ import { mergeProps } from "@zag-js/svelte";
5
5
  import { createClipboardContext, setClipboardContext } from "./context.svelte.js";
6
6
  let {
7
- id = nanoid(),
7
+ id = uuid(),
8
8
  ids,
9
9
  value,
10
10
  timeout,
@@ -1,10 +1,10 @@
1
1
  <script lang="ts" context="module"></script>
2
2
 
3
- <script lang="ts">import { mergeProps } from "@zag-js/svelte";
4
- import { nanoid } from "nanoid/non-secure";
3
+ <script lang="ts">import { uuid } from "../utils.svelte.js";
4
+ import { mergeProps } from "@zag-js/svelte";
5
5
  import { createCollapsibleContext, setCollapsibleContext } from "./context.svelte.js";
6
6
  let {
7
- id = nanoid(),
7
+ id = uuid(),
8
8
  ids,
9
9
  dir,
10
10
  open,
@@ -1,9 +1,9 @@
1
1
  <script lang="ts" context="module"></script>
2
2
 
3
- <script lang="ts">import { mergeProps } from "@zag-js/svelte";
4
- import { nanoid } from "nanoid/non-secure";
3
+ <script lang="ts">import { uuid } from "../utils.svelte.js";
4
+ import { mergeProps } from "@zag-js/svelte";
5
5
  import { setComboboxItemGroupContext, useComboboxContext } from "./context.svelte.js";
6
- let { id = nanoid(), children, ...props } = $props();
6
+ let { id = uuid(), children, ...props } = $props();
7
7
  let context = useComboboxContext();
8
8
  let attrs = $derived(mergeProps(props, context.getItemGroupProps({ id })));
9
9
  setComboboxItemGroupContext({ id });
@@ -1,10 +1,10 @@
1
1
  <script lang="ts" context="module"></script>
2
2
 
3
- <script lang="ts" generics="T">import { mergeProps } from "@zag-js/svelte";
4
- import { nanoid } from "nanoid/non-secure";
3
+ <script lang="ts" generics="T">import { uuid } from "../utils.svelte.js";
4
+ import { mergeProps } from "@zag-js/svelte";
5
5
  import { createComboboxContext, setComboboxContext } from "./context.svelte.js";
6
6
  let {
7
- id = nanoid(),
7
+ id = uuid(),
8
8
  ids,
9
9
  dir,
10
10
  name,
@@ -1,8 +1,8 @@
1
1
  <script lang="ts" context="module"></script>
2
2
 
3
- <script lang="ts">import { nanoid } from "nanoid/non-secure";
3
+ <script lang="ts">import { uuid } from "../utils.svelte.js";
4
4
  import { createDialogContext, setDialogContext } from "./context.svelte.js";
5
- let { id = nanoid(), children, ...props } = $props();
5
+ let { id = uuid(), children, ...props } = $props();
6
6
  let context = createDialogContext({ id, ...props });
7
7
  setDialogContext(context);
8
8
  </script>
@@ -1,8 +1,8 @@
1
1
  <script lang="ts" context="module"></script>
2
2
 
3
- <script lang="ts">import { nanoid } from "nanoid/non-secure";
3
+ <script lang="ts">import { uuid } from "../utils.svelte.js";
4
4
  import { createHoverCardContext, setHoverCardContext } from "./context.svelte.js";
5
- let { id = nanoid(), children, ...props } = $props();
5
+ let { id = uuid(), children, ...props } = $props();
6
6
  let context = createHoverCardContext({ id, ...props });
7
7
  setHoverCardContext(context);
8
8
  </script>
@@ -1,10 +1,10 @@
1
1
  <script lang="ts" context="module"></script>
2
2
 
3
- <script lang="ts">import { mergeProps } from "@zag-js/svelte";
4
- import { nanoid } from "nanoid/non-secure";
3
+ <script lang="ts">import { uuid } from "../utils.svelte.js";
4
+ import { mergeProps } from "@zag-js/svelte";
5
5
  import { createNumberInputContext, setNumberInputContext } from "./context.svelte.js";
6
6
  let {
7
- id = nanoid(),
7
+ id = uuid(),
8
8
  ids,
9
9
  dir,
10
10
  max,
@@ -1,10 +1,10 @@
1
1
  <script lang="ts" context="module"></script>
2
2
 
3
- <script lang="ts">import { mergeProps } from "@zag-js/svelte";
4
- import { nanoid } from "nanoid/non-secure";
3
+ <script lang="ts">import { uuid } from "../utils.svelte.js";
4
+ import { mergeProps } from "@zag-js/svelte";
5
5
  import { createPaginationContext, setPaginationContext } from "./context.svelte.js";
6
6
  let {
7
- id = nanoid(),
7
+ id = uuid(),
8
8
  ids,
9
9
  dir,
10
10
  type,
@@ -1,10 +1,10 @@
1
1
  <script lang="ts" context="module"></script>
2
2
 
3
- <script lang="ts">import { mergeProps } from "@zag-js/svelte";
4
- import { nanoid } from "nanoid/non-secure";
3
+ <script lang="ts">import { uuid } from "../utils.svelte.js";
4
+ import { mergeProps } from "@zag-js/svelte";
5
5
  import { createPinInputContext, setPinInputContext } from "./context.svelte.js";
6
6
  let {
7
- id = nanoid(),
7
+ id = uuid(),
8
8
  ids,
9
9
  dir,
10
10
  otp,
@@ -1,8 +1,8 @@
1
1
  <script lang="ts" context="module"></script>
2
2
 
3
- <script lang="ts">import { nanoid } from "nanoid/non-secure";
3
+ <script lang="ts">import { uuid } from "../utils.svelte.js";
4
4
  import { createPopoverContext, setPopoverContext } from "./context.svelte.js";
5
- let { id = nanoid(), children, ...props } = $props();
5
+ let { id = uuid(), children, ...props } = $props();
6
6
  let context = createPopoverContext({ id, ...props });
7
7
  setPopoverContext(context);
8
8
  </script>
@@ -1,10 +1,10 @@
1
1
  <script lang="ts" context="module"></script>
2
2
 
3
- <script lang="ts">import { mergeProps } from "@zag-js/svelte";
4
- import { nanoid } from "nanoid/non-secure";
3
+ <script lang="ts">import { uuid } from "../utils.svelte.js";
4
+ import { mergeProps } from "@zag-js/svelte";
5
5
  import { createProgressContext, setProgressContext } from "./context.svelte.js";
6
6
  let {
7
- id = nanoid(),
7
+ id = uuid(),
8
8
  ids,
9
9
  dir,
10
10
  max,
@@ -1,10 +1,10 @@
1
1
  <script lang="ts" context="module"></script>
2
2
 
3
- <script lang="ts">import { mergeProps } from "@zag-js/svelte";
4
- import { nanoid } from "nanoid/non-secure";
3
+ <script lang="ts">import { uuid } from "../utils.svelte.js";
4
+ import { mergeProps } from "@zag-js/svelte";
5
5
  import { createRadioGroupContext, setRadioGroupContext } from "./context.svelte.js";
6
6
  let {
7
- id = nanoid(),
7
+ id = uuid(),
8
8
  ids,
9
9
  dir,
10
10
  form,
@@ -1,9 +1,9 @@
1
1
  <script lang="ts" context="module"></script>
2
2
 
3
- <script lang="ts">import { mergeProps } from "@zag-js/svelte";
4
- import { nanoid } from "nanoid/non-secure";
3
+ <script lang="ts">import { uuid } from "../utils.svelte.js";
4
+ import { mergeProps } from "@zag-js/svelte";
5
5
  import { setSelectItemGroupContext, useSelectContext } from "./context.svelte.js";
6
- let { id = nanoid(), children, ...props } = $props();
6
+ let { id = uuid(), children, ...props } = $props();
7
7
  let context = useSelectContext();
8
8
  let attrs = $derived(mergeProps(props, context.getItemGroupProps({ id })));
9
9
  setSelectItemGroupContext({ id });
@@ -1,10 +1,10 @@
1
1
  <script lang="ts" context="module"></script>
2
2
 
3
- <script lang="ts" generics="T">import { mergeProps } from "@zag-js/svelte";
4
- import { nanoid } from "nanoid/non-secure";
3
+ <script lang="ts" generics="T">import { uuid } from "../utils.svelte.js";
4
+ import { mergeProps } from "@zag-js/svelte";
5
5
  import { createSelectContext, setSelectContext } from "./context.svelte.js";
6
6
  let {
7
- id = nanoid(),
7
+ id = uuid(),
8
8
  ids,
9
9
  dir,
10
10
  form,
@@ -1,10 +1,10 @@
1
1
  <script lang="ts" context="module"></script>
2
2
 
3
- <script lang="ts">import { mergeProps } from "@zag-js/svelte";
4
- import { nanoid } from "nanoid/non-secure";
3
+ <script lang="ts">import { uuid } from "../utils.svelte.js";
4
+ import { mergeProps } from "@zag-js/svelte";
5
5
  import { createSliderContext, setSliderContext } from "./context.svelte.js";
6
6
  let {
7
- id = nanoid(),
7
+ id = uuid(),
8
8
  ids,
9
9
  dir,
10
10
  max,
@@ -1,10 +1,10 @@
1
1
  <script lang="ts" context="module"></script>
2
2
 
3
- <script lang="ts">import { mergeProps } from "@zag-js/svelte";
4
- import { nanoid } from "nanoid/non-secure";
3
+ <script lang="ts">import { uuid } from "../utils.svelte.js";
4
+ import { mergeProps } from "@zag-js/svelte";
5
5
  import { createSwitchContext, setSwitchContext } from "./context.svelte.js";
6
6
  let {
7
- id = nanoid(),
7
+ id = uuid(),
8
8
  ids,
9
9
  dir,
10
10
  form,
@@ -1,10 +1,10 @@
1
1
  <script lang="ts" context="module"></script>
2
2
 
3
- <script lang="ts">import { mergeProps } from "@zag-js/svelte";
4
- import { nanoid } from "nanoid/non-secure";
3
+ <script lang="ts">import { uuid } from "../utils.svelte.js";
4
+ import { mergeProps } from "@zag-js/svelte";
5
5
  import { createTabsContext, setTabsContext } from "./context.svelte.js";
6
6
  let {
7
- id = nanoid(),
7
+ id = uuid(),
8
8
  ids,
9
9
  dir,
10
10
  value,
@@ -1,8 +1,8 @@
1
+ import { uuid } from '../utils.svelte.js';
1
2
  import { normalizeProps, reflect } from '@zag-js/svelte';
2
3
  import * as toast from '@zag-js/toast';
3
- import { nanoid } from 'nanoid/non-secure';
4
4
  export default function createToaster(props) {
5
- const id = $derived(props?.id ?? nanoid());
5
+ const id = $derived(props?.id ?? uuid());
6
6
  const machine = $derived(toast.group.machine({ ...props, id }));
7
7
  const api = $derived(reflect(() => ({
8
8
  machine,
@@ -1,10 +1,10 @@
1
1
  <script lang="ts" context="module"></script>
2
2
 
3
- <script lang="ts">import { mergeProps } from "@zag-js/svelte";
4
- import { nanoid } from "nanoid/non-secure";
3
+ <script lang="ts">import { uuid } from "../utils.svelte.js";
4
+ import { mergeProps } from "@zag-js/svelte";
5
5
  import { createToggleGroupContext, setToggleGroupContext } from "./context.svelte.js";
6
6
  let {
7
- id = nanoid(),
7
+ id = uuid(),
8
8
  ids,
9
9
  dir,
10
10
  value,
@@ -19,7 +19,7 @@ let {
19
19
  ...props
20
20
  } = $props();
21
21
  let context = createToggleGroupContext({
22
- id: nanoid(),
22
+ id,
23
23
  ids,
24
24
  dir,
25
25
  value: $state.snapshot(value),
@@ -1,8 +1,8 @@
1
1
  <script lang="ts" context="module"></script>
2
2
 
3
- <script lang="ts">import { nanoid } from "nanoid/non-secure";
3
+ <script lang="ts">import { uuid } from "../utils.svelte.js";
4
4
  import { createTooltipContext, setTooltipContext } from "./context.svelte.js";
5
- let { id = nanoid(), children, ...props } = $props();
5
+ let { id = uuid(), children, ...props } = $props();
6
6
  let context = createTooltipContext({ id, ...props });
7
7
  setTooltipContext(context);
8
8
  </script>
package/dist/types.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  export type Assign<T, U> = Omit<T, keyof U> & U;
2
- export type ContextGetter<T> = () => T;
3
2
  export type OptionalId<T> = Assign<T, {
4
3
  id?: string;
5
4
  }>;
@@ -1,2 +1 @@
1
- export declare function makeFieldsGetterSetterIfNotFunc<T extends Record<string, any>>(o: T): T;
2
- export declare function splitProps(): void;
1
+ export declare const uuid: () => string;
@@ -1,24 +1,3 @@
1
- export function makeFieldsGetterSetterIfNotFunc(o) {
2
- let r = {};
3
- for (const k in o) {
4
- const v = o[k];
5
- if (typeof v === 'function') {
6
- r = Object.assign(r, {
7
- [k](...args) {
8
- return v(...args);
9
- },
10
- });
11
- continue;
12
- }
13
- r = Object.assign(r, {
14
- get [k]() {
15
- return v;
16
- },
17
- set [k](v) {
18
- o[k] = v;
19
- },
20
- });
21
- }
22
- return r;
23
- }
24
- export function splitProps() { }
1
+ import hyperid from 'hyperid';
2
+ const h = hyperid();
3
+ export const uuid = () => h.uuid;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ui-ingredients",
3
3
  "type": "module",
4
- "version": "0.0.1",
4
+ "version": "0.0.3",
5
5
  "packageManager": "pnpm@9.7.0",
6
6
  "svelte": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -24,6 +24,10 @@
24
24
  "type": "git",
25
25
  "url": "git@github.com:calvo-jp/ui-ingredients.git"
26
26
  },
27
+ "bugs": {
28
+ "url": "https://github.com/calvo-jp/ui-ingredients/issues",
29
+ "email": "calvojp92@gmail.com"
30
+ },
27
31
  "description": "Headless component library for Svelte powered by zag",
28
32
  "keywords": [
29
33
  "Svelte",
@@ -118,7 +122,7 @@
118
122
  "@zag-js/toast": "0.65.0",
119
123
  "@zag-js/toggle-group": "0.65.0",
120
124
  "@zag-js/tooltip": "0.65.0",
121
- "nanoid": "5.0.7"
125
+ "hyperid": "3.2.0"
122
126
  },
123
127
  "peerDependencies": {
124
128
  "svelte": ">=5.0.0-next.200"