@dynamic-framework/ui-react 1.17.1 → 1.18.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 +3 -6
- package/dist/css/dynamic-ui-non-root.min.css +2 -2
- package/dist/css/dynamic-ui-root.css +4 -1
- package/dist/css/dynamic-ui-root.min.css +2 -2
- package/dist/css/dynamic-ui.css +6 -6
- package/dist/css/dynamic-ui.min.css +2 -2
- package/dist/index.esm.js +2 -12
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -12
- package/dist/index.js.map +1 -1
- package/dist/types/components/DButton/DButton.d.ts +1 -1
- package/package.json +2 -2
- package/src/style/abstracts/variables/_buttons.scss +3 -3
- package/src/style/base/_button.scss +0 -5
- package/src/style/root/_root.scss +4 -0
package/dist/index.js
CHANGED
|
@@ -317,23 +317,13 @@ function DBoxFile(_a) {
|
|
|
317
317
|
}), { children: [jsxRuntime.jsx("input", Object.assign({}, getInputProps())), jsxRuntime.jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: iconMaterialStyle }), jsxRuntime.jsx("div", { className: "d-box-content", children: children })] })), !!acceptedFiles.length && (jsxRuntime.jsx("aside", { className: "d-box-files", children: acceptedFiles.map((file) => (jsxRuntime.jsx("div", { className: "d-box-files-text", children: `${file.name} - ${file.size} bytes` }, file.name))) }))] }));
|
|
318
318
|
}
|
|
319
319
|
|
|
320
|
-
function DButton({ theme = 'primary', size, variant, state, text = '', ariaLabel, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconStartMaterialStyle, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, iconEndMaterialStyle, value, type = 'button',
|
|
320
|
+
function DButton({ theme = 'primary', size, variant, state, text = '', ariaLabel, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconStartMaterialStyle, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, iconEndMaterialStyle, value, type = 'button', loading = false, loadingAriaLabel, disabled = false, stopPropagationEnabled = true, className, style, form, onClick, }) {
|
|
321
321
|
const generateClasses = React.useMemo(() => {
|
|
322
322
|
const variantClass = variant
|
|
323
323
|
? `btn-${variant}-${theme}`
|
|
324
324
|
: `btn-${theme}`;
|
|
325
325
|
return Object.assign(Object.assign(Object.assign({ btn: true, [variantClass]: true }, size && { [`btn-${size}`]: true }), (state && state !== 'disabled') && { [state]: true }), { loading });
|
|
326
326
|
}, [variant, theme, size, state, loading]);
|
|
327
|
-
const generateStyleVariables = React.useMemo(() => {
|
|
328
|
-
if (pill) {
|
|
329
|
-
return {
|
|
330
|
-
[`--${PREFIX_BS}btn-component-border-radius`]: `var(--${PREFIX_BS}border-radius-pill)`,
|
|
331
|
-
[`--${PREFIX_BS}btn-component-lg-border-radius`]: `var(--${PREFIX_BS}border-radius-pill)`,
|
|
332
|
-
[`--${PREFIX_BS}btn-component-sm-border-radius`]: `var(--${PREFIX_BS}border-radius-pill)`,
|
|
333
|
-
};
|
|
334
|
-
}
|
|
335
|
-
return {};
|
|
336
|
-
}, [pill]);
|
|
337
327
|
const clickHandler = React.useCallback((event) => {
|
|
338
328
|
if (stopPropagationEnabled) {
|
|
339
329
|
event.stopPropagation();
|
|
@@ -344,7 +334,7 @@ function DButton({ theme = 'primary', size, variant, state, text = '', ariaLabel
|
|
|
344
334
|
const newAriaLabel = React.useMemo(() => (loading
|
|
345
335
|
? (loadingAriaLabel || ariaLabel || text)
|
|
346
336
|
: (ariaLabel || text)), [loading, loadingAriaLabel, ariaLabel, text]);
|
|
347
|
-
return (jsxRuntime.jsxs("button", Object.assign({ className: classNames(generateClasses, className), style:
|
|
337
|
+
return (jsxRuntime.jsxs("button", Object.assign({ className: classNames(generateClasses, className), style: style, type: type, disabled: isDisabled, onClick: clickHandler, "aria-label": newAriaLabel, form: form }, value && { value }, { children: [iconStart && (jsxRuntime.jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix, materialStyle: iconStartMaterialStyle })), (text && !loading) && (jsxRuntime.jsx("span", { children: text })), loading && (jsxRuntime.jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", children: jsxRuntime.jsx("span", { className: "visually-hidden", children: "Loading..." }) })), iconEnd && (jsxRuntime.jsx(DIcon, { icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix, materialStyle: iconEndMaterialStyle }))] })));
|
|
348
338
|
}
|
|
349
339
|
|
|
350
340
|
function DCardHeader({ className, style, children, }) {
|