playbook_ui 13.16.0.pre.alpha.play1141iconkitusinglibrary1993 → 13.16.0.pre.alpha.play1141iconkitusinglibrary2037

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_icon/_icon.scss +48 -6
  3. data/app/pb_kits/playbook/pb_icon/_icon.tsx +89 -30
  4. data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.md +10 -0
  5. data/app/pb_kits/playbook/pb_icon/icon.rb +23 -1
  6. data/app/pb_kits/playbook/pb_label_value/_label_value.tsx +1 -1
  7. data/app/pb_kits/playbook/pb_layout/_layout.tsx +2 -1
  8. data/app/pb_kits/playbook/pb_layout/layout.test.js +8 -4
  9. data/app/pb_kits/playbook/pb_legend/_legend.tsx +6 -6
  10. data/app/pb_kits/playbook/pb_lightbox/Carousel/Slides.tsx +4 -4
  11. data/app/pb_kits/playbook/pb_lightbox/Carousel/Thumbnail.tsx +1 -1
  12. data/app/pb_kits/playbook/pb_lightbox/Carousel/index.tsx +3 -3
  13. data/app/pb_kits/playbook/pb_lightbox/Header/_lightbox_header.tsx +30 -22
  14. data/app/pb_kits/playbook/pb_lightbox/_lightbox.tsx +5 -5
  15. data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +4 -4
  16. data/app/pb_kits/playbook/pb_list/_list.tsx +15 -15
  17. data/app/pb_kits/playbook/pb_list/_list_item.tsx +1 -1
  18. data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +9 -9
  19. data/app/pb_kits/playbook/pb_map/_map.tsx +8 -8
  20. data/app/pb_kits/playbook/pb_map/_map_controls.tsx +15 -7
  21. data/app/pb_kits/playbook/pb_map/_map_custom_button.tsx +4 -2
  22. data/app/pb_kits/playbook/pb_message/_message.tsx +1 -1
  23. data/app/pb_kits/playbook/pb_message/_message_mention.tsx +6 -6
  24. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +46 -42
  25. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +20 -20
  26. data/app/pb_kits/playbook/pb_nav/_item.tsx +56 -47
  27. data/app/pb_kits/playbook/pb_nav/_nav.tsx +15 -15
  28. data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +1 -1
  29. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.jsx +4 -2
  30. data/dist/playbook-rails.js +14 -6
  31. data/lib/playbook/version.rb +1 -1
  32. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8bc3dd349d844e27e7f58519da152f82f91f5e3bff1127a68334b50ca0cc4ce6
4
- data.tar.gz: 492f133650dfbe9d1a6bd971f3dc2d70df83d65d93e3c23ffdbf5efb2f58d0df
3
+ metadata.gz: aacf67192ce6bb0e2e2f018a81f6eb9ee56a54310767565636d1ab5af1a19835
4
+ data.tar.gz: 94f4777ec071fb07e296d840927f923a17214b100104b3a4d8ed282f385dc906
5
5
  SHA512:
6
- metadata.gz: 5f21ae991fb51fe768b44ff0f743473e7e1ceed79aed2bf3a5d191ed5cbfc60e04a32dc8ea49ee203f953e7b197646d054d72bd6e1641ea7eeb0ce69c4de14f1
7
- data.tar.gz: 921c84a3cb9c9a50db38257f481ff0a7ccd6bbb88753a0ba384a82b8e3d079debb7d540cd816d549f1ea028c64ed13bb031faf2cde8a95495e8bec45ebba8881
6
+ metadata.gz: b3a4a218afa0fc0ba1d98a2dd67569873911f9c7a1d73674e4073c72852f54a739a2a8227562ed14732ae92ebe14a040c2688ee3b301d2cf33522c79b2c448d4
7
+ data.tar.gz: e44dfb1e1e91896744dc99f1fb65183c28652dbb98ab0339a989050c532f8af1f5743fc448f0586ac1ba4e267346fba56c55ea7913c95b9d6e516236f979e93e
@@ -1,9 +1,51 @@
1
- // Rails custom icon styles
2
- svg.pb_custom_icon {
3
- width: 1em;
4
- fill: currentColor;
5
- path {
6
- fill: currentColor;
1
+ $rotate-list: (90, 180, 270);
2
+ $flip-list: (
3
+ "horizontal": (-1, 1),
4
+ "vertical": (1, -1),
5
+ "both": (-1, -1)
6
+ );
7
+
8
+ @keyframes pb_icon_spin {
9
+ 0% {
10
+ -webkit-transform: rotate(0);
11
+ transform: rotate(0);
12
+ }
13
+ 100% {
14
+ -webkit-transform: rotate(360deg);
15
+ transform: rotate(360deg);
16
+ }
17
+ };
18
+
19
+ svg {
20
+ &.pb_icon_kit {
21
+ @each $r in $rotate-list {
22
+ &.rotate_#{$r} {
23
+ transform: rotate(#{$r}deg);
24
+ }
25
+ }
26
+ @each $f, $v in $flip-list {
27
+ &.flip_#{$f} {
28
+ transform: scale($v);
29
+ }
30
+ }
31
+ &.pb_custom_icon path {
32
+ fill: currentColor;
33
+ }
34
+ &.pulse {
35
+ animation-name: pb_icon_spin;
36
+ animation-direction: normal;
37
+ animation-duration: 1s;
38
+ animation-iteration-count: infinite;
39
+ animation-timing-function: steps(8);
40
+ }
41
+ &.spin {
42
+ animation-name: pb_icon_spin;
43
+ animation-delay: 0s;
44
+ animation-direction: normal;
45
+ animation-duration: 2s;
46
+ animation-iteration-count: infinite;
47
+ animation-timing-function: linear;
48
+ }
7
49
  }
8
50
  }
9
51
 
@@ -4,10 +4,11 @@ import { buildAriaProps, buildDataProps, buildHtmlProps } from '../utilities/pro
4
4
  import { GlobalProps, globalProps } from '../utilities/globalProps'
5
5
  import { isValidEmoji } from '../utilities/validEmojiChecker'
6
6
 
7
- export type IconSizes = "lg"
7
+ type IconSizeNames = "lg"
8
8
  | "xs"
9
9
  | "sm"
10
- | "1x"
10
+
11
+ export type IconSizes = IconSizeNames | "1x"
11
12
  | "2x"
12
13
  | "3x"
13
14
  | "4x"
@@ -21,6 +22,7 @@ export type IconSizes = "lg"
21
22
 
22
23
  type IconProps = {
23
24
  aria?: {[key: string]: string},
25
+ aspectRatio?: string,
24
26
  border?: string,
25
27
  className?: string,
26
28
  customIcon?: {[key: string] :SVGElement},
@@ -40,16 +42,66 @@ type IconProps = {
40
42
  spin?: boolean,
41
43
  } & GlobalProps
42
44
 
45
+ const iconSizeMap = {
46
+ base: 16,
47
+ xs: .75,
48
+ sm: .875,
49
+ lg: 1.25
50
+ }
51
+
52
+ const getSvgDimensions = (aspectRatio = '1:1', size: string): {width: number, height: number} | null => {
53
+ if (!size) return null
54
+ const aspect = aspectRatio.split(':')
55
+
56
+ const scale = size.toLowerCase().includes('x') ?
57
+ parseInt(size.replace(/\x/i, '')) :
58
+ iconSizeMap[size as IconSizeNames]
59
+
60
+ return {
61
+ width: (iconSizeMap.base * scale) * parseInt(aspect[0]),
62
+ height: (iconSizeMap.base * scale) * parseInt(aspect[1])
63
+ }
64
+ }
65
+
43
66
  const flipMap = {
44
- horizontal: 'fa-flip-horizontal',
45
- vertical: 'fa-flip-vertical',
46
- both: 'fa-flip-horizontal fa-flip-vertical',
47
- none: ""
67
+ fa: {
68
+ horizontal: 'fa-flip-horizontal',
69
+ vertical: 'fa-flip-vertical',
70
+ both: 'fa-flip-horizontal fa-flip-vertical',
71
+ none: ''
72
+ },
73
+ svg: {
74
+ horizontal: 'flip_horizontal',
75
+ vertical: 'flip_vertical',
76
+ both: 'flip_horizontal flip_vertical',
77
+ none: ''
78
+ }
79
+ }
80
+ const pulseMap = {
81
+ fa: 'fa-pulse',
82
+ svg: 'pulse'
83
+ }
84
+ const spinMap = {
85
+ fa: 'fa-spin',
86
+ svg: 'spin'
87
+ }
88
+ const rotateMap = {
89
+ fa: {
90
+ 90: 'fa-rotate-90',
91
+ 180: 'fa-rotate-180',
92
+ 270: 'fa-rotate-270'
93
+ },
94
+ svg: {
95
+ 90: 'rotate_90',
96
+ 180: 'rotate_180',
97
+ 270: 'rotate_270'
98
+ }
48
99
  }
49
100
 
50
101
  const Icon = (props: IconProps) => {
51
102
  const {
52
103
  aria = {},
104
+ aspectRatio,
53
105
  border = false,
54
106
  className,
55
107
  customIcon,
@@ -64,7 +116,7 @@ const Icon = (props: IconProps) => {
64
116
  pull,
65
117
  pulse = false,
66
118
  rotation,
67
- size,
119
+ size = '1x',
68
120
  fontStyle = 'far',
69
121
  spin = false,
70
122
  } = props
@@ -72,31 +124,37 @@ const Icon = (props: IconProps) => {
72
124
  const iconURL = typeof(icon) === 'string' && icon.includes('.svg') ? icon : null
73
125
  const iconElement: ReactSVGElement | null = typeof(icon) === "object" ? icon : null
74
126
 
75
- const faClasses = {
76
- 'fa-border': border,
77
- 'fa-fw': (iconElement) ? false : fixedWidth,
78
- 'fa-inverse': inverse,
79
- 'fa-li': listItem,
80
- 'fa-pulse': pulse,
81
- 'fa-spin': spin,
82
- [`fa-${size}`]: size,
83
- [`fa-pull-${pull}`]: pull,
84
- [`fa-rotate-${rotation}`]: rotation,
85
- }
86
-
87
127
  const isFA = !iconElement && !customIcon && !iconURL
128
+ const svgProps = isFA ? null : {...{fill: 'currentColor'}, ...getSvgDimensions(aspectRatio, size)}
88
129
 
89
- if (isFA) faClasses[`fa-${icon}`] = icon as string
90
-
91
- const classes = classnames(
92
- flipMap[flip],
130
+ let classes = classnames(
93
131
  'pb_icon_kit',
94
- (iconElement || customIcon) ? '' : fontStyle,
95
- faClasses,
132
+ isFA ? fontStyle : null,
96
133
  globalProps(props),
97
134
  className
98
135
  )
99
136
 
137
+ const transformClasses = classnames(
138
+ flip ? flipMap[isFA ? 'fa' : 'svg'][flip] : null,
139
+ pulse ? pulseMap[isFA ? 'fa' : 'svg'] : null,
140
+ rotation ? rotateMap[isFA ? 'fa' : 'svg'][rotation] : null,
141
+ spin ? spinMap[isFA ? 'fa' : 'svg'] : null,
142
+ )
143
+ classes += ` ${transformClasses}`
144
+
145
+ if (isFA) {
146
+ const faClassList = {
147
+ 'fa-border': border,
148
+ 'fa-fw': (iconElement) ? false : fixedWidth,
149
+ 'fa-inverse': inverse,
150
+ 'fa-li': listItem,
151
+ [`fa-${size}`]: size,
152
+ [`fa-pull-${pull}`]: pull,
153
+ }
154
+ faClassList[`fa-${icon}`] = icon as string
155
+ classes += ` ${classnames(faClassList)}`
156
+ }
157
+
100
158
  const classesEmoji = classnames(
101
159
  'pb_icon_kit_emoji',
102
160
  globalProps(props),
@@ -117,6 +175,7 @@ const Icon = (props: IconProps) => {
117
175
  React.cloneElement(iconElement || customIcon, {
118
176
  ...dataProps,
119
177
  ...htmlProps,
178
+ ...svgProps,
120
179
  className: classes,
121
180
  id,
122
181
  })
@@ -139,14 +198,14 @@ const Icon = (props: IconProps) => {
139
198
  else if (iconURL)
140
199
  return (
141
200
  <>
142
- <span
201
+ <img
143
202
  {...dataProps}
144
203
  {...htmlProps}
145
- className={classesEmoji}
204
+ {...svgProps}
205
+ className={classes}
146
206
  id={id}
147
- >
148
- <img src={iconURL} />
149
- </span>
207
+ src={iconURL}
208
+ />
150
209
  </>
151
210
  )
152
211
  else
@@ -1,5 +1,15 @@
1
1
  # Tips for Custom Icons
2
2
 
3
+ When using custom icons it is important to introduce a "clean" SVG. In order to ensure these custom icons perform as intended within your kit(s), ensure these things have been modified from the original SVG markup:
4
+
5
+ Attributes must be React compatible e.g. <code>xmlns:xlink</code> should be <code>xmlnsXlink</code> and so on. <strong>There should be no hyphenated attributes and no semi-colons!.</strong>
6
+
7
+ Fill colors with regards to <code>g</code> or <code>path</code> nodes, e.g. <code>fill="black"</code>, should be replaced with <code>currentColor</code> ala <code>fill="currentColor"</code>. Your mileage may vary depending on the complexity of your SVG.
8
+
9
+ Pay attention to your custom icon's dimensions and `viewBox` attribute. It is best to use a `viewBox="0 0 512 512"` starting point **when designing instead of trying to retrofit the viewbox afterwards**!
10
+
11
+ You must source _your own SVG into component/view_ you are working on. This can easily be done in programmatic and maintainable ways.
12
+
3
13
  ### React
4
14
 
5
15
  - Providing a valid React `<SVG>` element to the `icon` prop results in an `<SVG>` node within the working view.
@@ -83,15 +83,37 @@ module Playbook
83
83
  doc = Nokogiri::XML(URI.open(icon || custom_icon)) # rubocop:disable Security/Open
84
84
  svg = doc.at_css "svg"
85
85
  svg["class"] = "pb_custom_icon " + object.custom_icon_classname
86
+ svg["height"] = svg_dims[svg_size] * 16
87
+ svg["width"] = svg_dims[svg_size] * 16
86
88
  raw doc
87
89
  end
88
90
 
89
91
  def is_svg?
90
- (icon || custom_icon).include?(".svg")
92
+ (icon || custom_icon.to_s).include?(".svg")
91
93
  end
92
94
 
93
95
  private
94
96
 
97
+ def svg_size
98
+ size.nil? ? "1x" : size
99
+ end
100
+
101
+ def svg_dims
102
+ { "lg" => 1.25,
103
+ "xs" => 0.75,
104
+ "sm" => 0.875,
105
+ "1x" => 1,
106
+ "2x" => 2,
107
+ "3x" => 3,
108
+ "4x" => 4,
109
+ "5x" => 5,
110
+ "6x" => 6,
111
+ "7x" => 7,
112
+ "8x" => 8,
113
+ "9x" => 9,
114
+ "10x" => 10 }
115
+ end
116
+
95
117
  def border_class
96
118
  border ? "fa-border" : nil
97
119
  end
@@ -15,7 +15,7 @@ type LabelValueProps = {
15
15
  aria?: { [key: string]: string };
16
16
  className?: string;
17
17
  dark?: boolean;
18
- data?: object;
18
+ data?: Record<string, unknown>;
19
19
  date?: Date;
20
20
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
21
21
  id?: string;
@@ -10,7 +10,7 @@ type LayoutPropTypes = {
10
10
  className?: string,
11
11
  collapse?: "xs" | "sm" | "md" | "lg" | "xl",
12
12
  dark?: boolean,
13
- data?: object,
13
+ data?: Record<string, unknown>,
14
14
  full?: boolean,
15
15
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
16
16
  position?: "left" | "right",
@@ -168,6 +168,7 @@ const Layout = (props: LayoutPropTypes) => {
168
168
  layoutCss,
169
169
  layoutCollapseCss,
170
170
  className,
171
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
171
172
  //@ts-ignore
172
173
  globalProps(filteredProps)
173
174
  )}
@@ -16,7 +16,8 @@ test("render all color variants", () => {
16
16
  testValues.forEach((variant) => {
17
17
  const { getByTestId } = render(
18
18
  <LayoutTest data={{ testid: `test-${variant}` }}
19
- variant={variant} />
19
+ variant={variant}
20
+ />
20
21
  )
21
22
  expect(getByTestId(`test-${variant}`)).toHaveClass(
22
23
  `pb_layout_kit_sidebar_size_md_left_${
@@ -33,7 +34,8 @@ test("render transparent class", () => {
33
34
 
34
35
  const { getByTestId } = render(
35
36
  <LayoutTest data={{ testid: `test-${id}` }}
36
- variant={id} />
37
+ variant={id}
38
+ />
37
39
  )
38
40
  expect(getByTestId(`test-${id}`)).toHaveClass(
39
41
  `pb_layout_kit_sidebar_size_md_left_${id}`
@@ -47,7 +49,8 @@ test("render all sizes variants", () => {
47
49
  testValues.forEach((size) => {
48
50
  const { getByTestId } = render(
49
51
  <LayoutTest data={{ testid: `test-${size}` }}
50
- size={size} />
52
+ size={size}
53
+ />
51
54
  )
52
55
  expect(getByTestId(`test-${size}`)).toHaveClass(
53
56
  `pb_layout_kit_sidebar_size_${size}_left_light`
@@ -84,7 +87,8 @@ test("render all layout variants", () => {
84
87
  testValues.forEach(({ layout, expected }) => {
85
88
  const { getByTestId } = render(
86
89
  <Layout data={{ testid: `test-${layout}` }}
87
- layout={layout}>
90
+ layout={layout}
91
+ >
88
92
  <Layout.Body>
89
93
  <Card>{"Card content"}</Card>
90
94
  </Layout.Body>
@@ -12,7 +12,7 @@ type LegendProps = {
12
12
  className?: string,
13
13
  color?: string,
14
14
  dark?: boolean,
15
- data?: object,
15
+ data?: Record<string, unknown>,
16
16
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
17
17
  id?: string,
18
18
  prefixText?: string,
@@ -64,11 +64,11 @@ const Legend = (props: LegendProps) => {
64
64
  {
65
65
  prefixText && (
66
66
  <Title
67
- dark={dark}
68
- size={4}
69
- tag="span"
70
- text={` ${prefixText} `}
71
- />
67
+ dark={dark}
68
+ size={4}
69
+ tag="span"
70
+ text={` ${prefixText} `}
71
+ />
72
72
  )
73
73
  }
74
74
  {` ${text} `}
@@ -56,15 +56,15 @@ const arrowRight = () => setIndex(current < urls.length - 1 ? current + 1 : urls
56
56
  return (
57
57
  <div
58
58
  className="Slides"
59
- onTouchStart={onTouchStart}
59
+ onTouchEnd={onTouchEnd}
60
60
  onTouchMove={onTouchMove}
61
- onTouchEnd={onTouchEnd}
61
+ onTouchStart={onTouchStart}
62
62
  >
63
63
  {
64
64
  urls.length > 1 && (
65
65
  <CircleIconButton
66
66
  className='carousel-arrow-left'
67
- dark={true}
67
+ dark
68
68
  icon="chevron-left"
69
69
  onClick={arrowLeft}
70
70
  variant="link"
@@ -81,7 +81,7 @@ const arrowRight = () => setIndex(current < urls.length - 1 ? current + 1 : urls
81
81
  urls.length > 1 && (
82
82
  <CircleIconButton
83
83
  className='carousel-arrow-right'
84
- dark={true}
84
+ dark
85
85
  icon="chevron-right"
86
86
  onClick={arrowRight}
87
87
  variant="link"
@@ -16,7 +16,7 @@ export default function Thumbnail({
16
16
  alt,
17
17
  width,
18
18
  url,
19
- onClick = ()=>{},
19
+ onClick,
20
20
  buttonRef,
21
21
  }: ThumbnailType): React.ReactElement {
22
22
  const activeClasses = classnames('Thumbnail', { active })
@@ -20,8 +20,8 @@ type CarouselType = {
20
20
  export default function Carousel({
21
21
  currentIndex,
22
22
  photos,
23
- onClick = ()=>{},
24
- onChange = ()=>{},
23
+ onClick,
24
+ onChange = () => undefined,
25
25
  setIndex,
26
26
  }: CarouselType): React.ReactElement {
27
27
  useEffect(() => {
@@ -39,10 +39,10 @@ export default function Carousel({
39
39
  return (
40
40
  <div className="Lightbox">
41
41
  <Slides
42
- setIndex={setIndex}
43
42
  current={currentIndex}
44
43
  onChange={handleChange}
45
44
  onClick={onClick}
45
+ setIndex={setIndex}
46
46
  urls={photos.map((photo) => photo.url)}
47
47
  />
48
48
  {photos.length > 1 ? (
@@ -61,23 +61,31 @@ const LightboxHeader = (props: LightboxHeaderProps): React.ReactElement => {
61
61
 
62
62
  const HeaderBody = () => (
63
63
  <React.Fragment>
64
- <FlexItem flex="1" marginLeft="sm">
64
+ <FlexItem flex="1"
65
+ marginLeft="sm"
66
+ >
65
67
  <CircleIconButton
66
- onClick={handleOnLightboxClose}
67
- dark={true}
68
- variant="link"
69
- icon={icon}
68
+ dark
69
+ icon={icon}
70
+ onClick={handleOnLightboxClose}
71
+ variant="link"
70
72
  />
71
73
  </FlexItem>
72
74
  {title && text && (
73
75
  <FlexItem flex="5">
74
76
  <Flex justify="center">
75
- <Flex align="center" orientation="column">
77
+ <Flex align="center"
78
+ orientation="column"
79
+ >
76
80
  {typeof title === "string" ? (
77
- <Title dark paddingBottom="xxs" size={4} text={title} />
81
+ <Title dark
82
+ paddingBottom="xxs"
83
+ size={4}
84
+ text={title}
85
+ />
78
86
  ) : (
79
- <Flex justify="center"
80
- className="custom-header"
87
+ <Flex className="custom-header"
88
+ justify="center"
81
89
  >
82
90
  {title}
83
91
  </Flex>
@@ -86,8 +94,8 @@ const LightboxHeader = (props: LightboxHeaderProps): React.ReactElement => {
86
94
  {typeof text === "string" ? (
87
95
  <Caption dark>{text}</Caption>
88
96
  ) : (
89
- <Flex justify="center"
90
- className="custom-header"
97
+ <Flex className="custom-header"
98
+ justify="center"
91
99
  >
92
100
  {text}
93
101
  </Flex>
@@ -99,12 +107,12 @@ const LightboxHeader = (props: LightboxHeaderProps): React.ReactElement => {
99
107
  <FlexItem flex="1">
100
108
  <Flex justify="end">
101
109
  <Button
102
- className="nav-right-btn"
103
- htmlType="button"
104
- onClick={onClickRight}
105
- dark
106
- variant="link"
107
- text={navRight}
110
+ className="nav-right-btn"
111
+ dark
112
+ htmlType="button"
113
+ onClick={onClickRight}
114
+ text={navRight}
115
+ variant="link"
108
116
  />
109
117
  </Flex>
110
118
  </FlexItem>
@@ -114,11 +122,11 @@ const LightboxHeader = (props: LightboxHeaderProps): React.ReactElement => {
114
122
  return (
115
123
  <div className="carousel-header">
116
124
  <Flex
117
- {...ariaProps}
118
- {...dataProps}
119
- {...htmlProps}
120
- className={classnames(headerCSS, headerSpacing, className)}
121
- spacing={spacing}
125
+ {...ariaProps}
126
+ {...dataProps}
127
+ {...htmlProps}
128
+ className={classnames(headerCSS, headerSpacing, className)}
129
+ spacing={spacing}
122
130
  >
123
131
  {closeable && <HeaderBody />}
124
132
  {children}
@@ -19,7 +19,7 @@ type LightboxType = {
19
19
  id?: string,
20
20
  photos: [],
21
21
  initialPhoto?: number,
22
- onChange?: (index: number)=> {},
22
+ onChange?: (index: number)=> void,
23
23
  onClickRight?: () => void,
24
24
  onClose?: () => void,
25
25
  icon: string,
@@ -40,7 +40,7 @@ const Lightbox = (props: LightboxType): React.ReactNode => {
40
40
  id = '',
41
41
  initialPhoto = 0,
42
42
  photos,
43
- onChange = ()=>{},
43
+ onChange = () => undefined,
44
44
  onClose,
45
45
  onClickRight,
46
46
  icon = 'times',
@@ -107,18 +107,18 @@ const Lightbox = (props: LightboxType): React.ReactNode => {
107
107
  <div className="carousel">
108
108
  <Lightbox.Header
109
109
  icon={icon}
110
- onClose={onClose}
110
+ navRight={navRight}
111
111
  onClickRight={onClickRight}
112
+ onClose={onClose}
112
113
  text={description}
113
- navRight={navRight}
114
114
  title={title}
115
115
  />
116
116
  {children}
117
117
  <Carousel
118
- setIndex={setActivePhoto}
119
118
  currentIndex={activePhoto}
120
119
  onChange={handleOnSlide}
121
120
  photos={photosMap}
121
+ setIndex={setActivePhoto}
122
122
  />
123
123
  </div>
124
124
  </div>
@@ -12,7 +12,7 @@ import mapColors from "../pb_dashboard/pbChartsColorsHelper";
12
12
  type LineGraphProps = {
13
13
  align?: "left" | "right" | "center";
14
14
  axisTitle?: string;
15
- dark?: Boolean;
15
+ dark?: boolean;
16
16
  xAxisCategories: [];
17
17
  yAxisMin: number;
18
18
  yAxisMax: number;
@@ -138,15 +138,15 @@ const LineGraph = ({
138
138
 
139
139
  return (
140
140
  <HighchartsReact
141
- containerProps={{
141
+ containerProps={{
142
142
  className: classnames(globalProps(props), className),
143
143
  id: id,
144
144
  ...ariaProps,
145
145
  ...dataProps,
146
146
  ...htmlProps
147
147
  }}
148
- highcharts={Highcharts}
149
- options={options}
148
+ highcharts={Highcharts}
149
+ options={options}
150
150
  />
151
151
  );
152
152
  };
@@ -9,7 +9,7 @@ type ListProps = {
9
9
  className?: string;
10
10
  children: React.ReactNode[] | React.ReactNode;
11
11
  dark?: boolean;
12
- data?: object;
12
+ data?: Record<string, unknown>;
13
13
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
14
14
  id?: string;
15
15
  layout?: "" | "left" | "right";
@@ -72,25 +72,25 @@ const List = (props: ListProps) => {
72
72
  <div className={classes}>
73
73
  {ordered ? (
74
74
  <ol
75
- {...ariaProps}
76
- {...dataProps}
77
- {...htmlProps}
78
- className={className}
79
- id={id}
80
- role={role}
81
- tabIndex={tabIndex}
75
+ {...ariaProps}
76
+ {...dataProps}
77
+ {...htmlProps}
78
+ className={className}
79
+ id={id}
80
+ role={role}
81
+ tabIndex={tabIndex}
82
82
  >
83
83
  {childrenWithProps}
84
84
  </ol>
85
85
  ) : (
86
86
  <ul
87
- {...ariaProps}
88
- {...dataProps}
89
- {...htmlProps}
90
- className={className}
91
- id={id}
92
- role={role}
93
- tabIndex={tabIndex}
87
+ {...ariaProps}
88
+ {...dataProps}
89
+ {...htmlProps}
90
+ className={className}
91
+ id={id}
92
+ role={role}
93
+ tabIndex={tabIndex}
94
94
  >
95
95
  {childrenWithProps}
96
96
  </ul>