react-better-html 1.1.163 → 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
@@ -3201,8 +3201,117 @@ function useUrlQuery() {
3201
3201
  };
3202
3202
  }
3203
3203
 
3204
- // src/components/Div.tsx
3204
+ // src/components/Divider.tsx
3205
+ var import_react11 = require("react");
3205
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");
3206
3315
  var DivStyledComponent = import_styled_components8.default.div.withConfig({
3207
3316
  shouldForwardProp: (prop) => !["normalStyle", "hoverStyle"].includes(prop)
3208
3317
  })`
@@ -3212,7 +3321,7 @@ var DivStyledComponent = import_styled_components8.default.div.withConfig({
3212
3321
  ${(props) => props.hoverStyle}
3213
3322
  }
3214
3323
  `;
3215
- var DivComponent = (0, import_react11.forwardRef)(function Div({
3324
+ var DivComponent = (0, import_react13.forwardRef)(function Div({
3216
3325
  as = "div",
3217
3326
  value,
3218
3327
  isTabAccessed,
@@ -3229,14 +3338,14 @@ var DivComponent = (0, import_react11.forwardRef)(function Div({
3229
3338
  const dataProps = useComponentPropsWithPrefix(props, "data");
3230
3339
  const ariaProps = useComponentPropsWithPrefix(props, "aria");
3231
3340
  const restProps = useComponentPropsWithoutStyle(props);
3232
- const onClickElement = (0, import_react11.useCallback)(
3341
+ const onClickElement = (0, import_react13.useCallback)(
3233
3342
  (event) => {
3234
3343
  onClick?.(event);
3235
3344
  onClickWithValue?.(value);
3236
3345
  },
3237
3346
  [onClick, onClickWithValue, value]
3238
3347
  );
3239
- const onKeyDownElement = (0, import_react11.useCallback)(
3348
+ const onKeyDownElement = (0, import_react13.useCallback)(
3240
3349
  (event) => {
3241
3350
  onKeyDown?.(event);
3242
3351
  if (!isTabAccessed) return;
@@ -3247,7 +3356,7 @@ var DivComponent = (0, import_react11.forwardRef)(function Div({
3247
3356
  },
3248
3357
  [onKeyDown, isTabAccessed]
3249
3358
  );
3250
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3359
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3251
3360
  DivStyledComponent,
3252
3361
  {
3253
3362
  as,
@@ -3265,9 +3374,9 @@ var DivComponent = (0, import_react11.forwardRef)(function Div({
3265
3374
  }
3266
3375
  );
3267
3376
  });
3268
- 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) {
3269
3378
  const reverseSuffix = flexReverse ? "-reverse" : "";
3270
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3379
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3271
3380
  DivComponent,
3272
3381
  {
3273
3382
  display: "flex",
@@ -3277,9 +3386,9 @@ DivComponent.row = (0, import_react11.forwardRef)(function Row({ flexReverse, in
3277
3386
  }
3278
3387
  );
3279
3388
  });
3280
- 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) {
3281
3390
  const reverseSuffix = flexReverse ? "-reverse" : "";
3282
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3391
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3283
3392
  DivComponent,
3284
3393
  {
3285
3394
  display: "flex",
@@ -3289,13 +3398,29 @@ DivComponent.column = (0, import_react11.forwardRef)(function Column({ flexRever
3289
3398
  }
3290
3399
  );
3291
3400
  });
3292
- DivComponent.grid = (0, import_react11.forwardRef)(function Grid(props, ref) {
3293
- 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 });
3294
3403
  });
3295
- 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) {
3296
3421
  const theme2 = useTheme();
3297
3422
  const withClick = props.onClick || props.onClickWithValue;
3298
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3423
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
3299
3424
  DivComponent,
3300
3425
  {
3301
3426
  color: isActive ? theme2.colors.base : void 0,
@@ -3305,57 +3430,61 @@ DivComponent.box = (0, import_react11.forwardRef)(function Box2({ isActive, ...p
3305
3430
  borderColorHover: withClick && !isActive ? theme2.colors.primary : void 0,
3306
3431
  filterHover: withClick && isActive ? "brightness(0.9)" : void 0,
3307
3432
  cursor: withClick ? "pointer" : void 0,
3308
- paddingBlock: theme2.styles.gap,
3433
+ paddingBlock: title ? theme2.styles.space : theme2.styles.gap,
3309
3434
  paddingInline: theme2.styles.space,
3310
3435
  ref,
3311
- ...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
+ ]
3312
3473
  }
3313
3474
  );
3314
3475
  });
3315
- var Div2 = (0, import_react11.memo)(DivComponent);
3476
+ var Div2 = (0, import_react13.memo)(DivComponent);
3316
3477
  Div2.row = DivComponent.row;
3317
3478
  Div2.column = DivComponent.column;
3318
3479
  Div2.grid = DivComponent.grid;
3319
3480
  Div2.box = DivComponent.box;
3320
3481
  var Div_default = Div2;
3321
3482
 
3322
- // src/components/Divider.tsx
3323
- var import_react12 = require("react");
3324
- var import_jsx_runtime10 = require("react/jsx-runtime");
3325
- var Divider_default = {
3326
- vertical: (0, import_react12.memo)(
3327
- (0, import_react12.forwardRef)(function Divider({ width = 1, backgroundColor, height, ...props }, ref) {
3328
- const theme2 = useTheme();
3329
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3330
- Div_default,
3331
- {
3332
- width,
3333
- height: height ?? "100%",
3334
- flexShrink: 0,
3335
- backgroundColor: backgroundColor ?? theme2.colors.border,
3336
- ...props,
3337
- ref
3338
- }
3339
- );
3340
- })
3341
- ),
3342
- horizontal: (0, import_react12.memo)(
3343
- (0, import_react12.forwardRef)(function Divider2({ width = 1, backgroundColor, text, textFontSize, textColor, ...props }, ref) {
3344
- const theme2 = useTheme();
3345
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Div_default.row, { width: "100%", alignItems: "center", gap: text ? theme2.styles.space : void 0, ...props, ref, children: [
3346
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Div_default, { flex: 1, height: width, flexShrink: 0, backgroundColor: backgroundColor ?? theme2.colors.border }),
3347
- text && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text_default, { fontSize: textFontSize, color: textColor ?? theme2.colors.textSecondary, children: text }),
3348
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Div_default, { flex: 1, height: width, flexShrink: 0, backgroundColor: backgroundColor ?? theme2.colors.border })
3349
- ] });
3350
- })
3351
- )
3352
- };
3353
-
3354
3483
  // src/components/Modal.tsx
3355
- var import_react13 = require("react");
3484
+ var import_react14 = require("react");
3356
3485
  var import_react_dom = require("react-dom");
3357
3486
  var import_styled_components9 = __toESM(require("styled-components"));
3358
- var import_jsx_runtime11 = require("react/jsx-runtime");
3487
+ var import_jsx_runtime12 = require("react/jsx-runtime");
3359
3488
  var DialogStylesElement = import_styled_components9.default.dialog.withConfig({
3360
3489
  shouldForwardProp: (prop) => !["theme", "colorTheme", "opacity"].includes(prop)
3361
3490
  })`
@@ -3396,7 +3525,7 @@ var DialogStylesElement = import_styled_components9.default.dialog.withConfig({
3396
3525
  }
3397
3526
  }
3398
3527
  `;
3399
- var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3528
+ var ModalComponent = (0, import_react14.forwardRef)(function Modal({
3400
3529
  maxWidth,
3401
3530
  title,
3402
3531
  titleColor,
@@ -3414,10 +3543,10 @@ var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3414
3543
  const urlQuery = reactRouterDomPlugin2 ? useUrlQuery() : void 0;
3415
3544
  const theme2 = useTheme();
3416
3545
  const { app, colorTheme } = useBetterHtmlContextInternal();
3417
- const dialogRef = (0, import_react13.useRef)(null);
3418
- const [isOpened, setIsOpened] = (0, import_react13.useState)(false);
3419
- const [isOpenedLate, setIsOpenedLate] = (0, import_react13.useState)(false);
3420
- 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)(() => {
3421
3550
  dialogRef.current?.showModal();
3422
3551
  setIsOpened(true);
3423
3552
  setIsOpenedLate(true);
@@ -3431,7 +3560,7 @@ var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3431
3560
  }
3432
3561
  onOpen?.();
3433
3562
  }, [onOpen, urlQuery, name]);
3434
- const onClickClose = (0, import_react13.useCallback)(() => {
3563
+ const onClickClose = (0, import_react14.useCallback)(() => {
3435
3564
  setIsOpened(false);
3436
3565
  onClose?.();
3437
3566
  if (urlQuery && name) urlQuery.removeQuery(`${name}-modal`, false);
@@ -3440,7 +3569,7 @@ var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3440
3569
  setIsOpenedLate(false);
3441
3570
  }, 0.2 * 1e3);
3442
3571
  }, [onClose, urlQuery, name]);
3443
- const onKeyDown = (0, import_react13.useCallback)(
3572
+ const onKeyDown = (0, import_react14.useCallback)(
3444
3573
  (event) => {
3445
3574
  if (event.key === "Escape") {
3446
3575
  if (!withoutCloseButton) return;
@@ -3449,7 +3578,7 @@ var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3449
3578
  },
3450
3579
  [withoutCloseButton]
3451
3580
  );
3452
- (0, import_react13.useImperativeHandle)(
3581
+ (0, import_react14.useImperativeHandle)(
3453
3582
  ref,
3454
3583
  () => {
3455
3584
  return {
@@ -3461,7 +3590,7 @@ var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3461
3590
  [onClickOpen, onClickClose, isOpened]
3462
3591
  );
3463
3592
  return (0, import_react_dom.createPortal)(
3464
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3593
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3465
3594
  DialogStylesElement,
3466
3595
  {
3467
3596
  theme: theme2,
@@ -3470,7 +3599,7 @@ var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3470
3599
  onClose: onClickClose,
3471
3600
  onKeyDown,
3472
3601
  ref: dialogRef,
3473
- children: isOpenedLate ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3602
+ children: isOpenedLate ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3474
3603
  Div_default.column,
3475
3604
  {
3476
3605
  position: "relative",
@@ -3484,7 +3613,7 @@ var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3484
3613
  transform: `translateY(${theme2.styles.space}px)`,
3485
3614
  transition: theme2.styles.transition,
3486
3615
  animation: isOpened ? "fadeInAnimation 0.2s ease forwards" : "fadeOutAnimation 0.2s ease forwards",
3487
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
3616
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
3488
3617
  Div_default,
3489
3618
  {
3490
3619
  position: "relative",
@@ -3492,12 +3621,11 @@ var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3492
3621
  minHeight: 32 + theme2.styles.space * 2,
3493
3622
  backgroundColor: theme2.colors.backgroundBase,
3494
3623
  borderRadius: theme2.styles.borderRadius * 2,
3495
- paddingInline: !title ? theme2.styles.space + theme2.styles.gap : void 0,
3496
- paddingBlock: !title ? theme2.styles.space : void 0,
3624
+ padding: !title ? theme2.styles.space : void 0,
3497
3625
  overflow,
3498
3626
  children: [
3499
- title ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
3500
- /* @__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)(
3501
3629
  Div_default.row,
3502
3630
  {
3503
3631
  alignItems: "center",
@@ -3505,12 +3633,12 @@ var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3505
3633
  backgroundColor: headerBackgroundColor,
3506
3634
  borderTopLeftRadius: theme2.styles.borderRadius * 2 - 1,
3507
3635
  borderTopRightRadius: theme2.styles.borderRadius * 2 - 1,
3508
- paddingInline: theme2.styles.space + theme2.styles.gap,
3636
+ paddingInline: theme2.styles.space,
3509
3637
  paddingBlock: theme2.styles.space,
3510
3638
  transition: theme2.styles.transition,
3511
3639
  children: [
3512
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Div_default.column, { flex: 1, gap: theme2.styles.gap / 2, children: [
3513
- /* @__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)(
3514
3642
  Text_default,
3515
3643
  {
3516
3644
  as: "h1",
@@ -3519,7 +3647,7 @@ var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3519
3647
  children: title
3520
3648
  }
3521
3649
  ),
3522
- description && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3650
+ description && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3523
3651
  Text_default,
3524
3652
  {
3525
3653
  color: descriptionColor ?? theme2.colors.textSecondary,
@@ -3528,7 +3656,7 @@ var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3528
3656
  }
3529
3657
  )
3530
3658
  ] }),
3531
- !withoutCloseButton && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3659
+ !withoutCloseButton && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3532
3660
  Button_default.icon,
3533
3661
  {
3534
3662
  icon: "XMark",
@@ -3541,16 +3669,9 @@ var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3541
3669
  ]
3542
3670
  }
3543
3671
  ),
3544
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Divider_default.horizontal, {})
3545
- ] }) : /* @__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 }) }) }),
3546
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3547
- Div_default,
3548
- {
3549
- paddingInline: title ? theme2.styles.space + theme2.styles.gap : void 0,
3550
- paddingBlock: title ? theme2.styles.space : void 0,
3551
- children
3552
- }
3553
- )
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 })
3554
3675
  ]
3555
3676
  }
3556
3677
  )
@@ -3561,21 +3682,21 @@ var ModalComponent = (0, import_react13.forwardRef)(function Modal({
3561
3682
  document.body
3562
3683
  );
3563
3684
  });
3564
- 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) {
3565
3686
  const theme2 = useTheme();
3566
- const modalRef = (0, import_react13.useRef)(null);
3567
- const onCancelElement = (0, import_react13.useCallback)(() => {
3687
+ const modalRef = (0, import_react14.useRef)(null);
3688
+ const onCancelElement = (0, import_react14.useCallback)(() => {
3568
3689
  onCancel?.();
3569
3690
  modalRef.current?.close();
3570
3691
  }, [onCancel]);
3571
- const onContinueElement = (0, import_react13.useCallback)(() => {
3692
+ const onContinueElement = (0, import_react14.useCallback)(() => {
3572
3693
  onContinue?.();
3573
3694
  modalRef.current?.close();
3574
3695
  }, [onContinue]);
3575
- (0, import_react13.useImperativeHandle)(ref, () => modalRef.current, []);
3576
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(ModalComponent, { title: "Are you sure?", maxWidth: 660, ...props, ref: modalRef, children: [
3577
- /* @__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." }),
3578
- /* @__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)(
3579
3700
  Div_default.row,
3580
3701
  {
3581
3702
  alignItems: "center",
@@ -3583,28 +3704,28 @@ ModalComponent.confirmation = (0, import_react13.forwardRef)(function Confirmati
3583
3704
  gap: theme2.styles.gap,
3584
3705
  marginTop: theme2.styles.space * 2,
3585
3706
  children: [
3586
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button_default.secondary, { text: "Cancel", onClick: onCancelElement }),
3587
- /* @__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 })
3588
3709
  ]
3589
3710
  }
3590
3711
  )
3591
3712
  ] });
3592
3713
  });
3593
- 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) {
3594
3715
  const theme2 = useTheme();
3595
- const modalRef = (0, import_react13.useRef)(null);
3596
- const onCancelElement = (0, import_react13.useCallback)(() => {
3716
+ const modalRef = (0, import_react14.useRef)(null);
3717
+ const onCancelElement = (0, import_react14.useCallback)(() => {
3597
3718
  onCancel?.();
3598
3719
  modalRef.current?.close();
3599
3720
  }, [onCancel]);
3600
- const onDeleteElement = (0, import_react13.useCallback)(() => {
3721
+ const onDeleteElement = (0, import_react14.useCallback)(() => {
3601
3722
  onDelete?.();
3602
3723
  modalRef.current?.close();
3603
3724
  }, [onDelete]);
3604
- (0, import_react13.useImperativeHandle)(ref, () => modalRef.current, []);
3605
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(ModalComponent, { title: "Are you sure?", maxWidth: 660, ...props, ref: modalRef, children: [
3606
- /* @__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." }),
3607
- /* @__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)(
3608
3729
  Div_default.row,
3609
3730
  {
3610
3731
  alignItems: "center",
@@ -3612,8 +3733,8 @@ ModalComponent.destructive = (0, import_react13.forwardRef)(function Destructive
3612
3733
  gap: theme2.styles.gap,
3613
3734
  marginTop: theme2.styles.space * 2,
3614
3735
  children: [
3615
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button_default.secondary, { text: "Cancel", onClick: onCancelElement }),
3616
- /* @__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)(
3617
3738
  Button_default.destructive,
3618
3739
  {
3619
3740
  icon: "trash",
@@ -3627,18 +3748,18 @@ ModalComponent.destructive = (0, import_react13.forwardRef)(function Destructive
3627
3748
  )
3628
3749
  ] });
3629
3750
  });
3630
- var Modal2 = (0, import_react13.memo)(ModalComponent);
3751
+ var Modal2 = (0, import_react14.memo)(ModalComponent);
3631
3752
  Modal2.confirmation = ModalComponent.confirmation;
3632
3753
  Modal2.destructive = ModalComponent.destructive;
3633
3754
  var Modal_default = Modal2;
3634
3755
 
3635
3756
  // src/components/PageHolder.tsx
3636
- var import_react14 = require("react");
3637
- var import_jsx_runtime12 = require("react/jsx-runtime");
3638
- 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) {
3639
3760
  const theme2 = useTheme();
3640
3761
  const { app } = useBetterHtmlContextInternal();
3641
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3762
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3642
3763
  Div_default,
3643
3764
  {
3644
3765
  as: "main",
@@ -3652,7 +3773,7 @@ var PageHolderComponent = (0, import_react14.forwardRef)(function PageHolder({ n
3652
3773
  }
3653
3774
  );
3654
3775
  });
3655
- PageHolderComponent.center = (0, import_react14.forwardRef)(function Center({
3776
+ PageHolderComponent.center = (0, import_react15.forwardRef)(function Center({
3656
3777
  pageBackgroundColor,
3657
3778
  pageBackgroundImage,
3658
3779
  contentMaxWidth,
@@ -3668,7 +3789,7 @@ PageHolderComponent.center = (0, import_react14.forwardRef)(function Center({
3668
3789
  const { app } = useBetterHtmlContextInternal();
3669
3790
  const breakingPoint = mediaQuery.size1000;
3670
3791
  const withSideComponent = sideComponent && !breakingPoint;
3671
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
3792
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
3672
3793
  Div_default.row,
3673
3794
  {
3674
3795
  position: "relative",
@@ -3679,7 +3800,7 @@ PageHolderComponent.center = (0, import_react14.forwardRef)(function Center({
3679
3800
  backgroundColor: pageBackgroundColor,
3680
3801
  backgroundImage: pageBackgroundImage,
3681
3802
  children: [
3682
- behindComponent && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3803
+ behindComponent && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3683
3804
  Div_default,
3684
3805
  {
3685
3806
  position: "fixed",
@@ -3692,8 +3813,8 @@ PageHolderComponent.center = (0, import_react14.forwardRef)(function Center({
3692
3813
  children: behindComponent
3693
3814
  }
3694
3815
  ),
3695
- sideComponentPosition === "left" && withSideComponent && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Div_default, { width: "50%" }),
3696
- /* @__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)(
3697
3818
  Div_default.box,
3698
3819
  {
3699
3820
  width: `calc(100% - ${theme2.styles.space * 2}px)`,
@@ -3705,8 +3826,8 @@ PageHolderComponent.center = (0, import_react14.forwardRef)(function Center({
3705
3826
  children
3706
3827
  }
3707
3828
  ) }),
3708
- sideComponentPosition === "right" && withSideComponent && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Div_default, { width: "50%" }),
3709
- 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)(
3710
3831
  Div_default,
3711
3832
  {
3712
3833
  position: "fixed",
@@ -3722,85 +3843,10 @@ PageHolderComponent.center = (0, import_react14.forwardRef)(function Center({
3722
3843
  }
3723
3844
  );
3724
3845
  });
3725
- var PageHolder2 = (0, import_react14.memo)(PageHolderComponent);
3846
+ var PageHolder2 = (0, import_react15.memo)(PageHolderComponent);
3726
3847
  PageHolder2.center = PageHolderComponent.center;
3727
3848
  var PageHolder_default = PageHolder2;
3728
3849
 
3729
- // src/components/PageHeader.tsx
3730
- var import_react15 = require("react");
3731
- var import_jsx_runtime13 = require("react/jsx-runtime");
3732
- var PageHeaderComponent = (0, import_react15.forwardRef)(function PageHeader({
3733
- imageUrl,
3734
- imageSize = 60,
3735
- title,
3736
- titleAs,
3737
- titleRightElement,
3738
- description,
3739
- textAlign,
3740
- rightElement,
3741
- lightMode,
3742
- marginBottom
3743
- }, ref) {
3744
- const theme2 = useTheme();
3745
- const { app } = useBetterHtmlContextInternal();
3746
- const mediaQuery = useMediaQuery();
3747
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
3748
- Div_default.row,
3749
- {
3750
- alignItems: "center",
3751
- gap: theme2.styles.space,
3752
- marginBottom: marginBottom ?? theme2.styles.space * 2,
3753
- ref,
3754
- children: [
3755
- imageUrl && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Image_default.profileImage, { src: imageUrl, size: imageSize ?? (mediaQuery.size600 ? 46 : 60) }),
3756
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
3757
- Div_default.column,
3758
- {
3759
- alignItems: textAlign === "center" ? "center" : textAlign === "right" ? "flex-end" : void 0,
3760
- flex: 1,
3761
- gap: theme2.styles.gap / 2,
3762
- children: [
3763
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
3764
- Div_default.row,
3765
- {
3766
- alignItems: "center",
3767
- justifyContent: textAlign === "center" ? "center" : textAlign === "right" ? "flex-end" : void 0,
3768
- gap: theme2.styles.space,
3769
- children: [
3770
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3771
- Text_default,
3772
- {
3773
- as: titleAs ?? "h1",
3774
- textAlign,
3775
- color: lightMode ? theme2.colors.base : theme2.colors.textPrimary,
3776
- children: title
3777
- }
3778
- ),
3779
- titleRightElement
3780
- ]
3781
- }
3782
- ),
3783
- description && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3784
- Text_default,
3785
- {
3786
- maxWidth: !mediaQuery.size600 ? app.contentMaxWidth * 0.6 : void 0,
3787
- textAlign,
3788
- color: lightMode ? theme2.colors.base : theme2.colors.textSecondary,
3789
- opacity: lightMode ? 0.7 : void 0,
3790
- children: description
3791
- }
3792
- )
3793
- ]
3794
- }
3795
- ),
3796
- rightElement
3797
- ]
3798
- }
3799
- );
3800
- });
3801
- var PageHeader2 = (0, import_react15.memo)(PageHeaderComponent);
3802
- var PageHeader_default = PageHeader2;
3803
-
3804
3850
  // src/components/Chip.tsx
3805
3851
  var import_react16 = require("react");
3806
3852