design-system-react icon indicating copy to clipboard operation
design-system-react copied to clipboard

Add Illustration Component

Open interactivellama opened this issue 8 years ago • 2 comments

These are mostly SVGs with a caption. Many variants, but no interactivity. https://www.lightningdesignsystem.com/components/illustration/

interactivellama avatar May 08 '18 06:05 interactivellama

@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

qyiming avatar Jun 26 '18 00:06 qyiming

  • I don't think we need assistiveText since

An illustration image must be accompanied with heading text inline. at https://lightningdesignsystem.com/components/illustration/#Maintenance

  • I don't think we need a category prop. name should trigger the correct illustration and heading and messagebody will 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 string or node.

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.

interactivellama avatar Jun 26 '18 19:06 interactivellama