@rokkit/ui 1.0.0-next.118 → 1.0.0-next.119

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rokkit/ui",
3
- "version": "1.0.0-next.118",
3
+ "version": "1.0.0-next.119",
4
4
  "description": "Organisms are larger, more complex building blocks that are composed of multiple molecules",
5
5
  "author": "Jerry Thomas <me@jerrythomas.name>",
6
6
  "license": "MIT",
package/src/Shine.svelte CHANGED
@@ -3,7 +3,7 @@
3
3
  // import { clsx } from 'clsx'
4
4
 
5
5
  let {
6
- color = 'var(--primary-500)',
6
+ color = 'rgb(var(--primary-500))',
7
7
  radius = 300,
8
8
  /** Depth of effect */
9
9
  depth = 1,
package/src/Toggle.svelte CHANGED
@@ -1,13 +1,13 @@
1
1
  <script>
2
- // import { FieldMapper, noop } from '@rokkit/core'
3
2
  import { keyboard } from '@rokkit/actions'
4
3
  import Item from './Item.svelte'
5
4
 
6
5
  /**
7
6
  * @typedef {Object} Props
8
- * @property {any} value
9
- * @property {string} [class]
10
- * @property {Array<any>} [options]
7
+ * @property {any} value
8
+ * @property {string} [class]
9
+ * @property {boolean} [disabled] = false
10
+ * @property {Array<any>} [options]
11
11
  * @property {FieldMapper} [mapping]
12
12
  */
13
13
 
@@ -17,6 +17,7 @@
17
17
  value = $bindable(null),
18
18
  options = [false, true],
19
19
  fields,
20
+ disabled = false,
20
21
  label = 'toggle',
21
22
  onchange
22
23
  } = $props()
@@ -27,6 +28,8 @@
27
28
  }
28
29
 
29
30
  function toggle(direction = 1) {
31
+ if (disabled) return
32
+
30
33
  let nextIndex
31
34
  const index = options.indexOf(value)
32
35
 
@@ -41,7 +44,7 @@
41
44
  }
42
45
  </script>
43
46
 
44
- <rk-toggle class={classes}>
47
+ <div data-toggle-root data-disabled={disabled} class={classes}>
45
48
  <button
46
49
  use:keyboard={keyMappings}
47
50
  onnext={() => toggle()}
@@ -51,4 +54,4 @@
51
54
  >
52
55
  <Item {value} {fields} />
53
56
  </button>
54
- </rk-toggle>
57
+ </div>