@ornikar/kitt-universal 3.3.0 → 3.4.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.
- package/dist/definitions/IconButton/PressableIconButton.d.ts.map +1 -1
- package/dist/definitions/typography/Typography.d.ts +2 -0
- package/dist/definitions/typography/Typography.d.ts.map +1 -1
- package/dist/definitions/typography/TypographyLink.d.ts.map +1 -1
- package/dist/index-browser-all.es.android.js +41 -22
- package/dist/index-browser-all.es.android.js.map +1 -1
- package/dist/index-browser-all.es.css +2 -2
- package/dist/index-browser-all.es.ios.js +41 -22
- package/dist/index-browser-all.es.ios.js.map +1 -1
- package/dist/index-browser-all.es.js +80 -54
- package/dist/index-browser-all.es.js.map +1 -1
- package/dist/index-browser-all.es.web.js +80 -54
- package/dist/index-browser-all.es.web.js.map +1 -1
- package/dist/index-node-14.17.cjs.css +2 -2
- package/dist/index-node-14.17.cjs.js +48 -19
- package/dist/index-node-14.17.cjs.js.map +1 -1
- package/dist/index-node-14.17.cjs.web.css +2 -2
- package/dist/index-node-14.17.cjs.web.js +48 -19
- package/dist/index-node-14.17.cjs.web.js.map +1 -1
- package/dist/styles.css +2 -2
- package/dist/tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -194,34 +194,53 @@ function useTypographyTypeForCurrentWindowSize(base, small, medium, large) {
|
|
|
194
194
|
if (small && width >= KittBreakpoints.SMALL) return small;
|
|
195
195
|
return base;
|
|
196
196
|
}
|
|
197
|
-
function
|
|
198
|
-
var
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
197
|
+
function getTypographyInheritedOrDefaultValuesBasedOnExistingAncestors(hasTypographyAncestor, _ref3) {
|
|
198
|
+
var base = _ref3.base,
|
|
199
|
+
color = _ref3.color;
|
|
200
|
+
// return the props set or undefined. In case of undefined, the value will be inherited from its parents.
|
|
201
|
+
if (hasTypographyAncestor) return {
|
|
202
|
+
base: base,
|
|
203
|
+
color: color
|
|
204
|
+
};
|
|
205
|
+
return {
|
|
206
|
+
base: base !== null && base !== void 0 ? base : 'body',
|
|
207
|
+
color: color !== null && color !== void 0 ? color : 'black'
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
function Typography(_ref4) {
|
|
211
|
+
var accessibilityRole = _ref4.accessibilityRole,
|
|
212
|
+
base = _ref4.base,
|
|
213
|
+
small = _ref4.small,
|
|
214
|
+
medium = _ref4.medium,
|
|
215
|
+
large = _ref4.large,
|
|
216
|
+
variant = _ref4.variant,
|
|
217
|
+
color = _ref4.color,
|
|
218
|
+
otherProps = _objectWithoutProperties(_ref4, _excluded$d);
|
|
206
219
|
|
|
207
220
|
var isHeaderTypographyInContext = useContext(IsHeaderTypographyContext);
|
|
208
|
-
var
|
|
209
|
-
var isHeader = isTypographyHeader(typeForCurrentWindowSize, isHeaderTypographyInContext);
|
|
210
|
-
var nonNullableVariant = variant !== null && variant !== void 0 ? variant : isHeader ? 'bold' : 'regular'; // if isHeaderTypographyInContext exists, it means we are inside another typography so we don't want to
|
|
211
|
-
// redefine the color, just inherit from it
|
|
221
|
+
var hasTypographyAncestor = isHeaderTypographyInContext !== undefined;
|
|
212
222
|
|
|
213
|
-
var
|
|
214
|
-
|
|
223
|
+
var _getTypographyInherit = getTypographyInheritedOrDefaultValuesBasedOnExistingAncestors(hasTypographyAncestor, {
|
|
224
|
+
base: base,
|
|
225
|
+
color: color
|
|
226
|
+
}),
|
|
227
|
+
baseOrDefaultToBody = _getTypographyInherit.base,
|
|
228
|
+
colorOrDefaultToBlack = _getTypographyInherit.color;
|
|
229
|
+
|
|
230
|
+
var typeForCurrentWindowSize = useTypographyTypeForCurrentWindowSize(baseOrDefaultToBody, small, medium, large);
|
|
231
|
+
var isHeader = isTypographyHeader(typeForCurrentWindowSize, isHeaderTypographyInContext);
|
|
232
|
+
var nonNullableVariant = variant !== null && variant !== void 0 ? variant : isHeader ? 'bold' : 'regular';
|
|
233
|
+
var content = baseOrDefaultToBody ? /*#__PURE__*/jsx(IsHeaderTypographyContext.Provider, {
|
|
215
234
|
value: isHeader,
|
|
216
235
|
children: /*#__PURE__*/jsx(StyledTypography, _objectSpread$h({
|
|
217
|
-
$color:
|
|
236
|
+
$color: colorOrDefaultToBlack,
|
|
218
237
|
$isHeader: isHeader,
|
|
219
238
|
$typeForCurrentWindowSize: typeForCurrentWindowSize,
|
|
220
239
|
$variant: nonNullableVariant,
|
|
221
240
|
accessibilityRole: accessibilityRole || undefined
|
|
222
241
|
}, otherProps))
|
|
223
242
|
}) : /*#__PURE__*/jsx(StyledTypography, _objectSpread$h({
|
|
224
|
-
$color:
|
|
243
|
+
$color: colorOrDefaultToBlack,
|
|
225
244
|
$isHeader: isHeader,
|
|
226
245
|
$variant: nonNullableVariant,
|
|
227
246
|
accessibilityRole: accessibilityRole || undefined
|
|
@@ -1460,29 +1479,30 @@ var PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/styled$1("div")({
|
|
|
1460
1479
|
return theme.kitt.iconButton.scale.base.active;
|
|
1461
1480
|
}],
|
|
1462
1481
|
"p1nlccvg-4": [function (_ref5) {
|
|
1463
|
-
var theme = _ref5.theme
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
return
|
|
1482
|
+
var theme = _ref5.theme,
|
|
1483
|
+
$isWhite = _ref5.$isWhite;
|
|
1484
|
+
var _theme$kitt$iconButto = theme.kitt.iconButton,
|
|
1485
|
+
white = _theme$kitt$iconButto.white,
|
|
1486
|
+
defaultIconButton = _theme$kitt$iconButto["default"];
|
|
1487
|
+
if ($isWhite) return white.pressedBackgroundColor;
|
|
1488
|
+
return defaultIconButton.pressedBackgroundColor;
|
|
1469
1489
|
}]
|
|
1470
1490
|
}
|
|
1471
1491
|
}));
|
|
1472
1492
|
var StyledPressableIconButton = /*#__PURE__*/styled.Pressable.withConfig({
|
|
1473
1493
|
displayName: "PressableIconButton__StyledPressableIconButton"
|
|
1474
|
-
})(["border-radius:", "px;width:", "px;height:", "px;align-items:center;justify-content:center;position:relative;background-color:transparent;", ";"], function (
|
|
1475
|
-
var theme =
|
|
1494
|
+
})(["border-radius:", "px;width:", "px;height:", "px;align-items:center;justify-content:center;position:relative;background-color:transparent;", ";"], function (_ref6) {
|
|
1495
|
+
var theme = _ref6.theme;
|
|
1476
1496
|
return theme.kitt.iconButton.borderRadius;
|
|
1497
|
+
}, function (_ref7) {
|
|
1498
|
+
var theme = _ref7.theme;
|
|
1499
|
+
return theme.kitt.iconButton.width;
|
|
1477
1500
|
}, function (_ref8) {
|
|
1478
1501
|
var theme = _ref8.theme;
|
|
1479
|
-
return theme.kitt.iconButton.width;
|
|
1480
|
-
}, function (_ref9) {
|
|
1481
|
-
var theme = _ref9.theme;
|
|
1482
1502
|
return theme.kitt.iconButton.height;
|
|
1483
|
-
}, function (
|
|
1484
|
-
var theme =
|
|
1485
|
-
disabled =
|
|
1503
|
+
}, function (_ref9) {
|
|
1504
|
+
var theme = _ref9.theme,
|
|
1505
|
+
disabled = _ref9.disabled;
|
|
1486
1506
|
var iconButton = theme.kitt.iconButton;
|
|
1487
1507
|
|
|
1488
1508
|
if (Platform.OS !== 'web') {
|
|
@@ -1497,13 +1517,13 @@ var StyledPressableIconButton = /*#__PURE__*/styled.Pressable.withConfig({
|
|
|
1497
1517
|
|
|
1498
1518
|
return "\n transition: ".concat(transition.property, " ").concat(transition.duration, " ").concat(transition.timingFunction, ";\n ");
|
|
1499
1519
|
});
|
|
1500
|
-
function PressableIconButton(
|
|
1501
|
-
var color =
|
|
1502
|
-
props = _objectWithoutProperties(
|
|
1520
|
+
function PressableIconButton(_ref10) {
|
|
1521
|
+
var color = _ref10.color,
|
|
1522
|
+
props = _objectWithoutProperties(_ref10, _excluded$6);
|
|
1503
1523
|
|
|
1504
1524
|
return /*#__PURE__*/jsx(StyleWebWrapper, {
|
|
1505
1525
|
as: PressableIconButtonWebWrapper,
|
|
1506
|
-
|
|
1526
|
+
$isWhite: color === 'white',
|
|
1507
1527
|
children: /*#__PURE__*/jsx(StyledPressableIconButton, _objectSpread$8({}, props))
|
|
1508
1528
|
});
|
|
1509
1529
|
}
|
|
@@ -3375,40 +3395,46 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
3375
3395
|
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; }
|
|
3376
3396
|
var TypographyLinkWebWrapper = withTheme( /*#__PURE__*/styled$1("span")({
|
|
3377
3397
|
name: "TypographyLinkWebWrapper",
|
|
3378
|
-
"class": "tcwz3nt"
|
|
3398
|
+
"class": "tcwz3nt",
|
|
3399
|
+
vars: {
|
|
3400
|
+
"tcwz3nt-0": [function (_ref) {
|
|
3401
|
+
var $hasNoUnderline = _ref.$hasNoUnderline;
|
|
3402
|
+
return $hasNoUnderline ? 'underline' : 'none';
|
|
3403
|
+
}]
|
|
3404
|
+
}
|
|
3379
3405
|
}));
|
|
3380
3406
|
var StyledLink = /*#__PURE__*/styled.Text.withConfig({
|
|
3381
3407
|
displayName: "TypographyLink__StyledLink"
|
|
3382
|
-
})(["text-decoration:", ";", ";", ";"], function (
|
|
3383
|
-
var $
|
|
3384
|
-
return $
|
|
3385
|
-
}, function (
|
|
3386
|
-
var $disabled =
|
|
3408
|
+
})(["text-decoration:", ";", ";", ";"], function (_ref2) {
|
|
3409
|
+
var $hasNoUnderline = _ref2.$hasNoUnderline;
|
|
3410
|
+
return $hasNoUnderline ? 'none' : 'underline';
|
|
3411
|
+
}, function (_ref3) {
|
|
3412
|
+
var $disabled = _ref3.$disabled;
|
|
3387
3413
|
if (Platform.OS !== 'web') return undefined;
|
|
3388
3414
|
return "\n text-decoration-color: inherit;\n transition: color 0.2s ease-in-out;\n cursor: ".concat($disabled ? 'not-allowed' : 'pointer', ";\n ");
|
|
3389
|
-
}, function (
|
|
3390
|
-
var $disabled =
|
|
3391
|
-
theme =
|
|
3415
|
+
}, function (_ref4) {
|
|
3416
|
+
var $disabled = _ref4.$disabled,
|
|
3417
|
+
theme = _ref4.theme;
|
|
3392
3418
|
if (!$disabled) return undefined;
|
|
3393
3419
|
return "color: ".concat(theme.kitt.typography.link.disabledColor, ";");
|
|
3394
3420
|
});
|
|
3395
|
-
function TypographyLink(
|
|
3396
|
-
var children =
|
|
3397
|
-
disabled =
|
|
3398
|
-
noUnderline =
|
|
3399
|
-
href =
|
|
3400
|
-
hrefAttrs =
|
|
3401
|
-
onPress =
|
|
3402
|
-
otherProps = _objectWithoutProperties(
|
|
3421
|
+
function TypographyLink(_ref5) {
|
|
3422
|
+
var children = _ref5.children,
|
|
3423
|
+
disabled = _ref5.disabled,
|
|
3424
|
+
noUnderline = _ref5.noUnderline,
|
|
3425
|
+
href = _ref5.href,
|
|
3426
|
+
hrefAttrs = _ref5.hrefAttrs,
|
|
3427
|
+
onPress = _ref5.onPress,
|
|
3428
|
+
otherProps = _objectWithoutProperties(_ref5, _excluded$1);
|
|
3403
3429
|
|
|
3404
3430
|
return /*#__PURE__*/jsx(Typography, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
3405
3431
|
accessibilityRole: "none",
|
|
3406
3432
|
children: /*#__PURE__*/jsx(StyleWebWrapper, {
|
|
3407
3433
|
as: TypographyLinkWebWrapper,
|
|
3408
|
-
|
|
3434
|
+
$hasNoUnderline: noUnderline,
|
|
3409
3435
|
children: /*#__PURE__*/jsx(StyledLink, {
|
|
3410
3436
|
$disabled: disabled,
|
|
3411
|
-
$
|
|
3437
|
+
$hasNoUnderline: noUnderline,
|
|
3412
3438
|
href: href,
|
|
3413
3439
|
hrefAttrs: hrefAttrs,
|
|
3414
3440
|
accessibilityRole: "link",
|