dry-ux 1.70.0 → 1.72.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/dist/dajaxice/DajaxiceCall.js +1 -1
- package/dist/dajaxice/Proxy.interface.d.ts +4 -0
- package/dist/enhanced-inputs/interface.d.ts +15 -0
- package/dist/error/ErrorBoundary.stories.d.ts +5 -0
- package/dist/error/ErrorBoundary.stories.js +23 -0
- package/dist/error/ErrorScreen.stories.d.ts +4 -0
- package/dist/error/ErrorScreen.stories.js +12 -0
- package/dist/helpers/logger.d.ts +15 -0
- package/dist/helpers/logger.js +19 -0
- package/dist/provider.d.ts +13 -1
- package/dist/provider.js +6 -0
- package/dist/styles/helper.css +863 -0
- package/dist/ui-utils/ActionsOverlay.d.ts +10 -0
- package/dist/ui-utils/ActionsOverlay.js +24 -16
- package/dist/ui-utils/Modal.d.ts +33 -0
- package/dist/ui-utils/Modal.js +6 -0
- package/dist/ui-utils/Money.stories.d.ts +7 -0
- package/dist/ui-utils/Money.stories.js +34 -0
- package/dist/ui-utils/RenderWhenVisible.stories.d.ts +4 -0
- package/dist/ui-utils/RenderWhenVisible.stories.js +15 -0
- package/dist/ui-utils/Spinner.stories.d.ts +7 -0
- package/dist/ui-utils/Spinner.stories.js +11 -0
- package/dist/ui-utils/UIUtil.interface.d.ts +72 -10
- package/dist/ui-utils/UIUtilProvider.d.ts +80 -0
- package/dist/ui-utils/UIUtilProvider.js +65 -0
- package/dist/ui-utils/UIUtilRenderer.d.ts +12 -0
- package/dist/ui-utils/UIUtilRenderer.js +6 -0
- package/dist/ui-utils/ViewportDetect.d.ts +40 -0
- package/dist/ui-utils/ViewportDetect.js +47 -0
- package/package.json +21 -6
- package/README.md +0 -0
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { ModalProps } from "./Modal";
|
|
3
|
+
/**
|
|
4
|
+
* Props for the UIUtilRenderer component.
|
|
5
|
+
*/
|
|
3
6
|
export type UIUtilRendererProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Configuration for the modal.
|
|
9
|
+
*/
|
|
4
10
|
modalConfig?: ModalProps["config"];
|
|
5
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* UIUtilRenderer component that renders modals based on the UIUtil context.
|
|
14
|
+
*
|
|
15
|
+
* @param {UIUtilRendererProps} props - The props for the UIUtilRenderer component.
|
|
16
|
+
* @returns {JSX.Element} The UIUtilRenderer component.
|
|
17
|
+
*/
|
|
6
18
|
export declare const UIUtilRenderer: React.FC<UIUtilRendererProps>;
|
|
@@ -4,6 +4,12 @@ exports.UIUtilRenderer = void 0;
|
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const UIUtilProvider_1 = require("./UIUtilProvider");
|
|
6
6
|
const Modal_1 = require("./Modal");
|
|
7
|
+
/**
|
|
8
|
+
* UIUtilRenderer component that renders modals based on the UIUtil context.
|
|
9
|
+
*
|
|
10
|
+
* @param {UIUtilRendererProps} props - The props for the UIUtilRenderer component.
|
|
11
|
+
* @returns {JSX.Element} The UIUtilRenderer component.
|
|
12
|
+
*/
|
|
7
13
|
exports.UIUtilRenderer = React.memo(({ modalConfig = {} }) => {
|
|
8
14
|
const { modal: { instances }, } = (0, UIUtilProvider_1.useUIUtilContext)();
|
|
9
15
|
return (React.createElement(React.Fragment, null, Object.keys(instances).map(id => (React.createElement(Modal_1.default, { key: id, id: id, instance: instances[id], config: modalConfig })))));
|
|
@@ -1,20 +1,60 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import "../styles/viewport.css";
|
|
3
|
+
/**
|
|
4
|
+
* Enum representing different viewport sizes.
|
|
5
|
+
*/
|
|
3
6
|
export declare enum Viewport {
|
|
7
|
+
/** Extra small viewport size. (phones with smaller display) */
|
|
4
8
|
XS = "xs",
|
|
9
|
+
/** Small viewport size. (phones) */
|
|
5
10
|
SM = "sm",
|
|
11
|
+
/** Medium viewport size. (tablets) */
|
|
6
12
|
MD = "md",
|
|
13
|
+
/** Large viewport size. (desktops) */
|
|
7
14
|
LG = "lg"
|
|
8
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Class representing the current viewport.
|
|
18
|
+
*/
|
|
9
19
|
export declare class CurrentViewport {
|
|
10
20
|
private _current;
|
|
21
|
+
/**
|
|
22
|
+
* Creates an instance of CurrentViewport.
|
|
23
|
+
* @param {Viewport} _current - The current viewport size.
|
|
24
|
+
*/
|
|
11
25
|
constructor(_current: Viewport);
|
|
26
|
+
/**
|
|
27
|
+
* Checks if the current viewport is extra small.
|
|
28
|
+
* @returns {boolean} True if the current viewport is extra small, otherwise false.
|
|
29
|
+
*/
|
|
12
30
|
get isXS(): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Checks if the current viewport is small.
|
|
33
|
+
* @returns {boolean} True if the current viewport is small, otherwise false.
|
|
34
|
+
*/
|
|
13
35
|
get isSM(): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Checks if the current viewport is medium.
|
|
38
|
+
* @returns {boolean} True if the current viewport is medium, otherwise false.
|
|
39
|
+
*/
|
|
14
40
|
get isMD(): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Checks if the current viewport is large.
|
|
43
|
+
* @returns {boolean} True if the current viewport is large, otherwise false.
|
|
44
|
+
*/
|
|
15
45
|
get isLG(): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Gets the current viewport size.
|
|
48
|
+
* @returns {Viewport} The current viewport size.
|
|
49
|
+
*/
|
|
16
50
|
get current(): Viewport;
|
|
17
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Component that detects the current viewport and triggers a callback on change.
|
|
54
|
+
* @param {Object} props - The component props.
|
|
55
|
+
* @param {function(CurrentViewport): void} props.onChange - Callback function to handle viewport change.
|
|
56
|
+
* @returns {JSX.Element} The viewport detection component.
|
|
57
|
+
*/
|
|
18
58
|
export declare const ViewportDetect: React.FC<{
|
|
19
59
|
onChange: (current: CurrentViewport) => void;
|
|
20
60
|
}>;
|
|
@@ -4,34 +4,75 @@ exports.ViewportDetect = exports.CurrentViewport = exports.Viewport = void 0;
|
|
|
4
4
|
const React = require("react");
|
|
5
5
|
require("../styles/viewport.css");
|
|
6
6
|
const utilities_1 = require("../helpers/utilities");
|
|
7
|
+
/**
|
|
8
|
+
* Enum representing different viewport sizes.
|
|
9
|
+
*/
|
|
7
10
|
var Viewport;
|
|
8
11
|
(function (Viewport) {
|
|
12
|
+
/** Extra small viewport size. (phones with smaller display) */
|
|
9
13
|
Viewport["XS"] = "xs";
|
|
14
|
+
/** Small viewport size. (phones) */
|
|
10
15
|
Viewport["SM"] = "sm";
|
|
16
|
+
/** Medium viewport size. (tablets) */
|
|
11
17
|
Viewport["MD"] = "md";
|
|
18
|
+
/** Large viewport size. (desktops) */
|
|
12
19
|
Viewport["LG"] = "lg";
|
|
13
20
|
})(Viewport || (exports.Viewport = Viewport = {}));
|
|
21
|
+
/**
|
|
22
|
+
* Class representing the current viewport.
|
|
23
|
+
*/
|
|
14
24
|
class CurrentViewport {
|
|
25
|
+
/**
|
|
26
|
+
* Creates an instance of CurrentViewport.
|
|
27
|
+
* @param {Viewport} _current - The current viewport size.
|
|
28
|
+
*/
|
|
15
29
|
constructor(_current) {
|
|
16
30
|
this._current = _current;
|
|
17
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Checks if the current viewport is extra small.
|
|
34
|
+
* @returns {boolean} True if the current viewport is extra small, otherwise false.
|
|
35
|
+
*/
|
|
18
36
|
get isXS() {
|
|
19
37
|
return this._current === Viewport.XS;
|
|
20
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Checks if the current viewport is small.
|
|
41
|
+
* @returns {boolean} True if the current viewport is small, otherwise false.
|
|
42
|
+
*/
|
|
21
43
|
get isSM() {
|
|
22
44
|
return this._current === Viewport.SM;
|
|
23
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Checks if the current viewport is medium.
|
|
48
|
+
* @returns {boolean} True if the current viewport is medium, otherwise false.
|
|
49
|
+
*/
|
|
24
50
|
get isMD() {
|
|
25
51
|
return this._current === Viewport.MD;
|
|
26
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Checks if the current viewport is large.
|
|
55
|
+
* @returns {boolean} True if the current viewport is large, otherwise false.
|
|
56
|
+
*/
|
|
27
57
|
get isLG() {
|
|
28
58
|
return this._current === Viewport.LG;
|
|
29
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Gets the current viewport size.
|
|
62
|
+
* @returns {Viewport} The current viewport size.
|
|
63
|
+
*/
|
|
30
64
|
get current() {
|
|
31
65
|
return this._current;
|
|
32
66
|
}
|
|
33
67
|
}
|
|
34
68
|
exports.CurrentViewport = CurrentViewport;
|
|
69
|
+
/**
|
|
70
|
+
* Component that detects the visibility of a viewport element.
|
|
71
|
+
* @param {Object} props - The component props.
|
|
72
|
+
* @param {Viewport} props.viewport - The viewport size.
|
|
73
|
+
* @param {function(boolean): void} props.onVisibilityChange - Callback function to handle visibility change.
|
|
74
|
+
* @returns {JSX.Element} The detection element.
|
|
75
|
+
*/
|
|
35
76
|
const DetectionElement = ({ viewport, onVisibilityChange, }) => {
|
|
36
77
|
const ref = React.useRef(null);
|
|
37
78
|
const isVisible = (0, utilities_1.useIsVisible)(ref);
|
|
@@ -40,6 +81,12 @@ const DetectionElement = ({ viewport, onVisibilityChange, }) => {
|
|
|
40
81
|
}, [isVisible]);
|
|
41
82
|
return React.createElement("div", { ref: ref, className: `dry-visible-${viewport}` });
|
|
42
83
|
};
|
|
84
|
+
/**
|
|
85
|
+
* Component that detects the current viewport and triggers a callback on change.
|
|
86
|
+
* @param {Object} props - The component props.
|
|
87
|
+
* @param {function(CurrentViewport): void} props.onChange - Callback function to handle viewport change.
|
|
88
|
+
* @returns {JSX.Element} The viewport detection component.
|
|
89
|
+
*/
|
|
43
90
|
exports.ViewportDetect = React.memo(({ onChange }) => {
|
|
44
91
|
const onVisibilityChange = (viewport, isVisible) => {
|
|
45
92
|
if (isVisible) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dry-ux",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.72.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index",
|
|
6
6
|
"scripts": {
|
|
@@ -9,9 +9,12 @@
|
|
|
9
9
|
"watch": "rimraf dist/ && tsc --watch",
|
|
10
10
|
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.tsx\"",
|
|
11
11
|
"update:version": "npm version minor --no-git-tag-version",
|
|
12
|
-
"prepub:npm": "npm run format && npm run build && npm run update:version",
|
|
12
|
+
"prepub:npm": "npm run format && npm run build && npm run update:version && npm run docs",
|
|
13
13
|
"publish:npm": "npm run prepub:npm && npm publish",
|
|
14
|
-
"pack": "npm run build && npm pack --pack-destination pack/"
|
|
14
|
+
"pack": "npm run build && npm pack --pack-destination pack/",
|
|
15
|
+
"docs": "typedoc --options typedoc.json && cd test && npm run build:test && cp -r proddist ../htmldocs/demo",
|
|
16
|
+
"storybook": "storybook dev -p 6006",
|
|
17
|
+
"build-storybook": "storybook build"
|
|
15
18
|
},
|
|
16
19
|
"repository": {
|
|
17
20
|
"type": "git",
|
|
@@ -24,13 +27,25 @@
|
|
|
24
27
|
"author": "Naved Rangwala",
|
|
25
28
|
"license": "ISC",
|
|
26
29
|
"devDependencies": {
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
+
"@chromatic-com/storybook": "^3.2.6",
|
|
31
|
+
"@storybook/addon-essentials": "^8.6.11",
|
|
32
|
+
"@storybook/addon-interactions": "^8.6.11",
|
|
33
|
+
"@storybook/addon-onboarding": "^8.6.11",
|
|
34
|
+
"@storybook/addon-webpack5-compiler-swc": "^3.0.0",
|
|
35
|
+
"@storybook/blocks": "^8.6.11",
|
|
36
|
+
"@storybook/react": "^8.6.11",
|
|
37
|
+
"@storybook/react-webpack5": "^8.6.11",
|
|
38
|
+
"@storybook/test": "^8.6.11",
|
|
30
39
|
"@types/react": "^17.0.0",
|
|
31
40
|
"@types/react-bootstrap": "^0.32.25",
|
|
41
|
+
"copyfiles": "^2.4.1",
|
|
32
42
|
"prettier": "^2.2.1",
|
|
43
|
+
"react": "^16.8.2",
|
|
44
|
+
"react-dom": "^16.8.2",
|
|
33
45
|
"rimraf": "^3.0.2",
|
|
46
|
+
"storybook": "^8.6.11",
|
|
47
|
+
"typedoc": "^0.27.9",
|
|
48
|
+
"typedoc-plugin-markdown": "^4.4.2",
|
|
34
49
|
"typescript": "*"
|
|
35
50
|
},
|
|
36
51
|
"dependencies": {
|
package/README.md
DELETED
|
File without changes
|