umwd-components 0.1.259 → 0.1.261
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/cjs/src/components/ExplanatoryFoldOut.js +1 -1
- package/dist/cjs/src/components/StyledLink.js +1 -1
- package/dist/esm/src/components/ExplanatoryFoldOut.js +1 -1
- package/dist/esm/src/components/StyledLink.js +1 -1
- package/package.json +1 -1
- package/src/components/ExplanatoryFoldOut.tsx +2 -0
- package/src/components/StyledLink.tsx +17 -10
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
"use strict";var e=require("@mui/material"),t=require("@mui/icons-material")
|
|
6
|
+
"use strict";var e=require("react"),r=require("@mui/material"),t=require("@mui/icons-material");exports.ExplanatoryFoldOut=function(l){let{title:a,description:i,sx:n={}}=l;const[o,c]=e.useState(!1);return e.createElement(r.Box,null,e.createElement(r.Divider,{textAlign:"left"},e.createElement(r.Chip,{label:a,size:"small",color:"primary",onClick:()=>c(!o),icon:o?e.createElement(t.KeyboardArrowUp,null):e.createElement(t.KeyboardArrowDown,null)})),e.createElement(r.Collapse,{in:o},e.createElement(r.Typography,{variant:"body2",color:"primary",sx:{mt:1}},i)))};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
"use strict";var e=require("react"),r=require("next/link"),t=require("@mui/material");exports.StyledLink=function(a){let{href:i,sx:n,children:l,target:
|
|
6
|
+
"use strict";var e=require("react"),r=require("next/link"),t=require("@mui/material/Link");exports.StyledLink=function(a){let{href:i,sx:n=[],children:l,target:s}=a;return e.createElement(r,{href:i,passHref:!0,legacyBehavior:!0},e.createElement(t,{target:s||"_blank",sx:[...Array.isArray(n)?n:[n]]},l))};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
import{Box as
|
|
6
|
+
import e,{useState as t}from"react";import{Box as r,Divider as l,Chip as m,Collapse as n,Typography as i}from"@mui/material";import{KeyboardArrowUp as a,KeyboardArrowDown as o}from"@mui/icons-material";function c(c){let{title:p,description:s,sx:u={}}=c;const[E,f]=t(!1);return e.createElement(r,null,e.createElement(l,{textAlign:"left"},e.createElement(m,{label:p,size:"small",color:"primary",onClick:()=>f(!E),icon:E?e.createElement(a,null):e.createElement(o,null)})),e.createElement(n,{in:E},e.createElement(i,{variant:"body2",color:"primary",sx:{mt:1}},s)))}export{c as ExplanatoryFoldOut};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
6
|
+
import r from"react";import e from"next/link";import t from"@mui/material/Link";function a(a){let{href:i,sx:m=[],children:n,target:o}=a;return r.createElement(e,{href:i,passHref:!0,legacyBehavior:!0},r.createElement(t,{target:o||"_blank",sx:[...Array.isArray(m)?m:[m]]},n))}export{a as StyledLink};
|
package/package.json
CHANGED
|
@@ -1,23 +1,30 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
// import NextLink from "next/link";
|
|
3
2
|
import NextLink from "next/link";
|
|
4
|
-
import
|
|
3
|
+
import Link from "@mui/material/Link";
|
|
5
4
|
import { SxProps, Theme } from "@mui/material/styles";
|
|
6
5
|
|
|
6
|
+
interface StyledLinkProps {
|
|
7
|
+
href: string;
|
|
8
|
+
sx?: SxProps<Theme>;
|
|
9
|
+
children: React.ReactNode | string;
|
|
10
|
+
target?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
7
13
|
export function StyledLink({
|
|
8
14
|
href,
|
|
9
|
-
sx,
|
|
15
|
+
sx = [],
|
|
10
16
|
children,
|
|
11
17
|
target,
|
|
12
|
-
}: {
|
|
13
|
-
readonly href: string;
|
|
14
|
-
readonly sx?: SxProps<Theme>;
|
|
15
|
-
readonly children: React.ReactNode | string;
|
|
16
|
-
readonly target?: string;
|
|
17
|
-
}) {
|
|
18
|
+
}: StyledLinkProps) {
|
|
18
19
|
return (
|
|
19
20
|
<NextLink href={href} passHref legacyBehavior>
|
|
20
|
-
<Link
|
|
21
|
+
<Link
|
|
22
|
+
target={target || "_blank"}
|
|
23
|
+
sx={[
|
|
24
|
+
// You cannot spread `sx` directly because `SxProps` (typeof sx) can be an array.
|
|
25
|
+
...(Array.isArray(sx) ? sx : [sx]),
|
|
26
|
+
]}
|
|
27
|
+
>
|
|
21
28
|
{children}
|
|
22
29
|
</Link>
|
|
23
30
|
</NextLink>
|