playbook_ui 15.2.0.pre.alpha.PLAY2589advancedtableinlinerowloadingtoggleicon11644 → 15.2.0.pre.alpha.PLAY236711331

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 (121) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +0 -2
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +1 -3
  4. data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableHeader.tsx +0 -3
  5. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +0 -3
  6. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +2 -2
  7. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +0 -59
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta.md +1 -3
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_sort.html.erb +3 -3
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.html.erb +3 -3
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_collapsible_trail_rails.html.erb +2 -2
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling.md +1 -1
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_column_headers_rails.html.erb +2 -2
  14. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_rails.html.erb +2 -2
  15. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_rails.md +1 -1
  16. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_row_loading.jsx +0 -16
  17. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_row_loading.md +2 -11
  18. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling_rails.md +1 -1
  19. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_row_styling_react.md +1 -1
  20. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_rails.html.erb +2 -2
  21. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -3
  22. data/app/pb_kits/playbook/pb_advanced_table/index.js +1 -5
  23. data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +6 -6
  24. data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +6 -6
  25. data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +2 -3
  26. data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +5 -49
  27. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern.jsx +1 -1
  28. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.scss +1 -0
  29. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +3 -5
  30. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_description.md +0 -2
  31. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb +1 -4
  32. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.test.js +0 -10
  33. data/app/pb_kits/playbook/pb_pb_line_graph/docs/_description.md +1 -1
  34. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +6 -25
  35. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/Toolbar.tsx +2 -41
  36. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarDropdown.tsx +0 -1
  37. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +20 -60
  38. data/app/pb_kits/playbook/pb_rich_text_editor/_tiptap_styles.scss +0 -36
  39. data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +2 -8
  40. data/app/pb_kits/playbook/pb_rich_text_editor/docs/index.js +0 -6
  41. data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.test.js +1 -127
  42. data/app/pb_kits/playbook/pb_typeahead/_typeahead.test.jsx +1 -35
  43. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +2 -71
  44. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -2
  45. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +0 -1
  46. data/app/pb_kits/playbook/tokens/_positioning.scss +0 -1
  47. data/app/pb_kits/playbook/utilities/_positioning.scss +1 -6
  48. data/app/pb_kits/playbook/utilities/globalProps.ts +1 -3
  49. data/dist/chunks/{_line_graph-D5MBnrO9.js → _line_graph-AKTV-rqw.js} +1 -1
  50. data/dist/chunks/_typeahead-DCInCM2E.js +6 -0
  51. data/dist/chunks/{_weekday_stacked-BQrF2byq.js → _weekday_stacked-ByJl1kOQ.js} +3 -3
  52. data/dist/chunks/vendor.js +1 -1
  53. data/dist/menu.yml +0 -6
  54. data/dist/playbook-doc.js +2 -2
  55. data/dist/playbook-rails-react-bindings.js +1 -1
  56. data/dist/playbook-rails.js +1 -1
  57. data/dist/playbook.css +1 -1
  58. data/lib/playbook/pb_forms_helper.rb +6 -7
  59. data/lib/playbook/version.rb +1 -1
  60. data/lib/playbook/z_index.rb +1 -1
  61. metadata +5 -64
  62. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.html.erb +0 -39
  63. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_background_control_rails.md +0 -1
  64. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control_per_row_rails.html.erb +0 -51
  65. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control_per_row_rails.md +0 -1
  66. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control_rails.html.erb +0 -40
  67. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_padding_control_rails.md +0 -1
  68. data/app/pb_kits/playbook/pb_advanced_table/docs/_mock_data_inline_loading_empty_children.js +0 -42
  69. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_description.md +0 -3
  70. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_description.md +0 -3
  71. data/app/pb_kits/playbook/pb_pb_gauge_chart/_pb_gauge_chart.scss +0 -3
  72. data/app/pb_kits/playbook/pb_pb_gauge_chart/_pb_gauge_chart.tsx +0 -69
  73. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_description.md +0 -3
  74. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_color.html.erb +0 -12
  75. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_color.jsx +0 -24
  76. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_color.md +0 -5
  77. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_complex.html.erb +0 -45
  78. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_complex.jsx +0 -119
  79. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_complex.md +0 -1
  80. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_default.html.erb +0 -5
  81. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_default.jsx +0 -17
  82. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_disable_animation.html.erb +0 -12
  83. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_disable_animation.jsx +0 -24
  84. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_full_circle.html.erb +0 -23
  85. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_full_circle.jsx +0 -37
  86. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_height.html.erb +0 -40
  87. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_height.jsx +0 -56
  88. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_live_data.jsx +0 -64
  89. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_min_max.html.erb +0 -27
  90. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_min_max.jsx +0 -40
  91. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_min_max.md +0 -1
  92. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_sizing.html.erb +0 -19
  93. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_sizing.jsx +0 -65
  94. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_sizing.md +0 -3
  95. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_title.html.erb +0 -14
  96. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_title.jsx +0 -27
  97. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_units.html.erb +0 -39
  98. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_units.jsx +0 -58
  99. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_pb_gauge_chart_units.md +0 -1
  100. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/example.yml +0 -29
  101. data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/index.js +0 -11
  102. data/app/pb_kits/playbook/pb_pb_gauge_chart/pbGaugeGraphTheme.ts +0 -91
  103. data/app/pb_kits/playbook/pb_pb_gauge_chart/pb_gauge_chart.html.erb +0 -1
  104. data/app/pb_kits/playbook/pb_pb_gauge_chart/pb_gauge_chart.rb +0 -25
  105. data/app/pb_kits/playbook/pb_pb_gauge_chart/pb_gauge_chart.test.jsx +0 -80
  106. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_attributes.jsx +0 -38
  107. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_attributes.md +0 -1
  108. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_focus.jsx +0 -34
  109. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_focus.md +0 -1
  110. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_inline.jsx +0 -37
  111. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_inline.md +0 -1
  112. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_simple.jsx +0 -37
  113. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_sticky.jsx +0 -38
  114. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_sticky.md +0 -1
  115. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_templates.jsx +0 -69
  116. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_templates.md +0 -1
  117. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default_options.html.erb +0 -36
  118. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default_options.md +0 -1
  119. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default_value.jsx +0 -41
  120. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default_value.md +0 -1
  121. data/dist/chunks/_typeahead-BjYBazGq.js +0 -6
@@ -1,58 +0,0 @@
1
- import React from 'react'
2
- import PbGaugeChart from '../../pb_pb_gauge_chart/_pb_gauge_chart'
3
- import { colors, typography } from 'playbook-ui'
4
-
5
-
6
- const data1 = [
7
- { name: 'Data Used', y: 32 },
8
- ]
9
- const data2 = [
10
- { name: 'Sales to Date', y: 65 },
11
- ]
12
-
13
- const chartOptions1 = {
14
- title: {
15
- text: "Data Usage",
16
- },
17
- series: [{ data: data1 }],
18
- plotOptions: {
19
- solidgauge: {
20
- dataLabels: {
21
- format:
22
- `<span class="fix">{y:,f}</span>` +
23
- `<span style="fill: ${colors.text_lt_light}; font-size: ${typography.text_larger};">GB</span>`,
24
- },
25
- },
26
- },
27
- };
28
- const chartOptions2 = {
29
- title: {
30
- text: "Sales Goal",
31
- },
32
- series: [{ data: data2 }],
33
- plotOptions: {
34
- solidgauge: {
35
- dataLabels: {
36
- format:
37
- `<span y="28" style="fill: ${colors.text_lt_light}; font-size: ${typography.text_base};">$</span>` +
38
- `<span class="fix" y="38">{y:,f}</span>` +
39
- `<span style="fill: ${colors.text_lt_light}; font-size: ${typography.text_larger};">k</span>`,
40
- },
41
- },
42
- },
43
- };
44
-
45
- const PbGaugeChartUnits = (props) => (
46
- <div>
47
- <PbGaugeChart
48
- options={chartOptions1}
49
- {...props}
50
- />
51
- <PbGaugeChart
52
- options={chartOptions2}
53
- {...props}
54
- />
55
- </div>
56
- )
57
-
58
- export default PbGaugeChartUnits
@@ -1 +0,0 @@
1
- Use custom CSS with classes or inline styles (as shown in these docs) to customize the appearance of prefix and suffix units.
@@ -1,29 +0,0 @@
1
- examples:
2
-
3
- rails:
4
- - pb_gauge_chart_default: Default
5
- - pb_gauge_chart_disable_animation: Disable Animation
6
- - pb_gauge_chart_title: With Title
7
- - pb_gauge_chart_units: With Units
8
- - pb_gauge_chart_full_circle: Full Circle
9
- - pb_gauge_chart_min_max: With Min and Max Labels
10
- - pb_gauge_chart_sizing: Sizing
11
- - pb_gauge_chart_height: Height
12
- - pb_gauge_chart_color: Custom Color
13
- - pb_gauge_chart_complex: Complex Example
14
-
15
-
16
- react:
17
- - pb_gauge_chart_default: Default
18
- - pb_gauge_chart_disable_animation: Disable Animation
19
- - pb_gauge_chart_title: With Title
20
- - pb_gauge_chart_units: With Units
21
- - pb_gauge_chart_full_circle: Full Circle
22
- - pb_gauge_chart_min_max: With Min and Max Labels
23
- - pb_gauge_chart_sizing: Sizing
24
- - pb_gauge_chart_height: Height
25
- - pb_gauge_chart_live_data: Live Data
26
- - pb_gauge_chart_color: Custom Color
27
- - pb_gauge_chart_complex: Complex Example
28
-
29
-
@@ -1,11 +0,0 @@
1
- export { default as PbGaugeChartDefault } from './_pb_gauge_chart_default.jsx'
2
- export { default as PbGaugeChartDisableAnimation } from './_pb_gauge_chart_disable_animation.jsx'
3
- export { default as PbGaugeChartTitle } from './_pb_gauge_chart_title.jsx'
4
- export { default as PbGaugeChartUnits } from './_pb_gauge_chart_units.jsx'
5
- export { default as PbGaugeChartFullCircle } from './_pb_gauge_chart_full_circle.jsx'
6
- export { default as PbGaugeChartMinMax } from './_pb_gauge_chart_min_max.jsx'
7
- export { default as PbGaugeChartSizing } from './_pb_gauge_chart_sizing.jsx'
8
- export { default as PbGaugeChartHeight } from './_pb_gauge_chart_height.jsx'
9
- export { default as PbGaugeChartLiveData } from './_pb_gauge_chart_live_data.jsx'
10
- export { default as PbGaugeChartColor } from './_pb_gauge_chart_color.jsx'
11
- export { default as PbGaugeChartComplex } from './_pb_gauge_chart_complex.jsx'
@@ -1,91 +0,0 @@
1
- import colors from '../tokens/exports/_colors.module.scss'
2
- import typography from '../tokens/exports/_typography.module.scss'
3
-
4
- const pbGaugeGraphTheme = {
5
- title: {
6
- text: "",
7
- style: {
8
- fontFamily: typography.font_family_base,
9
- fontSize: typography.text_larger,
10
- },
11
- },
12
- chart: {
13
- type: "solidgauge",
14
- events: {
15
- render() {
16
- this.container
17
- const arc = this.container.querySelector('path.gauge-pane');
18
- if (arc) arc.setAttribute('stroke-linejoin', 'round');
19
- }
20
- }
21
- },
22
- pane: {
23
- size: "90%",
24
- startAngle: -100,
25
- endAngle: 100,
26
- background: [
27
- {
28
- borderWidth: 20,
29
- innerRadius: "90%",
30
- outerRadius: "90%",
31
- shape: "arc",
32
- className: "gauge-pane",
33
- borderColor: colors.border_light,
34
- borderRadius: '50%',
35
- },
36
- ],
37
- },
38
- tooltip: {
39
- backgroundColor: {
40
- linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
41
- stops: [
42
- [0, colors.bg_dark],
43
- [1, colors.bg_dark],
44
- ],
45
- },
46
- pointFormat:
47
- '<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: ' +
48
- "<b>{point.y}</b>",
49
- followPointer: true,
50
- shadow: false,
51
- borderWidth: 0,
52
- borderRadius: 10,
53
- style: {
54
- fontFamily: typography.font_family_base,
55
- color: colors.text_dk_default,
56
- fontWeight: typography.regular,
57
- fontSize: typography.text_smaller,
58
- },
59
- },
60
- yAxis: {
61
- min: 0,
62
- max: 100,
63
- lineWidth: 0,
64
- tickPositions: [] as number[],
65
- },
66
- plotOptions: {
67
- solidgauge: {
68
- borderColor: colors.data_1,
69
- borderWidth: 20,
70
- color: colors.data_1,
71
- radius: 90,
72
- innerRadius: "90%",
73
- y: -26,
74
- dataLabels: {
75
- borderWidth: 0,
76
- color: colors.text_lt_default,
77
- enabled: true,
78
- format: '<span class="fix">{y:,f}</span>',
79
- style: {
80
- fontFamily: typography.font_family_base,
81
- fontWeight: typography.regular,
82
- fontSize: typography.heading_2,
83
- },
84
- y: -26,
85
- },
86
- },
87
- },
88
- credits: { enabled: false }
89
- }
90
-
91
- export default pbGaugeGraphTheme;
@@ -1 +0,0 @@
1
- <%= react_component('PbGaugeChart', object.react_props) %>
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Playbook
4
- module PbPbGaugeChart
5
- class PbGaugeChart < ::Playbook::KitBase
6
- prop :options, default: {}
7
-
8
- def react_props
9
- {
10
- className: classname,
11
- data: data,
12
- options: options,
13
- id: id,
14
- }
15
- end
16
-
17
- def classname
18
- # Highcharts react needs classname attached to the container div,
19
- # we pass an empty string here to avoid conflicts, classname is built in the TSX
20
- # We still need generate_classnames to retain ability to pass in custom classnames or global props
21
- generate_classname("")
22
- end
23
- end
24
- end
25
- end
@@ -1,80 +0,0 @@
1
- import React from 'react'
2
- import { render, screen } from '../utilities/test-utils'
3
-
4
- import { PbGaugeChart } from 'playbook-ui'
5
-
6
- beforeEach(() => {
7
- // Silences error logs within the test suite.
8
- jest.spyOn(console, 'error');
9
- jest.spyOn(console, 'warn');
10
- console.error.mockImplementation(() => {});
11
- console.warn.mockImplementation(() => {});
12
- });
13
-
14
- afterEach(() => {
15
- console.error.mockRestore();
16
- console.warn.mockRestore();
17
- });
18
-
19
- const chartOptions = {
20
- series:[{data:[{ name: "Name", y: 45 }]}]
21
- }
22
-
23
- const testId = 'pbgaugechart1'
24
-
25
- test('Kit to exist', () => {
26
- render(
27
- <PbGaugeChart
28
- data={{testid: testId}}
29
- options={chartOptions}
30
- />
31
- )
32
- expect(screen.getByTestId(testId)).toBeInTheDocument()
33
- })
34
-
35
- test('Kit to apply base classname', () => {
36
- render(
37
- <PbGaugeChart
38
- data={{testid: testId}}
39
- options={chartOptions}
40
- />
41
- )
42
-
43
- expect(screen.getByTestId(testId)).toHaveClass('pb_pb_gauge_chart')
44
- })
45
-
46
- test('Kit to have custom class', () => {
47
- render(
48
- <PbGaugeChart
49
- className='custom-class'
50
- data={{testid: testId}}
51
- options={chartOptions}
52
- />
53
- )
54
-
55
- expect(screen.getByTestId(testId)).toHaveClass('custom-class')
56
- })
57
-
58
- test('Kit to apply global props', () => {
59
- render(
60
- <PbGaugeChart
61
- data={{testid: testId}}
62
- margin="lg"
63
- options={chartOptions}
64
- />
65
- )
66
-
67
- expect(screen.getByTestId(testId)).toHaveClass('m_lg')
68
- })
69
-
70
- test('kit to apply id', () => {
71
- render(
72
- <PbGaugeChart
73
- data={{testid: testId}}
74
- id='gauge-chart-id'
75
- options={chartOptions}
76
- />
77
- )
78
-
79
- expect(screen.getByTestId(testId)).toHaveAttribute('id', 'gauge-chart-id')
80
- })
@@ -1,38 +0,0 @@
1
- import React from 'react'
2
- import RichTextEditor from '../../pb_rich_text_editor/_rich_text_editor'
3
- import { useEditor, EditorContent } from "@tiptap/react"
4
- import StarterKit from "@tiptap/starter-kit"
5
- import Link from '@tiptap/extension-link'
6
-
7
-
8
- const RichTextEditorAdvancedAttributes = (props) => {
9
-
10
- const editor = useEditor({
11
- extensions: [
12
- StarterKit,
13
- Link
14
- ],
15
- content:"Add your text here. You can format your text, add links, quotes, and bullets."
16
- })
17
- if (!editor) {
18
- return null
19
- }
20
-
21
-
22
-
23
-
24
- return (
25
- <div>
26
- <RichTextEditor
27
- advancedEditor={editor}
28
- aria={{ label: 'I am a rich text editor' }}
29
- data={{ 'test-data': 'value', 'test-data2': 'value2' }}
30
- {...props}
31
- >
32
- <EditorContent editor={editor}/>
33
- </RichTextEditor>
34
- </div>
35
- )
36
- }
37
-
38
- export default RichTextEditorAdvancedAttributes
@@ -1 +0,0 @@
1
- Aria labels and data attributes can also be added to the top level div for the RichTextEditor.
@@ -1,34 +0,0 @@
1
- import React from 'react'
2
- import RichTextEditor from '../../pb_rich_text_editor/_rich_text_editor'
3
- import { useEditor, EditorContent } from "@tiptap/react"
4
- import StarterKit from "@tiptap/starter-kit"
5
- import Link from '@tiptap/extension-link'
6
-
7
-
8
- const RichTextEditorAdvancedFocus = (props) => {
9
- const editor = useEditor({
10
- extensions: [
11
- StarterKit,
12
- Link
13
- ],
14
- content:"Click inside to see the toolbar. Click outside to hide it."
15
- })
16
-
17
- if (!editor) {
18
- return null
19
- }
20
-
21
- return (
22
- <div>
23
- <RichTextEditor
24
- advancedEditor={editor}
25
- focus
26
- {...props}
27
- >
28
- <EditorContent editor={editor}/>
29
- </RichTextEditor>
30
- </div>
31
- )
32
- }
33
-
34
- export default RichTextEditorAdvancedFocus
@@ -1 +0,0 @@
1
- When the optional `focus` prop is set to true, the toolbar will only show once you click in to the RichTextEditor.
@@ -1,37 +0,0 @@
1
- import React from 'react'
2
- import RichTextEditor from '../../pb_rich_text_editor/_rich_text_editor'
3
- import { useEditor, EditorContent } from "@tiptap/react"
4
- import StarterKit from "@tiptap/starter-kit"
5
- import Link from '@tiptap/extension-link'
6
-
7
-
8
- const RichTextEditorAdvancedInline = (props) => {
9
-
10
- const editor = useEditor({
11
- extensions: [
12
- StarterKit,
13
- Link
14
- ],
15
- content:"Add your text here. You can format your text, add links, quotes, and bullets."
16
- })
17
- if (!editor) {
18
- return null
19
- }
20
-
21
-
22
-
23
-
24
- return (
25
- <div>
26
- <RichTextEditor
27
- advancedEditor={editor}
28
- inline
29
- {...props}
30
- >
31
- <EditorContent editor={editor}/>
32
- </RichTextEditor>
33
- </div>
34
- )
35
- }
36
-
37
- export default RichTextEditorAdvancedInline
@@ -1 +0,0 @@
1
- When the optional `inline` prop is set to true, the editor borders and the toolbar will only be visible when hovered or focused on.
@@ -1,37 +0,0 @@
1
- import React from 'react'
2
- import RichTextEditor from '../../pb_rich_text_editor/_rich_text_editor'
3
- import { useEditor, EditorContent } from "@tiptap/react"
4
- import StarterKit from "@tiptap/starter-kit"
5
- import Link from '@tiptap/extension-link'
6
-
7
-
8
- const RichTextEditorAdvancedSimple = (props) => {
9
-
10
- const editor = useEditor({
11
- extensions: [
12
- StarterKit,
13
- Link
14
- ],
15
- content:"Add your text here. Use the simple toolbar above to format your text"
16
- })
17
- if (!editor) {
18
- return null
19
- }
20
-
21
-
22
-
23
-
24
- return (
25
- <div>
26
- <RichTextEditor
27
- advancedEditor={editor}
28
- simple
29
- {...props}
30
- >
31
- <EditorContent editor={editor}/>
32
- </RichTextEditor>
33
- </div>
34
- )
35
- }
36
-
37
- export default RichTextEditorAdvancedSimple
@@ -1,38 +0,0 @@
1
- import React from 'react'
2
- import RichTextEditor from '../../pb_rich_text_editor/_rich_text_editor'
3
- import { useEditor, EditorContent } from "@tiptap/react"
4
- import StarterKit from "@tiptap/starter-kit"
5
- import Link from '@tiptap/extension-link'
6
-
7
-
8
- const RichTextEditorAdvancedSticky = (props) => {
9
-
10
- const editor = useEditor({
11
- extensions: [
12
- StarterKit,
13
- Link
14
- ],
15
- content:"In this example, when you scroll down, the rich text editor's toolbar will scroll along with the page and it will no longer be visible at the top of the page. Dummy text to enable scroll.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ornare lorem ut pellentesque tempor. Vivamus ut ex vestibulum velit rich text editor eleifend fringilla. Sed non metus dictum, elementum mauris wysiwyg html editor non, sagittis odio. Nullam pellentesque leo sit amet ante suscipit wysiwyg html editor sagittis. Donec tempus vulputate suscipit. Ut non felis rich text editor ac dolor pulvinar lacinia eu eget urna. Sed tincidunt sapien vulputate tellus fringilla sodales. Morbi accumsan dui wysiwyg html editor sed massa pellentesque, quis vestibulum lectus scelerisque. Nulla ultrices mi id felis luctus aliquet. Donec nec ligula wysiwyg html editor pretium sapien semper dictum eu id quam. Etiam ut sollicitudin nibh. Quisque eu ultrices dui. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus rich text editor mi eu consequat. Nullam tincidunt erat et placerat mattis. Nunc rich text editor congue, enim vitae dictum dignissim, libero nisl sagittis augue, non aliquet nibh tortor sit amet ex. Aliquam cursus maximus mi eu consequat. Nullam tincidunt erat et placerat mattis."
16
-
17
- })
18
- if (!editor) {
19
- return null
20
- }
21
-
22
-
23
-
24
-
25
- return (
26
- <div>
27
- <RichTextEditor
28
- advancedEditor={editor}
29
- sticky
30
- {...props}
31
- >
32
- <EditorContent editor={editor}/>
33
- </RichTextEditor>
34
- </div>
35
- )
36
- }
37
-
38
- export default RichTextEditorAdvancedSticky
@@ -1 +0,0 @@
1
- Use the optional `sticky` prop to make the toolbar sticky on scroll.
@@ -1,69 +0,0 @@
1
- import React, {useState, useEffect} from 'react'
2
- import RichTextEditor from '../../pb_rich_text_editor/_rich_text_editor'
3
- import { useEditor, EditorContent } from "@tiptap/react"
4
- import StarterKit from "@tiptap/starter-kit"
5
- import Link from '@tiptap/extension-link'
6
-
7
- import Select from '../../pb_select/_select'
8
- import { changelog, release } from './templates.js'
9
-
10
- const RichTextEditorAdvancedTemplates = (props) => {
11
-
12
- const [editorContent, setEditorContent] = useState('')
13
-
14
- const handleChange = (event) => {
15
- setEditorContent(event.target.value)
16
- }
17
- const templatesOptions = [
18
- {
19
- value: release,
20
- text: 'Playbook Release',
21
- },
22
- {
23
- value: changelog,
24
- text: 'Changelog',
25
- },
26
- ]
27
-
28
- const editor = useEditor({
29
- extensions: [
30
- StarterKit,
31
- Link
32
- ],
33
- content: editorContent
34
- })
35
-
36
- // Update editor content when editorContent state changes
37
- useEffect(() => {
38
- if (editor && editorContent) {
39
- editor.commands.setContent(editorContent)
40
- }
41
- }, [editor, editorContent])
42
-
43
- if (!editor) {
44
- return null
45
- }
46
-
47
-
48
-
49
-
50
- return (
51
- <div>
52
- <Select
53
- blankSelection="Select a template..."
54
- label="Template"
55
- onChange={handleChange}
56
- options={templatesOptions}
57
- {...props}
58
- />
59
- <RichTextEditor
60
- advancedEditor={editor}
61
- {...props}
62
- >
63
- <EditorContent editor={editor}/>
64
- </RichTextEditor>
65
- </div>
66
- )
67
- }
68
-
69
- export default RichTextEditorAdvancedTemplates
@@ -1 +0,0 @@
1
- Tiptap allows you to set content within the editor using the 'content' prop within useEditor. See the code snippet below to see how this can be done.
@@ -1,36 +0,0 @@
1
- <%
2
- options = [
3
- { label: 'Orange', value: '#FFA500' },
4
- { label: 'Red', value: '#FF0000' },
5
- { label: 'Green', value: '#1e3d1eff' },
6
- { label: 'Blue', value: '#0000FF' },
7
- { label: 'Purple', value: '#800080' },
8
- { label: 'Yellow', value: '#FFFF00' },
9
- { label: 'Pink', value: '#FFC0CB' },
10
- { label: 'Brown', value: '#A52A2A' },
11
- { label: 'Black', value: '#000000' },
12
- { label: 'White', value: '#FFFFFF' },
13
- { label: 'Gray', value: '#808080' },
14
- { label: 'Cyan', value: '#00FFFF' },
15
- { label: 'Magenta', value: '#FF00FF' },
16
- { label: 'Lime', value: '#00FF00' },
17
- { label: 'Maroon', value: '#800000' },
18
- { label: 'Olive', value: '#808000' },
19
- { label: 'Navy', value: '#000080' },
20
- { label: 'Teal', value: '#008080' },
21
- { label: 'Silver', value: '#C0C0C0' },
22
- { label: 'Gold', value: '#FFD700' },
23
- { label: 'Beige', value: '#F5F5DC' },
24
- { label: 'Coral', value: '#FF7F50' }
25
- ]
26
- %>
27
-
28
- <%= pb_rails("typeahead", props: {
29
- default_options: [{ label: 'Gray', value: '#808080' }],
30
- id: "typeahead-default-value",
31
- options: options,
32
- label: "Colors",
33
- name: :foo,
34
- is_multi: false
35
- })
36
- %>
@@ -1 +0,0 @@
1
- The optional `default_options` prop can be used to set a default value for the kit. When a default value is set, focus will be automatically set to the selected option and the dropdown container will scroll to bring the selected option into view.
@@ -1,41 +0,0 @@
1
- import React from 'react'
2
-
3
- import Typeahead from '../_typeahead'
4
-
5
- const options = [
6
- { label: 'Orange', value: '#FFA500' },
7
- { label: 'Red', value: '#FF0000' },
8
- { label: 'Green', value: '#1e3d1eff' },
9
- { label: 'Blue', value: '#0000FF' },
10
- { label: 'Purple', value: '#800080' },
11
- { label: 'Yellow', value: '#FFFF00' },
12
- { label: 'Pink', value: '#FFC0CB' },
13
- { label: 'Brown', value: '#A52A2A' },
14
- { label: 'Black', value: '#000000' },
15
- { label: 'White', value: '#FFFFFF' },
16
- { label: 'Gray', value: '#808080' },
17
- { label: 'Cyan', value: '#00FFFF' },
18
- { label: 'Magenta', value: '#FF00FF' },
19
- { label: 'Lime', value: '#00FF00' },
20
- { label: 'Maroon', value: '#800000' },
21
- { label: 'Olive', value: '#808000' },
22
- { label: 'Navy', value: '#000080' },
23
- { label: 'Teal', value: '#008080' },
24
- { label: 'Silver', value: '#C0C0C0' },
25
- { label: 'Gold', value: '#FFD700' },
26
- { label: 'Beige', value: '#F5F5DC' },
27
- { label: 'Coral', value: '#FF7F50' }
28
- ]
29
-
30
- const TypeaheadDefaultValue = (props) => {
31
- return (
32
- <Typeahead
33
- defaultValue={options[10]}
34
- label="Colors"
35
- options={options}
36
- {...props}
37
- />
38
- )
39
- }
40
-
41
- export default TypeaheadDefaultValue