Add Illustration Component
These are mostly SVGs with a caption. Many variants, but no interactivity. https://www.lightningdesignsystem.com/components/illustration/
@interactivellama
The proposed props for this component are shown below -
assistiveText: PropTypes.string,
category: PropTypes.oneOf([ 'custom', 'textOnly' ]),
className: PropTypes.oneOfType([ PropTypes.array, PropTypes.object, PropTypes.string ]),
illustration: PropTypes.object,
heading: PropTypes.string,
messageBody: PropTypes.object,
name: PropTypes.string,
path: PropTypes.string,
size: PropTypes.oneOf(['small', 'medium', 'large']),
style: PropTypes.object
- I don't think we need
assistiveTextsince
An illustration image must be accompanied with heading text inline. at https://lightningdesignsystem.com/components/illustration/#Maintenance
- I don't think we need a
categoryprop.nameshould trigger the correct illustration andheadingandmessagebodywill just appear as they should. That way we don't need a text only variant. I don't see any markup change between the text only and the ones with SVGs. - The icon "keys" or names should probably be the kabob case (lower, hypens) of the name of in the illustrations headings on the site "No Access 2" =
no-access-2. - I was going to say we needed a way to do the call to action variant, but it looks like that's done within a card footer, so we don't have to worry about that.
- Message body should probably be
stringornode.
As I originally shared on Slack, since we do have three external SVGs in the /assets/images/ folder in the SLDS node modules, we will need an <ImageSettings imagePath=""> wrapper just like IconSettings it should be a direct copy and set "global" context for the Illustration component.
If SLDS plans on adding illustration SVGs in the future, we may want to add a little prop flag like internalIllustration that doesn't do anything except if folks use it and copy and paste out of the examples on the website, then in the future we could deprecate it and give them a notice when it's available inside SLDS. "Using illustration SVGs from inside this repo is deprecated. Please update your assets/images path to use the SVGs found in the @salesforce/design-system npm module."
Due to the size of the SVGs, I'd like pursue hosting them externally as files and have apps serve them up via HTTP, just like the icons. They would be stored in design-system-react/assets/images/illustrations and we'd want to eventually deprecate and remove them.