@noxlovette/material 0.1.31 → 0.1.32
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/components/buttons/button-group/ButtonGroup.svelte +5 -1
- package/dist/components/buttons/button-group/ButtonGroupItem.svelte +10 -3
- package/dist/components/nav/rail/Rail.svelte +5 -1
- package/dist/components/pill/theme.d.ts +12 -0
- package/dist/components/pill/theme.js +4 -0
- package/dist/components/toolbar/ToolbarButton.svelte +3 -1
- package/dist/components/toolbar/ToolbarDivider.svelte +3 -1
- package/dist/components/toolbar/ToolbarGroupItem.svelte +3 -1
- package/package.json +1 -1
|
@@ -28,7 +28,11 @@ Replaces the deprecated ToggleGroup / segmented-buttons pattern.
|
|
|
28
28
|
|
|
29
29
|
const cls = $derived(buttonGroup({ orientation, shape, size }));
|
|
30
30
|
|
|
31
|
-
const buttonGroupCtx = {
|
|
31
|
+
const buttonGroupCtx = {
|
|
32
|
+
get orientation() {
|
|
33
|
+
return orientation;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
32
36
|
setContext('buttonGroup', buttonGroupCtx);
|
|
33
37
|
</script>
|
|
34
38
|
|
|
@@ -11,10 +11,17 @@ Displays a leading check icon when selected, per M3 spec.
|
|
|
11
11
|
import { buttonGroupItem } from './theme.js';
|
|
12
12
|
import type { ButtonGroupItemProps } from './types.js';
|
|
13
13
|
|
|
14
|
-
let {
|
|
15
|
-
|
|
14
|
+
let {
|
|
15
|
+
value,
|
|
16
|
+
label,
|
|
17
|
+
iconProps,
|
|
18
|
+
disabled = false,
|
|
19
|
+
class: className
|
|
20
|
+
}: ButtonGroupItemProps = $props();
|
|
16
21
|
|
|
17
|
-
const buttonGroupCtx = getContext<{ orientation: 'horizontal' | 'vertical' } | undefined>(
|
|
22
|
+
const buttonGroupCtx = getContext<{ orientation: 'horizontal' | 'vertical' } | undefined>(
|
|
23
|
+
'buttonGroup'
|
|
24
|
+
);
|
|
18
25
|
const orientation = $derived(buttonGroupCtx?.orientation ?? 'horizontal');
|
|
19
26
|
const { base, checkIcon, icon } = $derived(buttonGroupItem({ orientation }));
|
|
20
27
|
</script>
|
|
@@ -28,7 +28,11 @@ Navigation rails provide access to primary destinations in apps when using table
|
|
|
28
28
|
}: RailProps = $props();
|
|
29
29
|
|
|
30
30
|
const expanded = $derived(!collapsed);
|
|
31
|
-
const railCtx = {
|
|
31
|
+
const railCtx = {
|
|
32
|
+
get collapsed() {
|
|
33
|
+
return collapsed;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
32
36
|
setContext('rail', railCtx);
|
|
33
37
|
const { base, items, ghost, scrim } = $derived(rail({ expanded, anchor, rounded }));
|
|
34
38
|
const railBaseClass = $derived(`${base({ class: clsx(className) })} rail-base`);
|
|
@@ -7,6 +7,10 @@ export declare const pill: import("tailwind-variants").TVReturnType<{
|
|
|
7
7
|
tertiary: string;
|
|
8
8
|
error: string;
|
|
9
9
|
container: string;
|
|
10
|
+
'primary-container': string;
|
|
11
|
+
'secondary-container': string;
|
|
12
|
+
'tertiary-container': string;
|
|
13
|
+
'error-container': string;
|
|
10
14
|
yellow: string;
|
|
11
15
|
green: string;
|
|
12
16
|
};
|
|
@@ -17,6 +21,10 @@ export declare const pill: import("tailwind-variants").TVReturnType<{
|
|
|
17
21
|
tertiary: string;
|
|
18
22
|
error: string;
|
|
19
23
|
container: string;
|
|
24
|
+
'primary-container': string;
|
|
25
|
+
'secondary-container': string;
|
|
26
|
+
'tertiary-container': string;
|
|
27
|
+
'error-container': string;
|
|
20
28
|
yellow: string;
|
|
21
29
|
green: string;
|
|
22
30
|
};
|
|
@@ -27,6 +35,10 @@ export declare const pill: import("tailwind-variants").TVReturnType<{
|
|
|
27
35
|
tertiary: string;
|
|
28
36
|
error: string;
|
|
29
37
|
container: string;
|
|
38
|
+
'primary-container': string;
|
|
39
|
+
'secondary-container': string;
|
|
40
|
+
'tertiary-container': string;
|
|
41
|
+
'error-container': string;
|
|
30
42
|
yellow: string;
|
|
31
43
|
green: string;
|
|
32
44
|
};
|
|
@@ -8,6 +8,10 @@ export const pill = tv({
|
|
|
8
8
|
tertiary: 'md-component-button-filled-tertiary',
|
|
9
9
|
error: 'md-component-button-filled-error',
|
|
10
10
|
container: 'bg-md-sys-color-surface-container text-md-sys-color-on-surface',
|
|
11
|
+
'primary-container': 'bg-md-sys-color-primary-container text-md-sys-color-on-primary-container',
|
|
12
|
+
'secondary-container': 'bg-md-sys-color-secondary-container text-md-sys-color-on-secondary-container',
|
|
13
|
+
'tertiary-container': 'bg-md-sys-color-tertiary-container text-md-sys-color-on-tertiary-container',
|
|
14
|
+
'error-container': 'bg-md-sys-color-error-container text-md-sys-color-on-error-container',
|
|
11
15
|
yellow: 'bg-yellow-400 text-yellow-950 dark:bg-yellow-300 dark:text-yellow-950',
|
|
12
16
|
green: 'bg-green-600 text-white dark:bg-green-500 dark:text-green-950'
|
|
13
17
|
}
|
|
@@ -19,7 +19,9 @@ Color is inherited from the parent Toolbar via context.
|
|
|
19
19
|
...restProps
|
|
20
20
|
}: ToolbarButtonProps = $props();
|
|
21
21
|
|
|
22
|
-
const toolbarCtx = getContext<{ color: ToolbarColor; orientation: string } | undefined>(
|
|
22
|
+
const toolbarCtx = getContext<{ color: ToolbarColor; orientation: string } | undefined>(
|
|
23
|
+
'toolbar'
|
|
24
|
+
);
|
|
23
25
|
const color = $derived(toolbarCtx?.color ?? 'standard');
|
|
24
26
|
const { base, icon } = $derived(toolbarButton({ color }));
|
|
25
27
|
</script>
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
import { getContext } from 'svelte';
|
|
3
3
|
import { toolbar } from './theme.js';
|
|
4
4
|
|
|
5
|
-
const toolbarCtx = getContext<
|
|
5
|
+
const toolbarCtx = getContext<
|
|
6
|
+
{ color: string; orientation: 'horizontal' | 'vertical' } | undefined
|
|
7
|
+
>('toolbar');
|
|
6
8
|
const orientation = $derived(toolbarCtx?.orientation ?? 'horizontal');
|
|
7
9
|
const cls = $derived(toolbar({ orientation }));
|
|
8
10
|
|
|
@@ -21,7 +21,9 @@ Color is inherited from the parent Toolbar via context.
|
|
|
21
21
|
...restProps
|
|
22
22
|
}: ToolbarGroupItemProps = $props();
|
|
23
23
|
|
|
24
|
-
const toolbarCtx = getContext<{ color: ToolbarColor; orientation: string } | undefined>(
|
|
24
|
+
const toolbarCtx = getContext<{ color: ToolbarColor; orientation: string } | undefined>(
|
|
25
|
+
'toolbar'
|
|
26
|
+
);
|
|
25
27
|
const color = $derived(toolbarCtx?.color ?? 'standard');
|
|
26
28
|
const { base, icon } = $derived(toolbarGroupItem({ color }));
|
|
27
29
|
</script>
|