@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.
@@ -1 +1 @@
1
- {"version":3,"file":"PressableIconButton.d.ts","sourceRoot":"","sources":["../../../src/IconButton/PressableIconButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAMnD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAwE3D,MAAM,WAAW,wBAAyB,SAAQ,cAAc;IAC9D,KAAK,EAAE,sBAAsB,CAAC,OAAO,CAAC,CAAC;CACxC;AAED,wBAAgB,mBAAmB,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,wBAAwB,GAAG,YAAY,CAM/F"}
1
+ {"version":3,"file":"PressableIconButton.d.ts","sourceRoot":"","sources":["../../../src/IconButton/PressableIconButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAMnD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AA2E3D,MAAM,WAAW,wBAAyB,SAAQ,cAAc;IAC9D,KAAK,EAAE,sBAAsB,CAAC,OAAO,CAAC,CAAC;CACxC;AAED,wBAAgB,mBAAmB,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,wBAAwB,GAAG,YAAY,CAM/F"}
@@ -33,6 +33,8 @@ export interface TypographyProps extends TypographyBreakpointTypesProps, Except<
33
33
  }
34
34
  export declare type TypographyPropsWithoutRole = Except<TypographyProps, 'accessibilityRole'>;
35
35
  export declare function useTypographyTypeForCurrentWindowSize(base: TypographyType | undefined, small: TypographyType | undefined, medium: TypographyType | undefined, large: TypographyType | undefined): TypographyType | undefined;
36
+ declare type GetTypographyInheritedOrDefaultValuesBasedOnExistingAncestorsProps = Pick<TypographyProps, 'base' | 'color'>;
37
+ export declare function getTypographyInheritedOrDefaultValuesBasedOnExistingAncestors(hasTypographyAncestor: boolean, { base, color }: GetTypographyInheritedOrDefaultValuesBasedOnExistingAncestorsProps): GetTypographyInheritedOrDefaultValuesBasedOnExistingAncestorsProps;
36
38
  export declare function Typography({ accessibilityRole, base, small, medium, large, variant, color, ...otherProps }: TypographyProps): ReactElement | null;
37
39
  export declare namespace Typography {
38
40
  var Text: typeof TypographyText;
@@ -1 +1 @@
1
- {"version":3,"file":"Typography.d.ts","sourceRoot":"","sources":["../../../src/typography/Typography.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAErD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,oBAAY,oBAAoB,GAAG,SAAS,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,EAAE,CAAC;AAC1E,oBAAY,kBAAkB,GAAG,MAAM,GAAG,QAAQ,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,EAAE,CAAC;AAC5F,oBAAY,cAAc,GAAG,oBAAoB,GAAG,kBAAkB,CAAC;AACvE,aAAK,iBAAiB,GAAG,SAAS,GAAG,MAAM,CAAC;AAC5C,oBAAY,eAAe,GACvB,OAAO,GACP,aAAa,GACb,OAAO,GACP,aAAa,GACb,SAA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MAAM,CAAC,CAAC;IACzB,SAAS,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IACnC,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC/B;AAED,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,SAAS,EACT,OAAO,EACP,GAAG,UAAU,EACd,EAAE,mBAAmB,GAAG,YAAY,CAqBpC"}
1
+ {"version":3,"file":"TypographyLink.d.ts","sourceRoot":"","sources":["../../../src/typography/TypographyLink.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGxC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AA8C/D,MAAM,WAAW,mBAAoB,SAAQ,MAAM,CAAC,0BAA0B,EAAE,UAAU,CAAC;IACzF,QAAQ,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,WAAW,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC,CAAC;IAC5D,IAAI,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACzB,SAAS,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IACnC,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC/B;AAED,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,SAAS,EACT,OAAO,EACP,GAAG,UAAU,EACd,EAAE,mBAAmB,GAAG,YAAY,CAqBpC"}
@@ -193,34 +193,53 @@ function useTypographyTypeForCurrentWindowSize(base, small, medium, large) {
193
193
  if (small && width >= KittBreakpoints.SMALL) return small;
194
194
  return base;
195
195
  }
196
- function Typography(_ref3) {
197
- var accessibilityRole = _ref3.accessibilityRole,
198
- base = _ref3.base,
199
- small = _ref3.small,
200
- medium = _ref3.medium,
201
- large = _ref3.large,
202
- variant = _ref3.variant,
203
- color = _ref3.color,
204
- otherProps = _objectWithoutProperties(_ref3, _excluded$d);
196
+ function getTypographyInheritedOrDefaultValuesBasedOnExistingAncestors(hasTypographyAncestor, _ref3) {
197
+ var base = _ref3.base,
198
+ color = _ref3.color;
199
+ // return the props set or undefined. In case of undefined, the value will be inherited from its parents.
200
+ if (hasTypographyAncestor) return {
201
+ base: base,
202
+ color: color
203
+ };
204
+ return {
205
+ base: base !== null && base !== void 0 ? base : 'body',
206
+ color: color !== null && color !== void 0 ? color : 'black'
207
+ };
208
+ }
209
+ function Typography(_ref4) {
210
+ var accessibilityRole = _ref4.accessibilityRole,
211
+ base = _ref4.base,
212
+ small = _ref4.small,
213
+ medium = _ref4.medium,
214
+ large = _ref4.large,
215
+ variant = _ref4.variant,
216
+ color = _ref4.color,
217
+ otherProps = _objectWithoutProperties(_ref4, _excluded$d);
205
218
 
206
219
  var isHeaderTypographyInContext = useContext(IsHeaderTypographyContext);
207
- var typeForCurrentWindowSize = useTypographyTypeForCurrentWindowSize(base, small, medium, large);
208
- var isHeader = isTypographyHeader(typeForCurrentWindowSize, isHeaderTypographyInContext);
209
- 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
210
- // redefine the color, just inherit from it
220
+ var hasTypographyAncestor = isHeaderTypographyInContext !== undefined;
221
+
222
+ var _getTypographyInherit = getTypographyInheritedOrDefaultValuesBasedOnExistingAncestors(hasTypographyAncestor, {
223
+ base: base,
224
+ color: color
225
+ }),
226
+ baseOrDefaultToBody = _getTypographyInherit.base,
227
+ colorOrDefaultToBlack = _getTypographyInherit.color;
211
228
 
212
- var colorWithDefaultToBlack = color !== null && color !== void 0 ? color : isHeaderTypographyInContext !== undefined ? undefined : 'black';
213
- var content = base ? /*#__PURE__*/jsx(IsHeaderTypographyContext.Provider, {
229
+ var typeForCurrentWindowSize = useTypographyTypeForCurrentWindowSize(baseOrDefaultToBody, small, medium, large);
230
+ var isHeader = isTypographyHeader(typeForCurrentWindowSize, isHeaderTypographyInContext);
231
+ var nonNullableVariant = variant !== null && variant !== void 0 ? variant : isHeader ? 'bold' : 'regular';
232
+ var content = baseOrDefaultToBody ? /*#__PURE__*/jsx(IsHeaderTypographyContext.Provider, {
214
233
  value: isHeader,
215
234
  children: /*#__PURE__*/jsx(StyledTypography, _objectSpread$g({
216
- $color: colorWithDefaultToBlack,
235
+ $color: colorOrDefaultToBlack,
217
236
  $isHeader: isHeader,
218
237
  $typeForCurrentWindowSize: typeForCurrentWindowSize,
219
238
  $variant: nonNullableVariant,
220
239
  accessibilityRole: accessibilityRole || undefined
221
240
  }, otherProps))
222
241
  }) : /*#__PURE__*/jsx(StyledTypography, _objectSpread$g({
223
- $color: colorWithDefaultToBlack,
242
+ $color: colorOrDefaultToBlack,
224
243
  $isHeader: isHeader,
225
244
  $variant: nonNullableVariant,
226
245
  accessibilityRole: accessibilityRole || undefined
@@ -1451,7 +1470,7 @@ function PressableIconButton(_ref5) {
1451
1470
 
1452
1471
  return /*#__PURE__*/jsx(StyleWebWrapper, {
1453
1472
  as: PressableIconButtonWebWrapper,
1454
- "data-color-white": color === 'white' ? true : undefined,
1473
+ $isWhite: color === 'white',
1455
1474
  children: /*#__PURE__*/jsx(StyledPressableIconButton, _objectSpread$8({}, props))
1456
1475
  });
1457
1476
  }
@@ -3325,8 +3344,8 @@ var TypographyLinkWebWrapper = undefined;
3325
3344
  var StyledLink = /*#__PURE__*/styled.Text.withConfig({
3326
3345
  displayName: "TypographyLink__StyledLink"
3327
3346
  })(["text-decoration:", ";", ";", ";"], function (_ref) {
3328
- var $noUnderline = _ref.$noUnderline;
3329
- return $noUnderline ? 'none' : 'underline';
3347
+ var $hasNoUnderline = _ref.$hasNoUnderline;
3348
+ return $hasNoUnderline ? 'none' : 'underline';
3330
3349
  }, function (_ref2) {
3331
3350
  var $disabled = _ref2.$disabled;
3332
3351
  if (Platform.OS !== 'web') return undefined;
@@ -3350,10 +3369,10 @@ function TypographyLink(_ref4) {
3350
3369
  accessibilityRole: "none",
3351
3370
  children: /*#__PURE__*/jsx(StyleWebWrapper, {
3352
3371
  as: TypographyLinkWebWrapper,
3353
- "data-nounderline": noUnderline ? true : undefined,
3372
+ $hasNoUnderline: noUnderline,
3354
3373
  children: /*#__PURE__*/jsx(StyledLink, {
3355
3374
  $disabled: disabled,
3356
- $noUnderline: noUnderline,
3375
+ $hasNoUnderline: noUnderline,
3357
3376
  href: href,
3358
3377
  hrefAttrs: hrefAttrs,
3359
3378
  accessibilityRole: "link",