@bug-on/md3-react 3.0.1 → 3.0.3

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.
Files changed (86) hide show
  1. package/.turbo/turbo-build.log +42 -42
  2. package/CHANGELOG.md +10 -0
  3. package/dist/index.css +107 -0
  4. package/dist/index.d.mts +1491 -1053
  5. package/dist/index.d.ts +1491 -1053
  6. package/dist/index.js +4457 -3156
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.mjs +4394 -3109
  9. package/dist/index.mjs.map +1 -1
  10. package/package.json +11 -6
  11. package/scripts/copy-assets.js +113 -8
  12. package/src/index.ts +66 -18
  13. package/src/test/button.test.tsx +1 -1
  14. package/src/ui/app-bar/app-bar.tokens.ts +5 -24
  15. package/src/ui/badge.tsx +2 -1
  16. package/src/ui/buttons/button/button-tokens.ts +118 -0
  17. package/src/ui/{button.test.tsx → buttons/button/button.test.tsx} +0 -21
  18. package/src/ui/buttons/button/button.tsx +381 -0
  19. package/src/ui/buttons/button/index.ts +3 -0
  20. package/src/ui/buttons/button/types.ts +90 -0
  21. package/src/ui/buttons/button-group/button-group-defaults.ts +95 -0
  22. package/src/ui/buttons/button-group/button-group-tokens.ts +20 -0
  23. package/src/ui/{button-group.test.tsx → buttons/button-group/button-group.test.tsx} +9 -10
  24. package/src/ui/buttons/button-group/button-group.tsx +699 -0
  25. package/src/ui/buttons/button-group/index.ts +8 -0
  26. package/src/ui/buttons/button-group/types.ts +77 -0
  27. package/src/ui/{fab.tsx → buttons/fabs/fab/fab.tsx} +6 -6
  28. package/src/ui/buttons/fabs/fab/index.ts +1 -0
  29. package/src/ui/{fab-menu.tsx → buttons/fabs/fab-menu/fab-menu.tsx} +7 -4
  30. package/src/ui/buttons/fabs/fab-menu/index.ts +1 -0
  31. package/src/ui/buttons/fabs/index.ts +2 -0
  32. package/src/ui/{icon-button.tsx → buttons/icon-button/icon-button.tsx} +6 -6
  33. package/src/ui/buttons/icon-button/index.ts +1 -0
  34. package/src/ui/buttons/index.ts +4 -0
  35. package/src/ui/code-block.tsx +1 -1
  36. package/src/ui/dialog.tsx +4 -7
  37. package/src/ui/drawer.tsx +4 -7
  38. package/src/ui/menu/menu-animations.ts +14 -20
  39. package/src/ui/menu/menu-tokens.ts +7 -5
  40. package/src/ui/menu/menu.test.tsx +9 -4
  41. package/src/ui/navigation-bar.test.tsx +111 -0
  42. package/src/ui/navigation-bar.tsx +464 -0
  43. package/src/ui/navigation-rail.test.tsx +5 -4
  44. package/src/ui/navigation-rail.tsx +32 -23
  45. package/src/ui/scroll-area.tsx +4 -0
  46. package/src/ui/search/search-view-fullscreen.tsx +1 -1
  47. package/src/ui/search/search.tokens.ts +9 -43
  48. package/src/ui/search/trailing-action.tsx +1 -1
  49. package/src/ui/shared/constants.ts +25 -27
  50. package/src/ui/shared/motion-tokens.ts +238 -0
  51. package/src/ui/snackbar/snackbar.tsx +4 -6
  52. package/src/ui/switch/switch.tsx +12 -18
  53. package/src/ui/text-field/text-field.tokens.ts +12 -12
  54. package/src/ui/text-field/text-field.tsx +31 -19
  55. package/src/ui/theme-provider/index.tsx +1 -5
  56. package/src/ui/toc.tsx +1 -1
  57. package/src/ui/toolbar/__snapshots__/bottom-docked-toolbar.test.tsx.snap +51 -0
  58. package/src/ui/toolbar/__snapshots__/floating-toolbar-with-fab.test.tsx.snap +113 -0
  59. package/src/ui/toolbar/__snapshots__/floating-toolbar.test.tsx.snap +169 -0
  60. package/src/ui/toolbar/bottom-docked-toolbar.test.tsx +114 -0
  61. package/src/ui/toolbar/docked-toolbar.tsx +186 -0
  62. package/src/ui/toolbar/floating-toolbar-with-fab.test.tsx +139 -0
  63. package/src/ui/toolbar/floating-toolbar-with-fab.tsx +199 -0
  64. package/src/ui/toolbar/floating-toolbar.test.tsx +230 -0
  65. package/src/ui/toolbar/floating-toolbar.tsx +344 -0
  66. package/src/ui/toolbar/index.ts +35 -0
  67. package/src/ui/toolbar/toolbar-colors.ts +37 -0
  68. package/src/ui/toolbar/toolbar-context.tsx +13 -0
  69. package/src/ui/toolbar/toolbar-divider.test.tsx +54 -0
  70. package/src/ui/toolbar/toolbar-divider.tsx +73 -0
  71. package/src/ui/toolbar/toolbar-icon-button.test.tsx +68 -0
  72. package/src/ui/toolbar/toolbar-icon-button.tsx +136 -0
  73. package/src/ui/toolbar/toolbar-scroll-behavior.ts +140 -0
  74. package/src/ui/toolbar/toolbar-tokens.ts +51 -0
  75. package/test-clip.html +31 -0
  76. package/test-shadow.html +5 -1
  77. package/test-width.html +34 -0
  78. package/src/ui/button-group.tsx +0 -350
  79. package/src/ui/button.tsx +0 -665
  80. package/test-render.tsx +0 -4
  81. package/test_output.txt +0 -164
  82. package/test_output_v2.txt +0 -5
  83. /package/src/ui/{fab.test.tsx → buttons/fabs/fab/fab.test.tsx} +0 -0
  84. /package/src/ui/{fab-menu.test.tsx → buttons/fabs/fab-menu/fab-menu.test.tsx} +0 -0
  85. /package/src/ui/{icon-button.test.tsx → buttons/icon-button/icon-button.test.tsx} +0 -0
  86. /package/src/ui/{Text.tsx → text.tsx} +0 -0
package/test_output.txt DELETED
@@ -1,164 +0,0 @@
1
-
2
- > @bug-on/md3-react@2.0.3 test
3
- > vitest run src/ui/menu/menu.test.tsx
4
-
5
-
6
- RUN v4.1.0 /Users/stark/Documents/GitHub/bug-on-md3-expressive/packages/react
7
-
8
- ❯ src/ui/menu/menu.test.tsx (28 tests | 8 failed) 16014ms
9
- ✓ renders children when open 277ms
10
- × MenuItem applies correct shape class for each itemPosition 82ms
11
- ✓ MenuItem shows check icon when selected 83ms
12
- ✓ MenuItem applies disabled state — opacity class and aria-disabled 66ms
13
- × MenuGroup auto-injects correct itemPosition based on child index 56ms
14
- × MenuDivider renders with correct role and classes 51ms
15
- × Standard variant applies surface-container-low on MenuGroup 49ms
16
- × Vibrant variant applies tertiary-container on MenuGroup 49ms
17
- ✓ Keyboard ArrowDown: menu opens via click 91ms
18
- ✓ Keyboard Escape closes menu 77ms
19
- ✓ renders children directly without a trigger 4ms
20
- ✓ gap separatorStyle renders no divider elements between groups 3ms
21
- ✓ divider separatorStyle inserts an hr between each pair of groups 5ms
22
- ✓ VerticalMenuDivider renders as hr with correct classes 2ms
23
- ✓ auto-injects index and count props into group children for shape morphing 3ms
24
- ✓ standard colorVariant gap: root is transparent, MenuGroup has surface-container-low 3ms
25
- ✓ vibrant colorVariant gap: root is transparent, MenuGroup has tertiary-container 2ms
26
- ✓ standard colorVariant divider: VerticalMenuContent has surface-container-low 2ms
27
- ✓ VerticalMenu root has role=menu and aria-orientation=vertical 2ms
28
- ✓ ArrowDown key moves focus to next menuitem 14ms
29
- ✓ ArrowUp from first item wraps to last item 9ms
30
- ✓ MenuItem inside VerticalMenu shows check icon when selected=true 4ms
31
- ✓ renders trigger item correctly 35ms
32
- × opens after hoverOpenDelay (default 200ms) 5009ms
33
- × closes after hoverCloseDelay (default 300ms) 5008ms
34
- ✓ useMenuContext returns default values when used outside Provider 4ms
35
- × MenuGroup updates state on hover for shape morphing 5003ms
36
- ✓ FAST_SPATIAL_SPRING has correct spring parameters 0ms
37
-
38
- ⎯⎯⎯⎯⎯⎯⎯ Failed Tests 8 ⎯⎯⎯⎯⎯⎯⎯
39
-
40
- FAIL src/ui/menu/menu.test.tsx > Menu > MenuItem applies correct shape class for each itemPosition
41
- AssertionError: expected 'relative flex w-full cursor-pointer s…' to contain 'rounded-t-[12px]'
42
-
43
- Expected: "rounded-t-[12px]"
44
- Received: "relative flex w-full cursor-pointer select-none items-center outline-none min-h-12 min-w-28 max-w-70 px-3 rounded-none transition-[border-radius,background-color] duration-150 ease-in text-m3-on-surface hover:bg-m3-on-surface/8 focus:bg-m3-on-surface/12 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-m3-primary"
45
-
46
- ❯ src/ui/menu/menu.test.tsx:90:29
47
- 88|
48
- 89| // Shape classes based on ITEM_SHAPE_CLASSES token
49
- 90| expect(leading.className).toContain("rounded-t-[12px]");
50
- | ^
51
- 91| expect(leading.className).toContain("rounded-b-[4px]");
52
- 92| expect(middle.className).toContain("rounded-[4px]");
53
-
54
- ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/8]⎯
55
-
56
- FAIL src/ui/menu/menu.test.tsx > Menu > MenuGroup auto-injects correct itemPosition based on child index
57
- AssertionError: expected 'relative flex w-full cursor-pointer s…' to contain 'rounded-t-[12px]'
58
-
59
- Expected: "rounded-t-[12px]"
60
- Received: "relative flex w-full cursor-pointer select-none items-center outline-none min-h-12 min-w-28 max-w-70 px-3 rounded-none transition-[border-radius,background-color] duration-150 ease-in text-m3-on-surface hover:bg-m3-on-surface/8 focus:bg-m3-on-surface/12 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-m3-primary"
61
-
62
- ❯ src/ui/menu/menu.test.tsx:146:27
63
- 144|
64
- 145| // First item should be "leading" shape: rounded-t-[12px] rounded-b-…
65
- 146| expect(first.className).toContain("rounded-t-[12px]");
66
- | ^
67
- 147| // Last item should be "trailing" shape: rounded-t-[4px] rounded-b-[…
68
- 148| expect(last.className).toContain("rounded-b-[12px]");
69
-
70
- ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/8]⎯
71
-
72
- FAIL src/ui/menu/menu.test.tsx > Menu > MenuDivider renders with correct role and classes
73
- AssertionError: expected 'my-2 mx-0 h-px border-0 bg-m3-outline…' to contain 'mx-3'
74
-
75
- Expected: "mx-3"
76
- Received: "my-2 mx-0 h-px border-0 bg-m3-outline-variant"
77
-
78
- ❯ src/ui/menu/menu.test.tsx:167:29
79
- 165| const divider = screen.getByTestId("divider");
80
- 166| expect(divider.getAttribute("role")).toBe("separator");
81
- 167| expect(divider.className).toContain("mx-3");
82
- | ^
83
- 168| expect(divider.className).toContain("bg-m3-outline-variant");
84
- 169| });
85
-
86
- ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/8]⎯
87
-
88
- FAIL src/ui/menu/menu.test.tsx > Menu > Standard variant applies surface-container-low on MenuGroup
89
- AssertionError: expected 'relative overflow-hidden py-1 bg-tran…' to contain 'bg-m3-surface-container-low'
90
-
91
- Expected: "bg-m3-surface-container-low"
92
- Received: "relative overflow-hidden py-1 bg-transparent"
93
-
94
- ❯ src/ui/menu/menu.test.tsx:186:27
95
- 184| );
96
- 185| const group = screen.getByTestId("group-standard");
97
- 186| expect(group.className).toContain("bg-m3-surface-container-low");
98
- | ^
99
- 187| });
100
- 188|
101
-
102
- ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/8]⎯
103
-
104
- FAIL src/ui/menu/menu.test.tsx > Menu > Vibrant variant applies tertiary-container on MenuGroup
105
- AssertionError: expected 'relative overflow-hidden py-1 bg-tran…' to contain 'bg-m3-tertiary-container'
106
-
107
- Expected: "bg-m3-tertiary-container"
108
- Received: "relative overflow-hidden py-1 bg-transparent"
109
-
110
- ❯ src/ui/menu/menu.test.tsx:204:27
111
- 202| );
112
- 203| const group = screen.getByTestId("group-vibrant");
113
- 204| expect(group.className).toContain("bg-m3-tertiary-container");
114
- | ^
115
- 205| });
116
- 206|
117
-
118
- ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[5/8]⎯
119
-
120
- FAIL src/ui/menu/menu.test.tsx > SubMenu > opens after hoverOpenDelay (default 200ms)
121
- Error: Test timed out in 5000ms.
122
- If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout".
123
- ❯ src/ui/menu/menu.test.tsx:513:2
124
- 511|
125
- 512| // 2. SubMenu opens after hover delay
126
- 513| it("opens after hoverOpenDelay (default 200ms)", async () => {
127
- | ^
128
- 514| vi.useFakeTimers();
129
- 515| const user = userEvent.setup({ delay: null });
130
-
131
- ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[6/8]⎯
132
-
133
- FAIL src/ui/menu/menu.test.tsx > SubMenu > closes after hoverCloseDelay (default 300ms)
134
- Error: Test timed out in 5000ms.
135
- If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout".
136
- ❯ src/ui/menu/menu.test.tsx:553:2
137
- 551|
138
- 552| // 3. SubMenu closes after hover close delay
139
- 553| it("closes after hoverCloseDelay (default 300ms)", async () => {
140
- | ^
141
- 554| vi.useFakeTimers();
142
- 555| const user = userEvent.setup({ delay: null });
143
-
144
- ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[7/8]⎯
145
-
146
- FAIL src/ui/menu/menu.test.tsx > Menu Internals > MenuGroup updates state on hover for shape morphing
147
- Error: Test timed out in 5000ms.
148
- If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout".
149
- ❯ src/ui/menu/menu.test.tsx:616:2
150
- 614|
151
- 615| // 2. MenuGroup shape morphing triggers on hover
152
- 616| it("MenuGroup updates state on hover for shape morphing", async () =>…
153
- | ^
154
- 617| const user = userEvent.setup();
155
- 618| render(
156
-
157
- ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[8/8]⎯
158
-
159
-
160
- Test Files 1 failed (1)
161
- Tests 8 failed | 20 passed (28)
162
- Start at 09:33:33
163
- Duration 17.69s (transform 152ms, setup 97ms, import 567ms, tests 16.01s, environment 805ms)
164
-
@@ -1,5 +0,0 @@
1
- npm error Missing script: "test"
2
- npm error
3
- npm error To see a list of scripts, run:
4
- npm error npm run
5
- npm error A complete log of this run can be found in: /Users/stark/.npm/_logs/2026-04-20T02_34_50_686Z-debug-0.log
File without changes