@react-email/tailwind 0.0.16-canary.0 → 0.0.16-canary.1

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/index.js CHANGED
@@ -2431,7 +2431,7 @@ ${n.map(({variableName:a,uniqueLocalName:c})=>` reactHotLoader.register(${a}, "
2431
2431
  @tailwind base;
2432
2432
  @tailwind components;
2433
2433
  @tailwind utilities;
2434
- `,{from:void 0}).css},UX=t=>{const e=/rgb\(\s*(\d+)\s*(\d+)\s*(\d+)(?:\s*\/\s*([\d%.]+))?\s*\)/gm;return t.replaceAll(e,(n,a,c,u,r)=>{const l=r==="1"||typeof r>"u"?"":`,${r}`;return`rgb(${a},${c},${u}${l})`})},VX=t=>t.replace(/-(\w|$)/g,(e,n)=>n.toUpperCase()),WX=t=>{let e=t;return e=e.toLowerCase(),e==="float"?"cssFloat":e.startsWith("--")?e:(e.startsWith("-ms-")&&(e=e.slice(1)),VX(e))},HX=t=>Array.from(t.matchAll(/([a-zA-Z0-9\-_]+)\s*:\s*('[^']*'[^;]*|"[^"]*"[^;]*|[^;]*?\([^)]*\)[^;]*|[^;(]*);?/gm)).map(([e,n,a])=>({property:n,value:a.replaceAll(/[\r\n|\r|\n]+/g,"").replaceAll(/\s+/g," ")})),qX=t=>{const e={},n=HX(t);for(const{property:a,value:c}of n)a.length>0&&c.trim().length>0&&(e[WX(a)]=c.trim());return e};function C0(t){return t.replaceAll(/\\[0-9]|\\/g,"")}const LI=t=>t.replaceAll("+","plus").replaceAll("[","").replaceAll("%","pc").replaceAll("]","").replaceAll("(","").replaceAll(")","").replaceAll("!","imprtnt").replaceAll(">","gt").replaceAll("<","lt").replaceAll("=","eq").replace(/[^a-zA-Z0-9\-_]/g,"_");function GX(t){const e=C0(t);return LI(e)}function zX(t){return t.split(";").map(e=>e.endsWith("!important")?e.trim():`${e.trim()}!important`).join(";")}function KX(t,e){const n=Jc(Gl.jsx(Gl.Fragment,{children:t})),a=UX($X(n,e)),[c,u]=CO(a),r={};for(const f of Lg(c)){const d=C0(f.selector);r[d]=qX(f.content)}const l=[],i=u.map(f=>{let d=f;for(const s of Lg(f))l.push(C0(s.selector)),d=d.replace(s.value,s.value.replace(s.selector,GX(s.selector)).replace(s.content,zX(s.content)).trim());return d.replace(/(\r\n|\r|\n)+/gm,"").replace(/\s+/gm," ")});return{stylePerClassMap:r,sanitizedMediaQueries:i,nonInlinableClasses:l}}function YX(t){return e=>{const n=e.split(" "),a=[];let c={};for(const u of n)u in t?c={...c,...t[u]}:a.push(u);return{styles:c,residualClassName:a.join(" ")}}}const XX=t=>t.replace(/\/\*[\s\S]*?\*\//gm,"").replace(/;\s+/gm,";").replace(/:\s+/gm,":").replace(/\)\s*{/gm,"){").replace(/\s+\(/gm,"(").replace(/{\s+/gm,"{").replace(/}\s+/gm,"}").replace(/\s*{/gm,"{").replace(/;?\s*}/gm,"}"),JX=({children:t,config:e})=>{const{stylePerClassMap:n,nonInlinableClasses:a,sanitizedMediaQueries:c}=KX(t,e??{}),u=YX(n),r=c.filter(s=>s.trim().length>0),l=r.length>0;let i=!1;function f(s){const o={};if(!i&&l&&s.type==="head"){i=!0;const y=Gl.jsx("style",{children:XX(r.join(""))});return Ys.cloneElement(s,s.props,s.props.children,y)}if(s.props.children&&(o.children=Ys.Children.map(s.props.children,y=>Ys.isValidElement(y)?f(y):y)),s.props.className){const{styles:y,residualClassName:b}=u(s.props.className);if(o.style={...s.props.style,...y},b.trim().length>0){o.className=b;for(const E of a)o.className=o.className.replace(E,LI(E))}else o.className=void 0}const m={...s.props,...o},h=o.children?o.children:s.props.children;if(typeof s.type=="function"||s.type.render){const b=(typeof s.type=="object"?s.type.render:s.type)({...s.props,...o});if(Ys.isValidElement(b))return f(b)}return Ys.cloneElement(s,m,h)}const d=Ys.Children.map(t,s=>Ys.isValidElement(s)?f(s):s)??[];if(l&&!i)throw new Error(`You are trying to use the following Tailwind classes that have media queries: ${a.join(" ")}.
2434
+ `,{from:void 0}).css},UX=t=>{const e=/rgb\(\s*(\d+)\s*(\d+)\s*(\d+)(?:\s*\/\s*([\d%.]+))?\s*\)/gm;return t.replaceAll(e,(n,a,c,u,r)=>{const l=r==="1"||typeof r>"u"?"":`,${r}`;return`rgb(${a},${c},${u}${l})`})},VX=t=>t.replace(/-(\w|$)/g,(e,n)=>n.toUpperCase()),WX=t=>{let e=t;return e=e.toLowerCase(),e==="float"?"cssFloat":e.startsWith("--")?e:(e.startsWith("-ms-")&&(e=e.slice(1)),VX(e))},HX=t=>Array.from(t.matchAll(/([a-zA-Z0-9\-_]+)\s*:\s*('[^']*'[^;]*|"[^"]*"[^;]*|[^;]*?\([^)]*\)[^;]*|[^;(]*);?/gm)).map(([e,n,a])=>({property:n,value:a.replaceAll(/[\r\n|\r|\n]+/g,"").replaceAll(/\s+/g," ")})),qX=t=>{const e={},n=HX(t);for(const{property:a,value:c}of n)a.length>0&&c.trim().length>0&&(e[WX(a)]=c.trim());return e};function C0(t){return t.replaceAll(/\\[0-9]|\\/g,"")}const LI=t=>t.replaceAll("+","plus").replaceAll("[","").replaceAll("%","pc").replaceAll("]","").replaceAll("(","").replaceAll(")","").replaceAll("!","imprtnt").replaceAll(">","gt").replaceAll("<","lt").replaceAll("=","eq").replace(/[^a-zA-Z0-9\-_]/g,"_");function GX(t){const e=C0(t);return LI(e)}function zX(t){return t.split(";").map(e=>e.endsWith("!important")?e.trim():`${e.trim()}!important`).join(";")}function KX(t,e){const n=Jc(Gl.jsx(Gl.Fragment,{children:t})),a=UX($X(n,e)),[c,u]=CO(a),r={};for(const f of Lg(c)){const d=C0(f.selector);r[d]=qX(f.content)}const l=[],i=u.map(f=>{let d=f;for(const s of Lg(f))l.push(C0(s.selector)),d=d.replace(s.value,s.value.replace(s.selector,GX(s.selector)).replace(s.content,zX(s.content)).trim());return d.replace(/(\r\n|\r|\n)+/gm,"").replace(/\s+/gm," ")});return{stylePerClassMap:r,sanitizedMediaQueries:i,nonInlinableClasses:l}}function YX(t){return e=>{const n=e.split(" "),a=[];let c={};for(const u of n)u in t?c={...c,...t[u]}:a.push(u);return{styles:c,residualClassName:a.join(" ")}}}const XX=t=>t.replace(/\/\*[\s\S]*?\*\//gm,"").replace(/;\s+/gm,";").replace(/:\s+/gm,":").replace(/\)\s*{/gm,"){").replace(/\s+\(/gm,"(").replace(/{\s+/gm,"{").replace(/}\s+/gm,"}").replace(/\s*{/gm,"{").replace(/;?\s*}/gm,"}"),JX=({children:t,config:e})=>{const{stylePerClassMap:n,nonInlinableClasses:a,sanitizedMediaQueries:c}=KX(t,e??{}),u=YX(n),r=c.filter(s=>s.trim().length>0),l=r.length>0;let i=!1;function f(s){const o={};if(!i&&l&&s.type==="head"){i=!0;const y=Gl.jsx("style",{children:XX(r.join(""))});return Ys.cloneElement(s,s.props,s.props.children,y)}if(s.props.children){const y=Ys.Children.map(s.props.children,b=>Ys.isValidElement(b)?f(b):b);o.children=y&&y.length===1?y[0]:y}if(s.props.className){const{styles:y,residualClassName:b}=u(s.props.className);if(o.style={...s.props.style,...y},b.trim().length>0){o.className=b;for(const E of a)o.className=o.className.replace(E,LI(E))}else o.className=void 0}const m={...s.props,...o},h=o.children?o.children:s.props.children;if(typeof s.type=="function"||s.type.render){const b=(typeof s.type=="object"?s.type.render:s.type)({...s.props,...o});if(Ys.isValidElement(b))return f(b)}return Ys.cloneElement(s,m,h)}const d=Ys.Children.map(t,s=>Ys.isValidElement(s)?f(s):s)??[];if(l&&!i)throw new Error(`You are trying to use the following Tailwind classes that have media queries: ${a.join(" ")}.
2435
2435
  For the media queries to work properly on rendering, they need to be added into a <style> tag inside of a <head> tag,
2436
2436
  the Tailwind component tried finding a <head> element but just wasn't able to find it.
2437
2437
 
package/dist/index.mjs CHANGED
@@ -93062,10 +93062,14 @@ const YX = (t) => t.replace(/\/\*[\s\S]*?\*\//gm, "").replace(/;\s+/gm, ";").rep
93062
93062
  y
93063
93063
  );
93064
93064
  }
93065
- if (s.props.children && (o.children = Ys.Children.map(
93066
- s.props.children,
93067
- (y) => Ys.isValidElement(y) ? f(y) : y
93068
- )), s.props.className) {
93065
+ if (s.props.children) {
93066
+ const y = Ys.Children.map(
93067
+ s.props.children,
93068
+ (b) => Ys.isValidElement(b) ? f(b) : b
93069
+ );
93070
+ o.children = y && y.length === 1 ? y[0] : y;
93071
+ }
93072
+ if (s.props.className) {
93069
93073
  const { styles: y, residualClassName: b } = u(s.props.className);
93070
93074
  if (o.style = {
93071
93075
  ...s.props.style,
@@ -1 +1 @@
1
- {"version":3,"file":"tailwind.d.ts","sourceRoot":"","sources":["../src/tailwind.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,MAAM,IAAI,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAMpE,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,sBAAsB,EAAE,SAAS,CAAC,CAAC;AAErE,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAQD,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAmI5C,CAAC"}
1
+ {"version":3,"file":"tailwind.d.ts","sourceRoot":"","sources":["../src/tailwind.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,MAAM,IAAI,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAMpE,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,sBAAsB,EAAE,SAAS,CAAC,CAAC;AAErE,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAQD,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAuI5C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-email/tailwind",
3
- "version": "0.0.16-canary.0",
3
+ "version": "0.0.16-canary.1",
4
4
  "description": "A React component to wrap emails with Tailwind CSS",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -58,12 +58,13 @@
58
58
  "vite": "4.5.2",
59
59
  "vite-plugin-dts": "3.6.3",
60
60
  "vite-plugin-node-polyfills": "0.17.0",
61
+ "@react-email/button": "^0.0.14",
61
62
  "@react-email/head": "0.0.8-canary.0",
62
- "@react-email/hr": "0.0.7",
63
+ "@react-email/heading": "0.0.11",
63
64
  "@react-email/html": "0.0.7",
64
- "eslint-config-custom": "0.0.0",
65
- "@react-email/button": "^0.0.14",
66
- "tsconfig": "0.0.0"
65
+ "@react-email/hr": "0.0.7",
66
+ "tsconfig": "0.0.0",
67
+ "eslint-config-custom": "0.0.0"
67
68
  },
68
69
  "publishConfig": {
69
70
  "access": "public"