playbook_ui 14.2.1.pre.alpha.20240828cikubedbump3702 → 14.3.0.pre.alpha.revert3654PBNTR479removeextraspacingfromradiochildren3734
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_avatar_action_button/_avatar_action_button.scss +3 -3
- data/app/pb_kits/playbook/pb_badge/_badge.scss +2 -2
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.scss +1 -1
- data/app/pb_kits/playbook/pb_button/_button.scss +1 -1
- data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar_mixins.scss +2 -2
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.scss +1 -1
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleIcon.tsx +30 -24
- data/app/pb_kits/playbook/pb_collapsible/collapsible_main.html.erb +11 -7
- data/app/pb_kits/playbook/pb_collapsible/collapsible_main.rb +2 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_no_icon.html.erb +10 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_no_icon.jsx +21 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_input_styles.scss +1 -1
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_overrides.scss +2 -2
- data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.scss +4 -4
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.scss +4 -4
- data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +4 -1
- data/app/pb_kits/playbook/pb_dialog/dialog.rb +3 -0
- data/app/pb_kits/playbook/pb_dialog/dialogHelper.js +21 -0
- data/app/pb_kits/playbook/pb_dialog/dialog_footer.html.erb +4 -2
- data/app/pb_kits/playbook/pb_dialog/dialog_footer.rb +10 -1
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_loading.html.erb +13 -0
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_loading.md +3 -0
- data/app/pb_kits/playbook/pb_dialog/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +1 -1
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +2 -2
- data/app/pb_kits/playbook/pb_hashtag/_hashtag.tsx +16 -2
- data/app/pb_kits/playbook/pb_hashtag/docs/_hashtag_link.html.erb +1 -1
- data/app/pb_kits/playbook/pb_hashtag/docs/_hashtag_link.jsx +1 -1
- data/app/pb_kits/playbook/pb_hashtag/docs/_hashtag_link.md +1 -1
- data/app/pb_kits/playbook/pb_hashtag/hashtag.html.erb +1 -1
- data/app/pb_kits/playbook/pb_hashtag/hashtag.rb +9 -2
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +16 -0
- data/app/pb_kits/playbook/pb_home_address_street/city_emphasis.html.erb +1 -0
- data/app/pb_kits/playbook/pb_home_address_street/city_emphasis.rb +11 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_link.html.erb +1 -1
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_link.jsx +1 -1
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_link.md +1 -1
- data/app/pb_kits/playbook/pb_home_address_street/home_address_street.rb +13 -0
- data/app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js +2 -2
- data/app/pb_kits/playbook/pb_home_address_street/street_emphasis.html.erb +2 -1
- data/app/pb_kits/playbook/pb_home_address_street/street_emphasis.rb +11 -0
- data/app/pb_kits/playbook/pb_icon/icon.rb +8 -0
- data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.scss +1 -1
- data/app/pb_kits/playbook/pb_label_value/_label_value.scss +1 -1
- data/app/pb_kits/playbook/pb_message/_message_mixins.scss +1 -1
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.scss +1 -1
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_no_icon.html.erb +24 -0
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_no_icon.jsx +88 -0
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_no_icon_rails.md +1 -0
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_no_icon_react.md +1 -0
- data/app/pb_kits/playbook/pb_nav/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_nav/docs/index.js +4 -3
- data/app/pb_kits/playbook/pb_pagination/_pagination.scss +3 -1
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.scss +3 -3
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +2 -2
- data/app/pb_kits/playbook/pb_phone_number_input/intlTelInput.scss +1290 -0
- data/app/pb_kits/playbook/pb_pill/_pill.scss +2 -2
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.scss +2 -2
- data/app/pb_kits/playbook/pb_radio/_radio.tsx +100 -50
- data/app/pb_kits/playbook/pb_radio/docs/_radio_children.jsx +56 -0
- data/app/pb_kits/playbook/pb_radio/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_radio/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/_previewer_mixin.scss +49 -13
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.scss +2 -14
- data/app/pb_kits/playbook/pb_rich_text_editor/_tiptap_styles.scss +23 -23
- data/app/pb_kits/playbook/pb_rich_text_editor/_trix_styles.scss +19 -27
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.html.erb +21 -11
- data/app/pb_kits/playbook/pb_select/_select.scss +1 -1
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +3 -3
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_default_value.html.erb +1 -0
- data/app/pb_kits/playbook/pb_star_rating/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_star_rating/index.js +11 -1
- data/app/pb_kits/playbook/pb_star_rating/star_rating.rb +3 -1
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +1 -1
- data/app/pb_kits/playbook/pb_textarea/_textarea.scss +1 -1
- data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.scss +4 -4
- data/app/pb_kits/playbook/pb_timeline/_timeline.scss +2 -2
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.html.erb +2 -2
- data/app/pb_kits/playbook/pb_timestamp/timestamp.rb +46 -2
- data/app/pb_kits/playbook/pb_toggle/_toggle.scss +3 -3
- data/dist/chunks/{_typeahead-KAYMhDNO.js → _typeahead-BWUFVlae.js} +3 -3
- data/dist/chunks/{_weekday_stacked-CTvE8Bet.js → _weekday_stacked-DpRkKl3_.js} +2 -2
- data/dist/chunks/{lib-DErGXNy3.js → lib-D9uVVKnh.js} +1 -1
- data/dist/chunks/{pb_form_validation-BC6kh7Hu.js → pb_form_validation-u2wnZ3oe.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/version.rb +2 -2
- metadata +17 -6
@@ -9,9 +9,9 @@ $pb_pill_height: 22px;
|
|
9
9
|
display: inline-flex;
|
10
10
|
justify-content: center;
|
11
11
|
align-items: center;
|
12
|
-
padding: 0
|
12
|
+
padding: 0 $space-sm/1.8;
|
13
13
|
height: $pb_pill_height;
|
14
|
-
border-radius:
|
14
|
+
border-radius: $pb_pill_height/2;
|
15
15
|
white-space: nowrap;
|
16
16
|
|
17
17
|
&[class*=lowercase] {
|
@@ -21,7 +21,7 @@ $pb_progress_simple_height: 4px;
|
|
21
21
|
[class^=pb_progress_simple_kit] {
|
22
22
|
width: 100%;
|
23
23
|
height: $pb_progress_simple_height;
|
24
|
-
border-radius:
|
24
|
+
border-radius: $pb_progress_simple_height/2;
|
25
25
|
background: rgba($primary, $opacity-1);
|
26
26
|
&[class*=_positive] {
|
27
27
|
.progress_simple_value {
|
@@ -42,7 +42,7 @@ $pb_progress_simple_height: 4px;
|
|
42
42
|
[class^=progress_simple_value] {
|
43
43
|
width: 0%;
|
44
44
|
height: 100%;
|
45
|
-
border-radius:
|
45
|
+
border-radius: $pb_progress_simple_height/2;
|
46
46
|
background: $primary;
|
47
47
|
}
|
48
48
|
|
@@ -1,28 +1,27 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
import React, { forwardRef } from 'react'
|
1
|
+
import React, { forwardRef, isValidElement, useRef } from 'react'
|
4
2
|
import Body from '../pb_body/_body'
|
3
|
+
import Flex from '../pb_flex/_flex'
|
5
4
|
import classnames from 'classnames'
|
6
5
|
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
7
6
|
import { globalProps, GlobalProps } from '../utilities/globalProps'
|
8
7
|
|
9
8
|
type RadioProps = {
|
10
|
-
aria?: {[key: string]: string},
|
9
|
+
aria?: { [key: string]: string },
|
11
10
|
alignment?: string,
|
12
11
|
checked?: boolean,
|
13
12
|
children?: React.ReactChild[] | React.ReactChild,
|
14
13
|
className?: string,
|
15
14
|
dark?: boolean,
|
16
|
-
data?: {[key: string]: string},
|
15
|
+
data?: { [key: string]: string },
|
17
16
|
disabled?: boolean,
|
18
17
|
error?: boolean,
|
19
|
-
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
18
|
+
htmlOptions?: { [key: string]: string | number | boolean | (() => void) },
|
20
19
|
id?: string,
|
21
20
|
label: string,
|
22
21
|
name?: string,
|
23
22
|
value?: string,
|
24
23
|
text?: string,
|
25
|
-
onChange: (event: React.FormEvent<HTMLInputElement> | null)=>void,
|
24
|
+
onChange: (event: React.FormEvent<HTMLInputElement> | null) => void,
|
26
25
|
} & GlobalProps
|
27
26
|
|
28
27
|
const Radio = ({
|
@@ -31,9 +30,9 @@ const Radio = ({
|
|
31
30
|
children,
|
32
31
|
className,
|
33
32
|
dark = false,
|
34
|
-
data = {},
|
35
33
|
disabled = false,
|
36
34
|
error = false,
|
35
|
+
data = {},
|
37
36
|
htmlOptions = {},
|
38
37
|
id,
|
39
38
|
label,
|
@@ -42,52 +41,103 @@ const Radio = ({
|
|
42
41
|
value = 'radio_text',
|
43
42
|
onChange = () => { void 0 },
|
44
43
|
...props
|
45
|
-
}: RadioProps
|
46
|
-
const
|
47
|
-
|
48
|
-
const
|
44
|
+
}: RadioProps ) => {
|
45
|
+
const radioRef = useRef(null);
|
46
|
+
|
47
|
+
const ariaProps = buildAriaProps(aria);
|
48
|
+
const dataProps = buildDataProps(data);
|
49
|
+
const htmlProps = buildHtmlProps(htmlOptions);
|
49
50
|
const classes = classnames(
|
50
|
-
buildCss('pb_radio_kit', alignment
|
51
|
-
dark ? 'dark'
|
51
|
+
buildCss('pb_radio_kit', alignment),
|
52
|
+
dark ? 'dark' : null,
|
53
|
+
error ? 'error' : null,
|
52
54
|
globalProps(props),
|
53
|
-
className
|
55
|
+
className
|
56
|
+
);
|
57
|
+
|
58
|
+
const classesCustom = classnames(
|
59
|
+
dark ? 'dark' : null,
|
60
|
+
error ? 'error' : null,
|
61
|
+
globalProps(props),
|
62
|
+
className
|
63
|
+
);
|
64
|
+
|
65
|
+
const isCustomChild = children && isValidElement(children) && children.type !== 'input';
|
54
66
|
|
55
67
|
const displayRadio = (props: RadioProps & any) => {
|
56
|
-
if (children)
|
57
|
-
return
|
58
|
-
else
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
68
|
+
if (isValidElement(children) && children.type === 'input') {
|
69
|
+
return children;
|
70
|
+
} else if (isCustomChild || !children) {
|
71
|
+
return (
|
72
|
+
<input
|
73
|
+
disabled={disabled}
|
74
|
+
id={id}
|
75
|
+
name={name}
|
76
|
+
onChange={onChange}
|
77
|
+
ref={radioRef}
|
78
|
+
text={text}
|
79
|
+
type="radio"
|
80
|
+
value={value}
|
81
|
+
{...props}
|
82
|
+
/>
|
83
|
+
);
|
84
|
+
}
|
85
|
+
};
|
86
|
+
|
87
|
+
const handleContainerClick = (event: React.MouseEvent<HTMLDivElement, MouseEvent> | undefined) => {
|
88
|
+
if (event) {
|
89
|
+
const target = event.target as HTMLElement;
|
90
|
+
if (
|
91
|
+
target.id === 'pb-radio-children-wrapper' ||
|
92
|
+
target.closest('#pb-radio-children-wrapper')
|
93
|
+
) {
|
94
|
+
radioRef.current?.click();
|
95
|
+
}
|
96
|
+
}
|
97
|
+
};
|
72
98
|
|
73
99
|
return (
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
}
|
100
|
+
isCustomChild ? (
|
101
|
+
<Flex
|
102
|
+
{...ariaProps}
|
103
|
+
{...dataProps}
|
104
|
+
{...htmlProps}
|
105
|
+
align='center'
|
106
|
+
className={classesCustom}
|
107
|
+
cursor='pointer'
|
108
|
+
htmlFor={id}
|
109
|
+
htmlOptions={{
|
110
|
+
onClick: ((event: React.MouseEvent<HTMLDivElement, MouseEvent>) => {
|
111
|
+
handleContainerClick(event);
|
112
|
+
}) as unknown as () => void
|
113
|
+
}}
|
114
|
+
id="radio-container"
|
115
|
+
>
|
116
|
+
<label className={buildCss('pb_radio_kit', alignment)}>
|
117
|
+
<>{displayRadio(props)}</>
|
118
|
+
<span className="pb_radio_button" />
|
119
|
+
</label>
|
120
|
+
<div id="pb-radio-children-wrapper"> {children} </div>
|
121
|
+
</Flex>
|
122
|
+
) : (
|
123
|
+
<label
|
124
|
+
{...ariaProps}
|
125
|
+
{...dataProps}
|
126
|
+
{...htmlProps}
|
127
|
+
className={classes}
|
128
|
+
htmlFor={id}
|
129
|
+
>
|
130
|
+
<>{displayRadio(props)}</>
|
131
|
+
<span className="pb_radio_button" />
|
132
|
+
<Body
|
133
|
+
dark={dark}
|
134
|
+
status={error ? 'negative' : null}
|
135
|
+
text={label}
|
136
|
+
variant={null}
|
137
|
+
/>
|
138
|
+
</label>
|
139
|
+
)
|
140
|
+
);
|
141
|
+
};
|
92
142
|
|
93
|
-
export default forwardRef(Radio)
|
143
|
+
export default forwardRef(Radio);
|
@@ -0,0 +1,56 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import Radio from '../_radio'
|
3
|
+
import Select from '../../pb_select/_select'
|
4
|
+
import Typeahead from '../../pb_typeahead/_typeahead'
|
5
|
+
import Title from '../../pb_title/_title'
|
6
|
+
|
7
|
+
const RadioChildren = (props) => {
|
8
|
+
|
9
|
+
|
10
|
+
const options = [
|
11
|
+
{ label: 'Orange', value: 'Orange' },
|
12
|
+
{ label: 'Red', value: 'Red' },
|
13
|
+
{ label: 'Green', value: 'Green' },
|
14
|
+
{ label: 'Blue', value: 'Blue' },
|
15
|
+
]
|
16
|
+
|
17
|
+
return (
|
18
|
+
<div>
|
19
|
+
<Radio
|
20
|
+
label="Select"
|
21
|
+
name="Group1"
|
22
|
+
tabIndex={0}
|
23
|
+
value="Select"
|
24
|
+
{...props}
|
25
|
+
>
|
26
|
+
<Select
|
27
|
+
minWidth="xs"
|
28
|
+
options={options}
|
29
|
+
/>
|
30
|
+
</Radio>
|
31
|
+
<Radio
|
32
|
+
label="Typeahead"
|
33
|
+
name="Group1"
|
34
|
+
tabIndex={0}
|
35
|
+
value="Typeahead"
|
36
|
+
{...props}
|
37
|
+
>
|
38
|
+
<Typeahead
|
39
|
+
minWidth="xs"
|
40
|
+
options={options}
|
41
|
+
/>
|
42
|
+
</Radio>
|
43
|
+
<br />
|
44
|
+
<Radio
|
45
|
+
defaultChecked={false}
|
46
|
+
label="Typography"
|
47
|
+
name="Group1"
|
48
|
+
value="Typography"
|
49
|
+
{...props}
|
50
|
+
>
|
51
|
+
<Title text="Custom Typography" />
|
52
|
+
</Radio>
|
53
|
+
</div>
|
54
|
+
)
|
55
|
+
}
|
56
|
+
export default RadioChildren
|
@@ -3,3 +3,4 @@ export { default as RadioCustom } from './_radio_custom.jsx'
|
|
3
3
|
export { default as RadioError } from './_radio_error.jsx'
|
4
4
|
export { default as RadioAlignment } from './_radio_alignment.jsx'
|
5
5
|
export { default as RadioDisabled } from './_radio_disabled.jsx'
|
6
|
+
export { default as RadioChildren } from './_radio_children.jsx'
|
@@ -3,18 +3,20 @@
|
|
3
3
|
@import "../tokens/spacing";
|
4
4
|
@import "../tokens/typography";
|
5
5
|
|
6
|
-
|
6
|
+
|
7
|
+
// Tiptap mixins section (React Advanced Editor)
|
8
|
+
@mixin preview_tiptap_first_child {
|
7
9
|
:first-child {
|
8
10
|
margin-top: 0;
|
9
11
|
}
|
10
12
|
}
|
11
13
|
|
12
|
-
@mixin
|
14
|
+
@mixin preview_tiptap_p {
|
13
15
|
margin: 1rem 0 0 0;
|
14
16
|
min-height: 1rem;
|
15
17
|
}
|
16
18
|
|
17
|
-
@mixin
|
19
|
+
@mixin preview_tiptap_code {
|
18
20
|
font-family: monospace;
|
19
21
|
background: $bg_light;
|
20
22
|
padding: 0.1rem 0.3rem;
|
@@ -23,7 +25,7 @@
|
|
23
25
|
overflow: hidden;
|
24
26
|
}
|
25
27
|
|
26
|
-
@mixin
|
28
|
+
@mixin preview_tiptap_pre_codeblock {
|
27
29
|
display: inline-block;
|
28
30
|
width: 100%;
|
29
31
|
vertical-align: top;
|
@@ -44,7 +46,7 @@
|
|
44
46
|
}
|
45
47
|
}
|
46
48
|
|
47
|
-
@mixin
|
49
|
+
@mixin preview_tiptap_a {
|
48
50
|
color: $primary;
|
49
51
|
border-bottom: 1px solid $primary;
|
50
52
|
&:hover {
|
@@ -53,7 +55,7 @@
|
|
53
55
|
}
|
54
56
|
}
|
55
57
|
|
56
|
-
@mixin
|
58
|
+
@mixin preview_tiptap_blockquote {
|
57
59
|
font-size: $font_larger;
|
58
60
|
padding: $space_sm $space_md;
|
59
61
|
font-style: italic;
|
@@ -63,7 +65,7 @@
|
|
63
65
|
}
|
64
66
|
}
|
65
67
|
|
66
|
-
@mixin
|
68
|
+
@mixin preview_tiptap_h1 {
|
67
69
|
font-size: $text_largest;
|
68
70
|
line-height: $text_larger;
|
69
71
|
font-weight: $bolder;
|
@@ -71,7 +73,7 @@
|
|
71
73
|
margin: 2.1rem 0 0 0;
|
72
74
|
}
|
73
75
|
|
74
|
-
@mixin
|
76
|
+
@mixin preview_tiptap_h2 {
|
75
77
|
font-size: $text_larger;
|
76
78
|
line-height: $text_larger;
|
77
79
|
font-weight: $bolder;
|
@@ -79,7 +81,7 @@
|
|
79
81
|
margin: 1.9rem 0 0 0;
|
80
82
|
}
|
81
83
|
|
82
|
-
@mixin
|
84
|
+
@mixin preview_tiptap_h3 {
|
83
85
|
font-size: $text_large;
|
84
86
|
line-height: $text_large;
|
85
87
|
font-weight: $bolder;
|
@@ -87,7 +89,7 @@
|
|
87
89
|
margin: 1.7rem 0 0 0;
|
88
90
|
}
|
89
91
|
|
90
|
-
@mixin
|
92
|
+
@mixin preview_tiptap_smaller_headings {
|
91
93
|
font-size: $text_base;
|
92
94
|
line-height: $text_base;
|
93
95
|
letter-spacing: $lspace_tight;
|
@@ -95,7 +97,7 @@
|
|
95
97
|
margin: 1rem 0 0 0;
|
96
98
|
}
|
97
99
|
|
98
|
-
@mixin
|
100
|
+
@mixin preview_tiptap_hr {
|
99
101
|
margin: 2.2rem 0;
|
100
102
|
box-sizing: content-box;
|
101
103
|
overflow: hidden;
|
@@ -107,7 +109,7 @@
|
|
107
109
|
border: 0;
|
108
110
|
}
|
109
111
|
|
110
|
-
@mixin
|
112
|
+
@mixin preview_tiptap_ol {
|
111
113
|
margin: 1rem 0 0 0;
|
112
114
|
padding-left: $space_md;
|
113
115
|
list-style: decimal;
|
@@ -119,7 +121,7 @@
|
|
119
121
|
}
|
120
122
|
}
|
121
123
|
|
122
|
-
@mixin
|
124
|
+
@mixin preview_tiptap_ul {
|
123
125
|
list-style-position: disc;
|
124
126
|
margin: 1rem 0 0 0;
|
125
127
|
padding-left: $space_md;
|
@@ -130,3 +132,37 @@
|
|
130
132
|
}
|
131
133
|
}
|
132
134
|
}
|
135
|
+
|
136
|
+
// Trix mixins section (Rails and React default editor)
|
137
|
+
@mixin preview_trix_div {
|
138
|
+
line-height: 1.4;
|
139
|
+
}
|
140
|
+
|
141
|
+
@mixin preview_trix_h1 {
|
142
|
+
font-size: 2em;
|
143
|
+
line-height: 1.4;
|
144
|
+
}
|
145
|
+
@mixin preview_trix_blockquote {
|
146
|
+
border: 0 solid #ccc;
|
147
|
+
border-left-width: 0.3em;
|
148
|
+
margin-left: 0.3em;
|
149
|
+
padding-left: 0.6em;
|
150
|
+
line-height: 1.4;
|
151
|
+
}
|
152
|
+
|
153
|
+
@mixin preview_trix_li {
|
154
|
+
line-height: 1.4;
|
155
|
+
margin-left: $space_sm;
|
156
|
+
}
|
157
|
+
|
158
|
+
@mixin preview_trix_pre {
|
159
|
+
display: inline-block;
|
160
|
+
width: 100%;
|
161
|
+
vertical-align: top;
|
162
|
+
font-family: monospace;
|
163
|
+
font-size: 0.9em;
|
164
|
+
padding: 0.5em;
|
165
|
+
white-space: pre;
|
166
|
+
background-color: #eee;
|
167
|
+
overflow-x: auto;
|
168
|
+
}
|
@@ -10,18 +10,6 @@
|
|
10
10
|
@import "./trix_styles";
|
11
11
|
@import "./tiptap_styles";
|
12
12
|
|
13
|
-
.trix-content pre {
|
14
|
-
display: inline-block;
|
15
|
-
width: 100%;
|
16
|
-
vertical-align: top;
|
17
|
-
font-family: monospace;
|
18
|
-
font-size: 0.9em;
|
19
|
-
padding: 0.5em;
|
20
|
-
white-space: pre;
|
21
|
-
background-color: #ccc !important;
|
22
|
-
color: black !important;
|
23
|
-
overflow-x: auto;
|
24
|
-
}
|
25
13
|
[class^=pb_rich_text_editor_kit] {
|
26
14
|
// Disables File Attatchment Button in Toolbar
|
27
15
|
trix-toolbar [data-trix-button-group="file-tools"] {
|
@@ -106,7 +94,7 @@
|
|
106
94
|
.trix-button--icon {
|
107
95
|
height: $space_lg;
|
108
96
|
width: $space_lg;
|
109
|
-
margin:
|
97
|
+
margin: $space_xs / 2;
|
110
98
|
border-radius: $border_rad_heavier;
|
111
99
|
&::before {
|
112
100
|
background-size: auto;
|
@@ -116,7 +104,7 @@
|
|
116
104
|
background: $white;
|
117
105
|
border: 1px solid #E4E8F0;
|
118
106
|
border-bottom: none;
|
119
|
-
padding:
|
107
|
+
padding: $space_xs / 2;
|
120
108
|
border-top-left-radius: $border_rad_heavier;
|
121
109
|
border-top-right-radius: $border_rad_heavier;
|
122
110
|
.trix-button-group {
|
@@ -86,44 +86,44 @@
|
|
86
86
|
}
|
87
87
|
|
88
88
|
code {
|
89
|
-
@include
|
89
|
+
@include preview_tiptap_code;
|
90
90
|
}
|
91
91
|
|
92
92
|
pre {
|
93
|
-
@include
|
93
|
+
@include preview_tiptap_pre_codeblock;
|
94
94
|
}
|
95
95
|
a {
|
96
|
-
@include
|
96
|
+
@include preview_tiptap_a;
|
97
97
|
}
|
98
98
|
blockquote {
|
99
|
-
@include
|
99
|
+
@include preview_tiptap_blockquote;
|
100
100
|
}
|
101
101
|
&:focus-visible {
|
102
102
|
outline: unset;
|
103
103
|
@include transition_default;
|
104
104
|
}
|
105
105
|
h1 {
|
106
|
-
@include
|
106
|
+
@include preview_tiptap_h1;
|
107
107
|
}
|
108
108
|
h2 {
|
109
|
-
@include
|
109
|
+
@include preview_tiptap_h2;
|
110
110
|
}
|
111
111
|
h3 {
|
112
|
-
@include
|
112
|
+
@include preview_tiptap_h3;
|
113
113
|
}
|
114
114
|
h4,
|
115
115
|
h5,
|
116
116
|
h6 {
|
117
|
-
@include
|
117
|
+
@include preview_tiptap_smaller_headings;
|
118
118
|
}
|
119
119
|
hr {
|
120
|
-
@include
|
120
|
+
@include preview_tiptap_hr;
|
121
121
|
}
|
122
122
|
ol {
|
123
|
-
@include
|
123
|
+
@include preview_tiptap_ol;
|
124
124
|
}
|
125
125
|
ul {
|
126
|
-
@include
|
126
|
+
@include preview_tiptap_ul;
|
127
127
|
}
|
128
128
|
}
|
129
129
|
}
|
@@ -170,40 +170,40 @@
|
|
170
170
|
}
|
171
171
|
}
|
172
172
|
.tiptap-content {
|
173
|
-
@include
|
173
|
+
@include preview_tiptap_first_child;
|
174
174
|
a {
|
175
|
-
@include
|
175
|
+
@include preview_tiptap_a;
|
176
176
|
}
|
177
177
|
blockquote {
|
178
|
-
@include
|
178
|
+
@include preview_tiptap_blockquote;
|
179
179
|
}
|
180
180
|
h1 {
|
181
|
-
@include
|
181
|
+
@include preview_tiptap_h1;
|
182
182
|
}
|
183
183
|
h2 {
|
184
|
-
@include
|
184
|
+
@include preview_tiptap_h2;
|
185
185
|
}
|
186
186
|
h3 {
|
187
|
-
@include
|
187
|
+
@include preview_tiptap_h3;
|
188
188
|
}
|
189
189
|
h4,
|
190
190
|
h5,
|
191
191
|
h6 {
|
192
|
-
@include
|
192
|
+
@include preview_tiptap_smaller_headings;
|
193
193
|
}
|
194
194
|
hr {
|
195
|
-
@include
|
195
|
+
@include preview_tiptap_hr;
|
196
196
|
}
|
197
197
|
ol {
|
198
|
-
@include
|
198
|
+
@include preview_tiptap_ol;
|
199
199
|
}
|
200
200
|
p {
|
201
|
-
@include
|
201
|
+
@include preview_tiptap_p;
|
202
202
|
}
|
203
203
|
pre {
|
204
|
-
@include
|
204
|
+
@include preview_tiptap_pre_codeblock;
|
205
205
|
}
|
206
206
|
ul {
|
207
|
-
@include
|
207
|
+
@include preview_tiptap_ul;
|
208
208
|
}
|
209
209
|
}
|
@@ -1,3 +1,5 @@
|
|
1
|
+
@import "previewer_mixin";
|
2
|
+
|
1
3
|
@charset "UTF-8";
|
2
4
|
/*
|
3
5
|
Trix 1.3.0
|
@@ -297,41 +299,31 @@ trix-editor .attachment__metadata {
|
|
297
299
|
trix-editor .attachment__metadata .attachment__size {
|
298
300
|
margin-left: 0.2em;
|
299
301
|
white-space: nowrap; }
|
302
|
+
trix-editor blockquote {
|
303
|
+
@include preview_trix_blockquote; }
|
304
|
+
trix-editor [dir=rtl] blockquote,
|
305
|
+
trix-editor blockquote[dir=rtl] {
|
306
|
+
@include preview_trix_blockquote }
|
300
307
|
@charset "UTF-8";
|
301
|
-
.trix-content {
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
308
|
+
.trix-content * {
|
309
|
+
box-sizing: border-box;
|
310
|
+
margin: 0;
|
311
|
+
padding: 0; }
|
312
|
+
.trix-content#content-preview div {
|
313
|
+
@include preview_trix_div; }
|
307
314
|
.trix-content h1 {
|
308
|
-
|
309
|
-
line-height: 1.2; }
|
315
|
+
@include preview_trix_h1; }
|
310
316
|
.trix-content blockquote {
|
311
|
-
|
312
|
-
border-left-width: 0.3em;
|
313
|
-
margin-left: 0.3em;
|
314
|
-
padding-left: 0.6em; }
|
317
|
+
@include preview_trix_blockquote; }
|
315
318
|
.trix-content [dir=rtl] blockquote,
|
316
319
|
.trix-content blockquote[dir=rtl] {
|
317
|
-
|
318
|
-
border-right-width: 0.3em;
|
319
|
-
margin-right: 0.3em;
|
320
|
-
padding-right: 0.6em; }
|
320
|
+
@include preview_trix_blockquote; }
|
321
321
|
.trix-content li {
|
322
|
-
|
322
|
+
@include preview_trix_li; }
|
323
323
|
.trix-content [dir=rtl] li {
|
324
|
-
|
324
|
+
@include preview_trix_li; }
|
325
325
|
.trix-content pre {
|
326
|
-
|
327
|
-
width: 100%;
|
328
|
-
vertical-align: top;
|
329
|
-
font-family: monospace;
|
330
|
-
font-size: 0.9em;
|
331
|
-
padding: 0.5em;
|
332
|
-
white-space: pre;
|
333
|
-
background-color: #eee;
|
334
|
-
overflow-x: auto; }
|
326
|
+
@include preview_trix_pre; }
|
335
327
|
.trix-content img {
|
336
328
|
max-width: 100%;
|
337
329
|
height: auto; }
|