@sproutsocial/racine 16.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 +77 -0
- package/README.md +16 -14
- package/__flow__/Card/Card.flow.js +5 -1
- package/__flow__/Card/CardTypes.flow.js +8 -1
- package/__flow__/EnumLogoNames.flow.js +1 -1
- package/__flow__/Icon/Icon.flow.js +2 -2
- package/__flow__/LogoViewBoxes.js +14 -0
- package/__flow__/Numeral/Numeral.flow.js +2 -0
- package/__flow__/PartnerLogo/PartnerLogo.flow.js +7 -2
- package/__flow__/PartnerLogo/index.flow.js +1 -2
- package/__flow__/Toast/Toast.flow.js +2 -2
- package/__flow__/index.flow.js +1 -2
- package/commonjs/Card/Card.js +14 -9
- package/commonjs/Card/index.js +8 -1
- package/commonjs/Card/styles.js +40 -12
- package/commonjs/Card/subComponents.js +46 -5
- package/commonjs/Card/utils.js +9 -5
- package/commonjs/ChartLegend/ChartLegend.js +6 -23
- package/commonjs/ChartLegend/useChartLabels.js +41 -0
- package/commonjs/Icon/Icon.js +3 -2
- package/commonjs/Link/Link.js +2 -1
- package/commonjs/LogoViewBoxes.js +14 -0
- package/commonjs/Menu/Menu.js +69 -55
- package/commonjs/Menu/styles.js +1 -1
- package/commonjs/Numeral/Numeral.js +11 -2
- package/commonjs/PartnerLogo/PartnerLogo.js +34 -29
- package/commonjs/PartnerLogo/PartnerLogoTypes.js +14 -3
- package/commonjs/PartnerLogo/index.flow.js +0 -11
- package/commonjs/Switch/styles.js +1 -1
- package/commonjs/iconNames.js +8 -0
- package/commonjs/illustrationNames.js +8 -0
- package/commonjs/index.js +24 -0
- package/commonjs/logoNames.js +8 -0
- package/dist/logo.svg +1 -1
- package/dist/logoList.js +1 -1
- package/dist/types/Card/Card.d.ts.map +1 -1
- package/dist/types/Card/CardTypes.d.ts +11 -1
- package/dist/types/Card/CardTypes.d.ts.map +1 -1
- package/dist/types/Card/index.d.ts +1 -1
- package/dist/types/Card/index.d.ts.map +1 -1
- package/dist/types/Card/styles.d.ts +9 -1
- package/dist/types/Card/styles.d.ts.map +1 -1
- package/dist/types/Card/subComponents.d.ts +5 -0
- package/dist/types/Card/subComponents.d.ts.map +1 -1
- package/dist/types/Card/utils.d.ts +2 -1
- package/dist/types/Card/utils.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/EnumLogoNames.d.ts +1 -1
- package/dist/types/EnumLogoNames.d.ts.map +1 -1
- package/dist/types/Icon/Icon.d.ts.map +1 -1
- package/dist/types/Icon/IconTypes.d.ts +2 -2
- package/dist/types/Icon/IconTypes.d.ts.map +1 -1
- 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/dist/types/PartnerLogo/PartnerLogo.d.ts.map +1 -1
- package/dist/types/PartnerLogo/PartnerLogoTypes.d.ts +13 -4
- package/dist/types/PartnerLogo/PartnerLogoTypes.d.ts.map +1 -1
- package/dist/types/Switch/styles.d.ts.map +1 -1
- package/dist/types/Toast/ToastTypes.d.ts +2 -2
- package/dist/types/Toast/ToastTypes.d.ts.map +1 -1
- package/dist/types/iconNames.d.ts +3 -0
- package/dist/types/iconNames.d.ts.map +1 -0
- package/dist/types/illustrationNames.d.ts +3 -0
- package/dist/types/illustrationNames.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/logoNames.d.ts +3 -0
- package/dist/types/logoNames.d.ts.map +1 -0
- package/lib/Card/Card.js +15 -10
- package/lib/Card/index.js +1 -1
- package/lib/Card/styles.js +38 -12
- package/lib/Card/subComponents.js +41 -4
- package/lib/Card/utils.js +9 -5
- package/lib/ChartLegend/ChartLegend.js +5 -23
- package/lib/ChartLegend/useChartLabels.js +33 -0
- package/lib/Icon/Icon.js +3 -2
- package/lib/Link/Link.js +2 -1
- package/lib/LogoViewBoxes.js +14 -0
- package/lib/Menu/Menu.js +69 -55
- package/lib/Menu/styles.js +1 -1
- package/lib/Numeral/Numeral.js +11 -2
- package/lib/PartnerLogo/PartnerLogo.js +34 -27
- package/lib/PartnerLogo/PartnerLogoTypes.js +13 -2
- package/lib/PartnerLogo/index.flow.js +1 -2
- package/lib/Switch/styles.js +1 -1
- package/lib/iconNames.js +1 -0
- package/lib/illustrationNames.js +1 -0
- package/lib/index.js +4 -0
- package/lib/logoNames.js +1 -0
- package/package.json +3 -2
- package/__flow__/PartnerLogo/TypePartnerNames.flow.js +0 -3
- package/commonjs/PartnerLogo/TypePartnerNames.flow.js +0 -1
- package/lib/PartnerLogo/TypePartnerNames.flow.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,82 @@
|
|
|
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
|
+
|
|
36
|
+
## 17.0.0
|
|
37
|
+
|
|
38
|
+
### Major Changes
|
|
39
|
+
|
|
40
|
+
- 5234f32d: Accessibility updates to Card based on Perkins review.
|
|
41
|
+
|
|
42
|
+
**Breaking changes**
|
|
43
|
+
|
|
44
|
+
- Card using role='link' will no longer work without the `CardLink` subcomponent
|
|
45
|
+
|
|
46
|
+
**Enhancements**
|
|
47
|
+
|
|
48
|
+
- Cards with `role='link'` should now wrap link text in the `CardLink` subcomponent
|
|
49
|
+
- Improves screen reader accessibility by pairing Cards as links with the new `CardLink` subcomponent
|
|
50
|
+
- Adds `CardLink` subcomponent
|
|
51
|
+
- Link text wrapped in CardLink renders an anchor tag as a child of Card
|
|
52
|
+
- Preserves the behavior that allows the user to click the whole Card as the link
|
|
53
|
+
- Handles navigating to the href using default link behavior.
|
|
54
|
+
- Includes an `affordance` prop that makes composing a Card as a link easy and visually appealing
|
|
55
|
+
|
|
56
|
+
### Minor Changes
|
|
57
|
+
|
|
58
|
+
- 99b984a6: Add the following Partner Logos:
|
|
59
|
+
- android
|
|
60
|
+
- apple
|
|
61
|
+
- github
|
|
62
|
+
- github-alien
|
|
63
|
+
- salesforce-cloud
|
|
64
|
+
- 6c2753bc: Adds Tableau symbol and lockup to the `PartnerLogo` component
|
|
65
|
+
|
|
66
|
+
### Patch Changes
|
|
67
|
+
|
|
68
|
+
- b31737fa: Fixed automation for `PartnerLogo` names and type, which updated `PartnerLogoNames` and `EnumLogoNames` so they now include all logos.
|
|
69
|
+
|
|
70
|
+
**Deprecation Warning**:
|
|
71
|
+
|
|
72
|
+
- `PartnerNames` is now deprecated in favor of `PartnerLogoNames`
|
|
73
|
+
- `TypePartnerNames` is now deprecated in favor of `EnumLogoNames`
|
|
74
|
+
|
|
75
|
+
- fb536bed: Applies `box-sizing: content-box` property to Switch loading state in order to avoid conflicts with global CSS reset properties
|
|
76
|
+
- adec46fc: Updates Toast to accept Partner Logo names for 'icon' prop
|
|
77
|
+
- Toast erroneously did not accept Partner Logo names for the 'icon' prop, even after the Icon component was updated to render PartnerLogos.
|
|
78
|
+
- The Flow and Typescript types have been updated to add all partner names to the valid values for the 'icon' prop.
|
|
79
|
+
|
|
3
80
|
## 16.0.0
|
|
4
81
|
|
|
5
82
|
### Major Changes
|
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
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @flow
|
|
2
|
-
export type EnumLogoNames = "adobe-experience-manager
|
|
2
|
+
export type EnumLogoNames = "adobe-experience-manager" | "android" | "apple-app-store" | "apple" | "bigcommerce" | "bitly" | "bynder" | "canva" | "dropbox" | "facebook-audience-network" | "facebook" | "facebook-groups" | "facebook-shops" | "feedly" | "github" | "glassdoor" | "google-analytics" | "google-business-messages" | "google-drive" | "google-my-business" | "google-play-store" | "hubspot" | "instagram" | "linkedin-audience-network" | "linkedin" | "marketo" | "messenger" | "microsoft-dynamics" | "pinterest" | "reddit-alien" | "reddit" | "salesforce-cloud" | "salesforce" | "shopify" | "slack" | "sproutsocial" | "tableau" | "tiktok" | "tripadvisor" | "tumblr" | "twitter-audience-network" | "twitter" | "whatsapp" | "woocommerce" | "yelp" | "youtube" | "zendesk";
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import type { StyledComponent } from 'styled-components';
|
|
4
4
|
import type { EnumIconNames } from "../EnumIconNames.flow";
|
|
5
|
+
import type { EnumLogoNames } from "../EnumLogoNames.flow";
|
|
5
6
|
import type { TypeWithDisplayName } from "../types/shared.flow";
|
|
6
7
|
import type { TypeTheme } from "../types/theme.flow";
|
|
7
8
|
import deprecatedIcons from "./deprecatedIcons.flow";
|
|
8
|
-
import type { TypePartnerNames } from "../PartnerLogo/TypePartnerNames.flow";
|
|
9
9
|
export type TypeIconSize = 'mini' // 12x12
|
|
10
10
|
// TODO: deprecate default in favor of small in future release
|
|
11
11
|
| 'default' // 16x16
|
|
@@ -14,7 +14,7 @@ export type TypeIconSize = 'mini' // 12x12
|
|
|
14
14
|
| 'large' // 32x32
|
|
15
15
|
| 'jumbo'; // 64x64
|
|
16
16
|
|
|
17
|
-
export type TypeIconName = EnumIconNames | $Keys<typeof deprecatedIcons> |
|
|
17
|
+
export type TypeIconName = EnumIconNames | $Keys<typeof deprecatedIcons> | EnumLogoNames;
|
|
18
18
|
export type TypeIconProps = {
|
|
19
19
|
/** Name of the icon in the svg sprite */
|
|
20
20
|
name: TypeIconName,
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
"adobe-experience-manager-dark": "0 0 16 17",
|
|
3
3
|
"adobe-experience-manager": "0 0 16 17",
|
|
4
|
+
"android-dark": "0 0 18 18",
|
|
5
|
+
"android": "0 0 18 18",
|
|
4
6
|
"apple-app-store-dark": "0 0 140 140",
|
|
5
7
|
"apple-app-store": "0 0 140 140",
|
|
8
|
+
"apple-dark": "0 0 18 18",
|
|
9
|
+
"apple": "0 0 18 18",
|
|
6
10
|
"bigcommerce-dark": "0 0 140 140",
|
|
7
11
|
"bigcommerce-lockup-dark": "0 0 291 66",
|
|
8
12
|
"bigcommerce-lockup": "0 0 291 66",
|
|
@@ -29,6 +33,8 @@ module.exports = {
|
|
|
29
33
|
"facebook": "0 0 141 139",
|
|
30
34
|
"feedly-dark": "0 0 141 123",
|
|
31
35
|
"feedly": "0 0 141 123",
|
|
36
|
+
"github-dark": "0 0 18 18",
|
|
37
|
+
"github": "0 0 18 18",
|
|
32
38
|
"glassdoor-dark": "0 0 140 196",
|
|
33
39
|
"glassdoor": "0 0 140 196",
|
|
34
40
|
"google-analytics-dark": "0 0 140 160",
|
|
@@ -57,8 +63,12 @@ module.exports = {
|
|
|
57
63
|
"microsoft-dynamics": "0 0 140 227",
|
|
58
64
|
"pinterest-dark": "0 0 140 141",
|
|
59
65
|
"pinterest": "0 0 140 141",
|
|
66
|
+
"reddit-alien-dark": "0 0 18 18",
|
|
67
|
+
"reddit-alien": "0 0 18 18",
|
|
60
68
|
"reddit-dark": "0 0 140 140",
|
|
61
69
|
"reddit": "0 0 140 140",
|
|
70
|
+
"salesforce-cloud-dark": "0 0 20 18",
|
|
71
|
+
"salesforce-cloud": "0 0 20 18",
|
|
62
72
|
"salesforce-dark": "0 0 140 99",
|
|
63
73
|
"salesforce": "0 0 140 99",
|
|
64
74
|
"shopify-dark": "0 0 140 159",
|
|
@@ -71,6 +81,10 @@ module.exports = {
|
|
|
71
81
|
"sproutsocial-wordmark-dark": "0 0 320 52",
|
|
72
82
|
"sproutsocial-wordmark": "0 0 320 52",
|
|
73
83
|
"sproutsocial": "0 0 140 174",
|
|
84
|
+
"tableau-dark": "0 0 18 18",
|
|
85
|
+
"tableau-lockup-dark": "0 0 291 56",
|
|
86
|
+
"tableau-lockup": "0 0 291 56",
|
|
87
|
+
"tableau": "0 0 18 18",
|
|
74
88
|
"tiktok-dark": "0 0 140 159",
|
|
75
89
|
"tiktok": "0 0 140 159",
|
|
76
90
|
"tripadvisor-dark": "0 0 140 140",
|
|
@@ -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,
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import type {
|
|
3
|
+
import type { EnumLogoNames } from "../EnumLogoNames.flow";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Use EnumLogoNames instead
|
|
7
|
+
*/
|
|
8
|
+
export type TypePartnerNames = EnumLogoNames;
|
|
4
9
|
export type TypePartnerLogoProps = {
|
|
5
10
|
/** The name of the partner whose logo you want to render. */
|
|
6
|
-
partnerName:
|
|
11
|
+
partnerName: EnumLogoNames,
|
|
7
12
|
/** Manually override the default mode behavior by rendering a logo based on the background it's displayed on. */
|
|
8
13
|
backgroundType?: 'dark' | 'light',
|
|
9
14
|
logoType?: 'symbol' | 'wordmark' | 'lockup',
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import type { TypeColor } from "../types/theme.flow";
|
|
4
|
-
import type {
|
|
4
|
+
import type { TypeIconName } from "../Icon/Icon.flow";
|
|
5
5
|
export type TypeToastTheme = 'info' | 'success' | 'warning' | 'error';
|
|
6
6
|
export type TypeToastProps = {|
|
|
7
7
|
theme?: TypeToastTheme,
|
|
8
8
|
content: React.Node,
|
|
9
9
|
color?: TypeColor,
|
|
10
|
-
icon?:
|
|
10
|
+
icon?: TypeIconName,
|
|
11
11
|
|};
|
|
12
12
|
export type TypeToastOptions = {|
|
|
13
13
|
...TypeToastProps,
|
package/__flow__/index.flow.js
CHANGED
|
@@ -105,8 +105,7 @@ export type { EnumDensities, TypeMessageProps } from "./Message/index.flow";
|
|
|
105
105
|
export type { TypeModalProps, TypeModalContentProps, TypeModalFooterProps, TypeModalHeaderProps } from "./Modal/index.flow";
|
|
106
106
|
export type { TypeNumeralProps } from "./Numeral/index.flow";
|
|
107
107
|
export type { TypeOverflowListProps, TypeVirtualizedListProps } from "./OverflowList/index.flow";
|
|
108
|
-
export type { TypePartnerLogoProps } from "./PartnerLogo/index.flow";
|
|
109
|
-
export type { TypePartnerNames } from "./PartnerLogo/TypePartnerNames.flow";
|
|
108
|
+
export type { TypePartnerLogoProps, TypePartnerNames } from "./PartnerLogo/index.flow";
|
|
110
109
|
export type { EnumPlacements, TypePopoutProps } from "./Popout/index.flow";
|
|
111
110
|
export type { TypeRadioProps } from "./Radio/index.flow";
|
|
112
111
|
export type { TypeSegmentedControlProps, TypeSegmentedControlItemProps } from "./SegmentedControl/index.flow";
|
package/commonjs/Card/Card.js
CHANGED
|
@@ -51,13 +51,17 @@ var Card = function Card(_ref) {
|
|
|
51
51
|
hasSubComponent = _useState2[0],
|
|
52
52
|
setHasSubComponent = _useState2[1];
|
|
53
53
|
var containerRef = (0, _react.useRef)(null);
|
|
54
|
+
var linkRef = (0, _react.useRef)(null);
|
|
55
|
+
var isRoleLink = role === 'link';
|
|
54
56
|
var checkedConditions = role === 'checkbox' ? selected : undefined;
|
|
57
|
+
var cardContext = {
|
|
58
|
+
setHasSubComponent: setHasSubComponent,
|
|
59
|
+
href: href,
|
|
60
|
+
linkRef: linkRef
|
|
61
|
+
};
|
|
55
62
|
var handleClickConditions = function handleClickConditions(e) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
href: href,
|
|
59
|
-
ref: containerRef
|
|
60
|
-
}) : onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
63
|
+
var _linkRef$current;
|
|
64
|
+
return isRoleLink ? (_linkRef$current = linkRef.current) === null || _linkRef$current === void 0 ? void 0 : _linkRef$current.click() : onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
61
65
|
};
|
|
62
66
|
var handleKeyDown = function handleKeyDown(e) {
|
|
63
67
|
return (0, _utils.onKeyDown)({
|
|
@@ -69,8 +73,8 @@ var Card = function Card(_ref) {
|
|
|
69
73
|
});
|
|
70
74
|
};
|
|
71
75
|
return /*#__PURE__*/_react.default.createElement(_styles.StyledCard, _extends({
|
|
72
|
-
tabIndex: 0,
|
|
73
|
-
role: role,
|
|
76
|
+
tabIndex: isRoleLink ? -1 : 0,
|
|
77
|
+
role: isRoleLink ? undefined : role,
|
|
74
78
|
onClick: handleClickConditions,
|
|
75
79
|
onKeyDown: handleKeyDown,
|
|
76
80
|
$elevation: elevation,
|
|
@@ -79,11 +83,12 @@ var Card = function Card(_ref) {
|
|
|
79
83
|
"aria-checked": checkedConditions,
|
|
80
84
|
$disabled: disabled,
|
|
81
85
|
"aria-disabled": disabled && disabled,
|
|
82
|
-
$compositionalComponents: hasSubComponent
|
|
86
|
+
$compositionalComponents: hasSubComponent,
|
|
87
|
+
$isRoleLink: isRoleLink
|
|
83
88
|
}, rest), /*#__PURE__*/_react.default.createElement(_subComponents.SelectedIcon, {
|
|
84
89
|
$selected: selected
|
|
85
90
|
}), /*#__PURE__*/_react.default.createElement(_utils.SubComponentContext.Provider, {
|
|
86
|
-
value:
|
|
91
|
+
value: cardContext
|
|
87
92
|
}, children));
|
|
88
93
|
};
|
|
89
94
|
var _default = Card;
|
package/commonjs/Card/index.js
CHANGED
|
@@ -7,7 +7,8 @@ var _exportNames = {
|
|
|
7
7
|
Card: true,
|
|
8
8
|
CardHeader: true,
|
|
9
9
|
CardContent: true,
|
|
10
|
-
CardFooter: true
|
|
10
|
+
CardFooter: true,
|
|
11
|
+
CardLink: true
|
|
11
12
|
};
|
|
12
13
|
Object.defineProperty(exports, "Card", {
|
|
13
14
|
enumerable: true,
|
|
@@ -33,6 +34,12 @@ Object.defineProperty(exports, "CardHeader", {
|
|
|
33
34
|
return _subComponents.CardHeader;
|
|
34
35
|
}
|
|
35
36
|
});
|
|
37
|
+
Object.defineProperty(exports, "CardLink", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function get() {
|
|
40
|
+
return _subComponents.CardLink;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
36
43
|
exports.default = void 0;
|
|
37
44
|
var _Card = _interopRequireDefault(require("./Card"));
|
|
38
45
|
var _subComponents = require("./subComponents");
|
package/commonjs/Card/styles.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.StyledSelectedIcon = exports.StyledCardHeader = exports.StyledCardFooter = exports.StyledCardContent = exports.StyledCard = exports.SelectedIconWrapper = void 0;
|
|
6
|
+
exports.StyledSelectedIcon = exports.StyledCardLink = exports.StyledCardHeader = exports.StyledCardFooter = exports.StyledCardContent = exports.StyledCardAffordance = exports.StyledCard = exports.SelectedIconWrapper = void 0;
|
|
7
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
8
|
var _styledSystem = require("styled-system");
|
|
9
9
|
var _mixins = require("../utils/mixins");
|
|
@@ -69,10 +69,23 @@ var StyledSelectedIcon = (0, _styledComponents.default)(_Icon.default).withConfi
|
|
|
69
69
|
return $selected && "\n opacity: 1;\n ";
|
|
70
70
|
});
|
|
71
71
|
exports.StyledSelectedIcon = StyledSelectedIcon;
|
|
72
|
+
var StyledCardLink = _styledComponents.default.a.withConfig({
|
|
73
|
+
displayName: "styles__StyledCardLink",
|
|
74
|
+
componentId: "sc-9tyqu4-5"
|
|
75
|
+
})(["font-family:", ";font-weight:", ";color:", ";", ";", " ", ""], function (p) {
|
|
76
|
+
return p.theme.fontFamily;
|
|
77
|
+
}, function (p) {
|
|
78
|
+
return p.theme.fontWeights.bold;
|
|
79
|
+
}, function (p) {
|
|
80
|
+
return p.theme.colors.text.headline;
|
|
81
|
+
}, function (p) {
|
|
82
|
+
return p.theme.typography[400];
|
|
83
|
+
}, _styledSystem.color, _styledSystem.typography);
|
|
84
|
+
exports.StyledCardLink = StyledCardLink;
|
|
72
85
|
var StyledCard = _styledComponents.default.div.withConfig({
|
|
73
86
|
displayName: "styles__StyledCard",
|
|
74
|
-
componentId: "sc-9tyqu4-
|
|
75
|
-
})(["position:relative;display:flex;flex-direction:column;box-sizing:border-box;margin:0;background:", ";border:", " solid ", ";padding:", ";border-radius:", ";transition:box-shadow ", ",border ", ";&[role='
|
|
87
|
+
componentId: "sc-9tyqu4-6"
|
|
88
|
+
})(["position:relative;display:flex;flex-direction:column;box-sizing:border-box;margin:0;background:", ";border:", " solid ", ";padding:", ";border-radius:", ";transition:box-shadow ", ",border ", ";&[role='button'],&[role='checkbox']{cursor:pointer;}", " &:hover{box-shadow:", ";}&:focus-within{", " ", ":focus{border:none;box-shadow:none;outline:none;}}&:focus{", "}", " ", " ", " ", " ", " ", " ", " ", " ", ""], function (_ref11) {
|
|
76
89
|
var theme = _ref11.theme;
|
|
77
90
|
return theme.colors.container.background.base;
|
|
78
91
|
}, function (_ref12) {
|
|
@@ -95,16 +108,31 @@ var StyledCard = _styledComponents.default.div.withConfig({
|
|
|
95
108
|
var theme = _ref17.theme;
|
|
96
109
|
return theme.duration.medium;
|
|
97
110
|
}, function (_ref18) {
|
|
98
|
-
var
|
|
99
|
-
|
|
100
|
-
|
|
111
|
+
var $isRoleLink = _ref18.$isRoleLink;
|
|
112
|
+
return $isRoleLink && "\n\t\tcursor: pointer;\n\t";
|
|
113
|
+
}, function (_ref19) {
|
|
114
|
+
var theme = _ref19.theme,
|
|
115
|
+
_ref19$$elevation = _ref19.$elevation,
|
|
116
|
+
$elevation = _ref19$$elevation === void 0 ? 'low' : _ref19$$elevation;
|
|
101
117
|
return theme.shadows[$elevation];
|
|
102
|
-
}, _mixins.focusRing, function (_ref19) {
|
|
103
|
-
var $disabled = _ref19.$disabled;
|
|
104
|
-
return $disabled && "\n ".concat(_mixins.disabled, "\n ");
|
|
105
118
|
}, function (_ref20) {
|
|
106
|
-
var $
|
|
107
|
-
|
|
119
|
+
var $isRoleLink = _ref20.$isRoleLink;
|
|
120
|
+
return $isRoleLink ? _mixins.focusRing : null;
|
|
121
|
+
}, StyledCardLink, _mixins.focusRing, function (_ref21) {
|
|
122
|
+
var $disabled = _ref21.$disabled;
|
|
123
|
+
return $disabled && "\n ".concat(_mixins.disabled, "\n ");
|
|
124
|
+
}, function (_ref22) {
|
|
125
|
+
var $selected = _ref22.$selected,
|
|
126
|
+
theme = _ref22.theme;
|
|
108
127
|
return $selected && "\n border: ".concat(theme.borderWidths[500], " solid ").concat(theme.colors.container.border.selected, "; \n ");
|
|
109
128
|
}, _styledSystem.border, _styledSystem.color, _styledSystem.flexbox, _styledSystem.grid, _styledSystem.layout, _styledSystem.position, _styledSystem.space);
|
|
110
|
-
exports.StyledCard = StyledCard;
|
|
129
|
+
exports.StyledCard = StyledCard;
|
|
130
|
+
var StyledCardAffordance = (0, _styledComponents.default)(_Icon.default).withConfig({
|
|
131
|
+
displayName: "styles__StyledCardAffordance",
|
|
132
|
+
componentId: "sc-9tyqu4-7"
|
|
133
|
+
})(["", ":hover &{transform:translateX(", ");}transition:", ";"], StyledCard, function (p) {
|
|
134
|
+
return p.theme.space[200];
|
|
135
|
+
}, function (p) {
|
|
136
|
+
return p.theme.duration.medium;
|
|
137
|
+
});
|
|
138
|
+
exports.StyledCardAffordance = StyledCardAffordance;
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
exports.SelectedIcon = exports.CardHeader = exports.CardFooter = exports.CardContent = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
exports.SelectedIcon = exports.CardLink = exports.CardHeader = exports.CardFooter = exports.CardContent = exports.CardAffordance = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
9
|
var _utils = require("./utils");
|
|
9
10
|
var _styles = require("./styles");
|
|
10
11
|
var _excluded = ["children"],
|
|
11
12
|
_excluded2 = ["children"],
|
|
12
|
-
_excluded3 = ["children"]
|
|
13
|
-
|
|
13
|
+
_excluded3 = ["children"],
|
|
14
|
+
_excluded4 = ["affordance", "children", "external", "color"];
|
|
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
|
+
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
|
+
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
|
18
|
+
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); }
|
|
14
19
|
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; }
|
|
15
20
|
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; }
|
|
16
21
|
var CardContent = function CardContent(_ref) {
|
|
@@ -45,4 +50,40 @@ var SelectedIcon = function SelectedIcon(_ref4) {
|
|
|
45
50
|
$selected: $selected
|
|
46
51
|
}));
|
|
47
52
|
};
|
|
48
|
-
exports.SelectedIcon = SelectedIcon;
|
|
53
|
+
exports.SelectedIcon = SelectedIcon;
|
|
54
|
+
var CardAffordance = function CardAffordance(_ref5) {
|
|
55
|
+
var rest = _extends({}, (_objectDestructuringEmpty(_ref5), _ref5));
|
|
56
|
+
return /*#__PURE__*/_react.default.createElement(_styles.StyledCardAffordance, _extends({}, rest, {
|
|
57
|
+
size: "mini",
|
|
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
|
+
,
|
|
61
|
+
"aria-hidden": true
|
|
62
|
+
}));
|
|
63
|
+
};
|
|
64
|
+
exports.CardAffordance = CardAffordance;
|
|
65
|
+
var CardLink = function CardLink(_ref6) {
|
|
66
|
+
var affordance = _ref6.affordance,
|
|
67
|
+
children = _ref6.children,
|
|
68
|
+
_ref6$external = _ref6.external,
|
|
69
|
+
external = _ref6$external === void 0 ? false : _ref6$external,
|
|
70
|
+
color = _ref6.color,
|
|
71
|
+
rest = _objectWithoutProperties(_ref6, _excluded4);
|
|
72
|
+
var _useContext = (0, _react.useContext)(_utils.SubComponentContext),
|
|
73
|
+
href = _useContext.href,
|
|
74
|
+
linkRef = _useContext.linkRef;
|
|
75
|
+
return /*#__PURE__*/_react.default.createElement(_styles.StyledCardLink, _extends({}, rest, {
|
|
76
|
+
target: external ? '_blank' : undefined,
|
|
77
|
+
rel: external ? 'noreferrer' : undefined,
|
|
78
|
+
href: href,
|
|
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
|
|
85
|
+
}), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children, affordance ? /*#__PURE__*/_react.default.createElement(CardAffordance, {
|
|
86
|
+
ml: 300
|
|
87
|
+
}) : null));
|
|
88
|
+
};
|
|
89
|
+
exports.CardLink = CardLink;
|
package/commonjs/Card/utils.js
CHANGED
|
@@ -7,13 +7,17 @@ exports.onKeyDown = exports.navigateTo = exports.SubComponentContext = void 0;
|
|
|
7
7
|
exports.useChildContext = useChildContext;
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _utils = require("../utils");
|
|
10
|
-
var SubComponentContext = /*#__PURE__*/(0, _react.createContext)(
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
12
|
-
function () {}
|
|
10
|
+
var SubComponentContext = /*#__PURE__*/(0, _react.createContext)({
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
12
|
+
setHasSubComponent: function setHasSubComponent() {},
|
|
13
|
+
href: '',
|
|
14
|
+
linkRef: null
|
|
15
|
+
});
|
|
13
16
|
exports.SubComponentContext = SubComponentContext;
|
|
14
17
|
function useChildContext() {
|
|
15
|
-
var
|
|
16
|
-
|
|
18
|
+
var _useContext = (0, _react.useContext)(SubComponentContext),
|
|
19
|
+
setHasSubComponent = _useContext.setHasSubComponent;
|
|
20
|
+
setHasSubComponent && setHasSubComponent(true);
|
|
17
21
|
}
|
|
18
22
|
var navigateTo = function navigateTo(_ref) {
|
|
19
23
|
var _ref$current, _window$open;
|