@getmicdrop/svelte-components 4.0.0 → 4.1.1

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,5 +1,5 @@
1
1
  <script>
2
- import { ChevronUpOutline } from "../Icons";
2
+ import { ChevronUpOutline } from "../../primitives/Icons";
3
3
 
4
4
  /** @type {Array<{question: string, answer: string} | string>} */
5
5
  export let faqs = [];
@@ -1,7 +1,7 @@
1
1
  <script>
2
2
  import { slide } from "svelte/transition";
3
3
  import { cubicOut } from "svelte/easing";
4
- import WarningIcon from "./Icons/WarningIcon.svelte";
4
+ import WarningIcon from "../../primitives/Icons/WarningIcon.svelte";
5
5
 
6
6
  /**
7
7
  * Object mapping field keys to error messages
@@ -1,6 +1,6 @@
1
1
  <script>
2
2
  import Cropper from 'svelte-easy-crop';
3
- import { CloseOutline, MinusOutline, PlusOutline } from "../Icons";
3
+ import { CloseOutline, MinusOutline, PlusOutline } from "../../primitives/Icons";
4
4
  import Button from '../../primitives/Button/Button.svelte';
5
5
 
6
6
  export let showModal = false;
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import Icon from "./Icons/Icon.svelte";
2
+ import Icon from "../../primitives/Icons/Icon.svelte";
3
3
 
4
4
  /** Error message to display */
5
5
  export let error = "";
@@ -1,6 +1,6 @@
1
1
  <script>
2
2
  import { createEventDispatcher, onMount } from "svelte";
3
- import { CloseOutline, ChevronDownOutline } from "../Icons";
3
+ import { CloseOutline, ChevronDownOutline } from "../../primitives/Icons";
4
4
 
5
5
  const dispatch = createEventDispatcher();
6
6
 
@@ -13,6 +13,7 @@
13
13
  export let disabled = false;
14
14
  export let error = "";
15
15
  export let hideClear = false;
16
+ export let hideCheckboxes = false; // Hide checkboxes in dropdown options
16
17
  export let name = "";
17
18
  export let id = "";
18
19
  /** @type {'sm' | 'md' | 'lg'} */
@@ -217,13 +218,15 @@
217
218
  on:click={() => toggleItem(item)}
218
219
  on:mouseenter={() => (focusedIndex = index)}
219
220
  >
220
- <input
221
- type="checkbox"
222
- checked={value.includes(item.value)}
223
- class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-700 dark:focus:ring-offset-gray-700 focus:ring-2 dark:bg-gray-600 dark:border-gray-500"
224
- tabindex="-1"
225
- on:click|stopPropagation={() => toggleItem(item)}
226
- />
221
+ {#if !hideCheckboxes}
222
+ <input
223
+ type="checkbox"
224
+ checked={value.includes(item.value)}
225
+ class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-700 dark:focus:ring-offset-gray-700 focus:ring-2 dark:bg-gray-600 dark:border-gray-500"
226
+ tabindex="-1"
227
+ on:click|stopPropagation={() => toggleItem(item)}
228
+ />
229
+ {/if}
227
230
  <span class="flex-1">{item.name}</span>
228
231
  </li>
229
232
  {/each}
@@ -11,6 +11,7 @@ type MultiSelect = SvelteComponent<{
11
11
  placeholder?: string | undefined;
12
12
  items?: any[] | undefined;
13
13
  hideClear?: boolean | undefined;
14
+ hideCheckboxes?: boolean | undefined;
14
15
  }, {
15
16
  change: CustomEvent<any>;
16
17
  } & {
@@ -30,6 +31,7 @@ declare const MultiSelect: $$__sveltets_2_IsomorphicComponent<{
30
31
  placeholder?: string | undefined;
31
32
  items?: any[] | undefined;
32
33
  hideClear?: boolean | undefined;
34
+ hideCheckboxes?: boolean | undefined;
33
35
  }, {
34
36
  change: CustomEvent<any>;
35
37
  } & {
@@ -1 +1 @@
1
- {"version":3,"file":"MultiSelect.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/recipes/inputs/MultiSelect.svelte.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAsNA;;;;;;;;;;;;;;;;mBAA6N;6CAThL,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,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CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IAC9G,eAAe,QAAQ,CAAC"}
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { onMount } from 'svelte';
3
- import { SearchOutline } from "../Icons";
3
+ import { SearchOutline } from "../../../primitives/Icons";
4
4
  import * as GMaps from '@googlemaps/js-api-loader';
5
5
  import { PUBLIC_GOOGLE_MAPS_API_KEY } from '../../../config.js';
6
6
  const { Loader } = GMaps;
@@ -1,6 +1,6 @@
1
1
  <script>
2
2
  import { createEventDispatcher } from "svelte";
3
- import { SearchOutline } from "../Icons";
3
+ import { SearchOutline } from "../../primitives/Icons";
4
4
 
5
5
  const dispatch = createEventDispatcher();
6
6
 
@@ -12,7 +12,7 @@
12
12
  * />
13
13
  */
14
14
  import { createEventDispatcher, onMount, onDestroy, tick } from "svelte";
15
- import { ChevronDownOutline } from "../Icons";
15
+ import { ChevronDownOutline } from "../../primitives/Icons";
16
16
 
17
17
  /** @type {Array<{label: string, value: string}>} Options to display */
18
18
  export let options = [];
@@ -1,6 +1,6 @@
1
1
  <script>
2
2
  import { createEventDispatcher } from "svelte";
3
- import { ExclamationTriangleOutline } from "../Icons";
3
+ import { ExclamationTriangleOutline } from "../../primitives/Icons";
4
4
  import Button from "../Button/Button.svelte";
5
5
  import Cancel from "../../assets/svg/cancel.svg";
6
6
  import Modal from "./Modal.svelte";
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import Icon from "../Icons/Icon.svelte";
2
+ import Icon from "../../primitives/Icons/Icon.svelte";
3
3
  import Button from "../Button/Button.svelte";
4
4
 
5
5
  /** Whether the modal is currently processing an action */
@@ -1,6 +1,6 @@
1
1
  <script>
2
2
  import { createEventDispatcher } from "svelte";
3
- import { CheckOutline, CloseOutline, ExclamationTriangleOutline, InfoCircleOutline } from "../Icons";
3
+ import { CheckOutline, CloseOutline, ExclamationTriangleOutline, InfoCircleOutline } from "../../primitives/Icons";
4
4
  import Button from "../Button/Button.svelte";
5
5
  import Cancel from "../../assets/svg/cancel.svg";
6
6
  import Modal from "./Modal.svelte";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getmicdrop/svelte-components",
3
- "version": "4.0.0",
3
+ "version": "4.1.1",
4
4
  "description": "Shared component library for Micdrop applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",