opus-toolkit-components 0.7.6 → 0.7.8

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(name, dataCy)
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(name, dataCy),
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(name, dataCy),
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(name, dataCy)
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", {
@@ -12453,6 +12476,7 @@ function Loader(_ref) {
12453
12476
  ;// ./src/components/Pills/Pill.js
12454
12477
 
12455
12478
  const statusClasses = {
12479
+ primary: "bg-[--color-primary-btn] text-[--color-white]",
12456
12480
  danger: "bg-[--color-util-red] text-[--color-white]",
12457
12481
  warning: "bg-[--color-util-amber] text-[--color-white]",
12458
12482
  success: "bg-[--color-util-green] text-[--color-white]",
@@ -12493,4 +12517,4 @@ const Pill = _ref => {
12493
12517
  /******/ })()
12494
12518
  ;
12495
12519
  });
12496
- //# sourceMappingURL=main.a8aa83e8cb55d25079a7.js.map
12520
+ //# sourceMappingURL=main.43655bc1feda5d97eff1.js.map