svseeds 0.4.0 → 0.4.1
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.
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
export type DarkToggleReqdProps = never;
|
|
12
12
|
export type DarkToggleBindProps = "dark" | "status" | "element";
|
|
13
13
|
|
|
14
|
-
const
|
|
14
|
+
const ariaLabel = "Toggle theme color";
|
|
15
15
|
const preset = "svs-dark-toggle";
|
|
16
16
|
|
|
17
17
|
class Theme {
|
|
@@ -116,17 +116,21 @@
|
|
|
116
116
|
|
|
117
117
|
// *** Initialize Deps *** //
|
|
118
118
|
const svsToggle = {
|
|
119
|
-
...omit(deps?.svsToggle, "main", "style"),
|
|
119
|
+
...omit(deps?.svsToggle, "main", "style", "attributes"),
|
|
120
120
|
style: deps?.svsToggle?.style ?? `${preset} svs-toggle`,
|
|
121
|
+
attributes: {
|
|
122
|
+
...deps?.svsToggle?.attributes,
|
|
123
|
+
"aria-label": deps?.svsToggle?.attributes?.["aria-label"] ?? ariaLabel,
|
|
124
|
+
},
|
|
121
125
|
};
|
|
122
126
|
|
|
123
127
|
// *** Bind Handlers *** //
|
|
124
|
-
$effect.pre(() => { theme.dark = dark });
|
|
128
|
+
$effect.pre(() => { theme.dark = dark; });
|
|
125
129
|
</script>
|
|
126
130
|
|
|
127
131
|
<!---------------------------------------->
|
|
128
132
|
|
|
129
|
-
<Toggle bind:value={dark} bind:status bind:element {
|
|
133
|
+
<Toggle bind:value={dark} bind:status bind:element {main} {...svsToggle} />
|
|
130
134
|
|
|
131
135
|
{#snippet svgDark()}
|
|
132
136
|
<svg style="width: 100%; height: 100%;" viewBox="0 0 24 24" aria-hidden="true">
|