@valerius_petrini/corekit-ui 0.1.40 → 0.1.42

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.
@@ -1,13 +1,17 @@
1
1
  <script lang="ts">
2
+ import type { FloatingSelectProps } from "../types/FloatingSelect.js";
2
3
  import { twMerge } from "tailwind-merge";
3
4
 
4
5
  let {
5
6
  children = undefined,
6
- class: className = "",
7
+ class: className = "",
8
+ divName = "",
9
+ optionClass = "",
10
+ value = $bindable(),
7
11
  options = [],
8
12
  id = crypto.randomUUID(),
9
13
  ...restProps
10
- } = $props();
14
+ }: FloatingSelectProps = $props();
11
15
 
12
16
  let defaultSelectClass = "cursor-pointer bg-form-input-background text-main-text z-20 w-full rounded px-1 pt-4 pb-1 text-xs outline-none focus:ring-2 focus:ring-blue-500 transition-all";
13
17
  let defaultLabelClass = "block text-sub-text rounded-md text-sm font-medium mb-1 absolute transition-all duration-100 pointer-events-none";
@@ -18,15 +22,18 @@
18
22
 
19
23
  let combinedLabelClass = $derived(twMerge(defaultLabelClass, selectedLabelClass, className));
20
24
  let combinedSelectClass = $derived(twMerge(defaultSelectClass, className));
25
+ let combinedDivClass = $derived(twMerge(defaultDivClass, divName));
21
26
  </script>
22
27
 
23
- <div class={defaultDivClass}>
28
+ <div class={combinedDivClass}>
24
29
  <label for={id} class={combinedLabelClass}>
25
30
  {@render children?.()}
26
31
  </label>
27
- <select {id} class={combinedSelectClass} {...restProps}>
32
+ <select {id} class={combinedSelectClass} {...restProps} bind:value={value}>
28
33
  {#each options as option}
29
- <option value={option.value}>{option.label}</option>
34
+ <option value={option.value} class={optionClass}>
35
+ {option.label}
36
+ </option>
30
37
  {/each}
31
38
  </select>
32
39
  </div>
@@ -0,0 +1,4 @@
1
+ import type { FloatingSelectProps } from "../types/FloatingSelect.js";
2
+ declare const FloatingSelect: import("svelte").Component<FloatingSelectProps, {}, "value">;
3
+ type FloatingSelect = ReturnType<typeof FloatingSelect>;
4
+ export default FloatingSelect;
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ export { default as Navbar } from "./components/Navbar.svelte";
6
6
  export { default as NavbarSeparator } from "./components/NavbarSeparator.svelte";
7
7
  export { default as NavbarElement } from "./components/NavbarElement.svelte";
8
8
  export { default as FloatingInput } from "./components/FloatingInput.svelte";
9
+ export { default as FloatingSelect } from "./components/FloatingSelect.svelte";
9
10
  export { default as Text } from "./components/Text.svelte";
10
11
  export { default as Card } from "./components/Card.svelte";
11
12
  export { fbmBackground } from "./actions/fbm.ts";
package/dist/index.js CHANGED
@@ -6,6 +6,7 @@ export { default as Navbar } from "./components/Navbar.svelte";
6
6
  export { default as NavbarSeparator } from "./components/NavbarSeparator.svelte";
7
7
  export { default as NavbarElement } from "./components/NavbarElement.svelte";
8
8
  export { default as FloatingInput } from "./components/FloatingInput.svelte";
9
+ export { default as FloatingSelect } from "./components/FloatingSelect.svelte";
9
10
  export { default as Text } from "./components/Text.svelte";
10
11
  export { default as Card } from "./components/Card.svelte";
11
12
  export { fbmBackground } from "./actions/fbm.js";
@@ -0,0 +1,10 @@
1
+ export interface FloatingSelectProps {
2
+ children?: any;
3
+ class?: string;
4
+ divClass?: string;
5
+ optionClass?: string;
6
+ value?: string;
7
+ options: { value: string; label: string }[];
8
+ id?: `${string}-${string}-${string}-${string}-${string}`;
9
+ [key: string]: any;
10
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valerius_petrini/corekit-ui",
3
- "version": "0.1.40",
3
+ "version": "0.1.42",
4
4
  "description": "Component Library used across all my projects",
5
5
  "author": "Valerius Petrini Jr.",
6
6
  "license": "MIT",
@@ -1,8 +0,0 @@
1
- declare const FloatingDropdown: import("svelte").Component<{
2
- children?: any;
3
- class?: string;
4
- options?: any[];
5
- id?: any;
6
- } & Record<string, any>, {}, "">;
7
- type FloatingDropdown = ReturnType<typeof FloatingDropdown>;
8
- export default FloatingDropdown;