playbook_ui 10.17.0 → 10.19.0.pre.lightbox

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +4 -0
  3. data/app/pb_kits/playbook/data/menu.yml +1 -0
  4. data/app/pb_kits/playbook/index.js +2 -1
  5. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_colors.md +1 -1
  6. data/app/pb_kits/playbook/pb_body/_body.jsx +1 -1
  7. data/app/pb_kits/playbook/pb_body/_body_mixins.scss +2 -1
  8. data/app/pb_kits/playbook/pb_body/body.rb +1 -1
  9. data/app/pb_kits/playbook/pb_body/body.test.js +29 -0
  10. data/app/pb_kits/playbook/pb_body/docs/_body_light.html.erb +5 -0
  11. data/app/pb_kits/playbook/pb_body/docs/_body_light.jsx +5 -0
  12. data/app/pb_kits/playbook/pb_body/docs/_body_light.md +6 -0
  13. data/app/pb_kits/playbook/pb_caption/_caption.jsx +6 -6
  14. data/app/pb_kits/playbook/pb_caption/_caption.scss +6 -17
  15. data/app/pb_kits/playbook/pb_caption/_caption_mixin.scss +13 -3
  16. data/app/pb_kits/playbook/pb_caption/caption.rb +3 -5
  17. data/app/pb_kits/playbook/pb_caption/caption.test.js +29 -0
  18. data/app/pb_kits/playbook/pb_caption/docs/_caption_colors.html.erb +3 -0
  19. data/app/pb_kits/playbook/pb_caption/docs/_caption_colors.jsx +25 -0
  20. data/app/pb_kits/playbook/pb_caption/docs/_caption_colors.md +6 -0
  21. data/app/pb_kits/playbook/pb_caption/docs/example.yml +2 -2
  22. data/app/pb_kits/playbook/pb_caption/docs/index.js +1 -2
  23. data/app/pb_kits/playbook/pb_card/docs/_card_background.html.erb +1 -1
  24. data/app/pb_kits/playbook/pb_card/docs/_card_content.html.erb +3 -1
  25. data/app/pb_kits/playbook/pb_card/docs/_card_content.jsx +9 -2
  26. data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.md +2 -0
  27. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.md +3 -1
  28. data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js +13 -4
  29. data/app/pb_kits/playbook/pb_gauge/_gauge.jsx +3 -0
  30. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors.html.erb +12 -0
  31. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors.jsx +19 -0
  32. data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors.md +2 -0
  33. data/app/pb_kits/playbook/pb_gauge/docs/example.yml +2 -0
  34. data/app/pb_kits/playbook/pb_gauge/docs/index.js +1 -0
  35. data/app/pb_kits/playbook/pb_gauge/gauge.rb +2 -0
  36. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.scss +2 -2
  37. data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_color.html.erb +1 -1
  38. data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_color.jsx +1 -1
  39. data/app/pb_kits/playbook/pb_icon_circle/docs/_icon_circle_color.md +1 -0
  40. data/app/pb_kits/playbook/pb_icon_circle/icon_circle.rb +1 -1
  41. data/app/pb_kits/playbook/pb_image/_image.jsx +4 -1
  42. data/app/pb_kits/playbook/pb_image/_image.scss +24 -8
  43. data/app/pb_kits/playbook/pb_image/docs/_transition_image.html.erb +54 -0
  44. data/app/pb_kits/playbook/pb_image/docs/_transition_image.jsx +77 -0
  45. data/app/pb_kits/playbook/pb_image/docs/_transition_image.md +1 -0
  46. data/app/pb_kits/playbook/pb_image/docs/example.yml +2 -0
  47. data/app/pb_kits/playbook/pb_image/docs/index.js +1 -0
  48. data/app/pb_kits/playbook/pb_image/image.html.erb +1 -1
  49. data/app/pb_kits/playbook/pb_image/image.rb +8 -1
  50. data/app/pb_kits/playbook/pb_image/image.test.js +9 -4
  51. data/app/pb_kits/playbook/pb_lightbox/Carousel/Slide.jsx +53 -0
  52. data/app/pb_kits/playbook/pb_lightbox/Carousel/Slides.jsx +54 -0
  53. data/app/pb_kits/playbook/pb_lightbox/Carousel/Thumbnail.jsx +39 -0
  54. data/app/pb_kits/playbook/pb_lightbox/Carousel/Thumbnails.jsx +82 -0
  55. data/app/pb_kits/playbook/pb_lightbox/Carousel/index.jsx +54 -0
  56. data/app/pb_kits/playbook/pb_lightbox/Carousel/styles.scss +110 -0
  57. data/app/pb_kits/playbook/pb_lightbox/Carousel/useSlides.js +66 -0
  58. data/app/pb_kits/playbook/pb_lightbox/Carousel/useUnscrollableBody.js +11 -0
  59. data/app/pb_kits/playbook/pb_lightbox/_lightbox.jsx +81 -0
  60. data/app/pb_kits/playbook/pb_lightbox/docs/_lightbox_default.jsx +65 -0
  61. data/app/pb_kits/playbook/pb_lightbox/docs/_lightbox_default.md +1 -0
  62. data/app/pb_kits/playbook/pb_lightbox/docs/_lightbox_multiple.jsx +65 -0
  63. data/app/pb_kits/playbook/pb_lightbox/docs/example.yml +6 -0
  64. data/app/pb_kits/playbook/pb_lightbox/docs/index.js +2 -0
  65. data/app/pb_kits/playbook/pb_lightbox/hooks/useToggler.js +10 -0
  66. data/app/pb_kits/playbook/pb_lightbox/hooks/useVisibility.js +21 -0
  67. data/app/pb_kits/playbook/pb_lightbox/hooks/useWindowSize.js +25 -0
  68. data/app/pb_kits/playbook/pb_lightbox/lightbox.scss +92 -0
  69. data/app/pb_kits/playbook/pb_lightbox/lightbox.test.jsx +30 -0
  70. data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors.md +1 -1
  71. data/app/pb_kits/playbook/pb_nav/_bold_mixin.scss +22 -0
  72. data/app/pb_kits/playbook/pb_nav/_horizontal_nav.scss +17 -1
  73. data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +9 -2
  74. data/app/pb_kits/playbook/pb_nav/docs/_bold_horizontal_nav.html.erb +6 -0
  75. data/app/pb_kits/playbook/pb_nav/docs/_bold_horizontal_nav.jsx +39 -0
  76. data/app/pb_kits/playbook/pb_nav/docs/_bold_vertical_nav.html.erb +6 -0
  77. data/app/pb_kits/playbook/pb_nav/docs/_bold_vertical_nav.jsx +39 -0
  78. data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav.html.erb +1 -1
  79. data/app/pb_kits/playbook/pb_nav/docs/_subtle_nav.html.erb +1 -1
  80. data/app/pb_kits/playbook/pb_nav/docs/example.yml +4 -0
  81. data/app/pb_kits/playbook/pb_nav/docs/index.js +2 -0
  82. data/app/pb_kits/playbook/pb_nav/nav.rb +1 -1
  83. data/app/pb_kits/playbook/pb_popover/docs/_popover_scroll_height.jsx +3 -0
  84. data/app/pb_kits/playbook/pb_popover/docs/_popover_z_index.jsx +1 -0
  85. data/app/pb_kits/playbook/pb_text_input/_text_input.scss +62 -13
  86. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error.html.erb +21 -2
  87. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error.jsx +12 -3
  88. data/app/pb_kits/playbook/pb_title/_title.jsx +6 -4
  89. data/app/pb_kits/playbook/pb_title/_title.scss +5 -5
  90. data/app/pb_kits/playbook/pb_title/_title_mixin.scss +17 -0
  91. data/app/pb_kits/playbook/pb_title/docs/_title_colors.html.erb +4 -0
  92. data/app/pb_kits/playbook/pb_title/docs/_title_colors.jsx +37 -0
  93. data/app/pb_kits/playbook/pb_title/docs/_title_colors.md +6 -0
  94. data/app/pb_kits/playbook/pb_title/docs/_title_light.html.erb +4 -1
  95. data/app/pb_kits/playbook/pb_title/docs/_title_light.md +3 -0
  96. data/app/pb_kits/playbook/pb_title/docs/example.yml +2 -2
  97. data/app/pb_kits/playbook/pb_title/docs/index.js +1 -1
  98. data/app/pb_kits/playbook/pb_title/title.html.erb +3 -2
  99. data/app/pb_kits/playbook/pb_title/title.rb +5 -4
  100. data/app/pb_kits/playbook/pb_title/title.test.js +29 -0
  101. data/app/pb_kits/playbook/playbook-doc.js +2 -0
  102. data/app/pb_kits/playbook/plugins/pb_chart.js +13 -22
  103. data/app/pb_kits/playbook/tokens/_colors.scss +3 -1
  104. data/app/pb_kits/playbook/utilities/_cursor.scss +3 -0
  105. data/app/pb_kits/playbook/utilities/_display.scss +23 -0
  106. data/app/pb_kits/playbook/utilities/_line_height.scss +11 -0
  107. data/app/pb_kits/playbook/utilities/globalProps.js +19 -1
  108. data/lib/playbook/classnames.rb +3 -0
  109. data/lib/playbook/cursor.rb +29 -0
  110. data/lib/playbook/display.rb +29 -0
  111. data/lib/playbook/engine.rb +0 -1
  112. data/lib/playbook/kit_base.rb +6 -0
  113. data/lib/playbook/line_height.rb +29 -0
  114. data/lib/playbook/version.rb +2 -2
  115. data/lib/playbook.rb +2 -0
  116. metadata +55 -15
  117. data/app/pb_kits/playbook/pb_caption/docs/_caption_example.html.erb +0 -3
  118. data/app/pb_kits/playbook/pb_caption/docs/_caption_example.jsx +0 -27
  119. data/app/pb_kits/playbook/pb_caption/docs/_caption_example.md +0 -1
  120. data/app/pb_kits/playbook/pb_caption/docs/_caption_variants.html.erb +0 -1
  121. data/app/pb_kits/playbook/pb_caption/docs/_caption_variants.jsx +0 -17
  122. data/app/pb_kits/playbook/pb_caption/docs/_caption_variants.md +0 -3
  123. data/app/pb_kits/playbook/pb_title/docs/_title_variants.html.erb +0 -1
  124. data/app/pb_kits/playbook/pb_title/docs/_title_variants.jsx +0 -19
  125. data/app/pb_kits/playbook/pb_title/docs/_title_variants.md +0 -3
@@ -1,4 +1,4 @@
1
- <%= pb_rails("nav", props: {variant: "subtle"}) do %>
1
+ <%= pb_rails("nav", props: { variant: "subtle" }) do %>
2
2
  <%= pb_rails("nav/item", props: { text: "Overview", link: "#" }) %>
3
3
  <%= pb_rails("nav/item", props: { text: "Albums", link: "#", active: true }) %>
4
4
  <%= pb_rails("nav/item", props: { text: "Similar Artists", link: "#" }) %>
@@ -8,8 +8,10 @@ examples:
8
8
  - subtle_nav: Subtle Variant
9
9
  - subtle_with_icons_nav: Subtle With Icons
10
10
  - subtle_no_highlight_nav: Subtle No Highlight
11
+ - bold_vertical_nav: Bold Variant
11
12
  - horizontal_nav: Horizontal Nav
12
13
  - subtle_horizontal_nav: Subtle Horizontal Nav
14
+ - bold_horizontal_nav: Bold Horizontal Nav
13
15
  - block_nav: Block
14
16
  - block_no_title_nav: Without Title
15
17
  - new_tab: Open in a New Tab
@@ -23,8 +25,10 @@ examples:
23
25
  - subtle_nav: Subtle Variant
24
26
  - subtle_with_icons_nav: Subtle With Icons
25
27
  - subtle_no_highlight_nav: Subtle No Highlight
28
+ - bold_vertical_nav: Bold Variant
26
29
  - horizontal_nav: Horizontal Nav
27
30
  - subtle_horizontal_nav: Subtle Horizontal Nav
31
+ - bold_horizontal_nav: Bold Horizontal Nav
28
32
  - block_nav: Block
29
33
  - block_no_title_nav: Without Title
30
34
  - new_tab: Open in a New Tab
@@ -11,3 +11,5 @@ export { default as WithIconsNav } from './_with_icons_nav.jsx'
11
11
  export { default as SubtleWithIconsNav } from './_subtle_with_icons_nav.jsx'
12
12
  export { default as WithImgNav } from './_with_img_nav.jsx'
13
13
  export { default as NewTab } from './_new_tab.jsx'
14
+ export { default as BoldHorizontalNav } from './_bold_horizontal_nav.jsx'
15
+ export { default as BoldVerticalNav } from './_bold_vertical_nav.jsx'
@@ -9,7 +9,7 @@ module Playbook
9
9
  values: %w[vertical horizontal],
10
10
  default: "vertical"
11
11
  prop :variant, type: Playbook::Props::Enum,
12
- values: %w[normal subtle],
12
+ values: %w[normal subtle bold],
13
13
  default: "normal"
14
14
  prop :highlight, type: Playbook::Props::Boolean, default: true
15
15
  prop :borderless, type: Playbook::Props::Boolean, default: false
@@ -31,6 +31,9 @@ const PopoverScrollHeight = (props) => {
31
31
  maxHeight="150px"
32
32
  maxWidth="240px"
33
33
  offset
34
+ padding="md"
35
+ paddingBottom="sm"
36
+ paddingTop="sm"
34
37
  placement="top"
35
38
  reference={popoverTrigger}
36
39
  shouldClosePopover={handleShouldClosePopover}
@@ -36,6 +36,7 @@ const PopoverZIndex = (props) => {
36
36
  <PbReactPopover
37
37
  closeOnClick="outside"
38
38
  offset
39
+ padding="sm"
39
40
  placement="top"
40
41
  reference={popoverTrigger}
41
42
  shouldClosePopover={handleShouldClosePopover}
@@ -88,6 +88,56 @@
88
88
  border-color: $error;
89
89
  }
90
90
  }
91
+ .text_input_wrapper_add_on {
92
+ .add-on {
93
+ &-right {
94
+ .add-on-card {
95
+ border: 1px solid $error;
96
+ border-left: 0;
97
+ }
98
+ }
99
+ &-left {
100
+ .add-on-card {
101
+ border: 1px solid $error;
102
+ border-right: 0;
103
+ }
104
+ }
105
+ }
106
+ .border {
107
+ &_left {
108
+ &_on {
109
+ .card-right-aligned {
110
+ border-left: 0;
111
+ }
112
+ }
113
+ &_off {
114
+ .card-right-aligned {
115
+ border-left: 0;
116
+ }
117
+ .text_input {
118
+ border-right: 0;
119
+ padding-right: 0;
120
+ }
121
+ }
122
+ }
123
+ &_right {
124
+ &_on {
125
+ .card-left-aligned {
126
+ border-right: 0;
127
+ }
128
+ }
129
+ &_off {
130
+ .card-left-aligned {
131
+ border-right: 0;
132
+ }
133
+ .text_input {
134
+ border-left: 0;
135
+ padding-left: 0;
136
+ }
137
+ }
138
+ }
139
+ }
140
+ }
91
141
  }
92
142
  &.inline {
93
143
  .text_input_wrapper input::placeholder,
@@ -132,15 +182,15 @@
132
182
  }
133
183
  &-left {
134
184
  .text_input {
135
- border-top-left-radius: 0 !important;
136
- border-bottom-left-radius: 0 !important;
185
+ border-top-left-radius: 0;
186
+ border-bottom-left-radius: 0;
137
187
  }
138
188
  }
139
189
 
140
190
  &-right {
141
191
  .text_input{
142
- border-top-right-radius: 0 !important;
143
- border-bottom-right-radius: 0 !important;
192
+ border-top-right-radius: 0;
193
+ border-bottom-right-radius: 0;
144
194
  }
145
195
  }
146
196
  }
@@ -148,15 +198,14 @@
148
198
  background-color: $focus_input_dark;
149
199
  border-width: 0px;
150
200
  }
151
-
152
201
  .card-left-aligned {
153
- border-top-right-radius: 0 !important;
154
- border-bottom-right-radius: 0 !important;
202
+ border-top-right-radius: 0;
203
+ border-bottom-right-radius: 0;
155
204
  }
156
205
 
157
206
  .card-right-aligned {
158
- border-top-left-radius: 0 !important;
159
- border-bottom-left-radius: 0 !important;
207
+ border-top-left-radius: 0;
208
+ border-bottom-left-radius: 0;
160
209
  }
161
210
 
162
211
  .border {
@@ -165,8 +214,8 @@
165
214
  border-right: 0;
166
215
  }
167
216
  .text_input {
168
- border-left: 0 !important;
169
- padding-left: 0 !important;
217
+ border-left: 0;
218
+ padding-left: 0;
170
219
  }
171
220
  }
172
221
  &_left_on {
@@ -184,8 +233,8 @@
184
233
  border-left: 0;
185
234
  }
186
235
  .text_input {
187
- border-right: 0 !important;
188
- padding-right: 0 !important;
236
+ border-right: 0;
237
+ padding-right: 0;
189
238
  }
190
239
  }
191
240
  }
@@ -1,2 +1,21 @@
1
- <%= pb_rails("text_input", props: { error: "Please enter a valid email address", label: "Email Address", type: "email", placeholder: "Enter email address" }) %>
2
- <%= pb_rails("text_input", props: { label: "Confirm Email Address", type: "email", placeholder: "Confirm email address" }) %>
1
+ <%= pb_rails("text_input", props: {
2
+ add_on: {
3
+ alignment: "left",
4
+ border: true,
5
+ icon: "user"
6
+ },
7
+ error: "Please enter a valid email address",
8
+ label: "Email Address",
9
+ placeholder: "Enter email address",
10
+ type: "email"
11
+ }) %>
12
+ <%= pb_rails("text_input", props: {
13
+ add_on: {
14
+ alignment: "left",
15
+ border: true,
16
+ icon: "user"
17
+ },
18
+ label: "Confirm Email Address",
19
+ placeholder: "Confirm email address",
20
+ type: "email"
21
+ }) %>
@@ -1,7 +1,6 @@
1
1
  import React, { useState } from 'react'
2
- import {
3
- TextInput,
4
- } from '../..'
2
+
3
+ import TextInput from '../_text_input'
5
4
 
6
5
  const TextInputError = (props) => {
7
6
  const [email, setEmail] = useState('')
@@ -12,6 +11,7 @@ const TextInputError = (props) => {
12
11
  return (
13
12
  <div>
14
13
  <TextInput
14
+ addOn={{ icon: 'user', alignment: 'left', border: true }}
15
15
  error="Please enter a valid email address"
16
16
  label="Email Address"
17
17
  onChange={handleUpdateEmail}
@@ -20,6 +20,15 @@ const TextInputError = (props) => {
20
20
  value={email}
21
21
  {...props}
22
22
  />
23
+ <TextInput
24
+ addOn={{ icon: 'user', alignment: 'left', border: true }}
25
+ label="Confirm Email Address"
26
+ onChange={handleUpdateEmail}
27
+ placeholder="Confirm email address"
28
+ type="email"
29
+ value={email}
30
+ {...props}
31
+ />
23
32
  </div>
24
33
  )
25
34
  }
@@ -3,12 +3,13 @@
3
3
  import React from 'react'
4
4
  import classnames from 'classnames'
5
5
  import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
6
- import { globalProps } from '../utilities/globalProps.js'
6
+ import { deprecatedProps, globalProps } from '../utilities/globalProps.js'
7
7
 
8
8
  type TitleProps = {
9
9
  aria?: object,
10
10
  children?: array<React.ReactNode> | React.ReactNode,
11
11
  className?: string,
12
+ color?: "default" | "light" | "lighter" | "success" | "error" | "link",
12
13
  data?: object,
13
14
  id?: string,
14
15
  size?: 1 | 2 | 3 | 4,
@@ -18,24 +19,25 @@ type TitleProps = {
18
19
  }
19
20
 
20
21
  const Title = (props: TitleProps) => {
22
+ if (props.variant) deprecatedProps('Title', ['variant']) //variant prop is deprecated, use color instead
21
23
  const {
22
24
  aria = {},
23
25
  children,
24
26
  className,
27
+ color,
25
28
  data = {},
26
29
  id,
27
30
  size = 3,
28
31
  tag = 'h3',
29
32
  text,
30
- variant = null,
31
33
  } = props
32
34
 
33
35
  const ariaProps = buildAriaProps(aria)
34
36
  const dataProps = buildDataProps(data)
35
37
  const classes = classnames(
36
- buildCss('pb_title_kit', size, variant),
38
+ buildCss('pb_title_kit', size, color),
37
39
  globalProps(props),
38
- className
40
+ className,
39
41
  )
40
42
  const Tag = `${tag}`
41
43
 
@@ -1,26 +1,26 @@
1
1
  @import "../tokens/titles";
2
2
  @import "../tokens/colors";
3
+ @import './title_mixin';
3
4
 
4
5
  [class^=pb_title_kit]{
5
6
  &[class*=_1] {
6
7
  @include pb_title_1;
8
+ @include title_colors;
7
9
  }
8
10
 
9
11
  &[class*=_2] {
10
12
  @include pb_title_2;
13
+ @include title_colors;
11
14
  }
12
15
 
13
16
  &[class*=_3] {
14
17
  @include pb_title_3;
18
+ @include title_colors;
15
19
  }
16
20
 
17
21
  &[class*=_4] {
18
22
  @include pb_title_4;
19
-
20
- &[class*=_link] {
21
- color: $primary;
22
- }
23
-
23
+ @include title_colors;
24
24
  }
25
25
 
26
26
  &.dark {
@@ -1 +1,18 @@
1
1
  @import "../tokens/titles";
2
+
3
+ $pb_title_colors: (
4
+ default: $text_lt_default,
5
+ light: $text_lt_light,
6
+ lighter: $text_lt_lighter,
7
+ success: $success,
8
+ error: $error,
9
+ link: $primary
10
+ );
11
+
12
+ @mixin title_colors {
13
+ @each $name, $color in $pb_title_colors {
14
+ &[class*=_#{$name}] {
15
+ color: $color
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,4 @@
1
+ <%= pb_rails("title", props: { text: "Default Color", tag: "h1", size: 3 }) %>
2
+ <%= pb_rails("title", props: { text: "Title Color", tag: "h1", size: 3, color: "link" }) %>
3
+ <%= pb_rails("title", props: { text: "Title Color", tag: "h1", size: 3, color: "success" }) %>
4
+ <%= pb_rails("title", props: { text: "Title Color", tag: "h1", size: 3, color: "error" }) %>
@@ -0,0 +1,37 @@
1
+ import React from 'react'
2
+
3
+ import Title from '../_title'
4
+
5
+ const TitleColors = (props) => {
6
+ return (
7
+ <div>
8
+ <Title
9
+ text="Default Color"
10
+ {...props}
11
+ />
12
+ <Title
13
+ color="link"
14
+ size={3}
15
+ tag="h1"
16
+ text="Title Color"
17
+ {...props}
18
+ />
19
+ <Title
20
+ color="success"
21
+ size={3}
22
+ tag="h1"
23
+ text="Title Color"
24
+ {...props}
25
+ />
26
+ <Title
27
+ color="error"
28
+ size={3}
29
+ tag="h1"
30
+ text="Title Color"
31
+ {...props}
32
+ />
33
+ </div>
34
+ )
35
+ }
36
+
37
+ export default TitleColors
@@ -0,0 +1,6 @@
1
+ ##### Prop
2
+ Title kit will use `default` color by default. Other available colors are:
3
+
4
+ *`light` `lighter` `success` `error` `link`
5
+
6
+ - These colors are not for standard usage. You can use the color prop to make fixes if colors are not appearing properly, but consult your UX team members if you are deciding to implement it
@@ -1,4 +1,7 @@
1
- <%= pb_rails("title", props: { text: "Default Title" }) %>
1
+ <%= pb_rails("title", props: {
2
+ }) do %>
3
+ Default Title
4
+ <% end %>
2
5
 
3
6
  <br/>
4
7
 
@@ -0,0 +1,3 @@
1
+ ##### Prop
2
+ Title kit will use `h3` tag by default, and `size 3` as well.
3
+ Size and tag props are not in correlation with each other, meaning any size can be used along with any tag.
@@ -1,8 +1,8 @@
1
1
  examples:
2
2
  rails:
3
3
  - title_light: Light UI
4
- - title_variants: Variants
4
+ - title_colors: Colors
5
5
 
6
6
  react:
7
7
  - title_light: Light UI
8
- - title_variants: Variants
8
+ - title_colors: Colors
@@ -1,2 +1,2 @@
1
1
  export { default as TitleLight } from './_title_light.jsx'
2
- export { default as TitleVariants } from './_title_variants.jsx'
2
+ export { default as TitleColors } from './_title_colors.jsx'
@@ -1,5 +1,6 @@
1
- <%= content_tag(object.tag, object.text,
1
+ <%= content_tag(object.tag,
2
2
  aria: object.aria,
3
3
  id: object.id,
4
4
  data: object.data,
5
- class: object.classname) %>
5
+ class: object.classname) do %><%= content.presence || object.text %><% end %>
6
+
@@ -3,6 +3,9 @@
3
3
  module Playbook
4
4
  module PbTitle
5
5
  class Title < Playbook::KitBase
6
+ prop :color, type: Playbook::Props::Enum,
7
+ values: [nil, "default", "light", "lighter", "success", "error", "link"],
8
+ default: nil
6
9
  prop :size, type: Playbook::Props::Enum,
7
10
  values: [1, 2, 3, 4],
8
11
  default: 3
@@ -10,12 +13,10 @@ module Playbook
10
13
  values: %w[h1 h2 h3 h4 h5 h6 p div span],
11
14
  default: "h3"
12
15
  prop :text
13
- prop :variant, type: Playbook::Props::Enum,
14
- values: [nil, "link"],
15
- default: nil
16
+ prop :variant, deprecated: true
16
17
 
17
18
  def classname
18
- generate_classname("pb_title_kit", size, variant)
19
+ generate_classname("pb_title_kit", size, color)
19
20
  end
20
21
  end
21
22
  end
@@ -0,0 +1,29 @@
1
+ import React from 'react'
2
+ import { render, screen } from '../utilities/test-utils'
3
+
4
+ import Title from './_title'
5
+
6
+ test('returns namespaced class name', () => {
7
+ render(
8
+ <Title
9
+ data={{ testid: 'primary-test' }}
10
+ text="Test colors"
11
+ />
12
+ )
13
+
14
+ const kit = screen.getByTestId('primary-test')
15
+ expect(kit).toHaveClass('pb_title_kit_3')
16
+ })
17
+
18
+ test('with colors', () => {
19
+ render(
20
+ <Title
21
+ color="success"
22
+ data={{ testid: 'primary-test' }}
23
+ text="Test colors"
24
+ />
25
+ )
26
+
27
+ const kit = screen.getByTestId('primary-test')
28
+ expect(kit).toHaveClass('pb_title_kit_3_success')
29
+ })
@@ -51,6 +51,7 @@ import * as LabelPill from 'pb_label_pill/docs'
51
51
  import * as LabelValue from 'pb_label_value/docs'
52
52
  import * as Layout from 'pb_layout/docs'
53
53
  import * as LegendDocs from 'pb_legend/docs'
54
+ import * as Lightbox from 'pb_lightbox/docs'
54
55
  import * as LineGraphDocs from 'pb_line_graph/docs'
55
56
  import * as List from 'pb_list/docs'
56
57
  import * as LoadingInline from 'pb_loading_inline/docs'
@@ -145,6 +146,7 @@ WebpackerReact.setup({
145
146
  ...LabelValue,
146
147
  ...Layout,
147
148
  ...LegendDocs,
149
+ ...Lightbox,
148
150
  ...LineGraphDocs,
149
151
  ...List,
150
152
  ...LoadingInline,
@@ -10,25 +10,14 @@ import solidGauge from 'highcharts/modules/solid-gauge'
10
10
  pie(Highcharts)
11
11
 
12
12
  // Map Data Color String Props to our SCSS Variables
13
+
13
14
  const mapColors = (array) => {
15
+ const regex = /(data)\-[1-8]/ //eslint-disable-line
16
+
14
17
  const newArray = array.map((item) => {
15
- return item == 'data-1'
16
- ? `${colors.data_1}`
17
- : item == 'data-2'
18
- ? `${colors.data_2}`
19
- : item == 'data-3'
20
- ? `${colors.data_3}`
21
- : item == 'data-4'
22
- ? `${colors.data_4}`
23
- : item == 'data-5'
24
- ? `${colors.data_5}`
25
- : item == 'data-6'
26
- ? `${colors.data_6}`
27
- : item == 'data-7'
28
- ? `${colors.data_7}`
29
- : item == 'data-8'
30
- ? `${colors.data_8}`
31
- : ''
18
+ return regex.test(item)
19
+ ? `${colors[`data_${item[item.length - 1]}`]}`
20
+ : item
32
21
  })
33
22
  return newArray
34
23
  }
@@ -72,13 +61,13 @@ class pbChart {
72
61
  if (this.options.type == 'variablepie' || this.options.type == 'pie'){
73
62
  this.setupPieChart(options)
74
63
  } else if (this.options.type == 'gauge') {
75
- this.setupGauge()
64
+ this.setupGauge(options)
76
65
  } else {
77
66
  this.setupChart(options)
78
67
  }
79
68
  }
80
69
 
81
- setupGauge() {
70
+ setupGauge(options) {
82
71
  highchartsMore(Highcharts)
83
72
  solidGauge(Highcharts)
84
73
  Highcharts.setOptions(highchartsTheme)
@@ -128,19 +117,21 @@ class pbChart {
128
117
  pointFormat: this.defaults.tooltipHtml,
129
118
  followPointer: true,
130
119
  },
120
+ colors: options.colors !== undefined && options.colors.length > 0 ? mapColors(options.colors) : highchartsTheme.colors,
131
121
  plotOptions: {
132
122
  series: {
133
123
  animation: !this.defaults.disableAnimation,
134
124
  },
135
125
  solidgauge: {
126
+ borderColor: options.colors !== undefined && options.colors.length === 1 ? mapColors(options.colors).join() : highchartsTheme.colors[0],
136
127
  dataLabels: {
137
128
  format: `<span class="prefix">${this.defaults.prefix}</span>` +
138
129
  '<span class="fix">{y:,f}</span>' +
139
130
  `<span class="suffix">${this.defaults.suffix}</span>`,
140
- },
141
- },
131
+ } },
142
132
  },
143
- })
133
+ },
134
+ )
144
135
  document.querySelectorAll('.gauge-pane').forEach((pane) => pane.setAttribute('stroke-linejoin', 'round'))
145
136
  if (document.querySelector('.prefix')) {
146
137
  document.querySelectorAll('.prefix').forEach((prefix) => prefix.setAttribute('y', '28'))
@@ -12,6 +12,7 @@ $red: #FF2229;
12
12
  $yellow: #F9BB00;
13
13
  $green: #00CA74;
14
14
  $orange: #FD804C;
15
+ $default: #93a8b8;
15
16
  $colors: (
16
17
  royal: $royal,
17
18
  purple: $purple,
@@ -19,7 +20,8 @@ $colors: (
19
20
  red: $red,
20
21
  yellow: $yellow,
21
22
  green: $green,
22
- orange: $orange
23
+ orange: $orange,
24
+ default: $default,
23
25
  );
24
26
 
25
27
  /* Specialty Gradient -----------------*/
@@ -0,0 +1,3 @@
1
+ .cursor_pointer {
2
+ cursor: pointer;
3
+ }
@@ -0,0 +1,23 @@
1
+ .display_block {
2
+ display: block;
3
+ }
4
+
5
+ .display_inline_block {
6
+ display: inline-block;
7
+ }
8
+
9
+ .display_inline {
10
+ display: inline;
11
+ }
12
+
13
+ .display_flex {
14
+ display: flex;
15
+ }
16
+
17
+ .display_inline_flex {
18
+ display: inline-flex;
19
+ }
20
+
21
+ .display_hidden {
22
+ display: none;
23
+ }
@@ -0,0 +1,11 @@
1
+ @import "../tokens/exports/line_height";
2
+
3
+ @mixin line-height-classes($line-height-list) {
4
+ @each $name, $line-height in $line-height-list {
5
+ [class*=pb_] .line_height_#{$name} {
6
+ line-height: $line-height;
7
+ }
8
+ }
9
+ }
10
+ @include line-height-classes($line_height);
11
+
@@ -63,10 +63,28 @@ const shadowProps = ({ shadow }) => {
63
63
  return css
64
64
  }
65
65
 
66
+ const lineHeightProps = ({ lineHeight }) => {
67
+ let css = ''
68
+ css += lineHeight ? `line_height_${lineHeight} ` : ''
69
+ return css
70
+ }
71
+
72
+ const displayProps = ({ display }) => {
73
+ let css = ''
74
+ css += display ? `display_${display} ` : ''
75
+ return css
76
+ }
77
+
78
+ const cursorProps = ({ cursor }) => {
79
+ let css = ''
80
+ css += cursor ? `cursor_${cursor} ` : ''
81
+ return css
82
+ }
83
+
66
84
  // All Exported as a single function
67
85
  export const globalProps = (props, defaultProps = {}) => {
68
86
  const allProps = { ...props, ...defaultProps }
69
- return spacingProps(allProps) + darkProps(allProps) + maxWidthProps(allProps) + zIndexProps(allProps) + numberSpacingProps(allProps) + shadowProps(allProps)
87
+ return spacingProps(allProps) + darkProps(allProps) + maxWidthProps(allProps) + zIndexProps(allProps) + numberSpacingProps(allProps) + shadowProps(allProps) + lineHeightProps(allProps) + cursorProps(allProps) + displayProps(allProps)
70
88
  }
71
89
 
72
90
  export const deprecatedProps = (kit, props = []) => {