formica-ui-lib 1.0.69 → 1.0.71

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.
Files changed (35) hide show
  1. package/README.md +21 -19
  2. package/dist/componentProps/atoms/icon/IconProps.d.ts +3 -3
  3. package/dist/componentProps/molecules/card/featureproductcard/FeaturedProductCardProps.d.ts +8 -0
  4. package/dist/componentProps/molecules/card/swatchquantitycard/SwatchQuantityCardProps.d.ts +13 -0
  5. package/dist/componentProps/molecules/carousel/minicarousel/MiniCarouselProps.d.ts +2 -0
  6. package/dist/componentProps/molecules/selectors/breadcrumb/BreadcrumbProps.d.ts +9 -0
  7. package/dist/componentProps/molecules/selectors/verticaltablist/VerticalTabListProps.d.ts +10 -0
  8. package/dist/componentProps/organisms/banner/featurebanner/FeatureBannerProps.d.ts +1 -1
  9. package/dist/componentProps/organisms/banner/standardcopyhero/StandardCopyHeroProps.d.ts +3 -0
  10. package/dist/componentProps/organisms/carousels/featureproductcarousel/FeaturedProductsCarouselProps.d.ts +13 -0
  11. package/dist/componentProps/organisms/section/productinformationsection/ProductInformationSectionProps.d.ts +46 -0
  12. package/dist/componentProps/page/productdetailpage/ProductDetailPageProps.d.ts +10 -0
  13. package/dist/componentProps/templates/productdetailpagetemplate/ProductDetailPageTemplateProps.d.ts +200 -0
  14. package/dist/index.cjs +8 -8
  15. package/dist/index.d.ts +32 -31
  16. package/dist/index.js +1393 -1041
  17. package/dist/stories/atoms/icon/Icon.d.ts +4 -4
  18. package/dist/stories/molecules/card/featureproductcard/FeaturedProductCard.d.ts +4 -0
  19. package/dist/stories/molecules/card/swatchquantitycard/SwatchQuantityCard.d.ts +4 -0
  20. package/dist/stories/molecules/card/swatchquantitycard/SwatchQuantityCard.test.d.ts +1 -0
  21. package/dist/stories/molecules/carousel/minicarousel/MiniCarousel.d.ts +1 -1
  22. package/dist/stories/molecules/mediaLinks/footerImageLink/FooterImageLink.stories.d.ts +1 -1
  23. package/dist/stories/molecules/radioButtons/RadioButtons.d.ts +1 -1
  24. package/dist/stories/molecules/selectors/breadcrumb/Breadcrumb.d.ts +4 -0
  25. package/dist/stories/molecules/selectors/verticaltablist/VerticalTabList.d.ts +4 -0
  26. package/dist/stories/organisms/banner/featurebanner/FeatureBanner.d.ts +1 -1
  27. package/dist/stories/organisms/carousels/featuredproductcarousel/FeaturedProductsCarousel.d.ts +4 -0
  28. package/dist/stories/organisms/section/productinformationsection/ProductInformationSection.d.ts +4 -0
  29. package/dist/stories/organisms/section/productinformationsection/parts/ProductDetailsPane.d.ts +6 -0
  30. package/dist/stories/organisms/section/productinformationsection/parts/SizeAndGradePane.d.ts +6 -0
  31. package/dist/stories/organisms/section/productinformationsection/parts/TexturePane.d.ts +6 -0
  32. package/dist/stories/page/productDetailPage/ProductDetailPage.d.ts +1 -12
  33. package/dist/stories/template/productdetailpagetemplate/ProductDetailPageTemplate.d.ts +4 -0
  34. package/package.json +86 -80
  35. package/dist/vite.svg +0 -1
package/README.md CHANGED
@@ -1,19 +1,21 @@
1
- # formicaui
2
-
3
- This is the home of Formica's Storybook components for the UI
4
-
5
- ## Branching / Git Workflow
6
-
7
- ⚠️ **Direct commits to `main` are not allowed.** All work must be done in a feature branch created from `dev`.
8
-
9
- ### Create a feature branch from `dev`
10
-
11
- 1. Checkout `dev` and pull the latest changes
12
- 2. Create a new feature branch named `feature/YourFeature`
13
-
14
- **Commands:**
15
- ```bash
16
- git fetch
17
- git checkout dev
18
- git pull
19
- git checkout -b feature/YourFeature
1
+ # formicaui
2
+
3
+ This is the home of Formica's Storybook components for the UI
4
+
5
+ ## Branching / Git Workflow
6
+
7
+ ⚠️ **Direct commits to `main` are not allowed.** All work must be done in a feature branch created from `dev`.
8
+
9
+ ### Create a feature branch from `dev`
10
+
11
+ 1. Checkout `dev` and pull the latest changes
12
+ 2. Create a new feature branch named `feature/YourFeature`
13
+
14
+ **Commands:**
15
+
16
+ ```bash
17
+ git fetch
18
+ git checkout dev
19
+ git pull
20
+ git checkout -b feature/YourFeature
21
+ ```
@@ -1,6 +1,6 @@
1
- import type { IconDefinition } from '@fortawesome/fontawesome-svg-core';
2
- export type IconSize = 'base' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl';
3
- export type IconColor = 'inherit' | 'primary' | 'secondary' | 'secondaryHover' | 'accent';
1
+ import type { IconDefinition } from "@fortawesome/fontawesome-svg-core";
2
+ export type IconSize = "base" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl";
3
+ export type IconColor = "inherit" | "primary" | "secondary" | "secondaryHover" | "accent";
4
4
  export type IconProps = {
5
5
  icon?: IconDefinition;
6
6
  alt?: string;
@@ -0,0 +1,8 @@
1
+ export type FeaturedProductCardProps = {
2
+ imageSrc: string;
3
+ imageAlt: string;
4
+ title: string;
5
+ brand: string;
6
+ decorNumber: string | number;
7
+ href?: string;
8
+ };
@@ -0,0 +1,13 @@
1
+ export type SwatchQuantityCardProps = {
2
+ imageSrc: string;
3
+ imageAlt: string;
4
+ title: string;
5
+ brand: string;
6
+ decorNumber: number;
7
+ swatchType: string;
8
+ initialQuantity?: number;
9
+ minQuantity?: number;
10
+ maxQuantity?: number;
11
+ onQuantityChange?: (quantity: number) => void;
12
+ onRemoveItem?: () => void;
13
+ };
@@ -4,6 +4,8 @@ export type MiniCarouselProps<T> = {
4
4
  initialIndex?: number;
5
5
  loop?: boolean;
6
6
  showArrows?: boolean;
7
+ header?: React.ReactNode;
8
+ arrowPosition?: "sides" | "top-right";
7
9
  onSelect?: (index: number, item: T) => void;
8
10
  renderItem: (args: {
9
11
  item: T;
@@ -0,0 +1,9 @@
1
+ export type BreadcrumbItem = {
2
+ id: string;
3
+ label: string;
4
+ href?: string;
5
+ };
6
+ export type BreadcrumbProps = {
7
+ Breadcrumbs?: BreadcrumbItem[];
8
+ onNavigate?: (href: string, item: BreadcrumbItem) => void;
9
+ };
@@ -0,0 +1,10 @@
1
+ export type VerticalTabListItem = {
2
+ id: string;
3
+ label: string;
4
+ disabled?: boolean;
5
+ };
6
+ export type VerticalTabListProps = {
7
+ items: VerticalTabListItem[];
8
+ value?: string;
9
+ onChange: (value: string, item: VerticalTabListItem) => void;
10
+ };
@@ -1,4 +1,4 @@
1
- type AlignOption = 'left' | 'right';
1
+ type AlignOption = "left" | "right";
2
2
  export interface FeatureBannerProps {
3
3
  imageSrc: string;
4
4
  imageAlt?: string;
@@ -4,4 +4,7 @@ export interface StandardCopyHeroProps {
4
4
  heading: string;
5
5
  subheading: string;
6
6
  body: string;
7
+ linkLabel?: string;
8
+ linkHref?: string;
9
+ onLinkClick?: () => void;
7
10
  }
@@ -0,0 +1,13 @@
1
+ export type FeaturedProductItem = {
2
+ id: string;
3
+ imageSrc: string;
4
+ imageAlt: string;
5
+ title: string;
6
+ brand: string;
7
+ decorNumber: string | number;
8
+ href?: string;
9
+ };
10
+ export type FeaturedProductsCarouselProps = {
11
+ title?: string;
12
+ items: FeaturedProductItem[];
13
+ };
@@ -0,0 +1,46 @@
1
+ import React from "react";
2
+ export type ProductInformationTabKey = "details" | "texture" | "sizeAndGrade";
3
+ export type ProductDetailsData = {
4
+ summary?: string;
5
+ content?: React.ReactNode;
6
+ };
7
+ export type TextureItem = {
8
+ key: string;
9
+ title?: string;
10
+ imageSrc?: string;
11
+ imageAlt?: string;
12
+ description?: string;
13
+ };
14
+ export type TextureGroup = {
15
+ id: string;
16
+ title: string;
17
+ items: TextureItem[];
18
+ };
19
+ export type TextureData = {
20
+ groups?: TextureGroup[];
21
+ };
22
+ export type SizeAndGradeCardData = {
23
+ id: string;
24
+ title: string;
25
+ subtitle?: string;
26
+ items?: string[];
27
+ tone?: "filled" | "outlined";
28
+ };
29
+ export type SizeAndGradeData = {
30
+ summary?: string;
31
+ cards?: SizeAndGradeCardData[];
32
+ content?: React.ReactNode;
33
+ };
34
+ export type ProductInformationRange = {
35
+ id: string;
36
+ label: string;
37
+ details?: ProductDetailsData;
38
+ texture?: TextureData;
39
+ sizeAndGrade?: SizeAndGradeData;
40
+ };
41
+ export type ProductInformationSectionProps = {
42
+ ranges: ProductInformationRange[];
43
+ defaultTab?: ProductInformationTabKey;
44
+ defaultRangeId?: string;
45
+ className?: string;
46
+ };
@@ -0,0 +1,10 @@
1
+ import type { BrandNavBarProps } from "../../organisms/navigation/BrandNavBarProps";
2
+ import type { TopNavBarProps } from "../../organisms/navigation/TopNavBarProps";
3
+ import type { FooterProps } from "../../organisms/footer/FooterProps";
4
+ import { ProductDetailPageTemplateProps } from "../../templates/productdetailpagetemplate/ProductDetailPageTemplateProps";
5
+ export type ProductDetailPageProps = {
6
+ brandNavBarProps: BrandNavBarProps;
7
+ topNavBarProps: TopNavBarProps;
8
+ productDetailPageTemplateProps: ProductDetailPageTemplateProps;
9
+ footerProps?: FooterProps;
10
+ };
@@ -0,0 +1,200 @@
1
+ import { BreadcrumbsProps } from "../../molecules/selectors/breadcrumb/BreadcrumbsProps";
2
+ import { ProductInformationTabKey } from "../../organisms/section/productinformationsection/ProductInformationSectionProps";
3
+ export type ProductDetailSimpleOption = {
4
+ id: string;
5
+ label: string;
6
+ value: string;
7
+ code?: string;
8
+ title?: string;
9
+ widthIn?: string;
10
+ lengthIn?: string;
11
+ };
12
+ export type ProductDetailImage = {
13
+ id: string;
14
+ type?: string;
15
+ src: string;
16
+ alt?: string;
17
+ thumbnailSrc?: string;
18
+ thumbnailAlt?: string;
19
+ };
20
+ export type ProductDetailPrice = {
21
+ value: number;
22
+ label: string;
23
+ };
24
+ export type ProductDetailProduct = {
25
+ parentId?: string;
26
+ decor?: string;
27
+ collection?: string;
28
+ title?: string;
29
+ description?: string;
30
+ sku?: string;
31
+ patternRepeat?: string;
32
+ currency?: string;
33
+ price?: ProductDetailPrice;
34
+ };
35
+ export type ProductDetailContent = {
36
+ defaultPurchaseTab?: string;
37
+ defaultInfoTab?: ProductInformationTabKey;
38
+ defaultRangeId?: string;
39
+ availabilityLabel?: string;
40
+ availabilityHref?: string;
41
+ returnPolicyLabel?: string;
42
+ returnPolicyHref?: string;
43
+ notReturnableText?: string;
44
+ sampleDisclaimer?: string;
45
+ sampleSizeNote?: string;
46
+ };
47
+ export type ProductDetailDownloadLink = {
48
+ label?: string;
49
+ href?: string;
50
+ };
51
+ export type ProductDetailDownloads = {
52
+ swatch?: ProductDetailDownloadLink;
53
+ fullSheet?: ProductDetailDownloadLink;
54
+ };
55
+ export type ProductDetailTextureItem = {
56
+ key: string;
57
+ title: string;
58
+ imageSrc?: string;
59
+ imageAlt?: string;
60
+ description?: string;
61
+ };
62
+ export type ProductDetailTextureGroup = {
63
+ id: string;
64
+ title: string;
65
+ items: ProductDetailTextureItem[];
66
+ };
67
+ export type ProductDetailRange = {
68
+ id: string;
69
+ label: string;
70
+ details?: {
71
+ summary?: string;
72
+ content?: string;
73
+ };
74
+ texture?: {
75
+ groups?: ProductDetailTextureGroup[];
76
+ };
77
+ sizeAndGrade?: {
78
+ summary?: string;
79
+ cards?: Array<{
80
+ id: string;
81
+ title: string;
82
+ subtitle?: string;
83
+ tone?: "filled" | "outlined";
84
+ items: string[];
85
+ }>;
86
+ content?: string;
87
+ };
88
+ };
89
+ export type ProductDetailPurchaseTabOptionIds = {
90
+ productOptionIds?: string[];
91
+ textureOptionIds?: string[];
92
+ sizeOptionIds?: string[];
93
+ };
94
+ export type ProductDetailPurchase = {
95
+ defaults?: {
96
+ product?: string | null;
97
+ texture?: string | null;
98
+ size?: string | null;
99
+ quantity?: number;
100
+ minQuantity?: number;
101
+ maxQuantity?: number;
102
+ };
103
+ tabOptions?: {
104
+ Sample?: ProductDetailPurchaseTabOptionIds;
105
+ "Buy Now"?: ProductDetailPurchaseTabOptionIds;
106
+ };
107
+ };
108
+ export type ProductDetailVariant = {
109
+ id: string;
110
+ sku: string;
111
+ rangeId: string;
112
+ decor?: string;
113
+ title?: string;
114
+ textureId?: string;
115
+ thicknessId?: string;
116
+ sizeId?: string;
117
+ finish?: string;
118
+ grade?: string;
119
+ isWebEnabled?: boolean;
120
+ };
121
+ export type ProductDetailSizeAndGradeGuideRow = {
122
+ textureId?: string;
123
+ thicknessId?: string;
124
+ finish?: string;
125
+ grade?: string;
126
+ sizes?: Array<{
127
+ sizeId: string;
128
+ label: string;
129
+ skuIds?: string[];
130
+ }>;
131
+ };
132
+ export type ProductDetailStandardCopyHero = {
133
+ imageSrc?: string;
134
+ imageAlt?: string;
135
+ heading?: string;
136
+ subheading?: string;
137
+ body?: string;
138
+ linkLabel?: string;
139
+ linkHref?: string;
140
+ };
141
+ export type ProductDetailFeaturedProduct = {
142
+ id: string;
143
+ imageSrc: string;
144
+ imageAlt: string;
145
+ title: string;
146
+ brand: string;
147
+ decorNumber: string | number;
148
+ href?: string;
149
+ };
150
+ export type ProductDetailData = {
151
+ id?: string;
152
+ meta?: {
153
+ source?: string;
154
+ cacheKey?: string;
155
+ productType?: string;
156
+ };
157
+ product?: ProductDetailProduct;
158
+ content?: ProductDetailContent;
159
+ downloads?: ProductDetailDownloads;
160
+ images?: ProductDetailImage[];
161
+ ranges?: ProductDetailRange[];
162
+ optionSets?: {
163
+ purchaseTabs?: string[];
164
+ sampleSizes?: ProductDetailSimpleOption[];
165
+ ranges?: ProductDetailSimpleOption[];
166
+ thicknesses?: ProductDetailSimpleOption[];
167
+ textures?: ProductDetailSimpleOption[];
168
+ sizes?: ProductDetailSimpleOption[];
169
+ };
170
+ purchase?: ProductDetailPurchase;
171
+ variants?: ProductDetailVariant[];
172
+ sizeAndGradeGuide?: {
173
+ rows?: ProductDetailSizeAndGradeGuideRow[];
174
+ };
175
+ standardCopyHero?: ProductDetailStandardCopyHero;
176
+ featuredProducts?: ProductDetailFeaturedProduct[];
177
+ };
178
+ export type ProductDetailPageTemplateProps = {
179
+ breadcrumbsProps?: BreadcrumbsProps;
180
+ productData?: ProductDetailData;
181
+ onDownloadSwatch?: (data: ProductDetailData) => void;
182
+ onDownloadFullSheet?: (data: ProductDetailData) => void;
183
+ onAddToWishlist?: (payload: {
184
+ sku?: string;
185
+ decor?: string;
186
+ }, data: ProductDetailData) => void;
187
+ onAddToCart?: (order: {
188
+ type: string;
189
+ sku?: string;
190
+ decor?: string;
191
+ product: string | null;
192
+ texture: string | null;
193
+ size: string | null;
194
+ quantity: number;
195
+ priceValue?: number;
196
+ priceLabel?: string;
197
+ currency?: string;
198
+ }, data: ProductDetailData) => void;
199
+ onNavigate?: (href: string) => void;
200
+ };