playbook_ui 15.8.0.pre.rc.1 → 16.0.0.pre.alpha.HFH3979Applydepwarningfixtoplaybook13635
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_icon/icon.rb +6 -1
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +7 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_disabled_options.md +1 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single_disabled.html.erb +135 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single_disabled.jsx +147 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_single_disabled.md +1 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.test.jsx +402 -27
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select_options.tsx +1 -0
- data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.html.erb +30 -0
- data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.jsx +1 -1
- data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.md +1 -1
- data/app/pb_kits/playbook/pb_multiple_users/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_multiple_users/multiple_users.html.erb +51 -7
- data/app/pb_kits/playbook/pb_multiple_users/multiple_users.rb +1 -0
- 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/pb_radio/_radio.scss +8 -0
- data/app/pb_kits/playbook/pb_table/docs/_sections.yml +68 -0
- 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/borderRadius.test.js +33 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/bottom.test.js +60 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/cursor.test.js +42 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/dark.test.js +33 -0
- 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/gap.test.js +87 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/globalPropsTestHelper.js +373 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/height.test.js +68 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/htmlOptions.test.js +510 -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/left.test.js +60 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/lineHeight.test.js +33 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/margin.test.js +95 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/numberSpacing.test.js +33 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/order.test.js +36 -48
- data/app/pb_kits/playbook/utilities/test/globalProps/overflow.test.js +68 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/padding.test.js +95 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/position.test.js +33 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/right.test.js +60 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/shadow.test.js +33 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/textAlign.test.js +41 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/top.test.js +60 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/truncate.test.js +30 -18
- data/app/pb_kits/playbook/utilities/test/globalProps/verticalAlign.test.js +40 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/width.test.js +66 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/zIndex.test.js +50 -0
- data/dist/chunks/_pb_line_graph-hxi01lk7.js +1 -0
- data/dist/chunks/_typeahead-BgLnlhzP.js +1 -0
- data/dist/chunks/componentRegistry-DzmmLR2x.js +1 -0
- data/dist/chunks/globalProps-DgYwLYNx.js +6 -0
- data/dist/chunks/lib-NLxTo8OB.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 +2 -2
- metadata +34 -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 {
|
|
3
|
-
|
|
1
|
+
import { testGlobalProp, testGlobalPropResponsiveWithDefault, testGlobalPropAbsence, testGlobalPropInvalidValues } from './globalPropsTestHelper'
|
|
2
|
+
import { camelToSnakeCase } from '../../../utilities/text'
|
|
4
3
|
import Body from '../../../pb_body/_body'
|
|
5
|
-
import
|
|
6
|
-
import
|
|
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 - justifySelf is a flexbox property that doesn't apply to form inputs
|
|
12
|
+
testGlobalProp(
|
|
13
|
+
'justifySelf',
|
|
14
|
+
['start', 'center', 'end', 'auto', 'stretch'],
|
|
15
|
+
(v) => `justify_self_${camelToSnakeCase(v)}`,
|
|
16
|
+
(size, v) => `justify_self_${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
|
-
justifySelf={`${propValues[x]}`}
|
|
18
|
-
text="Hi"
|
|
19
|
-
/>
|
|
20
|
-
)
|
|
21
|
-
const kit = screen.getByTestId(testId)
|
|
22
|
-
expect(kit).toHaveClass(`justify_self_${camelToSnakeCase(propValues[x])}`)
|
|
20
|
+
testGlobalPropResponsiveWithDefault(
|
|
21
|
+
'justifySelf',
|
|
22
|
+
{ default: 'end', xs: 'start', sm: 'end', md: 'center' },
|
|
23
|
+
(v) => `justify_self_${camelToSnakeCase(v)}`,
|
|
24
|
+
(size, v) => `justify_self_${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(`justify_self_${size}_${camelToSnakeCase(propValues[x])}`)
|
|
35
|
-
})
|
|
36
|
-
}
|
|
37
|
-
})
|
|
27
|
+
testGlobalPropAbsence(
|
|
28
|
+
'justifySelf',
|
|
29
|
+
['justify_self_start', 'justify_self_center', 'justify_self_end', 'justify_self_auto', 'justify_self_stretch'],
|
|
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(`justify_self_end`)
|
|
51
|
-
// Should have responsive classes for screen sizes
|
|
52
|
-
expect(kit).toHaveClass(`justify_self_xs_start`)
|
|
53
|
-
expect(kit).toHaveClass(`justify_self_sm_end`)
|
|
54
|
-
expect(kit).toHaveClass(`justify_self_md_center`)
|
|
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
|
+
'justifySelf',
|
|
38
|
+
['invalid', 'bad_value', 'not_a_justify_value', 'special-chars!@#'],
|
|
39
|
+
['justify_self_invalid', 'justify_self_bad_value', 'justify_self_not_a_justify_value', 'justify_self_special-chars!@#'],
|
|
40
|
+
undefined,
|
|
41
|
+
{ skipKnownIssues: true, allowRenderingErrors: true }
|
|
42
|
+
)
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { testGlobalProp, testGlobalPropAbsence, testGlobalPropInvalidValues } from './globalPropsTestHelper'
|
|
3
|
+
import { render, screen } from '../../test-utils'
|
|
4
|
+
import Body from '../../../pb_body/_body'
|
|
5
|
+
import Button from '../../../pb_button/_button'
|
|
6
|
+
import Card from '../../../pb_card/_card'
|
|
7
|
+
import Title from '../../../pb_title/_title'
|
|
8
|
+
import Flex from '../../../pb_flex/_flex'
|
|
9
|
+
import Link from '../../../pb_link/_link'
|
|
10
|
+
import Badge from '../../../pb_badge/_badge'
|
|
11
|
+
|
|
12
|
+
const validSizes = ['xs', 'sm', 'md', 'lg', 'xl']
|
|
13
|
+
|
|
14
|
+
// NOTE: TextInput excluded - positioning props are not valid for input elements
|
|
15
|
+
// Test left prop with string values
|
|
16
|
+
testGlobalProp(
|
|
17
|
+
'left',
|
|
18
|
+
validSizes,
|
|
19
|
+
(v) => `left_${v}`,
|
|
20
|
+
null,
|
|
21
|
+
[Body, Button, Card, Title, Flex, Link, Badge]
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
// Test left prop with object values (inset) - tested separately due to object value complexity
|
|
25
|
+
test('Global Props: left returns proper class name with object values (inset)', () => {
|
|
26
|
+
const testCases = [
|
|
27
|
+
{ value: { value: 'md', inset: true }, expected: 'left_md_inset' },
|
|
28
|
+
{ value: { value: 'lg', inset: false }, expected: 'left_lg' },
|
|
29
|
+
{ value: { value: 'sm', inset: true }, expected: 'left_sm_inset' }
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
testCases.forEach(({ value, expected }) => {
|
|
33
|
+
const testId = `body-left-object-${value.value}-${value.inset}`
|
|
34
|
+
render(
|
|
35
|
+
<Body
|
|
36
|
+
data={{ testid: testId }}
|
|
37
|
+
left={value}
|
|
38
|
+
text="Hi"
|
|
39
|
+
/>
|
|
40
|
+
)
|
|
41
|
+
const kit = screen.getByTestId(testId)
|
|
42
|
+
expect(kit).toHaveClass(expected)
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
testGlobalPropAbsence(
|
|
47
|
+
'left',
|
|
48
|
+
['left_xs', 'left_sm', 'left_md', 'left_lg', 'left_xl'],
|
|
49
|
+
undefined,
|
|
50
|
+
{ skipNull: true }
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
// NOTE: Currently using skipKnownIssues: true because globalProps.ts generates classes for invalid values
|
|
54
|
+
testGlobalPropInvalidValues(
|
|
55
|
+
'left',
|
|
56
|
+
['invalid', 'bad_value', 'not_a_size', 'special-chars!@#'],
|
|
57
|
+
['left_invalid', 'left_bad_value', 'left_not_a_size', 'left_special-chars!@#'],
|
|
58
|
+
undefined,
|
|
59
|
+
{ skipKnownIssues: true }
|
|
60
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { testGlobalProp, testGlobalPropAbsence, testGlobalPropInvalidValues } from './globalPropsTestHelper'
|
|
2
|
+
import Body from '../../../pb_body/_body'
|
|
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'
|
|
9
|
+
|
|
10
|
+
// NOTE: TextInput excluded - lineHeight is not a valid prop for input elements
|
|
11
|
+
testGlobalProp(
|
|
12
|
+
'lineHeight',
|
|
13
|
+
['loosest', 'looser', 'loose', 'normal', 'tight', 'tighter', 'tightest'],
|
|
14
|
+
(v) => `line_height_${v}`,
|
|
15
|
+
null,
|
|
16
|
+
[Body, Button, Card, Title, Flex, Link, Badge]
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
testGlobalPropAbsence(
|
|
20
|
+
'lineHeight',
|
|
21
|
+
['line_height_loosest', 'line_height_looser', 'line_height_loose', 'line_height_normal', 'line_height_tight', 'line_height_tighter', 'line_height_tightest'],
|
|
22
|
+
undefined,
|
|
23
|
+
{ skipNull: true }
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
// NOTE: Currently using skipKnownIssues: true because globalProps.ts generates classes for invalid values
|
|
27
|
+
testGlobalPropInvalidValues(
|
|
28
|
+
'lineHeight',
|
|
29
|
+
['invalid', 'bad_value', 'not_a_line_height', 'special-chars!@#'],
|
|
30
|
+
['line_height_invalid', 'line_height_bad_value', 'line_height_not_a_line_height', 'line_height_special-chars!@#'],
|
|
31
|
+
undefined,
|
|
32
|
+
{ skipKnownIssues: true }
|
|
33
|
+
)
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { testGlobalProp, testGlobalPropAbsence, testGlobalPropInvalidValues } from './globalPropsTestHelper'
|
|
2
|
+
import Body from '../../../pb_body/_body'
|
|
3
|
+
import Button from '../../../pb_button/_button'
|
|
4
|
+
import Card from '../../../pb_card/_card'
|
|
5
|
+
import Title from '../../../pb_title/_title'
|
|
6
|
+
import TextInput from '../../../pb_text_input/_text_input'
|
|
7
|
+
import Flex from '../../../pb_flex/_flex'
|
|
8
|
+
import Link from '../../../pb_link/_link'
|
|
9
|
+
import Badge from '../../../pb_badge/_badge'
|
|
10
|
+
|
|
11
|
+
const validValues = ['none', 'xs', 'sm', 'md', 'lg', 'xl', 'auto', 'initial', 'inherit']
|
|
12
|
+
|
|
13
|
+
// Test margin prop
|
|
14
|
+
testGlobalProp(
|
|
15
|
+
'margin',
|
|
16
|
+
validValues,
|
|
17
|
+
(v) => `m_${v}`,
|
|
18
|
+
null,
|
|
19
|
+
[Body, Button, Card, Title, TextInput, Flex, Link, Badge]
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
// Test marginX prop
|
|
23
|
+
testGlobalProp(
|
|
24
|
+
'marginX',
|
|
25
|
+
validValues,
|
|
26
|
+
(v) => `mx_${v}`,
|
|
27
|
+
null,
|
|
28
|
+
[Body, Button, Card, Title, TextInput, Flex, Link, Badge]
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
// Test marginY prop
|
|
32
|
+
testGlobalProp(
|
|
33
|
+
'marginY',
|
|
34
|
+
validValues,
|
|
35
|
+
(v) => `my_${v}`,
|
|
36
|
+
null,
|
|
37
|
+
[Body, Button, Card, Title, TextInput, Flex, Link, Badge]
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
// Test marginTop prop
|
|
41
|
+
testGlobalProp(
|
|
42
|
+
'marginTop',
|
|
43
|
+
validValues,
|
|
44
|
+
(v) => `mt_${v}`,
|
|
45
|
+
null,
|
|
46
|
+
[Body, Button, Card, Title, TextInput, Flex, Link, Badge]
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
// Test marginBottom prop
|
|
50
|
+
testGlobalProp(
|
|
51
|
+
'marginBottom',
|
|
52
|
+
validValues,
|
|
53
|
+
(v) => `mb_${v}`,
|
|
54
|
+
null,
|
|
55
|
+
[Body, Button, Card, Title, TextInput, Flex, Link, Badge]
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
// Test marginLeft prop
|
|
59
|
+
testGlobalProp(
|
|
60
|
+
'marginLeft',
|
|
61
|
+
validValues,
|
|
62
|
+
(v) => `ml_${v}`,
|
|
63
|
+
null,
|
|
64
|
+
[Body, Button, Card, Title, TextInput, Flex, Link, Badge]
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
// Test marginRight prop
|
|
68
|
+
testGlobalProp(
|
|
69
|
+
'marginRight',
|
|
70
|
+
validValues,
|
|
71
|
+
(v) => `mr_${v}`,
|
|
72
|
+
null,
|
|
73
|
+
[Body, Button, Card, Title, TextInput, Flex, Link, Badge]
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
// Test absence for all margin props
|
|
77
|
+
const marginProps = ['margin', 'marginX', 'marginY', 'marginTop', 'marginBottom', 'marginLeft', 'marginRight']
|
|
78
|
+
marginProps.forEach((propName) => {
|
|
79
|
+
const prefix = propName === 'margin' ? 'm' : propName === 'marginX' ? 'mx' : propName === 'marginY' ? 'my' : propName === 'marginTop' ? 'mt' : propName === 'marginBottom' ? 'mb' : propName === 'marginLeft' ? 'ml' : 'mr'
|
|
80
|
+
testGlobalPropAbsence(
|
|
81
|
+
propName,
|
|
82
|
+
[`${prefix}_xs`, `${prefix}_sm`, `${prefix}_md`, `${prefix}_lg`, `${prefix}_xl`],
|
|
83
|
+
undefined,
|
|
84
|
+
{ skipNull: true }
|
|
85
|
+
)
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
// NOTE: Currently using skipKnownIssues: true because globalProps.ts generates classes for invalid values
|
|
89
|
+
testGlobalPropInvalidValues(
|
|
90
|
+
'margin',
|
|
91
|
+
['invalid', 'bad_value', 'not_a_size', 'special-chars!@#'],
|
|
92
|
+
['m_invalid', 'm_bad_value', 'm_not_a_size', 'm_special-chars!@#'],
|
|
93
|
+
undefined,
|
|
94
|
+
{ skipKnownIssues: true }
|
|
95
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { testGlobalProp, testGlobalPropAbsence, testGlobalPropInvalidValues } from './globalPropsTestHelper'
|
|
2
|
+
import Body from '../../../pb_body/_body'
|
|
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'
|
|
9
|
+
|
|
10
|
+
// NOTE: TextInput excluded - numberSpacing is not a valid prop for input elements
|
|
11
|
+
testGlobalProp(
|
|
12
|
+
'numberSpacing',
|
|
13
|
+
['tabular'],
|
|
14
|
+
(v) => `ns_${v}`,
|
|
15
|
+
null,
|
|
16
|
+
[Body, Button, Card, Title, Flex, Link, Badge]
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
testGlobalPropAbsence(
|
|
20
|
+
'numberSpacing',
|
|
21
|
+
['ns_tabular'],
|
|
22
|
+
undefined,
|
|
23
|
+
{ skipNull: true }
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
// NOTE: Currently using skipKnownIssues: true because globalProps.ts generates classes for invalid values
|
|
27
|
+
testGlobalPropInvalidValues(
|
|
28
|
+
'numberSpacing',
|
|
29
|
+
['invalid', 'bad_value', 'not_tabular', 'special-chars!@#'],
|
|
30
|
+
['ns_invalid', 'ns_bad_value', 'ns_not_tabular', 'ns_special-chars!@#'],
|
|
31
|
+
undefined,
|
|
32
|
+
{ skipKnownIssues: true }
|
|
33
|
+
)
|
|
@@ -1,53 +1,41 @@
|
|
|
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 TextInput from '../../../pb_text_input/_text_input'
|
|
7
|
+
import Flex from '../../../pb_flex/_flex'
|
|
8
|
+
import Link from '../../../pb_link/_link'
|
|
9
|
+
import Badge from '../../../pb_badge/_badge'
|
|
6
10
|
|
|
7
|
-
|
|
11
|
+
// Test numeric values (1-12)
|
|
12
|
+
testGlobalProp(
|
|
13
|
+
'order',
|
|
14
|
+
Array.from({ length: 12 }, (_, i) => i + 1),
|
|
15
|
+
(v) => `flex_order_${v}`,
|
|
16
|
+
(size, v) => `flex_order_${size}_${v}`,
|
|
17
|
+
[Body, Button, Card, Title, TextInput, Flex, Link, Badge]
|
|
18
|
+
)
|
|
8
19
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
order={`${x}`}
|
|
16
|
-
text="Hi"
|
|
17
|
-
/>
|
|
18
|
-
)
|
|
19
|
-
const kit = screen.getByTestId(testId)
|
|
20
|
-
expect(kit).toHaveClass(`flex_order_${x}`)
|
|
20
|
+
testGlobalPropResponsiveWithDefault(
|
|
21
|
+
'order',
|
|
22
|
+
{ default: 3, xs: 1, sm: 3, md: 1 },
|
|
23
|
+
(v) => `flex_order_${v}`,
|
|
24
|
+
(size, v) => `flex_order_${size}_${v}`
|
|
25
|
+
)
|
|
21
26
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
text="Hi"
|
|
29
|
-
/>
|
|
30
|
-
)
|
|
31
|
-
const kit = screen.getByTestId(testId)
|
|
32
|
-
expect(kit).toHaveClass(`flex_order_${size}_${x}`)
|
|
33
|
-
})
|
|
34
|
-
}
|
|
35
|
-
})
|
|
27
|
+
testGlobalPropAbsence(
|
|
28
|
+
'order',
|
|
29
|
+
['flex_order_1', 'flex_order_3', 'flex_order_12'],
|
|
30
|
+
undefined,
|
|
31
|
+
{ skipNull: true }
|
|
32
|
+
)
|
|
36
33
|
|
|
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_order_3`)
|
|
49
|
-
// Should have responsive classes for screen sizes
|
|
50
|
-
expect(kit).toHaveClass(`flex_order_xs_1`)
|
|
51
|
-
expect(kit).toHaveClass(`flex_order_sm_3`)
|
|
52
|
-
expect(kit).toHaveClass(`flex_order_md_1`)
|
|
53
|
-
})
|
|
34
|
+
// NOTE: Currently using skipKnownIssues: true because globalProps.ts generates classes for invalid values
|
|
35
|
+
testGlobalPropInvalidValues(
|
|
36
|
+
'order',
|
|
37
|
+
[0, 13, 999, -1, 'invalid', 'bad_value', 'special-chars!@#'],
|
|
38
|
+
['flex_order_0', 'flex_order_13', 'flex_order_999', 'flex_order_-1', 'flex_order_invalid', 'flex_order_bad_value', 'flex_order_special-chars!@#'],
|
|
39
|
+
undefined,
|
|
40
|
+
{ skipKnownIssues: true }
|
|
41
|
+
)
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { testGlobalProp, testGlobalPropAbsence, testGlobalPropInvalidValues } from './globalPropsTestHelper'
|
|
2
|
+
import Body from '../../../pb_body/_body'
|
|
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'
|
|
9
|
+
|
|
10
|
+
const validValues = ['scroll', 'visible', 'hidden', 'auto']
|
|
11
|
+
|
|
12
|
+
// NOTE: TextInput excluded - overflow properties are not valid props for input elements
|
|
13
|
+
// Test overflow prop
|
|
14
|
+
testGlobalProp(
|
|
15
|
+
'overflow',
|
|
16
|
+
validValues,
|
|
17
|
+
(v) => `overflow_${v}`,
|
|
18
|
+
null,
|
|
19
|
+
[Body, Button, Card, Title, Flex, Link, Badge]
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
testGlobalPropAbsence(
|
|
23
|
+
'overflow',
|
|
24
|
+
['overflow_scroll', 'overflow_visible', 'overflow_hidden', 'overflow_auto'],
|
|
25
|
+
undefined,
|
|
26
|
+
{ skipNull: true }
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
// Test overflowX prop
|
|
30
|
+
testGlobalProp(
|
|
31
|
+
'overflowX',
|
|
32
|
+
validValues,
|
|
33
|
+
(v) => `overflow_x_${v}`,
|
|
34
|
+
null,
|
|
35
|
+
[Body, Button, Card, Title, Flex, Link, Badge]
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
testGlobalPropAbsence(
|
|
39
|
+
'overflowX',
|
|
40
|
+
['overflow_x_scroll', 'overflow_x_visible', 'overflow_x_hidden', 'overflow_x_auto'],
|
|
41
|
+
undefined,
|
|
42
|
+
{ skipNull: true }
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
// Test overflowY prop
|
|
46
|
+
testGlobalProp(
|
|
47
|
+
'overflowY',
|
|
48
|
+
validValues,
|
|
49
|
+
(v) => `overflow_y_${v}`,
|
|
50
|
+
null,
|
|
51
|
+
[Body, Button, Card, Title, Flex, Link, Badge]
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
testGlobalPropAbsence(
|
|
55
|
+
'overflowY',
|
|
56
|
+
['overflow_y_scroll', 'overflow_y_visible', 'overflow_y_hidden', 'overflow_y_auto'],
|
|
57
|
+
undefined,
|
|
58
|
+
{ skipNull: true }
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
// NOTE: Currently using skipKnownIssues: true because globalProps.ts generates classes for invalid values
|
|
62
|
+
testGlobalPropInvalidValues(
|
|
63
|
+
'overflow',
|
|
64
|
+
['invalid', 'bad_value', 'not_an_overflow', 'special-chars!@#'],
|
|
65
|
+
['overflow_invalid', 'overflow_bad_value', 'overflow_not_an_overflow', 'overflow_special-chars!@#'],
|
|
66
|
+
undefined,
|
|
67
|
+
{ skipKnownIssues: true }
|
|
68
|
+
)
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { testGlobalProp, testGlobalPropAbsence, testGlobalPropInvalidValues } from './globalPropsTestHelper'
|
|
2
|
+
import Body from '../../../pb_body/_body'
|
|
3
|
+
import Button from '../../../pb_button/_button'
|
|
4
|
+
import Card from '../../../pb_card/_card'
|
|
5
|
+
import Title from '../../../pb_title/_title'
|
|
6
|
+
import TextInput from '../../../pb_text_input/_text_input'
|
|
7
|
+
import Flex from '../../../pb_flex/_flex'
|
|
8
|
+
import Link from '../../../pb_link/_link'
|
|
9
|
+
import Badge from '../../../pb_badge/_badge'
|
|
10
|
+
|
|
11
|
+
const validValues = ['none', 'xs', 'sm', 'md', 'lg', 'xl', 'auto', 'initial', 'inherit']
|
|
12
|
+
|
|
13
|
+
// Test padding prop
|
|
14
|
+
testGlobalProp(
|
|
15
|
+
'padding',
|
|
16
|
+
validValues,
|
|
17
|
+
(v) => `p_${v}`,
|
|
18
|
+
null,
|
|
19
|
+
[Body, Button, Card, Title, TextInput, Flex, Link, Badge]
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
// Test paddingX prop
|
|
23
|
+
testGlobalProp(
|
|
24
|
+
'paddingX',
|
|
25
|
+
validValues,
|
|
26
|
+
(v) => `px_${v}`,
|
|
27
|
+
null,
|
|
28
|
+
[Body, Button, Card, Title, TextInput, Flex, Link, Badge]
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
// Test paddingY prop
|
|
32
|
+
testGlobalProp(
|
|
33
|
+
'paddingY',
|
|
34
|
+
validValues,
|
|
35
|
+
(v) => `py_${v}`,
|
|
36
|
+
null,
|
|
37
|
+
[Body, Button, Card, Title, TextInput, Flex, Link, Badge]
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
// Test paddingTop prop
|
|
41
|
+
testGlobalProp(
|
|
42
|
+
'paddingTop',
|
|
43
|
+
validValues,
|
|
44
|
+
(v) => `pt_${v}`,
|
|
45
|
+
null,
|
|
46
|
+
[Body, Button, Card, Title, TextInput, Flex, Link, Badge]
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
// Test paddingBottom prop
|
|
50
|
+
testGlobalProp(
|
|
51
|
+
'paddingBottom',
|
|
52
|
+
validValues,
|
|
53
|
+
(v) => `pb_${v}`,
|
|
54
|
+
null,
|
|
55
|
+
[Body, Button, Card, Title, TextInput, Flex, Link, Badge]
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
// Test paddingLeft prop
|
|
59
|
+
testGlobalProp(
|
|
60
|
+
'paddingLeft',
|
|
61
|
+
validValues,
|
|
62
|
+
(v) => `pl_${v}`,
|
|
63
|
+
null,
|
|
64
|
+
[Body, Button, Card, Title, TextInput, Flex, Link, Badge]
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
// Test paddingRight prop
|
|
68
|
+
testGlobalProp(
|
|
69
|
+
'paddingRight',
|
|
70
|
+
validValues,
|
|
71
|
+
(v) => `pr_${v}`,
|
|
72
|
+
null,
|
|
73
|
+
[Body, Button, Card, Title, TextInput, Flex, Link, Badge]
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
// Test absence for all padding props
|
|
77
|
+
const paddingProps = ['padding', 'paddingX', 'paddingY', 'paddingTop', 'paddingBottom', 'paddingLeft', 'paddingRight']
|
|
78
|
+
paddingProps.forEach((propName) => {
|
|
79
|
+
const prefix = propName === 'padding' ? 'p' : propName === 'paddingX' ? 'px' : propName === 'paddingY' ? 'py' : propName === 'paddingTop' ? 'pt' : propName === 'paddingBottom' ? 'pb' : propName === 'paddingLeft' ? 'pl' : 'pr'
|
|
80
|
+
testGlobalPropAbsence(
|
|
81
|
+
propName,
|
|
82
|
+
[`${prefix}_xs`, `${prefix}_sm`, `${prefix}_md`, `${prefix}_lg`, `${prefix}_xl`],
|
|
83
|
+
undefined,
|
|
84
|
+
{ skipNull: true }
|
|
85
|
+
)
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
// NOTE: Currently using skipKnownIssues: true because globalProps.ts generates classes for invalid values
|
|
89
|
+
testGlobalPropInvalidValues(
|
|
90
|
+
'padding',
|
|
91
|
+
['invalid', 'bad_value', 'not_a_size', 'special-chars!@#'],
|
|
92
|
+
['p_invalid', 'p_bad_value', 'p_not_a_size', 'p_special-chars!@#'],
|
|
93
|
+
undefined,
|
|
94
|
+
{ skipKnownIssues: true }
|
|
95
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { testGlobalProp, testGlobalPropAbsence, testGlobalPropInvalidValues } from './globalPropsTestHelper'
|
|
2
|
+
import Body from '../../../pb_body/_body'
|
|
3
|
+
import Button from '../../../pb_button/_button'
|
|
4
|
+
import Card from '../../../pb_card/_card'
|
|
5
|
+
import Title from '../../../pb_title/_title'
|
|
6
|
+
import TextInput from '../../../pb_text_input/_text_input'
|
|
7
|
+
import Flex from '../../../pb_flex/_flex'
|
|
8
|
+
import Link from '../../../pb_link/_link'
|
|
9
|
+
import Badge from '../../../pb_badge/_badge'
|
|
10
|
+
|
|
11
|
+
testGlobalProp(
|
|
12
|
+
'position',
|
|
13
|
+
['relative', 'absolute', 'fixed', 'sticky'],
|
|
14
|
+
(v) => `position_${v}`,
|
|
15
|
+
null,
|
|
16
|
+
[Body, Button, Card, Title, TextInput, Flex, Link, Badge]
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
testGlobalPropAbsence(
|
|
20
|
+
'position',
|
|
21
|
+
['position_relative', 'position_absolute', 'position_fixed', 'position_sticky'],
|
|
22
|
+
undefined,
|
|
23
|
+
{ skipNull: true }
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
// NOTE: Currently using skipKnownIssues: true because globalProps.ts generates classes for invalid values
|
|
27
|
+
testGlobalPropInvalidValues(
|
|
28
|
+
'position',
|
|
29
|
+
['invalid', 'bad_value', 'not_a_position', 'static', 'special-chars!@#'],
|
|
30
|
+
['position_invalid', 'position_bad_value', 'position_not_a_position', 'position_static', 'position_special-chars!@#'],
|
|
31
|
+
undefined,
|
|
32
|
+
{ skipKnownIssues: true }
|
|
33
|
+
)
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { testGlobalProp, testGlobalPropAbsence, testGlobalPropInvalidValues } from './globalPropsTestHelper'
|
|
3
|
+
import { render, screen } from '../../test-utils'
|
|
4
|
+
import Body from '../../../pb_body/_body'
|
|
5
|
+
import Button from '../../../pb_button/_button'
|
|
6
|
+
import Card from '../../../pb_card/_card'
|
|
7
|
+
import Title from '../../../pb_title/_title'
|
|
8
|
+
import Flex from '../../../pb_flex/_flex'
|
|
9
|
+
import Link from '../../../pb_link/_link'
|
|
10
|
+
import Badge from '../../../pb_badge/_badge'
|
|
11
|
+
|
|
12
|
+
const validSizes = ['xs', 'sm', 'md', 'lg', 'xl']
|
|
13
|
+
|
|
14
|
+
// NOTE: TextInput excluded - positioning props are not valid for input elements
|
|
15
|
+
// Test right prop with string values
|
|
16
|
+
testGlobalProp(
|
|
17
|
+
'right',
|
|
18
|
+
validSizes,
|
|
19
|
+
(v) => `right_${v}`,
|
|
20
|
+
null,
|
|
21
|
+
[Body, Button, Card, Title, Flex, Link, Badge]
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
// Test right prop with object values (inset) - tested separately due to object value complexity
|
|
25
|
+
test('Global Props: right returns proper class name with object values (inset)', () => {
|
|
26
|
+
const testCases = [
|
|
27
|
+
{ value: { value: 'md', inset: true }, expected: 'right_md_inset' },
|
|
28
|
+
{ value: { value: 'lg', inset: false }, expected: 'right_lg' },
|
|
29
|
+
{ value: { value: 'sm', inset: true }, expected: 'right_sm_inset' }
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
testCases.forEach(({ value, expected }) => {
|
|
33
|
+
const testId = `body-right-object-${value.value}-${value.inset}`
|
|
34
|
+
render(
|
|
35
|
+
<Body
|
|
36
|
+
data={{ testid: testId }}
|
|
37
|
+
right={value}
|
|
38
|
+
text="Hi"
|
|
39
|
+
/>
|
|
40
|
+
)
|
|
41
|
+
const kit = screen.getByTestId(testId)
|
|
42
|
+
expect(kit).toHaveClass(expected)
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
testGlobalPropAbsence(
|
|
47
|
+
'right',
|
|
48
|
+
['right_xs', 'right_sm', 'right_md', 'right_lg', 'right_xl'],
|
|
49
|
+
undefined,
|
|
50
|
+
{ skipNull: true }
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
// NOTE: Currently using skipKnownIssues: true because globalProps.ts generates classes for invalid values
|
|
54
|
+
testGlobalPropInvalidValues(
|
|
55
|
+
'right',
|
|
56
|
+
['invalid', 'bad_value', 'not_a_size', 'special-chars!@#'],
|
|
57
|
+
['right_invalid', 'right_bad_value', 'right_not_a_size', 'right_special-chars!@#'],
|
|
58
|
+
undefined,
|
|
59
|
+
{ skipKnownIssues: true }
|
|
60
|
+
)
|