opus-toolkit-components 0.3.0 → 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.
|
@@ -12,7 +12,7 @@ return /******/ (() => { // webpackBootstrap
|
|
|
12
12
|
/******/ "use strict";
|
|
13
13
|
/******/ var __webpack_modules__ = ({
|
|
14
14
|
|
|
15
|
-
/***/
|
|
15
|
+
/***/ 289:
|
|
16
16
|
/***/ ((module, __webpack_exports__, __webpack_require__) => {
|
|
17
17
|
|
|
18
18
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
@@ -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
|
|
|
@@ -546,7 +546,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
546
546
|
Card: () => (/* reexport */ Card),
|
|
547
547
|
DatePicker: () => (/* reexport */ DatePicker),
|
|
548
548
|
Dropdown: () => (/* reexport */ Dropdown),
|
|
549
|
-
Input: () => (/* reexport */
|
|
549
|
+
Input: () => (/* reexport */ Inputs_Input),
|
|
550
550
|
RadioButton: () => (/* reexport */ RadioButton),
|
|
551
551
|
Table: () => (/* reexport */ Table)
|
|
552
552
|
});
|
|
@@ -622,9 +622,9 @@ var insertStyleElement_default = /*#__PURE__*/__webpack_require__.n(insertStyleE
|
|
|
622
622
|
// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/styleTagTransform.js
|
|
623
623
|
var styleTagTransform = __webpack_require__(113);
|
|
624
624
|
var styleTagTransform_default = /*#__PURE__*/__webpack_require__.n(styleTagTransform);
|
|
625
|
-
// EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/Buttons/
|
|
626
|
-
var
|
|
627
|
-
;// ./src/components/Buttons/
|
|
625
|
+
// EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/Buttons/button.scss
|
|
626
|
+
var Buttons_button = __webpack_require__(289);
|
|
627
|
+
;// ./src/components/Buttons/button.scss
|
|
628
628
|
|
|
629
629
|
|
|
630
630
|
|
|
@@ -644,12 +644,12 @@ options.insert = insertBySelector_default().bind(null, "head");
|
|
|
644
644
|
options.domAPI = (styleDomAPI_default());
|
|
645
645
|
options.insertStyleElement = (insertStyleElement_default());
|
|
646
646
|
|
|
647
|
-
var update = injectStylesIntoStyleTag_default()(
|
|
647
|
+
var update = injectStylesIntoStyleTag_default()(Buttons_button/* default */.A, options);
|
|
648
648
|
|
|
649
649
|
|
|
650
650
|
|
|
651
651
|
|
|
652
|
-
/* harmony default export */ const
|
|
652
|
+
/* harmony default export */ const components_Buttons_button = (Buttons_button/* default */.A && Buttons_button/* default */.A.locals ? Buttons_button/* default */.A.locals : undefined);
|
|
653
653
|
|
|
654
654
|
;// ./src/components/Buttons/Button.js
|
|
655
655
|
|
|
@@ -658,19 +658,71 @@ function Button(_ref) {
|
|
|
658
658
|
let {
|
|
659
659
|
type = 'button',
|
|
660
660
|
rank = 'primary',
|
|
661
|
+
state = 'default',
|
|
661
662
|
text = 'Example Button',
|
|
662
663
|
size = 'md',
|
|
663
664
|
isFullWidth = false,
|
|
664
|
-
|
|
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
|
|
665
673
|
onClick
|
|
666
674
|
} = _ref;
|
|
667
|
-
//
|
|
668
|
-
const
|
|
675
|
+
// Define styles for button ranks
|
|
676
|
+
const rankStyles = {
|
|
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'
|
|
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
|
|
699
|
+
const classNames = `
|
|
700
|
+
${state === 'disabled' ? disabledStyles : rankStyles[rank] || rankStyles.primary}
|
|
701
|
+
group
|
|
702
|
+
transition
|
|
703
|
+
ease-in-out
|
|
704
|
+
duration-700
|
|
705
|
+
rounded-lg
|
|
706
|
+
px-6
|
|
707
|
+
py-2
|
|
708
|
+
text-${size}
|
|
709
|
+
flex
|
|
710
|
+
items-center
|
|
711
|
+
justify-center
|
|
712
|
+
whitespace-nowrap // Prevents text wrapping
|
|
713
|
+
${isFullWidth ? 'w-full' : ''}
|
|
714
|
+
${className}
|
|
715
|
+
`;
|
|
669
716
|
return /*#__PURE__*/external_react_default().createElement("button", {
|
|
670
717
|
type: type,
|
|
671
718
|
className: classNames,
|
|
672
|
-
onClick: onClick
|
|
673
|
-
|
|
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
|
+
}));
|
|
674
726
|
}
|
|
675
727
|
// EXTERNAL MODULE: ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./src/components/Cards/card.scss
|
|
676
728
|
var card = __webpack_require__(865);
|
|
@@ -707,16 +759,17 @@ var card_update = injectStylesIntoStyleTag_default()(card/* default */.A, card_o
|
|
|
707
759
|
function Card(_ref) {
|
|
708
760
|
let {
|
|
709
761
|
mode = 'light',
|
|
762
|
+
className = '',
|
|
710
763
|
children
|
|
711
764
|
} = _ref;
|
|
712
|
-
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}`;
|
|
713
766
|
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
714
767
|
className: cardClasses
|
|
715
768
|
}, children);
|
|
716
769
|
}
|
|
717
770
|
;// ./src/components/Forms/Inputs/Input.js
|
|
718
771
|
|
|
719
|
-
|
|
772
|
+
const Input = /*#__PURE__*/(0,external_react_.forwardRef)((_ref, ref) => {
|
|
720
773
|
let {
|
|
721
774
|
label,
|
|
722
775
|
placeholder,
|
|
@@ -725,12 +778,16 @@ function Input(_ref) {
|
|
|
725
778
|
isValid = true,
|
|
726
779
|
errorMessage = `${label} is required`,
|
|
727
780
|
onChange,
|
|
781
|
+
className = '',
|
|
728
782
|
value
|
|
729
783
|
} = _ref;
|
|
730
|
-
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'}`;
|
|
731
785
|
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
732
786
|
className: "flex flex-col mb-4"
|
|
733
|
-
}, /*#__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", {
|
|
790
|
+
ref: ref,
|
|
734
791
|
className: inputClasses,
|
|
735
792
|
type: type,
|
|
736
793
|
name: name,
|
|
@@ -738,9 +795,10 @@ function Input(_ref) {
|
|
|
738
795
|
onChange: onChange,
|
|
739
796
|
value: value
|
|
740
797
|
}), !isValid && /*#__PURE__*/external_react_default().createElement("span", {
|
|
741
|
-
className: "text-
|
|
798
|
+
className: "text-utilRed1000 text-sm"
|
|
742
799
|
}, errorMessage));
|
|
743
|
-
}
|
|
800
|
+
});
|
|
801
|
+
/* harmony default export */ const Inputs_Input = (Input);
|
|
744
802
|
;// ./src/components/Forms/Datepickers/DatePicker.js
|
|
745
803
|
|
|
746
804
|
function DatePicker(_ref) {
|
|
@@ -9085,4 +9143,4 @@ function Dropdown(_ref) {
|
|
|
9085
9143
|
/******/ })()
|
|
9086
9144
|
;
|
|
9087
9145
|
});
|
|
9088
|
-
//# sourceMappingURL=main.
|
|
9146
|
+
//# sourceMappingURL=main.923c53023bac4e887eda.js.map
|