@workday/canvas-kit-docs 5.3.0-next.3 → 5.3.0-next.32
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.
- package/LICENSE +1 -1
- package/dist/commonjs/lib/specs.js +429 -33
- package/dist/es6/lib/specs.js +429 -33
- package/dist/mdx/5.0-MIGRATION-GUIDE.mdx +81 -7
- package/dist/mdx/6.0-MIGRATION-GUIDE.mdx +560 -0
- package/dist/mdx/COMPOUND_COMPONENTS.mdx +31 -30
- package/dist/mdx/CONTRIBUTING.mdx +90 -63
- package/dist/mdx/TESTING.mdx +29 -5
- package/dist/mdx/labs-react/search-form/SearchForm.mdx +64 -0
- package/dist/mdx/labs-react/search-form/examples/Basic.tsx +61 -0
- package/dist/mdx/labs-react/search-form/examples/CustomTheme.tsx +72 -0
- package/dist/mdx/labs-react/search-form/examples/Grow.tsx +62 -0
- package/dist/mdx/labs-react/search-form/examples/PropTables.splitProps.tsx +4 -0
- package/dist/mdx/labs-react/search-form/examples/RTL.tsx +70 -0
- package/dist/mdx/labs-react/search-form/examples/Theming.tsx +64 -0
- package/dist/mdx/preview-react/breadcrumbs/Breadcrumbs.mdx +1 -1
- package/dist/mdx/preview-react/form-field/FormField.mdx +27 -0
- package/dist/mdx/preview-react/form-field/examples/Custom.tsx +57 -0
- package/dist/mdx/preview-react/menu/Menu.mdx +17 -9
- package/dist/mdx/preview-react/menu/examples/Basic.tsx +65 -10
- package/dist/mdx/preview-react/menu/examples/ContextMenu.tsx +47 -29
- package/dist/mdx/preview-react/menu/examples/CustomMenuItem.tsx +2 -2
- package/dist/mdx/preview-react/menu/examples/Icons.tsx +1 -1
- package/dist/mdx/preview-react/menu/examples/ManyItems.tsx +2 -2
- package/dist/mdx/preview-react/text-area/TextArea.mdx +122 -0
- package/dist/mdx/preview-react/text-area/examples/Alert.tsx +31 -0
- package/dist/mdx/preview-react/text-area/examples/Basic.tsx +17 -0
- package/dist/mdx/preview-react/text-area/examples/Disabled.tsx +17 -0
- package/dist/mdx/preview-react/text-area/examples/Error.tsx +40 -0
- package/dist/mdx/preview-react/text-area/examples/Grow.tsx +17 -0
- package/dist/mdx/preview-react/text-area/examples/HiddenLabel.tsx +20 -0
- package/dist/mdx/preview-react/text-area/examples/LabelPositionHorizontal.tsx +17 -0
- package/dist/mdx/preview-react/text-area/examples/LabelPositionVertical.tsx +17 -0
- package/dist/mdx/preview-react/text-area/examples/Placeholder.tsx +21 -0
- package/dist/mdx/preview-react/text-area/examples/RefForwarding.tsx +28 -0
- package/dist/mdx/preview-react/text-area/examples/Required.tsx +17 -0
- package/dist/mdx/preview-react/text-area/examples/ResizeConstraints.tsx +22 -0
- package/dist/mdx/preview-react/text-input/TextInput.mdx +145 -0
- package/dist/mdx/preview-react/text-input/examples/Alert.tsx +40 -0
- package/dist/mdx/preview-react/text-input/examples/Basic.tsx +17 -0
- package/dist/mdx/preview-react/text-input/examples/Disabled.tsx +17 -0
- package/dist/mdx/preview-react/text-input/examples/Error.tsx +40 -0
- package/dist/mdx/preview-react/text-input/examples/Grow.tsx +17 -0
- package/dist/mdx/preview-react/text-input/examples/HiddenLabel.tsx +20 -0
- package/dist/mdx/preview-react/text-input/examples/LabelPositionHorizontal.tsx +17 -0
- package/dist/mdx/preview-react/text-input/examples/LabelPositionVertical.tsx +17 -0
- package/dist/mdx/preview-react/text-input/examples/LoginForm.tsx +105 -0
- package/dist/mdx/preview-react/text-input/examples/Password.tsx +17 -0
- package/dist/mdx/preview-react/text-input/examples/Placeholder.tsx +17 -0
- package/dist/mdx/preview-react/text-input/examples/RefForwarding.tsx +28 -0
- package/dist/mdx/preview-react/text-input/examples/Required.tsx +17 -0
- package/dist/mdx/preview-react/text-input/examples/ThemedAlert.tsx +46 -0
- package/dist/mdx/preview-react/text-input/examples/ThemedError.tsx +37 -0
- package/dist/mdx/react/_examples/CookieBanner.mdx +8 -0
- package/dist/mdx/react/_examples/GlobalHeader.mdx +9 -0
- package/dist/mdx/react/_examples/PageHeader.mdx +8 -0
- package/dist/mdx/react/_examples/examples/CookieBanner.tsx +97 -0
- package/dist/mdx/react/_examples/examples/GlobalHeader.tsx +66 -0
- package/dist/mdx/react/_examples/examples/PageHeader.tsx +63 -0
- package/dist/mdx/react/action-bar/ActionBar.mdx +1 -1
- package/dist/mdx/react/button/button/Button.mdx +34 -9
- package/dist/mdx/react/button/button/examples/Primary.tsx +11 -1
- package/dist/mdx/react/button/button/examples/PrimaryInverse.tsx +14 -0
- package/dist/mdx/react/button/button/examples/Secondary.tsx +10 -1
- package/dist/mdx/react/button/button/examples/SecondaryInverse.tsx +14 -0
- package/dist/mdx/react/button/button/examples/Tertiary.tsx +10 -1
- package/dist/mdx/react/button/button/examples/TertiaryInverse.tsx +14 -0
- package/dist/mdx/react/button/icon-button/IconButton.mdx +1 -1
- package/dist/mdx/react/loading-animation/LoadingAnimation.mdx +5 -0
- package/dist/mdx/react/loading-animation/examples/RTL.tsx +16 -0
- package/dist/mdx/react/pagination/PropTables.splitprops.tsx +47 -0
- package/dist/mdx/react/pagination/examples/{StepControls.tsx → Basic.tsx} +1 -1
- package/dist/mdx/react/pagination/examples/GoToForm.tsx +1 -1
- package/dist/mdx/react/pagination/examples/HoistedModel.tsx +36 -22
- package/dist/mdx/react/pagination/examples/RTL.tsx +1 -1
- package/dist/mdx/react/pagination/pagination.mdx +225 -474
- package/dist/mdx/react/popup/Popup.mdx +96 -36
- package/dist/mdx/react/popup/examples/FullScreen.tsx +115 -0
- package/dist/mdx/react/radio/examples/Alert.tsx +3 -3
- package/dist/mdx/react/radio/examples/Basic.tsx +3 -3
- package/dist/mdx/react/radio/examples/Disabled.tsx +3 -3
- package/dist/mdx/react/radio/examples/Error.tsx +3 -3
- package/dist/mdx/react/radio/examples/LabelPosition.tsx +3 -3
- package/dist/mdx/react/radio/examples/NoValue.tsx +3 -3
- package/dist/mdx/react/radio/examples/RefForwarding.tsx +3 -3
- package/dist/mdx/react/radio/examples/Required.tsx +3 -3
- package/dist/mdx/react/segmented-control/SegmentedControl.mdx +1 -1
- package/dist/mdx/react/tabs/Tabs.mdx +67 -36
- package/dist/mdx/react/tabs/examples/DisabledTab.tsx +1 -1
- package/dist/mdx/react/tabs/examples/DynamicTabs.tsx +82 -38
- package/dist/mdx/react/tabs/examples/HoistedModel.tsx +4 -4
- package/dist/mdx/react/tabs/examples/Icons.tsx +36 -0
- package/dist/mdx/react/tabs/examples/{NamedKeys.tsx → NamedTabs.tsx} +0 -0
- package/dist/mdx/react/tabs/examples/OverflowTabs.tsx +58 -0
- package/dist/mdx/react/tabs/examples/SinglePanel.tsx +1 -1
- package/dist/mdx/react/text-area/TextArea.mdx +1 -1
- package/dist/mdx/react/toast/toast.mdx +1 -17
- package/dist/mdx/react/tooltip/Tooltip.mdx +9 -1
- package/dist/mdx/react/tooltip/examples/DelayedTooltip.tsx +16 -0
- package/dist/mdx/react/tooltip/examples/Ellipsis.tsx +6 -0
- package/package.json +5 -4
- package/dist/mdx/CODE_OF_CONDUCT.md +0 -68
- package/dist/mdx/preview-react/menu/examples/ContextMenuTarget.tsx +0 -33
- package/dist/mdx/preview-react/menu/examples/ControlButton.tsx +0 -84
- package/dist/mdx/react/pagination/examples/ShowAdditionalDetails.tsx +0 -52
|
@@ -7,8 +7,11 @@ import {
|
|
|
7
7
|
import {Specifications} from '@workday/canvas-kit-docs';
|
|
8
8
|
|
|
9
9
|
import Primary from './examples/Primary';
|
|
10
|
+
import PrimaryInverse from './examples/PrimaryInverse';
|
|
10
11
|
import Secondary from './examples/Secondary';
|
|
12
|
+
import SecondaryInverse from './examples/SecondaryInverse';
|
|
11
13
|
import Tertiary from './examples/Tertiary';
|
|
14
|
+
import TertiaryInverse from './examples/TertiaryInverse';
|
|
12
15
|
import Delete from './examples/Delete';
|
|
13
16
|
|
|
14
17
|
|
|
@@ -35,11 +38,20 @@ Primary Buttons are high emphasis. Use once per screen to draw attention to the
|
|
|
35
38
|
action. Multiple primary buttons make it confusing for the user to understand what action they
|
|
36
39
|
should take. Not all screens require a Primary Button.
|
|
37
40
|
|
|
41
|
+
Primary Buttons have four sizes: `extraSmall`, `small`, `medium`, and `large`. Icons are supported
|
|
42
|
+
for every size and can be positioned to the `left` or `right` with the `iconPosition` prop.
|
|
43
|
+
|
|
38
44
|
<ExampleCodeBlock code={Primary} />
|
|
39
45
|
|
|
46
|
+
Primary Buttons also have an `inverse` variant. While it looks similar to the default Secondary
|
|
47
|
+
Button, the default outline as well as the hover and focus states are different. Use this variant
|
|
48
|
+
when you need to place a Primary Button on a dark or colorful background such as `blueberry400`.
|
|
49
|
+
|
|
50
|
+
<ExampleCodeBlock code={PrimaryInverse} />
|
|
51
|
+
|
|
40
52
|
#### Props
|
|
41
53
|
|
|
42
|
-
Undocumented props are spread to the underlying
|
|
54
|
+
Undocumented props are spread to the underlying `<button>` element.
|
|
43
55
|
|
|
44
56
|
<ArgsTable of={PrimaryButton} />
|
|
45
57
|
|
|
@@ -49,13 +61,19 @@ Secondary Buttons have a medium level of emphasis. Use them for non-critical act
|
|
|
49
61
|
Buttons can be used on most pages without restrictions and work well for multiple actions of equal
|
|
50
62
|
weight. They can be used in conjunction with a Primary Button or independently.
|
|
51
63
|
|
|
52
|
-
|
|
64
|
+
Secondary Buttons have four sizes: `extraSmall`, `small`, `medium`, and `large`. Icons are supported
|
|
65
|
+
for every size and can be positioned to the `left` or `right` with the `iconPosition` prop.
|
|
53
66
|
|
|
54
67
|
<ExampleCodeBlock code={Secondary} />
|
|
55
68
|
|
|
69
|
+
Secondary Buttons also have an `inverse` variant. Use this when you need to place a Secondary Button on
|
|
70
|
+
a dark or colorful background such as `blueberry400`.
|
|
71
|
+
|
|
72
|
+
<ExampleCodeBlock code={SecondaryInverse} />
|
|
73
|
+
|
|
56
74
|
#### Props
|
|
57
75
|
|
|
58
|
-
Undocumented props are spread to the underlying
|
|
76
|
+
Undocumented props are spread to the underlying `<button>` element.
|
|
59
77
|
|
|
60
78
|
<ArgsTable of={SecondaryButton} />
|
|
61
79
|
|
|
@@ -66,13 +84,20 @@ the user may not often be looking to do. Tertiary Buttons have lower prominence
|
|
|
66
84
|
not visible until it is interacted with. Use Tertiary Buttons for supplemental actions such as “View
|
|
67
85
|
More”, “Read More” or “Select a File”. Tertiary Buttons are frequently used on Cards.
|
|
68
86
|
|
|
69
|
-
|
|
87
|
+
Tertiary Buttons have three sizes: `extraSmall`, `small`, and `medium`. Icons are supported
|
|
88
|
+
for every size and can be positioned to the `left` or `right` with the `iconPosition` prop.
|
|
70
89
|
|
|
71
90
|
<ExampleCodeBlock code={Tertiary} />
|
|
72
91
|
|
|
92
|
+
Tertiary Buttons also have an `inverse` variant. Use this when you need to place a Tertiary Button on
|
|
93
|
+
a dark or colorful background such as `blueberry400`.
|
|
94
|
+
|
|
95
|
+
<ExampleCodeBlock code={TertiaryInverse} />
|
|
96
|
+
|
|
97
|
+
|
|
73
98
|
#### Props
|
|
74
99
|
|
|
75
|
-
Undocumented props are spread to the underlying
|
|
100
|
+
Undocumented props are spread to the underlying `<button>` element.
|
|
76
101
|
|
|
77
102
|
<ArgsTable of={TertiaryButton} />
|
|
78
103
|
|
|
@@ -86,16 +111,16 @@ before deleting.
|
|
|
86
111
|
|
|
87
112
|
#### Props
|
|
88
113
|
|
|
89
|
-
Undocumented props are spread to the underlying
|
|
114
|
+
Undocumented props are spread to the underlying `<button>` element.
|
|
90
115
|
|
|
91
116
|
<ArgsTable of={DeleteButton} />
|
|
92
117
|
|
|
93
118
|
### Accessible Use of the `as` Prop
|
|
94
119
|
|
|
95
120
|
Like many of our components, Buttons accept an `as` prop, which lets you change the underlying
|
|
96
|
-
semantic element - usually an
|
|
97
|
-
|
|
98
|
-
|
|
121
|
+
semantic element - usually an `<a>`, or a `<button>`. This should be done with caution to ensure the
|
|
122
|
+
best accessibility. Generally, `<button>` elements should be used for actions, and `<a>` elements
|
|
123
|
+
should be used for navigation.
|
|
99
124
|
|
|
100
125
|
## Specifications
|
|
101
126
|
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import {PrimaryButton} from '@workday/canvas-kit-react/button';
|
|
4
|
+
import {HStack} from '@workday/canvas-kit-labs-react/layout';
|
|
5
|
+
import {plusIcon} from '@workday/canvas-system-icons-web';
|
|
4
6
|
|
|
5
|
-
export default
|
|
7
|
+
export default props => (
|
|
8
|
+
<HStack spacing="s" padding="s">
|
|
9
|
+
<PrimaryButton {...props}>Primary</PrimaryButton>
|
|
10
|
+
<p>{JSON.stringify(props.theme)}</p>
|
|
11
|
+
<PrimaryButton icon={plusIcon} iconPosition="right" {...props}>
|
|
12
|
+
Primary
|
|
13
|
+
</PrimaryButton>
|
|
14
|
+
</HStack>
|
|
15
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {PrimaryButton} from '@workday/canvas-kit-react/button';
|
|
4
|
+
import {HStack} from '@workday/canvas-kit-labs-react/layout';
|
|
5
|
+
import {plusIcon} from '@workday/canvas-system-icons-web';
|
|
6
|
+
|
|
7
|
+
export default () => (
|
|
8
|
+
<HStack spacing="s" backgroundColor="blueberry400" padding="s">
|
|
9
|
+
<PrimaryButton variant="inverse">Primary</PrimaryButton>
|
|
10
|
+
<PrimaryButton icon={plusIcon} iconPosition="right" variant="inverse">
|
|
11
|
+
Primary
|
|
12
|
+
</PrimaryButton>
|
|
13
|
+
</HStack>
|
|
14
|
+
);
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import {SecondaryButton} from '@workday/canvas-kit-react/button';
|
|
4
|
+
import {HStack} from '@workday/canvas-kit-labs-react/layout';
|
|
5
|
+
import {plusIcon} from '@workday/canvas-system-icons-web';
|
|
4
6
|
|
|
5
|
-
export default () =>
|
|
7
|
+
export default () => (
|
|
8
|
+
<HStack spacing="s" padding="s">
|
|
9
|
+
<SecondaryButton>Secondary</SecondaryButton>
|
|
10
|
+
<SecondaryButton icon={plusIcon} iconPosition="right">
|
|
11
|
+
Secondary
|
|
12
|
+
</SecondaryButton>
|
|
13
|
+
</HStack>
|
|
14
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {SecondaryButton} from '@workday/canvas-kit-react/button';
|
|
4
|
+
import {HStack} from '@workday/canvas-kit-labs-react/layout';
|
|
5
|
+
import {plusIcon} from '@workday/canvas-system-icons-web';
|
|
6
|
+
|
|
7
|
+
export default () => (
|
|
8
|
+
<HStack spacing="s" backgroundColor="blueberry400" padding="s">
|
|
9
|
+
<SecondaryButton variant="inverse">Secondary</SecondaryButton>
|
|
10
|
+
<SecondaryButton icon={plusIcon} iconPosition="right" variant="inverse">
|
|
11
|
+
Secondary
|
|
12
|
+
</SecondaryButton>
|
|
13
|
+
</HStack>
|
|
14
|
+
);
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import {TertiaryButton} from '@workday/canvas-kit-react/button';
|
|
4
|
+
import {HStack} from '@workday/canvas-kit-labs-react/layout';
|
|
5
|
+
import {plusIcon} from '@workday/canvas-system-icons-web';
|
|
4
6
|
|
|
5
|
-
export default () =>
|
|
7
|
+
export default () => (
|
|
8
|
+
<HStack spacing="s" padding="s">
|
|
9
|
+
<TertiaryButton>Tertiary</TertiaryButton>
|
|
10
|
+
<TertiaryButton icon={plusIcon} iconPosition="right">
|
|
11
|
+
Tertiary
|
|
12
|
+
</TertiaryButton>
|
|
13
|
+
</HStack>
|
|
14
|
+
);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {TertiaryButton} from '@workday/canvas-kit-react/button';
|
|
4
|
+
import {HStack} from '@workday/canvas-kit-labs-react/layout';
|
|
5
|
+
import {plusIcon} from '@workday/canvas-system-icons-web';
|
|
6
|
+
|
|
7
|
+
export default () => (
|
|
8
|
+
<HStack spacing="s" backgroundColor="blueberry400" padding="s">
|
|
9
|
+
<TertiaryButton variant="inverse">Tertiary</TertiaryButton>
|
|
10
|
+
<TertiaryButton icon={plusIcon} iconPosition="right" variant="inverse">
|
|
11
|
+
Tertiary
|
|
12
|
+
</TertiaryButton>
|
|
13
|
+
</HStack>
|
|
14
|
+
);
|
|
@@ -98,6 +98,6 @@ The `toggle` prop can be used to make icon buttons toggleable.
|
|
|
98
98
|
|
|
99
99
|
## Props
|
|
100
100
|
|
|
101
|
-
Undocumented props are spread to the underlying
|
|
101
|
+
Undocumented props are spread to the underlying `<button>` element.
|
|
102
102
|
|
|
103
103
|
<ArgsTable of={IconButton} />
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {LoadingAnimation} from '@workday/canvas-kit-react/loading-animation';
|
|
2
2
|
|
|
3
3
|
import Basic from './examples/Basic';
|
|
4
|
+
import RTL from './examples/RTL';
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
# Canvas Kit Loading Animation
|
|
@@ -22,6 +23,10 @@ yarn add @workday/canvas-kit-react
|
|
|
22
23
|
|
|
23
24
|
<ExampleCodeBlock code={Basic} />
|
|
24
25
|
|
|
26
|
+
### Right-to-Left (RTL)
|
|
27
|
+
|
|
28
|
+
<ExampleCodeBlock code={RTL} />
|
|
29
|
+
|
|
25
30
|
## Props
|
|
26
31
|
|
|
27
32
|
Loading Animation does not have any documented props. Undocumented props are spread to its outermost
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {LoadingAnimation} from '@workday/canvas-kit-react/loading-animation';
|
|
3
|
+
import {CanvasProvider, ContentDirection} from '@workday/canvas-kit-react/common';
|
|
4
|
+
|
|
5
|
+
export default () => {
|
|
6
|
+
const theme = {
|
|
7
|
+
canvas: {
|
|
8
|
+
direction: ContentDirection.RTL,
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
return (
|
|
12
|
+
<CanvasProvider theme={theme}>
|
|
13
|
+
<LoadingAnimation />
|
|
14
|
+
</CanvasProvider>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PaginationModel,
|
|
3
|
+
PaginationState,
|
|
4
|
+
PaginationEvents,
|
|
5
|
+
UsePaginationModelConfig,
|
|
6
|
+
} from '@workday/canvas-kit-react/pagination';
|
|
7
|
+
|
|
8
|
+
// <ArgsTable of={Pagination} /> generates a very large props table given that
|
|
9
|
+
// PaginationProps includes FlexProps. Use this dummy component instead to
|
|
10
|
+
// limit the props shown.
|
|
11
|
+
export const PaginationHoistedComponent = (_: {model: PaginationModel}) => <div />;
|
|
12
|
+
|
|
13
|
+
// <ArgsTable of={Pagination.PageButton} /> generates a props table with
|
|
14
|
+
// IconButton props. Use this dummy component instead to limit the props shown.
|
|
15
|
+
export const PageButtonComponent = (_: {pageNumber: number}) => <div />;
|
|
16
|
+
|
|
17
|
+
// <ArgsTable of={Pagination.PageListComponent} /> generates a very large props
|
|
18
|
+
// table given that PageListProps includes FlexProps. Use this dummy component
|
|
19
|
+
// instead to limit the props shown.
|
|
20
|
+
export const PageListComponent = (_: {
|
|
21
|
+
/**
|
|
22
|
+
* Accepts child elements or a render prop.
|
|
23
|
+
*/
|
|
24
|
+
children: (model: PaginationModel) => React.ReactNode | React.ReactNode;
|
|
25
|
+
}) => <div />;
|
|
26
|
+
|
|
27
|
+
// <ArgsTable of={Pagination.AdditionalDetails} /> generates a very large props
|
|
28
|
+
// table given that AdditionalDetailsProps includes FlexProps. Use this dummy
|
|
29
|
+
// component instead to limit the props shown.
|
|
30
|
+
export const AdditionalDetailsComponent = (_: {
|
|
31
|
+
/**
|
|
32
|
+
* Accepts child elements or a render prop.
|
|
33
|
+
*/
|
|
34
|
+
children: (model: PaginationModel) => React.ReactNode | React.ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* @default true
|
|
37
|
+
*/
|
|
38
|
+
shouldAnnounceToScreenReader?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
shouldHideDetails?: boolean;
|
|
43
|
+
}) => <div />;
|
|
44
|
+
|
|
45
|
+
export const PaginationModelConfigComponent = (_: UsePaginationModelConfig) => <div />;
|
|
46
|
+
export const PaginationStateComponent = (_: PaginationState) => <div />;
|
|
47
|
+
export const PaginationEventsComponent = (_: PaginationEvents) => <div />;
|
|
@@ -30,7 +30,7 @@ export default () => {
|
|
|
30
30
|
</Pagination.PageList>
|
|
31
31
|
<Pagination.StepToNextButton aria-label="Next" />
|
|
32
32
|
</Pagination.Controls>
|
|
33
|
-
<Pagination.AdditionalDetails
|
|
33
|
+
<Pagination.AdditionalDetails>
|
|
34
34
|
{({state}) =>
|
|
35
35
|
`${getVisibleResultsMin(state.currentPage, resultCount)}-${getVisibleResultsMax(
|
|
36
36
|
state.currentPage,
|
|
@@ -33,7 +33,7 @@ export default () => {
|
|
|
33
33
|
<Pagination.JumpToLastButton aria-label="Last" />
|
|
34
34
|
<Pagination.GoToForm>
|
|
35
35
|
<Pagination.GoToTextInput aria-label="Go to page number" />
|
|
36
|
-
<Pagination.GoToLabel>{({state}) => `of ${
|
|
36
|
+
<Pagination.GoToLabel>{({state}) => `of ${state.lastPage} pages`}</Pagination.GoToLabel>
|
|
37
37
|
</Pagination.GoToForm>
|
|
38
38
|
</Pagination.Controls>
|
|
39
39
|
<Pagination.AdditionalDetails shouldHideDetails>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import {SecondaryButton} from '@workday/canvas-kit-react/button';
|
|
2
3
|
import {
|
|
3
4
|
Pagination,
|
|
4
5
|
getLastPage,
|
|
@@ -16,30 +17,43 @@ export default () => {
|
|
|
16
17
|
lastPage,
|
|
17
18
|
onPageChange: number => console.log(number),
|
|
18
19
|
});
|
|
20
|
+
|
|
19
21
|
return (
|
|
20
|
-
|
|
21
|
-
<Pagination
|
|
22
|
-
<Pagination.
|
|
23
|
-
|
|
22
|
+
<>
|
|
23
|
+
<Pagination aria-label="Pagination" model={model}>
|
|
24
|
+
<Pagination.Controls>
|
|
25
|
+
<Pagination.StepToPreviousButton aria-label="Previous" />
|
|
26
|
+
<Pagination.PageList>
|
|
27
|
+
{({state}) =>
|
|
28
|
+
state.range.map(pageNumber => (
|
|
29
|
+
<Pagination.PageListItem key={pageNumber}>
|
|
30
|
+
<Pagination.PageButton
|
|
31
|
+
aria-label={`Page ${pageNumber}`}
|
|
32
|
+
pageNumber={pageNumber}
|
|
33
|
+
/>
|
|
34
|
+
</Pagination.PageListItem>
|
|
35
|
+
))
|
|
36
|
+
}
|
|
37
|
+
</Pagination.PageList>
|
|
38
|
+
<Pagination.StepToNextButton aria-label="Next" />
|
|
39
|
+
</Pagination.Controls>
|
|
40
|
+
<Pagination.AdditionalDetails shouldHideDetails>
|
|
24
41
|
{({state}) =>
|
|
25
|
-
state.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
)
|
|
42
|
+
`${getVisibleResultsMin(state.currentPage, resultCount)}-${getVisibleResultsMax(
|
|
43
|
+
state.currentPage,
|
|
44
|
+
resultCount,
|
|
45
|
+
totalCount
|
|
46
|
+
)} of ${totalCount} results`
|
|
30
47
|
}
|
|
31
|
-
</Pagination.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
</Pagination.AdditionalDetails>
|
|
43
|
-
</Pagination>
|
|
48
|
+
</Pagination.AdditionalDetails>
|
|
49
|
+
</Pagination>
|
|
50
|
+
<SecondaryButton
|
|
51
|
+
onClick={() => {
|
|
52
|
+
model.events.goTo(7);
|
|
53
|
+
}}
|
|
54
|
+
>
|
|
55
|
+
Go to Page 7
|
|
56
|
+
</SecondaryButton>
|
|
57
|
+
</>
|
|
44
58
|
);
|
|
45
59
|
};
|
|
@@ -36,7 +36,7 @@ export default () => {
|
|
|
36
36
|
<Pagination.JumpToLastButton aria-label="Last" />
|
|
37
37
|
<Pagination.GoToForm>
|
|
38
38
|
<Pagination.GoToTextInput aria-label="Go to page number" />
|
|
39
|
-
<Pagination.GoToLabel>{() =>
|
|
39
|
+
<Pagination.GoToLabel>{({state}) => `از ${state.lastPage} صفحه`}</Pagination.GoToLabel>
|
|
40
40
|
</Pagination.GoToForm>
|
|
41
41
|
</Pagination.Controls>
|
|
42
42
|
<Pagination.AdditionalDetails shouldHideDetails>
|