graphen 1.10.1 → 1.10.2

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphen",
3
- "version": "1.10.1",
3
+ "version": "1.10.2",
4
4
  "description": "Graphen is a small library, that keeps reusable blocks of UI and helps making application design consistent across multiple projects.",
5
5
  "main": "src/index.ts",
6
6
  "files": [
@@ -4,7 +4,7 @@ import classNames from "classnames";
4
4
 
5
5
  type Props = {
6
6
  initValue: Readonly<{ value: string, label: string }>,
7
- label: string,
7
+ label?: string,
8
8
  items: ReadonlyArray<{ value: string, label: string }>,
9
9
  onChange: (arg0: string) => void,
10
10
  };
@@ -27,9 +27,9 @@ function Dropdown(props: Props) {
27
27
 
28
28
  return (
29
29
  <div className="gc-dropdown">
30
- <label className="gc-dropdown__label" htmlFor="gc-dropdown__label">
30
+ {label && (<label className="gc-dropdown__label" htmlFor="gc-dropdown__label">
31
31
  {label}
32
- </label>
32
+ </label>)}
33
33
  <div className="gc-dropdown__menu">
34
34
  <button
35
35
  type="button"
@@ -69,4 +69,9 @@ function Dropdown(props: Props) {
69
69
  );
70
70
  }
71
71
 
72
+ // @ts-ignore
73
+ Dropdown.defaultProps = {
74
+ label: undefined,
75
+ };
76
+
72
77
  export default Dropdown;