@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.
@@ -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.1.0",
3
+ "version": "1.2.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
+ }