@fire-spark/rn-ui 0.0.1 → 0.0.3
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/dist/product-detail.d.ts +8 -1
- package/dist/product-detail.js +31 -1
- package/package.json +1 -11
package/dist/product-detail.d.ts
CHANGED
|
@@ -78,6 +78,13 @@ declare const ProductDetailOptionLabel: ({ className, ...rest }: ViewProps) => R
|
|
|
78
78
|
declare const ProductDetailOptionName: ({ className, ...rest }: TextProps) => React.JSX.Element;
|
|
79
79
|
declare const ProductDetailOptionPrice: ({ className, ...rest }: TextProps) => React.JSX.Element;
|
|
80
80
|
declare const ProductDetailOptionControl: ({ className, ...rest }: ViewProps) => React.JSX.Element;
|
|
81
|
+
declare const ProductDetailVariantGroup: ({ className, ...rest }: ViewProps) => React.JSX.Element;
|
|
82
|
+
declare const ProductDetailVariantOptions: ({ className, ...rest }: ViewProps) => React.JSX.Element;
|
|
83
|
+
type VariantOptionProps = PressableProps & {
|
|
84
|
+
selected?: boolean;
|
|
85
|
+
};
|
|
86
|
+
declare const ProductDetailVariantOption: (props: VariantOptionProps) => React.JSX.Element;
|
|
87
|
+
declare const ProductDetailVariantOptionImage: (props: UiImageProps) => React.JSX.Element;
|
|
81
88
|
declare const ProductDetailBack: ({ children, className, ...rest }: PressableProps) => React.JSX.Element;
|
|
82
89
|
declare const ProductDetailRelated: ({ className, ...rest }: ViewProps) => React.JSX.Element;
|
|
83
90
|
declare const ProductDetailRelatedTitle: ({ className, ...rest }: TextProps) => React.JSX.Element;
|
|
@@ -85,4 +92,4 @@ declare const ProductDetailRelatedGrid: ({ className, ...rest }: ViewProps) => R
|
|
|
85
92
|
declare const ProductDetailFooter: ({ className, ...rest }: ViewProps) => React.JSX.Element;
|
|
86
93
|
declare const ProductDetailSubmit: ({ children, className, ...rest }: PressableProps) => React.JSX.Element;
|
|
87
94
|
//#endregion
|
|
88
|
-
export { ProductDetail, ProductDetailActions, ProductDetailAnchorPrice, ProductDetailBack, ProductDetailBadge, ProductDetailBody, ProductDetailContextMeta, ProductDetailContextValue, ProductDetailDescription, ProductDetailDiscount, ProductDetailFooter, ProductDetailGroup, ProductDetailGroupDescription, ProductDetailGroupHeader, ProductDetailGroupHint, ProductDetailGroupRequired, ProductDetailGroupTitle, ProductDetailGroups, ProductDetailHeader, ProductDetailImage, ProductDetailImageSlot, ProductDetailLayout, ProductDetailMedia, ProductDetailMeta, ProductDetailOption, ProductDetailOptionControl, ProductDetailOptionLabel, ProductDetailOptionName, ProductDetailOptionPrice, ProductDetailOptions, ProductDetailPanel, ProductDetailPrice, ProductDetailProvider, ProductDetailProviderProps, ProductDetailQuantities, ProductDetailRelated, ProductDetailRelatedGrid, ProductDetailRelatedTitle, ProductDetailState, ProductDetailSubmit, ProductDetailTitle, useProductDetail };
|
|
95
|
+
export { ProductDetail, ProductDetailActions, ProductDetailAnchorPrice, ProductDetailBack, ProductDetailBadge, ProductDetailBody, ProductDetailContextMeta, ProductDetailContextValue, ProductDetailDescription, ProductDetailDiscount, ProductDetailFooter, ProductDetailGroup, ProductDetailGroupDescription, ProductDetailGroupHeader, ProductDetailGroupHint, ProductDetailGroupRequired, ProductDetailGroupTitle, ProductDetailGroups, ProductDetailHeader, ProductDetailImage, ProductDetailImageSlot, ProductDetailLayout, ProductDetailMedia, ProductDetailMeta, ProductDetailOption, ProductDetailOptionControl, ProductDetailOptionLabel, ProductDetailOptionName, ProductDetailOptionPrice, ProductDetailOptions, ProductDetailPanel, ProductDetailPrice, ProductDetailProvider, ProductDetailProviderProps, ProductDetailQuantities, ProductDetailRelated, ProductDetailRelatedGrid, ProductDetailRelatedTitle, ProductDetailState, ProductDetailSubmit, ProductDetailTitle, ProductDetailVariantGroup, ProductDetailVariantOption, ProductDetailVariantOptionImage, ProductDetailVariantOptions, useProductDetail };
|
package/dist/product-detail.js
CHANGED
|
@@ -140,6 +140,8 @@ const groupDescBase = "text-muted-foreground text-xs";
|
|
|
140
140
|
const optPriceBase = "text-muted-foreground text-sm tabular-nums";
|
|
141
141
|
const optControlBase = "shrink-0 flex-row items-center gap-2";
|
|
142
142
|
const metaBase = "flex-row flex-wrap items-center gap-2";
|
|
143
|
+
const variantOptionBase = `min-w-24 items-center gap-2 rounded-xl border px-3 py-3`;
|
|
144
|
+
const variantOptionOn = "border-foreground bg-muted";
|
|
143
145
|
const ProductDetail = view(rootBase);
|
|
144
146
|
const ProductDetailBody = (props) => {
|
|
145
147
|
const { className, ref, ...rest } = props;
|
|
@@ -175,6 +177,34 @@ const ProductDetailOptionLabel = view("min-w-0 flex-1");
|
|
|
175
177
|
const ProductDetailOptionName = text(optionNameBase);
|
|
176
178
|
const ProductDetailOptionPrice = text(optPriceBase);
|
|
177
179
|
const ProductDetailOptionControl = view(optControlBase);
|
|
180
|
+
const ProductDetailVariantGroup = view("flex-col gap-3");
|
|
181
|
+
const ProductDetailVariantOptions = view("flex-row flex-wrap gap-2");
|
|
182
|
+
const ProductDetailVariantOption = (props) => {
|
|
183
|
+
const { selected = false, disabled, className, children, ...rest } = props;
|
|
184
|
+
const optionClass = cn(variantOptionBase, selected ? variantOptionOn : "border-border", disabled ? "opacity-50" : "", className);
|
|
185
|
+
const p1 = {
|
|
186
|
+
selected,
|
|
187
|
+
disabled: !!disabled,
|
|
188
|
+
checked: selected
|
|
189
|
+
};
|
|
190
|
+
let content = children;
|
|
191
|
+
if (typeof children === "string" || typeof children === "number") content = /* @__PURE__ */ jsx(Text, {
|
|
192
|
+
className: optionNameBase,
|
|
193
|
+
children
|
|
194
|
+
});
|
|
195
|
+
return /* @__PURE__ */ jsx(Pressable, {
|
|
196
|
+
role: "radio",
|
|
197
|
+
accessibilityState: p1,
|
|
198
|
+
disabled,
|
|
199
|
+
className: optionClass,
|
|
200
|
+
...rest,
|
|
201
|
+
children: content
|
|
202
|
+
});
|
|
203
|
+
};
|
|
204
|
+
const ProductDetailVariantOptionImage = (props) => /* @__PURE__ */ jsx(View, {
|
|
205
|
+
className: "size-14 overflow-hidden rounded-lg",
|
|
206
|
+
children: /* @__PURE__ */ jsx(UiImage, { ...props })
|
|
207
|
+
});
|
|
178
208
|
const ProductDetailBack = button(backBase, "text-muted-foreground");
|
|
179
209
|
const ProductDetailRelated = view(relatedBase);
|
|
180
210
|
const ProductDetailRelatedTitle = text(relatedTitleBase);
|
|
@@ -182,4 +212,4 @@ const ProductDetailRelatedGrid = view("flex-row flex-wrap gap-3");
|
|
|
182
212
|
const ProductDetailFooter = view(footerBase);
|
|
183
213
|
const ProductDetailSubmit = button(submitBase, submitLabel);
|
|
184
214
|
//#endregion
|
|
185
|
-
export { ProductDetail, ProductDetailAnchorPrice, ProductDetailBack, ProductDetailBadge, ProductDetailBody, ProductDetailDescription, ProductDetailDiscount, ProductDetailFooter, ProductDetailGroup, ProductDetailGroupDescription, ProductDetailGroupHeader, ProductDetailGroupHint, ProductDetailGroupRequired, ProductDetailGroupTitle, ProductDetailGroups, ProductDetailHeader, ProductDetailImage, ProductDetailImageSlot, ProductDetailLayout, ProductDetailMedia, ProductDetailMeta, ProductDetailOption, ProductDetailOptionControl, ProductDetailOptionLabel, ProductDetailOptionName, ProductDetailOptionPrice, ProductDetailOptions, ProductDetailPanel, ProductDetailPrice, ProductDetailProvider, ProductDetailRelated, ProductDetailRelatedGrid, ProductDetailRelatedTitle, ProductDetailSubmit, ProductDetailTitle, useProductDetail };
|
|
215
|
+
export { ProductDetail, ProductDetailAnchorPrice, ProductDetailBack, ProductDetailBadge, ProductDetailBody, ProductDetailDescription, ProductDetailDiscount, ProductDetailFooter, ProductDetailGroup, ProductDetailGroupDescription, ProductDetailGroupHeader, ProductDetailGroupHint, ProductDetailGroupRequired, ProductDetailGroupTitle, ProductDetailGroups, ProductDetailHeader, ProductDetailImage, ProductDetailImageSlot, ProductDetailLayout, ProductDetailMedia, ProductDetailMeta, ProductDetailOption, ProductDetailOptionControl, ProductDetailOptionLabel, ProductDetailOptionName, ProductDetailOptionPrice, ProductDetailOptions, ProductDetailPanel, ProductDetailPrice, ProductDetailProvider, ProductDetailRelated, ProductDetailRelatedGrid, ProductDetailRelatedTitle, ProductDetailSubmit, ProductDetailTitle, ProductDetailVariantGroup, ProductDetailVariantOption, ProductDetailVariantOptionImage, ProductDetailVariantOptions, useProductDetail };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fire-spark/rn-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Fire Spark React Native UI components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -11,61 +11,51 @@
|
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
-
"development": "./src/index.ts",
|
|
15
14
|
"types": "./dist/index.d.ts",
|
|
16
15
|
"import": "./dist/index.js",
|
|
17
16
|
"default": "./dist/index.js"
|
|
18
17
|
},
|
|
19
18
|
"./button": {
|
|
20
|
-
"development": "./src/button.tsx",
|
|
21
19
|
"types": "./dist/button.d.ts",
|
|
22
20
|
"import": "./dist/button.js",
|
|
23
21
|
"default": "./dist/button.js"
|
|
24
22
|
},
|
|
25
23
|
"./category": {
|
|
26
|
-
"development": "./src/category.tsx",
|
|
27
24
|
"types": "./dist/category.d.ts",
|
|
28
25
|
"import": "./dist/category.js",
|
|
29
26
|
"default": "./dist/category.js"
|
|
30
27
|
},
|
|
31
28
|
"./menu": {
|
|
32
|
-
"development": "./src/menu.tsx",
|
|
33
29
|
"types": "./dist/menu.d.ts",
|
|
34
30
|
"import": "./dist/menu.js",
|
|
35
31
|
"default": "./dist/menu.js"
|
|
36
32
|
},
|
|
37
33
|
"./category-nav": {
|
|
38
|
-
"development": "./src/category-nav.tsx",
|
|
39
34
|
"types": "./dist/category-nav.d.ts",
|
|
40
35
|
"import": "./dist/category-nav.js",
|
|
41
36
|
"default": "./dist/category-nav.js"
|
|
42
37
|
},
|
|
43
38
|
"./use-active-category": {
|
|
44
|
-
"development": "./src/use-active-category.ts",
|
|
45
39
|
"types": "./dist/use-active-category.d.ts",
|
|
46
40
|
"import": "./dist/use-active-category.js",
|
|
47
41
|
"default": "./dist/use-active-category.js"
|
|
48
42
|
},
|
|
49
43
|
"./product-card": {
|
|
50
|
-
"development": "./src/product-card.tsx",
|
|
51
44
|
"types": "./dist/product-card.d.ts",
|
|
52
45
|
"import": "./dist/product-card.js",
|
|
53
46
|
"default": "./dist/product-card.js"
|
|
54
47
|
},
|
|
55
48
|
"./product-detail": {
|
|
56
|
-
"development": "./src/product-detail.tsx",
|
|
57
49
|
"types": "./dist/product-detail.d.ts",
|
|
58
50
|
"import": "./dist/product-detail.js",
|
|
59
51
|
"default": "./dist/product-detail.js"
|
|
60
52
|
},
|
|
61
53
|
"./cart": {
|
|
62
|
-
"development": "./src/cart.tsx",
|
|
63
54
|
"types": "./dist/cart.d.ts",
|
|
64
55
|
"import": "./dist/cart.js",
|
|
65
56
|
"default": "./dist/cart.js"
|
|
66
57
|
},
|
|
67
58
|
"./checkout": {
|
|
68
|
-
"development": "./src/checkout.tsx",
|
|
69
59
|
"types": "./dist/checkout.d.ts",
|
|
70
60
|
"import": "./dist/checkout.js",
|
|
71
61
|
"default": "./dist/checkout.js"
|