@m3-baseui/react-tailwind 1.1.0 → 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/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/icon-button.js +4 -1
- package/dist/icon-button.js.map +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +439 -17
- 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/search.d.ts +148 -0
- package/dist/search.js +105 -0
- package/dist/search.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/package.json +41 -1
- package/styles/preset.css +15 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import * as _m3_baseui_core from '@m3-baseui/core';
|
|
3
|
+
export { LoadingIndicatorProps } 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 loadingIndicatorTv: tailwind_variants.TVReturnType<{
|
|
8
|
+
contained: {
|
|
9
|
+
true: {
|
|
10
|
+
root: string;
|
|
11
|
+
};
|
|
12
|
+
false: {};
|
|
13
|
+
};
|
|
14
|
+
}, {
|
|
15
|
+
root: string;
|
|
16
|
+
indicator: string[];
|
|
17
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<{
|
|
18
|
+
contained: {
|
|
19
|
+
true: {
|
|
20
|
+
root: string;
|
|
21
|
+
};
|
|
22
|
+
false: {};
|
|
23
|
+
};
|
|
24
|
+
}, {
|
|
25
|
+
contained: {
|
|
26
|
+
true: {
|
|
27
|
+
root: string;
|
|
28
|
+
};
|
|
29
|
+
false: {};
|
|
30
|
+
};
|
|
31
|
+
}>, {
|
|
32
|
+
contained: {
|
|
33
|
+
true: {
|
|
34
|
+
root: string;
|
|
35
|
+
};
|
|
36
|
+
false: {};
|
|
37
|
+
};
|
|
38
|
+
}, {
|
|
39
|
+
root: string;
|
|
40
|
+
indicator: string[];
|
|
41
|
+
}, tailwind_variants.TVReturnType<{
|
|
42
|
+
contained: {
|
|
43
|
+
true: {
|
|
44
|
+
root: string;
|
|
45
|
+
};
|
|
46
|
+
false: {};
|
|
47
|
+
};
|
|
48
|
+
}, {
|
|
49
|
+
root: string;
|
|
50
|
+
indicator: string[];
|
|
51
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<{
|
|
52
|
+
contained: {
|
|
53
|
+
true: {
|
|
54
|
+
root: string;
|
|
55
|
+
};
|
|
56
|
+
false: {};
|
|
57
|
+
};
|
|
58
|
+
}, {
|
|
59
|
+
contained: {
|
|
60
|
+
true: {
|
|
61
|
+
root: string;
|
|
62
|
+
};
|
|
63
|
+
false: {};
|
|
64
|
+
};
|
|
65
|
+
}>, unknown, unknown, undefined>>;
|
|
66
|
+
declare const LoadingIndicator: react.ForwardRefExoticComponent<_m3_baseui_core.LoadingIndicatorOwnProps & react.HTMLAttributes<HTMLSpanElement> & react.RefAttributes<HTMLSpanElement>>;
|
|
67
|
+
|
|
68
|
+
export { LoadingIndicator, loadingIndicatorTv };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createLoadingIndicator } from '@m3-baseui/core';
|
|
3
|
+
import { tv as tv$1 } from 'tailwind-variants';
|
|
4
|
+
|
|
5
|
+
// src/loading-indicator.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/loading-indicator.ts
|
|
35
|
+
var loadingIndicatorTv = tv({
|
|
36
|
+
slots: {
|
|
37
|
+
// The SVG is a fixed 38dp active indicator. Uncontained: the box shrinks to
|
|
38
|
+
// the shape. Contained: a 48dp pill wraps it (5dp inset on each side).
|
|
39
|
+
root: "inline-flex items-center justify-center [&_svg]:block [&_svg]:size-[38px]",
|
|
40
|
+
indicator: [
|
|
41
|
+
"fill-primary",
|
|
42
|
+
// Morph + rotate about the shape's own centre (transform-box: fill-box).
|
|
43
|
+
"[transform-box:fill-box] origin-center animate-m3-loading"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
variants: {
|
|
47
|
+
contained: {
|
|
48
|
+
true: { root: "size-12 rounded-full bg-secondary-container" },
|
|
49
|
+
false: {}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
defaultVariants: { contained: false }
|
|
53
|
+
});
|
|
54
|
+
var LoadingIndicator = createLoadingIndicator(({ contained }) => {
|
|
55
|
+
const s = loadingIndicatorTv({ contained });
|
|
56
|
+
return { root: s.root(), indicator: s.indicator() };
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export { LoadingIndicator, loadingIndicatorTv };
|
|
60
|
+
//# sourceMappingURL=loading-indicator.js.map
|
|
61
|
+
//# sourceMappingURL=loading-indicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tv.ts","../src/loading-indicator.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,qBAAqB,EAAA,CAAG;AAAA,EACnC,KAAA,EAAO;AAAA;AAAA;AAAA,IAGL,IAAA,EAAM,2EAAA;AAAA,IACN,SAAA,EAAW;AAAA,MACT,cAAA;AAAA;AAAA,MAEA;AAAA;AACF,GACF;AAAA,EACA,QAAA,EAAU;AAAA,IACR,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,EAAE,IAAA,EAAM,6CAAA,EAA8C;AAAA,MAC5D,OAAO;AAAC;AACV,GACF;AAAA,EACA,eAAA,EAAiB,EAAE,SAAA,EAAW,KAAA;AAChC,CAAC;AAEM,IAAM,gBAAA,GAAmB,sBAAA,CAAuB,CAAC,EAAE,WAAU,KAAM;AACxE,EAAA,MAAM,CAAA,GAAI,kBAAA,CAAmB,EAAE,SAAA,EAAW,CAAA;AAC1C,EAAA,OAAO,EAAE,MAAM,CAAA,CAAE,IAAA,IAAQ,SAAA,EAAW,CAAA,CAAE,WAAU,EAAE;AACpD,CAAC","file":"loading-indicator.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 * loading-indicator.ts — tailwind-variants slots for the M3 Expressive Loading\n * indicator.\n *\n * A 48dp box holding the morphing `primary` shape; the rotate+scale morph keys\n * off the `m3-loading` keyframe (see preset.css) and always runs (indeterminate\n * only). `contained` puts the shape on a `secondary-container` pill. Same DOM as\n * the VE build.\n */\nimport { createLoadingIndicator } from '@m3-baseui/core';\nimport { tv } from './tv';\n\nexport const loadingIndicatorTv = tv({\n slots: {\n // The SVG is a fixed 38dp active indicator. Uncontained: the box shrinks to\n // the shape. Contained: a 48dp pill wraps it (5dp inset on each side).\n root: 'inline-flex items-center justify-center [&_svg]:block [&_svg]:size-[38px]',\n indicator: [\n 'fill-primary',\n // Morph + rotate about the shape's own centre (transform-box: fill-box).\n '[transform-box:fill-box] origin-center animate-m3-loading',\n ],\n },\n variants: {\n contained: {\n true: { root: 'size-12 rounded-full bg-secondary-container' },\n false: {},\n },\n },\n defaultVariants: { contained: false },\n});\n\nexport const LoadingIndicator = createLoadingIndicator(({ contained }) => {\n const s = loadingIndicatorTv({ contained });\n return { root: s.root(), indicator: s.indicator() };\n});\nexport type { LoadingIndicatorProps } from '@m3-baseui/core';\n"]}
|
package/dist/navigation-bar.d.ts
CHANGED
|
@@ -9,8 +9,8 @@ declare const navigationBarTv: tailwind_variants.TVReturnType<{
|
|
|
9
9
|
root?: tailwind_variants.ClassValue;
|
|
10
10
|
label?: tailwind_variants.ClassValue;
|
|
11
11
|
icon?: tailwind_variants.ClassValue;
|
|
12
|
-
indicator?: tailwind_variants.ClassValue;
|
|
13
12
|
item?: tailwind_variants.ClassValue;
|
|
13
|
+
indicator?: tailwind_variants.ClassValue;
|
|
14
14
|
iconWrap?: tailwind_variants.ClassValue;
|
|
15
15
|
};
|
|
16
16
|
};
|
|
@@ -20,8 +20,8 @@ declare const navigationBarTv: tailwind_variants.TVReturnType<{
|
|
|
20
20
|
root?: tailwind_variants.ClassValue;
|
|
21
21
|
label?: tailwind_variants.ClassValue;
|
|
22
22
|
icon?: tailwind_variants.ClassValue;
|
|
23
|
-
indicator?: tailwind_variants.ClassValue;
|
|
24
23
|
item?: tailwind_variants.ClassValue;
|
|
24
|
+
indicator?: tailwind_variants.ClassValue;
|
|
25
25
|
iconWrap?: tailwind_variants.ClassValue;
|
|
26
26
|
};
|
|
27
27
|
};
|
|
@@ -38,8 +38,8 @@ declare const navigationBarTv: tailwind_variants.TVReturnType<{
|
|
|
38
38
|
root?: tailwind_variants.ClassValue;
|
|
39
39
|
label?: tailwind_variants.ClassValue;
|
|
40
40
|
icon?: tailwind_variants.ClassValue;
|
|
41
|
-
indicator?: tailwind_variants.ClassValue;
|
|
42
41
|
item?: tailwind_variants.ClassValue;
|
|
42
|
+
indicator?: tailwind_variants.ClassValue;
|
|
43
43
|
iconWrap?: tailwind_variants.ClassValue;
|
|
44
44
|
};
|
|
45
45
|
};
|
|
@@ -49,8 +49,8 @@ declare const navigationBarTv: tailwind_variants.TVReturnType<{
|
|
|
49
49
|
root?: tailwind_variants.ClassValue;
|
|
50
50
|
label?: tailwind_variants.ClassValue;
|
|
51
51
|
icon?: tailwind_variants.ClassValue;
|
|
52
|
-
indicator?: tailwind_variants.ClassValue;
|
|
53
52
|
item?: tailwind_variants.ClassValue;
|
|
53
|
+
indicator?: tailwind_variants.ClassValue;
|
|
54
54
|
iconWrap?: tailwind_variants.ClassValue;
|
|
55
55
|
};
|
|
56
56
|
};
|
|
@@ -74,8 +74,8 @@ declare const navigationBarTv: tailwind_variants.TVReturnType<{
|
|
|
74
74
|
root?: tailwind_variants.ClassValue;
|
|
75
75
|
label?: tailwind_variants.ClassValue;
|
|
76
76
|
icon?: tailwind_variants.ClassValue;
|
|
77
|
-
indicator?: tailwind_variants.ClassValue;
|
|
78
77
|
item?: tailwind_variants.ClassValue;
|
|
78
|
+
indicator?: tailwind_variants.ClassValue;
|
|
79
79
|
iconWrap?: tailwind_variants.ClassValue;
|
|
80
80
|
};
|
|
81
81
|
};
|
|
@@ -10,8 +10,8 @@ declare const navigationRailTv: tailwind_variants.TVReturnType<{
|
|
|
10
10
|
header?: tailwind_variants.ClassValue;
|
|
11
11
|
label?: tailwind_variants.ClassValue;
|
|
12
12
|
icon?: tailwind_variants.ClassValue;
|
|
13
|
-
indicator?: tailwind_variants.ClassValue;
|
|
14
13
|
item?: tailwind_variants.ClassValue;
|
|
14
|
+
indicator?: tailwind_variants.ClassValue;
|
|
15
15
|
iconWrap?: tailwind_variants.ClassValue;
|
|
16
16
|
};
|
|
17
17
|
};
|
|
@@ -22,8 +22,8 @@ declare const navigationRailTv: tailwind_variants.TVReturnType<{
|
|
|
22
22
|
header?: tailwind_variants.ClassValue;
|
|
23
23
|
label?: tailwind_variants.ClassValue;
|
|
24
24
|
icon?: tailwind_variants.ClassValue;
|
|
25
|
-
indicator?: tailwind_variants.ClassValue;
|
|
26
25
|
item?: tailwind_variants.ClassValue;
|
|
26
|
+
indicator?: tailwind_variants.ClassValue;
|
|
27
27
|
iconWrap?: tailwind_variants.ClassValue;
|
|
28
28
|
};
|
|
29
29
|
};
|
|
@@ -42,8 +42,8 @@ declare const navigationRailTv: tailwind_variants.TVReturnType<{
|
|
|
42
42
|
header?: tailwind_variants.ClassValue;
|
|
43
43
|
label?: tailwind_variants.ClassValue;
|
|
44
44
|
icon?: tailwind_variants.ClassValue;
|
|
45
|
-
indicator?: tailwind_variants.ClassValue;
|
|
46
45
|
item?: tailwind_variants.ClassValue;
|
|
46
|
+
indicator?: tailwind_variants.ClassValue;
|
|
47
47
|
iconWrap?: tailwind_variants.ClassValue;
|
|
48
48
|
};
|
|
49
49
|
};
|
|
@@ -54,8 +54,8 @@ declare const navigationRailTv: tailwind_variants.TVReturnType<{
|
|
|
54
54
|
header?: tailwind_variants.ClassValue;
|
|
55
55
|
label?: tailwind_variants.ClassValue;
|
|
56
56
|
icon?: tailwind_variants.ClassValue;
|
|
57
|
-
indicator?: tailwind_variants.ClassValue;
|
|
58
57
|
item?: tailwind_variants.ClassValue;
|
|
58
|
+
indicator?: tailwind_variants.ClassValue;
|
|
59
59
|
iconWrap?: tailwind_variants.ClassValue;
|
|
60
60
|
};
|
|
61
61
|
};
|
|
@@ -82,8 +82,8 @@ declare const navigationRailTv: tailwind_variants.TVReturnType<{
|
|
|
82
82
|
header?: tailwind_variants.ClassValue;
|
|
83
83
|
label?: tailwind_variants.ClassValue;
|
|
84
84
|
icon?: tailwind_variants.ClassValue;
|
|
85
|
-
indicator?: tailwind_variants.ClassValue;
|
|
86
85
|
item?: tailwind_variants.ClassValue;
|
|
86
|
+
indicator?: tailwind_variants.ClassValue;
|
|
87
87
|
iconWrap?: tailwind_variants.ClassValue;
|
|
88
88
|
};
|
|
89
89
|
};
|
package/dist/search.d.ts
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import * as _base_ui_react from '@base-ui/react';
|
|
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 searchTv: tailwind_variants.TVReturnType<{
|
|
7
|
+
[key: string]: {
|
|
8
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
9
|
+
input?: tailwind_variants.ClassValue;
|
|
10
|
+
list?: tailwind_variants.ClassValue;
|
|
11
|
+
separator?: tailwind_variants.ClassValue;
|
|
12
|
+
popup?: tailwind_variants.ClassValue;
|
|
13
|
+
icon?: tailwind_variants.ClassValue;
|
|
14
|
+
clear?: tailwind_variants.ClassValue;
|
|
15
|
+
item?: tailwind_variants.ClassValue;
|
|
16
|
+
itemIndicator?: tailwind_variants.ClassValue;
|
|
17
|
+
groupLabel?: tailwind_variants.ClassValue;
|
|
18
|
+
bar?: tailwind_variants.ClassValue;
|
|
19
|
+
empty?: tailwind_variants.ClassValue;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
} | {
|
|
23
|
+
[x: string]: {
|
|
24
|
+
[x: string]: tailwind_variants.ClassValue | {
|
|
25
|
+
input?: tailwind_variants.ClassValue;
|
|
26
|
+
list?: tailwind_variants.ClassValue;
|
|
27
|
+
separator?: tailwind_variants.ClassValue;
|
|
28
|
+
popup?: tailwind_variants.ClassValue;
|
|
29
|
+
icon?: tailwind_variants.ClassValue;
|
|
30
|
+
clear?: tailwind_variants.ClassValue;
|
|
31
|
+
item?: tailwind_variants.ClassValue;
|
|
32
|
+
itemIndicator?: tailwind_variants.ClassValue;
|
|
33
|
+
groupLabel?: tailwind_variants.ClassValue;
|
|
34
|
+
bar?: tailwind_variants.ClassValue;
|
|
35
|
+
empty?: tailwind_variants.ClassValue;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
} | {}, {
|
|
39
|
+
bar: string[];
|
|
40
|
+
icon: string[];
|
|
41
|
+
input: string[];
|
|
42
|
+
clear: string[];
|
|
43
|
+
popup: string[];
|
|
44
|
+
list: string[];
|
|
45
|
+
item: string[];
|
|
46
|
+
itemIndicator: string[];
|
|
47
|
+
empty: string[];
|
|
48
|
+
separator: string[];
|
|
49
|
+
groupLabel: string[];
|
|
50
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<unknown, {
|
|
51
|
+
[key: string]: {
|
|
52
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
53
|
+
input?: tailwind_variants.ClassValue;
|
|
54
|
+
list?: tailwind_variants.ClassValue;
|
|
55
|
+
separator?: tailwind_variants.ClassValue;
|
|
56
|
+
popup?: tailwind_variants.ClassValue;
|
|
57
|
+
icon?: tailwind_variants.ClassValue;
|
|
58
|
+
clear?: tailwind_variants.ClassValue;
|
|
59
|
+
item?: tailwind_variants.ClassValue;
|
|
60
|
+
itemIndicator?: tailwind_variants.ClassValue;
|
|
61
|
+
groupLabel?: tailwind_variants.ClassValue;
|
|
62
|
+
bar?: tailwind_variants.ClassValue;
|
|
63
|
+
empty?: tailwind_variants.ClassValue;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
} | {}>, {
|
|
67
|
+
[key: string]: {
|
|
68
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
69
|
+
input?: tailwind_variants.ClassValue;
|
|
70
|
+
list?: tailwind_variants.ClassValue;
|
|
71
|
+
separator?: tailwind_variants.ClassValue;
|
|
72
|
+
popup?: tailwind_variants.ClassValue;
|
|
73
|
+
icon?: tailwind_variants.ClassValue;
|
|
74
|
+
clear?: tailwind_variants.ClassValue;
|
|
75
|
+
item?: tailwind_variants.ClassValue;
|
|
76
|
+
itemIndicator?: tailwind_variants.ClassValue;
|
|
77
|
+
groupLabel?: tailwind_variants.ClassValue;
|
|
78
|
+
bar?: tailwind_variants.ClassValue;
|
|
79
|
+
empty?: tailwind_variants.ClassValue;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
} | {}, {
|
|
83
|
+
bar: string[];
|
|
84
|
+
icon: string[];
|
|
85
|
+
input: string[];
|
|
86
|
+
clear: string[];
|
|
87
|
+
popup: string[];
|
|
88
|
+
list: string[];
|
|
89
|
+
item: string[];
|
|
90
|
+
itemIndicator: string[];
|
|
91
|
+
empty: string[];
|
|
92
|
+
separator: string[];
|
|
93
|
+
groupLabel: string[];
|
|
94
|
+
}, tailwind_variants.TVReturnType<unknown, {
|
|
95
|
+
bar: string[];
|
|
96
|
+
icon: string[];
|
|
97
|
+
input: string[];
|
|
98
|
+
clear: string[];
|
|
99
|
+
popup: string[];
|
|
100
|
+
list: string[];
|
|
101
|
+
item: string[];
|
|
102
|
+
itemIndicator: string[];
|
|
103
|
+
empty: string[];
|
|
104
|
+
separator: string[];
|
|
105
|
+
groupLabel: string[];
|
|
106
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<unknown, {
|
|
107
|
+
[key: string]: {
|
|
108
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
109
|
+
input?: tailwind_variants.ClassValue;
|
|
110
|
+
list?: tailwind_variants.ClassValue;
|
|
111
|
+
separator?: tailwind_variants.ClassValue;
|
|
112
|
+
popup?: tailwind_variants.ClassValue;
|
|
113
|
+
icon?: tailwind_variants.ClassValue;
|
|
114
|
+
clear?: tailwind_variants.ClassValue;
|
|
115
|
+
item?: tailwind_variants.ClassValue;
|
|
116
|
+
itemIndicator?: tailwind_variants.ClassValue;
|
|
117
|
+
groupLabel?: tailwind_variants.ClassValue;
|
|
118
|
+
bar?: tailwind_variants.ClassValue;
|
|
119
|
+
empty?: tailwind_variants.ClassValue;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
} | {}>, unknown, unknown, undefined>>;
|
|
123
|
+
declare const Search: {
|
|
124
|
+
Root: typeof _base_ui_react.ComboboxRoot;
|
|
125
|
+
Value: typeof _base_ui_react.ComboboxValue;
|
|
126
|
+
Label: react.ForwardRefExoticComponent<Omit<_base_ui_react.ComboboxLabelProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
127
|
+
Bar: react.ForwardRefExoticComponent<Omit<Omit<_base_ui_react.ComboboxInputGroupProps, "ref"> & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<unknown>>;
|
|
128
|
+
Input: react.ForwardRefExoticComponent<Omit<Omit<_base_ui_react.AutocompleteInputProps, "ref"> & react.RefAttributes<HTMLInputElement>, "ref"> & react.RefAttributes<unknown>>;
|
|
129
|
+
Trigger: react.ForwardRefExoticComponent<Omit<_base_ui_react.ComboboxTriggerProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
|
|
130
|
+
Icon: react.ForwardRefExoticComponent<Omit<Omit<_base_ui_react.AutocompleteIconProps, "ref"> & react.RefAttributes<HTMLSpanElement>, "ref"> & react.RefAttributes<unknown>>;
|
|
131
|
+
Clear: react.ForwardRefExoticComponent<Omit<Omit<_base_ui_react.AutocompleteClearProps, "ref"> & react.RefAttributes<HTMLButtonElement>, "ref"> & react.RefAttributes<unknown>>;
|
|
132
|
+
Portal: react.ForwardRefExoticComponent<Omit<_base_ui_react.AutocompletePortalProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
133
|
+
Positioner: react.ForwardRefExoticComponent<Omit<_base_ui_react.AutocompletePositionerProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
134
|
+
Popup: react.ForwardRefExoticComponent<Omit<Omit<_base_ui_react.AutocompletePopupProps, "ref"> & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<unknown>>;
|
|
135
|
+
List: react.ForwardRefExoticComponent<Omit<Omit<_base_ui_react.AutocompleteListProps, "ref"> & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<unknown>>;
|
|
136
|
+
Item: react.ForwardRefExoticComponent<Omit<Omit<_base_ui_react.ComboboxItemProps, "ref"> & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<unknown>>;
|
|
137
|
+
ItemIndicator: react.ForwardRefExoticComponent<Omit<Omit<_base_ui_react.ComboboxItemIndicatorProps, "ref"> & react.RefAttributes<HTMLSpanElement>, "ref"> & react.RefAttributes<unknown>>;
|
|
138
|
+
Empty: react.ForwardRefExoticComponent<Omit<Omit<_base_ui_react.AutocompleteEmptyProps, "ref"> & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<unknown>>;
|
|
139
|
+
Group: react.ForwardRefExoticComponent<Omit<_base_ui_react.AutocompleteGroupProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
140
|
+
GroupLabel: react.ForwardRefExoticComponent<Omit<Omit<_base_ui_react.AutocompleteGroupLabelProps, "ref"> & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<unknown>>;
|
|
141
|
+
Separator: react.ForwardRefExoticComponent<Omit<Omit<_base_ui_react.SeparatorProps, "ref"> & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<unknown>>;
|
|
142
|
+
Status: react.ForwardRefExoticComponent<Omit<_base_ui_react.AutocompleteStatusProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
143
|
+
Collection: typeof _base_ui_react.ComboboxCollection;
|
|
144
|
+
SearchGlyph: () => React.JSX.Element;
|
|
145
|
+
Check: () => React.JSX.Element;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export { Search, searchTv };
|
package/dist/search.js
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createSearch } from '@m3-baseui/core';
|
|
3
|
+
import { tv as tv$1 } from 'tailwind-variants';
|
|
4
|
+
|
|
5
|
+
// src/search.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/search.ts
|
|
35
|
+
var searchTv = tv({
|
|
36
|
+
slots: {
|
|
37
|
+
bar: [
|
|
38
|
+
"flex items-center gap-1 h-14 min-w-[360px] max-w-full pl-4 pr-2",
|
|
39
|
+
"bg-surface-container-high text-on-surface rounded-full",
|
|
40
|
+
"transition-shadow duration-150 ease-standard",
|
|
41
|
+
"focus-within:shadow-level1"
|
|
42
|
+
],
|
|
43
|
+
icon: [
|
|
44
|
+
"inline-flex shrink-0 items-center justify-center text-on-surface-variant",
|
|
45
|
+
"[&>svg]:size-6"
|
|
46
|
+
],
|
|
47
|
+
input: [
|
|
48
|
+
"flex-1 min-w-0 h-full bg-transparent border-0 outline-none",
|
|
49
|
+
"text-body-large text-on-surface placeholder:text-on-surface-variant"
|
|
50
|
+
],
|
|
51
|
+
clear: [
|
|
52
|
+
"relative inline-flex shrink-0 items-center justify-center size-10 rounded-full overflow-hidden",
|
|
53
|
+
"text-on-surface-variant cursor-pointer outline-none [&>svg]:size-6",
|
|
54
|
+
"before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100",
|
|
55
|
+
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
56
|
+
"focus-visible:before:opacity-[var(--md-sys-state-focus)]",
|
|
57
|
+
"active:before:opacity-[var(--md-sys-state-pressed)]"
|
|
58
|
+
],
|
|
59
|
+
popup: [
|
|
60
|
+
"w-[var(--anchor-width)] min-w-[360px] max-h-[min(72vh,480px)] overflow-y-auto py-2",
|
|
61
|
+
"bg-surface-container-high text-on-surface rounded-large shadow-level3",
|
|
62
|
+
"origin-[var(--transform-origin)] transition-[opacity,transform] duration-150 ease-standard",
|
|
63
|
+
"data-[starting-style]:opacity-0 data-[starting-style]:scale-95",
|
|
64
|
+
"data-[ending-style]:opacity-0",
|
|
65
|
+
"focus:outline-none"
|
|
66
|
+
],
|
|
67
|
+
list: ["outline-none"],
|
|
68
|
+
item: [
|
|
69
|
+
"group relative grid grid-cols-[24px_1fr_24px] items-center gap-4 h-14 px-4 overflow-hidden",
|
|
70
|
+
"cursor-pointer select-none outline-none text-body-large text-on-surface",
|
|
71
|
+
"before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100",
|
|
72
|
+
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
73
|
+
"data-[highlighted]:before:opacity-[var(--md-sys-state-hover)]",
|
|
74
|
+
"data-[selected]:before:opacity-[var(--md-sys-state-pressed)]",
|
|
75
|
+
"active:before:opacity-[var(--md-sys-state-pressed)]",
|
|
76
|
+
"data-[disabled]:text-on-surface/[0.38] data-[disabled]:before:opacity-0 data-[disabled]:pointer-events-none",
|
|
77
|
+
"[&_[data-slot=search-leading]]:inline-flex [&_[data-slot=search-leading]]:text-on-surface-variant [&_[data-slot=search-leading]>svg]:size-6"
|
|
78
|
+
],
|
|
79
|
+
itemIndicator: [
|
|
80
|
+
"inline-flex items-center justify-center text-on-surface",
|
|
81
|
+
"invisible group-data-[selected]:visible"
|
|
82
|
+
],
|
|
83
|
+
empty: ["px-4 py-3 text-body-medium text-on-surface-variant"],
|
|
84
|
+
separator: ["my-2 h-px border-0 bg-outline-variant"],
|
|
85
|
+
groupLabel: ["px-4 py-2 text-label-small text-on-surface-variant"]
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
var s = searchTv();
|
|
89
|
+
var Search = createSearch({
|
|
90
|
+
bar: s.bar(),
|
|
91
|
+
icon: s.icon(),
|
|
92
|
+
input: s.input(),
|
|
93
|
+
clear: s.clear(),
|
|
94
|
+
popup: s.popup(),
|
|
95
|
+
list: s.list(),
|
|
96
|
+
item: s.item(),
|
|
97
|
+
itemIndicator: s.itemIndicator(),
|
|
98
|
+
empty: s.empty(),
|
|
99
|
+
separator: s.separator(),
|
|
100
|
+
groupLabel: s.groupLabel()
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
export { Search, searchTv };
|
|
104
|
+
//# sourceMappingURL=search.js.map
|
|
105
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tv.ts","../src/search.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,WAAW,EAAA,CAAG;AAAA,EACzB,KAAA,EAAO;AAAA,IACL,GAAA,EAAK;AAAA,MACH,iEAAA;AAAA,MACA,wDAAA;AAAA,MACA,8CAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,IAAA,EAAM;AAAA,MACJ,0EAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,KAAA,EAAO;AAAA,MACL,4DAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,KAAA,EAAO;AAAA,MACL,gGAAA;AAAA,MACA,oEAAA;AAAA,MACA,4IAAA;AAAA,MACA,kDAAA;AAAA,MACA,0DAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,KAAA,EAAO;AAAA,MACL,oFAAA;AAAA,MACA,uEAAA;AAAA,MACA,4FAAA;AAAA,MACA,gEAAA;AAAA,MACA,+BAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,IAAA,EAAM,CAAC,cAAc,CAAA;AAAA,IACrB,IAAA,EAAM;AAAA,MACJ,4FAAA;AAAA,MACA,yEAAA;AAAA,MACA,4IAAA;AAAA,MACA,kDAAA;AAAA,MACA,+DAAA;AAAA,MACA,8DAAA;AAAA,MACA,qDAAA;AAAA,MACA,6GAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,aAAA,EAAe;AAAA,MACb,yDAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,KAAA,EAAO,CAAC,oDAAoD,CAAA;AAAA,IAC5D,SAAA,EAAW,CAAC,uCAAuC,CAAA;AAAA,IACnD,UAAA,EAAY,CAAC,oDAAoD;AAAA;AAErE,CAAC;AAED,IAAM,IAAI,QAAA,EAAS;AACZ,IAAM,SAAS,YAAA,CAAa;AAAA,EACjC,GAAA,EAAK,EAAE,GAAA,EAAI;AAAA,EACX,IAAA,EAAM,EAAE,IAAA,EAAK;AAAA,EACb,KAAA,EAAO,EAAE,KAAA,EAAM;AAAA,EACf,KAAA,EAAO,EAAE,KAAA,EAAM;AAAA,EACf,KAAA,EAAO,EAAE,KAAA,EAAM;AAAA,EACf,IAAA,EAAM,EAAE,IAAA,EAAK;AAAA,EACb,IAAA,EAAM,EAAE,IAAA,EAAK;AAAA,EACb,aAAA,EAAe,EAAE,aAAA,EAAc;AAAA,EAC/B,KAAA,EAAO,EAAE,KAAA,EAAM;AAAA,EACf,SAAA,EAAW,EAAE,SAAA,EAAU;AAAA,EACvB,UAAA,EAAY,EAAE,UAAA;AAChB,CAAC","file":"search.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 * search.ts — Tailwind classes for the M3 Search (search bar + docked view).\n *\n * Resting bar: surface-container-high pill (full corner, 56dp) with a leading\n * magnifier and a body-large input. The docked view is a surface-container-high\n * popup (elevation 3) whose suggestion rows carry a `before:` state layer keyed\n * to hover + Base UI's data-[highlighted]/data-[selected]. Same DOM + ripple as\n * the VE build.\n */\nimport { createSearch } from '@m3-baseui/core';\nimport { tv } from './tv';\n\nexport const searchTv = tv({\n slots: {\n bar: [\n 'flex items-center gap-1 h-14 min-w-[360px] max-w-full pl-4 pr-2',\n 'bg-surface-container-high text-on-surface rounded-full',\n 'transition-shadow duration-150 ease-standard',\n 'focus-within:shadow-level1',\n ],\n icon: [\n 'inline-flex shrink-0 items-center justify-center text-on-surface-variant',\n '[&>svg]:size-6',\n ],\n input: [\n 'flex-1 min-w-0 h-full bg-transparent border-0 outline-none',\n 'text-body-large text-on-surface placeholder:text-on-surface-variant',\n ],\n clear: [\n 'relative inline-flex shrink-0 items-center justify-center size-10 rounded-full overflow-hidden',\n 'text-on-surface-variant cursor-pointer outline-none [&>svg]:size-6',\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 ],\n popup: [\n 'w-[var(--anchor-width)] min-w-[360px] max-h-[min(72vh,480px)] overflow-y-auto py-2',\n 'bg-surface-container-high text-on-surface rounded-large shadow-level3',\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 'focus:outline-none',\n ],\n list: ['outline-none'],\n item: [\n 'group relative grid grid-cols-[24px_1fr_24px] items-center gap-4 h-14 px-4 overflow-hidden',\n 'cursor-pointer select-none outline-none text-body-large text-on-surface',\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 'data-[selected]:before:opacity-[var(--md-sys-state-pressed)]',\n 'active:before:opacity-[var(--md-sys-state-pressed)]',\n 'data-[disabled]:text-on-surface/[0.38] data-[disabled]:before:opacity-0 data-[disabled]:pointer-events-none',\n '[&_[data-slot=search-leading]]:inline-flex [&_[data-slot=search-leading]]:text-on-surface-variant [&_[data-slot=search-leading]>svg]:size-6',\n ],\n itemIndicator: [\n 'inline-flex items-center justify-center text-on-surface',\n 'invisible group-data-[selected]:visible',\n ],\n empty: ['px-4 py-3 text-body-medium text-on-surface-variant'],\n separator: ['my-2 h-px border-0 bg-outline-variant'],\n groupLabel: ['px-4 py-2 text-label-small text-on-surface-variant'],\n },\n});\n\nconst s = searchTv();\nexport const Search = createSearch({\n bar: s.bar(),\n icon: s.icon(),\n input: s.input(),\n clear: s.clear(),\n popup: s.popup(),\n list: s.list(),\n item: s.item(),\n itemIndicator: s.itemIndicator(),\n empty: s.empty(),\n separator: s.separator(),\n groupLabel: s.groupLabel(),\n});\n"]}
|