playbook_ui 13.27.0.pre.alpha.powercentrainplaybookpt22905 → 13.27.0.pre.alpha.testingcollapsible2912

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 74d7359c8120c5c70d7f9921d02699ff6f9cf3f0c937af7a1f8b7470413d3ec9
4
- data.tar.gz: 109783b9b43e8a3fd37d20394c1c492f1ab048ffc5f7e88dbcf44b85aa0a2cb1
3
+ metadata.gz: 139239375cde8415b10b6381e0d294df8666584609ff6c16002aab7f8cb2d5fa
4
+ data.tar.gz: 870ef281c575c7e7c752df452e3c368a197f0adfdbd9a7659259a7b713d4772d
5
5
  SHA512:
6
- metadata.gz: 2e13c1b3ddf3053fbb089f1aa974501f91cc30217d511ddb8138e83304542b3e8a2e81d4cbbfa88de95d132f2c327f94f6552cf139e5ef3f53fb665d79b37a0b
7
- data.tar.gz: 0f12b7619fcff70e4f499b0e05532497abda01537861143f9d3320d0ce51be870009b150f5ddedd304ab0d30993f0cf4ee6de4252f784c821baf6cefa1a18c04
6
+ metadata.gz: 031cc99959af36b9584cf2a68cd7e0dd69fa59908292e5c7865d9d44329ca6955c1968fa3000b724aef7e6416fcb67f08a3dea5542a88d99234e0d79176b0345
7
+ data.tar.gz: 6614ed6e1c90b0d1c9e404952b1ef22759bd710389a156e821c796b550fca8bcb680615ddb2ee723ab7dc1f0a6c48af5ebfb5c43f58c7b67ce073a4c48defb5c
@@ -6,9 +6,9 @@
6
6
  @import "../tokens/typography";
7
7
 
8
8
  $pb_button_sizes: (
9
- "sm": $font_smaller,
10
- "md": $font_small,
11
- "lg": ($font_large - 2px),
9
+ "sm": 0.75rem,
10
+ "md": 0.875rem,
11
+ "lg": 1.125rem,
12
12
  );
13
13
 
14
14
  [class*=pb_button_kit]{
@@ -9,7 +9,7 @@
9
9
 
10
10
  $pb_button_size: 40px;
11
11
  $pb_button_v_padding: 7px;
12
- $pb_button_h_padding: 28px;
12
+ $pb_button_h_padding: 34px;
13
13
  $pb_button_hover_darken: 4%;
14
14
  $pb_button_border_width: 0px;
15
15
 
@@ -27,13 +27,12 @@ $pb_button_border_width: 0px;
27
27
  text-rendering: optimizeLegibility;
28
28
  font-size: $font_small;
29
29
  font-weight: $bold;
30
- letter-spacing: $lspace_loose;
31
30
  text-align: center;
32
31
  vertical-align: middle;
33
32
  text-transform: none;
34
33
  border-width: $pb_button_border_width;
35
34
  border-style: solid;
36
- border-radius: $border_rad_heavy;
35
+ border-radius: $border_rad_light;
37
36
  min-height: $pb_button_size;
38
37
  line-height: 1.5;
39
38
  padding: $pb_button_v_padding $pb_button_h_padding;
@@ -24,7 +24,7 @@ $pb_dark_caption_colors: (
24
24
  color: $text_lt_light;
25
25
  text-transform: uppercase;
26
26
  font-size: $font_size;
27
- letter-spacing: $lspace_loosest;
27
+ letter-spacing: $lspace_looser;
28
28
  }
29
29
 
30
30
  @mixin caption_color($color: $text_lt_light) {
@@ -52,12 +52,15 @@ const Collapsible = ({
52
52
  if (CollapsibleParent.length !== 2) {
53
53
  throw new Error('Collapsible requires <CollapsibleMain> and <CollapsibleContent> to function properly.')
54
54
  }
55
+ const FirstChild = CollapsibleParent[0]
56
+ const SecondChild = CollapsibleParent[1]
55
57
 
56
- const Main = CollapsibleParent[0]
57
- const Content = CollapsibleParent[1]
58
+ const Main = FirstChild.type === CollapsibleMain ? FirstChild : null
59
+ const Content = SecondChild.type === CollapsibleContent ? SecondChild : null
58
60
 
59
- const { children: mainChildren, ...mainProps } = Main.props
60
- const { children: contentChildren, ...contentProps } = Content.props
61
+
62
+ const { children: mainChildren = null, ...mainProps } = Main ? Main.props : {}
63
+ const { children: contentChildren = null, ...contentProps } = Content ? Content.props : {}
61
64
  const ariaProps = buildAriaProps(aria)
62
65
  const dataProps = buildDataProps(data)
63
66
  const htmlProps = buildHtmlProps(htmlOptions)
@@ -75,13 +78,19 @@ const Collapsible = ({
75
78
  className={classes}
76
79
  id={id}
77
80
  >
78
- <CollapsibleMain {...mainProps}>
79
- {mainChildren}
80
- </CollapsibleMain>
81
+ {Main ? (
82
+ <CollapsibleMain {...mainProps}>
83
+ {mainChildren}
84
+ </CollapsibleMain>
85
+ ) : (
86
+ FirstChild
87
+ )}
81
88
 
82
- <CollapsibleContent {...contentProps}>
83
- {contentChildren}
84
- </CollapsibleContent>
89
+ {Content && (
90
+ <CollapsibleContent {...contentProps}>
91
+ {contentChildren}
92
+ </CollapsibleContent>
93
+ )}
85
94
  </div>
86
95
  </CollapsibleContext.Provider>
87
96
  )
@@ -0,0 +1,23 @@
1
+ <%= pb_rails("collapsible", props: { name: "default-example" }) do %>
2
+ <%= pb_rails("background", props: { background_color: "white", position: "sticky", top: "0", cursor:"pointer", data: {"collapsible-main": "true"} }) do %>
3
+ <%= pb_rails("flex", props: {align:"center", gap:"sm", justify:"between"}) do %>
4
+ <%= pb_rails("title", props: { text: "Custom Main Section", tag: "h4", size: 4 }) %>
5
+ <%= pb_rails("icon_circle", props: {
6
+ icon: "check",
7
+ size: "xs"
8
+ }) %>
9
+ <% end %>
10
+ <% end %>
11
+ <%= pb_rails("flex", props: { align: "center", justify: "between" }) do %>
12
+ <% end %>
13
+ <%= pb_rails("collapsible/collapsible_content", props: { padding: "none" }) do %>
14
+ <%= pb_rails("list", props: {ordered: false, dark: false, borderless: false}) do %>
15
+ <%= pb_rails("list/item") do %> Checklist Item <% end %>
16
+ <%= pb_rails("list/item") do %> Checklist Item <% end %>
17
+ <%= pb_rails("list/item") do %> Checklist Item <% end %>
18
+ <%= pb_rails("list/item") do %> Checklist Item <% end %>
19
+ <%= pb_rails("list/item") do %> Checklist Item <% end %>
20
+ <% end %>
21
+ <% end %>
22
+ <% end %>
23
+
@@ -0,0 +1,76 @@
1
+ import React from 'react'
2
+ import { Collapsible, useCollapsible, Background, Flex, Title, IconCircle, List, ListItem } from '../..'
3
+
4
+ const CollapsibleCustomMain = () => {
5
+ const [isCollapsed, setIsCollapsed] = useCollapsible(true)
6
+
7
+ return (
8
+ <>
9
+ <Collapsible
10
+ collapsed={isCollapsed}
11
+ >
12
+ <Background
13
+ backgroundColor="white"
14
+ cursor="pointer"
15
+ htmlOptions={{onClick:() => setIsCollapsed(!isCollapsed)}}
16
+ position="sticky"
17
+ top="0"
18
+ >
19
+ <Flex
20
+ align="center"
21
+ gap="sm"
22
+ justify="between"
23
+ >
24
+ <Title
25
+ size={4}
26
+ text="Custom Main Section"
27
+ />
28
+ <IconCircle
29
+ icon="check"
30
+ size="xs"
31
+ />
32
+ </Flex>
33
+ </Background>
34
+ <Collapsible.Content padding="none">
35
+ <div>
36
+ <List>
37
+ <ListItem
38
+ align="stretch"
39
+ flexDirection="column"
40
+ >
41
+ Checklist item
42
+ </ListItem>
43
+ <ListItem
44
+ align="stretch"
45
+ flexDirection="column"
46
+ >
47
+ Checklist item
48
+ </ListItem>
49
+ <ListItem
50
+ align="stretch"
51
+ flexDirection="column"
52
+ >
53
+ Checklist item
54
+ </ListItem>
55
+ <ListItem
56
+ align="stretch"
57
+ flexDirection="column"
58
+ >
59
+ Checklist item
60
+ </ListItem>
61
+ <ListItem
62
+ align="stretch"
63
+ flexDirection="column"
64
+ >
65
+ Checklist item
66
+ </ListItem>
67
+ </List>
68
+ </div>
69
+ </Collapsible.Content>
70
+ </Collapsible>
71
+
72
+ </>
73
+ )
74
+ }
75
+
76
+ export default CollapsibleCustomMain
@@ -7,6 +7,7 @@ examples:
7
7
  - collapsible_icons: Custom Icons
8
8
  - collapsible_external_controls: Toggle Collapsible With External Controls
9
9
  - collapsible_external_controls_multiple: Toggle All Collapsibles With One Control
10
+ - collapsible_custom_main: Custom Main
10
11
 
11
12
  react:
12
13
  - collapsible_default: Default
@@ -14,6 +15,8 @@ examples:
14
15
  - collapsible_color: Icon Color
15
16
  - collapsible_icons: Custom Icons
16
17
  - collapsible_state: useCollapsible Hook
18
+ - collapsible_custom_main: Custom Main
19
+
17
20
 
18
21
  swift:
19
22
  - collapsible_default_swift: Default
@@ -2,4 +2,5 @@ export { default as CollapsibleDefault } from './_collapsible_default.jsx'
2
2
  export { default as CollapsibleSize } from './_collapsible_size.jsx'
3
3
  export { default as CollapsibleColor } from './_collapsible_color.jsx'
4
4
  export { default as CollapsibleIcons } from './_collapsible_icons.jsx'
5
- export {default as CollapsibleState } from './_collapsible_state.jsx'
5
+ export { default as CollapsibleState } from './_collapsible_state.jsx'
6
+ export { default as CollapsibleCustomMain } from './_collapsible_custom_main.jsx'
@@ -75,13 +75,23 @@ export default class PbCollapsible extends PbEnhancedElement {
75
75
  this.displayUpArrow()
76
76
  }
77
77
 
78
+ toggleArrows(showDownArrow) {
79
+ const downArrow = this.element.querySelector(DOWN_ARROW_SELECTOR);
80
+ const upArrow = this.element.querySelector(UP_ARROW_SELECTOR);
81
+
82
+ if (downArrow) {
83
+ downArrow.style.display = showDownArrow ? 'inline-block' : 'none';
84
+ }
85
+ if (upArrow) {
86
+ upArrow.style.display = showDownArrow ? 'none' : 'inline-block';
87
+ }
88
+ }
89
+
78
90
  displayDownArrow() {
79
- this.element.querySelector(DOWN_ARROW_SELECTOR).style.display = 'inline-block'
80
- this.element.querySelector(UP_ARROW_SELECTOR).style.display = 'none'
91
+ this.toggleArrows(true);
81
92
  }
82
-
93
+
83
94
  displayUpArrow() {
84
- this.element.querySelector(UP_ARROW_SELECTOR).style.display = 'inline-block'
85
- this.element.querySelector(DOWN_ARROW_SELECTOR).style.display = 'none'
86
- }
95
+ this.toggleArrows(false);
96
+ }
87
97
  }
@@ -53,7 +53,7 @@ const adjustAxisStyle = (axis) => {
53
53
  /* Change axis label styles */
54
54
  axis.labels.style.fontFamily = typography.font_family_base
55
55
  axis.labels.style.color = colors.charcoal
56
- axis.labels.style.fontWeight = typography.regular
56
+ axis.labels.style.fontWeight = typography.light
57
57
  axis.labels.style.fontSize = typography.font_small
58
58
  }
59
59
 
@@ -27,7 +27,7 @@ const highchartsDarkTheme: ThemeProps = {
27
27
  style: {
28
28
  color: colors.text_dk_default,
29
29
  fontFamily: typography.font_family_base,
30
- fontWeight: typography.bold,
30
+ fontWeight: typography.regular,
31
31
  fontSize: typography.heading_3,
32
32
  },
33
33
  },
@@ -27,7 +27,7 @@ const highchartsTheme: ThemeProps = {
27
27
  style: {
28
28
  color: colors.text_lt_default,
29
29
  fontFamily: typography.font_family_base,
30
- fontWeight: typography.bold,
30
+ fontWeight: typography.regular,
31
31
  fontSize: typography.heading_3,
32
32
  },
33
33
  },
@@ -55,7 +55,7 @@ $form_pill_colors: (
55
55
  height: fit-content;
56
56
  height: -moz-fit-content;
57
57
  .pb_form_pill_text, .pb_form_pill_close, .pb_form_pill_tag {
58
- font-size: $font_base;
58
+ font-size: 16px;
59
59
  font-weight: $regular;
60
60
  }
61
61
  .pb_form_pill_text, .pb_form_pill_tag {
@@ -5,11 +5,10 @@
5
5
  @mixin pb_title(
6
6
  $fontSize: $heading_1,
7
7
  $fontWeight: $lighter,
8
- $lineHeight: $lh_tighter,
9
- $letterSpacing: $lspace_tight
8
+ $lineHeight: $lh_tighter
10
9
  ){
11
10
  font-size: $fontSize;
12
- letter-spacing: $letterSpacing;
11
+ letter-spacing: $lspace_tight;
13
12
  font-weight: $fontWeight;
14
13
  color: $text_lt_default;
15
14
  margin: 0;
@@ -30,7 +29,8 @@
30
29
  }
31
30
 
32
31
  @mixin pb_title_4 {
33
- @include pb_title($heading_4, $bolder, $letterSpacing: $lspace_normal);
32
+ @include pb_title($heading_4, $bolder);
33
+ letter-spacing: -0.03em;
34
34
  }
35
35
 
36
36
  @mixin pb_title_dark {
@@ -1,11 +1,11 @@
1
- $font_family_base: "Power Centra", "Helvetica Neue", Helvetica, Arial, sans_serif !default;
1
+ $font_family_base: "Proxima Nova", "Helvetica Neue", Helvetica, Arial, sans_serif !default;
2
2
 
3
3
  /* CLEAN UP AND REMOVE */
4
4
  $font_jumbo: 36px !default;
5
5
  $font_largest: 32px !default;
6
- $font_larger: 27px !default;
6
+ $font_larger: 28px !default;
7
7
  $font_large: 20px !default;
8
- $font_base: 15.5px !default;
8
+ $font_base: 16px !default;
9
9
  $font_default: $font_base !default;
10
10
  $font_normal: $font_base !default;
11
11
  $font_medium: $font_base !default;
@@ -26,8 +26,8 @@ $text_smaller: $font_smaller !default;
26
26
  $text_smallest: $font_smallest !default;
27
27
 
28
28
  /* Headings */
29
- $heading_1: 44px !default;
30
- $heading_2: 32px !default;
29
+ $heading_1: 46px !default;
30
+ $heading_2: 34px !default;
31
31
  $heading_3: $font_larger !default;
32
32
  $heading_4: $font_base !default;
33
33
 
@@ -35,19 +35,19 @@ $heading_4: $font_base !default;
35
35
  $lspace_tightest: -.1em !default;
36
36
  $lspace_tighter: -.07em !default;
37
37
  $lspace_tight: -.01em !default;
38
- $lspace_normal: .003em !default;
38
+ $lspace_normal: 0 !default;
39
39
  $lspace_loose: .03em !default;
40
40
  $lspace_looser: .07em !default;
41
41
  $lspace_loosest: .1em !default;
42
42
  $lspace_super_loosest: .2em !default;
43
43
 
44
44
  /* Standard Font Weights */
45
- $bold: 700 !default;
45
+ $bold: 600 !default;
46
46
  $regular: 400 !default;
47
47
 
48
48
  /* Non_Standard Font Weights */
49
- $extrabold: 700 !default;
50
- $boldest: 700 !default;
49
+ $extrabold: 900 !default;
50
+ $boldest: 800 !default;
51
51
  $bolder: 700 !default;
52
52
  $light: 300 !default;
53
- $lighter: 300 !default;
53
+ $lighter: 100 !default;