@norges-domstoler/dds-components 0.0.0-dev-20260119083800 → 0.0.0-dev-20260120080949
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/index.d.mts +4 -8
- package/dist/index.d.ts +4 -8
- package/dist/index.js +22 -42
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -42
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -3982,12 +3982,11 @@ var useButtonGroupContext = () => useContext4(ButtonGroupContext);
|
|
|
3982
3982
|
// src/components/Button/Button.tsx
|
|
3983
3983
|
import { Fragment as Fragment2, jsx as jsx198, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3984
3984
|
var Button = ({
|
|
3985
|
+
as: propAs,
|
|
3985
3986
|
children,
|
|
3986
3987
|
purpose = "primary",
|
|
3987
3988
|
size: size2 = "medium",
|
|
3988
3989
|
iconPosition = "left",
|
|
3989
|
-
href,
|
|
3990
|
-
target,
|
|
3991
3990
|
loading,
|
|
3992
3991
|
loadingTooltip,
|
|
3993
3992
|
fullWidth = false,
|
|
@@ -4000,7 +3999,7 @@ var Button = ({
|
|
|
4000
3999
|
ref,
|
|
4001
4000
|
className,
|
|
4002
4001
|
style,
|
|
4003
|
-
htmlProps
|
|
4002
|
+
htmlProps,
|
|
4004
4003
|
...props
|
|
4005
4004
|
}) => {
|
|
4006
4005
|
var _a;
|
|
@@ -4054,46 +4053,27 @@ var Button = ({
|
|
|
4054
4053
|
] });
|
|
4055
4054
|
const rest = props;
|
|
4056
4055
|
const { disabled: restDisabled, ...restFinal } = rest;
|
|
4057
|
-
const htmlDisabled = htmlProps.disabled;
|
|
4056
|
+
const htmlDisabled = htmlProps == null ? void 0 : htmlProps.disabled;
|
|
4058
4057
|
const isDisabled = ((_a = restDisabled != null ? restDisabled : htmlDisabled) != null ? _a : loading) === true;
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
id,
|
|
4079
|
-
buttonCn,
|
|
4080
|
-
style,
|
|
4081
|
-
//TODO: fikse types ordentlig
|
|
4082
|
-
htmlProps,
|
|
4083
|
-
props
|
|
4084
|
-
),
|
|
4085
|
-
onClick: loading ? void 0 : (
|
|
4086
|
-
//TODO: fikse types ordentlig
|
|
4087
|
-
onClick
|
|
4088
|
-
),
|
|
4089
|
-
onFocus,
|
|
4090
|
-
onBlur,
|
|
4091
|
-
href,
|
|
4092
|
-
rel: "noreferrer noopener",
|
|
4093
|
-
target,
|
|
4094
|
-
children: content
|
|
4095
|
-
}
|
|
4096
|
-
);
|
|
4058
|
+
const as = propAs ? propAs : "button";
|
|
4059
|
+
const isAnchor = as === "a";
|
|
4060
|
+
const aProps = isAnchor ? {
|
|
4061
|
+
rel: "noopener noreferrer"
|
|
4062
|
+
} : {};
|
|
4063
|
+
return /* @__PURE__ */ jsx198(
|
|
4064
|
+
ElementAs,
|
|
4065
|
+
{
|
|
4066
|
+
as,
|
|
4067
|
+
ref,
|
|
4068
|
+
...getBaseHTMLProps(id, buttonCn, style, htmlProps, restFinal),
|
|
4069
|
+
onClick,
|
|
4070
|
+
onFocus,
|
|
4071
|
+
onBlur,
|
|
4072
|
+
disabled: isDisabled,
|
|
4073
|
+
...aProps,
|
|
4074
|
+
children: content
|
|
4075
|
+
}
|
|
4076
|
+
);
|
|
4097
4077
|
};
|
|
4098
4078
|
Button.displayName = "Button";
|
|
4099
4079
|
var texts2 = createTexts({
|