playbook_ui 18.2.0.pre.rc.3 → 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.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_currency/_currency.tsx +3 -1
  3. data/app/pb_kits/playbook/pb_currency/kit.schema.json +1 -0
  4. data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.tsx +3 -1
  5. data/app/pb_kits/playbook/pb_dashboard_value/kit.schema.json +1 -0
  6. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_highlight.jsx +101 -0
  7. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_highlight.md +3 -0
  8. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +1 -0
  9. data/app/pb_kits/playbook/pb_dropdown/docs/index.js +2 -1
  10. data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.tsx +3 -1
  11. data/app/pb_kits/playbook/pb_icon_stat_value/kit.schema.json +1 -0
  12. data/app/pb_kits/playbook/pb_icon_value/_icon_value.tsx +3 -1
  13. data/app/pb_kits/playbook/pb_icon_value/kit.schema.json +1 -0
  14. data/app/pb_kits/playbook/pb_label_value/_label_value.tsx +3 -1
  15. data/app/pb_kits/playbook/pb_label_value/kit.schema.json +1 -0
  16. data/app/pb_kits/playbook/pb_message/_message.tsx +3 -1
  17. data/app/pb_kits/playbook/pb_message/kit.schema.json +1 -0
  18. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +3 -1
  19. data/app/pb_kits/playbook/pb_multiple_users/kit.schema.json +1 -0
  20. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +4 -2
  21. data/app/pb_kits/playbook/pb_multiple_users_stacked/kit.schema.json +1 -0
  22. data/app/pb_kits/playbook/pb_stat_value/_stat_value.tsx +3 -1
  23. data/app/pb_kits/playbook/pb_stat_value/kit.schema.json +1 -0
  24. data/app/pb_kits/playbook/pb_title_count/_title_count.tsx +3 -1
  25. data/app/pb_kits/playbook/pb_title_count/kit.schema.json +1 -0
  26. data/app/pb_kits/playbook/pb_title_detail/_title_detail.tsx +3 -1
  27. data/app/pb_kits/playbook/pb_title_detail/kit.schema.json +1 -0
  28. data/app/pb_kits/playbook/utilities/test/globalProps/onClick.test.js +227 -0
  29. data/dist/ai/all-schemas.json +11 -0
  30. data/dist/ai/forms.json +1 -1
  31. data/dist/ai/index.json +2 -2
  32. data/dist/ai/kits/currency.schema.json +1 -0
  33. data/dist/ai/kits/dashboard_value.schema.json +1 -0
  34. data/dist/ai/kits/icon_stat_value.schema.json +1 -0
  35. data/dist/ai/kits/icon_value.schema.json +1 -0
  36. data/dist/ai/kits/label_value.schema.json +1 -0
  37. data/dist/ai/kits/message.schema.json +1 -0
  38. data/dist/ai/kits/multiple_users.schema.json +1 -0
  39. data/dist/ai/kits/multiple_users_stacked.schema.json +1 -0
  40. data/dist/ai/kits/stat_value.schema.json +1 -0
  41. data/dist/ai/kits/title_count.schema.json +1 -0
  42. data/dist/ai/kits/title_detail.schema.json +1 -0
  43. data/dist/chunks/{_detail-Cy54syJC.js → _detail-Bsvl694i.js} +1 -1
  44. data/dist/chunks/_table-Bf6LGyL9.js +1 -0
  45. data/dist/chunks/{_typeahead-CXZH3KvV.js → _typeahead-w6S5Vx4b.js} +1 -1
  46. data/dist/chunks/vendor.js +2 -2
  47. data/dist/playbook-rails-react-bindings.js +1 -1
  48. data/dist/playbook-rails.js +1 -1
  49. data/lib/playbook/version.rb +1 -1
  50. metadata +8 -9
  51. data/dist/chunks/_table-BCqp1PAO.js +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c86866d416fa61cd6ef95462feacdaab4821a38f7512d171709d74ae355ca79
4
- data.tar.gz: 881dc11beb08455d597c2fef659070af84626c562597566f69fcdb773a61f5e7
3
+ metadata.gz: b5ac75f8f899c8e692ebc15d9e4c233540f1b055707c362099ca5f6bd23da085
4
+ data.tar.gz: 96f74ff346de6735599cbd46bf9d8b81e541b7ad7b258275e4174a922fe637ac
5
5
  SHA512:
6
- metadata.gz: 2a6e88281370f5ce11a7467aab89ed9db923a593f34748c39f43143488daa0f92b9f55b8eb9c1636c2f2c64215a3b092cdd5fbc3702315cc9612ef9cfe2327b0
7
- data.tar.gz: 398a941db88d54157eb9ca15fb952d290961fc05074a7c62ec0e6246cf315ae9d75da943f31d57b6c654d99652f32036b33c4dc1fda9bd3b2454e1cf524dae50
6
+ metadata.gz: c8dc8cf0775094f3d738ff9fdb1bc5a7101d9f950c6503dd75c598da03e0a4353d9466a864947fbc905a42997a60f3e8ee29569179106b9c8fc796feb2fe6819
7
+ data.tar.gz: 119a30f2687af34eb8bfbc1c942182d128838437cb8c15f71a061600892d9fe5498fe400db526ee306120e4b90f220d0f97bb1467e829191e6b5fe9c35a09eaf
@@ -2,6 +2,7 @@ import React from 'react'
2
2
  import classnames from 'classnames'
3
3
 
4
4
  import { globalProps } from '../utilities/globalProps'
5
+ import { GlobalEventProps, globalEventProps } from '../utilities/globalEventProps'
5
6
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
6
7
 
7
8
  import Body from '../pb_body/_body'
@@ -28,7 +29,7 @@ type CurrencyProps = {
28
29
  unit?: string,
29
30
  unstyled?: boolean,
30
31
  commaSeparator?: boolean,
31
- }
32
+ } & GlobalEventProps
32
33
 
33
34
  const sizes: {lg: 1, md: 3, sm: 4} = {
34
35
  lg: 1,
@@ -132,6 +133,7 @@ const Currency = (props: CurrencyProps): React.ReactElement => {
132
133
  {...ariaProps}
133
134
  {...dataProps}
134
135
  {...htmlProps}
136
+ {...globalEventProps(props)}
135
137
  className={classes}
136
138
  id={id}
137
139
  >
@@ -137,6 +137,7 @@
137
137
  }
138
138
  },
139
139
  "globalProps": true,
140
+ "globalEventProps": true,
140
141
  "usage": {
141
142
  "react": {
142
143
  "import": "import { Currency } from 'playbook-ui'",
@@ -2,6 +2,7 @@ import React from 'react'
2
2
  import classnames from 'classnames'
3
3
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
4
4
  import { globalProps } from '../utilities/globalProps'
5
+ import { GlobalEventProps, globalEventProps } from '../utilities/globalEventProps'
5
6
 
6
7
  import Body from '../pb_body/_body'
7
8
  import StatChange from '../pb_stat_change/_stat_change'
@@ -23,7 +24,7 @@ type DashboardValueProps = {
23
24
  unit?: string,
24
25
  value?: string | number
25
26
  }
26
- }
27
+ } & GlobalEventProps
27
28
 
28
29
  const DashboardValue = (props: DashboardValueProps): React.ReactElement => {
29
30
  const {
@@ -52,6 +53,7 @@ const DashboardValue = (props: DashboardValueProps): React.ReactElement => {
52
53
  {...ariaProps}
53
54
  {...dataProps}
54
55
  {...htmlProps}
56
+ {...globalEventProps(props)}
55
57
  className={classes}
56
58
  id={id}
57
59
  >
@@ -43,6 +43,7 @@
43
43
  }
44
44
  },
45
45
  "globalProps": true,
46
+ "globalEventProps": true,
46
47
  "usage": {
47
48
  "react": {
48
49
  "import": "import { DashboardValue } from 'playbook-ui'",
@@ -0,0 +1,101 @@
1
+ import React, { useState } from 'react'
2
+
3
+ import Avatar from '../../pb_avatar/_avatar'
4
+ import Body from '../../pb_body/_body'
5
+ import Dropdown from '../../pb_dropdown/_dropdown'
6
+ import Flex from '../../pb_flex/_flex'
7
+ import FlexItem from '../../pb_flex/_flex_item'
8
+ import Title from '../../pb_title/_title'
9
+
10
+ const USERS = [
11
+ {
12
+ label: "Wade Winningham",
13
+ title: "Nitro Principal Developer",
14
+ territory: "PHL",
15
+ value: "wadeWinningham",
16
+ },
17
+ {
18
+ label: "Carlos Lima",
19
+ title: "Nitro Developer",
20
+ territory: "PHL",
21
+ value: "carlosLima",
22
+ },
23
+ {
24
+ label: "Stephen Marshall",
25
+ title: "Senior Nitro Developer",
26
+ territory: "PHL",
27
+ value: "stephenMarshall",
28
+ },
29
+ {
30
+ label: "Jasper Furniss",
31
+ title: "Lead User Experience Engineer",
32
+ territory: "PHL",
33
+ value: "jasperFurniss",
34
+ },
35
+ ]
36
+
37
+ const escapeRegExp = (value = "") => (
38
+ value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")
39
+ )
40
+
41
+ const highlighted = (text, searchInput) => {
42
+ if (!searchInput) return text
43
+
44
+ const regex = new RegExp(`(${escapeRegExp(searchInput)})`, 'gi')
45
+
46
+ return text.split(regex).map((part, index) => (
47
+ part.toLowerCase() === searchInput.toLowerCase()
48
+ ? <mark key={`${part}-${index}`}>{part}</mark>
49
+ : <React.Fragment key={`${part}-${index}`}>{part}</React.Fragment>
50
+ ))
51
+ }
52
+
53
+ const loadUsers = (searchInput) => {
54
+ const normalizedInput = searchInput.toLowerCase()
55
+
56
+ return Promise.resolve(USERS.filter(({ label, title }) => (
57
+ `${label} ${title}`.toLowerCase().includes(normalizedInput)
58
+ )))
59
+ }
60
+
61
+ const DropdownWithHighlight = (props) => {
62
+ const [searchInput, setSearchInput] = useState("")
63
+
64
+ const renderUser = ({ label, territory, title }) => (
65
+ <Flex>
66
+ <FlexItem>
67
+ <Avatar
68
+ marginRight="sm"
69
+ name={label}
70
+ size="sm"
71
+ />
72
+ </FlexItem>
73
+ <FlexItem>
74
+ <Title size={4}>
75
+ {highlighted(label, searchInput)}
76
+ </Title>
77
+ <Body color="light">
78
+ {highlighted(title, searchInput)}{" • "}
79
+ {territory}
80
+ </Body>
81
+ </FlexItem>
82
+ </Flex>
83
+ )
84
+
85
+ return (
86
+ <Dropdown
87
+ async
88
+ autocomplete
89
+ defaultOptions={USERS}
90
+ label="Users"
91
+ loadOptions={loadUsers}
92
+ onInputChange={(input) => setSearchInput(input)}
93
+ onSelect={() => setSearchInput("")}
94
+ placeholder="Search users"
95
+ renderOption={renderUser}
96
+ {...props}
97
+ />
98
+ )
99
+ }
100
+
101
+ export default DropdownWithHighlight
@@ -0,0 +1,3 @@
1
+ Use `onInputChange` to track the current search and `renderOption` to customize each option row. Split each field by the search input, then render matching text inside `<mark>` so users can quickly see why a result matched.
2
+
3
+ This example uses `loadOptions` to search both the user's name and title.
@@ -51,6 +51,7 @@ examples:
51
51
  react:
52
52
  - dropdown_default: Default
53
53
  - dropdown_with_autocomplete: Autocomplete
54
+ - dropdown_with_highlight: With Highlight
54
55
  - dropdown_multi_select: Multi Select
55
56
  - dropdown_multi_select_with_autocomplete: Multi Select with Autocomplete
56
57
  - dropdown_multi_select_display: Multi Select with Form Pill Props
@@ -47,4 +47,5 @@ export { default as DropdownAsyncMultiSelect } from './_dropdown_async_multi_sel
47
47
  export { default as DropdownAsyncRichResults } from './_dropdown_async_rich_results.jsx'
48
48
  export { default as DropdownAsyncInitialOptions } from './_dropdown_async_initial_options.jsx'
49
49
  export { default as DropdownExternalSearch } from './_dropdown_external_search.jsx'
50
- export { default as DropdownQuickpickEnableTime } from './_dropdown_quickpick_enable_time.jsx'
50
+ export { default as DropdownQuickpickEnableTime } from './_dropdown_quickpick_enable_time.jsx'
51
+ export { default as DropdownWithHighlight } from './_dropdown_with_highlight.jsx'
@@ -3,6 +3,7 @@ import classnames from 'classnames'
3
3
 
4
4
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
5
5
  import { globalProps, GlobalProps } from '../utilities/globalProps'
6
+ import { GlobalEventProps, globalEventProps } from '../utilities/globalEventProps'
6
7
 
7
8
  import Body from '../pb_body/_body'
8
9
  import Caption from '../pb_caption/_caption'
@@ -33,7 +34,7 @@ type IconStatValueProps = {
33
34
  | "yellow"
34
35
  | "orange"
35
36
  | "green"
36
- } & GlobalProps
37
+ } & GlobalProps & GlobalEventProps
37
38
 
38
39
  const IconStatValue = (props: IconStatValueProps): React.ReactElement => {
39
40
  const {
@@ -94,6 +95,7 @@ const IconStatValue = (props: IconStatValueProps): React.ReactElement => {
94
95
  {...ariaProps}
95
96
  {...dataProps}
96
97
  {...htmlProps}
98
+ {...globalEventProps(props)}
97
99
  className={classes}
98
100
  id={id}
99
101
  >
@@ -89,6 +89,7 @@
89
89
  }
90
90
  },
91
91
  "globalProps": true,
92
+ "globalEventProps": true,
92
93
  "usage": {
93
94
  "react": {
94
95
  "import": "import { IconStatValue } from 'playbook-ui'",
@@ -3,6 +3,7 @@ import classnames from 'classnames'
3
3
 
4
4
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
5
5
  import { globalProps } from '../utilities/globalProps'
6
+ import { GlobalEventProps, globalEventProps } from '../utilities/globalEventProps'
6
7
 
7
8
  import Body from '../pb_body/_body'
8
9
  import Icon from '../pb_icon/_icon'
@@ -18,7 +19,7 @@ type IconValueProps = {
18
19
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
19
20
  id?: string,
20
21
  text: string,
21
- }
22
+ } & GlobalEventProps
22
23
 
23
24
  const IconValue = (props: IconValueProps): React.ReactElement => {
24
25
  const {
@@ -46,6 +47,7 @@ const IconValue = (props: IconValueProps): React.ReactElement => {
46
47
  {...ariaProps}
47
48
  {...dataProps}
48
49
  {...htmlProps}
50
+ {...globalEventProps(props)}
49
51
  className={classes}
50
52
  id={id}
51
53
  >
@@ -42,6 +42,7 @@
42
42
  }
43
43
  },
44
44
  "globalProps": true,
45
+ "globalEventProps": true,
45
46
  "usage": {
46
47
  "react": {
47
48
  "import": "import { IconValue } from 'playbook-ui'",
@@ -2,6 +2,7 @@ import React from "react";
2
2
  import classnames from "classnames";
3
3
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from "../utilities/props";
4
4
  import { globalProps } from "../utilities/globalProps";
5
+ import { GlobalEventProps, globalEventProps } from "../utilities/globalEventProps";
5
6
  import DateTime from '../pb_kit/dateTime';
6
7
 
7
8
  import Body from "../pb_body/_body";
@@ -25,7 +26,7 @@ type LabelValueProps = {
25
26
  icon?: string;
26
27
  description?: string;
27
28
  title?: string;
28
- };
29
+ } & GlobalEventProps;
29
30
 
30
31
  const dateString = (value: Date) => {
31
32
  const month = DateTime.toMonthNum(value);
@@ -67,6 +68,7 @@ const LabelValue = (props: LabelValueProps) => {
67
68
  {...ariaProps}
68
69
  {...dataProps}
69
70
  {...htmlProps}
71
+ {...globalEventProps(props)}
70
72
  className={classes}
71
73
  id={id}
72
74
  title={title}
@@ -77,6 +77,7 @@
77
77
  }
78
78
  },
79
79
  "globalProps": true,
80
+ "globalEventProps": true,
80
81
  "usage": {
81
82
  "react": {
82
83
  "import": "import { LabelValue } from 'playbook-ui'",
@@ -3,6 +3,7 @@ import classnames from 'classnames'
3
3
 
4
4
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
5
5
  import { globalProps } from '../utilities/globalProps'
6
+ import { GlobalEventProps, globalEventProps } from '../utilities/globalEventProps'
6
7
 
7
8
  import Avatar from '../pb_avatar/_avatar'
8
9
  import Body from '../pb_body/_body'
@@ -28,7 +29,7 @@ type MessageProps = {
28
29
  timestampObject?: Date,
29
30
  timezone?: string,
30
31
  alignTimestamp?: string,
31
- }
32
+ } & GlobalEventProps
32
33
 
33
34
  const Message = (props: MessageProps) => {
34
35
  const {
@@ -68,6 +69,7 @@ const Message = (props: MessageProps) => {
68
69
  {...ariaProps}
69
70
  {...dataProps}
70
71
  {...htmlProps}
72
+ {...globalEventProps(props)}
71
73
  className={classes}
72
74
  id={id}
73
75
  >
@@ -94,6 +94,7 @@
94
94
  }
95
95
  },
96
96
  "globalProps": true,
97
+ "globalEventProps": true,
97
98
  "usage": {
98
99
  "react": {
99
100
  "import": "import { Message } from 'playbook-ui'",
@@ -3,6 +3,7 @@ import classnames from 'classnames'
3
3
 
4
4
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
5
5
  import { globalProps } from '../utilities/globalProps'
6
+ import { GlobalEventProps, globalEventProps } from '../utilities/globalEventProps'
6
7
 
7
8
  import Avatar from '../pb_avatar/_avatar'
8
9
  import Tooltip from '../pb_tooltip/_tooltip'
@@ -19,7 +20,7 @@ type MultipleUsersProps = {
19
20
  size?: "md" | "lg" | "sm" | "xl" | "xs" | "xxs",
20
21
  withTooltip?: boolean,
21
22
  users: Array<{ [key: string]: string }>,
22
- }
23
+ } & GlobalEventProps
23
24
 
24
25
  const MultipleUsers = (props: MultipleUsersProps): React.ReactElement => {
25
26
  const {
@@ -126,6 +127,7 @@ const MultipleUsers = (props: MultipleUsersProps): React.ReactElement => {
126
127
  {...ariaProps}
127
128
  {...dataProps}
128
129
  {...htmlProps}
130
+ {...globalEventProps(props)}
129
131
  className={classes}
130
132
  id={id}
131
133
  >
@@ -60,6 +60,7 @@
60
60
  }
61
61
  },
62
62
  "globalProps": true,
63
+ "globalEventProps": true,
63
64
  "usage": {
64
65
  "react": {
65
66
  "import": "import { MultipleUsers } from 'playbook-ui'",
@@ -1,8 +1,9 @@
1
1
  import React from 'react'
2
2
  import classnames from 'classnames'
3
3
 
4
- import { globalProps } from '../utilities/globalProps'
5
4
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
5
+ import { globalProps } from '../utilities/globalProps'
6
+ import { GlobalEventProps, globalEventProps } from '../utilities/globalEventProps'
6
7
 
7
8
  import Avatar from '../pb_avatar/_avatar'
8
9
  import Badge from '../pb_badge/_badge'
@@ -17,7 +18,7 @@ type MultipleUsersStackedProps = {
17
18
  size?: "md" | "lg" | "sm" | "xl"
18
19
  users: Array<{ [key: string]: string }>,
19
20
  variant: "default" | "bubble",
20
- }
21
+ } & GlobalEventProps
21
22
 
22
23
  const MultipleUsersStacked = (props: MultipleUsersStackedProps) => {
23
24
  const {
@@ -132,6 +133,7 @@ const MultipleUsersStacked = (props: MultipleUsersStackedProps) => {
132
133
  {...ariaProps}
133
134
  {...dataProps}
134
135
  {...htmlProps}
136
+ {...globalEventProps(props)}
135
137
  className={classes}
136
138
  id={id}
137
139
  >
@@ -48,6 +48,7 @@
48
48
  }
49
49
  },
50
50
  "globalProps": true,
51
+ "globalEventProps": true,
51
52
  "usage": {
52
53
  "react": {
53
54
  "import": "import { MultipleUsersStacked } from 'playbook-ui'",
@@ -2,6 +2,7 @@ import React from 'react'
2
2
  import classnames from 'classnames'
3
3
 
4
4
  import { globalProps } from '../utilities/globalProps'
5
+ import { GlobalEventProps, globalEventProps } from '../utilities/globalEventProps'
5
6
  import { buildHtmlProps } from '../utilities/props'
6
7
  import Title from '../pb_title/_title'
7
8
 
@@ -11,7 +12,7 @@ type StatValueProps = {
11
12
  id?: string,
12
13
  unit?: string,
13
14
  value: string | number,
14
- }
15
+ } & GlobalEventProps
15
16
 
16
17
  const StatValue = (props: StatValueProps): React.ReactElement => {
17
18
  const {
@@ -53,6 +54,7 @@ const StatValue = (props: StatValueProps): React.ReactElement => {
53
54
  className={classnames('pb_stat_value_kit', globalProps(props), className)}
54
55
  id={id}
55
56
  {...htmlProps}
57
+ {...globalEventProps(props)}
56
58
  >
57
59
  <div className="pb_stat_value_wrapper">
58
60
  {displayValue(value)}
@@ -32,6 +32,7 @@
32
32
  }
33
33
  },
34
34
  "globalProps": true,
35
+ "globalEventProps": true,
35
36
  "usage": {
36
37
  "react": {
37
38
  "import": "import { StatValue } from 'playbook-ui'",
@@ -4,6 +4,7 @@ import classnames from 'classnames'
4
4
 
5
5
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
6
6
  import { globalProps } from '../utilities/globalProps'
7
+ import { GlobalEventProps, globalEventProps } from '../utilities/globalEventProps'
7
8
 
8
9
  import Body from '../pb_body/_body'
9
10
  import Title from '../pb_title/_title'
@@ -19,7 +20,7 @@ type TitleCountProps = {
19
20
  id?: string,
20
21
  title?: string,
21
22
  size?: "lg" | "sm",
22
- };
23
+ } & GlobalEventProps;
23
24
 
24
25
  const TitleCount = (props: TitleCountProps): React.ReactElement => {
25
26
  const {
@@ -50,6 +51,7 @@ const TitleCount = (props: TitleCountProps): React.ReactElement => {
50
51
  {...ariaProps}
51
52
  {...dataProps}
52
53
  {...htmlProps}
54
+ {...globalEventProps(props)}
53
55
  className={css}
54
56
  id={id}
55
57
  >
@@ -54,6 +54,7 @@
54
54
  }
55
55
  },
56
56
  "globalProps": true,
57
+ "globalEventProps": true,
57
58
  "usage": {
58
59
  "react": {
59
60
  "import": "import { TitleCount } from 'playbook-ui'",
@@ -2,6 +2,7 @@ import React from 'react'
2
2
  import classnames from 'classnames'
3
3
 
4
4
  import { GlobalProps, globalProps } from '../utilities/globalProps'
5
+ import { GlobalEventProps, globalEventProps } from '../utilities/globalEventProps'
5
6
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
6
7
 
7
8
  import Body from '../pb_body/_body'
@@ -16,7 +17,7 @@ type TitleDetailProps = {
16
17
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
17
18
  id?: string,
18
19
  title: string,
19
- } & GlobalProps
20
+ } & GlobalProps & GlobalEventProps
20
21
 
21
22
  const TitleDetail = (props: TitleDetailProps): React.ReactElement => {
22
23
  const {
@@ -40,6 +41,7 @@ const TitleDetail = (props: TitleDetailProps): React.ReactElement => {
40
41
  {...ariaProps}
41
42
  {...dataProps}
42
43
  {...htmlProps}
44
+ {...globalEventProps(props)}
43
45
  className={classnames(pbCss, globalProps(props), className)}
44
46
  id={id}
45
47
  >
@@ -36,6 +36,7 @@
36
36
  }
37
37
  },
38
38
  "globalProps": true,
39
+ "globalEventProps": true,
39
40
  "usage": {
40
41
  "react": {
41
42
  "import": "import { TitleDetail } from 'playbook-ui'",