playbook_ui 12.20.0.pre.alpha.title2667 → 12.21.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,67 @@
1
+ import React from 'react'
2
+ import { render, screen } from '../utilities/test-utils'
3
+
4
+ import UserBadge from './_user_badge'
5
+
6
+ const testId = 'userBadge'
7
+ const className = 'custom-class-name'
8
+
9
+ const UserBadgeDefault = (props) => (
10
+ <>
11
+ <UserBadge
12
+ aria={{ label: testId }}
13
+ className={className}
14
+ data={{ testid: testId }}
15
+ id={testId}
16
+ {...props}
17
+ />
18
+ </>
19
+ )
20
+
21
+ test('should pass data prop', () => {
22
+ render(<UserBadgeDefault />)
23
+ const kit = screen.getByTestId(testId)
24
+ expect(kit).toBeInTheDocument()
25
+ })
26
+
27
+ test('should pass className prop', () => {
28
+ render(<UserBadgeDefault />)
29
+ const kit = screen.getByTestId(testId)
30
+ expect(kit).toHaveClass(className)
31
+ })
32
+
33
+ test('should pass aria prop', () => {
34
+ render(<UserBadgeDefault />)
35
+ const kit = screen.getByTestId(testId)
36
+ expect(kit).toHaveAttribute('aria-label', testId)
37
+ })
38
+
39
+ test('should pass id prop', () => {
40
+ render(<UserBadgeDefault />)
41
+ const kit = screen.getByTestId(testId)
42
+ expect(kit).toHaveProperty('id', testId)
43
+ })
44
+
45
+ test('should be million-dollar badge by default', () => {
46
+ render(<UserBadgeDefault />)
47
+ const kit = screen.getByTestId(testId)
48
+ expect(kit).toContainHTML('<circle cx="121.5" cy="121.5" r="121.5" />')
49
+ })
50
+
51
+ test('should pass badge prop', () => {
52
+ render(<UserBadgeDefault badge="veteran" />)
53
+ const kit = screen.getByTestId(testId)
54
+ expect(kit).not.toContainHTML('<circle cx="121.5" cy="121.5" r="121.5" />')
55
+ })
56
+
57
+ test('should be md size by default', () => {
58
+ render(<UserBadgeDefault />)
59
+ const kit = screen.getByTestId(testId)
60
+ expect(kit).toHaveClass('pb_user_badge_kit_md')
61
+ })
62
+
63
+ test('should pass size prop', () => {
64
+ render(<UserBadgeDefault size="sm" />)
65
+ const kit = screen.getByTestId(testId)
66
+ expect(kit).toHaveClass('pb_user_badge_kit_sm')
67
+ })
@@ -0,0 +1,193 @@
1
+ import React from 'react'
2
+ import classnames from 'classnames'
3
+ import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
4
+ import { globalProps } from '../utilities/globalProps'
5
+ import Joyride, { TooltipRenderProps } from 'react-joyride'
6
+ import Button from '../pb_button/_button'
7
+ import Flex from '../pb_flex/_flex'
8
+ import SectionSeparator from '../pb_section_separator/_section_separator'
9
+ import Title from '../pb_title/_title'
10
+
11
+ type WalkthroughProps = {
12
+ aria?: { [key: string]: string },
13
+ callback?: () => void,
14
+ className?: string,
15
+ continuous?: boolean,
16
+ data?: { [key: string]: string },
17
+ id?: string,
18
+ run?: boolean,
19
+ steps?: [],
20
+ stepIndex?: number,
21
+ debug?: boolean,
22
+ disableCloseOnEsc?: boolean,
23
+ disableOverlay?: boolean,
24
+ disableOverlayClose?: boolean,
25
+ disableScrolling?: boolean,
26
+ floaterProps?: object,
27
+ hideBackButton?: boolean,
28
+ hideCloseButton?: boolean,
29
+ showProgress?: boolean,
30
+ showSkipButton?: boolean,
31
+ spotlightClicks?: boolean,
32
+ spotlightPadding?: number,
33
+ styles?: {
34
+ options: {
35
+ beaconSize?: number,
36
+ arrowColor?: string,
37
+ backgroundColor?: string,
38
+ primaryColor?: string,
39
+ overlayColor?: string,
40
+ spotlightShadow?: string,
41
+ width?: number,
42
+ zIndex?: number,
43
+ },
44
+ },
45
+ }
46
+
47
+ type TooltipProps = {
48
+ continuous?: boolean,
49
+ className?: string,
50
+ index?: number,
51
+ isLastStep?: boolean,
52
+ size?: number,
53
+ step: {
54
+ title?: string,
55
+ content?: React.ReactNode[] | React.ReactNode | string,
56
+ target: string,
57
+ disableBeacon?: boolean,
58
+ },
59
+ skip?: boolean,
60
+ backProps?: object,
61
+ closeProps?: object,
62
+ primaryProps?: object,
63
+ skipProps?: object,
64
+ tooltipProps?: object,
65
+ }
66
+
67
+ const Tooltip = React.forwardRef((props: TooltipProps) => (
68
+ <div
69
+ className="pb_card_kit_border_none p_none"
70
+ {...props.tooltipProps}
71
+ >
72
+ {props.step.title && <div>
73
+ <Flex
74
+ align="center"
75
+ justify="between"
76
+ padding="xs"
77
+ >
78
+ <Title
79
+ paddingLeft="xs"
80
+ size={4}
81
+ >
82
+ {props.step.title}
83
+ </Title>
84
+ {props.skip && (<Button
85
+ {...props.skipProps}
86
+ id="skip"
87
+ text="Skip Tour"
88
+ variant="link"
89
+ />)}
90
+ <Button
91
+ {...props.skipProps}
92
+ id="skip"
93
+ text="Skip Tour"
94
+ variant="link"
95
+ />
96
+ </Flex>
97
+ <SectionSeparator />
98
+ </div>}
99
+
100
+ <Flex padding="sm">{props.step.content}</Flex>
101
+ <SectionSeparator />
102
+ <Flex
103
+ justify={props.index == 0 ? 'end' : 'between'}
104
+ padding="xs"
105
+ >
106
+
107
+ {props.index > 0 && (
108
+ <Button
109
+ {...props.backProps}
110
+ id="back"
111
+ text="Back"
112
+ />
113
+ )}
114
+
115
+ {props.continuous && !props.isLastStep &&
116
+ <Button
117
+ {...props.primaryProps}
118
+ id="next"
119
+ text="Next"
120
+ />
121
+ }
122
+
123
+ {!props.continuous &&
124
+ <Button
125
+ {...props.closeProps}
126
+ id="close"
127
+ text="Close"
128
+ />
129
+ }
130
+
131
+ {!((props.continuous && !props.isLastStep) || (!props.continuous)) &&
132
+ <Button
133
+ {...props.closeProps}
134
+ id="close"
135
+ text="Close"
136
+ />
137
+ }
138
+ </Flex>
139
+ </div>
140
+ )) as unknown as React.ForwardRefRenderFunction<HTMLDivElement, TooltipRenderProps>
141
+
142
+ const Walkthrough = (props: WalkthroughProps) => {
143
+ const {
144
+ aria = {},
145
+ callback,
146
+ className,
147
+ continuous = false,
148
+ data = {},
149
+ disableOverlay,
150
+ floaterProps = {
151
+ offset: 50,
152
+ },
153
+ id,
154
+ run = false,
155
+ steps,
156
+ styles = {
157
+ options: {
158
+ zIndex: 20000,
159
+ },
160
+ },
161
+ showSkipButton,
162
+ } = props
163
+
164
+ const ariaProps = buildAriaProps(aria)
165
+ const dataProps = buildDataProps(data)
166
+ const classes = classnames(buildCss('pb_walkthrough'), globalProps(props), className)
167
+
168
+ return (
169
+ <div
170
+ {...ariaProps}
171
+ {...dataProps}
172
+ className={classes}
173
+ id={id}
174
+ >
175
+ <Joyride
176
+ callback={callback}
177
+ continuous={continuous}
178
+ disableOverlay={disableOverlay}
179
+ disableScrolling
180
+ floaterProps={floaterProps}
181
+ run={run}
182
+ showSkipButton={showSkipButton}
183
+ steps={steps}
184
+ styles={styles}
185
+ tooltipComponent={Tooltip}
186
+ {...props}
187
+ />
188
+ </div>
189
+
190
+ )
191
+ }
192
+
193
+ export default Walkthrough
data/dist/menu.yml CHANGED
@@ -31,6 +31,7 @@ kits:
31
31
  - form
32
32
  - form_group
33
33
  - form_pill
34
+ - multi_level_select
34
35
  - passphrase
35
36
  - phone_number_input
36
37
  - radio
@@ -57,7 +58,6 @@ kits:
57
58
  - list
58
59
  - loading_inline
59
60
  - map
60
- - multi_level_select
61
61
  - nav
62
62
  - tags:
63
63
  - badge
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Playbook
4
4
  PREVIOUS_VERSION = "12.20.0"
5
- VERSION = "12.20.0.pre.alpha.title2667"
5
+ VERSION = "12.21.0"
6
6
  end
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.20.0.pre.alpha.title2667
4
+ version: 12.21.0
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-05-15 00:00:00.000000000 Z
12
+ date: 2023-05-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -2318,12 +2318,12 @@ files:
2318
2318
  - app/pb_kits/playbook/pb_user/user.html.erb
2319
2319
  - app/pb_kits/playbook/pb_user/user.rb
2320
2320
  - app/pb_kits/playbook/pb_user/user.test.js
2321
- - app/pb_kits/playbook/pb_user_badge/_user_badge.jsx
2322
2321
  - app/pb_kits/playbook/pb_user_badge/_user_badge.scss
2323
- - app/pb_kits/playbook/pb_user_badge/badges/million-dollar.jsx
2322
+ - app/pb_kits/playbook/pb_user_badge/_user_badge.tsx
2324
2323
  - app/pb_kits/playbook/pb_user_badge/badges/million-dollar.svg
2325
- - app/pb_kits/playbook/pb_user_badge/badges/veteran.jsx
2324
+ - app/pb_kits/playbook/pb_user_badge/badges/million-dollar.tsx
2326
2325
  - app/pb_kits/playbook/pb_user_badge/badges/veteran.svg
2326
+ - app/pb_kits/playbook/pb_user_badge/badges/veteran.tsx
2327
2327
  - app/pb_kits/playbook/pb_user_badge/docs/_description.md
2328
2328
  - app/pb_kits/playbook/pb_user_badge/docs/_footer.md
2329
2329
  - app/pb_kits/playbook/pb_user_badge/docs/_user_badge_default.html.erb
@@ -2335,8 +2335,9 @@ files:
2335
2335
  - app/pb_kits/playbook/pb_user_badge/docs/index.js
2336
2336
  - app/pb_kits/playbook/pb_user_badge/user_badge.html.erb
2337
2337
  - app/pb_kits/playbook/pb_user_badge/user_badge.rb
2338
- - app/pb_kits/playbook/pb_walkthrough/_walkthrough.jsx
2338
+ - app/pb_kits/playbook/pb_user_badge/user_badge.test.js
2339
2339
  - app/pb_kits/playbook/pb_walkthrough/_walkthrough.scss
2340
+ - app/pb_kits/playbook/pb_walkthrough/_walkthrough.tsx
2340
2341
  - app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_continuous.jsx
2341
2342
  - app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_default.jsx
2342
2343
  - app/pb_kits/playbook/pb_walkthrough/docs/_walkthrough_multi_beacon.jsx
@@ -2486,7 +2487,7 @@ homepage: http://playbook.powerapp.cloud
2486
2487
  licenses:
2487
2488
  - ISC
2488
2489
  metadata: {}
2489
- post_install_message:
2490
+ post_install_message:
2490
2491
  rdoc_options: []
2491
2492
  require_paths:
2492
2493
  - lib
@@ -2497,12 +2498,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
2497
2498
  version: '0'
2498
2499
  required_rubygems_version: !ruby/object:Gem::Requirement
2499
2500
  requirements:
2500
- - - ">"
2501
+ - - ">="
2501
2502
  - !ruby/object:Gem::Version
2502
- version: 1.3.1
2503
+ version: '0'
2503
2504
  requirements: []
2504
2505
  rubygems_version: 3.3.7
2505
- signing_key:
2506
+ signing_key:
2506
2507
  specification_version: 4
2507
2508
  summary: Playbook Design System
2508
2509
  test_files: []
@@ -1,363 +0,0 @@
1
- import * as React from "react"
2
-
3
- const MillionDollar = (props) => (
4
- <svg
5
- style={{
6
- enableBackground: "new 0 0 242.9 242.9",
7
- }}
8
- viewBox="0 0 242.9 242.9"
9
- xmlSpace="preserve"
10
- xmlns="http://www.w3.org/2000/svg"
11
- {...props}
12
- >
13
- <circle cx={121.5}
14
- cy={121.5}
15
- r={121.5}
16
- />
17
- <linearGradient
18
- gradientUnits="userSpaceOnUse"
19
- id="a"
20
- x1={42.483}
21
- x2={200.309}
22
- y1={35.645}
23
- y2={35.645}
24
- >
25
- <stop
26
- offset={0}
27
- style={{
28
- stopColor: "#e6b711",
29
- }}
30
- />
31
- <stop
32
- offset={0.128}
33
- style={{
34
- stopColor: "#eac23c",
35
- }}
36
- />
37
- <stop
38
- offset={0.278}
39
- style={{
40
- stopColor: "#ec6",
41
- }}
42
- />
43
- <stop
44
- offset={0.413}
45
- style={{
46
- stopColor: "#f1d485",
47
- }}
48
- />
49
- <stop
50
- offset={0.527}
51
- style={{
52
- stopColor: "#f2d998",
53
- }}
54
- />
55
- <stop
56
- offset={0.607}
57
- style={{
58
- stopColor: "#f3db9f",
59
- }}
60
- />
61
- <stop
62
- offset={1}
63
- style={{
64
- stopColor: "#e6b711",
65
- }}
66
- />
67
- </linearGradient>
68
- <path
69
- d="M56.4 53.8c16.9-16.2 39.8-26.2 65-26.2 25.2 0 48.1 10 64.9 26.2h14c-19.1-22.2-47.4-36.3-78.9-36.3-31.5 0-59.8 14.1-78.9 36.3h13.9z"
70
- style={{
71
- fill: "url(#a)",
72
- }}
73
- />
74
- <linearGradient
75
- gradientUnits="userSpaceOnUse"
76
- id="b"
77
- x1={17.407}
78
- x2={44.897}
79
- y1={132.179}
80
- y2={132.179}
81
- >
82
- <stop
83
- offset={0}
84
- style={{
85
- stopColor: "#e6b711",
86
- }}
87
- />
88
- <stop
89
- offset={0.128}
90
- style={{
91
- stopColor: "#eac23c",
92
- }}
93
- />
94
- <stop
95
- offset={0.278}
96
- style={{
97
- stopColor: "#ec6",
98
- }}
99
- />
100
- <stop
101
- offset={0.413}
102
- style={{
103
- stopColor: "#f1d485",
104
- }}
105
- />
106
- <stop
107
- offset={0.527}
108
- style={{
109
- stopColor: "#f2d998",
110
- }}
111
- />
112
- <stop
113
- offset={0.607}
114
- style={{
115
- stopColor: "#f3db9f",
116
- }}
117
- />
118
- <stop
119
- offset={1}
120
- style={{
121
- stopColor: "#e6b711",
122
- }}
123
- />
124
- </linearGradient>
125
- <path
126
- d="M44.9 175.7c-10.9-15.3-17.3-34-17.3-54.2 0-14.1 3.1-27.5 8.8-39.5H25.3c-5 12.2-7.8 25.5-7.8 39.5 0 22.7 7.3 43.8 19.8 60.9l7.6-6.7z"
127
- style={{
128
- fill: "url(#b)",
129
- }}
130
- />
131
- <linearGradient
132
- gradientUnits="userSpaceOnUse"
133
- id="c"
134
- x1={52.914}
135
- x2={189.715}
136
- y1={212.573}
137
- y2={212.573}
138
- >
139
- <stop
140
- offset={0}
141
- style={{
142
- stopColor: "#e6b711",
143
- }}
144
- />
145
- <stop
146
- offset={0.128}
147
- style={{
148
- stopColor: "#eac23c",
149
- }}
150
- />
151
- <stop
152
- offset={0.278}
153
- style={{
154
- stopColor: "#ec6",
155
- }}
156
- />
157
- <stop
158
- offset={0.413}
159
- style={{
160
- stopColor: "#f1d485",
161
- }}
162
- />
163
- <stop
164
- offset={0.527}
165
- style={{
166
- stopColor: "#f2d998",
167
- }}
168
- />
169
- <stop
170
- offset={0.607}
171
- style={{
172
- stopColor: "#f3db9f",
173
- }}
174
- />
175
- <stop
176
- offset={1}
177
- style={{
178
- stopColor: "#e6b711",
179
- }}
180
- />
181
- </linearGradient>
182
- <path
183
- d="M173 199.8c-14.8 9.8-32.5 15.5-51.6 15.5s-37-5.8-51.8-15.6H52.9c18.3 16.1 42.3 25.8 68.5 25.8 26.1 0 50-9.7 68.3-25.7H173z"
184
- style={{
185
- fill: "url(#c)",
186
- }}
187
- />
188
- <linearGradient
189
- gradientUnits="userSpaceOnUse"
190
- id="d"
191
- x1={31.123}
192
- x2={207.766}
193
- y1={136.159}
194
- y2={136.159}
195
- >
196
- <stop
197
- offset={0}
198
- style={{
199
- stopColor: "#e6b711",
200
- }}
201
- />
202
- <stop
203
- offset={0.128}
204
- style={{
205
- stopColor: "#eac23c",
206
- }}
207
- />
208
- <stop
209
- offset={0.278}
210
- style={{
211
- stopColor: "#ec6",
212
- }}
213
- />
214
- <stop
215
- offset={0.413}
216
- style={{
217
- stopColor: "#f1d485",
218
- }}
219
- />
220
- <stop
221
- offset={0.527}
222
- style={{
223
- stopColor: "#f2d998",
224
- }}
225
- />
226
- <stop
227
- offset={0.607}
228
- style={{
229
- stopColor: "#f3db9f",
230
- }}
231
- />
232
- <stop
233
- offset={1}
234
- style={{
235
- stopColor: "#e6b711",
236
- }}
237
- />
238
- </linearGradient>
239
- <path
240
- d="M139.2 193v-1.8c5-.4 10.2-.5 13.4-5 3.8-5.2 3.2-15.4 3.2-21.5V78.5l-47.3 120.4L61.2 81.2v61.1c0 13.6.5 35.1 12.5 44.2 4.3 3.2 9 3.9 14.2 4.7v1.8H31.1v-1.8c1.6-.4 3.2-.7 4.8-1.1 22.6-5.7 22.9-32.4 22.9-51.1v-37.8c0-6.1.5-13.3-3.2-18.5-4.5-6.1-13.4-7.2-20.4-7.5v-1.8H96l29.6 75.4 29.9-75.4h52.3v1.8c-4.8.4-10.2.9-13.4 5-3.8 4.8-3.2 15.9-3.2 21.9v62.5c0 6.3-.7 16.1 3.2 21.5 3.2 4.3 6.2 4.7 11.2 5v1.8h-66.4z"
241
- style={{
242
- fill: "url(#d)",
243
- }}
244
- />
245
- <linearGradient
246
- gradientUnits="userSpaceOnUse"
247
- id="e"
248
- x1={30.453}
249
- x2={213.794}
250
- y1={63.629}
251
- y2={63.629}
252
- >
253
- <stop
254
- offset={0}
255
- style={{
256
- stopColor: "#e6b711",
257
- }}
258
- />
259
- <stop
260
- offset={0.128}
261
- style={{
262
- stopColor: "#eac23c",
263
- }}
264
- />
265
- <stop
266
- offset={0.278}
267
- style={{
268
- stopColor: "#ec6",
269
- }}
270
- />
271
- <stop
272
- offset={0.413}
273
- style={{
274
- stopColor: "#f1d485",
275
- }}
276
- />
277
- <stop
278
- offset={0.527}
279
- style={{
280
- stopColor: "#f2d998",
281
- }}
282
- />
283
- <stop
284
- offset={0.607}
285
- style={{
286
- stopColor: "#f3db9f",
287
- }}
288
- />
289
- <stop
290
- offset={1}
291
- style={{
292
- stopColor: "#e6b711",
293
- }}
294
- />
295
- </linearGradient>
296
- <path
297
- d="M30.5 60.6h183.3v6.1H30.5z"
298
- style={{
299
- fill: "url(#e)",
300
- }}
301
- />
302
- <linearGradient
303
- gradientUnits="userSpaceOnUse"
304
- id="f"
305
- x1={196.676}
306
- x2={225.538}
307
- y1={132.923}
308
- y2={132.923}
309
- >
310
- <stop
311
- offset={0}
312
- style={{
313
- stopColor: "#e6b711",
314
- }}
315
- />
316
- <stop
317
- offset={0.128}
318
- style={{
319
- stopColor: "#eac23c",
320
- }}
321
- />
322
- <stop
323
- offset={0.278}
324
- style={{
325
- stopColor: "#ec6",
326
- }}
327
- />
328
- <stop
329
- offset={0.413}
330
- style={{
331
- stopColor: "#f1d485",
332
- }}
333
- />
334
- <stop
335
- offset={0.527}
336
- style={{
337
- stopColor: "#f2d998",
338
- }}
339
- />
340
- <stop
341
- offset={0.607}
342
- style={{
343
- stopColor: "#f3db9f",
344
- }}
345
- />
346
- <stop
347
- offset={1}
348
- style={{
349
- stopColor: "#e6b711",
350
- }}
351
- />
352
- </linearGradient>
353
- <path
354
- d="M196.7 177.5c11.5-15.6 18.7-35.2 18.7-56 0-14.1-3.1-27.5-8.8-39.5h11.1c5 12.2 7.8 25.5 7.8 39.5 0 23.4-7.8 45-20.9 62.4l-7.9-6.4z"
355
- style={{
356
- fill: "url(#f)",
357
- }}
358
- />
359
- </svg>
360
- )
361
-
362
- export default MillionDollar
363
-