@elsapiens/ui 0.1.4 → 0.1.7

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 CHANGED
@@ -609,6 +609,12 @@ interface ModalProps {
609
609
  children: ReactNode;
610
610
  /** Optional footer content (typically action buttons) */
611
611
  footer?: ReactNode;
612
+ /** Whether the modal body should be scrollable (default: true) */
613
+ scrollable?: boolean;
614
+ /** Whether the modal body should have padding (default: true) */
615
+ padded?: boolean;
616
+ /** Custom header content, replaces the default title bar */
617
+ header?: ReactNode;
612
618
  }
613
619
  /**
614
620
  * A dialog overlay component for displaying content that requires user attention.
@@ -660,7 +666,7 @@ interface ModalProps {
660
666
  * <ImportantFormThatShouldNotBeAccidentallyClosed />
661
667
  * </Modal>
662
668
  */
663
- declare function Modal({ isOpen, onClose, title, description, size, closeOnOutsideClick, closeOnEscape, showCloseButton, children, footer, }: ModalProps): react.ReactPortal | null;
669
+ declare function Modal({ isOpen, onClose, title, description, size, closeOnOutsideClick, closeOnEscape, showCloseButton, children, footer, scrollable, padded, header, }: ModalProps): react.ReactPortal | null;
664
670
  /**
665
671
  * Props for the ConfirmDialog component.
666
672
  */
@@ -856,6 +862,10 @@ interface TooltipProps {
856
862
  delayDuration?: number;
857
863
  /** Additional CSS classes for the tooltip */
858
864
  className?: string;
865
+ /** Additional CSS classes for the trigger wrapper element */
866
+ wrapperClassName?: string;
867
+ /** Additional inline styles for the trigger wrapper element (useful for fixed positioning) */
868
+ wrapperStyle?: React.CSSProperties;
859
869
  }
860
870
  /**
861
871
  * A floating label that appears on hover/focus to provide additional context.
@@ -892,7 +902,7 @@ interface TooltipProps {
892
902
  * <InfoIcon />
893
903
  * </Tooltip>
894
904
  */
895
- declare function Tooltip({ content, children, side, delayDuration, className, }: TooltipProps): react_jsx_runtime.JSX.Element;
905
+ declare function Tooltip({ content, children, side, delayDuration, className, wrapperClassName, wrapperStyle, }: TooltipProps): react_jsx_runtime.JSX.Element;
896
906
 
897
907
  /**
898
908
  * Hook to detect mobile viewport based on window width.
package/dist/index.js CHANGED
@@ -2838,7 +2838,10 @@ function Modal({
2838
2838
  closeOnEscape = true,
2839
2839
  showCloseButton = true,
2840
2840
  children,
2841
- footer
2841
+ footer,
2842
+ scrollable = true,
2843
+ padded = true,
2844
+ header
2842
2845
  }) {
2843
2846
  const modalRef = useRef7(null);
2844
2847
  const previousActiveElement = useRef7(null);
@@ -2911,7 +2914,7 @@ function Modal({
2911
2914
  ),
2912
2915
  onClick: (e) => e.stopPropagation(),
2913
2916
  children: [
2914
- (title || showCloseButton) && /* @__PURE__ */ jsxs10(
2917
+ header ? /* @__PURE__ */ jsx10("div", { className: "flex-none rounded-t-lg bg-card border-b border-border", children: header }) : title || showCloseButton ? /* @__PURE__ */ jsxs10(
2915
2918
  "div",
2916
2919
  {
2917
2920
  className: "flex items-start justify-between border-b border-border bg-card rounded-t-lg",
@@ -2958,12 +2961,15 @@ function Modal({
2958
2961
  )
2959
2962
  ]
2960
2963
  }
2961
- ),
2964
+ ) : null,
2962
2965
  /* @__PURE__ */ jsx10(
2963
2966
  "div",
2964
2967
  {
2965
- className: "overflow-y-auto flex-1 min-h-0",
2966
- style: { padding: "var(--modal-padding)" },
2968
+ className: cn10(
2969
+ "flex-1 min-h-0",
2970
+ scrollable ? "overflow-y-auto" : "overflow-hidden"
2971
+ ),
2972
+ style: padded ? { padding: "var(--modal-padding)" } : void 0,
2967
2973
  children
2968
2974
  }
2969
2975
  ),
@@ -3238,7 +3244,9 @@ function Tooltip({
3238
3244
  children,
3239
3245
  side = "top",
3240
3246
  delayDuration = 200,
3241
- className
3247
+ className,
3248
+ wrapperClassName,
3249
+ wrapperStyle
3242
3250
  }) {
3243
3251
  const [isOpen, setIsOpen] = useState9(false);
3244
3252
  const [position, setPosition] = useState9({ top: 0, left: 0 });
@@ -3290,7 +3298,8 @@ function Tooltip({
3290
3298
  "div",
3291
3299
  {
3292
3300
  ref: triggerRef,
3293
- className: "inline-block",
3301
+ className: cn12("inline-block", wrapperClassName),
3302
+ style: wrapperStyle,
3294
3303
  onMouseEnter: showTooltip,
3295
3304
  onMouseLeave: hideTooltip,
3296
3305
  onFocus: showTooltip,
@@ -5230,6 +5239,11 @@ function FilterBar({
5230
5239
  searchInputRef.current.focus();
5231
5240
  }
5232
5241
  }, [isSearchOpen]);
5242
+ useEffect11(() => {
5243
+ if (search?.value && !isSearchOpen) {
5244
+ setIsSearchOpen(true);
5245
+ }
5246
+ }, [search?.value]);
5233
5247
  const addFilter = (fieldId) => {
5234
5248
  const field = fields.find((f) => f.id === fieldId);
5235
5249
  if (!field || !onConditionsChange) return;
@@ -6605,7 +6619,7 @@ var NumericInput = forwardRef12(
6605
6619
  const displayValue = value !== null && value !== void 0 ? String(value) : "";
6606
6620
  return /* @__PURE__ */ jsxs21("div", { className: "w-full", children: [
6607
6621
  /* @__PURE__ */ jsxs21("div", { className: "relative", children: [
6608
- prefix && /* @__PURE__ */ jsx22("div", { className: "absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-muted-foreground", children: prefix }),
6622
+ prefix && /* @__PURE__ */ jsx22("div", { className: "el-input-prefix-icon", children: prefix }),
6609
6623
  /* @__PURE__ */ jsx22(
6610
6624
  "input",
6611
6625
  {
@@ -6619,14 +6633,14 @@ var NumericInput = forwardRef12(
6619
6633
  className: cn22(
6620
6634
  "el-input el-input-md el-numeric-input",
6621
6635
  error && "el-input-invalid",
6622
- prefix && "pl-8",
6623
- suffix && "pr-8",
6636
+ prefix && "el-input-has-prefix-narrow",
6637
+ suffix && "el-input-has-suffix",
6624
6638
  className
6625
6639
  ),
6626
6640
  ...props
6627
6641
  }
6628
6642
  ),
6629
- suffix && /* @__PURE__ */ jsx22("div", { className: "absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none text-muted-foreground", children: suffix })
6643
+ suffix && /* @__PURE__ */ jsx22("div", { className: "el-input-suffix-icon", children: suffix })
6630
6644
  ] }),
6631
6645
  !hideMessage && error && /* @__PURE__ */ jsx22("div", { className: "el-field-message", children: /* @__PURE__ */ jsx22("p", { className: "el-field-error", children: error }) })
6632
6646
  ] });
@@ -6755,10 +6769,10 @@ function PhoneInput({
6755
6769
  hasError && "el-input-invalid"
6756
6770
  ),
6757
6771
  children: [
6758
- /* @__PURE__ */ jsx23("div", { className: "flex-shrink-0 border-r border-input flex items-stretch overflow-hidden pl-2", children: /* @__PURE__ */ jsx23(
6772
+ /* @__PURE__ */ jsx23("div", { className: "flex-shrink-0 border-r border-input flex items-center el-pl-md", children: /* @__PURE__ */ jsx23(
6759
6773
  SearchableSelect,
6760
6774
  {
6761
- className: "!border-0 !h-full !shadow-none !ring-0 !outline-none focus:!ring-0 focus:!outline-none focus-within:!ring-0 focus-within:!outline-none !rounded-none min-w-[100px] [&>button]:!border-0 [&>button]:!shadow-none [&>button]:!ring-0 [&>button]:!rounded-none [&>button]:h-full [&>button]:!ml-0",
6775
+ className: "!border-0 !shadow-none !ring-0 !outline-none focus:!ring-0 focus:!outline-none focus-within:!ring-0 focus-within:!outline-none !rounded-none [&>button]:!border-0 [&>button]:!shadow-none [&>button]:!ring-0 [&>button]:!rounded-none [&>button]:!bg-transparent [&>button>svg]:hidden [&>button]:el-px-md",
6762
6776
  disabled,
6763
6777
  options: COUNTRY_OPTIONS,
6764
6778
  placeholder: "Country",
@@ -13085,9 +13099,9 @@ var Summary = forwardRef44(
13085
13099
  ref: scrollContainerRef,
13086
13100
  className: "overflow-x-auto hide-native-scrollbar",
13087
13101
  onScroll: handleScroll,
13088
- children: /* @__PURE__ */ jsx58("div", { ref: itemsContainerRef, className: "flex items-center", children: items.map((item, index) => /* @__PURE__ */ jsxs49("div", { className: "flex items-center", children: [
13102
+ children: /* @__PURE__ */ jsx58("div", { ref: itemsContainerRef, className: "flex items-center el-px-md", children: items.map((item, index) => /* @__PURE__ */ jsxs49("div", { className: "flex items-center", children: [
13089
13103
  /* @__PURE__ */ jsx58(SummaryItem, { ...item }),
13090
- showDividers && index < items.length - 1 && /* @__PURE__ */ jsx58("div", { className: "w-px h-8 bg-border flex-shrink-0" })
13104
+ showDividers && index < items.length - 1 && /* @__PURE__ */ jsx58("div", { className: "w-px h-8 bg-border flex-shrink-0 el-mx-md" })
13091
13105
  ] }, index)) })
13092
13106
  }
13093
13107
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elsapiens/ui",
3
- "version": "0.1.4",
3
+ "version": "0.1.7",
4
4
  "description": "UI components for elSapiens SDK",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -20,14 +20,6 @@
20
20
  "files": [
21
21
  "dist"
22
22
  ],
23
- "scripts": {
24
- "build": "tsup src/index.ts --format esm --dts --clean --external react --external react-dom --external lucide-react",
25
- "dev": "tsup src/index.ts --format esm --dts --watch --external react --external react-dom --external lucide-react",
26
- "clean": "rm -rf dist",
27
- "typecheck": "tsc --noEmit",
28
- "test": "vitest run",
29
- "test:watch": "vitest"
30
- },
31
23
  "publishConfig": {
32
24
  "access": "public"
33
25
  },
@@ -49,5 +41,13 @@
49
41
  "peerDependencies": {
50
42
  "react": "^18.2.0",
51
43
  "react-dom": "^18.2.0"
44
+ },
45
+ "scripts": {
46
+ "build": "tsup src/index.ts --format esm --dts --clean --external react --external react-dom --external lucide-react",
47
+ "dev": "tsup src/index.ts --format esm --dts --watch --external react --external react-dom --external lucide-react",
48
+ "clean": "rm -rf dist",
49
+ "typecheck": "tsc --noEmit",
50
+ "test": "vitest run",
51
+ "test:watch": "vitest"
52
52
  }
53
- }
53
+ }