@telia/teddy 0.0.37 → 0.0.38

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 (99) hide show
  1. package/dist/components/card/card-button.cjs +42 -0
  2. package/dist/components/card/card-button.d.ts +35 -0
  3. package/dist/components/card/card-button.js +42 -0
  4. package/dist/components/card/card-content.cjs +15 -0
  5. package/dist/components/card/card-content.d.ts +6 -0
  6. package/dist/components/card/card-content.js +15 -0
  7. package/dist/components/card/card-footer.cjs +15 -0
  8. package/dist/components/card/card-footer.d.ts +6 -0
  9. package/dist/components/card/card-footer.js +15 -0
  10. package/dist/components/card/card-heading.cjs +25 -0
  11. package/dist/components/card/card-heading.d.ts +6 -0
  12. package/dist/components/card/card-heading.js +25 -0
  13. package/dist/components/card/card-illustration.cjs +22 -0
  14. package/dist/components/card/card-illustration.d.ts +15 -0
  15. package/dist/components/card/card-illustration.js +22 -0
  16. package/dist/components/card/card-line.cjs +13 -0
  17. package/dist/components/card/card-line.d.ts +5 -0
  18. package/dist/components/card/card-line.js +13 -0
  19. package/dist/components/card/card-link.cjs +18 -0
  20. package/dist/components/card/card-link.d.ts +11 -0
  21. package/dist/components/card/card-link.js +18 -0
  22. package/dist/components/card/card-slot.cjs +36 -0
  23. package/dist/components/card/card-slot.d.ts +8 -0
  24. package/dist/components/card/card-slot.js +36 -0
  25. package/dist/components/card/card.cjs +38 -171
  26. package/dist/components/card/card.d.ts +15 -99
  27. package/dist/components/card/card.js +39 -172
  28. package/dist/components/card/index.cjs +28 -1
  29. package/dist/components/card/index.d.ts +64 -2
  30. package/dist/components/card/index.js +28 -1
  31. package/dist/components/card/utils.cjs +4 -0
  32. package/dist/components/card/utils.d.ts +2 -0
  33. package/dist/components/card/utils.js +4 -0
  34. package/dist/components/date-picker/css.cjs +59 -0
  35. package/dist/components/date-picker/css.d.ts +1 -0
  36. package/dist/components/date-picker/css.js +59 -0
  37. package/dist/components/date-picker/date-picker-day.cjs +67 -0
  38. package/dist/components/date-picker/date-picker-day.d.ts +13 -0
  39. package/dist/components/date-picker/date-picker-day.js +67 -0
  40. package/dist/components/date-picker/date-picker-input.cjs +89 -0
  41. package/dist/components/date-picker/date-picker-input.d.ts +27 -0
  42. package/dist/components/date-picker/date-picker-input.js +90 -0
  43. package/dist/components/date-picker/date-picker-localization.cjs +31 -0
  44. package/dist/components/date-picker/date-picker-localization.d.ts +20 -0
  45. package/dist/components/date-picker/date-picker-localization.js +32 -0
  46. package/dist/components/date-picker/date-picker-month.cjs +42 -0
  47. package/dist/components/date-picker/date-picker-month.d.ts +20 -0
  48. package/dist/components/date-picker/date-picker-month.js +43 -0
  49. package/dist/components/date-picker/date-picker-navigation-key.cjs +15 -0
  50. package/dist/components/date-picker/date-picker-navigation-key.d.ts +14 -0
  51. package/dist/components/date-picker/date-picker-navigation-key.js +16 -0
  52. package/dist/components/date-picker/date-picker-props.cjs +1 -0
  53. package/dist/components/date-picker/date-picker-props.d.ts +23 -0
  54. package/dist/components/date-picker/date-picker-props.js +1 -0
  55. package/dist/components/date-picker/date-picker-unique-id.cjs +4 -0
  56. package/dist/components/date-picker/date-picker-unique-id.d.ts +1 -0
  57. package/dist/components/date-picker/date-picker-unique-id.js +4 -0
  58. package/dist/components/date-picker/date-picker-year-print.cjs +61 -0
  59. package/dist/components/date-picker/date-picker-year-print.d.ts +12 -0
  60. package/dist/components/date-picker/date-picker-year-print.js +61 -0
  61. package/dist/components/date-picker/date-picker-year.cjs +36 -0
  62. package/dist/components/date-picker/date-picker-year.d.ts +16 -0
  63. package/dist/components/date-picker/date-picker-year.js +37 -0
  64. package/dist/components/date-picker/date-picker.cjs +597 -0
  65. package/dist/components/date-picker/date-picker.d.ts +5 -0
  66. package/dist/components/date-picker/date-picker.js +597 -0
  67. package/dist/components/date-picker/date-utils.cjs +340 -0
  68. package/dist/components/date-picker/date-utils.d.ts +29 -0
  69. package/dist/components/date-picker/date-utils.js +340 -0
  70. package/dist/components/date-picker/date-year-range.cjs +1 -0
  71. package/dist/components/date-picker/date-year-range.d.ts +4 -0
  72. package/dist/components/date-picker/date-year-range.js +1 -0
  73. package/dist/components/date-picker/dialog-utils.cjs +36 -0
  74. package/dist/components/date-picker/dialog-utils.d.ts +3 -0
  75. package/dist/components/date-picker/dialog-utils.js +36 -0
  76. package/dist/components/date-picker/index.cjs +4 -0
  77. package/dist/components/date-picker/index.d.ts +2 -0
  78. package/dist/components/date-picker/index.js +4 -0
  79. package/dist/components/expandable-card/expandable-card-root.cjs +15 -15
  80. package/dist/components/expandable-card/expandable-card-root.js +15 -15
  81. package/dist/components/image/image.cjs +1 -1
  82. package/dist/components/image/image.js +1 -1
  83. package/dist/components/index.cjs +4 -2
  84. package/dist/components/index.d.ts +1 -0
  85. package/dist/components/index.js +3 -1
  86. package/dist/components/modal/modal.cjs +4 -4
  87. package/dist/components/modal/modal.js +4 -4
  88. package/dist/components/navigation-menu/global-navigation/global-navigation-my-pages.cjs +5 -5
  89. package/dist/components/navigation-menu/global-navigation/global-navigation-my-pages.js +5 -5
  90. package/dist/components/navigation-menu/global-navigation/utils.cjs +127 -126
  91. package/dist/components/navigation-menu/global-navigation/utils.d.ts +227 -219
  92. package/dist/components/navigation-menu/global-navigation/utils.js +127 -126
  93. package/dist/components/notification/notification.cjs +2 -2
  94. package/dist/components/notification/notification.d.ts +7 -7
  95. package/dist/components/notification/notification.js +1 -1
  96. package/dist/main.cjs +4 -2
  97. package/dist/main.js +3 -1
  98. package/dist/style.css +623 -179
  99. package/package.json +1 -1
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ function chunk(array, chunkSize) {
4
+ const result = [];
5
+ for (let i = 0; i < array.length; i += chunkSize) {
6
+ result.push(array.slice(i, i + chunkSize));
7
+ }
8
+ return result;
9
+ }
10
+ function mapWithOffset(array, startingOffset, mapFn) {
11
+ return array.map((_, i) => {
12
+ const adjustedIndex = (i + startingOffset) % array.length;
13
+ return mapFn(array[adjustedIndex]);
14
+ });
15
+ }
16
+ function cleanValue(input, regex) {
17
+ const value = input.value;
18
+ if (value) {
19
+ const cursor = input.selectionStart;
20
+ if (cursor) {
21
+ const beforeCursor = value.slice(0, cursor);
22
+ const afterCursor = value.slice(cursor, value.length);
23
+ const filteredBeforeCursor = beforeCursor.replace(regex, "");
24
+ const filterAfterCursor = afterCursor.replace(regex, "");
25
+ const newValue = filteredBeforeCursor + filterAfterCursor;
26
+ const newCursor = filteredBeforeCursor.length;
27
+ input.value = newValue;
28
+ input.selectionStart = input.selectionEnd = newCursor;
29
+ return newValue;
30
+ }
31
+ }
32
+ return value;
33
+ }
34
+ exports.chunk = chunk;
35
+ exports.cleanValue = cleanValue;
36
+ exports.mapWithOffset = mapWithOffset;
@@ -0,0 +1,3 @@
1
+ export declare function chunk<T>(array: T[], chunkSize: number): T[][];
2
+ export declare function mapWithOffset<T, U>(array: T[], startingOffset: number, mapFn: (item: T) => U): U[];
3
+ export declare function cleanValue(input: HTMLInputElement, regex: RegExp): string;
@@ -0,0 +1,36 @@
1
+ function chunk(array, chunkSize) {
2
+ const result = [];
3
+ for (let i = 0; i < array.length; i += chunkSize) {
4
+ result.push(array.slice(i, i + chunkSize));
5
+ }
6
+ return result;
7
+ }
8
+ function mapWithOffset(array, startingOffset, mapFn) {
9
+ return array.map((_, i) => {
10
+ const adjustedIndex = (i + startingOffset) % array.length;
11
+ return mapFn(array[adjustedIndex]);
12
+ });
13
+ }
14
+ function cleanValue(input, regex) {
15
+ const value = input.value;
16
+ if (value) {
17
+ const cursor = input.selectionStart;
18
+ if (cursor) {
19
+ const beforeCursor = value.slice(0, cursor);
20
+ const afterCursor = value.slice(cursor, value.length);
21
+ const filteredBeforeCursor = beforeCursor.replace(regex, "");
22
+ const filterAfterCursor = afterCursor.replace(regex, "");
23
+ const newValue = filteredBeforeCursor + filterAfterCursor;
24
+ const newCursor = filteredBeforeCursor.length;
25
+ input.value = newValue;
26
+ input.selectionStart = input.selectionEnd = newCursor;
27
+ return newValue;
28
+ }
29
+ }
30
+ return value;
31
+ }
32
+ export {
33
+ chunk,
34
+ cleanValue,
35
+ mapWithOffset
36
+ };
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const components_datePicker_datePicker = require("./date-picker.cjs");
4
+ exports.DatePicker = components_datePicker_datePicker.DatePicker;
@@ -0,0 +1,2 @@
1
+ export { DatePicker } from './date-picker';
2
+ export type { default as DatePickerProps } from './date-picker-props';
@@ -0,0 +1,4 @@
1
+ import { DatePicker } from "./date-picker.js";
2
+ export {
3
+ DatePicker
4
+ };
@@ -22,21 +22,21 @@ function _interopNamespaceDefault(e) {
22
22
  }
23
23
  const AccordionPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(AccordionPrimitive);
24
24
  const styles = {
25
- "teddy-expandable-card": "_teddy-expandable-card_15whs_1",
26
- "teddy-expandable-card__item": "_teddy-expandable-card__item_15whs_7",
27
- "teddy-expandable-card__trigger": "_teddy-expandable-card__trigger_15whs_15",
28
- "teddy-expandable-card__indicator": "_teddy-expandable-card__indicator_15whs_39",
29
- "teddy-expandable-card__hidden": "_teddy-expandable-card__hidden_15whs_51",
30
- "teddy-expandable-card__line": "_teddy-expandable-card__line_15whs_57",
31
- "teddy-expandable-card__content": "_teddy-expandable-card__content_15whs_60",
32
- "teddy-expandable-card__description": "_teddy-expandable-card__description_15whs_69",
33
- "teddy-expandable-card__price": "_teddy-expandable-card__price_15whs_80",
34
- "teddy-expandable-card__header": "_teddy-expandable-card__header_15whs_84",
35
- "teddy-expandable-card__slot": "_teddy-expandable-card__slot_15whs_92",
36
- "teddy-expandable-card__slot--bottom": "_teddy-expandable-card__slot--bottom_15whs_97",
37
- "teddy-expandable-card__slot--center": "_teddy-expandable-card__slot--center_15whs_100",
38
- "teddy-expandable-card__button--right": "_teddy-expandable-card__button--right_15whs_116",
39
- "teddy-expandable-card__button--left": "_teddy-expandable-card__button--left_15whs_119"
25
+ "teddy-expandable-card": "_teddy-expandable-card_o9m1o_1",
26
+ "teddy-expandable-card__item": "_teddy-expandable-card__item_o9m1o_6",
27
+ "teddy-expandable-card__trigger": "_teddy-expandable-card__trigger_o9m1o_15",
28
+ "teddy-expandable-card__indicator": "_teddy-expandable-card__indicator_o9m1o_39",
29
+ "teddy-expandable-card__hidden": "_teddy-expandable-card__hidden_o9m1o_51",
30
+ "teddy-expandable-card__line": "_teddy-expandable-card__line_o9m1o_57",
31
+ "teddy-expandable-card__content": "_teddy-expandable-card__content_o9m1o_60",
32
+ "teddy-expandable-card__description": "_teddy-expandable-card__description_o9m1o_69",
33
+ "teddy-expandable-card__price": "_teddy-expandable-card__price_o9m1o_80",
34
+ "teddy-expandable-card__header": "_teddy-expandable-card__header_o9m1o_84",
35
+ "teddy-expandable-card__slot": "_teddy-expandable-card__slot_o9m1o_92",
36
+ "teddy-expandable-card__slot--bottom": "_teddy-expandable-card__slot--bottom_o9m1o_97",
37
+ "teddy-expandable-card__slot--center": "_teddy-expandable-card__slot--center_o9m1o_100",
38
+ "teddy-expandable-card__button--right": "_teddy-expandable-card__button--right_o9m1o_116",
39
+ "teddy-expandable-card__button--left": "_teddy-expandable-card__button--left_o9m1o_119"
40
40
  };
41
41
  const rootClassName = "teddy-expandable-card";
42
42
  const Root = React.forwardRef(
@@ -3,21 +3,21 @@ import React__default from "react";
3
3
  import clsx from "clsx";
4
4
  import * as AccordionPrimitive from "@radix-ui/react-accordion";
5
5
  const styles = {
6
- "teddy-expandable-card": "_teddy-expandable-card_15whs_1",
7
- "teddy-expandable-card__item": "_teddy-expandable-card__item_15whs_7",
8
- "teddy-expandable-card__trigger": "_teddy-expandable-card__trigger_15whs_15",
9
- "teddy-expandable-card__indicator": "_teddy-expandable-card__indicator_15whs_39",
10
- "teddy-expandable-card__hidden": "_teddy-expandable-card__hidden_15whs_51",
11
- "teddy-expandable-card__line": "_teddy-expandable-card__line_15whs_57",
12
- "teddy-expandable-card__content": "_teddy-expandable-card__content_15whs_60",
13
- "teddy-expandable-card__description": "_teddy-expandable-card__description_15whs_69",
14
- "teddy-expandable-card__price": "_teddy-expandable-card__price_15whs_80",
15
- "teddy-expandable-card__header": "_teddy-expandable-card__header_15whs_84",
16
- "teddy-expandable-card__slot": "_teddy-expandable-card__slot_15whs_92",
17
- "teddy-expandable-card__slot--bottom": "_teddy-expandable-card__slot--bottom_15whs_97",
18
- "teddy-expandable-card__slot--center": "_teddy-expandable-card__slot--center_15whs_100",
19
- "teddy-expandable-card__button--right": "_teddy-expandable-card__button--right_15whs_116",
20
- "teddy-expandable-card__button--left": "_teddy-expandable-card__button--left_15whs_119"
6
+ "teddy-expandable-card": "_teddy-expandable-card_o9m1o_1",
7
+ "teddy-expandable-card__item": "_teddy-expandable-card__item_o9m1o_6",
8
+ "teddy-expandable-card__trigger": "_teddy-expandable-card__trigger_o9m1o_15",
9
+ "teddy-expandable-card__indicator": "_teddy-expandable-card__indicator_o9m1o_39",
10
+ "teddy-expandable-card__hidden": "_teddy-expandable-card__hidden_o9m1o_51",
11
+ "teddy-expandable-card__line": "_teddy-expandable-card__line_o9m1o_57",
12
+ "teddy-expandable-card__content": "_teddy-expandable-card__content_o9m1o_60",
13
+ "teddy-expandable-card__description": "_teddy-expandable-card__description_o9m1o_69",
14
+ "teddy-expandable-card__price": "_teddy-expandable-card__price_o9m1o_80",
15
+ "teddy-expandable-card__header": "_teddy-expandable-card__header_o9m1o_84",
16
+ "teddy-expandable-card__slot": "_teddy-expandable-card__slot_o9m1o_92",
17
+ "teddy-expandable-card__slot--bottom": "_teddy-expandable-card__slot--bottom_o9m1o_97",
18
+ "teddy-expandable-card__slot--center": "_teddy-expandable-card__slot--center_o9m1o_100",
19
+ "teddy-expandable-card__button--right": "_teddy-expandable-card__button--right_o9m1o_116",
20
+ "teddy-expandable-card__button--left": "_teddy-expandable-card__button--left_o9m1o_119"
21
21
  };
22
22
  const rootClassName = "teddy-expandable-card";
23
23
  const Root = React__default.forwardRef(
@@ -5,7 +5,7 @@ const React = require("react");
5
5
  const clsx = require("clsx");
6
6
  const utils_generateStyling_index = require("../../utils/generate-styling/index.cjs");
7
7
  const styles = {
8
- "teddy-image": "_teddy-image_oyxp8_1"
8
+ "teddy-image": "_teddy-image_jxcdf_2"
9
9
  };
10
10
  const rootClassName = "teddy-image";
11
11
  const Image = React.forwardRef((props, forwardRef) => {
@@ -3,7 +3,7 @@ import React__default from "react";
3
3
  import clsx from "clsx";
4
4
  import { extractProps } from "../../utils/generate-styling/index.js";
5
5
  const styles = {
6
- "teddy-image": "_teddy-image_oyxp8_1"
6
+ "teddy-image": "_teddy-image_jxcdf_2"
7
7
  };
8
8
  const rootClassName = "teddy-image";
9
9
  const Image = React__default.forwardRef((props, forwardRef) => {
@@ -12,12 +12,13 @@ const components_tabs_index = require("./tabs/index.cjs");
12
12
  const components_drawer_index = require("./drawer/index.cjs");
13
13
  const components_image_image = require("./image/image.cjs");
14
14
  const components_chip_index = require("./chip/index.cjs");
15
+ const components_datePicker_datePicker = require("./date-picker/date-picker.cjs");
15
16
  const components_modal_modal = require("./modal/modal.cjs");
16
17
  const components_notification_notification = require("./notification/notification.cjs");
17
18
  const components_radioGroup_index = require("./radio-group/index.cjs");
18
19
  const components_box_box = require("./box/box.cjs");
19
20
  const components_flex_flex = require("./flex/flex.cjs");
20
- const components_card_card = require("./card/card.cjs");
21
+ const components_card_index = require("./card/index.cjs");
21
22
  const components_grid_grid = require("./grid/grid.cjs");
22
23
  const components_navigationMenu_navigationMenu = require("./navigation-menu/navigation-menu.cjs");
23
24
  const components_navigationMenu_globalNavigation_globalNavigationMyPages = require("./navigation-menu/global-navigation/global-navigation-my-pages.cjs");
@@ -54,12 +55,13 @@ exports.Tabs = components_tabs_index.Tabs;
54
55
  exports.Drawer = components_drawer_index.Drawer;
55
56
  exports.Image = components_image_image.Image;
56
57
  exports.Chip = components_chip_index.Chip;
58
+ exports.DatePicker = components_datePicker_datePicker.DatePicker;
57
59
  exports.Modal = components_modal_modal.Modal;
58
60
  exports.Notification = components_notification_notification.Notification;
59
61
  exports.RadioGroup = components_radioGroup_index.RadioGroup;
60
62
  exports.Box = components_box_box.Box;
61
63
  exports.Flex = components_flex_flex.Flex;
62
- exports.Card = components_card_card.Card;
64
+ exports.Card = components_card_index.Card;
63
65
  exports.Grid = components_grid_grid.Grid;
64
66
  exports.NavigationMenu = components_navigationMenu_navigationMenu.NavigationMenu;
65
67
  exports.GlobalNavigation = components_navigationMenu_globalNavigation_globalNavigationMyPages.GlobalNavigation;
@@ -10,6 +10,7 @@ export * from './tabs';
10
10
  export * from './drawer';
11
11
  export * from './image';
12
12
  export * from './chip';
13
+ export * from './date-picker';
13
14
  export * from './modal';
14
15
  export * from './notification';
15
16
  export * from './radio-group';
@@ -10,12 +10,13 @@ import { Tabs } from "./tabs/index.js";
10
10
  import { Drawer } from "./drawer/index.js";
11
11
  import { Image } from "./image/image.js";
12
12
  import { Chip } from "./chip/index.js";
13
+ import { DatePicker } from "./date-picker/date-picker.js";
13
14
  import { Modal } from "./modal/modal.js";
14
15
  import { Notification } from "./notification/notification.js";
15
16
  import { RadioGroup } from "./radio-group/index.js";
16
17
  import { Box } from "./box/box.js";
17
18
  import { Flex } from "./flex/flex.js";
18
- import { Card } from "./card/card.js";
19
+ import { Card } from "./card/index.js";
19
20
  import { Grid } from "./grid/grid.js";
20
21
  import { NavigationMenu } from "./navigation-menu/navigation-menu.js";
21
22
  import { G } from "./navigation-menu/global-navigation/global-navigation-my-pages.js";
@@ -51,6 +52,7 @@ export {
51
52
  Chip,
52
53
  ColorDot,
53
54
  CounterBadge,
55
+ DatePicker,
54
56
  Drawer,
55
57
  ExpandableCard,
56
58
  FieldErrorText,
@@ -15,11 +15,14 @@ require("../tabs/index.cjs");
15
15
  require("../drawer/index.cjs");
16
16
  require("../image/image.cjs");
17
17
  require("../chip/index.cjs");
18
+ require("../../assets/sprite.269ba410-teddy.svg");
19
+ const components_icon_icon = require("../icon/icon.cjs");
20
+ const clsx = require("clsx");
18
21
  require("../notification/notification.cjs");
19
22
  require("../radio-group/index.cjs");
20
23
  require("../box/box.cjs");
21
24
  const components_flex_flex = require("../flex/flex.cjs");
22
- require("../card/card.cjs");
25
+ require("../card/index.cjs");
23
26
  require("../grid/grid.cjs");
24
27
  require("../navigation-menu/navigation-menu.cjs");
25
28
  require("../navigation-menu/global-navigation/global-navigation-my-pages.cjs");
@@ -32,8 +35,6 @@ require("../badge/counter-badge.cjs");
32
35
  const components_button_button = require("../button/button.cjs");
33
36
  require("../field-error-text/field-error-text.cjs");
34
37
  require("../helper-text/helper-text.cjs");
35
- require("../../assets/sprite.269ba410-teddy.svg");
36
- const components_icon_icon = require("../icon/icon.cjs");
37
38
  require("../input/index.cjs");
38
39
  require("../label/label.cjs");
39
40
  require("../spinner/spinner.cjs");
@@ -42,7 +43,6 @@ require("../text-field/index.cjs");
42
43
  const components_heading_heading = require("../heading/heading.cjs");
43
44
  require("../visually-hidden/visually-hidden.cjs");
44
45
  require("../text-spacing/text-spacing.cjs");
45
- const clsx = require("clsx");
46
46
  const reactSlot = require("@radix-ui/react-slot");
47
47
  const utils_composeRefs = require("../../utils/composeRefs.cjs");
48
48
  function _interopNamespaceDefault(e) {
@@ -13,11 +13,14 @@ import "../tabs/index.js";
13
13
  import "../drawer/index.js";
14
14
  import "../image/image.js";
15
15
  import "../chip/index.js";
16
+ import "../../assets/sprite.269ba410-teddy.svg";
17
+ import { Icon } from "../icon/icon.js";
18
+ import clsx from "clsx";
16
19
  import "../notification/notification.js";
17
20
  import "../radio-group/index.js";
18
21
  import "../box/box.js";
19
22
  import { Flex } from "../flex/flex.js";
20
- import "../card/card.js";
23
+ import "../card/index.js";
21
24
  import "../grid/grid.js";
22
25
  import "../navigation-menu/navigation-menu.js";
23
26
  import "../navigation-menu/global-navigation/global-navigation-my-pages.js";
@@ -30,8 +33,6 @@ import "../badge/counter-badge.js";
30
33
  import { Button } from "../button/button.js";
31
34
  import "../field-error-text/field-error-text.js";
32
35
  import "../helper-text/helper-text.js";
33
- import "../../assets/sprite.269ba410-teddy.svg";
34
- import { Icon } from "../icon/icon.js";
35
36
  import "../input/index.js";
36
37
  import "../label/label.js";
37
38
  import "../spinner/spinner.js";
@@ -40,7 +41,6 @@ import "../text-field/index.js";
40
41
  import { Heading } from "../heading/heading.js";
41
42
  import "../visually-hidden/visually-hidden.js";
42
43
  import "../text-spacing/text-spacing.js";
43
- import clsx from "clsx";
44
44
  import { Slot } from "@radix-ui/react-slot";
45
45
  import { composeRefs } from "../../utils/composeRefs.js";
46
46
  const styles = {
@@ -90,7 +90,7 @@ function LoggedInContent() {
90
90
  /* @__PURE__ */ jsxRuntime.jsx(components_heading_heading.Heading, { variant: "title-100", as: "h3", mb: "100", mt: "400", children: "Bedrift" }),
91
91
  components_navigationMenu_globalNavigation_utils.LOGGED_IN_LINKS_BUSINESS.map((link) => /* @__PURE__ */ jsxRuntime.jsx(components_button_button.Button, { variant: "list-item", fullWidth: true, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: link.link, children: /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: link.icon, children: link.name }) }) }, link.link))
92
92
  ] }),
93
- /* @__PURE__ */ jsxRuntime.jsx(components_button_button.Button, { mt: "200", onClick: () => rootContext == null ? void 0 : rootContext.onLogoutClick, variant: "secondary", children: /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "logout", children: "Logg ut" }) })
93
+ /* @__PURE__ */ jsxRuntime.jsx(components_button_button.Button, { mt: "200", onClick: () => rootContext == null ? void 0 : rootContext.onLogoutClick(), variant: "secondary", children: /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "logout", children: "Logg ut" }) })
94
94
  ] })
95
95
  ] })
96
96
  ] });
@@ -442,7 +442,7 @@ function getInitialDomain() {
442
442
  if (!currentLocation)
443
443
  return components_navigationMenu_globalNavigation_utils.PRIVATE_LINKS.name;
444
444
  const locationArray = currentLocation ? currentLocation.split("/") : [];
445
- const domainPartOfLocation = `/${locationArray[1]}`;
445
+ const domainPartOfLocation = `/${locationArray[1]}/`;
446
446
  const initDomain = domainPartOfLocation === components_navigationMenu_globalNavigation_utils.BUSINESS_LINKS.link ? components_navigationMenu_globalNavigation_utils.BUSINESS_LINKS.name : domainPartOfLocation === components_navigationMenu_globalNavigation_utils.MDU_LINKS.link ? components_navigationMenu_globalNavigation_utils.MDU_LINKS.name : components_navigationMenu_globalNavigation_utils.PRIVATE_LINKS.name;
447
447
  return initDomain;
448
448
  }
@@ -455,14 +455,14 @@ function getInitialMenuItem() {
455
455
  const initialDomain = getInitialDomain();
456
456
  if (initialDomain === "Bedrift") {
457
457
  const mainMenuPartOfLocation2 = locationArray[2];
458
- return (_a = components_navigationMenu_globalNavigation_utils.BUSINESS_LINKS.links.find((link) => link.link === `/${initialDomain.toLowerCase()}/${mainMenuPartOfLocation2}`)) == null ? void 0 : _a.name;
458
+ return (_a = components_navigationMenu_globalNavigation_utils.BUSINESS_LINKS.links.find((link) => link.link === `/${initialDomain.toLowerCase()}/${mainMenuPartOfLocation2}/`)) == null ? void 0 : _a.name;
459
459
  }
460
460
  if (initialDomain === "Borettslag") {
461
461
  const mainMenuPartOfLocation2 = locationArray[2];
462
- return (_b = components_navigationMenu_globalNavigation_utils.MDU_LINKS.links.find((link) => link.link === `/${initialDomain.toLowerCase()}/${mainMenuPartOfLocation2}`)) == null ? void 0 : _b.name;
462
+ return (_b = components_navigationMenu_globalNavigation_utils.MDU_LINKS.links.find((link) => link.link === `/${initialDomain.toLowerCase()}/${mainMenuPartOfLocation2}/`)) == null ? void 0 : _b.name;
463
463
  }
464
464
  const mainMenuPartOfLocation = locationArray[1];
465
- return (_c = components_navigationMenu_globalNavigation_utils.PRIVATE_LINKS.links.find((link) => link.link === `/${mainMenuPartOfLocation}`)) == null ? void 0 : _c.name;
465
+ return (_c = components_navigationMenu_globalNavigation_utils.PRIVATE_LINKS.links.find((link) => link.link === `/${mainMenuPartOfLocation}/`)) == null ? void 0 : _c.name;
466
466
  }
467
467
  Root.displayName = "GlobalNavigation";
468
468
  const GlobalNavigation = Root;
@@ -88,7 +88,7 @@ function LoggedInContent() {
88
88
  /* @__PURE__ */ jsx(Heading, { variant: "title-100", as: "h3", mb: "100", mt: "400", children: "Bedrift" }),
89
89
  LOGGED_IN_LINKS_BUSINESS.map((link) => /* @__PURE__ */ jsx(Button, { variant: "list-item", fullWidth: true, asChild: true, children: /* @__PURE__ */ jsx("a", { href: link.link, children: /* @__PURE__ */ jsx(Icon, { name: link.icon, children: link.name }) }) }, link.link))
90
90
  ] }),
91
- /* @__PURE__ */ jsx(Button, { mt: "200", onClick: () => rootContext == null ? void 0 : rootContext.onLogoutClick, variant: "secondary", children: /* @__PURE__ */ jsx(Icon, { name: "logout", children: "Logg ut" }) })
91
+ /* @__PURE__ */ jsx(Button, { mt: "200", onClick: () => rootContext == null ? void 0 : rootContext.onLogoutClick(), variant: "secondary", children: /* @__PURE__ */ jsx(Icon, { name: "logout", children: "Logg ut" }) })
92
92
  ] })
93
93
  ] })
94
94
  ] });
@@ -440,7 +440,7 @@ function getInitialDomain() {
440
440
  if (!currentLocation)
441
441
  return PRIVATE_LINKS.name;
442
442
  const locationArray = currentLocation ? currentLocation.split("/") : [];
443
- const domainPartOfLocation = `/${locationArray[1]}`;
443
+ const domainPartOfLocation = `/${locationArray[1]}/`;
444
444
  const initDomain = domainPartOfLocation === BUSINESS_LINKS.link ? BUSINESS_LINKS.name : domainPartOfLocation === MDU_LINKS.link ? MDU_LINKS.name : PRIVATE_LINKS.name;
445
445
  return initDomain;
446
446
  }
@@ -453,14 +453,14 @@ function getInitialMenuItem() {
453
453
  const initialDomain = getInitialDomain();
454
454
  if (initialDomain === "Bedrift") {
455
455
  const mainMenuPartOfLocation2 = locationArray[2];
456
- return (_a = BUSINESS_LINKS.links.find((link) => link.link === `/${initialDomain.toLowerCase()}/${mainMenuPartOfLocation2}`)) == null ? void 0 : _a.name;
456
+ return (_a = BUSINESS_LINKS.links.find((link) => link.link === `/${initialDomain.toLowerCase()}/${mainMenuPartOfLocation2}/`)) == null ? void 0 : _a.name;
457
457
  }
458
458
  if (initialDomain === "Borettslag") {
459
459
  const mainMenuPartOfLocation2 = locationArray[2];
460
- return (_b = MDU_LINKS.links.find((link) => link.link === `/${initialDomain.toLowerCase()}/${mainMenuPartOfLocation2}`)) == null ? void 0 : _b.name;
460
+ return (_b = MDU_LINKS.links.find((link) => link.link === `/${initialDomain.toLowerCase()}/${mainMenuPartOfLocation2}/`)) == null ? void 0 : _b.name;
461
461
  }
462
462
  const mainMenuPartOfLocation = locationArray[1];
463
- return (_c = PRIVATE_LINKS.links.find((link) => link.link === `/${mainMenuPartOfLocation}`)) == null ? void 0 : _c.name;
463
+ return (_c = PRIVATE_LINKS.links.find((link) => link.link === `/${mainMenuPartOfLocation}/`)) == null ? void 0 : _c.name;
464
464
  }
465
465
  Root.displayName = "GlobalNavigation";
466
466
  const GlobalNavigation = Root;