@telia/teddy 0.7.17 → 0.7.27

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 (136) hide show
  1. package/README.md +1 -1
  2. package/dist/components/avatar/avatar-root.d.ts +1 -1
  3. package/dist/components/avatar/index.d.ts +1 -1
  4. package/dist/components/breadcrumbs/breadcrumbs-link.d.ts +1 -1
  5. package/dist/components/breadcrumbs/index.d.ts +1 -1
  6. package/dist/components/card/card-illustration.d.ts +1 -1
  7. package/dist/components/card/card-link.d.ts +1 -1
  8. package/dist/components/channel-button/channel-button-root.d.ts +3 -3
  9. package/dist/components/channel-button/index.d.ts +3 -3
  10. package/dist/components/checkbox/checkbox-group.d.ts +1 -1
  11. package/dist/components/checkbox/index.d.ts +1 -1
  12. package/dist/components/checkbox-card-group/checkbox-card-group-content.cjs +65 -0
  13. package/dist/components/checkbox-card-group/checkbox-card-group-content.d.ts +5 -0
  14. package/dist/components/checkbox-card-group/checkbox-card-group-content.js +65 -0
  15. package/dist/components/checkbox-card-group/checkbox-card-group-indicator.cjs +1466 -0
  16. package/dist/components/checkbox-card-group/checkbox-card-group-indicator.d.ts +12 -0
  17. package/dist/components/checkbox-card-group/checkbox-card-group-indicator.js +1447 -0
  18. package/dist/components/checkbox-card-group/checkbox-card-group-item-body.cjs +15 -0
  19. package/dist/components/checkbox-card-group/checkbox-card-group-item-body.d.ts +5 -0
  20. package/dist/components/checkbox-card-group/checkbox-card-group-item-body.js +15 -0
  21. package/dist/components/checkbox-card-group/checkbox-card-group-item-title.cjs +66 -0
  22. package/dist/components/checkbox-card-group/checkbox-card-group-item-title.d.ts +14 -0
  23. package/dist/components/checkbox-card-group/checkbox-card-group-item-title.js +66 -0
  24. package/dist/components/checkbox-card-group/checkbox-card-group-item.cjs +67 -0
  25. package/dist/components/checkbox-card-group/checkbox-card-group-item.d.ts +22 -0
  26. package/dist/components/checkbox-card-group/checkbox-card-group-item.js +67 -0
  27. package/dist/components/checkbox-card-group/checkbox-card-group-label.cjs +29 -0
  28. package/dist/components/checkbox-card-group/checkbox-card-group-label.d.ts +65 -0
  29. package/dist/components/checkbox-card-group/checkbox-card-group-label.js +29 -0
  30. package/dist/components/checkbox-card-group/checkbox-card-group-root.cjs +42 -0
  31. package/dist/components/checkbox-card-group/checkbox-card-group-root.d.ts +39 -0
  32. package/dist/components/checkbox-card-group/checkbox-card-group-root.js +42 -0
  33. package/dist/components/checkbox-card-group/index.cjs +7 -0
  34. package/dist/components/checkbox-card-group/index.d.ts +76 -0
  35. package/dist/components/checkbox-card-group/index.js +7 -0
  36. package/dist/components/chip/chip-indicator.d.ts +3 -2
  37. package/dist/components/chip/index.d.ts +3 -2
  38. package/dist/components/color-dot/index.d.ts +1 -1
  39. package/dist/components/dashboard-card/dashboard-card-avatar.d.ts +1 -1
  40. package/dist/components/expandable-card/expandable-card-button.d.ts +2 -2
  41. package/dist/components/expandable-card/index.d.ts +3 -3
  42. package/dist/components/flip-card/flip-card-trigger.d.ts +2 -2
  43. package/dist/components/icon/icon.cjs +4 -1
  44. package/dist/components/icon/icon.d.ts +1 -0
  45. package/dist/components/icon/icon.js +4 -1
  46. package/dist/components/icon/utils.d.ts +1 -1
  47. package/dist/components/index.cjs +8 -5
  48. package/dist/components/index.d.ts +2 -0
  49. package/dist/components/index.js +4 -1
  50. package/dist/components/modal/index.cjs +2 -2
  51. package/dist/components/modal/index.js +1 -1
  52. package/dist/components/modal/modal-close.cjs +3 -2
  53. package/dist/components/modal/modal-close.js +3 -2
  54. package/dist/components/navigation-menu/global-navigation/global-navigation-desktop-simplified.cjs +2 -2
  55. package/dist/components/navigation-menu/global-navigation/global-navigation-desktop-simplified.js +2 -2
  56. package/dist/components/navigation-menu/global-navigation/global-navigation-desktop.cjs +2 -2
  57. package/dist/components/navigation-menu/global-navigation/global-navigation-desktop.js +1 -1
  58. package/dist/components/navigation-menu/global-navigation/global-navigation-mobile-simplified.cjs +2 -2
  59. package/dist/components/navigation-menu/global-navigation/global-navigation-mobile-simplified.js +2 -2
  60. package/dist/components/navigation-menu/global-navigation/global-navigation-mobile.cjs +3 -3
  61. package/dist/components/navigation-menu/global-navigation/global-navigation-mobile.js +2 -2
  62. package/dist/components/navigation-menu/global-navigation/global-navigation-my-pages.cjs +2 -2
  63. package/dist/components/navigation-menu/global-navigation/global-navigation-my-pages.js +2 -2
  64. package/dist/components/navigation-menu/global-navigation/global-navigation-root.cjs +4 -4
  65. package/dist/components/navigation-menu/global-navigation/global-navigation-root.js +4 -4
  66. package/dist/components/navigation-menu/global-navigation/global-navigation-search-field.cjs +2 -2
  67. package/dist/components/navigation-menu/global-navigation/global-navigation-search-field.js +2 -2
  68. package/dist/components/navigation-menu/global-navigation/global-navigation-search.cjs +2 -2
  69. package/dist/components/navigation-menu/global-navigation/global-navigation-search.js +2 -2
  70. package/dist/components/navigation-menu/global-navigation/global-navigation-shopping-cart.cjs +2 -2
  71. package/dist/components/navigation-menu/global-navigation/global-navigation-shopping-cart.js +2 -2
  72. package/dist/components/navigation-menu/global-navigation/index.cjs +2 -2
  73. package/dist/components/navigation-menu/global-navigation/index.js +1 -1
  74. package/dist/components/navigation-menu/index.cjs +3 -3
  75. package/dist/components/navigation-menu/index.js +1 -1
  76. package/dist/components/navigation-menu/navigation-menu.cjs +5 -4
  77. package/dist/components/navigation-menu/navigation-menu.js +2 -1
  78. package/dist/components/notabene/notabene-icon.d.ts +3 -2
  79. package/dist/components/notification/index.d.ts +1 -1
  80. package/dist/components/notification/notification-icon.d.ts +3 -2
  81. package/dist/components/notification/notification-root.d.ts +1 -1
  82. package/dist/components/pagination/pagination-button.d.ts +1 -1
  83. package/dist/components/radio-card-group/index.cjs +2 -2
  84. package/dist/components/radio-card-group/index.js +1 -1
  85. package/dist/components/radio-card-group/radio-card-group-content.cjs +3 -2
  86. package/dist/components/radio-card-group/radio-card-group-content.js +3 -2
  87. package/dist/components/radio-card-group/radio-card-group-item-title.cjs +22 -1328
  88. package/dist/components/radio-card-group/radio-card-group-item-title.js +22 -1309
  89. package/dist/components/radio-card-group/radio-card-group-item.cjs +4 -3
  90. package/dist/components/radio-card-group/radio-card-group-item.js +4 -3
  91. package/dist/components/scroll-area/index.d.ts +3 -3
  92. package/dist/components/scroll-area/scroll-area-button.d.ts +2 -2
  93. package/dist/components/select/index.cjs +4 -1
  94. package/dist/components/select/index.d.ts +5 -1
  95. package/dist/components/select/index.js +4 -1
  96. package/dist/components/select/select-group.cjs +6 -2
  97. package/dist/components/select/select-group.d.ts +4 -2
  98. package/dist/components/select/select-group.js +7 -3
  99. package/dist/components/select/select-root.cjs +12 -10
  100. package/dist/components/select/select-root.js +12 -10
  101. package/dist/components/select/select-separator.cjs +30 -0
  102. package/dist/components/select/select-separator.d.ts +5 -0
  103. package/dist/components/select/select-separator.js +13 -0
  104. package/dist/components/step-indicator/index.cjs +14 -0
  105. package/dist/components/step-indicator/index.d.ts +38 -0
  106. package/dist/components/step-indicator/index.js +14 -0
  107. package/dist/components/step-indicator/step-indicator-root.cjs +8 -0
  108. package/dist/components/step-indicator/step-indicator-root.d.ts +55 -0
  109. package/dist/components/step-indicator/step-indicator-root.js +8 -0
  110. package/dist/components/step-indicator/step-indicator-step-element.cjs +157 -0
  111. package/dist/components/step-indicator/step-indicator-step-element.d.ts +14 -0
  112. package/dist/components/step-indicator/step-indicator-step-element.js +157 -0
  113. package/dist/components/step-indicator/step-indicator-step-line.cjs +6 -0
  114. package/dist/components/step-indicator/step-indicator-step-line.d.ts +9 -0
  115. package/dist/components/step-indicator/step-indicator-step-line.js +6 -0
  116. package/dist/components/step-indicator/step-indicator-step.cjs +8 -0
  117. package/dist/components/step-indicator/step-indicator-step.d.ts +24 -0
  118. package/dist/components/step-indicator/step-indicator-step.js +8 -0
  119. package/dist/components/tabs/index.d.ts +1 -1
  120. package/dist/components/tabs/tabs-root.d.ts +1 -1
  121. package/dist/components/tabs/tabs-scroll-button.d.ts +2 -2
  122. package/dist/components/tabs/tabs-scroll.d.ts +1 -1
  123. package/dist/components/text-field/index.d.ts +2 -2
  124. package/dist/components/text-field/text-field-button.d.ts +2 -2
  125. package/dist/components/toggle/toggle.d.ts +3 -2
  126. package/dist/components/tooltip/index.d.ts +1 -1
  127. package/dist/main.cjs +8 -5
  128. package/dist/main.js +4 -1
  129. package/dist/style.css +529 -113
  130. package/dist/tokens/color/variables.cjs +32 -32
  131. package/dist/tokens/color/variables.d.ts +32 -32
  132. package/dist/tokens/color/variables.js +32 -32
  133. package/dist/utils/generate-styling/grid.d.ts +24 -24
  134. package/dist/utils/generate-styling/index.d.ts +16 -16
  135. package/dist/utils/generate-styling/util.d.ts +2 -2
  136. package/package.json +5 -5
@@ -0,0 +1,1466 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const React = require("react");
5
+ const clsx = require("clsx");
6
+ const components_navigationMenu_globalNavigation_utils = require("../navigation-menu/global-navigation/utils.cjs");
7
+ const NavigationMenuPrimitive = require("@radix-ui/react-navigation-menu");
8
+ const utils_composeRefs = require("../../utils/composeRefs.cjs");
9
+ const components_visuallyHidden_visuallyHidden = require("../visually-hidden/visually-hidden.cjs");
10
+ const utils_composeEventHandlers = require("../../utils/composeEventHandlers.cjs");
11
+ const reactSlot = require("@radix-ui/react-slot");
12
+ const reactUseControllableState = require("@radix-ui/react-use-controllable-state");
13
+ const utils_generateStyling_index = require("../../utils/generate-styling/index.cjs");
14
+ const tokens_motion_variables = require("../../tokens/motion/variables.cjs");
15
+ require("../step-indicator/index.cjs");
16
+ require("../metric-meter/metric-meter.cjs");
17
+ require("../footer/index.cjs");
18
+ require("../pagination/index.cjs");
19
+ require("../select/index.cjs");
20
+ require("../avatar/index.cjs");
21
+ require("../dashboard-card/index.cjs");
22
+ require("../table/index.cjs");
23
+ require("../flip-card/index.cjs");
24
+ require("../channel-button/index.cjs");
25
+ require("../collapsible/index.cjs");
26
+ require("../meter-bar/index.cjs");
27
+ require("../skeleton/index.cjs");
28
+ const components_checkbox_index = require("../checkbox/index.cjs");
29
+ const components_checkboxCardGroup_checkboxCardGroupRoot = require("./checkbox-card-group-root.cjs");
30
+ const components_checkboxCardGroup_checkboxCardGroupLabel = require("./checkbox-card-group-label.cjs");
31
+ require("../toast/toast-root.cjs");
32
+ require("sonner");
33
+ require("../toggletip/index.cjs");
34
+ require("../breadcrumbs/index.cjs");
35
+ const components_radioCardGroup_radioCardGroupRoot = require("../radio-card-group/radio-card-group-root.cjs");
36
+ const components_radioCardGroup_radioCardGroupLabel = require("../radio-card-group/radio-card-group-label.cjs");
37
+ require("../ribbon/index.cjs");
38
+ require("../expandable-card/index.cjs");
39
+ require("../color-dot/color-dot-root.cjs");
40
+ require("../progress-bar/progress-bar.cjs");
41
+ require("../notabene/index.cjs");
42
+ require("../tooltip/index.cjs");
43
+ const components_list_index = require("../list/index.cjs");
44
+ require("../scroll-area/index.cjs");
45
+ const components_tabs_index = require("../tabs/index.cjs");
46
+ const components_drawer_index = require("../drawer/index.cjs");
47
+ require("../image/image.cjs");
48
+ require("../chip/index.cjs");
49
+ require("../../assets/sprite.6511e521-teddy.svg");
50
+ const components_modal_modalRoot = require("../modal/modal-root.cjs");
51
+ const components_modal_modalTrigger = require("../modal/modal-trigger.cjs");
52
+ const components_modal_modalContent = require("../modal/modal-content.cjs");
53
+ const components_modal_modalTitle = require("../modal/modal-title.cjs");
54
+ const components_modal_modalDescription = require("../modal/modal-description.cjs");
55
+ const components_modal_modalOverlay = require("../modal/modal-overlay.cjs");
56
+ const components_modal_modalGroup = require("../modal/modal-group.cjs");
57
+ const DrawerPrimitive = require("@radix-ui/react-dialog");
58
+ const components_icon_icon = require("../icon/icon.cjs");
59
+ require("../notification/index.cjs");
60
+ require("../radio-group/index.cjs");
61
+ const components_box_box = require("../box/box.cjs");
62
+ const components_flex_flex = require("../flex/flex.cjs");
63
+ require("../card/index.cjs");
64
+ const components_grid_grid = require("../grid/grid.cjs");
65
+ require("../toggle/toggle.cjs");
66
+ require("../accordion/index.cjs");
67
+ require("../link/link.cjs");
68
+ require("../badge/badge.cjs");
69
+ require("../badge/alert-badge.cjs");
70
+ const components_badge_counterBadge = require("../badge/counter-badge.cjs");
71
+ const components_button_button = require("../button/button.cjs");
72
+ require("../field-error-text/field-error-text.cjs");
73
+ require("../helper-text/helper-text.cjs");
74
+ require("../input/index.cjs");
75
+ require("../label/label.cjs");
76
+ require("../spinner/spinner.cjs");
77
+ const components_text_text = require("../text/text.cjs");
78
+ const components_textField_index = require("../text-field/index.cjs");
79
+ const components_heading_heading = require("../heading/heading.cjs");
80
+ const components_textSpacing_textSpacing = require("../text-spacing/text-spacing.cjs");
81
+ require("../container/container.cjs");
82
+ require("../carousel/carousel-root.cjs");
83
+ require("../slider/slider.cjs");
84
+ const modal_module = require("../../modal.module-BfeNqXoN.cjs");
85
+ const components_modal_modalImage = require("../modal/modal-image.cjs");
86
+ const components_radioCardGroup_radioCardGroupIndicator = require("../radio-card-group/radio-card-group-indicator.cjs");
87
+ const components_radioCardGroup_radioCardGroupItemBody = require("../radio-card-group/radio-card-group-item-body.cjs");
88
+ const RadioGroupPrimitive = require("@radix-ui/react-radio-group");
89
+ const components_checkboxCardGroup_checkboxCardGroupItemBody = require("./checkbox-card-group-item-body.cjs");
90
+ const utils_useSize = require("../../utils/useSize.cjs");
91
+ function _interopNamespaceDefault(e) {
92
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
93
+ if (e) {
94
+ for (const k in e) {
95
+ if (k !== "default") {
96
+ const d = Object.getOwnPropertyDescriptor(e, k);
97
+ Object.defineProperty(n, k, d.get ? d : {
98
+ enumerable: true,
99
+ get: () => e[k]
100
+ });
101
+ }
102
+ }
103
+ }
104
+ n.default = e;
105
+ return Object.freeze(n);
106
+ }
107
+ const NavigationMenuPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(NavigationMenuPrimitive);
108
+ const DrawerPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(DrawerPrimitive);
109
+ const RadioGroupPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadioGroupPrimitive);
110
+ const Indicator$1 = React.forwardRef(
111
+ ({ className, checked, onCheckedChange, disabled, ...props }, forwardRef) => {
112
+ const classes = clsx([components_checkboxCardGroup_checkboxCardGroupRoot.styles[`${components_checkboxCardGroup_checkboxCardGroupRoot.rootClassName}__checkbox-wrapper`]], className);
113
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: forwardRef, className: classes, ...props, children: /* @__PURE__ */ jsxRuntime.jsx(components_checkbox_index.Checkbox, { children: /* @__PURE__ */ jsxRuntime.jsx(
114
+ components_checkbox_index.Checkbox.Trigger,
115
+ {
116
+ className: components_checkboxCardGroup_checkboxCardGroupRoot.styles[`${components_checkboxCardGroup_checkboxCardGroupRoot.rootClassName}__trigger`],
117
+ checked,
118
+ onCheckedChange,
119
+ disabled
120
+ }
121
+ ) }) });
122
+ }
123
+ );
124
+ Indicator$1.displayName = "Indicator";
125
+ const Title$1 = React.forwardRef(
126
+ ({ className, children, asChild, checked, onCheckedChange, disabled, ...props }, forwardRef) => {
127
+ const classes = clsx([components_checkboxCardGroup_checkboxCardGroupRoot.styles[`${components_checkboxCardGroup_checkboxCardGroupRoot.rootClassName}__title`]], className);
128
+ return /* @__PURE__ */ jsxRuntime.jsxs(components_flex_flex.Flex, { width: "100%", gap: "150", className: components_checkboxCardGroup_checkboxCardGroupRoot.styles[`${components_checkboxCardGroup_checkboxCardGroupRoot.rootClassName}__title-wrapper`], children: [
129
+ asChild ? /* @__PURE__ */ jsxRuntime.jsx(reactSlot.Slot, { ...props, ref: forwardRef, className: classes, children }) : /* @__PURE__ */ jsxRuntime.jsx(components_text_text.Text, { variant: "paragraph-100-bold", ref: forwardRef, className: classes, children }),
130
+ /* @__PURE__ */ jsxRuntime.jsx(Indicator$1, { checked, onCheckedChange, disabled })
131
+ ] });
132
+ }
133
+ );
134
+ Title$1.displayName = "Title";
135
+ const Content$2 = React.forwardRef(
136
+ ({ className, children, ...props }, forwardRef) => {
137
+ const classes = clsx([components_checkboxCardGroup_checkboxCardGroupRoot.styles[`${components_checkboxCardGroup_checkboxCardGroupRoot.rootClassName}__content-wrapper`]], className);
138
+ return /* @__PURE__ */ jsxRuntime.jsx(components_flex_flex.Flex, { direction: "column", width: "100%", gap: "50", ...props, ref: forwardRef, className: classes, children });
139
+ }
140
+ );
141
+ Content$2.displayName = "Content";
142
+ const ItemContext$1 = React.createContext(void 0);
143
+ const Item$2 = React.forwardRef(
144
+ ({ className, children, value, imageUrl, checked, onCheckedChange, disabled, ...props }, forwardedRef) => {
145
+ const classes = clsx([components_checkboxCardGroup_checkboxCardGroupRoot.styles[`${components_checkboxCardGroup_checkboxCardGroupRoot.rootClassName}__card-item`]], className);
146
+ const context = React.useContext(ItemContext$1);
147
+ const ref = utils_composeRefs.useComposedRefs(forwardedRef, context == null ? void 0 : context.triggerRef);
148
+ const id = props.id || (context == null ? void 0 : context.id);
149
+ return /* @__PURE__ */ jsxRuntime.jsxs(
150
+ "div",
151
+ {
152
+ id,
153
+ ...props,
154
+ ref,
155
+ className: classes,
156
+ "data-state": checked ? "checked" : "unchecked",
157
+ "data-disabled": disabled ? "" : void 0,
158
+ "aria-checked": checked,
159
+ children: [
160
+ imageUrl ? /* @__PURE__ */ jsxRuntime.jsx(components_flex_flex.Flex, { className: clsx([components_checkboxCardGroup_checkboxCardGroupRoot.styles[`${components_checkboxCardGroup_checkboxCardGroupRoot.rootClassName}__illustration`]], className), justify: "center", align: "center", children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: imageUrl, alt: value }) }) : null,
161
+ /* @__PURE__ */ jsxRuntime.jsx(Content$2, { children: React.Children.map(children, (child) => {
162
+ if (React.isValidElement(child) && child.type === Title$1) {
163
+ return React.cloneElement(child, {
164
+ ...child.props,
165
+ checked,
166
+ onCheckedChange,
167
+ disabled
168
+ });
169
+ }
170
+ return child;
171
+ }) })
172
+ ]
173
+ }
174
+ );
175
+ }
176
+ );
177
+ Item$2.displayName = "Item";
178
+ components_checkboxCardGroup_checkboxCardGroupRoot.Root.displayName = "CheckboxCardGroup";
179
+ components_checkboxCardGroup_checkboxCardGroupLabel.GroupLabel.displayName = "CheckboxCardGroup.GroupLabel";
180
+ Item$2.displayName = "CheckboxCardGroup.Item";
181
+ Title$1.displayName = "CheckboxCardGroup.Title";
182
+ components_checkboxCardGroup_checkboxCardGroupItemBody.Body.displayName = "CheckboxCardGroup.Body";
183
+ Indicator$1.displayName = "CheckboxCardGroup.Indicator";
184
+ const CheckboxCardGroup = Object.assign(components_checkboxCardGroup_checkboxCardGroupRoot.Root, {
185
+ GroupLabel: components_checkboxCardGroup_checkboxCardGroupLabel.GroupLabel,
186
+ Item: Item$2,
187
+ Title: Title$1,
188
+ Body: components_checkboxCardGroup_checkboxCardGroupItemBody.Body,
189
+ Indicator: Indicator$1
190
+ });
191
+ const Title = React.forwardRef(
192
+ ({ className, children, asChild, ...props }, forwardRef) => {
193
+ const classes = clsx([components_radioCardGroup_radioCardGroupRoot.styles[`${components_radioCardGroup_radioCardGroupRoot.rootClassName}__title`]], className);
194
+ return /* @__PURE__ */ jsxRuntime.jsxs(components_flex_flex.Flex, { width: "100%", gap: "150", className: components_radioCardGroup_radioCardGroupRoot.styles[`${components_radioCardGroup_radioCardGroupRoot.rootClassName}__title-wrapper`], children: [
195
+ asChild ? /* @__PURE__ */ jsxRuntime.jsx(reactSlot.Slot, { ...props, ref: forwardRef, className: classes, children }) : /* @__PURE__ */ jsxRuntime.jsx(components_text_text.Text, { variant: "paragraph-100-bold", ref: forwardRef, className: classes, children }),
196
+ /* @__PURE__ */ jsxRuntime.jsx(components_radioCardGroup_radioCardGroupIndicator.Indicator, {})
197
+ ] });
198
+ }
199
+ );
200
+ Title.displayName = "Title";
201
+ const Content$1 = React.forwardRef(
202
+ ({ className, children, ...props }, forwardRef) => {
203
+ const classes = clsx([components_radioCardGroup_radioCardGroupRoot.styles[`${components_radioCardGroup_radioCardGroupRoot.rootClassName}__content-wrapper`]], className);
204
+ return /* @__PURE__ */ jsxRuntime.jsx(components_flex_flex.Flex, { direction: "column", width: "100%", gap: "50", ...props, ref: forwardRef, className: classes, children });
205
+ }
206
+ );
207
+ Content$1.displayName = "Content";
208
+ const ItemContext = React.createContext(void 0);
209
+ const Item$1 = React.forwardRef(
210
+ ({ className, children, value, ...props }, forwardedRef) => {
211
+ const classes = clsx([components_radioCardGroup_radioCardGroupRoot.styles[`${components_radioCardGroup_radioCardGroupRoot.rootClassName}__card-item`]], className);
212
+ const context = React.useContext(ItemContext);
213
+ const ref = utils_composeRefs.useComposedRefs(forwardedRef, context == null ? void 0 : context.triggerRef);
214
+ const id = props.id || (context == null ? void 0 : context.id);
215
+ return /* @__PURE__ */ jsxRuntime.jsxs(RadioGroupPrimitive__namespace.Item, { value, id, ...props, asChild: false, ref, className: classes, children: [
216
+ props.imageUrl ? /* @__PURE__ */ jsxRuntime.jsx(components_flex_flex.Flex, { className: clsx([components_radioCardGroup_radioCardGroupRoot.styles[`${components_radioCardGroup_radioCardGroupRoot.rootClassName}__illustration`]], className), justify: "center", align: "center", children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: props.imageUrl, alt: value }) }) : null,
217
+ /* @__PURE__ */ jsxRuntime.jsx(Content$1, { children })
218
+ ] });
219
+ }
220
+ );
221
+ Item$1.displayName = "Item";
222
+ components_radioCardGroup_radioCardGroupRoot.Root.displayName = "RadioCardGroup";
223
+ components_radioCardGroup_radioCardGroupLabel.GroupLabel.displayName = "RadioCardGroup.GroupLabel";
224
+ Item$1.displayName = "RadioCardGroup.Item";
225
+ Title.displayName = "RadioCardGroup.Title";
226
+ components_radioCardGroup_radioCardGroupItemBody.Body.displayName = "RadioCardGroup.Body";
227
+ const RadioCardGroup = Object.assign(components_radioCardGroup_radioCardGroupRoot.Root, {
228
+ GroupLabel: components_radioCardGroup_radioCardGroupLabel.GroupLabel,
229
+ Item: Item$1,
230
+ Title,
231
+ Body: components_radioCardGroup_radioCardGroupItemBody.Body
232
+ });
233
+ const Close = React.forwardRef(
234
+ ({ className, ...props }, forwardedRef) => {
235
+ const classes = clsx([modal_module.styles[`${components_modal_modalRoot.rootClassName}__close`]], {
236
+ [modal_module.styles[`${components_modal_modalRoot.rootClassName}__close--floating`]]: props.slot === "floating",
237
+ className
238
+ });
239
+ const imageRef = React.useContext(components_modal_modalRoot.RootContext).imageRef;
240
+ const [hasImage, setHasImage] = React.useState(false);
241
+ React.useEffect(() => {
242
+ if (imageRef == null ? void 0 : imageRef.current) {
243
+ setHasImage(true);
244
+ }
245
+ }, [imageRef]);
246
+ return /* @__PURE__ */ jsxRuntime.jsx(DrawerPrimitive__namespace.Close, { ...props, className: classes, ref: forwardedRef, asChild: true, children: props.children || /* @__PURE__ */ jsxRuntime.jsx(
247
+ components_button_button.Button,
248
+ {
249
+ variant: hasImage ? "primary-negative" : "tertiary-purple",
250
+ iconOnly: true,
251
+ "aria-label": props["aria-label"] ?? "Lukk",
252
+ children: /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "close" })
253
+ }
254
+ ) });
255
+ }
256
+ );
257
+ Close.displayName = "Close";
258
+ const Modal = components_modal_modalRoot.Root;
259
+ Modal.displayName = "Modal";
260
+ Modal.Trigger = components_modal_modalTrigger.Trigger;
261
+ Modal.Trigger.displayName = "Modal.Trigger";
262
+ Modal.Content = components_modal_modalContent.Content;
263
+ Modal.Content.displayName = "Modal.Content";
264
+ Modal.Title = components_modal_modalTitle.Title;
265
+ Modal.Title.displayName = "Modal.Title";
266
+ Modal.Description = components_modal_modalDescription.Description;
267
+ Modal.Description.displayName = "Modal.Description";
268
+ Modal.Overlay = components_modal_modalOverlay.Overlay;
269
+ Modal.Overlay.displayName = "Modal.Overlay";
270
+ Modal.Group = components_modal_modalGroup.Group;
271
+ Modal.Group.displayName = "Modal.Group";
272
+ Modal.Close = Close;
273
+ Modal.Close.displayName = "Modal.Close";
274
+ Modal.Image = components_modal_modalImage.Image;
275
+ Modal.Image.displayName = "Modal.Image";
276
+ const styles$1 = {
277
+ "teddy-navigation-menu": "_teddy-navigation-menu_6p30v_1",
278
+ "teddy-navigation-menu__viewport": "_teddy-navigation-menu__viewport_6p30v_34",
279
+ "teddy-navigation-menu__separator": "_teddy-navigation-menu__separator_6p30v_37",
280
+ "teddy-navigation-menu__list": "_teddy-navigation-menu__list_6p30v_40",
281
+ "teddy-navigation-menu__top-menu-list": "_teddy-navigation-menu__top-menu-list_6p30v_66",
282
+ "teddy-navigation-menu__top-menu-trigger": "_teddy-navigation-menu__top-menu-trigger_6p30v_87",
283
+ "teddy-navigation-menu__top-menu-trigger--small": "_teddy-navigation-menu__top-menu-trigger--small_6p30v_106",
284
+ "teddy-navigation-menu__top-menu-trigger--button": "_teddy-navigation-menu__top-menu-trigger--button_6p30v_112",
285
+ "teddy-navigation-menu__content": "_teddy-navigation-menu__content_6p30v_187",
286
+ "teddy-navigation-menu__trigger": "_teddy-navigation-menu__trigger_6p30v_219",
287
+ "teddy-navigation-menu__trigger--small": "_teddy-navigation-menu__trigger--small_6p30v_239",
288
+ "teddy-navigation-menu__trigger--button": "_teddy-navigation-menu__trigger--button_6p30v_245",
289
+ "teddy-navigation-menu__link": "_teddy-navigation-menu__link_6p30v_313",
290
+ "teddy-navigation-menu__link--small": "_teddy-navigation-menu__link--small_6p30v_333",
291
+ "teddy-navigation-menu__link--button": "_teddy-navigation-menu__link--button_6p30v_339"
292
+ };
293
+ const rootClassName$1 = "teddy-navigation-menu";
294
+ const NavigationMenuContext = React.createContext({
295
+ selectedTopMenu: void 0,
296
+ setSelectedTopMenu: () => {
297
+ },
298
+ contentRef: { current: null },
299
+ focusProxyRef: { current: null },
300
+ topMenuRef: { current: null },
301
+ id: "",
302
+ dir: "ltr",
303
+ orientation: "horizontal",
304
+ onEntryKeyDown: () => {
305
+ },
306
+ onFocusProxyEnter: () => {
307
+ },
308
+ onContentFocusOutside: () => {
309
+ }
310
+ });
311
+ const Root$1 = React.forwardRef(
312
+ ({ className, defaultTopMenuValue, topMenuValue, onTopMenuValueChange, ...props }, forwardRef) => {
313
+ const [selectedTopMenu, setSelectedTopMenu] = reactUseControllableState.useControllableState({
314
+ defaultProp: defaultTopMenuValue,
315
+ prop: topMenuValue,
316
+ onChange: onTopMenuValueChange
317
+ });
318
+ const contentRef = React.useRef(null);
319
+ const [allowAnimationOfHeight, setAllowAnimationOfHeight] = React.useState(false);
320
+ const timerRef = React.useRef(void 0);
321
+ const restoreContentTabOrderRef = React.useRef(() => {
322
+ });
323
+ const focusProxyRef = React.useRef(null);
324
+ const topMenuRef = React.useRef(null);
325
+ const id = React.useId();
326
+ const handleContentEntry = React.useCallback((side = "start") => {
327
+ if (contentRef.current) {
328
+ restoreContentTabOrderRef.current();
329
+ const candidates = getTabbableCandidates(contentRef.current);
330
+ if (candidates.length) focusFirst(side === "start" ? candidates : candidates.reverse());
331
+ }
332
+ }, []);
333
+ const handleContentExit = React.useCallback(() => {
334
+ if (contentRef.current) {
335
+ const candidates = getTabbableCandidates(contentRef.current);
336
+ if (candidates.length) restoreContentTabOrderRef.current = removeFromTabOrder(candidates);
337
+ }
338
+ }, []);
339
+ React.useEffect(() => {
340
+ timerRef.current = setTimeout(() => {
341
+ setAllowAnimationOfHeight(true);
342
+ }, 500);
343
+ return () => {
344
+ timerRef.current && clearTimeout(timerRef.current);
345
+ };
346
+ }, []);
347
+ const classes = clsx([styles$1[`${rootClassName$1}`]], className);
348
+ return /* @__PURE__ */ jsxRuntime.jsx(
349
+ NavigationMenuContext.Provider,
350
+ {
351
+ value: {
352
+ contentRef,
353
+ focusProxyRef,
354
+ topMenuRef,
355
+ id,
356
+ dir: props.dir || "ltr",
357
+ orientation: props.orientation || "horizontal",
358
+ onEntryKeyDown: handleContentEntry,
359
+ onFocusProxyEnter: handleContentEntry,
360
+ onContentFocusOutside: handleContentExit,
361
+ selectedTopMenu,
362
+ setSelectedTopMenu
363
+ },
364
+ children: /* @__PURE__ */ jsxRuntime.jsx(
365
+ NavigationMenuPrimitive__namespace.Root,
366
+ {
367
+ ...props,
368
+ style: allowAnimationOfHeight ? utils_generateStyling_index.mergeStyles(props.style, { ["--teddy-motion-duration-controlled"]: tokens_motion_variables.teddyMotionDuration300 }) : props.style,
369
+ ref: forwardRef,
370
+ className: classes
371
+ }
372
+ )
373
+ }
374
+ );
375
+ }
376
+ );
377
+ Root$1.displayName = "NavigationMenu";
378
+ const TopMenuList = React.forwardRef(
379
+ ({ className, ...props }, forwardRef) => {
380
+ const classes = clsx([styles$1[`${rootClassName$1}__top-menu-list`]], className);
381
+ const context = React.useContext(NavigationMenuContext);
382
+ const ref = utils_composeRefs.useComposedRefs(context.topMenuRef, forwardRef);
383
+ return /* @__PURE__ */ jsxRuntime.jsx("ul", { ...props, ref, className: classes });
384
+ }
385
+ );
386
+ TopMenuList.displayName = "NavigationMenu.TopMenuList";
387
+ const TopMenuItem = React.forwardRef(
388
+ ({ className, ...props }, forwardRef) => {
389
+ const classes = clsx([styles$1[`${rootClassName$1}__top-menu-item`]], className);
390
+ return /* @__PURE__ */ jsxRuntime.jsx("li", { ...props, ref: forwardRef, className: classes });
391
+ }
392
+ );
393
+ const TopMenuTrigger = React.forwardRef(
394
+ ({ className, asChild, active, ...props }, forwardRef) => {
395
+ const classes = clsx(
396
+ [styles$1[`${rootClassName$1}__top-menu-trigger`], styles$1[`${rootClassName$1}__top-menu-trigger--small`]],
397
+ className
398
+ );
399
+ const Comp = asChild ? reactSlot.Slot : "button";
400
+ const context = React.useContext(NavigationMenuContext);
401
+ const innerRef = React.useRef(null);
402
+ const ref = utils_composeRefs.useComposedRefs(innerRef, forwardRef);
403
+ const isOpen = context.selectedTopMenu === props.value;
404
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
405
+ /* @__PURE__ */ jsxRuntime.jsx(
406
+ Comp,
407
+ {
408
+ ...props,
409
+ ref,
410
+ className: classes,
411
+ "data-state": isOpen ? "open" : "closed",
412
+ "data-active": active ? "true" : void 0,
413
+ "aria-expanded": isOpen,
414
+ "aria-controls": makeContentId({ value: props.value, baseId: context.id }),
415
+ ...{ [ITEM_DATA_ATTR]: "" },
416
+ onClick: utils_composeEventHandlers.composeEventHandlers(props.onClick, () => {
417
+ context.setSelectedTopMenu(props.value);
418
+ }),
419
+ onKeyDown: utils_composeEventHandlers.composeEventHandlers(props.onKeyDown, (event) => {
420
+ var _a;
421
+ const verticalEntryKey = context.dir === "rtl" ? "ArrowLeft" : "ArrowRight";
422
+ const entryKey = { horizontal: "ArrowDown", vertical: verticalEntryKey }[context.orientation];
423
+ if (isOpen && event.key === entryKey) {
424
+ context.onEntryKeyDown();
425
+ return event.preventDefault();
426
+ }
427
+ const isFocusNavigationKey = ["Home", "End", ...ARROW_KEYS].includes(event.key);
428
+ if (isFocusNavigationKey) {
429
+ const triggers = (_a = context.topMenuRef.current) == null ? void 0 : _a.querySelectorAll(`[${ITEM_DATA_ATTR}]`);
430
+ if (!triggers) return;
431
+ let candidateNodes = Array.from(triggers == null ? void 0 : triggers.values());
432
+ const prevItemKey = context.dir === "rtl" ? "ArrowRight" : "ArrowLeft";
433
+ const prevKeys = [prevItemKey, "ArrowUp", "End"];
434
+ if (prevKeys.includes(event.key)) candidateNodes.reverse();
435
+ if (ARROW_KEYS.includes(event.key)) {
436
+ const currentIndex = candidateNodes.indexOf(event.currentTarget);
437
+ candidateNodes = candidateNodes.slice(currentIndex + 1);
438
+ focusFirst(candidateNodes);
439
+ event.preventDefault();
440
+ }
441
+ }
442
+ })
443
+ }
444
+ ),
445
+ isOpen && /* @__PURE__ */ jsxRuntime.jsx(
446
+ components_visuallyHidden_visuallyHidden.VisuallyHidden,
447
+ {
448
+ tabIndex: 0,
449
+ ref: context.focusProxyRef,
450
+ onFocus: (event) => {
451
+ const content = context.contentRef.current;
452
+ const prevFocusedElement = event.relatedTarget;
453
+ const wasTriggerFocused = prevFocusedElement === innerRef.current;
454
+ const wasFocusFromContent = content == null ? void 0 : content.contains(prevFocusedElement);
455
+ if (wasTriggerFocused || !wasFocusFromContent) {
456
+ context.onFocusProxyEnter(wasTriggerFocused ? "start" : "end");
457
+ }
458
+ }
459
+ }
460
+ )
461
+ ] });
462
+ }
463
+ );
464
+ const List = React.forwardRef(
465
+ ({ className, variant, value, ...props }, forwardRef) => {
466
+ const classes = clsx([styles$1[`${rootClassName$1}__list`]], [styles$1[`${rootClassName$1}__list--${variant}`]], className);
467
+ const context = React.useContext(NavigationMenuContext);
468
+ const refOnOpen = utils_composeRefs.useComposedRefs(context.contentRef, forwardRef);
469
+ const hasTopMenu = context.selectedTopMenu !== void 0;
470
+ const isOpen = context.selectedTopMenu === value;
471
+ if (!isOpen) return null;
472
+ return /* @__PURE__ */ jsxRuntime.jsx(
473
+ NavigationMenuPrimitive__namespace.List,
474
+ {
475
+ ref: hasTopMenu ? refOnOpen : forwardRef,
476
+ id: value && makeContentId({ value, baseId: context.id }),
477
+ ...props,
478
+ onKeyDown: utils_composeEventHandlers.composeEventHandlers(props.onKeyDown, (event) => {
479
+ var _a;
480
+ if (!value) return;
481
+ const isMetaKey = event.altKey || event.ctrlKey || event.metaKey;
482
+ const isTabKey = event.key === "Tab" && !isMetaKey;
483
+ if (isTabKey) {
484
+ const candidates = getTabbableCandidates(event.currentTarget);
485
+ const focusedElement = document.activeElement;
486
+ const index = candidates.findIndex((candidate) => candidate === focusedElement);
487
+ const isMovingBackwards = event.shiftKey;
488
+ const nextCandidates = isMovingBackwards ? candidates.slice(0, index).reverse() : candidates.slice(index + 1, candidates.length);
489
+ if (focusFirst(nextCandidates)) {
490
+ event.preventDefault();
491
+ } else {
492
+ (_a = context.focusProxyRef.current) == null ? void 0 : _a.focus();
493
+ context.onContentFocusOutside();
494
+ }
495
+ }
496
+ }),
497
+ className: classes
498
+ }
499
+ );
500
+ }
501
+ );
502
+ List.displayName = "NavigationMenu.List";
503
+ const Separator = React.forwardRef(({ className, ...props }, forwardRef) => {
504
+ const classes = clsx(
505
+ [styles$1[`${rootClassName$1}__separator`]],
506
+ className
507
+ );
508
+ return /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { width: "100%", p: "0", m: "0", ...props, ref: forwardRef, className: classes, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("hr", {}) });
509
+ });
510
+ Separator.displayName = "NavigationMenu.Separator";
511
+ const Item = React.forwardRef(
512
+ ({ className, ...props }, forwardRef) => {
513
+ const classes = clsx([styles$1[`${rootClassName$1}__item`]], className);
514
+ return /* @__PURE__ */ jsxRuntime.jsx(NavigationMenuPrimitive__namespace.Item, { ...props, ref: forwardRef, className: classes });
515
+ }
516
+ );
517
+ Item.displayName = "NavigationMenu.Item";
518
+ const Trigger = React.forwardRef(
519
+ ({ className, active, variant = "default", ...props }, forwardRef) => {
520
+ const classes = clsx(
521
+ [styles$1[`${rootClassName$1}__trigger`]],
522
+ [styles$1[`${rootClassName$1}__trigger--${variant}`]],
523
+ className
524
+ );
525
+ const innerRef = React.useRef(null);
526
+ const ref = utils_composeRefs.useComposedRefs(forwardRef, innerRef);
527
+ return /* @__PURE__ */ jsxRuntime.jsx(
528
+ NavigationMenuPrimitive__namespace.Trigger,
529
+ {
530
+ ...props,
531
+ ref,
532
+ "data-active": active ? "true" : void 0,
533
+ className: classes,
534
+ "data-text": getLabelFromChildren(props.children)
535
+ }
536
+ );
537
+ }
538
+ );
539
+ Trigger.displayName = "NavigationMenu.Trigger";
540
+ const Content = React.forwardRef(
541
+ ({ className, variant = "default", ...props }, forwardRef) => {
542
+ const classes = clsx(
543
+ [styles$1[`${rootClassName$1}__content`]],
544
+ [styles$1[`${rootClassName$1}__content--${variant}`]],
545
+ className
546
+ );
547
+ return /* @__PURE__ */ jsxRuntime.jsx(
548
+ NavigationMenuPrimitive__namespace.Content,
549
+ {
550
+ ...props,
551
+ ref: forwardRef,
552
+ className: classes
553
+ }
554
+ );
555
+ }
556
+ );
557
+ const Link = React.forwardRef(
558
+ ({ className, variant = "default", ...props }, forwardRef) => {
559
+ const classes = clsx([styles$1[`${rootClassName$1}__link`]], [styles$1[`${rootClassName$1}__link--${variant}`]], className);
560
+ return /* @__PURE__ */ jsxRuntime.jsx(
561
+ NavigationMenuPrimitive__namespace.Link,
562
+ {
563
+ ...props,
564
+ ref: forwardRef,
565
+ className: classes,
566
+ "data-text": getLabelFromChildren(props.children)
567
+ }
568
+ );
569
+ }
570
+ );
571
+ Link.displayName = "NavigationMenu.Link";
572
+ const Indicator = React.forwardRef(
573
+ ({ className, ...props }, forwardRef) => {
574
+ const classes = clsx([styles$1[`${rootClassName$1}__indicator`]], className);
575
+ return /* @__PURE__ */ jsxRuntime.jsx(NavigationMenuPrimitive__namespace.Indicator, { ...props, ref: forwardRef, className: classes });
576
+ }
577
+ );
578
+ Indicator.displayName = "NavigationMenu.Indicator";
579
+ const Viewport = React.forwardRef(
580
+ ({ className, ...props }, forwardRef) => {
581
+ const classes = clsx([styles$1[`${rootClassName$1}__viewport`]], className);
582
+ return /* @__PURE__ */ jsxRuntime.jsx(NavigationMenuPrimitive__namespace.Viewport, { ...props, ref: forwardRef, className: classes });
583
+ }
584
+ );
585
+ Viewport.displayName = "NavigationMenu.Viewport";
586
+ const Sub = React.forwardRef(
587
+ ({ className, ...props }, forwardRef) => {
588
+ const classes = clsx([styles$1[`${rootClassName$1}__sub`]], className);
589
+ return /* @__PURE__ */ jsxRuntime.jsx(NavigationMenuPrimitive__namespace.Sub, { ...props, ref: forwardRef, className: classes });
590
+ }
591
+ );
592
+ Sub.displayName = "NavigationMenu.Sub";
593
+ function getLabelFromChildren(children) {
594
+ function findLabel(node) {
595
+ if (typeof node === "string") {
596
+ return node;
597
+ }
598
+ if (React.isValidElement(node) && node.props.children) {
599
+ return findLabel(node.props.children);
600
+ }
601
+ if (Array.isArray(node)) {
602
+ for (let i = node.length - 1; i >= 0; i--) {
603
+ const label = findLabel(node[i]);
604
+ if (label) {
605
+ return label;
606
+ }
607
+ }
608
+ }
609
+ return void 0;
610
+ }
611
+ return findLabel(children);
612
+ }
613
+ function getTabbableCandidates(container) {
614
+ const nodes = [];
615
+ const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
616
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
617
+ acceptNode: (node) => {
618
+ const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
619
+ if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
620
+ return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
621
+ }
622
+ });
623
+ while (walker.nextNode()) nodes.push(walker.currentNode);
624
+ return nodes;
625
+ }
626
+ function focusFirst(candidates) {
627
+ const previouslyFocusedElement = document.activeElement;
628
+ return candidates.some((candidate) => {
629
+ if (candidate === previouslyFocusedElement) return true;
630
+ candidate.focus();
631
+ return document.activeElement !== previouslyFocusedElement;
632
+ });
633
+ }
634
+ function removeFromTabOrder(candidates) {
635
+ candidates.forEach((candidate) => {
636
+ candidate.dataset.tabindex = candidate.getAttribute("tabindex") || "";
637
+ candidate.setAttribute("tabindex", "-1");
638
+ });
639
+ return () => {
640
+ candidates.forEach((candidate) => {
641
+ const prevTabIndex = candidate.dataset.tabindex;
642
+ candidate.setAttribute("tabindex", prevTabIndex);
643
+ });
644
+ };
645
+ }
646
+ const ITEM_DATA_ATTR = "data-teddy-top-selector-trigger";
647
+ const ARROW_KEYS = ["ArrowRight", "ArrowLeft", "ArrowUp", "ArrowDown"];
648
+ function makeContentId(args) {
649
+ return `teddy-navigation-menu-${args.baseId}-${args.value}-content`;
650
+ }
651
+ const NavigationMenu = Object.assign(Root$1, {
652
+ List,
653
+ Separator,
654
+ Item,
655
+ Trigger,
656
+ Content,
657
+ Link,
658
+ Indicator,
659
+ Viewport,
660
+ Sub,
661
+ TopMenuList,
662
+ TopMenuItem,
663
+ TopMenuTrigger
664
+ });
665
+ const styles = {
666
+ "teddy-global-navigation": "_teddy-global-navigation_1eacg_1",
667
+ "teddy-global-navigation__mobile": "_teddy-global-navigation__mobile_1eacg_6",
668
+ "teddy-global-navigation__top-icon-wrapper": "_teddy-global-navigation__top-icon-wrapper_1eacg_26",
669
+ "teddy-global-navigation__top-menu-icons": "_teddy-global-navigation__top-menu-icons_1eacg_31",
670
+ "teddy-global-navigation__link": "_teddy-global-navigation__link_1eacg_35",
671
+ "teddy-global-navigation__header": "_teddy-global-navigation__header_1eacg_48",
672
+ "teddy-global-navigation__colored-box": "_teddy-global-navigation__colored-box_1eacg_51",
673
+ "teddy-global-navigation__colored-box--mobile": "_teddy-global-navigation__colored-box--mobile_1eacg_55",
674
+ "teddy-global-navigation__sublink-button--mobile": "_teddy-global-navigation__sublink-button--mobile_1eacg_59",
675
+ "teddy-global-navigation__list": "_teddy-global-navigation__list_1eacg_65",
676
+ "teddy-global-navigation__viewport": "_teddy-global-navigation__viewport_1eacg_70",
677
+ "teddy-global-navigation__item-wrapper": "_teddy-global-navigation__item-wrapper_1eacg_73",
678
+ "teddy-global-navigation__item-count": "_teddy-global-navigation__item-count_1eacg_77",
679
+ "teddy-global-navigation__viewport-wrapper": "_teddy-global-navigation__viewport-wrapper_1eacg_84",
680
+ "close-viewport": "_close-viewport_1eacg_1",
681
+ "teddy-global-navigation__top-menu-color": "_teddy-global-navigation__top-menu-color_1eacg_101",
682
+ "teddy-global-navigation__top-menu-wrapper": "_teddy-global-navigation__top-menu-wrapper_1eacg_104"
683
+ };
684
+ function MyPages(props) {
685
+ var _a, _b;
686
+ const rootContext = React.useContext(RootContext);
687
+ const isLoggedIn = (((_a = rootContext == null ? void 0 : rootContext.loggedInUser) == null ? void 0 : _a.name.length) || 0) > 0;
688
+ return /* @__PURE__ */ jsxRuntime.jsxs(components_drawer_index.Drawer, { ...props, children: [
689
+ /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.Link, { asChild: true, variant: "button", children: /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Trigger, { children: ((_b = rootContext == null ? void 0 : rootContext.loggedInUser) == null ? void 0 : _b.name.length) ? /* @__PURE__ */ jsxRuntime.jsxs("button", { "data-di-mask": true, children: [
690
+ /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "end-user", size: "sm" }),
691
+ rootContext.loggedInUser.name
692
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs("button", { children: [
693
+ /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "login", size: "sm" }),
694
+ "Logg inn"
695
+ ] }) }) }),
696
+ /* @__PURE__ */ jsxRuntime.jsxs(components_drawer_index.Drawer.Content, { asChild: true, size: rootContext == null ? void 0 : rootContext.drawerSize, children: [
697
+ /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Close, { slot: "floating", "aria-label": "Lukk" }),
698
+ isLoggedIn ? /* @__PURE__ */ jsxRuntime.jsx(LoggedInContent, {}) : /* @__PURE__ */ jsxRuntime.jsx(LoggedOutContent, {}),
699
+ /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Close, { slot: "content", children: /* @__PURE__ */ jsxRuntime.jsx(components_button_button.Button, { variant: "secondary", children: "Lukk" }) }) })
700
+ ] })
701
+ ] });
702
+ }
703
+ function LoggedOutContent() {
704
+ return /* @__PURE__ */ jsxRuntime.jsxs(components_grid_grid.Grid, { gap: "400", children: [
705
+ /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Title, { children: "Logg inn" }),
706
+ /* @__PURE__ */ jsxRuntime.jsxs(components_textSpacing_textSpacing.TextSpacing, { children: [
707
+ /* @__PURE__ */ jsxRuntime.jsx(components_heading_heading.Heading, { variant: "title-100", as: "h3", children: "Privat" }),
708
+ /* @__PURE__ */ jsxRuntime.jsx(components_button_button.Button, { variant: "secondary", asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs("a", { href: components_navigationMenu_globalNavigation_utils.MY_PAGE_LINKS.link, children: [
709
+ components_navigationMenu_globalNavigation_utils.MY_PAGE_LINKS.name,
710
+ " ",
711
+ /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "arrow-right" })
712
+ ] }) })
713
+ ] }),
714
+ /* @__PURE__ */ jsxRuntime.jsxs(components_textSpacing_textSpacing.TextSpacing, { children: [
715
+ /* @__PURE__ */ jsxRuntime.jsx(components_heading_heading.Heading, { variant: "title-100", as: "h3", children: "Bedrift" }),
716
+ /* @__PURE__ */ jsxRuntime.jsx(components_grid_grid.Grid, { gap: "150", children: components_navigationMenu_globalNavigation_utils.LOGGED_IN_LINKS_BUSINESS.map((link) => /* @__PURE__ */ jsxRuntime.jsx(components_button_button.Button, { variant: "secondary", asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs("a", { href: link.link, children: [
717
+ link.name,
718
+ " ",
719
+ /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "arrow-right" })
720
+ ] }) })) })
721
+ ] })
722
+ ] });
723
+ }
724
+ function LoggedInContent() {
725
+ var _a, _b, _c;
726
+ const rootContext = React.useContext(RootContext);
727
+ const isRetailerLoggedIn = (_a = rootContext == null ? void 0 : rootContext.loggedInUser) == null ? void 0 : _a.isRetailer;
728
+ if (isRetailerLoggedIn) {
729
+ return /* @__PURE__ */ jsxRuntime.jsxs(components_textSpacing_textSpacing.TextSpacing, { children: [
730
+ /* @__PURE__ */ jsxRuntime.jsx(components_heading_heading.Heading, { variant: "title-100", as: "h3", mb: "100", mt: "400", children: "Min Side" }),
731
+ (_b = components_navigationMenu_globalNavigation_utils.MY_PAGE_RETAILER_LINKS.links) == null ? void 0 : _b.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)),
732
+ /* @__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" }) })
733
+ ] });
734
+ }
735
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
736
+ /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Title, { children: "Mine sider" }),
737
+ /* @__PURE__ */ jsxRuntime.jsxs(components_tabs_index.Tabs, { defaultValue: "private", children: [
738
+ /* @__PURE__ */ jsxRuntime.jsxs(components_tabs_index.Tabs.List, { children: [
739
+ /* @__PURE__ */ jsxRuntime.jsx(components_tabs_index.Tabs.Trigger, { value: "private", children: "Privat" }),
740
+ /* @__PURE__ */ jsxRuntime.jsx(components_tabs_index.Tabs.Trigger, { value: "business", children: "Bedrift" })
741
+ ] }),
742
+ /* @__PURE__ */ jsxRuntime.jsxs(components_textSpacing_textSpacing.TextSpacing, { children: [
743
+ /* @__PURE__ */ jsxRuntime.jsxs(components_tabs_index.Tabs.Content, { value: "private", children: [
744
+ /* @__PURE__ */ jsxRuntime.jsx(components_heading_heading.Heading, { variant: "title-100", as: "h3", mb: "100", mt: "400", children: "Min Side" }),
745
+ (_c = components_navigationMenu_globalNavigation_utils.MY_PAGE_LINKS.links) == null ? void 0 : _c.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))
746
+ ] }),
747
+ /* @__PURE__ */ jsxRuntime.jsxs(components_tabs_index.Tabs.Content, { value: "business", children: [
748
+ /* @__PURE__ */ jsxRuntime.jsx(components_heading_heading.Heading, { variant: "title-100", as: "h3", mb: "100", mt: "400", children: "Bedriftsportaler" }),
749
+ 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))
750
+ ] }),
751
+ /* @__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" }) })
752
+ ] })
753
+ ] })
754
+ ] });
755
+ }
756
+ MyPages.displayName = "MyPages";
757
+ const SearchField = React.forwardRef(
758
+ (props, forwardRef) => {
759
+ const ref = React.useRef(null);
760
+ const context = React.useContext(RootContext);
761
+ const composedRef = utils_composeRefs.useComposedRefs(forwardRef, ref);
762
+ return /* @__PURE__ */ jsxRuntime.jsx(
763
+ "form",
764
+ {
765
+ onSubmit: (e) => {
766
+ var _a, _b;
767
+ if (context == null ? void 0 : context.onSearchSubmit) {
768
+ context.onSearchSubmit(e, (_a = ref.current) == null ? void 0 : _a.value);
769
+ }
770
+ if (!window || e.isDefaultPrevented()) return;
771
+ e.preventDefault();
772
+ window.location.href = `/sok?q=${encodeURIComponent(((_b = ref.current) == null ? void 0 : _b.value) || "")}`;
773
+ },
774
+ children: /* @__PURE__ */ jsxRuntime.jsxs(components_textField_index.TextField, { ...props, children: [
775
+ /* @__PURE__ */ jsxRuntime.jsx(components_textField_index.TextField.Label, { children: "Søk i innhold" }),
776
+ /* @__PURE__ */ jsxRuntime.jsxs(components_textField_index.TextField.InputGroup, { children: [
777
+ /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "search" }),
778
+ /* @__PURE__ */ jsxRuntime.jsx(
779
+ components_textField_index.TextField.Input,
780
+ {
781
+ ref: composedRef,
782
+ value: context == null ? void 0 : context.searchValue,
783
+ onChange: (e) => {
784
+ var _a, _b;
785
+ if (((_a = ref.current) == null ? void 0 : _a.value) && (context == null ? void 0 : context.onSearchInputChange)) {
786
+ context == null ? void 0 : context.onSearchInputChange(e, (_b = ref.current) == null ? void 0 : _b.value);
787
+ }
788
+ },
789
+ onKeyDown: (e) => {
790
+ if (context == null ? void 0 : context.onSearchKeyDown) {
791
+ context.onSearchKeyDown(e);
792
+ }
793
+ },
794
+ placeholder: "Søk her"
795
+ }
796
+ ),
797
+ /* @__PURE__ */ jsxRuntime.jsx(components_textField_index.TextField.ClearButton, { onClick: () => {
798
+ if (context == null ? void 0 : context.onClear) {
799
+ context.onClear();
800
+ }
801
+ } })
802
+ ] }),
803
+ /* @__PURE__ */ jsxRuntime.jsx(components_textField_index.TextField.Button, { variant: "separated", children: "Søk" })
804
+ ] })
805
+ }
806
+ );
807
+ }
808
+ );
809
+ SearchField.displayName = "SearchField";
810
+ function Search(props) {
811
+ const rootContext = React.useContext(RootContext);
812
+ const additionalSearchContent = rootContext == null ? void 0 : rootContext.additionalSearchContent;
813
+ const searchFieldRef = React.useRef(null);
814
+ return /* @__PURE__ */ jsxRuntime.jsxs(components_drawer_index.Drawer, { ...props, children: [
815
+ /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.Link, { asChild: true, variant: "button", children: /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsxs("button", { children: [
816
+ /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "search", size: "sm" }),
817
+ " Søk"
818
+ ] }) }) }),
819
+ /* @__PURE__ */ jsxRuntime.jsxs(
820
+ components_drawer_index.Drawer.Content,
821
+ {
822
+ size: rootContext == null ? void 0 : rootContext.drawerSize,
823
+ onOpenAutoFocus: (e) => {
824
+ var _a;
825
+ e.preventDefault();
826
+ (_a = searchFieldRef.current) == null ? void 0 : _a.focus();
827
+ },
828
+ children: [
829
+ /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Close, { slot: "floating", "aria-label": "Lukk" }),
830
+ /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Title, { children: "Hva leter du etter?" }),
831
+ /* @__PURE__ */ jsxRuntime.jsx(SearchField, { ref: searchFieldRef }),
832
+ additionalSearchContent ? additionalSearchContent : null,
833
+ /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Close, { slot: "content", children: /* @__PURE__ */ jsxRuntime.jsx(components_button_button.Button, { variant: "secondary", children: "Lukk" }) }) })
834
+ ]
835
+ }
836
+ )
837
+ ] });
838
+ }
839
+ Search.displayName = "Search";
840
+ const ShoppingCart = React.forwardRef(() => {
841
+ const rootContext = React.useContext(RootContext);
842
+ const shoppingCartContent = rootContext == null ? void 0 : rootContext.shoppingCart;
843
+ const numberOfItemsInCart = (rootContext == null ? void 0 : rootContext.shoppingCartNumberOfItems) || 0;
844
+ const titleSuffix = numberOfItemsInCart > 0 ? `(${numberOfItemsInCart})` : "";
845
+ if (!numberOfItemsInCart) return null;
846
+ return /* @__PURE__ */ jsxRuntime.jsxs(components_drawer_index.Drawer, { open: rootContext == null ? void 0 : rootContext.isCartOpen, onOpenChange: rootContext == null ? void 0 : rootContext.onCartOpenChange, children: [
847
+ /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.Link, { asChild: true, variant: "button", children: /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsxs("button", { children: [
848
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx([styles[`${rootClassName}__item-wrapper`]]), children: [
849
+ /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "cart", size: "sm" }),
850
+ numberOfItemsInCart > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: clsx([styles[`${rootClassName}__item-count`]]), children: /* @__PURE__ */ jsxRuntime.jsx(components_badge_counterBadge.CounterBadge, { variant: "attention", children: numberOfItemsInCart }) })
851
+ ] }),
852
+ "Handlekurv"
853
+ ] }) }) }),
854
+ /* @__PURE__ */ jsxRuntime.jsxs(components_drawer_index.Drawer.Content, { size: rootContext == null ? void 0 : rootContext.drawerSize, children: [
855
+ /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Close, { slot: "floating", "aria-label": "Lukk" }),
856
+ /* @__PURE__ */ jsxRuntime.jsxs(components_drawer_index.Drawer.Title, { children: [
857
+ "Handlekurv ",
858
+ titleSuffix
859
+ ] }),
860
+ shoppingCartContent ? shoppingCartContent : null,
861
+ /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Footer, { children: /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Close, { slot: "content", children: /* @__PURE__ */ jsxRuntime.jsx(components_button_button.Button, { variant: "secondary", children: "Lukk" }) }) })
862
+ ] })
863
+ ] });
864
+ });
865
+ ShoppingCart.displayName = "ShoppingCart";
866
+ const Desktop = React.forwardRef(() => {
867
+ const rootContext = React.useContext(RootContext);
868
+ const [showMenu, setShowMenu] = React.useState(false);
869
+ const [isClientSide, setIsClientSide] = React.useState(false);
870
+ const topMenuRef = React.useRef(null);
871
+ const topMenuSize = utils_useSize.useSize(topMenuRef.current);
872
+ React.useEffect(() => {
873
+ setIsClientSide(true);
874
+ }, []);
875
+ if (!rootContext) return null;
876
+ const links = components_navigationMenu_globalNavigation_utils.getLinks(rootContext.pathname.includes("bedrift/utstyrsavtale"), rootContext.customLinks);
877
+ const shouldShowViewport = links.flatMap((link) => link.links || []).some((link) => {
878
+ var _a;
879
+ const sameParent = link.link.split("/")[1] === (rootContext == null ? void 0 : rootContext.pathname.split("/")[1]) || !link.link && (rootContext == null ? void 0 : rootContext.pathname) === "/";
880
+ return (((_a = link.links) == null ? void 0 : _a.length) || 0) > 0 && link.name === (rootContext == null ? void 0 : rootContext.specifiedLink) && sameParent;
881
+ });
882
+ const topMenuHeight = (topMenuSize == null ? void 0 : topMenuSize.height) ? `${topMenuSize.height}px` : void 0;
883
+ const { selectedMenuItem, setSelectedMenuItem, linkComponent: Link2, specifiedLink, setSpecifiedLink } = rootContext;
884
+ const currentLocation = rootContext.pathname.endsWith("/") ? rootContext.pathname : `${rootContext.pathname}/`;
885
+ const handleInteractions = (linkName) => {
886
+ setSpecifiedLink(linkName || "");
887
+ setSelectedMenuItem(linkName || "", true);
888
+ };
889
+ const viewPortHeight = shouldShowViewport ? "333px" : void 0;
890
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
891
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles[`${rootClassName}__top-menu-color`], children: /* @__PURE__ */ jsxRuntime.jsx(
892
+ "div",
893
+ {
894
+ style: utils_generateStyling_index.mergeStyles({ ["--teddy-top-menu-height"]: topMenuHeight }),
895
+ className: styles[`${rootClassName}__top-menu-wrapper`],
896
+ children: /* @__PURE__ */ jsxRuntime.jsxs(NavigationMenu.TopMenuList, { ref: topMenuRef, children: [
897
+ links.map((link) => /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.TopMenuItem, { children: /* @__PURE__ */ jsxRuntime.jsx(
898
+ NavigationMenu.TopMenuTrigger,
899
+ {
900
+ value: link.name,
901
+ asChild: true,
902
+ onClick: () => {
903
+ rootContext.setPathname(link.link);
904
+ setSpecifiedLink("");
905
+ },
906
+ children: link.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(Link2, { href: link.link, children: link.name }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: link.link, children: link.name })
907
+ }
908
+ ) }, link.name)),
909
+ /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.Item, { style: { marginLeft: "auto" } }),
910
+ /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.Item, { children: /* @__PURE__ */ jsxRuntime.jsx(ShoppingCart, {}) }),
911
+ /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.Item, { children: /* @__PURE__ */ jsxRuntime.jsx(Search, {}) }),
912
+ /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.Item, { children: /* @__PURE__ */ jsxRuntime.jsx(MyPages, {}) })
913
+ ] })
914
+ }
915
+ ) }),
916
+ links.map((link) => {
917
+ var _a;
918
+ return /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.List, { value: link.name, children: (_a = link.links) == null ? void 0 : _a.map(
919
+ (subLink) => /* @__PURE__ */ jsxRuntime.jsxs(
920
+ NavigationMenu.Item,
921
+ {
922
+ value: subLink.name,
923
+ onMouseEnter: () => setShowMenu(true),
924
+ onMouseLeave: () => setShowMenu(false),
925
+ children: [
926
+ subLink.name === "Logo" ? /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.Link, { asChild: true, variant: "button", children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(
927
+ Link2,
928
+ {
929
+ href: subLink.link,
930
+ onMouseEnter: () => handleInteractions(),
931
+ onClick: () => handleInteractions(),
932
+ children: /* @__PURE__ */ jsxRuntime.jsx(
933
+ "img",
934
+ {
935
+ src: "https://www.telia.no/globalassets/static/svg/telia-primary-default-v2.svg",
936
+ draggable: "false",
937
+ alt: "Telia logo"
938
+ }
939
+ )
940
+ }
941
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
942
+ "a",
943
+ {
944
+ href: subLink.link,
945
+ onMouseEnter: () => handleInteractions(),
946
+ onClick: () => handleInteractions(),
947
+ children: /* @__PURE__ */ jsxRuntime.jsx(
948
+ "img",
949
+ {
950
+ src: "https://www.telia.no/globalassets/static/svg/telia-primary-default-v2.svg",
951
+ draggable: "false",
952
+ alt: "Telia logo"
953
+ }
954
+ )
955
+ }
956
+ ) }) : /* @__PURE__ */ jsxRuntime.jsx(
957
+ NavigationMenu.Link,
958
+ {
959
+ asChild: true,
960
+ active: selectedMenuItem === subLink.name && currentLocation === subLink.link,
961
+ onFocus: () => {
962
+ handleInteractions(subLink.name);
963
+ setShowMenu(true);
964
+ },
965
+ children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(
966
+ Link2,
967
+ {
968
+ onMouseEnter: () => handleInteractions(subLink.name),
969
+ onClick: () => {
970
+ handleInteractions(subLink.name);
971
+ setShowMenu(false);
972
+ },
973
+ href: subLink.link,
974
+ children: subLink.name
975
+ }
976
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
977
+ "a",
978
+ {
979
+ onMouseEnter: () => handleInteractions(subLink.name),
980
+ onClick: () => {
981
+ handleInteractions(subLink.name);
982
+ setShowMenu(false);
983
+ },
984
+ onFocus: () => {
985
+ setShowMenu(true);
986
+ },
987
+ href: subLink.link,
988
+ children: subLink.name
989
+ }
990
+ )
991
+ }
992
+ ),
993
+ /* @__PURE__ */ jsxRuntime.jsx(
994
+ "div",
995
+ {
996
+ style: utils_generateStyling_index.mergeStyles({ ["--teddy-viewport-wrapper-height"]: viewPortHeight }),
997
+ className: styles[`${rootClassName}__viewport-wrapper`],
998
+ "data-state": showMenu ? "open" : "closed",
999
+ children: isClientSide && /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.Content, { children: !!specifiedLink && subLink.name === specifiedLink && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1000
+ subLink.links && subLink.links.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
1001
+ HightlightedLinksDesktop,
1002
+ {
1003
+ listName: subLink.name,
1004
+ setShowMenu,
1005
+ links: subLink.links
1006
+ }
1007
+ ),
1008
+ subLink.highlightedLinks && subLink.highlightedLinks.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
1009
+ HightlightedLinksDesktop,
1010
+ {
1011
+ colored: true,
1012
+ listName: "Nyttige snarveier",
1013
+ setShowMenu,
1014
+ links: subLink.highlightedLinks
1015
+ }
1016
+ )
1017
+ ] }) })
1018
+ }
1019
+ )
1020
+ ]
1021
+ },
1022
+ subLink.name
1023
+ )
1024
+ ) }, link.name);
1025
+ })
1026
+ ] });
1027
+ });
1028
+ Desktop.displayName = "Desktop";
1029
+ const HightlightedLinksDesktop = ({ links, listName, colored, setShowMenu }) => {
1030
+ const rootContext = React.useContext(RootContext);
1031
+ if (!rootContext) return null;
1032
+ const { linkComponent: Link2, setSpecifiedLink, setSelectedMenuItem } = rootContext;
1033
+ const currentLocation = rootContext.pathname.endsWith("/") ? rootContext.pathname : `${rootContext.pathname}/`;
1034
+ const firstPart = links.slice(0, 4);
1035
+ const secondPart = links.slice(4);
1036
+ return /* @__PURE__ */ jsxRuntime.jsxs(components_box_box.Box, { pt: "40px", pb: "40px", className: colored ? styles[`${rootClassName}__colored-box`] : "", children: [
1037
+ /* @__PURE__ */ jsxRuntime.jsx(components_heading_heading.Heading, { pl: "100", pb: "100", variant: "title-200", as: "h2", children: listName }),
1038
+ /* @__PURE__ */ jsxRuntime.jsxs(components_flex_flex.Flex, { gap: "400", children: [
1039
+ /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { children: firstPart == null ? void 0 : firstPart.map((subSubLink) => {
1040
+ return /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { children: /* @__PURE__ */ jsxRuntime.jsx(
1041
+ NavigationMenu.Link,
1042
+ {
1043
+ asChild: true,
1044
+ variant: "small",
1045
+ active: components_navigationMenu_globalNavigation_utils.getActiveSubLink(currentLocation, links || []) === subSubLink.link,
1046
+ onClick: () => {
1047
+ rootContext.setPathname(subSubLink.link);
1048
+ setSpecifiedLink("");
1049
+ setSelectedMenuItem("", true);
1050
+ setShowMenu(false);
1051
+ },
1052
+ children: subSubLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(Link2, { href: subSubLink.link, children: /* @__PURE__ */ jsxRuntime.jsxs(components_flex_flex.Flex, { as: "span", gap: "100", align: "center", children: [
1053
+ subSubLink.name,
1054
+ /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "arrow-right" })
1055
+ ] }) }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: subSubLink.link, children: /* @__PURE__ */ jsxRuntime.jsxs(components_flex_flex.Flex, { as: "span", gap: "100", align: "center", children: [
1056
+ subSubLink.name,
1057
+ /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "arrow-right" })
1058
+ ] }) })
1059
+ }
1060
+ ) }, subSubLink.name);
1061
+ }) }),
1062
+ /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { children: secondPart.map((subSubLink) => {
1063
+ return /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { children: /* @__PURE__ */ jsxRuntime.jsx(
1064
+ NavigationMenu.Link,
1065
+ {
1066
+ asChild: true,
1067
+ variant: "small",
1068
+ active: components_navigationMenu_globalNavigation_utils.getActiveSubLink(currentLocation, links || []) === subSubLink.link,
1069
+ onClick: () => {
1070
+ rootContext.setPathname(subSubLink.link);
1071
+ setSpecifiedLink("");
1072
+ setSelectedMenuItem("", true);
1073
+ setShowMenu(false);
1074
+ },
1075
+ children: subSubLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(Link2, { href: subSubLink.link, children: /* @__PURE__ */ jsxRuntime.jsxs(components_flex_flex.Flex, { as: "span", gap: "100", align: "center", children: [
1076
+ subSubLink.name,
1077
+ /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "arrow-right" })
1078
+ ] }) }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: subSubLink.link, children: /* @__PURE__ */ jsxRuntime.jsxs(components_flex_flex.Flex, { as: "span", gap: "100", align: "center", children: [
1079
+ subSubLink.name,
1080
+ /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "arrow-right" })
1081
+ ] }) })
1082
+ }
1083
+ ) }, subSubLink.name);
1084
+ }) })
1085
+ ] })
1086
+ ] });
1087
+ };
1088
+ function Mobile(props) {
1089
+ const [specifiedLink, setSpecifiedLink] = React.useState("");
1090
+ const rootContext = React.useContext(RootContext);
1091
+ const drawerRef = React.useRef(null);
1092
+ if (!rootContext) return null;
1093
+ const links = components_navigationMenu_globalNavigation_utils.getLinks(rootContext.pathname.includes("bedrift/utstyrsavtale"), rootContext.customLinks);
1094
+ const { linkComponent: NavLink } = rootContext;
1095
+ const classes = clsx([styles[`${rootClassName}__mobile`]], props.className);
1096
+ const linkClasses = clsx([styles[`${rootClassName}__link`]]);
1097
+ const headerClasses = clsx([styles[`${rootClassName}__header`]]);
1098
+ return /* @__PURE__ */ jsxRuntime.jsx(components_flex_flex.Flex, { ...props, className: classes, children: /* @__PURE__ */ jsxRuntime.jsxs(
1099
+ components_flex_flex.Flex,
1100
+ {
1101
+ flexGrow: "1",
1102
+ justify: "between",
1103
+ align: "center",
1104
+ gap: "200",
1105
+ className: styles[`${rootClassName}__top-icon-wrapper`],
1106
+ children: [
1107
+ /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { flexShrink: "0", children: /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.Link, { asChild: true, variant: "button", children: rootContext.appKey === "open-pages" ? /* @__PURE__ */ jsxRuntime.jsx(NavLink, { href: "/", children: /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { size: "lg", name: "telia-logo", "aria-label": "Telia logo" }) }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: "/", children: /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { size: "lg", name: "telia-logo", "aria-label": "Telia logo" }) }) }) }),
1108
+ /* @__PURE__ */ jsxRuntime.jsxs(components_flex_flex.Flex, { flexBasis: "0", gap: { sm: "100", md: "200" }, className: styles[`${rootClassName}__top-menu-icons`], children: [
1109
+ /* @__PURE__ */ jsxRuntime.jsx(Search, {}),
1110
+ /* @__PURE__ */ jsxRuntime.jsx(ShoppingCart, {}),
1111
+ /* @__PURE__ */ jsxRuntime.jsx(MyPages, {}),
1112
+ /* @__PURE__ */ jsxRuntime.jsxs(components_drawer_index.Drawer, { children: [
1113
+ /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.Link, { asChild: true, variant: "button", children: /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsxs("button", { children: [
1114
+ /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "menu", size: "sm" }),
1115
+ " Meny"
1116
+ ] }) }) }),
1117
+ /* @__PURE__ */ jsxRuntime.jsxs(components_drawer_index.Drawer.Content, { gap: "400", size: rootContext.drawerSize, children: [
1118
+ /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Close, { ref: drawerRef, slot: "floating", "aria-label": "Lukk" }),
1119
+ !specifiedLink ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1120
+ /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Title, { children: "Meny" }),
1121
+ /* @__PURE__ */ jsxRuntime.jsxs(
1122
+ components_tabs_index.Tabs,
1123
+ {
1124
+ value: rootContext.selectedDomainItem,
1125
+ onValueChange: (v) => rootContext.setSelectedDomainItem(v, true),
1126
+ children: [
1127
+ /* @__PURE__ */ jsxRuntime.jsx(components_tabs_index.Tabs.List, { children: links.map((link) => /* @__PURE__ */ jsxRuntime.jsx(components_tabs_index.Tabs.Trigger, { asChild: true, value: link.name, children: link.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(NavLink, { href: link.link, children: link.name }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: link.link, children: link.name }) }, link.name)) }),
1128
+ /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: links.map((link) => {
1129
+ var _a, _b;
1130
+ return /* @__PURE__ */ jsxRuntime.jsxs(components_tabs_index.Tabs.Content, { value: link.name, children: [
1131
+ /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { mt: "400", children: (_a = link.links) == null ? void 0 : _a.filter((l) => l.name !== "Logo").map(
1132
+ (subLink) => subLink.links && subLink.links.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(components_box_box.Box, { onClick: () => setSpecifiedLink(subLink.name), className: linkClasses, children: [
1133
+ /* @__PURE__ */ jsxRuntime.jsx(components_heading_heading.Heading, { asChild: true, variant: "title-300", children: /* @__PURE__ */ jsxRuntime.jsx(components_button_button.Button, { className: styles[`${rootClassName}__sublink-button--mobile`], children: subLink.name }) }),
1134
+ /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "chevron-right", size: "md" })
1135
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsxs(NavLink, { href: subLink.link, className: linkClasses, children: [
1136
+ /* @__PURE__ */ jsxRuntime.jsx(components_heading_heading.Heading, { variant: "title-300", as: "h2", className: headerClasses, children: subLink.name }),
1137
+ /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "chevron-right", size: "md" })
1138
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs("a", { href: subLink.link, className: linkClasses, children: [
1139
+ /* @__PURE__ */ jsxRuntime.jsx(components_heading_heading.Heading, { variant: "title-300", as: "h2", children: subLink.name }),
1140
+ /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "chevron-right", size: "md" })
1141
+ ] }) })
1142
+ ) }),
1143
+ link.highlightedLinks && ((_b = link.highlightedLinks) == null ? void 0 : _b.length) > 0 && /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { className: styles[`${rootClassName}__colored-box--mobile`], children: /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { mt: "400", pt: "250", pb: "250", pl: "300", children: /* @__PURE__ */ jsxRuntime.jsx(
1144
+ HighlightedLinks,
1145
+ {
1146
+ item: link,
1147
+ links: link.highlightedLinks,
1148
+ drawerRef,
1149
+ listTitle: "Nyttige snarveier"
1150
+ }
1151
+ ) }) })
1152
+ ] }, link.name);
1153
+ }) })
1154
+ ]
1155
+ }
1156
+ )
1157
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1158
+ /* @__PURE__ */ jsxRuntime.jsx(components_drawer_index.Drawer.Title, { children: /* @__PURE__ */ jsxRuntime.jsxs(components_button_button.Button, { size: "sm", variant: "secondary", onClick: () => setSpecifiedLink(""), children: [
1159
+ /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "arrow-left" }),
1160
+ "Tilbake"
1161
+ ] }) }),
1162
+ /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { mt: "100", children: links.filter((item) => item.name === rootContext.selectedDomainItem).map(
1163
+ (link) => {
1164
+ var _a;
1165
+ return (_a = link.links) == null ? void 0 : _a.filter((l) => l.name !== "Logo").map(
1166
+ (subLink) => subLink.links && subLink.links.length > 0 && subLink.name === specifiedLink && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1167
+ /* @__PURE__ */ jsxRuntime.jsx(
1168
+ HighlightedLinks,
1169
+ {
1170
+ item: subLink,
1171
+ listTitle: subLink.name,
1172
+ links: subLink.links,
1173
+ drawerRef
1174
+ }
1175
+ ),
1176
+ subLink.highlightedLinks && subLink.highlightedLinks.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { className: styles[`${rootClassName}__colored-box--mobile`], children: /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { mt: "400", pt: "250", pb: "250", pl: "300", children: /* @__PURE__ */ jsxRuntime.jsx(
1177
+ HighlightedLinks,
1178
+ {
1179
+ item: subLink,
1180
+ listTitle: "Nyttige snarveier",
1181
+ links: subLink.highlightedLinks,
1182
+ drawerRef
1183
+ }
1184
+ ) }) })
1185
+ ] })
1186
+ );
1187
+ }
1188
+ ) })
1189
+ ] })
1190
+ ] })
1191
+ ] })
1192
+ ] })
1193
+ ]
1194
+ }
1195
+ ) });
1196
+ }
1197
+ Mobile.displayName = "Mobile";
1198
+ const HighlightedLinks = ({
1199
+ listTitle,
1200
+ links,
1201
+ item,
1202
+ drawerRef
1203
+ }) => {
1204
+ const rootContext = React.useContext(RootContext);
1205
+ if (!rootContext) return null;
1206
+ const { linkComponent: NavLink } = rootContext;
1207
+ const currentLocation = rootContext.pathname;
1208
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1209
+ /* @__PURE__ */ jsxRuntime.jsx(components_heading_heading.Heading, { pl: "100", pb: "100", variant: "title-200", as: "h2", children: listTitle }),
1210
+ /* @__PURE__ */ jsxRuntime.jsx(components_list_index.List, { gap: "10", pl: "25", children: links == null ? void 0 : links.map((subSubLink) => /* @__PURE__ */ jsxRuntime.jsx(components_list_index.List.Item, { children: /* @__PURE__ */ jsxRuntime.jsx(
1211
+ NavigationMenu.Link,
1212
+ {
1213
+ asChild: true,
1214
+ variant: "small",
1215
+ active: components_navigationMenu_globalNavigation_utils.getActiveSubLink(currentLocation, item.links || []) === subSubLink.link,
1216
+ onClick: () => {
1217
+ var _a;
1218
+ (_a = drawerRef == null ? void 0 : drawerRef.current) == null ? void 0 : _a.click();
1219
+ rootContext.setPathname(subSubLink.link);
1220
+ },
1221
+ children: subSubLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(NavLink, { href: subSubLink.link, children: /* @__PURE__ */ jsxRuntime.jsxs(components_flex_flex.Flex, { as: "span", gap: "icon" in subSubLink ? "25" : "100", align: "center", children: [
1222
+ subSubLink.name,
1223
+ subSubLink.icon ? /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: subSubLink.icon }) : /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "arrow-right" })
1224
+ ] }) }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: subSubLink.link, children: /* @__PURE__ */ jsxRuntime.jsxs(components_flex_flex.Flex, { as: "span", gap: "icon" in subSubLink ? "25" : "100", align: "center", children: [
1225
+ subSubLink.name,
1226
+ subSubLink.icon ? /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: subSubLink.icon }) : /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "arrow-right" })
1227
+ ] }) })
1228
+ }
1229
+ ) }, subSubLink.name)) })
1230
+ ] });
1231
+ };
1232
+ const DesktopSimplified = React.forwardRef(() => {
1233
+ var _a;
1234
+ const rootContext = React.useContext(RootContext);
1235
+ const isRetailerLoggedIn = (_a = rootContext == null ? void 0 : rootContext.loggedInUser) == null ? void 0 : _a.isRetailer;
1236
+ if (!rootContext) return null;
1237
+ const { setSelectedMenuItem, linkComponent: Link2 } = rootContext;
1238
+ const isBusinessRental = rootContext.pathname.includes("bedrift/utstyrsavtale");
1239
+ const links = components_navigationMenu_globalNavigation_utils.getLinks(isBusinessRental, rootContext.customLinks);
1240
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1241
+ links.map((link) => {
1242
+ var _a2;
1243
+ return /* @__PURE__ */ jsxRuntime.jsxs(NavigationMenu.List, { value: link.name, children: [
1244
+ (_a2 = link.links) == null ? void 0 : _a2.map((subLink) => /* @__PURE__ */ jsxRuntime.jsxs(NavigationMenu.Item, { value: subLink.name, children: [
1245
+ subLink.name === "Logo" && /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.Link, { asChild: true, variant: "button", children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsxRuntime.jsx(Link2, { href: subLink.link, onClick: () => setSelectedMenuItem(""), children: /* @__PURE__ */ jsxRuntime.jsx(
1246
+ "img",
1247
+ {
1248
+ src: "https://www.telia.no/globalassets/static/svg/telia-primary-default-v2.svg",
1249
+ draggable: "false",
1250
+ alt: "Telia logo"
1251
+ }
1252
+ ) }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: subLink.link, onClick: () => setSelectedMenuItem(""), children: /* @__PURE__ */ jsxRuntime.jsx(
1253
+ "img",
1254
+ {
1255
+ src: "https://www.telia.no/globalassets/static/svg/telia-primary-default-v2.svg",
1256
+ draggable: "false",
1257
+ alt: "Telia logo"
1258
+ }
1259
+ ) }) }),
1260
+ subLink.name === "Hjem" && isBusinessRental && /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.Link, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: subLink.link, children: subLink.name }) })
1261
+ ] }, subLink.name)),
1262
+ /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { ml: "auto" }),
1263
+ /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.Item, { children: /* @__PURE__ */ jsxRuntime.jsx(ShoppingCart, {}) }),
1264
+ isRetailerLoggedIn && /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.Item, { children: /* @__PURE__ */ jsxRuntime.jsx(MyPages, {}) })
1265
+ ] }, link.name);
1266
+ }),
1267
+ /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.Viewport, { className: styles[`${rootClassName}__viewport`] })
1268
+ ] });
1269
+ });
1270
+ DesktopSimplified.displayName = "DesktopSimplified";
1271
+ function MobileSimplified(props) {
1272
+ const rootContext = React.useContext(RootContext);
1273
+ if (!rootContext) return null;
1274
+ const { linkComponent: NavLink } = rootContext;
1275
+ const classes = clsx([styles[`${rootClassName}__mobile`]], props.className);
1276
+ return /* @__PURE__ */ jsxRuntime.jsx(components_flex_flex.Flex, { ...props, className: classes, children: /* @__PURE__ */ jsxRuntime.jsxs(components_flex_flex.Flex, { flexGrow: "1", justify: "between", align: "center", gap: "200", children: [
1277
+ /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { flexShrink: "0", children: /* @__PURE__ */ jsxRuntime.jsx(NavigationMenu.Link, { asChild: true, variant: "button", children: rootContext.appKey === "open-pages" ? /* @__PURE__ */ jsxRuntime.jsx(NavLink, { href: "/", children: /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { size: "lg", name: "telia-logo", "aria-label": "Telia logo" }) }) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: "/", children: /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { size: "lg", name: "telia-logo", "aria-label": "Telia logo" }) }) }) }),
1278
+ /* @__PURE__ */ jsxRuntime.jsx(components_flex_flex.Flex, { flexBasis: "0", gap: { sm: "100", md: "200" }, children: /* @__PURE__ */ jsxRuntime.jsx(ShoppingCart, {}) })
1279
+ ] }) });
1280
+ }
1281
+ MobileSimplified.displayName = "MobileSimplified";
1282
+ const rootClassName = "teddy-global-navigation";
1283
+ const RootContext = React.createContext(null);
1284
+ function Root({
1285
+ className,
1286
+ appKey,
1287
+ loggedInUser,
1288
+ linkComponent,
1289
+ onLogoutClick,
1290
+ shoppingCart,
1291
+ shoppingCartNumberOfItems,
1292
+ onSearchSubmit,
1293
+ additionalSearchContent,
1294
+ isCartOpen,
1295
+ onCartOpenChange,
1296
+ drawerSize = "md",
1297
+ isSimplified,
1298
+ customLinks,
1299
+ currentPath,
1300
+ onSearchInputChange,
1301
+ onSearchKeyDown,
1302
+ searchValue,
1303
+ onClear,
1304
+ ...props
1305
+ }) {
1306
+ const [selectedMenuItem, setSelectedMenuItem] = React.useState(getInitialMenuItem(currentPath, customLinks));
1307
+ const [selectedDomainItem, setSelectedDomainItem] = React.useState(getInitialDomain(currentPath, customLinks));
1308
+ const [pathname, setPathname] = React.useState(currentPath || "");
1309
+ const [specifiedLink, setSpecifiedLink] = React.useState(getInitialMenuItem(currentPath, customLinks));
1310
+ const classes = clsx([styles[`${rootClassName}`]], className);
1311
+ React.useEffect(() => {
1312
+ setPathname(currentPath || "");
1313
+ }, [currentPath]);
1314
+ return /* @__PURE__ */ jsxRuntime.jsx(
1315
+ RootContext.Provider,
1316
+ {
1317
+ value: {
1318
+ appKey,
1319
+ loggedInUser,
1320
+ selectedMenuItem,
1321
+ setSelectedMenuItem(v, onlyStateChange) {
1322
+ if (appKey === "open-pages" && !onlyStateChange) return;
1323
+ setSelectedMenuItem(v);
1324
+ },
1325
+ linkComponent,
1326
+ selectedDomainItem,
1327
+ setSelectedDomainItem(v, onlyStateChange) {
1328
+ if (appKey === "open-pages" && !onlyStateChange) return;
1329
+ setSelectedDomainItem(v);
1330
+ },
1331
+ pathname,
1332
+ setPathname(v) {
1333
+ if (appKey === "open-pages") return;
1334
+ setPathname(v);
1335
+ },
1336
+ onLogoutClick,
1337
+ shoppingCart,
1338
+ shoppingCartNumberOfItems,
1339
+ onSearchSubmit,
1340
+ additionalSearchContent,
1341
+ isCartOpen,
1342
+ onCartOpenChange,
1343
+ drawerSize,
1344
+ specifiedLink,
1345
+ setSpecifiedLink,
1346
+ onSearchInputChange,
1347
+ onSearchKeyDown,
1348
+ searchValue,
1349
+ onClear,
1350
+ customLinks
1351
+ },
1352
+ children: /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { ...props, className: classes, children: /* @__PURE__ */ jsxRuntime.jsxs(
1353
+ NavigationMenu,
1354
+ {
1355
+ topMenuValue: selectedDomainItem,
1356
+ onTopMenuValueChange: setSelectedDomainItem,
1357
+ value: selectedMenuItem,
1358
+ onValueChange: (v) => {
1359
+ if (v === "" || appKey === "open-pages") return;
1360
+ setSelectedMenuItem(v);
1361
+ },
1362
+ children: [
1363
+ /* @__PURE__ */ jsxRuntime.jsxs(components_box_box.Box, { display: { sm: "none", lg: "block" }, children: [
1364
+ isSimplified && /* @__PURE__ */ jsxRuntime.jsx(DesktopSimplified, {}),
1365
+ !isSimplified && /* @__PURE__ */ jsxRuntime.jsx(Desktop, {})
1366
+ ] }),
1367
+ /* @__PURE__ */ jsxRuntime.jsxs(components_box_box.Box, { display: { lg: "none" }, children: [
1368
+ isSimplified && /* @__PURE__ */ jsxRuntime.jsx(MobileSimplified, {}),
1369
+ !isSimplified && /* @__PURE__ */ jsxRuntime.jsx(Mobile, {})
1370
+ ] })
1371
+ ]
1372
+ }
1373
+ ) })
1374
+ }
1375
+ );
1376
+ }
1377
+ Root.displayName = "Root";
1378
+ function getInitialDomain(currentPath, customLinks) {
1379
+ const privateLinks = (customLinks == null ? void 0 : customLinks.privateLinks) || components_navigationMenu_globalNavigation_utils.DEFAULT_PRIVATE_LINKS;
1380
+ const businessLinks = (customLinks == null ? void 0 : customLinks.businessLinks) || components_navigationMenu_globalNavigation_utils.DEFAULT_BUSINESS_LINKS;
1381
+ const mduLinks = (customLinks == null ? void 0 : customLinks.mduLinks) || components_navigationMenu_globalNavigation_utils.DEFAULT_MDU_LINKS;
1382
+ if (!currentPath) return privateLinks.name;
1383
+ const locationArray = currentPath ? currentPath.split("/") : [];
1384
+ const domainPartOfLocation = `/${locationArray[1].toLowerCase()}/`;
1385
+ const initDomain = domainPartOfLocation === businessLinks.link ? businessLinks.name : domainPartOfLocation === mduLinks.link ? mduLinks.name : privateLinks.name;
1386
+ return initDomain;
1387
+ }
1388
+ function getInitialMenuItem(currentPath, customLinks) {
1389
+ var _a, _b, _c, _d, _e, _f;
1390
+ const privateLinks = (customLinks == null ? void 0 : customLinks.privateLinks) || components_navigationMenu_globalNavigation_utils.DEFAULT_PRIVATE_LINKS;
1391
+ const businessLinks = (customLinks == null ? void 0 : customLinks.businessLinks) || components_navigationMenu_globalNavigation_utils.DEFAULT_BUSINESS_LINKS;
1392
+ const mduLinks = (customLinks == null ? void 0 : customLinks.mduLinks) || components_navigationMenu_globalNavigation_utils.DEFAULT_MDU_LINKS;
1393
+ if (!currentPath) return;
1394
+ const locationArray = currentPath ? currentPath.split("/") : [];
1395
+ const initialDomain = getInitialDomain(currentPath, customLinks);
1396
+ if (initialDomain === businessLinks.name) {
1397
+ const mainMenuPartOfLocation2 = locationArray[2];
1398
+ return (_b = (_a = businessLinks.links) == null ? void 0 : _a.find(
1399
+ (link) => {
1400
+ var _a2;
1401
+ return link.link === `/${initialDomain.toLowerCase()}/${mainMenuPartOfLocation2}/` || ((_a2 = link.links) == null ? void 0 : _a2.some((link2) => link2.link === `/${initialDomain.toLowerCase()}/${mainMenuPartOfLocation2}/`));
1402
+ }
1403
+ )) == null ? void 0 : _b.name;
1404
+ }
1405
+ if (initialDomain === mduLinks.name) {
1406
+ const mainMenuPartOfLocation2 = locationArray[2];
1407
+ return (_d = (_c = mduLinks.links) == null ? void 0 : _c.find((link) => link.link === `/${initialDomain.toLowerCase()}/${mainMenuPartOfLocation2}/`)) == null ? void 0 : _d.name;
1408
+ }
1409
+ const mainMenuPartOfLocation = locationArray[1];
1410
+ return (_f = (_e = privateLinks.links) == null ? void 0 : _e.find((link) => {
1411
+ var _a2;
1412
+ return link.name.toLowerCase() === mainMenuPartOfLocation || ((_a2 = link.links) == null ? void 0 : _a2.some((link2) => link2.link === `/${mainMenuPartOfLocation}/`));
1413
+ })) == null ? void 0 : _f.name;
1414
+ }
1415
+ Root.displayName = "GlobalNavigation";
1416
+ const GlobalNavigation = Root;
1417
+ exports.CheckboxCardGroup = CheckboxCardGroup;
1418
+ exports.CheckboxCardGroup$1 = CheckboxCardGroup;
1419
+ exports.Close = Close;
1420
+ exports.Close$1 = Close;
1421
+ exports.Content = Content$2;
1422
+ exports.Content$1 = Content$2;
1423
+ exports.Content$2 = Content$1;
1424
+ exports.Desktop = Desktop;
1425
+ exports.Desktop$1 = Desktop;
1426
+ exports.DesktopSimplified = DesktopSimplified;
1427
+ exports.DesktopSimplified$1 = DesktopSimplified;
1428
+ exports.GlobalNavigation = GlobalNavigation;
1429
+ exports.GlobalNavigation$1 = GlobalNavigation;
1430
+ exports.HighlightedLinks = HighlightedLinks;
1431
+ exports.HighlightedLinks$1 = HighlightedLinks;
1432
+ exports.Indicator = Indicator$1;
1433
+ exports.Item = Item$2;
1434
+ exports.Item$1 = Item$2;
1435
+ exports.Item$2 = Item$1;
1436
+ exports.ItemContext = ItemContext$1;
1437
+ exports.ItemContext$1 = ItemContext$1;
1438
+ exports.ItemContext$2 = ItemContext;
1439
+ exports.Mobile = Mobile;
1440
+ exports.Mobile$1 = Mobile;
1441
+ exports.MobileSimplified = MobileSimplified;
1442
+ exports.MobileSimplified$1 = MobileSimplified;
1443
+ exports.Modal = Modal;
1444
+ exports.Modal$1 = Modal;
1445
+ exports.MyPages = MyPages;
1446
+ exports.MyPages$1 = MyPages;
1447
+ exports.NavigationMenu = NavigationMenu;
1448
+ exports.NavigationMenu$1 = NavigationMenu;
1449
+ exports.RadioCardGroup = RadioCardGroup;
1450
+ exports.RadioCardGroup$1 = RadioCardGroup;
1451
+ exports.Root = Root;
1452
+ exports.RootContext = RootContext;
1453
+ exports.Search = Search;
1454
+ exports.Search$1 = Search;
1455
+ exports.SearchField = SearchField;
1456
+ exports.SearchField$1 = SearchField;
1457
+ exports.Separator = Separator;
1458
+ exports.Separator$1 = Separator;
1459
+ exports.ShoppingCart = ShoppingCart;
1460
+ exports.ShoppingCart$1 = ShoppingCart;
1461
+ exports.Title = Title$1;
1462
+ exports.Title$1 = Title$1;
1463
+ exports.Title$2 = Title;
1464
+ exports.rootClassName = rootClassName$1;
1465
+ exports.rootClassName$1 = rootClassName$1;
1466
+ exports.rootClassName$2 = rootClassName;