playbook_ui 14.1.0.pre.alpha.pbntr373enablekitsforradio3595 → 14.1.0
Sign up to get free protection for your applications and to get access to all the features.
- 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_radio/_radio.scss +2 -2
- data/app/pb_kits/playbook/pb_radio/_radio.tsx +50 -100
- data/app/pb_kits/playbook/pb_radio/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_radio/docs/index.js +0 -1
- 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 -78
- 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 -17
- 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-D6PRvP-1.js +22 -0
- data/dist/chunks/_weekday_stacked-DbdEuIzh.js +45 -0
- data/dist/chunks/lazysizes-DHz07jlL.js +1 -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 +2 -2
- metadata +13 -36
- 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_radio/docs/_radio_children.jsx +0 -51
- 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-CTLaD81v.js +0 -22
- data/dist/chunks/_weekday_stacked-U-4S3-tB.js +0 -45
- data/dist/chunks/lazysizes-B7xYodB-.js +0 -1
- /data/app/pb_kits/playbook/pb_pagination/docs/{_pagination_default_rails.md → _pagination_default.md} +0 -0
@@ -6,7 +6,6 @@
|
|
6
6
|
@import "../tokens/typography";
|
7
7
|
@import "../tokens/shadows";
|
8
8
|
@import "../tokens/transition";
|
9
|
-
@import "previewer_mixin";
|
10
9
|
|
11
10
|
[class^="pb_rich_text_editor_kit"] {
|
12
11
|
.toolbar_button {
|
@@ -86,44 +85,109 @@
|
|
86
85
|
}
|
87
86
|
|
88
87
|
code {
|
89
|
-
|
88
|
+
font-family: monospace;
|
89
|
+
background: $bg_light;
|
90
|
+
padding: 0.1rem 0.3rem;
|
91
|
+
margin: 0 5px;
|
92
|
+
box-shadow: 0 2px 10px $shadow;
|
93
|
+
border-radius: 0.25rem;
|
94
|
+
overflow: hidden;
|
95
|
+
font-size: ($text_small - 1px);
|
90
96
|
}
|
91
97
|
|
92
98
|
pre {
|
93
|
-
|
99
|
+
background: $bg_dark;
|
100
|
+
padding: $space_sm;
|
101
|
+
border-radius: $border_rad_heaviest;
|
102
|
+
margin: 1.5rem 0 2rem 0;
|
103
|
+
code {
|
104
|
+
background: transparent;
|
105
|
+
box-shadow: none;
|
106
|
+
border: 0;
|
107
|
+
color: #faf6e4;
|
108
|
+
}
|
94
109
|
}
|
95
110
|
a {
|
96
|
-
|
111
|
+
color: $primary;
|
112
|
+
border-bottom: 1px solid $primary;
|
113
|
+
&:hover {
|
114
|
+
color: $text_lt_default;
|
115
|
+
border-bottom: 1px solid $text_lt_default;
|
116
|
+
}
|
97
117
|
}
|
98
118
|
blockquote {
|
99
|
-
|
119
|
+
font-size: $font_larger;
|
120
|
+
padding: $space_sm $space_md;
|
121
|
+
font-style: italic;
|
122
|
+
p {
|
123
|
+
margin: 0;
|
124
|
+
}
|
100
125
|
}
|
101
126
|
&:focus-visible {
|
102
127
|
outline: unset;
|
103
128
|
@include transition_default;
|
104
129
|
}
|
105
130
|
h1 {
|
106
|
-
|
131
|
+
font-size: $text_largest;
|
132
|
+
line-height: $text_larger;
|
133
|
+
font-weight: $bolder;
|
134
|
+
letter-spacing: $lspace_tight;
|
135
|
+
margin: 2.1rem 0 0 0;
|
107
136
|
}
|
108
137
|
h2 {
|
109
|
-
|
138
|
+
font-size: $text_larger;
|
139
|
+
line-height: $text_larger;
|
140
|
+
font-weight: $bolder;
|
141
|
+
letter-spacing: $lspace_tight;
|
142
|
+
margin: 1.9rem 0 0 0;
|
110
143
|
}
|
111
144
|
h3 {
|
112
|
-
|
145
|
+
font-size: $text_large;
|
146
|
+
line-height: $text_large;
|
147
|
+
font-weight: $bolder;
|
148
|
+
letter-spacing: $lspace_tight;
|
149
|
+
margin: 1.7rem 0 0 0;
|
113
150
|
}
|
114
151
|
h4,
|
115
152
|
h5,
|
116
153
|
h6 {
|
117
|
-
|
154
|
+
font-size: $text_base;
|
155
|
+
line-height: $text_base;
|
156
|
+
letter-spacing: $lspace_tight;
|
157
|
+
font-weight: $bolder;
|
118
158
|
}
|
119
159
|
hr {
|
120
|
-
|
160
|
+
margin: 2.2rem 0;
|
161
|
+
box-sizing: content-box;
|
162
|
+
overflow: hidden;
|
163
|
+
background: transparent;
|
164
|
+
border-bottom: 1px solid $transparent;
|
165
|
+
height: 1px;
|
166
|
+
padding: 0;
|
167
|
+
background-color: $border_light;
|
168
|
+
border: 0;
|
121
169
|
}
|
122
170
|
ol {
|
123
|
-
|
171
|
+
margin: 1rem 0 0 0;
|
172
|
+
padding-left: $space_md;
|
173
|
+
list-style: decimal;
|
174
|
+
li {
|
175
|
+
margin: 2px 0;
|
176
|
+
p {
|
177
|
+
margin: 0;
|
178
|
+
}
|
179
|
+
}
|
124
180
|
}
|
125
181
|
ul {
|
126
|
-
|
182
|
+
list-style-position: disc;
|
183
|
+
margin: 1rem 0 0 0;
|
184
|
+
padding-left: $space_md;
|
185
|
+
li {
|
186
|
+
margin: 2px 0;
|
187
|
+
p {
|
188
|
+
margin: 0;
|
189
|
+
}
|
190
|
+
}
|
127
191
|
}
|
128
192
|
}
|
129
193
|
}
|
@@ -169,41 +233,3 @@
|
|
169
233
|
}
|
170
234
|
}
|
171
235
|
}
|
172
|
-
.tiptap-content {
|
173
|
-
@include preview_first_child;
|
174
|
-
a {
|
175
|
-
@include preview_a;
|
176
|
-
}
|
177
|
-
blockquote {
|
178
|
-
@include preview_blockquote;
|
179
|
-
}
|
180
|
-
h1 {
|
181
|
-
@include preview_h1;
|
182
|
-
}
|
183
|
-
h2 {
|
184
|
-
@include preview_h2;
|
185
|
-
}
|
186
|
-
h3 {
|
187
|
-
@include preview_h3;
|
188
|
-
}
|
189
|
-
h4,
|
190
|
-
h5,
|
191
|
-
h6 {
|
192
|
-
@include preview_smaller_headings;
|
193
|
-
}
|
194
|
-
hr {
|
195
|
-
@include preview_hr;
|
196
|
-
}
|
197
|
-
ol {
|
198
|
-
@include preview_ol;
|
199
|
-
}
|
200
|
-
p {
|
201
|
-
@include preview_p;
|
202
|
-
}
|
203
|
-
pre {
|
204
|
-
@include preview_pre_codeblock;
|
205
|
-
}
|
206
|
-
ul {
|
207
|
-
@include preview_ul;
|
208
|
-
}
|
209
|
-
}
|
@@ -9,5 +9,4 @@ export { default as RichTextEditorInline } from './_rich_text_editor_inline.jsx'
|
|
9
9
|
export { default as RichTextEditorPreview } from './_rich_text_editor_preview.jsx'
|
10
10
|
export { default as RichTextEditorAdvancedDefault } from './_rich_text_editor_advanced_default.jsx'
|
11
11
|
export { default as RichTextEditorMoreExtensions } from './_rich_text_editor_more_extensions.jsx'
|
12
|
-
export { default as RichTextEditorToolbarDisabled } from './_rich_text_editor_toolbar_disabled.jsx'
|
13
|
-
export { default as RichTextEditorAdvancedPreview } from './_rich_text_editor_advanced_preview.jsx'
|
12
|
+
export { default as RichTextEditorToolbarDisabled } from './_rich_text_editor_toolbar_disabled.jsx'
|
@@ -1,156 +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
|
-
this.element.querySelectorAll(STAR_RATING_SELECTOR).forEach(star => {
|
19
|
-
star.addEventListener("click", (event) => {
|
20
|
-
const clickedStarId = event.currentTarget.id
|
21
|
-
this.updateStarColors(clickedStarId)
|
22
|
-
this.updateHiddenInputValue(clickedStarId)
|
23
|
-
this.clearFormValidation()
|
24
|
-
})
|
12
|
+
this.element.addEventListener("click", (event) => {
|
13
|
+
const clickedStarId = event.currentTarget.id;
|
14
|
+
this.updateStarColors(clickedStarId);
|
15
|
+
this.updateHiddenInputValue(clickedStarId);
|
16
|
+
});
|
25
17
|
|
18
|
+
document.querySelectorAll(STAR_RATING_SELECTOR).forEach(star => {
|
26
19
|
star.addEventListener("mouseenter", (event) => {
|
27
20
|
const hoveredStarId = event.currentTarget.id
|
28
|
-
this.updateStarHoverColors(hoveredStarId)
|
21
|
+
this.updateStarHoverColors(hoveredStarId);
|
29
22
|
})
|
30
23
|
|
31
24
|
star.addEventListener("mouseleave", () => {
|
32
|
-
this.removeStarHoverColors()
|
25
|
+
this.removeStarHoverColors();
|
33
26
|
})
|
34
27
|
|
35
28
|
star.addEventListener("keydown", (event) => {
|
36
29
|
if (event.key === 'Enter' || event.key === ' ') {
|
37
|
-
event.preventDefault()
|
38
|
-
this.handleStarClick(star.id)
|
30
|
+
event.preventDefault();
|
31
|
+
this.handleStarClick(star.id);
|
39
32
|
}
|
40
33
|
})
|
41
34
|
})
|
42
35
|
}
|
43
36
|
|
44
37
|
handleStarClick(starId) {
|
45
|
-
this.updateStarColors(starId)
|
46
|
-
this.updateHiddenInputValue(starId)
|
38
|
+
this.updateStarColors(starId);
|
39
|
+
this.updateHiddenInputValue(starId);
|
47
40
|
}
|
48
41
|
|
49
42
|
updateStarColors(clickedStarId) {
|
50
|
-
const allStars =
|
43
|
+
const allStars = document.querySelectorAll(STAR_RATING_SELECTOR);
|
51
44
|
|
52
45
|
allStars.forEach(star => {
|
53
|
-
const starId = star.id
|
54
|
-
const icon = star.querySelector(".interactive-star-icon")
|
46
|
+
const starId = star.id;
|
47
|
+
const icon = star.querySelector(".interactive-star-icon");
|
55
48
|
|
56
49
|
if (icon) {
|
57
50
|
if (starId <= clickedStarId) {
|
58
51
|
if (star.classList.contains("yellow_star")) {
|
59
|
-
icon.classList.add("yellow-star-selected")
|
52
|
+
icon.classList.add("yellow-star-selected");
|
60
53
|
} else if (star.classList.contains("primary_star_light")) {
|
61
|
-
icon.classList.add("primary-star-selected")
|
54
|
+
icon.classList.add("primary-star-selected");
|
62
55
|
} else if (star.classList.contains("primary_star_dark")) {
|
63
|
-
icon.classList.add("primary-star-selected")
|
56
|
+
icon.classList.add("primary-star-selected");
|
64
57
|
} else if (star.classList.contains("subtle_star_light")) {
|
65
|
-
icon.classList.add("subtle-star-selected")
|
58
|
+
icon.classList.add("subtle-star-selected");
|
66
59
|
} else if (star.classList.contains("subtle_star_dark")) {
|
67
|
-
icon.classList.add("subtle-star-selected")
|
60
|
+
icon.classList.add("subtle-star-selected");
|
68
61
|
} else {
|
69
|
-
icon.classList.add("yellow-star-selected")
|
62
|
+
icon.classList.add("yellow-star-selected");
|
70
63
|
}
|
71
64
|
} else {
|
72
|
-
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");
|
73
66
|
}
|
74
|
-
icon.classList.remove("star-hovered")
|
67
|
+
icon.classList.remove("star-hovered");
|
75
68
|
}
|
76
|
-
})
|
69
|
+
});
|
77
70
|
}
|
78
71
|
|
79
72
|
updateHiddenInputValue(value) {
|
80
|
-
const hiddenInput =
|
73
|
+
const hiddenInput = document.getElementById(STAR_RATING_INPUT_ID);
|
81
74
|
if (hiddenInput) {
|
82
|
-
hiddenInput.value = value
|
75
|
+
hiddenInput.value = value;
|
83
76
|
}
|
84
77
|
}
|
85
78
|
|
86
79
|
updateStarHoverColors(hoveredStarId) {
|
87
|
-
const allStars =
|
80
|
+
const allStars = document.querySelectorAll(STAR_RATING_SELECTOR);
|
88
81
|
|
89
82
|
allStars.forEach(star => {
|
90
|
-
const starId = star.id
|
91
|
-
const icon = star.querySelector(".interactive-star-icon")
|
83
|
+
const starId = star.id;
|
84
|
+
const icon = star.querySelector(".interactive-star-icon");
|
92
85
|
|
93
86
|
if (icon) {
|
94
87
|
if (starId <= hoveredStarId) {
|
95
88
|
if (!icon.classList.contains("yellow-star-selected") &&
|
96
89
|
!icon.classList.contains("primary-star-selected") &&
|
97
90
|
!icon.classList.contains("subtle-star-selected")) {
|
98
|
-
icon.classList.add("star-hovered")
|
91
|
+
icon.classList.add("star-hovered");
|
99
92
|
}
|
100
93
|
} else {
|
101
|
-
icon.classList.remove("star-hovered")
|
94
|
+
icon.classList.remove("star-hovered");
|
102
95
|
}
|
103
96
|
}
|
104
|
-
})
|
97
|
+
});
|
105
98
|
}
|
106
99
|
|
107
100
|
|
108
101
|
removeStarHoverColors() {
|
109
|
-
const allStars =
|
102
|
+
const allStars = document.querySelectorAll(STAR_RATING_SELECTOR);
|
110
103
|
|
111
104
|
allStars.forEach(star => {
|
112
|
-
const icon = star.querySelector(".interactive-star-icon")
|
105
|
+
const icon = star.querySelector(".interactive-star-icon");
|
113
106
|
if (icon) {
|
114
107
|
if (!icon.classList.contains("yellow-star-selected") &&
|
115
108
|
!icon.classList.contains("primary-star-selected") &&
|
116
109
|
!icon.classList.contains("subtle-star-selected")) {
|
117
|
-
icon.classList.remove("star-hovered")
|
110
|
+
icon.classList.remove("star-hovered");
|
118
111
|
}
|
119
112
|
}
|
120
|
-
})
|
113
|
+
});
|
121
114
|
}
|
122
115
|
|
123
116
|
isStarSelected() {
|
124
|
-
return
|
125
|
-
}
|
126
|
-
|
127
|
-
handleFormReset() {
|
128
|
-
const form = this.element.closest("form")
|
129
|
-
if (form) {
|
130
|
-
form.addEventListener("reset", () => {
|
131
|
-
this.updateHiddenInputValue("")
|
132
|
-
this.resetStarRatingValues()
|
133
|
-
})
|
134
|
-
}
|
135
|
-
}
|
136
|
-
|
137
|
-
resetStarRatingValues() {
|
138
|
-
const allStars = this.element.querySelectorAll(STAR_RATING_SELECTOR)
|
139
|
-
allStars.forEach(star => {
|
140
|
-
const icon = star.querySelector(".interactive-star-icon")
|
141
|
-
if (icon) {
|
142
|
-
icon.classList.remove("yellow-star-selected", "primary-star-selected", "subtle-star-selected")
|
143
|
-
}
|
144
|
-
})
|
145
|
-
}
|
146
|
-
|
147
|
-
clearFormValidation() {
|
148
|
-
const hiddenInput = this.element.querySelector(STAR_RATING_INPUT_DATA_SELECTOR)
|
149
|
-
if (hiddenInput.checkValidity()) {
|
150
|
-
const errorLabelElement = this.element.querySelector(".pb_body_kit_negative")
|
151
|
-
if (errorLabelElement) {
|
152
|
-
errorLabelElement.remove()
|
153
|
-
}
|
154
|
-
}
|
117
|
+
return document.querySelectorAll(".yellow-star-selected, .primary-star-selected, .subtle-star-selected").length > 0;
|
155
118
|
}
|
156
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,10 +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
33
|
|
38
34
|
def one_decimal_rating
|
39
35
|
rating.to_f.round(1)
|
@@ -110,19 +106,6 @@ module Playbook
|
|
110
106
|
def classname
|
111
107
|
generate_classname("pb_star_rating_kit")
|
112
108
|
end
|
113
|
-
|
114
|
-
def hidden_input_tag
|
115
|
-
tag(:input, all_input_options)
|
116
|
-
end
|
117
|
-
|
118
|
-
def all_input_options
|
119
|
-
input_options.merge(
|
120
|
-
data: { "pb-star-rating-input": true },
|
121
|
-
name: name,
|
122
|
-
required: required,
|
123
|
-
style: "display: none"
|
124
|
-
)
|
125
|
-
end
|
126
109
|
end
|
127
110
|
end
|
128
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 = ''
|