playbook_ui 13.14.0 → 13.15.0.pre.alpha.PLAY10851907
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 +1 -0
- data/app/pb_kits/playbook/pb_avatar/_avatar.tsx +5 -5
- data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.tsx +3 -3
- data/app/pb_kits/playbook/pb_background/_background.tsx +9 -9
- data/app/pb_kits/playbook/pb_badge/_badge.tsx +2 -2
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +3 -3
- data/app/pb_kits/playbook/pb_body/_body.scss +0 -5
- data/app/pb_kits/playbook/pb_body/_body.tsx +5 -9
- data/app/pb_kits/playbook/pb_body/_body_mixins.scss +0 -20
- data/app/pb_kits/playbook/pb_body/body.rb +1 -8
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumb_item.tsx +3 -4
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.tsx +3 -3
- data/app/pb_kits/playbook/pb_button/_button.tsx +40 -37
- data/app/pb_kits/playbook/pb_button/docs/_button_props_swift.md +11 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_reaction_swift.md +26 -0
- data/app/pb_kits/playbook/pb_button/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.tsx +3 -3
- data/app/pb_kits/playbook/pb_caption/_caption.tsx +1 -1
- data/app/pb_kits/playbook/pb_card/_card.tsx +2 -2
- data/app/pb_kits/playbook/pb_card/docs/_card_background.jsx +5 -4
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.tsx +3 -3
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +9 -9
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +1 -1
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +5 -7
- data/app/pb_kits/playbook/pb_collapsible/_helper_functions.ts +2 -2
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.tsx +5 -4
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +16 -12
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_colors_swift.md +27 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_default_swift.md +22 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_props_table.md +8 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_sizes_swift.md +26 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/example.yml +6 -0
- data/app/pb_kits/playbook/pb_contact/_contact.tsx +3 -3
- data/app/pb_kits/playbook/pb_currency/_currency.tsx +2 -2
- data/app/pb_kits/playbook/pb_dashboard/pbChartsColorsHelper.ts +1 -1
- data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +4 -55
- data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +5 -56
- data/app/pb_kits/playbook/pb_dashboard/themeTypes.ts +20 -16
- data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.tsx +1 -1
- data/app/pb_kits/playbook/pb_date/_date.tsx +7 -7
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +1 -1
- data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.tsx +2 -2
- data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx +2 -2
- data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.tsx +8 -8
- data/app/pb_kits/playbook/pb_date_time/_date_time.tsx +2 -2
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +1 -1
- data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.tsx +2 -2
- data/app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js +6 -3
- data/app/pb_kits/playbook/pb_detail/_detail.scss +2 -2
- data/app/pb_kits/playbook/pb_detail/_detail.tsx +5 -5
- data/app/pb_kits/playbook/pb_detail/detail.rb +1 -1
- data/app/pb_kits/playbook/pb_detail/detail.test.jsx +2 -2
- data/app/pb_kits/playbook/pb_dialog/_close_icon.tsx +2 -2
- data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +42 -34
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_body.tsx +1 -1
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_footer.tsx +4 -5
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_header.tsx +4 -4
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_default_swift.md +11 -0
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height.jsx +8 -4
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height_placement.jsx +8 -4
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_props_table.md +13 -0
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_scrollable.jsx +4 -2
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_sizes_swift.md +18 -0
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_status.jsx +1 -1
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_status_swift.md +14 -0
- data/app/pb_kits/playbook/pb_dialog/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.tsx +5 -5
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.tsx +1 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +1 -1
- data/app/pb_kits/playbook/pb_flex/_flex.tsx +1 -1
- data/app/pb_kits/playbook/pb_flex/_flex_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_form_group/_form_group.tsx +1 -1
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +1 -1
- data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +1 -1
- data/app/pb_kits/playbook/pb_hashtag/_hashtag.tsx +1 -1
- data/app/pb_kits/playbook/pb_highlight/_highlight.tsx +1 -1
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +1 -1
- data/app/pb_kits/playbook/pb_icon/_icon.tsx +1 -1
- data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.tsx +1 -1
- data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.tsx +1 -1
- data/app/pb_kits/playbook/pb_icon_value/_icon_value.tsx +1 -1
- data/app/pb_kits/playbook/pb_image/_image.tsx +1 -1
- data/app/pb_kits/playbook/pb_label_pill/_label_pill.tsx +1 -1
- data/app/pb_kits/playbook/pb_label_value/_label_value.tsx +1 -1
- data/app/pb_kits/playbook/pb_layout/_layout.tsx +1 -1
- data/app/pb_kits/playbook/pb_legend/_legend.tsx +1 -1
- data/app/pb_kits/playbook/pb_lightbox/Header/_lightbox_header.tsx +1 -1
- data/app/pb_kits/playbook/pb_lightbox/_lightbox.tsx +1 -1
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +1 -1
- data/app/pb_kits/playbook/pb_list/_list.tsx +1 -1
- data/app/pb_kits/playbook/pb_list/_list_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +1 -1
- data/app/pb_kits/playbook/pb_map/_map.tsx +1 -1
- data/app/pb_kits/playbook/pb_message/_message.tsx +1 -1
- data/app/pb_kits/playbook/pb_message/_message_mention.tsx +1 -1
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +1 -1
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +1 -1
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +1 -1
- data/app/pb_kits/playbook/pb_nav/_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_nav/_nav.tsx +1 -1
- data/app/pb_kits/playbook/pb_nav/docs/_nav_horizontal_bold_swift.md +17 -0
- data/app/pb_kits/playbook/pb_nav/docs/_nav_horizontal_default_swift.md +17 -0
- data/app/pb_kits/playbook/pb_nav/docs/_nav_horizontal_subtle_no_highlight_swift.md +18 -0
- data/app/pb_kits/playbook/pb_nav/docs/_nav_horizontal_subtle_swift.md +18 -0
- data/app/pb_kits/playbook/pb_nav/docs/_nav_props_swift.md +11 -0
- data/app/pb_kits/playbook/pb_nav/docs/_nav_vertical_bold_swift.md +18 -0
- data/app/pb_kits/playbook/pb_nav/docs/_nav_vertical_default_swift.md +18 -0
- data/app/pb_kits/playbook/pb_nav/docs/_nav_vertical_subtle_no_highlight_swift.md +19 -0
- data/app/pb_kits/playbook/pb_nav/docs/_nav_vertical_subtle_swift.md +17 -0
- data/app/pb_kits/playbook/pb_nav/docs/example.yml +17 -0
- data/app/pb_kits/playbook/pb_online_status/_online_status.tsx +1 -1
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.tsx +52 -51
- data/app/pb_kits/playbook/pb_person/_person.tsx +1 -1
- data/app/pb_kits/playbook/pb_person/docs/_person_default_swift.md +8 -0
- data/app/pb_kits/playbook/pb_person/docs/_person_props_swift.md +5 -0
- data/app/pb_kits/playbook/pb_person/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_person_contact/_person_contact.tsx +21 -20
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +5 -4
- data/app/pb_kits/playbook/pb_pill/_pill.tsx +1 -1
- data/app/pb_kits/playbook/pb_popover/_popover.tsx +7 -5
- data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.tsx +21 -21
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.tsx +5 -5
- data/app/pb_kits/playbook/pb_progress_step/_progress_step.tsx +1 -1
- data/app/pb_kits/playbook/pb_progress_step/_progress_step_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_radio/_radio.tsx +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/EditorButton.tsx +19 -17
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/EditorTypes.ts +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/MoreExtensionsDropdown.tsx +23 -21
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/Toolbar.tsx +18 -10
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarDropdown.tsx +46 -23
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarHistory.tsx +8 -8
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarNodes.tsx +7 -7
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +18 -16
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.tsx +10 -8
- data/app/pb_kits/playbook/pb_select/_select.tsx +2 -2
- data/app/pb_kits/playbook/pb_select/docs/_select_default_swift.md +15 -0
- data/app/pb_kits/playbook/pb_select/docs/_select_error_swift.md +18 -0
- data/app/pb_kits/playbook/pb_select/docs/_select_props_table.md +8 -0
- data/app/pb_kits/playbook/pb_select/docs/example.yml +5 -0
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.tsx +1 -1
- data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.tsx +26 -25
- data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.tsx +28 -27
- data/app/pb_kits/playbook/pb_selectable_list/_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_selectable_list/_selectable_list.tsx +3 -2
- data/app/pb_kits/playbook/pb_source/_source.tsx +16 -16
- data/app/pb_kits/playbook/pb_star_rating/_star_rating.tsx +1 -1
- data/app/pb_kits/playbook/pb_stat_change/_stat_change.tsx +1 -1
- data/app/pb_kits/playbook/pb_stat_value/_stat_value.tsx +1 -1
- data/app/pb_kits/playbook/pb_table/_table.tsx +1 -1
- data/app/pb_kits/playbook/pb_table/_table_row.tsx +1 -1
- data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +1 -1
- data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +1 -1
- data/app/pb_kits/playbook/pb_time/_time.tsx +1 -1
- data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.tsx +1 -1
- data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.tsx +1 -1
- data/app/pb_kits/playbook/pb_timeline/_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +1 -1
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.tsx +1 -1
- data/app/pb_kits/playbook/pb_title/_title.scss +0 -5
- data/app/pb_kits/playbook/pb_title/_title.tsx +2 -5
- data/app/pb_kits/playbook/pb_title/_title_mixin.scss +0 -19
- data/app/pb_kits/playbook/pb_title/title.rb +2 -9
- data/app/pb_kits/playbook/pb_title_count/_title_count.tsx +1 -1
- data/app/pb_kits/playbook/pb_title_detail/_title_detail.tsx +1 -1
- data/app/pb_kits/playbook/pb_toggle/_toggle.tsx +1 -1
- data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +1 -1
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +1 -1
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +1 -1
- data/app/pb_kits/playbook/pb_user/_user.tsx +1 -1
- data/app/pb_kits/playbook/pb_user/docs/_user_horizontal_swift.md +37 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_props_table.md +10 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_size_swift.md +35 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_text_only_swift.md +27 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_vertical_size_swift.md +35 -0
- data/app/pb_kits/playbook/pb_user/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_user_badge/_user_badge.tsx +1 -1
- data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.tsx +1 -1
- data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.tsx +1 -1
- data/app/pb_kits/playbook/tokens/exports/exports.d.ts +1 -0
- data/app/pb_kits/playbook/utilities/_truncate.scss +20 -0
- data/app/pb_kits/playbook/utilities/globalProps.ts +13 -2
- data/app/pb_kits/playbook/utilities/props.ts +2 -2
- data/app/pb_kits/playbook/utilities/test/globalProps/truncate.test.js +21 -0
- data/dist/playbook-rails.js +4 -4
- data/lib/playbook/classnames.rb +1 -0
- data/lib/playbook/kit_base.rb +2 -0
- data/lib/playbook/truncate.rb +29 -0
- data/lib/playbook/version.rb +2 -2
- metadata +39 -7
@@ -13,25 +13,26 @@ import Flex from '../pb_flex/_flex'
|
|
13
13
|
import Icon from '../pb_icon/_icon'
|
14
14
|
import PbReactPopover from '../pb_popover/_popover'
|
15
15
|
import TextInput from '../pb_text_input/_text_input'
|
16
|
+
import { GenericObject } from "../types"
|
16
17
|
|
17
18
|
type PassphraseProps = {
|
18
19
|
aria?: { [key: string]: string },
|
19
20
|
confirmation?: boolean,
|
20
21
|
className?: string,
|
21
|
-
data?:
|
22
|
+
data?: GenericObject,
|
22
23
|
dark?: boolean,
|
23
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
24
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
24
25
|
id?: string,
|
25
|
-
inputProps?:
|
26
|
+
inputProps?: GenericObject,
|
26
27
|
label?: string,
|
27
|
-
onChange: (inputValue:
|
28
|
+
onChange: (inputValue: string) => void,
|
28
29
|
showTipsBelow?: "always" | "xs" | "sm" | "md" | "lg" | "xl",
|
29
30
|
tips?: Array<string>,
|
30
31
|
uncontrolled?: boolean,
|
31
32
|
value: string,
|
32
33
|
}
|
33
34
|
|
34
|
-
const Passphrase = (props: PassphraseProps) => {
|
35
|
+
const Passphrase = (props: PassphraseProps): React.ReactElement => {
|
35
36
|
const {
|
36
37
|
aria = {},
|
37
38
|
className,
|
@@ -42,7 +43,7 @@ const Passphrase = (props: PassphraseProps) => {
|
|
42
43
|
id,
|
43
44
|
inputProps = {},
|
44
45
|
label = confirmation ? "Confirm Passphrase" : "Passphrase",
|
45
|
-
onChange = () =>
|
46
|
+
onChange = () => undefined,
|
46
47
|
showTipsBelow = "always",
|
47
48
|
tips = [],
|
48
49
|
uncontrolled = false,
|
@@ -84,60 +85,60 @@ const Passphrase = (props: PassphraseProps) => {
|
|
84
85
|
globalProps(props),
|
85
86
|
className
|
86
87
|
)
|
87
|
-
|
88
|
-
|
88
|
+
const dataProps = buildDataProps(data)
|
89
|
+
const htmlProps = buildHtmlProps(htmlOptions)
|
89
90
|
|
90
91
|
const popoverReference = (
|
91
92
|
<CircleIconButton
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
93
|
+
className={tipClass}
|
94
|
+
dark={dark}
|
95
|
+
icon="info-circle"
|
96
|
+
onClick={toggleShowPopover}
|
97
|
+
variant="link"
|
97
98
|
/>
|
98
99
|
)
|
99
100
|
|
100
101
|
return (
|
101
102
|
<div
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
103
|
+
{...ariaProps}
|
104
|
+
{...dataProps}
|
105
|
+
{...htmlProps}
|
106
|
+
className={classes}
|
107
|
+
id={id}
|
107
108
|
>
|
108
109
|
<label>
|
109
110
|
<Flex align="baseline">
|
110
111
|
<Caption
|
111
|
-
|
112
|
-
|
112
|
+
className="passphrase-label"
|
113
|
+
text={label}
|
113
114
|
/>
|
114
115
|
{tips.length > 0 && !confirmation &&
|
115
116
|
<PbReactPopover
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
117
|
+
className="passphrase-tips"
|
118
|
+
closeOnClick="outside"
|
119
|
+
placement="right"
|
120
|
+
reference={popoverReference}
|
121
|
+
shouldClosePopover={handleShouldClosePopover}
|
122
|
+
show={showPopover}
|
122
123
|
>
|
123
124
|
<Flex
|
124
|
-
|
125
|
-
|
125
|
+
align="center"
|
126
|
+
orientation="column"
|
126
127
|
>
|
127
128
|
<Caption
|
128
|
-
|
129
|
-
|
129
|
+
marginBottom="xs"
|
130
|
+
text="Tips for a good passphrase"
|
130
131
|
/>
|
131
132
|
<div>
|
132
133
|
{tips.map((tip, i) => (
|
133
134
|
<Caption
|
134
|
-
|
135
|
-
|
136
|
-
|
135
|
+
key={i}
|
136
|
+
marginBottom="xs"
|
137
|
+
size="xs"
|
137
138
|
>
|
138
139
|
<Icon
|
139
|
-
|
140
|
-
|
140
|
+
icon="shield-check"
|
141
|
+
marginRight="xs"
|
141
142
|
/>
|
142
143
|
{tip}
|
143
144
|
</Caption>
|
@@ -149,30 +150,30 @@ const Passphrase = (props: PassphraseProps) => {
|
|
149
150
|
</Flex>
|
150
151
|
<div className="passphrase-text-input-wrapper">
|
151
152
|
<TextInput
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
153
|
+
className="passphrase-text-input"
|
154
|
+
dark={dark}
|
155
|
+
marginBottom="xs"
|
156
|
+
onChange={handleChange}
|
157
|
+
placeholder="Enter a passphrase..."
|
158
|
+
type={showPassphrase ? "text" : "password"}
|
159
|
+
value={displayValue}
|
160
|
+
{...inputProps}
|
160
161
|
/>
|
161
162
|
<span
|
162
|
-
|
163
|
-
|
163
|
+
className="show-passphrase-icon"
|
164
|
+
onClick={toggleShowPassphrase}
|
164
165
|
>
|
165
166
|
<Body
|
166
|
-
|
167
|
-
|
168
|
-
|
167
|
+
className={showPassphrase ? "hide-icon" : ""}
|
168
|
+
color="light"
|
169
|
+
dark={dark}
|
169
170
|
>
|
170
171
|
<Icon icon="eye-slash" />
|
171
172
|
</Body>
|
172
173
|
<Body
|
173
|
-
|
174
|
-
|
175
|
-
|
174
|
+
className={showPassphrase ? "" : "hide-icon"}
|
175
|
+
color="light"
|
176
|
+
dark={dark}
|
176
177
|
>
|
177
178
|
<Icon icon="eye" />
|
178
179
|
</Body>
|
@@ -17,7 +17,7 @@ type PersonProps = {
|
|
17
17
|
className?: string | string[],
|
18
18
|
data?: { [key: string]: string },
|
19
19
|
firstName: string,
|
20
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
20
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
21
21
|
id?: string,
|
22
22
|
lastName: string,
|
23
23
|
}
|
@@ -7,6 +7,7 @@ import { globalProps } from '../utilities/globalProps'
|
|
7
7
|
import Caption from '../pb_caption/_caption'
|
8
8
|
import Contact from '../pb_contact/_contact'
|
9
9
|
import Person from '../pb_person/_person'
|
10
|
+
import { GenericObject } from '../types'
|
10
11
|
|
11
12
|
type ContactItem = {
|
12
13
|
contactType: string,
|
@@ -17,15 +18,15 @@ type ContactItem = {
|
|
17
18
|
type PersonContactProps = {
|
18
19
|
aria?: { [key: string]: string },
|
19
20
|
className?: string | string[],
|
20
|
-
data?:
|
21
|
+
data?: GenericObject,
|
21
22
|
firstName: string,
|
22
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
23
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
23
24
|
id?: string,
|
24
25
|
lastName: string,
|
25
26
|
contacts?: ContactItem[],
|
26
27
|
}
|
27
28
|
|
28
|
-
const PersonContact = (props: PersonContactProps) => {
|
29
|
+
const PersonContact = (props: PersonContactProps): React.ReactElement => {
|
29
30
|
const {
|
30
31
|
aria = {},
|
31
32
|
className,
|
@@ -60,35 +61,35 @@ const PersonContact = (props: PersonContactProps) => {
|
|
60
61
|
|
61
62
|
return (
|
62
63
|
<div
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
64
|
+
{...ariaProps}
|
65
|
+
{...dataProps}
|
66
|
+
{...htmlProps}
|
67
|
+
className={classes}
|
68
|
+
id={id}
|
68
69
|
>
|
69
70
|
<Person
|
70
|
-
|
71
|
-
|
71
|
+
firstName={firstName}
|
72
|
+
lastName={lastName}
|
72
73
|
/>
|
73
74
|
{validContacts().map((contactObject, index) => (
|
74
75
|
<Contact
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
76
|
+
contactDetail={contactObject.contactDetail}
|
77
|
+
contactType={contactObject.contactType}
|
78
|
+
contactValue={contactObject.contactValue}
|
79
|
+
key={`valid-contact-${index}`}
|
79
80
|
/>
|
80
81
|
))}
|
81
82
|
{wrongContacts().map((contactObject, index) => (
|
82
83
|
<div key={`wrong-contact-caption-wrapper-${index}`}>
|
83
84
|
<Caption
|
84
|
-
|
85
|
-
|
86
|
-
|
85
|
+
className="wrong_numbers"
|
86
|
+
key={`wrong-contact-caption-${index}`}
|
87
|
+
text="wrong number"
|
87
88
|
/>
|
88
89
|
<Contact
|
89
|
-
|
90
|
-
|
91
|
-
|
90
|
+
contactType={contactObject.contactType}
|
91
|
+
contactValue={contactObject.contactValue}
|
92
|
+
key={`wrong-contact-${index}`}
|
92
93
|
/>
|
93
94
|
</div>
|
94
95
|
))}
|
@@ -25,7 +25,7 @@ type PhoneNumberInputProps = {
|
|
25
25
|
data?: { [key: string]: string },
|
26
26
|
disabled?: boolean,
|
27
27
|
error?: string,
|
28
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
28
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
29
29
|
id?: string,
|
30
30
|
initialCountry?: string,
|
31
31
|
isValid?: (valid: boolean) => void,
|
@@ -62,6 +62,7 @@ const formatAllCountries = () => {
|
|
62
62
|
formatAllCountries()
|
63
63
|
|
64
64
|
const containOnlyNumbers = (value: string) => {
|
65
|
+
// eslint-disable-next-line no-useless-escape
|
65
66
|
return /^[()+\-\ .\d]*$/g.test(value)
|
66
67
|
}
|
67
68
|
|
@@ -259,9 +260,9 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.MutableRefOb
|
|
259
260
|
if (required) textInputProps.required = true
|
260
261
|
|
261
262
|
return (
|
262
|
-
<div
|
263
|
-
|
264
|
-
|
263
|
+
<div
|
264
|
+
{...wrapperProps}
|
265
|
+
{...htmlProps}
|
265
266
|
>
|
266
267
|
<TextInput
|
267
268
|
ref={
|
@@ -9,7 +9,7 @@ type PillProps = {
|
|
9
9
|
aria?: {[key: string]: string},
|
10
10
|
className?: string,
|
11
11
|
data?: {[key: string]: string},
|
12
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
12
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
13
13
|
id?: string,
|
14
14
|
text: string,
|
15
15
|
variant?: "success" | "warning" | "error" | "info" | "neutral" | "primary",
|
@@ -1,3 +1,4 @@
|
|
1
|
+
/* eslint-disable react/no-multi-comp */
|
1
2
|
import React, { useEffect, useState } from "react";
|
2
3
|
import ReactDOM from "react-dom";
|
3
4
|
import {
|
@@ -25,7 +26,7 @@ type PbPopoverProps = {
|
|
25
26
|
className?: string;
|
26
27
|
closeOnClick?: "outside" | "inside" | "any";
|
27
28
|
data?: { [key: string]: string },
|
28
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
29
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
29
30
|
id?: string;
|
30
31
|
offset?: boolean;
|
31
32
|
reference: PopperReference & any;
|
@@ -54,7 +55,7 @@ const popoverModifiers = ({
|
|
54
55
|
offset,
|
55
56
|
}: {
|
56
57
|
modifiers: Modifier<any> & any;
|
57
|
-
offset:
|
58
|
+
offset: boolean;
|
58
59
|
}) => {
|
59
60
|
return offset ? modifiers.concat([POPOVER_MODIFIERS.offset]) : modifiers;
|
60
61
|
};
|
@@ -143,7 +144,7 @@ const Popover = (props: PbPopoverProps) => {
|
|
143
144
|
);
|
144
145
|
};
|
145
146
|
|
146
|
-
const PbReactPopover = (props: PbPopoverProps) => {
|
147
|
+
const PbReactPopover = (props: PbPopoverProps): React.ReactElement => {
|
147
148
|
const [targetId] = useState(_uniqueId('id-'))
|
148
149
|
const {
|
149
150
|
className,
|
@@ -226,9 +227,10 @@ const PbReactPopover = (props: PbPopoverProps) => {
|
|
226
227
|
<PopperReference>
|
227
228
|
{({ ref }) => (
|
228
229
|
<span
|
229
|
-
id={"reference-" + targetId}
|
230
230
|
className="pb_popover_reference_wrapper"
|
231
|
-
|
231
|
+
id={"reference-" + targetId}
|
232
|
+
ref={ref}
|
233
|
+
>
|
232
234
|
<reference.type {...reference.props} />
|
233
235
|
</span>
|
234
236
|
)}
|
@@ -13,13 +13,21 @@ type ProgressPillsProps = {
|
|
13
13
|
className?: string,
|
14
14
|
data?: { [key: string]: string },
|
15
15
|
dark?: boolean,
|
16
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
16
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
17
17
|
id?: string,
|
18
18
|
steps?: number,
|
19
19
|
title?: string,
|
20
20
|
value?: string,
|
21
21
|
}
|
22
22
|
|
23
|
+
const ProgressPill = ({ active, dark, steps: step }: ProgressPillsProps) => (
|
24
|
+
<div
|
25
|
+
className={`pb_progress_pill${step <= active ? '_active' : '_inactive'}${dark ? ' dark' : ''
|
26
|
+
}`}
|
27
|
+
key={step}
|
28
|
+
/>
|
29
|
+
)
|
30
|
+
|
23
31
|
const showSteps = (steps: number, active: number, dark: boolean) => {
|
24
32
|
const items = []
|
25
33
|
|
@@ -30,14 +38,6 @@ const showSteps = (steps: number, active: number, dark: boolean) => {
|
|
30
38
|
return items
|
31
39
|
}
|
32
40
|
|
33
|
-
const ProgressPill = ({ active, dark, steps: step }: ProgressPillsProps) => (
|
34
|
-
<div
|
35
|
-
className={`pb_progress_pill${step <= active ? '_active' : '_inactive'}${dark ? ' dark' : ''
|
36
|
-
}`}
|
37
|
-
key={step}
|
38
|
-
/>
|
39
|
-
)
|
40
|
-
|
41
41
|
const ProgressPills = (props: ProgressPillsProps) => {
|
42
42
|
const {
|
43
43
|
active = 0,
|
@@ -59,24 +59,24 @@ const ProgressPills = (props: ProgressPillsProps) => {
|
|
59
59
|
|
60
60
|
return (
|
61
61
|
<div
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
62
|
+
{...ariaProps}
|
63
|
+
{...dataProps}
|
64
|
+
{...htmlProps}
|
65
|
+
className={classes}
|
66
|
+
id={id}
|
67
67
|
>
|
68
68
|
{title &&
|
69
69
|
<div className="progress_pills_status">
|
70
70
|
<Title
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
71
|
+
dark={dark}
|
72
|
+
size={4}
|
73
|
+
tag="h4"
|
74
|
+
text={title}
|
75
75
|
/>
|
76
76
|
<Body
|
77
|
-
|
78
|
-
|
79
|
-
|
77
|
+
color="light"
|
78
|
+
dark={dark}
|
79
|
+
text={value}
|
80
80
|
/>
|
81
81
|
</div>}
|
82
82
|
<div className="progress_pills">{showSteps(steps, active, dark)}</div>
|
@@ -8,7 +8,7 @@ type ProgressSimpleProps = {
|
|
8
8
|
className?: string | string[],
|
9
9
|
dark?: boolean,
|
10
10
|
data?: string,
|
11
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
11
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
12
12
|
id?: string,
|
13
13
|
max?: number,
|
14
14
|
muted: boolean,
|
@@ -18,7 +18,7 @@ type ProgressSimpleProps = {
|
|
18
18
|
width: string,
|
19
19
|
}
|
20
20
|
|
21
|
-
const ProgressSimple = (props: ProgressSimpleProps) => {
|
21
|
+
const ProgressSimple = (props: ProgressSimpleProps): React.ReactElement => {
|
22
22
|
const {
|
23
23
|
align,
|
24
24
|
className,
|
@@ -57,9 +57,9 @@ const ProgressSimple = (props: ProgressSimpleProps) => {
|
|
57
57
|
|
58
58
|
return (
|
59
59
|
<div
|
60
|
-
|
61
|
-
|
62
|
-
|
60
|
+
{...dataProps}
|
61
|
+
{...htmlProps}
|
62
|
+
className={wrapperClass}
|
63
63
|
>
|
64
64
|
<div
|
65
65
|
className={kitClass}
|
@@ -7,7 +7,7 @@ type ProgressStepProps = {
|
|
7
7
|
aria?: { [key: string]: string },
|
8
8
|
className?: string,
|
9
9
|
data?: { [key: string]: string },
|
10
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
10
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
11
11
|
id?: string,
|
12
12
|
children?: React.ReactChild[] | React.ReactChild,
|
13
13
|
orientation?: "horizontal" | "vertical",
|
@@ -10,7 +10,7 @@ type ProgressStepItemProps = {
|
|
10
10
|
data?: { [key: string]: string },
|
11
11
|
status?: "complete" | "active" | "inactive" | "hidden",
|
12
12
|
children?: React.ReactNode | React.ReactNode[],
|
13
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
13
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
14
14
|
icon?: string,
|
15
15
|
}
|
16
16
|
|
@@ -15,7 +15,7 @@ type RadioProps = {
|
|
15
15
|
dark?: boolean,
|
16
16
|
data?: {[key: string]: string},
|
17
17
|
error?: boolean,
|
18
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
18
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
19
19
|
id?: string,
|
20
20
|
label: string,
|
21
21
|
name?: string,
|
@@ -7,7 +7,7 @@ import Tooltip from "../../pb_tooltip/_tooltip";
|
|
7
7
|
|
8
8
|
type EditorButtonProps = {
|
9
9
|
classname?: string,
|
10
|
-
onclick?: () =>
|
10
|
+
onclick?: () => undefined | void,
|
11
11
|
icon?: string;
|
12
12
|
text?: string;
|
13
13
|
disable?: boolean
|
@@ -19,29 +19,31 @@ const EditorButton = ({
|
|
19
19
|
onclick,
|
20
20
|
icon,
|
21
21
|
text,
|
22
|
-
}: EditorButtonProps) => {
|
22
|
+
}: EditorButtonProps): React.ReactElement => {
|
23
23
|
return (
|
24
|
-
<Tooltip
|
25
|
-
|
24
|
+
<Tooltip
|
25
|
+
delay={{
|
26
26
|
open: 2000
|
27
27
|
}}
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
interaction
|
29
|
+
placement="top"
|
30
|
+
text={text}
|
31
31
|
>
|
32
32
|
<button
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
33
|
+
className={classname}
|
34
|
+
disabled={disable}
|
35
|
+
onClick={onclick}
|
36
|
+
role="button"
|
37
|
+
type="button"
|
38
38
|
>
|
39
|
-
<Flex
|
40
|
-
|
41
|
-
|
42
|
-
|
39
|
+
<Flex
|
40
|
+
align="center"
|
41
|
+
className="toolbar_button_icon"
|
42
|
+
justify="center"
|
43
43
|
>
|
44
|
-
<Icon icon={icon}
|
44
|
+
<Icon icon={icon}
|
45
|
+
size="lg"
|
46
|
+
/>
|
45
47
|
</Flex>
|
46
48
|
</button>
|
47
49
|
</Tooltip>
|
@@ -20,17 +20,19 @@ const MoreExtensionsDropdown = ({extensions}: any) => {
|
|
20
20
|
|
21
21
|
const popoverReference = (
|
22
22
|
<button
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
className="toolbar_button"
|
24
|
+
onClick={handleTogglePopover}
|
25
|
+
role="button"
|
26
|
+
type="button"
|
27
27
|
>
|
28
28
|
<Flex
|
29
|
-
|
30
|
-
|
31
|
-
|
29
|
+
align="center"
|
30
|
+
className="toolbar_button_icon"
|
31
|
+
justify="center"
|
32
32
|
>
|
33
|
-
<Icon icon="ellipsis"
|
33
|
+
<Icon icon="ellipsis"
|
34
|
+
size="lg"
|
35
|
+
/>
|
34
36
|
</Flex>
|
35
37
|
</button>
|
36
38
|
|
@@ -46,21 +48,21 @@ const popoverReference = (
|
|
46
48
|
show={showPopover}
|
47
49
|
>
|
48
50
|
<Nav
|
49
|
-
|
50
|
-
|
51
|
-
|
51
|
+
paddingBottom={extensions.length > 1 ? "xs" : "none"}
|
52
|
+
paddingTop={extensions.length > 1 ? "xs" : "none"}
|
53
|
+
variant="subtle"
|
52
54
|
>
|
53
|
-
{extensions && extensions.map(({ icon, text, onclick, isActive}:any, index:number) => (
|
55
|
+
{extensions && extensions.map(({ icon, text, onclick, isActive}: any, index: number) => (
|
54
56
|
<NavItem
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
57
|
+
className={`pb_tiptap_toolbar_dropdown_list_item ${isActive ? "is-active" : ""}`}
|
58
|
+
cursor="pointer"
|
59
|
+
iconLeft={icon}
|
60
|
+
key={`${text}_${index}`}
|
61
|
+
margin='none'
|
62
|
+
onClick={()=> {onclick(); setShowPopover(false)}}
|
63
|
+
paddingBottom='xxs'
|
64
|
+
paddingTop='xxs'
|
65
|
+
text={text}
|
64
66
|
/>
|
65
67
|
))}
|
66
68
|
</Nav>
|