praxis-kit 4.0.0 → 4.0.3

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/dist/vue/index.js CHANGED
@@ -553,159 +553,21 @@ var InvariantBase = class {
553
553
  }
554
554
  };
555
555
 
556
- // ../../lib/diagnostics/src/category.ts
557
- var DiagnosticCategory = /* @__PURE__ */ ((DiagnosticCategory2) => {
558
- DiagnosticCategory2[DiagnosticCategory2["Contract"] = 0] = "Contract";
559
- DiagnosticCategory2[DiagnosticCategory2["HTML"] = 1] = "HTML";
560
- DiagnosticCategory2[DiagnosticCategory2["ARIA"] = 2] = "ARIA";
561
- DiagnosticCategory2[DiagnosticCategory2["Composition"] = 3] = "Composition";
562
- DiagnosticCategory2[DiagnosticCategory2["Rendering"] = 4] = "Rendering";
563
- DiagnosticCategory2[DiagnosticCategory2["Accessibility"] = 5] = "Accessibility";
564
- DiagnosticCategory2[DiagnosticCategory2["Performance"] = 6] = "Performance";
565
- DiagnosticCategory2[DiagnosticCategory2["Internal"] = 7] = "Internal";
566
- DiagnosticCategory2[DiagnosticCategory2["Deprecation"] = 8] = "Deprecation";
567
- DiagnosticCategory2[DiagnosticCategory2["Lint"] = 9] = "Lint";
568
- return DiagnosticCategory2;
569
- })(DiagnosticCategory || {});
570
-
571
- // ../../lib/diagnostics/src/error.ts
572
- var PraxisError = class extends Error {
573
- diagnostic;
574
- constructor(diagnostic) {
575
- super(diagnostic.message);
576
- this.name = "PraxisError";
577
- this.diagnostic = diagnostic;
578
- }
579
- };
580
-
581
- // ../../lib/diagnostics/src/severity.ts
582
- var Severity = /* @__PURE__ */ ((Severity2) => {
583
- Severity2[Severity2["Debug"] = 0] = "Debug";
584
- Severity2[Severity2["Info"] = 1] = "Info";
585
- Severity2[Severity2["Warning"] = 2] = "Warning";
586
- Severity2[Severity2["Error"] = 3] = "Error";
587
- Severity2[Severity2["Fatal"] = 4] = "Fatal";
588
- return Severity2;
589
- })(Severity || {});
590
-
591
- // ../../lib/diagnostics/src/policy.ts
592
- var DefaultPolicy = class {
593
- reportThreshold;
594
- throwThreshold;
595
- constructor({
596
- reportThreshold = 1 /* Info */,
597
- throwThreshold = 4 /* Fatal */
598
- } = {}) {
599
- this.reportThreshold = reportThreshold;
600
- this.throwThreshold = throwThreshold;
601
- }
602
- resolve(diagnostic) {
603
- if (diagnostic.severity >= this.throwThreshold) return 2 /* Throw */;
604
- if (diagnostic.severity >= this.reportThreshold) return 1 /* Report */;
605
- return 0 /* Ignore */;
606
- }
607
- };
608
-
609
- // ../../lib/diagnostics/src/diagnostics.ts
610
- var Diagnostics = class {
611
- reporter;
612
- policy;
613
- // Pre-computed at construction time: true if Warning-level diagnostics are not ignored.
614
- active;
615
- constructor(reporter, policy = new DefaultPolicy()) {
616
- this.reporter = reporter;
617
- this.policy = policy;
618
- this.active = policy.resolve({ severity: 2 /* Warning */ }) !== 0 /* Ignore */;
619
- }
620
- report(diagnostic) {
621
- const enforcement = this.policy.resolve(diagnostic);
622
- if (enforcement === 0 /* Ignore */) return diagnostic;
623
- if (enforcement === 2 /* Throw */) throw new PraxisError(diagnostic);
624
- this.reporter.report(diagnostic);
625
- return diagnostic;
626
- }
627
- warn(input) {
628
- return this.report({ ...input, severity: 2 /* Warning */ });
629
- }
630
- error(input) {
631
- return this.report({ ...input, severity: 3 /* Error */ });
632
- }
633
- info(input) {
634
- return this.report({ ...input, severity: 1 /* Info */ });
635
- }
636
- };
637
-
638
- // ../../lib/diagnostics/src/formatter.ts
639
- function formatDiagnostic(diagnostic) {
640
- const level = Severity[diagnostic.severity];
641
- const category = DiagnosticCategory[diagnostic.category];
642
- const prefix = category !== void 0 ? `[${category}] ` : "";
643
- return `${level} ${diagnostic.code}: ${prefix}${diagnostic.message}`;
644
- }
645
-
646
- // ../../lib/diagnostics/src/console-reporter.ts
647
- var ConsoleReporter = class {
648
- report(diagnostic) {
649
- const message = formatDiagnostic(diagnostic);
650
- switch (diagnostic.severity) {
651
- case 0 /* Debug */:
652
- console.debug(message);
653
- break;
654
- case 1 /* Info */:
655
- console.info(message);
656
- break;
657
- case 2 /* Warning */:
658
- console.warn(message);
659
- break;
660
- case 3 /* Error */:
661
- case 4 /* Fatal */:
662
- console.error(message);
663
- break;
664
- }
665
- }
666
- };
667
-
668
- // ../../lib/diagnostics/src/null-reporter.ts
669
- var nullReporter = {
670
- report() {
671
- }
672
- };
673
-
674
- // ../../lib/diagnostics/src/presets.ts
675
- var ignoreAllPolicy = {
676
- resolve(_) {
677
- return 0 /* Ignore */;
678
- }
679
- };
680
- var warnOnlyReporter = {
681
- report(diagnostic) {
682
- console.warn(formatDiagnostic(diagnostic));
683
- }
684
- };
685
- var silentDiagnostics = new Diagnostics(nullReporter, ignoreAllPolicy);
686
- var warnDiagnostics = new Diagnostics(
687
- warnOnlyReporter,
688
- new DefaultPolicy({ reportThreshold: 2 /* Warning */, throwThreshold: 4 /* Fatal */ })
689
- );
690
- var throwDiagnostics = new Diagnostics(
691
- new ConsoleReporter(),
692
- new DefaultPolicy({ reportThreshold: 2 /* Warning */, throwThreshold: 3 /* Error */ })
693
- );
694
-
695
556
  // ../../lib/contract/src/diagnostics/aria.ts
557
+ import { DiagnosticCategory, DiagnosticCode } from "../_shared/diagnostics.js";
696
558
  var AriaDiagnostics = {
697
559
  /** Generic bridge for violations produced by external AriaRule functions. */
698
560
  fromViolation(v) {
699
561
  return {
700
- code: "ARIA2002" /* AriaViolation */,
701
- category: 2 /* ARIA */,
562
+ code: DiagnosticCode.AriaViolation,
563
+ category: DiagnosticCategory.ARIA,
702
564
  message: v.message
703
565
  };
704
566
  },
705
567
  attributeInvalid(key, role) {
706
568
  return {
707
- code: "ARIA2003" /* AriaAttributeInvalid */,
708
- category: 2 /* ARIA */,
569
+ code: DiagnosticCode.AriaAttributeInvalid,
570
+ category: DiagnosticCategory.ARIA,
709
571
  message: `"${key}" is not valid on role="${role}". It will be removed.`,
710
572
  rationale: "Invalid ARIA attributes are ignored by assistive technology and may trigger accessibility-tree warnings in browser devtools.",
711
573
  suggestions: [
@@ -718,8 +580,8 @@ var AriaDiagnostics = {
718
580
  },
719
581
  missingLiveRegion(role, impliedLive) {
720
582
  return {
721
- code: "ARIA2004" /* AriaMissingLiveRegion */,
722
- category: 2 /* ARIA */,
583
+ code: DiagnosticCode.AriaMissingLiveRegion,
584
+ category: DiagnosticCategory.ARIA,
723
585
  message: `role="${role}" implies aria-live="${impliedLive}" but it is missing. It has been injected.`,
724
586
  rationale: "Live-region roles announce dynamic content changes to screen readers. Without aria-live the politeness level is unspecified and announcements may be silent.",
725
587
  suggestions: [
@@ -733,8 +595,8 @@ var AriaDiagnostics = {
733
595
  },
734
596
  missingAtomic(role) {
735
597
  return {
736
- code: "ARIA2005" /* AriaMissingAtomic */,
737
- category: 2 /* ARIA */,
598
+ code: DiagnosticCode.AriaMissingAtomic,
599
+ category: DiagnosticCategory.ARIA,
738
600
  message: `role="${role}" is a live region. Consider setting aria-atomic="true" if the full region should be announced as a unit, or aria-atomic="false" if only changed nodes should be read.`,
739
601
  rationale: "aria-atomic controls whether assistive technology announces the entire live region or only the changed nodes. Omitting it leaves the behaviour browser-defined."
740
602
  };
@@ -742,8 +604,8 @@ var AriaDiagnostics = {
742
604
  relevantInvalidTokens(invalid) {
743
605
  const quoted = invalid.map((t) => `"${t}"`).join(", ");
744
606
  return {
745
- code: "ARIA2006" /* AriaRelevantInvalidToken */,
746
- category: 2 /* ARIA */,
607
+ code: DiagnosticCode.AriaRelevantInvalidToken,
608
+ category: DiagnosticCategory.ARIA,
747
609
  message: `aria-relevant contains invalid token(s): ${quoted}. Valid tokens are: additions, removals, text, all.`,
748
610
  rationale: "aria-relevant accepts a space-separated list of change types. Unrecognised tokens are silently ignored by assistive technology, making the attribute ineffective.",
749
611
  suggestions: [
@@ -756,8 +618,8 @@ var AriaDiagnostics = {
756
618
  },
757
619
  relevantSuperseded() {
758
620
  return {
759
- code: "ARIA2007" /* AriaRelevantSuperseded */,
760
- category: 2 /* ARIA */,
621
+ code: DiagnosticCode.AriaRelevantSuperseded,
622
+ category: DiagnosticCategory.ARIA,
761
623
  message: 'aria-relevant includes "all" alongside other tokens. "all" supersedes additions, removals, and text \u2014 use aria-relevant="all" alone.',
762
624
  rationale: '"all" is equivalent to "additions removals text". Combining it with other tokens is redundant and may confuse readers of the markup.',
763
625
  suggestions: [
@@ -770,8 +632,8 @@ var AriaDiagnostics = {
770
632
  },
771
633
  missingAccessibleName(tag) {
772
634
  return {
773
- code: "ARIA2009" /* AriaMissingAccessibleName */,
774
- category: 2 /* ARIA */,
635
+ code: DiagnosticCode.AriaMissingAccessibleName,
636
+ category: DiagnosticCategory.ARIA,
775
637
  message: `<${tag}> has no accessible name. Add aria-label or aria-labelledby.`,
776
638
  rationale: "Elements with a landmark or interactive role must have an accessible name so that assistive technology can identify them when presenting the page outline.",
777
639
  suggestions: [
@@ -788,8 +650,8 @@ var AriaDiagnostics = {
788
650
  },
789
651
  attributeOnPresentational(attr, tag) {
790
652
  return {
791
- code: "ARIA2010" /* AriaAttributeOnPresentational */,
792
- category: 2 /* ARIA */,
653
+ code: DiagnosticCode.AriaAttributeOnPresentational,
654
+ category: DiagnosticCategory.ARIA,
793
655
  message: `"${attr}" is not allowed on a presentational <${tag}>. Presentational elements are invisible to assistive technology.`,
794
656
  rationale: 'role="none" and role="presentation" (including <img alt="">) remove an element from the accessibility tree. ARIA attributes on such elements are ignored by assistive technology.',
795
657
  suggestions: [
@@ -802,8 +664,8 @@ var AriaDiagnostics = {
802
664
  },
803
665
  ariaHiddenOnFocusable(tag) {
804
666
  return {
805
- code: "ARIA2011" /* AriaHiddenOnFocusable */,
806
- category: 2 /* ARIA */,
667
+ code: DiagnosticCode.AriaHiddenOnFocusable,
668
+ category: DiagnosticCategory.ARIA,
807
669
  message: `aria-hidden="true" must not be used on focusable <${tag}> elements. Screen reader users who navigate by keyboard will encounter the element but receive no information about it.`,
808
670
  rationale: 'aria-hidden removes an element from the accessibility tree while leaving it keyboard-reachable. This creates a "ghost" \u2014 a focusable element assistive technology cannot describe.',
809
671
  suggestions: [
@@ -821,8 +683,8 @@ var AriaDiagnostics = {
821
683
  invalidAttributeValue(attr, value, expected) {
822
684
  const got = value === null ? "null" : value === void 0 ? "undefined" : typeof value === "string" ? `"${value}"` : String(value);
823
685
  return {
824
- code: "ARIA2013" /* AriaInvalidAttributeValue */,
825
- category: 2 /* ARIA */,
686
+ code: DiagnosticCode.AriaInvalidAttributeValue,
687
+ category: DiagnosticCategory.ARIA,
826
688
  message: `"${attr}" has an invalid value (${got}). Expected: ${expected}.`,
827
689
  rationale: "ARIA attributes with invalid values are silently ignored by assistive technology, making the markup semantically inert.",
828
690
  suggestions: [
@@ -835,8 +697,8 @@ var AriaDiagnostics = {
835
697
  },
836
698
  redundantAriaLevel(tag, level) {
837
699
  return {
838
- code: "ARIA2014" /* AriaRedundantLevelAttribute */,
839
- category: 2 /* ARIA */,
700
+ code: DiagnosticCode.AriaRedundantLevelAttribute,
701
+ category: DiagnosticCategory.ARIA,
840
702
  message: `aria-level="${level}" is redundant on <${tag}>: the element already has an implicit heading level of ${level}. Remove the attribute.`,
841
703
  rationale: 'Restating the implicit aria-level adds noise without semantic value. Use aria-level only to override the native heading level (e.g. aria-level="3" on <h2>).',
842
704
  suggestions: [
@@ -849,8 +711,8 @@ var AriaDiagnostics = {
849
711
  },
850
712
  requiredProperty(attr, role) {
851
713
  return {
852
- code: "ARIA2012" /* AriaRequiredProperty */,
853
- category: 2 /* ARIA */,
714
+ code: DiagnosticCode.AriaRequiredProperty,
715
+ category: DiagnosticCategory.ARIA,
854
716
  message: `"${attr}" is required for role="${role}" but is missing.`,
855
717
  rationale: `WAI-ARIA 1.2 specifies required states and properties for certain roles. Without "${attr}", assistive technology cannot correctly communicate the element's state to users.`,
856
718
  suggestions: [
@@ -863,8 +725,8 @@ var AriaDiagnostics = {
863
725
  },
864
726
  invalidRole(role, tag) {
865
727
  return {
866
- code: "ARIA2008" /* AriaInvalidRole */,
867
- category: 2 /* ARIA */,
728
+ code: DiagnosticCode.AriaInvalidRole,
729
+ category: DiagnosticCategory.ARIA,
868
730
  message: `Invalid role "${role ?? ""}" on <${tag}>.`,
869
731
  rationale: "An unrecognised or misapplied ARIA role is ignored by assistive technology and may degrade the accessibility of the element."
870
732
  };
@@ -872,11 +734,12 @@ var AriaDiagnostics = {
872
734
  };
873
735
 
874
736
  // ../../lib/contract/src/diagnostics/contract.ts
737
+ import { DiagnosticCategory as DiagnosticCategory2, DiagnosticCode as DiagnosticCode2 } from "../_shared/diagnostics.js";
875
738
  var ContractDiagnostics = {
876
739
  unexpectedChild(typeName, index, context) {
877
740
  return {
878
- code: "COMP1004" /* UnexpectedChild */,
879
- category: 0 /* Contract */,
741
+ code: DiagnosticCode2.UnexpectedChild,
742
+ category: DiagnosticCategory2.Contract,
880
743
  component: context,
881
744
  message: `${context}: unexpected child "${typeName}" at index ${index}.`
882
745
  };
@@ -884,69 +747,69 @@ var ContractDiagnostics = {
884
747
  ambiguousChild(typeName, index, ruleNames, context) {
885
748
  const quoted = ruleNames.map((n) => `"${n}"`).join(" and ");
886
749
  return {
887
- code: "COMP1005" /* AmbiguousChild */,
888
- category: 0 /* Contract */,
750
+ code: DiagnosticCode2.AmbiguousChild,
751
+ category: DiagnosticCategory2.Contract,
889
752
  component: context,
890
753
  message: `${context}: child "${typeName}" at index ${index} matches multiple child rules: ${quoted}.`
891
754
  };
892
755
  },
893
756
  cardinalityMin(ruleName, min, context) {
894
757
  return {
895
- code: "COMP1006" /* CardinalityMin */,
896
- category: 0 /* Contract */,
758
+ code: DiagnosticCode2.CardinalityMin,
759
+ category: DiagnosticCategory2.Contract,
897
760
  component: context,
898
761
  message: `${context}: "${ruleName}" requires at least ${min}.`
899
762
  };
900
763
  },
901
764
  cardinalityMax(ruleName, max, context) {
902
765
  return {
903
- code: "COMP1007" /* CardinalityMax */,
904
- category: 0 /* Contract */,
766
+ code: DiagnosticCode2.CardinalityMax,
767
+ category: DiagnosticCategory2.Contract,
905
768
  component: context,
906
769
  message: `${context}: "${ruleName}" allows at most ${max}.`
907
770
  };
908
771
  },
909
772
  positionViolation(ruleName, position, index, context) {
910
773
  return {
911
- code: "COMP1008" /* PositionViolation */,
912
- category: 0 /* Contract */,
774
+ code: DiagnosticCode2.PositionViolation,
775
+ category: DiagnosticCategory2.Contract,
913
776
  component: context,
914
777
  message: `${context}: "${ruleName}" must be ${position}, got index ${index}`
915
778
  };
916
779
  },
917
780
  unknownVariantDim(component, label, dim) {
918
781
  return {
919
- code: "COMP1010" /* ContractUnknownVariantDim */,
920
- category: 0 /* Contract */,
782
+ code: DiagnosticCode2.ContractUnknownVariantDim,
783
+ category: DiagnosticCategory2.Contract,
921
784
  message: `${component}: ${label} references unknown variant "${dim}".`
922
785
  };
923
786
  },
924
787
  unknownVariantValue(component, label, dim, value, valid) {
925
788
  return {
926
- code: "COMP1011" /* ContractUnknownVariantValue */,
927
- category: 0 /* Contract */,
789
+ code: DiagnosticCode2.ContractUnknownVariantValue,
790
+ category: DiagnosticCategory2.Contract,
928
791
  message: `${component}: ${label} sets "${dim}" to unknown value "${value}" (valid: ${valid.join(", ")}).`
929
792
  };
930
793
  },
931
794
  unknownRecipeKey(component, key) {
932
795
  return {
933
- code: "COMP1012" /* ContractUnknownRecipeKey */,
934
- category: 0 /* Contract */,
796
+ code: DiagnosticCode2.ContractUnknownRecipeKey,
797
+ category: DiagnosticCategory2.Contract,
935
798
  message: `${component} Unknown recipeKey "${key}" \u2014 no preset with that name exists.`
936
799
  };
937
800
  },
938
801
  invalidVariantValue(component, key, value) {
939
802
  return {
940
- code: "COMP1013" /* ContractInvalidVariantValue */,
941
- category: 0 /* Contract */,
803
+ code: DiagnosticCode2.ContractInvalidVariantValue,
804
+ category: DiagnosticCategory2.Contract,
942
805
  message: `${component} Variant "${key}=${value}" is not a defined value for the "${key}" dimension.`
943
806
  };
944
807
  },
945
808
  allowedAsViolation(tag, allowedAs, component) {
946
809
  const allowed = allowedAs.map((t) => `"${String(t)}"`).join(", ");
947
810
  return {
948
- code: "COMP1009" /* AllowedAsViolation */,
949
- category: 0 /* Contract */,
811
+ code: DiagnosticCode2.AllowedAsViolation,
812
+ category: DiagnosticCategory2.Contract,
950
813
  component,
951
814
  message: `<${component}>: "as" prop received "${tag}" but only [${allowed}] are allowed.`
952
815
  };
@@ -954,73 +817,75 @@ var ContractDiagnostics = {
954
817
  };
955
818
 
956
819
  // ../../lib/contract/src/diagnostics/html.ts
820
+ import { DiagnosticCategory as DiagnosticCategory3, DiagnosticCode as DiagnosticCode3 } from "../_shared/diagnostics.js";
957
821
  var HtmlDiagnostics = {
958
822
  emptyRole(tag) {
959
823
  return {
960
- code: "HTML3002" /* HtmlEmptyRole */,
961
- category: 1 /* HTML */,
824
+ code: DiagnosticCode3.HtmlEmptyRole,
825
+ category: DiagnosticCategory3.HTML,
962
826
  message: `<${tag}> has an explicit empty role="". Omit the attribute instead.`
963
827
  };
964
828
  },
965
829
  implicitRoleRedundant(tag, implicitRole) {
966
830
  return {
967
- code: "HTML3003" /* HtmlImplicitRoleRedundant */,
968
- category: 1 /* HTML */,
831
+ code: DiagnosticCode3.HtmlImplicitRoleRedundant,
832
+ category: DiagnosticCategory3.HTML,
969
833
  message: `<${tag}> already has implicit role="${implicitRole}". Avoid redundant role assignment.`
970
834
  };
971
835
  },
972
836
  implicitRoleOverride(tag, implicitRole, role) {
973
837
  return {
974
- code: "HTML3004" /* HtmlImplicitRoleOverride */,
975
- category: 1 /* HTML */,
838
+ code: DiagnosticCode3.HtmlImplicitRoleOverride,
839
+ category: DiagnosticCategory3.HTML,
976
840
  message: `<${tag}> should not override its implicit role="${implicitRole}" with role="${role}".`
977
841
  };
978
842
  },
979
843
  standaloneRegionOverride(tag, implicitRole) {
980
844
  return {
981
- code: "HTML3005" /* HtmlStandaloneRegionOverride */,
982
- category: 1 /* HTML */,
845
+ code: DiagnosticCode3.HtmlStandaloneRegionOverride,
846
+ category: DiagnosticCategory3.HTML,
983
847
  message: `<${tag}> is a self-contained element with implicit role="${implicitRole}". Assigning role="region" has been removed.`
984
848
  };
985
849
  },
986
850
  landmarkRoleOverride(tag, implicitRole, role) {
987
851
  return {
988
- code: "HTML3006" /* HtmlLandmarkRoleOverride */,
989
- category: 1 /* HTML */,
852
+ code: DiagnosticCode3.HtmlLandmarkRoleOverride,
853
+ category: DiagnosticCategory3.HTML,
990
854
  message: `<${tag}> has a fixed landmark role="${implicitRole}". role="${role}" overrides it and confuses assistive technology. The override has been removed.`
991
855
  };
992
856
  },
993
857
  invalidChild(child, parent, allowed) {
994
858
  return {
995
- code: "HTML3007" /* HtmlInvalidChild */,
996
- category: 1 /* HTML */,
859
+ code: DiagnosticCode3.HtmlInvalidChild,
860
+ category: DiagnosticCategory3.HTML,
997
861
  message: `<${child}> is not a valid direct child of <${parent}>. Allowed: ${allowed}.`
998
862
  };
999
863
  }
1000
864
  };
1001
865
 
1002
866
  // ../../lib/contract/src/diagnostics/slot.ts
867
+ import { DiagnosticCategory as DiagnosticCategory4, DiagnosticCode as DiagnosticCode4 } from "../_shared/diagnostics.js";
1003
868
  var SlotDiagnostics = {
1004
869
  exclusive(name) {
1005
870
  return {
1006
- code: "SLOT1001" /* SlotExclusive */,
1007
- category: 0 /* Contract */,
871
+ code: DiagnosticCode4.SlotExclusive,
872
+ category: DiagnosticCategory4.Contract,
1008
873
  component: name,
1009
874
  message: `${name}: "as" and "asChild" are mutually exclusive`
1010
875
  };
1011
876
  },
1012
877
  singleChildRequired(name, elementTerm) {
1013
878
  return {
1014
- code: "SLOT1002" /* SlotSingleChild */,
1015
- category: 0 /* Contract */,
879
+ code: DiagnosticCode4.SlotSingleChild,
880
+ category: DiagnosticCategory4.Contract,
1016
881
  component: name,
1017
882
  message: `${name}: asChild requires a ${elementTerm} child`
1018
883
  };
1019
884
  },
1020
885
  singleChildExceeded(name, elementTerm, count) {
1021
886
  return {
1022
- code: "SLOT1002" /* SlotSingleChild */,
1023
- category: 0 /* Contract */,
887
+ code: DiagnosticCode4.SlotSingleChild,
888
+ category: DiagnosticCategory4.Contract,
1024
889
  component: name,
1025
890
  message: `${name}: asChild requires exactly one ${elementTerm} child, got ${count}`
1026
891
  };
@@ -1028,16 +893,16 @@ var SlotDiagnostics = {
1028
893
  discardedChildren(name, elementTerm, count) {
1029
894
  const suffix = count === 1 ? "" : "ren";
1030
895
  return {
1031
- code: "SLOT1003" /* SlotDiscardedChildren */,
1032
- category: 0 /* Contract */,
896
+ code: DiagnosticCode4.SlotDiscardedChildren,
897
+ category: DiagnosticCategory4.Contract,
1033
898
  component: name,
1034
899
  message: `${name}: asChild discarded ${count} non-element child${suffix} \u2014 only ${elementTerm}s are valid asChild children.`
1035
900
  };
1036
901
  },
1037
902
  renderFnRequired(name, received) {
1038
903
  return {
1039
- code: "SLOT1004" /* SlotRenderFn */,
1040
- category: 0 /* Contract */,
904
+ code: DiagnosticCode4.SlotRenderFn,
905
+ category: DiagnosticCategory4.Contract,
1041
906
  component: name,
1042
907
  message: `${name}: asChild requires a render function as children, got ${received}`
1043
908
  };
@@ -1972,6 +1837,9 @@ var readonlyProps = ({
1972
1837
  };
1973
1838
  };
1974
1839
 
1840
+ // ../core/src/html/evaluators.ts
1841
+ import { warnDiagnostics as warnDiagnostics2 } from "../_shared/diagnostics.js";
1842
+
1975
1843
  // ../core/src/html/aria-rules.ts
1976
1844
  var LANDMARK_TAG_SET = /* @__PURE__ */ new Set(["article", "aside", "footer", "header", "main", "nav"]);
1977
1845
  var removeLandmarkRoleOverride = {
@@ -2014,6 +1882,7 @@ function landmarkNameAdvisory(ctx) {
2014
1882
  }
2015
1883
 
2016
1884
  // ../core/src/html/contracts.ts
1885
+ import { warnDiagnostics } from "../_shared/diagnostics.js";
2017
1886
  function isOpenContent(...blockedTags) {
2018
1887
  const set2 = new Set(blockedTags);
2019
1888
  return (child) => isObject(child) && "type" in child && (!isString(child.type) || !set2.has(child.type));
@@ -2158,7 +2027,7 @@ var htmlContracts = {
2158
2027
  };
2159
2028
 
2160
2029
  // ../core/src/html/evaluators.ts
2161
- var htmlDiagnostics = warnDiagnostics;
2030
+ var htmlDiagnostics = warnDiagnostics2;
2162
2031
  function buildEvaluatorMap() {
2163
2032
  const map2 = /* @__PURE__ */ new Map();
2164
2033
  iterate.forEachEntry(htmlContracts, (tag, { children }) => {
@@ -2217,6 +2086,7 @@ function createVariantPass(activeProps, config) {
2217
2086
  }
2218
2087
 
2219
2088
  // ../core/src/resolver/resolver.ts
2089
+ import { silentDiagnostics } from "../_shared/diagnostics.js";
2220
2090
  function enforceAllowedAs(tag, allowedAs, diagnostics, displayName) {
2221
2091
  if (allowedAs.includes(tag)) return;
2222
2092
  if (!diagnostics) return;
@@ -2242,6 +2112,7 @@ function buildEngines(diagnostics, childRules, context) {
2242
2112
  }
2243
2113
 
2244
2114
  // ../../lib/adapter-utils/src/resolve-adapter-common-options.ts
2115
+ import { throwDiagnostics, silentDiagnostics as silentDiagnostics2 } from "../_shared/diagnostics.js";
2245
2116
  function resolveAdapterCommonOptions(options, defaultName = "PolymorphicComponent", defaultDiagnostics = throwDiagnostics) {
2246
2117
  return {
2247
2118
  name: options.name ?? defaultName,