@telia/teddy 0.0.56 → 0.0.58
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/breadcrumbs/breadcrumbs-link.cjs +1 -1
- package/dist/components/breadcrumbs/breadcrumbs-link.d.ts +8 -3
- package/dist/components/breadcrumbs/breadcrumbs-link.js +1 -1
- package/dist/components/breadcrumbs/index.d.ts +6 -1
- package/dist/components/navigation-menu/global-navigation/global-navigation-my-pages.cjs +3 -3
- package/dist/components/navigation-menu/global-navigation/global-navigation-my-pages.js +3 -3
- package/dist/components/tabs/tabs-trigger.cjs +4 -4
- package/dist/components/tabs/tabs-trigger.js +5 -5
- package/package.json +1 -1
|
@@ -18,7 +18,7 @@ const Link = React.forwardRef(({ children, home, className, ...props }, ref) =>
|
|
|
18
18
|
},
|
|
19
19
|
className
|
|
20
20
|
);
|
|
21
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(components_link_link.Link, { variant: negative ? "standalone-negative" : "standalone",
|
|
21
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(components_link_link.Link, { ...props, variant: negative ? "standalone-negative" : "standalone", ref, className: classes, children: [
|
|
22
22
|
home && /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "home" }),
|
|
23
23
|
/* @__PURE__ */ jsxRuntime.jsx(reactSlot.Slottable, { children })
|
|
24
24
|
] });
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { Link as LinkPrimitive } from '../link';
|
|
2
3
|
|
|
3
|
-
export type LinkProps = React.ComponentPropsWithoutRef<'
|
|
4
|
-
asChild?: boolean;
|
|
4
|
+
export type LinkProps = Omit<React.ComponentPropsWithoutRef<typeof LinkPrimitive>, 'variant'> & {
|
|
5
5
|
home?: boolean;
|
|
6
6
|
};
|
|
7
|
-
export declare const Link: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
|
|
7
|
+
export declare const Link: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
|
|
8
8
|
asChild?: boolean | undefined;
|
|
9
|
+
disableVisited?: boolean | undefined;
|
|
10
|
+
ensureTargetArea?: boolean | undefined;
|
|
11
|
+
silent?: boolean | undefined;
|
|
12
|
+
variant: "text" | "navigation" | "text-negative" | "standalone" | "standalone-negative" | "navigation-negative";
|
|
13
|
+
} & React.RefAttributes<HTMLAnchorElement>, "ref">, "variant"> & {
|
|
9
14
|
home?: boolean | undefined;
|
|
10
15
|
} & React.RefAttributes<HTMLAnchorElement>>;
|
|
@@ -16,7 +16,7 @@ const Link = React__default.forwardRef(({ children, home, className, ...props },
|
|
|
16
16
|
},
|
|
17
17
|
className
|
|
18
18
|
);
|
|
19
|
-
return /* @__PURE__ */ jsxs(Link$1, { variant: negative ? "standalone-negative" : "standalone",
|
|
19
|
+
return /* @__PURE__ */ jsxs(Link$1, { ...props, variant: negative ? "standalone-negative" : "standalone", ref, className: classes, children: [
|
|
20
20
|
home && /* @__PURE__ */ jsx(Icon, { name: "home" }),
|
|
21
21
|
/* @__PURE__ */ jsx(Slottable, { children })
|
|
22
22
|
] });
|
|
@@ -10,8 +10,13 @@ export declare const Breadcrumbs: import('react').ForwardRefExoticComponent<Omit
|
|
|
10
10
|
} & import('react').RefAttributes<HTMLElement>> & {
|
|
11
11
|
List: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "ref"> & import('react').RefAttributes<HTMLOListElement>>;
|
|
12
12
|
Item: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & import('react').RefAttributes<HTMLLIElement>>;
|
|
13
|
-
Link: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
|
|
13
|
+
Link: import('react').ForwardRefExoticComponent<Omit<Omit<Omit<import('react').DetailedHTMLProps<import('react').AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
|
|
14
14
|
asChild?: boolean | undefined;
|
|
15
|
+
disableVisited?: boolean | undefined;
|
|
16
|
+
ensureTargetArea?: boolean | undefined;
|
|
17
|
+
silent?: boolean | undefined;
|
|
18
|
+
variant: "text" | "navigation" | "text-negative" | "standalone" | "standalone-negative" | "navigation-negative";
|
|
19
|
+
} & import('react').RefAttributes<HTMLAnchorElement>, "ref">, "variant"> & {
|
|
15
20
|
home?: boolean | undefined;
|
|
16
21
|
} & import('react').RefAttributes<HTMLAnchorElement>>;
|
|
17
22
|
Page: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & import('react').RefAttributes<HTMLSpanElement>>;
|
|
@@ -95,11 +95,11 @@ function LoggedInContent() {
|
|
|
95
95
|
] }),
|
|
96
96
|
/* @__PURE__ */ jsxRuntime.jsxs(components_textSpacing_textSpacing.TextSpacing, { children: [
|
|
97
97
|
/* @__PURE__ */ jsxRuntime.jsxs(components_tabs_index.Tabs.Content, { value: "private", children: [
|
|
98
|
-
/* @__PURE__ */ jsxRuntime.jsx(components_heading_heading.Heading, { variant: "title-100", as: "h3", mb: "100", mt: "400", children: "
|
|
98
|
+
/* @__PURE__ */ jsxRuntime.jsx(components_heading_heading.Heading, { variant: "title-100", as: "h3", mb: "100", mt: "400", children: "Min Side" }),
|
|
99
99
|
(_a = components_navigationMenu_globalNavigation_utils.MY_PAGE_LINKS.links) == null ? void 0 : _a.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))
|
|
100
100
|
] }),
|
|
101
101
|
/* @__PURE__ */ jsxRuntime.jsxs(components_tabs_index.Tabs.Content, { value: "business", children: [
|
|
102
|
-
/* @__PURE__ */ jsxRuntime.jsx(components_heading_heading.Heading, { variant: "title-100", as: "h3", mb: "100", mt: "400", children: "
|
|
102
|
+
/* @__PURE__ */ jsxRuntime.jsx(components_heading_heading.Heading, { variant: "title-100", as: "h3", mb: "100", mt: "400", children: "Bedriftsportaler" }),
|
|
103
103
|
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))
|
|
104
104
|
] }),
|
|
105
105
|
/* @__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" }) })
|
|
@@ -413,7 +413,7 @@ function Mobile(props) {
|
|
|
413
413
|
value: rootContext.selectedDomainItem,
|
|
414
414
|
onValueChange: (v) => rootContext.setSelectedDomainItem(v, true),
|
|
415
415
|
children: [
|
|
416
|
-
/* @__PURE__ */ jsxRuntime.jsx(components_tabs_index.Tabs.List, { children: components_navigationMenu_globalNavigation_utils.LINKS.map((link) => /* @__PURE__ */ jsxRuntime.jsx(components_tabs_index.Tabs.Trigger, { value: link.name, children: link.name }, link.name)) }),
|
|
416
|
+
/* @__PURE__ */ jsxRuntime.jsx(components_tabs_index.Tabs.List, { children: components_navigationMenu_globalNavigation_utils.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)) }),
|
|
417
417
|
/* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { mt: "400", children: components_navigationMenu_globalNavigation_utils.LINKS.map((link) => {
|
|
418
418
|
var _a;
|
|
419
419
|
return /* @__PURE__ */ jsxRuntime.jsx(components_tabs_index.Tabs.Content, { value: link.name, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -93,11 +93,11 @@ function LoggedInContent() {
|
|
|
93
93
|
] }),
|
|
94
94
|
/* @__PURE__ */ jsxs(TextSpacing, { children: [
|
|
95
95
|
/* @__PURE__ */ jsxs(Tabs.Content, { value: "private", children: [
|
|
96
|
-
/* @__PURE__ */ jsx(Heading, { variant: "title-100", as: "h3", mb: "100", mt: "400", children: "
|
|
96
|
+
/* @__PURE__ */ jsx(Heading, { variant: "title-100", as: "h3", mb: "100", mt: "400", children: "Min Side" }),
|
|
97
97
|
(_a = MY_PAGE_LINKS.links) == null ? void 0 : _a.map((link) => /* @__PURE__ */ jsx(Button, { variant: "list-item", fullWidth: true, asChild: true, children: /* @__PURE__ */ jsx("a", { href: link.link, children: /* @__PURE__ */ jsx(Icon, { name: link.icon, children: link.name }) }) }, link.link))
|
|
98
98
|
] }),
|
|
99
99
|
/* @__PURE__ */ jsxs(Tabs.Content, { value: "business", children: [
|
|
100
|
-
/* @__PURE__ */ jsx(Heading, { variant: "title-100", as: "h3", mb: "100", mt: "400", children: "
|
|
100
|
+
/* @__PURE__ */ jsx(Heading, { variant: "title-100", as: "h3", mb: "100", mt: "400", children: "Bedriftsportaler" }),
|
|
101
101
|
LOGGED_IN_LINKS_BUSINESS.map((link) => /* @__PURE__ */ jsx(Button, { variant: "list-item", fullWidth: true, asChild: true, children: /* @__PURE__ */ jsx("a", { href: link.link, children: /* @__PURE__ */ jsx(Icon, { name: link.icon, children: link.name }) }) }, link.link))
|
|
102
102
|
] }),
|
|
103
103
|
/* @__PURE__ */ jsx(Button, { mt: "200", onClick: () => rootContext == null ? void 0 : rootContext.onLogoutClick(), variant: "secondary", children: /* @__PURE__ */ jsx(Icon, { name: "logout", children: "Logg ut" }) })
|
|
@@ -411,7 +411,7 @@ function Mobile(props) {
|
|
|
411
411
|
value: rootContext.selectedDomainItem,
|
|
412
412
|
onValueChange: (v) => rootContext.setSelectedDomainItem(v, true),
|
|
413
413
|
children: [
|
|
414
|
-
/* @__PURE__ */ jsx(Tabs.List, { children: LINKS.map((link) => /* @__PURE__ */ jsx(Tabs.Trigger, { value: link.name, children: link.name }, link.name)) }),
|
|
414
|
+
/* @__PURE__ */ jsx(Tabs.List, { children: LINKS.map((link) => /* @__PURE__ */ jsx(Tabs.Trigger, { asChild: true, value: link.name, children: link.appKey === rootContext.appKey || rootContext.appKey === "storybook" ? /* @__PURE__ */ jsx(NavLink, { href: link.link, children: link.name }) : /* @__PURE__ */ jsx("a", { href: link.link, children: link.name }) }, link.name)) }),
|
|
415
415
|
/* @__PURE__ */ jsx(Box, { mt: "400", children: LINKS.map((link) => {
|
|
416
416
|
var _a;
|
|
417
417
|
return /* @__PURE__ */ jsx(Tabs.Content, { value: link.name, children: /* @__PURE__ */ jsx(
|
|
@@ -26,15 +26,15 @@ function _interopNamespaceDefault(e) {
|
|
|
26
26
|
}
|
|
27
27
|
const TabsPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(TabsPrimitive);
|
|
28
28
|
const Trigger = React.forwardRef(
|
|
29
|
-
({ className, ...props }, forwardRef) => {
|
|
29
|
+
({ className, asChild, children, ...props }, forwardRef) => {
|
|
30
30
|
const classes = clsx([components_tabs_tabsRoot.styles[`${components_tabs_tabsRoot.rootClassName}__trigger`]], className);
|
|
31
31
|
const innerElementRef = React.useRef(null);
|
|
32
|
+
const ref = utils_composeRefs.useComposedRefs(forwardRef, innerElementRef);
|
|
32
33
|
const context = React.useContext(components_tabs_tabsRoot.RootContext);
|
|
33
34
|
const isFirstRender = React.useRef(true);
|
|
34
35
|
React.useEffect(() => {
|
|
35
36
|
if ((context == null ? void 0 : context.value) === props.value && innerElementRef.current) {
|
|
36
37
|
const newTab = innerElementRef.current;
|
|
37
|
-
context == null ? void 0 : context.setActiveElement(newTab);
|
|
38
38
|
const tabsContainer = context == null ? void 0 : context.listElement.current;
|
|
39
39
|
if (!newTab || !tabsContainer)
|
|
40
40
|
return;
|
|
@@ -47,9 +47,9 @@ const Trigger = React.forwardRef(
|
|
|
47
47
|
}
|
|
48
48
|
}, [context, props.value]);
|
|
49
49
|
if (context == null ? void 0 : context.snapCenter) {
|
|
50
|
-
return /* @__PURE__ */ jsxRuntime.jsx(components_scrollArea_index.ScrollArea.Item, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
50
|
+
return /* @__PURE__ */ jsxRuntime.jsx(components_scrollArea_index.ScrollArea.Item, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(TabsPrimitive__namespace.Trigger, { ...props, asChild: true, ref, className: classes, children: /* @__PURE__ */ jsxRuntime.jsx(components_button_button.Button, { variant: "primary", asChild, children }) }) });
|
|
51
51
|
}
|
|
52
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
52
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TabsPrimitive__namespace.Trigger, { ...props, asChild: true, ref, className: classes, children: /* @__PURE__ */ jsxRuntime.jsx(components_button_button.Button, { variant: "primary", asChild, children }) });
|
|
53
53
|
}
|
|
54
54
|
);
|
|
55
55
|
Trigger.displayName = "Trigger";
|
|
@@ -5,17 +5,17 @@ import clsx from "clsx";
|
|
|
5
5
|
import { s as styles, rootClassName, RootContext } from "./tabs-root.js";
|
|
6
6
|
import { ScrollArea } from "../scroll-area/index.js";
|
|
7
7
|
import { Button } from "../button/button.js";
|
|
8
|
-
import {
|
|
8
|
+
import { useComposedRefs } from "../../utils/composeRefs.js";
|
|
9
9
|
const Trigger = React__default.forwardRef(
|
|
10
|
-
({ className, ...props }, forwardRef) => {
|
|
10
|
+
({ className, asChild, children, ...props }, forwardRef) => {
|
|
11
11
|
const classes = clsx([styles[`${rootClassName}__trigger`]], className);
|
|
12
12
|
const innerElementRef = React__default.useRef(null);
|
|
13
|
+
const ref = useComposedRefs(forwardRef, innerElementRef);
|
|
13
14
|
const context = React__default.useContext(RootContext);
|
|
14
15
|
const isFirstRender = React__default.useRef(true);
|
|
15
16
|
React__default.useEffect(() => {
|
|
16
17
|
if ((context == null ? void 0 : context.value) === props.value && innerElementRef.current) {
|
|
17
18
|
const newTab = innerElementRef.current;
|
|
18
|
-
context == null ? void 0 : context.setActiveElement(newTab);
|
|
19
19
|
const tabsContainer = context == null ? void 0 : context.listElement.current;
|
|
20
20
|
if (!newTab || !tabsContainer)
|
|
21
21
|
return;
|
|
@@ -28,9 +28,9 @@ const Trigger = React__default.forwardRef(
|
|
|
28
28
|
}
|
|
29
29
|
}, [context, props.value]);
|
|
30
30
|
if (context == null ? void 0 : context.snapCenter) {
|
|
31
|
-
return /* @__PURE__ */ jsx(ScrollArea.Item, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
31
|
+
return /* @__PURE__ */ jsx(ScrollArea.Item, { asChild: true, children: /* @__PURE__ */ jsx(TabsPrimitive.Trigger, { ...props, asChild: true, ref, className: classes, children: /* @__PURE__ */ jsx(Button, { variant: "primary", asChild, children }) }) });
|
|
32
32
|
}
|
|
33
|
-
return /* @__PURE__ */ jsx(
|
|
33
|
+
return /* @__PURE__ */ jsx(TabsPrimitive.Trigger, { ...props, asChild: true, ref, className: classes, children: /* @__PURE__ */ jsx(Button, { variant: "primary", asChild, children }) });
|
|
34
34
|
}
|
|
35
35
|
);
|
|
36
36
|
Trigger.displayName = "Trigger";
|