@valerius_petrini/corekit-ui 0.1.79 → 0.1.81

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.
@@ -14,11 +14,11 @@
14
14
  const combinedClass = $derived(twMerge(defaultClass, className));
15
15
  </script>
16
16
 
17
- <span class={combinedClass} {...restProps} bind:this={element}>
17
+ <kbd class={combinedClass} {...restProps} bind:this={element}>
18
18
  {@render children?.()}
19
19
  {#if subtext}
20
20
  <span class="text-sub-text text-[10px] mt-0.5">
21
21
  {@render subtext?.()}
22
22
  </span>
23
23
  {/if}
24
- </span>
24
+ </kbd>
@@ -39,7 +39,7 @@
39
39
  </div>
40
40
  {/snippet}
41
41
 
42
- <div class={combinedContainerClass} bind:this={element}>
42
+ <div class={combinedContainerClass} bind:this={element} aria-hidden="true">
43
43
  {#if variant === "default"}
44
44
  <div class="h-4 bg-sub-background rounded w-3/4"></div>
45
45
  <div class="h-4 bg-sub-background rounded w-full"></div>
@@ -22,6 +22,7 @@
22
22
  ));
23
23
  </script>
24
24
 
25
+ <span class="sr-only">Loading...</span>
25
26
  <div class={sizeClass} {...restProps} bind:this={element}></div>
26
27
 
27
28
  <style>
@@ -59,7 +59,7 @@
59
59
  });
60
60
  </script>
61
61
 
62
- <div transition:fly={flyParams} class={combinedToastClass} {...restProps} bind:this={element}>
62
+ <div transition:fly={flyParams} class={combinedToastClass} {...restProps} bind:this={element} role="status" aria-live={type === "error" ? "assertive" : "polite"}>
63
63
  <div class="w-8 h-8 flex-center">
64
64
  <Icon class={defualtIconClass}/>
65
65
  </div>
@@ -134,19 +134,19 @@
134
134
  {...restProps}>
135
135
  {#snippet outerDivElementAfter()}
136
136
  {#if touched && requirements}
137
- <div class="mt-1 text-xs" transition:slide={{ duration: 300 }}>
137
+ <ul role="list" class="mt-1 text-xs" transition:slide={{ duration: 300 }}>
138
138
  {#each requirements as req}
139
139
  {@const isReqMet = testRequirement(req.requirements)}
140
140
  {@const reqClass = isReqMet ? "text-green-500" : "text-red-500"}
141
- <div class="flex w-full items-center gap-1 transition-colors {reqClass}">
141
+ <li class="flex w-full items-center gap-1 transition-colors {reqClass}">
142
142
  <div class="relative w-4 h-4">
143
143
  <Check class="w-4 h-4 absolute transition-all duration-150 {isReqMet ? 'opacity-100 scale-100' : 'opacity-0 scale-0'}"/>
144
144
  <X class="w-4 h-4 absolute transition-all duration-150 {isReqMet ? 'opacity-0 scale-0' : 'opacity-100 scale-100'}"/>
145
145
  </div>
146
146
  <Text tag="span" class="text-xs text-inherit">{req.label}</Text>
147
- </div>
147
+ </li>
148
148
  {/each}
149
- </div>
149
+ </ul>
150
150
  {/if}
151
151
  {/snippet}
152
152
 
@@ -85,9 +85,7 @@
85
85
  {/if}
86
86
  {#if icon}
87
87
  {@const Icon = icon}
88
- <div class="h-5 aspect-square px-1 py-0!">
89
- <Icon class="h-full aspect-square text-sub-text"></Icon>
90
- </div>
88
+ <Icon class="h-5 aspect-square mx-1 py-0! text-sub-text shrink-0"></Icon>
91
89
  {/if}
92
90
  {@render innerDivElement?.()}
93
91
  </div>
@@ -12,6 +12,9 @@
12
12
  } from "@floating-ui/dom";
13
13
  import { tick } from "svelte";
14
14
 
15
+ import ChevronUp from "@lucide/svelte/icons/chevron-up";
16
+ import ChevronDown from "@lucide/svelte/icons/chevron-down";
17
+
15
18
  let {
16
19
  children = undefined,
17
20
  class: className = "",
@@ -75,20 +78,23 @@
75
78
 
76
79
  <svelte:window onclick={handleClickOutside} />
77
80
 
78
- <div class="relative h-full {wrapperClass}" bind:this={element}>
79
- <NavbarElement
80
- onclick={toggle}
81
- class={className}
82
- {...restProps}
83
- aria-haspopup="true"
84
- aria-expanded={open}
85
- >
86
- {label}
87
- {#if navelement}
88
- {@render navelement()}
89
- {/if}
90
- </NavbarElement>
91
- </div>
81
+ <NavbarElement
82
+ onclick={toggle}
83
+ class="{className} relative {wrapperClass}"
84
+ bind:element
85
+ {...restProps}
86
+ aria-haspopup="true"
87
+ aria-expanded={open}
88
+ >
89
+ {label}
90
+ {#if navelement}
91
+ {@render navelement()}
92
+ {/if}
93
+ <span class="sr-only">{open ? 'Close' : 'Open'} dropdown</span>
94
+ <ChevronDown
95
+ class="mt-0.5 transition-transform ease-out duration-150 {open ? 'rotate-180' : 'rotate-0'}"
96
+ size="16"/>
97
+ </NavbarElement>
92
98
 
93
99
  {#if open}
94
100
  <div
@@ -98,13 +104,13 @@
98
104
  class="z-100 shadow-lg"
99
105
  style:visibility={ready ? "visible" : "hidden"}
100
106
  >
101
- <div
107
+ <menu
102
108
  transition:fly={flyParams}
103
109
  class="bg-sub-background p-2 min-w-max flex flex-col rounded border border-white/10 shadow-xl shadow-black/40"
104
110
  >
105
- <button onclick={() => (open = false)} class="contents *:w-full [&_a]:justify-start [&_a]:py-0.5 [&_a]:px-2.5 [&_a]:rounded">
111
+ <button onclick={() => (open = false)} class="contents *:w-full [&_button]:justify-start [&_a]:justify-start *:mx-0 [&_a]:pr-5">
106
112
  {@render children?.()}
107
113
  </button>
108
- </div>
114
+ </menu>
109
115
  </div>
110
116
  {/if}
@@ -12,10 +12,11 @@
12
12
  active = false,
13
13
  href = undefined,
14
14
  threshold = 10,
15
+ color = "sub",
15
16
  ...restProps
16
17
  }: NavbarElementProps = $props();
17
18
 
18
- let defaultClass = "navbar-element w-fit h-full px-5 py-0 text-main-text";
19
+ let defaultClass = "navbar-element w-fit h-fit mx-2 px-2.5 py-1.5 rounded text-main-text";
19
20
 
20
21
  let scrollY = $state(0);
21
22
  let isAtTop = $derived(scrollY <= threshold);
@@ -30,6 +31,6 @@
30
31
 
31
32
  <svelte:window bind:scrollY={scrollY}/>
32
33
 
33
- <Button bind:element radius="none" {href} color="sub" class={combinedClass} {...restProps} aria-current={active ? 'page' : undefined}>
34
+ <Button bind:element radius="none" {href} {color} class={combinedClass} {...restProps} aria-current={active ? 'page' : undefined}>
34
35
  {@render children?.()}
35
36
  </Button>
@@ -25,5 +25,8 @@
25
25
  <NavbarElement href="/about">About</NavbarElement>
26
26
  <NavbarSeparator variant="horizontal"/>
27
27
  <NavbarElement href="/contact">Contact</NavbarElement>
28
+ <NavbarElement>No Link</NavbarElement>
28
29
  </NavbarDropdown>
30
+
31
+ <NavbarElement color="primary">Action</NavbarElement>
29
32
  </Story>
@@ -11,7 +11,7 @@
11
11
  ...restProps
12
12
  }: NavbarProps = $props();
13
13
 
14
- let defaultClass = "transition-colors duration-300 fixed top-0 left-0 w-full h-14 z-[100] flex items-center bg-sub-background/99 border-b border-box border-b-sub-background-hover";
14
+ let defaultClass = "transition-colors duration-300 fixed top-0 left-0 w-full h-14 z-[100] flex items-center bg-sub-background/99 border-b border-box border-b-sub-background-hover px-4 md:px-6 lg:px-8";
15
15
 
16
16
  let scrollY = $state(0);
17
17
  let isAtTop = $derived(scrollY <= threshold);
@@ -1,5 +1,6 @@
1
1
  import type { Snippet } from "svelte";
2
2
  import type { BaseComponentProps } from "../../../types/BaseComponent.ts";
3
+ import type { ColorStyle } from "../../../styles/color.ts";
3
4
  export interface NavbarProps extends BaseComponentProps {
4
5
  classTop?: string;
5
6
  threshold?: number;
@@ -10,6 +11,7 @@ export interface NavbarElementProps extends BaseComponentProps {
10
11
  active?: boolean;
11
12
  href?: string;
12
13
  threshold?: number;
14
+ color?: ColorStyle;
13
15
  }
14
16
  export type NavbarSeparatorVariant = "vertical" | "horizontal" | "dynamic";
15
17
  export declare const NavbarSeparatorClasses: Record<NavbarSeparatorVariant, string>;
@@ -25,9 +25,9 @@
25
25
  "u": { class: "underline", size: "text-base" },
26
26
  "small": { class: "", size: "text-sm" },
27
27
  "blockquote": { class: "border-l-4 border-gray-500 pl-2 opacity-70", size: "text-base" },
28
- "pre": { class: "font-mono bg-sub-background px-3 py-2 radius overflow-x-auto whitespace-pre", size: "text-base" },
29
- "code": { class: "font-mono bg-sub-background px-1 radius inline-block", size: "text-base" },
30
- "a": { class: "text-blue-400 hover:text-blue-500 hover:underline transition-colors cursor-pointer", size: "text-base" },
28
+ "pre": { class: "font-mono bg-sub-background px-3 py-2 rounded overflow-x-auto whitespace-pre", size: "text-base" },
29
+ "code": { class: "font-mono bg-sub-background px-1 rounded inline-block", size: "text-base" },
30
+ "a": { class: "text-blue-400 decoration-blue-400/0 underline underline-offset-2 transition-all cursor-pointer duration-150 hover:decoration-blue-400 ", size: "text-base" },
31
31
  "li": { class: "text-base list-disc list-inside", size: "text-base" },
32
32
  "h1": { class: "font-bold", size: "text-4xl" },
33
33
  "h2": { class: "font-bold", size: "text-3xl" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valerius_petrini/corekit-ui",
3
- "version": "0.1.79",
3
+ "version": "0.1.81",
4
4
  "description": "Component Library used across all my projects",
5
5
  "author": "Valerius Petrini Jr.",
6
6
  "license": "MIT",