@juspay/svelte-ui-components 2.9.0 → 2.11.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.
- package/README.md +337 -77
- package/dist/Accordion/Accordion.svelte +4 -2
- package/dist/Accordion/Accordion.svelte.d.ts +2 -4
- package/dist/Accordion/properties.d.ts +6 -0
- package/dist/Accordion/properties.js +1 -0
- package/dist/Animations/ModalAnimation.svelte +11 -9
- package/dist/Avatar/Avatar.svelte +122 -0
- package/dist/Avatar/Avatar.svelte.d.ts +4 -0
- package/dist/Avatar/properties.d.ts +15 -0
- package/dist/Avatar/properties.js +1 -0
- package/dist/Badge/Badge.svelte +2 -2
- package/dist/Badge/properties.d.ts +1 -0
- package/dist/Banner/Banner.svelte +132 -48
- package/dist/Banner/Banner.svelte.d.ts +1 -1
- package/dist/Banner/properties.d.ts +8 -3
- package/dist/Book/Book.svelte +281 -0
- package/dist/Book/Book.svelte.d.ts +4 -0
- package/dist/Book/properties.d.ts +24 -0
- package/dist/Book/properties.js +1 -0
- package/dist/BrandLoader/BrandLoader.svelte +3 -3
- package/dist/BrandLoader/properties.d.ts +1 -0
- package/dist/Browser/Browser.svelte +193 -0
- package/dist/Browser/Browser.svelte.d.ts +3 -0
- package/dist/Browser/properties.d.ts +16 -0
- package/dist/Browser/properties.js +1 -0
- package/dist/Button/Button.svelte +20 -7
- package/dist/Button/properties.d.ts +7 -4
- package/dist/Calendar/Calendar.svelte +476 -0
- package/dist/Calendar/Calendar.svelte.d.ts +4 -0
- package/dist/Calendar/properties.d.ts +30 -0
- package/dist/Calendar/properties.js +1 -0
- package/dist/Carousel/Carousel.svelte +19 -16
- package/dist/Carousel/properties.d.ts +1 -0
- package/dist/CheckListItem/CheckListItem.svelte +31 -26
- package/dist/CheckListItem/properties.d.ts +4 -1
- package/dist/Checkbox/Checkbox.svelte +157 -0
- package/dist/Checkbox/Checkbox.svelte.d.ts +4 -0
- package/dist/Checkbox/properties.d.ts +17 -0
- package/dist/Checkbox/properties.js +1 -0
- package/dist/Choicebox/Choicebox.svelte +85 -0
- package/dist/Choicebox/Choicebox.svelte.d.ts +4 -0
- package/dist/Choicebox/properties.d.ts +14 -0
- package/dist/Choicebox/properties.js +1 -0
- package/dist/CommandMenu/CommandMenu.svelte +452 -0
- package/dist/CommandMenu/CommandMenu.svelte.d.ts +4 -0
- package/dist/CommandMenu/properties.d.ts +26 -0
- package/dist/CommandMenu/properties.js +1 -0
- package/dist/ContextMenu/ContextMenu.svelte +308 -0
- package/dist/ContextMenu/ContextMenu.svelte.d.ts +4 -0
- package/dist/ContextMenu/properties.d.ts +26 -0
- package/dist/ContextMenu/properties.js +1 -0
- package/dist/Gauge/Gauge.svelte +70 -0
- package/dist/Gauge/Gauge.svelte.d.ts +4 -0
- package/dist/Gauge/properties.d.ts +9 -0
- package/dist/Gauge/properties.js +1 -0
- package/dist/GridItem/GridItem.svelte +5 -4
- package/dist/GridItem/properties.d.ts +1 -0
- package/dist/Icon/Icon.svelte +3 -3
- package/dist/Icon/properties.d.ts +1 -0
- package/dist/IconStack/IconStack.svelte +3 -3
- package/dist/IconStack/properties.d.ts +1 -0
- package/dist/Img/Img.svelte +5 -3
- package/dist/Img/properties.d.ts +5 -1
- package/dist/Input/Input.svelte +12 -6
- package/dist/Input/properties.d.ts +1 -0
- package/dist/InputButton/InputButton.svelte +4 -3
- package/dist/InputButton/properties.d.ts +5 -6
- package/dist/KeyboardInput/KeyboardInput.svelte +93 -0
- package/dist/KeyboardInput/KeyboardInput.svelte.d.ts +4 -0
- package/dist/KeyboardInput/properties.d.ts +12 -0
- package/dist/KeyboardInput/properties.js +1 -0
- package/dist/ListItem/ListItem.svelte +31 -28
- package/dist/ListItem/properties.d.ts +1 -0
- package/dist/Loader/Loader.svelte +10 -6
- package/dist/Loader/Loader.svelte.d.ts +3 -25
- package/dist/Loader/properties.d.ts +3 -0
- package/dist/Loader/properties.js +1 -0
- package/dist/LoadingDots/LoadingDots.svelte +64 -0
- package/dist/LoadingDots/LoadingDots.svelte.d.ts +3 -0
- package/dist/LoadingDots/properties.d.ts +8 -0
- package/dist/LoadingDots/properties.js +1 -0
- package/dist/Menu/Menu.svelte +349 -0
- package/dist/Menu/Menu.svelte.d.ts +4 -0
- package/dist/Menu/properties.d.ts +24 -0
- package/dist/Menu/properties.js +1 -0
- package/dist/Modal/Modal.svelte +10 -9
- package/dist/Modal/properties.d.ts +1 -0
- package/dist/Pagination/Pagination.svelte +152 -0
- package/dist/Pagination/Pagination.svelte.d.ts +4 -0
- package/dist/Pagination/properties.d.ts +14 -0
- package/dist/Pagination/properties.js +1 -0
- package/dist/Phone/Phone.svelte +234 -0
- package/dist/Phone/Phone.svelte.d.ts +3 -0
- package/dist/Phone/properties.d.ts +11 -0
- package/dist/Phone/properties.js +1 -0
- package/dist/Pill/Pill.svelte +130 -0
- package/dist/Pill/Pill.svelte.d.ts +4 -0
- package/dist/Pill/properties.d.ts +16 -0
- package/dist/Pill/properties.js +1 -0
- package/dist/Progress/Progress.svelte +68 -0
- package/dist/Progress/Progress.svelte.d.ts +4 -0
- package/dist/Progress/properties.d.ts +10 -0
- package/dist/Progress/properties.js +1 -0
- package/dist/Radio/Radio.svelte +128 -0
- package/dist/Radio/Radio.svelte.d.ts +4 -0
- package/dist/Radio/properties.d.ts +15 -0
- package/dist/Radio/properties.js +1 -0
- package/dist/RelativeTime/RelativeTime.svelte +117 -0
- package/dist/RelativeTime/RelativeTime.svelte.d.ts +4 -0
- package/dist/RelativeTime/properties.d.ts +13 -0
- package/dist/RelativeTime/properties.js +1 -0
- package/dist/Scroller/Scroller.svelte +389 -0
- package/dist/Scroller/Scroller.svelte.d.ts +4 -0
- package/dist/Scroller/properties.d.ts +30 -0
- package/dist/Scroller/properties.js +1 -0
- package/dist/Select/Select.svelte +382 -344
- package/dist/Select/Select.svelte.d.ts +1 -1
- package/dist/Select/properties.d.ts +16 -26
- package/dist/Sheet/Sheet.svelte +264 -0
- package/dist/Sheet/Sheet.svelte.d.ts +4 -0
- package/dist/Sheet/properties.d.ts +19 -0
- package/dist/Sheet/properties.js +1 -0
- package/dist/Shimmer/Shimmer.svelte +44 -0
- package/dist/Shimmer/Shimmer.svelte.d.ts +4 -0
- package/dist/Shimmer/properties.d.ts +4 -0
- package/dist/Shimmer/properties.js +1 -0
- package/dist/Slider/Slider.svelte +144 -0
- package/dist/Slider/Slider.svelte.d.ts +4 -0
- package/dist/Slider/properties.d.ts +17 -0
- package/dist/Slider/properties.js +1 -0
- package/dist/Snippet/Snippet.svelte +123 -0
- package/dist/Snippet/Snippet.svelte.d.ts +4 -0
- package/dist/Snippet/properties.d.ts +15 -0
- package/dist/Snippet/properties.js +1 -0
- package/dist/SplitButton/SplitButton.svelte +135 -0
- package/dist/SplitButton/SplitButton.svelte.d.ts +4 -0
- package/dist/SplitButton/properties.d.ts +17 -0
- package/dist/SplitButton/properties.js +1 -0
- package/dist/Status/Status.svelte +5 -3
- package/dist/Status/properties.d.ts +1 -0
- package/dist/Stepper/Step.svelte +3 -3
- package/dist/Stepper/Stepper.svelte +3 -3
- package/dist/Stepper/properties.d.ts +2 -0
- package/dist/Table/Table.svelte +15 -8
- package/dist/Table/properties.d.ts +1 -0
- package/dist/Tabs/Tabs.svelte +240 -0
- package/dist/Tabs/Tabs.svelte.d.ts +4 -0
- package/dist/Tabs/properties.d.ts +16 -0
- package/dist/Tabs/properties.js +1 -0
- package/dist/ThemeSwitcher/ThemeSwitcher.svelte +249 -0
- package/dist/ThemeSwitcher/ThemeSwitcher.svelte.d.ts +4 -0
- package/dist/ThemeSwitcher/properties.d.ts +19 -0
- package/dist/ThemeSwitcher/properties.js +1 -0
- package/dist/Toast/Toast.svelte +25 -30
- package/dist/Toast/properties.d.ts +1 -0
- package/dist/Toggle/Toggle.svelte +2 -2
- package/dist/Toggle/properties.d.ts +1 -0
- package/dist/Toolbar/Toolbar.svelte +8 -7
- package/dist/Toolbar/properties.d.ts +1 -0
- package/dist/Tooltip/Tooltip.svelte +153 -0
- package/dist/Tooltip/Tooltip.svelte.d.ts +4 -0
- package/dist/Tooltip/properties.d.ts +13 -0
- package/dist/Tooltip/properties.js +1 -0
- package/dist/assets/battery.svg +5 -0
- package/dist/assets/checkmark.svg +3 -0
- package/dist/assets/chevron-down-sm.svg +3 -0
- package/dist/assets/chevron-down.svg +3 -0
- package/dist/assets/chevron-left-lg.svg +3 -0
- package/dist/assets/chevron-left.svg +3 -0
- package/dist/assets/chevron-right-lg.svg +3 -0
- package/dist/assets/chevron-right.svg +3 -0
- package/dist/assets/chevron-up.svg +3 -0
- package/dist/assets/close.svg +4 -0
- package/dist/assets/copy.svg +4 -0
- package/dist/assets/error-circle.svg +5 -0
- package/dist/assets/lock.svg +3 -0
- package/dist/assets/minus.svg +3 -0
- package/dist/assets/monitor.svg +5 -0
- package/dist/assets/moon.svg +3 -0
- package/dist/assets/palette.svg +7 -0
- package/dist/assets/search.svg +4 -0
- package/dist/assets/signal.svg +6 -0
- package/dist/assets/sun.svg +11 -0
- package/dist/assets/wifi.svg +3 -0
- package/dist/index.d.ts +55 -0
- package/dist/index.js +27 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +18 -4
- package/package.json +26 -1
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
export type CheckListItemProperties =
|
|
2
|
+
export type CheckListItemProperties = MandatoryCheckListItemProperties & OptionalCheckListItemProperties & CheckListItemEventProperties;
|
|
3
3
|
export type MandatoryCheckListItemProperties = {
|
|
4
4
|
text: string;
|
|
5
5
|
};
|
|
6
6
|
export type OptionalCheckListItemProperties = {
|
|
7
7
|
checked?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
8
9
|
checkboxLabel?: Snippet;
|
|
10
|
+
testId?: string;
|
|
11
|
+
classes?: string;
|
|
9
12
|
};
|
|
10
13
|
export type CheckListItemEventProperties = {
|
|
11
14
|
onclick?: (checked: boolean) => void;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { CheckboxProperties } from './properties';
|
|
3
|
+
import checkmarkSvg from '../assets/checkmark.svg?raw';
|
|
4
|
+
import minusSvg from '../assets/minus.svg?raw';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
text,
|
|
8
|
+
checked = $bindable(false),
|
|
9
|
+
disabled = false,
|
|
10
|
+
indeterminate = $bindable(false),
|
|
11
|
+
testId,
|
|
12
|
+
checkedIcon,
|
|
13
|
+
indeterminateIcon,
|
|
14
|
+
onclick,
|
|
15
|
+
classes
|
|
16
|
+
}: CheckboxProperties = $props();
|
|
17
|
+
|
|
18
|
+
function handleClick(): void {
|
|
19
|
+
if (disabled) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
checked = !checked;
|
|
23
|
+
if (indeterminate) {
|
|
24
|
+
indeterminate = false;
|
|
25
|
+
}
|
|
26
|
+
onclick?.(checked);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function handleKeyDown(e: KeyboardEvent): void {
|
|
30
|
+
if (e.key === ' ' || e.key === 'Enter') {
|
|
31
|
+
e.preventDefault();
|
|
32
|
+
handleClick();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
38
|
+
<!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
|
|
39
|
+
<label class="container {classes ?? ''}" class:disabled onclick={handleClick} data-pw={testId}>
|
|
40
|
+
<input
|
|
41
|
+
type="checkbox"
|
|
42
|
+
class="native-checkbox"
|
|
43
|
+
{checked}
|
|
44
|
+
{disabled}
|
|
45
|
+
tabindex={-1}
|
|
46
|
+
aria-hidden="true"
|
|
47
|
+
onclick={(e: MouseEvent) => e.stopPropagation()}
|
|
48
|
+
/>
|
|
49
|
+
<span
|
|
50
|
+
class="box"
|
|
51
|
+
class:checked
|
|
52
|
+
class:indeterminate
|
|
53
|
+
role="checkbox"
|
|
54
|
+
tabindex={disabled ? -1 : 0}
|
|
55
|
+
aria-checked={indeterminate ? 'mixed' : checked}
|
|
56
|
+
aria-disabled={disabled}
|
|
57
|
+
onkeydown={handleKeyDown}
|
|
58
|
+
>
|
|
59
|
+
{#if checked && !indeterminate}
|
|
60
|
+
{#if typeof checkedIcon === 'function'}
|
|
61
|
+
{@render checkedIcon()}
|
|
62
|
+
{:else}
|
|
63
|
+
<!-- eslint-disable svelte/no-at-html-tags -->
|
|
64
|
+
<span class="icon">{@html checkmarkSvg}</span>
|
|
65
|
+
{/if}
|
|
66
|
+
{/if}
|
|
67
|
+
{#if indeterminate}
|
|
68
|
+
{#if typeof indeterminateIcon === 'function'}
|
|
69
|
+
{@render indeterminateIcon()}
|
|
70
|
+
{:else}
|
|
71
|
+
<!-- eslint-disable svelte/no-at-html-tags -->
|
|
72
|
+
<span class="icon dash">{@html minusSvg}</span>
|
|
73
|
+
{/if}
|
|
74
|
+
{/if}
|
|
75
|
+
</span>
|
|
76
|
+
<span class="label" hidden={text.length === 0}>{text}</span>
|
|
77
|
+
</label>
|
|
78
|
+
|
|
79
|
+
<style>
|
|
80
|
+
.container {
|
|
81
|
+
display: var(--checkbox-container-display, inline-flex);
|
|
82
|
+
align-items: var(--checkbox-container-align-items, center);
|
|
83
|
+
gap: var(--checkbox-container-gap, 8px);
|
|
84
|
+
cursor: var(--checkbox-container-cursor, pointer);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.container.disabled {
|
|
88
|
+
opacity: var(--checkbox-disabled-opacity, 0.4);
|
|
89
|
+
cursor: var(--checkbox-disabled-cursor, not-allowed);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.native-checkbox {
|
|
93
|
+
position: absolute;
|
|
94
|
+
opacity: 0;
|
|
95
|
+
width: 0;
|
|
96
|
+
height: 0;
|
|
97
|
+
pointer-events: none;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.box {
|
|
101
|
+
display: inline-flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
justify-content: center;
|
|
104
|
+
width: var(--checkbox-size, 20px);
|
|
105
|
+
height: var(--checkbox-size, 20px);
|
|
106
|
+
border: var(--checkbox-border, 2px solid #757575);
|
|
107
|
+
border-radius: var(--checkbox-border-radius, 3px);
|
|
108
|
+
background-color: var(--checkbox-background, transparent);
|
|
109
|
+
transition:
|
|
110
|
+
background-color var(--checkbox-transition, 0.2s),
|
|
111
|
+
border var(--checkbox-transition, 0.2s);
|
|
112
|
+
flex-shrink: 0;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.box:focus-visible {
|
|
116
|
+
outline: none;
|
|
117
|
+
box-shadow: var(--checkbox-focus-ring, 0 0 0 3px rgba(33, 150, 243, 0.3));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.container:not(.disabled) .box:hover {
|
|
121
|
+
border-color: var(--checkbox-hover-border-color, #212121);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.box.checked {
|
|
125
|
+
background-color: var(--checkbox-checked-background, #2196f3);
|
|
126
|
+
border: var(--checkbox-checked-border, 2px solid #2196f3);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.box.indeterminate {
|
|
130
|
+
background-color: var(--checkbox-indeterminate-background, #2196f3);
|
|
131
|
+
border: var(--checkbox-indeterminate-border, 2px solid #2196f3);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.icon {
|
|
135
|
+
display: inline-flex;
|
|
136
|
+
align-items: center;
|
|
137
|
+
justify-content: center;
|
|
138
|
+
width: var(--checkbox-icon-size, 14px);
|
|
139
|
+
height: var(--checkbox-icon-size, 14px);
|
|
140
|
+
color: var(--checkbox-checkmark-color, white);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.icon :global(svg) {
|
|
144
|
+
width: 100%;
|
|
145
|
+
height: 100%;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.icon.dash {
|
|
149
|
+
color: var(--checkbox-dash-color, white);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.label {
|
|
153
|
+
font-size: var(--checkbox-label-font-size, 14px);
|
|
154
|
+
font-weight: var(--checkbox-label-font-weight, 400);
|
|
155
|
+
color: var(--checkbox-label-color, #212121);
|
|
156
|
+
}
|
|
157
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
export type CheckboxProperties = MandatoryCheckboxProperties & OptionalCheckboxProperties & CheckboxEventProperties;
|
|
3
|
+
export type MandatoryCheckboxProperties = {
|
|
4
|
+
text: string;
|
|
5
|
+
};
|
|
6
|
+
export type OptionalCheckboxProperties = {
|
|
7
|
+
checked?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
indeterminate?: boolean;
|
|
10
|
+
testId?: string;
|
|
11
|
+
checkedIcon?: Snippet;
|
|
12
|
+
indeterminateIcon?: Snippet;
|
|
13
|
+
classes?: string;
|
|
14
|
+
};
|
|
15
|
+
export type CheckboxEventProperties = {
|
|
16
|
+
onclick?: (checked: boolean) => void;
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { ChoiceboxProperties } from './properties';
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
children,
|
|
6
|
+
selected = $bindable(false),
|
|
7
|
+
mode = 'radio',
|
|
8
|
+
disabled = false,
|
|
9
|
+
testId,
|
|
10
|
+
onclick,
|
|
11
|
+
classes
|
|
12
|
+
}: ChoiceboxProperties = $props();
|
|
13
|
+
|
|
14
|
+
function handleClick(): void {
|
|
15
|
+
if (disabled) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (mode === 'radio' && selected) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
selected = !selected;
|
|
22
|
+
onclick?.(selected);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function handleKeyDown(e: KeyboardEvent): void {
|
|
26
|
+
if (e.key === ' ' || e.key === 'Enter') {
|
|
27
|
+
e.preventDefault();
|
|
28
|
+
handleClick();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
|
34
|
+
<div
|
|
35
|
+
class="choicebox {classes ?? ''}"
|
|
36
|
+
class:selected
|
|
37
|
+
class:disabled
|
|
38
|
+
role={mode === 'radio' ? 'radio' : 'checkbox'}
|
|
39
|
+
aria-checked={selected}
|
|
40
|
+
aria-disabled={disabled}
|
|
41
|
+
tabindex={disabled ? -1 : 0}
|
|
42
|
+
onclick={handleClick}
|
|
43
|
+
onkeydown={handleKeyDown}
|
|
44
|
+
data-pw={testId}
|
|
45
|
+
>
|
|
46
|
+
{#if typeof children === 'function'}
|
|
47
|
+
{@render children()}
|
|
48
|
+
{/if}
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<style>
|
|
52
|
+
.choicebox {
|
|
53
|
+
display: var(--choicebox-display, flex);
|
|
54
|
+
align-items: var(--choicebox-align-items, center);
|
|
55
|
+
padding: var(--choicebox-padding, 16px);
|
|
56
|
+
border: var(--choicebox-border, 2px solid #d0d0d0);
|
|
57
|
+
border-radius: var(--choicebox-border-radius, 12px);
|
|
58
|
+
background: var(--choicebox-background, #ffffff);
|
|
59
|
+
gap: var(--choicebox-gap, 12px);
|
|
60
|
+
cursor: var(--choicebox-cursor, pointer);
|
|
61
|
+
font-family: var(--choicebox-font-family, inherit);
|
|
62
|
+
transition: var(--choicebox-transition, border-color 0.2s, background 0.2s);
|
|
63
|
+
-webkit-tap-highlight-color: transparent;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.choicebox:focus-visible {
|
|
67
|
+
outline: none;
|
|
68
|
+
box-shadow: var(--choicebox-focus-ring, 0 0 0 3px rgba(33, 150, 243, 0.3));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.choicebox:not(.disabled):hover {
|
|
72
|
+
border-color: var(--choicebox-hover-border-color, #9e9e9e);
|
|
73
|
+
background: var(--choicebox-hover-background, var(--choicebox-background, #ffffff));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.choicebox.selected {
|
|
77
|
+
border-color: var(--choicebox-selected-border-color, #2196f3);
|
|
78
|
+
background: var(--choicebox-selected-background, var(--choicebox-background, #ffffff));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.choicebox.disabled {
|
|
82
|
+
opacity: var(--choicebox-disabled-opacity, 0.4);
|
|
83
|
+
cursor: var(--choicebox-disabled-cursor, not-allowed);
|
|
84
|
+
}
|
|
85
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
export type ChoiceboxProperties = OptionalChoiceboxProperties & ChoiceboxEventProperties;
|
|
3
|
+
export type ChoiceboxMode = 'radio' | 'checkbox';
|
|
4
|
+
export type OptionalChoiceboxProperties = {
|
|
5
|
+
children?: Snippet;
|
|
6
|
+
selected?: boolean;
|
|
7
|
+
mode?: ChoiceboxMode;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
testId?: string;
|
|
10
|
+
classes?: string;
|
|
11
|
+
};
|
|
12
|
+
export type ChoiceboxEventProperties = {
|
|
13
|
+
onclick?: (selected: boolean) => void;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|