praxis-kit 7.8.0 → 7.8.1

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.
@@ -1608,7 +1608,7 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1608
1608
  const next = _AriaPolicyEngine.#applyFixes(narrowedTag, implicitRole, workingProps, fixes);
1609
1609
  return { props: next, violations: [...preExistingViolations, ...violations] };
1610
1610
  }
1611
- static #evaluateWithRules(tag, props, extraRules) {
1611
+ static #evaluateWithRules(tag, props, extraRules, extraProps) {
1612
1612
  const derived = _AriaPolicyEngine.#deriveContext(tag, props);
1613
1613
  if (!derived.proceed) return derived.result;
1614
1614
  const {
@@ -1618,8 +1618,12 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1618
1618
  props: workingProps,
1619
1619
  preExistingViolations
1620
1620
  } = derived;
1621
- const rules = derived.hasRole ? [..._AriaPolicyEngine.#getRules(context), ...extraRules] : extraRules;
1622
- const { violations, fixes } = _AriaPolicyEngine.#runRules(rules, context);
1621
+ const builtinRules = derived.hasRole ? _AriaPolicyEngine.#getRules(context) : [];
1622
+ const builtin = _AriaPolicyEngine.#runRules(builtinRules, context);
1623
+ const extraContext = extraProps === void 0 ? context : { ...context, props: extraProps };
1624
+ const extra = _AriaPolicyEngine.#runRules(extraRules, extraContext);
1625
+ const violations = [...builtin.violations, ...extra.violations];
1626
+ const fixes = [...builtin.fixes, ...extra.fixes];
1623
1627
  const next = _AriaPolicyEngine.#applyFixes(narrowedTag, implicitRole, workingProps, fixes);
1624
1628
  return { props: next, violations: [...preExistingViolations, ...violations] };
1625
1629
  }
@@ -1690,11 +1694,17 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1690
1694
  Object.assign(next, updates);
1691
1695
  return next;
1692
1696
  }
1693
- validate(tag, props) {
1697
+ // `extraProps`, when supplied, is the pre-variant-filter props object (the same one
1698
+ // `normalize()` receives) — used only as the evaluation context for this engine's own
1699
+ // #extraRules (a consumer's `enforcement.aria`/`enforcement.rules`), never for the built-in
1700
+ // role-semantic pipeline or for the props a fix can apply to. Defaults to `props` so callers
1701
+ // that don't have a separate pre-filter object (or don't need one) see unchanged behavior.
1702
+ validate(tag, props, extraProps) {
1703
+ const ruleProps = extraProps ?? props;
1694
1704
  const baseKey = _AriaPolicyEngine.#createPlanKey(tag, props);
1695
1705
  let key = baseKey;
1696
1706
  if (this.#extraRules.length > 0) {
1697
- const suffix = _AriaPolicyEngine.#extraRulesKeySuffix(this.#extraRules, props);
1707
+ const suffix = _AriaPolicyEngine.#extraRulesKeySuffix(this.#extraRules, ruleProps);
1698
1708
  key = isNonNull(baseKey) && isNonNull(suffix) ? `${baseKey}|${suffix}` : null;
1699
1709
  }
1700
1710
  if (!isNull(key)) {
@@ -1707,7 +1717,7 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1707
1717
  };
1708
1718
  }
1709
1719
  }
1710
- const result = this.#extraRules.length ? _AriaPolicyEngine.#evaluateWithRules(tag, props, this.#extraRules) : _AriaPolicyEngine.evaluate(tag, props);
1720
+ const result = this.#extraRules.length ? _AriaPolicyEngine.#evaluateWithRules(tag, props, this.#extraRules, extraProps) : _AriaPolicyEngine.evaluate(tag, props);
1711
1721
  if (result.violations.length > 0) this.report(result.violations);
1712
1722
  if (!isNull(key)) {
1713
1723
  const { removals, updates } = _AriaPolicyEngine.#computePlan(
@@ -3598,10 +3608,10 @@ function resolveAriaRules(resolved) {
3598
3608
  var createAriaPipeline = (resolved) => {
3599
3609
  const rules = resolveAriaRules(resolved);
3600
3610
  const engine = new AriaPolicyEngine(resolved.diagnostics, rules.length ? { rules } : void 0);
3601
- return (tag, props) => engine.validate(tag, props);
3611
+ return (tag, props, extraProps) => engine.validate(tag, props, extraProps);
3602
3612
  };
3603
3613
  var memoizedAriaPipeline = definePipeline(createAriaPipeline);
3604
- function resolveAriaPassthrough(_tag, props) {
3614
+ function resolveAriaPassthrough(_tag, props, _extraProps) {
3605
3615
  return { props };
3606
3616
  }
3607
3617
 
@@ -3686,8 +3696,8 @@ function createPolymorphic(options = {}) {
3686
3696
  }
3687
3697
  return classPipeline(tag, props, className, recipe) || void 0;
3688
3698
  },
3689
- resolveAria(tag, props) {
3690
- return resolveAriaFn(tag, props);
3699
+ resolveAria(tag, props, extraProps) {
3700
+ return resolveAriaFn(tag, props, extraProps);
3691
3701
  }
3692
3702
  };
3693
3703
  const runtimeObject = pluginResult ? { ...methods, options: resolved, hasStyling: true, classPlugin: pluginResult } : { ...methods, options: resolved };
@@ -4047,7 +4057,7 @@ function buildElementProps(props, className, ref, children) {
4047
4057
  }
4048
4058
  function renderIntrinsic(state, ref, runtime) {
4049
4059
  const elementProps = buildElementProps(state.props, state.className, ref, state.children);
4050
- const domProps = typeof state.tag === "string" ? runtime.resolveAria(state.tag, elementProps).props : elementProps;
4060
+ const domProps = typeof state.tag === "string" ? runtime.resolveAria(state.tag, elementProps, state.normalizedProps).props : elementProps;
4051
4061
  return createElement2(state.tag, domProps);
4052
4062
  }
4053
4063
  function render({
package/dist/lit/index.js CHANGED
@@ -1430,7 +1430,7 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1430
1430
  const next = _AriaPolicyEngine.#applyFixes(narrowedTag, implicitRole, workingProps, fixes);
1431
1431
  return { props: next, violations: [...preExistingViolations, ...violations] };
1432
1432
  }
1433
- static #evaluateWithRules(tag, props, extraRules) {
1433
+ static #evaluateWithRules(tag, props, extraRules, extraProps) {
1434
1434
  const derived = _AriaPolicyEngine.#deriveContext(tag, props);
1435
1435
  if (!derived.proceed) return derived.result;
1436
1436
  const {
@@ -1440,8 +1440,12 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1440
1440
  props: workingProps,
1441
1441
  preExistingViolations
1442
1442
  } = derived;
1443
- const rules = derived.hasRole ? [..._AriaPolicyEngine.#getRules(context), ...extraRules] : extraRules;
1444
- const { violations, fixes } = _AriaPolicyEngine.#runRules(rules, context);
1443
+ const builtinRules = derived.hasRole ? _AriaPolicyEngine.#getRules(context) : [];
1444
+ const builtin = _AriaPolicyEngine.#runRules(builtinRules, context);
1445
+ const extraContext = extraProps === void 0 ? context : { ...context, props: extraProps };
1446
+ const extra = _AriaPolicyEngine.#runRules(extraRules, extraContext);
1447
+ const violations = [...builtin.violations, ...extra.violations];
1448
+ const fixes = [...builtin.fixes, ...extra.fixes];
1445
1449
  const next = _AriaPolicyEngine.#applyFixes(narrowedTag, implicitRole, workingProps, fixes);
1446
1450
  return { props: next, violations: [...preExistingViolations, ...violations] };
1447
1451
  }
@@ -1512,11 +1516,17 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1512
1516
  Object.assign(next, updates);
1513
1517
  return next;
1514
1518
  }
1515
- validate(tag, props) {
1519
+ // `extraProps`, when supplied, is the pre-variant-filter props object (the same one
1520
+ // `normalize()` receives) — used only as the evaluation context for this engine's own
1521
+ // #extraRules (a consumer's `enforcement.aria`/`enforcement.rules`), never for the built-in
1522
+ // role-semantic pipeline or for the props a fix can apply to. Defaults to `props` so callers
1523
+ // that don't have a separate pre-filter object (or don't need one) see unchanged behavior.
1524
+ validate(tag, props, extraProps) {
1525
+ const ruleProps = extraProps ?? props;
1516
1526
  const baseKey = _AriaPolicyEngine.#createPlanKey(tag, props);
1517
1527
  let key = baseKey;
1518
1528
  if (this.#extraRules.length > 0) {
1519
- const suffix = _AriaPolicyEngine.#extraRulesKeySuffix(this.#extraRules, props);
1529
+ const suffix = _AriaPolicyEngine.#extraRulesKeySuffix(this.#extraRules, ruleProps);
1520
1530
  key = isNonNull(baseKey) && isNonNull(suffix) ? `${baseKey}|${suffix}` : null;
1521
1531
  }
1522
1532
  if (!isNull(key)) {
@@ -1529,7 +1539,7 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1529
1539
  };
1530
1540
  }
1531
1541
  }
1532
- const result = this.#extraRules.length ? _AriaPolicyEngine.#evaluateWithRules(tag, props, this.#extraRules) : _AriaPolicyEngine.evaluate(tag, props);
1542
+ const result = this.#extraRules.length ? _AriaPolicyEngine.#evaluateWithRules(tag, props, this.#extraRules, extraProps) : _AriaPolicyEngine.evaluate(tag, props);
1533
1543
  if (result.violations.length > 0) this.report(result.violations);
1534
1544
  if (!isNull(key)) {
1535
1545
  const { removals, updates } = _AriaPolicyEngine.#computePlan(
@@ -3420,10 +3430,10 @@ function resolveAriaRules(resolved) {
3420
3430
  var createAriaPipeline = (resolved) => {
3421
3431
  const rules = resolveAriaRules(resolved);
3422
3432
  const engine = new AriaPolicyEngine(resolved.diagnostics, rules.length ? { rules } : void 0);
3423
- return (tag, props) => engine.validate(tag, props);
3433
+ return (tag, props, extraProps) => engine.validate(tag, props, extraProps);
3424
3434
  };
3425
3435
  var memoizedAriaPipeline = definePipeline(createAriaPipeline);
3426
- function resolveAriaPassthrough(_tag, props) {
3436
+ function resolveAriaPassthrough(_tag, props, _extraProps) {
3427
3437
  return { props };
3428
3438
  }
3429
3439
 
@@ -3508,8 +3518,8 @@ function createPolymorphic(options = {}) {
3508
3518
  }
3509
3519
  return classPipeline(tag, props, className, recipe) || void 0;
3510
3520
  },
3511
- resolveAria(tag, props) {
3512
- return resolveAriaFn(tag, props);
3521
+ resolveAria(tag, props, extraProps) {
3522
+ return resolveAriaFn(tag, props, extraProps);
3513
3523
  }
3514
3524
  };
3515
3525
  const runtimeObject = pluginResult ? { ...methods, options: resolved, hasStyling: true, classPlugin: pluginResult } : { ...methods, options: resolved };
@@ -1607,7 +1607,7 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1607
1607
  const next = _AriaPolicyEngine.#applyFixes(narrowedTag, implicitRole, workingProps, fixes);
1608
1608
  return { props: next, violations: [...preExistingViolations, ...violations] };
1609
1609
  }
1610
- static #evaluateWithRules(tag, props, extraRules) {
1610
+ static #evaluateWithRules(tag, props, extraRules, extraProps) {
1611
1611
  const derived = _AriaPolicyEngine.#deriveContext(tag, props);
1612
1612
  if (!derived.proceed) return derived.result;
1613
1613
  const {
@@ -1617,8 +1617,12 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1617
1617
  props: workingProps,
1618
1618
  preExistingViolations
1619
1619
  } = derived;
1620
- const rules = derived.hasRole ? [..._AriaPolicyEngine.#getRules(context), ...extraRules] : extraRules;
1621
- const { violations, fixes } = _AriaPolicyEngine.#runRules(rules, context);
1620
+ const builtinRules = derived.hasRole ? _AriaPolicyEngine.#getRules(context) : [];
1621
+ const builtin = _AriaPolicyEngine.#runRules(builtinRules, context);
1622
+ const extraContext = extraProps === void 0 ? context : { ...context, props: extraProps };
1623
+ const extra = _AriaPolicyEngine.#runRules(extraRules, extraContext);
1624
+ const violations = [...builtin.violations, ...extra.violations];
1625
+ const fixes = [...builtin.fixes, ...extra.fixes];
1622
1626
  const next = _AriaPolicyEngine.#applyFixes(narrowedTag, implicitRole, workingProps, fixes);
1623
1627
  return { props: next, violations: [...preExistingViolations, ...violations] };
1624
1628
  }
@@ -1689,11 +1693,17 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1689
1693
  Object.assign(next, updates);
1690
1694
  return next;
1691
1695
  }
1692
- validate(tag, props) {
1696
+ // `extraProps`, when supplied, is the pre-variant-filter props object (the same one
1697
+ // `normalize()` receives) — used only as the evaluation context for this engine's own
1698
+ // #extraRules (a consumer's `enforcement.aria`/`enforcement.rules`), never for the built-in
1699
+ // role-semantic pipeline or for the props a fix can apply to. Defaults to `props` so callers
1700
+ // that don't have a separate pre-filter object (or don't need one) see unchanged behavior.
1701
+ validate(tag, props, extraProps) {
1702
+ const ruleProps = extraProps ?? props;
1693
1703
  const baseKey = _AriaPolicyEngine.#createPlanKey(tag, props);
1694
1704
  let key = baseKey;
1695
1705
  if (this.#extraRules.length > 0) {
1696
- const suffix = _AriaPolicyEngine.#extraRulesKeySuffix(this.#extraRules, props);
1706
+ const suffix = _AriaPolicyEngine.#extraRulesKeySuffix(this.#extraRules, ruleProps);
1697
1707
  key = isNonNull(baseKey) && isNonNull(suffix) ? `${baseKey}|${suffix}` : null;
1698
1708
  }
1699
1709
  if (!isNull(key)) {
@@ -1706,7 +1716,7 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1706
1716
  };
1707
1717
  }
1708
1718
  }
1709
- const result = this.#extraRules.length ? _AriaPolicyEngine.#evaluateWithRules(tag, props, this.#extraRules) : _AriaPolicyEngine.evaluate(tag, props);
1719
+ const result = this.#extraRules.length ? _AriaPolicyEngine.#evaluateWithRules(tag, props, this.#extraRules, extraProps) : _AriaPolicyEngine.evaluate(tag, props);
1710
1720
  if (result.violations.length > 0) this.report(result.violations);
1711
1721
  if (!isNull(key)) {
1712
1722
  const { removals, updates } = _AriaPolicyEngine.#computePlan(
@@ -3597,10 +3607,10 @@ function resolveAriaRules(resolved) {
3597
3607
  var createAriaPipeline = (resolved) => {
3598
3608
  const rules = resolveAriaRules(resolved);
3599
3609
  const engine = new AriaPolicyEngine(resolved.diagnostics, rules.length ? { rules } : void 0);
3600
- return (tag, props) => engine.validate(tag, props);
3610
+ return (tag, props, extraProps) => engine.validate(tag, props, extraProps);
3601
3611
  };
3602
3612
  var memoizedAriaPipeline = definePipeline(createAriaPipeline);
3603
- function resolveAriaPassthrough(_tag, props) {
3613
+ function resolveAriaPassthrough(_tag, props, _extraProps) {
3604
3614
  return { props };
3605
3615
  }
3606
3616
 
@@ -3685,8 +3695,8 @@ function createPolymorphic(options = {}) {
3685
3695
  }
3686
3696
  return classPipeline(tag, props, className, recipe) || void 0;
3687
3697
  },
3688
- resolveAria(tag, props) {
3689
- return resolveAriaFn(tag, props);
3698
+ resolveAria(tag, props, extraProps) {
3699
+ return resolveAriaFn(tag, props, extraProps);
3690
3700
  }
3691
3701
  };
3692
3702
  const runtimeObject = pluginResult ? { ...methods, options: resolved, hasStyling: true, classPlugin: pluginResult } : { ...methods, options: resolved };
@@ -4009,7 +4019,7 @@ function buildElementProps(props, className, ref, children) {
4009
4019
  }
4010
4020
  function renderIntrinsic(state, ref, runtime) {
4011
4021
  const elementProps = buildElementProps(state.props, state.className, ref, state.children);
4012
- const domProps = typeof state.tag === "string" ? runtime.resolveAria(state.tag, elementProps).props : elementProps;
4022
+ const domProps = typeof state.tag === "string" ? runtime.resolveAria(state.tag, elementProps, state.normalizedProps).props : elementProps;
4013
4023
  return h2(state.tag, domProps);
4014
4024
  }
4015
4025
  function render({
@@ -15,7 +15,7 @@ import {
15
15
  makeCloneSlotChild,
16
16
  mergeRefs,
17
17
  render
18
- } from "../chunk-QYP7KLRE.js";
18
+ } from "../chunk-CCWOPNX2.js";
19
19
 
20
20
  // ../../adapters/react/src/current/create-contract-component.ts
21
21
  import { useCallback, useRef } from "react";
@@ -12,7 +12,7 @@ import {
12
12
  makeCloneSlotChild,
13
13
  mergeRefs,
14
14
  render
15
- } from "../chunk-QYP7KLRE.js";
15
+ } from "../chunk-CCWOPNX2.js";
16
16
 
17
17
  // ../../adapters/react/src/legacy/create-contract-component.ts
18
18
  import { forwardRef as forwardRef2, useCallback, useRef } from "react";
@@ -1580,7 +1580,7 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1580
1580
  const next = _AriaPolicyEngine.#applyFixes(narrowedTag, implicitRole, workingProps, fixes);
1581
1581
  return { props: next, violations: [...preExistingViolations, ...violations] };
1582
1582
  }
1583
- static #evaluateWithRules(tag, props, extraRules) {
1583
+ static #evaluateWithRules(tag, props, extraRules, extraProps) {
1584
1584
  const derived = _AriaPolicyEngine.#deriveContext(tag, props);
1585
1585
  if (!derived.proceed) return derived.result;
1586
1586
  const {
@@ -1590,8 +1590,12 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1590
1590
  props: workingProps,
1591
1591
  preExistingViolations
1592
1592
  } = derived;
1593
- const rules = derived.hasRole ? [..._AriaPolicyEngine.#getRules(context), ...extraRules] : extraRules;
1594
- const { violations, fixes } = _AriaPolicyEngine.#runRules(rules, context);
1593
+ const builtinRules = derived.hasRole ? _AriaPolicyEngine.#getRules(context) : [];
1594
+ const builtin = _AriaPolicyEngine.#runRules(builtinRules, context);
1595
+ const extraContext = extraProps === void 0 ? context : { ...context, props: extraProps };
1596
+ const extra = _AriaPolicyEngine.#runRules(extraRules, extraContext);
1597
+ const violations = [...builtin.violations, ...extra.violations];
1598
+ const fixes = [...builtin.fixes, ...extra.fixes];
1595
1599
  const next = _AriaPolicyEngine.#applyFixes(narrowedTag, implicitRole, workingProps, fixes);
1596
1600
  return { props: next, violations: [...preExistingViolations, ...violations] };
1597
1601
  }
@@ -1662,11 +1666,17 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1662
1666
  Object.assign(next, updates);
1663
1667
  return next;
1664
1668
  }
1665
- validate(tag, props) {
1669
+ // `extraProps`, when supplied, is the pre-variant-filter props object (the same one
1670
+ // `normalize()` receives) — used only as the evaluation context for this engine's own
1671
+ // #extraRules (a consumer's `enforcement.aria`/`enforcement.rules`), never for the built-in
1672
+ // role-semantic pipeline or for the props a fix can apply to. Defaults to `props` so callers
1673
+ // that don't have a separate pre-filter object (or don't need one) see unchanged behavior.
1674
+ validate(tag, props, extraProps) {
1675
+ const ruleProps = extraProps ?? props;
1666
1676
  const baseKey = _AriaPolicyEngine.#createPlanKey(tag, props);
1667
1677
  let key = baseKey;
1668
1678
  if (this.#extraRules.length > 0) {
1669
- const suffix = _AriaPolicyEngine.#extraRulesKeySuffix(this.#extraRules, props);
1679
+ const suffix = _AriaPolicyEngine.#extraRulesKeySuffix(this.#extraRules, ruleProps);
1670
1680
  key = isNonNull(baseKey) && isNonNull(suffix) ? `${baseKey}|${suffix}` : null;
1671
1681
  }
1672
1682
  if (!isNull(key)) {
@@ -1679,7 +1689,7 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1679
1689
  };
1680
1690
  }
1681
1691
  }
1682
- const result = this.#extraRules.length ? _AriaPolicyEngine.#evaluateWithRules(tag, props, this.#extraRules) : _AriaPolicyEngine.evaluate(tag, props);
1692
+ const result = this.#extraRules.length ? _AriaPolicyEngine.#evaluateWithRules(tag, props, this.#extraRules, extraProps) : _AriaPolicyEngine.evaluate(tag, props);
1683
1693
  if (result.violations.length > 0) this.report(result.violations);
1684
1694
  if (!isNull(key)) {
1685
1695
  const { removals, updates } = _AriaPolicyEngine.#computePlan(
@@ -3570,10 +3580,10 @@ function resolveAriaRules(resolved) {
3570
3580
  var createAriaPipeline = (resolved) => {
3571
3581
  const rules = resolveAriaRules(resolved);
3572
3582
  const engine = new AriaPolicyEngine(resolved.diagnostics, rules.length ? { rules } : void 0);
3573
- return (tag, props) => engine.validate(tag, props);
3583
+ return (tag, props, extraProps) => engine.validate(tag, props, extraProps);
3574
3584
  };
3575
3585
  var memoizedAriaPipeline = definePipeline(createAriaPipeline);
3576
- function resolveAriaPassthrough(_tag, props) {
3586
+ function resolveAriaPassthrough(_tag, props, _extraProps) {
3577
3587
  return { props };
3578
3588
  }
3579
3589
 
@@ -3658,8 +3668,8 @@ function createPolymorphic(options = {}) {
3658
3668
  }
3659
3669
  return classPipeline(tag, props, className, recipe) || void 0;
3660
3670
  },
3661
- resolveAria(tag, props) {
3662
- return resolveAriaFn(tag, props);
3671
+ resolveAria(tag, props, extraProps) {
3672
+ return resolveAriaFn(tag, props, extraProps);
3663
3673
  }
3664
3674
  };
3665
3675
  const runtimeObject = pluginResult ? { ...methods, options: resolved, hasStyling: true, classPlugin: pluginResult } : { ...methods, options: resolved };
@@ -3829,8 +3839,8 @@ function buildSlotProps(props, classStr, ref) {
3829
3839
  function resolveTag2(runtime, as) {
3830
3840
  return runtime.resolveTag(as);
3831
3841
  }
3832
- function resolveDomProps(tag, elementProps, runtime) {
3833
- return isString(tag) ? runtime.resolveAria(tag, elementProps).props : elementProps;
3842
+ function resolveDomProps(tag, elementProps, runtime, normalizedProps) {
3843
+ return isString(tag) ? runtime.resolveAria(tag, elementProps, normalizedProps).props : elementProps;
3834
3844
  }
3835
3845
  function tryRenderAsChild(known, filteredProps, resolvedClass, slotValidator) {
3836
3846
  if (!known.asChild) return null;
@@ -3885,7 +3895,7 @@ function render({
3885
3895
  if (slotResult !== null) return slotResult;
3886
3896
  const domProps = createMemo(() => {
3887
3897
  const ep = buildElementProps(filteredProps(), resolvedClass(), known.ref, known.children);
3888
- return resolveDomProps(tag(), ep, runtime);
3898
+ return resolveDomProps(tag(), ep, runtime, normalizedProps());
3889
3899
  });
3890
3900
  return _$createComponent(Dynamic, _$mergeProps({
3891
3901
  get component() {
@@ -65,6 +65,7 @@
65
65
  props: UnknownProps,
66
66
  classStr: string | undefined,
67
67
  tag: ElementType,
68
+ normalizedProps: UnknownProps,
68
69
  ): ResolvedAttributes {
69
70
  const { role, style, ...r } = normalizeEventKeys(props)
70
71
  const styleStr = isObject(style, true)
@@ -77,7 +78,8 @@
77
78
  }
78
79
  if (isKnownAriaRole(role)) ep.role = role
79
80
  if (!isString(tag)) return ep as ResolvedAttributes
80
- return bundle.runtime.resolveAria(tag, ep).props as ResolvedAttributes
81
+ return bundle.runtime.resolveAria(tag, ep, normalizedProps as IntrinsicProps)
82
+ .props as ResolvedAttributes
81
83
  }
82
84
 
83
85
  // Unlike buildDomProps above, this intentionally skips normalizeEventKeys and style
@@ -129,7 +131,7 @@
129
131
  const filteredProps = $derived(
130
132
  applyFilter(normalizedProps, bundle.filterProps, bundle.runtime.options.variantKeys),
131
133
  )
132
- const domProps = $derived(buildDomProps(filteredProps, resolvedClass, tag))
134
+ const domProps = $derived(buildDomProps(filteredProps, resolvedClass, tag, normalizedProps))
133
135
 
134
136
  // Resolves whether to render as child slot; also enforces as+asChild mutual exclusion.
135
137
  const useAsChild = $derived.by(() => {
@@ -564,7 +564,7 @@ type ResolvedFactoryOptions<TDefault extends ElementType = ElementType, Props ex
564
564
  readonly precomputedClasses?: Readonly<StringMap<string>>;
565
565
  };
566
566
 
567
- type ResolveAriaFn = <P extends IntrinsicProps>(tag: ElementType, props: P) => {
567
+ type ResolveAriaFn = <P extends IntrinsicProps>(tag: ElementType, props: P, extraProps?: IntrinsicProps) => {
568
568
  props: P;
569
569
  };
570
570
 
@@ -707,7 +707,7 @@ type ClassResolver = Readonly<{
707
707
  resolveClasses(tag: ElementType, props: ResolvedProps, className?: ClassName, recipe?: string): string | undefined;
708
708
  }>;
709
709
  type AriaResolver = Readonly<{
710
- resolveAria<P extends IntrinsicProps>(tag: ElementType, props: P): {
710
+ resolveAria<P extends IntrinsicProps>(tag: ElementType, props: P, extraProps?: IntrinsicProps): {
711
711
  props: P;
712
712
  };
713
713
  }>;
@@ -1446,7 +1446,7 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1446
1446
  const next = _AriaPolicyEngine.#applyFixes(narrowedTag, implicitRole, workingProps, fixes);
1447
1447
  return { props: next, violations: [...preExistingViolations, ...violations] };
1448
1448
  }
1449
- static #evaluateWithRules(tag, props, extraRules) {
1449
+ static #evaluateWithRules(tag, props, extraRules, extraProps) {
1450
1450
  const derived = _AriaPolicyEngine.#deriveContext(tag, props);
1451
1451
  if (!derived.proceed) return derived.result;
1452
1452
  const {
@@ -1456,8 +1456,12 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1456
1456
  props: workingProps,
1457
1457
  preExistingViolations
1458
1458
  } = derived;
1459
- const rules = derived.hasRole ? [..._AriaPolicyEngine.#getRules(context), ...extraRules] : extraRules;
1460
- const { violations, fixes } = _AriaPolicyEngine.#runRules(rules, context);
1459
+ const builtinRules = derived.hasRole ? _AriaPolicyEngine.#getRules(context) : [];
1460
+ const builtin = _AriaPolicyEngine.#runRules(builtinRules, context);
1461
+ const extraContext = extraProps === void 0 ? context : { ...context, props: extraProps };
1462
+ const extra = _AriaPolicyEngine.#runRules(extraRules, extraContext);
1463
+ const violations = [...builtin.violations, ...extra.violations];
1464
+ const fixes = [...builtin.fixes, ...extra.fixes];
1461
1465
  const next = _AriaPolicyEngine.#applyFixes(narrowedTag, implicitRole, workingProps, fixes);
1462
1466
  return { props: next, violations: [...preExistingViolations, ...violations] };
1463
1467
  }
@@ -1528,11 +1532,17 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1528
1532
  Object.assign(next, updates);
1529
1533
  return next;
1530
1534
  }
1531
- validate(tag, props) {
1535
+ // `extraProps`, when supplied, is the pre-variant-filter props object (the same one
1536
+ // `normalize()` receives) — used only as the evaluation context for this engine's own
1537
+ // #extraRules (a consumer's `enforcement.aria`/`enforcement.rules`), never for the built-in
1538
+ // role-semantic pipeline or for the props a fix can apply to. Defaults to `props` so callers
1539
+ // that don't have a separate pre-filter object (or don't need one) see unchanged behavior.
1540
+ validate(tag, props, extraProps) {
1541
+ const ruleProps = extraProps ?? props;
1532
1542
  const baseKey = _AriaPolicyEngine.#createPlanKey(tag, props);
1533
1543
  let key = baseKey;
1534
1544
  if (this.#extraRules.length > 0) {
1535
- const suffix = _AriaPolicyEngine.#extraRulesKeySuffix(this.#extraRules, props);
1545
+ const suffix = _AriaPolicyEngine.#extraRulesKeySuffix(this.#extraRules, ruleProps);
1536
1546
  key = isNonNull(baseKey) && isNonNull(suffix) ? `${baseKey}|${suffix}` : null;
1537
1547
  }
1538
1548
  if (!isNull(key)) {
@@ -1545,7 +1555,7 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1545
1555
  };
1546
1556
  }
1547
1557
  }
1548
- const result = this.#extraRules.length ? _AriaPolicyEngine.#evaluateWithRules(tag, props, this.#extraRules) : _AriaPolicyEngine.evaluate(tag, props);
1558
+ const result = this.#extraRules.length ? _AriaPolicyEngine.#evaluateWithRules(tag, props, this.#extraRules, extraProps) : _AriaPolicyEngine.evaluate(tag, props);
1549
1559
  if (result.violations.length > 0) this.report(result.violations);
1550
1560
  if (!isNull(key)) {
1551
1561
  const { removals, updates } = _AriaPolicyEngine.#computePlan(
@@ -3436,10 +3446,10 @@ function resolveAriaRules(resolved) {
3436
3446
  var createAriaPipeline = (resolved) => {
3437
3447
  const rules = resolveAriaRules(resolved);
3438
3448
  const engine = new AriaPolicyEngine(resolved.diagnostics, rules.length ? { rules } : void 0);
3439
- return (tag, props) => engine.validate(tag, props);
3449
+ return (tag, props, extraProps) => engine.validate(tag, props, extraProps);
3440
3450
  };
3441
3451
  var memoizedAriaPipeline = definePipeline(createAriaPipeline);
3442
- function resolveAriaPassthrough(_tag, props) {
3452
+ function resolveAriaPassthrough(_tag, props, _extraProps) {
3443
3453
  return { props };
3444
3454
  }
3445
3455
 
@@ -3524,8 +3534,8 @@ function createPolymorphic(options = {}) {
3524
3534
  }
3525
3535
  return classPipeline(tag, props, className, recipe) || void 0;
3526
3536
  },
3527
- resolveAria(tag, props) {
3528
- return resolveAriaFn(tag, props);
3537
+ resolveAria(tag, props, extraProps) {
3538
+ return resolveAriaFn(tag, props, extraProps);
3529
3539
  }
3530
3540
  };
3531
3541
  const runtimeObject = pluginResult ? { ...methods, options: resolved, hasStyling: true, classPlugin: pluginResult } : { ...methods, options: resolved };
package/dist/vue/index.js CHANGED
@@ -1583,7 +1583,7 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1583
1583
  const next = _AriaPolicyEngine.#applyFixes(narrowedTag, implicitRole, workingProps, fixes);
1584
1584
  return { props: next, violations: [...preExistingViolations, ...violations] };
1585
1585
  }
1586
- static #evaluateWithRules(tag, props, extraRules) {
1586
+ static #evaluateWithRules(tag, props, extraRules, extraProps) {
1587
1587
  const derived = _AriaPolicyEngine.#deriveContext(tag, props);
1588
1588
  if (!derived.proceed) return derived.result;
1589
1589
  const {
@@ -1593,8 +1593,12 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1593
1593
  props: workingProps,
1594
1594
  preExistingViolations
1595
1595
  } = derived;
1596
- const rules = derived.hasRole ? [..._AriaPolicyEngine.#getRules(context), ...extraRules] : extraRules;
1597
- const { violations, fixes } = _AriaPolicyEngine.#runRules(rules, context);
1596
+ const builtinRules = derived.hasRole ? _AriaPolicyEngine.#getRules(context) : [];
1597
+ const builtin = _AriaPolicyEngine.#runRules(builtinRules, context);
1598
+ const extraContext = extraProps === void 0 ? context : { ...context, props: extraProps };
1599
+ const extra = _AriaPolicyEngine.#runRules(extraRules, extraContext);
1600
+ const violations = [...builtin.violations, ...extra.violations];
1601
+ const fixes = [...builtin.fixes, ...extra.fixes];
1598
1602
  const next = _AriaPolicyEngine.#applyFixes(narrowedTag, implicitRole, workingProps, fixes);
1599
1603
  return { props: next, violations: [...preExistingViolations, ...violations] };
1600
1604
  }
@@ -1665,11 +1669,17 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1665
1669
  Object.assign(next, updates);
1666
1670
  return next;
1667
1671
  }
1668
- validate(tag, props) {
1672
+ // `extraProps`, when supplied, is the pre-variant-filter props object (the same one
1673
+ // `normalize()` receives) — used only as the evaluation context for this engine's own
1674
+ // #extraRules (a consumer's `enforcement.aria`/`enforcement.rules`), never for the built-in
1675
+ // role-semantic pipeline or for the props a fix can apply to. Defaults to `props` so callers
1676
+ // that don't have a separate pre-filter object (or don't need one) see unchanged behavior.
1677
+ validate(tag, props, extraProps) {
1678
+ const ruleProps = extraProps ?? props;
1669
1679
  const baseKey = _AriaPolicyEngine.#createPlanKey(tag, props);
1670
1680
  let key = baseKey;
1671
1681
  if (this.#extraRules.length > 0) {
1672
- const suffix = _AriaPolicyEngine.#extraRulesKeySuffix(this.#extraRules, props);
1682
+ const suffix = _AriaPolicyEngine.#extraRulesKeySuffix(this.#extraRules, ruleProps);
1673
1683
  key = isNonNull(baseKey) && isNonNull(suffix) ? `${baseKey}|${suffix}` : null;
1674
1684
  }
1675
1685
  if (!isNull(key)) {
@@ -1682,7 +1692,7 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1682
1692
  };
1683
1693
  }
1684
1694
  }
1685
- const result = this.#extraRules.length ? _AriaPolicyEngine.#evaluateWithRules(tag, props, this.#extraRules) : _AriaPolicyEngine.evaluate(tag, props);
1695
+ const result = this.#extraRules.length ? _AriaPolicyEngine.#evaluateWithRules(tag, props, this.#extraRules, extraProps) : _AriaPolicyEngine.evaluate(tag, props);
1686
1696
  if (result.violations.length > 0) this.report(result.violations);
1687
1697
  if (!isNull(key)) {
1688
1698
  const { removals, updates } = _AriaPolicyEngine.#computePlan(
@@ -3573,10 +3583,10 @@ function resolveAriaRules(resolved) {
3573
3583
  var createAriaPipeline = (resolved) => {
3574
3584
  const rules = resolveAriaRules(resolved);
3575
3585
  const engine = new AriaPolicyEngine(resolved.diagnostics, rules.length ? { rules } : void 0);
3576
- return (tag, props) => engine.validate(tag, props);
3586
+ return (tag, props, extraProps) => engine.validate(tag, props, extraProps);
3577
3587
  };
3578
3588
  var memoizedAriaPipeline = definePipeline(createAriaPipeline);
3579
- function resolveAriaPassthrough(_tag, props) {
3589
+ function resolveAriaPassthrough(_tag, props, _extraProps) {
3580
3590
  return { props };
3581
3591
  }
3582
3592
 
@@ -3661,8 +3671,8 @@ function createPolymorphic(options = {}) {
3661
3671
  }
3662
3672
  return classPipeline(tag, props, className, recipe) || void 0;
3663
3673
  },
3664
- resolveAria(tag, props) {
3665
- return resolveAriaFn(tag, props);
3674
+ resolveAria(tag, props, extraProps) {
3675
+ return resolveAriaFn(tag, props, extraProps);
3666
3676
  }
3667
3677
  };
3668
3678
  const runtimeObject = pluginResult ? { ...methods, options: resolved, hasStyling: true, classPlugin: pluginResult } : { ...methods, options: resolved };
@@ -3898,7 +3908,11 @@ function buildElementProps(props, className, elementRef) {
3898
3908
  }
3899
3909
  function renderIntrinsic(state, runtime, slots, elementRef) {
3900
3910
  const elementProps = buildElementProps(state.props, state.className, elementRef);
3901
- const domProps = runtime.resolveAria(state.tag, elementProps).props;
3911
+ const domProps = runtime.resolveAria(
3912
+ state.tag,
3913
+ elementProps,
3914
+ state.normalizedProps
3915
+ ).props;
3902
3916
  return h3(state.tag, domProps, slots.default ? { default: slots.default } : void 0);
3903
3917
  }
3904
3918
  function validateSlotDirectives(directives, validator) {
package/dist/web/index.js CHANGED
@@ -1430,7 +1430,7 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1430
1430
  const next = _AriaPolicyEngine.#applyFixes(narrowedTag, implicitRole, workingProps, fixes);
1431
1431
  return { props: next, violations: [...preExistingViolations, ...violations] };
1432
1432
  }
1433
- static #evaluateWithRules(tag, props, extraRules) {
1433
+ static #evaluateWithRules(tag, props, extraRules, extraProps) {
1434
1434
  const derived = _AriaPolicyEngine.#deriveContext(tag, props);
1435
1435
  if (!derived.proceed) return derived.result;
1436
1436
  const {
@@ -1440,8 +1440,12 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1440
1440
  props: workingProps,
1441
1441
  preExistingViolations
1442
1442
  } = derived;
1443
- const rules = derived.hasRole ? [..._AriaPolicyEngine.#getRules(context), ...extraRules] : extraRules;
1444
- const { violations, fixes } = _AriaPolicyEngine.#runRules(rules, context);
1443
+ const builtinRules = derived.hasRole ? _AriaPolicyEngine.#getRules(context) : [];
1444
+ const builtin = _AriaPolicyEngine.#runRules(builtinRules, context);
1445
+ const extraContext = extraProps === void 0 ? context : { ...context, props: extraProps };
1446
+ const extra = _AriaPolicyEngine.#runRules(extraRules, extraContext);
1447
+ const violations = [...builtin.violations, ...extra.violations];
1448
+ const fixes = [...builtin.fixes, ...extra.fixes];
1445
1449
  const next = _AriaPolicyEngine.#applyFixes(narrowedTag, implicitRole, workingProps, fixes);
1446
1450
  return { props: next, violations: [...preExistingViolations, ...violations] };
1447
1451
  }
@@ -1512,11 +1516,17 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1512
1516
  Object.assign(next, updates);
1513
1517
  return next;
1514
1518
  }
1515
- validate(tag, props) {
1519
+ // `extraProps`, when supplied, is the pre-variant-filter props object (the same one
1520
+ // `normalize()` receives) — used only as the evaluation context for this engine's own
1521
+ // #extraRules (a consumer's `enforcement.aria`/`enforcement.rules`), never for the built-in
1522
+ // role-semantic pipeline or for the props a fix can apply to. Defaults to `props` so callers
1523
+ // that don't have a separate pre-filter object (or don't need one) see unchanged behavior.
1524
+ validate(tag, props, extraProps) {
1525
+ const ruleProps = extraProps ?? props;
1516
1526
  const baseKey = _AriaPolicyEngine.#createPlanKey(tag, props);
1517
1527
  let key = baseKey;
1518
1528
  if (this.#extraRules.length > 0) {
1519
- const suffix = _AriaPolicyEngine.#extraRulesKeySuffix(this.#extraRules, props);
1529
+ const suffix = _AriaPolicyEngine.#extraRulesKeySuffix(this.#extraRules, ruleProps);
1520
1530
  key = isNonNull(baseKey) && isNonNull(suffix) ? `${baseKey}|${suffix}` : null;
1521
1531
  }
1522
1532
  if (!isNull(key)) {
@@ -1529,7 +1539,7 @@ var AriaPolicyEngine = class _AriaPolicyEngine extends InvariantBase {
1529
1539
  };
1530
1540
  }
1531
1541
  }
1532
- const result = this.#extraRules.length ? _AriaPolicyEngine.#evaluateWithRules(tag, props, this.#extraRules) : _AriaPolicyEngine.evaluate(tag, props);
1542
+ const result = this.#extraRules.length ? _AriaPolicyEngine.#evaluateWithRules(tag, props, this.#extraRules, extraProps) : _AriaPolicyEngine.evaluate(tag, props);
1533
1543
  if (result.violations.length > 0) this.report(result.violations);
1534
1544
  if (!isNull(key)) {
1535
1545
  const { removals, updates } = _AriaPolicyEngine.#computePlan(
@@ -3420,10 +3430,10 @@ function resolveAriaRules(resolved) {
3420
3430
  var createAriaPipeline = (resolved) => {
3421
3431
  const rules = resolveAriaRules(resolved);
3422
3432
  const engine = new AriaPolicyEngine(resolved.diagnostics, rules.length ? { rules } : void 0);
3423
- return (tag, props) => engine.validate(tag, props);
3433
+ return (tag, props, extraProps) => engine.validate(tag, props, extraProps);
3424
3434
  };
3425
3435
  var memoizedAriaPipeline = definePipeline(createAriaPipeline);
3426
- function resolveAriaPassthrough(_tag, props) {
3436
+ function resolveAriaPassthrough(_tag, props, _extraProps) {
3427
3437
  return { props };
3428
3438
  }
3429
3439
 
@@ -3508,8 +3518,8 @@ function createPolymorphic(options = {}) {
3508
3518
  }
3509
3519
  return classPipeline(tag, props, className, recipe) || void 0;
3510
3520
  },
3511
- resolveAria(tag, props) {
3512
- return resolveAriaFn(tag, props);
3521
+ resolveAria(tag, props, extraProps) {
3522
+ return resolveAriaFn(tag, props, extraProps);
3513
3523
  }
3514
3524
  };
3515
3525
  const runtimeObject = pluginResult ? { ...methods, options: resolved, hasStyling: true, classPlugin: pluginResult } : { ...methods, options: resolved };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "praxis-kit",
3
- "version": "7.8.0",
3
+ "version": "7.8.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./react": {
@@ -203,10 +203,10 @@
203
203
  "typescript": "^6.0.3",
204
204
  "vite": "^8.2.1",
205
205
  "vue": "^3.5.41",
206
- "@praxis-kit/adapter-utils": "0.0.0",
207
- "@praxis-kit/diagnostics": "0.0.0",
208
206
  "@praxis-kit/core": "0.0.0",
207
+ "@praxis-kit/adapter-utils": "0.0.0",
209
208
  "@praxis-kit/pipeline": "0.0.0",
209
+ "@praxis-kit/diagnostics": "0.0.0",
210
210
  "@praxis-kit/primitive": "0.0.0",
211
211
  "@praxis-kit/vite-plugin": "0.0.0"
212
212
  },