playbook_ui 7.6.2.pre.alpha1 → 7.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/{sample_screenshot.svg → full_page_samples.svg} +0 -0
  3. data/app/controllers/playbook/application_controller.rb +2 -0
  4. data/app/pb_kits/playbook/_playbook.scss +2 -0
  5. data/app/pb_kits/playbook/data/menu.yml +2 -0
  6. data/app/pb_kits/playbook/index.js +3 -1
  7. data/app/pb_kits/playbook/pb_avatar/_avatar.jsx +1 -1
  8. data/app/pb_kits/playbook/pb_avatar/avatar.test.js +27 -0
  9. data/app/pb_kits/playbook/pb_background/_background.html.erb +1 -1
  10. data/app/pb_kits/playbook/pb_filter/Filter/CurrentFilters.jsx +8 -2
  11. data/app/pb_kits/playbook/pb_filter/Filter/FilterBackground.jsx +9 -2
  12. data/app/pb_kits/playbook/pb_filter/Filter/FilterDouble.jsx +17 -6
  13. data/app/pb_kits/playbook/pb_filter/Filter/FilterSingle.jsx +15 -5
  14. data/app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.jsx +2 -1
  15. data/app/pb_kits/playbook/pb_filter/Filter/ResultsCount.jsx +4 -1
  16. data/app/pb_kits/playbook/pb_filter/Filter/SortMenu.jsx +9 -4
  17. data/app/pb_kits/playbook/pb_filter/Filter/index.jsx +0 -1
  18. data/app/pb_kits/playbook/pb_filter/_filter.scss +44 -23
  19. data/app/pb_kits/playbook/pb_filter/docs/_filter_default.html.erb +3 -2
  20. data/app/pb_kits/playbook/pb_filter/docs/_filter_default.jsx +5 -4
  21. data/app/pb_kits/playbook/pb_filter/docs/_filter_no_background.html.erb +6 -4
  22. data/app/pb_kits/playbook/pb_filter/docs/_filter_no_background.jsx +73 -28
  23. data/app/pb_kits/playbook/pb_filter/docs/_filter_only.jsx +3 -7
  24. data/app/pb_kits/playbook/pb_filter/docs/_filter_single.jsx +4 -3
  25. data/app/pb_kits/playbook/pb_filter/docs/_sort_only.html.erb +1 -2
  26. data/app/pb_kits/playbook/pb_filter/docs/_sort_only.jsx +3 -3
  27. data/app/pb_kits/playbook/pb_filter/docs/example.yml +4 -5
  28. data/app/pb_kits/playbook/pb_form_group/_form_group.jsx +1 -1
  29. data/app/pb_kits/playbook/pb_form_group/_form_group.scss +8 -0
  30. data/app/pb_kits/playbook/pb_form_group/docs/_form_group_button.jsx +2 -0
  31. data/app/pb_kits/playbook/pb_form_group/docs/_form_group_date_picker.jsx +3 -1
  32. data/app/pb_kits/playbook/pb_form_group/docs/_form_group_default.jsx +4 -1
  33. data/app/pb_kits/playbook/pb_form_group/docs/_form_group_select.html.erb +1 -1
  34. data/app/pb_kits/playbook/pb_form_group/docs/_form_group_select.jsx +4 -2
  35. data/app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card.jsx +3 -1
  36. data/app/pb_kits/playbook/pb_form_group/docs/_form_group_selectable_card_icon.jsx +3 -1
  37. data/app/pb_kits/playbook/pb_form_group/docs/_form_group_typeahead.html.erb +32 -4
  38. data/app/pb_kits/playbook/pb_form_group/docs/_form_group_typeahead.jsx +1 -0
  39. data/app/pb_kits/playbook/pb_form_group/docs/example.yml +2 -2
  40. data/app/pb_kits/playbook/pb_form_group/docs/index.js +1 -1
  41. data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.html.erb +24 -0
  42. data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.jsx +105 -0
  43. data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.scss +64 -0
  44. data/app/pb_kits/playbook/pb_icon_stat_value/docs/_icon_stat_value_color.html.erb +49 -0
  45. data/app/pb_kits/playbook/pb_icon_stat_value/docs/_icon_stat_value_color.jsx +67 -0
  46. data/app/pb_kits/playbook/pb_icon_stat_value/docs/_icon_stat_value_default.html.erb +11 -0
  47. data/app/pb_kits/playbook/pb_icon_stat_value/docs/_icon_stat_value_default.jsx +25 -0
  48. data/app/pb_kits/playbook/pb_icon_stat_value/docs/_icon_stat_value_sizes.html.erb +20 -0
  49. data/app/pb_kits/playbook/pb_icon_stat_value/docs/_icon_stat_value_sizes.jsx +35 -0
  50. data/app/pb_kits/playbook/pb_icon_stat_value/docs/_icon_stat_value_vertical.html.erb +7 -0
  51. data/app/pb_kits/playbook/pb_icon_stat_value/docs/_icon_stat_value_vertical.jsx +19 -0
  52. data/app/pb_kits/playbook/pb_icon_stat_value/docs/example.yml +15 -0
  53. data/app/pb_kits/playbook/pb_icon_stat_value/docs/index.js +4 -0
  54. data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.rb +52 -0
  55. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.jsx +2 -2
  56. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_status.jsx +2 -2
  57. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.html.erb +1 -0
  58. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.jsx +123 -0
  59. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.scss +216 -0
  60. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.html.erb +1 -0
  61. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.jsx +10 -0
  62. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_focus.html.erb +3 -0
  63. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_focus.jsx +11 -0
  64. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_simple.html.erb +1 -0
  65. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_simple.jsx +10 -0
  66. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_sticky.html.erb +1 -0
  67. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_sticky.jsx +14 -0
  68. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_templates.html.erb +115 -0
  69. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_templates.jsx +39 -0
  70. data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +15 -0
  71. data/app/pb_kits/playbook/pb_rich_text_editor/docs/index.js +5 -0
  72. data/app/pb_kits/playbook/pb_rich_text_editor/docs/templates.js +75 -0
  73. data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb +55 -0
  74. data/app/pb_kits/playbook/pb_rich_text_editor/useFocus.js +20 -0
  75. data/app/pb_kits/playbook/pb_table/_table.scss +45 -13
  76. data/app/pb_kits/playbook/pb_table/docs/_description.md +1 -0
  77. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column.html.erb +34 -0
  78. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column.jsx +43 -0
  79. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column.md +2 -0
  80. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row.html.erb +34 -0
  81. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row.jsx +43 -0
  82. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row.md +2 -0
  83. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.html.erb +63 -0
  84. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.jsx +70 -0
  85. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.md +2 -0
  86. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.html.erb +52 -0
  87. data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.jsx +61 -0
  88. data/app/pb_kits/playbook/pb_table/docs/example.yml +9 -1
  89. data/app/pb_kits/playbook/pb_table/docs/index.js +4 -1
  90. data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.html.erb +3 -6
  91. data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.jsx +15 -21
  92. data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.scss +0 -17
  93. data/app/pb_kits/playbook/pb_time_stacked/docs/_time_stacked_default.html.erb +4 -1
  94. data/app/pb_kits/playbook/pb_time_stacked/docs/_time_stacked_default.jsx +12 -1
  95. data/app/pb_kits/playbook/pb_time_stacked/docs/example.yml +1 -4
  96. data/app/pb_kits/playbook/pb_time_stacked/docs/index.js +0 -1
  97. data/app/pb_kits/playbook/pb_time_stacked/time_stacked.rb +7 -11
  98. data/app/pb_kits/playbook/react_rails_kits.js +1 -0
  99. data/app/pb_kits/playbook/utilities/globalProps.js +9 -0
  100. data/app/pb_kits/playbook/utilities/test-utils.js +24 -0
  101. data/app/pb_kits/playbook/vendor.js +2 -0
  102. data/lib/playbook/version.rb +1 -1
  103. metadata +53 -10
  104. data/app/pb_kits/playbook/pb_time_stacked/docs/_time_stacked_caption.html.erb +0 -2
  105. data/app/pb_kits/playbook/pb_time_stacked/docs/_time_stacked_caption.jsx +0 -15
@@ -0,0 +1,11 @@
1
+ <%= pb_rails("icon_stat_value", props: { icon: "lightbulb-on",
2
+ text: "Electric",
3
+ unit: "kw",
4
+ value: 64.18
5
+ }) %>
6
+ <br>
7
+ <%= pb_rails("icon_stat_value", props: { icon: "calendar",
8
+ text: "deadline",
9
+ unit: "days",
10
+ value: 24
11
+ }) %>
@@ -0,0 +1,25 @@
1
+ import React from 'react'
2
+ import { IconStatValue } from '../../'
3
+
4
+ const IconStatValueDefault = () => {
5
+ return (
6
+ <div>
7
+ <IconStatValue
8
+ icon="lightbulb-on"
9
+ text="Electric"
10
+ unit="kw"
11
+ value={64.18}
12
+ />
13
+ <br />
14
+ <IconStatValue
15
+ icon="calendar"
16
+ text="deadline"
17
+ unit="days"
18
+ value={24}
19
+ />
20
+ </div>
21
+
22
+ )
23
+ }
24
+
25
+ export default IconStatValueDefault
@@ -0,0 +1,20 @@
1
+ <%= pb_rails("icon_stat_value", props: { icon: "car",
2
+ size: "sm",
3
+ text: "distance driven",
4
+ unit: " mi",
5
+ value: 158.3
6
+ }) %>
7
+ <br>
8
+ <%= pb_rails("icon_stat_value", props: { icon: "car",
9
+ size: "md",
10
+ text: "distance driven",
11
+ unit: " mi",
12
+ value: 158.3
13
+ }) %>
14
+ <br>
15
+ <%= pb_rails("icon_stat_value", props: { icon: "car",
16
+ size: "lg",
17
+ text: "distance driven",
18
+ unit: " mi",
19
+ value: 158.3
20
+ }) %>
@@ -0,0 +1,35 @@
1
+ import React from 'react'
2
+ import { IconStatValue } from '../../'
3
+
4
+ const IconStatValueSizes = () => {
5
+ return (
6
+ <div>
7
+ <IconStatValue
8
+ icon="car"
9
+ size="sm"
10
+ text="distance driven"
11
+ unit="mi"
12
+ value={158.3}
13
+ />
14
+ <br />
15
+ <IconStatValue
16
+ icon="car"
17
+ size="md"
18
+ text="distance driven"
19
+ unit="mi"
20
+ value={158.3}
21
+ />
22
+ <br />
23
+ <IconStatValue
24
+ icon="car"
25
+ size="lg"
26
+ text="distance driven"
27
+ unit="mi"
28
+ value={158.3}
29
+ />
30
+ </div>
31
+
32
+ )
33
+ }
34
+
35
+ export default IconStatValueSizes
@@ -0,0 +1,7 @@
1
+ <%= pb_rails("icon_stat_value", props: { icon: "broadcast-tower",
2
+ orientation: "vertical",
3
+ size: "sm",
4
+ text: "Radio",
5
+ unit: "wkz",
6
+ value: 102.5
7
+ }) %>
@@ -0,0 +1,19 @@
1
+ import React from 'react'
2
+ import { IconStatValue } from '../../'
3
+
4
+ const IconStatValueVertical = () => {
5
+ return (
6
+ <div>
7
+ <IconStatValue
8
+ icon="broadcast-tower"
9
+ orientation="vertical"
10
+ text="Radio"
11
+ unit="wkz"
12
+ value={102.5}
13
+ />
14
+ </div>
15
+
16
+ )
17
+ }
18
+
19
+ export default IconStatValueVertical
@@ -0,0 +1,15 @@
1
+ examples:
2
+
3
+ rails:
4
+ - icon_stat_value_default: Default
5
+ - icon_stat_value_sizes: Size
6
+ - icon_stat_value_vertical: Vertical
7
+ - icon_stat_value_color: Color
8
+
9
+
10
+
11
+ react:
12
+ - icon_stat_value_default: Default
13
+ - icon_stat_value_sizes: Size
14
+ - icon_stat_value_vertical: Vertical
15
+ - icon_stat_value_color: Color
@@ -0,0 +1,4 @@
1
+ export { default as IconStatValueDefault } from './_icon_stat_value_default.jsx'
2
+ export { default as IconStatValueSizes } from './_icon_stat_value_sizes.jsx'
3
+ export { default as IconStatValueVertical } from './_icon_stat_value_vertical.jsx'
4
+ export { default as IconStatValueColor } from './_icon_stat_value_color.jsx'
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Playbook
4
+ module PbIconStatValue
5
+ class IconStatValue
6
+ include Playbook::Props
7
+ include ActionView::Helpers::NumberHelper
8
+
9
+ partial "pb_icon_stat_value/icon_stat_value"
10
+
11
+ prop :icon, required: true
12
+
13
+ prop :size, type: Playbook::Props::Enum,
14
+ values: %w[sm md lg],
15
+ default: "sm"
16
+ prop :variant, type: Playbook::Props::Enum,
17
+ values: %w[default royal blue purple teal red yellow green],
18
+ default: "default"
19
+
20
+ prop :orientation, type: Playbook::Props::Enum,
21
+ values: %w[vertical horizontal],
22
+ default: "horizontal"
23
+
24
+ prop :unit, type: Playbook::Props::String,
25
+ default: ""
26
+
27
+ prop :text, type: Playbook::Props::String,
28
+ default: ""
29
+
30
+ prop :value, type: Playbook::Props::Numeric
31
+
32
+
33
+ def classname
34
+ generate_classname("pb_icon_stat_value_kit", orientation, size, variant)
35
+ end
36
+
37
+ def value_string
38
+ value.to_s
39
+ end
40
+
41
+ def title_size
42
+ if size == "lg"
43
+ 1
44
+ elsif size == "md"
45
+ 2
46
+ else
47
+ 3
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -2,14 +2,14 @@
2
2
  import React from 'react'
3
3
  import ProgressPills from '../_progress_pills.jsx'
4
4
 
5
- const ProgressPillsDefault = () => {
5
+ const ProgressPillsDefault = (props) => {
6
6
  return (
7
7
  <div>
8
8
  <ProgressPills
9
9
  active={2}
10
10
  steps={3}
11
+ {...props}
11
12
  />
12
-
13
13
  </div>
14
14
  )
15
15
  }
@@ -2,7 +2,7 @@
2
2
  import React from 'react'
3
3
  import ProgressPills from '../_progress_pills.jsx'
4
4
 
5
- const ProgressPillsStatus = () => {
5
+ const ProgressPillsStatus = (props) => {
6
6
  return (
7
7
  <div>
8
8
  <ProgressPills
@@ -10,8 +10,8 @@ const ProgressPillsStatus = () => {
10
10
  steps={3}
11
11
  title="Status:"
12
12
  value="Orientation"
13
+ {...props}
13
14
  />
14
-
15
15
  </div>
16
16
  )
17
17
  }
@@ -0,0 +1 @@
1
+ <%= react_component('RichTextEditor', object.rich_text_options) %>
@@ -0,0 +1,123 @@
1
+ /* @flow */
2
+
3
+ import React, { useEffect, useRef } from 'react'
4
+ import classnames from 'classnames'
5
+ import useFocus from './useFocus.js'
6
+ import Trix from 'trix'
7
+ import { globalProps } from '../utilities/globalProps.js'
8
+
9
+ type RichTextEditorProps = {
10
+ className?: string,
11
+ focus?: boolean,
12
+ id?: string,
13
+ onChange: (string) => void,
14
+ placeholder?: string,
15
+ simple?: boolean,
16
+ sticky?: boolean,
17
+ template: string,
18
+ value?: string,
19
+ }
20
+
21
+ const RichTextEditor = (props: RichTextEditorProps) => {
22
+ const {
23
+ className,
24
+ focus = false,
25
+ id,
26
+ onChange,
27
+ placeholder,
28
+ simple = false,
29
+ sticky = false,
30
+ template = '',
31
+ value = '',
32
+ } = props
33
+ const trixRef = useRef()
34
+
35
+ useEffect(() => {
36
+ Trix.config.textAttributes.inlineCode = {
37
+ tagName: 'code',
38
+ inheritable: true,
39
+ }
40
+
41
+ trixRef.current.addEventListener('trix-initialize', (event) => {
42
+ const element = event.target
43
+
44
+ const { toolbarElement, editor } = element
45
+
46
+ const blockCodeButton = toolbarElement.querySelector(
47
+ '[data-trix-attribute=code]'
48
+ )
49
+ const inlineCodeButton = blockCodeButton.cloneNode(true)
50
+
51
+ inlineCodeButton.hidden = true
52
+ inlineCodeButton.dataset.trixAttribute = 'inlineCode'
53
+ blockCodeButton.insertAdjacentElement('afterend', inlineCodeButton)
54
+
55
+ const getCodeFormattingType = () => {
56
+ if (editor.attributeIsActive('code')) return 'block'
57
+ if (editor.attributeIsActive('inlineCode')) return 'inline'
58
+
59
+ const range = editor.getSelectedRange()
60
+ if (range[0] == range[1]) return 'block'
61
+
62
+ const text = editor.getSelectedDocument().toString().trim()
63
+ return /\n/.test(text) ? 'block' : 'inline'
64
+ }
65
+
66
+ element.addEventListener('trix-selection-change', () => {
67
+ const type = getCodeFormattingType()
68
+ blockCodeButton.hidden = type == 'inline'
69
+ inlineCodeButton.hidden = type == 'block'
70
+ })
71
+ })
72
+
73
+ trixRef.current.addEventListener('trix-change', (event) => {
74
+ onChange && onChange(event.target.innerHTML)
75
+ })
76
+ }, [trixRef])
77
+
78
+ useEffect(() => {
79
+ const editor = trixRef.current.editorController.editor
80
+ if (template) {
81
+ editor.loadHTML('')
82
+ editor.setSelectedRange([0, 0])
83
+ editor.insertHTML(template)
84
+ }
85
+ }, [template])
86
+
87
+ focus
88
+ ? (document.addEventListener('trix-focus', useFocus),
89
+ document.addEventListener('trix-blur', useFocus),
90
+ useFocus())
91
+ : null
92
+
93
+ const RichTextEditorClass = 'pb_rich_text_editor_kit'
94
+ const SimpleClass = simple ? 'simple' : ''
95
+ const FocusClass = focus ? 'focus-editor-targets' : ''
96
+ const StickyClass = sticky ? 'sticky' : ''
97
+ const css = classnames(globalProps(props), className)
98
+
99
+ return (
100
+ <div
101
+ className={classnames(
102
+ RichTextEditorClass,
103
+ SimpleClass,
104
+ FocusClass,
105
+ StickyClass,
106
+ css
107
+ )}
108
+ >
109
+ <input
110
+ id={id}
111
+ type="hidden"
112
+ value={value}
113
+ />
114
+ <trix-editor
115
+ input={id}
116
+ placeholder={placeholder}
117
+ ref={trixRef}
118
+ />
119
+ </div>
120
+ )
121
+ }
122
+
123
+ export default RichTextEditor
@@ -0,0 +1,216 @@
1
+ @import "trix/dist/trix";
2
+ @import "../pb_textarea/textarea_mixin";
3
+ @import "../pb_button/_button_mixins";
4
+ @import "../tokens/border_radius";
5
+ @import "../tokens/colors";
6
+ @import "../tokens/typography";
7
+ @import "../tokens/opacity";
8
+ @import "../tokens/spacing";
9
+ @import "../pb_icon/icon";
10
+
11
+
12
+ .trix-content pre {
13
+ display: inline-block;
14
+ width: 100%;
15
+ vertical-align: top;
16
+ font-family: monospace;
17
+ font-size: 0.9em;
18
+ padding: 0.5em;
19
+ white-space: pre;
20
+ background-color: #ccc !important;
21
+ color: black !important;
22
+ overflow-x: auto;
23
+ }
24
+
25
+
26
+ [class^=pb_rich_text_editor_kit] {
27
+
28
+
29
+
30
+ // trix-toolbar { display: none; }
31
+ // Disables File Attatchment Button in Toolbar
32
+ trix-toolbar [data-trix-button-group="file-tools"] {
33
+ display: none;
34
+ }
35
+
36
+ // Simple Mode (shows only BOLD & ITALIC)
37
+ &.simple {
38
+ [data-trix-button-group="history-tools"] {
39
+ display: none;
40
+ }
41
+ [data-trix-button-group="text-tools"] {
42
+ [data-trix-attribute="strike"] {
43
+ display: none;
44
+ }
45
+ [data-trix-attribute="href"] {
46
+ display: none;
47
+ }
48
+ }
49
+ [data-trix-button-group="block-tools"] {
50
+ display: none;
51
+ }
52
+ [data-trix-button-group="file-tools"] {
53
+ display: none;
54
+ }
55
+ }
56
+
57
+ // Focused Styles for Border Radius
58
+ &.focus-editor-targets {
59
+ trix-toolbar {
60
+ display: none;
61
+ }
62
+ :not(.focused-editor) {
63
+ border-top-left-radius: $border_rad_heavier !important;
64
+ border-top-right-radius: $border_rad_heavier !important;
65
+ }
66
+ }
67
+
68
+ &.sticky {
69
+ trix-toolbar {
70
+ position: sticky;
71
+ top: 0;
72
+ z-index: 1;
73
+ }
74
+ }
75
+
76
+
77
+ trix-editor {
78
+ // background-color: $focus_input_light;
79
+ @include pb_textarea_light;
80
+ border-top-left-radius: 0;
81
+ border-top-right-radius: 0;
82
+ }
83
+
84
+ trix-toolbar {
85
+
86
+ .trix-button--icon {
87
+ height: $space_lg;
88
+ width: $space_lg;
89
+ margin: $space_xs / 2;
90
+ border-radius: $space_xs / 4;
91
+ &::before {
92
+ background-size: auto;
93
+ }
94
+ }
95
+ .trix-button-row {
96
+ background: $white;
97
+ border: 1px solid #E4E8F0;
98
+ border-bottom: none;
99
+ padding: $space_xs / 2;
100
+ border-top-left-radius: $border_rad_heavier;
101
+ border-top-right-radius: $border_rad_heavier;
102
+
103
+ .trix-button-group {
104
+ margin-bottom: 0 !important;
105
+ border: none !important;
106
+
107
+ .trix-button {
108
+ border: none;
109
+
110
+ &.trix-active {
111
+ background: $bg_light;
112
+ }
113
+ }
114
+ }
115
+ }
116
+ }
117
+
118
+
119
+
120
+ // Trix doesn't provide customization to their icons.
121
+ // https://github.com/basecamp/trix/issues/464#issuecomment-564683997
122
+
123
+ &[class*=dark] {
124
+ // Dark SVG Icon Styles
125
+ .trix-button--icon-bold::before {
126
+ background-image: url("data:image/svg+xml,%3Csvg width='11px' height='14px' viewBox='0 0 11 14' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg id='Symbols' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0.6'%3E%3Cg id='Rich-Text/Dark/Field-Only/Empty' transform='translate(-19.000000, -17.000000)' fill='%23FFFFFF' fill-rule='nonzero'%3E%3Cg id='Styling1' transform='translate(7.000000, 7.000000)'%3E%3Cpath d='M20.6,16.79 C21.565,16.115 22.25,15.025 22.25,14 C22.25,11.745 20.505,10 18.25,10 L12,10 L12,24 L19.04,24 C21.135,24 22.75,22.3 22.75,20.21 C22.75,18.69 21.885,17.395 20.6,16.79 Z M15,12.5 L18,12.5 C18.83,12.5 19.5,13.17 19.5,14 C19.5,14.83 18.83,15.5 18,15.5 L15,15.5 L15,12.5 L15,12.5 Z M18.5,21.5 L15,21.5 L15,18.5 L18.5,18.5 C19.33,18.5 20,19.17 20,20 C20,20.83 19.33,21.5 18.5,21.5 Z' id='Shape'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
127
+ }
128
+
129
+ .trix-button--icon-italic::before {
130
+ background-image: url("data:image/svg+xml,%3Csvg width='12px' height='14px' viewBox='0 0 12 14' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg id='Symbols' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0.6'%3E%3Cg id='Rich-Text/Dark/Field-Only/Empty' transform='translate(-52.000000, -17.000000)' fill='%23FFFFFF' fill-rule='nonzero'%3E%3Cg id='Styling1' transform='translate(7.000000, 7.000000)'%3E%3Cpolygon id='Shape' points='49 10 49 13 51.215 13 47.785 21 45 21 45 24 53 24 53 21 50.785 21 54.215 13 57 13 57 10'%3E%3C/polygon%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
131
+ }
132
+
133
+ .trix-button--icon-strike::before {
134
+ background-image: url("data:image/svg+xml,%3Csvg width='18px' height='15px' viewBox='0 0 18 15' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg id='Symbols' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0.6'%3E%3Cg id='Rich-Text/Dark/Field-Only/Empty' transform='translate(-83.000000, -17.000000)' fill='%23FFFFFF' fill-rule='nonzero'%3E%3Cg id='Styling1' transform='translate(7.000000, 7.000000)'%3E%3Cpath d='M90.938,19.2 C90.979,19.439 91,19.69 91,19.954 C91,20.823 90.753,21.594 90.259,22.268 C89.765,22.942 89.052,23.466 88.121,23.84 C87.19,24.213 86.098,24.4 84.845,24.4 C83.799,24.4 82.9219,24.335 82.2129,24.204 C81.5039,24.073 80.7663,23.844 80,23.519 L80,23.519 L80,20.146 C80.8092,20.517 81.6507,20.806 82.5244,21.013 C83.398,21.221 84.2,21.325 84.931,21.325 C85.561,21.325 86.023,21.227 86.316,21.032 C86.61,20.838 86.757,20.587 86.757,20.28 C86.757,20.089 86.698,19.921 86.58,19.777 C86.461,19.634 86.272,19.488 86.01,19.341 C85.944,19.304 85.85,19.257 85.728,19.2 L85.728,19.2 Z M94,16.2 L94,18.2 L76,18.2 L76,16.2 L94,16.2 Z M86.026,10 C87.652,10 89.31,10.3353 91,11.006 L89.7,13.9281 C88.232,13.3277 86.965,13.0275 85.897,13.0275 C85.346,13.0275 84.945,13.1138 84.694,13.2862 C84.444,13.4587 84.318,13.6727 84.318,13.9281 C84.318,14.2028 84.478,14.4487 84.796,14.6659 C84.975,14.7877 85.326,14.9657 85.848,15.2 L80.2303,15.2 C80.1484,14.8642 80.1074,14.4978 80.1074,14.1006 C80.1074,12.8104 80.6338,11.8044 81.6865,11.0826 C82.7393,10.3609 84.186,10 86.026,10 Z' id='Combined-Shape'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
135
+ }
136
+
137
+ .trix-button--icon-link::before {
138
+ background-image: url("data:image/svg+xml,%3Csvg width='18px' height='18px' viewBox='0 0 18 18' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg id='Symbols' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0.6'%3E%3Cg id='Rich-Text/Dark/Field-Only/Empty' transform='translate(-117.000000, -15.000000)' fill='%23FFFFFF' fill-rule='nonzero'%3E%3Cg id='Styling1' transform='translate(7.000000, 7.000000)'%3E%3Cpath d='M120.695234,15.0178906 C122.367547,16.6902031 122.367547,19.4110156 120.695234,21.0833281 L117.320234,24.4583281 C116.510234,25.2683281 115.433047,25.7143906 114.287234,25.7143906 C113.141422,25.7143906 112.064234,25.2683281 111.254234,24.4583281 C109.581922,22.7860156 109.581922,20.0652031 111.254234,18.3928906 L113.178729,16.4902344 C113.535917,16.1330469 114.114729,16.1330469 114.471354,16.4902344 C114.827979,16.8474219 114.828542,17.4256719 114.471354,17.7828594 L112.546859,19.6855156 C111.587234,20.6451406 111.587234,22.2060781 112.546859,23.1657031 C113.011484,23.6303281 113.629672,23.8862656 114.287234,23.8862656 C114.944797,23.8862656 115.562422,23.6303281 116.027609,23.1657031 L119.402609,19.7907031 C120.362234,18.8310781 120.362234,17.2701406 119.402609,16.3105156 C119.045422,15.9533281 119.045422,15.3750781 119.402609,15.0178906 C119.759797,14.6607031 120.338047,14.6607031 120.695234,15.0178906 Z M123.287234,8 C124.433047,8 125.509672,8.4460625 126.320234,9.2560625 C127.992547,10.928375 127.992547,13.6491875 126.320234,15.3215 L124.358055,17.0365667 C124.000867,17.3937542 123.422617,17.3937542 123.06543,17.0365667 C122.708242,16.6793792 122.708242,16.1011292 123.06543,15.7439417 L125.027609,14.028875 C125.987234,13.06925 125.987234,11.5083125 125.027609,10.5486875 C124.562984,10.0840625 123.944797,9.828125 123.287234,9.828125 C122.629672,9.828125 122.012047,10.0840625 121.546859,10.5486875 L118.171859,13.9236875 C117.212234,14.8833125 117.212234,16.44425 118.171859,17.403875 C118.529047,17.7610625 118.529047,18.3393125 118.171859,18.6965 C117.993547,18.8748125 117.759547,18.96425 117.525547,18.96425 C117.291547,18.96425 117.057547,18.8748125 116.879234,18.6965 C115.206922,17.0241875 115.206922,14.303375 116.879234,12.6310625 L120.254234,9.2560625 C121.064234,8.4460625 122.141422,8 123.287234,8 Z' id='Combined-Shape'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
139
+ }
140
+
141
+ .trix-button--icon-heading-1::before {
142
+ background-image: url("data:image/svg+xml,%3Csvg width='19px' height='15px' viewBox='0 0 19 15' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg id='Symbols' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0.6'%3E%3Cg id='Rich-Text/Dark/Field-Only/Empty' transform='translate(-171.000000, -17.000000)' fill='%23FFFFFF' fill-rule='nonzero'%3E%3Cg id='Styling2' transform='translate(163.000000, 7.000000)'%3E%3Cpath d='M17,15.016 L17,18.016 L14,18.016 L14,25 L11,25 L11,18.016 L8,18.016 L8,15.016 L17,15.016 L17,15.016 Z M13.968,10 L26.999,10 L26.999,13 L21.983,13 L21.983,25 L18.983,25 L18.983,13 L13.967,13 L13.967,10 L13.968,10 Z' id='Shape'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
143
+ }
144
+
145
+ .trix-button--icon-quote::before {
146
+ background-image: url("data:image/svg+xml,%3Csvg width='14px' height='10px' viewBox='0 0 14 10' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg id='Symbols' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0.6'%3E%3Cg id='Rich-Text/Dark/Field-Only/Empty' transform='translate(-207.000000, -19.000000)' fill='%23FFFFFF' fill-rule='nonzero'%3E%3Cg id='Styling2' transform='translate(163.000000, 7.000000)'%3E%3Cpath d='M45,22 L48,22 L50,18 L50,12 L44,12 L44,18 L47,18 L45,22 Z M53,22 L56,22 L58,18 L58,12 L52,12 L52,18 L55,18 L53,22 Z' id='Shape'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
147
+ }
148
+
149
+ .trix-button--icon-code::before {
150
+ background-image: url("data:image/svg+xml,%3Csvg width='18px' height='10px' viewBox='0 0 18 10' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg id='Symbols' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0.6'%3E%3Cg id='Rich-Text/Dark/Field-Only/Empty' transform='translate(-239.000000, -19.000000)' fill='%23FFFFFF' fill-rule='nonzero'%3E%3Cg id='Styling2' transform='translate(163.000000, 7.000000)'%3E%3Cpath d='M91.17,16.585 L88,19.755 L89.415,21.17 L94,16.585 L89.415,12 L88,13.415 L91.17,16.585 Z M78.83,16.585 L82,13.415 L80.585,12 L76,16.585 L80.585,21.17 L82,19.755 L78.83,16.585 L78.83,16.585 Z' id='Shape'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
151
+ }
152
+
153
+ .trix-button--icon-bullet-list::before {
154
+ background-image: url("data:image/svg+xml,%3Csvg width='20px' height='16px' viewBox='0 0 20 16' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg id='Symbols' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0.6'%3E%3Cg id='Rich-Text/Dark/Field-Only/Empty' transform='translate(-272.000000, -16.000000)' fill='%23FFFFFF' fill-rule='nonzero'%3E%3Cg id='Styling2' transform='translate(163.000000, 7.000000)'%3E%3Cpath d='M111,9 C109.8933,9 109,9.8933 109,11 C109,12.1067 109.8933,13 111,13 C112.1067,13 113,12.1067 113,11 C113,9.8933 112.1067,9 111,9 Z M111,15 C109.8933,15 109,15.893 109,17 C109,18.107 109.8933,19 111,19 C112.1067,19 113,18.107 113,17 C113,15.893 112.1067,15 111,15 Z M111,21 C109.8933,21 109,21.893 109,23 C109,24.107 109.8933,25 111,25 C112.1067,25 113,24.107 113,23 C113,21.893 112.1067,21 111,21 Z M115,24 L129,24 L129,22 L115,22 L115,24 Z M115,18 L129,18 L129,16 L115,16 L115,18 Z M115,10 L115,12 L129,12 L129,10 L115,10 Z' id='Shape'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
155
+ }
156
+
157
+ .trix-button--icon-number-list::before {
158
+ background-image: url("data:image/svg+xml,%3Csvg width='19px' height='16px' viewBox='0 0 19 16' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg id='Symbols' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0.6'%3E%3Cg id='Rich-Text/Dark/Field-Only/Empty' transform='translate(-307.000000, -16.000000)' fill='%23FFFFFF' fill-rule='nonzero'%3E%3Cg id='Styling2' transform='translate(163.000000, 7.000000)'%3E%3Cpath d='M144,22 L146,22 L146,22.5 L145,22.5 L145,23.5 L146,23.5 L146,24 L144,24 L144,25 L147,25 L147,21 L144,21 L144,22 Z M145,13 L146,13 L146,9 L144,9 L144,10 L145,10 L145,13 Z M144,16 L145.8,16 L144,18.1 L144,19 L147,19 L147,18 L145.2,18 L147,15.9 L147,15 L144,15 L144,16 Z M149,10 L149,12 L163,12 L163,10 L149,10 Z M149,24 L163,24 L163,22 L149,22 L149,24 Z M149,18 L163,18 L163,16 L149,16 L149,18 Z' id='Shape'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
159
+ }
160
+
161
+ .trix-button--icon-decrease-nesting-level::before {
162
+ background-image: url("data:image/svg+xml,%3Csvg width='21px' height='14px' viewBox='0 0 21 14' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg id='Symbols' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0.6'%3E%3Cg id='Rich-Text/Dark/Field-Only/Empty' transform='translate(-340.000000, -17.000000)' fill='%23FFFFFF' fill-rule='nonzero'%3E%3Cg id='Styling2' transform='translate(163.000000, 7.000000)'%3E%3Cpath d='M179,24 L198,24 L198,22 L179,22 L179,24 L179,24 Z M186,18 L198,18 L198,16 L186,16 L186,18 L186,18 Z M177.707107,17.7426407 L180.535534,20.5710678 L181.949747,19.1568542 L179.828427,17.0355339 L181.949747,14.9142136 L180.535534,13.5 L177,17.0355339 L177.707107,17.7426407 Z M179,10 L179,12 L198,12 L198,10 L179,10 Z' id='Shape'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
163
+ }
164
+
165
+ .trix-button--icon-increase-nesting-level::before {
166
+ background-image: url("data:image/svg+xml,%3Csvg width='21px' height='14px' viewBox='0 0 21 14' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg id='Symbols' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0.6'%3E%3Cg id='Rich-Text/Dark/Field-Only/Empty' transform='translate(-374.000000, -17.000000)' fill='%23FFFFFF' fill-rule='nonzero'%3E%3Cg id='Styling2' transform='translate(163.000000, 7.000000)'%3E%3Cpath d='M213,24 L232,24 L232,22 L213,22 L213,24 L213,24 Z M220,18 L232,18 L232,16 L220,16 L220,18 L220,18 Z M213.12132,17.0355339 L211,19.1568542 L212.414214,20.5710678 L215.949747,17.0355339 L215.242641,16.3284271 L212.414214,13.5 L211,14.9142136 L213.12132,17.0355339 Z M213,10 L213,12 L232,12 L232,10 L213,10 Z' id='Shape-Copy'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
167
+ }
168
+
169
+ .trix-button--icon-attach::before {
170
+ background-image: url("data:image/svg+xml,%3Csvg width='11px' height='22px' viewBox='0 0 11 22' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg id='Symbols' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='Rich-Text/Dark/Field-Only/Default' transform='translate(-385.000000, -139.000000)' fill='%23ABAFC2' fill-rule='nonzero'%3E%3Cg id='For-Future' transform='translate(338.000000, 139.000000)'%3E%3Cpath d='M56.5,5 L56.5,16.5 C56.5,18.71 54.71,20.5 52.5,20.5 C50.29,20.5 48.5,18.71 48.5,16.5 L48.5,4 C48.5,2.62 49.62,1.5 51,1.5 C52.38,1.5 53.5,2.62 53.5,4 L53.5,14.5 C53.5,15.05 53.055,15.5 52.5,15.5 C51.945,15.5 51.5,15.05 51.5,14.5 L51.5,5 L50,5 L50,14.5 C50,15.88 51.12,17 52.5,17 C53.88,17 55,15.88 55,14.5 L55,4 C55,1.79 53.21,0 51,0 C48.79,0 47,1.79 47,4 L47,16.5 C47,19.54 49.465,22 52.5,22 C55.535,22 58,19.54 58,16.5 L58,5 L56.5,5 Z' id='Path'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
171
+ }
172
+
173
+ .trix-button--icon-undo::before {
174
+ background-image: url("data:image/svg+xml,%3Csvg width='21px' height='9px' viewBox='0 0 21 9' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg id='Symbols' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0.6'%3E%3Cg id='Rich-Text/Dark/Field-Only/Empty' transform='translate(-666.000000, -20.000000)' fill='%23FFFFFF' fill-rule='nonzero'%3E%3Cg id='Undo/Redo' transform='translate(659.000000, 7.000000)'%3E%3Cpath d='M17.5,14 C14.855,14 12.445,14.985 10.6,16.6 L7,13 L7,22 L16,22 L12.385,18.385 C13.77,17.22 15.545,16.5 17.5,16.5 C21.045,16.5 24.045,18.805 25.095,22 L27.46,21.22 C26.085,17.03 22.15,14 17.5,14 Z' id='Path'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
175
+ }
176
+
177
+ .trix-button--icon-redo::before {
178
+ background-image: url("data:image/svg+xml,%3Csvg width='21px' height='9px' viewBox='0 0 21 9' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg id='Symbols' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' fill-opacity='0.6'%3E%3Cg id='Rich-Text/Dark/Field-Only/Empty' transform='translate(-700.000000, -20.000000)' fill='%23FFFFFF' fill-rule='nonzero'%3E%3Cg id='Undo/Redo' transform='translate(659.000000, 7.000000)'%3E%3Cpath d='M57.855,16.6 C56.015,14.985 53.605,14 50.96,14 C46.31,14 42.375,17.03 41,21.22 L43.365,22 C44.415,18.805 47.415,16.5 50.96,16.5 C52.915,16.5 54.69,17.22 56.075,18.385 L52.46,22 L61.46,22 L61.46,13 L57.855,16.6 Z' id='Path'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
179
+ }
180
+
181
+
182
+
183
+
184
+ // Dark Mode Placeholder
185
+ trix-editor:empty:not(:focus)::before {
186
+ color: $text_dk_light;
187
+ }
188
+
189
+ trix-editor {
190
+ @include pb_textarea_dark;
191
+ background: #2f3968;
192
+ border-top-left-radius: 0;
193
+ border-top-right-radius: 0;
194
+ }
195
+
196
+ trix-toolbar {
197
+ .trix-button-row {
198
+ background: #2f3968;
199
+ border: 1px solid rgba(255, 255, 255, 0.1) !important;
200
+ }
201
+ }
202
+
203
+ trix-editor:focus {
204
+ @include pb_textarea_focus_dark;
205
+ }
206
+
207
+ &.error {
208
+ > trix-editor {
209
+ border-color: $error_dark;
210
+ }
211
+ }
212
+ }
213
+ }
214
+
215
+
216
+