@dynamic-framework/ui-react 2.4.0 → 2.5.1
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.css +14168 -7314
- package/dist/css/dynamic-ui.min.css +2 -2
- package/dist/index.esm.js +89 -25
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +88 -25
- package/dist/index.js.map +1 -1
- package/dist/types/components/DDropdown/DDropdown.d.ts +2 -1
- package/dist/types/components/DLayout/DLayout.d.ts +8 -9
- package/dist/types/components/DLayout/index.d.ts +1 -0
- package/dist/types/components/DToastContainer/DToastContainer.d.ts +39 -2
- package/dist/types/components/DToastContainer/index.d.ts +2 -0
- package/dist/types/components/DToastContainer/useDToast.d.ts +38 -5
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/interface.d.ts +1 -1
- package/dist/types/contexts/DContext.d.ts +67 -9
- package/dist/types/contexts/DPortalContext.d.ts +66 -8
- package/dist/types/contexts/index.d.ts +1 -1
- package/dist/types/hooks/index.d.ts +0 -1
- package/dist/types/hooks/usePortal.d.ts +6 -0
- package/package.json +4 -3
- package/src/style/abstracts/_mixins.scss +46 -0
- package/src/style/abstracts/_utilities.scss +1 -1
- package/src/style/abstracts/variables/_dropdowns.scss +18 -8
- package/src/style/base/_buttons.scss +4 -0
- package/src/style/base/_dropdown.scss +5 -16
- package/src/style/base/_toast.scss +18 -16
- package/src/style/root/_root.scss +26 -0
|
@@ -15,6 +15,7 @@ type Props = {
|
|
|
15
15
|
toggle: () => void;
|
|
16
16
|
}) => React.ReactNode);
|
|
17
17
|
className?: string;
|
|
18
|
+
classNameMenu?: string;
|
|
18
19
|
};
|
|
19
|
-
export default function DDropdown({ actions, dropdownToggle, className, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export default function DDropdown({ actions, dropdownToggle, className, classNameMenu, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
20
21
|
export {};
|
|
@@ -2,17 +2,16 @@ import type { PropsWithChildren } from 'react';
|
|
|
2
2
|
import DLayoutPane from './components/DLayoutPane';
|
|
3
3
|
import type { BaseProps } from '../interface';
|
|
4
4
|
/**
|
|
5
|
-
* Define the spacing (gap) on a scale from 0 to 30.
|
|
6
|
-
* @type {number}
|
|
5
|
+
* Define the spacing (gap) on a scale from 0 to 30 (Bootstrap gap utilities).
|
|
7
6
|
*/
|
|
8
|
-
type
|
|
7
|
+
export type DLayoutGap = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30;
|
|
9
8
|
type Props = PropsWithChildren<BaseProps & {
|
|
10
|
-
gap?:
|
|
11
|
-
gapSm?:
|
|
12
|
-
gapMd?:
|
|
13
|
-
gapLg?:
|
|
14
|
-
gapXl?:
|
|
15
|
-
gapXxl?:
|
|
9
|
+
gap?: DLayoutGap;
|
|
10
|
+
gapSm?: DLayoutGap;
|
|
11
|
+
gapMd?: DLayoutGap;
|
|
12
|
+
gapLg?: DLayoutGap;
|
|
13
|
+
gapXl?: DLayoutGap;
|
|
14
|
+
gapXxl?: DLayoutGap;
|
|
16
15
|
columns?: number;
|
|
17
16
|
}>;
|
|
18
17
|
declare function DLayout({ className, style, children, gap, columns, gapSm, gapMd, gapLg, gapXl, gapXxl, dataAttributes, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { DefaultToastOptions, ToastPosition } from 'react-hot-toast';
|
|
3
|
+
/**
|
|
4
|
+
* Props for `DToastContainer`. This component must be placed once near the root
|
|
5
|
+
* of your application (typically inside `DContextProvider`) so that toasts
|
|
6
|
+
* dispatched via `useDToast` have a render target.
|
|
7
|
+
*/
|
|
8
|
+
export type DToastContainerProps = {
|
|
9
|
+
/**
|
|
10
|
+
* Additional CSS class applied to the portal container `<div>`.
|
|
11
|
+
* Useful for scoping z-index or stacking context in your layout.
|
|
12
|
+
*/
|
|
13
|
+
containerClassName?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Default position for toasts that do not specify their own `position`.
|
|
16
|
+
* @default 'bottom-center'
|
|
17
|
+
*/
|
|
18
|
+
position?: ToastPosition;
|
|
19
|
+
/**
|
|
20
|
+
* When `true`, new toasts appear at the bottom of the stack instead of the top.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
reverseOrder?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Inline styles applied to the portal container `<div>`.
|
|
26
|
+
*/
|
|
27
|
+
containerStyle?: CSSProperties;
|
|
28
|
+
/**
|
|
29
|
+
* Default options merged into every toast rendered inside this container.
|
|
30
|
+
* Mirrors `DefaultToastOptions` from `react-hot-toast`.
|
|
31
|
+
*/
|
|
32
|
+
toastOptions?: DefaultToastOptions;
|
|
33
|
+
/**
|
|
34
|
+
* Gap in pixels between stacked toasts.
|
|
35
|
+
* @default 8
|
|
36
|
+
*/
|
|
37
|
+
gutter?: number;
|
|
38
|
+
};
|
|
39
|
+
export default function DToastContainer({ containerClassName, position, reverseOrder, containerStyle, toastOptions, gutter, }: DToastContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,15 +1,48 @@
|
|
|
1
|
-
import { Renderable, Toast, ValueFunction } from 'react-hot-toast';
|
|
1
|
+
import { Renderable, Toast, ToastPosition, ValueFunction } from 'react-hot-toast';
|
|
2
2
|
import { ComponentStateColor } from '../interface';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Data used to render the default DToast component via `useDToast`.
|
|
5
|
+
* When `description` is provided, the toast renders with a header and body layout.
|
|
6
|
+
* When omitted, a compact single-row body layout is used instead.
|
|
7
|
+
*/
|
|
8
|
+
export type ToastData = {
|
|
9
|
+
/** Main text displayed in the toast. */
|
|
4
10
|
title: string;
|
|
11
|
+
/** Optional secondary text. When present, activates the header + body layout. */
|
|
5
12
|
description?: string;
|
|
13
|
+
/** Timestamp string shown in the header (e.g. "just now").
|
|
14
|
+
* Only visible when `description` is set. */
|
|
6
15
|
timestamp?: string;
|
|
16
|
+
/** Icon name from the active icon set in `DContextProvider`. Shown before the title. */
|
|
7
17
|
icon?: string;
|
|
18
|
+
/** Overrides the default close icon from the context icon map. */
|
|
8
19
|
closeIcon?: string;
|
|
20
|
+
/** Applies the `toast-{color}` CSS modifier class. */
|
|
9
21
|
color?: ComponentStateColor;
|
|
10
22
|
};
|
|
11
|
-
|
|
23
|
+
/** Options forwarded to react-hot-toast for a single toast instance. */
|
|
24
|
+
export interface DToastOptions {
|
|
25
|
+
/** Stable id; reusing it updates the existing toast in place. */
|
|
26
|
+
id?: string;
|
|
27
|
+
/** Auto-dismiss delay in milliseconds. */
|
|
28
|
+
duration?: number;
|
|
29
|
+
/** Overrides the container default position for this individual toast. */
|
|
30
|
+
position?: ToastPosition;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Hook that provides a `toast` function to dispatch DToast notifications.
|
|
34
|
+
*
|
|
35
|
+
* Prerequisites:
|
|
36
|
+
* - The calling component must be inside `DContextProvider` (provides icon context).
|
|
37
|
+
* - `DToastContainer` must be present somewhere in the component tree as a render target.
|
|
38
|
+
*
|
|
39
|
+
* @returns {{ toast }} Object containing a `toast` dispatcher function.
|
|
40
|
+
* @requires DContextProvider
|
|
41
|
+
* @requires DToastContainer
|
|
42
|
+
* @example
|
|
43
|
+
* const { toast } = useDToast();
|
|
44
|
+
* toast({ title: 'Saved', color: 'success' });
|
|
45
|
+
*/
|
|
12
46
|
export default function useDToast(): {
|
|
13
|
-
toast: (data: ToastData | ValueFunction<Renderable, Toast>, toastProps?:
|
|
47
|
+
toast: (data: ToastData | ValueFunction<Renderable, Toast>, toastProps?: DToastOptions) => string;
|
|
14
48
|
};
|
|
15
|
-
export {};
|
|
@@ -13,6 +13,7 @@ export { default as DCurrencyText } from './DCurrencyText';
|
|
|
13
13
|
export { default as DDatePicker } from './DDatePicker';
|
|
14
14
|
export { default as DIcon } from './DIcon';
|
|
15
15
|
export { default as DLayout, DLayoutPane, } from './DLayout';
|
|
16
|
+
export type { DLayoutGap } from './DLayout';
|
|
16
17
|
export { default as DIconBase } from './DIconBase';
|
|
17
18
|
export { default as DInput } from './DInput';
|
|
18
19
|
export { default as DInputMask } from './DInputMask';
|
|
@@ -43,6 +44,7 @@ export { default as DTabs, useTabContext, DTabContent, } from './DTabs';
|
|
|
43
44
|
export type { DTabOption } from './DTabs';
|
|
44
45
|
export { default as DToast } from './DToast';
|
|
45
46
|
export { default as DToastContainer, useDToast, } from './DToastContainer';
|
|
47
|
+
export type { DToastContainerProps, DToastOptions, ToastData } from './DToastContainer';
|
|
46
48
|
export { default as DInputPhone } from './DInputPhone';
|
|
47
49
|
export { default as DCreditCard } from './DCreditCard';
|
|
48
50
|
export { default as DDropdown } from './DDropdown';
|
|
@@ -47,7 +47,7 @@ export type ComponentStateColor = 'success' | 'danger' | 'warning' | 'info';
|
|
|
47
47
|
export type AlertThemeIconMap = {
|
|
48
48
|
[state in ComponentStateColor]: string;
|
|
49
49
|
};
|
|
50
|
-
export type ButtonVariant = 'outline' | 'link';
|
|
50
|
+
export type ButtonVariant = 'outline' | 'link' | 'soft';
|
|
51
51
|
export type ButtonType = 'submit' | 'reset' | 'button';
|
|
52
52
|
export type InputCheckType = 'checkbox' | 'radio';
|
|
53
53
|
export type PinInputMode = 'numeric' | 'text' | 'tel';
|
|
@@ -1,55 +1,113 @@
|
|
|
1
1
|
import type { PropsWithChildren } from 'react';
|
|
2
2
|
import { PortalContextProps } from './DPortalContext';
|
|
3
3
|
import type { AlertThemeIconMap } from '../components/interface';
|
|
4
|
+
/**
|
|
5
|
+
* Currency formatting configuration used by `DContextProvider`.
|
|
6
|
+
*/
|
|
4
7
|
export type CurrencyProps = {
|
|
8
|
+
/** Currency symbol (e.g. `"$"`, `"€"`). */
|
|
5
9
|
symbol: string;
|
|
10
|
+
/** Number of decimal places (e.g. `2`). */
|
|
6
11
|
precision: number;
|
|
12
|
+
/** Thousands separator character (e.g. `","`). */
|
|
7
13
|
separator: string;
|
|
14
|
+
/** Decimal separator character (e.g. `"."`). */
|
|
8
15
|
decimal: string;
|
|
9
16
|
};
|
|
10
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Icon font configuration used by `DContextProvider` to resolve icon classes.
|
|
19
|
+
*/
|
|
20
|
+
export type IconProps = {
|
|
21
|
+
/** CSS class that identifies the icon font family (e.g. `"bi"`). */
|
|
11
22
|
familyClass: string;
|
|
23
|
+
/** CSS prefix for icon names within the family (e.g. `"bi-"`). */
|
|
12
24
|
familyPrefix: string;
|
|
25
|
+
/** When `true`, icons are rendered in Material Design outlined style. */
|
|
13
26
|
materialStyle: boolean;
|
|
14
27
|
};
|
|
15
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Map of semantic icon names to their icon-font class suffixes.
|
|
30
|
+
* Used by Dynamic UI components to look up icons consistently.
|
|
31
|
+
*/
|
|
32
|
+
export type IconMapProps = {
|
|
33
|
+
/** Class suffix for the generic close/dismiss icon. */
|
|
16
34
|
x: string;
|
|
35
|
+
/** Class suffix for the large close/dismiss icon. */
|
|
17
36
|
xLg: string;
|
|
37
|
+
/** Class suffix for the chevron-down icon. */
|
|
18
38
|
chevronDown: string;
|
|
39
|
+
/** Class suffix for the chevron-up icon. */
|
|
19
40
|
chevronUp: string;
|
|
41
|
+
/** Class suffix for the chevron-left icon. */
|
|
20
42
|
chevronLeft: string;
|
|
43
|
+
/** Class suffix for the chevron-right icon. */
|
|
21
44
|
chevronRight: string;
|
|
45
|
+
/** Per-state alert icon map (one icon per `ComponentStateColor` value). */
|
|
22
46
|
alert: AlertThemeIconMap;
|
|
47
|
+
/** Class suffix for the upload/attach icon. */
|
|
23
48
|
upload: string;
|
|
49
|
+
/** Class suffix for the calendar/date-picker icon. */
|
|
24
50
|
calendar: string;
|
|
51
|
+
/** Class suffix for the checkmark icon. */
|
|
25
52
|
check: string;
|
|
53
|
+
/** Icon class suffixes for text input adornments. */
|
|
26
54
|
input: {
|
|
55
|
+
/** Search/magnifier icon. */
|
|
27
56
|
search: string;
|
|
57
|
+
/** Show password icon. */
|
|
28
58
|
show: string;
|
|
59
|
+
/** Hide password icon. */
|
|
29
60
|
hide: string;
|
|
61
|
+
/** Numeric decrease icon. */
|
|
30
62
|
decrease: string;
|
|
63
|
+
/** Numeric increase icon. */
|
|
31
64
|
increase: string;
|
|
32
65
|
};
|
|
33
66
|
};
|
|
67
|
+
/**
|
|
68
|
+
* CSS breakpoint pixel values resolved from Bootstrap CSS variables at runtime.
|
|
69
|
+
* These are populated automatically by `DContextProvider` on mount.
|
|
70
|
+
*/
|
|
34
71
|
export type BreakpointProps = {
|
|
72
|
+
/** `--bs-breakpoint-xs` value (usually `"0px"`). */
|
|
35
73
|
xs: string;
|
|
74
|
+
/** `--bs-breakpoint-sm` value (usually `"576px"`). */
|
|
36
75
|
sm: string;
|
|
76
|
+
/** `--bs-breakpoint-md` value (usually `"768px"`). */
|
|
37
77
|
md: string;
|
|
78
|
+
/** `--bs-breakpoint-lg` value (usually `"992px"`). */
|
|
38
79
|
lg: string;
|
|
80
|
+
/** `--bs-breakpoint-xl` value (usually `"1200px"`). */
|
|
39
81
|
xl: string;
|
|
82
|
+
/** `--bs-breakpoint-xxl` value (usually `"1400px"`). */
|
|
40
83
|
xxl: string;
|
|
41
84
|
};
|
|
42
|
-
type Props
|
|
85
|
+
type Props = {
|
|
43
86
|
language: string;
|
|
44
87
|
currency: CurrencyProps;
|
|
45
88
|
icon: IconProps;
|
|
46
89
|
iconMap: IconMapProps;
|
|
47
90
|
breakpoints: BreakpointProps;
|
|
48
|
-
} & PortalContextProps<T>;
|
|
49
|
-
type Context<T extends Record<string, unknown>> = Props<T> & {
|
|
50
|
-
setContext: (value: Partial<Props<T>>) => void;
|
|
51
91
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
92
|
+
type DContextProviderProps<T extends Record<string, unknown>> = Props & PortalContextProps<T>;
|
|
93
|
+
type Context = Props & {
|
|
94
|
+
setContext: (value: Partial<Props>) => void;
|
|
95
|
+
};
|
|
96
|
+
export declare const DContext: import("react").Context<Context>;
|
|
97
|
+
/**
|
|
98
|
+
* Root context provider for Dynamic UI. Wrap your application with this
|
|
99
|
+
* component to configure icons, currency, language, and portal settings
|
|
100
|
+
* for all descendant Dynamic UI components.
|
|
101
|
+
*
|
|
102
|
+
* @template T - Map of portal name → payload shape (e.g. `{ modal: { title: string } }`).
|
|
103
|
+
* Pass it once at the top level: `<DContextProvider<MyPortals> ...>`.
|
|
104
|
+
*/
|
|
105
|
+
export declare function DContextProvider<T extends Record<string, unknown>>({ language, currency, icon, iconMap, portalName, availablePortals, children, }: PropsWithChildren<Partial<DContextProviderProps<T>>>): import("react/jsx-runtime").JSX.Element;
|
|
106
|
+
/**
|
|
107
|
+
* Returns the Dynamic UI context value set by `DContextProvider`.
|
|
108
|
+
* Falls back to the library's built-in defaults when no `DContextProvider`
|
|
109
|
+
* is present in the tree — wrap your application with `DContextProvider`
|
|
110
|
+
* to customise icons, currency, language, and portal settings.
|
|
111
|
+
*/
|
|
112
|
+
export declare function useDContext(): Context;
|
|
55
113
|
export {};
|
|
@@ -3,27 +3,85 @@ type PortalComponent<P = any> = FC<PortalProps<P>>;
|
|
|
3
3
|
type PortalAvailableList<T extends Record<string, unknown>> = {
|
|
4
4
|
[K in keyof T]: PortalComponent<T[K]>;
|
|
5
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* Props for the `DPortalContextProvider` (mounted internally by `DContextProvider`).
|
|
8
|
+
* Consumers should configure these props on `DContextProvider` directly — never
|
|
9
|
+
* use `DPortalContextProvider` directly.
|
|
10
|
+
* @template T - Map of portal name → payload shape (e.g. `{ modal: { title: string } }`).
|
|
11
|
+
*/
|
|
6
12
|
export type PortalContextProps<T extends Record<string, unknown>> = PropsWithChildren<{
|
|
13
|
+
/** DOM element id used as the portal mount point. */
|
|
7
14
|
portalName: string;
|
|
15
|
+
/** Map of portal name to the component that renders it. */
|
|
8
16
|
availablePortals?: PortalAvailableList<T>;
|
|
9
17
|
}>;
|
|
10
|
-
type
|
|
11
|
-
name: N;
|
|
12
|
-
Component: PortalComponent<P>;
|
|
13
|
-
payload: P;
|
|
14
|
-
};
|
|
15
|
-
type OpenPortalFunction<P = unknown> = (name: string, payload: P) => void;
|
|
18
|
+
type OpenPortalFunction<T extends Record<string, unknown>> = <K extends keyof T & string>(name: K, payload: T[K]) => void;
|
|
16
19
|
type ClosePortalFunction = () => void;
|
|
20
|
+
/**
|
|
21
|
+
* Consumer-facing shape of a single entry in the portal stack.
|
|
22
|
+
* Only exposes `name` and `payload` — the internal `Component` field is not part of the public API.
|
|
23
|
+
* @template T - Map of portal name → payload shape.
|
|
24
|
+
*/
|
|
25
|
+
export type PortalStackEntry<T extends Record<string, unknown>> = {
|
|
26
|
+
[K in keyof T]: {
|
|
27
|
+
/** Portal identifier — matches the key passed to `openPortal`. */
|
|
28
|
+
name: K & string;
|
|
29
|
+
/** Payload forwarded from `openPortal`. */
|
|
30
|
+
payload: T[K];
|
|
31
|
+
};
|
|
32
|
+
}[keyof T];
|
|
33
|
+
/**
|
|
34
|
+
* Value returned by `useDPortalContext`. Provides methods to open/close portals
|
|
35
|
+
* and inspect the current portal stack.
|
|
36
|
+
* @template T - Map of portal name → payload shape.
|
|
37
|
+
*/
|
|
17
38
|
export type PortalContextType<T extends Record<string, unknown>> = {
|
|
18
|
-
|
|
19
|
-
|
|
39
|
+
/** Currently open portals, ordered from oldest (bottom) to newest (top). */
|
|
40
|
+
stack: PortalStackEntry<T>[];
|
|
41
|
+
/**
|
|
42
|
+
* Pushes a named portal onto the stack, rendering its registered component
|
|
43
|
+
* with the given payload.
|
|
44
|
+
* @param name - Key of the portal to open (must be registered in `availablePortals`).
|
|
45
|
+
* @param payload - Data forwarded to the portal component via `PortalProps.payload`.
|
|
46
|
+
* TypeScript will enforce that `payload` matches the shape declared for `name` in `T`.
|
|
47
|
+
*/
|
|
48
|
+
openPortal: OpenPortalFunction<T>;
|
|
49
|
+
/** Pops the topmost portal off the stack, closing it. */
|
|
20
50
|
closePortal: ClosePortalFunction;
|
|
21
51
|
};
|
|
52
|
+
/**
|
|
53
|
+
* Props interface received by every component registered in `availablePortals`.
|
|
54
|
+
* Use `PortalProps<Payloads['myPortal']>` to type a specific portal component.
|
|
55
|
+
* @template P - The payload shape for this portal.
|
|
56
|
+
*/
|
|
22
57
|
export type PortalProps<P = unknown> = {
|
|
58
|
+
/** Portal identifier, matches the key used in `openPortal`. */
|
|
23
59
|
name: string;
|
|
60
|
+
/** Data passed via `openPortal`. */
|
|
24
61
|
payload: P;
|
|
25
62
|
};
|
|
26
63
|
export declare const DPortalContext: import("react").Context<PortalContextType<any> | undefined>;
|
|
27
64
|
export declare function DPortalContextProvider<T extends Record<string, unknown>>({ portalName, children, availablePortals, }: PortalContextProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
65
|
+
/**
|
|
66
|
+
* Hook to open/close registered portals (modals, offcanvas, etc.).
|
|
67
|
+
*
|
|
68
|
+
* **Prerequisite**: must be called inside a `DContextProvider` configured with
|
|
69
|
+
* `portalName` and `availablePortals`. `DContextProvider` mounts
|
|
70
|
+
* `DPortalContextProvider` internally — consumers never use
|
|
71
|
+
* `DPortalContextProvider` directly.
|
|
72
|
+
*
|
|
73
|
+
* @template T - Map of portal name → payload shape (e.g. `ModalPayloads`).
|
|
74
|
+
* Typing this generic gives you autocomplete on `openPortal` arguments.
|
|
75
|
+
* @returns `{ openPortal, closePortal, stack }` from the nearest portal context.
|
|
76
|
+
* @throws If called outside of `DContextProvider` / `DPortalContextProvider`.
|
|
77
|
+
*
|
|
78
|
+
* @requires DContextProvider
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```tsx
|
|
82
|
+
* const { openPortal, closePortal } = useDPortalContext<ModalPayloads>();
|
|
83
|
+
* openPortal('confirm', { message: 'Are you sure?' });
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
28
86
|
export declare function useDPortalContext<T extends Record<string, unknown>>(): PortalContextType<T>;
|
|
29
87
|
export {};
|
|
@@ -4,7 +4,6 @@ export { default as useDisableInputWheel } from './useDisableInputWheel';
|
|
|
4
4
|
export { default as useProvidedRefOrCreate } from './useProvidedRefOrCreate';
|
|
5
5
|
export { default as useStackState } from './useStackState';
|
|
6
6
|
export { default as useDisableBodyScrollEffect } from './useDisableBodyScrollEffect';
|
|
7
|
-
export { default as usePortal } from './usePortal';
|
|
8
7
|
export { default as useItemSelection } from './useItemSelection';
|
|
9
8
|
export { default as useMediaQuery } from './useMediaQuery';
|
|
10
9
|
export { useMediaBreakpointUpXs, useMediaBreakpointUpSm, useMediaBreakpointUpMd, useMediaBreakpointUpLg, useMediaBreakpointUpXl, useMediaBreakpointUpXxl, } from './useMediaBreakpointUp';
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
* Creates a DOM `<div>` portal mount point and appends it to `document.body`.
|
|
4
|
+
* This hook is used exclusively by `DPortalContextProvider` and is **not** part
|
|
5
|
+
* of the public API. Use `useDPortalContext` instead.
|
|
6
|
+
*/
|
|
1
7
|
export default function usePortal(portalName: string): {
|
|
2
8
|
created: boolean;
|
|
3
9
|
};
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"sideEffects": [
|
|
4
4
|
"*.css"
|
|
5
5
|
],
|
|
6
|
-
"version": "2.
|
|
6
|
+
"version": "2.5.1",
|
|
7
7
|
"description": "React Dynamic Framework",
|
|
8
8
|
"license": "https://github.com/dynamic-framework/dynamic-ui/blob/master/LICENSE.md",
|
|
9
9
|
"repository": {
|
|
@@ -60,7 +60,8 @@
|
|
|
60
60
|
"clean": "rimraf dist-transpiled && rimraf dist",
|
|
61
61
|
"compile": "tsc -p . && rollup -c rollup.config.mjs",
|
|
62
62
|
"storybook": "storybook dev -p 6006",
|
|
63
|
-
"build:storybook": "storybook build --docs -o docs
|
|
63
|
+
"build:storybook": "storybook build --docs -o docs",
|
|
64
|
+
"generate:registry": "node scripts/generate-api.mjs && node scripts/generate-schema.mjs",
|
|
64
65
|
"eslint": "npm run eslint:src && npm run eslint:stories && npm run eslint:test",
|
|
65
66
|
"eslint:src": "eslint 'src/**/*.ts' 'src/**/*.tsx' --ignore-pattern '**/*.spec.tsx'",
|
|
66
67
|
"eslint:stories": "eslint stories/**/*.stories.tsx",
|
|
@@ -69,7 +70,7 @@
|
|
|
69
70
|
"postversion": "npm run build:scss",
|
|
70
71
|
"publish:cdn": "npm run publish:cdn-version && npm run publish:cdn-latest",
|
|
71
72
|
"publish:cdn-version": "node scripts/publish-cdn.js",
|
|
72
|
-
"publish:cdn-latest": "aws s3 sync ./dist/ s3://dynamicframework-cdn/assets/latest/ui-react --delete --acl public-read",
|
|
73
|
+
"publish:cdn-latest": "aws s3 sync ./dist/ s3://dynamicframework-cdn/assets/latest/ui-react --delete --exclude 'api.json' --acl public-read",
|
|
73
74
|
"publish:cdn-rc": "aws s3 sync ./dist/ s3://dynamicframework-cdn/assets/rc/ui-react --delete --acl public-read",
|
|
74
75
|
"publish:cdn-dev": "aws s3 sync ./dist/ s3://dynamicframework-cdn/assets/dev/ui-react --delete --acl public-read",
|
|
75
76
|
"lint-staged": "lint-staged",
|
|
@@ -120,6 +120,52 @@
|
|
|
120
120
|
}
|
|
121
121
|
// scss-docs-end df-btn-link-variant-variables-mixin
|
|
122
122
|
|
|
123
|
+
// scss-docs-start df-btn-soft-variant-variables-mixin
|
|
124
|
+
@mixin df-button-soft-variant-variables(
|
|
125
|
+
$color-name,
|
|
126
|
+
$default-color: var(--#{$prefix}#{$color-name}-700),
|
|
127
|
+
$default-bg: var(--#{$prefix}#{$color-name}-50),
|
|
128
|
+
$default-border-color: transparent,
|
|
129
|
+
$hover-color: var(--#{$prefix}#{$color-name}-700),
|
|
130
|
+
$hover-bg: var(--#{$prefix}#{$color-name}-100),
|
|
131
|
+
$hover-border-color: transparent,
|
|
132
|
+
$focus-color: var(--#{$prefix}#{$color-name}-700),
|
|
133
|
+
$focus-bg: var(--#{$prefix}#{$color-name}-100),
|
|
134
|
+
$focus-border-color: transparent,
|
|
135
|
+
$active-color: var(--#{$prefix}#{$color-name}-700),
|
|
136
|
+
$active-bg: var(--#{$prefix}#{$color-name}-200),
|
|
137
|
+
$active-border-color: transparent,
|
|
138
|
+
$disabled-opacity: $btn-disabled-opacity,
|
|
139
|
+
$box-shadow: $btn-box-shadow,
|
|
140
|
+
$focus-shadow-rgb: var(--#{$prefix}#{$color-name}-500-rgb),
|
|
141
|
+
$active-box-shadow: $btn-active-box-shadow,
|
|
142
|
+
) {
|
|
143
|
+
--#{$prefix}btn-soft-#{$color-name}-color: #{$default-color};
|
|
144
|
+
--#{$prefix}btn-soft-#{$color-name}-bg: #{$default-bg};
|
|
145
|
+
--#{$prefix}btn-soft-#{$color-name}-border-color: #{$default-border-color};
|
|
146
|
+
--#{$prefix}btn-soft-#{$color-name}-box-shadow: #{$box-shadow};
|
|
147
|
+
|
|
148
|
+
--#{$prefix}btn-soft-#{$color-name}-hover-color: #{$hover-color};
|
|
149
|
+
--#{$prefix}btn-soft-#{$color-name}-hover-bg: #{$hover-bg};
|
|
150
|
+
--#{$prefix}btn-soft-#{$color-name}-hover-border-color: #{$hover-border-color};
|
|
151
|
+
|
|
152
|
+
--#{$prefix}btn-soft-#{$color-name}-focus-color: #{$focus-color};
|
|
153
|
+
--#{$prefix}btn-soft-#{$color-name}-focus-bg: #{$focus-bg};
|
|
154
|
+
--#{$prefix}btn-soft-#{$color-name}-focus-border-color: #{$focus-border-color};
|
|
155
|
+
--#{$prefix}btn-soft-#{$color-name}-focus-shadow-rgb: #{$focus-shadow-rgb};
|
|
156
|
+
|
|
157
|
+
--#{$prefix}btn-soft-#{$color-name}-active-color: #{$active-color};
|
|
158
|
+
--#{$prefix}btn-soft-#{$color-name}-active-bg: #{$active-bg};
|
|
159
|
+
--#{$prefix}btn-soft-#{$color-name}-active-border-color: #{$active-border-color};
|
|
160
|
+
--#{$prefix}btn-soft-#{$color-name}-active-box-shadow: #{$active-box-shadow};
|
|
161
|
+
|
|
162
|
+
--#{$prefix}btn-soft-#{$color-name}-disabled-color: #{$default-color};
|
|
163
|
+
--#{$prefix}btn-soft-#{$color-name}-disabled-bg: #{$default-bg};
|
|
164
|
+
--#{$prefix}btn-soft-#{$color-name}-disabled-border-color: #{$default-border-color};
|
|
165
|
+
--#{$prefix}btn-soft-#{$color-name}-disabled-opacity: #{$disabled-opacity};
|
|
166
|
+
}
|
|
167
|
+
// scss-docs-end df-btn-soft-variant-variables-mixin
|
|
168
|
+
|
|
123
169
|
@mixin df-button-variant-outline-mapper($color-name) {
|
|
124
170
|
--#{$prefix}btn-color: var(--#{$prefix}btn-outline-#{$color-name}-color);
|
|
125
171
|
--#{$prefix}btn-border-color: var(--#{$prefix}btn-outline-#{$color-name}-border-color);
|
|
@@ -98,7 +98,7 @@ $utilities: map-merge(
|
|
|
98
98
|
responsive: true,
|
|
99
99
|
values: map-merge(
|
|
100
100
|
map-get(map-get($utilities, "border-color"), "values"),
|
|
101
|
-
map-loop($palette-grays, rgba-css-var, "$key", "border"),
|
|
101
|
+
map-loop(map-merge-multiple($theme-colors-palettes, $palette-grays), rgba-css-var, "$key", "border"),
|
|
102
102
|
)
|
|
103
103
|
)
|
|
104
104
|
),
|
|
@@ -4,33 +4,43 @@
|
|
|
4
4
|
|
|
5
5
|
// scss-docs-start dropdown-variables
|
|
6
6
|
$dropdown-padding-x: var(--#{$prefix}ref-spacer-2) !default;
|
|
7
|
+
$dropdown-color: var(--#{$prefix}body-color) !default;
|
|
7
8
|
$dropdown-bg: var(--#{$prefix}white) !default;
|
|
9
|
+
$dropdown-border-color: var(--#{$prefix}border-color-translucent) !default;
|
|
8
10
|
$dropdown-border-radius: var(--#{$prefix}border-radius-sm) !default;
|
|
9
11
|
$dropdown-border-width: 0 !default;
|
|
10
|
-
|
|
11
|
-
$dropdown-divider-margin-y: var(--#{$prefix}ref-spacer-2) !default;
|
|
12
|
+
$dropdown-divider-bg: $dropdown-border-color !default;
|
|
12
13
|
$dropdown-box-shadow: var(--#{$prefix}box-shadow-sm) !default;
|
|
13
14
|
|
|
14
|
-
$dropdown-link-color:
|
|
15
|
-
$dropdown-link-hover-color:
|
|
15
|
+
$dropdown-link-color: var(--#{$prefix}body-color) !default;
|
|
16
|
+
$dropdown-link-hover-color: $dropdown-link-color !default;
|
|
16
17
|
$dropdown-link-hover-bg: rgb(var(--#{$prefix}gray-25-rgb)) !default;
|
|
18
|
+
|
|
19
|
+
$dropdown-link-active-color: var(--#{$prefix}body-color) !default;
|
|
17
20
|
$dropdown-link-active-bg: rgb(var(--#{$prefix}gray-50-rgb)) !default;
|
|
18
21
|
|
|
22
|
+
$dropdown-link-disabled-color: var(--#{$prefix}gray-100) !default;
|
|
23
|
+
|
|
19
24
|
$dropdown-item-padding-y: var(--#{$prefix}ref-spacer-2) !default;
|
|
20
25
|
$dropdown-item-padding-x: var(--#{$prefix}ref-spacer-4) !default;
|
|
21
26
|
|
|
27
|
+
$dropdown-header-color: var(--#{$prefix}gray-600) !default;
|
|
28
|
+
|
|
22
29
|
// custom
|
|
23
30
|
$dropdown-item-border-radius: var(--#{$prefix}border-radius-sm) !default;
|
|
24
31
|
// end custom
|
|
25
32
|
|
|
26
|
-
$dropdown-header-color: var(--#{$prefix}gray-600) !default;
|
|
27
33
|
// scss-docs-end dropdown-variables
|
|
28
|
-
|
|
29
|
-
// scss-docs-start dropdown-dark-variables
|
|
30
34
|
$dropdown-dark-color: var(--#{$prefix}gray-300) !default;
|
|
31
35
|
$dropdown-dark-bg: var(--#{$prefix}gray-800) !default;
|
|
36
|
+
$dropdown-dark-border-color: var(--#{$prefix}border-color-translucent) !default;
|
|
37
|
+
$dropdown-dark-divider-bg: $dropdown-dark-border-color !default;
|
|
38
|
+
$dropdown-dark-box-shadow: null !default;
|
|
39
|
+
$dropdown-dark-link-color: $dropdown-dark-color !default;
|
|
32
40
|
$dropdown-dark-link-hover-color: var(--#{$prefix}white) !default;
|
|
33
|
-
$dropdown-dark-link-hover-bg: var(--#{$prefix}
|
|
41
|
+
$dropdown-dark-link-hover-bg: rgba(var(--#{$prefix}white-rgb), .15) !default;
|
|
42
|
+
$dropdown-dark-link-active-color: $dropdown-link-active-color !default;
|
|
43
|
+
$dropdown-dark-link-active-bg: $dropdown-link-active-bg !default;
|
|
34
44
|
$dropdown-dark-link-disabled-color: var(--#{$prefix}gray-500) !default;
|
|
35
45
|
$dropdown-dark-header-color: var(--#{$prefix}gray-500) !default;
|
|
36
46
|
// scss-docs-end dropdown-dark-variables
|
|
@@ -1,21 +1,10 @@
|
|
|
1
|
-
// .dropdown-item {
|
|
2
|
-
// --#{$prefix}dropdown-item-border-radius: #{$dropdown-item-border-radius};
|
|
3
|
-
// }
|
|
4
|
-
|
|
5
1
|
.dropdown-item {
|
|
6
2
|
--#{$prefix}dropdown-item-border-radius: #{$dropdown-item-border-radius};
|
|
7
|
-
--#{$prefix}dropdown-item-active-bg: var(--#{$prefix}gray-25);
|
|
8
|
-
--#{$prefix}dropdown-item-active-color: inherit;
|
|
9
|
-
&:active {
|
|
10
|
-
color: var(--#{$prefix}dropdown-item-active-color);
|
|
11
|
-
background-color: var(--#{$prefix}dropdown-item-active-bg);
|
|
12
|
-
}
|
|
13
3
|
&.dropdown-item-danger {
|
|
14
|
-
color: var(--#{$prefix}danger-500);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
4
|
+
--#{$prefix}dropdown-link-color: var(--#{$prefix}danger-500);
|
|
5
|
+
--#{$prefix}dropdown-link-hover-color: var(--#{$prefix}dropdown-link-color);
|
|
6
|
+
--#{$prefix}dropdown-link-hover-bg: var(--#{$prefix}danger-25);
|
|
7
|
+
--#{$prefix}dropdown-link-active-color: var(--#{$prefix}dropdown-link-color);
|
|
8
|
+
--#{$prefix}dropdown-link-active-bg: var(--#{$prefix}danger-50);
|
|
20
9
|
}
|
|
21
10
|
}
|
|
@@ -25,29 +25,31 @@
|
|
|
25
25
|
--#{$prefix}icon-color: var(--#{$prefix}toast-icon-color);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
@each $theme, $value in map-remove($theme-colors, "light", "dark") {
|
|
29
|
-
$color: color-contrast-var($value);
|
|
28
|
+
@each $theme, $value in map-remove($theme-colors-base, "warning", "light", "dark") {
|
|
30
29
|
&.toast-#{$theme} {
|
|
31
|
-
--#{$prefix}toast-border-color: var(--#{$prefix}#{$theme});
|
|
32
|
-
--#{$prefix}toast-color: #{$
|
|
33
|
-
--#{$prefix}toast-close-color: #{$
|
|
34
|
-
--#{$prefix}toast-header-color: #{$
|
|
35
|
-
--#{$prefix}toast-bg: var(--#{$prefix}#{$theme});
|
|
36
|
-
--#{$prefix}toast-header-bg: var(--#{$prefix}#{$theme});
|
|
30
|
+
--#{$prefix}toast-border-color: var(--#{$prefix}#{$theme}-50);
|
|
31
|
+
--#{$prefix}toast-color: var(--#{$prefix}#{$theme}-700);
|
|
32
|
+
--#{$prefix}toast-close-color: var(--#{$prefix}#{$theme}-700);
|
|
33
|
+
--#{$prefix}toast-header-color: var(--#{$prefix}#{$theme}-700);
|
|
34
|
+
--#{$prefix}toast-bg: var(--#{$prefix}#{$theme}-50);
|
|
35
|
+
--#{$prefix}toast-header-bg: var(--#{$prefix}#{$theme}-50);
|
|
37
36
|
|
|
38
37
|
.d-close {
|
|
39
38
|
color: var(--#{$prefix}toast-close-color);
|
|
40
39
|
}
|
|
41
40
|
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&.toast-warning {
|
|
44
|
+
--#{$prefix}toast-border-color: var(--#{$prefix}warning-50);
|
|
45
|
+
--#{$prefix}toast-color: var(--#{$prefix}warning-800);
|
|
46
|
+
--#{$prefix}toast-close-color: var(--#{$prefix}warning-800);
|
|
47
|
+
--#{$prefix}toast-header-color: var(--#{$prefix}warning-800);
|
|
48
|
+
--#{$prefix}toast-bg: var(--#{$prefix}warning-50);
|
|
49
|
+
--#{$prefix}toast-header-bg: var(--#{$prefix}warning-50);
|
|
42
50
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
--#{$prefix}toast-close-color: var(--#{$prefix}gray-900);
|
|
46
|
-
--#{$prefix}toast-header-color: var(--#{$prefix}gray-900);
|
|
47
|
-
--#{$prefix}toast-icon-color: var(--#{$prefix}#{$theme}-500);
|
|
48
|
-
--#{$prefix}toast-border-color: var(--#{$prefix}#{$theme}-100);
|
|
49
|
-
--#{$prefix}toast-bg: var(--#{$prefix}#{$theme}-100);
|
|
50
|
-
--#{$prefix}toast-header-bg: var(--#{$prefix}#{$theme}-100);
|
|
51
|
+
.d-close {
|
|
52
|
+
color: var(--#{$prefix}toast-close-color);
|
|
51
53
|
}
|
|
52
54
|
}
|
|
53
55
|
}
|