@sveltia/ui 0.2.4 → 0.2.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.
- package/package/components/composite/checkbox-group.svelte +2 -1
- package/package/components/composite/combobox.svelte +2 -2
- package/package/components/composite/combobox.svelte.d.ts +1 -1
- package/package/components/composite/disclosure.svelte +1 -1
- package/package/components/composite/disclosure.svelte.d.ts +1 -1
- package/package/components/composite/listbox.svelte +2 -2
- package/package/components/composite/listbox.svelte.d.ts +1 -1
- package/package/components/composite/menu.svelte +1 -1
- package/package/components/composite/menu.svelte.d.ts +1 -1
- package/package/components/composite/{radio-button-group.svelte → radio-group.svelte} +9 -8
- package/package/components/composite/radio-group.svelte.d.ts +40 -0
- package/package/components/composite/select-button-group.svelte +2 -2
- package/package/components/composite/select-button-group.svelte.d.ts +2 -2
- package/package/components/composite/tab-list.svelte +2 -2
- package/package/components/composite/tab-list.svelte.d.ts +1 -1
- package/package/components/core/button.svelte +3 -3
- package/package/components/core/button.svelte.d.ts +1 -1
- package/package/components/core/checkbox.svelte +33 -14
- package/package/components/core/checkbox.svelte.d.ts +3 -1
- package/package/components/core/dialog.svelte +1 -1
- package/package/components/core/dialog.svelte.d.ts +1 -1
- package/package/components/core/drawer.svelte +1 -1
- package/package/components/core/drawer.svelte.d.ts +1 -1
- package/package/components/core/menu-button.svelte +1 -1
- package/package/components/core/menu-button.svelte.d.ts +1 -1
- package/package/components/core/number-input.svelte +11 -7
- package/package/components/core/password-input.svelte +1 -1
- package/package/components/core/{radio-button.svelte → radio.svelte} +40 -15
- package/package/components/core/radio.svelte.d.ts +41 -0
- package/package/components/core/select-button.svelte +2 -2
- package/package/components/core/select-button.svelte.d.ts +2 -2
- package/package/components/core/slider.svelte +29 -15
- package/package/components/core/switch.svelte +2 -2
- package/package/components/core/switch.svelte.d.ts +1 -1
- package/package/components/core/tab-panel.svelte +1 -1
- package/package/components/core/tab-panel.svelte.d.ts +1 -1
- package/package/components/core/tab.svelte +1 -1
- package/package/components/core/tab.svelte.d.ts +1 -1
- package/package/components/core/text-area.svelte +1 -1
- package/package/components/core/text-input.svelte +3 -3
- package/package/components/core/toolbar.svelte +1 -1
- package/package/components/core/toolbar.svelte.d.ts +1 -1
- package/package/components/helpers/group.js +3 -1
- package/package/components/helpers/popup.js +10 -1
- package/package/components/util/app-shell.svelte +8 -5
- package/package/index.d.ts +2 -2
- package/package/index.js +2 -2
- package/package/styles/variables.scss +8 -5
- package/package.json +29 -29
- package/package/components/composite/radio-button-group.svelte.d.ts +0 -36
- package/package/components/core/radio-button.svelte.d.ts +0 -37
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
3
|
@see https://w3c.github.io/aria/#radio
|
|
4
|
-
@see https://
|
|
4
|
+
@see https://www.w3.org/WAI/ARIA/apg/patterns/radio/
|
|
5
5
|
-->
|
|
6
6
|
<script>
|
|
7
7
|
import { getRandomId } from '../helpers/util';
|
|
@@ -19,12 +19,18 @@
|
|
|
19
19
|
/** @type {string} */
|
|
20
20
|
export let name = '';
|
|
21
21
|
|
|
22
|
+
/** @type {string?} */
|
|
23
|
+
export let label = undefined;
|
|
24
|
+
|
|
22
25
|
/** @type {string?} */
|
|
23
26
|
export let value = undefined;
|
|
24
27
|
|
|
25
28
|
/** @type {boolean} */
|
|
26
29
|
export let selected = false;
|
|
27
30
|
|
|
31
|
+
/** @type {boolean} */
|
|
32
|
+
export let disabled = false;
|
|
33
|
+
|
|
28
34
|
const id = getRandomId('checkbox');
|
|
29
35
|
/** @type {Button} */
|
|
30
36
|
let buttonComponent;
|
|
@@ -36,7 +42,7 @@
|
|
|
36
42
|
|
|
37
43
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
38
44
|
<span
|
|
39
|
-
class="sui radio
|
|
45
|
+
class="sui radio {className}"
|
|
40
46
|
on:click={(event) => {
|
|
41
47
|
if (!(/** @type {HTMLElement} */ (event.target).matches('button'))) {
|
|
42
48
|
buttonComponent.element.click();
|
|
@@ -45,23 +51,32 @@
|
|
|
45
51
|
>
|
|
46
52
|
<Button
|
|
47
53
|
{id}
|
|
54
|
+
{disabled}
|
|
55
|
+
{name}
|
|
56
|
+
{value}
|
|
48
57
|
role="radio"
|
|
49
58
|
aria-checked={selected}
|
|
50
59
|
aria-labelledby="{id}-label"
|
|
51
60
|
bind:this={buttonComponent}
|
|
52
61
|
on:click={(event) => {
|
|
53
62
|
event.preventDefault();
|
|
54
|
-
selected =
|
|
63
|
+
selected = true;
|
|
55
64
|
}}
|
|
56
65
|
>
|
|
57
66
|
<Icon slot="start-icon" name="circle" />
|
|
58
67
|
</Button>
|
|
59
|
-
|
|
60
|
-
<
|
|
61
|
-
|
|
68
|
+
{#if $$slots.default || label}
|
|
69
|
+
<label id="{id}-label">
|
|
70
|
+
{#if $$slots.default}
|
|
71
|
+
<slot />
|
|
72
|
+
{:else}
|
|
73
|
+
{label}
|
|
74
|
+
{/if}
|
|
75
|
+
</label>
|
|
76
|
+
{/if}
|
|
62
77
|
</span>
|
|
63
78
|
|
|
64
|
-
<style>.radio
|
|
79
|
+
<style>.radio {
|
|
65
80
|
display: inline-flex;
|
|
66
81
|
align-items: center;
|
|
67
82
|
gap: 8px;
|
|
@@ -70,24 +85,34 @@
|
|
|
70
85
|
-webkit-user-select: none;
|
|
71
86
|
user-select: none;
|
|
72
87
|
}
|
|
73
|
-
.radio
|
|
88
|
+
.radio.disabled {
|
|
89
|
+
cursor: default;
|
|
90
|
+
}
|
|
91
|
+
.radio.disabled label {
|
|
92
|
+
color: var(--disabled-foreground-color);
|
|
93
|
+
}
|
|
94
|
+
.radio :global(button) {
|
|
74
95
|
justify-content: center;
|
|
75
96
|
overflow: hidden;
|
|
76
97
|
border-width: 2px;
|
|
77
|
-
border-color: var(--control-border-color);
|
|
98
|
+
border-color: var(--primary-control-border-color);
|
|
78
99
|
border-radius: 24px;
|
|
79
|
-
width:
|
|
80
|
-
height:
|
|
100
|
+
width: 20px;
|
|
101
|
+
height: 20px;
|
|
81
102
|
color: var(--primary-accent-color-lighter);
|
|
82
103
|
transition: all 200ms;
|
|
83
104
|
}
|
|
84
|
-
.radio
|
|
85
|
-
font-size:
|
|
105
|
+
.radio :global(button) :global(.icon) {
|
|
106
|
+
font-size: 14px;
|
|
86
107
|
font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 48;
|
|
87
108
|
}
|
|
88
|
-
.radio
|
|
109
|
+
.radio :global(button[aria-checked="true"]) {
|
|
110
|
+
border-color: var(--primary-accent-color-lighter);
|
|
89
111
|
color: var(--primary-accent-color-lighter);
|
|
90
112
|
}
|
|
91
|
-
.radio
|
|
113
|
+
.radio :global(button[aria-checked="false"]) {
|
|
92
114
|
color: transparent;
|
|
115
|
+
}
|
|
116
|
+
.radio label {
|
|
117
|
+
cursor: inherit;
|
|
93
118
|
}</style>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} RadioProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} RadioEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} RadioSlots */
|
|
4
|
+
/**
|
|
5
|
+
* @see https://w3c.github.io/aria/#radio
|
|
6
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/radio/
|
|
7
|
+
*/
|
|
8
|
+
export default class Radio extends SvelteComponentTyped<{
|
|
9
|
+
label?: string;
|
|
10
|
+
class?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
name?: string;
|
|
13
|
+
value?: string;
|
|
14
|
+
selected?: boolean;
|
|
15
|
+
}, {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
}, {
|
|
18
|
+
default: {};
|
|
19
|
+
}> {
|
|
20
|
+
}
|
|
21
|
+
export type RadioProps = typeof __propDef.props;
|
|
22
|
+
export type RadioEvents = typeof __propDef.events;
|
|
23
|
+
export type RadioSlots = typeof __propDef.slots;
|
|
24
|
+
import { SvelteComponentTyped } from "svelte";
|
|
25
|
+
declare const __propDef: {
|
|
26
|
+
props: {
|
|
27
|
+
label?: string | null;
|
|
28
|
+
class?: string;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
name?: string;
|
|
31
|
+
value?: string | null;
|
|
32
|
+
selected?: boolean;
|
|
33
|
+
};
|
|
34
|
+
events: {
|
|
35
|
+
[evt: string]: CustomEvent<any>;
|
|
36
|
+
};
|
|
37
|
+
slots: {
|
|
38
|
+
default: {};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
-
A variant of `<
|
|
3
|
+
A variant of `<Radio>`, looking like a normal button.
|
|
4
4
|
@see https://w3c.github.io/aria/#radio
|
|
5
|
-
@see https://
|
|
5
|
+
@see https://www.w3.org/WAI/ARIA/apg/patterns/radio/
|
|
6
6
|
-->
|
|
7
7
|
<script>
|
|
8
8
|
import Button from './button.svelte';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} SelectButtonEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} SelectButtonSlots */
|
|
4
4
|
/**
|
|
5
|
-
* A variant of `<
|
|
5
|
+
* A variant of `<Radio>`, looking like a normal button.
|
|
6
6
|
* @see https://w3c.github.io/aria/#radio
|
|
7
|
-
* @see https://
|
|
7
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/radio/
|
|
8
8
|
*/
|
|
9
9
|
export default class SelectButton extends SvelteComponentTyped<{
|
|
10
10
|
[x: string]: any;
|
|
@@ -62,14 +62,10 @@
|
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
sliderPositions[targetValueIndex] = positionList[index];
|
|
66
|
-
|
|
67
65
|
if (multiThumb) {
|
|
68
66
|
values[targetValueIndex] = valueList[index];
|
|
69
|
-
dispatch('change', { values });
|
|
70
67
|
} else {
|
|
71
68
|
value = valueList[index];
|
|
72
|
-
dispatch('change', { value });
|
|
73
69
|
}
|
|
74
70
|
}
|
|
75
71
|
};
|
|
@@ -115,14 +111,10 @@
|
|
|
115
111
|
return;
|
|
116
112
|
}
|
|
117
113
|
|
|
118
|
-
sliderPositions[valueIndex] = positionList[index];
|
|
119
|
-
|
|
120
114
|
if (multiThumb) {
|
|
121
115
|
values[valueIndex] = valueList[index];
|
|
122
|
-
dispatch('change', { values });
|
|
123
116
|
} else {
|
|
124
117
|
value = valueList[index];
|
|
125
|
-
dispatch('change', { value });
|
|
126
118
|
}
|
|
127
119
|
}
|
|
128
120
|
};
|
|
@@ -151,6 +143,15 @@
|
|
|
151
143
|
}
|
|
152
144
|
};
|
|
153
145
|
|
|
146
|
+
/**
|
|
147
|
+
*
|
|
148
|
+
*/
|
|
149
|
+
const onMouseUp = () => {
|
|
150
|
+
if (dragging) {
|
|
151
|
+
dragging = false;
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
|
|
154
155
|
/**
|
|
155
156
|
*
|
|
156
157
|
* @param {MouseEvent} event `click` event.
|
|
@@ -165,6 +166,20 @@
|
|
|
165
166
|
}
|
|
166
167
|
};
|
|
167
168
|
|
|
169
|
+
/**
|
|
170
|
+
*
|
|
171
|
+
*/
|
|
172
|
+
const onValueChange = () => {
|
|
173
|
+
if (multiThumb) {
|
|
174
|
+
sliderPositions[0] = positionList[valueList.indexOf(values[0])];
|
|
175
|
+
sliderPositions[1] = positionList[valueList.indexOf(values[1])];
|
|
176
|
+
dispatch('change', { values });
|
|
177
|
+
} else {
|
|
178
|
+
sliderPositions[0] = positionList[valueList.indexOf(value)];
|
|
179
|
+
dispatch('change', { value });
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
|
|
168
183
|
onMount(() => {
|
|
169
184
|
barWidth = base.clientWidth;
|
|
170
185
|
|
|
@@ -174,17 +189,16 @@
|
|
|
174
189
|
valueList = new Array(stepCount).fill(0).map((_, index) => index * step + min, 10);
|
|
175
190
|
positionList = new Array(stepCount).fill(0).map((_, index) => index * stepWidth);
|
|
176
191
|
|
|
177
|
-
|
|
178
|
-
sliderPositions[0] = positionList[valueList.indexOf(values[0])];
|
|
179
|
-
sliderPositions[1] = positionList[valueList.indexOf(values[1])];
|
|
180
|
-
} else {
|
|
181
|
-
sliderPositions[0] = positionList[valueList.indexOf(value)];
|
|
182
|
-
}
|
|
192
|
+
onValueChange();
|
|
183
193
|
});
|
|
194
|
+
|
|
195
|
+
// @ts-ignore Arguments are triggers
|
|
196
|
+
$: onValueChange(value, values);
|
|
184
197
|
</script>
|
|
185
198
|
|
|
186
199
|
<svelte:body
|
|
187
200
|
on:mousemove={onMouseMove}
|
|
201
|
+
on:mouseup={onMouseUp}
|
|
188
202
|
on:click={() => {
|
|
189
203
|
dragging = false;
|
|
190
204
|
}}
|
|
@@ -262,7 +276,7 @@
|
|
|
262
276
|
width: var(--slider-base-width, 200px);
|
|
263
277
|
height: 8px;
|
|
264
278
|
border-radius: 8px;
|
|
265
|
-
background-color: var(--control-border-color);
|
|
279
|
+
background-color: var(--secondary-control-border-color);
|
|
266
280
|
}
|
|
267
281
|
|
|
268
282
|
.bar {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
3
|
@see https://w3c.github.io/aria/#switch
|
|
4
|
-
@see https://
|
|
4
|
+
@see https://www.w3.org/WAI/ARIA/apg/patterns/switch/
|
|
5
5
|
-->
|
|
6
6
|
<script>
|
|
7
7
|
/**
|
|
@@ -69,7 +69,7 @@ span {
|
|
|
69
69
|
padding: 2px;
|
|
70
70
|
display: inline-block;
|
|
71
71
|
border-radius: 16px;
|
|
72
|
-
background-color: var(--control-border-color);
|
|
72
|
+
background-color: var(--secondary-control-border-color);
|
|
73
73
|
transition: all 200ms;
|
|
74
74
|
}
|
|
75
75
|
span:hover {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/** @typedef {typeof __propDef.slots} SwitchSlots */
|
|
4
4
|
/**
|
|
5
5
|
* @see https://w3c.github.io/aria/#switch
|
|
6
|
-
* @see https://
|
|
6
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/switch/
|
|
7
7
|
*/
|
|
8
8
|
export default class Switch extends SvelteComponentTyped<{
|
|
9
9
|
label?: string;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/** @typedef {typeof __propDef.slots} TabPanelSlots */
|
|
4
4
|
/**
|
|
5
5
|
* @see https://w3c.github.io/aria/#tabpanel
|
|
6
|
-
* @see https://
|
|
6
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/tabs/
|
|
7
7
|
*/
|
|
8
8
|
export default class TabPanel extends SvelteComponentTyped<{
|
|
9
9
|
[x: string]: any;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/** @typedef {typeof __propDef.slots} TabSlots */
|
|
4
4
|
/**
|
|
5
5
|
* @see https://w3c.github.io/aria/#tab
|
|
6
|
-
* @see https://
|
|
6
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/tabs/
|
|
7
7
|
*/
|
|
8
8
|
export default class Tab extends SvelteComponentTyped<{
|
|
9
9
|
[x: string]: any;
|
|
@@ -101,7 +101,7 @@ textarea {
|
|
|
101
101
|
display: block;
|
|
102
102
|
margin: 0;
|
|
103
103
|
border-width: 1px;
|
|
104
|
-
border-color: var(--control-border-color);
|
|
104
|
+
border-color: var(--secondary-control-border-color);
|
|
105
105
|
border-radius: var(--input--medium--border-radius);
|
|
106
106
|
background-color: var(--control-background-color);
|
|
107
107
|
padding: 8px;
|
|
@@ -84,7 +84,7 @@ input {
|
|
|
84
84
|
display: inline-block;
|
|
85
85
|
flex: auto;
|
|
86
86
|
border-width: 1px;
|
|
87
|
-
border-color: var(--control-border-color);
|
|
87
|
+
border-color: var(--secondary-control-border-color);
|
|
88
88
|
border-radius: var(--input--medium--border-radius);
|
|
89
89
|
padding: 0 8px;
|
|
90
90
|
min-width: 0;
|
|
@@ -101,7 +101,7 @@ input:focus {
|
|
|
101
101
|
}
|
|
102
102
|
input:read-only {
|
|
103
103
|
color: var(--tertiary-foreground-color);
|
|
104
|
-
border-color: var(--control-border-color) !important;
|
|
104
|
+
border-color: var(--secondary-control-border-color) !important;
|
|
105
105
|
}
|
|
106
106
|
input:disabled {
|
|
107
107
|
background-color: var(--disabled-background-color);
|
|
@@ -115,7 +115,7 @@ input ~ :global(button) {
|
|
|
115
115
|
flex: none;
|
|
116
116
|
margin-left: -1px;
|
|
117
117
|
border-width: 1px;
|
|
118
|
-
border-color: var(--control-border-color);
|
|
118
|
+
border-color: var(--secondary-control-border-color);
|
|
119
119
|
height: var(--input--medium--height);
|
|
120
120
|
aspect-ratio: 1/1;
|
|
121
121
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/** @typedef {typeof __propDef.slots} ToolbarSlots */
|
|
4
4
|
/**
|
|
5
5
|
* @see https://w3c.github.io/aria/#toolbar
|
|
6
|
-
* @see https://
|
|
6
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/toolbar/
|
|
7
7
|
*/
|
|
8
8
|
export default class Toolbar extends SvelteComponentTyped<{
|
|
9
9
|
[x: string]: any;
|
|
@@ -76,7 +76,9 @@ class Group {
|
|
|
76
76
|
});
|
|
77
77
|
|
|
78
78
|
parent.addEventListener('click', (event) => {
|
|
79
|
-
|
|
79
|
+
if (/** @type {HTMLElement} */ (event.target).matches(this.selector)) {
|
|
80
|
+
this.onClick(event);
|
|
81
|
+
}
|
|
80
82
|
});
|
|
81
83
|
|
|
82
84
|
parent.addEventListener('keydown', (event) => {
|
|
@@ -107,8 +107,17 @@ class Popup {
|
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
109
|
|
|
110
|
+
// Close the popup when the backdrop, a menu item or an option is clicked
|
|
110
111
|
this.popupElement.addEventListener('click', (event) => {
|
|
111
|
-
|
|
112
|
+
event.stopPropagation();
|
|
113
|
+
|
|
114
|
+
// eslint-disable-next-line prefer-destructuring
|
|
115
|
+
const target = /** @type {HTMLElement} */ (event.target);
|
|
116
|
+
|
|
117
|
+
if (
|
|
118
|
+
get(this.open) &&
|
|
119
|
+
(target === this.popupElement || target.matches('[role^="menuitem"], [role="option"]'))
|
|
120
|
+
) {
|
|
112
121
|
this.open.set(false);
|
|
113
122
|
}
|
|
114
123
|
});
|
|
@@ -52,8 +52,9 @@
|
|
|
52
52
|
--foreground-color-2-hsl: var(--base-hue) 5% 20%;
|
|
53
53
|
--foreground-color-3-hsl: var(--base-hue) 5% 40%;
|
|
54
54
|
--foreground-color-4-hsl: var(--base-hue) 5% 60%;
|
|
55
|
-
--border-color-1-hsl: var(--base-hue) 5%
|
|
56
|
-
--border-color-2-hsl: var(--base-hue) 5%
|
|
55
|
+
--border-color-1-hsl: var(--base-hue) 5% 30%;
|
|
56
|
+
--border-color-2-hsl: var(--base-hue) 5% 50%;
|
|
57
|
+
--border-color-3-hsl: var(--base-hue) 5% 70%;
|
|
57
58
|
--background-color-1-hsl: var(--base-hue) 5% 100%;
|
|
58
59
|
--background-color-2-hsl: var(--base-hue) 5% 98%;
|
|
59
60
|
--background-color-3-hsl: var(--base-hue) 5% 94%;
|
|
@@ -81,8 +82,9 @@
|
|
|
81
82
|
--foreground-color-2-hsl: var(--base-hue) 10% 80%;
|
|
82
83
|
--foreground-color-3-hsl: var(--base-hue) 10% 60%;
|
|
83
84
|
--foreground-color-4-hsl: var(--base-hue) 10% 40%;
|
|
84
|
-
--border-color-1-hsl: var(--base-hue) 10%
|
|
85
|
-
--border-color-2-hsl: var(--base-hue) 10%
|
|
85
|
+
--border-color-1-hsl: var(--base-hue) 10% 70%;
|
|
86
|
+
--border-color-2-hsl: var(--base-hue) 10% 50%;
|
|
87
|
+
--border-color-3-hsl: var(--base-hue) 10% 30%;
|
|
86
88
|
--background-color-1-hsl: var(--base-hue) 10% 10%;
|
|
87
89
|
--background-color-2-hsl: var(--base-hue) 10% 12%;
|
|
88
90
|
--background-color-3-hsl: var(--base-hue) 10% 16%;
|
|
@@ -156,7 +158,8 @@
|
|
|
156
158
|
);
|
|
157
159
|
--primary-border-color: hsl(var(--border-color-1-hsl));
|
|
158
160
|
--secondary-border-color: hsl(var(--border-color-2-hsl));
|
|
159
|
-
--control-border-color: hsl(var(--border-color-2-hsl));
|
|
161
|
+
--primary-control-border-color: hsl(var(--border-color-2-hsl));
|
|
162
|
+
--secondary-control-border-color: hsl(var(--border-color-3-hsl));
|
|
160
163
|
--danger-border-color: hsl(
|
|
161
164
|
var(--danger-color-hue) var(--alert-border-color-saturation) var(--alert-border-color-lightness)
|
|
162
165
|
);
|
package/package/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export { default as Grid } from "./components/composite/grid.svelte";
|
|
|
10
10
|
export { default as Listbox } from "./components/composite/listbox.svelte";
|
|
11
11
|
export { default as MenuItemGroup } from "./components/composite/menu-item-group.svelte";
|
|
12
12
|
export { default as Menu } from "./components/composite/menu.svelte";
|
|
13
|
-
export { default as
|
|
13
|
+
export { default as RadioGroup } from "./components/composite/radio-group.svelte";
|
|
14
14
|
export { default as SelectButtonGroup } from "./components/composite/select-button-group.svelte";
|
|
15
15
|
export { default as Select } from "./components/composite/select.svelte";
|
|
16
16
|
export { default as TabList } from "./components/composite/tab-list.svelte";
|
|
@@ -28,7 +28,7 @@ export { default as MenuItem } from "./components/core/menu-item.svelte";
|
|
|
28
28
|
export { default as NumberInput } from "./components/core/number-input.svelte";
|
|
29
29
|
export { default as Option } from "./components/core/option.svelte";
|
|
30
30
|
export { default as PasswordInput } from "./components/core/password-input.svelte";
|
|
31
|
-
export { default as
|
|
31
|
+
export { default as Radio } from "./components/core/radio.svelte";
|
|
32
32
|
export { default as RowGroup } from "./components/core/row-group.svelte";
|
|
33
33
|
export { default as Row } from "./components/core/row.svelte";
|
|
34
34
|
export { default as SearchBar } from "./components/core/search-bar.svelte";
|
package/package/index.js
CHANGED
|
@@ -44,7 +44,7 @@ export { default as MenuItemGroup } from './components/composite/menu-item-group
|
|
|
44
44
|
// @ts-ignore
|
|
45
45
|
export { default as Menu } from './components/composite/menu.svelte';
|
|
46
46
|
// @ts-ignore
|
|
47
|
-
export { default as
|
|
47
|
+
export { default as RadioGroup } from './components/composite/radio-group.svelte';
|
|
48
48
|
// @ts-ignore
|
|
49
49
|
export { default as SelectButtonGroup } from './components/composite/select-button-group.svelte';
|
|
50
50
|
// @ts-ignore
|
|
@@ -80,7 +80,7 @@ export { default as Option } from './components/core/option.svelte';
|
|
|
80
80
|
// @ts-ignore
|
|
81
81
|
export { default as PasswordInput } from './components/core/password-input.svelte';
|
|
82
82
|
// @ts-ignore
|
|
83
|
-
export { default as
|
|
83
|
+
export { default as Radio } from './components/core/radio.svelte';
|
|
84
84
|
// @ts-ignore
|
|
85
85
|
export { default as RowGroup } from './components/core/row-group.svelte';
|
|
86
86
|
// @ts-ignore
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
--foreground-color-2-hsl: var(--base-hue) 5% 20%; // primary
|
|
4
4
|
--foreground-color-3-hsl: var(--base-hue) 5% 40%; // secondary
|
|
5
5
|
--foreground-color-4-hsl: var(--base-hue) 5% 60%; // tertiary
|
|
6
|
-
--border-color-1-hsl: var(--base-hue) 5%
|
|
7
|
-
--border-color-2-hsl: var(--base-hue) 5%
|
|
6
|
+
--border-color-1-hsl: var(--base-hue) 5% 30%; // primary
|
|
7
|
+
--border-color-2-hsl: var(--base-hue) 5% 50%; // secondary/input
|
|
8
|
+
--border-color-3-hsl: var(--base-hue) 5% 70%; // tertiary
|
|
8
9
|
--background-color-1-hsl: var(--base-hue) 5% 100%; // content/input
|
|
9
10
|
--background-color-2-hsl: var(--base-hue) 5% 98%; // primary
|
|
10
11
|
--background-color-3-hsl: var(--base-hue) 5% 94%; // secondary
|
|
@@ -34,8 +35,9 @@
|
|
|
34
35
|
--foreground-color-2-hsl: var(--base-hue) 10% 80%; // primary
|
|
35
36
|
--foreground-color-3-hsl: var(--base-hue) 10% 60%; // secondary
|
|
36
37
|
--foreground-color-4-hsl: var(--base-hue) 10% 40%; // tertiary
|
|
37
|
-
--border-color-1-hsl: var(--base-hue) 10%
|
|
38
|
-
--border-color-2-hsl: var(--base-hue) 10%
|
|
38
|
+
--border-color-1-hsl: var(--base-hue) 10% 70%; // primary
|
|
39
|
+
--border-color-2-hsl: var(--base-hue) 10% 50%; // secondary/input
|
|
40
|
+
--border-color-3-hsl: var(--base-hue) 10% 30%; // tertiary
|
|
39
41
|
--background-color-1-hsl: var(--base-hue) 10% 10%; // content/input
|
|
40
42
|
--background-color-2-hsl: var(--base-hue) 10% 12%; // primary
|
|
41
43
|
--background-color-3-hsl: var(--base-hue) 10% 16%; // secondary
|
|
@@ -115,7 +117,8 @@
|
|
|
115
117
|
// Borders
|
|
116
118
|
--primary-border-color: hsl(var(--border-color-1-hsl));
|
|
117
119
|
--secondary-border-color: hsl(var(--border-color-2-hsl));
|
|
118
|
-
--control-border-color: hsl(var(--border-color-2-hsl));
|
|
120
|
+
--primary-control-border-color: hsl(var(--border-color-2-hsl));
|
|
121
|
+
--secondary-control-border-color: hsl(var(--border-color-3-hsl));
|
|
119
122
|
--danger-border-color: hsl(
|
|
120
123
|
var(--danger-color-hue) var(--alert-border-color-saturation) var(--alert-border-color-lightness)
|
|
121
124
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltia/ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -26,33 +26,33 @@
|
|
|
26
26
|
"svelte": "^3.55.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@playwright/test": "^1.
|
|
30
|
-
"@sveltejs/adapter-auto": "2.0
|
|
31
|
-
"@sveltejs/kit": "1.
|
|
29
|
+
"@playwright/test": "^1.34.3",
|
|
30
|
+
"@sveltejs/adapter-auto": "2.1.0",
|
|
31
|
+
"@sveltejs/kit": "1.20.1",
|
|
32
32
|
"@sveltejs/package": "^2.0.2",
|
|
33
33
|
"cspell": "^6.31.1",
|
|
34
|
-
"eslint": "^8.
|
|
34
|
+
"eslint": "^8.42.0",
|
|
35
35
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
36
36
|
"eslint-config-prettier": "^8.8.0",
|
|
37
37
|
"eslint-plugin-import": "^2.27.5",
|
|
38
|
-
"eslint-plugin-jsdoc": "^
|
|
39
|
-
"eslint-plugin-svelte": "^2.
|
|
38
|
+
"eslint-plugin-jsdoc": "^46.2.4",
|
|
39
|
+
"eslint-plugin-svelte": "^2.30.0",
|
|
40
40
|
"npm-run-all": "^4.1.5",
|
|
41
|
-
"postcss": "^8.4.
|
|
41
|
+
"postcss": "^8.4.24",
|
|
42
42
|
"postcss-html": "^1.5.0",
|
|
43
43
|
"prettier": "^2.8.8",
|
|
44
|
-
"prettier-plugin-svelte": "^2.10.
|
|
44
|
+
"prettier-plugin-svelte": "^2.10.1",
|
|
45
45
|
"sass": "^1.62.1",
|
|
46
|
-
"stylelint": "^15.6.
|
|
47
|
-
"stylelint-config-recommended-scss": "^
|
|
46
|
+
"stylelint": "^15.6.3",
|
|
47
|
+
"stylelint-config-recommended-scss": "^12.0.0",
|
|
48
48
|
"stylelint-scss": "^5.0.0",
|
|
49
|
-
"svelte-check": "^3.3
|
|
49
|
+
"svelte-check": "^3.4.3",
|
|
50
50
|
"svelte-i18n": "^3.6.0",
|
|
51
|
-
"svelte-migrate": "^1.1
|
|
52
|
-
"svelte-preprocess": "^5.0.
|
|
53
|
-
"tslib": "^2.5.
|
|
54
|
-
"vite": "^4.3.
|
|
55
|
-
"vitest": "^0.31.
|
|
51
|
+
"svelte-migrate": "^1.2.1",
|
|
52
|
+
"svelte-preprocess": "^5.0.4",
|
|
53
|
+
"tslib": "^2.5.3",
|
|
54
|
+
"vite": "^4.3.9",
|
|
55
|
+
"vitest": "^0.31.4"
|
|
56
56
|
},
|
|
57
57
|
"exports": {
|
|
58
58
|
"./package.json": "./package.json",
|
|
@@ -96,10 +96,10 @@
|
|
|
96
96
|
"svelte": "./package/components/composite/menu.svelte",
|
|
97
97
|
"default": "./package/components/composite/menu.svelte"
|
|
98
98
|
},
|
|
99
|
-
"./components/composite/radio-
|
|
100
|
-
"types": "./package/components/composite/radio-
|
|
101
|
-
"svelte": "./package/components/composite/radio-
|
|
102
|
-
"default": "./package/components/composite/radio-
|
|
99
|
+
"./components/composite/radio-group.svelte": {
|
|
100
|
+
"types": "./package/components/composite/radio-group.svelte.d.ts",
|
|
101
|
+
"svelte": "./package/components/composite/radio-group.svelte",
|
|
102
|
+
"default": "./package/components/composite/radio-group.svelte"
|
|
103
103
|
},
|
|
104
104
|
"./components/composite/select-button-group.svelte": {
|
|
105
105
|
"types": "./package/components/composite/select-button-group.svelte.d.ts",
|
|
@@ -186,10 +186,10 @@
|
|
|
186
186
|
"svelte": "./package/components/core/password-input.svelte",
|
|
187
187
|
"default": "./package/components/core/password-input.svelte"
|
|
188
188
|
},
|
|
189
|
-
"./components/core/radio
|
|
190
|
-
"types": "./package/components/core/radio
|
|
191
|
-
"svelte": "./package/components/core/radio
|
|
192
|
-
"default": "./package/components/core/radio
|
|
189
|
+
"./components/core/radio.svelte": {
|
|
190
|
+
"types": "./package/components/core/radio.svelte.d.ts",
|
|
191
|
+
"svelte": "./package/components/core/radio.svelte",
|
|
192
|
+
"default": "./package/components/core/radio.svelte"
|
|
193
193
|
},
|
|
194
194
|
"./components/core/row-group.svelte": {
|
|
195
195
|
"types": "./package/components/core/row-group.svelte.d.ts",
|
|
@@ -341,8 +341,8 @@
|
|
|
341
341
|
"components/composite/menu.svelte": [
|
|
342
342
|
"./package/components/composite/menu.svelte.d.ts"
|
|
343
343
|
],
|
|
344
|
-
"components/composite/radio-
|
|
345
|
-
"./package/components/composite/radio-
|
|
344
|
+
"components/composite/radio-group.svelte": [
|
|
345
|
+
"./package/components/composite/radio-group.svelte.d.ts"
|
|
346
346
|
],
|
|
347
347
|
"components/composite/select-button-group.svelte": [
|
|
348
348
|
"./package/components/composite/select-button-group.svelte.d.ts"
|
|
@@ -395,8 +395,8 @@
|
|
|
395
395
|
"components/core/password-input.svelte": [
|
|
396
396
|
"./package/components/core/password-input.svelte.d.ts"
|
|
397
397
|
],
|
|
398
|
-
"components/core/radio
|
|
399
|
-
"./package/components/core/radio
|
|
398
|
+
"components/core/radio.svelte": [
|
|
399
|
+
"./package/components/core/radio.svelte.d.ts"
|
|
400
400
|
],
|
|
401
401
|
"components/core/row-group.svelte": [
|
|
402
402
|
"./package/components/core/row-group.svelte.d.ts"
|