playbook_ui 8.1.0.pre.alpha1 → 8.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -9
  3. data/app/pb_kits/playbook/_playbook.scss +0 -2
  4. data/app/pb_kits/playbook/data/menu.yml +1 -2
  5. data/app/pb_kits/playbook/index.js +0 -2
  6. data/app/pb_kits/playbook/pb_avatar/_avatar.jsx +2 -14
  7. data/app/pb_kits/playbook/pb_avatar/avatar.html.erb +1 -1
  8. data/app/pb_kits/playbook/pb_avatar/avatar.rb +2 -5
  9. data/app/pb_kits/playbook/pb_avatar/avatar.test.js +2 -5
  10. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_default.html.erb +0 -5
  11. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_default.jsx +0 -5
  12. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_status.html.erb +0 -4
  13. data/app/pb_kits/playbook/pb_avatar/docs/_avatar_status.jsx +0 -4
  14. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.jsx +0 -6
  15. data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.html.erb +1 -2
  16. data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.rb +0 -2
  17. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.html.erb +0 -4
  18. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.jsx +0 -4
  19. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.html.erb +0 -2
  20. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.jsx +0 -2
  21. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_on_click.jsx +0 -2
  22. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_onclick.html.erb +0 -2
  23. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.html.erb +0 -8
  24. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.jsx +0 -8
  25. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_tooltip.html.erb +0 -2
  26. data/app/pb_kits/playbook/pb_badge/_badge.jsx +1 -26
  27. data/app/pb_kits/playbook/pb_button/_button.jsx +0 -6
  28. data/app/pb_kits/playbook/pb_button/docs/_button_default.jsx +1 -0
  29. data/app/pb_kits/playbook/pb_caption/_caption.jsx +2 -3
  30. data/app/pb_kits/playbook/pb_caption/caption.rb +1 -1
  31. data/app/pb_kits/playbook/pb_card/_card.jsx +3 -18
  32. data/app/pb_kits/playbook/pb_card/card.html.erb +1 -1
  33. data/app/pb_kits/playbook/pb_card/card.rb +0 -3
  34. data/app/pb_kits/playbook/pb_card/docs/example.yml +0 -2
  35. data/app/pb_kits/playbook/pb_card/docs/index.js +0 -1
  36. data/app/pb_kits/playbook/pb_dashboard/commonSettings.js +2 -2
  37. data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.js +2 -2
  38. data/app/pb_kits/playbook/pb_form/_form.scss +1 -5
  39. data/app/pb_kits/playbook/pb_form/form_builder.rb +2 -4
  40. data/app/pb_kits/playbook/pb_form/form_builder/action_area.html.erb +3 -0
  41. data/app/pb_kits/playbook/pb_form/form_builder/action_area.rb +7 -14
  42. data/app/pb_kits/playbook/pb_form/simple_form.html.erb +4 -2
  43. data/app/pb_kits/playbook/pb_form/simple_form.rb +0 -4
  44. data/app/pb_kits/playbook/pb_online_status/_online_status.jsx +0 -2
  45. data/app/pb_kits/playbook/pb_online_status/online_status.html.erb +1 -1
  46. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.jsx +3 -4
  47. data/app/pb_kits/playbook/pb_text_input/_text_input.jsx +0 -3
  48. data/app/pb_kits/playbook/pb_textarea/_textarea.jsx +0 -3
  49. data/app/pb_kits/playbook/pb_typeahead/_typeahead.jsx +1 -6
  50. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx +2 -25
  51. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.jsx +0 -1
  52. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills.jsx +3 -7
  53. data/app/pb_kits/playbook/pb_user_badge/_user_badge.jsx +1 -1
  54. data/app/pb_kits/playbook/plugins/pb_chart.js +1 -1
  55. data/app/pb_kits/playbook/react_rails_kits.js +0 -4
  56. data/app/pb_kits/playbook/tokens/_border_radius.scss +10 -0
  57. data/app/pb_kits/playbook/tokens/_colors.scss +25 -0
  58. data/app/pb_kits/playbook/tokens/_line_height.scss +9 -0
  59. data/app/pb_kits/playbook/tokens/_opacity.scss +9 -0
  60. data/app/pb_kits/playbook/tokens/_positioning.scss +9 -0
  61. data/app/pb_kits/playbook/tokens/_screen_sizes.scss +9 -0
  62. data/app/pb_kits/playbook/tokens/_shadows.scss +9 -0
  63. data/app/pb_kits/playbook/tokens/_spacing.scss +10 -0
  64. data/app/pb_kits/playbook/tokens/_typography.scss +25 -0
  65. data/app/pb_kits/playbook/utilities/test-utils.js +0 -6
  66. data/lib/playbook/version.rb +1 -1
  67. metadata +13 -58
  68. data/app/pb_kits/playbook/pb_avatar_action_button/pb_avatar_action_button.test.js +0 -31
  69. data/app/pb_kits/playbook/pb_button/button.test.js +0 -91
  70. data/app/pb_kits/playbook/pb_button_toolbar/button_toolbar.test.js +0 -46
  71. data/app/pb_kits/playbook/pb_card/docs/_card_tag.html.erb +0 -25
  72. data/app/pb_kits/playbook/pb_card/docs/_card_tag.jsx +0 -59
  73. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.test.js +0 -17
  74. data/app/pb_kits/playbook/pb_dialog/_close_icon.jsx +0 -23
  75. data/app/pb_kits/playbook/pb_dialog/_dialog.html.erb +0 -10
  76. data/app/pb_kits/playbook/pb_dialog/_dialog.jsx +0 -142
  77. data/app/pb_kits/playbook/pb_dialog/_dialog.scss +0 -133
  78. data/app/pb_kits/playbook/pb_dialog/_dialog_context.jsx +0 -3
  79. data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_body.jsx +0 -21
  80. data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_footer.jsx +0 -36
  81. data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_header.jsx +0 -68
  82. data/app/pb_kits/playbook/pb_dialog/dialog.rb +0 -47
  83. data/app/pb_kits/playbook/pb_dialog/dialog.test.jsx +0 -23
  84. data/app/pb_kits/playbook/pb_dialog/dialog_header.rb +0 -31
  85. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.jsx +0 -53
  86. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_compound_components.md +0 -2
  87. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_default.jsx +0 -27
  88. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_scrollable.jsx +0 -27
  89. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_scrollable.md +0 -2
  90. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_separators.jsx +0 -119
  91. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_separators.md +0 -2
  92. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_should_close_on_overlay.jsx +0 -28
  93. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_should_close_on_overlay.md +0 -2
  94. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_sizes.jsx +0 -93
  95. data/app/pb_kits/playbook/pb_dialog/docs/example.yml +0 -10
  96. data/app/pb_kits/playbook/pb_dialog/docs/index.js +0 -6
  97. data/app/pb_kits/playbook/pb_inline/_inline.jsx +0 -83
  98. data/app/pb_kits/playbook/pb_inline/_inline.scss +0 -58
  99. data/app/pb_kits/playbook/pb_inline/docs/_inline_default.jsx +0 -36
  100. data/app/pb_kits/playbook/pb_inline/docs/_inline_input_options.jsx +0 -58
  101. data/app/pb_kits/playbook/pb_inline/docs/_inline_text_options.jsx +0 -99
  102. data/app/pb_kits/playbook/pb_inline/docs/example.yml +0 -5
  103. data/app/pb_kits/playbook/pb_inline/docs/index.js +0 -3
  104. data/app/pb_kits/playbook/pb_inline/inline.test.jsx +0 -21
  105. data/app/pb_kits/playbook/tokens/exports/_border_radius.scss +0 -10
  106. data/app/pb_kits/playbook/tokens/exports/_colors.scss +0 -26
  107. data/app/pb_kits/playbook/tokens/exports/_line_height.scss +0 -10
  108. data/app/pb_kits/playbook/tokens/exports/_opacity.scss +0 -10
  109. data/app/pb_kits/playbook/tokens/exports/_positioning.scss +0 -10
  110. data/app/pb_kits/playbook/tokens/exports/_screen_sizes.scss +0 -10
  111. data/app/pb_kits/playbook/tokens/exports/_shadows.scss +0 -10
  112. data/app/pb_kits/playbook/tokens/exports/_spacing.scss +0 -10
  113. data/app/pb_kits/playbook/tokens/exports/_typography.scss +0 -24
  114. data/dist/reset.css +0 -1
@@ -1,10 +0,0 @@
1
- examples:
2
-
3
- rails:
4
-
5
- react:
6
- - dialog_default: Simple
7
- - dialog_compound_components: Complex
8
- - dialog_sizes: Sizes
9
- - dialog_scrollable: Scrollable
10
- - dialog_should_close_on_overlay: Overlay Click
@@ -1,6 +0,0 @@
1
- export { default as DialogDefault } from './_dialog_default.jsx'
2
- export { default as DialogCompoundComponents } from './_dialog_compound_components.jsx'
3
- export { default as DialogSizes } from './_dialog_sizes.jsx'
4
- export { default as DialogScrollable } from './_dialog_scrollable.jsx'
5
- export { default as DialogSeparators } from './_dialog_separators.jsx'
6
- export { default as DialogShouldCloseOnOverlay } from './_dialog_should_close_on_overlay.jsx'
@@ -1,83 +0,0 @@
1
- /* @flow */
2
-
3
- import React, { useEffect, useRef, useState } from 'react'
4
- import classnames from 'classnames'
5
- import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
6
- import { globalProps } from '../utilities/globalProps.js'
7
- import './_inline.scss'
8
-
9
- type InlineProps = {
10
- aria?: object,
11
- className?: string,
12
- data?: object,
13
- displayKit?: React.Node,
14
- formInput?: React.Node,
15
- id?: string,
16
- }
17
-
18
- const Inline = (props: InlineProps) => {
19
- const {
20
- aria = {},
21
- className,
22
- data = {},
23
- displayKit,
24
- id,
25
- formInput,
26
- } = props
27
-
28
- const ariaProps = buildAriaProps(aria)
29
- const dataProps = buildDataProps(data)
30
- const classes = classnames(buildCss('pb_inline'), globalProps(props), className)
31
-
32
- const [editing, setEditing] = useState(false)
33
-
34
- const ToggleClickHandler = () => {
35
- setEditing(!editing)
36
- }
37
-
38
- useEffect(() => {
39
- if (editing) {
40
- modifiedInput.ref.current.focus()
41
-
42
- modifiedInput.ref.current.addEventListener('keydown', (e) => {
43
- if (e.key === 'Escape' || e.key === 'Enter') {
44
- setEditing(!editing)
45
- }
46
- })
47
- }
48
- }, [editing])
49
-
50
- const { kitType, size } = displayKit.props
51
- const textInputClassName = kitType ? (kitType.toLowerCase() + (size ? `_${size}` : '')) : ''
52
-
53
- const modifiedInput = React.cloneElement(formInput, {
54
- className: textInputClassName,
55
- onBlur: () => setEditing(!editing),
56
- ref: useRef(null),
57
- })
58
-
59
- return (
60
- <div
61
- {...ariaProps}
62
- {...dataProps}
63
- className={classes}
64
- id={id}
65
- >
66
- <If condition={editing}>
67
- {modifiedInput}
68
- </If>
69
- <If condition={!editing}>
70
- <div
71
- onClick={() => ToggleClickHandler()}
72
- onFocus={() => ToggleClickHandler()}
73
- tabIndex="0"
74
- >
75
- {displayKit}
76
- </div>
77
- </If>
78
-
79
- </div>
80
- )
81
- }
82
-
83
- export default Inline
@@ -1,58 +0,0 @@
1
- @import "../pb_title/title_mixin";
2
- @import "../pb_body/body_mixins";
3
- @import "../pb_caption/caption_mixin";
4
-
5
- .pb_inline {
6
- .pb_text_input_kit {
7
- &.title_1 {
8
- .text_input_wrapper input {
9
- @include pb_title_1;
10
- }
11
- &.dark .text_input_wrapper input {
12
- @include pb_title_1;
13
- @include pb_title_dark;
14
- }
15
- }
16
- &.title_2 {
17
- .text_input_wrapper input {
18
- @include pb_title_2;
19
- }
20
- &.dark .text_input_wrapper input {
21
- @include pb_title_2;
22
- @include pb_title_dark;
23
- }
24
- }
25
- &.title_3 {
26
- .text_input_wrapper input {
27
- @include pb_title_3;
28
- }
29
- &.dark .text_input_wrapper input {
30
- @include pb_title_3;
31
- @include pb_title_dark;
32
- }
33
- }
34
- &.body {
35
- .text_input_wrapper input {
36
- @include pb_body;
37
- }
38
- &.dark .text_input_wrapper input {
39
- @include pb_body_dark;
40
- }
41
- }
42
- &.caption {
43
- .text_input_wrapper input {
44
- @include caption;
45
- }
46
- &.dark .text_input_wrapper input {
47
- @include caption;
48
- @include caption_dark;
49
- }
50
- }
51
- .text_input_wrapper input {
52
- padding: 8px 5px;
53
- }
54
- .text_input_wrapper, .pb_textarea_kit {
55
- margin-bottom: 0;
56
- }
57
- }
58
- }
@@ -1,36 +0,0 @@
1
- import React, { useState } from 'react'
2
- import { Inline, TextInput, Title } from '../../'
3
-
4
- const InlineDefault = (props) => {
5
- const [formValue, setFormValue] = useState('Default Value')
6
-
7
- const handleInputChange = (event) => {
8
- setFormValue(event.target.value)
9
- }
10
-
11
- return (
12
- <div>
13
- <Inline
14
- {...props}
15
- displayKit={
16
- <Title
17
- {...props}
18
- kitType="Title"
19
- size={4}
20
- tag="h4"
21
- text={formValue}
22
- />
23
- }
24
- formInput={
25
- <TextInput
26
- {...props}
27
- onChange={handleInputChange}
28
- value={formValue}
29
- />
30
- }
31
- />
32
- </div>
33
- )
34
- }
35
-
36
- export default InlineDefault
@@ -1,58 +0,0 @@
1
- import React, { useState } from 'react'
2
- import { Body, Inline, Textarea, TextInput } from '../../'
3
-
4
- const InlineInputOptions = (props) => {
5
- const [formFields, setFormFields] = useState({
6
- inputOne: 'Input One',
7
- inputTwo: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
8
- })
9
-
10
- const handleChange = ({ target }) => {
11
- const { name, value } = target
12
- setFormFields({ ...formFields, [name]: value })
13
- }
14
-
15
- return (
16
- <div>
17
- <Inline
18
- {...props}
19
- displayKit={
20
- <Body
21
- {...props}
22
- kitType="Body"
23
- text={formFields.inputOne}
24
- />
25
- }
26
- formInput={
27
- <TextInput
28
- {...props}
29
- name="inputOne"
30
- onChange={handleChange}
31
- value={formFields.inputOne}
32
- />
33
- }
34
- />
35
- <Inline
36
- {...props}
37
- displayKit={
38
- <Body
39
- {...props}
40
- kitType="Body"
41
- text={formFields.inputTwo}
42
- />
43
- }
44
- formInput={
45
- <Textarea
46
- {...props}
47
- name="inputTwo"
48
- onChange={handleChange}
49
- resize="auto"
50
- value={formFields.inputTwo}
51
- />
52
- }
53
- />
54
- </div>
55
- )
56
- }
57
-
58
- export default InlineInputOptions
@@ -1,99 +0,0 @@
1
- import React, { useState } from 'react'
2
- import { Body, Caption, Inline, TextInput, Title } from '../../'
3
-
4
- const InlineTextOptions = (props) => {
5
- const [formFields, setFormFields] = useState({
6
- inputOne: 'Input One',
7
- inputTwo: 'Input Two',
8
- inputThree: 'Input Three',
9
- inputFour: 'Input Four',
10
- })
11
-
12
- const handleChange = ({ target }) => {
13
- const { name, value } = target
14
- setFormFields({ ...formFields, [name]: value })
15
- }
16
-
17
- return (
18
- <div>
19
- <Inline
20
- {...props}
21
- displayKit={
22
- <Title
23
- {...props}
24
- kitType="Title"
25
- size={1}
26
- tag="h1"
27
- text={formFields.inputOne}
28
- />
29
- }
30
- formInput={
31
- <TextInput
32
- {...props}
33
- name="inputOne"
34
- onChange={handleChange}
35
- value={formFields.inputOne}
36
- />
37
- }
38
- />
39
- <Inline
40
- {...props}
41
- displayKit={
42
- <Title
43
- {...props}
44
- kitType="Title 4"
45
- size={4}
46
- tag="h4"
47
- text={formFields.inputTwo}
48
- />
49
- }
50
- formInput={
51
- <TextInput
52
- {...props}
53
- name="inputTwo"
54
- onChange={handleChange}
55
- value={formFields.inputTwo}
56
- />
57
- }
58
- />
59
- <Inline
60
- {...props}
61
- displayKit={
62
- <Body
63
- {...props}
64
- kitType="Body"
65
- text={formFields.inputThree}
66
- />
67
- }
68
- formInput={
69
- <TextInput
70
- {...props}
71
- name="inputThree"
72
- onChange={handleChange}
73
- value={formFields.inputThree}
74
- />
75
- }
76
- />
77
- <Inline
78
- {...props}
79
- displayKit={
80
- <Caption
81
- {...props}
82
- kitType="Caption"
83
- text={formFields.inputFour}
84
- />
85
- }
86
- formInput={
87
- <TextInput
88
- {...props}
89
- name="inputFour"
90
- onChange={handleChange}
91
- value={formFields.inputFour}
92
- />
93
- }
94
- />
95
- </div>
96
- )
97
- }
98
-
99
- export default InlineTextOptions
@@ -1,5 +0,0 @@
1
- examples:
2
- react:
3
- - inline_default: Default
4
- - inline_text_options: Text Options
5
- - inline_input_options: Input Options
@@ -1,3 +0,0 @@
1
- export { default as InlineDefault } from './_inline_default.jsx'
2
- export { default as InlineTextOptions } from './_inline_text_options.jsx'
3
- export { default as InlineInputOptions } from './_inline_input_options.jsx'
@@ -1,21 +0,0 @@
1
- import React from 'react'
2
- import { render, screen } from '../utilities/test-utils'
3
- import { Inline } from '../'
4
-
5
- /* See these resources for more testing info:
6
- - https://github.com/testing-library/jest-dom#usage for useage and examples
7
- - https://jestjs.io/docs/en/using-matchers
8
- */
9
-
10
- test('generated scaffold test - update me', () => {
11
- const testId = "test1"
12
-
13
- render(
14
- <Inline
15
- data={{ testid: testId }}
16
- />
17
- )
18
-
19
- const kit = screen.getByTestId(testId)
20
- expect(kit).toBeInTheDocument()
21
- })
@@ -1,10 +0,0 @@
1
- @import "../border_radius";
2
-
3
- :export {
4
- @mixin export_border_radius($border_radius_list) {
5
- @each $name, $size in $border_radius_list {
6
- #{$name}: $size;
7
- }
8
- }
9
- @include export_border_radius($border_radius);
10
- }
@@ -1,26 +0,0 @@
1
- @import "../colors";
2
-
3
- :export {
4
- @mixin export-colors($colors-list) {
5
- @each $name, $color in $colors-list {
6
- #{$name}: $color;
7
- }
8
- }
9
- @include export-colors($product_colors);
10
- @include export-colors($status_colors);
11
- @include export-colors($data_colors);
12
- @include export-colors($shadow_colors);
13
- @include export-colors($colors);
14
- @include export-colors($interface_colors);
15
- @include export-colors($main_colors);
16
- @include export-colors($background_colors);
17
- @include export-colors($card_colors);
18
- @include export-colors($active_colors);
19
- @include export-colors($action_colors);
20
- @include export-colors($hover_colors);
21
- @include export-colors($border_colors);
22
- @include export-colors($text_colors);
23
- @include export-colors($category_colors);
24
- gradient_start: $gradient_start;
25
- gradient_end: $gradient_end;
26
- }
@@ -1,10 +0,0 @@
1
- @import "../line_height";
2
-
3
- :export {
4
- @mixin export_line_height($line_height_list) {
5
- @each $name, $settings in $line_height_list {
6
- #{$name}: $settings;
7
- }
8
- }
9
- @include export_line_height($line_height);
10
- }