@sveltia/ui 0.1.2 → 0.1.4

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 (67) hide show
  1. package/package/components/composite/calendar.svelte +5 -5
  2. package/package/components/composite/calendar.svelte.d.ts +1 -8
  3. package/package/components/composite/checkbox-group.svelte.d.ts +1 -11
  4. package/package/components/composite/combobox.svelte +22 -4
  5. package/package/components/composite/combobox.svelte.d.ts +3 -18
  6. package/package/components/composite/disclosure.svelte.d.ts +2 -11
  7. package/package/components/composite/grid.svelte.d.ts +1 -10
  8. package/package/components/composite/listbox.svelte.d.ts +7 -20
  9. package/package/components/composite/menu-item-group.svelte.d.ts +2 -12
  10. package/package/components/composite/menu.svelte.d.ts +5 -14
  11. package/package/components/composite/radio-button-group.svelte +1 -0
  12. package/package/components/composite/radio-button-group.svelte.d.ts +1 -10
  13. package/package/components/composite/select-button-group.svelte +1 -0
  14. package/package/components/composite/select-button-group.svelte.d.ts +1 -14
  15. package/package/components/composite/select.svelte.d.ts +3 -15
  16. package/package/components/composite/tab-list.svelte.d.ts +10 -23
  17. package/package/components/core/button.svelte +18 -22
  18. package/package/components/core/button.svelte.d.ts +26 -61
  19. package/package/components/core/checkbox.svelte +4 -2
  20. package/package/components/core/checkbox.svelte.d.ts +1 -14
  21. package/package/components/core/dialog.svelte +4 -3
  22. package/package/components/core/dialog.svelte.d.ts +3 -31
  23. package/package/components/core/grid-cell.svelte.d.ts +1 -9
  24. package/package/components/core/group.svelte.d.ts +2 -12
  25. package/package/components/core/icon.svelte.d.ts +2 -9
  26. package/package/components/core/menu-button.svelte +10 -18
  27. package/package/components/core/menu-button.svelte.d.ts +9 -15
  28. package/package/components/core/menu-item-checkbox.svelte.d.ts +2 -12
  29. package/package/components/core/menu-item-radio.svelte.d.ts +2 -12
  30. package/package/components/core/menu-item.svelte +1 -1
  31. package/package/components/core/menu-item.svelte.d.ts +4 -19
  32. package/package/components/core/number-input.svelte +7 -6
  33. package/package/components/core/number-input.svelte.d.ts +3 -17
  34. package/package/components/core/option.svelte +3 -1
  35. package/package/components/core/option.svelte.d.ts +12 -21
  36. package/package/components/core/password-input.svelte +8 -3
  37. package/package/components/core/password-input.svelte.d.ts +4 -15
  38. package/package/components/core/radio-button.svelte +4 -2
  39. package/package/components/core/radio-button.svelte.d.ts +1 -11
  40. package/package/components/core/row-group.svelte.d.ts +1 -9
  41. package/package/components/core/row.svelte.d.ts +1 -11
  42. package/package/components/core/search-bar.svelte +3 -3
  43. package/package/components/core/search-bar.svelte.d.ts +12 -26
  44. package/package/components/core/select-button.svelte +2 -0
  45. package/package/components/core/select-button.svelte.d.ts +8 -13
  46. package/package/components/core/separator.svelte.d.ts +1 -7
  47. package/package/components/core/slider.svelte +270 -0
  48. package/package/components/core/slider.svelte.d.ts +35 -0
  49. package/package/components/core/spacer.svelte.d.ts +1 -7
  50. package/package/components/core/switch.svelte.d.ts +2 -12
  51. package/package/components/core/tab-panel.svelte.d.ts +1 -9
  52. package/package/components/core/tab.svelte +2 -0
  53. package/package/components/core/tab.svelte.d.ts +7 -9
  54. package/package/components/core/text-area.svelte.d.ts +12 -26
  55. package/package/components/core/text-input.svelte.d.ts +16 -34
  56. package/package/components/core/toolbar.svelte.d.ts +1 -10
  57. package/package/components/editor/markdown.svelte +4 -1
  58. package/package/components/editor/markdown.svelte.d.ts +1 -7
  59. package/package/components/helpers/popup.d.ts +2 -7
  60. package/package/components/helpers/popup.js +28 -16
  61. package/package/components/util/app-shell.svelte.d.ts +1 -11
  62. package/package/components/util/popup.svelte +24 -16
  63. package/package/components/util/popup.svelte.d.ts +10 -19
  64. package/package/components/util/portal.svelte.d.ts +1 -8
  65. package/package/index.d.ts +1 -0
  66. package/package/index.js +1 -0
  67. package/package.json +24 -16
@@ -2,7 +2,6 @@
2
2
  import { _ } from 'svelte-i18n';
3
3
  import Button from '../core/button.svelte';
4
4
  import Icon from '../core/icon.svelte';
5
- import MenuButton from '../core/menu-button.svelte';
6
5
  import Separator from '../core/separator.svelte';
7
6
  import Spacer from '../core/spacer.svelte';
8
7
 
@@ -43,13 +42,14 @@
43
42
  <div role="group">
44
43
  <input type="hidden" bind:value />
45
44
  <div class="header">
46
- <MenuButton
45
+ <Button
47
46
  class="ternary"
48
47
  label={firstDay.toLocaleDateString('en', { year: 'numeric', month: 'short' })}
49
- iconName="arrow_drop_down"
48
+ aria-haspopup="dialog"
50
49
  >
50
+ <Icon slot="end-icon" name="arrow_drop_down" />
51
51
  <!-- svelte-ignore a11y-click-events-have-key-events -->
52
- <div class="popup-inner" on:click|stopPropagation>
52
+ <div slot="popup" class="popup-inner" on:click|stopPropagation>
53
53
  <div role="group" aria-label={$_('sui.calendar.year')}>
54
54
  <div class="header">
55
55
  <Button
@@ -90,7 +90,7 @@
90
90
  </div>
91
91
  </div>
92
92
  </div>
93
- </MenuButton>
93
+ </Button>
94
94
  <Button
95
95
  on:click={() => {
96
96
  firstDay.setUTCMonth(firstDay.getUTCMonth() - 1);
@@ -1,18 +1,11 @@
1
1
  /** @typedef {typeof __propDef.props} CalendarProps */
2
2
  /** @typedef {typeof __propDef.events} CalendarEvents */
3
3
  /** @typedef {typeof __propDef.slots} CalendarSlots */
4
- export default class Calendar extends SvelteComponentTyped<{
5
- value?: string;
6
- }, {
7
- click: MouseEvent;
8
- } & {
9
- [evt: string]: CustomEvent<any>;
10
- }, {}> {
4
+ export default class Calendar {
11
5
  }
12
6
  export type CalendarProps = typeof __propDef.props;
13
7
  export type CalendarEvents = typeof __propDef.events;
14
8
  export type CalendarSlots = typeof __propDef.slots;
15
- import { SvelteComponentTyped } from "svelte";
16
9
  declare const __propDef: {
17
10
  props: {
18
11
  value?: (string | undefined);
@@ -2,21 +2,11 @@
2
2
  /** @typedef {typeof __propDef.events} CheckboxGroupEvents */
3
3
  /** @typedef {typeof __propDef.slots} CheckboxGroupSlots */
4
4
  /** The container of `<Checkbox>`es. */
5
- export default class CheckboxGroup extends SvelteComponentTyped<{
6
- [x: string]: any;
7
- class?: string;
8
- orientation?: "vertical" | "horizontal";
9
- ariaLabel?: string;
10
- }, {
11
- [evt: string]: CustomEvent<any>;
12
- }, {
13
- default: {};
14
- }> {
5
+ export default class CheckboxGroup {
15
6
  }
16
7
  export type CheckboxGroupProps = typeof __propDef.props;
17
8
  export type CheckboxGroupEvents = typeof __propDef.events;
18
9
  export type CheckboxGroupSlots = typeof __propDef.slots;
19
- import { SvelteComponentTyped } from "svelte";
20
10
  declare const __propDef: {
21
11
  props: {
22
12
  [x: string]: any;
@@ -8,7 +8,9 @@
8
8
  import { _ } from 'svelte-i18n';
9
9
  import { writable } from 'svelte/store';
10
10
  import Button from '../core/button.svelte';
11
+ import Icon from '../core/icon.svelte';
11
12
  import TextInput from '../core/text-input.svelte';
13
+ import { getRandomId } from '../helpers/util';
12
14
  import Popup from '../util/popup.svelte';
13
15
  import Listbox from './listbox.svelte';
14
16
 
@@ -42,6 +44,7 @@
42
44
  export let value = undefined;
43
45
 
44
46
  const dispatch = createEventDispatcher();
47
+ const id = getRandomId('combobox');
45
48
  let comboboxElement;
46
49
  /** @type {(TextInput| undefined)} */
47
50
  let inputComponent;
@@ -65,10 +68,13 @@
65
68
 
66
69
  <div class="sui combobox {className}">
67
70
  {#if readOnly}
68
- <!-- svelte-ignore a11y-role-has-required-aria-props -->
69
71
  <div
70
72
  class:selected={value !== undefined}
71
73
  role="combobox"
74
+ {id}
75
+ tabindex="0"
76
+ aria-controls="{id}-popup"
77
+ aria-expanded={$isPopupOpen}
72
78
  aria-disabled={disabled ? true : undefined}
73
79
  aria-haspopup="listbox"
74
80
  aria-activedescendant="selected-option"
@@ -80,8 +86,12 @@
80
86
  {:else}
81
87
  <TextInput
82
88
  role="combobox"
89
+ {id}
83
90
  {value}
84
91
  {disabled}
92
+ aria-controls="{id}-popup"
93
+ aria-expanded={$isPopupOpen}
94
+ aria-disabled={disabled ? true : undefined}
85
95
  aria-haspopup="listbox"
86
96
  aria-activedescendant="selected-option"
87
97
  {...$$restProps}
@@ -90,9 +100,10 @@
90
100
  {/if}
91
101
  <Button
92
102
  {disabled}
103
+ aria-controls="{id}-popup"
104
+ aria-expanded={$isPopupOpen}
105
+ aria-disabled={disabled ? true : undefined}
93
106
  class="ternary iconic"
94
- iconName="expand_more"
95
- iconLabel={$isPopupOpen ? $_('sui._.collapse') : $_('sui._.expand')}
96
107
  on:click={(event) => {
97
108
  event.stopPropagation();
98
109
 
@@ -100,9 +111,16 @@
100
111
  $isPopupOpen = !$isPopupOpen;
101
112
  }
102
113
  }}
103
- />
114
+ >
115
+ <Icon
116
+ slot="start-icon"
117
+ name="expand_more"
118
+ label={$isPopupOpen ? $_('sui._.collapse') : $_('sui._.expand')}
119
+ />
120
+ </Button>
104
121
  </div>
105
122
  <Popup
123
+ id="{id}-popup"
106
124
  anchor={comboboxElement || inputComponent?.element}
107
125
  {position}
108
126
  bind:open={isPopupOpen}
@@ -5,34 +5,19 @@
5
5
  * @see https://w3c.github.io/aria/#combobox
6
6
  * @see https://w3c.github.io/aria-practices/#combobox
7
7
  */
8
- export default class Combobox extends SvelteComponentTyped<{
9
- [x: string]: any;
10
- class?: string;
11
- label?: string;
12
- disabled?: boolean;
13
- value?: string;
14
- position?: any;
15
- readOnly?: boolean;
16
- }, {
17
- change: CustomEvent<any>;
18
- } & {
19
- [evt: string]: CustomEvent<any>;
20
- }, {
21
- default: {};
22
- }> {
8
+ export default class Combobox {
23
9
  }
24
10
  export type ComboboxProps = typeof __propDef.props;
25
11
  export type ComboboxEvents = typeof __propDef.events;
26
12
  export type ComboboxSlots = typeof __propDef.slots;
27
- import { SvelteComponentTyped } from "svelte";
28
13
  declare const __propDef: {
29
14
  props: {
30
15
  [x: string]: any;
31
- class?: string;
32
16
  label?: string;
17
+ position?: any;
18
+ class?: string;
33
19
  disabled?: boolean;
34
20
  value?: (string | undefined);
35
- position?: any;
36
21
  readOnly?: boolean;
37
22
  };
38
23
  events: {
@@ -5,24 +5,15 @@
5
5
  * @see https://w3c.github.io/aria-practices/#disclosure
6
6
  * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details
7
7
  */
8
- export default class Disclosure extends SvelteComponentTyped<{
9
- class?: string;
10
- label?: string;
11
- expanded?: boolean;
12
- }, {
13
- [evt: string]: CustomEvent<any>;
14
- }, {
15
- default: {};
16
- }> {
8
+ export default class Disclosure {
17
9
  }
18
10
  export type DisclosureProps = typeof __propDef.props;
19
11
  export type DisclosureEvents = typeof __propDef.events;
20
12
  export type DisclosureSlots = typeof __propDef.slots;
21
- import { SvelteComponentTyped } from "svelte";
22
13
  declare const __propDef: {
23
14
  props: {
24
- class?: string;
25
15
  label?: string;
16
+ class?: string;
26
17
  expanded?: boolean;
27
18
  };
28
19
  events: {
@@ -1,20 +1,11 @@
1
1
  /** @typedef {typeof __propDef.props} GridProps */
2
2
  /** @typedef {typeof __propDef.events} GridEvents */
3
3
  /** @typedef {typeof __propDef.slots} GridSlots */
4
- export default class Grid extends SvelteComponentTyped<{
5
- [x: string]: any;
6
- class?: string;
7
- element?: HTMLElement;
8
- }, {
9
- [evt: string]: CustomEvent<any>;
10
- }, {
11
- default: {};
12
- }> {
4
+ export default class Grid {
13
5
  }
14
6
  export type GridProps = typeof __propDef.props;
15
7
  export type GridEvents = typeof __propDef.events;
16
8
  export type GridSlots = typeof __propDef.slots;
17
- import { SvelteComponentTyped } from "svelte";
18
9
  declare const __propDef: {
19
10
  props: {
20
11
  [x: string]: any;
@@ -5,33 +5,20 @@
5
5
  * @see https://w3c.github.io/aria/#listbox
6
6
  * @see https://w3c.github.io/aria-practices/#Listbox
7
7
  */
8
- export default class Listbox extends SvelteComponentTyped<{
9
- [x: string]: any;
10
- class?: string;
11
- element?: HTMLElement;
12
- multiple?: boolean;
13
- }, {
14
- click: MouseEvent;
15
- select: Event;
16
- } & {
17
- [evt: string]: CustomEvent<any>;
18
- }, {
19
- default: {};
20
- }> {
8
+ export default class Listbox {
21
9
  /**accessor*/
22
- set class(arg: string);
23
- get class(): string;
10
+ set class(arg: any);
11
+ get class(): any;
24
12
  /**accessor*/
25
- set element(arg: HTMLElement);
26
- get element(): HTMLElement;
13
+ set element(arg: any);
14
+ get element(): any;
27
15
  /**accessor*/
28
- set multiple(arg: boolean);
29
- get multiple(): boolean;
16
+ set multiple(arg: any);
17
+ get multiple(): any;
30
18
  }
31
19
  export type ListboxProps = typeof __propDef.props;
32
20
  export type ListboxEvents = typeof __propDef.events;
33
21
  export type ListboxSlots = typeof __propDef.slots;
34
- import { SvelteComponentTyped } from "svelte";
35
22
  declare const __propDef: {
36
23
  props: {
37
24
  [x: string]: any;
@@ -1,26 +1,16 @@
1
1
  /** @typedef {typeof __propDef.props} MenuItemGroupProps */
2
2
  /** @typedef {typeof __propDef.events} MenuItemGroupEvents */
3
3
  /** @typedef {typeof __propDef.slots} MenuItemGroupSlots */
4
- export default class MenuItemGroup extends SvelteComponentTyped<{
5
- [x: string]: any;
6
- class?: string;
7
- title?: string;
8
- ariaLabel?: string;
9
- }, {
10
- [evt: string]: CustomEvent<any>;
11
- }, {
12
- default: {};
13
- }> {
4
+ export default class MenuItemGroup {
14
5
  }
15
6
  export type MenuItemGroupProps = typeof __propDef.props;
16
7
  export type MenuItemGroupEvents = typeof __propDef.events;
17
8
  export type MenuItemGroupSlots = typeof __propDef.slots;
18
- import { SvelteComponentTyped } from "svelte";
19
9
  declare const __propDef: {
20
10
  props: {
21
11
  [x: string]: any;
22
- class?: string;
23
12
  title?: string;
13
+ class?: string;
24
14
  ariaLabel?: string;
25
15
  };
26
16
  events: {
@@ -5,26 +5,17 @@
5
5
  * @see https://w3c.github.io/aria/#menu
6
6
  * @see https://w3c.github.io/aria-practices/#menu
7
7
  */
8
- export default class Menu extends SvelteComponentTyped<{
9
- [x: string]: any;
10
- class?: string;
11
- element?: HTMLElement;
12
- }, {
13
- [evt: string]: CustomEvent<any>;
14
- }, {
15
- default: {};
16
- }> {
8
+ export default class Menu {
17
9
  /**accessor*/
18
- set class(arg: string);
19
- get class(): string;
10
+ set class(arg: any);
11
+ get class(): any;
20
12
  /**accessor*/
21
- set element(arg: HTMLElement);
22
- get element(): HTMLElement;
13
+ set element(arg: any);
14
+ get element(): any;
23
15
  }
24
16
  export type MenuProps = typeof __propDef.props;
25
17
  export type MenuEvents = typeof __propDef.events;
26
18
  export type MenuSlots = typeof __propDef.slots;
27
- import { SvelteComponentTyped } from "svelte";
28
19
  declare const __propDef: {
29
20
  props: {
30
21
  [x: string]: any;
@@ -25,6 +25,7 @@
25
25
  <div
26
26
  class="sui radio-button-group {className} {orientation}"
27
27
  role="radiogroup"
28
+ tabindex="0"
28
29
  bind:this={element}
29
30
  use:activateGroup
30
31
  >
@@ -6,20 +6,11 @@
6
6
  * @see https://w3c.github.io/aria/#radiogroup
7
7
  * @see https://w3c.github.io/aria-practices/#radiobutton
8
8
  */
9
- export default class RadioButtonGroup extends SvelteComponentTyped<{
10
- class?: string;
11
- element?: HTMLElement;
12
- orientation?: "vertical" | "horizontal";
13
- }, {
14
- [evt: string]: CustomEvent<any>;
15
- }, {
16
- default: {};
17
- }> {
9
+ export default class RadioButtonGroup {
18
10
  }
19
11
  export type RadioButtonGroupProps = typeof __propDef.props;
20
12
  export type RadioButtonGroupEvents = typeof __propDef.events;
21
13
  export type RadioButtonGroupSlots = typeof __propDef.slots;
22
- import { SvelteComponentTyped } from "svelte";
23
14
  declare const __propDef: {
24
15
  props: {
25
16
  class?: string;
@@ -34,6 +34,7 @@
34
34
  <div
35
35
  class="sui select-button-group {className}"
36
36
  role="radiogroup"
37
+ tabindex="0"
37
38
  aria-label={ariaLabel || undefined}
38
39
  aria-disabled={disabled ? true : undefined}
39
40
  bind:this={element}
@@ -6,24 +6,11 @@
6
6
  * @see https://w3c.github.io/aria/#radiogroup
7
7
  * @see https://w3c.github.io/aria-practices/#radiobutton
8
8
  */
9
- export default class SelectButtonGroup extends SvelteComponentTyped<{
10
- class?: string;
11
- element?: HTMLElement;
12
- disabled?: boolean;
13
- value?: string;
14
- ariaLabel?: string;
15
- }, {
16
- change: CustomEvent<any>;
17
- } & {
18
- [evt: string]: CustomEvent<any>;
19
- }, {
20
- default: {};
21
- }> {
9
+ export default class SelectButtonGroup {
22
10
  }
23
11
  export type SelectButtonGroupProps = typeof __propDef.props;
24
12
  export type SelectButtonGroupEvents = typeof __propDef.events;
25
13
  export type SelectButtonGroupSlots = typeof __propDef.slots;
26
- import { SvelteComponentTyped } from "svelte";
27
14
  declare const __propDef: {
28
15
  props: {
29
16
  class?: string;
@@ -2,32 +2,20 @@
2
2
  /** @typedef {typeof __propDef.events} SelectEvents */
3
3
  /** @typedef {typeof __propDef.slots} SelectSlots */
4
4
  /** A read-only variant of `<Combobox>`. */
5
- export default class Select extends SvelteComponentTyped<{
6
- [x: string]: any;
7
- class?: string;
8
- label?: string;
9
- value?: string;
10
- }, {
11
- change: CustomEvent<any>;
12
- } & {
13
- [evt: string]: CustomEvent<any>;
14
- }, {
15
- default: {};
16
- }> {
5
+ export default class Select {
17
6
  }
18
7
  export type SelectProps = typeof __propDef.props;
19
8
  export type SelectEvents = typeof __propDef.events;
20
9
  export type SelectSlots = typeof __propDef.slots;
21
- import { SvelteComponentTyped } from "svelte";
22
10
  declare const __propDef: {
23
11
  props: {
24
12
  [x: string]: any;
25
- class?: string;
26
13
  label?: string;
14
+ class?: string;
27
15
  value?: (string | undefined);
28
16
  };
29
17
  events: {
30
- change: CustomEvent<any>;
18
+ change: any;
31
19
  } & {
32
20
  [evt: string]: CustomEvent<any>;
33
21
  };
@@ -5,42 +5,29 @@
5
5
  * @see https://w3c.github.io/aria/#tablist
6
6
  * @see https://w3c.github.io/aria-practices/#tabpanel
7
7
  */
8
- export default class TabList extends SvelteComponentTyped<{
9
- [x: string]: any;
10
- class?: string;
11
- name?: string;
12
- element?: HTMLElement;
13
- orientation?: "vertical" | "horizontal";
14
- }, {
15
- select: Event;
16
- } & {
17
- [evt: string]: CustomEvent<any>;
18
- }, {
19
- default: {};
20
- }> {
8
+ export default class TabList {
21
9
  /**accessor*/
22
- set class(arg: string);
23
- get class(): string;
10
+ set class(arg: any);
11
+ get class(): any;
24
12
  /**accessor*/
25
- set element(arg: HTMLElement);
26
- get element(): HTMLElement;
13
+ set element(arg: any);
14
+ get element(): any;
27
15
  /**accessor*/
28
- set orientation(arg: "vertical" | "horizontal");
29
- get orientation(): "vertical" | "horizontal";
16
+ set orientation(arg: any);
17
+ get orientation(): any;
30
18
  /**accessor*/
31
- set name(arg: string);
32
- get name(): string;
19
+ set name(arg: any);
20
+ get name(): any;
33
21
  }
34
22
  export type TabListProps = typeof __propDef.props;
35
23
  export type TabListEvents = typeof __propDef.events;
36
24
  export type TabListSlots = typeof __propDef.slots;
37
- import { SvelteComponentTyped } from "svelte";
38
25
  declare const __propDef: {
39
26
  props: {
40
27
  [x: string]: any;
41
28
  class?: string;
42
- name?: string;
43
29
  element?: (HTMLElement | undefined);
30
+ name?: string;
44
31
  orientation?: ('horizontal' | 'vertical');
45
32
  };
46
33
  events: {
@@ -6,12 +6,13 @@
6
6
  <svelte:options accessors={true} />
7
7
 
8
8
  <script>
9
- import Icon from './icon.svelte';
9
+ import Popup from '../util/popup.svelte';
10
10
 
11
11
  /**
12
12
  * CSS class name on the button.
13
13
  * @type {String}
14
14
  */
15
+ // eslint-disable-next-line padding-line-between-statements
15
16
  let className = '';
16
17
 
17
18
  export { className as class };
@@ -65,20 +66,13 @@
65
66
  export let label = '';
66
67
 
67
68
  /**
68
- * The name of the Material Symbols icon on the button.
69
+ * Where to show the dropdown menu.
70
+ * @type {PopupPosition}
69
71
  */
70
- export let iconName = '';
72
+ export let popupPosition = 'bottom-left';
71
73
 
72
- /**
73
- * The accessible label on the icon. It can be omitted of a visible `label` is defined.
74
- */
75
- export let iconLabel = '';
76
-
77
- /**
78
- * Where the icon is displayed.
79
- * @type {('start'|'end')}
80
- */
81
- export let iconPosition = 'start';
74
+ /** @type {?Popup} */
75
+ let popupComponent;
82
76
  </script>
83
77
 
84
78
  <button
@@ -103,18 +97,20 @@
103
97
  on:keypress
104
98
  bind:this={element}
105
99
  >
106
- {#if iconName && iconPosition === 'start'}
107
- <Icon name={iconName} label={iconLabel} />
108
- {/if}
100
+ <slot name="start-icon" />
109
101
  {#if label}
110
102
  <span class="label">{label}</span>
111
103
  {/if}
112
104
  <slot />
113
- {#if iconName && iconPosition === 'end'}
114
- <Icon name={iconName} label={iconLabel} />
115
- {/if}
105
+ <slot name="end-icon" />
116
106
  </button>
117
107
 
108
+ {#if $$slots.popup}
109
+ <Popup anchor={element} position={popupPosition} bind:this={popupComponent}>
110
+ <slot name="popup" />
111
+ </Popup>
112
+ {/if}
113
+
118
114
  <style>button {
119
115
  display: inline-flex;
120
116
  align-items: center;
@@ -148,7 +144,7 @@ button[disabled] {
148
144
  button:global(.primary), button:global(.secondary), button:global(.ternary) {
149
145
  justify-content: center;
150
146
  border-radius: var(--button--medium--border-radius);
151
- padding: 0 8px;
147
+ padding: var(--button--medium--padding, 0 8px);
152
148
  height: var(--button--medium--height);
153
149
  }
154
150
  button:global(.primary) :global(.label:only-child), button:global(.secondary) :global(.label:only-child), button:global(.ternary) :global(.label:only-child) {
@@ -177,7 +173,7 @@ button:global(.secondary)[aria-pressed=true] {
177
173
  }
178
174
  button:global(.ternary) {
179
175
  color: var(--primary-foreground-color);
180
- padding: 0 8px;
176
+ padding: var(--button--medium--padding, 0 8px);
181
177
  }
182
178
  button:global(.ternary)[aria-pressed=true] {
183
179
  background-color: var(--highlight-background-color);
@@ -189,7 +185,7 @@ button:global(.large) {
189
185
  height: var(--button--large--height);
190
186
  }
191
187
  button:global(.small) {
192
- padding: 0 4px;
188
+ padding: var(--button--small--padding, 0 8px);
193
189
  height: var(--button--small--height);
194
190
  font-size: 12px;
195
191
  }