@l3mpire/ui 2.17.0 → 2.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -899,6 +899,8 @@ declare const PropertySelector: React.FC<PropertySelectorProps>;
899
899
 
900
900
  interface KebabMenuProps {
901
901
  onConvertToAdvanced?: () => void;
902
+ /** When true, label reads "Add to advanced filters" instead of "Convert to advanced". */
903
+ hasAdvancedFilters?: boolean;
902
904
  onDelete?: () => void;
903
905
  open?: boolean;
904
906
  onOpenChange?: (open: boolean) => void;
@@ -931,6 +933,7 @@ interface InteractiveFilterChipProps {
931
933
  onPropertyChange?: (property: PropertyDefinition) => void;
932
934
  onDelete: () => void;
933
935
  onConvertToAdvanced?: () => void;
936
+ hasAdvancedFilters?: boolean;
934
937
  className?: string;
935
938
  }
936
939
  declare const InteractiveFilterChip: React.FC<InteractiveFilterChipProps>;
@@ -952,6 +955,12 @@ interface FilterSystemProps {
952
955
  mode?: FilterBarMode;
953
956
  /** Width breakpoint (px) for switching to minimal mode. Default: 600. */
954
957
  breakpoint?: number;
958
+ /**
959
+ * Constrain popovers to stay within the container bounds. Use this when
960
+ * FilterSystem lives inside an iframe or a fixed-width panel where content
961
+ * must not overflow.
962
+ */
963
+ bounded?: boolean;
955
964
  children?: React.ReactNode;
956
965
  actions?: React.ReactNode;
957
966
  className?: string;
@@ -989,6 +998,7 @@ interface AdvancedPopoverProps {
989
998
  open?: boolean;
990
999
  onOpenChange?: (open: boolean) => void;
991
1000
  children?: React.ReactNode;
1001
+ collisionBoundary?: Element | null;
992
1002
  }
993
1003
  declare const AdvancedPopover: React.FC<AdvancedPopoverProps>;
994
1004
 
@@ -1002,6 +1012,7 @@ interface SummaryChipProps {
1002
1012
  className?: string;
1003
1013
  open?: boolean;
1004
1014
  onOpenChange?: (open: boolean) => void;
1015
+ collisionBoundary?: Element | null;
1005
1016
  }
1006
1017
  declare const SummaryChip: React.FC<SummaryChipProps>;
1007
1018
 
package/dist/index.d.ts CHANGED
@@ -899,6 +899,8 @@ declare const PropertySelector: React.FC<PropertySelectorProps>;
899
899
 
900
900
  interface KebabMenuProps {
901
901
  onConvertToAdvanced?: () => void;
902
+ /** When true, label reads "Add to advanced filters" instead of "Convert to advanced". */
903
+ hasAdvancedFilters?: boolean;
902
904
  onDelete?: () => void;
903
905
  open?: boolean;
904
906
  onOpenChange?: (open: boolean) => void;
@@ -931,6 +933,7 @@ interface InteractiveFilterChipProps {
931
933
  onPropertyChange?: (property: PropertyDefinition) => void;
932
934
  onDelete: () => void;
933
935
  onConvertToAdvanced?: () => void;
936
+ hasAdvancedFilters?: boolean;
934
937
  className?: string;
935
938
  }
936
939
  declare const InteractiveFilterChip: React.FC<InteractiveFilterChipProps>;
@@ -952,6 +955,12 @@ interface FilterSystemProps {
952
955
  mode?: FilterBarMode;
953
956
  /** Width breakpoint (px) for switching to minimal mode. Default: 600. */
954
957
  breakpoint?: number;
958
+ /**
959
+ * Constrain popovers to stay within the container bounds. Use this when
960
+ * FilterSystem lives inside an iframe or a fixed-width panel where content
961
+ * must not overflow.
962
+ */
963
+ bounded?: boolean;
955
964
  children?: React.ReactNode;
956
965
  actions?: React.ReactNode;
957
966
  className?: string;
@@ -989,6 +998,7 @@ interface AdvancedPopoverProps {
989
998
  open?: boolean;
990
999
  onOpenChange?: (open: boolean) => void;
991
1000
  children?: React.ReactNode;
1001
+ collisionBoundary?: Element | null;
992
1002
  }
993
1003
  declare const AdvancedPopover: React.FC<AdvancedPopoverProps>;
994
1004
 
@@ -1002,6 +1012,7 @@ interface SummaryChipProps {
1002
1012
  className?: string;
1003
1013
  open?: boolean;
1004
1014
  onOpenChange?: (open: boolean) => void;
1015
+ collisionBoundary?: Element | null;
1005
1016
  }
1006
1017
  declare const SummaryChip: React.FC<SummaryChipProps>;
1007
1018
 
package/dist/index.js CHANGED
@@ -7183,6 +7183,7 @@ var import_icons30 = require("@l3mpire/icons");
7183
7183
  var import_jsx_runtime51 = require("react/jsx-runtime");
7184
7184
  var KebabMenu = ({
7185
7185
  onConvertToAdvanced,
7186
+ hasAdvancedFilters = false,
7186
7187
  onDelete,
7187
7188
  open,
7188
7189
  onOpenChange,
@@ -7221,7 +7222,7 @@ var KebabMenu = ({
7221
7222
  className: "shrink-0 text-[var(--color-dropdown-item-icon)]"
7222
7223
  }
7223
7224
  ),
7224
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "text-sm font-regular leading-sm text-[var(--color-dropdown-item-text)]", children: "Convert to advanced" })
7225
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: "text-sm font-regular leading-sm text-[var(--color-dropdown-item-text)]", children: hasAdvancedFilters ? "Add to advanced filters" : "Convert to advanced" })
7225
7226
  ]
7226
7227
  }
7227
7228
  ),
@@ -7408,6 +7409,7 @@ var InteractiveFilterChip = ({
7408
7409
  onPropertyChange,
7409
7410
  onDelete,
7410
7411
  onConvertToAdvanced,
7412
+ hasAdvancedFilters = false,
7411
7413
  className
7412
7414
  }) => {
7413
7415
  const [operatorOpen, setOperatorOpen] = React46.useState(false);
@@ -7563,6 +7565,7 @@ var InteractiveFilterChip = ({
7563
7565
  open: kebabOpen,
7564
7566
  onOpenChange: setKebabOpen,
7565
7567
  onConvertToAdvanced,
7568
+ hasAdvancedFilters,
7566
7569
  onDelete,
7567
7570
  children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
7568
7571
  FilterChipSegment,
@@ -7892,6 +7895,27 @@ var AdvancedRow = ({
7892
7895
  ] }),
7893
7896
  condition.operator && !isNoValueOperator(condition.operator) && (() => {
7894
7897
  const inputType = getValueInputType(propertyDef.type, condition.operator);
7898
+ const isInline = inputType === "TextInput" || inputType === "NumberInput";
7899
+ if (isInline) {
7900
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
7901
+ "input",
7902
+ {
7903
+ type: inputType === "NumberInput" ? "number" : "text",
7904
+ value: condition.value ?? "",
7905
+ onChange: (e) => handleValueChange(
7906
+ inputType === "NumberInput" ? e.target.value === "" ? null : Number(e.target.value) : e.target.value
7907
+ ),
7908
+ placeholder: "Enter value...",
7909
+ className: cn(
7910
+ "flex-1 min-w-[80px] px-base py-sm",
7911
+ "bg-[var(--color-background)] border border-[var(--color-input)] rounded-base",
7912
+ "text-sm font-regular leading-sm text-[var(--color-foreground)]",
7913
+ "placeholder:text-[var(--color-muted-foreground)]",
7914
+ "focus:outline-none focus:ring-2 focus:ring-[var(--color-ring)] focus:ring-offset-0"
7915
+ )
7916
+ }
7917
+ );
7918
+ }
7895
7919
  const dateWide = inputType === "DatePicker" || inputType === "DateRange";
7896
7920
  return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(PopoverPrimitive11.Root, { open: valueOpen, onOpenChange: setValueOpen, children: [
7897
7921
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(PopoverPrimitive11.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
@@ -7907,7 +7931,7 @@ var AdvancedRow = ({
7907
7931
  "text-sm font-regular leading-sm whitespace-nowrap truncate text-left",
7908
7932
  hasValue ? "text-[var(--color-foreground)]" : "text-[var(--color-muted-foreground)]"
7909
7933
  ),
7910
- children: hasValue ? displayValue : "Enter a value"
7934
+ children: hasValue ? displayValue : "Select a value"
7911
7935
  }
7912
7936
  ),
7913
7937
  /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("span", { className: "flex items-center gap-xs shrink-0", children: [
@@ -8061,7 +8085,8 @@ var AdvancedPopover = ({
8061
8085
  onFiltersChange,
8062
8086
  open,
8063
8087
  onOpenChange,
8064
- children
8088
+ children,
8089
+ collisionBoundary
8065
8090
  }) => {
8066
8091
  const [addSelectorOpen, setAddSelectorOpen] = React51.useState(false);
8067
8092
  const [draftPickerOpen, setDraftPickerOpen] = React51.useState(false);
@@ -8209,6 +8234,7 @@ var AdvancedPopover = ({
8209
8234
  sideOffset: 4,
8210
8235
  align: "start",
8211
8236
  collisionPadding: 16,
8237
+ collisionBoundary: collisionBoundary ?? void 0,
8212
8238
  onOpenAutoFocus: (e) => e.preventDefault(),
8213
8239
  className: cn(
8214
8240
  "z-50 flex flex-col",
@@ -8216,7 +8242,7 @@ var AdvancedPopover = ({
8216
8242
  "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
8217
8243
  "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
8218
8244
  "data-[side=bottom]:slide-in-from-top-2",
8219
- "w-[min(640px,calc(100vw-32px))] min-w-[360px]"
8245
+ collisionBoundary ? "w-[min(640px,var(--radix-popover-content-available-width))] min-w-0" : "w-[min(640px,calc(100vw-32px))] min-w-[360px]"
8220
8246
  ),
8221
8247
  children: [
8222
8248
  /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "flex flex-col gap-base p-base", children: filters.length > 0 ? filters.map((node, i) => renderNode(node, i)) : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
@@ -8349,7 +8375,8 @@ var SummaryChip = ({
8349
8375
  children,
8350
8376
  className,
8351
8377
  open: openProp,
8352
- onOpenChange
8378
+ onOpenChange,
8379
+ collisionBoundary
8353
8380
  }) => {
8354
8381
  const [uncontrolledOpen, setUncontrolledOpen] = React52.useState(false);
8355
8382
  const isControlled = openProp !== void 0;
@@ -8517,6 +8544,7 @@ var SummaryChip = ({
8517
8544
  sideOffset: 4,
8518
8545
  align: "start",
8519
8546
  collisionPadding: 16,
8547
+ collisionBoundary: collisionBoundary ?? void 0,
8520
8548
  onOpenAutoFocus: (e) => e.preventDefault(),
8521
8549
  className: cn(
8522
8550
  "z-50 flex flex-col overflow-clip",
@@ -8524,7 +8552,7 @@ var SummaryChip = ({
8524
8552
  "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
8525
8553
  "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
8526
8554
  "data-[side=bottom]:slide-in-from-top-2",
8527
- "w-[min(640px,calc(100vw-32px))]"
8555
+ collisionBoundary ? "w-[min(640px,var(--radix-popover-content-available-width))]" : "w-[min(640px,calc(100vw-32px))]"
8528
8556
  ),
8529
8557
  children: [
8530
8558
  /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "flex flex-col gap-base p-base", children: filters.length > 0 ? filters.map((node, i) => renderNode(node, i)) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
@@ -8638,12 +8666,14 @@ var FilterSystem = ({
8638
8666
  sortFields,
8639
8667
  mode: modeOverride,
8640
8668
  breakpoint,
8669
+ bounded = false,
8641
8670
  children,
8642
8671
  actions,
8643
8672
  className
8644
8673
  }) => {
8645
8674
  const containerRef = React54.useRef(null);
8646
8675
  const mode = useFilterBarMode(containerRef, modeOverride, breakpoint);
8676
+ const collisionBoundary = bounded ? containerRef.current : void 0;
8647
8677
  const [propertySelectorOpen, setPropertySelectorOpen] = React54.useState(false);
8648
8678
  const [advancedOpen, setAdvancedOpen] = React54.useState(false);
8649
8679
  const [summaryOpen, setSummaryOpen] = React54.useState(false);
@@ -8763,6 +8793,7 @@ var FilterSystem = ({
8763
8793
  onClearAll: handleClearAll,
8764
8794
  open: summaryOpen,
8765
8795
  onOpenChange: setSummaryOpen,
8796
+ collisionBoundary,
8766
8797
  children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8767
8798
  FilterBarButton,
8768
8799
  {
@@ -8783,6 +8814,7 @@ var FilterSystem = ({
8783
8814
  onFiltersChange: handleAdvancedFiltersChange,
8784
8815
  open: advancedOpen,
8785
8816
  onOpenChange: setAdvancedOpen,
8817
+ collisionBoundary,
8786
8818
  children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
8787
8819
  AdvancedChip,
8788
8820
  {
@@ -8807,7 +8839,8 @@ var FilterSystem = ({
8807
8839
  onUpdate: handleUpdateFilter,
8808
8840
  onPropertyChange: (newProp) => handlePropertyChange(filter.id, newProp),
8809
8841
  onDelete: () => handleDeleteFilter(filter.id),
8810
- onConvertToAdvanced: () => handleConvertToAdvanced(filter.id)
8842
+ onConvertToAdvanced: () => handleConvertToAdvanced(filter.id),
8843
+ hasAdvancedFilters: hasAdvanced
8811
8844
  },
8812
8845
  filter.id
8813
8846
  );