playbook_ui 14.6.1 → 14.6.2.pre.alpha.PLAY1485selectablecardoverflowoutlinebug4274

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: 7f6ea7da8d2792558be3547ba7f887dadbef40b7cc6e852865eccaf4c84a3026
4
- data.tar.gz: 24c904059667b83f19598861f87fb05348151ea3e2fcb57a0d092107480f5b76
3
+ metadata.gz: b71c4b2a395af6da68e3af1572a6017af6a9e5295f52b94457ca6c0ad8dcc38f
4
+ data.tar.gz: 508acfe334924d8e006974817f578a4bb7273058a820acb946e882a4cf14b0bc
5
5
  SHA512:
6
- metadata.gz: 82b8062e404c3ca8136f06c214176e53454f60576e3e3ec367f78b176726f925bf60ef71c18e94850f6a932c1dd78872f735a3c4ec7b18dc6f71485c0bdc2171
7
- data.tar.gz: 725519a7cd656ab4c3a81f1b2fb9114d99c660e4bcde7ea420a3b303922d0f82a8631d77fc9175bcdb44466dae2c3d07663ffa010f76939e2f3103bfb5591c84
6
+ metadata.gz: 1257a96645ecf4f5fd4f635b5550134c4226147233720cfd3e560a0439690b53e76017a5520e8aadef384733c67f955e96bcec150ac6de030e19788f565ad1d0
7
+ data.tar.gz: bc83b14f9ad21018f572bf3ead1aef4ed7c69495a9d2c56e747d7b4a3ff8f3f6405fb392fe80009111c5cff677177ddcced0c06e876d97b71d1bcd4cd09936a5
@@ -28,8 +28,7 @@ $pb_card_header_colors: map-merge(map-merge($product_colors, $additional_colors)
28
28
 
29
29
  @mixin pb_card_selected($border_color: $primary) {
30
30
  border-color: $border_color;
31
- border-width: $pb_card_border_width;
32
- outline: 1px solid $border_color;
31
+ border-width: $pb_card_border_width * 2;
33
32
  }
34
33
 
35
34
  @mixin pb_card_selected_dark {
@@ -9,7 +9,7 @@
9
9
 
10
10
  @import "./scss_partials/dropdown_animation";
11
11
 
12
- .pb_dropdown {
12
+ [class*="pb_dropdown"] {
13
13
  .dropdown_wrapper {
14
14
  [class*="dropdown_trigger_wrapper"] {
15
15
  @include pb_body;
@@ -131,7 +131,7 @@
131
131
  }
132
132
  }
133
133
 
134
- &.separators_hidden {
134
+ &[class*="separators_hidden"] {
135
135
  .dropdown_wrapper {
136
136
  .pb_dropdown_container {
137
137
 
@@ -142,7 +142,7 @@
142
142
  }
143
143
  }
144
144
 
145
- &.subtle {
145
+ &[class*="subtle"] {
146
146
  .dropdown_wrapper {
147
147
  .pb_dropdown_container {
148
148
 
@@ -178,7 +178,7 @@
178
178
  }
179
179
  }
180
180
 
181
- &.separators_hidden {
181
+ &[class*="separators_hidden"] {
182
182
  .dropdown_wrapper {
183
183
  .pb_dropdown_container {
184
184
  [class*="pb_dropdown_option"]:first-child {
@@ -74,10 +74,8 @@ const Dropdown = forwardRef((props: DropdownProps, ref: any) => {
74
74
  const htmlProps = buildHtmlProps(htmlOptions);
75
75
  const separatorsClass = separators ? '' : 'separators_hidden'
76
76
  const classes = classnames(
77
- buildCss("pb_dropdown"),
77
+ buildCss("pb_dropdown", variant, separatorsClass),
78
78
  globalProps(props),
79
- variant,
80
- separatorsClass,
81
79
  className
82
80
  );
83
81
 
@@ -24,7 +24,7 @@ module Playbook
24
24
  end
25
25
 
26
26
  def classname
27
- generate_classname("pb_dropdown", variant, separators_class, separator: " ")
27
+ generate_classname("pb_dropdown", variant, separators_class)
28
28
  end
29
29
 
30
30
  private
@@ -38,7 +38,7 @@ module Playbook
38
38
  end
39
39
 
40
40
  def separators_class
41
- separators ? "" : "separators_hidden"
41
+ separators ? nil : "separators_hidden"
42
42
  end
43
43
 
44
44
  def options_with_blank
@@ -50,7 +50,7 @@ test('generated default kit and classname', () => {
50
50
 
51
51
  const kit = screen.getByTestId(testId)
52
52
  expect(kit).toBeInTheDocument()
53
- expect(kit).toHaveClass('pb_dropdown')
53
+ expect(kit).toHaveClass('pb_dropdown_default')
54
54
  })
55
55
 
56
56
  test('generated default Trigger and Container when none passed in', () => {
@@ -10,6 +10,24 @@
10
10
  $pb_selectable_card_indicator_size: 22px;
11
11
  $pb_selectable_card_border: 2px;
12
12
 
13
+ $pb_selectable_space_classes: (
14
+ xxs: $space_xxs,
15
+ xs: $space_xs,
16
+ sm: $space_sm,
17
+ md: $space_md,
18
+ lg: $space_lg,
19
+ xl: $space_xl,
20
+ );
21
+ $pb_selectable_paddings: (
22
+ p: "padding",
23
+ pr: "padding-right",
24
+ pl: "padding-left",
25
+ pt: "padding-top",
26
+ pb: "padding-bottom",
27
+ px: ("padding-left", "padding-right"),
28
+ py: ("padding-top", "padding-bottom")
29
+ );
30
+
13
31
  [class^=pb_selectable_card_kit] {
14
32
  display: block;
15
33
  margin-bottom: 0;
@@ -28,7 +46,6 @@ $pb_selectable_card_border: 2px;
28
46
  padding: $space_sm;
29
47
  margin-bottom: $space_sm;
30
48
  cursor: pointer;
31
- outline: 1px solid transparent;
32
49
 
33
50
  @media (hover:hover) {
34
51
  &:hover {
@@ -74,6 +91,7 @@ $pb_selectable_card_border: 2px;
74
91
 
75
92
  position: relative;
76
93
  @include pb_card_selected;
94
+ padding: calc(#{$space_sm} - 1px);
77
95
  transition-property: none;
78
96
  transition-duration: 0s;
79
97
 
@@ -88,6 +106,54 @@ $pb_selectable_card_border: 2px;
88
106
  background-color: $royal;
89
107
  }
90
108
  }
109
+
110
+ // Selected card has 1px more border
111
+ // Remove 1px so content does not "jump"
112
+ @each $position_name,
113
+ $position in $pb_selectable_paddings {
114
+ @each $space_name,
115
+ $space in $pb_selectable_space_classes {
116
+ ~ label.#{$position_name}_#{$space_name} {
117
+ @if type-of($position)=="list" {
118
+ @each $coordinate in $position {
119
+ #{$coordinate}: calc(#{$space} - 1px) !important;
120
+ }
121
+ }
122
+
123
+ @else {
124
+ #{$position}: calc(#{$space} - 1px) !important;
125
+ }
126
+ }
127
+ }
128
+ }
129
+ }
130
+ }
131
+
132
+ &.display_input {
133
+ input[type="checkbox"],
134
+ input[type="radio"] {
135
+ &:checked {
136
+ ~label {
137
+ border-width: $pb_card_border_width;
138
+ outline: 1px solid $primary;
139
+ }
140
+
141
+ }
142
+ }
143
+
144
+ > label {
145
+ outline: 1px solid transparent;
146
+ padding: $space_sm;
147
+ }
148
+
149
+ &.dark {
150
+ input[type="checkbox"],
151
+ input[type="radio"] {
152
+ &:checked ~ label {
153
+ border-width: $pb_card_border_width;
154
+ outline: 1px solid $primary;
155
+ }
156
+ }
91
157
  }
92
158
  }
93
159
 
@@ -67,6 +67,7 @@ const SelectableCard = (props: SelectableCardProps) => {
67
67
  'disabled': disabled,
68
68
  'enabled': !disabled,
69
69
  }),
70
+ variant === 'displayInput' ? 'display_input' : '',
70
71
  { error },
71
72
  dark ? 'dark' : '',
72
73
  className
@@ -25,7 +25,7 @@
25
25
  <% end %>
26
26
  <div class="separator"></div>
27
27
  <div class="psuedo_separator"></div>
28
- <%= pb_rails("card", props: { padding: "sm", status: object.status, border_none: true }) do %>
28
+ <%= pb_rails("card", props: { padding: "sm", status: object.status, border_none: true, dark: object.dark }) do %>
29
29
  <% if content.nil? %>
30
30
  <%= pb_rails("body", props: { text: object.text }) %>
31
31
  <% else %>
@@ -25,7 +25,7 @@ module Playbook
25
25
 
26
26
  def classname
27
27
  [
28
- generate_classname_without_spacing("pb_selectable_card_kit", checked_class, enable_disabled_class),
28
+ generate_classname_without_spacing("pb_selectable_card_kit", checked_class, enable_disabled_class) + display_input_class,
29
29
  error_class,
30
30
  dark_props,
31
31
  ].compact.join(" ")
@@ -79,6 +79,10 @@ module Playbook
79
79
  def error_class
80
80
  error ? "error" : nil
81
81
  end
82
+
83
+ def display_input_class
84
+ variant == "display_input" ? " display_input" : ""
85
+ end
82
86
  end
83
87
  end
84
88
  end