@norges-domstoler/dds-components 11.0.0 → 11.1.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.
@@ -3,10 +3,18 @@ export type DescriptionListAppearance = 'small' | 'bold';
3
3
  export type DescriptionListProps = BaseComponentPropsWithChildren<HTMLDListElement, {
4
4
  /**Påvirker tekst styling. */
5
5
  appearance?: DescriptionListAppearance;
6
+ /**Setter flex-direction. NB! Fungerer kun ved bruk av `DescriptionListGroup` som barn av `DescriptionList`.
7
+ * @default "column"
8
+ */
9
+ direction?: 'row' | 'column';
6
10
  }>;
7
11
  export declare const DescriptionList: import("react").ForwardRefExoticComponent<Pick<import("react").HTMLAttributes<HTMLDListElement>, "id" | "className"> & {
8
12
  /**Påvirker tekst styling. */
9
13
  appearance?: DescriptionListAppearance | undefined;
14
+ /**Setter flex-direction. NB! Fungerer kun ved bruk av `DescriptionListGroup` som barn av `DescriptionList`.
15
+ * @default "column"
16
+ */
17
+ direction?: "row" | "column" | undefined;
10
18
  } & {
11
19
  children?: import("react").ReactNode;
12
20
  } & {
@@ -3,6 +3,7 @@ declare const _default: {
3
3
  title: string;
4
4
  component: import("react").ForwardRefExoticComponent<Pick<import("react").HTMLAttributes<HTMLDListElement>, "id" | "className"> & {
5
5
  appearance?: import("./DescriptionList").DescriptionListAppearance | undefined;
6
+ direction?: "row" | "column" | undefined;
6
7
  } & {
7
8
  children?: import("react").ReactNode;
8
9
  } & {
@@ -14,4 +15,4 @@ export declare const Overview: () => JSX.Element;
14
15
  export declare const Default: (args: DescriptionListProps) => JSX.Element;
15
16
  export declare const Group: (args: DescriptionListProps) => JSX.Element;
16
17
  export declare const WithIcon: (args: DescriptionListProps) => JSX.Element;
17
- export declare const ColumnExample: (args: DescriptionListProps) => JSX.Element;
18
+ export declare const RowDirectionExample: (args: DescriptionListProps) => JSX.Element;
@@ -31,6 +31,9 @@ export declare const descriptionListTokens: {
31
31
  beforeNextTerm: {
32
32
  marginTop: string;
33
33
  };
34
+ rowDirection: {
35
+ columnGap: string;
36
+ };
34
37
  };
35
38
  group: {
36
39
  base: {
@@ -3,10 +3,18 @@ import { BaseComponentPropsWithChildren } from '../../types';
3
3
  export type DescriptionListGroupProps = BaseComponentPropsWithChildren<HTMLDivElement, {
4
4
  /**Custom margin. */
5
5
  margin?: Property.Margin<string>;
6
+ /**Custom min-width. */
7
+ minWidth?: Property.MinWidth<string>;
8
+ /**Custom max-width. */
9
+ maxWidth?: Property.MaxWidth<string>;
6
10
  }>;
7
11
  export declare const DescriptionListGroup: import("react").ForwardRefExoticComponent<Pick<import("react").HTMLAttributes<HTMLDivElement>, "id" | "className"> & {
8
12
  /**Custom margin. */
9
13
  margin?: Property.Margin<string> | undefined;
14
+ /**Custom min-width. */
15
+ minWidth?: Property.MinWidth<string> | undefined;
16
+ /**Custom max-width. */
17
+ maxWidth?: Property.MaxWidth<string> | undefined;
10
18
  } & {
11
19
  children?: import("react").ReactNode;
12
20
  } & {
@@ -12,5 +12,5 @@ export declare const InputMessage: import("react").ForwardRefExoticComponent<Pic
12
12
  /** Formålet med meldingen. Påvirker styling. */
13
13
  messageType: InputMessageType;
14
14
  } & {
15
- htmlProps?: import("react").HTMLAttributes<HTMLDivElement> | undefined; /** Meldingen som vises til brukeren. */
15
+ htmlProps?: import("react").HTMLAttributes<HTMLDivElement> | undefined;
16
16
  } & import("react").RefAttributes<HTMLDivElement>>;
package/dist/cjs/index.js CHANGED
@@ -2069,7 +2069,7 @@ var InputMessageWrapper = styled__default.default.div.withConfig({
2069
2069
  componentId: "sc-c954fy-0"
2070
2070
  })(["display:flex;width:fit-content;word-break:break-word;max-width:100%;", " svg{margin-top:", ";}"], function (_ref) {
2071
2071
  var messageType = _ref.messageType;
2072
- return messageType === 'tip' ? styled.css(["background-color:", ";"], inputMessageTokens.message.tip.backgroundColor) : messageType === 'error' ? styled.css(["color:", ";background-color:", ";padding:", ";gap:", ";"], inputMessageTokens.message.error.color, inputMessageTokens.message.error.backgroundColor, inputMessageTokens.message.error.padding, inputMessageTokens.message.error.gap) : '';
2072
+ return messageType === 'error' ? styled.css(["color:", ";background-color:", ";padding:", ";gap:", ";"], inputMessageTokens.message.error.color, inputMessageTokens.message.error.backgroundColor, inputMessageTokens.message.error.padding, inputMessageTokens.message.error.gap) : '';
2073
2073
  }, inputMessageTokens.icon.marginTop);
2074
2074
  var InputMessage = /*#__PURE__*/React.forwardRef(function (props, ref) {
2075
2075
  var message = props.message,
@@ -6399,6 +6399,9 @@ var desc$1 = {
6399
6399
  var list$7 = {
6400
6400
  beforeNextTerm: {
6401
6401
  marginTop: spacing$n.SizesDdsSpacingLocalX2
6402
+ },
6403
+ rowDirection: {
6404
+ columnGap: spacing$n.SizesDdsSpacingLocalX2
6402
6405
  }
6403
6406
  };
6404
6407
  var group$2 = {
@@ -6419,20 +6422,27 @@ var term = descriptionListTokens.term,
6419
6422
  var DList = styled__default.default.dl.withConfig({
6420
6423
  displayName: "DescriptionList__DList",
6421
6424
  componentId: "sc-1ob73hm-0"
6422
- })(["margin:0;*::selection{", "}", " & > dt:first-of-type{margin-top:", ";}& > dd:last-child{margin-bottom:", ";}dd + dt{margin-top:", ";}"], selection, function (_ref) {
6425
+ })(["margin:0;*::selection{", "}", " display:flex;flex-direction:column;&:not(:has(> dt):has(> dd)){flex-direction:", ";}flex-wrap:wrap;column-gap:", ";row-gap:0;& > dt:first-of-type{margin-top:", ";}& > dd:last-child{margin-bottom:", ";}dd + dt{margin-top:", ";}"], selection, function (_ref) {
6423
6426
  var appearance = _ref.appearance;
6424
6427
  return appearance && styled.css(["dt{color:", ";", " ", "}"], term.appearance[appearance].color, getFontStyling(termTypographyTypes[appearance]), appearance === 'bold' && styled.css(["font-weight:600;"]));
6425
- }, term.firstOfType.marginTop, desc.lastChild.marginBottom, list$6.beforeNextTerm.marginTop);
6428
+ }, function (_ref2) {
6429
+ var _ref2$direction = _ref2.direction,
6430
+ direction = _ref2$direction === void 0 ? 'column' : _ref2$direction;
6431
+ return direction;
6432
+ }, list$6.rowDirection.columnGap, term.firstOfType.marginTop, desc.lastChild.marginBottom, list$6.beforeNextTerm.marginTop);
6426
6433
  var DescriptionList = /*#__PURE__*/React.forwardRef(function (props, ref) {
6427
6434
  var _props$appearance = props.appearance,
6428
6435
  appearance = _props$appearance === void 0 ? 'bold' : _props$appearance,
6436
+ _props$direction = props.direction,
6437
+ direction = _props$direction === void 0 ? 'column' : _props$direction,
6429
6438
  children = props.children,
6430
6439
  id = props.id,
6431
6440
  className = props.className,
6432
6441
  htmlProps = props.htmlProps,
6433
- rest = tslib.__rest(props, ["appearance", "children", "id", "className", "htmlProps"]);
6442
+ rest = tslib.__rest(props, ["appearance", "direction", "children", "id", "className", "htmlProps"]);
6434
6443
  var dListProps = Object.assign(Object.assign({}, getBaseHTMLProps(id, className, htmlProps, rest)), {
6435
6444
  appearance: appearance,
6445
+ direction: direction,
6436
6446
  ref: ref
6437
6447
  });
6438
6448
  return jsxRuntime.jsx(DList, Object.assign({}, dListProps, {
@@ -6480,21 +6490,31 @@ var DescriptionListDesc = /*#__PURE__*/React.forwardRef(function (props, ref) {
6480
6490
  var DListGroup = styled__default.default.div.withConfig({
6481
6491
  displayName: "DescriptionListGroup__DListGroup",
6482
6492
  componentId: "sc-jkdc0o-0"
6483
- })(["margin:", ";"], function (_ref) {
6493
+ })(["margin:", ";", " ", ""], function (_ref) {
6484
6494
  var margin = _ref.margin;
6485
6495
  return margin ? margin : descriptionListTokens.group.base.margin;
6496
+ }, function (_ref2) {
6497
+ var minWidth = _ref2.minWidth;
6498
+ return minWidth && "min-width: ".concat(minWidth);
6499
+ }, function (_ref3) {
6500
+ var maxWidth = _ref3.maxWidth;
6501
+ return maxWidth && "max-width: ".concat(maxWidth);
6486
6502
  });
6487
6503
  var DescriptionListGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
6488
6504
  var children = props.children,
6489
6505
  margin = props.margin,
6506
+ minWidth = props.minWidth,
6507
+ maxWidth = props.maxWidth,
6490
6508
  id = props.id,
6491
6509
  className = props.className,
6492
6510
  htmlProps = props.htmlProps,
6493
- rest = tslib.__rest(props, ["children", "margin", "id", "className", "htmlProps"]);
6511
+ rest = tslib.__rest(props, ["children", "margin", "minWidth", "maxWidth", "id", "className", "htmlProps"]);
6494
6512
  var dListGroupProps = Object.assign(Object.assign({}, getBaseHTMLProps(id, className, htmlProps, rest)), {
6495
6513
  children: children,
6496
6514
  ref: ref,
6497
- margin: margin
6515
+ margin: margin,
6516
+ minWidth: minWidth,
6517
+ maxWidth: maxWidth
6498
6518
  });
6499
6519
  return jsxRuntime.jsx(DListGroup, Object.assign({}, dListGroupProps, {
6500
6520
  children: children
@@ -3,10 +3,18 @@ export type DescriptionListAppearance = 'small' | 'bold';
3
3
  export type DescriptionListProps = BaseComponentPropsWithChildren<HTMLDListElement, {
4
4
  /**Påvirker tekst styling. */
5
5
  appearance?: DescriptionListAppearance;
6
+ /**Setter flex-direction. NB! Fungerer kun ved bruk av `DescriptionListGroup` som barn av `DescriptionList`.
7
+ * @default "column"
8
+ */
9
+ direction?: 'row' | 'column';
6
10
  }>;
7
11
  export declare const DescriptionList: import("react").ForwardRefExoticComponent<Pick<import("react").HTMLAttributes<HTMLDListElement>, "id" | "className"> & {
8
12
  /**Påvirker tekst styling. */
9
13
  appearance?: DescriptionListAppearance | undefined;
14
+ /**Setter flex-direction. NB! Fungerer kun ved bruk av `DescriptionListGroup` som barn av `DescriptionList`.
15
+ * @default "column"
16
+ */
17
+ direction?: "row" | "column" | undefined;
10
18
  } & {
11
19
  children?: import("react").ReactNode;
12
20
  } & {
@@ -17,20 +17,27 @@ var term = descriptionListTokens.term,
17
17
  var DList = styled.dl.withConfig({
18
18
  displayName: "DescriptionList__DList",
19
19
  componentId: "sc-1ob73hm-0"
20
- })(["margin:0;*::selection{", "}", " & > dt:first-of-type{margin-top:", ";}& > dd:last-child{margin-bottom:", ";}dd + dt{margin-top:", ";}"], selection, function (_ref) {
20
+ })(["margin:0;*::selection{", "}", " display:flex;flex-direction:column;&:not(:has(> dt):has(> dd)){flex-direction:", ";}flex-wrap:wrap;column-gap:", ";row-gap:0;& > dt:first-of-type{margin-top:", ";}& > dd:last-child{margin-bottom:", ";}dd + dt{margin-top:", ";}"], selection, function (_ref) {
21
21
  var appearance = _ref.appearance;
22
22
  return appearance && css(["dt{color:", ";", " ", "}"], term.appearance[appearance].color, getFontStyling(termTypographyTypes[appearance]), appearance === 'bold' && css(["font-weight:600;"]));
23
- }, term.firstOfType.marginTop, desc.lastChild.marginBottom, list.beforeNextTerm.marginTop);
23
+ }, function (_ref2) {
24
+ var _ref2$direction = _ref2.direction,
25
+ direction = _ref2$direction === void 0 ? 'column' : _ref2$direction;
26
+ return direction;
27
+ }, list.rowDirection.columnGap, term.firstOfType.marginTop, desc.lastChild.marginBottom, list.beforeNextTerm.marginTop);
24
28
  var DescriptionList = /*#__PURE__*/forwardRef(function (props, ref) {
25
29
  var _props$appearance = props.appearance,
26
30
  appearance = _props$appearance === void 0 ? 'bold' : _props$appearance,
31
+ _props$direction = props.direction,
32
+ direction = _props$direction === void 0 ? 'column' : _props$direction,
27
33
  children = props.children,
28
34
  id = props.id,
29
35
  className = props.className,
30
36
  htmlProps = props.htmlProps,
31
- rest = __rest(props, ["appearance", "children", "id", "className", "htmlProps"]);
37
+ rest = __rest(props, ["appearance", "direction", "children", "id", "className", "htmlProps"]);
32
38
  var dListProps = Object.assign(Object.assign({}, getBaseHTMLProps(id, className, htmlProps, rest)), {
33
39
  appearance: appearance,
40
+ direction: direction,
34
41
  ref: ref
35
42
  });
36
43
  return jsx(DList, Object.assign({}, dListProps, {
@@ -3,6 +3,7 @@ declare const _default: {
3
3
  title: string;
4
4
  component: import("react").ForwardRefExoticComponent<Pick<import("react").HTMLAttributes<HTMLDListElement>, "id" | "className"> & {
5
5
  appearance?: import("./DescriptionList").DescriptionListAppearance | undefined;
6
+ direction?: "row" | "column" | undefined;
6
7
  } & {
7
8
  children?: import("react").ReactNode;
8
9
  } & {
@@ -14,4 +15,4 @@ export declare const Overview: () => JSX.Element;
14
15
  export declare const Default: (args: DescriptionListProps) => JSX.Element;
15
16
  export declare const Group: (args: DescriptionListProps) => JSX.Element;
16
17
  export declare const WithIcon: (args: DescriptionListProps) => JSX.Element;
17
- export declare const ColumnExample: (args: DescriptionListProps) => JSX.Element;
18
+ export declare const RowDirectionExample: (args: DescriptionListProps) => JSX.Element;
@@ -31,6 +31,9 @@ export declare const descriptionListTokens: {
31
31
  beforeNextTerm: {
32
32
  marginTop: string;
33
33
  };
34
+ rowDirection: {
35
+ columnGap: string;
36
+ };
34
37
  };
35
38
  group: {
36
39
  base: {
@@ -32,6 +32,9 @@ var desc = {
32
32
  var list = {
33
33
  beforeNextTerm: {
34
34
  marginTop: spacing.SizesDdsSpacingLocalX2
35
+ },
36
+ rowDirection: {
37
+ columnGap: spacing.SizesDdsSpacingLocalX2
35
38
  }
36
39
  };
37
40
  var group = {
@@ -3,10 +3,18 @@ import { BaseComponentPropsWithChildren } from '../../types';
3
3
  export type DescriptionListGroupProps = BaseComponentPropsWithChildren<HTMLDivElement, {
4
4
  /**Custom margin. */
5
5
  margin?: Property.Margin<string>;
6
+ /**Custom min-width. */
7
+ minWidth?: Property.MinWidth<string>;
8
+ /**Custom max-width. */
9
+ maxWidth?: Property.MaxWidth<string>;
6
10
  }>;
7
11
  export declare const DescriptionListGroup: import("react").ForwardRefExoticComponent<Pick<import("react").HTMLAttributes<HTMLDivElement>, "id" | "className"> & {
8
12
  /**Custom margin. */
9
13
  margin?: Property.Margin<string> | undefined;
14
+ /**Custom min-width. */
15
+ minWidth?: Property.MinWidth<string> | undefined;
16
+ /**Custom max-width. */
17
+ maxWidth?: Property.MaxWidth<string> | undefined;
10
18
  } & {
11
19
  children?: import("react").ReactNode;
12
20
  } & {
@@ -8,21 +8,31 @@ import { getBaseHTMLProps } from '../../types/BaseComponentProps.js';
8
8
  var DListGroup = styled.div.withConfig({
9
9
  displayName: "DescriptionListGroup__DListGroup",
10
10
  componentId: "sc-jkdc0o-0"
11
- })(["margin:", ";"], function (_ref) {
11
+ })(["margin:", ";", " ", ""], function (_ref) {
12
12
  var margin = _ref.margin;
13
13
  return margin ? margin : descriptionListTokens.group.base.margin;
14
+ }, function (_ref2) {
15
+ var minWidth = _ref2.minWidth;
16
+ return minWidth && "min-width: ".concat(minWidth);
17
+ }, function (_ref3) {
18
+ var maxWidth = _ref3.maxWidth;
19
+ return maxWidth && "max-width: ".concat(maxWidth);
14
20
  });
15
21
  var DescriptionListGroup = /*#__PURE__*/forwardRef(function (props, ref) {
16
22
  var children = props.children,
17
23
  margin = props.margin,
24
+ minWidth = props.minWidth,
25
+ maxWidth = props.maxWidth,
18
26
  id = props.id,
19
27
  className = props.className,
20
28
  htmlProps = props.htmlProps,
21
- rest = __rest(props, ["children", "margin", "id", "className", "htmlProps"]);
29
+ rest = __rest(props, ["children", "margin", "minWidth", "maxWidth", "id", "className", "htmlProps"]);
22
30
  var dListGroupProps = Object.assign(Object.assign({}, getBaseHTMLProps(id, className, htmlProps, rest)), {
23
31
  children: children,
24
32
  ref: ref,
25
- margin: margin
33
+ margin: margin,
34
+ minWidth: minWidth,
35
+ maxWidth: maxWidth
26
36
  });
27
37
  return jsx(DListGroup, Object.assign({}, dListGroupProps, {
28
38
  children: children
@@ -12,5 +12,5 @@ export declare const InputMessage: import("react").ForwardRefExoticComponent<Pic
12
12
  /** Formålet med meldingen. Påvirker styling. */
13
13
  messageType: InputMessageType;
14
14
  } & {
15
- htmlProps?: import("react").HTMLAttributes<HTMLDivElement> | undefined; /** Meldingen som vises til brukeren. */
15
+ htmlProps?: import("react").HTMLAttributes<HTMLDivElement> | undefined;
16
16
  } & import("react").RefAttributes<HTMLDivElement>>;
@@ -22,7 +22,7 @@ var InputMessageWrapper = styled.div.withConfig({
22
22
  componentId: "sc-c954fy-0"
23
23
  })(["display:flex;width:fit-content;word-break:break-word;max-width:100%;", " svg{margin-top:", ";}"], function (_ref) {
24
24
  var messageType = _ref.messageType;
25
- return messageType === 'tip' ? css(["background-color:", ";"], inputMessageTokens.message.tip.backgroundColor) : messageType === 'error' ? css(["color:", ";background-color:", ";padding:", ";gap:", ";"], inputMessageTokens.message.error.color, inputMessageTokens.message.error.backgroundColor, inputMessageTokens.message.error.padding, inputMessageTokens.message.error.gap) : '';
25
+ return messageType === 'error' ? css(["color:", ";background-color:", ";padding:", ";gap:", ";"], inputMessageTokens.message.error.color, inputMessageTokens.message.error.backgroundColor, inputMessageTokens.message.error.padding, inputMessageTokens.message.error.gap) : '';
26
26
  }, inputMessageTokens.icon.marginTop);
27
27
  var InputMessage = /*#__PURE__*/forwardRef(function (props, ref) {
28
28
  var message = props.message,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norges-domstoler/dds-components",
3
- "version": "11.0.0",
3
+ "version": "11.1.0",
4
4
  "description": "React components used in Elsa - domstolenes designsystem",
5
5
  "author": "Elsa team",
6
6
  "license": "MIT",