@m3-baseui/react-tailwind 1.0.3 → 1.1.0
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/bottom-app-bar.d.ts +62 -0
- package/dist/bottom-app-bar.js +51 -0
- package/dist/bottom-app-bar.js.map +1 -0
- package/dist/bottom-sheet.d.ts +101 -0
- package/dist/bottom-sheet.js +70 -0
- package/dist/bottom-sheet.js.map +1 -0
- package/dist/card.js +2 -0
- package/dist/card.js.map +1 -1
- package/dist/checkbox.d.ts +5 -5
- package/dist/divider.js +2 -1
- package/dist/divider.js.map +1 -1
- package/dist/fab-menu.d.ts +132 -0
- package/dist/fab-menu.js +116 -0
- package/dist/fab-menu.js.map +1 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.js +259 -16
- package/dist/index.js.map +1 -1
- package/dist/item.d.ts +5 -5
- package/dist/menu.d.ts +5 -5
- package/dist/navigation-bar.d.ts +5 -5
- package/dist/navigation-bar.js +20 -4
- package/dist/navigation-bar.js.map +1 -1
- package/dist/navigation-rail.d.ts +101 -0
- package/dist/navigation-rail.js +92 -0
- package/dist/navigation-rail.js.map +1 -0
- package/dist/progress.d.ts +12 -12
- package/dist/progress.js.map +1 -1
- package/dist/segmented-button.d.ts +5 -5
- package/dist/select.d.ts +5 -5
- package/dist/side-sheet.d.ts +112 -0
- package/dist/side-sheet.js +90 -0
- package/dist/side-sheet.js.map +1 -0
- package/dist/slider.d.ts +5 -5
- package/dist/snackbar.d.ts +5 -5
- package/dist/snackbar.js +1 -1
- package/dist/snackbar.js.map +1 -1
- package/dist/textfield.js +5 -2
- package/dist/textfield.js.map +1 -1
- package/dist/top-app-bar.d.ts +147 -0
- package/dist/top-app-bar.js +68 -0
- package/dist/top-app-bar.js.map +1 -0
- package/package.json +31 -1
- package/styles/preset.css +2 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import * as _m3_baseui_core from '@m3-baseui/core';
|
|
3
|
+
export { BottomAppBarProps } from '@m3-baseui/core';
|
|
4
|
+
import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
|
|
5
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
6
|
+
|
|
7
|
+
declare const bottomAppBarTv: tailwind_variants.TVReturnType<{
|
|
8
|
+
[key: string]: {
|
|
9
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
10
|
+
root?: tailwind_variants.ClassValue;
|
|
11
|
+
actions?: tailwind_variants.ClassValue;
|
|
12
|
+
fab?: tailwind_variants.ClassValue;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
} | {
|
|
16
|
+
[x: string]: {
|
|
17
|
+
[x: string]: tailwind_variants.ClassValue | {
|
|
18
|
+
root?: tailwind_variants.ClassValue;
|
|
19
|
+
actions?: tailwind_variants.ClassValue;
|
|
20
|
+
fab?: tailwind_variants.ClassValue;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
} | {}, {
|
|
24
|
+
root: string;
|
|
25
|
+
actions: string;
|
|
26
|
+
fab: string;
|
|
27
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<unknown, {
|
|
28
|
+
[key: string]: {
|
|
29
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
30
|
+
root?: tailwind_variants.ClassValue;
|
|
31
|
+
actions?: tailwind_variants.ClassValue;
|
|
32
|
+
fab?: tailwind_variants.ClassValue;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
} | {}>, {
|
|
36
|
+
[key: string]: {
|
|
37
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
38
|
+
root?: tailwind_variants.ClassValue;
|
|
39
|
+
actions?: tailwind_variants.ClassValue;
|
|
40
|
+
fab?: tailwind_variants.ClassValue;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
} | {}, {
|
|
44
|
+
root: string;
|
|
45
|
+
actions: string;
|
|
46
|
+
fab: string;
|
|
47
|
+
}, tailwind_variants.TVReturnType<unknown, {
|
|
48
|
+
root: string;
|
|
49
|
+
actions: string;
|
|
50
|
+
fab: string;
|
|
51
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<unknown, {
|
|
52
|
+
[key: string]: {
|
|
53
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
54
|
+
root?: tailwind_variants.ClassValue;
|
|
55
|
+
actions?: tailwind_variants.ClassValue;
|
|
56
|
+
fab?: tailwind_variants.ClassValue;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
} | {}>, unknown, unknown, undefined>>;
|
|
60
|
+
declare const BottomAppBar: react.ForwardRefExoticComponent<_m3_baseui_core.BottomAppBarOwnProps & react.HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
61
|
+
|
|
62
|
+
export { BottomAppBar, bottomAppBarTv };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createBottomAppBar } from '@m3-baseui/core';
|
|
3
|
+
import { tv as tv$1 } from 'tailwind-variants';
|
|
4
|
+
|
|
5
|
+
// src/bottom-app-bar.ts
|
|
6
|
+
var TYPESCALE = [
|
|
7
|
+
"display-large",
|
|
8
|
+
"display-medium",
|
|
9
|
+
"display-small",
|
|
10
|
+
"headline-large",
|
|
11
|
+
"headline-medium",
|
|
12
|
+
"headline-small",
|
|
13
|
+
"title-large",
|
|
14
|
+
"title-medium",
|
|
15
|
+
"title-small",
|
|
16
|
+
"body-large",
|
|
17
|
+
"body-medium",
|
|
18
|
+
"body-small",
|
|
19
|
+
"label-large",
|
|
20
|
+
"label-medium",
|
|
21
|
+
"label-small"
|
|
22
|
+
];
|
|
23
|
+
var tv = (options, config) => tv$1(options, {
|
|
24
|
+
...config,
|
|
25
|
+
twMergeConfig: {
|
|
26
|
+
extend: {
|
|
27
|
+
classGroups: {
|
|
28
|
+
"font-size": [{ text: [...TYPESCALE] }]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// src/bottom-app-bar.ts
|
|
35
|
+
var bottomAppBarTv = tv({
|
|
36
|
+
slots: {
|
|
37
|
+
root: "flex items-center justify-between w-full box-border h-20 px-1 bg-surface-container text-on-surface-variant",
|
|
38
|
+
actions: "flex items-center gap-1 pl-2 [&_svg]:size-6",
|
|
39
|
+
fab: "flex items-center pr-3"
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
var s = bottomAppBarTv();
|
|
43
|
+
var BottomAppBar = createBottomAppBar({
|
|
44
|
+
root: s.root(),
|
|
45
|
+
actions: s.actions(),
|
|
46
|
+
fab: s.fab()
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export { BottomAppBar, bottomAppBarTv };
|
|
50
|
+
//# sourceMappingURL=bottom-app-bar.js.map
|
|
51
|
+
//# sourceMappingURL=bottom-app-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tv.ts","../src/bottom-app-bar.ts"],"names":["baseTv"],"mappings":";;;;;AAeA,IAAM,SAAA,GAAY;AAAA,EAChB,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,iBAAA;AAAA,EACA,gBAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAA;AAEO,IAAM,EAAA,GAAS,CAAC,OAAA,EAAS,MAAA,KAC9BA,KAAO,OAAA,EAAS;AAAA,EACd,GAAG,MAAA;AAAA,EACH,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ;AAAA,MACN,WAAA,EAAa;AAAA,QACX,WAAA,EAAa,CAAC,EAAE,IAAA,EAAM,CAAC,GAAG,SAAS,GAAG;AAAA;AACxC;AACF;AAEJ,CAAC,CAAA;;;AClCI,IAAM,iBAAiB,EAAA,CAAG;AAAA,EAC/B,KAAA,EAAO;AAAA,IACL,IAAA,EAAM,4GAAA;AAAA,IACN,OAAA,EAAS,6CAAA;AAAA,IACT,GAAA,EAAK;AAAA;AAET,CAAC;AAED,IAAM,IAAI,cAAA,EAAe;AAClB,IAAM,eAAe,kBAAA,CAAmB;AAAA,EAC7C,IAAA,EAAM,EAAE,IAAA,EAAK;AAAA,EACb,OAAA,EAAS,EAAE,OAAA,EAAQ;AAAA,EACnB,GAAA,EAAK,EAAE,GAAA;AACT,CAAC","file":"bottom-app-bar.js","sourcesContent":["/**\n * tv.ts — a tailwind-variants factory pre-configured for the M3 typescale.\n *\n * The Tailwind v4 preset exposes the 15 typescale roles as `text-<role>`\n * font-size utilities (e.g. `text-body-small`, `text-label-large`). Stock\n * tailwind-merge does not know these custom names, so it groups them with the\n * `text-<color>` utilities and drops one when a slot sets both a color *and* a\n * typescale (the common M3 case). That silently strips either the color or the\n * type, breaking token compliance.\n *\n * Teaching tailwind-merge that the typescale names belong to the `font-size`\n * group keeps color and type independent, so both survive the merge.\n */\nimport { type TV, tv as baseTv } from 'tailwind-variants';\n\nconst TYPESCALE = [\n 'display-large',\n 'display-medium',\n 'display-small',\n 'headline-large',\n 'headline-medium',\n 'headline-small',\n 'title-large',\n 'title-medium',\n 'title-small',\n 'body-large',\n 'body-medium',\n 'body-small',\n 'label-large',\n 'label-medium',\n 'label-small',\n] as const;\n\nexport const tv: TV = (options, config) =>\n baseTv(options, {\n ...config,\n twMergeConfig: {\n extend: {\n classGroups: {\n 'font-size': [{ text: [...TYPESCALE] }],\n },\n },\n },\n });\n","/**\n * bottom-app-bar.ts — tailwind-variants slots for the M3 BottomAppBar.\n *\n * An 80dp `surface-container` `role=\"toolbar\"`: leading action icons + an\n * optional trailing FAB. Same DOM as the VE build.\n */\nimport { createBottomAppBar } from '@m3-baseui/core';\nimport { tv } from './tv';\n\nexport const bottomAppBarTv = tv({\n slots: {\n root: 'flex items-center justify-between w-full box-border h-20 px-1 bg-surface-container text-on-surface-variant',\n actions: 'flex items-center gap-1 pl-2 [&_svg]:size-6',\n fab: 'flex items-center pr-3',\n },\n});\n\nconst s = bottomAppBarTv();\nexport const BottomAppBar = createBottomAppBar({\n root: s.root(),\n actions: s.actions(),\n fab: s.fab(),\n});\nexport type { BottomAppBarProps } from '@m3-baseui/core';\n"]}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import * as _base_ui_react from '@base-ui/react';
|
|
3
|
+
import * as _m3_baseui_core from '@m3-baseui/core';
|
|
4
|
+
export { BottomSheetVariant } from '@m3-baseui/core';
|
|
5
|
+
import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
|
|
6
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
7
|
+
|
|
8
|
+
declare const bottomSheetTv: tailwind_variants.TVReturnType<{
|
|
9
|
+
[key: string]: {
|
|
10
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
11
|
+
title?: tailwind_variants.ClassValue;
|
|
12
|
+
popup?: tailwind_variants.ClassValue;
|
|
13
|
+
handle?: tailwind_variants.ClassValue;
|
|
14
|
+
description?: tailwind_variants.ClassValue;
|
|
15
|
+
viewport?: tailwind_variants.ClassValue;
|
|
16
|
+
backdrop?: tailwind_variants.ClassValue;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
} | {
|
|
20
|
+
[x: string]: {
|
|
21
|
+
[x: string]: tailwind_variants.ClassValue | {
|
|
22
|
+
title?: tailwind_variants.ClassValue;
|
|
23
|
+
popup?: tailwind_variants.ClassValue;
|
|
24
|
+
handle?: tailwind_variants.ClassValue;
|
|
25
|
+
description?: tailwind_variants.ClassValue;
|
|
26
|
+
viewport?: tailwind_variants.ClassValue;
|
|
27
|
+
backdrop?: tailwind_variants.ClassValue;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
} | {}, {
|
|
31
|
+
backdrop: string[];
|
|
32
|
+
viewport: string;
|
|
33
|
+
popup: string[];
|
|
34
|
+
handle: string;
|
|
35
|
+
title: string[];
|
|
36
|
+
description: string[];
|
|
37
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<unknown, {
|
|
38
|
+
[key: string]: {
|
|
39
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
40
|
+
title?: tailwind_variants.ClassValue;
|
|
41
|
+
popup?: tailwind_variants.ClassValue;
|
|
42
|
+
handle?: tailwind_variants.ClassValue;
|
|
43
|
+
description?: tailwind_variants.ClassValue;
|
|
44
|
+
viewport?: tailwind_variants.ClassValue;
|
|
45
|
+
backdrop?: tailwind_variants.ClassValue;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
} | {}>, {
|
|
49
|
+
[key: string]: {
|
|
50
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
51
|
+
title?: tailwind_variants.ClassValue;
|
|
52
|
+
popup?: tailwind_variants.ClassValue;
|
|
53
|
+
handle?: tailwind_variants.ClassValue;
|
|
54
|
+
description?: tailwind_variants.ClassValue;
|
|
55
|
+
viewport?: tailwind_variants.ClassValue;
|
|
56
|
+
backdrop?: tailwind_variants.ClassValue;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
} | {}, {
|
|
60
|
+
backdrop: string[];
|
|
61
|
+
viewport: string;
|
|
62
|
+
popup: string[];
|
|
63
|
+
handle: string;
|
|
64
|
+
title: string[];
|
|
65
|
+
description: string[];
|
|
66
|
+
}, tailwind_variants.TVReturnType<unknown, {
|
|
67
|
+
backdrop: string[];
|
|
68
|
+
viewport: string;
|
|
69
|
+
popup: string[];
|
|
70
|
+
handle: string;
|
|
71
|
+
title: string[];
|
|
72
|
+
description: string[];
|
|
73
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<unknown, {
|
|
74
|
+
[key: string]: {
|
|
75
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
76
|
+
title?: tailwind_variants.ClassValue;
|
|
77
|
+
popup?: tailwind_variants.ClassValue;
|
|
78
|
+
handle?: tailwind_variants.ClassValue;
|
|
79
|
+
description?: tailwind_variants.ClassValue;
|
|
80
|
+
viewport?: tailwind_variants.ClassValue;
|
|
81
|
+
backdrop?: tailwind_variants.ClassValue;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
} | {}>, unknown, unknown, undefined>>;
|
|
85
|
+
declare const BottomSheet: {
|
|
86
|
+
Root: {
|
|
87
|
+
({ variant, ...props }: _m3_baseui_core.BottomSheetOwnProps & Omit<_base_ui_react.DrawerRoot.Props<unknown>, "modal" | "swipeDirection">): React.JSX.Element;
|
|
88
|
+
displayName: string;
|
|
89
|
+
};
|
|
90
|
+
Trigger: _base_ui_react.DrawerTrigger;
|
|
91
|
+
Portal: _base_ui_react.DrawerPortal;
|
|
92
|
+
Backdrop: react.ForwardRefExoticComponent<Omit<Omit<_base_ui_react.DrawerBackdropProps, "ref"> & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
93
|
+
Viewport: react.ForwardRefExoticComponent<Omit<Omit<_base_ui_react.DrawerViewportProps, "ref"> & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<unknown>>;
|
|
94
|
+
Popup: react.ForwardRefExoticComponent<Omit<Omit<_base_ui_react.DrawerPopupProps, "ref"> & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<unknown>>;
|
|
95
|
+
Handle: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
96
|
+
Title: react.ForwardRefExoticComponent<Omit<_base_ui_react.DrawerTitleProps, "ref"> & react.RefAttributes<unknown>>;
|
|
97
|
+
Description: react.ForwardRefExoticComponent<Omit<_base_ui_react.DrawerDescriptionProps, "ref"> & react.RefAttributes<unknown>>;
|
|
98
|
+
Close: _base_ui_react.DrawerClose;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export { BottomSheet, bottomSheetTv };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createBottomSheet } from '@m3-baseui/core';
|
|
3
|
+
import { tv as tv$1 } from 'tailwind-variants';
|
|
4
|
+
|
|
5
|
+
// src/bottom-sheet.ts
|
|
6
|
+
var TYPESCALE = [
|
|
7
|
+
"display-large",
|
|
8
|
+
"display-medium",
|
|
9
|
+
"display-small",
|
|
10
|
+
"headline-large",
|
|
11
|
+
"headline-medium",
|
|
12
|
+
"headline-small",
|
|
13
|
+
"title-large",
|
|
14
|
+
"title-medium",
|
|
15
|
+
"title-small",
|
|
16
|
+
"body-large",
|
|
17
|
+
"body-medium",
|
|
18
|
+
"body-small",
|
|
19
|
+
"label-large",
|
|
20
|
+
"label-medium",
|
|
21
|
+
"label-small"
|
|
22
|
+
];
|
|
23
|
+
var tv = (options, config) => tv$1(options, {
|
|
24
|
+
...config,
|
|
25
|
+
twMergeConfig: {
|
|
26
|
+
extend: {
|
|
27
|
+
classGroups: {
|
|
28
|
+
"font-size": [{ text: [...TYPESCALE] }]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// src/bottom-sheet.ts
|
|
35
|
+
var bottomSheetTv = tv({
|
|
36
|
+
slots: {
|
|
37
|
+
backdrop: [
|
|
38
|
+
"fixed inset-0 z-40 bg-scrim/32",
|
|
39
|
+
"transition-opacity duration-300 ease-emphasized",
|
|
40
|
+
"data-[swiping]:transition-none",
|
|
41
|
+
"data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"
|
|
42
|
+
],
|
|
43
|
+
viewport: "fixed inset-0 z-50 flex items-end justify-center",
|
|
44
|
+
popup: [
|
|
45
|
+
"box-border w-full max-w-[640px] max-h-[calc(100dvh-56px)]",
|
|
46
|
+
"overflow-y-auto overscroll-contain touch-auto outline-none",
|
|
47
|
+
"pb-6 bg-surface-container-low text-on-surface rounded-t-extra-large shadow-level1",
|
|
48
|
+
"[transform:translateY(calc(var(--drawer-snap-point-offset)+var(--drawer-swipe-movement-y)))]",
|
|
49
|
+
"transition-transform duration-300 ease-emphasized",
|
|
50
|
+
"data-[swiping]:select-none",
|
|
51
|
+
"data-[starting-style]:[transform:translateY(100%)] data-[ending-style]:[transform:translateY(100%)]"
|
|
52
|
+
],
|
|
53
|
+
handle: "mx-auto mt-4 mb-2 h-1 w-8 shrink-0 rounded-full bg-on-surface-variant/40",
|
|
54
|
+
title: ["m-0 px-6 pt-2 text-title-large text-on-surface"],
|
|
55
|
+
description: ["m-0 px-6 pt-1 text-body-medium text-on-surface-variant"]
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
var s = bottomSheetTv();
|
|
59
|
+
var BottomSheet = createBottomSheet({
|
|
60
|
+
backdrop: s.backdrop(),
|
|
61
|
+
viewport: s.viewport(),
|
|
62
|
+
popup: s.popup(),
|
|
63
|
+
handle: s.handle(),
|
|
64
|
+
title: s.title(),
|
|
65
|
+
description: s.description()
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
export { BottomSheet, bottomSheetTv };
|
|
69
|
+
//# sourceMappingURL=bottom-sheet.js.map
|
|
70
|
+
//# sourceMappingURL=bottom-sheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tv.ts","../src/bottom-sheet.ts"],"names":["baseTv"],"mappings":";;;;;AAeA,IAAM,SAAA,GAAY;AAAA,EAChB,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,iBAAA;AAAA,EACA,gBAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAA;AAEO,IAAM,EAAA,GAAS,CAAC,OAAA,EAAS,MAAA,KAC9BA,KAAO,OAAA,EAAS;AAAA,EACd,GAAG,MAAA;AAAA,EACH,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ;AAAA,MACN,WAAA,EAAa;AAAA,QACX,WAAA,EAAa,CAAC,EAAE,IAAA,EAAM,CAAC,GAAG,SAAS,GAAG;AAAA;AACxC;AACF;AAEJ,CAAC,CAAA;;;AC/BI,IAAM,gBAAgB,EAAA,CAAG;AAAA,EAC9B,KAAA,EAAO;AAAA,IACL,QAAA,EAAU;AAAA,MACR,gCAAA;AAAA,MACA,iDAAA;AAAA,MACA,gCAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,QAAA,EAAU,kDAAA;AAAA,IACV,KAAA,EAAO;AAAA,MACL,2DAAA;AAAA,MACA,4DAAA;AAAA,MACA,mFAAA;AAAA,MACA,8FAAA;AAAA,MACA,mDAAA;AAAA,MACA,4BAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,MAAA,EAAQ,0EAAA;AAAA,IACR,KAAA,EAAO,CAAC,gDAAgD,CAAA;AAAA,IACxD,WAAA,EAAa,CAAC,wDAAwD;AAAA;AAE1E,CAAC;AAED,IAAM,IAAI,aAAA,EAAc;AACjB,IAAM,cAAc,iBAAA,CAAkB;AAAA,EAC3C,QAAA,EAAU,EAAE,QAAA,EAAS;AAAA,EACrB,QAAA,EAAU,EAAE,QAAA,EAAS;AAAA,EACrB,KAAA,EAAO,EAAE,KAAA,EAAM;AAAA,EACf,MAAA,EAAQ,EAAE,MAAA,EAAO;AAAA,EACjB,KAAA,EAAO,EAAE,KAAA,EAAM;AAAA,EACf,WAAA,EAAa,EAAE,WAAA;AACjB,CAAC","file":"bottom-sheet.js","sourcesContent":["/**\n * tv.ts — a tailwind-variants factory pre-configured for the M3 typescale.\n *\n * The Tailwind v4 preset exposes the 15 typescale roles as `text-<role>`\n * font-size utilities (e.g. `text-body-small`, `text-label-large`). Stock\n * tailwind-merge does not know these custom names, so it groups them with the\n * `text-<color>` utilities and drops one when a slot sets both a color *and* a\n * typescale (the common M3 case). That silently strips either the color or the\n * type, breaking token compliance.\n *\n * Teaching tailwind-merge that the typescale names belong to the `font-size`\n * group keeps color and type independent, so both survive the merge.\n */\nimport { type TV, tv as baseTv } from 'tailwind-variants';\n\nconst TYPESCALE = [\n 'display-large',\n 'display-medium',\n 'display-small',\n 'headline-large',\n 'headline-medium',\n 'headline-small',\n 'title-large',\n 'title-medium',\n 'title-small',\n 'body-large',\n 'body-medium',\n 'body-small',\n 'label-large',\n 'label-medium',\n 'label-small',\n] as const;\n\nexport const tv: TV = (options, config) =>\n baseTv(options, {\n ...config,\n twMergeConfig: {\n extend: {\n classGroups: {\n 'font-size': [{ text: [...TYPESCALE] }],\n },\n },\n },\n });\n","/**\n * bottom-sheet.ts — tailwind-variants slots for the M3 Bottom sheet.\n *\n * A `surface-container-low` surface docked to the bottom edge with extra-large\n * (28dp) top corners, elevation 1, and a 32×4dp drag handle. The scrim fades on\n * Base UI's data-[starting-style] / data-[ending-style]; the popup slides via the\n * drawer's `--drawer-swipe-movement-y` so the swipe gesture tracks the finger.\n * Same DOM + `data-*` as the VE build.\n */\nimport { createBottomSheet } from '@m3-baseui/core';\nimport { tv } from './tv';\n\nexport const bottomSheetTv = tv({\n slots: {\n backdrop: [\n 'fixed inset-0 z-40 bg-scrim/32',\n 'transition-opacity duration-300 ease-emphasized',\n 'data-[swiping]:transition-none',\n 'data-[starting-style]:opacity-0 data-[ending-style]:opacity-0',\n ],\n viewport: 'fixed inset-0 z-50 flex items-end justify-center',\n popup: [\n 'box-border w-full max-w-[640px] max-h-[calc(100dvh-56px)]',\n 'overflow-y-auto overscroll-contain touch-auto outline-none',\n 'pb-6 bg-surface-container-low text-on-surface rounded-t-extra-large shadow-level1',\n '[transform:translateY(calc(var(--drawer-snap-point-offset)+var(--drawer-swipe-movement-y)))]',\n 'transition-transform duration-300 ease-emphasized',\n 'data-[swiping]:select-none',\n 'data-[starting-style]:[transform:translateY(100%)] data-[ending-style]:[transform:translateY(100%)]',\n ],\n handle: 'mx-auto mt-4 mb-2 h-1 w-8 shrink-0 rounded-full bg-on-surface-variant/40',\n title: ['m-0 px-6 pt-2 text-title-large text-on-surface'],\n description: ['m-0 px-6 pt-1 text-body-medium text-on-surface-variant'],\n },\n});\n\nconst s = bottomSheetTv();\nexport const BottomSheet = createBottomSheet({\n backdrop: s.backdrop(),\n viewport: s.viewport(),\n popup: s.popup(),\n handle: s.handle(),\n title: s.title(),\n description: s.description(),\n});\nexport type { BottomSheetVariant } from '@m3-baseui/core';\n"]}
|
package/dist/card.js
CHANGED
|
@@ -43,6 +43,8 @@ var cardTv = tv({
|
|
|
43
43
|
interactive: {
|
|
44
44
|
true: [
|
|
45
45
|
"group overflow-hidden cursor-pointer select-none text-left w-full outline-none",
|
|
46
|
+
// Animate the elevation lift/settle to match the VE box-shadow transition.
|
|
47
|
+
"transition-shadow duration-150 ease-standard",
|
|
46
48
|
"before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100",
|
|
47
49
|
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
48
50
|
"focus-visible:before:opacity-[var(--md-sys-state-focus)]",
|
package/dist/card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/tv.ts","../src/card.ts"],"names":["baseTv"],"mappings":";;;;;AAeA,IAAM,SAAA,GAAY;AAAA,EAChB,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,iBAAA;AAAA,EACA,gBAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAA;AAEO,IAAM,EAAA,GAAS,CAAC,OAAA,EAAS,MAAA,KAC9BA,KAAO,OAAA,EAAS;AAAA,EACd,GAAG,MAAA;AAAA,EACH,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ;AAAA,MACN,WAAA,EAAa;AAAA,QACX,WAAA,EAAa,CAAC,EAAE,IAAA,EAAM,CAAC,GAAG,SAAS,GAAG;AAAA;AACxC;AACF;AAEJ,CAAC,CAAA;;;AC/BI,IAAM,SAAS,EAAA,CAAG;AAAA,EACvB,IAAA,EAAM,oDAAA;AAAA,EACN,QAAA,EAAU;AAAA,IACR,OAAA,EAAS;AAAA,MACP,QAAA,EAAU,wCAAA;AAAA,MACV,MAAA,EAAQ,8BAAA;AAAA,MACR,QAAA,EAAU;AAAA,KACZ;AAAA,IACA,WAAA,EAAa;AAAA,MACX,IAAA,EAAM;AAAA,QACJ,gFAAA;AAAA,QACA,4IAAA;AAAA,QACA,kDAAA;AAAA,QACA,0DAAA;AAAA,QACA,qDAAA;AAAA,QACA,4FAAA;AAAA;AAAA,QAEA,yGAAA;AAAA,QACA;AAAA,OACF;AAAA,MACA,KAAA,EAAO;AAAA;AACT,GACF;AAAA,EACA,gBAAA,EAAkB;AAAA;AAAA,IAEhB;AAAA,MACE,OAAA,EAAS,UAAA;AAAA,MACT,WAAA,EAAa,IAAA;AAAA,MACb,KAAA,EAAO;AAAA;AACT,GACF;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,OAAA,EAAS,UAAA;AAAA,IACT,WAAA,EAAa;AAAA;AAEjB,CAAC;AAEM,IAAM,OAAO,UAAA,CAAW;AAAA,EAC7B,IAAA,EAAM,CAAC,EAAE,OAAA,EAAS,WAAA,OAAkB,MAAA,CAAO,EAAE,OAAA,EAAS,WAAA,EAAa;AACrE,CAAC","file":"card.js","sourcesContent":["/**\n * tv.ts — a tailwind-variants factory pre-configured for the M3 typescale.\n *\n * The Tailwind v4 preset exposes the 15 typescale roles as `text-<role>`\n * font-size utilities (e.g. `text-body-small`, `text-label-large`). Stock\n * tailwind-merge does not know these custom names, so it groups them with the\n * `text-<color>` utilities and drops one when a slot sets both a color *and* a\n * typescale (the common M3 case). That silently strips either the color or the\n * type, breaking token compliance.\n *\n * Teaching tailwind-merge that the typescale names belong to the `font-size`\n * group keeps color and type independent, so both survive the merge.\n */\nimport { type TV, tv as baseTv } from 'tailwind-variants';\n\nconst TYPESCALE = [\n 'display-large',\n 'display-medium',\n 'display-small',\n 'headline-large',\n 'headline-medium',\n 'headline-small',\n 'title-large',\n 'title-medium',\n 'title-small',\n 'body-large',\n 'body-medium',\n 'body-small',\n 'label-large',\n 'label-medium',\n 'label-small',\n] as const;\n\nexport const tv: TV = (options, config) =>\n baseTv(options, {\n ...config,\n twMergeConfig: {\n extend: {\n classGroups: {\n 'font-size': [{ text: [...TYPESCALE] }],\n },\n },\n },\n });\n","/**\n * card.ts — tailwind-variants slots for the M3 Card.\n *\n * 12dp corners. `elevated` is surface-container-low + level1, `filled` is\n * surface-container-highest (level0), `outlined` is surface + outline-variant.\n * Interactive cards add the `currentColor` state-layer `::before` (the pointer\n * ripple is added by the factory), a focus ring and per-token disabled dimming.\n * Same DOM + `data-*` as the VE build.\n */\nimport { createCard } from '@m3-baseui/core';\nimport { tv } from './tv';\n\nexport const cardTv = tv({\n base: 'relative box-border rounded-medium text-on-surface',\n variants: {\n variant: {\n elevated: 'bg-surface-container-low shadow-level1',\n filled: 'bg-surface-container-highest',\n outlined: 'bg-surface border border-outline-variant',\n },\n interactive: {\n true: [\n 'group overflow-hidden cursor-pointer select-none text-left w-full outline-none',\n 'before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100',\n 'hover:before:opacity-[var(--md-sys-state-hover)]',\n 'focus-visible:before:opacity-[var(--md-sys-state-focus)]',\n 'active:before:opacity-[var(--md-sys-state-pressed)]',\n 'focus-visible:outline-[3px] focus-visible:outline-offset-2 focus-visible:outline-secondary',\n // M3 disabled: drop the shadow + state layer, dim the content per-token.\n 'disabled:pointer-events-none disabled:before:opacity-0 disabled:shadow-none disabled:text-on-surface/38',\n 'data-[disabled]:pointer-events-none data-[disabled]:before:opacity-0 data-[disabled]:shadow-none data-[disabled]:text-on-surface/38',\n ],\n false: '',\n },\n },\n compoundVariants: [\n // M3 interactive elevated: lifts to level2 on hover, settles to level1 on press.\n {\n variant: 'elevated',\n interactive: true,\n class: 'hover:shadow-level2 active:shadow-level1',\n },\n ],\n defaultVariants: {\n variant: 'elevated',\n interactive: false,\n },\n});\n\nexport const Card = createCard({\n root: ({ variant, interactive }) => cardTv({ variant, interactive }),\n});\nexport type { CardProps, CardVariant } from '@m3-baseui/core';\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/tv.ts","../src/card.ts"],"names":["baseTv"],"mappings":";;;;;AAeA,IAAM,SAAA,GAAY;AAAA,EAChB,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,iBAAA;AAAA,EACA,gBAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAA;AAEO,IAAM,EAAA,GAAS,CAAC,OAAA,EAAS,MAAA,KAC9BA,KAAO,OAAA,EAAS;AAAA,EACd,GAAG,MAAA;AAAA,EACH,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ;AAAA,MACN,WAAA,EAAa;AAAA,QACX,WAAA,EAAa,CAAC,EAAE,IAAA,EAAM,CAAC,GAAG,SAAS,GAAG;AAAA;AACxC;AACF;AAEJ,CAAC,CAAA;;;AC/BI,IAAM,SAAS,EAAA,CAAG;AAAA,EACvB,IAAA,EAAM,oDAAA;AAAA,EACN,QAAA,EAAU;AAAA,IACR,OAAA,EAAS;AAAA,MACP,QAAA,EAAU,wCAAA;AAAA,MACV,MAAA,EAAQ,8BAAA;AAAA,MACR,QAAA,EAAU;AAAA,KACZ;AAAA,IACA,WAAA,EAAa;AAAA,MACX,IAAA,EAAM;AAAA,QACJ,gFAAA;AAAA;AAAA,QAEA,8CAAA;AAAA,QACA,4IAAA;AAAA,QACA,kDAAA;AAAA,QACA,0DAAA;AAAA,QACA,qDAAA;AAAA,QACA,4FAAA;AAAA;AAAA,QAEA,yGAAA;AAAA,QACA;AAAA,OACF;AAAA,MACA,KAAA,EAAO;AAAA;AACT,GACF;AAAA,EACA,gBAAA,EAAkB;AAAA;AAAA,IAEhB;AAAA,MACE,OAAA,EAAS,UAAA;AAAA,MACT,WAAA,EAAa,IAAA;AAAA,MACb,KAAA,EAAO;AAAA;AACT,GACF;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,OAAA,EAAS,UAAA;AAAA,IACT,WAAA,EAAa;AAAA;AAEjB,CAAC;AAEM,IAAM,OAAO,UAAA,CAAW;AAAA,EAC7B,IAAA,EAAM,CAAC,EAAE,OAAA,EAAS,WAAA,OAAkB,MAAA,CAAO,EAAE,OAAA,EAAS,WAAA,EAAa;AACrE,CAAC","file":"card.js","sourcesContent":["/**\n * tv.ts — a tailwind-variants factory pre-configured for the M3 typescale.\n *\n * The Tailwind v4 preset exposes the 15 typescale roles as `text-<role>`\n * font-size utilities (e.g. `text-body-small`, `text-label-large`). Stock\n * tailwind-merge does not know these custom names, so it groups them with the\n * `text-<color>` utilities and drops one when a slot sets both a color *and* a\n * typescale (the common M3 case). That silently strips either the color or the\n * type, breaking token compliance.\n *\n * Teaching tailwind-merge that the typescale names belong to the `font-size`\n * group keeps color and type independent, so both survive the merge.\n */\nimport { type TV, tv as baseTv } from 'tailwind-variants';\n\nconst TYPESCALE = [\n 'display-large',\n 'display-medium',\n 'display-small',\n 'headline-large',\n 'headline-medium',\n 'headline-small',\n 'title-large',\n 'title-medium',\n 'title-small',\n 'body-large',\n 'body-medium',\n 'body-small',\n 'label-large',\n 'label-medium',\n 'label-small',\n] as const;\n\nexport const tv: TV = (options, config) =>\n baseTv(options, {\n ...config,\n twMergeConfig: {\n extend: {\n classGroups: {\n 'font-size': [{ text: [...TYPESCALE] }],\n },\n },\n },\n });\n","/**\n * card.ts — tailwind-variants slots for the M3 Card.\n *\n * 12dp corners. `elevated` is surface-container-low + level1, `filled` is\n * surface-container-highest (level0), `outlined` is surface + outline-variant.\n * Interactive cards add the `currentColor` state-layer `::before` (the pointer\n * ripple is added by the factory), a focus ring and per-token disabled dimming.\n * Same DOM + `data-*` as the VE build.\n */\nimport { createCard } from '@m3-baseui/core';\nimport { tv } from './tv';\n\nexport const cardTv = tv({\n base: 'relative box-border rounded-medium text-on-surface',\n variants: {\n variant: {\n elevated: 'bg-surface-container-low shadow-level1',\n filled: 'bg-surface-container-highest',\n outlined: 'bg-surface border border-outline-variant',\n },\n interactive: {\n true: [\n 'group overflow-hidden cursor-pointer select-none text-left w-full outline-none',\n // Animate the elevation lift/settle to match the VE box-shadow transition.\n 'transition-shadow duration-150 ease-standard',\n 'before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100',\n 'hover:before:opacity-[var(--md-sys-state-hover)]',\n 'focus-visible:before:opacity-[var(--md-sys-state-focus)]',\n 'active:before:opacity-[var(--md-sys-state-pressed)]',\n 'focus-visible:outline-[3px] focus-visible:outline-offset-2 focus-visible:outline-secondary',\n // M3 disabled: drop the shadow + state layer, dim the content per-token.\n 'disabled:pointer-events-none disabled:before:opacity-0 disabled:shadow-none disabled:text-on-surface/38',\n 'data-[disabled]:pointer-events-none data-[disabled]:before:opacity-0 data-[disabled]:shadow-none data-[disabled]:text-on-surface/38',\n ],\n false: '',\n },\n },\n compoundVariants: [\n // M3 interactive elevated: lifts to level2 on hover, settles to level1 on press.\n {\n variant: 'elevated',\n interactive: true,\n class: 'hover:shadow-level2 active:shadow-level1',\n },\n ],\n defaultVariants: {\n variant: 'elevated',\n interactive: false,\n },\n});\n\nexport const Card = createCard({\n root: ({ variant, interactive }) => cardTv({ variant, interactive }),\n});\nexport type { CardProps, CardVariant } from '@m3-baseui/core';\n"]}
|
package/dist/checkbox.d.ts
CHANGED
|
@@ -6,16 +6,16 @@ import * as tailwind_variants from 'tailwind-variants';
|
|
|
6
6
|
declare const checkboxTv: tailwind_variants.TVReturnType<{
|
|
7
7
|
[key: string]: {
|
|
8
8
|
[key: string]: tailwind_variants.ClassValue | {
|
|
9
|
-
icon?: tailwind_variants.ClassValue;
|
|
10
9
|
root?: tailwind_variants.ClassValue;
|
|
10
|
+
icon?: tailwind_variants.ClassValue;
|
|
11
11
|
indicator?: tailwind_variants.ClassValue;
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
} | {
|
|
15
15
|
[x: string]: {
|
|
16
16
|
[x: string]: tailwind_variants.ClassValue | {
|
|
17
|
-
icon?: tailwind_variants.ClassValue;
|
|
18
17
|
root?: tailwind_variants.ClassValue;
|
|
18
|
+
icon?: tailwind_variants.ClassValue;
|
|
19
19
|
indicator?: tailwind_variants.ClassValue;
|
|
20
20
|
};
|
|
21
21
|
};
|
|
@@ -26,16 +26,16 @@ declare const checkboxTv: tailwind_variants.TVReturnType<{
|
|
|
26
26
|
}, undefined, tailwind_variants_dist_config_js.TVConfig<unknown, {
|
|
27
27
|
[key: string]: {
|
|
28
28
|
[key: string]: tailwind_variants.ClassValue | {
|
|
29
|
-
icon?: tailwind_variants.ClassValue;
|
|
30
29
|
root?: tailwind_variants.ClassValue;
|
|
30
|
+
icon?: tailwind_variants.ClassValue;
|
|
31
31
|
indicator?: tailwind_variants.ClassValue;
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
34
|
} | {}>, {
|
|
35
35
|
[key: string]: {
|
|
36
36
|
[key: string]: tailwind_variants.ClassValue | {
|
|
37
|
-
icon?: tailwind_variants.ClassValue;
|
|
38
37
|
root?: tailwind_variants.ClassValue;
|
|
38
|
+
icon?: tailwind_variants.ClassValue;
|
|
39
39
|
indicator?: tailwind_variants.ClassValue;
|
|
40
40
|
};
|
|
41
41
|
};
|
|
@@ -50,8 +50,8 @@ declare const checkboxTv: tailwind_variants.TVReturnType<{
|
|
|
50
50
|
}, undefined, tailwind_variants_dist_config_js.TVConfig<unknown, {
|
|
51
51
|
[key: string]: {
|
|
52
52
|
[key: string]: tailwind_variants.ClassValue | {
|
|
53
|
-
icon?: tailwind_variants.ClassValue;
|
|
54
53
|
root?: tailwind_variants.ClassValue;
|
|
54
|
+
icon?: tailwind_variants.ClassValue;
|
|
55
55
|
indicator?: tailwind_variants.ClassValue;
|
|
56
56
|
};
|
|
57
57
|
};
|
package/dist/divider.js
CHANGED
|
@@ -19,7 +19,8 @@ var dividerTv = tv({
|
|
|
19
19
|
compoundVariants: [
|
|
20
20
|
{ orientation: "horizontal", inset: "inset", class: "ms-4" },
|
|
21
21
|
{ orientation: "horizontal", inset: "middle", class: "mx-4" },
|
|
22
|
-
|
|
22
|
+
// Logical block-start margin mirrors the VE recipe's `marginBlockStart`.
|
|
23
|
+
{ orientation: "vertical", inset: "inset", class: "[margin-block-start:1rem]" },
|
|
23
24
|
{ orientation: "vertical", inset: "middle", class: "my-4" }
|
|
24
25
|
],
|
|
25
26
|
defaultVariants: {
|
package/dist/divider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/divider.ts"],"names":[],"mappings":";;;;;AAWO,IAAM,YAAY,EAAA,CAAG;AAAA,EAC1B,IAAA,EAAM,mDAAA;AAAA,EACN,QAAA,EAAU;AAAA,IACR,WAAA,EAAa;AAAA,MACX,UAAA,EAAY,aAAA;AAAA,MACZ,QAAA,EAAU;AAAA,KACZ;AAAA,IACA,KAAA,EAAO;AAAA,MACL,IAAA,EAAM,EAAA;AAAA,MACN,KAAA,EAAO,EAAA;AAAA,MACP,MAAA,EAAQ;AAAA;AACV,GACF;AAAA,EACA,gBAAA,EAAkB;AAAA,IAChB,EAAE,WAAA,EAAa,YAAA,EAAc,KAAA,EAAO,OAAA,EAAS,OAAO,MAAA,EAAO;AAAA,IAC3D,EAAE,WAAA,EAAa,YAAA,EAAc,KAAA,EAAO,QAAA,EAAU,OAAO,MAAA,EAAO;AAAA,
|
|
1
|
+
{"version":3,"sources":["../src/divider.ts"],"names":[],"mappings":";;;;;AAWO,IAAM,YAAY,EAAA,CAAG;AAAA,EAC1B,IAAA,EAAM,mDAAA;AAAA,EACN,QAAA,EAAU;AAAA,IACR,WAAA,EAAa;AAAA,MACX,UAAA,EAAY,aAAA;AAAA,MACZ,QAAA,EAAU;AAAA,KACZ;AAAA,IACA,KAAA,EAAO;AAAA,MACL,IAAA,EAAM,EAAA;AAAA,MACN,KAAA,EAAO,EAAA;AAAA,MACP,MAAA,EAAQ;AAAA;AACV,GACF;AAAA,EACA,gBAAA,EAAkB;AAAA,IAChB,EAAE,WAAA,EAAa,YAAA,EAAc,KAAA,EAAO,OAAA,EAAS,OAAO,MAAA,EAAO;AAAA,IAC3D,EAAE,WAAA,EAAa,YAAA,EAAc,KAAA,EAAO,QAAA,EAAU,OAAO,MAAA,EAAO;AAAA;AAAA,IAE5D,EAAE,WAAA,EAAa,UAAA,EAAY,KAAA,EAAO,OAAA,EAAS,OAAO,2BAAA,EAA4B;AAAA,IAC9E,EAAE,WAAA,EAAa,UAAA,EAAY,KAAA,EAAO,QAAA,EAAU,OAAO,MAAA;AAAO,GAC5D;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,WAAA,EAAa,YAAA;AAAA,IACb,KAAA,EAAO;AAAA;AAEX,CAAC;AAEM,IAAM,OAAA,GAAU,aAAA,CAAc,CAAC,EAAE,KAAA,EAAO,WAAA,EAAY,KAAM,SAAA,CAAU,EAAE,KAAA,EAAO,WAAA,EAAa,CAAC","file":"divider.js","sourcesContent":["/**\n * divider.ts — tailwind-variants for the M3 Divider.\n *\n * 1dp `outline-variant` rule. `self-stretch` fills the cross axis in flex\n * layouts; horizontal is 1dp tall, vertical 1dp wide. The inset variants add a\n * 16dp leading (`inset`) or both-ends (`middle`) margin along the main axis.\n * Same DOM + `role=\"separator\"` as the VE build.\n */\nimport { createDivider } from '@m3-baseui/core';\nimport { tv } from 'tailwind-variants';\n\nexport const dividerTv = tv({\n base: 'shrink-0 self-stretch border-0 bg-outline-variant',\n variants: {\n orientation: {\n horizontal: 'h-px w-auto',\n vertical: 'w-px h-auto',\n },\n inset: {\n full: '',\n inset: '',\n middle: '',\n },\n },\n compoundVariants: [\n { orientation: 'horizontal', inset: 'inset', class: 'ms-4' },\n { orientation: 'horizontal', inset: 'middle', class: 'mx-4' },\n // Logical block-start margin mirrors the VE recipe's `marginBlockStart`.\n { orientation: 'vertical', inset: 'inset', class: '[margin-block-start:1rem]' },\n { orientation: 'vertical', inset: 'middle', class: 'my-4' },\n ],\n defaultVariants: {\n orientation: 'horizontal',\n inset: 'full',\n },\n});\n\nexport const Divider = createDivider(({ inset, orientation }) => dividerTv({ inset, orientation }));\nexport type { DividerProps, DividerInset, DividerOrientation } from '@m3-baseui/core';\n"]}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import * as _m3_baseui_core from '@m3-baseui/core';
|
|
2
|
+
export { FabMenuItemProps, FabMenuTriggerProps } from '@m3-baseui/core';
|
|
3
|
+
import * as react from 'react';
|
|
4
|
+
import * as _base_ui_react from '@base-ui/react';
|
|
5
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
6
|
+
import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
|
|
7
|
+
|
|
8
|
+
declare const fabMenuTv: tailwind_variants.TVReturnType<{
|
|
9
|
+
color: {
|
|
10
|
+
surface: {
|
|
11
|
+
item: string;
|
|
12
|
+
};
|
|
13
|
+
primary: {
|
|
14
|
+
item: string;
|
|
15
|
+
};
|
|
16
|
+
secondary: {
|
|
17
|
+
item: string;
|
|
18
|
+
};
|
|
19
|
+
tertiary: {
|
|
20
|
+
item: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}, {
|
|
24
|
+
popup: string[];
|
|
25
|
+
item: string[];
|
|
26
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<{
|
|
27
|
+
color: {
|
|
28
|
+
surface: {
|
|
29
|
+
item: string;
|
|
30
|
+
};
|
|
31
|
+
primary: {
|
|
32
|
+
item: string;
|
|
33
|
+
};
|
|
34
|
+
secondary: {
|
|
35
|
+
item: string;
|
|
36
|
+
};
|
|
37
|
+
tertiary: {
|
|
38
|
+
item: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
}, {
|
|
42
|
+
color: {
|
|
43
|
+
surface: {
|
|
44
|
+
item: string;
|
|
45
|
+
};
|
|
46
|
+
primary: {
|
|
47
|
+
item: string;
|
|
48
|
+
};
|
|
49
|
+
secondary: {
|
|
50
|
+
item: string;
|
|
51
|
+
};
|
|
52
|
+
tertiary: {
|
|
53
|
+
item: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
}>, {
|
|
57
|
+
color: {
|
|
58
|
+
surface: {
|
|
59
|
+
item: string;
|
|
60
|
+
};
|
|
61
|
+
primary: {
|
|
62
|
+
item: string;
|
|
63
|
+
};
|
|
64
|
+
secondary: {
|
|
65
|
+
item: string;
|
|
66
|
+
};
|
|
67
|
+
tertiary: {
|
|
68
|
+
item: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
}, {
|
|
72
|
+
popup: string[];
|
|
73
|
+
item: string[];
|
|
74
|
+
}, tailwind_variants.TVReturnType<{
|
|
75
|
+
color: {
|
|
76
|
+
surface: {
|
|
77
|
+
item: string;
|
|
78
|
+
};
|
|
79
|
+
primary: {
|
|
80
|
+
item: string;
|
|
81
|
+
};
|
|
82
|
+
secondary: {
|
|
83
|
+
item: string;
|
|
84
|
+
};
|
|
85
|
+
tertiary: {
|
|
86
|
+
item: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
}, {
|
|
90
|
+
popup: string[];
|
|
91
|
+
item: string[];
|
|
92
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<{
|
|
93
|
+
color: {
|
|
94
|
+
surface: {
|
|
95
|
+
item: string;
|
|
96
|
+
};
|
|
97
|
+
primary: {
|
|
98
|
+
item: string;
|
|
99
|
+
};
|
|
100
|
+
secondary: {
|
|
101
|
+
item: string;
|
|
102
|
+
};
|
|
103
|
+
tertiary: {
|
|
104
|
+
item: string;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
}, {
|
|
108
|
+
color: {
|
|
109
|
+
surface: {
|
|
110
|
+
item: string;
|
|
111
|
+
};
|
|
112
|
+
primary: {
|
|
113
|
+
item: string;
|
|
114
|
+
};
|
|
115
|
+
secondary: {
|
|
116
|
+
item: string;
|
|
117
|
+
};
|
|
118
|
+
tertiary: {
|
|
119
|
+
item: string;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
}>, unknown, unknown, undefined>>;
|
|
123
|
+
declare const FabMenu: {
|
|
124
|
+
Root: <Payload>(props: _base_ui_react.MenuRoot.Props<Payload>) => react.JSX.Element;
|
|
125
|
+
Trigger: react.ForwardRefExoticComponent<_m3_baseui_core.FabMenuTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
126
|
+
Portal: react.ForwardRefExoticComponent<Omit<_base_ui_react.ContextMenuPortalProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
127
|
+
Positioner: react.ForwardRefExoticComponent<Omit<_base_ui_react.ContextMenuPositionerProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
128
|
+
Popup: react.ForwardRefExoticComponent<Omit<Omit<_base_ui_react.ContextMenuPopupProps, "ref"> & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<unknown>>;
|
|
129
|
+
Item: react.ForwardRefExoticComponent<_m3_baseui_core.FabMenuItemProps & react.RefAttributes<HTMLDivElement>>;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export { FabMenu, fabMenuTv };
|
package/dist/fab-menu.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createFab, createFabMenu } from '@m3-baseui/core';
|
|
3
|
+
import { tv as tv$1 } from 'tailwind-variants';
|
|
4
|
+
|
|
5
|
+
// src/fab-menu.ts
|
|
6
|
+
var TYPESCALE = [
|
|
7
|
+
"display-large",
|
|
8
|
+
"display-medium",
|
|
9
|
+
"display-small",
|
|
10
|
+
"headline-large",
|
|
11
|
+
"headline-medium",
|
|
12
|
+
"headline-small",
|
|
13
|
+
"title-large",
|
|
14
|
+
"title-medium",
|
|
15
|
+
"title-small",
|
|
16
|
+
"body-large",
|
|
17
|
+
"body-medium",
|
|
18
|
+
"body-small",
|
|
19
|
+
"label-large",
|
|
20
|
+
"label-medium",
|
|
21
|
+
"label-small"
|
|
22
|
+
];
|
|
23
|
+
var tv = (options, config) => tv$1(options, {
|
|
24
|
+
...config,
|
|
25
|
+
twMergeConfig: {
|
|
26
|
+
extend: {
|
|
27
|
+
classGroups: {
|
|
28
|
+
"font-size": [{ text: [...TYPESCALE] }]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
var fabTv = tv$1({
|
|
34
|
+
base: [
|
|
35
|
+
"relative inline-flex items-center justify-center box-border overflow-hidden",
|
|
36
|
+
"border-0 cursor-pointer select-none outline-none",
|
|
37
|
+
"shadow-level3 hover:shadow-level4",
|
|
38
|
+
"transition-shadow duration-150 ease-standard",
|
|
39
|
+
"before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100",
|
|
40
|
+
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
41
|
+
"focus-visible:before:opacity-[var(--md-sys-state-focus)]",
|
|
42
|
+
"active:before:opacity-[var(--md-sys-state-pressed)]",
|
|
43
|
+
"data-[pressed]:before:opacity-[var(--md-sys-state-pressed)]",
|
|
44
|
+
// M3 discourages disabled FABs (material-web removed the state). When native
|
|
45
|
+
// disabled is used, apply the same container/label tokens as filled buttons.
|
|
46
|
+
"disabled:pointer-events-none disabled:shadow-none disabled:before:opacity-0",
|
|
47
|
+
"disabled:bg-on-surface/12 disabled:text-on-surface/38",
|
|
48
|
+
"data-[disabled]:pointer-events-none data-[disabled]:shadow-none data-[disabled]:before:opacity-0",
|
|
49
|
+
"data-[disabled]:bg-on-surface/12 data-[disabled]:text-on-surface/38"
|
|
50
|
+
],
|
|
51
|
+
variants: {
|
|
52
|
+
size: {
|
|
53
|
+
small: "size-10 rounded-medium [&_svg]:size-6",
|
|
54
|
+
regular: "size-14 rounded-large [&_svg]:size-6",
|
|
55
|
+
large: "size-24 rounded-extra-large [&_svg]:size-9",
|
|
56
|
+
extended: "h-14 min-w-20 px-4 gap-3 rounded-large text-label-large [&_svg]:size-6"
|
|
57
|
+
},
|
|
58
|
+
color: {
|
|
59
|
+
surface: "bg-surface-container-high text-primary",
|
|
60
|
+
primary: "bg-primary-container text-on-primary-container",
|
|
61
|
+
secondary: "bg-secondary-container text-on-secondary-container",
|
|
62
|
+
tertiary: "bg-tertiary-container text-on-tertiary-container"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
defaultVariants: {
|
|
66
|
+
size: "regular",
|
|
67
|
+
color: "surface"
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
createFab(({ size, color }) => fabTv({ size, color }));
|
|
71
|
+
|
|
72
|
+
// src/fab-menu.ts
|
|
73
|
+
var fabMenuTv = tv({
|
|
74
|
+
slots: {
|
|
75
|
+
popup: [
|
|
76
|
+
"flex flex-col items-end gap-2 bg-transparent outline-none",
|
|
77
|
+
"origin-[var(--transform-origin)] transition-[opacity,transform] duration-150 ease-standard",
|
|
78
|
+
"data-[starting-style]:opacity-0 data-[starting-style]:scale-95",
|
|
79
|
+
"data-[ending-style]:opacity-0"
|
|
80
|
+
],
|
|
81
|
+
item: [
|
|
82
|
+
"relative inline-flex items-center gap-3 h-14 px-4 overflow-hidden box-border",
|
|
83
|
+
"cursor-pointer select-none outline-none rounded-full text-label-large",
|
|
84
|
+
"shadow-level3 hover:shadow-level4 transition-shadow duration-150 ease-standard",
|
|
85
|
+
"before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100",
|
|
86
|
+
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
87
|
+
"data-[highlighted]:before:opacity-[var(--md-sys-state-hover)]",
|
|
88
|
+
"active:before:opacity-[var(--md-sys-state-pressed)]",
|
|
89
|
+
// M3 leading icon (24dp).
|
|
90
|
+
"[&_[data-slot=fab-menu-leading]]:inline-flex [&_[data-slot=fab-menu-leading]>svg]:size-6",
|
|
91
|
+
// M3 discourages disabled FABs; when used, match the filled-button tokens
|
|
92
|
+
// (per-token, not a blanket opacity) and suppress the state layer.
|
|
93
|
+
"data-[disabled]:pointer-events-none data-[disabled]:shadow-none data-[disabled]:before:opacity-0",
|
|
94
|
+
"data-[disabled]:bg-on-surface/12 data-[disabled]:text-on-surface/38"
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
variants: {
|
|
98
|
+
color: {
|
|
99
|
+
surface: { item: "bg-surface-container-high text-primary" },
|
|
100
|
+
primary: { item: "bg-primary-container text-on-primary-container" },
|
|
101
|
+
secondary: { item: "bg-secondary-container text-on-secondary-container" },
|
|
102
|
+
tertiary: { item: "bg-tertiary-container text-on-tertiary-container" }
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
defaultVariants: {
|
|
106
|
+
color: "primary"
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
var FabMenu = createFabMenu(({ size, color }) => fabTv({ size, color }), {
|
|
110
|
+
popup: fabMenuTv().popup(),
|
|
111
|
+
item: (color) => fabMenuTv({ color }).item()
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
export { FabMenu, fabMenuTv };
|
|
115
|
+
//# sourceMappingURL=fab-menu.js.map
|
|
116
|
+
//# sourceMappingURL=fab-menu.js.map
|