@ornikar/kitt-universal 23.2.7 → 23.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/definitions/Tag/Tag.d.ts +10 -6
  3. package/dist/definitions/Tag/Tag.d.ts.map +1 -1
  4. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +43 -78
  5. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts.map +1 -1
  6. package/dist/definitions/themes/late-ocean/tag.d.ts +22 -14
  7. package/dist/definitions/themes/late-ocean/tag.d.ts.map +1 -1
  8. package/dist/index-metro.es.android.js +152 -155
  9. package/dist/index-metro.es.android.js.map +1 -1
  10. package/dist/index-metro.es.ios.js +152 -155
  11. package/dist/index-metro.es.ios.js.map +1 -1
  12. package/dist/index-node-20.10.cjs.js +152 -155
  13. package/dist/index-node-20.10.cjs.js.map +1 -1
  14. package/dist/index-node-20.10.cjs.web.js +152 -155
  15. package/dist/index-node-20.10.cjs.web.js.map +1 -1
  16. package/dist/index-node-20.10.es.mjs +152 -155
  17. package/dist/index-node-20.10.es.mjs.map +1 -1
  18. package/dist/index-node-20.10.es.web.mjs +152 -155
  19. package/dist/index-node-20.10.es.web.mjs.map +1 -1
  20. package/dist/index.es.js +153 -156
  21. package/dist/index.es.js.map +1 -1
  22. package/dist/index.es.web.js +153 -156
  23. package/dist/index.es.web.js.map +1 -1
  24. package/dist/linaria-themes-metro.es.android.js +38 -44
  25. package/dist/linaria-themes-metro.es.android.js.map +1 -1
  26. package/dist/linaria-themes-metro.es.ios.js +38 -44
  27. package/dist/linaria-themes-metro.es.ios.js.map +1 -1
  28. package/dist/linaria-themes-node-20.10.cjs.js +38 -44
  29. package/dist/linaria-themes-node-20.10.cjs.js.map +1 -1
  30. package/dist/linaria-themes-node-20.10.cjs.web.js +38 -44
  31. package/dist/linaria-themes-node-20.10.cjs.web.js.map +1 -1
  32. package/dist/linaria-themes-node-20.10.es.mjs +38 -44
  33. package/dist/linaria-themes-node-20.10.es.mjs.map +1 -1
  34. package/dist/linaria-themes-node-20.10.es.web.mjs +38 -44
  35. package/dist/linaria-themes-node-20.10.es.web.mjs.map +1 -1
  36. package/dist/linaria-themes.es.js +38 -44
  37. package/dist/linaria-themes.es.js.map +1 -1
  38. package/dist/linaria-themes.es.web.js +38 -44
  39. package/dist/linaria-themes.es.web.js.map +1 -1
  40. package/dist/tsbuildinfo +1 -1
  41. package/package.json +2 -2
@@ -1636,57 +1636,51 @@ const skeleton$1 = {
1636
1636
  };
1637
1637
 
1638
1638
  const tag = {
1639
- borderRadius: 10,
1640
- padding: '2px 12px',
1641
- verticalPadding: 2,
1642
- horizontalPadding: 12,
1643
- primary: {
1644
- fill: {
1645
- backgroundColor: lateOceanColorPalette.moonPurpleLight1,
1646
- borderWidth: 0,
1647
- borderColor: colors.transparent
1648
- },
1649
- outline: {
1650
- backgroundColor: colors.transparent,
1651
- borderWidth: 1,
1652
- borderColor: colors.primary
1653
- }
1639
+ borderRadius: 16,
1640
+ icon: {
1641
+ small: 16,
1642
+ medium: 16,
1643
+ large: 20
1654
1644
  },
1655
- default: {
1656
- fill: {
1657
- backgroundColor: lateOceanColorPalette.black50,
1658
- borderWidth: 0,
1659
- borderColor: colors.transparent
1645
+ withIcon: {
1646
+ small: {
1647
+ paddingLeft: 2,
1648
+ paddingRight: 8,
1649
+ height: 20
1660
1650
  },
1661
- outline: {
1662
- backgroundColor: colors.transparent,
1663
- borderWidth: 1,
1664
- borderColor: colors.black
1665
- }
1666
- },
1667
- danger: {
1668
- fill: {
1669
- backgroundColor: colors.danger,
1670
- borderWidth: 0,
1671
- borderColor: colors.transparent
1651
+ medium: {
1652
+ paddingLeft: 4,
1653
+ paddingRight: 8,
1654
+ height: 24
1672
1655
  },
1673
- outline: {
1674
- backgroundColor: colors.transparent,
1675
- borderWidth: 1,
1676
- borderColor: colors.danger
1656
+ large: {
1657
+ paddingLeft: 6,
1658
+ paddingRight: 8,
1659
+ height: 32
1677
1660
  }
1678
1661
  },
1679
- warn: {
1680
- fill: {
1681
- backgroundColor: colors.warning,
1682
- borderWidth: 0,
1683
- borderColor: colors.transparent
1662
+ withoutIcon: {
1663
+ small: {
1664
+ paddingLeft: 8,
1665
+ paddingRight: 8,
1666
+ height: 20
1684
1667
  },
1685
- outline: {
1686
- backgroundColor: colors.transparent,
1687
- borderWidth: 1,
1688
- borderColor: colors.warning
1668
+ medium: {
1669
+ paddingLeft: 8,
1670
+ paddingRight: 8,
1671
+ height: 22
1672
+ },
1673
+ large: {
1674
+ paddingLeft: 8,
1675
+ paddingRight: 8,
1676
+ height: 28
1689
1677
  }
1678
+ },
1679
+ fill: {
1680
+ borderWidth: 0
1681
+ },
1682
+ outline: {
1683
+ borderWidth: 1
1690
1684
  }
1691
1685
  };
1692
1686
 
@@ -7065,48 +7059,6 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
7065
7059
  }
7066
7060
  }
7067
7061
  },
7068
- tag: {
7069
- primary: {
7070
- fill: {
7071
- backgroundColor: theme.tag.primary.fill.backgroundColor,
7072
- borderColor: theme.tag.primary.fill.borderColor
7073
- },
7074
- outline: {
7075
- backgroundColor: theme.tag.primary.outline.backgroundColor,
7076
- borderColor: theme.tag.primary.outline.borderColor
7077
- }
7078
- },
7079
- default: {
7080
- fill: {
7081
- backgroundColor: theme.tag.default.fill.backgroundColor,
7082
- borderColor: theme.tag.default.fill.borderColor
7083
- },
7084
- outline: {
7085
- backgroundColor: theme.tag.default.outline.backgroundColor,
7086
- borderColor: theme.tag.default.outline.borderColor
7087
- }
7088
- },
7089
- danger: {
7090
- fill: {
7091
- backgroundColor: theme.tag.danger.fill.backgroundColor,
7092
- borderColor: theme.tag.danger.fill.borderColor
7093
- },
7094
- outline: {
7095
- backgroundColor: theme.tag.danger.outline.backgroundColor,
7096
- borderColor: theme.tag.danger.outline.borderColor
7097
- }
7098
- },
7099
- warn: {
7100
- fill: {
7101
- backgroundColor: theme.tag.warn.fill.backgroundColor,
7102
- borderColor: theme.tag.warn.fill.borderColor
7103
- },
7104
- outline: {
7105
- backgroundColor: theme.tag.warn.outline.backgroundColor,
7106
- borderColor: theme.tag.warn.outline.borderColor
7107
- }
7108
- }
7109
- },
7110
7062
  tooltip: {
7111
7063
  backgroundColor: theme.tooltip.backgroundColor
7112
7064
  },
@@ -7595,37 +7547,11 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
7595
7547
  borderWidth: theme.listItem.borderWidth
7596
7548
  },
7597
7549
  tag: {
7598
- primary: {
7599
- fill: {
7600
- borderWidth: theme.tag.primary.fill.borderWidth
7601
- },
7602
- outline: {
7603
- borderWidth: theme.tag.primary.outline.borderWidth
7604
- }
7605
- },
7606
- default: {
7607
- fill: {
7608
- borderWidth: theme.tag.default.fill.borderWidth
7609
- },
7610
- outline: {
7611
- borderWidth: theme.tag.default.outline.borderWidth
7612
- }
7550
+ fill: {
7551
+ borderWidth: theme.tag.fill.borderWidth
7613
7552
  },
7614
- danger: {
7615
- fill: {
7616
- borderWidth: theme.tag.danger.fill.borderWidth
7617
- },
7618
- outline: {
7619
- borderWidth: theme.tag.danger.outline.borderWidth
7620
- }
7621
- },
7622
- warn: {
7623
- fill: {
7624
- borderWidth: theme.tag.warn.fill.borderWidth
7625
- },
7626
- outline: {
7627
- borderWidth: theme.tag.warn.outline.borderWidth
7628
- }
7553
+ outline: {
7554
+ borderWidth: theme.tag.outline.borderWidth
7629
7555
  }
7630
7556
  }
7631
7557
  },
@@ -7723,6 +7649,39 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
7723
7649
  pageLoader: {
7724
7650
  size: theme.pageLoader.size
7725
7651
  },
7652
+ tag: {
7653
+ small: {
7654
+ iconSize: theme.tag.icon.small
7655
+ },
7656
+ medium: {
7657
+ iconSize: theme.tag.icon.medium
7658
+ },
7659
+ large: {
7660
+ iconSize: theme.tag.icon.large
7661
+ },
7662
+ withIcon: {
7663
+ small: {
7664
+ height: theme.tag.withIcon.small.height
7665
+ },
7666
+ medium: {
7667
+ height: theme.tag.withIcon.medium.height
7668
+ },
7669
+ large: {
7670
+ height: theme.tag.withIcon.large.height
7671
+ }
7672
+ },
7673
+ withoutIcon: {
7674
+ small: {
7675
+ height: theme.tag.withoutIcon.small.height
7676
+ },
7677
+ medium: {
7678
+ height: theme.tag.withoutIcon.medium.height
7679
+ },
7680
+ large: {
7681
+ height: theme.tag.withoutIcon.large.height
7682
+ }
7683
+ }
7684
+ },
7726
7685
  tooltip: {
7727
7686
  maxWidth: theme.tooltip.maxWidth,
7728
7687
  arrow: {
@@ -7815,8 +7774,34 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
7815
7774
  horizontalPadding: theme.listItem.horizontalPadding
7816
7775
  },
7817
7776
  tag: {
7818
- verticalPadding: theme.tag.verticalPadding,
7819
- horizontalPadding: theme.tag.horizontalPadding
7777
+ withoutIcon: {
7778
+ small: {
7779
+ paddingLeft: theme.tag.withoutIcon.small.paddingLeft,
7780
+ paddingRight: theme.tag.withoutIcon.small.paddingRight
7781
+ },
7782
+ medium: {
7783
+ paddingLeft: theme.tag.withoutIcon.medium.paddingLeft,
7784
+ paddingRight: theme.tag.withoutIcon.medium.paddingRight
7785
+ },
7786
+ large: {
7787
+ paddingLeft: theme.tag.withoutIcon.large.paddingLeft,
7788
+ paddingRight: theme.tag.withoutIcon.large.paddingRight
7789
+ }
7790
+ },
7791
+ withIcon: {
7792
+ small: {
7793
+ paddingLeft: theme.tag.withIcon.small.paddingLeft,
7794
+ paddingRight: theme.tag.withIcon.small.paddingRight
7795
+ },
7796
+ medium: {
7797
+ paddingLeft: theme.tag.withIcon.medium.paddingLeft,
7798
+ paddingRight: theme.tag.withIcon.medium.paddingRight
7799
+ },
7800
+ large: {
7801
+ paddingLeft: theme.tag.withIcon.large.paddingLeft,
7802
+ paddingRight: theme.tag.withIcon.large.paddingRight
7803
+ }
7804
+ }
7820
7805
  },
7821
7806
  tooltip: {
7822
7807
  horizontalPadding: theme.tooltip.horizontalPadding,
@@ -9746,48 +9731,68 @@ const StoryGrid = {
9746
9731
  Col: StoryGridCol
9747
9732
  };
9748
9733
 
9749
- const getLabelColor = (type, variant) => {
9734
+ function useKittTheme() {
9735
+ return react.useMemo(() => {
9736
+ return {
9737
+ kitt: theme
9738
+ };
9739
+ }, []);
9740
+ }
9741
+
9742
+ const getTypography = size => {
9743
+ switch (size) {
9744
+ case 'small':
9745
+ return 'body-xs';
9746
+ case 'medium':
9747
+ return 'body-s';
9748
+ case 'large':
9749
+ default:
9750
+ return 'body-m';
9751
+ }
9752
+ };
9753
+ const typeToColor = (color, type) => {
9754
+ if (color) return color;
9750
9755
  switch (type) {
9751
- case 'danger':
9752
- {
9753
- return variant === 'outline' ? 'danger' : 'black';
9754
- }
9755
- case 'warn':
9756
- {
9757
- return variant === 'outline' ? 'warning' : 'black';
9758
- }
9759
9756
  case 'primary':
9760
- {
9761
- return 'primary';
9762
- }
9757
+ return 'violine';
9758
+ case 'warn':
9759
+ return 'sun';
9760
+ case 'danger':
9761
+ return 'coral';
9763
9762
  case 'default':
9764
- {
9765
- return 'black';
9766
- }
9767
9763
  default:
9768
- {
9769
- return 'black';
9770
- }
9764
+ return 'eggshell';
9771
9765
  }
9772
9766
  };
9773
9767
  function Tag({
9774
9768
  label,
9775
- type = 'default',
9769
+ icon,
9770
+ color,
9771
+ type,
9772
+ size = 'medium',
9776
9773
  variant = 'fill'
9777
9774
  }) {
9778
- return /*#__PURE__*/jsxRuntime.jsx(View, {
9775
+ const kittTheme = useKittTheme();
9776
+ const tagColor = typeToColor(color, type);
9777
+ return /*#__PURE__*/jsxRuntime.jsxs(HStack, {
9779
9778
  alignSelf: "flex-start",
9780
9779
  borderRadius: "kitt.tag.borderRadius",
9781
- paddingX: "kitt.tag.horizontalPadding",
9782
- paddingY: "kitt.tag.verticalPadding",
9783
- backgroundColor: `kitt.tag.${type}.${variant}.backgroundColor`,
9784
- borderColor: `kitt.tag.${type}.${variant}.borderColor`,
9785
- borderWidth: `kitt.tag.${type}.${variant}.borderWidth`,
9786
- children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
9787
- base: "body-xsmall",
9788
- color: getLabelColor(type, variant),
9780
+ height: `kitt.tag.${icon ? 'withIcon' : 'withoutIcon'}.${size}.height`,
9781
+ paddingLeft: `kitt.tag.${icon ? 'withIcon' : 'withoutIcon'}.${size}.paddingLeft`,
9782
+ paddingRight: `kitt.tag.${icon ? 'withIcon' : 'withoutIcon'}.${size}.paddingRight`,
9783
+ backgroundColor: variant === 'fill' ? kittTheme.kitt.palettes.lateOcean[`${tagColor}.4`] : 'kitt.transparent',
9784
+ borderColor: kittTheme.kitt.palettes.lateOcean[`${tagColor}.6`],
9785
+ borderWidth: `kitt.tag.${variant}.borderWidth`,
9786
+ space: "kitt.1",
9787
+ alignItems: "center",
9788
+ children: [icon ? /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
9789
+ icon: icon,
9790
+ size: `kitt.tag.${size}.iconSize`
9791
+ }) : null, /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
9792
+ base: getTypography(size),
9793
+ color: "black",
9789
9794
  children: label
9790
- })
9795
+ })]
9791
9796
  });
9792
9797
  }
9793
9798
 
@@ -10325,14 +10330,6 @@ function TypographyLink({
10325
10330
  });
10326
10331
  }
10327
10332
 
10328
- function useKittTheme() {
10329
- return react.useMemo(() => {
10330
- return {
10331
- kitt: theme
10332
- };
10333
- }, []);
10334
- }
10335
-
10336
10333
  function KittThemeProvider({
10337
10334
  isSSR,
10338
10335
  children,