wx-svelte-core 2.5.3 → 2.6.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 (44) hide show
  1. package/package.json +3 -3
  2. package/readme.md +1 -3
  3. package/src/components/Avatar.svelte +2 -2
  4. package/src/components/Button.svelte +2 -0
  5. package/src/components/Calendar.svelte +2 -1
  6. package/src/components/Checkbox.svelte +7 -2
  7. package/src/components/CheckboxGroup.svelte +8 -2
  8. package/src/components/ColorBoard.svelte +7 -2
  9. package/src/components/ColorPicker.svelte +7 -1
  10. package/src/components/ColorSelect.svelte +7 -1
  11. package/src/components/Combo.svelte +9 -1
  12. package/src/components/Counter.svelte +4 -1
  13. package/src/components/DatePicker.svelte +3 -2
  14. package/src/components/DateRangePicker.svelte +3 -2
  15. package/src/components/Field.svelte +2 -1
  16. package/src/components/Icon.svelte +9 -3
  17. package/src/components/Modal.svelte +2 -1
  18. package/src/components/MultiCombo.svelte +6 -1
  19. package/src/components/Pager.svelte +2 -1
  20. package/src/components/Popup.svelte +7 -1
  21. package/src/components/RadioButton.svelte +2 -1
  22. package/src/components/RadioButtonGroup.svelte +2 -1
  23. package/src/components/RangeCalendar.svelte +3 -1
  24. package/src/components/RichSelect.svelte +4 -1
  25. package/src/components/Segmented.svelte +1 -0
  26. package/src/components/Select.svelte +3 -1
  27. package/src/components/SideArea.svelte +2 -2
  28. package/src/components/Slider.svelte +8 -1
  29. package/src/components/Switch.svelte +8 -2
  30. package/src/components/Tabs.svelte +3 -1
  31. package/src/components/Text.svelte +9 -4
  32. package/src/components/TextArea.svelte +4 -1
  33. package/src/components/TimePicker.svelte +3 -2
  34. package/src/components/Tooltip.svelte +382 -0
  35. package/src/components/TwoState.svelte +4 -0
  36. package/src/components/calendar/Month.svelte +2 -1
  37. package/src/components/calendar/Panel.svelte +4 -1
  38. package/src/components/helpers/SuggestDropdown.svelte +6 -1
  39. package/src/index.js +1 -0
  40. package/src/themes/Material.svelte +14 -1
  41. package/src/themes/Willow.svelte +14 -1
  42. package/src/themes/WillowDark.svelte +14 -1
  43. package/types/index.d.ts +70 -6
  44. package/whatsnew.md +17 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wx-svelte-core",
3
- "version": "2.5.3",
3
+ "version": "2.6.0",
4
4
  "description": "SVAR Svelte Core - Svelte UI library of 20+ components and form controls",
5
5
  "productTag": "core",
6
6
  "productTrial": false,
@@ -33,8 +33,8 @@
33
33
  },
34
34
  "homepage": "https://svar.dev/svelte/core/",
35
35
  "dependencies": {
36
- "@svar-ui/core-locales": "2.5.3",
37
- "@svar-ui/lib-dom": "0.12.2",
36
+ "@svar-ui/core-locales": "2.6.0",
37
+ "@svar-ui/lib-dom": "0.13.1",
38
38
  "@svar-ui/lib-svelte": "0.5.2"
39
39
  },
40
40
  "files": [
package/readme.md CHANGED
@@ -20,15 +20,13 @@
20
20
 
21
21
  [SVAR Svelte Core library](https://svar.dev/svelte/core/) offers 30+ lightweight, fast-performing Svelte UI components with TypeScript support. Beautifully designed light and dark themes are included and fully customizable via CSS variables. A straightforward API and comprehensive documentation make it easy to start building feature-rich Svelte interfaces faster.
22
22
 
23
-
24
-
25
23
  <img src="https://svar.dev/images/github/github-core.png" alt="SVAR Core - Svelte UI Components Library" style="width: 752px;">
26
24
 
27
25
  SVAR Svelte Core library includes the following components:
28
26
 
29
27
  - buttons & form controls,
30
28
  - calendar (datepicker),
31
- - popups,
29
+ - popups, tooltips,
32
30
  - notifications,
33
31
  - sliding sidebar,
34
32
  - tabs, and more.
@@ -1,5 +1,5 @@
1
1
  <script>
2
- let { value, size = 32, limit } = $props();
2
+ let { value, size = 32, limit, css = "" } = $props();
3
3
 
4
4
  const DEFAULT_BG = "#dfe2e6";
5
5
  const DEFAULT_FONT = "#2c2f3c";
@@ -81,7 +81,7 @@
81
81
  }
82
82
  </script>
83
83
 
84
- <div class="wx-avatar-root" bind:this={containerEl}>
84
+ <div class="wx-avatar-root {css}" bind:this={containerEl}>
85
85
  {#if displayUsers.length > 0}
86
86
  <div class="wx-avatar-stack">
87
87
  {#each displayUsers as user, index (user.id)}
@@ -5,6 +5,7 @@
5
5
  icon = "",
6
6
  disabled = false,
7
7
  title = "",
8
+ tooltip,
8
9
  text = "",
9
10
  children,
10
11
  onclick,
@@ -32,6 +33,7 @@
32
33
  class:wx-icon={icon && !children}
33
34
  {disabled}
34
35
  onclick={handleClick}
36
+ data-tooltip-text={tooltip}
35
37
  >
36
38
  {#if icon}<i class={icon}></i>{/if}
37
39
  {#if children}{@render children()}{:else}{text}{/if}
@@ -7,6 +7,7 @@
7
7
  current = $bindable(),
8
8
  markers = null,
9
9
  buttons = ["clear", "today"],
10
+ css = "",
10
11
  onchange,
11
12
  } = $props();
12
13
 
@@ -30,5 +31,5 @@
30
31
  </script>
31
32
 
32
33
  <Locale>
33
- <Panel {value} bind:current {markers} {buttons} onchange={change} />
34
+ <Panel {value} bind:current {markers} {buttons} {css} onchange={change} />
34
35
  </Locale>
@@ -6,8 +6,8 @@
6
6
  label = "",
7
7
  inputValue = "",
8
8
  value = $bindable(false),
9
- style = "",
10
9
  disabled = false,
10
+ css = "",
11
11
  onchange,
12
12
  } = $props();
13
13
 
@@ -19,7 +19,7 @@
19
19
  }
20
20
  </script>
21
21
 
22
- <div {style} class="wx-checkbox">
22
+ <div class="wx-checkbox {css}">
23
23
  <input
24
24
  type="checkbox"
25
25
  id={inputId}
@@ -131,4 +131,9 @@
131
131
  input[disabled] ~ label span:first-child:after {
132
132
  border-color: var(--wx-input-background);
133
133
  }
134
+
135
+ .wx-list-checkbox {
136
+ margin-right: 8px;
137
+ pointer-events: none;
138
+ }
134
139
  </style>
@@ -2,7 +2,13 @@
2
2
  import Checkbox from "./Checkbox.svelte";
3
3
  import { setContext } from "svelte";
4
4
 
5
- let { options = [], value = $bindable([]), type = "", onchange } = $props();
5
+ let {
6
+ options = [],
7
+ value = $bindable([]),
8
+ type = "",
9
+ css = "",
10
+ onchange,
11
+ } = $props();
6
12
 
7
13
  setContext("wx-input-id", null);
8
14
 
@@ -13,7 +19,7 @@
13
19
  }
14
20
  </script>
15
21
 
16
- <div class="wx-checkboxgroup {type && `wx-${type}`}">
22
+ <div class="wx-checkboxgroup {type && `wx-${type}`} {css}">
17
23
  {#each options as option}
18
24
  <div class="wx-item">
19
25
  <Checkbox
@@ -8,7 +8,12 @@
8
8
  import { parseColor } from "./helpers/colorValidation.js";
9
9
  import { defaultLocale } from "./helpers/locale";
10
10
 
11
- let { value = $bindable("#65D3B3"), button = false, onchange } = $props();
11
+ let {
12
+ value = $bindable("#65D3B3"),
13
+ button = false,
14
+ css = "",
15
+ onchange,
16
+ } = $props();
12
17
 
13
18
  let block;
14
19
 
@@ -161,7 +166,7 @@
161
166
  }
162
167
  </script>
163
168
 
164
- <div class="wx-colorboard">
169
+ <div class="wx-colorboard {css}">
165
170
  <div
166
171
  class="wx-color-block"
167
172
  style="background: {blockColor};"
@@ -8,9 +8,11 @@
8
8
  id,
9
9
  placeholder = "",
10
10
  title = "",
11
+ tooltip,
11
12
  disabled = false,
12
13
  error = false,
13
14
  clear = false,
15
+ css = "",
14
16
  onchange,
15
17
  dropdown = {},
16
18
  } = $props();
@@ -41,7 +43,11 @@
41
43
 
42
44
  <!-- svelte-ignore a11y_click_events_have_key_events -->
43
45
  <!-- svelte-ignore a11y_no_static_element_interactions -->
44
- <div class="wx-colorpicker" onclick={handlePopup}>
46
+ <div
47
+ class="wx-colorpicker {css}"
48
+ onclick={handlePopup}
49
+ data-tooltip-text={tooltip}
50
+ >
45
51
  <input
46
52
  {title}
47
53
  {value}
@@ -19,8 +19,10 @@
19
19
  clear = false,
20
20
  placeholder = "",
21
21
  title = "",
22
+ tooltip,
22
23
  disabled = false,
23
24
  error = false,
25
+ css = "",
24
26
  onchange,
25
27
  dropdown = {},
26
28
  } = $props();
@@ -47,7 +49,11 @@
47
49
 
48
50
  <!-- svelte-ignore a11y_click_events_have_key_events -->
49
51
  <!-- svelte-ignore a11y_no_static_element_interactions -->
50
- <div class="wx-colorselect" onclick={handlePopup}>
52
+ <div
53
+ class="wx-colorselect {css}"
54
+ onclick={handlePopup}
55
+ data-tooltip-text={tooltip}
56
+ >
51
57
  <input
52
58
  {title}
53
59
  {value}
@@ -11,9 +11,11 @@
11
11
  textField = "label",
12
12
  placeholder = "",
13
13
  title = "",
14
+ tooltip,
14
15
  disabled = false,
15
16
  error = false,
16
17
  clear = false,
18
+ css = "",
17
19
  children: kids,
18
20
  onchange,
19
21
  dropdown = {},
@@ -116,7 +118,13 @@
116
118
  </script>
117
119
 
118
120
  <!-- svelte-ignore a11y_no_static_element_interactions -->
119
- <div class="wx-combo" {onclick} {onkeydown} {title}>
121
+ <div
122
+ class="wx-combo {css}"
123
+ {onclick}
124
+ {onkeydown}
125
+ {title}
126
+ data-tooltip-text={tooltip}
127
+ >
120
128
  <input
121
129
  id={inputId}
122
130
  bind:this={inputElement}
@@ -10,6 +10,8 @@
10
10
  error = false,
11
11
  disabled = false,
12
12
  readonly = false,
13
+ css = "",
14
+ tooltip,
13
15
  onchange,
14
16
  } = $props();
15
17
 
@@ -42,10 +44,11 @@
42
44
  </script>
43
45
 
44
46
  <div
45
- class="wx-counter"
47
+ class="wx-counter {css}"
46
48
  class:wx-disabled={disabled}
47
49
  class:wx-readonly={readonly}
48
50
  class:wx-error={error}
51
+ data-tooltip-text={tooltip}
49
52
  >
50
53
  <button aria-label="-" class="wx-btn wx-btn-dec" {disabled} onclick={dec}>
51
54
  <svg
@@ -18,6 +18,7 @@
18
18
  buttons = ["clear", "today"],
19
19
  css = "",
20
20
  title = "",
21
+ tooltip,
21
22
  editable = false,
22
23
  clear = false,
23
24
  onchange,
@@ -82,8 +83,9 @@
82
83
  <!-- svelte-ignore a11y_no_static_element_interactions -->
83
84
  <div class="wx-datepicker" onclick={() => (popup = true)}>
84
85
  <Text
85
- {css}
86
+ css={`wx-date-input ${css}`}
86
87
  {title}
88
+ {tooltip}
87
89
  value={formattedValue}
88
90
  {id}
89
91
  readonly={!editable}
@@ -93,7 +95,6 @@
93
95
  oninput={oncancel}
94
96
  onchange={change}
95
97
  icon="wxi-calendar"
96
- inputStyle="cursor: pointer; width: 100%; padding-right: calc(var(--wx-input-icon-size) + var(--wx-input-icon-indent) * 2);"
97
98
  {clear}
98
99
  />
99
100
 
@@ -16,6 +16,7 @@
16
16
  placeholder = "",
17
17
  css = "",
18
18
  title = "",
19
+ tooltip,
19
20
  format = "",
20
21
  months = 2,
21
22
  buttons = ["clear", "today"],
@@ -98,8 +99,9 @@
98
99
  onclick={() => (popup = true)}
99
100
  >
100
101
  <Text
101
- {css}
102
+ css={`wx-date-input ${css}`}
102
103
  {title}
104
+ {tooltip}
103
105
  value={formattedValue}
104
106
  {id}
105
107
  readonly={!editable}
@@ -108,7 +110,6 @@
108
110
  {error}
109
111
  onchange={doInputChange}
110
112
  icon="wxi-calendar"
111
- inputStyle="cursor: pointer; width: 100%; padding-right: calc(var(--wx-input-icon-size) + var(--wx-input-icon-indent) * 2);"
112
113
  {clear}
113
114
  />
114
115
 
@@ -9,6 +9,7 @@
9
9
  type = "",
10
10
  required = false,
11
11
  id,
12
+ css = "",
12
13
  children,
13
14
  } = $props();
14
15
 
@@ -17,7 +18,7 @@
17
18
  </script>
18
19
 
19
20
  <div
20
- class="wx-field wx-{position}"
21
+ class="wx-field wx-{position} {css}"
21
22
  class:wx-error={error}
22
23
  class:wx-required={required}
23
24
  style={width ? `width: ${width}` : ""}
@@ -1,19 +1,25 @@
1
1
  <script>
2
- let { css = "", title = "", children, onclick } = $props();
2
+ let { css = "", title = "", tooltip, children, onclick } = $props();
3
3
  </script>
4
4
 
5
5
  {#if children}
6
6
  <!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
7
7
  <!-- svelte-ignore a11y_click_events_have_key_events -->
8
8
  <!-- svelte-ignore a11y_no_static_element_interactions -->
9
- <i {title} role="img" class="wx-icon {css}" {onclick}>
9
+ <i
10
+ {title}
11
+ role="img"
12
+ class="wx-icon {css}"
13
+ {onclick}
14
+ data-tooltip-text={tooltip}
15
+ >
10
16
  {@render children()}
11
17
  </i>
12
18
  {:else}
13
19
  <!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
14
20
  <!-- svelte-ignore a11y_click_events_have_key_events -->
15
21
  <!-- svelte-ignore a11y_no_static_element_interactions -->
16
- <i {title} class="wx-icon {css}" {onclick}></i>
22
+ <i {title} class="wx-icon {css}" {onclick} data-tooltip-text={tooltip}></i>
17
23
  {/if}
18
24
 
19
25
  <style>
@@ -12,6 +12,7 @@
12
12
  header,
13
13
  children,
14
14
  footer,
15
+ css = "",
15
16
  onconfirm,
16
17
  oncancel,
17
18
  } = $props();
@@ -48,7 +49,7 @@
48
49
  <!-- svelte-ignore a11y_no_noninteractive_tabindex -->
49
50
  <!-- svelte-ignore a11y_no_static_element_interactions -->
50
51
  <div
51
- class="wx-modal"
52
+ class="wx-modal {css}"
52
53
  bind:this={modal}
53
54
  transition:fade={{ duration: 100 }}
54
55
  tabindex="0"
@@ -8,11 +8,14 @@
8
8
  options = [],
9
9
  textOptions = null,
10
10
  textField = "label",
11
+ keepText = false,
11
12
  placeholder = "",
12
13
  title = "",
14
+ tooltip,
13
15
  disabled = false,
14
16
  error = false,
15
17
  checkboxes = false,
18
+ css = "",
16
19
  onchange,
17
20
  children,
18
21
  dropdown = {},
@@ -50,6 +53,7 @@
50
53
  const { id } = ev;
51
54
  if (id) {
52
55
  value = id;
56
+ if (!keepText) text = "";
53
57
  onchange && onchange({ value: id });
54
58
  inputElement.focus();
55
59
  }
@@ -78,13 +82,14 @@
78
82
  <!-- svelte-ignore a11y_no_static_element_interactions -->
79
83
  <div
80
84
  {title}
81
- class="wx-multicombo"
85
+ class="wx-multicombo {css}"
82
86
  class:wx-error={error}
83
87
  class:wx-disabled={disabled}
84
88
  class:wx-not-empty={selected.length}
85
89
  class:wx-focus={focus && !disabled}
86
90
  {onclick}
87
91
  onkeydown={ev => keydown(ev, index())}
92
+ data-tooltip-text={tooltip}
88
93
  >
89
94
  <div class="wx-wrapper">
90
95
  <div class="wx-tags">
@@ -6,6 +6,7 @@
6
6
  total = 0,
7
7
  pageSize = $bindable(20),
8
8
  value = $bindable(1),
9
+ css = "",
9
10
  onchange,
10
11
  } = $props();
11
12
 
@@ -54,7 +55,7 @@
54
55
  };
55
56
  </script>
56
57
 
57
- <div class="wx-pager">
58
+ <div class="wx-pager {css}">
58
59
  <div class="wx-left">
59
60
  <span>{_("Rows per page")}: </span>
60
61
  <input
@@ -46,16 +46,22 @@
46
46
  }
47
47
 
48
48
  onMount(() => {
49
+ let resizeObserver;
49
50
  requestAnimationFrame(() => {
50
51
  updatePosition();
51
52
  if (trackScroll) {
52
53
  portal = getAbsParent(self);
53
54
  if (portal) portal.addEventListener("scroll", onScroll, true);
54
55
  }
56
+ if (parent) {
57
+ resizeObserver = new ResizeObserver(updatePosition);
58
+ resizeObserver.observe(parent);
59
+ }
55
60
  });
56
61
  return () => {
57
62
  if (trackScroll && portal)
58
63
  portal.removeEventListener("scroll", onScroll, true);
64
+ if (resizeObserver) resizeObserver.disconnect();
59
65
  };
60
66
  });
61
67
 
@@ -69,7 +75,7 @@
69
75
  </script>
70
76
 
71
77
  <div
72
- use:clickOutside={down}
78
+ use:clickOutside={{ callback: down, parent: () => parent }}
73
79
  bind:this={self}
74
80
  class="wx-popup {css}"
75
81
  style="position:absolute;top:{y}px;left:{x}px;width:{w};"
@@ -8,6 +8,7 @@
8
8
  name = "",
9
9
  inputValue = "",
10
10
  disabled = false,
11
+ css = "",
11
12
  onchange,
12
13
  } = $props();
13
14
 
@@ -19,7 +20,7 @@
19
20
  }
20
21
  </script>
21
22
 
22
- <div class="wx-radio">
23
+ <div class="wx-radio {css}">
23
24
  <input
24
25
  type="radio"
25
26
  id={inputId}
@@ -7,6 +7,7 @@
7
7
  options = [{}],
8
8
  value = $bindable(""),
9
9
  type = "",
10
+ css = "",
10
11
  onchange,
11
12
  } = $props();
12
13
 
@@ -19,7 +20,7 @@
19
20
  }
20
21
  </script>
21
22
 
22
- <div class="wx-radiogroup {type && `wx-${type}`}">
23
+ <div class="wx-radiogroup {type && `wx-${type}`} {css}">
23
24
  {#each options as option}
24
25
  <div class="wx-item">
25
26
  <RadioButton
@@ -10,6 +10,7 @@
10
10
  months = 2,
11
11
  markers = null,
12
12
  buttons = ["clear", "today"],
13
+ css = "",
13
14
  onchange,
14
15
  } = $props();
15
16
 
@@ -90,11 +91,12 @@
90
91
  bind:current={leftCurrent}
91
92
  {markers}
92
93
  {buttons}
94
+ {css}
93
95
  part="both"
94
96
  onchange={doChangeStart}
95
97
  />
96
98
  {:else}
97
- <div class="wx-rangecalendar">
99
+ <div class="wx-rangecalendar {css}">
98
100
  <div class="wx-half">
99
101
  <Panel
100
102
  value={{ start, end }}
@@ -9,8 +9,10 @@
9
9
  disabled = false,
10
10
  error = false,
11
11
  title = "",
12
+ tooltip,
12
13
  textField = "label",
13
14
  clear = false,
15
+ css = "",
14
16
  children: kids,
15
17
  onchange,
16
18
  dropdown = {},
@@ -50,7 +52,7 @@
50
52
  <!-- svelte-ignore a11y_no_noninteractive_tabindex -->
51
53
  <!-- svelte-ignore a11y_no_static_element_interactions -->
52
54
  <div
53
- class="wx-richselect"
55
+ class="wx-richselect {css}"
54
56
  {title}
55
57
  class:wx-error={error}
56
58
  class:wx-disabled={disabled}
@@ -58,6 +60,7 @@
58
60
  onclick={() => navigate?.(index())}
59
61
  onkeydown={ev => keydown?.(ev, index())}
60
62
  tabindex="0"
63
+ data-tooltip-text={tooltip}
61
64
  >
62
65
  <div class="wx-label">
63
66
  {#if selected}
@@ -20,6 +20,7 @@
20
20
  title={option.title}
21
21
  class:wx-selected={option.id == value}
22
22
  onclick={() => handleClick(option.id)}
23
+ data-tooltip-text={option.tooltip}
23
24
  >
24
25
  {#if children}{@render children({ option })}{:else}
25
26
  {#if option.icon}
@@ -6,11 +6,13 @@
6
6
  options = [],
7
7
  placeholder = "",
8
8
  title = "",
9
+ tooltip,
9
10
  disabled = false,
10
11
  error = false,
11
12
  textField = "label",
12
13
  clear = false,
13
14
  id,
15
+ css = "",
14
16
  onchange,
15
17
  } = $props();
16
18
 
@@ -26,7 +28,7 @@
26
28
  }
27
29
  </script>
28
30
 
29
- <div class="wx-select">
31
+ <div class="wx-select {css}" data-tooltip-text={tooltip}>
30
32
  <select
31
33
  id={inputId}
32
34
  bind:value
@@ -2,11 +2,11 @@
2
2
  import { clickOutside } from "@svar-ui/lib-dom";
3
3
  import { fly } from "svelte/transition";
4
4
 
5
- let { position = "right", children, oncancel } = $props();
5
+ let { position = "right", css = "", children, oncancel } = $props();
6
6
  </script>
7
7
 
8
8
  <div
9
- class="wx-sidearea wx-pos-{position}"
9
+ class="wx-sidearea wx-pos-{position} {css}"
10
10
  use:clickOutside={() => oncancel && oncancel()}
11
11
  transition:fly={{ x: 650, opacity: 1 }}
12
12
  >
@@ -10,7 +10,9 @@
10
10
  value = $bindable(0),
11
11
  step = 1,
12
12
  title = "",
13
+ tooltip,
13
14
  disabled = false,
15
+ css = "",
14
16
  onchange,
15
17
  } = $props();
16
18
 
@@ -38,7 +40,12 @@
38
40
  }
39
41
  </script>
40
42
 
41
- <div class="wx-slider" style={width ? `width: ${width}` : ""} {title}>
43
+ <div
44
+ class="wx-slider {css}"
45
+ style={width ? `width: ${width}` : ""}
46
+ {title}
47
+ data-tooltip-text={tooltip}
48
+ >
42
49
  {#if label}<label for={id}>{label}</label>{/if}
43
50
  <div>
44
51
  <input
@@ -1,7 +1,13 @@
1
1
  <script>
2
2
  import { getInputId } from "./helpers/getInputId.js";
3
3
 
4
- let { id, value = $bindable(false), disabled = false, onchange } = $props();
4
+ let {
5
+ id,
6
+ value = $bindable(false),
7
+ disabled = false,
8
+ css = "",
9
+ onchange,
10
+ } = $props();
5
11
 
6
12
  const inputId = $state(getInputId(id));
7
13
 
@@ -11,7 +17,7 @@
11
17
  }
12
18
  </script>
13
19
 
14
- <label class="wx-switch">
20
+ <label class="wx-switch {css}">
15
21
  <input
16
22
  type="checkbox"
17
23
  checked={value}
@@ -3,11 +3,12 @@
3
3
  options = [],
4
4
  value = $bindable(""),
5
5
  type = "top",
6
+ css = "",
6
7
  onchange,
7
8
  } = $props();
8
9
  </script>
9
10
 
10
- <div class="wx-tabs wx-{type}">
11
+ <div class="wx-tabs wx-{type} {css}">
11
12
  {#each options as option}
12
13
  <button
13
14
  class:wx-active={option.id == value}
@@ -16,6 +17,7 @@
16
17
  value = option.id;
17
18
  onchange && onchange({ value });
18
19
  }}
20
+ data-tooltip-text={option.tooltip}
19
21
  >
20
22
  {#if option.icon}
21
23
  <i