elseware-ui 2.40.4 → 3.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/README.md +289 -289
- package/dist/index.css +484 -310
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +101 -293
- package/dist/index.d.ts +101 -293
- package/dist/index.js +1294 -752
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +986 -449
- package/dist/index.mjs.map +1 -1
- package/dist/index.native.d.mts +16 -0
- package/dist/index.native.d.ts +16 -0
- package/dist/index.native.js +913 -0
- package/dist/index.native.js.map +1 -0
- package/dist/index.native.mjs +904 -0
- package/dist/index.native.mjs.map +1 -0
- package/dist/resolveGlobalConfigs-Cuiq_Zix.d.mts +288 -0
- package/dist/resolveGlobalConfigs-Cuiq_Zix.d.ts +288 -0
- package/package.json +173 -143
- package/tailwind.preset.js +116 -0
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React26 = require('react');
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
var tailwindMerge = require('tailwind-merge');
|
|
6
6
|
var index_js$1 = require('react-icons/ai/index.js');
|
|
7
7
|
var formik = require('formik');
|
|
8
|
-
var classNames77 = require('classnames');
|
|
9
8
|
var index_js$2 = require('react-icons/fa/index.js');
|
|
9
|
+
var classNames74 = require('classnames');
|
|
10
10
|
var reactBeautifulDnd = require('react-beautiful-dnd');
|
|
11
11
|
var cloudinaryReact = require('cloudinary-react');
|
|
12
12
|
var index_js = require('react-icons/md/index.js');
|
|
@@ -26,8 +26,8 @@ require('@mdxeditor/editor/style.css');
|
|
|
26
26
|
|
|
27
27
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
28
28
|
|
|
29
|
-
var
|
|
30
|
-
var
|
|
29
|
+
var React26__default = /*#__PURE__*/_interopDefault(React26);
|
|
30
|
+
var classNames74__default = /*#__PURE__*/_interopDefault(classNames74);
|
|
31
31
|
var ReactWorldFlags__default = /*#__PURE__*/_interopDefault(ReactWorldFlags);
|
|
32
32
|
var emojiFlags__default = /*#__PURE__*/_interopDefault(emojiFlags);
|
|
33
33
|
var CodeMirror__default = /*#__PURE__*/_interopDefault(CodeMirror);
|
|
@@ -4728,7 +4728,7 @@ var init_python = __esm({
|
|
|
4728
4728
|
});
|
|
4729
4729
|
|
|
4730
4730
|
// node_modules/refractor/lang/jsx.js
|
|
4731
|
-
function
|
|
4731
|
+
function jsx218(Prism2) {
|
|
4732
4732
|
Prism2.register(javascript);
|
|
4733
4733
|
Prism2.register(markup);
|
|
4734
4734
|
(function(Prism3) {
|
|
@@ -4861,14 +4861,14 @@ var init_jsx = __esm({
|
|
|
4861
4861
|
"node_modules/refractor/lang/jsx.js"() {
|
|
4862
4862
|
init_javascript();
|
|
4863
4863
|
init_markup();
|
|
4864
|
-
|
|
4865
|
-
|
|
4864
|
+
jsx218.displayName = "jsx";
|
|
4865
|
+
jsx218.aliases = [];
|
|
4866
4866
|
}
|
|
4867
4867
|
});
|
|
4868
4868
|
|
|
4869
4869
|
// node_modules/refractor/lang/tsx.js
|
|
4870
4870
|
function tsx(Prism2) {
|
|
4871
|
-
Prism2.register(
|
|
4871
|
+
Prism2.register(jsx218);
|
|
4872
4872
|
Prism2.register(typescript);
|
|
4873
4873
|
(function(Prism3) {
|
|
4874
4874
|
var typescript2 = Prism3.util.clone(Prism3.languages.typescript);
|
|
@@ -5030,7 +5030,7 @@ var EUI_ANALYTICS_QUEUE_STORAGE_KEY = "eui.analytics.queue";
|
|
|
5030
5030
|
var DEFAULT_ANALYTICS_CONFIG = {
|
|
5031
5031
|
enabled: true,
|
|
5032
5032
|
trackPageViews: true,
|
|
5033
|
-
trackSession:
|
|
5033
|
+
trackSession: true,
|
|
5034
5034
|
flushIntervalMs: 1e4,
|
|
5035
5035
|
maxBatchSize: 20,
|
|
5036
5036
|
respectDoNotTrack: true,
|
|
@@ -5072,7 +5072,7 @@ var createDefaultConsent = (version) => ({
|
|
|
5072
5072
|
marketing: false
|
|
5073
5073
|
}
|
|
5074
5074
|
});
|
|
5075
|
-
var AnalyticsContext =
|
|
5075
|
+
var AnalyticsContext = React26.createContext(
|
|
5076
5076
|
null
|
|
5077
5077
|
);
|
|
5078
5078
|
|
|
@@ -5110,10 +5110,18 @@ var getCurrentPath = () => {
|
|
|
5110
5110
|
if (!isBrowser()) return void 0;
|
|
5111
5111
|
return `${window.location.pathname}${window.location.search}`;
|
|
5112
5112
|
};
|
|
5113
|
+
var getCurrentFullUrl = () => {
|
|
5114
|
+
if (!isBrowser()) return void 0;
|
|
5115
|
+
return window.location.href;
|
|
5116
|
+
};
|
|
5113
5117
|
var getCurrentReferrer = () => {
|
|
5114
5118
|
if (!isBrowser()) return void 0;
|
|
5115
5119
|
return document.referrer || void 0;
|
|
5116
5120
|
};
|
|
5121
|
+
var getCurrentTitle = () => {
|
|
5122
|
+
if (!isBrowser()) return void 0;
|
|
5123
|
+
return document.title || void 0;
|
|
5124
|
+
};
|
|
5117
5125
|
var getConsentStatusFromCategories = (categories) => {
|
|
5118
5126
|
const optionalCategories = Object.entries(categories).filter(
|
|
5119
5127
|
([key]) => key !== "necessary"
|
|
@@ -5135,12 +5143,19 @@ var createAnalyticsEvent = ({
|
|
|
5135
5143
|
type: type2,
|
|
5136
5144
|
appId,
|
|
5137
5145
|
sessionId,
|
|
5138
|
-
anonymousId
|
|
5139
|
-
userId
|
|
5140
|
-
path:
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
|
|
5146
|
+
anonymousId,
|
|
5147
|
+
userId,
|
|
5148
|
+
path: getCurrentPath(),
|
|
5149
|
+
fullUrl: getCurrentFullUrl(),
|
|
5150
|
+
referrer: getCurrentReferrer(),
|
|
5151
|
+
title: getCurrentTitle(),
|
|
5152
|
+
timestamp: getNowISOString(),
|
|
5153
|
+
viewport: getViewport(),
|
|
5154
|
+
device: getDeviceInfo(),
|
|
5155
|
+
...options,
|
|
5156
|
+
metadata: {
|
|
5157
|
+
...options?.metadata
|
|
5158
|
+
}
|
|
5144
5159
|
});
|
|
5145
5160
|
|
|
5146
5161
|
// src/components/analytics/analytics.storage.ts
|
|
@@ -5218,11 +5233,11 @@ var AnalyticsProvider = ({
|
|
|
5218
5233
|
...DEFAULT_ANALYTICS_CONFIG,
|
|
5219
5234
|
...config
|
|
5220
5235
|
};
|
|
5221
|
-
const defaultConsent =
|
|
5236
|
+
const defaultConsent = React26.useMemo(
|
|
5222
5237
|
() => createDefaultConsent(consentVersion),
|
|
5223
5238
|
[consentVersion]
|
|
5224
5239
|
);
|
|
5225
|
-
const [consent, setConsent] =
|
|
5240
|
+
const [consent, setConsent] = React26.useState(() => {
|
|
5226
5241
|
const storedConsent = readConsentStorage(
|
|
5227
5242
|
resolvedConfig.storageKey,
|
|
5228
5243
|
defaultConsent
|
|
@@ -5232,17 +5247,17 @@ var AnalyticsProvider = ({
|
|
|
5232
5247
|
}
|
|
5233
5248
|
return storedConsent;
|
|
5234
5249
|
});
|
|
5235
|
-
const [anonymousId, setAnonymousId] =
|
|
5250
|
+
const [anonymousId, setAnonymousId] = React26.useState(() => {
|
|
5236
5251
|
if (!consent.categories.analytics) return null;
|
|
5237
5252
|
return ensureAnonymousIdStorage();
|
|
5238
5253
|
});
|
|
5239
|
-
const sessionIdRef =
|
|
5240
|
-
const queueRef =
|
|
5254
|
+
const sessionIdRef = React26.useRef(createAnalyticsId("ses"));
|
|
5255
|
+
const queueRef = React26.useRef(
|
|
5241
5256
|
resolvedConfig.persistQueue ? readAnalyticsQueueStorage() : []
|
|
5242
5257
|
);
|
|
5243
|
-
const flushingRef =
|
|
5258
|
+
const flushingRef = React26.useRef(false);
|
|
5244
5259
|
const hasAnalyticsConsent = consent.categories.analytics;
|
|
5245
|
-
const shouldTrack =
|
|
5260
|
+
const shouldTrack = React26.useCallback(() => {
|
|
5246
5261
|
if (!resolvedConfig.enabled) return false;
|
|
5247
5262
|
if (!hasAnalyticsConsent) return false;
|
|
5248
5263
|
if (resolvedConfig.respectDoNotTrack && getDoNotTrackEnabled()) {
|
|
@@ -5254,17 +5269,17 @@ var AnalyticsProvider = ({
|
|
|
5254
5269
|
resolvedConfig.enabled,
|
|
5255
5270
|
resolvedConfig.respectDoNotTrack
|
|
5256
5271
|
]);
|
|
5257
|
-
const persistQueue =
|
|
5272
|
+
const persistQueue = React26.useCallback(() => {
|
|
5258
5273
|
if (!resolvedConfig.persistQueue) return;
|
|
5259
5274
|
writeAnalyticsQueueStorage(queueRef.current);
|
|
5260
5275
|
}, [resolvedConfig.persistQueue]);
|
|
5261
|
-
const clearQueue =
|
|
5276
|
+
const clearQueue = React26.useCallback(() => {
|
|
5262
5277
|
queueRef.current = [];
|
|
5263
5278
|
if (resolvedConfig.persistQueue) {
|
|
5264
5279
|
clearAnalyticsQueueStorage();
|
|
5265
5280
|
}
|
|
5266
5281
|
}, [resolvedConfig.persistQueue]);
|
|
5267
|
-
const flush =
|
|
5282
|
+
const flush = React26.useCallback(async () => {
|
|
5268
5283
|
if (!transport || flushingRef.current) return;
|
|
5269
5284
|
if (!shouldTrack()) return;
|
|
5270
5285
|
if (queueRef.current.length === 0) return;
|
|
@@ -5282,7 +5297,7 @@ var AnalyticsProvider = ({
|
|
|
5282
5297
|
flushingRef.current = false;
|
|
5283
5298
|
}
|
|
5284
5299
|
}, [persistQueue, resolvedConfig.debug, shouldTrack, transport]);
|
|
5285
|
-
const track =
|
|
5300
|
+
const track = React26.useCallback(
|
|
5286
5301
|
async (type2, options) => {
|
|
5287
5302
|
if (!shouldTrack()) return;
|
|
5288
5303
|
const resolvedAnonymousId = anonymousId ?? ensureAnonymousIdStorage();
|
|
@@ -5315,7 +5330,7 @@ var AnalyticsProvider = ({
|
|
|
5315
5330
|
userId
|
|
5316
5331
|
]
|
|
5317
5332
|
);
|
|
5318
|
-
const applyConsent =
|
|
5333
|
+
const applyConsent = React26.useCallback(
|
|
5319
5334
|
(nextConsent) => {
|
|
5320
5335
|
setConsent(nextConsent);
|
|
5321
5336
|
writeConsentStorage(resolvedConfig.storageKey, nextConsent);
|
|
@@ -5330,7 +5345,7 @@ var AnalyticsProvider = ({
|
|
|
5330
5345
|
},
|
|
5331
5346
|
[clearQueue, onConsentChange, resolvedConfig.storageKey]
|
|
5332
5347
|
);
|
|
5333
|
-
const acceptAll =
|
|
5348
|
+
const acceptAll = React26.useCallback(() => {
|
|
5334
5349
|
applyConsent({
|
|
5335
5350
|
status: "accepted",
|
|
5336
5351
|
version: consentVersion,
|
|
@@ -5343,7 +5358,7 @@ var AnalyticsProvider = ({
|
|
|
5343
5358
|
}
|
|
5344
5359
|
});
|
|
5345
5360
|
}, [applyConsent, consentVersion]);
|
|
5346
|
-
const rejectAll =
|
|
5361
|
+
const rejectAll = React26.useCallback(() => {
|
|
5347
5362
|
applyConsent({
|
|
5348
5363
|
status: "rejected",
|
|
5349
5364
|
version: consentVersion,
|
|
@@ -5356,7 +5371,7 @@ var AnalyticsProvider = ({
|
|
|
5356
5371
|
}
|
|
5357
5372
|
});
|
|
5358
5373
|
}, [applyConsent, consentVersion]);
|
|
5359
|
-
const updateConsent =
|
|
5374
|
+
const updateConsent = React26.useCallback(
|
|
5360
5375
|
(categories) => {
|
|
5361
5376
|
const nextCategories = {
|
|
5362
5377
|
...consent.categories,
|
|
@@ -5372,14 +5387,14 @@ var AnalyticsProvider = ({
|
|
|
5372
5387
|
},
|
|
5373
5388
|
[applyConsent, consent.categories, consentVersion]
|
|
5374
5389
|
);
|
|
5375
|
-
const resetConsent =
|
|
5390
|
+
const resetConsent = React26.useCallback(() => {
|
|
5376
5391
|
setConsent(defaultConsent);
|
|
5377
5392
|
clearConsentStorage(resolvedConfig.storageKey);
|
|
5378
5393
|
clearAnonymousIdStorage();
|
|
5379
5394
|
clearQueue();
|
|
5380
5395
|
setAnonymousId(null);
|
|
5381
5396
|
}, [clearQueue, defaultConsent, resolvedConfig.storageKey]);
|
|
5382
|
-
|
|
5397
|
+
React26.useEffect(() => {
|
|
5383
5398
|
if (!isBrowser()) return;
|
|
5384
5399
|
const interval2 = window.setInterval(() => {
|
|
5385
5400
|
flush();
|
|
@@ -5388,7 +5403,7 @@ var AnalyticsProvider = ({
|
|
|
5388
5403
|
window.clearInterval(interval2);
|
|
5389
5404
|
};
|
|
5390
5405
|
}, [flush, resolvedConfig.flushIntervalMs]);
|
|
5391
|
-
|
|
5406
|
+
React26.useEffect(() => {
|
|
5392
5407
|
if (!isBrowser()) return;
|
|
5393
5408
|
const handleVisibilityChange = () => {
|
|
5394
5409
|
if (document.visibilityState !== "hidden") return;
|
|
@@ -5412,7 +5427,7 @@ var AnalyticsProvider = ({
|
|
|
5412
5427
|
document.removeEventListener("visibilitychange", handleVisibilityChange);
|
|
5413
5428
|
};
|
|
5414
5429
|
}, [flush, persistQueue, shouldTrack, transport]);
|
|
5415
|
-
const value =
|
|
5430
|
+
const value = React26.useMemo(
|
|
5416
5431
|
() => ({
|
|
5417
5432
|
appId,
|
|
5418
5433
|
consent,
|
|
@@ -5975,9 +5990,9 @@ function ConfigBootstrap({
|
|
|
5975
5990
|
loadingFallback = null,
|
|
5976
5991
|
showStack = false
|
|
5977
5992
|
}) {
|
|
5978
|
-
const [RootApp, setRootApp] =
|
|
5979
|
-
const [loadError, setLoadError] =
|
|
5980
|
-
|
|
5993
|
+
const [RootApp, setRootApp] = React26.useState(null);
|
|
5994
|
+
const [loadError, setLoadError] = React26.useState(null);
|
|
5995
|
+
React26.useEffect(() => {
|
|
5981
5996
|
if (!config.isValid) {
|
|
5982
5997
|
return;
|
|
5983
5998
|
}
|
|
@@ -6018,16 +6033,16 @@ function ConfigBootstrap({
|
|
|
6018
6033
|
return /* @__PURE__ */ jsxRuntime.jsx(RootApp, {});
|
|
6019
6034
|
}
|
|
6020
6035
|
var ConfigBootstrap_default = ConfigBootstrap;
|
|
6021
|
-
var EUIContext =
|
|
6036
|
+
var EUIContext = React26.createContext(null);
|
|
6022
6037
|
var EUIProvider = ({
|
|
6023
6038
|
config,
|
|
6024
6039
|
children: children3
|
|
6025
6040
|
}) => {
|
|
6026
|
-
const [state, setState] =
|
|
6041
|
+
const [state, setState] = React26.useState(config);
|
|
6027
6042
|
return /* @__PURE__ */ jsxRuntime.jsx(EUIContext.Provider, { value: { config: state, setConfig: setState }, children: children3 });
|
|
6028
6043
|
};
|
|
6029
6044
|
var useEUIConfig = () => {
|
|
6030
|
-
const ctx =
|
|
6045
|
+
const ctx = React26.useContext(EUIContext);
|
|
6031
6046
|
if (!ctx) {
|
|
6032
6047
|
throw new Error("useEUIConfig must be used inside EUIProvider");
|
|
6033
6048
|
}
|
|
@@ -6043,6 +6058,31 @@ function resolveWithGlobal(config, props, defaults) {
|
|
|
6043
6058
|
};
|
|
6044
6059
|
}
|
|
6045
6060
|
|
|
6061
|
+
// src/components/data-entry/button/base/Button.config.ts
|
|
6062
|
+
var buttonModeAppearance = {
|
|
6063
|
+
contained: "solid",
|
|
6064
|
+
"contained-tonal": "lite",
|
|
6065
|
+
outlined: "ghost",
|
|
6066
|
+
text: "ghost"
|
|
6067
|
+
};
|
|
6068
|
+
function useResolvedButtonConfig({
|
|
6069
|
+
compact = false,
|
|
6070
|
+
mode,
|
|
6071
|
+
variant,
|
|
6072
|
+
appearance,
|
|
6073
|
+
shape,
|
|
6074
|
+
size
|
|
6075
|
+
}) {
|
|
6076
|
+
const eui = useEUIConfig();
|
|
6077
|
+
const configuredSize = size ?? eui?.config?.global?.size ?? "md";
|
|
6078
|
+
return {
|
|
6079
|
+
shape: shape ?? eui?.config?.global?.shape ?? "square",
|
|
6080
|
+
size: compact && configuredSize === "md" ? "sm" : configuredSize,
|
|
6081
|
+
variant: variant ?? eui?.config?.global?.variant ?? "success",
|
|
6082
|
+
appearance: appearance ?? (mode ? buttonModeAppearance[mode] : "solid")
|
|
6083
|
+
};
|
|
6084
|
+
}
|
|
6085
|
+
|
|
6046
6086
|
// src/data/enums.ts
|
|
6047
6087
|
var Shape = /* @__PURE__ */ ((Shape2) => {
|
|
6048
6088
|
Shape2["circle"] = "circle";
|
|
@@ -6055,14 +6095,14 @@ var Shape = /* @__PURE__ */ ((Shape2) => {
|
|
|
6055
6095
|
// src/data/styles.tsx
|
|
6056
6096
|
var variantsSolid = {
|
|
6057
6097
|
["default" /* default */]: "bg-gray-300 text-gray-900 hover:bg-gray-200 dark:bg-gray-700 dark:text-gray-100 dark:hover:bg-gray-600",
|
|
6058
|
-
["primary" /* primary */]: "bg-
|
|
6059
|
-
["secondary" /* secondary */]: "bg-
|
|
6060
|
-
["success" /* success */]: "bg-
|
|
6061
|
-
["danger" /* danger */]: "bg-
|
|
6062
|
-
["warning" /* warning */]: "bg-
|
|
6063
|
-
["info" /* info */]: "bg-
|
|
6064
|
-
["light" /* light */]: "bg-
|
|
6065
|
-
["dark" /* dark */]: "bg-
|
|
6098
|
+
["primary" /* primary */]: "bg-eui-primary-500 text-white hover:bg-eui-primary-600",
|
|
6099
|
+
["secondary" /* secondary */]: "bg-eui-secondary-500 text-white hover:bg-eui-secondary-600",
|
|
6100
|
+
["success" /* success */]: "bg-eui-success-500 text-white hover:bg-eui-success-600",
|
|
6101
|
+
["danger" /* danger */]: "bg-eui-danger-500 text-white hover:bg-eui-danger-600",
|
|
6102
|
+
["warning" /* warning */]: "bg-eui-warning-500 text-black hover:bg-eui-warning-400",
|
|
6103
|
+
["info" /* info */]: "bg-eui-info-500 text-white hover:bg-eui-info-600",
|
|
6104
|
+
["light" /* light */]: "bg-eui-light-400 text-gray-900 hover:bg-eui-light-300 dark:bg-gray-200 dark:text-gray-900 dark:hover:bg-gray-100",
|
|
6105
|
+
["dark" /* dark */]: "bg-eui-dark-500 text-white hover:bg-eui-dark-400 dark:bg-eui-dark-400 dark:hover:bg-eui-dark-300"
|
|
6066
6106
|
};
|
|
6067
6107
|
var variantsLite = {
|
|
6068
6108
|
["default" /* default */]: "bg-gray-500/10 border border-gray-300 text-gray-700 dark:bg-gray-400/10 dark:border-gray-700 dark:text-gray-200",
|
|
@@ -6148,17 +6188,6 @@ var cardBgVariants = {
|
|
|
6148
6188
|
["light" /* light */]: "bg-eui-light-500/10",
|
|
6149
6189
|
["dark" /* dark */]: "bg-eui-dark-500/20"
|
|
6150
6190
|
};
|
|
6151
|
-
var checkboxVariants = {
|
|
6152
|
-
["default" /* default */]: "checked:bg-gray-600 checked:border-gray-600 dark:checked:bg-gray-500 dark:checked:border-gray-500",
|
|
6153
|
-
["primary" /* primary */]: "checked:bg-eui-primary-600 checked:border-eui-primary-600 dark:checked:bg-eui-primary-500 dark:checked:border-eui-primary-500",
|
|
6154
|
-
["secondary" /* secondary */]: "checked:bg-eui-secondary-600 checked:border-eui-secondary-600 dark:checked:bg-eui-secondary-500 dark:checked:border-eui-secondary-500",
|
|
6155
|
-
["success" /* success */]: "checked:bg-eui-success-600 checked:border-eui-success-600 dark:checked:bg-eui-success-500 dark:checked:border-eui-success-500",
|
|
6156
|
-
["danger" /* danger */]: "checked:bg-eui-danger-600 checked:border-eui-danger-600 dark:checked:bg-eui-danger-500 dark:checked:border-eui-danger-500",
|
|
6157
|
-
["warning" /* warning */]: "checked:bg-eui-warning-500 checked:border-eui-warning-500 dark:checked:bg-eui-warning-400 dark:checked:border-eui-warning-400",
|
|
6158
|
-
["info" /* info */]: "checked:bg-eui-info-600 checked:border-eui-info-600 dark:checked:bg-eui-info-500 dark:checked:border-eui-info-500",
|
|
6159
|
-
["light" /* light */]: "checked:bg-eui-light-400 checked:border-eui-light-400 dark:checked:bg-gray-200 dark:checked:border-gray-200",
|
|
6160
|
-
["dark" /* dark */]: "checked:bg-eui-dark-500 checked:border-eui-dark-500 dark:checked:bg-eui-dark-300 dark:checked:border-eui-dark-300"
|
|
6161
|
-
};
|
|
6162
6191
|
var toastPositionStyles = {
|
|
6163
6192
|
["top-left" /* topLeft */]: "top-4 left-4 items-start",
|
|
6164
6193
|
["top-center" /* topCenter */]: "top-4 left-1/2 -translate-x-1/2 items-center",
|
|
@@ -6218,7 +6247,31 @@ var toastShapeStyles = {
|
|
|
6218
6247
|
["softRoundedSquare" /* softRoundedSquare */]: "!rounded-3xl",
|
|
6219
6248
|
["square" /* square */]: "!rounded-none"
|
|
6220
6249
|
};
|
|
6221
|
-
|
|
6250
|
+
|
|
6251
|
+
// src/components/data-entry/button/base/Button.styles.ts
|
|
6252
|
+
var buttonShapes = shapes;
|
|
6253
|
+
var buttonIconSizes = {
|
|
6254
|
+
xs: 14,
|
|
6255
|
+
sm: 16,
|
|
6256
|
+
md: 18,
|
|
6257
|
+
lg: 20,
|
|
6258
|
+
xl: 22
|
|
6259
|
+
};
|
|
6260
|
+
function resolveButtonVariantStyles({
|
|
6261
|
+
appearance,
|
|
6262
|
+
variant
|
|
6263
|
+
}) {
|
|
6264
|
+
return resolveAppearanceStyles({
|
|
6265
|
+
appearance,
|
|
6266
|
+
variant,
|
|
6267
|
+
solid: variantsSolid,
|
|
6268
|
+
lite: variantsLite,
|
|
6269
|
+
ghost: variantsGhost
|
|
6270
|
+
});
|
|
6271
|
+
}
|
|
6272
|
+
|
|
6273
|
+
// src/components/data-entry/button/web/Button.web.styles.ts
|
|
6274
|
+
var webButtonSizes = {
|
|
6222
6275
|
xs: "px-2 py-1 text-xs",
|
|
6223
6276
|
sm: "px-3 py-1.5 text-sm",
|
|
6224
6277
|
md: "px-4 py-2 text-base",
|
|
@@ -6233,27 +6286,56 @@ function Button({
|
|
|
6233
6286
|
loading = false,
|
|
6234
6287
|
disabled = false,
|
|
6235
6288
|
block = false,
|
|
6236
|
-
|
|
6237
|
-
|
|
6289
|
+
compact = false,
|
|
6290
|
+
glow = true,
|
|
6291
|
+
mode,
|
|
6292
|
+
contentClassName,
|
|
6293
|
+
labelClassName,
|
|
6294
|
+
variant,
|
|
6295
|
+
appearance,
|
|
6238
6296
|
shape,
|
|
6239
|
-
size
|
|
6297
|
+
size,
|
|
6298
|
+
accessibilityLabel,
|
|
6299
|
+
accessibilityRole,
|
|
6300
|
+
accessibilityState,
|
|
6301
|
+
testID,
|
|
6240
6302
|
className,
|
|
6241
6303
|
onMouseMove,
|
|
6304
|
+
onClick,
|
|
6305
|
+
onPress,
|
|
6242
6306
|
...rest
|
|
6243
6307
|
}) {
|
|
6244
|
-
const
|
|
6245
|
-
const
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6308
|
+
const accessibility = accessibilityState;
|
|
6309
|
+
const {
|
|
6310
|
+
shape: resolvedShape,
|
|
6311
|
+
size: resolvedSize,
|
|
6312
|
+
variant: resolvedVariant,
|
|
6313
|
+
appearance: resolvedAppearance
|
|
6314
|
+
} = useResolvedButtonConfig({
|
|
6315
|
+
compact,
|
|
6316
|
+
mode,
|
|
6249
6317
|
variant,
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
|
|
6318
|
+
appearance,
|
|
6319
|
+
shape,
|
|
6320
|
+
size
|
|
6321
|
+
});
|
|
6322
|
+
const btnRef = React26.useRef(null);
|
|
6323
|
+
const variantStyles = resolveButtonVariantStyles({
|
|
6324
|
+
appearance: resolvedAppearance,
|
|
6325
|
+
variant: resolvedVariant
|
|
6253
6326
|
});
|
|
6327
|
+
const iconSize = buttonIconSizes[resolvedSize];
|
|
6328
|
+
const labelContent = text10 || children3;
|
|
6329
|
+
const resolvedIcon = typeof icon === "function" ? icon({
|
|
6330
|
+
color: "currentColor",
|
|
6331
|
+
size: iconSize
|
|
6332
|
+
}) : icon;
|
|
6254
6333
|
const handleMouseMove = (e) => {
|
|
6255
6334
|
const btn = btnRef.current;
|
|
6256
|
-
if (!btn)
|
|
6335
|
+
if (!btn || !glow) {
|
|
6336
|
+
onMouseMove?.(e);
|
|
6337
|
+
return;
|
|
6338
|
+
}
|
|
6257
6339
|
const rect = btn.getBoundingClientRect();
|
|
6258
6340
|
const x3 = e.clientX - rect.left;
|
|
6259
6341
|
const y3 = e.clientY - rect.top;
|
|
@@ -6261,6 +6343,12 @@ function Button({
|
|
|
6261
6343
|
btn.style.setProperty("--glow-y", `${y3}px`);
|
|
6262
6344
|
onMouseMove?.(e);
|
|
6263
6345
|
};
|
|
6346
|
+
const handleClick = (e) => {
|
|
6347
|
+
onClick?.(e);
|
|
6348
|
+
if (!e.defaultPrevented) {
|
|
6349
|
+
onPress?.();
|
|
6350
|
+
}
|
|
6351
|
+
};
|
|
6264
6352
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6265
6353
|
"button",
|
|
6266
6354
|
{
|
|
@@ -6268,47 +6356,114 @@ function Button({
|
|
|
6268
6356
|
ref: btnRef,
|
|
6269
6357
|
type: type2,
|
|
6270
6358
|
disabled: disabled || loading,
|
|
6359
|
+
onClick: handleClick,
|
|
6271
6360
|
onMouseMove: handleMouseMove,
|
|
6361
|
+
"aria-disabled": disabled || loading,
|
|
6362
|
+
"aria-label": accessibilityLabel,
|
|
6363
|
+
"aria-pressed": accessibility?.selected === void 0 ? void 0 : Boolean(accessibility.selected),
|
|
6364
|
+
"data-testid": testID,
|
|
6365
|
+
role: accessibilityRole,
|
|
6272
6366
|
className: cn(
|
|
6273
6367
|
"relative overflow-hidden group inline-flex items-center justify-center gap-2 transition-all duration-300",
|
|
6274
6368
|
variantStyles,
|
|
6275
|
-
|
|
6276
|
-
|
|
6369
|
+
buttonShapes[resolvedShape],
|
|
6370
|
+
webButtonSizes[resolvedSize],
|
|
6277
6371
|
block && "w-full",
|
|
6372
|
+
mode === "text" && "border-transparent bg-transparent",
|
|
6278
6373
|
(loading || disabled) && "brightness-75 grayscale cursor-not-allowed",
|
|
6279
6374
|
!loading && !disabled && "hover:cursor-pointer",
|
|
6280
6375
|
className
|
|
6281
6376
|
),
|
|
6282
6377
|
children: [
|
|
6283
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6378
|
+
glow && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6284
6379
|
"span",
|
|
6285
6380
|
{
|
|
6286
6381
|
className: "pointer-events-none absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-300",
|
|
6287
6382
|
style: {
|
|
6288
6383
|
background: `
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
|
|
6293
|
-
|
|
6294
|
-
|
|
6384
|
+
radial-gradient(
|
|
6385
|
+
200px circle at var(--glow-x) var(--glow-y),
|
|
6386
|
+
rgba(255,255,255,0.18),
|
|
6387
|
+
transparent 50%
|
|
6388
|
+
)
|
|
6389
|
+
`
|
|
6295
6390
|
}
|
|
6296
6391
|
}
|
|
6297
6392
|
),
|
|
6298
6393
|
loading && /* @__PURE__ */ jsxRuntime.jsx(index_js$1.AiOutlineLoading, { className: "animate-spin z-10" }),
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6394
|
+
resolvedIcon && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6395
|
+
"span",
|
|
6396
|
+
{
|
|
6397
|
+
className: cn(
|
|
6398
|
+
"z-10 inline-flex shrink-0 items-center justify-center leading-none",
|
|
6399
|
+
contentClassName
|
|
6400
|
+
),
|
|
6401
|
+
style: {
|
|
6402
|
+
height: iconSize,
|
|
6403
|
+
lineHeight: 0,
|
|
6404
|
+
width: iconSize
|
|
6405
|
+
},
|
|
6406
|
+
children: resolvedIcon
|
|
6407
|
+
}
|
|
6408
|
+
),
|
|
6409
|
+
labelContent && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6410
|
+
"span",
|
|
6411
|
+
{
|
|
6412
|
+
className: cn(
|
|
6413
|
+
"z-10 inline-flex items-center justify-center leading-none",
|
|
6414
|
+
labelClassName
|
|
6415
|
+
),
|
|
6416
|
+
style: {
|
|
6417
|
+
minHeight: iconSize
|
|
6418
|
+
},
|
|
6419
|
+
children: labelContent
|
|
6420
|
+
}
|
|
6421
|
+
)
|
|
6302
6422
|
]
|
|
6303
6423
|
}
|
|
6304
6424
|
);
|
|
6305
6425
|
}
|
|
6306
|
-
var
|
|
6426
|
+
var Button_web_default = Button;
|
|
6427
|
+
|
|
6428
|
+
// src/components/data-entry/input/input-label/base/InputLabel.styles.ts
|
|
6429
|
+
var inputLabelStaticClassName = "pointer-events-none select-none px-0 text-[13.5px] leading-none text-[#6B7280]";
|
|
6430
|
+
var inputLabelBaseClassName = "pointer-events-none absolute left-3 z-10 select-none bg-white/95 px-1 font-medium leading-none dark:bg-eui-dark-800";
|
|
6431
|
+
var inputLabelTransitionClassName = "transition-all duration-200 ease-out";
|
|
6432
|
+
var inputLabelRestingClassName = "top-[18px] translate-y-0 text-base leading-none text-[#6B7280]";
|
|
6433
|
+
var inputLabelFloatingClassName = "top-1.5 translate-y-0 text-xs leading-none text-[#6B7280]";
|
|
6434
|
+
var inputLabelErrorClassName = "text-[#6B7280]";
|
|
6435
|
+
var inputLabelDisabledClassName = "opacity-60";
|
|
6436
|
+
function InputLabel({
|
|
6437
|
+
text: text10,
|
|
6438
|
+
children: children3,
|
|
6439
|
+
className,
|
|
6440
|
+
floating,
|
|
6441
|
+
errored = false,
|
|
6442
|
+
disabled = false,
|
|
6443
|
+
htmlFor
|
|
6444
|
+
}) {
|
|
6445
|
+
const isFloatingLabel = typeof floating === "boolean";
|
|
6446
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6447
|
+
"label",
|
|
6448
|
+
{
|
|
6449
|
+
htmlFor,
|
|
6450
|
+
className: cn(
|
|
6451
|
+
isFloatingLabel ? inputLabelBaseClassName : inputLabelStaticClassName,
|
|
6452
|
+
isFloatingLabel && inputLabelTransitionClassName,
|
|
6453
|
+
isFloatingLabel && (floating === true ? inputLabelFloatingClassName : inputLabelRestingClassName),
|
|
6454
|
+
errored && inputLabelErrorClassName,
|
|
6455
|
+
disabled && inputLabelDisabledClassName,
|
|
6456
|
+
className
|
|
6457
|
+
),
|
|
6458
|
+
children: text10 || children3
|
|
6459
|
+
}
|
|
6460
|
+
);
|
|
6461
|
+
}
|
|
6307
6462
|
var Backdrop = ({ children: children3, styles }) => {
|
|
6308
6463
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6309
6464
|
"div",
|
|
6310
6465
|
{
|
|
6311
|
-
className:
|
|
6466
|
+
className: classNames74__default.default({
|
|
6312
6467
|
"bg-black/75 top-0 bottom-0 left-0 right-0 z-50 fixed inset-0 flex items-center justify-center overflow-hidden": true,
|
|
6313
6468
|
[`${styles}`]: styles
|
|
6314
6469
|
}),
|
|
@@ -6588,17 +6743,17 @@ function useToastTimer({
|
|
|
6588
6743
|
pauseOnHover,
|
|
6589
6744
|
onTimeout
|
|
6590
6745
|
}) {
|
|
6591
|
-
const [isPaused, setIsPaused] =
|
|
6592
|
-
const timeoutRef =
|
|
6593
|
-
const startedAtRef =
|
|
6594
|
-
const remainingRef =
|
|
6595
|
-
const clearTimer =
|
|
6746
|
+
const [isPaused, setIsPaused] = React26.useState(false);
|
|
6747
|
+
const timeoutRef = React26.useRef(null);
|
|
6748
|
+
const startedAtRef = React26.useRef(0);
|
|
6749
|
+
const remainingRef = React26.useRef(typeof duration === "number" ? duration : 0);
|
|
6750
|
+
const clearTimer = React26.useCallback(() => {
|
|
6596
6751
|
if (timeoutRef.current !== null) {
|
|
6597
6752
|
window.clearTimeout(timeoutRef.current);
|
|
6598
6753
|
timeoutRef.current = null;
|
|
6599
6754
|
}
|
|
6600
6755
|
}, []);
|
|
6601
|
-
const startTimer =
|
|
6756
|
+
const startTimer = React26.useCallback(() => {
|
|
6602
6757
|
if (typeof duration !== "number" || duration <= 0) {
|
|
6603
6758
|
return;
|
|
6604
6759
|
}
|
|
@@ -6608,12 +6763,12 @@ function useToastTimer({
|
|
|
6608
6763
|
onTimeout();
|
|
6609
6764
|
}, remainingRef.current);
|
|
6610
6765
|
}, [clearTimer, duration, onTimeout]);
|
|
6611
|
-
|
|
6766
|
+
React26.useEffect(() => {
|
|
6612
6767
|
remainingRef.current = typeof duration === "number" ? duration : 0;
|
|
6613
6768
|
startTimer();
|
|
6614
6769
|
return clearTimer;
|
|
6615
6770
|
}, [clearTimer, duration, startTimer]);
|
|
6616
|
-
const pauseTimer =
|
|
6771
|
+
const pauseTimer = React26.useCallback(() => {
|
|
6617
6772
|
if (!pauseOnHover || typeof duration !== "number") {
|
|
6618
6773
|
return;
|
|
6619
6774
|
}
|
|
@@ -6624,14 +6779,14 @@ function useToastTimer({
|
|
|
6624
6779
|
);
|
|
6625
6780
|
setIsPaused(true);
|
|
6626
6781
|
}, [clearTimer, duration, pauseOnHover]);
|
|
6627
|
-
const resumeTimer =
|
|
6782
|
+
const resumeTimer = React26.useCallback(() => {
|
|
6628
6783
|
if (!pauseOnHover || typeof duration !== "number") {
|
|
6629
6784
|
return;
|
|
6630
6785
|
}
|
|
6631
6786
|
setIsPaused(false);
|
|
6632
6787
|
startTimer();
|
|
6633
6788
|
}, [duration, pauseOnHover, startTimer]);
|
|
6634
|
-
const progressStyle =
|
|
6789
|
+
const progressStyle = React26.useMemo(() => {
|
|
6635
6790
|
if (typeof duration !== "number") {
|
|
6636
6791
|
return void 0;
|
|
6637
6792
|
}
|
|
@@ -6672,7 +6827,7 @@ function ToastItem({
|
|
|
6672
6827
|
const duration = item.duration ?? autoClose;
|
|
6673
6828
|
const variant = toastStatusVariantMap[item.status];
|
|
6674
6829
|
const statusStyles = toastVariantStyles[variant];
|
|
6675
|
-
const dismiss =
|
|
6830
|
+
const dismiss = React26.useCallback(() => {
|
|
6676
6831
|
toastStore.remove(item.id);
|
|
6677
6832
|
}, [item.id]);
|
|
6678
6833
|
const { pauseTimer, resumeTimer, progressStyle } = useToastTimer({
|
|
@@ -6751,16 +6906,16 @@ var Toast = ({
|
|
|
6751
6906
|
...rest
|
|
6752
6907
|
}) => {
|
|
6753
6908
|
const eui = useEUIConfig();
|
|
6754
|
-
const [items, setItems] =
|
|
6909
|
+
const [items, setItems] = React26.useState(() => {
|
|
6755
6910
|
return toastStore.getSnapshot();
|
|
6756
6911
|
});
|
|
6757
|
-
|
|
6912
|
+
React26.useEffect(() => {
|
|
6758
6913
|
return toastStore.subscribe(setItems);
|
|
6759
6914
|
}, []);
|
|
6760
|
-
const safeShape =
|
|
6915
|
+
const safeShape = React26.useMemo(() => {
|
|
6761
6916
|
return normalizeToastShape(shape ?? eui?.config?.global?.shape);
|
|
6762
6917
|
}, [shape, eui?.config?.global?.shape]);
|
|
6763
|
-
const visibleItems =
|
|
6918
|
+
const visibleItems = React26.useMemo(() => {
|
|
6764
6919
|
const orderedItems = newestOnTop ? [...items].reverse() : [...items];
|
|
6765
6920
|
return orderedItems.slice(0, maxToasts);
|
|
6766
6921
|
}, [items, maxToasts, newestOnTop]);
|
|
@@ -6840,12 +6995,12 @@ function sendToast(data = {}) {
|
|
|
6840
6995
|
});
|
|
6841
6996
|
}
|
|
6842
6997
|
function useTransitionVisibility(visibility, leaveDuration = 150) {
|
|
6843
|
-
const [mounted, setMounted] =
|
|
6844
|
-
const [active, setActive] =
|
|
6845
|
-
const isInitialRenderRef =
|
|
6846
|
-
const frameOneRef =
|
|
6847
|
-
const frameTwoRef =
|
|
6848
|
-
const timeoutRef =
|
|
6998
|
+
const [mounted, setMounted] = React26.useState(Boolean(visibility));
|
|
6999
|
+
const [active, setActive] = React26.useState(Boolean(visibility));
|
|
7000
|
+
const isInitialRenderRef = React26.useRef(true);
|
|
7001
|
+
const frameOneRef = React26.useRef(null);
|
|
7002
|
+
const frameTwoRef = React26.useRef(null);
|
|
7003
|
+
const timeoutRef = React26.useRef(null);
|
|
6849
7004
|
const clearTimers = () => {
|
|
6850
7005
|
if (frameOneRef.current) {
|
|
6851
7006
|
cancelAnimationFrame(frameOneRef.current);
|
|
@@ -6860,7 +7015,7 @@ function useTransitionVisibility(visibility, leaveDuration = 150) {
|
|
|
6860
7015
|
timeoutRef.current = null;
|
|
6861
7016
|
}
|
|
6862
7017
|
};
|
|
6863
|
-
|
|
7018
|
+
React26.useEffect(() => {
|
|
6864
7019
|
clearTimers();
|
|
6865
7020
|
if (isInitialRenderRef.current) {
|
|
6866
7021
|
isInitialRenderRef.current = false;
|
|
@@ -6888,17 +7043,17 @@ function useTransitionVisibility(visibility, leaveDuration = 150) {
|
|
|
6888
7043
|
};
|
|
6889
7044
|
}
|
|
6890
7045
|
function renderTransitionChild(children3, className) {
|
|
6891
|
-
const childCount =
|
|
7046
|
+
const childCount = React26.Children.count(children3);
|
|
6892
7047
|
if (childCount !== 1) {
|
|
6893
7048
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: children3 });
|
|
6894
7049
|
}
|
|
6895
|
-
const child =
|
|
6896
|
-
if (!
|
|
7050
|
+
const child = React26.Children.only(children3);
|
|
7051
|
+
if (!React26__default.default.isValidElement(child)) {
|
|
6897
7052
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: child });
|
|
6898
7053
|
}
|
|
6899
7054
|
const element7 = child;
|
|
6900
|
-
return
|
|
6901
|
-
className:
|
|
7055
|
+
return React26__default.default.cloneElement(element7, {
|
|
7056
|
+
className: classNames74__default.default(element7.props.className, className)
|
|
6902
7057
|
});
|
|
6903
7058
|
}
|
|
6904
7059
|
function TransitionBase({
|
|
@@ -6918,7 +7073,7 @@ function TransitionBase({
|
|
|
6918
7073
|
if (!mounted && unmountOnExit) {
|
|
6919
7074
|
return null;
|
|
6920
7075
|
}
|
|
6921
|
-
const transitionClassName =
|
|
7076
|
+
const transitionClassName = classNames74__default.default(
|
|
6922
7077
|
visibility ? enterClassName : leaveClassName,
|
|
6923
7078
|
active ? visibleClassName : hiddenClassName
|
|
6924
7079
|
);
|
|
@@ -7076,117 +7231,191 @@ var Transition = {
|
|
|
7076
7231
|
TransitionSlide: TransitionSlide_default,
|
|
7077
7232
|
TransitionAccordion: TransitionAccordion_default
|
|
7078
7233
|
};
|
|
7234
|
+
|
|
7235
|
+
// src/components/data-entry/input/input-response/base/InputResponse.styles.ts
|
|
7236
|
+
var inputResponseBaseClassName = "px-2 pt-1.5 text-sm font-medium";
|
|
7237
|
+
var inputResponseVariants = textVariants;
|
|
7079
7238
|
function InputResponse({
|
|
7080
7239
|
name: name2,
|
|
7081
7240
|
visibility = false,
|
|
7082
7241
|
variant = "default",
|
|
7083
|
-
|
|
7242
|
+
className,
|
|
7243
|
+
message
|
|
7084
7244
|
}) {
|
|
7085
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Transition.
|
|
7245
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Transition.TransitionFadeIn, { visibility, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7086
7246
|
"div",
|
|
7087
7247
|
{
|
|
7088
|
-
className:
|
|
7089
|
-
|
|
7090
|
-
[
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
})
|
|
7094
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(formik.ErrorMessage, { name: name2 })
|
|
7248
|
+
className: cn(
|
|
7249
|
+
inputResponseBaseClassName,
|
|
7250
|
+
inputResponseVariants[variant],
|
|
7251
|
+
className
|
|
7252
|
+
),
|
|
7253
|
+
children: message ?? /* @__PURE__ */ jsxRuntime.jsx(formik.ErrorMessage, { name: name2 })
|
|
7095
7254
|
}
|
|
7096
7255
|
) });
|
|
7097
7256
|
}
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
|
|
7103
|
-
className: classNames77__default.default({
|
|
7104
|
-
"px-0 eui-text-sm text-[13.5px] pointer-events-none select-none": true,
|
|
7105
|
-
"transition-all ease-in-out": true,
|
|
7106
|
-
[`${styles}`]: styles
|
|
7107
|
-
}),
|
|
7108
|
-
children: text10 || children3
|
|
7109
|
-
}
|
|
7110
|
-
);
|
|
7257
|
+
function resolveInputType({
|
|
7258
|
+
passwordVisible,
|
|
7259
|
+
type: type2
|
|
7260
|
+
}) {
|
|
7261
|
+
return type2 === "password" && passwordVisible ? "text" : type2;
|
|
7111
7262
|
}
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
|
|
7115
|
-
|
|
7116
|
-
|
|
7117
|
-
|
|
7118
|
-
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
|
|
7122
|
-
|
|
7263
|
+
function useResolvedInputConfig({
|
|
7264
|
+
label,
|
|
7265
|
+
placeholder,
|
|
7266
|
+
shape,
|
|
7267
|
+
type: type2 = "text"
|
|
7268
|
+
}) {
|
|
7269
|
+
const eui = useEUIConfig();
|
|
7270
|
+
return {
|
|
7271
|
+
shape: shape ?? eui?.config?.global?.shape ?? "square",
|
|
7272
|
+
type: type2,
|
|
7273
|
+
label: label ?? placeholder
|
|
7123
7274
|
};
|
|
7275
|
+
}
|
|
7276
|
+
function useInputFieldState(props) {
|
|
7277
|
+
const [field, meta, helpers] = formik.useField(props);
|
|
7278
|
+
return {
|
|
7279
|
+
field,
|
|
7280
|
+
meta,
|
|
7281
|
+
helpers
|
|
7282
|
+
};
|
|
7283
|
+
}
|
|
7284
|
+
|
|
7285
|
+
// src/components/data-entry/input/input/base/Input.styles.ts
|
|
7286
|
+
var inputShapes = shapes;
|
|
7287
|
+
var inputRootClassName = "relative w-full";
|
|
7288
|
+
var inputFrameClassName = "relative h-14 w-full overflow-hidden border bg-white/95 px-3 dark:bg-eui-dark-800";
|
|
7289
|
+
var inputFrameIdleClassName = "border-gray-300 hover:border-gray-400 dark:border-eui-dark-300 dark:hover:border-eui-dark-200";
|
|
7290
|
+
var inputFrameActiveClassName = "border-eui-secondary-600";
|
|
7291
|
+
var inputFrameErrorClassName = "border-eui-danger-500";
|
|
7292
|
+
var inputFrameDisabledClassName = "cursor-not-allowed opacity-60";
|
|
7293
|
+
var inputControlClassName = "w-full bg-transparent pt-5 pb-2 text-base font-medium text-gray-950 dark:text-gray-50";
|
|
7294
|
+
|
|
7295
|
+
// src/components/data-entry/input/input/web/Input.web.styles.ts
|
|
7296
|
+
var webInputControlClassName = "placeholder-transparent outline-none transition-all duration-200 ease-out";
|
|
7297
|
+
var webPasswordToggleClassName = "absolute right-3 top-[18px] cursor-pointer text-xl text-eui-dark-200 transition-colors duration-180 hover:text-eui-secondary-700";
|
|
7298
|
+
function PasswordVisibilityToggler({
|
|
7299
|
+
passwordVisible,
|
|
7300
|
+
onToggle
|
|
7301
|
+
}) {
|
|
7124
7302
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7125
7303
|
"div",
|
|
7126
7304
|
{
|
|
7127
|
-
className:
|
|
7128
|
-
onClick: () =>
|
|
7129
|
-
children:
|
|
7305
|
+
className: webPasswordToggleClassName,
|
|
7306
|
+
onClick: () => onToggle(!passwordVisible),
|
|
7307
|
+
children: passwordVisible ? /* @__PURE__ */ jsxRuntime.jsx(index_js$2.FaEyeSlash, {}) : /* @__PURE__ */ jsxRuntime.jsx(index_js$2.FaEye, {})
|
|
7130
7308
|
}
|
|
7131
7309
|
);
|
|
7132
|
-
}
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
|
|
7136
|
-
|
|
7137
|
-
|
|
7138
|
-
|
|
7139
|
-
|
|
7140
|
-
|
|
7141
|
-
|
|
7142
|
-
|
|
7143
|
-
|
|
7144
|
-
|
|
7145
|
-
|
|
7146
|
-
|
|
7310
|
+
}
|
|
7311
|
+
function Input(inputProps) {
|
|
7312
|
+
const {
|
|
7313
|
+
type: type2 = "text",
|
|
7314
|
+
id: id2,
|
|
7315
|
+
label,
|
|
7316
|
+
placeholder,
|
|
7317
|
+
inputClassName,
|
|
7318
|
+
labelClassName,
|
|
7319
|
+
responseClassName,
|
|
7320
|
+
step,
|
|
7321
|
+
shape,
|
|
7322
|
+
disabled = false,
|
|
7323
|
+
className,
|
|
7324
|
+
onBlur,
|
|
7325
|
+
onFocus,
|
|
7326
|
+
...props
|
|
7327
|
+
} = inputProps;
|
|
7328
|
+
const { field, meta } = useInputFieldState(inputProps);
|
|
7329
|
+
const [focused, setFocused] = React26.useState(false);
|
|
7330
|
+
const [passwordVisible, setPasswordVisible] = React26.useState(false);
|
|
7331
|
+
const {
|
|
7332
|
+
shape: resolvedShape,
|
|
7333
|
+
type: resolvedType,
|
|
7334
|
+
label: resolvedLabel
|
|
7335
|
+
} = useResolvedInputConfig({
|
|
7336
|
+
label,
|
|
7337
|
+
placeholder,
|
|
7338
|
+
shape,
|
|
7339
|
+
type: type2
|
|
7340
|
+
});
|
|
7341
|
+
const inputType = resolveInputType({
|
|
7342
|
+
passwordVisible,
|
|
7343
|
+
type: resolvedType
|
|
7344
|
+
});
|
|
7345
|
+
const hasError = Boolean(meta.touched && meta.error);
|
|
7346
|
+
const hasValue = String(field.value ?? "").length > 0;
|
|
7347
|
+
const floating = focused || hasValue;
|
|
7348
|
+
const inputId = id2 ?? field.name;
|
|
7349
|
+
const handleBlur = (event) => {
|
|
7350
|
+
setFocused(false);
|
|
7351
|
+
field.onBlur(event);
|
|
7352
|
+
onBlur?.(event);
|
|
7353
|
+
};
|
|
7354
|
+
const handleFocus = (event) => {
|
|
7355
|
+
setFocused(true);
|
|
7356
|
+
onFocus?.(event);
|
|
7357
|
+
};
|
|
7358
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: inputRootClassName, children: [
|
|
7147
7359
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7148
7360
|
formik.Field,
|
|
7149
7361
|
{
|
|
7150
|
-
type: inputType,
|
|
7151
|
-
step: inputType === "number" && step ? step : void 0,
|
|
7152
|
-
...field,
|
|
7153
7362
|
...props,
|
|
7154
|
-
|
|
7155
|
-
|
|
7156
|
-
|
|
7157
|
-
|
|
7158
|
-
|
|
7159
|
-
|
|
7160
|
-
|
|
7161
|
-
|
|
7162
|
-
|
|
7363
|
+
...field,
|
|
7364
|
+
disabled,
|
|
7365
|
+
id: inputId,
|
|
7366
|
+
onBlur: handleBlur,
|
|
7367
|
+
onFocus: handleFocus,
|
|
7368
|
+
placeholder: "",
|
|
7369
|
+
step: inputType === "number" && step ? step : void 0,
|
|
7370
|
+
type: inputType,
|
|
7371
|
+
className: cn(
|
|
7372
|
+
inputFrameClassName,
|
|
7373
|
+
inputControlClassName,
|
|
7374
|
+
webInputControlClassName,
|
|
7375
|
+
hasError ? inputFrameErrorClassName : focused ? inputFrameActiveClassName : inputFrameIdleClassName,
|
|
7376
|
+
inputShapes[resolvedShape],
|
|
7377
|
+
disabled && inputFrameDisabledClassName,
|
|
7378
|
+
className,
|
|
7379
|
+
inputClassName
|
|
7380
|
+
)
|
|
7163
7381
|
}
|
|
7164
7382
|
),
|
|
7165
7383
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7166
|
-
|
|
7384
|
+
InputLabel,
|
|
7167
7385
|
{
|
|
7168
|
-
|
|
7169
|
-
|
|
7386
|
+
disabled,
|
|
7387
|
+
errored: hasError,
|
|
7388
|
+
floating,
|
|
7389
|
+
htmlFor: inputId,
|
|
7390
|
+
text: resolvedLabel,
|
|
7391
|
+
className: labelClassName
|
|
7170
7392
|
}
|
|
7171
7393
|
),
|
|
7172
|
-
type2 === "password"
|
|
7394
|
+
type2 === "password" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
7395
|
+
PasswordVisibilityToggler,
|
|
7396
|
+
{
|
|
7397
|
+
passwordVisible,
|
|
7398
|
+
onToggle: setPasswordVisible
|
|
7399
|
+
}
|
|
7400
|
+
) : null,
|
|
7173
7401
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7174
|
-
|
|
7402
|
+
InputResponse,
|
|
7175
7403
|
{
|
|
7176
7404
|
name: field.name,
|
|
7177
|
-
visibility:
|
|
7178
|
-
variant: "danger"
|
|
7405
|
+
visibility: hasError,
|
|
7406
|
+
variant: "danger",
|
|
7407
|
+
className: responseClassName
|
|
7179
7408
|
}
|
|
7180
7409
|
)
|
|
7181
7410
|
] });
|
|
7182
|
-
}
|
|
7411
|
+
}
|
|
7183
7412
|
var InputFile = ({
|
|
7184
7413
|
placeholder,
|
|
7185
7414
|
accept = "",
|
|
7186
|
-
|
|
7415
|
+
className,
|
|
7187
7416
|
...props
|
|
7188
7417
|
}) => {
|
|
7189
|
-
const fileInputRef =
|
|
7418
|
+
const fileInputRef = React26.useRef(null);
|
|
7190
7419
|
const [field, meta, helpers] = formik.useField(props);
|
|
7191
7420
|
const handleFileChange = (e) => {
|
|
7192
7421
|
const file = e.target.files?.[0] || null;
|
|
@@ -7197,13 +7426,13 @@ var InputFile = ({
|
|
|
7197
7426
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7198
7427
|
"div",
|
|
7199
7428
|
{
|
|
7200
|
-
className:
|
|
7429
|
+
className: classNames74__default.default(
|
|
7201
7430
|
"border rounded-sm bg-eui-primary-300/10 px-3 pt-3 text-md text-eui-dark-100 cursor-pointer h-[50px] flex items-center",
|
|
7202
7431
|
{
|
|
7203
7432
|
"border-eui-primary-400 focus:border-eui-secondary-500": !(meta.touched && meta.error),
|
|
7204
7433
|
"border-eui-danger-500": meta.touched && meta.error
|
|
7205
7434
|
},
|
|
7206
|
-
|
|
7435
|
+
className
|
|
7207
7436
|
),
|
|
7208
7437
|
onClick: () => fileInputRef.current?.click(),
|
|
7209
7438
|
children: field.value?.name || ""
|
|
@@ -7220,10 +7449,10 @@ var InputFile = ({
|
|
|
7220
7449
|
}
|
|
7221
7450
|
),
|
|
7222
7451
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7223
|
-
|
|
7452
|
+
InputLabel,
|
|
7224
7453
|
{
|
|
7225
7454
|
text: placeholder,
|
|
7226
|
-
|
|
7455
|
+
className: classNames74__default.default({
|
|
7227
7456
|
"absolute left-2 eui-text-sm peer-placeholder-shown:text-base peer-placeholder-shown:top-3 pointer-events-none": true,
|
|
7228
7457
|
"top-[0.7px]": showFloatingLabel,
|
|
7229
7458
|
"top-[13px] text-base": !showFloatingLabel
|
|
@@ -7231,7 +7460,7 @@ var InputFile = ({
|
|
|
7231
7460
|
}
|
|
7232
7461
|
),
|
|
7233
7462
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7234
|
-
|
|
7463
|
+
InputResponse,
|
|
7235
7464
|
{
|
|
7236
7465
|
name: field.name,
|
|
7237
7466
|
visibility: meta.touched && meta.error ? true : false,
|
|
@@ -7272,11 +7501,11 @@ var InputList = ({ name: name2, placeholder, shape }) => {
|
|
|
7272
7501
|
const fieldErrors = errors[name2];
|
|
7273
7502
|
const hasListError = Boolean(errors[name2]) && Boolean(touched[name2]) && typeof errors[name2] === "string";
|
|
7274
7503
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
7275
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7504
|
+
/* @__PURE__ */ jsxRuntime.jsx(InputLabel, { text: placeholder }),
|
|
7276
7505
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsxRuntime.jsx(formik.FieldArray, { name: name2, children: ({ push: push2, remove: remove2, move }) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7277
7506
|
"div",
|
|
7278
7507
|
{
|
|
7279
|
-
className:
|
|
7508
|
+
className: classNames74__default.default(
|
|
7280
7509
|
"flex w-full flex-col space-y-2 bg-eui-primary-300/10",
|
|
7281
7510
|
shapes[resolvedShape]
|
|
7282
7511
|
),
|
|
@@ -7305,7 +7534,7 @@ var InputList = ({ name: name2, placeholder, shape }) => {
|
|
|
7305
7534
|
ref: provided2.innerRef,
|
|
7306
7535
|
...draggableProps,
|
|
7307
7536
|
style: draggableStyle,
|
|
7308
|
-
className:
|
|
7537
|
+
className: classNames74__default.default(
|
|
7309
7538
|
"flex items-center space-x-2 bg-eui-primary-300/10 p-2",
|
|
7310
7539
|
shapes[resolvedShape]
|
|
7311
7540
|
),
|
|
@@ -7316,7 +7545,7 @@ var InputList = ({ name: name2, placeholder, shape }) => {
|
|
|
7316
7545
|
{
|
|
7317
7546
|
name: `${name2}[${index3}]`,
|
|
7318
7547
|
placeholder: `Item ${index3 + 1}`,
|
|
7319
|
-
className:
|
|
7548
|
+
className: classNames74__default.default(
|
|
7320
7549
|
"peer h-[50px] w-full border bg-eui-primary-300/10 px-3 pb-2 pt-5 text-md placeholder-transparent placeholder-shown:p-3 focus:outline-none eui-text-md",
|
|
7321
7550
|
shapes[resolvedShape],
|
|
7322
7551
|
hasItemError ? "border-eui-danger-500" : "border-eui-primary-400 focus:border-eui-secondary-500"
|
|
@@ -7356,12 +7585,12 @@ var InputList = ({ name: name2, placeholder, shape }) => {
|
|
|
7356
7585
|
}
|
|
7357
7586
|
),
|
|
7358
7587
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7359
|
-
|
|
7588
|
+
InputResponse,
|
|
7360
7589
|
{
|
|
7361
7590
|
name: name2,
|
|
7362
7591
|
visibility: hasListError,
|
|
7363
7592
|
variant: "danger",
|
|
7364
|
-
|
|
7593
|
+
className: "pb-2"
|
|
7365
7594
|
}
|
|
7366
7595
|
)
|
|
7367
7596
|
]
|
|
@@ -7404,7 +7633,7 @@ var InputListGroup = ({
|
|
|
7404
7633
|
const groups = values[name2] ?? [];
|
|
7405
7634
|
const hasError = Boolean(errors[name2]) && Boolean(touched[name2]) && typeof errors[name2] === "string";
|
|
7406
7635
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col space-y-2", children: [
|
|
7407
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7636
|
+
/* @__PURE__ */ jsxRuntime.jsx(InputLabel, { text: placeholder }),
|
|
7408
7637
|
/* @__PURE__ */ jsxRuntime.jsx(formik.FieldArray, { name: name2, children: ({ push: push2, remove: remove2 }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
|
|
7409
7638
|
groups.map((group, groupIndex) => {
|
|
7410
7639
|
const itemsFieldName = `${name2}[${groupIndex}].items`;
|
|
@@ -7412,7 +7641,7 @@ var InputListGroup = ({
|
|
|
7412
7641
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7413
7642
|
"div",
|
|
7414
7643
|
{
|
|
7415
|
-
className:
|
|
7644
|
+
className: classNames74__default.default(
|
|
7416
7645
|
"flex flex-col gap-2 bg-eui-primary-300/10 p-3",
|
|
7417
7646
|
shapes[resolvedShape]
|
|
7418
7647
|
),
|
|
@@ -7424,7 +7653,7 @@ var InputListGroup = ({
|
|
|
7424
7653
|
{
|
|
7425
7654
|
name: `${name2}[${groupIndex}].name`,
|
|
7426
7655
|
placeholder: `Group ${groupIndex + 1}`,
|
|
7427
|
-
className:
|
|
7656
|
+
className: classNames74__default.default(
|
|
7428
7657
|
"h-[40px] w-full border bg-eui-primary-300/10 px-3 py-2 text-md focus:outline-none",
|
|
7429
7658
|
shapes[resolvedShape],
|
|
7430
7659
|
"border-eui-primary-400 focus:border-eui-secondary-500"
|
|
@@ -7455,7 +7684,7 @@ var InputListGroup = ({
|
|
|
7455
7684
|
{
|
|
7456
7685
|
ref: provided.innerRef,
|
|
7457
7686
|
...provided.droppableProps,
|
|
7458
|
-
className:
|
|
7687
|
+
className: classNames74__default.default(
|
|
7459
7688
|
"space-y-2 bg-eui-primary-300/10 p-2",
|
|
7460
7689
|
shapes[resolvedShape]
|
|
7461
7690
|
),
|
|
@@ -7475,7 +7704,7 @@ var InputListGroup = ({
|
|
|
7475
7704
|
ref: provided2.innerRef,
|
|
7476
7705
|
...draggableProps,
|
|
7477
7706
|
style: draggableStyle,
|
|
7478
|
-
className:
|
|
7707
|
+
className: classNames74__default.default(
|
|
7479
7708
|
"flex items-center gap-2 bg-eui-primary-300/10 p-2",
|
|
7480
7709
|
shapes[resolvedShape]
|
|
7481
7710
|
),
|
|
@@ -7486,7 +7715,7 @@ var InputListGroup = ({
|
|
|
7486
7715
|
{
|
|
7487
7716
|
name: `${itemsFieldName}[${itemIndex}]`,
|
|
7488
7717
|
placeholder: `Item ${itemIndex + 1}`,
|
|
7489
|
-
className:
|
|
7718
|
+
className: classNames74__default.default(
|
|
7490
7719
|
"h-[40px] w-full border bg-eui-primary-300/10 px-3 py-2 text-md focus:outline-none",
|
|
7491
7720
|
shapes[resolvedShape],
|
|
7492
7721
|
"border-eui-primary-400 focus:border-eui-secondary-500"
|
|
@@ -7545,12 +7774,12 @@ var InputListGroup = ({
|
|
|
7545
7774
|
}
|
|
7546
7775
|
),
|
|
7547
7776
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7548
|
-
|
|
7777
|
+
InputResponse,
|
|
7549
7778
|
{
|
|
7550
7779
|
name: name2,
|
|
7551
7780
|
visibility: hasError,
|
|
7552
7781
|
variant: "danger",
|
|
7553
|
-
|
|
7782
|
+
className: "pb-2"
|
|
7554
7783
|
}
|
|
7555
7784
|
)
|
|
7556
7785
|
] }) })
|
|
@@ -7559,13 +7788,20 @@ var InputListGroup = ({
|
|
|
7559
7788
|
function isMultiCheckbox(props) {
|
|
7560
7789
|
return Array.isArray(props.options);
|
|
7561
7790
|
}
|
|
7562
|
-
function
|
|
7791
|
+
function useResolvedCheckboxConfig({
|
|
7792
|
+
label,
|
|
7563
7793
|
placeholder,
|
|
7564
|
-
variant
|
|
7565
|
-
shape
|
|
7566
|
-
className,
|
|
7567
|
-
...props
|
|
7794
|
+
variant,
|
|
7795
|
+
shape
|
|
7568
7796
|
}) {
|
|
7797
|
+
const eui = useEUIConfig();
|
|
7798
|
+
return {
|
|
7799
|
+
shape: shape ?? eui?.config?.global?.shape ?? "roundedSquare",
|
|
7800
|
+
variant: variant ?? "secondary",
|
|
7801
|
+
label: label ?? placeholder
|
|
7802
|
+
};
|
|
7803
|
+
}
|
|
7804
|
+
function useCheckboxFieldState(props) {
|
|
7569
7805
|
const isMulti = isMultiCheckbox(props);
|
|
7570
7806
|
const [multiField, multiMeta, multiHelpers] = formik.useField(
|
|
7571
7807
|
props
|
|
@@ -7573,89 +7809,234 @@ function Checkbox({
|
|
|
7573
7809
|
const [singleField, singleMeta, singleHelpers] = formik.useField(
|
|
7574
7810
|
props
|
|
7575
7811
|
);
|
|
7576
|
-
|
|
7577
|
-
|
|
7578
|
-
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
|
|
7582
|
-
|
|
7583
|
-
|
|
7584
|
-
|
|
7585
|
-
|
|
7586
|
-
|
|
7587
|
-
|
|
7588
|
-
|
|
7589
|
-
|
|
7590
|
-
|
|
7591
|
-
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
|
|
7596
|
-
|
|
7597
|
-
|
|
7598
|
-
"checked:
|
|
7599
|
-
"
|
|
7600
|
-
|
|
7601
|
-
|
|
7602
|
-
|
|
7603
|
-
|
|
7604
|
-
|
|
7812
|
+
return {
|
|
7813
|
+
isMulti,
|
|
7814
|
+
multiField,
|
|
7815
|
+
multiMeta,
|
|
7816
|
+
multiHelpers,
|
|
7817
|
+
singleField,
|
|
7818
|
+
singleMeta,
|
|
7819
|
+
singleHelpers
|
|
7820
|
+
};
|
|
7821
|
+
}
|
|
7822
|
+
|
|
7823
|
+
// src/components/data-entry/checkbox/base/Checkbox.styles.ts
|
|
7824
|
+
var checkboxShapes = shapes;
|
|
7825
|
+
var checkboxGroupClassName = "flex flex-col gap-2";
|
|
7826
|
+
var checkboxOptionRowClassName = "flex flex-row items-start gap-3";
|
|
7827
|
+
var checkboxLabelClassName = "cursor-pointer select-none text-sm leading-relaxed text-gray-800 dark:text-gray-200";
|
|
7828
|
+
var checkboxIndicatorBaseClassName = "relative h-5 w-5 min-h-[1.25rem] min-w-[1.25rem] shrink-0 appearance-none border-2 border-gray-300 bg-white transition-all duration-300 hover:border-gray-400 focus:outline-none focus:ring-2 focus:ring-eui-primary-500/30 dark:border-neutral-600 dark:bg-neutral-900 dark:hover:border-neutral-500";
|
|
7829
|
+
var checkboxIndicatorDisabledClassName = "cursor-not-allowed opacity-50";
|
|
7830
|
+
|
|
7831
|
+
// src/components/data-entry/checkbox/web/Checkbox.web.styles.ts
|
|
7832
|
+
var webCheckboxVariants = {
|
|
7833
|
+
default: {
|
|
7834
|
+
checkedClassName: "checked:bg-eui-secondary-600 checked:border-eui-secondary-600 dark:checked:bg-eui-secondary-500 dark:checked:border-eui-secondary-500",
|
|
7835
|
+
iconClassName: "text-white"
|
|
7836
|
+
},
|
|
7837
|
+
primary: {
|
|
7838
|
+
checkedClassName: "checked:bg-eui-primary-600 checked:border-eui-primary-600 dark:checked:bg-eui-primary-500 dark:checked:border-eui-primary-500",
|
|
7839
|
+
iconClassName: "text-white"
|
|
7840
|
+
},
|
|
7841
|
+
secondary: {
|
|
7842
|
+
checkedClassName: "checked:bg-eui-secondary-600 checked:border-eui-secondary-600 dark:checked:bg-eui-secondary-500 dark:checked:border-eui-secondary-500",
|
|
7843
|
+
iconClassName: "text-white"
|
|
7844
|
+
},
|
|
7845
|
+
success: {
|
|
7846
|
+
checkedClassName: "checked:bg-eui-success-600 checked:border-eui-success-600 dark:checked:bg-eui-success-500 dark:checked:border-eui-success-500",
|
|
7847
|
+
iconClassName: "text-white"
|
|
7848
|
+
},
|
|
7849
|
+
danger: {
|
|
7850
|
+
checkedClassName: "checked:bg-eui-danger-600 checked:border-eui-danger-600 dark:checked:bg-eui-danger-500 dark:checked:border-eui-danger-500",
|
|
7851
|
+
iconClassName: "text-white"
|
|
7852
|
+
},
|
|
7853
|
+
warning: {
|
|
7854
|
+
checkedClassName: "checked:bg-eui-warning-500 checked:border-eui-warning-500 dark:checked:bg-eui-warning-400 dark:checked:border-eui-warning-400",
|
|
7855
|
+
iconClassName: "text-black"
|
|
7856
|
+
},
|
|
7857
|
+
info: {
|
|
7858
|
+
checkedClassName: "checked:bg-eui-info-600 checked:border-eui-info-600 dark:checked:bg-eui-info-500 dark:checked:border-eui-info-500",
|
|
7859
|
+
iconClassName: "text-white"
|
|
7860
|
+
},
|
|
7861
|
+
light: {
|
|
7862
|
+
checkedClassName: "checked:bg-eui-light-400 checked:border-eui-light-400 dark:checked:bg-gray-200 dark:checked:border-gray-200",
|
|
7863
|
+
iconClassName: "text-gray-900"
|
|
7864
|
+
},
|
|
7865
|
+
dark: {
|
|
7866
|
+
checkedClassName: "checked:bg-eui-dark-500 checked:border-eui-dark-500 dark:checked:bg-eui-dark-300 dark:checked:border-eui-dark-300",
|
|
7867
|
+
iconClassName: "text-white"
|
|
7868
|
+
}
|
|
7869
|
+
};
|
|
7870
|
+
function resolveWebCheckboxVariantStyles(variant) {
|
|
7871
|
+
return webCheckboxVariants[variant];
|
|
7872
|
+
}
|
|
7873
|
+
function getIndicatorClassName({
|
|
7874
|
+
checked,
|
|
7875
|
+
className,
|
|
7876
|
+
disabled,
|
|
7877
|
+
indicatorClassName,
|
|
7878
|
+
checkedIndicatorClassName,
|
|
7879
|
+
resolvedShape,
|
|
7880
|
+
variantCheckedClassName
|
|
7881
|
+
}) {
|
|
7882
|
+
return cn(
|
|
7883
|
+
checkboxIndicatorBaseClassName,
|
|
7884
|
+
checkboxShapes[resolvedShape],
|
|
7885
|
+
indicatorClassName,
|
|
7886
|
+
className,
|
|
7887
|
+
variantCheckedClassName,
|
|
7888
|
+
checked && checkedIndicatorClassName,
|
|
7889
|
+
disabled && checkboxIndicatorDisabledClassName
|
|
7605
7890
|
);
|
|
7606
|
-
|
|
7607
|
-
|
|
7608
|
-
|
|
7609
|
-
|
|
7610
|
-
|
|
7611
|
-
|
|
7612
|
-
|
|
7613
|
-
|
|
7614
|
-
|
|
7615
|
-
|
|
7616
|
-
|
|
7891
|
+
}
|
|
7892
|
+
function Tick({
|
|
7893
|
+
checked,
|
|
7894
|
+
checkedIconClassName,
|
|
7895
|
+
iconClassName
|
|
7896
|
+
}) {
|
|
7897
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7898
|
+
"span",
|
|
7899
|
+
{
|
|
7900
|
+
"aria-hidden": "true",
|
|
7901
|
+
className: cn(
|
|
7902
|
+
"pointer-events-none absolute inset-0 inline-flex items-center justify-center text-sm font-bold leading-none transition-opacity duration-200",
|
|
7903
|
+
iconClassName,
|
|
7904
|
+
checkedIconClassName,
|
|
7905
|
+
checked ? "opacity-100" : "opacity-0"
|
|
7617
7906
|
),
|
|
7618
|
-
|
|
7907
|
+
children: "\u2713"
|
|
7908
|
+
}
|
|
7909
|
+
);
|
|
7910
|
+
}
|
|
7911
|
+
function Checkbox(checkboxProps) {
|
|
7912
|
+
const {
|
|
7913
|
+
label,
|
|
7914
|
+
placeholder,
|
|
7915
|
+
variant,
|
|
7916
|
+
shape,
|
|
7917
|
+
disabled = false,
|
|
7918
|
+
className,
|
|
7919
|
+
groupClassName,
|
|
7920
|
+
optionClassName,
|
|
7921
|
+
indicatorClassName,
|
|
7922
|
+
checkedIndicatorClassName,
|
|
7923
|
+
checkedIconClassName,
|
|
7924
|
+
labelClassName
|
|
7925
|
+
} = checkboxProps;
|
|
7926
|
+
const { shape: resolvedShape, variant: resolvedVariant, label: resolvedLabel } = useResolvedCheckboxConfig({
|
|
7927
|
+
label,
|
|
7928
|
+
placeholder,
|
|
7929
|
+
variant,
|
|
7930
|
+
shape
|
|
7931
|
+
});
|
|
7932
|
+
const {
|
|
7933
|
+
isMulti,
|
|
7934
|
+
multiField,
|
|
7935
|
+
multiMeta,
|
|
7936
|
+
multiHelpers,
|
|
7937
|
+
singleField,
|
|
7938
|
+
singleMeta,
|
|
7939
|
+
singleHelpers
|
|
7940
|
+
} = useCheckboxFieldState(checkboxProps);
|
|
7941
|
+
const variantStyles = resolveWebCheckboxVariantStyles(resolvedVariant);
|
|
7942
|
+
const activeFieldName = isMulti ? multiField.name : singleField.name;
|
|
7943
|
+
const activeMeta = isMulti ? multiMeta : singleMeta;
|
|
7944
|
+
const multiProps = isMultiCheckbox(checkboxProps) ? checkboxProps : null;
|
|
7945
|
+
const singleChecked = singleField.value;
|
|
7946
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(checkboxGroupClassName, groupClassName), children: [
|
|
7947
|
+
!isMulti && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(checkboxOptionRowClassName, optionClassName), children: [
|
|
7948
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "relative inline-flex h-5 w-5 shrink-0 items-center justify-center", children: [
|
|
7949
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7950
|
+
"input",
|
|
7951
|
+
{
|
|
7952
|
+
id: singleField.name,
|
|
7953
|
+
name: singleField.name,
|
|
7954
|
+
type: "checkbox",
|
|
7955
|
+
checked: singleChecked,
|
|
7956
|
+
disabled,
|
|
7957
|
+
onBlur: singleField.onBlur,
|
|
7958
|
+
onChange: (event) => singleHelpers.setValue(event.target.checked),
|
|
7959
|
+
className: getIndicatorClassName({
|
|
7960
|
+
checked: singleChecked,
|
|
7961
|
+
className,
|
|
7962
|
+
disabled,
|
|
7963
|
+
indicatorClassName,
|
|
7964
|
+
checkedIndicatorClassName,
|
|
7965
|
+
resolvedShape,
|
|
7966
|
+
variantCheckedClassName: variantStyles.checkedClassName
|
|
7967
|
+
})
|
|
7968
|
+
}
|
|
7969
|
+
),
|
|
7970
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7971
|
+
Tick,
|
|
7972
|
+
{
|
|
7973
|
+
checked: singleChecked,
|
|
7974
|
+
checkedIconClassName,
|
|
7975
|
+
iconClassName: variantStyles.iconClassName
|
|
7976
|
+
}
|
|
7977
|
+
)
|
|
7978
|
+
] }),
|
|
7979
|
+
resolvedLabel ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
7619
7980
|
"label",
|
|
7620
7981
|
{
|
|
7621
7982
|
htmlFor: singleField.name,
|
|
7622
|
-
className: cn(
|
|
7623
|
-
|
|
7624
|
-
"text-gray-800 dark:text-gray-200"
|
|
7625
|
-
),
|
|
7626
|
-
children: placeholder
|
|
7983
|
+
className: cn(checkboxLabelClassName, labelClassName),
|
|
7984
|
+
children: resolvedLabel
|
|
7627
7985
|
}
|
|
7628
|
-
)
|
|
7986
|
+
) : null
|
|
7629
7987
|
] }),
|
|
7630
|
-
isMulti &&
|
|
7988
|
+
isMulti && multiProps?.options.map((option) => {
|
|
7631
7989
|
const values = multiField.value ?? [];
|
|
7632
7990
|
const checked = values.includes(option.value);
|
|
7991
|
+
const optionDisabled = disabled || option.disabled === true;
|
|
7633
7992
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7634
7993
|
"div",
|
|
7635
7994
|
{
|
|
7636
|
-
className:
|
|
7995
|
+
className: cn(checkboxOptionRowClassName, optionClassName),
|
|
7637
7996
|
children: [
|
|
7638
|
-
/* @__PURE__ */ jsxRuntime.
|
|
7639
|
-
|
|
7640
|
-
|
|
7641
|
-
|
|
7642
|
-
|
|
7643
|
-
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7997
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "relative inline-flex h-5 w-5 shrink-0 items-center justify-center", children: [
|
|
7998
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7999
|
+
"input",
|
|
8000
|
+
{
|
|
8001
|
+
id: option.value,
|
|
8002
|
+
name: multiField.name,
|
|
8003
|
+
type: "checkbox",
|
|
8004
|
+
checked,
|
|
8005
|
+
disabled: optionDisabled,
|
|
8006
|
+
onBlur: multiField.onBlur,
|
|
8007
|
+
onChange: () => {
|
|
8008
|
+
multiHelpers.setValue(
|
|
8009
|
+
checked ? values.filter((value) => value !== option.value) : [...values, option.value]
|
|
8010
|
+
);
|
|
8011
|
+
},
|
|
8012
|
+
className: getIndicatorClassName({
|
|
8013
|
+
checked,
|
|
8014
|
+
className,
|
|
8015
|
+
disabled: optionDisabled,
|
|
8016
|
+
indicatorClassName,
|
|
8017
|
+
checkedIndicatorClassName,
|
|
8018
|
+
resolvedShape,
|
|
8019
|
+
variantCheckedClassName: variantStyles.checkedClassName
|
|
8020
|
+
})
|
|
8021
|
+
}
|
|
8022
|
+
),
|
|
8023
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8024
|
+
Tick,
|
|
8025
|
+
{
|
|
8026
|
+
checked,
|
|
8027
|
+
checkedIconClassName,
|
|
8028
|
+
iconClassName: variantStyles.iconClassName
|
|
8029
|
+
}
|
|
8030
|
+
)
|
|
8031
|
+
] }),
|
|
7652
8032
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7653
8033
|
"label",
|
|
7654
8034
|
{
|
|
7655
8035
|
htmlFor: option.value,
|
|
7656
8036
|
className: cn(
|
|
7657
|
-
|
|
7658
|
-
"
|
|
8037
|
+
checkboxLabelClassName,
|
|
8038
|
+
optionDisabled && "cursor-not-allowed opacity-60",
|
|
8039
|
+
labelClassName
|
|
7659
8040
|
),
|
|
7660
8041
|
children: option.label
|
|
7661
8042
|
}
|
|
@@ -7666,16 +8047,15 @@ function Checkbox({
|
|
|
7666
8047
|
);
|
|
7667
8048
|
}),
|
|
7668
8049
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7669
|
-
|
|
8050
|
+
InputResponse,
|
|
7670
8051
|
{
|
|
7671
|
-
name:
|
|
7672
|
-
visibility: Boolean(
|
|
8052
|
+
name: activeFieldName,
|
|
8053
|
+
visibility: Boolean(activeMeta.touched && activeMeta.error),
|
|
7673
8054
|
variant: "danger"
|
|
7674
8055
|
}
|
|
7675
8056
|
)
|
|
7676
8057
|
] });
|
|
7677
8058
|
}
|
|
7678
|
-
var Checkbox_default = Checkbox;
|
|
7679
8059
|
var DateSelector = ({
|
|
7680
8060
|
placeholder,
|
|
7681
8061
|
styles,
|
|
@@ -7687,10 +8067,10 @@ var DateSelector = ({
|
|
|
7687
8067
|
const [field, meta] = formik.useField(props);
|
|
7688
8068
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative w-full", children: [
|
|
7689
8069
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7690
|
-
|
|
8070
|
+
InputLabel,
|
|
7691
8071
|
{
|
|
7692
8072
|
text: placeholder,
|
|
7693
|
-
|
|
8073
|
+
className: "absolute left-2 top-[0.7px] peer-placeholder-shown:text-base peer-placeholder-shown:top-3"
|
|
7694
8074
|
}
|
|
7695
8075
|
),
|
|
7696
8076
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7700,7 +8080,7 @@ var DateSelector = ({
|
|
|
7700
8080
|
...field,
|
|
7701
8081
|
...props,
|
|
7702
8082
|
placeholder,
|
|
7703
|
-
className:
|
|
8083
|
+
className: classNames74__default.default({
|
|
7704
8084
|
"border border-eui-primary-400 peer w-full bg-eui-primary-300/10 pt-5 px-3 pb-2 text-md eui-text-md placeholder-transparent placeholder-shown:p-3 focus:border-eui-secondary-500 focus:outline-none h-[50px]": true,
|
|
7705
8085
|
"border-eui-danger-500": meta.touched && meta.error,
|
|
7706
8086
|
"transition-all ease-in-out": true,
|
|
@@ -7709,13 +8089,13 @@ var DateSelector = ({
|
|
|
7709
8089
|
})
|
|
7710
8090
|
}
|
|
7711
8091
|
),
|
|
7712
|
-
meta.touched && meta.error && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8092
|
+
meta.touched && meta.error && /* @__PURE__ */ jsxRuntime.jsx(InputResponse, { name: field.name, visibility: true, variant: "danger" })
|
|
7713
8093
|
] });
|
|
7714
8094
|
};
|
|
7715
8095
|
var DateSelector_default = DateSelector;
|
|
7716
8096
|
var FormObserver = ({ formik, onChange }) => {
|
|
7717
|
-
const prevValuesRef =
|
|
7718
|
-
|
|
8097
|
+
const prevValuesRef = React26.useRef(formik.values);
|
|
8098
|
+
React26.useEffect(() => {
|
|
7719
8099
|
if (!onChange) return;
|
|
7720
8100
|
const currentValues = formik.values;
|
|
7721
8101
|
const prevValues = prevValuesRef.current;
|
|
@@ -7734,7 +8114,7 @@ var FormObserver = ({ formik, onChange }) => {
|
|
|
7734
8114
|
};
|
|
7735
8115
|
var FormObserver_default = FormObserver;
|
|
7736
8116
|
var DirtyObserver = ({ formik, onDirtyChange }) => {
|
|
7737
|
-
|
|
8117
|
+
React26.useEffect(() => {
|
|
7738
8118
|
if (onDirtyChange) {
|
|
7739
8119
|
onDirtyChange(formik.dirty);
|
|
7740
8120
|
}
|
|
@@ -7743,7 +8123,7 @@ var DirtyObserver = ({ formik, onDirtyChange }) => {
|
|
|
7743
8123
|
};
|
|
7744
8124
|
var DirtyObserver_default = DirtyObserver;
|
|
7745
8125
|
var UnsavedChangesGuard = ({ formik, enabled }) => {
|
|
7746
|
-
|
|
8126
|
+
React26.useEffect(() => {
|
|
7747
8127
|
if (!enabled) return;
|
|
7748
8128
|
const handleBeforeUnload = (e) => {
|
|
7749
8129
|
if (!formik.dirty) return;
|
|
@@ -7782,12 +8162,12 @@ var Form = ({
|
|
|
7782
8162
|
/* @__PURE__ */ jsxRuntime.jsx(UnsavedChangesGuard_default, { formik: formik$1, enabled: warnOnUnsavedChanges }),
|
|
7783
8163
|
/* @__PURE__ */ jsxRuntime.jsx(DirtyObserver_default, { formik: formik$1, onDirtyChange }),
|
|
7784
8164
|
/* @__PURE__ */ jsxRuntime.jsx(FormObserver_default, { formik: formik$1, onChange }),
|
|
7785
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
8165
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames74__default.default(styles), children: children3 })
|
|
7786
8166
|
] })
|
|
7787
8167
|
}
|
|
7788
8168
|
);
|
|
7789
8169
|
};
|
|
7790
|
-
var
|
|
8170
|
+
var sizes = {
|
|
7791
8171
|
xs: "px-2 py-1 text-xs",
|
|
7792
8172
|
sm: "px-3 py-2 text-sm",
|
|
7793
8173
|
md: "px-4 py-2 text-base",
|
|
@@ -7804,11 +8184,11 @@ function FormResponse({
|
|
|
7804
8184
|
return /* @__PURE__ */ jsxRuntime.jsx(Transition.TransitionDropdown, { visibility: text10 ? true : false, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
7805
8185
|
"div",
|
|
7806
8186
|
{
|
|
7807
|
-
className:
|
|
8187
|
+
className: classNames74__default.default({
|
|
7808
8188
|
"font-poppins font-light text-sm": true,
|
|
7809
8189
|
[`${variantsLite[variant]}`]: variant,
|
|
7810
8190
|
[`${shapes[shape]}`]: shape,
|
|
7811
|
-
[`${
|
|
8191
|
+
[`${sizes[size]}`]: size,
|
|
7812
8192
|
[`${styles}`]: styles
|
|
7813
8193
|
}),
|
|
7814
8194
|
children: text10
|
|
@@ -7829,7 +8209,7 @@ function ImageView({ imageUrl, secure = true, alt = "image" }) {
|
|
|
7829
8209
|
) }) });
|
|
7830
8210
|
}
|
|
7831
8211
|
var ImageView_default = ImageView;
|
|
7832
|
-
var ImageInput =
|
|
8212
|
+
var ImageInput = React26.forwardRef(
|
|
7833
8213
|
({
|
|
7834
8214
|
title = "Upload Image",
|
|
7835
8215
|
uploadDir = "eg-frontend-admin-temp",
|
|
@@ -7841,10 +8221,10 @@ var ImageInput = React25.forwardRef(
|
|
|
7841
8221
|
const [field, meta, helpers] = formik.useField(props);
|
|
7842
8222
|
const { value: imageUrl } = field;
|
|
7843
8223
|
const { setValue } = helpers;
|
|
7844
|
-
const [image3, setImage] =
|
|
7845
|
-
const [url, setUrl] =
|
|
7846
|
-
const [loading, setLoading] =
|
|
7847
|
-
const [preview, setPreview] =
|
|
8224
|
+
const [image3, setImage] = React26.useState(null);
|
|
8225
|
+
const [url, setUrl] = React26.useState(imageUrl);
|
|
8226
|
+
const [loading, setLoading] = React26.useState(false);
|
|
8227
|
+
const [preview, setPreview] = React26.useState(null);
|
|
7848
8228
|
const uploadImage = async () => {
|
|
7849
8229
|
if (!image3) return;
|
|
7850
8230
|
setLoading(true);
|
|
@@ -7890,10 +8270,10 @@ var ImageInput = React25.forwardRef(
|
|
|
7890
8270
|
if (!disableSetValue) setValue("");
|
|
7891
8271
|
setLoading(false);
|
|
7892
8272
|
};
|
|
7893
|
-
|
|
8273
|
+
React26.useImperativeHandle(ref, () => ({
|
|
7894
8274
|
handleResetClick
|
|
7895
8275
|
}));
|
|
7896
|
-
|
|
8276
|
+
React26.useEffect(() => {
|
|
7897
8277
|
if (!disableSetValue) setValue(url);
|
|
7898
8278
|
}, [url, setValue, disableSetValue]);
|
|
7899
8279
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full", children: [
|
|
@@ -7912,7 +8292,7 @@ var ImageInput = React25.forwardRef(
|
|
|
7912
8292
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7913
8293
|
"label",
|
|
7914
8294
|
{
|
|
7915
|
-
className:
|
|
8295
|
+
className: classNames74__default.default({
|
|
7916
8296
|
"border-2 border-dashed border-gray-700 bg-gray-900 h-[200px] w-[300px] flex flex-col gap-2 items-center justify-center group": true,
|
|
7917
8297
|
"hover:cursor-pointer hover:border-solid hover:border-gray-600 hover:bg-gray-900/80": true,
|
|
7918
8298
|
"transition-all ease-in-out duration-150": true
|
|
@@ -7959,7 +8339,7 @@ var ImageInput = React25.forwardRef(
|
|
|
7959
8339
|
] })
|
|
7960
8340
|
] }) }),
|
|
7961
8341
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7962
|
-
|
|
8342
|
+
InputResponse,
|
|
7963
8343
|
{
|
|
7964
8344
|
name: field.name,
|
|
7965
8345
|
visibility: meta.touched && meta.error ? true : false,
|
|
@@ -7978,14 +8358,14 @@ function MultiImageInput({
|
|
|
7978
8358
|
const [field, meta, helpers] = formik.useField(props);
|
|
7979
8359
|
const { value: imageUrls } = field;
|
|
7980
8360
|
const { setValue } = helpers;
|
|
7981
|
-
const imageInputRef =
|
|
8361
|
+
const imageInputRef = React26.useRef(null);
|
|
7982
8362
|
const onValueChanged = (url) => {
|
|
7983
8363
|
setValue([...imageUrls, url]);
|
|
7984
8364
|
if (imageInputRef.current) {
|
|
7985
8365
|
imageInputRef.current.handleResetClick();
|
|
7986
8366
|
}
|
|
7987
8367
|
};
|
|
7988
|
-
|
|
8368
|
+
React26.useEffect(() => {
|
|
7989
8369
|
}, [imageUrls]);
|
|
7990
8370
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
7991
8371
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row flex-wrap gap-5 w-ful", children: [
|
|
@@ -8004,7 +8384,7 @@ function MultiImageInput({
|
|
|
8004
8384
|
) })
|
|
8005
8385
|
] }),
|
|
8006
8386
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8007
|
-
|
|
8387
|
+
InputResponse,
|
|
8008
8388
|
{
|
|
8009
8389
|
name: field.name,
|
|
8010
8390
|
visibility: meta.touched && meta.error ? true : false,
|
|
@@ -8022,14 +8402,14 @@ function Radio({
|
|
|
8022
8402
|
const { name: name2 } = props;
|
|
8023
8403
|
const [field, meta] = formik.useField(props);
|
|
8024
8404
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
8025
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8405
|
+
/* @__PURE__ */ jsxRuntime.jsx(InputLabel, { text: placeholder }),
|
|
8026
8406
|
/* @__PURE__ */ jsxRuntime.jsx(formik.Field, { name: name2, children: (formik) => {
|
|
8027
8407
|
const { field: field2 } = formik;
|
|
8028
8408
|
return options.map((option) => {
|
|
8029
8409
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8030
8410
|
"div",
|
|
8031
8411
|
{
|
|
8032
|
-
className:
|
|
8412
|
+
className: classNames74__default.default({
|
|
8033
8413
|
"flex flex-row gap-2 items-center mx-1 my-2": true
|
|
8034
8414
|
}),
|
|
8035
8415
|
children: [
|
|
@@ -8042,7 +8422,7 @@ function Radio({
|
|
|
8042
8422
|
...props,
|
|
8043
8423
|
value: option.value,
|
|
8044
8424
|
checked: field2.value === option.value,
|
|
8045
|
-
className:
|
|
8425
|
+
className: classNames74__default.default({
|
|
8046
8426
|
"appearance-none w-4 h-4 border-2 border-eui-primary-400 rounded-full cursor-pointer transition-all duration-300": true,
|
|
8047
8427
|
// base radio button styles
|
|
8048
8428
|
"checked:bg-eui-secondary-700 checked:border-eui-primary-400": field2.value === option.value
|
|
@@ -8054,7 +8434,7 @@ function Radio({
|
|
|
8054
8434
|
"label",
|
|
8055
8435
|
{
|
|
8056
8436
|
htmlFor: option.value,
|
|
8057
|
-
className:
|
|
8437
|
+
className: classNames74__default.default({
|
|
8058
8438
|
"eui-text-md text-sm": true
|
|
8059
8439
|
}),
|
|
8060
8440
|
children: option.label
|
|
@@ -8067,7 +8447,7 @@ function Radio({
|
|
|
8067
8447
|
});
|
|
8068
8448
|
} }),
|
|
8069
8449
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8070
|
-
|
|
8450
|
+
InputResponse,
|
|
8071
8451
|
{
|
|
8072
8452
|
name: field.name,
|
|
8073
8453
|
visibility: meta.touched && meta.error ? true : false,
|
|
@@ -8085,9 +8465,9 @@ function StarRatingInput({
|
|
|
8085
8465
|
const { name: name2 } = props;
|
|
8086
8466
|
const [field, meta] = formik.useField(props);
|
|
8087
8467
|
const formikContext = formik.useFormikContext();
|
|
8088
|
-
const [rating, setRating] =
|
|
8089
|
-
const [hover, setHover] =
|
|
8090
|
-
|
|
8468
|
+
const [rating, setRating] = React26.useState(Number(field.value) || 0);
|
|
8469
|
+
const [hover, setHover] = React26.useState(null);
|
|
8470
|
+
React26.useEffect(() => {
|
|
8091
8471
|
setRating(Number(field.value));
|
|
8092
8472
|
}, [field.value]);
|
|
8093
8473
|
const handleOnClick = (index3) => {
|
|
@@ -8097,7 +8477,7 @@ function StarRatingInput({
|
|
|
8097
8477
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8098
8478
|
"div",
|
|
8099
8479
|
{
|
|
8100
|
-
className:
|
|
8480
|
+
className: classNames74__default.default({
|
|
8101
8481
|
"inline-flex gap-[4px] text-[20px]": true,
|
|
8102
8482
|
[`${styles}`]: styles
|
|
8103
8483
|
}),
|
|
@@ -8110,7 +8490,7 @@ function StarRatingInput({
|
|
|
8110
8490
|
onClick: () => handleOnClick(index3),
|
|
8111
8491
|
onMouseEnter: () => setHover(index3),
|
|
8112
8492
|
onMouseLeave: () => setHover(null),
|
|
8113
|
-
className:
|
|
8493
|
+
className: classNames74__default.default({
|
|
8114
8494
|
"text-yellow-600": index3 <= (hover ?? rating - 1),
|
|
8115
8495
|
"text-gray-400": index3 > (hover ?? rating - 1)
|
|
8116
8496
|
}),
|
|
@@ -8119,7 +8499,7 @@ function StarRatingInput({
|
|
|
8119
8499
|
index3
|
|
8120
8500
|
)) }),
|
|
8121
8501
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8122
|
-
|
|
8502
|
+
InputResponse,
|
|
8123
8503
|
{
|
|
8124
8504
|
name: field.name,
|
|
8125
8505
|
visibility: meta.touched && meta.error ? true : false,
|
|
@@ -8143,10 +8523,10 @@ function Select({
|
|
|
8143
8523
|
const [field, meta] = formik.useField(props);
|
|
8144
8524
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
8145
8525
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8146
|
-
|
|
8526
|
+
InputLabel,
|
|
8147
8527
|
{
|
|
8148
8528
|
text: placeholder,
|
|
8149
|
-
|
|
8529
|
+
className: "absolute left-2 top-[0.7px] peer-placeholder-shown:text-base peer-placeholder-shown:top-3"
|
|
8150
8530
|
}
|
|
8151
8531
|
),
|
|
8152
8532
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -8154,7 +8534,7 @@ function Select({
|
|
|
8154
8534
|
{
|
|
8155
8535
|
as: "select",
|
|
8156
8536
|
...props,
|
|
8157
|
-
className:
|
|
8537
|
+
className: classNames74__default.default({
|
|
8158
8538
|
"border peer w-full bg-eui-primary-300/10 pt-5 px-3 pb-2 text-md eui-text-md placeholder-transparent placeholder-shown:p-3 focus:border-eui-secondary-500 focus:outline-none h-[50px]": true,
|
|
8159
8539
|
"border-eui-primary-400": !(meta.touched && meta.error),
|
|
8160
8540
|
"border-red-500": meta.touched && meta.error,
|
|
@@ -8168,7 +8548,7 @@ function Select({
|
|
|
8168
8548
|
}
|
|
8169
8549
|
),
|
|
8170
8550
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8171
|
-
|
|
8551
|
+
InputResponse,
|
|
8172
8552
|
{
|
|
8173
8553
|
name: field.name,
|
|
8174
8554
|
visibility: meta.touched && meta.error ? true : false,
|
|
@@ -8189,7 +8569,7 @@ function Switch({
|
|
|
8189
8569
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
8190
8570
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row justify-between w-full gap-3", children: [
|
|
8191
8571
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
8192
|
-
label && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8572
|
+
label && /* @__PURE__ */ jsxRuntime.jsx(InputLabel, { text: label }),
|
|
8193
8573
|
description && /* @__PURE__ */ jsxRuntime.jsx("label", { className: "eui-text-md text-[12px] max-w-[500px]", children: description })
|
|
8194
8574
|
] }),
|
|
8195
8575
|
/* @__PURE__ */ jsxRuntime.jsx(formik.Field, { name: name2, children: () => /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "relative inline-flex cursor-pointer", children: [
|
|
@@ -8206,7 +8586,7 @@ function Switch({
|
|
|
8206
8586
|
"div",
|
|
8207
8587
|
{
|
|
8208
8588
|
onClick: () => helpers.setValue(!field.value),
|
|
8209
|
-
className:
|
|
8589
|
+
className: classNames74__default.default(
|
|
8210
8590
|
"w-11 h-6 bg-gray-200 peer-focus:outline-none rounded-full peer dark:bg-eui-dark-100",
|
|
8211
8591
|
"peer-checked:after:translate-x-full peer-checked:after:border-white",
|
|
8212
8592
|
"after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white",
|
|
@@ -8219,7 +8599,7 @@ function Switch({
|
|
|
8219
8599
|
] }) })
|
|
8220
8600
|
] }),
|
|
8221
8601
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8222
|
-
|
|
8602
|
+
InputResponse,
|
|
8223
8603
|
{
|
|
8224
8604
|
name: name2,
|
|
8225
8605
|
visibility: meta.touched && meta.error ? true : false,
|
|
@@ -8236,7 +8616,7 @@ function Tags({
|
|
|
8236
8616
|
...props
|
|
8237
8617
|
}) {
|
|
8238
8618
|
const [field, meta, helpers] = formik.useField({ ...props });
|
|
8239
|
-
const [input, setInput] =
|
|
8619
|
+
const [input, setInput] = React26.useState("");
|
|
8240
8620
|
const handleAddTag = () => {
|
|
8241
8621
|
const trimmed = input.trim();
|
|
8242
8622
|
if (trimmed && !field.value.includes(trimmed) && field.value.length < limit) {
|
|
@@ -8263,7 +8643,7 @@ function Tags({
|
|
|
8263
8643
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
8264
8644
|
"div",
|
|
8265
8645
|
{
|
|
8266
|
-
className:
|
|
8646
|
+
className: classNames74__default.default(
|
|
8267
8647
|
"border rounded-sm flex flex-wrap items-center gap-2 px-2 pt-2 pb-6 min-h-[3rem]",
|
|
8268
8648
|
{
|
|
8269
8649
|
"bg-eui-primary-300/10 eui-text-md": true,
|
|
@@ -8308,10 +8688,10 @@ function Tags({
|
|
|
8308
8688
|
}
|
|
8309
8689
|
),
|
|
8310
8690
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8311
|
-
|
|
8691
|
+
InputLabel,
|
|
8312
8692
|
{
|
|
8313
8693
|
text: placeholder,
|
|
8314
|
-
|
|
8694
|
+
className: classNames74__default.default(
|
|
8315
8695
|
"absolute left-2 transition-all pointer-events-none text-eui-dark-200",
|
|
8316
8696
|
input.length > 0 || field.value.length > 0 ? "top-[2px] text-[13.5px]" : "top-3 text-base"
|
|
8317
8697
|
)
|
|
@@ -8324,7 +8704,7 @@ function Tags({
|
|
|
8324
8704
|
] })
|
|
8325
8705
|
] }),
|
|
8326
8706
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8327
|
-
|
|
8707
|
+
InputResponse,
|
|
8328
8708
|
{
|
|
8329
8709
|
name: field.name,
|
|
8330
8710
|
visibility: meta.touched && meta.error ? true : false,
|
|
@@ -8352,7 +8732,7 @@ function TextArea({
|
|
|
8352
8732
|
as: "textarea",
|
|
8353
8733
|
...field,
|
|
8354
8734
|
...props,
|
|
8355
|
-
className:
|
|
8735
|
+
className: classNames74__default.default({
|
|
8356
8736
|
"border peer w-full bg-eui-primary-300/10 eui-text-md outline-none px-3 py-5 resize-none focus:resize-none focus:outline-none": true,
|
|
8357
8737
|
"transition-all ease-in-out": true,
|
|
8358
8738
|
"border-eui-primary-400 focus:border-eui-secondary-500": !(meta.touched && meta.error),
|
|
@@ -8363,10 +8743,10 @@ function TextArea({
|
|
|
8363
8743
|
}
|
|
8364
8744
|
),
|
|
8365
8745
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8366
|
-
|
|
8746
|
+
InputLabel,
|
|
8367
8747
|
{
|
|
8368
8748
|
text: placeholder,
|
|
8369
|
-
|
|
8749
|
+
className: classNames74__default.default(
|
|
8370
8750
|
"absolute left-2 transition-all pointer-events-none text-eui-dark-200",
|
|
8371
8751
|
field.value ? "top-[2px] text-[13.5px]" : "top-3 text-base"
|
|
8372
8752
|
)
|
|
@@ -8379,7 +8759,7 @@ function TextArea({
|
|
|
8379
8759
|
] })
|
|
8380
8760
|
] }),
|
|
8381
8761
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8382
|
-
|
|
8762
|
+
InputResponse,
|
|
8383
8763
|
{
|
|
8384
8764
|
name: field.name,
|
|
8385
8765
|
visibility: meta.touched && meta.error ? true : false,
|
|
@@ -8400,7 +8780,7 @@ function BreadcrumbItem({
|
|
|
8400
8780
|
{
|
|
8401
8781
|
href,
|
|
8402
8782
|
onClick,
|
|
8403
|
-
className:
|
|
8783
|
+
className: classNames74__default.default({
|
|
8404
8784
|
"text-lg font-semibold": true,
|
|
8405
8785
|
"text-gray-400 hover:text-gray-600 cursor-pointer": !active,
|
|
8406
8786
|
"text-eui-light-800": active,
|
|
@@ -8447,7 +8827,7 @@ var Breadcrumb = ({
|
|
|
8447
8827
|
const { config } = useEUIConfig();
|
|
8448
8828
|
const pathname = currentPath || (typeof window !== "undefined" ? window.location.pathname : "/");
|
|
8449
8829
|
const resolvedRoutes = routes || config?.routes || [];
|
|
8450
|
-
const resolvedData =
|
|
8830
|
+
const resolvedData = React26.useMemo(() => {
|
|
8451
8831
|
if (resolvedRoutes && resolvedRoutes.length > 0) {
|
|
8452
8832
|
return buildFromRoutes(resolvedRoutes, pathname);
|
|
8453
8833
|
}
|
|
@@ -8464,7 +8844,7 @@ var Breadcrumb = ({
|
|
|
8464
8844
|
navigate(item.href);
|
|
8465
8845
|
}
|
|
8466
8846
|
};
|
|
8467
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8847
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React26__default.default.Fragment, { children: [
|
|
8468
8848
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8469
8849
|
BreadcrumbItem_default,
|
|
8470
8850
|
{
|
|
@@ -8477,7 +8857,7 @@ var Breadcrumb = ({
|
|
|
8477
8857
|
index3 < resolvedData.length - 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8478
8858
|
"span",
|
|
8479
8859
|
{
|
|
8480
|
-
className:
|
|
8860
|
+
className: classNames74__default.default({
|
|
8481
8861
|
"text-lg font-semibold text-gray-500": true,
|
|
8482
8862
|
[`px-${gap}`]: gap
|
|
8483
8863
|
}),
|
|
@@ -8491,7 +8871,7 @@ var Breadcrumb = ({
|
|
|
8491
8871
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8492
8872
|
"div",
|
|
8493
8873
|
{
|
|
8494
|
-
className:
|
|
8874
|
+
className: classNames74__default.default({
|
|
8495
8875
|
"inline-flex": true,
|
|
8496
8876
|
[`${styles}`]: styles
|
|
8497
8877
|
}),
|
|
@@ -8500,8 +8880,8 @@ var Breadcrumb = ({
|
|
|
8500
8880
|
);
|
|
8501
8881
|
};
|
|
8502
8882
|
var useIsMobile = (breakpoint = 768) => {
|
|
8503
|
-
const [isMobile, setIsMobile] =
|
|
8504
|
-
|
|
8883
|
+
const [isMobile, setIsMobile] = React26.useState(window.innerWidth < breakpoint);
|
|
8884
|
+
React26.useEffect(() => {
|
|
8505
8885
|
const handleResize = () => {
|
|
8506
8886
|
setIsMobile(window.innerWidth < breakpoint);
|
|
8507
8887
|
};
|
|
@@ -8535,7 +8915,7 @@ var Drawer = ({
|
|
|
8535
8915
|
isMobile && showBackdrop && /* @__PURE__ */ jsxRuntime.jsx(TransitionFade_default, { visibility, leaveDuration: 200, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8536
8916
|
"div",
|
|
8537
8917
|
{
|
|
8538
|
-
className:
|
|
8918
|
+
className: classNames74__default.default(
|
|
8539
8919
|
"fixed inset-0 bg-black/50 z-40",
|
|
8540
8920
|
backdropStyles
|
|
8541
8921
|
),
|
|
@@ -8546,7 +8926,7 @@ var Drawer = ({
|
|
|
8546
8926
|
"div",
|
|
8547
8927
|
{
|
|
8548
8928
|
style: drawerStyle,
|
|
8549
|
-
className:
|
|
8929
|
+
className: classNames74__default.default(
|
|
8550
8930
|
"fixed shadow-lg z-50",
|
|
8551
8931
|
{
|
|
8552
8932
|
"h-full w-[300px] top-0": isHorizontal && !hasOffset,
|
|
@@ -8575,7 +8955,7 @@ function DrawerToggler({
|
|
|
8575
8955
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8576
8956
|
"div",
|
|
8577
8957
|
{
|
|
8578
|
-
className:
|
|
8958
|
+
className: classNames74__default.default({
|
|
8579
8959
|
"text-xl p-3 cursor-pointer": true,
|
|
8580
8960
|
"transition-all ease-in-out": true,
|
|
8581
8961
|
"text-eui-dark-500 dark:text-eui-secondary-600": !styles,
|
|
@@ -8623,7 +9003,7 @@ function FooterNav({ data = [], styles }) {
|
|
|
8623
9003
|
childrenContent = /* @__PURE__ */ jsxRuntime.jsx(
|
|
8624
9004
|
"div",
|
|
8625
9005
|
{
|
|
8626
|
-
className:
|
|
9006
|
+
className: classNames74__default.default({
|
|
8627
9007
|
"grid w-full": true,
|
|
8628
9008
|
"grid-cols-1": isMobile,
|
|
8629
9009
|
"grid-cols-3": !isMobile,
|
|
@@ -8636,7 +9016,7 @@ function FooterNav({ data = [], styles }) {
|
|
|
8636
9016
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8637
9017
|
"div",
|
|
8638
9018
|
{
|
|
8639
|
-
className:
|
|
9019
|
+
className: classNames74__default.default({
|
|
8640
9020
|
[`${styles}`]: styles
|
|
8641
9021
|
}),
|
|
8642
9022
|
children: childrenContent
|
|
@@ -8677,7 +9057,7 @@ var FooterNavGroup = ({
|
|
|
8677
9057
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8678
9058
|
"div",
|
|
8679
9059
|
{
|
|
8680
|
-
className:
|
|
9060
|
+
className: classNames74__default.default({
|
|
8681
9061
|
"": true,
|
|
8682
9062
|
"py-2 font-semibold eui-text-lg": !styles,
|
|
8683
9063
|
[`${styles}`]: styles
|
|
@@ -8722,7 +9102,7 @@ var FooterNavItem = ({
|
|
|
8722
9102
|
"div",
|
|
8723
9103
|
{
|
|
8724
9104
|
onClick: handleNavigation,
|
|
8725
|
-
className:
|
|
9105
|
+
className: classNames74__default.default({
|
|
8726
9106
|
"flex flex-row items-center gap-3 cursor-pointer p-1 w-full": true,
|
|
8727
9107
|
"transition-all duration-200 ease-in-out": true,
|
|
8728
9108
|
"text-sm eui-text-sm": !styles,
|
|
@@ -8751,7 +9131,7 @@ var FooterNavItemTitle = ({
|
|
|
8751
9131
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8752
9132
|
"div",
|
|
8753
9133
|
{
|
|
8754
|
-
className:
|
|
9134
|
+
className: classNames74__default.default({
|
|
8755
9135
|
"": true,
|
|
8756
9136
|
"py-2 font-thin eui-text-md": !styles,
|
|
8757
9137
|
[`${styles}`]: styles
|
|
@@ -8804,7 +9184,7 @@ function HeaderNav({ data = [], styles }) {
|
|
|
8804
9184
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8805
9185
|
"div",
|
|
8806
9186
|
{
|
|
8807
|
-
className:
|
|
9187
|
+
className: classNames74__default.default({
|
|
8808
9188
|
[`${styles}`]: styles
|
|
8809
9189
|
}),
|
|
8810
9190
|
children: childrenContent
|
|
@@ -8813,7 +9193,7 @@ function HeaderNav({ data = [], styles }) {
|
|
|
8813
9193
|
}
|
|
8814
9194
|
var HeaderNav_default = HeaderNav;
|
|
8815
9195
|
function useClickOutside(ref, fun) {
|
|
8816
|
-
|
|
9196
|
+
React26.useEffect(() => {
|
|
8817
9197
|
const listener = (e) => {
|
|
8818
9198
|
if (!ref.current || ref.current.contains(e.target)) {
|
|
8819
9199
|
return;
|
|
@@ -8854,8 +9234,8 @@ var HeaderNavGroup = ({
|
|
|
8854
9234
|
styles,
|
|
8855
9235
|
children: children3
|
|
8856
9236
|
}) => {
|
|
8857
|
-
const [collapsed, setCollapsed] =
|
|
8858
|
-
const headerNavGroupRef =
|
|
9237
|
+
const [collapsed, setCollapsed] = React26.useState(true);
|
|
9238
|
+
const headerNavGroupRef = React26.useRef(null);
|
|
8859
9239
|
useClickOutside(headerNavGroupRef, () => setCollapsed(true));
|
|
8860
9240
|
const handleNavigation = () => {
|
|
8861
9241
|
if (to) {
|
|
@@ -8866,7 +9246,7 @@ var HeaderNavGroup = ({
|
|
|
8866
9246
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
8867
9247
|
"div",
|
|
8868
9248
|
{
|
|
8869
|
-
className:
|
|
9249
|
+
className: classNames74__default.default({
|
|
8870
9250
|
"flex flex-row gap-2 items-center justify-between cursor-pointer p-3 w-full": true,
|
|
8871
9251
|
"transition-all duration-300 ease-in-out": true,
|
|
8872
9252
|
"eui-text-md bg-gradient-to-t from-eui-dark-500/10 dark:from-green-700/10": !styles,
|
|
@@ -8894,7 +9274,7 @@ var HeaderNavGroup = ({
|
|
|
8894
9274
|
children3 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8895
9275
|
index_js$3.BsChevronDown,
|
|
8896
9276
|
{
|
|
8897
|
-
className:
|
|
9277
|
+
className: classNames74__default.default({
|
|
8898
9278
|
"text-md": true,
|
|
8899
9279
|
"transition-all ease-in-out duration-300": true,
|
|
8900
9280
|
"rotate-180": !collapsed
|
|
@@ -8907,7 +9287,7 @@ var HeaderNavGroup = ({
|
|
|
8907
9287
|
!collapsed && children3 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8908
9288
|
"div",
|
|
8909
9289
|
{
|
|
8910
|
-
className:
|
|
9290
|
+
className: classNames74__default.default({
|
|
8911
9291
|
"absolute min-w-80 left-0 top-full mt-1 border border-eui-dark-300/10 dark:border-eui-dark-300/50 shadow-lg eui-shadow-lg z-50 w-full eui-bg-md": true,
|
|
8912
9292
|
"transition-all duration-300 ease-in-out": true
|
|
8913
9293
|
}),
|
|
@@ -8937,7 +9317,7 @@ var HeaderNavItem = ({
|
|
|
8937
9317
|
"div",
|
|
8938
9318
|
{
|
|
8939
9319
|
onClick: handleNavigation,
|
|
8940
|
-
className:
|
|
9320
|
+
className: classNames74__default.default({
|
|
8941
9321
|
"flex flex-row items-center gap-3 cursor-pointer p-3 w-full": true,
|
|
8942
9322
|
"transition-all duration-200 ease-in-out": true,
|
|
8943
9323
|
"eui-text-md border-b border-eui-dark-500/20 dark:border-eui-secondary-900/20 bg-gradient-to-r from-eui-dark-500/10 dark:from-eui-secondary-900/10": !styles,
|
|
@@ -8966,7 +9346,7 @@ var HeaderNavItemTitle = ({
|
|
|
8966
9346
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8967
9347
|
"div",
|
|
8968
9348
|
{
|
|
8969
|
-
className:
|
|
9349
|
+
className: classNames74__default.default({
|
|
8970
9350
|
"p-3 font-thin": true,
|
|
8971
9351
|
"eui-text-md": !styles,
|
|
8972
9352
|
[`${styles}`]: styles
|
|
@@ -9006,7 +9386,7 @@ var Link = ({
|
|
|
9006
9386
|
href: href || "#",
|
|
9007
9387
|
target: targets[target],
|
|
9008
9388
|
onClick: handleClick,
|
|
9009
|
-
className:
|
|
9389
|
+
className: classNames74__default.default({
|
|
9010
9390
|
[`${textVariants[variant]}`]: variant,
|
|
9011
9391
|
[`${decorations[decoration]}`]: decoration,
|
|
9012
9392
|
"font-bold": bold,
|
|
@@ -9078,8 +9458,8 @@ var MenuGroup = ({
|
|
|
9078
9458
|
style: style2,
|
|
9079
9459
|
...rest
|
|
9080
9460
|
}) => {
|
|
9081
|
-
const [collapsed, setCollapsed] =
|
|
9082
|
-
|
|
9461
|
+
const [collapsed, setCollapsed] = React26.useState(!defaultOpen);
|
|
9462
|
+
React26.useEffect(() => {
|
|
9083
9463
|
if (defaultOpen !== void 0) {
|
|
9084
9464
|
setCollapsed(!defaultOpen);
|
|
9085
9465
|
}
|
|
@@ -9196,12 +9576,12 @@ var Menu = ({
|
|
|
9196
9576
|
defaultMenuElements,
|
|
9197
9577
|
currentPath
|
|
9198
9578
|
}) => {
|
|
9199
|
-
const normalizedItems =
|
|
9200
|
-
const selected =
|
|
9579
|
+
const normalizedItems = React26.useMemo(() => assignKeys(items), [items]);
|
|
9580
|
+
const selected = React26.useMemo(() => {
|
|
9201
9581
|
if (!currentPath) return void 0;
|
|
9202
9582
|
return findSelectedKey(normalizedItems, currentPath);
|
|
9203
9583
|
}, [currentPath, normalizedItems]);
|
|
9204
|
-
const parentMap =
|
|
9584
|
+
const parentMap = React26.useMemo(
|
|
9205
9585
|
() => buildParentMap(normalizedItems),
|
|
9206
9586
|
[normalizedItems]
|
|
9207
9587
|
);
|
|
@@ -9354,8 +9734,8 @@ function RouteTabs({
|
|
|
9354
9734
|
const currentPath = window.location.pathname;
|
|
9355
9735
|
return navData.find((tab2) => tab2.to === currentPath)?.to || navData[0]?.to;
|
|
9356
9736
|
};
|
|
9357
|
-
const [activeTab, setActiveTab] =
|
|
9358
|
-
|
|
9737
|
+
const [activeTab, setActiveTab] = React26.useState(getActiveTab);
|
|
9738
|
+
React26.useEffect(() => {
|
|
9359
9739
|
if (mode !== "route") return;
|
|
9360
9740
|
const handlePopState = () => {
|
|
9361
9741
|
setActiveTab(getActiveTab());
|
|
@@ -9659,7 +10039,7 @@ var CHART_LIGHT_THEME = {
|
|
|
9659
10039
|
},
|
|
9660
10040
|
colors: CHART_COLOR_PALETTE
|
|
9661
10041
|
};
|
|
9662
|
-
var ChartContext =
|
|
10042
|
+
var ChartContext = React26.createContext({
|
|
9663
10043
|
data: [],
|
|
9664
10044
|
loading: false,
|
|
9665
10045
|
error: null,
|
|
@@ -9678,7 +10058,7 @@ var ChartContext = React25.createContext({
|
|
|
9678
10058
|
|
|
9679
10059
|
// src/components/data-display/charts/context/useChartContext.ts
|
|
9680
10060
|
function useChartContext() {
|
|
9681
|
-
return
|
|
10061
|
+
return React26.useContext(ChartContext);
|
|
9682
10062
|
}
|
|
9683
10063
|
function mergeChartTheme(baseTheme, customTheme) {
|
|
9684
10064
|
if (!customTheme) {
|
|
@@ -9706,7 +10086,7 @@ function mergeChartTheme(baseTheme, customTheme) {
|
|
|
9706
10086
|
}
|
|
9707
10087
|
function useChartTheme({ mode, theme } = {}) {
|
|
9708
10088
|
const context = useChartContext();
|
|
9709
|
-
return
|
|
10089
|
+
return React26.useMemo(() => {
|
|
9710
10090
|
const baseTheme = mode === "light" ? CHART_LIGHT_THEME : mode === "dark" ? CHART_DARK_THEME : context.theme;
|
|
9711
10091
|
return mergeChartTheme(baseTheme, theme);
|
|
9712
10092
|
}, [context.theme, mode, theme]);
|
|
@@ -10248,7 +10628,7 @@ function ChartLegend({
|
|
|
10248
10628
|
...rest
|
|
10249
10629
|
}) {
|
|
10250
10630
|
const theme = useChartTheme();
|
|
10251
|
-
const legendItems =
|
|
10631
|
+
const legendItems = React26.useMemo(() => {
|
|
10252
10632
|
if (items?.length) {
|
|
10253
10633
|
return items;
|
|
10254
10634
|
}
|
|
@@ -10468,14 +10848,14 @@ function useChartData({
|
|
|
10468
10848
|
onDataChange,
|
|
10469
10849
|
onError
|
|
10470
10850
|
} = {}) {
|
|
10471
|
-
const [state, setState] =
|
|
10851
|
+
const [state, setState] = React26.useState({
|
|
10472
10852
|
data: data ?? [],
|
|
10473
10853
|
loading: false,
|
|
10474
10854
|
error: null,
|
|
10475
10855
|
status: data?.length ? "success" : "idle",
|
|
10476
10856
|
lastUpdatedAt: data?.length ? /* @__PURE__ */ new Date() : void 0
|
|
10477
10857
|
});
|
|
10478
|
-
const prepareData =
|
|
10858
|
+
const prepareData = React26.useCallback(
|
|
10479
10859
|
(nextData) => {
|
|
10480
10860
|
if (!normalize4) {
|
|
10481
10861
|
return nextData;
|
|
@@ -10484,7 +10864,7 @@ function useChartData({
|
|
|
10484
10864
|
},
|
|
10485
10865
|
[normalize4]
|
|
10486
10866
|
);
|
|
10487
|
-
const replaceData =
|
|
10867
|
+
const replaceData = React26.useCallback(
|
|
10488
10868
|
(nextData) => {
|
|
10489
10869
|
const normalizedData = prepareData(nextData);
|
|
10490
10870
|
setState({
|
|
@@ -10498,7 +10878,7 @@ function useChartData({
|
|
|
10498
10878
|
},
|
|
10499
10879
|
[onDataChange, prepareData]
|
|
10500
10880
|
);
|
|
10501
|
-
const appendData =
|
|
10881
|
+
const appendData = React26.useCallback(
|
|
10502
10882
|
(nextData) => {
|
|
10503
10883
|
setState((currentState) => {
|
|
10504
10884
|
const incomingData = Array.isArray(nextData) ? nextData : [nextData];
|
|
@@ -10522,7 +10902,7 @@ function useChartData({
|
|
|
10522
10902
|
},
|
|
10523
10903
|
[maxDataPoints, onDataChange, prepareData]
|
|
10524
10904
|
);
|
|
10525
|
-
const clearData =
|
|
10905
|
+
const clearData = React26.useCallback(() => {
|
|
10526
10906
|
setState({
|
|
10527
10907
|
data: [],
|
|
10528
10908
|
loading: false,
|
|
@@ -10532,7 +10912,7 @@ function useChartData({
|
|
|
10532
10912
|
});
|
|
10533
10913
|
onDataChange?.([]);
|
|
10534
10914
|
}, [onDataChange]);
|
|
10535
|
-
const handleError =
|
|
10915
|
+
const handleError = React26.useCallback(
|
|
10536
10916
|
(error) => {
|
|
10537
10917
|
setState((currentState) => ({
|
|
10538
10918
|
...currentState,
|
|
@@ -10544,7 +10924,7 @@ function useChartData({
|
|
|
10544
10924
|
},
|
|
10545
10925
|
[onError]
|
|
10546
10926
|
);
|
|
10547
|
-
const refresh =
|
|
10927
|
+
const refresh = React26.useCallback(async () => {
|
|
10548
10928
|
const resolvedDataSource = dataSource;
|
|
10549
10929
|
if (!resolvedDataSource?.refresh && !resolvedDataSource?.getInitialData) {
|
|
10550
10930
|
return;
|
|
@@ -10563,13 +10943,13 @@ function useChartData({
|
|
|
10563
10943
|
handleError(error instanceof Error ? error : new Error(String(error)));
|
|
10564
10944
|
}
|
|
10565
10945
|
}, [dataSource, handleError, replaceData]);
|
|
10566
|
-
|
|
10946
|
+
React26.useEffect(() => {
|
|
10567
10947
|
if (!data) {
|
|
10568
10948
|
return;
|
|
10569
10949
|
}
|
|
10570
10950
|
replaceData(data);
|
|
10571
10951
|
}, [data, replaceData]);
|
|
10572
|
-
|
|
10952
|
+
React26.useEffect(() => {
|
|
10573
10953
|
if (!dataSource || !autoLoad) {
|
|
10574
10954
|
return;
|
|
10575
10955
|
}
|
|
@@ -10608,7 +10988,7 @@ function useChartData({
|
|
|
10608
10988
|
unsubscribe?.();
|
|
10609
10989
|
};
|
|
10610
10990
|
}, [appendData, autoLoad, dataSource, handleError, replaceData]);
|
|
10611
|
-
return
|
|
10991
|
+
return React26.useMemo(
|
|
10612
10992
|
() => ({
|
|
10613
10993
|
...state,
|
|
10614
10994
|
refresh,
|
|
@@ -10627,11 +11007,11 @@ function useChartRealtime({
|
|
|
10627
11007
|
onData,
|
|
10628
11008
|
onError
|
|
10629
11009
|
}) {
|
|
10630
|
-
const [data, setData] =
|
|
10631
|
-
const [error, setError] =
|
|
10632
|
-
const [connected, setConnected] =
|
|
10633
|
-
const [lastUpdatedAt, setLastUpdatedAt] =
|
|
10634
|
-
|
|
11010
|
+
const [data, setData] = React26.useState([]);
|
|
11011
|
+
const [error, setError] = React26.useState(null);
|
|
11012
|
+
const [connected, setConnected] = React26.useState(false);
|
|
11013
|
+
const [lastUpdatedAt, setLastUpdatedAt] = React26.useState();
|
|
11014
|
+
React26.useEffect(() => {
|
|
10635
11015
|
if (!enabled) {
|
|
10636
11016
|
setConnected(false);
|
|
10637
11017
|
return;
|
|
@@ -10665,7 +11045,7 @@ function useChartRealtime({
|
|
|
10665
11045
|
setConnected(false);
|
|
10666
11046
|
};
|
|
10667
11047
|
}, [connect, enabled, maxDataPoints, normalize4, onData, onError]);
|
|
10668
|
-
return
|
|
11048
|
+
return React26.useMemo(
|
|
10669
11049
|
() => ({
|
|
10670
11050
|
data,
|
|
10671
11051
|
error,
|
|
@@ -10687,13 +11067,13 @@ function useChartPolling({
|
|
|
10687
11067
|
onData,
|
|
10688
11068
|
onError
|
|
10689
11069
|
}) {
|
|
10690
|
-
const isMountedRef =
|
|
10691
|
-
const isFetchingRef =
|
|
10692
|
-
const [data, setData] =
|
|
10693
|
-
const [error, setError] =
|
|
10694
|
-
const [loading, setLoading] =
|
|
10695
|
-
const [lastUpdatedAt, setLastUpdatedAt] =
|
|
10696
|
-
const refresh =
|
|
11070
|
+
const isMountedRef = React26.useRef(false);
|
|
11071
|
+
const isFetchingRef = React26.useRef(false);
|
|
11072
|
+
const [data, setData] = React26.useState([]);
|
|
11073
|
+
const [error, setError] = React26.useState(null);
|
|
11074
|
+
const [loading, setLoading] = React26.useState(immediate);
|
|
11075
|
+
const [lastUpdatedAt, setLastUpdatedAt] = React26.useState();
|
|
11076
|
+
const refresh = React26.useCallback(async () => {
|
|
10697
11077
|
if (isFetchingRef.current) {
|
|
10698
11078
|
return;
|
|
10699
11079
|
}
|
|
@@ -10722,13 +11102,13 @@ function useChartPolling({
|
|
|
10722
11102
|
isFetchingRef.current = false;
|
|
10723
11103
|
}
|
|
10724
11104
|
}, [fetcher, normalize4, onData, onError]);
|
|
10725
|
-
|
|
11105
|
+
React26.useEffect(() => {
|
|
10726
11106
|
isMountedRef.current = true;
|
|
10727
11107
|
return () => {
|
|
10728
11108
|
isMountedRef.current = false;
|
|
10729
11109
|
};
|
|
10730
11110
|
}, []);
|
|
10731
|
-
|
|
11111
|
+
React26.useEffect(() => {
|
|
10732
11112
|
if (!enabled) {
|
|
10733
11113
|
setLoading(false);
|
|
10734
11114
|
return;
|
|
@@ -10743,7 +11123,7 @@ function useChartPolling({
|
|
|
10743
11123
|
window.clearInterval(timer2);
|
|
10744
11124
|
};
|
|
10745
11125
|
}, [enabled, immediate, interval2, refresh]);
|
|
10746
|
-
return
|
|
11126
|
+
return React26.useMemo(
|
|
10747
11127
|
() => ({
|
|
10748
11128
|
data,
|
|
10749
11129
|
error,
|
|
@@ -10777,7 +11157,7 @@ function useChartSeries({
|
|
|
10777
11157
|
xKey,
|
|
10778
11158
|
excludeKeys
|
|
10779
11159
|
}) {
|
|
10780
|
-
return
|
|
11160
|
+
return React26.useMemo(() => {
|
|
10781
11161
|
const resolvedData = data ?? [];
|
|
10782
11162
|
const resolvedExcludeKeys = excludeKeys ?? [];
|
|
10783
11163
|
const normalizedSeries = series && series.length > 0 ? series : inferSeriesKeys(
|
|
@@ -10935,7 +11315,7 @@ function AreaPlot({
|
|
|
10935
11315
|
...rest
|
|
10936
11316
|
}) {
|
|
10937
11317
|
const theme = useChartTheme();
|
|
10938
|
-
const chartId =
|
|
11318
|
+
const chartId = React26.useId().replace(/:/g, "");
|
|
10939
11319
|
const chart = useResolvedChartState(data, loading, error);
|
|
10940
11320
|
const resolvedSeries = useChartSeries({
|
|
10941
11321
|
data: chart.data,
|
|
@@ -11149,7 +11529,7 @@ function PiePlot({
|
|
|
11149
11529
|
}) {
|
|
11150
11530
|
const theme = useChartTheme();
|
|
11151
11531
|
const chart = useResolvedChartState(data, loading, error);
|
|
11152
|
-
const segments =
|
|
11532
|
+
const segments = React26.useMemo(
|
|
11153
11533
|
() => chart.data.map((item, index3) => {
|
|
11154
11534
|
const label = String(item[String(nameKey)] ?? index3);
|
|
11155
11535
|
return {
|
|
@@ -11540,7 +11920,7 @@ function ChartProvider({
|
|
|
11540
11920
|
onError
|
|
11541
11921
|
});
|
|
11542
11922
|
const resolvedTheme = useChartTheme({ mode: themeMode, theme });
|
|
11543
|
-
const value =
|
|
11923
|
+
const value = React26.useMemo(
|
|
11544
11924
|
() => ({
|
|
11545
11925
|
...chartData,
|
|
11546
11926
|
mode: dataSource?.mode,
|
|
@@ -11984,7 +12364,7 @@ var Chip = ({
|
|
|
11984
12364
|
}
|
|
11985
12365
|
) });
|
|
11986
12366
|
};
|
|
11987
|
-
var DataViewContext =
|
|
12367
|
+
var DataViewContext = React26.createContext(null);
|
|
11988
12368
|
|
|
11989
12369
|
// src/components/data-display/data-view/utils/searchData.ts
|
|
11990
12370
|
function searchData(data, search3) {
|
|
@@ -12028,19 +12408,19 @@ var DataViewProvider = ({
|
|
|
12028
12408
|
defaultPageSize = 9,
|
|
12029
12409
|
sortConfig = {}
|
|
12030
12410
|
}) => {
|
|
12031
|
-
const [search3, setSearch] =
|
|
12032
|
-
const [filters, setFilters] =
|
|
12033
|
-
const [sort, setSort] =
|
|
12034
|
-
const [page, setPage] =
|
|
12035
|
-
const [pageSize, setPageSize] =
|
|
12036
|
-
const processedData =
|
|
12411
|
+
const [search3, setSearch] = React26.useState("");
|
|
12412
|
+
const [filters, setFilters] = React26.useState({});
|
|
12413
|
+
const [sort, setSort] = React26.useState("suggested");
|
|
12414
|
+
const [page, setPage] = React26.useState(1);
|
|
12415
|
+
const [pageSize, setPageSize] = React26.useState(defaultPageSize);
|
|
12416
|
+
const processedData = React26.useMemo(() => {
|
|
12037
12417
|
let result = searchData(data, search3);
|
|
12038
12418
|
result = filterData(result, filters);
|
|
12039
12419
|
result = sortData(result, sort, sortConfig);
|
|
12040
12420
|
return result;
|
|
12041
12421
|
}, [data, search3, filters, sort, sortConfig]);
|
|
12042
12422
|
const totalPages = pageSize === "All" ? 1 : Math.ceil(processedData.length / pageSize);
|
|
12043
|
-
const paginatedData =
|
|
12423
|
+
const paginatedData = React26.useMemo(() => {
|
|
12044
12424
|
if (pageSize === "All") return processedData;
|
|
12045
12425
|
const size = pageSize;
|
|
12046
12426
|
const start3 = (page - 1) * size;
|
|
@@ -12093,7 +12473,7 @@ var DataViewSidebar = ({
|
|
|
12093
12473
|
return /* @__PURE__ */ jsxRuntime.jsx("aside", { ...rest, className: cn("w-[220px] shrink-0", className), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-hidden", children: children3 }) });
|
|
12094
12474
|
};
|
|
12095
12475
|
function useDataView() {
|
|
12096
|
-
const ctx =
|
|
12476
|
+
const ctx = React26.useContext(DataViewContext);
|
|
12097
12477
|
if (!ctx) {
|
|
12098
12478
|
throw new Error("useDataView must be used within DataViewProvider");
|
|
12099
12479
|
}
|
|
@@ -12190,7 +12570,7 @@ function Accordion({
|
|
|
12190
12570
|
toggleOnSummaryClick = false,
|
|
12191
12571
|
enableChildrenPadding = true
|
|
12192
12572
|
}) {
|
|
12193
|
-
const [collapse, setCollapse] =
|
|
12573
|
+
const [collapse, setCollapse] = React26.useState(defaultCollapse);
|
|
12194
12574
|
const handleToggle = () => {
|
|
12195
12575
|
setCollapse((prev) => !prev);
|
|
12196
12576
|
};
|
|
@@ -12198,7 +12578,7 @@ function Accordion({
|
|
|
12198
12578
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
12199
12579
|
"div",
|
|
12200
12580
|
{
|
|
12201
|
-
className:
|
|
12581
|
+
className: classNames74__default.default(
|
|
12202
12582
|
"inline-flex gap-3 items-center px-3 py-2 w-full eui-gradient-to-r-general-xs",
|
|
12203
12583
|
{
|
|
12204
12584
|
"hover:cursor-pointer": toggleOnSummaryClick
|
|
@@ -12219,7 +12599,7 @@ function Accordion({
|
|
|
12219
12599
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12220
12600
|
index_js$4.FaCircleChevronDown,
|
|
12221
12601
|
{
|
|
12222
|
-
className:
|
|
12602
|
+
className: classNames74__default.default("text-xl transition-transform duration-300", {
|
|
12223
12603
|
"rotate-180": collapse
|
|
12224
12604
|
})
|
|
12225
12605
|
}
|
|
@@ -12233,7 +12613,7 @@ function Accordion({
|
|
|
12233
12613
|
/* @__PURE__ */ jsxRuntime.jsx(TransitionAccordion_default, { visibility: collapse, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
12234
12614
|
"div",
|
|
12235
12615
|
{
|
|
12236
|
-
className:
|
|
12616
|
+
className: classNames74__default.default(
|
|
12237
12617
|
"border-t border-t-eui-dark-400/40 eui-text-sm",
|
|
12238
12618
|
{
|
|
12239
12619
|
"p-5": enableChildrenPadding
|
|
@@ -12290,7 +12670,7 @@ function CardHeader({ icon, title, description, className }) {
|
|
|
12290
12670
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
12291
12671
|
"div",
|
|
12292
12672
|
{
|
|
12293
|
-
className:
|
|
12673
|
+
className: classNames74__default.default(
|
|
12294
12674
|
"flex items-start gap-4 p-6 border-b border-white/10",
|
|
12295
12675
|
className
|
|
12296
12676
|
),
|
|
@@ -12306,14 +12686,14 @@ function CardHeader({ icon, title, description, className }) {
|
|
|
12306
12686
|
}
|
|
12307
12687
|
var CardHeader_default = CardHeader;
|
|
12308
12688
|
function CardContent({ children: children3, className }) {
|
|
12309
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
12689
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames74__default.default("p-6 text-gray-300 text-sm", className), children: children3 });
|
|
12310
12690
|
}
|
|
12311
12691
|
var CardContent_default = CardContent;
|
|
12312
12692
|
function CardFooter({ children: children3, className }) {
|
|
12313
12693
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12314
12694
|
"div",
|
|
12315
12695
|
{
|
|
12316
|
-
className:
|
|
12696
|
+
className: classNames74__default.default(
|
|
12317
12697
|
"flex items-center gap-3 p-5 border-t border-white/10 text-sm text-gray-400",
|
|
12318
12698
|
className
|
|
12319
12699
|
),
|
|
@@ -12355,7 +12735,7 @@ function GradientAnimation({
|
|
|
12355
12735
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12356
12736
|
"div",
|
|
12357
12737
|
{
|
|
12358
|
-
className:
|
|
12738
|
+
className: classNames74__default.default("absolute inset-0"),
|
|
12359
12739
|
style: {
|
|
12360
12740
|
background: `linear-gradient(${cfg.angle}deg, ${cfg.colors?.join(",")})`,
|
|
12361
12741
|
backgroundSize: cfg.backgroundSize,
|
|
@@ -12501,7 +12881,7 @@ function MotionSurface({
|
|
|
12501
12881
|
}) {
|
|
12502
12882
|
const AnimationComponent = animationVariant === "custom" ? CustomAnimation : animationRegistry[animationVariant];
|
|
12503
12883
|
const OverlayComponent = overlay === "custom" ? CustomOverlay : overlayRegistry[overlay];
|
|
12504
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
12884
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classNames74__default.default("relative overflow-hidden", className), children: [
|
|
12505
12885
|
AnimationComponent && /* @__PURE__ */ jsxRuntime.jsx(AnimationComponent, { config: animationConfig, animated }),
|
|
12506
12886
|
OverlayComponent && /* @__PURE__ */ jsxRuntime.jsx(OverlayComponent, { config: overlayConfig }),
|
|
12507
12887
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative z-10", children: children3 })
|
|
@@ -12664,8 +13044,8 @@ var Flag = ({
|
|
|
12664
13044
|
className,
|
|
12665
13045
|
...rest
|
|
12666
13046
|
}) => {
|
|
12667
|
-
const [pos, setPos] =
|
|
12668
|
-
const [showTooltip, setShowTooltip] =
|
|
13047
|
+
const [pos, setPos] = React26.useState({ x: 0, y: 0 });
|
|
13048
|
+
const [showTooltip, setShowTooltip] = React26.useState(false);
|
|
12669
13049
|
const upperCode = code4.toUpperCase();
|
|
12670
13050
|
const country = emojiFlags__default.default.countryCode(upperCode);
|
|
12671
13051
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -15793,16 +16173,16 @@ var GraphRenderer = ({
|
|
|
15793
16173
|
width = 1e3,
|
|
15794
16174
|
height = 700
|
|
15795
16175
|
}) => {
|
|
15796
|
-
const [nodes, setNodes] =
|
|
16176
|
+
const [nodes, setNodes] = React26.useState([]);
|
|
15797
16177
|
const edges = data.edges;
|
|
15798
|
-
const simulationRef =
|
|
15799
|
-
const [offset, setOffset] =
|
|
15800
|
-
const isDragging =
|
|
15801
|
-
const lastPos =
|
|
15802
|
-
const nodeMap =
|
|
16178
|
+
const simulationRef = React26.useRef(null);
|
|
16179
|
+
const [offset, setOffset] = React26.useState({ x: 0, y: 0 });
|
|
16180
|
+
const isDragging = React26.useRef(false);
|
|
16181
|
+
const lastPos = React26.useRef({ x: 0, y: 0 });
|
|
16182
|
+
const nodeMap = React26.useMemo(() => {
|
|
15803
16183
|
return new Map(nodes.map((n) => [n.id, n]));
|
|
15804
16184
|
}, [nodes]);
|
|
15805
|
-
|
|
16185
|
+
React26.useEffect(() => {
|
|
15806
16186
|
simulationRef.current?.stop?.();
|
|
15807
16187
|
const positionedNodes = data.nodes.map((n) => ({
|
|
15808
16188
|
...n,
|
|
@@ -15883,13 +16263,13 @@ var Graph = ({
|
|
|
15883
16263
|
}
|
|
15884
16264
|
);
|
|
15885
16265
|
};
|
|
15886
|
-
var CloudinaryContext =
|
|
16266
|
+
var CloudinaryContext = React26.createContext(null);
|
|
15887
16267
|
var CloudinaryProvider = ({
|
|
15888
16268
|
cloudName,
|
|
15889
16269
|
children: children3
|
|
15890
16270
|
}) => /* @__PURE__ */ jsxRuntime.jsx(CloudinaryContext.Provider, { value: { cloudName }, children: children3 });
|
|
15891
16271
|
var useCloudinaryConfig = () => {
|
|
15892
|
-
const ctx =
|
|
16272
|
+
const ctx = React26.useContext(CloudinaryContext);
|
|
15893
16273
|
if (!ctx) {
|
|
15894
16274
|
throw new Error(
|
|
15895
16275
|
"CloudinaryProvider is missing. Wrap your app with <CloudinaryProvider />"
|
|
@@ -16408,7 +16788,7 @@ var ListItem = ({
|
|
|
16408
16788
|
children: bullet
|
|
16409
16789
|
}
|
|
16410
16790
|
),
|
|
16411
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-w-0", children: TypographyComponent ?
|
|
16791
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-w-0", children: TypographyComponent ? React26__default.default.cloneElement(
|
|
16412
16792
|
TypographyComponent,
|
|
16413
16793
|
{
|
|
16414
16794
|
className: cn(
|
|
@@ -16442,7 +16822,7 @@ function normalizeItem(item, defaultBulletType) {
|
|
|
16442
16822
|
bulletType: defaultBulletType
|
|
16443
16823
|
};
|
|
16444
16824
|
}
|
|
16445
|
-
if (
|
|
16825
|
+
if (React26__default.default.isValidElement(item)) {
|
|
16446
16826
|
return {
|
|
16447
16827
|
content: item,
|
|
16448
16828
|
bulletType: defaultBulletType
|
|
@@ -16747,7 +17127,7 @@ var ProgressBar = ({
|
|
|
16747
17127
|
hasBottomLabel && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2", children: labelNode })
|
|
16748
17128
|
] });
|
|
16749
17129
|
};
|
|
16750
|
-
var
|
|
17130
|
+
var sizes2 = {
|
|
16751
17131
|
["xs" /* xs */]: "text-[10px]",
|
|
16752
17132
|
["sm" /* sm */]: "text-xs",
|
|
16753
17133
|
["md" /* md */]: "text-sm",
|
|
@@ -16777,7 +17157,7 @@ var StarRating = ({
|
|
|
16777
17157
|
className: cn(
|
|
16778
17158
|
"inline-flex items-center gap-[2px]",
|
|
16779
17159
|
"text-yellow-500 dark:text-yellow-400",
|
|
16780
|
-
|
|
17160
|
+
sizes2[size],
|
|
16781
17161
|
iconClassName
|
|
16782
17162
|
),
|
|
16783
17163
|
children: [
|
|
@@ -16790,7 +17170,7 @@ var StarRating = ({
|
|
|
16790
17170
|
showValue && valuePosition === "end" && ratingValue
|
|
16791
17171
|
] });
|
|
16792
17172
|
};
|
|
16793
|
-
var
|
|
17173
|
+
var sizes3 = {
|
|
16794
17174
|
["xs" /* xs */]: {
|
|
16795
17175
|
value: "text-2xl",
|
|
16796
17176
|
review: "text-xs"
|
|
@@ -16822,7 +17202,7 @@ var NumericRating = ({
|
|
|
16822
17202
|
className,
|
|
16823
17203
|
...rest
|
|
16824
17204
|
}) => {
|
|
16825
|
-
const sizeStyles =
|
|
17205
|
+
const sizeStyles = sizes3[size];
|
|
16826
17206
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16827
17207
|
"div",
|
|
16828
17208
|
{
|
|
@@ -17254,8 +17634,8 @@ var Table = ({
|
|
|
17254
17634
|
}) => {
|
|
17255
17635
|
const eui = useEUIConfig();
|
|
17256
17636
|
const resolvedShape = shape ?? eui?.config?.global?.shape ?? "square";
|
|
17257
|
-
const [sortKey, setSortKey] =
|
|
17258
|
-
const [sortOrder, setSortOrder] =
|
|
17637
|
+
const [sortKey, setSortKey] = React26.useState(null);
|
|
17638
|
+
const [sortOrder, setSortOrder] = React26.useState("asc");
|
|
17259
17639
|
const toggleSort = (key) => {
|
|
17260
17640
|
if (sortKey === key) {
|
|
17261
17641
|
setSortOrder((prev) => prev === "asc" ? "desc" : "asc");
|
|
@@ -17264,7 +17644,7 @@ var Table = ({
|
|
|
17264
17644
|
setSortOrder("asc");
|
|
17265
17645
|
}
|
|
17266
17646
|
};
|
|
17267
|
-
const sortedData =
|
|
17647
|
+
const sortedData = React26.useMemo(() => {
|
|
17268
17648
|
if (!sortKey) return data;
|
|
17269
17649
|
return [...data].sort((a2, b) => {
|
|
17270
17650
|
const aVal = a2[sortKey];
|
|
@@ -17345,8 +17725,8 @@ var Tooltip6 = ({
|
|
|
17345
17725
|
style: style2,
|
|
17346
17726
|
...rest
|
|
17347
17727
|
}) => {
|
|
17348
|
-
const [pos, setPos] =
|
|
17349
|
-
|
|
17728
|
+
const [pos, setPos] = React26.useState({ x: 0, y: 0 });
|
|
17729
|
+
React26.useEffect(() => {
|
|
17350
17730
|
if (!show) return;
|
|
17351
17731
|
const handleMove = (e) => {
|
|
17352
17732
|
setPos({ x: e.clientX + offsetX, y: e.clientY + offsetY });
|
|
@@ -17536,17 +17916,17 @@ var YoutubeVideo = ({
|
|
|
17536
17916
|
}
|
|
17537
17917
|
) });
|
|
17538
17918
|
};
|
|
17539
|
-
var ThemeContext =
|
|
17919
|
+
var ThemeContext = React26.createContext(
|
|
17540
17920
|
void 0
|
|
17541
17921
|
);
|
|
17542
17922
|
var ThemeProvider = ({
|
|
17543
17923
|
defaultTheme = "dark",
|
|
17544
17924
|
children: children3
|
|
17545
17925
|
}) => {
|
|
17546
|
-
const [theme, setTheme] =
|
|
17926
|
+
const [theme, setTheme] = React26.useState(() => {
|
|
17547
17927
|
return localStorage.getItem("theme") || defaultTheme;
|
|
17548
17928
|
});
|
|
17549
|
-
|
|
17929
|
+
React26.useEffect(() => {
|
|
17550
17930
|
if (theme === "dark") {
|
|
17551
17931
|
document.documentElement.classList.add("dark");
|
|
17552
17932
|
} else {
|
|
@@ -17560,7 +17940,7 @@ var ThemeProvider = ({
|
|
|
17560
17940
|
return /* @__PURE__ */ jsxRuntime.jsx(ThemeContext.Provider, { value: { theme, setTheme, toggleTheme }, children: children3 });
|
|
17561
17941
|
};
|
|
17562
17942
|
var ThemeSwitch = () => {
|
|
17563
|
-
const themeContext =
|
|
17943
|
+
const themeContext = React26.useContext(ThemeContext);
|
|
17564
17944
|
if (!themeContext) return null;
|
|
17565
17945
|
const { theme, toggleTheme } = themeContext;
|
|
17566
17946
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -17586,7 +17966,7 @@ var ThemeSwitch = () => {
|
|
|
17586
17966
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17587
17967
|
"div",
|
|
17588
17968
|
{
|
|
17589
|
-
className:
|
|
17969
|
+
className: classNames74__default.default(
|
|
17590
17970
|
"w-6 h-6 bg-white dark:bg-gray-600 rounded-full shadow-md transition-transform duration-300",
|
|
17591
17971
|
theme === "dark" ? "translate-x-8" : "translate-x-0"
|
|
17592
17972
|
)
|
|
@@ -17596,11 +17976,44 @@ var ThemeSwitch = () => {
|
|
|
17596
17976
|
}
|
|
17597
17977
|
);
|
|
17598
17978
|
};
|
|
17979
|
+
function ThemeSelect({
|
|
17980
|
+
ariaLabel,
|
|
17981
|
+
label,
|
|
17982
|
+
onChange,
|
|
17983
|
+
options,
|
|
17984
|
+
value
|
|
17985
|
+
}) {
|
|
17986
|
+
const id2 = React26.useId();
|
|
17987
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
17988
|
+
"label",
|
|
17989
|
+
{
|
|
17990
|
+
className: "inline-flex w-fit min-w-[112px] flex-col rounded-md border border-gray-300 bg-white px-2 py-1 shadow-sm dark:bg-gray-800",
|
|
17991
|
+
htmlFor: id2,
|
|
17992
|
+
children: [
|
|
17993
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-medium leading-3 text-gray-500 dark:text-gray-300", children: label }),
|
|
17994
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17995
|
+
"select",
|
|
17996
|
+
{
|
|
17997
|
+
"aria-label": ariaLabel ?? label,
|
|
17998
|
+
className: "h-5 bg-transparent p-0 text-sm leading-5 text-gray-900 outline-none dark:text-gray-100",
|
|
17999
|
+
id: id2,
|
|
18000
|
+
onChange: (event) => onChange?.(event.target.value),
|
|
18001
|
+
value,
|
|
18002
|
+
children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: option.value, children: option.label }, option.value))
|
|
18003
|
+
}
|
|
18004
|
+
)
|
|
18005
|
+
]
|
|
18006
|
+
}
|
|
18007
|
+
);
|
|
18008
|
+
}
|
|
18009
|
+
var shapeOptions = Object.keys(Shape).map((shape) => ({
|
|
18010
|
+
label: shape,
|
|
18011
|
+
value: shape
|
|
18012
|
+
}));
|
|
17599
18013
|
var ShapeSwitch = () => {
|
|
17600
18014
|
const { config, setConfig } = useEUIConfig();
|
|
17601
18015
|
const currentShape = config.global?.shape ?? "square";
|
|
17602
|
-
const handleChange = (
|
|
17603
|
-
const shape = e.target.value;
|
|
18016
|
+
const handleChange = (shape) => {
|
|
17604
18017
|
setConfig((prev) => ({
|
|
17605
18018
|
...prev,
|
|
17606
18019
|
global: {
|
|
@@ -17609,20 +18022,46 @@ var ShapeSwitch = () => {
|
|
|
17609
18022
|
}
|
|
17610
18023
|
}));
|
|
17611
18024
|
};
|
|
17612
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17613
|
-
|
|
18025
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18026
|
+
ThemeSelect,
|
|
17614
18027
|
{
|
|
17615
|
-
|
|
18028
|
+
ariaLabel: "Global shape",
|
|
18029
|
+
label: "Shape",
|
|
17616
18030
|
onChange: handleChange,
|
|
17617
|
-
|
|
17618
|
-
|
|
18031
|
+
options: shapeOptions,
|
|
18032
|
+
value: currentShape
|
|
17619
18033
|
}
|
|
17620
|
-
)
|
|
18034
|
+
);
|
|
18035
|
+
};
|
|
18036
|
+
var previewOptions = [
|
|
18037
|
+
{
|
|
18038
|
+
label: "Web",
|
|
18039
|
+
value: "web"
|
|
18040
|
+
},
|
|
18041
|
+
{
|
|
18042
|
+
label: "Native",
|
|
18043
|
+
value: "native"
|
|
18044
|
+
}
|
|
18045
|
+
];
|
|
18046
|
+
var PreviewSwitch = ({
|
|
18047
|
+
onChange,
|
|
18048
|
+
value = "web"
|
|
18049
|
+
}) => {
|
|
18050
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18051
|
+
ThemeSelect,
|
|
18052
|
+
{
|
|
18053
|
+
ariaLabel: "Preview platform",
|
|
18054
|
+
label: "Preview",
|
|
18055
|
+
onChange,
|
|
18056
|
+
options: previewOptions,
|
|
18057
|
+
value
|
|
18058
|
+
}
|
|
18059
|
+
);
|
|
17621
18060
|
};
|
|
17622
18061
|
|
|
17623
18062
|
// src/hooks/theme/useCurrentTheme.ts
|
|
17624
18063
|
var useCurrentTheme = () => {
|
|
17625
|
-
const context =
|
|
18064
|
+
const context = React26.useContext(ThemeContext);
|
|
17626
18065
|
if (!context) {
|
|
17627
18066
|
throw new Error("useCurrentTheme must be used within a ThemeProvider");
|
|
17628
18067
|
}
|
|
@@ -28965,7 +29404,7 @@ var WorldMap = ({
|
|
|
28965
29404
|
}
|
|
28966
29405
|
};
|
|
28967
29406
|
const mode = isDarkMode ? mapStyles.dark : mapStyles.light;
|
|
28968
|
-
const resolvedData =
|
|
29407
|
+
const resolvedData = React26.useMemo(() => {
|
|
28969
29408
|
return data.map((item) => {
|
|
28970
29409
|
const c3 = COUNTRIES.find((x3) => x3.code === item.code);
|
|
28971
29410
|
if (!c3) return null;
|
|
@@ -28977,8 +29416,8 @@ var WorldMap = ({
|
|
|
28977
29416
|
}).filter(Boolean);
|
|
28978
29417
|
}, [data]);
|
|
28979
29418
|
const maxValue = resolvedData.length > 0 ? Math.max(...resolvedData.map((d) => d.value)) : 0;
|
|
28980
|
-
const [showTooltip, setShowTooltip] =
|
|
28981
|
-
const [tooltipContent, setTooltipContent] =
|
|
29419
|
+
const [showTooltip, setShowTooltip] = React26.useState(false);
|
|
29420
|
+
const [tooltipContent, setTooltipContent] = React26.useState(null);
|
|
28982
29421
|
const handleMouseMove = (_event, point5) => {
|
|
28983
29422
|
setTooltipContent(
|
|
28984
29423
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
@@ -29075,7 +29514,7 @@ function AsyncStateCard({
|
|
|
29075
29514
|
isError ? /* @__PURE__ */ jsxRuntime.jsx(FormResponse_default, { text: message, variant: "danger" }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-eui-dark-500 dark:text-eui-light-400", children: message })
|
|
29076
29515
|
] }),
|
|
29077
29516
|
onAction && actionText && /* @__PURE__ */ jsxRuntime.jsx(
|
|
29078
|
-
|
|
29517
|
+
Button_web_default,
|
|
29079
29518
|
{
|
|
29080
29519
|
type: "button",
|
|
29081
29520
|
text: actionText,
|
|
@@ -29090,7 +29529,7 @@ function AsyncStateCard({
|
|
|
29090
29529
|
}
|
|
29091
29530
|
);
|
|
29092
29531
|
}
|
|
29093
|
-
var AsyncStateCard_default =
|
|
29532
|
+
var AsyncStateCard_default = React26__default.default.memo(AsyncStateCard);
|
|
29094
29533
|
|
|
29095
29534
|
// src/components/utils/async-component-wrapper/asyncError.utils.ts
|
|
29096
29535
|
var getDefaultErrorMessage = (error) => {
|
|
@@ -29149,22 +29588,22 @@ function AsyncComponentWrapper({
|
|
|
29149
29588
|
contentClassName,
|
|
29150
29589
|
stateClassName
|
|
29151
29590
|
}) {
|
|
29152
|
-
const [isRetrying, setIsRetrying] =
|
|
29153
|
-
const retryTimerRef =
|
|
29154
|
-
const errorMessage =
|
|
29591
|
+
const [isRetrying, setIsRetrying] = React26.useState(false);
|
|
29592
|
+
const retryTimerRef = React26.useRef(null);
|
|
29593
|
+
const errorMessage = React26.useMemo(() => {
|
|
29155
29594
|
if (!isError) return "";
|
|
29156
29595
|
return errorFormatter ? errorFormatter(error) : getDefaultErrorMessage(error);
|
|
29157
29596
|
}, [isError, error, errorFormatter]);
|
|
29158
29597
|
const hasSuccess = isSuccess ?? (!isLoading && !isError && !isUninitialized);
|
|
29159
29598
|
const shouldShowRetryLoading = showLoadingOnRetry && (isRetrying || isFetching && isError);
|
|
29160
29599
|
const shouldShowLoading = isLoading || shouldShowRetryLoading;
|
|
29161
|
-
const clearRetryTimer =
|
|
29600
|
+
const clearRetryTimer = React26.useCallback(() => {
|
|
29162
29601
|
if (retryTimerRef.current) {
|
|
29163
29602
|
clearTimeout(retryTimerRef.current);
|
|
29164
29603
|
retryTimerRef.current = null;
|
|
29165
29604
|
}
|
|
29166
29605
|
}, []);
|
|
29167
|
-
const handleRetry =
|
|
29606
|
+
const handleRetry = React26.useCallback(() => {
|
|
29168
29607
|
if (!onRetry) return;
|
|
29169
29608
|
clearRetryTimer();
|
|
29170
29609
|
setIsRetrying(true);
|
|
@@ -29184,12 +29623,12 @@ function AsyncComponentWrapper({
|
|
|
29184
29623
|
throw retryError;
|
|
29185
29624
|
}
|
|
29186
29625
|
}, [onRetry, clearRetryTimer, retryLoadingFallbackMs]);
|
|
29187
|
-
|
|
29626
|
+
React26.useEffect(() => {
|
|
29188
29627
|
if (!isLoading && !isFetching && !isError) {
|
|
29189
29628
|
setIsRetrying(false);
|
|
29190
29629
|
}
|
|
29191
29630
|
}, [isLoading, isFetching, isError]);
|
|
29192
|
-
|
|
29631
|
+
React26.useEffect(() => {
|
|
29193
29632
|
return () => {
|
|
29194
29633
|
clearRetryTimer();
|
|
29195
29634
|
};
|
|
@@ -29271,7 +29710,7 @@ function AsyncComponentWrapper({
|
|
|
29271
29710
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(contentClassName), children: children3 })
|
|
29272
29711
|
] });
|
|
29273
29712
|
}
|
|
29274
|
-
var AsyncComponentWrapper_default =
|
|
29713
|
+
var AsyncComponentWrapper_default = React26__default.default.memo(AsyncComponentWrapper);
|
|
29275
29714
|
function Modal({
|
|
29276
29715
|
title,
|
|
29277
29716
|
show = false,
|
|
@@ -29287,7 +29726,7 @@ function Modal({
|
|
|
29287
29726
|
}) {
|
|
29288
29727
|
const eui = useEUIConfig();
|
|
29289
29728
|
const resolvedShape = shape ?? eui?.config?.global?.shape ?? "square";
|
|
29290
|
-
const modalRef =
|
|
29729
|
+
const modalRef = React26.useRef(null);
|
|
29291
29730
|
useClickOutside(
|
|
29292
29731
|
modalRef,
|
|
29293
29732
|
enableCloseOnClickOutside ? handleOnClose : void 0
|
|
@@ -29296,7 +29735,7 @@ function Modal({
|
|
|
29296
29735
|
"div",
|
|
29297
29736
|
{
|
|
29298
29737
|
ref: modalRef,
|
|
29299
|
-
className:
|
|
29738
|
+
className: classNames74__default.default(
|
|
29300
29739
|
"eui-bg-md eui-shadow-lg border border-gray-700/80 w-fit h-fit",
|
|
29301
29740
|
shapes[resolvedShape],
|
|
29302
29741
|
styles
|
|
@@ -29308,7 +29747,7 @@ function Modal({
|
|
|
29308
29747
|
"button",
|
|
29309
29748
|
{
|
|
29310
29749
|
type: "button",
|
|
29311
|
-
className:
|
|
29750
|
+
className: classNames74__default.default(
|
|
29312
29751
|
"w-[60px] h-[60px] flex items-center justify-center transition-standard-fast",
|
|
29313
29752
|
"hover:cursor-pointer hover:bg-eui-dark-500"
|
|
29314
29753
|
),
|
|
@@ -29333,7 +29772,7 @@ function Modal({
|
|
|
29333
29772
|
}
|
|
29334
29773
|
var Modal_default = Modal;
|
|
29335
29774
|
var useAnalytics = () => {
|
|
29336
|
-
const context =
|
|
29775
|
+
const context = React26.useContext(AnalyticsContext);
|
|
29337
29776
|
if (!context) {
|
|
29338
29777
|
throw new Error("useAnalytics must be used within an AnalyticsProvider.");
|
|
29339
29778
|
}
|
|
@@ -29373,10 +29812,10 @@ var CookiePreferencesModal = ({
|
|
|
29373
29812
|
...rest
|
|
29374
29813
|
}) => {
|
|
29375
29814
|
const { consent, updateConsent } = useCookieConsent();
|
|
29376
|
-
const [selectedCategories, setSelectedCategories] =
|
|
29815
|
+
const [selectedCategories, setSelectedCategories] = React26.useState(
|
|
29377
29816
|
consent.categories
|
|
29378
29817
|
);
|
|
29379
|
-
|
|
29818
|
+
React26.useEffect(() => {
|
|
29380
29819
|
setSelectedCategories(consent.categories);
|
|
29381
29820
|
}, [consent.categories, open]);
|
|
29382
29821
|
const saveLabel = labels?.save ?? "Save preferences";
|
|
@@ -29438,7 +29877,7 @@ var CookiePreferencesModal = ({
|
|
|
29438
29877
|
}) }),
|
|
29439
29878
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-5 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", children: [
|
|
29440
29879
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
29441
|
-
|
|
29880
|
+
Button_web_default,
|
|
29442
29881
|
{
|
|
29443
29882
|
type: "button",
|
|
29444
29883
|
text: cancelLabel,
|
|
@@ -29450,7 +29889,7 @@ var CookiePreferencesModal = ({
|
|
|
29450
29889
|
}
|
|
29451
29890
|
),
|
|
29452
29891
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
29453
|
-
|
|
29892
|
+
Button_web_default,
|
|
29454
29893
|
{
|
|
29455
29894
|
type: "button",
|
|
29456
29895
|
text: saveLabel,
|
|
@@ -29488,8 +29927,8 @@ var CookieBanner = ({
|
|
|
29488
29927
|
...rest
|
|
29489
29928
|
}) => {
|
|
29490
29929
|
const { consent, acceptAll, rejectAll } = useCookieConsent();
|
|
29491
|
-
const [preferencesOpen, setPreferencesOpen] =
|
|
29492
|
-
const shouldRender =
|
|
29930
|
+
const [preferencesOpen, setPreferencesOpen] = React26.useState(false);
|
|
29931
|
+
const shouldRender = React26.useMemo(() => consent.status === "unset", [consent]);
|
|
29493
29932
|
if (!shouldRender) return null;
|
|
29494
29933
|
const acceptAllLabel = labels?.acceptAll ?? "Accept all";
|
|
29495
29934
|
const rejectAllLabel = labels?.rejectAll ?? "Reject optional";
|
|
@@ -29542,7 +29981,7 @@ var CookieBanner = ({
|
|
|
29542
29981
|
] }),
|
|
29543
29982
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
29544
29983
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
29545
|
-
|
|
29984
|
+
Button_web_default,
|
|
29546
29985
|
{
|
|
29547
29986
|
type: "button",
|
|
29548
29987
|
text: acceptAllLabel,
|
|
@@ -29554,7 +29993,7 @@ var CookieBanner = ({
|
|
|
29554
29993
|
}
|
|
29555
29994
|
),
|
|
29556
29995
|
showCustomize ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
29557
|
-
|
|
29996
|
+
Button_web_default,
|
|
29558
29997
|
{
|
|
29559
29998
|
type: "button",
|
|
29560
29999
|
text: customizeLabel,
|
|
@@ -29566,7 +30005,7 @@ var CookieBanner = ({
|
|
|
29566
30005
|
}
|
|
29567
30006
|
) : null,
|
|
29568
30007
|
showRejectAll ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
29569
|
-
|
|
30008
|
+
Button_web_default,
|
|
29570
30009
|
{
|
|
29571
30010
|
type: "button",
|
|
29572
30011
|
text: rejectAllLabel,
|
|
@@ -29598,42 +30037,109 @@ var CookieBanner = ({
|
|
|
29598
30037
|
var usePageTracking = ({
|
|
29599
30038
|
path: path2,
|
|
29600
30039
|
search: search3 = "",
|
|
30040
|
+
title,
|
|
30041
|
+
fullUrl,
|
|
30042
|
+
metadata,
|
|
29601
30043
|
enabled = true,
|
|
30044
|
+
trackPageLeave = false,
|
|
29602
30045
|
dedupe = true
|
|
29603
30046
|
}) => {
|
|
29604
30047
|
const { track } = useAnalytics();
|
|
29605
|
-
const trackRef =
|
|
29606
|
-
const
|
|
29607
|
-
|
|
30048
|
+
const trackRef = React26.useRef(track);
|
|
30049
|
+
const enteredAtRef = React26.useRef(Date.now());
|
|
30050
|
+
const previousPathRef = React26.useRef(null);
|
|
30051
|
+
const trackedPathsRef = React26.useRef(/* @__PURE__ */ new Set());
|
|
30052
|
+
React26.useEffect(() => {
|
|
29608
30053
|
trackRef.current = track;
|
|
29609
30054
|
}, [track]);
|
|
29610
|
-
|
|
30055
|
+
const metadataKey = React26.useMemo(() => JSON.stringify(metadata ?? {}), [metadata]);
|
|
30056
|
+
React26.useEffect(() => {
|
|
29611
30057
|
if (!enabled) return;
|
|
29612
30058
|
const nextPath = `${path2}${search3}`;
|
|
29613
30059
|
if (!nextPath) return;
|
|
29614
|
-
if (dedupe &&
|
|
30060
|
+
if (dedupe && trackedPathsRef.current.has(nextPath)) {
|
|
29615
30061
|
return;
|
|
29616
30062
|
}
|
|
30063
|
+
if (trackPageLeave && previousPathRef.current) {
|
|
30064
|
+
const durationMs = Date.now() - enteredAtRef.current;
|
|
30065
|
+
trackRef.current("page_leave", {
|
|
30066
|
+
path: previousPathRef.current,
|
|
30067
|
+
durationMs,
|
|
30068
|
+
metadata
|
|
30069
|
+
});
|
|
30070
|
+
}
|
|
30071
|
+
enteredAtRef.current = Date.now();
|
|
29617
30072
|
previousPathRef.current = nextPath;
|
|
30073
|
+
trackedPathsRef.current.add(nextPath);
|
|
29618
30074
|
trackRef.current("page_view", {
|
|
29619
|
-
path: nextPath
|
|
30075
|
+
path: nextPath,
|
|
30076
|
+
title,
|
|
30077
|
+
fullUrl,
|
|
30078
|
+
metadata
|
|
29620
30079
|
});
|
|
29621
|
-
|
|
30080
|
+
return () => {
|
|
30081
|
+
if (!trackPageLeave) return;
|
|
30082
|
+
const durationMs = Date.now() - enteredAtRef.current;
|
|
30083
|
+
trackRef.current("page_leave", {
|
|
30084
|
+
path: nextPath,
|
|
30085
|
+
durationMs,
|
|
30086
|
+
metadata
|
|
30087
|
+
});
|
|
30088
|
+
};
|
|
30089
|
+
}, [
|
|
30090
|
+
dedupe,
|
|
30091
|
+
enabled,
|
|
30092
|
+
fullUrl,
|
|
30093
|
+
metadataKey,
|
|
30094
|
+
path2,
|
|
30095
|
+
search3,
|
|
30096
|
+
title,
|
|
30097
|
+
trackPageLeave
|
|
30098
|
+
]);
|
|
29622
30099
|
};
|
|
29623
|
-
|
|
29624
|
-
// src/components/analytics/hooks/useSessionTracking.ts
|
|
29625
30100
|
var useSessionTracking = ({
|
|
29626
|
-
enabled = true
|
|
30101
|
+
enabled = true,
|
|
30102
|
+
metadata
|
|
29627
30103
|
} = {}) => {
|
|
29628
|
-
|
|
30104
|
+
const { track } = useAnalytics();
|
|
30105
|
+
const startedAtRef = React26.useRef(Date.now());
|
|
30106
|
+
const endedRef = React26.useRef(false);
|
|
30107
|
+
React26.useEffect(() => {
|
|
30108
|
+
if (!enabled || !isBrowser()) return;
|
|
30109
|
+
startedAtRef.current = Date.now();
|
|
30110
|
+
endedRef.current = false;
|
|
30111
|
+
track("session_start", {
|
|
30112
|
+
metadata
|
|
30113
|
+
});
|
|
30114
|
+
const endSession = () => {
|
|
30115
|
+
if (endedRef.current) return;
|
|
30116
|
+
endedRef.current = true;
|
|
30117
|
+
track("session_end", {
|
|
30118
|
+
durationMs: Date.now() - startedAtRef.current,
|
|
30119
|
+
metadata
|
|
30120
|
+
});
|
|
30121
|
+
};
|
|
30122
|
+
const handleVisibilityChange = () => {
|
|
30123
|
+
if (document.visibilityState === "hidden") {
|
|
30124
|
+
endSession();
|
|
30125
|
+
}
|
|
30126
|
+
};
|
|
30127
|
+
window.addEventListener("pagehide", endSession);
|
|
30128
|
+
document.addEventListener("visibilitychange", handleVisibilityChange);
|
|
30129
|
+
return () => {
|
|
30130
|
+
endSession();
|
|
30131
|
+
window.removeEventListener("pagehide", endSession);
|
|
30132
|
+
document.removeEventListener("visibilitychange", handleVisibilityChange);
|
|
30133
|
+
};
|
|
30134
|
+
}, [enabled, metadata, track]);
|
|
29629
30135
|
};
|
|
29630
|
-
var ContentArea =
|
|
30136
|
+
var ContentArea = React26.forwardRef(
|
|
29631
30137
|
({ children: children3, styles, enablePadding = false }, ref) => {
|
|
29632
30138
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
29633
30139
|
"div",
|
|
29634
30140
|
{
|
|
29635
30141
|
ref,
|
|
29636
|
-
className:
|
|
30142
|
+
className: classNames74__default.default({
|
|
29637
30143
|
"min-h-screen h-full w-full transition-all duration-[200ms]": true,
|
|
29638
30144
|
"py-3 px-5": !enablePadding,
|
|
29639
30145
|
"py-3 px-5 lg:px-[150px]": enablePadding,
|
|
@@ -29650,7 +30156,7 @@ function FlexCol({ children: children3, gap = 3, styles }) {
|
|
|
29650
30156
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
29651
30157
|
"div",
|
|
29652
30158
|
{
|
|
29653
|
-
className:
|
|
30159
|
+
className: classNames74__default.default({
|
|
29654
30160
|
[`flex flex-col gap-${gap}`]: true,
|
|
29655
30161
|
[`${styles}`]: styles
|
|
29656
30162
|
}),
|
|
@@ -29663,7 +30169,7 @@ function FlexRow({ children: children3, gap = 3, styles }) {
|
|
|
29663
30169
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
29664
30170
|
"div",
|
|
29665
30171
|
{
|
|
29666
|
-
className:
|
|
30172
|
+
className: classNames74__default.default({
|
|
29667
30173
|
[`flex flex-row gap-${gap}`]: true,
|
|
29668
30174
|
[`${styles}`]: styles
|
|
29669
30175
|
}),
|
|
@@ -29682,7 +30188,7 @@ function Grid({ children: children3, styles }) {
|
|
|
29682
30188
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
29683
30189
|
"div",
|
|
29684
30190
|
{
|
|
29685
|
-
className:
|
|
30191
|
+
className: classNames74__default.default({
|
|
29686
30192
|
[`grid`]: true,
|
|
29687
30193
|
[`${styles}`]: styles
|
|
29688
30194
|
}),
|
|
@@ -29699,7 +30205,7 @@ var Layout = ({
|
|
|
29699
30205
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
29700
30206
|
"div",
|
|
29701
30207
|
{
|
|
29702
|
-
className:
|
|
30208
|
+
className: classNames74__default.default({
|
|
29703
30209
|
// "flex h-full w-screen bg-gray-100 overflow-auto": true,
|
|
29704
30210
|
"flex bg-eui-light-600": true,
|
|
29705
30211
|
"flex-col": flexDirection === "vertical",
|
|
@@ -29713,12 +30219,15 @@ var Layout = ({
|
|
|
29713
30219
|
var Header = ({
|
|
29714
30220
|
position: position4 = "static",
|
|
29715
30221
|
children: children3,
|
|
30222
|
+
onPreviewPlatformChange,
|
|
30223
|
+
previewPlatform = "web",
|
|
30224
|
+
showPreviewPlatformSelector = false,
|
|
29716
30225
|
styles
|
|
29717
30226
|
}) => {
|
|
29718
30227
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
29719
30228
|
"div",
|
|
29720
30229
|
{
|
|
29721
|
-
className:
|
|
30230
|
+
className: classNames74__default.default({
|
|
29722
30231
|
static: position4 === "static",
|
|
29723
30232
|
fixed: position4 === "fixed",
|
|
29724
30233
|
sticky: position4 === "sticky",
|
|
@@ -29727,9 +30236,16 @@ var Header = ({
|
|
|
29727
30236
|
[`${styles}`]: styles
|
|
29728
30237
|
}),
|
|
29729
30238
|
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full", children: children3 ? children3 : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row w-full items-center justify-between px-4", children: [
|
|
29730
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { children: "
|
|
30239
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { children: "elseware UI" }),
|
|
29731
30240
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row gap-3 items-center", children: [
|
|
29732
30241
|
/* @__PURE__ */ jsxRuntime.jsx(ThemeSwitch, {}),
|
|
30242
|
+
showPreviewPlatformSelector ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
30243
|
+
PreviewSwitch,
|
|
30244
|
+
{
|
|
30245
|
+
onChange: onPreviewPlatformChange,
|
|
30246
|
+
value: previewPlatform
|
|
30247
|
+
}
|
|
30248
|
+
) : null,
|
|
29733
30249
|
/* @__PURE__ */ jsxRuntime.jsx(ShapeSwitch, {})
|
|
29734
30250
|
] })
|
|
29735
30251
|
] }) })
|
|
@@ -29746,7 +30262,7 @@ var Content = ({
|
|
|
29746
30262
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
29747
30263
|
"div",
|
|
29748
30264
|
{
|
|
29749
|
-
className:
|
|
30265
|
+
className: classNames74__default.default({
|
|
29750
30266
|
"w-full min-h-screen transition-all duration-200 eui-bg-sm": true,
|
|
29751
30267
|
"md:pl-[300px]": !overlayedSidebar && sidebarVisible && !isMobile,
|
|
29752
30268
|
// Shift when sidebar is open (desktop)
|
|
@@ -29762,7 +30278,7 @@ var Footer = ({ children: children3, styles }) => {
|
|
|
29762
30278
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
29763
30279
|
"div",
|
|
29764
30280
|
{
|
|
29765
|
-
className:
|
|
30281
|
+
className: classNames74__default.default({
|
|
29766
30282
|
"bottom-0 w-full h-fit": true,
|
|
29767
30283
|
"border-t border-eui-dark-500/40 dark:border-eui-secondary-800 eui-bg-md": !styles,
|
|
29768
30284
|
[`${styles}`]: styles
|
|
@@ -29847,8 +30363,8 @@ var GlowWrapper = ({
|
|
|
29847
30363
|
className = "",
|
|
29848
30364
|
hideOnLeave = true
|
|
29849
30365
|
}) => {
|
|
29850
|
-
const ref =
|
|
29851
|
-
const handleMove =
|
|
30366
|
+
const ref = React26.useRef(null);
|
|
30367
|
+
const handleMove = React26.useCallback(
|
|
29852
30368
|
(e) => {
|
|
29853
30369
|
const el = ref.current;
|
|
29854
30370
|
if (!el) return;
|
|
@@ -29870,7 +30386,7 @@ var GlowWrapper = ({
|
|
|
29870
30386
|
},
|
|
29871
30387
|
[glowSize, glowColor]
|
|
29872
30388
|
);
|
|
29873
|
-
const handleLeave =
|
|
30389
|
+
const handleLeave = React26.useCallback(() => {
|
|
29874
30390
|
const el = ref.current;
|
|
29875
30391
|
if (!el || !hideOnLeave) return;
|
|
29876
30392
|
el.style.setProperty("--glow-x", `-999px`);
|
|
@@ -29896,7 +30412,7 @@ var GlowWrapper = ({
|
|
|
29896
30412
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
29897
30413
|
"span",
|
|
29898
30414
|
{
|
|
29899
|
-
className: "\n pointer-events-none absolute inset-0 opacity-0 \n group-hover:opacity-100 transition-opacity duration-300\n ",
|
|
30415
|
+
className: "\r\n pointer-events-none absolute inset-0 opacity-0 \r\n group-hover:opacity-100 transition-opacity duration-300\r\n ",
|
|
29900
30416
|
style: { background: "var(--glow-bg)" }
|
|
29901
30417
|
}
|
|
29902
30418
|
),
|
|
@@ -29915,8 +30431,8 @@ function InfiniteScrollTrigger({
|
|
|
29915
30431
|
threshold = 0,
|
|
29916
30432
|
onLoadMore
|
|
29917
30433
|
}) {
|
|
29918
|
-
const triggerRef =
|
|
29919
|
-
|
|
30434
|
+
const triggerRef = React26.useRef(null);
|
|
30435
|
+
React26.useEffect(() => {
|
|
29920
30436
|
const element7 = triggerRef.current;
|
|
29921
30437
|
if (!element7 || !hasMore || isLoading) {
|
|
29922
30438
|
return;
|
|
@@ -29942,7 +30458,7 @@ function InfiniteScrollTrigger({
|
|
|
29942
30458
|
}
|
|
29943
30459
|
var InfiniteScrollTrigger_default = InfiniteScrollTrigger;
|
|
29944
30460
|
function ShowMore({ text: text10, limit }) {
|
|
29945
|
-
const [showMore, setShowMore] =
|
|
30461
|
+
const [showMore, setShowMore] = React26.useState(false);
|
|
29946
30462
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
29947
30463
|
showMore ? text10 : `${text10.substring(0, limit)}`,
|
|
29948
30464
|
text10.length > limit && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
@@ -29950,7 +30466,7 @@ function ShowMore({ text: text10, limit }) {
|
|
|
29950
30466
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
29951
30467
|
"div",
|
|
29952
30468
|
{
|
|
29953
|
-
className:
|
|
30469
|
+
className: classNames74__default.default({
|
|
29954
30470
|
"text-blue-300 px-1 pb-1 mt-1": true,
|
|
29955
30471
|
"bg-slate-900/70": !showMore,
|
|
29956
30472
|
"bg-gradient-to-t from-slate-900/50 to-transparent": showMore
|
|
@@ -29977,8 +30493,8 @@ function CommentComposer({
|
|
|
29977
30493
|
loading,
|
|
29978
30494
|
onSubmit
|
|
29979
30495
|
}) {
|
|
29980
|
-
const [value, setValue] =
|
|
29981
|
-
const [focused, setFocused] =
|
|
30496
|
+
const [value, setValue] = React26.useState("");
|
|
30497
|
+
const [focused, setFocused] = React26.useState(false);
|
|
29982
30498
|
async function handleSubmit() {
|
|
29983
30499
|
const content3 = value.trim();
|
|
29984
30500
|
if (!content3) {
|
|
@@ -30008,7 +30524,7 @@ function CommentComposer({
|
|
|
30008
30524
|
),
|
|
30009
30525
|
(focused || value.length > 0) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
30010
30526
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
30011
|
-
|
|
30527
|
+
Button_web_default,
|
|
30012
30528
|
{
|
|
30013
30529
|
text: "Cancel",
|
|
30014
30530
|
variant: "secondary",
|
|
@@ -30018,7 +30534,7 @@ function CommentComposer({
|
|
|
30018
30534
|
}
|
|
30019
30535
|
),
|
|
30020
30536
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
30021
|
-
|
|
30537
|
+
Button_web_default,
|
|
30022
30538
|
{
|
|
30023
30539
|
text: submitLabel,
|
|
30024
30540
|
variant: "primary",
|
|
@@ -30233,14 +30749,14 @@ function CommentHeader({ comment: comment4, config }) {
|
|
|
30233
30749
|
}
|
|
30234
30750
|
var CommentHeader_default = CommentHeader;
|
|
30235
30751
|
var useDrawer = (defaultVisibility = true) => {
|
|
30236
|
-
const [show, setShow] =
|
|
30237
|
-
const openDrawer =
|
|
30752
|
+
const [show, setShow] = React26.useState(defaultVisibility);
|
|
30753
|
+
const openDrawer = React26.useCallback(() => {
|
|
30238
30754
|
setShow(true);
|
|
30239
30755
|
}, []);
|
|
30240
|
-
const closeDrawer =
|
|
30756
|
+
const closeDrawer = React26.useCallback(() => {
|
|
30241
30757
|
setShow(false);
|
|
30242
30758
|
}, []);
|
|
30243
|
-
const toggleDrawer =
|
|
30759
|
+
const toggleDrawer = React26.useCallback(() => {
|
|
30244
30760
|
setShow((prev) => !prev);
|
|
30245
30761
|
}, []);
|
|
30246
30762
|
return {
|
|
@@ -30252,7 +30768,7 @@ var useDrawer = (defaultVisibility = true) => {
|
|
|
30252
30768
|
};
|
|
30253
30769
|
var useDrawer_default = useDrawer;
|
|
30254
30770
|
var useModal = () => {
|
|
30255
|
-
const [show, setShow] =
|
|
30771
|
+
const [show, setShow] = React26.useState(false);
|
|
30256
30772
|
const handleOpenModal = () => {
|
|
30257
30773
|
setShow(true);
|
|
30258
30774
|
};
|
|
@@ -30267,7 +30783,7 @@ var useModal = () => {
|
|
|
30267
30783
|
};
|
|
30268
30784
|
var useModal_default = useModal;
|
|
30269
30785
|
var useTheme = () => {
|
|
30270
|
-
const context =
|
|
30786
|
+
const context = React26.useContext(ThemeContext);
|
|
30271
30787
|
if (!context) {
|
|
30272
30788
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
30273
30789
|
}
|
|
@@ -30308,7 +30824,7 @@ function CommentMenu({
|
|
|
30308
30824
|
onDelete,
|
|
30309
30825
|
onReport
|
|
30310
30826
|
}) {
|
|
30311
|
-
const ref =
|
|
30827
|
+
const ref = React26.useRef(null);
|
|
30312
30828
|
useClickOutside(ref, () => setOpen(false));
|
|
30313
30829
|
const items = [];
|
|
30314
30830
|
if (canEdit) {
|
|
@@ -30436,11 +30952,11 @@ function CommentItem({
|
|
|
30436
30952
|
onDelete,
|
|
30437
30953
|
onReport
|
|
30438
30954
|
}) {
|
|
30439
|
-
const [collapsed, setCollapsed] =
|
|
30440
|
-
const [isReplying, setIsReplying] =
|
|
30441
|
-
const [menuOpen, setMenuOpen] =
|
|
30442
|
-
const [loadingReplies, setLoadingReplies] =
|
|
30443
|
-
const [repliesLoaded, setRepliesLoaded] =
|
|
30955
|
+
const [collapsed, setCollapsed] = React26.useState(true);
|
|
30956
|
+
const [isReplying, setIsReplying] = React26.useState(false);
|
|
30957
|
+
const [menuOpen, setMenuOpen] = React26.useState(false);
|
|
30958
|
+
const [loadingReplies, setLoadingReplies] = React26.useState(false);
|
|
30959
|
+
const [repliesLoaded, setRepliesLoaded] = React26.useState(false);
|
|
30444
30960
|
const resolvedDepth = Math.min(depth, config.maxDepth);
|
|
30445
30961
|
const {
|
|
30446
30962
|
Header: HeaderComponent = CommentHeader_default,
|
|
@@ -30604,18 +31120,18 @@ function CommentThread({
|
|
|
30604
31120
|
onDelete,
|
|
30605
31121
|
onReport
|
|
30606
31122
|
}) {
|
|
30607
|
-
const [comments, setComments] =
|
|
30608
|
-
const [isLoadingComments, setIsLoadingComments] =
|
|
30609
|
-
const [replyCache, setReplyCache] =
|
|
31123
|
+
const [comments, setComments] = React26.useState([]);
|
|
31124
|
+
const [isLoadingComments, setIsLoadingComments] = React26.useState(true);
|
|
31125
|
+
const [replyCache, setReplyCache] = React26.useState(
|
|
30610
31126
|
{}
|
|
30611
31127
|
);
|
|
30612
|
-
const replyCacheRef =
|
|
31128
|
+
const replyCacheRef = React26.useRef(replyCache);
|
|
30613
31129
|
const ComposerComponent = components?.Composer ?? CommentComposer_default;
|
|
30614
31130
|
const resolvedConfig = {
|
|
30615
31131
|
...DEFAULT_COMMENT_THREAD_CONFIG,
|
|
30616
31132
|
...config
|
|
30617
31133
|
};
|
|
30618
|
-
|
|
31134
|
+
React26.useEffect(() => {
|
|
30619
31135
|
async function loadComments() {
|
|
30620
31136
|
try {
|
|
30621
31137
|
const result = await dataSource.getComments({
|
|
@@ -30629,10 +31145,10 @@ function CommentThread({
|
|
|
30629
31145
|
}
|
|
30630
31146
|
void loadComments();
|
|
30631
31147
|
}, [dataSource, resolvedConfig.commentsPerPage]);
|
|
30632
|
-
|
|
31148
|
+
React26.useEffect(() => {
|
|
30633
31149
|
replyCacheRef.current = replyCache;
|
|
30634
31150
|
}, [replyCache]);
|
|
30635
|
-
|
|
31151
|
+
React26.useEffect(() => {
|
|
30636
31152
|
let cancelled = false;
|
|
30637
31153
|
async function refreshLoadedReplies() {
|
|
30638
31154
|
const parentIds = Object.keys(replyCacheRef.current);
|
|
@@ -30668,13 +31184,13 @@ function CommentThread({
|
|
|
30668
31184
|
cancelled = true;
|
|
30669
31185
|
};
|
|
30670
31186
|
}, [dataSource, resolvedConfig.repliesPerPage]);
|
|
30671
|
-
|
|
31187
|
+
React26.useEffect(() => {
|
|
30672
31188
|
if (!updatedComment) {
|
|
30673
31189
|
return;
|
|
30674
31190
|
}
|
|
30675
31191
|
updateCommentEverywhere(updatedComment.id, () => updatedComment);
|
|
30676
31192
|
}, [updatedComment]);
|
|
30677
|
-
|
|
31193
|
+
React26.useEffect(() => {
|
|
30678
31194
|
if (!deletedComment) {
|
|
30679
31195
|
return;
|
|
30680
31196
|
}
|
|
@@ -30866,7 +31382,7 @@ function DocumentationPanel({
|
|
|
30866
31382
|
return /* @__PURE__ */ jsxRuntime.jsx(MarkdownProvider_default, { markdown: value, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
30867
31383
|
"section",
|
|
30868
31384
|
{
|
|
30869
|
-
className:
|
|
31385
|
+
className: classNames74__default.default(
|
|
30870
31386
|
"eui-documentation-panel",
|
|
30871
31387
|
"min-h-0 overflow-hidden bg-white text-gray-900",
|
|
30872
31388
|
"dark:bg-gray-950 dark:text-gray-100",
|
|
@@ -30880,7 +31396,7 @@ function DocumentationPanel({
|
|
|
30880
31396
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
30881
31397
|
"main",
|
|
30882
31398
|
{
|
|
30883
|
-
className:
|
|
31399
|
+
className: classNames74__default.default(
|
|
30884
31400
|
"eui-documentation-panel-viewer",
|
|
30885
31401
|
"documentation-panel-scrollbar min-w-0 overflow-y-auto scroll-smooth",
|
|
30886
31402
|
viewerClassName
|
|
@@ -30888,7 +31404,7 @@ function DocumentationPanel({
|
|
|
30888
31404
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
30889
31405
|
"div",
|
|
30890
31406
|
{
|
|
30891
|
-
className:
|
|
31407
|
+
className: classNames74__default.default(
|
|
30892
31408
|
"mx-auto px-5 py-8 sm:px-6 lg:px-8",
|
|
30893
31409
|
contentMaxWidthClassName,
|
|
30894
31410
|
contentClassName
|
|
@@ -30901,7 +31417,7 @@ function DocumentationPanel({
|
|
|
30901
31417
|
toc ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
30902
31418
|
"aside",
|
|
30903
31419
|
{
|
|
30904
|
-
className:
|
|
31420
|
+
className: classNames74__default.default(
|
|
30905
31421
|
"eui-documentation-panel-toc",
|
|
30906
31422
|
"hidden min-w-0 border-l border-gray-200 bg-white lg:block",
|
|
30907
31423
|
"dark:border-gray-800 dark:bg-gray-950",
|
|
@@ -30910,7 +31426,7 @@ function DocumentationPanel({
|
|
|
30910
31426
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
30911
31427
|
"div",
|
|
30912
31428
|
{
|
|
30913
|
-
className:
|
|
31429
|
+
className: classNames74__default.default(
|
|
30914
31430
|
"documentation-panel-scrollbar h-full overflow-y-auto px-5 py-8"
|
|
30915
31431
|
),
|
|
30916
31432
|
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "sticky top-0", children: /* @__PURE__ */ jsxRuntime.jsx(MarkdownTOC_default, {}) })
|
|
@@ -30955,13 +31471,13 @@ function SliderItem({
|
|
|
30955
31471
|
}
|
|
30956
31472
|
var SliderItem_default = SliderItem;
|
|
30957
31473
|
function Slider({ isLoading, isSuccess, coverArt, screenshots }) {
|
|
30958
|
-
const [images, setImages] =
|
|
31474
|
+
const [images, setImages] = React26.useState([
|
|
30959
31475
|
{
|
|
30960
31476
|
img: coverArt,
|
|
30961
31477
|
selected: true
|
|
30962
31478
|
}
|
|
30963
31479
|
]);
|
|
30964
|
-
|
|
31480
|
+
React26.useEffect(() => {
|
|
30965
31481
|
setImages([
|
|
30966
31482
|
{
|
|
30967
31483
|
img: coverArt,
|
|
@@ -30969,7 +31485,7 @@ function Slider({ isLoading, isSuccess, coverArt, screenshots }) {
|
|
|
30969
31485
|
}
|
|
30970
31486
|
]);
|
|
30971
31487
|
}, [isSuccess]);
|
|
30972
|
-
|
|
31488
|
+
React26.useEffect(() => {
|
|
30973
31489
|
if (screenshots) {
|
|
30974
31490
|
const selectableScreenshots = [];
|
|
30975
31491
|
screenshots.forEach((item) => {
|
|
@@ -30981,8 +31497,8 @@ function Slider({ isLoading, isSuccess, coverArt, screenshots }) {
|
|
|
30981
31497
|
setImages((prev) => [...prev, ...selectableScreenshots]);
|
|
30982
31498
|
}
|
|
30983
31499
|
}, [isSuccess]);
|
|
30984
|
-
const [displayImg, setDisplayImg] =
|
|
30985
|
-
|
|
31500
|
+
const [displayImg, setDisplayImg] = React26.useState(coverArt);
|
|
31501
|
+
React26.useEffect(() => {
|
|
30986
31502
|
setDisplayImg(coverArt);
|
|
30987
31503
|
}, [coverArt]);
|
|
30988
31504
|
const displayImageHandler = (itemIndex, img) => {
|
|
@@ -31094,7 +31610,7 @@ function WorldMapCountryTable({
|
|
|
31094
31610
|
title = "Country Breakdown",
|
|
31095
31611
|
data
|
|
31096
31612
|
}) {
|
|
31097
|
-
const enrichedData =
|
|
31613
|
+
const enrichedData = React26.useMemo(() => {
|
|
31098
31614
|
const mapped = data.map((item) => {
|
|
31099
31615
|
const countryMeta = COUNTRIES.find((c3) => c3.code === item.code);
|
|
31100
31616
|
return {
|
|
@@ -31107,11 +31623,11 @@ function WorldMapCountryTable({
|
|
|
31107
31623
|
});
|
|
31108
31624
|
return mapped.sort((a2, b) => b.value - a2.value);
|
|
31109
31625
|
}, [data]);
|
|
31110
|
-
const total =
|
|
31626
|
+
const total = React26.useMemo(
|
|
31111
31627
|
() => enrichedData.reduce((sum, i) => sum + i.value, 0),
|
|
31112
31628
|
[enrichedData]
|
|
31113
31629
|
);
|
|
31114
|
-
const finalData =
|
|
31630
|
+
const finalData = React26.useMemo(() => {
|
|
31115
31631
|
return enrichedData.map((item) => ({
|
|
31116
31632
|
...item,
|
|
31117
31633
|
percent: total > 0 ? item.value / total * 100 : 0
|
|
@@ -31186,7 +31702,7 @@ function BoxNavItem({ icon, name: name2, to, selected, onClick }) {
|
|
|
31186
31702
|
type: "button",
|
|
31187
31703
|
onClick: handleClick,
|
|
31188
31704
|
"aria-current": selected ? "page" : void 0,
|
|
31189
|
-
className:
|
|
31705
|
+
className: classNames74__default.default(
|
|
31190
31706
|
"w-full min-w-[80px] flex flex-col items-center justify-center py-3 text-center",
|
|
31191
31707
|
"hover:text-secondary-700 hover:bg-gray-300/10 hover:cursor-pointer",
|
|
31192
31708
|
selected ? "text-eui-secondary-700 bg-gray-300/10" : "text-gray-400",
|
|
@@ -31356,7 +31872,7 @@ var TNDropdownGroup = ({
|
|
|
31356
31872
|
navigate,
|
|
31357
31873
|
className
|
|
31358
31874
|
}) => {
|
|
31359
|
-
const [open, setOpen] =
|
|
31875
|
+
const [open, setOpen] = React26.useState(true);
|
|
31360
31876
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
31361
31877
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
31362
31878
|
"div",
|
|
@@ -31445,8 +31961,8 @@ var TNGroup = ({
|
|
|
31445
31961
|
components,
|
|
31446
31962
|
selected
|
|
31447
31963
|
}) => {
|
|
31448
|
-
const [open, setOpen] =
|
|
31449
|
-
const timeoutRef =
|
|
31964
|
+
const [open, setOpen] = React26.useState(false);
|
|
31965
|
+
const timeoutRef = React26.useRef(null);
|
|
31450
31966
|
const handleEnter = () => {
|
|
31451
31967
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
31452
31968
|
setOpen(true);
|
|
@@ -31550,14 +32066,14 @@ function ReviewForm({
|
|
|
31550
32066
|
onSubmit,
|
|
31551
32067
|
onCancel
|
|
31552
32068
|
}) {
|
|
31553
|
-
const [content3, setContent] =
|
|
31554
|
-
const [rating, setRating] =
|
|
31555
|
-
const [isRecommended, setIsRecommended] =
|
|
32069
|
+
const [content3, setContent] = React26.useState(initialValues?.content ?? "");
|
|
32070
|
+
const [rating, setRating] = React26.useState(initialValues?.rating ?? 0);
|
|
32071
|
+
const [isRecommended, setIsRecommended] = React26.useState(
|
|
31556
32072
|
initialValues?.isRecommended ?? true
|
|
31557
32073
|
);
|
|
31558
|
-
const [error, setError] =
|
|
32074
|
+
const [error, setError] = React26.useState("");
|
|
31559
32075
|
const contentLength = content3.trim().length;
|
|
31560
|
-
const ratingItems =
|
|
32076
|
+
const ratingItems = React26.useMemo(() => {
|
|
31561
32077
|
return Array.from(
|
|
31562
32078
|
{
|
|
31563
32079
|
length: config.maxRating
|
|
@@ -31565,7 +32081,7 @@ function ReviewForm({
|
|
|
31565
32081
|
(_2, index3) => index3 + 1
|
|
31566
32082
|
);
|
|
31567
32083
|
}, [config.maxRating]);
|
|
31568
|
-
|
|
32084
|
+
React26.useEffect(() => {
|
|
31569
32085
|
setContent(initialValues?.content ?? "");
|
|
31570
32086
|
setRating(initialValues?.rating ?? 0);
|
|
31571
32087
|
setIsRecommended(initialValues?.isRecommended ?? true);
|
|
@@ -31681,7 +32197,7 @@ function ReviewForm({
|
|
|
31681
32197
|
] }),
|
|
31682
32198
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
31683
32199
|
onCancel && /* @__PURE__ */ jsxRuntime.jsx(
|
|
31684
|
-
|
|
32200
|
+
Button_web_default,
|
|
31685
32201
|
{
|
|
31686
32202
|
text: cancelLabel,
|
|
31687
32203
|
variant: "secondary",
|
|
@@ -31691,7 +32207,7 @@ function ReviewForm({
|
|
|
31691
32207
|
}
|
|
31692
32208
|
),
|
|
31693
32209
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
31694
|
-
|
|
32210
|
+
Button_web_default,
|
|
31695
32211
|
{
|
|
31696
32212
|
text: submitLabel,
|
|
31697
32213
|
variant: "primary",
|
|
@@ -31717,7 +32233,7 @@ function ReviewComposer({
|
|
|
31717
32233
|
if (!currentUser) {
|
|
31718
32234
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-xl border border-gray-200 bg-white p-4 dark:border-neutral-800 dark:bg-neutral-900", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
|
|
31719
32235
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Please login to post your review." }),
|
|
31720
|
-
onLoginClick && /* @__PURE__ */ jsxRuntime.jsx(
|
|
32236
|
+
onLoginClick && /* @__PURE__ */ jsxRuntime.jsx(Button_web_default, { text: "Login", variant: "primary", onClick: onLoginClick })
|
|
31721
32237
|
] }) });
|
|
31722
32238
|
}
|
|
31723
32239
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-xl border border-gray-200 bg-white p-4 dark:border-neutral-800 dark:bg-neutral-900", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-4", children: [
|
|
@@ -32009,7 +32525,7 @@ function MyReviewPanel({
|
|
|
32009
32525
|
onEditReview,
|
|
32010
32526
|
onDeleteReview
|
|
32011
32527
|
}) {
|
|
32012
|
-
const [editing, setEditing] =
|
|
32528
|
+
const [editing, setEditing] = React26.useState(false);
|
|
32013
32529
|
const ComposerComponent = components?.Composer ?? ReviewComposer_default;
|
|
32014
32530
|
const FormComponent = components?.Form ?? ReviewForm_default;
|
|
32015
32531
|
const HeaderComponent = components?.Header ?? ReviewHeader_default;
|
|
@@ -32093,7 +32609,7 @@ function MyReviewPanel({
|
|
|
32093
32609
|
/* @__PURE__ */ jsxRuntime.jsx(HeaderComponent, { review: myReview, config }),
|
|
32094
32610
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
32095
32611
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
32096
|
-
|
|
32612
|
+
Button_web_default,
|
|
32097
32613
|
{
|
|
32098
32614
|
text: "Edit",
|
|
32099
32615
|
variant: "secondary",
|
|
@@ -32103,7 +32619,7 @@ function MyReviewPanel({
|
|
|
32103
32619
|
}
|
|
32104
32620
|
),
|
|
32105
32621
|
onDeleteReview && /* @__PURE__ */ jsxRuntime.jsx(
|
|
32106
|
-
|
|
32622
|
+
Button_web_default,
|
|
32107
32623
|
{
|
|
32108
32624
|
text: "Delete",
|
|
32109
32625
|
variant: "danger",
|
|
@@ -32165,7 +32681,7 @@ function ReviewMenu({
|
|
|
32165
32681
|
onReport,
|
|
32166
32682
|
onReply
|
|
32167
32683
|
}) {
|
|
32168
|
-
const ref =
|
|
32684
|
+
const ref = React26.useRef(null);
|
|
32169
32685
|
useClickOutside(ref, () => setOpen(false));
|
|
32170
32686
|
const items = [];
|
|
32171
32687
|
if (canEdit) {
|
|
@@ -32316,7 +32832,7 @@ function ReviewReplyMenu({
|
|
|
32316
32832
|
onDelete,
|
|
32317
32833
|
onReport
|
|
32318
32834
|
}) {
|
|
32319
|
-
const ref =
|
|
32835
|
+
const ref = React26.useRef(null);
|
|
32320
32836
|
useClickOutside(ref, () => setOpen(false));
|
|
32321
32837
|
const items = [];
|
|
32322
32838
|
if (canEdit) {
|
|
@@ -32385,7 +32901,7 @@ function ReviewReplyItem({
|
|
|
32385
32901
|
onDeleteReviewReply,
|
|
32386
32902
|
onReportReviewReply
|
|
32387
32903
|
}) {
|
|
32388
|
-
const [menuOpen, setMenuOpen] =
|
|
32904
|
+
const [menuOpen, setMenuOpen] = React26.useState(false);
|
|
32389
32905
|
const HeaderComponent = components?.ReplyHeader ?? ReviewReplyHeader_default;
|
|
32390
32906
|
const ContentComponent = components?.ReplyContent ?? ReviewReplyContent_default;
|
|
32391
32907
|
const MenuComponent = components?.ReplyMenu ?? ReviewReplyMenu_default;
|
|
@@ -32462,7 +32978,7 @@ function ReviewItem({
|
|
|
32462
32978
|
onDeleteReviewReply,
|
|
32463
32979
|
onReportReviewReply
|
|
32464
32980
|
}) {
|
|
32465
|
-
const [menuOpen, setMenuOpen] =
|
|
32981
|
+
const [menuOpen, setMenuOpen] = React26.useState(false);
|
|
32466
32982
|
const HeaderComponent = components?.Header ?? ReviewHeader_default;
|
|
32467
32983
|
const ContentComponent = components?.Content ?? ReviewContent_default;
|
|
32468
32984
|
const RatingComponent = components?.Rating ?? ReviewRating_default;
|
|
@@ -32612,28 +33128,28 @@ function useReviewThreadState({
|
|
|
32612
33128
|
onReviewUpdated,
|
|
32613
33129
|
onReviewDeleted
|
|
32614
33130
|
}) {
|
|
32615
|
-
const [reviews, setReviews] =
|
|
32616
|
-
const [myReview, setMyReview] =
|
|
32617
|
-
const [isLoadingReviews, setIsLoadingReviews] =
|
|
32618
|
-
const [isLoadingMyReview, setIsLoadingMyReview] =
|
|
33131
|
+
const [reviews, setReviews] = React26.useState([]);
|
|
33132
|
+
const [myReview, setMyReview] = React26.useState(null);
|
|
33133
|
+
const [isLoadingReviews, setIsLoadingReviews] = React26.useState(true);
|
|
33134
|
+
const [isLoadingMyReview, setIsLoadingMyReview] = React26.useState(
|
|
32619
33135
|
Boolean(dataSource.getMyReview && shouldLoadMyReview)
|
|
32620
33136
|
);
|
|
32621
|
-
const [isCreatingReview, setIsCreatingReview] =
|
|
32622
|
-
const [isUpdatingReview, setIsUpdatingReview] =
|
|
32623
|
-
const [isDeletingReview, setIsDeletingReview] =
|
|
32624
|
-
const [isCreatingReviewReply, setIsCreatingReviewReply] =
|
|
32625
|
-
const [isUpdatingReviewReply, setIsUpdatingReviewReply] =
|
|
32626
|
-
const [isDeletingReviewReply, setIsDeletingReviewReply] =
|
|
32627
|
-
const [reviewsError, setReviewsError] =
|
|
32628
|
-
const [myReviewError, setMyReviewError] =
|
|
33137
|
+
const [isCreatingReview, setIsCreatingReview] = React26.useState(false);
|
|
33138
|
+
const [isUpdatingReview, setIsUpdatingReview] = React26.useState(false);
|
|
33139
|
+
const [isDeletingReview, setIsDeletingReview] = React26.useState(false);
|
|
33140
|
+
const [isCreatingReviewReply, setIsCreatingReviewReply] = React26.useState(false);
|
|
33141
|
+
const [isUpdatingReviewReply, setIsUpdatingReviewReply] = React26.useState(false);
|
|
33142
|
+
const [isDeletingReviewReply, setIsDeletingReviewReply] = React26.useState(false);
|
|
33143
|
+
const [reviewsError, setReviewsError] = React26.useState(null);
|
|
33144
|
+
const [myReviewError, setMyReviewError] = React26.useState(null);
|
|
32629
33145
|
const error = reviewsError ?? myReviewError;
|
|
32630
|
-
const visibleReviews =
|
|
33146
|
+
const visibleReviews = React26.useMemo(() => {
|
|
32631
33147
|
if (config.showMyReviewInList || !myReview) {
|
|
32632
33148
|
return reviews;
|
|
32633
33149
|
}
|
|
32634
33150
|
return reviews.filter((review) => review.id !== myReview.id);
|
|
32635
33151
|
}, [config.showMyReviewInList, myReview, reviews]);
|
|
32636
|
-
const applyReview =
|
|
33152
|
+
const applyReview = React26.useCallback((review) => {
|
|
32637
33153
|
setReviews((prev) => upsertReview(prev, review));
|
|
32638
33154
|
setMyReview((prev) => {
|
|
32639
33155
|
if (!prev || prev.id !== review.id) {
|
|
@@ -32642,7 +33158,7 @@ function useReviewThreadState({
|
|
|
32642
33158
|
return review;
|
|
32643
33159
|
});
|
|
32644
33160
|
}, []);
|
|
32645
|
-
const applyReviewUpdater =
|
|
33161
|
+
const applyReviewUpdater = React26.useCallback(
|
|
32646
33162
|
(reviewId, updater) => {
|
|
32647
33163
|
setReviews((prev) => updateReview(prev, reviewId, updater));
|
|
32648
33164
|
setMyReview((prev) => {
|
|
@@ -32654,7 +33170,7 @@ function useReviewThreadState({
|
|
|
32654
33170
|
},
|
|
32655
33171
|
[]
|
|
32656
33172
|
);
|
|
32657
|
-
const removeReviewById =
|
|
33173
|
+
const removeReviewById = React26.useCallback((reviewId) => {
|
|
32658
33174
|
setReviews((prev) => removeReview(prev, reviewId));
|
|
32659
33175
|
setMyReview((prev) => {
|
|
32660
33176
|
if (!prev || prev.id !== reviewId) {
|
|
@@ -32663,7 +33179,7 @@ function useReviewThreadState({
|
|
|
32663
33179
|
return null;
|
|
32664
33180
|
});
|
|
32665
33181
|
}, []);
|
|
32666
|
-
const loadReviews =
|
|
33182
|
+
const loadReviews = React26.useCallback(async () => {
|
|
32667
33183
|
try {
|
|
32668
33184
|
setIsLoadingReviews(true);
|
|
32669
33185
|
setReviewsError(null);
|
|
@@ -32677,7 +33193,7 @@ function useReviewThreadState({
|
|
|
32677
33193
|
setIsLoadingReviews(false);
|
|
32678
33194
|
}
|
|
32679
33195
|
}, [config.reviewsPerPage, dataSource, targetId]);
|
|
32680
|
-
const loadMyReview =
|
|
33196
|
+
const loadMyReview = React26.useCallback(async () => {
|
|
32681
33197
|
if (!dataSource.getMyReview || !shouldLoadMyReview) {
|
|
32682
33198
|
setMyReview(null);
|
|
32683
33199
|
setIsLoadingMyReview(false);
|
|
@@ -32696,10 +33212,10 @@ function useReviewThreadState({
|
|
|
32696
33212
|
setIsLoadingMyReview(false);
|
|
32697
33213
|
}
|
|
32698
33214
|
}, [dataSource, shouldLoadMyReview, targetId]);
|
|
32699
|
-
const reload =
|
|
33215
|
+
const reload = React26.useCallback(async () => {
|
|
32700
33216
|
await Promise.all([loadReviews(), loadMyReview()]);
|
|
32701
33217
|
}, [loadReviews, loadMyReview]);
|
|
32702
|
-
const createReview =
|
|
33218
|
+
const createReview = React26.useCallback(
|
|
32703
33219
|
async (values) => {
|
|
32704
33220
|
try {
|
|
32705
33221
|
setIsCreatingReview(true);
|
|
@@ -32718,7 +33234,7 @@ function useReviewThreadState({
|
|
|
32718
33234
|
},
|
|
32719
33235
|
[dataSource, onReviewCreated]
|
|
32720
33236
|
);
|
|
32721
|
-
const updateReview2 =
|
|
33237
|
+
const updateReview2 = React26.useCallback(
|
|
32722
33238
|
async (review, values) => {
|
|
32723
33239
|
try {
|
|
32724
33240
|
setIsUpdatingReview(true);
|
|
@@ -32743,7 +33259,7 @@ function useReviewThreadState({
|
|
|
32743
33259
|
},
|
|
32744
33260
|
[dataSource, onReviewUpdated]
|
|
32745
33261
|
);
|
|
32746
|
-
const deleteReview =
|
|
33262
|
+
const deleteReview = React26.useCallback(
|
|
32747
33263
|
async (review) => {
|
|
32748
33264
|
try {
|
|
32749
33265
|
setIsDeletingReview(true);
|
|
@@ -32756,7 +33272,7 @@ function useReviewThreadState({
|
|
|
32756
33272
|
},
|
|
32757
33273
|
[dataSource, onReviewDeleted, removeReviewById]
|
|
32758
33274
|
);
|
|
32759
|
-
const createReviewReply =
|
|
33275
|
+
const createReviewReply = React26.useCallback(
|
|
32760
33276
|
async (input) => {
|
|
32761
33277
|
if (!dataSource.createReviewReply) {
|
|
32762
33278
|
throw new Error("createReviewReply is not implemented by dataSource.");
|
|
@@ -32779,7 +33295,7 @@ function useReviewThreadState({
|
|
|
32779
33295
|
},
|
|
32780
33296
|
[applyReview, applyReviewUpdater, config.maxRepliesPerReview, dataSource]
|
|
32781
33297
|
);
|
|
32782
|
-
const updateReviewReply2 =
|
|
33298
|
+
const updateReviewReply2 = React26.useCallback(
|
|
32783
33299
|
async (input) => {
|
|
32784
33300
|
if (!dataSource.updateReviewReply) {
|
|
32785
33301
|
throw new Error("updateReviewReply is not implemented by dataSource.");
|
|
@@ -32802,7 +33318,7 @@ function useReviewThreadState({
|
|
|
32802
33318
|
},
|
|
32803
33319
|
[applyReview, applyReviewUpdater, dataSource]
|
|
32804
33320
|
);
|
|
32805
|
-
const deleteReviewReply =
|
|
33321
|
+
const deleteReviewReply = React26.useCallback(
|
|
32806
33322
|
async (reviewId, replyId) => {
|
|
32807
33323
|
if (!dataSource.deleteReviewReply) {
|
|
32808
33324
|
throw new Error("deleteReviewReply is not implemented by dataSource.");
|
|
@@ -32825,7 +33341,7 @@ function useReviewThreadState({
|
|
|
32825
33341
|
},
|
|
32826
33342
|
[applyReview, applyReviewUpdater, dataSource]
|
|
32827
33343
|
);
|
|
32828
|
-
|
|
33344
|
+
React26.useEffect(() => {
|
|
32829
33345
|
let cancelled = false;
|
|
32830
33346
|
async function run() {
|
|
32831
33347
|
try {
|
|
@@ -32852,7 +33368,7 @@ function useReviewThreadState({
|
|
|
32852
33368
|
cancelled = true;
|
|
32853
33369
|
};
|
|
32854
33370
|
}, [config.reviewsPerPage, dataSource, targetId]);
|
|
32855
|
-
|
|
33371
|
+
React26.useEffect(() => {
|
|
32856
33372
|
let cancelled = false;
|
|
32857
33373
|
async function run() {
|
|
32858
33374
|
if (!dataSource.getMyReview || !shouldLoadMyReview) {
|
|
@@ -32884,19 +33400,19 @@ function useReviewThreadState({
|
|
|
32884
33400
|
cancelled = true;
|
|
32885
33401
|
};
|
|
32886
33402
|
}, [dataSource, shouldLoadMyReview, targetId]);
|
|
32887
|
-
|
|
33403
|
+
React26.useEffect(() => {
|
|
32888
33404
|
if (!updatedReview) {
|
|
32889
33405
|
return;
|
|
32890
33406
|
}
|
|
32891
33407
|
applyReview(updatedReview);
|
|
32892
33408
|
}, [applyReview, updatedReview]);
|
|
32893
|
-
|
|
33409
|
+
React26.useEffect(() => {
|
|
32894
33410
|
if (!deletedReview) {
|
|
32895
33411
|
return;
|
|
32896
33412
|
}
|
|
32897
33413
|
removeReviewById(deletedReview.id);
|
|
32898
33414
|
}, [deletedReview, removeReviewById]);
|
|
32899
|
-
|
|
33415
|
+
React26.useEffect(() => {
|
|
32900
33416
|
if (!updatedReviewReply) {
|
|
32901
33417
|
return;
|
|
32902
33418
|
}
|
|
@@ -32923,7 +33439,7 @@ function useReviewThreadState({
|
|
|
32923
33439
|
config.maxRepliesPerReview,
|
|
32924
33440
|
updatedReviewReply
|
|
32925
33441
|
]);
|
|
32926
|
-
|
|
33442
|
+
React26.useEffect(() => {
|
|
32927
33443
|
if (!deletedReviewReply) {
|
|
32928
33444
|
return;
|
|
32929
33445
|
}
|
|
@@ -33048,7 +33564,7 @@ function ReviewThread({
|
|
|
33048
33564
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-sm text-red-600/80 dark:text-red-300/80", children: "Something went wrong while loading the review thread." })
|
|
33049
33565
|
] }),
|
|
33050
33566
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
33051
|
-
|
|
33567
|
+
Button_web_default,
|
|
33052
33568
|
{
|
|
33053
33569
|
text: "Retry",
|
|
33054
33570
|
variant: "danger",
|
|
@@ -33095,7 +33611,7 @@ function ReviewThread({
|
|
|
33095
33611
|
] });
|
|
33096
33612
|
}
|
|
33097
33613
|
var ReviewThread_default = ReviewThread;
|
|
33098
|
-
var MarkdownContext =
|
|
33614
|
+
var MarkdownContext = React26.createContext(null);
|
|
33099
33615
|
|
|
33100
33616
|
// src/compositions/markdown/utils/sanitizeHeading.ts
|
|
33101
33617
|
function sanitizeHeading(text10, options = {}) {
|
|
@@ -33316,30 +33832,30 @@ function MarkdownProvider({
|
|
|
33316
33832
|
onActiveHeadingChange
|
|
33317
33833
|
}) {
|
|
33318
33834
|
const resolvedMarkdown = value ?? markdown ?? "";
|
|
33319
|
-
const [internalActiveHeading, setInternalActiveHeading] =
|
|
33320
|
-
const headings =
|
|
33835
|
+
const [internalActiveHeading, setInternalActiveHeading] = React26.useState(defaultActiveHeading);
|
|
33836
|
+
const headings = React26.useMemo(() => {
|
|
33321
33837
|
if (externalHeadings) {
|
|
33322
33838
|
return externalHeadings;
|
|
33323
33839
|
}
|
|
33324
33840
|
return extractHeadings(resolvedMarkdown);
|
|
33325
33841
|
}, [externalHeadings, resolvedMarkdown]);
|
|
33326
|
-
const numberedHeadings =
|
|
33842
|
+
const numberedHeadings = React26.useMemo(() => {
|
|
33327
33843
|
return generateHeadingNumbers(headings);
|
|
33328
33844
|
}, [headings]);
|
|
33329
|
-
const headingMap =
|
|
33845
|
+
const headingMap = React26.useMemo(() => {
|
|
33330
33846
|
return headings.reduce((acc, heading3) => {
|
|
33331
33847
|
acc[heading3.id] = heading3;
|
|
33332
33848
|
return acc;
|
|
33333
33849
|
}, {});
|
|
33334
33850
|
}, [headings]);
|
|
33335
33851
|
const activeHeading = controlledActiveHeading ?? internalActiveHeading;
|
|
33336
|
-
const getHeadingById =
|
|
33852
|
+
const getHeadingById = React26.useCallback(
|
|
33337
33853
|
(id2) => {
|
|
33338
33854
|
return headingMap[id2];
|
|
33339
33855
|
},
|
|
33340
33856
|
[headingMap]
|
|
33341
33857
|
);
|
|
33342
|
-
const setActiveHeading =
|
|
33858
|
+
const setActiveHeading = React26.useCallback(
|
|
33343
33859
|
(id2) => {
|
|
33344
33860
|
if (controlledActiveHeading === void 0) {
|
|
33345
33861
|
setInternalActiveHeading(id2);
|
|
@@ -33348,7 +33864,7 @@ function MarkdownProvider({
|
|
|
33348
33864
|
},
|
|
33349
33865
|
[controlledActiveHeading, headingMap, onActiveHeadingChange]
|
|
33350
33866
|
);
|
|
33351
|
-
const contextValue =
|
|
33867
|
+
const contextValue = React26.useMemo(
|
|
33352
33868
|
() => ({
|
|
33353
33869
|
markdown: resolvedMarkdown,
|
|
33354
33870
|
headings,
|
|
@@ -33373,7 +33889,7 @@ function MarkdownProvider({
|
|
|
33373
33889
|
var MarkdownProvider_default = MarkdownProvider;
|
|
33374
33890
|
function useMarkdown(options = {}) {
|
|
33375
33891
|
const { required = false, errorMessage } = options;
|
|
33376
|
-
const context =
|
|
33892
|
+
const context = React26.useContext(MarkdownContext);
|
|
33377
33893
|
if (!context && required) {
|
|
33378
33894
|
throw new Error(
|
|
33379
33895
|
errorMessage || "useMarkdown must be used inside a MarkdownProvider."
|
|
@@ -33396,15 +33912,15 @@ function useActiveHeading(options = {}) {
|
|
|
33396
33912
|
onActiveHeadingChange
|
|
33397
33913
|
} = options;
|
|
33398
33914
|
const headings = externalHeadings ?? context?.headings ?? [];
|
|
33399
|
-
const [internalActiveHeading, setInternalActiveHeading] =
|
|
33915
|
+
const [internalActiveHeading, setInternalActiveHeading] = React26.useState(defaultActiveHeading);
|
|
33400
33916
|
const activeHeading = controlledActiveHeading ?? context?.activeHeading ?? internalActiveHeading;
|
|
33401
|
-
const headingMap =
|
|
33917
|
+
const headingMap = React26.useMemo(() => {
|
|
33402
33918
|
return headings.reduce((acc, heading3) => {
|
|
33403
33919
|
acc[heading3.id] = heading3;
|
|
33404
33920
|
return acc;
|
|
33405
33921
|
}, {});
|
|
33406
33922
|
}, [headings]);
|
|
33407
|
-
const setActiveHeading =
|
|
33923
|
+
const setActiveHeading = React26.useCallback(
|
|
33408
33924
|
(id2) => {
|
|
33409
33925
|
if (controlledActiveHeading === void 0 && !context) {
|
|
33410
33926
|
setInternalActiveHeading(id2);
|
|
@@ -33414,7 +33930,7 @@ function useActiveHeading(options = {}) {
|
|
|
33414
33930
|
},
|
|
33415
33931
|
[context, controlledActiveHeading, headingMap, onActiveHeadingChange]
|
|
33416
33932
|
);
|
|
33417
|
-
const scrollToHeading =
|
|
33933
|
+
const scrollToHeading = React26.useCallback(
|
|
33418
33934
|
(id2) => {
|
|
33419
33935
|
if (typeof document === "undefined") return;
|
|
33420
33936
|
const element7 = document.getElementById(id2);
|
|
@@ -33427,10 +33943,10 @@ function useActiveHeading(options = {}) {
|
|
|
33427
33943
|
},
|
|
33428
33944
|
[scrollBehavior, scrollBlock, setActiveHeading]
|
|
33429
33945
|
);
|
|
33430
|
-
const observedHeadingIds =
|
|
33946
|
+
const observedHeadingIds = React26.useMemo(() => {
|
|
33431
33947
|
return headings.map((heading3) => heading3.id).join("|");
|
|
33432
33948
|
}, [headings]);
|
|
33433
|
-
|
|
33949
|
+
React26.useEffect(() => {
|
|
33434
33950
|
if (!enabled) return;
|
|
33435
33951
|
if (typeof window === "undefined") return;
|
|
33436
33952
|
if (!("IntersectionObserver" in window)) return;
|
|
@@ -33479,7 +33995,7 @@ function useMarkdownHeadings(options = {}) {
|
|
|
33479
33995
|
minDepth = 1,
|
|
33480
33996
|
maxDepth = 6
|
|
33481
33997
|
} = options;
|
|
33482
|
-
const baseHeadings =
|
|
33998
|
+
const baseHeadings = React26.useMemo(() => {
|
|
33483
33999
|
if (externalHeadings) {
|
|
33484
34000
|
return externalHeadings;
|
|
33485
34001
|
}
|
|
@@ -33488,15 +34004,15 @@ function useMarkdownHeadings(options = {}) {
|
|
|
33488
34004
|
}
|
|
33489
34005
|
return context?.headings ?? [];
|
|
33490
34006
|
}, [context?.headings, externalHeadings, markdown]);
|
|
33491
|
-
const headings =
|
|
34007
|
+
const headings = React26.useMemo(() => {
|
|
33492
34008
|
return baseHeadings.filter((heading3) => {
|
|
33493
34009
|
return heading3.level >= minDepth && heading3.level <= maxDepth;
|
|
33494
34010
|
});
|
|
33495
34011
|
}, [baseHeadings, minDepth, maxDepth]);
|
|
33496
|
-
const numberedHeadings =
|
|
34012
|
+
const numberedHeadings = React26.useMemo(() => {
|
|
33497
34013
|
return generateHeadingNumbers(headings);
|
|
33498
34014
|
}, [headings]);
|
|
33499
|
-
const headingMap =
|
|
34015
|
+
const headingMap = React26.useMemo(() => {
|
|
33500
34016
|
return headings.reduce((acc, heading3) => {
|
|
33501
34017
|
acc[heading3.id] = heading3;
|
|
33502
34018
|
return acc;
|
|
@@ -33888,11 +34404,11 @@ function addChildren(props, children3) {
|
|
|
33888
34404
|
}
|
|
33889
34405
|
}
|
|
33890
34406
|
}
|
|
33891
|
-
function productionCreate(_2,
|
|
34407
|
+
function productionCreate(_2, jsx257, jsxs129) {
|
|
33892
34408
|
return create3;
|
|
33893
34409
|
function create3(_3, type2, props, key) {
|
|
33894
34410
|
const isStaticChildren = Array.isArray(props.children);
|
|
33895
|
-
const fn = isStaticChildren ?
|
|
34411
|
+
const fn = isStaticChildren ? jsxs129 : jsx257;
|
|
33896
34412
|
return key ? fn(type2, props, key) : fn(type2, props);
|
|
33897
34413
|
}
|
|
33898
34414
|
}
|
|
@@ -42282,7 +42798,7 @@ function markdownTable(table2, options) {
|
|
|
42282
42798
|
let rowIndex = -1;
|
|
42283
42799
|
while (++rowIndex < table2.length) {
|
|
42284
42800
|
const row2 = [];
|
|
42285
|
-
const
|
|
42801
|
+
const sizes5 = [];
|
|
42286
42802
|
let columnIndex2 = -1;
|
|
42287
42803
|
if (table2[rowIndex].length > mostCellsPerRow) {
|
|
42288
42804
|
mostCellsPerRow = table2[rowIndex].length;
|
|
@@ -42291,7 +42807,7 @@ function markdownTable(table2, options) {
|
|
|
42291
42807
|
const cell = serialize2(table2[rowIndex][columnIndex2]);
|
|
42292
42808
|
if (settings.alignDelimiters !== false) {
|
|
42293
42809
|
const size = stringLength(cell);
|
|
42294
|
-
|
|
42810
|
+
sizes5[columnIndex2] = size;
|
|
42295
42811
|
if (longestCellByColumn[columnIndex2] === void 0 || size > longestCellByColumn[columnIndex2]) {
|
|
42296
42812
|
longestCellByColumn[columnIndex2] = size;
|
|
42297
42813
|
}
|
|
@@ -42299,7 +42815,7 @@ function markdownTable(table2, options) {
|
|
|
42299
42815
|
row2.push(cell);
|
|
42300
42816
|
}
|
|
42301
42817
|
cellMatrix[rowIndex] = row2;
|
|
42302
|
-
sizeMatrix[rowIndex] =
|
|
42818
|
+
sizeMatrix[rowIndex] = sizes5;
|
|
42303
42819
|
}
|
|
42304
42820
|
let columnIndex = -1;
|
|
42305
42821
|
if (typeof align === "object" && "length" in align) {
|
|
@@ -42314,7 +42830,7 @@ function markdownTable(table2, options) {
|
|
|
42314
42830
|
}
|
|
42315
42831
|
columnIndex = -1;
|
|
42316
42832
|
const row = [];
|
|
42317
|
-
const
|
|
42833
|
+
const sizes4 = [];
|
|
42318
42834
|
while (++columnIndex < mostCellsPerRow) {
|
|
42319
42835
|
const code4 = alignments[columnIndex];
|
|
42320
42836
|
let before = "";
|
|
@@ -42337,17 +42853,17 @@ function markdownTable(table2, options) {
|
|
|
42337
42853
|
if (size > longestCellByColumn[columnIndex]) {
|
|
42338
42854
|
longestCellByColumn[columnIndex] = size;
|
|
42339
42855
|
}
|
|
42340
|
-
|
|
42856
|
+
sizes4[columnIndex] = size;
|
|
42341
42857
|
}
|
|
42342
42858
|
row[columnIndex] = cell;
|
|
42343
42859
|
}
|
|
42344
42860
|
cellMatrix.splice(1, 0, row);
|
|
42345
|
-
sizeMatrix.splice(1, 0,
|
|
42861
|
+
sizeMatrix.splice(1, 0, sizes4);
|
|
42346
42862
|
rowIndex = -1;
|
|
42347
42863
|
const lines = [];
|
|
42348
42864
|
while (++rowIndex < cellMatrix.length) {
|
|
42349
42865
|
const row2 = cellMatrix[rowIndex];
|
|
42350
|
-
const
|
|
42866
|
+
const sizes5 = sizeMatrix[rowIndex];
|
|
42351
42867
|
columnIndex = -1;
|
|
42352
42868
|
const line = [];
|
|
42353
42869
|
while (++columnIndex < mostCellsPerRow) {
|
|
@@ -42355,7 +42871,7 @@ function markdownTable(table2, options) {
|
|
|
42355
42871
|
let before = "";
|
|
42356
42872
|
let after = "";
|
|
42357
42873
|
if (settings.alignDelimiters !== false) {
|
|
42358
|
-
const size = longestCellByColumn[columnIndex] - (
|
|
42874
|
+
const size = longestCellByColumn[columnIndex] - (sizes5[columnIndex] || 0);
|
|
42359
42875
|
const code4 = alignments[columnIndex];
|
|
42360
42876
|
if (code4 === 114) {
|
|
42361
42877
|
before = " ".repeat(size);
|
|
@@ -53916,14 +54432,14 @@ function MarkdownHeading({
|
|
|
53916
54432
|
const normalizedLevel = Math.min(Math.max(level, 1), 6);
|
|
53917
54433
|
const TypographyComponent = normalizedLevel <= 3 ? Chapter : Section;
|
|
53918
54434
|
const typographyLevel = normalizedLevel <= 3 ? normalizedLevel : normalizedLevel - 3;
|
|
53919
|
-
return
|
|
54435
|
+
return React26.createElement(
|
|
53920
54436
|
TypographyComponent,
|
|
53921
54437
|
{
|
|
53922
54438
|
...props,
|
|
53923
54439
|
id: id2,
|
|
53924
54440
|
level: typographyLevel,
|
|
53925
54441
|
bold: true,
|
|
53926
|
-
className:
|
|
54442
|
+
className: classNames74__default.default(
|
|
53927
54443
|
"eui-markdown-heading group relative scroll-mt-24 font-bold leading-tight text-gray-900 dark:text-gray-100",
|
|
53928
54444
|
HEADING_STYLES[level],
|
|
53929
54445
|
className
|
|
@@ -54086,18 +54602,18 @@ function powerSetPermutations(arr) {
|
|
|
54086
54602
|
}
|
|
54087
54603
|
}
|
|
54088
54604
|
var classNameCombinations = {};
|
|
54089
|
-
function getClassNameCombinations(
|
|
54090
|
-
if (
|
|
54091
|
-
var key =
|
|
54605
|
+
function getClassNameCombinations(classNames78) {
|
|
54606
|
+
if (classNames78.length === 0 || classNames78.length === 1) return classNames78;
|
|
54607
|
+
var key = classNames78.join(".");
|
|
54092
54608
|
if (!classNameCombinations[key]) {
|
|
54093
|
-
classNameCombinations[key] = powerSetPermutations(
|
|
54609
|
+
classNameCombinations[key] = powerSetPermutations(classNames78);
|
|
54094
54610
|
}
|
|
54095
54611
|
return classNameCombinations[key];
|
|
54096
54612
|
}
|
|
54097
|
-
function createStyleObject(
|
|
54613
|
+
function createStyleObject(classNames78) {
|
|
54098
54614
|
var elementStyle = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
54099
54615
|
var stylesheet = arguments.length > 2 ? arguments[2] : void 0;
|
|
54100
|
-
var nonTokenClassNames =
|
|
54616
|
+
var nonTokenClassNames = classNames78.filter(function(className) {
|
|
54101
54617
|
return className !== "token";
|
|
54102
54618
|
});
|
|
54103
54619
|
var classNamesCombinations = getClassNameCombinations(nonTokenClassNames);
|
|
@@ -54105,8 +54621,8 @@ function createStyleObject(classNames81) {
|
|
|
54105
54621
|
return _objectSpread(_objectSpread({}, styleObject), stylesheet[className]);
|
|
54106
54622
|
}, elementStyle);
|
|
54107
54623
|
}
|
|
54108
|
-
function createClassNameString(
|
|
54109
|
-
return
|
|
54624
|
+
function createClassNameString(classNames78) {
|
|
54625
|
+
return classNames78.join(" ");
|
|
54110
54626
|
}
|
|
54111
54627
|
function createChildren2(stylesheet, useInlineStyles) {
|
|
54112
54628
|
var childrenCount = 0;
|
|
@@ -54151,7 +54667,7 @@ function createElement2(_ref) {
|
|
|
54151
54667
|
});
|
|
54152
54668
|
}
|
|
54153
54669
|
var children3 = childrenCreator(node2.children);
|
|
54154
|
-
return /* @__PURE__ */
|
|
54670
|
+
return /* @__PURE__ */ React26__default.default.createElement(TagName, _extends({
|
|
54155
54671
|
key
|
|
54156
54672
|
}, props), children3);
|
|
54157
54673
|
}
|
|
@@ -54194,7 +54710,7 @@ function getAllLineNumbers(_ref) {
|
|
|
54194
54710
|
var lines = _ref.lines, startingLineNumber = _ref.startingLineNumber, style2 = _ref.style;
|
|
54195
54711
|
return lines.map(function(_2, i) {
|
|
54196
54712
|
var number3 = i + startingLineNumber;
|
|
54197
|
-
return /* @__PURE__ */
|
|
54713
|
+
return /* @__PURE__ */ React26__default.default.createElement("span", {
|
|
54198
54714
|
key: "line-".concat(i),
|
|
54199
54715
|
className: "react-syntax-highlighter-line-number",
|
|
54200
54716
|
style: typeof style2 === "function" ? style2(number3) : style2
|
|
@@ -54206,7 +54722,7 @@ function AllLineNumbers(_ref2) {
|
|
|
54206
54722
|
"float": "left",
|
|
54207
54723
|
paddingRight: "10px"
|
|
54208
54724
|
} : _ref2$containerStyle, _ref2$numberStyle = _ref2.numberStyle, numberStyle = _ref2$numberStyle === void 0 ? {} : _ref2$numberStyle, startingLineNumber = _ref2.startingLineNumber;
|
|
54209
|
-
return /* @__PURE__ */
|
|
54725
|
+
return /* @__PURE__ */ React26__default.default.createElement("code", {
|
|
54210
54726
|
style: Object.assign({}, codeStyle, containerStyle)
|
|
54211
54727
|
}, getAllLineNumbers({
|
|
54212
54728
|
lines: codeString.replace(/\n$/, "").split("\n"),
|
|
@@ -54279,8 +54795,8 @@ function flattenCodeTree(tree) {
|
|
|
54279
54795
|
}));
|
|
54280
54796
|
} else if (node2.children) {
|
|
54281
54797
|
var _node$properties;
|
|
54282
|
-
var
|
|
54283
|
-
flattenCodeTree(node2.children,
|
|
54798
|
+
var classNames78 = className.concat(((_node$properties = node2.properties) === null || _node$properties === void 0 ? void 0 : _node$properties.className) || []);
|
|
54799
|
+
flattenCodeTree(node2.children, classNames78).forEach(function(i2) {
|
|
54284
54800
|
return newTree.push(i2);
|
|
54285
54801
|
});
|
|
54286
54802
|
}
|
|
@@ -54427,7 +54943,7 @@ function highlight_default(defaultAstGenerator, defaultStyle) {
|
|
|
54427
54943
|
style: _objectSpread2(_objectSpread2({}, style2['code[class*="language-"]']), style2['code[class*="language-'.concat(language, '"]')])
|
|
54428
54944
|
} : _ref7$codeTagProps, _ref7$useInlineStyles = _ref7.useInlineStyles, useInlineStyles = _ref7$useInlineStyles === void 0 ? true : _ref7$useInlineStyles, _ref7$showLineNumbers = _ref7.showLineNumbers, showLineNumbers = _ref7$showLineNumbers === void 0 ? false : _ref7$showLineNumbers, _ref7$showInlineLineN = _ref7.showInlineLineNumbers, showInlineLineNumbers = _ref7$showInlineLineN === void 0 ? true : _ref7$showInlineLineN, _ref7$startingLineNum = _ref7.startingLineNumber, startingLineNumber = _ref7$startingLineNum === void 0 ? 1 : _ref7$startingLineNum, lineNumberContainerStyle = _ref7.lineNumberContainerStyle, _ref7$lineNumberStyle = _ref7.lineNumberStyle, lineNumberStyle = _ref7$lineNumberStyle === void 0 ? {} : _ref7$lineNumberStyle, wrapLines = _ref7.wrapLines, _ref7$wrapLongLines = _ref7.wrapLongLines, wrapLongLines = _ref7$wrapLongLines === void 0 ? false : _ref7$wrapLongLines, _ref7$lineProps = _ref7.lineProps, lineProps = _ref7$lineProps === void 0 ? {} : _ref7$lineProps, renderer = _ref7.renderer, _ref7$PreTag = _ref7.PreTag, PreTag = _ref7$PreTag === void 0 ? "pre" : _ref7$PreTag, _ref7$CodeTag = _ref7.CodeTag, CodeTag = _ref7$CodeTag === void 0 ? "code" : _ref7$CodeTag, _ref7$code = _ref7.code, code4 = _ref7$code === void 0 ? (Array.isArray(children3) ? children3[0] : children3) || "" : _ref7$code, astGenerator = _ref7.astGenerator, rest = _objectWithoutProperties(_ref7, _excluded);
|
|
54429
54945
|
astGenerator = astGenerator || defaultAstGenerator;
|
|
54430
|
-
var allLineNumbers = showLineNumbers ? /* @__PURE__ */
|
|
54946
|
+
var allLineNumbers = showLineNumbers ? /* @__PURE__ */ React26__default.default.createElement(AllLineNumbers, {
|
|
54431
54947
|
containerStyle: lineNumberContainerStyle,
|
|
54432
54948
|
codeStyle: codeTagProps.style || {},
|
|
54433
54949
|
numberStyle: lineNumberStyle,
|
|
@@ -54454,7 +54970,7 @@ function highlight_default(defaultAstGenerator, defaultStyle) {
|
|
|
54454
54970
|
}, codeTagProps.style);
|
|
54455
54971
|
}
|
|
54456
54972
|
if (!astGenerator) {
|
|
54457
|
-
return /* @__PURE__ */
|
|
54973
|
+
return /* @__PURE__ */ React26__default.default.createElement(PreTag, preProps, allLineNumbers, /* @__PURE__ */ React26__default.default.createElement(CodeTag, codeTagProps, code4));
|
|
54458
54974
|
}
|
|
54459
54975
|
if (wrapLines === void 0 && renderer || wrapLongLines) wrapLines = true;
|
|
54460
54976
|
renderer = renderer || defaultRenderer;
|
|
@@ -54474,7 +54990,7 @@ function highlight_default(defaultAstGenerator, defaultStyle) {
|
|
|
54474
54990
|
var lineBreakCount = (_code$match$length = (_code$match = code4.match(/\n/g)) === null || _code$match === void 0 ? void 0 : _code$match.length) !== null && _code$match$length !== void 0 ? _code$match$length : 0;
|
|
54475
54991
|
var largestLineNumber = startingLineNumber + lineBreakCount;
|
|
54476
54992
|
var rows = processLines(codeTree, wrapLines, lineProps, showLineNumbers, showInlineLineNumbers, startingLineNumber, largestLineNumber, lineNumberStyle, wrapLongLines);
|
|
54477
|
-
return /* @__PURE__ */
|
|
54993
|
+
return /* @__PURE__ */ React26__default.default.createElement(PreTag, preProps, /* @__PURE__ */ React26__default.default.createElement(CodeTag, codeTagProps, !showInlineLineNumbers && allLineNumbers, renderer({
|
|
54478
54994
|
rows,
|
|
54479
54995
|
stylesheet: style2,
|
|
54480
54996
|
useInlineStyles
|
|
@@ -54811,7 +55327,7 @@ var json_default = json;
|
|
|
54811
55327
|
|
|
54812
55328
|
// node_modules/react-syntax-highlighter/dist/esm/languages/prism/jsx.js
|
|
54813
55329
|
init_jsx();
|
|
54814
|
-
var jsx_default =
|
|
55330
|
+
var jsx_default = jsx218;
|
|
54815
55331
|
|
|
54816
55332
|
// node_modules/react-syntax-highlighter/dist/esm/languages/prism/markup.js
|
|
54817
55333
|
init_markup();
|
|
@@ -54902,19 +55418,19 @@ function MarkdownCodeBlock({
|
|
|
54902
55418
|
wrapLongLines = false,
|
|
54903
55419
|
...props
|
|
54904
55420
|
}) {
|
|
54905
|
-
const [copied, setCopied] =
|
|
54906
|
-
const timeoutRef =
|
|
55421
|
+
const [copied, setCopied] = React26.useState(false);
|
|
55422
|
+
const timeoutRef = React26.useRef(null);
|
|
54907
55423
|
const title = meta?.title ?? meta?.filename;
|
|
54908
|
-
const resolvedLanguage =
|
|
55424
|
+
const resolvedLanguage = React26.useMemo(() => {
|
|
54909
55425
|
return normalizeLanguage(language);
|
|
54910
55426
|
}, [language]);
|
|
54911
55427
|
const languageLabel = language || resolvedLanguage;
|
|
54912
55428
|
const showHeader = Boolean(title || languageLabel || showCopy);
|
|
54913
|
-
const highlightLines =
|
|
55429
|
+
const highlightLines = React26.useMemo(() => {
|
|
54914
55430
|
return new Set(meta?.highlightLines ?? []);
|
|
54915
55431
|
}, [meta?.highlightLines]);
|
|
54916
55432
|
const showLineNumbers = Boolean(meta?.showLineNumbers);
|
|
54917
|
-
|
|
55433
|
+
React26.useEffect(() => {
|
|
54918
55434
|
return () => {
|
|
54919
55435
|
if (timeoutRef.current) {
|
|
54920
55436
|
window.clearTimeout(timeoutRef.current);
|
|
@@ -54944,7 +55460,7 @@ function MarkdownCodeBlock({
|
|
|
54944
55460
|
"div",
|
|
54945
55461
|
{
|
|
54946
55462
|
...props,
|
|
54947
|
-
className:
|
|
55463
|
+
className: classNames74__default.default(
|
|
54948
55464
|
"eui-markdown-code my-6 overflow-hidden rounded-md border border-slate-700 bg-[#0d1117] text-slate-300",
|
|
54949
55465
|
className
|
|
54950
55466
|
),
|
|
@@ -55015,7 +55531,7 @@ function MarkdownInlineCode({
|
|
|
55015
55531
|
Code,
|
|
55016
55532
|
{
|
|
55017
55533
|
...props,
|
|
55018
|
-
className:
|
|
55534
|
+
className: classNames74__default.default(
|
|
55019
55535
|
"eui-markdown-inline-code whitespace-break-spaces rounded-md border border-gray-300/70 bg-gray-200/60 px-1.5 py-0.5 font-mono text-[0.875em] font-medium text-gray-900 dark:border-gray-600/70 dark:bg-gray-700/50 dark:text-gray-200",
|
|
55020
55536
|
className
|
|
55021
55537
|
),
|
|
@@ -55056,7 +55572,7 @@ function MarkdownLink({
|
|
|
55056
55572
|
href: safeHref,
|
|
55057
55573
|
target: resolvedTarget,
|
|
55058
55574
|
rel,
|
|
55059
|
-
className:
|
|
55575
|
+
className: classNames74__default.default(
|
|
55060
55576
|
"eui-markdown-link font-medium text-blue-600 underline underline-offset-4 transition-colors hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300",
|
|
55061
55577
|
className
|
|
55062
55578
|
),
|
|
@@ -55091,7 +55607,7 @@ function MarkdownImage({
|
|
|
55091
55607
|
title,
|
|
55092
55608
|
loading: "lazy",
|
|
55093
55609
|
decoding: "async",
|
|
55094
|
-
className:
|
|
55610
|
+
className: classNames74__default.default(
|
|
55095
55611
|
"eui-markdown-image my-6 h-auto max-w-full rounded-md border border-gray-200 dark:border-gray-700",
|
|
55096
55612
|
className
|
|
55097
55613
|
)
|
|
@@ -55108,7 +55624,7 @@ function MarkdownTable({
|
|
|
55108
55624
|
TableElement,
|
|
55109
55625
|
{
|
|
55110
55626
|
...props,
|
|
55111
|
-
className:
|
|
55627
|
+
className: classNames74__default.default(
|
|
55112
55628
|
"eui-markdown-table w-full border-collapse text-[0.925rem]",
|
|
55113
55629
|
className
|
|
55114
55630
|
),
|
|
@@ -55125,7 +55641,7 @@ function MarkdownTableCell({
|
|
|
55125
55641
|
TableCell,
|
|
55126
55642
|
{
|
|
55127
55643
|
...props,
|
|
55128
|
-
className:
|
|
55644
|
+
className: classNames74__default.default(
|
|
55129
55645
|
"eui-markdown-table-cell border-b border-r border-gray-200 p-3 text-left align-top last:border-r-0 dark:border-gray-700",
|
|
55130
55646
|
className
|
|
55131
55647
|
),
|
|
@@ -55142,7 +55658,7 @@ function MarkdownTableHeaderCell({
|
|
|
55142
55658
|
TableHeaderCell,
|
|
55143
55659
|
{
|
|
55144
55660
|
...props,
|
|
55145
|
-
className:
|
|
55661
|
+
className: classNames74__default.default(
|
|
55146
55662
|
"eui-markdown-table-header-cell border-b border-r border-gray-200 p-3 text-left align-top font-bold text-gray-900 last:border-r-0 dark:border-gray-700 dark:text-gray-100",
|
|
55147
55663
|
className
|
|
55148
55664
|
),
|
|
@@ -55158,7 +55674,7 @@ function MarkdownTableHead({
|
|
|
55158
55674
|
TableHead,
|
|
55159
55675
|
{
|
|
55160
55676
|
...props,
|
|
55161
|
-
className:
|
|
55677
|
+
className: classNames74__default.default(
|
|
55162
55678
|
"eui-markdown-table-head bg-gray-50 dark:bg-gray-900",
|
|
55163
55679
|
className
|
|
55164
55680
|
)
|
|
@@ -55173,7 +55689,7 @@ function MarkdownTableBody({
|
|
|
55173
55689
|
TableBody,
|
|
55174
55690
|
{
|
|
55175
55691
|
...props,
|
|
55176
|
-
className:
|
|
55692
|
+
className: classNames74__default.default("eui-markdown-table-body", className)
|
|
55177
55693
|
}
|
|
55178
55694
|
);
|
|
55179
55695
|
}
|
|
@@ -55185,7 +55701,7 @@ function MarkdownTableRow({
|
|
|
55185
55701
|
TableRow,
|
|
55186
55702
|
{
|
|
55187
55703
|
...props,
|
|
55188
|
-
className:
|
|
55704
|
+
className: classNames74__default.default(
|
|
55189
55705
|
"eui-markdown-table-row even:bg-gray-50/70 dark:even:bg-gray-900/60",
|
|
55190
55706
|
className
|
|
55191
55707
|
)
|
|
@@ -55203,7 +55719,7 @@ function MarkdownBlockquote({
|
|
|
55203
55719
|
{
|
|
55204
55720
|
...props,
|
|
55205
55721
|
as: "blockquote",
|
|
55206
|
-
className:
|
|
55722
|
+
className: classNames74__default.default(
|
|
55207
55723
|
"eui-markdown-blockquote my-6 border-l-4 border-gray-300 bg-transparent px-4 py-0 text-gray-600 [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 dark:border-gray-700 dark:text-gray-400",
|
|
55208
55724
|
className
|
|
55209
55725
|
),
|
|
@@ -55222,7 +55738,7 @@ function MarkdownParagraph({
|
|
|
55222
55738
|
{
|
|
55223
55739
|
...props,
|
|
55224
55740
|
level: 1,
|
|
55225
|
-
className:
|
|
55741
|
+
className: classNames74__default.default("eui-markdown-paragraph my-4", className),
|
|
55226
55742
|
children: /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: children3 })
|
|
55227
55743
|
}
|
|
55228
55744
|
);
|
|
@@ -55233,7 +55749,7 @@ function MarkdownStrong({ className, ...props }) {
|
|
|
55233
55749
|
"strong",
|
|
55234
55750
|
{
|
|
55235
55751
|
...props,
|
|
55236
|
-
className:
|
|
55752
|
+
className: classNames74__default.default(
|
|
55237
55753
|
"eui-markdown-strong font-semibold text-gray-950 dark:text-gray-100",
|
|
55238
55754
|
className
|
|
55239
55755
|
)
|
|
@@ -55246,7 +55762,7 @@ function MarkdownEmphasis({ className, ...props }) {
|
|
|
55246
55762
|
"em",
|
|
55247
55763
|
{
|
|
55248
55764
|
...props,
|
|
55249
|
-
className:
|
|
55765
|
+
className: classNames74__default.default("eui-markdown-emphasis italic", className)
|
|
55250
55766
|
}
|
|
55251
55767
|
);
|
|
55252
55768
|
}
|
|
@@ -55259,7 +55775,7 @@ function MarkdownStrikethrough({
|
|
|
55259
55775
|
"del",
|
|
55260
55776
|
{
|
|
55261
55777
|
...props,
|
|
55262
|
-
className:
|
|
55778
|
+
className: classNames74__default.default(
|
|
55263
55779
|
"eui-markdown-strikethrough text-gray-500 dark:text-gray-400",
|
|
55264
55780
|
className
|
|
55265
55781
|
)
|
|
@@ -55320,7 +55836,7 @@ function MarkdownTaskCheckbox({
|
|
|
55320
55836
|
"input",
|
|
55321
55837
|
{
|
|
55322
55838
|
...props,
|
|
55323
|
-
className:
|
|
55839
|
+
className: classNames74__default.default(
|
|
55324
55840
|
"eui-markdown-task-checkbox mr-2 translate-y-px accent-blue-600",
|
|
55325
55841
|
className
|
|
55326
55842
|
)
|
|
@@ -55336,7 +55852,7 @@ function MarkdownThematicBreak({
|
|
|
55336
55852
|
"hr",
|
|
55337
55853
|
{
|
|
55338
55854
|
...props,
|
|
55339
|
-
className:
|
|
55855
|
+
className: classNames74__default.default(
|
|
55340
55856
|
"eui-markdown-thematic-break my-8 border-0 border-t border-gray-200 dark:border-gray-800",
|
|
55341
55857
|
className
|
|
55342
55858
|
)
|
|
@@ -55353,7 +55869,7 @@ function MarkdownDetails({ className, ...props }) {
|
|
|
55353
55869
|
"details",
|
|
55354
55870
|
{
|
|
55355
55871
|
...props,
|
|
55356
|
-
className:
|
|
55872
|
+
className: classNames74__default.default(
|
|
55357
55873
|
"eui-markdown-details my-4 rounded-md border border-gray-200 bg-gray-50 px-4 py-3 dark:border-gray-800 dark:bg-gray-900",
|
|
55358
55874
|
className
|
|
55359
55875
|
)
|
|
@@ -55365,7 +55881,7 @@ function MarkdownSummary({ className, ...props }) {
|
|
|
55365
55881
|
"summary",
|
|
55366
55882
|
{
|
|
55367
55883
|
...props,
|
|
55368
|
-
className:
|
|
55884
|
+
className: classNames74__default.default(
|
|
55369
55885
|
"eui-markdown-summary cursor-pointer font-semibold text-gray-950 dark:text-gray-100",
|
|
55370
55886
|
className
|
|
55371
55887
|
)
|
|
@@ -55377,7 +55893,7 @@ function MarkdownFigure({ className, ...props }) {
|
|
|
55377
55893
|
"figure",
|
|
55378
55894
|
{
|
|
55379
55895
|
...props,
|
|
55380
|
-
className:
|
|
55896
|
+
className: classNames74__default.default("eui-markdown-figure my-6", className)
|
|
55381
55897
|
}
|
|
55382
55898
|
);
|
|
55383
55899
|
}
|
|
@@ -55389,7 +55905,7 @@ function MarkdownFigcaption({
|
|
|
55389
55905
|
return /* @__PURE__ */ jsxRuntime.jsx("figcaption", { ...props, className: "eui-markdown-figcaption mt-2 text-center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
55390
55906
|
Caption,
|
|
55391
55907
|
{
|
|
55392
|
-
className:
|
|
55908
|
+
className: classNames74__default.default(
|
|
55393
55909
|
"text-gray-500 opacity-100 dark:text-gray-400",
|
|
55394
55910
|
className
|
|
55395
55911
|
),
|
|
@@ -55404,7 +55920,7 @@ function getTextContent(node2) {
|
|
|
55404
55920
|
if (Array.isArray(node2)) {
|
|
55405
55921
|
return node2.map(getTextContent).join("");
|
|
55406
55922
|
}
|
|
55407
|
-
if (
|
|
55923
|
+
if (React26.isValidElement(node2)) {
|
|
55408
55924
|
return getTextContent(node2.props.children);
|
|
55409
55925
|
}
|
|
55410
55926
|
return "";
|
|
@@ -55788,14 +56304,14 @@ function MarkdownRenderer({
|
|
|
55788
56304
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
55789
56305
|
"div",
|
|
55790
56306
|
{
|
|
55791
|
-
className:
|
|
56307
|
+
className: classNames74__default.default(
|
|
55792
56308
|
"eui-markdown markdown-body break-words bg-transparent text-[0.95rem] leading-7 text-gray-800 dark:text-gray-300",
|
|
55793
56309
|
className
|
|
55794
56310
|
),
|
|
55795
56311
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
55796
56312
|
"div",
|
|
55797
56313
|
{
|
|
55798
|
-
className:
|
|
56314
|
+
className: classNames74__default.default(
|
|
55799
56315
|
"[&>*:first-child]:mt-0 [&>*:last-child]:mb-0",
|
|
55800
56316
|
contentClassName
|
|
55801
56317
|
),
|
|
@@ -55824,7 +56340,7 @@ function MarkdownViewer({
|
|
|
55824
56340
|
}) {
|
|
55825
56341
|
const context = useMarkdown();
|
|
55826
56342
|
const markdown = value ?? context?.markdown ?? "";
|
|
55827
|
-
const headings =
|
|
56343
|
+
const headings = React26.useMemo(() => {
|
|
55828
56344
|
if (externalHeadings) {
|
|
55829
56345
|
return externalHeadings;
|
|
55830
56346
|
}
|
|
@@ -55873,11 +56389,11 @@ function MarkdownTOCItem({
|
|
|
55873
56389
|
onClick: () => onSelect?.(heading3),
|
|
55874
56390
|
"aria-current": active ? "location" : void 0,
|
|
55875
56391
|
title: label,
|
|
55876
|
-
className:
|
|
56392
|
+
className: classNames74__default.default(
|
|
55877
56393
|
"eui-markdown-toc-item",
|
|
55878
56394
|
"block w-full text-left text-sm transition-all ease-in-out duration-150",
|
|
55879
56395
|
"hover:text-primary",
|
|
55880
|
-
active ?
|
|
56396
|
+
active ? classNames74__default.default("text-primary font-semibold underline", activeClassName) : classNames74__default.default("text-gray-500 dark:text-gray-400", inactiveClassName),
|
|
55881
56397
|
className
|
|
55882
56398
|
),
|
|
55883
56399
|
style: {
|
|
@@ -55916,14 +56432,14 @@ function MarkdownTOC({
|
|
|
55916
56432
|
onHeadingClick
|
|
55917
56433
|
}) {
|
|
55918
56434
|
const context = useMarkdown();
|
|
55919
|
-
const [collapsed, setCollapsed] =
|
|
56435
|
+
const [collapsed, setCollapsed] = React26.useState(defaultCollapsed);
|
|
55920
56436
|
const { headings, numberedHeadings, hasHeadings } = useMarkdownHeadings({
|
|
55921
56437
|
markdown,
|
|
55922
56438
|
headings: externalHeadings,
|
|
55923
56439
|
minDepth,
|
|
55924
56440
|
maxDepth
|
|
55925
56441
|
});
|
|
55926
|
-
const tocHeadings =
|
|
56442
|
+
const tocHeadings = React26.useMemo(() => {
|
|
55927
56443
|
return numbered ? numberedHeadings : headings;
|
|
55928
56444
|
}, [headings, numbered, numberedHeadings]);
|
|
55929
56445
|
const { activeHeading, scrollToHeading, setActiveHeading } = useActiveHeading(
|
|
@@ -55943,7 +56459,7 @@ function MarkdownTOC({
|
|
|
55943
56459
|
return emptyState ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
55944
56460
|
"div",
|
|
55945
56461
|
{
|
|
55946
|
-
className:
|
|
56462
|
+
className: classNames74__default.default(
|
|
55947
56463
|
"eui-markdown-toc",
|
|
55948
56464
|
"text-sm text-gray-500 dark:text-gray-400",
|
|
55949
56465
|
className
|
|
@@ -55963,7 +56479,7 @@ function MarkdownTOC({
|
|
|
55963
56479
|
{
|
|
55964
56480
|
type: "button",
|
|
55965
56481
|
onClick: () => setCollapsed((value) => !value),
|
|
55966
|
-
className:
|
|
56482
|
+
className: classNames74__default.default(
|
|
55967
56483
|
"eui-markdown-toc-title",
|
|
55968
56484
|
"flex w-full items-center justify-between gap-2 text-left",
|
|
55969
56485
|
"text-sm font-semibold uppercase tracking-wide",
|
|
@@ -55976,7 +56492,7 @@ function MarkdownTOC({
|
|
|
55976
56492
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
55977
56493
|
"span",
|
|
55978
56494
|
{
|
|
55979
|
-
className:
|
|
56495
|
+
className: classNames74__default.default(
|
|
55980
56496
|
"text-xs opacity-60 transition-transform duration-150",
|
|
55981
56497
|
!collapsed && "rotate-90"
|
|
55982
56498
|
),
|
|
@@ -55989,7 +56505,7 @@ function MarkdownTOC({
|
|
|
55989
56505
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
55990
56506
|
"h2",
|
|
55991
56507
|
{
|
|
55992
|
-
className:
|
|
56508
|
+
className: classNames74__default.default(
|
|
55993
56509
|
"eui-markdown-toc-title",
|
|
55994
56510
|
"text-sm font-semibold uppercase tracking-wide",
|
|
55995
56511
|
"text-gray-900 dark:text-gray-100",
|
|
@@ -56001,7 +56517,7 @@ function MarkdownTOC({
|
|
|
56001
56517
|
!collapsed ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
56002
56518
|
"nav",
|
|
56003
56519
|
{
|
|
56004
|
-
className:
|
|
56520
|
+
className: classNames74__default.default(
|
|
56005
56521
|
"eui-markdown-toc-list",
|
|
56006
56522
|
"space-y-1",
|
|
56007
56523
|
listClassName
|
|
@@ -56025,7 +56541,7 @@ function MarkdownTOC({
|
|
|
56025
56541
|
}
|
|
56026
56542
|
) : null
|
|
56027
56543
|
] });
|
|
56028
|
-
return /* @__PURE__ */ jsxRuntime.jsx("aside", { className:
|
|
56544
|
+
return /* @__PURE__ */ jsxRuntime.jsx("aside", { className: classNames74__default.default("eui-markdown-toc", "space-y-4", className), children: content3 });
|
|
56029
56545
|
}
|
|
56030
56546
|
var MarkdownTOC_default = MarkdownTOC;
|
|
56031
56547
|
var DEFAULT_MARKDOWN_TOOLBAR_ACTIONS = [
|
|
@@ -56124,7 +56640,7 @@ function MarkdownToolbar({
|
|
|
56124
56640
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
56125
56641
|
"div",
|
|
56126
56642
|
{
|
|
56127
|
-
className:
|
|
56643
|
+
className: classNames74__default.default(
|
|
56128
56644
|
"eui-markdown-toolbar",
|
|
56129
56645
|
"flex flex-wrap items-center gap-1 border-b border-gray-200 bg-gray-50 p-2",
|
|
56130
56646
|
"dark:border-gray-700 dark:bg-gray-900",
|
|
@@ -56138,7 +56654,7 @@ function MarkdownToolbar({
|
|
|
56138
56654
|
disabled: disabled || actionsDisabled,
|
|
56139
56655
|
title: action.shortcut ? `${action.title || action.label} (${action.shortcut})` : action.title || action.label,
|
|
56140
56656
|
onClick: () => onAction?.(action.id),
|
|
56141
|
-
className:
|
|
56657
|
+
className: classNames74__default.default(
|
|
56142
56658
|
"eui-markdown-toolbar-button",
|
|
56143
56659
|
"inline-flex items-center justify-center rounded border border-transparent",
|
|
56144
56660
|
"text-gray-700 transition-colors hover:border-gray-300 hover:bg-white",
|
|
@@ -56158,7 +56674,7 @@ function MarkdownToolbar({
|
|
|
56158
56674
|
disabled,
|
|
56159
56675
|
onClick: onViewModeToggle,
|
|
56160
56676
|
title: isPreviewMode ? "Switch to Markdown syntax" : "Switch to preview",
|
|
56161
|
-
className:
|
|
56677
|
+
className: classNames74__default.default(
|
|
56162
56678
|
"eui-markdown-view-toggle",
|
|
56163
56679
|
"inline-flex items-center justify-center rounded border font-medium transition-colors",
|
|
56164
56680
|
"border-gray-300 bg-white text-gray-700 hover:bg-gray-100",
|
|
@@ -56344,20 +56860,20 @@ function MarkdownSourceEditor({
|
|
|
56344
56860
|
onKeyDown,
|
|
56345
56861
|
...props
|
|
56346
56862
|
}) {
|
|
56347
|
-
const textareaRef =
|
|
56863
|
+
const textareaRef = React26.useRef(null);
|
|
56348
56864
|
const isControlled = value !== void 0;
|
|
56349
56865
|
const isViewModeControlled = viewMode !== void 0;
|
|
56350
|
-
const [internalValue, setInternalValue] =
|
|
56351
|
-
const [internalViewMode, setInternalViewMode] =
|
|
56866
|
+
const [internalValue, setInternalValue] = React26.useState(defaultValue);
|
|
56867
|
+
const [internalViewMode, setInternalViewMode] = React26.useState(defaultViewMode);
|
|
56352
56868
|
const currentValue = isControlled ? value : internalValue;
|
|
56353
56869
|
const currentViewMode = isViewModeControlled ? viewMode : internalViewMode;
|
|
56354
56870
|
const resolvedValue = currentValue ?? "";
|
|
56355
|
-
|
|
56871
|
+
React26.useEffect(() => {
|
|
56356
56872
|
if (!isControlled) {
|
|
56357
56873
|
setInternalValue(defaultValue);
|
|
56358
56874
|
}
|
|
56359
56875
|
}, [defaultValue, isControlled]);
|
|
56360
|
-
|
|
56876
|
+
React26.useEffect(() => {
|
|
56361
56877
|
if (!isViewModeControlled) {
|
|
56362
56878
|
setInternalViewMode(defaultViewMode);
|
|
56363
56879
|
}
|
|
@@ -56415,7 +56931,7 @@ function MarkdownSourceEditor({
|
|
|
56415
56931
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
56416
56932
|
"div",
|
|
56417
56933
|
{
|
|
56418
|
-
className:
|
|
56934
|
+
className: classNames74__default.default(
|
|
56419
56935
|
"eui-markdown-editor",
|
|
56420
56936
|
"overflow-hidden rounded border border-gray-300 bg-white",
|
|
56421
56937
|
"dark:border-gray-700 dark:bg-gray-950",
|
|
@@ -56431,7 +56947,7 @@ function MarkdownSourceEditor({
|
|
|
56431
56947
|
actionsDisabled: readOnly,
|
|
56432
56948
|
viewMode: currentViewMode,
|
|
56433
56949
|
showViewModeToggle,
|
|
56434
|
-
className:
|
|
56950
|
+
className: classNames74__default.default(toolbarClassName, toolbarProps?.className),
|
|
56435
56951
|
onViewModeToggle: toggleViewMode,
|
|
56436
56952
|
onAction: handleToolbarAction
|
|
56437
56953
|
}
|
|
@@ -56439,7 +56955,7 @@ function MarkdownSourceEditor({
|
|
|
56439
56955
|
currentViewMode === "preview" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
56440
56956
|
"div",
|
|
56441
56957
|
{
|
|
56442
|
-
className:
|
|
56958
|
+
className: classNames74__default.default(
|
|
56443
56959
|
"eui-markdown-editor-preview",
|
|
56444
56960
|
"min-h-[260px] p-4",
|
|
56445
56961
|
previewClassName
|
|
@@ -56462,7 +56978,7 @@ function MarkdownSourceEditor({
|
|
|
56462
56978
|
onChange: (event) => updateValue(event.target.value),
|
|
56463
56979
|
onBlur,
|
|
56464
56980
|
onKeyDown: handleKeyDown,
|
|
56465
|
-
className:
|
|
56981
|
+
className: classNames74__default.default(
|
|
56466
56982
|
"eui-markdown-source-textarea",
|
|
56467
56983
|
"block w-full resize-y border-0 bg-transparent p-4 font-mono text-sm leading-7",
|
|
56468
56984
|
"text-gray-900 outline-none placeholder:text-gray-400",
|
|
@@ -56492,7 +57008,7 @@ function MarkdownPreviewPane({
|
|
|
56492
57008
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
56493
57009
|
"div",
|
|
56494
57010
|
{
|
|
56495
|
-
className:
|
|
57011
|
+
className: classNames74__default.default(
|
|
56496
57012
|
"eui-markdown-preview-pane",
|
|
56497
57013
|
"rounded border border-gray-300 bg-white p-4",
|
|
56498
57014
|
"dark:border-gray-700 dark:bg-gray-950",
|
|
@@ -56525,9 +57041,9 @@ function MarkdownSplitEditor({
|
|
|
56525
57041
|
...sourceEditorProps
|
|
56526
57042
|
}) {
|
|
56527
57043
|
const isControlled = value !== void 0;
|
|
56528
|
-
const [internalValue, setInternalValue] =
|
|
57044
|
+
const [internalValue, setInternalValue] = React26.useState(defaultValue);
|
|
56529
57045
|
const currentValue = isControlled ? value : internalValue;
|
|
56530
|
-
|
|
57046
|
+
React26.useEffect(() => {
|
|
56531
57047
|
if (!isControlled) {
|
|
56532
57048
|
setInternalValue(defaultValue);
|
|
56533
57049
|
}
|
|
@@ -56542,7 +57058,7 @@ function MarkdownSplitEditor({
|
|
|
56542
57058
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
56543
57059
|
"div",
|
|
56544
57060
|
{
|
|
56545
|
-
className:
|
|
57061
|
+
className: classNames74__default.default(
|
|
56546
57062
|
"eui-markdown-split-editor",
|
|
56547
57063
|
"grid gap-4",
|
|
56548
57064
|
isHorizontal ? "grid-cols-1 lg:grid-cols-2" : "grid-cols-1",
|
|
@@ -56552,7 +57068,7 @@ function MarkdownSplitEditor({
|
|
|
56552
57068
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
56553
57069
|
"div",
|
|
56554
57070
|
{
|
|
56555
|
-
className:
|
|
57071
|
+
className: classNames74__default.default(
|
|
56556
57072
|
"eui-markdown-split-source",
|
|
56557
57073
|
"min-w-0 space-y-2",
|
|
56558
57074
|
sourceWrapperClassName
|
|
@@ -56576,7 +57092,7 @@ function MarkdownSplitEditor({
|
|
|
56576
57092
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
56577
57093
|
"div",
|
|
56578
57094
|
{
|
|
56579
|
-
className:
|
|
57095
|
+
className: classNames74__default.default(
|
|
56580
57096
|
"eui-markdown-split-preview",
|
|
56581
57097
|
"min-w-0 space-y-2",
|
|
56582
57098
|
previewWrapperClassName
|
|
@@ -56606,9 +57122,9 @@ function MarkdownEditor({
|
|
|
56606
57122
|
...sourceEditorProps
|
|
56607
57123
|
}) {
|
|
56608
57124
|
const isControlled = value !== void 0;
|
|
56609
|
-
const [internalValue, setInternalValue] =
|
|
57125
|
+
const [internalValue, setInternalValue] = React26.useState(defaultValue);
|
|
56610
57126
|
const currentValue = isControlled ? value : internalValue;
|
|
56611
|
-
|
|
57127
|
+
React26.useEffect(() => {
|
|
56612
57128
|
if (!isControlled) {
|
|
56613
57129
|
setInternalValue(defaultValue);
|
|
56614
57130
|
}
|
|
@@ -56666,7 +57182,7 @@ function MarkdownField({
|
|
|
56666
57182
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
56667
57183
|
"div",
|
|
56668
57184
|
{
|
|
56669
|
-
className:
|
|
57185
|
+
className: classNames74__default.default(
|
|
56670
57186
|
"eui-markdown-field",
|
|
56671
57187
|
"relative space-y-2",
|
|
56672
57188
|
wrapperClassName
|
|
@@ -56676,7 +57192,7 @@ function MarkdownField({
|
|
|
56676
57192
|
"label",
|
|
56677
57193
|
{
|
|
56678
57194
|
htmlFor: editorProps.id || field.name,
|
|
56679
|
-
className:
|
|
57195
|
+
className: classNames74__default.default(
|
|
56680
57196
|
"block text-sm font-medium text-gray-700 dark:text-gray-200",
|
|
56681
57197
|
labelClassName
|
|
56682
57198
|
),
|
|
@@ -56701,14 +57217,14 @@ function MarkdownField({
|
|
|
56701
57217
|
helperText && !hasError ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
56702
57218
|
"p",
|
|
56703
57219
|
{
|
|
56704
|
-
className:
|
|
57220
|
+
className: classNames74__default.default(
|
|
56705
57221
|
"text-sm text-gray-500 dark:text-gray-400",
|
|
56706
57222
|
helperTextClassName
|
|
56707
57223
|
),
|
|
56708
57224
|
children: helperText
|
|
56709
57225
|
}
|
|
56710
57226
|
) : null,
|
|
56711
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
57227
|
+
/* @__PURE__ */ jsxRuntime.jsx(InputResponse, { name: field.name, visibility: hasError, variant: "danger" })
|
|
56712
57228
|
]
|
|
56713
57229
|
}
|
|
56714
57230
|
);
|
|
@@ -56738,9 +57254,9 @@ function CodeMirrorMarkdownEditor({
|
|
|
56738
57254
|
extensions
|
|
56739
57255
|
}) {
|
|
56740
57256
|
const isControlled = value !== void 0;
|
|
56741
|
-
const [internalValue, setInternalValue] =
|
|
57257
|
+
const [internalValue, setInternalValue] = React26.useState(defaultValue);
|
|
56742
57258
|
const currentValue = isControlled ? value : internalValue;
|
|
56743
|
-
|
|
57259
|
+
React26.useEffect(() => {
|
|
56744
57260
|
if (!isControlled) {
|
|
56745
57261
|
setInternalValue(defaultValue);
|
|
56746
57262
|
}
|
|
@@ -56756,7 +57272,7 @@ function CodeMirrorMarkdownEditor({
|
|
|
56756
57272
|
{
|
|
56757
57273
|
id: id2,
|
|
56758
57274
|
"data-name": name2,
|
|
56759
|
-
className:
|
|
57275
|
+
className: classNames74__default.default(
|
|
56760
57276
|
"eui-markdown-adapter",
|
|
56761
57277
|
"eui-markdown-codemirror-adapter",
|
|
56762
57278
|
"overflow-hidden rounded border border-gray-300 bg-white",
|
|
@@ -56790,7 +57306,7 @@ function CodeMirrorMarkdownEditor({
|
|
|
56790
57306
|
closeBrackets: true,
|
|
56791
57307
|
bracketMatching: true
|
|
56792
57308
|
},
|
|
56793
|
-
className:
|
|
57309
|
+
className: classNames74__default.default("eui-markdown-codemirror", editorClassName),
|
|
56794
57310
|
onChange: updateValue,
|
|
56795
57311
|
onBlur
|
|
56796
57312
|
}
|
|
@@ -56885,7 +57401,7 @@ function createDefaultPlugins({
|
|
|
56885
57401
|
...showToolbar ? [
|
|
56886
57402
|
editor.toolbarPlugin({
|
|
56887
57403
|
toolbarContents: toolbarContents ?? DefaultToolbar,
|
|
56888
|
-
toolbarClassName:
|
|
57404
|
+
toolbarClassName: classNames74__default.default(
|
|
56889
57405
|
"eui-markdown-mdx-toolbar",
|
|
56890
57406
|
toolbarClassName
|
|
56891
57407
|
),
|
|
@@ -56894,7 +57410,7 @@ function createDefaultPlugins({
|
|
|
56894
57410
|
] : []
|
|
56895
57411
|
];
|
|
56896
57412
|
}
|
|
56897
|
-
var MDXMarkdownEditor =
|
|
57413
|
+
var MDXMarkdownEditor = React26.forwardRef(
|
|
56898
57414
|
function MDXMarkdownEditor2({
|
|
56899
57415
|
value,
|
|
56900
57416
|
defaultValue = "",
|
|
@@ -56925,11 +57441,11 @@ var MDXMarkdownEditor = React25.forwardRef(
|
|
|
56925
57441
|
linkDialogOptions,
|
|
56926
57442
|
...props
|
|
56927
57443
|
}, forwardedRef) {
|
|
56928
|
-
const editorRef =
|
|
57444
|
+
const editorRef = React26.useRef(null);
|
|
56929
57445
|
const isControlled = value !== void 0;
|
|
56930
|
-
const [internalValue, setInternalValue] =
|
|
57446
|
+
const [internalValue, setInternalValue] = React26.useState(defaultValue);
|
|
56931
57447
|
const currentValue = isControlled ? value : internalValue;
|
|
56932
|
-
const defaultPlugins =
|
|
57448
|
+
const defaultPlugins = React26.useMemo(
|
|
56933
57449
|
() => createDefaultPlugins({
|
|
56934
57450
|
showToolbar,
|
|
56935
57451
|
toolbarPosition,
|
|
@@ -56951,7 +57467,7 @@ var MDXMarkdownEditor = React25.forwardRef(
|
|
|
56951
57467
|
toolbarPosition
|
|
56952
57468
|
]
|
|
56953
57469
|
);
|
|
56954
|
-
|
|
57470
|
+
React26.useImperativeHandle(
|
|
56955
57471
|
forwardedRef,
|
|
56956
57472
|
() => ({
|
|
56957
57473
|
focus: (callbackFn, options) => editorRef.current?.focus(callbackFn, options),
|
|
@@ -56963,7 +57479,7 @@ var MDXMarkdownEditor = React25.forwardRef(
|
|
|
56963
57479
|
}),
|
|
56964
57480
|
[currentValue]
|
|
56965
57481
|
);
|
|
56966
|
-
|
|
57482
|
+
React26.useEffect(() => {
|
|
56967
57483
|
if (!isControlled || !editorRef.current) return;
|
|
56968
57484
|
const nextValue = value ?? "";
|
|
56969
57485
|
if (editorRef.current.getMarkdown() !== nextValue) {
|
|
@@ -57002,7 +57518,7 @@ var MDXMarkdownEditor = React25.forwardRef(
|
|
|
57002
57518
|
"aria-required": required || void 0,
|
|
57003
57519
|
"aria-invalid": invalid || void 0,
|
|
57004
57520
|
onBlurCapture: handleBlur,
|
|
57005
|
-
className:
|
|
57521
|
+
className: classNames74__default.default(
|
|
57006
57522
|
"eui-markdown-adapter",
|
|
57007
57523
|
"eui-markdown-mdx-adapter",
|
|
57008
57524
|
dark && ["dark", "dark-theme"],
|
|
@@ -57020,8 +57536,8 @@ var MDXMarkdownEditor = React25.forwardRef(
|
|
|
57020
57536
|
markdown: currentValue ?? "",
|
|
57021
57537
|
readOnly: disabled || readOnly,
|
|
57022
57538
|
plugins: plugins ?? defaultPlugins,
|
|
57023
|
-
className:
|
|
57024
|
-
contentEditableClassName:
|
|
57539
|
+
className: classNames74__default.default("eui-markdown-mdx-editor", editorClassName),
|
|
57540
|
+
contentEditableClassName: classNames74__default.default(
|
|
57025
57541
|
"eui-markdown-mdx-content",
|
|
57026
57542
|
contentEditableClassName
|
|
57027
57543
|
),
|
|
@@ -57045,7 +57561,7 @@ function MDXMarkdownField({
|
|
|
57045
57561
|
helperTextClassName,
|
|
57046
57562
|
...editorProps
|
|
57047
57563
|
}) {
|
|
57048
|
-
const editorRef =
|
|
57564
|
+
const editorRef = React26.useRef(null);
|
|
57049
57565
|
const [field, meta, helpers] = formik.useField({
|
|
57050
57566
|
name: name2,
|
|
57051
57567
|
validate
|
|
@@ -57058,7 +57574,7 @@ function MDXMarkdownField({
|
|
|
57058
57574
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
57059
57575
|
"div",
|
|
57060
57576
|
{
|
|
57061
|
-
className:
|
|
57577
|
+
className: classNames74__default.default(
|
|
57062
57578
|
"eui-markdown-mdx-field",
|
|
57063
57579
|
"relative space-y-2",
|
|
57064
57580
|
wrapperClassName
|
|
@@ -57068,7 +57584,7 @@ function MDXMarkdownField({
|
|
|
57068
57584
|
"label",
|
|
57069
57585
|
{
|
|
57070
57586
|
htmlFor: editorId,
|
|
57071
|
-
className:
|
|
57587
|
+
className: classNames74__default.default(
|
|
57072
57588
|
"block text-sm font-medium text-gray-700 dark:text-gray-200",
|
|
57073
57589
|
labelClassName
|
|
57074
57590
|
),
|
|
@@ -57102,7 +57618,7 @@ function MDXMarkdownField({
|
|
|
57102
57618
|
"p",
|
|
57103
57619
|
{
|
|
57104
57620
|
id: helperId,
|
|
57105
|
-
className:
|
|
57621
|
+
className: classNames74__default.default(
|
|
57106
57622
|
"text-sm text-gray-500 dark:text-gray-400",
|
|
57107
57623
|
helperTextClassName
|
|
57108
57624
|
),
|
|
@@ -57110,7 +57626,7 @@ function MDXMarkdownField({
|
|
|
57110
57626
|
}
|
|
57111
57627
|
) : null,
|
|
57112
57628
|
/* @__PURE__ */ jsxRuntime.jsx("div", { id: errorId, role: hasError ? "alert" : void 0, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
57113
|
-
|
|
57629
|
+
InputResponse,
|
|
57114
57630
|
{
|
|
57115
57631
|
name: field.name,
|
|
57116
57632
|
visibility: hasError,
|
|
@@ -57162,10 +57678,10 @@ function MarkdownLayout({
|
|
|
57162
57678
|
};
|
|
57163
57679
|
const hasLeftToc = hasToc && tocPosition === "left";
|
|
57164
57680
|
const hasRightToc = hasToc && tocPosition === "right";
|
|
57165
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
57681
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames74__default.default("eui-markdown-layout", "w-full", className), children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
57166
57682
|
"div",
|
|
57167
57683
|
{
|
|
57168
|
-
className:
|
|
57684
|
+
className: classNames74__default.default(
|
|
57169
57685
|
"eui-markdown-layout-container",
|
|
57170
57686
|
"mx-auto w-full px-4 sm:px-6 lg:px-8",
|
|
57171
57687
|
containerClassName
|
|
@@ -57177,7 +57693,7 @@ function MarkdownLayout({
|
|
|
57177
57693
|
header ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
57178
57694
|
"header",
|
|
57179
57695
|
{
|
|
57180
|
-
className:
|
|
57696
|
+
className: classNames74__default.default(
|
|
57181
57697
|
"eui-markdown-layout-header",
|
|
57182
57698
|
"mb-8",
|
|
57183
57699
|
headerClassName
|
|
@@ -57188,7 +57704,7 @@ function MarkdownLayout({
|
|
|
57188
57704
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
57189
57705
|
"div",
|
|
57190
57706
|
{
|
|
57191
|
-
className:
|
|
57707
|
+
className: classNames74__default.default(
|
|
57192
57708
|
"eui-markdown-layout-grid",
|
|
57193
57709
|
"grid grid-cols-1 gap-8",
|
|
57194
57710
|
hasSidebar && hasToc && "xl:grid-cols-[16rem_minmax(0,1fr)_18rem]",
|
|
@@ -57201,7 +57717,7 @@ function MarkdownLayout({
|
|
|
57201
57717
|
hasSidebar ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
57202
57718
|
"aside",
|
|
57203
57719
|
{
|
|
57204
|
-
className:
|
|
57720
|
+
className: classNames74__default.default(
|
|
57205
57721
|
"eui-markdown-layout-sidebar",
|
|
57206
57722
|
"min-w-0",
|
|
57207
57723
|
stickySidebar && "lg:sticky lg:self-start",
|
|
@@ -57214,7 +57730,7 @@ function MarkdownLayout({
|
|
|
57214
57730
|
hasLeftToc ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
57215
57731
|
"aside",
|
|
57216
57732
|
{
|
|
57217
|
-
className:
|
|
57733
|
+
className: classNames74__default.default(
|
|
57218
57734
|
"eui-markdown-layout-toc",
|
|
57219
57735
|
"min-w-0",
|
|
57220
57736
|
stickyToc && "lg:sticky lg:self-start",
|
|
@@ -57227,7 +57743,7 @@ function MarkdownLayout({
|
|
|
57227
57743
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
57228
57744
|
"main",
|
|
57229
57745
|
{
|
|
57230
|
-
className:
|
|
57746
|
+
className: classNames74__default.default(
|
|
57231
57747
|
"eui-markdown-layout-content",
|
|
57232
57748
|
"min-w-0",
|
|
57233
57749
|
contentClassName
|
|
@@ -57238,7 +57754,7 @@ function MarkdownLayout({
|
|
|
57238
57754
|
hasRightToc ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
57239
57755
|
"aside",
|
|
57240
57756
|
{
|
|
57241
|
-
className:
|
|
57757
|
+
className: classNames74__default.default(
|
|
57242
57758
|
"eui-markdown-layout-toc",
|
|
57243
57759
|
"min-w-0",
|
|
57244
57760
|
stickyToc && "lg:sticky lg:self-start",
|
|
@@ -57251,7 +57767,7 @@ function MarkdownLayout({
|
|
|
57251
57767
|
hasAside ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
57252
57768
|
"aside",
|
|
57253
57769
|
{
|
|
57254
|
-
className:
|
|
57770
|
+
className: classNames74__default.default(
|
|
57255
57771
|
"eui-markdown-layout-aside",
|
|
57256
57772
|
"min-w-0",
|
|
57257
57773
|
stickyAside && "2xl:sticky 2xl:self-start",
|
|
@@ -57267,7 +57783,7 @@ function MarkdownLayout({
|
|
|
57267
57783
|
footer2 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
57268
57784
|
"footer",
|
|
57269
57785
|
{
|
|
57270
|
-
className:
|
|
57786
|
+
className: classNames74__default.default(
|
|
57271
57787
|
"eui-markdown-layout-footer",
|
|
57272
57788
|
"mt-10",
|
|
57273
57789
|
footerClassName
|
|
@@ -57304,7 +57820,7 @@ function MarkdownDocsLayoutContent({
|
|
|
57304
57820
|
const resolvedHeader = header ?? (title || description || headerActions ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
57305
57821
|
"div",
|
|
57306
57822
|
{
|
|
57307
|
-
className:
|
|
57823
|
+
className: classNames74__default.default(
|
|
57308
57824
|
"eui-markdown-docs-header",
|
|
57309
57825
|
"flex flex-col gap-4 border-b border-gray-200 pb-6",
|
|
57310
57826
|
"dark:border-gray-700",
|
|
@@ -57315,7 +57831,7 @@ function MarkdownDocsLayoutContent({
|
|
|
57315
57831
|
title ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
57316
57832
|
"h1",
|
|
57317
57833
|
{
|
|
57318
|
-
className:
|
|
57834
|
+
className: classNames74__default.default(
|
|
57319
57835
|
"eui-markdown-docs-title",
|
|
57320
57836
|
"text-3xl font-bold tracking-tight text-gray-950",
|
|
57321
57837
|
"dark:text-gray-50",
|
|
@@ -57327,7 +57843,7 @@ function MarkdownDocsLayoutContent({
|
|
|
57327
57843
|
description ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
57328
57844
|
"div",
|
|
57329
57845
|
{
|
|
57330
|
-
className:
|
|
57846
|
+
className: classNames74__default.default(
|
|
57331
57847
|
"eui-markdown-docs-description",
|
|
57332
57848
|
"max-w-3xl text-base leading-7 text-gray-600",
|
|
57333
57849
|
"dark:text-gray-400",
|
|
@@ -57415,7 +57931,7 @@ function GenericLayout({
|
|
|
57415
57931
|
return /* @__PURE__ */ jsxRuntime.jsx(ThemeProvider, { defaultTheme, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
57416
57932
|
"div",
|
|
57417
57933
|
{
|
|
57418
|
-
className:
|
|
57934
|
+
className: classNames74__default.default({
|
|
57419
57935
|
[`${styles}`]: styles
|
|
57420
57936
|
}),
|
|
57421
57937
|
children: children3
|
|
@@ -57452,7 +57968,7 @@ function SidebarLayout({
|
|
|
57452
57968
|
header = /* @__PURE__ */ jsxRuntime.jsx(Header, {}),
|
|
57453
57969
|
footer: footer2 = /* @__PURE__ */ jsxRuntime.jsx(Footer, {})
|
|
57454
57970
|
}) {
|
|
57455
|
-
const [showSidebar, setShowSidebar] =
|
|
57971
|
+
const [showSidebar, setShowSidebar] = React26.useState(true);
|
|
57456
57972
|
return /* @__PURE__ */ jsxRuntime.jsx(GenericLayout_default, { children: /* @__PURE__ */ jsxRuntime.jsx(Layout, { children: /* @__PURE__ */ jsxRuntime.jsx(Layout, { flexDirection: "horizontal", children: /* @__PURE__ */ jsxRuntime.jsxs(Content, { sidebarVisible: showSidebar, styles: "theme-bg-md pt-[60px]", children: [
|
|
57457
57973
|
/* @__PURE__ */ jsxRuntime.jsx(ContentArea_default, { children: children3 }),
|
|
57458
57974
|
footer2
|
|
@@ -57464,7 +57980,7 @@ function SidemenuLayout({ data, children: children3 }) {
|
|
|
57464
57980
|
return /* @__PURE__ */ jsxRuntime.jsx(DefaultLayout_default, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
57465
57981
|
"div",
|
|
57466
57982
|
{
|
|
57467
|
-
className:
|
|
57983
|
+
className: classNames74__default.default({
|
|
57468
57984
|
grid: true,
|
|
57469
57985
|
"grid-cols-7 gap-10": !isMobile,
|
|
57470
57986
|
"grid-cols-1 gap-": isMobile
|
|
@@ -57477,11 +57993,32 @@ function SidemenuLayout({ data, children: children3 }) {
|
|
|
57477
57993
|
) });
|
|
57478
57994
|
}
|
|
57479
57995
|
var SidemenuLayout_default = SidemenuLayout;
|
|
57996
|
+
var EUIDevPreviewPlatformContext = React26.createContext({
|
|
57997
|
+
platform: "web",
|
|
57998
|
+
setPlatform: () => void 0
|
|
57999
|
+
});
|
|
58000
|
+
var useEUIDevPreviewPlatform = () => React26.useContext(EUIDevPreviewPlatformContext);
|
|
57480
58001
|
function EUIDevLayout({
|
|
57481
58002
|
children: children3,
|
|
57482
|
-
header
|
|
58003
|
+
header,
|
|
57483
58004
|
footer: footer2 = /* @__PURE__ */ jsxRuntime.jsx(Footer, {})
|
|
57484
58005
|
}) {
|
|
58006
|
+
const [platform, setPlatform] = React26.useState("web");
|
|
58007
|
+
const previewPlatform = React26.useMemo(
|
|
58008
|
+
() => ({
|
|
58009
|
+
platform,
|
|
58010
|
+
setPlatform
|
|
58011
|
+
}),
|
|
58012
|
+
[platform]
|
|
58013
|
+
);
|
|
58014
|
+
const resolvedHeader = header ?? /* @__PURE__ */ jsxRuntime.jsx(
|
|
58015
|
+
Header,
|
|
58016
|
+
{
|
|
58017
|
+
onPreviewPlatformChange: setPlatform,
|
|
58018
|
+
previewPlatform: platform,
|
|
58019
|
+
showPreviewPlatformSelector: true
|
|
58020
|
+
}
|
|
58021
|
+
);
|
|
57485
58022
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
57486
58023
|
EUIProvider,
|
|
57487
58024
|
{
|
|
@@ -57493,8 +58030,8 @@ function EUIDevLayout({
|
|
|
57493
58030
|
}
|
|
57494
58031
|
},
|
|
57495
58032
|
children: /* @__PURE__ */ jsxRuntime.jsx(GenericLayout_default, { children: /* @__PURE__ */ jsxRuntime.jsxs(Layout, { children: [
|
|
57496
|
-
|
|
57497
|
-
/* @__PURE__ */ jsxRuntime.jsx(Content, { styles: "pt-[60px]", children: /* @__PURE__ */ jsxRuntime.jsx(ContentArea_default, { enablePadding: true, children: children3 }) }),
|
|
58033
|
+
resolvedHeader,
|
|
58034
|
+
/* @__PURE__ */ jsxRuntime.jsx(EUIDevPreviewPlatformContext.Provider, { value: previewPlatform, children: /* @__PURE__ */ jsxRuntime.jsx(Content, { styles: "pt-[60px]", children: /* @__PURE__ */ jsxRuntime.jsx(ContentArea_default, { enablePadding: true, children: children3 }) }) }),
|
|
57498
58035
|
footer2
|
|
57499
58036
|
] }) })
|
|
57500
58037
|
}
|
|
@@ -57506,7 +58043,7 @@ function ScrollToTop({
|
|
|
57506
58043
|
behavior = "smooth",
|
|
57507
58044
|
target
|
|
57508
58045
|
}) {
|
|
57509
|
-
|
|
58046
|
+
React26.useEffect(() => {
|
|
57510
58047
|
if (target) {
|
|
57511
58048
|
target.scrollTo({
|
|
57512
58049
|
top: 0,
|
|
@@ -57540,7 +58077,7 @@ exports.BoxNavItem = BoxNavItem_default;
|
|
|
57540
58077
|
exports.Brand = Brand;
|
|
57541
58078
|
exports.Breadcrumb = Breadcrumb;
|
|
57542
58079
|
exports.BreadcrumbItem = BreadcrumbItem_default;
|
|
57543
|
-
exports.Button =
|
|
58080
|
+
exports.Button = Button_web_default;
|
|
57544
58081
|
exports.CHART_COLOR_PALETTE = CHART_COLOR_PALETTE;
|
|
57545
58082
|
exports.CHART_DARK_THEME = CHART_DARK_THEME;
|
|
57546
58083
|
exports.CHART_DATA_MODES = CHART_DATA_MODES;
|
|
@@ -57579,7 +58116,7 @@ exports.ChartPlotFrame = ChartPlotFrame;
|
|
|
57579
58116
|
exports.ChartProvider = ChartProvider;
|
|
57580
58117
|
exports.ChartToolbar = ChartToolbar;
|
|
57581
58118
|
exports.ChartTooltip = ChartTooltip;
|
|
57582
|
-
exports.Checkbox =
|
|
58119
|
+
exports.Checkbox = Checkbox;
|
|
57583
58120
|
exports.Chip = Chip;
|
|
57584
58121
|
exports.CloudinaryImage = CloudinaryImage2;
|
|
57585
58122
|
exports.CloudinaryProvider = CloudinaryProvider;
|
|
@@ -57654,10 +58191,10 @@ exports.InfiniteScrollTrigger = InfiniteScrollTrigger_default;
|
|
|
57654
58191
|
exports.Info = Info;
|
|
57655
58192
|
exports.Input = Input;
|
|
57656
58193
|
exports.InputFile = InputFile;
|
|
57657
|
-
exports.InputLabel =
|
|
58194
|
+
exports.InputLabel = InputLabel;
|
|
57658
58195
|
exports.InputList = InputList;
|
|
57659
58196
|
exports.InputListGroup = InputListGroup;
|
|
57660
|
-
exports.InputResponse =
|
|
58197
|
+
exports.InputResponse = InputResponse;
|
|
57661
58198
|
exports.Label = Label;
|
|
57662
58199
|
exports.Layout = Layout;
|
|
57663
58200
|
exports.Lead = Lead;
|
|
@@ -57721,6 +58258,7 @@ exports.Overline = Overline;
|
|
|
57721
58258
|
exports.Paragraph = Paragraph;
|
|
57722
58259
|
exports.PiePlot = PiePlot;
|
|
57723
58260
|
exports.PollingChartDataSource = PollingChartDataSource;
|
|
58261
|
+
exports.PreviewSwitch = PreviewSwitch;
|
|
57724
58262
|
exports.PriceTag = PriceTag;
|
|
57725
58263
|
exports.ProgressBar = ProgressBar;
|
|
57726
58264
|
exports.ProgressBarRating = ProgressBarRating;
|
|
@@ -57765,6 +58303,7 @@ exports.Tags = Tags_default;
|
|
|
57765
58303
|
exports.TextArea = TextArea_default;
|
|
57766
58304
|
exports.ThemeContext = ThemeContext;
|
|
57767
58305
|
exports.ThemeProvider = ThemeProvider;
|
|
58306
|
+
exports.ThemeSelect = ThemeSelect;
|
|
57768
58307
|
exports.ThemeSwitch = ThemeSwitch;
|
|
57769
58308
|
exports.TitleBanner = TitleBanner;
|
|
57770
58309
|
exports.Toast = Toast;
|
|
@@ -57831,8 +58370,10 @@ exports.getBrowserOrigin = getBrowserOrigin;
|
|
|
57831
58370
|
exports.getBrowserRedirectURL = getBrowserRedirectURL;
|
|
57832
58371
|
exports.getConsentStatusFromCategories = getConsentStatusFromCategories;
|
|
57833
58372
|
exports.getCurrencySymbol = getCurrencySymbol;
|
|
58373
|
+
exports.getCurrentFullUrl = getCurrentFullUrl;
|
|
57834
58374
|
exports.getCurrentPath = getCurrentPath;
|
|
57835
58375
|
exports.getCurrentReferrer = getCurrentReferrer;
|
|
58376
|
+
exports.getCurrentTitle = getCurrentTitle;
|
|
57836
58377
|
exports.getDeviceInfo = getDeviceInfo;
|
|
57837
58378
|
exports.getDoNotTrackEnabled = getDoNotTrackEnabled;
|
|
57838
58379
|
exports.getLayout = getLayout;
|
|
@@ -57899,6 +58440,7 @@ exports.useCookieConsent = useCookieConsent;
|
|
|
57899
58440
|
exports.useCurrentTheme = useCurrentTheme_default;
|
|
57900
58441
|
exports.useDrawer = useDrawer_default;
|
|
57901
58442
|
exports.useEUIConfig = useEUIConfig;
|
|
58443
|
+
exports.useEUIDevPreviewPlatform = useEUIDevPreviewPlatform;
|
|
57902
58444
|
exports.useIsMobile = useIsMobile_default;
|
|
57903
58445
|
exports.useMarkdown = useMarkdown;
|
|
57904
58446
|
exports.useMarkdownHeadings = useMarkdownHeadings;
|