playbook_ui 14.18.0.pre.alpha.revert4567revert4553PLAY2056ATcolbordercolors7469 → 14.18.0.pre.rc.0
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/Components/RegularTableView.tsx +3 -23
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +3 -67
- data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableActions.ts +2 -1
- data/app/pb_kits/playbook/pb_advanced_table/Utilities/ExpansionControlHelpers.tsx +19 -29
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +143 -365
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +1 -14
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +1 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.jsx +2 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_rails.md +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_react.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_rails.md +2 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_react.md +2 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +3 -10
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -6
- data/app/pb_kits/playbook/pb_advanced_table/index.js +0 -7
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/circleChart.test.js +2 -2
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.html.erb +2 -2
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.jsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.jsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.jsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_live_data.jsx +2 -2
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.jsx +1 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +3 -2
- data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.scss +1 -39
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +0 -4
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb +1 -9
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.test.js +0 -14
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_copy_button/_copy_button.tsx +45 -19
- data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_copy_button/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_copy_button/index.js +20 -46
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +0 -12
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +0 -12
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +1 -50
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_error.jsx +1 -4
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_rails.md +0 -4
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_range_limit.md +1 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_react.md +1 -5
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_date_picker/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_date_picker/plugins/quickPick.tsx +0 -10
- data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +1 -10
- data/app/pb_kits/playbook/pb_dialog/dialog.rb +0 -2
- data/app/pb_kits/playbook/pb_dialog/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_dialog/index.js +14 -106
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +1 -3
- data/app/pb_kits/playbook/pb_draggable/draggable.rb +1 -9
- data/app/pb_kits/playbook/pb_draggable/index.js +142 -139
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +1 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_error.jsx +1 -4
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +1 -1
- data/app/pb_kits/playbook/pb_filter/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_form_group/_form_group.scss +3 -23
- data/app/pb_kits/playbook/pb_form_group/docs/_form_group_select.html.erb +5 -15
- data/app/pb_kits/playbook/pb_form_group/docs/_form_group_select.jsx +6 -39
- data/app/pb_kits/playbook/pb_gauge/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_gauge/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_layout/_layout.scss +1 -70
- data/app/pb_kits/playbook/pb_layout/_layout.tsx +2 -29
- data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.jsx +118 -322
- data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.md +1 -1
- data/app/pb_kits/playbook/pb_layout/subcomponents/_game.tsx +43 -74
- data/app/pb_kits/playbook/pb_layout/subcomponents/_round.tsx +4 -21
- data/app/pb_kits/playbook/pb_line_graph/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_line_graph/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_overlay/_overlay.scss +22 -83
- data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +7 -39
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.md +7 -1
- data/app/pb_kits/playbook/pb_overlay/docs/example.yml +0 -5
- data/app/pb_kits/playbook/pb_overlay/docs/index.js +0 -5
- data/app/pb_kits/playbook/pb_overlay/overlay.test.jsx +1 -39
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +0 -13
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +1 -3
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.jsx +1 -8
- data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.rb +0 -3
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.test.js +0 -19
- data/app/pb_kits/playbook/pb_popover/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_popover/index.ts +1 -13
- data/app/pb_kits/playbook/pb_popover/popover.rb +0 -2
- data/app/pb_kits/playbook/pb_select/docs/_select_error.jsx +2 -7
- data/app/pb_kits/playbook/pb_table/_table.tsx +2 -2
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.md +1 -3
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows_rails.md +1 -3
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.md +1 -3
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table_rails.md +1 -3
- data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +1 -1
- data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +5 -13
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error.jsx +1 -9
- data/app/pb_kits/playbook/pb_text_input/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_text_input/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_text_input/inputMask.ts +1 -8
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_error.jsx +1 -7
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_error_state.jsx +2 -6
- data/dist/chunks/_typeahead-C2GOKWtm.js +22 -0
- data/dist/chunks/_weekday_stacked-CFGTPT0O.js +45 -0
- data/dist/chunks/lib-BGzBzFZX.js +29 -0
- data/dist/chunks/{pb_form_validation-BWjy4bFn.js → pb_form_validation-BvNy9Bd6.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +2 -2
- data/dist/playbook-doc.js +1 -19
- 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 +8 -71
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color.jsx +0 -80
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color_rails.html.erb +0 -58
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_border_color_rails.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expand_by_depth.jsx +0 -66
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_expand_by_depth.md +0 -10
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns.jsx +0 -58
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns.md +0 -6
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns_and_header.jsx +0 -64
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_columns_and_header.md +0 -8
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header.jsx +0 -55
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header_rails.html.erb +0 -33
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sticky_header_rails.md +0 -3
- data/app/pb_kits/playbook/pb_advanced_table/scss_partials/advanced_table_sticky_mixin.scss +0 -97
- data/app/pb_kits/playbook/pb_circle_chart/circleChartTheme.ts +0 -53
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.jsx +0 -38
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_pb_styles.md +0 -1
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_size.html.erb +0 -28
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_size.jsx +0 -42
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_size.md +0 -1
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook.jsx +0 -54
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook.md +0 -3
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook_rails.html.erb +0 -14
- data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook_rails.md +0 -3
- data/app/pb_kits/playbook/pb_copy_button/usePBCopy.ts +0 -45
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern.jsx +0 -34
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern.md +0 -14
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.html.erb +0 -20
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.md +0 -14
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_turbo_frames.html.erb +0 -117
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_turbo_frames_rails.md +0 -9
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.html.erb +0 -43
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.html.erb +0 -55
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors_rails.md +0 -1
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners.html.erb +0 -42
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_event_listeners.md +0 -1
- data/app/pb_kits/playbook/pb_filter/docs/_filter_within_turbo_frames.html.erb +0 -41
- data/app/pb_kits/playbook/pb_filter/docs/_filter_within_turbo_frames.md +0 -1
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.jsx +0 -30
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_pb_styles.md +0 -1
- data/app/pb_kits/playbook/pb_gauge/gaugeTheme.ts +0 -85
- data/app/pb_kits/playbook/pb_layout/subcomponents/_participant.tsx +0 -79
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.jsx +0 -52
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_pb_styles.md +0 -1
- data/app/pb_kits/playbook/pb_line_graph/lineGraphTheme.ts +0 -110
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_color.jsx +0 -63
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_color.md +0 -3
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_background.jsx +0 -49
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_background.md +0 -1
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_opacity.jsx +0 -81
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_fullscreen_opacity.md +0 -1
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_gradient_opacity.jsx +0 -39
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_gradient_opacity.md +0 -1
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_layout.jsx +0 -40
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_layout.md +0 -5
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.html.erb +0 -10
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.jsx +0 -20
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_country_search.md +0 -1
- data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.html.erb +0 -46
- data/app/pb_kits/playbook/pb_popover/docs/_popover_append_to.md +0 -1
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_sanitize.jsx +0 -94
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_sanitize.md +0 -1
- data/dist/chunks/_typeahead-D8CsVBZO.js +0 -22
- data/dist/chunks/_weekday_stacked-D3oLTSkH.js +0 -45
- data/dist/chunks/lib-BmTAc7Nc.js +0 -29
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_drop_zones_react.md → _draggable_drop_zones.md} +0 -0
- /data/app/pb_kits/playbook/pb_draggable/docs/{_draggable_drop_zones_colors_react.md → _draggable_drop_zones_colors.md} +0 -0
@@ -139,22 +139,3 @@ test("should format phone number as '555-555-5555' with formatAsYouType and 'us'
|
|
139
139
|
|
140
140
|
expect(input.value).toBe("555-555-5555");
|
141
141
|
});
|
142
|
-
|
143
|
-
test("should pass countrySearch prop to component", () => {
|
144
|
-
window.intlTelInput = jest.fn(() => ({
|
145
|
-
getSelectedCountryData: jest.fn(() => ({})),
|
146
|
-
isValidNumber: jest.fn(() => true),
|
147
|
-
getValidationError: jest.fn(() => 0),
|
148
|
-
}));
|
149
|
-
|
150
|
-
const props = {
|
151
|
-
id: testId,
|
152
|
-
countrySearch: true,
|
153
|
-
data: { testid: 'phone-input-with-search' }
|
154
|
-
};
|
155
|
-
|
156
|
-
render(<PhoneNumberInput {...props} />);
|
157
|
-
|
158
|
-
const wrapper = screen.getByTestId('phone-input-with-search');
|
159
|
-
expect(wrapper).toBeInTheDocument();
|
160
|
-
});
|
@@ -13,15 +13,7 @@ export default class PbPopover extends PbEnhancedElement {
|
|
13
13
|
}
|
14
14
|
|
15
15
|
moveTooltip() {
|
16
|
-
|
17
|
-
|
18
|
-
if (this.appendTo === "parent") {
|
19
|
-
container = this.element.parentElement;
|
20
|
-
} else if (this.appendTo) {
|
21
|
-
container = document.querySelector(this.appendTo);
|
22
|
-
}
|
23
|
-
|
24
|
-
(container || document.body).appendChild(this.tooltip);
|
16
|
+
document.querySelector('body').appendChild(this.tooltip)
|
25
17
|
}
|
26
18
|
|
27
19
|
connect() {
|
@@ -116,8 +108,4 @@ export default class PbPopover extends PbEnhancedElement {
|
|
116
108
|
get closeOnClick() {
|
117
109
|
return this.element.dataset.pbPopoverCloseOnClick
|
118
110
|
}
|
119
|
-
|
120
|
-
get appendTo() {
|
121
|
-
return this.element.dataset.pbPopoverAppendTo;
|
122
|
-
}
|
123
111
|
}
|
@@ -3,7 +3,6 @@
|
|
3
3
|
module Playbook
|
4
4
|
module PbPopover
|
5
5
|
class Popover < Playbook::KitBase
|
6
|
-
prop :append_to, type: Playbook::Props::String, default: "body"
|
7
6
|
prop :position, type: Playbook::Props::Enum,
|
8
7
|
values: %w[top bottom left right top-start top-end bottom-start bottom-end right-start right-end left-start left-end],
|
9
8
|
default: "left"
|
@@ -48,7 +47,6 @@ module Playbook
|
|
48
47
|
|
49
48
|
def data
|
50
49
|
Hash(values[:data]).merge(
|
51
|
-
pb_popover_append_to: append_to,
|
52
50
|
pb_popover_kit: true,
|
53
51
|
pb_popover_position: position,
|
54
52
|
pb_popover_trigger_element_id: trigger_element_id,
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import Body from '../../pb_body/_body'
|
3
3
|
import Select from '../../pb_select/_select'
|
4
|
-
import Icon from '../../pb_icon/_icon'
|
5
4
|
|
6
5
|
const SelectError = (props) => {
|
7
6
|
const options = [
|
@@ -19,14 +18,10 @@ const SelectError = (props) => {
|
|
19
18
|
},
|
20
19
|
]
|
21
20
|
|
22
|
-
const error = (<>
|
23
|
-
<Icon icon="warning" /> Please make a valid selection
|
24
|
-
</>)
|
25
|
-
|
26
21
|
return (
|
27
22
|
<div>
|
28
23
|
<Select
|
29
|
-
error=
|
24
|
+
error="Please make a valid selection"
|
30
25
|
label="Favorite Food"
|
31
26
|
name="food"
|
32
27
|
options={options}
|
@@ -34,7 +29,7 @@ const SelectError = (props) => {
|
|
34
29
|
{...props}
|
35
30
|
/>
|
36
31
|
<Body
|
37
|
-
error=
|
32
|
+
error="Please make a valid selection"
|
38
33
|
status="negative"
|
39
34
|
{...props}
|
40
35
|
/>
|
@@ -84,8 +84,8 @@ const Table = (props: TableProps): React.ReactElement => {
|
|
84
84
|
'single-line': singleLine,
|
85
85
|
'no-hover': disableHover,
|
86
86
|
'sticky-header': sticky,
|
87
|
-
'sticky-left-column': stickyLeftColumn
|
88
|
-
'sticky-right-column': stickyRightColumn
|
87
|
+
'sticky-left-column': stickyLeftColumn,
|
88
|
+
'sticky-right-column': stickyRightColumn,
|
89
89
|
'striped': striped,
|
90
90
|
'header-borderless': headerStyle === 'borderless',
|
91
91
|
'header-floating': headerStyle === 'floating',
|
@@ -1,5 +1,3 @@
|
|
1
1
|
The `collapsibleContent` can display any content, including nested Table Rows.
|
2
2
|
|
3
|
-
Additionally, the `collapsibleSideHighlight` can also be removed by setting it to false if needed. This prop is set to true by default.
|
4
|
-
|
5
|
-
**NOTE**: We advise against using the `disableHover` Table prop when nesting Table Rows within a Table.
|
3
|
+
Additionally, the `collapsibleSideHighlight` can also be removed by setting it to false if needed. This prop is set to true by default.
|
@@ -1,5 +1,3 @@
|
|
1
1
|
The `collapsible_content` can display any content, including nested Table Rows.
|
2
2
|
|
3
|
-
Additionally, the `collapsible_side_highlight` can also be removed by setting it to false if needed. This prop is set to true by default.
|
4
|
-
|
5
|
-
**NOTE**: We advise against using the `disable_hover` Table prop when nesting Table Rows within a Table.
|
3
|
+
Additionally, the `collapsible_side_highlight` can also be removed by setting it to false if needed. This prop is set to true by default.
|
@@ -1,3 +1 @@
|
|
1
|
-
The `collapsible_content` can also be used to display nested Tables within each Row.
|
2
|
-
|
3
|
-
**NOTE**: We advise against using the `disable_hover` Table prop when nesting Tables within a Table.
|
1
|
+
The `collapsible_content` can also be used to display nested Tables within each Row.
|
@@ -25,7 +25,7 @@ type TextInputProps = {
|
|
25
25
|
name: string,
|
26
26
|
label: string,
|
27
27
|
mask?: 'currency' | 'zipCode' | 'postalCode' | 'ssn',
|
28
|
-
onChange: (e: React.FormEvent<HTMLInputElement
|
28
|
+
onChange: (e: React.FormEvent<HTMLInputElement>) => void,
|
29
29
|
placeholder: string,
|
30
30
|
required?: boolean,
|
31
31
|
type: string,
|
@@ -102,16 +102,10 @@ const TextInput = (props: TextInputProps, ref: React.LegacyRef<HTMLInputElement>
|
|
102
102
|
|
103
103
|
let cursorPosition = e.target.selectionStart;
|
104
104
|
const isAtEnd = cursorPosition === inputValue.length;
|
105
|
-
|
105
|
+
|
106
106
|
const formattedValue = INPUTMASKS[mask].format(inputValue)
|
107
|
-
|
108
|
-
let sanitizedValue = formattedValue;
|
109
|
-
if (INPUTMASKS[mask].sanitize) {
|
110
|
-
sanitizedValue = INPUTMASKS[mask].sanitize(formattedValue)
|
111
|
-
}
|
112
|
-
|
113
107
|
e.target.value = formattedValue
|
114
|
-
|
108
|
+
|
115
109
|
// Keep cursor position
|
116
110
|
if (!isAtEnd) {
|
117
111
|
// Account for extra characters (e.g., commas added/removed in currency)
|
@@ -122,11 +116,9 @@ const TextInput = (props: TextInputProps, ref: React.LegacyRef<HTMLInputElement>
|
|
122
116
|
}
|
123
117
|
e.target.selectionStart = e.target.selectionEnd = cursorPosition
|
124
118
|
}
|
125
|
-
|
126
|
-
onChange(e, sanitizedValue);
|
127
|
-
} else {
|
128
|
-
onChange(e)
|
129
119
|
}
|
120
|
+
|
121
|
+
onChange(e)
|
130
122
|
}
|
131
123
|
|
132
124
|
const childInput = children ? children.type === "input" : undefined
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import React, { useState } from 'react'
|
2
2
|
|
3
3
|
import TextInput from '../_text_input'
|
4
|
-
import Icon from '../../pb_icon/_icon'
|
5
4
|
|
6
5
|
const TextInputError = (props) => {
|
7
6
|
const [email, setEmail] = useState('')
|
@@ -9,18 +8,11 @@ const TextInputError = (props) => {
|
|
9
8
|
const handleUpdateEmail = ({ target }) => {
|
10
9
|
setEmail(target.value)
|
11
10
|
}
|
12
|
-
|
13
|
-
const error = (
|
14
|
-
<>
|
15
|
-
<Icon icon="warning" /> Please enter a valid email address
|
16
|
-
</>
|
17
|
-
)
|
18
|
-
|
19
11
|
return (
|
20
12
|
<div>
|
21
13
|
<TextInput
|
22
14
|
addOn={{ icon: 'user', alignment: 'left', border: true }}
|
23
|
-
error=
|
15
|
+
error="Please enter a valid email address"
|
24
16
|
label="Email Address"
|
25
17
|
onChange={handleUpdateEmail}
|
26
18
|
placeholder="Enter email address"
|
@@ -6,4 +6,3 @@ export { default as TextInputAddOn } from './_text_input_add_on.jsx'
|
|
6
6
|
export { default as TextInputInline } from './_text_input_inline.jsx'
|
7
7
|
export { default as TextInputNoLabel } from './_text_input_no_label.jsx'
|
8
8
|
export { default as TextInputMask } from './_text_input_mask.jsx'
|
9
|
-
export { default as TextInputSanitize } from './_text_input_sanitize.jsx'
|
@@ -3,7 +3,6 @@ type InputMask = {
|
|
3
3
|
formatDefaultValue: (value: string) => string
|
4
4
|
pattern: string
|
5
5
|
placeholder: string
|
6
|
-
sanitize?: (value: string) => string;
|
7
6
|
}
|
8
7
|
|
9
8
|
type InputMaskDictionary = {
|
@@ -74,41 +73,35 @@ export const INPUTMASKS: InputMaskDictionary = {
|
|
74
73
|
// eslint-disable-next-line no-useless-escape
|
75
74
|
pattern: '^\\$\\d{1,3}(?:,\\d{3})*(?:\\.\\d{2})?$',
|
76
75
|
placeholder: '$0.00',
|
77
|
-
sanitize: (value: string) => value.replace(/[$,]/g, ''),
|
78
76
|
},
|
79
77
|
zipCode: {
|
80
78
|
format: formatBasicPostal,
|
81
79
|
formatDefaultValue: formatBasicPostal,
|
82
80
|
pattern: '\\d{5}',
|
83
81
|
placeholder: '12345',
|
84
|
-
sanitize: (value: string) => value,
|
85
82
|
},
|
86
83
|
postalCode: {
|
87
84
|
format: formatExtendedPostal,
|
88
85
|
formatDefaultValue: formatExtendedPostal,
|
89
86
|
pattern: '\\d{5}-\\d{4}',
|
90
87
|
placeholder: '12345-6789',
|
91
|
-
sanitize: (value: string) => value.replace(/-/g, ''),
|
92
88
|
},
|
93
89
|
ssn: {
|
94
90
|
format: formatSSN,
|
95
91
|
formatDefaultValue: formatSSN,
|
96
92
|
pattern: '\\d{3}-\\d{2}-\\d{4}',
|
97
93
|
placeholder: '123-45-6789',
|
98
|
-
sanitize: (value: string) => value.replace(/-/g, ''),
|
99
94
|
},
|
100
95
|
creditCard: {
|
101
96
|
format: formatCreditCard,
|
102
97
|
formatDefaultValue: formatCreditCard,
|
103
98
|
pattern: '\\d{4} \\d{4} \\d{4} \\d{4}',
|
104
99
|
placeholder: '1234 5678 9012 3456',
|
105
|
-
sanitize: (value: string) => value.replace(/\s/g, ''),
|
106
100
|
},
|
107
101
|
cvv: {
|
108
102
|
format: formatCVV,
|
109
103
|
formatDefaultValue: formatCVV,
|
110
104
|
pattern: '\\d{3,4}',
|
111
105
|
placeholder: '123',
|
112
|
-
sanitize: (value: string) => value,
|
113
106
|
},
|
114
|
-
}
|
107
|
+
}
|
@@ -1,21 +1,15 @@
|
|
1
1
|
import React, {useState} from 'react'
|
2
2
|
import Textarea from '../../pb_textarea/_textarea'
|
3
|
-
import Icon from '../../pb_icon/_icon'
|
4
3
|
|
5
4
|
const TextareaError = (props) => {
|
6
5
|
const [value, setValue] = useState('default value text')
|
7
6
|
const handleChange = (event) => {
|
8
7
|
setValue(event.target.value)
|
9
8
|
}
|
10
|
-
const error = (
|
11
|
-
<>
|
12
|
-
<Icon icon="warning" /> This field has an error!
|
13
|
-
</>
|
14
|
-
)
|
15
9
|
return (
|
16
10
|
<div>
|
17
11
|
<Textarea
|
18
|
-
error=
|
12
|
+
error="This field has an error!"
|
19
13
|
label="Label"
|
20
14
|
name="comment"
|
21
15
|
onChange={(e)=> handleChange(e)}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
2
2
|
|
3
3
|
import Typeahead from '../_typeahead'
|
4
|
-
import Icon from '../../pb_icon/_icon'
|
5
4
|
|
6
5
|
const options = [
|
7
6
|
{ label: 'Orange', value: '#FFA500' },
|
@@ -11,10 +10,7 @@ const options = [
|
|
11
10
|
]
|
12
11
|
|
13
12
|
const TypeaheadErrorState = (props) => {
|
14
|
-
const
|
15
|
-
<Icon icon="warning" /> Please make a valid selection
|
16
|
-
</>)
|
17
|
-
const [errorState, setErrorState] = useState(error);
|
13
|
+
const [errorState, setErrorState] = useState("Please make a valid selection");
|
18
14
|
const [searchValue, setSearchValue] = useState(null);
|
19
15
|
|
20
16
|
const handleOnChange = (value) => setSearchValue(value)
|
@@ -23,7 +19,7 @@ const TypeaheadErrorState = (props) => {
|
|
23
19
|
if(searchValue) {
|
24
20
|
setErrorState("")
|
25
21
|
} else {
|
26
|
-
setErrorState(
|
22
|
+
setErrorState("Please make a valid selection")
|
27
23
|
}
|
28
24
|
}, [searchValue])
|
29
25
|
|