@toptal/picasso 28.1.2 → 28.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.
@@ -6,9 +6,13 @@ export interface Props extends TypographyProps {
6
6
  currency?: string;
7
7
  /** Locale identifiers are case-insensitive ASCII. However, it's conventional to use title case (first letter capitalized, successive letters lower case) for script code, upper case for region codes, and lower case for everything else. */
8
8
  locale?: string;
9
+ /** The minimum number of fraction digits to display */
10
+ minimumFractionDigits?: number;
11
+ /** The maximum number of fraction digits to display */
12
+ maximumFractionDigits?: number;
9
13
  }
10
14
  export declare const Amount: {
11
- ({ amount, currency, locale, inline, as, ...typographyProps }: Props): JSX.Element;
15
+ ({ amount, currency, locale, inline, as, minimumFractionDigits, maximumFractionDigits, ...typographyProps }: Props): JSX.Element;
12
16
  displayName: string;
13
17
  };
14
18
  export default Amount;
package/Amount/Amount.js CHANGED
@@ -13,8 +13,13 @@ import React from 'react';
13
13
  import Typography from '../Typography';
14
14
  import { formatAmount, DEFAULT_LOCALE, DEFAULT_CURRENCY, } from '../utils/Formatters';
15
15
  export const Amount = (_a) => {
16
- var { amount, currency = DEFAULT_CURRENCY, locale = DEFAULT_LOCALE, inline = true, as = 'span' } = _a, typographyProps = __rest(_a, ["amount", "currency", "locale", "inline", "as"]);
17
- return (React.createElement(Typography, Object.assign({ inline: inline, as: as }, typographyProps), formatAmount({ amount, currency, locale })));
16
+ var { amount, currency = DEFAULT_CURRENCY, locale = DEFAULT_LOCALE, inline = true, as = 'span', minimumFractionDigits, maximumFractionDigits } = _a, typographyProps = __rest(_a, ["amount", "currency", "locale", "inline", "as", "minimumFractionDigits", "maximumFractionDigits"]);
17
+ return (React.createElement(Typography, Object.assign({ inline: inline, as: as }, typographyProps), formatAmount({
18
+ amount,
19
+ currency,
20
+ locale,
21
+ options: { minimumFractionDigits, maximumFractionDigits },
22
+ })));
18
23
  };
19
24
  Amount.displayName = 'Amount';
20
25
  export default Amount;
@@ -1 +1 @@
1
- {"version":3,"file":"Amount.js","sourceRoot":"","sources":["../../src/Amount/Amount.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,UAA+B,MAAM,eAAe,CAAA;AAC3D,OAAO,EACL,YAAY,EACZ,cAAc,EACd,gBAAgB,GACjB,MAAM,qBAAqB,CAAA;AAW5B,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EAOf,EAAE,EAAE;QAPW,EACrB,MAAM,EACN,QAAQ,GAAG,gBAAgB,EAC3B,MAAM,GAAG,cAAc,EACvB,MAAM,GAAG,IAAI,EACb,EAAE,GAAG,MAAM,OAEL,EADH,eAAe,cANG,gDAOtB,CADmB;IAElB,OAAO,CACL,oBAAC,UAAU,kBAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,IAAM,eAAe,GACpD,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAChC,CACd,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAA;AAE7B,eAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"Amount.js","sourceRoot":"","sources":["../../src/Amount/Amount.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,UAA+B,MAAM,eAAe,CAAA;AAC3D,OAAO,EACL,YAAY,EACZ,cAAc,EACd,gBAAgB,GACjB,MAAM,qBAAqB,CAAA;AAe5B,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EASf,EAAE,EAAE;QATW,EACrB,MAAM,EACN,QAAQ,GAAG,gBAAgB,EAC3B,MAAM,GAAG,cAAc,EACvB,MAAM,GAAG,IAAI,EACb,EAAE,GAAG,MAAM,EACX,qBAAqB,EACrB,qBAAqB,OAEf,EADH,eAAe,cARG,kGAStB,CADmB;IAElB,OAAO,CACL,oBAAC,UAAU,kBAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,IAAM,eAAe,GACpD,YAAY,CAAC;QACZ,MAAM;QACN,QAAQ;QACR,MAAM;QACN,OAAO,EAAE,EAAE,qBAAqB,EAAE,qBAAqB,EAAE;KAC1D,CAAC,CACS,CACd,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAA;AAE7B,eAAe,MAAM,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toptal/picasso",
3
- "version": "28.1.2",
3
+ "version": "28.2.0",
4
4
  "description": "Toptal UI components library",
5
5
  "publishConfig": {
6
6
  "access": "public",