@sveltia/ui 0.26.1 → 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;
@@ -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);
@@ -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.1",
3
+ "version": "0.26.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {