@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.esm.js
CHANGED
|
@@ -272,23 +272,22 @@ function DIcon(_a) {
|
|
|
272
272
|
return (jsx(DIconBase, Object.assign({ familyClass: propFamilyClass || familyClass, familyPrefix: propFamilyPrefix || familyPrefix, materialStyle: propMaterialStyle || materialStyle }, props)));
|
|
273
273
|
}
|
|
274
274
|
|
|
275
|
-
function DAlert({
|
|
275
|
+
function DAlert({ theme = 'success', icon: iconProp, iconFamilyClass, iconFamilyPrefix, iconMaterialStyle = false, iconClose: iconCloseProp, iconCloseFamilyClass, iconCloseFamilyPrefix, iconCloseMaterialStyle = false, showClose, onClose, children, id, className, style, }) {
|
|
276
276
|
const { iconMap: { alert, xLg, }, } = useDContext();
|
|
277
|
-
const icon = useMemo(() => iconProp || alert[
|
|
277
|
+
const icon = useMemo(() => iconProp || alert[theme], [alert, iconProp, theme]);
|
|
278
278
|
const iconClose = useMemo(() => (iconCloseProp || xLg), [iconCloseProp, xLg]);
|
|
279
|
-
const generateClasses = useMemo(() => (Object.assign({ alert: true, [`alert-${
|
|
280
|
-
|
|
281
|
-
return (jsxs("div", { className: classNames(generateClasses), style: generateStyleVariables, role: "alert", id: id, children: [(showIcon || icon) && (jsx(DIcon, { className: "alert-icon", icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: iconMaterialStyle })), jsx("div", { className: "alert-text", children: children }), showClose && (jsx("div", { className: "alert-separator" })), showClose && (jsx("button", { type: "button", className: "btn-close", "aria-label": "Close", onClick: onClose, children: jsx(DIcon, { className: "alert-close-icon", icon: iconClose, familyClass: iconCloseFamilyClass, familyPrefix: iconCloseFamilyPrefix, materialStyle: iconCloseMaterialStyle }) }))] }));
|
|
279
|
+
const generateClasses = useMemo(() => (Object.assign({ alert: true, [`alert-${theme}`]: true, 'fade show': !!showClose }, className && { [className]: true })), [theme, showClose, className]);
|
|
280
|
+
return (jsxs("div", { className: classNames(generateClasses), style: style, role: "alert", id: id, children: [icon && (jsx(DIcon, { className: "alert-icon", icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: iconMaterialStyle })), jsx("div", { className: "alert-text", children: children }), showClose && (jsx("button", { type: "button", className: "d-close", "aria-label": "Close", onClick: onClose, children: jsx(DIcon, { icon: iconClose, familyClass: iconCloseFamilyClass, familyPrefix: iconCloseFamilyPrefix, materialStyle: iconCloseMaterialStyle }) }))] }));
|
|
282
281
|
}
|
|
283
282
|
|
|
284
|
-
function DBadge({ text,
|
|
283
|
+
function DBadge({ text, soft = false, theme = 'primary', id, rounded, className, style, iconStart, iconEnd, iconMaterialStyle, iconFamilyClass, iconFamilyPrefix, }) {
|
|
285
284
|
const generateClasses = useMemo(() => ({
|
|
286
285
|
badge: true,
|
|
287
|
-
|
|
288
|
-
[`
|
|
289
|
-
|
|
290
|
-
}), [
|
|
291
|
-
return (
|
|
286
|
+
[`badge-${theme}`]: !!theme && !soft,
|
|
287
|
+
[`badge-soft-${theme}`]: !!theme && soft,
|
|
288
|
+
'rounded-pill': !!rounded,
|
|
289
|
+
}), [rounded, soft, theme]);
|
|
290
|
+
return (jsxs("span", Object.assign({ className: classNames(generateClasses, className), style: style }, id && { id }, { children: [iconStart && (jsx(DIcon, { icon: iconStart, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: iconMaterialStyle })), jsx("span", { children: text }), iconEnd && (jsx(DIcon, { icon: iconEnd, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: iconMaterialStyle }))] })));
|
|
292
291
|
}
|
|
293
292
|
|
|
294
293
|
function DBoxFile(_a) {
|
|
@@ -1171,7 +1170,7 @@ var DList$1 = Object.assign(DList, {
|
|
|
1171
1170
|
function DModalHeader({ showCloseButton, onClose, children, className, style, iconFamilyClass, iconFamilyPrefix, icon: iconProp, materialStyle = false, }) {
|
|
1172
1171
|
const { iconMap: { xLg, }, } = useDContext();
|
|
1173
1172
|
const icon = useMemo(() => iconProp || xLg, [iconProp, xLg]);
|
|
1174
|
-
return (jsxs("div", { className: classNames('modal-header', className), style: style, children: [jsx("div", { children: children }), showCloseButton && (jsx("button", { type: "button", className: "d-close", "aria-label": "Close", onClick: onClose, children: jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: materialStyle }) }))] }));
|
|
1173
|
+
return (jsxs("div", { className: classNames('modal-header', className), style: style, children: [jsx("div", { children: children }), showCloseButton && (jsx("button", { type: "button", className: "d-close align-self-center", "aria-label": "Close", onClick: onClose, children: jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: materialStyle }) }))] }));
|
|
1175
1174
|
}
|
|
1176
1175
|
|
|
1177
1176
|
function DModalBody({ children, className, style, }) {
|
|
@@ -1208,7 +1207,7 @@ var DModal$1 = Object.assign(DModal, {
|
|
|
1208
1207
|
function DOffcanvasHeader({ showCloseButton, onClose, children, className, style, iconFamilyClass, iconFamilyPrefix, icon: iconProp, materialStyle = false, }) {
|
|
1209
1208
|
const { iconMap: { xLg, }, } = useDContext();
|
|
1210
1209
|
const icon = useMemo(() => iconProp || xLg, [iconProp, xLg]);
|
|
1211
|
-
return (jsxs("div", { className: classNames('offcanvas-header', className), style: style, children: [jsx("div", { children: children }), showCloseButton && (jsx("button", { type: "button", className: "d-close", "aria-label": "Close", onClick: onClose, children: jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: materialStyle }) }))] }));
|
|
1210
|
+
return (jsxs("div", { className: classNames('offcanvas-header', className), style: style, children: [jsx("div", { children: children }), showCloseButton && (jsx("button", { type: "button", className: "d-close align-self-center", "aria-label": "Close", onClick: onClose, children: jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: materialStyle }) }))] }));
|
|
1212
1211
|
}
|
|
1213
1212
|
|
|
1214
1213
|
function DOffcanvasBody({ children, className, style, }) {
|
|
@@ -1532,14 +1531,14 @@ function useDToast() {
|
|
|
1532
1531
|
}
|
|
1533
1532
|
if (!description) {
|
|
1534
1533
|
return (jsx(DToast$1, { className: classNames({
|
|
1535
|
-
[`toast-${theme}`]: !!theme,
|
|
1536
|
-
|
|
1537
|
-
}, 'show'), children: jsxs(DToast$1.Body, { children: [icon && (jsx(DIcon, { className: "toast-icon", icon: icon })), jsx("p", { className: "toast-title", children: title }), jsx("button", { type: "button", className: "d-close", "aria-label": "Close", onClick: () => toast.dismiss(id), children: jsx(DIcon, { icon: closeIcon || xLg }) })] }) }));
|
|
1534
|
+
[`toast-${theme}`]: !!theme && !soft,
|
|
1535
|
+
[`toast-soft-${theme}`]: !!theme && !!soft,
|
|
1536
|
+
}, 'show'), children: jsxs(DToast$1.Body, { children: [icon && (jsx(DIcon, { className: "toast-icon", icon: icon })), jsx("p", { className: "toast-title", children: title }), jsx("button", { type: "button", className: "d-close align-self-center", "aria-label": "Close", onClick: () => toast.dismiss(id), children: jsx(DIcon, { icon: closeIcon || xLg }) })] }) }));
|
|
1538
1537
|
}
|
|
1539
1538
|
return (jsxs(DToast$1, { className: classNames({
|
|
1540
|
-
[`toast-${theme}`]: !!theme,
|
|
1541
|
-
|
|
1542
|
-
}, 'show'), children: [jsxs(DToast$1.Header, { children: [icon && (jsx(DIcon, { className: "toast-icon", icon: icon })), jsx("p", { className: "toast-title", children: title }), timestamp && (jsx("small", { className: "toast-timestamp", children: timestamp })), jsx("button", { type: "button", className: "d-close", "aria-label": "Close", onClick: () => toast.dismiss(id), children: jsx(DIcon, { icon: closeIcon || xLg }) })] }), jsx(DToast$1.Body, { children: jsx("span", { children: description }) })] }));
|
|
1539
|
+
[`toast-${theme}`]: !!theme && !soft,
|
|
1540
|
+
[`toast-soft-${theme}`]: !!theme && !!soft,
|
|
1541
|
+
}, 'show'), children: [jsxs(DToast$1.Header, { children: [icon && (jsx(DIcon, { className: "toast-icon", icon: icon })), jsx("p", { className: "toast-title", children: title }), timestamp && (jsx("small", { className: "toast-timestamp", children: timestamp })), jsx("button", { type: "button", className: "d-close align-self-center", "aria-label": "Close", onClick: () => toast.dismiss(id), children: jsx(DIcon, { icon: closeIcon || xLg }) })] }), jsx(DToast$1.Body, { children: jsx("span", { children: description }) })] }));
|
|
1543
1542
|
}, toastProps);
|
|
1544
1543
|
}, [xLg]);
|
|
1545
1544
|
return {
|