reshaped 3.8.0-canary.1 → 3.8.0-canary.10
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/CHANGELOG.md +83 -18
- package/dist/bundle.css +1 -1
- package/dist/bundle.d.ts +1 -1
- package/dist/bundle.js +11 -11
- package/dist/components/Accordion/AccordionControlled.js +1 -0
- package/dist/components/Actionable/Actionable.js +17 -3
- package/dist/components/Actionable/Actionable.module.css +1 -1
- package/dist/components/Actionable/Actionable.types.d.ts +15 -3
- package/dist/components/Actionable/tests/Actionable.stories.d.ts +13 -1
- package/dist/components/Actionable/tests/Actionable.stories.js +127 -7
- package/dist/components/Alert/tests/Alert.stories.d.ts +6 -5
- package/dist/components/Alert/tests/Alert.stories.js +15 -2
- package/dist/components/Autocomplete/Autocomplete.js +2 -2
- package/dist/components/Autocomplete/Autocomplete.types.d.ts +1 -1
- package/dist/components/Badge/Badge.module.css +1 -1
- package/dist/components/Badge/tests/Badge.stories.d.ts +5 -0
- package/dist/components/Badge/tests/Badge.stories.js +34 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +1 -0
- package/dist/components/Breadcrumbs/tests/Breadcrumbs.stories.d.ts +8 -4
- package/dist/components/Breadcrumbs/tests/Breadcrumbs.stories.js +57 -1
- package/dist/components/Button/Button.js +2 -2
- package/dist/components/Button/Button.types.d.ts +1 -1
- package/dist/components/Button/tests/Button.stories.d.ts +54 -12
- package/dist/components/Button/tests/Button.stories.js +725 -588
- package/dist/components/Calendar/CalendarMonth.js +1 -0
- package/dist/components/Card/Card.d.ts +1 -1
- package/dist/components/Card/Card.module.css +1 -1
- package/dist/components/Card/tests/Card.stories.d.ts +29 -7
- package/dist/components/Card/tests/Card.stories.js +110 -65
- package/dist/components/Carousel/Carousel.js +1 -0
- package/dist/components/Carousel/Carousel.module.css +1 -1
- package/dist/components/Checkbox/Checkbox.module.css +1 -1
- package/dist/components/Checkbox/tests/Checkbox.stories.d.ts +20 -4
- package/dist/components/Checkbox/tests/Checkbox.stories.js +150 -79
- package/dist/components/CheckboxGroup/tests/CheckboxGroup.stories.d.ts +9 -2
- package/dist/components/CheckboxGroup/tests/CheckboxGroup.stories.js +67 -35
- package/dist/components/Container/tests/Container.stories.d.ts +2 -0
- package/dist/components/Container/tests/Container.stories.js +14 -0
- package/dist/components/ContextMenu/tests/ContextMenu.stories.d.ts +10 -1
- package/dist/components/ContextMenu/tests/ContextMenu.stories.js +57 -13
- package/dist/components/Dismissible/tests/Dismissible.stories.d.ts +5 -0
- package/dist/components/Dismissible/tests/Dismissible.stories.js +30 -1
- package/dist/components/Divider/tests/Divider.stories.d.ts +8 -3
- package/dist/components/Divider/tests/Divider.stories.js +71 -41
- package/dist/components/DropdownMenu/DropdownMenu.js +4 -4
- package/dist/components/DropdownMenu/DropdownMenu.types.d.ts +2 -2
- package/dist/components/DropdownMenu/tests/DropdownMenu.stories.d.ts +35 -6
- package/dist/components/DropdownMenu/tests/DropdownMenu.stories.js +222 -115
- package/dist/components/DropdownMenu/tests/DropdownMenu.test.stories.d.ts +0 -15
- package/dist/components/DropdownMenu/tests/DropdownMenu.test.stories.js +0 -106
- package/dist/components/FileUpload/FileUpload.module.css +1 -1
- package/dist/components/Flyout/Flyout.module.css +1 -1
- package/dist/components/Flyout/Flyout.types.d.ts +7 -7
- package/dist/components/Flyout/FlyoutContent.js +4 -1
- package/dist/components/Flyout/FlyoutControlled.js +10 -3
- package/dist/components/Flyout/index.d.ts +1 -1
- package/dist/components/Flyout/tests/Flyout.stories.d.ts +8 -0
- package/dist/components/Flyout/tests/Flyout.stories.js +81 -33
- package/dist/components/Flyout/useFlyout.d.ts +1 -7
- package/dist/components/Flyout/useFlyout.js +5 -1
- package/dist/components/Flyout/utilities/calculatePosition.d.ts +3 -2
- package/dist/components/Flyout/utilities/calculatePosition.js +47 -22
- package/dist/components/Flyout/utilities/flyout.js +3 -2
- package/dist/components/Flyout/utilities/getPositionFallbacks.js +3 -3
- package/dist/components/Flyout/utilities/isFullyVisible.d.ts +0 -2
- package/dist/components/Flyout/utilities/isFullyVisible.js +5 -7
- package/dist/components/FormControl/FormControl.context.d.ts +1 -1
- package/dist/components/FormControl/tests/FormControl.stories.d.ts +2 -0
- package/dist/components/FormControl/tests/FormControl.stories.js +35 -0
- package/dist/components/Hidden/tests/Hidden.stories.d.ts +2 -0
- package/dist/components/Hidden/tests/Hidden.stories.js +9 -0
- package/dist/components/HiddenVisually/tests/HiddenVisually.stories.d.ts +2 -0
- package/dist/components/HiddenVisually/tests/HiddenVisually.stories.js +9 -0
- package/dist/components/Hotkey/tests/Hotkey.stories.d.ts +2 -0
- package/dist/components/Hotkey/tests/Hotkey.stories.js +15 -0
- package/dist/components/Icon/Icon.js +2 -2
- package/dist/components/Icon/Icon.types.d.ts +1 -1
- package/dist/components/Icon/tests/Icon.stories.d.ts +3 -0
- package/dist/components/Icon/tests/Icon.stories.js +29 -1
- package/dist/components/Link/Link.d.ts +1 -1
- package/dist/components/Link/Link.js +2 -2
- package/dist/components/Link/Link.types.d.ts +1 -1
- package/dist/components/Link/tests/Link.stories.d.ts +29 -6
- package/dist/components/Link/tests/Link.stories.js +141 -58
- package/dist/components/Link/tests/Link.test.stories.d.ts +1 -13
- package/dist/components/Link/tests/Link.test.stories.js +0 -76
- package/dist/components/Loader/tests/Loader.stories.d.ts +11 -2
- package/dist/components/Loader/tests/Loader.stories.js +52 -25
- package/dist/components/Loader/tests/Loader.test.stories.d.ts +0 -3
- package/dist/components/Loader/tests/Loader.test.stories.js +0 -21
- package/dist/components/MenuItem/MenuItem.js +2 -2
- package/dist/components/MenuItem/MenuItem.module.css +1 -1
- package/dist/components/MenuItem/MenuItem.types.d.ts +1 -1
- package/dist/components/MenuItem/tests/MenuItem.stories.d.ts +37 -7
- package/dist/components/MenuItem/tests/MenuItem.stories.js +218 -112
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/Modal.module.css +1 -1
- package/dist/components/Modal/tests/Modal.stories.d.ts +53 -10
- package/dist/components/Modal/tests/Modal.stories.js +367 -210
- package/dist/components/Overlay/Overlay.js +2 -1
- package/dist/components/Overlay/tests/Overlay.stories.d.ts +15 -1
- package/dist/components/Overlay/tests/Overlay.stories.js +135 -1
- package/dist/components/Pagination/tests/Pagination.stories.d.ts +14 -1
- package/dist/components/Pagination/tests/Pagination.stories.js +93 -15
- package/dist/components/PinField/tests/PinField.stories.d.ts +1 -1
- package/dist/components/PinField/tests/PinField.stories.js +1 -1
- package/dist/components/Popover/Popover.js +2 -2
- package/dist/components/Popover/Popover.module.css +1 -1
- package/dist/components/Popover/Popover.types.d.ts +3 -1
- package/dist/components/Progress/tests/Progress.stories.d.ts +19 -4
- package/dist/components/Progress/tests/Progress.stories.js +85 -49
- package/dist/components/Radio/Radio.module.css +1 -1
- package/dist/components/Radio/tests/Radio.stories.d.ts +25 -4
- package/dist/components/Radio/tests/Radio.stories.js +147 -65
- package/dist/components/RadioGroup/tests/RadioGroup.stories.d.ts +9 -2
- package/dist/components/RadioGroup/tests/RadioGroup.stories.js +64 -38
- package/dist/components/Reshaped/Reshaped.css +1 -1
- package/dist/components/Scrim/tests/Scrim.stories.d.ts +10 -2
- package/dist/components/Scrim/tests/Scrim.stories.js +51 -31
- package/dist/components/ScrollArea/ScrollArea.module.css +1 -1
- package/dist/components/Select/Select.d.ts +8 -1
- package/dist/components/Select/Select.js +22 -48
- package/dist/components/Select/Select.module.css +1 -1
- package/dist/components/Select/Select.types.d.ts +83 -38
- package/dist/components/Select/SelectCustom.d.ts +3 -0
- package/dist/components/Select/SelectCustom.js +12 -0
- package/dist/components/Select/SelectCustomControlled.d.ts +4 -0
- package/dist/components/Select/SelectCustomControlled.js +105 -0
- package/dist/components/Select/SelectCustomUncontrolled.d.ts +4 -0
- package/dist/components/Select/SelectCustomUncontrolled.js +18 -0
- package/dist/components/Select/SelectEndContent.d.ts +3 -0
- package/dist/components/Select/SelectEndContent.js +12 -0
- package/dist/components/Select/SelectNative.d.ts +4 -0
- package/dist/components/Select/SelectNative.js +29 -0
- package/dist/components/Select/SelectOption.d.ts +4 -0
- package/dist/components/Select/SelectOption.js +13 -0
- package/dist/components/Select/SelectOptionGroup.d.ts +4 -0
- package/dist/components/Select/SelectOptionGroup.js +9 -0
- package/dist/components/Select/SelectRoot.d.ts +4 -0
- package/dist/components/Select/SelectRoot.js +21 -0
- package/dist/components/Select/SelectStartContent.d.ts +3 -0
- package/dist/components/Select/SelectStartContent.js +20 -0
- package/dist/components/Select/SelectTrigger.d.ts +4 -0
- package/dist/components/Select/SelectTrigger.js +16 -0
- package/dist/components/Select/tests/Select.stories.d.ts +38 -10
- package/dist/components/Select/tests/Select.stories.js +504 -175
- package/dist/components/Skeleton/tests/Skeleton.stories.d.ts +10 -2
- package/dist/components/Skeleton/tests/Skeleton.stories.js +46 -28
- package/dist/components/Slider/Slider.module.css +1 -1
- package/dist/components/Stepper/Stepper.js +2 -2
- package/dist/components/Stepper/Stepper.types.d.ts +2 -0
- package/dist/components/Stepper/tests/Stepper.stories.d.ts +18 -3
- package/dist/components/Stepper/tests/Stepper.stories.js +99 -47
- package/dist/components/Switch/Switch.module.css +1 -1
- package/dist/components/Switch/tests/Switch.stories.d.ts +10 -2
- package/dist/components/Switch/tests/Switch.stories.js +77 -23
- package/dist/components/Switch/tests/Switch.test.stories.d.ts +0 -10
- package/dist/components/Switch/tests/Switch.test.stories.js +0 -68
- package/dist/components/Table/Table.js +5 -3
- package/dist/components/Table/Table.module.css +1 -1
- package/dist/components/Table/tests/Table.stories.d.ts +25 -5
- package/dist/components/Table/tests/Table.stories.js +274 -177
- package/dist/components/Table/tests/Table.test.stories.d.ts +0 -5
- package/dist/components/Table/tests/Table.test.stories.js +0 -82
- package/dist/components/Tabs/Tabs.module.css +1 -1
- package/dist/components/Tabs/TabsControlled.js +1 -0
- package/dist/components/TextArea/TextArea.module.css +1 -1
- package/dist/components/TextArea/tests/TextArea.stories.d.ts +41 -9
- package/dist/components/TextArea/tests/TextArea.stories.js +179 -93
- package/dist/components/TextField/TextField.js +1 -1
- package/dist/components/TextField/TextField.module.css +1 -1
- package/dist/components/TextField/tests/TextField.stories.d.ts +41 -11
- package/dist/components/TextField/tests/TextField.stories.js +206 -132
- package/dist/components/TextField/tests/TextField.test.stories.d.ts +0 -13
- package/dist/components/TextField/tests/TextField.test.stories.js +0 -88
- package/dist/components/Theme/Theme.module.css +1 -1
- package/dist/components/Timeline/Timeline.js +2 -2
- package/dist/components/Timeline/tests/Timeline.stories.d.ts +10 -2
- package/dist/components/Timeline/tests/Timeline.stories.js +69 -45
- package/dist/components/Timeline/tests/Timeline.test.stories.d.ts +0 -2
- package/dist/components/Timeline/tests/Timeline.test.stories.js +0 -21
- package/dist/components/Toast/ToastContainer.js +1 -0
- package/dist/components/Toast/ToastRegion.js +1 -0
- package/dist/components/Toast/tests/Toast.stories.d.ts +32 -8
- package/dist/components/Toast/tests/Toast.stories.js +111 -37
- package/dist/components/ToggleButton/ToggleButton.types.d.ts +1 -1
- package/dist/components/ToggleButtonGroup/ToggleButtonGroupControlled.js +1 -0
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/Tooltip/Tooltip.types.d.ts +2 -2
- package/dist/components/Tooltip/tests/Tooltip.stories.d.ts +18 -4
- package/dist/components/Tooltip/tests/Tooltip.stories.js +139 -107
- package/dist/components/Tooltip/tests/Tooltip.test.stories.d.ts +0 -6
- package/dist/components/Tooltip/tests/Tooltip.test.stories.js +0 -29
- package/dist/components/View/View.js +11 -4
- package/dist/components/View/tests/View.stories.d.ts +4 -0
- package/dist/components/View/tests/View.stories.js +39 -0
- package/dist/components/_private/Expandable/Expandable.js +3 -1
- package/dist/components/_private/Portal/Portal.js +4 -1
- package/dist/hooks/_private/useIsDismissible.d.ts +1 -0
- package/dist/hooks/_private/useIsDismissible.js +6 -6
- package/dist/hooks/_private/usePrevious.js +1 -0
- package/dist/hooks/tests/useDrag.stories.js +1 -1
- package/dist/hooks/useScrollLock.js +5 -3
- package/dist/index.d.ts +1 -1
- package/dist/styles/resolvers/align/align.css +1 -1
- package/dist/styles/resolvers/aspectRatio/aspectRatio.css +1 -1
- package/dist/styles/resolvers/bleed/bleed.module.css +1 -1
- package/dist/styles/resolvers/justify/justify.css +1 -1
- package/dist/styles/resolvers/maxHeight/maxHeight.module.css +1 -1
- package/dist/styles/resolvers/maxWidth/maxWidth.module.css +1 -1
- package/dist/styles/resolvers/minHeight/minHeight.module.css +1 -1
- package/dist/styles/resolvers/minWidth/minWidth.module.css +1 -1
- package/dist/styles/resolvers/position/position.css +1 -1
- package/dist/styles/resolvers/textAlign/textAlign.css +1 -1
- package/dist/styles/resolvers/width/width.module.css +1 -1
- package/dist/utilities/scroll/disable.js +2 -2
- package/dist/utilities/scroll/index.d.ts +1 -1
- package/dist/utilities/scroll/index.js +1 -1
- package/dist/utilities/scroll/lock.d.ts +1 -2
- package/dist/utilities/scroll/lock.js +16 -15
- package/dist/utilities/scroll/lockSafari.js +1 -0
- package/package.json +23 -23
- package/dist/components/Actionable/tests/Actionable.test.stories.d.ts +0 -32
- package/dist/components/Actionable/tests/Actionable.test.stories.js +0 -130
- package/dist/components/Alert/tests/Alert.test.stories.d.ts +0 -15
- package/dist/components/Alert/tests/Alert.test.stories.js +0 -26
- package/dist/components/Badge/tests/Badge.test.stories.d.ts +0 -20
- package/dist/components/Badge/tests/Badge.test.stories.js +0 -46
- package/dist/components/Breadcrumbs/tests/Breadcrumbs.test.stories.d.ts +0 -23
- package/dist/components/Breadcrumbs/tests/Breadcrumbs.test.stories.js +0 -76
- package/dist/components/Button/tests/Button.test.stories.d.ts +0 -27
- package/dist/components/Button/tests/Button.test.stories.js +0 -112
- package/dist/components/Card/tests/Card.test.stories.d.ts +0 -35
- package/dist/components/Card/tests/Card.test.stories.js +0 -54
- package/dist/components/Checkbox/tests/Checkbox.test.stories.d.ts +0 -25
- package/dist/components/Checkbox/tests/Checkbox.test.stories.js +0 -104
- package/dist/components/CheckboxGroup/tests/CheckboxGroup.test.stories.d.ts +0 -22
- package/dist/components/CheckboxGroup/tests/CheckboxGroup.test.stories.js +0 -78
- package/dist/components/Container/tests/Container.test.stories.d.ts +0 -15
- package/dist/components/Container/tests/Container.test.stories.js +0 -26
- package/dist/components/ContextMenu/tests/ContextMenu.test.stories.d.ts +0 -25
- package/dist/components/ContextMenu/tests/ContextMenu.test.stories.js +0 -53
- package/dist/components/Dismissible/tests/Dismissible.test.stories.d.ts +0 -19
- package/dist/components/Dismissible/tests/Dismissible.test.stories.js +0 -42
- package/dist/components/Divider/tests/Divider.test.stories.d.ts +0 -18
- package/dist/components/Divider/tests/Divider.test.stories.js +0 -47
- package/dist/components/FormControl/tests/FormControl.test.stories.d.ts +0 -20
- package/dist/components/FormControl/tests/FormControl.test.stories.js +0 -49
- package/dist/components/Hidden/tests/Hidden.test.stories.d.ts +0 -15
- package/dist/components/Hidden/tests/Hidden.test.stories.js +0 -20
- package/dist/components/HiddenVisually/tests/HiddenVisually.test.stories.d.ts +0 -15
- package/dist/components/HiddenVisually/tests/HiddenVisually.test.stories.js +0 -20
- package/dist/components/Hotkey/tests/Hotkey.test.stories.d.ts +0 -15
- package/dist/components/Hotkey/tests/Hotkey.test.stories.js +0 -26
- package/dist/components/Icon/tests/Icon.test.stories.d.ts +0 -16
- package/dist/components/Icon/tests/Icon.test.stories.js +0 -35
- package/dist/components/MenuItem/tests/MenuItem.test.stories.d.ts +0 -26
- package/dist/components/MenuItem/tests/MenuItem.test.stories.js +0 -100
- package/dist/components/Modal/tests/Modal.test.stories.d.ts +0 -31
- package/dist/components/Modal/tests/Modal.test.stories.js +0 -149
- package/dist/components/Overlay/tests/Overlay.test.stories.d.ts +0 -28
- package/dist/components/Overlay/tests/Overlay.test.stories.js +0 -148
- package/dist/components/Pagination/tests/Pagination.test.stories.d.ts +0 -23
- package/dist/components/Pagination/tests/Pagination.test.stories.js +0 -86
- package/dist/components/Progress/tests/Progress.test.stories.d.ts +0 -16
- package/dist/components/Progress/tests/Progress.test.stories.js +0 -35
- package/dist/components/Radio/tests/Radio.test.stories.d.ts +0 -30
- package/dist/components/Radio/tests/Radio.test.stories.js +0 -118
- package/dist/components/RadioGroup/tests/RadioGroup.test.stories.d.ts +0 -22
- package/dist/components/RadioGroup/tests/RadioGroup.test.stories.js +0 -78
- package/dist/components/Scrim/tests/Scrim.test.stories.d.ts +0 -15
- package/dist/components/Scrim/tests/Scrim.test.stories.js +0 -25
- package/dist/components/Select/tests/Select.test.stories.d.ts +0 -27
- package/dist/components/Select/tests/Select.test.stories.js +0 -132
- package/dist/components/Skeleton/tests/Skeleton.test.stories.d.ts +0 -15
- package/dist/components/Skeleton/tests/Skeleton.test.stories.js +0 -23
- package/dist/components/Stepper/tests/Stepper.test.stories.d.ts +0 -20
- package/dist/components/Stepper/tests/Stepper.test.stories.js +0 -28
- package/dist/components/TextArea/tests/TextArea.test.stories.d.ts +0 -28
- package/dist/components/TextArea/tests/TextArea.test.stories.js +0 -99
- package/dist/components/Toast/tests/Toast.test.stories.d.ts +0 -16
- package/dist/components/Toast/tests/Toast.test.stories.js +0 -101
- package/dist/components/View/tests/View.test.stories.d.ts +0 -24
- package/dist/components/View/tests/View.test.stories.js +0 -50
@@ -6,6 +6,7 @@ import View from "../../View/index.js";
|
|
6
6
|
import Text from "../../Text/index.js";
|
7
7
|
import Button from "../../Button/index.js";
|
8
8
|
import Badge from "../../Badge/index.js";
|
9
|
+
import { expect, fn, userEvent } from "storybook/test";
|
9
10
|
export default {
|
10
11
|
title: "Components/TextField",
|
11
12
|
component: TextField,
|
@@ -15,143 +16,216 @@ export default {
|
|
15
16
|
},
|
16
17
|
},
|
17
18
|
};
|
18
|
-
export const
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
export const variant = {
|
20
|
+
name: "variant",
|
21
|
+
render: () => (<Example>
|
22
|
+
<Example.Item title="variant: faded">
|
23
|
+
<TextField variant="faded" name="Name" placeholder="Enter your name"/>
|
24
|
+
</Example.Item>
|
22
25
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
</Example.Item>
|
35
|
-
|
36
|
-
<Example.Item title="variant: headless">
|
37
|
-
<TextField variant="headless" name="Name" placeholder="Enter your name"/>
|
38
|
-
</Example.Item>
|
39
|
-
</Example>);
|
40
|
-
export const rounded = () => (<Example>
|
41
|
-
<Example.Item title="rounded">
|
42
|
-
<TextField rounded name="Name" placeholder="Enter your name" icon={IconZap} prefix="+31" endSlot={<Button rounded size="small" icon={IconZap}/>}/>
|
43
|
-
</Example.Item>
|
44
|
-
|
45
|
-
<Example.Item title="rounded, variant: faded">
|
46
|
-
<View direction="row" gap={2}>
|
47
|
-
<View.Item grow>
|
48
|
-
<TextField rounded variant="faded" name="Name" placeholder="Enter your name" startSlot={<Badge rounded size="small">
|
49
|
-
Hello
|
50
|
-
</Badge>}/>
|
51
|
-
</View.Item>
|
52
|
-
<Button rounded>Submit</Button>
|
53
|
-
</View>
|
54
|
-
</Example.Item>
|
55
|
-
</Example>);
|
56
|
-
export const disabled = () => (<Example>
|
57
|
-
<Example.Item title="disabled, no value">
|
58
|
-
<TextField name="Name" placeholder="Enter your name" disabled/>
|
59
|
-
</Example.Item>
|
60
|
-
<Example.Item title="disabled, value">
|
61
|
-
<TextField name="Name" placeholder="Enter your name" disabled value="Reshaped"/>
|
62
|
-
</Example.Item>
|
63
|
-
</Example>);
|
64
|
-
export const error = () => (<Example>
|
65
|
-
<Example.Item title="error">
|
66
|
-
<TextField name="Name" placeholder="Enter your name" hasError/>
|
67
|
-
</Example.Item>
|
68
|
-
</Example>);
|
69
|
-
export const attachments = () => (<Example>
|
70
|
-
<Example.Item title="icon">
|
71
|
-
<TextField name="Name" placeholder="Enter your name" value="Reshaped" icon={IconZap}/>
|
72
|
-
</Example.Item>
|
73
|
-
<Example.Item title="endIcon">
|
74
|
-
<TextField name="Name" placeholder="Enter your name" value="Reshaped" endIcon={IconZap}/>
|
75
|
-
</Example.Item>
|
26
|
+
<Example.Item title="variant: headless">
|
27
|
+
<TextField variant="headless" name="Name" placeholder="Enter your name"/>
|
28
|
+
</Example.Item>
|
29
|
+
</Example>),
|
30
|
+
};
|
31
|
+
export const rounded = {
|
32
|
+
name: "rounded",
|
33
|
+
render: () => (<Example>
|
34
|
+
<Example.Item title="rounded">
|
35
|
+
<TextField rounded name="Name" placeholder="Enter your name" icon={IconZap} prefix="+31" endSlot={<Button rounded size="small" icon={IconZap}/>}/>
|
36
|
+
</Example.Item>
|
76
37
|
|
77
|
-
|
78
|
-
|
79
|
-
|
38
|
+
<Example.Item title="rounded, variant: faded">
|
39
|
+
<View direction="row" gap={2}>
|
40
|
+
<View.Item grow>
|
41
|
+
<TextField rounded variant="faded" name="Name" placeholder="Enter your name" startSlot={<Badge rounded size="small">
|
42
|
+
Hello
|
43
|
+
</Badge>}/>
|
44
|
+
</View.Item>
|
45
|
+
<Button rounded>Submit</Button>
|
46
|
+
</View>
|
47
|
+
</Example.Item>
|
48
|
+
</Example>),
|
49
|
+
};
|
50
|
+
export const error = {
|
51
|
+
name: "hasError",
|
52
|
+
render: () => (<Example>
|
53
|
+
<Example.Item title="error">
|
54
|
+
<TextField name="Name" placeholder="Enter your name" hasError/>
|
55
|
+
</Example.Item>
|
56
|
+
</Example>),
|
57
|
+
};
|
58
|
+
export const attachments = {
|
59
|
+
name: "icon, endIcon, suffix, prefix, startSlot, endSlot",
|
60
|
+
render: () => (<Example>
|
61
|
+
<Example.Item title="icon">
|
62
|
+
<TextField name="Name" placeholder="Enter your name" value="Reshaped" icon={IconZap}/>
|
63
|
+
</Example.Item>
|
64
|
+
<Example.Item title="endIcon">
|
65
|
+
<TextField name="Name" placeholder="Enter your name" value="Reshaped" endIcon={IconZap}/>
|
66
|
+
</Example.Item>
|
80
67
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
</Example>);
|
85
|
-
export const size = () => (<Example>
|
86
|
-
<Example.Item title="size: small">
|
87
|
-
<TextField name="Name" placeholder="Enter your name" size="small" icon={IconZap}/>
|
88
|
-
</Example.Item>
|
68
|
+
<Example.Item title="width affixes">
|
69
|
+
<TextField name="Name" placeholder="Enter your name" value="Reshaped" endIcon={IconZap} icon={IconZap} prefix="Estimated value" suffix="m2"/>
|
70
|
+
</Example.Item>
|
89
71
|
|
90
|
-
|
91
|
-
|
92
|
-
|
72
|
+
<Example.Item title={["startSlot", "vertical and horizontal padding aligned"]}>
|
73
|
+
<TextField name="Name" placeholder="Enter your name" value="Reshaped" startSlot={<Placeholder h={20}/>}/>
|
74
|
+
</Example.Item>
|
75
|
+
<Example.Item title={["endSlot", "vertical and horizontal padding aligned"]}>
|
76
|
+
<TextField name="Name" placeholder="Enter your name" value="Reshaped" endSlot={<Button icon={IconZap} size="small" onClick={() => { }} attributes={{ "aria-label": "Action" }}/>}/>
|
77
|
+
</Example.Item>
|
78
|
+
<Example.Item title="multiline wrap">
|
79
|
+
<TextField name="Name" placeholder="Enter your name" value="Reshaped" startSlot={[...Array(10).keys()].map((i) => (<Badge size="small" key={i}>
|
80
|
+
Item {i + 1}
|
81
|
+
</Badge>))} multiline/>
|
82
|
+
</Example.Item>
|
83
|
+
</Example>),
|
84
|
+
};
|
85
|
+
export const size = {
|
86
|
+
name: "size",
|
87
|
+
render: () => (<Example>
|
88
|
+
<Example.Item title="size: small">
|
89
|
+
<TextField name="Name" placeholder="Enter your name" size="small" icon={IconZap}/>
|
90
|
+
</Example.Item>
|
93
91
|
|
94
|
-
|
95
|
-
|
96
|
-
|
92
|
+
<Example.Item title="size: medium">
|
93
|
+
<TextField name="Name" placeholder="Enter your name" size="medium" icon={IconZap}/>
|
94
|
+
</Example.Item>
|
97
95
|
|
98
|
-
|
99
|
-
|
100
|
-
|
96
|
+
<Example.Item title="size: large">
|
97
|
+
<TextField name="Name" placeholder="Enter your name" size="large" icon={IconZap}/>
|
98
|
+
</Example.Item>
|
101
99
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
</Example>);
|
106
|
-
export const affixes = () => (<Example>
|
107
|
-
<Example.Item title="prefix">
|
108
|
-
<TextField name="phone" placeholder="Enter your phone number" value="Reshaped" prefix="+31"/>
|
109
|
-
</Example.Item>
|
100
|
+
<Example.Item title="size: xlarge">
|
101
|
+
<TextField name="Name" placeholder="Enter your name" size="xlarge" icon={IconZap}/>
|
102
|
+
</Example.Item>
|
110
103
|
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
104
|
+
<Example.Item title={["responsive size", "[s] xlarge", "[m+] medium"]}>
|
105
|
+
<TextField name="Name" placeholder="Enter your name" size={{ s: "xlarge", m: "medium" }} icon={IconZap}/>
|
106
|
+
</Example.Item>
|
107
|
+
</Example>),
|
108
|
+
};
|
109
|
+
export const aligner = {
|
110
|
+
name: "aligner",
|
111
|
+
render: () => (<Example>
|
112
|
+
<Example.Item title="aligner">
|
113
|
+
<View gap={2}>
|
114
|
+
<Text variant="featured-2">What problem are you trying to solve?</Text>
|
115
|
+
<TextField.Aligner>
|
116
|
+
<TextField variant="headless" placeholder="Try something like 'I have a job'" name="description"/>
|
117
|
+
</TextField.Aligner>
|
118
|
+
<View.Item>
|
119
|
+
<Button>Next</Button>
|
120
|
+
</View.Item>
|
121
|
+
</View>
|
122
|
+
</Example.Item>
|
123
|
+
</Example>),
|
124
|
+
};
|
125
|
+
export const render = {
|
126
|
+
name: "base",
|
127
|
+
render: () => <TextField name="test-name" inputAttributes={{ "aria-label": "Label" }}/>,
|
128
|
+
play: async ({ canvas }) => {
|
129
|
+
const input = canvas.getByRole("textbox");
|
130
|
+
expect(input).toHaveAttribute("name", "test-name");
|
131
|
+
expect(input).toHaveAccessibleName("Label");
|
132
|
+
},
|
133
|
+
};
|
134
|
+
export const placeholder = {
|
135
|
+
name: "placeholder",
|
136
|
+
render: () => (<TextField name="test-name" placeholder="Placeholder" inputAttributes={{ "aria-label": "Label" }}/>),
|
137
|
+
play: async ({ canvas }) => {
|
138
|
+
const input = canvas.getByRole("textbox");
|
139
|
+
expect(input).toHaveValue("");
|
140
|
+
expect(input).toHaveAttribute("placeholder", "Placeholder");
|
141
|
+
},
|
142
|
+
};
|
143
|
+
export const id = {
|
144
|
+
name: "id",
|
145
|
+
render: () => (<TextField name="test-name" id="test-id" inputAttributes={{ "aria-label": "Label" }}/>),
|
146
|
+
play: async ({ canvas }) => {
|
147
|
+
const input = canvas.getByRole("textbox");
|
148
|
+
expect(input).toHaveAttribute("id", "test-id");
|
149
|
+
},
|
150
|
+
};
|
151
|
+
export const disabled = {
|
152
|
+
name: "disabled",
|
153
|
+
render: () => <TextField name="test-name" disabled inputAttributes={{ "aria-label": "Label" }}/>,
|
154
|
+
play: async ({ canvas }) => {
|
155
|
+
const input = canvas.getByRole("textbox");
|
156
|
+
expect(input).toBeDisabled();
|
157
|
+
},
|
158
|
+
};
|
159
|
+
export const defaultValue = {
|
160
|
+
name: "defaultValue, uncontrolled",
|
161
|
+
args: {
|
162
|
+
handleChange: fn(),
|
163
|
+
},
|
164
|
+
render: (args) => (<TextField name="test-name" defaultValue="value" onChange={args.handleChange} inputAttributes={{ "aria-label": "Label" }}/>),
|
165
|
+
play: async ({ canvas, args }) => {
|
166
|
+
const input = canvas.getByRole("textbox");
|
167
|
+
expect(input).toHaveValue("value");
|
168
|
+
input.focus();
|
169
|
+
await userEvent.keyboard("2");
|
170
|
+
expect(args.handleChange).toBeCalledTimes(1);
|
171
|
+
expect(args.handleChange).toHaveBeenCalledWith({
|
172
|
+
name: "test-name",
|
173
|
+
value: "value2",
|
174
|
+
event: expect.objectContaining({ target: input }),
|
175
|
+
});
|
176
|
+
expect(input).toHaveValue("value2");
|
177
|
+
},
|
178
|
+
};
|
179
|
+
export const value = {
|
180
|
+
name: "value, controlled",
|
181
|
+
args: {
|
182
|
+
handleChange: fn(),
|
183
|
+
},
|
184
|
+
render: (args) => (<TextField name="test-name" value="value" onChange={args.handleChange} inputAttributes={{ "aria-label": "Label" }}/>),
|
185
|
+
play: async ({ canvas, args }) => {
|
186
|
+
const input = canvas.getByRole("textbox");
|
187
|
+
expect(input).toHaveValue("value");
|
188
|
+
input.focus();
|
189
|
+
await userEvent.keyboard("2");
|
190
|
+
expect(args.handleChange).toBeCalledTimes(1);
|
191
|
+
expect(args.handleChange).toHaveBeenCalledWith({
|
192
|
+
name: "test-name",
|
193
|
+
value: "value2",
|
194
|
+
event: expect.objectContaining({ target: input }),
|
195
|
+
});
|
196
|
+
expect(input).toHaveValue("value");
|
197
|
+
},
|
198
|
+
};
|
199
|
+
export const className = {
|
200
|
+
name: "className, attributes",
|
201
|
+
render: () => (<div data-testid="root">
|
202
|
+
<TextField className="test-classname" attributes={{ id: "test-id" }} name="name" inputAttributes={{ id: "test-input-id", "aria-label": "Label" }}/>
|
203
|
+
</div>),
|
204
|
+
play: async ({ canvas }) => {
|
205
|
+
const root = canvas.getByTestId("root").firstChild;
|
206
|
+
const input = canvas.getByRole("textbox");
|
207
|
+
expect(root).toHaveClass("test-classname");
|
208
|
+
expect(root).toHaveAttribute("id", "test-id");
|
209
|
+
expect(input).toHaveAttribute("id", "test-input-id");
|
210
|
+
},
|
211
|
+
};
|
212
|
+
export const formControl = {
|
213
|
+
name: "test: form control",
|
214
|
+
render: () => (<Example>
|
215
|
+
<Example.Item title="with helper">
|
216
|
+
<FormControl>
|
217
|
+
<FormControl.Label>Name</FormControl.Label>
|
218
|
+
<TextField name="name" placeholder="Enter your name"/>
|
219
|
+
<FormControl.Helper>Helper</FormControl.Helper>
|
220
|
+
<FormControl.Error>This field is required</FormControl.Error>
|
221
|
+
</FormControl>
|
222
|
+
</Example.Item>
|
223
|
+
<Example.Item title="with error">
|
224
|
+
<FormControl hasError>
|
225
|
+
<FormControl.Label>Name</FormControl.Label>
|
226
|
+
<TextField name="name" placeholder="Enter your name"/>
|
227
|
+
<FormControl.Error>This field is required</FormControl.Error>
|
228
|
+
</FormControl>
|
229
|
+
</Example.Item>
|
230
|
+
</Example>),
|
231
|
+
};
|
@@ -1,5 +1,3 @@
|
|
1
|
-
import { StoryObj } from "@storybook/react-vite";
|
2
|
-
import { fn } from "storybook/test";
|
3
1
|
declare const _default: {
|
4
2
|
title: string;
|
5
3
|
component: import("react").FC<import("./..").TextFieldProps> & {
|
@@ -15,14 +13,3 @@ declare const _default: {
|
|
15
13
|
};
|
16
14
|
};
|
17
15
|
export default _default;
|
18
|
-
export declare const render: StoryObj;
|
19
|
-
export declare const placeholder: StoryObj;
|
20
|
-
export declare const id: StoryObj;
|
21
|
-
export declare const disabled: StoryObj;
|
22
|
-
export declare const defaultValue: StoryObj<{
|
23
|
-
handleChange: ReturnType<typeof fn>;
|
24
|
-
}>;
|
25
|
-
export declare const value: StoryObj<{
|
26
|
-
handleChange: ReturnType<typeof fn>;
|
27
|
-
}>;
|
28
|
-
export declare const className: StoryObj;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { expect, fn, userEvent } from "storybook/test";
|
2
1
|
import TextField from "../index.js";
|
3
2
|
export default {
|
4
3
|
title: "Components/TextField/tests",
|
@@ -10,90 +9,3 @@ export default {
|
|
10
9
|
chromatic: { disableSnapshot: true },
|
11
10
|
},
|
12
11
|
};
|
13
|
-
export const render = {
|
14
|
-
name: "base",
|
15
|
-
render: () => <TextField name="test-name" inputAttributes={{ "aria-label": "Label" }}/>,
|
16
|
-
play: async ({ canvas }) => {
|
17
|
-
const input = canvas.getByRole("textbox");
|
18
|
-
expect(input).toHaveAttribute("name", "test-name");
|
19
|
-
expect(input).toHaveAccessibleName("Label");
|
20
|
-
},
|
21
|
-
};
|
22
|
-
export const placeholder = {
|
23
|
-
name: "placeholder",
|
24
|
-
render: () => (<TextField name="test-name" placeholder="Placeholder" inputAttributes={{ "aria-label": "Label" }}/>),
|
25
|
-
play: async ({ canvas }) => {
|
26
|
-
const input = canvas.getByRole("textbox");
|
27
|
-
expect(input).toHaveValue("");
|
28
|
-
expect(input).toHaveAttribute("placeholder", "Placeholder");
|
29
|
-
},
|
30
|
-
};
|
31
|
-
export const id = {
|
32
|
-
name: "id",
|
33
|
-
render: () => (<TextField name="test-name" id="test-id" inputAttributes={{ "aria-label": "Label" }}/>),
|
34
|
-
play: async ({ canvas }) => {
|
35
|
-
const input = canvas.getByRole("textbox");
|
36
|
-
expect(input).toHaveAttribute("id", "test-id");
|
37
|
-
},
|
38
|
-
};
|
39
|
-
export const disabled = {
|
40
|
-
name: "disabled",
|
41
|
-
render: () => <TextField name="test-name" disabled inputAttributes={{ "aria-label": "Label" }}/>,
|
42
|
-
play: async ({ canvas }) => {
|
43
|
-
const input = canvas.getByRole("textbox");
|
44
|
-
expect(input).toBeDisabled();
|
45
|
-
},
|
46
|
-
};
|
47
|
-
export const defaultValue = {
|
48
|
-
name: "defaultValue, uncontrolled",
|
49
|
-
args: {
|
50
|
-
handleChange: fn(),
|
51
|
-
},
|
52
|
-
render: (args) => (<TextField name="test-name" defaultValue="value" onChange={args.handleChange} inputAttributes={{ "aria-label": "Label" }}/>),
|
53
|
-
play: async ({ canvas, args }) => {
|
54
|
-
const input = canvas.getByRole("textbox");
|
55
|
-
expect(input).toHaveValue("value");
|
56
|
-
input.focus();
|
57
|
-
await userEvent.keyboard("2");
|
58
|
-
expect(args.handleChange).toBeCalledTimes(1);
|
59
|
-
expect(args.handleChange).toHaveBeenCalledWith({
|
60
|
-
name: "test-name",
|
61
|
-
value: "value2",
|
62
|
-
event: expect.objectContaining({ target: input }),
|
63
|
-
});
|
64
|
-
expect(input).toHaveValue("value2");
|
65
|
-
},
|
66
|
-
};
|
67
|
-
export const value = {
|
68
|
-
name: "value, controlled",
|
69
|
-
args: {
|
70
|
-
handleChange: fn(),
|
71
|
-
},
|
72
|
-
render: (args) => (<TextField name="test-name" value="value" onChange={args.handleChange} inputAttributes={{ "aria-label": "Label" }}/>),
|
73
|
-
play: async ({ canvas, args }) => {
|
74
|
-
const input = canvas.getByRole("textbox");
|
75
|
-
expect(input).toHaveValue("value");
|
76
|
-
input.focus();
|
77
|
-
await userEvent.keyboard("2");
|
78
|
-
expect(args.handleChange).toBeCalledTimes(1);
|
79
|
-
expect(args.handleChange).toHaveBeenCalledWith({
|
80
|
-
name: "test-name",
|
81
|
-
value: "value2",
|
82
|
-
event: expect.objectContaining({ target: input }),
|
83
|
-
});
|
84
|
-
expect(input).toHaveValue("value");
|
85
|
-
},
|
86
|
-
};
|
87
|
-
export const className = {
|
88
|
-
name: "className, attributes",
|
89
|
-
render: () => (<div data-testid="root">
|
90
|
-
<TextField className="test-classname" attributes={{ id: "test-id" }} name="name" inputAttributes={{ id: "test-input-id", "aria-label": "Label" }}/>
|
91
|
-
</div>),
|
92
|
-
play: async ({ canvas }) => {
|
93
|
-
const root = canvas.getByTestId("root").firstChild;
|
94
|
-
const input = canvas.getByRole("textbox");
|
95
|
-
expect(root).toHaveClass("test-classname");
|
96
|
-
expect(root).toHaveAttribute("id", "test-id");
|
97
|
-
expect(input).toHaveAttribute("id", "test-input-id");
|
98
|
-
},
|
99
|
-
};
|
@@ -1 +1 @@
|
|
1
|
-
.root{--rs-
|
1
|
+
.root{--rs-radius-circular:9999px;--rs-shadow-focus:0 0 0 2px var(--rs-color-background-elevation-base),0 0 0 4px var(--rs-color-border-primary);--rs-shadow-focus-inset:inset 0 0 0 2px var(--rs-color-border-primary),inset 0 0 0 4px var(--rs-color-background-elevation-base);color:var(--rs-color-foreground-neutral);display:contents}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
-
import React from "react";
|
2
|
+
import React, { isValidElement } from "react";
|
3
3
|
import { classNames } from "../../utilities/props.js";
|
4
4
|
import View from "../View/index.js";
|
5
5
|
import s from "./Timeline.module.css";
|
@@ -13,7 +13,7 @@ const Timeline = (props) => {
|
|
13
13
|
const { children, className, attributes } = props;
|
14
14
|
const rootClassNames = classNames(className);
|
15
15
|
return (_jsx("ul", { ...attributes, className: rootClassNames, children: React.Children.map(children, (child, index) => {
|
16
|
-
return
|
16
|
+
return isValidElement(child) && child.type === TimelineItem ? (child) : (_jsx(TimelineItem, { children: child }, index));
|
17
17
|
}) }));
|
18
18
|
};
|
19
19
|
Timeline.Item = TimelineItem;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { StoryObj } from "@storybook/react-vite";
|
1
2
|
declare const _default: {
|
2
3
|
title: string;
|
3
4
|
component: import("react").FC<import("./..").TimelineProps> & {
|
@@ -10,5 +11,12 @@ declare const _default: {
|
|
10
11
|
};
|
11
12
|
};
|
12
13
|
export default _default;
|
13
|
-
export declare const base:
|
14
|
-
|
14
|
+
export declare const base: {
|
15
|
+
name: string;
|
16
|
+
render: () => import("react").JSX.Element;
|
17
|
+
};
|
18
|
+
export declare const marker: {
|
19
|
+
name: string;
|
20
|
+
render: () => import("react").JSX.Element;
|
21
|
+
};
|
22
|
+
export declare const className: StoryObj;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { Example, Placeholder } from "../../../utilities/storybook/index.js";
|
2
2
|
import Timeline from "../index.js";
|
3
|
+
import { expect } from "storybook/test";
|
3
4
|
export default {
|
4
5
|
title: "Components/Timeline",
|
5
6
|
component: Timeline,
|
@@ -9,54 +10,77 @@ export default {
|
|
9
10
|
},
|
10
11
|
},
|
11
12
|
};
|
12
|
-
export const base =
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
<
|
17
|
-
<Placeholder />
|
18
|
-
</Timeline>
|
19
|
-
</Example.Item>
|
20
|
-
<Example.Item title="children wrapped with Timeline.Item">
|
21
|
-
<Timeline>
|
22
|
-
<Timeline.Item>
|
23
|
-
<Placeholder />
|
24
|
-
</Timeline.Item>
|
25
|
-
<Timeline.Item>
|
13
|
+
export const base = {
|
14
|
+
name: "base",
|
15
|
+
render: () => (<Example>
|
16
|
+
<Example.Item title="children passed directly">
|
17
|
+
<Timeline>
|
26
18
|
<Placeholder />
|
27
|
-
</Timeline.Item>
|
28
|
-
<Timeline.Item>
|
29
19
|
<Placeholder />
|
30
|
-
</Timeline.Item>
|
31
|
-
</Timeline>
|
32
|
-
</Example.Item>
|
33
|
-
</Example>);
|
34
|
-
export const marker = () => (<Example>
|
35
|
-
<Example.Item title="slot">
|
36
|
-
<Timeline>
|
37
|
-
<Timeline.Item markerSlot={<Placeholder h="20px" w="20px"/>}>
|
38
20
|
<Placeholder />
|
39
|
-
</Timeline
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
21
|
+
</Timeline>
|
22
|
+
</Example.Item>
|
23
|
+
<Example.Item title="children wrapped with Timeline.Item">
|
24
|
+
<Timeline>
|
25
|
+
<Timeline.Item>
|
26
|
+
<Placeholder />
|
27
|
+
</Timeline.Item>
|
28
|
+
<Timeline.Item>
|
29
|
+
<Placeholder />
|
30
|
+
</Timeline.Item>
|
31
|
+
<Timeline.Item>
|
32
|
+
<Placeholder />
|
33
|
+
</Timeline.Item>
|
34
|
+
</Timeline>
|
35
|
+
</Example.Item>
|
36
|
+
</Example>),
|
37
|
+
};
|
38
|
+
export const marker = {
|
39
|
+
name: "markerSlot",
|
40
|
+
render: () => (<Example>
|
41
|
+
<Example.Item title="slot">
|
42
|
+
<Timeline>
|
43
|
+
<Timeline.Item markerSlot={<Placeholder h="20px" w="20px"/>}>
|
44
|
+
<Placeholder />
|
45
|
+
</Timeline.Item>
|
46
|
+
<Timeline.Item markerSlot={<Placeholder h="20px" w="20px"/>}>
|
47
|
+
<Placeholder />
|
48
|
+
</Timeline.Item>
|
49
|
+
<Timeline.Item markerSlot={<Placeholder h="20px" w="20px"/>}>
|
50
|
+
<Placeholder />
|
51
|
+
</Timeline.Item>
|
52
|
+
</Timeline>
|
53
|
+
</Example.Item>
|
48
54
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
55
|
+
<Example.Item title="null marker">
|
56
|
+
<Timeline>
|
57
|
+
<Timeline.Item markerSlot={null}>
|
58
|
+
<Placeholder />
|
59
|
+
</Timeline.Item>
|
60
|
+
<Timeline.Item markerSlot={null}>
|
61
|
+
<Placeholder />
|
62
|
+
</Timeline.Item>
|
63
|
+
</Timeline>
|
64
|
+
</Example.Item>
|
65
|
+
</Example>),
|
66
|
+
};
|
67
|
+
export const className = {
|
68
|
+
name: "className, attributes",
|
69
|
+
render: () => (<div data-testid="root">
|
70
|
+
<Timeline className="test-classname" attributes={{ id: "test-id" }}>
|
71
|
+
<Timeline.Item className="test-item-classname" attributes={{ id: "test-item-id" }}>
|
72
|
+
Content
|
59
73
|
</Timeline.Item>
|
74
|
+
<Timeline.Item>Content</Timeline.Item>
|
60
75
|
</Timeline>
|
61
|
-
</
|
62
|
-
|
76
|
+
</div>),
|
77
|
+
play: async ({ canvas }) => {
|
78
|
+
const root = canvas.getByTestId("root").firstChild;
|
79
|
+
const items = canvas.getAllByRole("listitem");
|
80
|
+
expect(root).toHaveClass("test-classname");
|
81
|
+
expect(root).toHaveAttribute("id", "test-id");
|
82
|
+
expect(items).toHaveLength(2);
|
83
|
+
expect(items[0]).toHaveClass("test-item-classname");
|
84
|
+
expect(items[0]).toHaveAttribute("id", "test-item-id");
|
85
|
+
},
|
86
|
+
};
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { StoryObj } from "@storybook/react-vite";
|
2
1
|
declare const _default: {
|
3
2
|
title: string;
|
4
3
|
component: import("react").FC<import("./..").TimelineProps> & {
|
@@ -14,4 +13,3 @@ declare const _default: {
|
|
14
13
|
};
|
15
14
|
};
|
16
15
|
export default _default;
|
17
|
-
export declare const className: StoryObj;
|