@dynamic-framework/ui-react 1.15.1 → 1.16.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/{LICENSE → LICENSE.md} +2 -2
- package/dist/css/dynamic-ui-non-root.css +1993 -2026
- package/dist/css/dynamic-ui-non-root.min.css +6 -1
- package/dist/css/dynamic-ui-root.css +6 -1
- package/dist/css/dynamic-ui-root.min.css +6 -1
- package/dist/css/dynamic-ui.css +1994 -2027
- package/dist/css/dynamic-ui.min.css +6 -1
- package/dist/index.esm.js +38 -47
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +36 -48
- package/dist/index.js.map +1 -1
- package/dist/js/bootstrap.bundle.js +8 -8
- package/dist/js/bootstrap.bundle.min.js +3 -3
- package/dist/js/bootstrap.esm.js +8 -8
- package/dist/js/bootstrap.esm.min.js +3 -3
- package/dist/js/bootstrap.js +8 -8
- package/dist/js/bootstrap.min.js +3 -3
- package/dist/types/components/DBadge/DBadge.d.ts +2 -1
- package/dist/types/components/DTabs/DTabs.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 +8 -6
- package/src/style/abstracts/variables/_+import.scss +1 -1
- package/src/style/abstracts/variables/_accordion.scss +14 -6
- package/src/style/abstracts/variables/_box-shadow.scss +1 -1
- package/src/style/abstracts/variables/_buttons.scss +3 -3
- package/src/style/abstracts/variables/_cards.scss +2 -2
- package/src/style/abstracts/variables/_close.scss +2 -2
- package/src/style/abstracts/variables/_dropdowns.scss +11 -7
- package/src/style/abstracts/variables/_forms.scss +23 -19
- package/src/style/abstracts/variables/_modals.scss +1 -5
- package/src/style/abstracts/variables/_navs.scss +2 -2
- package/src/style/base/_+import.scss +35 -1
- package/src/style/base/_accordion.scss +19 -0
- package/src/style/base/_breadcrumb.scss +10 -0
- package/src/style/{components/_d-button.scss → base/_button.scss} +15 -1
- package/src/style/base/_dropdown.scss +3 -0
- package/src/style/components/_+import.scss +0 -36
- package/src/style/components/_d-modal.scss +0 -5
- package/src/style/components/_d-tabs.scss +10 -19
- 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({
|
|
@@ -1048,15 +1038,15 @@ var DList$1 = Object.assign(DList, {
|
|
|
1048
1038
|
function DModalHeader({ showCloseButton, onClose, children, className, style, iconFamilyClass, iconFamilyPrefix, icon: iconProp, materialStyle = false, }) {
|
|
1049
1039
|
const { iconMap: { xLg, }, } = useDContext();
|
|
1050
1040
|
const icon = React.useMemo(() => iconProp || xLg, [iconProp, xLg]);
|
|
1051
|
-
return (jsxRuntime.jsxs("div", { className: classNames('modal-header', className), style: style, children: [jsxRuntime.jsx("div", {
|
|
1041
|
+
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-modal-close", "aria-label": "Close", onClick: onClose, children: jsxRuntime.jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: materialStyle }) }))] }));
|
|
1052
1042
|
}
|
|
1053
1043
|
|
|
1054
1044
|
function DModalBody({ children, className, style, }) {
|
|
1055
|
-
return (jsxRuntime.jsx("div", { className: classNames('
|
|
1045
|
+
return (jsxRuntime.jsx("div", { className: classNames('modal-body', className), style: style, children: children }));
|
|
1056
1046
|
}
|
|
1057
1047
|
|
|
1058
1048
|
function DModalFooter({ className, style, actionPlacement = 'fill', children, }) {
|
|
1059
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "d-modal-separator" }), jsxRuntime.jsx("div", { className: classNames(`
|
|
1049
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "d-modal-separator" }), jsxRuntime.jsx("div", { className: classNames(`modal-footer d-modal-action-${actionPlacement}`, className), style: style, children: children })] }));
|
|
1060
1050
|
}
|
|
1061
1051
|
|
|
1062
1052
|
function DModal({ name, className, style, staticBackdrop, scrollable, centered, fullScreen, fullScreenFrom, size, children, }) {
|
|
@@ -1085,15 +1075,15 @@ var DModal$1 = Object.assign(DModal, {
|
|
|
1085
1075
|
function DOffcanvasHeader({ showCloseButton, onClose, children, className, style, iconFamilyClass, iconFamilyPrefix, icon: iconProp, materialStyle = false, }) {
|
|
1086
1076
|
const { iconMap: { xLg, }, } = useDContext();
|
|
1087
1077
|
const icon = React.useMemo(() => iconProp || xLg, [iconProp, xLg]);
|
|
1088
|
-
return (jsxRuntime.jsxs("div", { className: classNames('offcanvas-header', className), style: style, children: [jsxRuntime.jsx("div", {
|
|
1078
|
+
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-offcanvas-close", "aria-label": "Close", onClick: onClose, children: jsxRuntime.jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: materialStyle }) }))] }));
|
|
1089
1079
|
}
|
|
1090
1080
|
|
|
1091
1081
|
function DOffcanvasBody({ children, className, style, }) {
|
|
1092
|
-
return (jsxRuntime.jsx("div", { className: classNames('
|
|
1082
|
+
return (jsxRuntime.jsx("div", { className: classNames('offcanvas-body', className), style: style, children: children }));
|
|
1093
1083
|
}
|
|
1094
1084
|
|
|
1095
1085
|
function DOffcanvasFooter({ footerActionPlacement = 'fill', children, className, style, }) {
|
|
1096
|
-
return (jsxRuntime.jsx("div", { className: classNames(`d-offcanvas-
|
|
1086
|
+
return (jsxRuntime.jsx("div", { className: classNames(`d-offcanvas-footer d-offcanvas-action-${footerActionPlacement}`, className), style: style, children: children }));
|
|
1097
1087
|
}
|
|
1098
1088
|
|
|
1099
1089
|
function DOffcanvas({ name, className, style, staticBackdrop, scrollable, openFrom = 'end', children, }) {
|
|
@@ -1343,7 +1333,7 @@ function DTabContent({ tab, children, className, style, }) {
|
|
|
1343
1333
|
return (jsxRuntime.jsx("div", { className: classNames('tab-pane fade show active', className), id: `${tab}Pane`, role: "tabpanel", tabIndex: 0, "aria-labelledby": `${tab}Tab`, style: style, children: children }));
|
|
1344
1334
|
}
|
|
1345
1335
|
|
|
1346
|
-
function DTabs({ children, defaultSelected, onChange, options, className, style, vertical, }) {
|
|
1336
|
+
function DTabs({ children, defaultSelected, onChange, options, className, style, vertical, pill, }) {
|
|
1347
1337
|
const [selected, setSelected] = React.useState(defaultSelected);
|
|
1348
1338
|
const onSelect = React.useCallback((option) => {
|
|
1349
1339
|
if (option.tab) {
|
|
@@ -1358,10 +1348,11 @@ function DTabs({ children, defaultSelected, onChange, options, className, style,
|
|
|
1358
1348
|
const value = React.useMemo(() => ({
|
|
1359
1349
|
isSelected,
|
|
1360
1350
|
}), [isSelected]);
|
|
1351
|
+
const generateClasses = React.useMemo(() => (Object.assign({ nav: true, 'flex-column align-items-center': vertical, 'nav-pills': pill, 'nav-tabs': !pill }, className && { [className]: true })), [vertical, pill, className]);
|
|
1361
1352
|
return (jsxRuntime.jsx(TabContext.Provider, { value: value, children: jsxRuntime.jsxs("div", { className: classNames({
|
|
1362
|
-
'd-
|
|
1363
|
-
'
|
|
1364
|
-
}, className), style: style, children: [jsxRuntime.jsx("nav", { className:
|
|
1353
|
+
'd-flex': true,
|
|
1354
|
+
'flex-column': !vertical,
|
|
1355
|
+
}, className), style: style, children: [jsxRuntime.jsx("nav", { className: classNames(generateClasses), children: options.map((option) => (jsxRuntime.jsx("button", { id: `${option.tab}Tab`, className: classNames('nav-link', {
|
|
1365
1356
|
active: option.tab === selected,
|
|
1366
1357
|
}, className), type: "button", role: "tab", "aria-controls": `${option.tab}Pane`, "aria-selected": option.tab === selected, disabled: option.disabled, onClick: () => onSelect(option), children: option.label }, option.label))) }), jsxRuntime.jsx("div", { className: "tab-content", children: children })] }) }));
|
|
1367
1358
|
}
|
|
@@ -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;
|