playbook_ui 14.6.0.pre.alpha.PBNTR5554217 → 14.6.0.pre.alpha.PBNTR5554223

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: 386f151fd01fd07dd00e2bbb98f290eb5a2d1d71fd775da6cbe748fb2967aa5c
4
- data.tar.gz: 1b1af709f31c4e02bfa5b88bcfa9ad3bd97f8e59ebe000219030cd754d0bdfdd
3
+ metadata.gz: 00b10f6b6dc5d613f9eaea588e3ea97f5d4045cebe40f1f26252eecb1feb7fc7
4
+ data.tar.gz: 9340cc23fb8ef18ec04416f0ec585b47a925b1f92bb1dd28db98ca15f2c3ab93
5
5
  SHA512:
6
- metadata.gz: 9c4dba5e3cd240d2e97629214ee5c9c592be48a507d3584e0f0bcb109e182c0434437c4d2e31059bfa4fcb68762b0fe41ffd32b6aceb2bc7d57b9b11314a8b10
7
- data.tar.gz: 7b69c72fb69a6367826cef4b40304f4fee9df732b3ea2290f25b44ddac687c741c618ab9b628040d96f8642079ae6cd87495bf50a19963a241b032b60cabbfeb
6
+ metadata.gz: 839f0192c8d7db7090c6ea683470f1f57eed6b6b9949fb3b2c0d4febddd3ea6780acf437928f3933c9574d15f64ac4c492f8edc7f2b413771ff09111db8820b3
7
+ data.tar.gz: 8a1ae795effa6c4a5fe482748cdab3c7f6ce0526c764e3273ca33fafd60916ed612cb5b2e406005460c6d5a6c55c18a2389f3fb70428be04981fd35db8473a86
@@ -5,7 +5,7 @@ import { get } from 'lodash'
5
5
  import classnames from 'classnames'
6
6
 
7
7
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
8
- import { GlobalProps, globalProps, globalInlineProps } from '../utilities/globalProps'
8
+ import { GlobalProps, globalProps } from '../utilities/globalProps'
9
9
  import type { ProductColors, CategoryColors, BackgroundColors } from '../types/colors'
10
10
 
11
11
  import Icon from '../pb_icon/_icon'
@@ -49,7 +49,6 @@ type CardBodyProps = {
49
49
  padding?: string,
50
50
  } & GlobalProps
51
51
 
52
-
53
52
  // Header component
54
53
  const Header = (props: CardHeaderProps) => {
55
54
  const { children, className, headerColor = 'category_1', headerColorStriped = false } = props
@@ -108,7 +107,6 @@ const Card = (props: CardPropTypes): React.ReactElement => {
108
107
 
109
108
  // coerce to array
110
109
  const cardChildren = React.Children.toArray(children)
111
- const dynamicInlineProps = globalInlineProps(props);
112
110
 
113
111
  const subComponentTags = (tagName: string) => {
114
112
  return cardChildren.filter((c: string) => (
@@ -137,7 +135,6 @@ const Card = (props: CardPropTypes): React.ReactElement => {
137
135
  {...dataProps}
138
136
  {...htmlProps}
139
137
  className={classnames(cardCss, globalProps(props), className)}
140
- style={dynamicInlineProps}
141
138
  >
142
139
  {subComponentTags('Header')}
143
140
  {
@@ -166,7 +163,6 @@ const Card = (props: CardPropTypes): React.ReactElement => {
166
163
  {...dataProps}
167
164
  {...htmlProps}
168
165
  className={classnames(cardCss, globalProps(props), className)}
169
- style={dynamicInlineProps}
170
166
  >
171
167
  {subComponentTags('Header')}
172
168
  {nonHeaderChildren}
@@ -67,7 +67,7 @@ test('commaSeparator prop returns comma separated amount', () => {
67
67
  render(
68
68
  <Currency
69
69
  amount="1234567890"
70
- comma_separator
70
+ commaSeparator
71
71
  data={{ testid: 'comma-test' }}
72
72
  />
73
73
  )
@@ -78,7 +78,7 @@ test('commaSeparator prop returns comma separated amount with decimals', () => {
78
78
  render(
79
79
  <Currency
80
80
  amount="1234567890.12"
81
- comma_separator
81
+ commaSeparator
82
82
  data={{ testid: 'comma-test-decimals' }}
83
83
  />
84
84
  )
@@ -89,7 +89,7 @@ test('commaSeparator prop returns comma separated amount with decimals="matching
89
89
  render(
90
90
  <Currency
91
91
  amount="1234567890.12"
92
- comma_separator
92
+ commaSeparator
93
93
  data={{ testid: 'comma-test-decimals-matching' }}
94
94
  decimals="matching"
95
95
  />
@@ -6,7 +6,7 @@ import classnames from "classnames";
6
6
  import Modal from "react-modal";
7
7
 
8
8
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from "../utilities/props";
9
- import { globalProps, globalInlineProps } from "../utilities/globalProps";
9
+ import { globalProps } from "../utilities/globalProps";
10
10
 
11
11
  import Body from "../pb_body/_body";
12
12
  import Button from "../pb_button/_button";
@@ -91,8 +91,6 @@ const Dialog = (props: DialogProps): React.ReactElement => {
91
91
  beforeClose: "pb_dialog_overlay_before_close",
92
92
  };
93
93
 
94
- const dynamicInlineProps = globalInlineProps(props);
95
-
96
94
  const classes = classnames(
97
95
  buildCss("pb_dialog_wrapper"),
98
96
  globalProps(props),
@@ -186,7 +184,6 @@ const Dialog = (props: DialogProps): React.ReactElement => {
186
184
  overlayClassName={overlayClassNames}
187
185
  portalClassName={portalClassName}
188
186
  shouldCloseOnOverlayClick={shouldCloseOnOverlayClick && !loading}
189
- style={{ content: dynamicInlineProps }}
190
187
  >
191
188
  <>
192
189
  {title && !status ? <Dialog.Header>{title}</Dialog.Header> : null}
@@ -195,7 +192,6 @@ const Dialog = (props: DialogProps): React.ReactElement => {
195
192
  <Dialog.Body
196
193
  className="dialog_status_text_align"
197
194
  padding="md"
198
-
199
195
  >
200
196
  <Flex align="center"
201
197
  orientation="column"
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import classnames from 'classnames'
3
3
  import { buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
4
- import { GlobalProps, globalProps, globalInlineProps } from '../utilities/globalProps'
4
+ import { GlobalProps, globalProps } from '../utilities/globalProps'
5
5
  import { GenericObject, Sizes } from '../types'
6
6
 
7
7
  type FlexProps = {
@@ -61,7 +61,6 @@ const Flex = (props: FlexProps): React.ReactElement => {
61
61
  const alignSelfClass = alignSelf !== 'none' ? `align_self_${alignSelf}` : ''
62
62
  const dataProps = buildDataProps(data)
63
63
  const htmlProps = buildHtmlProps(htmlOptions)
64
- const dynamicInlineProps = globalInlineProps(props)
65
64
 
66
65
 
67
66
  return (
@@ -84,7 +83,6 @@ const Flex = (props: FlexProps): React.ReactElement => {
84
83
  globalProps(props),
85
84
  className
86
85
  )}
87
- style={dynamicInlineProps}
88
86
  {...dataProps}
89
87
  {...htmlProps}
90
88
  >
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import classnames from 'classnames'
3
3
  import { buildCss, buildHtmlProps } from '../utilities/props'
4
- import { globalProps, GlobalProps, globalInlineProps} from '../utilities/globalProps'
4
+ import { globalProps, GlobalProps } from '../utilities/globalProps'
5
5
  type FlexItemPropTypes = {
6
6
  children: React.ReactNode[] | React.ReactNode,
7
7
  fixedSize?: string,
@@ -35,20 +35,14 @@ const FlexItem = (props: FlexItemPropTypes): React.ReactElement => {
35
35
  const fixedStyle =
36
36
  fixedSize !== undefined ? { flexBasis: `${fixedSize}` } : null
37
37
  const orderClass = order !== 'none' ? `order_${order}` : null
38
- const dynamicInlineProps = globalInlineProps(props)
39
- const combinedStyles = {
40
- ...fixedStyle,
41
- ...dynamicInlineProps
42
- }
43
38
 
44
39
  const htmlProps = buildHtmlProps(htmlOptions)
45
40
 
46
-
47
41
  return (
48
42
  <div
49
43
  {...htmlProps}
50
44
  className={classnames(buildCss('pb_flex_item_kit', growClass, shrinkClass, flexClass, displayFlexClass), orderClass, alignSelfClass, globalProps(props), className)}
51
- style={combinedStyles}
45
+ style={fixedStyle}
52
46
  >
53
47
  {children}
54
48
  </div>
@@ -1,5 +1,8 @@
1
- <%= pb_content_tag(:div,
2
- style: object.inline_styles
3
- ) do %>
1
+ <%= content_tag(:div,
2
+ id: object.id,
3
+ data: object.data,
4
+ class: object.classname,
5
+ style: object.style_value,
6
+ **combined_html_options) do %>
4
7
  <%= content.presence %>
5
8
  <% end %>
@@ -20,13 +20,8 @@ module Playbook
20
20
  generate_classname("pb_flex_item_kit", fixed_size_class, grow_class, shrink_class, display_flex_class) + align_self_class
21
21
  end
22
22
 
23
- def inline_styles
24
- styles = []
25
- styles << "flex-basis: #{fixed_size};" if fixed_size.present?
26
- styles << "height: #{height};" if height.present?
27
- styles << "min-height: #{min_height};" if min_height.present?
28
- styles << "max-height: #{max_height};" if max_height.present?
29
- styles.join(" ")
23
+ def style_value
24
+ "flex-basis: #{fixed_size};" if fixed_size.present?
30
25
  end
31
26
 
32
27
  private
@@ -21,7 +21,7 @@ import classnames from "classnames";
21
21
  import { globalProps, GlobalProps } from "../utilities/globalProps";
22
22
  import { uniqueId } from 'lodash';
23
23
 
24
- type ModifiedGlobalProps = Omit<GlobalProps, 'minWidth' | 'maxHeight' | 'minHeight'>
24
+ type ModifiedGlobalProps = Omit<GlobalProps, 'minWidth'>
25
25
 
26
26
  type PbPopoverProps = {
27
27
  aria?: { [key: string]: string };
@@ -1,7 +1,4 @@
1
1
  export default [
2
- "minHeight",
3
- "maxHeight",
4
- "height",
5
2
  "left",
6
3
  "bottom",
7
4
  "right",
@@ -170,24 +170,12 @@ type ZIndex = {
170
170
  zIndex?: ZIndexType,
171
171
  } | ZIndexResponsiveType
172
172
 
173
- type Height = {
174
- height?: string
175
- }
176
-
177
- type MaxHeight = {
178
- maxHeight?: string
179
- }
180
-
181
- type MinHeight = {
182
- minHeight?: string
183
- }
184
-
185
173
  // keep this as the last type definition
186
174
  export type GlobalProps = AlignContent & AlignItems & AlignSelf &
187
175
  BorderRadius & Cursor & Dark & Display & DisplaySizes & Flex & FlexDirection &
188
176
  FlexGrow & FlexShrink & FlexWrap & JustifyContent & JustifySelf &
189
177
  LineHeight & Margin & MinWidth & MaxWidth & NumberSpacing & Order & Overflow & Padding &
190
- Position & Shadow & TextAlign & Truncate & VerticalAlign & ZIndex & { hover?: string } & Top & Right & Bottom & Left & Height & MaxHeight & MinHeight;
178
+ Position & Shadow & TextAlign & Truncate & VerticalAlign & ZIndex & { hover?: string } & Top & Right & Bottom & Left;
191
179
 
192
180
  const getResponsivePropClasses = (prop: {[key: string]: string}, classPrefix: string) => {
193
181
  const keys: string[] = Object.keys(prop)
@@ -510,22 +498,7 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
510
498
  } else {
511
499
  return verticalAlign ? `vertical_align_${verticalAlign} ` : ''
512
500
  }
513
- },
514
-
515
- }
516
-
517
- const PROP_INLINE_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => {[key: string]: any}} = {
518
- heightProps: ({ height }: Height) => {
519
- return height ? { height } : {};
520
- },
521
-
522
- maxHeightProps: ({ maxHeight }: MaxHeight) => {
523
- return maxHeight ? { maxHeight } : {};
524
- },
525
-
526
- minHeightProps: ({ minHeight }: MinHeight) => {
527
- return minHeight ? { minHeight } : {};
528
- },
501
+ }
529
502
  }
530
503
 
531
504
  type DefaultProps = {[key: string]: string} | Record<string, unknown>
@@ -537,16 +510,6 @@ export const globalProps = (props: GlobalProps, defaultProps: DefaultProps = {})
537
510
  }).filter((value) => value?.length > 0).join(" ")
538
511
  }
539
512
 
540
- // New function for inline styles
541
- export const globalInlineProps = (props: GlobalProps): React.CSSProperties => {
542
- const styles = Object.keys(PROP_INLINE_CATEGORIES).reduce((acc, key) => {
543
- const result = PROP_INLINE_CATEGORIES[key](props);
544
- return { ...acc, ...(typeof result === 'object' ? result : {}) }; // Ensure result is an object before spreading
545
- }, {});
546
-
547
- return styles; // Return the styles object directly
548
- }
549
-
550
513
 
551
514
  export const deprecatedProps = (): void => {
552
515
  // if (process.env.NODE_ENV === 'development') {