opus-toolkit-components 1.9.9 → 2.0.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.
- 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 +1589 -39270
- package/lib/main.js.map +1 -1
- package/package.json +6 -3
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
/******/ (() => { // webpackBootstrap
|
|
2
|
+
/******/ "use strict";
|
|
3
|
+
/******/ var __webpack_modules__ = ({
|
|
4
|
+
|
|
5
|
+
/***/ 7779
|
|
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": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
11
|
+
/* harmony export */ });
|
|
12
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4178);
|
|
13
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @typedef {Object} BarLayoutProps
|
|
17
|
+
* @property {React.ReactNode} [left] Left content area
|
|
18
|
+
* @property {React.ReactNode} [center] Center content area
|
|
19
|
+
* @property {React.ReactNode} [right] Right content area
|
|
20
|
+
* @property {string} [className] Optional wrapper class
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @param {BarLayoutProps} props
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
const BarLayout = _ref => {
|
|
28
|
+
let {
|
|
29
|
+
left,
|
|
30
|
+
center,
|
|
31
|
+
right,
|
|
32
|
+
className = ""
|
|
33
|
+
} = _ref;
|
|
34
|
+
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
|
|
35
|
+
className: `flex w-full items-center justify-between ${className}`,
|
|
36
|
+
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
|
|
37
|
+
className: "flex-1",
|
|
38
|
+
children: left
|
|
39
|
+
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
|
|
40
|
+
className: "flex-auto text-center",
|
|
41
|
+
children: center
|
|
42
|
+
}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
|
|
43
|
+
className: "flex flex-1 justify-end",
|
|
44
|
+
children: right
|
|
45
|
+
})]
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BarLayout);
|
|
49
|
+
|
|
50
|
+
/***/ },
|
|
51
|
+
|
|
52
|
+
/***/ 1111
|
|
53
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
54
|
+
|
|
55
|
+
__webpack_require__.r(__webpack_exports__);
|
|
56
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
57
|
+
/* harmony export */ "default": () => (/* binding */ Text)
|
|
58
|
+
/* harmony export */ });
|
|
59
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9206);
|
|
60
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
61
|
+
/* harmony import */ var _utils_getDataCy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7339);
|
|
62
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4178);
|
|
63
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
const variantMap = {
|
|
68
|
+
h1: "text-4xl font-bold leading-tight",
|
|
69
|
+
h2: "text-3xl leading-snug",
|
|
70
|
+
h3: "text-2xl font-semibold leading-snug",
|
|
71
|
+
h4: "text-xl font-medium",
|
|
72
|
+
h5: "text-lg font-medium",
|
|
73
|
+
h6: "text-base font-medium",
|
|
74
|
+
body: "text-base",
|
|
75
|
+
small: "text-sm",
|
|
76
|
+
caption: "text-xs",
|
|
77
|
+
label: "text-md"
|
|
78
|
+
};
|
|
79
|
+
const elementMap = {
|
|
80
|
+
h1: "h1",
|
|
81
|
+
h2: "h2",
|
|
82
|
+
h3: "h3",
|
|
83
|
+
h4: "h4",
|
|
84
|
+
h5: "h5",
|
|
85
|
+
h6: "h6",
|
|
86
|
+
body: "p",
|
|
87
|
+
small: "small",
|
|
88
|
+
caption: "span",
|
|
89
|
+
label: "label"
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Allowed typographical variants for the Text component.
|
|
94
|
+
* @typedef {'h1'|'h2'|'h3'|'h4'|'h5'|'h6'|'body'|'small'|'caption'|'label'} TextVariant
|
|
95
|
+
*/
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Polymorphic HTML element types supported in `as`.
|
|
99
|
+
* @typedef {keyof JSX.IntrinsicElements | React.ComponentType<any>} TextAs
|
|
100
|
+
*/
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Props for the Text component.
|
|
104
|
+
*
|
|
105
|
+
* @typedef {Object} TextProps
|
|
106
|
+
*
|
|
107
|
+
* @property {TextVariant} [variant='body']
|
|
108
|
+
* Controls the typography style.
|
|
109
|
+
*
|
|
110
|
+
* @property {TextAs} [as]
|
|
111
|
+
* Optional override for the underlying HTML element.
|
|
112
|
+
*
|
|
113
|
+
* @property {string} [className]
|
|
114
|
+
* Extra CSS classes.
|
|
115
|
+
*
|
|
116
|
+
* @property {string} [color='text-[--color-text-strong]']
|
|
117
|
+
* Tailwind/text color classes.
|
|
118
|
+
*
|
|
119
|
+
* @property {React.ReactNode} [children]
|
|
120
|
+
* Text content.
|
|
121
|
+
*
|
|
122
|
+
* @property {string} [name]
|
|
123
|
+
* Name used to generate `data-cy`.
|
|
124
|
+
*
|
|
125
|
+
* @property {string} [dataCy]
|
|
126
|
+
* Optional override for auto-generated data-cy attribute.
|
|
127
|
+
*/
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Text component with typography variants and polymorphic rendering.
|
|
131
|
+
*
|
|
132
|
+
* @param {TextProps & React.HTMLAttributes<HTMLElement>} props
|
|
133
|
+
*/
|
|
134
|
+
|
|
135
|
+
function Text(_ref) {
|
|
136
|
+
let {
|
|
137
|
+
variant = "body",
|
|
138
|
+
as,
|
|
139
|
+
className = "",
|
|
140
|
+
color = "text-[--color-text-strong]",
|
|
141
|
+
children,
|
|
142
|
+
name,
|
|
143
|
+
dataCy,
|
|
144
|
+
...rest
|
|
145
|
+
} = _ref;
|
|
146
|
+
const Component = as || elementMap[variant] || "p";
|
|
147
|
+
const variantClass = variantMap[variant] || variantMap.body;
|
|
148
|
+
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Component, {
|
|
149
|
+
className: `${variantClass} ${color} ${className}`,
|
|
150
|
+
"data-cy": (0,_utils_getDataCy__WEBPACK_IMPORTED_MODULE_1__.getDataCy)({
|
|
151
|
+
name,
|
|
152
|
+
dataCy
|
|
153
|
+
}),
|
|
154
|
+
...rest,
|
|
155
|
+
children: children
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/***/ },
|
|
160
|
+
|
|
161
|
+
/***/ 7339
|
|
162
|
+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
163
|
+
|
|
164
|
+
__webpack_require__.r(__webpack_exports__);
|
|
165
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
166
|
+
/* harmony export */ getDataCy: () => (/* binding */ getDataCy)
|
|
167
|
+
/* harmony export */ });
|
|
168
|
+
const getDataCy = function () {
|
|
169
|
+
let {
|
|
170
|
+
name,
|
|
171
|
+
value,
|
|
172
|
+
dataCy
|
|
173
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
174
|
+
if (dataCy) return dataCy;
|
|
175
|
+
if (name && value) return `${name}-${value}`;
|
|
176
|
+
return name || '';
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
/***/ },
|
|
180
|
+
|
|
181
|
+
/***/ 4178
|
|
182
|
+
(module) {
|
|
183
|
+
|
|
184
|
+
module.exports = require("react/jsx-runtime");
|
|
185
|
+
|
|
186
|
+
/***/ },
|
|
187
|
+
|
|
188
|
+
/***/ 9206
|
|
189
|
+
(module) {
|
|
190
|
+
|
|
191
|
+
module.exports = require("react");
|
|
192
|
+
|
|
193
|
+
/***/ }
|
|
194
|
+
|
|
195
|
+
/******/ });
|
|
196
|
+
/************************************************************************/
|
|
197
|
+
/******/ // The module cache
|
|
198
|
+
/******/ var __webpack_module_cache__ = {};
|
|
199
|
+
/******/
|
|
200
|
+
/******/ // The require function
|
|
201
|
+
/******/ function __webpack_require__(moduleId) {
|
|
202
|
+
/******/ // Check if module is in cache
|
|
203
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
204
|
+
/******/ if (cachedModule !== undefined) {
|
|
205
|
+
/******/ return cachedModule.exports;
|
|
206
|
+
/******/ }
|
|
207
|
+
/******/ // Create a new module (and put it into the cache)
|
|
208
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
209
|
+
/******/ // no module.id needed
|
|
210
|
+
/******/ // no module.loaded needed
|
|
211
|
+
/******/ exports: {}
|
|
212
|
+
/******/ };
|
|
213
|
+
/******/
|
|
214
|
+
/******/ // Execute the module function
|
|
215
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
216
|
+
/******/
|
|
217
|
+
/******/ // Return the exports of the module
|
|
218
|
+
/******/ return module.exports;
|
|
219
|
+
/******/ }
|
|
220
|
+
/******/
|
|
221
|
+
/************************************************************************/
|
|
222
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
223
|
+
/******/ (() => {
|
|
224
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
225
|
+
/******/ __webpack_require__.n = (module) => {
|
|
226
|
+
/******/ var getter = module && module.__esModule ?
|
|
227
|
+
/******/ () => (module['default']) :
|
|
228
|
+
/******/ () => (module);
|
|
229
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
230
|
+
/******/ return getter;
|
|
231
|
+
/******/ };
|
|
232
|
+
/******/ })();
|
|
233
|
+
/******/
|
|
234
|
+
/******/ /* webpack/runtime/define property getters */
|
|
235
|
+
/******/ (() => {
|
|
236
|
+
/******/ // define getter functions for harmony exports
|
|
237
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
238
|
+
/******/ for(var key in definition) {
|
|
239
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
240
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
241
|
+
/******/ }
|
|
242
|
+
/******/ }
|
|
243
|
+
/******/ };
|
|
244
|
+
/******/ })();
|
|
245
|
+
/******/
|
|
246
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
247
|
+
/******/ (() => {
|
|
248
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
249
|
+
/******/ })();
|
|
250
|
+
/******/
|
|
251
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
252
|
+
/******/ (() => {
|
|
253
|
+
/******/ // define __esModule on exports
|
|
254
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
255
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
256
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
257
|
+
/******/ }
|
|
258
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
259
|
+
/******/ };
|
|
260
|
+
/******/ })();
|
|
261
|
+
/******/
|
|
262
|
+
/************************************************************************/
|
|
263
|
+
var __webpack_exports__ = {};
|
|
264
|
+
__webpack_require__.r(__webpack_exports__);
|
|
265
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
266
|
+
/* harmony export */ "default": () => (Header_Header)
|
|
267
|
+
/* harmony export */ });
|
|
268
|
+
/* harmony import */ var _BarLayout_BarLayout__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7779);
|
|
269
|
+
/* harmony import */ var _Text_Text__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1111);
|
|
270
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4178);
|
|
271
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__);
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* @typedef {Object} HeaderProps
|
|
277
|
+
* @property {string} title Header title text left slot
|
|
278
|
+
* @property {React.ReactNode} [center] center content slot
|
|
279
|
+
* @property {React.ReactNode} [right] Right content slot
|
|
280
|
+
* @property {string} [className] Optional wrapper class
|
|
281
|
+
*/
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* @param {HeaderProps} props
|
|
285
|
+
*/
|
|
286
|
+
|
|
287
|
+
const Header = _ref => {
|
|
288
|
+
let {
|
|
289
|
+
title,
|
|
290
|
+
center,
|
|
291
|
+
right,
|
|
292
|
+
className = "",
|
|
293
|
+
...rest
|
|
294
|
+
} = _ref;
|
|
295
|
+
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
|
|
296
|
+
className: `w-full px-4 py-2 ${className}`,
|
|
297
|
+
...rest,
|
|
298
|
+
children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_BarLayout_BarLayout__WEBPACK_IMPORTED_MODULE_0__["default"], {
|
|
299
|
+
left: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_Text_Text__WEBPACK_IMPORTED_MODULE_1__["default"], {
|
|
300
|
+
variant: "h3",
|
|
301
|
+
children: title
|
|
302
|
+
}),
|
|
303
|
+
center: center,
|
|
304
|
+
right: right
|
|
305
|
+
})
|
|
306
|
+
});
|
|
307
|
+
};
|
|
308
|
+
/* harmony default export */ const Header_Header = (Header);
|
|
309
|
+
module.exports = __webpack_exports__;
|
|
310
|
+
/******/ })()
|
|
311
|
+
;
|
|
312
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components/Header/index.js","mappings":";;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,MAAMA,SAAS,GAAGC,IAAA,IAA6C;EAAA,IAA5C;IAAEC,IAAI;IAAEC,MAAM;IAAEC,KAAK;IAAEC,SAAS,GAAG;EAAG,CAAC,GAAAJ,IAAA;EACxD,oBACEK,uDAAA;IAAKD,SAAS,EAAE,4CAA4CA,SAAS,EAAG;IAAAE,QAAA,gBACtEC,sDAAA;MAAKH,SAAS,EAAC,QAAQ;MAAAE,QAAA,EAAEL;IAAI,CAAM,CAAC,eACpCM,sDAAA;MAAKH,SAAS,EAAC,uBAAuB;MAAAE,QAAA,EAAEJ;IAAM,CAAM,CAAC,eACrDK,sDAAA;MAAKH,SAAS,EAAC,yBAAyB;MAAAE,QAAA,EAAEH;IAAK,CAAM,CAAC;EAAA,CACnD,CAAC;AAEV,CAAC;AAED,iEAAeJ,SAAS,E;;;;;;;;;;;;;;;;ACtBE;AACwB;AAAA;AAElD,MAAMY,UAAU,GAAG;EACjBC,EAAE,EAAE,kCAAkC;EACtCC,EAAE,EAAE,uBAAuB;EAC3BC,EAAE,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AAE+B;MAAK,CAAO,CAAE;MACxCnC,MAAM,EAAEA,MAAO;MACfC,KAAK,EAAEA;IAAM,CACd;EAAC,CACC,CAAC;AAAA,CACP;AAED,oDAAeiC,MAAM,E","sources":["webpack://opus-toolkit-components/./src/components/BarLayout/BarLayout.jsx","webpack://opus-toolkit-components/./src/components/Text/Text.jsx","webpack://opus-toolkit-components/./src/utils/getDataCy.js","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/Header/Header.jsx"],"sourcesContent":["/**\r\n * @typedef {Object} BarLayoutProps\r\n * @property {React.ReactNode} [left] Left content area\r\n * @property {React.ReactNode} [center] Center content area\r\n * @property {React.ReactNode} [right] Right content area\r\n * @property {string} [className] Optional wrapper class\r\n */\r\n\r\n/**\r\n * @param {BarLayoutProps} props\r\n */\r\n\r\nconst BarLayout = ({ left, center, right, className = \"\" }) => {\r\n return (\r\n <div className={`flex w-full items-center justify-between ${className}`}>\r\n <div className=\"flex-1\">{left}</div>\r\n <div className=\"flex-auto text-center\">{center}</div>\r\n <div className=\"flex flex-1 justify-end\">{right}</div>\r\n </div>\r\n );\r\n};\r\n\r\nexport default BarLayout;\r\n","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(\"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 BarLayout from \"../BarLayout/BarLayout\";\nimport Text from \"../Text/Text\";\n\n/**\n * @typedef {Object} HeaderProps\n * @property {string} title Header title text left slot\n * @property {React.ReactNode} [center] center content slot\n * @property {React.ReactNode} [right] Right content slot\n * @property {string} [className] Optional wrapper class\n */\n\n/**\n * @param {HeaderProps} props\n */\n\nconst Header = ({ title, center, right, className = \"\", ...rest }) => (\n <div className={`w-full px-4 py-2 ${className}`} {...rest}>\n <BarLayout\n left={<Text variant=\"h3\">{title}</Text>}\n center={center}\n right={right}\n />\n </div>\n);\n\nexport default Header;\n"],"names":["BarLayout","_ref","left","center","right","className","_jsxs","children","_jsx","React","getDataCy","jsx","variantMap","h1","h2","h3","h4","h5","h6","body","small","caption","label","elementMap","Text","variant","as","color","name","dataCy","rest","Component","variantClass","value","arguments","length","undefined","Header","title"],"sourceRoot":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { C247IconName } from "./index";
|
|
3
|
+
import type * as HeroIconsModule from "@heroicons/react/24/solid";
|
|
4
|
+
|
|
5
|
+
export type HeroIconName = keyof typeof HeroIconsModule;
|
|
6
|
+
export type IconName = HeroIconName | C247IconName;
|
|
7
|
+
export type IconLibrary = "hero" | "c247";
|
|
8
|
+
|
|
9
|
+
export interface IconProps extends React.SVGProps<SVGSVGElement> {
|
|
10
|
+
/** Icon name. PascalCase HeroIcon name (e.g. "HomeIcon") or C247 name (e.g. "C247Billing"). */
|
|
11
|
+
name: IconName;
|
|
12
|
+
/** Which icon library to resolve from. Defaults to "hero". */
|
|
13
|
+
library?: IconLibrary;
|
|
14
|
+
/** Width and height in px. Defaults to 18. */
|
|
15
|
+
size?: number;
|
|
16
|
+
/** Additional Tailwind classes. */
|
|
17
|
+
className?: string;
|
|
18
|
+
/** CSS color override (sets `color` style). */
|
|
19
|
+
color?: string;
|
|
20
|
+
/** Cypress test selector override. */
|
|
21
|
+
dataCy?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare const Icon: React.FC<IconProps>;
|
|
25
|
+
export default Icon;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Union of valid C247 custom icon names.
|
|
5
|
+
* Used as the `name` prop when `library="c247"`.
|
|
6
|
+
*/
|
|
4
7
|
export type C247IconName =
|
|
5
8
|
| "C247Billing"
|
|
6
9
|
| "C247Dashboard"
|
|
@@ -12,16 +15,16 @@ export type C247IconName =
|
|
|
12
15
|
| "C247Settings"
|
|
13
16
|
| "C247Support"
|
|
14
17
|
| "C247Tasks";
|
|
15
|
-
export type IconName = HeroIconName | C247IconName;
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
export const
|
|
19
|
+
// C247 inline SVG components — internal to the Icon wrapper.
|
|
20
|
+
// Consume via <Icon name="C247Billing" library="c247" /> not via direct import.
|
|
21
|
+
export declare const C247Billing: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
22
|
+
export declare const C247Dashboard: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
23
|
+
export declare const C247Deployment: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
24
|
+
export declare const C247Form: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
25
|
+
export declare const C247Planner: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
26
|
+
export declare const C247Reports: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
27
|
+
export declare const C247Screening: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
28
|
+
export declare const C247Settings: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
29
|
+
export declare const C247Support: React.FC<React.SVGProps<SVGSVGElement>>;
|
|
30
|
+
export declare const C247Tasks: React.FC<React.SVGProps<SVGSVGElement>>;
|