playbook_ui_docs 16.1.0.pre.alpha.testingrailsfix14159 → 16.1.0.pre.alpha.2726requiredindicatorpropdropdown14179

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 528f6574471c23f672e0c7ed43b82d327ecb4b3424a10462ee8a6fafb0b2d0f4
4
- data.tar.gz: edd37ff44192554be84163878ae59d0381e6e7e0ff22ce5c4eb1438b434cbece
3
+ metadata.gz: 9a3773b0b2a7e852ff1d56220ccae57ec127db9fa47cddabbe2a087f56797dde
4
+ data.tar.gz: f433f0a8d1f5e3416f418e276656f43410e05ca88fc7dc51a3b3039be1c3a764
5
5
  SHA512:
6
- metadata.gz: cf6d0036275beb97ab2f9500a0af143fa33be7dbbccb954c3e94e14e33efc9ae5129beee4f0676506d2fc270e09931dddba98231155cf5b4e0a9c154a11354e2
7
- data.tar.gz: 3691319c65ccf760fca005ceef32b86634c776d72197a9ca01de7e4327b94ffc58034ac7717ff6080669f2b5eae2a77c27c37dd627c3e065fde0ef4aed2594b7
6
+ metadata.gz: f5699fed9130ab7acf07abbfa96762501f3b6d9d26b0636a17c6bcc562123e4ed5676ba90b48a15916e482e250e9089ce60342f3dbbe34ad5f0b757744f2e607
7
+ data.tar.gz: a88e04434a4e40f0e87c3b6eed29420c22360c47ea56df3d7881872843c16ac2173903b6119416d507f28a4bd5b8615eafe23fdb1043fe28092f34ab6ebeb82e
@@ -0,0 +1,14 @@
1
+ <%
2
+ options = [
3
+ { label: 'United States', value: 'unitedStates', id: 'us' },
4
+ { label: 'Canada', value: 'canada', id: 'ca' },
5
+ { label: 'Pakistan', value: 'pakistan', id: 'pk' }
6
+ ]
7
+ %>
8
+
9
+ <%= pb_rails("dropdown", props: {
10
+ id: "dropdown_required_indicator",
11
+ label: "Select a Country",
12
+ options: options,
13
+ required_indicator: true
14
+ }) %>
@@ -0,0 +1,42 @@
1
+ import React from "react";
2
+ import Dropdown from "../../pb_dropdown/_dropdown";
3
+
4
+ const DropdownRequiredIndicator = (props) => {
5
+ const options = [
6
+ {
7
+ label: "United States",
8
+ value: "unitedStates",
9
+ id: "us",
10
+ },
11
+ {
12
+ label: "Canada",
13
+ value: "canada",
14
+ id: "ca",
15
+ },
16
+ {
17
+ label: "Pakistan",
18
+ value: "pakistan",
19
+ id: "pk",
20
+ },
21
+ ];
22
+
23
+ return (
24
+ <div>
25
+ <Dropdown
26
+ label="Select a Country"
27
+ options={options}
28
+ requiredIndicator
29
+ {...props}
30
+ >
31
+ {options.map((option) => (
32
+ <Dropdown.Option
33
+ key={option.id}
34
+ option={option}
35
+ />
36
+ ))}
37
+ </Dropdown>
38
+ </div>
39
+ );
40
+ };
41
+
42
+ export default DropdownRequiredIndicator;
@@ -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.
@@ -31,6 +31,7 @@ examples:
31
31
  - dropdown_quickpick_custom_rails: Quick Pick Variant (Custom Quick Pick Dates)
32
32
  - dropdown_quickpick_with_date_pickers_rails: Quick Pick with Date Pickers
33
33
  - dropdown_quickpick_with_date_pickers_default_rails: Quick Pick with Date Pickers (Default Value)
34
+ - dropdown_required_indicator: Required Indicator
34
35
 
35
36
  react:
36
37
  - dropdown_default: Default
@@ -66,5 +67,4 @@ examples:
66
67
  - dropdown_quickpick_default_dates: Quick Pick Variant (Default Dates)
67
68
  - dropdown_quickpick_custom: Quick Pick Variant (Custom Quick Pick Dates)
68
69
  - dropdown_quickpick_with_date_pickers: Quick Pick Variant with Date Pickers
69
-
70
-
70
+ - dropdown_required_indicator: Required Indicator
@@ -30,4 +30,5 @@ export { default as DropdownQuickpickDefaultDates } from './_dropdown_quickpick_
30
30
  export { default as DropdownQuickpickWithDatePickers } from './_dropdown_quickpick_with_date_pickers.jsx'
31
31
  export { default as DropdownQuickpickCustom } from './_dropdown_quickpick_custom.jsx'
32
32
  export { default as DropdownWithClearable } from './_dropdown_with_clearable.jsx'
33
- export { default as DropdownWithConstrainHeight } from './_dropdown_with_constrain_height.jsx'
33
+ export { default as DropdownWithConstrainHeight } from './_dropdown_with_constrain_height.jsx'
34
+ export { default as DropdownRequiredIndicator } from "./_dropdown_required_indicator.jsx";
@@ -1,3 +1,11 @@
1
+ <%
2
+ example_dropdown_options = [
3
+ { label: 'United States', value: 'United States', id: 'us' },
4
+ { label: 'Canada', value: 'Canada', id: 'ca' },
5
+ { label: 'Pakistan', value: 'Pakistan', id: 'pk' }
6
+ ]
7
+ %>
8
+
1
9
  <%= pb_form_with(scope: :example, url: "", method: :get, validate: true) do |form| %>
2
10
  <%= form.typeahead :example_typeahead_field, props: { label: true, required: true, required_indicator: true } %>
3
11
  <%= form.text_field :example_text_field, props: { label: true, required: true, required_indicator: true } %>
@@ -12,6 +20,8 @@
12
20
  <%= form.text_area :example_text_area_2, props: { label: "Textarea Custom Label", required: true, required_indicator: true } %>
13
21
  <%# <%= form.check_box :example_checkbox, props: { label: true, text: "Checkbox Label", required: true, required_indicator: true } %>
14
22
  <%= form.time_picker :example_time_picker_required_indicator, props: { label: true, required: true, required_indicator: true } %>
23
+ <%= form.dropdown_field :example_dropdown, props: { label: true, options: example_dropdown_options, required: true, required_indicator: true } %>
24
+ <%= form.dropdown_field :example_dropdown_2, props: { label: "Dropdown Custom Label", options: example_dropdown_options, required: true, required_indicator: true } %>
15
25
 
16
26
  <%= form.actions do |action| %>
17
27
  <%= action.submit %>
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.testingrailsfix14159
4
+ version: 16.1.0.pre.alpha.2726requiredindicatorpropdropdown14179
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -894,6 +894,9 @@ files:
894
894
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers_default_rails.md
895
895
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers_rails.html.erb
896
896
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers_rails.md
897
+ - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_required_indicator.html.erb
898
+ - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_required_indicator.jsx
899
+ - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_required_indicator.md
897
900
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_separators_hidden.html.erb
898
901
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_separators_hidden.jsx
899
902
  - app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure.jsx