@narmi/design_system 2.0.0-beta.2 → 2.0.0-beta.3

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,10 +1,41 @@
1
+ ## Functions
2
+
3
+ <dl>
4
+ <dt><a href="#formatDate">formatDate(date, style)</a> ⇒ <code>String</code></dt>
5
+ <dd><p>Wrapper for <code>Intl.DateTimeFormat</code> with options configured for Narmi applications.</p>
6
+ </dd>
7
+ <dt><a href="#formatNumber">formatNumber(input, style)</a> ⇒ <code>String</code></dt>
8
+ <dd><p>Wrapper for <code>Intl.NumberFormat</code> with options configured for Narmi applications.</p>
9
+ </dd>
10
+ </dl>
11
+
12
+ <a name="formatDate"></a>
13
+
14
+ ## formatDate(date, style) ⇒ <code>String</code>
15
+ Wrapper for `Intl.DateTimeFormat` with options configured for Narmi applications.
16
+
17
+ **Kind**: global function
18
+ **Returns**: <code>String</code> - date string formatted for display
19
+
20
+ | Param | Type | Default | Description |
21
+ | --- | --- | --- | --- |
22
+ | date | <code>Date</code> | | native date object |
23
+ | style | <code>String</code> | <code>short</code> | formatting style (`short` or `long`) |
24
+
25
+ **Example**
26
+ ```js
27
+ import { formatDate } from '@narmi/design_system';
28
+
29
+ formatDate(new Date('July 4, 2022'), 'short'); // '7/4/2022'
30
+ formatDate(new Date('7/4/2022'), 'long'); // 'July 4, 2022'
31
+ ```
1
32
  <a name="formatNumber"></a>
2
33
 
3
34
  ## formatNumber(input, style) ⇒ <code>String</code>
4
- Thin wrapper for `Intl.NumberFormat` with options configured for Narmi applications.
35
+ Wrapper for `Intl.NumberFormat` with options configured for Narmi applications.
5
36
 
6
37
  **Kind**: global function
7
- **Returns**: <code>String</code> - formatted string
38
+ **Returns**: <code>String</code> - number string formatted for display
8
39
 
9
40
  | Param | Type | Default | Description |
10
41
  | --- | --- | --- | --- |
@@ -13,6 +44,8 @@ Thin wrapper for `Intl.NumberFormat` with options configured for Narmi applicati
13
44
 
14
45
  **Example**
15
46
  ```js
47
+ import { formatNumber } from '@narmi/design_system';
48
+
16
49
  formatNumber(1234.56, 'currency'); // '$1,234.56'
17
50
  formatNumber(34.4, 'currency'); // '$34.40'
18
51
  formatNumber(-12, 'currency'); // '-$12'