Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Trial Bar Component #2006

Closed
pulkonet opened this issue Jun 2, 2019 · 12 comments · Fixed by #2025
Closed

Add Trial Bar Component #2006

pulkonet opened this issue Jun 2, 2019 · 12 comments · Fixed by #2025
Assignees

Comments

@pulkonet
Copy link
Contributor

pulkonet commented Jun 2, 2019

Add Trial Bar Component according to specs https://lightningdesignsystem.com/components/trial-bar/

I am working on this and will send a prop proposal soon.

@pulkonet
Copy link
Contributor Author

pulkonet commented Jun 2, 2019

Here is my initial props proposal:

Name Type Description
label string The main label of the Trial Bar which acts as a heading for it
dropdownLabel string Label for dropdown button
dropdownOptions array An array of menu item objects
timeLeft string Time (hours/days) left in trial period
timeLeftLabel string Label for indicating the time (hours/days) left
onSubscribe func Function to be called when subscribe button is hit
subscribeButtonLabel string Label for Subscribe button

@pulkonet
Copy link
Contributor Author

pulkonet commented Jun 3, 2019

@garygong @davidlygagnon Please see if the props are plausible, I will raise a PR for the same tomorrow morning.

@interactivellama
Copy link
Contributor

@garygong We may want this API to look something more like BuilderHeader. https://react.lightningdesignsystem.com/components/builder-header/

@garygong
Copy link
Contributor

garygong commented Jun 4, 2019

If we were to have the API be more like BuilderHeader, here's what it would look like. I actually like this. What do you think?

TrialBar

Name Type Description
onRenderActions function Renders the actions section of the trial bar.
children Element[] <TrialBarButton /> and <TrialBarDropdown />
className string CSS classes to be added to the component.
style string Customs styles to be applied to the component.
labels.timeLeft string Amount of time left in trial, e.g. '30'
labels.timeLeftUnit string Unit of the amount of time left, e.g. 'days'

TrialBarButton

Same props as Button.

TrialBarDropdown

Same props as Dropdown.

Example

Here's a sample using the example from the SLDS page.

<TrialBar
  labels={{ timeLeft: '30', timeLeftUnit: 'days' }}
  onRenderActions={() => (
    <Button variant="success" label="Subscribe Now" />
  )}
>
  <TrialBarButton label="Take the salesforce tour" />
  <TrialBarDropdown
    assistiveText={{ icon: 'Dropdown' }}
    id="dropdown"
    label="Choose your tour"
    options={[
      { label: 'Conquer Your Cases', value: 'item1'},
      { label: 'Automate For Speed', value: 'item2'},
      { label: 'Share Your Knowledge', value: 'item3'},
      { label: 'Finish it up in a Flash', value: 'item4'},
      { type: 'divider' },
      { label: 'Import Contacts and Accounts', value: 'item5', leftIcon: { name: 'utility', category: 'upload' } }
    ]}
    value={['item1']}
  />
</TrialBar>

@interactivellama
Copy link
Contributor

interactivellama commented Jun 6, 2019

Looks good to me.

Two comments

  • I think we have a success variant Button, but the text isn't looking right--It's still blue. That might need to be fixed. It looks like it's actually a link though. Should we have a link/button mix of props for Button or maybe a Link component? Feel free to proceed though. This can be added in the future.
  • We may want the time left strings in a labels object, so folks don't need to format it.

Our current success button:
Screen Shot 2019-06-05 at 8 53 40 PM

@garygong
Copy link
Contributor

garygong commented Jun 6, 2019

Good point. I updated the example above to use time left. I left the success link (button??) in a render function so that consumers can have that additional flexibility.

By "link/button mix of props" do you mean that we'd have something like a <Button link /> prop that would cause <a> to be used instead of <button>? This seems to be consistent with how the SLDS Button page has samples for links, too.

@interactivellama
Copy link
Contributor

interactivellama commented Jun 6, 2019

Yes. Something like that. We’d deprecate link variant I think so that the link prop could be any of the button variants.

Although link variant may be a visual variant, so we might want to keep it. It needs to be explored.

@interactivellama
Copy link
Contributor

@aswinshenoy might be interested in picking up the button/link issue. The user story still needs to be groomed /spec decides, but props could be proposed. @aswinshenoy would you be interested in working on the missing button options for the first evaluation period?

@pulkonet pulkonet mentioned this issue Jun 9, 2019
17 tasks
@davidlygagnon
Copy link
Contributor

@interactivellama Did we file an issue for the button/link? I noticed that when testing the trial bar component.

@interactivellama
Copy link
Contributor

interactivellama commented Jun 18, 2019

@davidlygagnon No, I haven't created an issue. I was waiting for someone to propose an API for it.

@davidlygagnon
Copy link
Contributor

Ok - I'll create the issue and TBD for props proposal so that we don't forget.

@davidlygagnon
Copy link
Contributor

Here's the new issue: #2090

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants