@highlanderrobotics/magnolia-svelte 0.0.0-stage → 0.2.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.
Files changed (75) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +2 -2
  3. package/dist/Alert.svelte +11 -0
  4. package/dist/Alert.svelte.d.ts +8 -0
  5. package/dist/Button.svelte +54 -0
  6. package/dist/Button.svelte.d.ts +4 -0
  7. package/dist/Checkbox.svelte +15 -0
  8. package/dist/Checkbox.svelte.d.ts +7 -0
  9. package/dist/DensityProvider.svelte +12 -0
  10. package/dist/DensityProvider.svelte.d.ts +8 -0
  11. package/dist/Dialog.svelte +108 -0
  12. package/dist/Dialog.svelte.d.ts +14 -0
  13. package/dist/Icon.svelte +31 -0
  14. package/dist/Icon.svelte.d.ts +12 -0
  15. package/dist/MagnoliaUIRoot.svelte +24 -0
  16. package/dist/MagnoliaUIRoot.svelte.d.ts +12 -0
  17. package/dist/Menu.svelte +117 -0
  18. package/dist/Menu.svelte.d.ts +11 -0
  19. package/dist/MenuButton.svelte +18 -0
  20. package/dist/MenuButton.svelte.d.ts +4 -0
  21. package/dist/MenuItem.svelte +6 -0
  22. package/dist/MenuItem.svelte.d.ts +7 -0
  23. package/dist/MenuWrapper.svelte +6 -0
  24. package/dist/MenuWrapper.svelte.d.ts +7 -0
  25. package/dist/Pill.svelte +29 -0
  26. package/dist/Pill.svelte.d.ts +11 -0
  27. package/dist/Radio.svelte +31 -0
  28. package/dist/Radio.svelte.d.ts +10 -0
  29. package/dist/Select.svelte +49 -0
  30. package/dist/Select.svelte.d.ts +16 -0
  31. package/dist/Switch.svelte +34 -0
  32. package/dist/Switch.svelte.d.ts +10 -0
  33. package/dist/TextField.svelte +42 -0
  34. package/dist/TextField.svelte.d.ts +11 -0
  35. package/dist/assets/figma/14d74.svg +6 -0
  36. package/dist/assets/figma/171e4.svg +6 -0
  37. package/dist/assets/figma/1887c.svg +3 -0
  38. package/dist/assets/figma/1b390.svg +3 -0
  39. package/dist/assets/figma/21c15.svg +3 -0
  40. package/dist/assets/figma/22923.svg +6 -0
  41. package/dist/assets/figma/26c8b.svg +3 -0
  42. package/dist/assets/figma/2bc71.svg +3 -0
  43. package/dist/assets/figma/430a5.svg +6 -0
  44. package/dist/assets/figma/46b3d.svg +3 -0
  45. package/dist/assets/figma/476c6.svg +3 -0
  46. package/dist/assets/figma/548f3.svg +3 -0
  47. package/dist/assets/figma/57389.svg +3 -0
  48. package/dist/assets/figma/6f0ad.svg +3 -0
  49. package/dist/assets/figma/704f2.svg +6 -0
  50. package/dist/assets/figma/76db5.svg +6 -0
  51. package/dist/assets/figma/7859e.svg +6 -0
  52. package/dist/assets/figma/7ab1c.svg +3 -0
  53. package/dist/assets/figma/8be31.svg +3 -0
  54. package/dist/assets/figma/93d28.svg +3 -0
  55. package/dist/assets/figma/a25b6.svg +3 -0
  56. package/dist/assets/figma/ab7c6.svg +3 -0
  57. package/dist/assets/figma/b20cb.svg +3 -0
  58. package/dist/assets/figma/c822a.svg +3 -0
  59. package/dist/assets/figma/d1b20.svg +3 -0
  60. package/dist/assets/figma/d8950.svg +3 -0
  61. package/dist/assets/figma/da2d4.svg +3 -0
  62. package/dist/assets/figma/e1ba2.svg +3 -0
  63. package/dist/assets/figma/ec624.svg +6 -0
  64. package/dist/dialog-lock.d.ts +2 -0
  65. package/dist/dialog-lock.js +13 -0
  66. package/dist/figma-assets.css +59 -0
  67. package/dist/fonts.css +2 -0
  68. package/dist/index.d.ts +17 -0
  69. package/dist/index.js +16 -0
  70. package/dist/menu-context.d.ts +4 -0
  71. package/dist/menu-context.js +1 -0
  72. package/dist/styles.css +494 -0
  73. package/dist/types.d.ts +13 -0
  74. package/dist/types.js +1 -0
  75. package/package.json +47 -4
@@ -0,0 +1,49 @@
1
+ <script lang="ts">
2
+ const uid = $props.id();
3
+ import type { HTMLSelectAttributes } from 'svelte/elements';
4
+ let {
5
+ value = $bindable(null),
6
+ placeholder = '',
7
+ errorMessage = null,
8
+ ariaLabel = null,
9
+ label,
10
+ id = uid,
11
+ items = [],
12
+ 'aria-describedby': describedby,
13
+ ...rest
14
+ }: Omit<HTMLSelectAttributes, 'value' | 'id'> & {
15
+ value?: string | null;
16
+ id?: string | null;
17
+ ariaLabel?: string | null;
18
+ label?: string;
19
+ errorMessage?: string | null;
20
+ items?: { label: string; value: string; disabled?: boolean | null }[];
21
+ } = $props();
22
+ let controlId = $derived(id ?? uid);
23
+ let errorId = $derived(controlId + '-error');
24
+ </script>
25
+
26
+ <div class="mg-field">
27
+ {#if label}<label for={controlId}>{label}</label>{/if}
28
+ <select
29
+ {...rest}
30
+ id={controlId}
31
+ class:mg-placeholder={value == null}
32
+ bind:value
33
+ aria-label={ariaLabel ?? rest['aria-label'] ?? undefined}
34
+ aria-invalid={!!errorMessage}
35
+ aria-errormessage={errorMessage ? errorId : undefined}
36
+ aria-describedby={[describedby, errorMessage ? errorId : null]
37
+ .filter(Boolean)
38
+ .join(' ') || undefined}
39
+ >
40
+ {#if placeholder}<option value={null} disabled hidden>{placeholder}</option
41
+ >{/if}
42
+ {#each items as item}<option
43
+ value={item.value}
44
+ disabled={item.disabled ?? false}>{item.label}</option
45
+ >{/each}
46
+ </select>
47
+ {#if errorMessage}<span class="mg-error" id={errorId}>{errorMessage}</span
48
+ >{/if}
49
+ </div>
@@ -0,0 +1,16 @@
1
+ import type { HTMLSelectAttributes } from 'svelte/elements';
2
+ type $$ComponentProps = Omit<HTMLSelectAttributes, 'value' | 'id'> & {
3
+ value?: string | null;
4
+ id?: string | null;
5
+ ariaLabel?: string | null;
6
+ label?: string;
7
+ errorMessage?: string | null;
8
+ items?: {
9
+ label: string;
10
+ value: string;
11
+ disabled?: boolean | null;
12
+ }[];
13
+ };
14
+ declare const Select: import("svelte").Component<$$ComponentProps, {}, "value">;
15
+ type Select = ReturnType<typeof Select>;
16
+ export default Select;
@@ -0,0 +1,34 @@
1
+ <script lang="ts">
2
+ const uid = $props.id();
3
+ import type { HTMLInputAttributes } from 'svelte/elements';
4
+ let {
5
+ value = $bindable(false),
6
+ disabled = false,
7
+ ariaLabel,
8
+ label,
9
+ name,
10
+ id = uid,
11
+ onchange,
12
+ ...rest
13
+ }: Omit<HTMLInputAttributes, 'value' | 'checked' | 'onchange' | 'type'> & {
14
+ value?: boolean;
15
+ ariaLabel?: string | null;
16
+ label?: string;
17
+ onchange?: (event: Event) => void;
18
+ } = $props();
19
+ </script>
20
+
21
+ <label class="mg-check" for={id}>
22
+ <input
23
+ {...rest}
24
+ {id}
25
+ {name}
26
+ type="checkbox"
27
+ role="switch"
28
+ bind:checked={value}
29
+ {disabled}
30
+ aria-label={ariaLabel ?? rest['aria-label'] ?? label}
31
+ {onchange}
32
+ />
33
+ {#if label}<span>{label}</span>{/if}
34
+ </label>
@@ -0,0 +1,10 @@
1
+ import type { HTMLInputAttributes } from 'svelte/elements';
2
+ type $$ComponentProps = Omit<HTMLInputAttributes, 'value' | 'checked' | 'onchange' | 'type'> & {
3
+ value?: boolean;
4
+ ariaLabel?: string | null;
5
+ label?: string;
6
+ onchange?: (event: Event) => void;
7
+ };
8
+ declare const Switch: import("svelte").Component<$$ComponentProps, {}, "value">;
9
+ type Switch = ReturnType<typeof Switch>;
10
+ export default Switch;
@@ -0,0 +1,42 @@
1
+ <script lang="ts">
2
+ const uid = $props.id();
3
+ import type { HTMLInputAttributes } from 'svelte/elements';
4
+ let {
5
+ value = $bindable(''),
6
+ placeholder = '',
7
+ errorMessage = null,
8
+ ariaLabel = null,
9
+ label,
10
+ id = uid,
11
+ type = 'text',
12
+ 'aria-describedby': describedby,
13
+ ...rest
14
+ }: Omit<HTMLInputAttributes, 'value' | 'id'> & {
15
+ value?: string;
16
+ id?: string | null;
17
+ ariaLabel?: string | null;
18
+ label?: string;
19
+ errorMessage?: string | null;
20
+ } = $props();
21
+ let controlId = $derived(id ?? uid);
22
+ let errorId = $derived(controlId + '-error');
23
+ </script>
24
+
25
+ <div class="mg-field">
26
+ {#if label}<label for={controlId}>{label}</label>{/if}
27
+ <input
28
+ {...rest}
29
+ {...{ type }}
30
+ id={controlId}
31
+ bind:value
32
+ aria-label={ariaLabel ?? rest['aria-label'] ?? undefined}
33
+ aria-invalid={!!errorMessage}
34
+ aria-errormessage={errorMessage ? errorId : undefined}
35
+ aria-describedby={[describedby, errorMessage ? errorId : null]
36
+ .filter(Boolean)
37
+ .join(' ') || undefined}
38
+ {placeholder}
39
+ />
40
+ {#if errorMessage}<span class="mg-error" id={errorId}>{errorMessage}</span
41
+ >{/if}
42
+ </div>
@@ -0,0 +1,11 @@
1
+ import type { HTMLInputAttributes } from 'svelte/elements';
2
+ type $$ComponentProps = Omit<HTMLInputAttributes, 'value' | 'id'> & {
3
+ value?: string;
4
+ id?: string | null;
5
+ ariaLabel?: string | null;
6
+ label?: string;
7
+ errorMessage?: string | null;
8
+ };
9
+ declare const TextField: import("svelte").Component<$$ComponentProps, {}, "value">;
10
+ type TextField = ReturnType<typeof TextField>;
11
+ export default TextField;
@@ -0,0 +1,6 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g id="Frame 1">
3
+ <rect width="24" height="24" rx="5" fill="#B59AFF"/>
4
+ <path id="Vector 1" d="M7 13.7273L10.3333 17L17 8" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" stroke="#1F1F1F"/>
5
+ </g>
6
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g id="Frame 1">
3
+ <rect width="24" height="24" rx="5" fill="#A59AB0"/>
4
+ <path id="Vector 1" d="M7 13.7273L10.3333 17L17 8" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" stroke="white" stroke-opacity="0.75"/>
5
+ </g>
6
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle id="Ellipse 1" cx="12" cy="12" r="11" fill="#292929" stroke-width="2" stroke="#424242"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle id="Ellipse 2" cx="9" cy="9" r="5.75" fill="white" stroke-width="6.5" stroke="#350868"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="12.5" height="6.25" viewBox="0 0 12.5 6.25" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path id="Vector" d="M0 0L6.25 6.25L12.5 0H0Z" fill="#535353"/>
3
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g id="Frame 1">
3
+ <rect width="18" height="18" rx="4" fill="#A59AB0"/>
4
+ <path id="Vector 1" d="M5 10.4545L7.66667 13L13 6" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke="white" stroke-opacity="0.75"/>
5
+ </g>
6
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle id="Ellipse 1" cx="12" cy="12" r="11" fill="white" stroke-width="2" stroke="#DBDBDB"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle id="Ellipse 2" cx="12" cy="12" r="8" fill="#1F1F1F" stroke-width="8" stroke="#B59AFF"/>
3
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g id="Frame 1">
3
+ <rect width="18" height="18" rx="4" fill="#350868"/>
4
+ <path id="Vector 1" d="M5 10.4545L7.66667 13L13 6" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke="white" stroke-opacity="0.75"/>
5
+ </g>
6
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle id="Ellipse 1" cx="9" cy="9" r="8" fill="#292929" stroke-width="2" stroke="#424242"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle id="Ellipse 4" cx="9" cy="9" r="8" fill="#F5F5F5" stroke-width="2" stroke="#EEEEEE"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle id="Ellipse 3" cx="12" cy="12" r="8" fill="white" stroke-width="8" stroke="#A59AB0"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle id="Ellipse 1" cx="9" cy="9" r="8" fill="white" stroke-width="2" stroke="#DBDBDB"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle id="Ellipse 4" cx="12" cy="12" r="11" fill="#212121" stroke-width="2" stroke="#272727"/>
3
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g id="Frame 1">
3
+ <rect width="18" height="18" rx="5" fill="#564B75"/>
4
+ <path id="Vector 1" d="M5 10.4545L7.66667 13L13 6" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke="#1F1F1F" stroke-opacity="0.7"/>
5
+ </g>
6
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g id="Frame 1">
3
+ <rect width="24" height="24" rx="5" fill="#564B75"/>
4
+ <path id="Vector 1" d="M7 13.7273L10.3333 17L17 8" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" stroke="#1F1F1F" stroke-opacity="0.7"/>
5
+ </g>
6
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g id="Frame 1">
3
+ <rect width="18" height="18" rx="5" fill="#B59AFF"/>
4
+ <path id="Vector 1" d="M5 10.4545L7.66667 13L13 6" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke="#1F1F1F"/>
5
+ </g>
6
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle id="Ellipse 2" cx="12" cy="12" r="8" fill="white" stroke-width="8" stroke="#350868"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle id="Ellipse 4" cx="12" cy="12" r="11" fill="#F5F5F5" stroke-width="2" stroke="#EEEEEE"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="12.5" height="6.25" viewBox="0 0 12.5 6.25" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path id="Vector" d="M0 0L6.25 6.25L12.5 0H0Z" fill="#8C8C8C"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="12.5" height="6.25" viewBox="0 0 12.5 6.25" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path id="Vector" d="M0 0L6.25 6.25L12.5 0H0Z" fill="#DDDDDD"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle id="Ellipse 4" cx="9" cy="9" r="8" fill="#212121" stroke-width="2" stroke="#272727"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="12.5" height="6.25" viewBox="0 0 12.5 6.25" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path id="Vector" d="M0 0L6.25 6.25L12.5 0H0Z" fill="#363636"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle id="Ellipse 3" cx="12" cy="12" r="8" fill="#1F1F1F" stroke-width="8" stroke="#564B75"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle id="Ellipse 2" cx="9" cy="9" r="5.75" fill="#1F1F1F" stroke-width="6.5" stroke="#B59AFF"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle id="Ellipse 3" cx="9" cy="9" r="5.75" fill="white" stroke-width="6.5" stroke="#A59AB0"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="12.5" height="6.25" viewBox="0 0 12.5 6.25" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path id="Vector" d="M0 0L6.25 6.25L12.5 0H0Z" fill="#DDDDDD"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle id="Ellipse 3" cx="9" cy="9" r="5.75" fill="#1F1F1F" stroke-width="6.5" stroke="#564B75"/>
3
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g id="Frame 1">
3
+ <rect width="24" height="24" rx="5" fill="#350868"/>
4
+ <path id="Vector 1" d="M7 13.7273L10.3333 17L17 8" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" stroke="white" stroke-opacity="0.75"/>
5
+ </g>
6
+ </svg>
@@ -0,0 +1,2 @@
1
+ /** Reference counting keeps scroll locked while any nested dialog is open. */
2
+ export declare function lockScroll(): () => void;
@@ -0,0 +1,13 @@
1
+ let locks = 0;
2
+ let original = '';
3
+ /** Reference counting keeps scroll locked while any nested dialog is open. */
4
+ export function lockScroll() {
5
+ if (locks++ === 0) {
6
+ original = document.documentElement.style.overflow;
7
+ document.documentElement.style.overflow = 'hidden';
8
+ }
9
+ return () => {
10
+ if (--locks === 0)
11
+ document.documentElement.style.overflow = original;
12
+ };
13
+ }
@@ -0,0 +1,59 @@
1
+ /* Original Figma vector assets. See docs/figma-assets.json for source and integrity. */
2
+ :root,
3
+ [data-magnolia-theme='system'],
4
+ [data-magnolia-theme='light'],
5
+ .color-scheme-light {
6
+ --mg-asset-checkbox-comfortable-on: url('./assets/figma/ec624.svg');
7
+ --mg-asset-checkbox-comfortable-on-disabled: url('./assets/figma/171e4.svg');
8
+ --mg-asset-checkbox-compact-on: url('./assets/figma/430a5.svg');
9
+ --mg-asset-checkbox-compact-on-disabled: url('./assets/figma/22923.svg');
10
+ --mg-asset-radio-comfortable-off: url('./assets/figma/26c8b.svg');
11
+ --mg-asset-radio-comfortable-on: url('./assets/figma/7ab1c.svg');
12
+ --mg-asset-radio-comfortable-on-disabled: url('./assets/figma/548f3.svg');
13
+ --mg-asset-radio-comfortable-off-disabled: url('./assets/figma/8be31.svg');
14
+ --mg-asset-radio-compact-off: url('./assets/figma/57389.svg');
15
+ --mg-asset-radio-compact-on: url('./assets/figma/1b390.svg');
16
+ --mg-asset-radio-compact-on-disabled: url('./assets/figma/d8950.svg');
17
+ --mg-asset-radio-compact-off-disabled: url('./assets/figma/476c6.svg');
18
+ --mg-asset-select-arrow: url('./assets/figma/b20cb.svg');
19
+ --mg-asset-select-arrow-disabled: url('./assets/figma/da2d4.svg');
20
+ --mg-asset-select-arrow-disabled-compact: url('./assets/figma/a25b6.svg');
21
+ }
22
+ @media (prefers-color-scheme: dark) {
23
+ :root:not([data-magnolia-theme='light']):not([data-theme='light']),
24
+ [data-magnolia-theme='system'] {
25
+ --mg-asset-checkbox-comfortable-on: url('./assets/figma/14d74.svg');
26
+ --mg-asset-checkbox-comfortable-on-disabled: url('./assets/figma/76db5.svg');
27
+ --mg-asset-checkbox-compact-on: url('./assets/figma/7859e.svg');
28
+ --mg-asset-checkbox-compact-on-disabled: url('./assets/figma/704f2.svg');
29
+ --mg-asset-radio-comfortable-off: url('./assets/figma/1887c.svg');
30
+ --mg-asset-radio-comfortable-on: url('./assets/figma/2bc71.svg');
31
+ --mg-asset-radio-comfortable-on-disabled: url('./assets/figma/c822a.svg');
32
+ --mg-asset-radio-comfortable-off-disabled: url('./assets/figma/6f0ad.svg');
33
+ --mg-asset-radio-compact-off: url('./assets/figma/46b3d.svg');
34
+ --mg-asset-radio-compact-on: url('./assets/figma/d1b20.svg');
35
+ --mg-asset-radio-compact-on-disabled: url('./assets/figma/e1ba2.svg');
36
+ --mg-asset-radio-compact-off-disabled: url('./assets/figma/ab7c6.svg');
37
+ --mg-asset-select-arrow: url('./assets/figma/93d28.svg');
38
+ --mg-asset-select-arrow-disabled: url('./assets/figma/21c15.svg');
39
+ --mg-asset-select-arrow-disabled-compact: url('./assets/figma/21c15.svg');
40
+ }
41
+ }
42
+ [data-magnolia-theme='dark'],
43
+ .color-scheme-dark {
44
+ --mg-asset-checkbox-comfortable-on: url('./assets/figma/14d74.svg');
45
+ --mg-asset-checkbox-comfortable-on-disabled: url('./assets/figma/76db5.svg');
46
+ --mg-asset-checkbox-compact-on: url('./assets/figma/7859e.svg');
47
+ --mg-asset-checkbox-compact-on-disabled: url('./assets/figma/704f2.svg');
48
+ --mg-asset-radio-comfortable-off: url('./assets/figma/1887c.svg');
49
+ --mg-asset-radio-comfortable-on: url('./assets/figma/2bc71.svg');
50
+ --mg-asset-radio-comfortable-on-disabled: url('./assets/figma/c822a.svg');
51
+ --mg-asset-radio-comfortable-off-disabled: url('./assets/figma/6f0ad.svg');
52
+ --mg-asset-radio-compact-off: url('./assets/figma/46b3d.svg');
53
+ --mg-asset-radio-compact-on: url('./assets/figma/d1b20.svg');
54
+ --mg-asset-radio-compact-on-disabled: url('./assets/figma/e1ba2.svg');
55
+ --mg-asset-radio-compact-off-disabled: url('./assets/figma/ab7c6.svg');
56
+ --mg-asset-select-arrow: url('./assets/figma/93d28.svg');
57
+ --mg-asset-select-arrow-disabled: url('./assets/figma/21c15.svg');
58
+ --mg-asset-select-arrow-disabled-compact: url('./assets/figma/21c15.svg');
59
+ }
package/dist/fonts.css ADDED
@@ -0,0 +1,2 @@
1
+ /* Optional: omit this file to self-host fonts or operate entirely offline. */
2
+ @import url('https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;600;700&family=Material+Symbols+Rounded:wght@500&display=swap');
@@ -0,0 +1,17 @@
1
+ export { default as MagnoliaUIRoot } from './MagnoliaUIRoot.svelte';
2
+ export { default as DensityProvider } from './DensityProvider.svelte';
3
+ export { default as Button } from './Button.svelte';
4
+ export { default as Icon } from './Icon.svelte';
5
+ export { default as Switch } from './Switch.svelte';
6
+ export { default as TextField } from './TextField.svelte';
7
+ export { default as Select } from './Select.svelte';
8
+ export { default as Menu } from './Menu.svelte';
9
+ export { default as MenuWrapper } from './MenuWrapper.svelte';
10
+ export { default as MenuItem } from './MenuItem.svelte';
11
+ export { default as MenuButton } from './MenuButton.svelte';
12
+ export { default as Dialog } from './Dialog.svelte';
13
+ export { default as Checkbox } from './Checkbox.svelte';
14
+ export { default as Radio } from './Radio.svelte';
15
+ export { default as Alert } from './Alert.svelte';
16
+ export type { ButtonProps, Variant } from './types.js';
17
+ export { default as Pill } from './Pill.svelte';
package/dist/index.js ADDED
@@ -0,0 +1,16 @@
1
+ export { default as MagnoliaUIRoot } from './MagnoliaUIRoot.svelte';
2
+ export { default as DensityProvider } from './DensityProvider.svelte';
3
+ export { default as Button } from './Button.svelte';
4
+ export { default as Icon } from './Icon.svelte';
5
+ export { default as Switch } from './Switch.svelte';
6
+ export { default as TextField } from './TextField.svelte';
7
+ export { default as Select } from './Select.svelte';
8
+ export { default as Menu } from './Menu.svelte';
9
+ export { default as MenuWrapper } from './MenuWrapper.svelte';
10
+ export { default as MenuItem } from './MenuItem.svelte';
11
+ export { default as MenuButton } from './MenuButton.svelte';
12
+ export { default as Dialog } from './Dialog.svelte';
13
+ export { default as Checkbox } from './Checkbox.svelte';
14
+ export { default as Radio } from './Radio.svelte';
15
+ export { default as Alert } from './Alert.svelte';
16
+ export { default as Pill } from './Pill.svelte';
@@ -0,0 +1,4 @@
1
+ export declare const MENU: unique symbol;
2
+ export type MenuContext = {
3
+ close: () => void;
4
+ };
@@ -0,0 +1 @@
1
+ export const MENU = Symbol('Magnolia action menu');