@variance-authority/core 0.1.0
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.
- package/CHANGELOG.md +79 -0
- package/LICENSE +21 -0
- package/README.md +169 -0
- package/dist/artifact.d.ts +47 -0
- package/dist/artifact.js +2 -0
- package/dist/artifact.js.map +1 -0
- package/dist/attribute/because.d.ts +43 -0
- package/dist/attribute/because.js +64 -0
- package/dist/attribute/because.js.map +1 -0
- package/dist/attribute/boundary.d.ts +191 -0
- package/dist/attribute/boundary.js +328 -0
- package/dist/attribute/boundary.js.map +1 -0
- package/dist/attribute/call-site.d.ts +96 -0
- package/dist/attribute/call-site.js +183 -0
- package/dist/attribute/call-site.js.map +1 -0
- package/dist/attribute/component-hash.d.ts +188 -0
- package/dist/attribute/component-hash.js +312 -0
- package/dist/attribute/component-hash.js.map +1 -0
- package/dist/attribute/composition-fixture.d.ts +18 -0
- package/dist/attribute/composition-fixture.js +53 -0
- package/dist/attribute/composition-fixture.js.map +1 -0
- package/dist/attribute/composition.d.ts +182 -0
- package/dist/attribute/composition.js +169 -0
- package/dist/attribute/composition.js.map +1 -0
- package/dist/attribute/control.d.ts +43 -0
- package/dist/attribute/control.js +54 -0
- package/dist/attribute/control.js.map +1 -0
- package/dist/attribute/coverage.d.ts +99 -0
- package/dist/attribute/coverage.js +86 -0
- package/dist/attribute/coverage.js.map +1 -0
- package/dist/attribute/divergence.d.ts +102 -0
- package/dist/attribute/divergence.js +152 -0
- package/dist/attribute/divergence.js.map +1 -0
- package/dist/attribute/index.d.ts +43 -0
- package/dist/attribute/index.js +29 -0
- package/dist/attribute/index.js.map +1 -0
- package/dist/attribute/instability.d.ts +89 -0
- package/dist/attribute/instability.js +183 -0
- package/dist/attribute/instability.js.map +1 -0
- package/dist/attribute/instances.d.ts +145 -0
- package/dist/attribute/instances.js +140 -0
- package/dist/attribute/instances.js.map +1 -0
- package/dist/attribute/locate.d.ts +22 -0
- package/dist/attribute/locate.js +100 -0
- package/dist/attribute/locate.js.map +1 -0
- package/dist/attribute/mask.d.ts +156 -0
- package/dist/attribute/mask.js +201 -0
- package/dist/attribute/mask.js.map +1 -0
- package/dist/attribute/movement.d.ts +211 -0
- package/dist/attribute/movement.js +181 -0
- package/dist/attribute/movement.js.map +1 -0
- package/dist/attribute/region.d.ts +188 -0
- package/dist/attribute/region.js +144 -0
- package/dist/attribute/region.js.map +1 -0
- package/dist/attribute/source-map.d.ts +98 -0
- package/dist/attribute/source-map.js +264 -0
- package/dist/attribute/source-map.js.map +1 -0
- package/dist/attribute/source.d.ts +77 -0
- package/dist/attribute/source.js +95 -0
- package/dist/attribute/source.js.map +1 -0
- package/dist/attribute/stack.d.ts +80 -0
- package/dist/attribute/stack.js +108 -0
- package/dist/attribute/stack.js.map +1 -0
- package/dist/compare/band.d.ts +85 -0
- package/dist/compare/band.js +70 -0
- package/dist/compare/band.js.map +1 -0
- package/dist/compare/cascade.d.ts +45 -0
- package/dist/compare/cascade.js +71 -0
- package/dist/compare/cascade.js.map +1 -0
- package/dist/compare/derive.d.ts +78 -0
- package/dist/compare/derive.js +39 -0
- package/dist/compare/derive.js.map +1 -0
- package/dist/compare/diff/attribution.d.ts +23 -0
- package/dist/compare/diff/attribution.js +244 -0
- package/dist/compare/diff/attribution.js.map +1 -0
- package/dist/compare/diff/compare-nodes.d.ts +15 -0
- package/dist/compare/diff/compare-nodes.js +227 -0
- package/dist/compare/diff/compare-nodes.js.map +1 -0
- package/dist/compare/diff/components.d.ts +20 -0
- package/dist/compare/diff/components.js +76 -0
- package/dist/compare/diff/components.js.map +1 -0
- package/dist/compare/diff/delta.d.ts +165 -0
- package/dist/compare/diff/delta.js +12 -0
- package/dist/compare/diff/delta.js.map +1 -0
- package/dist/compare/diff/index.d.ts +69 -0
- package/dist/compare/diff/index.js +101 -0
- package/dist/compare/diff/index.js.map +1 -0
- package/dist/compare/diff/match.d.ts +37 -0
- package/dist/compare/diff/match.js +167 -0
- package/dist/compare/diff/match.js.map +1 -0
- package/dist/compare/explain.d.ts +23 -0
- package/dist/compare/explain.js +190 -0
- package/dist/compare/explain.js.map +1 -0
- package/dist/compare/holding-diff.d.ts +25 -0
- package/dist/compare/holding-diff.js +74 -0
- package/dist/compare/holding-diff.js.map +1 -0
- package/dist/compare/impact.d.ts +56 -0
- package/dist/compare/impact.js +124 -0
- package/dist/compare/impact.js.map +1 -0
- package/dist/compare/index.d.ts +30 -0
- package/dist/compare/index.js +22 -0
- package/dist/compare/index.js.map +1 -0
- package/dist/compare/instance.d.ts +30 -0
- package/dist/compare/instance.js +145 -0
- package/dist/compare/instance.js.map +1 -0
- package/dist/compare/observability.d.ts +49 -0
- package/dist/compare/observability.js +57 -0
- package/dist/compare/observability.js.map +1 -0
- package/dist/compare/parting.d.ts +179 -0
- package/dist/compare/parting.js +244 -0
- package/dist/compare/parting.js.map +1 -0
- package/dist/compare/slice.d.ts +74 -0
- package/dist/compare/slice.js +79 -0
- package/dist/compare/slice.js.map +1 -0
- package/dist/compare/value.d.ts +60 -0
- package/dist/compare/value.js +111 -0
- package/dist/compare/value.js.map +1 -0
- package/dist/format/accessibility.d.ts +27 -0
- package/dist/format/accessibility.js +17 -0
- package/dist/format/accessibility.js.map +1 -0
- package/dist/format/canonical.d.ts +38 -0
- package/dist/format/canonical.js +65 -0
- package/dist/format/canonical.js.map +1 -0
- package/dist/format/capture.d.ts +212 -0
- package/dist/format/capture.js +2 -0
- package/dist/format/capture.js.map +1 -0
- package/dist/format/document.d.ts +279 -0
- package/dist/format/document.js +65 -0
- package/dist/format/document.js.map +1 -0
- package/dist/format/environment.d.ts +120 -0
- package/dist/format/environment.js +53 -0
- package/dist/format/environment.js.map +1 -0
- package/dist/format/hash.d.ts +45 -0
- package/dist/format/hash.js +41 -0
- package/dist/format/hash.js.map +1 -0
- package/dist/format/holding.d.ts +134 -0
- package/dist/format/holding.js +2 -0
- package/dist/format/holding.js.map +1 -0
- package/dist/format/index.d.ts +39 -0
- package/dist/format/index.js +25 -0
- package/dist/format/index.js.map +1 -0
- package/dist/format/intervention.d.ts +87 -0
- package/dist/format/intervention.js +11 -0
- package/dist/format/intervention.js.map +1 -0
- package/dist/format/profile.d.ts +59 -0
- package/dist/format/profile.js +66 -0
- package/dist/format/profile.js.map +1 -0
- package/dist/format/provenance.d.ts +179 -0
- package/dist/format/provenance.js +222 -0
- package/dist/format/provenance.js.map +1 -0
- package/dist/format/sha256.d.ts +34 -0
- package/dist/format/sha256.js +152 -0
- package/dist/format/sha256.js.map +1 -0
- package/dist/format/snapshot.d.ts +263 -0
- package/dist/format/snapshot.js +2 -0
- package/dist/format/snapshot.js.map +1 -0
- package/dist/format/stabilize.d.ts +190 -0
- package/dist/format/stabilize.js +333 -0
- package/dist/format/stabilize.js.map +1 -0
- package/dist/format/tier.d.ts +19 -0
- package/dist/format/tier.js +11 -0
- package/dist/format/tier.js.map +1 -0
- package/dist/format/value.d.ts +115 -0
- package/dist/format/value.js +182 -0
- package/dist/format/value.js.map +1 -0
- package/dist/format/wiring.d.ts +115 -0
- package/dist/format/wiring.js +60 -0
- package/dist/format/wiring.js.map +1 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/judge/docket.d.ts +85 -0
- package/dist/judge/docket.js +162 -0
- package/dist/judge/docket.js.map +1 -0
- package/dist/judge/fingerprint.d.ts +53 -0
- package/dist/judge/fingerprint.js +144 -0
- package/dist/judge/fingerprint.js.map +1 -0
- package/dist/judge/ignore.d.ts +206 -0
- package/dist/judge/ignore.js +237 -0
- package/dist/judge/ignore.js.map +1 -0
- package/dist/judge/index.d.ts +44 -0
- package/dist/judge/index.js +34 -0
- package/dist/judge/index.js.map +1 -0
- package/dist/judge/inspect.d.ts +148 -0
- package/dist/judge/inspect.js +208 -0
- package/dist/judge/inspect.js.map +1 -0
- package/dist/judge/intent.d.ts +146 -0
- package/dist/judge/intent.js +150 -0
- package/dist/judge/intent.js.map +1 -0
- package/dist/judge/locale.d.ts +111 -0
- package/dist/judge/locale.js +247 -0
- package/dist/judge/locale.js.map +1 -0
- package/dist/judge/scope.d.ts +41 -0
- package/dist/judge/scope.js +47 -0
- package/dist/judge/scope.js.map +1 -0
- package/dist/judge/sensitivity.d.ts +202 -0
- package/dist/judge/sensitivity.js +152 -0
- package/dist/judge/sensitivity.js.map +1 -0
- package/dist/judge/trail.d.ts +122 -0
- package/dist/judge/trail.js +96 -0
- package/dist/judge/trail.js.map +1 -0
- package/dist/judge/verdict.d.ts +39 -0
- package/dist/judge/verdict.js +32 -0
- package/dist/judge/verdict.js.map +1 -0
- package/dist/plan/index.d.ts +12 -0
- package/dist/plan/index.js +11 -0
- package/dist/plan/index.js.map +1 -0
- package/dist/plan/tool.d.ts +85 -0
- package/dist/plan/tool.js +87 -0
- package/dist/plan/tool.js.map +1 -0
- package/dist/relate/graph.d.ts +190 -0
- package/dist/relate/graph.js +234 -0
- package/dist/relate/graph.js.map +1 -0
- package/dist/relate/index.d.ts +16 -0
- package/dist/relate/index.js +16 -0
- package/dist/relate/index.js.map +1 -0
- package/dist/relate/merkle.d.ts +110 -0
- package/dist/relate/merkle.js +246 -0
- package/dist/relate/merkle.js.map +1 -0
- package/dist/relate/reach.d.ts +65 -0
- package/dist/relate/reach.js +111 -0
- package/dist/relate/reach.js.map +1 -0
- package/dist/relate/records.d.ts +129 -0
- package/dist/relate/records.js +112 -0
- package/dist/relate/records.js.map +1 -0
- package/dist/rules/index.d.ts +19 -0
- package/dist/rules/index.js +17 -0
- package/dist/rules/index.js.map +1 -0
- package/dist/rules/normalize/alias.d.ts +50 -0
- package/dist/rules/normalize/alias.js +111 -0
- package/dist/rules/normalize/alias.js.map +1 -0
- package/dist/rules/normalize/cascade.d.ts +85 -0
- package/dist/rules/normalize/cascade.js +324 -0
- package/dist/rules/normalize/cascade.js.map +1 -0
- package/dist/rules/normalize/color.d.ts +30 -0
- package/dist/rules/normalize/color.js +185 -0
- package/dist/rules/normalize/color.js.map +1 -0
- package/dist/rules/normalize/fixture.d.ts +83 -0
- package/dist/rules/normalize/fixture.js +74 -0
- package/dist/rules/normalize/fixture.js.map +1 -0
- package/dist/rules/normalize/index.d.ts +39 -0
- package/dist/rules/normalize/index.js +268 -0
- package/dist/rules/normalize/index.js.map +1 -0
- package/dist/rules/normalize/project.d.ts +42 -0
- package/dist/rules/normalize/project.js +83 -0
- package/dist/rules/normalize/project.js.map +1 -0
- package/dist/rules/normalize/shorthand.d.ts +38 -0
- package/dist/rules/normalize/shorthand.js +388 -0
- package/dist/rules/normalize/shorthand.js.map +1 -0
- package/dist/rules/normalize/value.d.ts +23 -0
- package/dist/rules/normalize/value.js +162 -0
- package/dist/rules/normalize/value.js.map +1 -0
- package/dist/rules/normalize/wrapper.d.ts +16 -0
- package/dist/rules/normalize/wrapper.js +137 -0
- package/dist/rules/normalize/wrapper.js.map +1 -0
- package/dist/rules/ruleset.d.ts +93 -0
- package/dist/rules/ruleset.js +175 -0
- package/dist/rules/ruleset.js.map +1 -0
- package/mark.svg +30 -0
- package/package.json +69 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ruleset.js","sourceRoot":"","sources":["../../src/rules/ruleset.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,oDAAoD;AACpD,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC;AAEpC;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,eAAe,GAAsB;IAChD,mCAAmC;IACnC,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;IACzE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY;IACvE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa;IAC5D,aAAa,EAAE,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AClD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU;CAClF,CAAC;AAEF,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,mBAAmB,CAAC,CAAC;AAEhD,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAsB;IACxD,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS;IACtC,iBAAiB,EAAE,kBAAkB,EAAE,eAAe,EAAE,WAAW;IACnE,uBAAuB,EAAE,cAAc,EAAE,mBAAmB,EAAE,aAAa;CAC5E,CAAC;AAEF,kFAAkF;AAClF,MAAM,CAAC,MAAM,4BAA4B,GAAsB;IAC7D,SAAS,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,eAAe;IACjE,WAAW,EAAE,aAAa;CAC3B,CAAC","sourcesContent":["/**\n * The normalization ruleset and computed-style allowlist.\n *\n * Both versions are components of the environment key, so **changing anything in\n * this file invalidates every baseline in every repository using it** (spec §7.3).\n * That is correct and intended — a rule change is a render-input change — but it\n * means edits here are releases, not tweaks. Bump the version in the same commit.\n */\n\n/** Bump on any change to normalization behavior. */\nexport const RULESET_VERSION = 'r1';\n\n/**\n * Bump on any change to {@link STYLE_ALLOWLIST}.\n *\n * `a2` added `accent-color` and `-webkit-text-stroke-width`, both found by\n * probing a real Chromium against the semantic snapshot: each moves hundreds of\n * pixels and neither moved the render hash.\n *\n * `-webkit-text-stroke-color` was added alongside them and immediately removed.\n * Its initial value is `currentcolor`, so it moves whenever `color` moves — which\n * split a colour-token root in two, since the derived property resolves through\n * no token and looked like an independent cause. Nothing measured it as a gap;\n * it was added on the assumption that its sibling implied it. Properties whose\n * computed value derives from another property need the derivation modelled\n * before they can be admitted.\n */\nexport const ALLOWLIST_VERSION = 'a2';\n\n/**\n * Properties that enter a snapshot.\n *\n * The allowlist is the direct lever on the product's central tradeoff (spec\n * §11.3): too narrow and real regressions pass unseen; too wide and every\n * snapshot churns, reintroducing the fatigue that makes teams stop reading\n * diffs. So the admission test is deliberately strict —\n *\n * > Can a change to this property alone alter what a user sees or how assistive\n * > technology reports the page?\n *\n * Only longhands appear. Shorthands are expanded before matching, because\n * `margin: 4px` and `margin-top: 4px; …` must produce identical snapshots or\n * refactoring a stylesheet becomes a mass-invalidation event.\n *\n * Notable exclusions, each for a reason:\n * - `transition-*` / `animation-*` — snapshots are taken at a declared settle\n * point with animation disabled, so these describe a journey the snapshot does\n * not contain. Including them would make every easing tweak a diff.\n * - `cursor`, `user-select`, `will-change`, `contain` — invisible in both raster\n * and the accessibility tree at rest.\n * - `content` — resolved pseudo-element text is captured as text, not as a\n * declaration, so that it diffs like the content it is.\n */\nexport const STYLE_ALLOWLIST: readonly string[] = [\n // Box model and formatting context\n 'display', 'position', 'top', 'right', 'bottom', 'left', 'float', 'clear',\n 'width', 'height', 'min-width', 'min-height', 'max-width', 'max-height',\n 'margin-top', 'margin-right', 'margin-bottom', 'margin-left',\n 'padding-top', 'padding-right', 'padding-bottom', 'padding-left',\n 'box-sizing', 'overflow-x', 'overflow-y', 'z-index', 'aspect-ratio',\n\n // Flex and grid\n 'flex-direction', 'flex-wrap', 'flex-grow', 'flex-shrink', 'flex-basis',\n 'justify-content', 'align-items', 'align-self', 'align-content', 'order',\n 'grid-template-columns', 'grid-template-rows', 'grid-template-areas',\n 'grid-auto-columns', 'grid-auto-rows', 'grid-auto-flow',\n 'grid-column-start', 'grid-column-end', 'grid-row-start', 'grid-row-end',\n 'row-gap', 'column-gap',\n\n // Typography\n 'font-family', 'font-size', 'font-weight', 'font-style', 'font-variant',\n 'font-stretch', 'line-height', 'letter-spacing', 'word-spacing',\n 'text-align', 'text-indent', 'text-transform', 'text-overflow',\n 'text-decoration-line', 'text-decoration-color', 'text-decoration-style',\n 'text-decoration-thickness', 'white-space', 'word-break', 'overflow-wrap',\n 'vertical-align', 'writing-mode', 'direction',\n\n // Paint\n 'color', 'opacity', 'background-color', 'background-image',\n // Native-control painting. `accent-color` restyles checkboxes and radios,\n // which is exactly the kind of property the rest of this list misses: it\n // describes what the *engine* paints rather than what the author declares\n // about a box. See the note below.\n 'accent-color', '-webkit-text-stroke-width',\n 'background-position', 'background-size', 'background-repeat',\n 'background-clip', 'background-origin',\n 'border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width',\n 'border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style',\n 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color',\n 'border-top-left-radius', 'border-top-right-radius',\n 'border-bottom-right-radius', 'border-bottom-left-radius',\n 'outline-width', 'outline-style', 'outline-color', 'outline-offset',\n 'box-shadow', 'text-shadow', 'filter', 'backdrop-filter', 'mix-blend-mode',\n\n // Visibility and geometry transforms\n 'visibility', 'content-visibility', 'transform', 'transform-origin',\n 'object-fit', 'object-position',\n\n // Tables\n 'table-layout', 'border-collapse', 'border-spacing', 'caption-side',\n];\n\n/**\n * Known weakness, recorded because two additions do not fix it.\n *\n * The list above was assembled by asking what an author declares about a box,\n * and it is good at that. It is poor at properties describing what the *engine*\n * paints — native control appearance, text decoration painted outside the glyph\n * box, platform accent colours. `accent-color` and `-webkit-text-stroke-width`\n * were found in an afternoon of probing a real browser, which is weak evidence\n * that they are the only two.\n *\n * The right response is a systematic audit against the CSS property index rather\n * than more ad-hoc additions, and until that happens this list should be assumed\n * to have holes of this shape. A missing property is a false `unchanged`, so the\n * gap is in the direction that matters.\n */\nconst ALLOWED = new Set(STYLE_ALLOWLIST);\n\nexport function isAllowedProperty(property: string): boolean {\n return ALLOWED.has(property);\n}\n\n/**\n * Custom properties are always admitted, whatever their name.\n *\n * They cannot be enumerated in advance — every project invents its own — and they\n * are the mechanism design tokens travel through, which makes them the highest-\n * value signal the system collects: a custom property resolves a *name* alongside\n * a value, and that name is what lets one token edit collapse into one docket\n * root with counted collateral rather than hundreds of separate colour diffs.\n */\nexport function isCustomProperty(property: string): boolean {\n return property.startsWith('--');\n}\n\n/** Whether a property survives the allowlist projection (ADR-0003 step 4). */\nexport function admits(property: string): boolean {\n return isCustomProperty(property) || isAllowedProperty(property);\n}\n\n/**\n * Attributes kept on a semantic node.\n *\n * An allowlist rather than a denylist. Frameworks emit an open-ended supply of\n * bookkeeping attributes — `data-reactroot`, `data-styled`, `data-testid`,\n * `data-v-7f3a`, Storybook's own markers — and a denylist would need a new entry\n * for each one, silently churning baselines until someone noticed. Anything not\n * named here is dropped.\n *\n * `class` is absent by design (ADR-0003): a class name records *how* a style was\n * applied, and the snapshot already records *what* was applied, resolved.\n * `id` is absent because it has been replaced by a structural alias.\n * `aria-*` is absent because those are resolved into `role`/`name`/`state`,\n * which is what actually reaches a user.\n */\nexport const ATTRIBUTE_ALLOWLIST: readonly string[] = [\n 'type', 'value', 'checked', 'disabled', 'readonly', 'required', 'multiple',\n 'placeholder', 'name', 'href', 'target', 'rel', 'src', 'alt', 'title',\n 'for', 'form', 'list', 'headers', 'colspan', 'rowspan', 'scope',\n 'lang', 'dir', 'hidden', 'open', 'selected', 'download',\n 'min', 'max', 'step', 'pattern', 'maxlength', 'minlength', 'autocomplete',\n 'role', 'tabindex', 'draggable', 'contenteditable',\n 'width', 'height', 'loading', 'decoding', 'srcset', 'sizes', 'poster', 'controls',\n];\n\nconst ATTRIBUTES = new Set(ATTRIBUTE_ALLOWLIST);\n\nexport function admitsAttribute(name: string): boolean {\n return ATTRIBUTES.has(name);\n}\n\n/**\n * Attributes whose values are id references, rewritten to structural aliases.\n *\n * Aliasing rather than masking is what preserves the *relationship* while\n * deleting the volatile *value* (ADR-0003): a `useId` renumbering becomes a\n * no-op, while breaking a `label ↔ input` association stays a real structural\n * change. Masking both to a constant cannot tell those apart.\n */\nexport const ID_REFERENCE_ATTRIBUTES: readonly string[] = [\n 'id', 'for', 'form', 'list', 'headers',\n 'aria-labelledby', 'aria-describedby', 'aria-controls', 'aria-owns',\n 'aria-activedescendant', 'aria-details', 'aria-errormessage', 'aria-flowto',\n];\n\n/** Attributes holding a *space-separated list* of id references, not just one. */\nexport const ID_REFERENCE_LIST_ATTRIBUTES: readonly string[] = [\n 'headers', 'aria-labelledby', 'aria-describedby', 'aria-controls',\n 'aria-owns', 'aria-flowto',\n];\n"]}
|
package/mark.svg
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 320" role="img" aria-labelledby="title desc">
|
|
2
|
+
<title id="title">Variance Authority mark</title>
|
|
3
|
+
<desc id="desc">Folded ribbon VA mark in charcoal and orange.</desc>
|
|
4
|
+
|
|
5
|
+
<defs>
|
|
6
|
+
<style>
|
|
7
|
+
.ribbon-dark {
|
|
8
|
+
fill: #24282A;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@media (prefers-color-scheme: dark) {
|
|
12
|
+
.ribbon-dark {
|
|
13
|
+
fill: #F3F4F6;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
</style>
|
|
17
|
+
</defs>
|
|
18
|
+
|
|
19
|
+
<!-- Left descending ribbon -->
|
|
20
|
+
<path class="ribbon-dark" d="M64 54H159L256 266H160Z"/>
|
|
21
|
+
|
|
22
|
+
<!-- Right descending ribbon -->
|
|
23
|
+
<path class="ribbon-dark" d="M331 28H419L494 266H397Z"/>
|
|
24
|
+
|
|
25
|
+
<!-- Chosen / variant ribbon -->
|
|
26
|
+
<path d="M256 266L202 152L283 28H376L301 165Z" fill="#FF4A19"/>
|
|
27
|
+
|
|
28
|
+
<!-- Fold shadow -->
|
|
29
|
+
<path d="M202 152L256 266L301 165L264 103Z" fill="#D83A13" opacity="0.72"/>
|
|
30
|
+
</svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@variance-authority/core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "The Variance Authority format, rules, comparison, attribution and verdicts. Pure data in, pure data out, no DOM and no I/O.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"variance-authority",
|
|
7
|
+
"normalization",
|
|
8
|
+
"attribution",
|
|
9
|
+
"visual-diff",
|
|
10
|
+
"verdict"
|
|
11
|
+
],
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"author": "Machine Garden",
|
|
14
|
+
"homepage": "https://variance-authority.dev#packages",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/Variance-Authority/variance-authority.git",
|
|
18
|
+
"directory": "packages/core"
|
|
19
|
+
},
|
|
20
|
+
"bugs": "https://github.com/Variance-Authority/variance-authority/issues",
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=22"
|
|
23
|
+
},
|
|
24
|
+
"type": "module",
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"default": "./dist/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./format": {
|
|
31
|
+
"types": "./dist/format/index.d.ts",
|
|
32
|
+
"default": "./dist/format/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./rules": {
|
|
35
|
+
"types": "./dist/rules/index.d.ts",
|
|
36
|
+
"default": "./dist/rules/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./compare": {
|
|
39
|
+
"types": "./dist/compare/index.d.ts",
|
|
40
|
+
"default": "./dist/compare/index.js"
|
|
41
|
+
},
|
|
42
|
+
"./attribute": {
|
|
43
|
+
"types": "./dist/attribute/index.d.ts",
|
|
44
|
+
"default": "./dist/attribute/index.js"
|
|
45
|
+
},
|
|
46
|
+
"./relate": {
|
|
47
|
+
"types": "./dist/relate/index.d.ts",
|
|
48
|
+
"default": "./dist/relate/index.js"
|
|
49
|
+
},
|
|
50
|
+
"./judge": {
|
|
51
|
+
"types": "./dist/judge/index.d.ts",
|
|
52
|
+
"default": "./dist/judge/index.js"
|
|
53
|
+
},
|
|
54
|
+
"./plan": {
|
|
55
|
+
"types": "./dist/plan/index.d.ts",
|
|
56
|
+
"default": "./dist/plan/index.js"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"main": "./dist/index.js",
|
|
60
|
+
"types": "./dist/index.d.ts",
|
|
61
|
+
"files": [
|
|
62
|
+
"dist",
|
|
63
|
+
"!dist/**/*.d.ts.map",
|
|
64
|
+
"mark.svg"
|
|
65
|
+
],
|
|
66
|
+
"scripts": {
|
|
67
|
+
"build": "tsc --build"
|
|
68
|
+
}
|
|
69
|
+
}
|