@noxlovette/material 0.6.0 → 0.6.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.
- package/dist/components/badge/theme.js +1 -1
- package/dist/components/buttons/button-group/theme.d.ts +1 -1
- package/dist/components/buttons/button-group/theme.js +1 -1
- package/dist/components/buttons/connected/theme.d.ts +1 -1
- package/dist/components/buttons/connected/theme.js +1 -1
- package/dist/components/buttons/split-button/SplitButton.svelte +1 -1
- package/dist/components/buttons/split-button/theme.d.ts +1 -1
- package/dist/components/buttons/split-button/theme.js +1 -1
- package/dist/components/buttons/theme.d.ts +1 -1
- package/dist/components/buttons/theme.js +3 -3
- package/dist/components/cards/theme.js +1 -1
- package/dist/components/chips/theme.d.ts +1 -1
- package/dist/components/chips/theme.js +1 -1
- package/dist/components/containers/action-rail/theme.d.ts +1 -1
- package/dist/components/containers/action-rail/theme.js +2 -2
- package/dist/components/containers/app/theme.d.ts +1 -1
- package/dist/components/containers/app/theme.js +1 -1
- package/dist/components/containers/bottom-sheet/theme.d.ts +1 -1
- package/dist/components/containers/bottom-sheet/theme.js +2 -2
- package/dist/components/containers/carousel/theme.d.ts +1 -1
- package/dist/components/containers/carousel/theme.js +1 -1
- package/dist/components/containers/context-menu/theme.d.ts +1 -1
- package/dist/components/containers/context-menu/theme.js +2 -2
- package/dist/components/containers/dialogue/Dialogue.svelte +1 -1
- package/dist/components/containers/dialogue/theme.d.ts +1 -1
- package/dist/components/containers/dialogue/theme.js +3 -3
- package/dist/components/containers/dialogue/types.d.ts +1 -1
- package/dist/components/containers/divider/theme.d.ts +1 -1
- package/dist/components/containers/divider/theme.js +1 -1
- package/dist/components/containers/link-preview/theme.d.ts +1 -1
- package/dist/components/containers/link-preview/theme.js +2 -2
- package/dist/components/containers/list/theme.d.ts +1 -1
- package/dist/components/containers/list/theme.js +1 -1
- package/dist/components/containers/menu/Menu.svelte +1 -1
- package/dist/components/containers/menu/MenuSub.svelte +1 -1
- package/dist/components/containers/menu/theme.d.ts +1 -1
- package/dist/components/containers/menu/theme.js +1 -1
- package/dist/components/containers/pane/theme.d.ts +1 -1
- package/dist/components/containers/pane/theme.js +3 -3
- package/dist/components/containers/popover/theme.d.ts +1 -1
- package/dist/components/containers/popover/theme.js +2 -2
- package/dist/components/containers/scroll-area/theme.js +1 -1
- package/dist/components/containers/side-sheet/theme.d.ts +1 -1
- package/dist/components/containers/side-sheet/theme.js +1 -1
- package/dist/components/date/theme.d.ts +1 -1
- package/dist/components/date/theme.js +1 -1
- package/dist/components/forms/checkbox/theme.d.ts +1 -1
- package/dist/components/forms/checkbox/theme.js +1 -1
- package/dist/components/forms/command/theme.d.ts +1 -1
- package/dist/components/forms/command/theme.js +1 -1
- package/dist/components/forms/pin/theme.d.ts +1 -1
- package/dist/components/forms/pin/theme.js +1 -1
- package/dist/components/forms/radio-group/theme.d.ts +1 -1
- package/dist/components/forms/radio-group/theme.js +1 -1
- package/dist/components/forms/search/theme.d.ts +1 -1
- package/dist/components/forms/search/theme.js +1 -1
- package/dist/components/forms/select/Select.svelte +2 -2
- package/dist/components/forms/select/theme.d.ts +1 -1
- package/dist/components/forms/select/theme.js +2 -2
- package/dist/components/forms/slider/theme.d.ts +1 -1
- package/dist/components/forms/slider/theme.js +1 -1
- package/dist/components/forms/switch/theme.d.ts +1 -1
- package/dist/components/forms/switch/theme.js +1 -1
- package/dist/components/forms/textfield/theme.d.ts +1 -1
- package/dist/components/forms/textfield/theme.js +1 -1
- package/dist/components/forms/toggle-group/theme.d.ts +1 -1
- package/dist/components/forms/toggle-group/theme.js +1 -1
- package/dist/components/forms/tooltip/theme.d.ts +1 -1
- package/dist/components/forms/tooltip/theme.js +2 -2
- package/dist/components/misc/ThemeSwitcher.svelte +1 -1
- package/dist/components/misc/theme.js +1 -1
- package/dist/components/nav/appbar/theme.d.ts +1 -1
- package/dist/components/nav/appbar/theme.js +2 -2
- package/dist/components/nav/breadcrumb/theme.d.ts +1 -1
- package/dist/components/nav/breadcrumb/theme.js +1 -1
- package/dist/components/nav/navbar/theme.d.ts +3 -3
- package/dist/components/nav/navbar/theme.js +2 -2
- package/dist/components/nav/rail/Rail.svelte +4 -2
- package/dist/components/nav/rail/theme.d.ts +1 -1
- package/dist/components/nav/rail/theme.js +2 -2
- package/dist/components/nav/rail/types.d.ts +4 -0
- package/dist/components/nav/tabs/theme.d.ts +1 -1
- package/dist/components/nav/tabs/theme.js +1 -1
- package/dist/components/pill/theme.d.ts +1 -1
- package/dist/components/pill/theme.js +1 -1
- package/dist/components/progress/LinearProgress.svelte +1 -1
- package/dist/components/snackbar/theme.d.ts +1 -1
- package/dist/components/snackbar/theme.js +2 -2
- package/dist/components/table/theme.d.ts +1 -1
- package/dist/components/table/theme.js +1 -1
- package/dist/components/time/TimeField.svelte +1 -1
- package/dist/components/time/theme.d.ts +1 -1
- package/dist/components/time/theme.js +1 -1
- package/dist/components/toolbar/theme.d.ts +1 -1
- package/dist/components/toolbar/theme.js +2 -2
- package/dist/components/typography/body/theme.d.ts +1 -1
- package/dist/components/typography/body/theme.js +1 -1
- package/dist/components/typography/display/theme.d.ts +1 -1
- package/dist/components/typography/display/theme.js +1 -1
- package/dist/components/typography/headline/theme.d.ts +1 -1
- package/dist/components/typography/headline/theme.js +1 -1
- package/dist/components/typography/kbd/theme.d.ts +1 -1
- package/dist/components/typography/kbd/theme.js +1 -1
- package/dist/components/typography/label/theme.js +1 -1
- package/dist/components/typography/title/theme.d.ts +1 -1
- package/dist/components/typography/title/theme.js +1 -1
- package/dist/index.css +1 -0
- package/dist/styles/layers.css +33 -0
- package/dist/utils/icon/theme.d.ts +1 -1
- package/dist/utils/icon/theme.js +1 -1
- package/dist/utils/tv.d.ts +6 -0
- package/dist/utils/tv.js +12 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { tv } from '
|
|
1
|
+
import { tv } from '../../../utils/tv.js';
|
|
2
2
|
export const tooltip = tv({
|
|
3
3
|
slots: {
|
|
4
|
-
base: 'min-w-60 py-spacing-150 px-spacing-200 shadow-elevation-2 rounded-md relative z-
|
|
4
|
+
base: 'min-w-60 py-spacing-150 px-spacing-200 shadow-elevation-2 rounded-md relative z-layer-popup pointer-events-auto',
|
|
5
5
|
subhead: '',
|
|
6
6
|
supportingText: '',
|
|
7
7
|
textContainer: '',
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
let open = $state(false);
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
|
-
<div class="right-spacing-200 bottom-spacing-200
|
|
9
|
+
<div class="right-spacing-200 bottom-spacing-200 z-layer-fab fixed hidden md:block">
|
|
10
10
|
<Popover bind:open title="Theme Settings" side="top" align="end" sideOffset={16}>
|
|
11
11
|
{#snippet trigger(triggerProps)}
|
|
12
12
|
<FAB iconProps={{ name: 'palette' }} {...triggerProps} />
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type VariantProps } from '
|
|
1
|
+
import { type VariantProps } from '../../../utils/tv.js';
|
|
2
2
|
import type { Breakpoint } from '../../containers/pane/theme.js';
|
|
3
3
|
export type AppbarVariants = VariantProps<typeof appbar>;
|
|
4
4
|
export type AppBarSize = 'small' | 'medium' | 'large';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { tv } from '
|
|
1
|
+
import { tv } from '../../../utils/tv.js';
|
|
2
2
|
/*
|
|
3
3
|
M3 Expressive app bar (https://m3.material.io/components/app-bars/specs), laid out on one
|
|
4
4
|
3-column grid (leading · text · trailing) so the size can change per breakpoint in CSS alone:
|
|
@@ -121,7 +121,7 @@ export function appbarSize(size, hasSubtitle) {
|
|
|
121
121
|
}
|
|
122
122
|
export const appbar = tv({
|
|
123
123
|
slots: {
|
|
124
|
-
base: 'fixed top-spacing-0 left-spacing-0 w-full flex flex-col z-
|
|
124
|
+
base: 'fixed top-spacing-0 left-spacing-0 w-full flex flex-col z-layer-bar transition-colors md-sys-motion-effects',
|
|
125
125
|
row: 'grid w-full items-center px-spacing-50',
|
|
126
126
|
childrenRow: 'w-full px-spacing-100 pb-spacing-100',
|
|
127
127
|
ghost: 'w-full shrink-0 pointer-events-none',
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export declare const navbar: import("tailwind-variants").TVReturnType<{
|
|
2
2
|
[key: string]: {
|
|
3
3
|
[key: string]: import("tailwind-variants").ClassValue | {
|
|
4
|
+
fab?: import("tailwind-variants").ClassValue;
|
|
4
5
|
base?: import("tailwind-variants").ClassValue;
|
|
5
6
|
items?: import("tailwind-variants").ClassValue;
|
|
6
7
|
ghost?: import("tailwind-variants").ClassValue;
|
|
7
|
-
fab?: import("tailwind-variants").ClassValue;
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
10
|
} | {
|
|
11
11
|
[x: string]: {
|
|
12
12
|
[x: string]: import("tailwind-variants").ClassValue | {
|
|
13
|
+
fab?: import("tailwind-variants").ClassValue;
|
|
13
14
|
base?: import("tailwind-variants").ClassValue;
|
|
14
15
|
items?: import("tailwind-variants").ClassValue;
|
|
15
16
|
ghost?: import("tailwind-variants").ClassValue;
|
|
16
|
-
fab?: import("tailwind-variants").ClassValue;
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
} | {}, {
|
|
@@ -24,10 +24,10 @@ export declare const navbar: import("tailwind-variants").TVReturnType<{
|
|
|
24
24
|
}, undefined, {
|
|
25
25
|
[key: string]: {
|
|
26
26
|
[key: string]: import("tailwind-variants").ClassValue | {
|
|
27
|
+
fab?: import("tailwind-variants").ClassValue;
|
|
27
28
|
base?: import("tailwind-variants").ClassValue;
|
|
28
29
|
items?: import("tailwind-variants").ClassValue;
|
|
29
30
|
ghost?: import("tailwind-variants").ClassValue;
|
|
30
|
-
fab?: import("tailwind-variants").ClassValue;
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
} | {}, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { tv } from '
|
|
1
|
+
import { tv } from '../../../utils/tv.js';
|
|
2
2
|
export const navbar = tv({
|
|
3
3
|
slots: {
|
|
4
|
-
base: 'shadow-elevation-2 bg-md-sys-color-surface-container
|
|
4
|
+
base: 'shadow-elevation-2 bg-md-sys-color-surface-container z-layer-bar flex h-20 fixed bottom-spacing-0 w-full left-spacing-0 justify-around py-spacing-150 md:hidden',
|
|
5
5
|
items: 'flex justify-around w-full',
|
|
6
6
|
fab: 'bottom-24 right-spacing-200 absolute',
|
|
7
7
|
ghost: 'h-20 w-full shrink-0 md:hidden pointer-events-none'
|
|
@@ -25,6 +25,8 @@ On mobile (< md) it automatically renders as a bottom navigation bar.
|
|
|
25
25
|
collapsed = $bindable(true),
|
|
26
26
|
anchor = 'viewport',
|
|
27
27
|
railTop = 0,
|
|
28
|
+
expandLabel = 'Expand navigation',
|
|
29
|
+
collapseLabel = 'Collapse navigation',
|
|
28
30
|
class: className
|
|
29
31
|
}: RailProps = $props();
|
|
30
32
|
|
|
@@ -68,7 +70,7 @@ On mobile (< md) it automatically renders as a bottom navigation bar.
|
|
|
68
70
|
<ButtonIcon
|
|
69
71
|
variant="standard"
|
|
70
72
|
type="button"
|
|
71
|
-
tooltipContent={collapsed ?
|
|
73
|
+
tooltipContent={collapsed ? expandLabel : collapseLabel}
|
|
72
74
|
iconProps={{ name: `${collapsed ? 'menu' : 'menu_open'}` }}
|
|
73
75
|
class={toggleClass}
|
|
74
76
|
onclick={() => (collapsed = !collapsed)}
|
|
@@ -98,6 +100,6 @@ On mobile (< md) it automatically renders as a bottom navigation bar.
|
|
|
98
100
|
opacity: 1;
|
|
99
101
|
pointer-events: auto;
|
|
100
102
|
background-color: rgb(0 0 0 / 0.4);
|
|
101
|
-
z-index:
|
|
103
|
+
z-index: var(--z-layer-rail);
|
|
102
104
|
}
|
|
103
105
|
</style>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type VariantProps } from '
|
|
1
|
+
import { type VariantProps } from '../../../utils/tv.js';
|
|
2
2
|
export type RailVariants = VariantProps<typeof rail>;
|
|
3
3
|
export type RailItemVariants = VariantProps<typeof railElement>;
|
|
4
4
|
export declare const rail: import("tailwind-variants").TVReturnType<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { tv } from '
|
|
1
|
+
import { tv } from '../../../utils/tv.js';
|
|
2
2
|
export const rail = tv({
|
|
3
3
|
slots: {
|
|
4
|
-
base: 'py-spacing-600 hidden bg-md-sys-color-surface-container z-
|
|
4
|
+
base: 'py-spacing-600 hidden bg-md-sys-color-surface-container z-layer-rail flex-col md:flex gap-spacing-300 transition-[width,padding,background-color] md-sys-motion-spatial',
|
|
5
5
|
items: 'flex flex-col gap-spacing-150 pt-spacing-300 scrollbar-none w-full overflow-x-hidden',
|
|
6
6
|
ghost: 'hidden md:block shrink-0 transition-[width] md-sys-motion-spatial',
|
|
7
7
|
scrim: 'hidden md:block lg:hidden inset-spacing-0'
|
|
@@ -41,6 +41,10 @@ export type RailProps = RailVariants & HTMLAttributes<HTMLDivElement> & {
|
|
|
41
41
|
anchor?: RailVariants['anchor'];
|
|
42
42
|
/** Top offset in px for viewport/parent anchor (e.g. height of a top bar). Default 0. */
|
|
43
43
|
railTop?: number;
|
|
44
|
+
/** Tooltip and accessible name of the toggle while collapsed. Default 'Expand navigation'. */
|
|
45
|
+
expandLabel?: string;
|
|
46
|
+
/** Tooltip and accessible name of the toggle while expanded. Default 'Collapse navigation'. */
|
|
47
|
+
collapseLabel?: string;
|
|
44
48
|
/**
|
|
45
49
|
* @deprecated No effect: Rail no longer renders a navigation bar below `md`. Mount a `Navbar`
|
|
46
50
|
* next to it for small windows.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type VariantProps } from '
|
|
1
|
+
import { type VariantProps } from '../../../utils/tv.js';
|
|
2
2
|
export type TabVariants = VariantProps<typeof tab>;
|
|
3
3
|
export type TabHolderVariants = VariantProps<typeof tabHolder>;
|
|
4
4
|
export declare const tabHolder: import("tailwind-variants").TVReturnType<{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { tv } from '
|
|
1
|
+
import { tv } from '../../utils/tv.js';
|
|
2
2
|
export const pill = tv({
|
|
3
3
|
base: 'relative inline-flex items-center justify-center px-spacing-200 py-spacing-75 md-sys-typescale-label-large select-none rounded-full whitespace-nowrap',
|
|
4
4
|
variants: {
|
|
@@ -11,7 +11,7 @@ The track always keeps a gap either side of the bar.
|
|
|
11
11
|
-->
|
|
12
12
|
<script lang="ts">
|
|
13
13
|
import clsx from 'clsx';
|
|
14
|
-
import { tv } from '
|
|
14
|
+
import { tv } from '../../utils/tv.js';
|
|
15
15
|
import { Progress } from 'bits-ui';
|
|
16
16
|
import { animate, type AnimationPlaybackControls } from 'motion';
|
|
17
17
|
import { springTokens, springTransition } from '../../animation/spring.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { tv } from '
|
|
1
|
+
import { tv } from '../../utils/tv.js';
|
|
2
2
|
export const snackbar = tv({
|
|
3
3
|
slots: {
|
|
4
|
-
base: 'rounded-xs relative min-h-spacing-600 md:max-h-17 flex z-
|
|
4
|
+
base: 'rounded-xs relative min-h-spacing-600 md:max-h-17 flex z-layer-snackbar items-center bg-md-sys-color-inverse-surface shadow-elevation-3 pr-spacing-100 pl-spacing-200 justify-between h-max py-spacing-150',
|
|
5
5
|
label: 'text-md-sys-color-inverse-primary md-sys-typescale-label-large px-spacing-150 cursor-pointer ',
|
|
6
6
|
actionWrapper: 'flex items-center z-40',
|
|
7
7
|
supportingText: 'text-md-sys-color-inverse-on-surface md-sys-typescale-body-medium max-w-[60ch] ',
|
|
@@ -92,7 +92,7 @@ It combines a Material 3 Textfield with a TimepickerInput for intuitive time sel
|
|
|
92
92
|
align="start"
|
|
93
93
|
sideOffset={12}
|
|
94
94
|
collisionPadding={8}
|
|
95
|
-
class="z-
|
|
95
|
+
class="z-layer-popup"
|
|
96
96
|
>
|
|
97
97
|
{#snippet child({ wrapperProps, props, open })}
|
|
98
98
|
<div {...wrapperProps}>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type VariantProps } from '
|
|
1
|
+
import { type VariantProps } from '../../utils/tv.js';
|
|
2
2
|
export type TimepickerVariants = VariantProps<typeof timepicker>;
|
|
3
3
|
export declare const timepicker: import("tailwind-variants").TVReturnType<{
|
|
4
4
|
[key: string]: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type VariantProps } from '
|
|
1
|
+
import { type VariantProps } from '../../utils/tv.js';
|
|
2
2
|
export type ToolbarVariants = VariantProps<typeof toolbar>;
|
|
3
3
|
export type ToolbarButtonVariants = VariantProps<typeof toolbarButton>;
|
|
4
4
|
export type ToolbarGroupItemVariants = VariantProps<typeof toolbarGroupItem>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { tv } from '
|
|
1
|
+
import { tv } from '../../utils/tv.js';
|
|
2
2
|
export const toolbar = tv({
|
|
3
3
|
slots: {
|
|
4
4
|
// Layout/position only — no paint. Holds one implicit `segment` by default, or,
|
|
@@ -33,7 +33,7 @@ export const toolbar = tv({
|
|
|
33
33
|
},
|
|
34
34
|
variant: {
|
|
35
35
|
floating: { root: 'inline-flex', segment: 'rounded-full shadow-elevation-1' },
|
|
36
|
-
docked: { root: 'fixed left-spacing-0 z-
|
|
36
|
+
docked: { root: 'fixed left-spacing-0 z-layer-bar w-full', segment: 'w-full rounded-none' }
|
|
37
37
|
},
|
|
38
38
|
color: {
|
|
39
39
|
standard: { segment: 'bg-md-sys-color-surface-container' },
|
package/dist/index.css
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Stacking layers for surfaces that float over the page. M3 defines no z-index tokens, so the
|
|
3
|
+
* library names its own: every fixed, sticky or portaled component takes one of these instead
|
|
4
|
+
* of a number, so their relative order is set here and nowhere else. Apply with
|
|
5
|
+
* `z-layer-<name>` (z-layer-modal); override the value on :root with `--z-layer-<name>`.
|
|
6
|
+
* Stacking inside one component (a slider thumb over its track) keeps plain z-10/z-20.
|
|
7
|
+
*
|
|
8
|
+
* Order, lowest first:
|
|
9
|
+
* bar Navbar, AppBar, ActionRail, docked Toolbar
|
|
10
|
+
* rail Rail and its tablet scrim (the expanded rail covers the bars)
|
|
11
|
+
* sheet standard (non-modal) BottomSheet
|
|
12
|
+
* fab fixed FABs such as ThemeSwitcher
|
|
13
|
+
* pane DraggablePane and its minimised pill, floating windows over app chrome
|
|
14
|
+
* modal Dialogue scrim and content, a FAB's container-transform surface
|
|
15
|
+
* snackbar stays readable while a dialog is open
|
|
16
|
+
* popup menus, selects, tooltips, popovers, date/time pickers, opened from any layer
|
|
17
|
+
* beneath, including a dialog or a pane
|
|
18
|
+
* Modal sheets are native <dialog>s in the top layer and sit above all of these.
|
|
19
|
+
*/
|
|
20
|
+
@theme static {
|
|
21
|
+
--z-layer-bar: 30;
|
|
22
|
+
--z-layer-rail: 40;
|
|
23
|
+
--z-layer-sheet: 40;
|
|
24
|
+
--z-layer-fab: 50;
|
|
25
|
+
--z-layer-pane: 60;
|
|
26
|
+
--z-layer-modal: 70;
|
|
27
|
+
--z-layer-snackbar: 80;
|
|
28
|
+
--z-layer-popup: 90;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@utility z-layer-* {
|
|
32
|
+
z-index: --value(--z-layer-*);
|
|
33
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type VariantProps } from '
|
|
1
|
+
import { type VariantProps } from '../tv.js';
|
|
2
2
|
export type LoadingIndicatorVariants = VariantProps<typeof loadingIndicator>;
|
|
3
3
|
export declare const loadingIndicator: import("tailwind-variants").TVReturnType<{
|
|
4
4
|
center: {
|
package/dist/utils/icon/theme.js
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { VariantProps } from 'tailwind-variants';
|
|
2
|
+
/**
|
|
3
|
+
* The library's `tv`. It teaches tailwind-merge that `z-layer-*` sets z-index, so a consumer's
|
|
4
|
+
* `class="z-40"` replaces a component's layer instead of fighting it in CSS order.
|
|
5
|
+
*/
|
|
6
|
+
export declare const tv: import("tailwind-variants").TV;
|
package/dist/utils/tv.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createTV } from 'tailwind-variants';
|
|
2
|
+
/** The layer names from `styles/layers.css`. Keep the two in sync. */
|
|
3
|
+
const LAYERS = ['bar', 'rail', 'sheet', 'fab', 'pane', 'modal', 'snackbar', 'popup'];
|
|
4
|
+
/**
|
|
5
|
+
* The library's `tv`. It teaches tailwind-merge that `z-layer-*` sets z-index, so a consumer's
|
|
6
|
+
* `class="z-40"` replaces a component's layer instead of fighting it in CSS order.
|
|
7
|
+
*/
|
|
8
|
+
export const tv = createTV({
|
|
9
|
+
twMergeConfig: {
|
|
10
|
+
extend: { classGroups: { z: [{ 'z-layer': LAYERS }] } }
|
|
11
|
+
}
|
|
12
|
+
});
|