@classic-homes/theme-svelte 0.1.49 → 0.1.51
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/dist/lib/components/Button.svelte +34 -49
- package/dist/lib/components/Checkbox.svelte +2 -2
- package/dist/lib/components/DataPanel.svelte +1399 -0
- package/dist/lib/components/DataPanel.svelte.d.ts +63 -0
- package/dist/lib/components/DataPanelContent.svelte +17 -0
- package/dist/lib/components/DataPanelContent.svelte.d.ts +10 -0
- package/dist/lib/components/DataPanelFooter.svelte +55 -0
- package/dist/lib/components/DataPanelFooter.svelte.d.ts +15 -0
- package/dist/lib/components/DataPanelHeader.svelte +220 -0
- package/dist/lib/components/DataPanelHeader.svelte.d.ts +37 -0
- package/dist/lib/components/DataPanelTab.svelte +72 -0
- package/dist/lib/components/DataPanelTab.svelte.d.ts +14 -0
- package/dist/lib/components/DateTimePicker.svelte +175 -57
- package/dist/lib/components/DateTimePicker.svelte.d.ts +2 -0
- package/dist/lib/components/FileUpload.svelte +4 -2
- package/dist/lib/components/Label.svelte +1 -1
- package/dist/lib/components/Select.svelte +126 -231
- package/dist/lib/components/Separator.svelte +1 -1
- package/dist/lib/components/Signature.svelte +4 -3
- package/dist/lib/components/Switch.svelte +7 -20
- package/dist/lib/components/Switch.svelte.d.ts +0 -1
- package/dist/lib/components/Tabs.svelte +4 -2
- package/dist/lib/components/data-table/createDataTable.svelte.d.ts +1 -1
- package/dist/lib/components/layout/FormPageLayout.svelte +3 -2
- package/dist/lib/components/layout/FormPageLayout.svelte.d.ts +1 -1
- package/dist/lib/composables/index.d.ts +17 -0
- package/dist/lib/composables/index.js +17 -1
- package/dist/lib/index.d.ts +7 -0
- package/dist/lib/index.js +7 -0
- package/dist/lib/schemas/common.d.ts +2 -2
- package/dist/lib/stores/dataPanel.svelte.d.ts +37 -0
- package/dist/lib/stores/dataPanel.svelte.js +182 -0
- package/dist/lib/utils/date.d.ts +29 -0
- package/dist/lib/utils/date.js +118 -0
- package/dist/lib/utils.d.ts +8 -0
- package/dist/lib/utils.js +19 -0
- package/package.json +5 -1
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
class?: string;
|
|
45
45
|
onclick?: (e: MouseEvent) => void;
|
|
46
46
|
children: Snippet;
|
|
47
|
+
/** Allow passing additional HTML attributes (aria-*, data-*, etc.) */
|
|
47
48
|
[key: string]: unknown;
|
|
48
49
|
}
|
|
49
50
|
|
|
@@ -64,33 +65,41 @@
|
|
|
64
65
|
const classes = $derived(cn(buttonVariants({ variant, size }), className));
|
|
65
66
|
</script>
|
|
66
67
|
|
|
67
|
-
{#
|
|
68
|
-
<
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
68
|
+
{#snippet loadingSpinner()}
|
|
69
|
+
<svg
|
|
70
|
+
class="h-4 w-4 animate-spin"
|
|
71
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
72
|
+
fill="none"
|
|
73
|
+
viewBox="0 0 24 24"
|
|
74
|
+
aria-hidden="true"
|
|
75
|
+
>
|
|
76
|
+
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"
|
|
77
|
+
></circle>
|
|
78
|
+
<path
|
|
79
|
+
class="opacity-75"
|
|
80
|
+
fill="currentColor"
|
|
81
|
+
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
82
|
+
></path>
|
|
83
|
+
</svg>
|
|
84
|
+
{/snippet}
|
|
85
|
+
|
|
86
|
+
{#snippet buttonContent()}
|
|
87
|
+
{#if loading}
|
|
88
|
+
{@render loadingSpinner()}
|
|
89
|
+
{#if loadingText}
|
|
90
|
+
<span>{loadingText}</span>
|
|
91
|
+
<span class="sr-only">Loading</span>
|
|
91
92
|
{:else}
|
|
92
93
|
{@render children()}
|
|
93
94
|
{/if}
|
|
95
|
+
{:else}
|
|
96
|
+
{@render children()}
|
|
97
|
+
{/if}
|
|
98
|
+
{/snippet}
|
|
99
|
+
|
|
100
|
+
{#if href}
|
|
101
|
+
<a {href} class={classes} {...restProps}>
|
|
102
|
+
{@render buttonContent()}
|
|
94
103
|
</a>
|
|
95
104
|
{:else}
|
|
96
105
|
<button
|
|
@@ -102,30 +111,6 @@
|
|
|
102
111
|
{onclick}
|
|
103
112
|
{...restProps}
|
|
104
113
|
>
|
|
105
|
-
{
|
|
106
|
-
<svg
|
|
107
|
-
class="h-4 w-4 animate-spin"
|
|
108
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
109
|
-
fill="none"
|
|
110
|
-
viewBox="0 0 24 24"
|
|
111
|
-
aria-hidden="true"
|
|
112
|
-
>
|
|
113
|
-
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"
|
|
114
|
-
></circle>
|
|
115
|
-
<path
|
|
116
|
-
class="opacity-75"
|
|
117
|
-
fill="currentColor"
|
|
118
|
-
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
119
|
-
></path>
|
|
120
|
-
</svg>
|
|
121
|
-
{#if loadingText}
|
|
122
|
-
<span>{loadingText}</span>
|
|
123
|
-
<span class="sr-only">Loading</span>
|
|
124
|
-
{:else}
|
|
125
|
-
{@render children()}
|
|
126
|
-
{/if}
|
|
127
|
-
{:else}
|
|
128
|
-
{@render children()}
|
|
129
|
-
{/if}
|
|
114
|
+
{@render buttonContent()}
|
|
130
115
|
</button>
|
|
131
116
|
{/if}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
import { Checkbox as CheckboxPrimitive } from 'bits-ui';
|
|
4
|
-
import { cn } from '../utils.js';
|
|
4
|
+
import { cn, useId } from '../utils.js';
|
|
5
5
|
|
|
6
6
|
interface Props {
|
|
7
7
|
checked?: boolean;
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
}: Props = $props();
|
|
33
33
|
|
|
34
34
|
// Generate a stable unique ID if none provided (for accessibility)
|
|
35
|
-
const generatedId =
|
|
35
|
+
const generatedId = useId('checkbox');
|
|
36
36
|
const effectiveId = $derived(id ?? generatedId);
|
|
37
37
|
|
|
38
38
|
function handleCheckedChange(newChecked: boolean | 'indeterminate') {
|