@swr-data-lab/components 2.32.2 → 2.33.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.
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">import FormLabel from '../FormLabel/FormLabel.svelte';
2
- let { label, options, size = 'default', value = $bindable(null), onchange } = $props();
2
+ let { label, options, size = 'default', hideLabel = false, value = $bindable(null), onchange } = $props();
3
3
  const groupId = $props.id();
4
4
  const groupName = 'select-' + groupId;
5
5
  function optionToID(o) {
@@ -8,7 +8,9 @@ function optionToID(o) {
8
8
  </script>
9
9
 
10
10
  <fieldset class="container" class:small={size === 'small'}>
11
- <FormLabel as="legend">{label}</FormLabel>
11
+ <div class="legend" class:hidden={hideLabel}>
12
+ <FormLabel as="legend">{label}</FormLabel>
13
+ </div>
12
14
  <ul>
13
15
  {#each options as o (o)}
14
16
  <li class:is-selected={o === value}>
@@ -33,6 +35,11 @@ function optionToID(o) {
33
35
  font-family: var(--swr-sans);
34
36
  }
35
37
 
38
+ .legend.hidden {
39
+ position: absolute;
40
+ left: -9999px;
41
+ }
42
+
36
43
  ul {
37
44
  width: 100%;
38
45
  display: flex;
@@ -61,7 +68,7 @@ li:last-child label {
61
68
 
62
69
  input {
63
70
  position: absolute;
64
- left: -999px;
71
+ left: -9999px;
65
72
  }
66
73
 
67
74
  .small label {
@@ -11,6 +11,7 @@ interface SwitcherProps {
11
11
  * Display size
12
12
  */
13
13
  size?: 'default' | 'small';
14
+ hideLabel?: boolean;
14
15
  /**
15
16
  * The currently-selected option (bindable)
16
17
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@swr-data-lab/components",
3
3
  "description": "SWR Data Lab component library",
4
- "version": "2.32.2",
4
+ "version": "2.33.1",
5
5
  "author": "SWR Data Lab",
6
6
  "license": "UNLICENSED",
7
7
  "type": "module",