@digigov/react-core 0.6.4 → 0.8.0
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/BackLink/__snapshots__/index.test.tsx.snap +34 -6
- package/CHANGELOG.md +23 -1
- package/List/index.d.ts +1 -1
- package/List/index.js +2 -1
- package/TableDataCell/index.d.ts +1 -1
- package/TableHeaderCell/index.d.ts +1 -1
- package/es/BackLink/__snapshots__/index.test.tsx.snap +34 -6
- package/es/List/index.js +2 -1
- package/es/index.js +0 -3
- package/esm/BackLink/__snapshots__/index.test.tsx.snap +34 -6
- package/esm/List/index.js +2 -1
- package/esm/index.js +1 -4
- package/index.d.ts +0 -3
- package/index.js +0 -24
- package/package.json +2 -2
- package/Dropdown/__snapshots__/index.test.tsx.snap +0 -144
- package/Dropdown/index.d.ts +0 -30
- package/Dropdown/index.js +0 -42
- package/Dropdown/index.test.d.ts +0 -1
- package/Dropdown/index.test.js +0 -101
- package/DropdownButton/__snapshots__/index.test.tsx.snap +0 -375
- package/DropdownButton/index.d.ts +0 -28
- package/DropdownButton/index.js +0 -47
- package/DropdownButton/index.test.d.ts +0 -1
- package/DropdownButton/index.test.js +0 -195
- package/DropdownContent/__snapshots__/index.test.tsx.snap +0 -11
- package/DropdownContent/index.d.ts +0 -9
- package/DropdownContent/index.js +0 -35
- package/DropdownContent/index.test.d.ts +0 -1
- package/DropdownContent/index.test.js +0 -15
- package/es/Dropdown/__snapshots__/index.test.tsx.snap +0 -144
- package/es/Dropdown/index.js +0 -27
- package/es/Dropdown/index.test.js +0 -95
- package/es/DropdownButton/__snapshots__/index.test.tsx.snap +0 -375
- package/es/DropdownButton/index.js +0 -31
- package/es/DropdownButton/index.test.js +0 -189
- package/es/DropdownContent/__snapshots__/index.test.tsx.snap +0 -11
- package/es/DropdownContent/index.js +0 -20
- package/es/DropdownContent/index.test.js +0 -9
- package/esm/Dropdown/__snapshots__/index.test.tsx.snap +0 -144
- package/esm/Dropdown/index.js +0 -27
- package/esm/Dropdown/index.test.js +0 -95
- package/esm/DropdownButton/__snapshots__/index.test.tsx.snap +0 -375
- package/esm/DropdownButton/index.js +0 -31
- package/esm/DropdownButton/index.test.js +0 -189
- package/esm/DropdownContent/__snapshots__/index.test.tsx.snap +0 -11
- package/esm/DropdownContent/index.js +0 -20
- package/esm/DropdownContent/index.test.js +0 -9
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _react = _interopRequireDefault(require("react"));
|
|
6
|
-
|
|
7
|
-
var _enzyme = require("enzyme");
|
|
8
|
-
|
|
9
|
-
var _DropdownButton = _interopRequireDefault(require("@digigov/react-core/DropdownButton"));
|
|
10
|
-
|
|
11
|
-
var _ref = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], null, "hello");
|
|
12
|
-
|
|
13
|
-
it('renders the DropdownButton with no props', function () {
|
|
14
|
-
expect((0, _enzyme.mount)(_ref)).toMatchSnapshot();
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
var _ref2 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
|
|
18
|
-
color: "primary"
|
|
19
|
-
}, "hello");
|
|
20
|
-
|
|
21
|
-
it('renders the DropdownButton with color=primary', function () {
|
|
22
|
-
expect((0, _enzyme.mount)(_ref2)).toMatchSnapshot();
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
var _ref3 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
|
|
26
|
-
color: "secondary"
|
|
27
|
-
}, "hello");
|
|
28
|
-
|
|
29
|
-
it('renders the DropdownButton with color=secondary', function () {
|
|
30
|
-
expect((0, _enzyme.mount)(_ref3)).toMatchSnapshot();
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
var _ref4 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
|
|
34
|
-
variant: "button"
|
|
35
|
-
}, "hello");
|
|
36
|
-
|
|
37
|
-
it('renders the DropdownButton with variant=button', function () {
|
|
38
|
-
expect((0, _enzyme.mount)(_ref4)).toMatchSnapshot();
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
var _ref5 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
|
|
42
|
-
variant: "link"
|
|
43
|
-
}, "hello");
|
|
44
|
-
|
|
45
|
-
it('renders the DropdownButton with variant=link', function () {
|
|
46
|
-
expect((0, _enzyme.mount)(_ref5)).toMatchSnapshot();
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
var _ref6 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
|
|
50
|
-
arrow: false
|
|
51
|
-
}, "hello");
|
|
52
|
-
|
|
53
|
-
it('renders the DropdownButton with arrow=false', function () {
|
|
54
|
-
expect((0, _enzyme.mount)(_ref6)).toMatchSnapshot();
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
var _ref7 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
|
|
58
|
-
arrow: true
|
|
59
|
-
}, "hello");
|
|
60
|
-
|
|
61
|
-
it('renders the DropdownButton with arrow=true', function () {
|
|
62
|
-
expect((0, _enzyme.mount)(_ref7)).toMatchSnapshot();
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
var _ref8 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
|
|
66
|
-
color: "primary",
|
|
67
|
-
variant: "button"
|
|
68
|
-
}, "hello");
|
|
69
|
-
|
|
70
|
-
it('renders the DropdownButton with color=primary and variant="button"', function () {
|
|
71
|
-
expect((0, _enzyme.mount)(_ref8)).toMatchSnapshot();
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
var _ref9 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
|
|
75
|
-
color: "primary",
|
|
76
|
-
variant: "link"
|
|
77
|
-
}, "hello");
|
|
78
|
-
|
|
79
|
-
it('renders the DropdownButton with color=primary and variant="link"', function () {
|
|
80
|
-
expect((0, _enzyme.mount)(_ref9)).toMatchSnapshot();
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
var _ref10 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
|
|
84
|
-
color: "primary",
|
|
85
|
-
arrow: false
|
|
86
|
-
}, "hello");
|
|
87
|
-
|
|
88
|
-
it('renders the DropdownButton with color=primary and arrow={false}', function () {
|
|
89
|
-
expect((0, _enzyme.mount)(_ref10)).toMatchSnapshot();
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
var _ref11 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
|
|
93
|
-
color: "primary",
|
|
94
|
-
arrow: true
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
it('renders the DropdownButton with color=primary and arrow={true}', function () {
|
|
98
|
-
expect((0, _enzyme.mount)(_ref11)).toMatchSnapshot();
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
var _ref12 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
|
|
102
|
-
color: "secondary",
|
|
103
|
-
variant: "button"
|
|
104
|
-
}, "hello");
|
|
105
|
-
|
|
106
|
-
it('renders the DropdownButton with color=secondary and variant="button"', function () {
|
|
107
|
-
expect((0, _enzyme.mount)(_ref12)).toMatchSnapshot();
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
var _ref13 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
|
|
111
|
-
color: "secondary",
|
|
112
|
-
variant: "link"
|
|
113
|
-
}, "hello");
|
|
114
|
-
|
|
115
|
-
it('renders the DropdownButton with color=primary and variant="link"', function () {
|
|
116
|
-
expect((0, _enzyme.mount)(_ref13)).toMatchSnapshot();
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
var _ref14 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
|
|
120
|
-
color: "secondary",
|
|
121
|
-
arrow: false
|
|
122
|
-
}, "hello");
|
|
123
|
-
|
|
124
|
-
it('renders the DropdownButton with color=secondary and arrow={false}', function () {
|
|
125
|
-
expect((0, _enzyme.mount)(_ref14)).toMatchSnapshot();
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
var _ref15 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
|
|
129
|
-
color: "secondary",
|
|
130
|
-
arrow: true
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
it('renders the DropdownButton with color=secondary and arrow={true}', function () {
|
|
134
|
-
expect((0, _enzyme.mount)(_ref15)).toMatchSnapshot();
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
var _ref16 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
|
|
138
|
-
color: "primary",
|
|
139
|
-
variant: "button",
|
|
140
|
-
arrow: false
|
|
141
|
-
}, "hello");
|
|
142
|
-
|
|
143
|
-
it('renders the DropdownButton with color=primary variant="button" and arrow={false}', function () {
|
|
144
|
-
expect((0, _enzyme.mount)(_ref16)).toMatchSnapshot();
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
var _ref17 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
|
|
148
|
-
color: "primary",
|
|
149
|
-
variant: "button",
|
|
150
|
-
arrow: true
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
it('renders the DropdownButton with color=primary variant="button" arrow={true}', function () {
|
|
154
|
-
expect((0, _enzyme.mount)(_ref17)).toMatchSnapshot();
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
var _ref18 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
|
|
158
|
-
color: "primary",
|
|
159
|
-
variant: "link",
|
|
160
|
-
arrow: true
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
it('renders the DropdownButton with color=primary variant="link" arrow={true}', function () {
|
|
164
|
-
expect((0, _enzyme.mount)(_ref18)).toMatchSnapshot();
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
var _ref19 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
|
|
168
|
-
color: "primary",
|
|
169
|
-
variant: "link",
|
|
170
|
-
arrow: false
|
|
171
|
-
}, "hello");
|
|
172
|
-
|
|
173
|
-
it('renders the DropdownButton with color=primary variant="link" arrow={false}', function () {
|
|
174
|
-
expect((0, _enzyme.mount)(_ref19)).toMatchSnapshot();
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
var _ref20 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
|
|
178
|
-
color: "warning",
|
|
179
|
-
variant: "link",
|
|
180
|
-
arrow: false
|
|
181
|
-
}, "hello");
|
|
182
|
-
|
|
183
|
-
it('renders the DropdownButton with color=warning variant="button" arrow={false}', function () {
|
|
184
|
-
expect((0, _enzyme.mount)(_ref20)).toMatchSnapshot();
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
var _ref21 = /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
|
|
188
|
-
color: "warning",
|
|
189
|
-
variant: "link",
|
|
190
|
-
arrow: true
|
|
191
|
-
}, "hello");
|
|
192
|
-
|
|
193
|
-
it('renders the DropdownButton with color=warning variant="button" arrow={true}', function () {
|
|
194
|
-
expect((0, _enzyme.mount)(_ref21)).toMatchSnapshot();
|
|
195
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
declare type DivElementAttributes = JSX.IntrinsicElements['div'];
|
|
3
|
-
export interface DropdownContentProps extends DivElementAttributes {
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* You should use DropdownContent component inside Dropdown component.
|
|
7
|
-
*/
|
|
8
|
-
export declare const DropdownContent: React.ForwardRefExoticComponent<Pick<DropdownContentProps, "className" | "children" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
-
export default DropdownContent;
|
package/DropdownContent/index.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = exports.DropdownContent = void 0;
|
|
9
|
-
|
|
10
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
|
|
12
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
-
|
|
14
|
-
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
|
|
16
|
-
var _clsx = _interopRequireDefault(require("clsx"));
|
|
17
|
-
|
|
18
|
-
var _excluded = ["className", "children"];
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* You should use DropdownContent component inside Dropdown component.
|
|
22
|
-
*/
|
|
23
|
-
var DropdownContent = /*#__PURE__*/_react["default"].forwardRef(function DropdownContent(_ref, ref) {
|
|
24
|
-
var className = _ref.className,
|
|
25
|
-
children = _ref.children,
|
|
26
|
-
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
27
|
-
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
|
|
28
|
-
ref: ref,
|
|
29
|
-
className: (0, _clsx["default"])(className, true && 'govgr-dropdown__content')
|
|
30
|
-
}, props), children);
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
exports.DropdownContent = DropdownContent;
|
|
34
|
-
var _default = DropdownContent;
|
|
35
|
-
exports["default"] = _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _react = _interopRequireDefault(require("react"));
|
|
6
|
-
|
|
7
|
-
var _enzyme = require("enzyme");
|
|
8
|
-
|
|
9
|
-
var _DropdownContent = _interopRequireDefault(require("@digigov/react-core/DropdownContent"));
|
|
10
|
-
|
|
11
|
-
var _ref = /*#__PURE__*/_react["default"].createElement(_DropdownContent["default"], null, "hello");
|
|
12
|
-
|
|
13
|
-
it('renders the DropdownContent with no props', function () {
|
|
14
|
-
expect((0, _enzyme.mount)(_ref)).toMatchSnapshot();
|
|
15
|
-
});
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`renders the Dropdown disabled 1`] = `
|
|
4
|
-
<ForwardRef(Dropdown)
|
|
5
|
-
disabled={true}
|
|
6
|
-
>
|
|
7
|
-
<details
|
|
8
|
-
className="govgr-dropdown--disabled govgr-dropdown"
|
|
9
|
-
>
|
|
10
|
-
hello
|
|
11
|
-
</details>
|
|
12
|
-
</ForwardRef(Dropdown)>
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
exports[`renders the Dropdown with align=left 1`] = `
|
|
16
|
-
<ForwardRef(Dropdown)
|
|
17
|
-
align="left"
|
|
18
|
-
>
|
|
19
|
-
<details
|
|
20
|
-
className="govgr-dropdown--left govgr-dropdown"
|
|
21
|
-
>
|
|
22
|
-
hello
|
|
23
|
-
</details>
|
|
24
|
-
</ForwardRef(Dropdown)>
|
|
25
|
-
`;
|
|
26
|
-
|
|
27
|
-
exports[`renders the Dropdown with align=left and open=true 1`] = `
|
|
28
|
-
<ForwardRef(Dropdown)
|
|
29
|
-
align="left"
|
|
30
|
-
open={true}
|
|
31
|
-
>
|
|
32
|
-
<details
|
|
33
|
-
className="govgr-dropdown--left govgr-dropdown"
|
|
34
|
-
open={true}
|
|
35
|
-
>
|
|
36
|
-
hello
|
|
37
|
-
</details>
|
|
38
|
-
</ForwardRef(Dropdown)>
|
|
39
|
-
`;
|
|
40
|
-
|
|
41
|
-
exports[`renders the Dropdown with align=right and open=false 1`] = `
|
|
42
|
-
<ForwardRef(Dropdown)
|
|
43
|
-
align="right"
|
|
44
|
-
open={false}
|
|
45
|
-
>
|
|
46
|
-
<details
|
|
47
|
-
className="govgr-dropdown"
|
|
48
|
-
open={false}
|
|
49
|
-
>
|
|
50
|
-
hello
|
|
51
|
-
</details>
|
|
52
|
-
</ForwardRef(Dropdown)>
|
|
53
|
-
`;
|
|
54
|
-
|
|
55
|
-
exports[`renders the Dropdown with no props 1`] = `
|
|
56
|
-
<ForwardRef(Dropdown)>
|
|
57
|
-
<details
|
|
58
|
-
className="govgr-dropdown"
|
|
59
|
-
>
|
|
60
|
-
hello
|
|
61
|
-
</details>
|
|
62
|
-
</ForwardRef(Dropdown)>
|
|
63
|
-
`;
|
|
64
|
-
|
|
65
|
-
exports[`renders the Dropdown with open=false 1`] = `
|
|
66
|
-
<ForwardRef(Dropdown)
|
|
67
|
-
open={false}
|
|
68
|
-
>
|
|
69
|
-
<details
|
|
70
|
-
className="govgr-dropdown"
|
|
71
|
-
open={false}
|
|
72
|
-
>
|
|
73
|
-
hello
|
|
74
|
-
</details>
|
|
75
|
-
</ForwardRef(Dropdown)>
|
|
76
|
-
`;
|
|
77
|
-
|
|
78
|
-
exports[`renders the Dropdown with open=true 1`] = `
|
|
79
|
-
<ForwardRef(Dropdown)
|
|
80
|
-
open={true}
|
|
81
|
-
>
|
|
82
|
-
<details
|
|
83
|
-
className="govgr-dropdown"
|
|
84
|
-
open={true}
|
|
85
|
-
>
|
|
86
|
-
hello
|
|
87
|
-
</details>
|
|
88
|
-
</ForwardRef(Dropdown)>
|
|
89
|
-
`;
|
|
90
|
-
|
|
91
|
-
exports[`renders the Dropdown with placement=bottom and open=false 1`] = `
|
|
92
|
-
<ForwardRef(Dropdown)
|
|
93
|
-
open={false}
|
|
94
|
-
placement="bottom"
|
|
95
|
-
>
|
|
96
|
-
<details
|
|
97
|
-
className="govgr-dropdown"
|
|
98
|
-
open={false}
|
|
99
|
-
>
|
|
100
|
-
hello
|
|
101
|
-
</details>
|
|
102
|
-
</ForwardRef(Dropdown)>
|
|
103
|
-
`;
|
|
104
|
-
|
|
105
|
-
exports[`renders the Dropdown with placement=top 1`] = `
|
|
106
|
-
<ForwardRef(Dropdown)
|
|
107
|
-
placement="top"
|
|
108
|
-
>
|
|
109
|
-
<details
|
|
110
|
-
className="govgr-dropdown--up govgr-dropdown"
|
|
111
|
-
>
|
|
112
|
-
hello
|
|
113
|
-
</details>
|
|
114
|
-
</ForwardRef(Dropdown)>
|
|
115
|
-
`;
|
|
116
|
-
|
|
117
|
-
exports[`renders the Dropdown with placement=top align=left and open=true 1`] = `
|
|
118
|
-
<ForwardRef(Dropdown)
|
|
119
|
-
align="left"
|
|
120
|
-
open={true}
|
|
121
|
-
placement="top"
|
|
122
|
-
>
|
|
123
|
-
<details
|
|
124
|
-
className="govgr-dropdown--up govgr-dropdown--left govgr-dropdown"
|
|
125
|
-
open={true}
|
|
126
|
-
>
|
|
127
|
-
hello
|
|
128
|
-
</details>
|
|
129
|
-
</ForwardRef(Dropdown)>
|
|
130
|
-
`;
|
|
131
|
-
|
|
132
|
-
exports[`renders the Dropdown with placement=top and open=true 1`] = `
|
|
133
|
-
<ForwardRef(Dropdown)
|
|
134
|
-
open={true}
|
|
135
|
-
placement="top"
|
|
136
|
-
>
|
|
137
|
-
<details
|
|
138
|
-
className="govgr-dropdown--up govgr-dropdown"
|
|
139
|
-
open={true}
|
|
140
|
-
>
|
|
141
|
-
hello
|
|
142
|
-
</details>
|
|
143
|
-
</ForwardRef(Dropdown)>
|
|
144
|
-
`;
|
package/es/Dropdown/index.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["className", "children", "align", "placement", "open", "disabled"];
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import clsx from 'clsx';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Dropdown is the main component for a dropdown.
|
|
9
|
-
* Inside this component must be DropdownButton and DropdownContent components.
|
|
10
|
-
*/
|
|
11
|
-
// eslint-disable-next-line react/display-name
|
|
12
|
-
export var Dropdown = /*#__PURE__*/React.forwardRef(function Dropdown(_ref, ref) {
|
|
13
|
-
var className = _ref.className,
|
|
14
|
-
children = _ref.children,
|
|
15
|
-
align = _ref.align,
|
|
16
|
-
placement = _ref.placement,
|
|
17
|
-
open = _ref.open,
|
|
18
|
-
disabled = _ref.disabled,
|
|
19
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
-
|
|
21
|
-
return /*#__PURE__*/React.createElement("details", _extends({
|
|
22
|
-
ref: ref,
|
|
23
|
-
open: open,
|
|
24
|
-
className: clsx(className, placement === 'top' && 'govgr-dropdown--up', disabled === true && 'govgr-dropdown--disabled', align === 'left' && 'govgr-dropdown--left', true && 'govgr-dropdown')
|
|
25
|
-
}, props), children);
|
|
26
|
-
});
|
|
27
|
-
export default Dropdown;
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { mount } from 'enzyme';
|
|
3
|
-
import Dropdown from '@digigov/react-core/Dropdown';
|
|
4
|
-
|
|
5
|
-
var _ref = /*#__PURE__*/React.createElement(Dropdown, null, "hello");
|
|
6
|
-
|
|
7
|
-
it('renders the Dropdown with no props', function () {
|
|
8
|
-
expect(mount(_ref)).toMatchSnapshot();
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
var _ref2 = /*#__PURE__*/React.createElement(Dropdown, {
|
|
12
|
-
disabled: true
|
|
13
|
-
}, "hello");
|
|
14
|
-
|
|
15
|
-
it('renders the Dropdown disabled', function () {
|
|
16
|
-
expect(mount(_ref2)).toMatchSnapshot();
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
var _ref3 = /*#__PURE__*/React.createElement(Dropdown, {
|
|
20
|
-
open: true
|
|
21
|
-
}, "hello");
|
|
22
|
-
|
|
23
|
-
it('renders the Dropdown with open=true', function () {
|
|
24
|
-
expect(mount(_ref3)).toMatchSnapshot();
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
var _ref4 = /*#__PURE__*/React.createElement(Dropdown, {
|
|
28
|
-
open: false
|
|
29
|
-
}, "hello");
|
|
30
|
-
|
|
31
|
-
it('renders the Dropdown with open=false', function () {
|
|
32
|
-
expect(mount(_ref4)).toMatchSnapshot();
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
var _ref5 = /*#__PURE__*/React.createElement(Dropdown, {
|
|
36
|
-
align: "left"
|
|
37
|
-
}, "hello");
|
|
38
|
-
|
|
39
|
-
it('renders the Dropdown with align=left', function () {
|
|
40
|
-
expect(mount(_ref5)).toMatchSnapshot();
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
var _ref6 = /*#__PURE__*/React.createElement(Dropdown, {
|
|
44
|
-
placement: "top"
|
|
45
|
-
}, "hello");
|
|
46
|
-
|
|
47
|
-
it('renders the Dropdown with placement=top', function () {
|
|
48
|
-
expect(mount(_ref6)).toMatchSnapshot();
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
var _ref7 = /*#__PURE__*/React.createElement(Dropdown, {
|
|
52
|
-
open: true,
|
|
53
|
-
align: "left"
|
|
54
|
-
}, "hello");
|
|
55
|
-
|
|
56
|
-
it('renders the Dropdown with align=left and open=true', function () {
|
|
57
|
-
expect(mount(_ref7)).toMatchSnapshot();
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
var _ref8 = /*#__PURE__*/React.createElement(Dropdown, {
|
|
61
|
-
open: false,
|
|
62
|
-
align: "right"
|
|
63
|
-
}, "hello");
|
|
64
|
-
|
|
65
|
-
it('renders the Dropdown with align=right and open=false', function () {
|
|
66
|
-
expect(mount(_ref8)).toMatchSnapshot();
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
var _ref9 = /*#__PURE__*/React.createElement(Dropdown, {
|
|
70
|
-
open: true,
|
|
71
|
-
placement: "top"
|
|
72
|
-
}, "hello");
|
|
73
|
-
|
|
74
|
-
it('renders the Dropdown with placement=top and open=true', function () {
|
|
75
|
-
expect(mount(_ref9)).toMatchSnapshot();
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
var _ref10 = /*#__PURE__*/React.createElement(Dropdown, {
|
|
79
|
-
open: false,
|
|
80
|
-
placement: "bottom"
|
|
81
|
-
}, "hello");
|
|
82
|
-
|
|
83
|
-
it('renders the Dropdown with placement=bottom and open=false', function () {
|
|
84
|
-
expect(mount(_ref10)).toMatchSnapshot();
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
var _ref11 = /*#__PURE__*/React.createElement(Dropdown, {
|
|
88
|
-
open: true,
|
|
89
|
-
placement: "top",
|
|
90
|
-
align: "left"
|
|
91
|
-
}, "hello");
|
|
92
|
-
|
|
93
|
-
it('renders the Dropdown with placement=top align=left and open=true', function () {
|
|
94
|
-
expect(mount(_ref11)).toMatchSnapshot();
|
|
95
|
-
});
|