playbook_ui 10.25.1 → 10.26.0.pre.alpha.display1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/data/menu.yml +1 -0
  3. data/app/pb_kits/playbook/index.js +2 -1
  4. data/app/pb_kits/playbook/pb_avatar/_avatar.tsx +3 -3
  5. data/app/pb_kits/playbook/pb_body/_body.tsx +8 -8
  6. data/app/pb_kits/playbook/pb_caption/{_caption.jsx → _caption.tsx} +7 -8
  7. data/app/pb_kits/playbook/pb_card/_card.jsx +3 -1
  8. data/app/pb_kits/playbook/pb_card/_card_mixin.scss +1 -0
  9. data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.js +37 -0
  10. data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.js +37 -0
  11. data/app/pb_kits/playbook/pb_form_pill/_form_pill.jsx +1 -1
  12. data/app/pb_kits/playbook/pb_image/_image.tsx +1 -1
  13. data/app/pb_kits/playbook/pb_kit/dateTime.js +1 -2
  14. data/app/pb_kits/playbook/pb_pill/_pill.jsx +1 -1
  15. data/app/pb_kits/playbook/pb_title/{_title.jsx → _title.tsx} +10 -12
  16. data/app/pb_kits/playbook/pb_title/title.test.js +2 -2
  17. data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx +79 -0
  18. data/app/pb_kits/playbook/pb_treemap_chart/docs/_description.md +5 -0
  19. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.html.erb +37 -0
  20. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.jsx +48 -0
  21. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.md +2 -0
  22. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.html.erb +37 -0
  23. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.jsx +47 -0
  24. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.md +3 -0
  25. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.html.erb +79 -0
  26. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.jsx +90 -0
  27. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.md +1 -0
  28. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.html.erb +54 -0
  29. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.jsx +65 -0
  30. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.md +3 -0
  31. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.html.erb +37 -0
  32. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.jsx +48 -0
  33. data/app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.md +3 -0
  34. data/app/pb_kits/playbook/pb_treemap_chart/docs/example.yml +15 -0
  35. data/app/pb_kits/playbook/pb_treemap_chart/docs/index.js +5 -0
  36. data/app/pb_kits/playbook/pb_treemap_chart/treemap_chart.html.erb +1 -0
  37. data/app/pb_kits/playbook/pb_treemap_chart/treemap_chart.rb +43 -0
  38. data/app/pb_kits/playbook/playbook-doc.js +2 -0
  39. data/app/pb_kits/playbook/playbook-rails-react-bindings.js +2 -0
  40. data/app/pb_kits/playbook/plugins/pb_chart.js +34 -0
  41. data/app/pb_kits/playbook/tokens/_display.scss +13 -0
  42. data/app/pb_kits/playbook/tokens/_screen_sizes.scss +21 -5
  43. data/app/pb_kits/playbook/utilities/_display.scss +60 -2
  44. data/app/pb_kits/playbook/utilities/globalProps.ts +31 -16
  45. data/dist/reset.css +60 -1
  46. data/lib/playbook/display.rb +21 -7
  47. data/lib/playbook/version.rb +1 -1
  48. metadata +29 -7
@@ -1,7 +1,12 @@
1
1
  import { omit } from 'lodash'
2
2
 
3
- type Sizes = "xs" | "sm" | "md" | "lg" | "xl"
4
- type None = "none"
3
+ import {
4
+ Binary,
5
+ Display,
6
+ DisplaySizes,
7
+ None,
8
+ Sizes,
9
+ } from '../types'
5
10
 
6
11
  type AllSizes = None & Sizes
7
12
 
@@ -42,27 +47,23 @@ type ZIndex = {
42
47
  }
43
48
 
44
49
  type Shadow = {
45
- shadow?: "none" | "deep" | "deeper" | "deepest",
50
+ shadow?: None | "deep" | "deeper" | "deepest",
46
51
  }
47
52
 
48
53
  type LineHeight = {
49
54
  lineHeight?: "loosest" | "looser" | "loose" | "normal" | "tight" | "tighter" | "tightest",
50
55
  }
51
56
 
52
- type Display = {
53
- display?: "block" | "flex" | "hidden" | "inline_block" | "inline" | "inline_flex",
54
- }
55
-
56
57
  type Cursor = {
57
58
  cursor?: "pointer",
58
59
  }
59
60
 
60
61
  type BorderRadius = {
61
- borderRadius?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | "rounded",
62
+ borderRadius?: None | "xs" | "sm" | "md" | "lg" | "xl" | "rounded",
62
63
  }
63
64
 
64
65
  type Flex = {
65
- flex?: "none" | "initial" | "auto" | 1
66
+ flex?: None | "initial" | "auto" | 1
66
67
  }
67
68
 
68
69
  type FlexDirection = {
@@ -70,11 +71,11 @@ type FlexDirection = {
70
71
  }
71
72
 
72
73
  type FlexGrow = {
73
- flexGrow?: 0 | 1
74
+ flexGrow?: Binary
74
75
  }
75
76
 
76
77
  type FlexShrink = {
77
- flexShrink?: 0 | 1
78
+ flexShrink?: Binary
78
79
  }
79
80
 
80
81
  type FlexWrap = {
@@ -106,11 +107,11 @@ type AlignSelf = {
106
107
  }
107
108
 
108
109
  type Order = {
109
- order?: "none" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
110
+ order?: None | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12
110
111
  }
111
112
 
112
113
  export type GlobalProps = AlignContent & AlignItems & AlignSelf &
113
- BorderRadius & Cursor & Dark & Display & Flex & FlexDirection &
114
+ BorderRadius & Cursor & Dark & Display & DisplaySizes & Flex & FlexDirection &
114
115
  FlexGrow & FlexShrink & FlexWrap & JustifyContent & JustifySelf &
115
116
  LineHeight & Margin & MaxWidth & NumberSpacing & Order & Padding &
116
117
  Shadow & ZIndex
@@ -180,9 +181,21 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
180
181
  css += lineHeight ? `line_height_${lineHeight} ` : ''
181
182
  return css
182
183
  },
183
- displayProps: ({ display }: Display) => {
184
+ displayProps: (display: Display ) => {
184
185
  let css = ''
185
- css += display ? `display_${display} ` : ''
186
+ Object.entries(display).forEach((displayEntry) => {
187
+ if (displayEntry[0] == "display") {
188
+ if (typeof displayEntry[1] == "string") {
189
+ css += `display_${displayEntry[1]} `
190
+ } else if (typeof displayEntry[1] == "object") {
191
+ Object.entries(displayEntry[1]).forEach((displayObj) => {
192
+ css += `display_${displayObj[0]}_${displayObj[1]} `
193
+ })
194
+ } else {
195
+ ' '
196
+ }
197
+ }
198
+ })
186
199
  return css
187
200
  },
188
201
  cursorProps: ({ cursor }: Cursor) => {
@@ -259,7 +272,9 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
259
272
  }
260
273
  }
261
274
 
262
- export const globalProps = (props: GlobalProps, defaultProps: {[key: string]: string} | {} = {}): string => {
275
+ type DefaultProps = {[key: string]: string} | Record<string, unknown>
276
+
277
+ export const globalProps = (props: GlobalProps, defaultProps: DefaultProps = {}): string => {
263
278
  const allProps = { ...props, ...defaultProps }
264
279
  return Object.keys(PROP_CATEGORIES).map((key) => {
265
280
  return PROP_CATEGORIES[key](allProps)
data/dist/reset.css CHANGED
@@ -1,2 +1,61 @@
1
- *{box-sizing:border-box;margin:0;padding:0}*:before,*:after{box-sizing:border-box}html{-webkit-tap-highlight-color:rgba(0,0,0,0);height:100vh;overflow-x:hidden}body{font-family:"Proxima Nova","Helvetica Neue",Helvetica,Arial,sans_serif;font-size:16px;line-height:1.5;background-color:#F3F7FB;height:100%;letter-spacing:0;font-weight:400;font-style:normal;text-rendering:optimizeLegibility;-moz-font-feature-settings:"liga" on;color:#242B42;margin:0 !important;padding:0 !important;box-sizing:border-box;min-height:100vh;padding:50px}a{text-decoration:none;color:#0056CF}
1
+ /* CLEAN UP AND REMOVE */
2
+ /* Headings */
3
+ /* Standard Font Weights */
4
+ /* Non_Standard Font Weights */
5
+ /*=====================================
6
+ Base colors should not be documented.
7
+ Only document color use.
8
+
9
+ Colors -----------------------------*/
10
+ /* Specialty Gradient -----------------*/
11
+ /* Interface colors -------------------*/
12
+ /* Main colors ------------------------*/
13
+ /*=====================================
14
+
15
+ Background colors ------------------*/
16
+ /* Card colors ------------------*/
17
+ /* Active colors ----------------------*/
18
+ /* Hover colors -----------------------*/
19
+ /* Focus colors -----------------------*/
20
+ /* Border colors ----------------------*/
21
+ /* Shadow colors ----------------------*/
22
+ /* Text colors ------------------------*/
23
+ /* Data colors ------------------------*/
24
+ /* Status colors ----------------------*/
25
+ /* Link colors ------------------------*/
26
+ /* Product colors ---------------------*/
27
+ /* Category colors ---------------------*/
28
+ * {
29
+ box-sizing: border-box;
30
+ margin: 0;
31
+ padding: 0; }
32
+ *:before, *:after {
33
+ box-sizing: border-box; }
34
+
35
+ html {
36
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
37
+ height: 100vh;
38
+ overflow-x: hidden; }
39
+
40
+ body {
41
+ font-family: "Proxima Nova", "Helvetica Neue", Helvetica, Arial, sans_serif;
42
+ font-size: 16px;
43
+ line-height: 1.5;
44
+ background-color: #F3F7FB;
45
+ height: 100%;
46
+ letter-spacing: 0;
47
+ font-weight: 400;
48
+ font-style: normal;
49
+ text-rendering: optimizeLegibility;
50
+ -moz-font-feature-settings: "liga" on;
51
+ color: #242B42;
52
+ margin: 0 !important;
53
+ padding: 0 !important;
54
+ box-sizing: border-box;
55
+ min-height: 100vh;
56
+ padding: 50px; }
57
+
58
+ a {
59
+ text-decoration: none;
60
+ color: #0056CF; }
2
61
 
@@ -8,12 +8,22 @@ module Playbook
8
8
 
9
9
  def display_props
10
10
  selected_props = display_options.keys.select { |sk| try(sk) }
11
- return nil unless selected_props.present?
12
-
13
- selected_props.map do |k|
14
- display_value = send(k)
15
- "display_#{display_value}" if display_values.include? display_value
16
- end.compact.join(" ")
11
+ responsive = selected_props.present? && try(:display).is_a?(::Hash)
12
+ css = ""
13
+ if responsive
14
+ display_value = send(:display)
15
+ display_value.each do |key, value|
16
+ css += "display_#{key}_#{value} " if display_size_values.include?(key.to_s) && display_values.include?(value.to_s)
17
+ end
18
+ elsif display_value.is_a?(String)
19
+ selected_props.each do |k|
20
+ display_value = send(k)
21
+ css += "display_#{display_value}" if display_values.include? display_value
22
+ end
23
+ else
24
+ ""
25
+ end
26
+ css unless css.blank?
17
27
  end
18
28
 
19
29
  def display_options
@@ -22,8 +32,12 @@ module Playbook
22
32
  }
23
33
  end
24
34
 
35
+ def display_size_values
36
+ %w[xs sm md lg xl]
37
+ end
38
+
25
39
  def display_values
26
- %w[block inline_block inline flex inline_flex hidden]
40
+ %w[block inline_block inline flex inline_flex none]
27
41
  end
28
42
  end
29
43
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Playbook
4
4
  PREVIOUS_VERSION = "10.25.0"
5
- VERSION = "10.25.1"
5
+ VERSION = "10.26.0.pre.alpha.display1"
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: 10.25.1
4
+ version: 10.26.0.pre.alpha.display1
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-05-02 00:00:00.000000000 Z
12
+ date: 2022-05-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -452,8 +452,8 @@ files:
452
452
  - app/pb_kits/playbook/pb_button_toolbar/docs/_description.md
453
453
  - app/pb_kits/playbook/pb_button_toolbar/docs/example.yml
454
454
  - app/pb_kits/playbook/pb_button_toolbar/docs/index.js
455
- - app/pb_kits/playbook/pb_caption/_caption.jsx
456
455
  - app/pb_kits/playbook/pb_caption/_caption.scss
456
+ - app/pb_kits/playbook/pb_caption/_caption.tsx
457
457
  - app/pb_kits/playbook/pb_caption/_caption_mixin.scss
458
458
  - app/pb_kits/playbook/pb_caption/caption.html.erb
459
459
  - app/pb_kits/playbook/pb_caption/caption.rb
@@ -1884,8 +1884,8 @@ files:
1884
1884
  - app/pb_kits/playbook/pb_timestamp/docs/index.js
1885
1885
  - app/pb_kits/playbook/pb_timestamp/timestamp.html.erb
1886
1886
  - app/pb_kits/playbook/pb_timestamp/timestamp.rb
1887
- - app/pb_kits/playbook/pb_title/_title.jsx
1888
1887
  - app/pb_kits/playbook/pb_title/_title.scss
1888
+ - app/pb_kits/playbook/pb_title/_title.tsx
1889
1889
  - app/pb_kits/playbook/pb_title/_title_mixin.scss
1890
1890
  - app/pb_kits/playbook/pb_title/docs/_description.md
1891
1891
  - app/pb_kits/playbook/pb_title/docs/_title_colors.html.erb
@@ -1950,6 +1950,27 @@ files:
1950
1950
  - app/pb_kits/playbook/pb_tooltip/index.js
1951
1951
  - app/pb_kits/playbook/pb_tooltip/tooltip.html.erb
1952
1952
  - app/pb_kits/playbook/pb_tooltip/tooltip.rb
1953
+ - app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.jsx
1954
+ - app/pb_kits/playbook/pb_treemap_chart/docs/_description.md
1955
+ - app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.html.erb
1956
+ - app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.jsx
1957
+ - app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_colors.md
1958
+ - app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.html.erb
1959
+ - app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.jsx
1960
+ - app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_default.md
1961
+ - app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.html.erb
1962
+ - app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.jsx
1963
+ - app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_drillable.md
1964
+ - app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.html.erb
1965
+ - app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.jsx
1966
+ - app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_grouped_data.md
1967
+ - app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.html.erb
1968
+ - app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.jsx
1969
+ - app/pb_kits/playbook/pb_treemap_chart/docs/_treemap_chart_tooltip.md
1970
+ - app/pb_kits/playbook/pb_treemap_chart/docs/example.yml
1971
+ - app/pb_kits/playbook/pb_treemap_chart/docs/index.js
1972
+ - app/pb_kits/playbook/pb_treemap_chart/treemap_chart.html.erb
1973
+ - app/pb_kits/playbook/pb_treemap_chart/treemap_chart.rb
1953
1974
  - app/pb_kits/playbook/pb_typeahead/_typeahead.jsx
1954
1975
  - app/pb_kits/playbook/pb_typeahead/_typeahead.scss
1955
1976
  - app/pb_kits/playbook/pb_typeahead/components/ClearIndicator.jsx
@@ -2050,6 +2071,7 @@ files:
2050
2071
  - app/pb_kits/playbook/tokens/_animation-curves.scss
2051
2072
  - app/pb_kits/playbook/tokens/_border_radius.scss
2052
2073
  - app/pb_kits/playbook/tokens/_colors.scss
2074
+ - app/pb_kits/playbook/tokens/_display.scss
2053
2075
  - app/pb_kits/playbook/tokens/_line_height.scss
2054
2076
  - app/pb_kits/playbook/tokens/_opacity.scss
2055
2077
  - app/pb_kits/playbook/tokens/_positioning.scss
@@ -2155,7 +2177,7 @@ files:
2155
2177
  - lib/playbook_ui.rb
2156
2178
  homepage: http://playbook.powerapp.cloud
2157
2179
  licenses:
2158
- - ISC
2180
+ - MIT
2159
2181
  metadata: {}
2160
2182
  post_install_message:
2161
2183
  rdoc_options: []
@@ -2168,9 +2190,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
2168
2190
  version: '0'
2169
2191
  required_rubygems_version: !ruby/object:Gem::Requirement
2170
2192
  requirements:
2171
- - - ">="
2193
+ - - ">"
2172
2194
  - !ruby/object:Gem::Version
2173
- version: '0'
2195
+ version: 1.3.1
2174
2196
  requirements: []
2175
2197
  rubygems_version: 3.1.6
2176
2198
  signing_key: