playbook_ui 11.19.0 → 11.20.0.pre.alpha.passthrough1
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/_playbook.scss +1 -0
- data/app/pb_kits/playbook/data/menu.yml +1 -0
- data/app/pb_kits/playbook/pb_body/_body.scss +10 -1
- data/app/pb_kits/playbook/pb_body/docs/_body_styled.html.erb +9 -0
- data/app/pb_kits/playbook/pb_body/docs/_body_styled.jsx +20 -0
- data/app/pb_kits/playbook/pb_body/docs/_body_styled.md +1 -0
- data/app/pb_kits/playbook/pb_body/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_body/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.tsx +7 -7
- data/app/pb_kits/playbook/pb_dialog/_dialog.scss +69 -3
- data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +1 -1
- data/app/pb_kits/playbook/pb_dialog/dialog.rb +1 -1
- data/app/pb_kits/playbook/pb_dialog/dialog.test.jsx +12 -0
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.tsx +5 -4
- data/app/pb_kits/playbook/pb_file_upload/docs/_description.md +2 -3
- data/app/pb_kits/playbook/pb_file_upload/docs/_file_upload_custom_message.jsx +40 -0
- data/app/pb_kits/playbook/pb_file_upload/docs/example.yml +2 -2
- data/app/pb_kits/playbook/pb_file_upload/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_file_upload/fileupload.test.js +12 -0
- data/app/pb_kits/playbook/pb_paginate/_paginate.scss +69 -0
- data/app/pb_kits/playbook/pb_paginate/docs/_paginate_default.html.erb +19 -0
- data/app/pb_kits/playbook/pb_paginate/docs/example.yml +6 -0
- data/app/pb_kits/playbook/pb_paginate/paginate.html.erb +5 -0
- data/app/pb_kits/playbook/pb_paginate/paginate.rb +19 -0
- data/app/pb_kits/playbook/pb_radio/_radio.tsx +4 -4
- data/app/pb_kits/playbook/pb_select/_select.scss +1 -1
- data/app/pb_kits/playbook/pb_selectable_card/{_selectable_card.jsx → _selectable_card.tsx} +47 -42
- data/app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_default.jsx +1 -2
- data/app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_single_select.jsx +1 -1
- data/app/pb_kits/playbook/pb_selectable_card/selectable_card.test.js +185 -0
- data/app/pb_kits/playbook/pb_selectable_icon/{_selectable_icon.jsx → _selectable_icon.tsx} +29 -32
- data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_default.jsx +1 -5
- data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_single_select.jsx +1 -4
- data/app/pb_kits/playbook/pb_selectable_icon/selectable_icon.test.js +148 -0
- data/lib/playbook/pagination_renderer.rb +41 -0
- data/lib/playbook/version.rb +2 -2
- data/lib/playbook.rb +2 -0
- metadata +32 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c0a373f8f9816ad4f827295f7861d7eb09a895860d1f9214e15cce8b250719e4
|
|
4
|
+
data.tar.gz: 66d3fe725f2b20d4f848707cc08be5e5efb1753efe4ff2f6fe3da5778af6adf3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: da9d63bdd58257e7ec57560934076227af38918805cf0b81a2faa2084595ba6d55edc4dfc363601fa877bf9d7d28ef0762a6b32b1519bb77def36bdae5044378
|
|
7
|
+
data.tar.gz: 9a868a827e05f6b702172a1f3c0e7299bbd92da128ef7e122832cace0468f1fd673b81f7fc11f77728c4459f4baef420f078101b749e953a8011c3c10c3e868c
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
@import 'pb_multiple_users_stacked/multiple_users_stacked';
|
|
57
57
|
@import 'pb_nav/nav';
|
|
58
58
|
@import 'pb_online_status/online_status';
|
|
59
|
+
@import 'pb_paginate/paginate';
|
|
59
60
|
@import 'pb_passphrase/passphrase';
|
|
60
61
|
@import 'pb_person/person';
|
|
61
62
|
@import 'pb_person_contact/person_contact';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@import "./body_mixins";
|
|
2
|
+
@import "../tokens/titles";
|
|
2
3
|
|
|
3
4
|
[class^=pb_body_kit]{
|
|
4
5
|
@include pb_body($text_lt_default);
|
|
@@ -12,13 +13,21 @@
|
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
|
-
|
|
16
16
|
@each $dark_color_name, $dark_color_value in $pb_dark_body_colors{
|
|
17
17
|
&[class*=_#{$dark_color_name}][class*=dark]{
|
|
18
18
|
@include pb_body($dark_color_value);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
+
b, strong {
|
|
22
|
+
@include pb_title_4
|
|
23
|
+
}
|
|
21
24
|
|
|
25
|
+
a {
|
|
26
|
+
color: $primary;
|
|
27
|
+
&:hover {
|
|
28
|
+
color: $text_lt_default;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
22
31
|
@each $status_name, $status_value in $pb_body_status {
|
|
23
32
|
&[class*=#{$status_name}] {
|
|
24
33
|
@include pb_body($status_value);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Body } from '../..'
|
|
3
|
+
|
|
4
|
+
const BodyStyled = (props) => {
|
|
5
|
+
return (
|
|
6
|
+
<div>
|
|
7
|
+
<Body {...props}>
|
|
8
|
+
<b>{"This text is using the <b> tag"}</b>
|
|
9
|
+
<br />
|
|
10
|
+
<br />
|
|
11
|
+
<strong>{"This text is using the <strong> tag"}</strong>
|
|
12
|
+
<br />
|
|
13
|
+
<br />
|
|
14
|
+
<a href="#">{"This text is using the <a> tag"}</a>
|
|
15
|
+
</Body>
|
|
16
|
+
</div>
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default BodyStyled
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Playbook styles the `b`, `strong` and `a` tags within the body kit to match Playbook's design system.
|
|
@@ -8,18 +8,18 @@ import { globalProps, GlobalProps } from '../utilities/globalProps'
|
|
|
8
8
|
type CheckboxProps = {
|
|
9
9
|
aria?: {[key: string]: string},
|
|
10
10
|
checked?: boolean,
|
|
11
|
-
children
|
|
11
|
+
children?: React.ReactChild[] | React.ReactChild,
|
|
12
12
|
className?: string,
|
|
13
13
|
dark?: boolean,
|
|
14
14
|
data?: {[key: string]: string},
|
|
15
15
|
error?: boolean,
|
|
16
16
|
id?: string,
|
|
17
17
|
indeterminate?: boolean,
|
|
18
|
-
name
|
|
19
|
-
onChange
|
|
20
|
-
tabIndex
|
|
21
|
-
text
|
|
22
|
-
value
|
|
18
|
+
name?: string,
|
|
19
|
+
onChange?: (event: React.FormEvent<HTMLInputElement>) => void,
|
|
20
|
+
tabIndex?: number,
|
|
21
|
+
text?: string,
|
|
22
|
+
value?: string,
|
|
23
23
|
} & GlobalProps
|
|
24
24
|
|
|
25
25
|
const Checkbox = (props: CheckboxProps): JSX.Element => {
|
|
@@ -34,7 +34,7 @@ const Checkbox = (props: CheckboxProps): JSX.Element => {
|
|
|
34
34
|
id,
|
|
35
35
|
indeterminate = false,
|
|
36
36
|
name = '',
|
|
37
|
-
onChange = () => {},
|
|
37
|
+
onChange = () => { void 0 },
|
|
38
38
|
tabIndex,
|
|
39
39
|
text = '',
|
|
40
40
|
value = '',
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
// Dialog Animations
|
|
12
|
-
|
|
12
|
+
// Dialog Animations for fading in and out from the center
|
|
13
13
|
@keyframes modalFadeIn {
|
|
14
14
|
from {
|
|
15
15
|
transform: translate3d(0, -100%, 0);
|
|
@@ -32,6 +32,53 @@
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
// Dialog Animations for fading in and out from the left side
|
|
36
|
+
@keyframes modalFadeInLeft {
|
|
37
|
+
from {
|
|
38
|
+
transform: translate3d(-100%, 0, 0);
|
|
39
|
+
opacity: 0;
|
|
40
|
+
}
|
|
41
|
+
to {
|
|
42
|
+
transform: translate3d(0, 0, 0);
|
|
43
|
+
opacity: 1;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@keyframes modalFadeOutLeft {
|
|
48
|
+
from {
|
|
49
|
+
transform: translate3d(0, 0, 0);
|
|
50
|
+
opacity: 1;
|
|
51
|
+
}
|
|
52
|
+
to {
|
|
53
|
+
transform: translate3d(-50%, 0, 0);
|
|
54
|
+
opacity: 0;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
// Dialog Animations for fading in and out from the right side
|
|
60
|
+
@keyframes modalFadeInRight {
|
|
61
|
+
from {
|
|
62
|
+
transform: translate3d(100%, 0, 0);
|
|
63
|
+
opacity: 0;
|
|
64
|
+
}
|
|
65
|
+
to {
|
|
66
|
+
transform: translate3d(0, 0, 0);
|
|
67
|
+
opacity: 1;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@keyframes modalFadeOutRight {
|
|
72
|
+
from {
|
|
73
|
+
transform: translate3d(0, 0, 0);
|
|
74
|
+
opacity: 1;
|
|
75
|
+
}
|
|
76
|
+
to {
|
|
77
|
+
transform: translate3d(50%, 0, 0);
|
|
78
|
+
opacity: 0;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
35
82
|
@keyframes overlayFade {
|
|
36
83
|
from {
|
|
37
84
|
opacity: 0;
|
|
@@ -63,7 +110,7 @@
|
|
|
63
110
|
$medium: 500px;
|
|
64
111
|
$large: 800px;
|
|
65
112
|
$xlarge: 1150px;
|
|
66
|
-
$animation-duration:
|
|
113
|
+
$animation-duration: .2s;
|
|
67
114
|
$z-index: 100;
|
|
68
115
|
$opacity_visible: 1;
|
|
69
116
|
$opacity_hidden: 0;
|
|
@@ -87,6 +134,24 @@
|
|
|
87
134
|
outline: none;
|
|
88
135
|
animation-timing-function: $easeInOutQuint;
|
|
89
136
|
|
|
137
|
+
&[class*="_left"] {
|
|
138
|
+
animation-name: modalFadeInLeft;
|
|
139
|
+
&[class*="_before_close"] {
|
|
140
|
+
animation-name: modalFadeOutLeft;
|
|
141
|
+
animation-duration: $animation-duration;
|
|
142
|
+
opacity: $opacity_hidden;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
&[class*="_right"] {
|
|
147
|
+
animation-name: modalFadeInRight;
|
|
148
|
+
&[class*="_before_close"] {
|
|
149
|
+
animation-name: modalFadeOutRight;
|
|
150
|
+
animation-duration: $animation-duration;
|
|
151
|
+
opacity: $opacity_hidden;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
90
155
|
&[class*="_status_size"] {
|
|
91
156
|
width: $status_size;
|
|
92
157
|
}
|
|
@@ -98,6 +163,7 @@
|
|
|
98
163
|
&[class*="_md"] {
|
|
99
164
|
width: $medium;
|
|
100
165
|
}
|
|
166
|
+
|
|
101
167
|
|
|
102
168
|
&[class*="_lg"] {
|
|
103
169
|
width: $large;
|
|
@@ -111,7 +177,7 @@
|
|
|
111
177
|
opacity: $opacity_visible;
|
|
112
178
|
}
|
|
113
179
|
|
|
114
|
-
&_before_close {
|
|
180
|
+
&[class*="_before_close"] {
|
|
115
181
|
animation-name: modalFadeOut;
|
|
116
182
|
animation-duration: $animation-duration;
|
|
117
183
|
opacity: $opacity_hidden;
|
|
@@ -71,7 +71,7 @@ const Dialog = (props: DialogProps) => {
|
|
|
71
71
|
const ariaProps = buildAriaProps(aria);
|
|
72
72
|
const dataProps = buildDataProps(data);
|
|
73
73
|
const dialogClassNames = {
|
|
74
|
-
base: classnames("pb_dialog", buildCss("pb_dialog", size)),
|
|
74
|
+
base: classnames("pb_dialog", buildCss("pb_dialog", size, placement)),
|
|
75
75
|
afterOpen: "pb_dialog_after_open",
|
|
76
76
|
beforeClose: "pb_dialog_before_close",
|
|
77
77
|
};
|
|
@@ -25,6 +25,7 @@ function DialogTest({ props }) {
|
|
|
25
25
|
onClose={close}
|
|
26
26
|
onConfirm={() => setIsLoading(!isLoading)}
|
|
27
27
|
opened={isOpen}
|
|
28
|
+
placement="right"
|
|
28
29
|
portalClassName="portal"
|
|
29
30
|
size={size}
|
|
30
31
|
text={text}
|
|
@@ -98,3 +99,14 @@ test("renders the buttons", async () => {
|
|
|
98
99
|
cleanup()
|
|
99
100
|
});
|
|
100
101
|
|
|
102
|
+
test("renders the right placement dialog", async () => {
|
|
103
|
+
|
|
104
|
+
const { queryByText } = render(<DialogTest />);
|
|
105
|
+
|
|
106
|
+
fireEvent.click(queryByText('Open Dialog'));
|
|
107
|
+
|
|
108
|
+
await waitFor(() => expect(queryByText("Header Title is the Title Prop")));
|
|
109
|
+
|
|
110
|
+
cleanup()
|
|
111
|
+
});
|
|
112
|
+
|
|
@@ -12,6 +12,7 @@ import Card from '../pb_card/_card'
|
|
|
12
12
|
type FileUploadProps = {
|
|
13
13
|
accept?: string[],
|
|
14
14
|
className?: string,
|
|
15
|
+
customMessage?: string,
|
|
15
16
|
data?: {[key: string]: string | number},
|
|
16
17
|
acceptedFilesDescription?: string,
|
|
17
18
|
maxSize?: number,
|
|
@@ -28,6 +29,7 @@ const FileUpload = (props: FileUploadProps): React.ReactElement => {
|
|
|
28
29
|
accept = null,
|
|
29
30
|
acceptedFilesDescription = '',
|
|
30
31
|
className,
|
|
32
|
+
customMessage,
|
|
31
33
|
data = {},
|
|
32
34
|
maxSize,
|
|
33
35
|
onFilesAccepted = noop,
|
|
@@ -77,10 +79,9 @@ const FileUpload = (props: FileUploadProps): React.ReactElement => {
|
|
|
77
79
|
const dataProps = buildDataProps(data)
|
|
78
80
|
|
|
79
81
|
const getDescription = () => {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return msg
|
|
82
|
+
return customMessage
|
|
83
|
+
? customMessage
|
|
84
|
+
: `Choose a file or drag it here.${accept === null ? '' : ` The accepted file types are: ${acceptedFilesDescription || acceptedFileTypes()}.`}${maxSize ? ` ${maxFileSizeText}` : ''}`;
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
return (
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
This kit provides a drag and drop interface for file uploads. Currently, the kit leverages [react-dropzone](https://github.com/react-dropzone/react-dropzone).
|
|
1
|
+
This kit provides a drag and drop interface for file uploads. Currently, the kit leverages [react-dropzone](https://github.com/react-dropzone/react-dropzone).
|
|
2
2
|
|
|
3
3
|
### Props
|
|
4
4
|
|
|
5
5
|
`accept: [String]` Use this prop to set the list of valid file types
|
|
6
|
+
`customMessage: [String]` Use this prop to set a custom message, replacing the default text
|
|
6
7
|
`onFilesAccepted: Function` The callback function, providing the list of dropped files
|
|
7
|
-
|
|
8
|
-
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/* @flow */
|
|
2
|
+
|
|
3
|
+
import React, { useState } from 'react'
|
|
4
|
+
import {
|
|
5
|
+
FileUpload,
|
|
6
|
+
List,
|
|
7
|
+
ListItem,
|
|
8
|
+
} from '../..'
|
|
9
|
+
|
|
10
|
+
const AcceptedFilesList = ({ files }: FileList) => (
|
|
11
|
+
<List>
|
|
12
|
+
{files.map((file) => (
|
|
13
|
+
<ListItem key={file.name}>{file.name}</ListItem>
|
|
14
|
+
))}
|
|
15
|
+
</List>
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
const FileUploadCustomMessage = (props) => {
|
|
19
|
+
const [filesToUpload, setFilesToUpload] = useState([])
|
|
20
|
+
|
|
21
|
+
const handleOnFilesAccepted = (files) => {
|
|
22
|
+
setFilesToUpload([...filesToUpload, ...files])
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<div>
|
|
27
|
+
<AcceptedFilesList
|
|
28
|
+
files={filesToUpload}
|
|
29
|
+
{...props}
|
|
30
|
+
/>
|
|
31
|
+
<FileUpload
|
|
32
|
+
customMessage="Playbook is awesome!"
|
|
33
|
+
onFilesAccepted={handleOnFilesAccepted}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|
|
36
|
+
</div>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default FileUploadCustomMessage
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
examples:
|
|
2
2
|
|
|
3
3
|
rails:
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
react:
|
|
6
6
|
- file_upload_default: Default List of files to upload
|
|
7
7
|
- file_upload_accept: Accept only certain types of files
|
|
8
|
+
- file_upload_custom_message: Add a custom message
|
|
8
9
|
- file_upload_custom_description: Add your one accepted files description
|
|
9
10
|
- file_upload_max_size: Set a file size limit
|
|
10
|
-
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as FileUploadDefault } from './_file_upload_default.jsx'
|
|
2
2
|
export { default as FileUploadAccept } from './_file_upload_accept.jsx'
|
|
3
|
+
export { default as FileUploadCustomMessage } from './_file_upload_custom_message.jsx'
|
|
3
4
|
export { default as FileUploadCustomDescription } from './_file_upload_custom_description.jsx'
|
|
4
5
|
export { default as FileUploadMaxSize } from './_file_upload_max_size.jsx'
|
|
@@ -38,3 +38,15 @@ test('displays max file size text', () => {
|
|
|
38
38
|
const kit = screen.getByTestId(testid)
|
|
39
39
|
expect(kit).toHaveTextContent('Choose a file or drag it here. Max file size is 1 MB.')
|
|
40
40
|
})
|
|
41
|
+
|
|
42
|
+
test('displays custom message', () => {
|
|
43
|
+
render(
|
|
44
|
+
<FileUpload
|
|
45
|
+
customMessage={'Hello world!'}
|
|
46
|
+
data={{ testid: testid }}
|
|
47
|
+
/>
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
const kit = screen.getByTestId(testid)
|
|
51
|
+
expect(kit).toHaveTextContent('Hello world!')
|
|
52
|
+
})
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
@import "../tokens/colors";
|
|
2
|
+
@import "../tokens/typography";
|
|
3
|
+
@import "../tokens/border_radius";
|
|
4
|
+
@import "../tokens/shadows";
|
|
5
|
+
|
|
6
|
+
.pb_pagination {
|
|
7
|
+
display: inline-block;
|
|
8
|
+
border-radius: $border_rad_light;
|
|
9
|
+
border: 1px solid $border_light;
|
|
10
|
+
background-color: $white;
|
|
11
|
+
padding: 3px 0px 3.6px 0px;
|
|
12
|
+
margin: 10px 0;
|
|
13
|
+
li {
|
|
14
|
+
display: inline;
|
|
15
|
+
> a, li > span {
|
|
16
|
+
padding: 7px 13px;
|
|
17
|
+
text-decoration: none;
|
|
18
|
+
margin-left: -1px;
|
|
19
|
+
border: 0 !important;
|
|
20
|
+
}}
|
|
21
|
+
li:first-child > a, li:first-child > span {
|
|
22
|
+
padding: 7px 13px;
|
|
23
|
+
margin-left: .5px;
|
|
24
|
+
border-right: 1px solid $border_light !important;
|
|
25
|
+
z-index: 2;
|
|
26
|
+
}
|
|
27
|
+
li:last-child > a, li:last-child > span {
|
|
28
|
+
padding: 7px 13px;
|
|
29
|
+
margin-right: .5px;
|
|
30
|
+
border-left: 1px solid $border_light !important;
|
|
31
|
+
z-index: 2;
|
|
32
|
+
}
|
|
33
|
+
a {
|
|
34
|
+
color: $text_lt_default !important;
|
|
35
|
+
font-size: $text_small;
|
|
36
|
+
font-weight: $regular;
|
|
37
|
+
border: none;
|
|
38
|
+
|
|
39
|
+
&:hover {
|
|
40
|
+
background-color: $active_light;
|
|
41
|
+
color: $primary !important;
|
|
42
|
+
border-radius: $border_rad_light;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&:focus {
|
|
46
|
+
outline: 1px solid $primary !important;
|
|
47
|
+
border-radius: $border_rad_light;
|
|
48
|
+
outline-offset: -1px;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
.active > span {
|
|
52
|
+
background-color: $primary !important;
|
|
53
|
+
border-radius: $border_rad_light;
|
|
54
|
+
color: #fff;
|
|
55
|
+
padding: 7px 13px;
|
|
56
|
+
border: 0 !important;
|
|
57
|
+
text-decoration: none;
|
|
58
|
+
font-weight: $bold;
|
|
59
|
+
font-size: $text_small;
|
|
60
|
+
|
|
61
|
+
&:hover {
|
|
62
|
+
box-shadow: $shadow_deeper;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
.disabled > span {
|
|
66
|
+
padding: 7px 10px;
|
|
67
|
+
font-size: $text_small;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<%= pb_rails("title", props: { size: 4, text: "Default will_paginate"}) %>
|
|
2
|
+
<%= will_paginate @users %>
|
|
3
|
+
<%= pb_rails("body") do %>
|
|
4
|
+
You need to add: <code> require 'will_paginate'</code> in your app to use.
|
|
5
|
+
<% end %>
|
|
6
|
+
<br><br>
|
|
7
|
+
|
|
8
|
+
<%= pb_rails("title", props: { size: 4, text: "Playbook Renderer"}) %>
|
|
9
|
+
<%= will_paginate @users, renderer: Playbook::Pagination::Rails %>
|
|
10
|
+
<%= pb_rails("body") do %>
|
|
11
|
+
You need to also add: <code>require "playbook/pagination_renderer"</code> in your app to use.
|
|
12
|
+
<% end %>
|
|
13
|
+
<br><br>
|
|
14
|
+
|
|
15
|
+
<%= pb_rails("title", props: { size: 4, text: "Playbook Kit (Passthrough)"}) %>
|
|
16
|
+
<%= pb_rails("paginate", props: { strategy: "will_paginate", model: @users, view: self }) %>
|
|
17
|
+
<%= pb_rails("body") do %>
|
|
18
|
+
Same...You need to also add: <code>require "playbook/pagination_renderer"</code> in your app to use.
|
|
19
|
+
<% end %>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Playbook
|
|
4
|
+
module PbPaginate
|
|
5
|
+
class Paginate < ::Playbook::KitBase
|
|
6
|
+
prop :strategy # Need to add protection
|
|
7
|
+
prop :model # Need to add protection
|
|
8
|
+
prop :view # Need to add protection
|
|
9
|
+
|
|
10
|
+
def classname
|
|
11
|
+
generate_classname("pb_paginate")
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def url_for(options = nil)
|
|
15
|
+
view.url_for(options)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -10,16 +10,16 @@ type RadioProps = {
|
|
|
10
10
|
aria?: {[key: string]: string},
|
|
11
11
|
alignment?: string,
|
|
12
12
|
checked?: boolean,
|
|
13
|
-
children?:
|
|
13
|
+
children?: React.ReactChild[] | React.ReactChild,
|
|
14
14
|
className?: string,
|
|
15
15
|
dark?: boolean,
|
|
16
16
|
data?: {[key: string]: string},
|
|
17
17
|
error?: boolean,
|
|
18
18
|
id?: string,
|
|
19
19
|
label: string,
|
|
20
|
-
name
|
|
21
|
-
value
|
|
22
|
-
text
|
|
20
|
+
name?: string,
|
|
21
|
+
value?: string,
|
|
22
|
+
text?: string,
|
|
23
23
|
onChange: (event: React.FormEvent<HTMLInputElement> | null)=>void,
|
|
24
24
|
} & GlobalProps
|
|
25
25
|
|