playbook_ui 16.1.0.pre.alpha.play264213818 → 16.1.0.pre.rc.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/pb_advanced_table/advanced_table.html.erb +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +0 -4
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_row_loading.md +2 -2
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +1 -51
- data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +0 -34
- data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +0 -19
- data/app/pb_kits/playbook/pb_background/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_background/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_light.html.erb +3 -35
- data/app/pb_kits/playbook/pb_form/docs/_form_with_required_indicator.html.erb +1 -3
- data/app/pb_kits/playbook/pb_icon/icon.rb +1 -6
- data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +33 -35
- data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +0 -1
- 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 +0 -1
- data/app/pb_kits/playbook/pb_multiple_users/multiple_users.html.erb +7 -51
- data/app/pb_kits/playbook/pb_multiple_users/multiple_users.rb +0 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +6 -33
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +0 -3
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/index.js +0 -2
- data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb +0 -5
- data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.test.js +18 -33
- data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +11 -29
- data/app/pb_kits/playbook/pb_textarea/docs/example.yml +1 -4
- data/app/pb_kits/playbook/pb_textarea/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_textarea/index.ts +5 -12
- data/app/pb_kits/playbook/pb_textarea/textarea.html.erb +10 -10
- data/app/pb_kits/playbook/pb_textarea/textarea.rb +0 -30
- data/app/pb_kits/playbook/pb_textarea/textarea.test.js +1 -18
- data/dist/chunks/{_pb_line_graph-BgKF_zz1.js → _pb_line_graph-hxi01lk7.js} +1 -1
- data/dist/chunks/{_typeahead-B9a6ZsEP.js → _typeahead-BgLnlhzP.js} +1 -1
- data/dist/chunks/{globalProps-BhVYCqRf.js → globalProps-DgYwLYNx.js} +1 -1
- data/dist/chunks/{lib-DD34ZrWL.js → lib-NLxTo8OB.js} +1 -1
- data/dist/chunks/vendor.js +2 -2
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/lib/playbook/align_content.rb +3 -13
- data/lib/playbook/align_items.rb +3 -13
- data/lib/playbook/align_self.rb +3 -13
- data/lib/playbook/display.rb +0 -5
- data/lib/playbook/flex.rb +3 -13
- data/lib/playbook/flex_direction.rb +3 -13
- data/lib/playbook/flex_grow.rb +3 -13
- data/lib/playbook/flex_shrink.rb +3 -13
- data/lib/playbook/flex_wrap.rb +3 -13
- data/lib/playbook/justify_content.rb +3 -13
- data/lib/playbook/justify_self.rb +3 -13
- data/lib/playbook/order.rb +3 -13
- data/lib/playbook/spacing.rb +9 -39
- data/lib/playbook/text_align.rb +3 -13
- data/lib/playbook/version.rb +2 -2
- data/lib/playbook/vertical_align.rb +3 -13
- data/lib/playbook/z_index.rb +0 -5
- metadata +6 -47
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_row_loading_rails.html.erb +0 -64
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_inline_row_loading_rails.md +0 -18
- data/app/pb_kits/playbook/pb_background/docs/_background_responsive.jsx +0 -30
- data/app/pb_kits/playbook/pb_background/docs/_background_responsive.md +0 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_input_display.html.erb +0 -74
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_input_display.jsx +0 -87
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_input_display.md +0 -3
- data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_with_tooltip.html.erb +0 -30
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_required_indicator.jsx +0 -35
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_required_indicator.md +0 -3
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_required_indicator.html.erb +0 -10
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_required_indicator.jsx +0 -21
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_required_indicator.md +0 -3
- data/app/pb_kits/playbook/pb_table/docs/_sections.yml +0 -68
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_input_options.html.erb +0 -39
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_input_options.md +0 -3
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_required_indicator.html.erb +0 -5
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_required_indicator.jsx +0 -25
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_required_indicator.md +0 -3
- data/app/pb_kits/playbook/utilities/test/globalProps/borderRadius.test.js +0 -33
- data/app/pb_kits/playbook/utilities/test/globalProps/bottom.test.js +0 -60
- data/app/pb_kits/playbook/utilities/test/globalProps/cursor.test.js +0 -42
- data/app/pb_kits/playbook/utilities/test/globalProps/dark.test.js +0 -33
- data/app/pb_kits/playbook/utilities/test/globalProps/gap.test.js +0 -87
- data/app/pb_kits/playbook/utilities/test/globalProps/globalProps.integration.test.js +0 -936
- data/app/pb_kits/playbook/utilities/test/globalProps/height.test.js +0 -68
- data/app/pb_kits/playbook/utilities/test/globalProps/htmlOptions.test.js +0 -510
- data/app/pb_kits/playbook/utilities/test/globalProps/left.test.js +0 -60
- data/app/pb_kits/playbook/utilities/test/globalProps/lineHeight.test.js +0 -33
- data/app/pb_kits/playbook/utilities/test/globalProps/margin.test.js +0 -95
- data/app/pb_kits/playbook/utilities/test/globalProps/numberSpacing.test.js +0 -33
- data/app/pb_kits/playbook/utilities/test/globalProps/overflow.test.js +0 -68
- data/app/pb_kits/playbook/utilities/test/globalProps/padding.test.js +0 -95
- data/app/pb_kits/playbook/utilities/test/globalProps/position.test.js +0 -33
- data/app/pb_kits/playbook/utilities/test/globalProps/right.test.js +0 -60
- data/app/pb_kits/playbook/utilities/test/globalProps/shadow.test.js +0 -33
- data/app/pb_kits/playbook/utilities/test/globalProps/textAlign.test.js +0 -41
- data/app/pb_kits/playbook/utilities/test/globalProps/top.test.js +0 -60
- data/app/pb_kits/playbook/utilities/test/globalProps/verticalAlign.test.js +0 -40
- data/app/pb_kits/playbook/utilities/test/globalProps/width.test.js +0 -66
- data/app/pb_kits/playbook/utilities/test/globalProps/zIndex.test.js +0 -50
data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_input_display.html.erb
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
<% treeData = [{
|
|
2
|
-
label: "Power Home Remodeling",
|
|
3
|
-
value: "powerHomeRemodeling",
|
|
4
|
-
id: "100",
|
|
5
|
-
expanded: true,
|
|
6
|
-
children: [
|
|
7
|
-
{
|
|
8
|
-
label: "People",
|
|
9
|
-
value: "people",
|
|
10
|
-
id: "101",
|
|
11
|
-
expanded: true,
|
|
12
|
-
children: [
|
|
13
|
-
{
|
|
14
|
-
label: "Talent Acquisition",
|
|
15
|
-
value: "talentAcquisition",
|
|
16
|
-
id: "102",
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
label: "Business Affairs",
|
|
20
|
-
value: "businessAffairs",
|
|
21
|
-
id: "103",
|
|
22
|
-
children: [
|
|
23
|
-
{
|
|
24
|
-
label: "Initiatives",
|
|
25
|
-
value: "initiatives",
|
|
26
|
-
id: "104",
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
label: "Learning & Development",
|
|
30
|
-
value: "learningAndDevelopment",
|
|
31
|
-
id: "105",
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
label: "People Experience",
|
|
37
|
-
value: "peopleExperience",
|
|
38
|
-
id: "106",
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
label: "Contact Center",
|
|
44
|
-
value: "contactCenter",
|
|
45
|
-
id: "107",
|
|
46
|
-
children: [
|
|
47
|
-
{
|
|
48
|
-
label: "Appointment Management",
|
|
49
|
-
value: "appointmentManagement",
|
|
50
|
-
id: "108",
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
label: "Customer Service",
|
|
54
|
-
value: "customerService",
|
|
55
|
-
id: "109",
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
label: "Energy",
|
|
59
|
-
value: "energy",
|
|
60
|
-
id: "110",
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
}] %>
|
|
66
|
-
|
|
67
|
-
<%= pb_rails("multi_level_select", props: {
|
|
68
|
-
id: "multi-level-select-input-display-none",
|
|
69
|
-
name: :foo,
|
|
70
|
-
tree_data: treeData,
|
|
71
|
-
input_display: "none",
|
|
72
|
-
return_all_selected: true,
|
|
73
|
-
})
|
|
74
|
-
%>
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import MultiLevelSelect from "../_multi_level_select";
|
|
3
|
-
|
|
4
|
-
const treeData = [
|
|
5
|
-
{
|
|
6
|
-
label: "Power Home Remodeling",
|
|
7
|
-
value: "powerHomeRemodeling",
|
|
8
|
-
id: "powerhome1",
|
|
9
|
-
expanded: true,
|
|
10
|
-
children: [
|
|
11
|
-
{
|
|
12
|
-
label: "People",
|
|
13
|
-
value: "people",
|
|
14
|
-
id: "people1",
|
|
15
|
-
expanded: true,
|
|
16
|
-
children: [
|
|
17
|
-
{
|
|
18
|
-
label: "Talent Acquisition",
|
|
19
|
-
value: "talentAcquisition",
|
|
20
|
-
id: "talent1",
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
label: "Business Affairs",
|
|
24
|
-
value: "businessAffairs",
|
|
25
|
-
id: "business1",
|
|
26
|
-
children: [
|
|
27
|
-
{
|
|
28
|
-
label: "Initiatives",
|
|
29
|
-
value: "initiatives",
|
|
30
|
-
id: "initiative1",
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
label: "Learning & Development",
|
|
34
|
-
value: "learningAndDevelopment",
|
|
35
|
-
id: "development1",
|
|
36
|
-
},
|
|
37
|
-
],
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
label: "People Experience",
|
|
41
|
-
value: "peopleExperience",
|
|
42
|
-
id: "experience1",
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
label: "Contact Center",
|
|
48
|
-
value: "contactCenter",
|
|
49
|
-
id: "contact1",
|
|
50
|
-
children: [
|
|
51
|
-
{
|
|
52
|
-
label: "Appointment Management",
|
|
53
|
-
value: "appointmentManagement",
|
|
54
|
-
id: "appointment1",
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
label: "Customer Service",
|
|
58
|
-
value: "customerService",
|
|
59
|
-
id: "customer1",
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
label: "Energy",
|
|
63
|
-
value: "energy",
|
|
64
|
-
id: "energy1",
|
|
65
|
-
},
|
|
66
|
-
],
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
},
|
|
70
|
-
];
|
|
71
|
-
|
|
72
|
-
const MultiLevelSelectInputDisplay = (props) => {
|
|
73
|
-
return (
|
|
74
|
-
<MultiLevelSelect
|
|
75
|
-
id="multi-level-select-input-display-none"
|
|
76
|
-
inputDisplay="none"
|
|
77
|
-
onSelect={(selectedNodes) =>
|
|
78
|
-
console.log("Selected Items", selectedNodes)
|
|
79
|
-
}
|
|
80
|
-
returnAllSelected
|
|
81
|
-
treeData={treeData}
|
|
82
|
-
{...props}
|
|
83
|
-
/>
|
|
84
|
-
);
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
export default MultiLevelSelectInputDisplay;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
Use the `inputDisplay`/`input_display` prop to optionally display only the count in the display as opposed to multiple pills. This prop is set to 'pills' by default.
|
|
2
|
-
|
|
3
|
-
**NOTE**: `inputDisplay`/`input_display` is particularly useful for larger trees that may return many pill selections, helping to keep the input field clean and compact. This prop should not be used with the Single Select variant.
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<%= pb_rails("multiple_users", props: {
|
|
2
|
-
with_tooltip: true,
|
|
3
|
-
users: [
|
|
4
|
-
{
|
|
5
|
-
name: "Patrick Welch",
|
|
6
|
-
image_url: "https://randomuser.me/api/portraits/men/9.jpg",
|
|
7
|
-
tooltip: "Patrick Welch - Online"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
name: "Lucille Sanchez",
|
|
11
|
-
image_url: "https://randomuser.me/api/portraits/women/6.jpg",
|
|
12
|
-
tooltip: "Lucille Sanchez - Offline"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: "Beverly Reyes",
|
|
16
|
-
image_url: "https://randomuser.me/api/portraits/women/74.jpg",
|
|
17
|
-
tooltip: "Beverly Reyes - Online"
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: "Keith Craig",
|
|
21
|
-
image_url: "https://randomuser.me/api/portraits/men/40.jpg",
|
|
22
|
-
tooltip: "Keith Craig - Away"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: "Alicia Cooper",
|
|
26
|
-
image_url: "https://randomuser.me/api/portraits/women/46.jpg",
|
|
27
|
-
tooltip: "Alicia Cooper - Busy"
|
|
28
|
-
}
|
|
29
|
-
]
|
|
30
|
-
}) %>
|
data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_required_indicator.jsx
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import RichTextEditor from '../../pb_rich_text_editor/_rich_text_editor'
|
|
3
|
-
import { useEditor, EditorContent } from "@tiptap/react"
|
|
4
|
-
import StarterKit from "@tiptap/starter-kit"
|
|
5
|
-
import Link from '@tiptap/extension-link'
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const RichTextEditorAdvancedRequiredIndicator = (props) => {
|
|
9
|
-
|
|
10
|
-
const editor = useEditor({
|
|
11
|
-
extensions: [
|
|
12
|
-
StarterKit,
|
|
13
|
-
Link
|
|
14
|
-
],
|
|
15
|
-
content:"Add your text here. You can format your text, add links, quotes, and bullets."
|
|
16
|
-
})
|
|
17
|
-
if (!editor) {
|
|
18
|
-
return null
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<div>
|
|
23
|
-
<RichTextEditor
|
|
24
|
-
advancedEditor={editor}
|
|
25
|
-
label="Label"
|
|
26
|
-
requiredIndicator
|
|
27
|
-
{...props}
|
|
28
|
-
>
|
|
29
|
-
<EditorContent editor={editor}/>
|
|
30
|
-
</RichTextEditor>
|
|
31
|
-
</div>
|
|
32
|
-
)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export default RichTextEditorAdvancedRequiredIndicator
|
data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_required_indicator.md
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
The `requiredIndicator`/`required_indicator` prop displays a red asterisk (*) next to the label, visually indicating that the field is required. This is purely visual and does not enforce validation.
|
|
2
|
-
|
|
3
|
-
You can use `requiredIndicator`/`required_indicator` with any validation approach: HTML5 validation via the `required` prop, client-side validation, or backend validation. For this reason, it works independently and doesn't need to be paired with the `required` prop.
|
data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_required_indicator.html.erb
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<%= pb_rails("rich_text_editor", props: {
|
|
2
|
-
id: "required-indicator",
|
|
3
|
-
input_options: {
|
|
4
|
-
id: 'hidden_input_id',
|
|
5
|
-
name: "hidden_input_name"
|
|
6
|
-
},
|
|
7
|
-
label: "Label",
|
|
8
|
-
required_indicator: true,
|
|
9
|
-
value: "Add your text here. You can format your text, add links, quotes, and bullets."
|
|
10
|
-
}) %>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
2
|
-
import RichTextEditor from '../../pb_rich_text_editor/_rich_text_editor'
|
|
3
|
-
|
|
4
|
-
const RichTextEditorRequiredIndicator = (props) => {
|
|
5
|
-
const [value, setValue] = useState('Add your text here. You can format your text, add links, quotes, and bullets.'),
|
|
6
|
-
handleOnChange = (html) => setValue(html)
|
|
7
|
-
|
|
8
|
-
return (
|
|
9
|
-
<div>
|
|
10
|
-
<RichTextEditor
|
|
11
|
-
label="Label"
|
|
12
|
-
onChange={handleOnChange}
|
|
13
|
-
requiredIndicator
|
|
14
|
-
value={value}
|
|
15
|
-
{...props}
|
|
16
|
-
/>
|
|
17
|
-
</div>
|
|
18
|
-
)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export default RichTextEditorRequiredIndicator
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
The `requiredIndicator`/`required_indicator` prop displays a red asterisk (*) next to the label, visually indicating that the field is required. This is purely visual and does not enforce validation.
|
|
2
|
-
|
|
3
|
-
You can use `requiredIndicator`/`required_indicator` with any validation approach: HTML5 validation via the `required` prop, client-side validation, or backend validation. For this reason, it works independently and doesn't need to be paired with the `required` prop.
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
sections:
|
|
2
|
-
- title: "Size & Density"
|
|
3
|
-
examples:
|
|
4
|
-
- table_sm
|
|
5
|
-
- table_md
|
|
6
|
-
- table_lg
|
|
7
|
-
- table_multiline
|
|
8
|
-
- table_single_line
|
|
9
|
-
- table_outer_padding
|
|
10
|
-
|
|
11
|
-
- title: "Layout & Structure"
|
|
12
|
-
examples:
|
|
13
|
-
- table_responsive_table
|
|
14
|
-
- table_with_subcomponents
|
|
15
|
-
- table_with_subcomponents_as_divs
|
|
16
|
-
- table_with_background_kit
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- title: "Sticky & Positional Behaviors"
|
|
20
|
-
examples:
|
|
21
|
-
- table_sticky
|
|
22
|
-
- table_sticky_left_columns
|
|
23
|
-
- table_sticky_right_columns
|
|
24
|
-
- table_sticky_columns
|
|
25
|
-
- table_alignment_row
|
|
26
|
-
- table_alignment_column
|
|
27
|
-
- table_alignment_shift_row
|
|
28
|
-
- table_alignment_shift_data
|
|
29
|
-
- table_side_highlight
|
|
30
|
-
- table_container
|
|
31
|
-
|
|
32
|
-
- title: "Collapsible & Nested Behaviors"
|
|
33
|
-
examples:
|
|
34
|
-
- table_with_collapsible
|
|
35
|
-
- table_with_dynamic_collapsible
|
|
36
|
-
- table_with_collapsible_with_custom_click
|
|
37
|
-
- table_with_collapsible_with_custom_content
|
|
38
|
-
- table_with_collapsible_with_nested_rows
|
|
39
|
-
- table_with_collapsible_with_nested_table
|
|
40
|
-
|
|
41
|
-
- title: "Data Presentation"
|
|
42
|
-
examples:
|
|
43
|
-
- table_data_table
|
|
44
|
-
- table_vertical_border
|
|
45
|
-
- table_striped
|
|
46
|
-
|
|
47
|
-
- title: "Header Variants"
|
|
48
|
-
examples:
|
|
49
|
-
- table_header
|
|
50
|
-
- table_with_header_style_borderless
|
|
51
|
-
- table_with_header_style_floating
|
|
52
|
-
|
|
53
|
-
- title: "Interactive Tables"
|
|
54
|
-
examples:
|
|
55
|
-
- table_with_clickable_rows
|
|
56
|
-
- table_with_selectable_rows
|
|
57
|
-
- table_with_filter_variant
|
|
58
|
-
- table_with_filter_variant_with_pagination
|
|
59
|
-
- table_disable_hover
|
|
60
|
-
|
|
61
|
-
- title: "Table Actions"
|
|
62
|
-
examples:
|
|
63
|
-
- table_one_action
|
|
64
|
-
- table_two_actions
|
|
65
|
-
- table_two_plus_actions
|
|
66
|
-
- table_action_middle
|
|
67
|
-
- table_icon_buttons
|
|
68
|
-
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<%= pb_rails("textarea", props: {
|
|
2
|
-
label: "ID on Container",
|
|
3
|
-
id: "container-id",
|
|
4
|
-
name: "comment",
|
|
5
|
-
rows: 4
|
|
6
|
-
}) %>
|
|
7
|
-
|
|
8
|
-
<br/>
|
|
9
|
-
|
|
10
|
-
<%= pb_rails("textarea", props: {
|
|
11
|
-
label: "ID on Textarea via input_options",
|
|
12
|
-
input_options: { id: "textarea-id" },
|
|
13
|
-
name: "comment",
|
|
14
|
-
rows: 4
|
|
15
|
-
}) %>
|
|
16
|
-
|
|
17
|
-
<br/>
|
|
18
|
-
|
|
19
|
-
<%= pb_rails("textarea", props: {
|
|
20
|
-
label: "Both Container and Textarea IDs",
|
|
21
|
-
id: "container-id-2",
|
|
22
|
-
input_options: { id: "textarea-id-2" },
|
|
23
|
-
name: "comment",
|
|
24
|
-
rows: 4
|
|
25
|
-
}) %>
|
|
26
|
-
|
|
27
|
-
<br/>
|
|
28
|
-
|
|
29
|
-
<%= pb_rails("textarea", props: {
|
|
30
|
-
label: "Data and ARIA Attributes",
|
|
31
|
-
name: "description",
|
|
32
|
-
rows: 4,
|
|
33
|
-
input_options: {
|
|
34
|
-
'aria-label': "Enter description",
|
|
35
|
-
'aria-describedby': "help-text",
|
|
36
|
-
data: { controller: "textarea", action: "focus->handleFocus" },
|
|
37
|
-
id: "description-textarea"
|
|
38
|
-
}
|
|
39
|
-
}) %>
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
Use the `input_options` / `inputOptions` prop to pass additional attributes directly to the underlying `<textarea>` element instead of the outer wrapper. This is useful for applying data attributes, custom IDs, ARIA attributes, or other HTML attributes that need to be on the textarea element itself.
|
|
2
|
-
|
|
3
|
-
Additional HTML attributes (e.g. data or ARIA attributes) can also be passed directly to the `<textarea>` via `input_options`.
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React, {useState} from 'react'
|
|
2
|
-
|
|
3
|
-
import Textarea from '../_textarea'
|
|
4
|
-
|
|
5
|
-
const TextareaRequiredIndicator = (props) => {
|
|
6
|
-
const [value, setValue] = useState('Default value text')
|
|
7
|
-
const handleChange = (event) => {
|
|
8
|
-
setValue(event.target.value)
|
|
9
|
-
}
|
|
10
|
-
return (
|
|
11
|
-
<div>
|
|
12
|
-
<Textarea
|
|
13
|
-
label="Label"
|
|
14
|
-
name="comment"
|
|
15
|
-
onChange={(e) => handleChange(e)}
|
|
16
|
-
placeholder="Placeholder text"
|
|
17
|
-
requiredIndicator
|
|
18
|
-
value={value}
|
|
19
|
-
{...props}
|
|
20
|
-
/>
|
|
21
|
-
</div>
|
|
22
|
-
)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default TextareaRequiredIndicator
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
The `requiredIndicator`/`required_indicator` prop displays a red asterisk (*) next to the label, visually indicating that the field is required. This is purely visual and does not enforce validation.
|
|
2
|
-
|
|
3
|
-
You can use `requiredIndicator`/`required_indicator` with any validation approach: HTML5 validation via the `required` prop, client-side validation, or backend validation. For this reason, it works independently and doesn't need to be paired with the `required` prop.
|
|
@@ -1,33 +0,0 @@
|
|
|
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
|
-
)
|
|
@@ -1,60 +0,0 @@
|
|
|
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
|
-
)
|
|
@@ -1,42 +0,0 @@
|
|
|
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
|
-
)
|
|
@@ -1,33 +0,0 @@
|
|
|
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
|
-
)
|