@norges-domstoler/dds-components 0.0.0-dev-20240402105918 → 0.0.0-dev-20240404072551

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.js CHANGED
@@ -3920,6 +3920,26 @@ var getAppearanceAndPurposeStyling = (appearance, purpose) => {
3920
3920
  return import_styled_components15.css`
3921
3921
  background-color: ${appearances2[appearance].purpose[purpose].base.backgroundColor};
3922
3922
  border-color: ${appearances2[appearance].purpose[purpose].base.borderColor};
3923
+ `;
3924
+ case "ghost":
3925
+ return import_styled_components15.css`
3926
+ background-color: ${appearances2.ghost.base.backgroundColor};
3927
+ border-color: ${appearances2.ghost.purpose[purpose].base.borderColor};
3928
+ `;
3929
+ case "borderless":
3930
+ return import_styled_components15.css`
3931
+ background-color: ${appearances2.borderless.base.backgroundColor};
3932
+ border-color: ${appearances2.borderless.base.borderColor};
3933
+ text-decoration: ${appearances2.borderless.base.textDecoration};
3934
+ text-decoration-color: ${appearances2.borderless.base.textDecorationColor};
3935
+ `;
3936
+ }
3937
+ };
3938
+ var getAppearanceAndPurposeStateStyling = (appearance, purpose) => {
3939
+ switch (appearance) {
3940
+ case "filled":
3941
+ case "rounded":
3942
+ return import_styled_components15.css`
3923
3943
  &:hover {
3924
3944
  background-color: ${appearances2[appearance].purpose[purpose].hover.backgroundColor};
3925
3945
  border-color: ${appearances2[appearance].purpose[purpose].hover.borderColor};
@@ -3931,8 +3951,6 @@ var getAppearanceAndPurposeStyling = (appearance, purpose) => {
3931
3951
  `;
3932
3952
  case "ghost":
3933
3953
  return import_styled_components15.css`
3934
- background-color: ${appearances2.ghost.base.backgroundColor};
3935
- border-color: ${appearances2.ghost.purpose[purpose].base.borderColor};
3936
3954
  &:hover {
3937
3955
  color: ${appearances2.ghost.purpose[purpose].hover.color};
3938
3956
  border-color: ${appearances2.ghost.purpose[purpose].hover.borderColor};
@@ -3946,10 +3964,6 @@ var getAppearanceAndPurposeStyling = (appearance, purpose) => {
3946
3964
  `;
3947
3965
  case "borderless":
3948
3966
  return import_styled_components15.css`
3949
- background-color: ${appearances2.borderless.base.backgroundColor};
3950
- border-color: ${appearances2.borderless.base.borderColor};
3951
- text-decoration: ${appearances2.borderless.base.textDecoration};
3952
- text-decoration-color: ${appearances2.borderless.base.textDecorationColor};
3953
3967
  &:hover {
3954
3968
  color: ${appearances2.borderless.purpose[purpose].hover.color};
3955
3969
  text-decoration-color: ${appearances2.borderless.purpose[purpose].hover.textDecorationColor};
@@ -4004,8 +4018,9 @@ var ButtonWrapper = import_styled_components15.default.button.withConfig({
4004
4018
  color: ${appearances2[appearance].purpose[purpose].base.color};
4005
4019
  ${getAppearanceAndPurposeStyling(appearance, purpose)}
4006
4020
  `}
4021
+ ${({ appearance, purpose, isLoading }) => !isLoading && getAppearanceAndPurposeStateStyling(appearance, purpose)}
4007
4022
 
4008
- ${({ hasIcon, hasLabel, appearance, purpose }) => hasIcon && !hasLabel && appearance === "borderless" && import_styled_components15.css`
4023
+ ${({ hasIcon, hasLabel, appearance, purpose, isLoading }) => hasIcon && !hasLabel && !isLoading && appearance === "borderless" && import_styled_components15.css`
4009
4024
  &:hover {
4010
4025
  border-color: ${appearances2[appearance].purpose[purpose].icon.hover.borderColor};
4011
4026
  box-shadow: ${appearances2[appearance].purpose[purpose].icon.hover.boxShadow};
@@ -4015,7 +4030,7 @@ var ButtonWrapper = import_styled_components15.default.button.withConfig({
4015
4030
  box-shadow: ${appearances2[appearance].purpose[purpose].icon.active.boxShadow};
4016
4031
  }
4017
4032
  `}
4018
- ${({ hasIcon, hasLabel, size: size2 }) => hasIcon && hasLabel && import_styled_components15.css`
4033
+ ${({ hasIcon, hasLabel, size: size2 }) => hasIcon && hasLabel && import_styled_components15.css`
4019
4034
  gap: ${sizes2[size2].textAndIcon.gap};
4020
4035
  `}
4021
4036