playbook_ui 14.2.1 → 14.3.0.pre.alpha.revert3654PBNTR479removeextraspacingfromradiochildren3734

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.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.scss +3 -3
  3. data/app/pb_kits/playbook/pb_badge/_badge.scss +2 -2
  4. data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.scss +1 -1
  5. data/app/pb_kits/playbook/pb_button/_button.scss +1 -1
  6. data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar_mixins.scss +2 -2
  7. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.scss +1 -1
  8. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +3 -0
  9. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.html.erb +1 -1
  10. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb +2 -0
  11. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.test.js +15 -0
  12. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_loading.html.erb +29 -0
  13. data/app/pb_kits/playbook/pb_circle_icon_button/docs/_circle_icon_button_loading.jsx +43 -0
  14. data/app/pb_kits/playbook/pb_circle_icon_button/docs/example.yml +2 -0
  15. data/app/pb_kits/playbook/pb_circle_icon_button/docs/index.js +1 -0
  16. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleIcon.tsx +30 -24
  17. data/app/pb_kits/playbook/pb_collapsible/collapsible_main.html.erb +11 -7
  18. data/app/pb_kits/playbook/pb_collapsible/collapsible_main.rb +2 -0
  19. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_no_icon.html.erb +10 -0
  20. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_no_icon.jsx +21 -0
  21. data/app/pb_kits/playbook/pb_collapsible/docs/example.yml +2 -0
  22. data/app/pb_kits/playbook/pb_collapsible/docs/index.js +2 -1
  23. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_input_styles.scss +1 -1
  24. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_overrides.scss +2 -2
  25. data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.scss +4 -4
  26. data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.scss +4 -4
  27. data/app/pb_kits/playbook/pb_dialog/dialog.html.erb +4 -1
  28. data/app/pb_kits/playbook/pb_dialog/dialog.rb +3 -0
  29. data/app/pb_kits/playbook/pb_dialog/dialogHelper.js +21 -0
  30. data/app/pb_kits/playbook/pb_dialog/dialog_footer.html.erb +4 -2
  31. data/app/pb_kits/playbook/pb_dialog/dialog_footer.rb +10 -1
  32. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_loading.html.erb +13 -0
  33. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_loading.md +3 -0
  34. data/app/pb_kits/playbook/pb_dialog/docs/example.yml +1 -0
  35. data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +1 -1
  36. data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +2 -2
  37. data/app/pb_kits/playbook/pb_hashtag/_hashtag.tsx +16 -2
  38. data/app/pb_kits/playbook/pb_hashtag/docs/_hashtag_link.html.erb +1 -1
  39. data/app/pb_kits/playbook/pb_hashtag/docs/_hashtag_link.jsx +1 -1
  40. data/app/pb_kits/playbook/pb_hashtag/docs/_hashtag_link.md +1 -1
  41. data/app/pb_kits/playbook/pb_hashtag/hashtag.html.erb +1 -1
  42. data/app/pb_kits/playbook/pb_hashtag/hashtag.rb +9 -2
  43. data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +16 -0
  44. data/app/pb_kits/playbook/pb_home_address_street/city_emphasis.html.erb +1 -0
  45. data/app/pb_kits/playbook/pb_home_address_street/city_emphasis.rb +11 -0
  46. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_link.html.erb +1 -1
  47. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_link.jsx +1 -1
  48. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_link.md +1 -1
  49. data/app/pb_kits/playbook/pb_home_address_street/home_address_street.rb +13 -0
  50. data/app/pb_kits/playbook/pb_home_address_street/home_adress_street.test.js +2 -2
  51. data/app/pb_kits/playbook/pb_home_address_street/street_emphasis.html.erb +2 -1
  52. data/app/pb_kits/playbook/pb_home_address_street/street_emphasis.rb +11 -0
  53. data/app/pb_kits/playbook/pb_icon/icon.rb +8 -0
  54. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.scss +1 -1
  55. data/app/pb_kits/playbook/pb_label_value/_label_value.scss +1 -1
  56. data/app/pb_kits/playbook/pb_message/_message_mixins.scss +1 -1
  57. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.scss +1 -1
  58. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_no_icon.html.erb +24 -0
  59. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_no_icon.jsx +88 -0
  60. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_no_icon_rails.md +1 -0
  61. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_no_icon_react.md +1 -0
  62. data/app/pb_kits/playbook/pb_nav/docs/example.yml +2 -0
  63. data/app/pb_kits/playbook/pb_nav/docs/index.js +4 -3
  64. data/app/pb_kits/playbook/pb_pagination/_pagination.scss +3 -1
  65. data/app/pb_kits/playbook/pb_passphrase/_passphrase.scss +3 -3
  66. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +2 -2
  67. data/app/pb_kits/playbook/pb_phone_number_input/intlTelInput.scss +1290 -0
  68. data/app/pb_kits/playbook/pb_pill/_pill.scss +2 -2
  69. data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.scss +2 -2
  70. data/app/pb_kits/playbook/pb_radio/_radio.tsx +100 -50
  71. data/app/pb_kits/playbook/pb_radio/docs/_radio_children.jsx +56 -0
  72. data/app/pb_kits/playbook/pb_radio/docs/example.yml +1 -0
  73. data/app/pb_kits/playbook/pb_radio/docs/index.js +1 -0
  74. data/app/pb_kits/playbook/pb_rich_text_editor/_previewer_mixin.scss +49 -13
  75. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.scss +2 -14
  76. data/app/pb_kits/playbook/pb_rich_text_editor/_tiptap_styles.scss +23 -23
  77. data/app/pb_kits/playbook/pb_rich_text_editor/_trix_styles.scss +19 -27
  78. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.html.erb +21 -11
  79. data/app/pb_kits/playbook/pb_select/_select.scss +1 -1
  80. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +3 -3
  81. data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_default_value.html.erb +1 -0
  82. data/app/pb_kits/playbook/pb_star_rating/docs/example.yml +1 -0
  83. data/app/pb_kits/playbook/pb_star_rating/index.js +11 -1
  84. data/app/pb_kits/playbook/pb_star_rating/star_rating.rb +3 -1
  85. data/app/pb_kits/playbook/pb_text_input/_text_input.scss +1 -1
  86. data/app/pb_kits/playbook/pb_textarea/_textarea.scss +1 -1
  87. data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.scss +4 -4
  88. data/app/pb_kits/playbook/pb_timeline/_timeline.scss +2 -2
  89. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.html.erb +2 -2
  90. data/app/pb_kits/playbook/pb_timestamp/timestamp.rb +46 -2
  91. data/app/pb_kits/playbook/pb_toggle/_toggle.scss +3 -3
  92. data/dist/chunks/{_typeahead-Cq7RLPBA.js → _typeahead-BWUFVlae.js} +3 -3
  93. data/dist/chunks/{_weekday_stacked-Cykj5kLZ.js → _weekday_stacked-DpRkKl3_.js} +2 -2
  94. data/dist/chunks/{lib-DErGXNy3.js → lib-D9uVVKnh.js} +1 -1
  95. data/dist/chunks/{pb_form_validation-BC6kh7Hu.js → pb_form_validation-u2wnZ3oe.js} +1 -1
  96. data/dist/chunks/vendor.js +1 -1
  97. data/dist/playbook-doc.js +1 -1
  98. data/dist/playbook-rails-react-bindings.js +1 -1
  99. data/dist/playbook-rails.js +1 -1
  100. data/dist/playbook.css +1 -1
  101. data/lib/playbook/version.rb +2 -2
  102. metadata +22 -9
@@ -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 calc($space-sm/1.8);
12
+ padding: 0 $space-sm/1.8;
13
13
  height: $pb_pill_height;
14
- border-radius: calc($pb_pill_height/2);
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: calc($pb_progress_simple_height/2);
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: calc($pb_progress_simple_height/2);
45
+ border-radius: $pb_progress_simple_height/2;
46
46
  background: $primary;
47
47
  }
48
48
 
@@ -1,28 +1,27 @@
1
- /*eslint-disable react/no-multi-comp, flowtype/space-before-type-colon */
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, ref: any) => {
46
- const ariaProps = buildAriaProps(aria)
47
- const dataProps = buildDataProps(data)
48
- const htmlProps = buildHtmlProps(htmlOptions)
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': null, error ? 'error': null,
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 (children)
58
- else
59
- return (
60
- <input
61
- disabled={disabled}
62
- id={id}
63
- name={name}
64
- onChange={onChange}
65
- ref={ref}
66
- text={text}
67
- type="radio"
68
- value={value}
69
- {...props}
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
- <label
75
- {...ariaProps}
76
- {...dataProps}
77
- {...htmlProps}
78
- className={classes}
79
- htmlFor={id}
80
- >
81
- <>{displayRadio(props)}</>
82
- <span className="pb_radio_button" />
83
- <Body
84
- dark={dark}
85
- status={error ? 'negative' : null}
86
- text={label}
87
- variant={null}
88
- />
89
- </label>
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
@@ -14,6 +14,7 @@ examples:
14
14
  - radio_error: With Error
15
15
  - radio_alignment: Alignment
16
16
  - radio_disabled: Disabled
17
+ - radio_children: Children
17
18
 
18
19
  swift:
19
20
  - radio_default_swift: Default
@@ -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
- @mixin preview_first_child {
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 preview_p {
14
+ @mixin preview_tiptap_p {
13
15
  margin: 1rem 0 0 0;
14
16
  min-height: 1rem;
15
17
  }
16
18
 
17
- @mixin preview_code {
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 preview_pre_codeblock {
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 preview_a {
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 preview_blockquote {
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 preview_h1 {
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 preview_h2 {
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 preview_h3 {
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 preview_smaller_headings {
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 preview_hr {
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 preview_ol {
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 preview_ul {
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: calc($space_xs / 2);
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: calc($space_xs / 2);
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 preview_code;
89
+ @include preview_tiptap_code;
90
90
  }
91
91
 
92
92
  pre {
93
- @include preview_pre_codeblock;
93
+ @include preview_tiptap_pre_codeblock;
94
94
  }
95
95
  a {
96
- @include preview_a;
96
+ @include preview_tiptap_a;
97
97
  }
98
98
  blockquote {
99
- @include preview_blockquote;
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 preview_h1;
106
+ @include preview_tiptap_h1;
107
107
  }
108
108
  h2 {
109
- @include preview_h2;
109
+ @include preview_tiptap_h2;
110
110
  }
111
111
  h3 {
112
- @include preview_h3;
112
+ @include preview_tiptap_h3;
113
113
  }
114
114
  h4,
115
115
  h5,
116
116
  h6 {
117
- @include preview_smaller_headings;
117
+ @include preview_tiptap_smaller_headings;
118
118
  }
119
119
  hr {
120
- @include preview_hr;
120
+ @include preview_tiptap_hr;
121
121
  }
122
122
  ol {
123
- @include preview_ol;
123
+ @include preview_tiptap_ol;
124
124
  }
125
125
  ul {
126
- @include preview_ul;
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 preview_first_child;
173
+ @include preview_tiptap_first_child;
174
174
  a {
175
- @include preview_a;
175
+ @include preview_tiptap_a;
176
176
  }
177
177
  blockquote {
178
- @include preview_blockquote;
178
+ @include preview_tiptap_blockquote;
179
179
  }
180
180
  h1 {
181
- @include preview_h1;
181
+ @include preview_tiptap_h1;
182
182
  }
183
183
  h2 {
184
- @include preview_h2;
184
+ @include preview_tiptap_h2;
185
185
  }
186
186
  h3 {
187
- @include preview_h3;
187
+ @include preview_tiptap_h3;
188
188
  }
189
189
  h4,
190
190
  h5,
191
191
  h6 {
192
- @include preview_smaller_headings;
192
+ @include preview_tiptap_smaller_headings;
193
193
  }
194
194
  hr {
195
- @include preview_hr;
195
+ @include preview_tiptap_hr;
196
196
  }
197
197
  ol {
198
- @include preview_ol;
198
+ @include preview_tiptap_ol;
199
199
  }
200
200
  p {
201
- @include preview_p;
201
+ @include preview_tiptap_p;
202
202
  }
203
203
  pre {
204
- @include preview_pre_codeblock;
204
+ @include preview_tiptap_pre_codeblock;
205
205
  }
206
206
  ul {
207
- @include preview_ul;
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
- line-height: 1.5; }
303
- .trix-content * {
304
- box-sizing: border-box;
305
- margin: 0;
306
- padding: 0; }
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
- font-size: 1.2em;
309
- line-height: 1.2; }
315
+ @include preview_trix_h1; }
310
316
  .trix-content blockquote {
311
- border: 0 solid #ccc;
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
- border-width: 0;
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
- margin-left: 1em; }
322
+ @include preview_trix_li; }
323
323
  .trix-content [dir=rtl] li {
324
- margin-right: 1em; }
324
+ @include preview_trix_li; }
325
325
  .trix-content pre {
326
- display: inline-block;
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; }