@digigov/react-core 0.10.2 → 0.13.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/AccordionControls/__snapshots__/index.test.tsx.snap +13 -0
- package/AccordionSection/__snapshots__/index.test.tsx.snap +9 -7
- package/AccordionSectionHeader/__snapshots__/index.test.tsx.snap +2 -2
- package/AccordionSectionHeader/index.d.ts +1 -1
- package/AccordionSectionHeader/index.js +1 -1
- package/AccordionSectionSummary/__snapshots__/index.test.tsx.snap +11 -0
- package/AccordionSectionSummary/index.d.ts +9 -0
- package/AccordionSectionSummary/index.js +35 -0
- package/AccordionSectionSummary/index.test.d.ts +1 -0
- package/AccordionSectionSummary/index.test.js +15 -0
- package/AccordionSectionSummaryHeading/__snapshots__/index.test.tsx.snap +15 -0
- package/AccordionSectionSummaryHeading/index.d.ts +9 -0
- package/AccordionSectionSummaryHeading/index.js +37 -0
- package/AccordionSectionSummaryHeading/index.test.d.ts +1 -0
- package/AccordionSectionSummaryHeading/index.test.js +15 -0
- package/CHANGELOG.md +28 -1
- package/Card/__snapshots__/index.test.tsx.snap +118 -0
- package/Card/index.d.ts +14 -2
- package/Card/index.js +4 -2
- package/Card/index.test.js +65 -3
- package/Grid/index.d.ts +1 -1
- package/Grid/index.js +1 -1
- package/List/__snapshots__/index.test.tsx.snap +15 -15
- package/List/index.d.ts +2 -2
- package/List/index.js +2 -2
- package/PhaseBannerHeaderContainer/__snapshots__/inde.test.tsx.snap +11 -0
- package/PhaseBannerHeaderContainer/inde.test.d.ts +1 -0
- package/PhaseBannerHeaderContainer/inde.test.js +15 -0
- package/PhaseBannerHeaderContainer/index.d.ts +8 -0
- package/PhaseBannerHeaderContainer/index.js +32 -0
- package/TableContainer/__snapshots__/index.test.tsx.snap +23 -0
- package/TableContainer/index.d.ts +13 -0
- package/TableContainer/index.js +37 -0
- package/TableContainer/index.test.d.ts +1 -0
- package/TableContainer/index.test.js +23 -0
- package/es/AccordionControls/__snapshots__/index.test.tsx.snap +13 -0
- package/es/AccordionSection/__snapshots__/index.test.tsx.snap +9 -7
- package/es/AccordionSectionHeader/__snapshots__/index.test.tsx.snap +2 -2
- package/es/AccordionSectionHeader/index.js +1 -1
- package/es/AccordionSectionSummary/__snapshots__/index.test.tsx.snap +11 -0
- package/es/AccordionSectionSummary/index.js +20 -0
- package/es/AccordionSectionSummary/index.test.js +9 -0
- package/es/AccordionSectionSummaryHeading/__snapshots__/index.test.tsx.snap +15 -0
- package/es/AccordionSectionSummaryHeading/index.js +22 -0
- package/es/AccordionSectionSummaryHeading/index.test.js +9 -0
- package/es/Card/__snapshots__/index.test.tsx.snap +118 -0
- package/es/Card/index.js +4 -2
- package/es/Card/index.test.js +65 -3
- package/es/Grid/index.js +1 -1
- package/es/List/__snapshots__/index.test.tsx.snap +15 -15
- package/es/List/index.js +2 -2
- package/es/PhaseBannerHeaderContainer/__snapshots__/inde.test.tsx.snap +11 -0
- package/es/PhaseBannerHeaderContainer/inde.test.js +9 -0
- package/es/PhaseBannerHeaderContainer/index.js +16 -0
- package/es/TableContainer/__snapshots__/index.test.tsx.snap +23 -0
- package/es/TableContainer/index.js +22 -0
- package/es/TableContainer/index.test.js +17 -0
- package/es/index.js +4 -0
- package/esm/AccordionControls/__snapshots__/index.test.tsx.snap +13 -0
- package/esm/AccordionSection/__snapshots__/index.test.tsx.snap +9 -7
- package/esm/AccordionSectionHeader/__snapshots__/index.test.tsx.snap +2 -2
- package/esm/AccordionSectionHeader/index.js +1 -1
- package/esm/AccordionSectionSummary/__snapshots__/index.test.tsx.snap +11 -0
- package/esm/AccordionSectionSummary/index.js +20 -0
- package/esm/AccordionSectionSummary/index.test.js +9 -0
- package/esm/AccordionSectionSummaryHeading/__snapshots__/index.test.tsx.snap +15 -0
- package/esm/AccordionSectionSummaryHeading/index.js +22 -0
- package/esm/AccordionSectionSummaryHeading/index.test.js +9 -0
- package/esm/Card/__snapshots__/index.test.tsx.snap +118 -0
- package/esm/Card/index.js +4 -2
- package/esm/Card/index.test.js +65 -3
- package/esm/Grid/index.js +1 -1
- package/esm/List/__snapshots__/index.test.tsx.snap +15 -15
- package/esm/List/index.js +2 -2
- package/esm/PhaseBannerHeaderContainer/__snapshots__/inde.test.tsx.snap +11 -0
- package/esm/PhaseBannerHeaderContainer/inde.test.js +9 -0
- package/esm/PhaseBannerHeaderContainer/index.js +16 -0
- package/esm/TableContainer/__snapshots__/index.test.tsx.snap +23 -0
- package/esm/TableContainer/index.js +22 -0
- package/esm/TableContainer/index.test.js +17 -0
- package/esm/index.js +5 -1
- package/index.d.ts +4 -0
- package/index.js +32 -0
- package/package.json +2 -2
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders the AccordionControls with button 1`] = `
|
|
4
|
+
<ForwardRef(AccordionControls)>
|
|
5
|
+
<div
|
|
6
|
+
className="govgr-accordion__controls"
|
|
7
|
+
>
|
|
8
|
+
<button>
|
|
9
|
+
open all
|
|
10
|
+
</button>
|
|
11
|
+
</div>
|
|
12
|
+
</ForwardRef(AccordionControls)>
|
|
13
|
+
`;
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`renders the AccordionSection with no props 1`] = `
|
|
4
4
|
<ForwardRef(AccordionSection)>
|
|
5
|
-
<
|
|
5
|
+
<details
|
|
6
6
|
className="govgr-accordion__section"
|
|
7
7
|
>
|
|
8
8
|
hello
|
|
9
|
-
</
|
|
9
|
+
</details>
|
|
10
10
|
</ForwardRef(AccordionSection)>
|
|
11
11
|
`;
|
|
12
12
|
|
|
@@ -14,11 +14,12 @@ exports[`renders the AccordionSection with open=false 1`] = `
|
|
|
14
14
|
<ForwardRef(AccordionSection)
|
|
15
15
|
open={false}
|
|
16
16
|
>
|
|
17
|
-
<
|
|
17
|
+
<details
|
|
18
18
|
className="govgr-accordion__section"
|
|
19
|
+
open={false}
|
|
19
20
|
>
|
|
20
21
|
hello
|
|
21
|
-
</
|
|
22
|
+
</details>
|
|
22
23
|
</ForwardRef(AccordionSection)>
|
|
23
24
|
`;
|
|
24
25
|
|
|
@@ -26,10 +27,11 @@ exports[`renders the AccordionSection with open=true 1`] = `
|
|
|
26
27
|
<ForwardRef(AccordionSection)
|
|
27
28
|
open={true}
|
|
28
29
|
>
|
|
29
|
-
<
|
|
30
|
-
className="govgr-accordion__section
|
|
30
|
+
<details
|
|
31
|
+
className="govgr-accordion__section"
|
|
32
|
+
open={true}
|
|
31
33
|
>
|
|
32
34
|
hello
|
|
33
|
-
</
|
|
35
|
+
</details>
|
|
34
36
|
</ForwardRef(AccordionSection)>
|
|
35
37
|
`;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`renders the AccordionSectionHeader with no props 1`] = `
|
|
4
4
|
<ForwardRef(AccordionSectionHeader)>
|
|
5
|
-
<
|
|
5
|
+
<summary
|
|
6
6
|
className="govgr-accordion__section-header"
|
|
7
7
|
>
|
|
8
8
|
<h2
|
|
@@ -14,6 +14,6 @@ exports[`renders the AccordionSectionHeader with no props 1`] = `
|
|
|
14
14
|
hello
|
|
15
15
|
</span>
|
|
16
16
|
</h2>
|
|
17
|
-
</
|
|
17
|
+
</summary>
|
|
18
18
|
</ForwardRef(AccordionSectionHeader)>
|
|
19
19
|
`;
|
|
@@ -3,7 +3,7 @@ declare type DivElementAttributes = JSX.IntrinsicElements['div'];
|
|
|
3
3
|
export interface AccordionSectionHeaderProps extends DivElementAttributes {
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
|
-
* AccordionSectionHeader
|
|
6
|
+
* AccordionSectionHeader will be deprecated and implemented using AccordionSectionSummary and AccordionSectionSummaryHeading.
|
|
7
7
|
*/
|
|
8
8
|
export declare const AccordionSectionHeader: React.ForwardRefExoticComponent<Pick<AccordionSectionHeaderProps, "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
9
|
export default AccordionSectionHeader;
|
|
@@ -18,7 +18,7 @@ var _clsx = _interopRequireDefault(require("clsx"));
|
|
|
18
18
|
var _excluded = ["className", "children"];
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* AccordionSectionHeader
|
|
21
|
+
* AccordionSectionHeader will be deprecated and implemented using AccordionSectionSummary and AccordionSectionSummaryHeading.
|
|
22
22
|
*/
|
|
23
23
|
var AccordionSectionHeader = /*#__PURE__*/_react["default"].forwardRef(function AccordionSectionHeader(_ref, ref) {
|
|
24
24
|
var className = _ref.className,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders the AccordionSectionSummary with no props 1`] = `
|
|
4
|
+
<ForwardRef(AccordionSectionSummary)>
|
|
5
|
+
<summary
|
|
6
|
+
className="govgr-accordion__section-summary"
|
|
7
|
+
>
|
|
8
|
+
hello
|
|
9
|
+
</summary>
|
|
10
|
+
</ForwardRef(AccordionSectionSummary)>
|
|
11
|
+
`;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type SummaryElementAttributes = JSX.IntrinsicElements['summary'];
|
|
3
|
+
export interface AccordionSectionSummaryProps extends SummaryElementAttributes {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* AccordionSectionSummary is used as a wrapper component for AccordionSectionSummaryHeading.
|
|
7
|
+
*/
|
|
8
|
+
export declare const AccordionSectionSummary: React.ForwardRefExoticComponent<Pick<AccordionSectionSummaryProps, "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 AccordionSectionSummary;
|
|
@@ -0,0 +1,35 @@
|
|
|
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.AccordionSectionSummary = 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
|
+
* AccordionSectionSummary is used as a wrapper component for AccordionSectionSummaryHeading.
|
|
22
|
+
*/
|
|
23
|
+
var AccordionSectionSummary = /*#__PURE__*/_react["default"].forwardRef(function AccordionSectionSummary(_ref, ref) {
|
|
24
|
+
var className = _ref.className,
|
|
25
|
+
children = _ref.children,
|
|
26
|
+
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
27
|
+
return /*#__PURE__*/_react["default"].createElement("summary", (0, _extends2["default"])({
|
|
28
|
+
ref: ref,
|
|
29
|
+
className: (0, _clsx["default"])(className, true && 'govgr-accordion__section-summary')
|
|
30
|
+
}, props), children);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
exports.AccordionSectionSummary = AccordionSectionSummary;
|
|
34
|
+
var _default = AccordionSectionSummary;
|
|
35
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
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 _AccordionSectionSummary = _interopRequireDefault(require("@digigov/react-core/AccordionSectionSummary"));
|
|
10
|
+
|
|
11
|
+
var _ref = /*#__PURE__*/_react["default"].createElement(_AccordionSectionSummary["default"], null, "hello");
|
|
12
|
+
|
|
13
|
+
it('renders the AccordionSectionSummary with no props', function () {
|
|
14
|
+
expect((0, _enzyme.mount)(_ref)).toMatchSnapshot();
|
|
15
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders the AccordionSectionSummaryHeading with no props 1`] = `
|
|
4
|
+
<ForwardRef(AccordionSectionSummaryHeading)>
|
|
5
|
+
<h2
|
|
6
|
+
className="govgr-accordion__section-heading"
|
|
7
|
+
>
|
|
8
|
+
<span
|
|
9
|
+
className="govgr-accordion__section-button"
|
|
10
|
+
>
|
|
11
|
+
hello
|
|
12
|
+
</span>
|
|
13
|
+
</h2>
|
|
14
|
+
</ForwardRef(AccordionSectionSummaryHeading)>
|
|
15
|
+
`;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type H2ElementAttributes = JSX.IntrinsicElements['h2'];
|
|
3
|
+
export interface AccordionSectionSummaryHeadingProps extends H2ElementAttributes {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* AccordionSectionSummaryHeading should be placed inside AccordionSectionSummary.
|
|
7
|
+
*/
|
|
8
|
+
export declare const AccordionSectionSummaryHeading: React.ForwardRefExoticComponent<Pick<AccordionSectionSummaryHeadingProps, "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<HTMLHeadingElement>>;
|
|
9
|
+
export default AccordionSectionSummaryHeading;
|
|
@@ -0,0 +1,37 @@
|
|
|
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.AccordionSectionSummaryHeading = 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
|
+
* AccordionSectionSummaryHeading should be placed inside AccordionSectionSummary.
|
|
22
|
+
*/
|
|
23
|
+
var AccordionSectionSummaryHeading = /*#__PURE__*/_react["default"].forwardRef(function AccordionSectionSummaryHeading(_ref, ref) {
|
|
24
|
+
var className = _ref.className,
|
|
25
|
+
children = _ref.children,
|
|
26
|
+
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
27
|
+
return /*#__PURE__*/_react["default"].createElement("h2", (0, _extends2["default"])({
|
|
28
|
+
ref: ref,
|
|
29
|
+
className: (0, _clsx["default"])(className, true && 'govgr-accordion__section-heading')
|
|
30
|
+
}, props), /*#__PURE__*/_react["default"].createElement("span", {
|
|
31
|
+
className: (0, _clsx["default"])(true && 'govgr-accordion__section-button')
|
|
32
|
+
}, children));
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
exports.AccordionSectionSummaryHeading = AccordionSectionSummaryHeading;
|
|
36
|
+
var _default = AccordionSectionSummaryHeading;
|
|
37
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
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 _AccordionSectionSummaryHeading = _interopRequireDefault(require("@digigov/react-core/AccordionSectionSummaryHeading"));
|
|
10
|
+
|
|
11
|
+
var _ref = /*#__PURE__*/_react["default"].createElement(_AccordionSectionSummaryHeading["default"], null, "hello");
|
|
12
|
+
|
|
13
|
+
it('renders the AccordionSectionSummaryHeading with no props', function () {
|
|
14
|
+
expect((0, _enzyme.mount)(_ref)).toMatchSnapshot();
|
|
15
|
+
});
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,33 @@
|
|
|
1
1
|
# Change Log - @digigov/react-core
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 10 May 2022 14:04:00 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 0.13.0
|
|
6
|
+
Tue, 10 May 2022 14:04:00 GMT
|
|
7
|
+
|
|
8
|
+
### Minor changes
|
|
9
|
+
|
|
10
|
+
- Create PhaseBannerHeaderContainer
|
|
11
|
+
- Implement AccordionSectionHeader using AccordionSectionSummary and AccordionSectionSummaryHeading
|
|
12
|
+
|
|
13
|
+
### Patches
|
|
14
|
+
|
|
15
|
+
- change element tag from ul to ol in List component
|
|
16
|
+
- Add comments to List component properties
|
|
17
|
+
|
|
18
|
+
## 0.12.0
|
|
19
|
+
Tue, 03 May 2022 10:27:10 GMT
|
|
20
|
+
|
|
21
|
+
### Minor changes
|
|
22
|
+
|
|
23
|
+
- add TableContainer component
|
|
24
|
+
|
|
25
|
+
## 0.11.0
|
|
26
|
+
Wed, 20 Apr 2022 12:11:46 GMT
|
|
27
|
+
|
|
28
|
+
### Minor changes
|
|
29
|
+
|
|
30
|
+
- add more props at Card component
|
|
4
31
|
|
|
5
32
|
## 0.10.2
|
|
6
33
|
Mon, 18 Apr 2022 13:00:33 GMT
|
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
+
exports[`renders the Card with callToActon props 1`] = `
|
|
4
|
+
<ForwardRef(Card)
|
|
5
|
+
callToAction={true}
|
|
6
|
+
>
|
|
7
|
+
<div
|
|
8
|
+
className="govgr-card--cta govgr-card"
|
|
9
|
+
>
|
|
10
|
+
<div
|
|
11
|
+
className="govgr-card__body"
|
|
12
|
+
>
|
|
13
|
+
hello
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</ForwardRef(Card)>
|
|
17
|
+
`;
|
|
18
|
+
|
|
3
19
|
exports[`renders the Card with no props 1`] = `
|
|
4
20
|
<ForwardRef(Card)>
|
|
5
21
|
<div
|
|
@@ -14,6 +30,40 @@ exports[`renders the Card with no props 1`] = `
|
|
|
14
30
|
</ForwardRef(Card)>
|
|
15
31
|
`;
|
|
16
32
|
|
|
33
|
+
exports[`renders the Card with variant="border" and borderColor="dark" props 1`] = `
|
|
34
|
+
<ForwardRef(Card)
|
|
35
|
+
borderColor="dark"
|
|
36
|
+
variant="border"
|
|
37
|
+
>
|
|
38
|
+
<div
|
|
39
|
+
className="govgr-card--border govgr-card--border-dark govgr-card"
|
|
40
|
+
>
|
|
41
|
+
<div
|
|
42
|
+
className="govgr-card__body"
|
|
43
|
+
>
|
|
44
|
+
hello
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</ForwardRef(Card)>
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
exports[`renders the Card with variant="border" and borderColor="gray" props 1`] = `
|
|
51
|
+
<ForwardRef(Card)
|
|
52
|
+
borderColor="gray"
|
|
53
|
+
variant="border"
|
|
54
|
+
>
|
|
55
|
+
<div
|
|
56
|
+
className="govgr-card--border govgr-card--border-gray govgr-card"
|
|
57
|
+
>
|
|
58
|
+
<div
|
|
59
|
+
className="govgr-card__body"
|
|
60
|
+
>
|
|
61
|
+
hello
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</ForwardRef(Card)>
|
|
65
|
+
`;
|
|
66
|
+
|
|
17
67
|
exports[`renders the Card with variant="border" props 1`] = `
|
|
18
68
|
<ForwardRef(Card)
|
|
19
69
|
variant="border"
|
|
@@ -30,6 +80,74 @@ exports[`renders the Card with variant="border" props 1`] = `
|
|
|
30
80
|
</ForwardRef(Card)>
|
|
31
81
|
`;
|
|
32
82
|
|
|
83
|
+
exports[`renders the Card with variant="border-top" and borderColor="dark" callToAction props 1`] = `
|
|
84
|
+
<ForwardRef(Card)
|
|
85
|
+
borderColor="dark"
|
|
86
|
+
callToAction={true}
|
|
87
|
+
variant="border-top"
|
|
88
|
+
>
|
|
89
|
+
<div
|
|
90
|
+
className="govgr-card--border-top govgr-card--border-dark govgr-card--cta govgr-card"
|
|
91
|
+
>
|
|
92
|
+
<div
|
|
93
|
+
className="govgr-card__body"
|
|
94
|
+
>
|
|
95
|
+
hello
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
</ForwardRef(Card)>
|
|
99
|
+
`;
|
|
100
|
+
|
|
101
|
+
exports[`renders the Card with variant="border-top" and borderColor="dark" props 1`] = `
|
|
102
|
+
<ForwardRef(Card)
|
|
103
|
+
borderColor="dark"
|
|
104
|
+
variant="border-top"
|
|
105
|
+
>
|
|
106
|
+
<div
|
|
107
|
+
className="govgr-card--border-top govgr-card--border-dark govgr-card"
|
|
108
|
+
>
|
|
109
|
+
<div
|
|
110
|
+
className="govgr-card__body"
|
|
111
|
+
>
|
|
112
|
+
hello
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
</ForwardRef(Card)>
|
|
116
|
+
`;
|
|
117
|
+
|
|
118
|
+
exports[`renders the Card with variant="border-top" and borderColor="gray" props 1`] = `
|
|
119
|
+
<ForwardRef(Card)
|
|
120
|
+
borderColor="gray"
|
|
121
|
+
variant="border-top"
|
|
122
|
+
>
|
|
123
|
+
<div
|
|
124
|
+
className="govgr-card--border-top govgr-card--border-gray govgr-card"
|
|
125
|
+
>
|
|
126
|
+
<div
|
|
127
|
+
className="govgr-card__body"
|
|
128
|
+
>
|
|
129
|
+
hello
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
</ForwardRef(Card)>
|
|
133
|
+
`;
|
|
134
|
+
|
|
135
|
+
exports[`renders the Card with variant="border-top" props 1`] = `
|
|
136
|
+
<ForwardRef(Card)
|
|
137
|
+
variant="border-top"
|
|
138
|
+
>
|
|
139
|
+
<div
|
|
140
|
+
className="govgr-card--border-top govgr-card"
|
|
141
|
+
>
|
|
142
|
+
<div
|
|
143
|
+
className="govgr-card__body"
|
|
144
|
+
>
|
|
145
|
+
hello
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
</ForwardRef(Card)>
|
|
149
|
+
`;
|
|
150
|
+
|
|
33
151
|
exports[`renders the Card with variant="divider" props 1`] = `
|
|
34
152
|
<ForwardRef(Card)
|
|
35
153
|
variant="divider"
|
package/Card/index.d.ts
CHANGED
|
@@ -6,12 +6,24 @@ export interface CardProps extends DivElementAttributes {
|
|
|
6
6
|
* divider
|
|
7
7
|
* `variant` property is optional.
|
|
8
8
|
*/
|
|
9
|
-
variant?:
|
|
9
|
+
variant?: 'border' | 'divider' | 'border-top';
|
|
10
|
+
/**
|
|
11
|
+
*borderColor property is optional and it is used to set the color of the Card's border.
|
|
12
|
+
*
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
borderColor?: 'gray' | 'dark';
|
|
16
|
+
/**
|
|
17
|
+
*callToAction property is optional and it is used to set the content of the Card clickable.
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
callToAction?: boolean;
|
|
10
22
|
}
|
|
11
23
|
/**
|
|
12
24
|
* Cards can be used to divide and organise interface content for better understandability and readability.
|
|
13
25
|
* Cards can help your users to scan through vast amounts of information quicker.
|
|
14
26
|
* Use Card as parent component to wrap CardHeading, CardText and CartAction components
|
|
15
27
|
*/
|
|
16
|
-
export declare const Card: React.ForwardRefExoticComponent<Pick<CardProps, "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" | "variant"> & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
export declare const Card: React.ForwardRefExoticComponent<Pick<CardProps, "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" | "variant" | "borderColor" | "callToAction"> & React.RefAttributes<HTMLDivElement>>;
|
|
17
29
|
export default Card;
|
package/Card/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
15
15
|
|
|
16
16
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
17
17
|
|
|
18
|
-
var _excluded = ["variant", "style", "className", "children"];
|
|
18
|
+
var _excluded = ["variant", "borderColor", "callToAction", "style", "className", "children"];
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Cards can be used to divide and organise interface content for better understandability and readability.
|
|
@@ -24,13 +24,15 @@ var _excluded = ["variant", "style", "className", "children"];
|
|
|
24
24
|
*/
|
|
25
25
|
var Card = /*#__PURE__*/_react["default"].forwardRef(function Card(_ref, ref) {
|
|
26
26
|
var variant = _ref.variant,
|
|
27
|
+
borderColor = _ref.borderColor,
|
|
28
|
+
callToAction = _ref.callToAction,
|
|
27
29
|
style = _ref.style,
|
|
28
30
|
className = _ref.className,
|
|
29
31
|
children = _ref.children,
|
|
30
32
|
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
31
33
|
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
|
|
32
34
|
ref: ref,
|
|
33
|
-
className: (0, _clsx["default"])(className, variant ===
|
|
35
|
+
className: (0, _clsx["default"])(className, variant === 'border-top' && 'govgr-card--border-top', borderColor === 'gray' && 'govgr-card--border-gray', borderColor === 'dark' && 'govgr-card--border-dark', variant === 'divider' && 'govgr-card--divider', variant === 'border' && 'govgr-card--border', callToAction && 'govgr-card--cta', true && 'govgr-card')
|
|
34
36
|
}, props), /*#__PURE__*/_react["default"].createElement("div", {
|
|
35
37
|
className: (0, _clsx["default"])(true && 'govgr-card__body')
|
|
36
38
|
}, children));
|
package/Card/index.test.js
CHANGED
|
@@ -15,17 +15,79 @@ it('renders the Card with no props', function () {
|
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
var _ref2 = /*#__PURE__*/_react["default"].createElement(_Card["default"], {
|
|
18
|
-
|
|
18
|
+
callToAction: true
|
|
19
19
|
}, "hello");
|
|
20
20
|
|
|
21
|
-
it('renders the Card with
|
|
21
|
+
it('renders the Card with callToActon props', function () {
|
|
22
22
|
expect((0, _enzyme.mount)(_ref2)).toMatchSnapshot();
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
var _ref3 = /*#__PURE__*/_react["default"].createElement(_Card["default"], {
|
|
26
|
+
variant: "border"
|
|
27
|
+
}, "hello");
|
|
28
|
+
|
|
29
|
+
it('renders the Card with variant="border" props', function () {
|
|
30
|
+
expect((0, _enzyme.mount)(_ref3)).toMatchSnapshot();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
var _ref4 = /*#__PURE__*/_react["default"].createElement(_Card["default"], {
|
|
26
34
|
variant: "divider"
|
|
27
35
|
}, "hello");
|
|
28
36
|
|
|
29
37
|
it('renders the Card with variant="divider" props', function () {
|
|
30
|
-
expect((0, _enzyme.mount)(
|
|
38
|
+
expect((0, _enzyme.mount)(_ref4)).toMatchSnapshot();
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
var _ref5 = /*#__PURE__*/_react["default"].createElement(_Card["default"], {
|
|
42
|
+
variant: "border-top"
|
|
43
|
+
}, "hello");
|
|
44
|
+
|
|
45
|
+
it('renders the Card with variant="border-top" props', function () {
|
|
46
|
+
expect((0, _enzyme.mount)(_ref5)).toMatchSnapshot();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
var _ref6 = /*#__PURE__*/_react["default"].createElement(_Card["default"], {
|
|
50
|
+
variant: "border",
|
|
51
|
+
borderColor: "dark"
|
|
52
|
+
}, "hello");
|
|
53
|
+
|
|
54
|
+
it('renders the Card with variant="border" and borderColor="dark" props', function () {
|
|
55
|
+
expect((0, _enzyme.mount)(_ref6)).toMatchSnapshot();
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
var _ref7 = /*#__PURE__*/_react["default"].createElement(_Card["default"], {
|
|
59
|
+
variant: "border",
|
|
60
|
+
borderColor: "gray"
|
|
61
|
+
}, "hello");
|
|
62
|
+
|
|
63
|
+
it('renders the Card with variant="border" and borderColor="gray" props', function () {
|
|
64
|
+
expect((0, _enzyme.mount)(_ref7)).toMatchSnapshot();
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
var _ref8 = /*#__PURE__*/_react["default"].createElement(_Card["default"], {
|
|
68
|
+
variant: "border-top",
|
|
69
|
+
borderColor: "dark"
|
|
70
|
+
}, "hello");
|
|
71
|
+
|
|
72
|
+
it('renders the Card with variant="border-top" and borderColor="dark" props', function () {
|
|
73
|
+
expect((0, _enzyme.mount)(_ref8)).toMatchSnapshot();
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
var _ref9 = /*#__PURE__*/_react["default"].createElement(_Card["default"], {
|
|
77
|
+
variant: "border-top",
|
|
78
|
+
borderColor: "gray"
|
|
79
|
+
}, "hello");
|
|
80
|
+
|
|
81
|
+
it('renders the Card with variant="border-top" and borderColor="gray" props', function () {
|
|
82
|
+
expect((0, _enzyme.mount)(_ref9)).toMatchSnapshot();
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
var _ref10 = /*#__PURE__*/_react["default"].createElement(_Card["default"], {
|
|
86
|
+
variant: "border-top",
|
|
87
|
+
borderColor: "dark",
|
|
88
|
+
callToAction: true
|
|
89
|
+
}, "hello");
|
|
90
|
+
|
|
91
|
+
it('renders the Card with variant="border-top" and borderColor="dark" callToAction props', function () {
|
|
92
|
+
expect((0, _enzyme.mount)(_ref10)).toMatchSnapshot();
|
|
31
93
|
});
|
package/Grid/index.d.ts
CHANGED