@kutur-kit/oxc 0.1.0-alpha.6 → 0.1.0-alpha.8

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 (139) hide show
  1. package/README.md +75 -27
  2. package/dist/app.d.ts +16 -0
  3. package/dist/app.d.ts.map +1 -0
  4. package/dist/app.js +17 -0
  5. package/dist/app.js.map +1 -0
  6. package/dist/base.d.ts.map +1 -1
  7. package/dist/base.js +5 -1
  8. package/dist/base.js.map +1 -1
  9. package/dist/effect-ui-stylex/class.d.ts +2 -0
  10. package/dist/effect-ui-stylex/class.d.ts.map +1 -0
  11. package/dist/effect-ui-stylex/class.js +109 -0
  12. package/dist/effect-ui-stylex/class.js.map +1 -0
  13. package/dist/effect-ui-stylex/components.d.ts +30 -0
  14. package/dist/effect-ui-stylex/components.d.ts.map +1 -0
  15. package/dist/effect-ui-stylex/components.js +175 -0
  16. package/dist/effect-ui-stylex/components.js.map +1 -0
  17. package/dist/effect-ui-stylex/condition-key.d.ts.map +1 -0
  18. package/dist/{foldkit-stylex → effect-ui-stylex}/condition-key.js +7 -41
  19. package/dist/effect-ui-stylex/condition-key.js.map +1 -0
  20. package/dist/effect-ui-stylex/hover-gate.d.ts.map +1 -0
  21. package/dist/effect-ui-stylex/hover-gate.js.map +1 -0
  22. package/dist/effect-ui-stylex/internal-import.d.ts +2 -0
  23. package/dist/effect-ui-stylex/internal-import.d.ts.map +1 -0
  24. package/dist/effect-ui-stylex/internal-import.js +29 -0
  25. package/dist/effect-ui-stylex/internal-import.js.map +1 -0
  26. package/dist/effect-ui-stylex/layers.d.ts +14 -0
  27. package/dist/effect-ui-stylex/layers.d.ts.map +1 -0
  28. package/dist/effect-ui-stylex/layers.js +118 -0
  29. package/dist/effect-ui-stylex/layers.js.map +1 -0
  30. package/dist/effect-ui-stylex/look-level.d.ts +2 -0
  31. package/dist/effect-ui-stylex/look-level.d.ts.map +1 -0
  32. package/dist/effect-ui-stylex/look-level.js +83 -0
  33. package/dist/effect-ui-stylex/look-level.js.map +1 -0
  34. package/dist/effect-ui-stylex/modules.d.ts +36 -0
  35. package/dist/effect-ui-stylex/modules.d.ts.map +1 -0
  36. package/dist/effect-ui-stylex/modules.js +97 -0
  37. package/dist/effect-ui-stylex/modules.js.map +1 -0
  38. package/dist/effect-ui-stylex/parts.d.ts +17 -0
  39. package/dist/effect-ui-stylex/parts.d.ts.map +1 -0
  40. package/dist/effect-ui-stylex/parts.js +66 -0
  41. package/dist/effect-ui-stylex/parts.js.map +1 -0
  42. package/dist/effect-ui-stylex/raw-part.d.ts +2 -0
  43. package/dist/effect-ui-stylex/raw-part.d.ts.map +1 -0
  44. package/dist/effect-ui-stylex/raw-part.js +90 -0
  45. package/dist/effect-ui-stylex/raw-part.js.map +1 -0
  46. package/dist/effect-ui-stylex/state-attributes.d.ts +8 -0
  47. package/dist/effect-ui-stylex/state-attributes.d.ts.map +1 -0
  48. package/dist/effect-ui-stylex/state-attributes.js +141 -0
  49. package/dist/effect-ui-stylex/state-attributes.js.map +1 -0
  50. package/dist/effect-ui-stylex/state-key.d.ts +2 -0
  51. package/dist/effect-ui-stylex/state-key.d.ts.map +1 -0
  52. package/dist/effect-ui-stylex/state-key.js +103 -0
  53. package/dist/effect-ui-stylex/state-key.js.map +1 -0
  54. package/dist/effect-ui-stylex/subpath.d.ts +10 -0
  55. package/dist/effect-ui-stylex/subpath.d.ts.map +1 -0
  56. package/dist/effect-ui-stylex/subpath.js +53 -0
  57. package/dist/effect-ui-stylex/subpath.js.map +1 -0
  58. package/dist/effect-ui-stylex.d.ts +23 -0
  59. package/dist/effect-ui-stylex.d.ts.map +1 -0
  60. package/dist/{foldkit-stylex.js → effect-ui-stylex.js} +10 -9
  61. package/dist/effect-ui-stylex.js.map +1 -0
  62. package/dist/{foldkit-stylex.json → effect-ui-stylex.json} +7 -6
  63. package/dist/plugin.d.ts.map +1 -1
  64. package/dist/plugin.js +18 -12
  65. package/dist/plugin.js.map +1 -1
  66. package/dist/rules/imports.d.ts +5 -6
  67. package/dist/rules/imports.d.ts.map +1 -1
  68. package/dist/rules/imports.js +18 -14
  69. package/dist/rules/imports.js.map +1 -1
  70. package/dist/rules/module-sources.d.ts +33 -0
  71. package/dist/rules/module-sources.d.ts.map +1 -0
  72. package/dist/rules/module-sources.js +139 -0
  73. package/dist/rules/module-sources.js.map +1 -0
  74. package/dist/rules/no-suppression-directives.js +3 -3
  75. package/dist/rules/no-suppression-directives.js.map +1 -1
  76. package/dist/rules/scope.d.ts +3 -1
  77. package/dist/rules/scope.d.ts.map +1 -1
  78. package/dist/rules/scope.js.map +1 -1
  79. package/dist/vendor/anti-slop/rules/no-runtime-typeof.js +1 -1
  80. package/dist/vendor/anti-slop/rules/no-runtime-typeof.js.map +1 -1
  81. package/package.json +21 -17
  82. package/src/app.ts +19 -0
  83. package/src/base.ts +5 -1
  84. package/src/effect-ui-stylex/class.ts +140 -0
  85. package/src/effect-ui-stylex/components.ts +184 -0
  86. package/src/{foldkit-stylex → effect-ui-stylex}/condition-key.ts +6 -52
  87. package/src/effect-ui-stylex/internal-import.ts +32 -0
  88. package/src/effect-ui-stylex/layers.ts +161 -0
  89. package/src/effect-ui-stylex/look-level.ts +99 -0
  90. package/src/effect-ui-stylex/modules.ts +115 -0
  91. package/src/effect-ui-stylex/parts.ts +89 -0
  92. package/src/effect-ui-stylex/raw-part.ts +110 -0
  93. package/src/effect-ui-stylex/state-attributes.ts +140 -0
  94. package/src/effect-ui-stylex/state-key.ts +147 -0
  95. package/src/effect-ui-stylex/subpath.ts +65 -0
  96. package/src/{foldkit-stylex.ts → effect-ui-stylex.ts} +9 -8
  97. package/src/plugin.ts +18 -12
  98. package/src/rules/imports.ts +22 -15
  99. package/src/rules/module-sources.ts +179 -0
  100. package/src/rules/no-suppression-directives.ts +3 -3
  101. package/src/rules/scope.ts +1 -1
  102. package/src/vendor/anti-slop/UPSTREAM.md +2 -0
  103. package/src/vendor/anti-slop/rules/no-runtime-typeof.ts +1 -1
  104. package/dist/foldkit-stylex/attributes.d.ts +0 -2
  105. package/dist/foldkit-stylex/attributes.d.ts.map +0 -1
  106. package/dist/foldkit-stylex/attributes.js +0 -191
  107. package/dist/foldkit-stylex/attributes.js.map +0 -1
  108. package/dist/foldkit-stylex/components.d.ts +0 -12
  109. package/dist/foldkit-stylex/components.d.ts.map +0 -1
  110. package/dist/foldkit-stylex/components.js +0 -41
  111. package/dist/foldkit-stylex/components.js.map +0 -1
  112. package/dist/foldkit-stylex/condition-key.d.ts.map +0 -1
  113. package/dist/foldkit-stylex/condition-key.js.map +0 -1
  114. package/dist/foldkit-stylex/hover-gate.d.ts.map +0 -1
  115. package/dist/foldkit-stylex/hover-gate.js.map +0 -1
  116. package/dist/foldkit-stylex/styles.d.ts +0 -2
  117. package/dist/foldkit-stylex/styles.d.ts.map +0 -1
  118. package/dist/foldkit-stylex/styles.js +0 -131
  119. package/dist/foldkit-stylex/styles.js.map +0 -1
  120. package/dist/foldkit-stylex/unstyled-view.d.ts +0 -2
  121. package/dist/foldkit-stylex/unstyled-view.d.ts.map +0 -1
  122. package/dist/foldkit-stylex/unstyled-view.js +0 -94
  123. package/dist/foldkit-stylex/unstyled-view.js.map +0 -1
  124. package/dist/foldkit-stylex/vite.d.ts +0 -2
  125. package/dist/foldkit-stylex/vite.d.ts.map +0 -1
  126. package/dist/foldkit-stylex/vite.js +0 -26
  127. package/dist/foldkit-stylex/vite.js.map +0 -1
  128. package/dist/foldkit-stylex.d.ts +0 -22
  129. package/dist/foldkit-stylex.d.ts.map +0 -1
  130. package/dist/foldkit-stylex.js.map +0 -1
  131. package/src/foldkit-stylex/attributes.ts +0 -282
  132. package/src/foldkit-stylex/components.ts +0 -41
  133. package/src/foldkit-stylex/styles.ts +0 -170
  134. package/src/foldkit-stylex/unstyled-view.ts +0 -121
  135. package/src/foldkit-stylex/vite.ts +0 -29
  136. /package/dist/{foldkit-stylex → effect-ui-stylex}/condition-key.d.ts +0 -0
  137. /package/dist/{foldkit-stylex → effect-ui-stylex}/hover-gate.d.ts +0 -0
  138. /package/dist/{foldkit-stylex → effect-ui-stylex}/hover-gate.js +0 -0
  139. /package/src/{foldkit-stylex → effect-ui-stylex}/hover-gate.ts +0 -0
@@ -1,11 +1,5 @@
1
1
  import { defineRule } from "@oxlint/plugins";
2
2
  import { exportOf, importsOf, keyOf } from "../rules/imports.js";
3
- // Hooks @foldkit/ui derives from state that the kit exposes as flags, native states that
4
- // @foldkit/ui's aria-disabled controls never enter, and ARIA attributes.
5
- const stateHook = /data-(checked|indeterminate|open|active|selected|disabled|readonly|invalid|focused|current|drag-over|dragging|today|outside-month|state|variant|closed|swipe)\b|:(disabled|enabled|checked|indeterminate|read-only|read-write|invalid|open)\b|\[aria-/;
6
- // Every Toast entry shares one class, which cannot take state, so its animation and swipe key on
7
- // these hooks.
8
- const toastEntryHooks = /data-(closed|swipe)\b/g;
9
3
  const unbounded = {
10
4
  min: { value: -Infinity, inclusive: true },
11
5
  max: { value: Infinity, inclusive: true },
@@ -136,7 +130,6 @@ export const conditionKey = defineRule({
136
130
  hasSuggestions: true,
137
131
  schema: [],
138
132
  messages: {
139
- stateAttribute: "Style '{{key}}' from state: (state) => [styles.base, state.isChecked && styles.checked] in a part's styles, or sx(styles.base, isChecked && styles.checked) on your own element. @foldkit/ui's hooks differ across components (Checkbox, Switch, Button and Listbox use aria-disabled, so :disabled never matches them), and StyleX ranks ':is()' keys of one property equally.",
140
133
  bareAttribute: "Write ':is({{key}})' instead of '{{key}}'. StyleX adds 3000 to a bare attribute condition's priority, above :hover (+130) and media queries (+200), and types its value as unknown, which typed style props reject. The :is() form ranks with pseudo-classes, so check which condition wins where they overlap.",
141
134
  mediaOrder: "'{{earlier}}' never matches: StyleX rewrites each media query to exclude the ones after it in the same property, and '{{later}}' matches wherever it does. Put the query that covers the other first: min-width queries from narrow to wide, max-width queries from wide to narrow.",
142
135
  focusRank: "StyleX 0.19 ranks '{{key}}' below '{{above}}', so '{{above}}' wins wherever both match and hides the focus style. Style focus on a property that '{{above}}' does not set, or write '{{above}}:not({{key}})' so the two never match together.",
@@ -145,10 +138,6 @@ export const conditionKey = defineRule({
145
138
  },
146
139
  createOnce(context) {
147
140
  let imports = new Map();
148
- // State hook keys, reported at the end of the file once every Toast entry is known.
149
- let candidates = [];
150
- // Style keys passed as a Toast `entry`, such as `entry` in `entry: styles.entry`.
151
- let toastEntries = new Set();
152
141
  const checkMediaOrder = (properties) => {
153
142
  const queries = properties.flatMap((property) => {
154
143
  const key = keyOf(property);
@@ -181,11 +170,8 @@ export const conditionKey = defineRule({
181
170
  }
182
171
  }
183
172
  };
184
- const checkKey = (entry, key, property) => {
185
- if (stateHook.test(key)) {
186
- candidates.push({ entry, key, node: property.key });
187
- }
188
- else if (key.startsWith("[")) {
173
+ const checkKey = (key, property) => {
174
+ if (key.startsWith("[")) {
189
175
  context.report({
190
176
  node: property.key,
191
177
  messageId: "bareAttribute",
@@ -199,7 +185,7 @@ export const conditionKey = defineRule({
199
185
  });
200
186
  }
201
187
  };
202
- const checkStyle = (entry, style) => {
188
+ const checkStyle = (style) => {
203
189
  // A dynamic style's conditions are in the object its function returns.
204
190
  const object = style.type === "ArrowFunctionExpression" ? style.body : style;
205
191
  if (object.type !== "ObjectExpression")
@@ -210,15 +196,13 @@ export const conditionKey = defineRule({
210
196
  for (const property of properties) {
211
197
  const key = keyOf(property);
212
198
  if (key !== undefined)
213
- checkKey(entry, key, property);
214
- checkStyle(entry, property.value);
199
+ checkKey(key, property);
200
+ checkStyle(property.value);
215
201
  }
216
202
  };
217
203
  return {
218
204
  Program(program) {
219
205
  imports = importsOf(program);
220
- candidates = [];
221
- toastEntries = new Set();
222
206
  },
223
207
  CallExpression(node) {
224
208
  const [styles] = node.arguments;
@@ -227,26 +211,8 @@ export const conditionKey = defineRule({
227
211
  return;
228
212
  }
229
213
  for (const entry of styles.properties) {
230
- const name = entry.type === "Property" ? keyOf(entry) : undefined;
231
- if (entry.type === "Property" && name !== undefined)
232
- checkStyle(name, entry.value);
233
- }
234
- },
235
- MemberExpression(node) {
236
- if (node.computed || node.property.type !== "Identifier")
237
- return;
238
- for (let parent = node.parent; parent !== null; parent = parent.parent) {
239
- if (parent.type === "Property" && keyOf(parent) === "entry") {
240
- toastEntries.add(node.property.name);
241
- return;
242
- }
243
- }
244
- },
245
- "Program:exit"() {
246
- for (const { entry, key, node } of candidates) {
247
- const entryOnly = toastEntries.has(entry) && !stateHook.test(key.replaceAll(toastEntryHooks, ""));
248
- if (!entryOnly)
249
- context.report({ node, messageId: "stateAttribute", data: { key } });
214
+ if (entry.type === "Property")
215
+ checkStyle(entry.value);
250
216
  }
251
217
  },
252
218
  };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"condition-key.js","sources":["../../src/effect-ui-stylex/condition-key.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAgB,SAAS,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAW/E,MAAM,SAAS,GAAe;IAC5B,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE;IAC1C,GAAG,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE;CAC1C,CAAC;AAEF,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAA,wBAAwB,CAAC;AAElD,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAA,yBAAyB,MAAM,KAAK,CAAC,CAAC;AAE3E,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAA,0BAA0B,MAAM,KAAK,CAAC,CAAC;AAE/E,MAAM,MAAM,GAAG,CAAC,KAAiB,EAAE,IAAmB,EAAE,KAAY,EAAc,EAAE,CAAC,CAAC;IACpF,GAAG,KAAK;IACR,CAAC,IAAI,CAAC,EAAE,KAAK;CACd,CAAC,CAAC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AAC;QAEF,OAAO;YACL,OAAO,CAAC,OAAO;gBACb,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;YAC/B,CAAC;YACD,cAAc,CAAC,IAAI;gBACjB,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC;gBAEhC,IACE,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,kBAAkB,CAAC,KAAK,QAAQ;oBAC/D,MAAM,EAAE,IAAI,KAAK,kBAAkB,EACnC,CAAC;oBACD,OAAO;gBACT,CAAC;gBAED,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;oBACtC,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU;wBAAE,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBACzD,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hover-gate.d.ts","sources":["../../src/effect-ui-stylex/hover-gate.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,SAAS,gCA8EpB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hover-gate.js","sources":["../../src/effect-ui-stylex/hover-gate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAgB,SAAS,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,MAAM,GAAG,kBAAkB,CAAC;AAElC,kGAAkG;AAClG,yEAAyE;AACzE,MAAM,OAAO,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE7E,2FAA2F;AAC3F,kGAAkG;AAClG,MAAM,MAA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C,CAAC;oBACD,OAAO;gBACT,CAAC;gBAED,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;oBACtC,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU;wBAAE,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;gBACvE,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const internalImport: import("@oxlint/plugins").Rule;
2
+ //# sourceMappingURL=internal-import.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal-import.d.ts","sources":["../../src/effect-ui-stylex/internal-import.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,cAAc,gCAmBzB,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { defineRule } from "@oxlint/plugins";
2
+ import { moduleSources, posixPath } from "../rules/module-sources.js";
3
+ // A module under an `internal` directory of effect/ui, at any depth: effect/ui/internal,
4
+ // effect/ui/html/internal and effect/ui/kit/internal today.
5
+ const internal = /^effect\/ui\/(?:[^/]+\/)*internal(?:\/|$)/;
6
+ // A file of the effect package's build or source, named through the package or by a path into
7
+ // node_modules.
8
+ const file = /(?:^|\/)effect\/(?:dist|src)\/ui(?:\/|$)/;
9
+ export const internalImport = defineRule({
10
+ meta: {
11
+ type: "problem",
12
+ docs: { description: "Import effect/ui by the modules its package exports." },
13
+ schema: [],
14
+ messages: {
15
+ internal: "Import the module of effect/ui that exports this, such as effect/ui/kit/Dialog or effect/ui/html/Html. effect exports nothing under an `internal` directory, so {{source}} is no part of its API and changes without a version.",
16
+ file: "Import effect/ui by a module its package exports, such as effect/ui/kit/Dialog. {{source}} names a file of the package, which another build of effect lays out differently.",
17
+ },
18
+ },
19
+ createOnce(context) {
20
+ return moduleSources(({ source, node }) => {
21
+ const path = posixPath(source);
22
+ if (internal.test(path))
23
+ context.report({ node, messageId: "internal", data: { source } });
24
+ else if (file.test(path))
25
+ context.report({ node, messageId: "file", data: { source } });
26
+ });
27
+ },
28
+ });
29
+ //# sourceMappingURL=internal-import.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal-import.js","sources":["../../src/effect-ui-stylex/internal-import.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEtE,yFAAyF;AACzF,4DAA4D;AAC5D,MAAM,QAAQ,GAAG,2CAA2C,CAAC;AAE7D,8FAA8F;AAC9F,gBAAgB;AAChB,MAAM,IAAI,GAAG,0CAA0C,CAAC;AAExD,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;IACvC,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,EAAE,WAAW,EAAE,sDAAsD,EAAE;QAC7E,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,QAAQ,EACN,iOAAiO;YACnO,IAAI,EAAE,6KAA6K;SACpL;KACF;IACD,UAAU,CAAC,OAAO;QAChB,OAAO,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE;YACxC,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;YAE/B,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;gBAAE,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;iBACtF,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;gBAAE,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;QAC1F,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ type Report = Readonly<{
2
+ messageId: "layer" | "named" | "noLayer" | "outside" | "unexported";
3
+ data: Readonly<Record<string, string>>;
4
+ }>;
5
+ /**
6
+ * What is wrong with an import of `source` in `file`, a module under a `src` laid out in layers,
7
+ * or `undefined` for an import the layers allow and for one of another package. A path names a
8
+ * file of the package or leaves it, whether it starts at the importing file or at the root of the
9
+ * file system. `named` is whether the import binds named exports alone.
10
+ */
11
+ export declare const crossing: (filename: string, source: string, named: boolean) => Report | undefined;
12
+ export declare const layers: import("@oxlint/plugins").Rule;
13
+ export {};
14
+ //# sourceMappingURL=layers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layers.d.ts","sources":["../../src/effect-ui-stylex/layers.ts"],"names":[],"mappings":"AAkDA,KAAK,MAAM,GAAG,QAAQ,CAAC;IACrB,SAAS,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,YAAY,CAAC;IACpE,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACxC,CAAC,CAAC;AA0CH;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,aAAc,MAAM,UAAU,MAAM,SAAS,OAAO,KAAG,MAAM,GAAG,SAuBpF,CAAC;AAEF,eAAO,MAAM,MAAM,gCAkCjB,CAAC"}
@@ -0,0 +1,118 @@
1
+ import { defineRule } from "@oxlint/plugins";
2
+ import { isPath, moduleSources, posixPath, resolveFrom } from "../rules/module-sources.js";
3
+ import { directories, exportedPlace, library, modules, placeOf, } from "./modules.js";
4
+ // The modules of another layer that a layer imports, with `*` for all of one. A layer also
5
+ // imports its own, and a component imports those beside it by name, which `crossing` checks.
6
+ const routes = {
7
+ mechanism: [],
8
+ design: ["mechanism/style", "mechanism/compiled"],
9
+ component: ["design/looks", "design/tokens.stylex", "design/icons", "mechanism/style"],
10
+ testing: ["mechanism/*"],
11
+ };
12
+ // What the message says a layer imports, with the reason where the layout does not show it.
13
+ const allowed = {
14
+ mechanism: "The mechanism imports src/mechanism alone. It knows no look, and takes what it needs of one as an option, as `audit` takes `hairline`.",
15
+ design: "The design imports src/design, and `style.ts` and `compiled.ts` of src/mechanism. A component draws with the design, so the design imports none.",
16
+ component: "A component imports `looks.ts`, `tokens.stylex.ts` and `icons.ts` of src/design, `style.ts` of src/mechanism and the named exports of the components beside it.",
17
+ testing: "src/testing.ts imports src/mechanism alone. An app's Playwright tests load it in Node, where StyleX has compiled no module of the design or the components.",
18
+ };
19
+ const reaches = (from, { layer, name }) => from === layer ||
20
+ routes[from].includes(`${layer}/${name}`) ||
21
+ routes[from].includes(`${layer}/*`);
22
+ /** A module's path under `src`, without its extension, for a message. */
23
+ const shown = ({ layer, name }) => layer === "testing" ? "src/testing" : `src/${directories[layer]}/${name}`;
24
+ /** Where a file is in a package laid out in layers: the package's directory and the path in `src`. */
25
+ const inSrc = (file) => {
26
+ const [, root, path] = /^(.*)\/src\/(.+)$/.exec(file) ?? [];
27
+ return root === undefined || path === undefined ? undefined : { root, path };
28
+ };
29
+ /**
30
+ * What is wrong with the place of `filename`, or `undefined` for a module of a layer and for a
31
+ * file under no `src`. A component is a module the package exports, so a file of `src/components`
32
+ * that is no export is a helper two components would share out of an app's sight.
33
+ */
34
+ const misplaced = (filename) => {
35
+ const file = inSrc(posixPath(filename));
36
+ if (file === undefined)
37
+ return undefined;
38
+ const place = placeOf(file.path);
39
+ if (place === undefined)
40
+ return { messageId: "noLayer", data: { source: `src/${file.path}` } };
41
+ return place.layer === "component" && !modules.has(place.name)
42
+ ? { messageId: "unexported", data: { target: `src/${file.path}` } }
43
+ : undefined;
44
+ };
45
+ /**
46
+ * The module an import of `source` in `file` names: one the package exports, by its name, or a
47
+ * file of the importing package's `src`, by a path. `undefined` is another package's module, and a
48
+ * report a path that names no module of a layer.
49
+ */
50
+ const targetOf = (file, root, source) => {
51
+ if (source.startsWith(`${library}/`)) {
52
+ return (exportedPlace(source.slice(library.length + 1)) ?? { messageId: "noLayer", data: { source } });
53
+ }
54
+ if (!isPath(source))
55
+ return undefined;
56
+ const resolved = inSrc(resolveFrom(file, source));
57
+ if (resolved?.root !== root)
58
+ return { messageId: "outside", data: { source } };
59
+ return placeOf(resolved.path) ?? { messageId: "noLayer", data: { source } };
60
+ };
61
+ /**
62
+ * What is wrong with an import of `source` in `file`, a module under a `src` laid out in layers,
63
+ * or `undefined` for an import the layers allow and for one of another package. A path names a
64
+ * file of the package or leaves it, whether it starts at the importing file or at the root of the
65
+ * file system. `named` is whether the import binds named exports alone.
66
+ */
67
+ export const crossing = (filename, source, named) => {
68
+ const file = posixPath(filename);
69
+ const from = inSrc(file);
70
+ const place = from && placeOf(from.path);
71
+ if (from === undefined || place === undefined)
72
+ return undefined;
73
+ const target = targetOf(file, from.root, source);
74
+ if (target === undefined || "messageId" in target)
75
+ return target;
76
+ if (target.layer === "component" && place.layer === "component") {
77
+ if (!modules.has(target.name))
78
+ return { messageId: "unexported", data: { target: source } };
79
+ return named ? undefined : { messageId: "named", data: { target: shown(target) } };
80
+ }
81
+ return reaches(place.layer, target)
82
+ ? undefined
83
+ : {
84
+ messageId: "layer",
85
+ data: { from: shown(place), target: shown(target), allowed: allowed[place.layer] },
86
+ };
87
+ };
88
+ export const layers = defineRule({
89
+ meta: {
90
+ type: "problem",
91
+ docs: {
92
+ description: "Hold the modules of @kutur-kit/effect-ui-stylex to their layers: mechanism, design and components.",
93
+ },
94
+ schema: [],
95
+ messages: {
96
+ layer: "{{from}} cannot import {{target}}. {{allowed}}",
97
+ named: 'Import the names you use of {{target}}, as `import { Button, type ButtonOptions } from "./button.ts"`. A component takes from another the types, drawn functions, styles and helpers it exports by name: no namespace, default or side-effect import, no re-export and no `import()`.',
98
+ noLayer: "{{source}} is in no layer. A module of this package is under src/mechanism, a file of src/design or a file of src/components, and src/testing.ts is the one module beside them.",
99
+ outside: "{{source}} is not under this package's src. A module of src imports files of src alone: the package publishes `src` and the `dist` built from it, so a path to anything else resolves in this checkout and not once installed.",
100
+ unexported: "{{target}} is no module the package exports. Each file of src/components is a component an app imports, as `@kutur-kit/effect-ui-stylex/button`, and a component takes from another what an app can. Move what two components share into one of them, or export the module in package.json and add it to `modules` in @kutur-kit/oxc.",
101
+ },
102
+ },
103
+ createOnce(context) {
104
+ return {
105
+ Program(program) {
106
+ const report = misplaced(context.filename);
107
+ if (report !== undefined)
108
+ context.report({ node: program, ...report });
109
+ },
110
+ ...moduleSources(({ source, node, named }) => {
111
+ const report = crossing(context.filename, source, named);
112
+ if (report !== undefined)
113
+ context.report({ node, ...report });
114
+ }),
115
+ };
116
+ },
117
+ });
118
+ //# sourceMappingURL=layers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layers.js","sources":["../../src/effect-ui-stylex/layers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC3F,OAAO,EACL,WAAW,EACX,aAAa,EAEb,OAAO,EACP,OAAO,EAEP,OAAO,GACR,MAAM,cAAc,CAAC;AAEtB,2FAA2F;AAC3F,6FAA6F;AAC7F,MAAM,MAAM,GAAmD;IAC7D,SAAS,EAAE,EAAE;IACb,MAAM,EAAE,CAAC,iBAAiB,EAAE,oBAAoB,CAAC;IACjD,SAAS,EAAE,CAAC,cAAc,EAAE,sBAAsB,EAAE,cAAc,EAAE,iBAAiB,CAAC;IACtF,OAAO,EAAE,CAAC,aAAa,CAAC;CACzB,CAAC;AAEF,4FAA4F;AAC5F,MAAM,OAAO,GAAoC;IAC/C,SAAS,EACP,wIAAwI;IAC1I,MAAM,EACJ,kJAAkJ;IACpJ,SAAS,EACP,iKAAiK;IACnK,OAAO,EACL,6JAA6J;CAChK,CAAC;AAEF,MAAM,OAAO,GAAG,CAAC,IAAW,EAAE,EAAE,KAAK,EAAE,IAAI,EAAS,EAAE,EAAE,CACtD,IAA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uR;YACzR,OAAO,EACL,iLAAiL;YACnL,OAAO,EACL,gOAAgO;YAClO,UAAU,EACR,uUAAuU;SAC1U;KACF;IACD,UAAU,CAAC,OAAO;QAChB,OAAO;YACL,OAAO,CAAC,OAAO;gBACb,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;gBAE3C,IAAI,MAAM,KAAK,SAAS;oBAAE,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;YACzE,CAAC;YACD,GAAG,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE;gBAC3C,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;gBAEzD,IAAI,MAAM,KAAK,SAAS;oBAAE,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;YAChE,CAAC,CAAC;SACH,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const lookLevel: import("@oxlint/plugins").Rule;
2
+ //# sourceMappingURL=look-level.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"look-level.d.ts","sources":["../../src/effect-ui-stylex/look-level.ts"],"names":[],"mappings":"AA0CA,eAAO,MAAM,SAAS,gCAwDpB,CAAC"}
@@ -0,0 +1,83 @@
1
+ import { defineRule } from "@oxlint/plugins";
2
+ import { exportOf, importsOf, keyOf } from "../rules/imports.js";
3
+ const side = "Top|Right|Bottom|Left|InlineStart|InlineEnd|BlockStart|BlockEnd";
4
+ // Each family of properties that set one side or one physical axis, with the property a caller
5
+ // writes for the level above it. StyleX applies the narrower property over the wider one
6
+ // whatever the order of the styles.
7
+ const levels = [
8
+ [
9
+ /^(padding|margin|scrollPadding|scrollMargin)(Inline|Block)(?:Start|End)$/,
10
+ (box = "", axis = "") => `${box}${axis}`,
11
+ ],
12
+ [
13
+ /^(padding|margin|scrollPadding|scrollMargin)(Top|Bottom|Left|Right)$/,
14
+ (box = "", edge = "") => `${box}${edge === "Top" || edge === "Bottom" ? "Block" : "Inline"}`,
15
+ ],
16
+ [/^inset(Inline|Block)(?:Start|End)$/, (axis = "") => `inset${axis}`],
17
+ [/^(top|bottom)$/, () => "insetBlock"],
18
+ [/^(left|right)$/, () => "insetInline"],
19
+ [new RegExp(`^border(?:${side})(Width|Style|Color)$`), (kind = "") => `border${kind}`],
20
+ [
21
+ /^border(?:TopLeft|TopRight|BottomLeft|BottomRight|StartStart|StartEnd|EndStart|EndEnd)Radius$/,
22
+ () => "borderRadius",
23
+ ],
24
+ [/^(overflow|overscrollBehavior)[XY]$/, (property = "") => property],
25
+ ];
26
+ // The property of the level above `property`, or `undefined` for one that sets a whole level.
27
+ const levelAbove = (property) => {
28
+ for (const [pattern, above] of levels) {
29
+ const match = pattern.exec(property);
30
+ if (match !== null)
31
+ return above(...match.slice(1));
32
+ }
33
+ return undefined;
34
+ };
35
+ export const lookLevel = defineRule({
36
+ meta: {
37
+ type: "problem",
38
+ docs: {
39
+ description: "In a library of drawn elements, hold a look to the properties its style option can replace.",
40
+ },
41
+ schema: [],
42
+ messages: {
43
+ level: "Write this look with {{above}}, or exclude {{above}} from the `style` option of the function that draws the element and say so in a comment that disables this rule for the line. StyleX applies {{property}} over a caller's {{above}} whatever the order of the styles, so the override would lose without a word.",
44
+ },
45
+ },
46
+ createOnce(context) {
47
+ let imports = new Map();
48
+ const checkStyle = (style) => {
49
+ // A dynamic style's properties are in the object its function returns.
50
+ const object = style.type === "ArrowFunctionExpression" ? style.body : style;
51
+ if (object.type !== "ObjectExpression")
52
+ return;
53
+ for (const property of object.properties) {
54
+ const name = property.type === "Property" ? keyOf(property) : undefined;
55
+ const above = name === undefined ? undefined : levelAbove(name);
56
+ if (property.type === "Property" && name !== undefined && above !== undefined) {
57
+ context.report({
58
+ node: property.key,
59
+ messageId: "level",
60
+ data: { property: name, above },
61
+ });
62
+ }
63
+ }
64
+ };
65
+ return {
66
+ Program(program) {
67
+ imports = importsOf(program);
68
+ },
69
+ CallExpression(node) {
70
+ const [styles] = node.arguments;
71
+ if (exportOf(node.callee, imports, "@stylexjs/stylex") !== "create" ||
72
+ styles?.type !== "ObjectExpression") {
73
+ return;
74
+ }
75
+ for (const entry of styles.properties) {
76
+ if (entry.type === "Property")
77
+ checkStyle(entry.value);
78
+ }
79
+ },
80
+ };
81
+ },
82
+ });
83
+ //# sourceMappingURL=look-level.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"look-level.js","sources":["../../src/effect-ui-stylex/look-level.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAgB,SAAS,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE/E,MAAM,IAAI,GAAG,iEAAiE,CAAC;AAE/E,+FAA+F;AAC/F,yFAAyF;AACzF,oCAAoC;AACpC,MAAM,MAAM,GAAmF;IAC7F;QACE,0EAA0E;QAC1E,CAAC,GAAG,GAAG,EAAE,EAAE,IAAI,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,IAAI,EAAE;KACzC;IACD;QACE,sEAAsE;QACtE,CAAC,GAAG,GAAG,EAAE,EAAE,IAAI,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE;KAC7F;IACD,CAAC,oCAAoC,EAAE,CAAC,IAAI,GAAG,EAAE,EAAE,EAAE,CAAC,QAAQ,IAAI,EAAE,CAAC;IACrE,CAAC,gBAAgB,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC;IACtC,CAAC,gBAAgB,EAAE,GAAG,EAAE,CAA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2
+ export declare const library = "@kutur-kit/effect-ui-stylex";
3
+ /**
4
+ * The layers of the library's `src`. The mechanism is the StyleX plumbing in `src/mechanism`,
5
+ * which knows no look. The design is the tokens, looks and icons, each a module of `src/design`.
6
+ * A component is a module of `src/components`. `src/testing.ts` is the one module above them.
7
+ */
8
+ export type Layer = "mechanism" | "design" | "component" | "testing";
9
+ /** A module of the library: its layer and its name there, such as `component` and `button`. */
10
+ export type Place = Readonly<{
11
+ layer: Layer;
12
+ name: string;
13
+ }>;
14
+ /** The directory of `src` that holds a layer's modules. */
15
+ export declare const directories: {
16
+ readonly mechanism: "mechanism";
17
+ readonly design: "design";
18
+ readonly component: "components";
19
+ };
20
+ /**
21
+ * The layer of each module the library exports, by the name an app imports it with: `button` for
22
+ * `@kutur-kit/effect-ui-stylex/button`. A test derives the table from the library's
23
+ * `package.json`, so add a module in the change that exports it.
24
+ */
25
+ export declare const modules: ReadonlyMap<string, Layer>;
26
+ /** A file's name without the extension of a TypeScript or JavaScript module. */
27
+ export declare const stem: (file: string) => string;
28
+ /**
29
+ * The module a path under the library's `src` or `dist` is, or `undefined` for a path in no
30
+ * layer. The mechanism nests, as `mechanism/internal/dev-stylesheets.ts`. A design or component
31
+ * module is a file of its directory, so `components/internal/shared.ts` is in no layer.
32
+ */
33
+ export declare const placeOf: (path: string) => Place | undefined;
34
+ /** The module an app imports as `@kutur-kit/effect-ui-stylex/<name>`, if the library exports it. */
35
+ export declare const exportedPlace: (name: string) => Place | undefined;
36
+ //# sourceMappingURL=modules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modules.d.ts","sources":["../../src/effect-ui-stylex/modules.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,eAAO,MAAM,OAAO,gCAAgC,CAAC;AAErD;;;;GAIG;AACH,MAAM,MAAM,KAAK,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,CAAC;AAErE,+FAA+F;AAC/F,MAAM,MAAM,KAAK,GAAG,QAAQ,CAAC;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAE7D,2DAA2D;AAC3D,eAAO,MAAM,WAAW;wBACX,WAAW;qBACd,QAAQ;wBACL,YAAY;CAC+C,CAAC;AAiDzE;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAU7C,CAAC;AAEH,gFAAgF;AAChF,eAAO,MAAM,IAAI,SAAU,MAAM,WAAuD,CAAC;AAEzF;;;;GAIG;AACH,eAAO,MAAM,OAAO,SAAU,MAAM,KAAG,KAAK,GAAG,SAe9C,CAAC;AAEF,oGAAoG;AACpG,eAAO,MAAM,aAAa,SAAU,MAAM,KAAG,KAAK,GAAG,SAIpD,CAAC"}
@@ -0,0 +1,97 @@
1
+ /** The package of the drawn components, imported by module, as `@kutur-kit/effect-ui-stylex/dialog`. */
2
+ export const library = "@kutur-kit/effect-ui-stylex";
3
+ /** The directory of `src` that holds a layer's modules. */
4
+ export const directories = {
5
+ mechanism: "mechanism",
6
+ design: "design",
7
+ component: "components",
8
+ };
9
+ const components = [
10
+ "accordion",
11
+ "alert-dialog",
12
+ "autocomplete",
13
+ "avatar",
14
+ "button",
15
+ "calendar",
16
+ "checkbox",
17
+ "checkbox-group",
18
+ "collapsible",
19
+ "combobox",
20
+ "date-field",
21
+ "date-picker",
22
+ "dialog",
23
+ "drawer",
24
+ "drawer-provider",
25
+ "field",
26
+ "fieldset",
27
+ "file-drop",
28
+ "form",
29
+ "input",
30
+ "menu",
31
+ "menubar",
32
+ "meter",
33
+ "navigation-menu",
34
+ "number-field",
35
+ "otp-field",
36
+ "popover",
37
+ "preview-card",
38
+ "progress",
39
+ "radio-group",
40
+ "range-calendar",
41
+ "scroll-area",
42
+ "select",
43
+ "separator",
44
+ "slider",
45
+ "switch",
46
+ "tabs",
47
+ "time-field",
48
+ "toast",
49
+ "toggle",
50
+ "toggle-group",
51
+ "toolbar",
52
+ "tooltip",
53
+ "virtual-list",
54
+ ];
55
+ /**
56
+ * The layer of each module the library exports, by the name an app imports it with: `button` for
57
+ * `@kutur-kit/effect-ui-stylex/button`. A test derives the table from the library's
58
+ * `package.json`, so add a module in the change that exports it.
59
+ */
60
+ export const modules = new Map([
61
+ ...components.map((name) => [name, "component"]),
62
+ ["icons", "design"],
63
+ ["looks", "design"],
64
+ ["tokens.stylex", "design"],
65
+ ["compiled", "mechanism"],
66
+ ["reset.css", "mechanism"],
67
+ ["style", "mechanism"],
68
+ ["vite", "mechanism"],
69
+ ["testing", "testing"],
70
+ ]);
71
+ /** A file's name without the extension of a TypeScript or JavaScript module. */
72
+ export const stem = (file) => file.replace(/\.(?:d\.[cm]?ts|[cm]?[jt]sx?)$/, "");
73
+ /**
74
+ * The module a path under the library's `src` or `dist` is, or `undefined` for a path in no
75
+ * layer. The mechanism nests, as `mechanism/internal/dev-stylesheets.ts`. A design or component
76
+ * module is a file of its directory, so `components/internal/shared.ts` is in no layer.
77
+ */
78
+ export const placeOf = (path) => {
79
+ const [directory, ...below] = path.split("/");
80
+ const name = stem(below.join("/"));
81
+ if (below.length === 0) {
82
+ return stem(path) === "testing" ? { layer: "testing", name: "testing" } : undefined;
83
+ }
84
+ if (directory === directories.mechanism)
85
+ return { layer: "mechanism", name };
86
+ if (below.length > 1)
87
+ return undefined;
88
+ if (directory === directories.design)
89
+ return { layer: "design", name };
90
+ return directory === directories.component ? { layer: "component", name } : undefined;
91
+ };
92
+ /** The module an app imports as `@kutur-kit/effect-ui-stylex/<name>`, if the library exports it. */
93
+ export const exportedPlace = (name) => {
94
+ const layer = modules.get(name);
95
+ return layer === undefined ? undefined : { layer, name };
96
+ };
97
+ //# sourceMappingURL=modules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modules.js","sources":["../../src/effect-ui-stylex/modules.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,MAAM,CAAC,MAAM,OAAO,GAAG,6BAA6B,CAAC;AAYr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,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { ESTree, SourceCode } from "@oxlint/plugins";
2
+ /**
3
+ * The part a call applies, with the call that draws the part's component: `trigger` and
4
+ * `Dialog(h, { … })` for `dialog.trigger(h.button)` in that call's `view`.
5
+ */
6
+ export declare const partOf: (sourceCode: SourceCode, call: ESTree.CallExpression) => Readonly<{
7
+ name: string;
8
+ owner: ESTree.CallExpression;
9
+ }> | undefined;
10
+ /**
11
+ * The builder a call draws its element on, when the call is a part or a view function: the
12
+ * argument of `dialog.trigger(h.button)`, or the `element` of `tabs.tab({ element: h.button })`
13
+ * and of `Save(h, { element: h.button })`. A part's result is that builder again, so what is
14
+ * chained on the two reaches one element.
15
+ */
16
+ export declare const elementOf: (sourceCode: SourceCode, call: ESTree.CallExpression) => ESTree.Node | undefined;
17
+ //# sourceMappingURL=parts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parts.d.ts","sources":["../../src/effect-ui-stylex/parts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AA0C1D;;;GAGG;AACH,eAAO,MAAM,MAAM,eACL,UAAU,QAChB,MAAM,CAAC,cAAc,KAC1B,QAAQ,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC,cAAc,CAAA;CAAE,CAAC,GAAG,SAU7D,CAAC;AAQF;;;;;GAKG;AACH,eAAO,MAAM,SAAS,eACR,UAAU,QAChB,MAAM,CAAC,cAAc,KAC1B,MAAM,CAAC,IAAI,GAAG,SAYhB,CAAC"}