-
Notifications
You must be signed in to change notification settings - Fork 199
/
Copy pathpicker.stories.js
112 lines (109 loc) · 2.44 KB
/
picker.stories.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import { WithDividers as MenuStories } from "@spectrum-css/menu/stories/menu.stories.js";
import { disableDefaultModes } from "@spectrum-css/preview/modes";
import { isDisabled, isInvalid, isKeyboardFocused, isLoading, isOpen, isQuiet, size } from "@spectrum-css/preview/types";
import pkgJson from "../package.json";
import { PickerGroup } from "./picker.test.js";
/**
* A picker outlines a set of options for a user.
*/
export default {
title: "Picker",
component: "Picker",
argTypes: {
size: size(["s", "m", "l", "xl"]),
label: {
name: "Label",
type: { name: "string" },
table: {
type: { summary: "string" },
category: "Content",
},
control: { type: "text" },
},
labelPosition: {
name: "Label position",
type: { name: "string" },
table: {
type: { summary: "string" },
category: "Content",
},
options: ["top", "left"],
control: { type: "select" },
},
withSwitch: {
name: "Display with a switch component",
type: { name: "boolean" },
table: {
type: { summary: "boolean" },
category: "Component",
},
control: "boolean",
if: { arg: "labelPosition", eq: "left" },
},
placeholder: {
name: "Placeholder",
type: { name: "string" },
table: {
type: { summary: "string" },
category: "Content",
},
control: { type: "text" },
},
isQuiet,
isOpen,
menuHeight: {
name: "Max menu block size",
type: {name: "boolean"},
table: {
type: { name: "boolean" },
category: "State",
},
if: { arg: "isOpen", eq: true },
control: "boolean",
},
isKeyboardFocused,
isDisabled,
isLoading,
isInvalid,
content: { table: { disable: true } },
},
args: {
rootClass: "spectrum-Picker",
size: "m",
label: "Country",
placeholder: "Select a country",
isQuiet: false,
isKeyboardFocused: false,
isLoading: false,
isDisabled: false,
isInvalid: false,
isOpen: false,
withSwitch: false,
content: [
(passthrough, context) => MenuStories({
...passthrough,
...MenuStories.args,
}, context)
],
},
parameters: {
docs: {
story: {
height: "400px"
}
},
packageJson: pkgJson,
},
};
export const Default = PickerGroup.bind({});
Default.args = {};
// ********* VRT ONLY ********* //
export const WithForcedColors = PickerGroup.bind({});
WithForcedColors.tags = ["!autodocs", "!dev"];
WithForcedColors.parameters = {
chromatic: {
forcedColors: "active",
modes: disableDefaultModes
},
};
WithForcedColors.args = {};