@dynamic-framework/ui-react 1.15.1 → 1.16.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 +1879 -1893
- package/dist/css/dynamic-ui-non-root.min.css +4 -1
- package/dist/css/dynamic-ui-root.css +3 -0
- package/dist/css/dynamic-ui-root.min.css +3 -0
- package/dist/css/dynamic-ui.css +1879 -1893
- package/dist/css/dynamic-ui.min.css +4 -1
- package/dist/index.esm.js +29 -38
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +27 -39
- package/dist/index.js.map +1 -1
- package/dist/types/components/DBadge/DBadge.d.ts +2 -1
- package/dist/types/components/index.d.ts +0 -1
- package/dist/types/contexts/DContext.d.ts +2 -2
- package/package.json +4 -3
- package/src/style/abstracts/variables/_accordion.scss +14 -6
- package/src/style/abstracts/variables/_buttons.scss +3 -3
- package/src/style/abstracts/variables/_close.scss +2 -2
- package/src/style/abstracts/variables/_modals.scss +2 -2
- package/src/style/base/_+import.scss +34 -1
- package/src/style/base/_accordion.scss +18 -0
- package/src/style/base/_breadcrumb.scss +10 -0
- package/src/style/{components/_d-button.scss → base/_button.scss} +15 -1
- package/src/style/components/_+import.scss +0 -36
- package/src/style/components/_d-modal.scss +1 -1
- package/src/style/helpers/_color-bg.scss +12 -0
- package/dist/types/components/banking/DPermissionGroup.d.ts +0 -11
- package/dist/types/components/banking/DPermissionItem.d.ts +0 -9
- package/dist/types/components/banking/DSummaryCard.d.ts +0 -12
- package/dist/types/components/banking/index.d.ts +0 -3
- package/dist/types/components/banking/interface.d.ts +0 -7
- package/src/style/components/_d-badge.scss +0 -26
- package/src/style/components/_d-permission-group.scss +0 -39
- /package/src/style/{components/_d-alert.scss → base/_alert.scss} +0 -0
- /package/src/style/{components/_d-collapse.scss → base/_collapse.scss} +0 -0
- /package/src/style/{components/_d-input-check.scss → base/_form-check.scss} +0 -0
- /package/src/style/{components/_d-input-switch.scss → base/_form-switch.scss} +0 -0
- /package/src/style/{components/_d-paginator.scss → base/_pagination.scss} +0 -0
- /package/src/style/{components/_d-progress.scss → base/_progress.scss} +0 -0
package/dist/index.js
CHANGED
|
@@ -19,36 +19,6 @@ var i18n = require('i18next');
|
|
|
19
19
|
var reactI18next = require('react-i18next');
|
|
20
20
|
var reactDom = require('react-dom');
|
|
21
21
|
|
|
22
|
-
function DBadge({ text, dot = false, theme = 'primary', id, className, style, }) {
|
|
23
|
-
const generateClasses = React.useMemo(() => ({
|
|
24
|
-
badge: true,
|
|
25
|
-
'badge-dot': dot,
|
|
26
|
-
[`badge-${theme}`]: !!theme,
|
|
27
|
-
}), [dot, theme]);
|
|
28
|
-
return (jsxRuntime.jsx("span", Object.assign({ className: classNames(generateClasses, className), style: style }, id && { id }, { children: jsxRuntime.jsx("span", { children: text }) })));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function DInputSwitch({ label, ariaLabel, id, name, checked, disabled, readonly, className, style, onChange, }) {
|
|
32
|
-
const [internalIsChecked, setInternalIsChecked] = React.useState(checked);
|
|
33
|
-
React.useEffect(() => {
|
|
34
|
-
setInternalIsChecked(checked);
|
|
35
|
-
}, [checked]);
|
|
36
|
-
const changeHandler = React.useCallback((event) => {
|
|
37
|
-
const value = event.currentTarget.checked;
|
|
38
|
-
setInternalIsChecked(value);
|
|
39
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
|
40
|
-
}, [onChange]);
|
|
41
|
-
return (jsxRuntime.jsxs("div", { className: "form-check form-switch", children: [jsxRuntime.jsx("input", { id: id, name: name, onChange: readonly ? () => false : changeHandler, className: classNames('form-check-input', className), style: style, type: "checkbox", role: "switch", checked: internalIsChecked, disabled: disabled, "aria-label": ariaLabel }), label && (jsxRuntime.jsx("label", { className: "form-check-label", htmlFor: id, children: label }))] }));
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function DPermissionItem({ permission, permissionState, onChange, onAction = () => { }, }) {
|
|
45
|
-
return (jsxRuntime.jsxs("div", { role: "button", tabIndex: 0, onKeyDown: () => { }, className: "d-flex permission-item align-items-center", onClick: onAction, children: [jsxRuntime.jsx("span", { className: "flex-grow-1 label", children: permission.label }), permission.type === 'custom' && (jsxRuntime.jsx(DBadge, { theme: "tertiary", text: permissionState })), jsxRuntime.jsx(DInputSwitch, { id: permission.id, checked: !!permission.value, disabled: !permission.enabled, onChange: (isChecked) => onChange(isChecked) })] }));
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function DPermissionGroup({ title, description, permissionState, permissionList, onChangePermission, onCustomAction = () => { }, }) {
|
|
49
|
-
return (jsxRuntime.jsxs("div", { className: "row operation-group g-0 mb-3 mb-lg-0", children: [jsxRuntime.jsxs("div", { className: "col-12 col-lg-4 d-flex flex-column justify-content-center", children: [jsxRuntime.jsx("h6", { className: "fw-bold mb-3 mb-lg-2", children: title }), jsxRuntime.jsx("p", { className: "fs-8 d-none d-lg-block m-0", children: description })] }), jsxRuntime.jsx("div", { className: "col-12 offset-lg-1 col-lg-7", children: permissionList.map((permission) => (jsxRuntime.jsx(DPermissionItem, { permission: permission, permissionState: permissionState, onChange: (checked) => onChangePermission(permission, checked), onAction: () => onCustomAction(permission) }, permission.id))) })] }));
|
|
50
|
-
}
|
|
51
|
-
|
|
52
22
|
const PREFIX_BS = 'bs-';
|
|
53
23
|
|
|
54
24
|
function DIconBase({ icon, theme, style, className, size = '1.5rem', loading = false, loadingDuration = 1.8, hasCircle = false, circleSize = `calc(var(--${PREFIX_BS}icon-component-size) * 1)`, color, backgroundColor, materialStyle = false, familyClass = 'bi', familyPrefix = 'bi-', }) {
|
|
@@ -146,7 +116,8 @@ function DContextProvider({ language = defaultState.language, currency = default
|
|
|
146
116
|
icon,
|
|
147
117
|
iconMap,
|
|
148
118
|
});
|
|
149
|
-
const
|
|
119
|
+
const setContext = React.useCallback((newValue) => (setInternalContext((prevInternalContext) => (Object.assign(Object.assign({}, prevInternalContext), newValue)))), []);
|
|
120
|
+
const value = React.useMemo(() => (Object.assign(Object.assign({}, internalContext), { setContext })), [internalContext, setContext]);
|
|
150
121
|
return (jsxRuntime.jsx(DContext.Provider, { value: value, children: children }));
|
|
151
122
|
}
|
|
152
123
|
function useDContext() {
|
|
@@ -313,10 +284,6 @@ function DIcon(_a) {
|
|
|
313
284
|
return (jsxRuntime.jsx(DIconBase, Object.assign({ familyClass: propFamilyClass || familyClass, familyPrefix: propFamilyPrefix || familyPrefix, materialStyle: propMaterialStyle || materialStyle }, props)));
|
|
314
285
|
}
|
|
315
286
|
|
|
316
|
-
function DSummaryCard({ title, description, icon, iconSize, iconTheme, Summary, }) {
|
|
317
|
-
return (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("h6", { className: "fw-bold fs-6", children: title }), jsxRuntime.jsx("p", { className: "fs-8", children: description }), jsxRuntime.jsxs("div", { className: "bg-white rounded p-4 d-flex gap-3 shadow-sm text-gray-700 fs-8", children: [jsxRuntime.jsx(DIcon, { icon: icon, theme: iconTheme, size: iconSize }), Summary] })] }));
|
|
318
|
-
}
|
|
319
|
-
|
|
320
287
|
function DAlert({ type = 'success', icon: iconProp, iconFamilyClass, iconFamilyPrefix, iconMaterialStyle = false, iconClose: iconCloseProp, iconCloseFamilyClass, iconCloseFamilyPrefix, iconCloseMaterialStyle = false, showIcon = true, soft = false, showClose, onClose, children, id, className, style, }) {
|
|
321
288
|
const { iconMap: { alert, xLg, }, } = useDContext();
|
|
322
289
|
const icon = React.useMemo(() => iconProp || alert[type], [alert, iconProp, type]);
|
|
@@ -326,6 +293,16 @@ function DAlert({ type = 'success', icon: iconProp, iconFamilyClass, iconFamilyP
|
|
|
326
293
|
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 }) }))] }));
|
|
327
294
|
}
|
|
328
295
|
|
|
296
|
+
function DBadge({ text, dot = false, soft = false, theme = 'primary', id, className, style, }) {
|
|
297
|
+
const generateClasses = React.useMemo(() => ({
|
|
298
|
+
badge: true,
|
|
299
|
+
'rounded-circle p-2': dot,
|
|
300
|
+
[`text-bg-${theme}`]: !!theme && !soft,
|
|
301
|
+
[`text-bg-soft-${theme}`]: !!theme && soft,
|
|
302
|
+
}), [dot, soft, theme]);
|
|
303
|
+
return (jsxRuntime.jsx("span", Object.assign({ className: classNames(generateClasses, className), style: style }, id && { id }, { children: jsxRuntime.jsx("span", { children: text }) })));
|
|
304
|
+
}
|
|
305
|
+
|
|
329
306
|
function DBoxFile(_a) {
|
|
330
307
|
var { icon: iconProp, iconFamilyClass, iconFamilyPrefix, iconMaterialStyle, disabled = false, children, className, style } = _a, dropzoneOptions = tslib.__rest(_a, ["icon", "iconFamilyClass", "iconFamilyPrefix", "iconMaterialStyle", "disabled", "children", "className", "style"]);
|
|
331
308
|
const { acceptedFiles, getRootProps, getInputProps, } = reactDropzone.useDropzone(Object.assign({ disabled }, dropzoneOptions));
|
|
@@ -919,6 +896,19 @@ function DInputSelect({ id, name, label = '', className, style, options = [], la
|
|
|
919
896
|
}), children: [iconStart && (jsxRuntime.jsx("button", { type: "button", className: "input-group-text", id: `${id}Start`, onClick: iconStartClickHandler, disabled: disabled || loading, "aria-label": iconStartAriaLabel, children: iconStart && (jsxRuntime.jsx(DIcon, { className: "d-input-icon", icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix })) })), dynamicComponent, iconEnd && !loading && (jsxRuntime.jsx("button", { type: "button", className: "input-group-text", id: `${id}End`, onClick: iconEndClickHandler, disabled: disabled || loading, "aria-label": iconEndAriaLabel, children: iconEnd && (jsxRuntime.jsx(DIcon, { className: "d-input-icon", icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix })) })), loading && (jsxRuntime.jsx("div", { className: "input-group-text form-control-icon loading", children: jsxRuntime.jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", children: jsxRuntime.jsx("span", { className: "visually-hidden", children: "Loading..." }) }) }))] }), hint && (jsxRuntime.jsx("div", { className: "form-text", id: `${id}Hint`, children: hint }))] })] }));
|
|
920
897
|
}
|
|
921
898
|
|
|
899
|
+
function DInputSwitch({ label, ariaLabel, id, name, checked, disabled, readonly, className, style, onChange, }) {
|
|
900
|
+
const [internalIsChecked, setInternalIsChecked] = React.useState(checked);
|
|
901
|
+
React.useEffect(() => {
|
|
902
|
+
setInternalIsChecked(checked);
|
|
903
|
+
}, [checked]);
|
|
904
|
+
const changeHandler = React.useCallback((event) => {
|
|
905
|
+
const value = event.currentTarget.checked;
|
|
906
|
+
setInternalIsChecked(value);
|
|
907
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
|
908
|
+
}, [onChange]);
|
|
909
|
+
return (jsxRuntime.jsxs("div", { className: "form-check form-switch", children: [jsxRuntime.jsx("input", { id: id, name: name, onChange: readonly ? () => false : changeHandler, className: classNames('form-check-input', className), style: style, type: "checkbox", role: "switch", checked: internalIsChecked, disabled: disabled, "aria-label": ariaLabel }), label && (jsxRuntime.jsx("label", { className: "form-check-label", htmlFor: id, children: label }))] }));
|
|
910
|
+
}
|
|
911
|
+
|
|
922
912
|
function DSelectOptionCheck(_a) {
|
|
923
913
|
var { innerProps, children, isSelected } = _a, props = tslib.__rest(_a, ["innerProps", "children", "isSelected"]);
|
|
924
914
|
return (jsxRuntime.jsx(Select.components.Option, Object.assign({ className: classNames({
|
|
@@ -1052,7 +1042,8 @@ function DModalHeader({ showCloseButton, onClose, children, className, style, ic
|
|
|
1052
1042
|
}
|
|
1053
1043
|
|
|
1054
1044
|
function DModalBody({ children, className, style, }) {
|
|
1055
|
-
|
|
1045
|
+
const generateStyleVariables = React.useMemo(() => (Object.assign(Object.assign({}, style), { [`--${PREFIX_BS}modal-component-body-padding`]: 0 })), [style]);
|
|
1046
|
+
return (jsxRuntime.jsx("div", { className: classNames('d-modal-slot modal-body', className), style: generateStyleVariables, children: children }));
|
|
1056
1047
|
}
|
|
1057
1048
|
|
|
1058
1049
|
function DModalFooter({ className, style, actionPlacement = 'fill', children, }) {
|
|
@@ -1444,8 +1435,6 @@ exports.DOffcanvasContextProvider = DOffcanvasContextProvider;
|
|
|
1444
1435
|
exports.DOffcanvasFooter = DOffcanvasFooter;
|
|
1445
1436
|
exports.DOffcanvasHeader = DOffcanvasHeader;
|
|
1446
1437
|
exports.DPaginator = DPaginator;
|
|
1447
|
-
exports.DPermissionGroup = DPermissionGroup;
|
|
1448
|
-
exports.DPermissionItem = DPermissionItem;
|
|
1449
1438
|
exports.DPopover = DPopover;
|
|
1450
1439
|
exports.DProgress = DProgress;
|
|
1451
1440
|
exports.DQuickActionButton = DQuickActionButton;
|
|
@@ -1457,7 +1446,6 @@ exports.DSkeleton = DSkeleton;
|
|
|
1457
1446
|
exports.DStepper = DStepper;
|
|
1458
1447
|
exports.DStepperDesktop = DStepper$2;
|
|
1459
1448
|
exports.DStepperMobile = DStepper$1;
|
|
1460
|
-
exports.DSummaryCard = DSummaryCard;
|
|
1461
1449
|
exports.DTabContent = DTabContent;
|
|
1462
1450
|
exports.DTabs = DTabs$1;
|
|
1463
1451
|
exports.DToastContainer = DToastContainer;
|