@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
@@ -1635,57 +1635,51 @@ const skeleton = {
1635
1635
  };
1636
1636
 
1637
1637
  const tag = {
1638
- borderRadius: 10,
1639
- padding: '2px 12px',
1640
- verticalPadding: 2,
1641
- horizontalPadding: 12,
1642
- primary: {
1643
- fill: {
1644
- backgroundColor: lateOceanColorPalette.moonPurpleLight1,
1645
- borderWidth: 0,
1646
- borderColor: colors.transparent
1647
- },
1648
- outline: {
1649
- backgroundColor: colors.transparent,
1650
- borderWidth: 1,
1651
- borderColor: colors.primary
1652
- }
1638
+ borderRadius: 16,
1639
+ icon: {
1640
+ small: 16,
1641
+ medium: 16,
1642
+ large: 20
1653
1643
  },
1654
- default: {
1655
- fill: {
1656
- backgroundColor: lateOceanColorPalette.black50,
1657
- borderWidth: 0,
1658
- borderColor: colors.transparent
1644
+ withIcon: {
1645
+ small: {
1646
+ paddingLeft: 2,
1647
+ paddingRight: 8,
1648
+ height: 20
1659
1649
  },
1660
- outline: {
1661
- backgroundColor: colors.transparent,
1662
- borderWidth: 1,
1663
- borderColor: colors.black
1664
- }
1665
- },
1666
- danger: {
1667
- fill: {
1668
- backgroundColor: colors.danger,
1669
- borderWidth: 0,
1670
- borderColor: colors.transparent
1650
+ medium: {
1651
+ paddingLeft: 4,
1652
+ paddingRight: 8,
1653
+ height: 24
1671
1654
  },
1672
- outline: {
1673
- backgroundColor: colors.transparent,
1674
- borderWidth: 1,
1675
- borderColor: colors.danger
1655
+ large: {
1656
+ paddingLeft: 6,
1657
+ paddingRight: 8,
1658
+ height: 32
1676
1659
  }
1677
1660
  },
1678
- warn: {
1679
- fill: {
1680
- backgroundColor: colors.warning,
1681
- borderWidth: 0,
1682
- borderColor: colors.transparent
1661
+ withoutIcon: {
1662
+ small: {
1663
+ paddingLeft: 8,
1664
+ paddingRight: 8,
1665
+ height: 20
1683
1666
  },
1684
- outline: {
1685
- backgroundColor: colors.transparent,
1686
- borderWidth: 1,
1687
- borderColor: colors.warning
1667
+ medium: {
1668
+ paddingLeft: 8,
1669
+ paddingRight: 8,
1670
+ height: 22
1671
+ },
1672
+ large: {
1673
+ paddingLeft: 8,
1674
+ paddingRight: 8,
1675
+ height: 28
1688
1676
  }
1677
+ },
1678
+ fill: {
1679
+ borderWidth: 0
1680
+ },
1681
+ outline: {
1682
+ borderWidth: 1
1689
1683
  }
1690
1684
  };
1691
1685
 
@@ -7708,48 +7702,6 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
7708
7702
  }
7709
7703
  }
7710
7704
  },
7711
- tag: {
7712
- primary: {
7713
- fill: {
7714
- backgroundColor: theme.tag.primary.fill.backgroundColor,
7715
- borderColor: theme.tag.primary.fill.borderColor
7716
- },
7717
- outline: {
7718
- backgroundColor: theme.tag.primary.outline.backgroundColor,
7719
- borderColor: theme.tag.primary.outline.borderColor
7720
- }
7721
- },
7722
- default: {
7723
- fill: {
7724
- backgroundColor: theme.tag.default.fill.backgroundColor,
7725
- borderColor: theme.tag.default.fill.borderColor
7726
- },
7727
- outline: {
7728
- backgroundColor: theme.tag.default.outline.backgroundColor,
7729
- borderColor: theme.tag.default.outline.borderColor
7730
- }
7731
- },
7732
- danger: {
7733
- fill: {
7734
- backgroundColor: theme.tag.danger.fill.backgroundColor,
7735
- borderColor: theme.tag.danger.fill.borderColor
7736
- },
7737
- outline: {
7738
- backgroundColor: theme.tag.danger.outline.backgroundColor,
7739
- borderColor: theme.tag.danger.outline.borderColor
7740
- }
7741
- },
7742
- warn: {
7743
- fill: {
7744
- backgroundColor: theme.tag.warn.fill.backgroundColor,
7745
- borderColor: theme.tag.warn.fill.borderColor
7746
- },
7747
- outline: {
7748
- backgroundColor: theme.tag.warn.outline.backgroundColor,
7749
- borderColor: theme.tag.warn.outline.borderColor
7750
- }
7751
- }
7752
- },
7753
7705
  tooltip: {
7754
7706
  backgroundColor: theme.tooltip.backgroundColor
7755
7707
  },
@@ -8238,37 +8190,11 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
8238
8190
  borderWidth: theme.listItem.borderWidth
8239
8191
  },
8240
8192
  tag: {
8241
- primary: {
8242
- fill: {
8243
- borderWidth: theme.tag.primary.fill.borderWidth
8244
- },
8245
- outline: {
8246
- borderWidth: theme.tag.primary.outline.borderWidth
8247
- }
8248
- },
8249
- default: {
8250
- fill: {
8251
- borderWidth: theme.tag.default.fill.borderWidth
8252
- },
8253
- outline: {
8254
- borderWidth: theme.tag.default.outline.borderWidth
8255
- }
8193
+ fill: {
8194
+ borderWidth: theme.tag.fill.borderWidth
8256
8195
  },
8257
- danger: {
8258
- fill: {
8259
- borderWidth: theme.tag.danger.fill.borderWidth
8260
- },
8261
- outline: {
8262
- borderWidth: theme.tag.danger.outline.borderWidth
8263
- }
8264
- },
8265
- warn: {
8266
- fill: {
8267
- borderWidth: theme.tag.warn.fill.borderWidth
8268
- },
8269
- outline: {
8270
- borderWidth: theme.tag.warn.outline.borderWidth
8271
- }
8196
+ outline: {
8197
+ borderWidth: theme.tag.outline.borderWidth
8272
8198
  }
8273
8199
  }
8274
8200
  },
@@ -8366,6 +8292,39 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
8366
8292
  pageLoader: {
8367
8293
  size: theme.pageLoader.size
8368
8294
  },
8295
+ tag: {
8296
+ small: {
8297
+ iconSize: theme.tag.icon.small
8298
+ },
8299
+ medium: {
8300
+ iconSize: theme.tag.icon.medium
8301
+ },
8302
+ large: {
8303
+ iconSize: theme.tag.icon.large
8304
+ },
8305
+ withIcon: {
8306
+ small: {
8307
+ height: theme.tag.withIcon.small.height
8308
+ },
8309
+ medium: {
8310
+ height: theme.tag.withIcon.medium.height
8311
+ },
8312
+ large: {
8313
+ height: theme.tag.withIcon.large.height
8314
+ }
8315
+ },
8316
+ withoutIcon: {
8317
+ small: {
8318
+ height: theme.tag.withoutIcon.small.height
8319
+ },
8320
+ medium: {
8321
+ height: theme.tag.withoutIcon.medium.height
8322
+ },
8323
+ large: {
8324
+ height: theme.tag.withoutIcon.large.height
8325
+ }
8326
+ }
8327
+ },
8369
8328
  tooltip: {
8370
8329
  maxWidth: theme.tooltip.maxWidth,
8371
8330
  arrow: {
@@ -8458,8 +8417,34 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
8458
8417
  horizontalPadding: theme.listItem.horizontalPadding
8459
8418
  },
8460
8419
  tag: {
8461
- verticalPadding: theme.tag.verticalPadding,
8462
- horizontalPadding: theme.tag.horizontalPadding
8420
+ withoutIcon: {
8421
+ small: {
8422
+ paddingLeft: theme.tag.withoutIcon.small.paddingLeft,
8423
+ paddingRight: theme.tag.withoutIcon.small.paddingRight
8424
+ },
8425
+ medium: {
8426
+ paddingLeft: theme.tag.withoutIcon.medium.paddingLeft,
8427
+ paddingRight: theme.tag.withoutIcon.medium.paddingRight
8428
+ },
8429
+ large: {
8430
+ paddingLeft: theme.tag.withoutIcon.large.paddingLeft,
8431
+ paddingRight: theme.tag.withoutIcon.large.paddingRight
8432
+ }
8433
+ },
8434
+ withIcon: {
8435
+ small: {
8436
+ paddingLeft: theme.tag.withIcon.small.paddingLeft,
8437
+ paddingRight: theme.tag.withIcon.small.paddingRight
8438
+ },
8439
+ medium: {
8440
+ paddingLeft: theme.tag.withIcon.medium.paddingLeft,
8441
+ paddingRight: theme.tag.withIcon.medium.paddingRight
8442
+ },
8443
+ large: {
8444
+ paddingLeft: theme.tag.withIcon.large.paddingLeft,
8445
+ paddingRight: theme.tag.withIcon.large.paddingRight
8446
+ }
8447
+ }
8463
8448
  },
8464
8449
  tooltip: {
8465
8450
  horizontalPadding: theme.tooltip.horizontalPadding,
@@ -10440,48 +10425,68 @@ const StoryGrid = {
10440
10425
  Col: StoryGridCol
10441
10426
  };
10442
10427
 
10443
- const getLabelColor = (type, variant) => {
10428
+ function useKittTheme() {
10429
+ return useMemo(() => {
10430
+ return {
10431
+ kitt: theme
10432
+ };
10433
+ }, []);
10434
+ }
10435
+
10436
+ const getTypography = size => {
10437
+ switch (size) {
10438
+ case 'small':
10439
+ return 'body-xs';
10440
+ case 'medium':
10441
+ return 'body-s';
10442
+ case 'large':
10443
+ default:
10444
+ return 'body-m';
10445
+ }
10446
+ };
10447
+ const typeToColor = (color, type) => {
10448
+ if (color) return color;
10444
10449
  switch (type) {
10445
- case 'danger':
10446
- {
10447
- return variant === 'outline' ? 'danger' : 'black';
10448
- }
10449
- case 'warn':
10450
- {
10451
- return variant === 'outline' ? 'warning' : 'black';
10452
- }
10453
10450
  case 'primary':
10454
- {
10455
- return 'primary';
10456
- }
10451
+ return 'violine';
10452
+ case 'warn':
10453
+ return 'sun';
10454
+ case 'danger':
10455
+ return 'coral';
10457
10456
  case 'default':
10458
- {
10459
- return 'black';
10460
- }
10461
10457
  default:
10462
- {
10463
- return 'black';
10464
- }
10458
+ return 'eggshell';
10465
10459
  }
10466
10460
  };
10467
10461
  function Tag({
10468
10462
  label,
10469
- type = 'default',
10463
+ icon,
10464
+ color,
10465
+ type,
10466
+ size = 'medium',
10470
10467
  variant = 'fill'
10471
10468
  }) {
10472
- return /*#__PURE__*/jsx(View, {
10469
+ const kittTheme = useKittTheme();
10470
+ const tagColor = typeToColor(color, type);
10471
+ return /*#__PURE__*/jsxs(HStack, {
10473
10472
  alignSelf: "flex-start",
10474
10473
  borderRadius: "kitt.tag.borderRadius",
10475
- paddingX: "kitt.tag.horizontalPadding",
10476
- paddingY: "kitt.tag.verticalPadding",
10477
- backgroundColor: `kitt.tag.${type}.${variant}.backgroundColor`,
10478
- borderColor: `kitt.tag.${type}.${variant}.borderColor`,
10479
- borderWidth: `kitt.tag.${type}.${variant}.borderWidth`,
10480
- children: /*#__PURE__*/jsx(Typography.Text, {
10481
- base: "body-xsmall",
10482
- color: getLabelColor(type, variant),
10474
+ height: `kitt.tag.${icon ? 'withIcon' : 'withoutIcon'}.${size}.height`,
10475
+ paddingLeft: `kitt.tag.${icon ? 'withIcon' : 'withoutIcon'}.${size}.paddingLeft`,
10476
+ paddingRight: `kitt.tag.${icon ? 'withIcon' : 'withoutIcon'}.${size}.paddingRight`,
10477
+ backgroundColor: variant === 'fill' ? kittTheme.kitt.palettes.lateOcean[`${tagColor}.4`] : 'kitt.transparent',
10478
+ borderColor: kittTheme.kitt.palettes.lateOcean[`${tagColor}.6`],
10479
+ borderWidth: `kitt.tag.${variant}.borderWidth`,
10480
+ space: "kitt.1",
10481
+ alignItems: "center",
10482
+ children: [icon ? /*#__PURE__*/jsx(TypographyIcon, {
10483
+ icon: icon,
10484
+ size: `kitt.tag.${size}.iconSize`
10485
+ }) : null, /*#__PURE__*/jsx(Typography.Text, {
10486
+ base: getTypography(size),
10487
+ color: "black",
10483
10488
  children: label
10484
- })
10489
+ })]
10485
10490
  });
10486
10491
  }
10487
10492
 
@@ -11049,14 +11054,6 @@ function TypographyLink({
11049
11054
  });
11050
11055
  }
11051
11056
 
11052
- function useKittTheme() {
11053
- return useMemo(() => {
11054
- return {
11055
- kitt: theme
11056
- };
11057
- }, []);
11058
- }
11059
-
11060
11057
  function KittThemeProvider({
11061
11058
  isSSR,
11062
11059
  children,