@rehagro/ui 1.0.56 → 1.0.58
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.d.mts +52 -7
- package/dist/index.d.ts +52 -7
- package/dist/index.js +603 -46
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +605 -49
- package/dist/index.mjs.map +1 -1
- package/dist/native.js.map +1 -1
- package/dist/native.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import React9, { forwardRef, createContext, useState,
|
|
3
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React9, { forwardRef, createContext, useState, useMemo, useRef, useEffect, useCallback, useContext } from 'react';
|
|
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
|
-
"
|
|
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
|
|
@@ -2049,7 +2049,8 @@ var DateSelect = forwardRef(
|
|
|
2049
2049
|
wrapperClassName = "",
|
|
2050
2050
|
startYear,
|
|
2051
2051
|
endYear,
|
|
2052
|
-
backgroundColor
|
|
2052
|
+
backgroundColor,
|
|
2053
|
+
modes
|
|
2053
2054
|
} = props;
|
|
2054
2055
|
const triggerId = React9.useId();
|
|
2055
2056
|
const helperId = React9.useId();
|
|
@@ -2061,7 +2062,14 @@ var DateSelect = forwardRef(
|
|
|
2061
2062
|
);
|
|
2062
2063
|
const isControlled = props.value !== void 0;
|
|
2063
2064
|
const value = isControlled ? props.value ?? internalValue : internalValue;
|
|
2064
|
-
const
|
|
2065
|
+
const availableModes = useMemo(
|
|
2066
|
+
() => modes && modes.length > 0 ? MODE_OPTIONS.filter((o) => modes.includes(o.value)) : MODE_OPTIONS,
|
|
2067
|
+
[modes]
|
|
2068
|
+
);
|
|
2069
|
+
const defaultMode = availableModes[0]?.value ?? "day";
|
|
2070
|
+
const [activeMode, setActiveMode] = useState(
|
|
2071
|
+
availableModes.some((o) => o.value === (value.mode ?? "day")) ? value.mode ?? "day" : defaultMode
|
|
2072
|
+
);
|
|
2065
2073
|
const [selectedYear, setSelectedYear] = useState((/* @__PURE__ */ new Date()).getFullYear());
|
|
2066
2074
|
const [selectedMonth, setSelectedMonth] = useState((/* @__PURE__ */ new Date()).getMonth());
|
|
2067
2075
|
const rightMonth = selectedMonth === 11 ? 0 : selectedMonth + 1;
|
|
@@ -2177,19 +2185,22 @@ var DateSelect = forwardRef(
|
|
|
2177
2185
|
const [lo, hi] = start <= ref2 ? [start, ref2] : [ref2, start];
|
|
2178
2186
|
return date > lo && date < hi;
|
|
2179
2187
|
};
|
|
2180
|
-
const renderModeTabs = () =>
|
|
2181
|
-
|
|
2182
|
-
{
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2188
|
+
const renderModeTabs = () => {
|
|
2189
|
+
if (availableModes.length <= 1) return null;
|
|
2190
|
+
return /* @__PURE__ */ jsx("div", { className: "rh-flex rh-border-b rh-border-border rh-bg-transparent", children: availableModes.map((option) => /* @__PURE__ */ jsx(
|
|
2191
|
+
"button",
|
|
2192
|
+
{
|
|
2193
|
+
onClick: () => setActiveMode(option.value),
|
|
2194
|
+
className: [
|
|
2195
|
+
"rh-flex-1 rh-py-2 rh-px-4 rh-text-sm rh-transition-colors rh-duration-150 rh-text-text rh-font-bold",
|
|
2196
|
+
"rh-border-b-2 -rh-mb-px",
|
|
2197
|
+
activeMode === option.value ? "rh-border-primary" : "rh-border-transparent hover:rh-border-border"
|
|
2198
|
+
].join(" "),
|
|
2199
|
+
children: option.label
|
|
2200
|
+
},
|
|
2201
|
+
option.value
|
|
2202
|
+
)) });
|
|
2203
|
+
};
|
|
2193
2204
|
const renderYearGrid = () => /* @__PURE__ */ jsxs("div", { className: "rh-p-1", children: [
|
|
2194
2205
|
/* @__PURE__ */ jsxs("div", { className: "rh-flex rh-items-center rh-justify-between", children: [
|
|
2195
2206
|
/* @__PURE__ */ jsx(
|
|
@@ -2716,7 +2727,7 @@ var DateSelect = forwardRef(
|
|
|
2716
2727
|
},
|
|
2717
2728
|
children: [
|
|
2718
2729
|
renderModeTabs(),
|
|
2719
|
-
/* @__PURE__ */ jsx("div", { className: "rh-mt-2", children: renderContent() })
|
|
2730
|
+
/* @__PURE__ */ jsx("div", { className: availableModes.length > 1 ? "rh-mt-2" : "", children: renderContent() })
|
|
2720
2731
|
]
|
|
2721
2732
|
}
|
|
2722
2733
|
),
|
|
@@ -2739,6 +2750,551 @@ var DateSelect = forwardRef(
|
|
|
2739
2750
|
);
|
|
2740
2751
|
}
|
|
2741
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
|
+
var TimePicker = forwardRef(
|
|
2842
|
+
function TimePicker2(props, ref) {
|
|
2843
|
+
const {
|
|
2844
|
+
label,
|
|
2845
|
+
subtitle,
|
|
2846
|
+
placeholder = "Selecione",
|
|
2847
|
+
status = "default",
|
|
2848
|
+
size = "md",
|
|
2849
|
+
radius = "xs",
|
|
2850
|
+
helperText,
|
|
2851
|
+
disabled = false,
|
|
2852
|
+
className = "",
|
|
2853
|
+
wrapperClassName = "",
|
|
2854
|
+
backgroundColor,
|
|
2855
|
+
presentation = "dropdown"
|
|
2856
|
+
} = props;
|
|
2857
|
+
const triggerId = React9.useId();
|
|
2858
|
+
const helperId = React9.useId();
|
|
2859
|
+
const isControlled = props.value !== void 0;
|
|
2860
|
+
const [internalValue, setInternalValue] = useState(
|
|
2861
|
+
props.defaultValue ?? null
|
|
2862
|
+
);
|
|
2863
|
+
const committedValue = isControlled ? props.value ?? null : internalValue;
|
|
2864
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
2865
|
+
const [isHelperDismissed, setIsHelperDismissed] = useState(false);
|
|
2866
|
+
const [dropdownAlign, setDropdownAlign] = useState("left");
|
|
2867
|
+
const [clockStep, setClockStep] = useState("hour");
|
|
2868
|
+
const [isManualClockInput, setIsManualClockInput] = useState(false);
|
|
2869
|
+
const [hasPendingValue, setHasPendingValue] = useState(committedValue != null);
|
|
2870
|
+
const [pendingHour, setPendingHour] = useState(committedValue?.hour ?? 0);
|
|
2871
|
+
const [pendingMinute, setPendingMinute] = useState(committedValue?.minute ?? 0);
|
|
2872
|
+
const wrapperRef = useRef(null);
|
|
2873
|
+
const innerRef = useRef(null);
|
|
2874
|
+
const dropdownRef = useRef(null);
|
|
2875
|
+
const hourColRef = useRef(null);
|
|
2876
|
+
const minuteColRef = useRef(null);
|
|
2877
|
+
React9.useImperativeHandle(ref, () => innerRef.current);
|
|
2878
|
+
const visualStatus = helperText && isHelperDismissed ? "default" : status;
|
|
2879
|
+
useEffect(() => {
|
|
2880
|
+
if (!isOpen) return;
|
|
2881
|
+
const h = committedValue?.hour ?? 0;
|
|
2882
|
+
const m = committedValue?.minute ?? 0;
|
|
2883
|
+
setPendingHour(h);
|
|
2884
|
+
setPendingMinute(m);
|
|
2885
|
+
setClockStep("hour");
|
|
2886
|
+
setIsManualClockInput(false);
|
|
2887
|
+
setHasPendingValue(committedValue != null);
|
|
2888
|
+
if (presentation === "dropdown") {
|
|
2889
|
+
requestAnimationFrame(() => {
|
|
2890
|
+
scrollToSelected(hourColRef, h);
|
|
2891
|
+
scrollToSelected(minuteColRef, m);
|
|
2892
|
+
});
|
|
2893
|
+
}
|
|
2894
|
+
}, [isOpen]);
|
|
2895
|
+
useEffect(() => {
|
|
2896
|
+
if (!isOpen || presentation !== "dropdown" || !innerRef.current) return;
|
|
2897
|
+
const rect = innerRef.current.getBoundingClientRect();
|
|
2898
|
+
const dropdownW = 240;
|
|
2899
|
+
setDropdownAlign(window.innerWidth - rect.right >= dropdownW ? "left" : "right");
|
|
2900
|
+
}, [isOpen, presentation]);
|
|
2901
|
+
useEffect(() => {
|
|
2902
|
+
if (!isOpen || presentation !== "dropdown") return;
|
|
2903
|
+
const handler = (e) => {
|
|
2904
|
+
if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
|
|
2905
|
+
setIsOpen(false);
|
|
2906
|
+
}
|
|
2907
|
+
};
|
|
2908
|
+
document.addEventListener("mousedown", handler);
|
|
2909
|
+
return () => document.removeEventListener("mousedown", handler);
|
|
2910
|
+
}, [isOpen, presentation]);
|
|
2911
|
+
useEffect(() => {
|
|
2912
|
+
if (!isOpen) return;
|
|
2913
|
+
const handler = (e) => {
|
|
2914
|
+
if (e.key === "Escape") {
|
|
2915
|
+
setIsOpen(false);
|
|
2916
|
+
innerRef.current?.focus();
|
|
2917
|
+
}
|
|
2918
|
+
};
|
|
2919
|
+
document.addEventListener("keydown", handler);
|
|
2920
|
+
return () => document.removeEventListener("keydown", handler);
|
|
2921
|
+
}, [isOpen]);
|
|
2922
|
+
const commit = useCallback(
|
|
2923
|
+
(hour, minute) => {
|
|
2924
|
+
const newValue = { hour, minute };
|
|
2925
|
+
if (helperText) setIsHelperDismissed(true);
|
|
2926
|
+
if (!isControlled) setInternalValue(newValue);
|
|
2927
|
+
props.onChange?.(newValue);
|
|
2928
|
+
setIsOpen(false);
|
|
2929
|
+
},
|
|
2930
|
+
[helperText, isControlled, props]
|
|
2931
|
+
);
|
|
2932
|
+
const handleClear = useCallback(() => {
|
|
2933
|
+
setPendingHour(0);
|
|
2934
|
+
setPendingMinute(0);
|
|
2935
|
+
if (!isControlled) setInternalValue(null);
|
|
2936
|
+
props.onChange?.(void 0);
|
|
2937
|
+
setIsOpen(false);
|
|
2938
|
+
}, [isControlled, props]);
|
|
2939
|
+
const displayText = committedValue != null ? `${pad(committedValue.hour)}:${pad(committedValue.minute)}` : null;
|
|
2940
|
+
const clockDisplayText = hasPendingValue ? `${pad(pendingHour)}:${pad(pendingMinute)}` : "--:--";
|
|
2941
|
+
const closeClockDialog = () => {
|
|
2942
|
+
setIsOpen(false);
|
|
2943
|
+
innerRef.current?.focus();
|
|
2944
|
+
};
|
|
2945
|
+
const handleClockHourChange = (hour) => {
|
|
2946
|
+
setPendingHour(hour);
|
|
2947
|
+
setHasPendingValue(true);
|
|
2948
|
+
setClockStep("minute");
|
|
2949
|
+
};
|
|
2950
|
+
const handleClockMinuteChange = (minute) => {
|
|
2951
|
+
setPendingMinute(minute);
|
|
2952
|
+
setHasPendingValue(true);
|
|
2953
|
+
};
|
|
2954
|
+
const handleManualClockChange = (part, value) => {
|
|
2955
|
+
const numericValue = Number(value.replace(/\D/g, ""));
|
|
2956
|
+
if (Number.isNaN(numericValue)) return;
|
|
2957
|
+
if (part === "hour") {
|
|
2958
|
+
setPendingHour(clampClockPart(numericValue, 23));
|
|
2959
|
+
} else {
|
|
2960
|
+
setPendingMinute(clampClockPart(numericValue, 59));
|
|
2961
|
+
}
|
|
2962
|
+
setHasPendingValue(true);
|
|
2963
|
+
};
|
|
2964
|
+
const clockHourButton = (hour, index, radius2) => {
|
|
2965
|
+
const selected = hasPendingValue && pendingHour === hour;
|
|
2966
|
+
const position = getClockPosition(index, radius2);
|
|
2967
|
+
return /* @__PURE__ */ jsx(
|
|
2968
|
+
"button",
|
|
2969
|
+
{
|
|
2970
|
+
type: "button",
|
|
2971
|
+
"aria-label": `${pad(hour)} horas`,
|
|
2972
|
+
onClick: () => handleClockHourChange(hour),
|
|
2973
|
+
className: [
|
|
2974
|
+
"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",
|
|
2975
|
+
selected ? "rh-bg-primary rh-font-semibold rh-text-surface" : "rh-text-text hover:rh-bg-border/40"
|
|
2976
|
+
].join(" "),
|
|
2977
|
+
style: position,
|
|
2978
|
+
children: pad(hour)
|
|
2979
|
+
},
|
|
2980
|
+
hour
|
|
2981
|
+
);
|
|
2982
|
+
};
|
|
2983
|
+
const clockMinuteButton = (minute, index) => {
|
|
2984
|
+
const selected = hasPendingValue && pendingMinute === minute;
|
|
2985
|
+
const position = getClockPosition(index, 102);
|
|
2986
|
+
return /* @__PURE__ */ jsx(
|
|
2987
|
+
"button",
|
|
2988
|
+
{
|
|
2989
|
+
type: "button",
|
|
2990
|
+
"aria-label": `${pad(minute)} minutos`,
|
|
2991
|
+
onClick: () => handleClockMinuteChange(minute),
|
|
2992
|
+
className: [
|
|
2993
|
+
"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",
|
|
2994
|
+
selected ? "rh-bg-primary rh-font-semibold rh-text-surface" : "rh-text-text hover:rh-bg-border/40"
|
|
2995
|
+
].join(" "),
|
|
2996
|
+
style: position,
|
|
2997
|
+
children: pad(minute)
|
|
2998
|
+
},
|
|
2999
|
+
minute
|
|
3000
|
+
);
|
|
3001
|
+
};
|
|
3002
|
+
return /* @__PURE__ */ jsxs(
|
|
3003
|
+
"div",
|
|
3004
|
+
{
|
|
3005
|
+
ref: wrapperRef,
|
|
3006
|
+
className: ["rh-relative rh-flex rh-flex-col rh-gap-1 rh-font-body", wrapperClassName].filter(Boolean).join(" "),
|
|
3007
|
+
children: [
|
|
3008
|
+
label && /* @__PURE__ */ jsxs("label", { id: `${triggerId}-label`, className: "rh-flex rh-items-baseline rh-gap-1", children: [
|
|
3009
|
+
/* @__PURE__ */ jsx("span", { className: "rh-text-sm rh-font-medium rh-text-text", children: label }),
|
|
3010
|
+
subtitle && /* @__PURE__ */ jsx("span", { className: `rh-text-sm ${getSubtitleClassName4(subtitle)}`, children: subtitle })
|
|
3011
|
+
] }),
|
|
3012
|
+
/* @__PURE__ */ jsxs(
|
|
3013
|
+
"button",
|
|
3014
|
+
{
|
|
3015
|
+
ref: innerRef,
|
|
3016
|
+
id: triggerId,
|
|
3017
|
+
type: "button",
|
|
3018
|
+
role: "combobox",
|
|
3019
|
+
"aria-expanded": isOpen,
|
|
3020
|
+
"aria-haspopup": "dialog",
|
|
3021
|
+
"aria-labelledby": label ? `${triggerId}-label` : void 0,
|
|
3022
|
+
"aria-describedby": helperText ? helperId : void 0,
|
|
3023
|
+
"aria-invalid": visualStatus === "error" || void 0,
|
|
3024
|
+
"aria-disabled": disabled || void 0,
|
|
3025
|
+
disabled,
|
|
3026
|
+
onClick: () => !disabled && setIsOpen((o) => !o),
|
|
3027
|
+
style: backgroundColor ? { backgroundColor } : void 0,
|
|
3028
|
+
className: [
|
|
3029
|
+
"rh-group rh-flex rh-items-center rh-justify-between rh-gap-2",
|
|
3030
|
+
"rh-border rh-font-body",
|
|
3031
|
+
!backgroundColor && "rh-bg-surface",
|
|
3032
|
+
"rh-transition-colors rh-duration-150",
|
|
3033
|
+
"rh-text-left rh-w-full",
|
|
3034
|
+
statusClasses4[visualStatus],
|
|
3035
|
+
radiusClasses6[radius],
|
|
3036
|
+
sizeClasses7[size],
|
|
3037
|
+
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "rh-cursor-pointer",
|
|
3038
|
+
className
|
|
3039
|
+
].filter(Boolean).join(" "),
|
|
3040
|
+
children: [
|
|
3041
|
+
/* @__PURE__ */ jsx(
|
|
3042
|
+
"span",
|
|
3043
|
+
{
|
|
3044
|
+
className: [
|
|
3045
|
+
"rh-flex-1 rh-truncate",
|
|
3046
|
+
displayText ? "rh-text-text" : "rh-text-text-muted group-hover:rh-text-text"
|
|
3047
|
+
].join(" "),
|
|
3048
|
+
children: displayText ?? placeholder
|
|
3049
|
+
}
|
|
3050
|
+
),
|
|
3051
|
+
/* @__PURE__ */ jsx(ClockIcon, {})
|
|
3052
|
+
]
|
|
3053
|
+
}
|
|
3054
|
+
),
|
|
3055
|
+
isOpen && presentation === "dropdown" && /* @__PURE__ */ jsxs(
|
|
3056
|
+
"div",
|
|
3057
|
+
{
|
|
3058
|
+
ref: dropdownRef,
|
|
3059
|
+
role: "dialog",
|
|
3060
|
+
"aria-label": "Seletor de hora",
|
|
3061
|
+
className: [
|
|
3062
|
+
"rh-absolute rh-z-50 rh-mt-1",
|
|
3063
|
+
"rh-bg-surface rh-rounded-xs rh-border rh-border-border",
|
|
3064
|
+
"rh-w-[240px]",
|
|
3065
|
+
dropdownAlign === "left" ? "rh-left-0" : "rh-right-0"
|
|
3066
|
+
].filter(Boolean).join(" "),
|
|
3067
|
+
style: {
|
|
3068
|
+
top: "100%",
|
|
3069
|
+
boxShadow: "0 0 9.6px 0 rgba(8, 11, 18, 0.08)"
|
|
3070
|
+
},
|
|
3071
|
+
children: [
|
|
3072
|
+
/* @__PURE__ */ jsxs("div", { className: "rh-flex rh-border-b rh-border-border", children: [
|
|
3073
|
+
/* @__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" }),
|
|
3074
|
+
/* @__PURE__ */ jsx("div", { className: "rh-w-px rh-bg-border" }),
|
|
3075
|
+
/* @__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" })
|
|
3076
|
+
] }),
|
|
3077
|
+
/* @__PURE__ */ jsxs("div", { className: "rh-flex", style: { height: 216 }, children: [
|
|
3078
|
+
/* @__PURE__ */ jsx(
|
|
3079
|
+
"div",
|
|
3080
|
+
{
|
|
3081
|
+
ref: hourColRef,
|
|
3082
|
+
className: "rh-flex-1 rh-overflow-y-auto rh-py-1 rh-scrollbar-thin",
|
|
3083
|
+
style: { scrollbarWidth: "none" },
|
|
3084
|
+
children: HOURS.map((h) => {
|
|
3085
|
+
const selected = h === pendingHour;
|
|
3086
|
+
return /* @__PURE__ */ jsx(
|
|
3087
|
+
"button",
|
|
3088
|
+
{
|
|
3089
|
+
type: "button",
|
|
3090
|
+
onClick: () => setPendingHour(h),
|
|
3091
|
+
style: { height: ITEM_HEIGHT },
|
|
3092
|
+
className: [
|
|
3093
|
+
"rh-w-full rh-flex rh-items-center rh-justify-center rh-text-sm rh-transition-colors rh-duration-100",
|
|
3094
|
+
selected ? "rh-bg-primary rh-text-surface rh-font-semibold" : "rh-text-text hover:rh-bg-background"
|
|
3095
|
+
].join(" "),
|
|
3096
|
+
children: pad(h)
|
|
3097
|
+
},
|
|
3098
|
+
h
|
|
3099
|
+
);
|
|
3100
|
+
})
|
|
3101
|
+
}
|
|
3102
|
+
),
|
|
3103
|
+
/* @__PURE__ */ jsx("div", { className: "rh-w-px rh-bg-border rh-self-stretch" }),
|
|
3104
|
+
/* @__PURE__ */ jsx(
|
|
3105
|
+
"div",
|
|
3106
|
+
{
|
|
3107
|
+
ref: minuteColRef,
|
|
3108
|
+
className: "rh-flex-1 rh-overflow-y-auto rh-py-1",
|
|
3109
|
+
style: { scrollbarWidth: "none" },
|
|
3110
|
+
children: MINUTES.map((m) => {
|
|
3111
|
+
const selected = m === pendingMinute;
|
|
3112
|
+
return /* @__PURE__ */ jsx(
|
|
3113
|
+
"button",
|
|
3114
|
+
{
|
|
3115
|
+
type: "button",
|
|
3116
|
+
onClick: () => setPendingMinute(m),
|
|
3117
|
+
style: { height: ITEM_HEIGHT },
|
|
3118
|
+
className: [
|
|
3119
|
+
"rh-w-full rh-flex rh-items-center rh-justify-center rh-text-sm rh-transition-colors rh-duration-100",
|
|
3120
|
+
selected ? "rh-bg-primary rh-text-surface rh-font-semibold" : "rh-text-text hover:rh-bg-background"
|
|
3121
|
+
].join(" "),
|
|
3122
|
+
children: pad(m)
|
|
3123
|
+
},
|
|
3124
|
+
m
|
|
3125
|
+
);
|
|
3126
|
+
})
|
|
3127
|
+
}
|
|
3128
|
+
)
|
|
3129
|
+
] }),
|
|
3130
|
+
/* @__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: [
|
|
3131
|
+
/* @__PURE__ */ jsxs(
|
|
3132
|
+
"button",
|
|
3133
|
+
{
|
|
3134
|
+
type: "button",
|
|
3135
|
+
onClick: handleClear,
|
|
3136
|
+
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",
|
|
3137
|
+
children: [
|
|
3138
|
+
/* @__PURE__ */ jsx(EraserIcon2, {}),
|
|
3139
|
+
"Limpar"
|
|
3140
|
+
]
|
|
3141
|
+
}
|
|
3142
|
+
),
|
|
3143
|
+
/* @__PURE__ */ jsx(
|
|
3144
|
+
"button",
|
|
3145
|
+
{
|
|
3146
|
+
type: "button",
|
|
3147
|
+
onClick: () => commit(pendingHour, pendingMinute),
|
|
3148
|
+
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",
|
|
3149
|
+
children: "Aplicar"
|
|
3150
|
+
}
|
|
3151
|
+
)
|
|
3152
|
+
] })
|
|
3153
|
+
]
|
|
3154
|
+
}
|
|
3155
|
+
),
|
|
3156
|
+
isOpen && presentation === "clock" && /* @__PURE__ */ jsx(
|
|
3157
|
+
"div",
|
|
3158
|
+
{
|
|
3159
|
+
role: "presentation",
|
|
3160
|
+
className: "rh-fixed rh-inset-0 rh-z-50 rh-flex rh-items-center rh-justify-center rh-bg-text/50 rh-p-4",
|
|
3161
|
+
onMouseDown: (event) => {
|
|
3162
|
+
if (event.target === event.currentTarget) closeClockDialog();
|
|
3163
|
+
},
|
|
3164
|
+
children: /* @__PURE__ */ jsxs(
|
|
3165
|
+
"div",
|
|
3166
|
+
{
|
|
3167
|
+
ref: dropdownRef,
|
|
3168
|
+
role: "dialog",
|
|
3169
|
+
"aria-modal": "true",
|
|
3170
|
+
"aria-label": "Seletor de hora",
|
|
3171
|
+
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",
|
|
3172
|
+
style: { boxShadow: "0 24px 48px rgb(8 11 18 / 0.24)" },
|
|
3173
|
+
children: [
|
|
3174
|
+
/* @__PURE__ */ jsx("span", { className: "rh-text-sm rh-font-normal rh-uppercase rh-text-text-muted", children: "Selecione a hora" }),
|
|
3175
|
+
/* @__PURE__ */ jsxs("div", { className: "rh-mt-6 rh-flex rh-items-center rh-justify-between", children: [
|
|
3176
|
+
isManualClockInput ? /* @__PURE__ */ jsxs("div", { className: "rh-flex rh-items-center rh-gap-2", children: [
|
|
3177
|
+
/* @__PURE__ */ jsx(
|
|
3178
|
+
"input",
|
|
3179
|
+
{
|
|
3180
|
+
"aria-label": "Hora",
|
|
3181
|
+
inputMode: "numeric",
|
|
3182
|
+
maxLength: 2,
|
|
3183
|
+
value: pad(pendingHour),
|
|
3184
|
+
onChange: (event) => handleManualClockChange("hour", event.target.value),
|
|
3185
|
+
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"
|
|
3186
|
+
}
|
|
3187
|
+
),
|
|
3188
|
+
/* @__PURE__ */ jsx("span", { className: "rh-text-3xl rh-font-semibold rh-text-text-muted", children: ":" }),
|
|
3189
|
+
/* @__PURE__ */ jsx(
|
|
3190
|
+
"input",
|
|
3191
|
+
{
|
|
3192
|
+
"aria-label": "Minuto",
|
|
3193
|
+
inputMode: "numeric",
|
|
3194
|
+
maxLength: 2,
|
|
3195
|
+
value: pad(pendingMinute),
|
|
3196
|
+
onChange: (event) => handleManualClockChange("minute", 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__ */ jsxs("div", { className: "rh-flex rh-items-center rh-gap-1 rh-text-3xl rh-font-semibold", children: [
|
|
3201
|
+
/* @__PURE__ */ jsx(
|
|
3202
|
+
"button",
|
|
3203
|
+
{
|
|
3204
|
+
type: "button",
|
|
3205
|
+
onClick: () => setClockStep("hour"),
|
|
3206
|
+
className: [
|
|
3207
|
+
"rh-rounded-xs rh-px-1 rh-transition-colors rh-duration-150",
|
|
3208
|
+
clockStep === "hour" ? "rh-text-text" : "rh-text-text-muted hover:rh-bg-background"
|
|
3209
|
+
].join(" "),
|
|
3210
|
+
children: clockDisplayText.slice(0, 2)
|
|
3211
|
+
}
|
|
3212
|
+
),
|
|
3213
|
+
/* @__PURE__ */ jsx("span", { className: "rh-text-text-muted", children: ":" }),
|
|
3214
|
+
/* @__PURE__ */ jsx(
|
|
3215
|
+
"button",
|
|
3216
|
+
{
|
|
3217
|
+
type: "button",
|
|
3218
|
+
onClick: () => setClockStep("minute"),
|
|
3219
|
+
className: [
|
|
3220
|
+
"rh-rounded-xs rh-px-1 rh-transition-colors rh-duration-150",
|
|
3221
|
+
clockStep === "minute" ? "rh-text-text" : "rh-text-text-muted hover:rh-bg-background"
|
|
3222
|
+
].join(" "),
|
|
3223
|
+
children: clockDisplayText.slice(3, 5)
|
|
3224
|
+
}
|
|
3225
|
+
)
|
|
3226
|
+
] }),
|
|
3227
|
+
/* @__PURE__ */ jsx(
|
|
3228
|
+
"button",
|
|
3229
|
+
{
|
|
3230
|
+
type: "button",
|
|
3231
|
+
"aria-label": isManualClockInput ? "Voltar ao rel\xF3gio" : "Digitar hor\xE1rio manualmente",
|
|
3232
|
+
onClick: () => setIsManualClockInput((current) => !current),
|
|
3233
|
+
className: "rh-rounded-full rh-p-2 rh-text-text hover:rh-bg-background",
|
|
3234
|
+
children: /* @__PURE__ */ jsx(PencilIcon, {})
|
|
3235
|
+
}
|
|
3236
|
+
)
|
|
3237
|
+
] }),
|
|
3238
|
+
!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: [
|
|
3239
|
+
clockStep === "hour" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3240
|
+
CLOCK_HOURS_OUTER.map(
|
|
3241
|
+
(hour, index) => clockHourButton(hour, index, 102)
|
|
3242
|
+
),
|
|
3243
|
+
CLOCK_HOURS_INNER.map(
|
|
3244
|
+
(hour, index) => clockHourButton(hour, index, 68)
|
|
3245
|
+
)
|
|
3246
|
+
] }) : CLOCK_MINUTES.map(
|
|
3247
|
+
(minute, index) => clockMinuteButton(minute, index)
|
|
3248
|
+
),
|
|
3249
|
+
/* @__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" })
|
|
3250
|
+
] }) }),
|
|
3251
|
+
/* @__PURE__ */ jsxs("div", { className: "rh-mt-8 rh-flex rh-justify-end rh-gap-6", children: [
|
|
3252
|
+
/* @__PURE__ */ jsx(
|
|
3253
|
+
"button",
|
|
3254
|
+
{
|
|
3255
|
+
type: "button",
|
|
3256
|
+
onClick: closeClockDialog,
|
|
3257
|
+
className: "rh-text-base rh-font-medium rh-uppercase rh-text-primary hover:rh-opacity-80",
|
|
3258
|
+
children: "Cancelar"
|
|
3259
|
+
}
|
|
3260
|
+
),
|
|
3261
|
+
/* @__PURE__ */ jsx(
|
|
3262
|
+
"button",
|
|
3263
|
+
{
|
|
3264
|
+
type: "button",
|
|
3265
|
+
onClick: () => {
|
|
3266
|
+
if (hasPendingValue) commit(pendingHour, pendingMinute);
|
|
3267
|
+
else closeClockDialog();
|
|
3268
|
+
},
|
|
3269
|
+
className: "rh-text-base rh-font-medium rh-uppercase rh-text-primary hover:rh-opacity-80",
|
|
3270
|
+
children: "OK"
|
|
3271
|
+
}
|
|
3272
|
+
)
|
|
3273
|
+
] })
|
|
3274
|
+
]
|
|
3275
|
+
}
|
|
3276
|
+
)
|
|
3277
|
+
}
|
|
3278
|
+
),
|
|
3279
|
+
helperText && !isHelperDismissed && /* @__PURE__ */ jsxs(
|
|
3280
|
+
"span",
|
|
3281
|
+
{
|
|
3282
|
+
id: helperId,
|
|
3283
|
+
className: [
|
|
3284
|
+
"rh-flex rh-items-center rh-gap-1 rh-text-xs",
|
|
3285
|
+
helperStatusClasses4[visualStatus]
|
|
3286
|
+
].join(" "),
|
|
3287
|
+
children: [
|
|
3288
|
+
/* @__PURE__ */ jsx(WarningCircleIcon, {}),
|
|
3289
|
+
helperText
|
|
3290
|
+
]
|
|
3291
|
+
}
|
|
3292
|
+
)
|
|
3293
|
+
]
|
|
3294
|
+
}
|
|
3295
|
+
);
|
|
3296
|
+
}
|
|
3297
|
+
);
|
|
2742
3298
|
var variantClasses = {
|
|
2743
3299
|
light: "rh-bg-surface rh-text-text rh-border rh-border-border rh-shadow-md",
|
|
2744
3300
|
default: "rh-bg-primary/10 rh-text-text rh-border rh-border-primary/20 rh-shadow-md",
|
|
@@ -2749,7 +3305,7 @@ var arrowVariantClasses = {
|
|
|
2749
3305
|
default: "rh-border-primary/20 rh-bg-primary/10",
|
|
2750
3306
|
dark: "rh-bg-primary"
|
|
2751
3307
|
};
|
|
2752
|
-
var
|
|
3308
|
+
var sizeClasses8 = {
|
|
2753
3309
|
sm: "rh-px-3 rh-py-1.5 rh-text-xs",
|
|
2754
3310
|
md: "rh-px-4 rh-py-3 rh-text-sm"
|
|
2755
3311
|
};
|
|
@@ -2880,7 +3436,7 @@ var Tooltip = forwardRef(
|
|
|
2880
3436
|
"rh-absolute rh-z-50 rh-w-max rh-max-w-xs rh-rounded-xs",
|
|
2881
3437
|
tooltipPlacementClasses[placement],
|
|
2882
3438
|
variantClasses[variant],
|
|
2883
|
-
|
|
3439
|
+
sizeClasses8[size],
|
|
2884
3440
|
className
|
|
2885
3441
|
].filter(Boolean).join(" "),
|
|
2886
3442
|
children: [
|
|
@@ -2981,7 +3537,7 @@ function getAvatarColors(name) {
|
|
|
2981
3537
|
const index = hash % AVATAR_COLORS.length;
|
|
2982
3538
|
return AVATAR_COLORS[index];
|
|
2983
3539
|
}
|
|
2984
|
-
var
|
|
3540
|
+
var sizeClasses9 = {
|
|
2985
3541
|
sm: "rh-w-8 rh-h-8 rh-text-xs",
|
|
2986
3542
|
md: "rh-w-10 rh-h-10 rh-text-sm",
|
|
2987
3543
|
lg: "rh-w-12 rh-h-12 rh-text-base",
|
|
@@ -3016,7 +3572,7 @@ var Avatar = forwardRef(function Avatar2({ src, alt = "", initials, size = "md",
|
|
|
3016
3572
|
"rh-inline-flex rh-items-center rh-justify-center rh-shrink-0 rh-overflow-hidden",
|
|
3017
3573
|
avatarColors ? "" : "rh-bg-primary rh-text-surface",
|
|
3018
3574
|
"rh-font-display rh-font-medium rh-select-none",
|
|
3019
|
-
|
|
3575
|
+
sizeClasses9[size],
|
|
3020
3576
|
variantClasses2[variant],
|
|
3021
3577
|
className
|
|
3022
3578
|
].filter(Boolean).join(" "),
|
|
@@ -3083,7 +3639,7 @@ var hoverInactivePresetClasses = {
|
|
|
3083
3639
|
info: "hover:rh-bg-info/20 hover:rh-border-info/50",
|
|
3084
3640
|
neutral: "hover:rh-bg-neutral/20 hover:rh-border-neutral/50"
|
|
3085
3641
|
};
|
|
3086
|
-
var
|
|
3642
|
+
var sizeClasses10 = {
|
|
3087
3643
|
sm: "rh-text-xs rh-px-2 rh-py-0.5 rh-gap-1",
|
|
3088
3644
|
md: "rh-text-sm rh-px-2.5 rh-py-1 rh-gap-1.5",
|
|
3089
3645
|
lg: "rh-text-sm rh-px-3 rh-py-1.5 rh-gap-1.5"
|
|
@@ -3130,7 +3686,7 @@ var Tag = forwardRef(function Tag2({
|
|
|
3130
3686
|
"rh-transition-colors rh-duration-150",
|
|
3131
3687
|
"rh-cursor-pointer",
|
|
3132
3688
|
clickable ? "rh-cursor-pointer" : "",
|
|
3133
|
-
|
|
3689
|
+
sizeClasses10[size],
|
|
3134
3690
|
colorClasses3,
|
|
3135
3691
|
hoverClasses,
|
|
3136
3692
|
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-pointer-events-none" : "",
|
|
@@ -3147,16 +3703,16 @@ var Tag = forwardRef(function Tag2({
|
|
|
3147
3703
|
}
|
|
3148
3704
|
);
|
|
3149
3705
|
});
|
|
3150
|
-
var
|
|
3706
|
+
var statusClasses5 = {
|
|
3151
3707
|
default: "rh-border-border focus-within:rh-ring-2 focus-within:rh-ring-ring focus-within:rh-ring-offset-2",
|
|
3152
3708
|
error: "rh-border-danger focus-within:rh-ring-2 focus-within:rh-ring-danger focus-within:rh-ring-offset-2"
|
|
3153
3709
|
};
|
|
3154
|
-
var
|
|
3710
|
+
var sizeClasses11 = {
|
|
3155
3711
|
sm: "rh-min-h-[36px] rh-text-sm rh-px-2 rh-py-1",
|
|
3156
3712
|
md: "rh-h-[44px] rh-text-sm rh-px-2 rh-py-[6px]",
|
|
3157
3713
|
lg: "rh-min-h-[52px] rh-text-base rh-px-3 rh-py-2"
|
|
3158
3714
|
};
|
|
3159
|
-
var
|
|
3715
|
+
var radiusClasses7 = {
|
|
3160
3716
|
none: "rh-rounded-none",
|
|
3161
3717
|
xxs: "rh-rounded-xxs",
|
|
3162
3718
|
xs: "rh-rounded-xs",
|
|
@@ -3166,7 +3722,7 @@ var radiusClasses6 = {
|
|
|
3166
3722
|
xl: "rh-rounded-xl",
|
|
3167
3723
|
full: "rh-rounded-full"
|
|
3168
3724
|
};
|
|
3169
|
-
var
|
|
3725
|
+
var helperStatusClasses5 = {
|
|
3170
3726
|
default: "rh-text-text-muted",
|
|
3171
3727
|
error: "rh-text-danger"
|
|
3172
3728
|
};
|
|
@@ -3185,7 +3741,7 @@ var addButtonSizeClasses = {
|
|
|
3185
3741
|
md: "rh-w-5 rh-h-5",
|
|
3186
3742
|
lg: "rh-w-5 rh-h-5"
|
|
3187
3743
|
};
|
|
3188
|
-
var
|
|
3744
|
+
var getSubtitleClassName5 = (subtitle) => subtitle.trim() === "*" ? "rh-text-danger" : "rh-text-text-muted";
|
|
3189
3745
|
var TagInput = forwardRef(function TagInput2({
|
|
3190
3746
|
label,
|
|
3191
3747
|
subtitle,
|
|
@@ -3242,7 +3798,7 @@ var TagInput = forwardRef(function TagInput2({
|
|
|
3242
3798
|
children: [
|
|
3243
3799
|
label && /* @__PURE__ */ jsxs("label", { htmlFor: inputId, className: "rh-flex rh-items-baseline rh-gap-1", children: [
|
|
3244
3800
|
/* @__PURE__ */ jsx("span", { className: "rh-text-sm rh-font-semibold rh-text-text", children: label }),
|
|
3245
|
-
subtitle && /* @__PURE__ */ jsx("span", { className: `rh-text-sm ${
|
|
3801
|
+
subtitle && /* @__PURE__ */ jsx("span", { className: `rh-text-sm ${getSubtitleClassName5(subtitle)}`, children: subtitle })
|
|
3246
3802
|
] }),
|
|
3247
3803
|
/* @__PURE__ */ jsxs(
|
|
3248
3804
|
"div",
|
|
@@ -3252,9 +3808,9 @@ var TagInput = forwardRef(function TagInput2({
|
|
|
3252
3808
|
"rh-flex rh-flex-row rh-items-center rh-justify-between rh-gap-2",
|
|
3253
3809
|
"rh-border rh-bg-surface rh-font-body",
|
|
3254
3810
|
"rh-transition-colors rh-duration-150",
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3811
|
+
statusClasses5[status],
|
|
3812
|
+
radiusClasses7[radius],
|
|
3813
|
+
sizeClasses11[size],
|
|
3258
3814
|
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-bg-background" : "rh-cursor-pointer",
|
|
3259
3815
|
className
|
|
3260
3816
|
].filter(Boolean).join(" "),
|
|
@@ -3417,7 +3973,7 @@ var TagInput = forwardRef(function TagInput2({
|
|
|
3417
3973
|
id: `${inputId}-helper`,
|
|
3418
3974
|
className: [
|
|
3419
3975
|
"rh-flex rh-items-center rh-gap-1 rh-text-xs",
|
|
3420
|
-
|
|
3976
|
+
helperStatusClasses5[status]
|
|
3421
3977
|
].join(" "),
|
|
3422
3978
|
children: helperText
|
|
3423
3979
|
}
|
|
@@ -3524,12 +4080,12 @@ var PRESET_COLORS5 = /* @__PURE__ */ new Set([
|
|
|
3524
4080
|
"info"
|
|
3525
4081
|
]);
|
|
3526
4082
|
var isPresetColor5 = (color) => PRESET_COLORS5.has(color);
|
|
3527
|
-
var
|
|
4083
|
+
var sizeClasses12 = {
|
|
3528
4084
|
sm: { container: "rh-h-8", button: "rh-px-2 rh-text-xs" },
|
|
3529
4085
|
md: { container: "rh-h-9", button: "rh-px-3 rh-text-sm" },
|
|
3530
4086
|
lg: { container: "rh-h-10", button: "rh-px-4 rh-text-sm" }
|
|
3531
4087
|
};
|
|
3532
|
-
var
|
|
4088
|
+
var radiusClasses8 = {
|
|
3533
4089
|
none: "rh-rounded-none",
|
|
3534
4090
|
xs: "rh-rounded-xs",
|
|
3535
4091
|
sm: "rh-rounded-sm",
|
|
@@ -3562,8 +4118,8 @@ function ToggleGroupInner({
|
|
|
3562
4118
|
className: [
|
|
3563
4119
|
"rh-inline-flex rh-items-center rh-bg-muted rh-overflow-hidden",
|
|
3564
4120
|
"rh-p-1 rh-gap-0.5",
|
|
3565
|
-
|
|
3566
|
-
|
|
4121
|
+
radiusClasses8[radius],
|
|
4122
|
+
sizeClasses12[size].container,
|
|
3567
4123
|
disabled ? "rh-opacity-50 rh-cursor-not-allowed" : "",
|
|
3568
4124
|
className
|
|
3569
4125
|
].filter(Boolean).join(" "),
|
|
@@ -3585,8 +4141,8 @@ function ToggleGroupInner({
|
|
|
3585
4141
|
"rh-border-0 rh-font-display rh-font-medium",
|
|
3586
4142
|
"rh-transition-all rh-duration-150",
|
|
3587
4143
|
"focus-visible:rh-outline-none focus-visible:rh-ring-2 focus-visible:rh-ring-ring",
|
|
3588
|
-
|
|
3589
|
-
|
|
4144
|
+
radiusClasses8[radius],
|
|
4145
|
+
sizeClasses12[size].button,
|
|
3590
4146
|
isActive ? "rh-bg-surface rh-text-text rh-shadow-sm" : "rh-bg-transparent rh-text-text-muted",
|
|
3591
4147
|
!isActive && !isDisabled ? "hover:rh-bg-surface/50" : "",
|
|
3592
4148
|
isDisabled ? "rh-cursor-not-allowed rh-pointer-events-none" : "rh-cursor-pointer"
|
|
@@ -3609,7 +4165,7 @@ var variantClasses3 = {
|
|
|
3609
4165
|
outlined: "rh-bg-surface rh-border rh-border-border rh-shadow-none",
|
|
3610
4166
|
filled: "rh-bg-background rh-border-0 rh-shadow-none"
|
|
3611
4167
|
};
|
|
3612
|
-
var
|
|
4168
|
+
var radiusClasses9 = {
|
|
3613
4169
|
none: "rh-rounded-none",
|
|
3614
4170
|
xs: "rh-rounded-xs",
|
|
3615
4171
|
sm: "rh-rounded-sm",
|
|
@@ -3644,7 +4200,7 @@ var CardRoot = forwardRef(function Card({
|
|
|
3644
4200
|
className: [
|
|
3645
4201
|
"rh-font-body rh-transition-all rh-duration-150",
|
|
3646
4202
|
variantClasses3[variant],
|
|
3647
|
-
|
|
4203
|
+
radiusClasses9[radius],
|
|
3648
4204
|
paddingClasses[padding],
|
|
3649
4205
|
isInteractive ? "rh-cursor-pointer hover:rh-shadow-lg hover:rh-scale-[1.01] active:rh-scale-[0.99]" : "",
|
|
3650
4206
|
disabled ? "rh-opacity-50 rh-cursor-not-allowed rh-pointer-events-none" : "",
|
|
@@ -3697,7 +4253,7 @@ var PRESET_COLORS6 = /* @__PURE__ */ new Set([
|
|
|
3697
4253
|
"info"
|
|
3698
4254
|
]);
|
|
3699
4255
|
var isPresetColor6 = (color) => PRESET_COLORS6.has(color);
|
|
3700
|
-
var
|
|
4256
|
+
var sizeClasses13 = {
|
|
3701
4257
|
xs: "rh-w-3 rh-h-3",
|
|
3702
4258
|
sm: "rh-w-4 rh-h-4",
|
|
3703
4259
|
md: "rh-w-6 rh-h-6",
|
|
@@ -3725,7 +4281,7 @@ var Spinner = forwardRef(function Spinner2({ size = "md", color = "primary", lab
|
|
|
3725
4281
|
"aria-label": label,
|
|
3726
4282
|
className: [
|
|
3727
4283
|
"rh-inline-flex rh-items-center rh-justify-center",
|
|
3728
|
-
|
|
4284
|
+
sizeClasses13[size],
|
|
3729
4285
|
colorClass,
|
|
3730
4286
|
className
|
|
3731
4287
|
].filter(Boolean).join(" "),
|
|
@@ -4178,7 +4734,7 @@ var CustomSelect = ({
|
|
|
4178
4734
|
)
|
|
4179
4735
|
] });
|
|
4180
4736
|
};
|
|
4181
|
-
var
|
|
4737
|
+
var sizeClasses14 = {
|
|
4182
4738
|
sm: { cell: "rh-px-2 rh-py-2 rh-text-xs", header: "rh-px-2 rh-py-2 rh-text-xs" },
|
|
4183
4739
|
md: { cell: "rh-px-3 rh-py-3 rh-text-sm", header: "rh-px-3 rh-py-3 rh-text-xs" },
|
|
4184
4740
|
lg: { cell: "rh-px-4 rh-py-4 rh-text-sm", header: "rh-px-4 rh-py-3 rh-text-sm" }
|
|
@@ -4333,7 +4889,7 @@ function TableInner({
|
|
|
4333
4889
|
...rowPaddingStyle
|
|
4334
4890
|
},
|
|
4335
4891
|
className: [
|
|
4336
|
-
rowPadding ? "" :
|
|
4892
|
+
rowPadding ? "" : sizeClasses14[size].header,
|
|
4337
4893
|
alignClasses[column.align || "left"],
|
|
4338
4894
|
`rh-font-semibold rh-whitespace-nowrap ${headerTextClassName || "rh-text-text-muted"}`,
|
|
4339
4895
|
stickyHeader ? "rh-sticky rh-top-0 rh-bg-surface rh-z-10" : "",
|
|
@@ -4414,7 +4970,7 @@ function TableInner({
|
|
|
4414
4970
|
{
|
|
4415
4971
|
style: { width: column.width, maxWidth: column.maxWidth, ...rowPaddingStyle },
|
|
4416
4972
|
className: [
|
|
4417
|
-
rowPadding ? "" :
|
|
4973
|
+
rowPadding ? "" : sizeClasses14[size].cell,
|
|
4418
4974
|
alignClasses[column.align || "left"],
|
|
4419
4975
|
"rh-text-text"
|
|
4420
4976
|
].filter(Boolean).join(" "),
|
|
@@ -4908,6 +5464,6 @@ var GridItem = forwardRef(
|
|
|
4908
5464
|
}
|
|
4909
5465
|
);
|
|
4910
5466
|
|
|
4911
|
-
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 };
|
|
5467
|
+
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 };
|
|
4912
5468
|
//# sourceMappingURL=index.mjs.map
|
|
4913
5469
|
//# sourceMappingURL=index.mjs.map
|