@sveltia/ui 0.26.0 → 0.26.2

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.
@@ -36,6 +36,9 @@
36
36
  border-top-style: var(--sui-bottom-navigation-border-style, solid);
37
37
  border-top-color: var(--sui-bottom-navigation-border-color, var(--sui-secondary-border-color));
38
38
  }
39
+ .bottom-navigation:is([inert], [hidden]) {
40
+ display: none;
41
+ }
39
42
  .bottom-navigation :global(.buttons) {
40
43
  flex: auto;
41
44
  display: flex;
@@ -26,6 +26,7 @@
26
26
  </div>
27
27
 
28
28
  <style>.button-group {
29
+ flex: none;
29
30
  display: inline-flex;
30
31
  align-items: center;
31
32
  }</style>
@@ -104,6 +104,7 @@
104
104
  {/if}
105
105
 
106
106
  <style>button {
107
+ flex: none;
107
108
  display: inline-flex;
108
109
  align-items: center;
109
110
  gap: 4px;
@@ -257,6 +258,7 @@ button:global(.pill) {
257
258
  padding: var(--sui-button-medium-pill-padding, 0 12px);
258
259
  }
259
260
  button:global(.flex) {
261
+ flex: auto;
260
262
  width: -moz-available;
261
263
  width: -webkit-fill-available;
262
264
  width: stretch;
@@ -63,6 +63,7 @@
63
63
  </div>
64
64
 
65
65
  <style>.select-button-group {
66
+ flex: none;
66
67
  display: inline-flex;
67
68
  align-items: center;
68
69
  margin: var(--sui-focus-ring-width);
@@ -83,6 +83,7 @@
83
83
  </div>
84
84
 
85
85
  <style>.split-button {
86
+ flex: none;
86
87
  display: inline-flex;
87
88
  margin: var(--sui-focus-ring-width);
88
89
  }
@@ -103,6 +103,11 @@
103
103
  font-size: var(--sui-control-font-size);
104
104
  line-height: var(--sui-control-line-height);
105
105
  }
106
+ @media (pointer: coarse) {
107
+ [role=listbox] {
108
+ gap: 8px 0;
109
+ }
110
+ }
106
111
  [role=listbox] :global([role="separator"]) {
107
112
  margin: 4px 0;
108
113
  background-color: var(--sui-control-border-color);
@@ -55,36 +55,34 @@
55
55
  };
56
56
  </script>
57
57
 
58
- <div role="none" class="wrapper">
59
- <Button
60
- {...restProps}
61
- bind:element={buttonElement}
62
- class="sui menu-button {className}"
63
- {hidden}
64
- {disabled}
65
- {label}
66
- {variant}
67
- {size}
68
- {iconic}
69
- aria-haspopup="menu"
70
- >
71
- {#snippet startIcon()}
72
- {@render _startIcon?.()}
73
- {/snippet}
74
- {#snippet children()}
75
- {@render _children?.()}
76
- {/snippet}
77
- {#snippet endIcon()}
78
- {#if _endIcon}
79
- {@render _endIcon()}
80
- {:else if iconic}
81
- <Icon name="more_vert" />
82
- {:else}
83
- <Icon name="arrow_drop_down" class="small-arrow" />
84
- {/if}
85
- {/snippet}
86
- </Button>
87
- </div>
58
+ <Button
59
+ {...restProps}
60
+ bind:element={buttonElement}
61
+ class="sui menu-button {className}"
62
+ {hidden}
63
+ {disabled}
64
+ {label}
65
+ {variant}
66
+ {size}
67
+ {iconic}
68
+ aria-haspopup="menu"
69
+ >
70
+ {#snippet startIcon()}
71
+ {@render _startIcon?.()}
72
+ {/snippet}
73
+ {#snippet children()}
74
+ {@render _children?.()}
75
+ {/snippet}
76
+ {#snippet endIcon()}
77
+ {#if _endIcon}
78
+ {@render _endIcon()}
79
+ {:else if iconic}
80
+ <Icon name="more_vert" />
81
+ {:else}
82
+ <Icon name="arrow_drop_down" class="small-arrow" />
83
+ {/if}
84
+ {/snippet}
85
+ </Button>
88
86
 
89
87
  <Popup
90
88
  anchor={buttonElement}
@@ -62,6 +62,11 @@
62
62
  border-radius: var(--sui-menu-border-radius, 4px);
63
63
  padding: var(--sui-menu-padding, 4px);
64
64
  }
65
+ @media (pointer: coarse) {
66
+ .menu {
67
+ gap: 8px 0;
68
+ }
69
+ }
65
70
  .menu :global([role="separator"]) {
66
71
  margin: var(--sui-menu-divider-margin, 4px);
67
72
  background-color: var(--sui-menu-divider-color, var(--sui-control-border-color));
@@ -33,6 +33,7 @@
33
33
  invalid = false,
34
34
  editable = true,
35
35
  position = 'bottom-left',
36
+ filterThreshold = 5,
36
37
  children,
37
38
  chevronIcon,
38
39
  onChange,
@@ -197,7 +198,10 @@
197
198
  touchOptimized={true}
198
199
  bind:open={isPopupOpen}
199
200
  onOpen={() => {
200
- showFilter = (popupContent?.querySelectorAll('[role="option"]')?.length ?? 0) > 5;
201
+ showFilter =
202
+ filterThreshold === -1
203
+ ? false
204
+ : (popupContent?.querySelectorAll('[role="option"]')?.length ?? 0) > filterThreshold;
201
205
  searchTerms = '';
202
206
  }}
203
207
  >
@@ -130,7 +130,7 @@
130
130
  min-width: 0;
131
131
  }
132
132
  .search-bar :global(.icon) {
133
- font-size: var(--sui-font-size-xx-large);
133
+ font-size: calc(var(--sui-textbox-height) * 0.6);
134
134
  opacity: 0.5;
135
135
  }
136
136
  .search-bar > span {
@@ -91,7 +91,7 @@
91
91
  [role=toolbar] :global(h2):first-child {
92
92
  padding-inline-start: 12px;
93
93
  }
94
- [role=toolbar] :global(h2) :global(span) {
94
+ [role=toolbar] :global(h2) :global(span:not(.sui.truncated-text)) {
95
95
  font-size: var(--sui-font-size-small);
96
96
  font-weight: var(--sui-font-weight-normal, normal);
97
97
  opacity: 0.8;
@@ -258,9 +258,9 @@
258
258
  @media (pointer: coarse) {
259
259
  :global(:root),
260
260
  :global(:host) {
261
- --sui-control-small-height: 40px;
262
- --sui-control-medium-height: 48px;
263
- --sui-control-large-height: 56px;
261
+ --sui-control-small-height: 32px;
262
+ --sui-control-medium-height: 40px;
263
+ --sui-control-large-height: 48px;
264
264
  --sui-checkbox-height: 24px;
265
265
  --sui-secondary-row-height: 48px;
266
266
  }
@@ -243,9 +243,9 @@
243
243
 
244
244
  // Make controls larger on touch devices, e.g. mobile & tablet
245
245
  @media (pointer: coarse) {
246
- --sui-control-small-height: 40px;
247
- --sui-control-medium-height: 48px;
248
- --sui-control-large-height: 56px;
246
+ --sui-control-small-height: 32px;
247
+ --sui-control-medium-height: 40px;
248
+ --sui-control-large-height: 48px;
249
249
  --sui-checkbox-height: 24px;
250
250
  --sui-secondary-row-height: 48px;
251
251
  }
@@ -370,6 +370,11 @@ export type ComboboxProps = {
370
370
  * Where to show the dropdown menu.
371
371
  */
372
372
  position?: PopupPosition | undefined;
373
+ /**
374
+ * Number of items to start showing the filter. Default: `5`.
375
+ * Use `-1` to always hide the filter.
376
+ */
377
+ filterThreshold?: number | undefined;
373
378
  /**
374
379
  * Primary slot content.
375
380
  */
package/dist/typedefs.js CHANGED
@@ -127,6 +127,8 @@
127
127
  * @property {string} [value] Selected option’s value.
128
128
  * @property {boolean} [editable] Whether to make the `combobox` editable.
129
129
  * @property {PopupPosition} [position] Where to show the dropdown menu.
130
+ * @property {number} [filterThreshold] Number of items to start showing the filter. Default: `5`.
131
+ * Use `-1` to always hide the filter.
130
132
  * @property {Snippet} [children] Primary slot content.
131
133
  * @property {Snippet} [chevronIcon] Chevron icon slot content.
132
134
  * @property {(event: CustomEvent) => void} [onChange] Custom `change` event handler.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltia/ui",
3
- "version": "0.26.0",
3
+ "version": "0.26.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {