playbook_ui 6.0.1.pre.alpha4 → 6.1.0.pre.alpha2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/_playbook.scss +3 -1
- data/app/pb_kits/playbook/data/menu.yml +4 -2
- data/app/pb_kits/playbook/index.js +2 -0
- data/app/pb_kits/playbook/packs/examples.js +5 -0
- data/app/pb_kits/playbook/pb_avatar/_avatar.jsx +2 -2
- data/app/pb_kits/playbook/pb_badge/_badge.jsx +2 -5
- data/app/pb_kits/playbook/pb_badge/_badge.scss +1 -1
- data/app/pb_kits/playbook/pb_badge/badge.rb +1 -6
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx +2 -2
- data/app/pb_kits/playbook/pb_body/_body.jsx +3 -6
- data/app/pb_kits/playbook/pb_body/_body.scss +6 -0
- data/app/pb_kits/playbook/pb_body/body.rb +2 -8
- data/app/pb_kits/playbook/pb_button/_button.jsx +2 -5
- data/app/pb_kits/playbook/pb_button/_button.scss +1 -1
- data/app/pb_kits/playbook/pb_button/button.rb +1 -7
- data/app/pb_kits/playbook/pb_button/docs/_button_default.jsx +2 -0
- data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.html.erb +7 -0
- data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx +52 -0
- data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.scss +101 -0
- data/app/pb_kits/playbook/pb_button_toolbar/button_toolbar.rb +29 -0
- data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_default.html.erb +7 -0
- data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_default.jsx +29 -0
- data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_secondary.html.erb +7 -0
- data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_secondary.jsx +34 -0
- data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_vertical.html.erb +11 -0
- data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_vertical.jsx +29 -0
- data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_vertical_secondary.html.erb +11 -0
- data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_vertical_secondary.jsx +34 -0
- data/app/pb_kits/playbook/pb_button_toolbar/docs/_description.md +1 -0
- data/app/pb_kits/playbook/pb_button_toolbar/docs/example.yml +15 -0
- data/app/pb_kits/playbook/pb_button_toolbar/docs/index.js +4 -0
- data/app/pb_kits/playbook/pb_caption/_caption.jsx +3 -7
- data/app/pb_kits/playbook/pb_caption/_caption.scss +0 -4
- data/app/pb_kits/playbook/pb_caption/caption.rb +1 -8
- data/app/pb_kits/playbook/pb_card/_card.jsx +17 -14
- data/app/pb_kits/playbook/pb_card/_card.scss +4 -1
- data/app/pb_kits/playbook/pb_card/card.rb +2 -9
- data/app/pb_kits/playbook/pb_card/docs/_card_dark.html.erb +1 -1
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.jsx +2 -2
- data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +1 -8
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.jsx +2 -2
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb +0 -2
- data/app/pb_kits/playbook/pb_contact/_contact.jsx +2 -2
- data/app/pb_kits/playbook/pb_currency/_currency.jsx +2 -2
- data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.js +26 -0
- data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.jsx +2 -2
- data/app/pb_kits/playbook/pb_date/_date.jsx +4 -4
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.jsx +2 -2
- data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.jsx +2 -2
- data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.jsx +2 -2
- data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.jsx +2 -2
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.jsx +2 -2
- data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.jsx +2 -2
- data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.jsx +2 -2
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.jsx +2 -2
- data/app/pb_kits/playbook/pb_filter/Filter/FilterBackground.jsx +2 -2
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.jsx +2 -2
- data/app/pb_kits/playbook/pb_flex/_flex.jsx +2 -2
- data/app/pb_kits/playbook/pb_flex/_flex_item.jsx +2 -2
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +2 -2
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +2 -2
- data/app/pb_kits/playbook/pb_form/docs/_form_simple_form.html.erb +1 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_simple_form_validate.html.erb +1 -1
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.jsx +2 -2
- data/app/pb_kits/playbook/pb_gauge/_gauge.html.erb +12 -0
- data/app/pb_kits/playbook/pb_gauge/_gauge.jsx +110 -0
- data/app/pb_kits/playbook/pb_gauge/_gauge.scss +11 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_default.html.erb +11 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_default.jsx +17 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_disable_animation.html.erb +12 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_disable_animation.jsx +18 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.html.erb +14 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.jsx +20 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_height.html.erb +15 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_height.jsx +23 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_live_data.jsx +40 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.html.erb +15 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.jsx +21 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.md +1 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.html.erb +26 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.jsx +37 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.md +1 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_title.html.erb +14 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_title.jsx +20 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units.html.erb +29 -0
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units.jsx +29 -0
- data/app/pb_kits/playbook/pb_gauge/docs/example.yml +24 -0
- data/app/pb_kits/playbook/pb_gauge/docs/index.js +9 -0
- data/app/pb_kits/playbook/pb_gauge/gauge.rb +57 -0
- data/app/pb_kits/playbook/pb_hashtag/_hashtag.jsx +2 -2
- data/app/pb_kits/playbook/pb_highlight/_highlight.jsx +2 -2
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.jsx +2 -2
- data/app/pb_kits/playbook/pb_icon/_icon.jsx +2 -2
- data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.jsx +2 -2
- data/app/pb_kits/playbook/pb_icon_value/_icon_value.jsx +2 -2
- data/app/pb_kits/playbook/pb_image/_image.jsx +2 -2
- data/app/pb_kits/playbook/pb_kit/dateTime.js +5 -1
- data/app/pb_kits/playbook/pb_label_pill/_label_pill.jsx +2 -2
- data/app/pb_kits/playbook/pb_label_value/_label_value.jsx +2 -2
- data/app/pb_kits/playbook/pb_layout/_layout.jsx +6 -6
- data/app/pb_kits/playbook/pb_legend/_legend.jsx +2 -2
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.jsx +2 -2
- data/app/pb_kits/playbook/pb_list/_list.jsx +2 -2
- data/app/pb_kits/playbook/pb_list/_list_item.jsx +2 -2
- data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.jsx +2 -2
- data/app/pb_kits/playbook/pb_logistic/_logistic.jsx +111 -0
- data/app/pb_kits/playbook/pb_message/_message.jsx +2 -2
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.jsx +2 -2
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.jsx +2 -2
- data/app/pb_kits/playbook/pb_nav/_nav.jsx +2 -2
- data/app/pb_kits/playbook/pb_online_status/_online_status.jsx +2 -2
- data/app/pb_kits/playbook/pb_person/_person.jsx +2 -2
- data/app/pb_kits/playbook/pb_person_contact/_person_contact.jsx +2 -2
- data/app/pb_kits/playbook/pb_pill/_pill.jsx +2 -2
- data/app/pb_kits/playbook/pb_popover/_popover.jsx +2 -2
- data/app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx +5 -5
- data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.jsx +2 -2
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.jsx +2 -2
- data/app/pb_kits/playbook/pb_progress_step/_progress_step.jsx +2 -2
- data/app/pb_kits/playbook/pb_radio/_radio.jsx +2 -2
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.jsx +2 -2
- data/app/pb_kits/playbook/pb_select/_select.jsx +2 -2
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.jsx +12 -16
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +1 -1
- data/app/pb_kits/playbook/pb_selectable_card/selectable_card.rb +1 -7
- data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.jsx +26 -26
- data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.scss +1 -1
- data/app/pb_kits/playbook/pb_selectable_card_icon/selectable_card_icon.rb +1 -8
- data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.jsx +8 -10
- data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.scss +1 -1
- data/app/pb_kits/playbook/pb_selectable_icon/selectable_icon.rb +1 -7
- data/app/pb_kits/playbook/pb_stat_change/_stat_change.jsx +2 -2
- data/app/pb_kits/playbook/pb_stat_value/_stat_value.jsx +2 -2
- data/app/pb_kits/playbook/pb_table/_table.jsx +2 -2
- data/app/pb_kits/playbook/pb_table/_table_row.jsx +2 -2
- data/app/pb_kits/playbook/pb_text_input/_text_input.jsx +2 -2
- data/app/pb_kits/playbook/pb_textarea/_textarea.html.erb +1 -1
- data/app/pb_kits/playbook/pb_textarea/_textarea.jsx +2 -2
- data/app/pb_kits/playbook/pb_textarea/_textarea.scss +2 -1
- data/app/pb_kits/playbook/pb_time/_time.jsx +57 -14
- data/app/pb_kits/playbook/pb_time/_time.scss +17 -0
- data/app/pb_kits/playbook/pb_time/docs/_time_align.jsx +27 -0
- data/app/pb_kits/playbook/pb_time/docs/_time_dark.jsx +28 -0
- data/app/pb_kits/playbook/pb_time/docs/_time_default.jsx +28 -0
- data/app/pb_kits/playbook/pb_time/docs/_time_timestamp.jsx +32 -0
- data/app/pb_kits/playbook/pb_time/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_time/docs/index.js +4 -0
- data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.jsx +2 -2
- data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.jsx +2 -2
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.jsx +2 -2
- data/app/pb_kits/playbook/pb_title/_title.jsx +3 -6
- data/app/pb_kits/playbook/pb_title/_title.scss +1 -1
- data/app/pb_kits/playbook/pb_title/title.rb +1 -9
- data/app/pb_kits/playbook/pb_title_count/_title_count.jsx +2 -2
- data/app/pb_kits/playbook/pb_title_detail/_title_detail.jsx +2 -2
- data/app/pb_kits/playbook/pb_toggle/_toggle.jsx +39 -31
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_custom.jsx +31 -0
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.html.erb +6 -6
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_custom_radio.jsx +72 -0
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_default.html.erb +1 -3
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_default.jsx +6 -19
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_name.jsx +57 -0
- data/app/pb_kits/playbook/pb_toggle/docs/{_toggle_checked.html.erb → _toggle_size.html.erb} +2 -2
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_size.jsx +44 -0
- data/app/pb_kits/playbook/pb_toggle/docs/example.yml +8 -5
- data/app/pb_kits/playbook/pb_toggle/docs/index.js +4 -2
- data/app/pb_kits/playbook/pb_user/_user.jsx +2 -2
- data/app/pb_kits/playbook/pb_user_badge/_user_badge.jsx +2 -2
- data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.jsx +2 -2
- data/app/pb_kits/playbook/plugins/pb_chart.js +74 -0
- data/app/pb_kits/playbook/props.rb +6 -0
- data/app/pb_kits/playbook/utilities/{spacing.js → globalProps.js} +14 -1
- data/app/pb_kits/playbook/utilities/props.js +1 -0
- data/lib/generators/kit/templates/kit_jsx.erb.tt +2 -2
- data/lib/playbook/version.rb +1 -1
- metadata +53 -6
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_accessibility.jsx +0 -12
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_data.jsx +0 -15
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Playbook
|
4
|
+
module PbButtonToolbar
|
5
|
+
class ButtonToolbar
|
6
|
+
include Playbook::Props
|
7
|
+
|
8
|
+
partial "pb_button_toolbar/button_toolbar"
|
9
|
+
|
10
|
+
prop :connected, type: Playbook::Props::Boolean, default: false
|
11
|
+
|
12
|
+
prop :orientation, type: Playbook::Props::Enum,
|
13
|
+
values: %w[horizontal vertical],
|
14
|
+
default: "horizontal"
|
15
|
+
|
16
|
+
prop :text
|
17
|
+
|
18
|
+
def classname
|
19
|
+
generate_classname("pb_button_toolbar_kit", orientation, connected_class)
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def connected_class
|
25
|
+
connected == true ? "connected" : nil
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<%= pb_rails("button_toolbar", props: { orientation: "horizontal", connected: true }) do %>
|
2
|
+
<%= pb_rails("button", props: { text: "Field" }) %>
|
3
|
+
<%= pb_rails("button", props: { text: "Retail"}) %>
|
4
|
+
<%= pb_rails("button", props: { text: "Event"}) %>
|
5
|
+
<%= pb_rails("button", props: { text: "Training"}) %>
|
6
|
+
<%= pb_rails("button", props: { text: "Not Working"}) %>
|
7
|
+
<% end %>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { Button, ButtonToolbar } from '../..'
|
3
|
+
|
4
|
+
const ButtonToolbarDefault = () => (
|
5
|
+
<div>
|
6
|
+
<ButtonToolbar
|
7
|
+
connected
|
8
|
+
orientation="horizontal"
|
9
|
+
>
|
10
|
+
<Button
|
11
|
+
text="Field"
|
12
|
+
/>
|
13
|
+
<Button
|
14
|
+
text="Retail"
|
15
|
+
/>
|
16
|
+
<Button
|
17
|
+
text="Event"
|
18
|
+
/>
|
19
|
+
<Button
|
20
|
+
text="Training"
|
21
|
+
/>
|
22
|
+
<Button
|
23
|
+
text="Not Working"
|
24
|
+
/>
|
25
|
+
</ButtonToolbar>
|
26
|
+
</div>
|
27
|
+
)
|
28
|
+
|
29
|
+
export default ButtonToolbarDefault
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<%= pb_rails("button_toolbar", props: { orientation: "horizontal", connected: true }) do %>
|
2
|
+
<%= pb_rails("button", props: { text: "Field", variant: "secondary" }) %>
|
3
|
+
<%= pb_rails("button", props: { text: "Retail", variant: "secondary"}) %>
|
4
|
+
<%= pb_rails("button", props: { text: "Event", variant: "secondary"}) %>
|
5
|
+
<%= pb_rails("button", props: { text: "Training", variant: "secondary"}) %>
|
6
|
+
<%= pb_rails("button", props: { text: "Not Working", variant: "secondary"}) %>
|
7
|
+
<% end %>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { Button, ButtonToolbar } from '../..'
|
3
|
+
|
4
|
+
const ButtonToolbarSecondary = () => (
|
5
|
+
<div>
|
6
|
+
<ButtonToolbar
|
7
|
+
connected
|
8
|
+
orientation="horizontal"
|
9
|
+
>
|
10
|
+
<Button
|
11
|
+
text="Field"
|
12
|
+
variant="secondary"
|
13
|
+
/>
|
14
|
+
<Button
|
15
|
+
text="Retail"
|
16
|
+
variant="secondary"
|
17
|
+
/>
|
18
|
+
<Button
|
19
|
+
text="Event"
|
20
|
+
variant="secondary"
|
21
|
+
/>
|
22
|
+
<Button
|
23
|
+
text="Training"
|
24
|
+
variant="secondary"
|
25
|
+
/>
|
26
|
+
<Button
|
27
|
+
text="Not Working"
|
28
|
+
variant="secondary"
|
29
|
+
/>
|
30
|
+
</ButtonToolbar>
|
31
|
+
</div>
|
32
|
+
)
|
33
|
+
|
34
|
+
export default ButtonToolbarSecondary
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<div class="pb--doc-demo-row">
|
2
|
+
<div>
|
3
|
+
<%= pb_rails("button_toolbar", props: { orientation: "vertical", connected: true }) do %>
|
4
|
+
<%= pb_rails("button", props: { text: "Field" }) %>
|
5
|
+
<%= pb_rails("button", props: { text: "Retail"}) %>
|
6
|
+
<%= pb_rails("button", props: { text: "Event"}) %>
|
7
|
+
<%= pb_rails("button", props: { text: "Training"}) %>
|
8
|
+
<%= pb_rails("button", props: { text: "Not Working"}) %>
|
9
|
+
<% end %>
|
10
|
+
</div>
|
11
|
+
</div>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { Button, ButtonToolbar } from '../..'
|
3
|
+
|
4
|
+
const ButtonToolbarVertical = () => (
|
5
|
+
<div>
|
6
|
+
<ButtonToolbar
|
7
|
+
connected
|
8
|
+
orientation="vertical"
|
9
|
+
>
|
10
|
+
<Button
|
11
|
+
text="Field"
|
12
|
+
/>
|
13
|
+
<Button
|
14
|
+
text="Retail"
|
15
|
+
/>
|
16
|
+
<Button
|
17
|
+
text="Event"
|
18
|
+
/>
|
19
|
+
<Button
|
20
|
+
text="Training"
|
21
|
+
/>
|
22
|
+
<Button
|
23
|
+
text="Not Working"
|
24
|
+
/>
|
25
|
+
</ButtonToolbar>
|
26
|
+
</div>
|
27
|
+
)
|
28
|
+
|
29
|
+
export default ButtonToolbarVertical
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<div class="pb--doc-demo-row">
|
2
|
+
<div>
|
3
|
+
<%= pb_rails("button_toolbar", props: { orientation: "vertical", connected: true }) do %>
|
4
|
+
<%= pb_rails("button", props: { text: "Field", variant: "secondary" }) %>
|
5
|
+
<%= pb_rails("button", props: { text: "Retail", variant: "secondary" }) %>
|
6
|
+
<%= pb_rails("button", props: { text: "Event", variant: "secondary" }) %>
|
7
|
+
<%= pb_rails("button", props: { text: "Training", variant: "secondary" }) %>
|
8
|
+
<%= pb_rails("button", props: { text: "Not Working", variant: "secondary" }) %>
|
9
|
+
<% end %>
|
10
|
+
</div>
|
11
|
+
</div>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { Button, ButtonToolbar } from '../..'
|
3
|
+
|
4
|
+
const ButtonToolbarVerticalSecondary = () => (
|
5
|
+
<div>
|
6
|
+
<ButtonToolbar
|
7
|
+
connected
|
8
|
+
orientation="vertical"
|
9
|
+
>
|
10
|
+
<Button
|
11
|
+
text="Field"
|
12
|
+
variant="secondary"
|
13
|
+
/>
|
14
|
+
<Button
|
15
|
+
text="Retail"
|
16
|
+
variant="secondary"
|
17
|
+
/>
|
18
|
+
<Button
|
19
|
+
text="Event"
|
20
|
+
variant="secondary"
|
21
|
+
/>
|
22
|
+
<Button
|
23
|
+
text="Training"
|
24
|
+
variant="secondary"
|
25
|
+
/>
|
26
|
+
<Button
|
27
|
+
text="Not Working"
|
28
|
+
variant="secondary"
|
29
|
+
/>
|
30
|
+
</ButtonToolbar>
|
31
|
+
</div>
|
32
|
+
)
|
33
|
+
|
34
|
+
export default ButtonToolbarVerticalSecondary
|
@@ -0,0 +1 @@
|
|
1
|
+
This kit should primarily hold the most commonly used buttons.
|
@@ -0,0 +1,15 @@
|
|
1
|
+
examples:
|
2
|
+
|
3
|
+
rails:
|
4
|
+
- button_toolbar_default: Horizontal Button Toolbar
|
5
|
+
- button_toolbar_vertical: Vertical Button Toolbar
|
6
|
+
- button_toolbar_secondary: Horizontal Secondary Button Toolbar
|
7
|
+
- button_toolbar_vertical_secondary: Vertical Secondary Button Toolbar
|
8
|
+
|
9
|
+
|
10
|
+
react:
|
11
|
+
- button_toolbar_default: Default
|
12
|
+
- button_toolbar_vertical: Vertical Button Toolbar
|
13
|
+
- button_toolbar_secondary: Horizontal Secondary Button Toolbar
|
14
|
+
- button_toolbar_vertical_secondary: Vertical Secondary Button Toolbar
|
15
|
+
|
@@ -0,0 +1,4 @@
|
|
1
|
+
export { default as ButtonToolbarDefault } from './_button_toolbar_default.jsx'
|
2
|
+
export { default as ButtonToolbarVertical } from './_button_toolbar_vertical.jsx'
|
3
|
+
export { default as ButtonToolbarSecondary } from './_button_toolbar_secondary.jsx'
|
4
|
+
export { default as ButtonToolbarVerticalSecondary } from './_button_toolbar_vertical_secondary.jsx'
|
@@ -3,13 +3,12 @@
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
5
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
6
|
-
import {
|
6
|
+
import { globalProps } from '../utilities/globalProps.js'
|
7
7
|
|
8
8
|
type CaptionProps = {
|
9
9
|
aria?: object,
|
10
10
|
className?: String,
|
11
11
|
children: Array<React.ReactNode> | React.ReactNode,
|
12
|
-
dark?: Boolean,
|
13
12
|
data?: object,
|
14
13
|
id?: String,
|
15
14
|
size?: "xs" | "sm" | "md" | "lg" | "xl",
|
@@ -22,7 +21,6 @@ const Caption = (props: CaptionProps) => {
|
|
22
21
|
aria = {},
|
23
22
|
className,
|
24
23
|
children,
|
25
|
-
dark = false,
|
26
24
|
data = {},
|
27
25
|
id,
|
28
26
|
size = 'md',
|
@@ -34,11 +32,9 @@ const Caption = (props: CaptionProps) => {
|
|
34
32
|
const ariaProps = buildAriaProps(aria)
|
35
33
|
const dataProps = buildDataProps(data)
|
36
34
|
const css = classnames(
|
37
|
-
buildCss('pb_caption_kit', size,
|
38
|
-
dark: dark,
|
39
|
-
}),
|
35
|
+
buildCss('pb_caption_kit', size),
|
40
36
|
className,
|
41
|
-
|
37
|
+
globalProps(props)
|
42
38
|
)
|
43
39
|
|
44
40
|
return (
|
@@ -7,7 +7,6 @@ module Playbook
|
|
7
7
|
|
8
8
|
partial "pb_caption/caption"
|
9
9
|
|
10
|
-
prop :dark, type: Playbook::Props::Boolean, default: false
|
11
10
|
prop :size, type: Playbook::Props::Enum,
|
12
11
|
values: %w[xs sm md base lg xl],
|
13
12
|
default: "md"
|
@@ -17,13 +16,7 @@ module Playbook
|
|
17
16
|
prop :text
|
18
17
|
|
19
18
|
def classname
|
20
|
-
generate_classname("pb_caption_kit", size
|
21
|
-
end
|
22
|
-
|
23
|
-
private
|
24
|
-
|
25
|
-
def dark_class
|
26
|
-
dark ? "dark" : nil
|
19
|
+
generate_classname("pb_caption_kit", size)
|
27
20
|
end
|
28
21
|
end
|
29
22
|
end
|
@@ -4,38 +4,41 @@ import React from 'react'
|
|
4
4
|
import { get } from 'lodash'
|
5
5
|
import classnames from 'classnames'
|
6
6
|
import { buildCss } from '../utilities/props'
|
7
|
-
import {
|
7
|
+
import { globalProps } from '../utilities/globalProps.js'
|
8
8
|
|
9
9
|
type CardPropTypes = {
|
10
|
+
borderNone?: Boolean,
|
10
11
|
children: Array<React.ReactNode> | React.ReactNode,
|
11
12
|
className?: String,
|
12
13
|
highlight?: {
|
13
14
|
position?: "side" | "top",
|
14
15
|
color?: String,
|
15
16
|
},
|
17
|
+
padding?: String,
|
16
18
|
selected?: Boolean,
|
17
19
|
shadow?: "none" | "deep" | "deeper" | "deepest",
|
18
|
-
dark?: Boolean,
|
19
|
-
borderNone?: Boolean,
|
20
20
|
}
|
21
21
|
|
22
22
|
type CardHeaderProps = {
|
23
|
+
categoryColor?: Number,
|
23
24
|
children: Array<React.ReactNode> | React.ReactNode,
|
24
25
|
className?: String,
|
25
|
-
|
26
|
+
padding?: String,
|
26
27
|
}
|
27
28
|
|
28
29
|
type CardBodyProps = {
|
29
30
|
children: Array<React.ReactNode> | React.ReactNode | String,
|
30
31
|
className?: String,
|
32
|
+
padding?: String,
|
31
33
|
}
|
32
34
|
|
33
35
|
// Header component
|
34
36
|
const Header = (props: CardHeaderProps) => {
|
35
|
-
const { children, className, categoryColor = 1 } = props
|
37
|
+
const { children, className, categoryColor = 1, padding = 'sm' } = props
|
36
38
|
const headerCSS = buildCss('pb_card_header_kit', `category_${categoryColor}`)
|
37
39
|
|
38
|
-
const headerSpacing =
|
40
|
+
const headerSpacing = globalProps(props, { padding })
|
41
|
+
|
39
42
|
return (
|
40
43
|
<div className={classnames(headerCSS, className, headerSpacing)}>
|
41
44
|
{children}
|
@@ -45,9 +48,11 @@ const Header = (props: CardHeaderProps) => {
|
|
45
48
|
|
46
49
|
// Body component
|
47
50
|
const Body = (props: CardBodyProps) => {
|
48
|
-
const { children, className } = props
|
51
|
+
const { children, className, padding = 'md' } = props
|
49
52
|
const bodyCSS = buildCss('pb_card_body_kit')
|
50
|
-
|
53
|
+
|
54
|
+
const bodySpacing = globalProps(props, { padding })
|
55
|
+
|
51
56
|
return (
|
52
57
|
<div className={classnames(bodyCSS, className, bodySpacing)}>
|
53
58
|
{children}
|
@@ -57,24 +62,22 @@ const Body = (props: CardBodyProps) => {
|
|
57
62
|
|
58
63
|
const Card = (props: CardPropTypes) => {
|
59
64
|
const {
|
65
|
+
borderNone = false,
|
60
66
|
children,
|
61
67
|
className,
|
62
|
-
dark = false,
|
63
68
|
highlight = {},
|
64
69
|
selected = false,
|
65
70
|
shadow = 'none',
|
66
|
-
|
71
|
+
padding = 'md',
|
67
72
|
} = props
|
68
73
|
const bodyCSS = buildCss('pb_card_body_kit')
|
69
74
|
const borderCSS = borderNone == true ? 'border_none' : ''
|
70
75
|
const cardCss = buildCss('pb_card_kit', `shadow_${shadow}`, `${borderCSS}`, {
|
71
|
-
dark: dark,
|
72
76
|
selected,
|
73
77
|
deselected: !selected,
|
74
78
|
[`highlight_${highlight.position}`]: highlight.position,
|
75
79
|
[`highlight_${highlight.color}`]: highlight.color,
|
76
80
|
})
|
77
|
-
const cardSpacing = spacing(props) ? spacing(props) : 'p_md'
|
78
81
|
|
79
82
|
// coerce to array
|
80
83
|
const cardChildren =
|
@@ -91,9 +94,9 @@ const Card = (props: CardPropTypes) => {
|
|
91
94
|
const nonHeaderChildren = cardChildren.filter((child) => (get(child, 'type.displayName') !== 'Header'))
|
92
95
|
|
93
96
|
return (
|
94
|
-
<div className={classnames(cardCss, className)}>
|
97
|
+
<div className={classnames(cardCss, globalProps(props), className)}>
|
95
98
|
{subComponentTags('Header')}
|
96
|
-
<div className={classnames(bodyCSS,
|
99
|
+
<div className={classnames(bodyCSS, globalProps({ padding }))}>
|
97
100
|
{nonHeaderChildren}
|
98
101
|
</div>
|
99
102
|
</div>
|
@@ -8,7 +8,7 @@
|
|
8
8
|
@include pb_card_selected;
|
9
9
|
}
|
10
10
|
|
11
|
-
|
11
|
+
&.dark {
|
12
12
|
@include pb_card_dark;
|
13
13
|
|
14
14
|
&[class*=_selected] {
|
@@ -40,6 +40,9 @@
|
|
40
40
|
flex-basis: auto;
|
41
41
|
min-height: 1px;
|
42
42
|
border: 0;
|
43
|
+
&.dark {
|
44
|
+
@include pb_card_dark;
|
45
|
+
}
|
43
46
|
}
|
44
47
|
|
45
48
|
@each $name, $shadow in $box_shadows {
|
@@ -13,8 +13,6 @@ module Playbook
|
|
13
13
|
default: "none"
|
14
14
|
prop :highlight, type: Playbook::Props::Hash,
|
15
15
|
default: {}
|
16
|
-
prop :dark, type: Playbook::Props::Boolean,
|
17
|
-
default: false
|
18
16
|
prop :border_none, type: Playbook::Props::Boolean,
|
19
17
|
default: false
|
20
18
|
|
@@ -24,14 +22,13 @@ module Playbook
|
|
24
22
|
shadow_class,
|
25
23
|
highlight_position_class,
|
26
24
|
highlight_color_class,
|
27
|
-
dark_class,
|
28
25
|
border_class)
|
29
26
|
end
|
30
27
|
|
31
28
|
def body_padding
|
32
|
-
if padding.present?
|
29
|
+
if padding.present?
|
33
30
|
""
|
34
|
-
else
|
31
|
+
else
|
35
32
|
"p_md"
|
36
33
|
end
|
37
34
|
end
|
@@ -55,10 +52,6 @@ module Playbook
|
|
55
52
|
highlight[:color].present? ? "highlight_#{highlight[:color]}" : nil
|
56
53
|
end
|
57
54
|
|
58
|
-
def dark_class
|
59
|
-
dark ? "dark" : nil
|
60
|
-
end
|
61
|
-
|
62
55
|
def border_class
|
63
56
|
border_none == true ? "border_none" : nil
|
64
57
|
end
|