playbook_ui 18.2.0.pre.rc.2 → 18.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_background/_background.tsx +3 -1
- data/app/pb_kits/playbook/pb_background/kit.schema.json +1 -0
- data/app/pb_kits/playbook/pb_caption/_caption.tsx +3 -1
- data/app/pb_kits/playbook/pb_caption/kit.schema.json +1 -0
- data/app/pb_kits/playbook/pb_container/_container.tsx +3 -1
- data/app/pb_kits/playbook/pb_container/kit.schema.json +1 -0
- data/app/pb_kits/playbook/pb_currency/_currency.tsx +3 -1
- data/app/pb_kits/playbook/pb_currency/kit.schema.json +1 -0
- data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.tsx +3 -1
- data/app/pb_kits/playbook/pb_dashboard_value/kit.schema.json +1 -0
- data/app/pb_kits/playbook/pb_detail/_detail.tsx +3 -1
- data/app/pb_kits/playbook/pb_detail/kit.schema.json +1 -0
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +6 -5
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_custom.md +7 -2
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_custom_rails.md +7 -2
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_enable_time.html.erb +33 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_enable_time.jsx +42 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_enable_time.md +24 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_highlight.jsx +101 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_highlight.md +3 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +3 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_dropdown/index.js +19 -10
- data/app/pb_kits/playbook/pb_dropdown/quickpick/index.ts +60 -18
- data/app/pb_kits/playbook/pb_dropdown/quickpick_helper.rb +92 -3
- data/app/pb_kits/playbook/pb_dropdown/utilities/index.ts +8 -1
- data/app/pb_kits/playbook/pb_dropdown/utilities/quickpickDateSync.ts +137 -0
- data/app/pb_kits/playbook/pb_filter/Filter/InteractiveFilter.tsx +1 -1
- data/app/pb_kits/playbook/pb_highlight/_highlight.tsx +3 -1
- data/app/pb_kits/playbook/pb_highlight/kit.schema.json +1 -0
- data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.tsx +3 -1
- data/app/pb_kits/playbook/pb_icon_stat_value/kit.schema.json +1 -0
- data/app/pb_kits/playbook/pb_icon_value/_icon_value.tsx +3 -1
- data/app/pb_kits/playbook/pb_icon_value/kit.schema.json +1 -0
- data/app/pb_kits/playbook/pb_label_value/_label_value.tsx +3 -1
- data/app/pb_kits/playbook/pb_label_value/kit.schema.json +1 -0
- data/app/pb_kits/playbook/pb_map/docs/_map_default.md +3 -3
- data/app/pb_kits/playbook/pb_message/_message.tsx +3 -1
- data/app/pb_kits/playbook/pb_message/kit.schema.json +1 -0
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +3 -1
- data/app/pb_kits/playbook/pb_multiple_users/kit.schema.json +1 -0
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +4 -2
- data/app/pb_kits/playbook/pb_multiple_users_stacked/kit.schema.json +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/MoreExtensionsDropdown.tsx +10 -3
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/Toolbar.tsx +16 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_playground.json +2 -3
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_playground.overrides.json +2 -3
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_attributes.jsx +1 -5
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_default.jsx +1 -5
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_default.md +2 -3
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_focus.jsx +1 -5
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_height.jsx +3 -13
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_inline.jsx +1 -5
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_label.jsx +2 -3
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_markdown_support.jsx +1 -2
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_min_height.jsx +3 -13
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_preview.jsx +1 -5
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_required_indicator.jsx +1 -5
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_simple.jsx +1 -5
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_sticky.jsx +1 -5
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_templates.jsx +1 -5
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_more_extensions.jsx +3 -8
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_more_extensions.md +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_rails_default.md +2 -2
- data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.test.js +2 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor_advanced.test.js +7 -5
- data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor_rails.js +15 -4
- data/app/pb_kits/playbook/pb_stat_value/_stat_value.tsx +3 -1
- data/app/pb_kits/playbook/pb_stat_value/kit.schema.json +1 -0
- data/app/pb_kits/playbook/pb_table/_table.tsx +70 -197
- data/app/pb_kits/playbook/pb_table/index.ts +53 -122
- data/app/pb_kits/playbook/pb_table/styles/_sticky_columns.scss +26 -3
- data/app/pb_kits/playbook/pb_table/utilities/stickyColumns.test.ts +266 -0
- data/app/pb_kits/playbook/pb_table/utilities/stickyColumns.ts +145 -0
- data/app/pb_kits/playbook/pb_title_count/_title_count.tsx +3 -1
- data/app/pb_kits/playbook/pb_title_count/kit.schema.json +1 -0
- data/app/pb_kits/playbook/pb_title_detail/_title_detail.tsx +3 -1
- data/app/pb_kits/playbook/pb_title_detail/kit.schema.json +1 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/onClick.test.js +237 -0
- data/dist/ai/all-schemas.json +16 -0
- data/dist/ai/forms.json +1 -1
- data/dist/ai/index.json +2 -2
- data/dist/ai/kits/background.schema.json +1 -0
- data/dist/ai/kits/caption.schema.json +1 -0
- data/dist/ai/kits/container.schema.json +1 -0
- data/dist/ai/kits/currency.schema.json +1 -0
- data/dist/ai/kits/dashboard_value.schema.json +1 -0
- data/dist/ai/kits/detail.schema.json +1 -0
- data/dist/ai/kits/highlight.schema.json +1 -0
- data/dist/ai/kits/icon_stat_value.schema.json +1 -0
- data/dist/ai/kits/icon_value.schema.json +1 -0
- data/dist/ai/kits/label_value.schema.json +1 -0
- data/dist/ai/kits/message.schema.json +1 -0
- data/dist/ai/kits/multiple_users.schema.json +1 -0
- data/dist/ai/kits/multiple_users_stacked.schema.json +1 -0
- data/dist/ai/kits/stat_value.schema.json +1 -0
- data/dist/ai/kits/title_count.schema.json +1 -0
- data/dist/ai/kits/title_detail.schema.json +1 -0
- data/dist/ai/playgrounds/rich_text_editor.json +1 -1
- data/dist/chunks/{_detail-BqqzPTNr.js → _detail-Bsvl694i.js} +2 -2
- data/dist/chunks/{_pb_line_graph-BGyCJjgG.js → _pb_line_graph-Du7xE9vl.js} +1 -1
- data/dist/chunks/_table-Bf6LGyL9.js +1 -0
- data/dist/chunks/_typeahead-w6S5Vx4b.js +1 -0
- data/dist/chunks/{globalProps-K1DCn3il.js → globalProps-B120NbSJ.js} +1 -1
- data/dist/chunks/{lib-7vm9BMqp.js → lib-Buo6zHEw.js} +1 -1
- data/dist/chunks/quickpickDateSync-DLDx4zce.js +1 -0
- data/dist/chunks/{time_picker_helper-BZutIzB3.js → time_picker_helper-CYGg0UQ0.js} +1 -1
- data/dist/chunks/vendor.js +2 -2
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +19 -13
- data/dist/chunks/_table-CEZU0qUK.js +0 -1
- data/dist/chunks/_typeahead-C7iPR5ZF.js +0 -1
|
@@ -1,21 +1,53 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { fireEvent, render, screen } from '../../test-utils'
|
|
3
|
+
import Background from '../../../pb_background/_background'
|
|
3
4
|
import Body from '../../../pb_body/_body'
|
|
4
5
|
import Button from '../../../pb_button/_button'
|
|
5
6
|
import ButtonToolbar from '../../../pb_button_toolbar/_button_toolbar'
|
|
7
|
+
import Caption from '../../../pb_caption/_caption'
|
|
6
8
|
import Card from '../../../pb_card/_card'
|
|
9
|
+
import Container from '../../../pb_container/_container'
|
|
10
|
+
import Currency from '../../../pb_currency/_currency'
|
|
11
|
+
import DashboardValue from '../../../pb_dashboard_value/_dashboard_value'
|
|
12
|
+
import Detail from '../../../pb_detail/_detail'
|
|
7
13
|
import Flex from '../../../pb_flex/_flex'
|
|
8
14
|
import FormPill from '../../../pb_form_pill/_form_pill'
|
|
15
|
+
import Highlight from '../../../pb_highlight/_highlight'
|
|
16
|
+
import IconStatValue from '../../../pb_icon_stat_value/_icon_stat_value'
|
|
17
|
+
import IconValue from '../../../pb_icon_value/_icon_value'
|
|
18
|
+
import LabelValue from '../../../pb_label_value/_label_value'
|
|
19
|
+
import Message from '../../../pb_message/_message'
|
|
20
|
+
import MultipleUsers from '../../../pb_multiple_users/_multiple_users'
|
|
21
|
+
import MultipleUsersStacked from '../../../pb_multiple_users_stacked/_multiple_users_stacked'
|
|
9
22
|
import StarRating from '../../../pb_star_rating/_star_rating'
|
|
23
|
+
import StatValue from '../../../pb_stat_value/_stat_value'
|
|
10
24
|
import Title from '../../../pb_title/_title'
|
|
25
|
+
import TitleCount from '../../../pb_title_count/_title_count'
|
|
26
|
+
import TitleDetail from '../../../pb_title_detail/_title_detail'
|
|
11
27
|
import { globalProps } from '../../globalProps'
|
|
12
28
|
import { globalEventProps } from '../../globalEventProps'
|
|
13
29
|
|
|
14
30
|
const optedInKits = [
|
|
31
|
+
{ Kit: Background, name: 'Background', extraProps: { children: 'Test' } },
|
|
15
32
|
{ Kit: Body, name: 'Body', extraProps: { text: 'Test' } },
|
|
33
|
+
{ Kit: Caption, name: 'Caption', extraProps: { text: 'Test' } },
|
|
16
34
|
{ Kit: Card, name: 'Card', extraProps: { children: 'Test' } },
|
|
35
|
+
{ Kit: Container, name: 'Container', extraProps: { children: 'Test' } },
|
|
36
|
+
{ Kit: Currency, name: 'Currency', extraProps: { amount: '100.00', label: 'Total' } },
|
|
37
|
+
{ Kit: DashboardValue, name: 'DashboardValue', extraProps: { statLabel: 'Sales', statValue: { value: 100 } } },
|
|
38
|
+
{ Kit: Detail, name: 'Detail', extraProps: { text: 'Test' } },
|
|
17
39
|
{ Kit: Flex, name: 'Flex', extraProps: { children: 'Test' } },
|
|
40
|
+
{ Kit: Highlight, name: 'Highlight', extraProps: { text: 'Test' } },
|
|
41
|
+
{ Kit: IconStatValue, name: 'IconStatValue', extraProps: { icon: 'heart', text: 'Likes', value: 42 } },
|
|
42
|
+
{ Kit: IconValue, name: 'IconValue', extraProps: { icon: 'heart', text: 'Favorites' } },
|
|
43
|
+
{ Kit: LabelValue, name: 'LabelValue', extraProps: { label: 'Label', value: 'Value' } },
|
|
44
|
+
{ Kit: Message, name: 'Message', extraProps: { label: 'Sender', message: 'Test' } },
|
|
45
|
+
{ Kit: MultipleUsers, name: 'MultipleUsers', extraProps: { users: [{ name: 'Pat' }] } },
|
|
46
|
+
{ Kit: MultipleUsersStacked, name: 'MultipleUsersStacked', extraProps: { users: [{ name: 'Pat' }] } },
|
|
47
|
+
{ Kit: StatValue, name: 'StatValue', extraProps: { unit: 'mg', value: 100 } },
|
|
18
48
|
{ Kit: Title, name: 'Title', extraProps: { text: 'Test' } },
|
|
49
|
+
{ Kit: TitleCount, name: 'TitleCount', extraProps: { count: 12, title: 'Items' } },
|
|
50
|
+
{ Kit: TitleDetail, name: 'TitleDetail', extraProps: { detail: 'Detail', title: 'Title' } },
|
|
19
51
|
]
|
|
20
52
|
|
|
21
53
|
describe('onClick GlobalEventProps', () => {
|
|
@@ -43,6 +75,7 @@ describe('onClick GlobalEventProps', () => {
|
|
|
43
75
|
render(
|
|
44
76
|
<Kit
|
|
45
77
|
data={{ testid: testId }}
|
|
78
|
+
htmlOptions={{ 'data-testid': testId }}
|
|
46
79
|
onClick={onClick}
|
|
47
80
|
{...extraProps}
|
|
48
81
|
/>
|
|
@@ -209,4 +242,208 @@ describe('onClick GlobalEventProps', () => {
|
|
|
209
242
|
expect(cardOnClick).toHaveBeenCalledTimes(1)
|
|
210
243
|
})
|
|
211
244
|
})
|
|
245
|
+
|
|
246
|
+
describe('value and summary kits fire once from nested regions', () => {
|
|
247
|
+
test('Currency label and value regions each invoke onClick once', () => {
|
|
248
|
+
const onClick = jest.fn()
|
|
249
|
+
const { container } = render(
|
|
250
|
+
<Currency
|
|
251
|
+
amount="42.00"
|
|
252
|
+
data={{ testid: 'onclick-currency-regions' }}
|
|
253
|
+
label="Balance"
|
|
254
|
+
onClick={onClick}
|
|
255
|
+
/>
|
|
256
|
+
)
|
|
257
|
+
|
|
258
|
+
fireEvent.click(screen.getByText('Balance'))
|
|
259
|
+
fireEvent.click(container.querySelector('.pb_currency_value'))
|
|
260
|
+
expect(onClick).toHaveBeenCalledTimes(2)
|
|
261
|
+
})
|
|
262
|
+
|
|
263
|
+
test('Currency unstyled branch still attaches root onClick', () => {
|
|
264
|
+
const onClick = jest.fn()
|
|
265
|
+
render(
|
|
266
|
+
<Currency
|
|
267
|
+
amount="10.00"
|
|
268
|
+
data={{ testid: 'onclick-currency-unstyled' }}
|
|
269
|
+
label="Cash"
|
|
270
|
+
onClick={onClick}
|
|
271
|
+
unstyled
|
|
272
|
+
/>
|
|
273
|
+
)
|
|
274
|
+
|
|
275
|
+
fireEvent.click(screen.getByTestId('onclick-currency-unstyled'))
|
|
276
|
+
expect(onClick).toHaveBeenCalledTimes(1)
|
|
277
|
+
})
|
|
278
|
+
|
|
279
|
+
test('LabelValue default and details variants fire once', () => {
|
|
280
|
+
const defaultOnClick = jest.fn()
|
|
281
|
+
const detailsOnClick = jest.fn()
|
|
282
|
+
render(
|
|
283
|
+
<>
|
|
284
|
+
<LabelValue
|
|
285
|
+
data={{ testid: 'onclick-label-value-default' }}
|
|
286
|
+
label="Status"
|
|
287
|
+
onClick={defaultOnClick}
|
|
288
|
+
value="Open"
|
|
289
|
+
/>
|
|
290
|
+
<LabelValue
|
|
291
|
+
data={{ testid: 'onclick-label-value-details' }}
|
|
292
|
+
description="Meta"
|
|
293
|
+
icon="calendar"
|
|
294
|
+
label="Event"
|
|
295
|
+
onClick={detailsOnClick}
|
|
296
|
+
title="Kickoff"
|
|
297
|
+
variant="details"
|
|
298
|
+
/>
|
|
299
|
+
</>
|
|
300
|
+
)
|
|
301
|
+
|
|
302
|
+
fireEvent.click(screen.getByText('Status'))
|
|
303
|
+
fireEvent.click(screen.getByText('Open'))
|
|
304
|
+
expect(defaultOnClick).toHaveBeenCalledTimes(2)
|
|
305
|
+
|
|
306
|
+
fireEvent.click(screen.getByText('Event'))
|
|
307
|
+
fireEvent.click(screen.getByText('Kickoff'))
|
|
308
|
+
expect(detailsOnClick).toHaveBeenCalledTimes(2)
|
|
309
|
+
})
|
|
310
|
+
|
|
311
|
+
test('IconStatValue icon and value regions fire once each', () => {
|
|
312
|
+
const onClick = jest.fn()
|
|
313
|
+
const { container } = render(
|
|
314
|
+
<IconStatValue
|
|
315
|
+
data={{ testid: 'onclick-icon-stat-value' }}
|
|
316
|
+
icon="heart"
|
|
317
|
+
onClick={onClick}
|
|
318
|
+
text="Likes"
|
|
319
|
+
value={7}
|
|
320
|
+
/>
|
|
321
|
+
)
|
|
322
|
+
|
|
323
|
+
fireEvent.click(container.querySelector('[class*="pb_icon_circle_kit"]'))
|
|
324
|
+
fireEvent.click(screen.getByText('7'))
|
|
325
|
+
fireEvent.click(screen.getByText('Likes'))
|
|
326
|
+
expect(onClick).toHaveBeenCalledTimes(3)
|
|
327
|
+
})
|
|
328
|
+
|
|
329
|
+
test('DashboardValue nested StatValue does not duplicate the handler', () => {
|
|
330
|
+
const onClick = jest.fn()
|
|
331
|
+
render(
|
|
332
|
+
<DashboardValue
|
|
333
|
+
data={{ testid: 'onclick-dashboard-value' }}
|
|
334
|
+
onClick={onClick}
|
|
335
|
+
statLabel="Revenue"
|
|
336
|
+
statValue={{ unit: 'USD', value: 99 }}
|
|
337
|
+
/>
|
|
338
|
+
)
|
|
339
|
+
|
|
340
|
+
fireEvent.click(screen.getByText('Revenue'))
|
|
341
|
+
fireEvent.click(screen.getByText('99'))
|
|
342
|
+
expect(onClick).toHaveBeenCalledTimes(2)
|
|
343
|
+
})
|
|
344
|
+
})
|
|
345
|
+
|
|
346
|
+
describe('whole-kit handlers preserve nested content behavior', () => {
|
|
347
|
+
test('Message nested content fires once with the Message root as currentTarget', () => {
|
|
348
|
+
const currentTargets = []
|
|
349
|
+
const onClick = jest.fn((event) => currentTargets.push(event.currentTarget))
|
|
350
|
+
render(
|
|
351
|
+
<Message
|
|
352
|
+
data={{ testid: 'onclick-message' }}
|
|
353
|
+
label="Sender"
|
|
354
|
+
message="Click this message"
|
|
355
|
+
onClick={onClick}
|
|
356
|
+
/>
|
|
357
|
+
)
|
|
358
|
+
|
|
359
|
+
fireEvent.click(screen.getByText('Click this message'))
|
|
360
|
+
|
|
361
|
+
expect(onClick).toHaveBeenCalledTimes(1)
|
|
362
|
+
expect(currentTargets[0]).toBe(screen.getByTestId('onclick-message'))
|
|
363
|
+
})
|
|
364
|
+
|
|
365
|
+
test('Message child handlers still fire and bubble once to the Message root', () => {
|
|
366
|
+
const messageOnClick = jest.fn()
|
|
367
|
+
const buttonOnClick = jest.fn()
|
|
368
|
+
render(
|
|
369
|
+
<Message
|
|
370
|
+
label="Sender"
|
|
371
|
+
message="Message"
|
|
372
|
+
onClick={messageOnClick}
|
|
373
|
+
>
|
|
374
|
+
<Button
|
|
375
|
+
onClick={buttonOnClick}
|
|
376
|
+
text="Reply"
|
|
377
|
+
/>
|
|
378
|
+
</Message>
|
|
379
|
+
)
|
|
380
|
+
|
|
381
|
+
fireEvent.click(screen.getByRole('button', { name: 'Reply' }))
|
|
382
|
+
|
|
383
|
+
expect(buttonOnClick).toHaveBeenCalledTimes(1)
|
|
384
|
+
expect(messageOnClick).toHaveBeenCalledTimes(1)
|
|
385
|
+
})
|
|
386
|
+
|
|
387
|
+
test('MultipleUsers tooltip avatar fires once with the kit root as currentTarget', () => {
|
|
388
|
+
const currentTargets = []
|
|
389
|
+
const onClick = jest.fn((event) => currentTargets.push(event.currentTarget))
|
|
390
|
+
render(
|
|
391
|
+
<MultipleUsers
|
|
392
|
+
data={{ testid: 'onclick-multiple-users' }}
|
|
393
|
+
onClick={onClick}
|
|
394
|
+
users={[{ imageUrl: 'pat.jpg', name: 'Pat', tooltip: 'Pat tooltip' }]}
|
|
395
|
+
withTooltip
|
|
396
|
+
/>
|
|
397
|
+
)
|
|
398
|
+
|
|
399
|
+
fireEvent.click(screen.getByAltText('Pat'))
|
|
400
|
+
|
|
401
|
+
expect(onClick).toHaveBeenCalledTimes(1)
|
|
402
|
+
expect(currentTargets[0]).toBe(screen.getByTestId('onclick-multiple-users'))
|
|
403
|
+
})
|
|
404
|
+
|
|
405
|
+
test('MultipleUsers overflow count fires the whole-kit handler once', () => {
|
|
406
|
+
const onClick = jest.fn()
|
|
407
|
+
render(
|
|
408
|
+
<MultipleUsers
|
|
409
|
+
maxDisplayedUsers={2}
|
|
410
|
+
onClick={onClick}
|
|
411
|
+
users={[
|
|
412
|
+
{ imageUrl: 'pat.jpg', name: 'Pat' },
|
|
413
|
+
{ name: 'Sam' },
|
|
414
|
+
{ name: 'Alex' },
|
|
415
|
+
]}
|
|
416
|
+
/>
|
|
417
|
+
)
|
|
418
|
+
|
|
419
|
+
fireEvent.click(screen.getByText('+2'))
|
|
420
|
+
|
|
421
|
+
expect(onClick).toHaveBeenCalledTimes(1)
|
|
422
|
+
})
|
|
423
|
+
|
|
424
|
+
test('MultipleUsersStacked avatar and overflow badge each fire once from the root', () => {
|
|
425
|
+
const currentTargets = []
|
|
426
|
+
const onClick = jest.fn((event) => currentTargets.push(event.currentTarget))
|
|
427
|
+
render(
|
|
428
|
+
<MultipleUsersStacked
|
|
429
|
+
data={{ testid: 'onclick-multiple-users-stacked' }}
|
|
430
|
+
onClick={onClick}
|
|
431
|
+
users={[
|
|
432
|
+
{ imageUrl: 'pat.jpg', name: 'Pat' },
|
|
433
|
+
{ name: 'Sam' },
|
|
434
|
+
{ name: 'Alex' },
|
|
435
|
+
]}
|
|
436
|
+
/>
|
|
437
|
+
)
|
|
438
|
+
|
|
439
|
+
fireEvent.click(screen.getByAltText('Pat'))
|
|
440
|
+
fireEvent.click(screen.getByText('+2'))
|
|
441
|
+
|
|
442
|
+
expect(onClick).toHaveBeenCalledTimes(2)
|
|
443
|
+
expect(currentTargets).toEqual([
|
|
444
|
+
screen.getByTestId('onclick-multiple-users-stacked'),
|
|
445
|
+
screen.getByTestId('onclick-multiple-users-stacked'),
|
|
446
|
+
])
|
|
447
|
+
})
|
|
448
|
+
})
|
|
212
449
|
})
|
data/dist/ai/all-schemas.json
CHANGED
|
@@ -1950,6 +1950,7 @@
|
|
|
1950
1950
|
}
|
|
1951
1951
|
},
|
|
1952
1952
|
"globalProps": true,
|
|
1953
|
+
"globalEventProps": true,
|
|
1953
1954
|
"usage": {
|
|
1954
1955
|
"react": {
|
|
1955
1956
|
"import": "import { Background } from 'playbook-ui'",
|
|
@@ -2634,6 +2635,7 @@
|
|
|
2634
2635
|
}
|
|
2635
2636
|
},
|
|
2636
2637
|
"globalProps": true,
|
|
2638
|
+
"globalEventProps": true,
|
|
2637
2639
|
"usage": {
|
|
2638
2640
|
"react": {
|
|
2639
2641
|
"import": "import { Caption } from 'playbook-ui'",
|
|
@@ -3523,6 +3525,7 @@
|
|
|
3523
3525
|
}
|
|
3524
3526
|
},
|
|
3525
3527
|
"globalProps": true,
|
|
3528
|
+
"globalEventProps": true,
|
|
3526
3529
|
"usage": {
|
|
3527
3530
|
"react": {
|
|
3528
3531
|
"import": "import { Container } from 'playbook-ui'",
|
|
@@ -3775,6 +3778,7 @@
|
|
|
3775
3778
|
}
|
|
3776
3779
|
},
|
|
3777
3780
|
"globalProps": true,
|
|
3781
|
+
"globalEventProps": true,
|
|
3778
3782
|
"usage": {
|
|
3779
3783
|
"react": {
|
|
3780
3784
|
"import": "import { Currency } from 'playbook-ui'",
|
|
@@ -3835,6 +3839,7 @@
|
|
|
3835
3839
|
}
|
|
3836
3840
|
},
|
|
3837
3841
|
"globalProps": true,
|
|
3842
|
+
"globalEventProps": true,
|
|
3838
3843
|
"usage": {
|
|
3839
3844
|
"react": {
|
|
3840
3845
|
"import": "import { DashboardValue } from 'playbook-ui'",
|
|
@@ -5075,6 +5080,7 @@
|
|
|
5075
5080
|
}
|
|
5076
5081
|
},
|
|
5077
5082
|
"globalProps": true,
|
|
5083
|
+
"globalEventProps": true,
|
|
5078
5084
|
"usage": {
|
|
5079
5085
|
"react": {
|
|
5080
5086
|
"import": "import { Detail } from 'playbook-ui'",
|
|
@@ -7267,6 +7273,7 @@
|
|
|
7267
7273
|
}
|
|
7268
7274
|
},
|
|
7269
7275
|
"globalProps": true,
|
|
7276
|
+
"globalEventProps": true,
|
|
7270
7277
|
"usage": {
|
|
7271
7278
|
"react": {
|
|
7272
7279
|
"import": "import { Highlight } from 'playbook-ui'",
|
|
@@ -7793,6 +7800,7 @@
|
|
|
7793
7800
|
}
|
|
7794
7801
|
},
|
|
7795
7802
|
"globalProps": true,
|
|
7803
|
+
"globalEventProps": true,
|
|
7796
7804
|
"usage": {
|
|
7797
7805
|
"react": {
|
|
7798
7806
|
"import": "import { IconStatValue } from 'playbook-ui'",
|
|
@@ -7852,6 +7860,7 @@
|
|
|
7852
7860
|
}
|
|
7853
7861
|
},
|
|
7854
7862
|
"globalProps": true,
|
|
7863
|
+
"globalEventProps": true,
|
|
7855
7864
|
"usage": {
|
|
7856
7865
|
"react": {
|
|
7857
7866
|
"import": "import { IconValue } from 'playbook-ui'",
|
|
@@ -8080,6 +8089,7 @@
|
|
|
8080
8089
|
}
|
|
8081
8090
|
},
|
|
8082
8091
|
"globalProps": true,
|
|
8092
|
+
"globalEventProps": true,
|
|
8083
8093
|
"usage": {
|
|
8084
8094
|
"react": {
|
|
8085
8095
|
"import": "import { LabelValue } from 'playbook-ui'",
|
|
@@ -8775,6 +8785,7 @@
|
|
|
8775
8785
|
}
|
|
8776
8786
|
},
|
|
8777
8787
|
"globalProps": true,
|
|
8788
|
+
"globalEventProps": true,
|
|
8778
8789
|
"usage": {
|
|
8779
8790
|
"react": {
|
|
8780
8791
|
"import": "import { Message } from 'playbook-ui'",
|
|
@@ -9238,6 +9249,7 @@
|
|
|
9238
9249
|
}
|
|
9239
9250
|
},
|
|
9240
9251
|
"globalProps": true,
|
|
9252
|
+
"globalEventProps": true,
|
|
9241
9253
|
"usage": {
|
|
9242
9254
|
"react": {
|
|
9243
9255
|
"import": "import { MultipleUsers } from 'playbook-ui'",
|
|
@@ -9303,6 +9315,7 @@
|
|
|
9303
9315
|
}
|
|
9304
9316
|
},
|
|
9305
9317
|
"globalProps": true,
|
|
9318
|
+
"globalEventProps": true,
|
|
9306
9319
|
"usage": {
|
|
9307
9320
|
"react": {
|
|
9308
9321
|
"import": "import { MultipleUsersStacked } from 'playbook-ui'",
|
|
@@ -12800,6 +12813,7 @@
|
|
|
12800
12813
|
}
|
|
12801
12814
|
},
|
|
12802
12815
|
"globalProps": true,
|
|
12816
|
+
"globalEventProps": true,
|
|
12803
12817
|
"usage": {
|
|
12804
12818
|
"react": {
|
|
12805
12819
|
"import": "import { StatValue } from 'playbook-ui'",
|
|
@@ -15060,6 +15074,7 @@
|
|
|
15060
15074
|
}
|
|
15061
15075
|
},
|
|
15062
15076
|
"globalProps": true,
|
|
15077
|
+
"globalEventProps": true,
|
|
15063
15078
|
"usage": {
|
|
15064
15079
|
"react": {
|
|
15065
15080
|
"import": "import { TitleCount } from 'playbook-ui'",
|
|
@@ -15113,6 +15128,7 @@
|
|
|
15113
15128
|
}
|
|
15114
15129
|
},
|
|
15115
15130
|
"globalProps": true,
|
|
15131
|
+
"globalEventProps": true,
|
|
15116
15132
|
"usage": {
|
|
15117
15133
|
"react": {
|
|
15118
15134
|
"import": "import { TitleDetail } from 'playbook-ui'",
|
data/dist/ai/forms.json
CHANGED
data/dist/ai/index.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "18.2.0
|
|
2
|
+
"version": "18.2.0",
|
|
3
3
|
"metadataVersion": 1,
|
|
4
4
|
"forms": "forms.json",
|
|
5
|
-
"generated": "2026-10-
|
|
5
|
+
"generated": "2026-10-22T17:59:05.292Z",
|
|
6
6
|
"schemas": {
|
|
7
7
|
"globalProps": "global-props.schema.json",
|
|
8
8
|
"globalEventProps": "global-event-props.schema.json",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"presets":[{"name":"Default","structureMode":"advanced","props":{"advancedEditorToolbar":true,"label":"Description","name":"description"}},{"name":"Simple","structureMode":"advanced","props":{"advancedEditorToolbar":true,"label":"Notes","name":"notes","simple":true}},{"name":"Focus Toolbar","structureMode":"advanced","props":{"advancedEditorToolbar":false,"focus":true,"label":"Focus editor"}},{"name":"Tall Editor","structureMode":"advanced","props":{"inputHeight":"lg","inputMinHeight":"md","label":"Tall editor"}},{"name":"Required","structureMode":"advanced","props":{"label":"Description","name":"description","requiredIndicator":true}},{"name":"Sticky","structureMode":"advanced","props":{"label":"Sticky editor","sticky":true}}],"hints":{"advanced":{"presetName":"Default","message":"The Advanced structure wraps RichTextEditor with TipTap useEditor and EditorContent.","type":"info"},"focus":{"when":{"focus":true},"message":"Focus Toolbar shows the toolbar when the advanced editor receives focus.","type":"info"}},"conditionals":{"advancedEditorToolbar":{"structureMode":"advanced"},"inputHeight":{"structureMode":"advanced"},"inputMinHeight":{"structureMode":"advanced"},"sticky":{"structureMode":"advanced"}},"structureModes":{"default":"advanced","modes":{"advanced":{"label":"Advanced","template":"<RichTextEditor\n advancedEditor={editor}{{props}}\n>\n <EditorContent editor={editor} />\n</RichTextEditor>","children":"","wrapper":"const RichTextEditorPlayground = () => {\n const editor = useEditor({\n extensions: [StarterKit
|
|
1
|
+
{"presets":[{"name":"Default","structureMode":"advanced","props":{"advancedEditorToolbar":true,"label":"Description","name":"description"}},{"name":"Simple","structureMode":"advanced","props":{"advancedEditorToolbar":true,"label":"Notes","name":"notes","simple":true}},{"name":"Focus Toolbar","structureMode":"advanced","props":{"advancedEditorToolbar":false,"focus":true,"label":"Focus editor"}},{"name":"Tall Editor","structureMode":"advanced","props":{"inputHeight":"lg","inputMinHeight":"md","label":"Tall editor"}},{"name":"Required","structureMode":"advanced","props":{"label":"Description","name":"description","requiredIndicator":true}},{"name":"Sticky","structureMode":"advanced","props":{"label":"Sticky editor","sticky":true}}],"hints":{"advanced":{"presetName":"Default","message":"The Advanced structure wraps RichTextEditor with TipTap useEditor and EditorContent.","type":"info"},"focus":{"when":{"focus":true},"message":"Focus Toolbar shows the toolbar when the advanced editor receives focus.","type":"info"}},"conditionals":{"advancedEditorToolbar":{"structureMode":"advanced"},"inputHeight":{"structureMode":"advanced"},"inputMinHeight":{"structureMode":"advanced"},"sticky":{"structureMode":"advanced"}},"structureModes":{"default":"advanced","modes":{"advanced":{"label":"Advanced","template":"<RichTextEditor\n advancedEditor={editor}{{props}}\n>\n <EditorContent editor={editor} />\n</RichTextEditor>","children":"","wrapper":"const RichTextEditorPlayground = () => {\n const editor = useEditor({\n extensions: [StarterKit.configure({ trailingNode: false })],\n content: 'Add your text here. You can format your text, add links, quotes, and bullets.',\n })\n\n if (!editor) return null\n\n return {{component}}\n}\n\n<RichTextEditorPlayground />","externalImports":["import { useEditor, EditorContent } from '@tiptap/react'","import StarterKit from '@tiptap/starter-kit'"]}}},"template":"<RichTextEditor{{props}} />","propTargets":{},"externalDependencies":{"packages":["react-trix","trix","@tiptap/react","@tiptap/starter-kit","@tiptap/extension-link","prosemirror-markdown","prosemirror-model"],"optional":true,"note":"Default React editor uses Trix (pass TrixEditor from react-trix). Advanced React editor uses TipTap, and the host app must already have the needed packages installed. Agents must not install packages — tell the user if they are missing. Rails loads TipTap from esm.sh and accepts only these extension strings: underline, text_align, horizontal_rule, image."}}
|