@moldable-ai/ui 0.2.29 → 0.2.32

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 (215) hide show
  1. package/dist/catalog/component-catalog.d.ts +9 -2
  2. package/dist/catalog/component-catalog.d.ts.map +1 -1
  3. package/dist/catalog/component-catalog.js +11 -7
  4. package/dist/catalog/core-control-stories.d.ts.map +1 -1
  5. package/dist/catalog/core-control-stories.js +1 -1
  6. package/dist/catalog/core-foundation-stories.d.ts.map +1 -1
  7. package/dist/catalog/core-foundation-stories.js +5 -5
  8. package/dist/components/app-error-boundary.d.ts +1 -1
  9. package/dist/components/chat/chat-image-lightbox.d.ts +8 -0
  10. package/dist/components/chat/chat-image-lightbox.d.ts.map +1 -1
  11. package/dist/components/chat/chat-image-lightbox.js +24 -2
  12. package/dist/components/chat/chat-input.d.ts +3 -2
  13. package/dist/components/chat/chat-input.d.ts.map +1 -1
  14. package/dist/components/chat/chat-input.js +3 -3
  15. package/dist/components/chat/chat-message.d.ts.map +1 -1
  16. package/dist/components/chat/chat-message.js +3 -1
  17. package/dist/components/chat/chat-panel.d.ts +3 -1
  18. package/dist/components/chat/chat-panel.d.ts.map +1 -1
  19. package/dist/components/chat/chat-panel.js +53 -39
  20. package/dist/components/chat/conversation-history.d.ts +4 -2
  21. package/dist/components/chat/conversation-history.d.ts.map +1 -1
  22. package/dist/components/chat/conversation-history.js +20 -15
  23. package/dist/components/ui/alert.d.ts +1 -1
  24. package/dist/components/ui/app-frame.d.ts +20 -1
  25. package/dist/components/ui/app-frame.d.ts.map +1 -1
  26. package/dist/components/ui/app-frame.js +37 -7
  27. package/dist/components/ui/badge.d.ts +1 -1
  28. package/dist/components/ui/badge.js +1 -1
  29. package/dist/components/ui/button.d.ts +5 -3
  30. package/dist/components/ui/button.d.ts.map +1 -1
  31. package/dist/components/ui/button.js +39 -11
  32. package/dist/components/ui/card.d.ts +12 -2
  33. package/dist/components/ui/card.d.ts.map +1 -1
  34. package/dist/components/ui/card.js +3 -2
  35. package/dist/components/ui/checkbox.d.ts +4 -1
  36. package/dist/components/ui/checkbox.d.ts.map +1 -1
  37. package/dist/components/ui/checkbox.js +4 -4
  38. package/dist/components/ui/context-menu.d.ts.map +1 -1
  39. package/dist/components/ui/context-menu.js +7 -6
  40. package/dist/components/ui/date-field.d.ts +1 -1
  41. package/dist/components/ui/dropdown-menu.d.ts +1 -0
  42. package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
  43. package/dist/components/ui/dropdown-menu.js +9 -8
  44. package/dist/components/ui/icon-button.d.ts +1 -1
  45. package/dist/components/ui/icon-button.d.ts.map +1 -1
  46. package/dist/components/ui/icon-button.js +1 -0
  47. package/dist/components/ui/input.d.ts +6 -2
  48. package/dist/components/ui/input.d.ts.map +1 -1
  49. package/dist/components/ui/input.js +2 -2
  50. package/dist/components/ui/material.d.ts +8 -3
  51. package/dist/components/ui/material.d.ts.map +1 -1
  52. package/dist/components/ui/material.js +2 -2
  53. package/dist/components/ui/menu-items.d.ts +2 -1
  54. package/dist/components/ui/menu-items.d.ts.map +1 -1
  55. package/dist/components/ui/menu-items.js +3 -2
  56. package/dist/components/ui/message-scroller-controller.d.ts +15 -17
  57. package/dist/components/ui/message-scroller-controller.d.ts.map +1 -1
  58. package/dist/components/ui/message-scroller-controller.js +106 -91
  59. package/dist/components/ui/message-scroller-primitive.d.ts +2 -0
  60. package/dist/components/ui/message-scroller-primitive.d.ts.map +1 -1
  61. package/dist/components/ui/message-scroller-primitive.js +2 -0
  62. package/dist/components/ui/message-scroller.d.ts.map +1 -1
  63. package/dist/components/ui/message-scroller.js +2 -2
  64. package/dist/components/ui/number-input.d.ts +1 -1
  65. package/dist/components/ui/popover.js +1 -1
  66. package/dist/components/ui/search-field.d.ts +4 -2
  67. package/dist/components/ui/search-field.d.ts.map +1 -1
  68. package/dist/components/ui/search-field.js +16 -6
  69. package/dist/components/ui/segmented-control.d.ts +3 -1
  70. package/dist/components/ui/segmented-control.d.ts.map +1 -1
  71. package/dist/components/ui/segmented-control.js +23 -17
  72. package/dist/components/ui/select.js +2 -2
  73. package/dist/components/ui/sidebar.d.ts +10 -4
  74. package/dist/components/ui/sidebar.d.ts.map +1 -1
  75. package/dist/components/ui/sidebar.js +74 -17
  76. package/dist/components/ui/status.d.ts +1 -1
  77. package/dist/components/ui/status.js +1 -1
  78. package/dist/components/ui/switch.d.ts +3 -1
  79. package/dist/components/ui/switch.d.ts.map +1 -1
  80. package/dist/components/ui/switch.js +3 -2
  81. package/dist/components/ui/toolbar-controls.d.ts +13 -3
  82. package/dist/components/ui/toolbar-controls.d.ts.map +1 -1
  83. package/dist/components/ui/toolbar-controls.js +35 -10
  84. package/dist/components/ui/toolbar.d.ts +5 -4
  85. package/dist/components/ui/toolbar.d.ts.map +1 -1
  86. package/dist/components/ui/toolbar.js +3 -3
  87. package/dist/index.d.ts +2 -1
  88. package/dist/index.d.ts.map +1 -1
  89. package/dist/index.js +3 -1
  90. package/dist/lib/frame-lifecycle.d.ts +1 -0
  91. package/dist/lib/frame-lifecycle.d.ts.map +1 -1
  92. package/dist/lib/frame-lifecycle.js +7 -0
  93. package/dist/lib/theme.d.ts +39 -5
  94. package/dist/lib/theme.d.ts.map +1 -1
  95. package/dist/lib/theme.js +105 -17
  96. package/dist/tokens/contracts.d.ts +79 -0
  97. package/dist/tokens/contracts.d.ts.map +1 -0
  98. package/dist/tokens/contracts.js +57 -0
  99. package/dist/tokens/index.d.ts +2 -0
  100. package/dist/tokens/index.d.ts.map +1 -0
  101. package/dist/tokens/index.js +1 -0
  102. package/docs/README.md +2 -0
  103. package/docs/adaptive-materials.md +14 -9
  104. package/docs/design-tokens.md +10 -6
  105. package/docs/foundations.md +3 -3
  106. package/docs/macos-design-audit.md +144 -0
  107. package/docs/native-integration.md +4 -4
  108. package/docs/platform-architecture.md +189 -0
  109. package/docs/standalone-app-windows.md +37 -0
  110. package/docs/visual-regression.md +6 -8
  111. package/package.json +13 -1
  112. package/src/components/ui/accordion.md +46 -0
  113. package/src/components/ui/alert.md +12 -4
  114. package/src/components/ui/app-frame.md +8 -5
  115. package/src/components/ui/aspect-ratio.md +37 -0
  116. package/src/components/ui/avatar.md +48 -0
  117. package/src/components/ui/breadcrumb.md +52 -0
  118. package/src/components/ui/button-group.md +43 -0
  119. package/src/components/ui/button.md +21 -4
  120. package/src/components/ui/calendar.md +42 -0
  121. package/src/components/ui/card.md +43 -0
  122. package/src/components/ui/carousel.md +47 -0
  123. package/src/components/ui/chart.md +52 -0
  124. package/src/components/ui/checkbox.md +36 -0
  125. package/src/components/ui/collapsible.md +2 -3
  126. package/src/components/ui/color-well.md +14 -4
  127. package/src/components/ui/combobox.md +3 -3
  128. package/src/components/ui/confirm-dialog.md +5 -4
  129. package/src/components/ui/context-menu.md +3 -2
  130. package/src/components/ui/date-field.md +6 -1
  131. package/src/components/ui/date-picker.md +6 -3
  132. package/src/components/ui/dialog.md +14 -12
  133. package/src/components/ui/drawer.md +58 -0
  134. package/src/components/ui/dropdown-menu.md +16 -14
  135. package/src/components/ui/error-boundary-view.md +1 -1
  136. package/src/components/ui/field.md +2 -1
  137. package/src/components/ui/form.md +71 -0
  138. package/src/components/ui/grid.md +4 -3
  139. package/src/components/ui/icon-button.md +4 -1
  140. package/src/components/ui/input-group.md +49 -0
  141. package/src/components/ui/input-otp.md +56 -0
  142. package/src/components/ui/input.md +40 -0
  143. package/src/components/ui/inspector.md +47 -7
  144. package/src/components/ui/item.md +5 -3
  145. package/src/components/ui/kbd.md +30 -0
  146. package/src/components/ui/label.md +29 -0
  147. package/src/components/ui/list.md +2 -2
  148. package/src/components/ui/material.md +25 -12
  149. package/src/components/ui/menu-items.md +62 -0
  150. package/src/components/ui/menubar.md +58 -0
  151. package/src/components/ui/message-scroller-primitive.md +70 -0
  152. package/src/components/ui/message-scroller.md +89 -0
  153. package/src/components/ui/navigation-button-group.md +4 -3
  154. package/src/components/ui/navigation-menu.md +52 -0
  155. package/src/components/ui/number-input.md +8 -0
  156. package/src/components/ui/pagination.md +51 -0
  157. package/src/components/ui/panel.md +6 -0
  158. package/src/components/ui/popover.md +10 -7
  159. package/src/components/ui/progress.md +31 -0
  160. package/src/components/ui/radio-group.md +36 -0
  161. package/src/components/ui/resizable.md +2 -1
  162. package/src/components/ui/scroll-area.md +3 -1
  163. package/src/components/ui/search-field.md +6 -1
  164. package/src/components/ui/segmented-control.md +6 -1
  165. package/src/components/ui/separator.md +35 -0
  166. package/src/components/ui/sidebar.md +29 -6
  167. package/src/components/ui/skeleton.md +36 -0
  168. package/src/components/ui/slider.md +58 -0
  169. package/src/components/ui/spinner.md +41 -0
  170. package/src/components/ui/split-view.md +8 -4
  171. package/src/components/ui/switch.md +44 -0
  172. package/src/components/ui/table.md +7 -7
  173. package/src/components/ui/tabs.md +3 -1
  174. package/src/components/ui/textarea.md +41 -0
  175. package/src/components/ui/toggle-group.md +2 -2
  176. package/src/components/ui/toggle.md +9 -9
  177. package/src/components/ui/toolbar-controls.md +24 -12
  178. package/src/components/ui/toolbar.md +6 -6
  179. package/src/styles/index.css +298 -117
  180. package/src/tokens/contracts.ts +131 -0
  181. package/src/tokens/index.css +6 -0
  182. package/src/tokens/index.ts +23 -0
  183. package/src/tokens/macos-26/README.md +37 -0
  184. package/src/tokens/macos-26/aliases.css +53 -0
  185. package/src/tokens/macos-26/compatibility.css +7 -0
  186. package/src/tokens/macos-26/index.css +3 -0
  187. package/src/tokens/macos-26/source/provenance.generated.json +28 -0
  188. package/src/tokens/macos-26/source/sidebar.generated.css +29 -0
  189. package/src/tokens/macos-26/source.css +7 -0
  190. package/src/tokens/macos-26/web-adaptations.json +25 -0
  191. package/src/tokens/macos-26/web-adaptations.md +15 -0
  192. package/src/tokens/macos-27/accessibility.css +11 -0
  193. package/src/tokens/macos-27/aliases.css +304 -0
  194. package/src/tokens/macos-27/compatibility.css +212 -0
  195. package/src/tokens/macos-27/index.css +15 -0
  196. package/src/tokens/macos-27/recipes.css +23 -0
  197. package/src/tokens/macos-27/source/chrome.generated.css +338 -0
  198. package/src/tokens/macos-27/source/colors.generated.css +140 -0
  199. package/src/tokens/macos-27/source/context.generated.css +18 -0
  200. package/src/tokens/macos-27/source/controls.generated.css +764 -0
  201. package/src/tokens/macos-27/source/effects.generated.css +68 -0
  202. package/src/tokens/macos-27/source/kit.generated.css +50 -0
  203. package/src/tokens/macos-27/source/overlays-status.generated.css +931 -0
  204. package/src/tokens/macos-27/source/paint-styles.generated.css +81 -0
  205. package/src/tokens/macos-27/source/provenance.generated.json +62 -0
  206. package/src/tokens/macos-27/source/sizes.generated.css +385 -0
  207. package/src/tokens/macos-27/source/source.generated.json +554 -0
  208. package/src/tokens/macos-27/source/text-styles.generated.css +116 -0
  209. package/src/tokens/macos-27/source.css +17 -0
  210. package/src/tokens/macos-27/web-adaptations.css +98 -0
  211. package/src/tokens/macos-27/web-adaptations.json +163 -0
  212. package/src/tokens/macos-27/web-adaptations.md +117 -0
  213. package/src/tokens/moldable/brand.css +165 -0
  214. package/src/tokens/moldable/index.css +1 -0
  215. package/src/tokens/platform-contract.test.ts +294 -0
@@ -0,0 +1,294 @@
1
+ import {
2
+ PLATFORM_PACKS,
3
+ SIDEBAR_STYLES,
4
+ resolvePlatformPack,
5
+ } from './contracts'
6
+ import { readFileSync, readdirSync } from 'node:fs'
7
+ import { extname, join, resolve } from 'node:path'
8
+ import { describe, expect, it } from 'vitest'
9
+
10
+ interface WebAdaptationManifest {
11
+ source: string
12
+ target: string
13
+ schemaVersion: number
14
+ idConvention: string
15
+ adaptations: Array<{
16
+ id: string
17
+ status: string
18
+ overrides: Array<{
19
+ appearance?: 'light' | 'dark'
20
+ token: string
21
+ sourceValue: string
22
+ adaptedValue: string
23
+ }>
24
+ }>
25
+ }
26
+
27
+ function collectSourceFiles(directory: string): string[] {
28
+ return readdirSync(directory, { withFileTypes: true }).flatMap((entry) => {
29
+ const path = join(directory, entry.name)
30
+ if (entry.isDirectory()) return collectSourceFiles(path)
31
+ return ['.ts', '.tsx'].includes(extname(path)) ? [path] : []
32
+ })
33
+ }
34
+
35
+ describe('platform token contract', () => {
36
+ it('resolves exact versioned packs and an explicit web fallback', () => {
37
+ expect(resolvePlatformPack('macos', '27')).toBe(PLATFORM_PACKS['macos-27'])
38
+ expect(resolvePlatformPack('windows', 'future')).toBe(
39
+ PLATFORM_PACKS['web-default'],
40
+ )
41
+ })
42
+
43
+ it('keeps immutable platform variables out of universal components', () => {
44
+ const componentRoot = resolve(process.cwd(), 'src/components')
45
+ const violations = collectSourceFiles(componentRoot).filter((path) =>
46
+ /--m\d+-source-/.test(readFileSync(path, 'utf8')),
47
+ )
48
+
49
+ expect(violations).toEqual([])
50
+ })
51
+
52
+ it('registers semantic sidebar anatomy separately from the base pack', () => {
53
+ expect(SIDEBAR_STYLES).toMatchObject({
54
+ floating: {
55
+ sourcePlatform: 'macos',
56
+ sourceVersion: '26',
57
+ },
58
+ 'edge-to-edge': {
59
+ sourcePlatform: 'macos',
60
+ sourceVersion: '27',
61
+ },
62
+ })
63
+ })
64
+
65
+ it('keeps the macOS 27 edge-to-edge sidebar canvas-owned', () => {
66
+ const aliases = readFileSync(
67
+ resolve(process.cwd(), 'src/tokens/macos-27/aliases.css'),
68
+ 'utf8',
69
+ )
70
+ const compatibility = readFileSync(
71
+ resolve(process.cwd(), 'src/tokens/macos-27/compatibility.css'),
72
+ 'utf8',
73
+ )
74
+
75
+ expect(aliases).toContain('--m-ui-sidebar-material-fill: transparent;')
76
+ expect(aliases).toContain('--m-ui-sidebar-glass-effect-radius: 0px;')
77
+ expect(aliases).toContain('--m-ui-sidebar-divider-width: 0px;')
78
+ expect(compatibility).toContain(
79
+ '--sidebar: var(--m-ui-sidebar-material-fill);',
80
+ )
81
+ expect(compatibility).toContain(
82
+ "[data-ui-sidebar-style='edge-to-edge'][data-slot='sidebar']",
83
+ )
84
+ expect(compatibility).toContain('--sidebar: transparent;')
85
+ expect(compatibility).toContain('--sidebar-border: transparent;')
86
+ })
87
+
88
+ it('preserves the macOS 26 floating-sidebar source values exactly', () => {
89
+ const source = readFileSync(
90
+ resolve(
91
+ process.cwd(),
92
+ 'src/tokens/macos-26/source/sidebar.generated.css',
93
+ ),
94
+ 'utf8',
95
+ )
96
+ const requiredValues = [
97
+ '--m26-source-sidebar-width-reference: 240px;',
98
+ '--m26-source-sidebar-radius-shell: 18px;',
99
+ '--m26-source-sidebar-radius-item: 5px;',
100
+ '--m26-source-sidebar-radius-selection: 8px;',
101
+ '--m26-source-sidebar-corner-smoothing: 60%;',
102
+ '--m26-source-sidebar-shadow: 0 8px 40px rgb(0 0 0 / 12%);',
103
+ '--m26-source-sidebar-glass-effect-radius: 12px;',
104
+ '--m26-source-sidebar-padding-block: 10px;',
105
+ '--m26-source-sidebar-row-inset-inline: 10px;',
106
+ '--m26-source-sidebar-row-height-small: 24px;',
107
+ '--m26-source-sidebar-row-height-medium: 32px;',
108
+ '--m26-source-sidebar-row-height-large: 40px;',
109
+ '--m26-source-sidebar-section-height-small: 34px;',
110
+ '--m26-source-sidebar-section-height-medium: 39px;',
111
+ '--m26-source-sidebar-section-height-large: 43px;',
112
+ '--m26-source-sidebar-selection-light: rgb(0 0 0 / 11%);',
113
+ ]
114
+
115
+ expect(source).toContain("[data-ui-platform-version='26']")
116
+ expect(source).toContain("[data-ui-sidebar-style='floating']")
117
+ for (const value of requiredValues) expect(source).toContain(value)
118
+ })
119
+
120
+ it('keeps floating dark overrides on their own profile boundary', () => {
121
+ const floatingAliases = readFileSync(
122
+ resolve(process.cwd(), 'src/tokens/macos-26/aliases.css'),
123
+ 'utf8',
124
+ )
125
+ const moldableBrand = readFileSync(
126
+ resolve(process.cwd(), 'src/tokens/moldable/brand.css'),
127
+ 'utf8',
128
+ )
129
+ const descendantDarkAppearance =
130
+ /\[data-ui-sidebar-style='floating'\]\s+\[data-ui-appearance='dark'\]/
131
+
132
+ expect(floatingAliases).toContain(
133
+ "[data-ui-sidebar-style='floating'][data-ui-appearance='dark']",
134
+ )
135
+ expect(floatingAliases).not.toMatch(descendantDarkAppearance)
136
+ expect(moldableBrand).not.toMatch(descendantDarkAppearance)
137
+ })
138
+
139
+ it('scopes every source stylesheet to its platform and version', () => {
140
+ const sourceRoot = resolve(process.cwd(), 'src/tokens/macos-27/source')
141
+ const stylesheets = readdirSync(sourceRoot)
142
+ .filter((name) => name.endsWith('.css'))
143
+ .map((name) => join(sourceRoot, name))
144
+ const violations = stylesheets.filter((path) => {
145
+ const source = readFileSync(path, 'utf8')
146
+ return (
147
+ source.includes(':root') ||
148
+ !source.includes("[data-ui-platform='macos']") ||
149
+ !source.includes("[data-ui-platform-version='27']")
150
+ )
151
+ })
152
+
153
+ expect(violations).toEqual([])
154
+ })
155
+
156
+ it('keeps web adaptations explicit, traceable, and outside the source export', () => {
157
+ const packRoot = resolve(process.cwd(), 'src/tokens/macos-27')
158
+ const index = readFileSync(join(packRoot, 'index.css'), 'utf8')
159
+ const sourceEntry = readFileSync(join(packRoot, 'source.css'), 'utf8')
160
+ const sourceStyles = readdirSync(join(packRoot, 'source'))
161
+ .filter((name) => name.endsWith('.css'))
162
+ .map((name) => readFileSync(join(packRoot, 'source', name), 'utf8'))
163
+ .join('\n')
164
+ const adaptationCss = readFileSync(
165
+ join(packRoot, 'web-adaptations.css'),
166
+ 'utf8',
167
+ )
168
+ const manifest = JSON.parse(
169
+ readFileSync(join(packRoot, 'web-adaptations.json'), 'utf8'),
170
+ ) as WebAdaptationManifest
171
+ const normalizeCss = (value: string) => value.replace(/\s+/g, ' ').trim()
172
+ const normalizedSourceStyles = normalizeCss(sourceStyles)
173
+ const normalizedAdaptationCss = normalizeCss(adaptationCss)
174
+
175
+ expect(index).toContain("@import './web-adaptations.css';")
176
+ expect(sourceEntry).not.toContain('web-adaptations')
177
+ expect(manifest).toMatchObject({
178
+ source: 'macOS 27',
179
+ target: 'web',
180
+ schemaVersion: 1,
181
+ idConvention: 'M27-WEB-{AREA}-{NNN}',
182
+ })
183
+
184
+ const ids = manifest.adaptations.map(({ id }) => id)
185
+ expect(new Set(ids).size).toBe(ids.length)
186
+
187
+ for (const adaptation of manifest.adaptations) {
188
+ expect(adaptation.status).toBe('intentional-divergence')
189
+ expect(adaptationCss).toContain(`@m27-divergence ${adaptation.id}`)
190
+
191
+ for (const override of adaptation.overrides) {
192
+ expect(normalizedSourceStyles).toContain(
193
+ `${override.token}: ${override.sourceValue};`,
194
+ )
195
+ expect(normalizedAdaptationCss).toContain(
196
+ `${override.token}: ${override.adaptedValue};`,
197
+ )
198
+ }
199
+ }
200
+ })
201
+
202
+ it('fully shadows the legacy Tailwind semantic environment per pack', () => {
203
+ const compatibility = readFileSync(
204
+ resolve(process.cwd(), 'src/tokens/macos-27/compatibility.css'),
205
+ 'utf8',
206
+ )
207
+ const requiredVariables = [
208
+ '--font-family-ui',
209
+ '--type-display-size',
210
+ '--type-badge-size',
211
+ '--density-control-height-md',
212
+ '--density-badge-height',
213
+ '--shape-control',
214
+ '--background',
215
+ '--foreground',
216
+ '--card',
217
+ '--popover',
218
+ '--primary',
219
+ '--secondary',
220
+ '--muted',
221
+ '--accent',
222
+ '--destructive',
223
+ '--border',
224
+ '--input',
225
+ '--ring',
226
+ '--sidebar',
227
+ '--surface-canvas',
228
+ '--surface-toolbar',
229
+ '--control-hover',
230
+ '--toolbar-control-background',
231
+ '--material-medium-fill',
232
+ '--material-shadow-card',
233
+ '--material-shadow-window',
234
+ '--window-chrome-background',
235
+ ]
236
+
237
+ expect(compatibility).toContain("[data-ui-platform='macos']")
238
+ expect(compatibility).toContain("[data-ui-platform-version='27']")
239
+ for (const variable of requiredVariables) {
240
+ expect(compatibility).toContain(`${variable}:`)
241
+ }
242
+ })
243
+
244
+ it('maps the macOS unified toolbar to its full 52px platform metric', () => {
245
+ const chromeSource = readFileSync(
246
+ resolve(process.cwd(), 'src/tokens/macos-27/source/chrome.generated.css'),
247
+ 'utf8',
248
+ )
249
+ const compatibility = readFileSync(
250
+ resolve(process.cwd(), 'src/tokens/macos-27/compatibility.css'),
251
+ 'utf8',
252
+ )
253
+
254
+ expect(chromeSource).toContain(
255
+ '--m27-source-chrome-toolbar-unified-height: 52px;',
256
+ )
257
+ expect(chromeSource).toContain(
258
+ '--m27-source-chrome-toolbar-unified-padding-block: 8px;',
259
+ )
260
+ expect(compatibility.replace(/\s+/g, ' ')).toContain(
261
+ '--density-toolbar-height: var(--m27-source-chrome-toolbar-unified-height);',
262
+ )
263
+ })
264
+
265
+ it('only applies Moldable deltas when the Moldable theme is selected', () => {
266
+ const brand = readFileSync(
267
+ resolve(process.cwd(), 'src/tokens/moldable/brand.css'),
268
+ 'utf8',
269
+ )
270
+
271
+ expect(brand).toContain("[data-ui-theme='moldable']")
272
+ expect(brand).toContain(
273
+ "[data-ui-theme='moldable'][data-ui-sidebar-style='floating']",
274
+ )
275
+ expect(brand).toContain(
276
+ "[data-ui-theme='moldable'][data-ui-sidebar-style='floating'][data-ui-appearance='dark']",
277
+ )
278
+ expect(brand).not.toMatch(
279
+ /\[data-ui-sidebar-style='floating'\]\s+\[data-ui-appearance='dark'\]/,
280
+ )
281
+ expect(brand).toContain('--m-ui-surface-content: #181818;')
282
+ expect(brand).toContain("[data-slot='select-trigger']")
283
+ expect(brand).toContain("[data-slot='select-content']")
284
+ expect(brand).toContain("[data-slot='dropdown-menu-content']")
285
+ expect(brand).toContain('--material-shadow-overlay: var(--shadow-md);')
286
+ expect(brand).toContain('--m-ui-sidebar-material-fill: #1b1d1e;')
287
+ expect(brand).toContain('--m-ui-sidebar-border-color: #394043;')
288
+ expect(brand).toContain(
289
+ '--sidebar-accent-foreground: var(--m-ui-color-accent);',
290
+ )
291
+ expect(brand).toContain('0 4px 14px rgb(0 0 0 / 6%)')
292
+ expect(brand).not.toMatch(/(^|[,\s]):root(?=[\s,{])/)
293
+ })
294
+ })