playbook_ui 14.1.0.pre.alpha.PBNTR462starratingdefaultvalue3582 → 14.1.0.pre.alpha.fixaction3547
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 +4 -4
- data/app/pb_kits/playbook/_playbook.scss +0 -2
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +3 -3
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +1 -1
- data/app/pb_kits/playbook/pb_badge/_badge.scss +0 -9
- data/app/pb_kits/playbook/pb_badge/_badge.tsx +3 -8
- data/app/pb_kits/playbook/pb_badge/badge.rb +1 -1
- data/app/pb_kits/playbook/pb_badge/badge.test.js +11 -17
- data/app/pb_kits/playbook/pb_badge/docs/_badge_notification.html.erb +0 -13
- data/app/pb_kits/playbook/pb_badge/docs/_badge_notification.jsx +12 -31
- data/app/pb_kits/playbook/pb_button/_button.tsx +1 -4
- data/app/pb_kits/playbook/pb_button/button.html.erb +1 -1
- data/app/pb_kits/playbook/pb_button/button.rb +0 -4
- data/app/pb_kits/playbook/pb_date_time/dateTime.test.js +2 -2
- data/app/pb_kits/playbook/pb_dialog/_close_icon.tsx +1 -5
- data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +1 -3
- data/app/pb_kits/playbook/pb_dialog/dialog.test.jsx +1 -20
- data/app/pb_kits/playbook/pb_dialog/dialog_header.html.erb +1 -1
- data/app/pb_kits/playbook/pb_dialog/dialog_header.rb +0 -4
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_default.jsx +5 -1
- data/app/pb_kits/playbook/pb_dialog/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_dialog/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_filter/filter.rb +1 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +0 -1
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +25 -43
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +2 -6
- data/app/pb_kits/playbook/pb_form_pill/docs/example.yml +2 -2
- data/app/pb_kits/playbook/pb_form_pill/form_pill.html.erb +4 -4
- data/app/pb_kits/playbook/pb_form_pill/form_pill.rb +0 -4
- data/app/pb_kits/playbook/pb_icon/_icon.tsx +1 -1
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +2 -0
- data/app/pb_kits/playbook/pb_pagination/_pagination.scss +13 -49
- data/app/pb_kits/playbook/pb_pagination/docs/example.yml +1 -3
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +7 -0
- data/app/pb_kits/playbook/pb_popover/_popover.tsx +5 -10
- data/app/pb_kits/playbook/pb_rich_text_editor/_tiptap_styles.scss +76 -50
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_star_rating/index.js +41 -88
- data/app/pb_kits/playbook/pb_star_rating/star_rating.html.erb +2 -4
- data/app/pb_kits/playbook/pb_star_rating/star_rating.rb +0 -19
- data/app/pb_kits/playbook/pb_star_rating/subcomponents/_star_rating_display.tsx +2 -0
- data/app/pb_kits/playbook/pb_star_rating/subcomponents/_star_rating_interactive.tsx +1 -0
- data/app/pb_kits/playbook/pb_time/_time.tsx +8 -12
- data/app/pb_kits/playbook/pb_time/time.html.erb +3 -3
- data/app/pb_kits/playbook/pb_time/time.rb +0 -4
- data/app/pb_kits/playbook/utilities/globalPropNames.mjs +0 -1
- data/app/pb_kits/playbook/utilities/globalProps.ts +3 -20
- data/dist/chunks/_typeahead-D-4y9pbv.js +22 -0
- data/dist/chunks/_weekday_stacked-D5SswkOC.js +45 -0
- data/dist/chunks/{lib-DErGXNy3.js → lib-BE0Z3F7x.js} +2 -2
- data/dist/chunks/{pb_form_validation-BC6kh7Hu.js → pb_form_validation-TzZQ0Flx.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +0 -4
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/classnames.rb +0 -1
- data/lib/playbook/spacing.rb +2 -31
- data/lib/playbook/version.rb +1 -1
- metadata +9 -31
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_loading.jsx +0 -46
- data/app/pb_kits/playbook/pb_gantt_chart/_gantt_chart.scss +0 -3
- data/app/pb_kits/playbook/pb_gantt_chart/_gantt_chart.tsx +0 -72
- data/app/pb_kits/playbook/pb_gantt_chart/docs/_gantt_chart_default.jsx +0 -53
- data/app/pb_kits/playbook/pb_gantt_chart/docs/example.yml +0 -7
- data/app/pb_kits/playbook/pb_gantt_chart/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_gantt_chart/gantt_chart.test.jsx +0 -19
- data/app/pb_kits/playbook/pb_pagination/_pagination.tsx +0 -164
- data/app/pb_kits/playbook/pb_pagination/docs/_pagination_default.jsx +0 -19
- data/app/pb_kits/playbook/pb_pagination/docs/_pagination_default_react.md +0 -1
- data/app/pb_kits/playbook/pb_pagination/docs/_pagination_page_change.jsx +0 -62
- data/app/pb_kits/playbook/pb_pagination/docs/_pagination_page_change_react.md +0 -1
- data/app/pb_kits/playbook/pb_pagination/docs/data.js +0 -23
- data/app/pb_kits/playbook/pb_pagination/docs/index.js +0 -2
- data/app/pb_kits/playbook/pb_rich_text_editor/_previewer_mixin.scss +0 -132
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_preview.jsx +0 -73
- data/app/pb_kits/playbook/tokens/_container.scss +0 -21
- data/app/pb_kits/playbook/utilities/_min_width.scss +0 -45
- data/app/pb_kits/playbook/utilities/icons/allicons.tsx +0 -59
- data/app/pb_kits/playbook/utilities/icons/clock.svg +0 -9
- data/app/pb_kits/playbook/utilities/icons/spinner.svg +0 -3
- data/app/pb_kits/playbook/utilities/icons/times.svg +0 -3
- data/dist/chunks/_typeahead-Cq7RLPBA.js +0 -22
- data/dist/chunks/_weekday_stacked-Cykj5kLZ.js +0 -45
- /data/app/pb_kits/playbook/pb_pagination/docs/{_pagination_default_rails.md → _pagination_default.md} +0 -0
@@ -1,166 +1,119 @@
|
|
1
|
-
import PbEnhancedElement from "../pb_enhanced_element"
|
1
|
+
import PbEnhancedElement from "../pb_enhanced_element";
|
2
2
|
|
3
|
-
const
|
4
|
-
const
|
5
|
-
const STAR_RATING_INPUT_DATA_SELECTOR = "[data-pb-star-rating-input]"
|
3
|
+
const STAR_RATING_SELECTOR = "[data-pb-star-rating]";
|
4
|
+
const STAR_RATING_INPUT_ID = "star-rating-input";
|
6
5
|
|
7
6
|
export default class PbStarRating extends PbEnhancedElement {
|
8
7
|
static get selector() {
|
9
|
-
return
|
8
|
+
return STAR_RATING_SELECTOR;
|
10
9
|
}
|
11
10
|
|
12
11
|
connect() {
|
13
|
-
this.
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
addEventListeners() {
|
19
|
-
this.element.querySelectorAll(STAR_RATING_SELECTOR).forEach(star => {
|
20
|
-
star.addEventListener("click", (event) => {
|
21
|
-
const clickedStarId = event.currentTarget.id
|
22
|
-
this.updateStarColors(clickedStarId)
|
23
|
-
this.updateHiddenInputValue(clickedStarId)
|
24
|
-
this.clearFormValidation()
|
25
|
-
})
|
12
|
+
this.element.addEventListener("click", (event) => {
|
13
|
+
const clickedStarId = event.currentTarget.id;
|
14
|
+
this.updateStarColors(clickedStarId);
|
15
|
+
this.updateHiddenInputValue(clickedStarId);
|
16
|
+
});
|
26
17
|
|
18
|
+
document.querySelectorAll(STAR_RATING_SELECTOR).forEach(star => {
|
27
19
|
star.addEventListener("mouseenter", (event) => {
|
28
20
|
const hoveredStarId = event.currentTarget.id
|
29
|
-
this.updateStarHoverColors(hoveredStarId)
|
21
|
+
this.updateStarHoverColors(hoveredStarId);
|
30
22
|
})
|
31
23
|
|
32
24
|
star.addEventListener("mouseleave", () => {
|
33
|
-
this.removeStarHoverColors()
|
25
|
+
this.removeStarHoverColors();
|
34
26
|
})
|
35
27
|
|
36
28
|
star.addEventListener("keydown", (event) => {
|
37
29
|
if (event.key === 'Enter' || event.key === ' ') {
|
38
|
-
event.preventDefault()
|
39
|
-
this.handleStarClick(star.id)
|
30
|
+
event.preventDefault();
|
31
|
+
this.handleStarClick(star.id);
|
40
32
|
}
|
41
33
|
})
|
42
34
|
})
|
43
35
|
}
|
44
36
|
|
45
37
|
handleStarClick(starId) {
|
46
|
-
this.updateStarColors(starId)
|
47
|
-
this.updateHiddenInputValue(starId)
|
38
|
+
this.updateStarColors(starId);
|
39
|
+
this.updateHiddenInputValue(starId);
|
48
40
|
}
|
49
41
|
|
50
42
|
updateStarColors(clickedStarId) {
|
51
|
-
const allStars =
|
43
|
+
const allStars = document.querySelectorAll(STAR_RATING_SELECTOR);
|
52
44
|
|
53
45
|
allStars.forEach(star => {
|
54
|
-
const starId = star.id
|
55
|
-
const icon = star.querySelector(".interactive-star-icon")
|
46
|
+
const starId = star.id;
|
47
|
+
const icon = star.querySelector(".interactive-star-icon");
|
56
48
|
|
57
49
|
if (icon) {
|
58
50
|
if (starId <= clickedStarId) {
|
59
51
|
if (star.classList.contains("yellow_star")) {
|
60
|
-
icon.classList.add("yellow-star-selected")
|
52
|
+
icon.classList.add("yellow-star-selected");
|
61
53
|
} else if (star.classList.contains("primary_star_light")) {
|
62
|
-
icon.classList.add("primary-star-selected")
|
54
|
+
icon.classList.add("primary-star-selected");
|
63
55
|
} else if (star.classList.contains("primary_star_dark")) {
|
64
|
-
icon.classList.add("primary-star-selected")
|
56
|
+
icon.classList.add("primary-star-selected");
|
65
57
|
} else if (star.classList.contains("subtle_star_light")) {
|
66
|
-
icon.classList.add("subtle-star-selected")
|
58
|
+
icon.classList.add("subtle-star-selected");
|
67
59
|
} else if (star.classList.contains("subtle_star_dark")) {
|
68
|
-
icon.classList.add("subtle-star-selected")
|
60
|
+
icon.classList.add("subtle-star-selected");
|
69
61
|
} else {
|
70
|
-
icon.classList.add("yellow-star-selected")
|
62
|
+
icon.classList.add("yellow-star-selected");
|
71
63
|
}
|
72
64
|
} else {
|
73
|
-
icon.classList.remove("yellow-star-selected", "primary-star-selected", "subtle-star-selected")
|
65
|
+
icon.classList.remove("yellow-star-selected", "primary-star-selected", "subtle-star-selected");
|
74
66
|
}
|
75
|
-
icon.classList.remove("star-hovered")
|
67
|
+
icon.classList.remove("star-hovered");
|
76
68
|
}
|
77
|
-
})
|
69
|
+
});
|
78
70
|
}
|
79
71
|
|
80
72
|
updateHiddenInputValue(value) {
|
81
|
-
const hiddenInput =
|
73
|
+
const hiddenInput = document.getElementById(STAR_RATING_INPUT_ID);
|
82
74
|
if (hiddenInput) {
|
83
|
-
hiddenInput.value = value
|
75
|
+
hiddenInput.value = value;
|
84
76
|
}
|
85
77
|
}
|
86
78
|
|
87
79
|
updateStarHoverColors(hoveredStarId) {
|
88
|
-
const allStars =
|
80
|
+
const allStars = document.querySelectorAll(STAR_RATING_SELECTOR);
|
89
81
|
|
90
82
|
allStars.forEach(star => {
|
91
|
-
const starId = star.id
|
92
|
-
const icon = star.querySelector(".interactive-star-icon")
|
83
|
+
const starId = star.id;
|
84
|
+
const icon = star.querySelector(".interactive-star-icon");
|
93
85
|
|
94
86
|
if (icon) {
|
95
87
|
if (starId <= hoveredStarId) {
|
96
88
|
if (!icon.classList.contains("yellow-star-selected") &&
|
97
89
|
!icon.classList.contains("primary-star-selected") &&
|
98
90
|
!icon.classList.contains("subtle-star-selected")) {
|
99
|
-
icon.classList.add("star-hovered")
|
91
|
+
icon.classList.add("star-hovered");
|
100
92
|
}
|
101
93
|
} else {
|
102
|
-
icon.classList.remove("star-hovered")
|
94
|
+
icon.classList.remove("star-hovered");
|
103
95
|
}
|
104
96
|
}
|
105
|
-
})
|
97
|
+
});
|
106
98
|
}
|
107
99
|
|
108
100
|
|
109
101
|
removeStarHoverColors() {
|
110
|
-
const allStars =
|
102
|
+
const allStars = document.querySelectorAll(STAR_RATING_SELECTOR);
|
111
103
|
|
112
104
|
allStars.forEach(star => {
|
113
|
-
const icon = star.querySelector(".interactive-star-icon")
|
105
|
+
const icon = star.querySelector(".interactive-star-icon");
|
114
106
|
if (icon) {
|
115
107
|
if (!icon.classList.contains("yellow-star-selected") &&
|
116
108
|
!icon.classList.contains("primary-star-selected") &&
|
117
109
|
!icon.classList.contains("subtle-star-selected")) {
|
118
|
-
icon.classList.remove("star-hovered")
|
110
|
+
icon.classList.remove("star-hovered");
|
119
111
|
}
|
120
112
|
}
|
121
|
-
})
|
113
|
+
});
|
122
114
|
}
|
123
115
|
|
124
116
|
isStarSelected() {
|
125
|
-
return
|
126
|
-
}
|
127
|
-
|
128
|
-
handleFormReset() {
|
129
|
-
const form = this.element.closest("form")
|
130
|
-
if (form) {
|
131
|
-
form.addEventListener("reset", () => {
|
132
|
-
this.updateHiddenInputValue("")
|
133
|
-
this.resetStarRatingValues()
|
134
|
-
})
|
135
|
-
}
|
136
|
-
}
|
137
|
-
|
138
|
-
resetStarRatingValues() {
|
139
|
-
const allStars = this.element.querySelectorAll(STAR_RATING_SELECTOR)
|
140
|
-
allStars.forEach(star => {
|
141
|
-
const icon = star.querySelector(".interactive-star-icon")
|
142
|
-
if (icon) {
|
143
|
-
icon.classList.remove("yellow-star-selected", "primary-star-selected", "subtle-star-selected")
|
144
|
-
}
|
145
|
-
})
|
146
|
-
}
|
147
|
-
|
148
|
-
clearFormValidation() {
|
149
|
-
const hiddenInput = this.element.querySelector(STAR_RATING_INPUT_DATA_SELECTOR)
|
150
|
-
if (hiddenInput.checkValidity()) {
|
151
|
-
const errorLabelElement = this.element.querySelector(".pb_body_kit_negative")
|
152
|
-
if (errorLabelElement) {
|
153
|
-
errorLabelElement.remove()
|
154
|
-
}
|
155
|
-
}
|
156
|
-
}
|
157
|
-
|
158
|
-
setDefaultValue() {
|
159
|
-
const hiddenInput = this.element.querySelector(STAR_RATING_INPUT_DATA_SELECTOR)
|
160
|
-
const defaultValue = hiddenInput.value
|
161
|
-
|
162
|
-
if (defaultValue) {
|
163
|
-
this.updateStarColors(defaultValue)
|
164
|
-
}
|
117
|
+
return document.querySelectorAll(".yellow-star-selected, .primary-star-selected, .subtle-star-selected").length > 0;
|
165
118
|
}
|
166
119
|
}
|
@@ -39,13 +39,11 @@
|
|
39
39
|
<% end %>
|
40
40
|
|
41
41
|
<% else %>
|
42
|
-
<%= pb_rails("flex", props: {
|
42
|
+
<%= pb_rails("flex", props: { orientation: "column" }) do %>
|
43
43
|
<% if object.label.present? %>
|
44
44
|
<%= pb_rails("caption", props: {text: object.label, margin_bottom:"xs"}) %>
|
45
45
|
<% end %>
|
46
|
-
|
47
|
-
<%= hidden_input_tag %>
|
48
|
-
|
46
|
+
<input type="hidden" id="star-rating-input" value="" name="<%= object.name %>"/>
|
49
47
|
<%= pb_rails("flex", props: { orientation: "row" }) do %>
|
50
48
|
<% object.denominator.times do |index| %>
|
51
49
|
<div data-pb-star-rating id="<%= index + 1 %>" class="<%= star_color %>">
|
@@ -30,11 +30,6 @@ module Playbook
|
|
30
30
|
default: "display"
|
31
31
|
prop :label, type: Playbook::Props::String
|
32
32
|
prop :name, type: Playbook::Props::String
|
33
|
-
prop :required, type: Playbook::Props::Boolean,
|
34
|
-
default: false
|
35
|
-
prop :input_options, type: Playbook::Props::HashProp,
|
36
|
-
default: {}
|
37
|
-
prop :default_value
|
38
33
|
|
39
34
|
def one_decimal_rating
|
40
35
|
rating.to_f.round(1)
|
@@ -111,20 +106,6 @@ module Playbook
|
|
111
106
|
def classname
|
112
107
|
generate_classname("pb_star_rating_kit")
|
113
108
|
end
|
114
|
-
|
115
|
-
def hidden_input_tag
|
116
|
-
tag(:input, all_input_options)
|
117
|
-
end
|
118
|
-
|
119
|
-
def all_input_options
|
120
|
-
input_options.merge(
|
121
|
-
data: { "pb-star-rating-input": true },
|
122
|
-
name: name,
|
123
|
-
required: required,
|
124
|
-
style: "display: none",
|
125
|
-
value: default_value || ""
|
126
|
-
)
|
127
|
-
end
|
128
109
|
end
|
129
110
|
end
|
130
111
|
end
|
@@ -36,6 +36,7 @@ const StarRatingDisplay = (props: StarRatingDisplayProps) => {
|
|
36
36
|
<Icon
|
37
37
|
className={starIcon[colorOption].className}
|
38
38
|
customIcon={starIcon[colorOption].icon as unknown as { [key: string]: SVGElement }}
|
39
|
+
icon=""
|
39
40
|
/>
|
40
41
|
</React.Fragment>
|
41
42
|
))}
|
@@ -44,6 +45,7 @@ const StarRatingDisplay = (props: StarRatingDisplayProps) => {
|
|
44
45
|
<Icon
|
45
46
|
className={starIcon[backgroundType].className}
|
46
47
|
customIcon={starIcon[backgroundType].icon as unknown as { [key: string]: SVGElement }}
|
48
|
+
icon=""
|
47
49
|
/>
|
48
50
|
</React.Fragment>
|
49
51
|
))}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import classnames from "classnames";
|
3
3
|
|
4
|
-
import { getAllIcons } from "../utilities/icons/allicons"
|
5
4
|
import { buildCss, buildHtmlProps } from "../utilities/props";
|
6
5
|
import { globalProps, GlobalProps } from "../utilities/globalProps";
|
7
6
|
import DateTime from '../pb_kit/dateTime';
|
@@ -43,7 +42,7 @@ const Time = (props: TimeProps): React.ReactElement => {
|
|
43
42
|
globalProps(props),
|
44
43
|
className
|
45
44
|
);
|
46
|
-
|
45
|
+
|
47
46
|
const htmlProps = buildHtmlProps(htmlOptions);
|
48
47
|
|
49
48
|
return (
|
@@ -55,10 +54,9 @@ const Time = (props: TimeProps): React.ReactElement => {
|
|
55
54
|
unstyled
|
56
55
|
? (
|
57
56
|
<span>
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
/>
|
57
|
+
<Icon fixedWidth
|
58
|
+
icon="clock"
|
59
|
+
/>
|
62
60
|
{" "}
|
63
61
|
</span>
|
64
62
|
)
|
@@ -67,12 +65,10 @@ const Time = (props: TimeProps): React.ReactElement => {
|
|
67
65
|
<Body color="light"
|
68
66
|
tag="span"
|
69
67
|
>
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
size={size === "md" ? "" : "sm"}
|
75
|
-
/>
|
68
|
+
<Icon fixedWidth
|
69
|
+
icon="clock"
|
70
|
+
size={size === "md" ? "" : "sm"}
|
71
|
+
/>
|
76
72
|
{" "}
|
77
73
|
</Body>
|
78
74
|
</>
|
@@ -13,7 +13,7 @@
|
|
13
13
|
<% if object.unstyled %>
|
14
14
|
<% if object.show_icon %>
|
15
15
|
<span>
|
16
|
-
<%= pb_rails("icon", props: {
|
16
|
+
<%= pb_rails("icon", props: { icon: "clock", fixed_width: true }) %>
|
17
17
|
</span>
|
18
18
|
<% end %>
|
19
19
|
|
@@ -27,7 +27,7 @@
|
|
27
27
|
<% elsif size == "md" %>
|
28
28
|
<% if object.show_icon %>
|
29
29
|
<%= pb_rails("body", props: { color: "light", tag: "span"}) do %>
|
30
|
-
<%= pb_rails("icon", props: {
|
30
|
+
<%= pb_rails("icon", props: { icon: "clock", fixed_width: true }) %>
|
31
31
|
<% end %>
|
32
32
|
<% end %>
|
33
33
|
|
@@ -41,7 +41,7 @@
|
|
41
41
|
<% else %>
|
42
42
|
<% if object.show_icon %>
|
43
43
|
<%= pb_rails("body", props: { color: "light", tag: "span"}) do %>
|
44
|
-
<%= pb_rails("icon", props: {
|
44
|
+
<%= pb_rails("icon", props: { icon: "clock", fixed_width: true, size: "sm" }) %>
|
45
45
|
<% end %>
|
46
46
|
<% end %>
|
47
47
|
|
@@ -94,10 +94,6 @@ type MaxWidth = {
|
|
94
94
|
maxWidth?: Sizes,
|
95
95
|
}
|
96
96
|
|
97
|
-
type MinWidth = {
|
98
|
-
minWidth?: Sizes,
|
99
|
-
}
|
100
|
-
|
101
97
|
type NumberSpacing = {
|
102
98
|
numberSpacing?: "tabular",
|
103
99
|
}
|
@@ -174,7 +170,7 @@ type ZIndex = {
|
|
174
170
|
export type GlobalProps = AlignContent & AlignItems & AlignSelf &
|
175
171
|
BorderRadius & Cursor & Dark & Display & DisplaySizes & Flex & FlexDirection &
|
176
172
|
FlexGrow & FlexShrink & FlexWrap & JustifyContent & JustifySelf &
|
177
|
-
LineHeight & Margin &
|
173
|
+
LineHeight & Margin & MaxWidth & NumberSpacing & Order & Overflow & Padding &
|
178
174
|
Position & Shadow & TextAlign & Truncate & VerticalAlign & ZIndex & { hover?: string } & Top & Right & Bottom & Left;
|
179
175
|
|
180
176
|
const getResponsivePropClasses = (prop: {[key: string]: string}, classPrefix: string) => {
|
@@ -198,14 +194,6 @@ const getPositioningPropsClasses = (position: string, value: Sizes | {value: str
|
|
198
194
|
return css;
|
199
195
|
};
|
200
196
|
|
201
|
-
const filterClassName = (value: string): string => {
|
202
|
-
if (value.includes("%")) {
|
203
|
-
return value.replace("%", "_percent");
|
204
|
-
} else {
|
205
|
-
return value;
|
206
|
-
}
|
207
|
-
};
|
208
|
-
|
209
197
|
// Prop categories
|
210
198
|
const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} = {
|
211
199
|
|
@@ -332,15 +320,10 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
|
|
332
320
|
css += numberSpacing ? `ns_${numberSpacing} ` : ''
|
333
321
|
return css
|
334
322
|
},
|
335
|
-
minWidthProps: ({ minWidth }: MinWidth) => {
|
336
|
-
let css = ''
|
337
|
-
css += minWidth ? `min_width_${filterClassName(minWidth)} ` : ''
|
338
|
-
return css.trimEnd()
|
339
|
-
},
|
340
323
|
maxWidthProps: ({ maxWidth }: MaxWidth) => {
|
341
324
|
let css = ''
|
342
|
-
css += maxWidth ? `max_width_${
|
343
|
-
return css
|
325
|
+
css += maxWidth ? `max_width_${maxWidth } ` : ''
|
326
|
+
return css
|
344
327
|
},
|
345
328
|
zIndexProps: (zIndex: ZIndex) => {
|
346
329
|
let css = ''
|