@diwauhris/ui 1.7.6 → 1.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/assets/ui.css CHANGED
@@ -913,10 +913,6 @@
913
913
  min-height: 320px;
914
914
  }
915
915
 
916
- .min-h-\[32px\] {
917
- min-height: 32px;
918
- }
919
-
920
916
  .min-h-\[360px\] {
921
917
  min-height: 360px;
922
918
  }
@@ -2332,6 +2328,10 @@
2332
2328
  border-color: rgb(255 255 255 / 0.2);
2333
2329
  }
2334
2330
 
2331
+ .border-white\/30 {
2332
+ border-color: rgb(255 255 255 / 0.3);
2333
+ }
2334
+
2335
2335
  .border-white\/50 {
2336
2336
  border-color: rgb(255 255 255 / 0.5);
2337
2337
  }
@@ -2374,6 +2374,10 @@
2374
2374
  background-color: rgb(45 138 202 / var(--tw-bg-opacity, 1));
2375
2375
  }
2376
2376
 
2377
+ .bg-\[\#2D8ACA\]\/50 {
2378
+ background-color: rgb(45 138 202 / 0.5);
2379
+ }
2380
+
2377
2381
  .bg-\[\#B91C1C\] {
2378
2382
  --tw-bg-opacity: 1;
2379
2383
  background-color: rgb(185 28 28 / var(--tw-bg-opacity, 1));
@@ -2879,6 +2883,10 @@
2879
2883
  background-color: rgb(255 255 255 / 0.3);
2880
2884
  }
2881
2885
 
2886
+ .bg-white\/5 {
2887
+ background-color: rgb(255 255 255 / 0.05);
2888
+ }
2889
+
2882
2890
  .bg-white\/60 {
2883
2891
  background-color: rgb(255 255 255 / 0.6);
2884
2892
  }
@@ -3806,6 +3814,10 @@
3806
3814
  color: rgb(255 255 255 / var(--tw-text-opacity, 1));
3807
3815
  }
3808
3816
 
3817
+ .text-white\/20 {
3818
+ color: rgb(255 255 255 / 0.2);
3819
+ }
3820
+
3809
3821
  .text-white\/30 {
3810
3822
  color: rgb(255 255 255 / 0.3);
3811
3823
  }
@@ -3959,6 +3971,11 @@
3959
3971
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
3960
3972
  }
3961
3973
 
3974
+ .shadow-black\/20 {
3975
+ --tw-shadow-color: rgb(0 0 0 / 0.2);
3976
+ --tw-shadow: var(--tw-shadow-colored);
3977
+ }
3978
+
3962
3979
  .shadow-brand-blue\/15 {
3963
3980
  --tw-shadow-color: rgb(3 78 162 / 0.15);
3964
3981
  --tw-shadow: var(--tw-shadow-colored);
@@ -4539,9 +4556,6 @@ body {
4539
4556
  .last\:border-b-0:last-child {
4540
4557
  border-bottom-width: 0px;
4541
4558
  }
4542
- .last\:pb-0:last-child {
4543
- padding-bottom: 0px;
4544
- }
4545
4559
  .focus-within\:border-brand-blue\/50:focus-within {
4546
4560
  border-color: rgb(3 78 162 / 0.5);
4547
4561
  }
package/lib/index.cjs CHANGED
@@ -3519,14 +3519,19 @@ function resolveState(id, currentStep, completedSteps, disabledSteps) {
3519
3519
  if (id === currentStep) return "current";
3520
3520
  return "upcoming";
3521
3521
  }
3522
- function StepCircle({ state, number, icon }) {
3522
+ function StepCircle({ state, number, icon, dark = false }) {
3523
3523
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3524
- className: `flex h-9 w-9 shrink-0 items-center justify-center rounded-full border-2 text-sm font-bold transition-all ${{
3524
+ className: `flex h-9 w-9 shrink-0 items-center justify-center rounded-full border-2 text-sm font-bold transition-all ${(dark ? {
3525
+ completed: "border-[#2D8ACA] bg-[#2D8ACA] text-white",
3526
+ current: "border-white bg-white text-[#00377B] shadow-md shadow-black/20",
3527
+ upcoming: "border-white/30 bg-white/10 text-white/60",
3528
+ disabled: "border-white/10 bg-white/5 text-white/20"
3529
+ } : {
3525
3530
  completed: "border-brand-blue bg-brand-blue text-white",
3526
3531
  current: "border-brand-blue bg-white text-brand-blue shadow-md shadow-brand-blue/15",
3527
3532
  upcoming: "border-slate-300 bg-white text-slate-400",
3528
3533
  disabled: "border-slate-200 bg-slate-50 text-slate-300"
3529
- }[state]}`,
3534
+ })[state]}`,
3530
3535
  "aria-hidden": "true",
3531
3536
  children: state === "completed" ? icon ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Check, {
3532
3537
  size: 16,
@@ -3534,8 +3539,10 @@ function StepCircle({ state, number, icon }) {
3534
3539
  }) : icon ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: number })
3535
3540
  });
3536
3541
  }
3537
- function Stepper({ steps, currentStep, completedSteps = [], disabledSteps = [], orientation = "horizontal", className = "" }) {
3538
- if (!(orientation === "horizontal")) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3542
+ function Stepper({ steps, currentStep, completedSteps = [], disabledSteps = [], orientation = "horizontal", theme = "light", className = "" }) {
3543
+ const isHorizontal = orientation === "horizontal";
3544
+ const dark = theme === "dark";
3545
+ if (!isHorizontal) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3539
3546
  role: "group",
3540
3547
  "aria-label": "Progress",
3541
3548
  className: cn("flex flex-col", className),
@@ -3545,31 +3552,40 @@ function Stepper({ steps, currentStep, completedSteps = [], disabledSteps = [],
3545
3552
  const state = resolveState(step.id, currentStep, completedSteps, disabledSteps);
3546
3553
  const isCurrent = state === "current";
3547
3554
  const isLast = idx === steps.length - 1;
3555
+ const connectorDone = state === "completed";
3556
+ const connectorColor = dark ? connectorDone ? "bg-[#2D8ACA]/50" : "bg-white/15" : connectorDone ? "bg-brand-blue/50" : "bg-slate-200";
3557
+ const labelColor = dark ? {
3558
+ completed: "text-[#2D8ACA]",
3559
+ current: "text-white font-bold",
3560
+ upcoming: "text-white/60",
3561
+ disabled: "text-white/20"
3562
+ } : {
3563
+ completed: "text-brand-blue",
3564
+ current: "text-brand-navy font-bold",
3565
+ upcoming: "text-slate-500",
3566
+ disabled: "text-slate-300"
3567
+ };
3548
3568
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
3549
3569
  "aria-current": isCurrent ? "step" : void 0,
3550
- className: "flex items-start gap-4 pb-8 last:pb-0",
3570
+ className: "flex items-stretch gap-4",
3551
3571
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3552
- className: "relative flex flex-col items-center",
3572
+ className: "relative flex w-9 shrink-0 flex-col items-center",
3553
3573
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StepCircle, {
3554
3574
  state,
3555
3575
  number: idx + 1,
3556
- icon: step.icon
3576
+ icon: step.icon,
3577
+ dark
3557
3578
  }), !isLast && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3558
- className: `mt-1 w-0.5 flex-1 min-h-[32px] ${state === "completed" ? "bg-brand-blue/50" : "bg-slate-200"}`,
3579
+ className: `w-0.5 flex-1 ${connectorColor}`,
3559
3580
  "aria-hidden": "true"
3560
3581
  })]
3561
3582
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3562
- className: "min-w-0 flex-1 pt-1",
3583
+ className: `min-w-0 flex-1 pt-1 ${!isLast ? "pb-6" : ""}`,
3563
3584
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
3564
- className: `text-sm leading-tight ${{
3565
- completed: "text-brand-blue",
3566
- current: "text-brand-navy font-bold",
3567
- upcoming: "text-slate-500",
3568
- disabled: "text-slate-300"
3569
- }[state]}`,
3585
+ className: `text-sm leading-tight ${labelColor[state]}`,
3570
3586
  children: step.label
3571
3587
  }), step.description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
3572
- className: "mt-0.5 text-xs text-slate-400 leading-tight",
3588
+ className: `mt-0.5 text-xs leading-tight ${dark ? "text-white/40" : "text-slate-400"}`,
3573
3589
  children: step.description
3574
3590
  })]
3575
3591
  })]
@@ -3578,7 +3594,12 @@ function Stepper({ steps, currentStep, completedSteps = [], disabledSteps = [],
3578
3594
  })
3579
3595
  });
3580
3596
  const resolvedStates = steps.map((step) => resolveState(step.id, currentStep, completedSteps, disabledSteps));
3581
- const labelColor = {
3597
+ const labelColor = dark ? {
3598
+ completed: "text-[#2D8ACA]",
3599
+ current: "text-white font-bold",
3600
+ upcoming: "text-white/60",
3601
+ disabled: "text-white/20"
3602
+ } : {
3582
3603
  completed: "text-brand-blue",
3583
3604
  current: "text-brand-navy font-bold",
3584
3605
  upcoming: "text-slate-500",
@@ -3596,6 +3617,9 @@ function Stepper({ steps, currentStep, completedSteps = [], disabledSteps = [],
3596
3617
  const isCurrent = state === "current";
3597
3618
  const isLast = idx === steps.length - 1;
3598
3619
  const prevState = idx > 0 ? resolvedStates[idx - 1] : null;
3620
+ const connectorDone = prevState === "completed" || prevState === "current";
3621
+ const connectorLeft = dark ? connectorDone ? "bg-[#2D8ACA]/50" : "bg-white/15" : connectorDone ? "bg-brand-blue/50" : "bg-slate-200";
3622
+ const connectorRight = dark ? state === "completed" ? "bg-[#2D8ACA]/50" : "bg-white/15" : state === "completed" ? "bg-brand-blue/50" : "bg-slate-200";
3599
3623
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
3600
3624
  "aria-current": isCurrent ? "step" : void 0,
3601
3625
  className: "flex flex-col items-center",
@@ -3603,7 +3627,7 @@ function Stepper({ steps, currentStep, completedSteps = [], disabledSteps = [],
3603
3627
  className: "flex w-full items-center",
3604
3628
  children: [
3605
3629
  idx > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3606
- className: `h-0.5 flex-1 ${prevState === "completed" || prevState === "current" ? "bg-brand-blue/50" : "bg-slate-200"}`,
3630
+ className: `h-0.5 flex-1 ${connectorLeft}`,
3607
3631
  "aria-hidden": "true"
3608
3632
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3609
3633
  className: "flex-1",
@@ -3614,11 +3638,12 @@ function Stepper({ steps, currentStep, completedSteps = [], disabledSteps = [],
3614
3638
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StepCircle, {
3615
3639
  state,
3616
3640
  number: idx + 1,
3617
- icon: step.icon
3641
+ icon: step.icon,
3642
+ dark
3618
3643
  })
3619
3644
  }),
3620
3645
  !isLast ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3621
- className: `h-0.5 flex-1 ${state === "completed" ? "bg-brand-blue/50" : "bg-slate-200"}`,
3646
+ className: `h-0.5 flex-1 ${connectorRight}`,
3622
3647
  "aria-hidden": "true"
3623
3648
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3624
3649
  className: "flex-1",
@@ -3631,7 +3656,7 @@ function Stepper({ steps, currentStep, completedSteps = [], disabledSteps = [],
3631
3656
  className: `text-sm leading-tight ${labelColor[state]}`,
3632
3657
  children: step.label
3633
3658
  }), step.description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
3634
- className: "mt-0.5 text-xs text-slate-400 leading-tight",
3659
+ className: `mt-0.5 text-xs leading-tight ${dark ? "text-white/40" : "text-slate-400"}`,
3635
3660
  children: step.description
3636
3661
  })]
3637
3662
  })]
package/lib/index.mjs CHANGED
@@ -3495,14 +3495,19 @@ function resolveState(id, currentStep, completedSteps, disabledSteps) {
3495
3495
  if (id === currentStep) return "current";
3496
3496
  return "upcoming";
3497
3497
  }
3498
- function StepCircle({ state, number, icon }) {
3498
+ function StepCircle({ state, number, icon, dark = false }) {
3499
3499
  return /* @__PURE__ */ jsx("div", {
3500
- className: `flex h-9 w-9 shrink-0 items-center justify-center rounded-full border-2 text-sm font-bold transition-all ${{
3500
+ className: `flex h-9 w-9 shrink-0 items-center justify-center rounded-full border-2 text-sm font-bold transition-all ${(dark ? {
3501
+ completed: "border-[#2D8ACA] bg-[#2D8ACA] text-white",
3502
+ current: "border-white bg-white text-[#00377B] shadow-md shadow-black/20",
3503
+ upcoming: "border-white/30 bg-white/10 text-white/60",
3504
+ disabled: "border-white/10 bg-white/5 text-white/20"
3505
+ } : {
3501
3506
  completed: "border-brand-blue bg-brand-blue text-white",
3502
3507
  current: "border-brand-blue bg-white text-brand-blue shadow-md shadow-brand-blue/15",
3503
3508
  upcoming: "border-slate-300 bg-white text-slate-400",
3504
3509
  disabled: "border-slate-200 bg-slate-50 text-slate-300"
3505
- }[state]}`,
3510
+ })[state]}`,
3506
3511
  "aria-hidden": "true",
3507
3512
  children: state === "completed" ? icon ?? /* @__PURE__ */ jsx(Check, {
3508
3513
  size: 16,
@@ -3510,8 +3515,10 @@ function StepCircle({ state, number, icon }) {
3510
3515
  }) : icon ?? /* @__PURE__ */ jsx("span", { children: number })
3511
3516
  });
3512
3517
  }
3513
- function Stepper({ steps, currentStep, completedSteps = [], disabledSteps = [], orientation = "horizontal", className = "" }) {
3514
- if (!(orientation === "horizontal")) return /* @__PURE__ */ jsx("div", {
3518
+ function Stepper({ steps, currentStep, completedSteps = [], disabledSteps = [], orientation = "horizontal", theme = "light", className = "" }) {
3519
+ const isHorizontal = orientation === "horizontal";
3520
+ const dark = theme === "dark";
3521
+ if (!isHorizontal) return /* @__PURE__ */ jsx("div", {
3515
3522
  role: "group",
3516
3523
  "aria-label": "Progress",
3517
3524
  className: cn("flex flex-col", className),
@@ -3521,31 +3528,40 @@ function Stepper({ steps, currentStep, completedSteps = [], disabledSteps = [],
3521
3528
  const state = resolveState(step.id, currentStep, completedSteps, disabledSteps);
3522
3529
  const isCurrent = state === "current";
3523
3530
  const isLast = idx === steps.length - 1;
3531
+ const connectorDone = state === "completed";
3532
+ const connectorColor = dark ? connectorDone ? "bg-[#2D8ACA]/50" : "bg-white/15" : connectorDone ? "bg-brand-blue/50" : "bg-slate-200";
3533
+ const labelColor = dark ? {
3534
+ completed: "text-[#2D8ACA]",
3535
+ current: "text-white font-bold",
3536
+ upcoming: "text-white/60",
3537
+ disabled: "text-white/20"
3538
+ } : {
3539
+ completed: "text-brand-blue",
3540
+ current: "text-brand-navy font-bold",
3541
+ upcoming: "text-slate-500",
3542
+ disabled: "text-slate-300"
3543
+ };
3524
3544
  return /* @__PURE__ */ jsxs("li", {
3525
3545
  "aria-current": isCurrent ? "step" : void 0,
3526
- className: "flex items-start gap-4 pb-8 last:pb-0",
3546
+ className: "flex items-stretch gap-4",
3527
3547
  children: [/* @__PURE__ */ jsxs("div", {
3528
- className: "relative flex flex-col items-center",
3548
+ className: "relative flex w-9 shrink-0 flex-col items-center",
3529
3549
  children: [/* @__PURE__ */ jsx(StepCircle, {
3530
3550
  state,
3531
3551
  number: idx + 1,
3532
- icon: step.icon
3552
+ icon: step.icon,
3553
+ dark
3533
3554
  }), !isLast && /* @__PURE__ */ jsx("div", {
3534
- className: `mt-1 w-0.5 flex-1 min-h-[32px] ${state === "completed" ? "bg-brand-blue/50" : "bg-slate-200"}`,
3555
+ className: `w-0.5 flex-1 ${connectorColor}`,
3535
3556
  "aria-hidden": "true"
3536
3557
  })]
3537
3558
  }), /* @__PURE__ */ jsxs("div", {
3538
- className: "min-w-0 flex-1 pt-1",
3559
+ className: `min-w-0 flex-1 pt-1 ${!isLast ? "pb-6" : ""}`,
3539
3560
  children: [/* @__PURE__ */ jsx("p", {
3540
- className: `text-sm leading-tight ${{
3541
- completed: "text-brand-blue",
3542
- current: "text-brand-navy font-bold",
3543
- upcoming: "text-slate-500",
3544
- disabled: "text-slate-300"
3545
- }[state]}`,
3561
+ className: `text-sm leading-tight ${labelColor[state]}`,
3546
3562
  children: step.label
3547
3563
  }), step.description && /* @__PURE__ */ jsx("p", {
3548
- className: "mt-0.5 text-xs text-slate-400 leading-tight",
3564
+ className: `mt-0.5 text-xs leading-tight ${dark ? "text-white/40" : "text-slate-400"}`,
3549
3565
  children: step.description
3550
3566
  })]
3551
3567
  })]
@@ -3554,7 +3570,12 @@ function Stepper({ steps, currentStep, completedSteps = [], disabledSteps = [],
3554
3570
  })
3555
3571
  });
3556
3572
  const resolvedStates = steps.map((step) => resolveState(step.id, currentStep, completedSteps, disabledSteps));
3557
- const labelColor = {
3573
+ const labelColor = dark ? {
3574
+ completed: "text-[#2D8ACA]",
3575
+ current: "text-white font-bold",
3576
+ upcoming: "text-white/60",
3577
+ disabled: "text-white/20"
3578
+ } : {
3558
3579
  completed: "text-brand-blue",
3559
3580
  current: "text-brand-navy font-bold",
3560
3581
  upcoming: "text-slate-500",
@@ -3572,6 +3593,9 @@ function Stepper({ steps, currentStep, completedSteps = [], disabledSteps = [],
3572
3593
  const isCurrent = state === "current";
3573
3594
  const isLast = idx === steps.length - 1;
3574
3595
  const prevState = idx > 0 ? resolvedStates[idx - 1] : null;
3596
+ const connectorDone = prevState === "completed" || prevState === "current";
3597
+ const connectorLeft = dark ? connectorDone ? "bg-[#2D8ACA]/50" : "bg-white/15" : connectorDone ? "bg-brand-blue/50" : "bg-slate-200";
3598
+ const connectorRight = dark ? state === "completed" ? "bg-[#2D8ACA]/50" : "bg-white/15" : state === "completed" ? "bg-brand-blue/50" : "bg-slate-200";
3575
3599
  return /* @__PURE__ */ jsxs("li", {
3576
3600
  "aria-current": isCurrent ? "step" : void 0,
3577
3601
  className: "flex flex-col items-center",
@@ -3579,7 +3603,7 @@ function Stepper({ steps, currentStep, completedSteps = [], disabledSteps = [],
3579
3603
  className: "flex w-full items-center",
3580
3604
  children: [
3581
3605
  idx > 0 ? /* @__PURE__ */ jsx("div", {
3582
- className: `h-0.5 flex-1 ${prevState === "completed" || prevState === "current" ? "bg-brand-blue/50" : "bg-slate-200"}`,
3606
+ className: `h-0.5 flex-1 ${connectorLeft}`,
3583
3607
  "aria-hidden": "true"
3584
3608
  }) : /* @__PURE__ */ jsx("div", {
3585
3609
  className: "flex-1",
@@ -3590,11 +3614,12 @@ function Stepper({ steps, currentStep, completedSteps = [], disabledSteps = [],
3590
3614
  children: /* @__PURE__ */ jsx(StepCircle, {
3591
3615
  state,
3592
3616
  number: idx + 1,
3593
- icon: step.icon
3617
+ icon: step.icon,
3618
+ dark
3594
3619
  })
3595
3620
  }),
3596
3621
  !isLast ? /* @__PURE__ */ jsx("div", {
3597
- className: `h-0.5 flex-1 ${state === "completed" ? "bg-brand-blue/50" : "bg-slate-200"}`,
3622
+ className: `h-0.5 flex-1 ${connectorRight}`,
3598
3623
  "aria-hidden": "true"
3599
3624
  }) : /* @__PURE__ */ jsx("div", {
3600
3625
  className: "flex-1",
@@ -3607,7 +3632,7 @@ function Stepper({ steps, currentStep, completedSteps = [], disabledSteps = [],
3607
3632
  className: `text-sm leading-tight ${labelColor[state]}`,
3608
3633
  children: step.label
3609
3634
  }), step.description && /* @__PURE__ */ jsx("p", {
3610
- className: "mt-0.5 text-xs text-slate-400 leading-tight",
3635
+ className: `mt-0.5 text-xs leading-tight ${dark ? "text-white/40" : "text-slate-400"}`,
3611
3636
  children: step.description
3612
3637
  })]
3613
3638
  })]
@@ -38,6 +38,8 @@ export interface StepperProps {
38
38
  /** IDs of steps that are disabled */
39
39
  disabledSteps?: string[];
40
40
  orientation?: 'horizontal' | 'vertical';
41
+ /** Use "dark" when rendering on a dark/navy background */
42
+ theme?: 'light' | 'dark';
41
43
  className?: string;
42
44
  }
43
- export declare function Stepper({ steps, currentStep, completedSteps, disabledSteps, orientation, className, }: StepperProps): import("react").JSX.Element;
45
+ export declare function Stepper({ steps, currentStep, completedSteps, disabledSteps, orientation, theme, className, }: StepperProps): import("react").JSX.Element;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@diwauhris/ui",
3
3
  "private": false,
4
- "version": "1.7.6",
4
+ "version": "1.7.8",
5
5
  "type": "module",
6
6
  "description": "DIWA UHRIS UI component library — React + Tailwind CSS",
7
7
  "keywords": [