playbook_ui 11.2.5 → 11.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd92a1775a844fd8f606c1acd266c5ce645b45dd625195efdcd6a416ed8b5fa7
4
- data.tar.gz: 3f27c1389870c46b76d5032b0c06480899095c920ed61d80c331d2f35de9e6fe
3
+ metadata.gz: 829ab73754749eeb3476c40cfaba3fb74e62e92744f725772b851b3c084a81ce
4
+ data.tar.gz: e42dc4f35cb80676454745307afba58a5d33e7deae5f68ff36074a28e78e3299
5
5
  SHA512:
6
- metadata.gz: 53d6e1bb4c838f0f36a5e53f96c85756f2514c4fa27038f4e3d8f462cc5d7106c9252ee0614d47a5e47f4b68ee3ee22c2bf2c3d72e95d3ccb76d4c021167fba9
7
- data.tar.gz: ecef6c648cd16239a594e8f6df5a6cd45699362beb921fb71a42c349b44e2d387327aef0337e89ee11a1b826c40abaacafadd9580bdaf47d5b921f551e9b7284
6
+ metadata.gz: 6c74669ef536138bc842fb3b2867d68716e10b15af93ea73233593bad06c7c0f01494d30e29cba67c7a2526401a854bf6ad00b259829a2adcfe4795969dbbcb5
7
+ data.tar.gz: 169d399c99f5fddd984fedb81e3701b85e918da087546259e84989bbf5f17a0227a9787494a8f524c2a50d38eccfc4badab2e9810e3e0b5cecd5585bb85883ac
@@ -1,7 +1,4 @@
1
- /* @flow */
2
-
3
1
  import React, { useState } from 'react'
4
-
5
2
  import classnames from 'classnames'
6
3
 
7
4
  import { globalProps } from '../utilities/globalProps'
@@ -12,8 +9,8 @@ import CollapsibleMain from './child_kits/CollapsibleMain'
12
9
  import CollapsibleContext from './context'
13
10
 
14
11
  type CollapsibleProps = {
15
- children: CollapsibleMain | CollapsibleContent | ReactNode,
16
- aria?: object,
12
+ children?: JSX.Element | [],
13
+ aria?: {[key: string]: string},
17
14
  className?: string,
18
15
  collapsed?: boolean,
19
16
  data?: object,
@@ -21,6 +18,7 @@ type CollapsibleProps = {
21
18
  padding?: string,
22
19
  }
23
20
 
21
+
24
22
  const useCollapsible = (initial = false) => {
25
23
  const [collapsed, setCollapsed] = useState(initial)
26
24
 
@@ -41,7 +39,7 @@ const Collapsible = ({
41
39
  ...props
42
40
  }: CollapsibleProps) => {
43
41
  const [isCollapsed, collapse] = useCollapsible(collapsed)
44
- const CollapsibleParent = React.Children.toArray(children)
42
+ const CollapsibleParent = React.Children.toArray(children) as JSX.Element[]
45
43
 
46
44
  if (CollapsibleParent.length !== 2) {
47
45
  throw new Error('Collapsible requires <CollapsibleMain> and <CollapsibleContent> to function properly.')
@@ -1,5 +1,3 @@
1
- /* @flow */
2
-
3
1
  import classnames from 'classnames'
4
2
  import React, { useContext } from 'react'
5
3
  import AnimateHeight from 'react-animate-height'
@@ -8,8 +6,8 @@ import { globalProps } from '../../utilities/globalProps'
8
6
 
9
7
  import CollapsibleContext from '../context'
10
8
 
11
- type CollapsibleContentProps = {
12
- children: array<React.ReactNode> | React.ReactNode | string,
9
+ export type CollapsibleContentProps = {
10
+ children?: React.ReactNode[] | React.ReactNode | string,
13
11
  className?: string,
14
12
  padding?: string,
15
13
  }
@@ -20,7 +18,7 @@ const CollapsibleContent = ({
20
18
  padding = 'md',
21
19
  ...props
22
20
  }: CollapsibleContentProps) => {
23
- const context = useContext(CollapsibleContext)
21
+ const context: {[key: string]: boolean | string} = useContext(CollapsibleContext)
24
22
  const contentCSS = buildCss('pb_collapsible_content_kit')
25
23
  const contentSpacing = globalProps(props, { padding })
26
24
 
@@ -1,4 +1,3 @@
1
- /* @flow */
2
1
 
3
2
  import classnames from 'classnames'
4
3
  import React, { useContext } from 'react'
@@ -10,13 +9,14 @@ import FlexItem from '../../pb_flex/_flex_item'
10
9
  import CollapsibleContext from '../context'
11
10
 
12
11
  type CollapsibleMainProps = {
13
- children: array<React.ReactNode> | React.ReactNode,
12
+ children: React.ReactNode[] | React.ReactNode,
14
13
  className?: string,
15
14
  padding?: string,
15
+ cursor?: string
16
16
  }
17
17
 
18
18
  type IconProps = {
19
- collapsed: boolean
19
+ collapsed: boolean | (()=> void)
20
20
  }
21
21
 
22
22
  const Icon = ({ collapsed }: IconProps) => {
@@ -40,7 +40,7 @@ const CollapsibleMain = ({
40
40
 
41
41
  ...props
42
42
  }: CollapsibleMainProps) => {
43
- const context = useContext(CollapsibleContext)
43
+ const context: {[key: string]: (()=> void)} | boolean = useContext(CollapsibleContext)
44
44
  const mainCSS = buildCss('pb_collapsible_main_kit')
45
45
  const mainSpacing = globalProps(props, { cursor, padding })
46
46
 
@@ -0,0 +1 @@
1
+ declare module 'react-animate-height'
@@ -23,6 +23,7 @@
23
23
  }
24
24
  [class^=pb_currency_wrapper] {
25
25
  display: flex;
26
+ align-items: baseline;
26
27
 
27
28
  &[class*=_deemphasized] [class^=pb_body_kit][class*=_light] {
28
29
  color: $text_lt_default;
@@ -48,7 +49,7 @@
48
49
 
49
50
  & > [class*=dollar_sign] {
50
51
  display: flex;
51
- align-items: flex-start;
52
+ align-self: flex-start;
52
53
  }
53
54
  & > [class*=unit] {
54
55
  display: flex;
@@ -150,8 +150,10 @@ const Dialog = (props: DialogProps) => {
150
150
  shouldCloseOnOverlayClick={shouldCloseOnOverlayClick}
151
151
  status={status}
152
152
  >
153
- <If condition={title && !status}>
153
+ <If condition={title}>
154
154
  <Dialog.Header>{title}</Dialog.Header>
155
+ </If>
156
+ <If condition={!status && text}>
155
157
  <Dialog.Body>{text}</Dialog.Body>
156
158
  </If>
157
159
  <If condition={status}>
@@ -1,26 +1,24 @@
1
- /* @flow */
2
-
3
1
  import React from 'react'
4
2
  import classnames from 'classnames'
5
3
  import { globalProps } from '../utilities/globalProps'
6
4
 
7
5
  type DistributionBarProps = {
8
6
  className?: string,
9
- colors: array,
7
+ colors: [],
10
8
  data?: string,
11
9
  id?: string,
12
10
  size?: "lg" | "sm",
13
- widths?: array<number>,
11
+ widths?: number[],
14
12
  }
15
13
 
16
- const normalizeCharacters = (widths) => {
14
+ const normalizeCharacters = (widths: number[]) => {
17
15
  return widths.map((width) => {
18
16
  return parseInt(width.toString().replace(/[^0-9.]/gi, ''))
19
17
  })
20
18
  }
21
19
 
22
- const barValues = (normalizedValues, colors) => {
23
- const arrSum = (value) => value.reduce((a, b) => a + b, 0)
20
+ const barValues = (normalizedValues: number[], colors: []) => {
21
+ const arrSum = (value: number[]) => value.reduce((a, b) => a + b, 0)
24
22
  const widthSum = arrSum(normalizedValues)
25
23
  return normalizedValues.map((value, i) => {
26
24
  return (
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import DistributionBar from '../_distribution_bar.jsx'
2
+ import DistributionBar from '../_distribution_bar'
3
3
 
4
4
  const DistributionBarCustomColors = (props) => {
5
5
  return (
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import DistributionBar from '../_distribution_bar.jsx'
2
+ import DistributionBar from '../_distribution_bar'
3
3
 
4
4
  const DistributionBarDefault = (props) => {
5
5
  return (
@@ -19,14 +19,12 @@ module Playbook
19
19
  prop :tabindex
20
20
 
21
21
  def list_classname
22
- [
23
- "pb_list_kit",
24
- xpadding_class,
25
- borderless_class,
26
- dark_class,
27
- size_class,
28
- layout_class,
29
- ].compact.join("_")
22
+ generate_classname("pb_list_kit",
23
+ xpadding_class,
24
+ borderless_class,
25
+ dark_class,
26
+ size_class,
27
+ layout_class)
30
28
  end
31
29
 
32
30
  def ordered_class
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playbook
4
- PREVIOUS_VERSION = "11.2.4"
5
- VERSION = "11.2.5"
4
+ PREVIOUS_VERSION = "11.2.7"
5
+ VERSION = "11.3.0"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 11.2.5
4
+ version: 11.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-08-10 00:00:00.000000000 Z
12
+ date: 2022-08-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -567,10 +567,10 @@ files:
567
567
  - app/pb_kits/playbook/pb_circle_icon_button/docs/_footer.md
568
568
  - app/pb_kits/playbook/pb_circle_icon_button/docs/example.yml
569
569
  - app/pb_kits/playbook/pb_circle_icon_button/docs/index.js
570
- - app/pb_kits/playbook/pb_collapsible/_collapsible.jsx
571
570
  - app/pb_kits/playbook/pb_collapsible/_collapsible.scss
572
- - app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.jsx
573
- - app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.jsx
571
+ - app/pb_kits/playbook/pb_collapsible/_collapsible.tsx
572
+ - app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.tsx
573
+ - app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx
574
574
  - app/pb_kits/playbook/pb_collapsible/collapsible.html.erb
575
575
  - app/pb_kits/playbook/pb_collapsible/collapsible.rb
576
576
  - app/pb_kits/playbook/pb_collapsible/collapsible.test.js
@@ -578,12 +578,13 @@ files:
578
578
  - app/pb_kits/playbook/pb_collapsible/collapsible_content.rb
579
579
  - app/pb_kits/playbook/pb_collapsible/collapsible_main.html.erb
580
580
  - app/pb_kits/playbook/pb_collapsible/collapsible_main.rb
581
- - app/pb_kits/playbook/pb_collapsible/context.js
581
+ - app/pb_kits/playbook/pb_collapsible/context.ts
582
582
  - app/pb_kits/playbook/pb_collapsible/docs/_collapsible_default.html.erb
583
583
  - app/pb_kits/playbook/pb_collapsible/docs/_collapsible_default.jsx
584
584
  - app/pb_kits/playbook/pb_collapsible/docs/example.yml
585
585
  - app/pb_kits/playbook/pb_collapsible/docs/index.js
586
586
  - app/pb_kits/playbook/pb_collapsible/index.js
587
+ - app/pb_kits/playbook/pb_collapsible/types.d.ts
587
588
  - app/pb_kits/playbook/pb_contact/_contact.scss
588
589
  - app/pb_kits/playbook/pb_contact/_contact.tsx
589
590
  - app/pb_kits/playbook/pb_contact/contact.html.erb
@@ -809,8 +810,8 @@ files:
809
810
  - app/pb_kits/playbook/pb_dialog/docs/_dialog_status.md
810
811
  - app/pb_kits/playbook/pb_dialog/docs/example.yml
811
812
  - app/pb_kits/playbook/pb_dialog/docs/index.js
812
- - app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.jsx
813
813
  - app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.scss
814
+ - app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.tsx
814
815
  - app/pb_kits/playbook/pb_distribution_bar/distribution_bar.html.erb
815
816
  - app/pb_kits/playbook/pb_distribution_bar/distribution_bar.rb
816
817
  - app/pb_kits/playbook/pb_distribution_bar/docs/_description.md