opus-toolkit-components 1.7.6 → 1.7.9
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/Accordions/index.d.ts +19 -0
- package/lib/components/BarLayout/index.d.ts +8 -0
- package/lib/components/Buttons/index.d.ts +36 -0
- package/lib/components/Cards/index.d.ts +16 -0
- package/lib/components/Cookie/index.d.ts +11 -0
- package/lib/components/Footer/index.d.ts +8 -0
- package/lib/components/Forms/Checkbox/index.d.ts +20 -0
- package/lib/components/Forms/Datepickers/index.d.ts +23 -0
- package/lib/components/Forms/Dropdowns/index.d.ts +35 -0
- package/lib/components/Forms/Inputs/index.d.ts +45 -0
- package/lib/components/Forms/Radios/index.d.ts +29 -0
- package/lib/components/Header/index.d.ts +8 -0
- package/lib/components/Icon/index.d.ts +15 -0
- package/lib/components/IconButton/index.d.ts +22 -0
- package/lib/components/Link/index.js +131 -0
- package/lib/components/Link/index.js.map +1 -0
- package/lib/components/Loader/index.d.ts +8 -0
- package/lib/components/Modals/index.d.ts +16 -0
- package/lib/components/Navbar/index.d.ts +8 -0
- package/lib/components/PageTemplate/index.d.ts +12 -0
- package/lib/components/Pills/index.d.ts +8 -0
- package/lib/components/Profile/ProfileCard/index.d.ts +11 -0
- package/lib/components/Sidebar/index.d.ts +48 -0
- package/lib/components/Tables/index.d.ts +18 -0
- package/lib/components/Text/index.d.ts +25 -0
- package/lib/index.d.ts +23 -464
- package/lib/{opus-components.main.js → main.js} +222 -85
- package/lib/main.js.map +1 -0
- package/package.json +36 -32
- package/lib/opus-components.main.js.map +0 -1
|
@@ -3655,16 +3655,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3655
3655
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(94178);
|
|
3656
3656
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
|
|
3657
3657
|
|
|
3658
|
-
/**
|
|
3659
|
-
* @typedef {Object} BarLayoutProps
|
|
3660
|
-
* @property {React.ReactNode} [left] Left content area
|
|
3661
|
-
* @property {React.ReactNode} [center] Center content area
|
|
3662
|
-
* @property {React.ReactNode} [right] Right content area
|
|
3663
|
-
* @property {string} [className] Optional wrapper class
|
|
3658
|
+
/**
|
|
3659
|
+
* @typedef {Object} BarLayoutProps
|
|
3660
|
+
* @property {React.ReactNode} [left] Left content area
|
|
3661
|
+
* @property {React.ReactNode} [center] Center content area
|
|
3662
|
+
* @property {React.ReactNode} [right] Right content area
|
|
3663
|
+
* @property {string} [className] Optional wrapper class
|
|
3664
3664
|
*/
|
|
3665
3665
|
|
|
3666
|
-
/**
|
|
3667
|
-
* @param {BarLayoutProps} props
|
|
3666
|
+
/**
|
|
3667
|
+
* @param {BarLayoutProps} props
|
|
3668
3668
|
*/
|
|
3669
3669
|
|
|
3670
3670
|
const BarLayout = _ref => {
|
|
@@ -22489,7 +22489,11 @@ class Virtualizer {
|
|
|
22489
22489
|
this.isScrolling = false;
|
|
22490
22490
|
this.measurementsCache = [];
|
|
22491
22491
|
this.itemSizeCache = /* @__PURE__ */ new Map();
|
|
22492
|
+
this.laneAssignments = /* @__PURE__ */ new Map();
|
|
22492
22493
|
this.pendingMeasuredCacheIndexes = [];
|
|
22494
|
+
this.prevLanes = void 0;
|
|
22495
|
+
this.lanesChangedFlag = false;
|
|
22496
|
+
this.lanesSettling = false;
|
|
22493
22497
|
this.scrollRect = null;
|
|
22494
22498
|
this.scrollOffset = null;
|
|
22495
22499
|
this.scrollDirection = null;
|
|
@@ -22688,47 +22692,99 @@ class Virtualizer {
|
|
|
22688
22692
|
this.options.paddingStart,
|
|
22689
22693
|
this.options.scrollMargin,
|
|
22690
22694
|
this.options.getItemKey,
|
|
22691
|
-
this.options.enabled
|
|
22695
|
+
this.options.enabled,
|
|
22696
|
+
this.options.lanes
|
|
22692
22697
|
],
|
|
22693
|
-
(count, paddingStart, scrollMargin, getItemKey, enabled) => {
|
|
22698
|
+
(count, paddingStart, scrollMargin, getItemKey, enabled, lanes) => {
|
|
22699
|
+
const lanesChanged = this.prevLanes !== void 0 && this.prevLanes !== lanes;
|
|
22700
|
+
if (lanesChanged) {
|
|
22701
|
+
this.lanesChangedFlag = true;
|
|
22702
|
+
}
|
|
22703
|
+
this.prevLanes = lanes;
|
|
22694
22704
|
this.pendingMeasuredCacheIndexes = [];
|
|
22695
22705
|
return {
|
|
22696
22706
|
count,
|
|
22697
22707
|
paddingStart,
|
|
22698
22708
|
scrollMargin,
|
|
22699
22709
|
getItemKey,
|
|
22700
|
-
enabled
|
|
22710
|
+
enabled,
|
|
22711
|
+
lanes
|
|
22701
22712
|
};
|
|
22702
22713
|
},
|
|
22703
22714
|
{
|
|
22704
|
-
key: false
|
|
22715
|
+
key: false,
|
|
22716
|
+
skipInitialOnChange: true,
|
|
22717
|
+
onChange: () => {
|
|
22718
|
+
this.notify(this.isScrolling);
|
|
22719
|
+
}
|
|
22705
22720
|
}
|
|
22706
22721
|
);
|
|
22707
22722
|
this.getMeasurements = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.memo)(
|
|
22708
22723
|
() => [this.getMeasurementOptions(), this.itemSizeCache],
|
|
22709
|
-
({ count, paddingStart, scrollMargin, getItemKey, enabled }, itemSizeCache) => {
|
|
22724
|
+
({ count, paddingStart, scrollMargin, getItemKey, enabled, lanes }, itemSizeCache) => {
|
|
22710
22725
|
if (!enabled) {
|
|
22711
22726
|
this.measurementsCache = [];
|
|
22712
22727
|
this.itemSizeCache.clear();
|
|
22728
|
+
this.laneAssignments.clear();
|
|
22713
22729
|
return [];
|
|
22714
22730
|
}
|
|
22731
|
+
if (this.laneAssignments.size > count) {
|
|
22732
|
+
for (const index of this.laneAssignments.keys()) {
|
|
22733
|
+
if (index >= count) {
|
|
22734
|
+
this.laneAssignments.delete(index);
|
|
22735
|
+
}
|
|
22736
|
+
}
|
|
22737
|
+
}
|
|
22738
|
+
if (this.lanesChangedFlag) {
|
|
22739
|
+
this.lanesChangedFlag = false;
|
|
22740
|
+
this.lanesSettling = true;
|
|
22741
|
+
this.measurementsCache = [];
|
|
22742
|
+
this.itemSizeCache.clear();
|
|
22743
|
+
this.laneAssignments.clear();
|
|
22744
|
+
this.pendingMeasuredCacheIndexes = [];
|
|
22745
|
+
}
|
|
22715
22746
|
if (this.measurementsCache.length === 0) {
|
|
22716
22747
|
this.measurementsCache = this.options.initialMeasurementsCache;
|
|
22717
22748
|
this.measurementsCache.forEach((item) => {
|
|
22718
22749
|
this.itemSizeCache.set(item.key, item.size);
|
|
22719
22750
|
});
|
|
22720
22751
|
}
|
|
22721
|
-
const min = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
22752
|
+
const min = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
22722
22753
|
this.pendingMeasuredCacheIndexes = [];
|
|
22754
|
+
if (this.lanesSettling && this.measurementsCache.length === count) {
|
|
22755
|
+
this.lanesSettling = false;
|
|
22756
|
+
}
|
|
22723
22757
|
const measurements = this.measurementsCache.slice(0, min);
|
|
22758
|
+
const laneLastIndex = new Array(lanes).fill(
|
|
22759
|
+
void 0
|
|
22760
|
+
);
|
|
22761
|
+
for (let m = 0; m < min; m++) {
|
|
22762
|
+
const item = measurements[m];
|
|
22763
|
+
if (item) {
|
|
22764
|
+
laneLastIndex[item.lane] = m;
|
|
22765
|
+
}
|
|
22766
|
+
}
|
|
22724
22767
|
for (let i = min; i < count; i++) {
|
|
22725
22768
|
const key = getItemKey(i);
|
|
22726
|
-
const
|
|
22727
|
-
|
|
22769
|
+
const cachedLane = this.laneAssignments.get(i);
|
|
22770
|
+
let lane;
|
|
22771
|
+
let start;
|
|
22772
|
+
if (cachedLane !== void 0 && this.options.lanes > 1) {
|
|
22773
|
+
lane = cachedLane;
|
|
22774
|
+
const prevIndex = laneLastIndex[lane];
|
|
22775
|
+
const prevInLane = prevIndex !== void 0 ? measurements[prevIndex] : void 0;
|
|
22776
|
+
start = prevInLane ? prevInLane.end + this.options.gap : paddingStart + scrollMargin;
|
|
22777
|
+
} else {
|
|
22778
|
+
const furthestMeasurement = this.options.lanes === 1 ? measurements[i - 1] : this.getFurthestMeasurement(measurements, i);
|
|
22779
|
+
start = furthestMeasurement ? furthestMeasurement.end + this.options.gap : paddingStart + scrollMargin;
|
|
22780
|
+
lane = furthestMeasurement ? furthestMeasurement.lane : i % this.options.lanes;
|
|
22781
|
+
if (this.options.lanes > 1) {
|
|
22782
|
+
this.laneAssignments.set(i, lane);
|
|
22783
|
+
}
|
|
22784
|
+
}
|
|
22728
22785
|
const measuredSize = itemSizeCache.get(key);
|
|
22729
22786
|
const size = typeof measuredSize === "number" ? measuredSize : this.options.estimateSize(i);
|
|
22730
22787
|
const end = start + size;
|
|
22731
|
-
const lane = furthestMeasurement ? furthestMeasurement.lane : i % this.options.lanes;
|
|
22732
22788
|
measurements[i] = {
|
|
22733
22789
|
index: i,
|
|
22734
22790
|
start,
|
|
@@ -22737,6 +22793,7 @@ class Virtualizer {
|
|
|
22737
22793
|
key,
|
|
22738
22794
|
lane
|
|
22739
22795
|
};
|
|
22796
|
+
laneLastIndex[lane] = i;
|
|
22740
22797
|
}
|
|
22741
22798
|
this.measurementsCache = measurements;
|
|
22742
22799
|
return measurements;
|
|
@@ -23028,6 +23085,7 @@ class Virtualizer {
|
|
|
23028
23085
|
};
|
|
23029
23086
|
this.measure = () => {
|
|
23030
23087
|
this.itemSizeCache = /* @__PURE__ */ new Map();
|
|
23088
|
+
this.laneAssignments = /* @__PURE__ */ new Map();
|
|
23031
23089
|
this.notify(false);
|
|
23032
23090
|
};
|
|
23033
23091
|
this.setOptions(opts);
|
|
@@ -23359,6 +23417,78 @@ function $bdb11010cef70236$export$b4cc09c592e8fdb8(depArray = []) {
|
|
|
23359
23417
|
//# sourceMappingURL=useId.module.js.map
|
|
23360
23418
|
|
|
23361
23419
|
|
|
23420
|
+
/***/ }),
|
|
23421
|
+
|
|
23422
|
+
/***/ 43155:
|
|
23423
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
23424
|
+
|
|
23425
|
+
__webpack_require__.r(__webpack_exports__);
|
|
23426
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
23427
|
+
/* harmony export */ "default": () => (/* binding */ IconButton)
|
|
23428
|
+
/* harmony export */ });
|
|
23429
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9206);
|
|
23430
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
23431
|
+
/* harmony import */ var _utils_getDataCy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(67339);
|
|
23432
|
+
/* harmony import */ var _Icon_Icon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(57739);
|
|
23433
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(94178);
|
|
23434
|
+
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__);
|
|
23435
|
+
const _excluded = ["rank", "size", "title", "iconName", "iconLibrary", "isFullWidth", "className", "name", "dataCy"];
|
|
23436
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
23437
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
23438
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
23439
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
23440
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
23441
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
23442
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
23443
|
+
|
|
23444
|
+
|
|
23445
|
+
|
|
23446
|
+
|
|
23447
|
+
const rankStyles = {
|
|
23448
|
+
primary: "bg-[--color-primary-btn] hover:bg-[--color-primary-btn-hover] text-[--color-primary-btn-txt] border-2 border-[--color-primary-btn] hover:border-[--color-primary-btn-hover] rounded-full",
|
|
23449
|
+
secondary: "bg-[--color-brand-secondary] text-[--color-white] border-2 border-[--color-stroke] hover:bg-[--color-primary-btn-hover] hover:border-[--color-primary-btn-hover] rounded-full",
|
|
23450
|
+
outline: "bg-[--color-input-bg] border-2 border-[--color-stroke] hover:border-[--color-text-strong] text-[--color-text-strong] rounded-full",
|
|
23451
|
+
destructive: "bg-[--color-destructive-btn] hover:bg-[--color-destructive-btn-hover] text-[--color-destructive-btn-txt] border-2 border-[--color-destructive-btn] hover:border-[--color-destructive-btn-hover] rounded-full"
|
|
23452
|
+
};
|
|
23453
|
+
|
|
23454
|
+
// Map button size to icon size in pixels
|
|
23455
|
+
const iconSizes = {
|
|
23456
|
+
sm: 16,
|
|
23457
|
+
md: 20,
|
|
23458
|
+
lg: 24
|
|
23459
|
+
};
|
|
23460
|
+
const DEFAULT_ICON = "PlusIcon";
|
|
23461
|
+
function IconButton(_ref) {
|
|
23462
|
+
let {
|
|
23463
|
+
rank = "primary",
|
|
23464
|
+
size = "md",
|
|
23465
|
+
title = "Icon Button",
|
|
23466
|
+
iconName = DEFAULT_ICON,
|
|
23467
|
+
iconLibrary = "hero",
|
|
23468
|
+
// 'hero' or 'c247'
|
|
23469
|
+
isFullWidth = false,
|
|
23470
|
+
className = "",
|
|
23471
|
+
name,
|
|
23472
|
+
dataCy
|
|
23473
|
+
} = _ref,
|
|
23474
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
23475
|
+
const classNames = "\n ".concat(rankStyles[rank] || rankStyles.primary, "\n flex\n items-center\n justify-center\n p-3\n transition\n ease-in-out\n duration-700\n hover:shadow-lg\n ").concat(isFullWidth ? "w-full" : "", "\n ").concat(className, "\n ");
|
|
23476
|
+
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("button", _objectSpread(_objectSpread(_objectSpread({
|
|
23477
|
+
title: title,
|
|
23478
|
+
name: name,
|
|
23479
|
+
className: classNames
|
|
23480
|
+
}, rest), (0,_utils_getDataCy__WEBPACK_IMPORTED_MODULE_1__.getDataCy)({
|
|
23481
|
+
name,
|
|
23482
|
+
dataCy
|
|
23483
|
+
})), {}, {
|
|
23484
|
+
children: iconName && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_Icon_Icon__WEBPACK_IMPORTED_MODULE_2__["default"], {
|
|
23485
|
+
name: iconName,
|
|
23486
|
+
library: iconLibrary,
|
|
23487
|
+
size: iconSizes[size] || iconSizes.md
|
|
23488
|
+
})
|
|
23489
|
+
}));
|
|
23490
|
+
}
|
|
23491
|
+
|
|
23362
23492
|
/***/ }),
|
|
23363
23493
|
|
|
23364
23494
|
/***/ 43199:
|
|
@@ -48699,80 +48829,80 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
48699
48829
|
// Import a spinner icon
|
|
48700
48830
|
|
|
48701
48831
|
|
|
48702
|
-
/**
|
|
48703
|
-
* @typedef {'primary'|'secondary'|'tertiary'|'outline'|'destructive'} ButtonRank
|
|
48832
|
+
/**
|
|
48833
|
+
* @typedef {'primary'|'secondary'|'tertiary'|'outline'|'destructive'} ButtonRank
|
|
48704
48834
|
*/
|
|
48705
48835
|
|
|
48706
|
-
/**
|
|
48707
|
-
* @typedef {'default'|'disabled'} ButtonState
|
|
48836
|
+
/**
|
|
48837
|
+
* @typedef {'default'|'disabled'} ButtonState
|
|
48708
48838
|
*/
|
|
48709
48839
|
|
|
48710
|
-
/**
|
|
48711
|
-
* @typedef {'sm'|'md'|'lg'|'xl'|string} ButtonSize
|
|
48712
|
-
* (Supports custom tailwind text sizes too)
|
|
48840
|
+
/**
|
|
48841
|
+
* @typedef {'sm'|'md'|'lg'|'xl'|string} ButtonSize
|
|
48842
|
+
* (Supports custom tailwind text sizes too)
|
|
48713
48843
|
*/
|
|
48714
48844
|
|
|
48715
|
-
/**
|
|
48716
|
-
* Icon component type from react-icons or your own components
|
|
48717
|
-
* @typedef {(props: React.SVGProps<SVGSVGElement>) => JSX.Element} IconComponent
|
|
48845
|
+
/**
|
|
48846
|
+
* Icon component type from react-icons or your own components
|
|
48847
|
+
* @typedef {(props: React.SVGProps<SVGSVGElement>) => JSX.Element} IconComponent
|
|
48718
48848
|
*/
|
|
48719
48849
|
|
|
48720
|
-
/**
|
|
48721
|
-
* @typedef {Object} ButtonProps
|
|
48722
|
-
*
|
|
48723
|
-
* @property {'button'|'submit'|'reset'} [type]
|
|
48724
|
-
* Native button type.
|
|
48725
|
-
*
|
|
48726
|
-
* @property {ButtonRank} [rank]
|
|
48727
|
-
* Visual rank: primary, secondary, etc.
|
|
48728
|
-
*
|
|
48729
|
-
* @property {ButtonState} [state]
|
|
48730
|
-
* Current state (default, disabled).
|
|
48731
|
-
*
|
|
48732
|
-
* @property {string} [text]
|
|
48733
|
-
* Text shown inside the button (ignored when isSaving is true).
|
|
48734
|
-
*
|
|
48735
|
-
* @property {ButtonSize} [size]
|
|
48736
|
-
* Tailwind text size (sm, md, lg, xl).
|
|
48737
|
-
*
|
|
48738
|
-
* @property {string} [name]
|
|
48739
|
-
* Standard HTML name attribute + for data-cy.
|
|
48740
|
-
*
|
|
48741
|
-
* @property {string} [dataCy]
|
|
48742
|
-
* Override for auto-generated test selector.
|
|
48743
|
-
*
|
|
48744
|
-
* @property {number} [tabIndex]
|
|
48745
|
-
*
|
|
48746
|
-
* @property {boolean} [isFullWidth]
|
|
48747
|
-
* Expand to full container width.
|
|
48748
|
-
*
|
|
48749
|
-
* @property {IconComponent} [icon]
|
|
48750
|
-
* Optional icon component (left or right).
|
|
48751
|
-
*
|
|
48752
|
-
* @property {'left'|'right'} [iconPosition]
|
|
48753
|
-
* Position of icon.
|
|
48754
|
-
*
|
|
48755
|
-
* @property {boolean} [isIconAnimated]
|
|
48756
|
-
* Enables subtle translate animation on hover.
|
|
48757
|
-
*
|
|
48758
|
-
* @property {boolean} [isSaving]
|
|
48759
|
-
* Shows a spinner and disables all interaction.
|
|
48760
|
-
*
|
|
48761
|
-
* @property {string} [savingText]
|
|
48762
|
-
* Text shown when isSaving = true.
|
|
48763
|
-
*
|
|
48764
|
-
* @property {string} [className]
|
|
48765
|
-
* Extra custom classes.
|
|
48766
|
-
*
|
|
48767
|
-
* @property {string} [title]
|
|
48768
|
-
* Adds accessible label / tooltip.
|
|
48769
|
-
*
|
|
48770
|
-
* @property {(event: React.MouseEvent<HTMLButtonElement>) => void} [onClick]
|
|
48771
|
-
* Click handler. Not called during saving or disabled state.
|
|
48850
|
+
/**
|
|
48851
|
+
* @typedef {Object} ButtonProps
|
|
48852
|
+
*
|
|
48853
|
+
* @property {'button'|'submit'|'reset'} [type]
|
|
48854
|
+
* Native button type.
|
|
48855
|
+
*
|
|
48856
|
+
* @property {ButtonRank} [rank]
|
|
48857
|
+
* Visual rank: primary, secondary, etc.
|
|
48858
|
+
*
|
|
48859
|
+
* @property {ButtonState} [state]
|
|
48860
|
+
* Current state (default, disabled).
|
|
48861
|
+
*
|
|
48862
|
+
* @property {string} [text]
|
|
48863
|
+
* Text shown inside the button (ignored when isSaving is true).
|
|
48864
|
+
*
|
|
48865
|
+
* @property {ButtonSize} [size]
|
|
48866
|
+
* Tailwind text size (sm, md, lg, xl).
|
|
48867
|
+
*
|
|
48868
|
+
* @property {string} [name]
|
|
48869
|
+
* Standard HTML name attribute + for data-cy.
|
|
48870
|
+
*
|
|
48871
|
+
* @property {string} [dataCy]
|
|
48872
|
+
* Override for auto-generated test selector.
|
|
48873
|
+
*
|
|
48874
|
+
* @property {number} [tabIndex]
|
|
48875
|
+
*
|
|
48876
|
+
* @property {boolean} [isFullWidth]
|
|
48877
|
+
* Expand to full container width.
|
|
48878
|
+
*
|
|
48879
|
+
* @property {IconComponent} [icon]
|
|
48880
|
+
* Optional icon component (left or right).
|
|
48881
|
+
*
|
|
48882
|
+
* @property {'left'|'right'} [iconPosition]
|
|
48883
|
+
* Position of icon.
|
|
48884
|
+
*
|
|
48885
|
+
* @property {boolean} [isIconAnimated]
|
|
48886
|
+
* Enables subtle translate animation on hover.
|
|
48887
|
+
*
|
|
48888
|
+
* @property {boolean} [isSaving]
|
|
48889
|
+
* Shows a spinner and disables all interaction.
|
|
48890
|
+
*
|
|
48891
|
+
* @property {string} [savingText]
|
|
48892
|
+
* Text shown when isSaving = true.
|
|
48893
|
+
*
|
|
48894
|
+
* @property {string} [className]
|
|
48895
|
+
* Extra custom classes.
|
|
48896
|
+
*
|
|
48897
|
+
* @property {string} [title]
|
|
48898
|
+
* Adds accessible label / tooltip.
|
|
48899
|
+
*
|
|
48900
|
+
* @property {(event: React.MouseEvent<HTMLButtonElement>) => void} [onClick]
|
|
48901
|
+
* Click handler. Not called during saving or disabled state.
|
|
48772
48902
|
*/
|
|
48773
48903
|
|
|
48774
|
-
/**
|
|
48775
|
-
* @param {ButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement>} props
|
|
48904
|
+
/**
|
|
48905
|
+
* @param {ButtonProps & React.ButtonHTMLAttributes<HTMLButtonElement>} props
|
|
48776
48906
|
*/
|
|
48777
48907
|
|
|
48778
48908
|
function Button(_ref) {
|
|
@@ -48804,7 +48934,7 @@ function Button(_ref) {
|
|
|
48804
48934
|
// Define styles for button ranks
|
|
48805
48935
|
const rankStyles = {
|
|
48806
48936
|
primary: "bg-[--color-primary-btn] hover:bg-[--color-primary-btn-hover] text-[--color-primary-btn-txt] border-solid border-2 border-[--color-primary-btn] hover:border-[--color-primary-btn-hover]",
|
|
48807
|
-
secondary: "
|
|
48937
|
+
secondary: "border-2 border-2 bg-[--color-secondary-btn] border-[--color-stroke] hover:bg-[--color-primary-btn-hover] text-[--color-white]",
|
|
48808
48938
|
tertiary: "bg-transparent underline text-[--color-text-strong]",
|
|
48809
48939
|
outline: "bg-[--color-input-bg] border-solid border-2 border-[--color-outline-btn] hover:border-[--color-outline-btn-hover] text-[--color-text-strong]",
|
|
48810
48940
|
destructive: "bg-[--color-destructive-btn] hover:bg-[--color-destructive-btn-hover] text-[--color-destructive-btn-txt] border-solid border-2 border-[--color-destructive-btn] hover:border-[--color-destructive-btn-hover]"
|
|
@@ -52068,8 +52198,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
52068
52198
|
function memo(getDeps, fn, opts) {
|
|
52069
52199
|
let deps = opts.initialDeps ?? [];
|
|
52070
52200
|
let result;
|
|
52201
|
+
let isInitial = true;
|
|
52071
52202
|
function memoizedFunction() {
|
|
52072
|
-
var _a, _b, _c
|
|
52203
|
+
var _a, _b, _c;
|
|
52073
52204
|
let depTime;
|
|
52074
52205
|
if (opts.key && ((_a = opts.debug) == null ? void 0 : _a.call(opts))) depTime = Date.now();
|
|
52075
52206
|
const newDeps = getDeps();
|
|
@@ -52104,7 +52235,10 @@ function memo(getDeps, fn, opts) {
|
|
|
52104
52235
|
opts == null ? void 0 : opts.key
|
|
52105
52236
|
);
|
|
52106
52237
|
}
|
|
52107
|
-
(
|
|
52238
|
+
if ((opts == null ? void 0 : opts.onChange) && !(isInitial && opts.skipInitialOnChange)) {
|
|
52239
|
+
opts.onChange(result);
|
|
52240
|
+
}
|
|
52241
|
+
isInitial = false;
|
|
52108
52242
|
return result;
|
|
52109
52243
|
}
|
|
52110
52244
|
memoizedFunction.updateDeps = (newDeps) => {
|
|
@@ -63650,6 +63784,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
63650
63784
|
/* harmony export */ Footer: () => (/* reexport safe */ _components_Footer_Footer__WEBPACK_IMPORTED_MODULE_18__["default"]),
|
|
63651
63785
|
/* harmony export */ Header: () => (/* reexport safe */ _components_Header_Header__WEBPACK_IMPORTED_MODULE_16__["default"]),
|
|
63652
63786
|
/* harmony export */ Icon: () => (/* reexport safe */ _components_Icon_Icon__WEBPACK_IMPORTED_MODULE_17__["default"]),
|
|
63787
|
+
/* harmony export */ IconButton: () => (/* reexport safe */ _components_IconButton_IconButton__WEBPACK_IMPORTED_MODULE_22__["default"]),
|
|
63653
63788
|
/* harmony export */ Input: () => (/* reexport safe */ _components_Forms_Inputs_Input__WEBPACK_IMPORTED_MODULE_3__["default"]),
|
|
63654
63789
|
/* harmony export */ Loader: () => (/* reexport safe */ _components_Loader_Loader__WEBPACK_IMPORTED_MODULE_11__["default"]),
|
|
63655
63790
|
/* harmony export */ Modal: () => (/* reexport safe */ _components_Modals_Modal__WEBPACK_IMPORTED_MODULE_10__["default"]),
|
|
@@ -63684,6 +63819,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
63684
63819
|
/* harmony import */ var _components_PageTemplate_PageTemplate__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(3179);
|
|
63685
63820
|
/* harmony import */ var _components_BarLayout_BarLayout__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(7779);
|
|
63686
63821
|
/* harmony import */ var _components_Profile_ProfileCard_ProfileCard__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(64977);
|
|
63822
|
+
/* harmony import */ var _components_IconButton_IconButton__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(43155);
|
|
63823
|
+
|
|
63687
63824
|
|
|
63688
63825
|
|
|
63689
63826
|
|
|
@@ -63709,4 +63846,4 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
63709
63846
|
module.exports = __webpack_exports__;
|
|
63710
63847
|
/******/ })()
|
|
63711
63848
|
;
|
|
63712
|
-
//# sourceMappingURL=
|
|
63849
|
+
//# sourceMappingURL=main.js.map
|