playbook_ui 12.10.0 → 12.12.0.pre.alpha.PLAY697sandpacklayoutstyles413
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_avatar/_avatar.tsx +1 -1
- data/app/pb_kits/playbook/pb_button/_button.tsx +15 -3
- data/app/pb_kits/playbook/pb_button/button.rb +10 -1
- data/app/pb_kits/playbook/pb_button/button.test.js +92 -61
- data/app/pb_kits/playbook/pb_button/docs/_button_link.html.erb +3 -2
- data/app/pb_kits/playbook/pb_button/docs/_button_link.jsx +12 -2
- data/app/pb_kits/playbook/pb_button/docs/_button_link.md +1 -0
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +3 -3
- data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +3 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.html.erb +20 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.jsx +31 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.md +3 -0
- data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +3 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_day_styles.scss +1 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +13 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.jsx +68 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.md +1 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb +6 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/index.js +17 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/{_rich_text_editor.jsx → _rich_text_editor.tsx} +40 -32
- data/app/pb_kits/playbook/pb_rich_text_editor/{inlineFocus.js → inlineFocus.ts} +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/{useFocus.js → useFocus.ts} +1 -1
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.tsx +1 -0
- data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.test.js +67 -0
- data/app/pb_kits/playbook/pb_selectable_card_icon/{_selectable_card_icon.jsx → _selectable_card_icon.tsx} +26 -28
- data/app/pb_kits/playbook/pb_source/{_source.jsx → _source.tsx} +33 -29
- data/app/pb_kits/playbook/pb_source/source.test.js +82 -0
- data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +4 -1
- data/lib/playbook/version.rb +2 -2
- metadata +20 -12
data/app/pb_kits/playbook/pb_rich_text_editor/{_rich_text_editor.jsx → _rich_text_editor.tsx}
RENAMED
@@ -1,6 +1,3 @@
|
|
1
|
-
/* @flow */
|
2
|
-
/* eslint-disable react-hooks/rules-of-hooks */
|
3
|
-
|
4
1
|
import React, { useEffect, useState } from 'react'
|
5
2
|
import classnames from 'classnames'
|
6
3
|
import inlineFocus from './inlineFocus'
|
@@ -18,11 +15,21 @@ try {
|
|
18
15
|
|
19
16
|
import { TrixEditor } from "react-trix"
|
20
17
|
|
18
|
+
type Editor = {
|
19
|
+
attributeIsActive?: Function,
|
20
|
+
element?: HTMLElement,
|
21
|
+
getSelectedDocument?: Function,
|
22
|
+
getSelectedRange?: () => Array<number>,
|
23
|
+
insertHTML?: Function,
|
24
|
+
loadHTML?: Function,
|
25
|
+
setSelectedRange?: (range: Array<number>) => void,
|
26
|
+
}
|
27
|
+
|
21
28
|
type RichTextEditorProps = {
|
22
|
-
aria?:
|
29
|
+
aria?: { [key: string]: string },
|
23
30
|
toolbarBottom?: Boolean,
|
24
31
|
className?: string,
|
25
|
-
data?:
|
32
|
+
data?: { [key: string]: string },
|
26
33
|
focus?: boolean,
|
27
34
|
id?: string,
|
28
35
|
inline?: boolean,
|
@@ -53,19 +60,19 @@ const RichTextEditor = (props: RichTextEditorProps) => {
|
|
53
60
|
} = props
|
54
61
|
|
55
62
|
const ariaProps = buildAriaProps(aria),
|
56
|
-
|
57
|
-
|
63
|
+
dataProps = buildDataProps(data),
|
64
|
+
[editor, setEditor] = useState<Editor>()
|
58
65
|
|
59
|
-
const handleOnEditorReady = (editorInstance) => setEditor(editorInstance),
|
60
|
-
|
66
|
+
const handleOnEditorReady = (editorInstance: Editor) => setEditor(editorInstance),
|
67
|
+
element = editor?.element
|
61
68
|
|
62
69
|
// DOM manipulation must wait for editor to be ready
|
63
70
|
if (editor) {
|
64
|
-
const toolbarElement = element.parentElement.querySelector('trix-toolbar'),
|
65
|
-
|
71
|
+
const toolbarElement = element.parentElement.querySelector('trix-toolbar') as HTMLElement,
|
72
|
+
blockCodeButton = toolbarElement.querySelector('[data-trix-attribute=code]') as HTMLElement
|
66
73
|
|
67
|
-
let inlineCodeButton = toolbarElement.querySelector('[data-trix-attribute=inlineCode]')
|
68
|
-
if (!inlineCodeButton) inlineCodeButton = blockCodeButton.cloneNode(true)
|
74
|
+
let inlineCodeButton = toolbarElement.querySelector('[data-trix-attribute=inlineCode]') as HTMLElement
|
75
|
+
if (!inlineCodeButton) inlineCodeButton = blockCodeButton.cloneNode(true) as HTMLElement
|
69
76
|
|
70
77
|
// set button attributes
|
71
78
|
inlineCodeButton.dataset.trixAttribute = 'inlineCode'
|
@@ -93,8 +100,8 @@ const RichTextEditor = (props: RichTextEditorProps) => {
|
|
93
100
|
|
94
101
|
focus
|
95
102
|
? (document.addEventListener('trix-focus', useFocus),
|
96
|
-
|
97
|
-
|
103
|
+
document.addEventListener('trix-blur', useFocus),
|
104
|
+
useFocus())
|
98
105
|
: null
|
99
106
|
|
100
107
|
document.addEventListener('trix-focus', inlineFocus)
|
@@ -110,11 +117,11 @@ const RichTextEditor = (props: RichTextEditorProps) => {
|
|
110
117
|
|
111
118
|
useEffect(() => {
|
112
119
|
if (!element) return
|
113
|
-
element.addEventListener('click', ({target}) => {
|
114
|
-
const trixEditorContainer = target.closest('.pb_rich_text_editor_kit')
|
120
|
+
element.addEventListener('click', ({ target }: Event) => {
|
121
|
+
const trixEditorContainer = (target as Element).closest('.pb_rich_text_editor_kit')
|
115
122
|
if (!trixEditorContainer) return
|
116
123
|
|
117
|
-
const anchorElement = target.closest('a')
|
124
|
+
const anchorElement = (target as Element).closest('a')
|
118
125
|
if (!anchorElement) return
|
119
126
|
|
120
127
|
if (anchorElement.hasAttribute('href')) window.open(anchorElement.href)
|
@@ -122,11 +129,11 @@ const RichTextEditor = (props: RichTextEditorProps) => {
|
|
122
129
|
}, [element])
|
123
130
|
|
124
131
|
const richTextEditorClass = 'pb_rich_text_editor_kit',
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
132
|
+
simpleClass = simple ? 'simple' : '',
|
133
|
+
focusClass = focus ? 'focus-editor-targets' : '',
|
134
|
+
stickyClass = sticky ? 'sticky' : '',
|
135
|
+
inlineClass = inline ? 'inline' : '',
|
136
|
+
toolbarBottomClass = toolbarBottom ? 'toolbar-bottom' : ''
|
130
137
|
|
131
138
|
let css = classnames(globalProps(props), className)
|
132
139
|
css = classnames(
|
@@ -141,17 +148,18 @@ const RichTextEditor = (props: RichTextEditorProps) => {
|
|
141
148
|
|
142
149
|
return (
|
143
150
|
<div
|
144
|
-
|
145
|
-
|
146
|
-
|
151
|
+
{...ariaProps}
|
152
|
+
{...dataProps}
|
153
|
+
className={css}
|
147
154
|
>
|
148
155
|
<TrixEditor
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
156
|
+
className=""
|
157
|
+
fileParamName={name}
|
158
|
+
mergeTags={[]}
|
159
|
+
onChange={onChange}
|
160
|
+
onEditorReady={handleOnEditorReady}
|
161
|
+
placeholder={placeholder}
|
162
|
+
value={value}
|
155
163
|
/>
|
156
164
|
</div>
|
157
165
|
)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
const inlineFocus = () => {
|
2
|
-
const trixEditorElement = event.target
|
2
|
+
const trixEditorElement = event.target as Element
|
3
3
|
const trixEditorContainer = trixEditorElement.closest('.pb_rich_text_editor_kit')
|
4
4
|
|
5
5
|
if (!trixEditorContainer.classList.contains('inline')) return
|
@@ -2,7 +2,7 @@ const useFocus = () => {
|
|
2
2
|
const allTrixEditors = document.querySelectorAll(
|
3
3
|
'.focus-editor-targets trix-editor'
|
4
4
|
)
|
5
|
-
allTrixEditors.forEach((editorElement) => {
|
5
|
+
allTrixEditors.forEach((editorElement: any) => {
|
6
6
|
const toolbarElement = editorElement.toolbarElement
|
7
7
|
if (editorElement == document.activeElement) {
|
8
8
|
editorElement.classList.add('focused-editor')
|
@@ -102,6 +102,7 @@ const SelectableCard = (props: SelectableCardProps) => {
|
|
102
102
|
delete filteredProps?.error
|
103
103
|
delete filteredProps?.dark
|
104
104
|
delete filteredProps?.multi
|
105
|
+
delete filteredProps?.customIcon
|
105
106
|
const labelProps: GlobalProps = variant === 'displayInput' ? { ...filteredProps, padding: 'none' } : { ...filteredProps }
|
106
107
|
|
107
108
|
return (
|
@@ -0,0 +1,67 @@
|
|
1
|
+
import React, { useState } from 'react'
|
2
|
+
import { render, screen } from '../utilities/test-utils'
|
3
|
+
|
4
|
+
import SelectableCardIcon from './_selectable_card_icon'
|
5
|
+
|
6
|
+
const testId = 'selectableCardIcon'
|
7
|
+
const className = 'custom-class-name'
|
8
|
+
|
9
|
+
const SelectableCardIconDefault = () => {
|
10
|
+
const [selected, setSelected] = useState(true)
|
11
|
+
|
12
|
+
return (
|
13
|
+
<SelectableCardIcon
|
14
|
+
aria={{ label: testId }}
|
15
|
+
bodyText="Export"
|
16
|
+
checked={selected}
|
17
|
+
className={className}
|
18
|
+
data={{ testid: testId }}
|
19
|
+
icon="chart-line"
|
20
|
+
inputId={1}
|
21
|
+
onChange={() => setSelected(!selected)}
|
22
|
+
titleText="Quarterly Report"
|
23
|
+
/>
|
24
|
+
)
|
25
|
+
}
|
26
|
+
|
27
|
+
test('should pass data prop', () => {
|
28
|
+
render(<SelectableCardIconDefault />)
|
29
|
+
const kit = screen.getByTestId(testId)
|
30
|
+
expect(kit).toBeInTheDocument()
|
31
|
+
})
|
32
|
+
|
33
|
+
test('should pass className prop', () => {
|
34
|
+
render(<SelectableCardIconDefault />)
|
35
|
+
const kit = screen.getByTestId(testId)
|
36
|
+
expect(kit).toHaveClass(className)
|
37
|
+
})
|
38
|
+
|
39
|
+
test('should pass aria prop', () => {
|
40
|
+
render(<SelectableCardIconDefault />)
|
41
|
+
const kit = screen.getByTestId(testId)
|
42
|
+
expect(kit).toHaveAttribute('aria-label', testId)
|
43
|
+
})
|
44
|
+
|
45
|
+
test('should be checked', () => {
|
46
|
+
render(<SelectableCardIconDefault />)
|
47
|
+
const kit = screen.getByTestId(testId)
|
48
|
+
expect(kit).toHaveClass('pb_selectable_card_icon_kit_checked_enabled')
|
49
|
+
})
|
50
|
+
|
51
|
+
test('should not be disabled', () => {
|
52
|
+
render(<SelectableCardIconDefault />)
|
53
|
+
const kit = screen.getByTestId(testId)
|
54
|
+
expect(kit).toHaveClass('pb_selectable_card_icon_kit_checked_enabled')
|
55
|
+
})
|
56
|
+
|
57
|
+
test('should render body text prop', () => {
|
58
|
+
render(<SelectableCardIconDefault />)
|
59
|
+
const kit = screen.getByText("Export")
|
60
|
+
expect(kit).toBeInTheDocument()
|
61
|
+
})
|
62
|
+
|
63
|
+
test('should render title text prop', () => {
|
64
|
+
render(<SelectableCardIconDefault />)
|
65
|
+
const kit = screen.getByText("Quarterly Report")
|
66
|
+
expect(kit).toBeInTheDocument()
|
67
|
+
})
|
@@ -1,5 +1,3 @@
|
|
1
|
-
/* @flow */
|
2
|
-
|
3
1
|
import React from 'react'
|
4
2
|
import classnames from 'classnames'
|
5
3
|
|
@@ -15,13 +13,13 @@ import SelectableCard from '../pb_selectable_card/_selectable_card'
|
|
15
13
|
import SelectableIcon from '../pb_selectable_icon/_selectable_icon'
|
16
14
|
|
17
15
|
type SelectableCardIconProps = {
|
18
|
-
aria?:
|
16
|
+
aria?: { [key: string]: string },
|
19
17
|
checked?: boolean,
|
20
18
|
checkmark: boolean,
|
21
19
|
className?: string,
|
22
|
-
customIcon?: SVGElement,
|
20
|
+
customIcon?: { [key: string]: SVGElement },
|
23
21
|
dark?: boolean,
|
24
|
-
data?:
|
22
|
+
data?: { [key: string]: string },
|
25
23
|
disabled?: boolean,
|
26
24
|
icon?: string,
|
27
25
|
inputId?: string,
|
@@ -30,7 +28,7 @@ type SelectableCardIconProps = {
|
|
30
28
|
titleText?: string,
|
31
29
|
bodyText?: string,
|
32
30
|
value?: string,
|
33
|
-
onChange?: (
|
31
|
+
onChange?: (event: React.FormEvent<HTMLInputElement>) => void,
|
34
32
|
}
|
35
33
|
|
36
34
|
const SelectableCardIcon = (props: SelectableCardIconProps) => {
|
@@ -68,35 +66,35 @@ const SelectableCardIcon = (props: SelectableCardIconProps) => {
|
|
68
66
|
|
69
67
|
return (
|
70
68
|
<div
|
71
|
-
|
72
|
-
|
73
|
-
|
69
|
+
{...ariaProps}
|
70
|
+
{...dataProps}
|
71
|
+
className={classes}
|
74
72
|
>
|
75
73
|
<SelectableCard
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
74
|
+
checked={checked}
|
75
|
+
customIcon={customIcon}
|
76
|
+
dark={dark}
|
77
|
+
disabled={disabled}
|
78
|
+
icon={checkmark}
|
79
|
+
inputId={inputId}
|
80
|
+
multi={multi}
|
81
|
+
name={name}
|
82
|
+
onChange={onChange}
|
83
|
+
value={value}
|
86
84
|
>
|
87
85
|
{
|
88
86
|
<>
|
89
87
|
<SelectableIcon
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
88
|
+
customIcon={customIcon}
|
89
|
+
icon={icon}
|
90
|
+
inputId={''}
|
91
|
+
inputs="disabled"
|
92
|
+
name={''}
|
93
|
+
text={titleText} />
|
96
94
|
<Body
|
97
|
-
|
98
|
-
|
99
|
-
|
95
|
+
color="light"
|
96
|
+
dark={dark}
|
97
|
+
text={bodyText}
|
100
98
|
/>
|
101
99
|
</>
|
102
100
|
}
|
@@ -1,28 +1,28 @@
|
|
1
|
-
/* @flow */
|
2
|
-
|
3
1
|
import React from 'react'
|
4
2
|
import classnames from 'classnames'
|
5
3
|
|
6
|
-
import { buildDataProps } from '../utilities/props'
|
4
|
+
import { buildDataProps, buildAriaProps } from '../utilities/props'
|
7
5
|
import { titleize } from '../utilities/text'
|
8
6
|
|
9
|
-
import Avatar from '../pb_avatar/_avatar'
|
7
|
+
import Avatar, { AvatarProps } from '../pb_avatar/_avatar'
|
10
8
|
import Body from '../pb_body/_body'
|
11
9
|
import Caption from '../pb_caption/_caption'
|
12
10
|
import IconCircle from '../pb_icon_circle/_icon_circle'
|
13
11
|
import Title from '../pb_title/_title'
|
14
12
|
|
15
13
|
type SourceProps = {
|
14
|
+
aria?: {[key: string]: string},
|
16
15
|
className?: string,
|
17
|
-
data?:
|
16
|
+
data?: { [key: string]: string },
|
18
17
|
hideIcon: boolean,
|
19
18
|
id?: string,
|
20
19
|
source?: string,
|
21
20
|
type: "events" | "inbound" | "outbound" | "prospecting" | "referral" | "retail" | "user",
|
22
|
-
user:
|
21
|
+
user: AvatarProps,
|
23
22
|
}
|
24
23
|
|
25
24
|
const Source = ({
|
25
|
+
aria = {},
|
26
26
|
className,
|
27
27
|
data = {},
|
28
28
|
hideIcon = false,
|
@@ -32,6 +32,7 @@ const Source = ({
|
|
32
32
|
user = {},
|
33
33
|
}: SourceProps) => {
|
34
34
|
const dataProps = buildDataProps(data)
|
35
|
+
const ariaProps = buildAriaProps(aria)
|
35
36
|
|
36
37
|
const css = classnames([
|
37
38
|
'pb_source_kit',
|
@@ -40,7 +41,7 @@ const Source = ({
|
|
40
41
|
|
41
42
|
const avatar = () => {
|
42
43
|
if ((type === 'user' || type === 'referral') && user.name !== undefined) {
|
43
|
-
const avatarProps = { ...user }
|
44
|
+
const avatarProps: AvatarProps = { ...user }
|
44
45
|
avatarProps.size = 'sm'
|
45
46
|
delete avatarProps.userId
|
46
47
|
return avatarProps
|
@@ -55,7 +56,7 @@ const Source = ({
|
|
55
56
|
}
|
56
57
|
}
|
57
58
|
|
58
|
-
const typeIconNames = {
|
59
|
+
const typeIconNames: { [key: string]: string } = {
|
59
60
|
events: 'calendar-alt',
|
60
61
|
outbound: 'sign-out',
|
61
62
|
prospecting: 'binoculars',
|
@@ -68,47 +69,50 @@ const Source = ({
|
|
68
69
|
|
69
70
|
return (
|
70
71
|
<div
|
71
|
-
|
72
|
-
|
73
|
-
|
72
|
+
{...ariaProps}
|
73
|
+
{...dataProps}
|
74
|
+
className={css}
|
75
|
+
id={id}
|
74
76
|
>
|
75
77
|
|
76
78
|
<div className="pb__source_layout">
|
77
|
-
|
78
|
-
|
79
|
-
|
79
|
+
{hideIcon === false &&
|
80
|
+
<>
|
81
|
+
{showIcon() &&
|
82
|
+
<IconCircle
|
80
83
|
icon={typeIconNames[type]}
|
81
84
|
size="sm"
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
+
/>
|
86
|
+
}
|
87
|
+
{!showIcon() &&
|
88
|
+
<Avatar
|
85
89
|
{...avatar()}
|
86
|
-
|
87
|
-
|
88
|
-
|
90
|
+
/>
|
91
|
+
}
|
92
|
+
</>
|
93
|
+
}
|
89
94
|
|
90
95
|
<div className="pb__source_content">
|
91
96
|
<Title
|
92
|
-
|
93
|
-
|
94
|
-
|
97
|
+
size={4}
|
98
|
+
tag="h4"
|
99
|
+
text={source}
|
95
100
|
/>
|
96
101
|
|
97
102
|
<div className="pb__source_value">
|
98
103
|
<Body
|
99
|
-
|
100
|
-
|
104
|
+
color="light"
|
105
|
+
text={typeText()}
|
101
106
|
/>
|
102
107
|
|
103
|
-
|
108
|
+
{user.userId &&
|
104
109
|
<Caption
|
105
|
-
|
110
|
+
text={user.userId}
|
106
111
|
/>
|
107
|
-
|
112
|
+
}
|
108
113
|
</div>
|
109
114
|
</div>
|
110
115
|
</div>
|
111
|
-
|
112
116
|
</div>
|
113
117
|
)
|
114
118
|
}
|
@@ -0,0 +1,82 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { render, screen } from '../utilities/test-utils'
|
3
|
+
|
4
|
+
import Source from './_source'
|
5
|
+
|
6
|
+
const testId = 'source'
|
7
|
+
const className = 'custom-class-name'
|
8
|
+
|
9
|
+
const SourceDefault = (props) => (
|
10
|
+
<>
|
11
|
+
<Source
|
12
|
+
aria={{ label: testId }}
|
13
|
+
className={className}
|
14
|
+
data={{ testid: testId }}
|
15
|
+
source="BJ's Johnston-208"
|
16
|
+
type='retail'
|
17
|
+
{...props}
|
18
|
+
/>
|
19
|
+
</>
|
20
|
+
)
|
21
|
+
|
22
|
+
test('should pass data prop', () => {
|
23
|
+
render(<SourceDefault />)
|
24
|
+
const kit = screen.getByTestId(testId)
|
25
|
+
expect(kit).toBeInTheDocument()
|
26
|
+
})
|
27
|
+
|
28
|
+
test('should pass className prop', () => {
|
29
|
+
render(<SourceDefault />)
|
30
|
+
const kit = screen.getByTestId(testId)
|
31
|
+
expect(kit).toHaveClass(className)
|
32
|
+
})
|
33
|
+
|
34
|
+
test('should pass aria prop', () => {
|
35
|
+
render(<SourceDefault />)
|
36
|
+
const kit = screen.getByTestId(testId)
|
37
|
+
expect(kit).toHaveAttribute('aria-label', testId)
|
38
|
+
})
|
39
|
+
|
40
|
+
test('should pass type prop', () => {
|
41
|
+
render(<SourceDefault />)
|
42
|
+
const kit = screen.getByText('Retail')
|
43
|
+
expect(kit).toBeInTheDocument()
|
44
|
+
})
|
45
|
+
|
46
|
+
test('should pass source prop', () => {
|
47
|
+
render(<SourceDefault />)
|
48
|
+
const kit = screen.getByText("BJ's Johnston-208")
|
49
|
+
expect(kit).toBeInTheDocument()
|
50
|
+
})
|
51
|
+
|
52
|
+
test('should not hide icon by default', () => {
|
53
|
+
render(<SourceDefault />)
|
54
|
+
const kit = screen.getByTestId(testId)
|
55
|
+
expect(kit.querySelector('.pb_icon_circle_kit_sm_default')).toBeTruthy()
|
56
|
+
})
|
57
|
+
|
58
|
+
test('should hide icon', () => {
|
59
|
+
render(<SourceDefault hideIcon />)
|
60
|
+
const kit = screen.getByTestId(testId)
|
61
|
+
expect(kit.querySelector('.pb_icon_circle_kit_sm_default')).toBeFalsy()
|
62
|
+
})
|
63
|
+
|
64
|
+
test('should pass user prop', () => {
|
65
|
+
const user = {
|
66
|
+
name: 'Anna Black',
|
67
|
+
userId: '48582',
|
68
|
+
}
|
69
|
+
|
70
|
+
render(
|
71
|
+
<SourceDefault
|
72
|
+
type='user'
|
73
|
+
user={user}
|
74
|
+
/>
|
75
|
+
)
|
76
|
+
|
77
|
+
let kit = screen.getByText(user.name)
|
78
|
+
expect(kit).toBeInTheDocument()
|
79
|
+
|
80
|
+
kit = screen.getByText(user.userId)
|
81
|
+
expect(kit).toBeInTheDocument()
|
82
|
+
})
|
@@ -10,13 +10,16 @@ import {
|
|
10
10
|
useFloating,
|
11
11
|
useHover,
|
12
12
|
useInteractions,
|
13
|
-
} from "@floating-ui/react
|
13
|
+
} from "@floating-ui/react"
|
14
14
|
|
15
15
|
import classnames from "classnames"
|
16
16
|
import { GlobalProps, globalProps } from "../utilities/globalProps"
|
17
17
|
import { buildAriaProps, buildDataProps } from "../utilities/props"
|
18
18
|
import Flex from "../pb_flex/_flex"
|
19
19
|
|
20
|
+
|
21
|
+
|
22
|
+
|
20
23
|
type TooltipProps = {
|
21
24
|
aria?: { [key: string]: string },
|
22
25
|
className?: string | string[],
|
data/lib/playbook/version.rb
CHANGED
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.
|
4
|
+
version: 12.12.0.pre.alpha.PLAY697sandpacklayoutstyles413
|
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-
|
12
|
+
date: 2023-04-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -457,6 +457,7 @@ files:
|
|
457
457
|
- app/pb_kits/playbook/pb_button/docs/_button_icon_options.md
|
458
458
|
- app/pb_kits/playbook/pb_button/docs/_button_link.html.erb
|
459
459
|
- app/pb_kits/playbook/pb_button/docs/_button_link.jsx
|
460
|
+
- app/pb_kits/playbook/pb_button/docs/_button_link.md
|
460
461
|
- app/pb_kits/playbook/pb_button/docs/_button_loading.html.erb
|
461
462
|
- app/pb_kits/playbook/pb_button/docs/_button_loading.jsx
|
462
463
|
- app/pb_kits/playbook/pb_button/docs/_button_loading.md
|
@@ -569,6 +570,9 @@ files:
|
|
569
570
|
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.html.erb
|
570
571
|
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx
|
571
572
|
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.md
|
573
|
+
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.html.erb
|
574
|
+
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.jsx
|
575
|
+
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.md
|
572
576
|
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.html.erb
|
573
577
|
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx
|
574
578
|
- app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_inner_sizes.html.erb
|
@@ -955,6 +959,8 @@ files:
|
|
955
959
|
- app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.scss
|
956
960
|
- app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx
|
957
961
|
- app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_description.md
|
962
|
+
- app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.jsx
|
963
|
+
- app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_auto_close.md
|
958
964
|
- app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_close.html.erb
|
959
965
|
- app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_close.jsx
|
960
966
|
- app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_default.html.erb
|
@@ -1710,8 +1716,8 @@ files:
|
|
1710
1716
|
- app/pb_kits/playbook/pb_radio/radio.html.erb
|
1711
1717
|
- app/pb_kits/playbook/pb_radio/radio.rb
|
1712
1718
|
- app/pb_kits/playbook/pb_radio/radio.test.js
|
1713
|
-
- app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.jsx
|
1714
1719
|
- app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.scss
|
1720
|
+
- app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx
|
1715
1721
|
- app/pb_kits/playbook/pb_rich_text_editor/_trix_styles.scss
|
1716
1722
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_attributes.html.erb
|
1717
1723
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_attributes.jsx
|
@@ -1734,11 +1740,11 @@ files:
|
|
1734
1740
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml
|
1735
1741
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/index.js
|
1736
1742
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/templates.js
|
1737
|
-
- app/pb_kits/playbook/pb_rich_text_editor/inlineFocus.
|
1743
|
+
- app/pb_kits/playbook/pb_rich_text_editor/inlineFocus.ts
|
1738
1744
|
- app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.html.erb
|
1739
1745
|
- app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb
|
1740
1746
|
- app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.test.js
|
1741
|
-
- app/pb_kits/playbook/pb_rich_text_editor/useFocus.
|
1747
|
+
- app/pb_kits/playbook/pb_rich_text_editor/useFocus.ts
|
1742
1748
|
- app/pb_kits/playbook/pb_section_separator/_section_separator.scss
|
1743
1749
|
- app/pb_kits/playbook/pb_section_separator/_section_separator.tsx
|
1744
1750
|
- app/pb_kits/playbook/pb_section_separator/_section_separator_mixin.scss
|
@@ -1811,8 +1817,9 @@ files:
|
|
1811
1817
|
- app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb
|
1812
1818
|
- app/pb_kits/playbook/pb_selectable_card/selectable_card.rb
|
1813
1819
|
- app/pb_kits/playbook/pb_selectable_card/selectable_card.test.js
|
1814
|
-
- app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.jsx
|
1815
1820
|
- app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.scss
|
1821
|
+
- app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.test.js
|
1822
|
+
- app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.tsx
|
1816
1823
|
- app/pb_kits/playbook/pb_selectable_card_icon/docs/_selectable_card_icon_checkmark.html.erb
|
1817
1824
|
- app/pb_kits/playbook/pb_selectable_card_icon/docs/_selectable_card_icon_checkmark.jsx
|
1818
1825
|
- app/pb_kits/playbook/pb_selectable_card_icon/docs/_selectable_card_icon_default.html.erb
|
@@ -1849,8 +1856,8 @@ files:
|
|
1849
1856
|
- app/pb_kits/playbook/pb_selectable_list/selectable_list.rb
|
1850
1857
|
- app/pb_kits/playbook/pb_selectable_list/selectable_list_item.html.erb
|
1851
1858
|
- app/pb_kits/playbook/pb_selectable_list/selectable_list_item.rb
|
1852
|
-
- app/pb_kits/playbook/pb_source/_source.jsx
|
1853
1859
|
- app/pb_kits/playbook/pb_source/_source.scss
|
1860
|
+
- app/pb_kits/playbook/pb_source/_source.tsx
|
1854
1861
|
- app/pb_kits/playbook/pb_source/docs/_description.md
|
1855
1862
|
- app/pb_kits/playbook/pb_source/docs/_source_default.html.erb
|
1856
1863
|
- app/pb_kits/playbook/pb_source/docs/_source_default.jsx
|
@@ -1862,6 +1869,7 @@ files:
|
|
1862
1869
|
- app/pb_kits/playbook/pb_source/docs/index.js
|
1863
1870
|
- app/pb_kits/playbook/pb_source/source.html.erb
|
1864
1871
|
- app/pb_kits/playbook/pb_source/source.rb
|
1872
|
+
- app/pb_kits/playbook/pb_source/source.test.js
|
1865
1873
|
- app/pb_kits/playbook/pb_star_rating/_star_rating.jsx
|
1866
1874
|
- app/pb_kits/playbook/pb_star_rating/_star_rating.scss
|
1867
1875
|
- app/pb_kits/playbook/pb_star_rating/docs/_description.md
|
@@ -2453,7 +2461,7 @@ homepage: http://playbook.powerapp.cloud
|
|
2453
2461
|
licenses:
|
2454
2462
|
- ISC
|
2455
2463
|
metadata: {}
|
2456
|
-
post_install_message:
|
2464
|
+
post_install_message:
|
2457
2465
|
rdoc_options: []
|
2458
2466
|
require_paths:
|
2459
2467
|
- lib
|
@@ -2464,12 +2472,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
2464
2472
|
version: '0'
|
2465
2473
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
2466
2474
|
requirements:
|
2467
|
-
- - "
|
2475
|
+
- - ">"
|
2468
2476
|
- !ruby/object:Gem::Version
|
2469
|
-
version:
|
2477
|
+
version: 1.3.1
|
2470
2478
|
requirements: []
|
2471
2479
|
rubygems_version: 3.3.7
|
2472
|
-
signing_key:
|
2480
|
+
signing_key:
|
2473
2481
|
specification_version: 4
|
2474
2482
|
summary: Playbook Design System
|
2475
2483
|
test_files: []
|