opus-toolkit-components 0.7.6 → 0.7.7
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.
|
@@ -3540,6 +3540,17 @@ function AiTwotoneWarning (props) {
|
|
|
3540
3540
|
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 1024 1024"},"child":[{"tag":"path","attr":{"fill":"#333","d":"M955.7 856l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"},"child":[]},{"tag":"path","attr":{"fill":"#E6E6E6","d":"M172.2 828.1h679.6L512 239.9 172.2 828.1zM560 720a48.01 48.01 0 0 1-96 0 48.01 48.01 0 0 1 96 0zm-16-304v184c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V416c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8z"},"child":[]},{"tag":"path","attr":{"fill":"#333","d":"M464 720a48 48 0 1 0 96 0 48 48 0 1 0-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8z"},"child":[]}]})(props);
|
|
3541
3541
|
};
|
|
3542
3542
|
|
|
3543
|
+
;// ./src/utils/getDataCy.js
|
|
3544
|
+
const getDataCy = function () {
|
|
3545
|
+
let {
|
|
3546
|
+
name,
|
|
3547
|
+
value,
|
|
3548
|
+
dataCy
|
|
3549
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
3550
|
+
if (dataCy) return dataCy;
|
|
3551
|
+
if (name && value) return "".concat(name, "-").concat(value);
|
|
3552
|
+
return name || '';
|
|
3553
|
+
};
|
|
3543
3554
|
;// ./src/components/Buttons/Button.js
|
|
3544
3555
|
|
|
3545
3556
|
|
|
@@ -3552,6 +3563,9 @@ function Button(_ref) {
|
|
|
3552
3563
|
state = 'default',
|
|
3553
3564
|
text = 'Example Button',
|
|
3554
3565
|
size = 'md',
|
|
3566
|
+
name,
|
|
3567
|
+
dataCy,
|
|
3568
|
+
tabIndex,
|
|
3555
3569
|
isFullWidth = false,
|
|
3556
3570
|
icon: Icon,
|
|
3557
3571
|
// Icon as a React component
|
|
@@ -3588,8 +3602,14 @@ function Button(_ref) {
|
|
|
3588
3602
|
return /*#__PURE__*/external_react_default().createElement("button", {
|
|
3589
3603
|
type: type,
|
|
3590
3604
|
title: title,
|
|
3605
|
+
name: name,
|
|
3591
3606
|
"aria-label": title,
|
|
3592
3607
|
className: classNames,
|
|
3608
|
+
tabIndex: tabIndex,
|
|
3609
|
+
"data-cy": getDataCy({
|
|
3610
|
+
name,
|
|
3611
|
+
dataCy
|
|
3612
|
+
}),
|
|
3593
3613
|
onClick: !isSaving && state !== 'disabled' ? onClick : null,
|
|
3594
3614
|
disabled: isSaving || state === 'disabled'
|
|
3595
3615
|
}, isSaving ? /*#__PURE__*/external_react_default().createElement(AiOutlineLoading3Quarters, {
|
|
@@ -3615,15 +3635,6 @@ function Card(_ref) {
|
|
|
3615
3635
|
className: cardClasses
|
|
3616
3636
|
}, children);
|
|
3617
3637
|
}
|
|
3618
|
-
;// ./src/utils/getDataCy.js
|
|
3619
|
-
const getDataCy = _ref => {
|
|
3620
|
-
let {
|
|
3621
|
-
name,
|
|
3622
|
-
value = '',
|
|
3623
|
-
dataCy
|
|
3624
|
-
} = _ref;
|
|
3625
|
-
return dataCy || (value ? "".concat(name, "-").concat(value) : name);
|
|
3626
|
-
};
|
|
3627
3638
|
;// ./src/components/Forms/Inputs/Input.jsx
|
|
3628
3639
|
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; }
|
|
3629
3640
|
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; }
|
|
@@ -3690,7 +3701,10 @@ const Input = /*#__PURE__*/(0,external_react_.forwardRef)((_ref, ref) => {
|
|
|
3690
3701
|
"aria-label": title,
|
|
3691
3702
|
required: required,
|
|
3692
3703
|
disabled: disabled,
|
|
3693
|
-
"data-cy": getDataCy(
|
|
3704
|
+
"data-cy": getDataCy({
|
|
3705
|
+
name,
|
|
3706
|
+
dataCy
|
|
3707
|
+
})
|
|
3694
3708
|
}), Icon && iconPosition === 'right' && /*#__PURE__*/external_react_default().createElement("span", {
|
|
3695
3709
|
className: "absolute right-3 flex items-center pointer-events-none"
|
|
3696
3710
|
}, /*#__PURE__*/external_react_default().createElement(Icon, {
|
|
@@ -3814,7 +3828,10 @@ function DatePicker(_ref) {
|
|
|
3814
3828
|
onChange: handleDateChange,
|
|
3815
3829
|
required: required,
|
|
3816
3830
|
disabled: disabled,
|
|
3817
|
-
"data-cy": getDataCy(
|
|
3831
|
+
"data-cy": getDataCy({
|
|
3832
|
+
name,
|
|
3833
|
+
dataCy
|
|
3834
|
+
}),
|
|
3818
3835
|
className: "w-full py-2 px-3 pr-10 rounded-md bg-[--color-input-bg] border ".concat(isValid ? 'border-[--color-stroke]' : 'border-utilRed1000', " text-md font-normal text-[--color-text-weak] ").concat(disabled ? 'opacity-50 cursor-not-allowed' : '', " ").concat(className)
|
|
3819
3836
|
}), /*#__PURE__*/external_react_default().createElement("button", {
|
|
3820
3837
|
type: "button",
|
|
@@ -3929,7 +3946,10 @@ function Checkbox(_ref) {
|
|
|
3929
3946
|
checked: value,
|
|
3930
3947
|
onChange: onChange,
|
|
3931
3948
|
disabled: disabled,
|
|
3932
|
-
"data-cy": getDataCy(
|
|
3949
|
+
"data-cy": getDataCy({
|
|
3950
|
+
name,
|
|
3951
|
+
dataCy
|
|
3952
|
+
}),
|
|
3933
3953
|
className: "mr-2 ".concat(disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer')
|
|
3934
3954
|
}), label), !isValid && errorMessage && /*#__PURE__*/external_react_default().createElement("span", {
|
|
3935
3955
|
className: "text-rose-500 text-sm mt-1"
|
|
@@ -12280,7 +12300,10 @@ function Dropdown(_ref) {
|
|
|
12280
12300
|
title: title,
|
|
12281
12301
|
"aria-label": title,
|
|
12282
12302
|
tabIndex: tabIndex,
|
|
12283
|
-
"data-cy": getDataCy(
|
|
12303
|
+
"data-cy": getDataCy({
|
|
12304
|
+
name,
|
|
12305
|
+
dataCy
|
|
12306
|
+
})
|
|
12284
12307
|
}, /*#__PURE__*/external_react_default().createElement("label", {
|
|
12285
12308
|
className: "flex items-center text-[--color-text-weak] mb-1"
|
|
12286
12309
|
}, label, required && /*#__PURE__*/external_react_default().createElement("span", {
|
|
@@ -12493,4 +12516,4 @@ const Pill = _ref => {
|
|
|
12493
12516
|
/******/ })()
|
|
12494
12517
|
;
|
|
12495
12518
|
});
|
|
12496
|
-
//# sourceMappingURL=main.
|
|
12519
|
+
//# sourceMappingURL=main.56fc8a295b30cd3236eb.js.map
|