playbook_ui 18.1.0.pre.rc.2 → 18.1.0.pre.rc.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 69806745bf9d406cc340a98ebaa54bbab8fd00312d756cd0bf60e3077db5794e
4
- data.tar.gz: 0aef11e0e9dc51c336af96739287476e8b01e8397c2580cfff87d8ef0a17a7eb
3
+ metadata.gz: b509d67399d2f700fb0fdb9121ba71f5430009a0ad2d4c8c86b685cd904cf0d0
4
+ data.tar.gz: ee187a8a1510f7c9c51c68dfa5532d250ddd96e6688384386a092890eb84a9d3
5
5
  SHA512:
6
- metadata.gz: 590f41d6ac3e5304ad388114c1a0a0264df448ef4e4df753a4e06058c4a80bae552f5aefb78f768ff257073694dcc9433fd697520a7603d7d2ce5b4b314fd5c5
7
- data.tar.gz: 4dd0fe2434dc65fd2a2eab892ffd571d6c6f2fcf9d7ea72e5fb83da7d5f5cf44ccaf5c2e579765c2886092779b4b5c7de0007da7a12cc49998c23ca253815208
6
+ metadata.gz: dcc3382e3c37957e7f805db7de2b4f78b9b03bb40e8b11d283519842af3790d016626ae63b194268033a196ce8ea0fce84c30c5a8f73b42f9901655db25d3009
7
+ data.tar.gz: 315da4f419ed8096a01da8ef3d990dce428f4b60fc810e82cfb1c051f34e928ea4d7b3b8ccae5d7076eb61803cbf79526703a4a5a38b573b286fa6ea7be2a541
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import classnames from 'classnames'
3
- import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
3
+ import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
4
4
  import { globalProps } from '../utilities/globalProps'
5
5
 
6
6
  import Button from '../pb_button/_button'
@@ -13,6 +13,7 @@ type CopyButtonProps = {
13
13
  aria?: { [key: string]: string }
14
14
  className?: string
15
15
  data?: { [key: string]: string }
16
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)}
16
17
  id?: string
17
18
  from?: string
18
19
  text?: string
@@ -29,6 +30,7 @@ const CopyButton = (props: CopyButtonProps) => {
29
30
  className,
30
31
  data = {},
31
32
  from = '',
33
+ htmlOptions = {},
32
34
  id,
33
35
  text = 'Copy',
34
36
  timeout = 1000,
@@ -42,12 +44,14 @@ const CopyButton = (props: CopyButtonProps) => {
42
44
 
43
45
  const ariaProps = buildAriaProps(aria)
44
46
  const dataProps = buildDataProps(data)
47
+ const htmlProps = buildHtmlProps(htmlOptions)
45
48
  const classes = classnames(buildCss('pb_copy_button_kit'), globalProps(props), className)
46
49
 
47
50
  return (
48
51
  <div
49
52
  {...ariaProps}
50
53
  {...dataProps}
54
+ {...htmlProps}
51
55
  className={classes}
52
56
  id={id}
53
57
  >
@@ -86,3 +86,15 @@ test('passes text and tooltip props to button', () => {
86
86
  const tooltip = kit.querySelector('.pb_tooltip_kit')
87
87
  expect(tooltip).toBeInTheDocument()
88
88
  })
89
+
90
+ test('applies htmlOptions to the root element', () => {
91
+ render(
92
+ <CopyButton
93
+ data={{ testid: 'html-options-test' }}
94
+ htmlOptions={{ title: 'copy title' }}
95
+ value="copy"
96
+ />
97
+ )
98
+
99
+ expect(screen.getByTestId('html-options-test')).toHaveAttribute('title', 'copy title')
100
+ })
@@ -1,5 +1,6 @@
1
1
 
2
2
  import React from 'react'
3
+ import classnames from 'classnames'
3
4
 
4
5
  import { buildCss, buildHtmlProps } from '../utilities/props'
5
6
  import { deprecatedProps, globalProps } from '../utilities/globalProps'
@@ -11,6 +12,7 @@ import TimeStacked from '../pb_time_stacked/_time_stacked'
11
12
  import DateStacked from '../pb_date_stacked/_date_stacked'
12
13
 
13
14
  type DateTimeStackedProps = {
15
+ className?: string,
14
16
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
15
17
  id?: string,
16
18
  date: Date,
@@ -27,20 +29,25 @@ const DateTimeStacked = (props: DateTimeStackedProps): React.ReactElement => {
27
29
  date,
28
30
  datetime,
29
31
  dark,
32
+ className,
30
33
  htmlOptions = {},
31
34
  timeZone = 'America/New_York',
32
35
  showCurrentYear = false,
33
36
  } = props
34
37
 
35
- const classes = buildCss('pb_date_time_stacked_kit', globalProps(props))
36
- const htmlProps = buildHtmlProps(htmlOptions)
38
+ const classes = classnames(
39
+ buildCss('pb_date_time_stacked_kit'),
40
+ globalProps(props),
41
+ className
42
+ )
37
43
 
38
44
  return (
39
45
  <Flex
46
+ htmlOptions={htmlOptions}
40
47
  inline={false}
41
48
  vertical="stretch"
42
- {...htmlProps}
43
49
  {...props}
50
+ className={classes}
44
51
  >
45
52
  <FlexItem>
46
53
  <DateStacked
@@ -58,7 +65,6 @@ const DateTimeStacked = (props: DateTimeStackedProps): React.ReactElement => {
58
65
  />
59
66
  <FlexItem>
60
67
  <TimeStacked
61
- className={classes}
62
68
  dark={dark}
63
69
  date={date || datetime}
64
70
  timeZone={timeZone}
@@ -74,3 +74,15 @@ test('hides current year by default', () => {
74
74
  expect(yearElement).toBeNull()
75
75
  }
76
76
  })
77
+
78
+ test('applies kit class and global props to the root', () => {
79
+ const kit = renderKit(DateTimeStacked, {
80
+ data: { testid: 'datetimestacked-root' },
81
+ datetime,
82
+ dark: false,
83
+ margin: 'md',
84
+ })
85
+
86
+ expect(kit).toHaveClass('pb_date_time_stacked_kit')
87
+ expect(kit).toHaveClass('m_md')
88
+ })
@@ -1,22 +1,27 @@
1
1
  import React from 'react'
2
2
  import classnames from 'classnames'
3
- import { buildCss } from '../../utilities/props'
3
+ import { buildCss, buildHtmlProps } from '../../utilities/props'
4
4
  import { globalProps } from '../../utilities/globalProps'
5
5
 
6
6
  type DialogBodyProps = {
7
7
  children: React.ReactNode | React.ReactNode[] | string,
8
8
  padding?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl",
9
- className?: string
9
+ className?: string,
10
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
10
11
  }
11
12
 
12
13
  // Body component
13
14
  const DialogBody = (props: DialogBodyProps): React.ReactElement => {
14
- const { children, className } = props
15
+ const { children, className, htmlOptions = {} } = props
15
16
  const bodyCSS = buildCss("dialog_body")
16
17
  const bodySpacing = globalProps(props)
18
+ const htmlProps = buildHtmlProps(htmlOptions)
17
19
 
18
20
  return (
19
- <div className={classnames(bodyCSS, bodySpacing, className)}>
21
+ <div
22
+ {...htmlProps}
23
+ className={classnames(bodyCSS, bodySpacing, className)}
24
+ >
20
25
  {children}
21
26
  </div>
22
27
  )
@@ -268,3 +268,13 @@ describe('isNativeSelectMenuInteraction', () => {
268
268
  expect(isNativeSelectMenuInteraction(dialog, select)).toBe(false)
269
269
  })
270
270
  })
271
+
272
+ test("applies htmlOptions to Dialog.Body", () => {
273
+ render(
274
+ <Dialog.Body htmlOptions={{ title: "body title" }}>
275
+ {"Body content"}
276
+ </Dialog.Body>
277
+ )
278
+
279
+ expect(document.querySelector(".dialog_body")).toHaveAttribute("title", "body title")
280
+ })
@@ -2,7 +2,7 @@
2
2
  import React from "react"
3
3
  import ReactDOMServer from "react-dom/server"
4
4
  import classnames from "classnames"
5
- import { buildAriaProps, buildCss, buildDataProps } from "../utilities/props"
5
+ import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from "../utilities/props"
6
6
  import { globalProps } from "../utilities/globalProps"
7
7
  import Title from "../pb_title/_title"
8
8
  import Body from "../pb_body/_body"
@@ -22,6 +22,7 @@ type EmptyStateProps = {
22
22
  data?: { [key: string]: string },
23
23
  description?: string,
24
24
  header?: string,
25
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
25
26
  id?: string,
26
27
  image?: string,
27
28
  linkButton?: string,
@@ -40,6 +41,7 @@ const EmptyState = (props: EmptyStateProps) => {
40
41
  data = {},
41
42
  description,
42
43
  header = "",
44
+ htmlOptions = {},
43
45
  id,
44
46
  image,
45
47
  linkButton,
@@ -52,6 +54,7 @@ const EmptyState = (props: EmptyStateProps) => {
52
54
 
53
55
  const ariaProps = buildAriaProps(aria)
54
56
  const dataProps = buildDataProps(data)
57
+ const htmlProps = buildHtmlProps(htmlOptions)
55
58
  const classes = classnames(buildCss("pb_empty_state_kit"), globalProps(props), className)
56
59
 
57
60
  const renderContent = () => {
@@ -137,6 +140,7 @@ const EmptyState = (props: EmptyStateProps) => {
137
140
  const layout = (
138
141
  <div {...ariaProps}
139
142
  {...dataProps}
143
+ {...htmlProps}
140
144
  className={classes}
141
145
  id={id}
142
146
  >
@@ -14,4 +14,15 @@ test('returns namespaced class name', () => {
14
14
 
15
15
  const kit = screen.getByTestId('primary-test')
16
16
  expect(kit).toHaveClass('pb_empty_state_kit')
17
+ })
18
+
19
+ test('applies htmlOptions to the root element', () => {
20
+ render(
21
+ <EmptyState
22
+ data={{ testid: 'html-options-test' }}
23
+ htmlOptions={{ title: 'empty state title' }}
24
+ />
25
+ )
26
+
27
+ expect(screen.getByTestId('html-options-test')).toHaveAttribute('title', 'empty state title')
17
28
  })
@@ -1,6 +1,7 @@
1
1
  import React from 'react'
2
2
  import classnames from 'classnames'
3
3
 
4
+ import { buildHtmlProps } from '../../utilities/props'
4
5
  import { GlobalProps, globalProps } from '../../utilities/globalProps'
5
6
 
6
7
  import Card from '../../pb_card/_card'
@@ -10,13 +11,18 @@ export type FilterBackgroundProps = {
10
11
  className?: string,
11
12
  children?: React.ReactChild[] | React.ReactChild,
12
13
  dark?: boolean,
14
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
13
15
  } & GlobalProps
14
16
 
15
17
  const FilterBackground = (props: FilterBackgroundProps): React.ReactElement => {
16
- const { background = true, className, children, dark } = props
18
+ const { background = true, className, children, dark, htmlOptions = {} } = props
19
+ const htmlProps = buildHtmlProps(htmlOptions)
17
20
 
18
21
  return (
19
- <div className={classnames(`pb_filter_kit ${className}`, globalProps(props))}>
22
+ <div
23
+ {...htmlProps}
24
+ className={classnames(`pb_filter_kit ${className}`, globalProps(props))}
25
+ >
20
26
  { background ?
21
27
  <Card
22
28
  dark={dark}
@@ -153,6 +153,20 @@ test("generates quickpick options for interactive dropdown filters", () => {
153
153
  expect(handleChange).toHaveBeenCalledWith("quickpick-last-month");
154
154
  });
155
155
 
156
+ test("applies htmlOptions to the root element", () => {
157
+ render(
158
+ <Filter
159
+ htmlOptions={{ title: "filter title" }}
160
+ results={1}
161
+ />
162
+ );
163
+
164
+ expect(document.querySelector(".pb_filter_kit")).toHaveAttribute(
165
+ "title",
166
+ "filter title"
167
+ );
168
+ });
169
+
156
170
  test("renders double layout when double is true", () => {
157
171
  render(<FilterTest double />);
158
172
 
@@ -2,6 +2,7 @@ import React from 'react'
2
2
  import classnames from 'classnames'
3
3
 
4
4
  import { buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
5
+ import { globalProps } from '../utilities/globalProps'
5
6
 
6
7
  import Icon from '../pb_icon/_icon'
7
8
 
@@ -32,7 +33,7 @@ const ProgressStepItem = (props: ProgressStepItemProps): React.ReactElement => {
32
33
  <li
33
34
  {...dataProps}
34
35
  {...htmlProps}
35
- className={classnames(progressStepItem, className)}
36
+ className={classnames(progressStepItem, globalProps(props), className)}
36
37
  >
37
38
  <div className="box">
38
39
  <div className="circle">
@@ -108,6 +108,22 @@ test('should render the children elements', () => {
108
108
  expect(step3Kit).toHaveClass('pb_progress_step_item_inactive')
109
109
  })
110
110
 
111
+ test('should apply global props to ProgressStepItem', () => {
112
+ render(
113
+ <ProgressStep>
114
+ <ProgressStepItem
115
+ data={{ testid: step1Id }}
116
+ margin="md"
117
+ status="complete"
118
+ >
119
+ {'Step 1'}
120
+ </ProgressStepItem>
121
+ </ProgressStep>
122
+ )
123
+
124
+ expect(screen.getByTestId(step1Id)).toHaveClass('m_md')
125
+ })
126
+
111
127
  test('should render info color', () => {
112
128
  render(
113
129
  <ProgressStep
@@ -2,6 +2,7 @@ import React from 'react'
2
2
  import classnames from 'classnames'
3
3
 
4
4
  import { buildDataProps, buildAriaProps, buildHtmlProps } from '../utilities/props'
5
+ import { globalProps } from '../utilities/globalProps'
5
6
  import { titleize } from '../utilities/text'
6
7
 
7
8
  import Avatar, { AvatarProps } from '../pb_avatar/_avatar'
@@ -22,23 +23,25 @@ type SourceProps = {
22
23
  user: AvatarProps,
23
24
  }
24
25
 
25
- const Source = ({
26
- aria = {},
27
- className,
28
- data = {},
29
- hideIcon = false,
30
- htmlOptions = {},
31
- id,
32
- source,
33
- type = 'inbound',
34
- user = {},
35
- }: SourceProps): React.ReactElement => {
26
+ const Source = (props: SourceProps): React.ReactElement => {
27
+ const {
28
+ aria = {},
29
+ className,
30
+ data = {},
31
+ hideIcon = false,
32
+ htmlOptions = {},
33
+ id,
34
+ source,
35
+ type = 'inbound',
36
+ user = {},
37
+ } = props
36
38
  const dataProps = buildDataProps(data)
37
39
  const htmlProps = buildHtmlProps(htmlOptions)
38
40
  const ariaProps = buildAriaProps(aria)
39
41
 
40
42
  const css = classnames([
41
43
  'pb_source_kit',
44
+ globalProps(props),
42
45
  className,
43
46
  ])
44
47
 
@@ -80,3 +80,9 @@ test('should pass user prop', () => {
80
80
  kit = screen.getByText(user.userId)
81
81
  expect(kit).toBeInTheDocument()
82
82
  })
83
+
84
+ test('should apply global props to the root element', () => {
85
+ render(<SourceDefault margin="md" />)
86
+ const kit = screen.getByTestId(testId)
87
+ expect(kit).toHaveClass('m_md')
88
+ })
data/dist/ai/forms.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "metadataVersion": 1,
3
- "version": "18.1.0-rc.2",
3
+ "version": "18.1.0-rc.3",
4
4
  "builder": {
5
5
  "class": "Playbook::Forms::Builder",
6
6
  "helper": "pb_form_with",
data/dist/ai/index.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
- "version": "18.1.0-rc.2",
2
+ "version": "18.1.0-rc.3",
3
3
  "metadataVersion": 1,
4
4
  "forms": "forms.json",
5
- "generated": "2026-09-29T19:21:09.246Z",
5
+ "generated": "2026-09-29T19:46:50.397Z",
6
6
  "schemas": {
7
7
  "globalProps": "global-props.schema.json",
8
8
  "globalEventProps": "global-event-props.schema.json",