@digigov/react-core 0.4.1 → 0.5.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/CHANGELOG.md +12 -1
- package/GovGRLogo/index.js +1 -1
- package/Hidden/index.d.ts +17 -0
- package/Hidden/index.js +47 -0
- package/Hidden/index.test.d.ts +1 -0
- package/Hidden/index.test.js +49 -0
- package/es/GovGRLogo/index.js +1 -1
- package/es/Hidden/index.js +32 -0
- package/es/Hidden/index.test.js +43 -0
- package/es/index.js +1 -0
- package/esm/GovGRLogo/index.js +1 -1
- package/esm/Hidden/index.js +32 -0
- package/esm/Hidden/index.test.js +43 -0
- package/esm/index.js +2 -1
- package/index.d.ts +1 -0
- package/index.js +8 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
# Change Log - @digigov/react-core
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 01 Feb 2022 15:38:26 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 0.5.0
|
|
6
|
+
Tue, 01 Feb 2022 15:38:26 GMT
|
|
7
|
+
|
|
8
|
+
### Minor changes
|
|
9
|
+
|
|
10
|
+
- implement Hidden component
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- Add the missing `govgr-header-link` className in GovGRLogo
|
|
4
15
|
|
|
5
16
|
## 0.4.1
|
|
6
17
|
Thu, 20 Jan 2022 10:45:21 GMT
|
package/GovGRLogo/index.js
CHANGED
|
@@ -28,7 +28,7 @@ var GovGRLogo = /*#__PURE__*/_react["default"].forwardRef(function GovGRLogo(_re
|
|
|
28
28
|
return /*#__PURE__*/_react["default"].createElement("a", (0, _extends2["default"])({
|
|
29
29
|
href: href,
|
|
30
30
|
ref: ref,
|
|
31
|
-
className: (0, _clsx["default"])(className)
|
|
31
|
+
className: (0, _clsx["default"])(className, true && 'govgr-header-link')
|
|
32
32
|
}, props), /*#__PURE__*/_react["default"].createElement("img", {
|
|
33
33
|
src: "https://www.gov.gr/gov_gr_logo.svg",
|
|
34
34
|
className: (0, _clsx["default"])(className, true && 'govgr-header-logo')
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type DivElementAttributes = JSX.IntrinsicElements['div'];
|
|
3
|
+
export interface HiddenProps extends DivElementAttributes {
|
|
4
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
5
|
+
lgUp?: boolean;
|
|
6
|
+
mdUp?: boolean;
|
|
7
|
+
smUp?: boolean;
|
|
8
|
+
xlUp?: boolean;
|
|
9
|
+
xsUp?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Hidden is used to responsively hide children based on the screen size.
|
|
13
|
+
* Each property refers to a specific screen sizes and applies the "invisible"
|
|
14
|
+
* property at the selected screen size and above.
|
|
15
|
+
*/
|
|
16
|
+
export declare const Hidden: React.ForwardRefExoticComponent<Pick<HiddenProps, "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" | "lgUp" | "mdUp" | "smUp" | "xlUp" | "xsUp"> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
export default Hidden;
|
package/Hidden/index.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
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.Hidden = 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", "lgUp", "mdUp", "smUp", "xlUp", "xsUp"];
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Hidden is used to responsively hide children based on the screen size.
|
|
22
|
+
* Each property refers to a specific screen sizes and applies the "invisible"
|
|
23
|
+
* property at the selected screen size and above.
|
|
24
|
+
*/
|
|
25
|
+
var Hidden = /*#__PURE__*/_react["default"].forwardRef(function Hidden(_ref, ref) {
|
|
26
|
+
var className = _ref.className,
|
|
27
|
+
children = _ref.children,
|
|
28
|
+
_ref$lgUp = _ref.lgUp,
|
|
29
|
+
lgUp = _ref$lgUp === void 0 ? false : _ref$lgUp,
|
|
30
|
+
_ref$mdUp = _ref.mdUp,
|
|
31
|
+
mdUp = _ref$mdUp === void 0 ? false : _ref$mdUp,
|
|
32
|
+
_ref$smUp = _ref.smUp,
|
|
33
|
+
smUp = _ref$smUp === void 0 ? false : _ref$smUp,
|
|
34
|
+
_ref$xlUp = _ref.xlUp,
|
|
35
|
+
xlUp = _ref$xlUp === void 0 ? false : _ref$xlUp,
|
|
36
|
+
_ref$xsUp = _ref.xsUp,
|
|
37
|
+
xsUp = _ref$xsUp === void 0 ? false : _ref$xsUp,
|
|
38
|
+
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
39
|
+
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
|
|
40
|
+
ref: ref,
|
|
41
|
+
className: (0, _clsx["default"])(className, lgUp && 'govgr-lg-up', mdUp && 'govgr-md-up', smUp && 'govgr-sm-up', xlUp && 'govgr-xl-up', xsUp && 'govgr-xs-up')
|
|
42
|
+
}, props), children);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
exports.Hidden = Hidden;
|
|
46
|
+
var _default = Hidden;
|
|
47
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
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 _Hidden = _interopRequireDefault(require("@digigov/react-core/Hidden"));
|
|
10
|
+
|
|
11
|
+
var _ref = /*#__PURE__*/_react["default"].createElement(_Hidden["default"], {
|
|
12
|
+
lgUp: true
|
|
13
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, "hello"));
|
|
14
|
+
|
|
15
|
+
it('renders the Hidden with `lgUp` props', function () {
|
|
16
|
+
expect((0, _enzyme.mount)(_ref)).toMatchSnapshot();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
var _ref2 = /*#__PURE__*/_react["default"].createElement(_Hidden["default"], {
|
|
20
|
+
mdUp: true
|
|
21
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, "hello"));
|
|
22
|
+
|
|
23
|
+
it('renders the Hidden with `mdUp` props', function () {
|
|
24
|
+
expect((0, _enzyme.mount)(_ref2)).toMatchSnapshot();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
var _ref3 = /*#__PURE__*/_react["default"].createElement(_Hidden["default"], {
|
|
28
|
+
smUp: true
|
|
29
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, "hello"));
|
|
30
|
+
|
|
31
|
+
it('renders the Hidden with `smUp` props', function () {
|
|
32
|
+
expect((0, _enzyme.mount)(_ref3)).toMatchSnapshot();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
var _ref4 = /*#__PURE__*/_react["default"].createElement(_Hidden["default"], {
|
|
36
|
+
xlUp: true
|
|
37
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, "hello"));
|
|
38
|
+
|
|
39
|
+
it('renders the Hidden with `xlUp` props', function () {
|
|
40
|
+
expect((0, _enzyme.mount)(_ref4)).toMatchSnapshot();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
var _ref5 = /*#__PURE__*/_react["default"].createElement(_Hidden["default"], {
|
|
44
|
+
xsUp: true
|
|
45
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, "hello"));
|
|
46
|
+
|
|
47
|
+
it('renders the Hidden with `xsUp` props', function () {
|
|
48
|
+
expect((0, _enzyme.mount)(_ref5)).toMatchSnapshot();
|
|
49
|
+
});
|
package/es/GovGRLogo/index.js
CHANGED
|
@@ -16,7 +16,7 @@ export var GovGRLogo = /*#__PURE__*/React.forwardRef(function GovGRLogo(_ref, re
|
|
|
16
16
|
return /*#__PURE__*/React.createElement("a", _extends({
|
|
17
17
|
href: href,
|
|
18
18
|
ref: ref,
|
|
19
|
-
className: clsx(className)
|
|
19
|
+
className: clsx(className, true && 'govgr-header-link')
|
|
20
20
|
}, props), /*#__PURE__*/React.createElement("img", {
|
|
21
21
|
src: "https://www.gov.gr/gov_gr_logo.svg",
|
|
22
22
|
className: clsx(className, true && 'govgr-header-logo')
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["className", "children", "lgUp", "mdUp", "smUp", "xlUp", "xsUp"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Hidden is used to responsively hide children based on the screen size.
|
|
9
|
+
* Each property refers to a specific screen sizes and applies the "invisible"
|
|
10
|
+
* property at the selected screen size and above.
|
|
11
|
+
*/
|
|
12
|
+
export var Hidden = /*#__PURE__*/React.forwardRef(function Hidden(_ref, ref) {
|
|
13
|
+
var className = _ref.className,
|
|
14
|
+
children = _ref.children,
|
|
15
|
+
_ref$lgUp = _ref.lgUp,
|
|
16
|
+
lgUp = _ref$lgUp === void 0 ? false : _ref$lgUp,
|
|
17
|
+
_ref$mdUp = _ref.mdUp,
|
|
18
|
+
mdUp = _ref$mdUp === void 0 ? false : _ref$mdUp,
|
|
19
|
+
_ref$smUp = _ref.smUp,
|
|
20
|
+
smUp = _ref$smUp === void 0 ? false : _ref$smUp,
|
|
21
|
+
_ref$xlUp = _ref.xlUp,
|
|
22
|
+
xlUp = _ref$xlUp === void 0 ? false : _ref$xlUp,
|
|
23
|
+
_ref$xsUp = _ref.xsUp,
|
|
24
|
+
xsUp = _ref$xsUp === void 0 ? false : _ref$xsUp,
|
|
25
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
26
|
+
|
|
27
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
28
|
+
ref: ref,
|
|
29
|
+
className: clsx(className, lgUp && 'govgr-lg-up', mdUp && 'govgr-md-up', smUp && 'govgr-sm-up', xlUp && 'govgr-xl-up', xsUp && 'govgr-xs-up')
|
|
30
|
+
}, props), children);
|
|
31
|
+
});
|
|
32
|
+
export default Hidden;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
import Hidden from '@digigov/react-core/Hidden';
|
|
4
|
+
|
|
5
|
+
var _ref = /*#__PURE__*/React.createElement(Hidden, {
|
|
6
|
+
lgUp: true
|
|
7
|
+
}, /*#__PURE__*/React.createElement("div", null, "hello"));
|
|
8
|
+
|
|
9
|
+
it('renders the Hidden with `lgUp` props', function () {
|
|
10
|
+
expect(mount(_ref)).toMatchSnapshot();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _ref2 = /*#__PURE__*/React.createElement(Hidden, {
|
|
14
|
+
mdUp: true
|
|
15
|
+
}, /*#__PURE__*/React.createElement("div", null, "hello"));
|
|
16
|
+
|
|
17
|
+
it('renders the Hidden with `mdUp` props', function () {
|
|
18
|
+
expect(mount(_ref2)).toMatchSnapshot();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
var _ref3 = /*#__PURE__*/React.createElement(Hidden, {
|
|
22
|
+
smUp: true
|
|
23
|
+
}, /*#__PURE__*/React.createElement("div", null, "hello"));
|
|
24
|
+
|
|
25
|
+
it('renders the Hidden with `smUp` props', function () {
|
|
26
|
+
expect(mount(_ref3)).toMatchSnapshot();
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
var _ref4 = /*#__PURE__*/React.createElement(Hidden, {
|
|
30
|
+
xlUp: true
|
|
31
|
+
}, /*#__PURE__*/React.createElement("div", null, "hello"));
|
|
32
|
+
|
|
33
|
+
it('renders the Hidden with `xlUp` props', function () {
|
|
34
|
+
expect(mount(_ref4)).toMatchSnapshot();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
var _ref5 = /*#__PURE__*/React.createElement(Hidden, {
|
|
38
|
+
xsUp: true
|
|
39
|
+
}, /*#__PURE__*/React.createElement("div", null, "hello"));
|
|
40
|
+
|
|
41
|
+
it('renders the Hidden with `xsUp` props', function () {
|
|
42
|
+
expect(mount(_ref5)).toMatchSnapshot();
|
|
43
|
+
});
|
package/es/index.js
CHANGED
|
@@ -66,6 +66,7 @@ export { default as HeaderTitle } from '@digigov/react-core/HeaderTitle';
|
|
|
66
66
|
export { default as Heading } from '@digigov/react-core/Heading';
|
|
67
67
|
export { default as HeadingCaption } from '@digigov/react-core/HeadingCaption';
|
|
68
68
|
export { default as HellenicRepublicLogo } from '@digigov/react-core/HellenicRepublicLogo';
|
|
69
|
+
export { default as Hidden } from '@digigov/react-core/Hidden';
|
|
69
70
|
export { default as Hint } from '@digigov/react-core/Hint';
|
|
70
71
|
export { default as Label } from '@digigov/react-core/Label';
|
|
71
72
|
export { default as LabelTitle } from '@digigov/react-core/LabelTitle';
|
package/esm/GovGRLogo/index.js
CHANGED
|
@@ -16,7 +16,7 @@ export var GovGRLogo = /*#__PURE__*/React.forwardRef(function GovGRLogo(_ref, re
|
|
|
16
16
|
return /*#__PURE__*/React.createElement("a", _extends({
|
|
17
17
|
href: href,
|
|
18
18
|
ref: ref,
|
|
19
|
-
className: clsx(className)
|
|
19
|
+
className: clsx(className, true && 'govgr-header-link')
|
|
20
20
|
}, props), /*#__PURE__*/React.createElement("img", {
|
|
21
21
|
src: "https://www.gov.gr/gov_gr_logo.svg",
|
|
22
22
|
className: clsx(className, true && 'govgr-header-logo')
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["className", "children", "lgUp", "mdUp", "smUp", "xlUp", "xsUp"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Hidden is used to responsively hide children based on the screen size.
|
|
9
|
+
* Each property refers to a specific screen sizes and applies the "invisible"
|
|
10
|
+
* property at the selected screen size and above.
|
|
11
|
+
*/
|
|
12
|
+
export var Hidden = /*#__PURE__*/React.forwardRef(function Hidden(_ref, ref) {
|
|
13
|
+
var className = _ref.className,
|
|
14
|
+
children = _ref.children,
|
|
15
|
+
_ref$lgUp = _ref.lgUp,
|
|
16
|
+
lgUp = _ref$lgUp === void 0 ? false : _ref$lgUp,
|
|
17
|
+
_ref$mdUp = _ref.mdUp,
|
|
18
|
+
mdUp = _ref$mdUp === void 0 ? false : _ref$mdUp,
|
|
19
|
+
_ref$smUp = _ref.smUp,
|
|
20
|
+
smUp = _ref$smUp === void 0 ? false : _ref$smUp,
|
|
21
|
+
_ref$xlUp = _ref.xlUp,
|
|
22
|
+
xlUp = _ref$xlUp === void 0 ? false : _ref$xlUp,
|
|
23
|
+
_ref$xsUp = _ref.xsUp,
|
|
24
|
+
xsUp = _ref$xsUp === void 0 ? false : _ref$xsUp,
|
|
25
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
26
|
+
|
|
27
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
28
|
+
ref: ref,
|
|
29
|
+
className: clsx(className, lgUp && 'govgr-lg-up', mdUp && 'govgr-md-up', smUp && 'govgr-sm-up', xlUp && 'govgr-xl-up', xsUp && 'govgr-xs-up')
|
|
30
|
+
}, props), children);
|
|
31
|
+
});
|
|
32
|
+
export default Hidden;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
import Hidden from '@digigov/react-core/Hidden';
|
|
4
|
+
|
|
5
|
+
var _ref = /*#__PURE__*/React.createElement(Hidden, {
|
|
6
|
+
lgUp: true
|
|
7
|
+
}, /*#__PURE__*/React.createElement("div", null, "hello"));
|
|
8
|
+
|
|
9
|
+
it('renders the Hidden with `lgUp` props', function () {
|
|
10
|
+
expect(mount(_ref)).toMatchSnapshot();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _ref2 = /*#__PURE__*/React.createElement(Hidden, {
|
|
14
|
+
mdUp: true
|
|
15
|
+
}, /*#__PURE__*/React.createElement("div", null, "hello"));
|
|
16
|
+
|
|
17
|
+
it('renders the Hidden with `mdUp` props', function () {
|
|
18
|
+
expect(mount(_ref2)).toMatchSnapshot();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
var _ref3 = /*#__PURE__*/React.createElement(Hidden, {
|
|
22
|
+
smUp: true
|
|
23
|
+
}, /*#__PURE__*/React.createElement("div", null, "hello"));
|
|
24
|
+
|
|
25
|
+
it('renders the Hidden with `smUp` props', function () {
|
|
26
|
+
expect(mount(_ref3)).toMatchSnapshot();
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
var _ref4 = /*#__PURE__*/React.createElement(Hidden, {
|
|
30
|
+
xlUp: true
|
|
31
|
+
}, /*#__PURE__*/React.createElement("div", null, "hello"));
|
|
32
|
+
|
|
33
|
+
it('renders the Hidden with `xlUp` props', function () {
|
|
34
|
+
expect(mount(_ref4)).toMatchSnapshot();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
var _ref5 = /*#__PURE__*/React.createElement(Hidden, {
|
|
38
|
+
xsUp: true
|
|
39
|
+
}, /*#__PURE__*/React.createElement("div", null, "hello"));
|
|
40
|
+
|
|
41
|
+
it('renders the Hidden with `xsUp` props', function () {
|
|
42
|
+
expect(mount(_ref5)).toMatchSnapshot();
|
|
43
|
+
});
|
package/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license Digigov v0.
|
|
1
|
+
/** @license Digigov v0.5.0
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the MIT license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -71,6 +71,7 @@ export { default as HeaderTitle } from '@digigov/react-core/HeaderTitle';
|
|
|
71
71
|
export { default as Heading } from '@digigov/react-core/Heading';
|
|
72
72
|
export { default as HeadingCaption } from '@digigov/react-core/HeadingCaption';
|
|
73
73
|
export { default as HellenicRepublicLogo } from '@digigov/react-core/HellenicRepublicLogo';
|
|
74
|
+
export { default as Hidden } from '@digigov/react-core/Hidden';
|
|
74
75
|
export { default as Hint } from '@digigov/react-core/Hint';
|
|
75
76
|
export { default as Label } from '@digigov/react-core/Label';
|
|
76
77
|
export { default as LabelTitle } from '@digigov/react-core/LabelTitle';
|
package/index.d.ts
CHANGED
|
@@ -66,6 +66,7 @@ export { default as HeaderTitle } from '@digigov/react-core/HeaderTitle';
|
|
|
66
66
|
export { default as Heading } from '@digigov/react-core/Heading';
|
|
67
67
|
export { default as HeadingCaption } from '@digigov/react-core/HeadingCaption';
|
|
68
68
|
export { default as HellenicRepublicLogo } from '@digigov/react-core/HellenicRepublicLogo';
|
|
69
|
+
export { default as Hidden } from '@digigov/react-core/Hidden';
|
|
69
70
|
export { default as Hint } from '@digigov/react-core/Hint';
|
|
70
71
|
export { default as Label } from '@digigov/react-core/Label';
|
|
71
72
|
export { default as LabelTitle } from '@digigov/react-core/LabelTitle';
|
package/index.js
CHANGED
|
@@ -413,6 +413,12 @@ Object.defineProperty(exports, "HellenicRepublicLogo", {
|
|
|
413
413
|
return _HellenicRepublicLogo["default"];
|
|
414
414
|
}
|
|
415
415
|
});
|
|
416
|
+
Object.defineProperty(exports, "Hidden", {
|
|
417
|
+
enumerable: true,
|
|
418
|
+
get: function get() {
|
|
419
|
+
return _Hidden["default"];
|
|
420
|
+
}
|
|
421
|
+
});
|
|
416
422
|
Object.defineProperty(exports, "Hint", {
|
|
417
423
|
enumerable: true,
|
|
418
424
|
get: function get() {
|
|
@@ -898,6 +904,8 @@ var _HeadingCaption = _interopRequireDefault(require("@digigov/react-core/Headin
|
|
|
898
904
|
|
|
899
905
|
var _HellenicRepublicLogo = _interopRequireDefault(require("@digigov/react-core/HellenicRepublicLogo"));
|
|
900
906
|
|
|
907
|
+
var _Hidden = _interopRequireDefault(require("@digigov/react-core/Hidden"));
|
|
908
|
+
|
|
901
909
|
var _Hint = _interopRequireDefault(require("@digigov/react-core/Hint"));
|
|
902
910
|
|
|
903
911
|
var _Label = _interopRequireDefault(require("@digigov/react-core/Label"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digigov/react-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "@digigov react core components",
|
|
5
5
|
"author": "GRNET Developers <devs@lists.grnet.gr>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"directory": "dist"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"@digigov/css": "0.
|
|
14
|
+
"@digigov/css": "0.7.0",
|
|
15
15
|
"clsx": "~1.1.1",
|
|
16
16
|
"react": "16.14.0",
|
|
17
17
|
"react-dom": "16.14.0"
|