@ornikar/kitt-universal 1.1.0 → 2.2.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 (34) hide show
  1. package/dist/definitions/Button/Button.d.ts +1 -1
  2. package/dist/definitions/Button/Button.d.ts.map +1 -1
  3. package/dist/definitions/IconButton/PressableAnimatedContainer.d.ts +2 -4
  4. package/dist/definitions/IconButton/PressableAnimatedContainer.d.ts.map +1 -1
  5. package/dist/definitions/IconButton/PressableAnimatedContainer.web.d.ts +4 -0
  6. package/dist/definitions/IconButton/PressableAnimatedContainer.web.d.ts.map +1 -0
  7. package/dist/definitions/Tag/Tag.d.ts +6 -3
  8. package/dist/definitions/Tag/Tag.d.ts.map +1 -1
  9. package/dist/definitions/primitives/PrimitivePressable.d.ts +1 -1
  10. package/dist/definitions/primitives/PrimitivePressable.d.ts.map +1 -1
  11. package/dist/definitions/themes/default.d.ts +33 -9
  12. package/dist/definitions/themes/default.d.ts.map +1 -1
  13. package/dist/definitions/themes/late-ocean/colorsLateOceanTheme.d.ts +1 -0
  14. package/dist/definitions/themes/late-ocean/colorsLateOceanTheme.d.ts.map +1 -1
  15. package/dist/definitions/themes/late-ocean/tagLateOceanTheme.d.ts +30 -3
  16. package/dist/definitions/themes/late-ocean/tagLateOceanTheme.d.ts.map +1 -1
  17. package/dist/definitions/themes/late-ocean/typographyLateOceanTheme.d.ts +0 -6
  18. package/dist/definitions/themes/late-ocean/typographyLateOceanTheme.d.ts.map +1 -1
  19. package/dist/definitions/themes/palettes/lateOceanColorPalette.d.ts +2 -0
  20. package/dist/definitions/themes/palettes/lateOceanColorPalette.d.ts.map +1 -1
  21. package/dist/definitions/typography/Typography.d.ts +2 -2
  22. package/dist/definitions/typography/Typography.d.ts.map +1 -1
  23. package/dist/index-browser-all.es.android.js +113 -56
  24. package/dist/index-browser-all.es.android.js.map +1 -1
  25. package/dist/index-browser-all.es.ios.js +113 -56
  26. package/dist/index-browser-all.es.ios.js.map +1 -1
  27. package/dist/index-browser-all.es.js +113 -68
  28. package/dist/index-browser-all.es.js.map +1 -1
  29. package/dist/index-browser-all.es.web.js +98 -40
  30. package/dist/index-browser-all.es.web.js.map +1 -1
  31. package/dist/index-node-14.17.cjs.js +87 -46
  32. package/dist/index-node-14.17.cjs.js.map +1 -1
  33. package/dist/tsbuildinfo +1 -1
  34. package/package.json +7 -7
@@ -558,7 +558,7 @@ var getColorFromState = function (state) {
558
558
  return 'danger';
559
559
 
560
560
  default:
561
- return 'grey';
561
+ return 'black-light';
562
562
  }
563
563
  };
564
564
 
@@ -1136,51 +1136,37 @@ var PressableIconButton = /*#__PURE__*/styled(PrimitivePressable).withConfig({
1136
1136
  return "\n transition: ".concat(transition.property, " ").concat(transition.duration, " ").concat(transition.timingFunction, ";\n\n &:hover,\n .kitt-hover & {\n @media (hover: none) and (pointer: coarse) {\n transform: scale(").concat(scale.base.hover, ");\n }\n\n @media(").concat(theme.breakpoints.min.mediumBreakpoint, ") {\n transform: scale(").concat(scale.medium.hover, ");\n }\n }\n\n &:active,\n .kitt-active & {\n transform: scale(").concat(scale.base.active, ");\n }\n\n &:hover,\n .kitt-hover &,\n &:focus,\n .kitt-focus &,\n &:active,\n .kitt-active & {\n background-color: ").concat(color === 'white' ? iconButton.white.pressedBackgroundColor : iconButton["default"].pressedBackgroundColor, ";\n }\n ");
1137
1137
  });
1138
1138
 
1139
- function WebAnimatedContainer(_ref) {
1140
- var children = _ref.children,
1141
- color = _ref.color,
1142
- disabled = _ref.disabled,
1143
- onPress = _ref.onPress;
1144
- return /*#__PURE__*/React.createElement(PressableIconButton, {
1145
- accessibilityRole: "button",
1146
- color: color,
1147
- disabled: disabled,
1148
- onPress: onPress
1149
- }, children);
1150
- }
1151
-
1152
1139
  var AnimatedIconButtonBackground = /*#__PURE__*/styled(Animated$1.View).withConfig({
1153
1140
  displayName: "PressableAnimatedContainer__AnimatedIconButtonBackground",
1154
1141
  componentId: "kitt-universal__sc-xl9ll5-0"
1155
- })(["background-color:", ";border-radius:", "px;width:", "px;height:", "px;position:absolute;bottom:0;left:0;"], function (_ref2) {
1156
- var theme = _ref2.theme,
1157
- color = _ref2.color,
1158
- disabled = _ref2.disabled;
1142
+ })(["background-color:", ";border-radius:", "px;width:", "px;height:", "px;position:absolute;bottom:0;left:0;"], function (_ref) {
1143
+ var theme = _ref.theme,
1144
+ color = _ref.color,
1145
+ disabled = _ref.disabled;
1159
1146
  var iconButton = theme.kitt.iconButton;
1160
1147
  if (disabled) return iconButton.disabled.backgroundColor;
1161
1148
  if (color === 'white') return iconButton.white.pressedBackgroundColor;
1162
1149
  return iconButton["default"].pressedBackgroundColor;
1150
+ }, function (_ref2) {
1151
+ var theme = _ref2.theme;
1152
+ return theme.kitt.iconButton.borderRadius;
1163
1153
  }, function (_ref3) {
1164
1154
  var theme = _ref3.theme;
1165
- return theme.kitt.iconButton.borderRadius;
1155
+ return theme.kitt.iconButton.width;
1166
1156
  }, function (_ref4) {
1167
1157
  var theme = _ref4.theme;
1168
- return theme.kitt.iconButton.width;
1169
- }, function (_ref5) {
1170
- var theme = _ref5.theme;
1171
1158
  return theme.kitt.iconButton.height;
1172
1159
  });
1173
1160
  var AnimatedViewContainer = /*#__PURE__*/styled(Animated$1.View).withConfig({
1174
1161
  displayName: "PressableAnimatedContainer__AnimatedViewContainer",
1175
1162
  componentId: "kitt-universal__sc-xl9ll5-1"
1176
1163
  })(["position:relative;align-items:center;justify-content:center;width:100%;height:100%;"]);
1177
-
1178
- function NativeAnimatedContainer(_ref6) {
1179
- var disabled = _ref6.disabled,
1180
- _ref6$color = _ref6.color,
1181
- color = _ref6$color === void 0 ? 'black' : _ref6$color,
1182
- children = _ref6.children,
1183
- onPress = _ref6.onPress;
1164
+ function PressableAnimatedContainer(_ref5) {
1165
+ var disabled = _ref5.disabled,
1166
+ _ref5$color = _ref5.color,
1167
+ color = _ref5$color === void 0 ? 'black' : _ref5$color,
1168
+ children = _ref5.children,
1169
+ onPress = _ref5.onPress;
1184
1170
  var theme = /*#__PURE__*/useTheme();
1185
1171
  var pressed = useSharedValue(false);
1186
1172
  var opacityStyles = useAnimatedStyle(function () {
@@ -1196,7 +1182,7 @@ function NativeAnimatedContainer(_ref6) {
1196
1182
  };
1197
1183
  _f.asString = "function _f(){const{withSpring,pressed}=jsThis._closure;{return{opacity:withSpring(pressed.value?1:0)};}}";
1198
1184
  _f.__workletHash = 10645190329247;
1199
- _f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (64:41)";
1185
+ _f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (55:41)";
1200
1186
  _f.__optimalization = 2;
1201
1187
 
1202
1188
  global.__reanimatedWorkletInit(_f);
@@ -1230,7 +1216,7 @@ function NativeAnimatedContainer(_ref6) {
1230
1216
  };
1231
1217
  _f.asString = "function _f(){const{withSpring,pressed,theme}=jsThis._closure;{return{transform:[{scale:withSpring(pressed.value?theme.kitt.iconButton.scale.base.active:theme.kitt.iconButton.scale.base.default)}]};}}";
1232
1218
  _f.__workletHash = 13861998831411;
1233
- _f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (70:39)";
1219
+ _f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (61:39)";
1234
1220
  _f.__optimalization = 2;
1235
1221
 
1236
1222
  global.__reanimatedWorkletInit(_f);
@@ -1263,8 +1249,6 @@ function NativeAnimatedContainer(_ref6) {
1263
1249
  }), children));
1264
1250
  }
1265
1251
 
1266
- var PressableAnimatedContainer = Platform.OS === 'web' ? WebAnimatedContainer : NativeAnimatedContainer;
1267
-
1268
1252
  var IconButtonContentBorder = /*#__PURE__*/styled(PrimitiveView).withConfig({
1269
1253
  displayName: "IconButton__IconButtonContentBorder",
1270
1254
  componentId: "kitt-universal__sc-swelbf-0"
@@ -1371,9 +1355,9 @@ function ListItemSideContent(_ref5) {
1371
1355
 
1372
1356
  var _excluded$3 = ["children", "withPadding", "borders", "left", "right", "onPress"];
1373
1357
 
1374
- function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
1358
+ function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1375
1359
 
1376
- function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
1360
+ function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1377
1361
  var ContainerView = /*#__PURE__*/styled(PrimitiveView).withConfig({
1378
1362
  displayName: "ListItem__ContainerView",
1379
1363
  componentId: "kitt-universal__sc-2afp9s-0"
@@ -1580,9 +1564,9 @@ function Message(_ref11) {
1580
1564
  })) : null);
1581
1565
  }
1582
1566
 
1583
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
1567
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
1584
1568
 
1585
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
1569
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
1586
1570
  var OverlayPressable = /*#__PURE__*/styled(PrimitivePressable).withConfig({
1587
1571
  displayName: "Overlay__OverlayPressable",
1588
1572
  componentId: "kitt-universal__sc-1cz1gbr-0"
@@ -2061,26 +2045,63 @@ var StoryGrid = {
2061
2045
  var Container = /*#__PURE__*/styled(PrimitiveView).withConfig({
2062
2046
  displayName: "Tag__Container",
2063
2047
  componentId: "kitt-universal__sc-19jmowi-0"
2064
- })(["background-color:", ";padding:", ";border-radius:", ";align-self:flex-start;"], function (_ref) {
2048
+ })(["background-color:", ";border-width:", ";border-color:", ";padding:", ";border-radius:", ";align-self:flex-start;"], function (_ref) {
2065
2049
  var theme = _ref.theme,
2066
- type = _ref.type;
2067
- return theme.kitt.tag[type].backgroundColor;
2050
+ type = _ref.type,
2051
+ variant = _ref.variant;
2052
+ return theme.kitt.tag[type][variant].backgroundColor;
2068
2053
  }, function (_ref2) {
2069
- var theme = _ref2.theme;
2070
- return theme.kitt.tag.padding;
2054
+ var theme = _ref2.theme,
2055
+ type = _ref2.type,
2056
+ variant = _ref2.variant;
2057
+ return theme.kitt.tag[type][variant].borderWidth;
2071
2058
  }, function (_ref3) {
2072
- var theme = _ref3.theme;
2059
+ var theme = _ref3.theme,
2060
+ type = _ref3.type,
2061
+ variant = _ref3.variant;
2062
+ return theme.kitt.tag[type][variant].borderColor;
2063
+ }, function (_ref4) {
2064
+ var theme = _ref4.theme;
2065
+ return theme.kitt.tag.padding;
2066
+ }, function (_ref5) {
2067
+ var theme = _ref5.theme;
2073
2068
  return theme.kitt.tag.borderRadius;
2074
2069
  });
2075
- function Tag(_ref4) {
2076
- var label = _ref4.label,
2077
- _ref4$type = _ref4.type,
2078
- type = _ref4$type === void 0 ? 'default' : _ref4$type;
2070
+ var getLabelColor = function (type, variant) {
2071
+ switch (type) {
2072
+ case 'danger':
2073
+ {
2074
+ return variant === 'outline' ? 'danger' : 'black';
2075
+ }
2076
+
2077
+ case 'primary':
2078
+ {
2079
+ return 'primary';
2080
+ }
2081
+
2082
+ case 'default':
2083
+ {
2084
+ return 'black';
2085
+ }
2086
+
2087
+ default:
2088
+ {
2089
+ return 'black';
2090
+ }
2091
+ }
2092
+ };
2093
+ function Tag(_ref6) {
2094
+ var label = _ref6.label,
2095
+ _ref6$type = _ref6.type,
2096
+ type = _ref6$type === void 0 ? 'default' : _ref6$type,
2097
+ _ref6$variant = _ref6.variant,
2098
+ variant = _ref6$variant === void 0 ? 'fill' : _ref6$variant;
2079
2099
  return /*#__PURE__*/React.createElement(Container, {
2080
- type: type
2100
+ type: type,
2101
+ variant: variant
2081
2102
  }, /*#__PURE__*/React.createElement(Typography.Text, {
2082
2103
  base: "body-xsmall",
2083
- color: type === 'primary' ? 'primary-light' : undefined
2104
+ color: getLabelColor(type, variant)
2084
2105
  }, label));
2085
2106
  }
2086
2107
 
@@ -2102,7 +2123,9 @@ var lateOceanColorPalette = {
2102
2123
  englishVermillon: '#D44148',
2103
2124
  goldCrayola: '#F8C583',
2104
2125
  aero: '#89BDDD',
2105
- transparent: 'transparent'
2126
+ transparent: 'transparent',
2127
+ moonPurple: '#DBD6F9',
2128
+ moonPurpleLight1: '#EDEBFC'
2106
2129
  };
2107
2130
 
2108
2131
  var avatarLateOceanTheme = {
@@ -2133,9 +2156,9 @@ var buttonLateOceanTheme = {
2133
2156
  disabledBorderColor: lateOceanColorPalette.black100
2134
2157
  },
2135
2158
  secondary: {
2136
- backgroundColor: lateOceanColorPalette.black50,
2159
+ backgroundColor: 'rgba(0, 0, 0, 0.05)',
2137
2160
  disabledBackgroundColor: lateOceanColorPalette.black50,
2138
- pressedBackgroundColor: lateOceanColorPalette.black100,
2161
+ pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
2139
2162
  disabledBorderColor: lateOceanColorPalette.black100
2140
2163
  },
2141
2164
  subtle: {
@@ -2180,6 +2203,7 @@ var cardLateOceanTheme = {
2180
2203
 
2181
2204
  var colorsLateOceanTheme = {
2182
2205
  primary: lateOceanColorPalette.lateOcean,
2206
+ primaryLight: lateOceanColorPalette.lateOceanLight1,
2183
2207
  accent: lateOceanColorPalette.warmEmbrace,
2184
2208
  accentLight: lateOceanColorPalette.warmEmbraceLight1,
2185
2209
  success: lateOceanColorPalette.viride,
@@ -2335,15 +2359,40 @@ var tagLateOceanTheme = {
2335
2359
  borderRadius: '10px',
2336
2360
  padding: '2px 12px',
2337
2361
  primary: {
2338
- // eslint-disable-next-line unicorn/expiring-todo-comments
2339
- // TODO: validate Moon shadow color with design team
2340
- backgroundColor: '#EDEBFC'
2362
+ fill: {
2363
+ backgroundColor: lateOceanColorPalette.moonPurpleLight1,
2364
+ borderWidth: '0',
2365
+ borderColor: lateOceanColorPalette.transparent
2366
+ },
2367
+ outline: {
2368
+ backgroundColor: lateOceanColorPalette.transparent,
2369
+ borderWidth: '1px',
2370
+ borderColor: lateOceanColorPalette.lateOcean
2371
+ }
2341
2372
  },
2342
2373
  "default": {
2343
- backgroundColor: lateOceanColorPalette.black50
2374
+ fill: {
2375
+ backgroundColor: lateOceanColorPalette.black50,
2376
+ borderWidth: '0',
2377
+ borderColor: lateOceanColorPalette.transparent
2378
+ },
2379
+ outline: {
2380
+ backgroundColor: lateOceanColorPalette.transparent,
2381
+ borderWidth: '1px',
2382
+ borderColor: lateOceanColorPalette.black1000
2383
+ }
2344
2384
  },
2345
2385
  danger: {
2346
- backgroundColor: lateOceanColorPalette.warmEmbrace
2386
+ fill: {
2387
+ backgroundColor: lateOceanColorPalette.warmEmbrace,
2388
+ borderWidth: '0',
2389
+ borderColor: lateOceanColorPalette.transparent
2390
+ },
2391
+ outline: {
2392
+ backgroundColor: lateOceanColorPalette.transparent,
2393
+ borderWidth: '1px',
2394
+ borderColor: colorsLateOceanTheme.danger
2395
+ }
2347
2396
  }
2348
2397
  };
2349
2398
 
@@ -2368,8 +2417,6 @@ var typographyLateOceanTheme = {
2368
2417
  colors: {
2369
2418
  black: lateOceanColorPalette.black1000,
2370
2419
  'black-light': lateOceanColorPalette.black555,
2371
- grey: lateOceanColorPalette.black555,
2372
- 'grey-light': lateOceanColorPalette.black200,
2373
2420
  white: lateOceanColorPalette.white,
2374
2421
  'white-light': lateOceanColorPalette.white,
2375
2422
  primary: lateOceanColorPalette.lateOcean,
@@ -2382,8 +2429,7 @@ var typographyLateOceanTheme = {
2382
2429
  headers: {
2383
2430
  fontFamily: {
2384
2431
  regular: Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold',
2385
- bold: Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold',
2386
- italic: Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold'
2432
+ bold: Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold'
2387
2433
  },
2388
2434
  fontWeight: 400,
2389
2435
  fontStyle: 'normal',
@@ -2403,18 +2449,15 @@ var typographyLateOceanTheme = {
2403
2449
  bodies: {
2404
2450
  fontFamily: {
2405
2451
  regular: Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans',
2406
- bold: Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans-Bold',
2407
- italic: Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans-Italic'
2452
+ bold: Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans-Bold'
2408
2453
  },
2409
2454
  fontWeight: {
2410
2455
  regular: 400,
2411
- bold: 700,
2412
- italic: 400
2456
+ bold: 700
2413
2457
  },
2414
2458
  fontStyle: {
2415
2459
  regular: 'normal',
2416
- bold: 'normal',
2417
- italic: 'italic'
2460
+ bold: 'normal'
2418
2461
  },
2419
2462
  configs: {
2420
2463
  'body-large': createTypographyTypeConfig(1.6, 18, 24),
@@ -2450,7 +2493,9 @@ var breakpoints = {
2450
2493
  largeBreakpoint: 'max-width: 1023px',
2451
2494
  wideBreakpoint: 'max-width: 1279px'
2452
2495
  }
2453
- };
2496
+ }; // eslint-disable-next-line unicorn/expiring-todo-comments
2497
+ // TODO : seperate brand color usage definition from proper theme definition and add typings - https://ornikar.atlassian.net/browse/CME-156
2498
+
2454
2499
  var theme = {
2455
2500
  spacing: 4,
2456
2501
  colors: colorsLateOceanTheme,