@m3-baseui/react-tailwind 1.1.0 → 1.3.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/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/checkbox.js +5 -0
- package/dist/checkbox.js.map +1 -1
- package/dist/chip.d.ts +31 -0
- package/dist/chip.js +34 -7
- 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/icon-button.js +4 -1
- package/dist/icon-button.js.map +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +501 -29
- 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/navigation-bar.d.ts +5 -5
- package/dist/navigation-rail.d.ts +5 -5
- package/dist/radio.js +8 -3
- package/dist/radio.js.map +1 -1
- 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/slider.d.ts +33 -6
- package/dist/slider.js +16 -3
- package/dist/slider.js.map +1 -1
- 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/switch.js +4 -1
- package/dist/switch.js.map +1 -1
- 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/package.json +41 -1
- package/styles/preset.css +15 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import * as _m3_baseui_core from '@m3-baseui/core';
|
|
2
|
+
export { TimePickerVariant, TimeValue } from '@m3-baseui/core';
|
|
3
|
+
import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
|
|
4
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
5
|
+
|
|
6
|
+
declare const timePickerTv: tailwind_variants.TVReturnType<{
|
|
7
|
+
[key: string]: {
|
|
8
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
9
|
+
root?: tailwind_variants.ClassValue;
|
|
10
|
+
header?: tailwind_variants.ClassValue;
|
|
11
|
+
dial?: tailwind_variants.ClassValue;
|
|
12
|
+
field?: tailwind_variants.ClassValue;
|
|
13
|
+
colon?: tailwind_variants.ClassValue;
|
|
14
|
+
periods?: tailwind_variants.ClassValue;
|
|
15
|
+
period?: tailwind_variants.ClassValue;
|
|
16
|
+
dialNumber?: tailwind_variants.ClassValue;
|
|
17
|
+
dialHand?: tailwind_variants.ClassValue;
|
|
18
|
+
dialCenter?: tailwind_variants.ClassValue;
|
|
19
|
+
inputs?: tailwind_variants.ClassValue;
|
|
20
|
+
inputBox?: tailwind_variants.ClassValue;
|
|
21
|
+
inputCaption?: tailwind_variants.ClassValue;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
} | {
|
|
25
|
+
[x: string]: {
|
|
26
|
+
[x: string]: tailwind_variants.ClassValue | {
|
|
27
|
+
root?: tailwind_variants.ClassValue;
|
|
28
|
+
header?: tailwind_variants.ClassValue;
|
|
29
|
+
dial?: tailwind_variants.ClassValue;
|
|
30
|
+
field?: tailwind_variants.ClassValue;
|
|
31
|
+
colon?: tailwind_variants.ClassValue;
|
|
32
|
+
periods?: tailwind_variants.ClassValue;
|
|
33
|
+
period?: tailwind_variants.ClassValue;
|
|
34
|
+
dialNumber?: tailwind_variants.ClassValue;
|
|
35
|
+
dialHand?: tailwind_variants.ClassValue;
|
|
36
|
+
dialCenter?: tailwind_variants.ClassValue;
|
|
37
|
+
inputs?: tailwind_variants.ClassValue;
|
|
38
|
+
inputBox?: tailwind_variants.ClassValue;
|
|
39
|
+
inputCaption?: tailwind_variants.ClassValue;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
} | {}, {
|
|
43
|
+
root: string[];
|
|
44
|
+
header: string[];
|
|
45
|
+
field: string[];
|
|
46
|
+
colon: string[];
|
|
47
|
+
periods: string[];
|
|
48
|
+
period: string[];
|
|
49
|
+
dial: string[];
|
|
50
|
+
dialNumber: string[];
|
|
51
|
+
dialHand: string[];
|
|
52
|
+
dialCenter: string[];
|
|
53
|
+
inputs: string[];
|
|
54
|
+
inputBox: string[];
|
|
55
|
+
inputCaption: string[];
|
|
56
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<unknown, {
|
|
57
|
+
[key: string]: {
|
|
58
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
59
|
+
root?: tailwind_variants.ClassValue;
|
|
60
|
+
header?: tailwind_variants.ClassValue;
|
|
61
|
+
dial?: tailwind_variants.ClassValue;
|
|
62
|
+
field?: tailwind_variants.ClassValue;
|
|
63
|
+
colon?: tailwind_variants.ClassValue;
|
|
64
|
+
periods?: tailwind_variants.ClassValue;
|
|
65
|
+
period?: tailwind_variants.ClassValue;
|
|
66
|
+
dialNumber?: tailwind_variants.ClassValue;
|
|
67
|
+
dialHand?: tailwind_variants.ClassValue;
|
|
68
|
+
dialCenter?: tailwind_variants.ClassValue;
|
|
69
|
+
inputs?: tailwind_variants.ClassValue;
|
|
70
|
+
inputBox?: tailwind_variants.ClassValue;
|
|
71
|
+
inputCaption?: tailwind_variants.ClassValue;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
} | {}>, {
|
|
75
|
+
[key: string]: {
|
|
76
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
77
|
+
root?: tailwind_variants.ClassValue;
|
|
78
|
+
header?: tailwind_variants.ClassValue;
|
|
79
|
+
dial?: tailwind_variants.ClassValue;
|
|
80
|
+
field?: tailwind_variants.ClassValue;
|
|
81
|
+
colon?: tailwind_variants.ClassValue;
|
|
82
|
+
periods?: tailwind_variants.ClassValue;
|
|
83
|
+
period?: tailwind_variants.ClassValue;
|
|
84
|
+
dialNumber?: tailwind_variants.ClassValue;
|
|
85
|
+
dialHand?: tailwind_variants.ClassValue;
|
|
86
|
+
dialCenter?: tailwind_variants.ClassValue;
|
|
87
|
+
inputs?: tailwind_variants.ClassValue;
|
|
88
|
+
inputBox?: tailwind_variants.ClassValue;
|
|
89
|
+
inputCaption?: tailwind_variants.ClassValue;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
} | {}, {
|
|
93
|
+
root: string[];
|
|
94
|
+
header: string[];
|
|
95
|
+
field: string[];
|
|
96
|
+
colon: string[];
|
|
97
|
+
periods: string[];
|
|
98
|
+
period: string[];
|
|
99
|
+
dial: string[];
|
|
100
|
+
dialNumber: string[];
|
|
101
|
+
dialHand: string[];
|
|
102
|
+
dialCenter: string[];
|
|
103
|
+
inputs: string[];
|
|
104
|
+
inputBox: string[];
|
|
105
|
+
inputCaption: string[];
|
|
106
|
+
}, tailwind_variants.TVReturnType<unknown, {
|
|
107
|
+
root: string[];
|
|
108
|
+
header: string[];
|
|
109
|
+
field: string[];
|
|
110
|
+
colon: string[];
|
|
111
|
+
periods: string[];
|
|
112
|
+
period: string[];
|
|
113
|
+
dial: string[];
|
|
114
|
+
dialNumber: string[];
|
|
115
|
+
dialHand: string[];
|
|
116
|
+
dialCenter: string[];
|
|
117
|
+
inputs: string[];
|
|
118
|
+
inputBox: string[];
|
|
119
|
+
inputCaption: string[];
|
|
120
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<unknown, {
|
|
121
|
+
[key: string]: {
|
|
122
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
123
|
+
root?: tailwind_variants.ClassValue;
|
|
124
|
+
header?: tailwind_variants.ClassValue;
|
|
125
|
+
dial?: tailwind_variants.ClassValue;
|
|
126
|
+
field?: tailwind_variants.ClassValue;
|
|
127
|
+
colon?: tailwind_variants.ClassValue;
|
|
128
|
+
periods?: tailwind_variants.ClassValue;
|
|
129
|
+
period?: tailwind_variants.ClassValue;
|
|
130
|
+
dialNumber?: tailwind_variants.ClassValue;
|
|
131
|
+
dialHand?: tailwind_variants.ClassValue;
|
|
132
|
+
dialCenter?: tailwind_variants.ClassValue;
|
|
133
|
+
inputs?: tailwind_variants.ClassValue;
|
|
134
|
+
inputBox?: tailwind_variants.ClassValue;
|
|
135
|
+
inputCaption?: tailwind_variants.ClassValue;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
} | {}>, unknown, unknown, undefined>>;
|
|
139
|
+
declare const TimePicker: {
|
|
140
|
+
({ variant, format, value, defaultValue, onValueChange, className, }: _m3_baseui_core.TimePickerOwnProps): React.JSX.Element;
|
|
141
|
+
displayName: string;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export { TimePicker, timePickerTv };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createTimePicker } from '@m3-baseui/core';
|
|
3
|
+
import { tv as tv$1 } from 'tailwind-variants';
|
|
4
|
+
|
|
5
|
+
// src/time-picker.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/time-picker.ts
|
|
35
|
+
var timePickerTv = tv({
|
|
36
|
+
slots: {
|
|
37
|
+
root: ["inline-flex flex-col items-center gap-2 p-2 text-on-surface"],
|
|
38
|
+
header: ["flex items-center gap-2"],
|
|
39
|
+
field: [
|
|
40
|
+
"inline-grid place-items-center w-24 h-20 rounded-small overflow-hidden box-border",
|
|
41
|
+
"bg-surface-container-highest text-on-surface text-display-large cursor-pointer outline-none",
|
|
42
|
+
"border border-transparent transition-colors duration-100",
|
|
43
|
+
"data-[selected]:bg-primary-container data-[selected]:text-on-primary-container"
|
|
44
|
+
],
|
|
45
|
+
colon: ["text-display-large text-on-surface px-1 leading-none"],
|
|
46
|
+
periods: [
|
|
47
|
+
"inline-flex flex-col rounded-small overflow-hidden border border-outline self-stretch",
|
|
48
|
+
"m-0 p-0 min-w-0"
|
|
49
|
+
],
|
|
50
|
+
period: [
|
|
51
|
+
"flex-1 inline-flex items-center justify-center px-3 min-h-[38px] w-14",
|
|
52
|
+
"border-0 bg-transparent",
|
|
53
|
+
"text-title-medium text-on-surface-variant cursor-pointer outline-none",
|
|
54
|
+
"data-[selected]:bg-secondary-container data-[selected]:text-on-secondary-container",
|
|
55
|
+
"[&+&]:border-t [&+&]:border-outline"
|
|
56
|
+
],
|
|
57
|
+
dial: [
|
|
58
|
+
"relative size-[256px] my-2 p-0 min-w-0 border-0 rounded-full bg-surface-container-highest"
|
|
59
|
+
],
|
|
60
|
+
dialNumber: [
|
|
61
|
+
"absolute -translate-x-1/2 -translate-y-1/2 inline-grid place-items-center size-12 rounded-full",
|
|
62
|
+
"border-0 bg-transparent",
|
|
63
|
+
"text-body-large text-on-surface cursor-pointer outline-none select-none",
|
|
64
|
+
"data-[selected]:bg-primary data-[selected]:text-on-primary"
|
|
65
|
+
],
|
|
66
|
+
dialHand: [
|
|
67
|
+
"absolute left-1/2 top-[12%] h-[38%] w-0.5 origin-bottom bg-primary -translate-x-1/2 pointer-events-none"
|
|
68
|
+
],
|
|
69
|
+
dialCenter: [
|
|
70
|
+
"absolute left-1/2 top-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary pointer-events-none"
|
|
71
|
+
],
|
|
72
|
+
inputs: ["flex items-start gap-2"],
|
|
73
|
+
inputBox: [
|
|
74
|
+
"w-24 h-20 rounded-small box-border text-center",
|
|
75
|
+
"bg-surface-container-highest text-on-surface text-display-large outline-none",
|
|
76
|
+
"border border-outline focus:border-2 focus:border-primary",
|
|
77
|
+
"[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"
|
|
78
|
+
],
|
|
79
|
+
inputCaption: ["block mt-1 text-body-small text-on-surface-variant"]
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
var tp = timePickerTv();
|
|
83
|
+
var TimePicker = createTimePicker(() => ({
|
|
84
|
+
root: tp.root(),
|
|
85
|
+
header: tp.header(),
|
|
86
|
+
field: tp.field(),
|
|
87
|
+
colon: tp.colon(),
|
|
88
|
+
periods: tp.periods(),
|
|
89
|
+
period: tp.period(),
|
|
90
|
+
dial: tp.dial(),
|
|
91
|
+
dialNumber: tp.dialNumber(),
|
|
92
|
+
dialHand: tp.dialHand(),
|
|
93
|
+
dialCenter: tp.dialCenter(),
|
|
94
|
+
inputs: tp.inputs(),
|
|
95
|
+
inputBox: tp.inputBox(),
|
|
96
|
+
inputCaption: tp.inputCaption()
|
|
97
|
+
}));
|
|
98
|
+
|
|
99
|
+
export { TimePicker, timePickerTv };
|
|
100
|
+
//# sourceMappingURL=time-picker.js.map
|
|
101
|
+
//# sourceMappingURL=time-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tv.ts","../src/time-picker.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;;;AC7BI,IAAM,eAAe,EAAA,CAAG;AAAA,EAC7B,KAAA,EAAO;AAAA,IACL,IAAA,EAAM,CAAC,6DAA6D,CAAA;AAAA,IACpE,MAAA,EAAQ,CAAC,yBAAyB,CAAA;AAAA,IAClC,KAAA,EAAO;AAAA,MACL,mFAAA;AAAA,MACA,6FAAA;AAAA,MACA,0DAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,KAAA,EAAO,CAAC,sDAAsD,CAAA;AAAA,IAC9D,OAAA,EAAS;AAAA,MACP,uFAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,uEAAA;AAAA,MACA,yBAAA;AAAA,MACA,uEAAA;AAAA,MACA,oFAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,IAAA,EAAM;AAAA,MACJ;AAAA,KACF;AAAA,IACA,UAAA,EAAY;AAAA,MACV,gGAAA;AAAA,MACA,yBAAA;AAAA,MACA,yEAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,QAAA,EAAU;AAAA,MACR;AAAA,KACF;AAAA,IACA,UAAA,EAAY;AAAA,MACV;AAAA,KACF;AAAA,IACA,MAAA,EAAQ,CAAC,wBAAwB,CAAA;AAAA,IACjC,QAAA,EAAU;AAAA,MACR,gDAAA;AAAA,MACA,8EAAA;AAAA,MACA,2DAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,YAAA,EAAc,CAAC,oDAAoD;AAAA;AAEvE,CAAC;AAED,IAAM,KAAK,YAAA,EAAa;AACjB,IAAM,UAAA,GAAa,iBAAiB,OAAO;AAAA,EAChD,IAAA,EAAM,GAAG,IAAA,EAAK;AAAA,EACd,MAAA,EAAQ,GAAG,MAAA,EAAO;AAAA,EAClB,KAAA,EAAO,GAAG,KAAA,EAAM;AAAA,EAChB,KAAA,EAAO,GAAG,KAAA,EAAM;AAAA,EAChB,OAAA,EAAS,GAAG,OAAA,EAAQ;AAAA,EACpB,MAAA,EAAQ,GAAG,MAAA,EAAO;AAAA,EAClB,IAAA,EAAM,GAAG,IAAA,EAAK;AAAA,EACd,UAAA,EAAY,GAAG,UAAA,EAAW;AAAA,EAC1B,QAAA,EAAU,GAAG,QAAA,EAAS;AAAA,EACtB,UAAA,EAAY,GAAG,UAAA,EAAW;AAAA,EAC1B,MAAA,EAAQ,GAAG,MAAA,EAAO;AAAA,EAClB,QAAA,EAAU,GAAG,QAAA,EAAS;AAAA,EACtB,YAAA,EAAc,GAAG,YAAA;AACnB,CAAA,CAAE","file":"time-picker.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 * time-picker.ts — Tailwind classes for the M3 Time picker (dial + input).\n *\n * The header time fields are surface-container-highest blocks (display-large)\n * that fill with primary-container when active; the AM/PM toggle fills with\n * secondary-container. The dial is a surface-container-highest face whose\n * selected number fills with primary and is reached by a primary hand. Same DOM\n * + data-* as the VE build.\n */\nimport { createTimePicker } from '@m3-baseui/core';\nimport { tv } from './tv';\n\nexport type { TimePickerVariant, TimeValue } from '@m3-baseui/core';\n\nexport const timePickerTv = tv({\n slots: {\n root: ['inline-flex flex-col items-center gap-2 p-2 text-on-surface'],\n header: ['flex items-center gap-2'],\n field: [\n 'inline-grid place-items-center w-24 h-20 rounded-small overflow-hidden box-border',\n 'bg-surface-container-highest text-on-surface text-display-large cursor-pointer outline-none',\n 'border border-transparent transition-colors duration-100',\n 'data-[selected]:bg-primary-container data-[selected]:text-on-primary-container',\n ],\n colon: ['text-display-large text-on-surface px-1 leading-none'],\n periods: [\n 'inline-flex flex-col rounded-small overflow-hidden border border-outline self-stretch',\n 'm-0 p-0 min-w-0',\n ],\n period: [\n 'flex-1 inline-flex items-center justify-center px-3 min-h-[38px] w-14',\n 'border-0 bg-transparent',\n 'text-title-medium text-on-surface-variant cursor-pointer outline-none',\n 'data-[selected]:bg-secondary-container data-[selected]:text-on-secondary-container',\n '[&+&]:border-t [&+&]:border-outline',\n ],\n dial: [\n 'relative size-[256px] my-2 p-0 min-w-0 border-0 rounded-full bg-surface-container-highest',\n ],\n dialNumber: [\n 'absolute -translate-x-1/2 -translate-y-1/2 inline-grid place-items-center size-12 rounded-full',\n 'border-0 bg-transparent',\n 'text-body-large text-on-surface cursor-pointer outline-none select-none',\n 'data-[selected]:bg-primary data-[selected]:text-on-primary',\n ],\n dialHand: [\n 'absolute left-1/2 top-[12%] h-[38%] w-0.5 origin-bottom bg-primary -translate-x-1/2 pointer-events-none',\n ],\n dialCenter: [\n 'absolute left-1/2 top-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary pointer-events-none',\n ],\n inputs: ['flex items-start gap-2'],\n inputBox: [\n 'w-24 h-20 rounded-small box-border text-center',\n 'bg-surface-container-highest text-on-surface text-display-large outline-none',\n 'border border-outline focus:border-2 focus:border-primary',\n '[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none',\n ],\n inputCaption: ['block mt-1 text-body-small text-on-surface-variant'],\n },\n});\n\nconst tp = timePickerTv();\nexport const TimePicker = createTimePicker(() => ({\n root: tp.root(),\n header: tp.header(),\n field: tp.field(),\n colon: tp.colon(),\n periods: tp.periods(),\n period: tp.period(),\n dial: tp.dial(),\n dialNumber: tp.dialNumber(),\n dialHand: tp.dialHand(),\n dialCenter: tp.dialCenter(),\n inputs: tp.inputs(),\n inputBox: tp.inputBox(),\n inputCaption: tp.inputCaption(),\n}));\n"]}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import * as _m3_baseui_core from '@m3-baseui/core';
|
|
3
|
+
export { ToolbarOrientation, ToolbarProps, ToolbarVariant } from '@m3-baseui/core';
|
|
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 toolbarTv: tailwind_variants.TVReturnType<{
|
|
8
|
+
variant: {
|
|
9
|
+
standard: string;
|
|
10
|
+
vibrant: string;
|
|
11
|
+
};
|
|
12
|
+
orientation: {
|
|
13
|
+
horizontal: string;
|
|
14
|
+
vertical: string;
|
|
15
|
+
};
|
|
16
|
+
}, undefined, "inline-flex items-center justify-center gap-1 box-border rounded-full shadow-level3 [&_svg]:size-6", tailwind_variants_dist_config_js.TVConfig<{
|
|
17
|
+
variant: {
|
|
18
|
+
standard: string;
|
|
19
|
+
vibrant: string;
|
|
20
|
+
};
|
|
21
|
+
orientation: {
|
|
22
|
+
horizontal: string;
|
|
23
|
+
vertical: string;
|
|
24
|
+
};
|
|
25
|
+
}, {
|
|
26
|
+
variant: {
|
|
27
|
+
standard: string;
|
|
28
|
+
vibrant: string;
|
|
29
|
+
};
|
|
30
|
+
orientation: {
|
|
31
|
+
horizontal: string;
|
|
32
|
+
vertical: string;
|
|
33
|
+
};
|
|
34
|
+
}>, {
|
|
35
|
+
variant: {
|
|
36
|
+
standard: string;
|
|
37
|
+
vibrant: string;
|
|
38
|
+
};
|
|
39
|
+
orientation: {
|
|
40
|
+
horizontal: string;
|
|
41
|
+
vertical: string;
|
|
42
|
+
};
|
|
43
|
+
}, undefined, tailwind_variants.TVReturnType<{
|
|
44
|
+
variant: {
|
|
45
|
+
standard: string;
|
|
46
|
+
vibrant: string;
|
|
47
|
+
};
|
|
48
|
+
orientation: {
|
|
49
|
+
horizontal: string;
|
|
50
|
+
vertical: string;
|
|
51
|
+
};
|
|
52
|
+
}, undefined, "inline-flex items-center justify-center gap-1 box-border rounded-full shadow-level3 [&_svg]:size-6", tailwind_variants_dist_config_js.TVConfig<{
|
|
53
|
+
variant: {
|
|
54
|
+
standard: string;
|
|
55
|
+
vibrant: string;
|
|
56
|
+
};
|
|
57
|
+
orientation: {
|
|
58
|
+
horizontal: string;
|
|
59
|
+
vertical: string;
|
|
60
|
+
};
|
|
61
|
+
}, {
|
|
62
|
+
variant: {
|
|
63
|
+
standard: string;
|
|
64
|
+
vibrant: string;
|
|
65
|
+
};
|
|
66
|
+
orientation: {
|
|
67
|
+
horizontal: string;
|
|
68
|
+
vertical: string;
|
|
69
|
+
};
|
|
70
|
+
}>, unknown, unknown, undefined>>;
|
|
71
|
+
declare const Toolbar: react.ForwardRefExoticComponent<_m3_baseui_core.ToolbarOwnProps & react.HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
|
|
72
|
+
|
|
73
|
+
export { Toolbar, toolbarTv };
|
package/dist/toolbar.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createToolbar } from '@m3-baseui/core';
|
|
3
|
+
import { tv as tv$1 } from 'tailwind-variants';
|
|
4
|
+
|
|
5
|
+
// src/toolbar.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/toolbar.ts
|
|
35
|
+
var toolbarTv = tv({
|
|
36
|
+
base: "inline-flex items-center justify-center gap-1 box-border rounded-full shadow-level3 [&_svg]:size-6",
|
|
37
|
+
variants: {
|
|
38
|
+
variant: {
|
|
39
|
+
standard: "bg-surface-container text-on-surface-variant",
|
|
40
|
+
vibrant: "bg-primary-container text-on-primary-container [&_button]:text-on-primary-container [&_a]:text-on-primary-container"
|
|
41
|
+
},
|
|
42
|
+
orientation: {
|
|
43
|
+
horizontal: "flex-row h-16 px-2",
|
|
44
|
+
vertical: "flex-col w-16 py-2"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
defaultVariants: { variant: "standard", orientation: "horizontal" }
|
|
48
|
+
});
|
|
49
|
+
var Toolbar = createToolbar(
|
|
50
|
+
({ variant, orientation }) => toolbarTv({ variant, orientation })
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
export { Toolbar, toolbarTv };
|
|
54
|
+
//# sourceMappingURL=toolbar.js.map
|
|
55
|
+
//# sourceMappingURL=toolbar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tv.ts","../src/toolbar.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;;;AC5BI,IAAM,YAAY,EAAA,CAAG;AAAA,EAC1B,IAAA,EAAM,oGAAA;AAAA,EACN,QAAA,EAAU;AAAA,IACR,OAAA,EAAS;AAAA,MACP,QAAA,EAAU,8CAAA;AAAA,MACV,OAAA,EACE;AAAA,KACJ;AAAA,IACA,WAAA,EAAa;AAAA,MACX,UAAA,EAAY,oBAAA;AAAA,MACZ,QAAA,EAAU;AAAA;AACZ,GACF;AAAA,EACA,eAAA,EAAiB,EAAE,OAAA,EAAS,UAAA,EAAY,aAAa,YAAA;AACvD,CAAC;AAEM,IAAM,OAAA,GAAU,aAAA;AAAA,EAAc,CAAC,EAAE,OAAA,EAAS,WAAA,OAC/C,SAAA,CAAU,EAAE,OAAA,EAAS,WAAA,EAAa;AACpC","file":"toolbar.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 * toolbar.ts — tailwind-variants for the M3 Expressive Toolbar.\n *\n * A floating, full-radius pill (elevation level3) that groups action icons.\n * `standard` rides on surface-container; `vibrant` on primary-container — and\n * forces its interactive children (icon buttons / links) to the matching\n * on-primary-container foreground, since `IconButton` otherwise paints its own\n * `on-surface-variant`. The descendant selector outranks the button's own color\n * class but not its higher-specificity `data-[disabled]` rule, so disabled\n * actions still dim. `vertical` swaps the main axis and the fixed dimension.\n * Same DOM + `data-*` as the VE build.\n */\nimport { createToolbar } from '@m3-baseui/core';\nimport { tv } from './tv';\n\nexport const toolbarTv = tv({\n base: 'inline-flex items-center justify-center gap-1 box-border rounded-full shadow-level3 [&_svg]:size-6',\n variants: {\n variant: {\n standard: 'bg-surface-container text-on-surface-variant',\n vibrant:\n 'bg-primary-container text-on-primary-container [&_button]:text-on-primary-container [&_a]:text-on-primary-container',\n },\n orientation: {\n horizontal: 'flex-row h-16 px-2',\n vertical: 'flex-col w-16 py-2',\n },\n },\n defaultVariants: { variant: 'standard', orientation: 'horizontal' },\n});\n\nexport const Toolbar = createToolbar(({ variant, orientation }) =>\n toolbarTv({ variant, orientation }),\n);\nexport type { ToolbarProps, ToolbarVariant, ToolbarOrientation } 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.
|
|
3
|
+
"version": "1.3.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",
|
|
@@ -112,6 +112,11 @@
|
|
|
112
112
|
"types": "./dist/progress.d.ts",
|
|
113
113
|
"default": "./dist/progress.js"
|
|
114
114
|
},
|
|
115
|
+
"./loading-indicator": {
|
|
116
|
+
"@m3/source": "./src/loading-indicator.ts",
|
|
117
|
+
"types": "./dist/loading-indicator.d.ts",
|
|
118
|
+
"default": "./dist/loading-indicator.js"
|
|
119
|
+
},
|
|
115
120
|
"./list": {
|
|
116
121
|
"@m3/source": "./src/list.ts",
|
|
117
122
|
"types": "./dist/list.d.ts",
|
|
@@ -142,6 +147,16 @@
|
|
|
142
147
|
"types": "./dist/segmented-button.d.ts",
|
|
143
148
|
"default": "./dist/segmented-button.js"
|
|
144
149
|
},
|
|
150
|
+
"./button-group": {
|
|
151
|
+
"@m3/source": "./src/button-group.ts",
|
|
152
|
+
"types": "./dist/button-group.d.ts",
|
|
153
|
+
"default": "./dist/button-group.js"
|
|
154
|
+
},
|
|
155
|
+
"./split-button": {
|
|
156
|
+
"@m3/source": "./src/split-button.ts",
|
|
157
|
+
"types": "./dist/split-button.d.ts",
|
|
158
|
+
"default": "./dist/split-button.js"
|
|
159
|
+
},
|
|
145
160
|
"./navigation-drawer": {
|
|
146
161
|
"@m3/source": "./src/navigation-drawer.ts",
|
|
147
162
|
"types": "./dist/navigation-drawer.d.ts",
|
|
@@ -172,6 +187,31 @@
|
|
|
172
187
|
"types": "./dist/side-sheet.d.ts",
|
|
173
188
|
"default": "./dist/side-sheet.js"
|
|
174
189
|
},
|
|
190
|
+
"./search": {
|
|
191
|
+
"@m3/source": "./src/search.ts",
|
|
192
|
+
"types": "./dist/search.d.ts",
|
|
193
|
+
"default": "./dist/search.js"
|
|
194
|
+
},
|
|
195
|
+
"./date-picker": {
|
|
196
|
+
"@m3/source": "./src/date-picker.ts",
|
|
197
|
+
"types": "./dist/date-picker.d.ts",
|
|
198
|
+
"default": "./dist/date-picker.js"
|
|
199
|
+
},
|
|
200
|
+
"./time-picker": {
|
|
201
|
+
"@m3/source": "./src/time-picker.ts",
|
|
202
|
+
"types": "./dist/time-picker.d.ts",
|
|
203
|
+
"default": "./dist/time-picker.js"
|
|
204
|
+
},
|
|
205
|
+
"./toolbar": {
|
|
206
|
+
"@m3/source": "./src/toolbar.ts",
|
|
207
|
+
"types": "./dist/toolbar.d.ts",
|
|
208
|
+
"default": "./dist/toolbar.js"
|
|
209
|
+
},
|
|
210
|
+
"./carousel": {
|
|
211
|
+
"@m3/source": "./src/carousel.ts",
|
|
212
|
+
"types": "./dist/carousel.d.ts",
|
|
213
|
+
"default": "./dist/carousel.js"
|
|
214
|
+
},
|
|
175
215
|
"./preset.css": "./styles/preset.css",
|
|
176
216
|
"./tokens.css": "./styles/tokens.css",
|
|
177
217
|
"./theme.css": "./styles/theme.css"
|
package/styles/preset.css
CHANGED
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
*/
|
|
20
20
|
@theme {
|
|
21
21
|
--animate-m3-linear-indeterminate: m3-linear-indeterminate 2s ease-in-out infinite;
|
|
22
|
+
/* M3 Expressive loading indicator: the active shape rotates while it morphs
|
|
23
|
+
* (approximated as a rotate + scale pulse). The VE build matches this period. */
|
|
24
|
+
--animate-m3-loading: m3-loading 1.2s ease-in-out infinite;
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
@keyframes m3-linear-indeterminate {
|
|
@@ -29,3 +32,15 @@
|
|
|
29
32
|
transform: translateX(400%);
|
|
30
33
|
}
|
|
31
34
|
}
|
|
35
|
+
|
|
36
|
+
@keyframes m3-loading {
|
|
37
|
+
0% {
|
|
38
|
+
transform: rotate(0deg) scale(1);
|
|
39
|
+
}
|
|
40
|
+
50% {
|
|
41
|
+
transform: rotate(180deg) scale(0.85);
|
|
42
|
+
}
|
|
43
|
+
100% {
|
|
44
|
+
transform: rotate(360deg) scale(1);
|
|
45
|
+
}
|
|
46
|
+
}
|