playbook_ui 14.9.0.pre.rc.16 → 14.9.0.pre.rc.17

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: 8ab25ef480fdafc4e7dbe01d8a996b66f4aff5cafdbfbe2c39149954238969a4
4
- data.tar.gz: f1168644429453dec42a540d09dec3410aed9a7375982553f7fca2abfb537e6a
3
+ metadata.gz: d00eca4bbfbc0c7635601ac8ea5bc581b72dc830ef1341b878a85bd7ed1e71fc
4
+ data.tar.gz: cfcdad0ccad5a5cc1d02625b5ac13fdbd3abd48ac162b6821968c65f70e93d1b
5
5
  SHA512:
6
- metadata.gz: 9de68a63391ed82f5417582571b01731b2eab2b974304311caada2a0fa5d0565a231c964a62fc6e3fdda00738f4f2c417e23e15c26c223244b60bf3bf9f4880c
7
- data.tar.gz: b8b961b78de3bed1f50860eae0facb39fb6b9f7fba49267debcf4492815a9c3f4b313ca9dfd1a6575cfb0faf4784ee19a40416e3841e15397eeee6948a9c8b76
6
+ metadata.gz: f19a2d498ee2652e7e20956b8ce047e638135ad3b9274dc19edeabf82b04ed4de1110c003b48bdda87773f44d9f3e09cf4413678ddce5073fcab4ba220a4ac2a
7
+ data.tar.gz: aff5d022e2cfd855ecace5ea28927f9c1183c6f25231ce65a6266893fa3a616f6483dbe68270ff8c89cf7f3482ba9586a68b804c50b461406855bc5217d37ddc
@@ -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,9 @@
1
1
  import React from 'react'
2
2
  import classnames from 'classnames'
3
3
  import { buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
4
- import { globalProps } from '../utilities/globalProps'
4
+ import { globalProps, GlobalProps } from '../utilities/globalProps'
5
+
6
+ type ModifiedGlobalProps = Omit<GlobalProps, 'width'>
5
7
 
6
8
  type ProgressSimpleProps = {
7
9
  align?: "left" | "center" | "right",
@@ -16,7 +18,7 @@ type ProgressSimpleProps = {
16
18
  value: number,
17
19
  variant?: "default" | "positive" | "negative" | "warning",
18
20
  width: string,
19
- }
21
+ } & ModifiedGlobalProps
20
22
 
21
23
  const ProgressSimple = (props: ProgressSimpleProps): React.ReactElement => {
22
24
  const {
@@ -56,7 +58,7 @@ const ProgressSimple = (props: ProgressSimpleProps): React.ReactElement => {
56
58
  )
57
59
 
58
60
  return (
59
- <div
61
+ <div
60
62
  {...dataProps}
61
63
  {...htmlProps}
62
64
  className={wrapperClass}
@@ -1,9 +1,10 @@
1
- <%= content_tag(:div, class: object.wrapper_classname) do %>
1
+ <%= content_tag(:div,
2
+ class: object.wrapper_classname,
3
+ style: object.style) do %>
2
4
  <%= content_tag(:div,
3
5
  id: object.id,
4
6
  data: object.data_values,
5
7
  class: object.classname,
6
- style: object.style,
7
8
  **combined_html_options) do %>
8
9
  <%= content_tag(:div, "",
9
10
  class: "progress_simple_value",
@@ -21,6 +21,11 @@ module Playbook
21
21
  values: %w[default positive negative warning],
22
22
  default: "default"
23
23
 
24
+ # Explicitly defining the width prop here so the local prop takes precedence over global width prop
25
+ def width
26
+ prop(:width)
27
+ end
28
+
24
29
  def number_value
25
30
  validate_required_progress_props
26
31
 
@@ -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)} ` : ''