playbook_ui 12.17.0 → 12.18.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown617

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/index.js +1 -1
  3. data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.html.erb +1 -2
  4. data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +2 -2
  5. data/app/pb_kits/playbook/pb_date_picker/_date_picker.scss +26 -0
  6. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +99 -95
  7. data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +1 -1
  8. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +1 -1
  9. data/app/pb_kits/playbook/pb_date_picker/date_picker.test.js +44 -1
  10. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +34 -2
  11. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick.html.erb +8 -0
  12. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick.jsx +18 -0
  13. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +2 -0
  14. data/app/pb_kits/playbook/pb_date_picker/docs/index.js +2 -1
  15. data/app/pb_kits/playbook/pb_date_picker/plugins/quickPick.tsx +161 -0
  16. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_calendar_input_icon.scss +4 -3
  17. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_quick_pick_styles.scss +75 -0
  18. data/app/pb_kits/playbook/pb_docs/kit_api.html.erb +48 -36
  19. data/app/pb_kits/playbook/pb_docs/kit_api.rb +97 -9
  20. data/app/pb_kits/playbook/pb_docs/kit_example.html.erb +1 -1
  21. data/app/pb_kits/playbook/pb_docs/kit_example.rb +9 -5
  22. data/app/pb_kits/playbook/pb_lightbox/_lightbox.tsx +3 -0
  23. data/app/pb_kits/playbook/pb_lightbox/docs/_lightbox_compound_component.jsx +5 -1
  24. data/app/pb_kits/playbook/pb_lightbox/docs/_lightbox_current_photo.jsx +1 -1
  25. data/app/pb_kits/playbook/pb_lightbox/docs/_lightbox_custom_header.jsx +5 -1
  26. data/app/pb_kits/playbook/pb_lightbox/docs/_lightbox_default.jsx +5 -1
  27. data/app/pb_kits/playbook/pb_lightbox/docs/_lightbox_default.md +1 -1
  28. data/app/pb_kits/playbook/pb_lightbox/docs/_lightbox_multiple.jsx +5 -1
  29. data/app/pb_kits/playbook/pb_lightbox/lightbox.test.jsx +5 -1
  30. data/app/pb_kits/playbook/pb_nav/_item.tsx +7 -7
  31. data/app/pb_kits/playbook/pb_nav/_nav.tsx +4 -4
  32. data/app/pb_kits/playbook/pb_nav/_subtle_mixin.scss +1 -1
  33. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/EditorButton.tsx +49 -0
  34. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/EditorTypes.ts +9 -0
  35. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/Toolbar.tsx +62 -0
  36. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarDropdown.tsx +139 -0
  37. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarHistory.tsx +45 -0
  38. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarNodes.tsx +59 -0
  39. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.scss +1 -1
  40. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +28 -12
  41. data/app/pb_kits/playbook/pb_rich_text_editor/_tiptap_styles.scss +231 -0
  42. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_description.md +1 -0
  43. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_default.jsx +36 -0
  44. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_default.md +4 -0
  45. data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +1 -0
  46. data/app/pb_kits/playbook/pb_rich_text_editor/docs/index.js +1 -0
  47. data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.tsx +185 -0
  48. data/app/pb_kits/playbook/pb_time_range_inline/time_range_inline.test.js +85 -0
  49. data/app/pb_kits/playbook/pb_title/_title.tsx +1 -1
  50. data/app/pb_kits/playbook/pb_title_detail/_title_detail.tsx +45 -0
  51. data/app/pb_kits/playbook/pb_title_detail/title_detail.test.js +71 -0
  52. data/app/pb_kits/playbook/pb_toggle/{_toggle.jsx → _toggle.tsx} +20 -22
  53. data/app/pb_kits/playbook/pb_toggle/toggle.test.js +67 -0
  54. data/app/pb_kits/playbook/pb_tooltip/_tooltip.scss +11 -6
  55. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_default.html.erb +4 -4
  56. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_with_icon_circle.html.erb +1 -2
  57. data/app/pb_kits/playbook/pb_tooltip/docs/example.yml +0 -1
  58. data/app/pb_kits/playbook/pb_user/_user.tsx +1 -1
  59. data/lib/playbook/markdown/helper.rb +50 -71
  60. data/lib/playbook/markdown.rb +0 -1
  61. data/lib/playbook/number_spacing.rb +10 -10
  62. data/lib/playbook/position.rb +10 -10
  63. data/lib/playbook/spacing.rb +10 -10
  64. data/lib/playbook/version.rb +2 -2
  65. data/lib/playbook/z_index.rb +10 -10
  66. metadata +29 -14
  67. data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.jsx +0 -172
  68. data/app/pb_kits/playbook/pb_title_detail/_title_detail.jsx +0 -44
  69. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_white.html.erb +0 -9
  70. data/lib/playbook/markdown/template_handler.rb +0 -47
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.17.0
4
+ version: 12.18.0.pre.alpha.PLAY603datepickerquickpickinputpresetdropdown617
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
8
8
  - Power Devs
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-04-27 00:00:00.000000000 Z
12
+ date: 2023-05-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -73,14 +73,14 @@ dependencies:
73
73
  requirements:
74
74
  - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: '3.5'
76
+ version: '3.6'
77
77
  type: :runtime
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - "~>"
82
82
  - !ruby/object:Gem::Version
83
- version: '3.5'
83
+ version: '3.6'
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: rouge
86
86
  requirement: !ruby/object:Gem::Requirement
@@ -745,6 +745,8 @@ files:
745
745
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_positions.md
746
746
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_positions_element.html.erb
747
747
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_positions_element.jsx
748
+ - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick.html.erb
749
+ - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick.jsx
748
750
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range.html.erb
749
751
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range.jsx
750
752
  - app/pb_kits/playbook/pb_date_picker/docs/_date_picker_time.html.erb
@@ -759,6 +761,7 @@ files:
759
761
  - app/pb_kits/playbook/pb_date_picker/docs/_description.md
760
762
  - app/pb_kits/playbook/pb_date_picker/docs/example.yml
761
763
  - app/pb_kits/playbook/pb_date_picker/docs/index.js
764
+ - app/pb_kits/playbook/pb_date_picker/plugins/quickPick.tsx
762
765
  - app/pb_kits/playbook/pb_date_picker/plugins/timeSelect.ts
763
766
  - app/pb_kits/playbook/pb_date_picker/sass_partials/_calendar_input_icon.scss
764
767
  - app/pb_kits/playbook/pb_date_picker/sass_partials/_day_styles.scss
@@ -768,6 +771,7 @@ files:
768
771
  - app/pb_kits/playbook/pb_date_picker/sass_partials/_input_styles.scss
769
772
  - app/pb_kits/playbook/pb_date_picker/sass_partials/_month_and_year_styles.scss
770
773
  - app/pb_kits/playbook/pb_date_picker/sass_partials/_overrides.scss
774
+ - app/pb_kits/playbook/pb_date_picker/sass_partials/_quick_pick_styles.scss
771
775
  - app/pb_kits/playbook/pb_date_picker/sass_partials/_time_selection_styles.scss
772
776
  - app/pb_kits/playbook/pb_date_picker/sass_partials/_week_styles.scss
773
777
  - app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.scss
@@ -1719,9 +1723,19 @@ files:
1719
1723
  - app/pb_kits/playbook/pb_radio/radio.html.erb
1720
1724
  - app/pb_kits/playbook/pb_radio/radio.rb
1721
1725
  - app/pb_kits/playbook/pb_radio/radio.test.js
1726
+ - app/pb_kits/playbook/pb_rich_text_editor/TipTap/EditorButton.tsx
1727
+ - app/pb_kits/playbook/pb_rich_text_editor/TipTap/EditorTypes.ts
1728
+ - app/pb_kits/playbook/pb_rich_text_editor/TipTap/Toolbar.tsx
1729
+ - app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarDropdown.tsx
1730
+ - app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarHistory.tsx
1731
+ - app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarNodes.tsx
1722
1732
  - app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.scss
1723
1733
  - app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx
1734
+ - app/pb_kits/playbook/pb_rich_text_editor/_tiptap_styles.scss
1724
1735
  - app/pb_kits/playbook/pb_rich_text_editor/_trix_styles.scss
1736
+ - app/pb_kits/playbook/pb_rich_text_editor/docs/_description.md
1737
+ - app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_default.jsx
1738
+ - app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_default.md
1725
1739
  - app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_attributes.html.erb
1726
1740
  - app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_attributes.jsx
1727
1741
  - app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.html.erb
@@ -2074,14 +2088,15 @@ files:
2074
2088
  - app/pb_kits/playbook/pb_time/docs/index.js
2075
2089
  - app/pb_kits/playbook/pb_time/time.html.erb
2076
2090
  - app/pb_kits/playbook/pb_time/time.rb
2077
- - app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.jsx
2078
2091
  - app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.scss
2092
+ - app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.tsx
2079
2093
  - app/pb_kits/playbook/pb_time_range_inline/docs/_time_range_inline_default.html.erb
2080
2094
  - app/pb_kits/playbook/pb_time_range_inline/docs/_time_range_inline_default.jsx
2081
2095
  - app/pb_kits/playbook/pb_time_range_inline/docs/example.yml
2082
2096
  - app/pb_kits/playbook/pb_time_range_inline/docs/index.js
2083
2097
  - app/pb_kits/playbook/pb_time_range_inline/time_range_inline.html.erb
2084
2098
  - app/pb_kits/playbook/pb_time_range_inline/time_range_inline.rb
2099
+ - app/pb_kits/playbook/pb_time_range_inline/time_range_inline.test.js
2085
2100
  - app/pb_kits/playbook/pb_time_stacked/_time_stacked.scss
2086
2101
  - app/pb_kits/playbook/pb_time_stacked/_time_stacked.tsx
2087
2102
  - app/pb_kits/playbook/pb_time_stacked/docs/_time_stacked_default.html.erb
@@ -2162,8 +2177,8 @@ files:
2162
2177
  - app/pb_kits/playbook/pb_title_count/title_count.html.erb
2163
2178
  - app/pb_kits/playbook/pb_title_count/title_count.rb
2164
2179
  - app/pb_kits/playbook/pb_title_count/title_count.test.js
2165
- - app/pb_kits/playbook/pb_title_detail/_title_detail.jsx
2166
2180
  - app/pb_kits/playbook/pb_title_detail/_title_detail.scss
2181
+ - app/pb_kits/playbook/pb_title_detail/_title_detail.tsx
2167
2182
  - app/pb_kits/playbook/pb_title_detail/docs/_description.md
2168
2183
  - app/pb_kits/playbook/pb_title_detail/docs/_footer.md
2169
2184
  - app/pb_kits/playbook/pb_title_detail/docs/_title_detail_default.html.erb
@@ -2173,8 +2188,9 @@ files:
2173
2188
  - app/pb_kits/playbook/pb_title_detail/docs/index.js
2174
2189
  - app/pb_kits/playbook/pb_title_detail/title_detail.html.erb
2175
2190
  - app/pb_kits/playbook/pb_title_detail/title_detail.rb
2176
- - app/pb_kits/playbook/pb_toggle/_toggle.jsx
2191
+ - app/pb_kits/playbook/pb_title_detail/title_detail.test.js
2177
2192
  - app/pb_kits/playbook/pb_toggle/_toggle.scss
2193
+ - app/pb_kits/playbook/pb_toggle/_toggle.tsx
2178
2194
  - app/pb_kits/playbook/pb_toggle/docs/_description.md
2179
2195
  - app/pb_kits/playbook/pb_toggle/docs/_footer.md
2180
2196
  - app/pb_kits/playbook/pb_toggle/docs/_toggle_custom.html.erb
@@ -2190,6 +2206,7 @@ files:
2190
2206
  - app/pb_kits/playbook/pb_toggle/docs/index.js
2191
2207
  - app/pb_kits/playbook/pb_toggle/toggle.html.erb
2192
2208
  - app/pb_kits/playbook/pb_toggle/toggle.rb
2209
+ - app/pb_kits/playbook/pb_toggle/toggle.test.js
2193
2210
  - app/pb_kits/playbook/pb_tooltip/_tooltip.scss
2194
2211
  - app/pb_kits/playbook/pb_tooltip/_tooltip.tsx
2195
2212
  - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_default.html.erb
@@ -2206,7 +2223,6 @@ files:
2206
2223
  - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_margin.md
2207
2224
  - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_selectors.html.erb
2208
2225
  - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_selectors.md
2209
- - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_white.html.erb
2210
2226
  - app/pb_kits/playbook/pb_tooltip/docs/_tooltip_with_icon_circle.html.erb
2211
2227
  - app/pb_kits/playbook/pb_tooltip/docs/example.yml
2212
2228
  - app/pb_kits/playbook/pb_tooltip/docs/index.js
@@ -2442,7 +2458,6 @@ files:
2442
2458
  - lib/playbook/line_height.rb
2443
2459
  - lib/playbook/markdown.rb
2444
2460
  - lib/playbook/markdown/helper.rb
2445
- - lib/playbook/markdown/template_handler.rb
2446
2461
  - lib/playbook/number_spacing.rb
2447
2462
  - lib/playbook/order.rb
2448
2463
  - lib/playbook/pagination_renderer.rb
@@ -2474,7 +2489,7 @@ homepage: http://playbook.powerapp.cloud
2474
2489
  licenses:
2475
2490
  - ISC
2476
2491
  metadata: {}
2477
- post_install_message:
2492
+ post_install_message:
2478
2493
  rdoc_options: []
2479
2494
  require_paths:
2480
2495
  - lib
@@ -2485,12 +2500,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
2485
2500
  version: '0'
2486
2501
  required_rubygems_version: !ruby/object:Gem::Requirement
2487
2502
  requirements:
2488
- - - ">="
2503
+ - - ">"
2489
2504
  - !ruby/object:Gem::Version
2490
- version: '0'
2505
+ version: 1.3.1
2491
2506
  requirements: []
2492
2507
  rubygems_version: 3.3.7
2493
- signing_key:
2508
+ signing_key:
2494
2509
  specification_version: 4
2495
2510
  summary: Playbook Design System
2496
2511
  test_files: []
@@ -1,172 +0,0 @@
1
- /* @flow */
2
-
3
- import React from 'react'
4
- import classnames from 'classnames'
5
-
6
- import DateTime from '../pb_kit/dateTime'
7
- import { globalProps } from '../utilities/globalProps'
8
-
9
- import Body from '../pb_body/_body'
10
- import Caption from '../pb_caption/_caption'
11
- import Icon from '../pb_icon/_icon'
12
-
13
- type TimeRangeInlineProps = {
14
- className?: string,
15
- id?: string,
16
- data?: string,
17
- alignment?: "left" | "center" | "vertical",
18
- size?: "sm" | "xs",
19
- dark?: boolean,
20
- icon?: boolean,
21
- timezone?: boolean,
22
- startTime: string,
23
- endTime: string,
24
- }
25
-
26
- const timezoneString = (dateValue) => {
27
- const date = new DateTime({ value: dateValue })
28
- return `${date.convertToTimezone()}`
29
- }
30
-
31
- const dateTimestamp = (dateValue) => {
32
- const date = new DateTime({ value: dateValue })
33
- return `${date.toHour()}:${date.toMinute()}${date.toMeridian()}`
34
- }
35
-
36
- const dateTimeIso = (dateValue) => {
37
- const date = new DateTime({ value: dateValue })
38
- return date.toIso()
39
- }
40
-
41
- const TimeRangeInline = (props: TimeRangeInlineProps) => {
42
- const {
43
- className,
44
- alignment = 'left',
45
- size = 'sm',
46
- dark = false,
47
- icon = false,
48
- timezone = false,
49
- startTime,
50
- endTime,
51
- } = props
52
- const separator = (
53
- <Body color="light">
54
- <Icon
55
- className="pb_time_range_inline_arrow"
56
- dark={dark}
57
- fixedWidth
58
- icon="long-arrow-right"
59
- />
60
- </Body>
61
- )
62
-
63
- const iconContent = () => {
64
- return (
65
- <If condition={icon}>
66
- <Body
67
- color="light"
68
- tag="span"
69
- >
70
- <Icon
71
- className="pb_time_range_inline_icon"
72
- dark={dark}
73
- fixedWidth
74
- icon="clock"
75
- size={size}
76
- tag="span"
77
- />
78
- </Body>
79
- </If>
80
- )
81
- }
82
-
83
- return (
84
- <div
85
- className={classnames('pb_time_range_inline_kit_' + alignment, globalProps(props), className)}
86
- >
87
- <div className="pb_time_range_inline_wrapper">
88
- <If condition={size == 'xs'}>
89
- <Caption
90
- dark={dark}
91
- tag="span"
92
- >
93
- {iconContent()}
94
- <time dateTime={dateTimeIso(startTime)}>
95
- {` ${dateTimestamp(
96
- startTime
97
- )} `}
98
- </time>
99
- </Caption>
100
- <Caption
101
- className="pb_time_range_inline_arrow"
102
- dark={dark}
103
- tag="span"
104
- >
105
- {separator}
106
- </Caption>
107
- <Caption
108
- dark={dark}
109
- tag="span"
110
- >
111
- <time dateTime={dateTimeIso(endTime)}>
112
- {` ${dateTimestamp(
113
- endTime
114
- )} `}
115
- </time>
116
- </Caption>
117
- <If condition={timezone}>
118
- <Caption
119
- className="pb_time_range_inline_timezone"
120
- dark={dark}
121
- tag="span"
122
- >
123
- {timezoneString(endTime)}
124
- </Caption>
125
- </If>
126
- </If>
127
- <If condition={size == 'sm'}>
128
- <Body
129
- dark={dark}
130
- tag="span"
131
- >
132
- {iconContent()}
133
- <time dateTime={dateTimeIso(startTime)}>
134
- {` ${dateTimestamp(
135
- startTime
136
- )} `}
137
- </time>
138
- </Body>
139
- <Body
140
- className="pb_time_range_inline_arrow"
141
- dark={dark}
142
- tag="span"
143
- >
144
- {separator}
145
- </Body>
146
- <Body
147
- dark={dark}
148
- tag="span"
149
- >
150
- <time dateTime={dateTimeIso(endTime)}>
151
- {` ${dateTimestamp(
152
- endTime
153
- )} `}
154
- </time>
155
- </Body>
156
- <If condition={timezone}>
157
- <Body
158
- className="pb_time_range_inline_timezone"
159
- color="light"
160
- dark={dark}
161
- tag="span"
162
- >
163
- {timezoneString(endTime)}
164
- </Body>
165
- </If>
166
- </If>
167
- </div>
168
- </div>
169
- )
170
- }
171
-
172
- export default TimeRangeInline
@@ -1,44 +0,0 @@
1
- /* @flow */
2
-
3
- import React from 'react'
4
- import classnames from 'classnames'
5
-
6
- import { globalProps } from '../utilities/globalProps'
7
- import { buildCss, buildDataProps } from '../utilities/props'
8
-
9
- import Body from '../pb_body/_body'
10
- import Title from '../pb_title/_title'
11
-
12
- type TitleDetailProps = {
13
- align?: "left" | "center" | "right",
14
- className?: string,
15
- data?: object,
16
- detail: string,
17
- id?: string,
18
- title: string,
19
- }
20
-
21
- const TitleDetail = (props: TitleDetailProps) => {
22
- const { align = 'left', className, data = {}, detail, id, title } = props
23
- const dataProps = buildDataProps(data)
24
- const pbCss = buildCss('pb_title_detail_kit', align)
25
-
26
- return (
27
- <div
28
- {...dataProps}
29
- className={classnames(pbCss, globalProps(props), className)}
30
- id={id}
31
- >
32
- <Title
33
- size={4}
34
- text={title}
35
- />
36
- <Body
37
- color="light"
38
- text={detail}
39
- />
40
- </div>
41
- )
42
- }
43
-
44
- export default TitleDetail
@@ -1,9 +0,0 @@
1
- <span id='regular-tooltip-5'>I am a white tooltip.</span>
2
-
3
- <%= pb_rails("tooltip", props: {
4
- trigger_element_id: "regular-tooltip-5",
5
- tooltip_id: "tooltip-5",
6
- position: 'top'
7
- }) do %>
8
- Whoa. I'm a white tooltip.
9
- <% end %>
@@ -1,47 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "redcarpet"
4
-
5
- module Playbook
6
- module Markdown
7
- class HTMLWithPants < Redcarpet::Render::HTML
8
- include Redcarpet::Render::SmartyPants
9
- end
10
-
11
- class TemplateHandler
12
- class_attribute :default_format
13
- self.default_format = Mime[:html]
14
-
15
- class << self
16
- def call(template)
17
- compiled_source = erb.call(template)
18
- "#{name}.render(begin;#{compiled_source};end)"
19
- end
20
-
21
- def render(template)
22
- markdown.render(template).html_safe
23
- end
24
-
25
- private
26
-
27
- def md_options
28
- @md_options ||= {
29
- autolink: true,
30
- no_intra_emphasis: true,
31
- fenced_code_blocks: true,
32
- strikethrough: true,
33
- tables: true,
34
- }
35
- end
36
-
37
- def markdown
38
- @markdown ||= Redcarpet::Markdown.new(::Playbook::Markdown::HTMLWithPants, md_options)
39
- end
40
-
41
- def erb
42
- @erb ||= ActionView::Template.registered_template_handler(:erb)
43
- end
44
- end
45
- end
46
- end
47
- end