@elsapiens/ui 0.1.4 → 0.1.6
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 +12 -2
- package/dist/index.js +24 -15
- package/package.json +10 -10
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
|
|
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:
|
|
2966
|
-
|
|
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,
|
|
@@ -6605,7 +6614,7 @@ var NumericInput = forwardRef12(
|
|
|
6605
6614
|
const displayValue = value !== null && value !== void 0 ? String(value) : "";
|
|
6606
6615
|
return /* @__PURE__ */ jsxs21("div", { className: "w-full", children: [
|
|
6607
6616
|
/* @__PURE__ */ jsxs21("div", { className: "relative", children: [
|
|
6608
|
-
prefix && /* @__PURE__ */ jsx22("div", { className: "
|
|
6617
|
+
prefix && /* @__PURE__ */ jsx22("div", { className: "el-input-prefix-icon", children: prefix }),
|
|
6609
6618
|
/* @__PURE__ */ jsx22(
|
|
6610
6619
|
"input",
|
|
6611
6620
|
{
|
|
@@ -6619,14 +6628,14 @@ var NumericInput = forwardRef12(
|
|
|
6619
6628
|
className: cn22(
|
|
6620
6629
|
"el-input el-input-md el-numeric-input",
|
|
6621
6630
|
error && "el-input-invalid",
|
|
6622
|
-
prefix && "
|
|
6623
|
-
suffix && "
|
|
6631
|
+
prefix && "el-input-has-prefix-narrow",
|
|
6632
|
+
suffix && "el-input-has-suffix",
|
|
6624
6633
|
className
|
|
6625
6634
|
),
|
|
6626
6635
|
...props
|
|
6627
6636
|
}
|
|
6628
6637
|
),
|
|
6629
|
-
suffix && /* @__PURE__ */ jsx22("div", { className: "
|
|
6638
|
+
suffix && /* @__PURE__ */ jsx22("div", { className: "el-input-suffix-icon", children: suffix })
|
|
6630
6639
|
] }),
|
|
6631
6640
|
!hideMessage && error && /* @__PURE__ */ jsx22("div", { className: "el-field-message", children: /* @__PURE__ */ jsx22("p", { className: "el-field-error", children: error }) })
|
|
6632
6641
|
] });
|
|
@@ -6755,10 +6764,10 @@ function PhoneInput({
|
|
|
6755
6764
|
hasError && "el-input-invalid"
|
|
6756
6765
|
),
|
|
6757
6766
|
children: [
|
|
6758
|
-
/* @__PURE__ */ jsx23("div", { className: "flex-shrink-0 border-r border-input flex items-
|
|
6767
|
+
/* @__PURE__ */ jsx23("div", { className: "flex-shrink-0 border-r border-input flex items-center el-pl-md", children: /* @__PURE__ */ jsx23(
|
|
6759
6768
|
SearchableSelect,
|
|
6760
6769
|
{
|
|
6761
|
-
className: "!border-0 !
|
|
6770
|
+
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
6771
|
disabled,
|
|
6763
6772
|
options: COUNTRY_OPTIONS,
|
|
6764
6773
|
placeholder: "Country",
|
|
@@ -13085,9 +13094,9 @@ var Summary = forwardRef44(
|
|
|
13085
13094
|
ref: scrollContainerRef,
|
|
13086
13095
|
className: "overflow-x-auto hide-native-scrollbar",
|
|
13087
13096
|
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: [
|
|
13097
|
+
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
13098
|
/* @__PURE__ */ jsx58(SummaryItem, { ...item }),
|
|
13090
|
-
showDividers && index < items.length - 1 && /* @__PURE__ */ jsx58("div", { className: "w-px h-8 bg-border flex-shrink-0" })
|
|
13099
|
+
showDividers && index < items.length - 1 && /* @__PURE__ */ jsx58("div", { className: "w-px h-8 bg-border flex-shrink-0 el-mx-md" })
|
|
13091
13100
|
] }, index)) })
|
|
13092
13101
|
}
|
|
13093
13102
|
),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elsapiens/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
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
|
+
}
|