@telia/teddy 0.1.24 → 0.1.26
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.
- package/dist/components/navigation-menu/global-navigation/utils.cjs +14 -21
- package/dist/components/navigation-menu/global-navigation/utils.d.ts +29 -10
- package/dist/components/navigation-menu/global-navigation/utils.js +14 -21
- package/dist/components/radio-card-group/radio-card-group-item-title.cjs +44 -82
- package/dist/components/radio-card-group/radio-card-group-item-title.js +44 -82
- package/dist/components/tabs/tabs-root.cjs +5 -5
- package/dist/components/tabs/tabs-root.js +5 -5
- package/dist/style.css +115 -226
- package/package.json +1 -1
|
@@ -260,34 +260,22 @@ const Close = React__default.forwardRef(
|
|
|
260
260
|
);
|
|
261
261
|
Close.displayName = "Dialog.Close";
|
|
262
262
|
const Modal = Object.assign(Root$2, { Trigger: Trigger$1, Content: Content$1, Title, Overlay, Description, Close, Image, Group });
|
|
263
|
-
const scaleIn = "_scaleIn_19565_1";
|
|
264
|
-
const scaleOut = "_scaleOut_19565_1";
|
|
265
|
-
const enterFromRight = "_enterFromRight_19565_1";
|
|
266
|
-
const enterFromLeft = "_enterFromLeft_19565_1";
|
|
267
|
-
const exitToRight = "_exitToRight_19565_1";
|
|
268
|
-
const exitToLeft = "_exitToLeft_19565_1";
|
|
269
263
|
const styles$1 = {
|
|
270
|
-
"teddy-navigation-menu": "_teddy-navigation-
|
|
271
|
-
"teddy-navigation-menu__viewport": "_teddy-navigation-
|
|
272
|
-
"teddy-navigation-menu__separator": "_teddy-navigation-
|
|
273
|
-
"teddy-navigation-menu__list": "_teddy-navigation-
|
|
274
|
-
"teddy-navigation-menu__top-menu-list": "_teddy-navigation-menu__top-menu-
|
|
275
|
-
"teddy-navigation-menu__top-menu-trigger": "_teddy-navigation-menu__top-menu-
|
|
276
|
-
"teddy-navigation-menu__top-menu-trigger--small": "_teddy-navigation-menu__top-menu-trigger--
|
|
277
|
-
"teddy-navigation-menu__top-menu-trigger--button": "_teddy-navigation-menu__top-menu-trigger--
|
|
278
|
-
"teddy-navigation-menu__content": "_teddy-navigation-
|
|
279
|
-
"teddy-navigation-menu__trigger": "_teddy-navigation-
|
|
280
|
-
"teddy-navigation-menu__trigger--small": "_teddy-navigation-menu__trigger--
|
|
281
|
-
"teddy-navigation-menu__trigger--button": "_teddy-navigation-menu__trigger--
|
|
282
|
-
"teddy-navigation-menu__link": "_teddy-navigation-
|
|
283
|
-
"teddy-navigation-menu__link--small": "_teddy-navigation-menu__link--
|
|
284
|
-
"teddy-navigation-menu__link--button": "_teddy-navigation-menu__link--
|
|
285
|
-
scaleIn,
|
|
286
|
-
scaleOut,
|
|
287
|
-
enterFromRight,
|
|
288
|
-
enterFromLeft,
|
|
289
|
-
exitToRight,
|
|
290
|
-
exitToLeft
|
|
264
|
+
"teddy-navigation-menu": "_teddy-navigation-menu_6p30v_1",
|
|
265
|
+
"teddy-navigation-menu__viewport": "_teddy-navigation-menu__viewport_6p30v_34",
|
|
266
|
+
"teddy-navigation-menu__separator": "_teddy-navigation-menu__separator_6p30v_37",
|
|
267
|
+
"teddy-navigation-menu__list": "_teddy-navigation-menu__list_6p30v_40",
|
|
268
|
+
"teddy-navigation-menu__top-menu-list": "_teddy-navigation-menu__top-menu-list_6p30v_66",
|
|
269
|
+
"teddy-navigation-menu__top-menu-trigger": "_teddy-navigation-menu__top-menu-trigger_6p30v_87",
|
|
270
|
+
"teddy-navigation-menu__top-menu-trigger--small": "_teddy-navigation-menu__top-menu-trigger--small_6p30v_106",
|
|
271
|
+
"teddy-navigation-menu__top-menu-trigger--button": "_teddy-navigation-menu__top-menu-trigger--button_6p30v_112",
|
|
272
|
+
"teddy-navigation-menu__content": "_teddy-navigation-menu__content_6p30v_187",
|
|
273
|
+
"teddy-navigation-menu__trigger": "_teddy-navigation-menu__trigger_6p30v_219",
|
|
274
|
+
"teddy-navigation-menu__trigger--small": "_teddy-navigation-menu__trigger--small_6p30v_239",
|
|
275
|
+
"teddy-navigation-menu__trigger--button": "_teddy-navigation-menu__trigger--button_6p30v_245",
|
|
276
|
+
"teddy-navigation-menu__link": "_teddy-navigation-menu__link_6p30v_313",
|
|
277
|
+
"teddy-navigation-menu__link--small": "_teddy-navigation-menu__link--small_6p30v_333",
|
|
278
|
+
"teddy-navigation-menu__link--button": "_teddy-navigation-menu__link--button_6p30v_339"
|
|
291
279
|
};
|
|
292
280
|
const rootClassName$1 = "teddy-navigation-menu";
|
|
293
281
|
const NavigationMenuContext = React__default.createContext({
|
|
@@ -533,9 +521,6 @@ const Trigger = React__default.forwardRef(
|
|
|
533
521
|
return /* @__PURE__ */ jsx(
|
|
534
522
|
NavigationMenuPrimitive.Trigger,
|
|
535
523
|
{
|
|
536
|
-
onPointerEnter: (e) => e.preventDefault(),
|
|
537
|
-
onPointerMove: (e) => e.preventDefault(),
|
|
538
|
-
onPointerLeave: (e) => e.preventDefault(),
|
|
539
524
|
...props,
|
|
540
525
|
ref,
|
|
541
526
|
"data-active": active ? "true" : void 0,
|
|
@@ -556,8 +541,6 @@ const Content = React__default.forwardRef(
|
|
|
556
541
|
return /* @__PURE__ */ jsx(
|
|
557
542
|
NavigationMenuPrimitive.Content,
|
|
558
543
|
{
|
|
559
|
-
onPointerEnter: (e) => e.preventDefault(),
|
|
560
|
-
onPointerLeave: (e) => e.preventDefault(),
|
|
561
544
|
...props,
|
|
562
545
|
ref: forwardRef,
|
|
563
546
|
className: classes
|
|
@@ -677,27 +660,22 @@ const NavigationMenu = Object.assign(Root$1, {
|
|
|
677
660
|
TopMenuTrigger
|
|
678
661
|
});
|
|
679
662
|
const styles = {
|
|
680
|
-
"teddy-global-navigation": "_teddy-global-
|
|
681
|
-
"teddy-global-navigation__mobile
|
|
682
|
-
"teddy-global-
|
|
683
|
-
"teddy-global-
|
|
684
|
-
"teddy-global-
|
|
685
|
-
"teddy-global-
|
|
686
|
-
"teddy-global-
|
|
687
|
-
"teddy-global-
|
|
688
|
-
"teddy-global-
|
|
689
|
-
"teddy-global-
|
|
690
|
-
"teddy-global-
|
|
691
|
-
"teddy-global-
|
|
692
|
-
"teddy-global-
|
|
693
|
-
"teddy-global-
|
|
694
|
-
"teddy-global-
|
|
695
|
-
"teddy-global-
|
|
696
|
-
"close-viewport": "_close-viewport_1kpy3_1",
|
|
697
|
-
"teddy-global-navigation__top-menu-color": "_teddy-global-navigation__top-menu-color_1kpy3_102",
|
|
698
|
-
"teddy-global-navigation__top-menu-wrapper": "_teddy-global-navigation__top-menu-wrapper_1kpy3_105",
|
|
699
|
-
"teddy-global-navigation__accordion-look": "_teddy-global-navigation__accordion-look_1kpy3_122",
|
|
700
|
-
"teddy-global-navigation__mobile-link--accordion-look": "_teddy-global-navigation__mobile-link--accordion-look_1kpy3_138"
|
|
663
|
+
"teddy-global-navigation": "_teddy-global-navigation_19q4u_1",
|
|
664
|
+
"teddy-global-navigation__mobile": "_teddy-global-navigation__mobile_19q4u_6",
|
|
665
|
+
"teddy-global-navigation__top-icon-wrapper": "_teddy-global-navigation__top-icon-wrapper_19q4u_26",
|
|
666
|
+
"teddy-global-navigation__top-menu-icons": "_teddy-global-navigation__top-menu-icons_19q4u_31",
|
|
667
|
+
"teddy-global-navigation__link": "_teddy-global-navigation__link_19q4u_35",
|
|
668
|
+
"teddy-global-navigation__header": "_teddy-global-navigation__header_19q4u_48",
|
|
669
|
+
"teddy-global-navigation__colored-box": "_teddy-global-navigation__colored-box_19q4u_51",
|
|
670
|
+
"teddy-global-navigation__colored-box--mobile": "_teddy-global-navigation__colored-box--mobile_19q4u_54",
|
|
671
|
+
"teddy-global-navigation__sublink-button--mobile": "_teddy-global-navigation__sublink-button--mobile_19q4u_58",
|
|
672
|
+
"teddy-global-navigation__list": "_teddy-global-navigation__list_19q4u_64",
|
|
673
|
+
"teddy-global-navigation__viewport": "_teddy-global-navigation__viewport_19q4u_69",
|
|
674
|
+
"teddy-global-navigation__item-wrapper": "_teddy-global-navigation__item-wrapper_19q4u_72",
|
|
675
|
+
"teddy-global-navigation__item-count": "_teddy-global-navigation__item-count_19q4u_76",
|
|
676
|
+
"teddy-global-navigation__viewport-wrapper": "_teddy-global-navigation__viewport-wrapper_19q4u_83",
|
|
677
|
+
"teddy-global-navigation__top-menu-color": "_teddy-global-navigation__top-menu-color_19q4u_98",
|
|
678
|
+
"teddy-global-navigation__top-menu-wrapper": "_teddy-global-navigation__top-menu-wrapper_19q4u_101"
|
|
701
679
|
};
|
|
702
680
|
function MyPages(props) {
|
|
703
681
|
var _a, _b;
|
|
@@ -871,7 +849,7 @@ const Desktop = React__default.forwardRef(() => {
|
|
|
871
849
|
);
|
|
872
850
|
const topMenuSize = useSize(topMenuRef.current);
|
|
873
851
|
const topMenuHeight = (topMenuSize == null ? void 0 : topMenuSize.height) ? `${topMenuSize.height}px` : void 0;
|
|
874
|
-
const viewPortHeight = shouldShowViewport ? "
|
|
852
|
+
const viewPortHeight = shouldShowViewport ? "293px" : void 0;
|
|
875
853
|
if (!rootContext)
|
|
876
854
|
return null;
|
|
877
855
|
function resetAndShowMenu() {
|
|
@@ -881,6 +859,10 @@ const Desktop = React__default.forwardRef(() => {
|
|
|
881
859
|
}
|
|
882
860
|
const { hideMenu, selectedMenuItem, setSelectedMenuItem, linkComponent: Link2, specifiedLink, setSpecifiedLink } = rootContext;
|
|
883
861
|
const currentLocation = rootContext.pathname.endsWith("/") ? rootContext.pathname : `${rootContext.pathname}/`;
|
|
862
|
+
const handleInteractions = (linkName) => {
|
|
863
|
+
setSpecifiedLink(linkName || "");
|
|
864
|
+
setSelectedMenuItem(linkName || "", true);
|
|
865
|
+
};
|
|
884
866
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
885
867
|
/* @__PURE__ */ jsx("div", { className: styles[`${rootClassName}__top-menu-color`], children: /* @__PURE__ */ jsx(
|
|
886
868
|
"div",
|
|
@@ -910,13 +892,7 @@ const Desktop = React__default.forwardRef(() => {
|
|
|
910
892
|
(subLink) => {
|
|
911
893
|
var _a2, _b, _c;
|
|
912
894
|
return /* @__PURE__ */ jsxs(NavigationMenu.Item, { value: subLink.name, children: [
|
|
913
|
-
subLink.name === "Logo" ? /* @__PURE__ */ jsx(NavigationMenu.Link, { asChild: true, variant: "button", children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsx(Link2, { href: subLink.link, onMouseEnter: () =>
|
|
914
|
-
setSelectedMenuItem("", true);
|
|
915
|
-
setSpecifiedLink("");
|
|
916
|
-
}, onClick: () => {
|
|
917
|
-
setSelectedMenuItem("", true);
|
|
918
|
-
setSpecifiedLink("");
|
|
919
|
-
}, children: /* @__PURE__ */ jsx(
|
|
895
|
+
subLink.name === "Logo" ? /* @__PURE__ */ jsx(NavigationMenu.Link, { asChild: true, variant: "button", children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsx(Link2, { href: subLink.link, onMouseEnter: () => handleInteractions(), onClick: () => handleInteractions(), children: /* @__PURE__ */ jsx(
|
|
920
896
|
"img",
|
|
921
897
|
{
|
|
922
898
|
src: "https://cdn.voca.teliacompany.com/logo/Telia-primary-default-v2.svg",
|
|
@@ -927,14 +903,8 @@ const Desktop = React__default.forwardRef(() => {
|
|
|
927
903
|
"a",
|
|
928
904
|
{
|
|
929
905
|
href: subLink.link,
|
|
930
|
-
onMouseEnter: () =>
|
|
931
|
-
|
|
932
|
-
setSpecifiedLink("");
|
|
933
|
-
},
|
|
934
|
-
onClick: () => {
|
|
935
|
-
setSelectedMenuItem("", true);
|
|
936
|
-
setSpecifiedLink("");
|
|
937
|
-
},
|
|
906
|
+
onMouseEnter: () => handleInteractions(),
|
|
907
|
+
onClick: () => handleInteractions(),
|
|
938
908
|
children: /* @__PURE__ */ jsx(
|
|
939
909
|
"img",
|
|
940
910
|
{
|
|
@@ -949,23 +919,14 @@ const Desktop = React__default.forwardRef(() => {
|
|
|
949
919
|
{
|
|
950
920
|
asChild: true,
|
|
951
921
|
active: currentLocation === subLink.link,
|
|
952
|
-
children: /* @__PURE__ */ jsx(Button, { onMouseEnter: () =>
|
|
953
|
-
setSpecifiedLink(subLink.name);
|
|
954
|
-
setSelectedMenuItem(subLink.name, true);
|
|
955
|
-
}, children: subLink.name })
|
|
922
|
+
children: /* @__PURE__ */ jsx(Button, { onMouseEnter: () => handleInteractions(subLink.name), onClick: () => handleInteractions(subLink.name), children: subLink.name })
|
|
956
923
|
}
|
|
957
924
|
) : /* @__PURE__ */ jsx(
|
|
958
925
|
NavigationMenu.Link,
|
|
959
926
|
{
|
|
960
927
|
asChild: true,
|
|
961
928
|
active: selectedMenuItem === subLink.name && currentLocation === subLink.link,
|
|
962
|
-
children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsx(Link2, { onMouseEnter: () => {
|
|
963
|
-
setSpecifiedLink(subLink.name);
|
|
964
|
-
setSelectedMenuItem(subLink.name, true);
|
|
965
|
-
}, href: subLink.link, children: subLink.name }) : /* @__PURE__ */ jsx("a", { onMouseEnter: () => {
|
|
966
|
-
setSpecifiedLink(subLink.name);
|
|
967
|
-
setSelectedMenuItem(subLink.name, true);
|
|
968
|
-
}, href: subLink.link, children: subLink.name })
|
|
929
|
+
children: subLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsx(Link2, { onMouseEnter: () => handleInteractions(subLink.name), onClick: () => handleInteractions(subLink.name), href: subLink.link, children: subLink.name }) : /* @__PURE__ */ jsx("a", { onMouseEnter: () => handleInteractions(subLink.name), onClick: () => handleInteractions(subLink.name), href: subLink.link, children: subLink.name })
|
|
969
930
|
}
|
|
970
931
|
),
|
|
971
932
|
/* @__PURE__ */ jsx(NavigationMenu.Content, { children: !!specifiedLink && subLink.name === specifiedLink && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -1006,7 +967,7 @@ const HightlightedLinksDesktop = ({ links, listName }) => {
|
|
|
1006
967
|
const rootContext = React__default.useContext(RootContext);
|
|
1007
968
|
if (!rootContext)
|
|
1008
969
|
return null;
|
|
1009
|
-
const { linkComponent: Link2 } = rootContext;
|
|
970
|
+
const { linkComponent: Link2, setSpecifiedLink, setSelectedMenuItem } = rootContext;
|
|
1010
971
|
const currentLocation = rootContext.pathname.endsWith("/") ? rootContext.pathname : `${rootContext.pathname}/`;
|
|
1011
972
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1012
973
|
/* @__PURE__ */ jsx(Heading, { pl: "100", pb: "100", variant: "title-200", as: "h2", children: listName }),
|
|
@@ -1019,6 +980,8 @@ const HightlightedLinksDesktop = ({ links, listName }) => {
|
|
|
1019
980
|
active: getActiveSubLink(currentLocation, links || []) === subSubLink.link,
|
|
1020
981
|
onClick: () => {
|
|
1021
982
|
rootContext.setPathname(subSubLink.link);
|
|
983
|
+
setSpecifiedLink("");
|
|
984
|
+
setSelectedMenuItem("", true);
|
|
1022
985
|
},
|
|
1023
986
|
children: subSubLink.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsx(Link2, { href: subSubLink.link, children: /* @__PURE__ */ jsxs(Flex, { as: "span", gap: "100", align: "center", children: [
|
|
1024
987
|
subSubLink.name,
|
|
@@ -1057,7 +1020,6 @@ function Mobile(props) {
|
|
|
1057
1020
|
/* @__PURE__ */ jsx(Drawer.Close, { ref: drawerRef, slot: "floating", "aria-label": "Lukk" }),
|
|
1058
1021
|
!specifiedLink ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1059
1022
|
/* @__PURE__ */ jsx(Drawer.Title, { children: "Meny" }),
|
|
1060
|
-
/* @__PURE__ */ jsx(SearchField, {}),
|
|
1061
1023
|
/* @__PURE__ */ jsxs(
|
|
1062
1024
|
Tabs,
|
|
1063
1025
|
{
|
|
@@ -24,11 +24,11 @@ function _interopNamespaceDefault(e) {
|
|
|
24
24
|
}
|
|
25
25
|
const TabsPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(TabsPrimitive);
|
|
26
26
|
const styles = {
|
|
27
|
-
"teddy-tabs__list": "_teddy-
|
|
28
|
-
"teddy-tabs--full-width": "_teddy-tabs--full-
|
|
29
|
-
"teddy-tabs__content": "_teddy-
|
|
30
|
-
"teddy-tabs__trigger": "_teddy-
|
|
31
|
-
"teddy-tabs__scroll-button": "_teddy-tabs__scroll-
|
|
27
|
+
"teddy-tabs__list": "_teddy-tabs__list_e9ndq_1",
|
|
28
|
+
"teddy-tabs--full-width": "_teddy-tabs--full-width_e9ndq_28",
|
|
29
|
+
"teddy-tabs__content": "_teddy-tabs__content_e9ndq_31",
|
|
30
|
+
"teddy-tabs__trigger": "_teddy-tabs__trigger_e9ndq_35",
|
|
31
|
+
"teddy-tabs__scroll-button": "_teddy-tabs__scroll-button_e9ndq_56"
|
|
32
32
|
};
|
|
33
33
|
const rootClassName = "teddy-tabs";
|
|
34
34
|
const RootContext = React.createContext(void 0);
|
|
@@ -5,11 +5,11 @@ import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
|
5
5
|
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
6
6
|
import { composeEventHandlers } from "../../utils/composeEventHandlers.js";
|
|
7
7
|
const styles = {
|
|
8
|
-
"teddy-tabs__list": "_teddy-
|
|
9
|
-
"teddy-tabs--full-width": "_teddy-tabs--full-
|
|
10
|
-
"teddy-tabs__content": "_teddy-
|
|
11
|
-
"teddy-tabs__trigger": "_teddy-
|
|
12
|
-
"teddy-tabs__scroll-button": "_teddy-tabs__scroll-
|
|
8
|
+
"teddy-tabs__list": "_teddy-tabs__list_e9ndq_1",
|
|
9
|
+
"teddy-tabs--full-width": "_teddy-tabs--full-width_e9ndq_28",
|
|
10
|
+
"teddy-tabs__content": "_teddy-tabs__content_e9ndq_31",
|
|
11
|
+
"teddy-tabs__trigger": "_teddy-tabs__trigger_e9ndq_35",
|
|
12
|
+
"teddy-tabs__scroll-button": "_teddy-tabs__scroll-button_e9ndq_56"
|
|
13
13
|
};
|
|
14
14
|
const rootClassName = "teddy-tabs";
|
|
15
15
|
const RootContext = React__default.createContext(void 0);
|