formica-ui-lib 1.0.317 → 1.0.319

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 (20) hide show
  1. package/dist/componentProps/atoms/dropdown/DropdownProps.d.ts +1 -0
  2. package/dist/componentProps/molecules/cards/documentinfocard/DocumentInfoCardProps.d.ts +15 -0
  3. package/dist/componentProps/molecules/selectors/verticalcheckboxlist/VerticalCheckboxListProps.d.ts +2 -0
  4. package/dist/componentProps/organisms/collections/documentinfocollection/DocumentInfoCollectionProps.d.ts +11 -0
  5. package/dist/componentProps/organisms/sections/vendorimportsection/VendorImportSectionProps.d.ts +28 -0
  6. package/dist/componentProps/templates/admin/wheretobuy/WhereToBuyProps.d.ts +117 -0
  7. package/dist/componentProps/templates/documentresultstemplate/DocumentResultsTemplateProps.d.ts +11 -0
  8. package/dist/index.cjs +9 -9
  9. package/dist/index.d.ts +11 -0
  10. package/dist/index.js +1608 -695
  11. package/dist/stories/atoms/dropdown/DropdownThemeStyles.d.ts +2 -1
  12. package/dist/stories/molecules/cards/documentinfocard/DocumentInfoCard.d.ts +4 -0
  13. package/dist/stories/organisms/collections/documentinfocollection/DocumentInfoCollection.d.ts +4 -0
  14. package/dist/stories/organisms/sections/vendorimportsection/VendorImportSection.d.ts +4 -0
  15. package/dist/stories/templates/admin/wheretobuy/WhereToBuyDetailPage.d.ts +4 -0
  16. package/dist/stories/templates/admin/wheretobuy/WhereToBuyLandingPage.d.ts +4 -0
  17. package/dist/stories/templates/admin/wheretobuy/whereToBuyFields.d.ts +3 -0
  18. package/dist/stories/templates/documentresultstemplate/DocumentResultsTemplate.d.ts +4 -0
  19. package/dist/tailwind.css +1 -1
  20. package/package.json +1 -1
@@ -16,6 +16,7 @@ export interface DropdownProps {
16
16
  required?: boolean;
17
17
  hasError?: boolean;
18
18
  variant?: "field" | "filter" | "toolbar";
19
+ pickerVariant?: "native" | "rounded";
19
20
  onChange?: (event: React.ChangeEvent<HTMLSelectElement>) => void;
20
21
  onBlur?: (event: React.FocusEvent<HTMLSelectElement>) => void;
21
22
  }
@@ -0,0 +1,15 @@
1
+ export type DocumentInfoCardItem = {
2
+ id: string;
3
+ name: string;
4
+ range?: string;
5
+ documentType?: string;
6
+ documentSubtype?: string;
7
+ };
8
+ export type DocumentInfoCardClickPayload = {
9
+ documentInfoCardItem: DocumentInfoCardItem;
10
+ };
11
+ export type DocumentInfoCardProps = {
12
+ documentInfoCardItem: DocumentInfoCardItem;
13
+ onDownloadClick: (payload: DocumentInfoCardClickPayload) => void;
14
+ onRangeClick: (payload: DocumentInfoCardClickPayload) => void;
15
+ };
@@ -13,5 +13,7 @@ export interface VerticalCheckboxListProps {
13
13
  defaultOpen?: boolean;
14
14
  iconName?: string;
15
15
  indentOptions?: boolean;
16
+ /** Number of option columns on desktop; mobile always uses one column. */
17
+ columns?: 1 | 2 | 3;
16
18
  onOptionChange?: (payload: CheckboxChangePayload) => void;
17
19
  }
@@ -0,0 +1,11 @@
1
+ import { DocumentInfoCardClickPayload, DocumentInfoCardItem } from "../../../molecules/cards/documentinfocard/DocumentInfoCardProps";
2
+ export interface DocumentInfoCollectionProps {
3
+ documentTitleLabel?: string;
4
+ documentRangeLabel?: string;
5
+ documentTypeLabel?: string;
6
+ documentSubtypeLabel?: string;
7
+ emptyMessage?: string;
8
+ documentInfoCards: DocumentInfoCardItem[];
9
+ onDownloadClick: (payload: DocumentInfoCardClickPayload) => void;
10
+ onRangeClick: (payload: DocumentInfoCardClickPayload) => void;
11
+ }
@@ -0,0 +1,28 @@
1
+ export interface VendorImportFilePayload {
2
+ file: File;
3
+ }
4
+ export type VendorImportMode = "add" | "replace";
5
+ export interface VendorImportModePayload {
6
+ mode: VendorImportMode;
7
+ }
8
+ export interface VendorImportSectionProps {
9
+ mode: VendorImportMode;
10
+ /** Names the exact set of vendor listings affected, for example Europe. */
11
+ targetLabel: string;
12
+ /** Changing mode must invalidate any previous parse result in the app layer. */
13
+ onModeChange: (payload: VendorImportModePayload) => void;
14
+ scopeDescription: string;
15
+ importDescription: string;
16
+ acceptedExtensions: string[];
17
+ maxFileSizeBytes: number;
18
+ fileName?: string;
19
+ state: "idle" | "selected" | "processing" | "review" | "importing" | "success" | "error";
20
+ message?: string;
21
+ errors?: string[];
22
+ disabled?: boolean;
23
+ onFileSelect: (payload: VendorImportFilePayload) => void;
24
+ onFileRemove: () => void;
25
+ onParseClick: (payload: VendorImportModePayload) => void;
26
+ onImportClick: (payload: VendorImportModePayload) => void;
27
+ onTemplateDownloadClick?: () => void;
28
+ }
@@ -0,0 +1,117 @@
1
+ import type { AdminSideNavProps } from "../../../organisms/navigation/AdminSideNavProps";
2
+ import type { VendorImportSectionProps } from "../../../organisms/sections/vendorimportsection/VendorImportSectionProps";
3
+ import type { AdminRegionSelectorProps } from "../../../molecules/selectors/adminregionselector/AdminRegionSelectorProps";
4
+ import type { AdminTemplateStatus } from "../shared/AdminTemplateStatus";
5
+ import type { DynamicFormFieldChangePayload } from "../../../organisms/forms/dynamicform/DynamicFormProps";
6
+ export interface WhereToBuyLocality {
7
+ id: string;
8
+ region: string;
9
+ subRegion: string;
10
+ language: string;
11
+ locale: string;
12
+ vendorCount: number;
13
+ }
14
+ export interface WhereToBuyVendor {
15
+ id: string;
16
+ localityId: string;
17
+ name: string;
18
+ description: string;
19
+ address1: string;
20
+ city: string;
21
+ country: string;
22
+ postalCode: string;
23
+ latitude: number | null;
24
+ longitude: number | null;
25
+ email: string;
26
+ phone: string;
27
+ websiteUrl: string;
28
+ distributorTypes: string[];
29
+ stockedRanges: string[];
30
+ }
31
+ export interface WhereToBuyOption {
32
+ id: string;
33
+ label: string;
34
+ }
35
+ export interface WhereToBuyVendorPayload {
36
+ localityId: string;
37
+ vendorId: string;
38
+ }
39
+ export interface WhereToBuyVendorFieldChangePayload extends WhereToBuyVendorPayload, DynamicFormFieldChangePayload {
40
+ }
41
+ export interface WhereToBuySelectionChangePayload extends WhereToBuyVendorPayload {
42
+ field: "distributorTypes" | "stockedRanges";
43
+ optionId: string;
44
+ checked: boolean;
45
+ }
46
+ export interface WhereToBuyAddressSuggestion {
47
+ id: string;
48
+ label: string;
49
+ }
50
+ export interface WhereToBuyAddressResult extends WhereToBuyAddressSuggestion {
51
+ address1: string;
52
+ city: string;
53
+ country: string;
54
+ postalCode: string;
55
+ latitude: number;
56
+ longitude: number;
57
+ }
58
+ export interface WhereToBuyAddressLookupProps {
59
+ query: string;
60
+ state: "idle" | "loading" | "resolving" | "ready" | "error";
61
+ message?: string;
62
+ results: WhereToBuyAddressSuggestion[];
63
+ }
64
+ export interface WhereToBuyLandingPageProps {
65
+ importProps?: VendorImportSectionProps;
66
+ sideNavProps: AdminSideNavProps;
67
+ regionSelectorProps: AdminRegionSelectorProps;
68
+ localities: WhereToBuyLocality[];
69
+ status?: AdminTemplateStatus;
70
+ onLocalitySelect: (payload: {
71
+ localityId: string;
72
+ }) => void;
73
+ onRetryClick?: () => void;
74
+ }
75
+ export interface WhereToBuyDetailPageProps {
76
+ sideNavProps: AdminSideNavProps;
77
+ locality: WhereToBuyLocality;
78
+ vendors: WhereToBuyVendor[];
79
+ selectedVendorId?: string;
80
+ editor?: WhereToBuyVendor;
81
+ isCreating?: boolean;
82
+ searchValue: string;
83
+ distributorTypeOptions: WhereToBuyOption[];
84
+ stockedRangeOptions: WhereToBuyOption[];
85
+ status?: AdminTemplateStatus;
86
+ saveState: "saved" | "unsaved" | "saving" | "error";
87
+ saveMessage?: string;
88
+ fieldErrors?: Record<string, string>;
89
+ lookup: WhereToBuyAddressLookupProps;
90
+ googleMapsApiKey?: string;
91
+ deleteOpen?: boolean;
92
+ deletePending?: boolean;
93
+ deleteError?: string;
94
+ onBackClick: () => void;
95
+ onSearchChange: (payload: {
96
+ value: string;
97
+ }) => void;
98
+ onVendorSelect: (payload: WhereToBuyVendorPayload) => void;
99
+ onAddVendorClick: () => void;
100
+ onVendorFieldChange: (payload: WhereToBuyVendorFieldChangePayload) => void;
101
+ onVendorSelectionChange: (payload: WhereToBuySelectionChangePayload) => void;
102
+ onSaveVendor: (payload: {
103
+ vendor: WhereToBuyVendor;
104
+ isNew: boolean;
105
+ }) => void;
106
+ onCancelEdit: () => void;
107
+ onDeleteVendorRequest: (payload: WhereToBuyVendorPayload) => void;
108
+ onDeleteVendorConfirm: (payload: WhereToBuyVendorPayload) => void;
109
+ onDeleteVendorCancel: () => void;
110
+ onLookupQueryChange: (payload: {
111
+ value: string;
112
+ }) => void;
113
+ onAddressSelect: (payload: WhereToBuyVendorPayload & {
114
+ suggestion: WhereToBuyAddressSuggestion;
115
+ }) => void;
116
+ onRetryClick?: () => void;
117
+ }
@@ -0,0 +1,11 @@
1
+ import { DocumentInfoCollectionProps } from "../../organisms/collections/documentinfocollection/DocumentInfoCollectionProps";
2
+ import { SearchBarProps } from "../../molecules/searchbar/SearchBarProps";
3
+ import { DropdownProps } from "../../atoms/dropdown/DropdownProps";
4
+ import { TextCardProps } from "../../molecules/cards/textcard/TextCardProps";
5
+ export type DocumentResultsTemplateProps = {
6
+ documentInfoCollectionProps: DocumentInfoCollectionProps;
7
+ textCard: Pick<TextCardProps, "heading" | "subheading" | "body">;
8
+ documentDropdownFilters: DropdownProps[];
9
+ searchBarProps: SearchBarProps;
10
+ mobileFilterLabel?: string;
11
+ };