opus-toolkit-components 1.0.9 → 1.1.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.
|
@@ -505,7 +505,7 @@ module.exports = insertBySelector;
|
|
|
505
505
|
|
|
506
506
|
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()));
|
|
507
507
|
// Module
|
|
508
|
-
___CSS_LOADER_EXPORT___.push([module.id, `table thead th:first-of-type{border-top-left-radius:8px}table thead th:last-of-type{border-top-right-radius:8px}table tr:last-of-type td:first-of-type{border-bottom-left-radius:8px}table tr:last-of-type td:last-of-type{border-bottom-right-radius:8px}`, "",{"version":3,"sources":["webpack://./src/components/Tables/table.scss"],"names":[],"mappings":"
|
|
508
|
+
___CSS_LOADER_EXPORT___.push([module.id, `table{width:100%}table thead th:first-of-type{border-top-left-radius:8px}table thead th:last-of-type{border-top-right-radius:8px}table tr:last-of-type td:first-of-type{border-bottom-left-radius:8px}table tr:last-of-type td:last-of-type{border-bottom-right-radius:8px}@media(max-width: 640px){.responsive-table-wrapper td::before{content:attr(data-label);display:block;font-weight:600;text-transform:uppercase;margin-bottom:.25rem;color:var(--color-text-strong)}.responsive-table-wrapper tr{display:block}.responsive-table-wrapper td{display:block;padding-left:1rem;padding-right:1rem}.responsive-table-wrapper thead{display:none}}`, "",{"version":3,"sources":["webpack://./src/components/Tables/table.scss"],"names":[],"mappings":"AAAA,MAuBI,UAAA,CApBQ,6BACI,0BAAA,CAEJ,4BACI,2BAAA,CAOA,uCACI,6BAAA,CAEJ,sCACI,8BAAA,CAQpB,yBACI,qCACE,wBAAA,CACA,aAAA,CACA,eAAA,CACA,wBAAA,CACA,oBAAA,CACA,8BAAA,CAGF,6BACE,aAAA,CAGF,6BACE,aAAA,CACA,iBAAA,CACA,kBAAA,CAGF,gCACE,YAAA,CAAA","sourcesContent":["table {\r\n thead {\r\n th {\r\n &:first-of-type {\r\n border-top-left-radius: 8px;\r\n }\r\n &:last-of-type {\r\n border-top-right-radius: 8px;\r\n }\r\n }\r\n }\r\n tr {\r\n &:last-of-type {\r\n td {\r\n &:first-of-type {\r\n border-bottom-left-radius: 8px;\r\n }\r\n &:last-of-type {\r\n border-bottom-right-radius: 8px;\r\n }\r\n }\r\n } \r\n }\r\n width: 100%; \r\n}\r\n\r\n@media (max-width: 640px) {\r\n .responsive-table-wrapper td::before {\r\n content: attr(data-label);\r\n display: block;\r\n font-weight: 600;\r\n text-transform: uppercase;\r\n margin-bottom: 0.25rem;\r\n color: var(--color-text-strong);\r\n }\r\n \r\n .responsive-table-wrapper tr {\r\n display: block;\r\n }\r\n \r\n .responsive-table-wrapper td {\r\n display: block;\r\n padding-left: 1rem;\r\n padding-right: 1rem;\r\n }\r\n \r\n .responsive-table-wrapper thead {\r\n display: none;\r\n }\r\n }"],"sourceRoot":""}]);
|
|
509
509
|
// Exports
|
|
510
510
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
511
511
|
|
|
@@ -692,7 +692,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
692
692
|
Button: () => (/* reexport */ Button),
|
|
693
693
|
Card: () => (/* reexport */ Card),
|
|
694
694
|
Checkbox: () => (/* reexport */ Checkbox),
|
|
695
|
-
CookieBanner: () => (/* reexport */
|
|
695
|
+
CookieBanner: () => (/* reexport */ Cookie),
|
|
696
696
|
DatePicker: () => (/* reexport */ DatePicker),
|
|
697
697
|
Dropdown: () => (/* reexport */ Dropdown),
|
|
698
698
|
Input: () => (/* reexport */ Inputs_Input),
|
|
@@ -4180,30 +4180,36 @@ var table_update = injectStylesIntoStyleTag_default()(table/* default */.A, tabl
|
|
|
4180
4180
|
function Table(_ref) {
|
|
4181
4181
|
let {
|
|
4182
4182
|
data = [],
|
|
4183
|
-
// Array defining columns and rendering logic
|
|
4184
4183
|
rows = [],
|
|
4185
|
-
// Array defining rows
|
|
4186
4184
|
className = '',
|
|
4187
4185
|
rowClassName = '',
|
|
4188
4186
|
cellClassName = '',
|
|
4189
4187
|
headRowClassName = '',
|
|
4190
4188
|
headCellClassName = '',
|
|
4191
|
-
rowKeyExtractor = (row, index) => index
|
|
4189
|
+
rowKeyExtractor = (row, index) => index
|
|
4192
4190
|
} = _ref;
|
|
4193
|
-
return /*#__PURE__*/external_react_default().createElement("
|
|
4194
|
-
className: "
|
|
4195
|
-
}, /*#__PURE__*/external_react_default().createElement("
|
|
4191
|
+
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
4192
|
+
className: "responsive-table-wrapper w-full ".concat(className)
|
|
4193
|
+
}, /*#__PURE__*/external_react_default().createElement("table", {
|
|
4194
|
+
className: "min-w-full table-auto text-left border-collapse"
|
|
4195
|
+
}, /*#__PURE__*/external_react_default().createElement("thead", {
|
|
4196
|
+
className: "hidden sm:table-header-group"
|
|
4197
|
+
}, /*#__PURE__*/external_react_default().createElement("tr", {
|
|
4196
4198
|
className: "bg-[--color-table-head-bg] ".concat(headRowClassName)
|
|
4197
4199
|
}, data.map(column => /*#__PURE__*/external_react_default().createElement("th", {
|
|
4198
4200
|
key: column.key,
|
|
4199
|
-
className: "border-b border-[--color-stroke] py-2 px-4 text-sm font-normal text-[--color-
|
|
4200
|
-
}, column.header)))), /*#__PURE__*/external_react_default().createElement("tbody", null, rows.map((row, index) =>
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4201
|
+
className: "border-b border-[--color-stroke] py-2 px-4 text-sm font-normal text-[--color-table-head-txt] ".concat(headCellClassName)
|
|
4202
|
+
}, column.header)))), /*#__PURE__*/external_react_default().createElement("tbody", null, rows.map((row, index) => {
|
|
4203
|
+
const backgroundClass = index % 2 === 0 ? 'bg-[--color-table-row-bg-even]' : 'bg-[--color-table-row-bg-odd]';
|
|
4204
|
+
return /*#__PURE__*/external_react_default().createElement("tr", {
|
|
4205
|
+
key: rowKeyExtractor(row, index),
|
|
4206
|
+
className: "block sm:table-row mb-4 sm:mb-0 rounded-lg sm:rounded-none border sm:border-0 border-[--color-stroke] p-4 sm:p-0 shadow-sm sm:shadow-none hover:bg-[--color-table-row-bg-hover] ".concat(backgroundClass, " ").concat(rowClassName)
|
|
4207
|
+
}, data.map(column => /*#__PURE__*/external_react_default().createElement("td", {
|
|
4208
|
+
key: column.key,
|
|
4209
|
+
className: "block sm:table-cell px-4 py-2 text-sm text-[--color-text-weak] ".concat(cellClassName),
|
|
4210
|
+
"data-label": column.header
|
|
4211
|
+
}, column.render ? column.render(row) : row[column.key])));
|
|
4212
|
+
}))));
|
|
4207
4213
|
}
|
|
4208
4214
|
;// ./node_modules/@react-aria/utils/dist/useLayoutEffect.mjs
|
|
4209
4215
|
|
|
@@ -12911,8 +12917,7 @@ function Loader(_ref) {
|
|
|
12911
12917
|
}
|
|
12912
12918
|
;// external "opus-toolkit-styles/assets/logos/footer-logos.svg"
|
|
12913
12919
|
const footer_logos_svg_namespaceObject = require("opus-toolkit-styles/assets/logos/footer-logos.svg");
|
|
12914
|
-
|
|
12915
|
-
;// ./src/components/Cookies/CookieBanner.js
|
|
12920
|
+
;// ./src/components/Cookie/Cookie.js
|
|
12916
12921
|
|
|
12917
12922
|
|
|
12918
12923
|
|
|
@@ -12922,32 +12927,54 @@ const CookieBanner = _ref => {
|
|
|
12922
12927
|
logo,
|
|
12923
12928
|
policyTxt = "This website uses cookies to ensure you get the best experience on our site. By clicking Accept, you consent to the use of cookies.",
|
|
12924
12929
|
linkTxt = "Learn More",
|
|
12925
|
-
// New props for control
|
|
12926
12930
|
isVisible = true,
|
|
12927
|
-
// show/hide banner
|
|
12928
12931
|
onAccept = () => {},
|
|
12929
|
-
|
|
12930
|
-
onLearnMore = () => {} // Learn More click handler
|
|
12932
|
+
onLearnMore = () => {}
|
|
12931
12933
|
} = _ref;
|
|
12932
|
-
|
|
12934
|
+
const [show, setShow] = (0,external_react_.useState)(false);
|
|
12935
|
+
const [render, setRender] = (0,external_react_.useState)(isVisible);
|
|
12936
|
+
const [imageLoaded, setImageLoaded] = (0,external_react_.useState)(!logo); // if no logo image, consider loaded
|
|
12933
12937
|
|
|
12938
|
+
(0,external_react_.useEffect)(() => {
|
|
12939
|
+
if (isVisible) {
|
|
12940
|
+
setRender(true);
|
|
12941
|
+
if (logo) setImageLoaded(false);
|
|
12942
|
+
} else {
|
|
12943
|
+
setShow(false);
|
|
12944
|
+
const timeout = setTimeout(() => setRender(false), 300);
|
|
12945
|
+
return () => clearTimeout(timeout);
|
|
12946
|
+
}
|
|
12947
|
+
}, [isVisible]);
|
|
12948
|
+
(0,external_react_.useEffect)(() => {
|
|
12949
|
+
if (imageLoaded && render) {
|
|
12950
|
+
const timeout = setTimeout(() => setShow(true), 10);
|
|
12951
|
+
return () => clearTimeout(timeout);
|
|
12952
|
+
}
|
|
12953
|
+
}, [imageLoaded, render]);
|
|
12954
|
+
if (!render) return null;
|
|
12934
12955
|
return /*#__PURE__*/external_react_default().createElement(Card, {
|
|
12935
12956
|
intent: "brandSecondary",
|
|
12936
|
-
className: "flex items-center justify-between p-4 space-x-4"
|
|
12957
|
+
className: "\n md:flex items-center justify-between p-4 space-x-4\n transition-all duration-300 ease-in-out\n ".concat(show ? "opacity-100 translate-y-0" : "opacity-0 translate-y-3", "\n ")
|
|
12937
12958
|
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
12938
|
-
className: "flex items-center"
|
|
12939
|
-
}, /*#__PURE__*/external_react_default().createElement("
|
|
12940
|
-
|
|
12959
|
+
className: "md:flex items-center"
|
|
12960
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
12961
|
+
className: "flex-shrink-0 mr-4"
|
|
12962
|
+
}, logo ? /*#__PURE__*/external_react_default().createElement("img", {
|
|
12963
|
+
src: logo,
|
|
12941
12964
|
alt: "C247 Logo",
|
|
12942
|
-
className: "
|
|
12943
|
-
|
|
12965
|
+
className: "w-full object-contain",
|
|
12966
|
+
onLoad: () => setImageLoaded(true),
|
|
12967
|
+
loading: "eager"
|
|
12968
|
+
}) : /*#__PURE__*/external_react_default().createElement(footer_logos_svg_namespaceObject.ReactComponent, {
|
|
12969
|
+
className: "w-full h-full"
|
|
12970
|
+
})), /*#__PURE__*/external_react_default().createElement("p", {
|
|
12944
12971
|
className: "mr-4"
|
|
12945
12972
|
}, policyTxt)), /*#__PURE__*/external_react_default().createElement("div", {
|
|
12946
12973
|
className: "flex items-center space-x-4"
|
|
12947
12974
|
}, /*#__PURE__*/external_react_default().createElement(Button, {
|
|
12948
12975
|
rank: "primary",
|
|
12949
12976
|
text: "Accept",
|
|
12950
|
-
onClick: onAccept
|
|
12977
|
+
onClick: onAccept
|
|
12951
12978
|
}), /*#__PURE__*/external_react_default().createElement(Button, {
|
|
12952
12979
|
rank: "secondary",
|
|
12953
12980
|
text: linkTxt,
|
|
@@ -12957,7 +12984,7 @@ const CookieBanner = _ref => {
|
|
|
12957
12984
|
}
|
|
12958
12985
|
})));
|
|
12959
12986
|
};
|
|
12960
|
-
/* harmony default export */ const
|
|
12987
|
+
/* harmony default export */ const Cookie = (CookieBanner);
|
|
12961
12988
|
;// ./src/index.js
|
|
12962
12989
|
|
|
12963
12990
|
|
|
@@ -12977,4 +13004,4 @@ const CookieBanner = _ref => {
|
|
|
12977
13004
|
/******/ })()
|
|
12978
13005
|
;
|
|
12979
13006
|
});
|
|
12980
|
-
//# sourceMappingURL=main.
|
|
13007
|
+
//# sourceMappingURL=main.af7bdb60c408fab716fd.js.map
|