graphen 1.10.2 → 1.10.3
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/package.json
CHANGED
|
@@ -24,6 +24,7 @@ function Dropdown(props: Props) {
|
|
|
24
24
|
},
|
|
25
25
|
[setIsExpanded, setSelectedItem, items]
|
|
26
26
|
);
|
|
27
|
+
const buttonClasses = `gc-dropdown__btn ${label ? 'gc-dropdown__btn--with-label' : ''}`;
|
|
27
28
|
|
|
28
29
|
return (
|
|
29
30
|
<div className="gc-dropdown">
|
|
@@ -33,7 +34,7 @@ function Dropdown(props: Props) {
|
|
|
33
34
|
<div className="gc-dropdown__menu">
|
|
34
35
|
<button
|
|
35
36
|
type="button"
|
|
36
|
-
className=
|
|
37
|
+
className={buttonClasses}
|
|
37
38
|
data-cy="dropdown-button"
|
|
38
39
|
onClick={expandMenu}
|
|
39
40
|
>
|
|
@@ -2,6 +2,7 @@ describe("dropdown menu", () => {
|
|
|
2
2
|
it("should open dropdown and pick a value", () => {
|
|
3
3
|
cy.visit("localhost:3000");
|
|
4
4
|
cy.get("[data-cy=dropdown-button]")
|
|
5
|
+
.first()
|
|
5
6
|
.click()
|
|
6
7
|
.get("[data-cy=dropdown-item]")
|
|
7
8
|
.contains("Red")
|
|
@@ -10,6 +11,7 @@ describe("dropdown menu", () => {
|
|
|
10
11
|
.should("contain", "Red");
|
|
11
12
|
|
|
12
13
|
cy.get("[data-cy=dropdown-button]")
|
|
14
|
+
.first()
|
|
13
15
|
.click()
|
|
14
16
|
.get("[data-cy=dropdown-item]")
|
|
15
17
|
.contains("Blue")
|
package/src/example.tsx
CHANGED
|
@@ -613,15 +613,27 @@ class ExampleApp extends React.PureComponent<Props, State> {
|
|
|
613
613
|
<article className="gc-panel gc-panel--separator">
|
|
614
614
|
<header className="gc-panel__title">Dropdown Menu</header>
|
|
615
615
|
<div className="gc-panel__content">
|
|
616
|
-
<
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
{
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
616
|
+
<p>
|
|
617
|
+
<Dropdown
|
|
618
|
+
initValue={{ label: "-Select Value-", value: "selectValue" }}
|
|
619
|
+
label="Dropdown label"
|
|
620
|
+
items={[
|
|
621
|
+
{ label: "Red", value: "red" },
|
|
622
|
+
{ label: "Blue", value: "blue" },
|
|
623
|
+
]}
|
|
624
|
+
onChange={_.noop}
|
|
625
|
+
/>
|
|
626
|
+
</p>
|
|
627
|
+
<p>
|
|
628
|
+
<Dropdown
|
|
629
|
+
initValue={{ label: "-Select Value-", value: "selectValue" }}
|
|
630
|
+
items={[
|
|
631
|
+
{ label: "Red", value: "red" },
|
|
632
|
+
{ label: "Blue", value: "blue" },
|
|
633
|
+
]}
|
|
634
|
+
onChange={_.noop}
|
|
635
|
+
/>
|
|
636
|
+
</p>
|
|
625
637
|
</div>
|
|
626
638
|
</article>
|
|
627
639
|
</>
|