@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,68 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createTopAppBar } from '@m3-baseui/core';
|
|
3
|
+
import { tv as tv$1 } from 'tailwind-variants';
|
|
4
|
+
|
|
5
|
+
// src/top-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/top-app-bar.ts
|
|
35
|
+
var topAppBarTv = tv({
|
|
36
|
+
slots: {
|
|
37
|
+
root: "flex flex-col w-full box-border h-16 bg-surface text-on-surface",
|
|
38
|
+
row: "flex items-center gap-1 h-16 px-1",
|
|
39
|
+
leading: "flex items-center shrink-0 text-on-surface [&_svg]:size-6",
|
|
40
|
+
headline: "min-w-0 truncate text-on-surface",
|
|
41
|
+
trailing: "flex items-center gap-1 shrink-0 text-on-surface-variant [&_svg]:size-6"
|
|
42
|
+
},
|
|
43
|
+
variants: {
|
|
44
|
+
variant: {
|
|
45
|
+
small: { headline: "flex-1 px-3 text-title-large" },
|
|
46
|
+
center: { headline: "flex-1 px-3 text-center text-title-large" },
|
|
47
|
+
medium: { root: "h-28", headline: "px-4 pb-6 text-headline-small" },
|
|
48
|
+
large: { root: "h-38", headline: "px-4 pb-7 text-headline-medium" }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
defaultVariants: {
|
|
52
|
+
variant: "small"
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
var TopAppBar = createTopAppBar((args) => {
|
|
56
|
+
const s = topAppBarTv({ variant: args.variant });
|
|
57
|
+
return {
|
|
58
|
+
root: s.root(),
|
|
59
|
+
row: s.row(),
|
|
60
|
+
leading: s.leading(),
|
|
61
|
+
headline: s.headline(),
|
|
62
|
+
trailing: s.trailing()
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
export { TopAppBar, topAppBarTv };
|
|
67
|
+
//# sourceMappingURL=top-app-bar.js.map
|
|
68
|
+
//# sourceMappingURL=top-app-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AAAA,IACf,OAAA,EAAS;AAAA;AAEb,CAAC;AAEM,IAAM,SAAA,GAAY,eAAA,CAAgB,CAAC,IAAA,KAAS;AACjD,EAAA,MAAM,IAAI,WAAA,CAAY,EAAE,OAAA,EAAS,IAAA,CAAK,SAAS,CAAA;AAC/C,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,EAAE,IAAA,EAAK;AAAA,IACb,GAAA,EAAK,EAAE,GAAA,EAAI;AAAA,IACX,OAAA,EAAS,EAAE,OAAA,EAAQ;AAAA,IACnB,QAAA,EAAU,EAAE,QAAA,EAAS;AAAA,IACrB,QAAA,EAAU,EAAE,QAAA;AAAS,GACvB;AACF,CAAC","file":"top-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 * top-app-bar.ts — tailwind-variants slots for the M3 TopAppBar.\n *\n * A `surface` bar. `small`/`center` are a single 64dp row (title-large, left vs.\n * centered); `medium`/`large` add a second headline line (headline-small /\n * headline-medium) below a 64dp action row, for 112dp / 152dp totals. The active\n * variant is exposed as `data-variant`. Same DOM as the VE build.\n */\nimport { createTopAppBar } from '@m3-baseui/core';\nimport { tv } from './tv';\n\nexport const topAppBarTv = tv({\n slots: {\n root: 'flex flex-col w-full box-border h-16 bg-surface text-on-surface',\n row: 'flex items-center gap-1 h-16 px-1',\n leading: 'flex items-center shrink-0 text-on-surface [&_svg]:size-6',\n headline: 'min-w-0 truncate text-on-surface',\n trailing: 'flex items-center gap-1 shrink-0 text-on-surface-variant [&_svg]:size-6',\n },\n variants: {\n variant: {\n small: { headline: 'flex-1 px-3 text-title-large' },\n center: { headline: 'flex-1 px-3 text-center text-title-large' },\n medium: { root: 'h-28', headline: 'px-4 pb-6 text-headline-small' },\n large: { root: 'h-38', headline: 'px-4 pb-7 text-headline-medium' },\n },\n },\n defaultVariants: {\n variant: 'small',\n },\n});\n\nexport const TopAppBar = createTopAppBar((args) => {\n const s = topAppBarTv({ variant: args.variant });\n return {\n root: s.root(),\n row: s.row(),\n leading: s.leading(),\n headline: s.headline(),\n trailing: s.trailing(),\n };\n});\nexport type { TopAppBarProps, TopAppBarVariant } from '@m3-baseui/core';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m3-baseui/react-tailwind",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "M3 components implemented with tailwind-variants over the shared @m3-baseui/core factories. Ships the Tailwind v4 @theme preset.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -97,6 +97,11 @@
|
|
|
97
97
|
"types": "./dist/fab.d.ts",
|
|
98
98
|
"default": "./dist/fab.js"
|
|
99
99
|
},
|
|
100
|
+
"./fab-menu": {
|
|
101
|
+
"@m3/source": "./src/fab-menu.ts",
|
|
102
|
+
"types": "./dist/fab-menu.d.ts",
|
|
103
|
+
"default": "./dist/fab-menu.js"
|
|
104
|
+
},
|
|
100
105
|
"./divider": {
|
|
101
106
|
"@m3/source": "./src/divider.ts",
|
|
102
107
|
"types": "./dist/divider.d.ts",
|
|
@@ -142,6 +147,31 @@
|
|
|
142
147
|
"types": "./dist/navigation-drawer.d.ts",
|
|
143
148
|
"default": "./dist/navigation-drawer.js"
|
|
144
149
|
},
|
|
150
|
+
"./top-app-bar": {
|
|
151
|
+
"@m3/source": "./src/top-app-bar.ts",
|
|
152
|
+
"types": "./dist/top-app-bar.d.ts",
|
|
153
|
+
"default": "./dist/top-app-bar.js"
|
|
154
|
+
},
|
|
155
|
+
"./bottom-app-bar": {
|
|
156
|
+
"@m3/source": "./src/bottom-app-bar.ts",
|
|
157
|
+
"types": "./dist/bottom-app-bar.d.ts",
|
|
158
|
+
"default": "./dist/bottom-app-bar.js"
|
|
159
|
+
},
|
|
160
|
+
"./navigation-rail": {
|
|
161
|
+
"@m3/source": "./src/navigation-rail.ts",
|
|
162
|
+
"types": "./dist/navigation-rail.d.ts",
|
|
163
|
+
"default": "./dist/navigation-rail.js"
|
|
164
|
+
},
|
|
165
|
+
"./bottom-sheet": {
|
|
166
|
+
"@m3/source": "./src/bottom-sheet.ts",
|
|
167
|
+
"types": "./dist/bottom-sheet.d.ts",
|
|
168
|
+
"default": "./dist/bottom-sheet.js"
|
|
169
|
+
},
|
|
170
|
+
"./side-sheet": {
|
|
171
|
+
"@m3/source": "./src/side-sheet.ts",
|
|
172
|
+
"types": "./dist/side-sheet.d.ts",
|
|
173
|
+
"default": "./dist/side-sheet.js"
|
|
174
|
+
},
|
|
145
175
|
"./preset.css": "./styles/preset.css",
|
|
146
176
|
"./tokens.css": "./styles/tokens.css",
|
|
147
177
|
"./theme.css": "./styles/theme.css"
|