@sveltia/ui 0.2.0 → 0.2.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.
Files changed (107) hide show
  1. package/package/components/composite/calendar.svelte +239 -0
  2. package/package/components/composite/calendar.svelte.d.ts +27 -0
  3. package/package/components/composite/checkbox-group.svelte +43 -0
  4. package/package/components/composite/checkbox-group.svelte.d.ts +34 -0
  5. package/package/components/composite/combobox.svelte +210 -0
  6. package/package/components/composite/combobox.svelte.d.ts +47 -0
  7. package/package/components/composite/disclosure.svelte +60 -0
  8. package/package/components/composite/disclosure.svelte.d.ts +35 -0
  9. package/package/components/composite/grid.svelte +24 -0
  10. package/package/components/composite/grid.svelte.d.ts +31 -0
  11. package/package/components/composite/listbox.svelte +63 -0
  12. package/package/components/composite/listbox.svelte.d.ts +52 -0
  13. package/package/components/composite/menu-item-group.svelte +31 -0
  14. package/package/components/composite/menu-item-group.svelte.d.ts +33 -0
  15. package/package/components/composite/menu.svelte +44 -0
  16. package/package/components/composite/menu.svelte.d.ts +41 -0
  17. package/package/components/composite/radio-button-group.svelte +45 -0
  18. package/package/components/composite/radio-button-group.svelte.d.ts +36 -0
  19. package/package/components/composite/select-button-group.svelte +71 -0
  20. package/package/components/composite/select-button-group.svelte.d.ts +44 -0
  21. package/package/components/composite/select.svelte +34 -0
  22. package/package/components/composite/select.svelte.d.ts +38 -0
  23. package/package/components/composite/tab-list.svelte +76 -0
  24. package/package/components/composite/tab-list.svelte.d.ts +55 -0
  25. package/package/components/core/button.svelte +216 -0
  26. package/package/components/core/button.svelte.d.ts +109 -0
  27. package/package/components/core/checkbox.svelte +114 -0
  28. package/package/components/core/checkbox.svelte.d.ts +45 -0
  29. package/package/components/core/dialog.svelte +288 -0
  30. package/package/components/core/dialog.svelte.d.ts +73 -0
  31. package/package/components/core/drawer.svelte +338 -0
  32. package/package/components/core/drawer.svelte.d.ts +59 -0
  33. package/package/components/core/grid-cell.svelte +14 -0
  34. package/package/components/core/grid-cell.svelte.d.ts +29 -0
  35. package/package/components/core/group.svelte +31 -0
  36. package/package/components/core/group.svelte.d.ts +33 -0
  37. package/package/components/core/icon.svelte +21 -0
  38. package/package/components/core/icon.svelte.d.ts +27 -0
  39. package/package/components/core/menu-button.svelte +57 -0
  40. package/package/components/core/menu-button.svelte.d.ts +46 -0
  41. package/package/components/core/menu-item-checkbox.svelte +24 -0
  42. package/package/components/core/menu-item-checkbox.svelte.d.ts +34 -0
  43. package/package/components/core/menu-item-radio.svelte +19 -0
  44. package/package/components/core/menu-item-radio.svelte.d.ts +34 -0
  45. package/package/components/core/menu-item.svelte +113 -0
  46. package/package/components/core/menu-item.svelte.d.ts +44 -0
  47. package/package/components/core/number-input.svelte +112 -0
  48. package/package/components/core/number-input.svelte.d.ts +42 -0
  49. package/package/components/core/option.svelte +65 -0
  50. package/package/components/core/option.svelte.d.ts +60 -0
  51. package/package/components/core/password-input.svelte +81 -0
  52. package/package/components/core/password-input.svelte.d.ts +36 -0
  53. package/package/components/core/radio-button.svelte +93 -0
  54. package/package/components/core/radio-button.svelte.d.ts +37 -0
  55. package/package/components/core/row-group.svelte +14 -0
  56. package/package/components/core/row-group.svelte.d.ts +29 -0
  57. package/package/components/core/row.svelte +14 -0
  58. package/package/components/core/row.svelte.d.ts +33 -0
  59. package/package/components/core/search-bar.svelte +91 -0
  60. package/package/components/core/search-bar.svelte.d.ts +49 -0
  61. package/package/components/core/select-button.svelte +31 -0
  62. package/package/components/core/select-button.svelte.d.ts +52 -0
  63. package/package/components/core/separator.svelte +28 -0
  64. package/package/components/core/separator.svelte.d.ts +26 -0
  65. package/package/components/core/slider.svelte +271 -0
  66. package/package/components/core/slider.svelte.d.ts +51 -0
  67. package/package/components/core/spacer.svelte +22 -0
  68. package/package/components/core/spacer.svelte.d.ts +25 -0
  69. package/package/components/core/switch.svelte +86 -0
  70. package/package/components/core/switch.svelte.d.ts +37 -0
  71. package/package/components/core/tab-panel.svelte +23 -0
  72. package/package/components/core/tab-panel.svelte.d.ts +33 -0
  73. package/package/components/core/tab.svelte +22 -0
  74. package/package/components/core/tab.svelte.d.ts +45 -0
  75. package/package/components/core/text-area.svelte +90 -0
  76. package/package/components/core/text-area.svelte.d.ts +57 -0
  77. package/package/components/core/text-input.svelte +146 -0
  78. package/package/components/core/text-input.svelte.d.ts +71 -0
  79. package/package/components/core/toolbar.svelte +74 -0
  80. package/package/components/core/toolbar.svelte.d.ts +35 -0
  81. package/package/components/editor/markdown.svelte +78 -0
  82. package/package/components/editor/markdown.svelte.d.ts +25 -0
  83. package/package/components/helpers/group.d.ts +37 -0
  84. package/package/components/helpers/group.js +246 -0
  85. package/package/components/helpers/popup.d.ts +31 -0
  86. package/package/components/helpers/popup.js +165 -0
  87. package/package/components/helpers/util.d.ts +1 -0
  88. package/package/components/helpers/util.js +8 -0
  89. package/package/components/util/app-shell.svelte +354 -0
  90. package/package/components/util/app-shell.svelte.d.ts +38 -0
  91. package/package/components/util/misc.d.ts +2 -0
  92. package/package/components/util/misc.js +22 -0
  93. package/package/components/util/popup.svelte +155 -0
  94. package/package/components/util/popup.svelte.d.ts +53 -0
  95. package/package/components/util/portal.svelte +34 -0
  96. package/package/components/util/portal.svelte.d.ts +28 -0
  97. package/package/index.d.ts +43 -0
  98. package/package/index.js +66 -0
  99. package/package/locales/en.d.ts +42 -0
  100. package/package/locales/en.js +41 -0
  101. package/package/locales/ja.d.ts +42 -0
  102. package/package/locales/ja.js +41 -0
  103. package/package/styles/core.scss +134 -0
  104. package/package/styles/variables.scss +184 -0
  105. package/package/typedef.d.ts +0 -0
  106. package/package/typedef.js +0 -0
  107. package/package.json +2 -3
@@ -0,0 +1,59 @@
1
+ /** @typedef {typeof __propDef.props} DrawerProps */
2
+ /** @typedef {typeof __propDef.events} DrawerEvents */
3
+ /** @typedef {typeof __propDef.slots} DrawerSlots */
4
+ /**
5
+ * @see https://w3c.github.io/aria/#dialog
6
+ * @see https://w3c.github.io/aria-practices/#dialog_modal
7
+ */
8
+ export default class Drawer extends SvelteComponentTyped<{
9
+ title?: string;
10
+ position?: "top" | "right" | "bottom" | "left";
11
+ open?: boolean;
12
+ class?: string;
13
+ size?: "small" | "medium" | "large" | "x-large";
14
+ showClose?: false | "inside" | "outside";
15
+ closeOnBackdropClick?: boolean;
16
+ }, {
17
+ submit: SubmitEvent;
18
+ ok: CustomEvent<any>;
19
+ cancel: CustomEvent<any>;
20
+ close: CustomEvent<any>;
21
+ } & {
22
+ [evt: string]: CustomEvent<any>;
23
+ }, {
24
+ header: {};
25
+ 'header-extra': {};
26
+ default: {};
27
+ footer: {};
28
+ }> {
29
+ }
30
+ export type DrawerProps = typeof __propDef.props;
31
+ export type DrawerEvents = typeof __propDef.events;
32
+ export type DrawerSlots = typeof __propDef.slots;
33
+ import { SvelteComponentTyped } from "svelte";
34
+ declare const __propDef: {
35
+ props: {
36
+ title?: string;
37
+ position?: ('top' | 'right' | 'bottom' | 'left');
38
+ open?: boolean;
39
+ class?: string;
40
+ size?: ('small' | 'medium' | 'large' | 'x-large');
41
+ showClose?: ('inside' | 'outside' | false);
42
+ closeOnBackdropClick?: boolean;
43
+ };
44
+ events: {
45
+ submit: SubmitEvent;
46
+ ok: CustomEvent<any>;
47
+ cancel: CustomEvent<any>;
48
+ close: CustomEvent<any>;
49
+ } & {
50
+ [evt: string]: CustomEvent<any>;
51
+ };
52
+ slots: {
53
+ header: {};
54
+ 'header-extra': {};
55
+ default: {};
56
+ footer: {};
57
+ };
58
+ };
59
+ export {};
@@ -0,0 +1,14 @@
1
+ <script>
2
+ /**
3
+ * CSS class name on the button.
4
+ * @type {String}
5
+ */
6
+ // eslint-disable-next-line padding-line-between-statements
7
+ let className = '';
8
+
9
+ export { className as class };
10
+ </script>
11
+
12
+ <div role="gridcell" class="sui grid-cell {className}" {...$$restProps}>
13
+ <slot />
14
+ </div>
@@ -0,0 +1,29 @@
1
+ /** @typedef {typeof __propDef.props} GridCellProps */
2
+ /** @typedef {typeof __propDef.events} GridCellEvents */
3
+ /** @typedef {typeof __propDef.slots} GridCellSlots */
4
+ export default class GridCell extends SvelteComponentTyped<{
5
+ [x: string]: any;
6
+ class?: string;
7
+ }, {
8
+ [evt: string]: CustomEvent<any>;
9
+ }, {
10
+ default: {};
11
+ }> {
12
+ }
13
+ export type GridCellProps = typeof __propDef.props;
14
+ export type GridCellEvents = typeof __propDef.events;
15
+ export type GridCellSlots = typeof __propDef.slots;
16
+ import { SvelteComponentTyped } from "svelte";
17
+ declare const __propDef: {
18
+ props: {
19
+ [x: string]: any;
20
+ class?: string;
21
+ };
22
+ events: {
23
+ [evt: string]: CustomEvent<any>;
24
+ };
25
+ slots: {
26
+ default: {};
27
+ };
28
+ };
29
+ export {};
@@ -0,0 +1,31 @@
1
+ <script>
2
+ import { getRandomId } from '../helpers/util';
3
+
4
+ /**
5
+ * CSS class name on the button.
6
+ * @type {String}
7
+ */
8
+ let className = '';
9
+
10
+ export { className as class };
11
+
12
+ export let title = '';
13
+
14
+ export let ariaLabel = '';
15
+
16
+ const id = getRandomId('group');
17
+ </script>
18
+
19
+ <div
20
+ class="sui group {className}"
21
+ role="group"
22
+ {id}
23
+ aria-label={ariaLabel || undefined}
24
+ aria-labelledby={title ? '{id}-title' : undefined}
25
+ {...$$restProps}
26
+ >
27
+ {#if title}
28
+ <div class="title" id="{id}-title">{title}</div>
29
+ {/if}
30
+ <slot />
31
+ </div>
@@ -0,0 +1,33 @@
1
+ /** @typedef {typeof __propDef.props} GroupProps */
2
+ /** @typedef {typeof __propDef.events} GroupEvents */
3
+ /** @typedef {typeof __propDef.slots} GroupSlots */
4
+ export default class Group extends SvelteComponentTyped<{
5
+ [x: string]: any;
6
+ title?: string;
7
+ class?: string;
8
+ ariaLabel?: string;
9
+ }, {
10
+ [evt: string]: CustomEvent<any>;
11
+ }, {
12
+ default: {};
13
+ }> {
14
+ }
15
+ export type GroupProps = typeof __propDef.props;
16
+ export type GroupEvents = typeof __propDef.events;
17
+ export type GroupSlots = typeof __propDef.slots;
18
+ import { SvelteComponentTyped } from "svelte";
19
+ declare const __propDef: {
20
+ props: {
21
+ [x: string]: any;
22
+ title?: string;
23
+ class?: string;
24
+ ariaLabel?: string;
25
+ };
26
+ events: {
27
+ [evt: string]: CustomEvent<any>;
28
+ };
29
+ slots: {
30
+ default: {};
31
+ };
32
+ };
33
+ export {};
@@ -0,0 +1,21 @@
1
+ <script>
2
+ /**
3
+ * CSS class name on the button.
4
+ * @type {String}
5
+ */
6
+ let className = '';
7
+
8
+ export { className as class };
9
+
10
+ export let name = '';
11
+
12
+ export let label = '';
13
+ </script>
14
+
15
+ <span
16
+ class="sui icon material-symbols-outlined {className}"
17
+ aria-label={label || undefined}
18
+ aria-hidden={label ? undefined : true}
19
+ >
20
+ {name}
21
+ </span>
@@ -0,0 +1,27 @@
1
+ /** @typedef {typeof __propDef.props} IconProps */
2
+ /** @typedef {typeof __propDef.events} IconEvents */
3
+ /** @typedef {typeof __propDef.slots} IconSlots */
4
+ export default class Icon extends SvelteComponentTyped<{
5
+ label?: string;
6
+ class?: string;
7
+ name?: string;
8
+ }, {
9
+ [evt: string]: CustomEvent<any>;
10
+ }, {}> {
11
+ }
12
+ export type IconProps = typeof __propDef.props;
13
+ export type IconEvents = typeof __propDef.events;
14
+ export type IconSlots = typeof __propDef.slots;
15
+ import { SvelteComponentTyped } from "svelte";
16
+ declare const __propDef: {
17
+ props: {
18
+ label?: string;
19
+ class?: string;
20
+ name?: string;
21
+ };
22
+ events: {
23
+ [evt: string]: CustomEvent<any>;
24
+ };
25
+ slots: {};
26
+ };
27
+ export {};
@@ -0,0 +1,57 @@
1
+ <!--
2
+ @component
3
+ @see https://w3c.github.io/aria-practices/#menubutton
4
+ -->
5
+ <script>
6
+ import Popup from '../util/popup.svelte';
7
+ import Button from './button.svelte';
8
+
9
+ /**
10
+ * CSS class name on the button.
11
+ * @type {String}
12
+ */
13
+ let className = '';
14
+
15
+ export { className as class };
16
+
17
+ /**
18
+ * Where to show the dropdown menu.
19
+ * @type {PopupPosition}
20
+ */
21
+ export let popupPosition = 'bottom-left';
22
+
23
+ /** @type {?Button} */
24
+ let buttonComponent;
25
+ /** @type {?Popup} */
26
+ let popupComponent;
27
+ </script>
28
+
29
+ <Button
30
+ class="sui menu-button {className}"
31
+ aria-haspopup="menu"
32
+ {...$$restProps}
33
+ bind:this={buttonComponent}
34
+ on:keydown={(event) => {
35
+ const { key, ctrlKey, metaKey, shiftKey, altKey } = event;
36
+
37
+ if (['ArrowUp', 'ArrowDown'].includes(key) && !ctrlKey && !metaKey && !shiftKey && !altKey) {
38
+ event.preventDefault();
39
+
40
+ const members = [
41
+ ...popupComponent.dialog.querySelectorAll('[role^="menuitem"]:not([aria-disabled="true"])'),
42
+ ];
43
+
44
+ if (members.length) {
45
+ (key === 'ArrowUp' ? members.pop() : members.shift()).focus();
46
+ }
47
+ }
48
+ }}
49
+ >
50
+ <slot name="start-icon" slot="start-icon" />
51
+ <slot />
52
+ <slot name="end-icon" slot="end-icon" />
53
+ </Button>
54
+
55
+ <Popup anchor={buttonComponent?.element} position={popupPosition} bind:this={popupComponent}>
56
+ <slot name="popup" />
57
+ </Popup>
@@ -0,0 +1,46 @@
1
+ /** @typedef {typeof __propDef.props} MenuButtonProps */
2
+ /** @typedef {typeof __propDef.events} MenuButtonEvents */
3
+ /** @typedef {typeof __propDef.slots} MenuButtonSlots */
4
+ /** @see https://w3c.github.io/aria-practices/#menubutton */
5
+ export default class MenuButton extends SvelteComponentTyped<{
6
+ [x: string]: any;
7
+ class?: string;
8
+ popupPosition?: any;
9
+ }, {
10
+ [evt: string]: CustomEvent<any>;
11
+ }, {
12
+ 'start-icon': {
13
+ slot: string;
14
+ };
15
+ default: {};
16
+ 'end-icon': {
17
+ slot: string;
18
+ };
19
+ popup: {};
20
+ }> {
21
+ }
22
+ export type MenuButtonProps = typeof __propDef.props;
23
+ export type MenuButtonEvents = typeof __propDef.events;
24
+ export type MenuButtonSlots = typeof __propDef.slots;
25
+ import { SvelteComponentTyped } from "svelte";
26
+ declare const __propDef: {
27
+ props: {
28
+ [x: string]: any;
29
+ class?: string;
30
+ popupPosition?: any;
31
+ };
32
+ events: {
33
+ [evt: string]: CustomEvent<any>;
34
+ };
35
+ slots: {
36
+ 'start-icon': {
37
+ slot: string;
38
+ };
39
+ default: {};
40
+ 'end-icon': {
41
+ slot: string;
42
+ };
43
+ popup: {};
44
+ };
45
+ };
46
+ export {};
@@ -0,0 +1,24 @@
1
+ <!--
2
+ @component
3
+ @see https://w3c.github.io/aria/#menuitemcheckbox
4
+ -->
5
+ <script>
6
+ import MenuItem from './menu-item.svelte';
7
+
8
+ /**
9
+ * CSS class name on the button.
10
+ * @type {String}
11
+ */
12
+ let className = '';
13
+
14
+ export { className as class };
15
+ </script>
16
+
17
+ <MenuItem
18
+ class="sui menu-item-checkbox {className}"
19
+ role="menuitemcheckbox"
20
+ {...$$restProps}
21
+ on:click
22
+ >
23
+ <slot />
24
+ </MenuItem>
@@ -0,0 +1,34 @@
1
+ /** @typedef {typeof __propDef.props} MenuItemCheckboxProps */
2
+ /** @typedef {typeof __propDef.events} MenuItemCheckboxEvents */
3
+ /** @typedef {typeof __propDef.slots} MenuItemCheckboxSlots */
4
+ /** @see https://w3c.github.io/aria/#menuitemcheckbox */
5
+ export default class MenuItemCheckbox extends SvelteComponentTyped<{
6
+ [x: string]: any;
7
+ class?: string;
8
+ }, {
9
+ click: MouseEvent;
10
+ } & {
11
+ [evt: string]: CustomEvent<any>;
12
+ }, {
13
+ default: {};
14
+ }> {
15
+ }
16
+ export type MenuItemCheckboxProps = typeof __propDef.props;
17
+ export type MenuItemCheckboxEvents = typeof __propDef.events;
18
+ export type MenuItemCheckboxSlots = typeof __propDef.slots;
19
+ import { SvelteComponentTyped } from "svelte";
20
+ declare const __propDef: {
21
+ props: {
22
+ [x: string]: any;
23
+ class?: string;
24
+ };
25
+ events: {
26
+ click: MouseEvent;
27
+ } & {
28
+ [evt: string]: CustomEvent<any>;
29
+ };
30
+ slots: {
31
+ default: {};
32
+ };
33
+ };
34
+ export {};
@@ -0,0 +1,19 @@
1
+ <!--
2
+ @component
3
+ @see https://w3c.github.io/aria/#menuitemradio
4
+ -->
5
+ <script>
6
+ import MenuItem from './menu-item.svelte';
7
+
8
+ /**
9
+ * CSS class name on the button.
10
+ * @type {String}
11
+ */
12
+ let className = '';
13
+
14
+ export { className as class };
15
+ </script>
16
+
17
+ <MenuItem class="sui menu-item-radio {className}" role="menuitemradio" {...$$restProps} on:click>
18
+ <slot />
19
+ </MenuItem>
@@ -0,0 +1,34 @@
1
+ /** @typedef {typeof __propDef.props} MenuItemRadioProps */
2
+ /** @typedef {typeof __propDef.events} MenuItemRadioEvents */
3
+ /** @typedef {typeof __propDef.slots} MenuItemRadioSlots */
4
+ /** @see https://w3c.github.io/aria/#menuitemradio */
5
+ export default class MenuItemRadio extends SvelteComponentTyped<{
6
+ [x: string]: any;
7
+ class?: string;
8
+ }, {
9
+ click: MouseEvent;
10
+ } & {
11
+ [evt: string]: CustomEvent<any>;
12
+ }, {
13
+ default: {};
14
+ }> {
15
+ }
16
+ export type MenuItemRadioProps = typeof __propDef.props;
17
+ export type MenuItemRadioEvents = typeof __propDef.events;
18
+ export type MenuItemRadioSlots = typeof __propDef.slots;
19
+ import { SvelteComponentTyped } from "svelte";
20
+ declare const __propDef: {
21
+ props: {
22
+ [x: string]: any;
23
+ class?: string;
24
+ };
25
+ events: {
26
+ click: MouseEvent;
27
+ } & {
28
+ [evt: string]: CustomEvent<any>;
29
+ };
30
+ slots: {
31
+ default: {};
32
+ };
33
+ };
34
+ export {};
@@ -0,0 +1,113 @@
1
+ <!--
2
+ @component
3
+ @see https://w3c.github.io/aria/#menuitem
4
+ -->
5
+ <script>
6
+ import { writable } from 'svelte/store';
7
+ import Menu from '../composite/menu.svelte';
8
+ import Popup from '../util/popup.svelte';
9
+ import Button from './button.svelte';
10
+ import Icon from './icon.svelte';
11
+
12
+ let className = '';
13
+
14
+ export { className as class };
15
+
16
+ /** @type {('menuitem'|'menuitemcheckbox'|'menuitemradio')} */
17
+ export let role = 'menuitem';
18
+
19
+ export let label = '';
20
+
21
+ export let iconName = '';
22
+
23
+ export let iconLabel = '';
24
+
25
+ export let checked = false;
26
+
27
+ /** @type {Button} */
28
+ let buttonComponent;
29
+ let isPopupOpen = writable(false);
30
+
31
+ $: hasChildren = role === 'menuitem' && $$slots.default;
32
+ </script>
33
+
34
+ <div class="sui menuitem {className}">
35
+ <Button
36
+ {role}
37
+ aria-checked={checked}
38
+ aria-haspopup={hasChildren ? 'menu' : undefined}
39
+ aria-expanded={$isPopupOpen ? true : undefined}
40
+ {...$$restProps}
41
+ bind:this={buttonComponent}
42
+ on:click
43
+ on:mouseenter={() => {
44
+ $isPopupOpen = true;
45
+ }}
46
+ on:mouseleave={() => {
47
+ $isPopupOpen = false;
48
+ }}
49
+ >
50
+ {#if iconName}
51
+ <Icon slot="start-icon" name={iconName} label={iconLabel} />
52
+ {/if}
53
+ {#if label}
54
+ <span class="label">{label}</span>
55
+ {/if}
56
+ {#if role === 'menuitemradio' || role === 'menuitemcheckbox'}
57
+ <span class="icon-outer">
58
+ {#if checked}
59
+ <Icon name="check" />
60
+ {/if}
61
+ </span>
62
+ {/if}
63
+ {#if hasChildren}
64
+ <span class="icon-outer">
65
+ <Icon name="chevron_right" />
66
+ </span>
67
+ {/if}
68
+ </Button>
69
+ {#if hasChildren}
70
+ <Popup anchor={buttonComponent?.element} position="right-top" bind:open={isPopupOpen}>
71
+ <Menu>
72
+ <slot />
73
+ </Menu>
74
+ </Popup>
75
+ {/if}
76
+ </div>
77
+
78
+ <style>.menuitem {
79
+ position: relative;
80
+ }
81
+ .menuitem :global(button) {
82
+ display: flex;
83
+ justify-content: space-between !important;
84
+ border-radius: 4px;
85
+ padding: 0 16px;
86
+ width: 100%;
87
+ min-width: 160px;
88
+ height: var(--option--medium--height);
89
+ }
90
+ .menuitem :global(button[aria-checked="true"]) :global(.icon) {
91
+ color: var(--primary-accent-color-lighter);
92
+ }
93
+ .menuitem :global(button:hover),
94
+ .menuitem :global(button:focus) {
95
+ color: var(--highlight-foreground-color);
96
+ background-color: var(--highlight-background-color);
97
+ }
98
+ .menuitem:hover > :global([role="menu"]) {
99
+ opacity: 1;
100
+ }
101
+ .menuitem > :global([role="menu"]) {
102
+ position: absolute;
103
+ inset: 2px auto auto calc(100% + 4px);
104
+ }
105
+ .menuitem > :global([role="menu"]):hover {
106
+ opacity: 1;
107
+ }
108
+
109
+ .icon-outer {
110
+ flex: none;
111
+ width: 24px;
112
+ height: 24px;
113
+ }</style>
@@ -0,0 +1,44 @@
1
+ /** @typedef {typeof __propDef.props} MenuItemProps */
2
+ /** @typedef {typeof __propDef.events} MenuItemEvents */
3
+ /** @typedef {typeof __propDef.slots} MenuItemSlots */
4
+ /** @see https://w3c.github.io/aria/#menuitem */
5
+ export default class MenuItem extends SvelteComponentTyped<{
6
+ [x: string]: any;
7
+ label?: string;
8
+ class?: string;
9
+ role?: "menuitem" | "menuitemcheckbox" | "menuitemradio";
10
+ checked?: boolean;
11
+ iconName?: string;
12
+ iconLabel?: string;
13
+ }, {
14
+ click: MouseEvent;
15
+ } & {
16
+ [evt: string]: CustomEvent<any>;
17
+ }, {
18
+ default: {};
19
+ }> {
20
+ }
21
+ export type MenuItemProps = typeof __propDef.props;
22
+ export type MenuItemEvents = typeof __propDef.events;
23
+ export type MenuItemSlots = typeof __propDef.slots;
24
+ import { SvelteComponentTyped } from "svelte";
25
+ declare const __propDef: {
26
+ props: {
27
+ [x: string]: any;
28
+ label?: string;
29
+ class?: string;
30
+ role?: ('menuitem' | 'menuitemcheckbox' | 'menuitemradio');
31
+ checked?: boolean;
32
+ iconName?: string;
33
+ iconLabel?: string;
34
+ };
35
+ events: {
36
+ click: MouseEvent;
37
+ } & {
38
+ [evt: string]: CustomEvent<any>;
39
+ };
40
+ slots: {
41
+ default: {};
42
+ };
43
+ };
44
+ export {};