@caseparts-org/caseblocks 0.0.90 → 0.0.92
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/Cart.module-9txlotpz.js +18 -0
- package/dist/assets/Cart.css +1 -1
- package/dist/assets/Icon.css +1 -1
- package/dist/assets/Popover.css +1 -0
- package/dist/assets/SlideInPanel.css +1 -0
- package/dist/assets/Tooltip.css +1 -1
- package/dist/assets/buttonClassName.css +1 -1
- package/dist/atoms/Button/buttonClassName.js +25 -25
- package/dist/atoms/Icon/Icon.d.ts +3 -1
- package/dist/atoms/Icon/Icon.js +48 -32
- package/dist/atoms/Input/Input.js +4 -4
- package/dist/atoms/Popover/Popover.d.ts +14 -0
- package/dist/atoms/Popover/Popover.js +110 -0
- package/dist/atoms/Popover/Popover.stories.d.ts +66 -0
- package/dist/atoms/Popover/Popover.stories.js +207 -0
- package/dist/atoms/SlideInPanel/SlideInPanel.d.ts +18 -0
- package/dist/atoms/SlideInPanel/SlideInPanel.js +99 -0
- package/dist/atoms/SlideInPanel/SlideInPanel.stories.d.ts +10 -0
- package/dist/atoms/SlideInPanel/SlideInPanel.stories.js +117 -0
- package/dist/atoms/Tooltip/Tooltip.d.ts +16 -0
- package/dist/atoms/Tooltip/Tooltip.js +137 -0
- package/dist/{molecules → atoms}/Tooltip/Tooltip.stories.d.ts +8 -26
- package/dist/atoms/Tooltip/Tooltip.stories.js +209 -0
- package/dist/index-B4KbmMH3.js +383 -0
- package/dist/main-client.d.ts +5 -1
- package/dist/main-client.js +49 -45
- package/dist/molecules/AddToCart/AddToCart.js +18 -18
- package/dist/molecules/Cart/Cart.d.ts +10 -11
- package/dist/molecules/Cart/Cart.js +42 -93
- package/dist/molecules/Cart/Cart.stories.js +63 -45
- package/dist/molecules/Cart/CartSlideInPanel.d.ts +15 -0
- package/dist/molecules/Cart/CartSlideInPanel.js +97 -0
- package/dist/molecules/CategoryNav/CategoryNav.js +2 -2
- package/dist/molecules/StatefulButton/StatefulButton.stories.js +4 -4
- package/dist/molecules/ToggleView/ToggleView.js +6 -6
- package/dist/organisms/Carousel/Carousel.js +44 -44
- package/dist/organisms/Footer/Footer.js +1 -1
- package/dist/organisms/MainNav/MainNav.d.ts +13 -15
- package/dist/organisms/MainNav/MainNav.js +78 -84
- package/dist/organisms/MainNav/MainNav.stories.d.ts +1 -2
- package/dist/organisms/MainNav/MainNav.stories.js +94 -77
- package/package.json +28 -7
- package/dist/molecules/Cart/Cart.stories.d.ts +0 -15
- package/dist/molecules/Tooltip/Tooltip.d.ts +0 -12
- package/dist/molecules/Tooltip/Tooltip.js +0 -2321
- package/dist/molecules/Tooltip/Tooltip.stories.js +0 -202
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { jsxs as u, Fragment as s, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useState as b } from "react";
|
|
3
|
+
import { MainNav as d } from "./MainNav.js";
|
|
4
|
+
import { CartSlideInPanel as m } from "../../molecules/Cart/CartSlideInPanel.js";
|
|
5
|
+
const g = {
|
|
3
6
|
title: "Case Parts/Organisms/MainNav",
|
|
4
|
-
component:
|
|
7
|
+
component: d,
|
|
5
8
|
parameters: {
|
|
6
9
|
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
|
|
7
10
|
layout: "fullscreen"
|
|
8
11
|
}
|
|
9
12
|
// tags: ["autodocs"],
|
|
10
|
-
},
|
|
13
|
+
}, l = [
|
|
11
14
|
{
|
|
12
15
|
id: 0,
|
|
13
16
|
label: "Shop by Brands",
|
|
@@ -24,7 +27,12 @@ const r = {
|
|
|
24
27
|
id: 1,
|
|
25
28
|
label: "Gaskets",
|
|
26
29
|
route: "#",
|
|
27
|
-
children: [
|
|
30
|
+
children: [
|
|
31
|
+
{ id: 25, label: "Sponge", route: "/anthony" },
|
|
32
|
+
{ id: 26, label: "Magnetic", route: "/beverage" },
|
|
33
|
+
{ id: 27, label: "Compression", route: "/continental" },
|
|
34
|
+
{ id: 28, label: "Door Sweep", route: "/delfield" }
|
|
35
|
+
]
|
|
28
36
|
},
|
|
29
37
|
{
|
|
30
38
|
id: 2,
|
|
@@ -80,29 +88,59 @@ const r = {
|
|
|
80
88
|
route: "#",
|
|
81
89
|
children: []
|
|
82
90
|
}
|
|
83
|
-
],
|
|
91
|
+
], t = "https://m.media-amazon.com/images/I/216+JEttsYL._UF1000,1000_QL80_.jpg", r = {
|
|
84
92
|
items: [
|
|
85
|
-
{ id: 1, itemId: "1094-01", description: "Kason Door Closer - Flush", price: "$99.99", quantity: 1, imageUrl:
|
|
86
|
-
{ id: 2, itemId: "810810", description: "True Door Gasket", price: "$99.99", quantity: 1, imageUrl:
|
|
87
|
-
{ id: 3, itemId: "MG064", description: '36" x 79" 3-Sided Dart-to-Dart Gasket', price: "$99.99", quantity: 1, imageUrl:
|
|
88
|
-
{ id: 4, itemId: "MG064-B", description: '36" x 79" 3-Sided Dart-to-Dart Gasket', price: "$99.99", quantity: 1, imageUrl:
|
|
89
|
-
{ id: 5, itemId: "Warmer Wire", description: '228" 7.0 OHMS 115V', price: "$99.99", quantity: 1, imageUrl:
|
|
90
|
-
{ id: 6, itemId: "810803", description: "True Door Gasket", price: "$99.99", quantity: 1, imageUrl:
|
|
91
|
-
{ id: 7, itemId: "ABG-12114-PF", description: "Adhesive Sponge Gasket 1/4", price: "$99.99", quantity: 10, imageUrl:
|
|
92
|
-
{ id: 8, itemId: "ABG-12138-PF", description: "Adhesive Sponge Gasket 3/8", price: "$99.99", quantity: 10, imageUrl:
|
|
93
|
-
{ id: 9, itemId: "1094-C1", description: "Kason Door Closer - Flush", price: "$99.99", quantity: 1, imageUrl:
|
|
94
|
-
{ id: 10, itemId: "1094-02", description: "Kason Door Closer - Offset", price: "$99.99", quantity: 1, imageUrl:
|
|
95
|
-
{ id: 11, itemId: "1092-01", description: "Kason Door Closer - Flush", price: "$99.99", quantity: 1, imageUrl:
|
|
96
|
-
{ id: 12, itemId: "1092-02", description: "Kason Door Closer - Offset", price: "$99.99", quantity: 1, imageUrl:
|
|
93
|
+
{ id: 1, itemId: "1094-01", description: "Kason Door Closer - Flush", price: "$99.99", quantity: 1, imageUrl: t, availability: "In Stock", availabilityId: "available" },
|
|
94
|
+
{ id: 2, itemId: "810810", description: "True Door Gasket", price: "$99.99", quantity: 1, imageUrl: t, availability: "In Stock", availabilityId: "available" },
|
|
95
|
+
{ id: 3, itemId: "MG064", description: '36" x 79" 3-Sided Dart-to-Dart Gasket', price: "$99.99", quantity: 1, imageUrl: t, availability: "In Stock", availabilityId: "available" },
|
|
96
|
+
{ id: 4, itemId: "MG064-B", description: '36" x 79" 3-Sided Dart-to-Dart Gasket', price: "$99.99", quantity: 1, imageUrl: t, availability: "In Stock", availabilityId: "available" },
|
|
97
|
+
{ id: 5, itemId: "Warmer Wire", description: '228" 7.0 OHMS 115V', price: "$99.99", quantity: 1, imageUrl: t, availability: "", availabilityId: "available" },
|
|
98
|
+
{ id: 6, itemId: "810803", description: "True Door Gasket", price: "$99.99", quantity: 1, imageUrl: t, availability: "In Stock", availabilityId: "available" },
|
|
99
|
+
{ id: 7, itemId: "ABG-12114-PF", description: "Adhesive Sponge Gasket 1/4", price: "$99.99", quantity: 10, imageUrl: t, availability: "In Stock", availabilityId: "available" },
|
|
100
|
+
{ id: 8, itemId: "ABG-12138-PF", description: "Adhesive Sponge Gasket 3/8", price: "$99.99", quantity: 10, imageUrl: t, availability: "In Stock", availabilityId: "available" },
|
|
101
|
+
{ id: 9, itemId: "1094-C1", description: "Kason Door Closer - Flush", price: "$99.99", quantity: 1, imageUrl: t, availability: "In Stock", availabilityId: "available" },
|
|
102
|
+
{ id: 10, itemId: "1094-02", description: "Kason Door Closer - Offset", price: "$99.99", quantity: 1, imageUrl: t, availability: "In Stock", availabilityId: "available" },
|
|
103
|
+
{ id: 11, itemId: "1092-01", description: "Kason Door Closer - Flush", price: "$99.99", quantity: 1, imageUrl: t, availability: "In Stock", availabilityId: "available" },
|
|
104
|
+
{ id: 12, itemId: "1092-02", description: "Kason Door Closer - Offset", price: "$99.99", quantity: 1, imageUrl: t, availability: "In Stock", availabilityId: "available" }
|
|
97
105
|
]
|
|
98
|
-
}
|
|
106
|
+
};
|
|
107
|
+
function h(e) {
|
|
108
|
+
return `$${e.items.reduce(
|
|
109
|
+
(a, i) => a + (parseFloat(i.price.replace(/[^0-9.]/g, "")) || 0) * i.quantity,
|
|
110
|
+
0
|
|
111
|
+
).toFixed(2)}`;
|
|
112
|
+
}
|
|
113
|
+
const n = (e) => {
|
|
114
|
+
const [o, a] = b(!1);
|
|
115
|
+
return /* @__PURE__ */ u(s, { children: [
|
|
116
|
+
/* @__PURE__ */ c(
|
|
117
|
+
d,
|
|
118
|
+
{
|
|
119
|
+
...e,
|
|
120
|
+
open: o,
|
|
121
|
+
onCartClick: () => a((i) => !i)
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
/* @__PURE__ */ c(
|
|
125
|
+
m,
|
|
126
|
+
{
|
|
127
|
+
open: o,
|
|
128
|
+
onClose: () => a(!1),
|
|
129
|
+
cart: e.cart,
|
|
130
|
+
subtotal: h(e.cart),
|
|
131
|
+
itemPriceLabel: "List Price",
|
|
132
|
+
contactHref: e.contactRoute,
|
|
133
|
+
contactLinkBehavior: "new-tab",
|
|
134
|
+
onItemQtyChange: () => alert("Qty Change"),
|
|
135
|
+
onItemDelete: () => alert("Delete"),
|
|
136
|
+
onCheckout: e.onCheckout
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
] });
|
|
140
|
+
}, C = {
|
|
99
141
|
args: {
|
|
100
|
-
account: {
|
|
101
|
-
|
|
102
|
-
initials: "RS",
|
|
103
|
-
number: "123456789012"
|
|
104
|
-
},
|
|
105
|
-
cart: i,
|
|
142
|
+
account: { name: "Ringo", initials: "RS", number: "123456789012" },
|
|
143
|
+
cart: r,
|
|
106
144
|
homeRoute: "/",
|
|
107
145
|
customPartsRoute: "/custom",
|
|
108
146
|
accountRoute: "/account",
|
|
@@ -111,33 +149,24 @@ const r = {
|
|
|
111
149
|
aboutUsRoute: "/about",
|
|
112
150
|
contactRoute: "/contact",
|
|
113
151
|
onLoginClick: () => {
|
|
114
|
-
alert("Login
|
|
152
|
+
alert("Login");
|
|
115
153
|
},
|
|
116
154
|
onCheckout: () => {
|
|
117
155
|
alert("Checkout");
|
|
118
156
|
},
|
|
119
|
-
|
|
120
|
-
alert(
|
|
121
|
-
},
|
|
122
|
-
onItemEdit: () => {
|
|
123
|
-
alert("Delete");
|
|
157
|
+
onSearch: (e) => {
|
|
158
|
+
alert(`Search ${e}`);
|
|
124
159
|
},
|
|
125
|
-
|
|
126
|
-
alert("Delete");
|
|
160
|
+
onCartClick: () => {
|
|
127
161
|
},
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}, c = {
|
|
162
|
+
// placeholder required by component
|
|
163
|
+
categories: l
|
|
164
|
+
},
|
|
165
|
+
render: n
|
|
166
|
+
}, k = {
|
|
134
167
|
args: {
|
|
135
|
-
account: {
|
|
136
|
-
|
|
137
|
-
initials: "RS",
|
|
138
|
-
number: "123456789012"
|
|
139
|
-
},
|
|
140
|
-
cart: i,
|
|
168
|
+
account: { name: "Ringo", initials: "RS", number: "123456789012" },
|
|
169
|
+
cart: r,
|
|
141
170
|
homeRoute: "/",
|
|
142
171
|
customPartsRoute: "/custom",
|
|
143
172
|
accountRoute: "/account",
|
|
@@ -146,28 +175,22 @@ const r = {
|
|
|
146
175
|
aboutUsRoute: "/about",
|
|
147
176
|
contactRoute: "/contact",
|
|
148
177
|
onLoginClick: () => {
|
|
149
|
-
alert("Login
|
|
178
|
+
alert("Login");
|
|
150
179
|
},
|
|
151
180
|
onCheckout: () => {
|
|
152
181
|
alert("Checkout");
|
|
153
182
|
},
|
|
154
|
-
|
|
155
|
-
alert(
|
|
183
|
+
onSearch: (e) => {
|
|
184
|
+
alert(`Search ${e}`);
|
|
156
185
|
},
|
|
157
|
-
|
|
158
|
-
alert("Delete");
|
|
186
|
+
onCartClick: () => {
|
|
159
187
|
},
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
alert(`Search ${a}`);
|
|
165
|
-
},
|
|
166
|
-
categories: t
|
|
167
|
-
}
|
|
168
|
-
}, d = {
|
|
188
|
+
categories: l
|
|
189
|
+
},
|
|
190
|
+
render: n
|
|
191
|
+
}, S = {
|
|
169
192
|
args: {
|
|
170
|
-
cart:
|
|
193
|
+
cart: r,
|
|
171
194
|
homeRoute: "/",
|
|
172
195
|
customPartsRoute: "/custom",
|
|
173
196
|
accountRoute: "/account",
|
|
@@ -176,29 +199,23 @@ const r = {
|
|
|
176
199
|
aboutUsRoute: "/about",
|
|
177
200
|
contactRoute: "/contact",
|
|
178
201
|
onLoginClick: () => {
|
|
179
|
-
alert("Login
|
|
202
|
+
alert("Login");
|
|
180
203
|
},
|
|
181
204
|
onCheckout: () => {
|
|
182
205
|
alert("Checkout");
|
|
183
206
|
},
|
|
184
|
-
|
|
185
|
-
alert(
|
|
207
|
+
onSearch: (e) => {
|
|
208
|
+
alert(`Search ${e}`);
|
|
186
209
|
},
|
|
187
|
-
|
|
188
|
-
alert("Delete");
|
|
210
|
+
onCartClick: () => {
|
|
189
211
|
},
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
onSearch: (a) => {
|
|
194
|
-
alert(`Search ${a}`);
|
|
195
|
-
},
|
|
196
|
-
categories: t
|
|
197
|
-
}
|
|
212
|
+
categories: l
|
|
213
|
+
},
|
|
214
|
+
render: n
|
|
198
215
|
};
|
|
199
216
|
export {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
217
|
+
C as Authenticated,
|
|
218
|
+
S as Unauthenticated,
|
|
219
|
+
k as WithCartItems,
|
|
220
|
+
g as default
|
|
204
221
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caseparts-org/caseblocks",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.92",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "dist/main.js",
|
|
7
7
|
"types": "dist/main.d.ts",
|
|
@@ -29,15 +29,14 @@
|
|
|
29
29
|
"preview": "vite preview",
|
|
30
30
|
"storybook": "storybook dev -p 6006",
|
|
31
31
|
"build-storybook": "storybook build",
|
|
32
|
-
"prepare": "husky"
|
|
32
|
+
"prepare": "husky",
|
|
33
|
+
"size:components": "size-limit"
|
|
33
34
|
},
|
|
34
35
|
"dependencies": {
|
|
35
36
|
"@fontsource-variable/roboto-condensed": "^5.1.1",
|
|
36
37
|
"@fontsource/roboto": "^5.1.0",
|
|
37
|
-
"@tippyjs/react": "^4.2.6",
|
|
38
38
|
"clsx": "^2.1.1",
|
|
39
|
-
"csstype": "^3.1.3"
|
|
40
|
-
"reactjs-popup": "^2.0.6"
|
|
39
|
+
"csstype": "^3.1.3"
|
|
41
40
|
},
|
|
42
41
|
"peerDependencies": {
|
|
43
42
|
"embla-carousel-autoplay": "^8.0.0",
|
|
@@ -75,7 +74,9 @@
|
|
|
75
74
|
"vite": "^5.4.10",
|
|
76
75
|
"vite-plugin-dts": "^4.3.0",
|
|
77
76
|
"vite-plugin-lib-inject-css": "^2.1.1",
|
|
78
|
-
"vite-plugin-static-copy": "^2.3.1"
|
|
77
|
+
"vite-plugin-static-copy": "^2.3.1",
|
|
78
|
+
"size-limit": "^11.0.0",
|
|
79
|
+
"@size-limit/preset-small-lib": "^11.0.0"
|
|
79
80
|
},
|
|
80
81
|
"eslintConfig": {
|
|
81
82
|
"extends": [
|
|
@@ -84,5 +85,25 @@
|
|
|
84
85
|
},
|
|
85
86
|
"lint-staged": {
|
|
86
87
|
"**/*": "prettier --write --ignore-unknown"
|
|
87
|
-
}
|
|
88
|
+
},
|
|
89
|
+
"size-limit": [
|
|
90
|
+
{
|
|
91
|
+
"name": "Tooltip",
|
|
92
|
+
"path": "lib/atoms/Tooltip/Tooltip.tsx",
|
|
93
|
+
"import": "{ Tooltip }",
|
|
94
|
+
"limit": "3 KB"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "Popover",
|
|
98
|
+
"path": "lib/atoms/Popover/Popover.tsx",
|
|
99
|
+
"import": "{ Popover }",
|
|
100
|
+
"limit": "4 KB"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"name": "SlideInPanel",
|
|
104
|
+
"path": "lib/atoms/SlideInPanel/SlideInPanel.tsx",
|
|
105
|
+
"import": "{ SlideInPanel }",
|
|
106
|
+
"limit": "5 KB"
|
|
107
|
+
}
|
|
108
|
+
]
|
|
88
109
|
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { ShoppingCart } from './Cart';
|
|
3
|
-
declare const meta: {
|
|
4
|
-
title: string;
|
|
5
|
-
component: typeof ShoppingCart;
|
|
6
|
-
parameters: {
|
|
7
|
-
layout: string;
|
|
8
|
-
};
|
|
9
|
-
tags: string[];
|
|
10
|
-
};
|
|
11
|
-
export default meta;
|
|
12
|
-
type Story = StoryObj<typeof meta>;
|
|
13
|
-
export declare const EmptyCart: Story;
|
|
14
|
-
export declare const LargeCart: Story;
|
|
15
|
-
export declare const SmallCart: Story;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { TippyProps } from '@tippyjs/react';
|
|
3
|
-
export type TooltipProps = Omit<TippyProps, "content" | "children" | "trigger"> & {
|
|
4
|
-
tooltipClassName?: string;
|
|
5
|
-
contentClassName?: string;
|
|
6
|
-
trigger: React.ReactElement;
|
|
7
|
-
on?: "click" | "mouseenter focus";
|
|
8
|
-
children: React.ReactNode;
|
|
9
|
-
mouseEnterDelay?: number;
|
|
10
|
-
mouseLeaveDelay?: number;
|
|
11
|
-
};
|
|
12
|
-
export declare function Tooltip({ tooltipClassName, contentClassName, trigger, children, on, mouseEnterDelay, mouseLeaveDelay, ...tippyProps }: TooltipProps): import("react/jsx-runtime").JSX.Element;
|