@splpi/estore-shared-components 0.0.2 → 0.0.4

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.mjs CHANGED
@@ -227,8 +227,7 @@ var STANDARD_ICON_BUTTON_STYLES = {
227
227
  }
228
228
  };
229
229
 
230
- // src/NewSaleForm/ui/floating-label-input.tsx
231
- import { useState } from "react";
230
+ // src/NewSaleForm/ui/FloatingLabelInput.tsx
232
231
  import {
233
232
  Box,
234
233
  Field,
@@ -236,6 +235,7 @@ import {
236
235
  defineStyle,
237
236
  useControllableState
238
237
  } from "@chakra-ui/react";
238
+ import { useState } from "react";
239
239
  import { jsx, jsxs } from "react/jsx-runtime";
240
240
  var FloatingLabelInput = (props) => {
241
241
  const { label, onValueChange, value, defaultValue = "", ...rest } = props;
@@ -251,6 +251,14 @@ var FloatingLabelInput = (props) => {
251
251
  Input,
252
252
  {
253
253
  ...rest,
254
+ h: "12",
255
+ pt: shouldFloat ? "5" : "2",
256
+ pb: "1",
257
+ fontSize: "sm",
258
+ fontWeight: "semibold",
259
+ borderWidth: "1.5px",
260
+ borderRadius: "lg",
261
+ _placeholder: { color: "transparent" },
254
262
  onFocus: (e) => {
255
263
  props.onFocus?.(e);
256
264
  setFocused(true);
@@ -271,22 +279,28 @@ var FloatingLabelInput = (props) => {
271
279
  ] });
272
280
  };
273
281
  var floatingStyles = defineStyle({
282
+ /* placeholder state — vertically centred inside the input */
274
283
  pos: "absolute",
275
- bg: "bg",
276
- px: "0.5",
277
- top: "2.5",
284
+ top: "50%",
285
+ transform: "translateY(-50%)",
278
286
  insetStart: "3",
287
+ fontSize: "sm",
279
288
  fontWeight: "normal",
289
+ color: "gray.400",
290
+ bg: "bg",
291
+ px: "0.5",
280
292
  pointerEvents: "none",
281
- transition: "position",
282
- color: "fg.muted",
293
+ transition: "top 0.15s ease, font-size 0.15s ease, color 0.15s ease, transform 0.15s ease",
294
+ /* floated state — sits above the border, clearly a label */
283
295
  "&[data-float]": {
284
- top: "-3",
285
- insetStart: "2",
286
- color: "fg"
296
+ top: "-2",
297
+ transform: "translateY(0)",
298
+ fontSize: "xs",
299
+ fontWeight: "medium",
300
+ color: "gray.400",
301
+ insetStart: "2.5"
287
302
  }
288
303
  });
289
- var floating_label_input_default = FloatingLabelInput;
290
304
 
291
305
  // src/NewSaleForm/LifePlanApplication1.tsx
292
306
  import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
@@ -399,7 +413,7 @@ var LifePlanApplication1 = ({
399
413
  }
400
414
  ) }),
401
415
  /* @__PURE__ */ jsx2(Field2.Root, { children: /* @__PURE__ */ jsx2(
402
- floating_label_input_default,
416
+ FloatingLabelInput,
403
417
  {
404
418
  id: "idNumber",
405
419
  type: "text",
@@ -409,7 +423,7 @@ var LifePlanApplication1 = ({
409
423
  }
410
424
  ) }),
411
425
  /* @__PURE__ */ jsx2(Field2.Root, { children: /* @__PURE__ */ jsx2(
412
- floating_label_input_default,
426
+ FloatingLabelInput,
413
427
  {
414
428
  id: "lastName",
415
429
  type: "text",
@@ -419,7 +433,7 @@ var LifePlanApplication1 = ({
419
433
  }
420
434
  ) }),
421
435
  /* @__PURE__ */ jsx2(Field2.Root, { children: /* @__PURE__ */ jsx2(
422
- floating_label_input_default,
436
+ FloatingLabelInput,
423
437
  {
424
438
  id: "firstName",
425
439
  type: "text",
@@ -429,7 +443,7 @@ var LifePlanApplication1 = ({
429
443
  }
430
444
  ) }),
431
445
  /* @__PURE__ */ jsx2(Field2.Root, { children: /* @__PURE__ */ jsx2(
432
- floating_label_input_default,
446
+ FloatingLabelInput,
433
447
  {
434
448
  id: "middleName",
435
449
  type: "text",
@@ -439,7 +453,7 @@ var LifePlanApplication1 = ({
439
453
  }
440
454
  ) }),
441
455
  /* @__PURE__ */ jsx2(Field2.Root, { children: /* @__PURE__ */ jsx2(
442
- floating_label_input_default,
456
+ FloatingLabelInput,
443
457
  {
444
458
  id: "suffix",
445
459
  type: "text",
@@ -465,7 +479,7 @@ var LifePlanApplication1 = ({
465
479
  /* @__PURE__ */ jsx2(Input2, { id: "dateOfNeutralization", type: "date" })
466
480
  ] }),
467
481
  /* @__PURE__ */ jsx2(Field2.Root, { children: /* @__PURE__ */ jsx2(
468
- floating_label_input_default,
482
+ FloatingLabelInput,
469
483
  {
470
484
  id: "height",
471
485
  label: "Height (ft)",
@@ -477,7 +491,7 @@ var LifePlanApplication1 = ({
477
491
  }
478
492
  ) }),
479
493
  /* @__PURE__ */ jsx2(Field2.Root, { children: /* @__PURE__ */ jsx2(
480
- floating_label_input_default,
494
+ FloatingLabelInput,
481
495
  {
482
496
  id: "weight",
483
497
  label: "Weight (lbs)",
@@ -526,7 +540,7 @@ var LifePlanApplication1 = ({
526
540
  }
527
541
  ) }),
528
542
  /* @__PURE__ */ jsx2(Field2.Root, { children: /* @__PURE__ */ jsx2(
529
- floating_label_input_default,
543
+ FloatingLabelInput,
530
544
  {
531
545
  id: "nationality",
532
546
  type: "text",
@@ -536,7 +550,7 @@ var LifePlanApplication1 = ({
536
550
  }
537
551
  ) }),
538
552
  /* @__PURE__ */ jsx2(Field2.Root, { children: /* @__PURE__ */ jsx2(
539
- floating_label_input_default,
553
+ FloatingLabelInput,
540
554
  {
541
555
  id: "mobileNumber",
542
556
  type: "text",
@@ -546,7 +560,7 @@ var LifePlanApplication1 = ({
546
560
  }
547
561
  ) }),
548
562
  /* @__PURE__ */ jsx2(Field2.Root, { children: /* @__PURE__ */ jsx2(
549
- floating_label_input_default,
563
+ FloatingLabelInput,
550
564
  {
551
565
  id: "landlineNumber",
552
566
  type: "text",
@@ -559,7 +573,7 @@ var LifePlanApplication1 = ({
559
573
  }
560
574
  ) }),
561
575
  /* @__PURE__ */ jsx2(Field2.Root, { children: /* @__PURE__ */ jsx2(
562
- floating_label_input_default,
576
+ FloatingLabelInput,
563
577
  {
564
578
  id: "email",
565
579
  type: "email",
@@ -569,7 +583,7 @@ var LifePlanApplication1 = ({
569
583
  }
570
584
  ) }),
571
585
  /* @__PURE__ */ jsx2(Field2.Root, { children: /* @__PURE__ */ jsx2(
572
- floating_label_input_default,
586
+ FloatingLabelInput,
573
587
  {
574
588
  id: "mailingAddress",
575
589
  type: "text",
@@ -579,7 +593,7 @@ var LifePlanApplication1 = ({
579
593
  }
580
594
  ) }),
581
595
  /* @__PURE__ */ jsx2(Field2.Root, { children: /* @__PURE__ */ jsx2(
582
- floating_label_input_default,
596
+ FloatingLabelInput,
583
597
  {
584
598
  id: "insurability",
585
599
  type: "text",
@@ -900,7 +914,7 @@ var LifePlanApplication2 = ({
900
914
  }
901
915
  ) }),
902
916
  /* @__PURE__ */ jsx3(Field3.Root, { children: /* @__PURE__ */ jsx3(
903
- floating_label_input_default,
917
+ FloatingLabelInput,
904
918
  {
905
919
  id: "street",
906
920
  label: "Street",
@@ -909,7 +923,7 @@ var LifePlanApplication2 = ({
909
923
  }
910
924
  ) }),
911
925
  /* @__PURE__ */ jsx3(Field3.Root, { children: /* @__PURE__ */ jsx3(
912
- floating_label_input_default,
926
+ FloatingLabelInput,
913
927
  {
914
928
  id: "lotNumber",
915
929
  label: "Lot #",
@@ -925,13 +939,13 @@ var LifePlanApplication2_default = LifePlanApplication2;
925
939
 
926
940
  // src/NewSaleForm/LifePlanApplication3.tsx
927
941
  import { Box as Box3, Field as Field4, SimpleGrid as SimpleGrid2, VStack as VStack2 } from "@chakra-ui/react";
928
- import React2 from "react";
942
+ import React from "react";
929
943
  import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
930
944
  var LifePlanApplication3 = ({
931
945
  initialData,
932
946
  onUpdate
933
947
  }) => {
934
- const [formData, setFormData] = React2.useState({
948
+ const [formData, setFormData] = React.useState({
935
949
  occupation: initialData?.occupation ?? "Software Engineer",
936
950
  employerName: initialData?.employerName ?? "ABC Technologies Inc.",
937
951
  employmentStatus: initialData?.employmentStatus ?? "Regular",
@@ -1309,7 +1323,7 @@ var Beneficiary = ({ onUpdate }) => {
1309
1323
  children: [
1310
1324
  /* @__PURE__ */ jsxs6(Field5.Root, { children: [
1311
1325
  /* @__PURE__ */ jsx6(
1312
- floating_label_input_default,
1326
+ FloatingLabelInput,
1313
1327
  {
1314
1328
  id: "firstName",
1315
1329
  type: "text",
@@ -1325,7 +1339,7 @@ var Beneficiary = ({ onUpdate }) => {
1325
1339
  ] }),
1326
1340
  /* @__PURE__ */ jsxs6(Field5.Root, { children: [
1327
1341
  /* @__PURE__ */ jsx6(
1328
- floating_label_input_default,
1342
+ FloatingLabelInput,
1329
1343
  {
1330
1344
  id: "lastName",
1331
1345
  type: "text",
@@ -1341,7 +1355,7 @@ var Beneficiary = ({ onUpdate }) => {
1341
1355
  ] }),
1342
1356
  /* @__PURE__ */ jsxs6(Field5.Root, { children: [
1343
1357
  /* @__PURE__ */ jsx6(
1344
- floating_label_input_default,
1358
+ FloatingLabelInput,
1345
1359
  {
1346
1360
  id: "middleInitial",
1347
1361
  type: "text",
@@ -1360,7 +1374,7 @@ var Beneficiary = ({ onUpdate }) => {
1360
1374
  ),
1361
1375
  /* @__PURE__ */ jsxs6(Field5.Root, { children: [
1362
1376
  /* @__PURE__ */ jsx6(
1363
- floating_label_input_default,
1377
+ FloatingLabelInput,
1364
1378
  {
1365
1379
  id: "address",
1366
1380
  type: "text",
@@ -3168,7 +3182,7 @@ var LifePlanApplicationStepWrapper = () => {
3168
3182
  var LifePlanApplicationStepWrapper_default = LifePlanApplicationStepWrapper;
3169
3183
 
3170
3184
  // src/Generic/BottomQuickActions.tsx
3171
- import React6 from "react";
3185
+ import React5 from "react";
3172
3186
  import {
3173
3187
  Box as Box15,
3174
3188
  Drawer,
@@ -3229,7 +3243,7 @@ var SUBTITLE_COLOR = BRAND_COLORS.grey;
3229
3243
  var LABEL_COLOR = BRAND_COLORS.neutralText;
3230
3244
  var DESC_COLOR = BRAND_COLORS.grey;
3231
3245
  var CHEVRON_COLOR = BRAND_COLORS.ashWhite;
3232
- var QuickActionsHeaderCard = React6.memo(
3246
+ var QuickActionsHeaderCard = React5.memo(
3233
3247
  ({
3234
3248
  initials,
3235
3249
  avatarBg = AVATAR_DEFAULT_BG,
@@ -3305,7 +3319,7 @@ var QuickActionsHeaderCard = React6.memo(
3305
3319
  var ITEM_TRANSITION = {
3306
3320
  transition: "background 0.15s ease, transform 0.1s ease"
3307
3321
  };
3308
- var ActionItem = React6.memo(({ action }) => {
3322
+ var ActionItem = React5.memo(({ action }) => {
3309
3323
  const iconBg = action.iconBg ?? DEFAULT_ICON_BG;
3310
3324
  const iconColor = action.iconColor ?? DEFAULT_ICON_COLOR;
3311
3325
  const inner = /* @__PURE__ */ jsxs15(
@@ -3562,7 +3576,8 @@ var STEPS = [
3562
3576
  ];
3563
3577
  var INSTALL_DIALOG_DISMISSED_KEY = "estore-install-dialog-dismissed";
3564
3578
  function NotifyInstall({
3565
- children
3579
+ children,
3580
+ appName
3566
3581
  }) {
3567
3582
  const { isInstalled, isMobile, canInstall, install } = useNotifyInstall();
3568
3583
  const [isDismissed, setIsDismissed] = useState13(false);
@@ -3623,13 +3638,16 @@ function NotifyInstall({
3623
3638
  }
3624
3639
  ),
3625
3640
  /* @__PURE__ */ jsxs16(VStack8, { gap: 2, children: [
3626
- /* @__PURE__ */ jsx19(
3641
+ /* @__PURE__ */ jsxs16(
3627
3642
  Heading,
3628
3643
  {
3629
3644
  fontSize: { base: "lg", sm: "xl" },
3630
3645
  fontWeight: "bold",
3631
3646
  color: "gray.900",
3632
- children: "Install St. Peter eStore"
3647
+ children: [
3648
+ "Install ",
3649
+ appName || "eStore"
3650
+ ]
3633
3651
  }
3634
3652
  ),
3635
3653
  /* @__PURE__ */ jsx19(
@@ -5214,7 +5232,6 @@ var UserProfile_default = ReusableProfile;
5214
5232
  export {
5215
5233
  beneficiary_default as Beneficiary,
5216
5234
  BottomQuickActions_default as BottomQuickActions,
5217
- floating_label_input_default as FloatingLabelInput,
5218
5235
  HealthDeclaration_default as HealthDeclaration,
5219
5236
  LifePlanApplication1_default as LifePlanApplication1,
5220
5237
  LifePlanApplication2_default as LifePlanApplication2,