@geoffcox/sterling-svelte 0.0.4 → 0.0.5

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.
@@ -4,7 +4,7 @@ export let shape = "rounded";
4
4
 
5
5
  <!--
6
6
  @component
7
- provides a styled HTML button element.
7
+ A styled HTML button element.
8
8
  -->
9
9
  <button
10
10
  class="sterling-button"
@@ -42,7 +42,7 @@ declare const __propDef: {
42
42
  export type ButtonProps = typeof __propDef.props;
43
43
  export type ButtonEvents = typeof __propDef.events;
44
44
  export type ButtonSlots = typeof __propDef.slots;
45
- /** provides a styled HTML button element. */
45
+ /** A styled HTML button element. */
46
46
  export default class Button extends SvelteComponentTyped<ButtonProps, ButtonEvents, ButtonSlots> {
47
47
  }
48
48
  export {};
package/index.d.ts CHANGED
@@ -9,4 +9,5 @@ export { toggleDarkTheme } from './theme/toggleDarkTheme';
9
9
  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
- export { Button, Input };
12
+ import Checkbox from './inputs/Checkbox.svelte';
13
+ export { Button, Checkbox, Input };
package/index.js CHANGED
@@ -9,4 +9,5 @@ export { toggleDarkTheme } from './theme/toggleDarkTheme';
9
9
  export {} from './buttons/types';
10
10
  import Button from './buttons/Button.svelte';
11
11
  import Input from './inputs/Input.svelte';
12
- export { Button, Input };
12
+ import Checkbox from './inputs/Checkbox.svelte';
13
+ export { Button, Checkbox, Input };
@@ -1,6 +1,11 @@
1
1
  <script>export let checked = false;
2
+ export let disabled = false;
2
3
  </script>
3
4
 
5
+ <!--
6
+ @component
7
+ A styled HTML input type=checkbox element.
8
+ -->
4
9
  <!-- svelte-ignore a11y-label-has-associated-control -->
5
10
  <label class="sterling-checkbox">
6
11
  <div class="container">
@@ -28,10 +33,11 @@
28
33
  on:wheel
29
34
  bind:checked
30
35
  {...$$restProps}
36
+ {disabled}
31
37
  />
32
38
  <div class="indicator" />
33
39
  </div>
34
- <div class="label-content">
40
+ <div class="label-content" class:disabled>
35
41
  <slot />
36
42
  </div>
37
43
  </label>
@@ -133,8 +139,13 @@
133
139
  }
134
140
 
135
141
  .label-content {
136
- color: var(--Common__color);
142
+ color: var(--Input__color);
137
143
  user-select: none;
138
144
  margin-top: 0.25em;
145
+ transition: background-color 250ms, color 250ms, border-color 250ms;
146
+ }
147
+
148
+ .label-content.disabled {
149
+ color: var(--Input__color--disabled);
139
150
  }
140
151
  </style>
@@ -3,6 +3,7 @@ declare const __propDef: {
3
3
  props: {
4
4
  [x: string]: any;
5
5
  checked?: boolean | undefined;
6
+ disabled?: boolean | undefined;
6
7
  };
7
8
  events: {
8
9
  blur: FocusEvent;
@@ -35,6 +36,7 @@ declare const __propDef: {
35
36
  export type CheckboxProps = typeof __propDef.props;
36
37
  export type CheckboxEvents = typeof __propDef.events;
37
38
  export type CheckboxSlots = typeof __propDef.slots;
39
+ /** A styled HTML input type=checkbox element. */
38
40
  export default class Checkbox extends SvelteComponentTyped<CheckboxProps, CheckboxEvents, CheckboxSlots> {
39
41
  }
40
42
  export {};
@@ -1,6 +1,10 @@
1
1
  <script>export let value = "";
2
2
  </script>
3
3
 
4
+ <!--
5
+ @component
6
+ A styled HTML input element with optional label.
7
+ -->
4
8
  <!-- svelte-ignore a11y-label-has-associated-control -->
5
9
  {#if $$slots.label}
6
10
  <label class="sterling-input-label">
@@ -41,6 +41,7 @@ declare const __propDef: {
41
41
  export type InputProps = typeof __propDef.props;
42
42
  export type InputEvents = typeof __propDef.events;
43
43
  export type InputSlots = typeof __propDef.slots;
44
+ /** A styled HTML input element with optional label. */
44
45
  export default class Input extends SvelteComponentTyped<InputProps, InputEvents, InputSlots> {
45
46
  }
46
47
  export {};
@@ -20,6 +20,10 @@ $: {
20
20
  }
21
21
  </script>
22
22
 
23
+ <!--
24
+ @component
25
+ A styled HTML input type=radio element with optional label.
26
+ -->
23
27
  <!-- svelte-ignore a11y-label-has-associated-control -->
24
28
  <label class="sterling-radio">
25
29
  <div class="container">
@@ -36,6 +36,7 @@ declare const __propDef: {
36
36
  export type RadioProps = typeof __propDef.props;
37
37
  export type RadioEvents = typeof __propDef.events;
38
38
  export type RadioSlots = typeof __propDef.slots;
39
+ /** A styled HTML input type=radio element with optional label. */
39
40
  export default class Radio extends SvelteComponentTyped<RadioProps, RadioEvents, RadioSlots> {
40
41
  }
41
42
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geoffcox/sterling-svelte",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "devDependencies": {
5
5
  "@fontsource/fira-mono": "^4.5.10",
6
6
  "@fontsource/overpass": "^4.5.10",