react-better-html 1.1.162 → 1.1.164

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/dist/index.js CHANGED
@@ -92,7 +92,7 @@ __export(index_exports, {
92
92
  module.exports = __toCommonJS(index_exports);
93
93
 
94
94
  // src/components/Div.tsx
95
- var import_react11 = require("react");
95
+ var import_react13 = require("react");
96
96
  var import_styled_components8 = __toESM(require("styled-components"));
97
97
 
98
98
  // src/constants.ts
@@ -102,6 +102,7 @@ var isMobileDevice = /Mobi|Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Op
102
102
 
103
103
  // src/utils/hooks.ts
104
104
  var import_react10 = require("react");
105
+ var import_react_router_dom = require("react-router-dom");
105
106
 
106
107
  // src/constants/css.ts
107
108
  var cssProps = {
@@ -1639,10 +1640,7 @@ var alertsPlugin = (options) => ({
1639
1640
  });
1640
1641
 
1641
1642
  // src/plugins/reactRouterDom.ts
1642
- var reactRouterDomLib = __toESM(require("react-router-dom"));
1643
- var defaultReactRouterDomPluginOptions = {
1644
- reactRouterDomLib
1645
- };
1643
+ var defaultReactRouterDomPluginOptions = {};
1646
1644
  var reactRouterDomPlugin = (options) => ({
1647
1645
  name: "react-router-dom",
1648
1646
  initialize: () => {
@@ -3153,15 +3151,14 @@ function useUrlQuery() {
3153
3151
  "`useUrlQuery` hook requires the `react-router-dom` plugin to be added to the `plugins` prop in `<BetterHtmlProvider>`."
3154
3152
  );
3155
3153
  }
3156
- const reactRouterDomPluginConfig = reactRouterDomPlugin2.getConfig();
3157
- const isInRouterContext = reactRouterDomPluginConfig.reactRouterDomLib.useInRouterContext();
3154
+ const isInRouterContext = (0, import_react_router_dom.useInRouterContext)();
3158
3155
  if (!isInRouterContext) {
3159
3156
  throw new Error(
3160
3157
  "`useUrlQuery` hook must be used inside a React Router context. Make sure your component is wrapped in a `<BrowserRouter>`, or another Router component."
3161
3158
  );
3162
3159
  }
3163
- const navigate = reactRouterDomPluginConfig.reactRouterDomLib.useNavigate();
3164
- const [searchParams] = reactRouterDomPluginConfig.reactRouterDomLib.useSearchParams();
3160
+ const navigate = (0, import_react_router_dom.useNavigate)();
3161
+ const [searchParams] = (0, import_react_router_dom.useSearchParams)();
3165
3162
  const setQuery = (0, import_react10.useCallback)(
3166
3163
  (query, keepHistory = true) => {
3167
3164
  const currentSearchParams = {};
@@ -3170,7 +3167,7 @@ function useUrlQuery() {
3170
3167
  });
3171
3168
  navigate(
3172
3169
  {
3173
- search: reactRouterDomPluginConfig.reactRouterDomLib.createSearchParams({
3170
+ search: (0, import_react_router_dom.createSearchParams)({
3174
3171
  ...currentSearchParams,
3175
3172
  ...Object.fromEntries(Object.entries(query).map(([key, value]) => [key, value.toString()]))
3176
3173
  }).toString()
@@ -3204,8 +3201,117 @@ function useUrlQuery() {
3204
3201
  };
3205
3202
  }
3206
3203
 
3207
- // src/components/Div.tsx
3204
+ // src/components/Divider.tsx
3205
+ var import_react11 = require("react");
3208
3206
  var import_jsx_runtime9 = require("react/jsx-runtime");
3207
+ var Divider_default = {
3208
+ vertical: (0, import_react11.memo)(
3209
+ (0, import_react11.forwardRef)(function Divider({ width = 1, backgroundColor, height, ...props }, ref) {
3210
+ const theme2 = useTheme();
3211
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3212
+ Div_default,
3213
+ {
3214
+ width,
3215
+ height: height ?? "100%",
3216
+ flexShrink: 0,
3217
+ backgroundColor: backgroundColor ?? theme2.colors.border,
3218
+ ...props,
3219
+ ref
3220
+ }
3221
+ );
3222
+ })
3223
+ ),
3224
+ horizontal: (0, import_react11.memo)(
3225
+ (0, import_react11.forwardRef)(function Divider2({ width = 1, backgroundColor, text, textFontSize, textColor, ...props }, ref) {
3226
+ const theme2 = useTheme();
3227
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Div_default.row, { width: "100%", alignItems: "center", gap: text ? theme2.styles.space : void 0, ...props, ref, children: [
3228
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Div_default, { flex: 1, height: width, flexShrink: 0, backgroundColor: backgroundColor ?? theme2.colors.border }),
3229
+ text && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text_default, { fontSize: textFontSize, color: textColor ?? theme2.colors.textSecondary, children: text }),
3230
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Div_default, { flex: 1, height: width, flexShrink: 0, backgroundColor: backgroundColor ?? theme2.colors.border })
3231
+ ] });
3232
+ })
3233
+ )
3234
+ };
3235
+
3236
+ // src/components/PageHeader.tsx
3237
+ var import_react12 = require("react");
3238
+ var import_jsx_runtime10 = require("react/jsx-runtime");
3239
+ var PageHeaderComponent = (0, import_react12.forwardRef)(function PageHeader({
3240
+ imageUrl,
3241
+ imageSize = 60,
3242
+ title,
3243
+ titleAs,
3244
+ titleColor,
3245
+ titleRightElement,
3246
+ description,
3247
+ descriptionColor,
3248
+ textAlign,
3249
+ rightElement,
3250
+ lightMode,
3251
+ marginBottom
3252
+ }, ref) {
3253
+ const theme2 = useTheme();
3254
+ const { app } = useBetterHtmlContextInternal();
3255
+ const mediaQuery = useMediaQuery();
3256
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3257
+ Div_default.row,
3258
+ {
3259
+ alignItems: "center",
3260
+ gap: theme2.styles.space,
3261
+ marginBottom: marginBottom ?? theme2.styles.space * 2,
3262
+ ref,
3263
+ children: [
3264
+ imageUrl && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Image_default.profileImage, { src: imageUrl, size: imageSize ?? (mediaQuery.size600 ? 46 : 60) }),
3265
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3266
+ Div_default.column,
3267
+ {
3268
+ alignItems: textAlign === "center" ? "center" : textAlign === "right" ? "flex-end" : void 0,
3269
+ flex: 1,
3270
+ gap: theme2.styles.gap / 2,
3271
+ children: [
3272
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
3273
+ Div_default.row,
3274
+ {
3275
+ alignItems: "center",
3276
+ justifyContent: textAlign === "center" ? "center" : textAlign === "right" ? "flex-end" : void 0,
3277
+ gap: theme2.styles.space,
3278
+ children: [
3279
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3280
+ Text_default,
3281
+ {
3282
+ as: titleAs ?? "h1",
3283
+ textAlign,
3284
+ color: titleColor ?? (lightMode ? theme2.colors.base : theme2.colors.textPrimary),
3285
+ children: title
3286
+ }
3287
+ ),
3288
+ titleRightElement
3289
+ ]
3290
+ }
3291
+ ),
3292
+ description && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3293
+ Text_default,
3294
+ {
3295
+ maxWidth: !mediaQuery.size600 ? app.contentMaxWidth * 0.6 : void 0,
3296
+ textAlign,
3297
+ color: descriptionColor ?? (lightMode ? theme2.colors.base : theme2.colors.textSecondary),
3298
+ opacity: lightMode ? 0.7 : void 0,
3299
+ children: description
3300
+ }
3301
+ )
3302
+ ]
3303
+ }
3304
+ ),
3305
+ rightElement
3306
+ ]
3307
+ }
3308
+ );
3309
+ });
3310
+ var PageHeader2 = (0, import_react12.memo)(PageHeaderComponent);
3311
+ var PageHeader_default = PageHeader2;
3312
+
3313
+ // src/components/Div.tsx
3314
+ var import_jsx_runtime11 = require("react/jsx-runtime");
3209
3315
  var DivStyledComponent = import_styled_components8.default.div.withConfig({
3210
3316
  shouldForwardProp: (prop) => !["normalStyle", "hoverStyle"].includes(prop)
3211
3317
  })`
@@ -3215,7 +3321,7 @@ var DivStyledComponent = import_styled_components8.default.div.withConfig({
3215
3321
  ${(props) => props.hoverStyle}
3216
3322
  }
3217
3323
  `;
3218
- var DivComponent = (0, import_react11.forwardRef)(function Div({
3324
+ var DivComponent = (0, import_react13.forwardRef)(function Div({
3219
3325
  as = "div",
3220
3326
  value,
3221
3327
  isTabAccessed,
@@ -3232,14 +3338,14 @@ var DivComponent = (0, import_react11.forwardRef)(function Div({
3232
3338
  const dataProps = useComponentPropsWithPrefix(props, "data");
3233
3339
  const ariaProps = useComponentPropsWithPrefix(props, "aria");
3234
3340
  const restProps = useComponentPropsWithoutStyle(props);
3235
- const onClickElement = (0, import_react11.useCallback)(
3341
+ const onClickElement = (0, import_react13.useCallback)(
3236
3342
  (event) => {
3237
3343
  onClick?.(event);
3238
3344
  onClickWithValue?.(value);
3239
3345
  },
3240
3346
  [onClick, onClickWithValue, value]
3241
3347
  );
3242
- const onKeyDownElement = (0, import_react11.useCallback)(
3348
+ const onKeyDownElement = (0, import_react13.useCallback)(
3243
3349
  (event) => {
3244
3350
  onKeyDown?.(event);
3245
3351
  if (!isTabAccessed) return;
@@ -3250,7 +3356,7 @@ var DivComponent = (0, import_react11.forwardRef)(function Div({
3250
3356
  },
3251
3357
  [onKeyDown, isTabAccessed]
3252
3358
  );
3253
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3359
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3254
3360
  DivStyledComponent,
3255
3361
  {
3256
3362
  as,
@@ -3268,9 +3374,9 @@ var DivComponent = (0, import_react11.forwardRef)(function Div({
3268
3374
  }
3269
3375
  );
3270
3376
  });
3271
- DivComponent.row = (0, import_react11.forwardRef)(function Row({ flexReverse, invertFlexDirection, ...props }, ref) {
3377
+ DivComponent.row = (0, import_react13.forwardRef)(function Row({ flexReverse, invertFlexDirection, ...props }, ref) {
3272
3378
  const reverseSuffix = flexReverse ? "-reverse" : "";
3273
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3379
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3274
3380
  DivComponent,
3275
3381
  {
3276
3382
  display: "flex",
@@ -3280,9 +3386,9 @@ DivComponent.row = (0, import_react11.forwardRef)(function Row({ flexReverse, in
3280
3386
  }
3281
3387
  );
3282
3388
  });
3283
- DivComponent.column = (0, import_react11.forwardRef)(function Column({ flexReverse, invertFlexDirection, ...props }, ref) {
3389
+ DivComponent.column = (0, import_react13.forwardRef)(function Column({ flexReverse, invertFlexDirection, ...props }, ref) {
3284
3390
  const reverseSuffix = flexReverse ? "-reverse" : "";
3285
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3391
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3286
3392
  DivComponent,
3287
3393
  {
3288
3394
  display: "flex",
@@ -3292,13 +3398,29 @@ DivComponent.column = (0, import_react11.forwardRef)(function Column({ flexRever
3292
3398
  }
3293
3399
  );
3294
3400
  });
3295
- DivComponent.grid = (0, import_react11.forwardRef)(function Grid(props, ref) {
3296
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DivComponent, { display: "grid", ref, ...props });
3401
+ DivComponent.grid = (0, import_react13.forwardRef)(function Grid(props, ref) {
3402
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DivComponent, { display: "grid", ref, ...props });
3297
3403
  });
3298
- DivComponent.box = (0, import_react11.forwardRef)(function Box2({ isActive, ...props }, ref) {
3404
+ DivComponent.box = (0, import_react13.forwardRef)(function Box2({
3405
+ imageUrl,
3406
+ imageSize,
3407
+ title,
3408
+ titleAs,
3409
+ titleColor,
3410
+ titleRightElement,
3411
+ description,
3412
+ descriptionColor,
3413
+ textAlign,
3414
+ rightElement,
3415
+ lightMode,
3416
+ headerBackgroundColor,
3417
+ isActive,
3418
+ children,
3419
+ ...props
3420
+ }, ref) {
3299
3421
  const theme2 = useTheme();
3300
3422
  const withClick = props.onClick || props.onClickWithValue;
3301
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3423
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
3302
3424
  DivComponent,
3303
3425
  {
3304
3426
  color: isActive ? theme2.colors.base : void 0,
@@ -3308,57 +3430,61 @@ DivComponent.box = (0, import_react11.forwardRef)(function Box2({ isActive, ...p
3308
3430
  borderColorHover: withClick && !isActive ? theme2.colors.primary : void 0,
3309
3431
  filterHover: withClick && isActive ? "brightness(0.9)" : void 0,
3310
3432
  cursor: withClick ? "pointer" : void 0,
3311
- paddingBlock: theme2.styles.gap,
3433
+ paddingBlock: title ? theme2.styles.space : theme2.styles.gap,
3312
3434
  paddingInline: theme2.styles.space,
3313
3435
  ref,
3314
- ...props
3436
+ ...props,
3437
+ children: [
3438
+ title && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
3439
+ Div2,
3440
+ {
3441
+ backgroundColor: headerBackgroundColor,
3442
+ borderTopLeftRadius: props.borderTopLeftRadius ?? props.borderRadius ?? theme2.styles.borderRadius - 1,
3443
+ borderTopRightRadius: props.borderTopRightRadius ?? props.borderRadius ?? theme2.styles.borderRadius - 1,
3444
+ marginInline: -theme2.styles.space,
3445
+ marginTop: -theme2.styles.space,
3446
+ marginBottom: theme2.styles.space,
3447
+ paddingInline: theme2.styles.space,
3448
+ paddingTop: theme2.styles.space,
3449
+ children: [
3450
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3451
+ PageHeader_default,
3452
+ {
3453
+ imageUrl,
3454
+ imageSize,
3455
+ title,
3456
+ titleAs,
3457
+ titleColor,
3458
+ titleRightElement,
3459
+ description,
3460
+ descriptionColor,
3461
+ textAlign,
3462
+ rightElement,
3463
+ lightMode,
3464
+ marginBottom: theme2.styles.space
3465
+ }
3466
+ ),
3467
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Div2, { width: `calc(100% + ${theme2.styles.space * 2}px)`, marginLeft: -theme2.styles.space, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Divider_default.horizontal, {}) })
3468
+ ]
3469
+ }
3470
+ ),
3471
+ children
3472
+ ]
3315
3473
  }
3316
3474
  );
3317
3475
  });
3318
- var Div2 = (0, import_react11.memo)(DivComponent);
3476
+ var Div2 = (0, import_react13.memo)(DivComponent);
3319
3477
  Div2.row = DivComponent.row;
3320
3478
  Div2.column = DivComponent.column;
3321
3479
  Div2.grid = DivComponent.grid;
3322
3480
  Div2.box = DivComponent.box;
3323
3481
  var Div_default = Div2;
3324
3482
 
3325
- // src/components/Divider.tsx
3326
- var import_react12 = require("react");
3327
- var import_jsx_runtime10 = require("react/jsx-runtime");
3328
- var Divider_default = {
3329
- vertical: (0, import_react12.memo)(
3330
- (0, import_react12.forwardRef)(function Divider({ width = 1, backgroundColor, height, ...props }, ref) {
3331
- const theme2 = useTheme();
3332
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3333
- Div_default,
3334
- {
3335
- width,
3336
- height: height ?? "100%",
3337
- flexShrink: 0,
3338
- backgroundColor: backgroundColor ?? theme2.colors.border,
3339
- ...props,
3340
- ref
3341
- }
3342
- );
3343
- })
3344
- ),
3345
- horizontal: (0, import_react12.memo)(
3346
- (0, import_react12.forwardRef)(function Divider2({ width = 1, backgroundColor, text, textFontSize, textColor, ...props }, ref) {
3347
- const theme2 = useTheme();
3348
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Div_default.row, { width: "100%", alignItems: "center", gap: text ? theme2.styles.space : void 0, ...props, ref, children: [
3349
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Div_default, { flex: 1, height: width, flexShrink: 0, backgroundColor: backgroundColor ?? theme2.colors.border }),
3350
- text && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text_default, { fontSize: textFontSize, color: textColor ?? theme2.colors.textSecondary, children: text }),
3351
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Div_default, { flex: 1, height: width, flexShrink: 0, backgroundColor: backgroundColor ?? theme2.colors.border })
3352
- ] });
3353
- })
3354
- )
3355
- };
3356
-
3357
3483
  // src/components/Modal.tsx
3358
- var import_react13 = require("react");
3484
+ var import_react14 = require("react");
3359
3485
  var import_react_dom = require("react-dom");
3360
3486
  var import_styled_components9 = __toESM(require("styled-components"));
3361
- var import_jsx_runtime11 = require("react/jsx-runtime");
3487
+ var import_jsx_runtime12 = require("react/jsx-runtime");
3362
3488
  var DialogStylesElement = import_styled_components9.default.dialog.withConfig({
3363
3489
  shouldForwardProp: (prop) => !["theme", "colorTheme", "opacity"].includes(prop)
3364
3490
  })`
@@ -3399,7 +3525,7 @@ var DialogStylesElement = import_styled_components9.default.dialog.withConfig({
3399
3525
  }
3400
3526
  }
3401
3527
  `;
3402
- var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3528
+ var ModalComponent = (0, import_react14.forwardRef)(function Modal({
3403
3529
  maxWidth,
3404
3530
  title,
3405
3531
  titleColor,
@@ -3417,10 +3543,10 @@ var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3417
3543
  const urlQuery = reactRouterDomPlugin2 ? useUrlQuery() : void 0;
3418
3544
  const theme2 = useTheme();
3419
3545
  const { app, colorTheme } = useBetterHtmlContextInternal();
3420
- const dialogRef = (0, import_react13.useRef)(null);
3421
- const [isOpened, setIsOpened] = (0, import_react13.useState)(false);
3422
- const [isOpenedLate, setIsOpenedLate] = (0, import_react13.useState)(false);
3423
- const onClickOpen = (0, import_react13.useCallback)(() => {
3546
+ const dialogRef = (0, import_react14.useRef)(null);
3547
+ const [isOpened, setIsOpened] = (0, import_react14.useState)(false);
3548
+ const [isOpenedLate, setIsOpenedLate] = (0, import_react14.useState)(false);
3549
+ const onClickOpen = (0, import_react14.useCallback)(() => {
3424
3550
  dialogRef.current?.showModal();
3425
3551
  setIsOpened(true);
3426
3552
  setIsOpenedLate(true);
@@ -3434,7 +3560,7 @@ var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3434
3560
  }
3435
3561
  onOpen?.();
3436
3562
  }, [onOpen, urlQuery, name]);
3437
- const onClickClose = (0, import_react13.useCallback)(() => {
3563
+ const onClickClose = (0, import_react14.useCallback)(() => {
3438
3564
  setIsOpened(false);
3439
3565
  onClose?.();
3440
3566
  if (urlQuery && name) urlQuery.removeQuery(`${name}-modal`, false);
@@ -3443,7 +3569,7 @@ var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3443
3569
  setIsOpenedLate(false);
3444
3570
  }, 0.2 * 1e3);
3445
3571
  }, [onClose, urlQuery, name]);
3446
- const onKeyDown = (0, import_react13.useCallback)(
3572
+ const onKeyDown = (0, import_react14.useCallback)(
3447
3573
  (event) => {
3448
3574
  if (event.key === "Escape") {
3449
3575
  if (!withoutCloseButton) return;
@@ -3452,7 +3578,7 @@ var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3452
3578
  },
3453
3579
  [withoutCloseButton]
3454
3580
  );
3455
- (0, import_react13.useImperativeHandle)(
3581
+ (0, import_react14.useImperativeHandle)(
3456
3582
  ref,
3457
3583
  () => {
3458
3584
  return {
@@ -3464,7 +3590,7 @@ var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3464
3590
  [onClickOpen, onClickClose, isOpened]
3465
3591
  );
3466
3592
  return (0, import_react_dom.createPortal)(
3467
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3593
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3468
3594
  DialogStylesElement,
3469
3595
  {
3470
3596
  theme: theme2,
@@ -3473,7 +3599,7 @@ var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3473
3599
  onClose: onClickClose,
3474
3600
  onKeyDown,
3475
3601
  ref: dialogRef,
3476
- children: isOpenedLate ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3602
+ children: isOpenedLate ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3477
3603
  Div_default.column,
3478
3604
  {
3479
3605
  position: "relative",
@@ -3487,7 +3613,7 @@ var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3487
3613
  transform: `translateY(${theme2.styles.space}px)`,
3488
3614
  transition: theme2.styles.transition,
3489
3615
  animation: isOpened ? "fadeInAnimation 0.2s ease forwards" : "fadeOutAnimation 0.2s ease forwards",
3490
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
3616
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
3491
3617
  Div_default,
3492
3618
  {
3493
3619
  position: "relative",
@@ -3495,12 +3621,11 @@ var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3495
3621
  minHeight: 32 + theme2.styles.space * 2,
3496
3622
  backgroundColor: theme2.colors.backgroundBase,
3497
3623
  borderRadius: theme2.styles.borderRadius * 2,
3498
- paddingInline: !title ? theme2.styles.space + theme2.styles.gap : void 0,
3499
- paddingBlock: !title ? theme2.styles.space : void 0,
3624
+ padding: !title ? theme2.styles.space : void 0,
3500
3625
  overflow,
3501
3626
  children: [
3502
- title ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
3503
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
3627
+ title ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
3628
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
3504
3629
  Div_default.row,
3505
3630
  {
3506
3631
  alignItems: "center",
@@ -3508,12 +3633,12 @@ var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3508
3633
  backgroundColor: headerBackgroundColor,
3509
3634
  borderTopLeftRadius: theme2.styles.borderRadius * 2 - 1,
3510
3635
  borderTopRightRadius: theme2.styles.borderRadius * 2 - 1,
3511
- paddingInline: theme2.styles.space + theme2.styles.gap,
3636
+ paddingInline: theme2.styles.space,
3512
3637
  paddingBlock: theme2.styles.space,
3513
3638
  transition: theme2.styles.transition,
3514
3639
  children: [
3515
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Div_default.column, { flex: 1, gap: theme2.styles.gap / 2, children: [
3516
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3640
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Div_default.column, { flex: 1, gap: theme2.styles.gap / 2, children: [
3641
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3517
3642
  Text_default,
3518
3643
  {
3519
3644
  as: "h1",
@@ -3522,7 +3647,7 @@ var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3522
3647
  children: title
3523
3648
  }
3524
3649
  ),
3525
- description && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3650
+ description && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3526
3651
  Text_default,
3527
3652
  {
3528
3653
  color: descriptionColor ?? theme2.colors.textSecondary,
@@ -3531,7 +3656,7 @@ var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3531
3656
  }
3532
3657
  )
3533
3658
  ] }),
3534
- !withoutCloseButton && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3659
+ !withoutCloseButton && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3535
3660
  Button_default.icon,
3536
3661
  {
3537
3662
  icon: "XMark",
@@ -3544,16 +3669,9 @@ var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3544
3669
  ]
3545
3670
  }
3546
3671
  ),
3547
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Divider_default.horizontal, {})
3548
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_jsx_runtime11.Fragment, { children: !withoutCloseButton && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Div_default, { position: "absolute", top: theme2.styles.space, right: theme2.styles.space, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button_default.icon, { icon: "XMark", onClick: onClickClose }) }) }),
3549
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3550
- Div_default,
3551
- {
3552
- paddingInline: title ? theme2.styles.space + theme2.styles.gap : void 0,
3553
- paddingBlock: title ? theme2.styles.space : void 0,
3554
- children
3555
- }
3556
- )
3672
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Divider_default.horizontal, {})
3673
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_jsx_runtime12.Fragment, { children: !withoutCloseButton && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Div_default, { position: "absolute", top: theme2.styles.space, right: theme2.styles.space, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Button_default.icon, { icon: "XMark", onClick: onClickClose }) }) }),
3674
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Div_default, { padding: title ? theme2.styles.space : void 0, children })
3557
3675
  ]
3558
3676
  }
3559
3677
  )
@@ -3564,21 +3682,21 @@ var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3564
3682
  document.body
3565
3683
  );
3566
3684
  });
3567
- ModalComponent.confirmation = (0, import_react13.forwardRef)(function Confirmation({ message, continueButtonLoaderName, onContinue, onCancel, ...props }, ref) {
3685
+ ModalComponent.confirmation = (0, import_react14.forwardRef)(function Confirmation({ message, continueButtonLoaderName, onContinue, onCancel, ...props }, ref) {
3568
3686
  const theme2 = useTheme();
3569
- const modalRef = (0, import_react13.useRef)(null);
3570
- const onCancelElement = (0, import_react13.useCallback)(() => {
3687
+ const modalRef = (0, import_react14.useRef)(null);
3688
+ const onCancelElement = (0, import_react14.useCallback)(() => {
3571
3689
  onCancel?.();
3572
3690
  modalRef.current?.close();
3573
3691
  }, [onCancel]);
3574
- const onContinueElement = (0, import_react13.useCallback)(() => {
3692
+ const onContinueElement = (0, import_react14.useCallback)(() => {
3575
3693
  onContinue?.();
3576
3694
  modalRef.current?.close();
3577
3695
  }, [onContinue]);
3578
- (0, import_react13.useImperativeHandle)(ref, () => modalRef.current, []);
3579
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(ModalComponent, { title: "Are you sure?", maxWidth: 660, ...props, ref: modalRef, children: [
3580
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text_default, { color: theme2.colors.textSecondary, children: message ?? "Do you really want to continue? This action may be irreversible." }),
3581
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
3696
+ (0, import_react14.useImperativeHandle)(ref, () => modalRef.current, []);
3697
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(ModalComponent, { title: "Are you sure?", maxWidth: 660, ...props, ref: modalRef, children: [
3698
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text_default, { color: theme2.colors.textSecondary, children: message ?? "Do you really want to continue? This action may be irreversible." }),
3699
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
3582
3700
  Div_default.row,
3583
3701
  {
3584
3702
  alignItems: "center",
@@ -3586,28 +3704,28 @@ ModalComponent.confirmation = (0, import_react13.forwardRef)(function Confirmati
3586
3704
  gap: theme2.styles.gap,
3587
3705
  marginTop: theme2.styles.space * 2,
3588
3706
  children: [
3589
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button_default.secondary, { text: "Cancel", onClick: onCancelElement }),
3590
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button_default, { text: "Continue", loaderName: continueButtonLoaderName, onClick: onContinueElement })
3707
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Button_default.secondary, { text: "Cancel", onClick: onCancelElement }),
3708
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Button_default, { text: "Continue", loaderName: continueButtonLoaderName, onClick: onContinueElement })
3591
3709
  ]
3592
3710
  }
3593
3711
  )
3594
3712
  ] });
3595
3713
  });
3596
- ModalComponent.destructive = (0, import_react13.forwardRef)(function Destructive2({ message, deleteButtonLoaderName, onDelete, onCancel, ...props }, ref) {
3714
+ ModalComponent.destructive = (0, import_react14.forwardRef)(function Destructive2({ message, deleteButtonLoaderName, onDelete, onCancel, ...props }, ref) {
3597
3715
  const theme2 = useTheme();
3598
- const modalRef = (0, import_react13.useRef)(null);
3599
- const onCancelElement = (0, import_react13.useCallback)(() => {
3716
+ const modalRef = (0, import_react14.useRef)(null);
3717
+ const onCancelElement = (0, import_react14.useCallback)(() => {
3600
3718
  onCancel?.();
3601
3719
  modalRef.current?.close();
3602
3720
  }, [onCancel]);
3603
- const onDeleteElement = (0, import_react13.useCallback)(() => {
3721
+ const onDeleteElement = (0, import_react14.useCallback)(() => {
3604
3722
  onDelete?.();
3605
3723
  modalRef.current?.close();
3606
3724
  }, [onDelete]);
3607
- (0, import_react13.useImperativeHandle)(ref, () => modalRef.current, []);
3608
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(ModalComponent, { title: "Are you sure?", maxWidth: 660, ...props, ref: modalRef, children: [
3609
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text_default, { color: theme2.colors.textSecondary, children: message ?? "Do you really want to continue with the deleting of the item? This action may be irreversible." }),
3610
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
3725
+ (0, import_react14.useImperativeHandle)(ref, () => modalRef.current, []);
3726
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(ModalComponent, { title: "Are you sure?", maxWidth: 660, ...props, ref: modalRef, children: [
3727
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Text_default, { color: theme2.colors.textSecondary, children: message ?? "Do you really want to continue with the deleting of the item? This action may be irreversible." }),
3728
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
3611
3729
  Div_default.row,
3612
3730
  {
3613
3731
  alignItems: "center",
@@ -3615,8 +3733,8 @@ ModalComponent.destructive = (0, import_react13.forwardRef)(function Destructive
3615
3733
  gap: theme2.styles.gap,
3616
3734
  marginTop: theme2.styles.space * 2,
3617
3735
  children: [
3618
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button_default.secondary, { text: "Cancel", onClick: onCancelElement }),
3619
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3736
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Button_default.secondary, { text: "Cancel", onClick: onCancelElement }),
3737
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3620
3738
  Button_default.destructive,
3621
3739
  {
3622
3740
  icon: "trash",
@@ -3630,18 +3748,18 @@ ModalComponent.destructive = (0, import_react13.forwardRef)(function Destructive
3630
3748
  )
3631
3749
  ] });
3632
3750
  });
3633
- var Modal2 = (0, import_react13.memo)(ModalComponent);
3751
+ var Modal2 = (0, import_react14.memo)(ModalComponent);
3634
3752
  Modal2.confirmation = ModalComponent.confirmation;
3635
3753
  Modal2.destructive = ModalComponent.destructive;
3636
3754
  var Modal_default = Modal2;
3637
3755
 
3638
3756
  // src/components/PageHolder.tsx
3639
- var import_react14 = require("react");
3640
- var import_jsx_runtime12 = require("react/jsx-runtime");
3641
- var PageHolderComponent = (0, import_react14.forwardRef)(function PageHolder({ noMaxContentWidth, children, ...props }, ref) {
3757
+ var import_react15 = require("react");
3758
+ var import_jsx_runtime13 = require("react/jsx-runtime");
3759
+ var PageHolderComponent = (0, import_react15.forwardRef)(function PageHolder({ noMaxContentWidth, children, ...props }, ref) {
3642
3760
  const theme2 = useTheme();
3643
3761
  const { app } = useBetterHtmlContextInternal();
3644
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3762
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3645
3763
  Div_default,
3646
3764
  {
3647
3765
  as: "main",
@@ -3655,7 +3773,7 @@ var PageHolderComponent = (0, import_react14.forwardRef)(function PageHolder({ n
3655
3773
  }
3656
3774
  );
3657
3775
  });
3658
- PageHolderComponent.center = (0, import_react14.forwardRef)(function Center({
3776
+ PageHolderComponent.center = (0, import_react15.forwardRef)(function Center({
3659
3777
  pageBackgroundColor,
3660
3778
  pageBackgroundImage,
3661
3779
  contentMaxWidth,
@@ -3671,7 +3789,7 @@ PageHolderComponent.center = (0, import_react14.forwardRef)(function Center({
3671
3789
  const { app } = useBetterHtmlContextInternal();
3672
3790
  const breakingPoint = mediaQuery.size1000;
3673
3791
  const withSideComponent = sideComponent && !breakingPoint;
3674
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
3792
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
3675
3793
  Div_default.row,
3676
3794
  {
3677
3795
  position: "relative",
@@ -3682,7 +3800,7 @@ PageHolderComponent.center = (0, import_react14.forwardRef)(function Center({
3682
3800
  backgroundColor: pageBackgroundColor,
3683
3801
  backgroundImage: pageBackgroundImage,
3684
3802
  children: [
3685
- behindComponent && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3803
+ behindComponent && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3686
3804
  Div_default,
3687
3805
  {
3688
3806
  position: "fixed",
@@ -3695,8 +3813,8 @@ PageHolderComponent.center = (0, import_react14.forwardRef)(function Center({
3695
3813
  children: behindComponent
3696
3814
  }
3697
3815
  ),
3698
- sideComponentPosition === "left" && withSideComponent && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Div_default, { width: "50%" }),
3699
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Div_default.column, { position: "relative", width: `${withSideComponent ? 50 : 100}%`, alignItems: "center", zIndex: 2, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3816
+ sideComponentPosition === "left" && withSideComponent && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Div_default, { width: "50%" }),
3817
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Div_default.column, { position: "relative", width: `${withSideComponent ? 50 : 100}%`, alignItems: "center", zIndex: 2, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3700
3818
  Div_default.box,
3701
3819
  {
3702
3820
  width: `calc(100% - ${theme2.styles.space * 2}px)`,
@@ -3708,8 +3826,8 @@ PageHolderComponent.center = (0, import_react14.forwardRef)(function Center({
3708
3826
  children
3709
3827
  }
3710
3828
  ) }),
3711
- sideComponentPosition === "right" && withSideComponent && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Div_default, { width: "50%" }),
3712
- withSideComponent && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3829
+ sideComponentPosition === "right" && withSideComponent && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Div_default, { width: "50%" }),
3830
+ withSideComponent && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3713
3831
  Div_default,
3714
3832
  {
3715
3833
  position: "fixed",
@@ -3725,85 +3843,10 @@ PageHolderComponent.center = (0, import_react14.forwardRef)(function Center({
3725
3843
  }
3726
3844
  );
3727
3845
  });
3728
- var PageHolder2 = (0, import_react14.memo)(PageHolderComponent);
3846
+ var PageHolder2 = (0, import_react15.memo)(PageHolderComponent);
3729
3847
  PageHolder2.center = PageHolderComponent.center;
3730
3848
  var PageHolder_default = PageHolder2;
3731
3849
 
3732
- // src/components/PageHeader.tsx
3733
- var import_react15 = require("react");
3734
- var import_jsx_runtime13 = require("react/jsx-runtime");
3735
- var PageHeaderComponent = (0, import_react15.forwardRef)(function PageHeader({
3736
- imageUrl,
3737
- imageSize = 60,
3738
- title,
3739
- titleAs,
3740
- titleRightElement,
3741
- description,
3742
- textAlign,
3743
- rightElement,
3744
- lightMode,
3745
- marginBottom
3746
- }, ref) {
3747
- const theme2 = useTheme();
3748
- const { app } = useBetterHtmlContextInternal();
3749
- const mediaQuery = useMediaQuery();
3750
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
3751
- Div_default.row,
3752
- {
3753
- alignItems: "center",
3754
- gap: theme2.styles.space,
3755
- marginBottom: marginBottom ?? theme2.styles.space * 2,
3756
- ref,
3757
- children: [
3758
- imageUrl && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Image_default.profileImage, { src: imageUrl, size: imageSize ?? (mediaQuery.size600 ? 46 : 60) }),
3759
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
3760
- Div_default.column,
3761
- {
3762
- alignItems: textAlign === "center" ? "center" : textAlign === "right" ? "flex-end" : void 0,
3763
- flex: 1,
3764
- gap: theme2.styles.gap / 2,
3765
- children: [
3766
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
3767
- Div_default.row,
3768
- {
3769
- alignItems: "center",
3770
- justifyContent: textAlign === "center" ? "center" : textAlign === "right" ? "flex-end" : void 0,
3771
- gap: theme2.styles.space,
3772
- children: [
3773
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3774
- Text_default,
3775
- {
3776
- as: titleAs ?? "h1",
3777
- textAlign,
3778
- color: lightMode ? theme2.colors.base : theme2.colors.textPrimary,
3779
- children: title
3780
- }
3781
- ),
3782
- titleRightElement
3783
- ]
3784
- }
3785
- ),
3786
- description && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3787
- Text_default,
3788
- {
3789
- maxWidth: !mediaQuery.size600 ? app.contentMaxWidth * 0.6 : void 0,
3790
- textAlign,
3791
- color: lightMode ? theme2.colors.base : theme2.colors.textSecondary,
3792
- opacity: lightMode ? 0.7 : void 0,
3793
- children: description
3794
- }
3795
- )
3796
- ]
3797
- }
3798
- ),
3799
- rightElement
3800
- ]
3801
- }
3802
- );
3803
- });
3804
- var PageHeader2 = (0, import_react15.memo)(PageHeaderComponent);
3805
- var PageHeader_default = PageHeader2;
3806
-
3807
3850
  // src/components/Chip.tsx
3808
3851
  var import_react16 = require("react");
3809
3852