@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.mjs CHANGED
@@ -7086,6 +7086,7 @@ import { Icon as Icon29, faArrowRightOutline as faArrowRightOutline2, faTrashOut
7086
7086
  import { jsx as jsx51, jsxs as jsxs45 } from "react/jsx-runtime";
7087
7087
  var KebabMenu = ({
7088
7088
  onConvertToAdvanced,
7089
+ hasAdvancedFilters = false,
7089
7090
  onDelete,
7090
7091
  open,
7091
7092
  onOpenChange,
@@ -7124,7 +7125,7 @@ var KebabMenu = ({
7124
7125
  className: "shrink-0 text-[var(--color-dropdown-item-icon)]"
7125
7126
  }
7126
7127
  ),
7127
- /* @__PURE__ */ jsx51("span", { className: "text-sm font-regular leading-sm text-[var(--color-dropdown-item-text)]", children: "Convert to advanced" })
7128
+ /* @__PURE__ */ jsx51("span", { className: "text-sm font-regular leading-sm text-[var(--color-dropdown-item-text)]", children: hasAdvancedFilters ? "Add to advanced filters" : "Convert to advanced" })
7128
7129
  ]
7129
7130
  }
7130
7131
  ),
@@ -7311,6 +7312,7 @@ var InteractiveFilterChip = ({
7311
7312
  onPropertyChange,
7312
7313
  onDelete,
7313
7314
  onConvertToAdvanced,
7315
+ hasAdvancedFilters = false,
7314
7316
  className
7315
7317
  }) => {
7316
7318
  const [operatorOpen, setOperatorOpen] = React46.useState(false);
@@ -7466,6 +7468,7 @@ var InteractiveFilterChip = ({
7466
7468
  open: kebabOpen,
7467
7469
  onOpenChange: setKebabOpen,
7468
7470
  onConvertToAdvanced,
7471
+ hasAdvancedFilters,
7469
7472
  onDelete,
7470
7473
  children: /* @__PURE__ */ jsx53("div", { children: /* @__PURE__ */ jsx53(
7471
7474
  FilterChipSegment,
@@ -7802,6 +7805,27 @@ var AdvancedRow = ({
7802
7805
  ] }),
7803
7806
  condition.operator && !isNoValueOperator(condition.operator) && (() => {
7804
7807
  const inputType = getValueInputType(propertyDef.type, condition.operator);
7808
+ const isInline = inputType === "TextInput" || inputType === "NumberInput";
7809
+ if (isInline) {
7810
+ return /* @__PURE__ */ jsx56(
7811
+ "input",
7812
+ {
7813
+ type: inputType === "NumberInput" ? "number" : "text",
7814
+ value: condition.value ?? "",
7815
+ onChange: (e) => handleValueChange(
7816
+ inputType === "NumberInput" ? e.target.value === "" ? null : Number(e.target.value) : e.target.value
7817
+ ),
7818
+ placeholder: "Enter value...",
7819
+ className: cn(
7820
+ "flex-1 min-w-[80px] px-base py-sm",
7821
+ "bg-[var(--color-background)] border border-[var(--color-input)] rounded-base",
7822
+ "text-sm font-regular leading-sm text-[var(--color-foreground)]",
7823
+ "placeholder:text-[var(--color-muted-foreground)]",
7824
+ "focus:outline-none focus:ring-2 focus:ring-[var(--color-ring)] focus:ring-offset-0"
7825
+ )
7826
+ }
7827
+ );
7828
+ }
7805
7829
  const dateWide = inputType === "DatePicker" || inputType === "DateRange";
7806
7830
  return /* @__PURE__ */ jsxs50(PopoverPrimitive11.Root, { open: valueOpen, onOpenChange: setValueOpen, children: [
7807
7831
  /* @__PURE__ */ jsx56(PopoverPrimitive11.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs50(
@@ -7817,7 +7841,7 @@ var AdvancedRow = ({
7817
7841
  "text-sm font-regular leading-sm whitespace-nowrap truncate text-left",
7818
7842
  hasValue ? "text-[var(--color-foreground)]" : "text-[var(--color-muted-foreground)]"
7819
7843
  ),
7820
- children: hasValue ? displayValue : "Enter a value"
7844
+ children: hasValue ? displayValue : "Select a value"
7821
7845
  }
7822
7846
  ),
7823
7847
  /* @__PURE__ */ jsxs50("span", { className: "flex items-center gap-xs shrink-0", children: [
@@ -7968,7 +7992,8 @@ var AdvancedPopover = ({
7968
7992
  onFiltersChange,
7969
7993
  open,
7970
7994
  onOpenChange,
7971
- children
7995
+ children,
7996
+ collisionBoundary
7972
7997
  }) => {
7973
7998
  const [addSelectorOpen, setAddSelectorOpen] = React51.useState(false);
7974
7999
  const [draftPickerOpen, setDraftPickerOpen] = React51.useState(false);
@@ -8119,6 +8144,7 @@ var AdvancedPopover = ({
8119
8144
  sideOffset: 4,
8120
8145
  align: "start",
8121
8146
  collisionPadding: 16,
8147
+ collisionBoundary: collisionBoundary ?? void 0,
8122
8148
  onOpenAutoFocus: (e) => e.preventDefault(),
8123
8149
  className: cn(
8124
8150
  "z-50 flex flex-col",
@@ -8126,7 +8152,7 @@ var AdvancedPopover = ({
8126
8152
  "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
8127
8153
  "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
8128
8154
  "data-[side=bottom]:slide-in-from-top-2",
8129
- "w-[min(640px,calc(100vw-32px))] min-w-[360px]"
8155
+ collisionBoundary ? "w-[min(640px,var(--radix-popover-content-available-width))] min-w-0" : "w-[min(640px,calc(100vw-32px))] min-w-[360px]"
8130
8156
  ),
8131
8157
  children: [
8132
8158
  /* @__PURE__ */ jsx58("div", { className: "flex flex-col gap-base p-base", children: filters.length > 0 ? filters.map((node, i) => renderNode(node, i)) : /* @__PURE__ */ jsx58(
@@ -8259,7 +8285,8 @@ var SummaryChip = ({
8259
8285
  children,
8260
8286
  className,
8261
8287
  open: openProp,
8262
- onOpenChange
8288
+ onOpenChange,
8289
+ collisionBoundary
8263
8290
  }) => {
8264
8291
  const [uncontrolledOpen, setUncontrolledOpen] = React52.useState(false);
8265
8292
  const isControlled = openProp !== void 0;
@@ -8427,6 +8454,7 @@ var SummaryChip = ({
8427
8454
  sideOffset: 4,
8428
8455
  align: "start",
8429
8456
  collisionPadding: 16,
8457
+ collisionBoundary: collisionBoundary ?? void 0,
8430
8458
  onOpenAutoFocus: (e) => e.preventDefault(),
8431
8459
  className: cn(
8432
8460
  "z-50 flex flex-col overflow-clip",
@@ -8434,7 +8462,7 @@ var SummaryChip = ({
8434
8462
  "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
8435
8463
  "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
8436
8464
  "data-[side=bottom]:slide-in-from-top-2",
8437
- "w-[min(640px,calc(100vw-32px))]"
8465
+ collisionBoundary ? "w-[min(640px,var(--radix-popover-content-available-width))]" : "w-[min(640px,calc(100vw-32px))]"
8438
8466
  ),
8439
8467
  children: [
8440
8468
  /* @__PURE__ */ jsx59("div", { className: "flex flex-col gap-base p-base", children: filters.length > 0 ? filters.map((node, i) => renderNode(node, i)) : /* @__PURE__ */ jsx59(
@@ -8548,12 +8576,14 @@ var FilterSystem = ({
8548
8576
  sortFields,
8549
8577
  mode: modeOverride,
8550
8578
  breakpoint,
8579
+ bounded = false,
8551
8580
  children,
8552
8581
  actions,
8553
8582
  className
8554
8583
  }) => {
8555
8584
  const containerRef = React54.useRef(null);
8556
8585
  const mode = useFilterBarMode(containerRef, modeOverride, breakpoint);
8586
+ const collisionBoundary = bounded ? containerRef.current : void 0;
8557
8587
  const [propertySelectorOpen, setPropertySelectorOpen] = React54.useState(false);
8558
8588
  const [advancedOpen, setAdvancedOpen] = React54.useState(false);
8559
8589
  const [summaryOpen, setSummaryOpen] = React54.useState(false);
@@ -8673,6 +8703,7 @@ var FilterSystem = ({
8673
8703
  onClearAll: handleClearAll,
8674
8704
  open: summaryOpen,
8675
8705
  onOpenChange: setSummaryOpen,
8706
+ collisionBoundary,
8676
8707
  children: /* @__PURE__ */ jsx60(
8677
8708
  FilterBarButton,
8678
8709
  {
@@ -8693,6 +8724,7 @@ var FilterSystem = ({
8693
8724
  onFiltersChange: handleAdvancedFiltersChange,
8694
8725
  open: advancedOpen,
8695
8726
  onOpenChange: setAdvancedOpen,
8727
+ collisionBoundary,
8696
8728
  children: /* @__PURE__ */ jsx60(
8697
8729
  AdvancedChip,
8698
8730
  {
@@ -8717,7 +8749,8 @@ var FilterSystem = ({
8717
8749
  onUpdate: handleUpdateFilter,
8718
8750
  onPropertyChange: (newProp) => handlePropertyChange(filter.id, newProp),
8719
8751
  onDelete: () => handleDeleteFilter(filter.id),
8720
- onConvertToAdvanced: () => handleConvertToAdvanced(filter.id)
8752
+ onConvertToAdvanced: () => handleConvertToAdvanced(filter.id),
8753
+ hasAdvancedFilters: hasAdvanced
8721
8754
  },
8722
8755
  filter.id
8723
8756
  );