@dynamic-framework/ui-react 1.28.1 → 1.29.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/css/dynamic-ui-non-root.css +6611 -127
- package/dist/css/dynamic-ui-non-root.min.css +2 -2
- package/dist/css/dynamic-ui-root.css +18 -2
- package/dist/css/dynamic-ui-root.min.css +2 -2
- package/dist/css/dynamic-ui.css +6628 -128
- package/dist/css/dynamic-ui.min.css +2 -2
- package/dist/index.esm.js +18 -19
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +18 -19
- package/dist/index.js.map +1 -1
- package/dist/types/components/DAlert/DAlert.d.ts +3 -5
- package/dist/types/components/DBadge/DBadge.d.ts +7 -2
- package/dist/types/components/interface.d.ts +3 -3
- package/dist/types/contexts/DContext.d.ts +2 -2
- package/package.json +2 -2
- package/src/style/abstracts/variables/_alerts.scss +1 -6
- package/src/style/abstracts/variables/_badges.scss +1 -1
- package/src/style/abstracts/variables/_border.scss +1 -1
- package/src/style/abstracts/variables/_spacers.scss +32 -0
- package/src/style/base/_+import.scss +1 -0
- package/src/style/base/_alert.scss +10 -45
- package/src/style/base/_badge.scss +49 -0
- package/src/style/base/_toast.scss +8 -13
- package/src/style/components/_d-close.scss +0 -1
package/dist/index.js
CHANGED
|
@@ -274,23 +274,22 @@ function DIcon(_a) {
|
|
|
274
274
|
return (jsxRuntime.jsx(DIconBase, Object.assign({ familyClass: propFamilyClass || familyClass, familyPrefix: propFamilyPrefix || familyPrefix, materialStyle: propMaterialStyle || materialStyle }, props)));
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
-
function DAlert({
|
|
277
|
+
function DAlert({ theme = 'success', icon: iconProp, iconFamilyClass, iconFamilyPrefix, iconMaterialStyle = false, iconClose: iconCloseProp, iconCloseFamilyClass, iconCloseFamilyPrefix, iconCloseMaterialStyle = false, showClose, onClose, children, id, className, style, }) {
|
|
278
278
|
const { iconMap: { alert, xLg, }, } = useDContext();
|
|
279
|
-
const icon = React.useMemo(() => iconProp || alert[
|
|
279
|
+
const icon = React.useMemo(() => iconProp || alert[theme], [alert, iconProp, theme]);
|
|
280
280
|
const iconClose = React.useMemo(() => (iconCloseProp || xLg), [iconCloseProp, xLg]);
|
|
281
|
-
const generateClasses = React.useMemo(() => (Object.assign({ alert: true, [`alert-${
|
|
282
|
-
|
|
283
|
-
return (jsxRuntime.jsxs("div", { className: classNames(generateClasses), style: generateStyleVariables, role: "alert", id: id, children: [(showIcon || icon) && (jsxRuntime.jsx(DIcon, { className: "alert-icon", icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: iconMaterialStyle })), jsxRuntime.jsx("div", { className: "alert-text", children: children }), showClose && (jsxRuntime.jsx("div", { className: "alert-separator" })), showClose && (jsxRuntime.jsx("button", { type: "button", className: "btn-close", "aria-label": "Close", onClick: onClose, children: jsxRuntime.jsx(DIcon, { className: "alert-close-icon", icon: iconClose, familyClass: iconCloseFamilyClass, familyPrefix: iconCloseFamilyPrefix, materialStyle: iconCloseMaterialStyle }) }))] }));
|
|
281
|
+
const generateClasses = React.useMemo(() => (Object.assign({ alert: true, [`alert-${theme}`]: true, 'fade show': !!showClose }, className && { [className]: true })), [theme, showClose, className]);
|
|
282
|
+
return (jsxRuntime.jsxs("div", { className: classNames(generateClasses), style: style, role: "alert", id: id, children: [icon && (jsxRuntime.jsx(DIcon, { className: "alert-icon", icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: iconMaterialStyle })), jsxRuntime.jsx("div", { className: "alert-text", children: children }), showClose && (jsxRuntime.jsx("button", { type: "button", className: "d-close", "aria-label": "Close", onClick: onClose, children: jsxRuntime.jsx(DIcon, { icon: iconClose, familyClass: iconCloseFamilyClass, familyPrefix: iconCloseFamilyPrefix, materialStyle: iconCloseMaterialStyle }) }))] }));
|
|
284
283
|
}
|
|
285
284
|
|
|
286
|
-
function DBadge({ text,
|
|
285
|
+
function DBadge({ text, soft = false, theme = 'primary', id, rounded, className, style, iconStart, iconEnd, iconMaterialStyle, iconFamilyClass, iconFamilyPrefix, }) {
|
|
287
286
|
const generateClasses = React.useMemo(() => ({
|
|
288
287
|
badge: true,
|
|
289
|
-
|
|
290
|
-
[`
|
|
291
|
-
|
|
292
|
-
}), [
|
|
293
|
-
return (jsxRuntime.
|
|
288
|
+
[`badge-${theme}`]: !!theme && !soft,
|
|
289
|
+
[`badge-soft-${theme}`]: !!theme && soft,
|
|
290
|
+
'rounded-pill': !!rounded,
|
|
291
|
+
}), [rounded, soft, theme]);
|
|
292
|
+
return (jsxRuntime.jsxs("span", Object.assign({ className: classNames(generateClasses, className), style: style }, id && { id }, { children: [iconStart && (jsxRuntime.jsx(DIcon, { icon: iconStart, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: iconMaterialStyle })), jsxRuntime.jsx("span", { children: text }), iconEnd && (jsxRuntime.jsx(DIcon, { icon: iconEnd, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: iconMaterialStyle }))] })));
|
|
294
293
|
}
|
|
295
294
|
|
|
296
295
|
function DBoxFile(_a) {
|
|
@@ -1173,7 +1172,7 @@ var DList$1 = Object.assign(DList, {
|
|
|
1173
1172
|
function DModalHeader({ showCloseButton, onClose, children, className, style, iconFamilyClass, iconFamilyPrefix, icon: iconProp, materialStyle = false, }) {
|
|
1174
1173
|
const { iconMap: { xLg, }, } = useDContext();
|
|
1175
1174
|
const icon = React.useMemo(() => iconProp || xLg, [iconProp, xLg]);
|
|
1176
|
-
return (jsxRuntime.jsxs("div", { className: classNames('modal-header', className), style: style, children: [jsxRuntime.jsx("div", { children: children }), showCloseButton && (jsxRuntime.jsx("button", { type: "button", className: "d-close", "aria-label": "Close", onClick: onClose, children: jsxRuntime.jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: materialStyle }) }))] }));
|
|
1175
|
+
return (jsxRuntime.jsxs("div", { className: classNames('modal-header', className), style: style, children: [jsxRuntime.jsx("div", { children: children }), showCloseButton && (jsxRuntime.jsx("button", { type: "button", className: "d-close align-self-center", "aria-label": "Close", onClick: onClose, children: jsxRuntime.jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: materialStyle }) }))] }));
|
|
1177
1176
|
}
|
|
1178
1177
|
|
|
1179
1178
|
function DModalBody({ children, className, style, }) {
|
|
@@ -1210,7 +1209,7 @@ var DModal$1 = Object.assign(DModal, {
|
|
|
1210
1209
|
function DOffcanvasHeader({ showCloseButton, onClose, children, className, style, iconFamilyClass, iconFamilyPrefix, icon: iconProp, materialStyle = false, }) {
|
|
1211
1210
|
const { iconMap: { xLg, }, } = useDContext();
|
|
1212
1211
|
const icon = React.useMemo(() => iconProp || xLg, [iconProp, xLg]);
|
|
1213
|
-
return (jsxRuntime.jsxs("div", { className: classNames('offcanvas-header', className), style: style, children: [jsxRuntime.jsx("div", { children: children }), showCloseButton && (jsxRuntime.jsx("button", { type: "button", className: "d-close", "aria-label": "Close", onClick: onClose, children: jsxRuntime.jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: materialStyle }) }))] }));
|
|
1212
|
+
return (jsxRuntime.jsxs("div", { className: classNames('offcanvas-header', className), style: style, children: [jsxRuntime.jsx("div", { children: children }), showCloseButton && (jsxRuntime.jsx("button", { type: "button", className: "d-close align-self-center", "aria-label": "Close", onClick: onClose, children: jsxRuntime.jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: materialStyle }) }))] }));
|
|
1214
1213
|
}
|
|
1215
1214
|
|
|
1216
1215
|
function DOffcanvasBody({ children, className, style, }) {
|
|
@@ -1534,14 +1533,14 @@ function useDToast() {
|
|
|
1534
1533
|
}
|
|
1535
1534
|
if (!description) {
|
|
1536
1535
|
return (jsxRuntime.jsx(DToast$1, { className: classNames({
|
|
1537
|
-
[`toast-${theme}`]: !!theme,
|
|
1538
|
-
|
|
1539
|
-
}, 'show'), children: jsxRuntime.jsxs(DToast$1.Body, { children: [icon && (jsxRuntime.jsx(DIcon, { className: "toast-icon", icon: icon })), jsxRuntime.jsx("p", { className: "toast-title", children: title }), jsxRuntime.jsx("button", { type: "button", className: "d-close", "aria-label": "Close", onClick: () => reactHotToast.toast.dismiss(id), children: jsxRuntime.jsx(DIcon, { icon: closeIcon || xLg }) })] }) }));
|
|
1536
|
+
[`toast-${theme}`]: !!theme && !soft,
|
|
1537
|
+
[`toast-soft-${theme}`]: !!theme && !!soft,
|
|
1538
|
+
}, 'show'), children: jsxRuntime.jsxs(DToast$1.Body, { children: [icon && (jsxRuntime.jsx(DIcon, { className: "toast-icon", icon: icon })), jsxRuntime.jsx("p", { className: "toast-title", children: title }), jsxRuntime.jsx("button", { type: "button", className: "d-close align-self-center", "aria-label": "Close", onClick: () => reactHotToast.toast.dismiss(id), children: jsxRuntime.jsx(DIcon, { icon: closeIcon || xLg }) })] }) }));
|
|
1540
1539
|
}
|
|
1541
1540
|
return (jsxRuntime.jsxs(DToast$1, { className: classNames({
|
|
1542
|
-
[`toast-${theme}`]: !!theme,
|
|
1543
|
-
|
|
1544
|
-
}, 'show'), children: [jsxRuntime.jsxs(DToast$1.Header, { children: [icon && (jsxRuntime.jsx(DIcon, { className: "toast-icon", icon: icon })), jsxRuntime.jsx("p", { className: "toast-title", children: title }), timestamp && (jsxRuntime.jsx("small", { className: "toast-timestamp", children: timestamp })), jsxRuntime.jsx("button", { type: "button", className: "d-close", "aria-label": "Close", onClick: () => reactHotToast.toast.dismiss(id), children: jsxRuntime.jsx(DIcon, { icon: closeIcon || xLg }) })] }), jsxRuntime.jsx(DToast$1.Body, { children: jsxRuntime.jsx("span", { children: description }) })] }));
|
|
1541
|
+
[`toast-${theme}`]: !!theme && !soft,
|
|
1542
|
+
[`toast-soft-${theme}`]: !!theme && !!soft,
|
|
1543
|
+
}, 'show'), children: [jsxRuntime.jsxs(DToast$1.Header, { children: [icon && (jsxRuntime.jsx(DIcon, { className: "toast-icon", icon: icon })), jsxRuntime.jsx("p", { className: "toast-title", children: title }), timestamp && (jsxRuntime.jsx("small", { className: "toast-timestamp", children: timestamp })), jsxRuntime.jsx("button", { type: "button", className: "d-close align-self-center", "aria-label": "Close", onClick: () => reactHotToast.toast.dismiss(id), children: jsxRuntime.jsx(DIcon, { icon: closeIcon || xLg }) })] }), jsxRuntime.jsx(DToast$1.Body, { children: jsxRuntime.jsx("span", { children: description }) })] }));
|
|
1545
1544
|
}, toastProps);
|
|
1546
1545
|
}, [xLg]);
|
|
1547
1546
|
return {
|