@bedrock-layout/center
Advanced tools
Comparing version 3.2.2 to 3.2.3
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@bedrock-layout/spacing-constants"),C=require("@bedrock-layout/type-utils"),d=require("react"),n=C.forwardRefWithAs(function({as:r,centerChildren:o,centerText:c,maxWidth:e,style:s,...i},l){const u=t.useTheme(),a=[c&&"center-text",o&&"center-children"].filter(y=>y).join(" "),p=s??{},f=r??"div";return d.createElement(f,{"data-bedrock-center":a,ref:l,style:{"--maxWidth":typeof e=="number"&&e>0?`${e}px`:t.getSizeValue(u,e)??e,...p},...i})});n.displayName="Center";exports.Center=n; | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@bedrock-layout/spacing-constants"),y=require("@bedrock-layout/type-utils"),C=require("react"),b=y.forwardRefWithAs(function({as:n,centerChildren:r,centerText:o,maxWidth:e,style:c,...s},i){const u=t.useTheme(),l=[o&&"center-text",r&&"center-children"].filter(p=>p).join(" "),a=c??{},f=n??"div";return C.createElement(f,{"data-bedrock-center":l,ref:i,style:{"--maxWidth":typeof e=="number"&&e>0?`${e}px`:t.getSizeValue(u,e)??e,...a},...s})});exports.Center=b; |
@@ -1,6 +0,6 @@ | ||
import { useTheme as a, getSizeValue as u } from "@bedrock-layout/spacing-constants"; | ||
import { useTheme as u, getSizeValue as a } from "@bedrock-layout/spacing-constants"; | ||
import { forwardRefWithAs as y } from "@bedrock-layout/type-utils"; | ||
import C from "react"; | ||
const d = y(function({ as: t, centerChildren: r, centerText: n, maxWidth: e, style: o, ...c }, s) { | ||
const f = a(), m = [ | ||
const g = y(function({ as: t, centerChildren: r, centerText: n, maxWidth: e, style: o, ...c }, s) { | ||
const f = u(), m = [ | ||
n && "center-text", | ||
@@ -15,3 +15,3 @@ r && "center-children" | ||
style: { | ||
"--maxWidth": typeof e == "number" && e > 0 ? `${e}px` : u(f, e) ?? e, | ||
"--maxWidth": typeof e == "number" && e > 0 ? `${e}px` : a(f, e) ?? e, | ||
...p | ||
@@ -23,5 +23,4 @@ }, | ||
}); | ||
d.displayName = "Center"; | ||
export { | ||
d as Center | ||
g as Center | ||
}; |
@@ -1,1 +0,1 @@ | ||
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("@bedrock-layout/spacing-constants"),require("@bedrock-layout/type-utils"),require("react")):typeof define=="function"&&define.amd?define(["exports","@bedrock-layout/spacing-constants","@bedrock-layout/type-utils","react"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.center={},e.spacingConstants,e.typeUtils,e.React))})(this,function(e,t,o,c){"use strict";const r=o.forwardRefWithAs(function({as:s,centerChildren:i,centerText:u,maxWidth:n,style:d,...f},p){const y=t.useTheme(),a=[u&&"center-text",i&&"center-children"].filter(m=>m).join(" "),l=d??{},b=s??"div";return c.createElement(b,{"data-bedrock-center":a,ref:p,style:{"--maxWidth":typeof n=="number"&&n>0?`${n}px`:t.getSizeValue(y,n)??n,...l},...f})});r.displayName="Center",e.Center=r,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}); | ||
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("@bedrock-layout/spacing-constants"),require("@bedrock-layout/type-utils"),require("react")):typeof define=="function"&&define.amd?define(["exports","@bedrock-layout/spacing-constants","@bedrock-layout/type-utils","react"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.center={},e.spacingConstants,e.typeUtils,e.React))})(this,function(e,t,r,o){"use strict";const c=r.forwardRefWithAs(function({as:s,centerChildren:i,centerText:u,maxWidth:n,style:f,...d},p){const y=t.useTheme(),a=[u&&"center-text",i&&"center-children"].filter(k=>k).join(" "),l=f??{},b=s??"div";return o.createElement(b,{"data-bedrock-center":a,ref:p,style:{"--maxWidth":typeof n=="number"&&n>0?`${n}px`:t.getSizeValue(y,n)??n,...l},...d})});e.Center=c,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}); |
{ | ||
"name": "@bedrock-layout/center", | ||
"version": "3.2.2", | ||
"version": "3.2.3", | ||
"description": "bedrock-layout center", | ||
@@ -38,4 +38,4 @@ "sideEffects": false, | ||
"dependencies": { | ||
"@bedrock-layout/spacing-constants": "^3.3.0", | ||
"@bedrock-layout/type-utils": "^0.1.3" | ||
"@bedrock-layout/spacing-constants": "^3.3.1", | ||
"@bedrock-layout/type-utils": "^0.1.4" | ||
}, | ||
@@ -63,3 +63,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "953659b3f9552ca0b6a4effb6254afb2307086aa" | ||
"gitHead": "a6d6b30100b03c24cab0c3a363c8c1f362f115d0" | ||
} |
7063
60