opus-toolkit-components 0.3.0 → 0.3.1
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, `.primary-btn{
|
|
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":""}]);
|
|
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
|
|
|
@@ -657,15 +657,35 @@ var update = injectStylesIntoStyleTag_default()(_button/* default */.A, options)
|
|
|
657
657
|
function Button(_ref) {
|
|
658
658
|
let {
|
|
659
659
|
type = 'button',
|
|
660
|
+
cat = 'c247',
|
|
661
|
+
// c247, neutral, destructive, inverse
|
|
660
662
|
rank = 'primary',
|
|
663
|
+
// Primary, secondary, tertiary
|
|
664
|
+
state = 'default',
|
|
665
|
+
// default, hover, disabled
|
|
661
666
|
text = 'Example Button',
|
|
662
667
|
size = 'md',
|
|
663
668
|
isFullWidth = false,
|
|
664
|
-
// The boolean to toggle 'w-full'
|
|
665
669
|
onClick
|
|
666
670
|
} = _ref;
|
|
667
|
-
//
|
|
668
|
-
const
|
|
671
|
+
// Define style classes based on button rank
|
|
672
|
+
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'
|
|
676
|
+
};
|
|
677
|
+
const classNames = `
|
|
678
|
+
${rankStyles[rank] || rankStyles.primary}
|
|
679
|
+
text-white
|
|
680
|
+
transition
|
|
681
|
+
ease-in-out
|
|
682
|
+
duration-700
|
|
683
|
+
rounded-lg
|
|
684
|
+
px-6
|
|
685
|
+
py-2
|
|
686
|
+
text-${size}
|
|
687
|
+
${isFullWidth ? 'w-full' : ''}
|
|
688
|
+
`;
|
|
669
689
|
return /*#__PURE__*/external_react_default().createElement("button", {
|
|
670
690
|
type: type,
|
|
671
691
|
className: classNames,
|
|
@@ -716,7 +736,7 @@ function Card(_ref) {
|
|
|
716
736
|
}
|
|
717
737
|
;// ./src/components/Forms/Inputs/Input.js
|
|
718
738
|
|
|
719
|
-
|
|
739
|
+
const Input = /*#__PURE__*/(0,external_react_.forwardRef)((_ref, ref) => {
|
|
720
740
|
let {
|
|
721
741
|
label,
|
|
722
742
|
placeholder,
|
|
@@ -731,6 +751,7 @@ function Input(_ref) {
|
|
|
731
751
|
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
732
752
|
className: "flex flex-col mb-4"
|
|
733
753
|
}, /*#__PURE__*/external_react_default().createElement("label", null, label), /*#__PURE__*/external_react_default().createElement("input", {
|
|
754
|
+
ref: ref,
|
|
734
755
|
className: inputClasses,
|
|
735
756
|
type: type,
|
|
736
757
|
name: name,
|
|
@@ -740,7 +761,8 @@ function Input(_ref) {
|
|
|
740
761
|
}), !isValid && /*#__PURE__*/external_react_default().createElement("span", {
|
|
741
762
|
className: "text-rose-500 text-sm"
|
|
742
763
|
}, errorMessage));
|
|
743
|
-
}
|
|
764
|
+
});
|
|
765
|
+
/* harmony default export */ const Inputs_Input = (Input);
|
|
744
766
|
;// ./src/components/Forms/Datepickers/DatePicker.js
|
|
745
767
|
|
|
746
768
|
function DatePicker(_ref) {
|
|
@@ -9085,4 +9107,4 @@ function Dropdown(_ref) {
|
|
|
9085
9107
|
/******/ })()
|
|
9086
9108
|
;
|
|
9087
9109
|
});
|
|
9088
|
-
//# sourceMappingURL=main.
|
|
9110
|
+
//# sourceMappingURL=main.cf31769a0398dce70335.js.map
|