@twilio-paste/anchor
Advanced tools
Comparing version 6.0.1 to 6.0.2
# Change Log | ||
## 6.0.2 | ||
### Patch Changes | ||
- [`73c596919`](https://github.com/twilio-labs/paste/commit/73c5969191c04b4721a059c9dee329126afc1a8e) [#2269](https://github.com/twilio-labs/paste/pull/2269) Thanks [@SiTaggart](https://github.com/SiTaggart)! - Fixed a regression with the compilation script that caused incompatible ESM module importing of JSON files. | ||
## 6.0.1 | ||
@@ -4,0 +10,0 @@ |
var __defProp = Object.defineProperty; | ||
var __defProps = Object.defineProperties; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropDescs = Object.getOwnPropertyDescriptors; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getOwnPropSymbols = Object.getOwnPropertySymbols; | ||
@@ -34,44 +32,12 @@ var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
}; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __reExport = (target, module, copyDefault, desc) => { | ||
if (module && typeof module === "object" || typeof module === "function") { | ||
for (let key of __getOwnPropNames(module)) | ||
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default")) | ||
__defProp(target, key, { get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable }); | ||
} | ||
return target; | ||
}; | ||
// esm-externals:react | ||
var react_exports = {}; | ||
__export(react_exports, { | ||
default: () => default2 | ||
}); | ||
__reExport(react_exports, react_star); | ||
import * as default2 from "react"; | ||
import * as react_star from "react"; | ||
// src/index.tsx | ||
import * as React3 from "react"; | ||
import { Box as Box3, safelySpreadBoxProps } from "@twilio-paste/box"; | ||
import { LinkExternalIcon } from "@twilio-paste/icons/esm/LinkExternalIcon"; | ||
// esm-externals:@twilio-paste/box | ||
var box_exports = {}; | ||
__export(box_exports, { | ||
default: () => default3 | ||
}); | ||
__reExport(box_exports, box_star); | ||
import * as default3 from "@twilio-paste/box"; | ||
import * as box_star from "@twilio-paste/box"; | ||
// esm-externals:@twilio-paste/icons/esm/LinkExternalIcon | ||
var LinkExternalIcon_exports = {}; | ||
__export(LinkExternalIcon_exports, { | ||
default: () => default4 | ||
}); | ||
__reExport(LinkExternalIcon_exports, LinkExternalIcon_star); | ||
import * as default4 from "@twilio-paste/icons/esm/LinkExternalIcon"; | ||
import * as LinkExternalIcon_star from "@twilio-paste/icons/esm/LinkExternalIcon"; | ||
// src/DefaultAnchor.tsx | ||
var DefaultAnchor = react_exports.forwardRef((props, ref) => /* @__PURE__ */ react_exports.createElement(box_exports.Box, __spreadProps(__spreadValues({}, props), { | ||
import * as React from "react"; | ||
import { Box } from "@twilio-paste/box"; | ||
var DefaultAnchor = React.forwardRef((props, ref) => /* @__PURE__ */ React.createElement(Box, __spreadProps(__spreadValues({}, props), { | ||
as: "a", | ||
@@ -105,3 +71,5 @@ color: "colorTextLink", | ||
// src/InverseAnchor.tsx | ||
var InverseAnchor = react_exports.forwardRef((props, ref) => /* @__PURE__ */ react_exports.createElement(box_exports.Box, __spreadProps(__spreadValues({}, props), { | ||
import * as React2 from "react"; | ||
import { Box as Box2 } from "@twilio-paste/box"; | ||
var InverseAnchor = React2.forwardRef((props, ref) => /* @__PURE__ */ React2.createElement(Box2, __spreadProps(__spreadValues({}, props), { | ||
as: "a", | ||
@@ -151,3 +119,3 @@ color: "colorTextInverse", | ||
}; | ||
var Anchor = react_exports.forwardRef((_a, ref) => { | ||
var Anchor = React3.forwardRef((_a, ref) => { | ||
var _b = _a, { | ||
@@ -209,7 +177,7 @@ element = "ANCHOR", | ||
const AnchorComponent = AnchorVariants[variant]; | ||
return /* @__PURE__ */ react_exports.createElement(AnchorComponent, __spreadProps(__spreadValues(__spreadValues({ | ||
return /* @__PURE__ */ React3.createElement(AnchorComponent, __spreadProps(__spreadValues(__spreadValues({ | ||
href: props.href, | ||
ref, | ||
variant | ||
}, secureExternalLink(props.href)), (0, box_exports.safelySpreadBoxProps)(props)), { | ||
}, secureExternalLink(props.href)), safelySpreadBoxProps(props)), { | ||
element, | ||
@@ -239,5 +207,5 @@ display, | ||
verticalAlign | ||
}), showExternal ? /* @__PURE__ */ react_exports.createElement(box_exports.Box, { | ||
}), showExternal ? /* @__PURE__ */ React3.createElement(Box3, { | ||
as: "span" | ||
}, props.children, /* @__PURE__ */ react_exports.createElement(box_exports.Box, { | ||
}, props.children, /* @__PURE__ */ React3.createElement(Box3, { | ||
as: "span", | ||
@@ -247,3 +215,3 @@ display: "inline-block", | ||
verticalAlign: "middle" | ||
}, /* @__PURE__ */ react_exports.createElement(LinkExternalIcon_exports.LinkExternalIcon, { | ||
}, /* @__PURE__ */ React3.createElement(LinkExternalIcon, { | ||
decorative: false, | ||
@@ -250,0 +218,0 @@ title: "link takes you to an external page" |
@@ -1,1 +0,1 @@ | ||
var f=Object.defineProperty,j=Object.defineProperties,q=Object.getOwnPropertyDescriptor,J=Object.getOwnPropertyDescriptors,K=Object.getOwnPropertyNames,m=Object.getOwnPropertySymbols;var d=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var u=(o,e,n)=>e in o?f(o,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[e]=n,p=(o,e)=>{for(var n in e||(e={}))d.call(e,n)&&u(o,n,e[n]);if(m)for(var n of m(e))E.call(e,n)&&u(o,n,e[n]);return o},s=(o,e)=>j(o,J(e));var y=(o,e)=>{var n={};for(var i in o)d.call(o,i)&&e.indexOf(i)<0&&(n[i]=o[i]);if(o!=null&&m)for(var i of m(o))e.indexOf(i)<0&&E.call(o,i)&&(n[i]=o[i]);return n};var x=(o,e)=>{for(var n in e)f(o,n,{get:e[n],enumerable:!0})},a=(o,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of K(e))!d.call(o,c)&&(n||c!=="default")&&f(o,c,{get:()=>e[c],enumerable:!(i=q(e,c))||i.enumerable});return o};var r={};x(r,{default:()=>v});a(r,co);import*as v from"react";import*as co from"react";var t={};x(t,{default:()=>L});a(t,po);import*as L from"@twilio-paste/box";import*as po from"@twilio-paste/box";var l={};x(l,{default:()=>R});a(l,lo);import*as R from"@twilio-paste/icons/esm/LinkExternalIcon";import*as lo from"@twilio-paste/icons/esm/LinkExternalIcon";var A=r.forwardRef((o,e)=>r.createElement(t.Box,s(p({},o),{as:"a",color:"colorTextLink",fontSize:"inherit",fontWeight:"inherit",lineHeight:"inherit",outline:"none",ref:e,textDecoration:"underline",_active:{color:"colorTextLinkStronger",textDecoration:"none"},_focus:{boxShadow:"shadowFocus",color:"colorTextLinkStronger",textDecoration:"none"},_hover:{color:"colorTextLinkStronger",textDecoration:"none"}}),o.children));A.displayName="DefaultAnchor";var T=r.forwardRef((o,e)=>r.createElement(t.Box,s(p({},o),{as:"a",color:"colorTextInverse",fontSize:"inherit",fontWeight:"inherit",lineHeight:"inherit",outline:"none",ref:e,textDecoration:"underline",_active:{color:"colorTextInverse",textDecoration:"none"},_focus:{boxShadow:"shadowFocusInverse",color:"colorTextInverse",textDecoration:"none"},_hover:{color:"colorTextInverse",textDecoration:"none"}}),o.children));T.displayName="InverseAnchor";var Q={inverse:T,default:A},Z=/^(https?:)\S*$/,oo="_blank",eo="noreferrer noopener",ro=o=>Z.test(o),no=o=>{if(!!ro(o))return{rel:eo,target:oo}},to=r.forwardRef((io,Y)=>{var g=io,{element:o="ANCHOR",variant:e="default",showExternal:n,display:i,height:c,minHeight:_,maxHeight:D,width:N,minWidth:P,maxWidth:k,size:B,margin:I,marginBottom:S,marginLeft:w,marginRight:H,marginTop:X,marginX:F=null,marginY:U=null,padding:b,paddingBottom:O,paddingLeft:V,paddingRight:W,paddingTop:z,paddingX:C=null,paddingY:G=null,verticalAlign:M}=g,h=y(g,["element","variant","showExternal","display","height","minHeight","maxHeight","width","minWidth","maxWidth","size","margin","marginBottom","marginLeft","marginRight","marginTop","marginX","marginY","padding","paddingBottom","paddingLeft","paddingRight","paddingTop","paddingX","paddingY","verticalAlign"]);let $=Q[e];return r.createElement($,s(p(p({href:h.href,ref:Y,variant:e},no(h.href)),(0,t.safelySpreadBoxProps)(h)),{element:o,display:i,height:c,minHeight:_,maxHeight:D,width:N,minWidth:P,maxWidth:k,size:B,margin:I,marginBottom:S,marginLeft:w,marginRight:H,marginTop:X,marginX:F,marginY:U,padding:b,paddingBottom:O,paddingLeft:V,paddingRight:W,paddingTop:z,paddingX:C,paddingY:G,verticalAlign:M}),n?r.createElement(t.Box,{as:"span"},h.children,r.createElement(t.Box,{as:"span",display:"inline-block",flexShrink:0,verticalAlign:"middle"},r.createElement(l.LinkExternalIcon,{decorative:!1,title:"link takes you to an external page"}))):h.children)});to.displayName="Anchor";export{to as Anchor,ro as isExternalUrl,no as secureExternalLink}; | ||
var C=Object.defineProperty,G=Object.defineProperties;var M=Object.getOwnPropertyDescriptors;var l=Object.getOwnPropertySymbols;var d=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var x=(o,e,r)=>e in o?C(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,t=(o,e)=>{for(var r in e||(e={}))d.call(e,r)&&x(o,r,e[r]);if(l)for(var r of l(e))A.call(e,r)&&x(o,r,e[r]);return o},c=(o,e)=>G(o,M(e));var T=(o,e)=>{var r={};for(var n in o)d.call(o,n)&&e.indexOf(n)<0&&(r[n]=o[n]);if(o!=null&&l)for(var n of l(o))e.indexOf(n)<0&&A.call(o,n)&&(r[n]=o[n]);return r};import*as i from"react";import{Box as g,safelySpreadBoxProps as j}from"@twilio-paste/box";import{LinkExternalIcon as q}from"@twilio-paste/icons/esm/LinkExternalIcon";import*as p from"react";import{Box as Y}from"@twilio-paste/box";var h=p.forwardRef((o,e)=>p.createElement(Y,c(t({},o),{as:"a",color:"colorTextLink",fontSize:"inherit",fontWeight:"inherit",lineHeight:"inherit",outline:"none",ref:e,textDecoration:"underline",_active:{color:"colorTextLinkStronger",textDecoration:"none"},_focus:{boxShadow:"shadowFocus",color:"colorTextLinkStronger",textDecoration:"none"},_hover:{color:"colorTextLinkStronger",textDecoration:"none"}}),o.children));h.displayName="DefaultAnchor";import*as s from"react";import{Box as $}from"@twilio-paste/box";var m=s.forwardRef((o,e)=>s.createElement($,c(t({},o),{as:"a",color:"colorTextInverse",fontSize:"inherit",fontWeight:"inherit",lineHeight:"inherit",outline:"none",ref:e,textDecoration:"underline",_active:{color:"colorTextInverse",textDecoration:"none"},_focus:{boxShadow:"shadowFocusInverse",color:"colorTextInverse",textDecoration:"none"},_hover:{color:"colorTextInverse",textDecoration:"none"}}),o.children));m.displayName="InverseAnchor";var J={inverse:m,default:h},K=/^(https?:)\S*$/,Q="_blank",Z="noreferrer noopener",oo=o=>K.test(o),eo=o=>{if(!!oo(o))return{rel:Z,target:Q}},ro=i.forwardRef((no,W)=>{var f=no,{element:o="ANCHOR",variant:e="default",showExternal:r,display:n,height:E,minHeight:u,maxHeight:y,width:v,minWidth:L,maxWidth:R,size:_,margin:D,marginBottom:N,marginLeft:P,marginRight:k,marginTop:B,marginX:I=null,marginY:S=null,padding:w,paddingBottom:H,paddingLeft:X,paddingRight:F,paddingTop:U,paddingX:b=null,paddingY:O=null,verticalAlign:V}=f,a=T(f,["element","variant","showExternal","display","height","minHeight","maxHeight","width","minWidth","maxWidth","size","margin","marginBottom","marginLeft","marginRight","marginTop","marginX","marginY","padding","paddingBottom","paddingLeft","paddingRight","paddingTop","paddingX","paddingY","verticalAlign"]);let z=J[e];return i.createElement(z,c(t(t({href:a.href,ref:W,variant:e},eo(a.href)),j(a)),{element:o,display:n,height:E,minHeight:u,maxHeight:y,width:v,minWidth:L,maxWidth:R,size:_,margin:D,marginBottom:N,marginLeft:P,marginRight:k,marginTop:B,marginX:I,marginY:S,padding:w,paddingBottom:H,paddingLeft:X,paddingRight:F,paddingTop:U,paddingX:b,paddingY:O,verticalAlign:V}),r?i.createElement(g,{as:"span"},a.children,i.createElement(g,{as:"span",display:"inline-block",flexShrink:0,verticalAlign:"middle"},i.createElement(q,{decorative:!1,title:"link takes you to an external page"}))):a.children)});ro.displayName="Anchor";export{ro as Anchor,oo as isExternalUrl,eo as secureExternalLink}; |
{ | ||
"name": "@twilio-paste/anchor", | ||
"version": "6.0.1", | ||
"version": "6.0.2", | ||
"category": "interaction", | ||
@@ -41,10 +41,10 @@ "status": "production", | ||
"devDependencies": { | ||
"@twilio-paste/box": "^5.0.1", | ||
"@twilio-paste/design-tokens": "^7.1.0", | ||
"@twilio-paste/icons": "^6.2.0", | ||
"@twilio-paste/style-props": "^4.0.1", | ||
"@twilio-paste/styling-library": "^0.3.6", | ||
"@twilio-paste/theme": "^6.0.1", | ||
"@twilio-paste/types": "^3.1.4", | ||
"@twilio-paste/uid-library": "^0.2.3", | ||
"@twilio-paste/box": "^5.0.2", | ||
"@twilio-paste/design-tokens": "^7.1.1", | ||
"@twilio-paste/icons": "^6.2.1", | ||
"@twilio-paste/style-props": "^4.0.2", | ||
"@twilio-paste/styling-library": "^0.3.7", | ||
"@twilio-paste/theme": "^6.0.2", | ||
"@twilio-paste/types": "^3.1.5", | ||
"@twilio-paste/uid-library": "^0.2.4", | ||
"prop-types": "^15.7.2", | ||
@@ -51,0 +51,0 @@ "react": "^17.0.2", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
481513
10942
602