@rehagro/ui 1.0.57 → 1.0.59

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
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import React9, { forwardRef, createContext, useState, useMemo, useRef, useEffect, useCallback, useContext } from 'react';
3
- import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
4
4
  import { createPortal } from 'react-dom';
5
5
 
6
6
  // src/provider/RehagroProvider.tsx
@@ -463,7 +463,7 @@ var Toast = forwardRef(function Toast2({
463
463
  /* @__PURE__ */ jsxs("div", { className: "rh-flex-1 rh-min-w-0", children: [
464
464
  /* @__PURE__ */ jsx("p", { className: "rh-text-sm rh-font-semibold rh-leading-tight", children: title }),
465
465
  description && /* @__PURE__ */ jsx(
466
- "p",
466
+ "div",
467
467
  {
468
468
  className: ["rh-mt-1 rh-text-sm rh-leading-normal", descriptionStyles[styleKey]].filter(Boolean).join(" "),
469
469
  children: description
@@ -2750,6 +2750,563 @@ var DateSelect = forwardRef(
2750
2750
  );
2751
2751
  }
2752
2752
  );
2753
+ var HOURS = Array.from({ length: 24 }, (_, i) => i);
2754
+ var MINUTES = Array.from({ length: 60 }, (_, i) => i);
2755
+ var ITEM_HEIGHT = 36;
2756
+ var CLOCK_HOURS_OUTER = [12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
2757
+ var CLOCK_HOURS_INNER = [0, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23];
2758
+ var CLOCK_MINUTES = Array.from({ length: 12 }, (_, index) => index * 5);
2759
+ var pad = (n) => String(n).padStart(2, "0");
2760
+ var clampClockPart = (value, max) => Math.min(max, Math.max(0, value));
2761
+ var statusClasses4 = {
2762
+ default: "rh-border-border focus-within:rh-border-primary focus-within:rh-ring-2 focus-within:rh-ring-gray-200",
2763
+ error: "rh-border-danger focus-within:rh-border-danger focus-within:rh-ring-2 focus-within:rh-ring-red-100"
2764
+ };
2765
+ var sizeClasses7 = {
2766
+ sm: "rh-min-h-[32px] rh-text-sm rh-px-input-x-sm",
2767
+ md: "rh-min-h-[40px] rh-text-sm rh-px-input-x-md",
2768
+ lg: "rh-min-h-[48px] rh-text-base rh-px-input-x-lg"
2769
+ };
2770
+ var radiusClasses6 = {
2771
+ none: "rh-rounded-none",
2772
+ xxs: "rh-rounded-xxs",
2773
+ xs: "rh-rounded-xs",
2774
+ sm: "rh-rounded-sm",
2775
+ md: "rh-rounded-md",
2776
+ lg: "rh-rounded-lg",
2777
+ xl: "rh-rounded-xl",
2778
+ full: "rh-rounded-full"
2779
+ };
2780
+ var helperStatusClasses4 = {
2781
+ default: "rh-text-text-muted",
2782
+ error: "rh-text-danger"
2783
+ };
2784
+ var getSubtitleClassName4 = (subtitle) => subtitle.trim() === "*" ? "rh-text-danger" : "rh-text-text-muted";
2785
+ var ClockIcon = () => /* @__PURE__ */ jsxs(
2786
+ "svg",
2787
+ {
2788
+ width: "16",
2789
+ height: "16",
2790
+ viewBox: "0 0 24 24",
2791
+ fill: "none",
2792
+ stroke: "currentColor",
2793
+ strokeWidth: "2",
2794
+ strokeLinecap: "round",
2795
+ strokeLinejoin: "round",
2796
+ "aria-hidden": "true",
2797
+ children: [
2798
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
2799
+ /* @__PURE__ */ jsx("polyline", { points: "12 6 12 12 16 14" })
2800
+ ]
2801
+ }
2802
+ );
2803
+ var EraserIcon2 = () => /* @__PURE__ */ jsx("svg", { width: "15", height: "14", viewBox: "0 0 17 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx(
2804
+ "path",
2805
+ {
2806
+ d: "M15.3134 13.7509H9.45406L16.2384 6.96656C16.4416 6.76343 16.6027 6.52227 16.7127 6.25686C16.8226 5.99145 16.8792 5.70697 16.8792 5.41969C16.8792 5.1324 16.8226 4.84793 16.7127 4.58252C16.6027 4.3171 16.4416 4.07594 16.2384 3.87281L13.0033 0.640783C12.8002 0.437631 12.559 0.276481 12.2936 0.166535C12.0282 0.0565888 11.7437 0 11.4564 0C11.1691 0 10.8846 0.0565888 10.6192 0.166535C10.3538 0.276481 10.1127 0.437631 9.90953 0.640783L0.640783 9.90875C0.437631 10.1119 0.276481 10.353 0.166535 10.6185C0.0565888 10.8839 0 11.1683 0 11.4556C0 11.7429 0.0565888 12.0274 0.166535 12.2928C0.276481 12.5582 0.437631 12.7994 0.640783 13.0025L2.98922 15.3517C3.07635 15.4388 3.17977 15.5078 3.29358 15.5548C3.40739 15.6019 3.52935 15.626 3.6525 15.6259H15.3134C15.5621 15.6259 15.8005 15.5272 15.9763 15.3514C16.1522 15.1755 16.2509 14.9371 16.2509 14.6884C16.2509 14.4398 16.1522 14.2013 15.9763 14.0255C15.8005 13.8497 15.5621 13.7509 15.3134 13.7509Z",
2807
+ fill: "currentColor"
2808
+ }
2809
+ ) });
2810
+ var PencilIcon = () => /* @__PURE__ */ jsxs(
2811
+ "svg",
2812
+ {
2813
+ width: "20",
2814
+ height: "20",
2815
+ viewBox: "0 0 24 24",
2816
+ fill: "none",
2817
+ stroke: "currentColor",
2818
+ strokeWidth: "2",
2819
+ strokeLinecap: "round",
2820
+ strokeLinejoin: "round",
2821
+ "aria-hidden": "true",
2822
+ children: [
2823
+ /* @__PURE__ */ jsx("path", { d: "M4 20h4L19 9a2.828 2.828 0 1 0-4-4L4 16v4Z" }),
2824
+ /* @__PURE__ */ jsx("path", { d: "m13.5 6.5 4 4" })
2825
+ ]
2826
+ }
2827
+ );
2828
+ function scrollToSelected(ref, index) {
2829
+ const el = ref.current;
2830
+ if (!el) return;
2831
+ const target = index * ITEM_HEIGHT - el.clientHeight / 2 + ITEM_HEIGHT / 2;
2832
+ el.scrollTop = Math.max(0, target);
2833
+ }
2834
+ function getClockPosition(index, radius) {
2835
+ const angle = index / 12 * Math.PI * 2 - Math.PI / 2;
2836
+ return {
2837
+ left: `calc(50% + ${Math.cos(angle) * radius}px)`,
2838
+ top: `calc(50% + ${Math.sin(angle) * radius}px)`
2839
+ };
2840
+ }
2841
+ function getRehagroPortalStyle(source) {
2842
+ const root = source?.closest(".rh-root");
2843
+ if (!root) return void 0;
2844
+ const variables = {};
2845
+ for (let index = 0; index < root.style.length; index += 1) {
2846
+ const property = root.style.item(index);
2847
+ if (!property.startsWith("--rh-")) continue;
2848
+ variables[property] = root.style.getPropertyValue(property);
2849
+ }
2850
+ return variables;
2851
+ }
2852
+ var TimePicker = forwardRef(
2853
+ function TimePicker2(props, ref) {
2854
+ const {
2855
+ label,
2856
+ subtitle,
2857
+ placeholder = "Selecione",
2858
+ status = "default",
2859
+ size = "md",
2860
+ radius = "xs",
2861
+ helperText,
2862
+ disabled = false,
2863
+ className = "",
2864
+ wrapperClassName = "",
2865
+ backgroundColor,
2866
+ presentation = "dropdown"
2867
+ } = props;
2868
+ const triggerId = React9.useId();
2869
+ const helperId = React9.useId();
2870
+ const isControlled = props.value !== void 0;
2871
+ const [internalValue, setInternalValue] = useState(
2872
+ props.defaultValue ?? null
2873
+ );
2874
+ const committedValue = isControlled ? props.value ?? null : internalValue;
2875
+ const [isOpen, setIsOpen] = useState(false);
2876
+ const [isHelperDismissed, setIsHelperDismissed] = useState(false);
2877
+ const [dropdownAlign, setDropdownAlign] = useState("left");
2878
+ const [clockStep, setClockStep] = useState("hour");
2879
+ const [isManualClockInput, setIsManualClockInput] = useState(false);
2880
+ const [hasPendingValue, setHasPendingValue] = useState(committedValue != null);
2881
+ const [pendingHour, setPendingHour] = useState(committedValue?.hour ?? 0);
2882
+ const [pendingMinute, setPendingMinute] = useState(committedValue?.minute ?? 0);
2883
+ const wrapperRef = useRef(null);
2884
+ const innerRef = useRef(null);
2885
+ const dropdownRef = useRef(null);
2886
+ const hourColRef = useRef(null);
2887
+ const minuteColRef = useRef(null);
2888
+ React9.useImperativeHandle(ref, () => innerRef.current);
2889
+ const visualStatus = helperText && isHelperDismissed ? "default" : status;
2890
+ useEffect(() => {
2891
+ if (!isOpen) return;
2892
+ const h = committedValue?.hour ?? 0;
2893
+ const m = committedValue?.minute ?? 0;
2894
+ setPendingHour(h);
2895
+ setPendingMinute(m);
2896
+ setClockStep("hour");
2897
+ setIsManualClockInput(false);
2898
+ setHasPendingValue(committedValue != null);
2899
+ if (presentation === "dropdown") {
2900
+ requestAnimationFrame(() => {
2901
+ scrollToSelected(hourColRef, h);
2902
+ scrollToSelected(minuteColRef, m);
2903
+ });
2904
+ }
2905
+ }, [isOpen]);
2906
+ useEffect(() => {
2907
+ if (!isOpen || presentation !== "dropdown" || !innerRef.current) return;
2908
+ const rect = innerRef.current.getBoundingClientRect();
2909
+ const dropdownW = 240;
2910
+ setDropdownAlign(window.innerWidth - rect.right >= dropdownW ? "left" : "right");
2911
+ }, [isOpen, presentation]);
2912
+ useEffect(() => {
2913
+ if (!isOpen || presentation !== "dropdown") return;
2914
+ const handler = (e) => {
2915
+ if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
2916
+ setIsOpen(false);
2917
+ }
2918
+ };
2919
+ document.addEventListener("mousedown", handler);
2920
+ return () => document.removeEventListener("mousedown", handler);
2921
+ }, [isOpen, presentation]);
2922
+ useEffect(() => {
2923
+ if (!isOpen) return;
2924
+ const handler = (e) => {
2925
+ if (e.key === "Escape") {
2926
+ setIsOpen(false);
2927
+ innerRef.current?.focus();
2928
+ }
2929
+ };
2930
+ document.addEventListener("keydown", handler);
2931
+ return () => document.removeEventListener("keydown", handler);
2932
+ }, [isOpen]);
2933
+ const commit = useCallback(
2934
+ (hour, minute) => {
2935
+ const newValue = { hour, minute };
2936
+ if (helperText) setIsHelperDismissed(true);
2937
+ if (!isControlled) setInternalValue(newValue);
2938
+ props.onChange?.(newValue);
2939
+ setIsOpen(false);
2940
+ },
2941
+ [helperText, isControlled, props]
2942
+ );
2943
+ const handleClear = useCallback(() => {
2944
+ setPendingHour(0);
2945
+ setPendingMinute(0);
2946
+ if (!isControlled) setInternalValue(null);
2947
+ props.onChange?.(void 0);
2948
+ setIsOpen(false);
2949
+ }, [isControlled, props]);
2950
+ const displayText = committedValue != null ? `${pad(committedValue.hour)}:${pad(committedValue.minute)}` : null;
2951
+ const clockDisplayText = hasPendingValue ? `${pad(pendingHour)}:${pad(pendingMinute)}` : "--:--";
2952
+ const closeClockDialog = () => {
2953
+ setIsOpen(false);
2954
+ innerRef.current?.focus();
2955
+ };
2956
+ const handleClockHourChange = (hour) => {
2957
+ setPendingHour(hour);
2958
+ setHasPendingValue(true);
2959
+ setClockStep("minute");
2960
+ };
2961
+ const handleClockMinuteChange = (minute) => {
2962
+ setPendingMinute(minute);
2963
+ setHasPendingValue(true);
2964
+ };
2965
+ const handleManualClockChange = (part, value) => {
2966
+ const numericValue = Number(value.replace(/\D/g, ""));
2967
+ if (Number.isNaN(numericValue)) return;
2968
+ if (part === "hour") {
2969
+ setPendingHour(clampClockPart(numericValue, 23));
2970
+ } else {
2971
+ setPendingMinute(clampClockPart(numericValue, 59));
2972
+ }
2973
+ setHasPendingValue(true);
2974
+ };
2975
+ const clockHourButton = (hour, index, radius2) => {
2976
+ const selected = hasPendingValue && pendingHour === hour;
2977
+ const position = getClockPosition(index, radius2);
2978
+ return /* @__PURE__ */ jsx(
2979
+ "button",
2980
+ {
2981
+ type: "button",
2982
+ "aria-label": `${pad(hour)} horas`,
2983
+ onClick: () => handleClockHourChange(hour),
2984
+ className: [
2985
+ "rh-absolute rh-flex rh-h-8 rh-w-8 -rh-translate-x-1/2 -rh-translate-y-1/2 rh-items-center rh-justify-center rh-rounded-full rh-text-sm rh-transition-colors rh-duration-150",
2986
+ selected ? "rh-bg-primary rh-font-semibold rh-text-surface" : "rh-text-text hover:rh-bg-border/40"
2987
+ ].join(" "),
2988
+ style: position,
2989
+ children: pad(hour)
2990
+ },
2991
+ hour
2992
+ );
2993
+ };
2994
+ const clockMinuteButton = (minute, index) => {
2995
+ const selected = hasPendingValue && pendingMinute === minute;
2996
+ const position = getClockPosition(index, 102);
2997
+ return /* @__PURE__ */ jsx(
2998
+ "button",
2999
+ {
3000
+ type: "button",
3001
+ "aria-label": `${pad(minute)} minutos`,
3002
+ onClick: () => handleClockMinuteChange(minute),
3003
+ className: [
3004
+ "rh-absolute rh-flex rh-h-8 rh-w-8 -rh-translate-x-1/2 -rh-translate-y-1/2 rh-items-center rh-justify-center rh-rounded-full rh-text-sm rh-transition-colors rh-duration-150",
3005
+ selected ? "rh-bg-primary rh-font-semibold rh-text-surface" : "rh-text-text hover:rh-bg-border/40"
3006
+ ].join(" "),
3007
+ style: position,
3008
+ children: pad(minute)
3009
+ },
3010
+ minute
3011
+ );
3012
+ };
3013
+ return /* @__PURE__ */ jsxs(
3014
+ "div",
3015
+ {
3016
+ ref: wrapperRef,
3017
+ className: ["rh-relative rh-flex rh-flex-col rh-gap-1 rh-font-body", wrapperClassName].filter(Boolean).join(" "),
3018
+ children: [
3019
+ label && /* @__PURE__ */ jsxs("label", { id: `${triggerId}-label`, className: "rh-flex rh-items-baseline rh-gap-1", children: [
3020
+ /* @__PURE__ */ jsx("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: label }),
3021
+ subtitle && /* @__PURE__ */ jsx("span", { className: `rh-text-sm ${getSubtitleClassName4(subtitle)}`, children: subtitle })
3022
+ ] }),
3023
+ /* @__PURE__ */ jsxs(
3024
+ "button",
3025
+ {
3026
+ ref: innerRef,
3027
+ id: triggerId,
3028
+ type: "button",
3029
+ role: "combobox",
3030
+ "aria-expanded": isOpen,
3031
+ "aria-haspopup": "dialog",
3032
+ "aria-labelledby": label ? `${triggerId}-label` : void 0,
3033
+ "aria-describedby": helperText ? helperId : void 0,
3034
+ "aria-invalid": visualStatus === "error" || void 0,
3035
+ "aria-disabled": disabled || void 0,
3036
+ disabled,
3037
+ onClick: () => !disabled && setIsOpen((o) => !o),
3038
+ style: backgroundColor ? { backgroundColor } : void 0,
3039
+ className: [
3040
+ "rh-group rh-flex rh-items-center rh-justify-between rh-gap-2",
3041
+ "rh-border rh-font-body",
3042
+ !backgroundColor && "rh-bg-surface",
3043
+ "rh-transition-colors rh-duration-150",
3044
+ "rh-text-left rh-w-full",
3045
+ statusClasses4[visualStatus],
3046
+ radiusClasses6[radius],
3047
+ sizeClasses7[size],
3048
+ disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "rh-cursor-pointer",
3049
+ className
3050
+ ].filter(Boolean).join(" "),
3051
+ children: [
3052
+ /* @__PURE__ */ jsx(
3053
+ "span",
3054
+ {
3055
+ className: [
3056
+ "rh-flex-1 rh-truncate",
3057
+ displayText ? "rh-text-text" : "rh-text-text-muted group-hover:rh-text-text"
3058
+ ].join(" "),
3059
+ children: displayText ?? placeholder
3060
+ }
3061
+ ),
3062
+ /* @__PURE__ */ jsx(ClockIcon, {})
3063
+ ]
3064
+ }
3065
+ ),
3066
+ isOpen && presentation === "dropdown" && /* @__PURE__ */ jsxs(
3067
+ "div",
3068
+ {
3069
+ ref: dropdownRef,
3070
+ role: "dialog",
3071
+ "aria-label": "Seletor de hora",
3072
+ className: [
3073
+ "rh-absolute rh-z-50 rh-mt-1",
3074
+ "rh-bg-surface rh-rounded-xs rh-border rh-border-border",
3075
+ "rh-w-[240px]",
3076
+ dropdownAlign === "left" ? "rh-left-0" : "rh-right-0"
3077
+ ].filter(Boolean).join(" "),
3078
+ style: {
3079
+ top: "100%",
3080
+ boxShadow: "0 0 9.6px 0 rgba(8, 11, 18, 0.08)"
3081
+ },
3082
+ children: [
3083
+ /* @__PURE__ */ jsxs("div", { className: "rh-flex rh-border-b rh-border-border", children: [
3084
+ /* @__PURE__ */ jsx("div", { className: "rh-flex-1 rh-py-2 rh-text-center rh-text-xs rh-font-semibold rh-text-text-muted rh-uppercase rh-tracking-wide", children: "Hora" }),
3085
+ /* @__PURE__ */ jsx("div", { className: "rh-w-px rh-bg-border" }),
3086
+ /* @__PURE__ */ jsx("div", { className: "rh-flex-1 rh-py-2 rh-text-center rh-text-xs rh-font-semibold rh-text-text-muted rh-uppercase rh-tracking-wide", children: "Minuto" })
3087
+ ] }),
3088
+ /* @__PURE__ */ jsxs("div", { className: "rh-flex", style: { height: 216 }, children: [
3089
+ /* @__PURE__ */ jsx(
3090
+ "div",
3091
+ {
3092
+ ref: hourColRef,
3093
+ className: "rh-flex-1 rh-overflow-y-auto rh-py-1 rh-scrollbar-thin",
3094
+ style: { scrollbarWidth: "none" },
3095
+ children: HOURS.map((h) => {
3096
+ const selected = h === pendingHour;
3097
+ return /* @__PURE__ */ jsx(
3098
+ "button",
3099
+ {
3100
+ type: "button",
3101
+ onClick: () => setPendingHour(h),
3102
+ style: { height: ITEM_HEIGHT },
3103
+ className: [
3104
+ "rh-w-full rh-flex rh-items-center rh-justify-center rh-text-sm rh-transition-colors rh-duration-100",
3105
+ selected ? "rh-bg-primary rh-text-surface rh-font-semibold" : "rh-text-text hover:rh-bg-background"
3106
+ ].join(" "),
3107
+ children: pad(h)
3108
+ },
3109
+ h
3110
+ );
3111
+ })
3112
+ }
3113
+ ),
3114
+ /* @__PURE__ */ jsx("div", { className: "rh-w-px rh-bg-border rh-self-stretch" }),
3115
+ /* @__PURE__ */ jsx(
3116
+ "div",
3117
+ {
3118
+ ref: minuteColRef,
3119
+ className: "rh-flex-1 rh-overflow-y-auto rh-py-1",
3120
+ style: { scrollbarWidth: "none" },
3121
+ children: MINUTES.map((m) => {
3122
+ const selected = m === pendingMinute;
3123
+ return /* @__PURE__ */ jsx(
3124
+ "button",
3125
+ {
3126
+ type: "button",
3127
+ onClick: () => setPendingMinute(m),
3128
+ style: { height: ITEM_HEIGHT },
3129
+ className: [
3130
+ "rh-w-full rh-flex rh-items-center rh-justify-center rh-text-sm rh-transition-colors rh-duration-100",
3131
+ selected ? "rh-bg-primary rh-text-surface rh-font-semibold" : "rh-text-text hover:rh-bg-background"
3132
+ ].join(" "),
3133
+ children: pad(m)
3134
+ },
3135
+ m
3136
+ );
3137
+ })
3138
+ }
3139
+ )
3140
+ ] }),
3141
+ /* @__PURE__ */ jsxs("div", { className: "rh-flex rh-items-center rh-justify-between rh-px-3 rh-py-2 rh-border-t rh-border-border", children: [
3142
+ /* @__PURE__ */ jsxs(
3143
+ "button",
3144
+ {
3145
+ type: "button",
3146
+ onClick: handleClear,
3147
+ className: "rh-flex rh-items-center rh-gap-1.5 rh-text-sm rh-text-text rh-font-medium rh-px-2 rh-py-1.5 rh-rounded-sm hover:rh-bg-background rh-transition-colors rh-duration-150",
3148
+ children: [
3149
+ /* @__PURE__ */ jsx(EraserIcon2, {}),
3150
+ "Limpar"
3151
+ ]
3152
+ }
3153
+ ),
3154
+ /* @__PURE__ */ jsx(
3155
+ "button",
3156
+ {
3157
+ type: "button",
3158
+ onClick: () => commit(pendingHour, pendingMinute),
3159
+ className: "rh-text-sm rh-font-medium rh-px-4 rh-py-1.5 rh-rounded-lg rh-bg-primary rh-text-surface hover:rh-opacity-90 rh-transition-opacity rh-duration-150",
3160
+ children: "Aplicar"
3161
+ }
3162
+ )
3163
+ ] })
3164
+ ]
3165
+ }
3166
+ ),
3167
+ isOpen && presentation === "clock" && typeof document !== "undefined" && createPortal(
3168
+ /* @__PURE__ */ jsx("div", { className: "rh-root", style: getRehagroPortalStyle(wrapperRef.current), children: /* @__PURE__ */ jsx(
3169
+ "div",
3170
+ {
3171
+ role: "presentation",
3172
+ className: "rh-fixed rh-inset-0 rh-z-50 rh-flex rh-items-center rh-justify-center rh-bg-text/50 rh-p-4",
3173
+ onMouseDown: (event) => {
3174
+ if (event.target === event.currentTarget) closeClockDialog();
3175
+ },
3176
+ children: /* @__PURE__ */ jsxs(
3177
+ "div",
3178
+ {
3179
+ ref: dropdownRef,
3180
+ role: "dialog",
3181
+ "aria-modal": "true",
3182
+ "aria-label": "Seletor de hora",
3183
+ className: "rh-flex rh-w-full rh-max-w-[360px] rh-flex-col rh-rounded-sm rh-bg-surface rh-p-6 rh-text-text",
3184
+ style: { boxShadow: "0 24px 48px rgb(8 11 18 / 0.24)" },
3185
+ children: [
3186
+ /* @__PURE__ */ jsx("span", { className: "rh-text-sm rh-font-normal rh-uppercase rh-text-text-muted", children: "Selecione a hora" }),
3187
+ /* @__PURE__ */ jsxs("div", { className: "rh-mt-6 rh-flex rh-items-center rh-justify-between", children: [
3188
+ isManualClockInput ? /* @__PURE__ */ jsxs("div", { className: "rh-flex rh-items-center rh-gap-2", children: [
3189
+ /* @__PURE__ */ jsx(
3190
+ "input",
3191
+ {
3192
+ "aria-label": "Hora",
3193
+ inputMode: "numeric",
3194
+ maxLength: 2,
3195
+ value: pad(pendingHour),
3196
+ onChange: (event) => handleManualClockChange("hour", event.target.value),
3197
+ className: "rh-h-12 rh-w-14 rh-rounded-xs rh-border rh-border-border rh-bg-surface rh-text-center rh-text-2xl rh-font-semibold rh-text-text rh-outline-none focus:rh-border-primary focus:rh-ring-2 focus:rh-ring-gray-200"
3198
+ }
3199
+ ),
3200
+ /* @__PURE__ */ jsx("span", { className: "rh-text-2xl rh-font-semibold rh-text-text-muted", children: ":" }),
3201
+ /* @__PURE__ */ jsx(
3202
+ "input",
3203
+ {
3204
+ "aria-label": "Minuto",
3205
+ inputMode: "numeric",
3206
+ maxLength: 2,
3207
+ value: pad(pendingMinute),
3208
+ onChange: (event) => handleManualClockChange("minute", event.target.value),
3209
+ className: "rh-h-12 rh-w-14 rh-rounded-xs rh-border rh-border-border rh-bg-surface rh-text-center rh-text-2xl rh-font-semibold rh-text-text rh-outline-none focus:rh-border-primary focus:rh-ring-2 focus:rh-ring-gray-200"
3210
+ }
3211
+ )
3212
+ ] }) : /* @__PURE__ */ jsxs("div", { className: "rh-flex rh-items-center rh-gap-1 rh-text-2xl rh-font-semibold", children: [
3213
+ /* @__PURE__ */ jsx(
3214
+ "button",
3215
+ {
3216
+ type: "button",
3217
+ onClick: () => setClockStep("hour"),
3218
+ className: [
3219
+ "rh-rounded-xs rh-px-1 rh-transition-colors rh-duration-150",
3220
+ clockStep === "hour" ? "rh-text-text" : "rh-text-text-muted hover:rh-bg-background"
3221
+ ].join(" "),
3222
+ children: clockDisplayText.slice(0, 2)
3223
+ }
3224
+ ),
3225
+ /* @__PURE__ */ jsx("span", { className: "rh-text-text-muted", children: ":" }),
3226
+ /* @__PURE__ */ jsx(
3227
+ "button",
3228
+ {
3229
+ type: "button",
3230
+ onClick: () => setClockStep("minute"),
3231
+ className: [
3232
+ "rh-rounded-xs rh-px-1 rh-transition-colors rh-duration-150",
3233
+ clockStep === "minute" ? "rh-text-text" : "rh-text-text-muted hover:rh-bg-background"
3234
+ ].join(" "),
3235
+ children: clockDisplayText.slice(3, 5)
3236
+ }
3237
+ )
3238
+ ] }),
3239
+ /* @__PURE__ */ jsx(
3240
+ "button",
3241
+ {
3242
+ type: "button",
3243
+ "aria-label": isManualClockInput ? "Voltar ao rel\xF3gio" : "Digitar hor\xE1rio manualmente",
3244
+ onClick: () => setIsManualClockInput((current) => !current),
3245
+ className: "rh-rounded-full rh-p-2 rh-text-text hover:rh-bg-background",
3246
+ children: /* @__PURE__ */ jsx(PencilIcon, {})
3247
+ }
3248
+ )
3249
+ ] }),
3250
+ !isManualClockInput && /* @__PURE__ */ jsx("div", { className: "rh-mx-auto rh-mt-8 rh-flex rh-h-[256px] rh-w-[256px] rh-items-center rh-justify-center rh-rounded-full rh-bg-background", children: /* @__PURE__ */ jsxs("div", { className: "rh-relative rh-h-full rh-w-full", children: [
3251
+ clockStep === "hour" ? /* @__PURE__ */ jsxs(Fragment, { children: [
3252
+ CLOCK_HOURS_OUTER.map(
3253
+ (hour, index) => clockHourButton(hour, index, 102)
3254
+ ),
3255
+ CLOCK_HOURS_INNER.map(
3256
+ (hour, index) => clockHourButton(hour, index, 68)
3257
+ )
3258
+ ] }) : CLOCK_MINUTES.map((minute, index) => clockMinuteButton(minute, index)),
3259
+ /* @__PURE__ */ jsx("span", { className: "rh-absolute rh-left-1/2 rh-top-1/2 rh-h-2 rh-w-2 -rh-translate-x-1/2 -rh-translate-y-1/2 rh-rounded-full rh-bg-primary" })
3260
+ ] }) }),
3261
+ /* @__PURE__ */ jsxs("div", { className: "rh-mt-8 rh-flex rh-justify-end rh-gap-6", children: [
3262
+ /* @__PURE__ */ jsx(
3263
+ "button",
3264
+ {
3265
+ type: "button",
3266
+ onClick: closeClockDialog,
3267
+ className: "rh-text-base rh-font-medium rh-uppercase rh-text-primary hover:rh-opacity-80",
3268
+ children: "Cancelar"
3269
+ }
3270
+ ),
3271
+ /* @__PURE__ */ jsx(
3272
+ "button",
3273
+ {
3274
+ type: "button",
3275
+ onClick: () => {
3276
+ if (hasPendingValue) commit(pendingHour, pendingMinute);
3277
+ else closeClockDialog();
3278
+ },
3279
+ className: "rh-text-base rh-font-medium rh-uppercase rh-text-primary hover:rh-opacity-80",
3280
+ children: "OK"
3281
+ }
3282
+ )
3283
+ ] })
3284
+ ]
3285
+ }
3286
+ )
3287
+ }
3288
+ ) }),
3289
+ document.body
3290
+ ),
3291
+ helperText && !isHelperDismissed && /* @__PURE__ */ jsxs(
3292
+ "span",
3293
+ {
3294
+ id: helperId,
3295
+ className: [
3296
+ "rh-flex rh-items-center rh-gap-1 rh-text-xs",
3297
+ helperStatusClasses4[visualStatus]
3298
+ ].join(" "),
3299
+ children: [
3300
+ /* @__PURE__ */ jsx(WarningCircleIcon, {}),
3301
+ helperText
3302
+ ]
3303
+ }
3304
+ )
3305
+ ]
3306
+ }
3307
+ );
3308
+ }
3309
+ );
2753
3310
  var variantClasses = {
2754
3311
  light: "rh-bg-surface rh-text-text rh-border rh-border-border rh-shadow-md",
2755
3312
  default: "rh-bg-primary/10 rh-text-text rh-border rh-border-primary/20 rh-shadow-md",
@@ -2760,7 +3317,7 @@ var arrowVariantClasses = {
2760
3317
  default: "rh-border-primary/20 rh-bg-primary/10",
2761
3318
  dark: "rh-bg-primary"
2762
3319
  };
2763
- var sizeClasses7 = {
3320
+ var sizeClasses8 = {
2764
3321
  sm: "rh-px-3 rh-py-1.5 rh-text-xs",
2765
3322
  md: "rh-px-4 rh-py-3 rh-text-sm"
2766
3323
  };
@@ -2891,7 +3448,7 @@ var Tooltip = forwardRef(
2891
3448
  "rh-absolute rh-z-50 rh-w-max rh-max-w-xs rh-rounded-xs",
2892
3449
  tooltipPlacementClasses[placement],
2893
3450
  variantClasses[variant],
2894
- sizeClasses7[size],
3451
+ sizeClasses8[size],
2895
3452
  className
2896
3453
  ].filter(Boolean).join(" "),
2897
3454
  children: [
@@ -2992,7 +3549,7 @@ function getAvatarColors(name) {
2992
3549
  const index = hash % AVATAR_COLORS.length;
2993
3550
  return AVATAR_COLORS[index];
2994
3551
  }
2995
- var sizeClasses8 = {
3552
+ var sizeClasses9 = {
2996
3553
  sm: "rh-w-8 rh-h-8 rh-text-xs",
2997
3554
  md: "rh-w-10 rh-h-10 rh-text-sm",
2998
3555
  lg: "rh-w-12 rh-h-12 rh-text-base",
@@ -3027,7 +3584,7 @@ var Avatar = forwardRef(function Avatar2({ src, alt = "", initials, size = "md",
3027
3584
  "rh-inline-flex rh-items-center rh-justify-center rh-shrink-0 rh-overflow-hidden",
3028
3585
  avatarColors ? "" : "rh-bg-primary rh-text-surface",
3029
3586
  "rh-font-display rh-font-medium rh-select-none",
3030
- sizeClasses8[size],
3587
+ sizeClasses9[size],
3031
3588
  variantClasses2[variant],
3032
3589
  className
3033
3590
  ].filter(Boolean).join(" "),
@@ -3094,7 +3651,7 @@ var hoverInactivePresetClasses = {
3094
3651
  info: "hover:rh-bg-info/20 hover:rh-border-info/50",
3095
3652
  neutral: "hover:rh-bg-neutral/20 hover:rh-border-neutral/50"
3096
3653
  };
3097
- var sizeClasses9 = {
3654
+ var sizeClasses10 = {
3098
3655
  sm: "rh-text-xs rh-px-2 rh-py-0.5 rh-gap-1",
3099
3656
  md: "rh-text-sm rh-px-2.5 rh-py-1 rh-gap-1.5",
3100
3657
  lg: "rh-text-sm rh-px-3 rh-py-1.5 rh-gap-1.5"
@@ -3141,7 +3698,7 @@ var Tag = forwardRef(function Tag2({
3141
3698
  "rh-transition-colors rh-duration-150",
3142
3699
  "rh-cursor-pointer",
3143
3700
  clickable ? "rh-cursor-pointer" : "",
3144
- sizeClasses9[size],
3701
+ sizeClasses10[size],
3145
3702
  colorClasses3,
3146
3703
  hoverClasses,
3147
3704
  disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-pointer-events-none" : "",
@@ -3158,16 +3715,16 @@ var Tag = forwardRef(function Tag2({
3158
3715
  }
3159
3716
  );
3160
3717
  });
3161
- var statusClasses4 = {
3718
+ var statusClasses5 = {
3162
3719
  default: "rh-border-border focus-within:rh-ring-2 focus-within:rh-ring-ring focus-within:rh-ring-offset-2",
3163
3720
  error: "rh-border-danger focus-within:rh-ring-2 focus-within:rh-ring-danger focus-within:rh-ring-offset-2"
3164
3721
  };
3165
- var sizeClasses10 = {
3722
+ var sizeClasses11 = {
3166
3723
  sm: "rh-min-h-[36px] rh-text-sm rh-px-2 rh-py-1",
3167
3724
  md: "rh-h-[44px] rh-text-sm rh-px-2 rh-py-[6px]",
3168
3725
  lg: "rh-min-h-[52px] rh-text-base rh-px-3 rh-py-2"
3169
3726
  };
3170
- var radiusClasses6 = {
3727
+ var radiusClasses7 = {
3171
3728
  none: "rh-rounded-none",
3172
3729
  xxs: "rh-rounded-xxs",
3173
3730
  xs: "rh-rounded-xs",
@@ -3177,7 +3734,7 @@ var radiusClasses6 = {
3177
3734
  xl: "rh-rounded-xl",
3178
3735
  full: "rh-rounded-full"
3179
3736
  };
3180
- var helperStatusClasses4 = {
3737
+ var helperStatusClasses5 = {
3181
3738
  default: "rh-text-text-muted",
3182
3739
  error: "rh-text-danger"
3183
3740
  };
@@ -3196,7 +3753,7 @@ var addButtonSizeClasses = {
3196
3753
  md: "rh-w-5 rh-h-5",
3197
3754
  lg: "rh-w-5 rh-h-5"
3198
3755
  };
3199
- var getSubtitleClassName4 = (subtitle) => subtitle.trim() === "*" ? "rh-text-danger" : "rh-text-text-muted";
3756
+ var getSubtitleClassName5 = (subtitle) => subtitle.trim() === "*" ? "rh-text-danger" : "rh-text-text-muted";
3200
3757
  var TagInput = forwardRef(function TagInput2({
3201
3758
  label,
3202
3759
  subtitle,
@@ -3253,7 +3810,7 @@ var TagInput = forwardRef(function TagInput2({
3253
3810
  children: [
3254
3811
  label && /* @__PURE__ */ jsxs("label", { htmlFor: inputId, className: "rh-flex rh-items-baseline rh-gap-1", children: [
3255
3812
  /* @__PURE__ */ jsx("span", { className: "rh-text-sm rh-font-semibold rh-text-text", children: label }),
3256
- subtitle && /* @__PURE__ */ jsx("span", { className: `rh-text-sm ${getSubtitleClassName4(subtitle)}`, children: subtitle })
3813
+ subtitle && /* @__PURE__ */ jsx("span", { className: `rh-text-sm ${getSubtitleClassName5(subtitle)}`, children: subtitle })
3257
3814
  ] }),
3258
3815
  /* @__PURE__ */ jsxs(
3259
3816
  "div",
@@ -3263,9 +3820,9 @@ var TagInput = forwardRef(function TagInput2({
3263
3820
  "rh-flex rh-flex-row rh-items-center rh-justify-between rh-gap-2",
3264
3821
  "rh-border rh-bg-surface rh-font-body",
3265
3822
  "rh-transition-colors rh-duration-150",
3266
- statusClasses4[status],
3267
- radiusClasses6[radius],
3268
- sizeClasses10[size],
3823
+ statusClasses5[status],
3824
+ radiusClasses7[radius],
3825
+ sizeClasses11[size],
3269
3826
  disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "rh-cursor-pointer",
3270
3827
  className
3271
3828
  ].filter(Boolean).join(" "),
@@ -3428,7 +3985,7 @@ var TagInput = forwardRef(function TagInput2({
3428
3985
  id: `${inputId}-helper`,
3429
3986
  className: [
3430
3987
  "rh-flex rh-items-center rh-gap-1 rh-text-xs",
3431
- helperStatusClasses4[status]
3988
+ helperStatusClasses5[status]
3432
3989
  ].join(" "),
3433
3990
  children: helperText
3434
3991
  }
@@ -3535,12 +4092,12 @@ var PRESET_COLORS5 = /* @__PURE__ */ new Set([
3535
4092
  "info"
3536
4093
  ]);
3537
4094
  var isPresetColor5 = (color) => PRESET_COLORS5.has(color);
3538
- var sizeClasses11 = {
4095
+ var sizeClasses12 = {
3539
4096
  sm: { container: "rh-h-8", button: "rh-px-2 rh-text-xs" },
3540
4097
  md: { container: "rh-h-9", button: "rh-px-3 rh-text-sm" },
3541
4098
  lg: { container: "rh-h-10", button: "rh-px-4 rh-text-sm" }
3542
4099
  };
3543
- var radiusClasses7 = {
4100
+ var radiusClasses8 = {
3544
4101
  none: "rh-rounded-none",
3545
4102
  xs: "rh-rounded-xs",
3546
4103
  sm: "rh-rounded-sm",
@@ -3573,8 +4130,8 @@ function ToggleGroupInner({
3573
4130
  className: [
3574
4131
  "rh-inline-flex rh-items-center rh-bg-muted rh-overflow-hidden",
3575
4132
  "rh-p-1 rh-gap-0.5",
3576
- radiusClasses7[radius],
3577
- sizeClasses11[size].container,
4133
+ radiusClasses8[radius],
4134
+ sizeClasses12[size].container,
3578
4135
  disabled ? "rh-opacity-50 rh-cursor-not-allowed" : "",
3579
4136
  className
3580
4137
  ].filter(Boolean).join(" "),
@@ -3596,8 +4153,8 @@ function ToggleGroupInner({
3596
4153
  "rh-border-0 rh-font-display rh-font-medium",
3597
4154
  "rh-transition-all rh-duration-150",
3598
4155
  "focus-visible:rh-outline-none focus-visible:rh-ring-2 focus-visible:rh-ring-ring",
3599
- radiusClasses7[radius],
3600
- sizeClasses11[size].button,
4156
+ radiusClasses8[radius],
4157
+ sizeClasses12[size].button,
3601
4158
  isActive ? "rh-bg-surface rh-text-text rh-shadow-sm" : "rh-bg-transparent rh-text-text-muted",
3602
4159
  !isActive && !isDisabled ? "hover:rh-bg-surface/50" : "",
3603
4160
  isDisabled ? "rh-cursor-not-allowed rh-pointer-events-none" : "rh-cursor-pointer"
@@ -3620,7 +4177,7 @@ var variantClasses3 = {
3620
4177
  outlined: "rh-bg-surface rh-border rh-border-border rh-shadow-none",
3621
4178
  filled: "rh-bg-background rh-border-0 rh-shadow-none"
3622
4179
  };
3623
- var radiusClasses8 = {
4180
+ var radiusClasses9 = {
3624
4181
  none: "rh-rounded-none",
3625
4182
  xs: "rh-rounded-xs",
3626
4183
  sm: "rh-rounded-sm",
@@ -3655,7 +4212,7 @@ var CardRoot = forwardRef(function Card({
3655
4212
  className: [
3656
4213
  "rh-font-body rh-transition-all rh-duration-150",
3657
4214
  variantClasses3[variant],
3658
- radiusClasses8[radius],
4215
+ radiusClasses9[radius],
3659
4216
  paddingClasses[padding],
3660
4217
  isInteractive ? "rh-cursor-pointer hover:rh-shadow-lg hover:rh-scale-[1.01] active:rh-scale-[0.99]" : "",
3661
4218
  disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-pointer-events-none" : "",
@@ -3708,7 +4265,7 @@ var PRESET_COLORS6 = /* @__PURE__ */ new Set([
3708
4265
  "info"
3709
4266
  ]);
3710
4267
  var isPresetColor6 = (color) => PRESET_COLORS6.has(color);
3711
- var sizeClasses12 = {
4268
+ var sizeClasses13 = {
3712
4269
  xs: "rh-w-3 rh-h-3",
3713
4270
  sm: "rh-w-4 rh-h-4",
3714
4271
  md: "rh-w-6 rh-h-6",
@@ -3736,7 +4293,7 @@ var Spinner = forwardRef(function Spinner2({ size = "md", color = "primary", lab
3736
4293
  "aria-label": label,
3737
4294
  className: [
3738
4295
  "rh-inline-flex rh-items-center rh-justify-center",
3739
- sizeClasses12[size],
4296
+ sizeClasses13[size],
3740
4297
  colorClass,
3741
4298
  className
3742
4299
  ].filter(Boolean).join(" "),
@@ -4189,7 +4746,7 @@ var CustomSelect = ({
4189
4746
  )
4190
4747
  ] });
4191
4748
  };
4192
- var sizeClasses13 = {
4749
+ var sizeClasses14 = {
4193
4750
  sm: { cell: "rh-px-2 rh-py-2 rh-text-xs", header: "rh-px-2 rh-py-2 rh-text-xs" },
4194
4751
  md: { cell: "rh-px-3 rh-py-3 rh-text-sm", header: "rh-px-3 rh-py-3 rh-text-xs" },
4195
4752
  lg: { cell: "rh-px-4 rh-py-4 rh-text-sm", header: "rh-px-4 rh-py-3 rh-text-sm" }
@@ -4344,7 +4901,7 @@ function TableInner({
4344
4901
  ...rowPaddingStyle
4345
4902
  },
4346
4903
  className: [
4347
- rowPadding ? "" : sizeClasses13[size].header,
4904
+ rowPadding ? "" : sizeClasses14[size].header,
4348
4905
  alignClasses[column.align || "left"],
4349
4906
  `rh-font-semibold rh-whitespace-nowrap ${headerTextClassName || "rh-text-text-muted"}`,
4350
4907
  stickyHeader ? "rh-sticky rh-top-0 rh-bg-surface rh-z-10" : "",
@@ -4425,7 +4982,7 @@ function TableInner({
4425
4982
  {
4426
4983
  style: { width: column.width, maxWidth: column.maxWidth, ...rowPaddingStyle },
4427
4984
  className: [
4428
- rowPadding ? "" : sizeClasses13[size].cell,
4985
+ rowPadding ? "" : sizeClasses14[size].cell,
4429
4986
  alignClasses[column.align || "left"],
4430
4987
  "rh-text-text"
4431
4988
  ].filter(Boolean).join(" "),
@@ -4919,6 +5476,6 @@ var GridItem = forwardRef(
4919
5476
  }
4920
5477
  );
4921
5478
 
4922
- export { Avatar, Button, Card2 as Card, CardContent, CardFooter, CardHeader, CaretLeftIcon, CaretRightIcon, Checkbox, CloseIcon, Container, DateSelect, DeleteIcon, EditIcon, ErrorIcon, GridContainer, GridItem, IconButton, InfoIcon, NeutralIcon, Pagination, PlusIcon, ProgressBar, Radio, RadioGroup, RadioOption, RehagroProvider, SearchIcon, Select, Spinner, SuccessIcon, Table, Tag, TagInput, TextInput, Toast, ToastContainer, ToastProvider, ToggleGroup, Tooltip, Typography, WarningIcon, useToast };
5479
+ export { Avatar, Button, Card2 as Card, CardContent, CardFooter, CardHeader, CaretLeftIcon, CaretRightIcon, Checkbox, CloseIcon, Container, DateSelect, DeleteIcon, EditIcon, ErrorIcon, GridContainer, GridItem, IconButton, InfoIcon, NeutralIcon, Pagination, PlusIcon, ProgressBar, Radio, RadioGroup, RadioOption, RehagroProvider, SearchIcon, Select, Spinner, SuccessIcon, Table, Tag, TagInput, TextInput, TimePicker, Toast, ToastContainer, ToastProvider, ToggleGroup, Tooltip, Typography, WarningIcon, useToast };
4923
5480
  //# sourceMappingURL=index.mjs.map
4924
5481
  //# sourceMappingURL=index.mjs.map