@dynamic-framework/ui-react 2.0.0-dev.22 → 2.0.0-dev.23
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/css/dynamic-ui-non-root.css +13220 -1
- package/dist/css/dynamic-ui-non-root.min.css +2 -2
- package/dist/css/dynamic-ui-root.css +1 -1
- package/dist/css/dynamic-ui-root.min.css +1 -1
- package/dist/css/dynamic-ui.css +13220 -1
- package/dist/css/dynamic-ui.min.css +2 -2
- package/dist/index.esm.js +66 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +74 -1
- package/dist/index.js.map +1 -1
- package/dist/types/components/DCreditCard/DCreditCard.d.ts +2 -1
- package/dist/types/components/DDataStateWrapper/DDataStateWrapper.d.ts +14 -0
- package/dist/types/components/DDataStateWrapper/components/EmptyState.d.ts +8 -0
- package/dist/types/components/DDataStateWrapper/components/ErrorState.d.ts +8 -0
- package/dist/types/components/DDataStateWrapper/components/LoadingState.d.ts +6 -0
- package/dist/types/components/DDataStateWrapper/index.d.ts +2 -0
- package/dist/types/components/DErrorBoundary/DErrorBoundary.d.ts +11 -0
- package/dist/types/components/DErrorBoundary/components/DefaultErrorBoundary.d.ts +6 -0
- package/dist/types/components/DErrorBoundary/index.d.ts +3 -0
- package/dist/types/components/index.d.ts +2 -0
- package/package.json +2 -1
- package/src/style/abstracts/_utilities-dark.scss +72 -0
- package/src/style/dynamic-ui-non-root.scss +2 -0
- package/src/style/dynamic-ui.scss +1 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
type Renderable = ReactNode | (() => ReactNode);
|
|
3
|
+
type DDataStateWrapperProps<T> = {
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
isError: boolean;
|
|
6
|
+
data: T[] | undefined;
|
|
7
|
+
onRetry?: () => void;
|
|
8
|
+
renderLoading?: Renderable;
|
|
9
|
+
renderEmpty?: Renderable;
|
|
10
|
+
renderError?: Renderable;
|
|
11
|
+
children: (data: T[]) => ReactNode;
|
|
12
|
+
};
|
|
13
|
+
export default function DDataStateWrapper<T>({ isLoading, isError, data, onRetry, renderLoading, renderEmpty, renderError, children, }: DDataStateWrapperProps<T>): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface EmptyStateProps {
|
|
2
|
+
message?: string;
|
|
3
|
+
icon?: string;
|
|
4
|
+
actionText?: string;
|
|
5
|
+
onAction?: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function EmptyState({ message, icon, actionText, onAction, }: EmptyStateProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type ErrorStateProps = {
|
|
2
|
+
message?: string;
|
|
3
|
+
onRetry?: () => void;
|
|
4
|
+
retryMessage?: string;
|
|
5
|
+
color?: 'danger' | 'warning';
|
|
6
|
+
};
|
|
7
|
+
export declare function ErrorState({ message, onRetry, retryMessage, color, }: ErrorStateProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type PropsWithChildren, type ReactNode, type ErrorInfo } from 'react';
|
|
2
|
+
import { FallbackProps, useErrorBoundary, getErrorMessage } from 'react-error-boundary';
|
|
3
|
+
export { type FallbackProps, useErrorBoundary, getErrorMessage, };
|
|
4
|
+
export type DErrorBoundaryProps = PropsWithChildren<{
|
|
5
|
+
name?: string;
|
|
6
|
+
fallback?: (props: FallbackProps) => ReactNode;
|
|
7
|
+
resetKeys?: unknown[];
|
|
8
|
+
onReset?: () => void;
|
|
9
|
+
onError?: (error: unknown, info: ErrorInfo) => void;
|
|
10
|
+
}>;
|
|
11
|
+
export default function DErrorBoundary({ name, fallback, resetKeys, onReset, onError, children, }: DErrorBoundaryProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -48,3 +48,5 @@ export { default as DCreditCard } from './DCreditCard';
|
|
|
48
48
|
export { default as DDropdown } from './DDropdown';
|
|
49
49
|
export { default as DVoucher } from './DVoucher';
|
|
50
50
|
export { default as DOtp } from './DOtp';
|
|
51
|
+
export { default as DErrorBoundary, useErrorBoundary, type FallbackProps, getErrorMessage, } from './DErrorBoundary';
|
|
52
|
+
export { default as DDataStateWrapper } from './DDataStateWrapper';
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"sideEffects": [
|
|
4
4
|
"*.css"
|
|
5
5
|
],
|
|
6
|
-
"version": "2.0.0-dev.
|
|
6
|
+
"version": "2.0.0-dev.23",
|
|
7
7
|
"description": "React Dynamic Framework",
|
|
8
8
|
"license": "https://github.com/dynamic-framework/dynamic-ui/blob/master/LICENSE.md",
|
|
9
9
|
"repository": {
|
|
@@ -103,6 +103,7 @@
|
|
|
103
103
|
"jspdf": "^4.0.0",
|
|
104
104
|
"lucide-react": "^0.553.0",
|
|
105
105
|
"react-datepicker": "~8.3.0",
|
|
106
|
+
"react-error-boundary": "^6.1.0",
|
|
106
107
|
"react-international-phone": "~4.6.0",
|
|
107
108
|
"react-responsive-pagination": "~2.11.3",
|
|
108
109
|
"react-select": "~5.10.2"
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
@mixin generate-dark-utility($utility) {
|
|
2
|
+
$values: map-get($utility, values);
|
|
3
|
+
|
|
4
|
+
@if type-of($values) == "string" or type-of(nth($values, 1)) != "list" {
|
|
5
|
+
$values: zip($values, $values);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@each $key, $value in $values {
|
|
9
|
+
$properties: map-get($utility, property);
|
|
10
|
+
|
|
11
|
+
@if type-of($properties) == "string" {
|
|
12
|
+
$properties: append((), $properties);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
$property-class: if(map-has-key($utility, class), map-get($utility, class), nth($properties, 1));
|
|
16
|
+
$property-class: if($property-class == null, "", $property-class);
|
|
17
|
+
$css-variable-name: if(map-has-key($utility, css-variable-name), map-get($utility, css-variable-name), map-get($utility, class));
|
|
18
|
+
$property-class-modifier: if($key, if($property-class == "", "", "-") + $key, "");
|
|
19
|
+
|
|
20
|
+
$is-css-var: map-get($utility, css-var);
|
|
21
|
+
$is-local-vars: map-get($utility, local-vars);
|
|
22
|
+
|
|
23
|
+
@if $value != null {
|
|
24
|
+
$escaped-prefix: "dark\\:";
|
|
25
|
+
$selector: ".#{$escaped-prefix}#{$property-class}#{$property-class-modifier}";
|
|
26
|
+
|
|
27
|
+
@if $is-css-var {
|
|
28
|
+
@media (prefers-color-scheme: dark) {
|
|
29
|
+
#{$selector} {
|
|
30
|
+
--#{$prefix}#{$css-variable-name}: #{$value};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
.dark #{$selector} {
|
|
34
|
+
--#{$prefix}#{$css-variable-name}: #{$value};
|
|
35
|
+
}
|
|
36
|
+
} @else {
|
|
37
|
+
@media (prefers-color-scheme: dark) {
|
|
38
|
+
#{$selector} {
|
|
39
|
+
@each $property in $properties {
|
|
40
|
+
@if $is-local-vars {
|
|
41
|
+
@each $local-var, $variable in $is-local-vars {
|
|
42
|
+
--#{$prefix}#{$local-var}: #{$variable};
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
#{$property}: $value if($enable-important-utilities, !important, null);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
.dark #{$selector} {
|
|
50
|
+
@each $property in $properties {
|
|
51
|
+
@if $is-local-vars {
|
|
52
|
+
@each $local-var, $variable in $is-local-vars {
|
|
53
|
+
--#{$prefix}#{$local-var}: #{$variable};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
#{$property}: $value if($enable-important-utilities, !important, null);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@mixin generate-dark-utilities($utilities-map) {
|
|
65
|
+
@each $name, $utility in $utilities-map {
|
|
66
|
+
@if map-has-key($utility, values) and map-has-key($utility, property) {
|
|
67
|
+
@include generate-dark-utility($utility);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@include generate-dark-utilities($utilities);
|