@sproutsocial/racine 17.0.0 → 18.0.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/CHANGELOG.md +34 -1
- package/README.md +16 -14
- package/__flow__/Card/Card.flow.js +5 -1
- package/__flow__/Card/CardTypes.flow.js +8 -1
- package/__flow__/Numeral/Numeral.flow.js +2 -0
- package/commonjs/Card/subComponents.js +14 -6
- package/commonjs/ChartLegend/ChartLegend.js +6 -23
- package/commonjs/ChartLegend/useChartLabels.js +41 -0
- package/commonjs/Link/Link.js +2 -1
- package/commonjs/Menu/Menu.js +69 -55
- package/commonjs/Menu/styles.js +1 -1
- package/commonjs/Numeral/Numeral.js +11 -2
- package/dist/types/Card/CardTypes.d.ts +3 -2
- package/dist/types/Card/CardTypes.d.ts.map +1 -1
- package/dist/types/Card/styles.d.ts +2 -2
- package/dist/types/Card/styles.d.ts.map +1 -1
- package/dist/types/Card/subComponents.d.ts +1 -1
- package/dist/types/Card/subComponents.d.ts.map +1 -1
- package/dist/types/ChartLegend/ChartLegend.d.ts.map +1 -1
- package/dist/types/ChartLegend/ChartLegendTypes.d.ts +8 -5
- package/dist/types/ChartLegend/ChartLegendTypes.d.ts.map +1 -1
- package/dist/types/ChartLegend/useChartLabels.d.ts +4 -0
- package/dist/types/ChartLegend/useChartLabels.d.ts.map +1 -0
- package/dist/types/Menu/Menu.d.ts.map +1 -1
- package/dist/types/Menu/styles.d.ts.map +1 -1
- package/dist/types/Numeral/Numeral.d.ts.map +1 -1
- package/dist/types/Numeral/NumeralTypes.d.ts +2 -0
- package/dist/types/Numeral/NumeralTypes.d.ts.map +1 -1
- package/dist/types/Numeral/__tests__/features/testNumeral.d.ts.map +1 -1
- package/lib/Card/subComponents.js +14 -7
- package/lib/ChartLegend/ChartLegend.js +5 -23
- package/lib/ChartLegend/useChartLabels.js +33 -0
- package/lib/Link/Link.js +2 -1
- package/lib/Menu/Menu.js +69 -55
- package/lib/Menu/styles.js +1 -1
- package/lib/Numeral/Numeral.js +11 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 18.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- fb938ad3: The HTML structure for the menu and listbox groups has been rearranged to improve accessibility for grouping
|
|
8
|
+
- When a title is provided to the `<Menu.Group />` or `<Listbox.Group />` component, the title is now correctly nested within the menu group container with the appropriate `role` and `aria-labelledby` attributes
|
|
9
|
+
- `Menu` and `Listbox` title container is now a `li` instead of a `div` for improved accessibility
|
|
10
|
+
- Developers are now able to provide a custom `role` to the `Menu.Group` and `Listbox.Group` components as well as override the padding applied to the title container
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- 5f60f73a: Adds the `invalidNumberLabel` prop to `Numeral`
|
|
15
|
+
- The label you provide will be added as visually hidden text to any instance of Numeral with an invalid value (i.e., where we render an em dash (`—`)).
|
|
16
|
+
- The prop is optional, but passing in a localized label is strongly recommended for accessibility purposes.
|
|
17
|
+
- Without this prop, screen readers will not read off anything for invalid values.
|
|
18
|
+
- With this prop, screen readers will read off the `invalidNumberLabel` for invalid values, providing clear feedback to screen reader users.
|
|
19
|
+
- Users should pass an `invalidNumberLabel` prop to all instances of Numeral; Numeral handles conditionally applying or omitting the label as needed.
|
|
20
|
+
- 23f73d44: `Card` component enhancements
|
|
21
|
+
- Adds the ability to specify an external link on the CardLink component.
|
|
22
|
+
- Provides Flow types for the subcomponents.
|
|
23
|
+
- 9e33f361: Fix `Link` accessibility issues
|
|
24
|
+
- Changes default state of underline prop from false to true
|
|
25
|
+
- Updates stories to accurately reflect accessible link usage
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- ba5d2429: Accessibility bugfixes for the `ChartLegend` component
|
|
30
|
+
- Recreates provided "contrast", "compare", and "extended" palettes in React hook to utilize the Racine theme
|
|
31
|
+
- Deprecation warnings added to the "contrast", "compare", and "extended" palettes
|
|
32
|
+
- Due to low usage of these palettes, ChartLegend will rely solely on the dataviz rotation and custom colors moving forward
|
|
33
|
+
- Provides 3:1 contrast ratio
|
|
34
|
+
- Dark mode support
|
|
35
|
+
|
|
3
36
|
## 17.0.0
|
|
4
37
|
|
|
5
38
|
### Major Changes
|
|
@@ -13,7 +46,7 @@
|
|
|
13
46
|
**Enhancements**
|
|
14
47
|
|
|
15
48
|
- Cards with `role='link'` should now wrap link text in the `CardLink` subcomponent
|
|
16
|
-
- Improves screen reader
|
|
49
|
+
- Improves screen reader accessibility by pairing Cards as links with the new `CardLink` subcomponent
|
|
17
50
|
- Adds `CardLink` subcomponent
|
|
18
51
|
- Link text wrapped in CardLink renders an anchor tag as a child of Card
|
|
19
52
|
- Preserves the behavior that allows the user to click the whole Card as the link
|
package/README.md
CHANGED
|
@@ -146,7 +146,7 @@ When writing code for Racine, please refer to the `code-guidelines.mdx` story in
|
|
|
146
146
|
|
|
147
147
|
There are a few ways to get involved:
|
|
148
148
|
|
|
149
|
-
- Join #
|
|
149
|
+
- Join #design-systems on Slack to participate in discussions about Racine's development.
|
|
150
150
|
- Check out [the issues tab of this repository](https://github.com/sproutsocial/racine/issues). Issues contain community-collected bugs and features that need attention. If you're looking for an easy way to jump in, we have [a label which shows issues that are good for first-time contributors](https://github.com/sproutsocial/racine/issues?q=is%3Aopen+is%3Aissue+label%3A%22♥%EF%B8%8F+good+first+issue%22).
|
|
151
151
|
- The Design Systems team [uses Jira to track our backlog, in-flight changes, and future changes](https://sprout.atlassian.net/jira/software/c/projects/DS/boards/601/backlog). It's a great way to get a broad look at what's happening in Racine, and tracks the squad's work from sprint to sprint, and release to release.
|
|
152
152
|
|
|
@@ -175,12 +175,12 @@ And you can interact with Racine via the command line with these commands:
|
|
|
175
175
|
|
|
176
176
|
### **✅ Step 3: Make your changes**
|
|
177
177
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
If you are a member of the Design Systems team you'll have write access to `sproutsocial/racine`, which means you can branch directly off `dev` and start working. Either way, once you've got your new feature branch feel free to start coding! As updates are merged into `dev` on `sproutsocial/racine` by other developers over time you'll want to pull those updates into your feature branch, ideally via rebase, to avoid any conflicts when you open a pull request.
|
|
178
|
+
Cut a feature branch off `dev` and start coding! As updates are merged into `dev` by other developers over time you'll want to pull those updates into your branch, ideally via rebase, to avoid any conflicts when you open a pull request.
|
|
181
179
|
|
|
182
180
|
_Need to make an urgent update? Branch off `main` instead of dev, and open your PR later against `main`. We consider this a hotfix and only support it for critical time-sensitive updates, so check with the Design Systems team prior to making this kind of contribution._
|
|
183
181
|
|
|
182
|
+
We use a [visual regression testing](https://racine.netlify.app/?path=/story/welcome-visual-regression-testing--page) suite to capture any unintended changes during development. After running `yarn build` you can run the suite locally with `yarn backstop-test`, which will open a report in your browser to show you what passed and what failed. If any fails are actually intentional visual changes you can run `yarn backstop-approve` to approve those changes as new reference images and include them in your PR.
|
|
183
|
+
|
|
184
184
|
As you develop you'll want to track the scope of the changes you make. Racine supports this with a tool called [changesets](https://github.com/atlassian/changesets) to automatically pick new version numbers and update the changelog whenever we publish a new version of the package.
|
|
185
185
|
|
|
186
186
|
**Run `yarn change` to generate a changeset that will be used to derive the next version number for Racine from your changes.**
|
|
@@ -193,26 +193,28 @@ When running this command, you will be asked to select whether your change is a
|
|
|
193
193
|
- **minor** changes are for new features or improvements, and they bump the middle digit in the version number (`x.0.x`)
|
|
194
194
|
- **major** changes are _breaking changes_, and they bump the first digit (`0.x.x`). These types of changes are rare and should be coordinated in advance with the Design Systems team.
|
|
195
195
|
|
|
196
|
-
The changeset CLI will also ask you to input a message detailing your changes. The completion of the command will generate a new changeset markdown file. You are more than welcome to edit this file after it has been generated, so don't get hung up on trying to write the perfect text from the command line. Aim to make the text of the changeset file(s) as descriptive and informative as possible, as they will be used to build a changelog file when the new version is released.
|
|
196
|
+
The changeset CLI will also ask you to input a message detailing your changes. The completion of the command will generate a new changeset markdown file. You are more than welcome to edit this file after it has been generated, so don't get hung up on trying to write the perfect text from the command line. Aim to make the text of the changeset file(s) as descriptive and informative as possible, as they will be used to build a changelog file when the new version is released. Check out our documentation for the [Seeds Release Process](https://sprout.atlassian.net/wiki/spaces/SEEDS/pages/3522756609/DS+Seeds+Release+Process#Changesets) for examples of what makes a good or bad changeset.
|
|
197
197
|
|
|
198
198
|
**You can add as many changesets to a PR as you would like.** If your PR makes several distinct changes to Racine, you should create a changeset detailing each one individually.
|
|
199
199
|
|
|
200
200
|
### **🗣 Step 4: Create a pull request**
|
|
201
201
|
|
|
202
|
-
Once you're ready to submit your changes for review, open a PR against the `dev` branch
|
|
202
|
+
Once you're ready to submit your changes for review, open a PR against the `dev` branch. A few things will happen:
|
|
203
203
|
|
|
204
|
-
- The Racine maintainers will be tagged to review your code. Feel free to tag any specific individuals who you think should take a look.
|
|
205
|
-
-
|
|
206
|
-
-
|
|
204
|
+
- The Racine maintainers will be tagged to review your code. Feel free to additionally tag any specific individuals who you think should take a look.
|
|
205
|
+
- Visual regression testing will run against your PR, and the results can be found in the "Report" artifact on the summary page for the associated Github Action run. `html_report/index.html` in `Report.zip` will show you what passed and what failed.
|
|
206
|
+
- Racine's test suite will run via CI, and the status will be reported on the PR. You can run `yarn test` to run these tests locally. If there are any issues, they will need to be resolved before the PR can be merged.
|
|
207
|
+
- Netlify will create a preview deploy of Racine's Storybook and include a link to it in a comment on the PR so you can see your changes and share them with others.
|
|
208
|
+
- A Racine package snapshot including your changes will be published to Artifactory and included in a comment on the PR so you can install it locally or in a web app PR/snapshot in order to test your changes.
|
|
207
209
|
|
|
208
|
-
You may be asked to make changes to match Racine's contribution guidelines, so expect to keep attention on your PR for a little bit. Once your tests are passing and you have at least one approving Design Systems review, a member of the Design Systems team will merge your changes for inclusion in a future release of Racine!
|
|
210
|
+
You may be asked to make changes to match Racine's contribution guidelines, so expect to keep attention on your PR for a little bit. Once your tests are passing and you have at least one approving Design Systems review, a member of the Design Systems team will merge your changes for inclusion in a future release of Racine! Please **do NOT** merge your own PR unless expressly told to, since commits to `dev` end up in the next release, and the Design Systems team needs to make sure they have the bandwidth to validate any contribution before it releases.
|
|
209
211
|
|
|
210
|
-
### **☁️ Step 5:
|
|
212
|
+
### **☁️ Step 5: Changes get published to Artifactory**
|
|
211
213
|
|
|
212
|
-
|
|
214
|
+
When the Design Systems team prepares the next Racine release, changsets will generate a PR called `Version Packages`. This PR will detail all of the changes that have been made to the package since the last publish. Merging this PR will release a new version of Racine.
|
|
213
215
|
|
|
214
|
-
When the PR is merged, [GitHub will kick off a publish of the new version](https://github.com/sproutsocial/racine/actions?query=workflow%3ARelease). There will be a notification in #
|
|
216
|
+
When the PR is merged, [GitHub will kick off a publish of the new version](https://github.com/sproutsocial/racine/actions?query=workflow%3ARelease). There will be a notification in #design-systems in Slack when the new version is available.
|
|
215
217
|
|
|
216
218
|
### **✍ Step 6: Document your changes**
|
|
217
219
|
|
|
218
|
-
Racine components are documented in [Seeds](https://sproutsocial.com/seeds/components), Sprout's design system. You can open a PR to the [Seeds repository](https://github.com/sproutsocial/seeds) to add or edit component documentation. Reach out to the Design Systems team
|
|
220
|
+
Racine components are documented in [Seeds](https://sproutsocial.com/seeds/components), Sprout's design system. You can open a PR to the [Seeds repository](https://github.com/sproutsocial/seeds) to add or edit component documentation. It's a good idea to have documentation changes ready to go at the same time your Racine contributions are deployed, so start early! Reach out to the Design Systems team if you need help getting started.
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import type { TypeCardProps } from "./CardTypes.flow";
|
|
3
|
+
import type { TypeCardProps, TypeCardLink, TypeCardArea } from "./CardTypes.flow";
|
|
4
4
|
declare var Card: React.StatelessFunctionalComponent<TypeCardProps>;
|
|
5
|
+
declare export var CardLink: React.StatelessFunctionalComponent<TypeCardLink>;
|
|
6
|
+
declare export var CardHeader: React.StatelessFunctionalComponent<TypeCardArea>;
|
|
7
|
+
declare export var CardContent: React.StatelessFunctionalComponent<TypeCardArea>;
|
|
8
|
+
declare export var CardFooter: React.StatelessFunctionalComponent<TypeCardArea>;
|
|
5
9
|
declare export default typeof Card;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import type { TypeIconProps } from "../Icon/index.flow";
|
|
5
5
|
import type { TypeStyledComponentsCommonProps, TypePropsWithChildren } from "../types/index.flow";
|
|
6
|
-
import type { TypeBorderSystemProps, TypeColorSystemProps, TypeFlexboxSystemProps, TypeGridSystemProps, TypeLayoutSystemProps, TypePositionSystemProps, TypeSpaceSystemProps } from "../systemProps/index.flow";
|
|
6
|
+
import type { TypeBorderSystemProps, TypeColorSystemProps, TypeFlexboxSystemProps, TypeGridSystemProps, TypeLayoutSystemProps, TypePositionSystemProps, TypeSpaceSystemProps, TypeTypographySystemProps } from "../systemProps/index.flow";
|
|
7
7
|
export type TypeSharedCardSystemProps = TypePropsWithChildren<{|
|
|
8
8
|
...TypeStyledComponentsCommonProps,
|
|
9
9
|
...TypeBorderSystemProps,
|
|
@@ -63,4 +63,11 @@ export type TypeStyledSelectedIcon = {
|
|
|
63
63
|
...TypeIconProps,
|
|
64
64
|
$selected: $PropertyType<TypeCardStyleTransientProps, '$selected'>,
|
|
65
65
|
...
|
|
66
|
+
};
|
|
67
|
+
export type TypeCardLink = {
|
|
68
|
+
...TypeColorSystemProps,
|
|
69
|
+
...TypeTypographySystemProps,
|
|
70
|
+
affordance?: boolean,
|
|
71
|
+
external?: boolean,
|
|
72
|
+
...
|
|
66
73
|
};
|
|
@@ -12,6 +12,8 @@ export type TypeNumeralProps = {
|
|
|
12
12
|
currency?: string,
|
|
13
13
|
/** A boolean determining whether or not the number should be abbreviated, or a number representing the abbreviation threshold */
|
|
14
14
|
abbreviate?: boolean | number,
|
|
15
|
+
/** Text to be read off by screen readers for invalid values (i.e., any value rendered as '—' (em dash)) */
|
|
16
|
+
invalidNumberLabel?: string,
|
|
15
17
|
/** Override the default decimal precision (2 for decimals/currency, 1 for percentages), or "none" allowing unrestricted precision. */
|
|
16
18
|
precision?: number | 'none',
|
|
17
19
|
qa?: Object,
|
|
@@ -11,7 +11,7 @@ var _styles = require("./styles");
|
|
|
11
11
|
var _excluded = ["children"],
|
|
12
12
|
_excluded2 = ["children"],
|
|
13
13
|
_excluded3 = ["children"],
|
|
14
|
-
_excluded4 = ["affordance", "children"];
|
|
14
|
+
_excluded4 = ["affordance", "children", "external", "color"];
|
|
15
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
16
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
17
|
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
|
@@ -55,25 +55,33 @@ var CardAffordance = function CardAffordance(_ref5) {
|
|
|
55
55
|
var rest = _extends({}, (_objectDestructuringEmpty(_ref5), _ref5));
|
|
56
56
|
return /*#__PURE__*/_react.default.createElement(_styles.StyledCardAffordance, _extends({}, rest, {
|
|
57
57
|
size: "mini",
|
|
58
|
-
name: "arrow-right"
|
|
58
|
+
name: "arrow-right"
|
|
59
|
+
// TODO: probably need to make this available to the top level for external links https://sprout.atlassian.net/browse/DS-2223
|
|
60
|
+
,
|
|
59
61
|
"aria-hidden": true
|
|
60
62
|
}));
|
|
61
63
|
};
|
|
62
|
-
|
|
63
|
-
// jsdocs, never types?
|
|
64
64
|
exports.CardAffordance = CardAffordance;
|
|
65
65
|
var CardLink = function CardLink(_ref6) {
|
|
66
66
|
var affordance = _ref6.affordance,
|
|
67
67
|
children = _ref6.children,
|
|
68
|
+
_ref6$external = _ref6.external,
|
|
69
|
+
external = _ref6$external === void 0 ? false : _ref6$external,
|
|
70
|
+
color = _ref6.color,
|
|
68
71
|
rest = _objectWithoutProperties(_ref6, _excluded4);
|
|
69
72
|
var _useContext = (0, _react.useContext)(_utils.SubComponentContext),
|
|
70
73
|
href = _useContext.href,
|
|
71
74
|
linkRef = _useContext.linkRef;
|
|
72
75
|
return /*#__PURE__*/_react.default.createElement(_styles.StyledCardLink, _extends({}, rest, {
|
|
73
|
-
target:
|
|
74
|
-
rel:
|
|
76
|
+
target: external ? '_blank' : undefined,
|
|
77
|
+
rel: external ? 'noreferrer' : undefined,
|
|
75
78
|
href: href,
|
|
76
79
|
ref: linkRef
|
|
80
|
+
// TODO: fix this type since `color` should be valid here. TS can't resolve the correct type.
|
|
81
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
82
|
+
// @ts-ignore
|
|
83
|
+
,
|
|
84
|
+
color: color
|
|
77
85
|
}), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children, affordance ? /*#__PURE__*/_react.default.createElement(CardAffordance, {
|
|
78
86
|
ml: 300
|
|
79
87
|
}) : null));
|
|
@@ -6,45 +6,28 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var React = _interopRequireWildcard(require("react"));
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var _styles = _interopRequireWildcard(require("./styles"));
|
|
9
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
|
10
|
+
var _useChartLabels = require("./useChartLabels");
|
|
12
11
|
var _excluded = ["legendLabels", "stacked", "theme", "qa"];
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
15
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
16
16
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
17
17
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
18
|
-
function getSwatchColor(theme, index) {
|
|
19
|
-
return _chartColors.THEME_MAP[theme.toUpperCase()][index];
|
|
20
|
-
}
|
|
21
|
-
function getLabels(legendLabels, theme) {
|
|
22
|
-
return legendLabels.map(function (label, i) {
|
|
23
|
-
var labelColor = label.color ? label.color : getSwatchColor(theme, i);
|
|
24
|
-
return /*#__PURE__*/React.createElement(_styles.Label, {
|
|
25
|
-
key: label.name
|
|
26
|
-
}, /*#__PURE__*/React.createElement(_styles.Swatch, {
|
|
27
|
-
bg: labelColor,
|
|
28
|
-
"data-qa-swatch": ""
|
|
29
|
-
}), /*#__PURE__*/React.createElement(_Text.Text, {
|
|
30
|
-
as: "div",
|
|
31
|
-
fontSize: 200,
|
|
32
|
-
breakWord: true
|
|
33
|
-
}, label.name));
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
18
|
var ChartLegend = function ChartLegend(_ref) {
|
|
37
19
|
var legendLabels = _ref.legendLabels,
|
|
38
20
|
stacked = _ref.stacked,
|
|
39
21
|
_ref$theme = _ref.theme,
|
|
40
|
-
theme = _ref$theme === void 0 ? '
|
|
22
|
+
theme = _ref$theme === void 0 ? 'datavizRotation' : _ref$theme,
|
|
41
23
|
qa = _ref.qa,
|
|
42
24
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
25
|
+
var chartLabels = (0, _useChartLabels.useChartLabels)(legendLabels, theme);
|
|
43
26
|
return /*#__PURE__*/React.createElement(_styles.default, _extends({
|
|
44
27
|
inline: !stacked,
|
|
45
28
|
"data-qa-chartlegend": "",
|
|
46
29
|
qa: qa
|
|
47
|
-
}, rest),
|
|
30
|
+
}, rest), chartLabels);
|
|
48
31
|
};
|
|
49
32
|
var _default = ChartLegend;
|
|
50
33
|
exports.default = _default;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useChartLabels = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _styledComponents = require("styled-components");
|
|
9
|
+
var _styles = require("./styles");
|
|
10
|
+
var _Text = require("../Text");
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
var getSwatchColor = function getSwatchColor(theme, index, RacineThemeColors) {
|
|
13
|
+
var COMPARE_THEME = [RacineThemeColors.dataviz.map['1'], RacineThemeColors.dataviz.map['10'], RacineThemeColors.dataviz.map['11'], RacineThemeColors.dataviz.map['2']];
|
|
14
|
+
var CONTRAST_THEME = [RacineThemeColors.dataviz.map['1'], RacineThemeColors.dataviz.map['2'], RacineThemeColors.dataviz.map['3'], RacineThemeColors.dataviz.map['4'], RacineThemeColors.dataviz.map['5'], RacineThemeColors.dataviz.map['6'], RacineThemeColors.dataviz.map['4'], RacineThemeColors.dataviz.map['5'], RacineThemeColors.dataviz.map['6'], RacineThemeColors.dataviz.map['7'], RacineThemeColors.dataviz.map['8'], RacineThemeColors.dataviz.map['9'], RacineThemeColors.dataviz.map['10']];
|
|
15
|
+
var EXTENDED_THEME = [RacineThemeColors.dataviz.map['7'], RacineThemeColors.dataviz.map['1'], RacineThemeColors.dataviz.map['5'], RacineThemeColors.dataviz.map['11'], RacineThemeColors.dataviz.map['6'], RacineThemeColors.dataviz.map['3'], RacineThemeColors.dataviz.map['18'], RacineThemeColors.dataviz.map['8'], RacineThemeColors.dataviz.map['4'], RacineThemeColors.dataviz.map['13'], RacineThemeColors.dataviz.map['16'], RacineThemeColors.dataviz.map['10'], RacineThemeColors.dataviz.map['14'], RacineThemeColors.dataviz.map['2'], RacineThemeColors.dataviz.map['15'], RacineThemeColors.dataviz.map['12'], RacineThemeColors.dataviz.map['9'], RacineThemeColors.dataviz.map['17'], RacineThemeColors.dataviz.map['20'], RacineThemeColors.dataviz.map['19']];
|
|
16
|
+
var THEME_MAP = {
|
|
17
|
+
COMPARE: COMPARE_THEME,
|
|
18
|
+
CONTRAST: CONTRAST_THEME,
|
|
19
|
+
EXTENDED: EXTENDED_THEME,
|
|
20
|
+
DATAVIZROTATION: RacineThemeColors.dataviz.list
|
|
21
|
+
};
|
|
22
|
+
return THEME_MAP[theme.toUpperCase()][index];
|
|
23
|
+
};
|
|
24
|
+
var useChartLabels = function useChartLabels(legendLabels, theme) {
|
|
25
|
+
var racineTheme = (0, _styledComponents.useTheme)();
|
|
26
|
+
var colors = racineTheme.colors;
|
|
27
|
+
return legendLabels.map(function (label, i) {
|
|
28
|
+
var labelColor = label.color ? label.color : getSwatchColor(theme, i, colors);
|
|
29
|
+
return /*#__PURE__*/_react.default.createElement(_styles.Label, {
|
|
30
|
+
key: label.name
|
|
31
|
+
}, /*#__PURE__*/_react.default.createElement(_styles.Swatch, {
|
|
32
|
+
bg: labelColor,
|
|
33
|
+
"data-qa-swatch": ""
|
|
34
|
+
}), /*#__PURE__*/_react.default.createElement(_Text.Text, {
|
|
35
|
+
as: "div",
|
|
36
|
+
fontSize: 200,
|
|
37
|
+
breakWord: true
|
|
38
|
+
}, label.name));
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
exports.useChartLabels = useChartLabels;
|
package/commonjs/Link/Link.js
CHANGED
|
@@ -21,7 +21,8 @@ var Link = function Link(_ref) {
|
|
|
21
21
|
disabled = _ref.disabled,
|
|
22
22
|
onClick = _ref.onClick,
|
|
23
23
|
as = _ref.as,
|
|
24
|
-
underline = _ref.underline,
|
|
24
|
+
_ref$underline = _ref.underline,
|
|
25
|
+
underline = _ref$underline === void 0 ? true : _ref$underline,
|
|
25
26
|
_ref$qa = _ref.qa,
|
|
26
27
|
qa = _ref$qa === void 0 ? {} : _ref$qa,
|
|
27
28
|
rest = _objectWithoutProperties(_ref, _excluded);
|
package/commonjs/Menu/Menu.js
CHANGED
|
@@ -246,29 +246,49 @@ var MenuRadio = function MenuRadio(props) {
|
|
|
246
246
|
}, props));
|
|
247
247
|
};
|
|
248
248
|
exports.MenuRadio = MenuRadio;
|
|
249
|
-
var
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
249
|
+
var MenuTitle = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
250
|
+
displayName: "Menu__MenuTitle",
|
|
251
|
+
componentId: "sc-1jmjosz-0"
|
|
252
|
+
})(["font-weight:600;padding-left:", ";padding-top:", ";padding-bottom:", ";color:", ";"], function (_ref2) {
|
|
253
|
+
var theme = _ref2.theme;
|
|
254
|
+
return theme.space[300];
|
|
255
|
+
}, function (_ref3) {
|
|
256
|
+
var theme = _ref3.theme;
|
|
257
|
+
return theme.space[200];
|
|
258
|
+
}, function (_ref4) {
|
|
259
|
+
var theme = _ref4.theme;
|
|
260
|
+
return theme.space[300];
|
|
261
|
+
}, function (_ref5) {
|
|
262
|
+
var theme = _ref5.theme;
|
|
263
|
+
return theme.colors.text.headline;
|
|
264
|
+
});
|
|
265
|
+
var _StyledMenuTitle = (0, _styledComponents.default)(MenuTitle).withConfig({
|
|
266
|
+
displayName: "Menu___StyledMenuTitle",
|
|
267
|
+
componentId: "sc-1jmjosz-1"
|
|
268
|
+
})(["", ""], function (p) {
|
|
269
|
+
return p.$_css;
|
|
270
|
+
});
|
|
271
|
+
var MenuGroup = function MenuGroup(_ref6) {
|
|
272
|
+
var children = _ref6.children,
|
|
273
|
+
title = _ref6.title,
|
|
274
|
+
titleAs = _ref6.titleAs,
|
|
275
|
+
_ref6$disabled = _ref6.disabled,
|
|
276
|
+
isDisabled = _ref6$disabled === void 0 ? false : _ref6$disabled,
|
|
277
|
+
props = _objectWithoutProperties(_ref6, _excluded2);
|
|
278
|
+
var menuTitleId = (0, _lodash.default)('menu-title-');
|
|
279
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Box.default, _extends({
|
|
280
|
+
p: 300,
|
|
281
|
+
role: "group",
|
|
282
|
+
"aria-labelledby": title ? menuTitleId : undefined,
|
|
258
283
|
borderTop: "1px solid",
|
|
259
|
-
borderColor: "container.border.base"
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
284
|
+
borderColor: "container.border.base"
|
|
285
|
+
}, props), title && /*#__PURE__*/React.createElement(_StyledMenuTitle, {
|
|
286
|
+
id: menuTitleId,
|
|
287
|
+
role: "presentation",
|
|
263
288
|
fontSize: 200,
|
|
264
|
-
|
|
265
|
-
mt: 350,
|
|
266
|
-
color: "text.headline",
|
|
289
|
+
forwardedAs: titleAs || 'li',
|
|
267
290
|
$_css: isDisabled ? _mixins.disabled : undefined
|
|
268
|
-
}, title)
|
|
269
|
-
p: 300,
|
|
270
|
-
role: "group"
|
|
271
|
-
}), children));
|
|
291
|
+
}, title), children));
|
|
272
292
|
};
|
|
273
293
|
exports.MenuGroup = MenuGroup;
|
|
274
294
|
var MenuDivider = function MenuDivider(props) {
|
|
@@ -313,12 +333,12 @@ var MenuFilterInput = function MenuFilterInput(props) {
|
|
|
313
333
|
onBlur: handleOnBlur
|
|
314
334
|
}));
|
|
315
335
|
};
|
|
316
|
-
var MenuItems = function MenuItems(
|
|
317
|
-
var children =
|
|
318
|
-
role =
|
|
319
|
-
multiselect =
|
|
320
|
-
innerRef =
|
|
321
|
-
props = _objectWithoutProperties(
|
|
336
|
+
var MenuItems = function MenuItems(_ref7) {
|
|
337
|
+
var children = _ref7.children,
|
|
338
|
+
role = _ref7.role,
|
|
339
|
+
multiselect = _ref7.multiselect,
|
|
340
|
+
innerRef = _ref7.innerRef,
|
|
341
|
+
props = _objectWithoutProperties(_ref7, _excluded3);
|
|
322
342
|
var _useMenuKeyDown = (0, _utils.useMenuKeyDown)(),
|
|
323
343
|
handleKeyDown = _useMenuKeyDown.handleKeyDown,
|
|
324
344
|
activeDescendent = _useMenuKeyDown.activeDescendent;
|
|
@@ -338,15 +358,15 @@ var MenuItems = function MenuItems(_ref3) {
|
|
|
338
358
|
overflow: "hidden"
|
|
339
359
|
}), children);
|
|
340
360
|
};
|
|
341
|
-
var Menu = function Menu(
|
|
342
|
-
var
|
|
343
|
-
role =
|
|
344
|
-
children =
|
|
345
|
-
onChange =
|
|
346
|
-
value =
|
|
347
|
-
multiselect =
|
|
348
|
-
innerRef =
|
|
349
|
-
props = _objectWithoutProperties(
|
|
361
|
+
var Menu = function Menu(_ref8) {
|
|
362
|
+
var _ref8$role = _ref8.role,
|
|
363
|
+
role = _ref8$role === void 0 ? _utils.MENU_ROLES.MENU : _ref8$role,
|
|
364
|
+
children = _ref8.children,
|
|
365
|
+
onChange = _ref8.onChange,
|
|
366
|
+
value = _ref8.value,
|
|
367
|
+
multiselect = _ref8.multiselect,
|
|
368
|
+
innerRef = _ref8.innerRef,
|
|
369
|
+
props = _objectWithoutProperties(_ref8, _excluded4);
|
|
350
370
|
var _useDescendants = (0, _utils.useDescendants)(),
|
|
351
371
|
_useDescendants2 = _slicedToArray(_useDescendants, 2),
|
|
352
372
|
descendants = _useDescendants2[0],
|
|
@@ -404,20 +424,20 @@ Menu.Divider = MenuDivider;
|
|
|
404
424
|
Menu.FilterInput = MenuFilterInput;
|
|
405
425
|
var CustomPopoutContent = (0, _styledComponents.default)(_Popout.default.Content).withConfig({
|
|
406
426
|
displayName: "Menu__CustomPopoutContent",
|
|
407
|
-
componentId: "sc-1jmjosz-
|
|
427
|
+
componentId: "sc-1jmjosz-2"
|
|
408
428
|
})(["padding:0;margin-left:0;margin-right:0;"]);
|
|
409
|
-
var MenuButton = function MenuButton(
|
|
410
|
-
var content =
|
|
411
|
-
popoutProps =
|
|
412
|
-
children =
|
|
413
|
-
_onClick =
|
|
414
|
-
|
|
415
|
-
closeOnItemClick =
|
|
416
|
-
|
|
417
|
-
id =
|
|
418
|
-
|
|
419
|
-
placement =
|
|
420
|
-
props = _objectWithoutProperties(
|
|
429
|
+
var MenuButton = function MenuButton(_ref9) {
|
|
430
|
+
var content = _ref9.content,
|
|
431
|
+
popoutProps = _ref9.popoutProps,
|
|
432
|
+
children = _ref9.children,
|
|
433
|
+
_onClick = _ref9.onClick,
|
|
434
|
+
_ref9$closeOnItemClic = _ref9.closeOnItemClick,
|
|
435
|
+
closeOnItemClick = _ref9$closeOnItemClic === void 0 ? true : _ref9$closeOnItemClic,
|
|
436
|
+
_ref9$id = _ref9.id,
|
|
437
|
+
id = _ref9$id === void 0 ? (0, _lodash.default)('MenuButton-') : _ref9$id,
|
|
438
|
+
_ref9$placement = _ref9.placement,
|
|
439
|
+
placement = _ref9$placement === void 0 ? 'bottom' : _ref9$placement,
|
|
440
|
+
props = _objectWithoutProperties(_ref9, _excluded5);
|
|
421
441
|
var _useState5 = (0, React.useState)(false),
|
|
422
442
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
423
443
|
isOpen = _useState6[0],
|
|
@@ -459,10 +479,4 @@ var MenuButton = function MenuButton(_ref5) {
|
|
|
459
479
|
};
|
|
460
480
|
exports.MenuButton = MenuButton;
|
|
461
481
|
var _default = Menu;
|
|
462
|
-
exports.default = _default;
|
|
463
|
-
var _StyledText = (0, _styledComponents.default)(_Text.default).withConfig({
|
|
464
|
-
displayName: "Menu___StyledText",
|
|
465
|
-
componentId: "sc-1jmjosz-1"
|
|
466
|
-
})(["", ""], function (p) {
|
|
467
|
-
return p.$_css;
|
|
468
|
-
});
|
|
482
|
+
exports.default = _default;
|
package/commonjs/Menu/styles.js
CHANGED
|
@@ -55,5 +55,5 @@ exports.MenuItemContainer = MenuItemContainer;
|
|
|
55
55
|
var MenuItemsContainer = (0, _styledComponents.default)(_Box.default).withConfig({
|
|
56
56
|
displayName: "styles__MenuItemsContainer",
|
|
57
57
|
componentId: "sc-168zlb1-1"
|
|
58
|
-
})(["list-style-type:none;&:focus{", "}"], _mixins.focusRing);
|
|
58
|
+
})(["list-style-type:none;&:focus{", "}& > div[role='group']:first-of-type{border-top:none;}"], _mixins.focusRing);
|
|
59
59
|
exports.MenuItemsContainer = MenuItemsContainer;
|
|
@@ -9,9 +9,10 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _lruMemoize = _interopRequireDefault(require("lru-memoize"));
|
|
10
10
|
var _constants = require("../utils/constants");
|
|
11
11
|
var _Tooltip = _interopRequireDefault(require("../Tooltip"));
|
|
12
|
+
var _VisuallyHidden = require("../VisuallyHidden");
|
|
12
13
|
var _constants2 = require("./constants");
|
|
13
14
|
var _styles = require("./styles");
|
|
14
|
-
var _excluded = ["number", "locale", "format", "currency", "abbreviate", "precision", "qa"];
|
|
15
|
+
var _excluded = ["number", "locale", "format", "currency", "abbreviate", "invalidNumberLabel", "precision", "qa"];
|
|
15
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
17
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -86,6 +87,7 @@ var normalizeArgs = function normalizeArgs(props) {
|
|
|
86
87
|
currency = _props$currency === void 0 ? 'USD' : _props$currency,
|
|
87
88
|
_props$abbreviate = props.abbreviate,
|
|
88
89
|
abbreviate = _props$abbreviate === void 0 ? true : _props$abbreviate,
|
|
90
|
+
invalidNumberLabel = props.invalidNumberLabel,
|
|
89
91
|
precision = props.precision,
|
|
90
92
|
qa = props.qa,
|
|
91
93
|
rest = _objectWithoutProperties(props, _excluded);
|
|
@@ -107,6 +109,7 @@ var normalizeArgs = function normalizeArgs(props) {
|
|
|
107
109
|
return {
|
|
108
110
|
value: value,
|
|
109
111
|
canAbbreviate: canAbbreviate,
|
|
112
|
+
invalidNumberLabel: invalidNumberLabel,
|
|
110
113
|
options: options,
|
|
111
114
|
qa: qa,
|
|
112
115
|
rest: rest
|
|
@@ -116,10 +119,16 @@ var Numeral = function Numeral(props) {
|
|
|
116
119
|
var _normalizeArgs = normalizeArgs(props),
|
|
117
120
|
value = _normalizeArgs.value,
|
|
118
121
|
canAbbreviate = _normalizeArgs.canAbbreviate,
|
|
122
|
+
invalidNumberLabel = _normalizeArgs.invalidNumberLabel,
|
|
119
123
|
options = _normalizeArgs.options,
|
|
120
124
|
qa = _normalizeArgs.qa,
|
|
121
125
|
rest = _normalizeArgs.rest;
|
|
122
|
-
if (!isValidNumber(props.number)) return /*#__PURE__*/React.createElement(
|
|
126
|
+
if (!isValidNumber(props.number)) return /*#__PURE__*/React.createElement(React.Fragment, null, invalidNumberLabel &&
|
|
127
|
+
/*#__PURE__*/
|
|
128
|
+
// Give screen readers something useful to read off + hide the em dash
|
|
129
|
+
React.createElement(_VisuallyHidden.VisuallyHidden, null, invalidNumberLabel), /*#__PURE__*/React.createElement(_styles.Container, _extends({
|
|
130
|
+
"aria-hidden": true
|
|
131
|
+
}, qa), _constants.EM_DASH));
|
|
123
132
|
var formatters = getNumberFormatters(options);
|
|
124
133
|
var fullText = formatters.standard.format(value);
|
|
125
134
|
if (canAbbreviate) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TypeIconProps } from '../Icon';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { TypeStyledComponentsCommonProps } from '../types/styled-components';
|
|
4
|
-
import type { TypeBorderSystemProps, TypeColorSystemProps, TypeFlexboxSystemProps, TypeGridSystemProps, TypeLayoutSystemProps, TypePositionSystemProps, TypeSpaceSystemProps } from '../systemProps';
|
|
4
|
+
import type { TypeBorderSystemProps, TypeColorSystemProps, TypeFlexboxSystemProps, TypeGridSystemProps, TypeLayoutSystemProps, TypePositionSystemProps, TypeSpaceSystemProps, TypeTypographySystemProps } from '../systemProps';
|
|
5
5
|
export interface TypeSharedCardSystemProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color'>, TypeStyledComponentsCommonProps, TypeBorderSystemProps, TypeColorSystemProps, TypeFlexboxSystemProps, TypeGridSystemProps, TypeLayoutSystemProps, TypePositionSystemProps, TypeSpaceSystemProps {
|
|
6
6
|
}
|
|
7
7
|
export interface TypeCardStyleProps {
|
|
@@ -55,8 +55,9 @@ export interface TypeCardContext {
|
|
|
55
55
|
href?: string;
|
|
56
56
|
linkRef: React.RefObject<HTMLAnchorElement> | null;
|
|
57
57
|
}
|
|
58
|
-
export interface TypeCardLink {
|
|
58
|
+
export interface TypeCardLink extends Omit<React.ComponentPropsWithoutRef<'a'>, 'color'>, TypeColorSystemProps, TypeTypographySystemProps {
|
|
59
59
|
affordance?: boolean;
|
|
60
|
+
external?: boolean;
|
|
60
61
|
}
|
|
61
62
|
export {};
|
|
62
63
|
//# sourceMappingURL=CardTypes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardTypes.d.ts","sourceRoot":"","sources":["../../../src/Card/CardTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,+BAA+B,EAAC,MAAM,8BAA8B,CAAC;AAC7E,OAAO,KAAK,EACV,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"CardTypes.d.ts","sourceRoot":"","sources":["../../../src/Card/CardTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,+BAA+B,EAAC,MAAM,8BAA8B,CAAC;AAC7E,OAAO,KAAK,EACV,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,yBAAyB,EAC1B,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,yBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,EAC1D,+BAA+B,EAC/B,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB;CAAG;AAG3B,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAGD,oBAAY,uBAAuB,CAAC,CAAC,IAAI;KACtC,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,IAAI,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;CACjD,CAAC;AAEF,oBAAY,2BAA2B,GACrC,uBAAuB,CAAC,kBAAkB,CAAC,CAAC;AAE9C,MAAM,WAAW,cACf,SAAQ,yBAAyB,EAC/B,2BAA2B;CAAG;AAElC,MAAM,WAAW,cACf,SAAQ,yBAAyB,EAC/B,IAAI,CAAC,kBAAkB,EAAE,yBAAyB,CAAC;CAAG;AAE1D,aAAK,WAAW,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,aAAa,KAAK,IAAI,CAAC;AAE3E,oBAAY,kBAAkB,GAC1B;IACE,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,WAAW,CAAC;CACtB,GACD;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;CACnB,GACD;IACE,IAAI,EAAE,cAAc,CAAC;IACrB,IAAI,CAAC,EAAE,KAAK,CAAC;IACb;;;;OAIG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB,CAAC;AAEN,oBAAY,aAAa,GAAG,kBAAkB,GAC5C,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC;AAE1C,MAAM,WAAW,YAAa,SAAQ,yBAAyB;IAC7D,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;CAC7B;AAED,MAAM,WAAW,sBAAuB,SAAQ,aAAa;IAC3D,SAAS,EAAE,IAAI,CAAC,2BAA2B,EAAE,WAAW,CAAC,CAAC;CAC3D;AAED,MAAM,WAAW,eAAe;IAC9B,kBAAkB,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACnE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;CACpD;AAED,MAAM,WAAW,YACf,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,EACxD,oBAAoB,EACpB,yBAAyB;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { TypeStyledCard, TypeCardArea, TypeStyledSelectedIcon } from './CardTypes';
|
|
2
|
+
import { TypeStyledCard, TypeCardArea, TypeStyledSelectedIcon, TypeCardLink } from './CardTypes';
|
|
3
3
|
export declare const StyledCardContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TypeCardArea, never>;
|
|
4
4
|
export declare const StyledCardHeader: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TypeCardArea, never>;
|
|
5
5
|
export declare const StyledCardFooter: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TypeCardArea, never>;
|
|
@@ -11,7 +11,7 @@ export declare const StyledSelectedIcon: import("styled-components").StyledCompo
|
|
|
11
11
|
displayName: string;
|
|
12
12
|
};
|
|
13
13
|
}, import("styled-components").DefaultTheme, TypeStyledSelectedIcon, never>;
|
|
14
|
-
export declare const StyledCardLink: import("styled-components").StyledComponent<"a", import("styled-components").DefaultTheme,
|
|
14
|
+
export declare const StyledCardLink: import("styled-components").StyledComponent<"a", import("styled-components").DefaultTheme, TypeCardLink, never>;
|
|
15
15
|
export declare const StyledCard: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, TypeStyledCard, never>;
|
|
16
16
|
export declare const StyledCardAffordance: import("styled-components").StyledComponent<{
|
|
17
17
|
({ name, size, fixedWidth, ariaLabel, color, svgProps, ...rest }: import("../Icon").TypeIconProps): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Card/styles.tsx"],"names":[],"mappings":";AAYA,OAAO,EACL,cAAc,EACd,YAAY,EACZ,sBAAsB,
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Card/styles.tsx"],"names":[],"mappings":";AAYA,OAAO,EACL,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,YAAY,EACb,MAAM,aAAa,CAAC;AAQrB,eAAO,MAAM,iBAAiB,mHAY7B,CAAC;AAEF,eAAO,MAAM,gBAAgB,mHAa5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,mHAa5B,CAAC;AAEF,eAAO,MAAM,mBAAmB,yGAO/B,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;2EAW9B,CAAC;AAEF,eAAO,MAAM,cAAc,iHAQ1B,CAAC;AAEF,eAAO,MAAM,UAAU,qHA8DtB,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;uDAKhC,CAAC"}
|
|
@@ -18,5 +18,5 @@ export declare const SelectedIcon: ({ $selected }: {
|
|
|
18
18
|
export declare const CardAffordance: ({ ...rest }: {
|
|
19
19
|
[x: string]: any;
|
|
20
20
|
}) => React.JSX.Element;
|
|
21
|
-
export declare const CardLink: ({ affordance, children, ...rest }: React.PropsWithChildren<TypeCardLink>) => React.JSX.Element;
|
|
21
|
+
export declare const CardLink: ({ affordance, children, external, color, ...rest }: React.PropsWithChildren<TypeCardLink>) => React.JSX.Element;
|
|
22
22
|
//# sourceMappingURL=subComponents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subComponents.d.ts","sourceRoot":"","sources":["../../../src/Card/subComponents.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AAWzC,eAAO,MAAM,WAAW;;;uBAKvB,CAAC;AAEF,eAAO,MAAM,UAAU;;;uBAGtB,CAAC;AAEF,eAAO,MAAM,UAAU;;;uBAGtB,CAAC;AAEF,eAAO,MAAM,YAAY;;uBAWxB,CAAC;AAEF,eAAO,MAAM,cAAc;;
|
|
1
|
+
{"version":3,"file":"subComponents.d.ts","sourceRoot":"","sources":["../../../src/Card/subComponents.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AAWzC,eAAO,MAAM,WAAW;;;uBAKvB,CAAC;AAEF,eAAO,MAAM,UAAU;;;uBAGtB,CAAC;AAEF,eAAO,MAAM,UAAU;;;uBAGtB,CAAC;AAEF,eAAO,MAAM,YAAY;;uBAWxB,CAAC;AAEF,eAAO,MAAM,cAAc;;uBAU1B,CAAC;AAEF,eAAO,MAAM,QAAQ,uDAMlB,MAAM,iBAAiB,CAAC,YAAY,CAAC,sBAqBvC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartLegend.d.ts","sourceRoot":"","sources":["../../../src/ChartLegend/ChartLegend.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ChartLegend.d.ts","sourceRoot":"","sources":["../../../src/ChartLegend/ChartLegend.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AAG7D,QAAA,MAAM,WAAW,kDAMd,oBAAoB,sBAQtB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { TypeStyledComponentsCommonProps } from '../types/styled-components';
|
|
3
3
|
import type { TypeSystemCommonProps, TypeSystemLayoutProps } from '../types/system-props';
|
|
4
|
-
|
|
4
|
+
/** @deprecated legend themes will be handled automatically by the standard dataviz rotation in a future version */
|
|
5
|
+
export declare type TypeChartLegendTheme = 'compare' | 'contrast' | 'extended' | 'datavizRotation';
|
|
6
|
+
export interface TypeLegendLabels {
|
|
7
|
+
name: string;
|
|
8
|
+
color?: string;
|
|
9
|
+
}
|
|
5
10
|
export interface TypeChartLegendProps extends TypeStyledComponentsCommonProps, TypeSystemCommonProps, TypeSystemLayoutProps, Omit<React.ComponentPropsWithoutRef<'div'>, 'color'> {
|
|
6
11
|
/** Inline or stacked y plots */
|
|
7
12
|
stacked?: boolean;
|
|
13
|
+
/** @deprecated legend themes will be handled automatically by the standard dataviz rotation in a future version */
|
|
8
14
|
theme?: TypeChartLegendTheme;
|
|
9
15
|
/** Array of names with optional color to display. If no color is specified, index of label will be used to determine color based on the theme. */
|
|
10
|
-
legendLabels:
|
|
11
|
-
name: string;
|
|
12
|
-
color?: string;
|
|
13
|
-
}[];
|
|
16
|
+
legendLabels: TypeLegendLabels[];
|
|
14
17
|
qa?: object;
|
|
15
18
|
}
|
|
16
19
|
//# sourceMappingURL=ChartLegendTypes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartLegendTypes.d.ts","sourceRoot":"","sources":["../../../src/ChartLegend/ChartLegendTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAC,+BAA+B,EAAC,MAAM,8BAA8B,CAAC;AAClF,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,yBAAyB,CAAC;AAEjC,oBAAY,oBAAoB,
|
|
1
|
+
{"version":3,"file":"ChartLegendTypes.d.ts","sourceRoot":"","sources":["../../../src/ChartLegend/ChartLegendTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAC,+BAA+B,EAAC,MAAM,8BAA8B,CAAC;AAClF,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,yBAAyB,CAAC;AAEjC,mHAAmH;AACnH,oBAAY,oBAAoB,GAC5B,SAAS,GACT,UAAU,GACV,UAAU,GACV,iBAAiB,CAAC;AACtB,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,oBACf,SAAQ,+BAA+B,EACrC,qBAAqB,EACrB,qBAAqB,EACrB,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACtD,gCAAgC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mHAAmH;IACnH,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAC7B,kJAAkJ;IAClJ,YAAY,EAAE,gBAAgB,EAAE,CAAC;IACjC,EAAE,CAAC,EAAE,MAAM,CAAC;CACb"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TypeChartLegendTheme, TypeLegendLabels } from './ChartLegendTypes';
|
|
3
|
+
export declare const useChartLabels: (legendLabels: TypeLegendLabels[], theme: TypeChartLegendTheme) => React.JSX.Element[];
|
|
4
|
+
//# sourceMappingURL=useChartLabels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useChartLabels.d.ts","sourceRoot":"","sources":["../../../src/ChartLegend/useChartLabels.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAC,oBAAoB,EAAE,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAmE/E,eAAO,MAAM,cAAc,iBACX,gBAAgB,EAAE,SACzB,oBAAoB,wBAmB5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../src/Menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAc/B,OAAY,EAAC,YAAY,EAAC,MAAM,UAAU,CAAC;AAI3C,OAAc,EAAC,cAAc,EAAC,MAAM,YAAY,CAAC;AAIjD,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EAEjB,aAAa,EAEd,MAAM,aAAa,CAAC;AA8CrB,eAAO,MAAM,QAAQ;kMAgBlB,iBAAiB;;CAuLnB,CAAC;AACF,eAAO,MAAM,YAAY;YAAW,iBAAiB;;CAEpD,CAAC;AACF,eAAO,MAAM,SAAS;YAAW,iBAAiB;;CAEjD,CAAC;
|
|
1
|
+
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../src/Menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAc/B,OAAY,EAAC,YAAY,EAAC,MAAM,UAAU,CAAC;AAI3C,OAAc,EAAC,cAAc,EAAC,MAAM,YAAY,CAAC;AAIjD,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EAEjB,aAAa,EAEd,MAAM,aAAa,CAAC;AA8CrB,eAAO,MAAM,QAAQ;kMAgBlB,iBAAiB;;CAuLnB,CAAC;AACF,eAAO,MAAM,YAAY;YAAW,iBAAiB;;CAEpD,CAAC;AACF,eAAO,MAAM,SAAS;YAAW,iBAAiB;;CAEjD,CAAC;AAUF,eAAO,MAAM,SAAS;mEAMnB,kBAAkB;;CA2BpB,CAAC;AAEF,eAAO,MAAM,WAAW;YAAW,YAAY;;CAQ9C,CAAC;AAyEF,eAAO,MAAM,IAAI;2EAQd,aAAa;;;uEAtHb,kBAAkB;;;;sMA7MlB,iBAAiB;;;;gBAwLgB,iBAAiB;;;;gBAGpB,iBAAiB;;;;gBA+Cf,YAAY;;;;gBAUf,cAAc;;;CAiI7C,CAAC;AAqBF,eAAO,MAAM,UAAU,2FASpB,mBAAmB,sBA+CrB,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Menu/styles.ts"],"names":[],"mappings":";AAGA,OAAO,KAAK,EAAC,0BAA0B,EAAC,MAAM,qBAAqB,CAAC;AAEpE,eAAO,MAAM,iBAAiB,uyMAoE7B,CAAC;
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/Menu/styles.ts"],"names":[],"mappings":";AAGA,OAAO,KAAK,EAAC,0BAA0B,EAAC,MAAM,qBAAqB,CAAC;AAEpE,eAAO,MAAM,iBAAiB,uyMAoE7B,CAAC;AAEF,eAAO,MAAM,kBAAkB,+wMAQ9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Numeral.d.ts","sourceRoot":"","sources":["../../../src/Numeral/Numeral.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Numeral.d.ts","sourceRoot":"","sources":["../../../src/Numeral/Numeral.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgB/B,OAAO,KAAK,EAAoB,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AAyHxE,QAAA,MAAM,OAAO,UAAW,gBAAgB,sBA0CvC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -11,6 +11,8 @@ export interface TypeNumeralProps extends Omit<TypeTextProps, 'children'> {
|
|
|
11
11
|
currency?: string;
|
|
12
12
|
/** A boolean determining whether or not the number should be abbreviated, or a number representing the abbreviation threshold */
|
|
13
13
|
abbreviate?: boolean | number;
|
|
14
|
+
/** Text to be read off by screen readers for invalid values (i.e., any value rendered as '—' (em dash)) */
|
|
15
|
+
invalidNumberLabel?: string;
|
|
14
16
|
/** Override the default decimal precision (2 for decimals/currency, 1 for percentages), or "none" allowing unrestricted precision. */
|
|
15
17
|
precision?: number | 'none';
|
|
16
18
|
qa?: TypeQaProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumeralTypes.d.ts","sourceRoot":"","sources":["../../../src/Numeral/NumeralTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAE9C,oBAAY,iBAAiB,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AAEnE,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC;IACvE,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAEnC,mIAAmI;IACnI,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAE3B,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,kIAAkI;IAClI,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAE9B,sIAAsI;IACtI,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,EAAE,CAAC,EAAE,WAAW,CAAC;CAClB"}
|
|
1
|
+
{"version":3,"file":"NumeralTypes.d.ts","sourceRoot":"","sources":["../../../src/Numeral/NumeralTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAE9C,oBAAY,iBAAiB,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AAEnE,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC;IACvE,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAEnC,mIAAmI;IACnI,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAE3B,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,kIAAkI;IAClI,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAE9B,2GAA2G;IAC3G,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B,sIAAsI;IACtI,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,EAAE,CAAC,EAAE,WAAW,CAAC;CAClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testNumeral.d.ts","sourceRoot":"","sources":["../../../../../src/Numeral/__tests__/features/testNumeral.tsx"],"names":[],"mappings":"AAWA,QAAA,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"testNumeral.d.ts","sourceRoot":"","sources":["../../../../../src/Numeral/__tests__/features/testNumeral.tsx"],"names":[],"mappings":"AAWA,QAAA,MAAM,WAAW,2DA0BhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _excluded = ["children"],
|
|
2
2
|
_excluded2 = ["children"],
|
|
3
3
|
_excluded3 = ["children"],
|
|
4
|
-
_excluded4 = ["affordance", "children"];
|
|
4
|
+
_excluded4 = ["affordance", "children", "external", "color"];
|
|
5
5
|
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
|
6
6
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
7
7
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -42,25 +42,32 @@ export var CardAffordance = function CardAffordance(_ref5) {
|
|
|
42
42
|
var rest = _extends({}, (_objectDestructuringEmpty(_ref5), _ref5));
|
|
43
43
|
return /*#__PURE__*/React.createElement(StyledCardAffordance, _extends({}, rest, {
|
|
44
44
|
size: "mini",
|
|
45
|
-
name: "arrow-right"
|
|
45
|
+
name: "arrow-right"
|
|
46
|
+
// TODO: probably need to make this available to the top level for external links https://sprout.atlassian.net/browse/DS-2223
|
|
47
|
+
,
|
|
46
48
|
"aria-hidden": true
|
|
47
49
|
}));
|
|
48
50
|
};
|
|
49
|
-
|
|
50
|
-
// jsdocs, never types?
|
|
51
|
-
|
|
52
51
|
export var CardLink = function CardLink(_ref6) {
|
|
53
52
|
var affordance = _ref6.affordance,
|
|
54
53
|
children = _ref6.children,
|
|
54
|
+
_ref6$external = _ref6.external,
|
|
55
|
+
external = _ref6$external === void 0 ? false : _ref6$external,
|
|
56
|
+
color = _ref6.color,
|
|
55
57
|
rest = _objectWithoutProperties(_ref6, _excluded4);
|
|
56
58
|
var _useContext = useContext(SubComponentContext),
|
|
57
59
|
href = _useContext.href,
|
|
58
60
|
linkRef = _useContext.linkRef;
|
|
59
61
|
return /*#__PURE__*/React.createElement(StyledCardLink, _extends({}, rest, {
|
|
60
|
-
target:
|
|
61
|
-
rel:
|
|
62
|
+
target: external ? '_blank' : undefined,
|
|
63
|
+
rel: external ? 'noreferrer' : undefined,
|
|
62
64
|
href: href,
|
|
63
65
|
ref: linkRef
|
|
66
|
+
// TODO: fix this type since `color` should be valid here. TS can't resolve the correct type.
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
68
|
+
// @ts-ignore
|
|
69
|
+
,
|
|
70
|
+
color: color
|
|
64
71
|
}), /*#__PURE__*/React.createElement(React.Fragment, null, children, affordance ? /*#__PURE__*/React.createElement(CardAffordance, {
|
|
65
72
|
ml: 300
|
|
66
73
|
}) : null));
|
|
@@ -3,38 +3,20 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
3
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
5
|
import * as React from 'react';
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import Container, { Label, Swatch } from "./styles";
|
|
9
|
-
function getSwatchColor(theme, index) {
|
|
10
|
-
return THEME_MAP[theme.toUpperCase()][index];
|
|
11
|
-
}
|
|
12
|
-
function getLabels(legendLabels, theme) {
|
|
13
|
-
return legendLabels.map(function (label, i) {
|
|
14
|
-
var labelColor = label.color ? label.color : getSwatchColor(theme, i);
|
|
15
|
-
return /*#__PURE__*/React.createElement(Label, {
|
|
16
|
-
key: label.name
|
|
17
|
-
}, /*#__PURE__*/React.createElement(Swatch, {
|
|
18
|
-
bg: labelColor,
|
|
19
|
-
"data-qa-swatch": ""
|
|
20
|
-
}), /*#__PURE__*/React.createElement(Text, {
|
|
21
|
-
as: "div",
|
|
22
|
-
fontSize: 200,
|
|
23
|
-
breakWord: true
|
|
24
|
-
}, label.name));
|
|
25
|
-
});
|
|
26
|
-
}
|
|
6
|
+
import Container from "./styles";
|
|
7
|
+
import { useChartLabels } from "./useChartLabels";
|
|
27
8
|
var ChartLegend = function ChartLegend(_ref) {
|
|
28
9
|
var legendLabels = _ref.legendLabels,
|
|
29
10
|
stacked = _ref.stacked,
|
|
30
11
|
_ref$theme = _ref.theme,
|
|
31
|
-
theme = _ref$theme === void 0 ? '
|
|
12
|
+
theme = _ref$theme === void 0 ? 'datavizRotation' : _ref$theme,
|
|
32
13
|
qa = _ref.qa,
|
|
33
14
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
15
|
+
var chartLabels = useChartLabels(legendLabels, theme);
|
|
34
16
|
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
35
17
|
inline: !stacked,
|
|
36
18
|
"data-qa-chartlegend": "",
|
|
37
19
|
qa: qa
|
|
38
|
-
}, rest),
|
|
20
|
+
}, rest), chartLabels);
|
|
39
21
|
};
|
|
40
22
|
export default ChartLegend;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useTheme } from 'styled-components';
|
|
3
|
+
import { Label, Swatch } from "./styles";
|
|
4
|
+
import { Text } from "../Text";
|
|
5
|
+
var getSwatchColor = function getSwatchColor(theme, index, RacineThemeColors) {
|
|
6
|
+
var COMPARE_THEME = [RacineThemeColors.dataviz.map['1'], RacineThemeColors.dataviz.map['10'], RacineThemeColors.dataviz.map['11'], RacineThemeColors.dataviz.map['2']];
|
|
7
|
+
var CONTRAST_THEME = [RacineThemeColors.dataviz.map['1'], RacineThemeColors.dataviz.map['2'], RacineThemeColors.dataviz.map['3'], RacineThemeColors.dataviz.map['4'], RacineThemeColors.dataviz.map['5'], RacineThemeColors.dataviz.map['6'], RacineThemeColors.dataviz.map['4'], RacineThemeColors.dataviz.map['5'], RacineThemeColors.dataviz.map['6'], RacineThemeColors.dataviz.map['7'], RacineThemeColors.dataviz.map['8'], RacineThemeColors.dataviz.map['9'], RacineThemeColors.dataviz.map['10']];
|
|
8
|
+
var EXTENDED_THEME = [RacineThemeColors.dataviz.map['7'], RacineThemeColors.dataviz.map['1'], RacineThemeColors.dataviz.map['5'], RacineThemeColors.dataviz.map['11'], RacineThemeColors.dataviz.map['6'], RacineThemeColors.dataviz.map['3'], RacineThemeColors.dataviz.map['18'], RacineThemeColors.dataviz.map['8'], RacineThemeColors.dataviz.map['4'], RacineThemeColors.dataviz.map['13'], RacineThemeColors.dataviz.map['16'], RacineThemeColors.dataviz.map['10'], RacineThemeColors.dataviz.map['14'], RacineThemeColors.dataviz.map['2'], RacineThemeColors.dataviz.map['15'], RacineThemeColors.dataviz.map['12'], RacineThemeColors.dataviz.map['9'], RacineThemeColors.dataviz.map['17'], RacineThemeColors.dataviz.map['20'], RacineThemeColors.dataviz.map['19']];
|
|
9
|
+
var THEME_MAP = {
|
|
10
|
+
COMPARE: COMPARE_THEME,
|
|
11
|
+
CONTRAST: CONTRAST_THEME,
|
|
12
|
+
EXTENDED: EXTENDED_THEME,
|
|
13
|
+
DATAVIZROTATION: RacineThemeColors.dataviz.list
|
|
14
|
+
};
|
|
15
|
+
return THEME_MAP[theme.toUpperCase()][index];
|
|
16
|
+
};
|
|
17
|
+
export var useChartLabels = function useChartLabels(legendLabels, theme) {
|
|
18
|
+
var racineTheme = useTheme();
|
|
19
|
+
var colors = racineTheme.colors;
|
|
20
|
+
return legendLabels.map(function (label, i) {
|
|
21
|
+
var labelColor = label.color ? label.color : getSwatchColor(theme, i, colors);
|
|
22
|
+
return /*#__PURE__*/React.createElement(Label, {
|
|
23
|
+
key: label.name
|
|
24
|
+
}, /*#__PURE__*/React.createElement(Swatch, {
|
|
25
|
+
bg: labelColor,
|
|
26
|
+
"data-qa-swatch": ""
|
|
27
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
28
|
+
as: "div",
|
|
29
|
+
fontSize: 200,
|
|
30
|
+
breakWord: true
|
|
31
|
+
}, label.name));
|
|
32
|
+
});
|
|
33
|
+
};
|
package/lib/Link/Link.js
CHANGED
|
@@ -11,7 +11,8 @@ var Link = function Link(_ref) {
|
|
|
11
11
|
disabled = _ref.disabled,
|
|
12
12
|
onClick = _ref.onClick,
|
|
13
13
|
as = _ref.as,
|
|
14
|
-
underline = _ref.underline,
|
|
14
|
+
_ref$underline = _ref.underline,
|
|
15
|
+
underline = _ref$underline === void 0 ? true : _ref$underline,
|
|
15
16
|
_ref$qa = _ref.qa,
|
|
16
17
|
qa = _ref$qa === void 0 ? {} : _ref$qa,
|
|
17
18
|
rest = _objectWithoutProperties(_ref, _excluded);
|
package/lib/Menu/Menu.js
CHANGED
|
@@ -237,29 +237,49 @@ export var MenuRadio = function MenuRadio(props) {
|
|
|
237
237
|
role: MENU_ITEM_ROLES.RADIO
|
|
238
238
|
}, props));
|
|
239
239
|
};
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
240
|
+
var MenuTitle = styled(Text).withConfig({
|
|
241
|
+
displayName: "Menu__MenuTitle",
|
|
242
|
+
componentId: "sc-1jmjosz-0"
|
|
243
|
+
})(["font-weight:600;padding-left:", ";padding-top:", ";padding-bottom:", ";color:", ";"], function (_ref2) {
|
|
244
|
+
var theme = _ref2.theme;
|
|
245
|
+
return theme.space[300];
|
|
246
|
+
}, function (_ref3) {
|
|
247
|
+
var theme = _ref3.theme;
|
|
248
|
+
return theme.space[200];
|
|
249
|
+
}, function (_ref4) {
|
|
250
|
+
var theme = _ref4.theme;
|
|
251
|
+
return theme.space[300];
|
|
252
|
+
}, function (_ref5) {
|
|
253
|
+
var theme = _ref5.theme;
|
|
254
|
+
return theme.colors.text.headline;
|
|
255
|
+
});
|
|
256
|
+
var _StyledMenuTitle = styled(MenuTitle).withConfig({
|
|
257
|
+
displayName: "Menu___StyledMenuTitle",
|
|
258
|
+
componentId: "sc-1jmjosz-1"
|
|
259
|
+
})(["", ""], function (p) {
|
|
260
|
+
return p.$_css;
|
|
261
|
+
});
|
|
262
|
+
export var MenuGroup = function MenuGroup(_ref6) {
|
|
263
|
+
var children = _ref6.children,
|
|
264
|
+
title = _ref6.title,
|
|
265
|
+
titleAs = _ref6.titleAs,
|
|
266
|
+
_ref6$disabled = _ref6.disabled,
|
|
267
|
+
isDisabled = _ref6$disabled === void 0 ? false : _ref6$disabled,
|
|
268
|
+
props = _objectWithoutProperties(_ref6, _excluded2);
|
|
269
|
+
var menuTitleId = uniqueId('menu-title-');
|
|
270
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, _extends({
|
|
271
|
+
p: 300,
|
|
272
|
+
role: "group",
|
|
273
|
+
"aria-labelledby": title ? menuTitleId : undefined,
|
|
249
274
|
borderTop: "1px solid",
|
|
250
|
-
borderColor: "container.border.base"
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
275
|
+
borderColor: "container.border.base"
|
|
276
|
+
}, props), title && /*#__PURE__*/React.createElement(_StyledMenuTitle, {
|
|
277
|
+
id: menuTitleId,
|
|
278
|
+
role: "presentation",
|
|
254
279
|
fontSize: 200,
|
|
255
|
-
|
|
256
|
-
mt: 350,
|
|
257
|
-
color: "text.headline",
|
|
280
|
+
forwardedAs: titleAs || 'li',
|
|
258
281
|
$_css: isDisabled ? disabled : undefined
|
|
259
|
-
}, title)
|
|
260
|
-
p: 300,
|
|
261
|
-
role: "group"
|
|
262
|
-
}), children));
|
|
282
|
+
}, title), children));
|
|
263
283
|
};
|
|
264
284
|
export var MenuDivider = function MenuDivider(props) {
|
|
265
285
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
@@ -302,12 +322,12 @@ var MenuFilterInput = function MenuFilterInput(props) {
|
|
|
302
322
|
onBlur: handleOnBlur
|
|
303
323
|
}));
|
|
304
324
|
};
|
|
305
|
-
var MenuItems = function MenuItems(
|
|
306
|
-
var children =
|
|
307
|
-
role =
|
|
308
|
-
multiselect =
|
|
309
|
-
innerRef =
|
|
310
|
-
props = _objectWithoutProperties(
|
|
325
|
+
var MenuItems = function MenuItems(_ref7) {
|
|
326
|
+
var children = _ref7.children,
|
|
327
|
+
role = _ref7.role,
|
|
328
|
+
multiselect = _ref7.multiselect,
|
|
329
|
+
innerRef = _ref7.innerRef,
|
|
330
|
+
props = _objectWithoutProperties(_ref7, _excluded3);
|
|
311
331
|
var _useMenuKeyDown = useMenuKeyDown(),
|
|
312
332
|
handleKeyDown = _useMenuKeyDown.handleKeyDown,
|
|
313
333
|
activeDescendent = _useMenuKeyDown.activeDescendent;
|
|
@@ -327,15 +347,15 @@ var MenuItems = function MenuItems(_ref3) {
|
|
|
327
347
|
overflow: "hidden"
|
|
328
348
|
}), children);
|
|
329
349
|
};
|
|
330
|
-
export var Menu = function Menu(
|
|
331
|
-
var
|
|
332
|
-
role =
|
|
333
|
-
children =
|
|
334
|
-
onChange =
|
|
335
|
-
value =
|
|
336
|
-
multiselect =
|
|
337
|
-
innerRef =
|
|
338
|
-
props = _objectWithoutProperties(
|
|
350
|
+
export var Menu = function Menu(_ref8) {
|
|
351
|
+
var _ref8$role = _ref8.role,
|
|
352
|
+
role = _ref8$role === void 0 ? MENU_ROLES.MENU : _ref8$role,
|
|
353
|
+
children = _ref8.children,
|
|
354
|
+
onChange = _ref8.onChange,
|
|
355
|
+
value = _ref8.value,
|
|
356
|
+
multiselect = _ref8.multiselect,
|
|
357
|
+
innerRef = _ref8.innerRef,
|
|
358
|
+
props = _objectWithoutProperties(_ref8, _excluded4);
|
|
339
359
|
var _useDescendants = useDescendants(),
|
|
340
360
|
_useDescendants2 = _slicedToArray(_useDescendants, 2),
|
|
341
361
|
descendants = _useDescendants2[0],
|
|
@@ -392,20 +412,20 @@ Menu.Divider = MenuDivider;
|
|
|
392
412
|
Menu.FilterInput = MenuFilterInput;
|
|
393
413
|
var CustomPopoutContent = styled(Popout.Content).withConfig({
|
|
394
414
|
displayName: "Menu__CustomPopoutContent",
|
|
395
|
-
componentId: "sc-1jmjosz-
|
|
415
|
+
componentId: "sc-1jmjosz-2"
|
|
396
416
|
})(["padding:0;margin-left:0;margin-right:0;"]);
|
|
397
|
-
export var MenuButton = function MenuButton(
|
|
398
|
-
var content =
|
|
399
|
-
popoutProps =
|
|
400
|
-
children =
|
|
401
|
-
_onClick =
|
|
402
|
-
|
|
403
|
-
closeOnItemClick =
|
|
404
|
-
|
|
405
|
-
id =
|
|
406
|
-
|
|
407
|
-
placement =
|
|
408
|
-
props = _objectWithoutProperties(
|
|
417
|
+
export var MenuButton = function MenuButton(_ref9) {
|
|
418
|
+
var content = _ref9.content,
|
|
419
|
+
popoutProps = _ref9.popoutProps,
|
|
420
|
+
children = _ref9.children,
|
|
421
|
+
_onClick = _ref9.onClick,
|
|
422
|
+
_ref9$closeOnItemClic = _ref9.closeOnItemClick,
|
|
423
|
+
closeOnItemClick = _ref9$closeOnItemClic === void 0 ? true : _ref9$closeOnItemClic,
|
|
424
|
+
_ref9$id = _ref9.id,
|
|
425
|
+
id = _ref9$id === void 0 ? uniqueId('MenuButton-') : _ref9$id,
|
|
426
|
+
_ref9$placement = _ref9.placement,
|
|
427
|
+
placement = _ref9$placement === void 0 ? 'bottom' : _ref9$placement,
|
|
428
|
+
props = _objectWithoutProperties(_ref9, _excluded5);
|
|
409
429
|
var _useState5 = useState(false),
|
|
410
430
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
411
431
|
isOpen = _useState6[0],
|
|
@@ -445,10 +465,4 @@ export var MenuButton = function MenuButton(_ref5) {
|
|
|
445
465
|
}
|
|
446
466
|
}), children)));
|
|
447
467
|
};
|
|
448
|
-
export default Menu;
|
|
449
|
-
var _StyledText = styled(Text).withConfig({
|
|
450
|
-
displayName: "Menu___StyledText",
|
|
451
|
-
componentId: "sc-1jmjosz-1"
|
|
452
|
-
})(["", ""], function (p) {
|
|
453
|
-
return p.$_css;
|
|
454
|
-
});
|
|
468
|
+
export default Menu;
|
package/lib/Menu/styles.js
CHANGED
|
@@ -44,4 +44,4 @@ export var MenuItemContainer = styled(Box).withConfig({
|
|
|
44
44
|
export var MenuItemsContainer = styled(Box).withConfig({
|
|
45
45
|
displayName: "styles__MenuItemsContainer",
|
|
46
46
|
componentId: "sc-168zlb1-1"
|
|
47
|
-
})(["list-style-type:none;&:focus{", "}"], focusRing);
|
|
47
|
+
})(["list-style-type:none;&:focus{", "}& > div[role='group']:first-of-type{border-top:none;}"], focusRing);
|
package/lib/Numeral/Numeral.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["number", "locale", "format", "currency", "abbreviate", "precision", "qa"];
|
|
1
|
+
var _excluded = ["number", "locale", "format", "currency", "abbreviate", "invalidNumberLabel", "precision", "qa"];
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
4
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -12,6 +12,7 @@ import * as React from 'react';
|
|
|
12
12
|
import memoize from 'lru-memoize';
|
|
13
13
|
import { EM_DASH } from "../utils/constants";
|
|
14
14
|
import Tooltip from "../Tooltip";
|
|
15
|
+
import { VisuallyHidden } from "../VisuallyHidden";
|
|
15
16
|
import { DEFAULT_THRESHOLD, MEMO_CACHE_SIZE, COMPARE_OBJECTS, MAX_PRECISION, ABBREV_PRECISION, DefaultPrecisions } from "./constants";
|
|
16
17
|
import { AbbrContainer, Container } from "./styles";
|
|
17
18
|
var _getNumberFormatters = function _getNumberFormatters(options) {
|
|
@@ -76,6 +77,7 @@ var normalizeArgs = function normalizeArgs(props) {
|
|
|
76
77
|
currency = _props$currency === void 0 ? 'USD' : _props$currency,
|
|
77
78
|
_props$abbreviate = props.abbreviate,
|
|
78
79
|
abbreviate = _props$abbreviate === void 0 ? true : _props$abbreviate,
|
|
80
|
+
invalidNumberLabel = props.invalidNumberLabel,
|
|
79
81
|
precision = props.precision,
|
|
80
82
|
qa = props.qa,
|
|
81
83
|
rest = _objectWithoutProperties(props, _excluded);
|
|
@@ -97,6 +99,7 @@ var normalizeArgs = function normalizeArgs(props) {
|
|
|
97
99
|
return {
|
|
98
100
|
value: value,
|
|
99
101
|
canAbbreviate: canAbbreviate,
|
|
102
|
+
invalidNumberLabel: invalidNumberLabel,
|
|
100
103
|
options: options,
|
|
101
104
|
qa: qa,
|
|
102
105
|
rest: rest
|
|
@@ -106,10 +109,16 @@ var Numeral = function Numeral(props) {
|
|
|
106
109
|
var _normalizeArgs = normalizeArgs(props),
|
|
107
110
|
value = _normalizeArgs.value,
|
|
108
111
|
canAbbreviate = _normalizeArgs.canAbbreviate,
|
|
112
|
+
invalidNumberLabel = _normalizeArgs.invalidNumberLabel,
|
|
109
113
|
options = _normalizeArgs.options,
|
|
110
114
|
qa = _normalizeArgs.qa,
|
|
111
115
|
rest = _normalizeArgs.rest;
|
|
112
|
-
if (!isValidNumber(props.number)) return /*#__PURE__*/React.createElement(
|
|
116
|
+
if (!isValidNumber(props.number)) return /*#__PURE__*/React.createElement(React.Fragment, null, invalidNumberLabel &&
|
|
117
|
+
/*#__PURE__*/
|
|
118
|
+
// Give screen readers something useful to read off + hide the em dash
|
|
119
|
+
React.createElement(VisuallyHidden, null, invalidNumberLabel), /*#__PURE__*/React.createElement(Container, _extends({
|
|
120
|
+
"aria-hidden": true
|
|
121
|
+
}, qa), EM_DASH));
|
|
113
122
|
var formatters = getNumberFormatters(options);
|
|
114
123
|
var fullText = formatters.standard.format(value);
|
|
115
124
|
if (canAbbreviate) {
|