@daren/typography
Advanced tools
Comparing version 1.4.1 to 1.4.2
@@ -1,3 +0,119 @@ | ||
export * from './title'; | ||
export * from './paragraph'; | ||
//# sourceMappingURL=index.js.map | ||
// lib/title.tsx | ||
import { cx } from "@daren/utils"; | ||
import { jsx, jsxs } from "react/jsx-runtime"; | ||
var fontSize = { | ||
h1: "leading-tight text-4xl md:text-5xl", | ||
h2: "leading-tight text-3xl md:text-4xl", | ||
h3: "text-2xl font-bold md:text-3xl", | ||
h4: "text-xl font-bold md:text-2xl", | ||
h5: "text-lg font-bold md:text-xl", | ||
h6: "text-lg font-bold" | ||
}; | ||
var titleColors = { | ||
primary: "text-primary", | ||
secondary: "text-secondary" | ||
}; | ||
function Title({ | ||
variant = "primary", | ||
size, | ||
as, | ||
className, | ||
...rest | ||
}) { | ||
const Tag = as ?? size; | ||
return /* @__PURE__ */ jsx(Tag, { | ||
className: cx(fontSize[size], titleColors[variant], className), | ||
...rest | ||
}); | ||
} | ||
function H1(props) { | ||
return /* @__PURE__ */ jsx(Title, { | ||
...props, | ||
size: "h1" | ||
}); | ||
} | ||
function H2(props) { | ||
return /* @__PURE__ */ jsx(Title, { | ||
...props, | ||
size: "h2" | ||
}); | ||
} | ||
function H3(props) { | ||
return /* @__PURE__ */ jsx(Title, { | ||
...props, | ||
size: "h3" | ||
}); | ||
} | ||
function H4(props) { | ||
return /* @__PURE__ */ jsx(Title, { | ||
...props, | ||
size: "h4" | ||
}); | ||
} | ||
function H5(props) { | ||
return /* @__PURE__ */ jsx(Title, { | ||
...props, | ||
size: "h5" | ||
}); | ||
} | ||
function H6(props) { | ||
return /* @__PURE__ */ jsx(Title, { | ||
...props, | ||
size: "h6" | ||
}); | ||
} | ||
function TitleWithActions({ | ||
children, | ||
actions, | ||
size = "h2", | ||
className, | ||
...rest | ||
}) { | ||
return /* @__PURE__ */ jsxs(Title, { | ||
size, | ||
className: cx( | ||
className, | ||
"flex flex-col space-y-1 sm:flex-row sm:justify-between sm:items-center sm:space-y-0 sm:space-x-3" | ||
), | ||
...rest, | ||
children: [ | ||
/* @__PURE__ */ jsx("div", { | ||
className: "flex-1", | ||
children | ||
}), | ||
actions && /* @__PURE__ */ jsx("div", { | ||
className: "flex flex-col flex-initial space-y-4 sm:flex-row sm:space-y-0 sm:space-x-4", | ||
children: actions | ||
}) | ||
] | ||
}); | ||
} | ||
// lib/paragraph.tsx | ||
import { cx as cx2 } from "@daren/utils"; | ||
import * as React from "react"; | ||
function Paragraph({ | ||
className, | ||
prose = true, | ||
as = "p", | ||
textColorClassName = "text-secondary", | ||
...rest | ||
}) { | ||
return React.createElement(as, { | ||
className: cx2("max-w-full text-lg", className, { | ||
"prose prose-light dark:prose-invert": prose, | ||
[textColorClassName]: !prose | ||
}), | ||
...rest | ||
}); | ||
} | ||
export { | ||
H1, | ||
H2, | ||
H3, | ||
H4, | ||
H5, | ||
H6, | ||
Paragraph, | ||
TitleWithActions | ||
}; |
{ | ||
"name": "@daren/typography", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"repository": { | ||
@@ -12,3 +12,3 @@ "type": "git", | ||
".": { | ||
"require": "./dist/cjs/index.js", | ||
"require": "./dist/index.js", | ||
"default": "./dist/esm/index.js" | ||
@@ -18,6 +18,6 @@ }, | ||
}, | ||
"main": "dist/cjs/index.js", | ||
"main": "dist/index.js", | ||
"module": "dist/esm/index.js", | ||
"types": "dist/types/index.d.ts", | ||
"typings": "dist/types/index.d.ts", | ||
"types": "dist/index.d.ts", | ||
"typings": "dist/index.d.ts", | ||
"files": [ | ||
@@ -27,6 +27,4 @@ "dist" | ||
"scripts": { | ||
"build": "run-p build:*", | ||
"build:cjs": "cross-env BABEL_ENV=cjs babel lib --root-mode upward --extensions .ts,.tsx -d dist/cjs --source-maps", | ||
"build:esm": "cross-env BABEL_ENV=esm babel lib --root-mode upward --extensions .ts,.tsx -d dist/esm --source-maps", | ||
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist/types", | ||
"build": "run-s build:*", | ||
"build:source": "tsup ./index.ts --format esm,cjs --legacy-output --dts ./index.ts", | ||
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist", | ||
@@ -42,3 +40,3 @@ "lint": "run-p lint:*", | ||
"dependencies": { | ||
"@daren/utils": "^1.5.0" | ||
"@daren/utils": "^1.5.1" | ||
}, | ||
@@ -54,3 +52,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "2461fb467f1d7ab15ab1c4288f548592bf63b1ba" | ||
"gitHead": "0cb696ce495fec15dafa4b2b174a840eabbcaa2c" | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
320
9277
5
1
Updated@daren/utils@^1.5.1