@rebasepro/ui 0.3.0 → 0.4.0
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/components/Card.d.ts +2 -3
- package/dist/components/FilterChip.d.ts +2 -10
- package/dist/components/VirtualTable/VirtualTableProps.d.ts +8 -2
- package/dist/index.css +1 -1
- package/dist/index.es.js +125 -107
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +124 -106
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -3
- package/src/components/Button.tsx +6 -6
- package/src/components/Card.tsx +1 -1
- package/src/components/DebouncedTextField.tsx +57 -16
- package/src/components/FilterChip.tsx +8 -13
- package/src/components/IconButton.tsx +4 -4
- package/src/components/Tabs.tsx +2 -2
- package/src/components/VirtualTable/VirtualTableHeaderRow.tsx +3 -2
- package/src/components/VirtualTable/VirtualTableProps.tsx +21 -12
- package/src/index.css +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -989,15 +989,15 @@
|
|
|
989
989
|
"border border-transparent bg-surface-300 dark:bg-surface-500 opacity-40 bg-surface-300/40 dark:bg-surface-500/40": t25
|
|
990
990
|
});
|
|
991
991
|
const sizeClasses2 = cls({
|
|
992
|
-
"py-
|
|
993
|
-
"py-
|
|
994
|
-
"py-2 px-
|
|
995
|
-
"py-
|
|
996
|
-
"py-
|
|
992
|
+
"py-1 px-2": size === "small",
|
|
993
|
+
"py-2 px-4": size === "medium",
|
|
994
|
+
"py-2.5 px-5": size === "large",
|
|
995
|
+
"py-3 px-6": size === "xl",
|
|
996
|
+
"py-4 px-10": size === "2xl"
|
|
997
997
|
});
|
|
998
998
|
const iconColorClass = (color === "neutral" || color === "text") && !disabled ? "[&>svg]:text-surface-accent-500 dark:[&>svg]:text-surface-accent-300" : "";
|
|
999
999
|
if (Component) {
|
|
1000
|
-
t30 = /* @__PURE__ */ jsxRuntime.jsxs(Component, { ref, onClick: props.onClick, className: cls(startIcon ? "pl-3" : "", "typography-button h-fit rounded-md whitespace-nowrap inline-flex items-center justify-center p-
|
|
1000
|
+
t30 = /* @__PURE__ */ jsxRuntime.jsxs(Component, { ref, onClick: props.onClick, className: cls(startIcon ? "pl-3" : "", "typography-button h-fit rounded-md whitespace-nowrap inline-flex items-center justify-center p-2 px-4 focus:outline-none transition-all ease-in-out duration-150 gap-2 active:scale-[0.98]", buttonClasses2, sizeClasses2, iconColorClass, className), ...props, children: [
|
|
1001
1001
|
startIcon,
|
|
1002
1002
|
children
|
|
1003
1003
|
] });
|
|
@@ -1006,7 +1006,7 @@
|
|
|
1006
1006
|
t26 = ref;
|
|
1007
1007
|
t27 = props.type ?? "button";
|
|
1008
1008
|
t28 = props.onClick;
|
|
1009
|
-
t29 = cls(startIcon ? "pl-3" : "", "typography-button h-fit rounded-md whitespace-nowrap inline-flex items-center justify-center p-
|
|
1009
|
+
t29 = cls(startIcon ? "pl-3" : "", "typography-button h-fit rounded-md whitespace-nowrap inline-flex items-center justify-center p-2 px-4 focus:outline-none transition-all ease-in-out duration-150 gap-2 active:scale-[0.98]", buttonClasses2, sizeClasses2, iconColorClass, className);
|
|
1010
1010
|
}
|
|
1011
1011
|
$[11] = Component;
|
|
1012
1012
|
$[12] = children;
|
|
@@ -2151,10 +2151,10 @@
|
|
|
2151
2151
|
const baseClasses = "inline-flex items-center justify-center p-2 text-sm font-medium focus:outline-none transition-colors ease-in-out duration-150";
|
|
2152
2152
|
const colorClasses$1 = "text-surface-accent-500 visited:text-surface-accent-500 dark:text-surface-accent-300 dark:visited:text-surface-300";
|
|
2153
2153
|
const sizeClasses$1 = {
|
|
2154
|
-
medium: "w-
|
|
2155
|
-
small: "w-
|
|
2156
|
-
smallest: "w-
|
|
2157
|
-
large: "w-
|
|
2154
|
+
medium: "w-10 !h-10 min-w-10 min-h-10",
|
|
2155
|
+
small: "w-8 !h-8 min-w-8 min-h-8",
|
|
2156
|
+
smallest: "w-6 !h-6 min-w-6 min-h-6",
|
|
2157
|
+
large: "w-12 !h-12 min-w-12 min-h-12"
|
|
2158
2158
|
};
|
|
2159
2159
|
const shapeClasses = {
|
|
2160
2160
|
circular: "rounded-full",
|
|
@@ -3182,49 +3182,80 @@
|
|
|
3182
3182
|
small: "px-2 py-0.5 text-xs",
|
|
3183
3183
|
medium: "px-2.5 py-1 text-xs"
|
|
3184
3184
|
};
|
|
3185
|
-
|
|
3186
|
-
const $ = reactCompilerRuntime.c(
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3185
|
+
const FilterChip = React.forwardRef(function FilterChip2(t0, ref) {
|
|
3186
|
+
const $ = reactCompilerRuntime.c(22);
|
|
3187
|
+
let children;
|
|
3188
|
+
let className;
|
|
3189
|
+
let icon;
|
|
3190
|
+
let onClick;
|
|
3191
|
+
let rest;
|
|
3192
|
+
let t1;
|
|
3193
|
+
let t2;
|
|
3194
|
+
let t3;
|
|
3195
|
+
if ($[0] !== t0) {
|
|
3196
|
+
({
|
|
3197
|
+
children,
|
|
3198
|
+
active: t1,
|
|
3199
|
+
onClick,
|
|
3200
|
+
icon,
|
|
3201
|
+
size: t2,
|
|
3202
|
+
className,
|
|
3203
|
+
disabled: t3,
|
|
3204
|
+
...rest
|
|
3205
|
+
} = t0);
|
|
3206
|
+
$[0] = t0;
|
|
3207
|
+
$[1] = children;
|
|
3208
|
+
$[2] = className;
|
|
3209
|
+
$[3] = icon;
|
|
3210
|
+
$[4] = onClick;
|
|
3211
|
+
$[5] = rest;
|
|
3212
|
+
$[6] = t1;
|
|
3213
|
+
$[7] = t2;
|
|
3214
|
+
$[8] = t3;
|
|
3215
|
+
} else {
|
|
3216
|
+
children = $[1];
|
|
3217
|
+
className = $[2];
|
|
3218
|
+
icon = $[3];
|
|
3219
|
+
onClick = $[4];
|
|
3220
|
+
rest = $[5];
|
|
3221
|
+
t1 = $[6];
|
|
3222
|
+
t2 = $[7];
|
|
3223
|
+
t3 = $[8];
|
|
3224
|
+
}
|
|
3196
3225
|
const active = t1 === void 0 ? false : t1;
|
|
3197
3226
|
const size = t2 === void 0 ? "medium" : t2;
|
|
3198
3227
|
const disabled = t3 === void 0 ? false : t3;
|
|
3199
3228
|
const t4 = sizeClasses[size];
|
|
3200
3229
|
let t5;
|
|
3201
|
-
if ($[
|
|
3230
|
+
if ($[9] !== active || $[10] !== className || $[11] !== disabled || $[12] !== t4) {
|
|
3202
3231
|
t5 = cls("inline-flex items-center gap-1 rounded-full", "font-medium whitespace-nowrap select-none shrink-0", "transition-all duration-150", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50", t4, active ? "bg-primary/12 text-primary dark:bg-primary/20 dark:text-primary shadow-[inset_0_0_0_1.5px_var(--color-primary)]" : cls("bg-surface-accent-100 text-text-secondary dark:bg-surface-accent-800 dark:text-text-secondary-dark", !disabled && "cursor-pointer hover:bg-surface-accent-200 dark:hover:bg-surface-accent-700"), disabled && "opacity-50 cursor-not-allowed", className);
|
|
3203
|
-
$[
|
|
3204
|
-
$[
|
|
3205
|
-
$[
|
|
3206
|
-
$[
|
|
3207
|
-
$[
|
|
3232
|
+
$[9] = active;
|
|
3233
|
+
$[10] = className;
|
|
3234
|
+
$[11] = disabled;
|
|
3235
|
+
$[12] = t4;
|
|
3236
|
+
$[13] = t5;
|
|
3208
3237
|
} else {
|
|
3209
|
-
t5 = $[
|
|
3238
|
+
t5 = $[13];
|
|
3210
3239
|
}
|
|
3211
3240
|
let t6;
|
|
3212
|
-
if ($[
|
|
3213
|
-
t6 = /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", onClick, disabled, className: t5, children: [
|
|
3241
|
+
if ($[14] !== children || $[15] !== disabled || $[16] !== icon || $[17] !== onClick || $[18] !== ref || $[19] !== rest || $[20] !== t5) {
|
|
3242
|
+
t6 = /* @__PURE__ */ jsxRuntime.jsxs("button", { ref, type: "button", onClick, disabled, className: t5, ...rest, children: [
|
|
3214
3243
|
icon,
|
|
3215
3244
|
children
|
|
3216
3245
|
] });
|
|
3217
|
-
$[
|
|
3218
|
-
$[
|
|
3219
|
-
$[
|
|
3220
|
-
$[
|
|
3221
|
-
$[
|
|
3222
|
-
$[
|
|
3246
|
+
$[14] = children;
|
|
3247
|
+
$[15] = disabled;
|
|
3248
|
+
$[16] = icon;
|
|
3249
|
+
$[17] = onClick;
|
|
3250
|
+
$[18] = ref;
|
|
3251
|
+
$[19] = rest;
|
|
3252
|
+
$[20] = t5;
|
|
3253
|
+
$[21] = t6;
|
|
3223
3254
|
} else {
|
|
3224
|
-
t6 = $[
|
|
3255
|
+
t6 = $[21];
|
|
3225
3256
|
}
|
|
3226
3257
|
return t6;
|
|
3227
|
-
}
|
|
3258
|
+
});
|
|
3228
3259
|
const colorClasses = {
|
|
3229
3260
|
info: "bg-sky-200 dark:bg-teal-900",
|
|
3230
3261
|
warn: "bg-orange-200 dark:bg-yellow-950"
|
|
@@ -7005,7 +7036,7 @@
|
|
|
7005
7036
|
} else {
|
|
7006
7037
|
t10 = $[12];
|
|
7007
7038
|
}
|
|
7008
|
-
const t11 = variant === "standard" && "inline-flex h-
|
|
7039
|
+
const t11 = variant === "standard" && "inline-flex h-9 items-center justify-start rounded-md bg-surface-50 p-1 text-surface-600 dark:bg-surface-900 dark:text-surface-400 gap-2 border";
|
|
7009
7040
|
const t12 = variant === "standard" && defaultBorderMixin;
|
|
7010
7041
|
const t13 = variant === "boxy" && "flex items-center h-full";
|
|
7011
7042
|
const t14 = variant === "pill" && "flex items-center gap-0.5";
|
|
@@ -7079,7 +7110,7 @@
|
|
|
7079
7110
|
const {
|
|
7080
7111
|
variant
|
|
7081
7112
|
} = React.useContext(TabsContext);
|
|
7082
|
-
const t1 = variant === "standard" && "rounded-sm px-3 py-1
|
|
7113
|
+
const t1 = variant === "standard" && "rounded-sm px-3 py-1 data-[state=active]:bg-white data-[state=active]:text-surface-900 data-[state=active]:shadow-sm dark:data-[state=active]:bg-surface-900 dark:data-[state=active]:text-surface-50";
|
|
7083
7114
|
let t2;
|
|
7084
7115
|
if ($[0] !== className || $[1] !== innerClassName || $[2] !== t1 || $[3] !== variant) {
|
|
7085
7116
|
t2 = cls("inline-flex items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-white transition-all", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-surface-400 focus-visible:ring-offset-2", "disabled:pointer-events-none disabled:opacity-50", t1, variant === "boxy" && cls("flex-shrink-0 flex items-center gap-1.5 px-3.5 h-9 border-r border-surface-200 dark:border-surface-800 cursor-pointer text-[12px] font-medium transition-colors group relative box-border overflow-hidden", "border-b-2 border-b-transparent", "data-[state=active]:bg-surface-50 dark:data-[state=active]:bg-surface-900", "data-[state=active]:text-text-primary dark:data-[state=active]:text-text-primary-dark", "data-[state=active]:border-b-primary", "text-text-secondary dark:text-text-secondary-dark hover:bg-surface-100 dark:hover:bg-surface-800"), variant === "pill" && cls("px-2 py-0.5 rounded text-[10px] font-medium transition-colors", "data-[state=active]:bg-primary/10 data-[state=active]:text-primary dark:data-[state=active]:bg-primary/20 dark:data-[state=active]:text-blue-400", "text-text-disabled dark:text-text-disabled-dark hover:text-text-secondary dark:hover:text-text-secondary-dark"), className, variant === "standard" && innerClassName);
|
|
@@ -7553,73 +7584,59 @@
|
|
|
7553
7584
|
});
|
|
7554
7585
|
Badge.displayName = "Badge";
|
|
7555
7586
|
function DebouncedTextField(props) {
|
|
7556
|
-
const
|
|
7557
|
-
const
|
|
7558
|
-
const
|
|
7559
|
-
|
|
7560
|
-
|
|
7561
|
-
|
|
7562
|
-
|
|
7563
|
-
|
|
7564
|
-
|
|
7587
|
+
const [internalValue, setInternalValue] = React.useState(props.value ?? "");
|
|
7588
|
+
const lastSentValueRef = React.useRef(props.value ?? "");
|
|
7589
|
+
const timerRef = React.useRef(void 0);
|
|
7590
|
+
React.useEffect(() => {
|
|
7591
|
+
const externalValue = props.value ?? "";
|
|
7592
|
+
if (externalValue !== lastSentValueRef.current) {
|
|
7593
|
+
setInternalValue(externalValue);
|
|
7594
|
+
lastSentValueRef.current = externalValue;
|
|
7595
|
+
}
|
|
7596
|
+
}, [props.value]);
|
|
7597
|
+
React.useEffect(() => {
|
|
7598
|
+
return () => {
|
|
7599
|
+
if (timerRef.current) clearTimeout(timerRef.current);
|
|
7565
7600
|
};
|
|
7566
|
-
|
|
7567
|
-
|
|
7568
|
-
|
|
7569
|
-
|
|
7570
|
-
|
|
7571
|
-
|
|
7572
|
-
|
|
7573
|
-
|
|
7574
|
-
|
|
7575
|
-
|
|
7576
|
-
|
|
7577
|
-
|
|
7578
|
-
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
}
|
|
7582
|
-
|
|
7583
|
-
|
|
7601
|
+
}, []);
|
|
7602
|
+
const flushChange = React.useCallback((value, event) => {
|
|
7603
|
+
if (timerRef.current) {
|
|
7604
|
+
clearTimeout(timerRef.current);
|
|
7605
|
+
timerRef.current = void 0;
|
|
7606
|
+
}
|
|
7607
|
+
if (value !== props.value && props.onChange) {
|
|
7608
|
+
lastSentValueRef.current = value;
|
|
7609
|
+
const e = {
|
|
7610
|
+
...event,
|
|
7611
|
+
target: {
|
|
7612
|
+
...event?.target,
|
|
7613
|
+
value,
|
|
7614
|
+
name: props.name
|
|
7615
|
+
}
|
|
7616
|
+
};
|
|
7617
|
+
props.onChange(e);
|
|
7618
|
+
}
|
|
7619
|
+
}, [props.value, props.onChange, props.name]);
|
|
7620
|
+
const internalOnChange = React.useCallback((event_0) => {
|
|
7621
|
+
const newValue = event_0.target.value;
|
|
7622
|
+
setInternalValue(newValue);
|
|
7623
|
+
if (timerRef.current) clearTimeout(timerRef.current);
|
|
7624
|
+
const eventCopy = {
|
|
7625
|
+
...event_0,
|
|
7626
|
+
target: {
|
|
7627
|
+
...event_0?.target,
|
|
7628
|
+
name: event_0?.target?.name
|
|
7584
7629
|
}
|
|
7585
7630
|
};
|
|
7586
|
-
|
|
7587
|
-
|
|
7588
|
-
|
|
7589
|
-
}
|
|
7590
|
-
|
|
7591
|
-
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
$[6] = deferredValue;
|
|
7596
|
-
$[7] = props.value;
|
|
7597
|
-
$[8] = t3;
|
|
7598
|
-
} else {
|
|
7599
|
-
t3 = $[8];
|
|
7600
|
-
}
|
|
7601
|
-
React.useEffect(t2, t3);
|
|
7602
|
-
let t4;
|
|
7603
|
-
if ($[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
7604
|
-
t4 = (event) => {
|
|
7605
|
-
previousEventRef.current = event;
|
|
7606
|
-
setInternalValue(event.target.value);
|
|
7607
|
-
};
|
|
7608
|
-
$[9] = t4;
|
|
7609
|
-
} else {
|
|
7610
|
-
t4 = $[9];
|
|
7611
|
-
}
|
|
7612
|
-
const internalOnChange = t4;
|
|
7613
|
-
let t5;
|
|
7614
|
-
if ($[10] !== internalValue || $[11] !== props) {
|
|
7615
|
-
t5 = /* @__PURE__ */ jsxRuntime.jsx(TextField, { ...props, onChange: internalOnChange, value: internalValue });
|
|
7616
|
-
$[10] = internalValue;
|
|
7617
|
-
$[11] = props;
|
|
7618
|
-
$[12] = t5;
|
|
7619
|
-
} else {
|
|
7620
|
-
t5 = $[12];
|
|
7621
|
-
}
|
|
7622
|
-
return t5;
|
|
7631
|
+
timerRef.current = setTimeout(() => {
|
|
7632
|
+
flushChange(newValue, eventCopy);
|
|
7633
|
+
}, 150);
|
|
7634
|
+
}, [flushChange]);
|
|
7635
|
+
const internalOnBlur = React.useCallback((event_1) => {
|
|
7636
|
+
flushChange(internalValue, event_1);
|
|
7637
|
+
props.onBlur?.(event_1);
|
|
7638
|
+
}, [internalValue, flushChange, props.onBlur]);
|
|
7639
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TextField, { ...props, onChange: internalOnChange, onBlur: internalOnBlur, value: internalValue });
|
|
7623
7640
|
}
|
|
7624
7641
|
const styles = `
|
|
7625
7642
|
@keyframes shimmer {
|
|
@@ -8339,7 +8356,8 @@
|
|
|
8339
8356
|
height: headerHeight
|
|
8340
8357
|
}, children: [
|
|
8341
8358
|
columns.map((column_0, columnIndex) => {
|
|
8342
|
-
const
|
|
8359
|
+
const columnFilter = column_0 && filter && filter[column_0.key] ? filter[column_0.key] : void 0;
|
|
8360
|
+
const filterForThisProperty = columnFilter ? Array.isArray(columnFilter[0]) ? columnFilter[0] : columnFilter : void 0;
|
|
8343
8361
|
const isDraggable = !column_0.frozen && !!onColumnsOrderChange;
|
|
8344
8362
|
const isDragging = draggingColumnId === column_0.key;
|
|
8345
8363
|
return /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntime.jsx(SortableColumnHeader, { column: column_0, columnIndex, columnRefs, isResizing, onFilterUpdate, filter: filterForThisProperty, sortByProperty, currentSort, onColumnSort, onClickResizeColumn, createFilterField, isDragging, isDraggable }) }, "header_" + column_0.key);
|