playbook_ui 14.16.0.pre.rc.6 → 14.17.0.pre.alpha.PBNTR920emojipickerpoc7130
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/Utilities/types.ts +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +104 -2
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +168 -85
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +10 -0
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +20 -7
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_fullscreen.jsx +90 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_fullscreen.md +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.jsx +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.html.erb +39 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.html.erb +33 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows_rails.md +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.md +6 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +4 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_advanced_table/index.js +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +4 -2
- data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +19 -9
- data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +38 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +49 -37
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +39 -0
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +1 -1
- data/app/pb_kits/playbook/pb_button/_button.scss +5 -5
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +1 -1
- data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +14 -7
- data/app/pb_kits/playbook/pb_contact/contact.test.js +7 -7
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +34 -34
- data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +2 -2
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +16 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_inline.html.erb +0 -11
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_inline.jsx +0 -7
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_inline_styles.scss +28 -24
- data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.test.js +2 -2
- data/app/pb_kits/playbook/pb_date_range_stacked/date_range_stacked.test.js +1 -1
- data/app/pb_kits/playbook/pb_draggable/_draggable.scss +115 -5
- data/app/pb_kits/playbook/pb_draggable/_draggable.tsx +6 -4
- data/app/pb_kits/playbook/pb_draggable/context/index.tsx +91 -24
- data/app/pb_kits/playbook/pb_draggable/context/types.ts +35 -28
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.jsx +184 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones.md +5 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.jsx +97 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_drop_zones_colors.md +1 -0
- data/app/pb_kits/playbook/pb_draggable/draggable.test.jsx +3 -3
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableContainer.tsx +11 -2
- data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableItem.tsx +65 -6
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.html.erb +3 -0
- data/app/pb_kits/playbook/pb_drawer/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete.jsx +6 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_autocomplete_and_custom_display.jsx +6 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.jsx +6 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.html.erb +8 -8
- data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +3 -3
- data/app/pb_kits/playbook/pb_filter/Filter/CurrentFilters.tsx +3 -4
- data/app/pb_kits/playbook/pb_filter/Filter/SortMenu.tsx +2 -2
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.scss +2 -2
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +67 -0
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +67 -0
- data/app/pb_kits/playbook/pb_form/pb_form_validation.js +1 -1
- data/app/pb_kits/playbook/pb_form_group/_form_group.scss +22 -0
- data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +1 -1
- data/app/pb_kits/playbook/pb_icon/_icon.scss +8 -1
- data/app/pb_kits/playbook/pb_icon/docs/_icon_color.html.erb +10 -4
- data/app/pb_kits/playbook/pb_icon/docs/_icon_color.jsx +49 -24
- data/app/pb_kits/playbook/pb_icon/icon.test.js +9 -9
- data/app/pb_kits/playbook/pb_icon_button/_icon_button.tsx +4 -1
- data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_click.jsx +13 -0
- data/app/pb_kits/playbook/pb_icon_button/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_icon_button/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_icon_circle/icon_circle.test.js +1 -1
- data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.test.js +1 -1
- data/app/pb_kits/playbook/pb_icon_value/icon_value.test.js +1 -1
- data/app/pb_kits/playbook/pb_label_value/label_value.test.js +1 -1
- data/app/pb_kits/playbook/pb_layout/_layout.scss +58 -0
- data/app/pb_kits/playbook/pb_layout/_layout.tsx +20 -7
- data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.jsx +190 -0
- data/app/pb_kits/playbook/pb_layout/docs/_layout_bracket.md +5 -0
- data/app/pb_kits/playbook/pb_layout/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_layout/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_layout/layout.test.js +4 -0
- data/app/pb_kits/playbook/pb_layout/subcomponents/_game.tsx +90 -0
- data/app/pb_kits/playbook/pb_layout/subcomponents/_round.tsx +57 -0
- data/app/pb_kits/playbook/pb_lightbox/Carousel/Slide.tsx +1 -1
- data/app/pb_kits/playbook/pb_lightbox/Carousel/Slides.tsx +1 -1
- data/app/pb_kits/playbook/pb_lightbox/Carousel/Thumbnails.tsx +1 -1
- data/app/pb_kits/playbook/pb_lightbox/hooks/useVisibility.js +1 -1
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +1 -1
- data/app/pb_kits/playbook/pb_link/link.test.jsx +2 -2
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.scss +23 -0
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +28 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_error.html.erb +72 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_error.jsx +97 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_label.html.erb +71 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_label.jsx +91 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +3 -1
- data/app/pb_kits/playbook/pb_multi_level_select/index.js +105 -0
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb +10 -0
- data/app/pb_kits/playbook/pb_nav/_nav.scss +5 -0
- data/app/pb_kits/playbook/pb_nav/_nav_item.test.js +5 -3
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +29 -11
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.html.erb +4 -4
- data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb +2 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_vertical.md +1 -0
- data/app/pb_kits/playbook/pb_stat_change/stat_change.test.js +8 -4
- data/app/pb_kits/playbook/pb_table/_table.tsx +4 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless.jsx +50 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_borderless_react.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating.jsx +59 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_with_header_style_floating_react.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_table/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_table/styles/_headers.scss +76 -0
- data/app/pb_kits/playbook/pb_table/styles/_striped.scss +3 -3
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_head.tsx +11 -1
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_header.tsx +11 -1
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +5 -0
- data/app/pb_kits/playbook/pb_table/table.test.js +17 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_emoji_picker.jsx +371 -0
- data/app/pb_kits/playbook/pb_text_input/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_text_input/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_tooltip/index.js +183 -56
- data/app/pb_kits/playbook/pb_tooltip/tooltip.html.erb +2 -5
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +1 -1
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +4 -0
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +3 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_disabled.html.erb +19 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_disabled.jsx +23 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.jsx +4 -4
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_typeahead/index.ts +2 -2
- data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +2 -5
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +3 -0
- data/app/pb_kits/playbook/pb_user/_user.tsx +78 -13
- data/app/pb_kits/playbook/pb_user/docs/_user_font_options.html.erb +22 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_font_options.jsx +40 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_font_options_rails.md +5 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_font_options_react.md +5 -0
- data/app/pb_kits/playbook/pb_user/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_user/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_user/user.html.erb +28 -12
- data/app/pb_kits/playbook/pb_user/user.rb +17 -1
- data/app/pb_kits/playbook/pb_user/user.test.js +182 -1
- data/app/pb_kits/playbook/pb_user_badge/user_badge.html.erb +1 -6
- data/app/pb_kits/playbook/tokens/_colors.scss +1 -4
- data/app/pb_kits/playbook/utilities/globalProps.ts +1 -1
- data/app/pb_kits/playbook/utilities/object.test.js +287 -1
- data/app/pb_kits/playbook/utilities/object.ts +171 -3
- data/app/pb_kits/playbook/utilities/text.ts +1 -1
- data/dist/chunks/_typeahead-7W5Ha5Td.js +22 -0
- data/dist/chunks/_weekday_stacked-DSKatW3m.js +45 -0
- data/dist/chunks/lib-BGzBzFZX.js +29 -0
- data/dist/chunks/{pb_form_validation-BvDxpfs-.js → pb_form_validation-BvNy9Bd6.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- 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/forms/builder/multi_level_select_field.rb +2 -0
- data/lib/playbook/kit_base.rb +4 -4
- data/lib/playbook/version.rb +2 -2
- metadata +40 -9
- data/app/pb_kits/playbook/pb_tooltip/floating_ui.js +0 -282
- data/dist/chunks/_typeahead-CRAPc8k-.js +0 -22
- data/dist/chunks/_weekday_stacked-T0kFfioG.js +0 -45
- data/dist/chunks/lib-BeKPJYlk.js +0 -29
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows_no_subrows.md → _advanced_table_selectable_rows_no_subrows_react.md} +0 -0
- /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_selectable_rows.md → _advanced_table_selectable_rows_react.md} +0 -0
@@ -1,11 +1,8 @@
|
|
1
|
-
<%=
|
2
|
-
id: object.id,
|
3
|
-
data: object.data,
|
4
|
-
class: object.classname,
|
1
|
+
<%= pb_content_tag(:div,
|
5
2
|
style: remove_height_properties(combined_html_options[:style]) || "",
|
6
3
|
**combined_html_options.except(:style)) do %>
|
7
4
|
<div class="tooltip_tooltip" id="<%= object.tooltip_id %>" role="tooltip" style="<%= object.height_and_width_helper %>">
|
8
5
|
<%= content.presence %>
|
9
6
|
<div class="arrow" id="<%= object.tooltip_id %>-arrow"></div>
|
10
7
|
</div>
|
11
|
-
<% end %>
|
8
|
+
<% end %>
|
@@ -10,7 +10,7 @@ import { highchartsTheme } from "../pb_dashboard/pbChartsLightTheme";
|
|
10
10
|
import { highchartsDarkTheme } from "../pb_dashboard/pbChartsDarkTheme";
|
11
11
|
import mapColors from "../pb_dashboard/pbChartsColorsHelper";
|
12
12
|
import treemap from 'highcharts/modules/treemap'
|
13
|
-
import { merge } from '
|
13
|
+
import { merge } from '../utilities/object'
|
14
14
|
|
15
15
|
type TreemapChartProps = {
|
16
16
|
chartData: {
|
@@ -126,6 +126,9 @@
|
|
126
126
|
color: $text_lt_default;
|
127
127
|
}
|
128
128
|
&__control {
|
129
|
+
&--is-disabled {
|
130
|
+
background-color: shade($white, 5%);
|
131
|
+
}
|
129
132
|
&--is-focused {
|
130
133
|
@include pb_textarea_focus;
|
131
134
|
@include transition_default;
|
@@ -252,6 +255,7 @@
|
|
252
255
|
color: $text_dk_default;
|
253
256
|
}
|
254
257
|
&__control {
|
258
|
+
|
255
259
|
&--is-focused {
|
256
260
|
@include pb_textarea_focus;
|
257
261
|
@include transition_default;
|
@@ -38,6 +38,7 @@ type TypeaheadProps = {
|
|
38
38
|
createable?: boolean,
|
39
39
|
dark?: boolean,
|
40
40
|
data?: { [key: string]: string },
|
41
|
+
disabled?: boolean,
|
41
42
|
error?: string,
|
42
43
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
43
44
|
id?: string,
|
@@ -79,6 +80,7 @@ const Typeahead = forwardRef<HTMLInputElement, TypeaheadProps>(({
|
|
79
80
|
createable,
|
80
81
|
error = "",
|
81
82
|
data = {},
|
83
|
+
disabled = false,
|
82
84
|
getOptionLabel,
|
83
85
|
getOptionValue,
|
84
86
|
htmlOptions = {},
|
@@ -205,6 +207,7 @@ const Typeahead = forwardRef<HTMLInputElement, TypeaheadProps>(({
|
|
205
207
|
<Tag
|
206
208
|
classNamePrefix="typeahead-kit-select"
|
207
209
|
error={error}
|
210
|
+
isDisabled={disabled}
|
208
211
|
onChange={handleOnChange}
|
209
212
|
{...selectProps}
|
210
213
|
/>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<%
|
2
|
+
options = [
|
3
|
+
{ label: 'Orange', value: '#FFA500' },
|
4
|
+
{ label: 'Red', value: '#FF0000' },
|
5
|
+
{ label: 'Green', value: '#00FF00' },
|
6
|
+
{ label: 'Blue', value: '#0000FF' },
|
7
|
+
]
|
8
|
+
%>
|
9
|
+
|
10
|
+
<%= pb_rails("typeahead", props: {
|
11
|
+
id: "typeahead-disabled",
|
12
|
+
disabled: true,
|
13
|
+
placeholder: "All Colors",
|
14
|
+
options: options,
|
15
|
+
label: "Colors",
|
16
|
+
name: :foo,
|
17
|
+
is_multi: false
|
18
|
+
})
|
19
|
+
%>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
|
3
|
+
import Typeahead from '../_typeahead'
|
4
|
+
|
5
|
+
const options = [
|
6
|
+
{ label: 'Orange', value: '#FFA500' },
|
7
|
+
{ label: 'Red', value: '#FF0000' },
|
8
|
+
{ label: 'Green', value: '#00FF00' },
|
9
|
+
{ label: 'Blue', value: '#0000FF' },
|
10
|
+
]
|
11
|
+
|
12
|
+
const TypeaheadDisabled = (props) => {
|
13
|
+
return (
|
14
|
+
<Typeahead
|
15
|
+
disabled
|
16
|
+
label="Colors"
|
17
|
+
options={options}
|
18
|
+
{...props}
|
19
|
+
/>
|
20
|
+
)
|
21
|
+
}
|
22
|
+
|
23
|
+
export default TypeaheadDisabled
|
@@ -18,18 +18,18 @@ const USERS = [
|
|
18
18
|
territory: "PHL",
|
19
19
|
},
|
20
20
|
{
|
21
|
-
name: "
|
22
|
-
title: "
|
21
|
+
name: "Carlos Lima",
|
22
|
+
title: "Nitro Developer",
|
23
23
|
territory: "PHL",
|
24
24
|
},
|
25
25
|
{
|
26
26
|
name: "Stephen Marshall",
|
27
|
-
title: "Senior
|
27
|
+
title: "Senior Nitro Developer",
|
28
28
|
territory: "PHL",
|
29
29
|
},
|
30
30
|
{
|
31
31
|
name: "Jasper Furniss",
|
32
|
-
title: "
|
32
|
+
title: "Lead User Experience Engineer",
|
33
33
|
territory: "PHL",
|
34
34
|
},
|
35
35
|
];
|
@@ -14,6 +14,7 @@ examples:
|
|
14
14
|
- typeahead_truncated_text: Truncated Text
|
15
15
|
- typeahead_dynamic_options: Dynamic Options
|
16
16
|
- typeahead_dynamic_options_pure_rails: Dynamic Options (Pure Rails)
|
17
|
+
- typeahead_disabled: Disabled
|
17
18
|
|
18
19
|
react:
|
19
20
|
- typeahead_default: Default
|
@@ -32,3 +33,4 @@ examples:
|
|
32
33
|
- typeahead_margin_bottom: Margin Bottom
|
33
34
|
- typeahead_with_pills_color: With Pills (Custom Color)
|
34
35
|
- typeahead_truncated_text: Truncated Text
|
36
|
+
- typeahead_disabled: Disabled
|
@@ -14,3 +14,4 @@ export { default as TypeaheadMarginBottom } from './_typeahead_margin_bottom.jsx
|
|
14
14
|
export { default as TypeaheadWithPillsColor } from './_typeahead_with_pills_color.jsx'
|
15
15
|
export { default as TypeaheadTruncatedText } from './_typeahead_truncated_text.jsx'
|
16
16
|
export { default as TypeaheadReactHook } from './_typeahead_react_hook.jsx'
|
17
|
+
export { default as TypeaheadDisabled } from './_typeahead_disabled.jsx'
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import PbEnhancedElement from '../pb_enhanced_element'
|
2
|
-
import { debounce } from '
|
2
|
+
import { debounce } from '../utilities/object'
|
3
3
|
|
4
4
|
export default class PbTypeahead extends PbEnhancedElement {
|
5
5
|
_searchInput: HTMLInputElement
|
@@ -284,4 +284,4 @@ export default class PbTypeahead extends PbEnhancedElement {
|
|
284
284
|
if (visible) visibilityProperty = '1'
|
285
285
|
this.resultsLoadingIndicator.style.opacity = visibilityProperty
|
286
286
|
}
|
287
|
-
}
|
287
|
+
}
|
@@ -1,11 +1,8 @@
|
|
1
1
|
<% if object.is_react? %>
|
2
2
|
<%= react_component('Typeahead', object.typeahead_react_options) %>
|
3
3
|
<% else %>
|
4
|
-
<%=
|
5
|
-
|
6
|
-
data: object.data,
|
7
|
-
class: object.classname + object.inline_class,
|
8
|
-
**combined_html_options) do %>
|
4
|
+
<%= pb_content_tag(:div,
|
5
|
+
class: object.classname + object.inline_class) do %>
|
9
6
|
<div class="pb_typeahead_wrapper">
|
10
7
|
<div class="pb_typeahead_loading_indicator" data-pb-typeahead-kit-loading-indicator>
|
11
8
|
<%= pb_rails("icon", props: {
|
@@ -52,6 +52,8 @@ module Playbook
|
|
52
52
|
default: {}
|
53
53
|
prop :search_context_selector, type: Playbook::Props::String,
|
54
54
|
default: nil
|
55
|
+
prop :disabled, type: Playbook::Props::Boolean,
|
56
|
+
default: false
|
55
57
|
|
56
58
|
def classname
|
57
59
|
default_margin_bottom = margin_bottom.present? ? "" : " mb_sm"
|
@@ -100,6 +102,7 @@ module Playbook
|
|
100
102
|
searchContextSelector: search_context_selector,
|
101
103
|
optionsByContext: options_by_context,
|
102
104
|
clearOnContextChange: clear_on_context_change,
|
105
|
+
disabled: disabled,
|
103
106
|
}
|
104
107
|
|
105
108
|
base_options[:getOptionLabel] = get_option_label if get_option_label.present?
|
@@ -7,6 +7,8 @@ import { GlobalProps, globalProps } from '../utilities/globalProps'
|
|
7
7
|
import Avatar from '../pb_avatar/_avatar'
|
8
8
|
import Body from '../pb_body/_body'
|
9
9
|
import Title from '../pb_title/_title'
|
10
|
+
import Caption from '../pb_caption/_caption'
|
11
|
+
import Detail from '../pb_detail/_detail'
|
10
12
|
|
11
13
|
type UserProps = {
|
12
14
|
align?: "left" | "center" | "right",
|
@@ -20,11 +22,13 @@ type UserProps = {
|
|
20
22
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
21
23
|
id?: string,
|
22
24
|
name?: string,
|
25
|
+
nameStyle?: "title" | "body" | "caption" | "detail"
|
23
26
|
orientation?: "horizontal" | "vertical",
|
24
27
|
size?: "sm" | "md" | "lg",
|
25
28
|
subtitle?: string | Array<Node> | Node,
|
26
29
|
territory?: string,
|
27
30
|
title?: string,
|
31
|
+
titleStyle?: "title" | "body" | "caption" | "detail",
|
28
32
|
} & GlobalProps
|
29
33
|
|
30
34
|
const User = (props: UserProps): React.ReactElement => {
|
@@ -40,11 +44,13 @@ const User = (props: UserProps): React.ReactElement => {
|
|
40
44
|
htmlOptions = {},
|
41
45
|
id,
|
42
46
|
name,
|
47
|
+
nameStyle = 'title',
|
43
48
|
orientation = 'horizontal',
|
44
49
|
size = 'sm',
|
45
50
|
subtitle,
|
46
51
|
territory = '',
|
47
52
|
title = '',
|
53
|
+
titleStyle = 'body',
|
48
54
|
} = props
|
49
55
|
|
50
56
|
const dataProps: {[key: string]: string} = buildDataProps(data)
|
@@ -58,6 +64,76 @@ const User = (props: UserProps): React.ReactElement => {
|
|
58
64
|
)
|
59
65
|
|
60
66
|
const avatarPresent = avatar || avatarUrl
|
67
|
+
const titleText = territory === '' ? title : `${territory} • ${title}`
|
68
|
+
|
69
|
+
const renderNameComponent = () => {
|
70
|
+
switch (nameStyle) {
|
71
|
+
case "title":
|
72
|
+
return (
|
73
|
+
<Title
|
74
|
+
bold={bold}
|
75
|
+
dark={dark}
|
76
|
+
size={size === "lg" ? 3 : 4}
|
77
|
+
text={name}
|
78
|
+
/>
|
79
|
+
);
|
80
|
+
case "body":
|
81
|
+
return (
|
82
|
+
<Body
|
83
|
+
dark={dark}
|
84
|
+
text={name}
|
85
|
+
/>
|
86
|
+
);
|
87
|
+
case "caption":
|
88
|
+
return (
|
89
|
+
<Caption
|
90
|
+
dark={dark}
|
91
|
+
size={size === "sm" ? "xs" : size}
|
92
|
+
text={name}
|
93
|
+
/>
|
94
|
+
);
|
95
|
+
case "detail":
|
96
|
+
return (
|
97
|
+
<Detail
|
98
|
+
dark={dark}
|
99
|
+
text={name}
|
100
|
+
/>
|
101
|
+
);
|
102
|
+
default:
|
103
|
+
return null;
|
104
|
+
}
|
105
|
+
};
|
106
|
+
|
107
|
+
const renderTitleComponent = () => {
|
108
|
+
switch (titleStyle) {
|
109
|
+
case "body":
|
110
|
+
return (
|
111
|
+
<Body
|
112
|
+
color="light"
|
113
|
+
dark={dark}
|
114
|
+
text={titleText}
|
115
|
+
variant={null}
|
116
|
+
/>
|
117
|
+
);
|
118
|
+
case "caption":
|
119
|
+
return (
|
120
|
+
<Caption
|
121
|
+
dark={dark}
|
122
|
+
size={size === "sm" ? "xs" : size}
|
123
|
+
text={titleText}
|
124
|
+
/>
|
125
|
+
);
|
126
|
+
case "detail":
|
127
|
+
return (
|
128
|
+
<Detail
|
129
|
+
dark={dark}
|
130
|
+
text={titleText}
|
131
|
+
/>
|
132
|
+
);
|
133
|
+
default:
|
134
|
+
return null;
|
135
|
+
}
|
136
|
+
};
|
61
137
|
|
62
138
|
return (
|
63
139
|
<div
|
@@ -76,19 +152,8 @@ const User = (props: UserProps): React.ReactElement => {
|
|
76
152
|
/>
|
77
153
|
}
|
78
154
|
<div className="content_wrapper">
|
79
|
-
|
80
|
-
|
81
|
-
dark={dark}
|
82
|
-
size={size == 'lg' ? 3 : 4}
|
83
|
-
text={name}
|
84
|
-
/>
|
85
|
-
<Body
|
86
|
-
color="light"
|
87
|
-
dark={dark}
|
88
|
-
variant={null}
|
89
|
-
>
|
90
|
-
{territory === '' ? title : `${territory} • ${title}`}
|
91
|
-
</Body>
|
155
|
+
{renderNameComponent()}
|
156
|
+
{renderTitleComponent()}
|
92
157
|
{ typeof(subtitle) === 'string' &&
|
93
158
|
<Body
|
94
159
|
color="light"
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<div class="pb--doc-demo-row">
|
2
|
+
<%= pb_rails("user", props: {
|
3
|
+
align: "left",
|
4
|
+
avatar_url: "https://randomuser.me/api/portraits/women/44.jpg",
|
5
|
+
name: "Anna Black",
|
6
|
+
name_style: "body",
|
7
|
+
orientation: "horizontal",
|
8
|
+
size: "md",
|
9
|
+
territory: "PHL",
|
10
|
+
title: "Remodeling Consultant"
|
11
|
+
}) %>
|
12
|
+
<%= pb_rails("user", props: {
|
13
|
+
align: "left",
|
14
|
+
avatar_url: "https://randomuser.me/api/portraits/women/44.jpg",
|
15
|
+
name: "Anna Black",
|
16
|
+
name_style: "detail",
|
17
|
+
orientation: "horizontal",
|
18
|
+
size: "md",
|
19
|
+
territory: "PHL",
|
20
|
+
title: "Remodeling Consultant"
|
21
|
+
}) %>
|
22
|
+
</div>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { User } from 'playbook-ui'
|
3
|
+
|
4
|
+
const UserFontOptions = (props) => {
|
5
|
+
return (
|
6
|
+
<div>
|
7
|
+
<div className="pb--doc-demo-row">
|
8
|
+
<div>
|
9
|
+
<User
|
10
|
+
align="center"
|
11
|
+
avatarUrl="https://randomuser.me/api/portraits/women/44.jpg"
|
12
|
+
name="Anna Black"
|
13
|
+
nameStyle= "body"
|
14
|
+
orientation="horizontal"
|
15
|
+
size= "md"
|
16
|
+
territory= "PHL"
|
17
|
+
title="Remodeling Consultant"
|
18
|
+
{...props}
|
19
|
+
/>
|
20
|
+
</div>
|
21
|
+
|
22
|
+
<div>
|
23
|
+
<User
|
24
|
+
align="left"
|
25
|
+
avatarUrl="https://randomuser.me/api/portraits/women/44.jpg"
|
26
|
+
name="Anna Black"
|
27
|
+
nameStyle= "detail"
|
28
|
+
orientation="horizontal"
|
29
|
+
size= "md"
|
30
|
+
territory= "PHL"
|
31
|
+
title= "Remodeling Consultant"
|
32
|
+
{...props}
|
33
|
+
/>
|
34
|
+
</div>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
)
|
38
|
+
}
|
39
|
+
|
40
|
+
export default UserFontOptions
|
@@ -0,0 +1,5 @@
|
|
1
|
+
Passing a `name_style` prop changes the type kit used for the user name. You can choose between `title`, `body`, `caption`, and `detail`. `title` is the default.
|
2
|
+
|
3
|
+
Passing a `title_style` prop changes the type kit used for the user title. You can choose between `body`, `caption`, and `detail`. `body` is the default.
|
4
|
+
|
5
|
+
The size of the `caption` is determined by the `size` prop.
|
@@ -0,0 +1,5 @@
|
|
1
|
+
Passing a `nameStyle` prop changes the type kit used for the user name. You can choose between `title`, `body`, `caption`, and `detail`. `title` is the default.
|
2
|
+
|
3
|
+
Passing a `titleStyle` prop changes the type kit used for the user title. You can choose between `body`, `caption`, and `detail`. `body` is the default.
|
4
|
+
|
5
|
+
The size of the `caption` is determined by the `size` prop.
|
@@ -9,6 +9,7 @@ examples:
|
|
9
9
|
- user_vertical_size: Vertical Size
|
10
10
|
- user_subtitle: Subtitle
|
11
11
|
- user_block_content_subtitle_rails: Block Content Subtitle
|
12
|
+
- user_font_options: Font Options
|
12
13
|
|
13
14
|
react:
|
14
15
|
- user_default: Default
|
@@ -19,6 +20,7 @@ examples:
|
|
19
20
|
- user_vertical_size: Vertical Size
|
20
21
|
- user_subtitle: Subtitle
|
21
22
|
- user_block_content_subtitle_react: Block Content Subtitle
|
23
|
+
- user_font_options: Font Options
|
22
24
|
|
23
25
|
swift:
|
24
26
|
- user_horizontal_swift: Horizontal
|
@@ -6,3 +6,4 @@ export { default as UserSize } from './_user_size.jsx'
|
|
6
6
|
export { default as UserVerticalSize } from './_user_vertical_size.jsx'
|
7
7
|
export { default as UserSubtitle } from './_user_subtitle.jsx'
|
8
8
|
export { default as UserBlockContentSubtitleReact } from './_user_block_content_subtitle_react.jsx'
|
9
|
+
export { default as UserFontOptions } from './_user_font_options.jsx'
|
@@ -1,9 +1,4 @@
|
|
1
|
-
<%=
|
2
|
-
aria: object.aria,
|
3
|
-
class: object.classname,
|
4
|
-
data: object.data,
|
5
|
-
id: object.id,
|
6
|
-
**combined_html_options) do %>
|
1
|
+
<%= pb_content_tag do %>
|
7
2
|
<% if object.avatar_url.present? || object.avatar %>
|
8
3
|
<%= pb_rails("avatar", props: {
|
9
4
|
name: object.name,
|
@@ -12,12 +7,33 @@
|
|
12
7
|
}) %>
|
13
8
|
<% end %>
|
14
9
|
<%= content_tag(:div, class: "content_wrapper") do %>
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
10
|
+
<% case object.name_style %>
|
11
|
+
<% when "title" %>
|
12
|
+
<%= pb_rails("title", props: { text: object.name, size: object.name_size, dark: object.dark, bold: object.bold }) %>
|
13
|
+
<% when "body" %>
|
14
|
+
<%= pb_rails("body", props: { text: object.name, dark: object.dark }) %>
|
15
|
+
<% when "caption" %>
|
16
|
+
<%= pb_rails("caption", props: { text: object.name, dark: object.dark, size: object.name_size }) %>
|
17
|
+
<% when "detail" %>
|
18
|
+
<%= pb_rails("detail", props: { text: object.name, dark: object.dark }) %>
|
19
|
+
<% end %>
|
20
|
+
<% case object.title_style %>
|
21
|
+
<% when "body" %>
|
22
|
+
<%= pb_rails("body", props: {
|
23
|
+
text: "#{object.details}",
|
24
|
+
dark: object.dark,
|
25
|
+
color: "light"
|
26
|
+
}) %>
|
27
|
+
<% when "caption" %>
|
28
|
+
<%= pb_rails("caption", props: {
|
29
|
+
text: "#{object.details}",
|
30
|
+
dark: object.dark,
|
31
|
+
color: "light",
|
32
|
+
size: object.title_size
|
33
|
+
}) %>
|
34
|
+
<% when "detail" %>
|
35
|
+
<%= pb_rails("detail", props: { text: "#{object.details}", dark: object.dark }) %>
|
36
|
+
<% end %>
|
21
37
|
<% if content %>
|
22
38
|
<%= content.presence %>
|
23
39
|
<% else %>
|
@@ -11,6 +11,9 @@ module Playbook
|
|
11
11
|
prop :avatar_url
|
12
12
|
prop :bold, type: Playbook::Props::Boolean, default: true
|
13
13
|
prop :name
|
14
|
+
prop :name_style, type: Playbook::Props::Enum,
|
15
|
+
values: %w[title body caption detail],
|
16
|
+
default: "title"
|
14
17
|
prop :orientation, type: Playbook::Props::Enum,
|
15
18
|
values: %w[vertical horizontal],
|
16
19
|
default: "horizontal"
|
@@ -19,6 +22,9 @@ module Playbook
|
|
19
22
|
default: "sm"
|
20
23
|
prop :subtitle
|
21
24
|
prop :title
|
25
|
+
prop :title_style, type: Playbook::Props::Enum,
|
26
|
+
values: %w[body caption detail],
|
27
|
+
default: "body"
|
22
28
|
prop :territory
|
23
29
|
|
24
30
|
def classname
|
@@ -36,8 +42,18 @@ module Playbook
|
|
36
42
|
end
|
37
43
|
end
|
38
44
|
|
45
|
+
def name_size
|
46
|
+
if name_style == "caption"
|
47
|
+
size == "sm" ? "xs" : size
|
48
|
+
else
|
49
|
+
size == "lg" ? 3 : 4
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
39
53
|
def title_size
|
40
|
-
|
54
|
+
if title_style == "caption"
|
55
|
+
size == "sm" ? "xs" : size
|
56
|
+
end
|
41
57
|
end
|
42
58
|
|
43
59
|
def details
|