@norges-domstoler/dds-components 22.7.0 → 22.7.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/dist/index.js CHANGED
@@ -8401,7 +8401,7 @@ var ErrorSummary = ({
8401
8401
  props
8402
8402
  ),
8403
8403
  background: "surface-danger-default",
8404
- padding: "x1 x0.75 x1.5 x1",
8404
+ padding: "x1 x0.75 x0.25 x1",
8405
8405
  children: [
8406
8406
  heading,
8407
8407
  /* @__PURE__ */ (0, import_jsx_runtime267.jsx)(List, { children })
@@ -11070,6 +11070,7 @@ var optionTypography = {
11070
11070
  letterSpacing: "var(--dds-font-body-short-xsmall-letter-spacing)"
11071
11071
  }
11072
11072
  };
11073
+ var controlTypography = optionTypography;
11073
11074
  var multiValueLabelTypography = {
11074
11075
  medium: {
11075
11076
  font: "var(--dds-font-body-short-small)",
@@ -11090,22 +11091,12 @@ var groupHeadingTypography = {
11090
11091
  };
11091
11092
  var typography = {
11092
11093
  option: optionTypography,
11094
+ control: controlTypography,
11093
11095
  multiValueLabel: multiValueLabelTypography,
11094
11096
  groupHeading: groupHeadingTypography
11095
11097
  };
11096
11098
  var prefix = "dds-select";
11097
- var control = {
11098
- medium: {
11099
- ...optionTypography.medium
11100
- },
11101
- small: {
11102
- ...optionTypography.small
11103
- },
11104
- xsmall: {
11105
- ...optionTypography.xsmall
11106
- }
11107
- };
11108
- var getCustomStyles = (size2, hasError, hasIcon, isReadOnly) => ({
11099
+ var getCustomStyles = (size2, hasError, isReadOnly) => ({
11109
11100
  control: (provided, state) => ({
11110
11101
  position: "relative",
11111
11102
  display: "flex",
@@ -11117,7 +11108,7 @@ var getCustomStyles = (size2, hasError, hasIcon, isReadOnly) => ({
11117
11108
  borderColor: "var(--dds-color-border-default)",
11118
11109
  backgroundColor: "var(--dds-color-surface-default)",
11119
11110
  transition: `box-shadow var(--dds-motion-micro-state), border-color var(--dds-motion-micro-state), ${focusVisibleTransitionValue}`,
11120
- ...control[size2],
11111
+ ...typography.control[size2],
11121
11112
  "&:hover": {
11122
11113
  ...!isReadOnly && {
11123
11114
  borderColor: "var(--dds-color-border-action-hover)",
@@ -11263,7 +11254,7 @@ var getCustomStyles = (size2, hasError, hasIcon, isReadOnly) => ({
11263
11254
  gap: "var(--dds-spacing-x0-25)",
11264
11255
  padding: "var(--dds-spacing-x0-75)",
11265
11256
  backgroundColor: "var(--dds-color-surface-default)",
11266
- ...typography.option.medium,
11257
+ ...typography.option[size2],
11267
11258
  color: "var(--dds-color-text-default)",
11268
11259
  "@media (prefers-reduced-motion: no-preference)": {
11269
11260
  transition: "color var(--dds-motion-micro-state), background-color var(--dds-motion-micro-state)"
@@ -11459,7 +11450,6 @@ function Select({
11459
11450
  const uniqueId = id != null ? id : `${generatedId}-select`;
11460
11451
  const singleValueId = !isMulti ? `${uniqueId}-singleValue` : void 0;
11461
11452
  const hasErrorMessage = !!errorMessage;
11462
- const hasIcon = !!icon;
11463
11453
  const showRequiredStyling = !!(rest.required || ariaRequired);
11464
11454
  const tipId = derivativeIdGenerator(uniqueId, "tip");
11465
11455
  const errorMessageId = derivativeIdGenerator(uniqueId, "errorMessage");
@@ -11542,12 +11532,7 @@ function Select({
11542
11532
  name: uniqueId,
11543
11533
  menuPortalTarget: portalTarget,
11544
11534
  classNamePrefix: prefix,
11545
- styles: getCustomStyles(
11546
- componentSize,
11547
- hasErrorMessage,
11548
- hasIcon,
11549
- readOnly
11550
- ),
11535
+ styles: getCustomStyles(componentSize, hasErrorMessage, readOnly),
11551
11536
  filterOption: (option, inputValue) => {
11552
11537
  const { label: label2 } = option;
11553
11538
  return searchFilter(label2, inputValue) || inputValue === "";