@sps-woodland/content-tiles
Advanced tools
Comparing version 7.4.5 to 7.4.6
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("@sps-woodland/core"),k=require("react"),y=require("@sps-woodland/tokens"),m=require("@spscommerce/utils");function S(e){if(e&&e.__esModule)return e;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const o=S(k);var N="_85dplj0",h="_85dplj1";function _(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function w(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,n)}return t}function v(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?w(Object(t),!0).forEach(function(n){_(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):w(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var O=(e,r,t)=>{for(var n of Object.keys(e)){var a;if(e[n]!==((a=r[n])!==null&&a!==void 0?a:t[n]))return!1}return!0},u=e=>r=>{var t=e.defaultClassName,n=v(v({},e.defaultVariants),r);for(var a in n){var p,c=(p=n[a])!==null&&p!==void 0?p:e.defaultVariants[a];if(c!=null){var l=c;typeof l=="boolean"&&(l=l===!0?"true":"false");var i=e.variantClassNames[a][l];i&&(t+=" "+i)}}for(var[d,f]of e.compoundVariants)O(d,n,e.defaultVariants)&&(t+=" "+f);return t},E=u({defaultClassName:"_1k4ncnf4",variantClassNames:{error:{true:"_1k4ncnf5"},warning:{true:"_1k4ncnf6"},disabled:{true:"_1k4ncnf7"}},defaultVariants:{error:!1,warning:!1,disabled:!1},compoundVariants:[]}),D="_1k4ncnf0",L=u({defaultClassName:"_1k4ncnf1",variantClassNames:{disabled:{true:"_1k4ncnf2"}},defaultVariants:{disabled:!1},compoundVariants:[]}),R="_1k4ncnf3",C=u({defaultClassName:"",variantClassNames:{error:{true:"_1k4ncnf8"},warning:{true:"_1k4ncnf9"},disabled:{true:"_1k4ncnfa"}},defaultVariants:{error:!1,disabled:!1,warning:!1},compoundVariants:[]}),j="_1k4ncnfb",x="_1k4ncnfc",I="_1k4ncnfe",A="_1k4ncnfd";function g({className:e,href:r,icon:t,error:n=!1,errorIcon:a,title:p,warning:c=!1,warningIcon:l,disabled:i=!1,target:d,onClick:f,...T}){return o.createElement("div",{className:s.cl(y.grid[3],D,e),...T},o.createElement("a",{href:i?void 0:r,className:s.cl(E({error:n,warning:c,disabled:i}),h),target:d,onClick:f},(c||n)&&o.createElement("div",{className:j},c&&(l?s.contentOf(l):o.createElement(s.Icon,{icon:"status-warning",className:s.cl(C({warning:c,disabled:i}))})),n&&(a?s.contentOf(a):o.createElement(s.Icon,{icon:"ban",className:s.cl(C({error:n,disabled:i}))}))),o.createElement("div",null,o.createElement("div",{className:s.cl(R)},typeof t=="string"?o.createElement("img",{className:s.cl(L({disabled:i})),src:t,alt:""}):s.contentOf(t)),o.createElement("div",{className:s.cl(x)},o.createElement("p",{className:s.cl(A)},p,d==="_blank"&&o.createElement(s.Icon,{icon:"tabs",className:s.cl(I)}))))))}s.Metadata.set(g,{name:"Content Tile",props:{href:{type:"string"},icon:{type:"React.ReactNode | (() => React.ReactNode)",required:!0},error:{type:"boolean",default:"false"},errorIcon:{type:"React.ReactNode | (() => React.ReactNode)"},title:{type:"string",required:!0},warning:{type:"boolean",default:"false"},warningIcon:{type:"React.ReactNode | (() => React.ReactNode)"},disabled:{type:"boolean",default:"false"},target:{type:"string"},onClick:{type:"() => void"}}});function b({children:e,className:r,...t}){return o.createElement("div",{className:s.cl(N,r),...t},e)}s.Metadata.set(b,{name:"Content Tile List"});const P={components:[g,b],examples:{basic:{label:"Basic",examples:{basic:{react:m.code` | ||
import { ContentTileList, ContentTile } from "@sps-woodland/content-tiles"; | ||
import { ContentTileList, ContentTile } from "@sps-woodland/content-tiles"; | ||
@@ -71,3 +71,3 @@ function Component() { | ||
`}}},singleTile:{label:"Single Tile",examples:{basic:{react:m.code` | ||
import { ContentTileList, ContentTile } from "@sps-woodland/content-tiles"; | ||
import { ContentTileList, ContentTile } from "@sps-woodland/content-tiles"; | ||
function Component() { | ||
@@ -87,3 +87,3 @@ return ( | ||
`},error:{react:m.code` | ||
import { ContentTileList, ContentTile } from "@sps-woodland/content-tiles"; | ||
import { ContentTileList, ContentTile } from "@sps-woodland/content-tiles"; | ||
@@ -108,3 +108,3 @@ function Component() { | ||
`}}},sortableTiles:{label:"Sortable Tiles",examples:{basic:{react:m.code` | ||
import { ContentTileList, ContentTile } from "@sps-woodland/content-tiles"; | ||
import { ContentTileList, ContentTile } from "@sps-woodland/content-tiles"; | ||
import { SortingHeader, SortingHeaderCell } from "@sps-woodland/sorting-header"; | ||
@@ -111,0 +111,0 @@ import { grid } from "@sps-woodland/tokens"; |
@@ -136,3 +136,3 @@ import { Metadata as T, cl as o, contentOf as u, Icon as g } from "@sps-woodland/core"; | ||
react: d` | ||
import { ContentTileList, ContentTile } from "@sps-woodland/content-tiles"; | ||
import { ContentTileList, ContentTile } from "@sps-woodland/content-tiles"; | ||
@@ -214,3 +214,3 @@ function Component() { | ||
react: d` | ||
import { ContentTileList, ContentTile } from "@sps-woodland/content-tiles"; | ||
import { ContentTileList, ContentTile } from "@sps-woodland/content-tiles"; | ||
function Component() { | ||
@@ -233,3 +233,3 @@ return ( | ||
react: d` | ||
import { ContentTileList, ContentTile } from "@sps-woodland/content-tiles"; | ||
import { ContentTileList, ContentTile } from "@sps-woodland/content-tiles"; | ||
@@ -262,3 +262,3 @@ function Component() { | ||
react: d` | ||
import { ContentTileList, ContentTile } from "@sps-woodland/content-tiles"; | ||
import { ContentTileList, ContentTile } from "@sps-woodland/content-tiles"; | ||
import { SortingHeader, SortingHeaderCell } from "@sps-woodland/sorting-header"; | ||
@@ -265,0 +265,0 @@ import { grid } from "@sps-woodland/tokens"; |
{ | ||
"name": "@sps-woodland/content-tiles", | ||
"description": "SPS Woodland Design System content-tile and content tile list components.", | ||
"version": "7.4.5", | ||
"version": "7.4.6", | ||
"author": "SPS Commerce", | ||
@@ -28,4 +28,4 @@ "license": "UNLICENSED", | ||
"peerDependencies": { | ||
"@sps-woodland/core": "7.4.5", | ||
"@sps-woodland/tokens": "7.4.5", | ||
"@sps-woodland/core": "7.4.6", | ||
"@sps-woodland/tokens": "7.4.6", | ||
"@spscommerce/utils": "^6.12.1", | ||
@@ -36,4 +36,4 @@ "react": "^16.14.0", | ||
"devDependencies": { | ||
"@sps-woodland/core": "7.4.5", | ||
"@sps-woodland/tokens": "7.4.5", | ||
"@sps-woodland/core": "7.4.6", | ||
"@sps-woodland/tokens": "7.4.6", | ||
"@spscommerce/utils": "^6.12.1", | ||
@@ -40,0 +40,0 @@ "@vanilla-extract/css": "^1.9.3", |
30596