@geoffcox/sterling-svelte 0.0.5 → 0.0.6

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.
package/index.d.ts CHANGED
@@ -10,4 +10,5 @@ export { type ButtonVariant, type ButtonShape } from './buttons/types';
10
10
  import Button from './buttons/Button.svelte';
11
11
  import Input from './inputs/Input.svelte';
12
12
  import Checkbox from './inputs/Checkbox.svelte';
13
- export { Button, Checkbox, Input };
13
+ import Radio from './inputs/Radio.svelte';
14
+ export { Button, Checkbox, Input, Radio };
package/index.js CHANGED
@@ -10,4 +10,5 @@ export {} from './buttons/types';
10
10
  import Button from './buttons/Button.svelte';
11
11
  import Input from './inputs/Input.svelte';
12
12
  import Checkbox from './inputs/Checkbox.svelte';
13
- export { Button, Checkbox, Input };
13
+ import Radio from './inputs/Radio.svelte';
14
+ export { Button, Checkbox, Input, Radio };
@@ -38,7 +38,7 @@ export let disabled = false;
38
38
  <div class="indicator" />
39
39
  </div>
40
40
  <div class="label-content" class:disabled>
41
- <slot />
41
+ <slot name="label" />
42
42
  </div>
43
43
  </label>
44
44
 
@@ -30,7 +30,7 @@ declare const __propDef: {
30
30
  [evt: string]: CustomEvent<any>;
31
31
  };
32
32
  slots: {
33
- default: {};
33
+ label: {};
34
34
  };
35
35
  };
36
36
  export type CheckboxProps = typeof __propDef.props;
@@ -1,4 +1,5 @@
1
1
  <script>export let value = "";
2
+ export let disabled = false;
2
3
  </script>
3
4
 
4
5
  <!--
@@ -8,7 +9,7 @@
8
9
  <!-- svelte-ignore a11y-label-has-associated-control -->
9
10
  {#if $$slots.label}
10
11
  <label class="sterling-input-label">
11
- <div class="label-content">
12
+ <div class="label-content" class:disabled>
12
13
  <slot name="label" />
13
14
  </div>
14
15
  <input
@@ -41,6 +42,7 @@
41
42
  on:reset
42
43
  on:wheel
43
44
  {...$$restProps}
45
+ {disabled}
44
46
  />
45
47
  </label>
46
48
  {:else}
@@ -74,6 +76,7 @@
74
76
  on:reset
75
77
  on:wheel
76
78
  {...$$restProps}
79
+ {disabled}
77
80
  />
78
81
  {/if}
79
82
 
@@ -83,12 +86,16 @@
83
86
  flex-direction: column;
84
87
  }
85
88
 
86
- .sterling-input-label > .label-content {
89
+ .label-content {
87
90
  font-size: 0.7em;
88
91
  margin: 0.5em 0 0 0.7em;
89
92
  color: var(--Display__color--subtle);
90
93
  }
91
94
 
95
+ .label-content.disabled {
96
+ color: var(--Display__color--disabled);
97
+ }
98
+
92
99
  .sterling-input-label,
93
100
  .sterling-input {
94
101
  background-color: var(--Input__background-color);
@@ -3,6 +3,7 @@ declare const __propDef: {
3
3
  props: {
4
4
  [x: string]: any;
5
5
  value?: string | undefined;
6
+ disabled?: boolean | undefined;
6
7
  };
7
8
  events: {
8
9
  blur: FocusEvent;
@@ -1,6 +1,7 @@
1
1
  <script>import { onMount } from "svelte";
2
2
  export let checked = false;
3
3
  export let group = void 0;
4
+ export let disabled = false;
4
5
  const onChange = (e) => {
5
6
  if (e.currentTarget.checked) {
6
7
  group = $$restProps.value;
@@ -52,11 +53,12 @@ $: {
52
53
  on:wheel
53
54
  checked={group === $$restProps.value}
54
55
  {...$$restProps}
56
+ {disabled}
55
57
  />
56
58
  <div class="indicator" />
57
59
  </div>
58
- <div class="label-content">
59
- <slot />
60
+ <div class="label-content" class:disabled>
61
+ <slot name="label" />
60
62
  </div>
61
63
  </label>
62
64
 
@@ -153,6 +155,10 @@ $: {
153
155
  }
154
156
 
155
157
  .label-content {
156
- color: var(--Common__color);
158
+ color: var(--Input__color);
159
+ }
160
+
161
+ .label-content.disabled {
162
+ color: var(--Input__color--disabled);
157
163
  }
158
164
  </style>
@@ -4,6 +4,7 @@ declare const __propDef: {
4
4
  [x: string]: any;
5
5
  checked?: boolean | undefined;
6
6
  group?: any | undefined | null;
7
+ disabled?: boolean | undefined;
7
8
  };
8
9
  events: {
9
10
  blur: FocusEvent;
@@ -30,7 +31,7 @@ declare const __propDef: {
30
31
  [evt: string]: CustomEvent<any>;
31
32
  };
32
33
  slots: {
33
- default: {};
34
+ label: {};
34
35
  };
35
36
  };
36
37
  export type RadioProps = typeof __propDef.props;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geoffcox/sterling-svelte",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "devDependencies": {
5
5
  "@fontsource/fira-mono": "^4.5.10",
6
6
  "@fontsource/overpass": "^4.5.10",