@m3-baseui/react-tailwind 1.0.4 → 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/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 +229 -8
- package/dist/index.js.map +1 -1
- package/dist/menu.d.ts +5 -5
- 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/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/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
|
@@ -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"]}
|
|
@@ -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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tv.ts","../src/fab.ts","../src/fab-menu.ts"],"names":["baseTv","tv"],"mappings":"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","file":"fab-menu.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 * fab.ts — tailwind-variants for the M3 FAB.\n *\n * Four sizes + four container colors, elevation level3 (level4 on hover) and a\n * currentColor state-layer `::before`. The pointer ripple is added by the\n * factory. Same DOM as the VE build.\n */\nimport { createFab } from '@m3-baseui/core';\nimport { tv } from 'tailwind-variants';\n\nexport const fabTv = tv({\n base: [\n 'relative inline-flex items-center justify-center box-border overflow-hidden',\n 'border-0 cursor-pointer select-none outline-none',\n 'shadow-level3 hover:shadow-level4',\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 'data-[pressed]:before:opacity-[var(--md-sys-state-pressed)]',\n // M3 discourages disabled FABs (material-web removed the state). When native\n // disabled is used, apply the same container/label tokens as filled buttons.\n 'disabled:pointer-events-none disabled:shadow-none disabled:before:opacity-0',\n 'disabled:bg-on-surface/12 disabled:text-on-surface/38',\n 'data-[disabled]:pointer-events-none data-[disabled]:shadow-none data-[disabled]:before:opacity-0',\n 'data-[disabled]:bg-on-surface/12 data-[disabled]:text-on-surface/38',\n ],\n variants: {\n size: {\n small: 'size-10 rounded-medium [&_svg]:size-6',\n regular: 'size-14 rounded-large [&_svg]:size-6',\n large: 'size-24 rounded-extra-large [&_svg]:size-9',\n extended: 'h-14 min-w-20 px-4 gap-3 rounded-large text-label-large [&_svg]:size-6',\n },\n color: {\n surface: 'bg-surface-container-high text-primary',\n primary: 'bg-primary-container text-on-primary-container',\n secondary: 'bg-secondary-container text-on-secondary-container',\n tertiary: 'bg-tertiary-container text-on-tertiary-container',\n },\n },\n defaultVariants: {\n size: 'regular',\n color: 'surface',\n },\n});\n\nexport const Fab = createFab(({ size, color }) => fabTv({ size, color }));\nexport type { FabProps, FabSize, FabColor } from '@m3-baseui/core';\n","/**\n * fab-menu.ts — tailwind-variants for the M3 FAB menu.\n *\n * The popup stacks the actions in a right-aligned column with the M3 menu\n * enter/exit motion; each item is a 56dp full-corner pill (elevation level3,\n * level4 on hover) with a currentColor state-layer `::before`, a 24dp leading\n * icon slot and a label-large label. The trigger reuses the FAB resolver. Same\n * DOM + ripple as the VE build.\n */\nimport { createFabMenu } from '@m3-baseui/core';\nimport { tv } from './tv';\nimport { fabTv } from './fab';\n\nexport const fabMenuTv = tv({\n slots: {\n popup: [\n 'flex flex-col items-end gap-2 bg-transparent outline-none',\n 'origin-[var(--transform-origin)] transition-[opacity,transform] duration-150 ease-standard',\n 'data-[starting-style]:opacity-0 data-[starting-style]:scale-95',\n 'data-[ending-style]:opacity-0',\n ],\n item: [\n 'relative inline-flex items-center gap-3 h-14 px-4 overflow-hidden box-border',\n 'cursor-pointer select-none outline-none rounded-full text-label-large',\n 'shadow-level3 hover:shadow-level4 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 'data-[highlighted]:before:opacity-[var(--md-sys-state-hover)]',\n 'active:before:opacity-[var(--md-sys-state-pressed)]',\n // M3 leading icon (24dp).\n '[&_[data-slot=fab-menu-leading]]:inline-flex [&_[data-slot=fab-menu-leading]>svg]:size-6',\n // M3 discourages disabled FABs; when used, match the filled-button tokens\n // (per-token, not a blanket opacity) and suppress the state layer.\n 'data-[disabled]:pointer-events-none data-[disabled]:shadow-none data-[disabled]:before:opacity-0',\n 'data-[disabled]:bg-on-surface/12 data-[disabled]:text-on-surface/38',\n ],\n },\n variants: {\n color: {\n surface: { item: 'bg-surface-container-high text-primary' },\n primary: { item: 'bg-primary-container text-on-primary-container' },\n secondary: { item: 'bg-secondary-container text-on-secondary-container' },\n tertiary: { item: 'bg-tertiary-container text-on-tertiary-container' },\n },\n },\n defaultVariants: {\n color: 'primary',\n },\n});\n\nexport const FabMenu = createFabMenu(({ size, color }) => fabTv({ size, color }), {\n popup: fabMenuTv().popup(),\n item: (color) => fabMenuTv({ color }).item(),\n});\n\nexport type { FabMenuTriggerProps, FabMenuItemProps } from '@m3-baseui/core';\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export { Select, selectTv } from './select.js';
|
|
|
13
13
|
export { TextField, textFieldTv } from './textfield.js';
|
|
14
14
|
export { NavigationBar, navigationBarTv } from './navigation-bar.js';
|
|
15
15
|
export { Fab, fabTv } from './fab.js';
|
|
16
|
+
export { FabMenu, fabMenuTv } from './fab-menu.js';
|
|
16
17
|
export { Divider, dividerTv } from './divider.js';
|
|
17
18
|
export { Progress, circularTv, linearTv } from './progress.js';
|
|
18
19
|
export { List, listTv } from './list.js';
|
|
@@ -22,7 +23,12 @@ export { Badge, badgeTv } from './badge.js';
|
|
|
22
23
|
export { Card, cardTv } from './card.js';
|
|
23
24
|
export { SegmentedButton, segmentedButtonTv } from './segmented-button.js';
|
|
24
25
|
export { NavigationDrawer, navigationDrawerTv } from './navigation-drawer.js';
|
|
25
|
-
export {
|
|
26
|
+
export { TopAppBar, topAppBarTv } from './top-app-bar.js';
|
|
27
|
+
export { BottomAppBar, bottomAppBarTv } from './bottom-app-bar.js';
|
|
28
|
+
export { NavigationRail, navigationRailTv } from './navigation-rail.js';
|
|
29
|
+
export { BottomSheet, bottomSheetTv } from './bottom-sheet.js';
|
|
30
|
+
export { SideSheet, sideSheetTv } from './side-sheet.js';
|
|
31
|
+
export { BadgeProps, BadgeSize, BottomAppBarProps, BottomSheetVariant, ButtonProps, ButtonVariant, CardProps, CardVariant, ChipProps, ChipVariant, CircularProgressProps, ContrastLevel, DividerInset, DividerOrientation, DividerProps, FabColor, FabMenuItemProps, FabMenuTriggerProps, FabProps, FabSize, IconButtonProps, IconButtonVariant, ItemProps, LinearProgressProps, ListItemLines, ListItemProps, NavigationDrawerVariant, Ripple, SchemeVariant, SideSheetSide, SideSheetVariant, TabsVariant, TextFieldProps, TextFieldVariant, ThemeMode, ThemeProvider, ThemeProviderProps, TopAppBarProps, TopAppBarVariant, applyScheme, generateScheme, schemeToCssText, useSnackbar, useTheme } from '@m3-baseui/core';
|
|
26
32
|
import '@base-ui/react';
|
|
27
33
|
import 'react';
|
|
28
34
|
import 'tailwind-variants';
|