@kbach/react 0.5.38 → 0.5.41

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.
@@ -598,7 +598,11 @@ var LRUCache = class {
598
598
  return this;
599
599
  }
600
600
  has(key) {
601
- return this.cache.has(key);
601
+ if (!this.cache.has(key)) return false;
602
+ const value = this.cache.get(key);
603
+ this.cache.delete(key);
604
+ this.cache.set(key, value);
605
+ return true;
602
606
  }
603
607
  delete(key) {
604
608
  return this.cache.delete(key);
@@ -613,9 +617,10 @@ var LRUCache = class {
613
617
 
614
618
  // src/core/platform.ts
615
619
  var isWeb = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
620
+ var isNative = !isWeb && (typeof globalThis.HermesInternal !== "undefined" || typeof globalThis.__fbBatchedBridge !== "undefined" || typeof navigator !== "undefined" && navigator.product === "ReactNative");
616
621
  var _cssGenMode = false;
617
622
  function getEffectiveIsWeb() {
618
- return isWeb || _cssGenMode;
623
+ return isWeb || _cssGenMode || !isNative;
619
624
  }
620
625
  function toNativeValue(raw) {
621
626
  if (/^-?\d+(\.\d+)?px$/.test(raw)) return parseFloat(raw);
@@ -628,773 +633,116 @@ function escapeCSSSelector(cls) {
628
633
  return cls.replace(/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g, "\\$&");
629
634
  }
630
635
 
631
- // src/core/parser.ts
632
- var PLUGIN_MODIFIERS = /* @__PURE__ */ new Set();
633
- function registerModifier(name) {
634
- PLUGIN_MODIFIERS.add(name);
636
+ // src/core/registry.ts
637
+ var BUILTIN_MODIFIERS = {
638
+ // ── Mode ─────────────────────────────────────────────────────────────────
639
+ dark: { darkScheme: "dark", jsBehavior: "mode", jsMatch: (d) => d },
640
+ "not-light": { darkScheme: "dark", jsBehavior: "mode", jsMatch: (d) => d },
641
+ light: { darkScheme: "light", jsBehavior: "mode", jsMatch: (d) => !d },
642
+ "not-dark": { darkScheme: "light", jsBehavior: "mode", jsMatch: (d) => !d },
643
+ // ── Interactive — JS state + CSS pseudo ───────────────────────────────────
644
+ hover: { pseudo: ":hover", jsBehavior: "interactive", jsMatch: (_, s) => !!s.hover },
645
+ "not-hover": { pseudo: ":not(:hover)", jsBehavior: "interactive", jsMatch: (_, s) => !s.hover },
646
+ focus: { pseudo: ":focus", jsBehavior: "interactive", jsMatch: (_, s) => !!s.focus },
647
+ "not-focus": { pseudo: ":not(:focus)", jsBehavior: "interactive", jsMatch: (_, s) => !s.focus },
648
+ active: { pseudo: ":active", jsBehavior: "interactive", jsMatch: (_, s) => !!s.active || !!s.pressed },
649
+ "not-active": { pseudo: ":not(:active)", jsBehavior: "interactive", jsMatch: (_, s) => !s.active && !s.pressed },
650
+ pressed: { pseudo: ":active", jsBehavior: "interactive", jsMatch: (_, s) => !!s.pressed || !!s.active },
651
+ "not-pressed": { pseudo: ":not(:active)", jsBehavior: "interactive", jsMatch: (_, s) => !s.pressed && !s.active },
652
+ disabled: { pseudo: ":disabled", jsBehavior: "interactive", jsMatch: (_, s) => !!s.disabled },
653
+ "not-disabled": { pseudo: ":not(:disabled)", jsBehavior: "interactive", jsMatch: (_, s) => !s.disabled },
654
+ checked: { pseudo: ":checked", jsBehavior: "interactive", jsMatch: (_, s) => !!s.checked },
655
+ "not-checked": { pseudo: ":not(:checked)", jsBehavior: "interactive", jsMatch: (_, s) => !s.checked },
656
+ visited: { pseudo: ":visited", jsBehavior: "interactive", jsMatch: (_, s) => !!s.visited },
657
+ "not-visited": { pseudo: ":not(:visited)", jsBehavior: "interactive", jsMatch: (_, s) => !s.visited },
658
+ placeholder: { pseudo: "::placeholder", jsBehavior: "interactive", jsMatch: (_, s) => !!s.placeholder },
659
+ // ── CSS-only pseudo-classes (structural) ──────────────────────────────────
660
+ first: { pseudo: ":first-child", jsBehavior: "css-only", forcesImportant: true },
661
+ last: { pseudo: ":last-child", jsBehavior: "css-only", forcesImportant: true },
662
+ odd: { pseudo: ":nth-child(odd)", jsBehavior: "css-only", forcesImportant: true },
663
+ even: { pseudo: ":nth-child(even)", jsBehavior: "css-only", forcesImportant: true },
664
+ only: { pseudo: ":only-child", jsBehavior: "css-only", forcesImportant: true },
665
+ "focus-within": { pseudo: ":focus-within", jsBehavior: "css-only", forcesImportant: true },
666
+ "focus-visible": { pseudo: ":focus-visible", jsBehavior: "css-only", forcesImportant: true },
667
+ // ── CSS-only pseudo-elements ───────────────────────────────────────────────
668
+ before: { pseudo: "::before", jsBehavior: "css-only" },
669
+ after: { pseudo: "::after", jsBehavior: "css-only" },
670
+ selection: { pseudo: "::selection", jsBehavior: "css-only" },
671
+ "first-letter": { pseudo: "::first-letter", jsBehavior: "css-only" },
672
+ "first-line": { pseudo: "::first-line", jsBehavior: "css-only" },
673
+ marker: { pseudo: "::marker", jsBehavior: "css-only" },
674
+ // ── Group / peer ancestor selectors (CSS-only) ─────────────────────────────
675
+ "group-hover": { ancestorSelector: ".group:hover ", jsBehavior: "css-only", forcesImportant: true },
676
+ "group-focus": { ancestorSelector: ".group:focus ", jsBehavior: "css-only", forcesImportant: true },
677
+ "peer-hover": { ancestorSelector: ".peer:hover ~ ", jsBehavior: "css-only", forcesImportant: true },
678
+ "peer-focus": { ancestorSelector: ".peer:focus ~ ", jsBehavior: "css-only", forcesImportant: true },
679
+ // ── Responsive — both CSS (@media min-width) and JS (breakpoints set) ──────
680
+ sm: { isResponsive: true, jsBehavior: "responsive", jsMatch: (_, __, bp) => bp.has("sm") },
681
+ md: { isResponsive: true, jsBehavior: "responsive", jsMatch: (_, __, bp) => bp.has("md") },
682
+ lg: { isResponsive: true, jsBehavior: "responsive", jsMatch: (_, __, bp) => bp.has("lg") },
683
+ xl: { isResponsive: true, jsBehavior: "responsive", jsMatch: (_, __, bp) => bp.has("xl") },
684
+ "2xl": { isResponsive: true, jsBehavior: "responsive", jsMatch: (_, __, bp) => bp.has("2xl") },
685
+ // ── Print media (CSS-only) ─────────────────────────────────────────────────
686
+ print: { mediaQuery: "print", jsBehavior: "css-only", forcesImportant: true },
687
+ // ── Orientation / accessibility media (CSS-only) ───────────────────────────
688
+ landscape: { mediaQuery: "(orientation: landscape)", jsBehavior: "css-only", forcesImportant: true },
689
+ portrait: { mediaQuery: "(orientation: portrait)", jsBehavior: "css-only", forcesImportant: true },
690
+ "motion-reduce": { mediaQuery: "(prefers-reduced-motion: reduce)", jsBehavior: "css-only", forcesImportant: true },
691
+ "motion-safe": { mediaQuery: "(prefers-reduced-motion: no-preference)", jsBehavior: "css-only", forcesImportant: true },
692
+ "contrast-more": { mediaQuery: "(prefers-contrast: more)", jsBehavior: "css-only", forcesImportant: true },
693
+ "contrast-less": { mediaQuery: "(prefers-contrast: less)", jsBehavior: "css-only", forcesImportant: true },
694
+ // ── Directionality (CSS-only) ──────────────────────────────────────────────
695
+ rtl: { dirSelector: '[dir="rtl"] ', jsBehavior: "css-only", forcesImportant: true },
696
+ ltr: { dirSelector: '[dir="ltr"] ', jsBehavior: "css-only", forcesImportant: true }
697
+ };
698
+ var _pluginModifiers = {};
699
+ var _allNames = null;
700
+ var _interactiveNames = null;
701
+ var _modeNames = null;
702
+ var _responsiveNames = null;
703
+ function _invalidate() {
704
+ _allNames = null;
705
+ _interactiveNames = null;
706
+ _modeNames = null;
707
+ _responsiveNames = null;
708
+ }
709
+ function registerModifier(name, def) {
710
+ _pluginModifiers[name] = def;
711
+ _invalidate();
635
712
  }
636
713
  function clearPluginModifiers() {
637
- PLUGIN_MODIFIERS.clear();
638
- }
639
- var MODIFIERS = /* @__PURE__ */ new Set([
640
- // Theme
641
- "dark",
642
- "light",
643
- "not-dark",
644
- "not-light",
645
- // Interaction
646
- "hover",
647
- "focus",
648
- "active",
649
- "visited",
650
- "disabled",
651
- "checked",
652
- "pressed",
653
- "placeholder",
654
- "focus-within",
655
- "focus-visible",
656
- // Negated interaction
657
- "not-hover",
658
- "not-focus",
659
- "not-active",
660
- "not-visited",
661
- "not-disabled",
662
- "not-checked",
663
- "not-pressed",
664
- // Structural
665
- "first",
666
- "last",
667
- "odd",
668
- "even",
669
- "only",
670
- // Group / peer
671
- "group-hover",
672
- "group-focus",
673
- "peer-hover",
674
- "peer-focus",
675
- // Responsive (handled separately but accepted)
676
- "sm",
677
- "md",
678
- "lg",
679
- "xl",
680
- "2xl",
681
- // Pseudo-elements (CSS-injection only; matchesMods returns false for these)
682
- "before",
683
- "after",
684
- "selection",
685
- "first-letter",
686
- "first-line",
687
- "marker",
688
- // Print media modifier
689
- "print",
690
- // Orientation media modifiers (CSS-injection only)
691
- "landscape",
692
- "portrait",
693
- // Accessibility media modifiers (CSS-injection only)
694
- "motion-reduce",
695
- "motion-safe",
696
- "contrast-more",
697
- "contrast-less",
698
- // Directionality modifiers (CSS-injection only)
699
- "rtl",
700
- "ltr"
701
- ]);
702
- var UTILITY_PREFIXES = [
703
- // Multi-word flex
704
- "flex-row-reverse",
705
- "flex-col-reverse",
706
- "flex-row",
707
- "flex-col",
708
- "flex-wrap-reverse",
709
- "flex-wrap",
710
- "flex-nowrap",
711
- "flex-shrink-0",
712
- "flex-shrink",
713
- "flex-grow-0",
714
- "flex-grow",
715
- "items-start",
716
- "items-end",
717
- "items-center",
718
- "items-baseline",
719
- "items-stretch",
720
- "justify-start",
721
- "justify-end",
722
- "justify-center",
723
- "justify-between",
724
- "justify-around",
725
- "justify-evenly",
726
- "content-start",
727
- "content-end",
728
- "content-center",
729
- "content-between",
730
- "content-around",
731
- "content-evenly",
732
- "self-start",
733
- "self-end",
734
- "self-center",
735
- "self-auto",
736
- "self-stretch",
737
- "text-left",
738
- "text-right",
739
- "text-center",
740
- "text-justify",
741
- "font-thin",
742
- "font-extralight",
743
- "font-light",
744
- "font-normal",
745
- "font-medium",
746
- "font-semibold",
747
- "font-bold",
748
- "font-extrabold",
749
- "font-black",
750
- "overflow-hidden",
751
- "overflow-visible",
752
- "overflow-scroll",
753
- "overflow-auto",
754
- "overflow-x-hidden",
755
- "overflow-x-scroll",
756
- "overflow-x-auto",
757
- "overflow-y-hidden",
758
- "overflow-y-scroll",
759
- "overflow-y-auto",
760
- "object-contain",
761
- "object-cover",
762
- "object-fill",
763
- "object-none",
764
- "object-scale-down",
765
- "border-solid",
766
- "border-dashed",
767
- "border-dotted",
768
- "border-none",
769
- "border-t",
770
- "border-r",
771
- "border-b",
772
- "border-l",
773
- "rounded-tl",
774
- "rounded-tr",
775
- "rounded-bl",
776
- "rounded-br",
777
- "rounded-t",
778
- "rounded-r",
779
- "rounded-b",
780
- "rounded-l",
781
- "list-none",
782
- "list-disc",
783
- "list-decimal",
784
- "cursor-auto",
785
- "cursor-default",
786
- "cursor-pointer",
787
- "cursor-wait",
788
- "cursor-text",
789
- "cursor-move",
790
- "cursor-not-allowed",
791
- "select-none",
792
- "select-text",
793
- "select-all",
794
- "select-auto",
795
- "pointer-events-none",
796
- "pointer-events-auto",
797
- "whitespace-normal",
798
- "whitespace-nowrap",
799
- "whitespace-pre-wrap",
800
- "whitespace-pre-line",
801
- "whitespace-pre",
802
- "break-normal",
803
- "break-words",
804
- "break-all",
805
- "break-keep",
806
- "bg-clip-border",
807
- "bg-clip-padding",
808
- "bg-clip-content",
809
- "bg-clip-text",
810
- "bg-gradient-to",
811
- "resize-none",
812
- "resize-y",
813
- "resize-x",
814
- "box-border",
815
- "box-content",
816
- "gap-x",
817
- "gap-y",
818
- "inset-x",
819
- "inset-y",
820
- "divide-x",
821
- "divide-y",
822
- "space-x",
823
- "space-y",
824
- "translate-x",
825
- "translate-y",
826
- "scale-x",
827
- "scale-y",
828
- "skew-x",
829
- "skew-y",
830
- // Transform origin (single prefix, value carries direction)
831
- "origin",
832
- "min-w",
833
- "min-h",
834
- "max-w",
835
- "max-h",
836
- "ring-offset",
837
- "bg-opacity",
838
- "text-opacity",
839
- "border-opacity",
840
- // Grid placement
841
- "col-span",
842
- "col-start",
843
- "col-end",
844
- "row-span",
845
- "row-start",
846
- "row-end",
847
- "grid-cols",
848
- "grid-rows",
849
- "grid-flow",
850
- "auto-cols",
851
- "auto-rows",
852
- // Grid alignment
853
- "place-items",
854
- "place-content",
855
- "place-self",
856
- "justify-items",
857
- "justify-self",
858
- // Backdrop filters (longer than 'backdrop' alone)
859
- "backdrop-blur",
860
- "backdrop-brightness",
861
- "backdrop-contrast",
862
- "backdrop-grayscale",
863
- "backdrop-hue-rotate",
864
- "backdrop-invert",
865
- "backdrop-opacity",
866
- "backdrop-saturate",
867
- "backdrop-sepia",
868
- "backdrop-filter",
869
- // Filters
870
- "drop-shadow",
871
- "hue-rotate",
872
- "text-shadow",
873
- "underline-offset",
874
- "outline-offset",
875
- "will-change",
876
- "mix-blend",
877
- "bg-blend",
878
- "decoration",
879
- "perspective",
880
- "tint",
881
- "animate",
882
- // Single-word prefixes last
883
- "appearance-none",
884
- "outline-none",
885
- "outline",
886
- "inline-flex",
887
- "inline-block",
888
- "inline-grid",
889
- "italic",
890
- "non-italic",
891
- "underline",
892
- "overline",
893
- "line-through",
894
- "no-underline",
895
- "uppercase",
896
- "lowercase",
897
- "capitalize",
898
- "normal-case",
899
- "antialiased",
900
- "subpixel-antialiased",
901
- "overflow-ellipsis",
902
- "truncate",
903
- "sr-only",
904
- "not-sr-only",
905
- "relative",
906
- "absolute",
907
- "fixed",
908
- "sticky",
909
- "static",
910
- "visible",
911
- "invisible",
912
- "hidden",
913
- "contents",
914
- "flow-root",
915
- "block",
916
- "inline",
917
- "flex",
918
- "grid",
919
- "resize",
920
- "appearance",
921
- "border",
922
- "rounded",
923
- "shadow",
924
- "size",
925
- "opacity",
926
- "leading",
927
- "tracking",
928
- "line-clamp",
929
- "basis",
930
- "grow",
931
- "shrink",
932
- "order",
933
- "delay",
934
- "duration",
935
- "scale",
936
- "rotate",
937
- "aspect",
938
- "columns",
939
- "ring",
940
- "gap",
941
- "inset",
942
- "filter",
943
- "transform",
944
- "blur",
945
- "brightness",
946
- "contrast",
947
- "grayscale",
948
- "invert",
949
- "saturate",
950
- "sepia",
951
- "bg",
952
- "text",
953
- "font",
954
- "caret",
955
- "accent",
956
- "from",
957
- "via",
958
- "to",
959
- "divide",
960
- "space",
961
- "transition",
962
- "px",
963
- "py",
964
- "pt",
965
- "pr",
966
- "pb",
967
- "pl",
968
- "p",
969
- "mx",
970
- "my",
971
- "mt",
972
- "mr",
973
- "mb",
974
- "ml",
975
- "m",
976
- "w",
977
- "h",
978
- "top",
979
- "right",
980
- "bottom",
981
- "left",
982
- "z",
983
- "col",
984
- "row"
985
- ];
986
- var SORTED_PREFIXES = [...new Set(UTILITY_PREFIXES)].sort((a, b) => b.length - a.length);
987
- var STANDALONE_UTILITIES = /* @__PURE__ */ new Set([
988
- // Display
989
- "flex",
990
- "block",
991
- "inline-block",
992
- "inline",
993
- "grid",
994
- "inline-flex",
995
- "inline-grid",
996
- "grd",
997
- "hidden",
998
- "contents",
999
- "flow-root",
1000
- // Position
1001
- "relative",
1002
- "absolute",
1003
- "fixed",
1004
- "sticky",
1005
- "static",
1006
- // Visibility
1007
- "visible",
1008
- "invisible",
1009
- // Typography
1010
- "uppercase",
1011
- "lowercase",
1012
- "capitalize",
1013
- "normal-case",
1014
- "italic",
1015
- "non-italic",
1016
- "underline",
1017
- "overline",
1018
- "line-through",
1019
- "no-underline",
1020
- "truncate",
1021
- "antialiased",
1022
- "sr-only",
1023
- "not-sr-only",
1024
- // Font variant numeric
1025
- "normal-nums",
1026
- "ordinal",
1027
- "slashed-zero",
1028
- "lining-nums",
1029
- "oldstyle-nums",
1030
- "proportional-nums",
1031
- "tabular-nums",
1032
- "diagonal-fractions",
1033
- "stacked-fractions",
1034
- // Flexbox
1035
- "flex-row",
1036
- "flex-col",
1037
- "flex-row-reverse",
1038
- "flex-col-reverse",
1039
- "flex-wrap",
1040
- "flex-wrap-reverse",
1041
- "flex-nowrap",
1042
- "flex-shrink",
1043
- "flex-shrink-0",
1044
- "flex-grow",
1045
- "flex-grow-0",
1046
- "items-start",
1047
- "items-end",
1048
- "items-center",
1049
- "items-baseline",
1050
- "items-stretch",
1051
- "justify-start",
1052
- "justify-end",
1053
- "justify-center",
1054
- "justify-between",
1055
- "justify-around",
1056
- "justify-evenly",
1057
- "content-start",
1058
- "content-end",
1059
- "content-center",
1060
- "content-between",
1061
- "content-around",
1062
- "content-evenly",
1063
- "content-stretch",
1064
- "self-start",
1065
- "self-end",
1066
- "self-center",
1067
- "self-auto",
1068
- "self-stretch",
1069
- "self-baseline",
1070
- // Text align
1071
- "text-left",
1072
- "text-right",
1073
- "text-center",
1074
- "text-justify",
1075
- // Font weight shortcuts
1076
- "font-thin",
1077
- "font-extralight",
1078
- "font-light",
1079
- "font-normal",
1080
- "font-medium",
1081
- "font-semibold",
1082
- "font-bold",
1083
- "font-extrabold",
1084
- "font-black",
1085
- // Overflow
1086
- "overflow-hidden",
1087
- "overflow-visible",
1088
- "overflow-scroll",
1089
- "overflow-auto",
1090
- "overflow-x-hidden",
1091
- "overflow-x-scroll",
1092
- "overflow-x-auto",
1093
- "overflow-y-hidden",
1094
- "overflow-y-scroll",
1095
- "overflow-y-auto",
1096
- // Object fit
1097
- "object-contain",
1098
- "object-cover",
1099
- "object-fill",
1100
- "object-none",
1101
- "object-scale-down",
1102
- // Object position
1103
- "object-center",
1104
- "object-top",
1105
- "object-bottom",
1106
- "object-left",
1107
- "object-right",
1108
- "object-left-top",
1109
- "object-left-bottom",
1110
- "object-right-top",
1111
- "object-right-bottom",
1112
- // Border
1113
- "border-solid",
1114
- "border-dashed",
1115
- "border-dotted",
1116
- "border-none",
1117
- "border-t",
1118
- "border-r",
1119
- "border-b",
1120
- "border-l",
1121
- "border-collapse",
1122
- "border-separate",
1123
- // Lists
1124
- "list-none",
1125
- "list-disc",
1126
- "list-decimal",
1127
- "list-inside",
1128
- "list-outside",
1129
- // Cursor / select
1130
- "cursor-auto",
1131
- "cursor-default",
1132
- "cursor-pointer",
1133
- "cursor-wait",
1134
- "cursor-text",
1135
- "cursor-move",
1136
- "cursor-not-allowed",
1137
- "select-none",
1138
- "select-text",
1139
- "select-all",
1140
- "select-auto",
1141
- "pointer-events-none",
1142
- "pointer-events-auto",
1143
- // Whitespace / word break
1144
- "whitespace-normal",
1145
- "whitespace-nowrap",
1146
- "whitespace-pre",
1147
- "whitespace-pre-wrap",
1148
- "whitespace-pre-line",
1149
- "break-normal",
1150
- "break-words",
1151
- "break-all",
1152
- // Background clip
1153
- "bg-clip-border",
1154
- "bg-clip-padding",
1155
- "bg-clip-content",
1156
- "bg-clip-text",
1157
- // Background size
1158
- "bg-auto",
1159
- "bg-cover",
1160
- "bg-contain",
1161
- // Background position
1162
- "bg-center",
1163
- "bg-top",
1164
- "bg-bottom",
1165
- "bg-left",
1166
- "bg-right",
1167
- "bg-left-top",
1168
- "bg-left-bottom",
1169
- "bg-right-top",
1170
- "bg-right-bottom",
1171
- // Background repeat
1172
- "bg-repeat",
1173
- "bg-no-repeat",
1174
- "bg-repeat-x",
1175
- "bg-repeat-y",
1176
- "bg-repeat-round",
1177
- "bg-repeat-space",
1178
- // Background attachment
1179
- "bg-fixed",
1180
- "bg-local",
1181
- "bg-scroll",
1182
- // Background image
1183
- "bg-none",
1184
- // Box sizing
1185
- "box-border",
1186
- "box-content",
1187
- // Resize
1188
- "resize",
1189
- "resize-none",
1190
- "resize-y",
1191
- "resize-x",
1192
- // Outline
1193
- "appearance-none",
1194
- "outline-none",
1195
- "outline",
1196
- // Table
1197
- "table",
1198
- "table-auto",
1199
- "table-fixed",
1200
- "caption-top",
1201
- "caption-bottom",
1202
- // CSS filters (standalone = default/full effect)
1203
- "grayscale",
1204
- "invert",
1205
- "sepia",
1206
- // Isolation
1207
- "isolate",
1208
- "isolation-auto",
1209
- // Backface visibility (both platforms)
1210
- "backface-visible",
1211
- "backface-hidden",
1212
- // Divide none
1213
- "divide-none",
1214
- // Group / peer markers (no-op style; needed so isKnownUtility recognises them)
1215
- "group",
1216
- "peer",
1217
- // Text-wrap (web-only)
1218
- "text-wrap",
1219
- "text-nowrap",
1220
- "text-balance",
1221
- "text-pretty",
1222
- // Screen sizing
1223
- "w-screen",
1224
- "min-h-screen",
1225
- "max-h-screen",
1226
- "min-w-screen",
1227
- "max-w-screen",
1228
- // max-w named container sizes (Tailwind compat)
1229
- "max-w-none",
1230
- "max-w-xs",
1231
- "max-w-sm",
1232
- "max-w-md",
1233
- "max-w-lg",
1234
- "max-w-xl",
1235
- "max-w-2xl",
1236
- "max-w-3xl",
1237
- "max-w-4xl",
1238
- "max-w-5xl",
1239
- "max-w-6xl",
1240
- "max-w-7xl",
1241
- "max-w-prose",
1242
- // Extended cursors (web-only)
1243
- "cursor-grab",
1244
- "cursor-grabbing",
1245
- "cursor-zoom-in",
1246
- "cursor-zoom-out",
1247
- "cursor-crosshair",
1248
- "cursor-help",
1249
- "cursor-none",
1250
- // Overflow clip (web-only)
1251
- "overflow-clip",
1252
- "overflow-x-clip",
1253
- "overflow-y-clip",
1254
- // Scroll behavior (web-only)
1255
- "scroll-smooth",
1256
- "scroll-auto",
1257
- // Float & clear (web-only)
1258
- "float-left",
1259
- "float-right",
1260
- "float-start",
1261
- "float-end",
1262
- "float-none",
1263
- "clear-left",
1264
- "clear-right",
1265
- "clear-both",
1266
- "clear-start",
1267
- "clear-end",
1268
- "clear-none",
1269
- // Vertical align (web-only)
1270
- "align-baseline",
1271
- "align-top",
1272
- "align-middle",
1273
- "align-bottom",
1274
- "align-text-top",
1275
- "align-text-bottom",
1276
- "align-sub",
1277
- "align-super",
1278
- // Touch action (web-only)
1279
- "touch-auto",
1280
- "touch-none",
1281
- "touch-pan-x",
1282
- "touch-pan-y",
1283
- "touch-pan-left",
1284
- "touch-pan-right",
1285
- "touch-pan-up",
1286
- "touch-pan-down",
1287
- "touch-pinch-zoom",
1288
- "touch-manipulation"
1289
- ]);
1290
- function parseClass(className) {
1291
- const trimmed = className.trim();
1292
- if (!trimmed) return null;
1293
- const modifiers = [];
1294
- let remaining = trimmed;
1295
- for (let i = 0; i < 3; i++) {
1296
- const colonIdx = findOuterColon(remaining);
1297
- if (colonIdx === -1) break;
1298
- const candidate = remaining.slice(0, colonIdx);
1299
- if (MODIFIERS.has(candidate) || PLUGIN_MODIFIERS.has(candidate)) {
1300
- modifiers.push(candidate);
1301
- remaining = remaining.slice(colonIdx + 1);
1302
- } else {
1303
- break;
1304
- }
1305
- }
1306
- let important = false;
1307
- if (remaining.startsWith("!") && remaining.length > 1) {
1308
- important = true;
1309
- remaining = remaining.slice(1);
1310
- }
1311
- let negative = false;
1312
- if (remaining.startsWith("-") && remaining.length > 1 && remaining[1] !== "-") {
1313
- negative = true;
1314
- remaining = remaining.slice(1);
1315
- }
1316
- const bracketStart = remaining.lastIndexOf("-[");
1317
- if (bracketStart > 0 && remaining.endsWith("]")) {
1318
- const utility = remaining.slice(0, bracketStart);
1319
- const value = remaining.slice(bracketStart + 2, -1).replace(/_/g, " ");
1320
- return { original: trimmed, modifiers, negative, important, utility, value, isArbitrary: true };
1321
- }
1322
- if (STANDALONE_UTILITIES.has(remaining)) {
1323
- return { original: trimmed, modifiers, negative, important, utility: remaining, value: "", isArbitrary: false };
1324
- }
1325
- for (const prefix of SORTED_PREFIXES) {
1326
- if (remaining === prefix) {
1327
- return { original: trimmed, modifiers, negative, important, utility: prefix, value: "", isArbitrary: false };
1328
- }
1329
- if (remaining.startsWith(prefix + "-")) {
1330
- const value = remaining.slice(prefix.length + 1);
1331
- return { original: trimmed, modifiers, negative, important, utility: prefix, value, isArbitrary: false };
1332
- }
1333
- }
1334
- const firstDash = remaining.indexOf("-");
1335
- if (firstDash > 0) {
1336
- return {
1337
- original: trimmed,
1338
- modifiers,
1339
- negative,
1340
- important,
1341
- utility: remaining.slice(0, firstDash),
1342
- value: remaining.slice(firstDash + 1),
1343
- isArbitrary: false
1344
- };
1345
- }
1346
- return { original: trimmed, modifiers, negative, important, utility: remaining, value: "", isArbitrary: false };
714
+ for (const k of Object.keys(_pluginModifiers)) delete _pluginModifiers[k];
715
+ _invalidate();
1347
716
  }
1348
- function splitClassTokens(classString) {
1349
- const tokens = [];
1350
- let current = "";
1351
- let depth = 0;
1352
- for (let i = 0; i < classString.length; i++) {
1353
- const ch = classString[i];
1354
- if (ch === "[") {
1355
- depth++;
1356
- current += ch;
1357
- continue;
1358
- }
1359
- if (ch === "]") {
1360
- depth--;
1361
- current += ch;
1362
- continue;
1363
- }
1364
- if (/\s/.test(ch)) {
1365
- if (depth === 0) {
1366
- if (current) {
1367
- tokens.push(current);
1368
- current = "";
1369
- }
1370
- }
1371
- } else {
1372
- current += ch;
1373
- }
1374
- }
1375
- if (current) tokens.push(current);
1376
- return tokens;
717
+ function getModifier(name) {
718
+ return BUILTIN_MODIFIERS[name] ?? _pluginModifiers[name];
1377
719
  }
1378
- function normalizeClassString(classString) {
1379
- return splitClassTokens(classString).join(" ");
720
+ function isKnownModifier(name) {
721
+ return name in BUILTIN_MODIFIERS || name in _pluginModifiers;
1380
722
  }
1381
- function parseClasses(classString) {
1382
- const results = [];
1383
- for (const token of splitClassTokens(classString)) {
1384
- const parsed = parseClass(token);
1385
- if (parsed) results.push(parsed);
723
+ function _allEntries() {
724
+ return [...Object.entries(BUILTIN_MODIFIERS), ...Object.entries(_pluginModifiers)];
725
+ }
726
+ function getInteractiveModifiers() {
727
+ if (!_interactiveNames) {
728
+ _interactiveNames = new Set(_allEntries().filter(([, d]) => d.jsBehavior === "interactive").map(([k]) => k));
1386
729
  }
1387
- return results;
730
+ return _interactiveNames;
1388
731
  }
1389
- function findOuterColon(s) {
1390
- let depth = 0;
1391
- for (let i = 0; i < s.length; i++) {
1392
- const ch = s[i];
1393
- if (ch === "[") depth++;
1394
- else if (ch === "]") depth--;
1395
- else if (ch === ":" && depth === 0) return i;
732
+ function getModeModifiers() {
733
+ if (!_modeNames) {
734
+ _modeNames = new Set(_allEntries().filter(([, d]) => d.jsBehavior === "mode").map(([k]) => k));
1396
735
  }
1397
- return -1;
736
+ return _modeNames;
737
+ }
738
+ function getResponsiveModifiers() {
739
+ if (!_responsiveNames) {
740
+ _responsiveNames = new Set(_allEntries().filter(([, d]) => d.jsBehavior === "responsive").map(([k]) => k));
741
+ }
742
+ return _responsiveNames;
743
+ }
744
+ function matchModifier(name, isDark, state, breakpoints) {
745
+ return getModifier(name)?.jsMatch?.(isDark, state, breakpoints) ?? false;
1398
746
  }
1399
747
 
1400
748
  // src/core/utilities.ts
@@ -1488,6 +836,7 @@ function resolveSizing(value, spacing, isArbitrary) {
1488
836
  if (raw !== void 0) return raw;
1489
837
  if (/^\d+\/\d+$/.test(value)) {
1490
838
  const [num, den] = value.split("/").map(Number);
839
+ if (!den) return null;
1491
840
  return `${(num / den * 100).toFixed(6)}%`;
1492
841
  }
1493
842
  return null;
@@ -3002,10 +2351,10 @@ function resolveUtility(parsed, theme) {
3002
2351
  if (!parsed.value) {
3003
2352
  if (parsed.utility in PLUGIN_STANDALONE) return PLUGIN_STANDALONE[parsed.utility] ?? null;
3004
2353
  if (parsed.utility === "grd" || parsed.utility === "grid") {
3005
- return { display: "grid" };
2354
+ return getEffectiveIsWeb() ? { display: "grid" } : null;
3006
2355
  }
3007
2356
  if (parsed.utility === "inline-grid") {
3008
- return { display: "inline-grid" };
2357
+ return getEffectiveIsWeb() ? { display: "inline-grid" } : null;
3009
2358
  }
3010
2359
  if (parsed.utility in getStandalone()) return getStandalone()[parsed.utility] ?? null;
3011
2360
  }
@@ -3018,6 +2367,8 @@ var PLUGIN_RESOLVERS = {};
3018
2367
  function clearPluginUtilities() {
3019
2368
  for (const key of Object.keys(PLUGIN_STANDALONE)) delete PLUGIN_STANDALONE[key];
3020
2369
  for (const key of Object.keys(PLUGIN_RESOLVERS)) delete PLUGIN_RESOLVERS[key];
2370
+ _sortedPrefixes = null;
2371
+ _standaloneNames = null;
3021
2372
  }
3022
2373
  function getPluginStandaloneMap() {
3023
2374
  return PLUGIN_STANDALONE;
@@ -3025,6 +2376,129 @@ function getPluginStandaloneMap() {
3025
2376
  function isKnownUtility(utility) {
3026
2377
  return utility in getStandalone() || utility in RESOLVERS || utility in PLUGIN_STANDALONE || utility in PLUGIN_RESOLVERS;
3027
2378
  }
2379
+ var _sortedPrefixes = null;
2380
+ var _standaloneNames = null;
2381
+ function getBuiltinUtilityPrefixes() {
2382
+ if (!_sortedPrefixes) {
2383
+ const all = [.../* @__PURE__ */ new Set([...Object.keys(RESOLVERS), ...Object.keys(PLUGIN_RESOLVERS)])];
2384
+ _sortedPrefixes = all.sort((a, b) => b.length - a.length);
2385
+ }
2386
+ return _sortedPrefixes;
2387
+ }
2388
+ function getBuiltinStandaloneNames() {
2389
+ if (!_standaloneNames) {
2390
+ _standaloneNames = /* @__PURE__ */ new Set([...Object.keys(getStandalone()), ...Object.keys(PLUGIN_STANDALONE)]);
2391
+ }
2392
+ return _standaloneNames;
2393
+ }
2394
+
2395
+ // src/core/parser.ts
2396
+ function parseClass(className) {
2397
+ const trimmed = className.trim();
2398
+ if (!trimmed) return null;
2399
+ const modifiers = [];
2400
+ let remaining = trimmed;
2401
+ while (true) {
2402
+ const colonIdx = findOuterColon(remaining);
2403
+ if (colonIdx === -1) break;
2404
+ const candidate = remaining.slice(0, colonIdx);
2405
+ if (!isKnownModifier(candidate)) break;
2406
+ modifiers.push(candidate);
2407
+ remaining = remaining.slice(colonIdx + 1);
2408
+ }
2409
+ let important = false;
2410
+ if (remaining.startsWith("!") && remaining.length > 1) {
2411
+ important = true;
2412
+ remaining = remaining.slice(1);
2413
+ }
2414
+ let negative = false;
2415
+ if (remaining.startsWith("-") && remaining.length > 1 && remaining[1] !== "-") {
2416
+ negative = true;
2417
+ remaining = remaining.slice(1);
2418
+ }
2419
+ const bracketStart = remaining.lastIndexOf("-[");
2420
+ if (bracketStart > 0 && remaining.endsWith("]")) {
2421
+ const utility = remaining.slice(0, bracketStart);
2422
+ const value = remaining.slice(bracketStart + 2, -1).replace(/_/g, " ");
2423
+ return { original: trimmed, modifiers, negative, important, utility, value, isArbitrary: true };
2424
+ }
2425
+ if (getBuiltinStandaloneNames().has(remaining)) {
2426
+ return { original: trimmed, modifiers, negative, important, utility: remaining, value: "", isArbitrary: false };
2427
+ }
2428
+ for (const prefix of getBuiltinUtilityPrefixes()) {
2429
+ if (remaining === prefix) {
2430
+ return { original: trimmed, modifiers, negative, important, utility: prefix, value: "", isArbitrary: false };
2431
+ }
2432
+ if (remaining.startsWith(prefix + "-")) {
2433
+ const value = remaining.slice(prefix.length + 1);
2434
+ return { original: trimmed, modifiers, negative, important, utility: prefix, value, isArbitrary: false };
2435
+ }
2436
+ }
2437
+ const firstDash = remaining.indexOf("-");
2438
+ if (firstDash > 0) {
2439
+ return {
2440
+ original: trimmed,
2441
+ modifiers,
2442
+ negative,
2443
+ important,
2444
+ utility: remaining.slice(0, firstDash),
2445
+ value: remaining.slice(firstDash + 1),
2446
+ isArbitrary: false
2447
+ };
2448
+ }
2449
+ return { original: trimmed, modifiers, negative, important, utility: remaining, value: "", isArbitrary: false };
2450
+ }
2451
+ function splitClassTokens(classString) {
2452
+ const tokens = [];
2453
+ let current = "";
2454
+ let depth = 0;
2455
+ for (let i = 0; i < classString.length; i++) {
2456
+ const ch = classString[i];
2457
+ if (ch === "[") {
2458
+ depth++;
2459
+ current += ch;
2460
+ continue;
2461
+ }
2462
+ if (ch === "]") {
2463
+ depth--;
2464
+ current += ch;
2465
+ continue;
2466
+ }
2467
+ if (/\s/.test(ch)) {
2468
+ if (depth === 0) {
2469
+ if (current) {
2470
+ tokens.push(current);
2471
+ current = "";
2472
+ }
2473
+ }
2474
+ } else {
2475
+ current += ch;
2476
+ }
2477
+ }
2478
+ if (current) tokens.push(current);
2479
+ return tokens;
2480
+ }
2481
+ function normalizeClassString(classString) {
2482
+ return splitClassTokens(classString).join(" ");
2483
+ }
2484
+ function parseClasses(classString) {
2485
+ const results = [];
2486
+ for (const token of splitClassTokens(classString)) {
2487
+ const parsed = parseClass(token);
2488
+ if (parsed) results.push(parsed);
2489
+ }
2490
+ return results;
2491
+ }
2492
+ function findOuterColon(s) {
2493
+ let depth = 0;
2494
+ for (let i = 0; i < s.length; i++) {
2495
+ const ch = s[i];
2496
+ if (ch === "[") depth++;
2497
+ else if (ch === "]") depth--;
2498
+ else if (ch === ":" && depth === 0) return i;
2499
+ }
2500
+ return -1;
2501
+ }
3028
2502
 
3029
2503
  // src/core/responsiveStore.ts
3030
2504
  var RESPONSIVE_KEY = "__kbach_responsive__";
@@ -3057,7 +2531,30 @@ function getActiveBreakpoints(width) {
3057
2531
  }
3058
2532
 
3059
2533
  // src/core/resolver.ts
3060
- var styleCache = new LRUCache(1e4);
2534
+ var _themeCache = /* @__PURE__ */ new WeakMap();
2535
+ function getThemeCache(theme) {
2536
+ let cache = _themeCache.get(theme);
2537
+ if (!cache) {
2538
+ cache = new LRUCache(1e4);
2539
+ _themeCache.set(theme, cache);
2540
+ }
2541
+ return cache;
2542
+ }
2543
+ var _sortCache = /* @__PURE__ */ new WeakMap();
2544
+ function getSortedEntries(resolved) {
2545
+ let sorted = _sortCache.get(resolved);
2546
+ if (!sorted) {
2547
+ const entries = Object.entries(resolved);
2548
+ entries.sort((a, b) => {
2549
+ const pa = a[0] === "base" ? -1 : a[0].split(":").length;
2550
+ const pb = b[0] === "base" ? -1 : b[0].split(":").length;
2551
+ return pa - pb;
2552
+ });
2553
+ sorted = entries;
2554
+ _sortCache.set(resolved, sorted);
2555
+ }
2556
+ return sorted;
2557
+ }
3061
2558
  var FONT_KEY = "__kbach_default_font__";
3062
2559
  function setDefaultFontFamily(font) {
3063
2560
  globalThis[FONT_KEY] = font;
@@ -3066,7 +2563,7 @@ function getDefaultFontFamily() {
3066
2563
  return globalThis[FONT_KEY];
3067
2564
  }
3068
2565
  var _styleEl = null;
3069
- var _injectedRules = /* @__PURE__ */ new Set();
2566
+ var _injectedRules = new LRUCache(5e4);
3070
2567
  function getStyleEl() {
3071
2568
  if (_styleEl) return _styleEl;
3072
2569
  _styleEl = document.createElement("style");
@@ -3076,7 +2573,7 @@ function getStyleEl() {
3076
2573
  }
3077
2574
  function injectRule(rule) {
3078
2575
  if (_injectedRules.has(rule)) return;
3079
- _injectedRules.add(rule);
2576
+ _injectedRules.set(rule, true);
3080
2577
  try {
3081
2578
  getStyleEl().sheet?.insertRule(rule, getStyleEl().sheet.cssRules.length);
3082
2579
  } catch {
@@ -3100,150 +2597,20 @@ function injectGlobalStyles(theme) {
3100
2597
  }
3101
2598
  getGlobalStyleEl().textContent = rules.join("\n");
3102
2599
  }
3103
- var MODIFIER_TO_PSEUDO = {
3104
- hover: ":hover",
3105
- focus: ":focus",
3106
- "focus-within": ":focus-within",
3107
- "focus-visible": ":focus-visible",
3108
- active: ":active",
3109
- pressed: ":active",
3110
- disabled: ":disabled",
3111
- checked: ":checked",
3112
- visited: ":visited",
3113
- placeholder: "::placeholder",
3114
- first: ":first-child",
3115
- last: ":last-child",
3116
- odd: ":nth-child(odd)",
3117
- even: ":nth-child(even)",
3118
- only: ":only-child",
3119
- "not-hover": ":not(:hover)",
3120
- "not-focus": ":not(:focus)",
3121
- "not-active": ":not(:active)",
3122
- "not-pressed": ":not(:active)",
3123
- "not-disabled": ":not(:disabled)",
3124
- "not-checked": ":not(:checked)",
3125
- "not-visited": ":not(:visited)",
3126
- // Pseudo-elements (CSS-injection only; never applied as inline styles)
3127
- before: "::before",
3128
- after: "::after",
3129
- selection: "::selection",
3130
- "first-letter": "::first-letter",
3131
- "first-line": "::first-line",
3132
- marker: "::marker"
3133
- };
3134
- var GROUP_PEER_PREFIX = {
3135
- "group-hover": ".group:hover",
3136
- "group-focus": ".group:focus",
3137
- "peer-hover": ".peer:hover ~",
3138
- "peer-focus": ".peer:focus ~"
3139
- };
3140
- var MODE_MODS = /* @__PURE__ */ new Set(["dark", "light", "not-dark", "not-light"]);
3141
- var RESPONSIVE_MODS = /* @__PURE__ */ new Set(["sm", "md", "lg", "xl", "2xl"]);
3142
- var PRINT_MODS = /* @__PURE__ */ new Set(["print"]);
3143
- var MEDIA_MODS = {
3144
- landscape: "(orientation: landscape)",
3145
- portrait: "(orientation: portrait)",
3146
- "motion-reduce": "(prefers-reduced-motion: reduce)",
3147
- "motion-safe": "(prefers-reduced-motion: no-preference)",
3148
- "contrast-more": "(prefers-contrast: more)",
3149
- "contrast-less": "(prefers-contrast: less)"
3150
- };
3151
- var DIR_MODS = {
3152
- rtl: '[dir="rtl"]',
3153
- ltr: '[dir="ltr"]'
3154
- };
3155
2600
  function buildDivideDecls(styles) {
3156
2601
  const parts = [];
3157
2602
  if ("__divideX" in styles) {
3158
2603
  const w = Number(styles.__divideX);
3159
- parts.push(`border-left-width: ${w}px`);
3160
- parts.push("border-right-width: 0px");
2604
+ parts.push(`border-left-width: ${w}px`, "border-right-width: 0px");
3161
2605
  }
3162
2606
  if ("__divideY" in styles) {
3163
2607
  const w = Number(styles.__divideY);
3164
- parts.push(`border-top-width: ${w}px`);
3165
- parts.push("border-bottom-width: 0px");
2608
+ parts.push(`border-top-width: ${w}px`, "border-bottom-width: 0px");
3166
2609
  }
3167
2610
  if ("__divideColor" in styles) parts.push(`border-color: ${String(styles.__divideColor)}`);
3168
2611
  if ("__divideStyle" in styles) parts.push(`border-style: ${String(styles.__divideStyle)}`);
3169
2612
  return parts.join("; ");
3170
2613
  }
3171
- function buildClassCSSRules(cls, bucketKey, styles, darkMode, important, screens) {
3172
- const rules = [];
3173
- if ("__keyframe" in styles && typeof styles.__keyframe === "string") {
3174
- rules.push(styles.__keyframe);
3175
- }
3176
- const isDivide = "__divideX" in styles || "__divideY" in styles || "__divideColor" in styles || "__divideStyle" in styles;
3177
- const escaped = escapeCSSSelector(cls);
3178
- const childSuffix = isDivide ? " > * + *" : "";
3179
- if (bucketKey === "base") {
3180
- const baseCssDecls = isDivide ? buildDivideDecls(styles) : styleValueToCSS(styles, important);
3181
- if (!baseCssDecls) return rules;
3182
- rules.push(`.${escaped}${childSuffix} { ${baseCssDecls} }`);
3183
- return rules;
3184
- }
3185
- const mods = bucketKey.split(":");
3186
- const responsiveMods = mods.filter((m) => RESPONSIVE_MODS.has(m));
3187
- const nonResponsiveMods = mods.filter((m) => !RESPONSIVE_MODS.has(m));
3188
- const hasDark = nonResponsiveMods.includes("dark") || nonResponsiveMods.includes("not-light");
3189
- const hasLight = nonResponsiveMods.includes("light") || nonResponsiveMods.includes("not-dark");
3190
- const hasPrint = nonResponsiveMods.includes("print");
3191
- const mediaMods = nonResponsiveMods.filter((m) => m in MEDIA_MODS);
3192
- const dirMods = nonResponsiveMods.filter((m) => m in DIR_MODS);
3193
- const ancestorMods = nonResponsiveMods.filter((m) => m in GROUP_PEER_PREFIX);
3194
- const pseudoMods = nonResponsiveMods.filter(
3195
- (m) => !MODE_MODS.has(m) && !(m in GROUP_PEER_PREFIX) && !PRINT_MODS.has(m) && !(m in MEDIA_MODS) && !(m in DIR_MODS)
3196
- );
3197
- const pseudoSuffix = pseudoMods.map((p) => MODIFIER_TO_PSEUDO[p] ?? `:${p}`).join("");
3198
- const elementSelector = `.${escaped}${pseudoSuffix}${childSuffix}`;
3199
- const ancestorPrefix = ancestorMods.length ? ancestorMods.map((m) => GROUP_PEER_PREFIX[m]).join(" ") + " " : "";
3200
- const dirPrefix = dirMods.length ? dirMods.map((m) => DIR_MODS[m]).join(" ") + " " : "";
3201
- const selector = `${dirPrefix}${ancestorPrefix}${elementSelector}`;
3202
- const CSS_ONLY_PSEUDOS = /* @__PURE__ */ new Set([
3203
- "first",
3204
- "last",
3205
- "odd",
3206
- "even",
3207
- "only",
3208
- "focus-within",
3209
- "focus-visible"
3210
- ]);
3211
- const needsImportant = important || hasPrint || mediaMods.length > 0 || dirMods.length > 0 || ancestorMods.length > 0 || pseudoMods.some((m) => CSS_ONLY_PSEUDOS.has(m));
3212
- const cssDecls = isDivide ? buildDivideDecls(styles) : styleValueToCSS(styles, needsImportant);
3213
- if (!cssDecls) return rules;
3214
- let rule;
3215
- if (hasDark) {
3216
- if (darkMode === "media") {
3217
- rule = `@media (prefers-color-scheme: dark) { ${selector} { ${cssDecls} } }`;
3218
- } else if (darkMode === "class") {
3219
- rule = `.dark ${selector} { ${cssDecls} }`;
3220
- } else {
3221
- rule = `[data-theme="dark"] ${selector} { ${cssDecls} }`;
3222
- }
3223
- } else if (hasLight) {
3224
- if (darkMode === "media") {
3225
- rule = `@media (prefers-color-scheme: light) { ${selector} { ${cssDecls} } }`;
3226
- } else if (darkMode === "class") {
3227
- rule = `:not(.dark) ${selector} { ${cssDecls} }`;
3228
- } else {
3229
- rule = `[data-theme="light"] ${selector} { ${cssDecls} }`;
3230
- }
3231
- } else {
3232
- rule = `${selector} { ${cssDecls} }`;
3233
- }
3234
- if (hasPrint) rule = `@media print { ${rule} }`;
3235
- for (const m of mediaMods) rule = `@media ${MEDIA_MODS[m]} { ${rule} }`;
3236
- if (responsiveMods.length > 0) {
3237
- const minWidth = Math.max(...responsiveMods.map((m) => screens[m] ?? 0));
3238
- if (minWidth > 0) rule = `@media (min-width: ${minWidth}px) { ${rule} }`;
3239
- }
3240
- rules.push(rule);
3241
- return rules;
3242
- }
3243
- function injectClassRule(cls, bucketKey, styles, darkMode, important = false) {
3244
- const cssRules = buildClassCSSRules(cls, bucketKey, styles, darkMode, important, getGlobalScreens());
3245
- for (const r of cssRules) injectRule(r);
3246
- }
3247
2614
  var RN_ONLY_PROPS = /* @__PURE__ */ new Set([
3248
2615
  "shadowColor",
3249
2616
  "shadowOffset",
@@ -3253,13 +2620,10 @@ var RN_ONLY_PROPS = /* @__PURE__ */ new Set([
3253
2620
  "includeFontPadding",
3254
2621
  "textAlignVertical",
3255
2622
  "writingDirection",
3256
- // Text shadow native props — web uses the textShadow CSS shorthand instead
3257
2623
  "textShadowColor",
3258
2624
  "textShadowOffset",
3259
2625
  "textShadowRadius",
3260
- // tintColor is native-only (Image/icon tinting)
3261
2626
  "tintColor",
3262
- // Internal markers — handled specially, never serialized as CSS props
3263
2627
  "__divideX",
3264
2628
  "__divideY",
3265
2629
  "__divideColor",
@@ -3301,8 +2665,7 @@ function styleValueToCSS(styles, forceImportant = false) {
3301
2665
  const imp = forceImportant || prop === "display" && (cssVal === "grid" || cssVal === "inline-grid") || prop === "position" && (cssVal === "sticky" || cssVal === "fixed" || cssVal === "static") ? " !important" : "";
3302
2666
  if (prop in RN_SHORTHAND_EXPAND) {
3303
2667
  const [p1, p2] = RN_SHORTHAND_EXPAND[prop];
3304
- parts.push(`${p1}: ${cssVal}${imp}`);
3305
- parts.push(`${p2}: ${cssVal}${imp}`);
2668
+ parts.push(`${p1}: ${cssVal}${imp}`, `${p2}: ${cssVal}${imp}`);
3306
2669
  continue;
3307
2670
  }
3308
2671
  parts.push(`${camelToKebab(prop)}: ${cssVal}${imp}`);
@@ -3312,14 +2675,87 @@ function styleValueToCSS(styles, forceImportant = false) {
3312
2675
  function camelToKebab(str) {
3313
2676
  return str.replace(/([A-Z])/g, "-$1").toLowerCase();
3314
2677
  }
2678
+ function buildClassCSSRules(cls, bucketKey, styles, darkMode, important, screens) {
2679
+ const rules = [];
2680
+ if ("__keyframe" in styles && typeof styles.__keyframe === "string") {
2681
+ rules.push(styles.__keyframe);
2682
+ }
2683
+ const isDivide = "__divideX" in styles || "__divideY" in styles || "__divideColor" in styles || "__divideStyle" in styles;
2684
+ const escaped = escapeCSSSelector(cls);
2685
+ const childSuffix = isDivide ? " > * + *" : "";
2686
+ if (bucketKey === "base") {
2687
+ const decls2 = isDivide ? buildDivideDecls(styles) : styleValueToCSS(styles, important);
2688
+ if (!decls2) return rules;
2689
+ rules.push(`.${escaped}${childSuffix} { ${decls2} }`);
2690
+ return rules;
2691
+ }
2692
+ const mods = bucketKey.split(":");
2693
+ let darkScheme;
2694
+ let needsImportant = important;
2695
+ const pseudoParts = [];
2696
+ const ancestorParts = [];
2697
+ const dirParts = [];
2698
+ const mediaWrappers = [];
2699
+ let minWidth = 0;
2700
+ for (const mod of mods) {
2701
+ const def = getModifier(mod);
2702
+ if (!def) continue;
2703
+ if (def.darkScheme) darkScheme = def.darkScheme;
2704
+ if (def.pseudo) pseudoParts.push(def.pseudo);
2705
+ if (def.ancestorSelector) {
2706
+ ancestorParts.push(def.ancestorSelector);
2707
+ needsImportant = true;
2708
+ }
2709
+ if (def.dirSelector) {
2710
+ dirParts.push(def.dirSelector);
2711
+ needsImportant = true;
2712
+ }
2713
+ if (def.mediaQuery) {
2714
+ mediaWrappers.push(`@media ${def.mediaQuery}`);
2715
+ needsImportant = true;
2716
+ }
2717
+ if (def.isResponsive) {
2718
+ const w = screens[mod] ?? 0;
2719
+ if (w > minWidth) minWidth = w;
2720
+ }
2721
+ if (def.forcesImportant) needsImportant = true;
2722
+ }
2723
+ const pseudoSuffix = pseudoParts.join("");
2724
+ const elementSelector = `.${escaped}${pseudoSuffix}${childSuffix}`;
2725
+ const ancestorPrefix = ancestorParts.join("");
2726
+ const dirPrefix = dirParts.join("");
2727
+ const selector = `${dirPrefix}${ancestorPrefix}${elementSelector}`;
2728
+ const decls = isDivide ? buildDivideDecls(styles) : styleValueToCSS(styles, needsImportant);
2729
+ if (!decls) return rules;
2730
+ let rule;
2731
+ if (darkScheme === "dark") {
2732
+ if (darkMode === "media") rule = `@media (prefers-color-scheme: dark) { ${selector} { ${decls} } }`;
2733
+ else if (darkMode === "class") rule = `.dark ${selector} { ${decls} }`;
2734
+ else rule = `[data-theme="dark"] ${selector} { ${decls} }`;
2735
+ } else if (darkScheme === "light") {
2736
+ if (darkMode === "media") rule = `@media (prefers-color-scheme: light) { ${selector} { ${decls} } }`;
2737
+ else if (darkMode === "class") rule = `:not(.dark) ${selector} { ${decls} }`;
2738
+ else rule = `[data-theme="light"] ${selector} { ${decls} }`;
2739
+ } else {
2740
+ rule = `${selector} { ${decls} }`;
2741
+ }
2742
+ for (const mw of mediaWrappers) rule = `${mw} { ${rule} }`;
2743
+ if (minWidth > 0) rule = `@media (min-width: ${minWidth}px) { ${rule} }`;
2744
+ rules.push(rule);
2745
+ return rules;
2746
+ }
2747
+ function injectClassRule(cls, bucketKey, styles, darkMode, important) {
2748
+ const cssRules = buildClassCSSRules(cls, bucketKey, styles, darkMode, important, getGlobalScreens());
2749
+ for (const r of cssRules) injectRule(r);
2750
+ }
3315
2751
  function resolve(classString, theme, darkMode = "attribute") {
2752
+ const cache = getThemeCache(theme);
3316
2753
  const cacheKey = `${classString}::${darkMode}`;
3317
- const cached = styleCache.get(cacheKey);
2754
+ const cached = cache.get(cacheKey);
3318
2755
  if (cached) return cached;
3319
2756
  const result = {};
3320
- const parsedClasses = parseClasses(classString);
3321
- const injectQueue = [];
3322
- for (const parsed of parsedClasses) {
2757
+ const onWeb = typeof document !== "undefined";
2758
+ for (const parsed of parseClasses(classString)) {
3323
2759
  const styles = resolveUtility(parsed, theme);
3324
2760
  if (!styles) {
3325
2761
  if (process.env.NODE_ENV !== "production" && !parsed.isArbitrary && !isKnownUtility(parsed.utility)) {
@@ -3330,130 +2766,59 @@ function resolve(classString, theme, darkMode = "attribute") {
3330
2766
  const bucketKey = parsed.modifiers.length === 0 ? "base" : parsed.modifiers.join(":");
3331
2767
  if (!result[bucketKey]) result[bucketKey] = {};
3332
2768
  Object.assign(result[bucketKey], styles);
3333
- if (typeof document !== "undefined") {
3334
- injectQueue.push({ cls: parsed.original, bucketKey, styles, important: parsed.important });
3335
- }
3336
- }
3337
- styleCache.set(cacheKey, result);
3338
- if (typeof document !== "undefined") {
3339
- for (const { cls, bucketKey, styles, important } of injectQueue) {
3340
- injectClassRule(cls, bucketKey, styles, darkMode, important);
2769
+ if (onWeb) {
2770
+ injectClassRule(parsed.original, bucketKey, styles, darkMode, parsed.important);
3341
2771
  }
3342
2772
  }
2773
+ cache.set(cacheKey, result);
3343
2774
  return result;
3344
2775
  }
3345
2776
  function flatten(resolved, isDark, state = {}, breakpoints = /* @__PURE__ */ new Set()) {
3346
2777
  const result = {};
3347
- const entries = Object.entries(resolved);
3348
- entries.sort((a, b) => {
3349
- const pa = a[0] === "base" ? -1 : a[0].split(":").length;
3350
- const pb = b[0] === "base" ? -1 : b[0].split(":").length;
3351
- return pa - pb;
3352
- });
3353
- for (const [key, styles] of entries) {
2778
+ for (const [key, styles] of getSortedEntries(resolved)) {
3354
2779
  if (!styles) continue;
3355
2780
  if (key === "base") {
3356
2781
  Object.assign(result, styles);
3357
2782
  continue;
3358
2783
  }
3359
2784
  const mods = key.split(":");
3360
- if (matchesMods(mods, isDark, state, breakpoints)) {
2785
+ if (mods.every((mod) => matchModifier(mod, isDark, state, breakpoints))) {
3361
2786
  Object.assign(result, styles);
3362
2787
  }
3363
2788
  }
3364
- const _df = getDefaultFontFamily();
3365
- if (_df && !("fontFamily" in result)) {
3366
- result.fontFamily = _df;
2789
+ const defaultFont = getDefaultFontFamily();
2790
+ if (defaultFont && !("fontFamily" in result)) {
2791
+ result.fontFamily = defaultFont;
3367
2792
  }
3368
- if (isWeb) {
2793
+ if (!isNative) {
3369
2794
  const r = result;
3370
- const v0 = r.paddingHorizontal;
3371
- if (v0 !== void 0) {
3372
- r.paddingLeft = v0;
3373
- r.paddingRight = v0;
2795
+ const ph = r.paddingHorizontal;
2796
+ if (ph !== void 0) {
2797
+ r.paddingLeft = ph;
2798
+ r.paddingRight = ph;
3374
2799
  delete r.paddingHorizontal;
3375
2800
  }
3376
- const v1 = r.paddingVertical;
3377
- if (v1 !== void 0) {
3378
- r.paddingTop = v1;
3379
- r.paddingBottom = v1;
2801
+ const pv = r.paddingVertical;
2802
+ if (pv !== void 0) {
2803
+ r.paddingTop = pv;
2804
+ r.paddingBottom = pv;
3380
2805
  delete r.paddingVertical;
3381
2806
  }
3382
- const v2 = r.marginHorizontal;
3383
- if (v2 !== void 0) {
3384
- r.marginLeft = v2;
3385
- r.marginRight = v2;
2807
+ const mh = r.marginHorizontal;
2808
+ if (mh !== void 0) {
2809
+ r.marginLeft = mh;
2810
+ r.marginRight = mh;
3386
2811
  delete r.marginHorizontal;
3387
2812
  }
3388
- const v3 = r.marginVertical;
3389
- if (v3 !== void 0) {
3390
- r.marginTop = v3;
3391
- r.marginBottom = v3;
2813
+ const mv = r.marginVertical;
2814
+ if (mv !== void 0) {
2815
+ r.marginTop = mv;
2816
+ r.marginBottom = mv;
3392
2817
  delete r.marginVertical;
3393
2818
  }
3394
2819
  }
3395
2820
  return result;
3396
2821
  }
3397
- function matchesMods(mods, isDark, state, breakpoints) {
3398
- return mods.every((mod) => {
3399
- switch (mod) {
3400
- case "dark":
3401
- return isDark;
3402
- case "light":
3403
- case "not-dark":
3404
- return !isDark;
3405
- case "not-light":
3406
- return isDark;
3407
- case "hover":
3408
- return !!state.hover;
3409
- case "not-hover":
3410
- return !state.hover;
3411
- case "focus":
3412
- return !!state.focus;
3413
- case "not-focus":
3414
- return !state.focus;
3415
- case "pressed":
3416
- case "active":
3417
- return !!state.pressed || !!state.active;
3418
- case "not-pressed":
3419
- case "not-active":
3420
- return !state.pressed && !state.active;
3421
- case "disabled":
3422
- return !!state.disabled;
3423
- case "not-disabled":
3424
- return !state.disabled;
3425
- case "checked":
3426
- return !!state.checked;
3427
- case "not-checked":
3428
- return !state.checked;
3429
- case "visited":
3430
- return !!state.visited;
3431
- case "not-visited":
3432
- return !state.visited;
3433
- case "placeholder":
3434
- return !!state.placeholder;
3435
- case "sm":
3436
- case "md":
3437
- case "lg":
3438
- case "xl":
3439
- case "2xl":
3440
- return breakpoints.has(mod);
3441
- // CSS-only modifiers — never applied as inline styles
3442
- case "print":
3443
- case "landscape":
3444
- case "portrait":
3445
- case "motion-reduce":
3446
- case "motion-safe":
3447
- case "contrast-more":
3448
- case "contrast-less":
3449
- case "rtl":
3450
- case "ltr":
3451
- return false;
3452
- default:
3453
- return false;
3454
- }
3455
- });
3456
- }
3457
2822
 
3458
2823
  // src/core/config.ts
3459
2824
  function deepMerge(base, override) {
@@ -3494,14 +2859,24 @@ function resolveOneRef(ref, colors) {
3494
2859
  return entry[m[2]] ?? null;
3495
2860
  }
3496
2861
  function resolveColorRefs(colors) {
2862
+ const MAX_DEPTH = 5;
2863
+ function resolveChain(raw) {
2864
+ let current = raw;
2865
+ for (let i = 0; i < MAX_DEPTH; i++) {
2866
+ const next = resolveOneRef(current, colors);
2867
+ if (!next || next === current) break;
2868
+ current = next;
2869
+ }
2870
+ return current;
2871
+ }
3497
2872
  const out = {};
3498
2873
  for (const [key, val] of Object.entries(colors)) {
3499
2874
  if (typeof val === "string") {
3500
- out[key] = resolveOneRef(val, colors) ?? val;
2875
+ out[key] = resolveChain(val);
3501
2876
  } else {
3502
2877
  const shades = {};
3503
2878
  for (const [shade, hex] of Object.entries(val)) {
3504
- shades[shade] = resolveOneRef(hex, colors) ?? hex;
2879
+ shades[shade] = resolveChain(hex);
3505
2880
  }
3506
2881
  out[key] = shades;
3507
2882
  }
@@ -3549,15 +2924,26 @@ function buildConfig(userConfig) {
3549
2924
  injectGlobalStyles(resolved.theme);
3550
2925
  return resolved;
3551
2926
  }
2927
+ function _selectorToModifierDef(selector) {
2928
+ const s = selector.trim();
2929
+ if (s.startsWith("@media ")) {
2930
+ return { mediaQuery: s.slice(7), jsBehavior: "css-only", forcesImportant: true };
2931
+ }
2932
+ if (s.startsWith("::") || s.startsWith(":")) {
2933
+ return { pseudo: s, jsBehavior: "css-only", forcesImportant: true };
2934
+ }
2935
+ return { ancestorSelector: s.endsWith(" ") ? s : `${s} `, jsBehavior: "css-only", forcesImportant: true };
2936
+ }
3552
2937
  function makePluginAPI(theme) {
3553
2938
  const standalone = getPluginStandaloneMap();
3554
2939
  return {
3555
2940
  addUtility(name, styles) {
3556
2941
  standalone[name] = styles;
3557
2942
  },
3558
- addVariant(name, selector) {
3559
- customVariants[name] = selector;
3560
- registerModifier(name);
2943
+ addVariant(name, selectorOrDef) {
2944
+ const def = typeof selectorOrDef === "string" ? _selectorToModifierDef(selectorOrDef) : selectorOrDef;
2945
+ customVariants[name] = typeof selectorOrDef === "string" ? selectorOrDef : name;
2946
+ registerModifier(name, def);
3561
2947
  },
3562
2948
  theme(path, defaultValue) {
3563
2949
  const parts = path.replace(/\[([^\]]+)\]/g, ".$1").split(".");
@@ -3678,23 +3064,26 @@ function useConditionalWidth(active) {
3678
3064
  );
3679
3065
  }
3680
3066
 
3681
- // src/InteractiveWrapper.tsx
3682
- function chain(original, extra) {
3683
- return (...args) => {
3684
- original?.(...args);
3685
- extra();
3686
- };
3687
- }
3688
- var RESPONSIVE_MODS2 = /* @__PURE__ */ new Set(["sm", "md", "lg", "xl", "2xl"]);
3067
+ // src/shared-utils.ts
3689
3068
  function hasResponsiveBuckets(resolved) {
3069
+ const responsiveMods = getResponsiveModifiers();
3690
3070
  for (const key of Object.keys(resolved)) {
3691
3071
  if (key === "base") continue;
3692
3072
  for (const mod of key.split(":")) {
3693
- if (RESPONSIVE_MODS2.has(mod)) return true;
3073
+ if (responsiveMods.has(mod)) return true;
3694
3074
  }
3695
3075
  }
3696
3076
  return false;
3697
3077
  }
3078
+ var EMPTY_BREAKPOINTS2 = /* @__PURE__ */ new Set();
3079
+
3080
+ // src/InteractiveWrapper.tsx
3081
+ function chain(original, extra) {
3082
+ return (...args) => {
3083
+ original?.(...args);
3084
+ extra();
3085
+ };
3086
+ }
3698
3087
  var InteractiveWrapper = (0, import_react3.forwardRef)(
3699
3088
  function InteractiveWrapper2({
3700
3089
  Component,
@@ -3770,10 +3159,10 @@ var InteractiveWrapper = (0, import_react3.forwardRef)(
3770
3159
  ref,
3771
3160
  ...restWithoutChildren,
3772
3161
  style: finalStyle,
3773
- ...isWeb && className ? { className } : {},
3162
+ ...!isNative && className ? { className } : {},
3774
3163
  // onPressIn / onPressOut are React Native-only.
3775
3164
  // On web, onPointerDown/Up drive the pressed state instead (covers mouse + touch).
3776
- ...isWeb ? { onPointerDown: handlePointerDown, onPointerUp: handlePointerUp, onPointerLeave: handlePointerLeave } : { onPressIn: handlePressIn, onPressOut: handlePressOut },
3165
+ ...!isNative ? { onPointerDown: handlePointerDown, onPointerUp: handlePointerUp, onPointerLeave: handlePointerLeave } : { onPressIn: handlePressIn, onPressOut: handlePressOut },
3777
3166
  onMouseEnter: handleMouseEnter,
3778
3167
  onMouseLeave: handleMouseLeave,
3779
3168
  onFocus: handleFocus,
@@ -3786,22 +3175,12 @@ InteractiveWrapper.displayName = "Kbach.InteractiveWrapper";
3786
3175
 
3787
3176
  // src/DarkWrapper.tsx
3788
3177
  var import_react4 = __toESM(require("react"));
3789
- var RESPONSIVE_MODS3 = /* @__PURE__ */ new Set(["sm", "md", "lg", "xl", "2xl"]);
3790
- function hasResponsiveBuckets2(resolved) {
3791
- for (const key of Object.keys(resolved)) {
3792
- if (key === "base") continue;
3793
- for (const mod of key.split(":")) {
3794
- if (RESPONSIVE_MODS3.has(mod)) return true;
3795
- }
3796
- }
3797
- return false;
3798
- }
3799
3178
  var DarkWrapper = import_react4.default.forwardRef(
3800
3179
  function DarkWrapper2({ Component, resolvedStyle, style: styleProp, children, ...rest }, ref) {
3801
3180
  const isDark = useGlobalDarkMode();
3802
- const needsWidth = hasResponsiveBuckets2(resolvedStyle);
3181
+ const needsWidth = hasResponsiveBuckets(resolvedStyle);
3803
3182
  const width = useConditionalWidth(needsWidth);
3804
- const breakpoints = needsWidth ? getActiveBreakpoints(width) : EMPTY_BREAKPOINTS;
3183
+ const breakpoints = needsWidth ? getActiveBreakpoints(width) : EMPTY_BREAKPOINTS2;
3805
3184
  const computedStyle = flatten(resolvedStyle, isDark, {}, breakpoints);
3806
3185
  stripInternalMarkers(computedStyle);
3807
3186
  if (typeof Component !== "string") stripWebOnlyProps(computedStyle);
@@ -3843,51 +3222,36 @@ function stripWebOnlyProps(s) {
3843
3222
  }
3844
3223
 
3845
3224
  // src/jsx-runtime.tsx
3846
- var INTERACTIVE_MODS = /* @__PURE__ */ new Set([
3847
- "hover",
3848
- "not-hover",
3849
- "focus",
3850
- "not-focus",
3851
- "active",
3852
- "not-active",
3853
- "pressed",
3854
- "not-pressed",
3855
- "disabled",
3856
- "not-disabled",
3857
- "checked",
3858
- "not-checked",
3859
- "visited",
3860
- "not-visited",
3861
- "placeholder",
3862
- "group-hover",
3863
- "group-focus",
3864
- "peer-hover",
3865
- "peer-focus"
3866
- // focus-within / focus-visible / first / last / odd / even / only are CSS-only —
3867
- // they have no JS state to track, so they don't need InteractiveWrapper.
3868
- ]);
3869
- var RESPONSIVE_MODS4 = /* @__PURE__ */ new Set(["sm", "md", "lg", "xl", "2xl"]);
3870
- var MODE_MODS_JSX = /* @__PURE__ */ new Set(["dark", "light", "not-dark", "not-light"]);
3225
+ var _cachedDefaultFont = void 0;
3226
+ var _defaultFontVersion = 0;
3227
+ var _lastFontVersion = -1;
3228
+ function getCachedDefaultFont() {
3229
+ if (_lastFontVersion !== _defaultFontVersion) {
3230
+ _cachedDefaultFont = getDefaultFontFamily();
3231
+ _lastFontVersion = _defaultFontVersion;
3232
+ }
3233
+ return _cachedDefaultFont;
3234
+ }
3235
+ var _bucketModsCache = /* @__PURE__ */ new WeakMap();
3871
3236
  function bucketMods(resolved) {
3237
+ const cached = _bucketModsCache.get(resolved);
3238
+ if (cached) return cached;
3239
+ const interactiveMods = getInteractiveModifiers();
3240
+ const modeMods = getModeModifiers();
3241
+ const responsiveMods = getResponsiveModifiers();
3872
3242
  let interactive = false;
3873
3243
  let modeOrResponsive = false;
3874
3244
  for (const key of Object.keys(resolved)) {
3875
3245
  if (key === "base") continue;
3876
- const parts = key.split(":");
3877
- for (const mod of parts) {
3878
- if (INTERACTIVE_MODS.has(mod)) {
3879
- interactive = true;
3880
- break;
3881
- }
3882
- }
3883
- for (const mod of parts) {
3884
- if (MODE_MODS_JSX.has(mod) || RESPONSIVE_MODS4.has(mod)) {
3885
- modeOrResponsive = true;
3886
- break;
3887
- }
3246
+ for (const mod of key.split(":")) {
3247
+ if (!interactive && interactiveMods.has(mod)) interactive = true;
3248
+ if (!modeOrResponsive && (modeMods.has(mod) || responsiveMods.has(mod))) modeOrResponsive = true;
3888
3249
  }
3250
+ if (interactive && modeOrResponsive) break;
3889
3251
  }
3890
- return { interactive, modeOrResponsive };
3252
+ const result = { interactive, modeOrResponsive };
3253
+ _bucketModsCache.set(resolved, result);
3254
+ return result;
3891
3255
  }
3892
3256
  var CONSUMED_PROPS = /* @__PURE__ */ new Set(["className", "kb", "__kbachStyles", "__kbachClasses"]);
3893
3257
  function omitConsumed(props) {
@@ -3962,10 +3326,8 @@ function processElement(type, rawProps, key, isStaticChildren) {
3962
3326
  const { className, kb: kbProp, __kbachStyles, __kbachClasses } = rawProps;
3963
3327
  const classStr = className ?? kbProp ?? __kbachClasses;
3964
3328
  if (!classStr && !__kbachStyles) {
3965
- const defaultFont = getDefaultFontFamily();
3966
- if (!defaultFont) {
3967
- return makeElement(isStaticChildren, type, rawProps, key);
3968
- }
3329
+ const defaultFont = getCachedDefaultFont();
3330
+ if (!defaultFont) return makeElement(isStaticChildren, type, rawProps, key);
3969
3331
  const { style: userStyle2, ...passProps2 } = omitConsumed(rawProps);
3970
3332
  const finalStyle2 = userStyle2 ? Array.isArray(userStyle2) ? { fontFamily: defaultFont, ...Object.assign({}, ...userStyle2) } : { fontFamily: defaultFont, ...userStyle2 } : { fontFamily: defaultFont };
3971
3333
  return makeElement(isStaticChildren, type, { ...passProps2, style: finalStyle2 }, key);
@@ -3981,7 +3343,7 @@ function processElement(type, rawProps, key, isStaticChildren) {
3981
3343
  return (0, import_jsx_runtime.jsx)(InteractiveWrapper, {
3982
3344
  Component: actualType,
3983
3345
  resolvedStyle: resolved,
3984
- ...isWeb && classStr ? { className: normalizeClassString(classStr) } : {},
3346
+ ...!isNative && classStr ? { className: normalizeClassString(classStr) } : {},
3985
3347
  style: userStyle,
3986
3348
  ...passProps
3987
3349
  }, key);
@@ -3990,7 +3352,7 @@ function processElement(type, rawProps, key, isStaticChildren) {
3990
3352
  return (0, import_jsx_runtime.jsx)(DarkWrapper, {
3991
3353
  Component: actualType,
3992
3354
  resolvedStyle: resolved,
3993
- ...isWeb && classStr ? { className: normalizeClassString(classStr) } : {},
3355
+ ...!isNative && classStr ? { className: normalizeClassString(classStr) } : {},
3994
3356
  style: userStyle,
3995
3357
  ...passProps
3996
3358
  }, key);
@@ -4002,7 +3364,7 @@ function processElement(type, rawProps, key, isStaticChildren) {
4002
3364
  return makeElement(isStaticChildren, actualType, {
4003
3365
  ...passProps,
4004
3366
  style: finalStyle,
4005
- ...isWeb && classStr ? { className: normalizeClassString(classStr) } : {}
3367
+ ...!isNative && classStr ? { className: normalizeClassString(classStr) } : {}
4006
3368
  }, key);
4007
3369
  }
4008
3370
  function jsx(type, props, key) {
@@ -4013,8 +3375,13 @@ function jsxs(type, props, key) {
4013
3375
  }
4014
3376
 
4015
3377
  // src/jsx-dev-runtime.tsx
4016
- function jsxDEV(type, props, key, isStaticChildren, _source, _self) {
4017
- return (isStaticChildren ? jsxs : jsx)(type, props, key);
3378
+ function jsxDEV(type, props, key, isStaticChildren, source, self) {
3379
+ const element = (isStaticChildren ? jsxs : jsx)(type, props, key);
3380
+ if (source && element && typeof element === "object" && "_source" in Object.getPrototypeOf(element ?? {})) {
3381
+ element._source = source;
3382
+ element._self = self;
3383
+ }
3384
+ return element;
4018
3385
  }
4019
3386
  // Annotate the CommonJS export names for ESM import in node:
4020
3387
  0 && (module.exports = {