@licklist/design 0.78.14 → 0.78.16
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.
- package/dist/CustomDatePicker/CustomDatePicker.d.ts +10 -0
- package/dist/CustomDatePicker/CustomDatePicker.d.ts.map +1 -0
- package/dist/customRadioButton/RadioButton.d.ts +11 -0
- package/dist/customRadioButton/RadioButton.d.ts.map +1 -0
- package/dist/customRadioButton/RadioButton.js +93 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/sales/guest-profile/profile/Profile.d.ts.map +1 -1
- package/dist/sales/guest-profile/profile/Profile.js +2 -1
- package/dist/snippet/snippet-template/context/snippetTemplate.d.ts.map +1 -1
- package/dist/snippet/snippet-template/context/snippetTemplate.js +1 -0
- package/dist/snippet/snippet-template/context/snippetTemplateView.d.ts.map +1 -1
- package/dist/snippet/snippet-template/context/snippetTemplateView.js +1 -0
- package/dist/snippet/snippet-template/utils/index.d.ts.map +1 -1
- package/dist/snippet/snippet-template/utils/index.js +4 -0
- package/dist/styles/snippet-templates/SnippetTemplate.scss +6 -0
- package/dist/styles/snippet-templates/_snippetVariables.scss +6 -0
- package/package.json +3 -3
- package/src/CustomDatePicker/CustomDatePicker.tsx +258 -0
- package/src/customRadioButton/RadioButton.tsx +84 -0
- package/src/index.ts +1 -0
- package/src/sales/guest-profile/profile/Profile.tsx +2 -5
- package/src/snippet/snippet-template/context/snippetTemplate.tsx +1 -0
- package/src/snippet/snippet-template/context/snippetTemplateView.tsx +1 -0
- package/src/snippet/snippet-template/utils/index.ts +9 -0
- package/src/styles/snippet-templates/SnippetTemplate.scss +6 -0
- package/src/styles/snippet-templates/_snippetVariables.scss +6 -0
- package/dist/CustomAlertTypes/AlertBox.d.ts +0 -22
- package/dist/CustomAlertTypes/AlertBox.d.ts.map +0 -1
- package/dist/CustomAlertTypes/AlertRender.d.ts +0 -21
- package/dist/CustomAlertTypes/AlertRender.d.ts.map +0 -1
- package/dist/CustomAlertTypes/alertThemes.d.ts +0 -41
- package/dist/CustomAlertTypes/alertThemes.d.ts.map +0 -1
- package/dist/CustomAlertTypes/utils/textWrapperUtils.d.ts +0 -8
- package/dist/CustomAlertTypes/utils/textWrapperUtils.d.ts.map +0 -1
- package/src/CustomAlertTypes/AlertBox.tsx +0 -87
- package/src/CustomAlertTypes/AlertRender.ts +0 -283
- package/src/CustomAlertTypes/alertThemes.ts +0 -72
- package/src/CustomAlertTypes/utils/textWrapperUtils.ts +0 -26
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type CustomDatePickerProps = {
|
|
2
|
+
name: string;
|
|
3
|
+
error?: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
showAge?: boolean;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare function CustomDatePicker({ name, error, showAge, required }: CustomDatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=CustomDatePicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomDatePicker.d.ts","sourceRoot":"","sources":["../../src/CustomDatePicker/CustomDatePicker.tsx"],"names":[],"mappings":"AAMA,KAAK,qBAAqB,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,IAAI,EACJ,KAAK,EACL,OAAc,EACd,QAAe,EAChB,EAAE,qBAAqB,2CA8OvB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface RadioButtonProps {
|
|
3
|
+
name: string;
|
|
4
|
+
value: string;
|
|
5
|
+
checked: boolean;
|
|
6
|
+
onChange: (value: string) => void;
|
|
7
|
+
label?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const RadioButton: React.FC<RadioButtonProps>;
|
|
10
|
+
export default RadioButton;
|
|
11
|
+
//# sourceMappingURL=RadioButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioButton.d.ts","sourceRoot":"","sources":["../../src/customRadioButton/RadioButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,UAAU,gBAAgB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAuE3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import 'react';
|
|
3
|
+
|
|
4
|
+
var RadioButton = function(param) {
|
|
5
|
+
var name = param.name, value = param.value, checked = param.checked, onChange = param.onChange, label = param.label;
|
|
6
|
+
// Generate a stable id so label could be connected if needed
|
|
7
|
+
var id = "".concat(name, "-").concat(value);
|
|
8
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
9
|
+
className: "tw-flex tw-items-center tw-space-x-3",
|
|
10
|
+
style: {
|
|
11
|
+
display: 'flex',
|
|
12
|
+
alignItems: 'center',
|
|
13
|
+
gap: 12
|
|
14
|
+
},
|
|
15
|
+
children: [
|
|
16
|
+
/*#__PURE__*/ jsxs("div", {
|
|
17
|
+
className: "tw-relative tw-cursor-pointer",
|
|
18
|
+
style: {
|
|
19
|
+
position: 'relative',
|
|
20
|
+
cursor: 'pointer'
|
|
21
|
+
},
|
|
22
|
+
onClick: function() {
|
|
23
|
+
return onChange(value);
|
|
24
|
+
},
|
|
25
|
+
children: [
|
|
26
|
+
/*#__PURE__*/ jsx("input", {
|
|
27
|
+
id: id,
|
|
28
|
+
type: "radio",
|
|
29
|
+
name: name,
|
|
30
|
+
value: value,
|
|
31
|
+
checked: checked,
|
|
32
|
+
onChange: function() {
|
|
33
|
+
return onChange(value);
|
|
34
|
+
},
|
|
35
|
+
className: "tw-sr-only",
|
|
36
|
+
style: {
|
|
37
|
+
position: 'absolute',
|
|
38
|
+
opacity: 0,
|
|
39
|
+
pointerEvents: 'none',
|
|
40
|
+
width: 0,
|
|
41
|
+
height: 0
|
|
42
|
+
}
|
|
43
|
+
}),
|
|
44
|
+
/*#__PURE__*/ jsx("div", {
|
|
45
|
+
className: "tw-w-[47px] tw-h-[47px] tw-border-[3px] tw-border-black tw-rounded-full tw-bg-white tw-flex tw-items-center tw-justify-center tw-transition-all tw-duration-200 hover:tw-shadow-sm",
|
|
46
|
+
style: {
|
|
47
|
+
width: 52,
|
|
48
|
+
height: 52,
|
|
49
|
+
borderWidth: 3,
|
|
50
|
+
borderStyle: 'solid',
|
|
51
|
+
borderColor: '#000',
|
|
52
|
+
borderRadius: 9999,
|
|
53
|
+
background: '#fff',
|
|
54
|
+
display: 'flex',
|
|
55
|
+
alignItems: 'center',
|
|
56
|
+
justifyContent: 'center',
|
|
57
|
+
transition: 'all 200ms'
|
|
58
|
+
},
|
|
59
|
+
children: checked && /*#__PURE__*/ jsx("div", {
|
|
60
|
+
className: "tw-w-[30px] tw-h-[30px] tw-bg-slate-900 tw-rounded-full",
|
|
61
|
+
style: {
|
|
62
|
+
width: 30,
|
|
63
|
+
height: 30,
|
|
64
|
+
background: '#0f172a',
|
|
65
|
+
borderRadius: 9999
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
})
|
|
69
|
+
]
|
|
70
|
+
}),
|
|
71
|
+
label && /*#__PURE__*/ jsx("label", {
|
|
72
|
+
htmlFor: id,
|
|
73
|
+
className: "tw-cursor-pointer tw-text-gray-700 tw-select-none tw-flex tw-items-center tw-leading-none",
|
|
74
|
+
style: {
|
|
75
|
+
cursor: 'pointer',
|
|
76
|
+
color: '#374151',
|
|
77
|
+
userSelect: 'none',
|
|
78
|
+
display: 'inline-flex',
|
|
79
|
+
alignItems: 'center',
|
|
80
|
+
lineHeight: 1,
|
|
81
|
+
position: 'relative',
|
|
82
|
+
top: 5
|
|
83
|
+
},
|
|
84
|
+
onClick: function() {
|
|
85
|
+
return onChange(value);
|
|
86
|
+
},
|
|
87
|
+
children: label
|
|
88
|
+
})
|
|
89
|
+
]
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export { RadioButton as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -43,4 +43,5 @@ export * from './availability-indicator';
|
|
|
43
43
|
export * from './number-of-people-input';
|
|
44
44
|
export * from './fullscreen-loader';
|
|
45
45
|
export * from './pages';
|
|
46
|
+
export { default as RadioButton } from './customRadioButton/RadioButton';
|
|
46
47
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,2BAA2B,CAAA;AACzC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,wBAAwB,CAAA;AACtC,cAAc,cAAc,CAAA;AAC5B,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,qBAAqB,CAAA;AACnC,cAAc,SAAS,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,2BAA2B,CAAA;AACzC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,wBAAwB,CAAA;AACtC,cAAc,cAAc,CAAA;AAC5B,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,qBAAqB,CAAA;AACnC,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,iCAAiC,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -205,6 +205,7 @@ export { useFullscreenLoader } from './fullscreen-loader/useFullscreenLoader.js'
|
|
|
205
205
|
export { FullscreenLoaderContext } from './fullscreen-loader/context.js';
|
|
206
206
|
export { PrivacyComponent } from './pages/PrivacyComponent.js';
|
|
207
207
|
export { TermsComponent } from './pages/TermsComponent.js';
|
|
208
|
+
export { default as RadioButton } from './customRadioButton/RadioButton.js';
|
|
208
209
|
export { default as CountrySelect } from './static/CountrySelect.js';
|
|
209
210
|
export { default as FormCard } from './static/FormCard.js';
|
|
210
211
|
export { default as Image } from './static/Image.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Profile.d.ts","sourceRoot":"","sources":["../../../../src/sales/guest-profile/profile/Profile.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sDAAsD,CAAA;AAO5E,KAAK,YAAY,GAAG;IAClB,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAGrB,CAAA;AAED,eAAO,MAAM,OAAO,aAAc,YAAY,
|
|
1
|
+
{"version":3,"file":"Profile.d.ts","sourceRoot":"","sources":["../../../../src/sales/guest-profile/profile/Profile.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sDAAsD,CAAA;AAO5E,KAAK,YAAY,GAAG;IAClB,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAGrB,CAAA;AAED,eAAO,MAAM,OAAO,aAAc,YAAY,4CA6C7C,CAAA"}
|
|
@@ -10,7 +10,8 @@ var Profile = function(param) {
|
|
|
10
10
|
if (!user) {
|
|
11
11
|
return null;
|
|
12
12
|
}
|
|
13
|
-
var firstName = user.firstName, lastName = user.lastName,
|
|
13
|
+
var firstName = user.firstName, lastName = user.lastName, userDetail = user.userDetail;
|
|
14
|
+
var gender = userDetail === null || userDetail === void 0 ? void 0 : userDetail.gender;
|
|
14
15
|
return /*#__PURE__*/ jsx("div", {
|
|
15
16
|
className: "profile",
|
|
16
17
|
children: /*#__PURE__*/ jsxs("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snippetTemplate.d.ts","sourceRoot":"","sources":["../../../../src/snippet/snippet-template/context/snippetTemplate.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EAEhB,MAAM,mEAAmE,CAAA;AAG1E,MAAM,MAAM,6BAA6B,GAAG,OAAO,CACjD,eAAe,GAAG;IAChB,IAAI,EAAE,MAAM,CAAA;CACb,CACF,CAAA;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,6BAA6B,CAAA;IACvC,OAAO,EAAE;QACP,cAAc,EAAE,CAAC,YAAY,EAAE,6BAA6B,KAAK,IAAI,CAAA;KACtE,CAAA;CACF;AAED,eAAO,MAAM,sBAAsB,uDACuB,CAAA;AAE1D,MAAM,WAAW,0CACf,SAAQ,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC;IACxC,aAAa,CAAC,EAAE,6BAA6B,CAAA;CAC9C;AAED,wBAAgB,8BAA8B,CAAC,EAC7C,QAAQ,EACR,aAAa,GACd,EAAE,0CAA0C,
|
|
1
|
+
{"version":3,"file":"snippetTemplate.d.ts","sourceRoot":"","sources":["../../../../src/snippet/snippet-template/context/snippetTemplate.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EAEhB,MAAM,mEAAmE,CAAA;AAG1E,MAAM,MAAM,6BAA6B,GAAG,OAAO,CACjD,eAAe,GAAG;IAChB,IAAI,EAAE,MAAM,CAAA;CACb,CACF,CAAA;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,6BAA6B,CAAA;IACvC,OAAO,EAAE;QACP,cAAc,EAAE,CAAC,YAAY,EAAE,6BAA6B,KAAK,IAAI,CAAA;KACtE,CAAA;CACF;AAED,eAAO,MAAM,sBAAsB,uDACuB,CAAA;AAE1D,MAAM,WAAW,0CACf,SAAQ,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC;IACxC,aAAa,CAAC,EAAE,6BAA6B,CAAA;CAC9C;AAED,wBAAgB,8BAA8B,CAAC,EAC7C,QAAQ,EACR,aAAa,GACd,EAAE,0CAA0C,2CA+J5C"}
|
|
@@ -102,6 +102,7 @@ function SnippetTemplateContextProvider(param) {
|
|
|
102
102
|
'--snippet-page-body-left-block-back-button-body-color': template === null || template === void 0 ? void 0 : template.pageBodyLeftBlockBackButtonBodyColor,
|
|
103
103
|
'--snippet-page-body-right-block-background-color': template === null || template === void 0 ? void 0 : template.pageBodyRightBlockBackgroundColor,
|
|
104
104
|
'--snippet-elements-body-color': template === null || template === void 0 ? void 0 : template.elementsBodyColor,
|
|
105
|
+
'--snippet-elements-heading-text-color': (template === null || template === void 0 ? void 0 : template.elementsHeadingTextColor) || (template === null || template === void 0 ? void 0 : template.elementsTitleColor),
|
|
105
106
|
'--snippet-elements-input-border-color': template === null || template === void 0 ? void 0 : template.elementsInputBorderColor,
|
|
106
107
|
'--snippet-elements-input-background-color': template === null || template === void 0 ? void 0 : template.elementsInputBackgroundColor,
|
|
107
108
|
'--snippet-elements-input-body-color': template === null || template === void 0 ? void 0 : template.elementsInputBodyColor,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snippetTemplateView.d.ts","sourceRoot":"","sources":["../../../../src/snippet/snippet-template/context/snippetTemplateView.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB;;;;;;;;;;CAUhC,CAAA;AAED,MAAM,WAAW,gCAAgC;IAC/C,IAAI,EAAE,MAAM,OAAO,oBAAoB,CAAA;IACvC,UAAU,EAAE,OAAO,oBAAoB,CAAA;IACvC,OAAO,EAAE,KAAK,CAAC,QAAQ,CACrB,KAAK,CAAC,cAAc,CAAC,MAAM,OAAO,oBAAoB,CAAC,CACxD,CAAA;CACF;AAED,eAAO,MAAM,0BAA0B,2DACuB,CAAA;AAE9D,eAAO,MAAM,YAAY,EAAE,MAAM,OAAO,oBAA6B,CAAA;AAErE,wBAAgB,kCAAkC,CAAC,EAAE,QAAQ,EAAE;;CAAA,
|
|
1
|
+
{"version":3,"file":"snippetTemplateView.d.ts","sourceRoot":"","sources":["../../../../src/snippet/snippet-template/context/snippetTemplateView.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB;;;;;;;;;;CAUhC,CAAA;AAED,MAAM,WAAW,gCAAgC;IAC/C,IAAI,EAAE,MAAM,OAAO,oBAAoB,CAAA;IACvC,UAAU,EAAE,OAAO,oBAAoB,CAAA;IACvC,OAAO,EAAE,KAAK,CAAC,QAAQ,CACrB,KAAK,CAAC,cAAc,CAAC,MAAM,OAAO,oBAAoB,CAAC,CACxD,CAAA;CACF;AAED,eAAO,MAAM,0BAA0B,2DACuB,CAAA;AAE9D,eAAO,MAAM,YAAY,EAAE,MAAM,OAAO,oBAA6B,CAAA;AAErE,wBAAgB,kCAAkC,CAAC,EAAE,QAAQ,EAAE;;CAAA,2CA2I9D"}
|
|
@@ -112,6 +112,7 @@ function SnippetTemplateViewContextProvider(param) {
|
|
|
112
112
|
},
|
|
113
113
|
elements: {
|
|
114
114
|
elementsBodyColor: t('bodyColor'),
|
|
115
|
+
elementsHeadingTextColor: t('headingTextColor'),
|
|
115
116
|
elementsInputBorderColor: t('inputBorderColor'),
|
|
116
117
|
elementsInputBackgroundColor: t('inputBackgroundColor'),
|
|
117
118
|
elementsInputBodyColor: t('inputBodyColor'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/snippet/snippet-template/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAChB,MAAM,mEAAmE,CAAA;AAE1E,eAAO,MAAM,wBAAwB,cACzB,OAAO,CAAC,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/snippet/snippet-template/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAChB,MAAM,mEAAmE,CAAA;AAE1E,eAAO,MAAM,wBAAwB,cACzB,OAAO,CAAC,eAAe,CAAC,oBAkCnC,CAAA"}
|
|
@@ -116,6 +116,10 @@ var safeMergeDefaultSettings = function() {
|
|
|
116
116
|
var settingKeys = _to_consumable_array(new Set(_to_consumable_array(Object.keys(settingsProps)).concat(_to_consumable_array(Object.keys(DEFAULT_SNIPPET_TEMPLATE_COLORS)))));
|
|
117
117
|
return settingKeys.reduce(function(prevValues, currentKey) {
|
|
118
118
|
var settingsKeyValue = settings[currentKey];
|
|
119
|
+
// Do not default heading text color; leave undefined unless explicitly provided
|
|
120
|
+
if (currentKey === 'elementsHeadingTextColor' && (settingsKeyValue === undefined || settingsKeyValue === null || settingsKeyValue === '')) {
|
|
121
|
+
return prevValues;
|
|
122
|
+
}
|
|
119
123
|
var // @TODO remove when will be integration with
|
|
120
124
|
// calendar type
|
|
121
125
|
_DEFAULT_SNIPPET_TEMPLATE_COLORS_currentKey;
|
|
@@ -257,3 +257,9 @@ $color-transition:
|
|
|
257
257
|
background-color 0.15s ease-in-out,
|
|
258
258
|
border-color 0.15s ease-in-out,
|
|
259
259
|
box-shadow 0.15s ease-in-out !default;
|
|
260
|
+
|
|
261
|
+
// Heading text color variable mapping
|
|
262
|
+
$snippet-elements-heading-text-color: var(
|
|
263
|
+
--snippet-elements-heading-text-color,
|
|
264
|
+
#333333
|
|
265
|
+
) !default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@licklist/design",
|
|
3
|
-
"version": "0.78.
|
|
3
|
+
"version": "0.78.16",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+ssh://git@bitbucket.org/artelogicsoft/licklist_design.git"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
]
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@licklist/core": "0.36.
|
|
45
|
+
"@licklist/core": "0.36.5",
|
|
46
46
|
"@licklist/eslint-config": "0.5.6",
|
|
47
47
|
"@licklist/plugins": "0.36.5",
|
|
48
48
|
"clsx": "2.1.1",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@dnd-kit/utilities": "2.0.0",
|
|
65
65
|
"@fortawesome/fontawesome-svg-core": "1.2.34",
|
|
66
66
|
"@fortawesome/free-solid-svg-icons": "5.15.2",
|
|
67
|
-
"@licklist/core": "0.36.
|
|
67
|
+
"@licklist/core": "0.36.5",
|
|
68
68
|
"@licklist/eslint-config": "0.5.6",
|
|
69
69
|
"@licklist/plugins": "0.36.5",
|
|
70
70
|
"@mantine/core": "6.0.22",
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { TextInput } from '@mantine/core'
|
|
2
|
+
import { useEffect, useState } from 'react'
|
|
3
|
+
import { Controller, useFormContext } from 'react-hook-form'
|
|
4
|
+
import { DateTime } from 'luxon'
|
|
5
|
+
import { useTranslation } from 'react-i18next'
|
|
6
|
+
|
|
7
|
+
type CustomDatePickerProps = {
|
|
8
|
+
name: string
|
|
9
|
+
error?: string
|
|
10
|
+
label?: string
|
|
11
|
+
showAge?: boolean
|
|
12
|
+
required?: boolean
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function CustomDatePicker({
|
|
16
|
+
name,
|
|
17
|
+
error,
|
|
18
|
+
showAge = true,
|
|
19
|
+
required = true
|
|
20
|
+
}: CustomDatePickerProps) {
|
|
21
|
+
const { t } = useTranslation()
|
|
22
|
+
const { control, setValue, watch, getValues, trigger, formState } = useFormContext()
|
|
23
|
+
const [age, setAge] = useState<number | null>(null)
|
|
24
|
+
const [localError, setLocalError] = useState<string | null>(null)
|
|
25
|
+
|
|
26
|
+
// Get current field values
|
|
27
|
+
const day = watch(`${name}_day`) || ''
|
|
28
|
+
const month = watch(`${name}_month`) || ''
|
|
29
|
+
const year = watch(`${name}_year`) || ''
|
|
30
|
+
|
|
31
|
+
// Initialize values from existing date
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
const existingDate = getValues(name)
|
|
34
|
+
|
|
35
|
+
if (existingDate instanceof Date && !day && !month && !year) {
|
|
36
|
+
const dateTime = DateTime.fromJSDate(existingDate)
|
|
37
|
+
if (dateTime.isValid) {
|
|
38
|
+
setValue(`${name}_day`, dateTime.day.toString().padStart(2, '0'))
|
|
39
|
+
setValue(`${name}_month`, dateTime.month.toString().padStart(2, '0'))
|
|
40
|
+
setValue(`${name}_year`, dateTime.year.toString())
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}, [name, setValue, getValues, day, month, year])
|
|
44
|
+
|
|
45
|
+
// Check for empty fields after submit attempt
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (formState.isSubmitted && required) {
|
|
48
|
+
const hasEmptyFields = !day || !month || !year
|
|
49
|
+
|
|
50
|
+
if (hasEmptyFields) {
|
|
51
|
+
setLocalError(t('Validation:fieldRequired', { attribute: t('App:dateOfBirth') }))
|
|
52
|
+
// Set the main field to null to trigger form validation
|
|
53
|
+
setValue(name, null, { shouldValidate: true })
|
|
54
|
+
} else {
|
|
55
|
+
setLocalError(null)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}, [formState.isSubmitted, day, month, year, required, name, setValue, t])
|
|
59
|
+
|
|
60
|
+
// Calculate age and validate date when all fields are filled
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (day && month && year) {
|
|
63
|
+
try {
|
|
64
|
+
// Create a date object
|
|
65
|
+
const dateObj = DateTime.fromObject({
|
|
66
|
+
day: parseInt(day, 10),
|
|
67
|
+
month: parseInt(month, 10),
|
|
68
|
+
year: parseInt(year, 10)
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
// Only proceed if date is valid
|
|
72
|
+
if (dateObj.isValid) {
|
|
73
|
+
// Set the main field value
|
|
74
|
+
setValue(name, dateObj.toJSDate(), { shouldValidate: true })
|
|
75
|
+
setLocalError(null)
|
|
76
|
+
|
|
77
|
+
// Calculate age
|
|
78
|
+
if (showAge) {
|
|
79
|
+
const now = DateTime.now()
|
|
80
|
+
const diff = now.diff(dateObj, 'years')
|
|
81
|
+
setAge(Math.floor(diff.years))
|
|
82
|
+
}
|
|
83
|
+
} else {
|
|
84
|
+
setLocalError(t('Validation:fieldInvalid', { attribute: t('App:dateOfBirth') }))
|
|
85
|
+
setValue(name, null, { shouldValidate: true })
|
|
86
|
+
setAge(null)
|
|
87
|
+
}
|
|
88
|
+
} catch (err) {
|
|
89
|
+
// If any parsing fails, just reset the age display
|
|
90
|
+
setLocalError(t('Validation:fieldInvalid', { attribute: t('App:dateOfBirth') }))
|
|
91
|
+
setValue(name, null, { shouldValidate: true })
|
|
92
|
+
setAge(null)
|
|
93
|
+
}
|
|
94
|
+
} else if (formState.isSubmitted && required) {
|
|
95
|
+
// If form was submitted and fields are required but not all filled
|
|
96
|
+
setLocalError(t('Validation:fieldRequired', { attribute: t('App:dateOfBirth') }))
|
|
97
|
+
setValue(name, null, { shouldValidate: true })
|
|
98
|
+
setAge(null)
|
|
99
|
+
} else {
|
|
100
|
+
// Reset if not all fields are filled but not submitted yet
|
|
101
|
+
setValue(name, null, { shouldValidate: false })
|
|
102
|
+
setAge(null)
|
|
103
|
+
}
|
|
104
|
+
}, [day, month, year, name, setValue, showAge, formState.isSubmitted, required, t])
|
|
105
|
+
|
|
106
|
+
// After user completes all fields, validate the form
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
if (day && month && year) {
|
|
109
|
+
trigger(name)
|
|
110
|
+
}
|
|
111
|
+
}, [day, month, year, name, trigger])
|
|
112
|
+
|
|
113
|
+
// Display either the form error or our local error
|
|
114
|
+
const displayError = error || localError
|
|
115
|
+
|
|
116
|
+
return (
|
|
117
|
+
<div className="tw-w-full">
|
|
118
|
+
<div className="tw-flex tw-flex-col">
|
|
119
|
+
<div className="tw-mb-2 tw-flex tw-items-center tw-justify-between">
|
|
120
|
+
<label className="tw-font-semibold">
|
|
121
|
+
{t('App:dateOfBirth')}
|
|
122
|
+
{required && <span className="tw-ml-1 tw-text-red-500"></span>}
|
|
123
|
+
</label>
|
|
124
|
+
{age !== null && (
|
|
125
|
+
<span className="tw-text-sm tw-text-gray-600">
|
|
126
|
+
{t('App:Age')}: {age}
|
|
127
|
+
</span>
|
|
128
|
+
)}
|
|
129
|
+
</div>
|
|
130
|
+
|
|
131
|
+
<div className="tw-flex tw-flex-row tw-gap-4">
|
|
132
|
+
<div className="tw-w-1/3">
|
|
133
|
+
<label className="tw-mb-1 tw-block tw-text-sm">{t('App:Day')}</label>
|
|
134
|
+
<Controller
|
|
135
|
+
control={control}
|
|
136
|
+
name={`${name}_day`}
|
|
137
|
+
defaultValue=""
|
|
138
|
+
render={({ field }) => (
|
|
139
|
+
<TextInput
|
|
140
|
+
{...field}
|
|
141
|
+
value={field.value || ''}
|
|
142
|
+
placeholder="DD"
|
|
143
|
+
maxLength={2}
|
|
144
|
+
error={!!displayError}
|
|
145
|
+
classNames={{ input: 'tw-placeholder-[#626A90]' }}
|
|
146
|
+
styles={{ input: { '&::placeholder': { color: '#626A90' } } }}
|
|
147
|
+
onChange={(e) => {
|
|
148
|
+
const value = e.target.value.replace(/[^0-9]/g, '')
|
|
149
|
+
field.onChange(value)
|
|
150
|
+
}}
|
|
151
|
+
onBlur={(e) => {
|
|
152
|
+
// Validate and format on blur
|
|
153
|
+
let value = e.target.value.replace(/[^0-9]/g, '')
|
|
154
|
+
if (value) {
|
|
155
|
+
const num = parseInt(value, 10)
|
|
156
|
+
if (num < 1) value = '01'
|
|
157
|
+
else if (num > 31) value = '31'
|
|
158
|
+
else value = num.toString().padStart(2, '0')
|
|
159
|
+
}
|
|
160
|
+
field.onChange(value)
|
|
161
|
+
}}
|
|
162
|
+
/>
|
|
163
|
+
)}
|
|
164
|
+
/>
|
|
165
|
+
</div>
|
|
166
|
+
|
|
167
|
+
<div className="tw-w-1/3">
|
|
168
|
+
<label className="tw-mb-1 tw-block tw-text-sm">{t('App:Month')}</label>
|
|
169
|
+
<Controller
|
|
170
|
+
control={control}
|
|
171
|
+
name={`${name}_month`}
|
|
172
|
+
defaultValue=""
|
|
173
|
+
render={({ field }) => (
|
|
174
|
+
<TextInput
|
|
175
|
+
{...field}
|
|
176
|
+
value={field.value || ''}
|
|
177
|
+
placeholder="MM"
|
|
178
|
+
maxLength={2}
|
|
179
|
+
error={!!displayError}
|
|
180
|
+
classNames={{ input: 'tw-placeholder-[#626A90]' }}
|
|
181
|
+
styles={{ input: { '&::placeholder': { color: '#626A90' } } }}
|
|
182
|
+
onChange={(e) => {
|
|
183
|
+
const value = e.target.value.replace(/[^0-9]/g, '')
|
|
184
|
+
field.onChange(value)
|
|
185
|
+
}}
|
|
186
|
+
onBlur={(e) => {
|
|
187
|
+
// Validate and format on blur
|
|
188
|
+
let value = e.target.value.replace(/[^0-9]/g, '')
|
|
189
|
+
if (value) {
|
|
190
|
+
const num = parseInt(value, 10)
|
|
191
|
+
if (num < 1) value = '01'
|
|
192
|
+
else if (num > 12) value = '12'
|
|
193
|
+
else value = num.toString().padStart(2, '0')
|
|
194
|
+
}
|
|
195
|
+
field.onChange(value)
|
|
196
|
+
}}
|
|
197
|
+
/>
|
|
198
|
+
)}
|
|
199
|
+
/>
|
|
200
|
+
</div>
|
|
201
|
+
|
|
202
|
+
<div className="tw-w-1/3">
|
|
203
|
+
<label className="tw-mb-1 tw-block tw-text-sm">{t('App:Year')}</label>
|
|
204
|
+
<Controller
|
|
205
|
+
control={control}
|
|
206
|
+
name={`${name}_year`}
|
|
207
|
+
defaultValue=""
|
|
208
|
+
render={({ field }) => (
|
|
209
|
+
<TextInput
|
|
210
|
+
{...field}
|
|
211
|
+
value={field.value || ''}
|
|
212
|
+
placeholder="YYYY"
|
|
213
|
+
maxLength={4}
|
|
214
|
+
error={!!displayError}
|
|
215
|
+
classNames={{ input: 'tw-placeholder-[#626A90]' }}
|
|
216
|
+
styles={{ input: { '&::placeholder': { color: '#626A90' } } }}
|
|
217
|
+
onChange={(e) => {
|
|
218
|
+
const value = e.target.value.replace(/[^0-9]/g, '')
|
|
219
|
+
field.onChange(value)
|
|
220
|
+
}}
|
|
221
|
+
onBlur={(e) => {
|
|
222
|
+
// Validate on blur
|
|
223
|
+
const value = e.target.value.replace(/[^0-9]/g, '')
|
|
224
|
+
if (value) {
|
|
225
|
+
const num = parseInt(value, 10)
|
|
226
|
+
const currentYear = new Date().getFullYear()
|
|
227
|
+
if (num > currentYear) {
|
|
228
|
+
field.onChange(currentYear.toString())
|
|
229
|
+
} else if (num < 1900) {
|
|
230
|
+
field.onChange('1900')
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}}
|
|
234
|
+
/>
|
|
235
|
+
)}
|
|
236
|
+
/>
|
|
237
|
+
</div>
|
|
238
|
+
</div>
|
|
239
|
+
</div>
|
|
240
|
+
|
|
241
|
+
{/* Hidden field to store the actual date value */}
|
|
242
|
+
<Controller
|
|
243
|
+
control={control}
|
|
244
|
+
name={name}
|
|
245
|
+
defaultValue={null}
|
|
246
|
+
rules={{
|
|
247
|
+
validate: value => {
|
|
248
|
+
if (required && !value) {
|
|
249
|
+
return t('Validation:fieldRequired', { attribute: t('App:dateOfBirth') })
|
|
250
|
+
}
|
|
251
|
+
return true
|
|
252
|
+
}
|
|
253
|
+
}}
|
|
254
|
+
render={() => <input type="hidden" />}
|
|
255
|
+
/>
|
|
256
|
+
</div>
|
|
257
|
+
)
|
|
258
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
interface RadioButtonProps {
|
|
4
|
+
name: string;
|
|
5
|
+
value: string;
|
|
6
|
+
checked: boolean;
|
|
7
|
+
onChange: (value: string) => void;
|
|
8
|
+
label?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const RadioButton: React.FC<RadioButtonProps> = ({
|
|
12
|
+
name,
|
|
13
|
+
value,
|
|
14
|
+
checked,
|
|
15
|
+
onChange,
|
|
16
|
+
label
|
|
17
|
+
}) => {
|
|
18
|
+
// Generate a stable id so label could be connected if needed
|
|
19
|
+
const id = `${name}-${value}`;
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div
|
|
23
|
+
className="tw-flex tw-items-center tw-space-x-3"
|
|
24
|
+
style={{ display: 'flex', alignItems: 'center', gap: 12 }}
|
|
25
|
+
>
|
|
26
|
+
<div
|
|
27
|
+
className="tw-relative tw-cursor-pointer"
|
|
28
|
+
style={{ position: 'relative', cursor: 'pointer' }}
|
|
29
|
+
onClick={() => onChange(value)}
|
|
30
|
+
>
|
|
31
|
+
{/* Hidden native radio input for accessibility */}
|
|
32
|
+
<input
|
|
33
|
+
id={id}
|
|
34
|
+
type="radio"
|
|
35
|
+
name={name}
|
|
36
|
+
value={value}
|
|
37
|
+
checked={checked}
|
|
38
|
+
onChange={() => onChange(value)}
|
|
39
|
+
className="tw-sr-only"
|
|
40
|
+
style={{ position: 'absolute', opacity: 0, pointerEvents: 'none', width: 0, height: 0 }}
|
|
41
|
+
/>
|
|
42
|
+
|
|
43
|
+
{/* Custom radio button circle */}
|
|
44
|
+
<div
|
|
45
|
+
className="tw-w-[47px] tw-h-[47px] tw-border-[3px] tw-border-black tw-rounded-full tw-bg-white tw-flex tw-items-center tw-justify-center tw-transition-all tw-duration-200 hover:tw-shadow-sm"
|
|
46
|
+
style={{
|
|
47
|
+
width: 52,
|
|
48
|
+
height: 52,
|
|
49
|
+
borderWidth: 3,
|
|
50
|
+
borderStyle: 'solid',
|
|
51
|
+
borderColor: '#000',
|
|
52
|
+
borderRadius: 9999,
|
|
53
|
+
background: '#fff',
|
|
54
|
+
display: 'flex',
|
|
55
|
+
alignItems: 'center',
|
|
56
|
+
justifyContent: 'center',
|
|
57
|
+
transition: 'all 200ms',
|
|
58
|
+
}}
|
|
59
|
+
>
|
|
60
|
+
{/* Inner filled circle when selected */}
|
|
61
|
+
{checked && (
|
|
62
|
+
<div
|
|
63
|
+
className="tw-w-[30px] tw-h-[30px] tw-bg-slate-900 tw-rounded-full"
|
|
64
|
+
style={{ width: 30, height: 30, background: '#0f172a', borderRadius: 9999 }}
|
|
65
|
+
/>
|
|
66
|
+
)}
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
{label && (
|
|
71
|
+
<label
|
|
72
|
+
htmlFor={id}
|
|
73
|
+
className="tw-cursor-pointer tw-text-gray-700 tw-select-none tw-flex tw-items-center tw-leading-none"
|
|
74
|
+
style={{ cursor: 'pointer', color: '#374151', userSelect: 'none', display: 'inline-flex', alignItems: 'center', lineHeight: 1, position: 'relative', top: 5 }}
|
|
75
|
+
onClick={() => onChange(value)}
|
|
76
|
+
>
|
|
77
|
+
{label}
|
|
78
|
+
</label>
|
|
79
|
+
)}
|
|
80
|
+
</div>
|
|
81
|
+
);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export default RadioButton;
|
package/src/index.ts
CHANGED
|
@@ -16,11 +16,8 @@ export const Profile = ({ user }: ProfileProps) => {
|
|
|
16
16
|
return null
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
const {
|
|
20
|
-
|
|
21
|
-
lastName,
|
|
22
|
-
userDetail: { gender },
|
|
23
|
-
} = user
|
|
19
|
+
const { firstName, lastName, userDetail } = user
|
|
20
|
+
const gender = userDetail?.gender
|
|
24
21
|
|
|
25
22
|
return (
|
|
26
23
|
<div className='profile'>
|
|
@@ -105,6 +105,7 @@ export function SnippetTemplateContextProvider({
|
|
|
105
105
|
'--snippet-page-body-right-block-background-color':
|
|
106
106
|
template?.pageBodyRightBlockBackgroundColor,
|
|
107
107
|
'--snippet-elements-body-color': template?.elementsBodyColor,
|
|
108
|
+
'--snippet-elements-heading-text-color': template?.elementsHeadingTextColor || template?.elementsTitleColor,
|
|
108
109
|
'--snippet-elements-input-border-color':
|
|
109
110
|
template?.elementsInputBorderColor,
|
|
110
111
|
'--snippet-elements-input-background-color':
|
|
@@ -92,6 +92,7 @@ export function SnippetTemplateViewContextProvider({ children }) {
|
|
|
92
92
|
|
|
93
93
|
elements: {
|
|
94
94
|
elementsBodyColor: t('bodyColor'),
|
|
95
|
+
elementsHeadingTextColor: t('headingTextColor'),
|
|
95
96
|
|
|
96
97
|
elementsInputBorderColor: t('inputBorderColor'),
|
|
97
98
|
elementsInputBackgroundColor: t('inputBackgroundColor'),
|
|
@@ -18,6 +18,15 @@ export const safeMergeDefaultSettings = (
|
|
|
18
18
|
return settingKeys.reduce(
|
|
19
19
|
(prevValues, currentKey) => {
|
|
20
20
|
const settingsKeyValue = settings[currentKey]
|
|
21
|
+
|
|
22
|
+
// Do not default heading text color; leave undefined unless explicitly provided
|
|
23
|
+
if (
|
|
24
|
+
currentKey === 'elementsHeadingTextColor' &&
|
|
25
|
+
(settingsKeyValue === undefined || settingsKeyValue === null || settingsKeyValue === '')
|
|
26
|
+
) {
|
|
27
|
+
return prevValues
|
|
28
|
+
}
|
|
29
|
+
|
|
21
30
|
return {
|
|
22
31
|
...prevValues,
|
|
23
32
|
[currentKey]:
|
|
@@ -257,3 +257,9 @@ $color-transition:
|
|
|
257
257
|
background-color 0.15s ease-in-out,
|
|
258
258
|
border-color 0.15s ease-in-out,
|
|
259
259
|
box-shadow 0.15s ease-in-out !default;
|
|
260
|
+
|
|
261
|
+
// Heading text color variable mapping
|
|
262
|
+
$snippet-elements-heading-text-color: var(
|
|
263
|
+
--snippet-elements-heading-text-color,
|
|
264
|
+
#333333
|
|
265
|
+
) !default;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { alertThemes } from "./alertThemes";
|
|
2
|
-
export interface AlertConfig {
|
|
3
|
-
type: keyof typeof alertThemes;
|
|
4
|
-
title?: string;
|
|
5
|
-
subTitle?: string;
|
|
6
|
-
message?: string | string[];
|
|
7
|
-
description?: string;
|
|
8
|
-
actionText?: string;
|
|
9
|
-
secondaryActionText?: string;
|
|
10
|
-
onAction?: (() => void) | null;
|
|
11
|
-
onSecondaryAction?: (() => void) | null;
|
|
12
|
-
timeout?: number;
|
|
13
|
-
closable?: boolean;
|
|
14
|
-
titleColor?: string;
|
|
15
|
-
subTitleColor?: string;
|
|
16
|
-
showArrow?: boolean;
|
|
17
|
-
showSecondaryArrow?: boolean;
|
|
18
|
-
alignActionsRight?: boolean;
|
|
19
|
-
mount?: "container" | "global";
|
|
20
|
-
}
|
|
21
|
-
export declare function showAlert(config: AlertConfig): void;
|
|
22
|
-
//# sourceMappingURL=AlertBox.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AlertBox.d.ts","sourceRoot":"","sources":["../../src/CustomAlertTypes/AlertBox.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,OAAO,WAAW,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;IAC/B,iBAAiB,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,KAAK,CAAC,EAAE,WAAW,GAAG,QAAQ,CAAC;CAChC;AAqDD,wBAAgB,SAAS,CAAC,MAAM,EAAE,WAAW,QAW5C"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { AlertConfig } from './AlertBox';
|
|
3
|
-
export declare class AlertRenderer {
|
|
4
|
-
static createAlert(config: AlertConfig, onClose: () => void): React.DetailedReactHTMLElement<{
|
|
5
|
-
style: {
|
|
6
|
-
backgroundColor: string;
|
|
7
|
-
border: string;
|
|
8
|
-
borderRadius: string;
|
|
9
|
-
padding: string;
|
|
10
|
-
width: string;
|
|
11
|
-
maxWidth: string;
|
|
12
|
-
margin: string;
|
|
13
|
-
pointerEvents: "auto";
|
|
14
|
-
fontFamily: string;
|
|
15
|
-
position: "relative";
|
|
16
|
-
overflow: "hidden";
|
|
17
|
-
boxSizing: "border-box";
|
|
18
|
-
};
|
|
19
|
-
}, HTMLElement>;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=AlertRender.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AlertRender.d.ts","sourceRoot":"","sources":["../../src/CustomAlertTypes/AlertRender.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,qBAAa,aAAa;IACxB,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,IAAI;;;;;;;;;;;;;;;;CAoR5D"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export declare const ErrorIcon: () => React.ReactSVGElement;
|
|
3
|
-
export declare const SuccessIcon: () => React.ReactSVGElement;
|
|
4
|
-
export declare const InfoIcon: () => React.ReactSVGElement;
|
|
5
|
-
export declare const WarningIcon: () => React.ReactSVGElement;
|
|
6
|
-
export declare const commonStyle: {
|
|
7
|
-
fontFamily: string;
|
|
8
|
-
color: string;
|
|
9
|
-
borderRad: string;
|
|
10
|
-
};
|
|
11
|
-
export declare const alertThemes: {
|
|
12
|
-
error: {
|
|
13
|
-
bg: string;
|
|
14
|
-
border: string;
|
|
15
|
-
icon: string;
|
|
16
|
-
IconComponent: () => React.ReactSVGElement;
|
|
17
|
-
defaultTitle: string;
|
|
18
|
-
};
|
|
19
|
-
success: {
|
|
20
|
-
bg: string;
|
|
21
|
-
border: string;
|
|
22
|
-
icon: string;
|
|
23
|
-
IconComponent: () => React.ReactSVGElement;
|
|
24
|
-
defaultTitle: string;
|
|
25
|
-
};
|
|
26
|
-
warning: {
|
|
27
|
-
bg: string;
|
|
28
|
-
border: string;
|
|
29
|
-
icon: string;
|
|
30
|
-
IconComponent: () => React.ReactSVGElement;
|
|
31
|
-
defaultTitle: string;
|
|
32
|
-
};
|
|
33
|
-
info: {
|
|
34
|
-
bg: string;
|
|
35
|
-
border: string;
|
|
36
|
-
icon: string;
|
|
37
|
-
IconComponent: () => React.ReactSVGElement;
|
|
38
|
-
defaultTitle: string;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
//# sourceMappingURL=alertThemes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"alertThemes.d.ts","sourceRoot":"","sources":["../../src/CustomAlertTypes/alertThemes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AA8B1B,eAAO,MAAM,SAAS,6BAA0C,CAAC;AACjE,eAAO,MAAM,WAAW,6BAA4C,CAAC;AACrE,eAAO,MAAM,QAAQ,6BAAyC,CAAC;AAC/D,eAAO,MAAM,WAAW,6BAA4C,CAAC;AAErE,eAAO,MAAM,WAAW;;;;CAIvB,CAAA;AAGD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BvB,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wraps text into multiple lines by word count limit.
|
|
3
|
-
* @param text - The input string
|
|
4
|
-
* @param limit - Max characters per line
|
|
5
|
-
* @returns Wrapped text as a single string with newlines
|
|
6
|
-
*/
|
|
7
|
-
export declare function wrapText(text: string, limit: number): string;
|
|
8
|
-
//# sourceMappingURL=textWrapperUtils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"textWrapperUtils.d.ts","sourceRoot":"","sources":["../../../src/CustomAlertTypes/utils/textWrapperUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAmB5D"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { createRoot } from "react-dom/client";
|
|
2
|
-
import { AlertRenderer } from './AlertRender';
|
|
3
|
-
import { alertThemes } from "./alertThemes";
|
|
4
|
-
|
|
5
|
-
export interface AlertConfig {
|
|
6
|
-
type: keyof typeof alertThemes;
|
|
7
|
-
title?: string;
|
|
8
|
-
subTitle?: string;
|
|
9
|
-
message?: string | string[];
|
|
10
|
-
description?: string;
|
|
11
|
-
actionText?: string;
|
|
12
|
-
secondaryActionText?: string;
|
|
13
|
-
onAction?: (() => void) | null;
|
|
14
|
-
onSecondaryAction?: (() => void) | null;
|
|
15
|
-
timeout?: number;
|
|
16
|
-
closable?: boolean;
|
|
17
|
-
titleColor?: string;
|
|
18
|
-
subTitleColor?: string;
|
|
19
|
-
showArrow?: boolean;
|
|
20
|
-
showSecondaryArrow?: boolean;
|
|
21
|
-
alignActionsRight?: boolean;
|
|
22
|
-
mount?: "container" | "global";
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
let container: HTMLDivElement | null = null;
|
|
26
|
-
let root: any = null;
|
|
27
|
-
|
|
28
|
-
function createContainer(mount: "container" | "global" = "global") {
|
|
29
|
-
if (container) return container;
|
|
30
|
-
container = document.createElement("div");
|
|
31
|
-
root = createRoot(container);
|
|
32
|
-
|
|
33
|
-
if (mount === "container") {
|
|
34
|
-
const containerFluid = document.querySelector(
|
|
35
|
-
".container-fluid"
|
|
36
|
-
) as HTMLDivElement | null;
|
|
37
|
-
|
|
38
|
-
if (containerFluid) {
|
|
39
|
-
container.style.cssText = `
|
|
40
|
-
width: 100%;
|
|
41
|
-
margin-bottom: 1rem;
|
|
42
|
-
pointer-events: auto;
|
|
43
|
-
`;
|
|
44
|
-
containerFluid.insertBefore(container, containerFluid.firstChild);
|
|
45
|
-
} else {
|
|
46
|
-
document.body.appendChild(container);
|
|
47
|
-
}
|
|
48
|
-
} else {
|
|
49
|
-
container.style.cssText = `
|
|
50
|
-
position: fixed;
|
|
51
|
-
top: 0;
|
|
52
|
-
left: 0;
|
|
53
|
-
right: 0;
|
|
54
|
-
z-index: 9999;
|
|
55
|
-
pointer-events: none;
|
|
56
|
-
`;
|
|
57
|
-
document.body.appendChild(container);
|
|
58
|
-
}
|
|
59
|
-
injectShrinkBarAnimation();
|
|
60
|
-
return container;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function injectShrinkBarAnimation() {
|
|
64
|
-
if (document.getElementById('shrinkBar-style')) return;
|
|
65
|
-
const style = document.createElement('style');
|
|
66
|
-
style.id = 'shrinkBar-style';
|
|
67
|
-
style.textContent = `
|
|
68
|
-
@keyframes shrinkBar {
|
|
69
|
-
from { width: 100%; }
|
|
70
|
-
to { width: 0%; }
|
|
71
|
-
}
|
|
72
|
-
`;
|
|
73
|
-
document.head.appendChild(style);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export function showAlert(config: AlertConfig) {
|
|
77
|
-
createContainer(config.mount || "global");
|
|
78
|
-
const removeAlert = () => {
|
|
79
|
-
if (root) root.render(null);
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
if (config.timeout && config.timeout > 0) {
|
|
83
|
-
setTimeout(removeAlert, config.timeout);
|
|
84
|
-
}
|
|
85
|
-
const alertBox = AlertRenderer.createAlert(config, removeAlert);
|
|
86
|
-
root.render(alertBox);
|
|
87
|
-
}
|
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { MdClose, MdArrowForward } from "react-icons/md";
|
|
3
|
-
import { alertThemes, commonStyle } from "./alertThemes";
|
|
4
|
-
import { wrapText } from "./utils/textWrapperUtils";
|
|
5
|
-
import { AlertConfig } from './AlertBox'
|
|
6
|
-
export class AlertRenderer {
|
|
7
|
-
static createAlert(config: AlertConfig, onClose: () => void) {
|
|
8
|
-
const theme = alertThemes[config.type];
|
|
9
|
-
|
|
10
|
-
return React.createElement(
|
|
11
|
-
"div",
|
|
12
|
-
{
|
|
13
|
-
style: {
|
|
14
|
-
backgroundColor: theme.bg,
|
|
15
|
-
border: theme.border,
|
|
16
|
-
borderRadius: commonStyle.borderRad,
|
|
17
|
-
padding: "16px 20px 0",
|
|
18
|
-
width: "100%",
|
|
19
|
-
maxWidth: "100%",
|
|
20
|
-
margin: "0 auto",
|
|
21
|
-
pointerEvents: "auto",
|
|
22
|
-
fontFamily: commonStyle.fontFamily,
|
|
23
|
-
position: "relative",
|
|
24
|
-
overflow: "hidden",
|
|
25
|
-
boxSizing: "border-box",
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
// HEADER ROW (icon + title + close button)
|
|
30
|
-
React.createElement(
|
|
31
|
-
"div",
|
|
32
|
-
{
|
|
33
|
-
style: {
|
|
34
|
-
display: "grid",
|
|
35
|
-
gridTemplateColumns: "20px 1fr auto", // icon | title | X
|
|
36
|
-
alignItems: "center",
|
|
37
|
-
columnGap: "12px",
|
|
38
|
-
marginBottom: "4px",
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
// Icon
|
|
43
|
-
React.createElement(theme.IconComponent, {
|
|
44
|
-
size: 20,
|
|
45
|
-
style: {
|
|
46
|
-
color: theme.icon,
|
|
47
|
-
gridColumn: "1 / 2",
|
|
48
|
-
gridRow: "1 / 2",
|
|
49
|
-
},
|
|
50
|
-
}),
|
|
51
|
-
|
|
52
|
-
// Title
|
|
53
|
-
React.createElement(
|
|
54
|
-
"h4",
|
|
55
|
-
{
|
|
56
|
-
style: {
|
|
57
|
-
gridColumn: "2 / 3",
|
|
58
|
-
gridRow: "1 / 2",
|
|
59
|
-
alignSelf: "center",
|
|
60
|
-
fontFamily: commonStyle.fontFamily,
|
|
61
|
-
fontSize: "16px",
|
|
62
|
-
fontWeight: 600,
|
|
63
|
-
lineHeight: "18px",
|
|
64
|
-
color: config.titleColor || commonStyle.fontFamily,
|
|
65
|
-
margin: 0,
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
config.title || theme.defaultTitle
|
|
69
|
-
),
|
|
70
|
-
|
|
71
|
-
// Close Button
|
|
72
|
-
config.closable !== true &&
|
|
73
|
-
React.createElement(
|
|
74
|
-
"button",
|
|
75
|
-
{
|
|
76
|
-
style: {
|
|
77
|
-
gridColumn: "3 / 4",
|
|
78
|
-
gridRow: "1 / 2",
|
|
79
|
-
background: "none",
|
|
80
|
-
border: "none",
|
|
81
|
-
color: config.type === "info" ? "#1E3A8A" : theme.icon,
|
|
82
|
-
cursor: "pointer",
|
|
83
|
-
padding: 0,
|
|
84
|
-
lineHeight: 1,
|
|
85
|
-
display: "flex",
|
|
86
|
-
alignItems: "center",
|
|
87
|
-
},
|
|
88
|
-
onClick: onClose,
|
|
89
|
-
},
|
|
90
|
-
React.createElement(MdClose, { size: 20 })
|
|
91
|
-
)
|
|
92
|
-
),
|
|
93
|
-
|
|
94
|
-
// BODY (Subtitle, Message, Description, Actions)
|
|
95
|
-
React.createElement(
|
|
96
|
-
"div",
|
|
97
|
-
{
|
|
98
|
-
style: {
|
|
99
|
-
marginLeft: "32px", // aligns with title, not icon
|
|
100
|
-
marginBottom:
|
|
101
|
-
!config.message && !config.description && !config.actionText
|
|
102
|
-
? "12px"
|
|
103
|
-
: "0",
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
// Subtitle
|
|
108
|
-
config.subTitle &&
|
|
109
|
-
React.createElement(
|
|
110
|
-
"span",
|
|
111
|
-
{
|
|
112
|
-
style: {
|
|
113
|
-
fontFamily: "Geist, system-ui, sans-serif",
|
|
114
|
-
fontSize: "16px",
|
|
115
|
-
fontWeight: 600,
|
|
116
|
-
lineHeight: "18px",
|
|
117
|
-
color: config.subTitleColor || commonStyle.color,
|
|
118
|
-
display: "block",
|
|
119
|
-
marginBottom: "4px",
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
config.subTitle
|
|
123
|
-
),
|
|
124
|
-
|
|
125
|
-
// Message
|
|
126
|
-
config.message &&
|
|
127
|
-
(Array.isArray(config.message)
|
|
128
|
-
? React.createElement(
|
|
129
|
-
"ul",
|
|
130
|
-
{
|
|
131
|
-
style: {
|
|
132
|
-
margin: "0 0 8px 0",
|
|
133
|
-
paddingLeft: "20px",
|
|
134
|
-
fontFamily: commonStyle.fontFamily,
|
|
135
|
-
fontSize: "15px",
|
|
136
|
-
fontWeight: 400,
|
|
137
|
-
lineHeight: "20px",
|
|
138
|
-
color: commonStyle.color,
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
config.message.map((line, idx) =>
|
|
142
|
-
React.createElement(
|
|
143
|
-
"li",
|
|
144
|
-
{
|
|
145
|
-
key: idx,
|
|
146
|
-
style: {
|
|
147
|
-
fontSize: "15px",
|
|
148
|
-
fontWeight: 400,
|
|
149
|
-
lineHeight: "20px",
|
|
150
|
-
fontFamily: "Geist, system-ui, sans-serif",
|
|
151
|
-
color: commonStyle.color,
|
|
152
|
-
},
|
|
153
|
-
},
|
|
154
|
-
line
|
|
155
|
-
)
|
|
156
|
-
)
|
|
157
|
-
)
|
|
158
|
-
: React.createElement(
|
|
159
|
-
"p",
|
|
160
|
-
{
|
|
161
|
-
style: {
|
|
162
|
-
fontFamily: commonStyle.fontFamily,
|
|
163
|
-
fontSize: "15px",
|
|
164
|
-
fontWeight: 400,
|
|
165
|
-
lineHeight: "20px",
|
|
166
|
-
color: commonStyle.color,
|
|
167
|
-
margin: "0 0 8px 0",
|
|
168
|
-
},
|
|
169
|
-
},
|
|
170
|
-
config.message
|
|
171
|
-
)),
|
|
172
|
-
|
|
173
|
-
// Description
|
|
174
|
-
config.description &&
|
|
175
|
-
React.createElement(
|
|
176
|
-
"p",
|
|
177
|
-
{
|
|
178
|
-
style: {
|
|
179
|
-
fontFamily: commonStyle.fontFamily,
|
|
180
|
-
fontSize: "15px",
|
|
181
|
-
fontWeight: 400,
|
|
182
|
-
lineHeight: "20px",
|
|
183
|
-
color: commonStyle.color,
|
|
184
|
-
margin: "0 0 12px 0",
|
|
185
|
-
whiteSpace: "pre-line",
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
wrapText(config.description, 150)
|
|
189
|
-
),
|
|
190
|
-
|
|
191
|
-
// Actions
|
|
192
|
-
(config.actionText || config.secondaryActionText) &&
|
|
193
|
-
React.createElement(
|
|
194
|
-
"div",
|
|
195
|
-
{
|
|
196
|
-
style: {
|
|
197
|
-
display: "flex",
|
|
198
|
-
flexDirection: "row",
|
|
199
|
-
gap: "16px",
|
|
200
|
-
marginTop: "6px",
|
|
201
|
-
justifyContent: config.alignActionsRight
|
|
202
|
-
? "flex-end"
|
|
203
|
-
: "flex-start",
|
|
204
|
-
marginBottom: "8px",
|
|
205
|
-
},
|
|
206
|
-
},
|
|
207
|
-
|
|
208
|
-
// Primary Action
|
|
209
|
-
config.actionText &&
|
|
210
|
-
React.createElement(
|
|
211
|
-
"button",
|
|
212
|
-
{
|
|
213
|
-
style: {
|
|
214
|
-
fontFamily: commonStyle.fontFamily,
|
|
215
|
-
fontSize: "15px",
|
|
216
|
-
fontWeight: 600,
|
|
217
|
-
lineHeight: "20px",
|
|
218
|
-
color: commonStyle.color,
|
|
219
|
-
background: "none",
|
|
220
|
-
border: "none",
|
|
221
|
-
padding: 0,
|
|
222
|
-
cursor: "pointer",
|
|
223
|
-
display: "flex",
|
|
224
|
-
alignItems: "center",
|
|
225
|
-
gap: "4px",
|
|
226
|
-
},
|
|
227
|
-
onClick: () => {
|
|
228
|
-
if (config.onAction) config.onAction();
|
|
229
|
-
onClose();
|
|
230
|
-
},
|
|
231
|
-
},
|
|
232
|
-
config.actionText,
|
|
233
|
-
config.showArrow &&
|
|
234
|
-
React.createElement(MdArrowForward, { size: 16 })
|
|
235
|
-
),
|
|
236
|
-
|
|
237
|
-
// Secondary Action
|
|
238
|
-
config.secondaryActionText &&
|
|
239
|
-
React.createElement(
|
|
240
|
-
"button",
|
|
241
|
-
{
|
|
242
|
-
style: {
|
|
243
|
-
fontFamily: commonStyle.fontFamily,
|
|
244
|
-
fontSize: "15px",
|
|
245
|
-
fontWeight: 600,
|
|
246
|
-
lineHeight: "20px",
|
|
247
|
-
color: commonStyle.color,
|
|
248
|
-
background: "none",
|
|
249
|
-
border: "none",
|
|
250
|
-
padding: 0,
|
|
251
|
-
cursor: "pointer",
|
|
252
|
-
display: "flex",
|
|
253
|
-
alignItems: "center",
|
|
254
|
-
gap: "4px",
|
|
255
|
-
},
|
|
256
|
-
onClick: () => {
|
|
257
|
-
if (config.onSecondaryAction) config.onSecondaryAction();
|
|
258
|
-
onClose();
|
|
259
|
-
},
|
|
260
|
-
},
|
|
261
|
-
config.secondaryActionText,
|
|
262
|
-
config.showSecondaryArrow &&
|
|
263
|
-
React.createElement(MdArrowForward, { size: 16 })
|
|
264
|
-
)
|
|
265
|
-
)
|
|
266
|
-
),
|
|
267
|
-
|
|
268
|
-
// Progress Bar
|
|
269
|
-
config.timeout &&
|
|
270
|
-
React.createElement("div", {
|
|
271
|
-
style: {
|
|
272
|
-
position: "absolute",
|
|
273
|
-
bottom: 0,
|
|
274
|
-
left: 0,
|
|
275
|
-
height: "4px",
|
|
276
|
-
backgroundColor: theme.icon,
|
|
277
|
-
width: "100%",
|
|
278
|
-
animation: `shrinkBar ${config.timeout}ms linear forwards`,
|
|
279
|
-
},
|
|
280
|
-
})
|
|
281
|
-
);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
// Factory for simple SVG icon components
|
|
4
|
-
function createSvgIcon(pathD: string, fillColor: string) {
|
|
5
|
-
return () =>
|
|
6
|
-
React.createElement(
|
|
7
|
-
"svg",
|
|
8
|
-
{
|
|
9
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
-
width: 32,
|
|
11
|
-
height: 32,
|
|
12
|
-
viewBox: "0 0 32 32",
|
|
13
|
-
},
|
|
14
|
-
React.createElement("path", { d: pathD, fill: fillColor })
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// Each icon path (different geometry and colors)
|
|
19
|
-
const iconInfoPath =
|
|
20
|
-
'M16 7C20.9706 7 25 11.0294 25 16C25 20.9706 20.9706 25 16 25C11.0294 25 7 20.9706 7 16C7 11.0294 11.0294 7 16 7ZM16 14C15.4477 14 15 14.4477 15 15V20C15 20.5523 15.4477 21 16 21C16.5523 21 17 20.5523 17 20V15C17 14.4477 16.5523 14 16 14ZM16 11C15.4477 11 15 11.4477 15 12C15 12.5523 15.4477 13 16 13C16.5523 13 17 12.5523 17 12C17 11.4477 16.5523 11 16 11Z';
|
|
21
|
-
|
|
22
|
-
const warningIconPath =
|
|
23
|
-
'M15.3496 8.46973C15.7414 7.84329 16.6543 7.84314 17.0459 8.46973L25.2412 21.583C25.6574 22.249 25.1788 23.113 24.3936 23.1133H8.00195C7.21654 23.1133 6.73711 22.249 7.15332 21.583L15.3496 8.46973ZM16.1973 19.1133C15.6451 19.1134 15.1973 19.5611 15.1973 20.1133C15.1973 20.6654 15.6451 21.1132 16.1973 21.1133C16.7495 21.1133 17.1972 20.6655 17.1973 20.1133C17.1973 19.561 16.7496 19.1133 16.1973 19.1133ZM15.1973 18.1133H17.1973V13.1133H15.1973V18.1133Z';
|
|
24
|
-
|
|
25
|
-
const errorIconPath =
|
|
26
|
-
'M16.1975 7C21.1681 7 25.1975 11.0294 25.1975 16C25.1975 20.9706 21.1681 25 16.1975 25C11.2269 25 7.19751 20.9706 7.19751 16C7.19751 11.0294 11.2269 7 16.1975 7ZM16.1975 14.5859L13.3694 11.7578L11.9553 13.1719L14.7834 16L11.9553 18.8281L13.3694 20.2422L16.1975 17.4141L19.0256 20.2422L20.4397 18.8281L17.6116 16L20.4397 13.1719L19.0256 11.7578L16.1975 14.5859Z';
|
|
27
|
-
|
|
28
|
-
const successIconPath =
|
|
29
|
-
'M16 7C20.9706 7 25 11.0294 25 16C25 20.9706 20.9706 25 16 25C11.0294 25 7 20.9706 7 16C7 11.0294 11.0294 7 16 7ZM14.4463 17.6055L12.7217 15.8076L11.2783 17.1924L14.3525 20.3945L21.6729 13.7402L20.3271 12.2598L14.4463 17.6055Z';
|
|
30
|
-
// Specific icons with unique fills
|
|
31
|
-
export const ErrorIcon = createSvgIcon(errorIconPath, "#E0423A"); // red
|
|
32
|
-
export const SuccessIcon = createSvgIcon(successIconPath, "#52C22B"); // green
|
|
33
|
-
export const InfoIcon = createSvgIcon(iconInfoPath, "#0E8CE2"); // blue
|
|
34
|
-
export const WarningIcon = createSvgIcon(warningIconPath, "#E2A50C"); // yellow
|
|
35
|
-
|
|
36
|
-
export const commonStyle = {
|
|
37
|
-
fontFamily: 'Geist, system-ui, sans-serif',
|
|
38
|
-
color: '#14215A',
|
|
39
|
-
borderRad: '8px',
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
export const alertThemes = {
|
|
44
|
-
error: {
|
|
45
|
-
bg: "#FCECEB",
|
|
46
|
-
border: "2px solid #F5C4C2",
|
|
47
|
-
icon: "#E0423A",
|
|
48
|
-
IconComponent: ErrorIcon,
|
|
49
|
-
defaultTitle: "Error!",
|
|
50
|
-
},
|
|
51
|
-
success: {
|
|
52
|
-
bg: "#EEF9EA",
|
|
53
|
-
border: "2px solid #C9ECBD",
|
|
54
|
-
icon: "#52C22B",
|
|
55
|
-
IconComponent: SuccessIcon,
|
|
56
|
-
defaultTitle: "Success!",
|
|
57
|
-
},
|
|
58
|
-
warning: {
|
|
59
|
-
bg: "#FCF6E7",
|
|
60
|
-
border: "2px solid #F2D68F",
|
|
61
|
-
icon: "#E2A50C",
|
|
62
|
-
IconComponent: WarningIcon,
|
|
63
|
-
defaultTitle: "Warning!",
|
|
64
|
-
},
|
|
65
|
-
info: {
|
|
66
|
-
bg: "#E7F4FC",
|
|
67
|
-
border: "2px solid #B4DBF6",
|
|
68
|
-
icon: "#0E8CE2",
|
|
69
|
-
IconComponent: InfoIcon,
|
|
70
|
-
defaultTitle: "Info",
|
|
71
|
-
},
|
|
72
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wraps text into multiple lines by word count limit.
|
|
3
|
-
* @param text - The input string
|
|
4
|
-
* @param limit - Max characters per line
|
|
5
|
-
* @returns Wrapped text as a single string with newlines
|
|
6
|
-
*/
|
|
7
|
-
export function wrapText(text: string, limit: number): string {
|
|
8
|
-
const words = text.split(' ');
|
|
9
|
-
let lines: string[] = [];
|
|
10
|
-
let currentLine = '';
|
|
11
|
-
|
|
12
|
-
words.forEach((word) => {
|
|
13
|
-
if ((currentLine + word).length >= limit) {
|
|
14
|
-
lines.push(currentLine.trim());
|
|
15
|
-
currentLine = word + ' ';
|
|
16
|
-
} else {
|
|
17
|
-
currentLine += word + ' ';
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
if (currentLine.trim() !== '') {
|
|
22
|
-
lines.push(currentLine.trim());
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return lines.join('\n');
|
|
26
|
-
}
|