@norges-domstoler/dds-components 9.5.0 → 10.0.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.
Files changed (36) hide show
  1. package/dist/cjs/components/ProgressTracker/ProgressTracker.context.d.ts +1 -0
  2. package/dist/cjs/components/ProgressTracker/ProgressTracker.d.ts +4 -0
  3. package/dist/cjs/components/ProgressTracker/ProgressTracker.stories.d.ts +2 -0
  4. package/dist/cjs/components/Table/Body.d.ts +2 -2
  5. package/dist/cjs/components/Table/Foot.d.ts +2 -2
  6. package/dist/cjs/components/Table/Head.d.ts +2 -2
  7. package/dist/cjs/components/Table/SortCell.d.ts +1 -1
  8. package/dist/cjs/components/Table/Table.stories.d.ts +19 -2
  9. package/dist/cjs/components/Table/index.d.ts +20 -8
  10. package/dist/cjs/helpers/styling/index.d.ts +1 -0
  11. package/dist/cjs/helpers/styling/normalize.d.ts +5 -0
  12. package/dist/cjs/index.js +67 -46
  13. package/dist/components/Button/Button.styles.js +2 -1
  14. package/dist/components/Card/CardAccordion/CardAccordionHeader.js +2 -1
  15. package/dist/components/OverflowMenu/OverflowMenuItem.js +2 -1
  16. package/dist/components/ProgressTracker/ProgressTracker.context.d.ts +1 -0
  17. package/dist/components/ProgressTracker/ProgressTracker.d.ts +4 -0
  18. package/dist/components/ProgressTracker/ProgressTracker.js +10 -2
  19. package/dist/components/ProgressTracker/ProgressTracker.stories.d.ts +2 -0
  20. package/dist/components/ProgressTracker/ProgressTrackerItem.js +6 -5
  21. package/dist/components/Search/Search.js +8 -3
  22. package/dist/components/Table/Body.d.ts +2 -2
  23. package/dist/components/Table/Foot.d.ts +2 -2
  24. package/dist/components/Table/Head.d.ts +2 -2
  25. package/dist/components/Table/SortCell.d.ts +1 -1
  26. package/dist/components/Table/SortCell.js +2 -1
  27. package/dist/components/Table/Table.stories.d.ts +19 -2
  28. package/dist/components/Table/index.d.ts +20 -8
  29. package/dist/components/Table/index.js +19 -0
  30. package/dist/components/Tabs/Tab.js +2 -1
  31. package/dist/components/Typography/Typography.utils.js +1 -1
  32. package/dist/helpers/styling/index.d.ts +1 -0
  33. package/dist/helpers/styling/normalize.d.ts +5 -0
  34. package/dist/helpers/styling/normalize.js +6 -0
  35. package/dist/index.js +1 -8
  36. package/package.json +1 -1
@@ -1,5 +1,6 @@
1
1
  declare type ProgressTrackerContextType = {
2
2
  activeStep: number;
3
+ handleStepChange?: (index: number) => void;
3
4
  };
4
5
  export declare const ProgressTrackerContext: import("react").Context<ProgressTrackerContextType>;
5
6
  export declare const useProgressTrackerContext: () => ProgressTrackerContextType;
@@ -4,6 +4,10 @@ import { ProgressTrackerItem } from './ProgressTrackerItem';
4
4
  declare type ProgressTrackerProps = BaseComponentPropsWithChildren<HTMLDivElement, {
5
5
  /** Indeksen til det aktive steget. */
6
6
  activeStep?: number;
7
+ /** Ekstra logikk ved klikking på et steg. */
8
+ onStepChange?: (step: number) => void;
9
+ /** Om brukeren kan hoppe mellom stegene via museklikk på et steg. */
10
+ clickable?: boolean;
7
11
  }>;
8
12
  declare type ProgressTrackerComponent = ForwardRefExoticComponent<ProgressTrackerProps> & {
9
13
  Item: typeof ProgressTrackerItem;
@@ -2,6 +2,8 @@ declare const _default: {
2
2
  title: string;
3
3
  component: import("react").ForwardRefExoticComponent<Pick<import("react").HTMLAttributes<HTMLDivElement>, "id" | "className"> & {
4
4
  activeStep?: number | undefined;
5
+ onStepChange?: ((step: number) => void) | undefined;
6
+ clickable?: boolean | undefined;
5
7
  } & {
6
8
  children?: import("react").ReactNode;
7
9
  } & {
@@ -1,3 +1,3 @@
1
1
  import { HTMLAttributes } from 'react';
2
- export declare type BodyProps = HTMLAttributes<HTMLTableSectionElement>;
3
- export declare const Body: import("react").ForwardRefExoticComponent<BodyProps & import("react").RefAttributes<HTMLTableSectionElement>>;
2
+ export declare type TableBodyProps = HTMLAttributes<HTMLTableSectionElement>;
3
+ export declare const Body: import("react").ForwardRefExoticComponent<TableBodyProps & import("react").RefAttributes<HTMLTableSectionElement>>;
@@ -1,3 +1,3 @@
1
1
  import { HTMLAttributes } from 'react';
2
- export declare type FootProps = HTMLAttributes<HTMLTableSectionElement>;
3
- export declare const Foot: import("react").ForwardRefExoticComponent<FootProps & import("react").RefAttributes<HTMLTableSectionElement>>;
2
+ export declare type TableFootProps = HTMLAttributes<HTMLTableSectionElement>;
3
+ export declare const Foot: import("react").ForwardRefExoticComponent<TableFootProps & import("react").RefAttributes<HTMLTableSectionElement>>;
@@ -1,3 +1,3 @@
1
1
  import { HTMLAttributes } from 'react';
2
- export declare type HeadProps = HTMLAttributes<HTMLTableSectionElement>;
3
- export declare const Head: import("react").ForwardRefExoticComponent<HeadProps & import("react").RefAttributes<HTMLTableSectionElement>>;
2
+ export declare type TableHeadProps = HTMLAttributes<HTMLTableSectionElement>;
3
+ export declare const Head: import("react").ForwardRefExoticComponent<TableHeadProps & import("react").RefAttributes<HTMLTableSectionElement>>;
@@ -1,7 +1,7 @@
1
1
  import { MouseEvent } from 'react';
2
2
  import { TableCellProps } from './Cell';
3
3
  export declare type SortOrder = 'ascending' | 'descending';
4
- export declare type SortCellProps = {
4
+ export declare type TableSortCellProps = {
5
5
  /**Spesifiserer om kolonnen er sortert. */
6
6
  isSorted?: boolean;
7
7
  /**Sorteringsrekkefølge i kolonnen. Avgjør hvilket ikon skal vises i cellen. */
@@ -1,11 +1,28 @@
1
- import { TableProps } from '.';
1
+ import { TableProps, SortOrder } from '.';
2
2
  declare const _default: {
3
3
  title: string;
4
4
  component: import("react").ForwardRefExoticComponent<{
5
5
  density?: import("./Table").TableDensity | undefined;
6
6
  stickyHeader?: boolean | undefined;
7
7
  withDividers?: boolean | undefined;
8
- } & import("react").HTMLAttributes<HTMLTableElement> & import("react").RefAttributes<HTMLTableElement>>;
8
+ } & import("react").HTMLAttributes<HTMLTableElement> & import("react").RefAttributes<HTMLTableElement>> & {
9
+ Wrapper: ({ children, ...rest }: import("./TableWrapper").TableWrapperProps) => JSX.Element;
10
+ Head: import("react").ForwardRefExoticComponent<import("./Head").TableHeadProps & import("react").RefAttributes<HTMLTableSectionElement>>;
11
+ Body: import("react").ForwardRefExoticComponent<import("./Body").TableBodyProps & import("react").RefAttributes<HTMLTableSectionElement>>;
12
+ Foot: import("react").ForwardRefExoticComponent<import("./Foot").TableFootProps & import("react").RefAttributes<HTMLTableSectionElement>>;
13
+ Row: import("react").ForwardRefExoticComponent<{
14
+ type?: import("./Row").TableRowType | undefined;
15
+ mode?: import("./Row").RowMode | undefined;
16
+ selected?: boolean | undefined;
17
+ hoverable?: boolean | undefined;
18
+ } & import("react").HTMLAttributes<HTMLTableRowElement> & import("react").RefAttributes<HTMLTableRowElement>>;
19
+ Cell: import("react").ForwardRefExoticComponent<import("./Cell").TableCellProps & import("react").RefAttributes<HTMLTableCellElement>>;
20
+ SortCell: import("react").ForwardRefExoticComponent<{
21
+ isSorted?: boolean | undefined;
22
+ sortOrder?: SortOrder | undefined;
23
+ onClick: (event: import("react").MouseEvent<HTMLButtonElement, MouseEvent>) => void;
24
+ } & Omit<import("./Cell").TableCellProps, "type"> & import("react").RefAttributes<HTMLTableCellElement>>;
25
+ };
9
26
  argTypes: {
10
27
  stickyHeader: {
11
28
  control: {
@@ -1,8 +1,20 @@
1
- export * from './Table';
2
- export * from './Body';
3
- export * from './Head';
4
- export * from './Row';
5
- export * from './Cell';
6
- export * from './SortCell';
7
- export * from './Foot';
8
- export * from './TableWrapper';
1
+ import { Table as BaseTable, TableProps, TableDensity } from './Table';
2
+ import { Head, TableHeadProps } from './Head';
3
+ import { Body, TableBodyProps } from './Body';
4
+ import { Foot, TableFootProps } from './Foot';
5
+ import { Row, TableRowProps, TableRowType } from './Row';
6
+ import { Cell, TableCellProps, TableCellLayout, TableCellType } from './Cell';
7
+ import { SortCell, TableSortCellProps, SortOrder } from './SortCell';
8
+ import { TableWrapper } from './TableWrapper';
9
+ declare type TableCompoundProps = typeof BaseTable & {
10
+ Wrapper: typeof TableWrapper;
11
+ Head: typeof Head;
12
+ Body: typeof Body;
13
+ Foot: typeof Foot;
14
+ Row: typeof Row;
15
+ Cell: typeof Cell;
16
+ SortCell: typeof SortCell;
17
+ };
18
+ declare const Table: TableCompoundProps;
19
+ export { Table };
20
+ export type { TableCellProps, TableDensity, TableProps, TableRowProps, TableRowType, TableHeadProps, TableBodyProps, TableFootProps, TableSortCellProps, SortOrder, TableCellLayout, TableCellType, };
@@ -6,3 +6,4 @@ export * from './focus';
6
6
  export * from './danger';
7
7
  export * from './hideInput';
8
8
  export * from './selection';
9
+ export * from './normalize';
@@ -0,0 +1,5 @@
1
+ import { Property } from 'csstype';
2
+ export declare const normalizeButton: {
3
+ margin: number;
4
+ textTransform: Property.TextTransform;
5
+ };
package/dist/cjs/index.js CHANGED
@@ -422,6 +422,11 @@ var selection = {
422
422
  backgroundColor: colors$s.DdsColorTertiaryLightest
423
423
  };
424
424
 
425
+ var normalizeButton = {
426
+ margin: 0,
427
+ textTransform: 'none'
428
+ };
429
+
425
430
  var joinClassNames = function joinClassNames() {
426
431
  for (var _len = arguments.length, classNames = new Array(_len), _key = 0; _key < _len; _key++) {
427
432
  classNames[_key] = arguments[_key];
@@ -544,7 +549,7 @@ var getMarginStyling = function getMarginStyling(typographyType, element, withMa
544
549
  return withMargins ? styled.css(["", " margin-top:", ";margin-bottom:", ";", ""], isInlineElement(element) && element !== 'a' && styled.css(["display:block;"]), typographyTokens.typographyType[typographyType].margins.marginTop, typographyTokens.typographyType[typographyType].margins.marginBottom, styled.css(["padding-top:", ";"], typographyTokens.typographyType[typographyType].margins.paddingTop)) : styled.css(["margin:0;"]);
545
550
  };
546
551
  var getAnchorStyling = function getAnchorStyling(external, interactionStyling, typographyType, withMargins) {
547
- return styled.css(["", " color:", ";width:fit-content;text-decoration:underline;@media (prefers-reduced-motion:no-preference){transition:", ";}", " &:hover{color:", ";", "}", " &:focus-visible,&.focus-visible,&:focus-visible::selection,&.focus-visible::selection{", "}"], typographyType ? styled.css(["", ";", ""], typographyTokens.typographyType[typographyType].base.font, getMarginStyling(typographyType, 'a', withMargins)) : styled.css(["font:inherit;", ""], getMarginStyling('a', 'a', withMargins)), typographyTokens.typographyType.a.base.color, focusVisibleLinkTransitionValue, external && styled.css(["padding-right:calc(1em + ", ");::after{mask:", " no-repeat center/contain;background:0 0;background-color:currentColor;width:1em;height:1em;content:'';position:absolute;margin-top:", ";margin-left:", ";}"], typographyTokens.typographyType.a.icon.marginLeft, "url(\"".concat(OpenExternalIcon$1, "\")"), typographyTokens.typographyType.a.icon.marginTop, typographyTokens.typographyType.a.icon.marginLeft), typographyTokens.typographyType.a.hover.color, interactionStyling && interactionStyling.hover && styled.css(["", ""], interactionStyling.hover), interactionStyling && interactionStyling.active && styled.css(["&:active{", "}"], interactionStyling.active), focusVisibleLink);
552
+ return styled.css(["", " color:", ";width:fit-content;text-decoration:underline;@media (prefers-reduced-motion:no-preference){transition:", ";}", " &:hover{color:", ";", "}", " &:focus-visible,&.focus-visible,&:focus-visible::selection,&.focus-visible::selection{", "}"], typographyType ? styled.css(["", ";", ""], typographyTokens.typographyType[typographyType].base.font, getMarginStyling(typographyType, 'a', withMargins)) : styled.css(["font:inherit;", ""], getMarginStyling('a', 'a', withMargins)), typographyTokens.typographyType.a.base.color, focusVisibleLinkTransitionValue, external && styled.css(["padding-right:calc(1em + ", ");position:relative;::after{mask:", " no-repeat center/contain;background:0 0;background-color:currentColor;width:1em;height:1em;content:'';position:absolute;margin-top:", ";margin-left:", ";}"], typographyTokens.typographyType.a.icon.marginLeft, "url(\"".concat(OpenExternalIcon$1, "\")"), typographyTokens.typographyType.a.icon.marginTop, typographyTokens.typographyType.a.icon.marginLeft), typographyTokens.typographyType.a.hover.color, interactionStyling && interactionStyling.hover && styled.css(["", ""], interactionStyling.hover), interactionStyling && interactionStyling.active && styled.css(["&:active{", "}"], interactionStyling.active), focusVisibleLink);
548
553
  };
549
554
 
550
555
  var combineHandlers = function combineHandlers(handler1, handler2) {
@@ -3272,7 +3277,7 @@ var getAppearanceAndPurposeStyling = function getAppearanceAndPurposeStyling(app
3272
3277
  var ButtonWrapper = styled__default["default"].button.withConfig({
3273
3278
  displayName: "Buttonstyles__ButtonWrapper",
3274
3279
  componentId: "sc-14dutqk-0"
3275
- })(["border:", ";user-select:text;display:inline-flex;align-items:center;justify-content:center;height:fit-content;width:", ";cursor:pointer;box-shadow:none;text-decoration:none;@media (prefers-reduced-motion:no-preference){transition:background-color 0.2s,text-decoration-color 0.2s,box-shadow 0.2s,border-color 0.2s,color 0.2s,", ";}", " ", " ", " ", " ", " &:focus-visible,&.focus-visible{", "}*::selection{", "}"], base$1.border, function (_ref) {
3280
+ })(["", " border:", ";user-select:text;display:inline-flex;align-items:center;justify-content:center;height:fit-content;width:", ";cursor:pointer;box-shadow:none;text-decoration:none;@media (prefers-reduced-motion:no-preference){transition:background-color 0.2s,text-decoration-color 0.2s,box-shadow 0.2s,border-color 0.2s,color 0.2s,", ";}", " ", " ", " ", " ", " &:focus-visible,&.focus-visible{", "}*::selection{", "}"], normalizeButton, base$1.border, function (_ref) {
3276
3281
  var fullWidth = _ref.fullWidth;
3277
3282
  return fullWidth ? '100%' : 'fit-content';
3278
3283
  }, focusVisibleTransitionValue, function (_ref2) {
@@ -5356,7 +5361,7 @@ var Span = styled__default["default"].span.withConfig({
5356
5361
  var Link$2 = styled__default["default"].a.withConfig({
5357
5362
  displayName: "OverflowMenuItem__Link",
5358
5363
  componentId: "sc-1ka2asi-1"
5359
- })(["text-align:left;user-select:text;border:none;cursor:pointer;outline:inherit;width:100%;", " @media (prefers-reduced-motion:no-preference){transition:background-color 0.2s;}&:hover{background-color:", ";}&:active{background-color:", ";}&:focus-visible,&.focus-visible{", "}"], elementBaseCSS, link$2.hover.backgroundColor, link$2.active.backgroundColor, focusVisibleLink);
5364
+ })(["", " text-align:left;user-select:text;border:none;cursor:pointer;outline:inherit;width:100%;", " @media (prefers-reduced-motion:no-preference){transition:background-color 0.2s;}&:hover{background-color:", ";}&:active{background-color:", ";}&:focus-visible,&.focus-visible{", "}"], normalizeButton, elementBaseCSS, link$2.hover.backgroundColor, link$2.active.backgroundColor, focusVisibleLink);
5360
5365
  var IconWrapper$1 = styled__default["default"].span.withConfig({
5361
5366
  displayName: "OverflowMenuItem__IconWrapper",
5362
5367
  componentId: "sc-1ka2asi-2"
@@ -5590,7 +5595,9 @@ var OuterContainer$3 = styled__default["default"].div.withConfig({
5590
5595
  var HorisontalContainer = styled__default["default"].div.withConfig({
5591
5596
  displayName: "Search__HorisontalContainer",
5592
5597
  componentId: "sc-1ax3s9s-3"
5593
- })(["display:grid;grid-template-columns:1fr auto;gap:", ";"], horisontalContainer.gap);
5598
+ })(["", ""], function (props) {
5599
+ return props.hasSearchButton && styled.css(["display:grid;grid-template-columns:1fr auto;gap:", ";"], horisontalContainer.gap);
5600
+ });
5594
5601
  var InputContainer = styled__default["default"].div.withConfig({
5595
5602
  displayName: "Search__InputContainer",
5596
5603
  componentId: "sc-1ax3s9s-4"
@@ -5641,13 +5648,16 @@ var Search$1 = /*#__PURE__*/React.forwardRef(function (_a, ref) {
5641
5648
  onClick = _b.onClick,
5642
5649
  otherButtonProps = tslib.__rest(_b, ["label", "onClick"]);
5643
5650
  var hasSuggestions = !!context.suggestions;
5651
+ var showSearchButton = !!buttonProps && !!onClick;
5644
5652
  return jsxRuntime.jsxs(OuterContainer$3, {
5645
5653
  children: [hasLabel && jsxRuntime.jsx(Label$2, Object.assign({
5646
5654
  htmlFor: uniqueId
5647
5655
  }, {
5648
5656
  children: label
5649
5657
  })), jsxRuntime.jsxs("div", {
5650
- children: [jsxRuntime.jsxs(HorisontalContainer, Object.assign({}, containerProps, {
5658
+ children: [jsxRuntime.jsxs(HorisontalContainer, Object.assign({
5659
+ hasSearchButton: showSearchButton
5660
+ }, containerProps, {
5651
5661
  children: [jsxRuntime.jsxs(InputContainer, {
5652
5662
  children: [jsxRuntime.jsx(StyledIcon$1, {
5653
5663
  icon: SearchIcon,
@@ -5674,7 +5684,7 @@ var Search$1 = /*#__PURE__*/React.forwardRef(function (_a, ref) {
5674
5684
  children: "Bla i s\xF8keforslag med piltaster n\xE5r listen er utvidet."
5675
5685
  }))]
5676
5686
  })]
5677
- }), buttonProps && onClick && jsxRuntime.jsx(Button$1, Object.assign({
5687
+ }), showSearchButton && jsxRuntime.jsx(Button$1, Object.assign({
5678
5688
  size: componentSize,
5679
5689
  label: buttonLabel || 'Søk',
5680
5690
  onClick: onClick
@@ -5863,7 +5873,7 @@ var StyledTable = styled__default["default"].table.withConfig({
5863
5873
  var withDividers = _ref3.withDividers;
5864
5874
  return withDividers && styled.css(["tr[type='body']{border-bottom:", ";}"], row$1.body.withDividers.borderBottom);
5865
5875
  });
5866
- var Table = /*#__PURE__*/React.forwardRef(function (_a, ref) {
5876
+ var Table$1 = /*#__PURE__*/React.forwardRef(function (_a, ref) {
5867
5877
  var _a$density = _a.density,
5868
5878
  density = _a$density === void 0 ? 'normal' : _a$density,
5869
5879
  children = _a.children,
@@ -5877,6 +5887,21 @@ var Table = /*#__PURE__*/React.forwardRef(function (_a, ref) {
5877
5887
  }));
5878
5888
  });
5879
5889
 
5890
+ var StyledHead = styled__default["default"].thead.withConfig({
5891
+ displayName: "Head__StyledHead",
5892
+ componentId: "sc-vzd2kv-0"
5893
+ })([""]);
5894
+ var Head = /*#__PURE__*/React.forwardRef(function (_a, ref) {
5895
+ var children = _a.children,
5896
+ rest = tslib.__rest(_a, ["children"]);
5897
+ var headProps = Object.assign({}, rest);
5898
+ return jsxRuntime.jsx(StyledHead, Object.assign({
5899
+ ref: ref
5900
+ }, headProps, {
5901
+ children: children
5902
+ }));
5903
+ });
5904
+
5880
5905
  var StyledBody = styled__default["default"].tbody.withConfig({
5881
5906
  displayName: "Body__StyledBody",
5882
5907
  componentId: "sc-67qjfs-0"
@@ -5892,17 +5917,17 @@ var Body$1 = /*#__PURE__*/React.forwardRef(function (_a, ref) {
5892
5917
  }));
5893
5918
  });
5894
5919
 
5895
- var StyledHead = styled__default["default"].thead.withConfig({
5896
- displayName: "Head__StyledHead",
5897
- componentId: "sc-vzd2kv-0"
5920
+ var StyledFoot = styled__default["default"].tfoot.withConfig({
5921
+ displayName: "Foot__StyledFoot",
5922
+ componentId: "sc-tfpehd-0"
5898
5923
  })([""]);
5899
- var Head = /*#__PURE__*/React.forwardRef(function (_a, ref) {
5924
+ var Foot = /*#__PURE__*/React.forwardRef(function (_a, ref) {
5900
5925
  var children = _a.children,
5901
5926
  rest = tslib.__rest(_a, ["children"]);
5902
- var headProps = Object.assign({}, rest);
5903
- return jsxRuntime.jsx(StyledHead, Object.assign({
5927
+ var footProps = Object.assign({}, rest);
5928
+ return jsxRuntime.jsx(StyledFoot, Object.assign({
5904
5929
  ref: ref
5905
- }, headProps, {
5930
+ }, footProps, {
5906
5931
  children: children
5907
5932
  }));
5908
5933
  });
@@ -6007,7 +6032,7 @@ var cell = tableTokens.cell;
6007
6032
  var StyledButton$3 = styled__default["default"].button.withConfig({
6008
6033
  displayName: "SortCell__StyledButton",
6009
6034
  componentId: "sc-1l3jzvh-0"
6010
- })(["user-select:text;", " display:flex;align-items:center;gap:", ";&:focus-visible{", "}"], removeButtonStyling, cell.sort.gap, focusVisible);
6035
+ })(["", " user-select:text;", " display:flex;align-items:center;gap:", ";&:focus-visible{", "}"], normalizeButton, removeButtonStyling, cell.sort.gap, focusVisible);
6011
6036
  var makeSortIcon = function makeSortIcon(isSorted, sortOrder) {
6012
6037
  if (!isSorted || !sortOrder) {
6013
6038
  return jsxRuntime.jsx(Icon, {
@@ -6043,21 +6068,6 @@ var SortCell = /*#__PURE__*/React.forwardRef(function (_a, ref) {
6043
6068
  }));
6044
6069
  });
6045
6070
 
6046
- var StyledFoot = styled__default["default"].tfoot.withConfig({
6047
- displayName: "Foot__StyledFoot",
6048
- componentId: "sc-tfpehd-0"
6049
- })([""]);
6050
- var Foot = /*#__PURE__*/React.forwardRef(function (_a, ref) {
6051
- var children = _a.children,
6052
- rest = tslib.__rest(_a, ["children"]);
6053
- var footProps = Object.assign({}, rest);
6054
- return jsxRuntime.jsx(StyledFoot, Object.assign({
6055
- ref: ref
6056
- }, footProps, {
6057
- children: children
6058
- }));
6059
- });
6060
-
6061
6071
  var Wrapper$4 = styled__default["default"].div.withConfig({
6062
6072
  displayName: "TableWrapper__Wrapper",
6063
6073
  componentId: "sc-eb384b-0"
@@ -6105,6 +6115,15 @@ var TableWrapper = function TableWrapper(_a) {
6105
6115
  }));
6106
6116
  };
6107
6117
 
6118
+ var Table = Table$1;
6119
+ Table.Wrapper = TableWrapper;
6120
+ Table.Head = Head;
6121
+ Table.Body = Body$1;
6122
+ Table.Cell = Cell;
6123
+ Table.SortCell = SortCell;
6124
+ Table.Row = Row;
6125
+ Table.Foot = Foot;
6126
+
6108
6127
  var isAnchorTypographyProps = function isAnchorTypographyProps(props) {
6109
6128
  return props.href != undefined;
6110
6129
  };
@@ -6911,7 +6930,7 @@ var HeaderContainer$2 = styled__default["default"].div.withConfig({
6911
6930
  var HeaderWrapper = styled__default["default"].button.withConfig({
6912
6931
  displayName: "CardAccordionHeader__HeaderWrapper",
6913
6932
  componentId: "sc-1qs6bkj-2"
6914
- })(["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:", ";}"], removeButtonStyling, header.hover.boxShadow, header.focus.boxShadow);
6933
+ })(["", " 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);
6915
6934
  var ChevronWrapper = styled__default["default"].span.withConfig({
6916
6935
  displayName: "CardAccordionHeader__ChevronWrapper",
6917
6936
  componentId: "sc-1qs6bkj-3"
@@ -8555,7 +8574,7 @@ var tab = tabsTokens.tab;
8555
8574
  var Button = styled__default["default"].button.withConfig({
8556
8575
  displayName: "Tab__Button",
8557
8576
  componentId: "sc-1dd8soq-0"
8558
- })(["", " user-select:text;display:flex;align-items:center;justify-content:center;border-bottom:", ";color:", ";padding:", ";", " @media (prefers-reduced-motion:no-preference){transition:box-shadow 0.2s,border-bottom 0.2s,color 0.2s,", ";}", ";", " &:focus-visible{", " outline-offset:-1px;}&:hover{border-color:", ";color:", ";box-shadow:", ";}"], removeButtonStyling, tab.base.borderBottom, tab.base.color, tab.base.padding, getFontStyling(defaultTypographyType), focusVisibleTransitionValue, function (_ref) {
8577
+ })(["", " ", " user-select:text;display:flex;align-items:center;justify-content:center;border-bottom:", ";color:", ";padding:", ";", " @media (prefers-reduced-motion:no-preference){transition:box-shadow 0.2s,border-bottom 0.2s,color 0.2s,", ";}", ";", " &:focus-visible{", " outline-offset:-1px;}&:hover{border-color:", ";color:", ";box-shadow:", ";}"], normalizeButton, removeButtonStyling, tab.base.borderBottom, tab.base.color, tab.base.padding, getFontStyling(defaultTypographyType), focusVisibleTransitionValue, function (_ref) {
8559
8578
  var direction = _ref.direction;
8560
8579
  return styled.css(["flex-direction:", ";gap:", ";"], direction, tab[direction].gap);
8561
8580
  }, function (_ref2) {
@@ -9483,11 +9502,12 @@ var ProgressTrackerItem = function ProgressTrackerItem(props) {
9483
9502
  icon = props.icon,
9484
9503
  children = props.children;
9485
9504
  var _useProgressTrackerCo = useProgressTrackerContext(),
9486
- activeStep = _useProgressTrackerCo.activeStep;
9505
+ activeStep = _useProgressTrackerCo.activeStep,
9506
+ handleStepChange = _useProgressTrackerCo.handleStepChange;
9487
9507
  var active = activeStep === index;
9488
9508
  var styleProps = {
9489
9509
  state: toItemState(active, completed, disabled),
9490
- clickable: props.onClick !== undefined
9510
+ clickable: handleStepChange !== undefined
9491
9511
  };
9492
9512
  var stepNumberContent = React.useMemo(function () {
9493
9513
  if (completed) {
@@ -9508,9 +9528,9 @@ var ProgressTrackerItem = function ProgressTrackerItem(props) {
9508
9528
  "aria-current": active ? 'step' : undefined
9509
9529
  }, {
9510
9530
  children: jsxRuntime.jsxs(ItemContentWrapper, Object.assign({}, styleProps, {
9511
- as: props.onClick ? 'button' : 'div',
9512
- onClick: !disabled && props.onClick ? function () {
9513
- return props.onClick(index);
9531
+ as: handleStepChange ? 'button' : 'div',
9532
+ onClick: !disabled && handleStepChange ? function () {
9533
+ return handleStepChange(index);
9514
9534
  } : undefined,
9515
9535
  disabled: disabled
9516
9536
  }, {
@@ -9542,14 +9562,21 @@ var ProgressTracker = function () {
9542
9562
  var id = props.id,
9543
9563
  _props$activeStep = props.activeStep,
9544
9564
  activeStep = _props$activeStep === void 0 ? 0 : _props$activeStep,
9565
+ onStepChange = props.onStepChange,
9566
+ _props$clickable = props.clickable,
9567
+ clickable = _props$clickable === void 0 ? false : _props$clickable,
9545
9568
  children = props.children,
9546
9569
  className = props.className,
9547
9570
  htmlProps = props.htmlProps,
9548
- rest = tslib.__rest(props, ["id", "activeStep", "children", "className", "htmlProps"]);
9571
+ rest = tslib.__rest(props, ["id", "activeStep", "onStepChange", "clickable", "children", "className", "htmlProps"]);
9549
9572
  var _useState = React.useState(activeStep),
9550
9573
  _useState2 = _slicedToArray(_useState, 2),
9551
9574
  thisActiveStep = _useState2[0],
9552
9575
  setActiveStep = _useState2[1];
9576
+ var handleChange = function handleChange(step) {
9577
+ setActiveStep(step);
9578
+ onStepChange && onStepChange(step);
9579
+ };
9553
9580
  React.useEffect(function () {
9554
9581
  if (activeStep !== undefined && activeStep != thisActiveStep) {
9555
9582
  setActiveStep(activeStep);
@@ -9566,7 +9593,8 @@ var ProgressTracker = function () {
9566
9593
  }, [children]);
9567
9594
  return jsxRuntime.jsx(ProgressTrackerContext.Provider, Object.assign({
9568
9595
  value: {
9569
- activeStep: thisActiveStep
9596
+ activeStep: thisActiveStep,
9597
+ handleStepChange: clickable ? handleChange : undefined
9570
9598
  }
9571
9599
  }, {
9572
9600
  children: jsxRuntime.jsx("div", Object.assign({
@@ -10021,7 +10049,6 @@ exports.AttachmentIcon = AttachmentIcon;
10021
10049
  exports.BarChartBoxedIcon = BarChartBoxedIcon;
10022
10050
  exports.BarChartIcon = BarChartIcon;
10023
10051
  exports.BlockIcon = BlockIcon;
10024
- exports.Body = Body$1;
10025
10052
  exports.BookIcon = BookIcon;
10026
10053
  exports.Breadcrumb = Breadcrumb;
10027
10054
  exports.Breadcrumbs = Breadcrumbs;
@@ -10039,7 +10066,6 @@ exports.Card = Card;
10039
10066
  exports.CardAccordion = CardAccordion;
10040
10067
  exports.CardAccordionBody = CardAccordionBody;
10041
10068
  exports.CardAccordionHeader = CardAccordionHeader;
10042
- exports.Cell = Cell;
10043
10069
  exports.ChatIcon = ChatIcon;
10044
10070
  exports.CheckCircledIcon = CheckCircledIcon;
10045
10071
  exports.CheckIcon = CheckIcon;
@@ -10095,14 +10121,12 @@ exports.FilterOffIcon = FilterOffIcon;
10095
10121
  exports.FindInPageIcon = FindInPageIcon;
10096
10122
  exports.FolderAddIcon = FolderAddIcon;
10097
10123
  exports.FolderIcon = FolderIcon;
10098
- exports.Foot = Foot;
10099
10124
  exports.FullscreenExitIcon = FullscreenExitIcon;
10100
10125
  exports.FullscreenIcon = FullscreenIcon;
10101
10126
  exports.GavelIcon = GavelIcon;
10102
10127
  exports.GlobalMessage = GlobalMessage;
10103
10128
  exports.Grid = Grid;
10104
10129
  exports.GridChild = GridChild;
10105
- exports.Head = Head;
10106
10130
  exports.Heading = Heading;
10107
10131
  exports.HelpFilledIcon = HelpFilledIcon;
10108
10132
  exports.HelpIcon = HelpIcon;
@@ -10176,7 +10200,6 @@ exports.ReceiptIcon = ReceiptIcon;
10176
10200
  exports.RedoIcon = RedoIcon;
10177
10201
  exports.RefreshIcon = RefreshIcon;
10178
10202
  exports.ReplayIcon = ReplayIcon;
10179
- exports.Row = Row;
10180
10203
  exports.ScrollableContainer = ScrollableContainer;
10181
10204
  exports.Scrollbar = Scrollbar;
10182
10205
  exports.Search = Search;
@@ -10185,7 +10208,6 @@ exports.Select = Select;
10185
10208
  exports.SettingsIcon = SettingsIcon;
10186
10209
  exports.SkipToContent = SkipToContent;
10187
10210
  exports.SmsIcon = SmsIcon;
10188
- exports.SortCell = SortCell;
10189
10211
  exports.Spinner = Spinner;
10190
10212
  exports.SplitButton = SplitButton;
10191
10213
  exports.StarFilledIcon = StarFilledIcon;
@@ -10197,7 +10219,6 @@ exports.TabList = TabList;
10197
10219
  exports.TabPanel = TabPanel;
10198
10220
  exports.TabPanels = TabPanels;
10199
10221
  exports.Table = Table;
10200
- exports.TableWrapper = TableWrapper;
10201
10222
  exports.Tabs = Tabs;
10202
10223
  exports.Tag = Tag;
10203
10224
  exports.TextArea = TextArea;
@@ -4,6 +4,7 @@ import '../../helpers/styling/hover.js';
4
4
  import '../../helpers/styling/focus.js';
5
5
  import '../../helpers/styling/danger.js';
6
6
  import { selection } from '../../helpers/styling/selection.js';
7
+ import { normalizeButton } from '../../helpers/styling/normalize.js';
7
8
  import { getFontStyling } from '../Typography/Typography.utils.js';
8
9
  import { typographyTypes, buttonTokens } from './Button.tokens.js';
9
10
 
@@ -25,7 +26,7 @@ var getAppearanceAndPurposeStyling = function getAppearanceAndPurposeStyling(app
25
26
  var ButtonWrapper = styled.button.withConfig({
26
27
  displayName: "Buttonstyles__ButtonWrapper",
27
28
  componentId: "sc-14dutqk-0"
28
- })(["border:", ";user-select:text;display:inline-flex;align-items:center;justify-content:center;height:fit-content;width:", ";cursor:pointer;box-shadow:none;text-decoration:none;@media (prefers-reduced-motion:no-preference){transition:background-color 0.2s,text-decoration-color 0.2s,box-shadow 0.2s,border-color 0.2s,color 0.2s,", ";}", " ", " ", " ", " ", " &:focus-visible,&.focus-visible{", "}*::selection{", "}"], base.border, function (_ref) {
29
+ })(["", " border:", ";user-select:text;display:inline-flex;align-items:center;justify-content:center;height:fit-content;width:", ";cursor:pointer;box-shadow:none;text-decoration:none;@media (prefers-reduced-motion:no-preference){transition:background-color 0.2s,text-decoration-color 0.2s,box-shadow 0.2s,border-color 0.2s,color 0.2s,", ";}", " ", " ", " ", " ", " &:focus-visible,&.focus-visible{", "}*::selection{", "}"], normalizeButton, base.border, function (_ref) {
29
30
  var fullWidth = _ref.fullWidth;
30
31
  return fullWidth ? '100%' : 'fit-content';
31
32
  }, focusVisibleTransitionValue, function (_ref2) {
@@ -17,6 +17,7 @@ import '../../../helpers/styling/hover.js';
17
17
  import '../../../helpers/styling/focus.js';
18
18
  import '../../../helpers/styling/danger.js';
19
19
  import '../../../helpers/styling/selection.js';
20
+ import { normalizeButton } from '../../../helpers/styling/normalize.js';
20
21
  import { getBaseHTMLProps } from '../../../types/BaseComponentProps.js';
21
22
  import { getFontStyling } from '../../Typography/Typography.utils.js';
22
23
 
@@ -33,7 +34,7 @@ var HeaderContainer = styled.div.withConfig({
33
34
  var HeaderWrapper = styled.button.withConfig({
34
35
  displayName: "CardAccordionHeader__HeaderWrapper",
35
36
  componentId: "sc-1qs6bkj-2"
36
- })(["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:", ";}"], removeButtonStyling, header.hover.boxShadow, header.focus.boxShadow);
37
+ })(["", " 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);
37
38
  var ChevronWrapper = styled.span.withConfig({
38
39
  displayName: "CardAccordionHeader__ChevronWrapper",
39
40
  componentId: "sc-1qs6bkj-3"
@@ -14,6 +14,7 @@ import '../../helpers/styling/hover.js';
14
14
  import '../../helpers/styling/focus.js';
15
15
  import '../../helpers/styling/danger.js';
16
16
  import '../../helpers/styling/selection.js';
17
+ import { normalizeButton } from '../../helpers/styling/normalize.js';
17
18
  import { getFontStyling } from '../Typography/Typography.utils.js';
18
19
 
19
20
  var element = overflowMenuTokens.element,
@@ -26,7 +27,7 @@ var Span = styled.span.withConfig({
26
27
  var Link = styled.a.withConfig({
27
28
  displayName: "OverflowMenuItem__Link",
28
29
  componentId: "sc-1ka2asi-1"
29
- })(["text-align:left;user-select:text;border:none;cursor:pointer;outline:inherit;width:100%;", " @media (prefers-reduced-motion:no-preference){transition:background-color 0.2s;}&:hover{background-color:", ";}&:active{background-color:", ";}&:focus-visible,&.focus-visible{", "}"], elementBaseCSS, link.hover.backgroundColor, link.active.backgroundColor, focusVisibleLink);
30
+ })(["", " text-align:left;user-select:text;border:none;cursor:pointer;outline:inherit;width:100%;", " @media (prefers-reduced-motion:no-preference){transition:background-color 0.2s;}&:hover{background-color:", ";}&:active{background-color:", ";}&:focus-visible,&.focus-visible{", "}"], normalizeButton, elementBaseCSS, link.hover.backgroundColor, link.active.backgroundColor, focusVisibleLink);
30
31
  var IconWrapper = styled.span.withConfig({
31
32
  displayName: "OverflowMenuItem__IconWrapper",
32
33
  componentId: "sc-1ka2asi-2"
@@ -1,5 +1,6 @@
1
1
  declare type ProgressTrackerContextType = {
2
2
  activeStep: number;
3
+ handleStepChange?: (index: number) => void;
3
4
  };
4
5
  export declare const ProgressTrackerContext: import("react").Context<ProgressTrackerContextType>;
5
6
  export declare const useProgressTrackerContext: () => ProgressTrackerContextType;
@@ -4,6 +4,10 @@ import { ProgressTrackerItem } from './ProgressTrackerItem';
4
4
  declare type ProgressTrackerProps = BaseComponentPropsWithChildren<HTMLDivElement, {
5
5
  /** Indeksen til det aktive steget. */
6
6
  activeStep?: number;
7
+ /** Ekstra logikk ved klikking på et steg. */
8
+ onStepChange?: (step: number) => void;
9
+ /** Om brukeren kan hoppe mellom stegene via museklikk på et steg. */
10
+ clickable?: boolean;
7
11
  }>;
8
12
  declare type ProgressTrackerComponent = ForwardRefExoticComponent<ProgressTrackerProps> & {
9
13
  Item: typeof ProgressTrackerItem;
@@ -21,14 +21,21 @@ var ProgressTracker = function () {
21
21
  var id = props.id,
22
22
  _props$activeStep = props.activeStep,
23
23
  activeStep = _props$activeStep === void 0 ? 0 : _props$activeStep,
24
+ onStepChange = props.onStepChange,
25
+ _props$clickable = props.clickable,
26
+ clickable = _props$clickable === void 0 ? false : _props$clickable,
24
27
  children = props.children,
25
28
  className = props.className,
26
29
  htmlProps = props.htmlProps,
27
- rest = __rest(props, ["id", "activeStep", "children", "className", "htmlProps"]);
30
+ rest = __rest(props, ["id", "activeStep", "onStepChange", "clickable", "children", "className", "htmlProps"]);
28
31
  var _useState = useState(activeStep),
29
32
  _useState2 = _slicedToArray(_useState, 2),
30
33
  thisActiveStep = _useState2[0],
31
34
  setActiveStep = _useState2[1];
35
+ var handleChange = function handleChange(step) {
36
+ setActiveStep(step);
37
+ onStepChange && onStepChange(step);
38
+ };
32
39
  useEffect(function () {
33
40
  if (activeStep !== undefined && activeStep != thisActiveStep) {
34
41
  setActiveStep(activeStep);
@@ -45,7 +52,8 @@ var ProgressTracker = function () {
45
52
  }, [children]);
46
53
  return jsx(ProgressTrackerContext.Provider, Object.assign({
47
54
  value: {
48
- activeStep: thisActiveStep
55
+ activeStep: thisActiveStep,
56
+ handleStepChange: clickable ? handleChange : undefined
49
57
  }
50
58
  }, {
51
59
  children: jsx("div", Object.assign({
@@ -2,6 +2,8 @@ declare const _default: {
2
2
  title: string;
3
3
  component: import("react").ForwardRefExoticComponent<Pick<import("react").HTMLAttributes<HTMLDivElement>, "id" | "className"> & {
4
4
  activeStep?: number | undefined;
5
+ onStepChange?: ((step: number) => void) | undefined;
6
+ clickable?: boolean | undefined;
5
7
  } & {
6
8
  children?: import("react").ReactNode;
7
9
  } & {
@@ -103,11 +103,12 @@ var ProgressTrackerItem = function ProgressTrackerItem(props) {
103
103
  icon = props.icon,
104
104
  children = props.children;
105
105
  var _useProgressTrackerCo = useProgressTrackerContext(),
106
- activeStep = _useProgressTrackerCo.activeStep;
106
+ activeStep = _useProgressTrackerCo.activeStep,
107
+ handleStepChange = _useProgressTrackerCo.handleStepChange;
107
108
  var active = activeStep === index;
108
109
  var styleProps = {
109
110
  state: toItemState(active, completed, disabled),
110
- clickable: props.onClick !== undefined
111
+ clickable: handleStepChange !== undefined
111
112
  };
112
113
  var stepNumberContent = useMemo(function () {
113
114
  if (completed) {
@@ -128,9 +129,9 @@ var ProgressTrackerItem = function ProgressTrackerItem(props) {
128
129
  "aria-current": active ? 'step' : undefined
129
130
  }, {
130
131
  children: jsxs(ItemContentWrapper, Object.assign({}, styleProps, {
131
- as: props.onClick ? 'button' : 'div',
132
- onClick: !disabled && props.onClick ? function () {
133
- return props.onClick(index);
132
+ as: handleStepChange ? 'button' : 'div',
133
+ onClick: !disabled && handleStepChange ? function () {
134
+ return handleStepChange(index);
134
135
  } : undefined,
135
136
  disabled: disabled
136
137
  }, {
@@ -63,7 +63,9 @@ var OuterContainer = styled.div.withConfig({
63
63
  var HorisontalContainer = styled.div.withConfig({
64
64
  displayName: "Search__HorisontalContainer",
65
65
  componentId: "sc-1ax3s9s-3"
66
- })(["display:grid;grid-template-columns:1fr auto;gap:", ";"], horisontalContainer.gap);
66
+ })(["", ""], function (props) {
67
+ return props.hasSearchButton && css(["display:grid;grid-template-columns:1fr auto;gap:", ";"], horisontalContainer.gap);
68
+ });
67
69
  var InputContainer = styled.div.withConfig({
68
70
  displayName: "Search__InputContainer",
69
71
  componentId: "sc-1ax3s9s-4"
@@ -114,13 +116,16 @@ var Search = /*#__PURE__*/forwardRef(function (_a, ref) {
114
116
  onClick = _b.onClick,
115
117
  otherButtonProps = __rest(_b, ["label", "onClick"]);
116
118
  var hasSuggestions = !!context.suggestions;
119
+ var showSearchButton = !!buttonProps && !!onClick;
117
120
  return jsxs(OuterContainer, {
118
121
  children: [hasLabel && jsx(Label, Object.assign({
119
122
  htmlFor: uniqueId
120
123
  }, {
121
124
  children: label
122
125
  })), jsxs("div", {
123
- children: [jsxs(HorisontalContainer, Object.assign({}, containerProps, {
126
+ children: [jsxs(HorisontalContainer, Object.assign({
127
+ hasSearchButton: showSearchButton
128
+ }, containerProps, {
124
129
  children: [jsxs(InputContainer, {
125
130
  children: [jsx(StyledIcon, {
126
131
  icon: SearchIcon,
@@ -147,7 +152,7 @@ var Search = /*#__PURE__*/forwardRef(function (_a, ref) {
147
152
  children: "Bla i s\xF8keforslag med piltaster n\xE5r listen er utvidet."
148
153
  }))]
149
154
  })]
150
- }), buttonProps && onClick && jsx(Button, Object.assign({
155
+ }), showSearchButton && jsx(Button, Object.assign({
151
156
  size: componentSize,
152
157
  label: buttonLabel || 'Søk',
153
158
  onClick: onClick
@@ -1,3 +1,3 @@
1
1
  import { HTMLAttributes } from 'react';
2
- export declare type BodyProps = HTMLAttributes<HTMLTableSectionElement>;
3
- export declare const Body: import("react").ForwardRefExoticComponent<BodyProps & import("react").RefAttributes<HTMLTableSectionElement>>;
2
+ export declare type TableBodyProps = HTMLAttributes<HTMLTableSectionElement>;
3
+ export declare const Body: import("react").ForwardRefExoticComponent<TableBodyProps & import("react").RefAttributes<HTMLTableSectionElement>>;
@@ -1,3 +1,3 @@
1
1
  import { HTMLAttributes } from 'react';
2
- export declare type FootProps = HTMLAttributes<HTMLTableSectionElement>;
3
- export declare const Foot: import("react").ForwardRefExoticComponent<FootProps & import("react").RefAttributes<HTMLTableSectionElement>>;
2
+ export declare type TableFootProps = HTMLAttributes<HTMLTableSectionElement>;
3
+ export declare const Foot: import("react").ForwardRefExoticComponent<TableFootProps & import("react").RefAttributes<HTMLTableSectionElement>>;
@@ -1,3 +1,3 @@
1
1
  import { HTMLAttributes } from 'react';
2
- export declare type HeadProps = HTMLAttributes<HTMLTableSectionElement>;
3
- export declare const Head: import("react").ForwardRefExoticComponent<HeadProps & import("react").RefAttributes<HTMLTableSectionElement>>;
2
+ export declare type TableHeadProps = HTMLAttributes<HTMLTableSectionElement>;
3
+ export declare const Head: import("react").ForwardRefExoticComponent<TableHeadProps & import("react").RefAttributes<HTMLTableSectionElement>>;
@@ -1,7 +1,7 @@
1
1
  import { MouseEvent } from 'react';
2
2
  import { TableCellProps } from './Cell';
3
3
  export declare type SortOrder = 'ascending' | 'descending';
4
- export declare type SortCellProps = {
4
+ export declare type TableSortCellProps = {
5
5
  /**Spesifiserer om kolonnen er sortert. */
6
6
  isSorted?: boolean;
7
7
  /**Sorteringsrekkefølge i kolonnen. Avgjør hvilket ikon skal vises i cellen. */
@@ -15,12 +15,13 @@ import '../../helpers/styling/hover.js';
15
15
  import '../../helpers/styling/focus.js';
16
16
  import '../../helpers/styling/danger.js';
17
17
  import '../../helpers/styling/selection.js';
18
+ import { normalizeButton } from '../../helpers/styling/normalize.js';
18
19
 
19
20
  var cell = tableTokens.cell;
20
21
  var StyledButton = styled.button.withConfig({
21
22
  displayName: "SortCell__StyledButton",
22
23
  componentId: "sc-1l3jzvh-0"
23
- })(["user-select:text;", " display:flex;align-items:center;gap:", ";&:focus-visible{", "}"], removeButtonStyling, cell.sort.gap, focusVisible);
24
+ })(["", " user-select:text;", " display:flex;align-items:center;gap:", ";&:focus-visible{", "}"], normalizeButton, removeButtonStyling, cell.sort.gap, focusVisible);
24
25
  var makeSortIcon = function makeSortIcon(isSorted, sortOrder) {
25
26
  if (!isSorted || !sortOrder) {
26
27
  return jsx(Icon, {
@@ -1,11 +1,28 @@
1
- import { TableProps } from '.';
1
+ import { TableProps, SortOrder } from '.';
2
2
  declare const _default: {
3
3
  title: string;
4
4
  component: import("react").ForwardRefExoticComponent<{
5
5
  density?: import("./Table").TableDensity | undefined;
6
6
  stickyHeader?: boolean | undefined;
7
7
  withDividers?: boolean | undefined;
8
- } & import("react").HTMLAttributes<HTMLTableElement> & import("react").RefAttributes<HTMLTableElement>>;
8
+ } & import("react").HTMLAttributes<HTMLTableElement> & import("react").RefAttributes<HTMLTableElement>> & {
9
+ Wrapper: ({ children, ...rest }: import("./TableWrapper").TableWrapperProps) => JSX.Element;
10
+ Head: import("react").ForwardRefExoticComponent<import("./Head").TableHeadProps & import("react").RefAttributes<HTMLTableSectionElement>>;
11
+ Body: import("react").ForwardRefExoticComponent<import("./Body").TableBodyProps & import("react").RefAttributes<HTMLTableSectionElement>>;
12
+ Foot: import("react").ForwardRefExoticComponent<import("./Foot").TableFootProps & import("react").RefAttributes<HTMLTableSectionElement>>;
13
+ Row: import("react").ForwardRefExoticComponent<{
14
+ type?: import("./Row").TableRowType | undefined;
15
+ mode?: import("./Row").RowMode | undefined;
16
+ selected?: boolean | undefined;
17
+ hoverable?: boolean | undefined;
18
+ } & import("react").HTMLAttributes<HTMLTableRowElement> & import("react").RefAttributes<HTMLTableRowElement>>;
19
+ Cell: import("react").ForwardRefExoticComponent<import("./Cell").TableCellProps & import("react").RefAttributes<HTMLTableCellElement>>;
20
+ SortCell: import("react").ForwardRefExoticComponent<{
21
+ isSorted?: boolean | undefined;
22
+ sortOrder?: SortOrder | undefined;
23
+ onClick: (event: import("react").MouseEvent<HTMLButtonElement, MouseEvent>) => void;
24
+ } & Omit<import("./Cell").TableCellProps, "type"> & import("react").RefAttributes<HTMLTableCellElement>>;
25
+ };
9
26
  argTypes: {
10
27
  stickyHeader: {
11
28
  control: {
@@ -1,8 +1,20 @@
1
- export * from './Table';
2
- export * from './Body';
3
- export * from './Head';
4
- export * from './Row';
5
- export * from './Cell';
6
- export * from './SortCell';
7
- export * from './Foot';
8
- export * from './TableWrapper';
1
+ import { Table as BaseTable, TableProps, TableDensity } from './Table';
2
+ import { Head, TableHeadProps } from './Head';
3
+ import { Body, TableBodyProps } from './Body';
4
+ import { Foot, TableFootProps } from './Foot';
5
+ import { Row, TableRowProps, TableRowType } from './Row';
6
+ import { Cell, TableCellProps, TableCellLayout, TableCellType } from './Cell';
7
+ import { SortCell, TableSortCellProps, SortOrder } from './SortCell';
8
+ import { TableWrapper } from './TableWrapper';
9
+ declare type TableCompoundProps = typeof BaseTable & {
10
+ Wrapper: typeof TableWrapper;
11
+ Head: typeof Head;
12
+ Body: typeof Body;
13
+ Foot: typeof Foot;
14
+ Row: typeof Row;
15
+ Cell: typeof Cell;
16
+ SortCell: typeof SortCell;
17
+ };
18
+ declare const Table: TableCompoundProps;
19
+ export { Table };
20
+ export type { TableCellProps, TableDensity, TableProps, TableRowProps, TableRowType, TableHeadProps, TableBodyProps, TableFootProps, TableSortCellProps, SortOrder, TableCellLayout, TableCellType, };
@@ -0,0 +1,19 @@
1
+ import { Table as Table$1 } from './Table.js';
2
+ import { Head } from './Head.js';
3
+ import { Body } from './Body.js';
4
+ import { Foot } from './Foot.js';
5
+ import { Row } from './Row.js';
6
+ import { Cell } from './Cell.js';
7
+ import { SortCell } from './SortCell.js';
8
+ import { TableWrapper } from './TableWrapper.js';
9
+
10
+ var Table = Table$1;
11
+ Table.Wrapper = TableWrapper;
12
+ Table.Head = Head;
13
+ Table.Body = Body;
14
+ Table.Cell = Cell;
15
+ Table.SortCell = SortCell;
16
+ Table.Row = Row;
17
+ Table.Foot = Foot;
18
+
19
+ export { Table };
@@ -17,13 +17,14 @@ import '../../helpers/styling/hover.js';
17
17
  import '../../helpers/styling/focus.js';
18
18
  import '../../helpers/styling/danger.js';
19
19
  import '../../helpers/styling/selection.js';
20
+ import { normalizeButton } from '../../helpers/styling/normalize.js';
20
21
  import { getFontStyling, defaultTypographyType } from '../Typography/Typography.utils.js';
21
22
 
22
23
  var tab = tabsTokens.tab;
23
24
  var Button = styled.button.withConfig({
24
25
  displayName: "Tab__Button",
25
26
  componentId: "sc-1dd8soq-0"
26
- })(["", " user-select:text;display:flex;align-items:center;justify-content:center;border-bottom:", ";color:", ";padding:", ";", " @media (prefers-reduced-motion:no-preference){transition:box-shadow 0.2s,border-bottom 0.2s,color 0.2s,", ";}", ";", " &:focus-visible{", " outline-offset:-1px;}&:hover{border-color:", ";color:", ";box-shadow:", ";}"], removeButtonStyling, tab.base.borderBottom, tab.base.color, tab.base.padding, getFontStyling(defaultTypographyType), focusVisibleTransitionValue, function (_ref) {
27
+ })(["", " ", " user-select:text;display:flex;align-items:center;justify-content:center;border-bottom:", ";color:", ";padding:", ";", " @media (prefers-reduced-motion:no-preference){transition:box-shadow 0.2s,border-bottom 0.2s,color 0.2s,", ";}", ";", " &:focus-visible{", " outline-offset:-1px;}&:hover{border-color:", ";color:", ";box-shadow:", ";}"], normalizeButton, removeButtonStyling, tab.base.borderBottom, tab.base.color, tab.base.padding, getFontStyling(defaultTypographyType), focusVisibleTransitionValue, function (_ref) {
27
28
  var direction = _ref.direction;
28
29
  return css(["flex-direction:", ";gap:", ";"], direction, tab[direction].gap);
29
30
  }, function (_ref2) {
@@ -63,7 +63,7 @@ var getMarginStyling = function getMarginStyling(typographyType, element, withMa
63
63
  return withMargins ? css(["", " margin-top:", ";margin-bottom:", ";", ""], isInlineElement(element) && element !== 'a' && css(["display:block;"]), typographyTokens.typographyType[typographyType].margins.marginTop, typographyTokens.typographyType[typographyType].margins.marginBottom, css(["padding-top:", ";"], typographyTokens.typographyType[typographyType].margins.paddingTop)) : css(["margin:0;"]);
64
64
  };
65
65
  var getAnchorStyling = function getAnchorStyling(external, interactionStyling, typographyType, withMargins) {
66
- return css(["", " color:", ";width:fit-content;text-decoration:underline;@media (prefers-reduced-motion:no-preference){transition:", ";}", " &:hover{color:", ";", "}", " &:focus-visible,&.focus-visible,&:focus-visible::selection,&.focus-visible::selection{", "}"], typographyType ? css(["", ";", ""], typographyTokens.typographyType[typographyType].base.font, getMarginStyling(typographyType, 'a', withMargins)) : css(["font:inherit;", ""], getMarginStyling('a', 'a', withMargins)), typographyTokens.typographyType.a.base.color, focusVisibleLinkTransitionValue, external && css(["padding-right:calc(1em + ", ");::after{mask:", " no-repeat center/contain;background:0 0;background-color:currentColor;width:1em;height:1em;content:'';position:absolute;margin-top:", ";margin-left:", ";}"], typographyTokens.typographyType.a.icon.marginLeft, "url(\"".concat(OpenExternalIcon, "\")"), typographyTokens.typographyType.a.icon.marginTop, typographyTokens.typographyType.a.icon.marginLeft), typographyTokens.typographyType.a.hover.color, interactionStyling && interactionStyling.hover && css(["", ""], interactionStyling.hover), interactionStyling && interactionStyling.active && css(["&:active{", "}"], interactionStyling.active), focusVisibleLink);
66
+ return css(["", " color:", ";width:fit-content;text-decoration:underline;@media (prefers-reduced-motion:no-preference){transition:", ";}", " &:hover{color:", ";", "}", " &:focus-visible,&.focus-visible,&:focus-visible::selection,&.focus-visible::selection{", "}"], typographyType ? css(["", ";", ""], typographyTokens.typographyType[typographyType].base.font, getMarginStyling(typographyType, 'a', withMargins)) : css(["font:inherit;", ""], getMarginStyling('a', 'a', withMargins)), typographyTokens.typographyType.a.base.color, focusVisibleLinkTransitionValue, external && css(["padding-right:calc(1em + ", ");position:relative;::after{mask:", " no-repeat center/contain;background:0 0;background-color:currentColor;width:1em;height:1em;content:'';position:absolute;margin-top:", ";margin-left:", ";}"], typographyTokens.typographyType.a.icon.marginLeft, "url(\"".concat(OpenExternalIcon, "\")"), typographyTokens.typographyType.a.icon.marginTop, typographyTokens.typographyType.a.icon.marginLeft), typographyTokens.typographyType.a.hover.color, interactionStyling && interactionStyling.hover && css(["", ""], interactionStyling.hover), interactionStyling && interactionStyling.active && css(["&:active{", "}"], interactionStyling.active), focusVisibleLink);
67
67
  };
68
68
 
69
69
  export { defaultTypographyType, getAdditionalFontStyle, getAnchorStyling, getElementType, getFontStyling, getMarginStyling, inlineElements, isInlineElement };
@@ -6,3 +6,4 @@ export * from './focus';
6
6
  export * from './danger';
7
7
  export * from './hideInput';
8
8
  export * from './selection';
9
+ export * from './normalize';
@@ -0,0 +1,5 @@
1
+ import { Property } from 'csstype';
2
+ export declare const normalizeButton: {
3
+ margin: number;
4
+ textTransform: Property.TextTransform;
5
+ };
@@ -0,0 +1,6 @@
1
+ var normalizeButton = {
2
+ margin: 0,
3
+ textTransform: 'none'
4
+ };
5
+
6
+ export { normalizeButton };
package/dist/index.js CHANGED
@@ -16,14 +16,7 @@ export { Heading } from './components/Typography/Heading/Heading.js';
16
16
  export { Link } from './components/Typography/Link/Link.js';
17
17
  export { Legend } from './components/Typography/Legend/Legend.js';
18
18
  export { Caption } from './components/Typography/Caption/Caption.js';
19
- export { Table } from './components/Table/Table.js';
20
- export { Body } from './components/Table/Body.js';
21
- export { Head } from './components/Table/Head.js';
22
- export { Row } from './components/Table/Row.js';
23
- export { Cell } from './components/Table/Cell.js';
24
- export { SortCell } from './components/Table/SortCell.js';
25
- export { Foot } from './components/Table/Foot.js';
26
- export { TableWrapper } from './components/Table/TableWrapper.js';
19
+ export { Table } from './components/Table/index.js';
27
20
  export { Breadcrumb } from './components/Breadcrumbs/Breadcrumb.js';
28
21
  export { Breadcrumbs } from './components/Breadcrumbs/Breadcrumbs.js';
29
22
  export { Icon } from './components/Icon/Icon.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@norges-domstoler/dds-components",
3
- "version": "9.5.0",
3
+ "version": "10.0.0",
4
4
  "description": "React components used in Elsa - domstolenes designsystem",
5
5
  "author": "Elsa team",
6
6
  "license": "MIT",