playbook_ui 15.4.0 → 15.5.0.pre.alpha.draggablefix12557
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.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling.jsx +2 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_column_headers.jsx +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_fullscreen.jsx +3 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_infinite_scroll.jsx +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_editing.jsx +3 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling.jsx +2 -1
- data/app/pb_kits/playbook/pb_copy_button/_copy_button.tsx +21 -8
- data/app/pb_kits/playbook/pb_copy_button/copy_button.html.erb +6 -2
- data/app/pb_kits/playbook/pb_copy_button/copy_button.rb +3 -0
- data/app/pb_kits/playbook/pb_copy_button/copy_button.test.jsx +24 -0
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_button_variant.html.erb +9 -0
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_button_variant.jsx +24 -0
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_button_variant_rails.md +1 -0
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_button_variant_react.md +1 -0
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_default.html.erb +2 -2
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_default.jsx +1 -2
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.html.erb +2 -2
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx +2 -0
- data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_copy_button/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_abbreviated.md +1 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_matching_decimals_rails.md +1 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_matching_decimals_react.md +1 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_negative.html.erb +10 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_negative.jsx +10 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_negative.md +1 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_no_symbol_rails.md +1 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_no_symbol_react.md +1 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.html.erb +7 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_variants.jsx +7 -0
- data/app/pb_kits/playbook/pb_currency/docs/_description.md +2 -2
- data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +25 -11
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +44 -3
- data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.tsx +20 -13
- data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb +6 -4
- data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.test.js +17 -0
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_show_current_year.html.erb +4 -0
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_show_current_year.jsx +43 -0
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_show_current_year.md +1 -0
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_description.md +1 -1
- data/app/pb_kits/playbook/pb_date_range_inline/docs/example.yml +3 -2
- data/app/pb_kits/playbook/pb_date_range_inline/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.tsx +6 -4
- data/app/pb_kits/playbook/pb_date_stacked/date_stacked.html.erb +2 -3
- data/app/pb_kits/playbook/pb_date_stacked/date_stacked.rb +11 -5
- data/app/pb_kits/playbook/pb_date_stacked/date_stacked.test.js +26 -9
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_current_year.html.erb +12 -0
- data/app/pb_kits/playbook/pb_date_stacked/docs/{_date_stacked_not_current_year.jsx → _date_stacked_current_year.jsx} +6 -5
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_current_year.md +1 -0
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_date_stacked/docs/_description.md +1 -1
- data/app/pb_kits/playbook/pb_date_stacked/docs/example.yml +2 -2
- data/app/pb_kits/playbook/pb_date_stacked/docs/index.js +1 -1
- data/app/pb_kits/playbook/pb_date_time/_date_time.tsx +3 -0
- data/app/pb_kits/playbook/pb_date_time/date_time.html.erb +1 -0
- data/app/pb_kits/playbook/pb_date_time/date_time.rb +1 -0
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year.html.erb +4 -0
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year.jsx +14 -0
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year_rails.md +1 -0
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year_react.md +1 -0
- data/app/pb_kits/playbook/pb_date_time/docs/example.yml +3 -1
- data/app/pb_kits/playbook/pb_date_time/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +3 -0
- data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.html.erb +2 -2
- data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.rb +2 -0
- data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js +33 -0
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_show_current_year.html.erb +4 -0
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_show_current_year.jsx +22 -0
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_show_current_year.md +1 -0
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/example.yml +3 -1
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.html.erb +2 -2
- data/app/pb_kits/playbook/pb_draggable/context/index.tsx +101 -4
- data/app/pb_kits/playbook/pb_draggable/context/types.ts +6 -3
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers_dropzone.jsx +179 -0
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_draggable/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_dropdown/index.js +32 -14
- data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_alignment.jsx +2 -1
- data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_default.jsx +2 -1
- data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_orientation.jsx +2 -1
- data/app/pb_kits/playbook/pb_empty_state/docs/_empty_state_size.jsx +2 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +31 -9
- data/app/pb_kits/playbook/pb_flex/_flex_item.tsx +12 -5
- data/app/pb_kits/playbook/pb_flex/docs/_flex_item_example.jsx +1 -0
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_wrapped.jsx +4 -1
- data/app/pb_kits/playbook/pb_loading_inline/docs/_loading_inline_variant.jsx +1 -1
- data/app/pb_kits/playbook/pb_nav/_item.tsx +18 -4
- data/app/pb_kits/playbook/pb_nav/_nav.scss +30 -5
- data/app/pb_kits/playbook/pb_nav/_nav_item.test.js +192 -0
- data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +1 -1
- data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_disabled.html.erb +21 -0
- data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_disabled.jsx +113 -0
- data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_disabled.md +1 -0
- data/app/pb_kits/playbook/pb_nav/docs/_vertical_nav_disabled.html.erb +30 -0
- data/app/pb_kits/playbook/pb_nav/docs/_vertical_nav_disabled.jsx +117 -0
- data/app/pb_kits/playbook/pb_nav/docs/_vertical_nav_disabled.md +1 -0
- data/app/pb_kits/playbook/pb_nav/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_nav/docs/index.js +3 -1
- data/app/pb_kits/playbook/pb_nav/item.html.erb +6 -4
- data/app/pb_kits/playbook/pb_nav/item.rb +11 -2
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_description.md +3 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.md +1 -0
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_horizontal.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_non_clickable.jsx +1 -2
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.html.erb +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.md +11 -0
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_negative_numbers.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_secondary_y_axis.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.jsx +1 -2
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_stacked.jsx +1 -2
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_description.md +3 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_block_content.jsx +2 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.jsx +2 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.md +2 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.jsx +2 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_labels.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_legend.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.md +1 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_inner_sizes.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_live_data.jsx +2 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_rounded.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_with_title.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_description.md +3 -1
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_color.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_color.md +2 -2
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_complex.jsx +2 -1
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_default.md +1 -0
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_full_circle.jsx +2 -1
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_height.jsx +2 -1
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_min_max.jsx +2 -1
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_units.jsx +2 -1
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_description.md +3 -1
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_colors.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_default.md +1 -0
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_pb_line_graph_legend_position.html.erb +1 -1
- data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.jsx +4 -1
- data/app/pb_kits/playbook/pb_progress_step/_progress_step.scss +384 -262
- data/app/pb_kits/playbook/pb_progress_step/docs/_description.md +1 -5
- data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_color.html.erb +14 -0
- data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_color.jsx +29 -0
- data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_color.md +3 -0
- data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_custom_icon.jsx +31 -0
- data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_custom_icon.md +1 -0
- data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.html.erb +4 -1
- data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.jsx +14 -3
- data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.md +3 -0
- data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_tracker.md +3 -0
- data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_vertical.html.erb +1 -7
- data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_vertical.md +1 -0
- data/app/pb_kits/playbook/pb_progress_step/docs/example.yml +3 -0
- data/app/pb_kits/playbook/pb_progress_step/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_progress_step/progress_step.test.js +41 -0
- data/app/pb_kits/playbook/pb_radio/docs/_radio_react_hook.jsx +3 -1
- data/app/pb_kits/playbook/pb_select/docs/_select_react_hook.jsx +3 -1
- data/app/pb_kits/playbook/pb_table/_table.tsx +28 -26
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_sizing.jsx +4 -1
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +4 -0
- data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +1 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_react_hook.jsx +2 -1
- data/app/pb_kits/playbook/pb_user/docs/_user_font_options.jsx +1 -1
- data/app/pb_kits/playbook/utilities/_truncate.scss +2 -0
- data/app/pb_kits/playbook/utilities/globalProps.ts +26 -8
- data/app/pb_kits/playbook/utilities/test/globalProps/alignContent.test.js +18 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/alignItems.test.js +18 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/alignSelf.test.js +18 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/display.test.js +18 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/flex.test.js +18 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/flexDirection.test.js +18 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/flexGrow.test.js +18 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/flexShrink.test.js +18 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/flexWrap.test.js +18 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/justifyContent.test.js +18 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/justifySelf.test.js +18 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/order.test.js +18 -0
- data/dist/chunks/_typeahead-LoB4DX1N.js +6 -0
- data/dist/chunks/lib-CgpqUb6l.js +29 -0
- data/dist/chunks/vendor.js +37 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +2 -2
- metadata +47 -11
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_not_current_year.html.erb +0 -5
- data/dist/chunks/_line_graph-r__oOO2H.js +0 -1
- data/dist/chunks/_typeahead-B7c52zVj.js +0 -6
- data/dist/chunks/_weekday_stacked-DgiIj2w3.js +0 -37
- data/dist/chunks/componentRegistry-DzmmLR2x.js +0 -1
- data/dist/chunks/lib-CRUXizZe.js +0 -29
- data/dist/chunks/pb_form_validation-CywJN0ej.js +0 -1
- data/dist/playbook-doc.js +0 -19
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import ProgressStep from '../_progress_step.tsx'
|
|
4
|
+
import ProgressStepItem from '../_progress_step_item.tsx'
|
|
5
|
+
import Caption from '../../pb_caption/_caption'
|
|
6
|
+
|
|
7
|
+
const ProgressStepColor = (props) => (
|
|
8
|
+
<div>
|
|
9
|
+
<br />
|
|
10
|
+
<ProgressStep
|
|
11
|
+
color="info"
|
|
12
|
+
icon
|
|
13
|
+
variant="tracker"
|
|
14
|
+
{...props}
|
|
15
|
+
>
|
|
16
|
+
<ProgressStepItem status="complete">
|
|
17
|
+
<Caption>{'Ordered'}</Caption>
|
|
18
|
+
</ProgressStepItem>
|
|
19
|
+
<ProgressStepItem status="active">
|
|
20
|
+
<Caption>{'Shipped'}</Caption>
|
|
21
|
+
</ProgressStepItem>
|
|
22
|
+
<ProgressStepItem status="inactive">
|
|
23
|
+
<Caption>{'Delivered'}</Caption>
|
|
24
|
+
</ProgressStepItem>
|
|
25
|
+
</ProgressStep>
|
|
26
|
+
</div>
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
export default ProgressStepColor
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import ProgressStep from '../_progress_step.tsx'
|
|
4
|
+
import ProgressStepItem from '../_progress_step_item.tsx'
|
|
5
|
+
import Caption from '../../pb_caption/_caption'
|
|
6
|
+
|
|
7
|
+
const ProgressStepCustomIcon = (props) => (
|
|
8
|
+
<div>
|
|
9
|
+
<br />
|
|
10
|
+
<ProgressStep
|
|
11
|
+
icon
|
|
12
|
+
variant="tracker"
|
|
13
|
+
{...props}
|
|
14
|
+
>
|
|
15
|
+
<ProgressStepItem status="complete">
|
|
16
|
+
<Caption>{'Ordered'}</Caption>
|
|
17
|
+
</ProgressStepItem>
|
|
18
|
+
<ProgressStepItem
|
|
19
|
+
icon="exclamation-triangle"
|
|
20
|
+
status="active"
|
|
21
|
+
>
|
|
22
|
+
<Caption>{'Shipped'}</Caption>
|
|
23
|
+
</ProgressStepItem>
|
|
24
|
+
<ProgressStepItem status="inactive">
|
|
25
|
+
<Caption>{'Delivered'}</Caption>
|
|
26
|
+
</ProgressStepItem>
|
|
27
|
+
</ProgressStep>
|
|
28
|
+
</div>
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
export default ProgressStepCustomIcon
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Custom icons can also be set for individual steps. Simply use the `icon` prop for the relevant `ProgressStepItem`/`progress_step_item` as shown here.
|
|
@@ -39,7 +39,10 @@
|
|
|
39
39
|
<%= pb_rails("progress_step/progress_step_item", props: {status: "complete"}) do %>
|
|
40
40
|
step 2
|
|
41
41
|
<% end %>
|
|
42
|
-
<%= pb_rails("progress_step/progress_step_item", props: {status: "
|
|
42
|
+
<%= pb_rails("progress_step/progress_step_item", props: {status: "active"}) do %>
|
|
43
43
|
step 3
|
|
44
|
+
<% end %>
|
|
45
|
+
<%= pb_rails("progress_step/progress_step_item", props: {status: "inactive"}) do %>
|
|
46
|
+
step 4
|
|
44
47
|
<% end %>
|
|
45
48
|
<% end %>
|
|
@@ -6,7 +6,6 @@ import ProgressStepItem from '../_progress_step_item.tsx'
|
|
|
6
6
|
const ProgressStepDefault = (props) => (
|
|
7
7
|
<div>
|
|
8
8
|
<ProgressStep
|
|
9
|
-
icon
|
|
10
9
|
{...props}
|
|
11
10
|
>
|
|
12
11
|
<ProgressStepItem status="complete" />
|
|
@@ -19,12 +18,24 @@ const ProgressStepDefault = (props) => (
|
|
|
19
18
|
|
|
20
19
|
<ProgressStep {...props}>
|
|
21
20
|
<ProgressStepItem status="complete">{'Step 1'}</ProgressStepItem>
|
|
22
|
-
<ProgressStepItem status="
|
|
23
|
-
<ProgressStepItem status="
|
|
21
|
+
<ProgressStepItem status="complete">{'Step 2'}</ProgressStepItem>
|
|
22
|
+
<ProgressStepItem status="active">{'Step 3'}</ProgressStepItem>
|
|
23
|
+
<ProgressStepItem status="inactive">{'Step 4'}</ProgressStepItem>
|
|
24
|
+
<ProgressStepItem status="inactive">{'Step 5'}</ProgressStepItem>
|
|
24
25
|
</ProgressStep>
|
|
25
26
|
|
|
26
27
|
<br />
|
|
27
28
|
<br />
|
|
29
|
+
|
|
30
|
+
<ProgressStep
|
|
31
|
+
icon
|
|
32
|
+
{...props}
|
|
33
|
+
>
|
|
34
|
+
<ProgressStepItem status="complete">{'Step 1'}</ProgressStepItem>
|
|
35
|
+
<ProgressStepItem status="complete">{'Step 2'}</ProgressStepItem>
|
|
36
|
+
<ProgressStepItem status="active">{'Step 3'}</ProgressStepItem>
|
|
37
|
+
<ProgressStepItem status="inactive">{'Step 4'}</ProgressStepItem>
|
|
38
|
+
</ProgressStep>
|
|
28
39
|
</div>
|
|
29
40
|
)
|
|
30
41
|
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
The `variant` prop can be set to `tracker` to achieve this UI. Tracker is only available with the horizontal orientation and it is also recommended that you set the `icon` prop to true for this variant.
|
|
2
|
+
|
|
3
|
+
This variant takes children just like the default progress step, however, it is best to use the caption kit for children in this variant.
|
|
@@ -25,13 +25,7 @@
|
|
|
25
25
|
Child
|
|
26
26
|
<% end %>
|
|
27
27
|
<%= pb_rails("progress_step/progress_step_item", props: {status: "active"}) do %>
|
|
28
|
-
|
|
29
|
-
Card content
|
|
30
|
-
<% end %>
|
|
31
|
-
<br>
|
|
32
|
-
<%= pb_rails("card", props: {highlight: {position: "side", color:"windows"}}) do %>
|
|
33
|
-
Card content
|
|
34
|
-
<% end %>
|
|
28
|
+
Child
|
|
35
29
|
<% end %>
|
|
36
30
|
<%= pb_rails("progress_step/progress_step_item", props: {status: "inactive"}) do %>
|
|
37
31
|
Child
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
`orientation` can also be set to `vertical` as shown here. By default, this is set to `horizontal`.
|
|
@@ -3,6 +3,7 @@ examples:
|
|
|
3
3
|
- progress_step_default: Default
|
|
4
4
|
- progress_step_vertical: Vertical
|
|
5
5
|
- progress_step_tracker: Tracker
|
|
6
|
+
- progress_step_color: Color
|
|
6
7
|
- progress_step_custom_icon: Custom Icon
|
|
7
8
|
- progress_step_tooltip: Tooltip
|
|
8
9
|
|
|
@@ -10,4 +11,6 @@ examples:
|
|
|
10
11
|
- progress_step_default: Default
|
|
11
12
|
- progress_step_vertical: Vertical
|
|
12
13
|
- progress_step_tracker: Tracker
|
|
14
|
+
- progress_step_color: Color
|
|
15
|
+
- progress_step_custom_icon: Custom Icon
|
|
13
16
|
- progress_step_tracker_click_events: Using State
|
|
@@ -2,3 +2,5 @@ export { default as ProgressStepDefault } from './_progress_step_default.jsx'
|
|
|
2
2
|
export { default as ProgressStepVertical } from './_progress_step_vertical.jsx'
|
|
3
3
|
export { default as ProgressStepTracker } from './_progress_step_tracker.jsx'
|
|
4
4
|
export { default as ProgressStepTrackerClickEvents } from './_progress_step_tracker_click_events.jsx'
|
|
5
|
+
export { default as ProgressStepColor } from './_progress_step_color.jsx'
|
|
6
|
+
export { default as ProgressStepCustomIcon } from './_progress_step_custom_icon.jsx'
|
|
@@ -107,3 +107,44 @@ test('should render the children elements', () => {
|
|
|
107
107
|
expect(step2Kit).toHaveClass('pb_progress_step_item_active')
|
|
108
108
|
expect(step3Kit).toHaveClass('pb_progress_step_item_inactive')
|
|
109
109
|
})
|
|
110
|
+
|
|
111
|
+
test('should render info color', () => {
|
|
112
|
+
render(
|
|
113
|
+
<ProgressStep
|
|
114
|
+
aria={{ label: testId }}
|
|
115
|
+
color="info"
|
|
116
|
+
data={{ testid: testId }}
|
|
117
|
+
variant="tracker"
|
|
118
|
+
>
|
|
119
|
+
<ProgressStepItem status="complete">{'Step 1'}</ProgressStepItem>
|
|
120
|
+
<ProgressStepItem status="active">{'Step 2'}</ProgressStepItem>
|
|
121
|
+
<ProgressStepItem status="inactive">{'Step 3'}</ProgressStepItem>
|
|
122
|
+
</ProgressStep>
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
const kit = screen.getByTestId(testId)
|
|
126
|
+
expect(kit).toHaveClass('pb_progress_step_kit_horizontal_tracker_info')
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
test('should render custom icon', () => {
|
|
130
|
+
render(
|
|
131
|
+
<ProgressStep
|
|
132
|
+
aria={{ label: testId }}
|
|
133
|
+
data={{ testid: testId }}
|
|
134
|
+
variant="tracker"
|
|
135
|
+
>
|
|
136
|
+
<ProgressStepItem icon="exclamation-triangle"
|
|
137
|
+
status="complete"
|
|
138
|
+
>
|
|
139
|
+
{'Step 1'}
|
|
140
|
+
</ProgressStepItem>
|
|
141
|
+
<ProgressStepItem status="active">{'Step 2'}</ProgressStepItem>
|
|
142
|
+
<ProgressStepItem status="inactive">{'Step 3'}</ProgressStepItem>
|
|
143
|
+
</ProgressStep>
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
const kit = screen.getByTestId(testId)
|
|
147
|
+
expect(kit).toHaveClass('pb_progress_step_kit_horizontal_tracker')
|
|
148
|
+
const icon = kit.getAttribute('aria-label', "exclamation-triangle-icon")
|
|
149
|
+
expect(icon).toBeDefined()
|
|
150
|
+
})
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import { useForm } from "react-hook-form"
|
|
3
|
-
import
|
|
3
|
+
import Radio from "../_radio"
|
|
4
|
+
import Body from "../../pb_body/_body"
|
|
5
|
+
import Flex from "../../pb_flex/_flex"
|
|
4
6
|
|
|
5
7
|
const RadioReactHook = () => {
|
|
6
8
|
const { register, watch } = useForm({
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React, { useState } from "react"
|
|
2
2
|
import { useForm } from "react-hook-form"
|
|
3
|
-
import
|
|
3
|
+
import Select from "../_select"
|
|
4
|
+
import Body from "../../pb_body/_body"
|
|
5
|
+
import Button from "../../pb_button/_button"
|
|
4
6
|
|
|
5
7
|
const SelectReactHook = (props) => {
|
|
6
8
|
const { register, handleSubmit, formState: { errors } } = useForm({
|
|
@@ -119,21 +119,22 @@ const Table = (props: TableProps): React.ReactElement => {
|
|
|
119
119
|
header.classList.add('sticky-left-shadow');
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
const headerWidth = (header as HTMLElement).offsetWidth;
|
|
123
|
+
accumulatedWidth += headerWidth;
|
|
124
124
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
cells.forEach((cell) => {
|
|
126
|
+
cell.classList.add('sticky');
|
|
127
|
+
(cell as HTMLElement).style.left = `${accumulatedWidth - headerWidth}px`;
|
|
128
128
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
129
|
+
if (!isLastColumn) {
|
|
130
|
+
cell.classList.add('with-border-right');
|
|
131
|
+
cell.classList.remove('sticky-left-shadow');
|
|
132
|
+
} else {
|
|
133
|
+
cell.classList.remove('with-border-right');
|
|
134
|
+
cell.classList.add('sticky-left-shadow');
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}
|
|
137
138
|
});
|
|
138
139
|
};
|
|
139
140
|
|
|
@@ -170,21 +171,22 @@ const Table = (props: TableProps): React.ReactElement => {
|
|
|
170
171
|
header.classList.add('sticky-right-shadow');
|
|
171
172
|
}
|
|
172
173
|
|
|
173
|
-
|
|
174
|
-
|
|
174
|
+
const headerWidth = (header as HTMLElement).offsetWidth;
|
|
175
|
+
accumulatedWidth += headerWidth;
|
|
175
176
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
177
|
+
cells.forEach((cell) => {
|
|
178
|
+
cell.classList.add('sticky');
|
|
179
|
+
(cell as HTMLElement).style.right = `${accumulatedWidth - headerWidth}px`;
|
|
179
180
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
181
|
+
if (!isLastColumn) {
|
|
182
|
+
cell.classList.add('with-border-left');
|
|
183
|
+
cell.classList.remove('sticky-right-shadow');
|
|
184
|
+
} else {
|
|
185
|
+
cell.classList.remove('with-border-left');
|
|
186
|
+
cell.classList.add('sticky-right-shadow');
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
}
|
|
188
190
|
});
|
|
189
191
|
};
|
|
190
192
|
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import
|
|
2
|
+
import Tooltip from '../_tooltip'
|
|
3
|
+
import Button from '../../pb_button/_button'
|
|
4
|
+
import Flex from '../../pb_flex/_flex'
|
|
5
|
+
import FlexItem from '../../pb_flex/_flex_item'
|
|
3
6
|
|
|
4
7
|
const TooltipSizing = (props) => {
|
|
5
8
|
|
|
@@ -213,10 +213,24 @@ export type GlobalProps = AlignContent & AlignItems & AlignSelf &
|
|
|
213
213
|
|
|
214
214
|
const getResponsivePropClasses = (prop: {[key: string]: string}, classPrefix: string) => {
|
|
215
215
|
const keys: string[] = Object.keys(prop)
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
216
|
+
const screenSizeValues = ["xs", "sm", "md", "lg", "xl"]
|
|
217
|
+
let classResult = ''
|
|
218
|
+
|
|
219
|
+
// Handle default value separately (generates base class without size prefix)
|
|
220
|
+
if (prop.default !== undefined) {
|
|
221
|
+
const defaultValue: string = typeof(prop.default) === 'string' ? camelToSnakeCase(prop.default) : prop.default
|
|
222
|
+
classResult += `${classPrefix}_${defaultValue} `
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// Handle responsive sizes (generates classes with size prefix)
|
|
226
|
+
keys.forEach((key) => {
|
|
227
|
+
if (screenSizeValues.includes(key)) {
|
|
228
|
+
const propValue: string = typeof(prop[key]) === 'string' ? camelToSnakeCase(prop[key]) : prop[key]
|
|
229
|
+
classResult += `${classPrefix}_${key}_${propValue} `
|
|
230
|
+
}
|
|
231
|
+
})
|
|
232
|
+
|
|
233
|
+
return classResult.trim()
|
|
220
234
|
}
|
|
221
235
|
|
|
222
236
|
//reusable function for top, bottom, right and left props
|
|
@@ -436,9 +450,11 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
|
|
|
436
450
|
if (typeof zIndexEntry[1] == "number") {
|
|
437
451
|
css += `z_index_${zIndexEntry[1]} `
|
|
438
452
|
} else if (typeof zIndexEntry[1] == "object") {
|
|
439
|
-
|
|
440
|
-
|
|
453
|
+
const responsiveObj: {[key: string]: string} = {}
|
|
454
|
+
Object.entries(zIndexEntry[1]).forEach(([key, value]) => {
|
|
455
|
+
responsiveObj[key] = value.toString()
|
|
441
456
|
})
|
|
457
|
+
css += getResponsivePropClasses(responsiveObj, 'z_index')
|
|
442
458
|
} else if (zIndexEntry[1] === 'max') {
|
|
443
459
|
css += `z_index_max `
|
|
444
460
|
}
|
|
@@ -463,9 +479,11 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
|
|
|
463
479
|
if (typeof displayEntry[1] == "string") {
|
|
464
480
|
css += `display_${displayEntry[1]} `
|
|
465
481
|
} else if (typeof displayEntry[1] == "object") {
|
|
466
|
-
|
|
467
|
-
|
|
482
|
+
const responsiveObj: {[key: string]: string} = {}
|
|
483
|
+
Object.entries(displayEntry[1]).forEach(([key, value]) => {
|
|
484
|
+
responsiveObj[key] = typeof value === 'string' ? value : value.toString()
|
|
468
485
|
})
|
|
486
|
+
css += getResponsivePropClasses(responsiveObj, 'display')
|
|
469
487
|
} else {
|
|
470
488
|
' '
|
|
471
489
|
}
|
|
@@ -35,3 +35,21 @@ test('Global Props: returns proper class name', () => {
|
|
|
35
35
|
})
|
|
36
36
|
}
|
|
37
37
|
})
|
|
38
|
+
|
|
39
|
+
test('Global Props: returns proper class name with default key', () => {
|
|
40
|
+
const testId = `${testSubject}-default-responsive`
|
|
41
|
+
render(
|
|
42
|
+
<Body
|
|
43
|
+
alignContent={{ default: "spaceAround", xs: "center", sm: "spaceAround", md: "center" }}
|
|
44
|
+
data={{ testid: testId }}
|
|
45
|
+
text="Hi"
|
|
46
|
+
/>
|
|
47
|
+
)
|
|
48
|
+
const kit = screen.getByTestId(testId)
|
|
49
|
+
// Should have base class for default value
|
|
50
|
+
expect(kit).toHaveClass(`align_content_space_around`)
|
|
51
|
+
// Should have responsive classes for screen sizes
|
|
52
|
+
expect(kit).toHaveClass(`align_content_xs_center`)
|
|
53
|
+
expect(kit).toHaveClass(`align_content_sm_space_around`)
|
|
54
|
+
expect(kit).toHaveClass(`align_content_md_center`)
|
|
55
|
+
})
|
|
@@ -34,3 +34,21 @@ test('Global Props: returns proper class name', () => {
|
|
|
34
34
|
})
|
|
35
35
|
}
|
|
36
36
|
})
|
|
37
|
+
|
|
38
|
+
test('Global Props: returns proper class name with default key', () => {
|
|
39
|
+
const testId = `${testSubject}-default-responsive`
|
|
40
|
+
render(
|
|
41
|
+
<Body
|
|
42
|
+
alignItems={{ default: "end", xs: "center", sm: "end", md: "center" }}
|
|
43
|
+
data={{ testid: testId }}
|
|
44
|
+
text="Hi"
|
|
45
|
+
/>
|
|
46
|
+
)
|
|
47
|
+
const kit = screen.getByTestId(testId)
|
|
48
|
+
// Should have base class for default value
|
|
49
|
+
expect(kit).toHaveClass(`align_items_end`)
|
|
50
|
+
// Should have responsive classes for screen sizes
|
|
51
|
+
expect(kit).toHaveClass(`align_items_xs_center`)
|
|
52
|
+
expect(kit).toHaveClass(`align_items_sm_end`)
|
|
53
|
+
expect(kit).toHaveClass(`align_items_md_center`)
|
|
54
|
+
})
|
|
@@ -35,3 +35,21 @@ test('Global Props: returns proper class name', () => {
|
|
|
35
35
|
})
|
|
36
36
|
}
|
|
37
37
|
})
|
|
38
|
+
|
|
39
|
+
test('Global Props: returns proper class name with default key', () => {
|
|
40
|
+
const testId = `${testSubject}-default-responsive`
|
|
41
|
+
render(
|
|
42
|
+
<Body
|
|
43
|
+
alignSelf={{ default: "end", xs: "center", sm: "end", md: "center" }}
|
|
44
|
+
data={{ testid: testId }}
|
|
45
|
+
text="Hi"
|
|
46
|
+
/>
|
|
47
|
+
)
|
|
48
|
+
const kit = screen.getByTestId(testId)
|
|
49
|
+
// Should have base class for default value
|
|
50
|
+
expect(kit).toHaveClass(`align_self_end`)
|
|
51
|
+
// Should have responsive classes for screen sizes
|
|
52
|
+
expect(kit).toHaveClass(`align_self_xs_center`)
|
|
53
|
+
expect(kit).toHaveClass(`align_self_sm_end`)
|
|
54
|
+
expect(kit).toHaveClass(`align_self_md_center`)
|
|
55
|
+
})
|
|
@@ -36,3 +36,21 @@ test('Global Props: returns proper class name', () => {
|
|
|
36
36
|
})
|
|
37
37
|
}
|
|
38
38
|
})
|
|
39
|
+
|
|
40
|
+
test('Global Props: returns proper class name with default key', () => {
|
|
41
|
+
const testId = `${testSubject}-default-responsive`
|
|
42
|
+
render(
|
|
43
|
+
<Body
|
|
44
|
+
data={{ testid: testId }}
|
|
45
|
+
display={{ default: "none", xs: "block", sm: "none", md: "block" }}
|
|
46
|
+
text="Hi"
|
|
47
|
+
/>
|
|
48
|
+
)
|
|
49
|
+
const kit = screen.getByTestId(testId)
|
|
50
|
+
// Should have base class for default value
|
|
51
|
+
expect(kit).toHaveClass(`display_none`)
|
|
52
|
+
// Should have responsive classes for screen sizes
|
|
53
|
+
expect(kit).toHaveClass(`display_xs_block`)
|
|
54
|
+
expect(kit).toHaveClass(`display_sm_none`)
|
|
55
|
+
expect(kit).toHaveClass(`display_md_block`)
|
|
56
|
+
})
|
|
@@ -62,3 +62,21 @@ test('Global Props: returns proper class name', () => {
|
|
|
62
62
|
})
|
|
63
63
|
}
|
|
64
64
|
})
|
|
65
|
+
|
|
66
|
+
test('Global Props: returns proper class name with default key', () => {
|
|
67
|
+
const testId = `${testSubject}-default-responsive`
|
|
68
|
+
render(
|
|
69
|
+
<Body
|
|
70
|
+
data={{ testid: testId }}
|
|
71
|
+
flex={{ default: "3", xs: "1", sm: "3", md: "1" }}
|
|
72
|
+
text="Hi"
|
|
73
|
+
/>
|
|
74
|
+
)
|
|
75
|
+
const kit = screen.getByTestId(testId)
|
|
76
|
+
// Should have base class for default value
|
|
77
|
+
expect(kit).toHaveClass(`flex_3`)
|
|
78
|
+
// Should have responsive classes for screen sizes
|
|
79
|
+
expect(kit).toHaveClass(`flex_xs_1`)
|
|
80
|
+
expect(kit).toHaveClass(`flex_sm_3`)
|
|
81
|
+
expect(kit).toHaveClass(`flex_md_1`)
|
|
82
|
+
})
|
|
@@ -35,3 +35,21 @@ test('Global Props: returns proper class name', () => {
|
|
|
35
35
|
})
|
|
36
36
|
}
|
|
37
37
|
})
|
|
38
|
+
|
|
39
|
+
test('Global Props: returns proper class name with default key', () => {
|
|
40
|
+
const testId = `${testSubject}-default-responsive`
|
|
41
|
+
render(
|
|
42
|
+
<Body
|
|
43
|
+
data={{ testid: testId }}
|
|
44
|
+
flexDirection={{ default: "column", xs: "row", sm: "column", md: "row" }}
|
|
45
|
+
text="Hi"
|
|
46
|
+
/>
|
|
47
|
+
)
|
|
48
|
+
const kit = screen.getByTestId(testId)
|
|
49
|
+
// Should have base class for default value
|
|
50
|
+
expect(kit).toHaveClass(`flex_direction_column`)
|
|
51
|
+
// Should have responsive classes for screen sizes
|
|
52
|
+
expect(kit).toHaveClass(`flex_direction_xs_row`)
|
|
53
|
+
expect(kit).toHaveClass(`flex_direction_sm_column`)
|
|
54
|
+
expect(kit).toHaveClass(`flex_direction_md_row`)
|
|
55
|
+
})
|
|
@@ -33,3 +33,21 @@ test('Global Props: Returns ordinal suffixed class name', () => {
|
|
|
33
33
|
})
|
|
34
34
|
}
|
|
35
35
|
})
|
|
36
|
+
|
|
37
|
+
test('Global Props: returns proper class name with default key', () => {
|
|
38
|
+
const testId = `${testSubject}-default-responsive`
|
|
39
|
+
render(
|
|
40
|
+
<Body
|
|
41
|
+
data={{ testid: testId }}
|
|
42
|
+
flexGrow={{ default: 1, xs: 0, sm: 1, md: 0 }}
|
|
43
|
+
text="Hi"
|
|
44
|
+
/>
|
|
45
|
+
)
|
|
46
|
+
const kit = screen.getByTestId(testId)
|
|
47
|
+
// Should have base class for default value
|
|
48
|
+
expect(kit).toHaveClass(`flex_grow_1`)
|
|
49
|
+
// Should have responsive classes for screen sizes
|
|
50
|
+
expect(kit).toHaveClass(`flex_grow_xs_0`)
|
|
51
|
+
expect(kit).toHaveClass(`flex_grow_sm_1`)
|
|
52
|
+
expect(kit).toHaveClass(`flex_grow_md_0`)
|
|
53
|
+
})
|
|
@@ -33,3 +33,21 @@ test('Global Props: Returns ordinal suffixed class name', () => {
|
|
|
33
33
|
})
|
|
34
34
|
}
|
|
35
35
|
})
|
|
36
|
+
|
|
37
|
+
test('Global Props: returns proper class name with default key', () => {
|
|
38
|
+
const testId = `${testSubject}-default-responsive`
|
|
39
|
+
render(
|
|
40
|
+
<Body
|
|
41
|
+
data={{ testid: testId }}
|
|
42
|
+
flexShrink={{ default: 0, xs: 1, sm: 0, md: 1 }}
|
|
43
|
+
text="Hi"
|
|
44
|
+
/>
|
|
45
|
+
)
|
|
46
|
+
const kit = screen.getByTestId(testId)
|
|
47
|
+
// Should have base class for default value
|
|
48
|
+
expect(kit).toHaveClass(`flex_shrink_0`)
|
|
49
|
+
// Should have responsive classes for screen sizes
|
|
50
|
+
expect(kit).toHaveClass(`flex_shrink_xs_1`)
|
|
51
|
+
expect(kit).toHaveClass(`flex_shrink_sm_0`)
|
|
52
|
+
expect(kit).toHaveClass(`flex_shrink_md_1`)
|
|
53
|
+
})
|
|
@@ -35,3 +35,21 @@ test('Global Props: returns proper class name', () => {
|
|
|
35
35
|
})
|
|
36
36
|
}
|
|
37
37
|
})
|
|
38
|
+
|
|
39
|
+
test('Global Props: returns proper class name with default key', () => {
|
|
40
|
+
const testId = `${testSubject}-default-responsive`
|
|
41
|
+
render(
|
|
42
|
+
<Body
|
|
43
|
+
data={{ testid: testId }}
|
|
44
|
+
flexWrap={{ default: "wrap", xs: "nowrap", sm: "wrap", md: "nowrap" }}
|
|
45
|
+
text="Hi"
|
|
46
|
+
/>
|
|
47
|
+
)
|
|
48
|
+
const kit = screen.getByTestId(testId)
|
|
49
|
+
// Should have base class for default value
|
|
50
|
+
expect(kit).toHaveClass(`flex_wrap_wrap`)
|
|
51
|
+
// Should have responsive classes for screen sizes
|
|
52
|
+
expect(kit).toHaveClass(`flex_wrap_xs_nowrap`)
|
|
53
|
+
expect(kit).toHaveClass(`flex_wrap_sm_wrap`)
|
|
54
|
+
expect(kit).toHaveClass(`flex_wrap_md_nowrap`)
|
|
55
|
+
})
|