playbook_ui 16.1.0.pre.rc.0 → 16.1.0.pre.rc.2

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.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +2 -2
  3. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +4 -0
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_row_loading.md +2 -2
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_row_loading_rails.html.erb +64 -0
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_row_loading_rails.md +18 -0
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -0
  8. data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +51 -1
  9. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +1 -1
  10. data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +34 -0
  11. data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +1 -1
  12. data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +19 -0
  13. data/app/pb_kits/playbook/pb_icon/icon.rb +6 -1
  14. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.html.erb +30 -0
  15. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.jsx +1 -1
  16. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.md +1 -1
  17. data/app/pb_kits/playbook/pb_multiple_users/docs/example.yml +1 -0
  18. data/app/pb_kits/playbook/pb_multiple_users/multiple_users.html.erb +51 -7
  19. data/app/pb_kits/playbook/pb_multiple_users/multiple_users.rb +1 -0
  20. data/app/pb_kits/playbook/pb_table/docs/_sections.yml +68 -0
  21. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_input_options.html.erb +39 -0
  22. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_input_options.md +3 -0
  23. data/app/pb_kits/playbook/pb_textarea/docs/example.yml +1 -0
  24. data/app/pb_kits/playbook/pb_textarea/textarea.html.erb +4 -10
  25. data/app/pb_kits/playbook/pb_textarea/textarea.rb +28 -0
  26. data/app/pb_kits/playbook/utilities/test/globalProps/borderRadius.test.js +33 -0
  27. data/app/pb_kits/playbook/utilities/test/globalProps/bottom.test.js +60 -0
  28. data/app/pb_kits/playbook/utilities/test/globalProps/cursor.test.js +42 -0
  29. data/app/pb_kits/playbook/utilities/test/globalProps/dark.test.js +33 -0
  30. data/app/pb_kits/playbook/utilities/test/globalProps/gap.test.js +87 -0
  31. data/app/pb_kits/playbook/utilities/test/globalProps/height.test.js +68 -0
  32. data/app/pb_kits/playbook/utilities/test/globalProps/htmlOptions.test.js +510 -0
  33. data/app/pb_kits/playbook/utilities/test/globalProps/left.test.js +60 -0
  34. data/app/pb_kits/playbook/utilities/test/globalProps/lineHeight.test.js +33 -0
  35. data/app/pb_kits/playbook/utilities/test/globalProps/margin.test.js +95 -0
  36. data/app/pb_kits/playbook/utilities/test/globalProps/numberSpacing.test.js +33 -0
  37. data/app/pb_kits/playbook/utilities/test/globalProps/overflow.test.js +68 -0
  38. data/app/pb_kits/playbook/utilities/test/globalProps/padding.test.js +95 -0
  39. data/app/pb_kits/playbook/utilities/test/globalProps/position.test.js +33 -0
  40. data/app/pb_kits/playbook/utilities/test/globalProps/right.test.js +60 -0
  41. data/app/pb_kits/playbook/utilities/test/globalProps/shadow.test.js +33 -0
  42. data/app/pb_kits/playbook/utilities/test/globalProps/textAlign.test.js +41 -0
  43. data/app/pb_kits/playbook/utilities/test/globalProps/top.test.js +60 -0
  44. data/app/pb_kits/playbook/utilities/test/globalProps/verticalAlign.test.js +40 -0
  45. data/app/pb_kits/playbook/utilities/test/globalProps/width.test.js +66 -0
  46. data/app/pb_kits/playbook/utilities/test/globalProps/zIndex.test.js +50 -0
  47. data/lib/playbook/version.rb +1 -1
  48. metadata +29 -2
@@ -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 - borderRadius is not a valid prop for input elements
11
+ testGlobalProp(
12
+ 'borderRadius',
13
+ ['none', 'xs', 'sm', 'md', 'lg', 'xl', 'rounded'],
14
+ (v) => `border_radius_${v}`,
15
+ null,
16
+ [Body, Button, Card, Title, Flex, Link, Badge]
17
+ )
18
+
19
+ testGlobalPropAbsence(
20
+ 'borderRadius',
21
+ ['border_radius_none', 'border_radius_xs', 'border_radius_sm', 'border_radius_md', 'border_radius_lg', 'border_radius_xl', 'border_radius_rounded'],
22
+ undefined,
23
+ { skipNull: true }
24
+ )
25
+
26
+ // NOTE: Currently using skipKnownIssues: true because globalProps.ts generates classes for invalid values
27
+ testGlobalPropInvalidValues(
28
+ 'borderRadius',
29
+ ['invalid', 'bad_value', 'not_a_radius', 'special-chars!@#'],
30
+ ['border_radius_invalid', 'border_radius_bad_value', 'border_radius_not_a_radius', 'border_radius_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 bottom prop with string values
16
+ testGlobalProp(
17
+ 'bottom',
18
+ validSizes,
19
+ (v) => `bottom_${v}`,
20
+ null,
21
+ [Body, Button, Card, Title, Flex, Link, Badge]
22
+ )
23
+
24
+ // Test bottom prop with object values (inset) - tested separately due to object value complexity
25
+ test('Global Props: bottom returns proper class name with object values (inset)', () => {
26
+ const testCases = [
27
+ { value: { value: 'md', inset: true }, expected: 'bottom_md_inset' },
28
+ { value: { value: 'lg', inset: false }, expected: 'bottom_lg' },
29
+ { value: { value: 'sm', inset: true }, expected: 'bottom_sm_inset' }
30
+ ]
31
+
32
+ testCases.forEach(({ value, expected }) => {
33
+ const testId = `body-bottom-object-${value.value}-${value.inset}`
34
+ render(
35
+ <Body
36
+ bottom={value}
37
+ data={{ testid: testId }}
38
+ text="Hi"
39
+ />
40
+ )
41
+ const kit = screen.getByTestId(testId)
42
+ expect(kit).toHaveClass(expected)
43
+ })
44
+ })
45
+
46
+ testGlobalPropAbsence(
47
+ 'bottom',
48
+ ['bottom_xs', 'bottom_sm', 'bottom_md', 'bottom_lg', 'bottom_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
+ 'bottom',
56
+ ['invalid', 'bad_value', 'not_a_size', 'special-chars!@#'],
57
+ ['bottom_invalid', 'bottom_bad_value', 'bottom_not_a_size', 'bottom_special-chars!@#'],
58
+ undefined,
59
+ { skipKnownIssues: true }
60
+ )
@@ -0,0 +1,42 @@
1
+ import { testGlobalProp, testGlobalPropAbsence, testGlobalPropInvalidValues } from './globalPropsTestHelper'
2
+ import { camelToSnakeCase } from '../../../utilities/text'
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 TextInput from '../../../pb_text_input/_text_input'
8
+ import Flex from '../../../pb_flex/_flex'
9
+ import Link from '../../../pb_link/_link'
10
+ import Badge from '../../../pb_badge/_badge'
11
+
12
+ const validValues = [
13
+ 'auto', 'default', 'none', 'contextMenu', 'help', 'pointer', 'progress', 'wait', 'cell',
14
+ 'crosshair', 'text', 'verticalText', 'alias', 'copy', 'move', 'noDrop', 'notAllowed', 'grab',
15
+ 'grabbing', 'eResize', 'nResize', 'neResize', 'nwResize', 'sResize', 'seResize', 'swResize', 'wResize',
16
+ 'ewResize', 'nsResize', 'neswResize', 'nwseResize', 'colResize', 'rowResize', 'allScroll', 'zoomIn', 'zoomOut'
17
+ ]
18
+
19
+ testGlobalProp(
20
+ 'cursor',
21
+ validValues,
22
+ (v) => `cursor_${camelToSnakeCase(v)}`,
23
+ null,
24
+ [Body, Button, Card, Title, TextInput, Flex, Link, Badge]
25
+ )
26
+
27
+ testGlobalPropAbsence(
28
+ 'cursor',
29
+ ['cursor_auto', 'cursor_pointer', 'cursor_default', 'cursor_none'],
30
+ undefined,
31
+ { skipNull: true }
32
+ )
33
+
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
+ 'cursor',
38
+ ['invalid', 'bad_value', 'not_a_cursor', 'special-chars!@#'],
39
+ ['cursor_invalid', 'cursor_bad_value', 'cursor_not_a_cursor', 'cursor_special-chars!@#'],
40
+ undefined,
41
+ { skipKnownIssues: true, allowRenderingErrors: true }
42
+ )
@@ -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
+ 'dark',
13
+ [true],
14
+ () => 'dark',
15
+ null,
16
+ [Body, Button, Card, Title, TextInput, Flex, Link, Badge]
17
+ )
18
+
19
+ testGlobalPropAbsence(
20
+ 'dark',
21
+ ['dark'],
22
+ undefined,
23
+ { skipNull: true }
24
+ )
25
+
26
+ // NOTE: Currently using skipKnownIssues: true because globalProps.ts generates classes for invalid values
27
+ testGlobalPropInvalidValues(
28
+ 'dark',
29
+ ['invalid', 'bad_value', 123, 'true', 'false'],
30
+ ['dark_invalid', 'dark_bad_value', 'dark_123', 'dark_true', 'dark_false'],
31
+ undefined,
32
+ { skipKnownIssues: true }
33
+ )
@@ -0,0 +1,87 @@
1
+ import { testGlobalProp, testGlobalPropResponsiveWithDefault, 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 - gap properties are not valid props for input elements
11
+ // Test gap prop
12
+ testGlobalProp(
13
+ 'gap',
14
+ ['xs', 'sm', 'md', 'lg', 'xl'],
15
+ (v) => `gap_${v}`,
16
+ (size, v) => `gap_${size}_${v}`,
17
+ [Body, Button, Card, Title, Flex, Link, Badge]
18
+ )
19
+
20
+ testGlobalPropResponsiveWithDefault(
21
+ 'gap',
22
+ { default: 'md', xs: 'xs', sm: 'md', md: 'lg' },
23
+ (v) => `gap_${v}`,
24
+ (size, v) => `gap_${size}_${v}`
25
+ )
26
+
27
+ testGlobalPropAbsence(
28
+ 'gap',
29
+ ['gap_xs', 'gap_sm', 'gap_md', 'gap_lg', 'gap_xl'],
30
+ undefined,
31
+ { skipNull: true }
32
+ )
33
+
34
+ // Test columnGap prop
35
+ testGlobalProp(
36
+ 'columnGap',
37
+ ['xs', 'sm', 'md', 'lg', 'xl'],
38
+ (v) => `column_gap_${v}`,
39
+ (size, v) => `column_gap_${size}_${v}`,
40
+ [Body, Button, Card, Title, Flex, Link, Badge]
41
+ )
42
+
43
+ testGlobalPropResponsiveWithDefault(
44
+ 'columnGap',
45
+ { default: 'md', xs: 'xs', sm: 'md', md: 'lg' },
46
+ (v) => `column_gap_${v}`,
47
+ (size, v) => `column_gap_${size}_${v}`
48
+ )
49
+
50
+ testGlobalPropAbsence(
51
+ 'columnGap',
52
+ ['column_gap_xs', 'column_gap_sm', 'column_gap_md', 'column_gap_lg', 'column_gap_xl'],
53
+ undefined,
54
+ { skipNull: true }
55
+ )
56
+
57
+ // Test rowGap prop
58
+ testGlobalProp(
59
+ 'rowGap',
60
+ ['xs', 'sm', 'md', 'lg', 'xl'],
61
+ (v) => `row_gap_${v}`,
62
+ (size, v) => `row_gap_${size}_${v}`,
63
+ [Body, Button, Card, Title, Flex, Link, Badge]
64
+ )
65
+
66
+ testGlobalPropResponsiveWithDefault(
67
+ 'rowGap',
68
+ { default: 'md', xs: 'xs', sm: 'md', md: 'lg' },
69
+ (v) => `row_gap_${v}`,
70
+ (size, v) => `row_gap_${size}_${v}`
71
+ )
72
+
73
+ testGlobalPropAbsence(
74
+ 'rowGap',
75
+ ['row_gap_xs', 'row_gap_sm', 'row_gap_md', 'row_gap_lg', 'row_gap_xl'],
76
+ undefined,
77
+ { skipNull: true }
78
+ )
79
+
80
+ // NOTE: Currently using skipKnownIssues: true because globalProps.ts generates classes for invalid values
81
+ testGlobalPropInvalidValues(
82
+ 'gap',
83
+ ['invalid', 'bad_value', 'not_a_size', 'special-chars!@#'],
84
+ ['gap_invalid', 'gap_bad_value', 'gap_not_a_size', 'gap_special-chars!@#'],
85
+ undefined,
86
+ { skipKnownIssues: true }
87
+ )
@@ -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 validHeightValues = ['auto', 'xs', 'sm', 'md', 'lg', 'xl', 'xxl', 'xxxl']
11
+
12
+ // NOTE: TextInput excluded - height properties are not valid props for input elements
13
+ // Test height prop
14
+ testGlobalProp(
15
+ 'height',
16
+ validHeightValues,
17
+ (v) => `height_${v}`,
18
+ null,
19
+ [Body, Button, Card, Title, Flex, Link, Badge]
20
+ )
21
+
22
+ testGlobalPropAbsence(
23
+ 'height',
24
+ ['height_auto', 'height_xs', 'height_sm', 'height_md', 'height_lg', 'height_xl', 'height_xxl', 'height_xxxl'],
25
+ undefined,
26
+ { skipNull: true }
27
+ )
28
+
29
+ // Test minHeight prop
30
+ testGlobalProp(
31
+ 'minHeight',
32
+ validHeightValues,
33
+ (v) => `min_height_${v}`,
34
+ null,
35
+ [Body, Button, Card, Title, Flex, Link, Badge]
36
+ )
37
+
38
+ testGlobalPropAbsence(
39
+ 'minHeight',
40
+ ['min_height_auto', 'min_height_xs', 'min_height_sm', 'min_height_md', 'min_height_lg', 'min_height_xl', 'min_height_xxl', 'min_height_xxxl'],
41
+ undefined,
42
+ { skipNull: true }
43
+ )
44
+
45
+ // Test maxHeight prop
46
+ testGlobalProp(
47
+ 'maxHeight',
48
+ validHeightValues,
49
+ (v) => `max_height_${v}`,
50
+ null,
51
+ [Body, Button, Card, Title, Flex, Link, Badge]
52
+ )
53
+
54
+ testGlobalPropAbsence(
55
+ 'maxHeight',
56
+ ['max_height_auto', 'max_height_xs', 'max_height_sm', 'max_height_md', 'max_height_lg', 'max_height_xl', 'max_height_xxl', 'max_height_xxxl'],
57
+ undefined,
58
+ { skipNull: true }
59
+ )
60
+
61
+ // NOTE: Currently using skipKnownIssues: true because globalProps.ts generates classes for invalid values
62
+ testGlobalPropInvalidValues(
63
+ 'height',
64
+ ['invalid', 'bad_value', 'not_a_height', 'special-chars!@#', '100px', '50%'],
65
+ ['height_invalid', 'height_bad_value', 'height_not_a_height', 'height_special-chars!@#', 'height_100px', 'height_50_percent'],
66
+ undefined,
67
+ { skipKnownIssues: true }
68
+ )