@hashrytech/quick-components-kit 0.4.0 → 0.5.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @hashrytech/quick-components-kit
2
2
 
3
+ ## 0.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - feat: adding navbar and nad-aside
8
+
9
+ ## 0.4.1
10
+
11
+ ### Patch Changes
12
+
13
+ - fix: link button package fix
14
+
3
15
  ## 0.4.0
4
16
 
5
17
  ### Minor Changes
@@ -0,0 +1,30 @@
1
+ <script lang="ts" module>
2
+ import type { ClassNameValue } from 'tailwind-merge';
3
+
4
+ export type ButtonProps = {
5
+ open?: boolean;
6
+ ariaLabel: string;
7
+ linesClasses?: string;
8
+ numberOfLines?: number;
9
+ onclick?: (event: MouseEvent) => void;
10
+ class?: ClassNameValue;
11
+ };
12
+
13
+ </script>
14
+
15
+ <script lang="ts">
16
+ import {twMerge} from 'tailwind-merge';
17
+
18
+ let { open=$bindable(true), ariaLabel, linesClasses, numberOfLines=3, onclick, ...props }: ButtonProps = $props();
19
+
20
+ </script>
21
+
22
+ <button class={twMerge("p-2 rounded focus:outline-none focus:ring-2 focus:ring-focus-primary cursor-pointer relative w-fit", props.class)} aria-label={ariaLabel} {onclick}>
23
+ <!-- Icon -->
24
+ <div class="space-y-2">
25
+ {#each Array(numberOfLines) as _}
26
+ <span class={twMerge("block w-7 h-0.5 bg-button-primary", linesClasses)}></span>
27
+ {/each}
28
+ </div>
29
+ </button>
30
+
@@ -0,0 +1,12 @@
1
+ import type { ClassNameValue } from 'tailwind-merge';
2
+ export type ButtonProps = {
3
+ open?: boolean;
4
+ ariaLabel: string;
5
+ linesClasses?: string;
6
+ numberOfLines?: number;
7
+ onclick?: (event: MouseEvent) => void;
8
+ class?: ClassNameValue;
9
+ };
10
+ declare const HamburgerMenu: import("svelte").Component<ButtonProps, {}, "open">;
11
+ type HamburgerMenu = ReturnType<typeof HamburgerMenu>;
12
+ export default HamburgerMenu;
@@ -0,0 +1 @@
1
+ export { default as HamburgerMenu } from './HamburgerMenu.svelte';
@@ -0,0 +1 @@
1
+ export { default as HamburgerMenu } from './HamburgerMenu.svelte';
package/dist/index.d.ts CHANGED
@@ -1,2 +1,5 @@
1
- export * from './button/index.js';
2
1
  export * from './text-input/index.js';
2
+ export * from './button/index.js';
3
+ export * from './link-button/index.js';
4
+ export * from './hamburger-menu/index.js';
5
+ export * from './navbar-aside/index.js';
package/dist/index.js CHANGED
@@ -1,5 +1,8 @@
1
1
  // Reexport your entry components here
2
2
  // lib/index.js
3
- export * from './button/index.js';
4
3
  export * from './text-input/index.js';
4
+ export * from './button/index.js';
5
+ export * from './link-button/index.js';
6
+ export * from './hamburger-menu/index.js';
7
+ export * from './navbar-aside/index.js';
5
8
  // Add more components here...
@@ -0,0 +1,35 @@
1
+ <script lang="ts" module>
2
+ import { fade, fly, slide } from 'svelte/transition';
3
+ import type { Snippet } from 'svelte';
4
+ import type { ClassNameValue } from 'tailwind-merge';
5
+
6
+ export type ButtonProps = {
7
+ open?: boolean;
8
+ transitionDuration?: number;
9
+ transitionDistance?: number;
10
+ transitionPosition?: "left-0" | "right-0";
11
+ overlayClasses?: string;
12
+ children?: Snippet;
13
+ class?: ClassNameValue;
14
+ };
15
+
16
+ </script>
17
+
18
+ <script lang="ts">
19
+ import {twMerge} from 'tailwind-merge';
20
+
21
+ let {open=$bindable(false), transitionPosition="left-0", transitionDuration=200, transitionDistance=-240, overlayClasses="", children, ...props}: ButtonProps = $props();
22
+
23
+ </script>
24
+
25
+ {#if open}
26
+ <!-- Overlay -->
27
+ <div transition:fade={{duration: transitionDuration}} class={twMerge("fixed inset-0 bg-neutral-700/80", overlayClasses)} role="presentation" onclick={() => open = false}></div>
28
+
29
+ <aside class={twMerge("fixed top-0 flex flex-col items-center gap-2 bg-white w-60 h-screen", transitionPosition, props.class)}
30
+ in:fly={{ x: transitionDistance, duration: transitionDuration }}
31
+ out:fly={{ x: transitionDistance, duration: transitionDuration }}>
32
+ {@render children?.()}
33
+ </aside>
34
+ {/if}
35
+
@@ -0,0 +1,14 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { ClassNameValue } from 'tailwind-merge';
3
+ export type ButtonProps = {
4
+ open?: boolean;
5
+ transitionDuration?: number;
6
+ transitionDistance?: number;
7
+ transitionPosition?: "left-0" | "right-0";
8
+ overlayClasses?: string;
9
+ children?: Snippet;
10
+ class?: ClassNameValue;
11
+ };
12
+ declare const NavBarAside: import("svelte").Component<ButtonProps, {}, "open">;
13
+ type NavBarAside = ReturnType<typeof NavBarAside>;
14
+ export default NavBarAside;
@@ -0,0 +1 @@
1
+ export { default as NavBarAside } from './NavBarAside.svelte';
@@ -0,0 +1 @@
1
+ export { default as NavBarAside } from './NavBarAside.svelte';
@@ -19,7 +19,7 @@
19
19
  * @prop {string} [value] - The bound value of the input.
20
20
  * @prop {string} [placeholder] - Placeholder text.
21
21
  * @prop {string} [labelText] - Optional label text.
22
- * @prop {ClassNameValue} [inputStyle] - Additional Tailwind classes to apply to the input. Example: "border-red-500 text-green-600"
22
+ * @prop {ClassNameValue} [inputClasses] - Additional Tailwind classes to apply to the input. Example: "border-red-500 text-green-600"
23
23
  * @prop {TextInputSize} [size] - Size variant ("sm", "md", "lg") with predefined Tailwind styles.
24
24
  * - "sm": h-[2.05rem] text-sm placeholder:text-sm
25
25
  * - "md": h-[2.375rem] text-sm placeholder:text-sm
@@ -35,7 +35,7 @@
35
35
  type?: TextInputType;
36
36
  placeholder?: string;
37
37
  labelText?: string;
38
- inputStyle?: ClassNameValue;
38
+ inputClasses?: ClassNameValue;
39
39
  size?: TextInputSize;
40
40
  disabled?: boolean;
41
41
  required?: boolean;
@@ -52,7 +52,7 @@
52
52
  <script lang="ts">
53
53
  import { twMerge } from 'tailwind-merge';
54
54
 
55
- let { id, type="text", name="", value="", placeholder="", labelText, size="md", inputStyle="", disabled=false, required=false, error, onchange, onmouseup, label, icon}: TextInputProps = $props();
55
+ let { id, type="text", name="", value="", placeholder="", labelText, size="md", inputClasses="", disabled=false, required=false, error, onchange, onmouseup, label, icon}: TextInputProps = $props();
56
56
 
57
57
  /**
58
58
  * Predefined size classes for the TextBox input.
@@ -76,7 +76,7 @@
76
76
  class={twMerge("rounded-primary border-neutral-300 focus:border-primary-500 focus:ring-primary-500 placeholder:opacity-50 disabled:bg-neutral-300/30 disabled:border-gray-300/30",
77
77
  error ? "bg-red-50 border-red-300 ring-red-300" : "",
78
78
  icon ? "pl-10" : "",
79
- sizeStyle[size], inputStyle)}
79
+ sizeStyle[size], inputClasses)}
80
80
  />
81
81
  </div>
82
82
  {#if error}
@@ -16,7 +16,7 @@ export type TextInputType = "text" | "password" | "number" | "email" | "tel" | "
16
16
  * @prop {string} [value] - The bound value of the input.
17
17
  * @prop {string} [placeholder] - Placeholder text.
18
18
  * @prop {string} [labelText] - Optional label text.
19
- * @prop {ClassNameValue} [inputStyle] - Additional Tailwind classes to apply to the input. Example: "border-red-500 text-green-600"
19
+ * @prop {ClassNameValue} [inputClasses] - Additional Tailwind classes to apply to the input. Example: "border-red-500 text-green-600"
20
20
  * @prop {TextInputSize} [size] - Size variant ("sm", "md", "lg") with predefined Tailwind styles.
21
21
  * - "sm": h-[2.05rem] text-sm placeholder:text-sm
22
22
  * - "md": h-[2.375rem] text-sm placeholder:text-sm
@@ -32,7 +32,7 @@ export type TextInputProps = {
32
32
  type?: TextInputType;
33
33
  placeholder?: string;
34
34
  labelText?: string;
35
- inputStyle?: ClassNameValue;
35
+ inputClasses?: ClassNameValue;
36
36
  size?: TextInputSize;
37
37
  disabled?: boolean;
38
38
  required?: boolean;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/hashrytech/quick-components-kit.git"
7
7
  },
8
- "version": "0.4.0",
8
+ "version": "0.5.0",
9
9
  "license": "MIT",
10
10
  "author": "Hashry Tech",
11
11
  "files": [