opus-toolkit-components 1.9.9 → 2.0.0
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.
- package/lib/components/BarLayout/index.js +125 -0
- package/lib/components/BarLayout/index.js.map +1 -0
- package/lib/components/Callout/index.js +1092 -0
- package/lib/components/Callout/index.js.map +1 -0
- package/lib/components/Cookie/index.js +4601 -0
- package/lib/components/Cookie/index.js.map +1 -0
- package/lib/components/Footer/index.js +705 -0
- package/lib/components/Footer/index.js.map +1 -0
- package/lib/components/FooterLogo/index.js +608 -0
- package/lib/components/FooterLogo/index.js.map +1 -0
- package/lib/components/Forms/Checkbox/index.js +347 -0
- package/lib/components/Forms/Checkbox/index.js.map +1 -0
- package/lib/components/Forms/FilterPopover/index.js +658 -0
- package/lib/components/Forms/FilterPopover/index.js.map +1 -0
- package/lib/components/Forms/ToggleSwitch/index.js +336 -0
- package/lib/components/Forms/ToggleSwitch/index.js.map +1 -0
- package/lib/components/Header/index.js +312 -0
- package/lib/components/Header/index.js.map +1 -0
- package/lib/components/Icon/Icon.d.ts +25 -0
- package/lib/components/Icon/index.d.ts +17 -14
- package/lib/components/Icon/index.js +359 -0
- package/lib/components/Icon/index.js.map +1 -0
- package/lib/components/IconButton/index.js +461 -0
- package/lib/components/IconButton/index.js.map +1 -0
- package/lib/components/Link/index.js +4 -4
- package/lib/components/Loader/index.js +297 -0
- package/lib/components/Loader/index.js.map +1 -0
- package/lib/components/Navbar/index.js +615 -0
- package/lib/components/Navbar/index.js.map +1 -0
- package/lib/components/PageTemplate/index.js +2153 -0
- package/lib/components/PageTemplate/index.js.map +1 -0
- package/lib/components/Profile/ProfileCard/index.js +339 -0
- package/lib/components/Profile/ProfileCard/index.js.map +1 -0
- package/lib/components/Sidebar/index.js +1743 -0
- package/lib/components/Sidebar/index.js.map +1 -0
- package/lib/components/Text/index.js +214 -0
- package/lib/components/Text/index.js.map +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/main.js +1558 -39242
- package/lib/main.js.map +1 -1
- package/package.json +6 -3
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
/******/ (() => { // webpackBootstrap
|
|
2
|
+
/******/ "use strict";
|
|
3
|
+
/******/ var __webpack_modules__ = ({
|
|
4
|
+
|
|
5
|
+
/***/ 1111
|
|
6
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
7
|
+
|
|
8
|
+
__webpack_require__.r(__webpack_exports__);
|
|
9
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
10
|
+
/* harmony export */ "default": () => (/* binding */ Text)
|
|
11
|
+
/* harmony export */ });
|
|
12
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9206);
|
|
13
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
14
|
+
/* harmony import */ var _utils_getDataCy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7339);
|
|
15
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4178);
|
|
16
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
const variantMap = {
|
|
21
|
+
h1: "text-4xl font-bold leading-tight",
|
|
22
|
+
h2: "text-3xl leading-snug",
|
|
23
|
+
h3: "text-2xl font-semibold leading-snug",
|
|
24
|
+
h4: "text-xl font-medium",
|
|
25
|
+
h5: "text-lg font-medium",
|
|
26
|
+
h6: "text-base font-medium",
|
|
27
|
+
body: "text-base",
|
|
28
|
+
small: "text-sm",
|
|
29
|
+
caption: "text-xs",
|
|
30
|
+
label: "text-md"
|
|
31
|
+
};
|
|
32
|
+
const elementMap = {
|
|
33
|
+
h1: "h1",
|
|
34
|
+
h2: "h2",
|
|
35
|
+
h3: "h3",
|
|
36
|
+
h4: "h4",
|
|
37
|
+
h5: "h5",
|
|
38
|
+
h6: "h6",
|
|
39
|
+
body: "p",
|
|
40
|
+
small: "small",
|
|
41
|
+
caption: "span",
|
|
42
|
+
label: "label"
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Allowed typographical variants for the Text component.
|
|
47
|
+
* @typedef {'h1'|'h2'|'h3'|'h4'|'h5'|'h6'|'body'|'small'|'caption'|'label'} TextVariant
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Polymorphic HTML element types supported in `as`.
|
|
52
|
+
* @typedef {keyof JSX.IntrinsicElements | React.ComponentType<any>} TextAs
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Props for the Text component.
|
|
57
|
+
*
|
|
58
|
+
* @typedef {Object} TextProps
|
|
59
|
+
*
|
|
60
|
+
* @property {TextVariant} [variant='body']
|
|
61
|
+
* Controls the typography style.
|
|
62
|
+
*
|
|
63
|
+
* @property {TextAs} [as]
|
|
64
|
+
* Optional override for the underlying HTML element.
|
|
65
|
+
*
|
|
66
|
+
* @property {string} [className]
|
|
67
|
+
* Extra CSS classes.
|
|
68
|
+
*
|
|
69
|
+
* @property {string} [color='text-[--color-text-strong]']
|
|
70
|
+
* Tailwind/text color classes.
|
|
71
|
+
*
|
|
72
|
+
* @property {React.ReactNode} [children]
|
|
73
|
+
* Text content.
|
|
74
|
+
*
|
|
75
|
+
* @property {string} [name]
|
|
76
|
+
* Name used to generate `data-cy`.
|
|
77
|
+
*
|
|
78
|
+
* @property {string} [dataCy]
|
|
79
|
+
* Optional override for auto-generated data-cy attribute.
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Text component with typography variants and polymorphic rendering.
|
|
84
|
+
*
|
|
85
|
+
* @param {TextProps & React.HTMLAttributes<HTMLElement>} props
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
function Text(_ref) {
|
|
89
|
+
let {
|
|
90
|
+
variant = "body",
|
|
91
|
+
as,
|
|
92
|
+
className = "",
|
|
93
|
+
color = "text-[--color-text-strong]",
|
|
94
|
+
children,
|
|
95
|
+
name,
|
|
96
|
+
dataCy,
|
|
97
|
+
...rest
|
|
98
|
+
} = _ref;
|
|
99
|
+
const Component = as || elementMap[variant] || "p";
|
|
100
|
+
const variantClass = variantMap[variant] || variantMap.body;
|
|
101
|
+
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Component, {
|
|
102
|
+
className: `${variantClass} ${color} ${className}`,
|
|
103
|
+
"data-cy": (0,_utils_getDataCy__WEBPACK_IMPORTED_MODULE_1__.getDataCy)({
|
|
104
|
+
name,
|
|
105
|
+
dataCy
|
|
106
|
+
}),
|
|
107
|
+
...rest,
|
|
108
|
+
children: children
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/***/ },
|
|
113
|
+
|
|
114
|
+
/***/ 7339
|
|
115
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
116
|
+
|
|
117
|
+
__webpack_require__.r(__webpack_exports__);
|
|
118
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
119
|
+
/* harmony export */ getDataCy: () => (/* binding */ getDataCy)
|
|
120
|
+
/* harmony export */ });
|
|
121
|
+
const getDataCy = function () {
|
|
122
|
+
let {
|
|
123
|
+
name,
|
|
124
|
+
value,
|
|
125
|
+
dataCy
|
|
126
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
127
|
+
if (dataCy) return dataCy;
|
|
128
|
+
if (name && value) return `${name}-${value}`;
|
|
129
|
+
return name || '';
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
/***/ },
|
|
133
|
+
|
|
134
|
+
/***/ 5827
|
|
135
|
+
(module) {
|
|
136
|
+
|
|
137
|
+
module.exports = require("opus-toolkit-styles/assets/logos/c247-loader.gif");
|
|
138
|
+
|
|
139
|
+
/***/ },
|
|
140
|
+
|
|
141
|
+
/***/ 4178
|
|
142
|
+
(module) {
|
|
143
|
+
|
|
144
|
+
module.exports = require("react/jsx-runtime");
|
|
145
|
+
|
|
146
|
+
/***/ },
|
|
147
|
+
|
|
148
|
+
/***/ 9206
|
|
149
|
+
(module) {
|
|
150
|
+
|
|
151
|
+
module.exports = require("react");
|
|
152
|
+
|
|
153
|
+
/***/ }
|
|
154
|
+
|
|
155
|
+
/******/ });
|
|
156
|
+
/************************************************************************/
|
|
157
|
+
/******/ // The module cache
|
|
158
|
+
/******/ var __webpack_module_cache__ = {};
|
|
159
|
+
/******/
|
|
160
|
+
/******/ // The require function
|
|
161
|
+
/******/ function __webpack_require__(moduleId) {
|
|
162
|
+
/******/ // Check if module is in cache
|
|
163
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
164
|
+
/******/ if (cachedModule !== undefined) {
|
|
165
|
+
/******/ return cachedModule.exports;
|
|
166
|
+
/******/ }
|
|
167
|
+
/******/ // Create a new module (and put it into the cache)
|
|
168
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
169
|
+
/******/ // no module.id needed
|
|
170
|
+
/******/ // no module.loaded needed
|
|
171
|
+
/******/ exports: {}
|
|
172
|
+
/******/ };
|
|
173
|
+
/******/
|
|
174
|
+
/******/ // Execute the module function
|
|
175
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
176
|
+
/******/
|
|
177
|
+
/******/ // Return the exports of the module
|
|
178
|
+
/******/ return module.exports;
|
|
179
|
+
/******/ }
|
|
180
|
+
/******/
|
|
181
|
+
/************************************************************************/
|
|
182
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
183
|
+
/******/ (() => {
|
|
184
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
185
|
+
/******/ __webpack_require__.n = (module) => {
|
|
186
|
+
/******/ var getter = module && module.__esModule ?
|
|
187
|
+
/******/ () => (module['default']) :
|
|
188
|
+
/******/ () => (module);
|
|
189
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
190
|
+
/******/ return getter;
|
|
191
|
+
/******/ };
|
|
192
|
+
/******/ })();
|
|
193
|
+
/******/
|
|
194
|
+
/******/ /* webpack/runtime/define property getters */
|
|
195
|
+
/******/ (() => {
|
|
196
|
+
/******/ // define getter functions for harmony exports
|
|
197
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
198
|
+
/******/ for(var key in definition) {
|
|
199
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
200
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
201
|
+
/******/ }
|
|
202
|
+
/******/ }
|
|
203
|
+
/******/ };
|
|
204
|
+
/******/ })();
|
|
205
|
+
/******/
|
|
206
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
207
|
+
/******/ (() => {
|
|
208
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
209
|
+
/******/ })();
|
|
210
|
+
/******/
|
|
211
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
212
|
+
/******/ (() => {
|
|
213
|
+
/******/ // define __esModule on exports
|
|
214
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
215
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
216
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
217
|
+
/******/ }
|
|
218
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
219
|
+
/******/ };
|
|
220
|
+
/******/ })();
|
|
221
|
+
/******/
|
|
222
|
+
/************************************************************************/
|
|
223
|
+
var __webpack_exports__ = {};
|
|
224
|
+
__webpack_require__.r(__webpack_exports__);
|
|
225
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
226
|
+
/* harmony export */ "default": () => (/* binding */ Loader)
|
|
227
|
+
/* harmony export */ });
|
|
228
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9206);
|
|
229
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
230
|
+
/* harmony import */ var _Text_Text__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1111);
|
|
231
|
+
/* harmony import */ var opus_toolkit_styles_assets_logos_c247_loader_gif__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5827);
|
|
232
|
+
/* harmony import */ var opus_toolkit_styles_assets_logos_c247_loader_gif__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(opus_toolkit_styles_assets_logos_c247_loader_gif__WEBPACK_IMPORTED_MODULE_2__);
|
|
233
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4178);
|
|
234
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
// TODO: Consider refactoring Loader to remove internal isLoading logic.
|
|
239
|
+
// It's currently responsible for both rendering logic and presentation.
|
|
240
|
+
// In production, it's better to let the parent control rendering to keep Loader focused on UI.
|
|
241
|
+
// This change would improve testability, flexibility, and follow React best practices.
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Props for the Loader component.
|
|
245
|
+
*
|
|
246
|
+
* @typedef {Object} LoaderProps
|
|
247
|
+
*
|
|
248
|
+
* @property {boolean} isLoading
|
|
249
|
+
* Determines whether the loader is visible.
|
|
250
|
+
*
|
|
251
|
+
* @property {string} [loaderText='loading...']
|
|
252
|
+
* Optional text displayed beneath the spinner.
|
|
253
|
+
*
|
|
254
|
+
* @property {React.ReactNode} [customLoader]
|
|
255
|
+
* Custom loader element (replaces default GIF).
|
|
256
|
+
*
|
|
257
|
+
* @property {string} [className]
|
|
258
|
+
* Extra class names applied to the outer container.
|
|
259
|
+
*/
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Loader overlay that covers the entire screen.
|
|
263
|
+
*
|
|
264
|
+
* @param {LoaderProps & React.HTMLAttributes<HTMLDivElement>} props
|
|
265
|
+
*/
|
|
266
|
+
|
|
267
|
+
function Loader(_ref) {
|
|
268
|
+
let {
|
|
269
|
+
isLoading,
|
|
270
|
+
loaderText = "loading...",
|
|
271
|
+
customLoader,
|
|
272
|
+
className = "",
|
|
273
|
+
...rest
|
|
274
|
+
} = _ref;
|
|
275
|
+
return isLoading && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
|
|
276
|
+
className: `fixed inset-0 z-50 flex items-center justify-center ${className}`,
|
|
277
|
+
...rest,
|
|
278
|
+
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
|
|
279
|
+
className: "absolute inset-0 bg-[--color-primary-bg] opacity-70"
|
|
280
|
+
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
|
|
281
|
+
className: "relative z-10 flex flex-col items-center",
|
|
282
|
+
children: [customLoader ? customLoader : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("img", {
|
|
283
|
+
src: (opus_toolkit_styles_assets_logos_c247_loader_gif__WEBPACK_IMPORTED_MODULE_2___default()),
|
|
284
|
+
alt: "Loading",
|
|
285
|
+
className: "max-h-[96px] w-[auto]"
|
|
286
|
+
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_Text_Text__WEBPACK_IMPORTED_MODULE_1__["default"], {
|
|
287
|
+
variant: "h4",
|
|
288
|
+
className: "mt-4 animate-pulse text-center",
|
|
289
|
+
children: loaderText
|
|
290
|
+
})]
|
|
291
|
+
})]
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
module.exports = __webpack_exports__;
|
|
295
|
+
/******/ })()
|
|
296
|
+
;
|
|
297
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components/Loader/index.js","mappings":"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","sources":["webpack://opus-toolkit-components/./src/components/Text/Text.jsx","webpack://opus-toolkit-components/./src/utils/getDataCy.js","webpack://opus-toolkit-components/external commonjs \"opus-toolkit-styles/assets/logos/c247-loader.gif\"","webpack://opus-toolkit-components/external commonjs2 \"react/jsx-runtime\"","webpack://opus-toolkit-components/external commonjs2 {\"commonjs\":\"react\",\"commonjs2\":\"react\",\"amd\":\"react\",\"root\":\"React\"}","webpack://opus-toolkit-components/webpack/bootstrap","webpack://opus-toolkit-components/webpack/runtime/compat get default export","webpack://opus-toolkit-components/webpack/runtime/define property getters","webpack://opus-toolkit-components/webpack/runtime/hasOwnProperty shorthand","webpack://opus-toolkit-components/webpack/runtime/make namespace object","webpack://opus-toolkit-components/./src/components/Loader/Loader.jsx"],"sourcesContent":["import React from \"react\";\r\nimport { getDataCy } from \"../../utils/getDataCy\";\r\n\r\nconst variantMap = {\r\n h1: \"text-4xl font-bold leading-tight\",\r\n h2: \"text-3xl leading-snug\",\r\n h3: \"text-2xl font-semibold leading-snug\",\r\n h4: \"text-xl font-medium\",\r\n h5: \"text-lg font-medium\",\r\n h6: \"text-base font-medium\",\r\n body: \"text-base\",\r\n small: \"text-sm\",\r\n caption: \"text-xs\",\r\n label: \"text-md\",\r\n};\r\n\r\nconst elementMap = {\r\n h1: \"h1\",\r\n h2: \"h2\",\r\n h3: \"h3\",\r\n h4: \"h4\",\r\n h5: \"h5\",\r\n h6: \"h6\",\r\n body: \"p\",\r\n small: \"small\",\r\n caption: \"span\",\r\n label: \"label\",\r\n};\r\n\r\n/**\r\n * Allowed typographical variants for the Text component.\r\n * @typedef {'h1'|'h2'|'h3'|'h4'|'h5'|'h6'|'body'|'small'|'caption'|'label'} TextVariant\r\n */\r\n\r\n/**\r\n * Polymorphic HTML element types supported in `as`.\r\n * @typedef {keyof JSX.IntrinsicElements | React.ComponentType<any>} TextAs\r\n */\r\n\r\n/**\r\n * Props for the Text component.\r\n *\r\n * @typedef {Object} TextProps\r\n *\r\n * @property {TextVariant} [variant='body']\r\n * Controls the typography style.\r\n *\r\n * @property {TextAs} [as]\r\n * Optional override for the underlying HTML element.\r\n *\r\n * @property {string} [className]\r\n * Extra CSS classes.\r\n *\r\n * @property {string} [color='text-[--color-text-strong]']\r\n * Tailwind/text color classes.\r\n *\r\n * @property {React.ReactNode} [children]\r\n * Text content.\r\n *\r\n * @property {string} [name]\r\n * Name used to generate `data-cy`.\r\n *\r\n * @property {string} [dataCy]\r\n * Optional override for auto-generated data-cy attribute.\r\n */\r\n\r\n/**\r\n * Text component with typography variants and polymorphic rendering.\r\n *\r\n * @param {TextProps & React.HTMLAttributes<HTMLElement>} props\r\n */\r\n\r\nexport default function Text({\r\n variant = \"body\",\r\n as,\r\n className = \"\",\r\n color = \"text-[--color-text-strong]\",\r\n children,\r\n name,\r\n dataCy,\r\n ...rest\r\n}) {\r\n const Component = as || elementMap[variant] || \"p\";\r\n const variantClass = variantMap[variant] || variantMap.body;\r\n\r\n return (\r\n <Component\r\n className={`${variantClass} ${color} ${className}`}\r\n data-cy={getDataCy({ name, dataCy })}\r\n {...rest}\r\n >\r\n {children}\r\n </Component>\r\n );\r\n}\r\n","export const getDataCy = ({ name, value, dataCy } = {}) => {\r\n if (dataCy) return dataCy;\r\n if (name && value) return `${name}-${value}`;\r\n return name || '';\r\n };","module.exports = require(\"opus-toolkit-styles/assets/logos/c247-loader.gif\");","module.exports = require(\"react/jsx-runtime\");","module.exports = require(\"react\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import React from \"react\";\nimport Text from \"../Text/Text\";\nimport logo from \"opus-toolkit-styles/assets/logos/c247-loader.gif\";\n// TODO: Consider refactoring Loader to remove internal isLoading logic.\n// It's currently responsible for both rendering logic and presentation.\n// In production, it's better to let the parent control rendering to keep Loader focused on UI.\n// This change would improve testability, flexibility, and follow React best practices.\n\n/**\n * Props for the Loader component.\n *\n * @typedef {Object} LoaderProps\n *\n * @property {boolean} isLoading\n * Determines whether the loader is visible.\n *\n * @property {string} [loaderText='loading...']\n * Optional text displayed beneath the spinner.\n *\n * @property {React.ReactNode} [customLoader]\n * Custom loader element (replaces default GIF).\n *\n * @property {string} [className]\n * Extra class names applied to the outer container.\n */\n\n/**\n * Loader overlay that covers the entire screen.\n *\n * @param {LoaderProps & React.HTMLAttributes<HTMLDivElement>} props\n */\n\nexport default function Loader({\n isLoading,\n loaderText = \"loading...\",\n customLoader,\n className = \"\",\n ...rest\n}) {\n return (\n isLoading && (\n <div\n className={`fixed inset-0 z-50 flex items-center justify-center ${className}`}\n {...rest}\n >\n <div className=\"absolute inset-0 bg-[--color-primary-bg] opacity-70\"></div>\n <div className=\"relative z-10 flex flex-col items-center\">\n {customLoader ? (\n customLoader\n ) : (\n <img src={logo} alt=\"Loading\" className=\"max-h-[96px] w-[auto]\" />\n )}\n <Text variant=\"h4\" className=\"mt-4 animate-pulse text-center\">\n {loaderText}\n </Text>\n </div>\n </div>\n )\n );\n}\n"],"names":["React","getDataCy","jsx","_jsx","variantMap","h1","h2","h3","h4","h5","h6","body","small","caption","label","elementMap","Text","_ref","variant","as","className","color","children","name","dataCy","rest","Component","variantClass","value","arguments","length","undefined","logo","jsxs","_jsxs","Loader","isLoading","loaderText","customLoader","src","alt"],"sourceRoot":""}
|