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,
|
|
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
|
|
675
|
+
// Define styles for button ranks
|
|
672
676
|
const rankStyles = {
|
|
673
|
-
primary: 'bg-
|
|
674
|
-
|
|
675
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 =
|
|
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",
|
|
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-
|
|
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.
|
|
9146
|
+
//# sourceMappingURL=main.923c53023bac4e887eda.js.map
|