@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
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@media (hover:none) and (pointer:coarse){.p1nlccvg > *:hover,.kitt-hover .p1nlccvg > *{-webkit-transform:scale(var(--p1nlccvg-0));-ms-transform:scale(var(--p1nlccvg-0));transform:scale(var(--p1nlccvg-0));}}@media (var(--p1nlccvg-1)){.p1nlccvg > *:hover,.kitt-hover .p1nlccvg > *{-webkit-transform:scale(var(--p1nlccvg-2));-ms-transform:scale(var(--p1nlccvg-2));transform:scale(var(--p1nlccvg-2));}}.p1nlccvg > *:active,.kitt-active .p1nlccvg > *{-webkit-transform:scale(var(--p1nlccvg-3));-ms-transform:scale(var(--p1nlccvg-3));transform:scale(var(--p1nlccvg-3));}.p1nlccvg
|
|
2
|
-
.tcwz3nt > *:hover,.tcwz3nt > *:active,.kitt-hover .tcwz3nt > *{-webkit-text-decoration:none;text-decoration:none;}.tcwz3nt
|
|
1
|
+
@media (hover:none) and (pointer:coarse){.p1nlccvg > *:hover,.kitt-hover .p1nlccvg > *{-webkit-transform:scale(var(--p1nlccvg-0));-ms-transform:scale(var(--p1nlccvg-0));transform:scale(var(--p1nlccvg-0));}}@media (var(--p1nlccvg-1)){.p1nlccvg > *:hover,.kitt-hover .p1nlccvg > *{-webkit-transform:scale(var(--p1nlccvg-2));-ms-transform:scale(var(--p1nlccvg-2));transform:scale(var(--p1nlccvg-2));}}.p1nlccvg > *:active,.kitt-active .p1nlccvg > *{-webkit-transform:scale(var(--p1nlccvg-3));-ms-transform:scale(var(--p1nlccvg-3));transform:scale(var(--p1nlccvg-3));}.p1nlccvg,.p1nlccvg > [data-focusvisible-polyfill]{outline:none;}.p1nlccvg > *:hover,.kitt-hover .p1nlccvg > *,.p1nlccvg > *:focus,.kitt-focus .p1nlccvg > *,.p1nlccvg > [data-focusvisible-polyfill],.p1nlccvg > *:active,.kitt-active .p1nlccvg > *{background-color:var(--p1nlccvg-4);}
|
|
2
|
+
.tcwz3nt > *:hover,.tcwz3nt > *:active,.kitt-hover .tcwz3nt > *{-webkit-text-decoration:none;text-decoration:none;}.tcwz3nt > *:hover,.tcwz3nt > *:active,.kitt-hover .tcwz3nt > *{-webkit-text-decoration:var(--tcwz3nt-0);text-decoration:var(--tcwz3nt-0);}
|
|
@@ -204,6 +204,20 @@ function useTypographyTypeForCurrentWindowSize(base, small, medium, large) {
|
|
|
204
204
|
if (small && width >= KittBreakpoints.SMALL) return small;
|
|
205
205
|
return base;
|
|
206
206
|
}
|
|
207
|
+
function getTypographyInheritedOrDefaultValuesBasedOnExistingAncestors(hasTypographyAncestor, {
|
|
208
|
+
base,
|
|
209
|
+
color
|
|
210
|
+
}) {
|
|
211
|
+
// return the props set or undefined. In case of undefined, the value will be inherited from its parents.
|
|
212
|
+
if (hasTypographyAncestor) return {
|
|
213
|
+
base,
|
|
214
|
+
color
|
|
215
|
+
};
|
|
216
|
+
return {
|
|
217
|
+
base: base ?? 'body',
|
|
218
|
+
color: color ?? 'black'
|
|
219
|
+
};
|
|
220
|
+
}
|
|
207
221
|
function Typography({
|
|
208
222
|
accessibilityRole,
|
|
209
223
|
base,
|
|
@@ -215,16 +229,21 @@ function Typography({
|
|
|
215
229
|
...otherProps
|
|
216
230
|
}) {
|
|
217
231
|
const isHeaderTypographyInContext = react.useContext(IsHeaderTypographyContext);
|
|
218
|
-
const
|
|
232
|
+
const hasTypographyAncestor = isHeaderTypographyInContext !== undefined;
|
|
233
|
+
const {
|
|
234
|
+
base: baseOrDefaultToBody,
|
|
235
|
+
color: colorOrDefaultToBlack
|
|
236
|
+
} = getTypographyInheritedOrDefaultValuesBasedOnExistingAncestors(hasTypographyAncestor, {
|
|
237
|
+
base,
|
|
238
|
+
color
|
|
239
|
+
});
|
|
240
|
+
const typeForCurrentWindowSize = useTypographyTypeForCurrentWindowSize(baseOrDefaultToBody, small, medium, large);
|
|
219
241
|
const isHeader = isTypographyHeader(typeForCurrentWindowSize, isHeaderTypographyInContext);
|
|
220
|
-
const nonNullableVariant = variant ?? (isHeader ? 'bold' : 'regular');
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
const colorWithDefaultToBlack = color ?? (isHeaderTypographyInContext !== undefined ? undefined : 'black');
|
|
224
|
-
const content = base ? /*#__PURE__*/jsxRuntime.jsx(IsHeaderTypographyContext.Provider, {
|
|
242
|
+
const nonNullableVariant = variant ?? (isHeader ? 'bold' : 'regular');
|
|
243
|
+
const content = baseOrDefaultToBody ? /*#__PURE__*/jsxRuntime.jsx(IsHeaderTypographyContext.Provider, {
|
|
225
244
|
value: isHeader,
|
|
226
245
|
children: /*#__PURE__*/jsxRuntime.jsx(StyledTypography, {
|
|
227
|
-
$color:
|
|
246
|
+
$color: colorOrDefaultToBlack,
|
|
228
247
|
$isHeader: isHeader,
|
|
229
248
|
$typeForCurrentWindowSize: typeForCurrentWindowSize,
|
|
230
249
|
$variant: nonNullableVariant,
|
|
@@ -232,7 +251,7 @@ function Typography({
|
|
|
232
251
|
...otherProps
|
|
233
252
|
})
|
|
234
253
|
}) : /*#__PURE__*/jsxRuntime.jsx(StyledTypography, {
|
|
235
|
-
$color:
|
|
254
|
+
$color: colorOrDefaultToBlack,
|
|
236
255
|
$isHeader: isHeader,
|
|
237
256
|
$variant: nonNullableVariant,
|
|
238
257
|
accessibilityRole: accessibilityRole || undefined,
|
|
@@ -1390,11 +1409,16 @@ const PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/react$1.styled("di
|
|
|
1390
1409
|
theme
|
|
1391
1410
|
}) => theme.kitt.iconButton.scale.base.active],
|
|
1392
1411
|
"p1nlccvg-4": [({
|
|
1393
|
-
theme
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1412
|
+
theme,
|
|
1413
|
+
$isWhite
|
|
1414
|
+
}) => {
|
|
1415
|
+
const {
|
|
1416
|
+
white,
|
|
1417
|
+
default: defaultIconButton
|
|
1418
|
+
} = theme.kitt.iconButton;
|
|
1419
|
+
if ($isWhite) return white.pressedBackgroundColor;
|
|
1420
|
+
return defaultIconButton.pressedBackgroundColor;
|
|
1421
|
+
}]
|
|
1398
1422
|
}
|
|
1399
1423
|
}));
|
|
1400
1424
|
const StyledPressableIconButton = /*#__PURE__*/styled__default.Pressable.withConfig({
|
|
@@ -1438,7 +1462,7 @@ function PressableIconButton({
|
|
|
1438
1462
|
}) {
|
|
1439
1463
|
return /*#__PURE__*/jsxRuntime.jsx(StyleWebWrapper, {
|
|
1440
1464
|
as: PressableIconButtonWebWrapper,
|
|
1441
|
-
|
|
1465
|
+
$isWhite: color === 'white',
|
|
1442
1466
|
children: /*#__PURE__*/jsxRuntime.jsx(StyledPressableIconButton, { ...props
|
|
1443
1467
|
})
|
|
1444
1468
|
});
|
|
@@ -3249,14 +3273,19 @@ function TypographyEmoji({
|
|
|
3249
3273
|
|
|
3250
3274
|
const TypographyLinkWebWrapper = withTheme( /*#__PURE__*/react$1.styled("span")({
|
|
3251
3275
|
name: "TypographyLinkWebWrapper",
|
|
3252
|
-
class: "tcwz3nt"
|
|
3276
|
+
class: "tcwz3nt",
|
|
3277
|
+
vars: {
|
|
3278
|
+
"tcwz3nt-0": [({
|
|
3279
|
+
$hasNoUnderline
|
|
3280
|
+
}) => $hasNoUnderline ? 'underline' : 'none']
|
|
3281
|
+
}
|
|
3253
3282
|
}));
|
|
3254
3283
|
const StyledLink = /*#__PURE__*/styled__default.Text.withConfig({
|
|
3255
3284
|
displayName: "TypographyLink__StyledLink",
|
|
3256
3285
|
componentId: "kitt-universal__sc-1o1zy30-0"
|
|
3257
3286
|
})(["text-decoration:", ";", ";", ";"], ({
|
|
3258
|
-
$
|
|
3259
|
-
}) => $
|
|
3287
|
+
$hasNoUnderline
|
|
3288
|
+
}) => $hasNoUnderline ? 'none' : 'underline', ({
|
|
3260
3289
|
$disabled
|
|
3261
3290
|
}) => {
|
|
3262
3291
|
if (reactNative.Platform.OS !== 'web') return undefined;
|
|
@@ -3285,10 +3314,10 @@ function TypographyLink({
|
|
|
3285
3314
|
accessibilityRole: "none",
|
|
3286
3315
|
children: /*#__PURE__*/jsxRuntime.jsx(StyleWebWrapper, {
|
|
3287
3316
|
as: TypographyLinkWebWrapper,
|
|
3288
|
-
|
|
3317
|
+
$hasNoUnderline: noUnderline,
|
|
3289
3318
|
children: /*#__PURE__*/jsxRuntime.jsx(StyledLink, {
|
|
3290
3319
|
$disabled: disabled,
|
|
3291
|
-
$
|
|
3320
|
+
$hasNoUnderline: noUnderline,
|
|
3292
3321
|
href: href,
|
|
3293
3322
|
hrefAttrs: hrefAttrs,
|
|
3294
3323
|
accessibilityRole: "link",
|