@tialro2/rnbokit 1.0.0

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.
Files changed (41) hide show
  1. package/README.md +243 -0
  2. package/dist/RNBO.css +113 -0
  3. package/dist/RNBO.svelte +230 -0
  4. package/dist/RNBO.svelte.d.ts +97 -0
  5. package/dist/RNBOcomponents/AudioDropIn.svelte +133 -0
  6. package/dist/RNBOcomponents/AudioDropIn.svelte.d.ts +17 -0
  7. package/dist/RNBOcomponents/ExtMidiIn.svelte +93 -0
  8. package/dist/RNBOcomponents/ExtMidiIn.svelte.d.ts +13 -0
  9. package/dist/RNBOcomponents/ExtMidiOut.svelte +93 -0
  10. package/dist/RNBOcomponents/ExtMidiOut.svelte.d.ts +13 -0
  11. package/dist/RNBOcomponents/MicIn.svelte +88 -0
  12. package/dist/RNBOcomponents/MicIn.svelte.d.ts +17 -0
  13. package/dist/RNBOcomponents/RNBOInlet.svelte +66 -0
  14. package/dist/RNBOcomponents/RNBOInlet.svelte.d.ts +55 -0
  15. package/dist/RNBOcomponents/RNBOInport.svelte +21 -0
  16. package/dist/RNBOcomponents/RNBOInport.svelte.d.ts +13 -0
  17. package/dist/RNBOcomponents/RNBOMidiIn.svelte +63 -0
  18. package/dist/RNBOcomponents/RNBOMidiIn.svelte.d.ts +31 -0
  19. package/dist/RNBOcomponents/RNBOMidiOut.svelte +38 -0
  20. package/dist/RNBOcomponents/RNBOMidiOut.svelte.d.ts +27 -0
  21. package/dist/RNBOcomponents/RNBOOutport.svelte +36 -0
  22. package/dist/RNBOcomponents/RNBOOutport.svelte.d.ts +21 -0
  23. package/dist/RNBOcomponents/RNBOParam.svelte +37 -0
  24. package/dist/RNBOcomponents/RNBOParam.svelte.d.ts +15 -0
  25. package/dist/RNBOcomponents/XYMidiIn.svelte +101 -0
  26. package/dist/RNBOcomponents/XYMidiIn.svelte.d.ts +17 -0
  27. package/dist/UIcomponents/Controls.svelte +12 -0
  28. package/dist/UIcomponents/Controls.svelte.d.ts +7 -0
  29. package/dist/UIcomponents/FileDropZone.svelte +118 -0
  30. package/dist/UIcomponents/FileDropZone.svelte.d.ts +37 -0
  31. package/dist/UIcomponents/ProgressBar.svelte +50 -0
  32. package/dist/UIcomponents/ProgressBar.svelte.d.ts +17 -0
  33. package/dist/UIcomponents/RadioGroup.svelte +35 -0
  34. package/dist/UIcomponents/RadioGroup.svelte.d.ts +13 -0
  35. package/dist/UIcomponents/RadioItem.svelte +96 -0
  36. package/dist/UIcomponents/RadioItem.svelte.d.ts +21 -0
  37. package/dist/UIcomponents/RangeSlider.svelte +38 -0
  38. package/dist/UIcomponents/RangeSlider.svelte.d.ts +21 -0
  39. package/dist/index.d.ts +15 -0
  40. package/dist/index.js +20 -0
  41. package/package.json +72 -0
@@ -0,0 +1,31 @@
1
+ export default RNBOMidiIn;
2
+ type RNBOMidiIn = {
3
+ $on?(type: string, callback: (e: any) => void): () => void;
4
+ $set?(props: Partial<Props & {
5
+ [key: string]: any;
6
+ }>): void;
7
+ };
8
+ declare const RNBOMidiIn: import("svelte").Component<{
9
+ /**
10
+ * - type {number} - the MIDI port index
11
+ */
12
+ port?: number;
13
+ device: import("@rnbo/js").Device;
14
+ midiMessage?: import("@rnbo/js").MIDIData | undefined;
15
+ midiChannel?: number | undefined;
16
+ mode?: "default" | "xy" | "external";
17
+ children?: import("svelte").Snippet<[any]>;
18
+ } & {
19
+ [key: string]: any;
20
+ }, {}, "mode" | "midiMessage">;
21
+ type Props = {
22
+ /**
23
+ * - type {number} - the MIDI port index
24
+ */
25
+ port?: number;
26
+ device: import("@rnbo/js").Device;
27
+ midiMessage?: import("@rnbo/js").MIDIData | undefined;
28
+ midiChannel?: number | undefined;
29
+ mode?: "default" | "xy" | "external";
30
+ children?: import("svelte").Snippet<[any]>;
31
+ };
@@ -0,0 +1,38 @@
1
+ <script>
2
+ import { MIDIEvent, TimeNow } from '@rnbo/js';
3
+ // import ExtMidiOut from './ExtMidiOut.svelte';
4
+
5
+
6
+
7
+ /**
8
+ * @typedef {Object} Props
9
+ * @property {number} [port] - type {number} - the MIDI port index
10
+ * @property {import ('@rnbo/js').Device} device
11
+ * @property {import('@rnbo/js').MIDIData|undefined} [midiMessage]
12
+ * @property {import('svelte').Snippet<[any]>} [children]
13
+ */
14
+
15
+ /** @type {Props & { [key: string]: any }} */
16
+ let {
17
+ port = 0,
18
+ device,
19
+ midiMessage = new MIDIEvent(TimeNow, 0, [144, 100, 100]),
20
+ children,
21
+ ...rest
22
+ } = $props();
23
+ // /** @type {number|undefined} */
24
+ // export let midiChannel = 0;
25
+
26
+ //TODO: replace block below with a midiMessage receive from a Max Midi out, send to extMidiOut
27
+ device.midiEvent.subscribe((ev) => {
28
+ console.log(ev);
29
+ });
30
+ </script>
31
+
32
+ <div class="RNBOcomponent RNBOsection" {...rest}>
33
+ {#if children}{@render children({ port, })}{:else}
34
+ <div class="RNBOtag">in {port}</div>
35
+
36
+ <!-- <ExtMidiOut bind:midiMessage /> -->
37
+ {/if}
38
+ </div>
@@ -0,0 +1,27 @@
1
+ export default RNBOMidiOut;
2
+ type RNBOMidiOut = {
3
+ $on?(type: string, callback: (e: any) => void): () => void;
4
+ $set?(props: Partial<Props & {
5
+ [key: string]: any;
6
+ }>): void;
7
+ };
8
+ declare const RNBOMidiOut: import("svelte").Component<{
9
+ /**
10
+ * - type {number} - the MIDI port index
11
+ */
12
+ port?: number;
13
+ device: import("@rnbo/js").Device;
14
+ midiMessage?: import("@rnbo/js").MIDIData | undefined;
15
+ children?: import("svelte").Snippet<[any]>;
16
+ } & {
17
+ [key: string]: any;
18
+ }, {}, "">;
19
+ type Props = {
20
+ /**
21
+ * - type {number} - the MIDI port index
22
+ */
23
+ port?: number;
24
+ device: import("@rnbo/js").Device;
25
+ midiMessage?: import("@rnbo/js").MIDIData | undefined;
26
+ children?: import("svelte").Snippet<[any]>;
27
+ };
@@ -0,0 +1,36 @@
1
+ <script>
2
+ import ProgressBar from '../UIcomponents/ProgressBar.svelte';
3
+
4
+ /** @type {import ('@rnbo/js').MessagePayload } */
5
+ let value = $state(0);
6
+
7
+ /**
8
+ * @typedef {Object} Props
9
+ * @property {import ('@rnbo/js').MessageInfo} outport
10
+ * @property {import ('@rnbo/js').Device} device
11
+ * @property {number} [min]
12
+ * @property {number} [max]
13
+ */
14
+
15
+ /** @type {Props & { [key: string]: any }} */
16
+ let { outport, device, min = 0, max = 1, ...rest } = $props();
17
+
18
+ $effect(() => {
19
+ device.messageEvent.subscribe((ev) => {
20
+ if (ev.tag == outport.tag) {
21
+ value = ev.payload;
22
+ }
23
+ });
24
+ });
25
+ </script>
26
+
27
+ <div class="RNBOcomponent RNBOsection" {...rest}>
28
+ <div class="RNBOalign">
29
+ <div class="RNBOtag">{outport.tag}</div>
30
+ <!-- some hack to make the value max 2 decimal floats: -->
31
+ <div class="RNBOval">{+parseFloat(value).toFixed(2)}</div>
32
+ </div>
33
+
34
+ <p class="RNBOtext">{outport.meta.slice(1, -1)}</p>
35
+ <ProgressBar value={Array.isArray(value) ? value[0] : value} {max} {min} />
36
+ </div>
@@ -0,0 +1,21 @@
1
+ export default RNBOOutport;
2
+ type RNBOOutport = {
3
+ $on?(type: string, callback: (e: any) => void): () => void;
4
+ $set?(props: Partial<Props & {
5
+ [key: string]: any;
6
+ }>): void;
7
+ };
8
+ declare const RNBOOutport: import("svelte").Component<{
9
+ outport: import("@rnbo/js").MessageInfo;
10
+ device: import("@rnbo/js").Device;
11
+ min?: number;
12
+ max?: number;
13
+ } & {
14
+ [key: string]: any;
15
+ }, {}, "">;
16
+ type Props = {
17
+ outport: import("@rnbo/js").MessageInfo;
18
+ device: import("@rnbo/js").Device;
19
+ min?: number;
20
+ max?: number;
21
+ };
@@ -0,0 +1,37 @@
1
+ <script>
2
+ import RangeSlider from '../UIcomponents/RangeSlider.svelte';
3
+ import RadioGroup from '../UIcomponents/RadioGroup.svelte';
4
+ import RadioItem from '../UIcomponents/RadioItem.svelte';
5
+
6
+ /**
7
+ * @typedef {Object} Props
8
+ * @property {import ('@rnbo/js').Parameter} parameter
9
+ */
10
+
11
+ /** @type {Props & { [key: string]: any }} */
12
+ let { parameter = $bindable(), ...rest } = $props();
13
+ </script>
14
+
15
+ <div class="RNBOcomponent RNBOsection" {...rest}>
16
+ {#if parameter.enumValues}
17
+ <div class="RNBOtag">{parameter.name}</div>
18
+ <RadioGroup>
19
+ {#each parameter.enumValues as enumValue, i}
20
+ <RadioItem bind:group={parameter.value} name="justify" value={i}>{enumValue}</RadioItem>
21
+ {/each}
22
+ </RadioGroup>
23
+ {:else}
24
+ <div class="RNBOalign">
25
+ <div class="RNBOtag">{parameter.name}</div>
26
+ <!-- some hack to make the value max 2 decimal floats: -->
27
+ <div class="RNBOval">{+parseFloat(value).toFixed(2)} / {parameter.max}</div>
28
+ </div>
29
+ <RangeSlider
30
+ name="range-slider"
31
+ bind:value={parameter.value}
32
+ min={parameter.min}
33
+ max={parameter.max}
34
+ step={0.01}
35
+ />
36
+ {/if}
37
+ </div>
@@ -0,0 +1,15 @@
1
+ export default RNBOParam;
2
+ type RNBOParam = {
3
+ $on?(type: string, callback: (e: any) => void): () => void;
4
+ $set?(props: Partial<Props & {
5
+ [key: string]: any;
6
+ }>): void;
7
+ };
8
+ declare const RNBOParam: import("svelte").Component<{
9
+ parameter: import("@rnbo/js").Parameter;
10
+ } & {
11
+ [key: string]: any;
12
+ }, {}, "parameter">;
13
+ type Props = {
14
+ parameter: import("@rnbo/js").Parameter;
15
+ };
@@ -0,0 +1,101 @@
1
+ <script>
2
+
3
+ /** @type {Uint8Array} */
4
+ let currentNote = $state(new Uint8Array([0, 0]));
5
+
6
+ /**
7
+ * @typedef {Object} Props
8
+ * @property {number} [midiChannel]
9
+ * @property {Uint8Array} midiMessage
10
+ */
11
+
12
+ /** @type {Props & { [key: string]: any }} */
13
+ let { midiChannel = 0, midiMessage = $bindable(), ...rest } = $props();
14
+ let isOn = $state(false);
15
+
16
+ /** @param {MouseEvent} e */
17
+ function NoteOn(e) {
18
+ // @ts-ignore - ts not knowing getBoundingClientRect()
19
+ const rect = e.currentTarget.getBoundingClientRect();
20
+ currentNote[0] = Math.round(((e.clientX - rect.left) / rect.width) * 127);
21
+ currentNote[1] = Math.round((1 - (e.clientY - rect.top) / rect.height) * 127);
22
+ midiMessage = new Uint8Array([midiChannel + 144, ...currentNote]);
23
+ isOn = true;
24
+ // console.log('from XYMidiIn', midiMessage);
25
+ }
26
+ function NoteOff() {
27
+ if (!isOn) return;
28
+ // currentNote[1] = 0;
29
+ midiMessage = new Uint8Array([midiChannel + 128, ...currentNote]);
30
+ isOn = false;
31
+ }
32
+ //preview the note and velocity value on hover
33
+ /** @param {MouseEvent} e */
34
+ function NoteUpdate(e) {
35
+ if (isOn) return;
36
+ // @ts-ignore - ts not knowing getBoundingClientRect()
37
+ const rect = e.currentTarget.getBoundingClientRect();
38
+ currentNote[0] = Math.round(((e.clientX - rect.left) / rect.width) * 127);
39
+ currentNote[1] = Math.round((1 - (e.clientY - rect.top) / rect.height) * 127);
40
+ }
41
+ </script>
42
+
43
+ <svelte:window onmouseup={NoteOff} />
44
+ <div class="RNBOsubcomponent" {...rest}>
45
+ <p class="RNBOtext">click the pad to generate MIDI notes</p>
46
+ <!-- TODO: fix accessibility roles, quick hack for now -->
47
+ <div
48
+ class="xy"
49
+ id="group"
50
+ onmousedown={NoteOn}
51
+ onmousemove={NoteUpdate}
52
+ onkeydown={NoteOn}
53
+ role="none"
54
+ >
55
+ <p class="xyval" class:text-gray-500={!isOn}>
56
+ note: {currentNote[0]} | velocity: {currentNote[1]}
57
+ </p>
58
+ </div>
59
+ </div>
60
+
61
+ <style>
62
+ .xy {
63
+ /* @apply group card flex align-center justify-center p-4 m-4 max-w-md min-h-max select-none hover:bg-primary-hover-token active:bg-primary-active-token */
64
+ display: flex;
65
+ justify-content: center;
66
+ align-items: center;
67
+ padding: 5rem;
68
+ margin-top: 1rem;
69
+ max-width: 28rem /* 448px */;
70
+ min-height: max-content;
71
+ user-select: none;
72
+ background-color: rgba(var(--local-accent-color), 0.1);
73
+ border-radius: var(--local-rounded-container);
74
+ transition: var(--local-animation) var(--local-animation-duration);
75
+ transition-timing-function: var(--local-animation-function);
76
+ }
77
+ .xy:hover {
78
+ background-color: rgba(var(--local-accent-color), 0.3);
79
+ transition: var(--local-animation) var(--local-animation-duration);
80
+ transition-timing-function: var(--local-animation-function);
81
+ }
82
+ .xy:active {
83
+ background-color: rgb(var(--local-accent-color)) !important;
84
+ /* color: black; */
85
+ fill: rgb(var(--local-accent-color));
86
+ transition: var(--local-animation) calc(var(--local-animation-duration) / 3);
87
+ transition-timing-function: var(--local-animation-function);
88
+ }
89
+ .xy .xyval {
90
+ /* visibility: hidden; */
91
+ color: rgba(var(--local-font-color), 0);
92
+ }
93
+ .xy:hover .xyval {
94
+ /* color: blue; */
95
+ color: rgba(var(--local-font-color), 0.5);
96
+ }
97
+ .xy:active .xyval {
98
+ /* color: black; */
99
+ color: rgb(var(--local-font-color));
100
+ }
101
+ </style>
@@ -0,0 +1,17 @@
1
+ export default XYMidiIn;
2
+ type XYMidiIn = {
3
+ $on?(type: string, callback: (e: any) => void): () => void;
4
+ $set?(props: Partial<Props & {
5
+ [key: string]: any;
6
+ }>): void;
7
+ };
8
+ declare const XYMidiIn: import("svelte").Component<{
9
+ midiChannel?: number;
10
+ midiMessage: Uint8Array;
11
+ } & {
12
+ [key: string]: any;
13
+ }, {}, "midiMessage">;
14
+ type Props = {
15
+ midiChannel?: number;
16
+ midiMessage: Uint8Array;
17
+ };
@@ -0,0 +1,12 @@
1
+ <script lang="ts">
2
+ interface Props {
3
+ tag: string;
4
+ sendMessage: () => void;
5
+ }
6
+
7
+ let { tag, sendMessage }: Props = $props();
8
+ </script>
9
+
10
+ <button onclick={sendMessage}>
11
+ <img src="/{tag}.png" alt={tag} />
12
+ </button>
@@ -0,0 +1,7 @@
1
+ interface Props {
2
+ tag: string;
3
+ sendMessage: () => void;
4
+ }
5
+ declare const Controls: import("svelte").Component<Props, {}, "">;
6
+ type Controls = ReturnType<typeof Controls>;
7
+ export default Controls;
@@ -0,0 +1,118 @@
1
+ <script>
2
+ let {
3
+ files = $bindable(void 0),
4
+ name,
5
+ lead,
6
+ message,
7
+ meta,
8
+ ondragenter,
9
+ ondragleave,
10
+ onchange,
11
+ ondragover,
12
+ ondrop,
13
+ onclick,
14
+ onkeydown,
15
+ onkeyup,
16
+ onkeypress,
17
+ ...rest
18
+ } = $props();
19
+ let dragOver = $state(false);
20
+ </script>
21
+
22
+ <div class="RNBOdropzone" data-testid="file-dropzone">
23
+ <!-- Input: File (hidden) -->
24
+ <!-- NOTE: keep `bind:files` here, unlike FileButton -->
25
+ <input
26
+ bind:files
27
+ type="file"
28
+ {name}
29
+ {...rest}
30
+ class="RNBOdropzone-input"
31
+ class:RNBOdrag={dragOver}
32
+ ondragenter={() => {
33
+ dragOver = true;
34
+ ondragenter();
35
+ }}
36
+ ondragleave={() => {
37
+ dragOver = false;
38
+ ondragleave();
39
+ }}
40
+ {onchange}
41
+ {ondragover}
42
+ {ondrop}
43
+ {onclick}
44
+ {onkeydown}
45
+ {onkeyup}
46
+ {onkeypress}
47
+ />
48
+ <!-- Interface -->
49
+ <div class="RNBOdropzone-interface">
50
+ <div class="dropzone-interface-text">
51
+ <!-- Lead -->
52
+ {#if lead}<div class="RNBOdropzone-lead">{@render lead?.()}</div>{/if}
53
+ <!-- Message -->
54
+ <div class="RNBOdropzone-message">
55
+ {#if message}{@render message()}{:else}<strong>Upload files</strong> or drag and drop{/if}
56
+ </div>
57
+ <!-- Meta Text -->
58
+ {#if meta}<small class="RNBOdropzone-meta">{@render meta?.()}</small>{/if}
59
+ </div>
60
+ </div>
61
+ </div>
62
+
63
+ <style>
64
+ .RNBOdropzone {
65
+ display: flex;
66
+ position: relative;
67
+ padding: 1rem;
68
+ padding-top: 2rem;
69
+ padding-bottom: 2rem;
70
+ justify-content: center;
71
+ align-items: center;
72
+ border-width: 2px;
73
+ border-style: dashed;
74
+ border-radius: var(--local-rounded-container);
75
+ border-color: rgb(var(--local-surface-color));
76
+ transition: var(--local-animation) var(--local-animation-duration);
77
+ transition-timing-function: var(--local-animation-function);
78
+ }
79
+ .RNBOdrag {
80
+ background-color: rgba(var(--local-accent-color), 0.2);
81
+ transition: var(--local-animation) var(--local-animation-duration);
82
+ transition-timing-function: var(--local-animation-function);
83
+ }
84
+ .RNBOdropzone:hover {
85
+ background-color: rgba(var(--local-accent-color), 0.2);
86
+ transition: var(--local-animation) var(--local-animation-duration);
87
+ transition-timing-function: var(--local-animation-function);
88
+ }
89
+ .RNBOdropzone:active {
90
+ background-color: rgba(var(--local-accent-color), 0.5);
91
+ transition: var(--local-animation) var(--local-animation-duration);
92
+ transition-timing-function: var(--local-animation-function);
93
+ }
94
+ .RNBOdropzone-input {
95
+ position: absolute;
96
+ top: 0;
97
+ right: 0;
98
+ bottom: 0;
99
+ left: 0;
100
+ width: 100%;
101
+ cursor: pointer;
102
+ opacity: 0;
103
+ }
104
+ .RNBOdropzone-interface {
105
+ display: flex;
106
+ text-align: center;
107
+ justify-content: center;
108
+ align-items: center;
109
+ }
110
+ /* .RNBOdropzone-interface-text { */
111
+ /* } */
112
+ .RNBOdropzone-meta {
113
+ opacity: 0.75;
114
+ }
115
+ .RNBOdropzone-lead {
116
+ margin-bottom: 1rem;
117
+ }
118
+ </style>
@@ -0,0 +1,37 @@
1
+ export default FileDropZone;
2
+ type FileDropZone = {
3
+ $on?(type: string, callback: (e: any) => void): () => void;
4
+ $set?(props: Partial<$$ComponentProps>): void;
5
+ };
6
+ declare const FileDropZone: import("svelte").Component<{
7
+ files?: any;
8
+ name: any;
9
+ lead: any;
10
+ message: any;
11
+ meta: any;
12
+ ondragenter: any;
13
+ ondragleave: any;
14
+ onchange: any;
15
+ ondragover: any;
16
+ ondrop: any;
17
+ onclick: any;
18
+ onkeydown: any;
19
+ onkeyup: any;
20
+ onkeypress: any;
21
+ } & Record<string, any>, {}, "files">;
22
+ type $$ComponentProps = {
23
+ files?: any;
24
+ name: any;
25
+ lead: any;
26
+ message: any;
27
+ meta: any;
28
+ ondragenter: any;
29
+ ondragleave: any;
30
+ onchange: any;
31
+ ondragover: any;
32
+ ondrop: any;
33
+ onclick: any;
34
+ onkeydown: any;
35
+ onkeyup: any;
36
+ onkeypress: any;
37
+ } & Record<string, any>;
@@ -0,0 +1,50 @@
1
+ <script>
2
+ /**
3
+ * @typedef {Object} Props
4
+ * @property {any} [value]
5
+ * @property {number} [min]
6
+ * @property {number} [max]
7
+ * @property {string} [labelledby]
8
+ */
9
+
10
+ /** @type {Props} */
11
+ let {
12
+ value = void 0,
13
+ min = 0,
14
+ max = 100,
15
+ labelledby = ''
16
+ } = $props();
17
+ let fillPercent = $derived(value ? (100 * (value - min)) / (max - min) : 0);
18
+ </script>
19
+
20
+ <!-- Track -->
21
+ <div
22
+ class="RNBOprogress-bar"
23
+ data-testid="progress-bar"
24
+ role="progressbar"
25
+ aria-labelledby={labelledby}
26
+ aria-valuenow={value}
27
+ aria-valuemin={min}
28
+ aria-valuemax={max - min}
29
+ >
30
+ <!-- Meter -->
31
+ <div class="RNBOprogress-bar-meter" style:width="{fillPercent}%"></div>
32
+ </div>
33
+
34
+ <style>
35
+ .RNBOprogress-bar {
36
+ overflow: hidden;
37
+ width: 100%;
38
+ height: 6px;
39
+ border-radius: var(--local-rounded-base);
40
+ border-style: solid;
41
+ border-color: rgba(var(--local-surface-color), 0.5);
42
+ border-width: 0.5px;
43
+ background-color: white;
44
+ }
45
+ .RNBOprogress-bar-meter {
46
+ height: 100%;
47
+ border-radius: var(--local-rounded-base);
48
+ background-color: rgb(var(--local-accent-color));
49
+ }
50
+ </style>
@@ -0,0 +1,17 @@
1
+ export default ProgressBar;
2
+ type ProgressBar = {
3
+ $on?(type: string, callback: (e: any) => void): () => void;
4
+ $set?(props: Partial<Props>): void;
5
+ };
6
+ declare const ProgressBar: import("svelte").Component<{
7
+ value?: any;
8
+ min?: number;
9
+ max?: number;
10
+ labelledby?: string;
11
+ }, {}, "">;
12
+ type Props = {
13
+ value?: any;
14
+ min?: number;
15
+ max?: number;
16
+ labelledby?: string;
17
+ };
@@ -0,0 +1,35 @@
1
+ <script>
2
+ /**
3
+ * @typedef {Object} Props
4
+ * @property {string} [labelledby]
5
+ * @property {import('svelte').Snippet} [children]
6
+ */
7
+
8
+ /** @type {Props} */
9
+ let { labelledby = '', children } = $props();
10
+ </script>
11
+
12
+ <div
13
+ class="RNBOradio-group"
14
+ data-testid="radio-group"
15
+ role="radiogroup"
16
+ aria-labelledby={labelledby}
17
+ >
18
+ {@render children?.()}
19
+ </div>
20
+
21
+ <style>
22
+ .RNBOradio-group {
23
+ display: inline-flex;
24
+ flex-wrap: wrap;
25
+ margin-left: 0.25rem;
26
+ background-color: rgba(var(--local-surface-color), 0);
27
+ border-width: var(--local-border-base);
28
+ border-color: rgb(var(--local-surface-color));
29
+ border-style: solid;
30
+ border-radius: var(--local-rounded-base);
31
+ }
32
+ /* .RNBOradio-group:hover { */
33
+ /* background-color: rgba(var(--local-surface-color), 0.2); */
34
+ /* } */
35
+ </style>
@@ -0,0 +1,13 @@
1
+ export default RadioGroup;
2
+ type RadioGroup = {
3
+ $on?(type: string, callback: (e: any) => void): () => void;
4
+ $set?(props: Partial<Props>): void;
5
+ };
6
+ declare const RadioGroup: import("svelte").Component<{
7
+ labelledby?: string;
8
+ children?: import("svelte").Snippet;
9
+ }, {}, "">;
10
+ type Props = {
11
+ labelledby?: string;
12
+ children?: import("svelte").Snippet;
13
+ };