@norges-domstoler/dds-components 12.0.0 → 12.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.
@@ -22,7 +22,12 @@ export interface StackStyleProps {
22
22
  * Hvilken spacing token som skal brukes som CSS `gap`.
23
23
  * @default 0
24
24
  */
25
- gap?: keyof typeof stackTokens.gap | 0;
25
+ gap?: keyof typeof stackTokens.spacing | 0;
26
+ /**
27
+ * Hvilken spacing token som skal brukes som CSS `padding`.
28
+ * @default 0
29
+ */
30
+ padding?: keyof typeof stackTokens.spacing | 0;
26
31
  }
27
32
  export type StackProps = BaseComponentPropsWithChildren<HTMLDivElement, Omit<StackStyleProps, 'direction'>>;
28
33
  export declare const HStack: import("react").ForwardRefExoticComponent<Pick<import("react").HTMLAttributes<HTMLDivElement>, "className" | "id"> & Omit<StackStyleProps, "direction"> & {
@@ -1,5 +1,5 @@
1
1
  export declare const stackTokens: {
2
- gap: {
2
+ spacing: {
3
3
  'local-x0.125': string;
4
4
  'local-x0.25': string;
5
5
  'local-x0.5': string;
package/dist/cjs/index.js CHANGED
@@ -7499,8 +7499,8 @@ var HeaderContainer$2 = styled__default.default.div.withConfig({
7499
7499
  }, function (props) {
7500
7500
  return props.bold && styled.css(["font-weight:600;"]);
7501
7501
  });
7502
- var HeaderWrapper = styled__default.default.button.withConfig({
7503
- displayName: "CardAccordionHeader__HeaderWrapper",
7502
+ var HeaderWrapperButton = styled__default.default.button.withConfig({
7503
+ displayName: "CardAccordionHeader__HeaderWrapperButton",
7504
7504
  componentId: "sc-1qs6bkj-2"
7505
7505
  })(["", " user-select:text;position:relative;cursor:pointer;@media (prefers-reduced-motion:no-preference){transition:box-shadow 0.2s;}", " display:block;width:100%;&:hover{box-shadow:", ";}&:focus-visible,&.focus-visible{outline:none;box-shadow:", ";}"], normalizeButton, removeButtonStyling, header.hover.boxShadow, header.focus.boxShadow);
7506
7506
  var ChevronWrapper = styled__default.default.span.withConfig({
@@ -7536,7 +7536,9 @@ var CardAccordionHeader = /*#__PURE__*/React.forwardRef(function (props, ref) {
7536
7536
  width: cardAccordionTokens.chevron.width,
7537
7537
  height: cardAccordionTokens.chevron.height
7538
7538
  };
7539
- return jsxRuntime.jsx(HeaderWrapper, Object.assign({}, headerWrapperProps, {
7539
+ return jsxRuntime.jsx(HeaderWrapperButton, Object.assign({}, headerWrapperProps, {
7540
+ type: "button"
7541
+ }, {
7540
7542
  children: jsxRuntime.jsxs(HeaderContainer$2, Object.assign({
7541
7543
  typographyType: typographyType,
7542
7544
  padding: padding,
@@ -10650,7 +10652,7 @@ var SplitButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
10650
10652
  });
10651
10653
 
10652
10654
  var spacing$3 = ddsDesignTokens.ddsBaseTokens.spacing;
10653
- var gapTokens = {
10655
+ var spacingTokens = {
10654
10656
  'local-x0.125': spacing$3.SizesDdsSpacingLocalX0125,
10655
10657
  'local-x0.25': spacing$3.SizesDdsSpacingLocalX025,
10656
10658
  'local-x0.5': spacing$3.SizesDdsSpacingLocalX05,
@@ -10669,13 +10671,13 @@ var gapTokens = {
10669
10671
  'layout-x10': spacing$3.SizesDdsSpacingLayoutX10
10670
10672
  };
10671
10673
  var stackTokens = {
10672
- gap: gapTokens
10674
+ spacing: spacingTokens
10673
10675
  };
10674
10676
 
10675
10677
  var Stack = styled__default.default.div.withConfig({
10676
10678
  displayName: "Stack",
10677
10679
  componentId: "sc-1a1z9ks-0"
10678
- })(["display:flex;flex-direction:", ";align-items:", ";justify-content:", ";gap:", ";"], function (_ref) {
10680
+ })(["display:flex;flex-direction:", ";align-items:", ";justify-content:", ";gap:", ";padding:", ";"], function (_ref) {
10679
10681
  var direction = _ref.direction;
10680
10682
  return direction === 'horizontal' ? 'row' : 'column';
10681
10683
  }, function (props) {
@@ -10683,7 +10685,9 @@ var Stack = styled__default.default.div.withConfig({
10683
10685
  }, function (props) {
10684
10686
  return props.justify;
10685
10687
  }, function (props) {
10686
- return props.gap === undefined || props.gap === 0 ? '0' : stackTokens.gap[props.gap];
10688
+ return props.gap === undefined || props.gap === 0 ? '0' : stackTokens.spacing[props.gap];
10689
+ }, function (props) {
10690
+ return props.padding === undefined || props.padding === 0 ? '0' : stackTokens.spacing[props.padding];
10687
10691
  });
10688
10692
  Stack.defaultProps = {
10689
10693
  align: 'center',
@@ -46,8 +46,8 @@ var HeaderContainer = styled.div.withConfig({
46
46
  }, function (props) {
47
47
  return props.bold && css(["font-weight:600;"]);
48
48
  });
49
- var HeaderWrapper = styled.button.withConfig({
50
- displayName: "CardAccordionHeader__HeaderWrapper",
49
+ var HeaderWrapperButton = styled.button.withConfig({
50
+ displayName: "CardAccordionHeader__HeaderWrapperButton",
51
51
  componentId: "sc-1qs6bkj-2"
52
52
  })(["", " user-select:text;position:relative;cursor:pointer;@media (prefers-reduced-motion:no-preference){transition:box-shadow 0.2s;}", " display:block;width:100%;&:hover{box-shadow:", ";}&:focus-visible,&.focus-visible{outline:none;box-shadow:", ";}"], normalizeButton, removeButtonStyling, header.hover.boxShadow, header.focus.boxShadow);
53
53
  var ChevronWrapper = styled.span.withConfig({
@@ -83,7 +83,9 @@ var CardAccordionHeader = /*#__PURE__*/forwardRef(function (props, ref) {
83
83
  width: cardAccordionTokens.chevron.width,
84
84
  height: cardAccordionTokens.chevron.height
85
85
  };
86
- return jsx(HeaderWrapper, Object.assign({}, headerWrapperProps, {
86
+ return jsx(HeaderWrapperButton, Object.assign({}, headerWrapperProps, {
87
+ type: "button"
88
+ }, {
87
89
  children: jsxs(HeaderContainer, Object.assign({
88
90
  typographyType: typographyType,
89
91
  padding: padding,
@@ -22,7 +22,12 @@ export interface StackStyleProps {
22
22
  * Hvilken spacing token som skal brukes som CSS `gap`.
23
23
  * @default 0
24
24
  */
25
- gap?: keyof typeof stackTokens.gap | 0;
25
+ gap?: keyof typeof stackTokens.spacing | 0;
26
+ /**
27
+ * Hvilken spacing token som skal brukes som CSS `padding`.
28
+ * @default 0
29
+ */
30
+ padding?: keyof typeof stackTokens.spacing | 0;
26
31
  }
27
32
  export type StackProps = BaseComponentPropsWithChildren<HTMLDivElement, Omit<StackStyleProps, 'direction'>>;
28
33
  export declare const HStack: import("react").ForwardRefExoticComponent<Pick<import("react").HTMLAttributes<HTMLDivElement>, "className" | "id"> & Omit<StackStyleProps, "direction"> & {
@@ -8,7 +8,7 @@ import { getBaseHTMLProps } from '../../types/BaseComponentProps.js';
8
8
  var Stack = styled.div.withConfig({
9
9
  displayName: "Stack",
10
10
  componentId: "sc-1a1z9ks-0"
11
- })(["display:flex;flex-direction:", ";align-items:", ";justify-content:", ";gap:", ";"], function (_ref) {
11
+ })(["display:flex;flex-direction:", ";align-items:", ";justify-content:", ";gap:", ";padding:", ";"], function (_ref) {
12
12
  var direction = _ref.direction;
13
13
  return direction === 'horizontal' ? 'row' : 'column';
14
14
  }, function (props) {
@@ -16,7 +16,9 @@ var Stack = styled.div.withConfig({
16
16
  }, function (props) {
17
17
  return props.justify;
18
18
  }, function (props) {
19
- return props.gap === undefined || props.gap === 0 ? '0' : stackTokens.gap[props.gap];
19
+ return props.gap === undefined || props.gap === 0 ? '0' : stackTokens.spacing[props.gap];
20
+ }, function (props) {
21
+ return props.padding === undefined || props.padding === 0 ? '0' : stackTokens.spacing[props.padding];
20
22
  });
21
23
  Stack.defaultProps = {
22
24
  align: 'center',
@@ -1,5 +1,5 @@
1
1
  export declare const stackTokens: {
2
- gap: {
2
+ spacing: {
3
3
  'local-x0.125': string;
4
4
  'local-x0.25': string;
5
5
  'local-x0.5': string;
@@ -1,7 +1,7 @@
1
1
  import { ddsBaseTokens } from '@norges-domstoler/dds-design-tokens';
2
2
 
3
3
  var spacing = ddsBaseTokens.spacing;
4
- var gapTokens = {
4
+ var spacingTokens = {
5
5
  'local-x0.125': spacing.SizesDdsSpacingLocalX0125,
6
6
  'local-x0.25': spacing.SizesDdsSpacingLocalX025,
7
7
  'local-x0.5': spacing.SizesDdsSpacingLocalX05,
@@ -20,7 +20,7 @@ var gapTokens = {
20
20
  'layout-x10': spacing.SizesDdsSpacingLayoutX10
21
21
  };
22
22
  var stackTokens = {
23
- gap: gapTokens
23
+ spacing: spacingTokens
24
24
  };
25
25
 
26
26
  export { stackTokens };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norges-domstoler/dds-components",
3
- "version": "12.0.0",
3
+ "version": "12.1.0",
4
4
  "description": "React components used in Elsa - domstolenes designsystem",
5
5
  "author": "Elsa team",
6
6
  "license": "MIT",