@narmi/design_system 1.28.0-beta.1 → 1.29.1
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/README.md +2 -0
- package/dist/docs/Formatters.md +21 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/style.css +4 -3
- package/dist/style.css.map +1 -1
- package/dist/tokens/css/rgbColors.css +1 -1
- package/dist/tokens/css/tokens.css +2 -1
- package/dist/tokens/js/colors.js +1 -1
- package/dist/tokens/js/manifest.js +150 -131
- package/package.json +5 -3
- package/dist/index.js.LICENSE.txt +0 -3
- package/dist/tokens/js/constants.js +0 -137
- package/dist/tokens/scss/variables.js +0 -305
- package/dist/tokens/scss/variables.scss +0 -305
package/README.md
CHANGED
|
@@ -84,6 +84,7 @@ npm install && npm run build && npm run storybook
|
|
|
84
84
|
|
|
85
85
|
`npm run` command | Description
|
|
86
86
|
-------------------- | ---------------------------------------
|
|
87
|
+
`build:jsdoc` | builds jsDoc documentation to `dist/`
|
|
87
88
|
`build:tokens` | builds all distributions of design tokens to `dist/`
|
|
88
89
|
`build:components` | builds all components and base stylesheet to `dist/`
|
|
89
90
|
`build` | builds everytyhing
|
|
@@ -140,3 +141,4 @@ If you are making a breaking change, please [note it in your commit message](htt
|
|
|
140
141
|
## License
|
|
141
142
|
|
|
142
143
|
Source code is under a custom license based on MIT. The license restricts `@narmi/design_system` usage to applications that integrate or interoperate with Narmi software or services, with additional restrictions for external, stand-alone applications. Please see LICENSE.md for full details.
|
|
144
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<a name="formatNumber"></a>
|
|
2
|
+
|
|
3
|
+
## formatNumber(input, style) ⇒ <code>String</code>
|
|
4
|
+
Thin wrapper for `Intl.NumberFormat` with options configured for Narmi applications.
|
|
5
|
+
|
|
6
|
+
**Kind**: global function
|
|
7
|
+
**Returns**: <code>String</code> - formatted string
|
|
8
|
+
|
|
9
|
+
| Param | Type | Default | Description |
|
|
10
|
+
| --- | --- | --- | --- |
|
|
11
|
+
| input | <code>String</code> \| <code>Number</code> | | string or number to format into a number string |
|
|
12
|
+
| style | <code>String</code> | <code>currency</code> | format style (`currency` or `percent`) |
|
|
13
|
+
|
|
14
|
+
**Example**
|
|
15
|
+
```js
|
|
16
|
+
formatNumber(1234.56, 'currency'); // '$1,234.56'
|
|
17
|
+
formatNumber(34.4, 'currency'); // '$34.40'
|
|
18
|
+
formatNumber(-12, 'currency'); // '-$12'
|
|
19
|
+
formatNumber('3.40', 'percent'); // '3.4%'
|
|
20
|
+
formatNumber(2, 'percent'); // '2%'
|
|
21
|
+
```
|