@npm_leadtech/legal-lib-components 7.107.0 → 7.107.2

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 (31) hide show
  1. package/dist/src/components/atoms/Logo/Logo.js +6 -2
  2. package/dist/src/components/atoms/Logo/Logo.tsx +8 -2
  3. package/dist/src/components/atoms/Logo/svg/lawdistrict-icon.svg +23 -0
  4. package/dist/src/components/atoms/SearchSelect/SearchSelect.d.ts +1 -0
  5. package/dist/src/components/atoms/SearchSelect/SearchSelect.js +9 -1
  6. package/dist/src/components/atoms/SearchSelect/SearchSelect.styled.js +19 -0
  7. package/dist/src/components/atoms/SearchSelect/SearchSelect.styled.ts +19 -0
  8. package/dist/src/components/atoms/SearchSelect/SearchSelect.tsx +20 -0
  9. package/dist/src/components/atoms/SearchSelect/stateFlags/stateFlags.scss +177 -0
  10. package/dist/src/components/atoms/SearchSelect/stateFlags/us-states-sprite.png +0 -0
  11. package/dist/src/components/sections/FormHeader/FormHeader.d.ts +3 -0
  12. package/dist/src/components/sections/FormHeader/FormHeader.js +15 -0
  13. package/dist/src/components/sections/FormHeader/FormHeader.styled.d.ts +2 -0
  14. package/dist/src/components/sections/FormHeader/FormHeader.styled.js +98 -0
  15. package/dist/src/components/sections/FormHeader/FormHeader.styled.ts +100 -0
  16. package/dist/src/components/sections/FormHeader/FormHeader.tsx +88 -0
  17. package/dist/src/components/sections/FormHeader/FormHeaderProps.d.ts +21 -0
  18. package/dist/src/components/sections/FormHeader/FormHeaderProps.js +1 -0
  19. package/dist/src/components/sections/FormHeader/FormHeaderProps.ts +23 -0
  20. package/dist/src/components/sections/FormHeader/index.d.ts +2 -0
  21. package/dist/src/components/sections/FormHeader/index.js +2 -0
  22. package/dist/src/components/sections/FormHeader/index.ts +2 -0
  23. package/dist/src/components/sections/FormHeader/svg/logo-icon.svg +23 -0
  24. package/dist/src/components/sections/FormHeader/svg/phone.svg +5 -0
  25. package/dist/src/components/sections/FormHeader/svg/trustpilot-logo.svg +7 -0
  26. package/dist/src/components/sections/FormHeader/svg/trustpilot-stars.svg +8 -0
  27. package/dist/src/components/sections/index.d.ts +1 -0
  28. package/dist/src/components/sections/index.js +1 -0
  29. package/dist/src/components/sections/index.ts +1 -0
  30. package/dist/tsconfig.build.tsbuildinfo +1 -1
  31. package/package.json +2 -1
@@ -2,6 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import districtlaws from './svg/districtlaws-logo.svg';
3
3
  import districtlawsWhite from './svg/districtlaws-white-logo.svg';
4
4
  import lawdistrict from './svg/lawdistrict-logo.svg';
5
+ import lawdistrictIcon from './svg/lawdistrict-icon.svg';
5
6
  import lawdistrictWhite from './svg/lawdistrict-white-logo.svg';
6
7
  import lawdistrictinfo from './svg/lawdistrictinfo-logo.svg';
7
8
  import lawdistrictinfoWhite from './svg/lawdistrictinfo-white-logo.svg';
@@ -18,7 +19,8 @@ import uslawdistrictWhite from './svg/uslawdistrict-white-logo.svg';
18
19
  const LOGOS = {
19
20
  lawdistrict: {
20
21
  default: lawdistrict,
21
- white: lawdistrictWhite
22
+ white: lawdistrictWhite,
23
+ icon: lawdistrictIcon
22
24
  },
23
25
  legalfinity: {
24
26
  default: legalfinity,
@@ -50,5 +52,7 @@ const LOGOS = {
50
52
  }
51
53
  };
52
54
  export const Logo = ({ className, siteName = 'lawdistrict', type = 'default', width, height, isLoadingLazy = false }) => {
53
- return (_jsx("img", { className: className, src: LOGOS[siteName.toLowerCase()]?.[type] ?? LOGOS['lawdistrict']?.[type], alt: `${siteName} logo`, width: width, height: height, loading: isLoadingLazy ? 'lazy' : 'eager' }));
55
+ const brandLogos = LOGOS[siteName.toLowerCase()] ?? LOGOS['lawdistrict'];
56
+ const logoSrc = brandLogos?.[type] ?? brandLogos?.default ?? LOGOS['lawdistrict']?.[type] ?? LOGOS['lawdistrict']?.default;
57
+ return (_jsx("img", { className: className, src: logoSrc, alt: `${siteName} logo`, width: width, height: height, loading: isLoadingLazy ? 'lazy' : 'eager' }));
54
58
  };
@@ -7,6 +7,7 @@ import { type LogoProps } from './LogoProps.types'
7
7
  import districtlaws from './svg/districtlaws-logo.svg'
8
8
  import districtlawsWhite from './svg/districtlaws-white-logo.svg'
9
9
  import lawdistrict from './svg/lawdistrict-logo.svg'
10
+ import lawdistrictIcon from './svg/lawdistrict-icon.svg'
10
11
  import lawdistrictWhite from './svg/lawdistrict-white-logo.svg'
11
12
  import lawdistrictinfo from './svg/lawdistrictinfo-logo.svg'
12
13
  import lawdistrictinfoWhite from './svg/lawdistrictinfo-white-logo.svg'
@@ -24,7 +25,8 @@ import uslawdistrictWhite from './svg/uslawdistrict-white-logo.svg'
24
25
  const LOGOS: Record<string, any> = {
25
26
  lawdistrict: {
26
27
  default: lawdistrict,
27
- white: lawdistrictWhite
28
+ white: lawdistrictWhite,
29
+ icon: lawdistrictIcon
28
30
  },
29
31
  legalfinity: {
30
32
  default: legalfinity,
@@ -64,10 +66,14 @@ export const Logo: FC<LogoProps> = ({
64
66
  height,
65
67
  isLoadingLazy = false
66
68
  }): React.ReactElement => {
69
+ const brandLogos = LOGOS[siteName.toLowerCase()] ?? LOGOS['lawdistrict']
70
+ const logoSrc =
71
+ brandLogos?.[type] ?? brandLogos?.default ?? LOGOS['lawdistrict']?.[type] ?? LOGOS['lawdistrict']?.default
72
+
67
73
  return (
68
74
  <img
69
75
  className={className}
70
- src={LOGOS[siteName.toLowerCase()]?.[type] ?? LOGOS['lawdistrict']?.[type]}
76
+ src={logoSrc}
71
77
  alt={`${siteName} logo`}
72
78
  width={width}
73
79
  height={height}
@@ -0,0 +1,23 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="128px" height="128px" viewBox="0 0 128 128" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <!-- Generator: Sketch 63.1 (92452) - https://sketch.com -->
4
+ <title>Favicon-LawDistrict</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <defs>
7
+ <polygon id="path-1" points="0.141306664 0.0946988736 48.5945545 0.0946988736 48.5945545 60.3311288 0.141306664 60.3311288"></polygon>
8
+ </defs>
9
+ <g id="Favicon-LawDistrict" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
10
+ <rect id="Rectangle-Copy-39" fill="#078080" x="0" y="0" width="128" height="128"></rect>
11
+ <g id="Group-8-Copy-5" transform="translate(29.000000, 22.000000)">
12
+ <path d="M21.9284372,72.0982728 C21.9284372,72.5546845 21.4493349,72.8792568 20.9798087,72.7402365 L18.0303257,71.8667637 C17.7291093,71.7774345 17.5245259,71.5177767 17.5245259,71.2245128 L17.5245259,61.8561511 C17.5245259,61.3994521 18.0039185,61.0751671 18.4731544,61.2139002 L21.4229276,62.0876602 C21.724144,62.1769894 21.9284372,62.4366472 21.9284372,62.7299111 L21.9284372,72.0982728 Z M13.1777819,69.4229931 C13.1777819,69.878256 12.6980991,70.2019665 12.2288632,70.0635207 L9.27938011,69.1917713 C8.97816372,69.1027294 8.77387052,68.843646 8.77387052,68.5509565 L8.77387052,51.0427249 C8.77387052,50.5871748 9.25297289,50.2634643 9.72220883,50.4019101 L12.6719821,51.2739467 C12.9731985,51.3629887 13.1777819,51.6217848 13.1777819,51.9144743 L13.1777819,69.4229931 Z M42.6180568,55.1286013 L2.27334221,42.6831224 C1.15466283,42.3381566 0,43.1099492 0,44.2025801 L0,70.5521024 C0,71.2417467 0.475910291,71.8538382 1.18223081,72.0715602 L41.5266552,84.5167519 C42.6453346,84.8620048 43.7999974,84.0902122 43.7999974,82.9972941 L43.7999974,56.648059 C43.7999974,55.958702 43.3237969,55.3463232 42.6180568,55.1286013 L42.6180568,55.1286013 Z" id="Fill-1" fill="#FFFFFF"></path>
13
+ <path d="M55.9064286,73.1155775 L50.5668712,71.4575512 C49.8548522,71.2364421 49.374415,70.6154115 49.3741222,69.91533 L49.3627041,53.0454081 C49.3621186,52.3453266 48.8819742,51.724296 48.1699551,51.503187 L28.4778854,45.3885586 C27.7658663,45.1674495 27.2851364,44.5458355 27.2851364,43.8454623 L27.2851364,40.7023881 C27.2851364,40.0020149 26.8049919,39.3804009 26.0926801,39.1592919 L10.8220379,34.4174066 C10.1117755,34.1971726 9.63192382,33.5784756 9.62928888,32.8801443 L9.59999943,22.6335767 C9.59562022,21.5213222 10.7626054,20.7334388 11.8935797,21.0843547 L57.0072475,35.0929852 C57.7192666,35.3140943 58.1999965,35.9357083 58.1999965,36.6360815 L58.1999965,71.5724813 C58.1999965,72.6821104 57.034768,73.46591 55.9064286,73.1155775" id="Fill-3" fill="#FFFFFF"></path>
14
+ <g id="Group-7" transform="translate(21.599999, 0.600000)">
15
+ <mask id="mask-2" fill="white">
16
+ <use xlink:href="#path-1"></use>
17
+ </mask>
18
+ <g id="Clip-6"></g>
19
+ <path d="M39.7802451,57.0626606 L39.7802451,32.1892362 C39.7802451,31.4933445 39.3008547,30.8759324 38.5911004,30.6567106 L18.9311377,24.5894496 C18.2208001,24.3705173 17.7417013,23.7528157 17.7417013,23.0572135 L17.7417013,19.9380083 C17.7417013,19.2426957 17.2631858,18.6252836 16.5540146,18.4060618 L1.3459089,13.6990187 C0.63819573,13.4797969 0.159680153,12.8644119 0.158222153,12.1702578 L0.141306664,1.71392666 C0.139268154,0.611156871 1.2995445,-0.169296013 2.42512045,0.178215475 L47.4055848,14.0743311 C48.1162139,14.2938425 48.5947296,14.9121234 48.5947296,15.6083047 L48.5533223,58.7168153 C48.5521559,59.8195851 47.3895468,60.5965628 46.2651372,60.2461554 L40.9647243,58.5934487 C40.2573027,58.3727789 39.7802451,57.7565252 39.7802451,57.0626606" id="Fill-5" fill="#FFFFFF" mask="url(#mask-2)"></path>
20
+ </g>
21
+ </g>
22
+ </g>
23
+ </svg>
@@ -1,5 +1,6 @@
1
1
  import { type FC } from 'react';
2
2
  import { type SearchSelectProps } from './SearchSelectProps.types';
3
+ import './stateFlags/stateFlags.scss';
3
4
  export declare enum MenuPlacement {
4
5
  top = "top",
5
6
  bottom = "bottom",
@@ -5,6 +5,7 @@ import Select from 'react-select';
5
5
  import { SearchSelectStyled } from './SearchSelect.styled';
6
6
  import classNames from 'classnames';
7
7
  import error from '../../../../images/svg/info-error_24px_outlined.svg';
8
+ import './stateFlags/stateFlags.scss';
8
9
  export var MenuPlacement;
9
10
  (function (MenuPlacement) {
10
11
  MenuPlacement["top"] = "top";
@@ -47,6 +48,13 @@ const SearchSelect = (props) => {
47
48
  props.onChange(selectObject);
48
49
  };
49
50
  const TooltipObject = props.tooltip && typeof props.tooltip === 'string' ? (_jsx("p", { className: 'tooltip-form sans-serif --small', children: props.tooltip })) : ('');
51
+ const hasIcons = sortedItems.some((item) => Boolean(item?.iconClassName));
52
+ const formatOptionLabel = (option) => {
53
+ if (!hasIcons)
54
+ return option.label;
55
+ const icon = option.iconClassName ? (_jsx("span", { className: option.iconClassName, role: 'img', "aria-label": option.iconAlt ?? option.label })) : (_jsx("span", { className: 'legal-selector__icon-placeholder', "aria-hidden": 'true' }));
56
+ return (_jsxs("span", { className: 'legal-selector__option', children: [icon, _jsx("span", { className: 'legal-selector__option-label', children: option.label })] }));
57
+ };
50
58
  return (_jsxs(SearchSelectStyled, { children: [props.label && (_jsx("div", { className: 'e-searchselect__inner', children: _jsx("label", { className: 'searchselect__label', children: props.label }) })), _jsxs("div", { className: `${classnames} ${props.width ? 'width' : ''}`, "data-qa": props.dataQA ?? props.name, children: [TooltipObject, _jsxs("span", { className: 'e-searchselect--error sans-serif --small', children: [_jsx("img", { src: error, alt: props.errorMessage, width: '24', height: '24' }), props.errorMessage] }), _jsx(Select, { styles: {
51
59
  control: (baseStyles, state) => {
52
60
  return {
@@ -57,6 +65,6 @@ const SearchSelect = (props) => {
57
65
  };
58
66
  },
59
67
  menuPortal: (base) => ({ ...base, zIndex: 9999 })
60
- }, id: props.name, name: props.name, className: 'legal-selector', defaultValue: defaultValue, onChange: handleChange, isDisabled: props.disabled, isSearchable: props.isSearchable !== false, options: sortedItems, escapeClearsValue: true, isClearable: true, menuPortalTarget: menuPortalTarget, placeholder: props.placeholder, defaultMenuIsOpen: props.defaultMenuIsOpen, menuPlacement: menuPlacement })] })] }));
68
+ }, id: props.name, name: props.name, className: 'legal-selector', defaultValue: defaultValue, onChange: handleChange, isDisabled: props.disabled, isSearchable: props.isSearchable !== false, options: sortedItems, escapeClearsValue: true, isClearable: true, menuPortalTarget: menuPortalTarget, placeholder: props.placeholder, defaultMenuIsOpen: props.defaultMenuIsOpen, menuPlacement: menuPlacement, formatOptionLabel: formatOptionLabel })] })] }));
61
69
  };
62
70
  export default SearchSelect;
@@ -221,4 +221,23 @@ export const SearchSelectStyled = styled.div `
221
221
  width: 60%;
222
222
  }
223
223
  }
224
+
225
+ .legal-selector__option {
226
+ display: flex;
227
+ align-items: center;
228
+ gap: 8px;
229
+ min-width: 0;
230
+ }
231
+
232
+ .legal-selector__option-label {
233
+ overflow: hidden;
234
+ text-overflow: ellipsis;
235
+ white-space: nowrap;
236
+ }
237
+
238
+ .legal-selector__icon-placeholder {
239
+ width: 21px;
240
+ height: 16px;
241
+ flex: 0 0 auto;
242
+ }
224
243
  `;
@@ -222,4 +222,23 @@ export const SearchSelectStyled = styled.div`
222
222
  width: 60%;
223
223
  }
224
224
  }
225
+
226
+ .legal-selector__option {
227
+ display: flex;
228
+ align-items: center;
229
+ gap: 8px;
230
+ min-width: 0;
231
+ }
232
+
233
+ .legal-selector__option-label {
234
+ overflow: hidden;
235
+ text-overflow: ellipsis;
236
+ white-space: nowrap;
237
+ }
238
+
239
+ .legal-selector__icon-placeholder {
240
+ width: 21px;
241
+ height: 16px;
242
+ flex: 0 0 auto;
243
+ }
225
244
  `
@@ -8,6 +8,8 @@ import { SearchSelectStyled } from './SearchSelect.styled'
8
8
  import classNames from 'classnames'
9
9
  import error from '../../../../images/svg/info-error_24px_outlined.svg'
10
10
 
11
+ import './stateFlags/stateFlags.scss'
12
+
11
13
  export enum MenuPlacement {
12
14
  top = 'top',
13
15
  bottom = 'bottom',
@@ -60,6 +62,23 @@ const SearchSelect: FC<SearchSelectProps> = (props) => {
60
62
  ''
61
63
  )
62
64
 
65
+ const hasIcons = sortedItems.some((item) => Boolean(item?.iconClassName))
66
+
67
+ const formatOptionLabel = (option: any): any => {
68
+ if (!hasIcons) return option.label
69
+ const icon = option.iconClassName ? (
70
+ <span className={option.iconClassName} role='img' aria-label={option.iconAlt ?? option.label} />
71
+ ) : (
72
+ <span className='legal-selector__icon-placeholder' aria-hidden='true' />
73
+ )
74
+ return (
75
+ <span className='legal-selector__option'>
76
+ {icon}
77
+ <span className='legal-selector__option-label'>{option.label}</span>
78
+ </span>
79
+ )
80
+ }
81
+
63
82
  return (
64
83
  <SearchSelectStyled>
65
84
  {props.label && (
@@ -99,6 +118,7 @@ const SearchSelect: FC<SearchSelectProps> = (props) => {
99
118
  placeholder={props.placeholder}
100
119
  defaultMenuIsOpen={props.defaultMenuIsOpen}
101
120
  menuPlacement={menuPlacement}
121
+ formatOptionLabel={formatOptionLabel}
102
122
  />
103
123
  </div>
104
124
  </SearchSelectStyled>
@@ -0,0 +1,177 @@
1
+ // Generado desde flags-us-sprite-42x32.json (53 celdas 42x32, bandera 32x32 centrada). No editar a mano.
2
+ $state-flag-width: 21px;
3
+ $state-flag-height: 16px;
4
+ $state-flag-step-x: 23px;
5
+ $state-flag-step-y: 18px;
6
+ $state-flag-sprite-width: 182px;
7
+ $state-flag-sprite-height: 124px;
8
+
9
+ .state-flag {
10
+ display: inline-block;
11
+ width: $state-flag-width;
12
+ height: $state-flag-height;
13
+ flex: 0 0 auto;
14
+ background-image: url('./us-states-sprite.png');
15
+ background-repeat: no-repeat;
16
+ background-size: $state-flag-sprite-width $state-flag-sprite-height;
17
+ }
18
+
19
+ .state-flag-alabama {
20
+ background-position: -0px -0px;
21
+ }
22
+ .state-flag-alaska {
23
+ background-position: -23px -0px;
24
+ }
25
+ .state-flag-arizona {
26
+ background-position: -46px -0px;
27
+ }
28
+ .state-flag-arkansas {
29
+ background-position: -69px -0px;
30
+ }
31
+ .state-flag-california {
32
+ background-position: -92px -0px;
33
+ }
34
+ .state-flag-colorado {
35
+ background-position: -115px -0px;
36
+ }
37
+ .state-flag-connecticut {
38
+ background-position: -138px -0px;
39
+ }
40
+ .state-flag-delaware {
41
+ background-position: -161px -0px;
42
+ }
43
+ .state-flag-district-of-columbia {
44
+ background-position: -0px -18px;
45
+ }
46
+ .state-flag-florida {
47
+ background-position: -23px -18px;
48
+ }
49
+ .state-flag-georgia {
50
+ background-position: -46px -18px;
51
+ }
52
+ .state-flag-guam {
53
+ background-position: -69px -18px;
54
+ }
55
+ .state-flag-hawaii {
56
+ background-position: -92px -18px;
57
+ }
58
+ .state-flag-idaho {
59
+ background-position: -115px -18px;
60
+ }
61
+ .state-flag-illinois {
62
+ background-position: -138px -18px;
63
+ }
64
+ .state-flag-indiana {
65
+ background-position: -161px -18px;
66
+ }
67
+ .state-flag-iowa {
68
+ background-position: -0px -36px;
69
+ }
70
+ .state-flag-kansas {
71
+ background-position: -23px -36px;
72
+ }
73
+ .state-flag-kentucky {
74
+ background-position: -46px -36px;
75
+ }
76
+ .state-flag-louisiana {
77
+ background-position: -69px -36px;
78
+ }
79
+ .state-flag-maine {
80
+ background-position: -92px -36px;
81
+ }
82
+ .state-flag-maryland {
83
+ background-position: -115px -36px;
84
+ }
85
+ .state-flag-massachusetts {
86
+ background-position: -138px -36px;
87
+ }
88
+ .state-flag-michigan {
89
+ background-position: -161px -36px;
90
+ }
91
+ .state-flag-minnesota {
92
+ background-position: -0px -54px;
93
+ }
94
+ .state-flag-mississippi {
95
+ background-position: -23px -54px;
96
+ }
97
+ .state-flag-missouri {
98
+ background-position: -46px -54px;
99
+ }
100
+ .state-flag-montana {
101
+ background-position: -69px -54px;
102
+ }
103
+ .state-flag-nebraska {
104
+ background-position: -92px -54px;
105
+ }
106
+ .state-flag-nevada {
107
+ background-position: -115px -54px;
108
+ }
109
+ .state-flag-new-hampshire {
110
+ background-position: -138px -54px;
111
+ }
112
+ .state-flag-new-jersey {
113
+ background-position: -161px -54px;
114
+ }
115
+ .state-flag-new-mexico {
116
+ background-position: -0px -72px;
117
+ }
118
+ .state-flag-new-york {
119
+ background-position: -23px -72px;
120
+ }
121
+ .state-flag-north-carolina {
122
+ background-position: -46px -72px;
123
+ }
124
+ .state-flag-north-dakota {
125
+ background-position: -69px -72px;
126
+ }
127
+ .state-flag-ohio {
128
+ background-position: -92px -72px;
129
+ }
130
+ .state-flag-oklahoma {
131
+ background-position: -115px -72px;
132
+ }
133
+ .state-flag-oregon {
134
+ background-position: -138px -72px;
135
+ }
136
+ .state-flag-pennsylvania {
137
+ background-position: -161px -72px;
138
+ }
139
+ .state-flag-puerto-rico {
140
+ background-position: -0px -90px;
141
+ }
142
+ .state-flag-rhode-island {
143
+ background-position: -23px -90px;
144
+ }
145
+ .state-flag-south-carolina {
146
+ background-position: -46px -90px;
147
+ }
148
+ .state-flag-south-dakota {
149
+ background-position: -69px -90px;
150
+ }
151
+ .state-flag-tennessee {
152
+ background-position: -92px -90px;
153
+ }
154
+ .state-flag-texas {
155
+ background-position: -115px -90px;
156
+ }
157
+ .state-flag-utah {
158
+ background-position: -138px -90px;
159
+ }
160
+ .state-flag-vermont {
161
+ background-position: -161px -90px;
162
+ }
163
+ .state-flag-virginia {
164
+ background-position: -0px -108px;
165
+ }
166
+ .state-flag-washington {
167
+ background-position: -23px -108px;
168
+ }
169
+ .state-flag-west-virginia {
170
+ background-position: -46px -108px;
171
+ }
172
+ .state-flag-wisconsin {
173
+ background-position: -69px -108px;
174
+ }
175
+ .state-flag-wyoming {
176
+ background-position: -92px -108px;
177
+ }
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { type FormHeaderProps } from './FormHeaderProps';
3
+ export declare const FormHeader: React.FC<FormHeaderProps>;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { FormHeaderInner, FormHeaderStyled } from './FormHeader.styled';
3
+ import { Logo } from '../../atoms';
4
+ import phoneIcon from './svg/phone.svg';
5
+ import trustpilotLogo from './svg/trustpilot-logo.svg';
6
+ import trustpilotStars from './svg/trustpilot-stars.svg';
7
+ const DEFAULT_TRUSTPILOT_TEMPLATE_ID = '5419b637fa0340045cd0c936';
8
+ const getPhoneHref = (phoneNumber) => `tel:${phoneNumber.replace(/[^\d+]/g, '')}`;
9
+ export const FormHeader = ({ siteName = 'LawDistrict', homeUrl = '/', documentName, phoneNumber, phoneHref, showPhone = true, showTrustpilot = true, trustpilot, handleClickLogo, className }) => {
10
+ const handleLogoClick = (event) => {
11
+ handleClickLogo?.(event, homeUrl);
12
+ };
13
+ const hasPhone = showPhone && Boolean(phoneNumber);
14
+ return (_jsx(FormHeaderStyled, { className: className, children: _jsxs(FormHeaderInner, { children: [_jsxs("a", { className: 'form-header__brand', href: homeUrl, onClick: handleLogoClick, "data-qa": 'form-header-logo', children: [_jsx(Logo, { siteName: siteName, type: 'icon', width: '40', height: '40' }), _jsx("p", { className: 'form-header__document-name', children: documentName })] }), _jsxs("div", { className: 'form-header__utilities', children: [hasPhone && (_jsxs("a", { className: 'form-header__phone', href: phoneHref ?? getPhoneHref(phoneNumber), "data-qa": 'form-header-phone', children: [_jsx("img", { src: phoneIcon, alt: '', width: '16', height: '16' }), _jsx("span", { children: phoneNumber })] })), hasPhone && _jsx("span", { className: 'form-header__divider', "aria-hidden": 'true' }), showTrustpilot && (_jsx("div", { className: 'form-header__trustpilot', "data-qa": 'form-header-trustpilot', children: trustpilot ? (_jsx("div", { className: 'trustpilot-widget', "data-locale": trustpilot.locale ?? 'en-US', "data-template-id": trustpilot.templateId ?? DEFAULT_TRUSTPILOT_TEMPLATE_ID, "data-businessunit-id": trustpilot.businessUnitId, "data-style-height": trustpilot.height ?? '20px', "data-style-width": '100%', "data-token": trustpilot.token, children: _jsx("a", { href: trustpilot.profileUrl, target: '_blank', rel: 'noopener noreferrer', children: "Trustpilot" }) })) : (_jsxs(_Fragment, { children: [_jsx("img", { className: 'form-header__trustpilot-logo', src: trustpilotLogo, alt: 'Trustpilot', width: '80', height: '20' }), _jsx("img", { src: trustpilotStars, alt: '', width: '106', height: '20' })] })) }))] })] }) }));
15
+ };
@@ -0,0 +1,2 @@
1
+ export declare const FormHeaderStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never>>> & string;
2
+ export declare const FormHeaderInner: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
@@ -0,0 +1,98 @@
1
+ import styled from 'styled-components';
2
+ export const FormHeaderStyled = styled.header `
3
+ position: sticky;
4
+ top: 0;
5
+ z-index: 999;
6
+ width: 100%;
7
+ background-color: var(--others-white);
8
+ `;
9
+ export const FormHeaderInner = styled.div `
10
+ display: flex;
11
+ align-items: center;
12
+ justify-content: space-between;
13
+ gap: 16px;
14
+ height: 72px;
15
+ padding: 16px 24px;
16
+
17
+ .form-header__brand {
18
+ display: flex;
19
+ align-items: center;
20
+ gap: 16px;
21
+ flex: 1 1 auto;
22
+ min-width: 0;
23
+ text-decoration: none;
24
+ }
25
+
26
+ .form-header__document-name {
27
+ margin: 0;
28
+ overflow: hidden;
29
+ font-family: var(--font-main);
30
+ font-size: 16px;
31
+ font-weight: 700;
32
+ line-height: 22px;
33
+ letter-spacing: -0.3px;
34
+ color: var(--neutral-neutral-2);
35
+ text-overflow: ellipsis;
36
+ white-space: nowrap;
37
+ }
38
+
39
+ .form-header__utilities {
40
+ display: flex;
41
+ align-items: center;
42
+ gap: 16px;
43
+ flex: 0 0 auto;
44
+ }
45
+
46
+ .form-header__phone {
47
+ display: flex;
48
+ align-items: center;
49
+ gap: 8px;
50
+ font-family: var(--font-main);
51
+ font-size: 16px;
52
+ font-weight: 700;
53
+ line-height: 22px;
54
+ letter-spacing: -0.3px;
55
+ color: var(--neutral-neutral-2);
56
+ text-decoration: none;
57
+ white-space: nowrap;
58
+ }
59
+
60
+ .form-header__divider {
61
+ width: 1px;
62
+ height: 34px;
63
+ flex: 0 0 auto;
64
+ border-radius: 2px;
65
+ background-color: var(--neutral-neutral-4);
66
+ }
67
+
68
+ .form-header__trustpilot {
69
+ display: flex;
70
+ align-items: center;
71
+ gap: 8px;
72
+ flex: 0 0 auto;
73
+ overflow: hidden;
74
+ }
75
+
76
+ .form-header__trustpilot img {
77
+ display: block;
78
+ }
79
+
80
+ .form-header__trustpilot .trustpilot-widget {
81
+ height: 20px;
82
+ }
83
+
84
+ .form-header__trustpilot-logo {
85
+ flex: 0 0 auto;
86
+ }
87
+
88
+ @media (max-width: 767px) {
89
+ height: 56px;
90
+ padding: 8px 16px;
91
+
92
+ .form-header__phone,
93
+ .form-header__divider,
94
+ .form-header__trustpilot {
95
+ display: none;
96
+ }
97
+ }
98
+ `;
@@ -0,0 +1,100 @@
1
+ import styled from 'styled-components'
2
+
3
+ export const FormHeaderStyled = styled.header`
4
+ position: sticky;
5
+ top: 0;
6
+ z-index: 999;
7
+ width: 100%;
8
+ background-color: var(--others-white);
9
+ `
10
+
11
+ export const FormHeaderInner = styled.div`
12
+ display: flex;
13
+ align-items: center;
14
+ justify-content: space-between;
15
+ gap: 16px;
16
+ height: 72px;
17
+ padding: 16px 24px;
18
+
19
+ .form-header__brand {
20
+ display: flex;
21
+ align-items: center;
22
+ gap: 16px;
23
+ flex: 1 1 auto;
24
+ min-width: 0;
25
+ text-decoration: none;
26
+ }
27
+
28
+ .form-header__document-name {
29
+ margin: 0;
30
+ overflow: hidden;
31
+ font-family: var(--font-main);
32
+ font-size: 16px;
33
+ font-weight: 700;
34
+ line-height: 22px;
35
+ letter-spacing: -0.3px;
36
+ color: var(--neutral-neutral-2);
37
+ text-overflow: ellipsis;
38
+ white-space: nowrap;
39
+ }
40
+
41
+ .form-header__utilities {
42
+ display: flex;
43
+ align-items: center;
44
+ gap: 16px;
45
+ flex: 0 0 auto;
46
+ }
47
+
48
+ .form-header__phone {
49
+ display: flex;
50
+ align-items: center;
51
+ gap: 8px;
52
+ font-family: var(--font-main);
53
+ font-size: 16px;
54
+ font-weight: 700;
55
+ line-height: 22px;
56
+ letter-spacing: -0.3px;
57
+ color: var(--neutral-neutral-2);
58
+ text-decoration: none;
59
+ white-space: nowrap;
60
+ }
61
+
62
+ .form-header__divider {
63
+ width: 1px;
64
+ height: 34px;
65
+ flex: 0 0 auto;
66
+ border-radius: 2px;
67
+ background-color: var(--neutral-neutral-4);
68
+ }
69
+
70
+ .form-header__trustpilot {
71
+ display: flex;
72
+ align-items: center;
73
+ gap: 8px;
74
+ flex: 0 0 auto;
75
+ overflow: hidden;
76
+ }
77
+
78
+ .form-header__trustpilot img {
79
+ display: block;
80
+ }
81
+
82
+ .form-header__trustpilot .trustpilot-widget {
83
+ height: 20px;
84
+ }
85
+
86
+ .form-header__trustpilot-logo {
87
+ flex: 0 0 auto;
88
+ }
89
+
90
+ @media (max-width: 767px) {
91
+ height: 56px;
92
+ padding: 8px 16px;
93
+
94
+ .form-header__phone,
95
+ .form-header__divider,
96
+ .form-header__trustpilot {
97
+ display: none;
98
+ }
99
+ }
100
+ `