formica-ui-lib 1.0.317 → 1.0.318

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.
@@ -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,115 @@
1
+ import type { AdminSideNavProps } from "../../../organisms/navigation/AdminSideNavProps";
2
+ import type { AdminRegionSelectorProps } from "../../../molecules/selectors/adminregionselector/AdminRegionSelectorProps";
3
+ import type { AdminTemplateStatus } from "../shared/AdminTemplateStatus";
4
+ import type { DynamicFormFieldChangePayload } from "../../../organisms/forms/dynamicform/DynamicFormProps";
5
+ export interface WhereToBuyLocality {
6
+ id: string;
7
+ region: string;
8
+ subRegion: string;
9
+ language: string;
10
+ locale: string;
11
+ vendorCount: number;
12
+ }
13
+ export interface WhereToBuyVendor {
14
+ id: string;
15
+ localityId: string;
16
+ name: string;
17
+ description: string;
18
+ address1: string;
19
+ city: string;
20
+ country: string;
21
+ postalCode: string;
22
+ latitude: number | null;
23
+ longitude: number | null;
24
+ email: string;
25
+ phone: string;
26
+ websiteUrl: string;
27
+ distributorTypes: string[];
28
+ stockedRanges: string[];
29
+ }
30
+ export interface WhereToBuyOption {
31
+ id: string;
32
+ label: string;
33
+ }
34
+ export interface WhereToBuyVendorPayload {
35
+ localityId: string;
36
+ vendorId: string;
37
+ }
38
+ export interface WhereToBuyVendorFieldChangePayload extends WhereToBuyVendorPayload, DynamicFormFieldChangePayload {
39
+ }
40
+ export interface WhereToBuySelectionChangePayload extends WhereToBuyVendorPayload {
41
+ field: "distributorTypes" | "stockedRanges";
42
+ optionId: string;
43
+ checked: boolean;
44
+ }
45
+ export interface WhereToBuyAddressSuggestion {
46
+ id: string;
47
+ label: string;
48
+ }
49
+ export interface WhereToBuyAddressResult extends WhereToBuyAddressSuggestion {
50
+ address1: string;
51
+ city: string;
52
+ country: string;
53
+ postalCode: string;
54
+ latitude: number;
55
+ longitude: number;
56
+ }
57
+ export interface WhereToBuyAddressLookupProps {
58
+ query: string;
59
+ state: "idle" | "loading" | "resolving" | "ready" | "error";
60
+ message?: string;
61
+ results: WhereToBuyAddressSuggestion[];
62
+ }
63
+ export interface WhereToBuyLandingPageProps {
64
+ sideNavProps: AdminSideNavProps;
65
+ regionSelectorProps: AdminRegionSelectorProps;
66
+ localities: WhereToBuyLocality[];
67
+ status?: AdminTemplateStatus;
68
+ onLocalitySelect: (payload: {
69
+ localityId: string;
70
+ }) => void;
71
+ onRetryClick?: () => void;
72
+ }
73
+ export interface WhereToBuyDetailPageProps {
74
+ sideNavProps: AdminSideNavProps;
75
+ locality: WhereToBuyLocality;
76
+ vendors: WhereToBuyVendor[];
77
+ selectedVendorId?: string;
78
+ editor?: WhereToBuyVendor;
79
+ isCreating?: boolean;
80
+ searchValue: string;
81
+ distributorTypeOptions: WhereToBuyOption[];
82
+ stockedRangeOptions: WhereToBuyOption[];
83
+ status?: AdminTemplateStatus;
84
+ saveState: "saved" | "unsaved" | "saving" | "error";
85
+ saveMessage?: string;
86
+ fieldErrors?: Record<string, string>;
87
+ lookup: WhereToBuyAddressLookupProps;
88
+ googleMapsApiKey?: string;
89
+ deleteOpen?: boolean;
90
+ deletePending?: boolean;
91
+ deleteError?: string;
92
+ onBackClick: () => void;
93
+ onSearchChange: (payload: {
94
+ value: string;
95
+ }) => void;
96
+ onVendorSelect: (payload: WhereToBuyVendorPayload) => void;
97
+ onAddVendorClick: () => void;
98
+ onVendorFieldChange: (payload: WhereToBuyVendorFieldChangePayload) => void;
99
+ onVendorSelectionChange: (payload: WhereToBuySelectionChangePayload) => void;
100
+ onSaveVendor: (payload: {
101
+ vendor: WhereToBuyVendor;
102
+ isNew: boolean;
103
+ }) => void;
104
+ onCancelEdit: () => void;
105
+ onDeleteVendorRequest: (payload: WhereToBuyVendorPayload) => void;
106
+ onDeleteVendorConfirm: (payload: WhereToBuyVendorPayload) => void;
107
+ onDeleteVendorCancel: () => void;
108
+ onLookupQueryChange: (payload: {
109
+ value: string;
110
+ }) => void;
111
+ onAddressSelect: (payload: WhereToBuyVendorPayload & {
112
+ suggestion: WhereToBuyAddressSuggestion;
113
+ }) => void;
114
+ onRetryClick?: () => void;
115
+ }