@adidas/htmplar-core 0.0.0 → 2.0.0-alpha.0

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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Block/Block.tsx","../src/components/Text/Text.tsx","../src/components/Button/Button.tsx","../src/components/Image/Image.tsx","../src/components/Link/Link.tsx","../src/components/Heading/Heading.tsx","../src/components/Spacer/Spacer.tsx","../src/components/Divider/Divider.tsx","../src/components/Row/Row.tsx","../src/components/Column/Column.tsx","../src/components/Container/Container.tsx","../src/index.ts"],"names":["jsx"],"mappings":";;;AA2CO,SAAS,KAAA,CAAM;AAAA,EACpB,QAAA;AAAA,EACA,eAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA,GAAU,EAAA;AAAA,EACV,QAAA,GAAW,GAAA;AAAA,EACX,KAAA,GAAQ,QAAA;AAAA,EACR,SAAA;AAAA,EACA;AACF,CAAA,EAAe;AACb,EAAA,MAAM,cAAA,GAAsC;AAAA,IAC1C,eAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,MAAM,UAAA,GAAkC;AAAA,IACtC,QAAA,EAAU,GAAG,QAAQ,CAAA,EAAA,CAAA;AAAA,IACrB,KAAA,EAAO;AAAA,GACT;AAEA,EAAA,MAAM,YAAA,GAAoC;AAAA,IACxC,SAAS,OAAO,OAAA,KAAY,QAAA,GAAW,CAAA,EAAG,OAAO,CAAA,EAAA,CAAA,GAAO;AAAA,GAC1D;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,cAAA;AAAA,MACL,MAAA,EAAQ,CAAA;AAAA,MACR,WAAA,EAAa,CAAA;AAAA,MACb,WAAA,EAAa,CAAA;AAAA,MACb,KAAA,EAAM,MAAA;AAAA,MACN,KAAA,EAAO,cAAA;AAAA,MACP,SAAA;AAAA,MACA,EAAA;AAAA,MAEA,QAAA,kBAAA,GAAA,CAAC,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AA,IAChC,QAAA,EAAU,GAAG,QAAQ,CAAA,EAAA,CAAA;AAAA,IACrB,KAAA,EAAO,MAAA;AAAA,IACP,eAAA;AAAA,IACA,MAAA,EAAQ,QAAA;AAAA,IACR,GAAG;AAAA,GACL;AAEA,EAAA,MAAM,SAAA,GAA2B;AAAA,IAC/B,SAAS,OAAO,OAAA,KAAY,QAAA,GAAW,CAAA,EAAG,OAAO,CAAA,EAAA,CAAA,GAAO;AAAA,GAC1D;AAEA,EAAA,uBACEA,GAAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,cAAA;AAAA,MACL,MAAA,EAAQ,CAAA;AAAA,MACR,WAAA,EAAa,CAAA;AAAA,MACb,WAAA,EAAa,CAAA;AAAA,MACb,KAAA,EAAM,MAAA;AAAA,MACN,KAAA,EAAO,UAAA;AAAA,MACP,KAAA;AAAA,MAEA,QAAA,kBAAAA,GAAAA,CAAC,OAAA,EAAA,EACC,QAAA,kBAAAA,GAAAA,CAAC,IAAA,EAAA,EACC,QAAA,kBAAAA,GAAAA,CAAC,IAAA,EAAA,EAAG,KAAA,EAAO,SAAA,EAAY,QAAA,EAAS,GAClC,CAAA,EACF;AAAA;AAAA,GACF;AAEJ;;;AC/CO,IAAM,OAAA,GAAU;AAoCvB,OAAA,CAAQ,GAAA,CAAI,CAAA,sBAAA,EAAyB,OAAO,CAAA,OAAA,CAAS,CAAA","file":"index.mjs","sourcesContent":["import React from 'react';\n\nexport interface BlockProps {\n /**\n * Content to display inside the block\n */\n children: React.ReactNode;\n /**\n * Background color\n */\n backgroundColor?: string;\n /**\n * Text color\n */\n color?: string;\n /**\n * Padding (in pixels)\n */\n padding?: number | string;\n /**\n * Maximum width (in pixels)\n * @default 600\n */\n maxWidth?: number;\n /**\n * Horizontal alignment\n * @default 'center'\n */\n align?: 'left' | 'center' | 'right';\n /**\n * Additional CSS class name\n */\n className?: string;\n /**\n * CSS ID\n */\n id?: string;\n}\n\n/**\n * Block component - Main container for email content\n * Uses table-based layout for email compatibility\n */\nexport function Block({\n children,\n backgroundColor,\n color,\n padding = 20,\n maxWidth = 600,\n align = 'center',\n className,\n id,\n}: BlockProps) {\n const containerStyle: React.CSSProperties = {\n backgroundColor,\n color,\n };\n\n const innerStyle: React.CSSProperties = {\n maxWidth: `${maxWidth}px`,\n width: '100%',\n };\n\n const contentStyle: React.CSSProperties = {\n padding: typeof padding === 'number' ? `${padding}px` : padding,\n };\n\n return (\n <table\n role=\"presentation\"\n border={0}\n cellPadding={0}\n cellSpacing={0}\n width=\"100%\"\n style={containerStyle}\n className={className}\n id={id}\n >\n <tbody>\n <tr>\n <td align={align} valign=\"top\">\n {/*[if (gte mso 9)|(IE)]>\n <table align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width={`${maxWidth}`}>\n <tr>\n <td align=\"center\" valign=\"top\" width={`${maxWidth}`}>\n <![endif]*/}\n <table\n role=\"presentation\"\n border={0}\n cellPadding={0}\n cellSpacing={0}\n style={innerStyle}\n className=\"mobile-full-width\"\n >\n <tbody>\n <tr>\n <td style={contentStyle} valign=\"top\">\n {children}\n </td>\n </tr>\n </tbody>\n </table>\n {/*[if (gte mso 9)|(IE)]>\n </td>\n </tr>\n </table>\n <![endif]*/}\n </td>\n </tr>\n </tbody>\n </table>\n );\n}\n","import React from 'react';\n\nexport interface TextProps {\n /**\n * Text content\n */\n children: React.ReactNode;\n /**\n * Font size (in pixels)\n * @default 16\n */\n fontSize?: number;\n /**\n * Font family\n * @default 'Arial, sans-serif'\n */\n fontFamily?: string;\n /**\n * Text color\n */\n color?: string;\n /**\n * Line height\n * @default 1.5\n */\n lineHeight?: number | string;\n /**\n * Text alignment\n * @default 'left'\n */\n align?: 'left' | 'center' | 'right' | 'justify';\n /**\n * Font weight\n */\n fontWeight?: 'normal' | 'bold' | number;\n /**\n * Additional CSS class name\n */\n className?: string;\n}\n\n/**\n * Text component - Email-safe text rendering\n */\nexport function Text({\n children,\n fontSize = 16,\n fontFamily = 'Arial, sans-serif',\n color,\n lineHeight = 1.5,\n align = 'left',\n fontWeight,\n className,\n}: TextProps) {\n const style: React.CSSProperties = {\n fontSize: `${fontSize}px`,\n fontFamily,\n color,\n lineHeight: typeof lineHeight === 'number' ? lineHeight : lineHeight,\n textAlign: align,\n fontWeight,\n margin: 0,\n padding: 0,\n };\n\n return (\n <p style={style} className={className}>\n {children}\n </p>\n );\n}\n","import React from 'react';\n\nexport interface ButtonProps {\n /**\n * Button text\n */\n children: React.ReactNode;\n /**\n * Link URL\n */\n href: string;\n /**\n * Background color\n * @default '#0066cc'\n */\n backgroundColor?: string;\n /**\n * Text color\n * @default '#ffffff'\n */\n color?: string;\n /**\n * Padding\n * @default '12px 24px'\n */\n padding?: string;\n /**\n * Border radius\n * @default '4px'\n */\n borderRadius?: string;\n /**\n * Font size\n * @default 16\n */\n fontSize?: number;\n /**\n * Font family\n * @default 'Arial, sans-serif'\n */\n fontFamily?: string;\n /**\n * Font weight\n * @default 'bold'\n */\n fontWeight?: 'normal' | 'bold' | number;\n /**\n * Text alignment\n * @default 'center'\n */\n align?: 'left' | 'center' | 'right';\n /**\n * Full width button\n * @default false\n */\n fullWidth?: boolean;\n /**\n * Additional CSS class\n */\n className?: string;\n}\n\n/**\n * Button component - Email-safe call-to-action button\n * Uses bulletproof button technique with VML for Outlook\n */\nexport function Button({\n children,\n href,\n backgroundColor = '#0066cc',\n color = '#ffffff',\n padding = '12px 24px',\n borderRadius = '4px',\n fontSize = 16,\n fontFamily = 'Arial, sans-serif',\n fontWeight = 'bold',\n align = 'center',\n fullWidth = false,\n className,\n}: ButtonProps) {\n const buttonStyle: React.CSSProperties = {\n backgroundColor,\n color,\n textDecoration: 'none',\n padding,\n borderRadius,\n fontSize: `${fontSize}px`,\n fontFamily,\n fontWeight,\n display: 'inline-block',\n textAlign: 'center',\n ...(fullWidth && { width: '100%' }),\n };\n\n const tableStyle: React.CSSProperties = {\n borderCollapse: 'separate',\n ...(fullWidth && { width: '100%' }),\n };\n\n return (\n <table\n role=\"presentation\"\n border={0}\n cellPadding={0}\n cellSpacing={0}\n style={tableStyle}\n className={className}\n >\n <tbody>\n <tr>\n <td align={align} valign=\"middle\">\n {/*[if mso]>\n <v:roundrect xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:w=\"urn:schemas-microsoft-com:office:word\" href={`${href}`} style=\"height:auto;v-text-anchor:middle;width:200px;\" arcsize=\"10%\" stroke=\"f\" fillcolor={`${backgroundColor}`}>\n <w:anchorlock/>\n <center>\n <![endif]*/}\n <a href={href} style={buttonStyle} target=\"_blank\" rel=\"noopener noreferrer\">\n {children}\n </a>\n {/*[if mso]>\n </center>\n </v:roundrect>\n <![endif]*/}\n </td>\n </tr>\n </tbody>\n </table>\n );\n}\n","import React from 'react';\n\nexport interface ImageProps {\n /**\n * Image source URL\n */\n src: string;\n /**\n * Alt text for accessibility\n */\n alt: string;\n /**\n * Image width\n */\n width?: number | string;\n /**\n * Image height\n */\n height?: number | string;\n /**\n * Horizontal alignment\n * @default 'center'\n */\n align?: 'left' | 'center' | 'right';\n /**\n * Additional CSS class\n */\n className?: string;\n /**\n * Title attribute\n */\n title?: string;\n}\n\n/**\n * Image component - Email-safe responsive images\n */\nexport function Image({ src, alt, width, height, align = 'center', className, title }: ImageProps) {\n const imgStyle: React.CSSProperties = {\n display: 'block',\n border: 0,\n outline: 'none',\n textDecoration: 'none',\n maxWidth: '100%',\n height: 'auto',\n ...(width && { width: typeof width === 'number' ? `${width}px` : width }),\n ...(height && { height: typeof height === 'number' ? `${height}px` : height }),\n };\n\n return (\n <table role=\"presentation\" border={0} cellPadding={0} cellSpacing={0} width=\"100%\">\n <tbody>\n <tr>\n <td align={align} valign=\"top\">\n <img src={src} alt={alt} title={title} style={imgStyle} className={className} />\n </td>\n </tr>\n </tbody>\n </table>\n );\n}\n","import { type CSSProperties, type ReactNode } from 'react';\n\nexport interface LinkProps {\n href: string;\n children: ReactNode;\n color?: string;\n fontSize?: number;\n fontWeight?: string | number;\n textDecoration?: string;\n target?: string;\n rel?: string;\n style?: CSSProperties;\n}\n\n/**\n * Link component for email-safe hyperlinks\n * Ensures proper styling and accessibility in all email clients\n */\nexport function Link({\n href,\n children,\n color = '#0066cc',\n fontSize = 16,\n fontWeight = 'normal',\n textDecoration = 'underline',\n target = '_blank',\n rel = 'noopener noreferrer',\n style = {},\n}: LinkProps) {\n const linkStyle: CSSProperties = {\n color,\n fontSize: `${fontSize}px`,\n fontWeight,\n textDecoration,\n ...style,\n };\n\n return (\n <a href={href} style={linkStyle} target={target} rel={rel}>\n {children}\n </a>\n );\n}\n","import { type CSSProperties, type ReactNode } from 'react';\n\nexport interface HeadingProps {\n level?: 1 | 2 | 3 | 4 | 5 | 6;\n children: ReactNode;\n color?: string;\n fontSize?: number;\n fontWeight?: string | number;\n align?: 'left' | 'center' | 'right';\n margin?: string | number;\n lineHeight?: string | number;\n style?: CSSProperties;\n}\n\n/**\n * Heading component for semantic email headings\n * Uses proper HTML heading tags (h1-h6) with email-safe styling\n */\nexport function Heading({\n level = 2,\n children,\n color = '#333333',\n fontSize,\n fontWeight = 'bold',\n align = 'left',\n margin = '0 0 16px 0',\n lineHeight = 1.3,\n style = {},\n}: HeadingProps) {\n // Default font sizes for each heading level\n const defaultFontSizes = {\n 1: 32,\n 2: 28,\n 3: 24,\n 4: 20,\n 5: 18,\n 6: 16,\n };\n\n const headingStyle: CSSProperties = {\n margin,\n padding: 0,\n color,\n fontSize: `${fontSize || defaultFontSizes[level]}px`,\n fontWeight,\n textAlign: align,\n lineHeight: typeof lineHeight === 'number' ? lineHeight : lineHeight,\n ...style,\n };\n\n const Tag = `h${level}` as keyof JSX.IntrinsicElements;\n\n return <Tag style={headingStyle}>{children}</Tag>;\n}\n","import { type CSSProperties } from 'react';\n\nexport interface SpacerProps {\n height?: number;\n width?: number;\n}\n\n/**\n * Spacer component for adding vertical or horizontal space\n * Uses table-based layout for consistent spacing across email clients\n */\nexport function Spacer({ height = 20, width }: SpacerProps) {\n const style: CSSProperties = {\n height: height ? `${height}px` : undefined,\n width: width ? `${width}px` : undefined,\n lineHeight: height ? `${height}px` : undefined,\n fontSize: '1px',\n };\n\n return (\n <table\n role=\"presentation\"\n border={0}\n cellPadding={0}\n cellSpacing={0}\n width={width || '100%'}\n style={style}\n >\n <tbody>\n <tr>\n <td style={style}>&nbsp;</td>\n </tr>\n </tbody>\n </table>\n );\n}\n","import { type CSSProperties } from 'react';\n\nexport interface DividerProps {\n color?: string;\n height?: number;\n width?: string | number;\n marginTop?: number;\n marginBottom?: number;\n}\n\n/**\n * Divider component for horizontal lines\n * Uses border-top for reliable rendering across email clients\n */\nexport function Divider({\n color = '#e0e0e0',\n height = 1,\n width = '100%',\n marginTop = 16,\n marginBottom = 16,\n}: DividerProps) {\n const containerStyle: CSSProperties = {\n margin: `${marginTop}px 0 ${marginBottom}px 0`,\n width: typeof width === 'number' ? `${width}px` : width,\n };\n\n const dividerStyle: CSSProperties = {\n borderTop: `${height}px solid ${color}`,\n fontSize: '1px',\n lineHeight: '1px',\n margin: 0,\n padding: 0,\n };\n\n return (\n <table\n role=\"presentation\"\n border={0}\n cellPadding={0}\n cellSpacing={0}\n width=\"100%\"\n style={containerStyle}\n >\n <tbody>\n <tr>\n <td style={dividerStyle}>&nbsp;</td>\n </tr>\n </tbody>\n </table>\n );\n}\n","import { type CSSProperties, type ReactNode } from 'react';\n\nexport interface RowProps {\n children: ReactNode;\n backgroundColor?: string;\n padding?: number | string;\n style?: CSSProperties;\n}\n\n/**\n * Row component for horizontal layout containers\n * Works with Column components to create responsive grid layouts\n */\nexport function Row({ children, backgroundColor, padding: _padding, style = {} }: RowProps) {\n const tableStyle: CSSProperties = {\n width: '100%',\n backgroundColor,\n ...style,\n };\n\n // Note: padding is intentionally not used here - Row children (Column) handle their own padding\n\n return (\n <table\n role=\"presentation\"\n border={0}\n cellPadding={0}\n cellSpacing={0}\n width=\"100%\"\n style={tableStyle}\n >\n <tbody>\n <tr>{children}</tr>\n </tbody>\n </table>\n );\n}\n","import { type CSSProperties, type ReactNode } from 'react';\n\nexport interface ColumnProps {\n children: ReactNode;\n width?: number | string;\n backgroundColor?: string;\n padding?: number | string;\n align?: 'left' | 'center' | 'right';\n verticalAlign?: 'top' | 'middle' | 'bottom';\n style?: CSSProperties;\n}\n\n/**\n * Column component for grid layouts\n * Must be used inside a Row component\n * Responsive: stacks on mobile by default\n */\nexport function Column({\n children,\n width,\n backgroundColor,\n padding = 0,\n align = 'left',\n verticalAlign = 'top',\n style = {},\n}: ColumnProps) {\n const cellStyle: CSSProperties = {\n width: typeof width === 'number' ? `${width}px` : width,\n backgroundColor,\n padding: typeof padding === 'number' ? `${padding}px` : padding,\n textAlign: align,\n verticalAlign,\n ...style,\n };\n\n return (\n <td style={cellStyle} align={align} valign={verticalAlign}>\n {children}\n </td>\n );\n}\n","import { type CSSProperties, type ReactNode } from 'react';\n\nexport interface ContainerProps {\n children: ReactNode;\n maxWidth?: number;\n backgroundColor?: string;\n padding?: number | string;\n align?: 'left' | 'center' | 'right';\n style?: CSSProperties;\n}\n\n/**\n * Container component - lightweight wrapper without MSO conditionals\n * Use Block for full email-safe containers with Outlook support\n */\nexport function Container({\n children,\n maxWidth = 600,\n backgroundColor,\n padding = 20,\n align = 'center',\n style = {},\n}: ContainerProps) {\n const tableStyle: CSSProperties = {\n maxWidth: `${maxWidth}px`,\n width: '100%',\n backgroundColor,\n margin: '0 auto',\n ...style,\n };\n\n const cellStyle: CSSProperties = {\n padding: typeof padding === 'number' ? `${padding}px` : padding,\n };\n\n return (\n <table\n role=\"presentation\"\n border={0}\n cellPadding={0}\n cellSpacing={0}\n width=\"100%\"\n style={tableStyle}\n align={align}\n >\n <tbody>\n <tr>\n <td style={cellStyle}>{children}</td>\n </tr>\n </tbody>\n </table>\n );\n}\n","/**\n * @adidas/htmplar-core - React component library for email development\n * @packageDocumentation\n */\n\nexport const version = '2.0.0-alpha.0';\n\n// Export components\nexport { Block } from './components/Block';\nexport type { BlockProps } from './components/Block';\n\nexport { Text } from './components/Text';\nexport type { TextProps } from './components/Text';\n\nexport { Button } from './components/Button';\nexport type { ButtonProps } from './components/Button';\n\nexport { Image } from './components/Image';\nexport type { ImageProps } from './components/Image';\n\nexport { Link } from './components/Link';\nexport type { LinkProps } from './components/Link';\n\nexport { Heading } from './components/Heading';\nexport type { HeadingProps } from './components/Heading';\n\nexport { Spacer } from './components/Spacer';\nexport type { SpacerProps } from './components/Spacer';\n\nexport { Divider } from './components/Divider';\nexport type { DividerProps } from './components/Divider';\n\nexport { Row } from './components/Row';\nexport type { RowProps } from './components/Row';\n\nexport { Column } from './components/Column';\nexport type { ColumnProps } from './components/Column';\n\nexport { Container } from './components/Container';\nexport type { ContainerProps } from './components/Container';\n\nconsole.log(`@adidas/htmplar-core v${version} loaded`);\n"]}
package/package.json CHANGED
@@ -1,4 +1,53 @@
1
1
  {
2
2
  "name": "@adidas/htmplar-core",
3
- "version": "0.0.0"
3
+ "version": "2.0.0-alpha.0",
4
+ "description": "React component library for email development",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/adidas/htmplar.git",
9
+ "directory": "packages/core"
10
+ },
11
+ "homepage": "https://github.com/adidas/htmplar#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/adidas/htmplar/issues"
14
+ },
15
+ "main": "./dist/index.js",
16
+ "module": "./dist/index.mjs",
17
+ "types": "./dist/index.d.ts",
18
+ "exports": {
19
+ ".": {
20
+ "import": "./dist/index.mjs",
21
+ "require": "./dist/index.js",
22
+ "types": "./dist/index.d.ts"
23
+ }
24
+ },
25
+ "files": [
26
+ "dist"
27
+ ],
28
+ "scripts": {
29
+ "build": "tsup",
30
+ "dev": "tsup --watch",
31
+ "lint": "eslint src",
32
+ "test": "vitest run",
33
+ "test:watch": "vitest",
34
+ "typecheck": "tsc --noEmit"
35
+ },
36
+ "dependencies": {
37
+ "@vanilla-extract/css": "^1.15.5",
38
+ "classnames": "^2.5.1"
39
+ },
40
+ "peerDependencies": {
41
+ "react": "^18.0.0",
42
+ "react-dom": "^18.0.0"
43
+ },
44
+ "devDependencies": {
45
+ "@types/react": "^18.3.8",
46
+ "@types/react-dom": "^18.3.0",
47
+ "react": "^18.3.1",
48
+ "react-dom": "^18.3.1"
49
+ },
50
+ "publishConfig": {
51
+ "access": "public"
52
+ }
4
53
  }