playbook_ui_docs 16.1.0.pre.alpha.play2724typeaheadindicator13970 → 16.1.0.pre.alpha.play2725datepickermlsrequiredindicator14215
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/docs/_advanced_table_column_styling_background_custom.jsx +71 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_custom.md +4 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default.md +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_required_indicator.html.erb +5 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_required_indicator.jsx +13 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_required_indicator.md +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.html.erb +1 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.html.erb +6 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.jsx +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.md +3 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_with_required_indicator.html.erb +143 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_label.html.erb +3 -3
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_label.jsx +4 -7
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_label.md +3 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_required_indicator.html.erb +72 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_required_indicator.jsx +87 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_required_indicator.md +3 -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 +18 -17
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_disabled_item.html.erb +24 -0
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_disabled_item.jsx +87 -0
- data/app/pb_kits/playbook/pb_nav/docs/example.yml +2 -6
- data/app/pb_kits/playbook/pb_nav/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_label.jsx +44 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_label.md +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_required_indicator.jsx +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_label.jsx +28 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_label.md +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_required_indicator.jsx +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_default.html.erb +3 -3
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_default.jsx +3 -0
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_default.md +1 -0
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_on_handler.jsx +5 -2
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_required_indicator.html.erb +6 -0
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_required_indicator.jsx +16 -0
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_required_indicator.md +3 -0
- data/app/pb_kits/playbook/pb_time_picker/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_time_picker/docs/index.js +1 -0
- metadata +22 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 82db3f5cc8f36ebfae9617b56a568257dd6c6928dfb057f97282ca5346775b50
|
|
4
|
+
data.tar.gz: 56d540cc063c5283cffb7cc3ce6bbc786af95d2ff0942bb7968e32b3b5014d11
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dd8b10d316ad351fc6b3032143a8190a605ff193eb7a0e3e0990c7a3980cbe0f9eaec345eb700294276bd6d8438cbbf2c6801538f31912b197b42adbe5df81ff
|
|
7
|
+
data.tar.gz: 1dc072ac7defc63add35888cd93f0fc36e4eb61aa39b4977621dab35793d85bf61be3723e899998779e45cf004cc3fc25385b811bf5a4d8bf631fa4ea1a0347c
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import AdvancedTable from '../_advanced_table'
|
|
3
|
+
import colors from '../../tokens/exports/_colors.module.scss'
|
|
4
|
+
import MOCK_DATA from "./advanced_table_mock_data.json"
|
|
5
|
+
import Flex from '../../pb_flex/_flex'
|
|
6
|
+
import Title from '../../pb_title/_title'
|
|
7
|
+
import Body from '../../pb_body/_body'
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
const AdvancedTableColumnStylingBackgroundCustom = (props) => {
|
|
11
|
+
const columnDefinitions = [
|
|
12
|
+
{
|
|
13
|
+
accessor: "year",
|
|
14
|
+
label: "Year",
|
|
15
|
+
cellAccessors: ["quarter", "month", "day"],
|
|
16
|
+
customRenderer: (row, value) => (
|
|
17
|
+
<Flex flexDirection="column">
|
|
18
|
+
<Title size={4}
|
|
19
|
+
text={value}
|
|
20
|
+
/>
|
|
21
|
+
<Body text="lorem ipsum" />
|
|
22
|
+
<Body text="lorem ipsum" />
|
|
23
|
+
</Flex>
|
|
24
|
+
),
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
accessor: "newEnrollments",
|
|
28
|
+
label: "New Enrollments",
|
|
29
|
+
columnStyling:{
|
|
30
|
+
cellBackgroundColor: (row) => row.original.newEnrollments > 15 ? colors.success_subtle : colors.error_subtle,
|
|
31
|
+
fontColor: (row) => row.original.newEnrollments > 15 ? colors.success : colors.error,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
accessor: "scheduledMeetings",
|
|
36
|
+
label: "Scheduled Meetings",
|
|
37
|
+
columnStyling:{
|
|
38
|
+
cellBackgroundColor: (row) => row.original.scheduledMeetings >= 15 ? colors.info_subtle : colors.warning_subtle
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
accessor: "attendanceRate",
|
|
43
|
+
label: "Attendance Rate",
|
|
44
|
+
columnStyling:{cellBackgroundColor: colors.info, headerBackgroundColor: colors.info, fontColor: colors.white, headerFontColor: colors.white},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
accessor: "completedClasses",
|
|
48
|
+
label: "Completed Classes",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
accessor: "classCompletionRate",
|
|
52
|
+
label: "Class Completion Rate",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
accessor: "graduatedStudents",
|
|
56
|
+
label: "Graduated Students",
|
|
57
|
+
},
|
|
58
|
+
]
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<div>
|
|
62
|
+
<AdvancedTable
|
|
63
|
+
columnDefinitions={columnDefinitions}
|
|
64
|
+
tableData={MOCK_DATA}
|
|
65
|
+
{...props}
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export default AdvancedTableColumnStylingBackgroundCustom
|
|
@@ -2,4 +2,4 @@ the `enableSorting` prop is a boolean prop set to false by default. If true, the
|
|
|
2
2
|
|
|
3
3
|
### sortIcon
|
|
4
4
|
|
|
5
|
-
An optional prop, `sortIcon` allows you to customize your icon sets by passing it an array of any comma-separated pair of icon values. The first icon value will replace the kit's default icon when sort direction is desc, and the second value will replace the default icon when sort direction is asc. `sortIcon` also allows you to pass it a single icon as a string, in which case the icon will not toggle with the sort state. Default for this prop is `["arrow-up-short
|
|
5
|
+
An optional prop, `sortIcon` allows you to customize your icon sets by passing it an array of any comma-separated pair of icon values. The first icon value will replace the kit's default icon when sort direction is desc, and the second value will replace the default icon when sort direction is asc. `sortIcon` also allows you to pass it a single icon as a string, in which case the icon will not toggle with the sort state. Default for this prop is `["arrow-up-wide-short", "arrow-down-short-wide"]`. All strings must be valid FA icons.
|
|
@@ -78,6 +78,7 @@ examples:
|
|
|
78
78
|
- advanced_table_column_styling: Column Styling
|
|
79
79
|
- advanced_table_column_styling_column_headers: Column Styling with Multiple Headers
|
|
80
80
|
- advanced_table_column_styling_background: Column Styling Background Color
|
|
81
|
+
- advanced_table_column_styling_background_custom: Column Styling Background Color (Custom)
|
|
81
82
|
- advanced_table_column_styling_background_multi: Column Styling Background Color with Multiple Headers
|
|
82
83
|
- advanced_table_padding_control: Padding Control using Column Styling
|
|
83
84
|
- advanced_table_column_border_color: Column Group Border Color
|
|
@@ -47,4 +47,5 @@ export { default as AdvancedTableSortPerColumnForMultiColumn } from './_advanced
|
|
|
47
47
|
export { default as AdvancedTablePaddingControl } from './_advanced_table_padding_control.jsx'
|
|
48
48
|
export { default as AdvancedTablePaddingControlPerRow } from './_advanced_table_padding_control_per_row.jsx'
|
|
49
49
|
export { default as AdvancedTableColumnStylingBackground } from './_advanced_table_column_styling_background.jsx'
|
|
50
|
-
export { default as AdvancedTableColumnStylingBackgroundMulti } from './_advanced_table_column_styling_background_multi.jsx'
|
|
50
|
+
export { default as AdvancedTableColumnStylingBackgroundMulti } from './_advanced_table_column_styling_background_multi.jsx'
|
|
51
|
+
export { default as AdvancedTableColumnStylingBackgroundCustom } from './_advanced_table_column_styling_background_custom.jsx'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
`pickerId`/`picker_id` is a **required prop** to instantiate the Date Picker. The presence of `pickerId`/`picker_id` in your Date Picker also associates the label with the input, providing the ability to focus the Date Picker by clicking the label.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import DatePicker from "../_date_picker"
|
|
3
|
+
|
|
4
|
+
const DatePickerRequiredIndicator = (props) => (
|
|
5
|
+
<DatePicker
|
|
6
|
+
label="Required Date Picker"
|
|
7
|
+
pickerId="date_picker_required_indicator"
|
|
8
|
+
requiredIndicator
|
|
9
|
+
{...props}
|
|
10
|
+
/>
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
export default DatePickerRequiredIndicator
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
The `requiredIndicator`/`required_indicator` prop displays a red asterisk (*) next to the label to visually indicate that the field is required. This is purely visual and does not enforce validation—you can pair it with HTML `required`, client-side validation, or server-side validation as needed.
|
|
@@ -31,6 +31,7 @@ examples:
|
|
|
31
31
|
- date_picker_time: Time Selection
|
|
32
32
|
- date_picker_positions: Custom Positions
|
|
33
33
|
- date_picker_positions_element: Custom Position (based on element)
|
|
34
|
+
- date_picker_required_indicator: Required Indicator
|
|
34
35
|
- date_picker_turbo_frames: Within Turbo Frames
|
|
35
36
|
|
|
36
37
|
react:
|
|
@@ -64,3 +65,4 @@ examples:
|
|
|
64
65
|
- date_picker_time: Time Selection
|
|
65
66
|
- date_picker_positions: Custom Positions
|
|
66
67
|
- date_picker_positions_element: Custom Position (based on element)
|
|
68
|
+
- date_picker_required_indicator: Required Indicator
|
|
@@ -27,4 +27,5 @@ export { default as DatePickerQuickPickCustom } from './_date_picker_quick_pick_
|
|
|
27
27
|
export { default as DatePickerQuickPickCustomOverride } from './_date_picker_quick_pick_custom_override'
|
|
28
28
|
export { default as DatePickerQuickPickDefaultDate } from './_date_picker_quick_pick_default_date'
|
|
29
29
|
export { default as DatePickerRangePattern } from './_date_picker_range_pattern'
|
|
30
|
-
export { default as DatePickerAndDropdownRange } from './_date_picker_and_dropdown_range.jsx'
|
|
30
|
+
export { default as DatePickerAndDropdownRange } from './_date_picker_and_dropdown_range.jsx'
|
|
31
|
+
export { default as DatePickerRequiredIndicator } from "./_date_picker_required_indicator.jsx";
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
const option = e.detail;
|
|
77
77
|
const dropdown = e.target;
|
|
78
78
|
|
|
79
|
-
const display = dropdown.querySelector("
|
|
79
|
+
const display = dropdown.querySelector("[data-dropdown-trigger-custom-display]");
|
|
80
80
|
if (!display) return;
|
|
81
81
|
|
|
82
82
|
const nameEl = display.querySelector("#dropdown-avatar-name");
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
<%
|
|
1
|
+
<%
|
|
2
2
|
options = [
|
|
3
3
|
{ label: 'United States', value: 'unitedStates', id: 'us' },
|
|
4
4
|
{ label: 'Canada', value: 'canada', id: 'ca' },
|
|
5
5
|
{ label: 'Pakistan', value: 'pakistan', id: 'pk' },
|
|
6
6
|
]
|
|
7
|
-
|
|
8
7
|
%>
|
|
9
8
|
|
|
10
|
-
<%= pb_rails("dropdown", props: {
|
|
9
|
+
<%= pb_rails("dropdown", props: {
|
|
10
|
+
id: "select_a_country",
|
|
11
|
+
label: "Select a Country",
|
|
12
|
+
options: options
|
|
13
|
+
}) %>
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
The top-level Dropdown component optionally accepts any string through a `label` prop to produce a label above your trigger element.
|
|
1
|
+
The top-level Dropdown component optionally accepts any string through a `label` prop to produce a label above your trigger element.
|
|
2
|
+
|
|
3
|
+
Add an `id` to wire the label to the trigger so that clicking the label will move focus directly to the input, and open the drop-down.
|
|
@@ -1,3 +1,128 @@
|
|
|
1
|
+
<% tree_data = [
|
|
2
|
+
{
|
|
3
|
+
label: "HQ",
|
|
4
|
+
value: "hQ",
|
|
5
|
+
id: "hq",
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
label: "Philadelphia",
|
|
9
|
+
value: "philadelphia",
|
|
10
|
+
id: "phl",
|
|
11
|
+
children: [
|
|
12
|
+
{
|
|
13
|
+
label: "Marketing & Sales PHL",
|
|
14
|
+
value: "marketingAndSalesPhl",
|
|
15
|
+
id: "marketingPHL",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
label: "Installation Office PHL",
|
|
19
|
+
value: "installationOfficePhl",
|
|
20
|
+
id: "installationPHL",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
label: "Warehouse PHL",
|
|
24
|
+
value: "warehousePhl",
|
|
25
|
+
id: "warehousePHL",
|
|
26
|
+
},
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
label: "New Jersey",
|
|
31
|
+
value: "newJersey",
|
|
32
|
+
id: "nj",
|
|
33
|
+
children: [
|
|
34
|
+
{
|
|
35
|
+
label: "New Jersey",
|
|
36
|
+
value: "newJersey",
|
|
37
|
+
id: "nj1",
|
|
38
|
+
children: [
|
|
39
|
+
{
|
|
40
|
+
label: "Marketing & Sales NJ",
|
|
41
|
+
value: "marketingAndSalesNj",
|
|
42
|
+
id: "marketingNJ",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
label: "Installation Office NJ",
|
|
46
|
+
value: "installationOfficeNj",
|
|
47
|
+
id: "installationNJ",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
label: "Warehouse NJ",
|
|
51
|
+
value: "warehouseNj",
|
|
52
|
+
id: "warehouseNJ",
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
label: "Princeton",
|
|
58
|
+
value: "princeton",
|
|
59
|
+
id: "princeton",
|
|
60
|
+
children: [
|
|
61
|
+
{
|
|
62
|
+
label: "Marketing & Sales Princeton",
|
|
63
|
+
value: "marketingAndSalesPrinceton",
|
|
64
|
+
id: "marketingPR",
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
label: "Installation Office Princeton",
|
|
68
|
+
value: "installationOfficePrinceton",
|
|
69
|
+
id: "installationPR",
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
label: "Warehouse Princeton",
|
|
73
|
+
value: "warehousePrinceton",
|
|
74
|
+
id: "warehousePR",
|
|
75
|
+
},
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
label: "Maryland",
|
|
82
|
+
value: "maryland",
|
|
83
|
+
id: "MD",
|
|
84
|
+
children: [
|
|
85
|
+
{
|
|
86
|
+
label: "Marketing & Sales MD",
|
|
87
|
+
value: "marketingAndSalesMd",
|
|
88
|
+
id: "marketingMD",
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
label: "Installation Office MD",
|
|
92
|
+
value: "installationOfficeMd",
|
|
93
|
+
id: "installationMD",
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
label: "Warehouse MD",
|
|
97
|
+
value: "warehouseMd",
|
|
98
|
+
id: "warehouseMD",
|
|
99
|
+
},
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
label: "Connecticut",
|
|
104
|
+
value: "connecticut",
|
|
105
|
+
id: "CT",
|
|
106
|
+
children: [
|
|
107
|
+
{
|
|
108
|
+
label: "Marketing & Sales CT",
|
|
109
|
+
value: "marketingAndSalesCt",
|
|
110
|
+
id: "marketingCT",
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
label: "Installation Office CT",
|
|
114
|
+
value: "installationOfficeCt",
|
|
115
|
+
id: "installationCT",
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
label: "Warehouse CT",
|
|
119
|
+
value: "warehouseCt",
|
|
120
|
+
id: "warehouseCT",
|
|
121
|
+
},
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
]; %>
|
|
125
|
+
|
|
1
126
|
<%= pb_form_with(scope: :example, url: "", method: :get, validate: true) do |form| %>
|
|
2
127
|
<%= form.typeahead :example_typeahead_field, props: { label: true, required: true, required_indicator: true } %>
|
|
3
128
|
<%= form.text_field :example_text_field, props: { label: true, required: true, required_indicator: true } %>
|
|
@@ -10,7 +135,24 @@
|
|
|
10
135
|
<%= form.url_field :example_url_field, props: { label: true, required: true, required_indicator: true } %>
|
|
11
136
|
<%= form.text_area :example_text_area, props: { label: true, required: true, required_indicator: true } %>
|
|
12
137
|
<%= form.text_area :example_text_area_2, props: { label: "Textarea Custom Label", required: true, required_indicator: true } %>
|
|
13
|
-
<%#
|
|
138
|
+
<%# form.check_box :example_checkbox, props: { label: true, text: "Checkbox Label", required: true, required_indicator: true } %>
|
|
139
|
+
<%= form.time_picker :example_time_picker_required_indicator, props: { label: true, required: true, required_indicator: true } %>
|
|
140
|
+
<%= form.date_picker :example_date_picker_required_indicator, props: { label: true, required: true, required_indicator: true } %>
|
|
141
|
+
<%= form.date_picker :example_date_picker_required_indicator_custom, props: { label: "Custom Date Picker Label", required: true, required_indicator: true } %>
|
|
142
|
+
<%= form.multi_level_select :example_multi_level_select_required_indicator, props: {
|
|
143
|
+
label: true,
|
|
144
|
+
margin_y: 'sm',
|
|
145
|
+
required: true,
|
|
146
|
+
required_indicator: true,
|
|
147
|
+
tree_data: tree_data
|
|
148
|
+
} %>
|
|
149
|
+
<%= form.multi_level_select :example_multi_level_select_required_indicator_custom, props: {
|
|
150
|
+
label: "Custom Multi Level Select Label",
|
|
151
|
+
margin_y: 'sm',
|
|
152
|
+
required: true,
|
|
153
|
+
required_indicator: true,
|
|
154
|
+
tree_data: tree_data
|
|
155
|
+
} %>
|
|
14
156
|
|
|
15
157
|
<%= form.actions do |action| %>
|
|
16
158
|
<%= action.submit %>
|
|
@@ -73,14 +73,11 @@ const MultiLevelSelectDefault = (props) => {
|
|
|
73
73
|
return (
|
|
74
74
|
<div>
|
|
75
75
|
<MultiLevelSelect
|
|
76
|
-
id=
|
|
76
|
+
id="select_a_department"
|
|
77
77
|
label="Select a Department"
|
|
78
78
|
onSelect={(selectedNodes) =>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
selectedNodes
|
|
82
|
-
)
|
|
83
|
-
}
|
|
79
|
+
console.log("Selected Items", selectedNodes)
|
|
80
|
+
}
|
|
84
81
|
treeData={treeData}
|
|
85
82
|
{...props}
|
|
86
83
|
/>
|
|
@@ -88,4 +85,4 @@ const MultiLevelSelectDefault = (props) => {
|
|
|
88
85
|
)
|
|
89
86
|
};
|
|
90
87
|
|
|
91
|
-
export default MultiLevelSelectDefault;
|
|
88
|
+
export default MultiLevelSelectDefault;
|
data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_required_indicator.html.erb
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
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: "select_a_department",
|
|
69
|
+
label: "Select a Department",
|
|
70
|
+
required_indicator: true,
|
|
71
|
+
tree_data: treeData
|
|
72
|
+
}) %>
|
data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_required_indicator.jsx
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
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 MultiLevelSelectRequiredIndicator = (props) => {
|
|
73
|
+
return (
|
|
74
|
+
<div>
|
|
75
|
+
<MultiLevelSelect
|
|
76
|
+
id="select_a_department"
|
|
77
|
+
label="Select a Department"
|
|
78
|
+
onSelect={(selectedNodes) => console.log("Selected Items", selectedNodes)}
|
|
79
|
+
requiredIndicator
|
|
80
|
+
treeData={treeData}
|
|
81
|
+
{...props}
|
|
82
|
+
/>
|
|
83
|
+
</div>
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export default MultiLevelSelectRequiredIndicator
|
data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_required_indicator.md
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
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.
|
|
@@ -17,6 +17,7 @@ examples:
|
|
|
17
17
|
- multi_level_select_disabled_options_parent_default: Disabled Parent Option (Default)
|
|
18
18
|
- multi_level_select_disabled_options_parent: Disabled Parent Option (Return All Selected)
|
|
19
19
|
- multi_level_select_single_disabled: Disabled Options (Single Select)
|
|
20
|
+
- multi_level_select_required_indicator: Required Indicator
|
|
20
21
|
|
|
21
22
|
react:
|
|
22
23
|
- multi_level_select_default: Default
|
|
@@ -37,3 +38,4 @@ examples:
|
|
|
37
38
|
- multi_level_select_disabled_options_parent_default: Disabled Parent Option (Default)
|
|
38
39
|
- multi_level_select_disabled_options_parent: Disabled Parent Option (Return All Selected)
|
|
39
40
|
- multi_level_select_single_disabled: Disabled Options (Single Select)
|
|
41
|
+
- multi_level_select_required_indicator: Required Indicator
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
export { default as MultiLevelSelectDefault } from
|
|
2
|
-
export { default as MultiLevelSelectSingle } from
|
|
3
|
-
export { default as MultiLevelSelectSingleChildrenOnly } from
|
|
4
|
-
export { default as MultiLevelSelectReturnAllSelected } from
|
|
1
|
+
export { default as MultiLevelSelectDefault } from "./_multi_level_select_default.jsx"
|
|
2
|
+
export { default as MultiLevelSelectSingle } from "./_multi_level_select_single.jsx"
|
|
3
|
+
export { default as MultiLevelSelectSingleChildrenOnly } from "./_multi_level_select_single_children_only.jsx"
|
|
4
|
+
export { default as MultiLevelSelectReturnAllSelected } from "./_multi_level_select_return_all_selected.jsx"
|
|
5
5
|
export { default as MultiLevelSelectSelectedIdsReact } from "./_multi_level_select_selected_ids_react.jsx"
|
|
6
|
-
export { default as MultiLevelSelectColor } from
|
|
7
|
-
export { default as MultiLevelSelectInputDisplay } from
|
|
8
|
-
export { default as MultiLevelSelectWithChildren } from
|
|
9
|
-
export { default as MultiLevelSelectWithChildrenWithRadios } from
|
|
10
|
-
export { default as MultiLevelSelectDisabled } from
|
|
11
|
-
export { default as MultiLevelSelectReactHook
|
|
12
|
-
export { default as MultiLevelSelectError } from
|
|
13
|
-
export { default as MultiLevelSelectDisabledOptions } from
|
|
14
|
-
export { default as MultiLevelSelectDisabledOptionsParent } from
|
|
15
|
-
export { default as MultiLevelSelectDisabledOptionsParentDefault } from
|
|
16
|
-
export { default as MultiLevelSelectDisabledOptionsDefault } from
|
|
17
|
-
export { default as MultiLevelSelectLabel } from
|
|
18
|
-
export { default as MultiLevelSelectSingleDisabled } from
|
|
6
|
+
export { default as MultiLevelSelectColor } from "./_multi_level_select_color.jsx"
|
|
7
|
+
export { default as MultiLevelSelectInputDisplay } from "./_multi_level_select_input_display.jsx"
|
|
8
|
+
export { default as MultiLevelSelectWithChildren } from "./_multi_level_select_with_children.jsx"
|
|
9
|
+
export { default as MultiLevelSelectWithChildrenWithRadios } from "./_multi_level_select_with_children_with_radios.jsx"
|
|
10
|
+
export { default as MultiLevelSelectDisabled } from "./_multi_level_select_disabled.jsx"
|
|
11
|
+
export { default as MultiLevelSelectReactHook } from "./_multi_level_select_react_hook.jsx"
|
|
12
|
+
export { default as MultiLevelSelectError } from "./_multi_level_select_error.jsx"
|
|
13
|
+
export { default as MultiLevelSelectDisabledOptions } from "./_multi_level_select_disabled_options.jsx"
|
|
14
|
+
export { default as MultiLevelSelectDisabledOptionsParent } from "./_multi_level_select_disabled_options_parent.jsx"
|
|
15
|
+
export { default as MultiLevelSelectDisabledOptionsParentDefault } from "./_multi_level_select_disabled_options_parent_default.jsx"
|
|
16
|
+
export { default as MultiLevelSelectDisabledOptionsDefault } from "./_multi_level_select_disabled_options_default.jsx"
|
|
17
|
+
export { default as MultiLevelSelectLabel } from "./_multi_level_select_label.jsx"
|
|
18
|
+
export { default as MultiLevelSelectSingleDisabled } from "./_multi_level_select_single_disabled.jsx"
|
|
19
|
+
export { default as MultiLevelSelectRequiredIndicator } from "./_multi_level_select_required_indicator.jsx"
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<%= pb_rails("nav", props: { variant: "bold" }) do %>
|
|
2
|
+
<%= pb_rails("nav/item", props: { text: "Overview", link: "#", collapsible: true, icon_left:"city", disabled: true }) do %>
|
|
3
|
+
<%= pb_rails("nav", props: { variant: "bold" }) do %>
|
|
4
|
+
<%= pb_rails("nav/item", props: { text: "City", link: "#" }) %>
|
|
5
|
+
<%= pb_rails("nav/item", props: { text: "People", link: "#" }) %>
|
|
6
|
+
<%= pb_rails("nav/item", props: { text: "Business", link: "#" }) %>
|
|
7
|
+
<% end %>
|
|
8
|
+
<% end %>
|
|
9
|
+
<%= pb_rails("nav/item", props: { text: "Albums", link: "#", active: true, collapsible: true, icon_left: "theater-masks" }) do %>
|
|
10
|
+
<%= pb_rails("nav", props: { variant: "bold" }) do %>
|
|
11
|
+
<%= pb_rails("nav/item", props: { text: "Entertainment", link: "#" }) %>
|
|
12
|
+
<%= pb_rails("nav/item", props: { text: "Food", link: "#" }) %>
|
|
13
|
+
<%= pb_rails("nav/item", props: { text: "Style", link: "#" }) %>
|
|
14
|
+
<% end %>
|
|
15
|
+
<% end %>
|
|
16
|
+
<%= pb_rails("nav/item", props: { text: "Similar Artists", link: "#", collapsible: true, icon_left: "city" }) do %>
|
|
17
|
+
<%= pb_rails("nav", props: { variant: "bold" }) do %>
|
|
18
|
+
<%= pb_rails("nav/item", props: { text: "City", link: "#", disabled: true }) %>
|
|
19
|
+
<%= pb_rails("nav/item", props: { text: "People", link: "#" }) %>
|
|
20
|
+
<%= pb_rails("nav/item", props: { text: "Business", link: "#" }) %>
|
|
21
|
+
<% end %>
|
|
22
|
+
<% end %>
|
|
23
|
+
<% end %>
|
|
24
|
+
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Nav from '../../pb_nav/_nav'
|
|
3
|
+
import NavItem from '../../pb_nav/_item'
|
|
4
|
+
|
|
5
|
+
const CollapsibleNavDisabledItem = (props) => {
|
|
6
|
+
return (
|
|
7
|
+
<Nav
|
|
8
|
+
variant="bold"
|
|
9
|
+
{...props}
|
|
10
|
+
>
|
|
11
|
+
<NavItem
|
|
12
|
+
collapsed={false}
|
|
13
|
+
collapsible
|
|
14
|
+
disabled
|
|
15
|
+
iconLeft="city"
|
|
16
|
+
link="#"
|
|
17
|
+
text="Overview"
|
|
18
|
+
{...props}
|
|
19
|
+
>
|
|
20
|
+
<NavItem
|
|
21
|
+
link="#"
|
|
22
|
+
text="City"
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
<NavItem
|
|
26
|
+
link="#"
|
|
27
|
+
text="People"
|
|
28
|
+
{...props}
|
|
29
|
+
/>
|
|
30
|
+
<NavItem
|
|
31
|
+
link="#"
|
|
32
|
+
text="Business"
|
|
33
|
+
{...props}
|
|
34
|
+
/>
|
|
35
|
+
</NavItem>
|
|
36
|
+
<NavItem
|
|
37
|
+
collapsible
|
|
38
|
+
iconLeft="theater-masks"
|
|
39
|
+
link="#"
|
|
40
|
+
text="Albums"
|
|
41
|
+
{...props}
|
|
42
|
+
>
|
|
43
|
+
<NavItem
|
|
44
|
+
disabled
|
|
45
|
+
link="#"
|
|
46
|
+
text="Entertainment"
|
|
47
|
+
{...props}
|
|
48
|
+
/>
|
|
49
|
+
<NavItem
|
|
50
|
+
link="#"
|
|
51
|
+
text="Food"
|
|
52
|
+
{...props}
|
|
53
|
+
/>
|
|
54
|
+
<NavItem
|
|
55
|
+
link="#"
|
|
56
|
+
text="Style"
|
|
57
|
+
{...props}
|
|
58
|
+
/>
|
|
59
|
+
</NavItem>
|
|
60
|
+
<NavItem
|
|
61
|
+
collapsible
|
|
62
|
+
iconLeft="city"
|
|
63
|
+
link="#"
|
|
64
|
+
text="Similar Artists"
|
|
65
|
+
{...props}
|
|
66
|
+
>
|
|
67
|
+
<NavItem
|
|
68
|
+
link="#"
|
|
69
|
+
text="City"
|
|
70
|
+
{...props}
|
|
71
|
+
/>
|
|
72
|
+
<NavItem
|
|
73
|
+
link="#"
|
|
74
|
+
text="People"
|
|
75
|
+
{...props}
|
|
76
|
+
/>
|
|
77
|
+
<NavItem
|
|
78
|
+
link="#"
|
|
79
|
+
text="Business"
|
|
80
|
+
{...props}
|
|
81
|
+
/>
|
|
82
|
+
</NavItem>
|
|
83
|
+
</Nav>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export default CollapsibleNavDisabledItem
|
|
@@ -14,6 +14,7 @@ examples:
|
|
|
14
14
|
- collapsible_nav: Collapsible Nav
|
|
15
15
|
- collapsible_nav_with_all_options: Collapsible Nav With Options
|
|
16
16
|
- collapsible_nav_no_icon: Collapsible Nav No Icon
|
|
17
|
+
- collapsible_nav_disabled_item: Collapsible Nav With Disabled Item
|
|
17
18
|
- horizontal_nav: Horizontal Nav
|
|
18
19
|
- subtle_horizontal_nav: Subtle Horizontal Nav
|
|
19
20
|
- bold_horizontal_nav: Bold Horizontal Nav
|
|
@@ -42,6 +43,7 @@ examples:
|
|
|
42
43
|
- collapsible_nav_item_spacing: Collapsible Nav With ItemSpacing
|
|
43
44
|
- collapsible_nav_custom: Collapsible Nav With Custom Toggling
|
|
44
45
|
- collapsible_nav_no_icon: Collapsible Nav No Icon
|
|
46
|
+
- collapsible_nav_disabled_item: Collapsible Nav With Disabled Item
|
|
45
47
|
- horizontal_nav: Horizontal Nav
|
|
46
48
|
- subtle_horizontal_nav: Subtle Horizontal Nav
|
|
47
49
|
- bold_horizontal_nav: Bold Horizontal Nav
|
|
@@ -62,9 +64,3 @@ examples:
|
|
|
62
64
|
- nav_horizontal_subtle_no_highlight_swift: Horizontal Subtle No Highlight
|
|
63
65
|
- nav_horizontal_bold_swift: Horizontal Bold
|
|
64
66
|
- nav_props_swift: ""
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
@@ -22,4 +22,5 @@ export { default as CollapsibleNavItemSpacing } from "./_collapsible_nav_item_sp
|
|
|
22
22
|
export { default as CollapsibleNavNoIcon } from "./_collapsible_nav_no_icon.jsx"
|
|
23
23
|
export { default as HorizontalNavExtendedunderline } from './_horizontal_nav_extendedunderline.jsx'
|
|
24
24
|
export { default as HorizontalNavDisabled } from './_horizontal_nav_disabled.jsx'
|
|
25
|
-
export { default as VerticalNavDisabled } from './_vertical_nav_disabled.jsx'
|
|
25
|
+
export { default as VerticalNavDisabled } from './_vertical_nav_disabled.jsx'
|
|
26
|
+
export { default as CollapsibleNavDisabledItem } from './_collapsible_nav_disabled_item.jsx'
|
|
@@ -0,0 +1,44 @@
|
|
|
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 RichTextEditorAdvancedLabel = (props) => {
|
|
9
|
+
|
|
10
|
+
const editor = useEditor({
|
|
11
|
+
extensions: [StarterKit, Link],
|
|
12
|
+
content: "Add your text here. You can format your text, add links, quotes, and bullets.",
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
const editorNoLabel = useEditor({
|
|
16
|
+
extensions: [StarterKit, Link],
|
|
17
|
+
content: "Add your text here. You can format your text, add links, quotes, and bullets.",
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
if (!editor || !editorNoLabel) return null
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<div>
|
|
24
|
+
<RichTextEditor
|
|
25
|
+
advancedEditor={editor}
|
|
26
|
+
id={"advanced-example"}
|
|
27
|
+
label="Advanced Example Label"
|
|
28
|
+
{...props}
|
|
29
|
+
>
|
|
30
|
+
<EditorContent editor={editor}/>
|
|
31
|
+
</RichTextEditor>
|
|
32
|
+
<br/>
|
|
33
|
+
<RichTextEditor
|
|
34
|
+
advancedEditor={editorNoLabel}
|
|
35
|
+
label="Advanced Example Label No ID"
|
|
36
|
+
{...props}
|
|
37
|
+
>
|
|
38
|
+
<EditorContent editor={editorNoLabel}/>
|
|
39
|
+
</RichTextEditor>
|
|
40
|
+
</div>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default RichTextEditorAdvancedLabel
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
The optional `label` prop adds a visible label to the advanced editor. Passing in the `id` prop associates the `label` with the editor for accessibility, enabling screen reader support and label-based focus behavior.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import RichTextEditor from '../../pb_rich_text_editor/_rich_text_editor'
|
|
3
|
+
|
|
4
|
+
const RichTextEditorLabel = (props) => {
|
|
5
|
+
const [value, setValue] = useState(''),
|
|
6
|
+
handleOnChange = (html) => setValue(html)
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<div>
|
|
10
|
+
<RichTextEditor
|
|
11
|
+
id="example"
|
|
12
|
+
label="Example Label"
|
|
13
|
+
onChange={handleOnChange}
|
|
14
|
+
value={value}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
<br/>
|
|
18
|
+
<RichTextEditor
|
|
19
|
+
label="Example Label No ID"
|
|
20
|
+
onChange={handleOnChange}
|
|
21
|
+
value={value}
|
|
22
|
+
{...props}
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default RichTextEditorLabel
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
The optional `label` prop adds a visible label to the editor. Passing in the `id` prop associates the `label` with the editor for accessibility, enabling screen reader support and label-based focus behavior.
|
|
@@ -32,6 +32,8 @@ examples:
|
|
|
32
32
|
- rich_text_editor_advanced_inline: Advanced (Inline)
|
|
33
33
|
- rich_text_editor_advanced_height: Advanced Height
|
|
34
34
|
- rich_text_editor_advanced_min_height: Advanced Min Height
|
|
35
|
+
- rich_text_editor_label: Label
|
|
36
|
+
- rich_text_editor_advanced_label: Advanced (Label)
|
|
35
37
|
- rich_text_editor_required_indicator: Required Indicator
|
|
36
38
|
- rich_text_editor_advanced_required_indicator: Advanced Required Indicator
|
|
37
39
|
- rich_text_editor_preview: Preview
|
|
@@ -21,3 +21,5 @@ export { default as RichTextEditorAdvancedHeight } from './_rich_text_editor_adv
|
|
|
21
21
|
export { default as RichTextEditorAdvancedMinHeight } from './_rich_text_editor_advanced_min_height.jsx'
|
|
22
22
|
export { default as RichTextEditorRequiredIndicator } from './_rich_text_editor_required_indicator.jsx'
|
|
23
23
|
export { default as RichTextEditorAdvancedRequiredIndicator } from './_rich_text_editor_advanced_required_indicator.jsx'
|
|
24
|
+
export { default as RichTextEditorLabel } from './_rich_text_editor_label.jsx'
|
|
25
|
+
export { default as RichTextEditorAdvancedLabel } from './_rich_text_editor_advanced_label.jsx'
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
<%= pb_rails("textarea", props: { label: "Label", rows: 4}) %>
|
|
1
|
+
<%= pb_rails("textarea", props: { label: "Label", rows: 4, id: "default-example-1" }) %>
|
|
2
2
|
|
|
3
3
|
<br/>
|
|
4
4
|
|
|
5
|
-
<%= pb_rails("textarea", props: { label: "Label", placeholder: "Placeholder text" }) %>
|
|
5
|
+
<%= pb_rails("textarea", props: { label: "Label", placeholder: "Placeholder text", id: "default-example-2" }) %>
|
|
6
6
|
|
|
7
7
|
<br/>
|
|
8
8
|
|
|
9
|
-
<%= pb_rails("textarea", props: { label: "Label", name: "comment", value: "Default value text" }) %>
|
|
9
|
+
<%= pb_rails("textarea", props: { label: "Label", name: "comment", value: "Default value text", id: "default-example-3" }) %>
|
|
@@ -13,6 +13,7 @@ const TextareaDefault = (props) => {
|
|
|
13
13
|
label="Label"
|
|
14
14
|
rows={4}
|
|
15
15
|
{...props}
|
|
16
|
+
id="default-example-1"
|
|
16
17
|
/>
|
|
17
18
|
|
|
18
19
|
<br />
|
|
@@ -21,6 +22,7 @@ const TextareaDefault = (props) => {
|
|
|
21
22
|
label="Label"
|
|
22
23
|
placeholder="Placeholder text"
|
|
23
24
|
{...props}
|
|
25
|
+
id="default-example-2"
|
|
24
26
|
/>
|
|
25
27
|
|
|
26
28
|
<br />
|
|
@@ -32,6 +34,7 @@ const TextareaDefault = (props) => {
|
|
|
32
34
|
placeholder="Placeholder text"
|
|
33
35
|
value={value}
|
|
34
36
|
{...props}
|
|
37
|
+
id="default-example-3"
|
|
35
38
|
/>
|
|
36
39
|
|
|
37
40
|
</div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Add an `id` to your Textarea so that clicking the label will move focus directly to the input.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
2
|
import TimePicker from '../../pb_time_picker/_time_picker'
|
|
3
3
|
import Body from '../../pb_body/_body'
|
|
4
|
+
import Flex from '../../pb_flex/_flex'
|
|
4
5
|
|
|
5
6
|
const TimePickerOnHandler = (props) => {
|
|
6
7
|
const [selectedTime, setSelectedTime] = useState('')
|
|
@@ -17,7 +18,9 @@ const TimePickerOnHandler = (props) => {
|
|
|
17
18
|
return (
|
|
18
19
|
<div>
|
|
19
20
|
{(selectedTime || closedTime) && (
|
|
20
|
-
<
|
|
21
|
+
<Flex marginBottom="sm"
|
|
22
|
+
orientation="column"
|
|
23
|
+
>
|
|
21
24
|
{selectedTime && (
|
|
22
25
|
<Body
|
|
23
26
|
text={`onChange: ${selectedTime}`}
|
|
@@ -29,7 +32,7 @@ const TimePickerOnHandler = (props) => {
|
|
|
29
32
|
text={`onClose: ${closedTime}`}
|
|
30
33
|
/>
|
|
31
34
|
)}
|
|
32
|
-
</
|
|
35
|
+
</Flex>
|
|
33
36
|
)}
|
|
34
37
|
<TimePicker
|
|
35
38
|
id="time-picker-on-handler"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import TimePicker from '../_time_picker'
|
|
3
|
+
|
|
4
|
+
const TimePickerRequiredIndicator = (props) => (
|
|
5
|
+
<div>
|
|
6
|
+
<TimePicker
|
|
7
|
+
id="time-picker-required-indicator"
|
|
8
|
+
label="Select Time"
|
|
9
|
+
requiredIndicator
|
|
10
|
+
{...props}
|
|
11
|
+
/>
|
|
12
|
+
</div>
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
export default TimePickerRequiredIndicator
|
|
16
|
+
|
|
@@ -0,0 +1,3 @@
|
|
|
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.
|
|
@@ -9,6 +9,7 @@ examples:
|
|
|
9
9
|
- time_picker_min_max_time: Min & Max Time
|
|
10
10
|
- time_picker_error: Error
|
|
11
11
|
- time_picker_disabled: Disabled
|
|
12
|
+
- time_picker_required_indicator: Required Indicator
|
|
12
13
|
- time_picker_input_options: Input Options
|
|
13
14
|
|
|
14
15
|
|
|
@@ -21,4 +22,5 @@ examples:
|
|
|
21
22
|
- time_picker_min_max_time: Min & Max Time
|
|
22
23
|
- time_picker_error: Error
|
|
23
24
|
- time_picker_disabled: Disabled
|
|
25
|
+
- time_picker_required_indicator: Required Indicator
|
|
24
26
|
- time_picker_on_handler: onChange & onClose Handlers
|
|
@@ -7,3 +7,4 @@ export { default as TimePickerOnHandler } from './_time_picker_on_handler.jsx'
|
|
|
7
7
|
export { default as TimePickerMinMaxTime } from './_time_picker_min_max_time.jsx'
|
|
8
8
|
export { default as TimePickerError } from './_time_picker_error.jsx'
|
|
9
9
|
export { default as TimePickerDisabled } from './_time_picker_disabled.jsx'
|
|
10
|
+
export { default as TimePickerRequiredIndicator } from './_time_picker_required_indicator.jsx'
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: playbook_ui_docs
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 16.1.0.pre.alpha.
|
|
4
|
+
version: 16.1.0.pre.alpha.play2725datepickermlsrequiredindicator14215
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Power UX
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2026-
|
|
12
|
+
date: 2026-02-05 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: playbook_ui
|
|
@@ -64,6 +64,8 @@ files:
|
|
|
64
64
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling.md
|
|
65
65
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background.jsx
|
|
66
66
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background.md
|
|
67
|
+
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_custom.jsx
|
|
68
|
+
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_custom.md
|
|
67
69
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_multi.jsx
|
|
68
70
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_multi.md
|
|
69
71
|
- app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_column_headers.jsx
|
|
@@ -579,6 +581,7 @@ files:
|
|
|
579
581
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_anti_patterns.html.erb
|
|
580
582
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default.html.erb
|
|
581
583
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default.jsx
|
|
584
|
+
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default.md
|
|
582
585
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.html.erb
|
|
583
586
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.jsx
|
|
584
587
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.md
|
|
@@ -645,6 +648,9 @@ files:
|
|
|
645
648
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern.md
|
|
646
649
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.html.erb
|
|
647
650
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.md
|
|
651
|
+
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_required_indicator.html.erb
|
|
652
|
+
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_required_indicator.jsx
|
|
653
|
+
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_required_indicator.md
|
|
648
654
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_time.html.erb
|
|
649
655
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_time.jsx
|
|
650
656
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_time.md
|
|
@@ -1431,8 +1437,12 @@ files:
|
|
|
1431
1437
|
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_input_display.md
|
|
1432
1438
|
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_label.html.erb
|
|
1433
1439
|
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_label.jsx
|
|
1440
|
+
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_label.md
|
|
1434
1441
|
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_react_hook.jsx
|
|
1435
1442
|
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_react_hook.md
|
|
1443
|
+
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_required_indicator.html.erb
|
|
1444
|
+
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_required_indicator.jsx
|
|
1445
|
+
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_required_indicator.md
|
|
1436
1446
|
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_reset.html.erb
|
|
1437
1447
|
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_reset.md
|
|
1438
1448
|
- app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_return_all_selected.html.erb
|
|
@@ -1506,6 +1516,8 @@ files:
|
|
|
1506
1516
|
- app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.md
|
|
1507
1517
|
- app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_custom.jsx
|
|
1508
1518
|
- app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_custom.md
|
|
1519
|
+
- app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_disabled_item.html.erb
|
|
1520
|
+
- app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_disabled_item.jsx
|
|
1509
1521
|
- app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_item_spacing.jsx
|
|
1510
1522
|
- app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_item_spacing.md
|
|
1511
1523
|
- app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_no_icon.html.erb
|
|
@@ -1932,6 +1944,8 @@ files:
|
|
|
1932
1944
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_height.md
|
|
1933
1945
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_inline.jsx
|
|
1934
1946
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_inline.md
|
|
1947
|
+
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_label.jsx
|
|
1948
|
+
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_label.md
|
|
1935
1949
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_min_height.jsx
|
|
1936
1950
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_min_height.md
|
|
1937
1951
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_preview.jsx
|
|
@@ -1950,6 +1964,8 @@ files:
|
|
|
1950
1964
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_focus.jsx
|
|
1951
1965
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_inline.html.erb
|
|
1952
1966
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_inline.jsx
|
|
1967
|
+
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_label.jsx
|
|
1968
|
+
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_label.md
|
|
1953
1969
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_more_extensions.jsx
|
|
1954
1970
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_more_extensions.md
|
|
1955
1971
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.html.erb
|
|
@@ -2346,6 +2362,7 @@ files:
|
|
|
2346
2362
|
- app/pb_kits/playbook/pb_textarea/docs/_textarea_custom.jsx
|
|
2347
2363
|
- app/pb_kits/playbook/pb_textarea/docs/_textarea_default.html.erb
|
|
2348
2364
|
- app/pb_kits/playbook/pb_textarea/docs/_textarea_default.jsx
|
|
2365
|
+
- app/pb_kits/playbook/pb_textarea/docs/_textarea_default.md
|
|
2349
2366
|
- app/pb_kits/playbook/pb_textarea/docs/_textarea_default_swift.md
|
|
2350
2367
|
- app/pb_kits/playbook/pb_textarea/docs/_textarea_emoji_mask.html.erb
|
|
2351
2368
|
- app/pb_kits/playbook/pb_textarea/docs/_textarea_emoji_mask.jsx
|
|
@@ -2406,6 +2423,9 @@ files:
|
|
|
2406
2423
|
- app/pb_kits/playbook/pb_time_picker/docs/_time_picker_min_max_time.md
|
|
2407
2424
|
- app/pb_kits/playbook/pb_time_picker/docs/_time_picker_on_handler.jsx
|
|
2408
2425
|
- app/pb_kits/playbook/pb_time_picker/docs/_time_picker_on_handler.md
|
|
2426
|
+
- app/pb_kits/playbook/pb_time_picker/docs/_time_picker_required_indicator.html.erb
|
|
2427
|
+
- app/pb_kits/playbook/pb_time_picker/docs/_time_picker_required_indicator.jsx
|
|
2428
|
+
- app/pb_kits/playbook/pb_time_picker/docs/_time_picker_required_indicator.md
|
|
2409
2429
|
- app/pb_kits/playbook/pb_time_picker/docs/_time_picker_timezone.html.erb
|
|
2410
2430
|
- app/pb_kits/playbook/pb_time_picker/docs/_time_picker_timezone.jsx
|
|
2411
2431
|
- app/pb_kits/playbook/pb_time_picker/docs/_time_picker_timezone.md
|