@webamoki/web-svelte 0.5.20 → 0.5.22

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.
@@ -6,7 +6,7 @@
6
6
  getLabel: (item: I) => string;
7
7
  getValue: (item: I) => V;
8
8
  vertical?: boolean;
9
- buttonContent?: Snippet<[label: string]>;
9
+ buttonContent?: Snippet<[label: string, item: I]>;
10
10
  }
11
11
  </script>
12
12
 
@@ -47,20 +47,30 @@
47
47
  )}
48
48
  >
49
49
  {#each items as item (getKey(item))}
50
- <button
51
- type="button"
52
- onclick={() => {
53
- if (disabled || readonly) return;
54
- handleItemClick(item);
55
- }}
56
- data-state={isActive(item) ? 'active' : 'inactive'}
57
- class="h-8 cursor-pointer rounded-lg bg-transparent p-2 text-muted-foreground hover:text-foreground hover:outline-2 focus-visible:outline-ring data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm"
58
- >
59
- {#if buttonContent}
60
- {@render buttonContent(getLabel(item))}
61
- {:else}
50
+ {#if buttonContent}
51
+ <button
52
+ type="button"
53
+ onclick={() => {
54
+ if (disabled || readonly) return;
55
+ handleItemClick(item);
56
+ }}
57
+ data-state={isActive(item) ? 'active' : 'inactive'}
58
+ class="cursor-pointer rounded-lg bg-transparent text-muted-foreground hover:text-foreground hover:outline-2 focus-visible:outline-ring data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm"
59
+ >
60
+ {@render buttonContent(getLabel(item), item)}
61
+ </button>
62
+ {:else}
63
+ <button
64
+ type="button"
65
+ onclick={() => {
66
+ if (disabled || readonly) return;
67
+ handleItemClick(item);
68
+ }}
69
+ data-state={isActive(item) ? 'active' : 'inactive'}
70
+ class="1p-2 h-8 cursor-pointer rounded-lg bg-transparent text-muted-foreground hover:text-foreground hover:outline-2 focus-visible:outline-ring data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm"
71
+ >
62
72
  {getLabel(item)}
63
- {/if}
64
- </button>
73
+ </button>
74
+ {/if}
65
75
  {/each}
66
76
  </div>
@@ -4,7 +4,7 @@ export interface ChoiceInternalProps<V, I, K extends string | number | symbol> e
4
4
  getLabel: (item: I) => string;
5
5
  getValue: (item: I) => V;
6
6
  vertical?: boolean;
7
- buttonContent?: Snippet<[label: string]>;
7
+ buttonContent?: Snippet<[label: string, item: I]>;
8
8
  }
9
9
  import type { FormAttrs } from '../../form/FieldWrapper.svelte';
10
10
  import type { Snippet } from 'svelte';
@@ -2,4 +2,5 @@ import Choice from './choice/Choice.svelte';
2
2
  import ChoiceMulti from './choice/ChoiceMulti.svelte';
3
3
  import WeekdayChoice from './choice/WeekdayChoice.svelte';
4
4
  import WeekdayChoiceMulti from './choice/WeekdayChoiceMulti.svelte';
5
- export { Choice, ChoiceMulti, WeekdayChoice, WeekdayChoiceMulti };
5
+ import SearchBar from './search/SearchBar.svelte';
6
+ export { Choice, ChoiceMulti, SearchBar, WeekdayChoice, WeekdayChoiceMulti };
@@ -2,4 +2,5 @@ import Choice from './choice/Choice.svelte';
2
2
  import ChoiceMulti from './choice/ChoiceMulti.svelte';
3
3
  import WeekdayChoice from './choice/WeekdayChoice.svelte';
4
4
  import WeekdayChoiceMulti from './choice/WeekdayChoiceMulti.svelte';
5
- export { Choice, ChoiceMulti, WeekdayChoice, WeekdayChoiceMulti };
5
+ import SearchBar from './search/SearchBar.svelte';
6
+ export { Choice, ChoiceMulti, SearchBar, WeekdayChoice, WeekdayChoiceMulti };
@@ -0,0 +1,24 @@
1
+ <script lang="ts">
2
+ import Input from '../../../shadcn/components/ui/input/input.svelte';
3
+ import { cn } from '../../../shadcn/utils.js';
4
+ import { Search } from '@lucide/svelte';
5
+
6
+ interface Props {
7
+ defaultValue?: string;
8
+ placeholder?: string;
9
+ onChange: (value: string) => void;
10
+ class?: string;
11
+ }
12
+ let { defaultValue, placeholder, onChange, class: className }: Props = $props();
13
+ </script>
14
+
15
+ <div class="relative w-full max-w-sm">
16
+ <Search class="absolute top-2.5 left-2.5 h-4 w-4 text-muted-foreground" />
17
+ <Input
18
+ type="search"
19
+ {placeholder}
20
+ value={defaultValue}
21
+ oninput={(e: Event & { currentTarget: HTMLInputElement }) => onChange(e.currentTarget.value)}
22
+ class={cn('w-full pl-9', className)}
23
+ />
24
+ </div>
@@ -0,0 +1,9 @@
1
+ interface Props {
2
+ defaultValue?: string;
3
+ placeholder?: string;
4
+ onChange: (value: string) => void;
5
+ class?: string;
6
+ }
7
+ declare const SearchBar: import("svelte").Component<Props, {}, "">;
8
+ type SearchBar = ReturnType<typeof SearchBar>;
9
+ export default SearchBar;
@@ -2,16 +2,16 @@ import { Type } from 'arktype';
2
2
  import { Days } from '../datetime/index.js';
3
3
  import { Time as timeImport, CalendarDate as calendarImport } from '@internationalized/date';
4
4
  /** Type string which is trimmed before narrowing the type checking */
5
- export declare function trimTo(typeTo: Type<string>): import("arktype/internal/methods/object.ts").ObjectType<(In: string) => import("arktype/internal/attributes.ts").To<string>, {}>;
6
- export declare const Day: import("arktype/internal/methods/string.ts").StringType<"Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday", {}>;
5
+ export declare function trimTo(typeTo: Type<string>): import("arktype/internal/variants/object.ts").ObjectType<(In: string) => import("arktype/internal/attributes.ts").To<string>, {}>;
6
+ export declare const Day: import("arktype/internal/variants/string.ts").StringType<"Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday", {}>;
7
7
  export type Day = (typeof Days)[number];
8
- export declare const Time: import("arktype/internal/methods/object.ts").ObjectType<timeImport, {}>;
9
- export declare const CalendarDate: import("arktype/internal/methods/object.ts").ObjectType<calendarImport, {}>;
10
- export declare const HexColor: import("arktype/internal/methods/string.ts").StringType<string, {}>;
11
- export declare const Email: import("arktype/internal/methods/object.ts").ObjectType<(In: string) => import("arktype").Out<string>, {}>;
12
- export declare const Name: import("arktype/internal/methods/object.ts").ObjectType<(In: string) => import("arktype").Out<string>, {}>;
13
- export declare const FirstName: import("arktype/internal/methods/object.ts").ObjectType<(In: string) => import("arktype").Out<string>, {}>;
14
- export declare const LastName: import("arktype/internal/methods/object.ts").ObjectType<(In: string) => import("arktype").Out<string>, {}>;
15
- export declare const Id: import("arktype/internal/methods/number.ts").NumberType<number, {}>;
16
- export declare const Password: import("arktype/internal/methods/string.ts").StringType<string, {}>;
17
- export declare const Duration: import("arktype/internal/methods/number.ts").NumberType<number, {}>;
8
+ export declare const Time: import("arktype/internal/variants/object.ts").ObjectType<timeImport, {}>;
9
+ export declare const CalendarDate: import("arktype/internal/variants/object.ts").ObjectType<calendarImport, {}>;
10
+ export declare const HexColor: import("arktype/internal/variants/string.ts").StringType<string, {}>;
11
+ export declare const Email: import("arktype/internal/variants/object.ts").ObjectType<(In: string) => import("arktype").Out<string>, {}>;
12
+ export declare const Name: import("arktype/internal/variants/object.ts").ObjectType<(In: string) => import("arktype").Out<string>, {}>;
13
+ export declare const FirstName: import("arktype/internal/variants/object.ts").ObjectType<(In: string) => import("arktype").Out<string>, {}>;
14
+ export declare const LastName: import("arktype/internal/variants/object.ts").ObjectType<(In: string) => import("arktype").Out<string>, {}>;
15
+ export declare const Id: import("arktype/internal/variants/number.ts").NumberType<number, {}>;
16
+ export declare const Password: import("arktype/internal/variants/string.ts").StringType<string, {}>;
17
+ export declare const Duration: import("arktype/internal/variants/number.ts").NumberType<number, {}>;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.5.20",
6
+ "version": "0.5.22",
7
7
  "license": "MIT",
8
8
  "files": [
9
9
  "dist",
@@ -57,49 +57,49 @@
57
57
  },
58
58
  "devDependencies": {
59
59
  "@changesets/cli": "^2.29.7",
60
- "@eslint/compat": "^1.2.5",
61
- "@eslint/js": "^9.22.0",
60
+ "@eslint/compat": "^1.4.0",
61
+ "@eslint/js": "^9.37.0",
62
62
  "@lucide/svelte": "^0.544.0",
63
- "@sveltejs/adapter-static": "^3.0.8",
64
- "@sveltejs/kit": "^2.22.0",
65
- "@sveltejs/package": "^2.0.0",
66
- "@sveltejs/vite-plugin-svelte": "^6.0.0",
67
- "@tailwindcss/forms": "^0.5.9",
68
- "@tailwindcss/typography": "^0.5.15",
69
- "@tailwindcss/vite": "^4.0.0",
70
- "@types/node": "^22",
63
+ "@sveltejs/adapter-static": "^3.0.10",
64
+ "@sveltejs/kit": "^2.46.5",
65
+ "@sveltejs/package": "^2.5.4",
66
+ "@sveltejs/vite-plugin-svelte": "^6.2.1",
67
+ "@tailwindcss/forms": "^0.5.10",
68
+ "@tailwindcss/typography": "^0.5.19",
69
+ "@tailwindcss/vite": "^4.1.14",
70
+ "@types/node": "^22.18.10",
71
71
  "@types/ramda": "^0.31.1",
72
72
  "@types/sorted-array-functions": "^1.3.3",
73
- "arktype": "^2.1.22",
74
- "bits-ui": "^2.11.4",
73
+ "arktype": "^2.1.23",
74
+ "bits-ui": "^2.11.5",
75
75
  "clsx": "^2.1.1",
76
- "eslint": "^9.22.0",
77
- "eslint-config-prettier": "^10.0.1",
78
- "eslint-plugin-svelte": "^3.0.0",
79
- "globals": "^16.0.0",
80
- "prettier": "^3.4.2",
81
- "prettier-plugin-svelte": "^3.3.3",
82
- "prettier-plugin-tailwindcss": "^0.6.11",
83
- "publint": "^0.3.2",
76
+ "eslint": "^9.37.0",
77
+ "eslint-config-prettier": "^10.1.8",
78
+ "eslint-plugin-svelte": "^3.12.4",
79
+ "globals": "^16.4.0",
80
+ "prettier": "^3.6.2",
81
+ "prettier-plugin-svelte": "^3.4.0",
82
+ "prettier-plugin-tailwindcss": "^0.6.14",
83
+ "publint": "^0.3.14",
84
84
  "shiki": "^3.13.0",
85
- "svelte": "^5.0.0",
86
- "svelte-check": "^4.0.0",
87
- "sveltekit-superforms": "^2.27.1",
85
+ "svelte": "^5.40.0",
86
+ "svelte-check": "^4.3.3",
87
+ "sveltekit-superforms": "^2.27.4",
88
88
  "tailwind-merge": "^3.3.1",
89
89
  "tailwind-variants": "^3.1.1",
90
- "tailwindcss": "^4.0.0",
91
- "tw-animate-css": "^1.3.8",
92
- "typescript": "^5.0.0",
93
- "typescript-eslint": "^8.20.0",
94
- "vite": "^7.0.4",
95
- "vitest": "^3.2.3"
90
+ "tailwindcss": "^4.1.14",
91
+ "tw-animate-css": "^1.4.0",
92
+ "typescript": "^5.9.3",
93
+ "typescript-eslint": "^8.46.1",
94
+ "vite": "^7.1.10",
95
+ "vitest": "^3.2.4"
96
96
  },
97
97
  "keywords": [
98
98
  "svelte"
99
99
  ],
100
100
  "dependencies": {
101
101
  "dotenv": "^17.2.3",
102
- "drizzle-orm": "^0.44.5",
102
+ "drizzle-orm": "^0.44.6",
103
103
  "formsnap": "^2.0.1",
104
104
  "pg": "^8.16.3",
105
105
  "ramda": "^0.31.3",