@lumx/react 2.0.0-alpha.0 → 2.0.1
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/esm/_internal/AlertDialog.js +15 -5
- package/esm/_internal/AlertDialog.js.map +1 -1
- package/esm/_internal/AutocompleteMultiple.js +6 -2
- package/esm/_internal/AutocompleteMultiple.js.map +1 -1
- package/esm/_internal/ButtonRoot.js +1 -0
- package/esm/_internal/ButtonRoot.js.map +1 -1
- package/esm/_internal/ClickAwayProvider.js +31 -30
- package/esm/_internal/ClickAwayProvider.js.map +1 -1
- package/esm/_internal/Dialog2.js +6 -3
- package/esm/_internal/Dialog2.js.map +1 -1
- package/esm/_internal/Dropdown2.js +6 -2
- package/esm/_internal/Dropdown2.js.map +1 -1
- package/esm/_internal/Icon2.js +1 -1
- package/esm/_internal/Icon2.js.map +1 -1
- package/esm/_internal/Lightbox2.js +4 -2
- package/esm/_internal/Lightbox2.js.map +1 -1
- package/esm/_internal/Message2.js +4 -3
- package/esm/_internal/Message2.js.map +1 -1
- package/esm/_internal/Popover2.js +4 -2
- package/esm/_internal/Popover2.js.map +1 -1
- package/esm/_internal/SelectMultiple.js +39 -61
- package/esm/_internal/SelectMultiple.js.map +1 -1
- package/esm/_internal/SlideshowControls.js +93 -44
- package/esm/_internal/SlideshowControls.js.map +1 -1
- package/esm/_internal/Switch2.js +2 -0
- package/esm/_internal/Switch2.js.map +1 -1
- package/esm/_internal/alert-dialog.js +1 -1
- package/esm/_internal/autocomplete.js +1 -2
- package/esm/_internal/autocomplete.js.map +1 -1
- package/esm/_internal/button.js +1 -2
- package/esm/_internal/button.js.map +1 -1
- package/esm/_internal/date-picker.js +1 -2
- package/esm/_internal/date-picker.js.map +1 -1
- package/esm/_internal/dialog.js +1 -1
- package/esm/_internal/dropdown.js +1 -1
- package/esm/_internal/expansion-panel.js +1 -2
- package/esm/_internal/expansion-panel.js.map +1 -1
- package/esm/_internal/getRootClassName.js +78 -68
- package/esm/_internal/getRootClassName.js.map +1 -1
- package/esm/_internal/lightbox.js +1 -2
- package/esm/_internal/lightbox.js.map +1 -1
- package/esm/_internal/popover.js +1 -1
- package/esm/_internal/select.js +1 -2
- package/esm/_internal/select.js.map +1 -1
- package/esm/_internal/side-navigation.js +1 -2
- package/esm/_internal/side-navigation.js.map +1 -1
- package/esm/_internal/slideshow.js +1 -2
- package/esm/_internal/slideshow.js.map +1 -1
- package/esm/_internal/text-field.js +1 -2
- package/esm/_internal/text-field.js.map +1 -1
- package/esm/_internal/tooltip.js +1 -2
- package/esm/_internal/tooltip.js.map +1 -1
- package/esm/_internal/useDelayedVisibility.js +16 -2
- package/esm/_internal/useDelayedVisibility.js.map +1 -1
- package/esm/_internal/useDisableBodyScroll.js +205 -7
- package/esm/_internal/useDisableBodyScroll.js.map +1 -1
- package/esm/index.js +1 -2
- package/esm/index.js.map +1 -1
- package/package.json +6 -6
- package/src/components/alert-dialog/AlertDialog.stories.tsx +29 -0
- package/src/components/alert-dialog/AlertDialog.tsx +29 -9
- package/src/components/alert-dialog/__snapshots__/AlertDialog.test.tsx.snap +91 -0
- package/src/components/autocomplete/Autocomplete.test.tsx +2 -0
- package/src/components/autocomplete/Autocomplete.tsx +7 -0
- package/src/components/autocomplete/AutocompleteMultiple.test.tsx +2 -0
- package/src/components/autocomplete/AutocompleteMultiple.tsx +2 -0
- package/src/components/autocomplete/__snapshots__/Autocomplete.test.tsx.snap +2 -0
- package/src/components/autocomplete/__snapshots__/AutocompleteMultiple.test.tsx.snap +2 -0
- package/src/components/button/Button.stories.tsx +8 -2
- package/src/components/button/ButtonRoot.tsx +1 -1
- package/src/components/comment-block/CommentBlock.stories.tsx +3 -2
- package/src/components/comment-block/__snapshots__/CommentBlock.test.tsx.snap +1 -1
- package/src/components/dialog/Dialog.stories.tsx +62 -22
- package/src/components/dialog/Dialog.tsx +8 -2
- package/src/components/dialog/__snapshots__/Dialog.test.tsx.snap +99 -35
- package/src/components/icon/Icon.tsx +1 -0
- package/src/components/icon/__snapshots__/Icon.test.tsx.snap +2 -2
- package/src/components/lightbox/Lightbox.tsx +4 -1
- package/src/components/lightbox/__snapshots__/Lightbox.test.tsx.snap +7 -5
- package/src/components/message/Message.stories.tsx +8 -0
- package/src/components/message/Message.tsx +4 -2
- package/src/components/popover/Popover.tsx +4 -1
- package/src/components/popover/__snapshots__/Popover.test.tsx.snap +100 -80
- package/src/components/select/WithSelectContext.tsx +3 -60
- package/src/components/slideshow/Slideshow.stories.tsx +47 -7
- package/src/components/slideshow/Slideshow.test.tsx +4 -1
- package/src/components/slideshow/Slideshow.tsx +51 -26
- package/src/components/slideshow/SlideshowControls.stories.tsx +0 -4
- package/src/components/slideshow/SlideshowControls.tsx +23 -8
- package/src/components/slideshow/__snapshots__/Slideshow.test.tsx.snap +0 -5
- package/src/components/slideshow/useKeyNavigate.ts +28 -0
- package/src/components/slideshow/useSwipeNavigate.ts +18 -0
- package/src/components/switch/Switch.tsx +2 -0
- package/src/components/switch/__snapshots__/Switch.test.tsx.snap +8 -0
- package/src/hooks/useClickAway.tsx +6 -5
- package/src/hooks/useDelayedVisibility.tsx +22 -2
- package/src/hooks/useDisableBodyScroll.ts +16 -1
- package/src/hooks/useInfiniteScroll.tsx +14 -3
- package/src/hooks/useListenFocus.tsx +26 -0
- package/src/utils/ClickAwayProvider/ClickAwayProvider.tsx +23 -32
- package/types.d.ts +17 -8
- package/src/components/slideshow/useKeyOrSwipeNavigate.ts +0 -37
|
@@ -158,3 +158,32 @@ export const RichDescription = ({ theme }: any) => {
|
|
|
158
158
|
</>
|
|
159
159
|
);
|
|
160
160
|
};
|
|
161
|
+
|
|
162
|
+
export const WithForwardedProps = ({ theme }: any) => {
|
|
163
|
+
const { button, buttonRef, closeDialog, isOpen } = useOpenButton(theme);
|
|
164
|
+
|
|
165
|
+
return (
|
|
166
|
+
<>
|
|
167
|
+
{button}
|
|
168
|
+
<AlertDialog
|
|
169
|
+
{...defaultProps}
|
|
170
|
+
title="With Forwarded Props"
|
|
171
|
+
isOpen={isOpen}
|
|
172
|
+
onClose={closeDialog}
|
|
173
|
+
parentElement={buttonRef}
|
|
174
|
+
cancelProps={{
|
|
175
|
+
label: 'Cancel',
|
|
176
|
+
onClick: closeDialog,
|
|
177
|
+
style: { color: 'blue' },
|
|
178
|
+
}}
|
|
179
|
+
confirmProps={{
|
|
180
|
+
onClick: () => alert('confirm'),
|
|
181
|
+
label: 'OK',
|
|
182
|
+
style: { color: 'red' },
|
|
183
|
+
}}
|
|
184
|
+
>
|
|
185
|
+
Consequat deserunt officia aute laborum tempor anim sint est.
|
|
186
|
+
</AlertDialog>
|
|
187
|
+
</>
|
|
188
|
+
);
|
|
189
|
+
};
|
|
@@ -2,7 +2,18 @@ import React, { forwardRef } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
DialogProps,
|
|
7
|
+
Dialog,
|
|
8
|
+
Button,
|
|
9
|
+
Emphasis,
|
|
10
|
+
ColorPalette,
|
|
11
|
+
Icon,
|
|
12
|
+
Size,
|
|
13
|
+
Kind,
|
|
14
|
+
Toolbar,
|
|
15
|
+
ButtonProps,
|
|
16
|
+
} from '@lumx/react';
|
|
6
17
|
|
|
7
18
|
import { mdiAlert, mdiAlertCircle, mdiCheckCircle, mdiInformation } from '@lumx/icons/';
|
|
8
19
|
import { uid } from 'uid';
|
|
@@ -13,16 +24,16 @@ export interface AlertDialogProps extends Omit<DialogProps, 'header' | 'footer'>
|
|
|
13
24
|
kind?: Kind;
|
|
14
25
|
/** Dialog title. */
|
|
15
26
|
title?: string;
|
|
16
|
-
/**
|
|
17
|
-
confirmProps: {
|
|
27
|
+
/** Props forwarded to the confirm button */
|
|
28
|
+
confirmProps: ButtonProps & {
|
|
18
29
|
onClick(): void;
|
|
19
30
|
label: string;
|
|
20
31
|
};
|
|
21
32
|
/**
|
|
22
|
-
*
|
|
33
|
+
* Props forwarded to the cancel button.
|
|
23
34
|
* Will not render a cancel button if undefined.
|
|
24
35
|
*/
|
|
25
|
-
cancelProps?: {
|
|
36
|
+
cancelProps?: ButtonProps & {
|
|
26
37
|
onClick(): void;
|
|
27
38
|
label: string;
|
|
28
39
|
};
|
|
@@ -91,6 +102,9 @@ export const AlertDialog: Comp<AlertDialogProps, HTMLDivElement> = forwardRef((p
|
|
|
91
102
|
// If content is a string, set in a paragraph.
|
|
92
103
|
const DescriptionElement = typeof children === 'string' ? 'p' : 'div';
|
|
93
104
|
|
|
105
|
+
const { label: confirmLabel, onClick: confirmOnClick, ...forwardedConfirmProps } = confirmProps;
|
|
106
|
+
const { label: cancelLabel, onClick: cancelOnClick, ...forwardedCancelProps } = cancelProps || {};
|
|
107
|
+
|
|
94
108
|
return (
|
|
95
109
|
<Dialog
|
|
96
110
|
ref={ref}
|
|
@@ -139,17 +153,23 @@ export const AlertDialog: Comp<AlertDialogProps, HTMLDivElement> = forwardRef((p
|
|
|
139
153
|
after={
|
|
140
154
|
<>
|
|
141
155
|
{cancelProps && (
|
|
142
|
-
<Button
|
|
143
|
-
{
|
|
156
|
+
<Button
|
|
157
|
+
{...forwardedCancelProps}
|
|
158
|
+
ref={cancelButtonRef}
|
|
159
|
+
emphasis={Emphasis.medium}
|
|
160
|
+
onClick={cancelOnClick}
|
|
161
|
+
>
|
|
162
|
+
{cancelLabel}
|
|
144
163
|
</Button>
|
|
145
164
|
)}
|
|
146
165
|
<Button
|
|
166
|
+
{...forwardedConfirmProps}
|
|
147
167
|
ref={confirmationButtonRef}
|
|
148
168
|
color={color}
|
|
149
169
|
className="lumx-spacing-margin-left-regular"
|
|
150
|
-
onClick={
|
|
170
|
+
onClick={confirmOnClick}
|
|
151
171
|
>
|
|
152
|
-
{
|
|
172
|
+
{confirmLabel}
|
|
153
173
|
</Button>
|
|
154
174
|
</>
|
|
155
175
|
}
|
|
@@ -458,3 +458,94 @@ exports[`<AlertDialog> Snapshots and structure should render story 'WithCancel'
|
|
|
458
458
|
</footer>
|
|
459
459
|
</Dialog>
|
|
460
460
|
`;
|
|
461
|
+
|
|
462
|
+
exports[`<AlertDialog> Snapshots and structure should render story 'WithForwardedProps' 1`] = `
|
|
463
|
+
<Dialog
|
|
464
|
+
className="lumx-alert-dialog lumx-alert-dialog--kind-info"
|
|
465
|
+
dialogProps={
|
|
466
|
+
Object {
|
|
467
|
+
"aria-describedby": "alert-dialog-description",
|
|
468
|
+
"aria-labelledby": "alert-dialog-title",
|
|
469
|
+
"id": "alert-dialog",
|
|
470
|
+
"role": "alertdialog",
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
focusElement={
|
|
474
|
+
Object {
|
|
475
|
+
"current": null,
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
isOpen={true}
|
|
479
|
+
onClose={[Function]}
|
|
480
|
+
parentElement={
|
|
481
|
+
Object {
|
|
482
|
+
"current": undefined,
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
size="tiny"
|
|
486
|
+
>
|
|
487
|
+
<header>
|
|
488
|
+
<Toolbar
|
|
489
|
+
before={
|
|
490
|
+
<Icon
|
|
491
|
+
color="blue"
|
|
492
|
+
icon="M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"
|
|
493
|
+
size="s"
|
|
494
|
+
/>
|
|
495
|
+
}
|
|
496
|
+
className="lumx-spacing-margin-horizontal"
|
|
497
|
+
label={
|
|
498
|
+
<h2
|
|
499
|
+
className="lumx-typography-title"
|
|
500
|
+
id="alert-dialog-title"
|
|
501
|
+
>
|
|
502
|
+
With Forwarded Props
|
|
503
|
+
</h2>
|
|
504
|
+
}
|
|
505
|
+
/>
|
|
506
|
+
</header>
|
|
507
|
+
<p
|
|
508
|
+
className="lumx-typography-body2 lumx-spacing-padding-vertical-big lumx-spacing-padding-horizontal-huge"
|
|
509
|
+
id="alert-dialog-description"
|
|
510
|
+
>
|
|
511
|
+
Consequat deserunt officia aute laborum tempor anim sint est.
|
|
512
|
+
</p>
|
|
513
|
+
<footer>
|
|
514
|
+
<Toolbar
|
|
515
|
+
after={
|
|
516
|
+
<React.Fragment>
|
|
517
|
+
<Button
|
|
518
|
+
emphasis="medium"
|
|
519
|
+
onClick={[Function]}
|
|
520
|
+
size="m"
|
|
521
|
+
style={
|
|
522
|
+
Object {
|
|
523
|
+
"color": "blue",
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
theme="light"
|
|
527
|
+
>
|
|
528
|
+
Cancel
|
|
529
|
+
</Button>
|
|
530
|
+
<Button
|
|
531
|
+
className="lumx-spacing-margin-left-regular"
|
|
532
|
+
color="blue"
|
|
533
|
+
emphasis="high"
|
|
534
|
+
onClick={[Function]}
|
|
535
|
+
size="m"
|
|
536
|
+
style={
|
|
537
|
+
Object {
|
|
538
|
+
"color": "red",
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
theme="light"
|
|
542
|
+
>
|
|
543
|
+
OK
|
|
544
|
+
</Button>
|
|
545
|
+
</React.Fragment>
|
|
546
|
+
}
|
|
547
|
+
className="lumx-spacing-margin-horizontal"
|
|
548
|
+
/>
|
|
549
|
+
</footer>
|
|
550
|
+
</Dialog>
|
|
551
|
+
`;
|
|
@@ -74,6 +74,11 @@ export interface AutocompleteProps extends GenericProps {
|
|
|
74
74
|
* @see {@link TextFieldProps#isDisabled}
|
|
75
75
|
*/
|
|
76
76
|
isDisabled?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Whether the component is required or not.
|
|
79
|
+
* @see {@link TextFieldProps#isRequired}
|
|
80
|
+
*/
|
|
81
|
+
isRequired?: boolean;
|
|
77
82
|
/**
|
|
78
83
|
* Whether the text field is displayed with valid style or not.
|
|
79
84
|
* @see {@link TextFieldProps#isValid}
|
|
@@ -200,6 +205,7 @@ export const Autocomplete: Comp<AutocompleteProps, HTMLDivElement> = forwardRef(
|
|
|
200
205
|
inputRef,
|
|
201
206
|
clearButtonProps,
|
|
202
207
|
isDisabled = disabled,
|
|
208
|
+
isRequired,
|
|
203
209
|
isOpen,
|
|
204
210
|
isValid,
|
|
205
211
|
label,
|
|
@@ -241,6 +247,7 @@ export const Autocomplete: Comp<AutocompleteProps, HTMLDivElement> = forwardRef(
|
|
|
241
247
|
inputRef={mergeRefs(inputAnchorRef, inputRef) as any}
|
|
242
248
|
clearButtonProps={clearButtonProps}
|
|
243
249
|
isDisabled={isDisabled}
|
|
250
|
+
isRequired={isRequired}
|
|
244
251
|
isValid={isValid}
|
|
245
252
|
label={label}
|
|
246
253
|
name={name}
|
|
@@ -79,6 +79,7 @@ export const AutocompleteMultiple: Comp<AutocompleteMultipleProps, HTMLDivElemen
|
|
|
79
79
|
inputRef,
|
|
80
80
|
clearButtonProps,
|
|
81
81
|
isDisabled,
|
|
82
|
+
isRequired,
|
|
82
83
|
isOpen,
|
|
83
84
|
isValid,
|
|
84
85
|
label,
|
|
@@ -126,6 +127,7 @@ export const AutocompleteMultiple: Comp<AutocompleteMultipleProps, HTMLDivElemen
|
|
|
126
127
|
inputRef={inputRef}
|
|
127
128
|
chips={values && values.map((chip: any, index: number) => selectedChipRender(chip, index, onClear))}
|
|
128
129
|
isDisabled={isDisabled}
|
|
130
|
+
isRequired={isRequired}
|
|
129
131
|
clearButtonProps={clearButtonProps}
|
|
130
132
|
isValid={isValid}
|
|
131
133
|
label={label}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { mdiSend } from '@lumx/icons';
|
|
1
|
+
import { mdiSend, mdiClose } from '@lumx/icons';
|
|
2
2
|
|
|
3
|
-
import { Button, ColorPalette, Emphasis, Size } from '@lumx/react';
|
|
3
|
+
import { Button, ColorPalette, Emphasis, IconButton, Size } from '@lumx/react';
|
|
4
4
|
import { boolean, select, text } from '@storybook/addon-knobs';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
@@ -36,3 +36,9 @@ export const DisabledWithHref = () => (
|
|
|
36
36
|
Disabled button with redirection
|
|
37
37
|
</Button>
|
|
38
38
|
);
|
|
39
|
+
|
|
40
|
+
export const IconButtonLowEmphasis = () => <IconButton emphasis={Emphasis.low} icon={mdiClose} label="Close" />;
|
|
41
|
+
|
|
42
|
+
export const IconButtonLowEmphasisHasBackground = () => (
|
|
43
|
+
<IconButton emphasis={Emphasis.low} hasBackground icon={mdiClose} label="Close" />
|
|
44
|
+
);
|
|
@@ -122,7 +122,7 @@ export const ButtonRoot: Comp<ButtonRootProps, HTMLButtonElement | HTMLAnchorEle
|
|
|
122
122
|
ColorPalette.dark;
|
|
123
123
|
|
|
124
124
|
if (hasBackground) {
|
|
125
|
-
return renderButtonWrapper({ ...props, variant, color: adaptedColor });
|
|
125
|
+
return renderButtonWrapper({ ...props, ref, variant, color: adaptedColor });
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
const buttonClassName = classNames(
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { mdiDotsHorizontal, mdiHeart, mdiReply } from '@lumx/icons';
|
|
2
3
|
import { Button, CommentBlock, Emphasis, Size } from '@lumx/react';
|
|
3
4
|
import { IconButton } from '@lumx/react/components/button/IconButton';
|
|
4
|
-
import
|
|
5
|
+
import { avatarImageKnob } from '@lumx/react/stories/knobs';
|
|
5
6
|
|
|
6
7
|
export default { title: 'LumX components/comment-block/CommentBlock' };
|
|
7
8
|
|
|
@@ -17,7 +18,7 @@ export const WithHeaderActions = ({ theme }: any) => (
|
|
|
17
18
|
</Button>,
|
|
18
19
|
]}
|
|
19
20
|
theme={theme}
|
|
20
|
-
avatarProps={{ image:
|
|
21
|
+
avatarProps={{ image: avatarImageKnob(), alt: 'Avatar' }}
|
|
21
22
|
date="4 hours ago"
|
|
22
23
|
name="Emmitt O. Lum"
|
|
23
24
|
text="All the rumors have finally died down and many skeptics have tightened their lips, the iPod does support video format now on its fifth generation."
|
|
@@ -2,7 +2,9 @@ import { mdiClose } from '@lumx/icons';
|
|
|
2
2
|
import {
|
|
3
3
|
Button,
|
|
4
4
|
Checkbox,
|
|
5
|
+
DatePickerField,
|
|
5
6
|
Emphasis,
|
|
7
|
+
FlexBox,
|
|
6
8
|
IconButton,
|
|
7
9
|
List,
|
|
8
10
|
ListItem,
|
|
@@ -196,6 +198,28 @@ export const ScrollableDialog = ({ theme }: any) => {
|
|
|
196
198
|
);
|
|
197
199
|
};
|
|
198
200
|
|
|
201
|
+
export const WithAnimationCallbacks = ({ theme }: any) => {
|
|
202
|
+
const { button, buttonRef, closeDialog, isOpen } = useOpenButton(theme);
|
|
203
|
+
const handleVisibiltyCallback = (isVisible: boolean) => {
|
|
204
|
+
alert(isVisible ? 'OPEN' : 'CLOSE');
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
return (
|
|
208
|
+
<>
|
|
209
|
+
{button}
|
|
210
|
+
<Dialog
|
|
211
|
+
isOpen={isOpen}
|
|
212
|
+
onClose={closeDialog}
|
|
213
|
+
size={Size.regular}
|
|
214
|
+
parentElement={buttonRef}
|
|
215
|
+
onVisibilityChange={handleVisibiltyCallback}
|
|
216
|
+
>
|
|
217
|
+
{content}
|
|
218
|
+
</Dialog>
|
|
219
|
+
</>
|
|
220
|
+
);
|
|
221
|
+
};
|
|
222
|
+
|
|
199
223
|
export const ScrollableDialogWithHeaderAndFooter = ({ theme }: any) => {
|
|
200
224
|
const { button, buttonRef, closeDialog, isOpen } = useOpenButton(theme);
|
|
201
225
|
return (
|
|
@@ -217,7 +241,7 @@ export const DialogWithFocusableElements = ({ theme }: any) => {
|
|
|
217
241
|
const inputRef = useRef(null);
|
|
218
242
|
|
|
219
243
|
const selectChoices = ['First item', 'Second item', 'Third item'];
|
|
220
|
-
const [value, setValue] = React.useState<string>(
|
|
244
|
+
const [value, setValue] = React.useState<string>(selectChoices[0]);
|
|
221
245
|
const [isSelectOpen, setSelectOpen] = useState(false);
|
|
222
246
|
const toggleSelect = () => setSelectOpen(!isSelectOpen);
|
|
223
247
|
const closeSelect = () => setSelectOpen(false);
|
|
@@ -225,6 +249,8 @@ export const DialogWithFocusableElements = ({ theme }: any) => {
|
|
|
225
249
|
closeSelect();
|
|
226
250
|
setValue(item);
|
|
227
251
|
};
|
|
252
|
+
const [date, setDate] = useState<Date | undefined>(new Date('2020-05-18'));
|
|
253
|
+
|
|
228
254
|
return (
|
|
229
255
|
<>
|
|
230
256
|
{button}
|
|
@@ -258,27 +284,41 @@ export const DialogWithFocusableElements = ({ theme }: any) => {
|
|
|
258
284
|
label="Checkbox input"
|
|
259
285
|
/>
|
|
260
286
|
|
|
261
|
-
<
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
{
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
287
|
+
<FlexBox orientation="horizontal">
|
|
288
|
+
<DatePickerField
|
|
289
|
+
locale="fr"
|
|
290
|
+
label="Start date"
|
|
291
|
+
placeholder="Pick a date"
|
|
292
|
+
theme={theme}
|
|
293
|
+
onChange={setDate}
|
|
294
|
+
value={date}
|
|
295
|
+
nextButtonProps={{ label: 'Next month' }}
|
|
296
|
+
previousButtonProps={{ label: 'Previous month' }}
|
|
297
|
+
/>
|
|
298
|
+
|
|
299
|
+
<Select
|
|
300
|
+
className="lumx-spacing-margin-left-huge"
|
|
301
|
+
isOpen={isSelectOpen}
|
|
302
|
+
value={value}
|
|
303
|
+
label="Select label"
|
|
304
|
+
onInputClick={toggleSelect}
|
|
305
|
+
onDropdownClose={closeSelect}
|
|
306
|
+
>
|
|
307
|
+
<List isClickable>
|
|
308
|
+
{selectChoices.map((choice) => (
|
|
309
|
+
<ListItem
|
|
310
|
+
key={choice}
|
|
311
|
+
isSelected={value === choice}
|
|
312
|
+
onItemSelected={selectItem(choice)}
|
|
313
|
+
size={Size.tiny}
|
|
314
|
+
>
|
|
315
|
+
{choice}
|
|
316
|
+
</ListItem>
|
|
317
|
+
))}
|
|
318
|
+
</List>
|
|
319
|
+
</Select>
|
|
320
|
+
</FlexBox>
|
|
321
|
+
|
|
282
322
|
{/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */}
|
|
283
323
|
<div tabIndex={0}>Focus div</div>
|
|
284
324
|
</div>
|