playbook_ui 15.8.0.pre.rc.1 → 16.0.0
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 -4
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_description.md +6 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_description.md +6 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/pb_circle_chart.test.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_description.md +6 -1
- data/app/pb_kits/playbook/pb_pb_gauge_chart/pb_gauge_chart.test.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_description.md +6 -1
- data/app/pb_kits/playbook/pb_pb_line_graph/pb_line_graph.test.jsx +1 -1
- data/app/pb_kits/playbook/utilities/test/globalProps/alignContent.test.js +37 -50
- data/app/pb_kits/playbook/utilities/test/globalProps/alignItems.test.js +38 -50
- data/app/pb_kits/playbook/utilities/test/globalProps/alignSelf.test.js +37 -50
- data/app/pb_kits/playbook/utilities/test/globalProps/display.test.js +37 -51
- data/app/pb_kits/playbook/utilities/test/globalProps/flex.test.js +44 -76
- data/app/pb_kits/playbook/utilities/test/globalProps/flexDirection.test.js +37 -50
- data/app/pb_kits/playbook/utilities/test/globalProps/flexGrow.test.js +35 -48
- data/app/pb_kits/playbook/utilities/test/globalProps/flexShrink.test.js +35 -48
- data/app/pb_kits/playbook/utilities/test/globalProps/flexWrap.test.js +37 -50
- data/app/pb_kits/playbook/utilities/test/globalProps/globalPropsTestHelper.js +373 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/justifyContent.test.js +37 -50
- data/app/pb_kits/playbook/utilities/test/globalProps/justifySelf.test.js +37 -50
- data/app/pb_kits/playbook/utilities/test/globalProps/order.test.js +36 -48
- data/app/pb_kits/playbook/utilities/test/globalProps/truncate.test.js +30 -18
- data/dist/chunks/_pb_line_graph-ByQFYuFO.js +1 -0
- data/dist/chunks/_typeahead-Bl8_gWmz.js +1 -0
- data/dist/chunks/componentRegistry-DzmmLR2x.js +1 -0
- data/dist/chunks/globalProps-D6R2eJnp.js +6 -0
- data/dist/chunks/lib-C8h70OzX.js +29 -0
- data/dist/chunks/vendor.js +4 -4
- data/dist/menu.yml +0 -29
- 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 +8 -147
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.scss +0 -6
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +0 -196
- data/app/pb_kits/playbook/pb_bar_graph/barGraph.test.js +0 -31
- data/app/pb_kits/playbook/pb_bar_graph/barGraphSettings.js +0 -32
- data/app/pb_kits/playbook/pb_bar_graph/barGraphTheme.ts +0 -106
- data/app/pb_kits/playbook/pb_bar_graph/bar_graph.html.erb +0 -1
- data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +0 -98
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_colors.html.erb +0 -26
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_colors.jsx +0 -55
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_colors.md +0 -2
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.html.erb +0 -42
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.md +0 -2
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.html.erb +0 -26
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.jsx +0 -55
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.html.erb +0 -26
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.jsx +0 -69
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.md +0 -3
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_horizontal.html.erb +0 -58
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_horizontal.jsx +0 -64
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend.html.erb +0 -14
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend.jsx +0 -40
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_non_clickable.html.erb +0 -15
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_non_clickable.jsx +0 -48
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_position.html.erb +0 -62
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_position.jsx +0 -136
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_position.md +0 -17
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_negative_numbers.html.erb +0 -23
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_negative_numbers.jsx +0 -52
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.html.erb +0 -26
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.jsx +0 -86
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.md +0 -3
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_spline.html.erb +0 -20
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_spline.jsx +0 -46
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_spline.md +0 -2
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_stacked.html.erb +0 -22
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_stacked.jsx +0 -55
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_stacked.md +0 -1
- data/app/pb_kits/playbook/pb_bar_graph/docs/_description.md +0 -1
- data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +0 -28
- data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +0 -11
- data/app/pb_kits/playbook/pb_circle_chart/ChartsTypes.ts +0 -2
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.scss +0 -16
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +0 -228
- data/app/pb_kits/playbook/pb_circle_chart/circleChart.test.js +0 -45
- data/app/pb_kits/playbook/pb_circle_chart/circleChartTheme.ts +0 -88
- data/app/pb_kits/playbook/pb_circle_chart/circle_chart.html.erb +0 -10
- data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +0 -99
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.html.erb +0 -26
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.jsx +0 -88
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.html.erb +0 -20
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx +0 -44
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors_rails.md +0 -2
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors_react.md +0 -2
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.html.erb +0 -20
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.jsx +0 -43
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.md +0 -5
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.html.erb +0 -19
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx +0 -38
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_inner_sizes.html.erb +0 -136
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_inner_sizes.jsx +0 -152
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.html.erb +0 -86
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.jsx +0 -142
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.md +0 -14
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_live_data.jsx +0 -63
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.html.erb +0 -22
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.jsx +0 -45
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_labels.html.erb +0 -37
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_labels.jsx +0 -61
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_legend_kit.html.erb +0 -22
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_legend_kit.jsx +0 -41
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_title.html.erb +0 -38
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_title.jsx +0 -55
- data/app/pb_kits/playbook/pb_circle_chart/docs/_description.md +0 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +0 -26
- data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +0 -11
- data/app/pb_kits/playbook/pb_dashboard/commonSettings.js +0 -104
- data/app/pb_kits/playbook/pb_dashboard/pbChartsColorsHelper.ts +0 -16
- data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +0 -174
- data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +0 -173
- data/app/pb_kits/playbook/pb_dashboard/themeTypes.ts +0 -20
- data/app/pb_kits/playbook/pb_gauge/_gauge.scss +0 -49
- data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +0 -215
- data/app/pb_kits/playbook/pb_gauge/docs/_description.md +0 -1
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors.html.erb +0 -12
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors.jsx +0 -36
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors_rails.md +0 -2
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors_react.md +0 -2
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex.html.erb +0 -32
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex.jsx +0 -146
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex_rails.md +0 -1
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex_react.md +0 -1
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_default.html.erb +0 -11
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_default.jsx +0 -30
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_disable_animation.html.erb +0 -12
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_disable_animation.jsx +0 -36
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.html.erb +0 -14
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.jsx +0 -49
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_height.html.erb +0 -15
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_height.jsx +0 -62
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_live_data.jsx +0 -76
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.html.erb +0 -15
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.jsx +0 -54
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.md +0 -1
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.html.erb +0 -27
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.jsx +0 -80
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.md +0 -2
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_title.html.erb +0 -14
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_title.jsx +0 -38
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units.html.erb +0 -29
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units.jsx +0 -72
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units_react.md +0 -1
- data/app/pb_kits/playbook/pb_gauge/docs/example.yml +0 -27
- data/app/pb_kits/playbook/pb_gauge/docs/index.js +0 -11
- data/app/pb_kits/playbook/pb_gauge/gauge.html.erb +0 -2
- data/app/pb_kits/playbook/pb_gauge/gauge.rb +0 -56
- data/app/pb_kits/playbook/pb_gauge/gauge.test.js +0 -35
- data/app/pb_kits/playbook/pb_gauge/gaugeTheme.ts +0 -91
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.scss +0 -3
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +0 -166
- data/app/pb_kits/playbook/pb_line_graph/docs/_description.md +0 -1
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors.html.erb +0 -26
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors.jsx +0 -56
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors_rails.md +0 -2
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors_react.md +0 -3
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_default.html.erb +0 -26
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_default.jsx +0 -52
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.html.erb +0 -26
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.jsx +0 -70
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.md +0 -3
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend.html.erb +0 -15
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend.jsx +0 -43
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_nonclickable.html.erb +0 -16
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_nonclickable.jsx +0 -49
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_position.html.erb +0 -62
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_position.jsx +0 -129
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_position.md +0 -14
- data/app/pb_kits/playbook/pb_line_graph/docs/example.yml +0 -18
- data/app/pb_kits/playbook/pb_line_graph/docs/index.js +0 -6
- data/app/pb_kits/playbook/pb_line_graph/lineGraph.test.js +0 -52
- data/app/pb_kits/playbook/pb_line_graph/lineGraphSettings.js +0 -30
- data/app/pb_kits/playbook/pb_line_graph/lineGraphTheme.ts +0 -125
- data/app/pb_kits/playbook/pb_line_graph/line_graph.html.erb +0 -1
- data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +0 -93
- data/dist/chunks/_typeahead-D0GNUBXn.js +0 -6
- data/dist/chunks/lib-DxCgrqqG.js +0 -29
|
@@ -1,55 +1,42 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { render, screen } from '../../test-utils'
|
|
3
|
-
|
|
4
|
-
import Body from '../../../pb_body/_body'
|
|
1
|
+
import { testGlobalProp, testGlobalPropResponsiveWithDefault, testGlobalPropAbsence, testGlobalPropInvalidValues } from './globalPropsTestHelper'
|
|
5
2
|
import { camelToSnakeCase } from '../../../utilities/text'
|
|
6
|
-
import
|
|
3
|
+
import Body from '../../../pb_body/_body'
|
|
4
|
+
import Button from '../../../pb_button/_button'
|
|
5
|
+
import Card from '../../../pb_card/_card'
|
|
6
|
+
import Title from '../../../pb_title/_title'
|
|
7
|
+
import Flex from '../../../pb_flex/_flex'
|
|
8
|
+
import Link from '../../../pb_link/_link'
|
|
9
|
+
import Badge from '../../../pb_badge/_badge'
|
|
7
10
|
|
|
8
|
-
|
|
11
|
+
// Note: TextInput excluded - flexDirection is a flexbox property that doesn't apply to form inputs
|
|
12
|
+
testGlobalProp(
|
|
13
|
+
'flexDirection',
|
|
14
|
+
['row', 'column', 'columnReverse'],
|
|
15
|
+
(v) => `flex_direction_${camelToSnakeCase(v)}`,
|
|
16
|
+
(size, v) => `flex_direction_${size}_${camelToSnakeCase(v)}`,
|
|
17
|
+
[Body, Button, Card, Title, Flex, Link, Badge]
|
|
18
|
+
)
|
|
9
19
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
data={{ testid: testId }}
|
|
17
|
-
flexDirection={`${propValues[x]}`}
|
|
18
|
-
text="Hi"
|
|
19
|
-
/>
|
|
20
|
-
)
|
|
21
|
-
const kit = screen.getByTestId(testId)
|
|
22
|
-
expect(kit).toHaveClass(`flex_direction_${camelToSnakeCase(propValues[x])}`)
|
|
20
|
+
testGlobalPropResponsiveWithDefault(
|
|
21
|
+
'flexDirection',
|
|
22
|
+
{ default: 'column', xs: 'row', sm: 'column', md: 'row' },
|
|
23
|
+
(v) => `flex_direction_${camelToSnakeCase(v)}`,
|
|
24
|
+
(size, v) => `flex_direction_${size}_${camelToSnakeCase(v)}`
|
|
25
|
+
)
|
|
23
26
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
text="Hi"
|
|
31
|
-
/>
|
|
32
|
-
)
|
|
33
|
-
const kit = screen.getByTestId(testId)
|
|
34
|
-
expect(kit).toHaveClass(`flex_direction_${size}_${camelToSnakeCase(propValues[x])}`)
|
|
35
|
-
})
|
|
36
|
-
}
|
|
37
|
-
})
|
|
27
|
+
testGlobalPropAbsence(
|
|
28
|
+
'flexDirection',
|
|
29
|
+
['flex_direction_row', 'flex_direction_column', 'flex_direction_column_reverse'],
|
|
30
|
+
undefined,
|
|
31
|
+
{ skipNull: true }
|
|
32
|
+
)
|
|
38
33
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
})
|
|
34
|
+
// NOTE: Currently using skipKnownIssues: true because globalProps.ts generates classes for invalid values
|
|
35
|
+
// NOTE: Using allowRenderingErrors: true because invalid types (like numbers) cause rendering errors with camelToSnakeCase
|
|
36
|
+
testGlobalPropInvalidValues(
|
|
37
|
+
'flexDirection',
|
|
38
|
+
['invalid', 'bad_value', 'not_a_direction', 'special-chars!@#'],
|
|
39
|
+
['flex_direction_invalid', 'flex_direction_bad_value', 'flex_direction_not_a_direction', 'flex_direction_special-chars!@#'],
|
|
40
|
+
undefined,
|
|
41
|
+
{ skipKnownIssues: true, allowRenderingErrors: true }
|
|
42
|
+
)
|
|
@@ -1,53 +1,40 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { render, screen } from '../../test-utils'
|
|
3
|
-
|
|
1
|
+
import { testGlobalProp, testGlobalPropResponsiveWithDefault, testGlobalPropAbsence, testGlobalPropInvalidValues } from './globalPropsTestHelper'
|
|
4
2
|
import Body from '../../../pb_body/_body'
|
|
5
|
-
import
|
|
3
|
+
import Button from '../../../pb_button/_button'
|
|
4
|
+
import Card from '../../../pb_card/_card'
|
|
5
|
+
import Title from '../../../pb_title/_title'
|
|
6
|
+
import Flex from '../../../pb_flex/_flex'
|
|
7
|
+
import Link from '../../../pb_link/_link'
|
|
8
|
+
import Badge from '../../../pb_badge/_badge'
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
// Note: TextInput excluded - flexGrow is a flexbox property that doesn't apply to form inputs
|
|
11
|
+
testGlobalProp(
|
|
12
|
+
'flexGrow',
|
|
13
|
+
[0, 1],
|
|
14
|
+
(v) => `flex_grow_${v}`,
|
|
15
|
+
(size, v) => `flex_grow_${size}_${v}`,
|
|
16
|
+
[Body, Button, Card, Title, Flex, Link, Badge]
|
|
17
|
+
)
|
|
8
18
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
flexGrow={x}
|
|
16
|
-
text="Hi"
|
|
17
|
-
/>
|
|
18
|
-
)
|
|
19
|
-
const kit = screen.getByTestId(testId)
|
|
20
|
-
expect(kit).toHaveClass(`flex_grow_${x}`)
|
|
19
|
+
testGlobalPropResponsiveWithDefault(
|
|
20
|
+
'flexGrow',
|
|
21
|
+
{ default: 1, xs: 0, sm: 1, md: 0 },
|
|
22
|
+
(v) => `flex_grow_${v}`,
|
|
23
|
+
(size, v) => `flex_grow_${size}_${v}`
|
|
24
|
+
)
|
|
21
25
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
text="Hi"
|
|
29
|
-
/>
|
|
30
|
-
)
|
|
31
|
-
const kit = screen.getByTestId(testId)
|
|
32
|
-
expect(kit).toHaveClass(`flex_grow_${size}_${x}`)
|
|
33
|
-
})
|
|
34
|
-
}
|
|
35
|
-
})
|
|
26
|
+
testGlobalPropAbsence(
|
|
27
|
+
'flexGrow',
|
|
28
|
+
['flex_grow_0', 'flex_grow_1'],
|
|
29
|
+
undefined,
|
|
30
|
+
{ skipNull: true }
|
|
31
|
+
)
|
|
36
32
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
+
// NOTE: Currently using skipKnownIssues: true because globalProps.ts generates classes for invalid values
|
|
34
|
+
testGlobalPropInvalidValues(
|
|
35
|
+
'flexGrow',
|
|
36
|
+
[2, -1, 999, 'invalid', 'bad_value', 'special-chars!@#'],
|
|
37
|
+
['flex_grow_2', 'flex_grow_-1', 'flex_grow_999', 'flex_grow_invalid', 'flex_grow_bad_value', 'flex_grow_special-chars!@#'],
|
|
38
|
+
undefined,
|
|
39
|
+
{ skipKnownIssues: true }
|
|
40
|
+
)
|
|
@@ -1,53 +1,40 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { render, screen } from '../../test-utils'
|
|
3
|
-
|
|
1
|
+
import { testGlobalProp, testGlobalPropResponsiveWithDefault, testGlobalPropAbsence, testGlobalPropInvalidValues } from './globalPropsTestHelper'
|
|
4
2
|
import Body from '../../../pb_body/_body'
|
|
5
|
-
import
|
|
3
|
+
import Button from '../../../pb_button/_button'
|
|
4
|
+
import Card from '../../../pb_card/_card'
|
|
5
|
+
import Title from '../../../pb_title/_title'
|
|
6
|
+
import Flex from '../../../pb_flex/_flex'
|
|
7
|
+
import Link from '../../../pb_link/_link'
|
|
8
|
+
import Badge from '../../../pb_badge/_badge'
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
// Note: TextInput excluded - flexShrink is a flexbox property that doesn't apply to form inputs
|
|
11
|
+
testGlobalProp(
|
|
12
|
+
'flexShrink',
|
|
13
|
+
[0, 1],
|
|
14
|
+
(v) => `flex_shrink_${v}`,
|
|
15
|
+
(size, v) => `flex_shrink_${size}_${v}`,
|
|
16
|
+
[Body, Button, Card, Title, Flex, Link, Badge]
|
|
17
|
+
)
|
|
8
18
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
flexShrink={x}
|
|
16
|
-
text="Hi"
|
|
17
|
-
/>
|
|
18
|
-
)
|
|
19
|
-
const kit = screen.getByTestId(testId)
|
|
20
|
-
expect(kit).toHaveClass(`flex_shrink_${x}`)
|
|
19
|
+
testGlobalPropResponsiveWithDefault(
|
|
20
|
+
'flexShrink',
|
|
21
|
+
{ default: 0, xs: 1, sm: 0, md: 1 },
|
|
22
|
+
(v) => `flex_shrink_${v}`,
|
|
23
|
+
(size, v) => `flex_shrink_${size}_${v}`
|
|
24
|
+
)
|
|
21
25
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
text="Hi"
|
|
29
|
-
/>
|
|
30
|
-
)
|
|
31
|
-
const kit = screen.getByTestId(testId)
|
|
32
|
-
expect(kit).toHaveClass(`flex_shrink_${size}_${x}`)
|
|
33
|
-
})
|
|
34
|
-
}
|
|
35
|
-
})
|
|
26
|
+
testGlobalPropAbsence(
|
|
27
|
+
'flexShrink',
|
|
28
|
+
['flex_shrink_0', 'flex_shrink_1'],
|
|
29
|
+
undefined,
|
|
30
|
+
{ skipNull: true }
|
|
31
|
+
)
|
|
36
32
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
})
|
|
33
|
+
// NOTE: Currently using skipKnownIssues: true because globalProps.ts generates classes for invalid values
|
|
34
|
+
testGlobalPropInvalidValues(
|
|
35
|
+
'flexShrink',
|
|
36
|
+
[2, -1, 999, 'invalid', 'bad_value', 'special-chars!@#'],
|
|
37
|
+
['flex_shrink_2', 'flex_shrink_-1', 'flex_shrink_999', 'flex_shrink_invalid', 'flex_shrink_bad_value', 'flex_shrink_special-chars!@#'],
|
|
38
|
+
undefined,
|
|
39
|
+
{ skipKnownIssues: true }
|
|
40
|
+
)
|
|
@@ -1,55 +1,42 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { render, screen } from '../../test-utils'
|
|
3
|
-
|
|
4
|
-
import Body from '../../../pb_body/_body'
|
|
1
|
+
import { testGlobalProp, testGlobalPropResponsiveWithDefault, testGlobalPropAbsence, testGlobalPropInvalidValues } from './globalPropsTestHelper'
|
|
5
2
|
import { camelToSnakeCase } from '../../../utilities/text'
|
|
6
|
-
import
|
|
3
|
+
import Body from '../../../pb_body/_body'
|
|
4
|
+
import Button from '../../../pb_button/_button'
|
|
5
|
+
import Card from '../../../pb_card/_card'
|
|
6
|
+
import Title from '../../../pb_title/_title'
|
|
7
|
+
import Flex from '../../../pb_flex/_flex'
|
|
8
|
+
import Link from '../../../pb_link/_link'
|
|
9
|
+
import Badge from '../../../pb_badge/_badge'
|
|
7
10
|
|
|
8
|
-
|
|
11
|
+
// Note: TextInput excluded - flexWrap is a flexbox property that doesn't apply to form inputs
|
|
12
|
+
testGlobalProp(
|
|
13
|
+
'flexWrap',
|
|
14
|
+
['wrap', 'nowrap', 'wrapReverse'],
|
|
15
|
+
(v) => `flex_wrap_${camelToSnakeCase(v)}`,
|
|
16
|
+
(size, v) => `flex_wrap_${size}_${camelToSnakeCase(v)}`,
|
|
17
|
+
[Body, Button, Card, Title, Flex, Link, Badge]
|
|
18
|
+
)
|
|
9
19
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
data={{ testid: testId }}
|
|
17
|
-
flexWrap={`${propValues[x]}`}
|
|
18
|
-
text="Hi"
|
|
19
|
-
/>
|
|
20
|
-
)
|
|
21
|
-
const kit = screen.getByTestId(testId)
|
|
22
|
-
expect(kit).toHaveClass(`flex_wrap_${camelToSnakeCase(propValues[x])}`)
|
|
20
|
+
testGlobalPropResponsiveWithDefault(
|
|
21
|
+
'flexWrap',
|
|
22
|
+
{ default: 'wrap', xs: 'nowrap', sm: 'wrap', md: 'nowrap' },
|
|
23
|
+
(v) => `flex_wrap_${camelToSnakeCase(v)}`,
|
|
24
|
+
(size, v) => `flex_wrap_${size}_${camelToSnakeCase(v)}`
|
|
25
|
+
)
|
|
23
26
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
text="Hi"
|
|
31
|
-
/>
|
|
32
|
-
)
|
|
33
|
-
const kit = screen.getByTestId(testId)
|
|
34
|
-
expect(kit).toHaveClass(`flex_wrap_${size}_${camelToSnakeCase(propValues[x])}`)
|
|
35
|
-
})
|
|
36
|
-
}
|
|
37
|
-
})
|
|
27
|
+
testGlobalPropAbsence(
|
|
28
|
+
'flexWrap',
|
|
29
|
+
['flex_wrap_wrap', 'flex_wrap_nowrap', 'flex_wrap_wrap_reverse'],
|
|
30
|
+
undefined,
|
|
31
|
+
{ skipNull: true }
|
|
32
|
+
)
|
|
38
33
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
})
|
|
34
|
+
// NOTE: Currently using skipKnownIssues: true because globalProps.ts generates classes for invalid values
|
|
35
|
+
// NOTE: Using allowRenderingErrors: true because invalid types (like numbers) cause rendering errors with camelToSnakeCase
|
|
36
|
+
testGlobalPropInvalidValues(
|
|
37
|
+
'flexWrap',
|
|
38
|
+
['invalid', 'bad_value', 'not_a_wrap_value', 'special-chars!@#'],
|
|
39
|
+
['flex_wrap_invalid', 'flex_wrap_bad_value', 'flex_wrap_not_a_wrap_value', 'flex_wrap_special-chars!@#'],
|
|
40
|
+
undefined,
|
|
41
|
+
{ skipKnownIssues: true, allowRenderingErrors: true }
|
|
42
|
+
)
|