@m3-baseui/react-tailwind 1.0.4 → 1.2.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/button-group.d.ts +48 -0
- package/dist/button-group.js +58 -0
- package/dist/button-group.js.map +1 -0
- package/dist/carousel.d.ts +115 -0
- package/dist/carousel.js +63 -0
- package/dist/carousel.js.map +1 -0
- package/dist/chip.js +5 -2
- package/dist/chip.js.map +1 -1
- package/dist/date-picker.d.ts +188 -0
- package/dist/date-picker.js +151 -0
- package/dist/date-picker.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/icon-button.js +4 -1
- package/dist/icon-button.js.map +1 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +654 -11
- package/dist/index.js.map +1 -1
- package/dist/loading-indicator.d.ts +68 -0
- package/dist/loading-indicator.js +61 -0
- package/dist/loading-indicator.js.map +1 -0
- package/dist/menu.d.ts +5 -5
- package/dist/navigation-bar.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/search.d.ts +148 -0
- package/dist/search.js +105 -0
- package/dist/search.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/split-button.d.ts +201 -0
- package/dist/split-button.js +126 -0
- package/dist/split-button.js.map +1 -0
- package/dist/time-picker.d.ts +144 -0
- package/dist/time-picker.js +101 -0
- package/dist/time-picker.js.map +1 -0
- package/dist/toolbar.d.ts +73 -0
- package/dist/toolbar.js +55 -0
- package/dist/toolbar.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 +71 -1
- package/styles/preset.css +15 -0
|
@@ -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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;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,48 @@
|
|
|
1
|
+
import * as _base_ui_react from '@base-ui/react';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import * as _m3_baseui_core from '@m3-baseui/core';
|
|
4
|
+
export { ButtonGroupProps, ButtonGroupVariant } from '@m3-baseui/core';
|
|
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 buttonGroup: tailwind_variants.TVReturnType<{
|
|
9
|
+
variant: {
|
|
10
|
+
standard: string;
|
|
11
|
+
connected: string[];
|
|
12
|
+
};
|
|
13
|
+
}, undefined, "inline-flex items-center", tailwind_variants_dist_config_js.TVConfig<{
|
|
14
|
+
variant: {
|
|
15
|
+
standard: string;
|
|
16
|
+
connected: string[];
|
|
17
|
+
};
|
|
18
|
+
}, {
|
|
19
|
+
variant: {
|
|
20
|
+
standard: string;
|
|
21
|
+
connected: string[];
|
|
22
|
+
};
|
|
23
|
+
}>, {
|
|
24
|
+
variant: {
|
|
25
|
+
standard: string;
|
|
26
|
+
connected: string[];
|
|
27
|
+
};
|
|
28
|
+
}, undefined, tailwind_variants.TVReturnType<{
|
|
29
|
+
variant: {
|
|
30
|
+
standard: string;
|
|
31
|
+
connected: string[];
|
|
32
|
+
};
|
|
33
|
+
}, undefined, "inline-flex items-center", tailwind_variants_dist_config_js.TVConfig<{
|
|
34
|
+
variant: {
|
|
35
|
+
standard: string;
|
|
36
|
+
connected: string[];
|
|
37
|
+
};
|
|
38
|
+
}, {
|
|
39
|
+
variant: {
|
|
40
|
+
standard: string;
|
|
41
|
+
connected: string[];
|
|
42
|
+
};
|
|
43
|
+
}>, unknown, unknown, undefined>>;
|
|
44
|
+
declare const ButtonGroup: react.ForwardRefExoticComponent<_m3_baseui_core.ButtonGroupOwnProps & react.HTMLAttributes<HTMLDivElement> & {
|
|
45
|
+
render?: _base_ui_react.useRender.RenderProp;
|
|
46
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
47
|
+
|
|
48
|
+
export { ButtonGroup, buttonGroup };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createButtonGroup } from '@m3-baseui/core';
|
|
3
|
+
import { tv as tv$1 } from 'tailwind-variants';
|
|
4
|
+
|
|
5
|
+
// src/button-group.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/button-group.ts
|
|
35
|
+
var buttonGroup = tv({
|
|
36
|
+
base: "inline-flex items-center",
|
|
37
|
+
variants: {
|
|
38
|
+
variant: {
|
|
39
|
+
standard: "gap-2",
|
|
40
|
+
connected: [
|
|
41
|
+
"gap-0.5",
|
|
42
|
+
"[&>*:not(:first-child):not(:last-child)]:rounded-small",
|
|
43
|
+
// Guard against a lone child (it is both first *and* last) — only morph
|
|
44
|
+
// the inner-facing corner when there is actually a sibling to face.
|
|
45
|
+
"[&>*:first-child:not(:last-child)]:rounded-e-small",
|
|
46
|
+
"[&>*:last-child:not(:first-child)]:rounded-s-small"
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
defaultVariants: {
|
|
51
|
+
variant: "standard"
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
var ButtonGroup = createButtonGroup(({ variant }) => buttonGroup({ variant }));
|
|
55
|
+
|
|
56
|
+
export { ButtonGroup, buttonGroup };
|
|
57
|
+
//# sourceMappingURL=button-group.js.map
|
|
58
|
+
//# sourceMappingURL=button-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tv.ts","../src/button-group.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,cAAc,EAAA,CAAG;AAAA,EAC5B,IAAA,EAAM,0BAAA;AAAA,EACN,QAAA,EAAU;AAAA,IACR,OAAA,EAAS;AAAA,MACP,QAAA,EAAU,OAAA;AAAA,MACV,SAAA,EAAW;AAAA,QACT,SAAA;AAAA,QACA,wDAAA;AAAA;AAAA;AAAA,QAGA,oDAAA;AAAA,QACA;AAAA;AACF;AACF,GACF;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,OAAA,EAAS;AAAA;AAEb,CAAC;AAEM,IAAM,WAAA,GAAc,iBAAA,CAAkB,CAAC,EAAE,OAAA,OAAc,WAAA,CAAY,EAAE,OAAA,EAAS,CAAC","file":"button-group.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 * button-group.ts — tailwind-variants resolver for the M3 ButtonGroup.\n *\n * `standard` lays the buttons out with an 8dp gap; `connected` tightens the gap\n * to 2dp and reduces the children's inner-facing corners to the `small` shape\n * token so the row reads as one connected unit (outer corners stay full). The\n * child selectors carry enough specificity to win over each button's own\n * `rounded-full`. Same DOM + `role=\"group\"` as the VE build.\n */\nimport { createButtonGroup } from '@m3-baseui/core';\nimport { tv } from './tv';\n\nexport const buttonGroup = tv({\n base: 'inline-flex items-center',\n variants: {\n variant: {\n standard: 'gap-2',\n connected: [\n 'gap-0.5',\n '[&>*:not(:first-child):not(:last-child)]:rounded-small',\n // Guard against a lone child (it is both first *and* last) — only morph\n // the inner-facing corner when there is actually a sibling to face.\n '[&>*:first-child:not(:last-child)]:rounded-e-small',\n '[&>*:last-child:not(:first-child)]:rounded-s-small',\n ],\n },\n },\n defaultVariants: {\n variant: 'standard',\n },\n});\n\nexport const ButtonGroup = createButtonGroup(({ variant }) => buttonGroup({ variant }));\nexport type { ButtonGroupProps, ButtonGroupVariant } from '@m3-baseui/core';\n"]}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import * as _m3_baseui_core from '@m3-baseui/core';
|
|
2
|
+
export { CarouselVariant } from '@m3-baseui/core';
|
|
3
|
+
import * as react from 'react';
|
|
4
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
5
|
+
import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
|
|
6
|
+
|
|
7
|
+
declare const carouselTv: tailwind_variants.TVReturnType<{
|
|
8
|
+
variant: {
|
|
9
|
+
'multi-browse': {
|
|
10
|
+
item: string;
|
|
11
|
+
};
|
|
12
|
+
hero: {
|
|
13
|
+
item: string;
|
|
14
|
+
};
|
|
15
|
+
'full-screen': {
|
|
16
|
+
root: string;
|
|
17
|
+
item: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
}, {
|
|
21
|
+
root: string[];
|
|
22
|
+
item: string;
|
|
23
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<{
|
|
24
|
+
variant: {
|
|
25
|
+
'multi-browse': {
|
|
26
|
+
item: string;
|
|
27
|
+
};
|
|
28
|
+
hero: {
|
|
29
|
+
item: string;
|
|
30
|
+
};
|
|
31
|
+
'full-screen': {
|
|
32
|
+
root: string;
|
|
33
|
+
item: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
}, {
|
|
37
|
+
variant: {
|
|
38
|
+
'multi-browse': {
|
|
39
|
+
item: string;
|
|
40
|
+
};
|
|
41
|
+
hero: {
|
|
42
|
+
item: string;
|
|
43
|
+
};
|
|
44
|
+
'full-screen': {
|
|
45
|
+
root: string;
|
|
46
|
+
item: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
}>, {
|
|
50
|
+
variant: {
|
|
51
|
+
'multi-browse': {
|
|
52
|
+
item: string;
|
|
53
|
+
};
|
|
54
|
+
hero: {
|
|
55
|
+
item: string;
|
|
56
|
+
};
|
|
57
|
+
'full-screen': {
|
|
58
|
+
root: string;
|
|
59
|
+
item: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
}, {
|
|
63
|
+
root: string[];
|
|
64
|
+
item: string;
|
|
65
|
+
}, tailwind_variants.TVReturnType<{
|
|
66
|
+
variant: {
|
|
67
|
+
'multi-browse': {
|
|
68
|
+
item: string;
|
|
69
|
+
};
|
|
70
|
+
hero: {
|
|
71
|
+
item: string;
|
|
72
|
+
};
|
|
73
|
+
'full-screen': {
|
|
74
|
+
root: string;
|
|
75
|
+
item: string;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
}, {
|
|
79
|
+
root: string[];
|
|
80
|
+
item: string;
|
|
81
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<{
|
|
82
|
+
variant: {
|
|
83
|
+
'multi-browse': {
|
|
84
|
+
item: string;
|
|
85
|
+
};
|
|
86
|
+
hero: {
|
|
87
|
+
item: string;
|
|
88
|
+
};
|
|
89
|
+
'full-screen': {
|
|
90
|
+
root: string;
|
|
91
|
+
item: string;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
}, {
|
|
95
|
+
variant: {
|
|
96
|
+
'multi-browse': {
|
|
97
|
+
item: string;
|
|
98
|
+
};
|
|
99
|
+
hero: {
|
|
100
|
+
item: string;
|
|
101
|
+
};
|
|
102
|
+
'full-screen': {
|
|
103
|
+
root: string;
|
|
104
|
+
item: string;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
}>, unknown, unknown, undefined>>;
|
|
108
|
+
declare const Carousel: {
|
|
109
|
+
Root: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLDivElement> & {
|
|
110
|
+
variant?: _m3_baseui_core.CarouselVariant;
|
|
111
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
112
|
+
Item: react.ForwardRefExoticComponent<react.HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export { Carousel, carouselTv };
|
package/dist/carousel.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createCarousel } from '@m3-baseui/core';
|
|
3
|
+
import { tv as tv$1 } from 'tailwind-variants';
|
|
4
|
+
|
|
5
|
+
// src/carousel.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/carousel.ts
|
|
35
|
+
var carouselTv = tv({
|
|
36
|
+
slots: {
|
|
37
|
+
root: [
|
|
38
|
+
"flex gap-2 overflow-x-auto snap-x snap-mandatory scroll-smooth",
|
|
39
|
+
"[scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
|
|
40
|
+
],
|
|
41
|
+
item: "snap-start shrink-0 overflow-hidden rounded-large"
|
|
42
|
+
},
|
|
43
|
+
variants: {
|
|
44
|
+
variant: {
|
|
45
|
+
"multi-browse": { item: "w-40 h-56" },
|
|
46
|
+
hero: { item: "w-72 h-56 snap-center" },
|
|
47
|
+
"full-screen": {
|
|
48
|
+
// gap-0: full-screen slides fill the viewport with no inter-slide gap.
|
|
49
|
+
root: "flex-col gap-0 overflow-x-hidden overflow-y-auto snap-y h-full",
|
|
50
|
+
item: "w-full h-full snap-center"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
defaultVariants: { variant: "multi-browse" }
|
|
55
|
+
});
|
|
56
|
+
var Carousel = createCarousel((variant) => {
|
|
57
|
+
const s = carouselTv({ variant });
|
|
58
|
+
return { root: s.root(), item: s.item() };
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export { Carousel, carouselTv };
|
|
62
|
+
//# sourceMappingURL=carousel.js.map
|
|
63
|
+
//# sourceMappingURL=carousel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tv.ts","../src/carousel.ts"],"names":["baseTv"],"mappings":";;;;;AAeA,IAAM,SAAA,GAAY;AAAA,EAChB,eAAA;AAAA,EACA,gBAAA;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v.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 * carousel.ts — tailwind-variants slots for the M3 Carousel.\n *\n * Root is a scroll-snap scroller (hidden scrollbar); items are snap-aligned,\n * `large`-radius cells. `multi-browse` and `hero` scroll horizontally (hero\n * items are wider and centre-snap); `full-screen` stacks full-size items\n * vertically. Same DOM as the VE build.\n */\nimport { createCarousel } from '@m3-baseui/core';\nimport { tv } from './tv';\n\nexport const carouselTv = tv({\n slots: {\n root: [\n 'flex gap-2 overflow-x-auto snap-x snap-mandatory scroll-smooth',\n '[scrollbar-width:none] [&::-webkit-scrollbar]:hidden',\n ],\n item: 'snap-start shrink-0 overflow-hidden rounded-large',\n },\n variants: {\n variant: {\n 'multi-browse': { item: 'w-40 h-56' },\n hero: { item: 'w-72 h-56 snap-center' },\n 'full-screen': {\n // gap-0: full-screen slides fill the viewport with no inter-slide gap.\n root: 'flex-col gap-0 overflow-x-hidden overflow-y-auto snap-y h-full',\n item: 'w-full h-full snap-center',\n },\n },\n },\n defaultVariants: { variant: 'multi-browse' },\n});\n\nexport const Carousel = createCarousel((variant) => {\n const s = carouselTv({ variant });\n return { root: s.root(), item: s.item() };\n});\nexport type { CarouselVariant } from '@m3-baseui/core';\n"]}
|
package/dist/chip.js
CHANGED
|
@@ -7,9 +7,12 @@ var chipTv = tv({
|
|
|
7
7
|
slots: {
|
|
8
8
|
root: [
|
|
9
9
|
"group relative inline-flex items-center justify-center gap-2 box-border",
|
|
10
|
-
|
|
10
|
+
// No `overflow-hidden`: it would clip the 48dp touch target. The state
|
|
11
|
+
// layer is rounded to match instead (before:rounded-[inherit]); the ripple
|
|
12
|
+
// self-clips.
|
|
13
|
+
"h-8 px-4 rounded-[8px] select-none border bg-transparent text-label-large",
|
|
11
14
|
"transition-colors duration-150 ease-standard",
|
|
12
|
-
"before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100",
|
|
15
|
+
"before:absolute before:inset-0 before:rounded-[inherit] before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100",
|
|
13
16
|
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
14
17
|
"focus-visible:before:opacity-[var(--md-sys-state-focus)]",
|
|
15
18
|
"active:before:opacity-[var(--md-sys-state-pressed)]",
|
package/dist/chip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/chip.ts"],"names":[],"mappings":";;;;;AAUO,IAAM,SAAS,EAAA,CAAG;AAAA,EACvB,KAAA,EAAO;AAAA,IACL,IAAA,EAAM;AAAA,MACJ,yEAAA;AAAA,
|
|
1
|
+
{"version":3,"sources":["../src/chip.ts"],"names":[],"mappings":";;;;;AAUO,IAAM,SAAS,EAAA,CAAG;AAAA,EACvB,KAAA,EAAO;AAAA,IACL,IAAA,EAAM;AAAA,MACJ,yEAAA;AAAA;AAAA;AAAA;AAAA,MAIA,2EAAA;AAAA,MACA,8CAAA;AAAA,MACA,qKAAA;AAAA,MACA,kDAAA;AAAA,MACA,0DA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,EAAE;AACpF,CAAC","file":"chip.js","sourcesContent":["/**\n * chip.ts — tailwind-variants slots for the M3 Chip.\n *\n * 32dp tall, 8dp corners, label-large. The state layer reacts to hover/focus/\n * press (not the persistent toggle `data-pressed`, which a filter chip uses for\n * its selected fill). Emits the same DOM + ripple as the VE build.\n */\nimport { createChip } from '@m3-baseui/core';\nimport { tv } from 'tailwind-variants';\n\nexport const chipTv = tv({\n slots: {\n root: [\n 'group relative inline-flex items-center justify-center gap-2 box-border',\n // No `overflow-hidden`: it would clip the 48dp touch target. The state\n // layer is rounded to match instead (before:rounded-[inherit]); the ripple\n // self-clips.\n 'h-8 px-4 rounded-[8px] select-none border bg-transparent text-label-large',\n 'transition-colors duration-150 ease-standard',\n 'before:absolute before:inset-0 before:rounded-[inherit] 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: label on-surface/38, outline on-surface/12; no state layer.\n 'data-[disabled]:pointer-events-none data-[disabled]:before:opacity-0',\n 'disabled:pointer-events-none disabled:before:opacity-0',\n 'data-[disabled]:text-on-surface/38 data-[disabled]:border-on-surface/12',\n 'disabled:text-on-surface/38 disabled:border-on-surface/12',\n ],\n remove: [\n 'inline-flex items-center justify-center shrink-0 size-[18px] -mr-1 ml-1 rounded-full border-0 bg-transparent',\n 'text-on-surface-variant cursor-pointer hover:opacity-80',\n ],\n check: [\n 'inline-flex items-center justify-center shrink-0 h-[18px] w-0 -ml-2 opacity-0 overflow-hidden pointer-events-none',\n 'transition-all duration-150 ease-standard',\n 'group-data-[pressed]:w-[18px] group-data-[pressed]:ml-0 group-data-[pressed]:opacity-100',\n ],\n // M3 leading avatar: 24dp circle; negative margin trims the leading padding to 4dp.\n avatar: [\n 'inline-flex items-center justify-center shrink-0 size-6 -ml-3 rounded-full overflow-hidden',\n 'bg-primary-container text-on-primary-container',\n '[&>img]:size-full [&>img]:object-cover',\n ],\n },\n variants: {\n variant: {\n assist: { root: 'border-outline text-on-surface cursor-pointer' },\n suggestion: { root: 'border-outline text-on-surface-variant cursor-pointer' },\n input: { root: 'border-outline text-on-surface-variant cursor-default pr-2' },\n filter: {\n root: [\n 'border-outline text-on-surface-variant cursor-pointer',\n 'data-[pressed]:bg-secondary-container data-[pressed]:text-on-secondary-container data-[pressed]:border-transparent',\n // M3 disabled + selected: faint on-surface/12 container\n 'data-[pressed]:data-[disabled]:bg-on-surface/12 data-[pressed]:disabled:bg-on-surface/12',\n ],\n },\n },\n // M3 elevated: filled surface-container-low + elevation level1→level2 on hover,\n // no outline. Disabled drops the shadow.\n elevated: {\n true: {\n root: [\n 'bg-surface-container-low border-transparent shadow-level1',\n 'hover:shadow-level2 active:shadow-level1',\n 'disabled:shadow-none data-[disabled]:shadow-none',\n ],\n },\n },\n },\n defaultVariants: {\n variant: 'assist',\n },\n});\n\nexport const Chip = createChip(({ variant, elevated }) => {\n const c = chipTv({ variant, elevated });\n return { root: c.root(), remove: c.remove(), check: c.check(), avatar: c.avatar() };\n});\nexport type { ChipProps, ChipVariant } from '@m3-baseui/core';\n"]}
|