playbook_ui_docs 16.5.0.pre.rc.5 → 16.6.0.pre.alpha.RTEPOC15801
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_button/docs/{_button_loading.html.erb → _button_loading_rails.html.erb} +5 -5
- data/app/pb_kits/playbook/pb_button/docs/_button_loading_rails.md +3 -0
- data/app/pb_kits/playbook/pb_button/docs/example.yml +1 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_dialog_submission.jsx +62 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_dialog_submission.md +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +5 -5
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validation_msg.html.erb +90 -0
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validation_msg.md +13 -0
- data/app/pb_kits/playbook/pb_form/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_rails_default.html.erb +1 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_rails_default.md +12 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_rails_simple.html.erb +9 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_rails_simple.md +8 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_createable.html.erb +29 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_createable.md +1 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +1 -0
- metadata +14 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d14ea2a71d5d146173907999dea08fb898f880c1b5761fbe6f1c6ca1a9d7533b
|
|
4
|
+
data.tar.gz: 5293a0f97723a83ac0d989e578fd96363ab587c86f543b2704a9d912530bb0f6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 119cc36000b349187af3d486eb28e5b1156054a56cddfbf2b55fc1167ef5d76c4082e24c472f65be6a9767285d96bb1f180344259d4077699b7ab37f86d38913
|
|
7
|
+
data.tar.gz: 41a756a6db3f323db459a31bd632e93352561d11284510d568dc3added1fd238e561935466cf8d60862451c3ccf79269fe9c04307e30f41e0864d45bc8f79f68
|
data/app/pb_kits/playbook/pb_button/docs/{_button_loading.html.erb → _button_loading_rails.html.erb}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<%= pb_rails("caption", props: { margin_y: "md", text: "Button variants with loading" }) %>
|
|
2
|
-
<%= pb_rails("button", props: { aria: { label: "Loading" }, loading: true, margin_right: "lg" }) %>
|
|
3
|
-
<%= pb_rails("button", props: { aria: { label: "Loading" }, variant: "secondary", loading: true, margin_right: "lg" }) %>
|
|
4
|
-
<%= pb_rails("button", props: { aria: { label: "Loading" }, variant: "link", loading: true, margin_right: "lg" }) %>
|
|
2
|
+
<%= pb_rails("button", props: { aria: { label: "Loading" }, loading: true, text: "Loading", margin_right: "lg" }) %>
|
|
3
|
+
<%= pb_rails("button", props: { aria: { label: "Loading" }, variant: "secondary", loading: true, text: "Loading", margin_right: "lg" }) %>
|
|
4
|
+
<%= pb_rails("button", props: { aria: { label: "Loading" }, variant: "link", loading: true, text: "Loading", margin_right: "lg" }) %>
|
|
5
5
|
<%= pb_rails("caption", props: { margin_y: "md", text: "Button sizes with loading" }) %>
|
|
6
|
-
<%= pb_rails("button", props: { aria: { label: "Loading" }, loading: true, size: "sm", margin_right: "lg" }) %>
|
|
7
|
-
<%= pb_rails("button", props: { aria: { label: "Loading" }, loading: true, size: "lg", margin_right: "lg" }) %>
|
|
6
|
+
<%= pb_rails("button", props: { aria: { label: "Loading" }, loading: true, size: "sm", text: "Loading", margin_right: "lg" }) %>
|
|
7
|
+
<%= pb_rails("button", props: { aria: { label: "Loading" }, loading: true, size: "lg", text: "Loading", margin_right: "lg" }) %>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
Used when a button will take a little while to load. The spinner lets the user know that the button has worked and it is in the process of loading.
|
|
2
|
+
|
|
3
|
+
**NOTE**: In Rails, both the button text and loading spinner are rendered at the same time, and visibility is toggled between them. Even though the text prop is not required, providing it ensures the button maintains its correct shape during loading.
|
|
@@ -4,7 +4,7 @@ examples:
|
|
|
4
4
|
- button_reaction: Reaction Button
|
|
5
5
|
- button_full_width: Button Full Width
|
|
6
6
|
- button_link: Button Links
|
|
7
|
-
-
|
|
7
|
+
- button_loading_rails: Button Loading
|
|
8
8
|
- button_block_content: Button Block Content
|
|
9
9
|
- button_icon_options: Button Icon Options
|
|
10
10
|
- button_accessibility: Button Accessibility Options
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import { Button, Dialog, DatePicker } from "playbook-ui";
|
|
3
|
+
|
|
4
|
+
const DatePickerDialogSubmission = () => {
|
|
5
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
6
|
+
const [dateFixed, setDateFixed] = useState("");
|
|
7
|
+
const [pickerInstance, setPickerInstance] = useState(0);
|
|
8
|
+
|
|
9
|
+
const close = (clearDate = false) => {
|
|
10
|
+
if (clearDate) setDateFixed("");
|
|
11
|
+
setIsOpen(false);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const open = () => {
|
|
15
|
+
setPickerInstance((current) => current + 1);
|
|
16
|
+
setIsOpen(true);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const handleSubmit = () => {
|
|
20
|
+
if (!dateFixed.trim()) return;
|
|
21
|
+
close();
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<>
|
|
26
|
+
<Button
|
|
27
|
+
onClick={open}
|
|
28
|
+
text="Open Dialog"
|
|
29
|
+
/>
|
|
30
|
+
<Dialog
|
|
31
|
+
onClose={() => close(true)}
|
|
32
|
+
opened={isOpen}
|
|
33
|
+
size="md"
|
|
34
|
+
title="Date Picker: Dialog Submission Example"
|
|
35
|
+
>
|
|
36
|
+
<Dialog.Body>
|
|
37
|
+
<DatePicker
|
|
38
|
+
defaultDate={dateFixed || undefined}
|
|
39
|
+
key={`fixed-${pickerInstance}`}
|
|
40
|
+
label="Date"
|
|
41
|
+
onChange={(dateStr) => setDateFixed(dateStr || "")}
|
|
42
|
+
pickerId={`datePickerFixed-${pickerInstance}`}
|
|
43
|
+
staticPosition={false}
|
|
44
|
+
/>
|
|
45
|
+
</Dialog.Body>
|
|
46
|
+
<Dialog.Footer>
|
|
47
|
+
<Button
|
|
48
|
+
onClick={handleSubmit}
|
|
49
|
+
text="Submit"
|
|
50
|
+
/>
|
|
51
|
+
<Button
|
|
52
|
+
onClick={() => close(true)}
|
|
53
|
+
text="Cancel"
|
|
54
|
+
variant="link"
|
|
55
|
+
/>
|
|
56
|
+
</Dialog.Footer>
|
|
57
|
+
</Dialog>
|
|
58
|
+
</>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export default DatePickerDialogSubmission;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Use this pattern when a DatePicker lives inside a Dialog and needs to submit a selected value before closing. A unique `key` and `pickerId` will force the datePicker to remount each time the dialog opens.
|
|
@@ -29,3 +29,4 @@ export { default as DatePickerQuickPickDefaultDate } from './_date_picker_quick_
|
|
|
29
29
|
export { default as DatePickerRangePattern } from './_date_picker_range_pattern'
|
|
30
30
|
export { default as DatePickerAndDropdownRange } from './_date_picker_and_dropdown_range.jsx'
|
|
31
31
|
export { default as DatePickerRequiredIndicator } from "./_date_picker_required_indicator.jsx";
|
|
32
|
+
export { default as DatePickerDialogSubmission } from "./_date_picker_dialog_submission.jsx";
|
|
@@ -97,8 +97,8 @@
|
|
|
97
97
|
}] %>
|
|
98
98
|
|
|
99
99
|
<%= pb_form_with(scope: :example, method: :get, url: "", validate: true) do |form| %>
|
|
100
|
-
<%= form.typeahead :example_typeahead_validation, props: { data: { typeahead_example2: true, user: {} }, label: true, placeholder: "Search for a user", required: true
|
|
101
|
-
<%= form.typeahead :example_typeahead_validation_react, props: { options: example_typeahead_options, pills: true, label: "Example Typeahead (React Rendered)", placeholder: "Search for a user", required: true
|
|
100
|
+
<%= form.typeahead :example_typeahead_validation, props: { data: { typeahead_example2: true, user: {} }, label: true, placeholder: "Search for a user", required: true } %>
|
|
101
|
+
<%= form.typeahead :example_typeahead_validation_react, props: { options: example_typeahead_options, pills: true, label: "Example Typeahead (React Rendered)", placeholder: "Search for a user", required: true } %>
|
|
102
102
|
<%= form.typeahead :example_typeahead_validation_react_2, props: { options: example_typeahead_options, pills: true, label: "Example Typeahead 2 (React Rendered)", placeholder: "Search for a user", required: true } %>
|
|
103
103
|
<%= form.text_field :example_text_field_validation, props: { label: true, required: true } %>
|
|
104
104
|
<%= form.phone_number_field :example_phone_number_field_validation, props: { label: "Example phone field", hidden_inputs: true, required: true } %>
|
|
@@ -110,14 +110,14 @@
|
|
|
110
110
|
<%= form.text_area :example_text_area_validation, props: { label: true, required: true } %>
|
|
111
111
|
<%= form.dropdown_field :example_dropdown_validation, props: { label: true, options: example_dropdown_options, required: true } %>
|
|
112
112
|
<%= form.dropdown_field :example_dropdown_validation_multi, props: { label: true, options: example_dropdown_options, multi_select: true, required: true } %>
|
|
113
|
-
<%= form.select :example_select_validation, [ ["Yes", 1], ["No", 2] ], props: { label: true, blank_selection: "Select One...", required: true
|
|
113
|
+
<%= form.select :example_select_validation, [ ["Yes", 1], ["No", 2] ], props: { label: true, blank_selection: "Select One...", required: true } %>
|
|
114
114
|
<%= form.collection_select :example_collection_select_validation, example_collection, :value, :name, props: { label: true, blank_selection: "Select One...", required: true } %>
|
|
115
115
|
<%= form.check_box :example_checkbox_validation, props: { text: "Example Checkbox Validation", label: true, required: true }, checked_value: "1", unchecked_value: "0" %>
|
|
116
|
-
<%= form.date_picker :example_date_picker_2, props: { label: true, required: true,
|
|
116
|
+
<%= form.date_picker :example_date_picker_2, props: { label: true, required: true, allow_input: true } %>
|
|
117
117
|
<%= form.star_rating_field :example_star_rating_validation, props: { variant: "interactive", label: true, required: true } %>
|
|
118
118
|
<%= form.time_zone_select_field :example_time_zone_select, ActiveSupport::TimeZone.us_zones, { default: "Eastern Time (US & Canada)" }, props: { label: true, blank_selection: "Select a Time Zone...", required: true } %>
|
|
119
119
|
<%= form.multi_level_select :example_multi_level_select, props: { id: "multi-level-select-form", tree_data: treeData, margin_bottom: "sm", required: true, label: "Example Multi Level Select field" } %>
|
|
120
|
-
<%= form.time_picker :example_time_picker_validation, props: { label: true, required: true
|
|
120
|
+
<%= form.time_picker :example_time_picker_validation, props: { label: true, required: true } %>
|
|
121
121
|
|
|
122
122
|
<%= form.actions do |action| %>
|
|
123
123
|
<%= action.submit %>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<%
|
|
2
|
+
example_collection = [
|
|
3
|
+
OpenStruct.new(name: "Alabama", value: 1),
|
|
4
|
+
OpenStruct.new(name: "Alaska", value: 2),
|
|
5
|
+
OpenStruct.new(name: "Arizona", value: 3),
|
|
6
|
+
OpenStruct.new(name: "Arkansas", value: 4),
|
|
7
|
+
OpenStruct.new(name: "California", value: 5),
|
|
8
|
+
OpenStruct.new(name: "Colorado", value: 6),
|
|
9
|
+
OpenStruct.new(name: "Connecticut", value: 7),
|
|
10
|
+
OpenStruct.new(name: "Delaware", value: 8),
|
|
11
|
+
OpenStruct.new(name: "Florida", value: 9),
|
|
12
|
+
OpenStruct.new(name: "Georgia", value: 10),
|
|
13
|
+
]
|
|
14
|
+
%>
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
<%
|
|
18
|
+
example_typeahead_options = [
|
|
19
|
+
{ label: 'Orange', value: '#FFA500' },
|
|
20
|
+
{ label: 'Red', value: '#FF0000' },
|
|
21
|
+
{ label: 'Green', value: '#00FF00' },
|
|
22
|
+
{ label: 'Blue', value: '#0000FF' },
|
|
23
|
+
]
|
|
24
|
+
%>
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
<%= pb_form_with(scope: :example, method: :get, url: "", validate: true) do |form| %>
|
|
28
|
+
<%= form.text_field :example_text_field_validation_msg, props: { label: "Text Field With Validation Message", required: true, validation: { message: "I am a custom validation message for text field." } } %>
|
|
29
|
+
<%= form.typeahead :example_typeahead_validation_msg, props: { data: { typeahead_example_msg: true, user: {} }, label: "Typeahead With Validation Message", placeholder: "Search for a user", required: true, validation: { message: "I am a custom validation message for typeahead." } } %>
|
|
30
|
+
<%= form.typeahead :example_typeahead_validation_react_msg, props: { options: example_typeahead_options, pills: true, label: "Typeahead With Validation Message (React Rendered)", placeholder: "Search for a color", required: true, validation: { message: "I am a custom validation message for React typeahead." } } %>
|
|
31
|
+
<%= form.select :example_select_validation_msg, [ ["Yes", 1], ["No", 2] ], props: { label: true, blank_selection: "Select One...", required: true, validation_message: "I am a custom validation message for select." } %>
|
|
32
|
+
<%= form.collection_select :example_collection_select_validation_msg, example_collection, :value, :name, props: { label: "Collection Select With Validation Message", blank_selection: "Select a State...", required: true, validation_message: "I am a custom validation message for collection select." } %>
|
|
33
|
+
<%= form.date_picker :example_date_picker_validation_msg, props: { label: "Date Picker With Validation Message", required: true, validation_message: "I am a custom validation message for date picker.", allow_input: true } %>
|
|
34
|
+
<%= form.time_picker :example_time_picker_validation_msg, props: { label: "Time Picker With Validation Message", required: true, validation_message: "I am a custom validation message for time picker." } %>
|
|
35
|
+
|
|
36
|
+
<%= form.actions do |action| %>
|
|
37
|
+
<%= action.submit %>
|
|
38
|
+
<%= action.button props: { type: "reset", text: "Cancel", variant: "secondary" } %>
|
|
39
|
+
<% end %>
|
|
40
|
+
<% end %>
|
|
41
|
+
|
|
42
|
+
<!-- form.typeahead user results example template -->
|
|
43
|
+
<template data-typeahead-example-result-option>
|
|
44
|
+
<%= pb_rails("user", props: {
|
|
45
|
+
name: tag(:slot, name: "name"),
|
|
46
|
+
orientation: "horizontal",
|
|
47
|
+
align: "left",
|
|
48
|
+
avatar_url: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGP6zwAAAgcBApocMXEAAAAASUVORK5CYII=",
|
|
49
|
+
avatar: true
|
|
50
|
+
}) %>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<!-- form.typeahead JS example implementation -->
|
|
54
|
+
<%= javascript_tag defer: "defer" do %>
|
|
55
|
+
document.addEventListener("pb-typeahead-kit-search", function(event) {
|
|
56
|
+
if (!event.target.dataset || !event.target.dataset.typeaheadExampleMsg) return
|
|
57
|
+
|
|
58
|
+
fetch(`https://api.github.com/search/users?q=${encodeURIComponent(event.detail.searchingFor)}`)
|
|
59
|
+
.then(response => response.json())
|
|
60
|
+
.then((result) => {
|
|
61
|
+
const resultOptionTemplate = document.querySelector("[data-typeahead-example-result-option]")
|
|
62
|
+
|
|
63
|
+
event.detail.setResults((result.items || []).map((user) => {
|
|
64
|
+
const wrapper = resultOptionTemplate.content.cloneNode(true)
|
|
65
|
+
wrapper.children[0].dataset.user = JSON.stringify(user)
|
|
66
|
+
wrapper.querySelector('slot[name="name"]').replaceWith(user.login)
|
|
67
|
+
wrapper.querySelector('img').dataset.src = user.avatar_url
|
|
68
|
+
return wrapper
|
|
69
|
+
}))
|
|
70
|
+
})
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
document.addEventListener("pb-typeahead-kit-result-option-selected", function(event) {
|
|
75
|
+
if (!event.target.dataset.typeaheadExampleMsg) return
|
|
76
|
+
|
|
77
|
+
const selectedUserJSON = event.detail.selected.firstElementChild.dataset.user
|
|
78
|
+
const selectedUserData = JSON.parse(selectedUserJSON)
|
|
79
|
+
|
|
80
|
+
// set the input field's value
|
|
81
|
+
event.target.querySelector('input[name=example_typeahead_validation_msg]').value = selectedUserData.login
|
|
82
|
+
|
|
83
|
+
// log the selected option's dataset
|
|
84
|
+
console.log('The selected user data:')
|
|
85
|
+
console.dir(selectedUserData)
|
|
86
|
+
|
|
87
|
+
// do even more with the data later - TBD
|
|
88
|
+
event.target.dataset.user = selectedUserJSON
|
|
89
|
+
})
|
|
90
|
+
<% end %>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Custom validation messages allow you to override the browser's default validation text with your own messaging. This provides a better user experience by giving specific, actionable feedback.
|
|
2
|
+
|
|
3
|
+
**Text-based inputs** (TextInput, Typeahead) use the `validation` prop with a `message` key:
|
|
4
|
+
```ruby
|
|
5
|
+
validation: { message: "Please enter a valid email address." }
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
**Selection-based inputs** (Select, DatePicker, TimePicker) use the `validation_message` prop:
|
|
9
|
+
```ruby
|
|
10
|
+
validation_message: "Please select an option."
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
When a required field is left empty or fails validation, your custom message will display instead of the generic browser default.
|
|
@@ -3,5 +3,6 @@ examples:
|
|
|
3
3
|
rails:
|
|
4
4
|
- form_form_with: Default
|
|
5
5
|
- form_form_with_validate: Default + Validation
|
|
6
|
+
- form_form_with_validation_msg: Validation + Custom Validation Message
|
|
6
7
|
- form_form_with_loading: Default + Loading
|
|
7
8
|
- form_with_required_indicator: With Optional Required Indicator
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= pb_rails("rich_text_editor", props: { input_options: { id: 'hidden_input_id', name: "hidden_input_name" }, value: "Add your text here. You can format your text, add links, quotes, and bullets." }) %>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
The Rails rich text editor is a TipTap surface with no React. The UI (toolbar, block-style menu, formatting actions) is rendered with Playbook Rails kits (`pb_rails`). The editor document is a vanilla TipTap `Editor` instance; HTML is synced to a hidden `<input>` so standard Rails forms can submit the value.
|
|
2
|
+
|
|
3
|
+
### How TipTap is loaded (Rails)
|
|
4
|
+
|
|
5
|
+
- The kit ships an `importmap` in the ERB template that maps `@tiptap/*` and ProseMirror packages to ES module URLs on a CDN (see `rich_text_editor.html.erb`). A small `type="module"` script `import()`s `@tiptap/core`, `@tiptap/starter-kit`, `@tiptap/extension-link`, and related modules at runtime.
|
|
6
|
+
- You do not need to add TipTap to your app’s npm dependencies or Gemfile for this kit to work out of the box—the browser loads those modules from the CDN when the page runs.
|
|
7
|
+
- Your app must support import maps and ES modules in the browser (modern browsers; ensure CSP allows the CDN if you lock scripts down).
|
|
8
|
+
|
|
9
|
+
### Relation to the React implementation
|
|
10
|
+
|
|
11
|
+
- Same core: both use TipTap v2 on top of ProseMirror; styling lives in Playbook SCSS (`_tiptap_styles.scss`) so the editor chrome lines up between platforms.
|
|
12
|
+
- Different shell: Rails uses ERB + Playbook Rails components + inline module script. React uses `RichTextEditor` / `_tiptap_editor.tsx` and TipTap wired through the bundled Playbook React package—see Advanced Default for that stack and when you need TipTap installed in your JavaScript bundle.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
### Simple toolbar (`simple: true`)
|
|
2
|
+
|
|
3
|
+
Pass **`simple: true`** for a compact toolbar: **Bold**, **Italic**, **Undo**, and **Redo** (same history controls as the full toolbar—plain buttons, not popovers).
|
|
4
|
+
|
|
5
|
+
- No block-style dropdown (no “Paragraph” / headings / lists in the menu).
|
|
6
|
+
- No **`pb_popover`** on the toolbar—useful in **native `<dialog>`** modals, turbo-loaded panels, or other tight layouts where the full block menu is awkward to position.
|
|
7
|
+
|
|
8
|
+
The underlying TipTap document still accepts the same HTML as the default Rails editor; `simple` only changes which **toolbar controls** are shown.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<%
|
|
2
|
+
options = [
|
|
3
|
+
{ label: 'Orange', value: '#FFA500' },
|
|
4
|
+
{ label: 'Red', value: '#FF0000' },
|
|
5
|
+
{ label: 'Green', value: '#00FF00' },
|
|
6
|
+
{ label: 'Blue', value: '#0000FF' },
|
|
7
|
+
]
|
|
8
|
+
%>
|
|
9
|
+
|
|
10
|
+
<%= pb_rails("typeahead", props: {
|
|
11
|
+
id: "typeahead-creatable",
|
|
12
|
+
placeholder: "All Colors",
|
|
13
|
+
options: options,
|
|
14
|
+
label: "Colors",
|
|
15
|
+
name: :foo,
|
|
16
|
+
createable: true,
|
|
17
|
+
pills: true,
|
|
18
|
+
})
|
|
19
|
+
%>
|
|
20
|
+
|
|
21
|
+
<%= javascript_tag defer: "defer" do %>
|
|
22
|
+
document.addEventListener("pb-typeahead-kit-typeahead-creatable-result-option-select", function(event) {
|
|
23
|
+
console.log('Single Option selected')
|
|
24
|
+
console.dir(event.detail)
|
|
25
|
+
})
|
|
26
|
+
document.addEventListener("pb-typeahead-kit-typeahead-creatable-result-clear", function() {
|
|
27
|
+
console.log('All options cleared')
|
|
28
|
+
})
|
|
29
|
+
<% end %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
The `createable` prop allows users to create new options by typing a value that doesn't exist in the options list.
|
|
@@ -11,6 +11,7 @@ examples:
|
|
|
11
11
|
- typeahead_with_pills_async_users: With Pills (Async Data w/ Users)
|
|
12
12
|
- typeahead_inline: Inline
|
|
13
13
|
- typeahead_multi_kit: Multi Kit Options
|
|
14
|
+
- typeahead_createable: Createable
|
|
14
15
|
- typeahead_error_state: Error State
|
|
15
16
|
- typeahead_margin_bottom: Margin Bottom
|
|
16
17
|
- typeahead_with_pills_color: With Pills (Custom Color)
|
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.
|
|
4
|
+
version: 16.6.0.pre.alpha.RTEPOC15801
|
|
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-04-
|
|
12
|
+
date: 2026-04-16 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: playbook_ui
|
|
@@ -328,9 +328,10 @@ files:
|
|
|
328
328
|
- app/pb_kits/playbook/pb_button/docs/_button_link.html.erb
|
|
329
329
|
- app/pb_kits/playbook/pb_button/docs/_button_link.jsx
|
|
330
330
|
- app/pb_kits/playbook/pb_button/docs/_button_link.md
|
|
331
|
-
- app/pb_kits/playbook/pb_button/docs/_button_loading.html.erb
|
|
332
331
|
- app/pb_kits/playbook/pb_button/docs/_button_loading.jsx
|
|
333
332
|
- app/pb_kits/playbook/pb_button/docs/_button_loading.md
|
|
333
|
+
- app/pb_kits/playbook/pb_button/docs/_button_loading_rails.html.erb
|
|
334
|
+
- app/pb_kits/playbook/pb_button/docs/_button_loading_rails.md
|
|
334
335
|
- app/pb_kits/playbook/pb_button/docs/_button_managed_disabled.html.erb
|
|
335
336
|
- app/pb_kits/playbook/pb_button/docs/_button_managed_disabled.md
|
|
336
337
|
- app/pb_kits/playbook/pb_button/docs/_button_managed_disabled_helper.html.erb
|
|
@@ -599,6 +600,8 @@ files:
|
|
|
599
600
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.html.erb
|
|
600
601
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.jsx
|
|
601
602
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.md
|
|
603
|
+
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_dialog_submission.jsx
|
|
604
|
+
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_dialog_submission.md
|
|
602
605
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_disabled.html.erb
|
|
603
606
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_disabled.jsx
|
|
604
607
|
- app/pb_kits/playbook/pb_date_picker/docs/_date_picker_error.html.erb
|
|
@@ -1118,6 +1121,8 @@ files:
|
|
|
1118
1121
|
- app/pb_kits/playbook/pb_form/docs/_form_form_with_loading.md
|
|
1119
1122
|
- app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb
|
|
1120
1123
|
- app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.md
|
|
1124
|
+
- app/pb_kits/playbook/pb_form/docs/_form_form_with_validation_msg.html.erb
|
|
1125
|
+
- app/pb_kits/playbook/pb_form/docs/_form_form_with_validation_msg.md
|
|
1121
1126
|
- app/pb_kits/playbook/pb_form/docs/_form_with_required_indicator.html.erb
|
|
1122
1127
|
- app/pb_kits/playbook/pb_form/docs/_form_with_required_indicator.md
|
|
1123
1128
|
- app/pb_kits/playbook/pb_form/docs/example.yml
|
|
@@ -1997,6 +2002,10 @@ files:
|
|
|
1997
2002
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_default.md
|
|
1998
2003
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_more_extensions.jsx
|
|
1999
2004
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_more_extensions.md
|
|
2005
|
+
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_rails_default.html.erb
|
|
2006
|
+
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_rails_default.md
|
|
2007
|
+
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_rails_simple.html.erb
|
|
2008
|
+
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_rails_simple.md
|
|
2000
2009
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_toolbar_disabled.jsx
|
|
2001
2010
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_toolbar_disabled.md
|
|
2002
2011
|
- app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml
|
|
@@ -2622,7 +2631,9 @@ files:
|
|
|
2622
2631
|
- app/pb_kits/playbook/pb_typeahead/docs/_description.md
|
|
2623
2632
|
- app/pb_kits/playbook/pb_typeahead/docs/_footer.md
|
|
2624
2633
|
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_async_createable.jsx
|
|
2634
|
+
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_createable.html.erb
|
|
2625
2635
|
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_createable.jsx
|
|
2636
|
+
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_createable.md
|
|
2626
2637
|
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_menu_list.jsx
|
|
2627
2638
|
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_options.html.erb
|
|
2628
2639
|
- app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_options.jsx
|