playbook_ui 13.15.0.pre.alpha.play1141iconkitusinglibrary1956 → 13.15.0.pre.alpha.play10841940
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/pb_date_picker/date_picker_helper.ts +33 -40
- data/app/pb_kits/playbook/pb_date_picker/plugins/quickPick.tsx +4 -4
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +30 -44
- data/app/pb_kits/playbook/pb_flex/_flex.tsx +4 -4
- data/app/pb_kits/playbook/pb_form_group/_form_group.tsx +2 -3
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +4 -7
- data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +10 -10
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +9 -10
- data/app/pb_kits/playbook/pb_icon/_icon.tsx +5 -21
- data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.tsx +2 -3
- data/app/pb_kits/playbook/pb_icon_value/_icon_value.tsx +2 -3
- data/app/pb_kits/playbook/pb_label_value/_label_value.tsx +1 -1
- data/app/pb_kits/playbook/pb_layout/_layout.tsx +2 -1
- data/app/pb_kits/playbook/pb_layout/layout.test.js +8 -4
- data/app/pb_kits/playbook/pb_legend/_legend.tsx +6 -6
- data/app/pb_kits/playbook/pb_lightbox/Carousel/Slides.tsx +4 -4
- data/app/pb_kits/playbook/pb_lightbox/Carousel/Thumbnail.tsx +1 -1
- data/app/pb_kits/playbook/pb_lightbox/Carousel/index.tsx +3 -3
- data/app/pb_kits/playbook/pb_lightbox/Header/_lightbox_header.tsx +30 -22
- data/app/pb_kits/playbook/pb_lightbox/_lightbox.tsx +5 -5
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +4 -4
- data/app/pb_kits/playbook/pb_list/_list.tsx +15 -15
- data/app/pb_kits/playbook/pb_list/_list_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +9 -9
- data/app/pb_kits/playbook/pb_map/_map.tsx +8 -8
- data/app/pb_kits/playbook/pb_map/_map_controls.tsx +15 -7
- data/app/pb_kits/playbook/pb_map/_map_custom_button.tsx +4 -2
- data/app/pb_kits/playbook/pb_message/_message.tsx +1 -1
- data/app/pb_kits/playbook/pb_message/_message_mention.tsx +6 -6
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +46 -42
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +20 -20
- data/app/pb_kits/playbook/pb_nav/_item.tsx +56 -47
- data/app/pb_kits/playbook/pb_nav/_nav.tsx +15 -15
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.tsx +50 -51
- data/app/pb_kits/playbook/pb_person_contact/_person_contact.tsx +19 -20
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +3 -4
- data/app/pb_kits/playbook/pb_popover/_popover.tsx +4 -6
- data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.tsx +20 -20
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.tsx +4 -4
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/EditorButton.tsx +17 -19
- 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 +21 -23
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/Toolbar.tsx +10 -18
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarDropdown.tsx +23 -46
- 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 +15 -17
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.tsx +7 -9
- data/app/pb_kits/playbook/pb_select/_select.scss +4 -13
- data/app/pb_kits/playbook/pb_select/_select.tsx +4 -7
- data/app/pb_kits/playbook/pb_select/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_select/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_select/select.rb +1 -6
- data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.tsx +24 -25
- data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.tsx +26 -27
- data/app/pb_kits/playbook/pb_selectable_list/_selectable_list.tsx +1 -2
- data/app/pb_kits/playbook/pb_source/_source.tsx +15 -15
- data/dist/playbook-rails.js +4 -4
- data/lib/playbook/version.rb +1 -1
- metadata +2 -4
- data/app/pb_kits/playbook/pb_select/docs/_select_inline_show_arrow.html.erb +0 -24
- data/app/pb_kits/playbook/pb_select/docs/_select_inline_show_arrow.jsx +0 -38
@@ -18,7 +18,7 @@ type ProgressSimpleProps = {
|
|
18
18
|
width: string,
|
19
19
|
}
|
20
20
|
|
21
|
-
const ProgressSimple = (props: ProgressSimpleProps)
|
21
|
+
const ProgressSimple = (props: ProgressSimpleProps) => {
|
22
22
|
const {
|
23
23
|
align,
|
24
24
|
className,
|
@@ -57,9 +57,9 @@ const ProgressSimple = (props: ProgressSimpleProps): React.ReactElement => {
|
|
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 @@ import Tooltip from "../../pb_tooltip/_tooltip";
|
|
7
7
|
|
8
8
|
type EditorButtonProps = {
|
9
9
|
classname?: string,
|
10
|
-
onclick?: () =>
|
10
|
+
onclick?: () => {} | void,
|
11
11
|
icon?: string;
|
12
12
|
text?: string;
|
13
13
|
disable?: boolean
|
@@ -19,31 +19,29 @@ const EditorButton = ({
|
|
19
19
|
onclick,
|
20
20
|
icon,
|
21
21
|
text,
|
22
|
-
}: EditorButtonProps)
|
22
|
+
}: EditorButtonProps) => {
|
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}
|
45
|
-
size="lg"
|
46
|
-
/>
|
44
|
+
<Icon icon={icon} size="lg" />
|
47
45
|
</Flex>
|
48
46
|
</button>
|
49
47
|
</Tooltip>
|
@@ -20,19 +20,17 @@ 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"
|
34
|
-
size="lg"
|
35
|
-
/>
|
33
|
+
<Icon icon="ellipsis" size="lg" />
|
36
34
|
</Flex>
|
37
35
|
</button>
|
38
36
|
|
@@ -48,21 +46,21 @@ const popoverReference = (
|
|
48
46
|
show={showPopover}
|
49
47
|
>
|
50
48
|
<Nav
|
51
|
-
|
52
|
-
|
53
|
-
|
49
|
+
paddingTop={extensions.length > 1 ? "xs" : "none"}
|
50
|
+
paddingBottom={extensions.length > 1 ? "xs" : "none"}
|
51
|
+
variant="subtle"
|
54
52
|
>
|
55
|
-
{extensions && extensions.map(({ icon, text, onclick, isActive}:
|
53
|
+
{extensions && extensions.map(({ icon, text, onclick, isActive}:any, index:number) => (
|
56
54
|
<NavItem
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
55
|
+
cursor="pointer"
|
56
|
+
className={`pb_tiptap_toolbar_dropdown_list_item ${isActive ? "is-active" : ""}`}
|
57
|
+
iconLeft={icon}
|
58
|
+
key={`${text}_${index}`}
|
59
|
+
margin='none'
|
60
|
+
onClick={()=> {onclick(); setShowPopover(false)}}
|
61
|
+
text={text}
|
62
|
+
paddingTop='xxs'
|
63
|
+
paddingBottom='xxs'
|
66
64
|
/>
|
67
65
|
))}
|
68
66
|
</Nav>
|
@@ -11,7 +11,7 @@ import { ToolbarTypes } from "./EditorTypes";
|
|
11
11
|
import ToolbarHistoryItems from "./ToolbarHistory";
|
12
12
|
import MoreExtensionsDropdown from "./MoreExtensionsDropdown";
|
13
13
|
|
14
|
-
const EditorToolbar = ({ editor, extensions }:
|
14
|
+
const EditorToolbar = ({ editor, extensions }:any) => {
|
15
15
|
const toolbaritems = [
|
16
16
|
{
|
17
17
|
icon: "bold",
|
@@ -34,27 +34,19 @@ const EditorToolbar = ({ editor, extensions }: any): React.ReactElement => {
|
|
34
34
|
]
|
35
35
|
|
36
36
|
return (
|
37
|
-
<Background backgroundColor="white"
|
38
|
-
|
39
|
-
|
40
|
-
<Flex flex="0"
|
41
|
-
justify="between"
|
42
|
-
paddingX="sm"
|
43
|
-
paddingY="xxs"
|
44
|
-
>
|
45
|
-
<FlexItem className="toolbar_block"
|
46
|
-
displayFlex
|
47
|
-
>
|
37
|
+
<Background backgroundColor="white" className="toolbar">
|
38
|
+
<Flex flex="0" justify="between" paddingX="sm" paddingY="xxs">
|
39
|
+
<FlexItem className="toolbar_block" displayFlex>
|
48
40
|
<ToolbarDropdown editor={editor}/>
|
49
41
|
<SectionSeparator orientation="vertical" />
|
50
42
|
{toolbaritems && toolbaritems.map(
|
51
|
-
({ icon, text, classname, onclick}:
|
43
|
+
({ icon, text, classname, onclick}:ToolbarTypes, index:number) => (
|
52
44
|
<EditorButton
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
45
|
+
classname={classname}
|
46
|
+
icon={icon}
|
47
|
+
key={index}
|
48
|
+
text={text}
|
49
|
+
onclick={onclick}
|
58
50
|
/>
|
59
51
|
)
|
60
52
|
)}
|
@@ -9,7 +9,7 @@ import NavItem from '../../pb_nav/_item'
|
|
9
9
|
|
10
10
|
import { ToolbarTypes } from './EditorTypes'
|
11
11
|
|
12
|
-
const ToolbarDropdown = ({editor}: any)
|
12
|
+
const ToolbarDropdown = ({editor}: any) => {
|
13
13
|
const [showPopover, setShowPopover] = useState(false)
|
14
14
|
|
15
15
|
const toolbarDropdownItems = [
|
@@ -81,21 +81,11 @@ for (const { text, isActive, icon } of toolbarDropdownItems) {
|
|
81
81
|
if (isActive) {
|
82
82
|
activeCount ++
|
83
83
|
activeItems.push(
|
84
|
-
<Flex align="center"
|
85
|
-
|
86
|
-
key={icon}
|
87
|
-
>
|
88
|
-
<Icon icon={icon}
|
89
|
-
size="lg"
|
90
|
-
/>
|
84
|
+
<Flex align="center" key={icon} gap="xs">
|
85
|
+
<Icon icon={icon} size="lg" />
|
91
86
|
<div>{text}</div>
|
92
|
-
<Flex className={showPopover ? "fa-flip-vertical" : ""}
|
93
|
-
|
94
|
-
>
|
95
|
-
<Icon fixedWidth
|
96
|
-
icon="angle-down"
|
97
|
-
margin-left="xs"
|
98
|
-
/>
|
87
|
+
<Flex className={showPopover ? "fa-flip-vertical" : ""} display="inline_flex">
|
88
|
+
<Icon fixedWidth icon="angle-down" margin-left="xs" />
|
99
89
|
</Flex>
|
100
90
|
</Flex>
|
101
91
|
);
|
@@ -103,10 +93,7 @@ for (const { text, isActive, icon } of toolbarDropdownItems) {
|
|
103
93
|
}
|
104
94
|
|
105
95
|
const popoverReference = (
|
106
|
-
<Button className="editor-dropdown-button"
|
107
|
-
onClick={handleTogglePopover}
|
108
|
-
variant="secondary"
|
109
|
-
>
|
96
|
+
<Button className="editor-dropdown-button" onClick={handleTogglePopover} variant="secondary">
|
110
97
|
{
|
111
98
|
activeCount === 2 ? (
|
112
99
|
activeItems[1]
|
@@ -114,21 +101,11 @@ const popoverReference = (
|
|
114
101
|
activeCount === 1 ? (
|
115
102
|
activeItems[0] || null
|
116
103
|
) : (
|
117
|
-
<Flex align="center"
|
118
|
-
|
119
|
-
key="paragraph"
|
120
|
-
>
|
121
|
-
<Icon icon="paragraph"
|
122
|
-
size="lg"
|
123
|
-
/>
|
104
|
+
<Flex align="center" key="paragraph" gap="xs">
|
105
|
+
<Icon icon="paragraph" size="lg" />
|
124
106
|
<div>Paragraph</div>
|
125
|
-
<Flex className={showPopover ? "fa-flip-vertical" : ""}
|
126
|
-
|
127
|
-
>
|
128
|
-
<Icon fixedWidth
|
129
|
-
icon="angle-down"
|
130
|
-
margin-left="xs"
|
131
|
-
/>
|
107
|
+
<Flex className={showPopover ? "fa-flip-vertical" : ""} display="inline_flex">
|
108
|
+
<Icon fixedWidth icon="angle-down" margin-left="xs" />
|
132
109
|
</Flex>
|
133
110
|
</Flex>
|
134
111
|
)
|
@@ -147,21 +124,21 @@ const popoverReference = (
|
|
147
124
|
show={showPopover}
|
148
125
|
>
|
149
126
|
<Nav
|
150
|
-
|
151
|
-
|
152
|
-
|
127
|
+
paddingTop="xs"
|
128
|
+
paddingBottom="xs"
|
129
|
+
variant="subtle"
|
153
130
|
>
|
154
|
-
{toolbarDropdownItems.map(({ icon, text, onclick, isActive}:
|
131
|
+
{toolbarDropdownItems.map(({ icon, text, onclick, isActive}:ToolbarTypes, index:number) => (
|
155
132
|
<NavItem
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
133
|
+
cursor="pointer"
|
134
|
+
className={`pb_tiptap_toolbar_dropdown_list_item ${isActive ? "is-active" : ""}`}
|
135
|
+
iconLeft={icon}
|
136
|
+
key={`${text}_${index}`}
|
137
|
+
margin='none'
|
138
|
+
onClick={()=> {onclick(); setShowPopover(false)}}
|
139
|
+
text={text}
|
140
|
+
paddingTop='xxs'
|
141
|
+
paddingBottom='xxs'
|
165
142
|
/>
|
166
143
|
))}
|
167
144
|
</Nav>
|
@@ -3,7 +3,7 @@ import FlexItem from "../../pb_flex/_flex_item";
|
|
3
3
|
import EditorButton from "./EditorButton";
|
4
4
|
import { ToolbarTypes } from "./EditorTypes";
|
5
5
|
|
6
|
-
const ToolbarHistoryItems = ({editor}:
|
6
|
+
const ToolbarHistoryItems = ({editor}:any) => {
|
7
7
|
|
8
8
|
const toolbarHistoryItems = [
|
9
9
|
{
|
@@ -26,14 +26,14 @@ const toolbarHistoryItems = [
|
|
26
26
|
<>
|
27
27
|
<FlexItem displayFlex>
|
28
28
|
{toolbarHistoryItems.map(
|
29
|
-
({ onclick, classname, disable, icon, text }:
|
29
|
+
({ onclick, classname, disable, icon, text }:ToolbarTypes, index:number) => (
|
30
30
|
<EditorButton
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
31
|
+
classname={classname}
|
32
|
+
onclick={onclick}
|
33
|
+
disable={disable}
|
34
|
+
icon={icon}
|
35
|
+
key={index}
|
36
|
+
text={text}
|
37
37
|
/>
|
38
38
|
)
|
39
39
|
)}
|
@@ -2,7 +2,7 @@ import React, {useCallback} from "react";
|
|
2
2
|
import EditorButton from "./EditorButton";
|
3
3
|
import { ToolbarTypes } from "./EditorTypes";
|
4
4
|
|
5
|
-
const ToolbarNodes = ({editor}:
|
5
|
+
const ToolbarNodes = ({editor}:any) => {
|
6
6
|
|
7
7
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
8
8
|
const setLink = useCallback(() => {
|
@@ -42,13 +42,13 @@ const toolbarNodesItems = [
|
|
42
42
|
|
43
43
|
return (
|
44
44
|
<>
|
45
|
-
{toolbarNodesItems.map(({ onclick, icon, text, isActive }:
|
45
|
+
{toolbarNodesItems.map(({ onclick, icon, text, isActive }:ToolbarTypes, index:number) => (
|
46
46
|
<EditorButton
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
47
|
+
classname={`toolbar_button ${isActive ? 'is-active' : ''}`}
|
48
|
+
onclick={onclick}
|
49
|
+
icon={icon}
|
50
|
+
key={index}
|
51
|
+
text={text}
|
52
52
|
/>
|
53
53
|
))}
|
54
54
|
</>
|
@@ -17,27 +17,27 @@ import { TrixEditor } from "react-trix"
|
|
17
17
|
import EditorToolbar from './TipTap/Toolbar'
|
18
18
|
|
19
19
|
type Editor = {
|
20
|
-
attributeIsActive?:
|
20
|
+
attributeIsActive?: Function,
|
21
21
|
element?: HTMLElement,
|
22
|
-
getSelectedDocument?:
|
22
|
+
getSelectedDocument?: Function,
|
23
23
|
getSelectedRange?: () => Array<number>,
|
24
|
-
insertHTML?:
|
25
|
-
loadHTML?:
|
26
|
-
setSelectedRange?: (range: Array<number>) => void,
|
24
|
+
insertHTML?: Function,
|
25
|
+
loadHTML?: Function,
|
26
|
+
setSelectedRange?: (range: Array<number>) => void,
|
27
27
|
}
|
28
28
|
|
29
29
|
type RichTextEditorProps = {
|
30
30
|
aria?: { [key: string]: string },
|
31
31
|
advancedEditor?: any,
|
32
32
|
advancedEditorToolbar?: boolean,
|
33
|
-
toolbarBottom?:
|
33
|
+
toolbarBottom?: Boolean,
|
34
34
|
children?: React.ReactNode | React.ReactNode[]
|
35
35
|
className?: string,
|
36
36
|
data?: { [key: string]: string },
|
37
37
|
focus?: boolean,
|
38
38
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
39
39
|
id?: string,
|
40
|
-
inline?: boolean,
|
40
|
+
inline?: boolean,
|
41
41
|
extensions?: { [key: string]: string }[],
|
42
42
|
name?: string,
|
43
43
|
onChange: (html: string, text: string) => void,
|
@@ -49,7 +49,7 @@ type RichTextEditorProps = {
|
|
49
49
|
maxWidth?: string
|
50
50
|
} & GlobalProps
|
51
51
|
|
52
|
-
const RichTextEditor = (props: RichTextEditorProps)
|
52
|
+
const RichTextEditor = (props: RichTextEditorProps) => {
|
53
53
|
const {
|
54
54
|
aria = {},
|
55
55
|
advancedEditor,
|
@@ -81,6 +81,7 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
|
|
81
81
|
const handleOnEditorReady = (editorInstance: Editor) => setEditor(editorInstance),
|
82
82
|
element = editor?.element
|
83
83
|
|
84
|
+
|
84
85
|
// DOM manipulation must wait for editor to be ready
|
85
86
|
if (editor) {
|
86
87
|
const toolbarElement = element.parentElement.querySelector('trix-toolbar') as HTMLElement,
|
@@ -116,7 +117,6 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
|
|
116
117
|
focus
|
117
118
|
? (document.addEventListener('trix-focus', useFocus),
|
118
119
|
document.addEventListener('trix-blur', useFocus),
|
119
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
120
120
|
useFocus())
|
121
121
|
: null
|
122
122
|
|
@@ -164,10 +164,10 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
|
|
164
164
|
|
165
165
|
return (
|
166
166
|
<div
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
167
|
+
{...ariaProps}
|
168
|
+
{...dataProps}
|
169
|
+
{...htmlProps}
|
170
|
+
className={css}
|
171
171
|
>
|
172
172
|
{
|
173
173
|
advancedEditor ? (
|
@@ -175,11 +175,9 @@ const RichTextEditor = (props: RichTextEditorProps): React.ReactElement => {
|
|
175
175
|
className={classnames("pb_rich_text_editor_advanced_container", {
|
176
176
|
["toolbar-active"]: advancedEditorToolbar,
|
177
177
|
})}
|
178
|
-
|
178
|
+
>
|
179
179
|
{advancedEditorToolbar && (
|
180
|
-
<EditorToolbar editor={advancedEditor}
|
181
|
-
extensions={extensions}
|
182
|
-
/>
|
180
|
+
<EditorToolbar extensions={extensions} editor={advancedEditor}/>
|
183
181
|
)}
|
184
182
|
{ children }
|
185
183
|
</div>
|
@@ -20,7 +20,7 @@ type SectionSeparatorProps = {
|
|
20
20
|
variant?: "card" | "background",
|
21
21
|
}
|
22
22
|
|
23
|
-
const SectionSeparator = (props: SectionSeparatorProps)
|
23
|
+
const SectionSeparator = (props: SectionSeparatorProps) => {
|
24
24
|
const {
|
25
25
|
aria = {},
|
26
26
|
children,
|
@@ -42,19 +42,17 @@ const SectionSeparator = (props: SectionSeparatorProps): React.ReactElement => {
|
|
42
42
|
return (
|
43
43
|
|
44
44
|
<div
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
45
|
+
{...ariaProps}
|
46
|
+
{...dataProps}
|
47
|
+
{...htmlProps}
|
48
|
+
className={classes}
|
49
|
+
id={id}
|
50
50
|
>
|
51
51
|
{
|
52
52
|
children && children ||
|
53
53
|
text && (
|
54
54
|
<span>
|
55
|
-
<Caption dark={dark}
|
56
|
-
text={text}
|
57
|
-
/>
|
55
|
+
<Caption text={text} dark={dark} />
|
58
56
|
</span>
|
59
57
|
)
|
60
58
|
}
|
@@ -102,29 +102,20 @@
|
|
102
102
|
pointer-events: none;
|
103
103
|
}
|
104
104
|
&.inline {
|
105
|
-
@mixin active_arrow_style {
|
106
|
-
svg {
|
107
|
-
color: $primary !important;
|
108
|
-
font-size: 16px;
|
109
|
-
}
|
110
|
-
}
|
111
105
|
&:not(:hover) {
|
112
106
|
svg {
|
113
107
|
display: none;
|
114
108
|
}
|
115
109
|
}
|
116
|
-
&.show_arrow:not(:hover) {
|
117
|
-
svg {
|
118
|
-
display: block;
|
119
|
-
}
|
120
|
-
@include active_arrow_style();
|
121
|
-
}
|
122
110
|
&:hover {
|
123
|
-
@include active_arrow_style();
|
124
111
|
select {
|
125
112
|
color: $primary !important;
|
126
113
|
background: rgba(0,130,255,0.1);
|
127
114
|
}
|
115
|
+
svg {
|
116
|
+
color: $primary !important;
|
117
|
+
font-size: 16px;
|
118
|
+
}
|
128
119
|
}
|
129
120
|
select {
|
130
121
|
box-shadow: none;
|
@@ -36,7 +36,6 @@ type SelectProps = {
|
|
36
36
|
onChange: InputCallback<HTMLSelectElement>,
|
37
37
|
options: SelectOption[],
|
38
38
|
required?: boolean,
|
39
|
-
showArrow?: boolean,
|
40
39
|
value?: string,
|
41
40
|
} & GlobalProps
|
42
41
|
|
@@ -64,10 +63,9 @@ const Select = ({
|
|
64
63
|
inline = false,
|
65
64
|
multiple = false,
|
66
65
|
name,
|
67
|
-
onChange = () =>
|
66
|
+
onChange = () => {},
|
68
67
|
options = [],
|
69
68
|
required = false,
|
70
|
-
showArrow = false,
|
71
69
|
value,
|
72
70
|
...props
|
73
71
|
}: SelectProps, ref: React.LegacyRef<HTMLSelectElement>) => {
|
@@ -79,16 +77,15 @@ const Select = ({
|
|
79
77
|
const inlineClass = inline ? 'inline' : null
|
80
78
|
const compactClass = compact ? 'compact' : null
|
81
79
|
const classes = classnames(
|
82
|
-
buildCss(
|
80
|
+
buildCss('pb_select'),
|
83
81
|
globalProps({
|
84
82
|
...props,
|
85
|
-
marginBottom: props.marginBottom || props.margin ||
|
83
|
+
marginBottom: props.marginBottom || props.margin || 'sm',
|
86
84
|
}),
|
87
85
|
className,
|
88
86
|
inlineClass,
|
89
|
-
{ show_arrow: showArrow },
|
90
87
|
compactClass
|
91
|
-
)
|
88
|
+
)
|
92
89
|
|
93
90
|
const selectWrapperClass = classnames(buildCss('pb_select_kit_wrapper'), { error }, className)
|
94
91
|
const selectBody =(() =>{
|
@@ -10,7 +10,6 @@ examples:
|
|
10
10
|
- select_custom_select: Custom Select
|
11
11
|
- select_error: Select w/ Error
|
12
12
|
- select_inline: Select Inline
|
13
|
-
- select_inline_show_arrow: Select Inline (Always Show Arrow)
|
14
13
|
- select_inline_compact: Select Inline Compact
|
15
14
|
- select_attributes: Select W/ Attributes
|
16
15
|
- select_multiple: Select Multiple
|
@@ -27,7 +26,6 @@ examples:
|
|
27
26
|
- select_custom_select: Custom Select
|
28
27
|
- select_error: Select w/ Error
|
29
28
|
- select_inline: Select Inline
|
30
|
-
- select_inline_show_arrow: Select Inline (Always Show Arrow)
|
31
29
|
- select_inline_compact: Select Inline Compact
|
32
30
|
- select_multiple: Select Multiple
|
33
31
|
|
@@ -7,6 +7,5 @@ export { default as SelectCustomSelect } from './_select_custom_select.jsx'
|
|
7
7
|
export { default as SelectValueTextSame } from './_select_value_text_same.jsx'
|
8
8
|
export { default as SelectError } from './_select_error.jsx'
|
9
9
|
export { default as SelectInline } from './_select_inline.jsx'
|
10
|
-
export { default as SelectInlineShowArrow } from './_select_inline_show_arrow.jsx'
|
11
10
|
export { default as SelectInlineCompact } from './_select_inline_compact.jsx'
|
12
11
|
export { default as SelectMultiple } from './_select_multiple.jsx'
|
@@ -19,11 +19,10 @@ module Playbook
|
|
19
19
|
prop :name
|
20
20
|
prop :onchange
|
21
21
|
prop :options, type: Playbook::Props::HashArray, required: false, default: []
|
22
|
-
prop :show_arrow, type: Playbook::Props::Boolean, default: false
|
23
22
|
prop :required, type: Playbook::Props::Boolean, default: false
|
24
23
|
|
25
24
|
def classnames
|
26
|
-
classname + inline_class + compact_class
|
25
|
+
classname + inline_class + compact_class
|
27
26
|
end
|
28
27
|
|
29
28
|
def all_attributes
|
@@ -50,10 +49,6 @@ module Playbook
|
|
50
49
|
compact ? "compact" : ""
|
51
50
|
end
|
52
51
|
|
53
|
-
def show_arrow_class
|
54
|
-
show_arrow ? "show_arrow" : ""
|
55
|
-
end
|
56
|
-
|
57
52
|
def select_wrapper_class
|
58
53
|
"pb_select_kit_wrapper" + error_class
|
59
54
|
end
|