@knkcs/anker 0.0.1 → 0.0.2

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.
@@ -25,6 +25,18 @@ var buttonTheme = defineRecipe({
25
25
  _disabled: {
26
26
  bg: "initial"
27
27
  }
28
+ },
29
+ // WCAG 2.5.8 touch target: expand hit area to 44×44px minimum
30
+ // without changing visual size. The pseudo is invisible and captures
31
+ // pointer events beyond the button's visual bounds.
32
+ _after: {
33
+ content: '""',
34
+ position: "absolute",
35
+ top: "50%",
36
+ insetInlineStart: "50%",
37
+ minWidth: "44px",
38
+ minHeight: "44px",
39
+ transform: "translate(-50%, -50%)"
28
40
  }
29
41
  },
30
42
  variants: {
@@ -150,15 +162,15 @@ var buttonTheme = defineRecipe({
150
162
  color: { base: "colorPalette.700", _dark: "colorPalette.300" }
151
163
  }
152
164
  },
153
- // Link variant for gray colorScheme
165
+ // Link variant for gray colorPalette
154
166
  "link-gray": {
155
- color: "fg.muted",
167
+ color: "muted",
156
168
  _hover: {
157
169
  textDecoration: "none",
158
- color: "fg.default"
170
+ color: "default"
159
171
  },
160
172
  _active: {
161
- color: "fg.default"
173
+ color: "default"
162
174
  }
163
175
  }
164
176
  }
@@ -318,21 +330,21 @@ var form_label_default = defineRecipe({
318
330
  _peerPlaceholderShown: {
319
331
  fontSize: "sm",
320
332
  top: "1.5",
321
- left: "4"
333
+ insetInlineStart: "4"
322
334
  }
323
335
  },
324
336
  md: {
325
337
  _peerPlaceholderShown: {
326
338
  fontSize: "md",
327
339
  top: "2",
328
- left: "4"
340
+ insetInlineStart: "4"
329
341
  }
330
342
  },
331
343
  lg: {
332
344
  _peerPlaceholderShown: {
333
345
  fontSize: "lg",
334
346
  top: "2.5",
335
- left: "4"
347
+ insetInlineStart: "4"
336
348
  }
337
349
  }
338
350
  },
@@ -346,7 +358,7 @@ var form_label_default = defineRecipe({
346
358
  transition: "all 0.12s ease-in",
347
359
  pointerEvents: "none",
348
360
  top: "-27px",
349
- left: "0",
361
+ insetInlineStart: "0",
350
362
  _peerPlaceholderShown: {
351
363
  fontWeight: "normal",
352
364
  color: "subtle"
@@ -355,7 +367,7 @@ var form_label_default = defineRecipe({
355
367
  fontSize: "sm",
356
368
  fontWeight: "medium",
357
369
  top: "-27px",
358
- left: "0",
370
+ insetInlineStart: "0",
359
371
  color: "muted"
360
372
  }
361
373
  }
@@ -386,19 +398,19 @@ var inputSlotRecipe = defineSlotRecipe({
386
398
  },
387
399
  "outline-on-accent": {
388
400
  field: {
389
- bg: "white",
401
+ bg: { base: "white", _dark: "gray.800" },
390
402
  borderRadius: "md",
391
- color: "gray.900",
403
+ color: { base: "gray.900", _dark: "gray.100" },
392
404
  borderWidth: "1px",
393
- borderColor: "primary.50",
405
+ borderColor: { base: "primary.50", _dark: "primary.800" },
394
406
  _placeholder: {
395
- color: "gray.500"
407
+ color: { base: "gray.500", _dark: "gray.400" }
396
408
  },
397
409
  _hover: {
398
- borderColor: "primary.100"
410
+ borderColor: { base: "primary.100", _dark: "primary.700" }
399
411
  },
400
412
  _focus: {
401
- borderColor: "primary.200",
413
+ borderColor: { base: "primary.200", _dark: "primary.600" },
402
414
  boxShadow: "0px 0px 0px 1px var(--chakra-colors-primary-200)"
403
415
  }
404
416
  }
@@ -478,7 +490,7 @@ var menuTheme = defineSlotRecipe({
478
490
  px: "0.8rem",
479
491
  fontSize: "sm",
480
492
  fontWeight: "normal",
481
- color: "black",
493
+ color: { base: "gray.800", _dark: "gray.100" },
482
494
  transitionProperty: "background",
483
495
  transitionDuration: "ultra-fast",
484
496
  transitionTimingFunction: "ease-in",
@@ -647,6 +659,287 @@ var propertyTheme = defineSlotRecipe({
647
659
  }
648
660
  }
649
661
  });
662
+ var TRAILING_PSEUDO_REGEX = /(::?[\w-]+(?:\([^)]*\))?)+$/;
663
+ var EXCLUDE_CLASSNAME = ".not-prose";
664
+ function inWhere(selector) {
665
+ const rebuiltSelector = selector.startsWith("& ") ? selector.slice(2) : selector;
666
+ const match = selector.match(TRAILING_PSEUDO_REGEX);
667
+ const pseudo = match ? match[0] : "";
668
+ const base = match ? selector.slice(0, -match[0].length) : rebuiltSelector;
669
+ return `& :where(${base}):not(${EXCLUDE_CLASSNAME}, ${EXCLUDE_CLASSNAME} *)${pseudo}`;
670
+ }
671
+ var proseTheme = defineRecipe({
672
+ className: "prose",
673
+ base: {
674
+ color: "fg.muted",
675
+ maxWidth: "65ch",
676
+ fontSize: "sm",
677
+ lineHeight: "1.7em",
678
+ [inWhere("& p")]: {
679
+ marginTop: "1em",
680
+ marginBottom: "1em"
681
+ },
682
+ [inWhere("& blockquote")]: {
683
+ marginTop: "1.285em",
684
+ marginBottom: "1.285em",
685
+ paddingInline: "1.285em",
686
+ borderInlineStartWidth: "0.25em",
687
+ color: "fg"
688
+ },
689
+ [inWhere("& a")]: {
690
+ color: "fg",
691
+ textDecoration: "underline",
692
+ textUnderlineOffset: "3px",
693
+ textDecorationThickness: "2px",
694
+ textDecorationColor: "border.muted",
695
+ fontWeight: "500"
696
+ },
697
+ [inWhere("& strong")]: {
698
+ fontWeight: "600"
699
+ },
700
+ [inWhere("& a strong")]: {
701
+ color: "inherit"
702
+ },
703
+ [inWhere("& em")]: {
704
+ fontStyle: "italic"
705
+ },
706
+ [inWhere("& h1")]: {
707
+ fontSize: "2.15em",
708
+ letterSpacing: "-0.02em",
709
+ marginTop: "0",
710
+ marginBottom: "0.8em",
711
+ lineHeight: "1.2em"
712
+ },
713
+ [inWhere("& h2")]: {
714
+ fontSize: "1.65em",
715
+ letterSpacing: "-0.02em",
716
+ marginTop: "1.6em",
717
+ marginBottom: "0.8em",
718
+ lineHeight: "1.3em"
719
+ },
720
+ [inWhere("& h3")]: {
721
+ fontSize: "1.35em",
722
+ letterSpacing: "-0.01em",
723
+ marginTop: "1.5em",
724
+ marginBottom: "0.4em",
725
+ lineHeight: "1.4em"
726
+ },
727
+ [inWhere("& h4")]: {
728
+ marginTop: "1.4em",
729
+ marginBottom: "0.5em",
730
+ letterSpacing: "-0.01em",
731
+ lineHeight: "1.5em"
732
+ },
733
+ [inWhere("& img")]: {
734
+ marginTop: "1.7em",
735
+ marginBottom: "1.7em",
736
+ borderRadius: "lg",
737
+ boxShadow: "inset"
738
+ },
739
+ [inWhere("& picture")]: {
740
+ marginTop: "1.7em",
741
+ marginBottom: "1.7em"
742
+ },
743
+ [inWhere("& picture > img")]: {
744
+ marginTop: "0",
745
+ marginBottom: "0"
746
+ },
747
+ [inWhere("& video")]: {
748
+ marginTop: "1.7em",
749
+ marginBottom: "1.7em"
750
+ },
751
+ [inWhere("& kbd")]: {
752
+ fontSize: "0.85em",
753
+ borderRadius: "xs",
754
+ paddingTop: "0.15em",
755
+ paddingBottom: "0.15em",
756
+ paddingInlineEnd: "0.35em",
757
+ paddingInlineStart: "0.35em",
758
+ fontFamily: "inherit",
759
+ color: "fg.muted",
760
+ "--shadow": "colors.border",
761
+ boxShadow: "0 0 0 1px var(--shadow), 0 1px 0 1px var(--shadow)"
762
+ },
763
+ [inWhere("& code")]: {
764
+ fontSize: "0.925em",
765
+ bg: "bg.muted",
766
+ letterSpacing: "-0.01em",
767
+ lineHeight: "1",
768
+ borderRadius: "md",
769
+ borderWidth: "1px",
770
+ paddingInline: "0.25em"
771
+ },
772
+ [inWhere("& pre code")]: {
773
+ fontSize: "inherit",
774
+ letterSpacing: "inherit",
775
+ borderWidth: "inherit",
776
+ padding: "0",
777
+ bg: "transparent"
778
+ },
779
+ [inWhere("& h2 code")]: {
780
+ fontSize: "0.9em"
781
+ },
782
+ [inWhere("& h3 code")]: {
783
+ fontSize: "0.8em"
784
+ },
785
+ [inWhere("& pre")]: {
786
+ backgroundColor: "bg.muted",
787
+ marginTop: "1.6em",
788
+ marginBottom: "1.6em",
789
+ borderRadius: "md",
790
+ fontSize: "0.9em",
791
+ paddingTop: "0.65em",
792
+ paddingBottom: "0.65em",
793
+ paddingInlineEnd: "1em",
794
+ paddingInlineStart: "1em",
795
+ overflowX: "auto",
796
+ fontWeight: "400"
797
+ },
798
+ [inWhere("& ol")]: {
799
+ marginTop: "1em",
800
+ marginBottom: "1em",
801
+ paddingInlineStart: "1.5em"
802
+ },
803
+ [inWhere("& ul")]: {
804
+ marginTop: "1em",
805
+ marginBottom: "1em",
806
+ paddingInlineStart: "1.5em"
807
+ },
808
+ [inWhere("& li")]: {
809
+ marginTop: "0.285em",
810
+ marginBottom: "0.285em"
811
+ },
812
+ [inWhere("& ol > li")]: {
813
+ paddingInlineStart: "0.4em",
814
+ listStyleType: "decimal",
815
+ "&::marker": {
816
+ color: "fg.muted"
817
+ }
818
+ },
819
+ [inWhere("& ul > li")]: {
820
+ paddingInlineStart: "0.4em",
821
+ listStyleType: "disc",
822
+ "&::marker": {
823
+ color: "fg.muted"
824
+ }
825
+ },
826
+ [inWhere("& > ul > li p")]: {
827
+ marginTop: "0.5em",
828
+ marginBottom: "0.5em"
829
+ },
830
+ [inWhere("& > ol > li p")]: {
831
+ marginTop: "0.5em",
832
+ marginBottom: "0.5em"
833
+ },
834
+ [inWhere("& > ul > li > p:first-of-type")]: {
835
+ marginTop: "0em"
836
+ },
837
+ [inWhere("& > ul > li > p:last-of-type")]: {
838
+ marginBottom: "0em"
839
+ },
840
+ [inWhere("& > ol > li > p:first-of-type")]: {
841
+ marginTop: "0em"
842
+ },
843
+ [inWhere("& > ol > li > p:last-of-type")]: {
844
+ marginBottom: "0em"
845
+ },
846
+ [inWhere("& ul ul, ul ol, ol ul, ol ol")]: {
847
+ marginTop: "0.5em",
848
+ marginBottom: "0.5em"
849
+ },
850
+ [inWhere("& dl")]: {
851
+ marginTop: "1em",
852
+ marginBottom: "1em"
853
+ },
854
+ [inWhere("& dt")]: {
855
+ fontWeight: "600",
856
+ marginTop: "1em"
857
+ },
858
+ [inWhere("& dd")]: {
859
+ marginTop: "0.285em",
860
+ paddingInlineStart: "1.5em"
861
+ },
862
+ [inWhere("& hr")]: {
863
+ marginTop: "2.25em",
864
+ marginBottom: "2.25em"
865
+ },
866
+ [inWhere("& :is(h1,h2,h3,h4,h5,hr) + *")]: {
867
+ marginTop: "0"
868
+ },
869
+ [inWhere("& table")]: {
870
+ width: "100%",
871
+ tableLayout: "auto",
872
+ textAlign: "start",
873
+ lineHeight: "1.5em",
874
+ marginTop: "2em",
875
+ marginBottom: "2em"
876
+ },
877
+ [inWhere("& thead")]: {
878
+ borderBottomWidth: "1px",
879
+ color: "fg"
880
+ },
881
+ [inWhere("& tbody tr")]: {
882
+ borderBottomWidth: "1px",
883
+ borderBottomColor: "border"
884
+ },
885
+ [inWhere("& thead th")]: {
886
+ paddingInlineEnd: "1em",
887
+ paddingBottom: "0.65em",
888
+ paddingInlineStart: "1em",
889
+ fontWeight: "medium",
890
+ textAlign: "start"
891
+ },
892
+ [inWhere("& thead th:first-of-type")]: {
893
+ paddingInlineStart: "0"
894
+ },
895
+ [inWhere("& thead th:last-of-type")]: {
896
+ paddingInlineEnd: "0"
897
+ },
898
+ [inWhere("& tbody td, tfoot td")]: {
899
+ paddingTop: "0.65em",
900
+ paddingInlineEnd: "1em",
901
+ paddingBottom: "0.65em",
902
+ paddingInlineStart: "1em"
903
+ },
904
+ [inWhere("& tbody td:first-of-type, tfoot td:first-of-type")]: {
905
+ paddingInlineStart: "0"
906
+ },
907
+ [inWhere("& tbody td:last-of-type, tfoot td:last-of-type")]: {
908
+ paddingInlineEnd: "0"
909
+ },
910
+ [inWhere("& figure")]: {
911
+ marginTop: "1.625em",
912
+ marginBottom: "1.625em"
913
+ },
914
+ [inWhere("& figure > *")]: {
915
+ marginTop: "0",
916
+ marginBottom: "0"
917
+ },
918
+ [inWhere("& figcaption")]: {
919
+ fontSize: "0.85em",
920
+ lineHeight: "1.25em",
921
+ marginTop: "0.85em",
922
+ color: "fg.muted"
923
+ },
924
+ [inWhere("& h1, h2, h3, h4, h5, h6")]: {
925
+ color: "fg",
926
+ fontWeight: "600"
927
+ }
928
+ },
929
+ variants: {
930
+ size: {
931
+ md: {
932
+ fontSize: "sm"
933
+ },
934
+ lg: {
935
+ fontSize: "md"
936
+ }
937
+ }
938
+ },
939
+ defaultVariants: {
940
+ size: "md"
941
+ }
942
+ });
650
943
  var radioCardTheme = defineRecipe({
651
944
  base: {
652
945
  borderWidth: "1px",
@@ -891,7 +1184,7 @@ var tableTheme = defineSlotRecipe({
891
1184
  borderColor: "border"
892
1185
  },
893
1186
  row: {
894
- bg: "bg"
1187
+ bg: "bg-surface"
895
1188
  }
896
1189
  },
897
1190
  striped: {
@@ -1184,19 +1477,19 @@ var tree_item_default = defineSlotRecipe({
1184
1477
  },
1185
1478
  treeItemContent: {},
1186
1479
  treeItemLabel: {
1187
- color: "gray.700"
1480
+ color: { base: "gray.700", _dark: "gray.300" }
1188
1481
  },
1189
1482
  treeItemActions: {
1190
- textAlign: "right",
1191
- marginLeft: "4px"
1483
+ textAlign: "end",
1484
+ marginInlineStart: "4px"
1192
1485
  },
1193
1486
  treeItemChildren: {
1194
1487
  position: "relative",
1195
- paddingLeft: 12,
1488
+ paddingInlineStart: 12,
1196
1489
  _before: {
1197
1490
  content: '""',
1198
1491
  position: "absolute",
1199
- left: "16px",
1492
+ insetInlineStart: "16px",
1200
1493
  height: "100%",
1201
1494
  width: "1px",
1202
1495
  bg: { base: "gray.200", _dark: "gray.600" }
@@ -1311,7 +1604,7 @@ var semanticTokens = {
1311
1604
  value: { base: "gray.500", _dark: "gray.400" }
1312
1605
  },
1313
1606
  border: {
1314
- value: { base: "{colors.gray.200}", _dark: "{colors.gray.700}" }
1607
+ value: { base: "gray.200", _dark: "gray.700" }
1315
1608
  },
1316
1609
  accent: {
1317
1610
  value: { base: "primary.500", _dark: "primary.200" }
@@ -1369,13 +1662,67 @@ var semanticTokens = {
1369
1662
  }
1370
1663
  }
1371
1664
  },
1372
- // Static accent surface tokens
1373
- "bg-accent": { value: "primary.600" },
1374
- "bg-accent-subtle": { value: "primary.500" },
1375
- "bg-accent-muted": { value: "primary.400" },
1376
- "on-accent": { value: "white" },
1377
- "on-accent-muted": { value: "primary.50" },
1378
- "on-accent-subtle": { value: "primary.100" }
1665
+ // Secondary color palette tokens (for colorPalette="secondary")
1666
+ secondary: {
1667
+ contrast: { value: { base: "white", _dark: "white" } },
1668
+ fg: {
1669
+ value: {
1670
+ base: "{colors.secondary.700}",
1671
+ _dark: "{colors.secondary.300}"
1672
+ }
1673
+ },
1674
+ subtle: {
1675
+ value: {
1676
+ base: "{colors.secondary.100}",
1677
+ _dark: "{colors.secondary.900}"
1678
+ }
1679
+ },
1680
+ muted: {
1681
+ value: {
1682
+ base: "{colors.secondary.200}",
1683
+ _dark: "{colors.secondary.800}"
1684
+ }
1685
+ },
1686
+ emphasized: {
1687
+ value: {
1688
+ base: "{colors.secondary.300}",
1689
+ _dark: "{colors.secondary.700}"
1690
+ }
1691
+ },
1692
+ solid: {
1693
+ value: {
1694
+ base: "{colors.secondary.500}",
1695
+ _dark: "{colors.secondary.500}"
1696
+ }
1697
+ },
1698
+ focusRing: {
1699
+ value: {
1700
+ base: "{colors.secondary.500}",
1701
+ _dark: "{colors.secondary.500}"
1702
+ }
1703
+ },
1704
+ border: {
1705
+ value: {
1706
+ base: "{colors.secondary.500}",
1707
+ _dark: "{colors.secondary.400}"
1708
+ }
1709
+ }
1710
+ },
1711
+ // Accent surface tokens
1712
+ "bg-accent": { value: { base: "primary.600", _dark: "primary.400" } },
1713
+ "bg-accent-subtle": {
1714
+ value: { base: "primary.500", _dark: "primary.500" }
1715
+ },
1716
+ "bg-accent-muted": {
1717
+ value: { base: "primary.400", _dark: "primary.600" }
1718
+ },
1719
+ "on-accent": { value: { base: "white", _dark: "white" } },
1720
+ "on-accent-muted": {
1721
+ value: { base: "primary.50", _dark: "primary.100" }
1722
+ },
1723
+ "on-accent-subtle": {
1724
+ value: { base: "primary.100", _dark: "primary.200" }
1725
+ }
1379
1726
  },
1380
1727
  shadows: {
1381
1728
  xs: {
@@ -1521,6 +1868,12 @@ function get(obj, path, fallback) {
1521
1868
  for (const key of keys) {
1522
1869
  if (current == null || typeof current !== "object") return String(fallback);
1523
1870
  current = current[key];
1871
+ if (current != null && typeof current === "object" && "value" in current) {
1872
+ const val = current.value;
1873
+ if (typeof val === "string") {
1874
+ current = val;
1875
+ }
1876
+ }
1524
1877
  }
1525
1878
  return current != null ? String(current) : String(fallback);
1526
1879
  }
@@ -1581,17 +1934,18 @@ var system = createSystem(defaultConfig, {
1581
1934
  recipes: {
1582
1935
  button: buttonTheme,
1583
1936
  container: container_default,
1937
+ prose: proseTheme,
1584
1938
  separator: separator_default,
1585
1939
  formLabel: form_label_default,
1586
1940
  textarea: textarea_default,
1587
1941
  tooltip: tooltipTheme,
1588
1942
  tsRadioCard: radioCardTheme,
1589
- tsProperty: propertyTheme,
1590
- treeItem: tree_item_default,
1591
1943
  tag: tagTheme
1592
1944
  },
1593
1945
  slotRecipes: {
1594
1946
  card: card_default,
1947
+ tsProperty: propertyTheme,
1948
+ treeItem: tree_item_default,
1595
1949
  checkbox: checkbox_default,
1596
1950
  comment: comment_default,
1597
1951
  dialog,
@@ -1624,5 +1978,5 @@ var system = createSystem(defaultConfig, {
1624
1978
  var theme_default = system;
1625
1979
 
1626
1980
  export { colors_default, durations, easings, fonts, getColor, radii_default, semantic_default, spacing_default, textStyles, theme_default, transparentize, z_index_default };
1627
- //# sourceMappingURL=chunk-4D3EY2W2.js.map
1628
- //# sourceMappingURL=chunk-4D3EY2W2.js.map
1981
+ //# sourceMappingURL=chunk-YSFUGIQM.js.map
1982
+ //# sourceMappingURL=chunk-YSFUGIQM.js.map