@undp/design-system-react
Version:
React based design system for UNDP
428 lines (427 loc) • 9.93 kB
JavaScript
import { t as e } from "./utils-ca9as9Ye.js";
import { t } from "./dist-CQzJbxrW.js";
import n from "react";
import { jsx as r } from "react/jsx-runtime";
//#region src/components/ui/typography.tsx
var i = t("mt-0 ml-0 mr-0", {
variants: {
size: {
xs: "text-xs",
sm: "text-sm",
base: "text-p-sm",
"base-responsive": "text-p-xs md:text-p-sm lg:text-p",
lg: "text-lg",
xl: "text-xl"
},
leading: {
none: "leading-none",
xs: "leading-xs",
sm: "leading-sm",
base: "leading-base",
lg: "leading-lg",
xl: "leading-xl",
"2xl": "leading-2xl"
},
weight: {
light: "font-light",
normal: "font-normal",
medium: "font-medium",
semibold: "font-semibold",
bold: "font-bold",
extrabold: "font-extrabold"
},
decoration: {
normal: "normal",
italic: "italic",
underline: "underline",
"line-through": "line-through"
},
marginBottom: {
none: "mb-0",
"3xs": "mb-1",
"2xs": "mb-2",
xs: "mb-3",
sm: "mb-4",
base: "mb-5",
lg: "mb-6",
xl: "mb-7"
},
alignment: {
left: "text-left",
right: "text-right",
center: "text-center"
}
},
defaultVariants: {
size: "base-responsive",
leading: "base",
weight: "normal",
decoration: "normal",
marginBottom: "base",
alignment: "left"
}
}), a = n.forwardRef(({ children: t, className: n, size: a, leading: o, marginBottom: s, weight: c, decoration: l, alignment: u, ...d }, f) => /* @__PURE__ */ r("p", {
ref: f,
...d,
className: e(i({
size: a,
leading: o,
marginBottom: s,
weight: c,
decoration: l,
alignment: u
}), n),
children: t
})), o = t("mt-0 ml-0 mr-0 p-0 uppercase font-heading tracking-[0.06rem]", {
variants: {
marginBottom: {
none: "mb-0",
"2xs": "mb-1",
xs: "mb-2",
sm: "mb-3",
"base-responsive": "mb-3 md:mb-4",
base: "mb-4",
lg: "mb-5",
xl: "mb-6"
},
weight: {
light: "font-light",
normal: "font-normal",
medium: "font-medium",
semibold: "font-semibold",
bold: "font-bold",
extrabold: "font-extrabold"
},
size: {
base: "text-h1-xs md:text-h1-sm lg:text-h1",
sm: "text-h2-xs md:text-h2-sm lg:text-h2"
},
alignment: {
left: "text-left",
right: "text-right",
center: "text-center"
}
},
defaultVariants: {
marginBottom: "base-responsive",
size: "base",
weight: "bold",
alignment: "left"
}
}), s = n.forwardRef(({ children: t, className: n, marginBottom: i, size: a, alignment: s, ...c }, l) => /* @__PURE__ */ r("h1", {
ref: l,
...c,
className: e(o({
marginBottom: i,
size: a,
alignment: s
}), n),
children: t
})), c = t("mt-0 ml-0 mr-0 p-0 font-body text-h2-xs md:text-h2-sm lg:text-h2", {
variants: {
marginBottom: {
none: "mb-0",
"2xs": "mb-1",
xs: "mb-2",
sm: "mb-3",
"base-responsive": "mb-3 md:mb-4",
base: "mb-4",
lg: "mb-5",
xl: "mb-6"
},
weight: {
light: "font-light",
normal: "font-normal",
medium: "font-medium",
semibold: "font-semibold",
bold: "font-bold",
extrabold: "font-extrabold"
},
alignment: {
left: "text-left",
right: "text-right",
center: "text-center"
}
},
defaultVariants: {
marginBottom: "base-responsive",
weight: "bold",
alignment: "left"
}
}), l = n.forwardRef(({ children: t, className: n, marginBottom: i, weight: a, alignment: o, ...s }, l) => /* @__PURE__ */ r("h2", {
ref: l,
...s,
className: e(c({
marginBottom: i,
weight: a,
alignment: o
}), n),
children: t
})), u = t("mt-0 ml-0 mr-0 p-0 font-body text-h3-xs md:text-h3-sm lg:text-h3", {
variants: {
marginBottom: {
none: "mb-0",
"2xs": "mb-1",
xs: "mb-2",
sm: "mb-3",
"base-responsive": "mb-3 md:mb-4",
base: "mb-4",
lg: "mb-5",
xl: "mb-6"
},
weight: {
light: "font-light",
normal: "font-normal",
medium: "font-medium",
semibold: "font-semibold",
bold: "font-bold",
extrabold: "font-extrabold"
},
alignment: {
left: "text-left",
right: "text-right",
center: "text-center"
}
},
defaultVariants: {
marginBottom: "base-responsive",
weight: "semibold",
alignment: "left"
}
}), d = n.forwardRef(({ children: t, className: n, marginBottom: i, weight: a, alignment: o, ...s }, c) => /* @__PURE__ */ r("h3", {
ref: c,
...s,
className: e(u({
marginBottom: i,
weight: a,
alignment: o
}), n),
children: t
})), f = t("mt-0 ml-0 mr-0 p-0 font-body text-h4-xs md:text-h4-sm lg:text-h4", {
variants: {
marginBottom: {
none: "mb-0",
"2xs": "mb-1",
xs: "mb-2",
sm: "mb-3",
"base-responsive": "mb-3 md:mb-4",
base: "mb-4",
lg: "mb-5",
xl: "mb-6"
},
weight: {
light: "font-light",
normal: "font-normal",
medium: "font-medium",
semibold: "font-semibold",
bold: "font-bold",
extrabold: "font-extrabold"
},
alignment: {
left: "text-left",
right: "text-right",
center: "text-center"
}
},
defaultVariants: {
marginBottom: "base-responsive",
weight: "normal",
alignment: "left"
}
}), p = n.forwardRef(({ children: t, className: n, marginBottom: i, weight: a, alignment: o, ...s }, c) => /* @__PURE__ */ r("h4", {
ref: c,
...s,
className: e(f({
marginBottom: i,
weight: a,
alignment: o
}), n),
children: t
})), m = t("mt-0 ml-0 mr-0 p-0 font-body", {
variants: {
marginBottom: {
none: "mb-0",
"2xs": "mb-1",
xs: "mb-2",
sm: "mb-3",
"base-responsive": "mb-3 md:mb-4",
base: "mb-4",
lg: "mb-5",
xl: "mb-6"
},
size: {
"base-responsive": "text-h5-xs md:text-h5-sm lg:text-h5",
base: "text-h5-xs"
},
weight: {
light: "font-light",
normal: "font-normal",
medium: "font-medium",
semibold: "font-semibold",
bold: "font-bold",
extrabold: "font-extrabold"
},
alignment: {
left: "text-left",
right: "text-right",
center: "text-center"
}
},
defaultVariants: {
marginBottom: "base-responsive",
weight: "normal",
alignment: "left",
size: "base-responsive"
}
}), h = n.forwardRef(({ children: t, className: n, marginBottom: i, weight: a, size: o, alignment: s, ...c }, l) => /* @__PURE__ */ r("h5", {
ref: l,
...c,
className: e(m({
marginBottom: i,
weight: a,
alignment: s,
size: o
}), n),
children: t
})), g = t("mt-0 ml-0 mr-0 p-0 font-body text-h6-xs md:text-h6-sm lg:text-h6 uppercase tracking-[0.48px]", {
variants: {
marginBottom: {
none: "mb-0",
"2xs": "mb-1",
xs: "mb-2",
sm: "mb-3",
"base-responsive": "mb-3 md:mb-4",
base: "mb-4",
lg: "mb-5",
xl: "mb-6"
},
weight: {
light: "font-light",
normal: "font-normal",
medium: "font-medium",
semibold: "font-semibold",
bold: "font-bold",
extrabold: "font-extrabold"
},
alignment: {
left: "text-left",
right: "text-right",
center: "text-center"
}
},
defaultVariants: {
marginBottom: "base-responsive",
weight: "bold",
alignment: "left"
}
}), _ = n.forwardRef(({ children: t, className: n, marginBottom: i, weight: a, alignment: o, ...s }, c) => /* @__PURE__ */ r("h6", {
ref: c,
...s,
className: e(g({
marginBottom: i,
weight: a,
alignment: o
}), n),
children: t
})), v = t("mt-0 ml-0 mr-0 block p-0 font-body text-h5-xs md:text-h5-sm lg:text-h5", {
variants: {
marginBottom: {
none: "mb-0",
"2xs": "mb-1",
xs: "mb-2",
sm: "mb-3",
"base-responsive": "mb-3 md:mb-4",
base: "mb-4",
lg: "mb-5",
xl: "mb-6"
},
weight: {
light: "font-light",
normal: "font-normal",
medium: "font-medium",
semibold: "font-semibold",
bold: "font-bold",
extrabold: "font-extrabold"
}
},
defaultVariants: {
marginBottom: "base-responsive",
weight: "normal"
}
}), y = n.forwardRef(({ children: t, className: n, marginBottom: i, weight: a, ...o }, s) => /* @__PURE__ */ r("cite", {
ref: s,
...o,
className: e(v({
marginBottom: i,
weight: a
}), n),
children: t
})), b = t("m-0 bg-surface px-1 pb-1 font-mono text-content-primary text-p-xs md:text-p-sm lg:text-p", {
variants: { weight: {
light: "font-light",
normal: "font-normal",
medium: "font-medium",
semibold: "font-semibold",
bold: "font-bold",
extrabold: "font-extrabold"
} },
defaultVariants: { weight: "normal" }
}), x = n.forwardRef(({ children: t, className: n, marginBottom: i, weight: a, ...o }, s) => /* @__PURE__ */ r("code", {
ref: s,
...o,
className: e(b({ weight: a }), n),
children: t
})), S = t("m-0 font-body text-h4-xs md:text-h4-sm lg:text-h4", {
variants: { weight: {
light: "font-light",
normal: "font-normal",
medium: "font-medium",
semibold: "font-semibold",
bold: "font-bold",
extrabold: "font-extrabold"
} },
defaultVariants: { weight: "semibold" }
}), C = n.forwardRef(({ children: t, className: n, weight: i, ...a }, o) => /* @__PURE__ */ r("blockquote", {
ref: o,
...a,
className: e(S({ weight: i }), n),
children: t
})), w = t("undp-link light font-inherit text-inherit cursor-pointer no-underline focus-visible:shadow-[0_0_0_var(--ring)] focus-visible:outline-hidden", {
variants: {
variant: {
primary: "bg-double-primary",
secondary: "bg-double-secondary",
tertiary: "bg-double-tertiary",
quaternary: "bg-double-quaternary",
background: "bg-double-background",
foreground: "bg-double-foreground",
success: "bg-double-success",
warning: "bg-double-warning",
info: "bg-double-info",
error: "bg-double-error"
},
weight: {
light: "font-light",
normal: "font-normal",
medium: "font-medium",
semibold: "font-semibold",
bold: "font-bold",
extrabold: "font-extrabold"
}
},
defaultVariants: {
weight: "normal",
variant: "primary"
}
}), T = n.forwardRef(({ children: t, className: n, weight: i, variant: a, ...o }, s) => /* @__PURE__ */ r("a", {
ref: s,
...o,
className: e(w({
variant: a,
weight: i
}), n),
children: t
}));
//#endregion
export { T as A, C as Blockquote, y as Cite, x as Code, s as H1, l as H2, d as H3, p as H4, h as H5, _ as H6, a as P };
//# sourceMappingURL=Typography.js.map