sveltacular 0.0.26 → 0.0.27

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.
@@ -67,7 +67,7 @@ const onInputKeyPress = (e) => {
67
67
  }
68
68
  };
69
69
  const triggerSearch = debounce(async () => {
70
- if (search) {
70
+ if (search && searchable) {
71
71
  items = await search(text);
72
72
  }
73
73
  updateText();
@@ -75,7 +75,7 @@ const triggerSearch = debounce(async () => {
75
75
  }, 300);
76
76
  const applyFilter = () => {
77
77
  const searchText = text.trim().toLowerCase();
78
- filteredItems = searchText ? items.map((item, index) => ({ ...item, index })).filter((item) => item.name.toLowerCase().includes(searchText)) : items.map((item, index) => ({ ...item, index }));
78
+ filteredItems = searchText && searchable ? items.map((item, index) => ({ ...item, index })).filter((item) => item.name.toLowerCase().includes(searchText)) : items.map((item, index) => ({ ...item, index }));
79
79
  };
80
80
  const clear = () => {
81
81
  text = "";
@@ -1,8 +1,8 @@
1
- <script>import AngleRightIcon from "../../icons/angle-right-icon.svelte";
2
- import HomeIcon from "../../icons/home-icon.svelte";
1
+ <script>import HomeIcon from "../../icons/home-icon.svelte";
3
2
  export let homeUrl = null;
4
3
  export let crumbs = [];
5
4
  export let size = "md";
5
+ export let separator = "/";
6
6
  const getCrumLabel = (crumb) => {
7
7
  if (typeof crumb === "string")
8
8
  return crumb;
@@ -12,8 +12,8 @@ const getCrumLabel = (crumb) => {
12
12
 
13
13
  <nav class={size}>
14
14
  {#if homeUrl}
15
- <li class="icon">
16
- <a href={homeUrl} class="home"><HomeIcon /></a>
15
+ <li class="home">
16
+ <a href={homeUrl}><HomeIcon /></a>
17
17
  </li>
18
18
  {/if}
19
19
  {#each crumbs as crumb, i}
@@ -27,9 +27,7 @@ const getCrumLabel = (crumb) => {
27
27
  </li>
28
28
  {/if}
29
29
  {#if i < crumbs.length - 1}
30
- <li class="icon">
31
- <AngleRightIcon />
32
- </li>
30
+ <li class="separator">{separator}</li>
33
31
  {/if}
34
32
  {/each}
35
33
  </nav>
@@ -38,44 +36,41 @@ const getCrumLabel = (crumb) => {
38
36
  display: flex;
39
37
  align-items: center;
40
38
  list-style: none;
39
+ gap: 0.5rem;
41
40
  padding: 0;
42
41
  margin: 0;
43
42
  line-height: 1.5rem;
44
43
  font-family: var(--breadcrumbs-font-family, sans-serif);
45
44
  }
46
45
  nav li {
47
- display: flex;
48
- align-items: center;
49
- vertical-align: middle;
50
- margin-left: 0.5rem;
51
46
  color: var(--breadcrumbs-fg, #333);
47
+ padding: 0;
48
+ margin: 0;
52
49
  }
53
50
  nav li a {
54
51
  color: var(--breadcrumbs-link-fg, #333);
55
52
  text-decoration: none;
53
+ width: 100%;
56
54
  }
57
55
  nav li a:hover {
58
56
  color: var(--breadcrumbs-link-hover-fg, black);
59
57
  text-decoration: underline;
60
58
  }
61
- nav li a.home {
62
- width: 100%;
63
- }
64
- nav li:first-child {
65
- margin-left: 0;
66
- }
67
- nav li.icon {
68
- padding-top: 2px;
69
- }
70
59
  nav.sm li {
71
60
  font-size: 0.75rem;
72
- min-width: 12px;
61
+ }
62
+ nav.sm li.home {
63
+ width: 12px;
73
64
  }
74
65
  nav.md li {
75
66
  font-size: 0.875rem;
76
- min-width: 14px;
67
+ }
68
+ nav.md li.home {
69
+ width: 14px;
77
70
  }
78
71
  nav.lg li {
79
72
  font-size: 1rem;
80
- min-width: 16px;
73
+ }
74
+ nav.lg li.home {
75
+ width: 16px;
81
76
  }</style>
@@ -7,6 +7,7 @@ declare const __propDef: {
7
7
  href?: string | undefined;
8
8
  })[] | undefined;
9
9
  size?: "sm" | "md" | "lg" | undefined;
10
+ separator?: string | undefined;
10
11
  };
11
12
  events: {
12
13
  [evt: string]: CustomEvent<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sveltacular",
3
- "version": "0.0.26",
3
+ "version": "0.0.27",
4
4
  "scripts": {
5
5
  "watch": "npm run dev -- --open",
6
6
  "dev": "vite dev",