@digigov/react-core 0.6.1 → 0.6.4
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/ArrowIcon/__snapshots__/index.test.tsx.snap +48 -32
- package/ArrowIcon/index.d.ts +4 -3
- package/ArrowIcon/index.js +13 -27
- package/BurgerIcon/__snapshots__/index.test.tsx.snap +323 -126
- package/BurgerIcon/index.d.ts +13 -7
- package/BurgerIcon/index.js +13 -33
- package/BurgerIcon/index.test.js +47 -5
- package/Button/index.d.ts +1 -1
- package/CHANGELOG.md +23 -1
- package/CaretIcon/__snapshots__/index.test.tsx.snap +48 -32
- package/CaretIcon/index.d.ts +4 -3
- package/CaretIcon/index.js +13 -27
- package/CheckIcon/__snapshots__/index.test.tsx.snap +196 -136
- package/CheckIcon/index.d.ts +7 -11
- package/CheckIcon/index.js +10 -34
- package/CheckboxItem/index.d.ts +1 -1
- package/CloseIcon/__snapshots__/index.test.tsx.snap +12 -8
- package/CloseIcon/index.d.ts +9 -3
- package/CloseIcon/index.js +10 -7
- package/DateInputItem/index.d.ts +1 -1
- package/Dropdown/__snapshots__/index.test.tsx.snap +144 -0
- package/Dropdown/index.d.ts +30 -0
- package/Dropdown/index.js +42 -0
- package/Dropdown/index.test.d.ts +1 -0
- package/Dropdown/index.test.js +101 -0
- package/DropdownButton/__snapshots__/index.test.tsx.snap +375 -0
- package/DropdownButton/index.d.ts +28 -0
- package/DropdownButton/index.js +47 -0
- package/DropdownButton/index.test.d.ts +1 -0
- package/DropdownButton/index.test.js +195 -0
- package/DropdownContent/__snapshots__/index.test.tsx.snap +11 -0
- package/DropdownContent/index.d.ts +9 -0
- package/DropdownContent/index.js +35 -0
- package/DropdownContent/index.test.d.ts +1 -0
- package/DropdownContent/index.test.js +15 -0
- package/FieldsetLegend/index.d.ts +1 -1
- package/FileUpload/index.d.ts +1 -1
- package/Grid/index.d.ts +1 -1
- package/LabelTitle/index.d.ts +1 -1
- package/MoreVertIcon/__snapshots__/index.test.tsx.snap +391 -315
- package/MoreVertIcon/index.d.ts +7 -11
- package/MoreVertIcon/index.js +10 -34
- package/NormalText/index.d.ts +1 -1
- package/Paragraph/index.d.ts +1 -1
- package/RadioItem/index.d.ts +1 -1
- package/Select/index.d.ts +1 -1
- package/SvgIcon/__snapshots__/index.test.tsx.snap +224 -0
- package/SvgIcon/index.d.ts +20 -0
- package/SvgIcon/index.js +41 -0
- package/SvgIcon/index.test.d.ts +1 -0
- package/SvgIcon/index.test.js +129 -0
- package/Table/index.d.ts +1 -1
- package/TableDataCell/index.d.ts +1 -1
- package/TableHeaderCell/index.d.ts +1 -1
- package/TextArea/index.d.ts +1 -1
- package/TextInput/index.d.ts +1 -1
- package/UncheckIcon/__snapshots__/index.test.tsx.snap +241 -165
- package/UncheckIcon/index.d.ts +9 -13
- package/UncheckIcon/index.js +15 -39
- package/es/ArrowIcon/__snapshots__/index.test.tsx.snap +48 -32
- package/es/ArrowIcon/index.js +12 -19
- package/es/BurgerIcon/__snapshots__/index.test.tsx.snap +323 -126
- package/es/BurgerIcon/index.js +12 -25
- package/es/BurgerIcon/index.test.js +47 -5
- package/es/CaretIcon/__snapshots__/index.test.tsx.snap +48 -32
- package/es/CaretIcon/index.js +12 -19
- package/es/CheckIcon/__snapshots__/index.test.tsx.snap +196 -136
- package/es/CheckIcon/index.js +9 -26
- package/es/CloseIcon/__snapshots__/index.test.tsx.snap +12 -8
- package/es/CloseIcon/index.js +9 -7
- package/es/Dropdown/__snapshots__/index.test.tsx.snap +144 -0
- package/es/Dropdown/index.js +27 -0
- package/es/Dropdown/index.test.js +95 -0
- package/es/DropdownButton/__snapshots__/index.test.tsx.snap +375 -0
- package/es/DropdownButton/index.js +31 -0
- package/es/DropdownButton/index.test.js +189 -0
- package/es/DropdownContent/__snapshots__/index.test.tsx.snap +11 -0
- package/es/DropdownContent/index.js +20 -0
- package/es/DropdownContent/index.test.js +9 -0
- package/es/MoreVertIcon/__snapshots__/index.test.tsx.snap +391 -315
- package/es/MoreVertIcon/index.js +9 -26
- package/es/SvgIcon/__snapshots__/index.test.tsx.snap +224 -0
- package/es/SvgIcon/index.js +26 -0
- package/es/SvgIcon/index.test.js +123 -0
- package/es/UncheckIcon/__snapshots__/index.test.tsx.snap +241 -165
- package/es/UncheckIcon/index.js +12 -29
- package/es/index.js +4 -0
- package/esm/ArrowIcon/__snapshots__/index.test.tsx.snap +48 -32
- package/esm/ArrowIcon/index.js +12 -19
- package/esm/BurgerIcon/__snapshots__/index.test.tsx.snap +323 -126
- package/esm/BurgerIcon/index.js +12 -25
- package/esm/BurgerIcon/index.test.js +47 -5
- package/esm/CaretIcon/__snapshots__/index.test.tsx.snap +48 -32
- package/esm/CaretIcon/index.js +12 -19
- package/esm/CheckIcon/__snapshots__/index.test.tsx.snap +196 -136
- package/esm/CheckIcon/index.js +9 -26
- package/esm/CloseIcon/__snapshots__/index.test.tsx.snap +12 -8
- package/esm/CloseIcon/index.js +9 -7
- package/esm/Dropdown/__snapshots__/index.test.tsx.snap +144 -0
- package/esm/Dropdown/index.js +27 -0
- package/esm/Dropdown/index.test.js +95 -0
- package/esm/DropdownButton/__snapshots__/index.test.tsx.snap +375 -0
- package/esm/DropdownButton/index.js +31 -0
- package/esm/DropdownButton/index.test.js +189 -0
- package/esm/DropdownContent/__snapshots__/index.test.tsx.snap +11 -0
- package/esm/DropdownContent/index.js +20 -0
- package/esm/DropdownContent/index.test.js +9 -0
- package/esm/MoreVertIcon/__snapshots__/index.test.tsx.snap +391 -315
- package/esm/MoreVertIcon/index.js +9 -26
- package/esm/SvgIcon/__snapshots__/index.test.tsx.snap +224 -0
- package/esm/SvgIcon/index.js +26 -0
- package/esm/SvgIcon/index.test.js +123 -0
- package/esm/UncheckIcon/__snapshots__/index.test.tsx.snap +241 -165
- package/esm/UncheckIcon/index.js +12 -29
- package/esm/index.js +5 -1
- package/index.d.ts +4 -0
- package/index.js +32 -0
- package/package.json +2 -2
package/BurgerIcon/index.test.js
CHANGED
|
@@ -39,19 +39,61 @@ it('renders the BurgerIcon prop variant= "light"', function () {
|
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
var _ref5 = /*#__PURE__*/_react["default"].createElement(_BurgerIcon["default"], {
|
|
42
|
-
|
|
43
|
-
variant: "dark"
|
|
42
|
+
variant: "error"
|
|
44
43
|
});
|
|
45
44
|
|
|
46
|
-
it('renders the BurgerIcon
|
|
45
|
+
it('renders the BurgerIcon prop variant= "error"', function () {
|
|
47
46
|
expect((0, _enzyme.mount)(_ref5)).toMatchSnapshot();
|
|
48
47
|
});
|
|
49
48
|
|
|
50
49
|
var _ref6 = /*#__PURE__*/_react["default"].createElement(_BurgerIcon["default"], {
|
|
50
|
+
hidden: "s"
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('renders the BurgerIcon prop hidden="s"', function () {
|
|
54
|
+
expect((0, _enzyme.mount)(_ref6)).toMatchSnapshot();
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
var _ref7 = /*#__PURE__*/_react["default"].createElement(_BurgerIcon["default"], {
|
|
58
|
+
hidden: "m"
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it('renders the BurgerIcon prop hidden="m"', function () {
|
|
62
|
+
expect((0, _enzyme.mount)(_ref7)).toMatchSnapshot();
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
var _ref8 = /*#__PURE__*/_react["default"].createElement(_BurgerIcon["default"], {
|
|
66
|
+
hidden: "l"
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it('renders the BurgerIcon prop hidden="l"', function () {
|
|
70
|
+
expect((0, _enzyme.mount)(_ref8)).toMatchSnapshot();
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
var _ref9 = /*#__PURE__*/_react["default"].createElement(_BurgerIcon["default"], {
|
|
74
|
+
active: true,
|
|
75
|
+
hidden: "s",
|
|
76
|
+
variant: "dark"
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it('renders the BurgerIcon with props active hidden="s" and variant="dark"', function () {
|
|
80
|
+
expect((0, _enzyme.mount)(_ref9)).toMatchSnapshot();
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
var _ref10 = /*#__PURE__*/_react["default"].createElement(_BurgerIcon["default"], {
|
|
84
|
+
hidden: "l",
|
|
85
|
+
variant: "success"
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it('renders the BurgerIcon with props hidden="l" and variant="success"', function () {
|
|
89
|
+
expect((0, _enzyme.mount)(_ref10)).toMatchSnapshot();
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
var _ref11 = /*#__PURE__*/_react["default"].createElement(_BurgerIcon["default"], {
|
|
51
93
|
active: true,
|
|
52
94
|
variant: "light"
|
|
53
95
|
});
|
|
54
96
|
|
|
55
|
-
it('renders the BurgerIcon props active hidden="
|
|
56
|
-
expect((0, _enzyme.mount)(
|
|
97
|
+
it('renders the BurgerIcon props active hidden="no" variant= "light"', function () {
|
|
98
|
+
expect((0, _enzyme.mount)(_ref11)).toMatchSnapshot();
|
|
57
99
|
});
|
package/Button/index.d.ts
CHANGED
|
@@ -21,5 +21,5 @@ export interface ButtonProps extends ButtonElementAttributes {
|
|
|
21
21
|
/**
|
|
22
22
|
* Use the Button component to help users carry out an action.
|
|
23
23
|
*/
|
|
24
|
-
export declare const Button: React.ForwardRefExoticComponent<Pick<ButtonProps, "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" | "form" | "
|
|
24
|
+
export declare const Button: React.ForwardRefExoticComponent<Pick<ButtonProps, "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" | "form" | "variant" | "name" | "type" | "value" | "disabled" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget"> & React.RefAttributes<HTMLButtonElement>>;
|
|
25
25
|
export default Button;
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
# Change Log - @digigov/react-core
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 04 Mar 2022 12:15:07 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 0.6.4
|
|
6
|
+
Fri, 04 Mar 2022 12:15:07 GMT
|
|
7
|
+
|
|
8
|
+
### Patches
|
|
9
|
+
|
|
10
|
+
- create Dropdown DropdownButton and DropdownContent components for dropdown menu
|
|
11
|
+
|
|
12
|
+
## 0.6.3
|
|
13
|
+
Tue, 01 Mar 2022 13:33:28 GMT
|
|
14
|
+
|
|
15
|
+
### Patches
|
|
16
|
+
|
|
17
|
+
- Fix SvgIcon className prop
|
|
18
|
+
|
|
19
|
+
## 0.6.2
|
|
20
|
+
Mon, 28 Feb 2022 15:04:49 GMT
|
|
21
|
+
|
|
22
|
+
### Patches
|
|
23
|
+
|
|
24
|
+
- Remove href's initial value from NavHorizontalListItem and add prop to NavHorizontal for no bottom border
|
|
25
|
+
- refactor svg icons, create SvgIcon global component
|
|
4
26
|
|
|
5
27
|
## 0.6.1
|
|
6
28
|
Thu, 24 Feb 2022 14:51:06 GMT
|
|
@@ -4,16 +4,20 @@ exports[`renders the CaretIcon with direction down prop 1`] = `
|
|
|
4
4
|
<ForwardRef(CaretIcon)
|
|
5
5
|
direction="down"
|
|
6
6
|
>
|
|
7
|
-
<
|
|
8
|
-
aria-hidden="true"
|
|
7
|
+
<ForwardRef(SvgIcon)
|
|
9
8
|
className="govgr-caret--down"
|
|
10
|
-
focusable="false"
|
|
11
|
-
viewBox="0 0 24 24"
|
|
12
9
|
>
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
<svg
|
|
11
|
+
aria-hidden="true"
|
|
12
|
+
className="govgr-svg-icon--dark govgr-svg-icon--m govgr-caret--down govgr-svg-icon"
|
|
13
|
+
focusable="false"
|
|
14
|
+
viewBox="0 0 24 24"
|
|
15
|
+
>
|
|
16
|
+
<path
|
|
17
|
+
d="M22,6H2l10,12L22,6z"
|
|
18
|
+
/>
|
|
19
|
+
</svg>
|
|
20
|
+
</ForwardRef(SvgIcon)>
|
|
17
21
|
</ForwardRef(CaretIcon)>
|
|
18
22
|
`;
|
|
19
23
|
|
|
@@ -21,16 +25,20 @@ exports[`renders the CaretIcon with direction right prop 1`] = `
|
|
|
21
25
|
<ForwardRef(CaretIcon)
|
|
22
26
|
direction="right"
|
|
23
27
|
>
|
|
24
|
-
<
|
|
25
|
-
aria-hidden="true"
|
|
28
|
+
<ForwardRef(SvgIcon)
|
|
26
29
|
className="govgr-caret--right"
|
|
27
|
-
focusable="false"
|
|
28
|
-
viewBox="0 0 24 24"
|
|
29
30
|
>
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
<svg
|
|
32
|
+
aria-hidden="true"
|
|
33
|
+
className="govgr-svg-icon--dark govgr-svg-icon--m govgr-caret--right govgr-svg-icon"
|
|
34
|
+
focusable="false"
|
|
35
|
+
viewBox="0 0 24 24"
|
|
36
|
+
>
|
|
37
|
+
<path
|
|
38
|
+
d="M6,2v20l12-10L6,2z"
|
|
39
|
+
/>
|
|
40
|
+
</svg>
|
|
41
|
+
</ForwardRef(SvgIcon)>
|
|
34
42
|
</ForwardRef(CaretIcon)>
|
|
35
43
|
`;
|
|
36
44
|
|
|
@@ -38,30 +46,38 @@ exports[`renders the CaretIcon with direction up prop 1`] = `
|
|
|
38
46
|
<ForwardRef(CaretIcon)
|
|
39
47
|
direction="up"
|
|
40
48
|
>
|
|
41
|
-
<
|
|
42
|
-
aria-hidden="true"
|
|
49
|
+
<ForwardRef(SvgIcon)
|
|
43
50
|
className="govgr-caret--up"
|
|
44
|
-
focusable="false"
|
|
45
|
-
viewBox="0 0 24 24"
|
|
46
51
|
>
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
<svg
|
|
53
|
+
aria-hidden="true"
|
|
54
|
+
className="govgr-svg-icon--dark govgr-svg-icon--m govgr-caret--up govgr-svg-icon"
|
|
55
|
+
focusable="false"
|
|
56
|
+
viewBox="0 0 24 24"
|
|
57
|
+
>
|
|
58
|
+
<path
|
|
59
|
+
d="M2,18h20L12,6L2,18z"
|
|
60
|
+
/>
|
|
61
|
+
</svg>
|
|
62
|
+
</ForwardRef(SvgIcon)>
|
|
51
63
|
</ForwardRef(CaretIcon)>
|
|
52
64
|
`;
|
|
53
65
|
|
|
54
66
|
exports[`renders the CaretIcon with no props, direction prop is left by default 1`] = `
|
|
55
67
|
<ForwardRef(CaretIcon)>
|
|
56
|
-
<
|
|
57
|
-
aria-hidden="true"
|
|
68
|
+
<ForwardRef(SvgIcon)
|
|
58
69
|
className="govgr-caret--left"
|
|
59
|
-
focusable="false"
|
|
60
|
-
viewBox="0 0 24 24"
|
|
61
70
|
>
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
71
|
+
<svg
|
|
72
|
+
aria-hidden="true"
|
|
73
|
+
className="govgr-svg-icon--dark govgr-svg-icon--m govgr-caret--left govgr-svg-icon"
|
|
74
|
+
focusable="false"
|
|
75
|
+
viewBox="0 0 24 24"
|
|
76
|
+
>
|
|
77
|
+
<path
|
|
78
|
+
d="M18,22V2L6,12L18,22z"
|
|
79
|
+
/>
|
|
80
|
+
</svg>
|
|
81
|
+
</ForwardRef(SvgIcon)>
|
|
66
82
|
</ForwardRef(CaretIcon)>
|
|
67
83
|
`;
|
package/CaretIcon/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export interface CaretIconProps extends
|
|
2
|
+
import { SvgIconProps } from '@digigov/react-core/SvgIcon';
|
|
3
|
+
export interface CaretIconProps extends SvgIconProps {
|
|
4
|
+
ref?: React.Ref<SVGSVGElement>;
|
|
4
5
|
/**
|
|
5
6
|
* direction is optional.
|
|
6
7
|
* direction prop declares the direction of the svg icon.
|
|
@@ -11,5 +12,5 @@ export interface CaretIconProps extends SVGElementAttributes {
|
|
|
11
12
|
* CaretIcon component is used to add caret icon.
|
|
12
13
|
* CaretIcon can be used inside other components, for example BackLink component.
|
|
13
14
|
*/
|
|
14
|
-
export declare const CaretIcon: React.
|
|
15
|
+
export declare const CaretIcon: React.FC<CaretIconProps>;
|
|
15
16
|
export default CaretIcon;
|
package/CaretIcon/index.js
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -11,19 +9,15 @@ exports["default"] = exports.CaretIcon = void 0;
|
|
|
11
9
|
|
|
12
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
11
|
|
|
14
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
|
-
|
|
16
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
17
13
|
|
|
18
|
-
var _react =
|
|
19
|
-
|
|
20
|
-
var _clsx = _interopRequireDefault(require("clsx"));
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
21
15
|
|
|
22
|
-
var
|
|
16
|
+
var _SvgIcon = _interopRequireDefault(require("@digigov/react-core/SvgIcon"));
|
|
23
17
|
|
|
24
|
-
|
|
18
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
25
19
|
|
|
26
|
-
|
|
20
|
+
var _excluded = ["size", "variant", "direction", "className"];
|
|
27
21
|
|
|
28
22
|
var _ref2 = /*#__PURE__*/_react["default"].createElement("path", {
|
|
29
23
|
d: "M18,22V2L6,12L18,22z"
|
|
@@ -46,26 +40,18 @@ var _ref5 = /*#__PURE__*/_react["default"].createElement("path", {
|
|
|
46
40
|
* CaretIcon can be used inside other components, for example BackLink component.
|
|
47
41
|
*/
|
|
48
42
|
var CaretIcon = /*#__PURE__*/_react["default"].forwardRef(function CaretIcon(_ref, ref) {
|
|
49
|
-
var
|
|
43
|
+
var size = _ref.size,
|
|
44
|
+
variant = _ref.variant,
|
|
45
|
+
_ref$direction = _ref.direction,
|
|
50
46
|
direction = _ref$direction === void 0 ? 'left' : _ref$direction,
|
|
51
47
|
className = _ref.className,
|
|
52
48
|
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
(0, _react.useEffect)(function () {
|
|
60
|
-
setDirection(direction);
|
|
61
|
-
}, [direction]);
|
|
62
|
-
return /*#__PURE__*/_react["default"].createElement("svg", (0, _extends2["default"])({
|
|
63
|
-
ref: ref,
|
|
64
|
-
className: (0, _clsx["default"])(caretDirection === 'right' && 'govgr-caret--right', caretDirection === 'left' && 'govgr-caret--left', caretDirection === 'down' && 'govgr-caret--down', caretDirection === 'up' && 'govgr-caret--up', className && className),
|
|
65
|
-
focusable: "false",
|
|
66
|
-
viewBox: "0 0 24 24",
|
|
67
|
-
"aria-hidden": "true"
|
|
68
|
-
}, props), caretDirection === 'left' && _ref2, caretDirection === 'right' && _ref3, caretDirection === 'up' && _ref4, caretDirection === 'down' && _ref5);
|
|
49
|
+
return /*#__PURE__*/_react["default"].createElement(_SvgIcon["default"], (0, _extends2["default"])({
|
|
50
|
+
size: size,
|
|
51
|
+
variant: variant,
|
|
52
|
+
className: (0, _clsx["default"])(direction === 'right' && 'govgr-caret--right', direction === 'left' && 'govgr-caret--left', direction === 'down' && 'govgr-caret--down', direction === 'up' && 'govgr-caret--up', className && className),
|
|
53
|
+
ref: ref
|
|
54
|
+
}, props), direction === 'left' && _ref2, direction === 'right' && _ref3, direction === 'up' && _ref4, direction === 'down' && _ref5);
|
|
69
55
|
});
|
|
70
56
|
|
|
71
57
|
exports.CaretIcon = CaretIcon;
|