opus-toolkit-components 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,7 +27,7 @@ return /******/ (() => { // webpackBootstrap
27
27
 
28
28
  var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
29
29
  // Module
30
- ___CSS_LOADER_EXPORT___.push([module.id, `.primary-btn{color:#fff;box-shadow:0px 2px 4px -2px rgba(0,0,0,.08),0px 4px 8px -2px rgba(0,0,0,.04)}.primary-btn:hover{background-color:#b52776}`, "",{"version":3,"sources":["webpack://./src/components/Buttons/button.scss"],"names":[],"mappings":"AAoBA,aAII,UAlBS,CAmBT,4EAAA,CAJF,mBACE,wBAAA","sourcesContent":["@import 'opus-toolkit-styles/fragments/colours';\r\n// Define color variables\r\n// $primary-color: $c247Pink;\r\n// $primary-hover-color: $c247Blue;\r\n// $secondary-color: $c247Blue;\r\n// $hover-color: $c247Pink;\r\n$text-color: white;\r\n// $outline-border-color: white;\r\n\r\n// Create a mixin for hover effects to avoid repetition\r\n// @mixin hover-effect($hover-bg, $hover-border: null) {\r\n// &:hover {\r\n// background: $hover-bg;\r\n// @if $hover-border {\r\n// border-color: $hover-border;\r\n// }\r\n// }\r\n// }\r\n\r\n// // Primary button styles\r\n.primary-btn {\r\n &:hover {\r\n background-color: #B52776;\r\n }\r\n color: $text-color;\r\n box-shadow: 0px 2px 4px -2px rgba(0, 0, 0, 0.08), 0px 4px 8px -2px rgba(0, 0, 0, 0.04);\r\n}\r\n\r\n// // Secondary button styles\r\n// .secondary-btn {\r\n// background: $secondary-color;\r\n// color: $text-color;\r\n// }"],"sourceRoot":""}]);
30
+ ___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}]);
31
31
  // Exports
32
32
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
33
33
 
@@ -657,26 +657,48 @@ var update = injectStylesIntoStyleTag_default()(Buttons_button/* default */.A, o
657
657
  function Button(_ref) {
658
658
  let {
659
659
  type = 'button',
660
- cat = 'c247',
661
- // c247, neutral, destructive, inverse
662
660
  rank = 'primary',
663
- // Primary, secondary, tertiary
664
661
  state = 'default',
665
- // default, hover, disabled
666
662
  text = 'Example Button',
667
663
  size = 'md',
668
664
  isFullWidth = false,
665
+ icon: Icon,
666
+ // Icon as a React component
667
+ iconPosition = 'right',
668
+ // Icon position: 'left' or 'right'
669
+ isIconAnimated = false,
670
+ // Optional animation for icon hover
671
+ className = '',
672
+ // Accepts additional custom class
669
673
  onClick
670
674
  } = _ref;
671
- // Define style classes based on button rank
675
+ // Define styles for button ranks
672
676
  const rankStyles = {
673
- primary: 'bg-c247-pinkDefault hover:bg-c247-pinkHover',
674
- neutral: 'bg-c247-neutralDefault hover:bg-c247-neutralHover',
675
- destructive: 'bg-c247-destructiveDefault hover:bg-c247-destructiveHover'
677
+ primary: 'bg-brandPink600 hover:bg-brandPink700 text-greyBaseLight',
678
+ secondary: 'bg-greyBaseDark900 hover:bg-brandPink700 text-greyBaseLight',
679
+ outline: 'bg-greyLight50 border-solid border-2 border-greyLight100 hover:border-greyLight700 hover:greyLight100 text-greyLight700',
680
+ neutral: 'bg-greyLight50 hover:bg-greyLight100 text-greyLight700',
681
+ destructive: 'bg-utilRed1000 hover:bg-utilRed800 text-greyBaseLight'
676
682
  };
683
+
684
+ // Disabled styles for button
685
+ const disabledStyles = 'bg-greyLight100 text-greyLight500 cursor-not-allowed';
686
+
687
+ // Icon animation style (if applicable)
688
+ const iconClassNames = `
689
+ inline-block
690
+ transition-transform
691
+ ease-in-out
692
+ duration-200
693
+ h-5 w-5
694
+ ${iconPosition === 'right' ? 'ml-2' : 'mr-2'}
695
+ ${isIconAnimated ? 'group-hover:translate-x-1' : ''}
696
+ `;
697
+
698
+ // Main button class names
677
699
  const classNames = `
678
- ${rankStyles[rank] || rankStyles.primary}
679
- text-white
700
+ ${state === 'disabled' ? disabledStyles : rankStyles[rank] || rankStyles.primary}
701
+ group
680
702
  transition
681
703
  ease-in-out
682
704
  duration-700
@@ -684,13 +706,23 @@ function Button(_ref) {
684
706
  px-6
685
707
  py-2
686
708
  text-${size}
709
+ flex
710
+ items-center
711
+ justify-center
712
+ whitespace-nowrap // Prevents text wrapping
687
713
  ${isFullWidth ? 'w-full' : ''}
714
+ ${className}
688
715
  `;
689
716
  return /*#__PURE__*/external_react_default().createElement("button", {
690
717
  type: type,
691
718
  className: classNames,
692
- onClick: onClick
693
- }, text);
719
+ onClick: state === 'disabled' ? null : onClick,
720
+ disabled: state === 'disabled'
721
+ }, iconPosition === 'left' && Icon && /*#__PURE__*/external_react_default().createElement(Icon, {
722
+ className: iconClassNames
723
+ }), text, iconPosition === 'right' && Icon && /*#__PURE__*/external_react_default().createElement(Icon, {
724
+ className: iconClassNames
725
+ }));
694
726
  }
695
727
  // EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/Cards/card.scss
696
728
  var card = __webpack_require__(865);
@@ -727,9 +759,10 @@ var card_update = injectStylesIntoStyleTag_default()(card/* default */.A, card_o
727
759
  function Card(_ref) {
728
760
  let {
729
761
  mode = 'light',
762
+ className = '',
730
763
  children
731
764
  } = _ref;
732
- const cardClasses = `p-5 ${mode}-card rounded-lg shadow-lg`;
765
+ const cardClasses = `p-5 ${mode}-card rounded-lg shadow-lg border-solid border-2 border-greyLight100 ${className}`;
733
766
  return /*#__PURE__*/external_react_default().createElement("div", {
734
767
  className: cardClasses
735
768
  }, children);
@@ -745,12 +778,15 @@ const Input = /*#__PURE__*/(0,external_react_.forwardRef)((_ref, ref) => {
745
778
  isValid = true,
746
779
  errorMessage = `${label} is required`,
747
780
  onChange,
781
+ className = '',
748
782
  value
749
783
  } = _ref;
750
- const inputClasses = `rounded-md bg-white border px-4 py-3 text-md font-normal text-gray-900 ${isValid ? 'border-slate-500' : 'border-rose-500'}`;
784
+ const inputClasses = `${className} rounded-md bg-white border border-greyLight500 px-4 py-3 text-md font-normal text-gray-900 ${isValid ? 'border-greyLight500' : 'border-utilRed1000'}`;
751
785
  return /*#__PURE__*/external_react_default().createElement("div", {
752
786
  className: "flex flex-col mb-4"
753
- }, /*#__PURE__*/external_react_default().createElement("label", null, label), /*#__PURE__*/external_react_default().createElement("input", {
787
+ }, /*#__PURE__*/external_react_default().createElement("label", {
788
+ className: "text-greyLight1000"
789
+ }, label), /*#__PURE__*/external_react_default().createElement("input", {
754
790
  ref: ref,
755
791
  className: inputClasses,
756
792
  type: type,
@@ -759,7 +795,7 @@ const Input = /*#__PURE__*/(0,external_react_.forwardRef)((_ref, ref) => {
759
795
  onChange: onChange,
760
796
  value: value
761
797
  }), !isValid && /*#__PURE__*/external_react_default().createElement("span", {
762
- className: "text-rose-500 text-sm"
798
+ className: "text-utilRed1000 text-sm"
763
799
  }, errorMessage));
764
800
  });
765
801
  /* harmony default export */ const Inputs_Input = (Input);
@@ -9107,4 +9143,4 @@ function Dropdown(_ref) {
9107
9143
  /******/ })()
9108
9144
  ;
9109
9145
  });
9110
- //# sourceMappingURL=main.cf31769a0398dce70335.js.map
9146
+ //# sourceMappingURL=main.923c53023bac4e887eda.js.map