formica-ui-lib 1.0.220 → 1.0.222

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.
@@ -1,3 +1,4 @@
1
+ import type { SegmentedControlVisualVariant } from "../segmentedcontrol/SegmentedControlProps";
1
2
  export type RadioButtonsOption = string;
2
3
  export interface RadioButtonsProps {
3
4
  options: RadioButtonsOption[];
@@ -9,4 +10,5 @@ export interface RadioButtonsProps {
9
10
  className?: string;
10
11
  containerClassName?: string;
11
12
  buttonClassName?: string;
13
+ visualVariant?: SegmentedControlVisualVariant;
12
14
  }
@@ -3,10 +3,14 @@ export type SegmentedControlItem = {
3
3
  label: string;
4
4
  disabled?: boolean;
5
5
  };
6
+ export type SegmentedControlLayoutVariant = "content" | "equalWidth";
7
+ export type SegmentedControlVisualVariant = "default" | "brandBar";
6
8
  export type SegmentedControlProps = {
7
9
  items: SegmentedControlItem[];
8
10
  selectedId?: string;
9
11
  onSelect?: (id: string) => void;
12
+ layoutVariant?: SegmentedControlLayoutVariant;
13
+ visualVariant?: SegmentedControlVisualVariant;
10
14
  className?: string;
11
15
  buttonClassName?: string;
12
16
  disabled?: boolean;
@@ -0,0 +1,59 @@
1
+ import React from "react";
2
+ export type AccountAccessPanelMode = "signIn" | "createAccount";
3
+ export type AccountAccessPanelUserTypeValue = "architectDesigner" | "builderConstruction" | "dealerRetailer" | "distributor" | "fabricator" | "generalContractor" | "homeowner" | "mediaPress" | "other" | "postformer";
4
+ export type AccountAccessPanelUserTypeOption = {
5
+ label: string;
6
+ value: AccountAccessPanelUserTypeValue;
7
+ disabled?: boolean;
8
+ };
9
+ export type AccountAccessPanelErrors = {
10
+ email?: string;
11
+ password?: string;
12
+ firstName?: string;
13
+ phoneNumber?: string;
14
+ userType?: string;
15
+ confirmPassword?: string;
16
+ termsAccepted?: string;
17
+ };
18
+ export type AccountAccessPanelData = {
19
+ mode?: AccountAccessPanelMode;
20
+ email?: string;
21
+ password?: string;
22
+ firstName?: string;
23
+ lastName?: string;
24
+ phoneNumber?: string;
25
+ userType?: AccountAccessPanelUserTypeValue | "";
26
+ confirmPassword?: string;
27
+ marketingOptIn?: boolean;
28
+ termsAccepted?: boolean;
29
+ passwordRequirementsText?: string;
30
+ userTypeOptions?: AccountAccessPanelUserTypeOption[];
31
+ errors?: AccountAccessPanelErrors;
32
+ };
33
+ export type AccountAccessPanelActionLabels = {
34
+ signInPrimary?: string;
35
+ createAccountPrimary?: string;
36
+ secondary?: string;
37
+ };
38
+ export type AccountAccessPanelProps = {
39
+ data: AccountAccessPanelData;
40
+ actionLabels?: AccountAccessPanelActionLabels;
41
+ onModeChange?: (mode: AccountAccessPanelMode) => void;
42
+ onEmailChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
43
+ onPasswordChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
44
+ onFirstNameChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
45
+ onLastNameChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
46
+ onPhoneNumberChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
47
+ onUserTypeChange?: (value: AccountAccessPanelUserTypeValue) => void;
48
+ onConfirmPasswordChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
49
+ onMarketingOptInChange?: (checked: boolean) => void;
50
+ onTermsAcceptedChange?: (checked: boolean) => void;
51
+ onEmailBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
52
+ onPasswordBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
53
+ onForgotPasswordClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
54
+ onTermsClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
55
+ onPrivacyClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
56
+ onSignInClick?: () => void;
57
+ onCreateAccountClick?: () => void;
58
+ onSecondaryClick?: () => void;
59
+ };
@@ -1,6 +1,9 @@
1
1
  import React from "react";
2
+ export type CartDiscountCodeStatus = "idle" | "success" | "error";
2
3
  export interface CartTotalsPanelProps {
3
4
  discountCode?: string;
5
+ discountCodeStatus?: CartDiscountCodeStatus;
6
+ discountCodeMessage?: string;
4
7
  subtotalLabel?: string;
5
8
  discountLabel?: string;
6
9
  taxLabel?: string;
@@ -1,20 +1,48 @@
1
1
  import React from "react";
2
+ import type { AccountAccessPanelMode, AccountAccessPanelUserTypeValue } from "../../account/AccountAccessPanelProps";
2
3
  export interface CheckoutAccountStepProps {
3
4
  currentStep?: number;
4
5
  steps?: string[];
5
- activeMode?: "createAccount" | "signIn";
6
+ activeMode?: AccountAccessPanelMode;
6
7
  email?: string;
7
8
  password?: string;
9
+ firstName?: string;
10
+ lastName?: string;
11
+ phoneNumber?: string;
12
+ userType?: AccountAccessPanelUserTypeValue | "";
13
+ confirmPassword?: string;
14
+ marketingOptIn?: boolean;
15
+ termsAccepted?: boolean;
16
+ passwordRequirementsText?: string;
8
17
  emailError?: string;
9
18
  passwordError?: string;
19
+ firstNameError?: string;
20
+ phoneNumberError?: string;
21
+ userTypeError?: string;
22
+ confirmPasswordError?: string;
23
+ termsAcceptedError?: string;
10
24
  emailHasError?: boolean;
11
25
  passwordHasError?: boolean;
12
- onModeChange?: (mode: "createAccount" | "signIn") => void;
26
+ firstNameHasError?: boolean;
27
+ phoneNumberHasError?: boolean;
28
+ userTypeHasError?: boolean;
29
+ confirmPasswordHasError?: boolean;
30
+ termsAcceptedHasError?: boolean;
31
+ onModeChange?: (mode: AccountAccessPanelMode) => void;
13
32
  onEmailChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
14
33
  onPasswordChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
34
+ onFirstNameChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
35
+ onLastNameChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
36
+ onPhoneNumberChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
37
+ onUserTypeChange?: (value: AccountAccessPanelUserTypeValue) => void;
38
+ onConfirmPasswordChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
39
+ onMarketingOptInChange?: (checked: boolean) => void;
40
+ onTermsAcceptedChange?: (checked: boolean) => void;
15
41
  onEmailBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
16
42
  onPasswordBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
17
43
  onForgotPasswordClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
44
+ onTermsClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
45
+ onPrivacyClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
18
46
  onContinue?: () => void;
19
47
  onContinueAsGuest?: () => void;
20
48
  className?: string;
@@ -29,6 +29,7 @@ export type TopNavCartSummary = {
29
29
  export type TopNavLogin = {
30
30
  label: string;
31
31
  href: string;
32
+ loggedIn?: boolean;
32
33
  };
33
34
  export type TopNavLogo = {
34
35
  src?: string;
@@ -11,5 +11,4 @@ export interface CartShippingTemplateProps {
11
11
  sameAsShipping?: boolean;
12
12
  sameAsShippingLabel?: string;
13
13
  onSameAsShippingChange?: (payload: CheckboxChangePayload) => void;
14
- className?: string;
15
14
  }
@@ -0,0 +1,14 @@
1
+ import type { AccountAccessPanelData, AccountAccessPanelErrors, AccountAccessPanelMode, AccountAccessPanelProps, AccountAccessPanelUserTypeOption, AccountAccessPanelUserTypeValue } from "../../organisms/account/AccountAccessPanelProps";
2
+ import type { ImageProps } from "../../atoms/image/ImageProps";
3
+ export type LoginTemplateMode = AccountAccessPanelMode;
4
+ export type LoginTemplateUserTypeValue = AccountAccessPanelUserTypeValue;
5
+ export type LoginTemplateUserTypeOption = AccountAccessPanelUserTypeOption;
6
+ export type LoginTemplateErrors = AccountAccessPanelErrors;
7
+ export type LoginTemplateData = AccountAccessPanelData;
8
+ export type LoginTemplateImage = Pick<ImageProps, "src" | "alt" | "fit" | "useNetlifyImages"> & {
9
+ quality?: ImageProps["quality"];
10
+ };
11
+ export type LoginTemplateProps = Omit<AccountAccessPanelProps, "actionLabels" | "onSecondaryClick"> & {
12
+ loginImage?: LoginTemplateImage;
13
+ onCancelClick?: () => void;
14
+ };