@digigov/react-core 2.0.0-rc.7 → 2.0.0-rc.8
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/AdminAside/__snapshots__/index.test.tsx.snap +7 -3
- package/AdminAside/index.js +6 -2
- package/AdminContainer/__snapshots__/index.test.tsx.snap +35 -7
- package/AdminContainer/index.d.ts +8 -1
- package/AdminContainer/index.js +6 -7
- package/AdminContainer/index.test/index.js +6 -0
- package/AdminMain/__snapshots__/index.test.tsx.snap +6 -3
- package/AdminMain/index.js +7 -2
- package/AutoCompleteInput/__snapshots__/index.test.tsx.snap +14 -50
- package/AutoCompleteResultList/__snapshots__/index.test.tsx.snap +2 -38
- package/ModalContainer/index.d.ts +8 -1
- package/ModalContainer/index.js +8 -6
- package/ModalHeading/index.js +1 -2
- package/Skeleton/index.d.ts +48 -0
- package/Skeleton/index.js +35 -0
- package/Skeleton/package.json +6 -0
- package/SummaryList/index.d.ts +10 -1
- package/SummaryList/index.js +4 -2
- package/Unpurge/index.js +1 -1
- package/cjs/AdminAside/__snapshots__/index.test.tsx.snap +7 -3
- package/cjs/AdminAside/index.js +6 -2
- package/cjs/AdminContainer/__snapshots__/index.test.tsx.snap +35 -7
- package/cjs/AdminContainer/index.js +6 -7
- package/cjs/AdminContainer/index.test/index.js +6 -0
- package/cjs/AdminMain/__snapshots__/index.test.tsx.snap +6 -3
- package/cjs/AdminMain/index.js +7 -2
- package/cjs/AutoCompleteInput/__snapshots__/index.test.tsx.snap +14 -50
- package/cjs/AutoCompleteResultList/__snapshots__/index.test.tsx.snap +2 -38
- package/cjs/ModalContainer/index.js +8 -6
- package/cjs/ModalHeading/index.js +1 -2
- package/cjs/Skeleton/index.js +42 -0
- package/cjs/SummaryList/index.js +4 -2
- package/cjs/Unpurge/index.js +1 -1
- package/cjs/lazy/index.js +9 -0
- package/cjs/registry/index.js +2 -0
- package/index.js +1 -1
- package/lazy/index.js +7 -0
- package/lazy.d.ts +4 -3
- package/package.json +3 -3
- package/registry/index.js +2 -0
- package/registry.d.ts +1 -0
- package/src/AdminAside/__snapshots__/index.test.tsx.snap +7 -3
- package/src/AdminAside/index.tsx +6 -2
- package/src/AdminContainer/__snapshots__/index.test.tsx.snap +35 -7
- package/src/AdminContainer/index.test.tsx +3 -0
- package/src/AdminContainer/index.tsx +12 -11
- package/src/AdminMain/__snapshots__/index.test.tsx.snap +6 -3
- package/src/AdminMain/index.tsx +5 -2
- package/src/AutoCompleteInput/__snapshots__/index.test.tsx.snap +14 -50
- package/src/AutoCompleteResultList/__snapshots__/index.test.tsx.snap +2 -38
- package/src/ModalContainer/index.tsx +18 -14
- package/src/ModalHeading/index.tsx +2 -2
- package/src/Skeleton/index.tsx +99 -0
- package/src/SummaryList/index.tsx +12 -1
- package/src/Unpurge/index.tsx +9 -0
- package/src/lazy.js +1 -0
- package/src/registry.js +2 -0
|
@@ -4,15 +4,19 @@ exports[`renders the AdminAside with no prop 1`] = `
|
|
|
4
4
|
<ForwardRef(AdminAside)>
|
|
5
5
|
<ForwardRef(Grid)
|
|
6
6
|
as="aside"
|
|
7
|
-
className="ds-admin-
|
|
7
|
+
className="ds-admin-aside"
|
|
8
8
|
item={true}
|
|
9
|
+
lg={3}
|
|
10
|
+
md={4}
|
|
11
|
+
spacing={4}
|
|
12
|
+
xs={12}
|
|
9
13
|
>
|
|
10
14
|
<ForwardRef(Base)
|
|
11
15
|
as="aside"
|
|
12
|
-
className="ds-admin-
|
|
16
|
+
className="ds-admin-aside xs:ds-grid__col-span-12 md:ds-grid__col-span-4 lg:ds-grid__col-span-3"
|
|
13
17
|
>
|
|
14
18
|
<aside
|
|
15
|
-
className="ds-admin-
|
|
19
|
+
className="ds-admin-aside xs:ds-grid__col-span-12 md:ds-grid__col-span-4 lg:ds-grid__col-span-3"
|
|
16
20
|
>
|
|
17
21
|
hello
|
|
18
22
|
</aside>
|
package/AdminAside/index.js
CHANGED
|
@@ -13,9 +13,13 @@ export var AdminAside = /*#__PURE__*/React.forwardRef(function AdminAside(_ref,
|
|
|
13
13
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
14
14
|
return /*#__PURE__*/React.createElement(Grid, _extends({
|
|
15
15
|
as: "aside",
|
|
16
|
-
ref: ref,
|
|
17
16
|
item: true,
|
|
18
|
-
|
|
17
|
+
xs: 12,
|
|
18
|
+
md: 4,
|
|
19
|
+
lg: 3,
|
|
20
|
+
spacing: 4,
|
|
21
|
+
ref: ref,
|
|
22
|
+
className: clsx(className, true && 'ds-admin-aside')
|
|
19
23
|
}, props), children);
|
|
20
24
|
});
|
|
21
25
|
export default AdminAside;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`renders the AdminContainer with no
|
|
4
|
-
<ForwardRef(AdminContainer)
|
|
3
|
+
exports[`renders the AdminContainer with no grid 1`] = `
|
|
4
|
+
<ForwardRef(AdminContainer)
|
|
5
|
+
grid={false}
|
|
6
|
+
>
|
|
5
7
|
<ForwardRef(Container)
|
|
6
8
|
fullWidth={true}
|
|
7
9
|
grid={false}
|
|
@@ -17,11 +19,37 @@ exports[`renders the AdminContainer with no props 1`] = `
|
|
|
17
19
|
<div
|
|
18
20
|
className="ds-container--full-width ds-container"
|
|
19
21
|
>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
hello
|
|
23
|
+
</div>
|
|
24
|
+
</ForwardRef(Base)>
|
|
25
|
+
</ForwardRef(Grid)>
|
|
26
|
+
</ForwardRef(Container)>
|
|
27
|
+
</ForwardRef(AdminContainer)>
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
exports[`renders the AdminContainer with no props 1`] = `
|
|
31
|
+
<ForwardRef(AdminContainer)>
|
|
32
|
+
<ForwardRef(Container)
|
|
33
|
+
fullWidth={true}
|
|
34
|
+
grid={true}
|
|
35
|
+
>
|
|
36
|
+
<ForwardRef(Grid)
|
|
37
|
+
className="ds-container--full-width ds-container"
|
|
38
|
+
container={true}
|
|
39
|
+
spacing={
|
|
40
|
+
Object {
|
|
41
|
+
"sm": 12,
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
>
|
|
45
|
+
<ForwardRef(Base)
|
|
46
|
+
as="div"
|
|
47
|
+
className="ds-container--full-width ds-container ds-gap-sm-12 ds-grid"
|
|
48
|
+
>
|
|
49
|
+
<div
|
|
50
|
+
className="ds-container--full-width ds-container ds-gap-sm-12 ds-grid"
|
|
51
|
+
>
|
|
52
|
+
hello
|
|
25
53
|
</div>
|
|
26
54
|
</ForwardRef(Base)>
|
|
27
55
|
</ForwardRef(Grid)>
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ContainerProps } from '@digigov/react-core/Container';
|
|
3
3
|
export interface AdminContainerProps extends Omit<ContainerProps, 'grid'> {
|
|
4
|
+
/**
|
|
5
|
+
* grid is optional. Set to false if you don't need grid layout.
|
|
6
|
+
* @value true
|
|
7
|
+
* @value false
|
|
8
|
+
* @default true
|
|
9
|
+
*/
|
|
10
|
+
grid?: boolean;
|
|
4
11
|
}
|
|
5
12
|
/**
|
|
6
13
|
* AdminContainer is a wrapper for the content of the page
|
|
7
14
|
* Use AdminContainer inside AdminLayout component
|
|
8
15
|
*/
|
|
9
|
-
export declare const AdminContainer: React.ForwardRefExoticComponent<Pick<AdminContainerProps, "p" | "slot" | "style" | "title" | "as" | "className" | "color" | "id" | "lang" | "role" | "tabIndex" | "spacing" | "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" | "children" | "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" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "inline" | "margin" | "marginTop" | "marginBottom" | "marginLeft" | "marginRight" | "m" | "mt" | "mb" | "ml" | "mr" | "mx" | "my" | "padding" | "paddingTop" | "paddingBottom" | "paddingLeft" | "paddingRight" | "pt" | "pb" | "pl" | "pr" | "px" | "py" | "printHidden" | "printVisible" | "xsUpHidden" | "smUpHidden" | "mdUpHidden" | "lgUpHidden" | "xlUpHidden" | "xsHidden" | "smHidden" | "mdHidden" | "lgHidden" | "xlHidden" | "container" | "item" | "xs" | "sm" | "md" | "lg" | "xl" | "fullWidth"> & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export declare const AdminContainer: React.ForwardRefExoticComponent<Pick<AdminContainerProps, "p" | "slot" | "style" | "title" | "as" | "className" | "color" | "id" | "lang" | "role" | "tabIndex" | "spacing" | "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" | "children" | "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" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "inline" | "margin" | "marginTop" | "marginBottom" | "marginLeft" | "marginRight" | "m" | "mt" | "mb" | "ml" | "mr" | "mx" | "my" | "padding" | "paddingTop" | "paddingBottom" | "paddingLeft" | "paddingRight" | "pt" | "pb" | "pl" | "pr" | "px" | "py" | "printHidden" | "printVisible" | "xsUpHidden" | "smUpHidden" | "mdUpHidden" | "lgUpHidden" | "xlUpHidden" | "xsHidden" | "smHidden" | "mdHidden" | "lgHidden" | "xlHidden" | "grid" | "container" | "item" | "xs" | "sm" | "md" | "lg" | "xl" | "fullWidth"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
17
|
export default AdminContainer;
|
package/AdminContainer/index.js
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["className", "children"];
|
|
3
|
+
var _excluded = ["grid", "className", "children"];
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import clsx from 'clsx';
|
|
6
5
|
import Container from '@digigov/react-core/Container';
|
|
7
6
|
/**
|
|
8
7
|
* AdminContainer is a wrapper for the content of the page
|
|
9
8
|
* Use AdminContainer inside AdminLayout component
|
|
10
9
|
*/
|
|
11
10
|
export var AdminContainer = /*#__PURE__*/React.forwardRef(function AdminContainer(_ref, ref) {
|
|
12
|
-
var
|
|
11
|
+
var _ref$grid = _ref.grid,
|
|
12
|
+
grid = _ref$grid === void 0 ? true : _ref$grid,
|
|
13
|
+
className = _ref.className,
|
|
13
14
|
children = _ref.children,
|
|
14
15
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
15
16
|
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
16
17
|
ref: ref,
|
|
17
18
|
fullWidth: true,
|
|
18
|
-
grid:
|
|
19
|
+
grid: grid,
|
|
19
20
|
className: className
|
|
20
|
-
}, props),
|
|
21
|
-
className: clsx(true && 'ds-admin-main-wrapper')
|
|
22
|
-
}, children));
|
|
21
|
+
}, props), children);
|
|
23
22
|
});
|
|
24
23
|
export default AdminContainer;
|
|
@@ -4,4 +4,10 @@ import AdminContainer from '@digigov/react-core/AdminContainer';
|
|
|
4
4
|
var _ref = /*#__PURE__*/React.createElement(AdminContainer, null, "hello");
|
|
5
5
|
it('renders the AdminContainer with no props', function () {
|
|
6
6
|
expect(mount(_ref)).toMatchSnapshot();
|
|
7
|
+
});
|
|
8
|
+
var _ref2 = /*#__PURE__*/React.createElement(AdminContainer, {
|
|
9
|
+
grid: false
|
|
10
|
+
}, "hello");
|
|
11
|
+
it('renders the AdminContainer with no grid', function () {
|
|
12
|
+
expect(mount(_ref2)).toMatchSnapshot();
|
|
7
13
|
});
|
|
@@ -4,15 +4,18 @@ exports[`renders the AdminMain with no prop 1`] = `
|
|
|
4
4
|
<ForwardRef(AdminMain)>
|
|
5
5
|
<ForwardRef(Grid)
|
|
6
6
|
as="main"
|
|
7
|
-
className="ds-admin-main
|
|
7
|
+
className="ds-admin-main"
|
|
8
8
|
item={true}
|
|
9
|
+
lg={9}
|
|
10
|
+
md={8}
|
|
11
|
+
xs={12}
|
|
9
12
|
>
|
|
10
13
|
<ForwardRef(Base)
|
|
11
14
|
as="main"
|
|
12
|
-
className="ds-admin-main-
|
|
15
|
+
className="ds-admin-main xs:ds-grid__col-span-12 md:ds-grid__col-span-8 lg:ds-grid__col-span-9"
|
|
13
16
|
>
|
|
14
17
|
<main
|
|
15
|
-
className="ds-admin-main-
|
|
18
|
+
className="ds-admin-main xs:ds-grid__col-span-12 md:ds-grid__col-span-8 lg:ds-grid__col-span-9"
|
|
16
19
|
>
|
|
17
20
|
hello
|
|
18
21
|
</main>
|
package/AdminMain/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["className", "children"];
|
|
3
|
+
var _excluded = ["className", "children", "id"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import Grid from '@digigov/react-core/Grid';
|
|
@@ -10,12 +10,17 @@ import Grid from '@digigov/react-core/Grid';
|
|
|
10
10
|
export var AdminMain = /*#__PURE__*/React.forwardRef(function AdminMain(_ref, ref) {
|
|
11
11
|
var className = _ref.className,
|
|
12
12
|
children = _ref.children,
|
|
13
|
+
_ref$id = _ref.id,
|
|
14
|
+
id = _ref$id === void 0 ? 'main-content' : _ref$id,
|
|
13
15
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
14
16
|
return /*#__PURE__*/React.createElement(Grid, _extends({
|
|
15
17
|
item: true,
|
|
16
18
|
as: "main",
|
|
19
|
+
xs: 12,
|
|
20
|
+
md: 8,
|
|
21
|
+
lg: 9,
|
|
17
22
|
ref: ref,
|
|
18
|
-
className: clsx(className, true && 'ds-admin-main
|
|
23
|
+
className: clsx(className, true && 'ds-admin-main')
|
|
19
24
|
}, props), children);
|
|
20
25
|
});
|
|
21
26
|
export default AdminMain;
|
|
@@ -1,87 +1,51 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`renders the AutoCompleteInput with
|
|
4
|
-
<ForwardRef(AutoCompleteInput)>
|
|
5
|
-
<ForwardRef(Base)
|
|
6
|
-
as="input"
|
|
7
|
-
className="ds-autocomplete__input--default ds-autocomplete__input"
|
|
8
|
-
type="text"
|
|
9
|
-
>
|
|
10
|
-
<input
|
|
11
|
-
className="ds-autocomplete__input--default ds-autocomplete__input"
|
|
12
|
-
type="text"
|
|
13
|
-
/>
|
|
14
|
-
</ForwardRef(Base)>
|
|
15
|
-
</ForwardRef(AutoCompleteInput)>
|
|
16
|
-
`;
|
|
17
|
-
|
|
18
|
-
exports[`renders the AutoCompleteInput with showAllValues 1`] = `
|
|
19
|
-
<ForwardRef(AutoCompleteInput)
|
|
20
|
-
showAllValues={true}
|
|
21
|
-
>
|
|
22
|
-
<ForwardRef(Base)
|
|
23
|
-
as="input"
|
|
24
|
-
className="ds-autocomplete__input--show-all-values ds-autocomplete__input"
|
|
25
|
-
type="text"
|
|
26
|
-
>
|
|
27
|
-
<input
|
|
28
|
-
className="ds-autocomplete__input--show-all-values ds-autocomplete__input"
|
|
29
|
-
type="text"
|
|
30
|
-
/>
|
|
31
|
-
</ForwardRef(Base)>
|
|
32
|
-
</ForwardRef(AutoCompleteInput)>
|
|
33
|
-
`;
|
|
34
|
-
|
|
35
|
-
exports[`renders the AutoCompleteInput with showAllValues 2`] = `
|
|
3
|
+
exports[`renders the AutoCompleteInput with isFocused 1`] = `
|
|
36
4
|
<ForwardRef(AutoCompleteInput)
|
|
37
|
-
|
|
5
|
+
isFocused={true}
|
|
38
6
|
>
|
|
39
7
|
<ForwardRef(Base)
|
|
40
8
|
as="input"
|
|
41
|
-
className="ds-autocomplete__input--
|
|
9
|
+
className="ds-autocomplete__input--focused ds-autocomplete__input"
|
|
42
10
|
type="text"
|
|
43
11
|
>
|
|
44
12
|
<input
|
|
45
|
-
className="ds-autocomplete__input--
|
|
13
|
+
className="ds-autocomplete__input--focused ds-autocomplete__input"
|
|
46
14
|
type="text"
|
|
47
15
|
/>
|
|
48
16
|
</ForwardRef(Base)>
|
|
49
17
|
</ForwardRef(AutoCompleteInput)>
|
|
50
18
|
`;
|
|
51
19
|
|
|
52
|
-
exports[`renders the AutoCompleteInput with
|
|
20
|
+
exports[`renders the AutoCompleteInput with isFocused and name props 1`] = `
|
|
53
21
|
<ForwardRef(AutoCompleteInput)
|
|
54
22
|
isFocused={true}
|
|
55
|
-
|
|
23
|
+
name="some-name"
|
|
56
24
|
>
|
|
57
25
|
<ForwardRef(Base)
|
|
58
26
|
as="input"
|
|
59
|
-
className="ds-autocomplete__input--
|
|
27
|
+
className="ds-autocomplete__input--focused ds-autocomplete__input"
|
|
28
|
+
name="some-name"
|
|
60
29
|
type="text"
|
|
61
30
|
>
|
|
62
31
|
<input
|
|
63
|
-
className="ds-autocomplete__input--
|
|
32
|
+
className="ds-autocomplete__input--focused ds-autocomplete__input"
|
|
33
|
+
name="some-name"
|
|
64
34
|
type="text"
|
|
65
35
|
/>
|
|
66
36
|
</ForwardRef(Base)>
|
|
67
37
|
</ForwardRef(AutoCompleteInput)>
|
|
68
38
|
`;
|
|
69
39
|
|
|
70
|
-
exports[`renders the AutoCompleteInput with
|
|
71
|
-
<ForwardRef(AutoCompleteInput)
|
|
72
|
-
isFocused={true}
|
|
73
|
-
name="some-name"
|
|
74
|
-
showAllValues={true}
|
|
75
|
-
>
|
|
40
|
+
exports[`renders the AutoCompleteInput with no props 1`] = `
|
|
41
|
+
<ForwardRef(AutoCompleteInput)>
|
|
76
42
|
<ForwardRef(Base)
|
|
77
43
|
as="input"
|
|
78
|
-
className="ds-autocomplete__input
|
|
79
|
-
name="some-name"
|
|
44
|
+
className="ds-autocomplete__input"
|
|
80
45
|
type="text"
|
|
81
46
|
>
|
|
82
47
|
<input
|
|
83
|
-
className="ds-autocomplete__input
|
|
84
|
-
name="some-name"
|
|
48
|
+
className="ds-autocomplete__input"
|
|
85
49
|
type="text"
|
|
86
50
|
/>
|
|
87
51
|
</ForwardRef(Base)>
|
|
@@ -1,51 +1,15 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`renders the AutoCompleteResultList with isVisible displayMenu="inline props 1`] = `
|
|
4
|
-
<ForwardRef(List)
|
|
5
|
-
displayMenu="inline"
|
|
6
|
-
isVisible={true}
|
|
7
|
-
>
|
|
8
|
-
<ForwardRef(Base)
|
|
9
|
-
as="ul"
|
|
10
|
-
className="ds-autocomplete__menu--inline ds-autocomplete__menu--visible ds-autocomplete__menu"
|
|
11
|
-
>
|
|
12
|
-
<ul
|
|
13
|
-
className="ds-autocomplete__menu--inline ds-autocomplete__menu--visible ds-autocomplete__menu"
|
|
14
|
-
>
|
|
15
|
-
Hello
|
|
16
|
-
</ul>
|
|
17
|
-
</ForwardRef(Base)>
|
|
18
|
-
</ForwardRef(List)>
|
|
19
|
-
`;
|
|
20
|
-
|
|
21
|
-
exports[`renders the AutoCompleteResultList with isVisible displayMenu="overlay props 1`] = `
|
|
22
|
-
<ForwardRef(List)
|
|
23
|
-
displayMenu="overlay"
|
|
24
|
-
isVisible={true}
|
|
25
|
-
>
|
|
26
|
-
<ForwardRef(Base)
|
|
27
|
-
as="ul"
|
|
28
|
-
className="ds-autocomplete__menu--overlay ds-autocomplete__menu--visible ds-autocomplete__menu"
|
|
29
|
-
>
|
|
30
|
-
<ul
|
|
31
|
-
className="ds-autocomplete__menu--overlay ds-autocomplete__menu--visible ds-autocomplete__menu"
|
|
32
|
-
>
|
|
33
|
-
Hello
|
|
34
|
-
</ul>
|
|
35
|
-
</ForwardRef(Base)>
|
|
36
|
-
</ForwardRef(List)>
|
|
37
|
-
`;
|
|
38
|
-
|
|
39
3
|
exports[`renders the AutoCompleteResultList with isVisible props 1`] = `
|
|
40
4
|
<ForwardRef(List)
|
|
41
5
|
isVisible={true}
|
|
42
6
|
>
|
|
43
7
|
<ForwardRef(Base)
|
|
44
8
|
as="ul"
|
|
45
|
-
className="ds-autocomplete__menu
|
|
9
|
+
className="ds-autocomplete__menu"
|
|
46
10
|
>
|
|
47
11
|
<ul
|
|
48
|
-
className="ds-autocomplete__menu
|
|
12
|
+
className="ds-autocomplete__menu"
|
|
49
13
|
>
|
|
50
14
|
Hello
|
|
51
15
|
</ul>
|
|
@@ -13,6 +13,13 @@ export interface ModalContainerProps extends BaseProps<'div'> {
|
|
|
13
13
|
* @default false
|
|
14
14
|
*/
|
|
15
15
|
dense?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* gaps is optional.
|
|
18
|
+
* @value false there will be no extra gaps among children components.
|
|
19
|
+
* @value true
|
|
20
|
+
* @default true
|
|
21
|
+
*/
|
|
22
|
+
gaps?: boolean;
|
|
16
23
|
}
|
|
17
24
|
/**
|
|
18
25
|
* Modals can be used to open a pop-up dialog box and provide critical information
|
|
@@ -20,5 +27,5 @@ export interface ModalContainerProps extends BaseProps<'div'> {
|
|
|
20
27
|
* remain on screen until confirmed, dismissed, or a required action has been taken
|
|
21
28
|
* Use Modal as parent component to wrap ModalHeading, ModalText and ModalAction components
|
|
22
29
|
*/
|
|
23
|
-
export declare const ModalContainer: React.ForwardRefExoticComponent<Pick<ModalContainerProps, "p" | "slot" | "style" | "title" | "as" | "className" | "color" | "id" | "lang" | "role" | "tabIndex" | "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" | "children" | "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" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "open" | "margin" | "marginTop" | "marginBottom" | "marginLeft" | "marginRight" | "m" | "mt" | "mb" | "ml" | "mr" | "mx" | "my" | "padding" | "paddingTop" | "paddingBottom" | "paddingLeft" | "paddingRight" | "pt" | "pb" | "pl" | "pr" | "px" | "py" | "printHidden" | "printVisible" | "xsUpHidden" | "smUpHidden" | "mdUpHidden" | "lgUpHidden" | "xlUpHidden" | "xsHidden" | "smHidden" | "mdHidden" | "lgHidden" | "xlHidden" | "dense"> & React.RefAttributes<HTMLDivElement>>;
|
|
30
|
+
export declare const ModalContainer: React.ForwardRefExoticComponent<Pick<ModalContainerProps, "p" | "slot" | "style" | "title" | "as" | "className" | "color" | "id" | "lang" | "role" | "tabIndex" | "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" | "children" | "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" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "open" | "margin" | "marginTop" | "marginBottom" | "marginLeft" | "marginRight" | "m" | "mt" | "mb" | "ml" | "mr" | "mx" | "my" | "padding" | "paddingTop" | "paddingBottom" | "paddingLeft" | "paddingRight" | "pt" | "pb" | "pl" | "pr" | "px" | "py" | "printHidden" | "printVisible" | "xsUpHidden" | "smUpHidden" | "mdUpHidden" | "lgUpHidden" | "xlUpHidden" | "xsHidden" | "smHidden" | "mdHidden" | "lgHidden" | "xlHidden" | "dense" | "gaps"> & React.RefAttributes<HTMLDivElement>>;
|
|
24
31
|
export default ModalContainer;
|
package/ModalContainer/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["className", "children", "open", "dense"];
|
|
3
|
+
var _excluded = ["className", "gaps", "children", "open", "dense"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import Base from '@digigov/react-core/Base';
|
|
@@ -12,18 +12,20 @@ import Base from '@digigov/react-core/Base';
|
|
|
12
12
|
*/
|
|
13
13
|
export var ModalContainer = /*#__PURE__*/React.forwardRef(function ModalContainer(_ref, ref) {
|
|
14
14
|
var className = _ref.className,
|
|
15
|
+
_ref$gaps = _ref.gaps,
|
|
16
|
+
gaps = _ref$gaps === void 0 ? true : _ref$gaps,
|
|
15
17
|
children = _ref.children,
|
|
16
18
|
open = _ref.open,
|
|
17
19
|
dense = _ref.dense,
|
|
18
20
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
21
|
return /*#__PURE__*/React.createElement(Base, _extends({
|
|
22
|
+
ref: ref,
|
|
20
23
|
as: "div",
|
|
21
24
|
className: clsx(className, dense && 'ds-modal--dense', true && 'ds-modal', open && 'ds-modal--open')
|
|
22
25
|
}, props), /*#__PURE__*/React.createElement("div", {
|
|
23
|
-
className:
|
|
24
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}, children)));
|
|
26
|
+
className: "ds-modal__body"
|
|
27
|
+
}, gaps ? /*#__PURE__*/React.createElement("div", {
|
|
28
|
+
className: "ds-modal__container"
|
|
29
|
+
}, children) : children));
|
|
28
30
|
});
|
|
29
31
|
export default ModalContainer;
|
package/ModalHeading/index.js
CHANGED
|
@@ -14,8 +14,7 @@ export var ModalHeading = /*#__PURE__*/React.forwardRef(function ModalHeading(_r
|
|
|
14
14
|
return /*#__PURE__*/React.createElement(Heading, _extends({
|
|
15
15
|
ref: ref,
|
|
16
16
|
size: "md",
|
|
17
|
-
element: "h2"
|
|
18
|
-
marginBottom: 0
|
|
17
|
+
element: "h2"
|
|
19
18
|
}, props), children);
|
|
20
19
|
});
|
|
21
20
|
export default ModalHeading;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BaseProps } from '@digigov/react-core/Base';
|
|
3
|
+
export interface SkeletonProps extends BaseProps<'span'> {
|
|
4
|
+
/**
|
|
5
|
+
* variant prop determines the style of the skeleton element.
|
|
6
|
+
* @value 'circular', it renders a circular skeleton.
|
|
7
|
+
* @value 'rectangular', it renders a rectangular skeleton.
|
|
8
|
+
* @value 'text', it renders a text skeleton.
|
|
9
|
+
* @value 'button', it renders a button skeleton.
|
|
10
|
+
* @default 'text'
|
|
11
|
+
*/
|
|
12
|
+
variant?: 'circular' | 'rectangular' | 'text' | 'button';
|
|
13
|
+
/**
|
|
14
|
+
* width prop determines the width of the skeleton element.
|
|
15
|
+
* It accepts number in px or string with valid CSS units (e.g. '24px', '1em', '100%').
|
|
16
|
+
* @default undefined
|
|
17
|
+
*/
|
|
18
|
+
width?: number | string;
|
|
19
|
+
/**
|
|
20
|
+
* height prop determines the height of the skeleton element.
|
|
21
|
+
* It accepts number in px or string with valid CSS units (e.g. '24px', '1em', '100%').
|
|
22
|
+
* @default undefined
|
|
23
|
+
*/
|
|
24
|
+
height?: number | string;
|
|
25
|
+
/**
|
|
26
|
+
* fontSize is optional. 'sm' is the default value.
|
|
27
|
+
* Use 'xl' when this Skeleton is for a main page title.
|
|
28
|
+
* The fontSize works only for variant 'text'.
|
|
29
|
+
* You don't need fontSize if you wrap Skeleton in a typography component.
|
|
30
|
+
* @value 'xl'
|
|
31
|
+
* @value 'lg'
|
|
32
|
+
* @value 'md'
|
|
33
|
+
* @value 'sm'
|
|
34
|
+
* @value 'xs'
|
|
35
|
+
* @default 'sm'
|
|
36
|
+
*/
|
|
37
|
+
fontSize?: 'xl' | 'lg' | 'md' | 'sm' | 'xs';
|
|
38
|
+
/**
|
|
39
|
+
* animation prop determines if the skeleton should animate or not.
|
|
40
|
+
* @default true
|
|
41
|
+
*/
|
|
42
|
+
animation?: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Use Skeleton component while a page is loading.
|
|
46
|
+
*/
|
|
47
|
+
export declare const Skeleton: React.ForwardRefExoticComponent<Pick<SkeletonProps, "p" | "slot" | "style" | "title" | "as" | "className" | "color" | "height" | "id" | "lang" | "width" | "role" | "tabIndex" | "fontSize" | "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" | "children" | "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" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "placeholder" | "spellCheck" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "margin" | "marginTop" | "marginBottom" | "marginLeft" | "marginRight" | "m" | "mt" | "mb" | "ml" | "mr" | "mx" | "my" | "padding" | "paddingTop" | "paddingBottom" | "paddingLeft" | "paddingRight" | "pt" | "pb" | "pl" | "pr" | "px" | "py" | "printHidden" | "printVisible" | "xsUpHidden" | "smUpHidden" | "mdUpHidden" | "lgUpHidden" | "xlUpHidden" | "xsHidden" | "smHidden" | "mdHidden" | "lgHidden" | "xlHidden" | "variant" | "animation"> & React.RefAttributes<HTMLSpanElement>>;
|
|
48
|
+
export default Skeleton;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["width", "height", "fontSize", "variant", "animation", "className", "children"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import clsx from 'clsx';
|
|
6
|
+
import Base from '@digigov/react-core/Base';
|
|
7
|
+
/**
|
|
8
|
+
* Use Skeleton component while a page is loading.
|
|
9
|
+
*/
|
|
10
|
+
export var Skeleton = /*#__PURE__*/React.forwardRef(function Skeleton(_ref, ref) {
|
|
11
|
+
var width = _ref.width,
|
|
12
|
+
height = _ref.height,
|
|
13
|
+
fontSize = _ref.fontSize,
|
|
14
|
+
_ref$variant = _ref.variant,
|
|
15
|
+
variant = _ref$variant === void 0 ? 'text' : _ref$variant,
|
|
16
|
+
_ref$animation = _ref.animation,
|
|
17
|
+
animation = _ref$animation === void 0 ? true : _ref$animation,
|
|
18
|
+
className = _ref.className,
|
|
19
|
+
children = _ref.children,
|
|
20
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
+
return /*#__PURE__*/React.createElement(Base, _extends({
|
|
22
|
+
as: "span",
|
|
23
|
+
ref: ref,
|
|
24
|
+
className: clsx(className, fontSize !== undefined && variant === 'text' && "ds-skeleton--font-".concat(fontSize), !!animation && 'ds-skeleton--animate', !!children && !width && 'ds-skeleton--width-fit-content', !!variant && !children && "ds-skeleton--".concat(variant), true && 'ds-skeleton')
|
|
25
|
+
}, props, {
|
|
26
|
+
style: {
|
|
27
|
+
width: typeof width === 'number' ? "".concat(width, "px") : width,
|
|
28
|
+
maxWidth: !!width ? '100%' : undefined,
|
|
29
|
+
height: typeof height === 'number' ? "".concat(height, "px") : height
|
|
30
|
+
}
|
|
31
|
+
}), variant === 'button' && /*#__PURE__*/React.createElement("span", {
|
|
32
|
+
className: clsx(height === undefined && width === undefined && 'ds-skeleton__line--size-default', true && 'ds-skeleton__line')
|
|
33
|
+
}), children);
|
|
34
|
+
});
|
|
35
|
+
export default Skeleton;
|