playbook_ui_docs 14.4.0.pre.alpha.pbntr523enablekitsforradiofix3826 → 14.4.0.pre.alpha.stephenagreerpatch13908
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_inline.html.erb +1 -1
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.jsx +117 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx +43 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.html.erb +1 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.jsx +63 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx +55 -0
- data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.jsx +113 -0
- data/app/pb_kits/playbook/pb_drawer/docs/example.yml +12 -0
- data/app/pb_kits/playbook/pb_drawer/docs/index.js +5 -0
- data/app/pb_kits/playbook/pb_pagination/docs/_pagination_page_change.jsx +12 -1
- data/app/pb_kits/playbook/pb_pagination/docs/_pagination_page_change_react.md +3 -1
- data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.html.erb +2 -0
- data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.jsx +5 -2
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_margin_bottom.html.erb +88 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_margin_bottom.jsx +60 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/index.js +1 -0
- data/dist/playbook-doc.js +1 -1
- metadata +12 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8352a52dd5cf61ddbd3878e9ec53b2a8ab7fb12415e9d19ec69c97647fdde964
|
4
|
+
data.tar.gz: 8118e67afbdf555e4ed7476a6301db25368674d3e22b4efd2c6a5811231c5682
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1755b58ae47308b01bfc77dd6f086faba7e92165328a0e25b1dd568744455cc3524115f3383d2ba60848f7a7590ecb1e90d321ada11d505954143aa34d6b1864
|
7
|
+
data.tar.gz: 580513ee60a62f79229a92982d048ce60a228d481391b5db81ea9d066819daefa09a2c99dc7595768d9d260ba94e2e748b142b7f12da553b40845304716be692
|
@@ -0,0 +1,117 @@
|
|
1
|
+
import React, { useState } from "react";
|
2
|
+
import { Button, Drawer, Flex } from "playbook-ui";
|
3
|
+
|
4
|
+
const DrawerBorders = () => {
|
5
|
+
// Individual state variables for each drawer size
|
6
|
+
const [openedBRightDrawer, setOpenedBRightDrawer] = useState(false);
|
7
|
+
const [openedBLeftDrawer, setOpenedBLeftDrawer] = useState(false);
|
8
|
+
const [openedBFullDrawer, setOpenedBFullDrawer] = useState(false);
|
9
|
+
const [openedBDefaultDrawer, setOpenedBDefaultDrawer] = useState(false);
|
10
|
+
const [openedBRoundedDrawer, setOpenedBRoundedDrawer] = useState(false);
|
11
|
+
|
12
|
+
// Toggle functions for each drawer
|
13
|
+
const toggleBRightDrawer = () => setOpenedBRightDrawer(!openedBRightDrawer);
|
14
|
+
const toggleBLeftDrawer = () => setOpenedBLeftDrawer(!openedBLeftDrawer);
|
15
|
+
const toggleBFullDrawer = () => setOpenedBFullDrawer(!openedBFullDrawer);
|
16
|
+
const toggleBDefaultDrawer = () => setOpenedBDefaultDrawer(!openedBDefaultDrawer);
|
17
|
+
const toggleBRoundedDrawer = () => setOpenedBRoundedDrawer(!openedBRoundedDrawer);
|
18
|
+
|
19
|
+
return (
|
20
|
+
<>
|
21
|
+
<Flex padding="md"
|
22
|
+
wrap
|
23
|
+
>
|
24
|
+
<Button marginRight="md"
|
25
|
+
onClick={toggleBRightDrawer}
|
26
|
+
>
|
27
|
+
Drawer with border right
|
28
|
+
</Button>
|
29
|
+
<Button marginRight="md"
|
30
|
+
onClick={toggleBLeftDrawer}
|
31
|
+
>
|
32
|
+
Drawer with border left
|
33
|
+
</Button>
|
34
|
+
<Button marginRight="md"
|
35
|
+
onClick={toggleBFullDrawer}
|
36
|
+
>
|
37
|
+
Drawer with border full
|
38
|
+
</Button>
|
39
|
+
<Button marginRight="md"
|
40
|
+
onClick={toggleBDefaultDrawer}
|
41
|
+
>
|
42
|
+
Default Drawer
|
43
|
+
</Button>
|
44
|
+
<Button marginRight="md"
|
45
|
+
onClick={toggleBRoundedDrawer}
|
46
|
+
>
|
47
|
+
Rounded Drawer
|
48
|
+
</Button>
|
49
|
+
</Flex>
|
50
|
+
|
51
|
+
{/* Drawers for each size */}
|
52
|
+
<Drawer
|
53
|
+
behavior="float"
|
54
|
+
border="right"
|
55
|
+
fullHeight
|
56
|
+
onClose={toggleBRightDrawer}
|
57
|
+
opened={openedBRightDrawer}
|
58
|
+
overlay={false}
|
59
|
+
placement="left"
|
60
|
+
size="lg"
|
61
|
+
>
|
62
|
+
This is a Drawer with border right
|
63
|
+
</Drawer>
|
64
|
+
<Drawer
|
65
|
+
behavior="float"
|
66
|
+
border="left"
|
67
|
+
fullHeight
|
68
|
+
onClose={toggleBLeftDrawer}
|
69
|
+
opened={openedBLeftDrawer}
|
70
|
+
overlay={false}
|
71
|
+
placement="right"
|
72
|
+
size="lg"
|
73
|
+
>
|
74
|
+
This is a Drawer with border left
|
75
|
+
</Drawer>
|
76
|
+
<Drawer
|
77
|
+
behavior="float"
|
78
|
+
border="full"
|
79
|
+
fullHeight
|
80
|
+
onClose={toggleBFullDrawer}
|
81
|
+
opened={openedBFullDrawer}
|
82
|
+
overlay={false}
|
83
|
+
placement="right"
|
84
|
+
size="lg"
|
85
|
+
>
|
86
|
+
This is a Drawer with border full
|
87
|
+
</Drawer>
|
88
|
+
<Drawer
|
89
|
+
behavior="float"
|
90
|
+
fullHeight
|
91
|
+
onClose={toggleBDefaultDrawer}
|
92
|
+
opened={openedBDefaultDrawer}
|
93
|
+
overlay={false}
|
94
|
+
placement="right"
|
95
|
+
size="lg"
|
96
|
+
>
|
97
|
+
This is a Default Drawer
|
98
|
+
</Drawer>
|
99
|
+
<Drawer
|
100
|
+
behavior="float"
|
101
|
+
borderRadius="rounded"
|
102
|
+
fullHeight
|
103
|
+
onClose={toggleBRoundedDrawer}
|
104
|
+
opened={openedBRoundedDrawer}
|
105
|
+
overlay={false}
|
106
|
+
placement="right"
|
107
|
+
size="lg"
|
108
|
+
>
|
109
|
+
<div style={{ paddingTop: '100px', paddingLeft: '12px' }}>
|
110
|
+
This is a Rounded Drawer
|
111
|
+
</div>
|
112
|
+
</Drawer>
|
113
|
+
</>
|
114
|
+
);
|
115
|
+
};
|
116
|
+
|
117
|
+
export default DrawerBorders;
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import React, { useState } from "react";
|
2
|
+
import { Button, Drawer, Flex } from "playbook-ui";
|
3
|
+
|
4
|
+
const useDrawer = (visible = false) => {
|
5
|
+
const [opened, setOpened] = useState(visible);
|
6
|
+
const toggle = () => setOpened(!opened);
|
7
|
+
|
8
|
+
return [opened, toggle];
|
9
|
+
};
|
10
|
+
|
11
|
+
const DrawerBreakpoints = () => {
|
12
|
+
const [smallDrawerOpened, toggleSmallDrawer] = useDrawer();
|
13
|
+
|
14
|
+
return (
|
15
|
+
<>
|
16
|
+
<Flex wrap>
|
17
|
+
<Button
|
18
|
+
id="sm"
|
19
|
+
marginRight="md"
|
20
|
+
onClick={toggleSmallDrawer}
|
21
|
+
>
|
22
|
+
{"Will open at small breakpoint"}
|
23
|
+
</Button>
|
24
|
+
</Flex>
|
25
|
+
<Flex>
|
26
|
+
<Drawer
|
27
|
+
behavior={"push"}
|
28
|
+
breakpoint="sm"
|
29
|
+
fullHeight
|
30
|
+
onClose={toggleSmallDrawer}
|
31
|
+
opened={smallDrawerOpened}
|
32
|
+
overlay={false}
|
33
|
+
placement={"right"}
|
34
|
+
size={"lg"}
|
35
|
+
>
|
36
|
+
Open because small breakpoint
|
37
|
+
</Drawer>
|
38
|
+
</Flex>
|
39
|
+
</>
|
40
|
+
);
|
41
|
+
};
|
42
|
+
|
43
|
+
export default DrawerBreakpoints;
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= pb_rails("drawer") %>
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import React, { useState } from "react";
|
2
|
+
import { Button, Drawer, Flex } from "playbook-ui";
|
3
|
+
|
4
|
+
const useDrawer = (visible = false) => {
|
5
|
+
const [opened, setOpened] = useState(visible);
|
6
|
+
const toggle = () => setOpened(!opened);
|
7
|
+
|
8
|
+
return [opened, toggle];
|
9
|
+
};
|
10
|
+
|
11
|
+
const DrawerDefault = () => {
|
12
|
+
const [headerSeparatorDrawerOpened, toggleHeaderSeparatorDrawer] = useDrawer();
|
13
|
+
const [bothSeparatorsDrawerOpened, toggleBothSeparatorsDrawer] = useDrawer();
|
14
|
+
|
15
|
+
return (
|
16
|
+
<>
|
17
|
+
<Flex wrap>
|
18
|
+
<Button
|
19
|
+
id="sm"
|
20
|
+
marginRight="md"
|
21
|
+
onClick={toggleHeaderSeparatorDrawer}
|
22
|
+
>
|
23
|
+
{"Left Drawer"}
|
24
|
+
</Button>
|
25
|
+
<Button
|
26
|
+
marginRight="xl"
|
27
|
+
onClick={toggleBothSeparatorsDrawer}
|
28
|
+
>
|
29
|
+
{"Right Drawer"}
|
30
|
+
</Button>
|
31
|
+
</Flex>
|
32
|
+
<Flex>
|
33
|
+
{/* Left Drawer */}
|
34
|
+
<Drawer
|
35
|
+
behavior={"push"}
|
36
|
+
fullHeight
|
37
|
+
onClose={toggleHeaderSeparatorDrawer}
|
38
|
+
opened={headerSeparatorDrawerOpened}
|
39
|
+
overlay
|
40
|
+
placement={"left"}
|
41
|
+
size={"lg"}
|
42
|
+
>
|
43
|
+
Test me (Left Drawer)
|
44
|
+
</Drawer>
|
45
|
+
|
46
|
+
{/* Right Drawer */}
|
47
|
+
<Drawer
|
48
|
+
behavior={"push"}
|
49
|
+
fullHeight
|
50
|
+
onClose={toggleBothSeparatorsDrawer}
|
51
|
+
opened={bothSeparatorsDrawerOpened}
|
52
|
+
overlay
|
53
|
+
placement={"right"}
|
54
|
+
size={"lg"}
|
55
|
+
>
|
56
|
+
Test me (Right Drawer)
|
57
|
+
</Drawer>
|
58
|
+
</Flex>
|
59
|
+
</>
|
60
|
+
);
|
61
|
+
};
|
62
|
+
|
63
|
+
export default DrawerDefault;
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import React, { useState } from "react";
|
2
|
+
import { Button, Drawer, Flex } from "playbook-ui";
|
3
|
+
|
4
|
+
const DrawerSizes = () => {
|
5
|
+
// Individual state variables for each drawer size
|
6
|
+
const [openedNoOverlayDrawer, setOpenedNoOverlayDrawer] = useState(false);
|
7
|
+
const [openedOverlayDrawer, setOpenedOverlayDrawer] = useState(false);
|
8
|
+
|
9
|
+
// Toggle functions for each drawer
|
10
|
+
const toggleNoOverlayDrawer = () => setOpenedNoOverlayDrawer(!openedNoOverlayDrawer);
|
11
|
+
const toggleOverlayDrawer = () => setOpenedOverlayDrawer(!openedOverlayDrawer);
|
12
|
+
|
13
|
+
return (
|
14
|
+
<>
|
15
|
+
<Flex wrap>
|
16
|
+
<Button marginRight="md"
|
17
|
+
onClick={toggleNoOverlayDrawer}
|
18
|
+
>
|
19
|
+
No Overlay Drawer
|
20
|
+
</Button>
|
21
|
+
<Button marginRight="md"
|
22
|
+
onClick={toggleOverlayDrawer}
|
23
|
+
>
|
24
|
+
Overlay Drawer
|
25
|
+
</Button>
|
26
|
+
</Flex>
|
27
|
+
|
28
|
+
{/* Drawers for each size */}
|
29
|
+
<Drawer
|
30
|
+
behavior="push"
|
31
|
+
fullHeight
|
32
|
+
onClose={toggleNoOverlayDrawer}
|
33
|
+
opened={openedNoOverlayDrawer}
|
34
|
+
overlay={false}
|
35
|
+
placement="right"
|
36
|
+
size="lg"
|
37
|
+
>
|
38
|
+
This is a Drawer with no overlay
|
39
|
+
</Drawer>
|
40
|
+
<Drawer
|
41
|
+
behavior="push"
|
42
|
+
fullHeight
|
43
|
+
onClose={toggleOverlayDrawer}
|
44
|
+
opened={openedOverlayDrawer}
|
45
|
+
overlay
|
46
|
+
placement="right"
|
47
|
+
size="lg"
|
48
|
+
>
|
49
|
+
This is a Drawer with an overlay
|
50
|
+
</Drawer>
|
51
|
+
</>
|
52
|
+
);
|
53
|
+
};
|
54
|
+
|
55
|
+
export default DrawerSizes;
|
@@ -0,0 +1,113 @@
|
|
1
|
+
import React, { useState } from "react";
|
2
|
+
import { Button, Drawer, Flex } from "playbook-ui";
|
3
|
+
|
4
|
+
const DrawerSizes = () => {
|
5
|
+
// Individual state variables for each drawer size
|
6
|
+
const [openedXsDrawer, setOpenedXsDrawer] = useState(false);
|
7
|
+
const [openedSmDrawer, setOpenedSmDrawer] = useState(false);
|
8
|
+
const [openedMdDrawer, setOpenedMdDrawer] = useState(false);
|
9
|
+
const [openedLgDrawer, setOpenedLgDrawer] = useState(false);
|
10
|
+
const [openedXlDrawer, setOpenedXlDrawer] = useState(false);
|
11
|
+
|
12
|
+
// Toggle functions for each drawer
|
13
|
+
const toggleXsDrawer = () => setOpenedXsDrawer(!openedXsDrawer);
|
14
|
+
const toggleSmDrawer = () => setOpenedSmDrawer(!openedSmDrawer);
|
15
|
+
const toggleMdDrawer = () => setOpenedMdDrawer(!openedMdDrawer);
|
16
|
+
const toggleLgDrawer = () => setOpenedLgDrawer(!openedLgDrawer);
|
17
|
+
const toggleXlDrawer = () => setOpenedXlDrawer(!openedXlDrawer);
|
18
|
+
|
19
|
+
return (
|
20
|
+
<>
|
21
|
+
<Flex wrap>
|
22
|
+
<Button marginRight="md"
|
23
|
+
onClick={toggleXsDrawer}
|
24
|
+
>
|
25
|
+
XS Drawer
|
26
|
+
</Button>
|
27
|
+
<Button marginRight="md"
|
28
|
+
onClick={toggleSmDrawer}
|
29
|
+
>
|
30
|
+
SM Drawer
|
31
|
+
</Button>
|
32
|
+
<Button marginRight="md"
|
33
|
+
onClick={toggleMdDrawer}
|
34
|
+
>
|
35
|
+
MD Drawer
|
36
|
+
</Button>
|
37
|
+
<Button marginRight="md"
|
38
|
+
onClick={toggleLgDrawer}
|
39
|
+
>
|
40
|
+
LG Drawer
|
41
|
+
</Button>
|
42
|
+
<Button marginRight="md"
|
43
|
+
onClick={toggleXlDrawer}
|
44
|
+
>
|
45
|
+
XL Drawer
|
46
|
+
</Button>
|
47
|
+
</Flex>
|
48
|
+
|
49
|
+
{/* Drawers for each size */}
|
50
|
+
<Drawer
|
51
|
+
behavior="push"
|
52
|
+
fullHeight
|
53
|
+
onClose={toggleXsDrawer}
|
54
|
+
opened={openedXsDrawer}
|
55
|
+
overlay
|
56
|
+
placement="right"
|
57
|
+
size="xs"
|
58
|
+
>
|
59
|
+
XS
|
60
|
+
</Drawer>
|
61
|
+
|
62
|
+
<Drawer
|
63
|
+
behavior="push"
|
64
|
+
fullHeight
|
65
|
+
onClose={toggleSmDrawer}
|
66
|
+
opened={openedSmDrawer}
|
67
|
+
overlay
|
68
|
+
placement="right"
|
69
|
+
size="sm"
|
70
|
+
>
|
71
|
+
This is an SM Drawer
|
72
|
+
</Drawer>
|
73
|
+
|
74
|
+
<Drawer
|
75
|
+
behavior="push"
|
76
|
+
fullHeight
|
77
|
+
onClose={toggleMdDrawer}
|
78
|
+
opened={openedMdDrawer}
|
79
|
+
overlay
|
80
|
+
placement="right"
|
81
|
+
size="md"
|
82
|
+
>
|
83
|
+
This is an MD Drawer
|
84
|
+
</Drawer>
|
85
|
+
|
86
|
+
<Drawer
|
87
|
+
behavior="push"
|
88
|
+
fullHeight
|
89
|
+
onClose={toggleLgDrawer}
|
90
|
+
opened={openedLgDrawer}
|
91
|
+
overlay
|
92
|
+
placement="right"
|
93
|
+
size="lg"
|
94
|
+
>
|
95
|
+
This is an LG Drawer
|
96
|
+
</Drawer>
|
97
|
+
|
98
|
+
<Drawer
|
99
|
+
behavior="push"
|
100
|
+
fullHeight
|
101
|
+
onClose={toggleXlDrawer}
|
102
|
+
opened={openedXlDrawer}
|
103
|
+
overlay
|
104
|
+
placement="right"
|
105
|
+
size="xl"
|
106
|
+
>
|
107
|
+
This is an XL Drawer
|
108
|
+
</Drawer>
|
109
|
+
</>
|
110
|
+
);
|
111
|
+
};
|
112
|
+
|
113
|
+
export default DrawerSizes;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
export { default as DrawerDefault } from './_drawer_default.jsx'
|
2
|
+
export { default as DrawerSizes } from './_drawer_sizes.jsx'
|
3
|
+
export { default as DrawerOverlay } from './_drawer_overlay.jsx'
|
4
|
+
export { default as DrawerBorders } from './_drawer_borders.jsx'
|
5
|
+
export { default as DrawerBreakpoints } from './_drawer_breakpoints.jsx'
|
@@ -22,6 +22,16 @@ const PaginationPageChange = (props) => {
|
|
22
22
|
|
23
23
|
return (
|
24
24
|
<div className="App">
|
25
|
+
<Pagination
|
26
|
+
current={activePage}
|
27
|
+
key={`pagination-top-${activePage}`}
|
28
|
+
marginBottom="xs"
|
29
|
+
onChange={onPageChange}
|
30
|
+
range={5}
|
31
|
+
total={totalPages}
|
32
|
+
{...props}
|
33
|
+
/>
|
34
|
+
|
25
35
|
<Table
|
26
36
|
marginBottom="xs"
|
27
37
|
responsive="none"
|
@@ -49,7 +59,8 @@ const PaginationPageChange = (props) => {
|
|
49
59
|
</Table>
|
50
60
|
|
51
61
|
<Pagination
|
52
|
-
current={
|
62
|
+
current={activePage}
|
63
|
+
key={`pagination-bottom-${activePage}`}
|
53
64
|
onChange={onPageChange}
|
54
65
|
range={5}
|
55
66
|
total={totalPages}
|
@@ -1 +1,3 @@
|
|
1
|
-
You can use the `onChange` prop to control the data of your table. This prop is callback function that will allow you control the state.
|
1
|
+
You can use the `onChange` prop to control the data of your table. This prop is callback function that will allow you control the state.
|
2
|
+
|
3
|
+
To ensure synchronization between multiple pagination components on a single page, use unique, dynamic keys for each pagination instance. Each Pagination component should have its own dynamic key that reflects the current active page: this example uses `pagination-top-${activePage}` and `pagination-bottom-${activePage}`.
|
@@ -10,6 +10,7 @@
|
|
10
10
|
<%= pb_rails("radio", props: {
|
11
11
|
custom_children: true,
|
12
12
|
label: "Select",
|
13
|
+
margin_bottom: "sm",
|
13
14
|
name: "Group1",
|
14
15
|
value: "Select",
|
15
16
|
}) do %>
|
@@ -22,6 +23,7 @@
|
|
22
23
|
<%= pb_rails("radio", props: {
|
23
24
|
custom_children: true,
|
24
25
|
label: "Typeahead",
|
26
|
+
margin_bottom: "sm",
|
25
27
|
name: "Group1",
|
26
28
|
value: "Typeahead",
|
27
29
|
}) do %>
|
@@ -19,12 +19,14 @@ const RadioChildren = (props) => {
|
|
19
19
|
<Radio
|
20
20
|
customChildren
|
21
21
|
label="Select"
|
22
|
+
marginBottom="sm"
|
22
23
|
name="Group1"
|
23
24
|
tabIndex={0}
|
24
25
|
value="Select"
|
25
26
|
{...props}
|
26
27
|
>
|
27
|
-
<Select
|
28
|
+
<Select
|
29
|
+
marginBottom="none"
|
28
30
|
minWidth="xs"
|
29
31
|
options={options}
|
30
32
|
/>
|
@@ -32,17 +34,18 @@ const RadioChildren = (props) => {
|
|
32
34
|
<Radio
|
33
35
|
customChildren
|
34
36
|
label="Typeahead"
|
37
|
+
marginBottom="sm"
|
35
38
|
name="Group1"
|
36
39
|
tabIndex={0}
|
37
40
|
value="Typeahead"
|
38
41
|
{...props}
|
39
42
|
>
|
40
43
|
<Typeahead
|
44
|
+
marginBottom="none"
|
41
45
|
minWidth="xs"
|
42
46
|
options={options}
|
43
47
|
/>
|
44
48
|
</Radio>
|
45
|
-
<br />
|
46
49
|
<Radio
|
47
50
|
customChildren
|
48
51
|
defaultChecked={false}
|
@@ -0,0 +1,88 @@
|
|
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-default",
|
12
|
+
placeholder: "All Colors",
|
13
|
+
options: options,
|
14
|
+
label: "None",
|
15
|
+
name: :foo,
|
16
|
+
is_multi: false,
|
17
|
+
margin_bottom: "none",
|
18
|
+
})
|
19
|
+
%>
|
20
|
+
<%= pb_rails("typeahead", props: {
|
21
|
+
id: "typeahead-default",
|
22
|
+
placeholder: "All Colors",
|
23
|
+
options: options,
|
24
|
+
label: "XXS",
|
25
|
+
name: :foo,
|
26
|
+
is_multi: false,
|
27
|
+
margin_bottom: "xxs",
|
28
|
+
})
|
29
|
+
%>
|
30
|
+
<%= pb_rails("typeahead", props: {
|
31
|
+
id: "typeahead-default",
|
32
|
+
placeholder: "All Colors",
|
33
|
+
options: options,
|
34
|
+
label: "XS",
|
35
|
+
name: :foo,
|
36
|
+
is_multi: false,
|
37
|
+
margin_bottom: "xs",
|
38
|
+
})
|
39
|
+
%>
|
40
|
+
<%= pb_rails("typeahead", props: {
|
41
|
+
id: "typeahead-default",
|
42
|
+
placeholder: "All Colors",
|
43
|
+
options: options,
|
44
|
+
label: "Default - SM",
|
45
|
+
name: :foo,
|
46
|
+
is_multi: false,
|
47
|
+
})
|
48
|
+
%>
|
49
|
+
<%= pb_rails("typeahead", props: {
|
50
|
+
id: "typeahead-default",
|
51
|
+
placeholder: "All Colors",
|
52
|
+
options: options,
|
53
|
+
label: "MD",
|
54
|
+
name: :foo,
|
55
|
+
is_multi: false,
|
56
|
+
margin_bottom: "md",
|
57
|
+
})
|
58
|
+
%>
|
59
|
+
<%= pb_rails("typeahead", props: {
|
60
|
+
id: "typeahead-default",
|
61
|
+
placeholder: "All Colors",
|
62
|
+
options: options,
|
63
|
+
label: "LG",
|
64
|
+
name: :foo,
|
65
|
+
is_multi: false,
|
66
|
+
margin_bottom: "lg",
|
67
|
+
})
|
68
|
+
%>
|
69
|
+
<%= pb_rails("typeahead", props: {
|
70
|
+
id: "typeahead-default",
|
71
|
+
placeholder: "All Colors",
|
72
|
+
options: options,
|
73
|
+
label: "XL",
|
74
|
+
name: :foo,
|
75
|
+
is_multi: false,
|
76
|
+
margin_bottom: "xl",
|
77
|
+
})
|
78
|
+
%>
|
79
|
+
|
80
|
+
<%= javascript_tag defer: "defer" do %>
|
81
|
+
document.addEventListener("pb-typeahead-kit-typeahead-default-result-option-select", function(event) {
|
82
|
+
console.log('Single Option selected')
|
83
|
+
console.dir(event.detail)
|
84
|
+
})
|
85
|
+
document.addEventListener("pb-typeahead-kit-typeahead-default-result-clear", function() {
|
86
|
+
console.log('All options cleared')
|
87
|
+
})
|
88
|
+
<% end %>
|
@@ -0,0 +1,60 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
|
3
|
+
import Typeahead from '../_typeahead'
|
4
|
+
|
5
|
+
const options = [
|
6
|
+
{ label: 'Orange', value: '#FFA500' },
|
7
|
+
{ label: 'Red', value: '#FF0000' },
|
8
|
+
{ label: 'Green', value: '#00FF00' },
|
9
|
+
{ label: 'Blue', value: '#0000FF' },
|
10
|
+
]
|
11
|
+
|
12
|
+
const TypeaheadMarginBottom = (props) => {
|
13
|
+
return (
|
14
|
+
<>
|
15
|
+
<Typeahead
|
16
|
+
label="None"
|
17
|
+
marginBottom="none"
|
18
|
+
options={options}
|
19
|
+
{...props}
|
20
|
+
/>
|
21
|
+
<Typeahead
|
22
|
+
label="XXS"
|
23
|
+
marginBottom="xxs"
|
24
|
+
options={options}
|
25
|
+
{...props}
|
26
|
+
/>
|
27
|
+
<Typeahead
|
28
|
+
label="XS"
|
29
|
+
marginBottom="xs"
|
30
|
+
options={options}
|
31
|
+
{...props}
|
32
|
+
/>
|
33
|
+
<Typeahead
|
34
|
+
label="Default - SM"
|
35
|
+
options={options}
|
36
|
+
{...props}
|
37
|
+
/>
|
38
|
+
<Typeahead
|
39
|
+
label="MD"
|
40
|
+
marginBottom="md"
|
41
|
+
options={options}
|
42
|
+
{...props}
|
43
|
+
/>
|
44
|
+
<Typeahead
|
45
|
+
label="LG"
|
46
|
+
marginBottom="lg"
|
47
|
+
options={options}
|
48
|
+
{...props}
|
49
|
+
/>
|
50
|
+
<Typeahead
|
51
|
+
label="XL"
|
52
|
+
marginBottom="xl"
|
53
|
+
options={options}
|
54
|
+
{...props}
|
55
|
+
/>
|
56
|
+
</>
|
57
|
+
)
|
58
|
+
}
|
59
|
+
|
60
|
+
export default TypeaheadMarginBottom
|
@@ -9,6 +9,7 @@ examples:
|
|
9
9
|
- typeahead_inline: Inline
|
10
10
|
- typeahead_multi_kit: Multi Kit Options
|
11
11
|
- typeahead_error_state: Error State
|
12
|
+
- typeahead_margin_bottom: Margin Bottom
|
12
13
|
- typeahead_with_pills_color: With Pills (Custom Color)
|
13
14
|
|
14
15
|
react:
|
@@ -24,4 +25,5 @@ examples:
|
|
24
25
|
- typeahead_async_createable: Createable (+ Async Data)
|
25
26
|
- typeahead_error_state: Error State
|
26
27
|
- typeahead_custom_menu_list: Custom MenuList
|
28
|
+
- typeahead_margin_bottom: Margin Bottom
|
27
29
|
- typeahead_with_pills_color: With Pills (Custom Color)
|
@@ -10,4 +10,5 @@ export { default as TypeaheadCreateable } from './_typeahead_createable.jsx'
|
|
10
10
|
export { default as TypeaheadAsyncCreateable } from './_typeahead_async_createable.jsx'
|
11
11
|
export { default as TypeaheadErrorState } from './_typeahead_error_state.jsx'
|
12
12
|
export { default as TypeaheadCustomMenuList } from './_typeahead_custom_menu_list.jsx'
|
13
|
+
export { default as TypeaheadMarginBottom } from './_typeahead_margin_bottom.jsx'
|
13
14
|
export { default as TypeaheadWithPillsColor } from './_typeahead_with_pills_color.jsx'
|