playbook_ui 16.1.0.pre.alpha.play2772accesibilitylabelsforphonenumbers14339 → 16.1.0.pre.alpha.play264213817
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/Components/RegularTableView.tsx +2 -12
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +0 -33
- 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 +0 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_button/_button.scss +0 -41
- data/app/pb_kits/playbook/pb_button/_button.tsx +0 -5
- data/app/pb_kits/playbook/pb_button/button.html.erb +8 -12
- data/app/pb_kits/playbook/pb_button/button.rb +0 -5
- data/app/pb_kits/playbook/pb_button/button.test.js +0 -105
- data/app/pb_kits/playbook/pb_button/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_button/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_light.html.erb +35 -3
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.scss +1 -1
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.tsx +0 -17
- data/app/pb_kits/playbook/pb_checkbox/checkbox.html.erb +1 -10
- data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +0 -2
- data/app/pb_kits/playbook/pb_checkbox/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_checkbox/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +5 -22
- data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +16 -25
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +0 -3
- data/app/pb_kits/playbook/pb_date_picker/date_picker.test.js +1 -36
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_date_picker/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_dialog/_dialog.scss +6 -8
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +0 -6
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +14 -97
- 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 +3 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.jsx +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.md +1 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +2 -8
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +1 -5
- data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +6 -18
- data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +0 -17
- data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +1 -118
- data/app/pb_kits/playbook/pb_dropdown/dropdown_container.rb +1 -5
- data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.html.erb +10 -15
- data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.rb +0 -4
- data/app/pb_kits/playbook/pb_dropdown/index.js +83 -191
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownContainer.tsx +0 -3
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownTrigger.tsx +1 -18
- data/app/pb_kits/playbook/pb_dropdown/utilities/clickOutsideHelper.tsx +0 -6
- data/app/pb_kits/playbook/pb_filter/Filter/SortMenu.tsx +1 -1
- data/app/pb_kits/playbook/pb_filter/docs/_filter_default.html.erb +2 -2
- data/app/pb_kits/playbook/pb_filter/docs/_filter_default.jsx +9 -16
- data/app/pb_kits/playbook/pb_filter/filter.rb +2 -2
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +1 -2
- data/app/pb_kits/playbook/pb_form/docs/_form_with_required_indicator.html.erb +2 -156
- data/app/pb_kits/playbook/pb_form/pb_form_validation.js +2 -9
- data/app/pb_kits/playbook/pb_form_group/docs/_form_group_button.html.erb +1 -1
- data/app/pb_kits/playbook/pb_form_group/docs/_form_group_button.jsx +0 -1
- data/app/pb_kits/playbook/pb_form_group/docs/_form_group_date_picker.html.erb +1 -1
- data/app/pb_kits/playbook/pb_form_group/docs/_form_group_date_picker.jsx +0 -1
- data/app/pb_kits/playbook/pb_form_group/docs/_form_group_default.html.erb +3 -3
- data/app/pb_kits/playbook/pb_form_group/docs/_form_group_default.jsx +1 -4
- data/app/pb_kits/playbook/pb_form_group/docs/_form_group_full_width.html.erb +4 -4
- data/app/pb_kits/playbook/pb_form_group/docs/_form_group_full_width.jsx +1 -4
- data/app/pb_kits/playbook/pb_form_group/docs/_form_group_typeahead.jsx +0 -1
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.html.erb +5 -5
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.jsx +4 -4
- data/app/pb_kits/playbook/pb_form_pill/form_pill.rb +0 -4
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.scss +0 -7
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +549 -648
- 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 +7 -4
- data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +17 -18
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb +0 -3
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.test.jsx +25 -55
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select_options.tsx +4 -4
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.scss +3 -8
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +67 -71
- data/app/pb_kits/playbook/pb_multiple_users/docs/example.yml +1 -2
- data/app/pb_kits/playbook/pb_multiple_users/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_nav/_item.tsx +3 -5
- data/app/pb_kits/playbook/pb_nav/_nav.scss +3 -82
- data/app/pb_kits/playbook/pb_nav/docs/example.yml +6 -2
- data/app/pb_kits/playbook/pb_nav/docs/index.js +1 -2
- data/app/pb_kits/playbook/pb_nav/item.html.erb +1 -1
- data/app/pb_kits/playbook/pb_nav/item.rb +1 -1
- data/app/pb_kits/playbook/pb_nav/navTypes.ts +0 -1
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.tsx +7 -40
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.jsx +0 -1
- data/app/pb_kits/playbook/pb_passphrase/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_passphrase/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_passphrase/passphrase.rb +0 -2
- data/app/pb_kits/playbook/pb_passphrase/passphrase.test.jsx +1 -30
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +0 -12
- data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.rb +0 -3
- data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.test.js +3 -34
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +16 -51
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_required_indicator.jsx +0 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_required_indicator.jsx +0 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/index.js +0 -2
- data/app/pb_kits/playbook/pb_star_rating/_star_rating.tsx +0 -3
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_interactive.html.erb +1 -1
- data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_interactive.jsx +0 -1
- data/app/pb_kits/playbook/pb_star_rating/star_rating.html.erb +2 -2
- data/app/pb_kits/playbook/pb_star_rating/subcomponents/_star_rating_interactive.tsx +39 -55
- data/app/pb_kits/playbook/pb_table/index.ts +27 -29
- data/app/pb_kits/playbook/pb_text_input/text_input.html.erb +10 -10
- data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +0 -10
- 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 +0 -3
- data/app/pb_kits/playbook/pb_textarea/textarea.html.erb +9 -25
- data/app/pb_kits/playbook/pb_textarea/textarea.rb +1 -7
- data/app/pb_kits/playbook/pb_time_picker/_time_picker.tsx +11 -97
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_on_handler.jsx +2 -5
- data/app/pb_kits/playbook/pb_time_picker/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_time_picker/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_time_picker/time_picker.rb +0 -3
- data/app/pb_kits/playbook/pb_time_picker/time_picker.test.jsx +1 -47
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.test.jsx +2 -53
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +324 -413
- data/app/pb_kits/playbook/pb_typeahead/components/Control.tsx +0 -2
- data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +1 -4
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.html.erb +1 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.jsx +1 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_typeahead/docs/index.js +21 -22
- data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +2 -3
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +1 -7
- data/app/pb_kits/playbook/tokens/_colors.scss +0 -3
- data/app/pb_kits/playbook/tokens/exports/_colors.module.scss +0 -10
- data/dist/chunks/{_pb_line_graph-CC2Ywwix.js → _pb_line_graph-BgKF_zz1.js} +1 -1
- data/dist/chunks/_typeahead-B9a6ZsEP.js +1 -0
- data/dist/chunks/{globalProps-DYr2qrIf.js → globalProps-BhVYCqRf.js} +1 -1
- data/dist/chunks/lib-DD34ZrWL.js +29 -0
- data/dist/chunks/vendor.js +3 -3
- data/dist/menu.yml +3 -3
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +2 -2
- data/dist/reset.css +1 -1
- data/lib/playbook/forms/builder/date_picker_field.rb +2 -8
- data/lib/playbook/forms/builder/dropdown_field.rb +1 -7
- data/lib/playbook/forms/builder/form_field_builder.rb +1 -1
- data/lib/playbook/forms/builder/intl_telephone_field.rb +1 -11
- data/lib/playbook/forms/builder/multi_level_select_field.rb +0 -8
- data/lib/playbook/forms/builder/phone_number_field.rb +1 -11
- data/lib/playbook/forms/builder/typeahead_field.rb +1 -15
- data/lib/playbook/forms/builder.rb +2 -2
- data/lib/playbook/truncate.rb +1 -1
- data/lib/playbook/version.rb +1 -1
- data/lib/playbook.rb +0 -1
- metadata +6 -61
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_custom.jsx +0 -71
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_styling_background_custom.md +0 -4
- data/app/pb_kits/playbook/pb_button/docs/_button_icon_variant.html.erb +0 -21
- data/app/pb_kits/playbook/pb_button/docs/_button_icon_variant.jsx +0 -180
- data/app/pb_kits/playbook/pb_button/docs/_button_icon_variant_rails.md +0 -1
- data/app/pb_kits/playbook/pb_button/docs/_button_icon_variant_react.md +0 -1
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_required_indicator.html.erb +0 -6
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_required_indicator.jsx +0 -17
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_required_indicator.md +0 -3
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default.md +0 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_required_indicator.html.erb +0 -5
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_required_indicator.jsx +0 -13
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_required_indicator.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_blank_selection_rails.md +0 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_blank_selection_react.md +0 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_required_indicator.html.erb +0 -14
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_required_indicator.jsx +0 -42
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_required_indicator.md +0 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_clearable.html.erb +0 -52
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_clearable.jsx +0 -72
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_clearable.md +0 -5
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_constrain_height.jsx +0 -33
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_constrain_height_rails.html.erb +0 -20
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_constrain_height_rails.md +0 -8
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_constrain_height_react.md +0 -8
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_placeholder.html.erb +0 -9
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_placeholder.jsx +0 -33
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_placeholder.md +0 -3
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_label.md +0 -3
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_required_indicator.html.erb +0 -72
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_required_indicator.jsx +0 -87
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_required_indicator.md +0 -3
- data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_max_displayed_users.jsx +0 -71
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_disabled_item.html.erb +0 -24
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_disabled_item.jsx +0 -87
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_required_indicator.html.erb +0 -7
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_required_indicator.jsx +0 -24
- data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_required_indicator.md +0 -3
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_required_indicator.html.erb +0 -5
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_required_indicator.jsx +0 -14
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_required_indicator.md +0 -3
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_label.jsx +0 -44
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_advanced_label.md +0 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_label.jsx +0 -28
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_label.md +0 -1
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_default.md +0 -1
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_required_indicator.html.erb +0 -6
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_required_indicator.jsx +0 -16
- data/app/pb_kits/playbook/pb_time_picker/docs/_time_picker_required_indicator.md +0 -3
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_required_indicator.html.erb +0 -16
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_required_indicator.jsx +0 -23
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_required_indicator.md +0 -3
- data/app/pb_kits/playbook/tokens/_colors_accessible.scss +0 -250
- data/dist/chunks/_typeahead-DtzfGPUT.js +0 -1
- data/dist/chunks/lib-DgqmX9CF.js +0 -29
- data/lib/playbook/tokens/colors.json +0 -99
- data/lib/playbook/tokens.rb +0 -99
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 60b41dbbb195e70b9104ae56ec68ad19fb488444096838262600e95bbe239642
|
|
4
|
+
data.tar.gz: 6d634ec91b1f185be3d7e47e6c88eeab8e545831336742e5661f5066a628e274
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dd16edcd3a1830e2736636eb7f254099c46fe7130e6ef42fd0bb35a17a1e6967f84be79ec23761183e615bdbe0c242b890d30670ef993a3382dbf62c349cc864
|
|
7
|
+
data.tar.gz: 377d852a602c33c7067b566a1fc838a61836516add1396a720269dd31e28aa370aa8ca400b913b6905c50443a45bf0e6cc9d84951480f09cf7b469e09d04f86c
|
|
@@ -66,18 +66,8 @@ const TableCellRenderer = ({
|
|
|
66
66
|
// Find the "owning" colDefinition by accessor. Needed for multi column logic
|
|
67
67
|
const colDef = findColumnDefByAccessor(columnDefinitions ?? [], column.id)
|
|
68
68
|
const cellAlignment = colDef?.columnStyling?.cellAlignment ?? "right"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const cellFontColorValue = colDef?.columnStyling?.fontColor
|
|
72
|
-
const cellFontColor = typeof cellFontColorValue === 'function'
|
|
73
|
-
? cellFontColorValue(row)
|
|
74
|
-
: cellFontColorValue
|
|
75
|
-
|
|
76
|
-
const cellBackgroundColorValue = colDef?.columnStyling?.cellBackgroundColor
|
|
77
|
-
const cellBackgroundColor = typeof cellBackgroundColorValue === 'function'
|
|
78
|
-
? cellBackgroundColorValue(row)
|
|
79
|
-
: cellBackgroundColorValue
|
|
80
|
-
|
|
69
|
+
const cellFontColor = colDef?.columnStyling?.fontColor
|
|
70
|
+
const cellBackgroundColor = colDef?.columnStyling?.cellBackgroundColor
|
|
81
71
|
const paddingValue = colDef?.columnStyling?.cellPadding ?? customRowStyle?.cellPadding
|
|
82
72
|
const paddingClass = paddingValue ? `p_${paddingValue}` : undefined
|
|
83
73
|
|
|
@@ -920,39 +920,6 @@ test("columnStyling.backgroundColor works as excpected", () => {
|
|
|
920
920
|
expect(firstEnrollmentCell).toHaveStyle({ backgroundColor: colors.error_subtle });
|
|
921
921
|
});
|
|
922
922
|
|
|
923
|
-
test("columnStyling.cellBackgroundColor works as expected with function", () => {
|
|
924
|
-
const styledColumnDefs = [
|
|
925
|
-
{
|
|
926
|
-
accessor: "year",
|
|
927
|
-
label: "Year",
|
|
928
|
-
cellAccessors: ["quarter", "month", "day"],
|
|
929
|
-
},
|
|
930
|
-
{
|
|
931
|
-
accessor: "newEnrollments",
|
|
932
|
-
label: "New Enrollments",
|
|
933
|
-
columnStyling:{
|
|
934
|
-
cellBackgroundColor: (row) => row.original.newEnrollments > 15 ? colors.success_subtle : colors.error_subtle,
|
|
935
|
-
fontColor: (row) => row.original.newEnrollments > 15 ? colors.success : colors.error,
|
|
936
|
-
},
|
|
937
|
-
},
|
|
938
|
-
{
|
|
939
|
-
accessor: "scheduledMeetings",
|
|
940
|
-
label: "Scheduled Meetings",
|
|
941
|
-
},
|
|
942
|
-
];
|
|
943
|
-
|
|
944
|
-
render(
|
|
945
|
-
<AdvancedTable
|
|
946
|
-
columnDefinitions={styledColumnDefs}
|
|
947
|
-
data={{ testid: testId }}
|
|
948
|
-
tableData={MOCK_DATA}
|
|
949
|
-
/>
|
|
950
|
-
);
|
|
951
|
-
|
|
952
|
-
const firstEnrollmentCell = screen.getAllByText("20")[0].closest("td");
|
|
953
|
-
expect(firstEnrollmentCell).toHaveStyle({ backgroundColor: colors.success_subtle, color: colors.success });
|
|
954
|
-
});
|
|
955
|
-
|
|
956
923
|
test("columnStyling.headerBackgroundColor works as excpected", () => {
|
|
957
924
|
const styledColumnDefs = [
|
|
958
925
|
{
|
|
@@ -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-wide
|
|
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-wide", "arrow-down-short-wide"]`. All strings must be valid FA icons.
|
|
@@ -78,7 +78,6 @@ 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)
|
|
82
81
|
- advanced_table_column_styling_background_multi: Column Styling Background Color with Multiple Headers
|
|
83
82
|
- advanced_table_padding_control: Padding Control using Column Styling
|
|
84
83
|
- advanced_table_column_border_color: Column Group Border Color
|
|
@@ -47,5 +47,4 @@ 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'
|
|
51
|
-
export { default as AdvancedTableColumnStylingBackgroundCustom } from './_advanced_table_column_styling_background_custom.jsx'
|
|
50
|
+
export { default as AdvancedTableColumnStylingBackgroundMulti } from './_advanced_table_column_styling_background_multi.jsx'
|
|
@@ -112,45 +112,4 @@ $pb_button_sizes: (
|
|
|
112
112
|
@include pb_button_disabled_dark;
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
|
|
116
|
-
// Icon-only button (icon prop set, no text) - square with equal padding
|
|
117
|
-
// Rails: uses .pb_button_icon_only class
|
|
118
|
-
// React: detects when pb_button_content has an empty text span
|
|
119
|
-
&.pb_button_icon_only,
|
|
120
|
-
&:has(.pb_button_content > span:empty) {
|
|
121
|
-
aspect-ratio: 1;
|
|
122
|
-
min-width: auto;
|
|
123
|
-
width: auto;
|
|
124
|
-
height: auto;
|
|
125
|
-
padding: $pb_button_v_padding !important;
|
|
126
|
-
min-height: ($pb_button_v_padding * 2) + $font_small;
|
|
127
|
-
|
|
128
|
-
&.pb_button_size_sm {
|
|
129
|
-
padding: $font_smaller !important;
|
|
130
|
-
min-height: ($font_smaller * 2) + $font_smaller;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
&.pb_button_size_md {
|
|
134
|
-
padding: $font_small !important;
|
|
135
|
-
min-height: ($font_small * 2) + $font_small;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
&.pb_button_size_lg {
|
|
139
|
-
padding: ($font_large - 2px) !important;
|
|
140
|
-
min-height: (($font_large - 2px) * 2) + ($font_large - 2px);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// Remove margins from icons
|
|
144
|
-
.button_with_icon,
|
|
145
|
-
.button_with_icon_right {
|
|
146
|
-
margin-right: 0;
|
|
147
|
-
margin-left: 0;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// Remove margins from Rails icon wrapper spans
|
|
151
|
-
> span {
|
|
152
|
-
margin-right: 0 !important;
|
|
153
|
-
margin-left: 0 !important;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
115
|
}
|
|
@@ -51,13 +51,9 @@ const buttonClassName = (props: ButtonPropTypes) => {
|
|
|
51
51
|
type = 'inline',
|
|
52
52
|
variant = 'primary',
|
|
53
53
|
size = null,
|
|
54
|
-
text,
|
|
55
|
-
children,
|
|
56
54
|
} = props
|
|
57
55
|
|
|
58
56
|
const classNames = ['pb_button_kit']
|
|
59
|
-
// Icon-only: has icon, no text/children, and not a reaction button (reaction buttons have count)
|
|
60
|
-
const isIconOnly = icon && !text && !children && variant !== 'reaction'
|
|
61
57
|
|
|
62
58
|
if (variant) classNames.push(`pb_button_${variant}`)
|
|
63
59
|
if (type) classNames.push(`pb_button_${type}`)
|
|
@@ -67,7 +63,6 @@ const buttonClassName = (props: ButtonPropTypes) => {
|
|
|
67
63
|
if (size) classNames.push(`pb_button_size_${size}`)
|
|
68
64
|
if (variant === 'reaction' && icon && !isValidEmoji(icon)) classNames.push('pb_button_reaction_default')
|
|
69
65
|
if (variant === 'reaction' && highlight) classNames.push('pb_button_active')
|
|
70
|
-
if (isIconOnly) classNames.push('pb_button_icon_only')
|
|
71
66
|
|
|
72
67
|
return classNames.join(' ')
|
|
73
68
|
}
|
|
@@ -16,21 +16,17 @@
|
|
|
16
16
|
<% end %>
|
|
17
17
|
<% end %>
|
|
18
18
|
<% else %>
|
|
19
|
-
<% if !object.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
</span>
|
|
24
|
-
<% end %>
|
|
19
|
+
<% if object.icon && !object.icon_right %>
|
|
20
|
+
<span>
|
|
21
|
+
<%= pb_rails("icon", props: { icon: "#{icon}", fixed_width: true, margin_right: "xs", font_style: object.icon_font_family }) %>
|
|
22
|
+
</span>
|
|
25
23
|
<% end %>
|
|
26
24
|
<%= pb_rails("icon", props: { custom_icon: Playbook::Engine::root.join(spinner_path), pulse: true, fixed_width: true, classname: "loading-icon" }) %>
|
|
27
25
|
<span class="pb_button_content"><%= content.presence || object.text %></span>
|
|
28
|
-
<% if
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</span>
|
|
33
|
-
<% end %>
|
|
26
|
+
<% if object.icon && object.icon_right %>
|
|
27
|
+
<span>
|
|
28
|
+
<%= pb_rails("icon", props: { icon: "#{icon}", fixed_width: true, margin_left: "xs", font_style: object.icon_font_family }) %>
|
|
29
|
+
</span>
|
|
34
30
|
<% end %>
|
|
35
31
|
<% end %>
|
|
36
32
|
|
|
@@ -73,10 +73,6 @@ module Playbook
|
|
|
73
73
|
emoji_regex.match?(icon)
|
|
74
74
|
end
|
|
75
75
|
|
|
76
|
-
def icon_only?
|
|
77
|
-
icon.present? && text.blank? && variant != "reaction"
|
|
78
|
-
end
|
|
79
|
-
|
|
80
76
|
def classname
|
|
81
77
|
class_names = ["pb_button_kit"]
|
|
82
78
|
class_names << "pb_button_#{variant}" if variant
|
|
@@ -86,7 +82,6 @@ module Playbook
|
|
|
86
82
|
class_names << "pb_button_size_#{size}" if size
|
|
87
83
|
class_names << "pb_button_reaction_default" if variant === "reaction" && icon && !valid_emoji(icon)
|
|
88
84
|
class_names << "pb_button_active" if variant === "reaction" && highlight
|
|
89
|
-
class_names << "pb_button_icon_only" if icon_only?
|
|
90
85
|
|
|
91
86
|
class_names.join(" ")
|
|
92
87
|
generate_classname(class_names.compact.join(" "), separator: " ")
|
|
@@ -131,108 +131,3 @@ test('should render child target prop', () => {
|
|
|
131
131
|
expect(kit).toHaveAttribute('target', 'child')
|
|
132
132
|
expect(kit).not.toHaveAttribute('rel')
|
|
133
133
|
})
|
|
134
|
-
|
|
135
|
-
describe('icon-only button', () => {
|
|
136
|
-
test('adds pb_button_icon_only class when icon is provided without text', () => {
|
|
137
|
-
render(
|
|
138
|
-
<Button
|
|
139
|
-
data={{ testid: 'icon-only-test' }}
|
|
140
|
-
icon="plus"
|
|
141
|
-
/>
|
|
142
|
-
)
|
|
143
|
-
|
|
144
|
-
const kit = screen.getByTestId('icon-only-test')
|
|
145
|
-
expect(kit).toHaveClass('pb_button_icon_only')
|
|
146
|
-
})
|
|
147
|
-
|
|
148
|
-
test('does not add pb_button_icon_only class when text is provided', () => {
|
|
149
|
-
render(
|
|
150
|
-
<Button
|
|
151
|
-
data={{ testid: 'icon-with-text-test' }}
|
|
152
|
-
icon="plus"
|
|
153
|
-
text="Click me"
|
|
154
|
-
/>
|
|
155
|
-
)
|
|
156
|
-
|
|
157
|
-
const kit = screen.getByTestId('icon-with-text-test')
|
|
158
|
-
expect(kit).not.toHaveClass('pb_button_icon_only')
|
|
159
|
-
})
|
|
160
|
-
|
|
161
|
-
test('does not add pb_button_icon_only class when children are provided', () => {
|
|
162
|
-
render(
|
|
163
|
-
<Button
|
|
164
|
-
data={{ testid: 'icon-with-children-test' }}
|
|
165
|
-
icon="plus"
|
|
166
|
-
>
|
|
167
|
-
Click me
|
|
168
|
-
</Button>
|
|
169
|
-
)
|
|
170
|
-
|
|
171
|
-
const kit = screen.getByTestId('icon-with-children-test')
|
|
172
|
-
expect(kit).not.toHaveClass('pb_button_icon_only')
|
|
173
|
-
})
|
|
174
|
-
|
|
175
|
-
test('does not add pb_button_icon_only class when variant is reaction', () => {
|
|
176
|
-
render(
|
|
177
|
-
<Button
|
|
178
|
-
data={{ testid: 'reaction-icon-test' }}
|
|
179
|
-
icon="plus"
|
|
180
|
-
variant="reaction"
|
|
181
|
-
/>
|
|
182
|
-
)
|
|
183
|
-
|
|
184
|
-
const kit = screen.getByTestId('reaction-icon-test')
|
|
185
|
-
expect(kit).not.toHaveClass('pb_button_icon_only')
|
|
186
|
-
})
|
|
187
|
-
|
|
188
|
-
test('adds pb_button_icon_only class with different variants', () => {
|
|
189
|
-
const variants = ['primary', 'secondary', 'link', 'danger']
|
|
190
|
-
|
|
191
|
-
variants.forEach(variant => {
|
|
192
|
-
const { unmount } = render(
|
|
193
|
-
<Button
|
|
194
|
-
data={{ testid: `icon-only-${variant}-test` }}
|
|
195
|
-
icon="plus"
|
|
196
|
-
variant={variant}
|
|
197
|
-
/>
|
|
198
|
-
)
|
|
199
|
-
|
|
200
|
-
const kit = screen.getByTestId(`icon-only-${variant}-test`)
|
|
201
|
-
expect(kit).toHaveClass('pb_button_icon_only')
|
|
202
|
-
unmount()
|
|
203
|
-
})
|
|
204
|
-
})
|
|
205
|
-
|
|
206
|
-
test('adds pb_button_icon_only class with loading state', () => {
|
|
207
|
-
render(
|
|
208
|
-
<Button
|
|
209
|
-
data={{ testid: 'icon-only-loading-test' }}
|
|
210
|
-
icon="plus"
|
|
211
|
-
loading
|
|
212
|
-
/>
|
|
213
|
-
)
|
|
214
|
-
|
|
215
|
-
const kit = screen.getByTestId('icon-only-loading-test')
|
|
216
|
-
expect(kit).toHaveClass('pb_button_icon_only')
|
|
217
|
-
expect(kit).toHaveClass('pb_button_loading')
|
|
218
|
-
})
|
|
219
|
-
|
|
220
|
-
test('adds pb_button_icon_only class with size variants', () => {
|
|
221
|
-
const sizes = ['sm', 'md', 'lg']
|
|
222
|
-
|
|
223
|
-
sizes.forEach(size => {
|
|
224
|
-
const { unmount } = render(
|
|
225
|
-
<Button
|
|
226
|
-
data={{ testid: `icon-only-${size}-test` }}
|
|
227
|
-
icon="plus"
|
|
228
|
-
size={size}
|
|
229
|
-
/>
|
|
230
|
-
)
|
|
231
|
-
|
|
232
|
-
const kit = screen.getByTestId(`icon-only-${size}-test`)
|
|
233
|
-
expect(kit).toHaveClass('pb_button_icon_only')
|
|
234
|
-
expect(kit).toHaveClass(`pb_button_size_${size}`)
|
|
235
|
-
unmount()
|
|
236
|
-
})
|
|
237
|
-
})
|
|
238
|
-
})
|
|
@@ -13,7 +13,6 @@ examples:
|
|
|
13
13
|
- button_form: Button Form Attribute
|
|
14
14
|
- button_managed_disabled: Button Toggle Disabled State
|
|
15
15
|
- button_managed_disabled_helper: Button Toggle Disabled State Helper
|
|
16
|
-
- button_icon_variant: Icon Button Variant
|
|
17
16
|
|
|
18
17
|
react:
|
|
19
18
|
- button_default: Button Variants
|
|
@@ -28,7 +27,6 @@ examples:
|
|
|
28
27
|
- button_size: Button Size
|
|
29
28
|
- button_form: Button Form Attribute
|
|
30
29
|
- button_hover: Button Hover
|
|
31
|
-
- button_icon_variant: Icon Button Variant
|
|
32
30
|
|
|
33
31
|
swift:
|
|
34
32
|
- button_default_swift: Button Variants
|
|
@@ -4,7 +4,6 @@ export { default as ButtonLink } from './_button_link.jsx'
|
|
|
4
4
|
export { default as ButtonLoading } from './_button_loading.jsx'
|
|
5
5
|
export { default as ButtonBlockContent } from './_button_block_content.jsx'
|
|
6
6
|
export { default as ButtonIconOptions } from './_button_icon_options.jsx'
|
|
7
|
-
export { default as ButtonIconVariant } from './_button_icon_variant.jsx'
|
|
8
7
|
export { default as ButtonAccessibility } from './_button_accessibility.jsx'
|
|
9
8
|
export { default as ButtonOptions } from './_button_options.jsx'
|
|
10
9
|
export { default as ButtonSize } from './_button_size.jsx'
|
|
@@ -1,4 +1,36 @@
|
|
|
1
|
-
<%= pb_rails("
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<%= pb_rails("flex", props: {
|
|
2
|
+
gap: "md",
|
|
3
|
+
orientation: "column"
|
|
4
|
+
}) do %>
|
|
5
|
+
|
|
6
|
+
<%= pb_rails("caption", props: { text: "flex direction responsive: row on md + xl, column as default" }) %>
|
|
7
|
+
<%= pb_rails("card", props: {
|
|
8
|
+
flex_direction: { default: "column", md: "row", xl:"row" }
|
|
9
|
+
}) do %>
|
|
10
|
+
<%= pb_rails("body", props: { text: "Item 1", color: "default" }) %>
|
|
11
|
+
<%= pb_rails("body", props: { text: "Item 2", color: "default" }) %>
|
|
12
|
+
<%= pb_rails("body", props: { text: "Item 3", color: "default" }) %>
|
|
13
|
+
<% end %>
|
|
14
|
+
|
|
15
|
+
<%= pb_rails("caption", props: { text: "align items responsive: start on default, center on md, end on lg" }) %>
|
|
16
|
+
<%= pb_rails("card", props: {
|
|
17
|
+
display: "flex",
|
|
18
|
+
flex_direction: "row",
|
|
19
|
+
align_items: { default: "start", md: "center", lg: "end" },
|
|
20
|
+
}) do %>
|
|
21
|
+
<%= pb_rails("card", props: {height:"xs" }) do %> Card 1 <% end %>
|
|
22
|
+
<%= pb_rails("card", props: { height:"sm" }) do %> Card 2 <% end %>
|
|
23
|
+
<%= pb_rails("card", props: { height:"xs" }) do %> Card 3 <% end %>
|
|
24
|
+
<% end %>
|
|
25
|
+
|
|
26
|
+
<%= pb_rails("caption", props: { text: "Text Align responsive: left on default, center on md, right on lg" }) %>
|
|
27
|
+
<%= pb_rails("card", props: {
|
|
28
|
+
text_align: { default: "left", md: "center", lg: "right" },
|
|
29
|
+
width: "100%"
|
|
30
|
+
}) do %>
|
|
31
|
+
<%= pb_rails("body", props: { }) do %> text 1 <% end %>
|
|
32
|
+
<%= pb_rails("body", props: { }) do %> text 2 <% end %>
|
|
33
|
+
<%= pb_rails("body", props: { }) do %> text 3 <% end %>
|
|
34
|
+
<% end %>
|
|
4
35
|
<% end %>
|
|
36
|
+
|
|
@@ -4,8 +4,6 @@ import Icon from '../pb_icon/_icon'
|
|
|
4
4
|
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
|
5
5
|
import classnames from 'classnames'
|
|
6
6
|
import { globalProps, GlobalProps } from '../utilities/globalProps'
|
|
7
|
-
import colors from '../tokens/exports/_colors.module.scss'
|
|
8
|
-
import spacing from '../tokens/exports/_spacing.module.scss'
|
|
9
7
|
|
|
10
8
|
type CheckboxProps = {
|
|
11
9
|
aria?: {[key: string]: string},
|
|
@@ -21,7 +19,6 @@ type CheckboxProps = {
|
|
|
21
19
|
indeterminate?: boolean,
|
|
22
20
|
name?: string,
|
|
23
21
|
onChange?: (event: React.FormEvent<HTMLInputElement>) => void,
|
|
24
|
-
requiredIndicator?: boolean,
|
|
25
22
|
tabIndex?: number,
|
|
26
23
|
text?: string,
|
|
27
24
|
value?: string,
|
|
@@ -42,7 +39,6 @@ const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, ref) => {
|
|
|
42
39
|
indeterminate = false,
|
|
43
40
|
name = '',
|
|
44
41
|
onChange = () => { void 0 },
|
|
45
|
-
requiredIndicator = false,
|
|
46
42
|
tabIndex,
|
|
47
43
|
text = '',
|
|
48
44
|
value = '',
|
|
@@ -128,20 +124,7 @@ const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, ref) => {
|
|
|
128
124
|
variant={null}
|
|
129
125
|
>
|
|
130
126
|
{text}
|
|
131
|
-
{requiredIndicator && (
|
|
132
|
-
<span
|
|
133
|
-
aria-hidden="true"
|
|
134
|
-
className="pb_required_indicator"
|
|
135
|
-
style={{
|
|
136
|
-
color: colors.error,
|
|
137
|
-
marginLeft: spacing.space_xs,
|
|
138
|
-
}}
|
|
139
|
-
>
|
|
140
|
-
{'*'}
|
|
141
|
-
</span>
|
|
142
|
-
)}
|
|
143
127
|
</Body>
|
|
144
|
-
|
|
145
128
|
</label>
|
|
146
129
|
)
|
|
147
130
|
})
|
|
@@ -5,15 +5,6 @@
|
|
|
5
5
|
<%= pb_rails("icon", props: { icon: "minus", classname: "indeterminate_icon hidden", fixed_width: true}) %>
|
|
6
6
|
</span>
|
|
7
7
|
<span class="pb_checkbox_label">
|
|
8
|
-
<%= pb_rails("body", props: { status: object.checkbox_label_status, dark: object.dark, margin_right: object.form_spacing ? "xs" : "" })
|
|
9
|
-
<%= object.text%>
|
|
10
|
-
<% if object.required_indicator %>
|
|
11
|
-
<span
|
|
12
|
-
class="pb_checkbox_required_indicator"
|
|
13
|
-
aria-hidden="true"
|
|
14
|
-
style="color: #DA0014;"
|
|
15
|
-
>*</span>
|
|
16
|
-
<% end %>
|
|
17
|
-
<% end %>
|
|
8
|
+
<%= pb_rails("body", props: { status: object.checkbox_label_status, text: object.text, dark: object.dark, margin_right: object.form_spacing ? "xs" : "" }) %>
|
|
18
9
|
</span>
|
|
19
10
|
<% end %>
|
|
@@ -23,8 +23,6 @@ module Playbook
|
|
|
23
23
|
prop :hidden_input, type: Playbook::Props::Boolean,
|
|
24
24
|
default: false
|
|
25
25
|
prop :hidden_value
|
|
26
|
-
prop :required_indicator, type: Playbook::Props::Boolean,
|
|
27
|
-
default: false
|
|
28
26
|
|
|
29
27
|
def classname
|
|
30
28
|
generate_classname("pb_checkbox_kit", checked_class) + error_class
|
|
@@ -8,7 +8,6 @@ examples:
|
|
|
8
8
|
- checkbox_indeterminate: Indeterminate Checkbox
|
|
9
9
|
- checkbox_disabled: Disabled Checkbox
|
|
10
10
|
- checkbox_form: Form and Hidden Input
|
|
11
|
-
# - checkbox_required_indicator: Required Indicator
|
|
12
11
|
|
|
13
12
|
react:
|
|
14
13
|
- checkbox_default: Default
|
|
@@ -18,7 +17,6 @@ examples:
|
|
|
18
17
|
- checkbox_error: Default w/ Error
|
|
19
18
|
- checkbox_indeterminate: Indeterminate Checkbox
|
|
20
19
|
- checkbox_disabled: Disabled Checkbox
|
|
21
|
-
# - checkbox_required_indicator: Required Indicator
|
|
22
20
|
|
|
23
21
|
swift:
|
|
24
22
|
- checkbox_default_swift: Default
|
|
@@ -5,4 +5,3 @@ export { default as CheckboxError } from './_checkbox_error.jsx'
|
|
|
5
5
|
export { default as CheckboxChecked } from './_checkbox_checked.jsx'
|
|
6
6
|
export { default as CheckboxIndeterminate } from './_checkbox_indeterminate.jsx'
|
|
7
7
|
export { default as CheckboxDisabled } from './_checkbox_disabled.jsx'
|
|
8
|
-
export { default as CheckboxRequiredIndicator } from './_checkbox_required_indicator.jsx'
|
|
@@ -10,7 +10,6 @@ import datePickerHelper from './date_picker_helper'
|
|
|
10
10
|
import Icon from '../pb_icon/_icon'
|
|
11
11
|
import Caption from '../pb_caption/_caption'
|
|
12
12
|
import Body from '../pb_body/_body'
|
|
13
|
-
import colors from "../tokens/exports/_colors.module.scss"
|
|
14
13
|
|
|
15
14
|
type DatePickerProps = {
|
|
16
15
|
allowInput?: boolean,
|
|
@@ -41,10 +40,9 @@ type DatePickerProps = {
|
|
|
41
40
|
maxDate: string,
|
|
42
41
|
minDate: string,
|
|
43
42
|
name: string,
|
|
44
|
-
pickerId
|
|
43
|
+
pickerId?: string,
|
|
45
44
|
placeholder?: string,
|
|
46
45
|
positionElement?: HTMLElement | null,
|
|
47
|
-
requiredIndicator?: boolean
|
|
48
46
|
scrollContainer?: string,
|
|
49
47
|
selectionType?: "month" | "week"| "quickpick",
|
|
50
48
|
showTimezone?: boolean,
|
|
@@ -99,7 +97,6 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
|
|
|
99
97
|
plugins = false,
|
|
100
98
|
position,
|
|
101
99
|
positionElement,
|
|
102
|
-
requiredIndicator,
|
|
103
100
|
scrollContainer,
|
|
104
101
|
selectionType = '',
|
|
105
102
|
showTimezone = false,
|
|
@@ -199,8 +196,6 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
|
|
|
199
196
|
|
|
200
197
|
const angleDown = getAllIcons()["angleDown"].icon as unknown as { [key: string]: SVGElement }
|
|
201
198
|
|
|
202
|
-
const errorId = error ? `${pickerId}-error` : undefined
|
|
203
|
-
|
|
204
199
|
return (
|
|
205
200
|
<div
|
|
206
201
|
{...ariaProps}
|
|
@@ -216,23 +211,14 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
|
|
|
216
211
|
>
|
|
217
212
|
|
|
218
213
|
{!hideLabel && (
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
</Caption>
|
|
224
|
-
) : (
|
|
225
|
-
<Caption className="pb_date_picker_kit_label"
|
|
226
|
-
text={label}
|
|
227
|
-
/>
|
|
228
|
-
)}
|
|
229
|
-
</label>
|
|
214
|
+
<Caption
|
|
215
|
+
className="pb_date_picker_kit_label"
|
|
216
|
+
text={label}
|
|
217
|
+
/>
|
|
230
218
|
)}
|
|
231
219
|
<>
|
|
232
220
|
<div className="date_picker_input_wrapper">
|
|
233
221
|
<input
|
|
234
|
-
aria-describedby={errorId}
|
|
235
|
-
aria-invalid={!!error}
|
|
236
222
|
autoComplete="off"
|
|
237
223
|
className="date_picker_input"
|
|
238
224
|
disabled={disableInput}
|
|
@@ -246,9 +232,6 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
|
|
|
246
232
|
|
|
247
233
|
{error &&
|
|
248
234
|
<Body
|
|
249
|
-
aria={{ atomic: "true", live: "polite" }}
|
|
250
|
-
htmlOptions={{ role: "alert" }}
|
|
251
|
-
id={errorId}
|
|
252
235
|
status="negative"
|
|
253
236
|
text={error}
|
|
254
237
|
variant={null}
|
|
@@ -4,35 +4,26 @@
|
|
|
4
4
|
'data-validation-message' => object.validation_message,
|
|
5
5
|
) do %>
|
|
6
6
|
<div class="input_wrapper">
|
|
7
|
-
<% if !object.hide_label && object.label %>
|
|
8
|
-
<label for="<%= object.picker_id %>">
|
|
9
|
-
<% if object.required_indicator %>
|
|
10
|
-
<%= pb_rails("caption", props: { dark: object.dark, classname: "pb_date_picker_kit_label" }) do %>
|
|
11
|
-
<%= object.label %><span style="color: #DA0014;"> *</span>
|
|
12
|
-
<% end %>
|
|
13
|
-
<% else %>
|
|
14
|
-
<%= pb_rails("caption", props: { text: object.label, dark: object.dark, classname: "pb_date_picker_kit_label" }) %>
|
|
15
|
-
<% end %>
|
|
16
|
-
</label>
|
|
17
|
-
<% end %>
|
|
18
7
|
<% if content.present? %>
|
|
19
8
|
<%= content %>
|
|
20
9
|
<% else %>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
10
|
+
<%= pb_rails("text_input", props: {
|
|
11
|
+
aria: object.input_aria,
|
|
12
|
+
autocomplete: false,
|
|
13
|
+
cursor: object.cursor,
|
|
14
|
+
dark: object.dark,
|
|
15
|
+
data: object.input_data,
|
|
16
|
+
disabled: object.disable_input,
|
|
17
|
+
error: object.error,
|
|
18
|
+
id: object.picker_id,
|
|
19
|
+
label: object.hide_label ? nil : object.label,
|
|
20
|
+
margin_bottom: "none",
|
|
21
|
+
name: object.name,
|
|
22
|
+
placeholder: object.placeholder,
|
|
23
|
+
required: object.required,
|
|
24
|
+
}) %>
|
|
35
25
|
<% end %>
|
|
26
|
+
|
|
36
27
|
<% if object.selection_type == "quickpick" %>
|
|
37
28
|
<input type="hidden" id="<%= "#{object.start_date_id}" %>" name="<%= "#{object.start_date_name}" %>">
|
|
38
29
|
<input type="hidden" id="<%= "#{object.end_date_id}" %>" name="<%= "#{object.end_date_name}" %>">
|
|
@@ -71,8 +71,6 @@ module Playbook
|
|
|
71
71
|
default: false
|
|
72
72
|
prop :required, type: Playbook::Props::Boolean,
|
|
73
73
|
default: false
|
|
74
|
-
prop :required_indicator, type: Playbook::Props::Boolean,
|
|
75
|
-
default: false
|
|
76
74
|
prop :year_range, type: Playbook::Props::Array,
|
|
77
75
|
default: [1900, 2100]
|
|
78
76
|
prop :custom_event_type, type: Playbook::Props::String,
|
|
@@ -115,7 +113,6 @@ module Playbook
|
|
|
115
113
|
position: position,
|
|
116
114
|
positionElement: position_element,
|
|
117
115
|
required: required,
|
|
118
|
-
requiredIndicator: required_indicator,
|
|
119
116
|
selectionType: selection_type,
|
|
120
117
|
showTimezone: show_timezone,
|
|
121
118
|
staticPosition: static_position,
|