opus-toolkit-components 1.2.4 → 1.2.6
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/lib/opus-components.main.js +252 -116
- package/lib/opus-components.main.js.map +1 -1
- package/package.json +3 -3
|
@@ -3737,11 +3737,11 @@ function Button(_ref) {
|
|
|
3737
3737
|
} = _ref;
|
|
3738
3738
|
// Define styles for button ranks
|
|
3739
3739
|
const rankStyles = {
|
|
3740
|
-
primary: 'bg-[--color-primary-btn] hover:bg-[--color-primary-btn-hover] text-
|
|
3741
|
-
secondary: 'bg-transparent hover:
|
|
3740
|
+
primary: 'bg-[--color-primary-btn] hover:bg-[--color-primary-btn-hover] text-[--color-primary-btn-txt]',
|
|
3741
|
+
secondary: 'bg-transparent border-2 border-[--color-primary-btn] hover:border-[--color-secondary-btn-hover] hover:text-[--color-secondary-btn-hover] text-[--color-primary-btn]',
|
|
3742
|
+
tertiary: 'bg-transparent underline text-[--color-text-strong]',
|
|
3742
3743
|
outline: 'bg-[--color-input-bg] border-solid border-2 border-[--color-outline-btn] hover:border-[--color-outline-btn-hover] text-[--color-text-strong]',
|
|
3743
|
-
|
|
3744
|
-
destructive: 'bg-utilRed1000 hover:bg-utilRed800 text-greyBaseLight'
|
|
3744
|
+
destructive: 'bg-[--color-destructive-btn] hover:bg-[--color-destructive-btn-hover] text-[--color-destructive-btn-txt]'
|
|
3745
3745
|
};
|
|
3746
3746
|
|
|
3747
3747
|
// Disabled styles for button
|
|
@@ -3751,7 +3751,7 @@ function Button(_ref) {
|
|
|
3751
3751
|
const iconClassNames = "inline-block \n transition-transform \n ease-in-out \n duration-200\n h-5 w-5\n ".concat(iconPosition === 'right' ? 'ml-2' : 'mr-2', "\n ").concat(isIconAnimated && !isSaving ? 'group-hover:translate-x-1' : '', "\n ").concat(isSaving ? 'animate-spin' : '', " // Add spinning animation\n ");
|
|
3752
3752
|
|
|
3753
3753
|
// Main button class names
|
|
3754
|
-
const classNames = " \n ".concat(state === 'disabled' || isSaving ? disabledStyles : rankStyles[rank] || rankStyles.primary, "\n group \n transition \n ease-in-out \n duration-700 \n rounded-lg
|
|
3754
|
+
const classNames = " \n ".concat(state === 'disabled' || isSaving ? disabledStyles : rankStyles[rank] || rankStyles.primary, "\n group \n transition \n ease-in-out \n duration-700 \n rounded-lg\n hover:shadow-lg\n px-5 \n py-2 \n text-").concat(size, " \n flex \n items-center \n justify-center \n whitespace-nowrap // Prevents text wrapping\n ").concat(isFullWidth ? 'w-full' : '', "\n ").concat(className, "\n ");
|
|
3755
3755
|
return /*#__PURE__*/external_react_default().createElement("button", {
|
|
3756
3756
|
type: type,
|
|
3757
3757
|
title: title,
|
|
@@ -3801,6 +3801,57 @@ function Card(_ref) {
|
|
|
3801
3801
|
className: cardClasses
|
|
3802
3802
|
}, children);
|
|
3803
3803
|
}
|
|
3804
|
+
;// ./src/components/Text/Text.jsx
|
|
3805
|
+
const Text_excluded = ["variant", "as", "className", "children", "name", "dataCy"];
|
|
3806
|
+
function Text_extends() { return Text_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, Text_extends.apply(null, arguments); }
|
|
3807
|
+
function Text_objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = Text_objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
3808
|
+
function Text_objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
3809
|
+
|
|
3810
|
+
|
|
3811
|
+
const variantMap = {
|
|
3812
|
+
h1: 'text-4xl font-bold leading-tight text-[--color-text-strong]',
|
|
3813
|
+
h2: 'text-3xl font-semibold leading-snug text-[--color-text-strong]',
|
|
3814
|
+
h3: 'text-2xl font-semibold leading-snug text-[--color-text-strong]',
|
|
3815
|
+
h4: 'text-xl font-medium text-[--color-text-strong]',
|
|
3816
|
+
h5: 'text-lg font-medium text-[--color-text-strong]',
|
|
3817
|
+
h6: 'text-base font-medium text-[--color-text-strong]',
|
|
3818
|
+
body: 'text-base text-[--color-text-strong]',
|
|
3819
|
+
small: 'text-sm text-[--color-text-strong]',
|
|
3820
|
+
caption: 'text-xs text-[--color-text-strong]',
|
|
3821
|
+
label: 'text-sm font-medium text-[--color-text-weak]'
|
|
3822
|
+
};
|
|
3823
|
+
const elementMap = {
|
|
3824
|
+
h1: 'h1',
|
|
3825
|
+
h2: 'h2',
|
|
3826
|
+
h3: 'h3',
|
|
3827
|
+
h4: 'h4',
|
|
3828
|
+
h5: 'h5',
|
|
3829
|
+
h6: 'h6',
|
|
3830
|
+
body: 'p',
|
|
3831
|
+
small: 'small',
|
|
3832
|
+
caption: 'span',
|
|
3833
|
+
label: 'label'
|
|
3834
|
+
};
|
|
3835
|
+
function Text(_ref) {
|
|
3836
|
+
let {
|
|
3837
|
+
variant = 'body',
|
|
3838
|
+
as,
|
|
3839
|
+
className = '',
|
|
3840
|
+
children,
|
|
3841
|
+
name,
|
|
3842
|
+
dataCy
|
|
3843
|
+
} = _ref,
|
|
3844
|
+
rest = Text_objectWithoutProperties(_ref, Text_excluded);
|
|
3845
|
+
const Component = as || elementMap[variant] || 'p';
|
|
3846
|
+
const variantClass = variantMap[variant] || variantMap.body;
|
|
3847
|
+
return /*#__PURE__*/external_react_default().createElement(Component, Text_extends({
|
|
3848
|
+
className: "".concat(variantClass, " ").concat(className),
|
|
3849
|
+
"data-cy": getDataCy({
|
|
3850
|
+
name,
|
|
3851
|
+
dataCy
|
|
3852
|
+
})
|
|
3853
|
+
}, rest), children);
|
|
3854
|
+
}
|
|
3804
3855
|
;// ./src/components/Forms/Inputs/Input.jsx
|
|
3805
3856
|
function Input_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3806
3857
|
function Input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? Input_ownKeys(Object(t), !0).forEach(function (r) { Input_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Input_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -3809,6 +3860,7 @@ function Input_toPropertyKey(t) { var i = Input_toPrimitive(t, "string"); return
|
|
|
3809
3860
|
function Input_toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
3810
3861
|
|
|
3811
3862
|
|
|
3863
|
+
|
|
3812
3864
|
const Input = /*#__PURE__*/(0,external_react_.forwardRef)((_ref, ref) => {
|
|
3813
3865
|
let {
|
|
3814
3866
|
label,
|
|
@@ -3844,10 +3896,15 @@ const Input = /*#__PURE__*/(0,external_react_.forwardRef)((_ref, ref) => {
|
|
|
3844
3896
|
const iconClasses = "h-5 w-5 ".concat(isAnimated ? 'transition-transform duration-200 group-focus-within:scale-125' : '', " text-[--color-text-weak]");
|
|
3845
3897
|
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
3846
3898
|
className: "flex flex-col mb-4"
|
|
3847
|
-
}, /*#__PURE__*/external_react_default().createElement(
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3899
|
+
}, /*#__PURE__*/external_react_default().createElement(Text, {
|
|
3900
|
+
as: "label",
|
|
3901
|
+
variant: "label",
|
|
3902
|
+
htmlFor: name,
|
|
3903
|
+
className: "mb-1 flex items-center"
|
|
3904
|
+
}, label, required && /*#__PURE__*/external_react_default().createElement(Text, {
|
|
3905
|
+
as: "span",
|
|
3906
|
+
variant: "small",
|
|
3907
|
+
className: "text-[--color-util-red] ml-1"
|
|
3851
3908
|
}, "*")), /*#__PURE__*/external_react_default().createElement("div", {
|
|
3852
3909
|
className: "".concat(inputClasses, " relative")
|
|
3853
3910
|
}, Icon && iconPosition === 'left' && /*#__PURE__*/external_react_default().createElement("span", {
|
|
@@ -3855,6 +3912,7 @@ const Input = /*#__PURE__*/(0,external_react_.forwardRef)((_ref, ref) => {
|
|
|
3855
3912
|
}, /*#__PURE__*/external_react_default().createElement(Icon, {
|
|
3856
3913
|
className: iconClasses
|
|
3857
3914
|
})), /*#__PURE__*/external_react_default().createElement("input", {
|
|
3915
|
+
id: name,
|
|
3858
3916
|
ref: ref,
|
|
3859
3917
|
className: "w-full ".concat(Icon ? iconPosition === 'left' ? 'pl-10' : 'pr-10' : '', " bg-[--color-input-bg] border-none focus:ring-0 focus:outline-none rounded-md py-2 px-3"),
|
|
3860
3918
|
type: type,
|
|
@@ -3870,13 +3928,18 @@ const Input = /*#__PURE__*/(0,external_react_.forwardRef)((_ref, ref) => {
|
|
|
3870
3928
|
"data-cy": getDataCy({
|
|
3871
3929
|
name,
|
|
3872
3930
|
dataCy
|
|
3873
|
-
})
|
|
3931
|
+
}),
|
|
3932
|
+
"aria-invalid": !isValid,
|
|
3933
|
+
"aria-describedby": !isValid ? "".concat(name, "-error") : undefined
|
|
3874
3934
|
}), Icon && iconPosition === 'right' && /*#__PURE__*/external_react_default().createElement("span", {
|
|
3875
3935
|
className: "absolute right-3 flex items-center pointer-events-none"
|
|
3876
3936
|
}, /*#__PURE__*/external_react_default().createElement(Icon, {
|
|
3877
3937
|
className: iconClasses
|
|
3878
|
-
}))), !isValid && /*#__PURE__*/external_react_default().createElement(
|
|
3879
|
-
|
|
3938
|
+
}))), !isValid && /*#__PURE__*/external_react_default().createElement(Text, {
|
|
3939
|
+
as: "span",
|
|
3940
|
+
variant: "small",
|
|
3941
|
+
id: "".concat(name, "-error"),
|
|
3942
|
+
className: "text-[--color-util-red]"
|
|
3880
3943
|
}, errorMessage), shouldRenderCustomComponent && customComponent && /*#__PURE__*/external_react_default().createElement(customComponent, Input_objectSpread({}, customComponentProps)));
|
|
3881
3944
|
});
|
|
3882
3945
|
/* harmony default export */ const Inputs_Input = (Input);
|
|
@@ -3941,6 +4004,7 @@ var datepicker_update = injectStylesIntoStyleTag_default()(datepicker/* default
|
|
|
3941
4004
|
|
|
3942
4005
|
|
|
3943
4006
|
|
|
4007
|
+
|
|
3944
4008
|
function DatePicker(_ref) {
|
|
3945
4009
|
let {
|
|
3946
4010
|
initialDate = '',
|
|
@@ -4003,11 +4067,13 @@ function DatePicker(_ref) {
|
|
|
4003
4067
|
};
|
|
4004
4068
|
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
4005
4069
|
className: "relative flex flex-col mb-4"
|
|
4006
|
-
}, /*#__PURE__*/external_react_default().createElement(
|
|
4070
|
+
}, /*#__PURE__*/external_react_default().createElement(Text, {
|
|
4071
|
+
as: "label",
|
|
4072
|
+
variant: "label",
|
|
4007
4073
|
htmlFor: name,
|
|
4008
|
-
className: "
|
|
4074
|
+
className: "mb-1"
|
|
4009
4075
|
}, label, required && /*#__PURE__*/external_react_default().createElement("span", {
|
|
4010
|
-
className: "text-
|
|
4076
|
+
className: "text-[--color-util-red] ml-1"
|
|
4011
4077
|
}, "*")), /*#__PURE__*/external_react_default().createElement("input", {
|
|
4012
4078
|
type: "date",
|
|
4013
4079
|
id: name,
|
|
@@ -4023,7 +4089,9 @@ function DatePicker(_ref) {
|
|
|
4023
4089
|
name,
|
|
4024
4090
|
dataCy
|
|
4025
4091
|
}),
|
|
4026
|
-
|
|
4092
|
+
"aria-invalid": !isValid,
|
|
4093
|
+
"aria-describedby": !isValid ? "".concat(name, "-error") : undefined,
|
|
4094
|
+
className: "w-full py-2 px-3 pr-10 rounded-md bg-[--color-input-bg] border ".concat(isValid ? 'border-[--color-stroke]' : 'border-[--color-util-red]', " text-md font-normal text-[--color-text-weak] ").concat(disabled ? 'opacity-50 cursor-not-allowed' : '', " ").concat(className)
|
|
4027
4095
|
}), /*#__PURE__*/external_react_default().createElement("button", {
|
|
4028
4096
|
type: "button",
|
|
4029
4097
|
onClick: handleIconClick,
|
|
@@ -4032,13 +4100,17 @@ function DatePicker(_ref) {
|
|
|
4032
4100
|
disabled: disabled
|
|
4033
4101
|
}, /*#__PURE__*/external_react_default().createElement(esm_CalendarIcon, {
|
|
4034
4102
|
className: "w-5 h-5 ".concat(disabled ? 'text-[--color-text-disabled]' : 'text-[--color-text-weak] hover:text-[--color-primary-btn-hover]', " transition")
|
|
4035
|
-
})), !isValid && /*#__PURE__*/external_react_default().createElement(
|
|
4036
|
-
|
|
4103
|
+
})), !isValid && /*#__PURE__*/external_react_default().createElement(Text, {
|
|
4104
|
+
as: "span",
|
|
4105
|
+
id: "".concat(name, "-error"),
|
|
4106
|
+
variant: "small",
|
|
4107
|
+
className: "text-[--color-util-red]"
|
|
4037
4108
|
}, errorMessage));
|
|
4038
4109
|
}
|
|
4039
4110
|
;// ./src/components/Forms/Radios/RadioButton.js
|
|
4040
4111
|
|
|
4041
4112
|
|
|
4113
|
+
|
|
4042
4114
|
const RadioButton = _ref => {
|
|
4043
4115
|
let {
|
|
4044
4116
|
label,
|
|
@@ -4072,43 +4144,55 @@ const RadioButton = _ref => {
|
|
|
4072
4144
|
if (disabled) return;
|
|
4073
4145
|
const event = {
|
|
4074
4146
|
target: {
|
|
4075
|
-
name
|
|
4147
|
+
name,
|
|
4076
4148
|
value: item.value
|
|
4077
4149
|
}
|
|
4078
4150
|
};
|
|
4079
|
-
|
|
4080
|
-
onChange(event);
|
|
4081
|
-
}
|
|
4151
|
+
onChange === null || onChange === void 0 || onChange(event);
|
|
4082
4152
|
};
|
|
4083
4153
|
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
4084
4154
|
className: "flex flex-col mb-4 ".concat(className)
|
|
4085
|
-
}, /*#__PURE__*/external_react_default().createElement(
|
|
4155
|
+
}, /*#__PURE__*/external_react_default().createElement(Text, {
|
|
4156
|
+
as: "label",
|
|
4157
|
+
variant: "label",
|
|
4086
4158
|
className: "text-[--color-text-strong] mb-2 flex items-center"
|
|
4087
|
-
}, label, required && /*#__PURE__*/external_react_default().createElement(
|
|
4088
|
-
|
|
4159
|
+
}, label, required && /*#__PURE__*/external_react_default().createElement(Text, {
|
|
4160
|
+
as: "span",
|
|
4161
|
+
variant: "small",
|
|
4162
|
+
className: "text-[--color-util-red] ml-1"
|
|
4089
4163
|
}, "*")), /*#__PURE__*/external_react_default().createElement("div", {
|
|
4090
|
-
className: "flex space-x-4"
|
|
4091
|
-
}, options.map(option =>
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
disabled: disabled,
|
|
4105
|
-
"data-cy": getDataCy({
|
|
4106
|
-
name,
|
|
4164
|
+
className: "flex space-x-4 flex-wrap"
|
|
4165
|
+
}, options.map(option => {
|
|
4166
|
+
const id = "".concat(name, "-").concat(option.value);
|
|
4167
|
+
return /*#__PURE__*/external_react_default().createElement("label", {
|
|
4168
|
+
key: option.value,
|
|
4169
|
+
htmlFor: id,
|
|
4170
|
+
className: "py-2 px-4 border rounded-lg transition duration-200 flex items-center ".concat(selectedValue === option.value ? 'bg-[--color-primary-btn] text-[--color-white] border-[--color-stroke]' : "bg-[--color-input-bg] text-[--color-text-strong] ".concat(!isValid && selectedValue === '' ? 'border-[--color-util-red]' : 'border-[--color-stroke]'), " ").concat(disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer')
|
|
4171
|
+
}, /*#__PURE__*/external_react_default().createElement("input", {
|
|
4172
|
+
id: id,
|
|
4173
|
+
type: "radio",
|
|
4174
|
+
tabIndex: tabIndex,
|
|
4175
|
+
title: title,
|
|
4176
|
+
"aria-label": title,
|
|
4177
|
+
name: name,
|
|
4107
4178
|
value: option.value,
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4179
|
+
checked: selectedValue === option.value,
|
|
4180
|
+
onChange: () => handleChange(option),
|
|
4181
|
+
className: "hidden",
|
|
4182
|
+
disabled: disabled,
|
|
4183
|
+
"data-cy": getDataCy({
|
|
4184
|
+
name,
|
|
4185
|
+
value: option.value,
|
|
4186
|
+
dataCy
|
|
4187
|
+
}),
|
|
4188
|
+
"aria-invalid": !isValid,
|
|
4189
|
+
"aria-describedby": !isValid ? "".concat(name, "-error") : undefined
|
|
4190
|
+
}), option.label);
|
|
4191
|
+
})), !isValid && /*#__PURE__*/external_react_default().createElement(Text, {
|
|
4192
|
+
as: "span",
|
|
4193
|
+
variant: "small",
|
|
4194
|
+
id: "".concat(name, "-error"),
|
|
4195
|
+
className: "text-[--color-util-red] mt-1"
|
|
4112
4196
|
}, errorMessage));
|
|
4113
4197
|
};
|
|
4114
4198
|
RadioButton.displayName = 'RadioButton';
|
|
@@ -4116,6 +4200,7 @@ RadioButton.displayName = 'RadioButton';
|
|
|
4116
4200
|
;// ./src/components/Forms/Checkbox/Checkbox.jsx
|
|
4117
4201
|
|
|
4118
4202
|
|
|
4203
|
+
|
|
4119
4204
|
function Checkbox(_ref) {
|
|
4120
4205
|
let {
|
|
4121
4206
|
label,
|
|
@@ -4123,15 +4208,17 @@ function Checkbox(_ref) {
|
|
|
4123
4208
|
onChange,
|
|
4124
4209
|
value = false,
|
|
4125
4210
|
isValid = true,
|
|
4126
|
-
errorMessage =
|
|
4211
|
+
errorMessage = '',
|
|
4127
4212
|
disabled = false,
|
|
4128
4213
|
dataCy
|
|
4129
4214
|
} = _ref;
|
|
4215
|
+
const id = "checkbox-".concat(name);
|
|
4130
4216
|
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
4131
4217
|
className: "flex flex-col mb-4"
|
|
4132
|
-
}, /*#__PURE__*/external_react_default().createElement("
|
|
4133
|
-
className: "flex items-center
|
|
4218
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
4219
|
+
className: "flex items-center"
|
|
4134
4220
|
}, /*#__PURE__*/external_react_default().createElement("input", {
|
|
4221
|
+
id: id,
|
|
4135
4222
|
type: "checkbox",
|
|
4136
4223
|
name: name,
|
|
4137
4224
|
checked: value,
|
|
@@ -4141,9 +4228,15 @@ function Checkbox(_ref) {
|
|
|
4141
4228
|
name,
|
|
4142
4229
|
dataCy
|
|
4143
4230
|
}),
|
|
4144
|
-
className: "mr-2 ".concat(disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer')
|
|
4145
|
-
}),
|
|
4146
|
-
|
|
4231
|
+
className: "mr-2 rounded-sm ".concat(disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer')
|
|
4232
|
+
}), /*#__PURE__*/external_react_default().createElement(Text, {
|
|
4233
|
+
variant: "label",
|
|
4234
|
+
as: "label",
|
|
4235
|
+
htmlFor: id
|
|
4236
|
+
}, label)), !isValid && errorMessage && /*#__PURE__*/external_react_default().createElement(Text, {
|
|
4237
|
+
variant: "small",
|
|
4238
|
+
as: "span",
|
|
4239
|
+
className: "text-[--color-util-red] mt-1"
|
|
4147
4240
|
}, errorMessage));
|
|
4148
4241
|
}
|
|
4149
4242
|
// EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./src/components/Tables/table.scss
|
|
@@ -6318,10 +6411,11 @@ const flip = function (options) {
|
|
|
6318
6411
|
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
6319
6412
|
const nextPlacement = placements[nextIndex];
|
|
6320
6413
|
if (nextPlacement) {
|
|
6321
|
-
var _overflowsData$;
|
|
6322
6414
|
const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== floating_ui_utils_getSideAxis(nextPlacement) : false;
|
|
6323
|
-
|
|
6324
|
-
if
|
|
6415
|
+
if (!ignoreCrossAxisOverflow ||
|
|
6416
|
+
// We leave the current main axis only if every placement on that axis
|
|
6417
|
+
// overflows the main axis.
|
|
6418
|
+
overflowsData.every(d => d.overflows[0] > 0 && floating_ui_utils_getSideAxis(d.placement) === initialSideAxis)) {
|
|
6325
6419
|
// Try next placement and re-run the lifecycle.
|
|
6326
6420
|
return {
|
|
6327
6421
|
data: {
|
|
@@ -7662,7 +7756,10 @@ const floating_ui_dom_computePosition = (reference, floating, options) => {
|
|
|
7662
7756
|
|
|
7663
7757
|
|
|
7664
7758
|
|
|
7665
|
-
var
|
|
7759
|
+
var isClient = typeof document !== 'undefined';
|
|
7760
|
+
|
|
7761
|
+
var noop = function noop() {};
|
|
7762
|
+
var index = isClient ? external_react_.useLayoutEffect : noop;
|
|
7666
7763
|
|
|
7667
7764
|
// Fork of `fast-deep-equal` that only does the comparisons we need and compares
|
|
7668
7765
|
// functions
|
|
@@ -12713,9 +12810,10 @@ const esm_ChevronDownIcon_ForwardRef = /*#__PURE__*/ external_react_.forwardRef(
|
|
|
12713
12810
|
|
|
12714
12811
|
|
|
12715
12812
|
|
|
12813
|
+
|
|
12716
12814
|
function Dropdown(_ref) {
|
|
12717
12815
|
let {
|
|
12718
|
-
items,
|
|
12816
|
+
items = [],
|
|
12719
12817
|
label = 'Test Label',
|
|
12720
12818
|
isValid = true,
|
|
12721
12819
|
required = false,
|
|
@@ -12729,15 +12827,14 @@ function Dropdown(_ref) {
|
|
|
12729
12827
|
Icon,
|
|
12730
12828
|
errorMessage = 'This field is required',
|
|
12731
12829
|
disabled = false,
|
|
12732
|
-
dataCy
|
|
12830
|
+
dataCy
|
|
12733
12831
|
} = _ref;
|
|
12734
12832
|
const [selectedItem, setSelectedItem] = (0,external_react_.useState)(null);
|
|
12735
|
-
const [isOpen, setIsOpen] = (0,external_react_.useState)(false);
|
|
12736
12833
|
(0,external_react_.useEffect)(() => {
|
|
12737
12834
|
const newSelectedItem = items.find(item => item.value === value) || null;
|
|
12738
12835
|
setSelectedItem(newSelectedItem);
|
|
12739
12836
|
}, [value, items]);
|
|
12740
|
-
const inputClasses = "inline-flex w-full justify-between items-center rounded-md bg-[--color-input-bg] text-md font-normal border p-2 text-[--color-text-weak] ".concat(isValid ? 'border-[--color-stroke]' : 'border-utilRed1000', " ").concat(disabled ? 'opacity-50 cursor-not-allowed' : ''
|
|
12837
|
+
const inputClasses = "inline-flex w-full justify-between items-center rounded-md bg-[--color-input-bg] text-md font-normal border p-2 text-[--color-text-weak] ".concat(isValid ? 'border-[--color-stroke]' : 'border-utilRed1000', " ").concat(disabled ? 'opacity-50 cursor-not-allowed' : '');
|
|
12741
12838
|
const handleSelect = item => {
|
|
12742
12839
|
if (disabled) return;
|
|
12743
12840
|
setSelectedItem(item);
|
|
@@ -12747,53 +12844,65 @@ function Dropdown(_ref) {
|
|
|
12747
12844
|
value: item.value
|
|
12748
12845
|
}
|
|
12749
12846
|
};
|
|
12750
|
-
onChange(event);
|
|
12847
|
+
onChange === null || onChange === void 0 || onChange(event);
|
|
12751
12848
|
};
|
|
12752
|
-
return /*#__PURE__*/external_react_default().createElement(
|
|
12753
|
-
|
|
12754
|
-
|
|
12755
|
-
|
|
12756
|
-
|
|
12757
|
-
"
|
|
12758
|
-
|
|
12759
|
-
"data-cy": getDataCy({
|
|
12760
|
-
name,
|
|
12761
|
-
dataCy
|
|
12762
|
-
})
|
|
12763
|
-
}, /*#__PURE__*/external_react_default().createElement("label", {
|
|
12764
|
-
className: "flex items-center text-[--color-text-weak] mb-1"
|
|
12849
|
+
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
12850
|
+
className: "flex flex-col mb-4 ".concat(className)
|
|
12851
|
+
}, /*#__PURE__*/external_react_default().createElement(Text, {
|
|
12852
|
+
as: "label",
|
|
12853
|
+
variant: "label",
|
|
12854
|
+
className: "mb-1",
|
|
12855
|
+
htmlFor: name
|
|
12765
12856
|
}, label, required && /*#__PURE__*/external_react_default().createElement("span", {
|
|
12766
|
-
className: "ml-1 text-
|
|
12767
|
-
}, "*")), /*#__PURE__*/external_react_default().createElement(
|
|
12768
|
-
className: inputClasses,
|
|
12769
|
-
onClick: () => !disabled && setIsOpen(prev => !prev),
|
|
12770
|
-
disabled: disabled
|
|
12771
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
12772
|
-
className: "flex items-center gap-2"
|
|
12773
|
-
}, Icon && /*#__PURE__*/external_react_default().createElement(Icon, {
|
|
12774
|
-
className: "h-5 w-5 text-[--color-text-weak]"
|
|
12775
|
-
}), /*#__PURE__*/external_react_default().createElement("span", null, selectedItem ? selectedItem.label : placeholder)), /*#__PURE__*/external_react_default().createElement(solid_esm_ChevronDownIcon, {
|
|
12776
|
-
"aria-hidden": "true",
|
|
12777
|
-
className: "-mr-1 h-5 w-5 text-[--color-text-weak] transition-transform duration-200 ".concat(isOpen ? 'rotate-180' : 'rotate-0')
|
|
12778
|
-
}))), !disabled && /*#__PURE__*/external_react_default().createElement(Pt, {
|
|
12779
|
-
transition: true,
|
|
12780
|
-
className: "\r absolute \r right-0 \r z-10 \r mt-2 \r w-56 \r origin-top-right \r rounded-md bg-[--color-primary-bg] \r shadow-lg \r ring-1 \r ring-[--color-stroke] \r ring-opacity-1 \r transition \r focus:outline-none \r max-h-48 \r overflow-y-auto\r ",
|
|
12781
|
-
onClick: () => setIsOpen(false)
|
|
12782
|
-
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
12783
|
-
className: "py-1"
|
|
12784
|
-
}, items.map((item, index) => /*#__PURE__*/external_react_default().createElement(Et, {
|
|
12785
|
-
key: index
|
|
12786
|
-
}, _ref2 => {
|
|
12857
|
+
className: "ml-1 text-[--color-util-red]"
|
|
12858
|
+
}, "*")), /*#__PURE__*/external_react_default().createElement(lo, null, _ref2 => {
|
|
12787
12859
|
let {
|
|
12788
|
-
|
|
12860
|
+
open
|
|
12789
12861
|
} = _ref2;
|
|
12790
|
-
return /*#__PURE__*/external_react_default().createElement("
|
|
12791
|
-
|
|
12792
|
-
|
|
12793
|
-
|
|
12794
|
-
|
|
12795
|
-
|
|
12796
|
-
|
|
12862
|
+
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
12863
|
+
className: "relative"
|
|
12864
|
+
}, /*#__PURE__*/external_react_default().createElement(yt, {
|
|
12865
|
+
id: name,
|
|
12866
|
+
name: name,
|
|
12867
|
+
title: title,
|
|
12868
|
+
"aria-label": title,
|
|
12869
|
+
"aria-invalid": !isValid,
|
|
12870
|
+
"aria-describedby": !isValid ? "".concat(name, "-error") : undefined,
|
|
12871
|
+
tabIndex: tabIndex,
|
|
12872
|
+
disabled: disabled,
|
|
12873
|
+
"data-cy": getDataCy({
|
|
12874
|
+
name,
|
|
12875
|
+
dataCy
|
|
12876
|
+
}),
|
|
12877
|
+
className: inputClasses
|
|
12878
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
12879
|
+
className: "flex items-center gap-2"
|
|
12880
|
+
}, Icon && /*#__PURE__*/external_react_default().createElement(Icon, {
|
|
12881
|
+
className: "h-5 w-5 text-[--color-text-weak]"
|
|
12882
|
+
}), /*#__PURE__*/external_react_default().createElement("span", null, selectedItem ? selectedItem.label : placeholder)), /*#__PURE__*/external_react_default().createElement(solid_esm_ChevronDownIcon, {
|
|
12883
|
+
"aria-hidden": "true",
|
|
12884
|
+
className: "-mr-1 h-5 w-5 text-[--color-text-weak] transition-transform duration-200 ".concat(open ? 'rotate-180' : 'rotate-0')
|
|
12885
|
+
})), !disabled && /*#__PURE__*/external_react_default().createElement(Pt, {
|
|
12886
|
+
className: " absolute right-0 z-10 mt-2 w-56 origin-top-right rounded-md bg-[--color-primary-bg] shadow-lg ring-1 ring-[--color-stroke] ring-opacity-1 focus:outline-none max-h-48 overflow-y-auto "
|
|
12887
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
12888
|
+
className: "py-1"
|
|
12889
|
+
}, items.map((item, index) => /*#__PURE__*/external_react_default().createElement(Et, {
|
|
12890
|
+
key: index
|
|
12891
|
+
}, _ref3 => {
|
|
12892
|
+
let {
|
|
12893
|
+
active
|
|
12894
|
+
} = _ref3;
|
|
12895
|
+
return /*#__PURE__*/external_react_default().createElement("button", {
|
|
12896
|
+
type: "button",
|
|
12897
|
+
onClick: () => handleSelect(item),
|
|
12898
|
+
className: "block w-full px-4 py-2 text-left text-sm text-[--color-text-weak] ".concat(active ? 'bg-[--color-input-bg]' : '')
|
|
12899
|
+
}, item.label);
|
|
12900
|
+
})))));
|
|
12901
|
+
}), !isValid && /*#__PURE__*/external_react_default().createElement(Text, {
|
|
12902
|
+
as: "span",
|
|
12903
|
+
variant: "small",
|
|
12904
|
+
id: "".concat(name, "-error"),
|
|
12905
|
+
className: "text-[--color-util-red] mt-1"
|
|
12797
12906
|
}, errorMessage));
|
|
12798
12907
|
}
|
|
12799
12908
|
// EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./src/components/Navbar/navbar.scss
|
|
@@ -12879,6 +12988,7 @@ const XMarkIcon_ForwardRef = /*#__PURE__*/ external_react_.forwardRef(XMarkIcon)
|
|
|
12879
12988
|
;// ./src/components/Modals/Modal.js
|
|
12880
12989
|
|
|
12881
12990
|
|
|
12991
|
+
|
|
12882
12992
|
const Modal = _ref => {
|
|
12883
12993
|
let {
|
|
12884
12994
|
isOpen,
|
|
@@ -12886,27 +12996,47 @@ const Modal = _ref => {
|
|
|
12886
12996
|
header,
|
|
12887
12997
|
body,
|
|
12888
12998
|
footer,
|
|
12889
|
-
className =
|
|
12890
|
-
footerClassName =
|
|
12891
|
-
headerClassName =
|
|
12999
|
+
className = '',
|
|
13000
|
+
footerClassName = '',
|
|
13001
|
+
headerClassName = ''
|
|
12892
13002
|
} = _ref;
|
|
12893
|
-
|
|
13003
|
+
// ✅ Hook must be called unconditionally
|
|
13004
|
+
(0,external_react_.useEffect)(() => {
|
|
13005
|
+
const handleEscape = e => {
|
|
13006
|
+
if (e.key === 'Escape' && isOpen) {
|
|
13007
|
+
onClose === null || onClose === void 0 || onClose();
|
|
13008
|
+
}
|
|
13009
|
+
};
|
|
13010
|
+
document.addEventListener('keydown', handleEscape);
|
|
13011
|
+
return () => document.removeEventListener('keydown', handleEscape);
|
|
13012
|
+
}, [isOpen, onClose]);
|
|
13013
|
+
|
|
13014
|
+
// ✅ Conditional render *after* hooks
|
|
13015
|
+
if (!isOpen) return null;
|
|
12894
13016
|
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
12895
13017
|
className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50"
|
|
12896
13018
|
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
13019
|
+
role: "dialog",
|
|
13020
|
+
"aria-modal": "true",
|
|
13021
|
+
"aria-labelledby": "modal-title",
|
|
13022
|
+
"aria-describedby": "modal-description",
|
|
12897
13023
|
className: "bg-[--color-primary-bg] rounded-lg shadow-xl w-11/12 max-w-fit p-6 ".concat(className)
|
|
12898
13024
|
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
12899
13025
|
className: "flex justify-end pb-3"
|
|
12900
|
-
}, /*#__PURE__*/external_react_default().createElement("
|
|
13026
|
+
}, /*#__PURE__*/external_react_default().createElement("button", {
|
|
12901
13027
|
onClick: onClose,
|
|
12902
|
-
className: "hover:cursor-pointer text-[--color-text-strong]"
|
|
13028
|
+
className: "hover:cursor-pointer text-[--color-text-strong]",
|
|
13029
|
+
"aria-label": "Close modal"
|
|
12903
13030
|
}, /*#__PURE__*/external_react_default().createElement(esm_XMarkIcon, {
|
|
12904
13031
|
width: "24px",
|
|
12905
13032
|
className: "text-[--color-text-strong]"
|
|
12906
13033
|
}))), /*#__PURE__*/external_react_default().createElement("div", {
|
|
12907
13034
|
className: "border-b border-[--color-stroke] pb-4 text-[--color-text-strong] ".concat(headerClassName)
|
|
12908
|
-
},
|
|
12909
|
-
|
|
13035
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
13036
|
+
id: "modal-title"
|
|
13037
|
+
}, header)), /*#__PURE__*/external_react_default().createElement("div", {
|
|
13038
|
+
id: "modal-description",
|
|
13039
|
+
className: "my-4 text-[--color-text-weak]"
|
|
12910
13040
|
}, body), /*#__PURE__*/external_react_default().createElement("div", {
|
|
12911
13041
|
className: "text-[--color-text-weak] ".concat(footerClassName)
|
|
12912
13042
|
}, footer)));
|
|
@@ -12918,19 +13048,25 @@ var c247_loader_gif_default = /*#__PURE__*/__webpack_require__.n(c247_loader_gif
|
|
|
12918
13048
|
;// ./src/components/Loader/Loader.js
|
|
12919
13049
|
|
|
12920
13050
|
|
|
13051
|
+
|
|
12921
13052
|
function Loader(_ref) {
|
|
12922
13053
|
let {
|
|
12923
13054
|
isLoading,
|
|
12924
|
-
loaderText =
|
|
13055
|
+
loaderText = 'loading...',
|
|
13056
|
+
customLoader,
|
|
13057
|
+
className = ''
|
|
12925
13058
|
} = _ref;
|
|
12926
13059
|
return isLoading && /*#__PURE__*/external_react_default().createElement("div", {
|
|
12927
|
-
|
|
12928
|
-
|
|
13060
|
+
role: "status",
|
|
13061
|
+
"aria-live": "polite",
|
|
13062
|
+
className: "fixed inset-0 flex flex-col items-center justify-center bg-greySunkenDark1000 bg-opacity-80 z-50 ".concat(className)
|
|
13063
|
+
}, customLoader ? customLoader : /*#__PURE__*/external_react_default().createElement("img", {
|
|
12929
13064
|
src: (c247_loader_gif_default()),
|
|
12930
13065
|
alt: "Loading",
|
|
12931
13066
|
className: "h-60"
|
|
12932
|
-
}), /*#__PURE__*/external_react_default().createElement(
|
|
12933
|
-
|
|
13067
|
+
}), /*#__PURE__*/external_react_default().createElement(Text, {
|
|
13068
|
+
variant: "h4",
|
|
13069
|
+
className: "mt-4 animate-pulse"
|
|
12934
13070
|
}, loaderText));
|
|
12935
13071
|
}
|
|
12936
13072
|
;// external "opus-toolkit-styles/assets/logos/footer-logos.svg"
|