{"version":3,"file":"index.mjs","names":[],"sources":["../src/plugins/use-logical-spec.ts","../src/index.ts"],"sourcesContent":["import stylelint, { type Rule } from 'stylelint';\nimport logicalSpec from 'stylelint-use-logical-spec';\n\nconst { rule: original, ruleName } = logicalSpec as unknown as { rule: Rule; ruleName: string };\n\n/** Properties whose *value* names other properties (e.g. `transition: left 1s`). */\nconst PROPS_WITH_PROPS_IN_VALUE = /^(transition(-property)?|will-change)$/i;\nconst SKIPPED_PROP = '--lobe-use-logical-spec-skip';\n\n/**\n * `liberty/use-logical-spec` (stylelint-use-logical-spec 5.0.1, latest) also rewrites the\n * *values* of `transition`, `transition-property` and `will-change`, e.g.\n * `transition: left 0.4s, top 0.4s` -> `inset-inline-start 0.4s, inset-block-start 0.4s`.\n *\n * That is unsafe: the animated property must match the one that actually changes at runtime,\n * which lint cannot see (positions are often set via inline `style={{ left, top }}` or JS).\n * Rewriting the value silently kills the animation, and the upstream fix also lowercases the\n * whole value (breaking `${cssVar.motionEaseInOut}` interpolations).\n *\n * This wrapper keeps the rule name and every other check/fix, but hides those declarations from\n * the upstream rule: they are neither reported nor autofixed.\n */\nconst rule = ((primary, secondary, context) => {\n  const run = original(primary, secondary, context);\n\n  return (root, result) => {\n    const skipped = new Map<{ prop: string }, string>();\n\n    root.walkDecls(PROPS_WITH_PROPS_IN_VALUE, (decl) => {\n      skipped.set(decl, decl.prop);\n      decl.prop = SKIPPED_PROP;\n    });\n\n    try {\n      return run(root, result);\n    } finally {\n      for (const [decl, prop] of skipped) decl.prop = prop;\n    }\n  };\n}) as Rule;\n\nrule.ruleName = ruleName;\nrule.messages = original.messages;\nrule.meta = original.meta;\n\nexport const useLogicalSpec = stylelint.createPlugin(ruleName, rule);\n","import { type Config } from 'stylelint';\n\nimport { useLogicalSpec } from './plugins/use-logical-spec';\n\nconst config: Config = {\n  extends: [\n    'stylelint-config-standard',\n    'stylelint-config-recommended',\n    'stylelint-config-clean-order',\n  ],\n  overrides: [\n    {\n      customSyntax: 'postcss-less',\n      files: ['*.less', '*.css'],\n      plugins: ['stylelint-less'],\n      rules: {\n        'at-rule-no-unknown': null,\n        'color-no-invalid-hex': true,\n        'function-no-unknown': null,\n        'less/color-no-invalid-hex': true,\n      },\n    },\n    {\n      customSyntax: 'postcss-styled-syntax',\n      files: ['*.js', '*.jsx', '*.ts', '*.tsx'],\n      rules: {\n        'no-empty-source': null,\n        'no-invalid-double-slash-comments': null,\n        'property-no-vendor-prefix': true,\n        'value-no-vendor-prefix': [true, { ignoreValues: ['box'] }],\n      },\n    },\n  ],\n  // `liberty/use-logical-spec` comes from a wrapper around `stylelint-use-logical-spec` that keeps\n  // CSS-in-JS interpolations intact when autofixing `transition` / `will-change` values.\n  plugins: ['stylelint-order', useLogicalSpec],\n  rules: {\n    'liberty/use-logical-spec': [true, { except: ['float', /^((min|max)-)?(height|width)$/i] }],\n  },\n};\n\nexport default config;\n"],"mappings":";;;AAGA,MAAM,EAAE,MAAM,UAAU,aAAa;;AAGrC,MAAM,4BAA4B;AAClC,MAAM,eAAe;;;;;;;;;;;;;;AAerB,MAAM,SAAS,SAAS,WAAW,YAAY;CAC7C,MAAM,MAAM,SAAS,SAAS,WAAW,OAAO;CAEhD,QAAQ,MAAM,WAAW;EACvB,MAAM,0BAAU,IAAI,IAA8B;EAElD,KAAK,UAAU,4BAA4B,SAAS;GAClD,QAAQ,IAAI,MAAM,KAAK,IAAI;GAC3B,KAAK,OAAO;EACd,CAAC;EAED,IAAI;GACF,OAAO,IAAI,MAAM,MAAM;EACzB,UAAU;GACR,KAAK,MAAM,CAAC,MAAM,SAAS,SAAS,KAAK,OAAO;EAClD;CACF;AACF;AAEA,KAAK,WAAW;AAChB,KAAK,WAAW,SAAS;AACzB,KAAK,OAAO,SAAS;;ACvCrB,MAAM,SAAiB;CACrB,SAAS;EACP;EACA;EACA;CACF;CACA,WAAW,CACT;EACE,cAAc;EACd,OAAO,CAAC,UAAU,OAAO;EACzB,SAAS,CAAC,gBAAgB;EAC1B,OAAO;GACL,sBAAsB;GACtB,wBAAwB;GACxB,uBAAuB;GACvB,6BAA6B;EAC/B;CACF,GACA;EACE,cAAc;EACd,OAAO;GAAC;GAAQ;GAAS;GAAQ;EAAO;EACxC,OAAO;GACL,mBAAmB;GACnB,oCAAoC;GACpC,6BAA6B;GAC7B,0BAA0B,CAAC,MAAM,EAAE,cAAc,CAAC,KAAK,EAAE,CAAC;EAC5D;CACF,CACF;CAGA,SAAS,CAAC,mBDUkB,UAAU,aAAa,UAAU,ICVhC,CAAc;CAC3C,OAAO,EACL,4BAA4B,CAAC,MAAM,EAAE,QAAQ,CAAC,SAAS,gCAAgC,EAAE,CAAC,EAC5F;AACF"}