@griffel/transform 3.0.3 → 3.0.5

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 (188) hide show
  1. package/CHANGELOG.json +404 -0
  2. package/CHANGELOG.md +130 -0
  3. package/__fixtures__/assets/blank.jpg +0 -0
  4. package/__fixtures__/assets/code.ts +12 -0
  5. package/__fixtures__/assets/empty.jpg +0 -0
  6. package/__fixtures__/assets/output.meta.json +12 -0
  7. package/__fixtures__/assets/output.ts +12 -0
  8. package/__fixtures__/assets-multiple-declarations/blank.jpg +0 -0
  9. package/__fixtures__/assets-multiple-declarations/code.ts +8 -0
  10. package/__fixtures__/assets-multiple-declarations/empty.jpg +0 -0
  11. package/__fixtures__/assets-multiple-declarations/output.meta.json +9 -0
  12. package/__fixtures__/assets-multiple-declarations/output.ts +6 -0
  13. package/__fixtures__/assets-reset-styles/blank.jpg +0 -0
  14. package/__fixtures__/assets-reset-styles/code.ts +11 -0
  15. package/__fixtures__/assets-reset-styles/empty.jpg +0 -0
  16. package/__fixtures__/assets-reset-styles/output.meta.json +11 -0
  17. package/__fixtures__/assets-reset-styles/output.ts +7 -0
  18. package/__fixtures__/assets-urls/code.ts +13 -0
  19. package/__fixtures__/assets-urls/output.meta.json +14 -0
  20. package/__fixtures__/assets-urls/output.ts +10 -0
  21. package/__fixtures__/at-rules/code.ts +14 -0
  22. package/__fixtures__/at-rules/output.meta.json +15 -0
  23. package/__fixtures__/at-rules/output.ts +10 -0
  24. package/__fixtures__/config-classname-hash-salt/code.ts +5 -0
  25. package/__fixtures__/config-classname-hash-salt/output.meta.json +7 -0
  26. package/__fixtures__/config-classname-hash-salt/output.ts +3 -0
  27. package/__fixtures__/config-evaluation-rules/code.ts +8 -0
  28. package/__fixtures__/config-evaluation-rules/consts.ts +1 -0
  29. package/__fixtures__/config-evaluation-rules/output.meta.json +7 -0
  30. package/__fixtures__/config-evaluation-rules/output.ts +4 -0
  31. package/__fixtures__/config-evaluation-rules/sampleEvaluator.cjs +12 -0
  32. package/__fixtures__/error-argument-count/fixture.js +4 -0
  33. package/__fixtures__/error-cjs/fixture.js +4 -0
  34. package/__fixtures__/error-on-undefined/fixture.ts +7 -0
  35. package/__fixtures__/error-on-undefined/tokens.ts +1 -0
  36. package/__fixtures__/export-default/code.ts +6 -0
  37. package/__fixtures__/export-default/output.meta.json +14 -0
  38. package/__fixtures__/export-default/output.ts +6 -0
  39. package/__fixtures__/function-mixin/code.ts +6 -0
  40. package/__fixtures__/function-mixin/mixins.ts +7 -0
  41. package/__fixtures__/function-mixin/output.meta.json +7 -0
  42. package/__fixtures__/function-mixin/output.ts +4 -0
  43. package/__fixtures__/function-mixin/tokens.ts +3 -0
  44. package/__fixtures__/import-alias/code.ts +5 -0
  45. package/__fixtures__/import-alias/output.meta.json +7 -0
  46. package/__fixtures__/import-alias/output.ts +3 -0
  47. package/__fixtures__/import-custom-module/code.ts +6 -0
  48. package/__fixtures__/import-custom-module/output.meta.json +7 -0
  49. package/__fixtures__/import-custom-module/output.ts +4 -0
  50. package/__fixtures__/keyframes/code.ts +22 -0
  51. package/__fixtures__/keyframes/output.meta.json +17 -0
  52. package/__fixtures__/keyframes/output.ts +6 -0
  53. package/__fixtures__/multiple-declarations/code.ts +8 -0
  54. package/__fixtures__/multiple-declarations/output.meta.json +7 -0
  55. package/__fixtures__/multiple-declarations/output.ts +4 -0
  56. package/__fixtures__/non-existing-module-call/code.ts +10 -0
  57. package/__fixtures__/non-existing-module-call/module.ts +13 -0
  58. package/__fixtures__/non-existing-module-call/output.meta.json +7 -0
  59. package/__fixtures__/non-existing-module-call/output.ts +6 -0
  60. package/__fixtures__/object/code.ts +6 -0
  61. package/__fixtures__/object/output.meta.json +14 -0
  62. package/__fixtures__/object/output.ts +6 -0
  63. package/__fixtures__/object-computed-keys/code.ts +8 -0
  64. package/__fixtures__/object-computed-keys/output.meta.json +14 -0
  65. package/__fixtures__/object-computed-keys/output.ts +8 -0
  66. package/__fixtures__/object-imported-keys/code.ts +9 -0
  67. package/__fixtures__/object-imported-keys/consts.ts +2 -0
  68. package/__fixtures__/object-imported-keys/output.meta.json +7 -0
  69. package/__fixtures__/object-imported-keys/output.ts +4 -0
  70. package/__fixtures__/object-mixins/code.ts +11 -0
  71. package/__fixtures__/object-mixins/mixins.ts +17 -0
  72. package/__fixtures__/object-mixins/output.meta.json +16 -0
  73. package/__fixtures__/object-mixins/output.ts +10 -0
  74. package/__fixtures__/object-mixins/tokens.ts +3 -0
  75. package/__fixtures__/object-nesting/code.ts +13 -0
  76. package/__fixtures__/object-nesting/consts.ts +1 -0
  77. package/__fixtures__/object-nesting/output.meta.json +9 -0
  78. package/__fixtures__/object-nesting/output.ts +6 -0
  79. package/__fixtures__/object-reset/code.ts +8 -0
  80. package/__fixtures__/object-reset/output.meta.json +7 -0
  81. package/__fixtures__/object-reset/output.ts +5 -0
  82. package/__fixtures__/object-sequence-expr/code.ts +16 -0
  83. package/__fixtures__/object-sequence-expr/output.meta.json +7 -0
  84. package/__fixtures__/object-sequence-expr/output.ts +7 -0
  85. package/__fixtures__/object-shorthands/code.ts +8 -0
  86. package/__fixtures__/object-shorthands/output.meta.json +20 -0
  87. package/__fixtures__/object-shorthands/output.ts +5 -0
  88. package/__fixtures__/object-variables/code.ts +9 -0
  89. package/__fixtures__/object-variables/output.meta.json +15 -0
  90. package/__fixtures__/object-variables/output.ts +9 -0
  91. package/__fixtures__/object-variables/vars.ts +5 -0
  92. package/__fixtures__/reset-styles/code.ts +6 -0
  93. package/__fixtures__/reset-styles/output.meta.json +7 -0
  94. package/__fixtures__/reset-styles/output.ts +3 -0
  95. package/__fixtures__/reset-styles-at-rules/code.ts +7 -0
  96. package/__fixtures__/reset-styles-at-rules/output.meta.json +8 -0
  97. package/__fixtures__/reset-styles-at-rules/output.ts +3 -0
  98. package/__fixtures__/rules-with-metadata/code.ts +9 -0
  99. package/__fixtures__/rules-with-metadata/output.meta.json +14 -0
  100. package/__fixtures__/rules-with-metadata/output.ts +3 -0
  101. package/__fixtures__/shared-mixins/code.ts +7 -0
  102. package/__fixtures__/shared-mixins/mixins.ts +6 -0
  103. package/__fixtures__/shared-mixins/output.meta.json +7 -0
  104. package/__fixtures__/shared-mixins/output.ts +8 -0
  105. package/__fixtures__/static-styles/code.ts +7 -0
  106. package/__fixtures__/static-styles/output.meta.json +7 -0
  107. package/__fixtures__/static-styles/output.ts +3 -0
  108. package/__fixtures__/static-styles-array/code.ts +10 -0
  109. package/__fixtures__/static-styles-array/output.meta.json +7 -0
  110. package/__fixtures__/static-styles-array/output.ts +3 -0
  111. package/__fixtures__/static-styles-string/code.ts +3 -0
  112. package/__fixtures__/static-styles-string/output.meta.json +7 -0
  113. package/__fixtures__/static-styles-string/output.ts +3 -0
  114. package/__fixtures__/tokens/code.ts +11 -0
  115. package/__fixtures__/tokens/output.meta.json +12 -0
  116. package/__fixtures__/tokens/output.ts +7 -0
  117. package/__fixtures__/tokens/tokens.ts +4 -0
  118. package/__fixtures__/unsupported-css-properties/fixture.ts +16 -0
  119. package/__fixtures__/unsupported-css-properties/output.meta.json +5 -0
  120. package/__fixtures__/unsupported-css-properties/output.ts +3 -0
  121. package/eslint.config.mjs +31 -0
  122. package/package.json +7 -8
  123. package/project.json +51 -0
  124. package/src/{constants.mjs → constants.mts} +0 -1
  125. package/src/evaluation/astEvaluator.mts +109 -0
  126. package/src/evaluation/astEvaluator.test.mts +126 -0
  127. package/src/evaluation/batchEvaluator.mts +79 -0
  128. package/src/evaluation/evalCache.mts +84 -0
  129. package/src/evaluation/fluentTokensPlugin.mts +82 -0
  130. package/src/evaluation/fluentTokensPlugin.test.mts +130 -0
  131. package/src/evaluation/module.mts +271 -0
  132. package/src/evaluation/module.test.mts +133 -0
  133. package/src/evaluation/{process.mjs → process.mts} +12 -7
  134. package/src/evaluation/types.mts +49 -0
  135. package/src/evaluation/vmEvaluator.mts +45 -0
  136. package/src/evaluation/vmEvaluator.test.mts +30 -0
  137. package/src/{index.d.mts → index.mts} +4 -0
  138. package/src/transformSync.mts +425 -0
  139. package/src/transformSync.test.mts +429 -0
  140. package/src/types.mts +13 -0
  141. package/src/utils/convertESMtoCJS.mts +226 -0
  142. package/src/utils/convertESMtoCJS.test.mts +159 -0
  143. package/src/utils/dedupeCSSRules.mts +25 -0
  144. package/src/utils/dedupeCSSRules.test.mts +39 -0
  145. package/tsconfig.json +19 -0
  146. package/tsconfig.lib.json +30 -0
  147. package/tsconfig.spec.json +24 -0
  148. package/vitest.config.mts +18 -0
  149. package/LICENSE.md +0 -21
  150. package/src/constants.d.mts +0 -2
  151. package/src/constants.mjs.map +0 -1
  152. package/src/evaluation/astEvaluator.d.mts +0 -20
  153. package/src/evaluation/astEvaluator.mjs +0 -90
  154. package/src/evaluation/astEvaluator.mjs.map +0 -1
  155. package/src/evaluation/batchEvaluator.d.mts +0 -13
  156. package/src/evaluation/batchEvaluator.mjs +0 -54
  157. package/src/evaluation/batchEvaluator.mjs.map +0 -1
  158. package/src/evaluation/evalCache.d.mts +0 -9
  159. package/src/evaluation/evalCache.mjs +0 -65
  160. package/src/evaluation/evalCache.mjs.map +0 -1
  161. package/src/evaluation/fluentTokensPlugin.d.mts +0 -2
  162. package/src/evaluation/fluentTokensPlugin.mjs +0 -70
  163. package/src/evaluation/fluentTokensPlugin.mjs.map +0 -1
  164. package/src/evaluation/module.d.mts +0 -44
  165. package/src/evaluation/module.mjs +0 -207
  166. package/src/evaluation/module.mjs.map +0 -1
  167. package/src/evaluation/process.d.mts +0 -24
  168. package/src/evaluation/process.mjs.map +0 -1
  169. package/src/evaluation/types.d.mts +0 -34
  170. package/src/evaluation/types.mjs +0 -2
  171. package/src/evaluation/types.mjs.map +0 -1
  172. package/src/evaluation/vmEvaluator.d.mts +0 -3
  173. package/src/evaluation/vmEvaluator.mjs +0 -33
  174. package/src/evaluation/vmEvaluator.mjs.map +0 -1
  175. package/src/index.mjs +0 -9
  176. package/src/index.mjs.map +0 -1
  177. package/src/transformSync.d.mts +0 -41
  178. package/src/transformSync.mjs +0 -252
  179. package/src/transformSync.mjs.map +0 -1
  180. package/src/types.d.mts +0 -12
  181. package/src/types.mjs +0 -2
  182. package/src/types.mjs.map +0 -1
  183. package/src/utils/convertESMtoCJS.d.mts +0 -6
  184. package/src/utils/convertESMtoCJS.mjs +0 -203
  185. package/src/utils/convertESMtoCJS.mjs.map +0 -1
  186. package/src/utils/dedupeCSSRules.d.mts +0 -6
  187. package/src/utils/dedupeCSSRules.mjs +0 -19
  188. package/src/utils/dedupeCSSRules.mjs.map +0 -1
@@ -0,0 +1,14 @@
1
+ {
2
+ "usedProcessing": true,
3
+ "usedVMForEvaluation": false,
4
+ "cssRulesByBucket": {
5
+ "d": [
6
+ ".f405sdg{background-image:url(http://www.example.com);}",
7
+ ".fvpuk3z{background-image:url(https://www.example.com);}",
8
+ ".fcrzfig{background-image:url(\"https://www.example.com\");}",
9
+ ".f1b0d1k8{background-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);}",
10
+ ".f15gfcnl{background-image:url('data:image/svg+xml,%3Csvg xmlns=\"http://www.w3.org/2000/svg\" height=\"32\" aria-hidden=\"true\" viewBox=\"0 0 16 16\" width=\"32\" data-view-component=\"true\" class=\"octicon octicon-mark-github v-align-middle\"%3E%3Cpath fill-rule=\"evenodd\" d=\"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z\"%3E%3C/path%3E%3C/svg%3E');}",
11
+ ".f1bk4c0y{filter:url(#a);}"
12
+ ]
13
+ }
14
+ }
@@ -0,0 +1,10 @@
1
+ import { __css } from '@griffel/react';
2
+
3
+ export const useStyles = __css({
4
+ httpUrl: { Bcmaq0h: 'f405sdg' },
5
+ httpsUrl: { Bcmaq0h: 'fvpuk3z' },
6
+ httpsUrlWithQuotes: { Bcmaq0h: 'fcrzfig' },
7
+ dataUrl: { Bcmaq0h: 'f1b0d1k8' },
8
+ dataUrlQuotes: { Bcmaq0h: 'f15gfcnl' },
9
+ hashOnly: { Bhu2qc9: 'f1bk4c0y' },
10
+ });
@@ -0,0 +1,14 @@
1
+ import { makeStyles } from '@griffel/react';
2
+
3
+ export const useStyles = makeStyles({
4
+ root: {
5
+ '@media (min-width: 600px)': {
6
+ paddingLeft: '4px',
7
+ paddingRight: '4px',
8
+ },
9
+ '@supports (display: flex)': {
10
+ paddingLeft: '4px',
11
+ paddingRight: '4px',
12
+ },
13
+ },
14
+ });
@@ -0,0 +1,15 @@
1
+ {
2
+ "usedProcessing": true,
3
+ "usedVMForEvaluation": false,
4
+ "cssRulesByBucket": {
5
+ "m": [
6
+ [
7
+ "@media (min-width: 600px){.f1h4p6a1{padding-right:4px;}.fgefjy{padding-left:4px;}}",
8
+ {
9
+ "m": "(min-width: 600px)"
10
+ }
11
+ ]
12
+ ],
13
+ "t": ["@supports (display: flex){.f1dyc5nu{padding-left:4px;}.f1kq3x14{padding-right:4px;}}"]
14
+ }
15
+ }
@@ -0,0 +1,10 @@
1
+ import { __css } from '@griffel/react';
2
+
3
+ export const useStyles = __css({
4
+ root: {
5
+ wbkd2a: ['fgefjy', 'f1h4p6a1'],
6
+ Dt0rau: ['f1h4p6a1', 'fgefjy'],
7
+ k2kg1z: ['f1dyc5nu', 'f1kq3x14'],
8
+ Blnc60a: ['f1kq3x14', 'f1dyc5nu'],
9
+ },
10
+ });
@@ -0,0 +1,5 @@
1
+ import { makeStyles } from '@griffel/react';
2
+
3
+ export const useStyles = makeStyles({
4
+ root: { color: 'red', paddingLeft: '4px' },
5
+ });
@@ -0,0 +1,7 @@
1
+ {
2
+ "usedProcessing": true,
3
+ "usedVMForEvaluation": false,
4
+ "cssRulesByBucket": {
5
+ "d": [".feohi3x{color:red;}", ".f1rwgqon{padding-left:4px;}", ".f1tyzn0d{padding-right:4px;}"]
6
+ }
7
+ }
@@ -0,0 +1,3 @@
1
+ import { __css } from '@griffel/react';
2
+
3
+ export const useStyles = __css({ root: { sj55zd: 'feohi3x', uwmqm3: ['f1rwgqon', 'f1tyzn0d'] } });
@@ -0,0 +1,8 @@
1
+ import { makeStyles } from '@griffel/react';
2
+ import { colorRed } from './consts';
3
+
4
+ export const useStyles = makeStyles({
5
+ // This import has no sense, but it will prevent us from evaluation in AST by Babel
6
+ // This fixture uses "sampleEvaluator.js" in transformPlugin's config so input we should get a different color
7
+ root: { color: colorRed },
8
+ });
@@ -0,0 +1 @@
1
+ export const colorRed = 'red';
@@ -0,0 +1,7 @@
1
+ {
2
+ "usedProcessing": true,
3
+ "usedVMForEvaluation": true,
4
+ "cssRulesByBucket": {
5
+ "d": [".f163i14w{color:blue;}"]
6
+ }
7
+ }
@@ -0,0 +1,4 @@
1
+ import { __css } from '@griffel/react';
2
+ import { colorRed } from './consts';
3
+
4
+ export const useStyles = __css({ root: { sj55zd: 'f163i14w' } });
@@ -0,0 +1,12 @@
1
+ // @ts-check
2
+
3
+ /** @type {import("@linaria/babel-preset").Evaluator} */
4
+ const sampleEvaluator = () => {
5
+ // Evaluators transform input code to something that will be evaluated by Node later. In evaluatePathsInVM() we expect
6
+ // that results will be available as "exports.__mkPreval", this evaluator mocks it
7
+ const result = `exports.__mkPreval = [{ root: { color: 'blue' } }]`;
8
+
9
+ return { code: result, imports: null, moduleKind: 'cjs' };
10
+ };
11
+
12
+ module.exports.default = sampleEvaluator;
@@ -0,0 +1,4 @@
1
+ import { makeStyles } from '@griffel/react';
2
+
3
+ // This file is .js intentionally to avoid TS compiler errors
4
+ export const useStyles = makeStyles({ root: { color: 'red' } }, 'foo');
@@ -0,0 +1,4 @@
1
+ const { makeStyles } = require('@griffel/react');
2
+
3
+ const useStyles = makeStyles({ root: { color: 'red' } });
4
+ module.exports = { useStyles };
@@ -0,0 +1,7 @@
1
+ import { makeStyles } from '@griffel/react';
2
+ // @ts-expect-error This module does not have exported member 'colors'
3
+ import { colors } from './tokens';
4
+
5
+ export const useClassesA = makeStyles({
6
+ root: { color: colors.foreground },
7
+ });
@@ -0,0 +1 @@
1
+ export const tokens = {};
@@ -0,0 +1,6 @@
1
+ import { makeStyles } from '@griffel/react';
2
+
3
+ export default makeStyles({
4
+ root: { color: 'red', paddingLeft: '4px' },
5
+ icon: { backgroundColor: 'green', marginLeft: '4px' },
6
+ });
@@ -0,0 +1,14 @@
1
+ {
2
+ "usedProcessing": true,
3
+ "usedVMForEvaluation": false,
4
+ "cssRulesByBucket": {
5
+ "d": [
6
+ ".fe3e8s9{color:red;}",
7
+ ".fycuoez{padding-left:4px;}",
8
+ ".f8wuabp{padding-right:4px;}",
9
+ ".fcnqdeg{background-color:green;}",
10
+ ".fjf1xye{margin-left:4px;}",
11
+ ".f8zmjen{margin-right:4px;}"
12
+ ]
13
+ }
14
+ }
@@ -0,0 +1,6 @@
1
+ import { __css } from '@griffel/react';
2
+
3
+ export default __css({
4
+ root: { sj55zd: 'fe3e8s9', uwmqm3: ['fycuoez', 'f8wuabp'] },
5
+ icon: { De3pzq: 'fcnqdeg', Frg6f3: ['fjf1xye', 'f8zmjen'] },
6
+ });
@@ -0,0 +1,6 @@
1
+ import { makeStyles } from '@griffel/react';
2
+ import { createMixin } from './mixins';
3
+
4
+ export const useStyles = makeStyles({
5
+ avatar: createMixin({ display: 'block', opacity: '0' }),
6
+ });
@@ -0,0 +1,7 @@
1
+ import type { GriffelStyle } from '@griffel/core';
2
+ import { tokens } from './tokens';
3
+
4
+ export const createMixin = (rule: GriffelStyle): GriffelStyle => ({
5
+ color: tokens.colorBrandBackground,
6
+ ...rule,
7
+ });
@@ -0,0 +1,7 @@
1
+ {
2
+ "usedProcessing": true,
3
+ "usedVMForEvaluation": true,
4
+ "cssRulesByBucket": {
5
+ "d": [".f1817uup{color:var(--colorBrandBackground);}", ".ftgm304{display:block;}", ".fk73vx1{opacity:0;}"]
6
+ }
7
+ }
@@ -0,0 +1,4 @@
1
+ import { __css } from '@griffel/react';
2
+ import { createMixin } from './mixins';
3
+
4
+ export const useStyles = __css({ avatar: { sj55zd: 'f1817uup', mc9l5x: 'ftgm304', abs64n: 'fk73vx1' } });
@@ -0,0 +1,3 @@
1
+ export const tokens = {
2
+ colorBrandBackground: 'var(--colorBrandBackground)',
3
+ };
@@ -0,0 +1,5 @@
1
+ import { makeStyles as createStyles } from '@griffel/react';
2
+
3
+ export const useStyles = createStyles({
4
+ root: { color: 'red' },
5
+ });
@@ -0,0 +1,7 @@
1
+ {
2
+ "usedProcessing": true,
3
+ "usedVMForEvaluation": false,
4
+ "cssRulesByBucket": {
5
+ "d": [".fe3e8s9{color:red;}"]
6
+ }
7
+ }
@@ -0,0 +1,3 @@
1
+ import { __css } from '@griffel/react';
2
+
3
+ export const useStyles = __css({ root: { sj55zd: 'fe3e8s9' } });
@@ -0,0 +1,6 @@
1
+ // @ts-expect-error This module does not exist, but will be resolved via aliases
2
+ import { makeStyles } from 'custom-package';
3
+
4
+ export const useStyles = makeStyles({
5
+ root: { color: 'red' },
6
+ });
@@ -0,0 +1,7 @@
1
+ {
2
+ "usedProcessing": true,
3
+ "usedVMForEvaluation": false,
4
+ "cssRulesByBucket": {
5
+ "d": [".fe3e8s9{color:red;}"]
6
+ }
7
+ }
@@ -0,0 +1,4 @@
1
+ // @ts-expect-error This module does not exist, but will be resolved via aliases
2
+ import { __css } from 'custom-package';
3
+
4
+ export const useStyles = __css({ root: { sj55zd: 'fe3e8s9' } });
@@ -0,0 +1,22 @@
1
+ import { makeStyles } from '@griffel/react';
2
+
3
+ export const useStyles = makeStyles({
4
+ single: {
5
+ animationName: {
6
+ from: { transform: 'rotate(0deg)' },
7
+ to: { transform: 'rotate(360deg)' },
8
+ },
9
+ },
10
+ multiple: {
11
+ animationName: [
12
+ {
13
+ from: { transform: 'rotate(0deg)' },
14
+ to: { transform: 'rotate(360deg)' },
15
+ },
16
+ {
17
+ from: { height: '100px' },
18
+ to: { height: '200px' },
19
+ },
20
+ ],
21
+ },
22
+ });
@@ -0,0 +1,17 @@
1
+ {
2
+ "usedProcessing": true,
3
+ "usedVMForEvaluation": true,
4
+ "cssRulesByBucket": {
5
+ "k": [
6
+ "@keyframes f1q8eu9e{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}",
7
+ "@keyframes f55c0se{from{transform:rotate(0deg);}to{transform:rotate(-360deg);}}",
8
+ "@keyframes f19fnzg9{from{height:100px;}to{height:200px;}}"
9
+ ],
10
+ "d": [
11
+ ".f1g6ul6r{animation-name:f1q8eu9e;}",
12
+ ".f1fp4ujf{animation-name:f55c0se;}",
13
+ ".f1e467oh{animation-name:f1q8eu9e,f19fnzg9;}",
14
+ ".f1w9bd63{animation-name:f55c0se,f19fnzg9;}"
15
+ ]
16
+ }
17
+ }
@@ -0,0 +1,6 @@
1
+ import { __css } from '@griffel/react';
2
+
3
+ export const useStyles = __css({
4
+ single: { Bv12yb3: ['f1g6ul6r', 'f1fp4ujf'] },
5
+ multiple: { Bv12yb3: ['f1e467oh', 'f1w9bd63'] },
6
+ });
@@ -0,0 +1,8 @@
1
+ import { makeStyles } from '@griffel/react';
2
+
3
+ export const useStyles1 = makeStyles({
4
+ root: { color: 'red' },
5
+ });
6
+ export const useStyles2 = makeStyles({
7
+ root: { color: 'green' },
8
+ });
@@ -0,0 +1,7 @@
1
+ {
2
+ "usedProcessing": true,
3
+ "usedVMForEvaluation": false,
4
+ "cssRulesByBucket": {
5
+ "d": [".fka9v86{color:green;}", ".fe3e8s9{color:red;}"]
6
+ }
7
+ }
@@ -0,0 +1,4 @@
1
+ import { __css } from '@griffel/react';
2
+
3
+ export const useStyles1 = __css({ root: { sj55zd: 'fe3e8s9' } });
4
+ export const useStyles2 = __css({ root: { sj55zd: 'fka9v86' } });
@@ -0,0 +1,10 @@
1
+ import { makeStyles } from '@griffel/react';
2
+ import { createModule } from './module';
3
+
4
+ export const useStyles = makeStyles({
5
+ container: {
6
+ color: 'red',
7
+ },
8
+ });
9
+
10
+ createModule().baz();
@@ -0,0 +1,13 @@
1
+ type FakeModule = {
2
+ foo: () => void;
3
+ bar: () => void;
4
+ baz: () => void;
5
+ };
6
+
7
+ export function createModule(): FakeModule {
8
+ return {
9
+ foo: () => {},
10
+ bar: () => {},
11
+ // this implementation intentionally missing "baz" property to throw on calls in runtime
12
+ } as unknown as FakeModule;
13
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "usedProcessing": true,
3
+ "usedVMForEvaluation": false,
4
+ "cssRulesByBucket": {
5
+ "d": [".fe3e8s9{color:red;}"]
6
+ }
7
+ }
@@ -0,0 +1,6 @@
1
+ import { __css } from '@griffel/react';
2
+ import { createModule } from './module';
3
+
4
+ export const useStyles = __css({ container: { sj55zd: 'fe3e8s9' } });
5
+
6
+ createModule().baz();
@@ -0,0 +1,6 @@
1
+ import { makeStyles } from '@griffel/react';
2
+
3
+ export const useStyles = makeStyles({
4
+ root: { color: 'red', paddingLeft: '4px' },
5
+ icon: { backgroundColor: 'green', marginLeft: '4px' },
6
+ });
@@ -0,0 +1,14 @@
1
+ {
2
+ "usedProcessing": true,
3
+ "usedVMForEvaluation": false,
4
+ "cssRulesByBucket": {
5
+ "d": [
6
+ ".fe3e8s9{color:red;}",
7
+ ".fycuoez{padding-left:4px;}",
8
+ ".f8wuabp{padding-right:4px;}",
9
+ ".fcnqdeg{background-color:green;}",
10
+ ".fjf1xye{margin-left:4px;}",
11
+ ".f8zmjen{margin-right:4px;}"
12
+ ]
13
+ }
14
+ }
@@ -0,0 +1,6 @@
1
+ import { __css } from '@griffel/react';
2
+
3
+ export const useStyles = __css({
4
+ root: { sj55zd: 'fe3e8s9', uwmqm3: ['fycuoez', 'f8wuabp'] },
5
+ icon: { De3pzq: 'fcnqdeg', Frg6f3: ['fjf1xye', 'f8zmjen'] },
6
+ });
@@ -0,0 +1,8 @@
1
+ import { makeStyles } from '@griffel/react';
2
+
3
+ const rootSlot = 'root';
4
+
5
+ export const useStyles = makeStyles({
6
+ [rootSlot]: { color: 'red', paddingLeft: '4px' },
7
+ [rootSlot + 'primary']: { backgroundColor: 'green', marginLeft: '4px' },
8
+ });
@@ -0,0 +1,14 @@
1
+ {
2
+ "usedProcessing": true,
3
+ "usedVMForEvaluation": true,
4
+ "cssRulesByBucket": {
5
+ "d": [
6
+ ".fe3e8s9{color:red;}",
7
+ ".fycuoez{padding-left:4px;}",
8
+ ".f8wuabp{padding-right:4px;}",
9
+ ".fcnqdeg{background-color:green;}",
10
+ ".fjf1xye{margin-left:4px;}",
11
+ ".f8zmjen{margin-right:4px;}"
12
+ ]
13
+ }
14
+ }
@@ -0,0 +1,8 @@
1
+ import { __css } from '@griffel/react';
2
+
3
+ const rootSlot = 'root';
4
+
5
+ export const useStyles = __css({
6
+ root: { sj55zd: 'fe3e8s9', uwmqm3: ['fycuoez', 'f8wuabp'] },
7
+ rootprimary: { De3pzq: 'fcnqdeg', Frg6f3: ['fjf1xye', 'f8zmjen'] },
8
+ });
@@ -0,0 +1,9 @@
1
+ import { makeStyles } from '@griffel/react';
2
+ import { className, selector } from './consts';
3
+
4
+ export const useStyles = makeStyles({
5
+ root: {
6
+ [selector]: { color: 'red' },
7
+ [`& .${className}`]: { color: 'blue' },
8
+ },
9
+ });
@@ -0,0 +1,2 @@
1
+ export const className = 'component-foo';
2
+ export const selector = '& .component-bar';
@@ -0,0 +1,7 @@
1
+ {
2
+ "usedProcessing": true,
3
+ "usedVMForEvaluation": true,
4
+ "cssRulesByBucket": {
5
+ "d": [".f1wgwx3x .component-bar{color:red;}", ".fglt6ox .component-foo{color:blue;}"]
6
+ }
7
+ }
@@ -0,0 +1,4 @@
1
+ import { __css } from '@griffel/react';
2
+ import { className, selector } from './consts';
3
+
4
+ export const useStyles = __css({ root: { B0egftl: 'f1wgwx3x', qhv8v2: 'fglt6ox' } });
@@ -0,0 +1,11 @@
1
+ import { makeStyles } from '@griffel/react';
2
+ import { flexStyles, gridStyles, typography } from './mixins';
3
+
4
+ export const useStyles = makeStyles({
5
+ root: flexStyles,
6
+ label: typography.text,
7
+ header: typography.header,
8
+
9
+ icon: { ...flexStyles, color: 'red' },
10
+ image: { ...gridStyles('10px'), color: 'green' },
11
+ });
@@ -0,0 +1,17 @@
1
+ import type { GriffelStyle } from '@griffel/core';
2
+ import { tokens } from './tokens';
3
+
4
+ export const flexStyles: GriffelStyle = {
5
+ display: 'flex',
6
+ flexDirection: 'column',
7
+ };
8
+
9
+ export const gridStyles = (gridGap: string): GriffelStyle => ({
10
+ display: 'grid',
11
+ gridRowGap: gridGap,
12
+ });
13
+
14
+ export const typography: Record<'text' | 'header', GriffelStyle> = {
15
+ text: { fontWeight: tokens.fontWeightRegular },
16
+ header: { fontWeight: 'bold' },
17
+ };
@@ -0,0 +1,16 @@
1
+ {
2
+ "usedProcessing": true,
3
+ "usedVMForEvaluation": true,
4
+ "cssRulesByBucket": {
5
+ "d": [
6
+ ".f22iagw{display:flex;}",
7
+ ".f1vx9l62{flex-direction:column;}",
8
+ ".figsok6{font-weight:var(--fontWeightRegular);}",
9
+ ".f16wzh4i{font-weight:bold;}",
10
+ ".fe3e8s9{color:red;}",
11
+ ".f13qh94s{display:grid;}",
12
+ ".f85kjgz{grid-row-gap:10px;}",
13
+ ".fka9v86{color:green;}"
14
+ ]
15
+ }
16
+ }
@@ -0,0 +1,10 @@
1
+ import { __css } from '@griffel/react';
2
+ import { flexStyles, gridStyles, typography } from './mixins';
3
+
4
+ export const useStyles = __css({
5
+ root: { mc9l5x: 'f22iagw', Beiy3e4: 'f1vx9l62' },
6
+ label: { Bhrd7zp: 'figsok6' },
7
+ header: { Bhrd7zp: 'f16wzh4i' },
8
+ icon: { mc9l5x: 'f22iagw', Beiy3e4: 'f1vx9l62', sj55zd: 'fe3e8s9' },
9
+ image: { mc9l5x: 'f13qh94s', a6qtfi: 'f85kjgz', sj55zd: 'fka9v86' },
10
+ });
@@ -0,0 +1,3 @@
1
+ export const tokens = {
2
+ fontWeightRegular: 'var(--fontWeightRegular)',
3
+ };
@@ -0,0 +1,13 @@
1
+ import { makeStyles } from '@griffel/react';
2
+ import { colorBlue } from './consts';
3
+
4
+ export const useStyles = makeStyles({
5
+ root: {
6
+ display: 'flex',
7
+
8
+ ':hover': { color: 'red' },
9
+ ':focus': { ':hover': { color: colorBlue } },
10
+
11
+ '& .foo': { ':hover': { color: 'green' } },
12
+ },
13
+ });
@@ -0,0 +1 @@
1
+ export const colorBlue = 'blue';
@@ -0,0 +1,9 @@
1
+ {
2
+ "usedProcessing": true,
3
+ "usedVMForEvaluation": true,
4
+ "cssRulesByBucket": {
5
+ "d": [".f22iagw{display:flex;}", ".fh8e7tb .foo:hover{color:green;}"],
6
+ "h": [".faf35ka:hover{color:red;}"],
7
+ "f": [".f17t1d3d:focus:hover{color:blue;}"]
8
+ }
9
+ }
@@ -0,0 +1,6 @@
1
+ import { __css } from '@griffel/react';
2
+ import { colorBlue } from './consts';
3
+
4
+ export const useStyles = __css({
5
+ root: { mc9l5x: 'f22iagw', Bi91k9c: 'faf35ka', Bb9khzn: 'f17t1d3d', Btk3f3y: 'fh8e7tb' },
6
+ });
@@ -0,0 +1,8 @@
1
+ import { makeStyles } from '@griffel/react';
2
+
3
+ export const RESET = 'DO_NOT_USE_DIRECTLY: @griffel/reset-value' as unknown as 'unset';
4
+
5
+ export const useStyles = makeStyles({
6
+ root: { color: 'red', paddingLeft: RESET },
7
+ icon: { color: RESET },
8
+ });
@@ -0,0 +1,7 @@
1
+ {
2
+ "usedProcessing": true,
3
+ "usedVMForEvaluation": true,
4
+ "cssRulesByBucket": {
5
+ "d": [".fe3e8s9{color:red;}"]
6
+ }
7
+ }
@@ -0,0 +1,5 @@
1
+ import { __css } from '@griffel/react';
2
+
3
+ export const RESET = 'DO_NOT_USE_DIRECTLY: @griffel/reset-value' as unknown as 'unset';
4
+
5
+ export const useStyles = __css({ root: { sj55zd: 'fe3e8s9', uwmqm3: 0 }, icon: { sj55zd: 0 } });
@@ -0,0 +1,16 @@
1
+ import type { GriffelStyle } from '@griffel/react';
2
+ import { makeStyles } from '@griffel/react';
3
+
4
+ const switchClassName = 'fui-Switch';
5
+ let _a: Record<string, GriffelStyle>;
6
+
7
+ export const useStyles = makeStyles({
8
+ root:
9
+ ((_a = {}),
10
+ (_a[':hover .' + switchClassName] = {
11
+ ':before': {
12
+ backgroundColor: 'red',
13
+ },
14
+ }),
15
+ _a),
16
+ });