playbook_ui 15.4.0.pre.alpha.PLAY2627requiredmultiselectdropdownbug12442 → 15.4.0.pre.alpha.PLAY2640typeaheadmultikitbadgespacing12415
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/pb_date_time/_date_time.tsx +0 -3
- data/app/pb_kits/playbook/pb_date_time/date_time.html.erb +0 -1
- data/app/pb_kits/playbook/pb_date_time/date_time.rb +0 -1
- data/app/pb_kits/playbook/pb_date_time/docs/example.yml +1 -3
- data/app/pb_kits/playbook/pb_date_time/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +0 -3
- data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.html.erb +2 -2
- data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.rb +0 -2
- data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js +0 -33
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/example.yml +1 -3
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_dropdown/index.js +13 -31
- data/app/pb_kits/playbook/pb_table/_table.tsx +26 -28
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +4 -0
- data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +1 -0
- data/app/pb_kits/playbook/utilities/globalProps.ts +8 -26
- data/app/pb_kits/playbook/utilities/test/globalProps/alignContent.test.js +0 -18
- data/app/pb_kits/playbook/utilities/test/globalProps/alignItems.test.js +0 -18
- data/app/pb_kits/playbook/utilities/test/globalProps/alignSelf.test.js +0 -18
- data/app/pb_kits/playbook/utilities/test/globalProps/display.test.js +0 -18
- data/app/pb_kits/playbook/utilities/test/globalProps/flex.test.js +0 -18
- data/app/pb_kits/playbook/utilities/test/globalProps/flexDirection.test.js +0 -18
- data/app/pb_kits/playbook/utilities/test/globalProps/flexGrow.test.js +0 -18
- data/app/pb_kits/playbook/utilities/test/globalProps/flexShrink.test.js +0 -18
- data/app/pb_kits/playbook/utilities/test/globalProps/flexWrap.test.js +0 -18
- data/app/pb_kits/playbook/utilities/test/globalProps/justifyContent.test.js +0 -18
- data/app/pb_kits/playbook/utilities/test/globalProps/justifySelf.test.js +0 -18
- data/app/pb_kits/playbook/utilities/test/globalProps/order.test.js +0 -18
- data/dist/chunks/{_line_graph-BuucBJlH.js → _line_graph-CxZAFRDo.js} +1 -1
- data/dist/chunks/_typeahead-DYIGfk8o.js +6 -0
- data/dist/chunks/{_weekday_stacked-B4_b9xef.js → _weekday_stacked-B52YWU9Z.js} +2 -2
- 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 +5 -12
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year.html.erb +0 -4
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year.jsx +0 -14
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year_rails.md +0 -1
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_show_current_year_react.md +0 -1
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_show_current_year.html.erb +0 -4
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_show_current_year.jsx +0 -22
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/_date_time_stacked_show_current_year.md +0 -1
- data/dist/chunks/_typeahead-VFd5WMRg.js +0 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3a79f50c7005e51f9647544f9ecad8561dd0eba490d7392867d247cc26152d57
|
|
4
|
+
data.tar.gz: 4d68e0342ca547569a384c873e5e4f9e8b35242c6180b37a3a6a2e107bbcd457
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 53a825e51f1fdd056c2a818f8ebff66256d82ef617d8ccdb206a7ee221c4b882c55a7513d91773b2083e109e8e577a8ebaf4f82eb655f99ccc3b041ee056d997
|
|
7
|
+
data.tar.gz: 2638946f9c1d16561f5b6a4b06465667fe79c590c3fc4e0ba63ddfee96986e7c48293358fab4d0c20aba9deb51bb40f2922eb575971913a596cec78b944446d3
|
|
@@ -17,7 +17,6 @@ type DateTimeProps = {
|
|
|
17
17
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
|
18
18
|
id?: string,
|
|
19
19
|
size?: "sm" | "md",
|
|
20
|
-
showCurrentYear?: boolean,
|
|
21
20
|
showDayOfWeek: boolean,
|
|
22
21
|
showIcon?: boolean,
|
|
23
22
|
timeZone?: string
|
|
@@ -33,7 +32,6 @@ const DateTime = (props: DateTimeProps): React.ReactElement => {
|
|
|
33
32
|
showDayOfWeek = false,
|
|
34
33
|
datetime,
|
|
35
34
|
id,
|
|
36
|
-
showCurrentYear = false,
|
|
37
35
|
showIcon = false,
|
|
38
36
|
size = 'md',
|
|
39
37
|
timeZone = 'America/New_York',
|
|
@@ -61,7 +59,6 @@ const DateTime = (props: DateTimeProps): React.ReactElement => {
|
|
|
61
59
|
vertical="baseline"
|
|
62
60
|
>
|
|
63
61
|
<FormattedDate
|
|
64
|
-
showCurrentYear={showCurrentYear}
|
|
65
62
|
showDayOfWeek={showDayOfWeek}
|
|
66
63
|
size={size}
|
|
67
64
|
value={datetime}
|
|
@@ -16,7 +16,6 @@ module Playbook
|
|
|
16
16
|
prop :dark, type: Playbook::Props::Boolean, default: false
|
|
17
17
|
prop :show_icon, type: Playbook::Props::Boolean, default: false
|
|
18
18
|
prop :show_day_of_week, type: Playbook::Props::Boolean, default: false
|
|
19
|
-
prop :show_current_year, type: Playbook::Props::Boolean, default: false
|
|
20
19
|
|
|
21
20
|
def classname
|
|
22
21
|
generate_classname("pb_date_time_kit", align)
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
examples:
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
rails:
|
|
4
4
|
- date_time_default: Default
|
|
5
5
|
- date_time_align: Alignment
|
|
6
6
|
- date_time_size: Size
|
|
7
|
-
- date_time_show_current_year: Show Current Year
|
|
8
7
|
|
|
9
8
|
react:
|
|
10
9
|
- date_time_default: Default
|
|
11
10
|
- date_time_align: Alignment
|
|
12
11
|
- date_time_size: Size
|
|
13
|
-
- date_time_show_current_year: Show Current Year
|
|
14
12
|
|
|
15
13
|
swift:
|
|
16
14
|
- date_time_default_swift: Default
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { default as DateTimeDefault } from './_date_time_default.jsx'
|
|
2
2
|
export { default as DateTimeAlign } from './_date_time_align.jsx'
|
|
3
3
|
export { default as DateTimeSize } from './_date_time_size.jsx'
|
|
4
|
-
export { default as DateTimeShowCurrentYear } from './_date_time_show_current_year.jsx'
|
|
@@ -17,7 +17,6 @@ type DateTimeStackedProps = {
|
|
|
17
17
|
datetime: Date,
|
|
18
18
|
dark: boolean,
|
|
19
19
|
timeZone?: string,
|
|
20
|
-
showCurrentYear?: boolean,
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
const DateTimeStacked = (props: DateTimeStackedProps): React.ReactElement => {
|
|
@@ -29,7 +28,6 @@ const DateTimeStacked = (props: DateTimeStackedProps): React.ReactElement => {
|
|
|
29
28
|
dark,
|
|
30
29
|
htmlOptions = {},
|
|
31
30
|
timeZone = 'America/New_York',
|
|
32
|
-
showCurrentYear = false,
|
|
33
31
|
} = props
|
|
34
32
|
|
|
35
33
|
const classes = buildCss('pb_date_time_stacked_kit', globalProps(props))
|
|
@@ -48,7 +46,6 @@ const DateTimeStacked = (props: DateTimeStackedProps): React.ReactElement => {
|
|
|
48
46
|
bold
|
|
49
47
|
dark={dark}
|
|
50
48
|
date={date || datetime}
|
|
51
|
-
showCurrentYear={showCurrentYear}
|
|
52
49
|
/>
|
|
53
50
|
</FlexItem>
|
|
54
51
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
<%= pb_content_tag do %>
|
|
2
2
|
|
|
3
3
|
<%= pb_rails("flex", props: {classname: "flex-container", vertical: "stretch"}) do %>
|
|
4
4
|
<%= pb_rails("body", props: {classname: "flex-item"}) do %>
|
|
5
|
-
<%= pb_rails("date_stacked", props: { date: object.date_time_value, size: "sm", align: "right", bold: true, dark: object.dark
|
|
5
|
+
<%= pb_rails("date_stacked", props: { date: object.date_time_value, size: "sm", align: "right", bold: true, dark: object.dark }) %>
|
|
6
6
|
<% end %>
|
|
7
7
|
<%= pb_rails("section_separator", props: { orientation: "vertical", classname: "date-time-padding" }) %>
|
|
8
8
|
<%= pb_rails("body", props: {classname: "flex-item"}) do %>
|
|
@@ -41,36 +41,3 @@ test('renders time in timezone', () => {
|
|
|
41
41
|
const kit = renderKit(DateTimeStacked, props)
|
|
42
42
|
expect(kit).toHaveTextContent(`${monthDayYear}11:00aMDT`)
|
|
43
43
|
})
|
|
44
|
-
|
|
45
|
-
test('renders current year when showCurrentYear is true', () => {
|
|
46
|
-
const currentYearDate = new Date()
|
|
47
|
-
const currentYear = currentYearDate.getFullYear()
|
|
48
|
-
|
|
49
|
-
const kit = renderKit(DateTimeStacked, {
|
|
50
|
-
data: { testid: 'datetimestacked-current-year' },
|
|
51
|
-
datetime: currentYearDate,
|
|
52
|
-
dark: false,
|
|
53
|
-
showCurrentYear: true,
|
|
54
|
-
})
|
|
55
|
-
expect(kit).toHaveTextContent(currentYear.toString())
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
test('hides current year by default', () => {
|
|
59
|
-
const currentYearDate = new Date()
|
|
60
|
-
const currentYear = currentYearDate.getFullYear()
|
|
61
|
-
|
|
62
|
-
const kit = renderKit(DateTimeStacked, {
|
|
63
|
-
data: { testid: 'datetimestacked-hide-year' },
|
|
64
|
-
datetime: currentYearDate,
|
|
65
|
-
dark: false,
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
const yearElement = kit.querySelector('.pb_caption_kit_xs')
|
|
69
|
-
|
|
70
|
-
if (yearElement) {
|
|
71
|
-
expect(yearElement.textContent).not.toBe(currentYear.toString())
|
|
72
|
-
} else {
|
|
73
|
-
|
|
74
|
-
expect(yearElement).toBeNull()
|
|
75
|
-
}
|
|
76
|
-
})
|
|
@@ -2,11 +2,9 @@ examples:
|
|
|
2
2
|
|
|
3
3
|
rails:
|
|
4
4
|
- date_time_stacked_default: Default
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
|
|
7
6
|
react:
|
|
8
7
|
- date_time_stacked_default: Default
|
|
9
|
-
- date_time_stacked_show_current_year: Show Current Year
|
|
10
8
|
|
|
11
9
|
swift:
|
|
12
10
|
- date_time_stacked_default_swift: Default
|
|
@@ -33,8 +33,6 @@ export default class PbDropdown extends PbEnhancedElement {
|
|
|
33
33
|
this.formPillProps = this.element.dataset.formPillProps
|
|
34
34
|
? JSON.parse(this.element.dataset.formPillProps)
|
|
35
35
|
: {};
|
|
36
|
-
const baseInput = this.element.querySelector(DROPDOWN_INPUT);
|
|
37
|
-
this.wasOriginallyRequired = baseInput && baseInput.hasAttribute("required");
|
|
38
36
|
this.setDefaultValue();
|
|
39
37
|
this.bindEventListeners();
|
|
40
38
|
this.bindSearchInput();
|
|
@@ -358,6 +356,17 @@ export default class PbDropdown extends PbEnhancedElement {
|
|
|
358
356
|
}
|
|
359
357
|
|
|
360
358
|
clearFormValidation(input) {
|
|
359
|
+
if (input.checkValidity()) {
|
|
360
|
+
const dropdownWrapperElement = input.closest(".dropdown_wrapper");
|
|
361
|
+
dropdownWrapperElement.classList.remove("error");
|
|
362
|
+
|
|
363
|
+
const errorLabelElement = dropdownWrapperElement.querySelector(
|
|
364
|
+
".pb_body_kit_negative"
|
|
365
|
+
);
|
|
366
|
+
if (errorLabelElement) {
|
|
367
|
+
errorLabelElement.remove();
|
|
368
|
+
}
|
|
369
|
+
}
|
|
361
370
|
if (this.isMultiSelect) {
|
|
362
371
|
if (this.selectedOptions.size > 0) {
|
|
363
372
|
const dropdownWrapperElement = input.closest(".dropdown_wrapper");
|
|
@@ -368,19 +377,6 @@ export default class PbDropdown extends PbEnhancedElement {
|
|
|
368
377
|
if (errorLabelElement) {
|
|
369
378
|
errorLabelElement.remove();
|
|
370
379
|
}
|
|
371
|
-
return;
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
if (input.checkValidity()) {
|
|
376
|
-
const dropdownWrapperElement = input.closest(".dropdown_wrapper");
|
|
377
|
-
dropdownWrapperElement.classList.remove("error");
|
|
378
|
-
|
|
379
|
-
const errorLabelElement = dropdownWrapperElement.querySelector(
|
|
380
|
-
".pb_body_kit_negative"
|
|
381
|
-
);
|
|
382
|
-
if (errorLabelElement) {
|
|
383
|
-
errorLabelElement.remove();
|
|
384
380
|
}
|
|
385
381
|
}
|
|
386
382
|
}
|
|
@@ -589,9 +585,7 @@ export default class PbDropdown extends PbEnhancedElement {
|
|
|
589
585
|
// for multi_select, for each selectedOption, create a hidden input
|
|
590
586
|
const name = baseInput.getAttribute("name");
|
|
591
587
|
this.selectedOptions.forEach((raw) => {
|
|
592
|
-
const
|
|
593
|
-
// Use id if available, otherwise fall back to value
|
|
594
|
-
const id = optionData.id || optionData.value;
|
|
588
|
+
const id = JSON.parse(raw).id;
|
|
595
589
|
const inp = document.createElement("input");
|
|
596
590
|
inp.type = "hidden";
|
|
597
591
|
inp.name = name;
|
|
@@ -599,19 +593,7 @@ export default class PbDropdown extends PbEnhancedElement {
|
|
|
599
593
|
inp.dataset.generated = "true";
|
|
600
594
|
baseInput.insertAdjacentElement("afterend", inp);
|
|
601
595
|
});
|
|
602
|
-
|
|
603
|
-
// For multi-select, remove required from base input when there are selections
|
|
604
|
-
// The generated inputs handle the form submission with actual values
|
|
605
|
-
// Restore required attribute when there are no selections (if it was originally required)
|
|
606
|
-
if (this.selectedOptions.size > 0) {
|
|
607
|
-
baseInput.value = "";
|
|
608
|
-
baseInput.removeAttribute("required");
|
|
609
|
-
} else {
|
|
610
|
-
baseInput.value = "";
|
|
611
|
-
if (this.wasOriginallyRequired) {
|
|
612
|
-
baseInput.setAttribute("required", "");
|
|
613
|
-
}
|
|
614
|
-
}
|
|
596
|
+
baseInput.value = "";
|
|
615
597
|
}
|
|
616
598
|
|
|
617
599
|
handleBackspaceClear() {
|
|
@@ -119,22 +119,21 @@ const Table = (props: TableProps): React.ReactElement => {
|
|
|
119
119
|
header.classList.add('sticky-left-shadow');
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
accumulatedWidth += (header as HTMLElement).offsetWidth;
|
|
123
|
+
}
|
|
124
124
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
cells.forEach((cell) => {
|
|
126
|
+
cell.classList.add('sticky');
|
|
127
|
+
(cell as HTMLElement).style.left = `${accumulatedWidth - (header as HTMLElement).offsetWidth}px`;
|
|
128
128
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
129
|
+
if (!isLastColumn) {
|
|
130
|
+
cell.classList.add('with-border-right');
|
|
131
|
+
cell.classList.remove('sticky-left-shadow');
|
|
132
|
+
} else {
|
|
133
|
+
cell.classList.remove('with-border-right');
|
|
134
|
+
cell.classList.add('sticky-left-shadow');
|
|
135
|
+
}
|
|
136
|
+
});
|
|
138
137
|
});
|
|
139
138
|
};
|
|
140
139
|
|
|
@@ -171,22 +170,21 @@ const Table = (props: TableProps): React.ReactElement => {
|
|
|
171
170
|
header.classList.add('sticky-right-shadow');
|
|
172
171
|
}
|
|
173
172
|
|
|
174
|
-
|
|
175
|
-
|
|
173
|
+
accumulatedWidth += (header as HTMLElement).offsetWidth;
|
|
174
|
+
}
|
|
176
175
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
176
|
+
cells.forEach((cell) => {
|
|
177
|
+
cell.classList.add('sticky');
|
|
178
|
+
(cell as HTMLElement).style.right = `${accumulatedWidth - (header as HTMLElement).offsetWidth}px`;
|
|
180
179
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}
|
|
180
|
+
if (!isLastColumn) {
|
|
181
|
+
cell.classList.add('with-border-left');
|
|
182
|
+
cell.classList.remove('sticky-right-shadow');
|
|
183
|
+
} else {
|
|
184
|
+
cell.classList.remove('with-border-left');
|
|
185
|
+
cell.classList.add('sticky-right-shadow');
|
|
186
|
+
}
|
|
187
|
+
});
|
|
190
188
|
});
|
|
191
189
|
};
|
|
192
190
|
|
|
@@ -213,24 +213,10 @@ export type GlobalProps = AlignContent & AlignItems & AlignSelf &
|
|
|
213
213
|
|
|
214
214
|
const getResponsivePropClasses = (prop: {[key: string]: string}, classPrefix: string) => {
|
|
215
215
|
const keys: string[] = Object.keys(prop)
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
if (prop.default !== undefined) {
|
|
221
|
-
const defaultValue: string = typeof(prop.default) === 'string' ? camelToSnakeCase(prop.default) : prop.default
|
|
222
|
-
classResult += `${classPrefix}_${defaultValue} `
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
// Handle responsive sizes (generates classes with size prefix)
|
|
226
|
-
keys.forEach((key) => {
|
|
227
|
-
if (screenSizeValues.includes(key)) {
|
|
228
|
-
const propValue: string = typeof(prop[key]) === 'string' ? camelToSnakeCase(prop[key]) : prop[key]
|
|
229
|
-
classResult += `${classPrefix}_${key}_${propValue} `
|
|
230
|
-
}
|
|
231
|
-
})
|
|
232
|
-
|
|
233
|
-
return classResult.trim()
|
|
216
|
+
return keys.map((size: Sizes) => {
|
|
217
|
+
const propValue: string = typeof(prop[size]) === 'string' ? camelToSnakeCase(prop[size]) : prop[size]
|
|
218
|
+
return `${classPrefix}_${size}_${propValue}`
|
|
219
|
+
}).join(" ")
|
|
234
220
|
}
|
|
235
221
|
|
|
236
222
|
//reusable function for top, bottom, right and left props
|
|
@@ -450,11 +436,9 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
|
|
|
450
436
|
if (typeof zIndexEntry[1] == "number") {
|
|
451
437
|
css += `z_index_${zIndexEntry[1]} `
|
|
452
438
|
} else if (typeof zIndexEntry[1] == "object") {
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
responsiveObj[key] = value.toString()
|
|
439
|
+
Object.entries(zIndexEntry[1]).forEach((zIndexObj) => {
|
|
440
|
+
css += `z_index_${zIndexObj[0]}_${zIndexObj[1]} `
|
|
456
441
|
})
|
|
457
|
-
css += getResponsivePropClasses(responsiveObj, 'z_index')
|
|
458
442
|
} else if (zIndexEntry[1] === 'max') {
|
|
459
443
|
css += `z_index_max `
|
|
460
444
|
}
|
|
@@ -479,11 +463,9 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
|
|
|
479
463
|
if (typeof displayEntry[1] == "string") {
|
|
480
464
|
css += `display_${displayEntry[1]} `
|
|
481
465
|
} else if (typeof displayEntry[1] == "object") {
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
responsiveObj[key] = typeof value === 'string' ? value : value.toString()
|
|
466
|
+
Object.entries(displayEntry[1]).forEach((displayObj) => {
|
|
467
|
+
css += `display_${displayObj[0]}_${displayObj[1]} `
|
|
485
468
|
})
|
|
486
|
-
css += getResponsivePropClasses(responsiveObj, 'display')
|
|
487
469
|
} else {
|
|
488
470
|
' '
|
|
489
471
|
}
|
|
@@ -35,21 +35,3 @@ test('Global Props: returns proper class name', () => {
|
|
|
35
35
|
})
|
|
36
36
|
}
|
|
37
37
|
})
|
|
38
|
-
|
|
39
|
-
test('Global Props: returns proper class name with default key', () => {
|
|
40
|
-
const testId = `${testSubject}-default-responsive`
|
|
41
|
-
render(
|
|
42
|
-
<Body
|
|
43
|
-
alignContent={{ default: "spaceAround", xs: "center", sm: "spaceAround", md: "center" }}
|
|
44
|
-
data={{ testid: testId }}
|
|
45
|
-
text="Hi"
|
|
46
|
-
/>
|
|
47
|
-
)
|
|
48
|
-
const kit = screen.getByTestId(testId)
|
|
49
|
-
// Should have base class for default value
|
|
50
|
-
expect(kit).toHaveClass(`align_content_space_around`)
|
|
51
|
-
// Should have responsive classes for screen sizes
|
|
52
|
-
expect(kit).toHaveClass(`align_content_xs_center`)
|
|
53
|
-
expect(kit).toHaveClass(`align_content_sm_space_around`)
|
|
54
|
-
expect(kit).toHaveClass(`align_content_md_center`)
|
|
55
|
-
})
|
|
@@ -34,21 +34,3 @@ test('Global Props: returns proper class name', () => {
|
|
|
34
34
|
})
|
|
35
35
|
}
|
|
36
36
|
})
|
|
37
|
-
|
|
38
|
-
test('Global Props: returns proper class name with default key', () => {
|
|
39
|
-
const testId = `${testSubject}-default-responsive`
|
|
40
|
-
render(
|
|
41
|
-
<Body
|
|
42
|
-
alignItems={{ default: "end", xs: "center", sm: "end", md: "center" }}
|
|
43
|
-
data={{ testid: testId }}
|
|
44
|
-
text="Hi"
|
|
45
|
-
/>
|
|
46
|
-
)
|
|
47
|
-
const kit = screen.getByTestId(testId)
|
|
48
|
-
// Should have base class for default value
|
|
49
|
-
expect(kit).toHaveClass(`align_items_end`)
|
|
50
|
-
// Should have responsive classes for screen sizes
|
|
51
|
-
expect(kit).toHaveClass(`align_items_xs_center`)
|
|
52
|
-
expect(kit).toHaveClass(`align_items_sm_end`)
|
|
53
|
-
expect(kit).toHaveClass(`align_items_md_center`)
|
|
54
|
-
})
|
|
@@ -35,21 +35,3 @@ test('Global Props: returns proper class name', () => {
|
|
|
35
35
|
})
|
|
36
36
|
}
|
|
37
37
|
})
|
|
38
|
-
|
|
39
|
-
test('Global Props: returns proper class name with default key', () => {
|
|
40
|
-
const testId = `${testSubject}-default-responsive`
|
|
41
|
-
render(
|
|
42
|
-
<Body
|
|
43
|
-
alignSelf={{ default: "end", xs: "center", sm: "end", md: "center" }}
|
|
44
|
-
data={{ testid: testId }}
|
|
45
|
-
text="Hi"
|
|
46
|
-
/>
|
|
47
|
-
)
|
|
48
|
-
const kit = screen.getByTestId(testId)
|
|
49
|
-
// Should have base class for default value
|
|
50
|
-
expect(kit).toHaveClass(`align_self_end`)
|
|
51
|
-
// Should have responsive classes for screen sizes
|
|
52
|
-
expect(kit).toHaveClass(`align_self_xs_center`)
|
|
53
|
-
expect(kit).toHaveClass(`align_self_sm_end`)
|
|
54
|
-
expect(kit).toHaveClass(`align_self_md_center`)
|
|
55
|
-
})
|
|
@@ -36,21 +36,3 @@ test('Global Props: returns proper class name', () => {
|
|
|
36
36
|
})
|
|
37
37
|
}
|
|
38
38
|
})
|
|
39
|
-
|
|
40
|
-
test('Global Props: returns proper class name with default key', () => {
|
|
41
|
-
const testId = `${testSubject}-default-responsive`
|
|
42
|
-
render(
|
|
43
|
-
<Body
|
|
44
|
-
data={{ testid: testId }}
|
|
45
|
-
display={{ default: "none", xs: "block", sm: "none", md: "block" }}
|
|
46
|
-
text="Hi"
|
|
47
|
-
/>
|
|
48
|
-
)
|
|
49
|
-
const kit = screen.getByTestId(testId)
|
|
50
|
-
// Should have base class for default value
|
|
51
|
-
expect(kit).toHaveClass(`display_none`)
|
|
52
|
-
// Should have responsive classes for screen sizes
|
|
53
|
-
expect(kit).toHaveClass(`display_xs_block`)
|
|
54
|
-
expect(kit).toHaveClass(`display_sm_none`)
|
|
55
|
-
expect(kit).toHaveClass(`display_md_block`)
|
|
56
|
-
})
|
|
@@ -62,21 +62,3 @@ test('Global Props: returns proper class name', () => {
|
|
|
62
62
|
})
|
|
63
63
|
}
|
|
64
64
|
})
|
|
65
|
-
|
|
66
|
-
test('Global Props: returns proper class name with default key', () => {
|
|
67
|
-
const testId = `${testSubject}-default-responsive`
|
|
68
|
-
render(
|
|
69
|
-
<Body
|
|
70
|
-
data={{ testid: testId }}
|
|
71
|
-
flex={{ default: "3", xs: "1", sm: "3", md: "1" }}
|
|
72
|
-
text="Hi"
|
|
73
|
-
/>
|
|
74
|
-
)
|
|
75
|
-
const kit = screen.getByTestId(testId)
|
|
76
|
-
// Should have base class for default value
|
|
77
|
-
expect(kit).toHaveClass(`flex_3`)
|
|
78
|
-
// Should have responsive classes for screen sizes
|
|
79
|
-
expect(kit).toHaveClass(`flex_xs_1`)
|
|
80
|
-
expect(kit).toHaveClass(`flex_sm_3`)
|
|
81
|
-
expect(kit).toHaveClass(`flex_md_1`)
|
|
82
|
-
})
|
|
@@ -35,21 +35,3 @@ test('Global Props: returns proper class name', () => {
|
|
|
35
35
|
})
|
|
36
36
|
}
|
|
37
37
|
})
|
|
38
|
-
|
|
39
|
-
test('Global Props: returns proper class name with default key', () => {
|
|
40
|
-
const testId = `${testSubject}-default-responsive`
|
|
41
|
-
render(
|
|
42
|
-
<Body
|
|
43
|
-
data={{ testid: testId }}
|
|
44
|
-
flexDirection={{ default: "column", xs: "row", sm: "column", md: "row" }}
|
|
45
|
-
text="Hi"
|
|
46
|
-
/>
|
|
47
|
-
)
|
|
48
|
-
const kit = screen.getByTestId(testId)
|
|
49
|
-
// Should have base class for default value
|
|
50
|
-
expect(kit).toHaveClass(`flex_direction_column`)
|
|
51
|
-
// Should have responsive classes for screen sizes
|
|
52
|
-
expect(kit).toHaveClass(`flex_direction_xs_row`)
|
|
53
|
-
expect(kit).toHaveClass(`flex_direction_sm_column`)
|
|
54
|
-
expect(kit).toHaveClass(`flex_direction_md_row`)
|
|
55
|
-
})
|
|
@@ -33,21 +33,3 @@ test('Global Props: Returns ordinal suffixed class name', () => {
|
|
|
33
33
|
})
|
|
34
34
|
}
|
|
35
35
|
})
|
|
36
|
-
|
|
37
|
-
test('Global Props: returns proper class name with default key', () => {
|
|
38
|
-
const testId = `${testSubject}-default-responsive`
|
|
39
|
-
render(
|
|
40
|
-
<Body
|
|
41
|
-
data={{ testid: testId }}
|
|
42
|
-
flexGrow={{ default: 1, xs: 0, sm: 1, md: 0 }}
|
|
43
|
-
text="Hi"
|
|
44
|
-
/>
|
|
45
|
-
)
|
|
46
|
-
const kit = screen.getByTestId(testId)
|
|
47
|
-
// Should have base class for default value
|
|
48
|
-
expect(kit).toHaveClass(`flex_grow_1`)
|
|
49
|
-
// Should have responsive classes for screen sizes
|
|
50
|
-
expect(kit).toHaveClass(`flex_grow_xs_0`)
|
|
51
|
-
expect(kit).toHaveClass(`flex_grow_sm_1`)
|
|
52
|
-
expect(kit).toHaveClass(`flex_grow_md_0`)
|
|
53
|
-
})
|
|
@@ -33,21 +33,3 @@ test('Global Props: Returns ordinal suffixed class name', () => {
|
|
|
33
33
|
})
|
|
34
34
|
}
|
|
35
35
|
})
|
|
36
|
-
|
|
37
|
-
test('Global Props: returns proper class name with default key', () => {
|
|
38
|
-
const testId = `${testSubject}-default-responsive`
|
|
39
|
-
render(
|
|
40
|
-
<Body
|
|
41
|
-
data={{ testid: testId }}
|
|
42
|
-
flexShrink={{ default: 0, xs: 1, sm: 0, md: 1 }}
|
|
43
|
-
text="Hi"
|
|
44
|
-
/>
|
|
45
|
-
)
|
|
46
|
-
const kit = screen.getByTestId(testId)
|
|
47
|
-
// Should have base class for default value
|
|
48
|
-
expect(kit).toHaveClass(`flex_shrink_0`)
|
|
49
|
-
// Should have responsive classes for screen sizes
|
|
50
|
-
expect(kit).toHaveClass(`flex_shrink_xs_1`)
|
|
51
|
-
expect(kit).toHaveClass(`flex_shrink_sm_0`)
|
|
52
|
-
expect(kit).toHaveClass(`flex_shrink_md_1`)
|
|
53
|
-
})
|
|
@@ -35,21 +35,3 @@ test('Global Props: returns proper class name', () => {
|
|
|
35
35
|
})
|
|
36
36
|
}
|
|
37
37
|
})
|
|
38
|
-
|
|
39
|
-
test('Global Props: returns proper class name with default key', () => {
|
|
40
|
-
const testId = `${testSubject}-default-responsive`
|
|
41
|
-
render(
|
|
42
|
-
<Body
|
|
43
|
-
data={{ testid: testId }}
|
|
44
|
-
flexWrap={{ default: "wrap", xs: "nowrap", sm: "wrap", md: "nowrap" }}
|
|
45
|
-
text="Hi"
|
|
46
|
-
/>
|
|
47
|
-
)
|
|
48
|
-
const kit = screen.getByTestId(testId)
|
|
49
|
-
// Should have base class for default value
|
|
50
|
-
expect(kit).toHaveClass(`flex_wrap_wrap`)
|
|
51
|
-
// Should have responsive classes for screen sizes
|
|
52
|
-
expect(kit).toHaveClass(`flex_wrap_xs_nowrap`)
|
|
53
|
-
expect(kit).toHaveClass(`flex_wrap_sm_wrap`)
|
|
54
|
-
expect(kit).toHaveClass(`flex_wrap_md_nowrap`)
|
|
55
|
-
})
|
|
@@ -35,21 +35,3 @@ test('Global Props: returns proper class name', () => {
|
|
|
35
35
|
})
|
|
36
36
|
}
|
|
37
37
|
})
|
|
38
|
-
|
|
39
|
-
test('Global Props: returns proper class name with default key', () => {
|
|
40
|
-
const testId = `${testSubject}-default-responsive`
|
|
41
|
-
render(
|
|
42
|
-
<Body
|
|
43
|
-
data={{ testid: testId }}
|
|
44
|
-
justifyContent={{ default: "spaceBetween", xs: "start", sm: "spaceBetween", md: "start" }}
|
|
45
|
-
text="Hi"
|
|
46
|
-
/>
|
|
47
|
-
)
|
|
48
|
-
const kit = screen.getByTestId(testId)
|
|
49
|
-
// Should have base class for default value
|
|
50
|
-
expect(kit).toHaveClass(`justify_content_space_between`)
|
|
51
|
-
// Should have responsive classes for screen sizes
|
|
52
|
-
expect(kit).toHaveClass(`justify_content_xs_start`)
|
|
53
|
-
expect(kit).toHaveClass(`justify_content_sm_space_between`)
|
|
54
|
-
expect(kit).toHaveClass(`justify_content_md_start`)
|
|
55
|
-
})
|