playbook_ui 14.10.0.pre.alpha.play16825206 → 14.10.0.pre.alpha.play16825301
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/pb_advanced_table/_advanced_table.scss +11 -16
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +8 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_sort.html.erb +1 -3
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers.html.erb +43 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_multiple.html.erb +58 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/index.js +185 -92
- data/app/pb_kits/playbook/pb_advanced_table/table_body.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +55 -8
- data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +17 -14
- data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +78 -0
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +4 -3
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +13 -2
- data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +2 -6
- data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb +6 -4
- data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.scss +11 -9
- data/app/pb_kits/playbook/pb_badge/_badge.scss +4 -2
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.scss +3 -1
- data/app/pb_kits/playbook/pb_button/_button.scss +3 -1
- data/app/pb_kits/playbook/pb_card/_card.scss +21 -3
- data/app/pb_kits/playbook/pb_card/docs/_card_header.html.erb +18 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_header.jsx +40 -0
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.scss +4 -2
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_input_styles.scss +3 -1
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_overrides.scss +5 -3
- data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.scss +6 -4
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.scss +4 -2
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +10 -8
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.tsx +24 -15
- data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_accept.jsx +3 -1
- data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_description.jsx +4 -1
- data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_max_size.jsx +1 -1
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +6 -4
- data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.scss +3 -1
- data/app/pb_kits/playbook/pb_label_value/_label_value.scss +4 -2
- data/app/pb_kits/playbook/pb_message/_message_mixins.scss +3 -1
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.scss +3 -1
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.scss +5 -3
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +10 -8
- data/app/pb_kits/playbook/pb_pill/_pill.scss +4 -2
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.scss +4 -2
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.scss +4 -2
- data/app/pb_kits/playbook/pb_select/_select.scss +5 -3
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +5 -3
- data/app/pb_kits/playbook/pb_table/_table.tsx +8 -1
- data/app/pb_kits/playbook/pb_table/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_table/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +3 -1
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.jsx +18 -0
- data/app/pb_kits/playbook/pb_text_input/inputMask.ts +22 -1
- data/app/pb_kits/playbook/pb_text_input/text_input.test.js +80 -0
- data/app/pb_kits/playbook/pb_textarea/_textarea.scss +3 -1
- data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.scss +5 -4
- data/app/pb_kits/playbook/pb_timeline/_timeline.scss +4 -2
- data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +5 -5
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.html.erb +4 -5
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.jsx +4 -4
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_gap.md +1 -1
- data/app/pb_kits/playbook/pb_timeline/timeline.rb +6 -6
- data/app/pb_kits/playbook/pb_toggle/_toggle.scss +5 -3
- data/dist/chunks/_typeahead-C2iCBqxQ.js +36 -0
- data/dist/chunks/_weekday_stacked-CWnbnW7m.js +45 -0
- data/dist/chunks/vendor.js +1 -1
- 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/version.rb +1 -1
- metadata +6 -4
- data/dist/chunks/_typeahead-CbKUtXZa.js +0 -22
- data/dist/chunks/_weekday_stacked-CEpLoHbM.js +0 -45
@@ -1,3 +1,5 @@
|
|
1
|
+
@use "sass:math";
|
2
|
+
|
1
3
|
@import "../tokens/colors";
|
2
4
|
@import "../tokens/spacing";
|
3
5
|
@import "../tokens/typography";
|
@@ -122,7 +124,7 @@
|
|
122
124
|
|
123
125
|
&.error {
|
124
126
|
[class*=pb_body_kit] {
|
125
|
-
margin-top: $space_xs
|
127
|
+
margin-top: math.div($space_xs, 2);
|
126
128
|
}
|
127
129
|
|
128
130
|
[class*="dropdown_trigger_wrapper"] {
|
@@ -146,7 +148,7 @@
|
|
146
148
|
&[class*="subtle"] {
|
147
149
|
.dropdown_wrapper {
|
148
150
|
.pb_dropdown_container {
|
149
|
-
|
151
|
+
|
150
152
|
[class*="pb_dropdown_option"]:first-child {
|
151
153
|
margin-top: $space_xs;
|
152
154
|
}
|
@@ -161,7 +163,7 @@
|
|
161
163
|
border-radius: $border_radius_md;
|
162
164
|
border-bottom: none;
|
163
165
|
position: relative;
|
164
|
-
|
166
|
+
|
165
167
|
&::after {
|
166
168
|
content: "";
|
167
169
|
position: absolute;
|
@@ -172,20 +174,20 @@
|
|
172
174
|
background: $border_light;
|
173
175
|
}
|
174
176
|
}
|
175
|
-
|
177
|
+
|
176
178
|
[class*="pb_dropdown_option"]:last-child::after {
|
177
|
-
display: none;
|
179
|
+
display: none;
|
178
180
|
}
|
179
181
|
}
|
180
182
|
}
|
181
|
-
|
183
|
+
|
182
184
|
&[class*="separators_hidden"] {
|
183
185
|
.dropdown_wrapper {
|
184
186
|
.pb_dropdown_container {
|
185
187
|
[class*="pb_dropdown_option"]:first-child {
|
186
188
|
margin-top: $space_xs;
|
187
189
|
}
|
188
|
-
|
190
|
+
|
189
191
|
[class*="pb_dropdown_option"]:last-child {
|
190
192
|
margin-bottom: $space_xs;
|
191
193
|
}
|
@@ -193,7 +195,7 @@
|
|
193
195
|
[class*="pb_dropdown_option"] {
|
194
196
|
padding: $space_xxs $space_xs;
|
195
197
|
margin: $space_xxs $space_xs;
|
196
|
-
|
198
|
+
|
197
199
|
&::after {
|
198
200
|
height: 0px;
|
199
201
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { useEffect, useCallback, useRef } from 'react'
|
2
|
-
import { useDropzone, DropzoneInputProps, DropzoneRootProps } from 'react-dropzone'
|
2
|
+
import { useDropzone, DropzoneInputProps, DropzoneRootProps, FileRejection } from 'react-dropzone'
|
3
3
|
import classnames from 'classnames'
|
4
4
|
|
5
5
|
import { buildCss, buildDataProps, noop, buildHtmlProps } from '../utilities/props'
|
@@ -9,8 +9,10 @@ import type { Callback } from '../types'
|
|
9
9
|
import Body from '../pb_body/_body'
|
10
10
|
import Card from '../pb_card/_card'
|
11
11
|
|
12
|
+
import { isEmpty } from '../utilities/object'
|
13
|
+
|
12
14
|
type FileUploadProps = {
|
13
|
-
accept?: string[]
|
15
|
+
accept?: Record<string, string[]>,
|
14
16
|
className?: string,
|
15
17
|
customMessage?: string,
|
16
18
|
dark?: boolean,
|
@@ -19,7 +21,7 @@ type FileUploadProps = {
|
|
19
21
|
acceptedFilesDescription?: string,
|
20
22
|
maxSize?: number,
|
21
23
|
onFilesAccepted: Callback<File, File>,
|
22
|
-
onFilesRejected: (error: string, files:
|
24
|
+
onFilesRejected: (error: string, files: readonly FileRejection[]) => void,
|
23
25
|
}
|
24
26
|
|
25
27
|
const getFormattedFileSize = (fileSize: number): string => {
|
@@ -28,7 +30,7 @@ const getFormattedFileSize = (fileSize: number): string => {
|
|
28
30
|
|
29
31
|
const FileUpload = (props: FileUploadProps): React.ReactElement => {
|
30
32
|
const {
|
31
|
-
accept =
|
33
|
+
accept = {},
|
32
34
|
acceptedFilesDescription = '',
|
33
35
|
className,
|
34
36
|
customMessage,
|
@@ -48,30 +50,37 @@ const FileUpload = (props: FileUploadProps): React.ReactElement => {
|
|
48
50
|
getRootProps: () => DropzoneRootProps & any;
|
49
51
|
getInputProps: () => DropzoneInputProps & any;
|
50
52
|
isDragActive: boolean;
|
51
|
-
|
53
|
+
fileRejections: readonly FileRejection[];
|
52
54
|
}
|
53
55
|
|
54
|
-
const { getRootProps, getInputProps, isDragActive,
|
56
|
+
const { getRootProps, getInputProps, isDragActive, fileRejections }: DropZoneProps = useDropzone({
|
55
57
|
accept,
|
56
58
|
maxSize,
|
57
59
|
onDrop,
|
58
60
|
})
|
59
61
|
|
60
|
-
const prevRejected = useRef<
|
62
|
+
const prevRejected = useRef<readonly FileRejection[] | null>(null);
|
61
63
|
|
62
|
-
|
64
|
+
let maxFileSizeText = ''
|
65
|
+
if (maxSize !== undefined) {
|
66
|
+
maxFileSizeText = `Max file size is ${getFormattedFileSize(maxSize)}.`
|
67
|
+
}
|
63
68
|
|
64
69
|
useEffect(() => {
|
65
|
-
if (
|
66
|
-
const isFileTooLarge = maxSize &&
|
70
|
+
if (fileRejections === prevRejected.current) return
|
71
|
+
const isFileTooLarge = maxSize && fileRejections.length > 0 && fileRejections[0].file.size > maxSize;
|
67
72
|
if (isFileTooLarge) {
|
68
|
-
onFilesRejected(`File size is too large! ${maxFileSizeText}`,
|
73
|
+
onFilesRejected(`File size is too large! ${maxFileSizeText}`, fileRejections)
|
69
74
|
}
|
70
|
-
prevRejected.current =
|
71
|
-
}, [maxFileSizeText, maxSize, onFilesRejected,
|
75
|
+
prevRejected.current = fileRejections
|
76
|
+
}, [maxFileSizeText, maxSize, onFilesRejected, fileRejections])
|
72
77
|
|
73
78
|
const acceptedFileTypes = () => {
|
74
|
-
|
79
|
+
if (!accept) {
|
80
|
+
return []
|
81
|
+
}
|
82
|
+
|
83
|
+
return Object.keys(accept).map((fileType) => {
|
75
84
|
if (fileType.startsWith('image/')) {
|
76
85
|
return fileType.replace('image/', ' ')
|
77
86
|
} else {
|
@@ -86,7 +95,7 @@ const FileUpload = (props: FileUploadProps): React.ReactElement => {
|
|
86
95
|
const getDescription = () => {
|
87
96
|
return customMessage
|
88
97
|
? customMessage
|
89
|
-
: `Choose a file or drag it here.${accept
|
98
|
+
: `Choose a file or drag it here.${isEmpty(accept) ? '' : ` The accepted file types are: ${acceptedFilesDescription || acceptedFileTypes()}.`}${maxSize ? ` ${maxFileSizeText}` : ''}`;
|
90
99
|
}
|
91
100
|
|
92
101
|
return (
|
@@ -25,7 +25,10 @@ const FileUploadCustomDescription = (props) => {
|
|
25
25
|
{...props}
|
26
26
|
/>
|
27
27
|
<FileUpload
|
28
|
-
accept={
|
28
|
+
accept={{
|
29
|
+
"application/pdf": [".pdf"],
|
30
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": [".xlsx"],
|
31
|
+
}}
|
29
32
|
acceptedFilesDescription="Adobe (.pdf) and Microsoft (.xslx)"
|
30
33
|
onFilesAccepted={handleOnFilesAccepted}
|
31
34
|
{...props}
|
@@ -18,7 +18,7 @@ const AcceptedFilesList = ({ files }) => (
|
|
18
18
|
const RejectedFilesList = ({ files }) => (
|
19
19
|
<List>
|
20
20
|
{files.map((file) => (
|
21
|
-
<ListItem key={file.name}><Body color="error">{`${file.name} (file too large)`}</Body></ListItem>
|
21
|
+
<ListItem key={file.file.name}><Body color="error">{`${file.file.name} (file too large)`}</Body></ListItem>
|
22
22
|
))}
|
23
23
|
</List>
|
24
24
|
)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
@use "sass:math";
|
2
|
+
|
1
3
|
@import "../tokens/spacing";
|
2
4
|
@import "../tokens/colors";
|
3
5
|
@import "../tokens/opacity";
|
@@ -14,9 +16,9 @@ $form_pill_colors: map-merge($status_color_text, map-merge($data_colors, $produc
|
|
14
16
|
display: inline-flex;
|
15
17
|
justify-content: center;
|
16
18
|
align-items: center;
|
17
|
-
padding: 0 $space-md
|
19
|
+
padding: 0 math.div($space-md, 2);
|
18
20
|
height: $pb_form_pill_height;
|
19
|
-
border-radius: $pb_form_pill_height
|
21
|
+
border-radius: math.div($pb_form_pill_height, 2);
|
20
22
|
margin-bottom: 2px;
|
21
23
|
margin-top: 2px;
|
22
24
|
cursor: pointer;
|
@@ -142,7 +144,7 @@ $form_pill_colors: map-merge($status_color_text, map-merge($data_colors, $produc
|
|
142
144
|
height: 12px !important;
|
143
145
|
width: 12px !important;
|
144
146
|
padding-right: $space_xs;
|
145
|
-
+ .pb_form_pill_text, + .pb_form_pill_tag,
|
147
|
+
+ .pb_form_pill_text, + .pb_form_pill_tag,
|
146
148
|
+ .pb_tooltip_kit .pb_form_pill_text, + .pb_tooltip_kit .pb_form_pill_tag,
|
147
149
|
+ div .pb_form_pill_text, + div .pb_form_pill_tag {
|
148
150
|
padding-left: 0;
|
@@ -171,7 +173,7 @@ $form_pill_colors: map-merge($status_color_text, map-merge($data_colors, $produc
|
|
171
173
|
}
|
172
174
|
.pb_form_pill_icon {
|
173
175
|
padding-right: $space_xxs;
|
174
|
-
+ .pb_form_pill_text, + .pb_form_pill_tag,
|
176
|
+
+ .pb_form_pill_text, + .pb_form_pill_tag,
|
175
177
|
+ .pb_tooltip_kit .pb_form_pill_text, + .pb_tooltip_kit .pb_form_pill_tag,
|
176
178
|
+ div .pb_form_pill_text, + div .pb_form_pill_tag {
|
177
179
|
padding-left: 0;
|
@@ -1,3 +1,5 @@
|
|
1
|
+
@use "sass:math";
|
2
|
+
|
1
3
|
@import "../tokens/border_radius";
|
2
4
|
@import "../tokens/colors";
|
3
5
|
@import "../tokens/typography";
|
@@ -44,7 +46,7 @@ $pb_icon_circle_sizes: (
|
|
44
46
|
&[class*=_size_#{$name}] {
|
45
47
|
width: $size;
|
46
48
|
height: $size;
|
47
|
-
border-radius: $size
|
49
|
+
border-radius: math.div($size, 2);
|
48
50
|
background: $silver;
|
49
51
|
color: $text_lt_light;
|
50
52
|
font-size: if($name == "xxs", $size - 6px, $size * 0.38);
|
@@ -1,3 +1,5 @@
|
|
1
|
+
@use "sass:math";
|
2
|
+
|
1
3
|
@import "../tokens/colors";
|
2
4
|
@import "../utilities/colors";
|
3
5
|
@import "../tokens/opacity";
|
@@ -18,7 +20,7 @@ $pb_multiple_users_size_xxs: map-get($avatar-sizes, "xxs");
|
|
18
20
|
justify-content: center;
|
19
21
|
width: $pb_multiple_users_size;
|
20
22
|
height: $pb_multiple_users_size;
|
21
|
-
border-radius: $pb_multiple_users_size
|
23
|
+
border-radius: math.div($pb_multiple_users_size, 2) + 2;
|
22
24
|
background: tint($primary, 90%);
|
23
25
|
border: $pb_multiple_users_border_size solid $white;
|
24
26
|
color: $primary;
|
@@ -1,3 +1,5 @@
|
|
1
|
+
@use "sass:math";
|
2
|
+
|
1
3
|
@import "../tokens/colors";
|
2
4
|
@import "../tokens/spacing";
|
3
5
|
@import "../tokens/screen_sizes";
|
@@ -21,14 +23,14 @@
|
|
21
23
|
}
|
22
24
|
|
23
25
|
.passphrase-label {
|
24
|
-
margin-right: $space_xs
|
26
|
+
margin-right: math.div($space_xs, 2);
|
25
27
|
}
|
26
28
|
|
27
29
|
.passphrase-text-input-wrapper {
|
28
30
|
position: relative;
|
29
31
|
|
30
32
|
.pb_text_input_kit_label {
|
31
|
-
margin-bottom: $space_xs
|
33
|
+
margin-bottom: math.div($space_xs, 2);
|
32
34
|
}
|
33
35
|
|
34
36
|
.passphrase-text-input input {
|
@@ -57,7 +59,7 @@
|
|
57
59
|
}
|
58
60
|
|
59
61
|
.pb_progress_simple_wrapper, .pb_progress_simple_wrapper_dark {
|
60
|
-
margin-bottom: $space_xs
|
62
|
+
margin-bottom: math.div($space_xs, 2);
|
61
63
|
|
62
64
|
&.progress-empty-input {
|
63
65
|
visibility: hidden;
|
@@ -1,3 +1,5 @@
|
|
1
|
+
@use "sass:math";
|
2
|
+
|
1
3
|
@import "./intlTelInput";
|
2
4
|
@import "../tokens/colors";
|
3
5
|
|
@@ -39,7 +41,7 @@ $flag-min-resolution: 192dpi;
|
|
39
41
|
color: $charcoal;
|
40
42
|
}
|
41
43
|
|
42
|
-
// iti-spacer-horizontal's default is 8px, or $space_xs
|
44
|
+
// iti-spacer-horizontal's default is 8px, or $space_xs
|
43
45
|
.iti__country-list .iti__flag, .iti__country-name {
|
44
46
|
margin-right: $space_xs;
|
45
47
|
}
|
@@ -73,7 +75,7 @@ $flag-min-resolution: 192dpi;
|
|
73
75
|
}
|
74
76
|
|
75
77
|
.iti__divider {
|
76
|
-
border-bottom: 1px solid $border_light !important;
|
78
|
+
border-bottom: 1px solid $border_light !important;
|
77
79
|
}
|
78
80
|
|
79
81
|
.iti__selected-country-primary {
|
@@ -93,7 +95,7 @@ $flag-min-resolution: 192dpi;
|
|
93
95
|
justify-content: center;
|
94
96
|
align-items: center;
|
95
97
|
border-width: 0;
|
96
|
-
border-radius: $space_xxs;
|
98
|
+
border-radius: $space_xxs;
|
97
99
|
|
98
100
|
&[aria-expanded="true"] {
|
99
101
|
color: $primary_action;
|
@@ -163,7 +165,7 @@ $flag-min-resolution: 192dpi;
|
|
163
165
|
}
|
164
166
|
|
165
167
|
.iti__arrow.iti__arrow--up::before {
|
166
|
-
transform: rotate(-($transform-rotate-deg
|
168
|
+
transform: rotate(-(math.div($transform-rotate-deg, 3)));
|
167
169
|
top: $space_xs + 4px;
|
168
170
|
color: $primary_action;
|
169
171
|
}
|
@@ -196,7 +198,7 @@ $flag-min-resolution: 192dpi;
|
|
196
198
|
}
|
197
199
|
|
198
200
|
.iti__dropdown-content {
|
199
|
-
border-radius: $space_xs;
|
201
|
+
border-radius: $space_xs;
|
200
202
|
border: 1px solid $border_light !important;
|
201
203
|
position: absolute;
|
202
204
|
top: 100%;
|
@@ -225,12 +227,12 @@ $flag-min-resolution: 192dpi;
|
|
225
227
|
}
|
226
228
|
|
227
229
|
.iti__dropdown-content {
|
228
|
-
border-radius: $space_xs;
|
230
|
+
border-radius: $space_xs;
|
229
231
|
border: 1px solid $border_dark !important;
|
230
232
|
}
|
231
233
|
|
232
234
|
.iti__divider {
|
233
|
-
border-bottom: 1px solid $border_dark !important;
|
235
|
+
border-bottom: 1px solid $border_dark !important;
|
234
236
|
}
|
235
237
|
|
236
238
|
.iti__country-list {
|
@@ -265,7 +267,7 @@ $flag-min-resolution: 192dpi;
|
|
265
267
|
color: $white;
|
266
268
|
}
|
267
269
|
}
|
268
|
-
|
270
|
+
|
269
271
|
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: $flag-min-resolution) {
|
270
272
|
.iti__flag {
|
271
273
|
background-image: url("https://unpkg.com/intl-tel-input@24.6.0/build/img/flags@2x.png");
|
@@ -1,3 +1,5 @@
|
|
1
|
+
@use "sass:math";
|
2
|
+
|
1
3
|
@import "../tokens/spacing";
|
2
4
|
@import "../tokens/colors";
|
3
5
|
@import "../tokens/opacity";
|
@@ -9,9 +11,9 @@ $pb_pill_height: 22px;
|
|
9
11
|
display: inline-flex;
|
10
12
|
justify-content: center;
|
11
13
|
align-items: center;
|
12
|
-
padding: 0 $space-sm
|
14
|
+
padding: 0 math.div($space-sm, 1.8);
|
13
15
|
height: $pb_pill_height;
|
14
|
-
border-radius: $pb_pill_height
|
16
|
+
border-radius: math.div($pb_pill_height, 2);
|
15
17
|
white-space: nowrap;
|
16
18
|
|
17
19
|
&[class*=lowercase] {
|
@@ -1,3 +1,5 @@
|
|
1
|
+
@use "sass:math";
|
2
|
+
|
1
3
|
@import "../tokens/colors";
|
2
4
|
@import "../tokens/opacity";
|
3
5
|
@import "../tokens/colors";
|
@@ -21,7 +23,7 @@ $pb_progress_simple_height: 4px;
|
|
21
23
|
[class^=pb_progress_simple_kit] {
|
22
24
|
width: 100%;
|
23
25
|
height: $pb_progress_simple_height;
|
24
|
-
border-radius: $pb_progress_simple_height
|
26
|
+
border-radius: math.div($pb_progress_simple_height, 2);
|
25
27
|
background: rgba($primary, $opacity-1);
|
26
28
|
&[class*=_positive] {
|
27
29
|
.progress_simple_value {
|
@@ -42,7 +44,7 @@ $pb_progress_simple_height: 4px;
|
|
42
44
|
[class^=progress_simple_value] {
|
43
45
|
width: 0%;
|
44
46
|
height: 100%;
|
45
|
-
border-radius: $pb_progress_simple_height
|
47
|
+
border-radius: math.div($pb_progress_simple_height, 2);
|
46
48
|
background: $primary;
|
47
49
|
}
|
48
50
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
@use "sass:math";
|
2
|
+
|
1
3
|
@import "../pb_textarea/textarea_mixin";
|
2
4
|
@import "../pb_button/_button_mixins";
|
3
5
|
@import "../tokens/border_radius";
|
@@ -94,7 +96,7 @@
|
|
94
96
|
.trix-button--icon {
|
95
97
|
height: $space_lg;
|
96
98
|
width: $space_lg;
|
97
|
-
margin: $space_xs
|
99
|
+
margin: math.div($space_xs, 2);
|
98
100
|
border-radius: $border_rad_heavier;
|
99
101
|
&::before {
|
100
102
|
background-size: auto;
|
@@ -104,7 +106,7 @@
|
|
104
106
|
background: $white;
|
105
107
|
border: 1px solid #E4E8F0;
|
106
108
|
border-bottom: none;
|
107
|
-
padding: $space_xs
|
109
|
+
padding: math.div($space_xs, 2);
|
108
110
|
border-top-left-radius: $border_rad_heavier;
|
109
111
|
border-top-right-radius: $border_rad_heavier;
|
110
112
|
.trix-button-group {
|
@@ -1,3 +1,5 @@
|
|
1
|
+
@use "sass:math";
|
2
|
+
|
1
3
|
@import "../pb_body/body_mixins";
|
2
4
|
@import "../pb_textarea/textarea_mixin";
|
3
5
|
@import "../tokens/titles";
|
@@ -81,7 +83,7 @@
|
|
81
83
|
display: block;
|
82
84
|
&.error {
|
83
85
|
[class*=pb_body_kit] {
|
84
|
-
margin-top: $space_xs
|
86
|
+
margin-top: math.div($space_xs, 2);
|
85
87
|
}
|
86
88
|
> select:first-child {
|
87
89
|
border-color: $error;
|
@@ -133,7 +135,7 @@
|
|
133
135
|
box-shadow: none;
|
134
136
|
border-color: transparent;
|
135
137
|
padding: 4px 8px;
|
136
|
-
padding-right: $space_lg;
|
138
|
+
padding-right: $space_lg;
|
137
139
|
border-radius: 4px;
|
138
140
|
option {
|
139
141
|
background-color: $white;
|
@@ -240,7 +242,7 @@
|
|
240
242
|
border-color: transparent;
|
241
243
|
background: transparent;
|
242
244
|
padding: 4px 8px;
|
243
|
-
padding-right: $space_lg;
|
245
|
+
padding-right: $space_lg;
|
244
246
|
border-radius: 4px;
|
245
247
|
option {
|
246
248
|
background-color: $white;
|
@@ -1,3 +1,5 @@
|
|
1
|
+
@use "sass:math";
|
2
|
+
|
1
3
|
@import "../tokens/animation-curves";
|
2
4
|
@import "../tokens/colors";
|
3
5
|
@import "../tokens/opacity";
|
@@ -60,7 +62,7 @@ $pb_selectable_paddings: (
|
|
60
62
|
align-items: center;
|
61
63
|
height: $pb_selectable_card_indicator_size;
|
62
64
|
width: $pb_selectable_card_indicator_size;
|
63
|
-
border-radius: $pb_selectable_card_indicator_size
|
65
|
+
border-radius: (math.div($pb_selectable_card_indicator_size, 2)) + (math.div($pb_selectable_card_border, 2));
|
64
66
|
border-width: $pb_selectable_card_border;
|
65
67
|
border-style: solid;
|
66
68
|
border-color: $white;
|
@@ -69,8 +71,8 @@ $pb_selectable_paddings: (
|
|
69
71
|
font-size: $font_smaller;
|
70
72
|
text-align: center;
|
71
73
|
position: absolute;
|
72
|
-
top: -($pb_selectable_card_indicator_size
|
73
|
-
right: -($pb_selectable_card_indicator_size
|
74
|
+
top: -(math.div($pb_selectable_card_indicator_size, 2));
|
75
|
+
right: -(math.div($pb_selectable_card_indicator_size, 2));
|
74
76
|
opacity: 0;
|
75
77
|
}
|
76
78
|
}
|
@@ -69,6 +69,7 @@ const Table = (props: TableProps): React.ReactElement => {
|
|
69
69
|
const outerPaddingCss = outerPadding ? `outer_padding_${spaceCssName}${outerPadding}` : ''
|
70
70
|
const isTableTag = tag === 'table'
|
71
71
|
const dynamicInlineProps = globalInlineProps(props)
|
72
|
+
const stickyRightColumnReversed = stickyRightColumn.reverse()
|
72
73
|
|
73
74
|
const classNames = classnames(
|
74
75
|
'pb_table',
|
@@ -148,7 +149,7 @@ const Table = (props: TableProps): React.ReactElement => {
|
|
148
149
|
if (!stickyRightColumn.length) return;
|
149
150
|
let accumulatedWidth = 0;
|
150
151
|
|
151
|
-
|
152
|
+
stickyRightColumnReversed.forEach((colId, index) => {
|
152
153
|
const isLastColumn = index === stickyRightColumn.length - 1;
|
153
154
|
const header = document.querySelector(`th[id="${colId}"]`);
|
154
155
|
const cells = document.querySelectorAll(`td[id="${colId}"]`);
|
@@ -186,6 +187,12 @@ const Table = (props: TableProps): React.ReactElement => {
|
|
186
187
|
setTimeout(() => {
|
187
188
|
handleStickyRightColumns();
|
188
189
|
}, 10);
|
190
|
+
|
191
|
+
window.addEventListener('resize', handleStickyRightColumns);
|
192
|
+
|
193
|
+
return () => {
|
194
|
+
window.removeEventListener('resize', handleStickyRightColumns);
|
195
|
+
};
|
189
196
|
}, [stickyRightColumn]);
|
190
197
|
|
191
198
|
useEffect(() => {
|
@@ -35,6 +35,8 @@ examples:
|
|
35
35
|
- table_lg: Large
|
36
36
|
- table_sticky: Sticky Header
|
37
37
|
- table_sticky_left_columns: Sticky Left Column
|
38
|
+
- table_sticky_right_columns: Sticky Right Column
|
39
|
+
- table_sticky_columns: Sticky Left and Right Columns
|
38
40
|
- table_alignment_row: Row Alignment
|
39
41
|
- table_alignment_column: Cell Alignment
|
40
42
|
- table_alignment_shift_row: Row Shift
|
@@ -26,6 +26,8 @@ export { default as TableWithSubcomponents } from './_table_with_subcomponents.j
|
|
26
26
|
export { default as TableWithSubcomponentsAsDivs } from './_table_with_subcomponents_as_divs.jsx'
|
27
27
|
export { default as TableOuterPadding } from './_table_outer_padding.jsx'
|
28
28
|
export { default as TableStickyLeftColumns } from './_table_sticky_left_columns.jsx'
|
29
|
+
export { default as TableStickyRightColumns } from './_table_sticky_right_columns.jsx'
|
30
|
+
export { default as TableStickyColumns } from './_table_sticky_columns.jsx'
|
29
31
|
export { default as TableWithCollapsible } from './_table_with_collapsible.jsx'
|
30
32
|
export { default as TableWithCollapsibleWithCustomContent } from './_table_with_collapsible_with_custom_content.jsx'
|
31
33
|
export { default as TableWithCollapsibleWithNestedTable } from './_table_with_collapsible_with_nested_table.jsx'
|
@@ -1,3 +1,5 @@
|
|
1
|
+
@use "sass:math";
|
2
|
+
|
1
3
|
@import "../pb_textarea/textarea_mixin";
|
2
4
|
@import "../tokens/titles";
|
3
5
|
@import "../tokens/colors";
|
@@ -100,7 +102,7 @@
|
|
100
102
|
&.error {
|
101
103
|
.text_input_wrapper {
|
102
104
|
[class*="pb_body_kit"] {
|
103
|
-
margin-top: $space_xs
|
105
|
+
margin-top: math.div($space_xs, 2);
|
104
106
|
}
|
105
107
|
input,
|
106
108
|
.text_input {
|
@@ -16,6 +16,8 @@ const TextInputMask = (props) => {
|
|
16
16
|
zipCode: '',
|
17
17
|
postalCode: '',
|
18
18
|
ssn: '',
|
19
|
+
creditCard: '',
|
20
|
+
cvv: ''
|
19
21
|
})
|
20
22
|
|
21
23
|
const handleOnChangeFormField = ({ target }) => {
|
@@ -57,6 +59,22 @@ const TextInputMask = (props) => {
|
|
57
59
|
value={formFields.ssn}
|
58
60
|
{...props}
|
59
61
|
/>
|
62
|
+
<TextInput
|
63
|
+
label="Credit Card"
|
64
|
+
mask="creditCard"
|
65
|
+
name="creditCard"
|
66
|
+
onChange={handleOnChangeFormField}
|
67
|
+
value={formFields.creditCard}
|
68
|
+
{...props}
|
69
|
+
/>
|
70
|
+
<TextInput
|
71
|
+
label="CVV"
|
72
|
+
mask="cvv"
|
73
|
+
name="cvv"
|
74
|
+
onChange={handleOnChangeFormField}
|
75
|
+
value={formFields.cvv}
|
76
|
+
{...props}
|
77
|
+
/>
|
60
78
|
|
61
79
|
<br />
|
62
80
|
<br />
|
@@ -6,7 +6,7 @@ type InputMask = {
|
|
6
6
|
}
|
7
7
|
|
8
8
|
type InputMaskDictionary = {
|
9
|
-
[key in 'currency' | 'zipCode' | 'postalCode' | 'ssn']: InputMask
|
9
|
+
[key in 'currency' | 'zipCode' | 'postalCode' | 'ssn' | 'creditCard' | 'cvv']: InputMask
|
10
10
|
}
|
11
11
|
|
12
12
|
const formatCurrencyDefaultValue = (value: string): string => {
|
@@ -58,6 +58,15 @@ const formatSSN = (value: string): string => {
|
|
58
58
|
.replace(/(\d{3})(?=\d)/, '$1-')
|
59
59
|
}
|
60
60
|
|
61
|
+
const formatCreditCard = (value: string): string => {
|
62
|
+
const cleaned = value.replace(/\D/g, '').slice(0, 16)
|
63
|
+
return cleaned.replace(/(\d{4})(?=\d)/g, '$1 ')
|
64
|
+
}
|
65
|
+
|
66
|
+
const formatCVV = (value: string): string => {
|
67
|
+
return value.replace(/\D/g, '').slice(0, 4)
|
68
|
+
}
|
69
|
+
|
61
70
|
export const INPUTMASKS: InputMaskDictionary = {
|
62
71
|
currency: {
|
63
72
|
format: formatCurrency,
|
@@ -84,4 +93,16 @@ export const INPUTMASKS: InputMaskDictionary = {
|
|
84
93
|
pattern: '\\d{3}-\\d{2}-\\d{4}',
|
85
94
|
placeholder: '123-45-6789',
|
86
95
|
},
|
96
|
+
creditCard: {
|
97
|
+
format: formatCreditCard,
|
98
|
+
formatDefaultValue: formatCreditCard,
|
99
|
+
pattern: '\\d{4} \\d{4} \\d{4} \\d{4}',
|
100
|
+
placeholder: '1234 5678 9012 3456',
|
101
|
+
},
|
102
|
+
cvv: {
|
103
|
+
format: formatCVV,
|
104
|
+
formatDefaultValue: formatCVV,
|
105
|
+
pattern: '\\d{3,4}',
|
106
|
+
placeholder: '123',
|
107
|
+
},
|
87
108
|
}
|