playbook_ui 14.8.0.pre.alpha.PLAY1649rolloutheightglobalprops4635 → 14.8.0.pre.alpha.PLAY1680newwidthprop4661

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: db8ee9f13c7629142d8ebee9009fe589989ec0a27cf7cb7177adf16d52ffa1d3
4
- data.tar.gz: c793285b7a81d5ff14d5caba6ec65320c00763fba4fc01d9d388794bc684289a
3
+ metadata.gz: 470ceb2308e2f5f036f019c0ae83adb3446f845a4e83f75560b0a2d6b1bec89b
4
+ data.tar.gz: 0a443da489c1d1242379a99ec020a709e4f24e03b1c65b148aefb50d91f06bc1
5
5
  SHA512:
6
- metadata.gz: 9768ae568bb5b7688320d5c6fc48dee29c5f551614622c2e0f5ce9f0efe08b91891a5ef5798b912aed744e9c0cb6cea69a7a3fdb1046dcbe528cd8d760f634cc
7
- data.tar.gz: e33ec41098720c971d57a925d57d9f77882e977bfea8273c60c4ff87b8b4302cdf323f51fe629a79f343c7db729a2ca9061feed631229c9818c39b6207759204
6
+ metadata.gz: a9fc193798b1eff208434da829db369218807400c99f6b3b601282b3f3a4ad10107ffb75ac93a647aa0bf92fa4d2c1692d987bd183500bbcd0fe105ddd18df8b
7
+ data.tar.gz: 58cc3188841d723a6d402b79b9c964bda66d33a88db3c90c1fa0753fcf220af9bb4e0850603519c4558eac64b98528024b544babab98f1ecd9efc5c10eb8e04a
@@ -111,6 +111,7 @@
111
111
  @import 'utilities/mixins';
112
112
  @import 'utilities/spacing';
113
113
  @import 'utilities/cursor';
114
+ @import 'utilities/width';
114
115
  @import 'utilities/min_width';
115
116
  @import 'utilities/max_width';
116
117
  @import 'utilities/positioning';
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect, useState } from 'react'
2
2
  import classnames from 'classnames'
3
3
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
4
- import { GlobalProps, globalProps, globalInlineProps } from '../utilities/globalProps'
4
+ import { GlobalProps, globalProps } from '../utilities/globalProps'
5
5
 
6
6
  type BackgroundColors = 'gradient' |
7
7
  'dark' |'light' | 'white' | 'success' | 'warning' | 'error' | 'info' | 'neutral' | 'primary' | 'shadow' |
@@ -145,12 +145,6 @@ const Background = (props: BackgroundProps): React.ReactElement => {
145
145
  } : {})
146
146
  };
147
147
 
148
- const dynamicInlineProps = globalInlineProps(props);
149
- const combinedStyles = {
150
- ...backgroundStyle,
151
- ...dynamicInlineProps
152
- };
153
-
154
148
  const Tag: React.ReactElement | any = `${tag}`;
155
149
  const ariaProps = buildAriaProps(aria);
156
150
  const dataProps = buildDataProps(data);
@@ -164,7 +158,7 @@ const Background = (props: BackgroundProps): React.ReactElement => {
164
158
  alt={alt}
165
159
  className={classes}
166
160
  id={id}
167
- style={combinedStyles}
161
+ style={backgroundStyle}
168
162
  >
169
163
  {children}
170
164
  </Tag>
@@ -2,7 +2,7 @@ import React, { useEffect, ReactElement } from 'react'
2
2
  import classnames from 'classnames'
3
3
  import useCollapsible from './useCollapsible'
4
4
 
5
- import { globalProps, globalInlineProps } from '../utilities/globalProps'
5
+ import { globalProps } from '../utilities/globalProps'
6
6
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
7
7
 
8
8
  import CollapsibleContent from './child_kits/CollapsibleContent'
@@ -75,7 +75,6 @@ const Collapsible = ({
75
75
  globalProps(props),
76
76
  className
77
77
  )
78
- const dynamicInlineProps = globalInlineProps(props)
79
78
  return (
80
79
  <CollapsibleContext.Provider value={{ collapsed: isCollapsed, toggle, icon, iconSize, iconColor, onIconClick, onClick }}>
81
80
  <div
@@ -84,7 +83,6 @@ const Collapsible = ({
84
83
  {...htmlProps}
85
84
  className={classes}
86
85
  id={id}
87
- style={dynamicInlineProps}
88
86
  >
89
87
  {Main ? (
90
88
  <CollapsibleMain {...mainProps}>
@@ -7,7 +7,7 @@ import {
7
7
  buildDataProps,
8
8
  buildHtmlProps,
9
9
  } from "../utilities/props";
10
- import { globalProps, globalInlineProps } from "../utilities/globalProps";
10
+ import { globalProps } from "../utilities/globalProps";
11
11
 
12
12
  import { DialogContext } from "../pb_dialog/_dialog_context";
13
13
 
@@ -101,8 +101,6 @@ const Drawer = (props: DrawerProps): React.ReactElement => {
101
101
 
102
102
  const classes = classnames(buildCss("pb_drawer_wrapper"), className);
103
103
 
104
- const dynamicInlineProps = globalInlineProps(props)
105
-
106
104
  const [triggerOpened, setTriggerOpened] = useState(false);
107
105
 
108
106
  const breakpointWidths: Record<DrawerProps["breakpoint"], number> = {
@@ -200,7 +198,6 @@ const Drawer = (props: DrawerProps): React.ReactElement => {
200
198
  {...dataProps}
201
199
  {...htmlProps}
202
200
  className={classes}
203
- style={dynamicInlineProps}
204
201
  >
205
202
  {isModalVisible && (
206
203
  <div
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import classnames from 'classnames'
3
- import { GlobalProps, globalProps, globalInlineProps } from '../utilities/globalProps'
3
+ import { GlobalProps, globalProps } from '../utilities/globalProps'
4
4
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
5
5
 
6
6
  type ImageType = {
@@ -41,7 +41,6 @@ const Image = (props: ImageType): React.ReactElement => {
41
41
  globalProps(props),
42
42
  className
43
43
  )
44
- const dynamicInlineProps = globalInlineProps(props)
45
44
  const dataProps = buildDataProps(data)
46
45
  const htmlProps = buildHtmlProps(htmlOptions)
47
46
 
@@ -57,7 +56,6 @@ const Image = (props: ImageType): React.ReactElement => {
57
56
  id={id}
58
57
  onError={onError}
59
58
  src={url}
60
- style={dynamicInlineProps}
61
59
  />
62
60
  )
63
61
  }
@@ -2,7 +2,7 @@ import React from 'react'
2
2
  import classnames from 'classnames'
3
3
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
4
4
 
5
- import { GlobalProps, globalProps, globalInlineProps } from '../utilities/globalProps'
5
+ import { globalProps } from '../utilities/globalProps'
6
6
 
7
7
  type LayoutPropTypes = {
8
8
  aria?: {[key: string]: string},
@@ -19,7 +19,7 @@ type LayoutPropTypes = {
19
19
  variant?: "light" | "dark" | "gradient",
20
20
  transparent?: boolean,
21
21
  layout?: "sidebar" | "collection" | "kanban" | "content" | "masonry",
22
- } & GlobalProps
22
+ }
23
23
 
24
24
  type LayoutSideProps = {
25
25
  children: React.ReactNode[] | React.ReactNode,
@@ -159,8 +159,6 @@ const Layout = (props: LayoutPropTypes) => {
159
159
  const filteredProps = {...props}
160
160
  delete filteredProps?.position
161
161
 
162
- const dynamicInlineProps = globalInlineProps(props)
163
-
164
162
  return (
165
163
  <div
166
164
  {...ariaProps}
@@ -173,8 +171,7 @@ const Layout = (props: LayoutPropTypes) => {
173
171
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
174
172
  //@ts-ignore
175
173
  globalProps(filteredProps)
176
- )}
177
- style={dynamicInlineProps}
174
+ )}
178
175
  >
179
176
  {subComponentTags('Side')}
180
177
  {nonSideChildren}
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import classnames from 'classnames'
3
3
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
4
- import { globalProps, globalInlineProps } from '../utilities/globalProps'
4
+ import { globalProps } from '../utilities/globalProps'
5
5
  import OverlayPercentage from './subcomponents/_overlay_percentage'
6
6
  import OverlayToken from './subcomponents/_overlay_token'
7
7
 
@@ -39,7 +39,6 @@ const Overlay = (props: OverlayProps) => {
39
39
  const dataProps = buildDataProps(data)
40
40
  const classes = classnames(buildCss('pb_overlay'), globalProps(props), className)
41
41
  const htmlProps = buildHtmlProps(htmlOptions)
42
- const dynamicInlineProps = globalInlineProps(props)
43
42
 
44
43
  const getPosition = () => {
45
44
  return Object.keys(layout)[0]
@@ -58,7 +57,6 @@ const Overlay = (props: OverlayProps) => {
58
57
  {...htmlProps}
59
58
  className={classes}
60
59
  id={id}
61
- style={dynamicInlineProps}
62
60
  >
63
61
  {isSizePercentage ?
64
62
  OverlayPercentage({
@@ -2,7 +2,7 @@ import React from 'react'
2
2
  import classnames from 'classnames'
3
3
 
4
4
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
5
- import { globalProps, globalInlineProps } from '../utilities/globalProps'
5
+ import { globalProps } from '../utilities/globalProps'
6
6
 
7
7
  import Caption from '../pb_caption/_caption'
8
8
 
@@ -38,7 +38,6 @@ const SectionSeparator = (props: SectionSeparatorProps): React.ReactElement => {
38
38
  const dataProps = buildDataProps(data)
39
39
  const htmlProps = buildHtmlProps(htmlOptions)
40
40
  const classes = classnames(buildCss('pb_section_separator_kit', variant, orientation, lineStyle === "dashed" ? lineStyle : ""), globalProps(props), className)
41
- const dynamicInlineProps = globalInlineProps(props)
42
41
 
43
42
  return (
44
43
 
@@ -48,7 +47,6 @@ const SectionSeparator = (props: SectionSeparatorProps): React.ReactElement => {
48
47
  {...htmlProps}
49
48
  className={classes}
50
49
  id={id}
51
- style={dynamicInlineProps}
52
50
  >
53
51
  {
54
52
  children && children ||
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect } from 'react'
2
2
  import classnames from 'classnames'
3
3
  import { buildAriaProps, buildDataProps, buildHtmlProps } from '../utilities/props'
4
- import { globalProps, GlobalProps, globalInlineProps } from '../utilities/globalProps'
4
+ import { globalProps, GlobalProps } from '../utilities/globalProps'
5
5
  import PbTable from '.'
6
6
  import {
7
7
  TableHead,
@@ -64,7 +64,6 @@ const Table = (props: TableProps): React.ReactElement => {
64
64
  const spaceCssName = outerPadding !== 'none' ? 'space_' : ''
65
65
  const outerPaddingCss = outerPadding ? `outer_padding_${spaceCssName}${outerPadding}` : ''
66
66
  const isTableTag = tag === 'table'
67
- const dynamicInlineProps = globalInlineProps(props)
68
67
 
69
68
  const classNames = classnames(
70
69
  'pb_table',
@@ -100,7 +99,6 @@ const Table = (props: TableProps): React.ReactElement => {
100
99
  {...htmlProps}
101
100
  className={classNames}
102
101
  id={id}
103
- style={dynamicInlineProps}
104
102
  >
105
103
  {children}
106
104
  </table>
@@ -1,31 +1,47 @@
1
- .max_width_xs {
2
- max-width: 360px;
3
- }
1
+ @import "../tokens/container";
2
+
4
3
  .max_width_0 {
5
- max-width: 0;
4
+ max-width: map-get($containers, 'none');
6
5
  }
6
+
7
7
  .max_width_none {
8
8
  max-width: none;
9
9
  }
10
10
 
11
+ .max_width_0_percent {
12
+ max-width: $container_0;
13
+ }
14
+
15
+ .max_width_xxs {
16
+ max-width: $container_xxs;
17
+ }
18
+
19
+ .max_width_xs {
20
+ max-width: $container_xs;
21
+ }
22
+
11
23
  .max_width_sm {
12
- max-width: 540px;
24
+ max-width: $container_sm;
13
25
  }
14
26
 
15
27
  .max_width_md {
16
- max-width: 720px;
28
+ max-width: $container_md;
17
29
  }
18
30
 
19
31
  .max_width_lg {
20
- max-width: 960px;
32
+ max-width: $container_lg;
21
33
  }
22
34
 
23
35
  .max_width_xl {
24
- max-width: 1140px;
36
+ max-width: $container_xl;
25
37
  }
26
38
 
27
39
  .max_width_xxl {
28
- max-width: 1320px;
40
+ max-width: $container_xxl;
41
+ }
42
+
43
+ .max_width_100_percent {
44
+ max-width: $container_100;
29
45
  }
30
46
 
31
47
  .width-resize {
@@ -4,7 +4,11 @@
4
4
  min-width: map-get($containers, 'none');
5
5
  }
6
6
 
7
- .min_with_0_percent {
7
+ .min_width_none {
8
+ min-width: none;
9
+ }
10
+
11
+ .min_width_0_percent {
8
12
  min-width: $container_0;
9
13
  }
10
14
 
@@ -0,0 +1,45 @@
1
+ @import "../tokens/container";
2
+
3
+ .width_none {
4
+ width: none;
5
+ }
6
+
7
+ .width_0 {
8
+ width: map-get($containers, 'none');
9
+ }
10
+
11
+ .width_0_percent {
12
+ width: map-get($containers, 'none');
13
+ }
14
+
15
+ .width_xxs {
16
+ width: $container_xxs;
17
+ }
18
+
19
+ .width_xs {
20
+ width: $container_xs;
21
+ }
22
+
23
+ .width_sm {
24
+ width: $container_sm;
25
+ }
26
+
27
+ .width_md {
28
+ width: $container_md;
29
+ }
30
+
31
+ .width_lg {
32
+ width: $container_lg;
33
+ }
34
+
35
+ .width_xl {
36
+ width: $container_xl;
37
+ }
38
+
39
+ .width_xxl {
40
+ width: $container_xxl;
41
+ }
42
+
43
+ .width_100_percent {
44
+ width: $container_100;
45
+ }
@@ -29,6 +29,7 @@ export default [
29
29
  "numberSpacing",
30
30
  "maxWidth",
31
31
  "minWidth",
32
+ "width",
32
33
  "marginRight",
33
34
  "marginLeft",
34
35
  "marginTop",
@@ -95,12 +95,16 @@ type Margin = {
95
95
  default?: string
96
96
  }
97
97
 
98
+ type Width = {
99
+ width?: string
100
+ }
101
+
98
102
  type MaxWidth = {
99
- maxWidth?: Sizes,
103
+ maxWidth?: string,
100
104
  }
101
105
 
102
106
  type MinWidth = {
103
- minWidth?: Sizes,
107
+ minWidth?: string,
104
108
  }
105
109
 
106
110
  type NumberSpacing = {
@@ -176,7 +180,7 @@ type ZIndex = {
176
180
  } | ZIndexResponsiveType
177
181
 
178
182
  type Height = {
179
- height?: string
183
+ height?: string
180
184
  }
181
185
 
182
186
  type MaxHeight = {
@@ -191,7 +195,7 @@ type MinHeight = {
191
195
  export type GlobalProps = AlignContent & AlignItems & AlignSelf &
192
196
  BorderRadius & Cursor & Dark & Display & DisplaySizes & Flex & FlexDirection &
193
197
  FlexGrow & FlexShrink & FlexWrap & JustifyContent & JustifySelf &
194
- LineHeight & Margin & MinWidth & MaxWidth & NumberSpacing & Order & Overflow & Padding &
198
+ LineHeight & Margin & Width & MinWidth & MaxWidth & NumberSpacing & Order & Overflow & Padding &
195
199
  Position & Shadow & TextAlign & Truncate & VerticalAlign & ZIndex & { hover?: string } & Top & Right & Bottom & Left & Height & MaxHeight & MinHeight;
196
200
 
197
201
  const getResponsivePropClasses = (prop: {[key: string]: string}, classPrefix: string) => {
@@ -351,6 +355,11 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
351
355
  css += numberSpacing ? `ns_${numberSpacing} ` : ''
352
356
  return css
353
357
  },
358
+ widthProps: ({ width }: Width) => {
359
+ let css = ''
360
+ css += width ? `width_${filterClassName(width)} ` : ''
361
+ return css.trimEnd()
362
+ },
354
363
  minWidthProps: ({ minWidth }: MinWidth) => {
355
364
  let css = ''
356
365
  css += minWidth ? `min_width_${filterClassName(minWidth)} ` : ''