playbook_ui 14.0.0.pre.alpha.PBNTR416formpillsizes3521 → 14.0.0.pre.alpha.PLAY1475bumpaxecoredependency3483

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: ea3c69b9c2b5783ce5705c518e323adcf53ca682d4e0ef23e41db041e2748c2f
4
- data.tar.gz: 60fc36ea7adee27547a5e96fd61f5ea1e9aeba509511eb4d55a83e464cc4ee2d
3
+ metadata.gz: 2abd5d33f04276dea9344ad26c67d1307e944b5627cf95aeb50eb60db7ea93d5
4
+ data.tar.gz: '096e6c48b3f6e9f301cb36155dd2c94dc942238049c486c3433a349a90c7311b'
5
5
  SHA512:
6
- metadata.gz: 4e91bbdd240472b13de70c5166769164fe7311d94003237bf9cf82d1ddaf6a1b935f3307901e7bf4a847de519619329abddcdc82f77fec8450ee284ac52438c7
7
- data.tar.gz: 920a6c9a3e83ae944b77a466578f9735cf2ac8b1f19cb98f846318f786f9eeaaea0e1819ab47f17475d0cac8905d8e3fed1cdf39a71d6ec0fba642c731027aa6
6
+ metadata.gz: 1d80b5d648f3d2ccf778878ba4dfcd71aab3a6b8923dad57591c8082331813a783bf2260aae48d6cf903d8d87e2a1b3025071a2c1fdbee315879a82a51fe5a91
7
+ data.tar.gz: 6f9b724b58caa5ad0bba0fde990e815cbbbb507d8563eb13fc13545f3734ac6a46a791836deb50d6f18344810fe34dccc21ac50527601726b42af0afb98a189a
@@ -3,10 +3,9 @@
3
3
  @import "../tokens/opacity";
4
4
  @import "../tokens/shadows";
5
5
  @import "../pb_avatar/avatar";
6
- @import "../tokens/typography";
7
6
 
8
7
  $selector: ".pb_form_pill";
9
- $pb_form_pill_height: 27px;
8
+ $pb_form_pill_height: 37px;
10
9
  $form_pill_colors: (
11
10
  primary: map-get($status_color_text, "primary"),
12
11
  neutral: map-get($status_color_text, "neutral"),
@@ -17,24 +16,18 @@ $form_pill_colors: (
17
16
  display: inline-flex;
18
17
  justify-content: center;
19
18
  align-items: center;
20
- padding: 0 calc($space-md/2);
19
+ padding: 0 calc($space-sm/3);
21
20
  height: $pb_form_pill_height;
22
21
  border-radius: calc($pb_form_pill_height/2);
23
22
  margin-bottom: 2px;
24
23
  margin-top: 2px;
25
24
  cursor: pointer;
26
- .pb_form_pill_text, .pb_form_pill_close, .pb_form_pill_tag{
27
- font-size: $font_small !important;
28
- }
29
25
  @each $color_name, $color_value in $form_pill_colors {
30
26
  &[class*=_#{$color_name}] {
31
27
  background-color: mix($color_value, $card_light, 10%);
32
28
  @if ($color_name == "neutral") {
33
29
  background-color: $white;
34
30
  border: 1px solid $border_light;
35
- .pb_form_pill_icon {
36
- color: $text_lt_default;
37
- }
38
31
  }
39
32
  transition: background-color 0.2s ease;
40
33
  box-shadow: none;
@@ -58,18 +51,20 @@ $form_pill_colors: (
58
51
  @if ($color_name == "neutral") {
59
52
  color: $text_lt_default;
60
53
  }
61
- padding: 0 $space-xs;
54
+ padding-left: $space-sm;
55
+ padding-right: calc($space-sm/2);
62
56
  }
63
57
  #{$selector}_close {
64
58
  color: $color_value;
59
+ padding-left: calc($space-sm/4);
60
+ padding-right: calc($space-sm/4);
65
61
  display: flex;
66
62
  align-items: center;
67
- height: 17px;
68
- border-radius: calc(50%);
63
+ // I had to temporarily change height to 27px so new hover state darker background forms a circle not an oval
64
+ // before size change (ticket 2 of 4) - change back to 100% when $pb_form_pill_height changed to 27px from 37px
65
+ height: 27px;
66
+ border-radius: 70px;
69
67
  cursor: pointer;
70
- @if ($color_name == "neutral") {
71
- color: $text_lt_default;
72
- }
73
68
  &:hover {
74
69
  background-color: mix($color_value, $card_light, 40%);
75
70
  @if ($color_name == "neutral") {
@@ -79,7 +74,7 @@ $form_pill_colors: (
79
74
  }
80
75
  #{$selector}_tag {
81
76
  color: $color_value;
82
- padding: 0 $space-xs;
77
+ padding-left: $space-sm;
83
78
  @if ($color_name == "neutral") {
84
79
  color: $text_lt_default;
85
80
  }
@@ -97,37 +92,24 @@ $form_pill_colors: (
97
92
  .pb_form_pill_icon {
98
93
  height: 12px !important;
99
94
  width: 12px !important;
100
- padding-right: $space_xs;
101
- + .pb_form_pill_text, + .pb_form_pill_tag {
102
- padding-left: 0;
103
- }
104
95
  }
105
96
  &.small {
106
- height: 17px;
107
- padding: 0 $space-xs;
97
+ height: fit-content;
98
+ height: -moz-fit-content;
108
99
  .pb_form_pill_text, .pb_form_pill_close, .pb_form_pill_tag {
109
- font-size: $font_smallest !important;
100
+ font-size: $font_base;
101
+ font-weight: $regular;
110
102
  }
111
103
  .pb_form_pill_text, .pb_form_pill_tag {
112
104
  line-height: 1.7;
113
- padding: 0 $space_xxs;
114
- }
115
- .pb_form_pill_close {
116
- height: 10px;
117
- border-radius: calc(50%);
105
+ padding-left: $space_xs;
106
+ padding-right: 2px;
118
107
  }
119
- [class^=pb_avatar_kit] .avatar_wrapper {
120
- flex-basis: 16px;
121
- height: 16px;
122
- margin-top: 2px;
123
- width: 16px;
124
- &::before { line-height: 16.5px; }
125
- }
126
- .pb_form_pill_icon {
127
- padding-right: $space_xxs;
128
- + .pb_form_pill_text, + .pb_form_pill_tag {
129
- padding-left: 0;
130
- }
108
+ [class^=pb_avatar_kit], [class^=pb_avatar_kit] .avatar_wrapper {
109
+ width: 20px;
110
+ height: 20px;
111
+ flex-basis: 20px;
112
+ &::before { line-height: 21px; }
131
113
  }
132
114
  }
133
115
  &.dark {
@@ -136,7 +118,7 @@ $form_pill_colors: (
136
118
  // Primary and Neutral are exceptions to the general rule in the handoff
137
119
  &[class*=_#{$color_name}] {
138
120
  // background-color: mix($color_value, $card_dark, 10%);
139
- // .pb_form_pill_text, .pb_form_pill_tag, .pb_form_pill_icon {
121
+ // .pb_form_pill_tag {
140
122
  // color: $color_name;
141
123
  // }
142
124
  // .pb_form_pill_close {
@@ -154,7 +136,7 @@ $form_pill_colors: (
154
136
  @if ($color_name == "neutral") {
155
137
  background-color: transparent;
156
138
  border: 1px solid $border_dark;
157
- .pb_form_pill_text, .pb_form_pill_tag, .pb_form_pill_icon {
139
+ .pb_form_pill_text, .pb_form_pill_tag {
158
140
  color: $text_dk_default;
159
141
  }
160
142
  .pb_form_pill_close {
@@ -175,7 +157,7 @@ $form_pill_colors: (
175
157
  }
176
158
  @if ($color_name == "primary") {
177
159
  background-color: mix($active_dark, $card_dark, 10%);
178
- .pb_form_pill_text, .pb_form_pill_tag, .pb_form_pill_icon {
160
+ .pb_form_pill_text, .pb_form_pill_tag {
179
161
  color: $active_dark;
180
162
  }
181
163
  .pb_form_pill_close {
@@ -46,7 +46,6 @@ const FormPill = (props: FormPillProps): React.ReactElement => {
46
46
  } = props
47
47
 
48
48
  const iconClass = icon ? "_icon" : ""
49
- const closeIconSize = size === "small" ? "xs" : "sm"
50
49
  const css = classnames(
51
50
  `pb_form_pill_kit_${color}${iconClass}`,
52
51
  globalProps(props),
@@ -70,7 +69,7 @@ const FormPill = (props: FormPillProps): React.ReactElement => {
70
69
  <Avatar
71
70
  imageUrl={avatarUrl}
72
71
  name={name}
73
- size="xxs"
72
+ size="xs"
74
73
  status={null}
75
74
  />
76
75
  <Title
@@ -85,7 +84,7 @@ const FormPill = (props: FormPillProps): React.ReactElement => {
85
84
  <Avatar
86
85
  imageUrl={avatarUrl}
87
86
  name={name}
88
- size="xxs"
87
+ size="xs"
89
88
  status={null}
90
89
  />
91
90
  <Title
@@ -95,7 +94,6 @@ const FormPill = (props: FormPillProps): React.ReactElement => {
95
94
  />
96
95
  <Icon
97
96
  className="pb_form_pill_icon"
98
- color={color}
99
97
  icon={icon}
100
98
  />
101
99
  </>
@@ -104,7 +102,6 @@ const FormPill = (props: FormPillProps): React.ReactElement => {
104
102
  <>
105
103
  <Icon
106
104
  className="pb_form_pill_icon"
107
- color={color}
108
105
  icon={icon}
109
106
  />
110
107
  <Title
@@ -129,7 +126,6 @@ const FormPill = (props: FormPillProps): React.ReactElement => {
129
126
  <Icon
130
127
  fixedWidth
131
128
  icon="times"
132
- size={closeIconSize}
133
129
  />
134
130
  </div>
135
131
  </div>
@@ -5,11 +5,11 @@ examples:
5
5
  - form_pill_size: Form Pill Size
6
6
  - form_pill_tag: Form Pill Tag
7
7
  - form_pill_example: Example
8
- - form_pill_icon: Form Pill Icon
8
+ # - form_pill_icon: Form Pill Icon
9
9
 
10
10
  react:
11
11
  - form_pill_user: Form Pill User
12
12
  - form_pill_size: Form Pill Size
13
13
  - form_pill_tag: Form Pill Tag
14
14
  - form_pill_example: Example
15
- - form_pill_icon: Form Pill Icon
15
+ # - form_pill_icon: Form Pill Icon
@@ -1,19 +1,19 @@
1
1
  <%= content_tag(:div, id: object.id, data: object.data, class: object.classname + object.size_class, tabindex: object.tabindex, **combined_html_options) do %>
2
2
  <% if object.name.present? %>
3
- <%= pb_rails("avatar", props: { name: object.name, image_url: object.avatar_url, size: "xxs" }) %>
3
+ <%= pb_rails("avatar", props: { name: object.name, image_url: object.avatar_url, size: "xs" }) %>
4
4
  <%= pb_rails("title", props: { text: object.name, size: 4, classname: "pb_form_pill_text" }) %>
5
5
  <% if object.icon.present? %>
6
- <%= pb_rails("icon", props: { classname: "pb_form_pill_icon", color: object.color, icon: object.icon }) %>
6
+ <%= pb_rails("icon", props: { classname: "pb_form_pill_icon", icon: object.icon }) %>
7
7
  <% end %>
8
8
  <% elsif object.text.present? %>
9
9
  <% if object.icon.present? %>
10
- <%= pb_rails("icon", props: { classname: "pb_form_pill_icon", color: object.color, icon: object.icon }) %>
10
+ <%= pb_rails("icon", props: { classname: "pb_form_pill_icon", icon: object.icon }) %>
11
11
  <% end %>
12
12
  <% if object.text.present? %>
13
13
  <%= pb_rails("title", props: { text: object.text, size: 4, classname: "pb_form_pill_tag" }) %>
14
14
  <% end %>
15
15
  <% end %>
16
16
  <%= pb_rails("body", props: { classname: "pb_form_pill_close" }) do %>
17
- <%= pb_rails("icon", props: { icon: 'times', fixed_width: true, size: object.close_icon_size }) %>
17
+ <%= pb_rails("icon", props: { icon: 'times' , fixed_width: true }) %>
18
18
  <% end %>
19
19
  <% end %>
@@ -32,10 +32,6 @@ module Playbook
32
32
  def icon_class
33
33
  icon ? "icon" : nil
34
34
  end
35
-
36
- def close_icon_size
37
- size == "small" ? "xs" : "sm"
38
- end
39
35
  end
40
36
  end
41
37
  end
@@ -469,6 +469,7 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
469
469
  <FormPill
470
470
  key={index}
471
471
  onClick={(event: any) => handlePillClose(event, item)}
472
+ size="small"
472
473
  text={item.label}
473
474
  />
474
475
  ))
@@ -481,6 +482,7 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
481
482
  <FormPill
482
483
  key={index}
483
484
  onClick={(event: any) => handlePillClose(event, item)}
485
+ size="small"
484
486
  text={item.label}
485
487
  />
486
488
  ))