@onesaz/ui 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +36 -7
- package/dist/index.js +276 -112
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -866,7 +866,7 @@ Caption.displayName = "Caption";
|
|
|
866
866
|
import * as React6 from "react";
|
|
867
867
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
868
868
|
var Button = React6.forwardRef(
|
|
869
|
-
({ className, variant = "default", size = "default", ...props }, ref) => {
|
|
869
|
+
({ className, variant = "default", size = "default", fullWidth = false, ...props }, ref) => {
|
|
870
870
|
return /* @__PURE__ */ jsx6(
|
|
871
871
|
"button",
|
|
872
872
|
{
|
|
@@ -888,6 +888,7 @@ var Button = React6.forwardRef(
|
|
|
888
888
|
"h-11 rounded-md px-8": size === "lg",
|
|
889
889
|
"h-10 w-10": size === "icon"
|
|
890
890
|
},
|
|
891
|
+
fullWidth && "w-full",
|
|
891
892
|
className
|
|
892
893
|
),
|
|
893
894
|
ref,
|
|
@@ -941,7 +942,16 @@ var sizeClasses = {
|
|
|
941
942
|
lg: "h-12 text-base px-4"
|
|
942
943
|
};
|
|
943
944
|
var Input = React7.forwardRef(
|
|
944
|
-
({
|
|
945
|
+
({
|
|
946
|
+
className,
|
|
947
|
+
type,
|
|
948
|
+
inputSize = "md",
|
|
949
|
+
error,
|
|
950
|
+
startAdornment,
|
|
951
|
+
endAdornment,
|
|
952
|
+
containerClassName,
|
|
953
|
+
...props
|
|
954
|
+
}, ref) => {
|
|
945
955
|
const hasAdornment = startAdornment || endAdornment;
|
|
946
956
|
if (hasAdornment) {
|
|
947
957
|
return /* @__PURE__ */ jsxs(
|
|
@@ -952,7 +962,8 @@ var Input = React7.forwardRef(
|
|
|
952
962
|
"bg-background",
|
|
953
963
|
error ? "border-destructive focus-within:ring-2 focus-within:ring-destructive/20" : "border-input focus-within:ring-2 focus-within:ring-ring/20 focus-within:border-ring",
|
|
954
964
|
"transition-colors",
|
|
955
|
-
props.disabled && "opacity-50 cursor-not-allowed bg-muted"
|
|
965
|
+
props.disabled && "opacity-50 cursor-not-allowed bg-muted",
|
|
966
|
+
containerClassName
|
|
956
967
|
),
|
|
957
968
|
children: [
|
|
958
969
|
startAdornment && /* @__PURE__ */ jsx7("div", { className: "flex items-center pl-3 text-muted-foreground", children: startAdornment }),
|
|
@@ -1075,7 +1086,7 @@ var Label = React10.forwardRef(
|
|
|
1075
1086
|
Label.displayName = "Label";
|
|
1076
1087
|
|
|
1077
1088
|
// src/components/text-field.tsx
|
|
1078
|
-
import { jsx as jsx11, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1089
|
+
import { Fragment, jsx as jsx11, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1079
1090
|
var TextField = React11.forwardRef(
|
|
1080
1091
|
({
|
|
1081
1092
|
className,
|
|
@@ -1089,12 +1100,39 @@ var TextField = React11.forwardRef(
|
|
|
1089
1100
|
error,
|
|
1090
1101
|
startAdornment,
|
|
1091
1102
|
endAdornment,
|
|
1103
|
+
inputProps,
|
|
1104
|
+
InputProps,
|
|
1105
|
+
InputLabelProps,
|
|
1106
|
+
inputRef,
|
|
1092
1107
|
...props
|
|
1093
1108
|
}, ref) => {
|
|
1094
1109
|
const generatedId = React11.useId();
|
|
1095
1110
|
const id = idProp || generatedId;
|
|
1096
1111
|
const helperId = `${id}-helper`;
|
|
1097
1112
|
const hasError = error || !!errorMessage;
|
|
1113
|
+
const mergedRef = (node) => {
|
|
1114
|
+
if (typeof ref === "function") ref(node);
|
|
1115
|
+
else if (ref) ref.current = node;
|
|
1116
|
+
if (typeof inputRef === "function") inputRef(node);
|
|
1117
|
+
else if (inputRef) inputRef.current = node;
|
|
1118
|
+
};
|
|
1119
|
+
const { className: inputPropsClassName, ...restInputProps } = inputProps ?? {};
|
|
1120
|
+
const {
|
|
1121
|
+
className: inputSlotClassName,
|
|
1122
|
+
containerClassName,
|
|
1123
|
+
startAdornment: inputSlotStart,
|
|
1124
|
+
endAdornment: inputSlotEnd,
|
|
1125
|
+
...restInputSlotProps
|
|
1126
|
+
} = InputProps ?? {};
|
|
1127
|
+
const resolvedStartAdornment = inputSlotStart ? /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
1128
|
+
inputSlotStart,
|
|
1129
|
+
startAdornment
|
|
1130
|
+
] }) : startAdornment;
|
|
1131
|
+
const resolvedEndAdornment = inputSlotEnd ? /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
1132
|
+
endAdornment,
|
|
1133
|
+
inputSlotEnd
|
|
1134
|
+
] }) : endAdornment;
|
|
1135
|
+
const resolvedSize = size === "small" ? "sm" : size === "medium" ? "md" : size;
|
|
1098
1136
|
return /* @__PURE__ */ jsxs2("div", { className: cn("grid gap-1.5", fullWidth && "w-full", className), children: [
|
|
1099
1137
|
label && /* @__PURE__ */ jsxs2(
|
|
1100
1138
|
Label,
|
|
@@ -1104,6 +1142,7 @@ var TextField = React11.forwardRef(
|
|
|
1104
1142
|
"text-sm font-medium",
|
|
1105
1143
|
hasError && "text-destructive"
|
|
1106
1144
|
),
|
|
1145
|
+
...InputLabelProps,
|
|
1107
1146
|
children: [
|
|
1108
1147
|
label,
|
|
1109
1148
|
required && /* @__PURE__ */ jsx11("span", { className: "text-destructive ml-0.5", "aria-hidden": "true", children: "*" })
|
|
@@ -1113,15 +1152,19 @@ var TextField = React11.forwardRef(
|
|
|
1113
1152
|
/* @__PURE__ */ jsx11(
|
|
1114
1153
|
Input,
|
|
1115
1154
|
{
|
|
1116
|
-
ref,
|
|
1155
|
+
ref: mergedRef,
|
|
1117
1156
|
id,
|
|
1118
|
-
inputSize:
|
|
1157
|
+
inputSize: resolvedSize,
|
|
1119
1158
|
error: hasError,
|
|
1120
|
-
startAdornment,
|
|
1121
|
-
endAdornment,
|
|
1159
|
+
startAdornment: resolvedStartAdornment,
|
|
1160
|
+
endAdornment: resolvedEndAdornment,
|
|
1122
1161
|
"aria-describedby": helperText || errorMessage ? helperId : void 0,
|
|
1123
1162
|
"aria-invalid": hasError,
|
|
1124
|
-
|
|
1163
|
+
className: cn(inputSlotClassName, inputPropsClassName),
|
|
1164
|
+
containerClassName,
|
|
1165
|
+
...props,
|
|
1166
|
+
...restInputSlotProps,
|
|
1167
|
+
...restInputProps
|
|
1125
1168
|
}
|
|
1126
1169
|
),
|
|
1127
1170
|
(helperText || errorMessage) && /* @__PURE__ */ jsx11(
|
|
@@ -2036,12 +2079,12 @@ Spinner.displayName = "Spinner";
|
|
|
2036
2079
|
import * as React23 from "react";
|
|
2037
2080
|
import { jsx as jsx23, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2038
2081
|
var variantStyles2 = {
|
|
2039
|
-
default: "bg-muted border-border
|
|
2040
|
-
info: "bg-blue-50 dark:bg-blue-950/30 border-blue-200 dark:border-blue-800
|
|
2041
|
-
success: "bg-green-50 dark:bg-green-950/30 border-green-200 dark:border-green-800
|
|
2042
|
-
warning: "bg-yellow-50 dark:bg-yellow-950/30 border-yellow-200 dark:border-yellow-800
|
|
2043
|
-
error: "bg-red-50 dark:bg-red-950/30 border-red-200 dark:border-red-800
|
|
2044
|
-
destructive: "bg-red-50 dark:bg-red-950/30 border-red-200 dark:border-red-800
|
|
2082
|
+
default: "bg-muted border-border",
|
|
2083
|
+
info: "bg-blue-50 dark:bg-blue-950/30 border-blue-200 dark:border-blue-800",
|
|
2084
|
+
success: "bg-green-50 dark:bg-green-950/30 border-green-200 dark:border-green-800",
|
|
2085
|
+
warning: "bg-yellow-50 dark:bg-yellow-950/30 border-yellow-200 dark:border-yellow-800",
|
|
2086
|
+
error: "bg-red-50 dark:bg-red-950/30 border-red-200 dark:border-red-800",
|
|
2087
|
+
destructive: "bg-red-50 dark:bg-red-950/30 border-red-200 dark:border-red-800"
|
|
2045
2088
|
};
|
|
2046
2089
|
var iconColors = {
|
|
2047
2090
|
default: "text-muted-foreground",
|
|
@@ -2101,7 +2144,7 @@ var Alert = React23.forwardRef(
|
|
|
2101
2144
|
ref,
|
|
2102
2145
|
role: "alert",
|
|
2103
2146
|
className: cn(
|
|
2104
|
-
"relative flex items-start gap-3 rounded-lg border p-4",
|
|
2147
|
+
"relative flex items-start gap-3 rounded-lg border p-4 text-foreground",
|
|
2105
2148
|
variantStyles2[variant],
|
|
2106
2149
|
className
|
|
2107
2150
|
),
|
|
@@ -2146,7 +2189,7 @@ var AlertTitle = React23.forwardRef(
|
|
|
2146
2189
|
"h5",
|
|
2147
2190
|
{
|
|
2148
2191
|
ref,
|
|
2149
|
-
className: cn("font-semibold leading-none tracking-tight", className),
|
|
2192
|
+
className: cn("font-semibold leading-none tracking-tight text-foreground", className),
|
|
2150
2193
|
...props,
|
|
2151
2194
|
children
|
|
2152
2195
|
}
|
|
@@ -2158,7 +2201,7 @@ var AlertDescription = React23.forwardRef(
|
|
|
2158
2201
|
"p",
|
|
2159
2202
|
{
|
|
2160
2203
|
ref,
|
|
2161
|
-
className: cn("mt-1 text-sm
|
|
2204
|
+
className: cn("mt-1 text-sm text-muted-foreground", className),
|
|
2162
2205
|
...props,
|
|
2163
2206
|
children
|
|
2164
2207
|
}
|
|
@@ -2169,7 +2212,7 @@ AlertDescription.displayName = "AlertDescription";
|
|
|
2169
2212
|
// src/components/tooltip.tsx
|
|
2170
2213
|
import * as React24 from "react";
|
|
2171
2214
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
2172
|
-
import { Fragment, jsx as jsx24, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2215
|
+
import { Fragment as Fragment2, jsx as jsx24, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2173
2216
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
2174
2217
|
var TooltipRoot = TooltipPrimitive.Root;
|
|
2175
2218
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
@@ -2220,7 +2263,7 @@ var Tooltip = React24.forwardRef(
|
|
|
2220
2263
|
className
|
|
2221
2264
|
}, ref) => {
|
|
2222
2265
|
if (disabled) {
|
|
2223
|
-
return /* @__PURE__ */ jsx24(
|
|
2266
|
+
return /* @__PURE__ */ jsx24(Fragment2, { children });
|
|
2224
2267
|
}
|
|
2225
2268
|
return /* @__PURE__ */ jsx24(TooltipProvider, { children: /* @__PURE__ */ jsxs10(
|
|
2226
2269
|
TooltipRoot,
|
|
@@ -2916,7 +2959,7 @@ var PaginationNamespace = Object.assign(Pagination, {
|
|
|
2916
2959
|
|
|
2917
2960
|
// src/components/combobox/index.tsx
|
|
2918
2961
|
import * as React30 from "react";
|
|
2919
|
-
import { Fragment as
|
|
2962
|
+
import { Fragment as Fragment3, jsx as jsx30, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2920
2963
|
function isMultipleProps(props) {
|
|
2921
2964
|
return props.multiple === true;
|
|
2922
2965
|
}
|
|
@@ -2928,55 +2971,66 @@ var Combobox = React30.forwardRef(
|
|
|
2928
2971
|
searchPlaceholder = "Search...",
|
|
2929
2972
|
emptyMessage = "No results found.",
|
|
2930
2973
|
disabled = false,
|
|
2974
|
+
clearable = true,
|
|
2975
|
+
openOnFocus = true,
|
|
2931
2976
|
className
|
|
2932
2977
|
} = props;
|
|
2933
2978
|
const [open, setOpen] = React30.useState(false);
|
|
2934
|
-
const [
|
|
2979
|
+
const [internalSearch, setInternalSearch] = React30.useState("");
|
|
2935
2980
|
const containerRef = React30.useRef(null);
|
|
2981
|
+
const searchInputRef = React30.useRef(null);
|
|
2936
2982
|
const isMultiple = isMultipleProps(props);
|
|
2937
|
-
const
|
|
2938
|
-
|
|
2939
|
-
);
|
|
2940
|
-
const [internalMultiValue, setInternalMultiValue] = React30.useState(
|
|
2941
|
-
|
|
2942
|
-
);
|
|
2943
|
-
const singleValue = !isMultiple ? props.value !== void 0 ? props.value : internalSingleValue : "";
|
|
2983
|
+
const selectAll = isMultiple ? props.selectAll ?? false : false;
|
|
2984
|
+
const selectAllLabel = isMultiple ? props.selectAllLabel ?? "Select all" : "Select all";
|
|
2985
|
+
const [internalSingleValue, setInternalSingleValue] = React30.useState(!isMultiple ? props.defaultValue ?? null : null);
|
|
2986
|
+
const [internalMultiValue, setInternalMultiValue] = React30.useState(isMultiple ? props.defaultValue ?? [] : []);
|
|
2987
|
+
const singleValue = !isMultiple ? props.value !== void 0 ? props.value : internalSingleValue : null;
|
|
2944
2988
|
const multiValue = isMultiple ? props.value !== void 0 ? props.value : internalMultiValue : [];
|
|
2989
|
+
const search = props.inputValue !== void 0 ? props.inputValue : internalSearch;
|
|
2945
2990
|
const filteredOptions = React30.useMemo(() => {
|
|
2946
2991
|
if (!search) return options;
|
|
2947
2992
|
return options.filter(
|
|
2948
2993
|
(option) => option.label.toLowerCase().includes(search.toLowerCase())
|
|
2949
2994
|
);
|
|
2950
2995
|
}, [options, search]);
|
|
2951
|
-
const
|
|
2952
|
-
const
|
|
2953
|
-
|
|
2996
|
+
const selectedOptions = isMultiple ? multiValue : [];
|
|
2997
|
+
const selectableOptions = React30.useMemo(
|
|
2998
|
+
() => options.filter((option) => !option.disabled),
|
|
2999
|
+
[options]
|
|
3000
|
+
);
|
|
3001
|
+
const allSelected = isMultiple && selectableOptions.length > 0 && selectableOptions.every(
|
|
3002
|
+
(option) => multiValue.some((item) => item.value === option.value)
|
|
3003
|
+
);
|
|
3004
|
+
const handleSingleSelect = (option) => {
|
|
2954
3005
|
if (!isMultiple) {
|
|
2955
3006
|
if (props.value === void 0) {
|
|
2956
|
-
setInternalSingleValue(
|
|
3007
|
+
setInternalSingleValue(option);
|
|
2957
3008
|
}
|
|
2958
|
-
props.
|
|
3009
|
+
props.onChange?.(option);
|
|
2959
3010
|
setOpen(false);
|
|
2960
|
-
|
|
3011
|
+
if (props.inputValue === void 0) {
|
|
3012
|
+
setInternalSearch("");
|
|
3013
|
+
}
|
|
2961
3014
|
}
|
|
2962
3015
|
};
|
|
2963
|
-
const handleMultiSelect = (
|
|
3016
|
+
const handleMultiSelect = (option) => {
|
|
2964
3017
|
if (isMultiple) {
|
|
2965
|
-
const
|
|
3018
|
+
const exists = multiValue.some((item) => item.value === option.value);
|
|
3019
|
+
const newValue = exists ? multiValue.filter((item) => item.value !== option.value) : [...multiValue, option];
|
|
2966
3020
|
if (props.value === void 0) {
|
|
2967
3021
|
setInternalMultiValue(newValue);
|
|
2968
3022
|
}
|
|
2969
|
-
props.
|
|
3023
|
+
props.onChange?.(newValue);
|
|
2970
3024
|
}
|
|
2971
3025
|
};
|
|
2972
3026
|
const handleRemoveItem = (optionValue, e) => {
|
|
2973
3027
|
e.stopPropagation();
|
|
2974
3028
|
if (isMultiple) {
|
|
2975
|
-
const newValue = multiValue.filter((v) => v !== optionValue);
|
|
3029
|
+
const newValue = multiValue.filter((v) => v.value !== optionValue);
|
|
2976
3030
|
if (props.value === void 0) {
|
|
2977
3031
|
setInternalMultiValue(newValue);
|
|
2978
3032
|
}
|
|
2979
|
-
props.
|
|
3033
|
+
props.onChange?.(newValue);
|
|
2980
3034
|
}
|
|
2981
3035
|
};
|
|
2982
3036
|
const handleClearAll = (e) => {
|
|
@@ -2985,7 +3039,28 @@ var Combobox = React30.forwardRef(
|
|
|
2985
3039
|
if (props.value === void 0) {
|
|
2986
3040
|
setInternalMultiValue([]);
|
|
2987
3041
|
}
|
|
2988
|
-
props.
|
|
3042
|
+
props.onChange?.([]);
|
|
3043
|
+
}
|
|
3044
|
+
};
|
|
3045
|
+
const handleSelectAll = (e) => {
|
|
3046
|
+
e.stopPropagation();
|
|
3047
|
+
if (!isMultiple) return;
|
|
3048
|
+
const nextValue = allSelected ? [] : selectableOptions;
|
|
3049
|
+
if (props.value === void 0) {
|
|
3050
|
+
setInternalMultiValue(nextValue);
|
|
3051
|
+
}
|
|
3052
|
+
props.onChange?.(nextValue);
|
|
3053
|
+
};
|
|
3054
|
+
const handleClearSingle = (e) => {
|
|
3055
|
+
e.stopPropagation();
|
|
3056
|
+
if (!isMultiple) {
|
|
3057
|
+
if (props.value === void 0) {
|
|
3058
|
+
setInternalSingleValue(null);
|
|
3059
|
+
}
|
|
3060
|
+
props.onChange?.(null);
|
|
3061
|
+
if (props.inputValue === void 0) {
|
|
3062
|
+
setInternalSearch("");
|
|
3063
|
+
}
|
|
2989
3064
|
}
|
|
2990
3065
|
};
|
|
2991
3066
|
React30.useEffect(() => {
|
|
@@ -2997,6 +3072,19 @@ var Combobox = React30.forwardRef(
|
|
|
2997
3072
|
document.addEventListener("mousedown", handleClickOutside);
|
|
2998
3073
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
2999
3074
|
}, []);
|
|
3075
|
+
React30.useEffect(() => {
|
|
3076
|
+
if (open) {
|
|
3077
|
+
searchInputRef.current?.focus();
|
|
3078
|
+
}
|
|
3079
|
+
}, [open]);
|
|
3080
|
+
React30.useImperativeHandle(
|
|
3081
|
+
ref,
|
|
3082
|
+
() => searchInputRef.current,
|
|
3083
|
+
[]
|
|
3084
|
+
);
|
|
3085
|
+
const setSearchRef = (node) => {
|
|
3086
|
+
searchInputRef.current = node;
|
|
3087
|
+
};
|
|
3000
3088
|
const maxDisplayItems = isMultiple ? props.maxDisplayItems ?? 3 : 0;
|
|
3001
3089
|
const displayedOptions = selectedOptions.slice(0, maxDisplayItems);
|
|
3002
3090
|
const remainingCount = selectedOptions.length - maxDisplayItems;
|
|
@@ -3018,7 +3106,7 @@ var Combobox = React30.forwardRef(
|
|
|
3018
3106
|
className
|
|
3019
3107
|
),
|
|
3020
3108
|
children: [
|
|
3021
|
-
isMultiple ? /* @__PURE__ */ jsx30("div", { className: "flex flex-1 flex-wrap items-center gap-1", children: selectedOptions.length === 0 ? /* @__PURE__ */ jsx30("span", { className: "text-muted-foreground", children: placeholder }) : /* @__PURE__ */ jsxs15(
|
|
3109
|
+
isMultiple ? /* @__PURE__ */ jsx30("div", { className: "flex flex-1 flex-wrap items-center gap-1", children: selectedOptions.length === 0 ? /* @__PURE__ */ jsx30("span", { className: "text-muted-foreground", children: placeholder }) : /* @__PURE__ */ jsxs15(Fragment3, { children: [
|
|
3022
3110
|
displayedOptions.map((option) => /* @__PURE__ */ jsxs15(
|
|
3023
3111
|
"span",
|
|
3024
3112
|
{
|
|
@@ -3057,7 +3145,7 @@ var Combobox = React30.forwardRef(
|
|
|
3057
3145
|
remainingCount,
|
|
3058
3146
|
" more"
|
|
3059
3147
|
] })
|
|
3060
|
-
] }) }) : /* @__PURE__ */ jsx30("span", { className: cn(!
|
|
3148
|
+
] }) }) : /* @__PURE__ */ jsx30("span", { className: cn(!singleValue && "text-muted-foreground"), children: singleValue?.label ?? placeholder }),
|
|
3061
3149
|
/* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-1", children: [
|
|
3062
3150
|
isMultiple && selectedOptions.length > 0 && /* @__PURE__ */ jsx30(
|
|
3063
3151
|
"button",
|
|
@@ -3083,6 +3171,31 @@ var Combobox = React30.forwardRef(
|
|
|
3083
3171
|
)
|
|
3084
3172
|
}
|
|
3085
3173
|
),
|
|
3174
|
+
!isMultiple && clearable && singleValue && /* @__PURE__ */ jsx30(
|
|
3175
|
+
"button",
|
|
3176
|
+
{
|
|
3177
|
+
type: "button",
|
|
3178
|
+
onClick: handleClearSingle,
|
|
3179
|
+
className: "rounded p-0.5 hover:bg-muted",
|
|
3180
|
+
"aria-label": "Clear selection",
|
|
3181
|
+
children: /* @__PURE__ */ jsx30(
|
|
3182
|
+
"svg",
|
|
3183
|
+
{
|
|
3184
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3185
|
+
width: "14",
|
|
3186
|
+
height: "14",
|
|
3187
|
+
viewBox: "0 0 24 24",
|
|
3188
|
+
fill: "none",
|
|
3189
|
+
stroke: "currentColor",
|
|
3190
|
+
strokeWidth: "2",
|
|
3191
|
+
strokeLinecap: "round",
|
|
3192
|
+
strokeLinejoin: "round",
|
|
3193
|
+
className: "opacity-50 hover:opacity-100",
|
|
3194
|
+
children: /* @__PURE__ */ jsx30("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
3195
|
+
}
|
|
3196
|
+
)
|
|
3197
|
+
}
|
|
3198
|
+
),
|
|
3086
3199
|
/* @__PURE__ */ jsx30(
|
|
3087
3200
|
"svg",
|
|
3088
3201
|
{
|
|
@@ -3130,82 +3243,133 @@ var Combobox = React30.forwardRef(
|
|
|
3130
3243
|
/* @__PURE__ */ jsx30(
|
|
3131
3244
|
"input",
|
|
3132
3245
|
{
|
|
3133
|
-
ref,
|
|
3246
|
+
ref: setSearchRef,
|
|
3134
3247
|
className: "flex h-10 w-full bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground",
|
|
3135
3248
|
placeholder: searchPlaceholder,
|
|
3136
3249
|
value: search,
|
|
3137
|
-
onChange: (e) =>
|
|
3250
|
+
onChange: (e) => {
|
|
3251
|
+
if (props.inputValue === void 0) {
|
|
3252
|
+
setInternalSearch(e.target.value);
|
|
3253
|
+
}
|
|
3254
|
+
props.onInputChange?.(e.target.value);
|
|
3255
|
+
},
|
|
3256
|
+
onFocus: () => {
|
|
3257
|
+
if (openOnFocus && !disabled) setOpen(true);
|
|
3258
|
+
}
|
|
3138
3259
|
}
|
|
3139
3260
|
)
|
|
3140
3261
|
] }),
|
|
3141
|
-
/* @__PURE__ */ jsx30("div", { className: "max-h-[300px] overflow-y-auto p-1", children: filteredOptions.length === 0 ? /* @__PURE__ */ jsx30("div", { className: "py-6 text-center text-sm text-muted-foreground", children: emptyMessage }) :
|
|
3142
|
-
|
|
3143
|
-
return /* @__PURE__ */ jsxs15(
|
|
3262
|
+
/* @__PURE__ */ jsx30("div", { className: "max-h-[300px] overflow-y-auto p-1", children: filteredOptions.length === 0 ? /* @__PURE__ */ jsx30("div", { className: "py-6 text-center text-sm text-muted-foreground", children: emptyMessage }) : /* @__PURE__ */ jsxs15(Fragment3, { children: [
|
|
3263
|
+
isMultiple && selectAll && /* @__PURE__ */ jsxs15(
|
|
3144
3264
|
"button",
|
|
3145
3265
|
{
|
|
3146
3266
|
type: "button",
|
|
3147
|
-
|
|
3148
|
-
onClick: () => isMultiple ? handleMultiSelect(option.value) : handleSingleSelect(option.value),
|
|
3267
|
+
onClick: handleSelectAll,
|
|
3149
3268
|
className: cn(
|
|
3150
3269
|
"relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none",
|
|
3151
3270
|
"hover:bg-muted hover:text-foreground",
|
|
3152
3271
|
"focus:bg-muted focus:text-foreground",
|
|
3153
|
-
"
|
|
3154
|
-
isSelected && "bg-muted"
|
|
3272
|
+
allSelected && "bg-muted"
|
|
3155
3273
|
),
|
|
3156
3274
|
children: [
|
|
3157
|
-
/* @__PURE__ */ jsx30("span", { className: "absolute left-2 flex h-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
"svg",
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
)
|
|
3182
|
-
}
|
|
3183
|
-
)
|
|
3184
|
-
) : (
|
|
3185
|
-
// Checkmark for single-select
|
|
3186
|
-
isSelected && /* @__PURE__ */ jsx30(
|
|
3187
|
-
"svg",
|
|
3188
|
-
{
|
|
3189
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
3190
|
-
width: "24",
|
|
3191
|
-
height: "24",
|
|
3192
|
-
viewBox: "0 0 24 24",
|
|
3193
|
-
fill: "none",
|
|
3194
|
-
stroke: "currentColor",
|
|
3195
|
-
strokeWidth: "2",
|
|
3196
|
-
strokeLinecap: "round",
|
|
3197
|
-
strokeLinejoin: "round",
|
|
3198
|
-
className: "h-4 w-4",
|
|
3199
|
-
children: /* @__PURE__ */ jsx30("polyline", { points: "20 6 9 17 4 12" })
|
|
3200
|
-
}
|
|
3201
|
-
)
|
|
3275
|
+
/* @__PURE__ */ jsx30("span", { className: "absolute left-2 flex h-4 w-4 items-center justify-center", children: /* @__PURE__ */ jsx30(
|
|
3276
|
+
"div",
|
|
3277
|
+
{
|
|
3278
|
+
className: cn(
|
|
3279
|
+
"flex h-4 w-4 items-center justify-center rounded border border-input",
|
|
3280
|
+
allSelected && "bg-accent border-accent"
|
|
3281
|
+
),
|
|
3282
|
+
children: allSelected && /* @__PURE__ */ jsx30(
|
|
3283
|
+
"svg",
|
|
3284
|
+
{
|
|
3285
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3286
|
+
width: "24",
|
|
3287
|
+
height: "24",
|
|
3288
|
+
viewBox: "0 0 24 24",
|
|
3289
|
+
fill: "none",
|
|
3290
|
+
stroke: "white",
|
|
3291
|
+
strokeWidth: "3",
|
|
3292
|
+
strokeLinecap: "round",
|
|
3293
|
+
strokeLinejoin: "round",
|
|
3294
|
+
className: "h-3 w-3",
|
|
3295
|
+
children: /* @__PURE__ */ jsx30("polyline", { points: "20 6 9 17 4 12" })
|
|
3296
|
+
}
|
|
3297
|
+
)
|
|
3298
|
+
}
|
|
3202
3299
|
) }),
|
|
3203
|
-
|
|
3300
|
+
selectAllLabel
|
|
3204
3301
|
]
|
|
3205
|
-
}
|
|
3206
|
-
|
|
3207
|
-
)
|
|
3208
|
-
|
|
3302
|
+
}
|
|
3303
|
+
),
|
|
3304
|
+
filteredOptions.map((option) => {
|
|
3305
|
+
const isSelected = isMultiple ? multiValue.some((item) => item.value === option.value) : option.value === singleValue?.value;
|
|
3306
|
+
return /* @__PURE__ */ jsxs15(
|
|
3307
|
+
"button",
|
|
3308
|
+
{
|
|
3309
|
+
type: "button",
|
|
3310
|
+
disabled: option.disabled,
|
|
3311
|
+
onClick: () => isMultiple ? handleMultiSelect(option) : handleSingleSelect(option),
|
|
3312
|
+
className: cn(
|
|
3313
|
+
"relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none",
|
|
3314
|
+
"hover:bg-muted hover:text-foreground",
|
|
3315
|
+
"focus:bg-muted focus:text-foreground",
|
|
3316
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
3317
|
+
isSelected && "bg-muted"
|
|
3318
|
+
),
|
|
3319
|
+
children: [
|
|
3320
|
+
/* @__PURE__ */ jsx30("span", { className: "absolute left-2 flex h-4 w-4 items-center justify-center", children: isMultiple ? (
|
|
3321
|
+
// Checkbox for multi-select
|
|
3322
|
+
/* @__PURE__ */ jsx30(
|
|
3323
|
+
"div",
|
|
3324
|
+
{
|
|
3325
|
+
className: cn(
|
|
3326
|
+
"flex h-4 w-4 items-center justify-center rounded border border-input",
|
|
3327
|
+
isSelected && "bg-accent border-accent"
|
|
3328
|
+
),
|
|
3329
|
+
children: isSelected && /* @__PURE__ */ jsx30(
|
|
3330
|
+
"svg",
|
|
3331
|
+
{
|
|
3332
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3333
|
+
width: "24",
|
|
3334
|
+
height: "24",
|
|
3335
|
+
viewBox: "0 0 24 24",
|
|
3336
|
+
fill: "none",
|
|
3337
|
+
stroke: "white",
|
|
3338
|
+
strokeWidth: "3",
|
|
3339
|
+
strokeLinecap: "round",
|
|
3340
|
+
strokeLinejoin: "round",
|
|
3341
|
+
className: "h-3 w-3",
|
|
3342
|
+
children: /* @__PURE__ */ jsx30("polyline", { points: "20 6 9 17 4 12" })
|
|
3343
|
+
}
|
|
3344
|
+
)
|
|
3345
|
+
}
|
|
3346
|
+
)
|
|
3347
|
+
) : (
|
|
3348
|
+
// Checkmark for single-select
|
|
3349
|
+
isSelected && /* @__PURE__ */ jsx30(
|
|
3350
|
+
"svg",
|
|
3351
|
+
{
|
|
3352
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
3353
|
+
width: "24",
|
|
3354
|
+
height: "24",
|
|
3355
|
+
viewBox: "0 0 24 24",
|
|
3356
|
+
fill: "none",
|
|
3357
|
+
stroke: "currentColor",
|
|
3358
|
+
strokeWidth: "2",
|
|
3359
|
+
strokeLinecap: "round",
|
|
3360
|
+
strokeLinejoin: "round",
|
|
3361
|
+
className: "h-4 w-4",
|
|
3362
|
+
children: /* @__PURE__ */ jsx30("polyline", { points: "20 6 9 17 4 12" })
|
|
3363
|
+
}
|
|
3364
|
+
)
|
|
3365
|
+
) }),
|
|
3366
|
+
option.label
|
|
3367
|
+
]
|
|
3368
|
+
},
|
|
3369
|
+
option.value
|
|
3370
|
+
);
|
|
3371
|
+
})
|
|
3372
|
+
] }) })
|
|
3209
3373
|
] })
|
|
3210
3374
|
] });
|
|
3211
3375
|
}
|
|
@@ -4944,7 +5108,7 @@ var SheetFooter = DrawerFooter;
|
|
|
4944
5108
|
|
|
4945
5109
|
// src/components/topbar.tsx
|
|
4946
5110
|
import * as React36 from "react";
|
|
4947
|
-
import { Fragment as
|
|
5111
|
+
import { Fragment as Fragment4, jsx as jsx36, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4948
5112
|
var sizeClasses4 = {
|
|
4949
5113
|
sm: "h-12",
|
|
4950
5114
|
md: "h-14",
|
|
@@ -4972,7 +5136,7 @@ var TopBar = React36.forwardRef(
|
|
|
4972
5136
|
TopBar.displayName = "TopBar";
|
|
4973
5137
|
var TopBarBrand = React36.forwardRef(
|
|
4974
5138
|
({ className, logo, name, href, children, ...props }, ref) => {
|
|
4975
|
-
const content = /* @__PURE__ */ jsxs21(
|
|
5139
|
+
const content = /* @__PURE__ */ jsxs21(Fragment4, { children: [
|
|
4976
5140
|
logo && /* @__PURE__ */ jsx36("span", { className: "shrink-0", children: logo }),
|
|
4977
5141
|
name && /* @__PURE__ */ jsx36("span", { className: "font-semibold text-lg", children: name }),
|
|
4978
5142
|
children
|
|
@@ -5054,7 +5218,7 @@ TopBarDivider.displayName = "TopBarDivider";
|
|
|
5054
5218
|
|
|
5055
5219
|
// src/components/sidebar.tsx
|
|
5056
5220
|
import * as React37 from "react";
|
|
5057
|
-
import { Fragment as
|
|
5221
|
+
import { Fragment as Fragment5, jsx as jsx37, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
5058
5222
|
var SidebarContext = React37.createContext(void 0);
|
|
5059
5223
|
var useSidebar = () => {
|
|
5060
5224
|
const context = React37.useContext(SidebarContext);
|
|
@@ -5163,9 +5327,9 @@ SidebarGroup.displayName = "SidebarGroup";
|
|
|
5163
5327
|
var SidebarItem = React37.forwardRef(
|
|
5164
5328
|
({ className, icon, active, disabled, badge, onClick, href, children, ...props }, ref) => {
|
|
5165
5329
|
const { collapsed } = useSidebar();
|
|
5166
|
-
const content = /* @__PURE__ */ jsxs22(
|
|
5330
|
+
const content = /* @__PURE__ */ jsxs22(Fragment5, { children: [
|
|
5167
5331
|
icon && /* @__PURE__ */ jsx37("span", { className: cn("shrink-0", collapsed ? "mx-auto" : ""), children: icon }),
|
|
5168
|
-
!collapsed && /* @__PURE__ */ jsxs22(
|
|
5332
|
+
!collapsed && /* @__PURE__ */ jsxs22(Fragment5, { children: [
|
|
5169
5333
|
/* @__PURE__ */ jsx37("span", { className: "flex-1 truncate", children }),
|
|
5170
5334
|
badge && /* @__PURE__ */ jsx37("span", { className: "shrink-0", children: badge })
|
|
5171
5335
|
] })
|
|
@@ -5286,7 +5450,7 @@ SidebarToggle.displayName = "SidebarToggle";
|
|
|
5286
5450
|
|
|
5287
5451
|
// src/components/sidebar-rail.tsx
|
|
5288
5452
|
import * as React38 from "react";
|
|
5289
|
-
import { Fragment as
|
|
5453
|
+
import { Fragment as Fragment6, jsx as jsx38, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
5290
5454
|
var SidebarRailContext = React38.createContext(void 0);
|
|
5291
5455
|
var useSidebarRail = () => {
|
|
5292
5456
|
const context = React38.useContext(SidebarRailContext);
|
|
@@ -5429,7 +5593,7 @@ var IconRailContent = React38.forwardRef(
|
|
|
5429
5593
|
"div",
|
|
5430
5594
|
{
|
|
5431
5595
|
ref,
|
|
5432
|
-
className: cn("flex-1 flex flex-col items-center py-2 gap-1 overflow-y-auto", className),
|
|
5596
|
+
className: cn("flex-1 flex flex-col items-center py-2 px-2 gap-1 overflow-y-auto", className),
|
|
5433
5597
|
...props,
|
|
5434
5598
|
children
|
|
5435
5599
|
}
|
|
@@ -5576,7 +5740,7 @@ var RailPanelGroup = React38.forwardRef(
|
|
|
5576
5740
|
RailPanelGroup.displayName = "RailPanelGroup";
|
|
5577
5741
|
var RailPanelItem = React38.forwardRef(
|
|
5578
5742
|
({ className, icon, active, disabled, badge, href, children, onClick, ...props }, ref) => {
|
|
5579
|
-
const content = /* @__PURE__ */ jsxs23(
|
|
5743
|
+
const content = /* @__PURE__ */ jsxs23(Fragment6, { children: [
|
|
5580
5744
|
icon && /* @__PURE__ */ jsx38("span", { className: "shrink-0", children: icon }),
|
|
5581
5745
|
/* @__PURE__ */ jsx38("span", { className: "flex-1 truncate", children }),
|
|
5582
5746
|
badge && /* @__PURE__ */ jsx38("span", { className: "shrink-0", children: badge })
|
|
@@ -5634,7 +5798,7 @@ var PlaygroundContent = () => {
|
|
|
5634
5798
|
const [inputValue, setInputValue] = React39.useState("");
|
|
5635
5799
|
const [textareaValue, setTextareaValue] = React39.useState("");
|
|
5636
5800
|
const [selectValue, setSelectValue] = React39.useState("");
|
|
5637
|
-
const [comboboxValue, setComboboxValue] = React39.useState(
|
|
5801
|
+
const [comboboxValue, setComboboxValue] = React39.useState(null);
|
|
5638
5802
|
const comboboxOptions = [
|
|
5639
5803
|
{ value: "react", label: "React" },
|
|
5640
5804
|
{ value: "vue", label: "Vue" },
|
|
@@ -5752,7 +5916,7 @@ var PlaygroundContent = () => {
|
|
|
5752
5916
|
{
|
|
5753
5917
|
options: comboboxOptions,
|
|
5754
5918
|
value: comboboxValue,
|
|
5755
|
-
|
|
5919
|
+
onChange: setComboboxValue,
|
|
5756
5920
|
placeholder: "Search frameworks..."
|
|
5757
5921
|
}
|
|
5758
5922
|
)
|