playbook_ui 15.0.0.pre.alpha.PLAY2316advancedtablerightsidedoubleborder10726 → 15.0.0.pre.alpha.PLAY2361datepickerarrownav10322
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/_playbook.scss +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +11 -24
- data/app/pb_kits/playbook/pb_advanced_table/Components/VirtualizedTableView.tsx +7 -7
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/RowUtils.ts +2 -7
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +13 -67
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_vertical_border.html.erb +2 -4
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_vertical_border.jsx +9 -12
- data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_card/_card.scss +4 -12
- data/app/pb_kits/playbook/pb_card/_card.tsx +3 -3
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +0 -10
- data/app/pb_kits/playbook/pb_card/docs/_card_highlight.html.erb +0 -3
- data/app/pb_kits/playbook/pb_card/docs/_card_highlight.jsx +0 -8
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +0 -2
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.html.erb +0 -1
- data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +0 -1
- data/app/pb_kits/playbook/pb_contact/_contact.tsx +0 -5
- data/app/pb_kits/playbook/pb_contact/contact.rb +0 -4
- data/app/pb_kits/playbook/pb_contact/contact.test.js +1 -21
- data/app/pb_kits/playbook/pb_contact/docs/_contact_default.html.erb +1 -16
- data/app/pb_kits/playbook/pb_contact/docs/_contact_default.jsx +0 -15
- data/app/pb_kits/playbook/pb_contact/docs/_contact_with_detail.html.erb +0 -6
- data/app/pb_kits/playbook/pb_contact/docs/_contact_with_detail.jsx +0 -6
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +4 -6
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +5 -37
- data/app/pb_kits/playbook/pb_dialog/_close_icon.tsx +1 -5
- data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +8 -6
- data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +1 -1
- data/app/pb_kits/playbook/pb_dialog/dialogHelper.js +65 -0
- data/app/pb_kits/playbook/pb_dialog/dialog_header.html.erb +2 -2
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +0 -9
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.html.erb +3 -3
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +0 -1
- data/app/pb_kits/playbook/pb_icon/_icon.tsx +2 -13
- data/app/pb_kits/playbook/pb_icon/icon.rb +1 -9
- data/app/pb_kits/playbook/pb_icon_button/_icon_button.tsx +0 -1
- data/app/pb_kits/playbook/pb_icon_button/icon_button.html.erb +1 -2
- data/app/pb_kits/playbook/pb_icon_circle/icon_circle.html.erb +1 -1
- data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +1 -3
- data/app/pb_kits/playbook/pb_loading_inline/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_loading_inline/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_loading_inline/loading_inline.html.erb +1 -1
- data/app/pb_kits/playbook/pb_loading_inline/loading_inline.rb +0 -11
- data/app/pb_kits/playbook/pb_nav/_item.tsx +5 -19
- data/app/pb_kits/playbook/pb_nav/item.html.erb +2 -6
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_breached.html.erb +3 -3
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_common.html.erb +3 -3
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.html.erb +3 -3
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.html.erb +3 -3
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_strength_change.html.erb +3 -3
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.html.erb +2 -2
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.scss +5 -13
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_children.html.erb +0 -23
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_children.jsx +7 -45
- data/app/pb_kits/playbook/pb_section_separator/section_separator.html.erb +1 -4
- data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +0 -3
- data/app/pb_kits/playbook/pb_text_input/docs/example.yml +0 -3
- data/app/pb_kits/playbook/pb_text_input/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_text_input/text_input.rb +3 -2
- data/app/pb_kits/playbook/pb_text_input/text_input.test.js +0 -38
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.tsx +8 -24
- data/app/pb_kits/playbook/pb_timestamp/docs/_time_stamp_default.md +1 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align.html.erb +10 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align.jsx +9 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.html.erb +17 -3
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.jsx +15 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.html.erb +2 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.jsx +2 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.html.erb +14 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.jsx +14 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_unstyled.html.erb +4 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_unstyled.jsx +4 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated.jsx +1 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/example.yml +6 -18
- data/app/pb_kits/playbook/pb_timestamp/docs/index.js +0 -6
- data/app/pb_kits/playbook/pb_timestamp/timestamp.rb +7 -29
- data/app/pb_kits/playbook/pb_timestamp/timestamp.test.js +4 -69
- data/dist/chunks/{_line_graph-DeH7NK-i.js → _line_graph-DHO-uYxy.js} +1 -1
- data/dist/chunks/_typeahead-_kMvPVfz.js +6 -0
- data/dist/chunks/_weekday_stacked-B1esXFeA.js +37 -0
- data/dist/chunks/{lib-QZuu1ltS.js → lib-C43ywQsO.js} +1 -1
- data/dist/chunks/{pb_form_validation-CleM960_.js → pb_form_validation-Cqj3itLG.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +1 -15
- data/dist/playbook-doc.js +2 -2
- 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/engine.rb +1 -0
- data/lib/playbook/forms/builder/form_field_builder.rb +2 -37
- data/lib/playbook/kit_base.rb +2 -23
- data/lib/playbook/version.rb +1 -1
- metadata +28 -108
- data/app/pb_kits/playbook/pb_contact/docs/_contact_default.md +0 -5
- data/app/pb_kits/playbook/pb_loading_inline/docs/_loading_inline_variant.html.erb +0 -5
- data/app/pb_kits/playbook/pb_loading_inline/docs/_loading_inline_variant.jsx +0 -24
- data/app/pb_kits/playbook/pb_pb_bar_graph/_pb_bar_graph.scss +0 -0
- data/app/pb_kits/playbook/pb_pb_bar_graph/_pb_bar_graph.tsx +0 -62
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors.html.erb +0 -35
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors.jsx +0 -49
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors_rails.md +0 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors_react.md +0 -2
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.html.erb +0 -38
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.jsx +0 -51
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.html.erb +0 -46
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.jsx +0 -62
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.md +0 -3
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_horizontal.html.erb +0 -47
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_horizontal.jsx +0 -60
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend.html.erb +0 -25
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend.jsx +0 -36
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_non_clickable.jsx +0 -44
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.html.erb +0 -100
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.jsx +0 -126
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_negative_numbers.html.erb +0 -32
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_negative_numbers.jsx +0 -48
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_secondary_y_axis.html.erb +0 -68
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_secondary_y_axis.jsx +0 -81
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.html.erb +0 -31
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.jsx +0 -42
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.md +0 -2
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_stacked.html.erb +0 -35
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_stacked.jsx +0 -51
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/example.yml +0 -27
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/index.js +0 -11
- data/app/pb_kits/playbook/pb_pb_bar_graph/pbBarGraphTheme.ts +0 -106
- data/app/pb_kits/playbook/pb_pb_bar_graph/pb_bar_graph.html.erb +0 -1
- data/app/pb_kits/playbook/pb_pb_bar_graph/pb_bar_graph.rb +0 -28
- data/app/pb_kits/playbook/pb_pb_bar_graph/pbbargraph.test.jsx +0 -31
- data/app/pb_kits/playbook/pb_pb_circle_chart/_pb_circle_chart.scss +0 -3
- data/app/pb_kits/playbook/pb_pb_circle_chart/_pb_circle_chart.tsx +0 -62
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_block_content.html.erb +0 -31
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_block_content.jsx +0 -81
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.html.erb +0 -25
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.jsx +0 -40
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.md +0 -5
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.html.erb +0 -27
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.jsx +0 -39
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.md +0 -5
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.html.erb +0 -93
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.jsx +0 -131
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.md +0 -14
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_labels.html.erb +0 -42
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_labels.jsx +0 -58
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_legend.html.erb +0 -24
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_legend.jsx +0 -38
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.html.erb +0 -22
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.jsx +0 -33
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_inner_sizes.html.erb +0 -118
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_inner_sizes.jsx +0 -144
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_live_data.jsx +0 -60
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_rounded.html.erb +0 -24
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_rounded.jsx +0 -42
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_with_title.html.erb +0 -38
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_with_title.jsx +0 -52
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/example.yml +0 -29
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/index.js +0 -11
- data/app/pb_kits/playbook/pb_pb_circle_chart/pbCircleChartTheme.ts +0 -88
- data/app/pb_kits/playbook/pb_pb_circle_chart/pb_circle_chart.html.erb +0 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/pb_circle_chart.rb +0 -28
- data/app/pb_kits/playbook/pb_pb_circle_chart/pb_circle_chart.test.jsx +0 -51
- data/app/pb_kits/playbook/pb_section_separator/section_separator.test.js +0 -165
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_autocomplete.html.erb +0 -41
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_autocomplete.jsx +0 -80
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_autocomplete.md +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align.md +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.md +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.md +0 -5
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_current_year.html.erb +0 -12
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_current_year.jsx +0 -25
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_current_year.md +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_date.html.erb +0 -4
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_date.jsx +0 -17
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_date.md +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_time.html.erb +0 -18
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_time.jsx +0 -44
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_time.md +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.md +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated.md +0 -5
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_current_year.html.erb +0 -16
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_current_year.jsx +0 -30
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_current_year.md +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_date.html.erb +0 -16
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_date.jsx +0 -30
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_date.md +0 -1
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_time.html.erb +0 -26
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_time.jsx +0 -41
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_time.md +0 -1
- data/dist/chunks/_typeahead-CCGp0OQe.js +0 -6
- data/dist/chunks/_weekday_stacked-Dy1jab6x.js +0 -37
- data/dist/chunks/componentRegistry-DzmmLR2x.js +0 -1
@@ -1,165 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import { render, screen } from '../utilities/test-utils'
|
3
|
-
|
4
|
-
import SectionSeparator from './_section_separator'
|
5
|
-
|
6
|
-
const testId = "section-separator-kit"
|
7
|
-
|
8
|
-
describe("Section Separator Kit", () => {
|
9
|
-
test("renders basic section separator with default props", () => {
|
10
|
-
render(
|
11
|
-
<SectionSeparator
|
12
|
-
data={{ testid: testId }}
|
13
|
-
/>
|
14
|
-
)
|
15
|
-
|
16
|
-
const kit = screen.getByTestId(testId)
|
17
|
-
expect(kit).toHaveClass("pb_section_separator_kit pb_section_separator_card pb_section_separator_horizontal pb_section_separator_solid pb_section_separator_color_default")
|
18
|
-
})
|
19
|
-
|
20
|
-
test("renders with text prop", () => {
|
21
|
-
const text = "Section Title"
|
22
|
-
render(
|
23
|
-
<SectionSeparator
|
24
|
-
data={{ testid: testId }}
|
25
|
-
text={text}
|
26
|
-
/>
|
27
|
-
)
|
28
|
-
|
29
|
-
const kit = screen.getByTestId(testId)
|
30
|
-
const textElement = screen.getByText(text)
|
31
|
-
|
32
|
-
expect(kit).toHaveClass("pb_section_separator_kit")
|
33
|
-
expect(textElement).toBeInTheDocument()
|
34
|
-
})
|
35
|
-
|
36
|
-
test("renders with children", () => {
|
37
|
-
const childText = "Custom Content"
|
38
|
-
render(
|
39
|
-
<SectionSeparator
|
40
|
-
data={{ testid: testId }}
|
41
|
-
>
|
42
|
-
<span>{childText}</span>
|
43
|
-
</SectionSeparator>
|
44
|
-
)
|
45
|
-
|
46
|
-
const kit = screen.getByTestId(testId)
|
47
|
-
const childElement = screen.getByText(childText)
|
48
|
-
|
49
|
-
expect(kit).toHaveClass("pb_section_separator_kit")
|
50
|
-
expect(childElement).toBeInTheDocument()
|
51
|
-
})
|
52
|
-
|
53
|
-
test("renders vertical orientation", () => {
|
54
|
-
render(
|
55
|
-
<SectionSeparator
|
56
|
-
data={{ testid: testId }}
|
57
|
-
orientation="vertical"
|
58
|
-
/>
|
59
|
-
)
|
60
|
-
|
61
|
-
const kit = screen.getByTestId(testId)
|
62
|
-
expect(kit).toHaveClass("pb_section_separator_kit pb_section_separator_card pb_section_separator_vertical pb_section_separator_solid pb_section_separator_color_default")
|
63
|
-
})
|
64
|
-
|
65
|
-
test("renders background variant", () => {
|
66
|
-
render(
|
67
|
-
<SectionSeparator
|
68
|
-
data={{ testid: testId }}
|
69
|
-
variant="background"
|
70
|
-
/>
|
71
|
-
)
|
72
|
-
|
73
|
-
const kit = screen.getByTestId(testId)
|
74
|
-
expect(kit).toHaveClass("pb_section_separator_kit pb_section_separator_background pb_section_separator_horizontal pb_section_separator_solid pb_section_separator_color_default")
|
75
|
-
})
|
76
|
-
|
77
|
-
test("renders dashed line style", () => {
|
78
|
-
render(
|
79
|
-
<SectionSeparator
|
80
|
-
data={{ testid: testId }}
|
81
|
-
lineStyle="dashed"
|
82
|
-
/>
|
83
|
-
)
|
84
|
-
|
85
|
-
const kit = screen.getByTestId(testId)
|
86
|
-
expect(kit).toHaveClass("pb_section_separator_kit pb_section_separator_card pb_section_separator_horizontal pb_section_separator_dashed pb_section_separator_color_default")
|
87
|
-
})
|
88
|
-
|
89
|
-
test("renders primary color", () => {
|
90
|
-
render(
|
91
|
-
<SectionSeparator
|
92
|
-
color="primary"
|
93
|
-
data={{ testid: testId }}
|
94
|
-
/>
|
95
|
-
)
|
96
|
-
|
97
|
-
const kit = screen.getByTestId(testId)
|
98
|
-
expect(kit).toHaveClass("pb_section_separator_kit pb_section_separator_card pb_section_separator_horizontal pb_section_separator_solid pb_section_separator_color_primary")
|
99
|
-
})
|
100
|
-
|
101
|
-
test("renders dark mode", () => {
|
102
|
-
render(
|
103
|
-
<SectionSeparator
|
104
|
-
dark
|
105
|
-
data={{ testid: testId }}
|
106
|
-
/>
|
107
|
-
)
|
108
|
-
|
109
|
-
const kit = screen.getByTestId(testId)
|
110
|
-
expect(kit).toHaveClass("pb_section_separator_kit pb_section_separator_card pb_section_separator_horizontal pb_section_separator_solid pb_section_separator_color_default")
|
111
|
-
})
|
112
|
-
|
113
|
-
test("renders with custom className", () => {
|
114
|
-
const customClass = "custom-class"
|
115
|
-
render(
|
116
|
-
<SectionSeparator
|
117
|
-
className={customClass}
|
118
|
-
data={{ testid: testId }}
|
119
|
-
/>
|
120
|
-
)
|
121
|
-
|
122
|
-
const kit = screen.getByTestId(testId)
|
123
|
-
expect(kit).toHaveClass("pb_section_separator_kit pb_section_separator_card pb_section_separator_horizontal pb_section_separator_solid pb_section_separator_color_default custom-class")
|
124
|
-
})
|
125
|
-
|
126
|
-
test("renders vertical with children", () => {
|
127
|
-
const childText = "Vertical Content"
|
128
|
-
render(
|
129
|
-
<SectionSeparator
|
130
|
-
data={{ testid: testId }}
|
131
|
-
orientation="vertical"
|
132
|
-
>
|
133
|
-
<span>{childText}</span>
|
134
|
-
</SectionSeparator>
|
135
|
-
)
|
136
|
-
|
137
|
-
const kit = screen.getByTestId(testId)
|
138
|
-
const childElement = screen.getByText(childText)
|
139
|
-
|
140
|
-
expect(kit).toHaveClass("pb_section_separator_kit pb_section_separator_card pb_section_separator_vertical pb_section_separator_solid pb_section_separator_color_default")
|
141
|
-
expect(childElement).toBeInTheDocument()
|
142
|
-
})
|
143
|
-
|
144
|
-
test("renders all props combined", () => {
|
145
|
-
const text = "Combined Props"
|
146
|
-
render(
|
147
|
-
<SectionSeparator
|
148
|
-
color="primary"
|
149
|
-
dark
|
150
|
-
data={{ testid: testId }}
|
151
|
-
lineStyle="dashed"
|
152
|
-
orientation="vertical"
|
153
|
-
variant="background"
|
154
|
-
>
|
155
|
-
<span>{text}</span>
|
156
|
-
</SectionSeparator>
|
157
|
-
)
|
158
|
-
|
159
|
-
const kit = screen.getByTestId(testId)
|
160
|
-
const childElement = screen.getByText(text)
|
161
|
-
|
162
|
-
expect(kit).toHaveClass("pb_section_separator_kit pb_section_separator_background pb_section_separator_vertical pb_section_separator_dashed pb_section_separator_color_primary")
|
163
|
-
expect(childElement).toBeInTheDocument()
|
164
|
-
})
|
165
|
-
})
|
@@ -1,41 +0,0 @@
|
|
1
|
-
<%= pb_rails("text_input", props: {
|
2
|
-
autocomplete: false,
|
3
|
-
label: "autocomplete='off'",
|
4
|
-
name: "firstName",
|
5
|
-
placeholder: "Enter first name",
|
6
|
-
}) %>
|
7
|
-
|
8
|
-
<%= pb_rails("text_input", props: {
|
9
|
-
label: "no autocomplete attribute (let browser decide- basically 'on')",
|
10
|
-
name: "lastName",
|
11
|
-
placeholder: "Enter last name"
|
12
|
-
}) %>
|
13
|
-
|
14
|
-
<%= pb_rails("text_input", props: {
|
15
|
-
autocomplete: true,
|
16
|
-
label: "autocomplete='on'",
|
17
|
-
name: "phone",
|
18
|
-
type: "phone",
|
19
|
-
placeholder: "Enter phone number"
|
20
|
-
}) %>
|
21
|
-
|
22
|
-
<%= pb_rails("body", props: { margin_bottom: "sm" }) do %>
|
23
|
-
The following have the same autocomplete attributes (email), but have
|
24
|
-
different name attributes (email and emailAlt). Many browsers will
|
25
|
-
open autocomplete based on name attributes instead of autocomplete:
|
26
|
-
<% end %>
|
27
|
-
|
28
|
-
<%= pb_rails("text_input", props: {
|
29
|
-
autocomplete: "email",
|
30
|
-
label: "autocomplete='email' name='email'",
|
31
|
-
name: "email",
|
32
|
-
placeholder: "Enter email address"
|
33
|
-
}) %>
|
34
|
-
|
35
|
-
<%= pb_rails("text_input", props: {
|
36
|
-
autocomplete: "email",
|
37
|
-
label: "autocomplete='email' name='emailAlt'",
|
38
|
-
name: "emailAlt",
|
39
|
-
type: "email",
|
40
|
-
placeholder: "Enter email address"
|
41
|
-
}) %>
|
@@ -1,80 +0,0 @@
|
|
1
|
-
import React, { useState } from 'react'
|
2
|
-
|
3
|
-
import TextInput from '../../pb_text_input/_text_input'
|
4
|
-
import Body from '../../pb_body/_body'
|
5
|
-
|
6
|
-
|
7
|
-
const TextInputAutocomplete = (props) => {
|
8
|
-
const [formFields, setFormFields] = useState({
|
9
|
-
firstName: "",
|
10
|
-
lastName: "",
|
11
|
-
phone: "",
|
12
|
-
emailTest: "",
|
13
|
-
email: "",
|
14
|
-
});
|
15
|
-
|
16
|
-
const handleOnChangeFormField = ({ target }) => {
|
17
|
-
const { name, value } = target;
|
18
|
-
setFormFields({ ...formFields, [name]: value });
|
19
|
-
};
|
20
|
-
|
21
|
-
return (
|
22
|
-
<div>
|
23
|
-
<TextInput
|
24
|
-
autoComplete={false}
|
25
|
-
label="autocomplete='off'"
|
26
|
-
name="firstName"
|
27
|
-
onChange={handleOnChangeFormField}
|
28
|
-
placeholder="Enter first name"
|
29
|
-
value={formFields.firstName}
|
30
|
-
{...props}
|
31
|
-
/>
|
32
|
-
<TextInput
|
33
|
-
label="no autocomplete attribute (let browser decide- basically 'on')"
|
34
|
-
name="lastName"
|
35
|
-
onChange={handleOnChangeFormField}
|
36
|
-
placeholder="Enter last name"
|
37
|
-
value={formFields.lastName}
|
38
|
-
{...props}
|
39
|
-
/>
|
40
|
-
<TextInput
|
41
|
-
autoComplete
|
42
|
-
label="autocomplete='on'"
|
43
|
-
name="phone"
|
44
|
-
onChange={handleOnChangeFormField}
|
45
|
-
placeholder="Enter phone number"
|
46
|
-
type="phone"
|
47
|
-
value={formFields.phone}
|
48
|
-
{...props}
|
49
|
-
/>
|
50
|
-
<Body marginBottom="sm">
|
51
|
-
The following have the same autocomplete attributes (email), but have
|
52
|
-
different name attributes (email and emailAlt). Many browsers will
|
53
|
-
open autocomplete based on name attributes instead of autocomplete:
|
54
|
-
</Body>
|
55
|
-
<TextInput
|
56
|
-
autoComplete="email"
|
57
|
-
label="autocomplete='email' name='email'"
|
58
|
-
name="email"
|
59
|
-
onChange={handleOnChangeFormField}
|
60
|
-
placeholder="Enter email address"
|
61
|
-
type="email"
|
62
|
-
value={formFields.email}
|
63
|
-
{...props}
|
64
|
-
/>
|
65
|
-
<TextInput
|
66
|
-
autoComplete="email"
|
67
|
-
label="autocomplete='email' name='emailAlt'"
|
68
|
-
marginTop="sm"
|
69
|
-
name="emailTest"
|
70
|
-
onChange={handleOnChangeFormField}
|
71
|
-
placeholder="Enter email address"
|
72
|
-
type="email"
|
73
|
-
value={formFields.emailTest}
|
74
|
-
{...props}
|
75
|
-
/>
|
76
|
-
</div>
|
77
|
-
);
|
78
|
-
};
|
79
|
-
|
80
|
-
export default TextInputAutocomplete;
|
@@ -1 +0,0 @@
|
|
1
|
-
Set this prop to `false` or `"off"` to remove autocomplete from text inputs. You can also set it to a string, but browsers will often defer to other attributes like `name`.
|
@@ -1 +0,0 @@
|
|
1
|
-
The `align` prop can be used to set alignment. This prop is set to 'left' by default.
|
@@ -1 +0,0 @@
|
|
1
|
-
By default, the timestamp kit will display the date and time as shown here. If the date is NOT within the current year, the year will also be shown while dates in the current year will not show the year.
|
@@ -1,5 +0,0 @@
|
|
1
|
-
Use variant `elapsed` to show time ago. This variant can be customized in several ways:
|
2
|
-
|
3
|
-
Use the optional `showUser`/`show_user` prop to show user as part of the text. When showing the user, pass in the user name using the `text` prop as shown. `showUser`/`show_user` is set to false by default.
|
4
|
-
|
5
|
-
Use the optional `hideUpdated`/`hide_updated` prop to hide the 'Last updated' text if needed.
|
@@ -1,25 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import Timestamp from '../_timestamp'
|
3
|
-
|
4
|
-
|
5
|
-
const TimestampShowCurrentYear = (props) => {
|
6
|
-
return (
|
7
|
-
<div>
|
8
|
-
<Timestamp
|
9
|
-
showCurrentYear
|
10
|
-
timestamp={new Date()}
|
11
|
-
{...props}
|
12
|
-
/>
|
13
|
-
<br />
|
14
|
-
<Timestamp
|
15
|
-
showCurrentYear
|
16
|
-
showTime={false}
|
17
|
-
timestamp={new Date()}
|
18
|
-
{...props}
|
19
|
-
/>
|
20
|
-
|
21
|
-
</div>
|
22
|
-
)
|
23
|
-
}
|
24
|
-
|
25
|
-
export default TimestampShowCurrentYear
|
@@ -1 +0,0 @@
|
|
1
|
-
Use the `showCurrentYear`/`show_current_year` prop to show the year even if it is the current year. This is set to false by default.
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import Timestamp from '../_timestamp'
|
3
|
-
|
4
|
-
const TimestampShowDate = (props) => {
|
5
|
-
return (
|
6
|
-
<div>
|
7
|
-
<Timestamp
|
8
|
-
align="left"
|
9
|
-
showDate={false}
|
10
|
-
timestamp={new Date()}
|
11
|
-
{...props}
|
12
|
-
/>
|
13
|
-
</div>
|
14
|
-
)
|
15
|
-
}
|
16
|
-
|
17
|
-
export default TimestampShowDate
|
@@ -1 +0,0 @@
|
|
1
|
-
The `showDate`/`show_date` prop is set to true by default but can be set to false to hide the date.
|
@@ -1,18 +0,0 @@
|
|
1
|
-
<%= pb_rails("timestamp", props: {
|
2
|
-
timestamp: DateTime.now,
|
3
|
-
show_time: false,
|
4
|
-
}) %>
|
5
|
-
|
6
|
-
<br>
|
7
|
-
|
8
|
-
<%= pb_rails("timestamp", props: {
|
9
|
-
timestamp: DateTime.now + 4.years,
|
10
|
-
show_time: false,
|
11
|
-
}) %>
|
12
|
-
|
13
|
-
<br>
|
14
|
-
|
15
|
-
<%= pb_rails("timestamp", props: {
|
16
|
-
timestamp: DateTime.now - 1.year,
|
17
|
-
show_time: false
|
18
|
-
}) %>
|
@@ -1,44 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import Timestamp from '../_timestamp'
|
3
|
-
|
4
|
-
const todaysDate = new Date()
|
5
|
-
const futureYear = new Date().getFullYear() + 4
|
6
|
-
const pastYear = new Date().getFullYear() - 1
|
7
|
-
const month = new Date().getMonth()
|
8
|
-
const date = new Date().getDate()
|
9
|
-
const hours = new Date().getHours()
|
10
|
-
const minutes = new Date().getMinutes()
|
11
|
-
const futureDate = new Date(futureYear, month, date, hours, minutes)
|
12
|
-
const pastDate = new Date(pastYear, month, date, hours, minutes)
|
13
|
-
|
14
|
-
const TimestampShowTime = (props) => {
|
15
|
-
return (
|
16
|
-
<div>
|
17
|
-
<Timestamp
|
18
|
-
align="left"
|
19
|
-
showTime={false}
|
20
|
-
timestamp={todaysDate}
|
21
|
-
{...props}
|
22
|
-
/>
|
23
|
-
<br />
|
24
|
-
|
25
|
-
<Timestamp
|
26
|
-
align="left"
|
27
|
-
showTime={false}
|
28
|
-
timestamp={futureDate}
|
29
|
-
{...props}
|
30
|
-
/>
|
31
|
-
|
32
|
-
<br />
|
33
|
-
|
34
|
-
<Timestamp
|
35
|
-
align="left"
|
36
|
-
showTime={false}
|
37
|
-
timestamp={pastDate}
|
38
|
-
{...props}
|
39
|
-
/>
|
40
|
-
</div>
|
41
|
-
)
|
42
|
-
}
|
43
|
-
|
44
|
-
export default TimestampShowTime
|
@@ -1 +0,0 @@
|
|
1
|
-
The `showTime`/`show_time` prop is set to true by default but can be set to false to hide the time.
|
@@ -1 +0,0 @@
|
|
1
|
-
The `showTimezone`/`show_timezone` prop can be used to show the timezone as well. This is set to false by default. **NOTE**: This prop must be used in conjunction with the `timezone` prop to specify which timezone to display.
|
@@ -1,5 +0,0 @@
|
|
1
|
-
Use variant `updated` to show last updated at timestamp.
|
2
|
-
|
3
|
-
This variant can be customized using the optional `showUser`/`show_user` prop to show user as part of the text. When showing the user, pass in the user name using the `text` prop as shown.
|
4
|
-
|
5
|
-
`showUser`/`show_user` is set to false by default.
|
@@ -1,16 +0,0 @@
|
|
1
|
-
<%= pb_rails("timestamp", props: {
|
2
|
-
timestamp: DateTime.now,
|
3
|
-
variant: "updated",
|
4
|
-
show_user: true,
|
5
|
-
show_current_year: true,
|
6
|
-
text: "Maricris Nonato"
|
7
|
-
}) %>
|
8
|
-
|
9
|
-
<br>
|
10
|
-
|
11
|
-
<%= pb_rails("timestamp", props: {
|
12
|
-
timestamp: DateTime.now,
|
13
|
-
variant: "updated",
|
14
|
-
show_user: false,
|
15
|
-
show_current_year: true
|
16
|
-
}) %>
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import Timestamp from '../_timestamp'
|
3
|
-
|
4
|
-
const todaysDate = new Date()
|
5
|
-
|
6
|
-
const TimestampUpdatedShowCurrentYear = (props) => {
|
7
|
-
return (
|
8
|
-
<div>
|
9
|
-
<Timestamp
|
10
|
-
showCurrentYear
|
11
|
-
showUser
|
12
|
-
text="Maricris Nonato"
|
13
|
-
timestamp={todaysDate}
|
14
|
-
variant="updated"
|
15
|
-
{...props}
|
16
|
-
/>
|
17
|
-
|
18
|
-
<br />
|
19
|
-
|
20
|
-
<Timestamp
|
21
|
-
showCurrentYear
|
22
|
-
timestamp={todaysDate}
|
23
|
-
variant="updated"
|
24
|
-
{...props}
|
25
|
-
/>
|
26
|
-
</div>
|
27
|
-
)
|
28
|
-
}
|
29
|
-
|
30
|
-
export default TimestampUpdatedShowCurrentYear
|
@@ -1 +0,0 @@
|
|
1
|
-
The `updated` variant can also be used in conjunction with the `showCurrentYear`/`show_current_year` prop to show the year even if it is the current year.
|
@@ -1,16 +0,0 @@
|
|
1
|
-
<%= pb_rails("timestamp", props: {
|
2
|
-
timestamp: DateTime.now,
|
3
|
-
variant: "updated",
|
4
|
-
show_user: true,
|
5
|
-
show_date: false,
|
6
|
-
text: "Maricris Nonato"
|
7
|
-
}) %>
|
8
|
-
|
9
|
-
<br>
|
10
|
-
|
11
|
-
<%= pb_rails("timestamp", props: {
|
12
|
-
timestamp: DateTime.now,
|
13
|
-
variant: "updated",
|
14
|
-
show_user: false,
|
15
|
-
show_date: false
|
16
|
-
}) %>
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import Timestamp from '../_timestamp'
|
3
|
-
|
4
|
-
const todaysDate = new Date()
|
5
|
-
|
6
|
-
const TimestampUpdatedShowDate = (props) => {
|
7
|
-
return (
|
8
|
-
<div>
|
9
|
-
<Timestamp
|
10
|
-
showDate={false}
|
11
|
-
showUser
|
12
|
-
text="Maricris Nonato"
|
13
|
-
timestamp={todaysDate}
|
14
|
-
variant="updated"
|
15
|
-
{...props}
|
16
|
-
/>
|
17
|
-
|
18
|
-
<br />
|
19
|
-
|
20
|
-
<Timestamp
|
21
|
-
showDate={false}
|
22
|
-
timestamp={todaysDate}
|
23
|
-
variant="updated"
|
24
|
-
{...props}
|
25
|
-
/>
|
26
|
-
</div>
|
27
|
-
)
|
28
|
-
}
|
29
|
-
|
30
|
-
export default TimestampUpdatedShowDate
|
@@ -1 +0,0 @@
|
|
1
|
-
The `updated` variant can also be used in conjunction with the `showDate`/`show_date` prop. This prop is set to true by default but can be set to false to hide the date.
|
@@ -1,26 +0,0 @@
|
|
1
|
-
<%= pb_rails("timestamp", props: {
|
2
|
-
timestamp: DateTime.now,
|
3
|
-
variant: "updated",
|
4
|
-
show_user: true,
|
5
|
-
show_time: false,
|
6
|
-
text: "Maricris Nonato"
|
7
|
-
}) %>
|
8
|
-
|
9
|
-
<br>
|
10
|
-
|
11
|
-
<%= pb_rails("timestamp", props: {
|
12
|
-
timestamp: DateTime.now,
|
13
|
-
variant: "updated",
|
14
|
-
show_user: false,
|
15
|
-
show_time: false
|
16
|
-
}) %>
|
17
|
-
|
18
|
-
<br>
|
19
|
-
|
20
|
-
<%= pb_rails("timestamp", props: {
|
21
|
-
timestamp: DateTime.now,
|
22
|
-
variant: "updated",
|
23
|
-
show_current_year: true,
|
24
|
-
show_user: false,
|
25
|
-
show_time: false
|
26
|
-
}) %>
|
@@ -1,41 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import Timestamp from '../_timestamp'
|
3
|
-
|
4
|
-
const todaysDate = new Date()
|
5
|
-
|
6
|
-
const TimestampUpdatedShowTime = (props) => {
|
7
|
-
return (
|
8
|
-
<div>
|
9
|
-
<Timestamp
|
10
|
-
showTime={false}
|
11
|
-
showUser
|
12
|
-
text="Maricris Nonato"
|
13
|
-
timestamp={todaysDate}
|
14
|
-
variant="updated"
|
15
|
-
{...props}
|
16
|
-
/>
|
17
|
-
|
18
|
-
<br />
|
19
|
-
|
20
|
-
<Timestamp
|
21
|
-
showTime={false}
|
22
|
-
timestamp={todaysDate}
|
23
|
-
variant="updated"
|
24
|
-
{...props}
|
25
|
-
/>
|
26
|
-
|
27
|
-
<br />
|
28
|
-
|
29
|
-
<Timestamp
|
30
|
-
showCurrentYear
|
31
|
-
showTime={false}
|
32
|
-
timestamp={todaysDate}
|
33
|
-
variant="updated"
|
34
|
-
{...props}
|
35
|
-
/>
|
36
|
-
|
37
|
-
</div>
|
38
|
-
)
|
39
|
-
}
|
40
|
-
|
41
|
-
export default TimestampUpdatedShowTime
|
@@ -1 +0,0 @@
|
|
1
|
-
The `updated` variant can also be used in conjunction with the `showTime`/`show_time` prop. This prop is set to true by default but can be set to false to hide the time. This can also be used in conjunction with `showCurrentYear`/`show_current_year` to show the year even if it is the current year.
|