playbook_ui 14.10.0.pre.alpha.play16825301 → 14.10.0.pre.rc.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/_playbook.scss +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/Components/CollapsibleTrail.tsx +6 -1
- data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +19 -32
- data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableBody.tsx +1 -3
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +6 -46
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +36 -94
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +1 -8
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_sort.html.erb +3 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -8
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +0 -4
- data/app/pb_kits/playbook/pb_advanced_table/index.js +92 -185
- data/app/pb_kits/playbook/pb_advanced_table/table_body.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +8 -57
- data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +13 -18
- data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +0 -78
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +3 -12
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +2 -15
- data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +6 -10
- data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb +4 -8
- data/app/pb_kits/playbook/pb_avatar/_avatar.scss +2 -0
- data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.scss +9 -11
- data/app/pb_kits/playbook/pb_badge/_badge.scss +2 -4
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.jsx +49 -53
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.html.erb +36 -29
- data/app/pb_kits/playbook/pb_body/_body.scss +13 -14
- data/app/pb_kits/playbook/pb_body/_body_mixins.scss +16 -22
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.scss +1 -3
- data/app/pb_kits/playbook/pb_bread_crumbs/docs/_bread_crumbs_default.jsx +0 -6
- data/app/pb_kits/playbook/pb_button/_button.scss +1 -3
- data/app/pb_kits/playbook/pb_caption/_caption_mixin.scss +1 -2
- data/app/pb_kits/playbook/pb_card/_card.scss +3 -21
- data/app/pb_kits/playbook/pb_card/_card.tsx +7 -7
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +2 -2
- data/app/pb_kits/playbook/pb_card/docs/_card_header.html.erb +1 -39
- data/app/pb_kits/playbook/pb_card/docs/_card_header.jsx +0 -90
- data/app/pb_kits/playbook/pb_card/docs/_card_header.md +1 -1
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.scss +2 -4
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +0 -3
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.html.erb +1 -1
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb +0 -1
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_link.html.erb +0 -8
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_link.jsx +0 -9
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +4 -9
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.tsx +2 -2
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +2 -2
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_input_styles.scss +1 -3
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_overrides.scss +3 -5
- data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.scss +4 -6
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.scss +2 -4
- data/app/pb_kits/playbook/pb_drawer/_drawer.tsx +2 -2
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +8 -10
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.scss +0 -5
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.tsx +17 -31
- data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx +1 -3
- data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx +1 -4
- data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_max_size.jsx +1 -1
- data/app/pb_kits/playbook/pb_file_upload/file_upload.html.erb +2 -8
- data/app/pb_kits/playbook/pb_form_group/_form_group.scss +2 -11
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +4 -6
- data/app/pb_kits/playbook/pb_gauge/_gauge.scss +1 -31
- data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +3 -3
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex.jsx +5 -25
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +1 -17
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis.html.erb +1 -17
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis.jsx +0 -15
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis.md +1 -2
- data/app/pb_kits/playbook/pb_home_address_street/home_address_street.rb +1 -15
- data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.scss +14 -4
- data/app/pb_kits/playbook/pb_label_value/_label_value.scss +2 -4
- data/app/pb_kits/playbook/pb_layout/_layout.tsx +11 -30
- data/app/pb_kits/playbook/pb_link/_link.scss +3 -3
- data/app/pb_kits/playbook/pb_message/_message_mixins.scss +1 -3
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.scss +1 -3
- data/app/pb_kits/playbook/pb_nav/_bold_mixin.scss +1 -11
- data/app/pb_kits/playbook/pb_nav/_collapsible_nav.scss +2 -16
- data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +1 -1
- data/app/pb_kits/playbook/pb_pagination/_pagination.tsx +2 -2
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.scss +3 -5
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +8 -10
- data/app/pb_kits/playbook/pb_pill/_pill.scss +2 -4
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.scss +2 -4
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.scss +2 -4
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.scss +1 -64
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.tsx +1 -3
- data/app/pb_kits/playbook/pb_section_separator/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_section_separator/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_section_separator/section_separator.rb +1 -4
- data/app/pb_kits/playbook/pb_select/_select.scss +3 -5
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +7 -9
- data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +1 -1
- data/app/pb_kits/playbook/pb_skeleton_loading/_skeleton_loading.scss +2 -2
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_height_width.jsx +2 -8
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/example.yml +3 -9
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/index.js +0 -2
- data/app/pb_kits/playbook/pb_skeleton_loading/skeleton_loading.html.erb +12 -8
- data/app/pb_kits/playbook/pb_skeleton_loading/skeleton_loading.rb +1 -48
- data/app/pb_kits/playbook/pb_stat_change/_stat_change.tsx +36 -44
- data/app/pb_kits/playbook/pb_stat_change/stat_change.html.erb +4 -4
- data/app/pb_kits/playbook/pb_table/_table.tsx +24 -80
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.jsx +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_react.md +1 -4
- data/app/pb_kits/playbook/pb_table/docs/example.yml +0 -9
- data/app/pb_kits/playbook/pb_table/docs/index.js +0 -7
- data/app/pb_kits/playbook/pb_table/index.ts +26 -102
- data/app/pb_kits/playbook/pb_table/styles/_all.scss +1 -2
- data/app/pb_kits/playbook/pb_table/styles/_scroll.scss +2 -63
- data/app/pb_kits/playbook/pb_table/styles/_sticky_columns.scss +4 -17
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +1 -106
- data/app/pb_kits/playbook/pb_table/table.html.erb +2 -8
- data/app/pb_kits/playbook/pb_table/table.rb +2 -21
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +1 -3
- data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +4 -43
- data/app/pb_kits/playbook/pb_text_input/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_text_input/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_text_input/text_input.test.js +2 -219
- data/app/pb_kits/playbook/pb_textarea/_textarea.scss +1 -3
- data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.scss +4 -5
- data/app/pb_kits/playbook/pb_timeline/_timeline.scss +2 -4
- data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +5 -5
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.html.erb +5 -4
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.jsx +4 -4
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.md +1 -1
- data/app/pb_kits/playbook/pb_timeline/timeline.rb +6 -6
- data/app/pb_kits/playbook/pb_title/_title.scss +5 -6
- data/app/pb_kits/playbook/pb_title/_title_mixin.scss +0 -13
- data/app/pb_kits/playbook/pb_toggle/_toggle.scss +3 -5
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +46 -115
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.jsx +2 -9
- data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +2 -3
- data/app/pb_kits/playbook/tokens/_titles.scss +8 -0
- data/app/pb_kits/playbook/utilities/_hover.scss +2 -11
- data/app/pb_kits/playbook/utilities/globalPropNames.mjs +0 -1
- data/app/pb_kits/playbook/utilities/globalProps.ts +9 -20
- data/app/pb_kits/playbook/utilities/test/globalProps/hover.test.js +0 -15
- data/dist/chunks/_typeahead-B8fkIeXA.js +22 -0
- data/dist/chunks/_weekday_stacked-CiL8BjKa.js +45 -0
- data/dist/chunks/{lib-B7sgJtGS.js → lib-SyD3buPZ.js} +3 -3
- data/dist/chunks/{pb_form_validation-C5Cc0-1v.js → pb_form_validation-Dt8UJgrJ.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +2 -2
- data/dist/playbook-doc.js +1 -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/classnames.rb +0 -1
- data/lib/playbook/hover.rb +1 -7
- data/lib/playbook/spacing.rb +0 -21
- data/lib/playbook/version.rb +2 -2
- metadata +8 -59
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail_rails.html.erb +0 -36
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail_rails.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers.html.erb +0 -43
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers.jsx +0 -60
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_multiple.html.erb +0 -58
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_multiple.jsx +0 -74
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_multiple.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.jsx +0 -50
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.md +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx +0 -57
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.md +0 -5
- data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_pagination_mock_data.json +0 -5600
- data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_link.md +0 -1
- data/app/pb_kits/playbook/pb_form_group/_error_state_mixin.scss +0 -57
- data/app/pb_kits/playbook/pb_home_address_street/none_emphasis.html.erb +0 -32
- data/app/pb_kits/playbook/pb_home_address_street/none_emphasis.rb +0 -29
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_color.html.erb +0 -10
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_color.jsx +0 -42
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_color.md +0 -3
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_description.md +0 -3
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_border_radius.html.erb +0 -9
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_border_radius_rails.md +0 -1
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_color.html.erb +0 -7
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_filter.html.erb +0 -119
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_filter.jsx +0 -174
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_height_width.html.erb +0 -15
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_height_width_rails.md +0 -3
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_layout.html.erb +0 -3
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_user.html.erb +0 -63
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_user.jsx +0 -97
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns.jsx +0 -88
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns_react.md +0 -3
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.html.erb +0 -77
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_rails.md +0 -3
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns.jsx +0 -87
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns_react.md +0 -5
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.jsx +0 -75
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.md +0 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.jsx +0 -108
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.md +0 -2
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.jsx +0 -94
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.md +0 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.jsx +0 -83
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows.md +0 -3
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.jsx +0 -120
- data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table.md +0 -1
- data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +0 -35
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.jsx +0 -106
- data/app/pb_kits/playbook/pb_text_input/inputMask.ts +0 -108
- data/app/pb_kits/playbook/utilities/_gap.scss +0 -29
- data/dist/chunks/_typeahead-C2iCBqxQ.js +0 -36
- data/dist/chunks/_weekday_stacked-CWnbnW7m.js +0 -45
- /data/app/pb_kits/playbook/pb_skeleton_loading/docs/{_skeleton_loading_border_radius_react.md → _skeleton_loading_border_radius.md} +0 -0
- /data/app/pb_kits/playbook/pb_skeleton_loading/docs/{_skeleton_loading_height_width_react.md → _skeleton_loading_height_width.md} +0 -0
@@ -23,8 +23,6 @@ module Playbook
|
|
23
23
|
prop :text
|
24
24
|
prop :sticky, type: Playbook::Props::Boolean,
|
25
25
|
default: false
|
26
|
-
prop :sticky_left_column, type: Playbook::Props::Array,
|
27
|
-
default: []
|
28
26
|
prop :vertical_border, type: Playbook::Props::Boolean,
|
29
27
|
default: false
|
30
28
|
prop :striped, type: Playbook::Props::Boolean,
|
@@ -39,16 +37,12 @@ module Playbook
|
|
39
37
|
def classname
|
40
38
|
generate_classname(
|
41
39
|
"pb_table", "table-#{size}", single_line_class, dark_class,
|
42
|
-
disable_hover_class, container_class, data_table_class, sticky_class,
|
43
|
-
|
40
|
+
disable_hover_class, container_class, data_table_class, sticky_class, collapse_class,
|
41
|
+
vertical_border_class, striped_class, outer_padding_class,
|
44
42
|
"table-responsive-#{responsive}", separator: " "
|
45
43
|
)
|
46
44
|
end
|
47
45
|
|
48
|
-
def responsive_classname
|
49
|
-
responsive ? "table-responsive-#{responsive}" : nil
|
50
|
-
end
|
51
|
-
|
52
46
|
private
|
53
47
|
|
54
48
|
def dark_class
|
@@ -79,19 +73,6 @@ module Playbook
|
|
79
73
|
sticky ? "sticky-header" : nil
|
80
74
|
end
|
81
75
|
|
82
|
-
def sticky_left_column_class
|
83
|
-
if sticky_left_column.empty?
|
84
|
-
nil
|
85
|
-
else
|
86
|
-
sticky_col_classname = "sticky-left-column sticky-columns"
|
87
|
-
sticky_left_column.each do |id|
|
88
|
-
sticky_col_classname += "-#{id}"
|
89
|
-
end
|
90
|
-
|
91
|
-
sticky_col_classname
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
76
|
def striped_class
|
96
77
|
striped ? "striped" : nil
|
97
78
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
@use "sass:math";
|
2
|
-
|
3
1
|
@import "../pb_textarea/textarea_mixin";
|
4
2
|
@import "../tokens/titles";
|
5
3
|
@import "../tokens/colors";
|
@@ -102,7 +100,7 @@
|
|
102
100
|
&.error {
|
103
101
|
.text_input_wrapper {
|
104
102
|
[class*="pb_body_kit"] {
|
105
|
-
margin-top:
|
103
|
+
margin-top: $space_xs / 2;
|
106
104
|
}
|
107
105
|
input,
|
108
106
|
.text_input {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, { forwardRef
|
1
|
+
import React, { forwardRef } from 'react'
|
2
2
|
import classnames from 'classnames'
|
3
3
|
|
4
4
|
import { globalProps, GlobalProps, domSafeProps } from '../utilities/globalProps'
|
@@ -10,8 +10,6 @@ import Caption from '../pb_caption/_caption'
|
|
10
10
|
import Body from '../pb_body/_body'
|
11
11
|
import Icon from '../pb_icon/_icon'
|
12
12
|
|
13
|
-
import { INPUTMASKS } from './inputMask'
|
14
|
-
|
15
13
|
type TextInputProps = {
|
16
14
|
aria?: { [key: string]: string },
|
17
15
|
className?: string,
|
@@ -24,7 +22,6 @@ type TextInputProps = {
|
|
24
22
|
inline?: boolean,
|
25
23
|
name: string,
|
26
24
|
label: string,
|
27
|
-
mask?: 'currency' | 'zipCode' | 'postalCode' | 'ssn',
|
28
25
|
onChange: (e: React.FormEvent<HTMLInputElement>) => void,
|
29
26
|
placeholder: string,
|
30
27
|
required?: boolean,
|
@@ -50,7 +47,6 @@ const TextInput = (props: TextInputProps, ref: React.LegacyRef<HTMLInputElement>
|
|
50
47
|
htmlOptions = {},
|
51
48
|
id,
|
52
49
|
inline = false,
|
53
|
-
mask = null,
|
54
50
|
name,
|
55
51
|
label,
|
56
52
|
onChange = () => { void 0 },
|
@@ -94,42 +90,8 @@ const TextInput = (props: TextInputProps, ref: React.LegacyRef<HTMLInputElement>
|
|
94
90
|
/>
|
95
91
|
)
|
96
92
|
|
97
|
-
const isMaskedInput = mask && mask in INPUTMASKS
|
98
|
-
|
99
|
-
const handleChange = (e: ChangeEvent<HTMLInputElement>) => {
|
100
|
-
if (isMaskedInput) {
|
101
|
-
const inputValue = e.target.value
|
102
|
-
|
103
|
-
let cursorPosition = e.target.selectionStart;
|
104
|
-
const isAtEnd = cursorPosition === inputValue.length;
|
105
|
-
|
106
|
-
const formattedValue = INPUTMASKS[mask].format(inputValue)
|
107
|
-
e.target.value = formattedValue
|
108
|
-
|
109
|
-
// Keep cursor position
|
110
|
-
if (!isAtEnd) {
|
111
|
-
// Account for extra characters (e.g., commas added/removed in currency)
|
112
|
-
if (formattedValue.length - inputValue.length === 1) {
|
113
|
-
cursorPosition = cursorPosition + 1
|
114
|
-
} else if (mask === "currency" && formattedValue.length - inputValue.length === -1) {
|
115
|
-
cursorPosition = cursorPosition - 1
|
116
|
-
}
|
117
|
-
e.target.selectionStart = e.target.selectionEnd = cursorPosition
|
118
|
-
}
|
119
|
-
}
|
120
|
-
|
121
|
-
onChange(e)
|
122
|
-
}
|
123
|
-
|
124
93
|
const childInput = children ? children.type === "input" : undefined
|
125
94
|
|
126
|
-
let formattedValue;
|
127
|
-
if (isMaskedInput && value) {
|
128
|
-
formattedValue = INPUTMASKS[mask].formatDefaultValue(value.toString())
|
129
|
-
} else {
|
130
|
-
formattedValue = value
|
131
|
-
}
|
132
|
-
|
133
95
|
const textInput = (
|
134
96
|
childInput ? React.cloneElement(children, { className: "text_input" }) :
|
135
97
|
(<input
|
@@ -139,13 +101,12 @@ const TextInput = (props: TextInputProps, ref: React.LegacyRef<HTMLInputElement>
|
|
139
101
|
id={id}
|
140
102
|
key={id}
|
141
103
|
name={name}
|
142
|
-
onChange={
|
143
|
-
|
144
|
-
placeholder={placeholder || (isMaskedInput ? INPUTMASKS[mask]?.placeholder : undefined)}
|
104
|
+
onChange={onChange}
|
105
|
+
placeholder={placeholder}
|
145
106
|
ref={ref}
|
146
107
|
required={required}
|
147
108
|
type={type}
|
148
|
-
value={
|
109
|
+
value={value}
|
149
110
|
/>)
|
150
111
|
)
|
151
112
|
|
@@ -5,4 +5,3 @@ export { default as TextInputDisabled } from './_text_input_disabled.jsx'
|
|
5
5
|
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
|
-
export { default as TextInputMask } from './_text_input_mask.jsx'
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import React
|
2
|
-
import { render, screen
|
1
|
+
import React from 'react'
|
2
|
+
import { render, screen } from '../utilities/test-utils'
|
3
3
|
|
4
4
|
import TextInput from './_text_input'
|
5
5
|
|
@@ -89,220 +89,3 @@ test('returns additional class name', () => {
|
|
89
89
|
const kit = screen.getByTestId(testId)
|
90
90
|
expect(kit).toHaveClass(`${kitClass} mb_lg`)
|
91
91
|
})
|
92
|
-
|
93
|
-
|
94
|
-
const TextInputCurrencyMask = (props) => {
|
95
|
-
const [currency, setValue] = useState('')
|
96
|
-
const handleOnChange = ({ target }) => {
|
97
|
-
setValue(target.value)
|
98
|
-
}
|
99
|
-
|
100
|
-
return (
|
101
|
-
<TextInput
|
102
|
-
mask="currency"
|
103
|
-
onChange={handleOnChange}
|
104
|
-
value={currency}
|
105
|
-
{...props}
|
106
|
-
/>
|
107
|
-
)
|
108
|
-
}
|
109
|
-
|
110
|
-
test('returns masked currency value', () => {
|
111
|
-
render(
|
112
|
-
<TextInputCurrencyMask
|
113
|
-
data={{ testid: testId }}
|
114
|
-
/>
|
115
|
-
)
|
116
|
-
|
117
|
-
const kit = screen.getByTestId(testId)
|
118
|
-
|
119
|
-
const input = within(kit).getByRole('textbox');
|
120
|
-
|
121
|
-
fireEvent.change(input, { target: { value: '123456' } });
|
122
|
-
|
123
|
-
expect(input.value).toBe('$1,234.56')
|
124
|
-
|
125
|
-
fireEvent.change(input, { target: { value: '1' } });
|
126
|
-
|
127
|
-
expect(input.value).toBe('$0.01')
|
128
|
-
|
129
|
-
fireEvent.change(input, { target: { value: '' } });
|
130
|
-
|
131
|
-
expect(input.value).toBe('')
|
132
|
-
})
|
133
|
-
|
134
|
-
const TextInputZipCodeMask = (props) => {
|
135
|
-
const [zipCode, setValue] = useState('')
|
136
|
-
const handleOnChange = ({ target }) => {
|
137
|
-
setValue(target.value)
|
138
|
-
}
|
139
|
-
|
140
|
-
return (
|
141
|
-
<TextInput
|
142
|
-
mask="zipCode"
|
143
|
-
onChange={handleOnChange}
|
144
|
-
value={zipCode}
|
145
|
-
{...props}
|
146
|
-
/>
|
147
|
-
)
|
148
|
-
}
|
149
|
-
|
150
|
-
test('returns masked zip code value', () => {
|
151
|
-
render(
|
152
|
-
<TextInputZipCodeMask
|
153
|
-
data={{ testid: testId }}
|
154
|
-
/>
|
155
|
-
)
|
156
|
-
|
157
|
-
const kit = screen.getByTestId(testId)
|
158
|
-
|
159
|
-
const input = within(kit).getByRole('textbox');
|
160
|
-
|
161
|
-
fireEvent.change(input, { target: { value: '123456' } });
|
162
|
-
|
163
|
-
expect(input.value).toBe('12345')
|
164
|
-
})
|
165
|
-
|
166
|
-
const TextInputPostalCodeMask = (props) => {
|
167
|
-
const [postalCode, setValue] = useState('')
|
168
|
-
const handleOnChange = ({ target }) => {
|
169
|
-
setValue(target.value)
|
170
|
-
}
|
171
|
-
|
172
|
-
return (
|
173
|
-
<TextInput
|
174
|
-
mask="postalCode"
|
175
|
-
onChange={handleOnChange}
|
176
|
-
value={postalCode}
|
177
|
-
{...props}
|
178
|
-
/>
|
179
|
-
)
|
180
|
-
}
|
181
|
-
|
182
|
-
test('returns masked postal code value', () => {
|
183
|
-
render(
|
184
|
-
<TextInputPostalCodeMask
|
185
|
-
data={{ testid: testId }}
|
186
|
-
/>
|
187
|
-
)
|
188
|
-
|
189
|
-
const kit = screen.getByTestId(testId)
|
190
|
-
|
191
|
-
const input = within(kit).getByRole('textbox');
|
192
|
-
|
193
|
-
fireEvent.change(input, { target: { value: '123456789' } });
|
194
|
-
|
195
|
-
expect(input.value).toBe('12345-6789')
|
196
|
-
})
|
197
|
-
|
198
|
-
const TextInputSSNMask = (props) => {
|
199
|
-
const [ssn, setValue] = useState('')
|
200
|
-
const handleOnChange = ({ target }) => {
|
201
|
-
setValue(target.value)
|
202
|
-
}
|
203
|
-
|
204
|
-
return (
|
205
|
-
<TextInput
|
206
|
-
mask="ssn"
|
207
|
-
onChange={handleOnChange}
|
208
|
-
value={ssn}
|
209
|
-
{...props}
|
210
|
-
/>
|
211
|
-
)
|
212
|
-
}
|
213
|
-
|
214
|
-
test('returns masked ssn value', () => {
|
215
|
-
render(
|
216
|
-
<TextInputSSNMask
|
217
|
-
data={{ testid: testId }}
|
218
|
-
/>
|
219
|
-
)
|
220
|
-
|
221
|
-
const kit = screen.getByTestId(testId)
|
222
|
-
|
223
|
-
const input = within(kit).getByRole('textbox');
|
224
|
-
|
225
|
-
fireEvent.change(input, { target: { value: '123456789' } });
|
226
|
-
|
227
|
-
expect(input.value).toBe('123-45-6789')
|
228
|
-
})
|
229
|
-
|
230
|
-
const TextInputCreditCardMask = (props) => {
|
231
|
-
const [creditCard, setValue] = useState('')
|
232
|
-
const handleOnChange = ({ target }) => {
|
233
|
-
setValue(target.value)
|
234
|
-
}
|
235
|
-
|
236
|
-
return (
|
237
|
-
<TextInput
|
238
|
-
mask="creditCard"
|
239
|
-
onChange={handleOnChange}
|
240
|
-
value={creditCard}
|
241
|
-
{...props}
|
242
|
-
/>
|
243
|
-
)
|
244
|
-
}
|
245
|
-
|
246
|
-
test('returns masked credit card value', () => {
|
247
|
-
render(
|
248
|
-
<TextInputCreditCardMask
|
249
|
-
data={{ testid: testId }}
|
250
|
-
/>
|
251
|
-
)
|
252
|
-
|
253
|
-
const kit = screen.getByTestId(testId)
|
254
|
-
|
255
|
-
const input = within(kit).getByRole('textbox')
|
256
|
-
|
257
|
-
fireEvent.change(input, { target: { value: '1234567890123456' } })
|
258
|
-
|
259
|
-
expect(input.value).toBe('1234 5678 9012 3456')
|
260
|
-
|
261
|
-
fireEvent.change(input, { target: { value: '1234' } })
|
262
|
-
|
263
|
-
expect(input.value).toBe('1234')
|
264
|
-
|
265
|
-
fireEvent.change(input, { target: { value: '' } })
|
266
|
-
|
267
|
-
expect(input.value).toBe('')
|
268
|
-
})
|
269
|
-
|
270
|
-
const TextInputCVVMask = (props) => {
|
271
|
-
const [cvv, setValue] = useState('')
|
272
|
-
const handleOnChange = ({ target }) => {
|
273
|
-
setValue(target.value)
|
274
|
-
}
|
275
|
-
|
276
|
-
return (
|
277
|
-
<TextInput
|
278
|
-
mask="cvv"
|
279
|
-
onChange={handleOnChange}
|
280
|
-
value={cvv}
|
281
|
-
{...props}
|
282
|
-
/>
|
283
|
-
)
|
284
|
-
}
|
285
|
-
|
286
|
-
test('returns masked CVV value', () => {
|
287
|
-
render(
|
288
|
-
<TextInputCVVMask
|
289
|
-
data={{ testid: testId }}
|
290
|
-
/>
|
291
|
-
)
|
292
|
-
|
293
|
-
const kit = screen.getByTestId(testId)
|
294
|
-
|
295
|
-
const input = within(kit).getByRole('textbox')
|
296
|
-
|
297
|
-
fireEvent.change(input, { target: { value: '1234' } })
|
298
|
-
|
299
|
-
expect(input.value).toBe('1234')
|
300
|
-
|
301
|
-
fireEvent.change(input, { target: { value: '123' } })
|
302
|
-
|
303
|
-
expect(input.value).toBe('123')
|
304
|
-
|
305
|
-
fireEvent.change(input, { target: { value: '' } })
|
306
|
-
|
307
|
-
expect(input.value).toBe('')
|
308
|
-
})
|
@@ -1,5 +1,3 @@
|
|
1
|
-
@use "sass:math";
|
2
|
-
|
3
1
|
@import "../pb_body/body_mixins";
|
4
2
|
@import "./textarea_mixin";
|
5
3
|
@import "../tokens/spacing";
|
@@ -62,7 +60,7 @@
|
|
62
60
|
|
63
61
|
&.error {
|
64
62
|
[class*=pb_body_kit] {
|
65
|
-
margin-top:
|
63
|
+
margin-top: $space_xs / 2;
|
66
64
|
}
|
67
65
|
textarea {
|
68
66
|
border-color: $error;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
@use "sass:math";
|
2
1
|
|
3
2
|
[class^=pb_time_range_inline_kit] {
|
4
3
|
&[class*=_center] {
|
@@ -23,14 +22,14 @@
|
|
23
22
|
display: flex;
|
24
23
|
align-items: center;
|
25
24
|
[class*=pb_time_range_inline_arrow] {
|
26
|
-
margin-left:
|
27
|
-
margin-right:
|
25
|
+
margin-left: $space_xs/2;
|
26
|
+
margin-right: $space_xs/2;
|
28
27
|
}
|
29
28
|
[class*=pb_time_range_inline_timezone] {
|
30
|
-
margin-left:
|
29
|
+
margin-left: $space_xs/2;
|
31
30
|
}
|
32
31
|
[class*=pb_time_range_inline_icon] {
|
33
|
-
margin-right:
|
32
|
+
margin-right: $space_xs/2;
|
34
33
|
}
|
35
34
|
}
|
36
35
|
}
|
@@ -1,14 +1,12 @@
|
|
1
|
-
@use "sass:math";
|
2
|
-
|
3
1
|
@import "../tokens/colors";
|
4
2
|
@import "../tokens/spacing";
|
5
3
|
@import "../tokens/opacity";
|
6
4
|
@import "../tokens/typography";
|
7
5
|
|
8
6
|
$connector_width: 2px;
|
9
|
-
$icon_margin:
|
7
|
+
$icon_margin: $space_xs/2;
|
10
8
|
$icon_height: 28px;
|
11
|
-
$height_from_top:
|
9
|
+
$height_from_top: $icon_height/2 - $connector_width/2;
|
12
10
|
|
13
11
|
// Add gap variables
|
14
12
|
$gap_xs: $height_from_top + $space_xs;
|
@@ -20,7 +20,7 @@ type TimelineProps = {
|
|
20
20
|
id?: string,
|
21
21
|
orientation?: string,
|
22
22
|
showDate?: boolean,
|
23
|
-
|
23
|
+
gap?: 'xs' | 'sm' | 'md' | 'lg' | 'none',
|
24
24
|
} & GlobalProps
|
25
25
|
|
26
26
|
const Timeline = ({
|
@@ -32,15 +32,15 @@ const Timeline = ({
|
|
32
32
|
id,
|
33
33
|
orientation = 'horizontal',
|
34
34
|
showDate = false,
|
35
|
-
|
35
|
+
gap = 'none',
|
36
36
|
...props
|
37
37
|
}: TimelineProps): React.ReactElement => {
|
38
38
|
const ariaProps = buildAriaProps(aria)
|
39
39
|
const dataProps = buildDataProps(data)
|
40
40
|
const htmlProps = buildHtmlProps(htmlOptions)
|
41
41
|
const dateStyle = showDate === true ? '_with_date' : ''
|
42
|
-
const
|
43
|
-
const timelineCss = buildCss('pb_timeline_kit', `${orientation}`, dateStyle,
|
42
|
+
const gapStyle = gap === 'none' ? '' : `gap_${gap}`
|
43
|
+
const timelineCss = buildCss('pb_timeline_kit', `${orientation}`, dateStyle, gapStyle)
|
44
44
|
|
45
45
|
return (
|
46
46
|
<div
|
@@ -60,4 +60,4 @@ Timeline.Step = TimelineStep
|
|
60
60
|
Timeline.Label = TimelineLabel
|
61
61
|
Timeline.Detail = TimelineDetail
|
62
62
|
|
63
|
-
export default Timeline
|
63
|
+
export default Timeline
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%= pb_rails("flex", props: { justify: "evenly" }) do %>
|
2
2
|
<%= pb_rails("flex/flex_item") do %>
|
3
|
-
<%= pb_rails("timeline", props: {orientation: "vertical",
|
3
|
+
<%= pb_rails("timeline", props: {orientation: "vertical", gap: "xs"}) do %>
|
4
4
|
<%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal"}) do %>
|
5
5
|
<%= pb_rails("body", props: {
|
6
6
|
text: "Conversation started",
|
@@ -23,7 +23,7 @@
|
|
23
23
|
<% end %>
|
24
24
|
|
25
25
|
<%= pb_rails("flex/flex_item") do %>
|
26
|
-
<%= pb_rails("timeline", props: {orientation: "vertical",
|
26
|
+
<%= pb_rails("timeline", props: {orientation: "vertical", gap: "sm"}) do %>
|
27
27
|
<%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal"}) do %>
|
28
28
|
<%= pb_rails("body", props: {
|
29
29
|
text: "Conversation started",
|
@@ -46,7 +46,7 @@
|
|
46
46
|
<% end %>
|
47
47
|
|
48
48
|
<%= pb_rails("flex/flex_item") do %>
|
49
|
-
<%= pb_rails("timeline", props: {orientation: "vertical",
|
49
|
+
<%= pb_rails("timeline", props: {orientation: "vertical", gap: "md"}) do %>
|
50
50
|
<%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal"}) do %>
|
51
51
|
<%= pb_rails("body", props: {
|
52
52
|
text: "Conversation started",
|
@@ -69,7 +69,7 @@
|
|
69
69
|
<% end %>
|
70
70
|
|
71
71
|
<%= pb_rails("flex/flex_item") do %>
|
72
|
-
<%= pb_rails("timeline", props: {orientation: "vertical",
|
72
|
+
<%= pb_rails("timeline", props: {orientation: "vertical", gap: "lg"}) do %>
|
73
73
|
<%= pb_rails("timeline/item", props: {icon: "user", icon_color: "royal"}) do %>
|
74
74
|
<%= pb_rails("body", props: {
|
75
75
|
text: "Conversation started",
|
@@ -91,3 +91,4 @@
|
|
91
91
|
<% end %>
|
92
92
|
<% end %>
|
93
93
|
<% end %>
|
94
|
+
|
@@ -10,7 +10,7 @@ const TimelineWithGap = (props) => (
|
|
10
10
|
<Flex justify="evenly">
|
11
11
|
<FlexItem>
|
12
12
|
<Timeline
|
13
|
-
|
13
|
+
gap="xs"
|
14
14
|
orientation="vertical"
|
15
15
|
>
|
16
16
|
<Timeline.Item
|
@@ -51,7 +51,7 @@ const TimelineWithGap = (props) => (
|
|
51
51
|
</FlexItem>
|
52
52
|
<FlexItem>
|
53
53
|
<Timeline
|
54
|
-
|
54
|
+
gap="sm"
|
55
55
|
orientation="vertical"
|
56
56
|
>
|
57
57
|
<Timeline.Item
|
@@ -92,7 +92,7 @@ const TimelineWithGap = (props) => (
|
|
92
92
|
</FlexItem>
|
93
93
|
<FlexItem>
|
94
94
|
<Timeline
|
95
|
-
|
95
|
+
gap="md"
|
96
96
|
orientation="vertical"
|
97
97
|
>
|
98
98
|
<Timeline.Item
|
@@ -134,7 +134,7 @@ const TimelineWithGap = (props) => (
|
|
134
134
|
</FlexItem>
|
135
135
|
<FlexItem>
|
136
136
|
<Timeline
|
137
|
-
|
137
|
+
gap="lg"
|
138
138
|
orientation="vertical"
|
139
139
|
>
|
140
140
|
<Timeline.Item
|
@@ -1 +1 @@
|
|
1
|
-
Use the optional `
|
1
|
+
Use the optional `gap` prop to render the timeline kit with adjusted spacing between nodes. The `gap` prop will only work when utilized with a vertical timeline. Horizontal timelines will show no difference in spacing.
|
@@ -8,15 +8,15 @@ module Playbook
|
|
8
8
|
default: "horizontal"
|
9
9
|
prop :show_date, type: Playbook::Props::Boolean,
|
10
10
|
default: false
|
11
|
-
prop :
|
12
|
-
|
13
|
-
|
11
|
+
prop :gap, type: Playbook::Props::Enum,
|
12
|
+
values: %w[xs sm md lg none],
|
13
|
+
default: "none"
|
14
14
|
|
15
15
|
def classname
|
16
16
|
generate_classname("pb_timeline_kit",
|
17
17
|
orientation,
|
18
18
|
date_class,
|
19
|
-
|
19
|
+
gap_class)
|
20
20
|
end
|
21
21
|
|
22
22
|
private
|
@@ -25,8 +25,8 @@ module Playbook
|
|
25
25
|
show_date ? "with_date" : nil
|
26
26
|
end
|
27
27
|
|
28
|
-
def
|
29
|
-
|
28
|
+
def gap_class
|
29
|
+
gap == "none" ? nil : "gap_#{gap}"
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
@@ -49,11 +49,10 @@
|
|
49
49
|
}
|
50
50
|
|
51
51
|
&.dark {
|
52
|
-
@include
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
}
|
52
|
+
@include pb_title_dark;
|
53
|
+
}
|
54
|
+
|
55
|
+
&.dark[class*=_link] {
|
56
|
+
@include pb_title_dark_link;
|
58
57
|
}
|
59
58
|
}
|
@@ -9,15 +9,6 @@ $pb_title_colors: (
|
|
9
9
|
link: $primary
|
10
10
|
);
|
11
11
|
|
12
|
-
$pb_dark_title_colors: (
|
13
|
-
default: $text_dk_default,
|
14
|
-
light: $text_dk_light,
|
15
|
-
lighter: $text_dk_lighter,
|
16
|
-
success: $success,
|
17
|
-
error: $error_dark,
|
18
|
-
link: $active_dark
|
19
|
-
);
|
20
|
-
|
21
12
|
@mixin title_colors {
|
22
13
|
@each $name, $color in $pb_title_colors {
|
23
14
|
&[class*=_#{$name}] {
|
@@ -25,7 +16,3 @@ $pb_dark_title_colors: (
|
|
25
16
|
}
|
26
17
|
}
|
27
18
|
}
|
28
|
-
|
29
|
-
@mixin title_dark {
|
30
|
-
color: $text_dk_default;
|
31
|
-
}
|
@@ -1,5 +1,3 @@
|
|
1
|
-
@use "sass:math";
|
2
|
-
|
3
1
|
@import "../tokens/colors";
|
4
2
|
|
5
3
|
$color_checkbox_success: $data_1;
|
@@ -10,7 +8,7 @@ $transition: .2s ease-in-out;
|
|
10
8
|
[class^=pb_toggle_kit] {
|
11
9
|
position: relative;
|
12
10
|
$width: 44px;
|
13
|
-
$height:
|
11
|
+
$height: $width / 2;
|
14
12
|
$border_success: 3px solid $color_checkbox_success;
|
15
13
|
$border_default: 3px solid $color_checkbox_default;
|
16
14
|
|
@@ -29,7 +27,7 @@ $transition: .2s ease-in-out;
|
|
29
27
|
&:after {
|
30
28
|
transition: $transition;
|
31
29
|
content: "";
|
32
|
-
width:
|
30
|
+
width: $width / 2 - 4px;
|
33
31
|
height: $height - 4px;
|
34
32
|
background-color: $color_checkbox_default;
|
35
33
|
border-radius: 50%;
|
@@ -70,7 +68,7 @@ $transition: .2s ease-in-out;
|
|
70
68
|
background-color: $color_checkbox_success;
|
71
69
|
|
72
70
|
&:after {
|
73
|
-
left:
|
71
|
+
left: $width / 2 + 2px;
|
74
72
|
background-color: $white;
|
75
73
|
}
|
76
74
|
}
|