@propeller-commerce/propeller-v2-react-ui 0.4.6 → 0.4.7
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.
- package/CHANGELOG.md +25 -0
- package/dist/index.cjs +36 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +36 -12
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4004,8 +4004,8 @@ function AddToCart(rawProps) {
|
|
|
4004
4004
|
className: `propeller-add-to-cart ${props.className || ""}`,
|
|
4005
4005
|
"data-loading": loading ? "true" : "false",
|
|
4006
4006
|
children: [
|
|
4007
|
-
/* @__PURE__ */ jsxs("div", { className: "propeller-add-to-cart__controls flex items-center gap-2 w-full", children: [
|
|
4008
|
-
props.allowIncrDecr !== false ? /* @__PURE__ */ jsxs("div", { className: "propeller-add-to-cart__stepper flex items-center border border-input rounded-control bg-card h-10", children: [
|
|
4007
|
+
/* @__PURE__ */ jsxs("div", { className: "propeller-add-to-cart__controls flex flex-wrap items-center gap-2 w-full md:flex-nowrap", children: [
|
|
4008
|
+
props.allowIncrDecr !== false ? /* @__PURE__ */ jsxs("div", { className: "propeller-add-to-cart__stepper flex items-center border border-input rounded-control bg-card h-10 w-full md:w-auto", children: [
|
|
4009
4009
|
/* @__PURE__ */ jsxs(
|
|
4010
4010
|
"button",
|
|
4011
4011
|
{
|
|
@@ -4024,7 +4024,7 @@ function AddToCart(rawProps) {
|
|
|
4024
4024
|
"input",
|
|
4025
4025
|
{
|
|
4026
4026
|
type: "number",
|
|
4027
|
-
className: "propeller-add-to-cart__quantity w-12 text-center text-sm bg-transparent border-none focus:ring-0 focus:outline-none h-full [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",
|
|
4027
|
+
className: "propeller-add-to-cart__quantity flex-1 md:flex-none md:w-12 text-center text-sm bg-transparent border-none focus:ring-0 focus:outline-none h-full [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",
|
|
4028
4028
|
min: getMinQuantity(props.product),
|
|
4029
4029
|
step: getStep(props.product),
|
|
4030
4030
|
value: quantity,
|
|
@@ -4057,7 +4057,7 @@ function AddToCart(rawProps) {
|
|
|
4057
4057
|
"input",
|
|
4058
4058
|
{
|
|
4059
4059
|
type: "number",
|
|
4060
|
-
className: "propeller-add-to-cart__quantity w-16 h-10 text-center text-sm border border-input rounded-control focus:ring-2 focus:ring-secondary focus:border-transparent [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",
|
|
4060
|
+
className: "propeller-add-to-cart__quantity w-full md:w-16 h-10 text-center text-sm border border-input rounded-control focus:ring-2 focus:ring-secondary focus:border-transparent [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",
|
|
4061
4061
|
min: getMinQuantity(props.product),
|
|
4062
4062
|
step: getStep(props.product),
|
|
4063
4063
|
value: quantity,
|
|
@@ -4075,10 +4075,28 @@ function AddToCart(rawProps) {
|
|
|
4075
4075
|
"button",
|
|
4076
4076
|
{
|
|
4077
4077
|
type: "button",
|
|
4078
|
-
className: "propeller-add-to-cart__submit flex-1 inline-flex justify-center items-center h-10 px-6 border border-transparent text-sm font-medium rounded-control text-secondary-foreground bg-secondary hover:bg-secondary/90 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-secondary disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
4078
|
+
className: "propeller-add-to-cart__submit flex-1 basis-full md:basis-auto inline-flex justify-center items-center gap-2 h-10 px-6 border border-transparent text-sm font-medium rounded-control text-secondary-foreground bg-secondary hover:bg-secondary/90 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-secondary disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
4079
4079
|
onClick: () => handleAddToCart(),
|
|
4080
4080
|
disabled: loading,
|
|
4081
4081
|
children: [
|
|
4082
|
+
/* @__PURE__ */ jsxs(
|
|
4083
|
+
"svg",
|
|
4084
|
+
{
|
|
4085
|
+
className: "propeller-add-to-cart__icon w-[1.1em] h-[1.1em] flex-shrink-0",
|
|
4086
|
+
viewBox: "0 0 24 24",
|
|
4087
|
+
fill: "none",
|
|
4088
|
+
stroke: "currentColor",
|
|
4089
|
+
strokeWidth: 2,
|
|
4090
|
+
strokeLinecap: "round",
|
|
4091
|
+
strokeLinejoin: "round",
|
|
4092
|
+
"aria-hidden": "true",
|
|
4093
|
+
children: [
|
|
4094
|
+
/* @__PURE__ */ jsx("circle", { cx: "8", cy: "21", r: "1" }),
|
|
4095
|
+
/* @__PURE__ */ jsx("circle", { cx: "19", cy: "21", r: "1" }),
|
|
4096
|
+
/* @__PURE__ */ jsx("path", { d: "M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12" })
|
|
4097
|
+
]
|
|
4098
|
+
}
|
|
4099
|
+
),
|
|
4082
4100
|
loading ? /* @__PURE__ */ jsx(Fragment, { children: getLabel(props.labels, "adding", "Adding...") }) : null,
|
|
4083
4101
|
!loading ? /* @__PURE__ */ jsx(Fragment, { children: getLabel(props.labels, "add", "Add") }) : null
|
|
4084
4102
|
]
|
|
@@ -13242,22 +13260,28 @@ function ProductCardRoot(rawProps) {
|
|
|
13242
13260
|
props.showManufacturer && manufacturer ? /* @__PURE__ */ jsx(ProductCardManufacturer, {}) : null,
|
|
13243
13261
|
props.showShortDescription && shortDescription ? /* @__PURE__ */ jsx(ProductCardShortDescription, {}) : null
|
|
13244
13262
|
] }) }),
|
|
13245
|
-
/* @__PURE__ */ jsxs("div", { className: "propeller-product-card__footer w-full md:w-auto flex items-center gap-3 px-4 py-2 md:py-0 border-t md:border-t-0 border-border-subtle", children: [
|
|
13246
|
-
|
|
13247
|
-
|
|
13248
|
-
|
|
13263
|
+
/* @__PURE__ */ jsxs("div", { className: "propeller-product-card__footer w-full md:w-auto flex flex-col gap-2 md:flex-row md:items-center md:gap-3 px-4 py-2 md:py-0 border-t md:border-t-0 border-border-subtle", children: [
|
|
13264
|
+
/* @__PURE__ */ jsxs("div", { className: "propeller-product-card__footer-meta flex items-center justify-between gap-3 md:contents", children: [
|
|
13265
|
+
props.showStock && !!product.inventory ? /* @__PURE__ */ jsx(ProductCardStock, {}) : null,
|
|
13266
|
+
props.showPrice !== false && !!product?.price ? /* @__PURE__ */ jsx(ProductCardPrice, { priceSize: "text-sm" }) : null
|
|
13267
|
+
] }),
|
|
13268
|
+
props.allowAddToCart !== false ? /* @__PURE__ */ jsx("div", { className: "propeller-product-card__cta w-full md:w-auto md:flex-shrink-0 md:ml-auto", children: /* @__PURE__ */ jsx(ProductCardAddToCart, {}) }) : null
|
|
13249
13269
|
] })
|
|
13250
13270
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
13251
13271
|
/* @__PURE__ */ jsxs("div", { className: "propeller-product-card__body flex flex-1 flex-col gap-1.5 p-3 sm:gap-2 sm:p-4", children: [
|
|
13252
13272
|
props.showSku !== false && sku ? /* @__PURE__ */ jsx(ProductCardSku, {}) : null,
|
|
13253
13273
|
props.showName !== false ? /* @__PURE__ */ jsx(ProductCardName, { linkable: true }) : null,
|
|
13254
13274
|
textLabelValues.length > 0 ? /* @__PURE__ */ jsx(ProductCardTextLabels, {}) : null,
|
|
13255
|
-
props.showStock && !!product.inventory ? /* @__PURE__ */ jsx(ProductCardStock, {}) : null,
|
|
13275
|
+
props.showStock && !!product.inventory ? /* @__PURE__ */ jsx("div", { className: "hidden md:block", children: /* @__PURE__ */ jsx(ProductCardStock, {}) }) : null,
|
|
13256
13276
|
props.showManufacturer && manufacturer ? /* @__PURE__ */ jsx(ProductCardManufacturer, {}) : null,
|
|
13257
13277
|
props.showShortDescription && shortDescription ? /* @__PURE__ */ jsx(ProductCardShortDescription, {}) : null,
|
|
13258
|
-
props.showPrice !== false && !!product?.price ? /* @__PURE__ */ jsx("div", { className: "propeller-product-card__price mt-auto pt-1", children: /* @__PURE__ */ jsx(ProductCardPrice, { priceSize: "text-base sm:text-lg" }) }) : null
|
|
13278
|
+
props.showPrice !== false && !!product?.price ? /* @__PURE__ */ jsx("div", { className: "propeller-product-card__price mt-auto pt-1 hidden md:block", children: /* @__PURE__ */ jsx(ProductCardPrice, { priceSize: "text-base sm:text-lg" }) }) : null
|
|
13259
13279
|
] }),
|
|
13260
|
-
props.
|
|
13280
|
+
props.showStock && !!product.inventory || props.showPrice !== false && !!product?.price ? /* @__PURE__ */ jsxs("div", { className: "propeller-product-card__footer-meta flex items-center justify-between gap-2 px-3 pt-1 sm:px-4 md:hidden", children: [
|
|
13281
|
+
props.showStock && !!product.inventory ? /* @__PURE__ */ jsx(ProductCardStock, {}) : null,
|
|
13282
|
+
props.showPrice !== false && !!product?.price ? /* @__PURE__ */ jsx(ProductCardPrice, { priceSize: "text-base" }) : null
|
|
13283
|
+
] }) : null,
|
|
13284
|
+
props.allowAddToCart !== false ? /* @__PURE__ */ jsx("div", { className: "propeller-product-card__cta px-3 pb-3 pt-2 sm:px-4 sm:pb-4", children: /* @__PURE__ */ jsx(ProductCardAddToCart, {}) }) : null
|
|
13261
13285
|
] })
|
|
13262
13286
|
]
|
|
13263
13287
|
}
|