'use strict'; const utilities = require('./preset-mini.UhMMbd34.cjs'); const cursorValues = ["auto", "default", "none", "context-menu", "help", "pointer", "progress", "wait", "cell", "crosshair", "text", "vertical-text", "alias", "copy", "move", "no-drop", "not-allowed", "grab", "grabbing", "all-scroll", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "ne-resize", "nw-resize", "se-resize", "sw-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "zoom-in", "zoom-out"]; const containValues = ["none", "strict", "content", "size", "inline-size", "layout", "style", "paint"]; const varEmpty = " "; const displays = [ ["inline", { display: "inline" }], ["block", { display: "block" }], ["inline-block", { display: "inline-block" }], ["contents", { display: "contents" }], ["flow-root", { display: "flow-root" }], ["list-item", { display: "list-item" }], ["hidden", { display: "none" }], [/^display-(.+)$/, ([, c]) => ({ display: utilities.h.bracket.cssvar.global(c) })] ]; const appearances = [ ["visible", { visibility: "visible" }], ["invisible", { visibility: "hidden" }], ["backface-visible", { "backface-visibility": "visible" }], ["backface-hidden", { "backface-visibility": "hidden" }], ...utilities.makeGlobalStaticRules("backface", "backface-visibility") ]; const cursors = [ [/^cursor-(.+)$/, ([, c]) => ({ cursor: utilities.h.bracket.cssvar.global(c) })], ...cursorValues.map((v) => [`cursor-${v}`, { cursor: v }]) ]; const contains = [ [/^contain-(.*)$/, ([, d]) => { if (utilities.h.bracket(d) != null) { return { contain: utilities.h.bracket(d).split(" ").map((e) => utilities.h.cssvar.fraction(e) ?? e).join(" ") }; } return containValues.includes(d) ? { contain: d } : void 0; }] ]; const pointerEvents = [ ["pointer-events-auto", { "pointer-events": "auto" }], ["pointer-events-none", { "pointer-events": "none" }], ...utilities.makeGlobalStaticRules("pointer-events") ]; const resizes = [ ["resize-x", { resize: "horizontal" }], ["resize-y", { resize: "vertical" }], ["resize", { resize: "both" }], ["resize-none", { resize: "none" }], ...utilities.makeGlobalStaticRules("resize") ]; const userSelects = [ ["select-auto", { "-webkit-user-select": "auto", "user-select": "auto" }], ["select-all", { "-webkit-user-select": "all", "user-select": "all" }], ["select-text", { "-webkit-user-select": "text", "user-select": "text" }], ["select-none", { "-webkit-user-select": "none", "user-select": "none" }], ...utilities.makeGlobalStaticRules("select", "user-select") ]; const whitespaces = [ [ /^(?:whitespace-|ws-)([-\w]+)$/, ([, v]) => ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces", ...utilities.globalKeywords].includes(v) ? { "white-space": v } : void 0, { autocomplete: "(whitespace|ws)-(normal|nowrap|pre|pre-line|pre-wrap|break-spaces)" } ] ]; const contentVisibility = [ [/^intrinsic-size-(.+)$/, ([, d]) => ({ "contain-intrinsic-size": utilities.h.bracket.cssvar.global.fraction.rem(d) }), { autocomplete: "intrinsic-size-" }], ["content-visibility-visible", { "content-visibility": "visible" }], ["content-visibility-hidden", { "content-visibility": "hidden" }], ["content-visibility-auto", { "content-visibility": "auto" }], ...utilities.makeGlobalStaticRules("content-visibility") ]; const contents = [ [/^content-(.+)$/, ([, v]) => ({ content: utilities.h.bracket.cssvar(v) })], ["content-empty", { content: '""' }], ["content-none", { content: "none" }] ]; const breaks = [ ["break-normal", { "overflow-wrap": "normal", "word-break": "normal" }], ["break-words", { "overflow-wrap": "break-word" }], ["break-all", { "word-break": "break-all" }], ["break-keep", { "word-break": "keep-all" }], ["break-anywhere", { "overflow-wrap": "anywhere" }] ]; const textWraps = [ ["text-wrap", { "text-wrap": "wrap" }], ["text-nowrap", { "text-wrap": "nowrap" }], ["text-balance", { "text-wrap": "balance" }], ["text-pretty", { "text-wrap": "pretty" }] ]; const textOverflows = [ ["truncate", { "overflow": "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" }], ["text-truncate", { "overflow": "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" }], ["text-ellipsis", { "text-overflow": "ellipsis" }], ["text-clip", { "text-overflow": "clip" }] ]; const textTransforms = [ ["case-upper", { "text-transform": "uppercase" }], ["case-lower", { "text-transform": "lowercase" }], ["case-capital", { "text-transform": "capitalize" }], ["case-normal", { "text-transform": "none" }], ...utilities.makeGlobalStaticRules("case", "text-transform") ]; const fontStyles = [ ["italic", { "font-style": "italic" }], ["not-italic", { "font-style": "normal" }], ["font-italic", { "font-style": "italic" }], ["font-not-italic", { "font-style": "normal" }], ["oblique", { "font-style": "oblique" }], ["not-oblique", { "font-style": "normal" }], ["font-oblique", { "font-style": "oblique" }], ["font-not-oblique", { "font-style": "normal" }] ]; const fontSmoothings = [ ["antialiased", { "-webkit-font-smoothing": "antialiased", "-moz-osx-font-smoothing": "grayscale" }], ["subpixel-antialiased", { "-webkit-font-smoothing": "auto", "-moz-osx-font-smoothing": "auto" }] ]; const ringBase = { "--un-ring-inset": varEmpty, "--un-ring-offset-width": "0px", "--un-ring-offset-color": "#fff", "--un-ring-width": "0px", "--un-ring-color": "rgb(147 197 253 / 0.5)", "--un-shadow": "0 0 rgb(0 0 0 / 0)" }; const rings = [ // ring [/^ring(?:-(.+))?$/, ([, d], { theme }) => { const value = theme.ringWidth?.[d || "DEFAULT"] ?? utilities.h.px(d || "1"); if (value) { return { "--un-ring-width": value, "--un-ring-offset-shadow": "var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color)", "--un-ring-shadow": "var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color)", "box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow)" }; } }, { autocomplete: "ring-$ringWidth" }], // size [/^ring-(?:width-|size-)(.+)$/, handleWidth, { autocomplete: "ring-(width|size)-$lineWidth" }], // offset size ["ring-offset", { "--un-ring-offset-width": "1px" }], [/^ring-offset-(?:width-|size-)?(.+)$/, ([, d], { theme }) => ({ "--un-ring-offset-width": theme.lineWidth?.[d] ?? utilities.h.bracket.cssvar.px(d) }), { autocomplete: "ring-offset-(width|size)-$lineWidth" }], // colors [/^ring-(.+)$/, handleColorOrWidth, { autocomplete: "ring-$colors" }], [/^ring-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-opacity": utilities.h.bracket.percent.cssvar(opacity) }), { autocomplete: "ring-(op|opacity)-" }], // offset color [/^ring-offset-(.+)$/, utilities.colorResolver("--un-ring-offset-color", "ring-offset", "borderColor"), { autocomplete: "ring-offset-$colors" }], [/^ring-offset-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-ring-offset-opacity": utilities.h.bracket.percent.cssvar(opacity) }), { autocomplete: "ring-offset-(op|opacity)-" }], // style ["ring-inset", { "--un-ring-inset": "inset" }] ]; function handleWidth([, b], { theme }) { return { "--un-ring-width": theme.ringWidth?.[b] ?? utilities.h.bracket.cssvar.px(b) }; } function handleColorOrWidth(match, ctx) { if (utilities.isCSSMathFn(utilities.h.bracket(match[1]))) return handleWidth(match, ctx); return utilities.colorResolver("--un-ring-color", "ring", "borderColor")(match, ctx); } const boxShadowsBase = { "--un-ring-offset-shadow": "0 0 rgb(0 0 0 / 0)", "--un-ring-shadow": "0 0 rgb(0 0 0 / 0)", "--un-shadow-inset": varEmpty, "--un-shadow": "0 0 rgb(0 0 0 / 0)" }; const boxShadows = [ // color [/^shadow(?:-(.+))?$/, (match, context) => { const [, d] = match; const { theme } = context; const v = theme.boxShadow?.[d || "DEFAULT"]; const c = d ? utilities.h.bracket.cssvar(d) : void 0; if ((v != null || c != null) && !utilities.hasParseableColor(c, theme, "shadowColor")) { return { "--un-shadow": utilities.colorableShadows(v || c, "--un-shadow-color").join(","), "box-shadow": "var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow)" }; } return utilities.colorResolver("--un-shadow-color", "shadow", "shadowColor")(match, context); }, { autocomplete: ["shadow-$colors", "shadow-$boxShadow"] }], [/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": utilities.h.bracket.percent.cssvar(opacity) }), { autocomplete: "shadow-(op|opacity)-" }], // inset ["shadow-inset", { "--un-shadow-inset": "inset" }] ]; const transformValues = [ "translate", "rotate", "scale" ]; const transformCpu = [ "translateX(var(--un-translate-x))", "translateY(var(--un-translate-y))", "translateZ(var(--un-translate-z))", "rotate(var(--un-rotate))", "rotateX(var(--un-rotate-x))", "rotateY(var(--un-rotate-y))", "rotateZ(var(--un-rotate-z))", "skewX(var(--un-skew-x))", "skewY(var(--un-skew-y))", "scaleX(var(--un-scale-x))", "scaleY(var(--un-scale-y))", "scaleZ(var(--un-scale-z))" ].join(" "); const transformGpu = [ "translate3d(var(--un-translate-x), var(--un-translate-y), var(--un-translate-z))", "rotate(var(--un-rotate))", "rotateX(var(--un-rotate-x))", "rotateY(var(--un-rotate-y))", "rotateZ(var(--un-rotate-z))", "skewX(var(--un-skew-x))", "skewY(var(--un-skew-y))", "scaleX(var(--un-scale-x))", "scaleY(var(--un-scale-y))", "scaleZ(var(--un-scale-z))" ].join(" "); const transformBase = { // transform "--un-rotate": 0, "--un-rotate-x": 0, "--un-rotate-y": 0, "--un-rotate-z": 0, "--un-scale-x": 1, "--un-scale-y": 1, "--un-scale-z": 1, "--un-skew-x": 0, "--un-skew-y": 0, "--un-translate-x": 0, "--un-translate-y": 0, "--un-translate-z": 0 }; const transforms = [ // origins [/^(?:transform-)?origin-(.+)$/, ([, s]) => ({ "transform-origin": utilities.positionMap[s] ?? utilities.h.bracket.cssvar(s) }), { autocomplete: [`transform-origin-(${Object.keys(utilities.positionMap).join("|")})`, `origin-(${Object.keys(utilities.positionMap).join("|")})`] }], // perspectives [/^(?:transform-)?perspect(?:ive)?-(.+)$/, ([, s]) => { const v = utilities.h.bracket.cssvar.px.numberWithUnit(s); if (v != null) { return { "-webkit-perspective": v, "perspective": v }; } }], // skip 1 & 2 letters shortcut [/^(?:transform-)?perspect(?:ive)?-origin-(.+)$/, ([, s]) => { const v = utilities.h.bracket.cssvar(s) ?? (s.length >= 3 ? utilities.positionMap[s] : void 0); if (v != null) { return { "-webkit-perspective-origin": v, "perspective-origin": v }; } }], // modifiers [/^(?:transform-)?translate-()(.+)$/, handleTranslate], [/^(?:transform-)?translate-([xyz])-(.+)$/, handleTranslate], [/^(?:transform-)?rotate-()(.+)$/, handleRotate], [/^(?:transform-)?rotate-([xyz])-(.+)$/, handleRotate], [/^(?:transform-)?skew-()(.+)$/, handleSkew], [/^(?:transform-)?skew-([xy])-(.+)$/, handleSkew, { autocomplete: ["transform-skew-(x|y)-", "skew-(x|y)-"] }], [/^(?:transform-)?scale-()(.+)$/, handleScale], [/^(?:transform-)?scale-([xyz])-(.+)$/, handleScale, { autocomplete: [`transform-(${transformValues.join("|")})-`, `transform-(${transformValues.join("|")})-(x|y|z)-`, `(${transformValues.join("|")})-`, `(${transformValues.join("|")})-(x|y|z)-`] }], // style [/^(?:transform-)?preserve-3d$/, () => ({ "transform-style": "preserve-3d" })], [/^(?:transform-)?preserve-flat$/, () => ({ "transform-style": "flat" })], // base ["transform", { transform: transformCpu }], ["transform-cpu", { transform: transformCpu }], ["transform-gpu", { transform: transformGpu }], ["transform-none", { transform: "none" }], ...utilities.makeGlobalStaticRules("transform") ]; function handleTranslate([, d, b], { theme }) { const v = theme.spacing?.[b] ?? utilities.h.bracket.cssvar.fraction.rem(b); if (v != null) { return [ ...utilities.xyzMap[d].map((i) => [`--un-translate${i}`, v]), ["transform", transformCpu] ]; } } function handleScale([, d, b]) { const v = utilities.h.bracket.cssvar.fraction.percent(b); if (v != null) { return [ ...utilities.xyzMap[d].map((i) => [`--un-scale${i}`, v]), ["transform", transformCpu] ]; } } function handleRotate([, d = "", b]) { const v = utilities.h.bracket.cssvar.degree(b); if (v != null) { if (d) { return { "--un-rotate": 0, [`--un-rotate-${d}`]: v, "transform": transformCpu }; } else { return { "--un-rotate-x": 0, "--un-rotate-y": 0, "--un-rotate-z": 0, "--un-rotate": v, "transform": transformCpu }; } } } function handleSkew([, d, b]) { const v = utilities.h.bracket.cssvar.degree(b); if (v != null) { return [ ...utilities.xyzMap[d].map((i) => [`--un-skew${i}`, v]), ["transform", transformCpu] ]; } } exports.appearances = appearances; exports.boxShadows = boxShadows; exports.boxShadowsBase = boxShadowsBase; exports.breaks = breaks; exports.contains = contains; exports.contentVisibility = contentVisibility; exports.contents = contents; exports.cursors = cursors; exports.displays = displays; exports.fontSmoothings = fontSmoothings; exports.fontStyles = fontStyles; exports.pointerEvents = pointerEvents; exports.resizes = resizes; exports.ringBase = ringBase; exports.rings = rings; exports.textOverflows = textOverflows; exports.textTransforms = textTransforms; exports.textWraps = textWraps; exports.transformBase = transformBase; exports.transforms = transforms; exports.userSelects = userSelects; exports.varEmpty = varEmpty; exports.whitespaces = whitespaces;