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.
@@ -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"),r=require("react");exports.ExplanatoryFoldOut=function(a){let{title:l,description:c,sx:i={}}=a;const[n,o]=r.useState(!1);return React.createElement(e.Box,null,React.createElement(e.Divider,{textAlign:"left"},React.createElement(e.Chip,{label:l,size:"small",color:"primary",onClick:()=>o(!n),icon:n?React.createElement(t.KeyboardArrowUp,null):React.createElement(t.KeyboardArrowDown,null)})),React.createElement(e.Collapse,{in:n},React.createElement(e.Typography,{variant:"body2",color:"primary",sx:{mt:1}},c)))};
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:c}=a;return e.createElement(r,{href:i,passHref:!0,legacyBehavior:!0},e.createElement(t.Link,{target:c||"_blank",sx:{...n}},l))};
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 e,Divider as t,Chip as r,Collapse as l,Typography as a}from"@mui/material";import{KeyboardArrowUp as c,KeyboardArrowDown as m}from"@mui/icons-material";import{useState as n}from"react";function i(i){let{title:o,description:p,sx:s={}}=i;const[u,E]=n(!1);return React.createElement(e,null,React.createElement(t,{textAlign:"left"},React.createElement(r,{label:o,size:"small",color:"primary",onClick:()=>E(!u),icon:u?React.createElement(c,null):React.createElement(m,null)})),React.createElement(l,{in:u},React.createElement(a,{variant:"body2",color:"primary",sx:{mt:1}},p)))}export{i as ExplanatoryFoldOut};
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 e from"react";import r from"next/link";import{Link as t}from"@mui/material";function a(a){let{href:i,sx:m,children:n,target:o}=a;return e.createElement(r,{href:i,passHref:!0,legacyBehavior:!0},e.createElement(t,{target:o||"_blank",sx:{...m}},n))}export{a as StyledLink};
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,6 +1,6 @@
1
1
  {
2
2
  "name": "umwd-components",
3
- "version": "0.1.259",
3
+ "version": "0.1.261",
4
4
  "description": "UMWD Component library",
5
5
  "main": "dist/cjs/src/index.js",
6
6
  "module": "dist/esm/src/index.js",
@@ -1,4 +1,6 @@
1
1
  // "use client"
2
+
3
+ import React from "react";
2
4
  import {
3
5
  Typography,
4
6
  Divider,
@@ -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 { Link } from "@mui/material";
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 target={target || "_blank"} sx={{ ...sx }}>
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>