@wallarm-org/design-system 0.12.0 → 0.13.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/Calendar/Calendar.d.ts +2 -0
- package/dist/components/Calendar/Calendar.js +2 -1
- package/dist/components/{QueryBar/QueryBar.d.ts → FilterInput/FilterInput.d.ts} +3 -3
- package/dist/components/FilterInput/FilterInput.js +68 -0
- package/dist/components/FilterInput/FilterInputContext/FilterInputContext.d.ts +2 -0
- package/dist/components/FilterInput/FilterInputContext/FilterInputContext.js +3 -0
- package/dist/components/FilterInput/FilterInputContext/FilterInputProvider.d.ts +8 -0
- package/dist/components/FilterInput/FilterInputContext/FilterInputProvider.js +8 -0
- package/dist/components/FilterInput/FilterInputContext/index.d.ts +4 -0
- package/dist/components/FilterInput/FilterInputContext/index.js +4 -0
- package/dist/components/{QueryBar/QueryBarContext → FilterInput/FilterInputContext}/types.d.ts +6 -4
- package/dist/components/FilterInput/FilterInputContext/useFilterInputContext.d.ts +2 -0
- package/dist/components/FilterInput/FilterInputContext/useFilterInputContext.js +8 -0
- package/dist/components/{QueryBar/QueryBarContext/useQueryBarContextValue.d.ts → FilterInput/FilterInputContext/useFilterInputContextValue.d.ts} +7 -6
- package/dist/components/{QueryBar/QueryBarContext/useQueryBarContextValue.js → FilterInput/FilterInputContext/useFilterInputContextValue.js} +5 -3
- package/dist/components/FilterInput/FilterInputErrors/FilterInputErrors.d.ts +5 -0
- package/dist/components/FilterInput/FilterInputErrors/FilterInputErrors.js +34 -0
- package/dist/components/FilterInput/FilterInputErrors/index.d.ts +2 -0
- package/dist/components/FilterInput/FilterInputErrors/index.js +3 -0
- package/dist/components/FilterInput/FilterInputErrors/parseFilterInputErrors.d.ts +6 -0
- package/dist/components/FilterInput/FilterInputErrors/parseFilterInputErrors.js +34 -0
- package/dist/components/{QueryBar/QueryBarInput → FilterInput/FilterInputField}/ChipsWithGaps.d.ts +4 -4
- package/dist/components/{QueryBar/QueryBarInput → FilterInput/FilterInputField}/ChipsWithGaps.js +9 -5
- package/dist/components/{QueryBar/QueryBarInput/QueryBarChip → FilterInput/FilterInputField/FilterInputChip}/EditingContext.d.ts +1 -1
- package/dist/components/FilterInput/FilterInputField/FilterInputChip/FilterInputChip.d.ts +17 -0
- package/dist/components/{QueryBar/QueryBarInput/QueryBarChip/QueryBarChip.js → FilterInput/FilterInputField/FilterInputChip/FilterInputChip.js} +16 -10
- package/dist/components/{QueryBar/QueryBarInput/QueryBarChip/QueryBarRemoveButton.d.ts → FilterInput/FilterInputField/FilterInputChip/FilterInputRemoveButton.d.ts} +1 -1
- package/dist/components/{QueryBar/QueryBarInput/QueryBarChip/QueryBarRemoveButton.js → FilterInput/FilterInputField/FilterInputChip/FilterInputRemoveButton.js} +4 -4
- package/dist/components/{QueryBar/QueryBarInput/QueryBarChip → FilterInput/FilterInputField/FilterInputChip}/Segment.d.ts +1 -0
- package/dist/components/{QueryBar/QueryBarInput/QueryBarChip → FilterInput/FilterInputField/FilterInputChip}/Segment.js +11 -7
- package/dist/components/FilterInput/FilterInputField/FilterInputChip/ValueSegment.d.ts +18 -0
- package/dist/components/FilterInput/FilterInputField/FilterInputChip/ValueSegment.js +47 -0
- package/dist/components/{QueryBar/QueryBarInput/QueryBarChip → FilterInput/FilterInputField/FilterInputChip}/classes.d.ts +2 -1
- package/dist/components/{QueryBar/QueryBarInput/QueryBarChip → FilterInput/FilterInputField/FilterInputChip}/classes.js +27 -3
- package/dist/components/FilterInput/FilterInputField/FilterInputChip/index.d.ts +5 -0
- package/dist/components/FilterInput/FilterInputField/FilterInputChip/index.js +6 -0
- package/dist/components/{QueryBar/QueryBarInput/QueryBarConnectorChip/QueryBarConnectorChip.d.ts → FilterInput/FilterInputField/FilterInputConnectorChip/FilterInputConnectorChip.d.ts} +3 -3
- package/dist/components/{QueryBar/QueryBarInput/QueryBarConnectorChip/QueryBarConnectorChip.js → FilterInput/FilterInputField/FilterInputConnectorChip/FilterInputConnectorChip.js} +29 -9
- package/dist/components/FilterInput/FilterInputField/FilterInputConnectorChip/index.d.ts +1 -0
- package/dist/components/FilterInput/FilterInputField/FilterInputConnectorChip/index.js +2 -0
- package/dist/components/FilterInput/FilterInputField/FilterInputField.d.ts +4 -0
- package/dist/components/FilterInput/FilterInputField/FilterInputField.js +152 -0
- package/dist/components/FilterInput/FilterInputField/FilterInputFieldActions.d.ts +7 -0
- package/dist/components/FilterInput/FilterInputField/FilterInputFieldActions.js +62 -0
- package/dist/components/FilterInput/FilterInputField/FilterInputSearch.d.ts +7 -0
- package/dist/components/{QueryBar/QueryBarInput/QueryBarFilterInput.js → FilterInput/FilterInputField/FilterInputSearch.js} +9 -8
- package/dist/components/FilterInput/FilterInputField/classes.d.ts +19 -0
- package/dist/components/FilterInput/FilterInputField/classes.js +54 -0
- package/dist/components/FilterInput/FilterInputField/hooks/useChipsSplitting.d.ts +11 -0
- package/dist/components/FilterInput/FilterInputField/hooks/useChipsSplitting.js +28 -0
- package/dist/components/FilterInput/FilterInputField/hooks/useExpandCollapse.d.ts +14 -0
- package/dist/components/FilterInput/FilterInputField/hooks/useExpandCollapse.js +35 -0
- package/dist/components/FilterInput/FilterInputField/index.d.ts +2 -0
- package/dist/components/FilterInput/FilterInputField/index.js +3 -0
- package/dist/components/FilterInput/FilterInputMenu/FilterInputDateValueMenu/ApplyButton.d.ts +7 -0
- package/dist/components/FilterInput/FilterInputMenu/FilterInputDateValueMenu/ApplyButton.js +15 -0
- package/dist/components/{QueryBar/QueryBarMenu/QueryBarDateValueMenu/QueryBarDateValueMenu.d.ts → FilterInput/FilterInputMenu/FilterInputDateValueMenu/FilterInputDateValueMenu.d.ts} +6 -8
- package/dist/components/FilterInput/FilterInputMenu/FilterInputDateValueMenu/FilterInputDateValueMenu.js +95 -0
- package/dist/components/{QueryBar/QueryBarMenu/QueryBarDateValueMenu → FilterInput/FilterInputMenu/FilterInputDateValueMenu}/constants.d.ts +5 -2
- package/dist/components/{QueryBar/QueryBarMenu/QueryBarDateValueMenu → FilterInput/FilterInputMenu/FilterInputDateValueMenu}/constants.js +16 -5
- package/dist/components/FilterInput/FilterInputMenu/FilterInputDateValueMenu/index.d.ts +3 -0
- package/dist/components/FilterInput/FilterInputMenu/FilterInputDateValueMenu/index.js +3 -0
- package/dist/components/FilterInput/FilterInputMenu/FilterInputDateValueMenu/utils.d.ts +5 -0
- package/dist/components/FilterInput/FilterInputMenu/FilterInputDateValueMenu/utils.js +21 -0
- package/dist/components/{QueryBar/QueryBarMenu/QueryBarFieldMenu/QueryBarFieldMenu.d.ts → FilterInput/FilterInputMenu/FilterInputFieldMenu/FilterInputFieldMenu.d.ts} +2 -2
- package/dist/components/{QueryBar/QueryBarMenu/QueryBarFieldMenu/QueryBarFieldMenu.js → FilterInput/FilterInputMenu/FilterInputFieldMenu/FilterInputFieldMenu.js} +5 -5
- package/dist/components/FilterInput/FilterInputMenu/FilterInputFieldMenu/index.d.ts +1 -0
- package/dist/components/FilterInput/FilterInputMenu/FilterInputFieldMenu/index.js +2 -0
- package/dist/components/{QueryBar/QueryBarMenu/QueryBarMenu.d.ts → FilterInput/FilterInputMenu/FilterInputMenu.d.ts} +9 -6
- package/dist/components/{QueryBar/QueryBarMenu/QueryBarMenu.js → FilterInput/FilterInputMenu/FilterInputMenu.js} +27 -27
- package/dist/components/{QueryBar/QueryBarMenu/QueryBarOperatorMenu.d.ts → FilterInput/FilterInputMenu/FilterInputOperatorMenu.d.ts} +9 -3
- package/dist/components/{QueryBar/QueryBarMenu/QueryBarOperatorMenu.js → FilterInput/FilterInputMenu/FilterInputOperatorMenu.js} +34 -12
- package/dist/components/{QueryBar/QueryBarMenu/QueryBarValueMenu/QueryBarValueMenu.d.ts → FilterInput/FilterInputMenu/FilterInputValueMenu/FilterInputValueMenu.d.ts} +4 -2
- package/dist/components/{QueryBar/QueryBarMenu/QueryBarValueMenu/QueryBarValueMenu.js → FilterInput/FilterInputMenu/FilterInputValueMenu/FilterInputValueMenu.js} +5 -4
- package/dist/components/{QueryBar/QueryBarMenu/QueryBarValueMenu → FilterInput/FilterInputMenu/FilterInputValueMenu}/ValueMenuItem.d.ts +1 -1
- package/dist/components/FilterInput/FilterInputMenu/FilterInputValueMenu/index.d.ts +1 -0
- package/dist/components/FilterInput/FilterInputMenu/FilterInputValueMenu/index.js +2 -0
- package/dist/components/{QueryBar/QueryBarMenu/QueryBarValueMenu → FilterInput/FilterInputMenu/FilterInputValueMenu}/useValueMenuState.d.ts +7 -5
- package/dist/components/{QueryBar/QueryBarMenu/QueryBarValueMenu → FilterInput/FilterInputMenu/FilterInputValueMenu}/useValueMenuState.js +31 -8
- package/dist/components/{QueryBar/QueryBarMenu → FilterInput/FilterInputMenu/hooks}/useKeyboardNav.d.ts +3 -3
- package/dist/components/{QueryBar/QueryBarMenu → FilterInput/FilterInputMenu/hooks}/useKeyboardNav.js +3 -1
- package/dist/components/FilterInput/FilterInputMenu/index.d.ts +5 -0
- package/dist/components/FilterInput/FilterInputMenu/index.js +6 -0
- package/dist/components/FilterInput/hooks/index.d.ts +2 -0
- package/dist/components/FilterInput/hooks/index.js +3 -0
- package/dist/components/{QueryBar/hooks/useQueryBarAutocomplete → FilterInput/hooks/useFilterInputAutocomplete}/deriveAutocompleteValues.d.ts +3 -2
- package/dist/components/FilterInput/hooks/useFilterInputAutocomplete/deriveAutocompleteValues.js +49 -0
- package/dist/components/FilterInput/hooks/useFilterInputAutocomplete/index.d.ts +1 -0
- package/dist/components/FilterInput/hooks/useFilterInputAutocomplete/index.js +2 -0
- package/dist/components/{QueryBar/hooks/useQueryBarAutocomplete → FilterInput/hooks/useFilterInputAutocomplete}/useChipEditing.d.ts +5 -4
- package/dist/components/{QueryBar/hooks/useQueryBarAutocomplete → FilterInput/hooks/useFilterInputAutocomplete}/useChipEditing.js +25 -8
- package/dist/components/{QueryBar/hooks/useQueryBarAutocomplete/useQueryBarAutocomplete.d.ts → FilterInput/hooks/useFilterInputAutocomplete/useFilterInputAutocomplete.d.ts} +19 -16
- package/dist/components/{QueryBar/hooks/useQueryBarAutocomplete/useQueryBarAutocomplete.js → FilterInput/hooks/useFilterInputAutocomplete/useFilterInputAutocomplete.js} +70 -115
- package/dist/components/FilterInput/hooks/useFilterInputAutocomplete/useFocusManagement.d.ts +22 -0
- package/dist/components/FilterInput/hooks/useFilterInputAutocomplete/useFocusManagement.js +67 -0
- package/dist/components/FilterInput/hooks/useFilterInputAutocomplete/useInputHandlers.d.ts +27 -0
- package/dist/components/FilterInput/hooks/useFilterInputAutocomplete/useInputHandlers.js +104 -0
- package/dist/components/{QueryBar/hooks/useQueryBarAutocomplete → FilterInput/hooks/useFilterInputAutocomplete}/useMenuFlow.d.ts +3 -3
- package/dist/components/{QueryBar/hooks/useQueryBarAutocomplete → FilterInput/hooks/useFilterInputAutocomplete}/useMenuFlow.js +30 -83
- package/dist/components/{QueryBar/hooks/useQueryBarAutocomplete → FilterInput/hooks/useFilterInputAutocomplete}/useMenuPositioning.d.ts +2 -3
- package/dist/components/FilterInput/hooks/useFilterInputAutocomplete/useMenuPositioning.js +36 -0
- package/dist/components/FilterInput/hooks/useFilterInputAutocomplete/valueCommitHelpers.d.ts +34 -0
- package/dist/components/FilterInput/hooks/useFilterInputAutocomplete/valueCommitHelpers.js +81 -0
- package/dist/components/{QueryBar/hooks/useQueryBarExpression → FilterInput/hooks/useFilterInputExpression}/buildChips.d.ts +2 -2
- package/dist/components/{QueryBar/hooks/useQueryBarExpression → FilterInput/hooks/useFilterInputExpression}/buildChips.js +54 -23
- package/dist/components/FilterInput/hooks/useFilterInputExpression/index.d.ts +1 -0
- package/dist/components/FilterInput/hooks/useFilterInputExpression/index.js +2 -0
- package/dist/components/{QueryBar/hooks/useQueryBarExpression/useQueryBarExpression.d.ts → FilterInput/hooks/useFilterInputExpression/useFilterInputExpression.d.ts} +5 -5
- package/dist/components/{QueryBar/hooks/useQueryBarExpression/useQueryBarExpression.js → FilterInput/hooks/useFilterInputExpression/useFilterInputExpression.js} +15 -15
- package/dist/components/FilterInput/hooks/useFilterInputPositioning.d.ts +29 -0
- package/dist/components/FilterInput/hooks/useFilterInputPositioning.js +19 -0
- package/dist/components/FilterInput/index.d.ts +4 -0
- package/dist/components/FilterInput/index.js +4 -0
- package/dist/components/{QueryBar → FilterInput}/lib/conditions.d.ts +2 -2
- package/dist/components/{QueryBar → FilterInput}/lib/constants.d.ts +10 -2
- package/dist/components/{QueryBar → FilterInput}/lib/constants.js +29 -7
- package/dist/components/FilterInput/lib/dom.d.ts +17 -0
- package/dist/components/FilterInput/lib/dom.js +12 -0
- package/dist/components/FilterInput/lib/fields.d.ts +12 -0
- package/dist/components/FilterInput/lib/fields.js +10 -0
- package/dist/components/FilterInput/lib/index.d.ts +8 -0
- package/dist/components/FilterInput/lib/index.js +8 -0
- package/dist/components/{QueryBar → FilterInput}/types.d.ts +26 -12
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/metadata/components.json +2987 -2954
- package/package.json +1 -1
- package/dist/components/QueryBar/QueryBar.js +0 -60
- package/dist/components/QueryBar/QueryBarContext/QueryBarContext.d.ts +0 -2
- package/dist/components/QueryBar/QueryBarContext/QueryBarContext.js +0 -3
- package/dist/components/QueryBar/QueryBarContext/QueryBarProvider.d.ts +0 -8
- package/dist/components/QueryBar/QueryBarContext/QueryBarProvider.js +0 -8
- package/dist/components/QueryBar/QueryBarContext/index.d.ts +0 -4
- package/dist/components/QueryBar/QueryBarContext/index.js +0 -4
- package/dist/components/QueryBar/QueryBarContext/useQueryBarContext.d.ts +0 -2
- package/dist/components/QueryBar/QueryBarContext/useQueryBarContext.js +0 -8
- package/dist/components/QueryBar/QueryBarInput/QueryBarChip/QueryBarChip.d.ts +0 -13
- package/dist/components/QueryBar/QueryBarInput/QueryBarChip/index.d.ts +0 -5
- package/dist/components/QueryBar/QueryBarInput/QueryBarChip/index.js +0 -6
- package/dist/components/QueryBar/QueryBarInput/QueryBarConnectorChip/index.d.ts +0 -1
- package/dist/components/QueryBar/QueryBarInput/QueryBarConnectorChip/index.js +0 -2
- package/dist/components/QueryBar/QueryBarInput/QueryBarFilterInput.d.ts +0 -6
- package/dist/components/QueryBar/QueryBarInput/QueryBarInput.d.ts +0 -4
- package/dist/components/QueryBar/QueryBarInput/QueryBarInput.js +0 -133
- package/dist/components/QueryBar/QueryBarInput/QueryBarInputActions.d.ts +0 -2
- package/dist/components/QueryBar/QueryBarInput/QueryBarInputActions.js +0 -37
- package/dist/components/QueryBar/QueryBarInput/classes.d.ts +0 -12
- package/dist/components/QueryBar/QueryBarInput/classes.js +0 -35
- package/dist/components/QueryBar/QueryBarInput/index.d.ts +0 -2
- package/dist/components/QueryBar/QueryBarInput/index.js +0 -3
- package/dist/components/QueryBar/QueryBarMenu/QueryBarDateValueMenu/CalendarNav.d.ts +0 -2
- package/dist/components/QueryBar/QueryBarMenu/QueryBarDateValueMenu/CalendarNav.js +0 -22
- package/dist/components/QueryBar/QueryBarMenu/QueryBarDateValueMenu/DateCalendar.d.ts +0 -14
- package/dist/components/QueryBar/QueryBarMenu/QueryBarDateValueMenu/DateCalendar.js +0 -100
- package/dist/components/QueryBar/QueryBarMenu/QueryBarDateValueMenu/DatePresets.d.ts +0 -8
- package/dist/components/QueryBar/QueryBarMenu/QueryBarDateValueMenu/DatePresets.js +0 -66
- package/dist/components/QueryBar/QueryBarMenu/QueryBarDateValueMenu/DayView.d.ts +0 -2
- package/dist/components/QueryBar/QueryBarMenu/QueryBarDateValueMenu/DayView.js +0 -42
- package/dist/components/QueryBar/QueryBarMenu/QueryBarDateValueMenu/MonthView.d.ts +0 -2
- package/dist/components/QueryBar/QueryBarMenu/QueryBarDateValueMenu/MonthView.js +0 -34
- package/dist/components/QueryBar/QueryBarMenu/QueryBarDateValueMenu/QueryBarDateValueMenu.js +0 -107
- package/dist/components/QueryBar/QueryBarMenu/QueryBarDateValueMenu/YearView.d.ts +0 -2
- package/dist/components/QueryBar/QueryBarMenu/QueryBarDateValueMenu/YearView.js +0 -33
- package/dist/components/QueryBar/QueryBarMenu/QueryBarDateValueMenu/index.d.ts +0 -4
- package/dist/components/QueryBar/QueryBarMenu/QueryBarDateValueMenu/index.js +0 -4
- package/dist/components/QueryBar/QueryBarMenu/QueryBarDateValueMenu/styles.d.ts +0 -4
- package/dist/components/QueryBar/QueryBarMenu/QueryBarDateValueMenu/styles.js +0 -4
- package/dist/components/QueryBar/QueryBarMenu/QueryBarFieldMenu/index.d.ts +0 -1
- package/dist/components/QueryBar/QueryBarMenu/QueryBarFieldMenu/index.js +0 -2
- package/dist/components/QueryBar/QueryBarMenu/QueryBarValueMenu/index.d.ts +0 -1
- package/dist/components/QueryBar/QueryBarMenu/QueryBarValueMenu/index.js +0 -2
- package/dist/components/QueryBar/QueryBarMenu/index.d.ts +0 -5
- package/dist/components/QueryBar/QueryBarMenu/index.js +0 -6
- package/dist/components/QueryBar/hooks/index.d.ts +0 -3
- package/dist/components/QueryBar/hooks/index.js +0 -4
- package/dist/components/QueryBar/hooks/useQueryBarAutocomplete/deriveAutocompleteValues.js +0 -50
- package/dist/components/QueryBar/hooks/useQueryBarAutocomplete/index.d.ts +0 -1
- package/dist/components/QueryBar/hooks/useQueryBarAutocomplete/index.js +0 -2
- package/dist/components/QueryBar/hooks/useQueryBarAutocomplete/useMenuPositioning.js +0 -49
- package/dist/components/QueryBar/hooks/useQueryBarExpression/index.d.ts +0 -1
- package/dist/components/QueryBar/hooks/useQueryBarExpression/index.js +0 -2
- package/dist/components/QueryBar/index.d.ts +0 -4
- package/dist/components/QueryBar/index.js +0 -4
- package/dist/components/QueryBar/lib/dom.d.ts +0 -2
- package/dist/components/QueryBar/lib/dom.js +0 -2
- package/dist/components/QueryBar/lib/index.d.ts +0 -7
- package/dist/components/QueryBar/lib/index.js +0 -7
- /package/dist/components/{QueryBar/QueryBarContext → FilterInput/FilterInputContext}/types.js +0 -0
- /package/dist/components/{QueryBar/QueryBarInput/QueryBarChip → FilterInput/FilterInputField/FilterInputChip}/EditingContext.js +0 -0
- /package/dist/components/{QueryBar/QueryBarInput/QueryBarChip → FilterInput/FilterInputField/FilterInputChip}/OperatorSegment.d.ts +0 -0
- /package/dist/components/{QueryBar/QueryBarInput/QueryBarChip → FilterInput/FilterInputField/FilterInputChip}/OperatorSegment.js +0 -0
- /package/dist/components/{QueryBar/QueryBarInput/QueryBarConnectorChip → FilterInput/FilterInputField/FilterInputConnectorChip}/classes.d.ts +0 -0
- /package/dist/components/{QueryBar/QueryBarInput/QueryBarConnectorChip → FilterInput/FilterInputField/FilterInputConnectorChip}/classes.js +0 -0
- /package/dist/components/{QueryBar/QueryBarInput → FilterInput/FilterInputField}/InsertionGap/InsertionGap.d.ts +0 -0
- /package/dist/components/{QueryBar/QueryBarInput → FilterInput/FilterInputField}/InsertionGap/InsertionGap.js +0 -0
- /package/dist/components/{QueryBar/QueryBarInput → FilterInput/FilterInputField}/InsertionGap/classes.d.ts +0 -0
- /package/dist/components/{QueryBar/QueryBarInput → FilterInput/FilterInputField}/InsertionGap/classes.js +0 -0
- /package/dist/components/{QueryBar/QueryBarInput → FilterInput/FilterInputField}/InsertionGap/index.d.ts +0 -0
- /package/dist/components/{QueryBar/QueryBarInput → FilterInput/FilterInputField}/InsertionGap/index.js +0 -0
- /package/dist/components/{QueryBar/QueryBarMenu/QueryBarDateValueMenu → FilterInput/FilterInputMenu/FilterInputDateValueMenu}/hooks.d.ts +0 -0
- /package/dist/components/{QueryBar/QueryBarMenu/QueryBarDateValueMenu → FilterInput/FilterInputMenu/FilterInputDateValueMenu}/hooks.js +0 -0
- /package/dist/components/{QueryBar/QueryBarMenu/QueryBarFieldMenu → FilterInput/FilterInputMenu/FilterInputFieldMenu}/FieldMenuSections.d.ts +0 -0
- /package/dist/components/{QueryBar/QueryBarMenu/QueryBarFieldMenu → FilterInput/FilterInputMenu/FilterInputFieldMenu}/FieldMenuSections.js +0 -0
- /package/dist/components/{QueryBar/QueryBarMenu/QueryBarValueMenu → FilterInput/FilterInputMenu/FilterInputValueMenu}/ValueMenuItem.js +0 -0
- /package/dist/components/{QueryBar/QueryBarMenu → FilterInput/FilterInputMenu}/MenuEmptyState.d.ts +0 -0
- /package/dist/components/{QueryBar/QueryBarMenu → FilterInput/FilterInputMenu}/MenuEmptyState.js +0 -0
- /package/dist/components/{QueryBar/hooks/useQueryBarExpression → FilterInput/hooks/useFilterInputExpression}/expression.d.ts +0 -0
- /package/dist/components/{QueryBar/hooks/useQueryBarExpression → FilterInput/hooks/useFilterInputExpression}/expression.js +0 -0
- /package/dist/components/{QueryBar → FilterInput}/lib/conditions.js +0 -0
- /package/dist/components/{QueryBar → FilterInput}/lib/filterSort.d.ts +0 -0
- /package/dist/components/{QueryBar → FilterInput}/lib/filterSort.js +0 -0
- /package/dist/components/{QueryBar → FilterInput}/lib/operators.d.ts +0 -0
- /package/dist/components/{QueryBar → FilterInput}/lib/operators.js +0 -0
- /package/dist/components/{QueryBar → FilterInput}/types.js +0 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../../../utils/cn.js";
|
|
3
|
+
import { segmentContainer, segmentTextVariants } from "./classes.js";
|
|
4
|
+
import { Segment } from "./Segment.js";
|
|
5
|
+
const ValueSegment = ({ children, error, valueParts, valueSeparator = ', ', errorValueIndices, editing, editText, onEditChange, onEditKeyDown, onEditBlur, className, ...domProps })=>{
|
|
6
|
+
if (valueParts && errorValueIndices && errorValueIndices.length > 0 && !editing) {
|
|
7
|
+
const isInteractive = !!domProps.onClick;
|
|
8
|
+
return /*#__PURE__*/ jsx("div", {
|
|
9
|
+
className: cn(segmentContainer, className),
|
|
10
|
+
"data-slot": "segment-value",
|
|
11
|
+
...isInteractive && {
|
|
12
|
+
role: 'button',
|
|
13
|
+
'aria-label': 'Edit filter value'
|
|
14
|
+
},
|
|
15
|
+
...domProps,
|
|
16
|
+
children: /*#__PURE__*/ jsx("p", {
|
|
17
|
+
className: segmentTextVariants({
|
|
18
|
+
variant: 'value'
|
|
19
|
+
}),
|
|
20
|
+
children: valueParts.map((part, idx)=>/*#__PURE__*/ jsxs("span", {
|
|
21
|
+
className: errorValueIndices.includes(idx) ? segmentTextVariants({
|
|
22
|
+
variant: 'value',
|
|
23
|
+
error: true
|
|
24
|
+
}) : void 0,
|
|
25
|
+
children: [
|
|
26
|
+
part,
|
|
27
|
+
idx < valueParts.length - 1 && valueSeparator
|
|
28
|
+
]
|
|
29
|
+
}, idx))
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return /*#__PURE__*/ jsx(Segment, {
|
|
34
|
+
variant: "value",
|
|
35
|
+
error: error,
|
|
36
|
+
editing: editing,
|
|
37
|
+
editText: editText,
|
|
38
|
+
onEditChange: onEditChange,
|
|
39
|
+
onEditKeyDown: onEditKeyDown,
|
|
40
|
+
onEditBlur: onEditBlur,
|
|
41
|
+
className: className,
|
|
42
|
+
...domProps,
|
|
43
|
+
children: children
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
ValueSegment.displayName = 'ValueSegment';
|
|
47
|
+
export { ValueSegment };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Base chip container styles shared by
|
|
1
|
+
/** Base chip container styles shared by FilterInputChip and FilterInputConnectorChip */
|
|
2
2
|
export declare const chipVariants: (props?: ({
|
|
3
3
|
error?: boolean | null | undefined;
|
|
4
4
|
interactive?: boolean | null | undefined;
|
|
@@ -8,6 +8,7 @@ export declare const segmentContainer = "flex flex-col justify-center overflow-h
|
|
|
8
8
|
/** Segment text styles by variant */
|
|
9
9
|
export declare const segmentTextVariants: (props?: ({
|
|
10
10
|
variant?: "operator" | "value" | "attribute" | null | undefined;
|
|
11
|
+
error?: boolean | null | undefined;
|
|
11
12
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
13
|
/** Remove button styles — hidden by default, shown on chip hover or button focus */
|
|
13
14
|
export declare const removeButtonVariants: (props?: ({
|
|
@@ -19,10 +19,34 @@ const segmentContainer = 'flex flex-col justify-center overflow-hidden p-2 leadi
|
|
|
19
19
|
const segmentTextVariants = cva('truncate text-sm', {
|
|
20
20
|
variants: {
|
|
21
21
|
variant: {
|
|
22
|
-
attribute: 'font-normal
|
|
23
|
-
operator: 'font-normal
|
|
24
|
-
value: 'font-medium
|
|
22
|
+
attribute: 'font-normal',
|
|
23
|
+
operator: 'font-normal',
|
|
24
|
+
value: 'font-medium'
|
|
25
|
+
},
|
|
26
|
+
error: {
|
|
27
|
+
true: 'text-text-danger',
|
|
28
|
+
false: ''
|
|
25
29
|
}
|
|
30
|
+
},
|
|
31
|
+
compoundVariants: [
|
|
32
|
+
{
|
|
33
|
+
variant: 'attribute',
|
|
34
|
+
error: false,
|
|
35
|
+
className: 'text-text-primary'
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
variant: 'operator',
|
|
39
|
+
error: false,
|
|
40
|
+
className: 'text-text-secondary'
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
variant: 'value',
|
|
44
|
+
error: false,
|
|
45
|
+
className: 'text-text-info'
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
defaultVariants: {
|
|
49
|
+
error: false
|
|
26
50
|
}
|
|
27
51
|
});
|
|
28
52
|
const removeButtonVariants = cva('absolute -right-12 top-[-1px] bottom-[-1px] flex items-center justify-center p-0 cursor-pointer w-[18px] border border-solid border-l-0 rounded-r-8 opacity-0 group-hover/chip:opacity-100 focus:opacity-100 transition-opacity', {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { type ConnectorVariant, FilterInputConnectorChip, type FilterInputConnectorChipProps, } from '../FilterInputConnectorChip';
|
|
2
|
+
export { type EditingContextValue, EditingProvider, useEditingContext } from './EditingContext';
|
|
3
|
+
export { type ChipSegment, FilterInputChip, type FilterInputChipProps } from './FilterInputChip';
|
|
4
|
+
export { FilterInputRemoveButton } from './FilterInputRemoveButton';
|
|
5
|
+
export { Segment } from './Segment';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FilterInputConnectorChip } from "../FilterInputConnectorChip/index.js";
|
|
2
|
+
import { EditingProvider, useEditingContext } from "./EditingContext.js";
|
|
3
|
+
import { FilterInputChip } from "./FilterInputChip.js";
|
|
4
|
+
import { FilterInputRemoveButton } from "./FilterInputRemoveButton.js";
|
|
5
|
+
import { Segment } from "./Segment.js";
|
|
6
|
+
export { EditingProvider, FilterInputChip, FilterInputConnectorChip, FilterInputRemoveButton, Segment, useEditingContext };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type FC } from 'react';
|
|
2
2
|
export type ConnectorVariant = 'and' | 'or';
|
|
3
|
-
export interface
|
|
3
|
+
export interface FilterInputConnectorChipProps {
|
|
4
4
|
chipId: string;
|
|
5
5
|
variant: ConnectorVariant;
|
|
6
6
|
onChange: (chipId: string, value: 'and' | 'or') => void;
|
|
7
7
|
className?: string;
|
|
8
8
|
}
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const FilterInputConnectorChip: FC<FilterInputConnectorChipProps>;
|
|
@@ -1,29 +1,49 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
2
3
|
import { CirclePlus } from "../../../../icons/CirclePlus.js";
|
|
3
4
|
import { CircleSlash } from "../../../../icons/CircleSlash.js";
|
|
4
5
|
import { cn } from "../../../../utils/cn.js";
|
|
5
6
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuFooter, DropdownMenuItem, DropdownMenuItemIcon, DropdownMenuItemText } from "../../../DropdownMenu/index.js";
|
|
6
7
|
import { DropdownMenuTrigger } from "../../../DropdownMenu/DropdownMenuTrigger.js";
|
|
7
8
|
import { Kbd, KbdGroup } from "../../../Kbd/index.js";
|
|
9
|
+
import { useFilterInputContext } from "../../FilterInputContext/index.js";
|
|
10
|
+
import { useFilterInputPositioning } from "../../hooks/useFilterInputPositioning.js";
|
|
8
11
|
import { VARIANT_LABELS } from "../../lib/constants.js";
|
|
9
|
-
import { chipVariants, segmentContainer } from "../
|
|
12
|
+
import { chipVariants, segmentContainer } from "../FilterInputChip/classes.js";
|
|
10
13
|
import { connectorTextVariants } from "./classes.js";
|
|
11
|
-
const
|
|
14
|
+
const FilterInputConnectorChip = ({ chipId, variant, onChange, className })=>{
|
|
15
|
+
const { menuOpen, closeAutocompleteMenu } = useFilterInputContext();
|
|
16
|
+
const [open, setOpen] = useState(false);
|
|
17
|
+
const triggerRef = useRef(null);
|
|
18
|
+
const handleOpenChange = useCallback((nextOpen)=>{
|
|
19
|
+
if (nextOpen) closeAutocompleteMenu();
|
|
20
|
+
setOpen(nextOpen);
|
|
21
|
+
}, [
|
|
22
|
+
closeAutocompleteMenu
|
|
23
|
+
]);
|
|
24
|
+
useEffect(()=>{
|
|
25
|
+
if (menuOpen) setOpen(false);
|
|
26
|
+
}, [
|
|
27
|
+
menuOpen
|
|
28
|
+
]);
|
|
29
|
+
const positioning = useFilterInputPositioning({
|
|
30
|
+
anchorRef: triggerRef
|
|
31
|
+
});
|
|
12
32
|
const label = VARIANT_LABELS[variant];
|
|
13
33
|
return /*#__PURE__*/ jsxs(DropdownMenu, {
|
|
14
|
-
positioning:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
},
|
|
34
|
+
positioning: positioning,
|
|
35
|
+
open: open && !menuOpen,
|
|
36
|
+
onOpenChange: handleOpenChange,
|
|
18
37
|
children: [
|
|
19
38
|
/*#__PURE__*/ jsx(DropdownMenuTrigger, {
|
|
20
39
|
asChild: true,
|
|
21
40
|
children: /*#__PURE__*/ jsx("button", {
|
|
41
|
+
ref: triggerRef,
|
|
22
42
|
type: "button",
|
|
23
43
|
className: cn(chipVariants({
|
|
24
44
|
interactive: true
|
|
25
45
|
}), 'max-w-[320px] outline-none focus-visible:outline-none', className),
|
|
26
|
-
"data-slot": "
|
|
46
|
+
"data-slot": "filter-input-connector-chip",
|
|
27
47
|
"aria-label": `Logical operator: ${label}`,
|
|
28
48
|
children: /*#__PURE__*/ jsx("div", {
|
|
29
49
|
className: segmentContainer,
|
|
@@ -97,5 +117,5 @@ const QueryBarConnectorChip = ({ chipId, variant, onChange, className })=>{
|
|
|
97
117
|
]
|
|
98
118
|
});
|
|
99
119
|
};
|
|
100
|
-
|
|
101
|
-
export {
|
|
120
|
+
FilterInputConnectorChip.displayName = 'FilterInputConnectorChip';
|
|
121
|
+
export { FilterInputConnectorChip };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type ConnectorVariant, FilterInputConnectorChip, type FilterInputConnectorChipProps, } from './FilterInputConnectorChip';
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import { cn } from "../../../utils/cn.js";
|
|
4
|
+
import { inputVariants } from "../../Input/classes.js";
|
|
5
|
+
import { ScrollArea, ScrollAreaScrollbar, ScrollAreaViewport } from "../../ScrollArea/index.js";
|
|
6
|
+
import { useFilterInputContext } from "../FilterInputContext/index.js";
|
|
7
|
+
import { isMenuRelated } from "../lib/index.js";
|
|
8
|
+
import { ChipsWithGaps, TrailingGap } from "./ChipsWithGaps.js";
|
|
9
|
+
import { ACTIONS_PADDING, COLLAPSED_MAX_HEIGHT, buildingChipWrapperClass, filterInputContainerVariants, filterInputInnerVariants } from "./classes.js";
|
|
10
|
+
import { EditingProvider } from "./FilterInputChip/EditingContext.js";
|
|
11
|
+
import { FilterInputChip } from "./FilterInputChip/FilterInputChip.js";
|
|
12
|
+
import { FilterInputFieldActions } from "./FilterInputFieldActions.js";
|
|
13
|
+
import { FilterInputSearch } from "./FilterInputSearch.js";
|
|
14
|
+
import { useChipsSplitting } from "./hooks/useChipsSplitting.js";
|
|
15
|
+
import { useExpandCollapse } from "./hooks/useExpandCollapse.js";
|
|
16
|
+
const FilterInputField = ({ className, ...props })=>{
|
|
17
|
+
const { chips, buildingChipData, buildingChipRef, insertIndex, insertAfterConnector, error, onInputClick, onGapClick, onChipClick, onConnectorChange, onChipRemove, editingChipId, editingSegment, segmentFilterText, onSegmentFilterChange, onCancelSegmentEdit, onCustomValueCommit, onCustomAttributeCommit, menuRef } = useFilterInputContext();
|
|
18
|
+
const hasContent = chips.length > 0 || null != buildingChipData;
|
|
19
|
+
const { isExpanded, isOverflowing, innerRef, toggleExpand, multiRow } = useExpandCollapse();
|
|
20
|
+
const { chipsBefore, chipsAfter, hideTrailingGap, hideLeadingGap } = useChipsSplitting(chips, insertIndex, insertAfterConnector);
|
|
21
|
+
const chipsGapProps = {
|
|
22
|
+
onChipClick,
|
|
23
|
+
onConnectorChange,
|
|
24
|
+
onChipRemove,
|
|
25
|
+
onGapClick
|
|
26
|
+
};
|
|
27
|
+
const handleSegmentEditKeyDown = useCallback((e)=>{
|
|
28
|
+
if ('Escape' === e.key) {
|
|
29
|
+
e.preventDefault();
|
|
30
|
+
onCancelSegmentEdit();
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if ('Enter' === e.key && !e.defaultPrevented) {
|
|
34
|
+
if ('value' === editingSegment) {
|
|
35
|
+
e.preventDefault();
|
|
36
|
+
onCustomValueCommit(segmentFilterText);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if ('attribute' === editingSegment) {
|
|
40
|
+
e.preventDefault();
|
|
41
|
+
onCustomAttributeCommit(segmentFilterText);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if ('ArrowDown' === e.key) {
|
|
46
|
+
e.preventDefault();
|
|
47
|
+
menuRef.current?.focus();
|
|
48
|
+
}
|
|
49
|
+
}, [
|
|
50
|
+
onCancelSegmentEdit,
|
|
51
|
+
editingSegment,
|
|
52
|
+
segmentFilterText,
|
|
53
|
+
onCustomValueCommit,
|
|
54
|
+
onCustomAttributeCommit,
|
|
55
|
+
menuRef
|
|
56
|
+
]);
|
|
57
|
+
const handleSegmentEditBlur = useCallback((e)=>{
|
|
58
|
+
if (!isMenuRelated(e.relatedTarget)) onCancelSegmentEdit();
|
|
59
|
+
}, [
|
|
60
|
+
onCancelSegmentEdit
|
|
61
|
+
]);
|
|
62
|
+
return /*#__PURE__*/ jsx(EditingProvider, {
|
|
63
|
+
editingChipId: editingChipId,
|
|
64
|
+
editingSegment: editingSegment,
|
|
65
|
+
segmentFilterText: segmentFilterText,
|
|
66
|
+
onSegmentFilterChange: onSegmentFilterChange,
|
|
67
|
+
onSegmentEditKeyDown: handleSegmentEditKeyDown,
|
|
68
|
+
onSegmentEditBlur: handleSegmentEditBlur,
|
|
69
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
70
|
+
className: cn(inputVariants({
|
|
71
|
+
error
|
|
72
|
+
}), filterInputContainerVariants({
|
|
73
|
+
error,
|
|
74
|
+
multiRow
|
|
75
|
+
}), className),
|
|
76
|
+
"data-slot": "filter-input",
|
|
77
|
+
...props,
|
|
78
|
+
children: [
|
|
79
|
+
/*#__PURE__*/ jsxs(ScrollArea, {
|
|
80
|
+
className: "h-auto flex-1 min-w-0",
|
|
81
|
+
style: {
|
|
82
|
+
maxHeight: isExpanded ? void 0 : COLLAPSED_MAX_HEIGHT
|
|
83
|
+
},
|
|
84
|
+
children: [
|
|
85
|
+
/*#__PURE__*/ jsx(ScrollAreaViewport, {
|
|
86
|
+
style: {
|
|
87
|
+
height: 'auto',
|
|
88
|
+
maxHeight: 'inherit'
|
|
89
|
+
},
|
|
90
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
91
|
+
ref: innerRef,
|
|
92
|
+
className: cn(filterInputInnerVariants({
|
|
93
|
+
hasContent
|
|
94
|
+
})),
|
|
95
|
+
style: {
|
|
96
|
+
paddingRight: hasContent ? ACTIONS_PADDING : void 0
|
|
97
|
+
},
|
|
98
|
+
onClick: (e)=>{
|
|
99
|
+
if (e.target === e.currentTarget) onInputClick();
|
|
100
|
+
},
|
|
101
|
+
children: [
|
|
102
|
+
/*#__PURE__*/ jsx(ChipsWithGaps, {
|
|
103
|
+
chips: chipsBefore,
|
|
104
|
+
hideTrailingGap: hideTrailingGap,
|
|
105
|
+
...chipsGapProps
|
|
106
|
+
}),
|
|
107
|
+
buildingChipData ? /*#__PURE__*/ jsxs("div", {
|
|
108
|
+
ref: buildingChipRef,
|
|
109
|
+
className: cn(buildingChipWrapperClass, hasContent && 'ml-8'),
|
|
110
|
+
children: [
|
|
111
|
+
/*#__PURE__*/ jsx(FilterInputChip, {
|
|
112
|
+
building: true,
|
|
113
|
+
attribute: buildingChipData.attribute ?? '',
|
|
114
|
+
operator: buildingChipData.operator,
|
|
115
|
+
value: buildingChipData.value,
|
|
116
|
+
className: "border-none"
|
|
117
|
+
}),
|
|
118
|
+
/*#__PURE__*/ jsx(FilterInputSearch, {
|
|
119
|
+
hasContent: true
|
|
120
|
+
})
|
|
121
|
+
]
|
|
122
|
+
}) : /*#__PURE__*/ jsx(FilterInputSearch, {
|
|
123
|
+
hasContent: hasContent
|
|
124
|
+
}),
|
|
125
|
+
/*#__PURE__*/ jsx(ChipsWithGaps, {
|
|
126
|
+
chips: chipsAfter,
|
|
127
|
+
hideLeadingGap: hideLeadingGap,
|
|
128
|
+
...chipsGapProps
|
|
129
|
+
}),
|
|
130
|
+
chipsAfter.length > 0 && /*#__PURE__*/ jsx(TrailingGap, {
|
|
131
|
+
chips: chipsAfter,
|
|
132
|
+
onGapClick: onGapClick
|
|
133
|
+
})
|
|
134
|
+
]
|
|
135
|
+
})
|
|
136
|
+
}),
|
|
137
|
+
!isExpanded && /*#__PURE__*/ jsx(ScrollAreaScrollbar, {
|
|
138
|
+
orientation: "vertical"
|
|
139
|
+
})
|
|
140
|
+
]
|
|
141
|
+
}),
|
|
142
|
+
/*#__PURE__*/ jsx(FilterInputFieldActions, {
|
|
143
|
+
isExpanded: isExpanded,
|
|
144
|
+
isOverflowing: isOverflowing,
|
|
145
|
+
onToggleExpand: toggleExpand
|
|
146
|
+
})
|
|
147
|
+
]
|
|
148
|
+
})
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
FilterInputField.displayName = 'FilterInputField';
|
|
152
|
+
export { FilterInputField };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Maximize2 } from "../../../icons/Maximize2.js";
|
|
3
|
+
import { Minimize2 } from "../../../icons/Minimize2.js";
|
|
4
|
+
import { X } from "../../../icons/X.js";
|
|
5
|
+
import { Button } from "../../Button/index.js";
|
|
6
|
+
import { Kbd } from "../../Kbd/Kbd.js";
|
|
7
|
+
import { KbdGroup } from "../../Kbd/KbdGroup.js";
|
|
8
|
+
import { Tooltip } from "../../Tooltip/Tooltip.js";
|
|
9
|
+
import { TooltipContent } from "../../Tooltip/TooltipContent.js";
|
|
10
|
+
import { TooltipTrigger } from "../../Tooltip/TooltipTrigger.js";
|
|
11
|
+
import { useFilterInputContext } from "../FilterInputContext/index.js";
|
|
12
|
+
const FilterInputFieldActions = ({ isExpanded, isOverflowing, onToggleExpand })=>{
|
|
13
|
+
const { chips, buildingChipData, showKeyboardHint, onClear } = useFilterInputContext();
|
|
14
|
+
const hasChips = chips.length > 0;
|
|
15
|
+
const hasContent = hasChips || null != buildingChipData;
|
|
16
|
+
const showExpandCollapse = isOverflowing || isExpanded;
|
|
17
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
18
|
+
className: "absolute right-8 top-0 z-10 flex items-center gap-8 pt-8",
|
|
19
|
+
children: [
|
|
20
|
+
showKeyboardHint && !hasContent && /*#__PURE__*/ jsxs(KbdGroup, {
|
|
21
|
+
children: [
|
|
22
|
+
/*#__PURE__*/ jsx(Kbd, {
|
|
23
|
+
children: "⌘"
|
|
24
|
+
}),
|
|
25
|
+
/*#__PURE__*/ jsx(Kbd, {
|
|
26
|
+
children: "K"
|
|
27
|
+
})
|
|
28
|
+
]
|
|
29
|
+
}),
|
|
30
|
+
showExpandCollapse && /*#__PURE__*/ jsxs(Tooltip, {
|
|
31
|
+
children: [
|
|
32
|
+
/*#__PURE__*/ jsx(TooltipTrigger, {
|
|
33
|
+
asChild: true,
|
|
34
|
+
children: /*#__PURE__*/ jsx(Button, {
|
|
35
|
+
variant: "ghost",
|
|
36
|
+
color: "neutral",
|
|
37
|
+
size: "small",
|
|
38
|
+
onClick: onToggleExpand,
|
|
39
|
+
"aria-label": isExpanded ? 'Collapse' : 'Expand',
|
|
40
|
+
className: "text-icon-secondary",
|
|
41
|
+
children: isExpanded ? /*#__PURE__*/ jsx(Minimize2, {}) : /*#__PURE__*/ jsx(Maximize2, {})
|
|
42
|
+
})
|
|
43
|
+
}),
|
|
44
|
+
/*#__PURE__*/ jsx(TooltipContent, {
|
|
45
|
+
children: isExpanded ? 'Collapse' : 'Expand'
|
|
46
|
+
})
|
|
47
|
+
]
|
|
48
|
+
}),
|
|
49
|
+
hasChips && /*#__PURE__*/ jsx(Button, {
|
|
50
|
+
variant: "ghost",
|
|
51
|
+
color: "neutral",
|
|
52
|
+
size: "small",
|
|
53
|
+
onClick: onClear,
|
|
54
|
+
"aria-label": "Clear all filters",
|
|
55
|
+
className: "text-icon-secondary",
|
|
56
|
+
children: /*#__PURE__*/ jsx(X, {})
|
|
57
|
+
})
|
|
58
|
+
]
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
FilterInputFieldActions.displayName = 'FilterInputFieldActions';
|
|
62
|
+
export { FilterInputFieldActions };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
5
|
-
|
|
2
|
+
import { useFilterInputContext } from "../FilterInputContext/index.js";
|
|
3
|
+
import { filterInputInputVariants } from "./classes.js";
|
|
4
|
+
const CHAR_WIDTH_PX = 8;
|
|
5
|
+
const FilterInputSearch = ({ hasContent, minWidth = 4 })=>{
|
|
6
|
+
const { inputText, inputRef, placeholder, error, menuOpen, onInputChange, onInputKeyDown, onInputClick } = useFilterInputContext();
|
|
6
7
|
return /*#__PURE__*/ jsx("input", {
|
|
7
8
|
ref: inputRef,
|
|
8
9
|
type: "text",
|
|
@@ -17,12 +18,12 @@ const QueryBarFilterInput = ({ hasContent })=>{
|
|
|
17
18
|
onClick: onInputClick,
|
|
18
19
|
placeholder: hasContent ? void 0 : placeholder,
|
|
19
20
|
style: hasContent ? {
|
|
20
|
-
width: `${Math.max(
|
|
21
|
+
width: `${Math.max(minWidth, inputText.length * CHAR_WIDTH_PX)}px`
|
|
21
22
|
} : void 0,
|
|
22
|
-
className:
|
|
23
|
+
className: filterInputInputVariants({
|
|
23
24
|
hasContent
|
|
24
25
|
})
|
|
25
26
|
});
|
|
26
27
|
};
|
|
27
|
-
|
|
28
|
-
export {
|
|
28
|
+
FilterInputSearch.displayName = 'FilterInputSearch';
|
|
29
|
+
export { FilterInputSearch };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Max height (px) of the inner chip area when the query bar is collapsed. */
|
|
2
|
+
export declare const COLLAPSED_MAX_HEIGHT: number;
|
|
3
|
+
/** Right padding (px) applied to the chip area when content is present. */
|
|
4
|
+
export declare const ACTIONS_PADDING: number;
|
|
5
|
+
/** Outer filter-input container (combobox wrapper) */
|
|
6
|
+
export declare const filterInputContainerVariants: (props?: ({
|
|
7
|
+
error?: boolean | null | undefined;
|
|
8
|
+
multiRow?: boolean | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
|
+
/** Inner scrollable chip area that delegates clicks to the input */
|
|
11
|
+
export declare const filterInputInnerVariants: (props?: ({
|
|
12
|
+
hasContent?: boolean | null | undefined;
|
|
13
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
14
|
+
/** Wrapper that visually groups the building chip and the filter input */
|
|
15
|
+
export declare const buildingChipWrapperClass = "flex items-center gap-2 min-w-0 rounded-8 border border-solid border-border-strong-primary bg-badge-badge-bg";
|
|
16
|
+
/** Native input element inside the query bar */
|
|
17
|
+
export declare const filterInputInputVariants: (props?: ({
|
|
18
|
+
hasContent?: boolean | null | undefined;
|
|
19
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
const VISIBLE_ROWS = 3;
|
|
3
|
+
const CHIP_ROW_HEIGHT = 22;
|
|
4
|
+
const ROW_GAP = 4;
|
|
5
|
+
const PADDING_Y = 8;
|
|
6
|
+
const EDGE_GAP = 8;
|
|
7
|
+
const CONTAINER_BORDER = 2;
|
|
8
|
+
const BOTTOM_REVEAL = 6;
|
|
9
|
+
const COLLAPSED_MAX_HEIGHT = VISIBLE_ROWS * CHIP_ROW_HEIGHT + (VISIBLE_ROWS - 1) * ROW_GAP + PADDING_Y + EDGE_GAP + CONTAINER_BORDER + BOTTOM_REVEAL;
|
|
10
|
+
const BUTTON_SIZE = 24;
|
|
11
|
+
const BUTTON_COUNT = 2;
|
|
12
|
+
const BUTTON_GAP = 8;
|
|
13
|
+
const ACTIONS_RIGHT = 8;
|
|
14
|
+
const ACTIONS_PADDING = BUTTON_COUNT * BUTTON_SIZE + BUTTON_GAP + ACTIONS_RIGHT;
|
|
15
|
+
const filterInputContainerVariants = cva('relative flex min-h-40 w-full overflow-hidden px-0 focus-within:outline-none focus-within:ring-3', {
|
|
16
|
+
variants: {
|
|
17
|
+
error: {
|
|
18
|
+
true: 'focus-within:ring-focus-destructive',
|
|
19
|
+
false: 'focus-within:not-disabled:border-border-strong-primary focus-within:ring-focus-primary'
|
|
20
|
+
},
|
|
21
|
+
multiRow: {
|
|
22
|
+
true: 'items-start',
|
|
23
|
+
false: 'items-center'
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
error: false,
|
|
28
|
+
multiRow: false
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const filterInputInnerVariants = cva('flex min-h-full w-full cursor-text flex-wrap items-center gap-y-4 py-4', {
|
|
32
|
+
variants: {
|
|
33
|
+
hasContent: {
|
|
34
|
+
true: 'pl-4',
|
|
35
|
+
false: 'pl-12 pr-4'
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
defaultVariants: {
|
|
39
|
+
hasContent: false
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
const buildingChipWrapperClass = 'flex items-center gap-2 min-w-0 rounded-8 border border-solid border-border-strong-primary bg-badge-badge-bg';
|
|
43
|
+
const filterInputInputVariants = cva('h-auto border-none bg-transparent p-0 text-sm shadow-none outline-none ring-0', {
|
|
44
|
+
variants: {
|
|
45
|
+
hasContent: {
|
|
46
|
+
true: 'mx-4',
|
|
47
|
+
false: 'flex-1'
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
defaultVariants: {
|
|
51
|
+
hasContent: false
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
export { ACTIONS_PADDING, COLLAPSED_MAX_HEIGHT, buildingChipWrapperClass, filterInputContainerVariants, filterInputInnerVariants, filterInputInputVariants };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FilterInputChipData } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Splits the chip array into "before" and "after" groups around the insert cursor.
|
|
4
|
+
* Also computes gap visibility flags based on whether adjacent chips are connectors.
|
|
5
|
+
*/
|
|
6
|
+
export declare const useChipsSplitting: (chips: FilterInputChipData[], insertIndex: number, insertAfterConnector: boolean) => {
|
|
7
|
+
chipsBefore: FilterInputChipData[];
|
|
8
|
+
chipsAfter: FilterInputChipData[];
|
|
9
|
+
hideTrailingGap: boolean;
|
|
10
|
+
hideLeadingGap: boolean;
|
|
11
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { findChipSplitIndex } from "../../lib/index.js";
|
|
3
|
+
const useChipsSplitting = (chips, insertIndex, insertAfterConnector)=>{
|
|
4
|
+
const chipSplitIndex = useMemo(()=>findChipSplitIndex(chips, insertIndex, insertAfterConnector), [
|
|
5
|
+
chips,
|
|
6
|
+
insertIndex,
|
|
7
|
+
insertAfterConnector
|
|
8
|
+
]);
|
|
9
|
+
const chipsBefore = useMemo(()=>chips.slice(0, chipSplitIndex), [
|
|
10
|
+
chips,
|
|
11
|
+
chipSplitIndex
|
|
12
|
+
]);
|
|
13
|
+
const chipsAfter = useMemo(()=>chips.slice(chipSplitIndex), [
|
|
14
|
+
chips,
|
|
15
|
+
chipSplitIndex
|
|
16
|
+
]);
|
|
17
|
+
const lastBefore = chipsBefore[chipsBefore.length - 1];
|
|
18
|
+
const firstAfter = chipsAfter[0];
|
|
19
|
+
const hideTrailingGap = lastBefore?.variant === 'and' || lastBefore?.variant === 'or';
|
|
20
|
+
const hideLeadingGap = firstAfter?.variant === 'and' || firstAfter?.variant === 'or';
|
|
21
|
+
return {
|
|
22
|
+
chipsBefore,
|
|
23
|
+
chipsAfter,
|
|
24
|
+
hideTrailingGap,
|
|
25
|
+
hideLeadingGap
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export { useChipsSplitting };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Manages the expand/collapse state for the query bar chip area.
|
|
3
|
+
*
|
|
4
|
+
* Uses a ResizeObserver on the inner container to detect when chip content
|
|
5
|
+
* exceeds `COLLAPSED_MAX_HEIGHT`. Automatically collapses back when chips
|
|
6
|
+
* are removed and the content fits within the limit.
|
|
7
|
+
*/
|
|
8
|
+
export declare const useExpandCollapse: () => {
|
|
9
|
+
readonly isExpanded: boolean;
|
|
10
|
+
readonly isOverflowing: boolean;
|
|
11
|
+
readonly innerRef: import("react").RefObject<HTMLDivElement | null>;
|
|
12
|
+
readonly toggleExpand: () => void;
|
|
13
|
+
readonly multiRow: boolean;
|
|
14
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
2
|
+
import { COLLAPSED_MAX_HEIGHT } from "../classes.js";
|
|
3
|
+
const useExpandCollapse = ()=>{
|
|
4
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
5
|
+
const [isOverflowing, setIsOverflowing] = useState(false);
|
|
6
|
+
const innerRef = useRef(null);
|
|
7
|
+
useEffect(()=>{
|
|
8
|
+
const el = innerRef.current;
|
|
9
|
+
if (!el) return;
|
|
10
|
+
const check = ()=>{
|
|
11
|
+
const wouldOverflow = el.scrollHeight > COLLAPSED_MAX_HEIGHT;
|
|
12
|
+
if (isExpanded) {
|
|
13
|
+
if (!wouldOverflow) {
|
|
14
|
+
setIsExpanded(false);
|
|
15
|
+
setIsOverflowing(false);
|
|
16
|
+
}
|
|
17
|
+
} else setIsOverflowing(wouldOverflow);
|
|
18
|
+
};
|
|
19
|
+
const ro = new ResizeObserver(check);
|
|
20
|
+
ro.observe(el);
|
|
21
|
+
return ()=>ro.disconnect();
|
|
22
|
+
}, [
|
|
23
|
+
isExpanded
|
|
24
|
+
]);
|
|
25
|
+
const toggleExpand = useCallback(()=>setIsExpanded((prev)=>!prev), []);
|
|
26
|
+
const multiRow = isOverflowing || isExpanded;
|
|
27
|
+
return {
|
|
28
|
+
isExpanded,
|
|
29
|
+
isOverflowing,
|
|
30
|
+
innerRef,
|
|
31
|
+
toggleExpand,
|
|
32
|
+
multiRow
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export { useExpandCollapse };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { FilterInputChip, FilterInputConnectorChip, FilterInputRemoveButton, Segment } from "./FilterInputChip/index.js";
|
|
2
|
+
import { FilterInputField } from "./FilterInputField.js";
|
|
3
|
+
export { FilterInputChip, FilterInputConnectorChip, FilterInputField, FilterInputRemoveButton, Segment };
|