playbook_ui_docs 16.10.0.pre.alpha.PLAY3032dropdowndisabledinput17361 → 16.10.0.pre.alpha.PLAY3053advancedtablebottompinnedrowsreact17469

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.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows.jsx +19 -2
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_react.md +2 -2
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -1
  5. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_custom_display_disabled_option.html.erb +93 -0
  6. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_custom_display_disabled_option.jsx +127 -0
  7. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_custom_display_disabled_option.md +1 -0
  8. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_disabled_option.html.erb +10 -0
  9. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_disabled_option.jsx +37 -0
  10. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_disabled_option.md +1 -0
  11. data/app/pb_kits/playbook/pb_dropdown/docs/_playground.json +149 -237
  12. data/app/pb_kits/playbook/pb_dropdown/docs/_playground.overrides.json +58 -74
  13. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +4 -0
  14. data/app/pb_kits/playbook/pb_dropdown/docs/index.js +2 -0
  15. data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_remove_replace.html.erb +66 -0
  16. data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_remove_replace.jsx +53 -0
  17. data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_remove_replace.md +5 -0
  18. data/app/pb_kits/playbook/pb_file_upload/docs/example.yml +3 -1
  19. data/app/pb_kits/playbook/pb_file_upload/docs/index.js +1 -0
  20. data/app/pb_kits/playbook/pb_form_group/docs/_playground.json +100 -1
  21. data/app/pb_kits/playbook/pb_form_group/docs/_playground.overrides.json +91 -0
  22. data/app/pb_kits/playbook/pb_full_screen/docs/_description.md +1 -0
  23. data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_content_padding.jsx +68 -0
  24. data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_content_padding.md +1 -0
  25. data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_custom_trigger.jsx +71 -0
  26. data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_custom_trigger.md +1 -0
  27. data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_default.html.erb +3 -0
  28. data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_default.jsx +63 -0
  29. data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_default.md +1 -0
  30. data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_header_text_styling.jsx +68 -0
  31. data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_header_text_styling.md +1 -0
  32. data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_sticky_header.jsx +68 -0
  33. data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_sticky_header.md +1 -0
  34. data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_table_and_filter.jsx +149 -0
  35. data/app/pb_kits/playbook/pb_full_screen/docs/_full_screen_table_and_filter.md +1 -0
  36. data/app/pb_kits/playbook/pb_full_screen/docs/_playground.json +155 -0
  37. data/app/pb_kits/playbook/pb_full_screen/docs/_playground.overrides.json +137 -0
  38. data/app/pb_kits/playbook/pb_full_screen/docs/example.yml +14 -0
  39. data/app/pb_kits/playbook/pb_full_screen/docs/index.js +6 -0
  40. data/app/pb_kits/playbook/pb_icon/docs/_playground.json +2 -16
  41. data/app/pb_kits/playbook/pb_icon/docs/_playground.overrides.json +2 -13
  42. data/app/pb_kits/playbook/pb_layout/docs/_playground.json +246 -1
  43. data/app/pb_kits/playbook/pb_layout/docs/_playground.overrides.json +188 -0
  44. data/app/pb_kits/playbook/pb_progress_pills/docs/_playground.json +26 -13
  45. data/app/pb_kits/playbook/pb_progress_pills/docs/_playground.overrides.json +24 -6
  46. data/app/pb_kits/playbook/pb_progress_simple/docs/_playground.json +50 -17
  47. data/app/pb_kits/playbook/pb_progress_simple/docs/_playground.overrides.json +41 -7
  48. data/app/pb_kits/playbook/pb_progress_step/docs/_playground.json +218 -1
  49. data/app/pb_kits/playbook/pb_progress_step/docs/_playground.overrides.json +189 -0
  50. data/app/pb_kits/playbook/pb_radio/docs/_playground.json +80 -6
  51. data/app/pb_kits/playbook/pb_radio/docs/_playground.overrides.json +82 -3
  52. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_playground.json +171 -1
  53. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_playground.overrides.json +153 -0
  54. data/app/pb_kits/playbook/pb_select/docs/_playground.json +65 -19
  55. data/app/pb_kits/playbook/pb_select/docs/_playground.overrides.json +54 -14
  56. data/app/pb_kits/playbook/pb_selectable_card/docs/_playground.json +75 -82
  57. data/app/pb_kits/playbook/pb_selectable_card/docs/_playground.overrides.json +76 -76
  58. data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_playground.json +128 -1
  59. data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_playground.overrides.json +106 -0
  60. data/app/pb_kits/playbook/pb_selectable_icon/docs/_playground.json +37 -21
  61. data/app/pb_kits/playbook/pb_selectable_icon/docs/_playground.overrides.json +35 -18
  62. data/app/pb_kits/playbook/pb_selectable_list/docs/_playground.json +174 -12
  63. data/app/pb_kits/playbook/pb_selectable_list/docs/_playground.overrides.json +162 -10
  64. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_playground.json +92 -1
  65. data/app/pb_kits/playbook/pb_skeleton_loading/docs/_playground.overrides.json +80 -0
  66. data/app/pb_kits/playbook/pb_source/docs/_playground.json +88 -1
  67. data/app/pb_kits/playbook/pb_source/docs/_playground.overrides.json +80 -0
  68. data/app/pb_kits/playbook/pb_star_rating/docs/_playground.json +28 -53
  69. data/app/pb_kits/playbook/pb_star_rating/docs/_playground.overrides.json +33 -32
  70. data/app/pb_kits/playbook/pb_stat_change/docs/_playground.json +15 -9
  71. data/app/pb_kits/playbook/pb_stat_change/docs/_playground.overrides.json +15 -5
  72. data/app/pb_kits/playbook/pb_stat_value/docs/_playground.json +19 -9
  73. data/app/pb_kits/playbook/pb_stat_value/docs/_playground.overrides.json +18 -7
  74. data/app/pb_kits/playbook/pb_table/docs/_playground.json +259 -1
  75. data/app/pb_kits/playbook/pb_table/docs/_playground.overrides.json +176 -0
  76. data/app/pb_kits/playbook/pb_text_input/docs/_playground.json +44 -5
  77. data/app/pb_kits/playbook/pb_text_input/docs/_playground.overrides.json +39 -3
  78. data/app/pb_kits/playbook/pb_textarea/docs/_playground.json +35 -3
  79. data/app/pb_kits/playbook/pb_textarea/docs/_playground.overrides.json +28 -3
  80. data/app/pb_kits/playbook/pb_time/docs/_playground.json +28 -14
  81. data/app/pb_kits/playbook/pb_time/docs/_playground.overrides.json +26 -13
  82. data/app/pb_kits/playbook/pb_time_picker/docs/_playground.json +36 -30
  83. data/app/pb_kits/playbook/pb_time_picker/docs/_playground.overrides.json +31 -26
  84. data/app/pb_kits/playbook/pb_time_range_inline/docs/_playground.json +86 -1
  85. data/app/pb_kits/playbook/pb_time_range_inline/docs/_playground.overrides.json +69 -0
  86. data/app/pb_kits/playbook/pb_time_stacked/docs/_playground.json +30 -9
  87. data/app/pb_kits/playbook/pb_time_stacked/docs/_playground.overrides.json +30 -9
  88. data/app/pb_kits/playbook/pb_timeline/docs/_playground.json +199 -1
  89. data/app/pb_kits/playbook/pb_timeline/docs/_playground.overrides.json +165 -0
  90. data/app/pb_kits/playbook/pb_timestamp/docs/_playground.json +36 -21
  91. data/app/pb_kits/playbook/pb_timestamp/docs/_playground.overrides.json +35 -20
  92. data/app/pb_kits/playbook/pb_toggle/docs/_playground.json +24 -13
  93. data/app/pb_kits/playbook/pb_toggle/docs/_playground.overrides.json +20 -12
  94. data/app/pb_kits/playbook/pb_tooltip/docs/_playground.json +42 -23
  95. data/app/pb_kits/playbook/pb_tooltip/docs/_playground.overrides.json +35 -15
  96. data/app/pb_kits/playbook/pb_typeahead/docs/_playground.json +124 -44
  97. data/app/pb_kits/playbook/pb_typeahead/docs/_playground.overrides.json +98 -31
  98. data/app/pb_kits/playbook/pb_user/docs/_playground.json +33 -15
  99. data/app/pb_kits/playbook/pb_user/docs/_playground.overrides.json +32 -15
  100. data/app/pb_kits/playbook/pb_user_badge/docs/_playground.json +26 -12
  101. data/app/pb_kits/playbook/pb_user_badge/docs/_playground.overrides.json +26 -9
  102. data/app/pb_kits/playbook/pb_weekday_stacked/docs/_playground.json +32 -5
  103. data/app/pb_kits/playbook/pb_weekday_stacked/docs/_playground.overrides.json +30 -4
  104. metadata +39 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 784db6e54b4c0baf815bdcf9ec1a5c25f815978410880de23ceecd407f185438
4
- data.tar.gz: c585a73f27f6a3f44cc37c39a6800d9f3ccc7e72d39e4581904af9c4bd39d5d6
3
+ metadata.gz: 54da223a58079747e07a434617596364176d18e253953d3538b471b5682514fc
4
+ data.tar.gz: c9ac712cb4fc7704c4d122cf27377c4847d432664f7871a3536104332e85ddfe
5
5
  SHA512:
6
- metadata.gz: 60656f8b4b32c59653f42616194036d630cf0096242ebe97a3d1a2081e182df852ac54ab95b0b9e178e4ac365bdb5fdd444499224dec99cd8278d99beb69f24b
7
- data.tar.gz: a2346f2530a7dc3f04ddc5e130deab34e0ec82fc8063fc8f381c5536db83daf7b2a665a001c41d0fc13513f6426f97b1067c59e911b63dd2166d7b84324ba13e
6
+ metadata.gz: 845a59d6693e7e4c17c38ecc339b30cf06fa815a77e222f40c4521b98a513dfeff8166aaae4f5a7fd35e5ae30e30a271e2d55a6fd7bbbe6197b73428d8f33e52
7
+ data.tar.gz: db593af6693a42cde0cbe0ae239e25890041de12bc1957788210ac2db85a81e48cd499a8997c72e9bb39993c2fc8a039e3343a2e52061eb312c90711a5793333
@@ -1,6 +1,7 @@
1
1
  import React, { useState } from "react"
2
2
  import AdvancedTable from '../_advanced_table'
3
3
  import MOCK_DATA_WITH_ID from "./advanced_table_mock_data_with_id.json"
4
+ import Caption from "../../pb_caption/_caption"
4
5
 
5
6
  const AdvancedTableRowPinning = (props) => {
6
7
  const columnDefinitions = [
@@ -35,14 +36,30 @@ const AdvancedTableRowPinning = (props) => {
35
36
  },
36
37
  ]
37
38
 
38
- const [pinnedRows, setPinnedRows] = useState({top: ["8"]})
39
+ const [pinnedRowsTop, setPinnedRowsTop] = useState({top: ["8"]})
40
+ const [pinnedRowsBottom, setPinnedRowsBottom] = useState({bottom: ["8"]})
39
41
 
40
42
  return (
41
43
  <div>
44
+ <Caption text="Pinned Rows Top" />
42
45
  <AdvancedTable
43
46
  columnDefinitions={columnDefinitions}
44
47
  maxHeight="xs"
45
- pinnedRows={{value: pinnedRows, onChange: setPinnedRows}}
48
+ pinnedRows={{value: pinnedRowsTop, onChange: setPinnedRowsTop}}
49
+ tableData={MOCK_DATA_WITH_ID}
50
+ tableProps={{sticky: true}}
51
+ {...props}
52
+ >
53
+ <AdvancedTable.Header enableSorting />
54
+ <AdvancedTable.Body />
55
+ </AdvancedTable>
56
+ <Caption marginTop="md"
57
+ text="Pinned Rows Bottom"
58
+ />
59
+ <AdvancedTable
60
+ columnDefinitions={columnDefinitions}
61
+ maxHeight="xs"
62
+ pinnedRows={{value: pinnedRowsBottom, onChange: setPinnedRowsBottom}}
46
63
  tableData={MOCK_DATA_WITH_ID}
47
64
  tableProps={{sticky: true}}
48
65
  {...props}
@@ -1,7 +1,7 @@
1
- Use the `pinnedRows` prop to pin specific rows to the top of an Advanced Table. Pinned rows will remain at the top when scrolling through table data and will not change position if sorting is used.
1
+ Use the `pinnedRows` prop to pin specific rows to the top or bottom of an Advanced Table. Pinned rows will remain at the top or bottom when scrolling through table data and will not change position if sorting is used.
2
2
 
3
3
  **NOTE:**
4
4
  - Sticky header required: Pinned rows must be used with `sticky: true` via `tableProps` (works with both responsive and non-responsive tables)
5
5
  - Row ids required: Each object within the `tableData` Array must contain a unique id in order to attach an id to all Rows for this to function.
6
- - `pinnedRows` takes an array of row ids to the `top` property as shown in the code snippet below.
6
+ - `pinnedRows` takes an array of row ids to the `top` or `bottom` property as shown in the code snippet below (both can be used on the same table).
7
7
  - For expandable rows, use the parent id in `pinnedRows`, all its children will automatically be pinned with it. If id for a child is passed in without parent being pinned, nothing will be pinned.
@@ -89,5 +89,4 @@ examples:
89
89
  - advanced_table_column_styling_background_multi: Column Styling Background Color with Multiple Headers
90
90
  - advanced_table_padding_control: Padding Control using Column Styling
91
91
  - advanced_table_column_border_color: Column Group Border Color
92
- - advanced_table_fullscreen: Fullscreen
93
92
  - advanced_table_infinite_scroll: Infinite Scroll
@@ -0,0 +1,93 @@
1
+ <%
2
+ options = [
3
+ {
4
+ label: "Jasper Furniss",
5
+ value: "jasperFurniss",
6
+ territory: "PHL",
7
+ title: "Lead UX Engineer",
8
+ id: "jasper-furniss",
9
+ status: "Offline"
10
+ },
11
+ {
12
+ label: "Ramon Ruiz",
13
+ value: "ramonRuiz",
14
+ territory: "PHL",
15
+ title: "Senior UX Designer",
16
+ id: "ramon-ruiz",
17
+ status: "Unavailable",
18
+ disabled: true
19
+ },
20
+ {
21
+ label: "Carlos Lima",
22
+ value: "carlosLima",
23
+ territory: "PHL",
24
+ title: "Nitro Developer",
25
+ id: "carlos-lima",
26
+ status: "Online"
27
+ },
28
+ {
29
+ label: "Courtney Long",
30
+ value: "courtneyLong",
31
+ territory: "PHL",
32
+ title: "Lead UX Designer",
33
+ id: "courtney-long",
34
+ status: "Online"
35
+ }
36
+ ]
37
+ %>
38
+
39
+ <%
40
+ custom_display = capture do
41
+ pb_rails("flex", props: { align: "center" }) do
42
+ concat(pb_rails("avatar", props: { name: "", size: "xs", id: "dropdown-avatar" }))
43
+ concat(pb_rails("body", props: { text: "", size: "xs", margin_x: "xs", id: "dropdown-avatar-name" }))
44
+ concat(pb_rails("badge", props: { text: "", id: "dropdown-avatar-status" }))
45
+ end
46
+ end
47
+ %>
48
+
49
+ <%= pb_rails("dropdown", props: { id: "user-dropdown-disabled-options", options: options }) do %>
50
+ <%= pb_rails("dropdown/dropdown_trigger", props: { placeholder: "Select a User", custom_display: custom_display }) %>
51
+ <%= pb_rails("dropdown/dropdown_container") do %>
52
+ <% options.each do |option| %>
53
+ <%= pb_rails("dropdown/dropdown_option", props: { option: option }) do %>
54
+ <%= pb_rails("flex", props: { align: "center", justify: "between" }) do %>
55
+ <%= pb_rails("flex/flex_item") do %>
56
+ <%= pb_rails("user", props: { name: option[:label], align: "left", avatar: true, orientation: "horizontal", territory: option[:territory], title: option[:title] }) %>
57
+ <% end %>
58
+ <%= pb_rails("flex/flex_item") do %>
59
+ <%= pb_rails("badge", props: { rounded: true, dark: true, text: option[:status], variant: option[:status] == "Offline" ? "neutral" : option[:status] == "Online" ? "success" : "warning" }) %>
60
+ <% end %>
61
+ <% end %>
62
+ <% end %>
63
+ <% end %>
64
+ <% end %>
65
+ <% end %>
66
+
67
+ <script>
68
+ document.addEventListener("pb:dropdown:selected", (e) => {
69
+ if (e.target.id !== "user-dropdown-disabled-options") return;
70
+
71
+ const option = e.detail;
72
+ const dropdown = e.target;
73
+ const display = dropdown.querySelector("[data-dropdown-trigger-custom-display]");
74
+ if (!display) return;
75
+
76
+ const nameEl = display.querySelector("#dropdown-avatar-name");
77
+ if (nameEl) nameEl.textContent = option.label;
78
+
79
+ const avatarWrapper = display.querySelector("#dropdown-avatar .avatar_wrapper");
80
+ if (avatarWrapper) {
81
+ const initials = (option.label[0] + option.label.split(" ").pop()[0]).toUpperCase();
82
+ avatarWrapper.dataset.name = option.label;
83
+ avatarWrapper.setAttribute("data-initials", initials);
84
+ }
85
+
86
+ const badgeEl = display.querySelector("#dropdown-avatar-status");
87
+ const variant = option.status === "Online" ? "success" : option.status === "Offline" ? "neutral" : "warning";
88
+ if (badgeEl) {
89
+ badgeEl.querySelector("span").textContent = option.status;
90
+ badgeEl.className = `pb_badge_kit_${variant}`;
91
+ }
92
+ });
93
+ </script>
@@ -0,0 +1,127 @@
1
+ import React, { useState } from 'react'
2
+
3
+ import Dropdown from '../../pb_dropdown/_dropdown'
4
+ import Badge from '../../pb_badge/_badge'
5
+ import Flex from '../../pb_flex/_flex'
6
+ import FlexItem from '../../pb_flex/_flex_item'
7
+ import Avatar from '../../pb_avatar/_avatar'
8
+ import User from '../../pb_user/_user'
9
+ import Body from '../../pb_body/_body'
10
+
11
+ const DropdownCustomDisplayDisabledOption = (props) => {
12
+ const [selectedOption, setSelectedOption] = useState();
13
+
14
+ const options = [
15
+ {
16
+ label: "Jasper Furniss",
17
+ value: "jasperFurniss",
18
+ territory: "PHL",
19
+ title: "Lead UX Engineer",
20
+ id: "jasper-furniss",
21
+ status: "Offline"
22
+ },
23
+ {
24
+ label: "Ramon Ruiz",
25
+ value: "ramonRuiz",
26
+ territory: "PHL",
27
+ title: "Senior UX Designer",
28
+ id: "ramon-ruiz",
29
+ status: "Unavailable",
30
+ disabled: true
31
+ },
32
+ {
33
+ label: "Carlos Lima",
34
+ value: "carlosLima",
35
+ territory: "PHL",
36
+ title: "Nitro Developer",
37
+ id: "carlos-lima",
38
+ status: "Online"
39
+ },
40
+ {
41
+ label: "Courtney Long",
42
+ value: "courtneyLong",
43
+ territory: "PHL",
44
+ title: "Lead UX Designer",
45
+ id: "courtney-long",
46
+ status: "Online"
47
+ }
48
+ ];
49
+
50
+ const CustomDisplay = () => {
51
+ return (
52
+ <>
53
+ {
54
+ selectedOption && (
55
+ <Flex align="center">
56
+ <Avatar
57
+ name={selectedOption.label}
58
+ size="xs"
59
+ />
60
+ <Body
61
+ marginX="xs"
62
+ text={selectedOption.label}
63
+ />
64
+ <Badge
65
+ text={selectedOption.status}
66
+ variant={selectedOption.status == "Offline" ? "neutral" : selectedOption.status == "Online" ? "success" : "warning"}
67
+ />
68
+ </Flex>
69
+ )
70
+ }
71
+ </>
72
+ )
73
+ };
74
+
75
+
76
+ return (
77
+ <div>
78
+ <Dropdown
79
+ onSelect={(selectedItem) => setSelectedOption(selectedItem)}
80
+ options={options}
81
+ {...props}
82
+ >
83
+ <Dropdown.Trigger customDisplay={<CustomDisplay/>}
84
+ placeholder="Select a User"
85
+ />
86
+ {options.map((option) => (
87
+ <Dropdown.Option key={option.id}
88
+ option={option}
89
+ >
90
+ <Flex
91
+ align="center"
92
+ justify="between"
93
+ >
94
+ <FlexItem>
95
+ <User
96
+ align="left"
97
+ avatar
98
+ name={option.label}
99
+ orientation="horizontal"
100
+ territory={option.territory}
101
+ title={option.title}
102
+ />
103
+ </FlexItem>
104
+ <FlexItem>
105
+ <Badge dark
106
+ rounded
107
+ text={option.status}
108
+ variant={`${
109
+ option.status === "Offline"
110
+ ? "neutral"
111
+ : option.status === "Unavailable"
112
+ ? "warning"
113
+ : option.status === "Online"
114
+ ? "success"
115
+ : "warning"
116
+ }`}
117
+ />
118
+ </FlexItem>
119
+ </Flex>
120
+ </Dropdown.Option>
121
+ ))}
122
+ </Dropdown>
123
+ </div>
124
+ )
125
+ }
126
+
127
+ export default DropdownCustomDisplayDisabledOption
@@ -0,0 +1 @@
1
+ To disable individual items in the `options`, include `disabled: true` within the object on the option that you want disabled. See the code snippet below for an example of how to do this.
@@ -0,0 +1,10 @@
1
+ <%
2
+ options = [
3
+ { label: "Available Option", value: "available", id: "available-option" },
4
+ { label: "Coming Soon", value: "coming-soon", id: "coming-soon", disabled: true },
5
+ { label: "Another Available", value: "another-available", id: "another-available" },
6
+ { label: "Locked Feature", value: "locked-feature", id: "locked-feature", disabled: true },
7
+ ]
8
+ %>
9
+
10
+ <%= pb_rails("dropdown", props: { label: "Disabled Options", options: options }) %>
@@ -0,0 +1,37 @@
1
+ import React, { useState } from 'react'
2
+
3
+ import Dropdown from '../../pb_dropdown/_dropdown'
4
+ import Caption from '../../pb_caption/_caption'
5
+
6
+ const DropdownDisabledOption = (props) => {
7
+ const [selectedOption, setSelectedOption] = useState()
8
+
9
+ const options = [
10
+ { label: 'Available Option', value: 'available', id: 'available-option' },
11
+ { label: 'Coming Soon', value: 'coming-soon', id: 'coming-soon', disabled: true },
12
+ { label: 'Another Available', value: 'another-available', id: 'another-available' },
13
+ { label: 'Locked Feature', value: 'locked-feature', id: 'locked-feature', disabled: true },
14
+ ]
15
+
16
+ return (
17
+ <div>
18
+ <Caption
19
+ text="Select an option. Disabled options remain visible but cannot be selected."
20
+ />
21
+ <Dropdown
22
+ onSelect={(selectedItem) => setSelectedOption(selectedItem)}
23
+ options={options}
24
+ placeholder="Choose an option"
25
+ {...props}
26
+ />
27
+ {selectedOption && (
28
+ <Caption
29
+ marginTop="xs"
30
+ text={`Selected: ${selectedOption.label}`}
31
+ />
32
+ )}
33
+ </div>
34
+ )
35
+ }
36
+
37
+ export default DropdownDisabledOption
@@ -0,0 +1 @@
1
+ To disable individual items in the `options`, include `disabled: true` within the object on the option that you want disabled. See the code snippet below for an example of how to do this.