elseware-ui 2.17.3 → 2.18.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.
@@ -1,7 +1,10 @@
1
1
  import { FieldHookConfig } from "formik";
2
- interface DateSelectorProps {
2
+ import { Shape } from "../../../data/enums";
3
+ interface DateSelectorProps extends FieldHookConfig<string> {
4
+ name: string;
3
5
  placeholder: string;
4
6
  styles?: string;
7
+ shape?: keyof typeof Shape;
5
8
  }
6
- export declare const DateSelector: ({ placeholder, styles, ...props }: FieldHookConfig<string> & DateSelectorProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const DateSelector: ({ placeholder, styles, shape, ...props }: DateSelectorProps) => import("react/jsx-runtime").JSX.Element;
7
10
  export default DateSelector;
@@ -1,6 +1,8 @@
1
+ import { Shape } from "../../../../data/enums";
1
2
  interface InputListProps {
2
3
  name: string;
3
4
  placeholder?: string;
5
+ shape?: keyof typeof Shape;
4
6
  }
5
- export declare const InputList: ({ name, placeholder }: InputListProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const InputList: ({ name, placeholder, shape }: InputListProps) => import("react/jsx-runtime").JSX.Element;
6
8
  export {};
@@ -1,6 +1,8 @@
1
+ import { Shape } from "../../../../data/enums";
1
2
  interface InputListGroupProps {
2
3
  name: string;
3
4
  placeholder?: string;
5
+ shape?: keyof typeof Shape;
4
6
  }
5
- export declare const InputListGroup: ({ name, placeholder }: InputListGroupProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const InputListGroup: ({ name, placeholder, shape, }: InputListGroupProps) => import("react/jsx-runtime").JSX.Element;
6
8
  export {};
@@ -1,8 +1,11 @@
1
1
  import { FieldHookConfig } from "formik";
2
- export interface SelectProps {
2
+ import { Shape } from "../../../data/enums";
3
+ export interface SelectProps extends FieldHookConfig<string> {
4
+ name: string;
3
5
  placeholder: string;
4
6
  options: any[];
5
7
  styles?: string;
8
+ shape?: keyof typeof Shape;
6
9
  }
7
- declare function Select({ placeholder, options, styles, ...props }: FieldHookConfig<string> & SelectProps): import("react/jsx-runtime").JSX.Element;
10
+ declare function Select({ placeholder, options, styles, shape, ...props }: SelectProps): import("react/jsx-runtime").JSX.Element;
8
11
  export default Select;
@@ -1,8 +1,11 @@
1
1
  import { FieldHookConfig } from "formik";
2
- export interface TextAreaProps {
2
+ import { Shape } from "../../../data/enums";
3
+ export interface TextAreaProps extends FieldHookConfig<string> {
4
+ name: string;
3
5
  placeholder: string;
4
6
  limit: number;
5
7
  styles?: string;
8
+ shape?: keyof typeof Shape;
6
9
  }
7
- declare function TextArea({ placeholder, limit, styles, ...props }: FieldHookConfig<string> & TextAreaProps): import("react/jsx-runtime").JSX.Element;
10
+ declare function TextArea({ placeholder, limit, styles, shape, ...props }: TextAreaProps): import("react/jsx-runtime").JSX.Element;
8
11
  export default TextArea;
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import { EUIConfigs } from "./EUITypes";
3
+ export declare const EUIProvider: ({ config, children, }: {
4
+ config: EUIConfigs;
5
+ children: React.ReactNode;
6
+ }) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const useEUIConfig: () => EUIConfigs | null;
@@ -0,0 +1,10 @@
1
+ import { Variant, Shape, Size } from "../../data/enums";
2
+ export interface EUIComponentDefaults {
3
+ variant?: keyof typeof Variant;
4
+ size?: keyof typeof Size;
5
+ shape?: keyof typeof Shape;
6
+ styles?: string;
7
+ }
8
+ export interface EUIConfigs {
9
+ global?: EUIComponentDefaults;
10
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./EUIProvider";
2
+ export * from "./EUITypes";
3
+ export * from "./resolveGlobalConfigs";
@@ -0,0 +1,2 @@
1
+ import { EUIConfigs } from "./EUITypes";
2
+ export declare function resolveWithGlobal<T>(config: EUIConfigs | null, props: T, defaults: Partial<T>): T;
@@ -1,5 +1,6 @@
1
1
  export * from "./data-display";
2
2
  export * from "./data-entry";
3
+ export * from "./eui";
3
4
  export * from "./feedback";
4
5
  export * from "./general";
5
6
  export * from "./layout";
package/build/index.es.js CHANGED
@@ -67984,6 +67984,18 @@ function WorldMapCountryTable(_a) {
67984
67984
  return (jsx("div", __assign$1({ className: "bg-white dark:bg-neutral-950 rounded-2xl shadow-md p-4" }, { children: jsx(Table, { title: title, data: finalData, columns: columns, defaultPageSize: defaultPageSize, pageSizeOptions: [5, 10, "All"] }) })));
67985
67985
  }
67986
67986
 
67987
+ var EUIContext = createContext$1(null);
67988
+ var EUIProvider = function (_a) {
67989
+ var config = _a.config, children = _a.children;
67990
+ return jsx(EUIContext.Provider, __assign$1({ value: config }, { children: children }));
67991
+ };
67992
+ var useEUIConfig = function () { return useContext(EUIContext); };
67993
+
67994
+ function resolveWithGlobal(config, props, defaults) {
67995
+ var _a;
67996
+ return __assign$1(__assign$1(__assign$1({}, defaults), ((_a = config === null || config === void 0 ? void 0 : config.global) !== null && _a !== void 0 ? _a : {})), props);
67997
+ }
67998
+
67987
67999
  var sizes = {
67988
68000
  xs: "px-2 py-1 text-xs",
67989
68001
  sm: "px-3 py-1.5 text-sm",
@@ -67993,7 +68005,11 @@ var sizes = {
67993
68005
  };
67994
68006
  var Button$2 = function (_a) {
67995
68007
  var _b;
67996
- var _c = _a.type, type = _c === void 0 ? "button" : _c, icon = _a.icon, text = _a.text, children = _a.children, loading = _a.loading, disabled = _a.disabled, ghost = _a.ghost, block = _a.block, _d = _a.variant, variant = _d === void 0 ? "default" : _d, _e = _a.shape, shape = _e === void 0 ? "square" : _e, _f = _a.size, size = _f === void 0 ? "md" : _f, styles = _a.styles, onClick = _a.onClick;
68008
+ var _c, _d;
68009
+ var _e = _a.type, type = _e === void 0 ? "button" : _e, icon = _a.icon, text = _a.text, children = _a.children, loading = _a.loading, disabled = _a.disabled, ghost = _a.ghost, block = _a.block, _f = _a.variant, variant = _f === void 0 ? "success" : _f, shape = _a.shape, _g = _a.size, size = _g === void 0 ? "md" : _g, styles = _a.styles, onClick = _a.onClick;
68010
+ var eui = useEUIConfig();
68011
+ // Resolved Global Overrides
68012
+ var resolvedShape = (_d = shape !== null && shape !== void 0 ? shape : (_c = eui === null || eui === void 0 ? void 0 : eui.global) === null || _c === void 0 ? void 0 : _c.shape) !== null && _d !== void 0 ? _d : "square";
67997
68013
  var btnRef = useRef(null);
67998
68014
  // 👉 Glow effect on mouse move
67999
68015
  var handleMouseMove = function (e) {
@@ -68012,7 +68028,7 @@ var Button$2 = function (_a) {
68012
68028
  },
68013
68029
  _b["".concat(variants[variant])] = !ghost,
68014
68030
  _b["".concat(variantsGhost[variant])] = ghost,
68015
- _b["".concat(shapes[shape])] = true,
68031
+ _b["".concat(shapes[resolvedShape])] = true,
68016
68032
  _b["".concat(sizes[size])] = true,
68017
68033
  _b["w-full"] = block,
68018
68034
  _b["brightness-75 grayscale text-gray-900 cursor-not-allowed"] = loading || disabled,
@@ -68061,9 +68077,13 @@ var PasswordVisibilityToggler = function (_a) {
68061
68077
  };
68062
68078
  var Input = function (_a) {
68063
68079
  var _b;
68064
- var _c = _a.type, type = _c === void 0 ? "text" : _c, placeholder = _a.placeholder, styles = _a.styles, step = _a.step, _d = _a.shape, shape = _d === void 0 ? "square" : _d, props = __rest$1(_a, ["type", "placeholder", "styles", "step", "shape"]);
68065
- var _e = useField(props), field = _e[0], meta = _e[1];
68066
- var _f = useState(false), passwordVisibility = _f[0], setPasswordVisibilty = _f[1];
68080
+ var _c, _d;
68081
+ var _e = _a.type, type = _e === void 0 ? "text" : _e, placeholder = _a.placeholder, styles = _a.styles, step = _a.step, shape = _a.shape, props = __rest$1(_a, ["type", "placeholder", "styles", "step", "shape"]);
68082
+ var eui = useEUIConfig();
68083
+ // Resolved Global Overrides
68084
+ var resolvedShape = (_d = shape !== null && shape !== void 0 ? shape : (_c = eui === null || eui === void 0 ? void 0 : eui.global) === null || _c === void 0 ? void 0 : _c.shape) !== null && _d !== void 0 ? _d : "square";
68085
+ var _f = useField(props), field = _f[0], meta = _f[1];
68086
+ var _g = useState(false), passwordVisibility = _g[0], setPasswordVisibilty = _g[1];
68067
68087
  // Determine the final input type
68068
68088
  var inputType = type === "password" ? toggleType(passwordVisibility) : type;
68069
68089
  return (jsxs("div", __assign$1({ className: "relative w-full" }, { children: [jsx(Field, __assign$1({ type: inputType, step: inputType === "number" && step ? step : undefined }, field, props, { placeholder: placeholder, className: classnames((_b = {
@@ -68071,7 +68091,7 @@ var Input = function (_a) {
68071
68091
  "border-eui-primary-400 focus:border-eui-secondary-500": !(meta.touched && meta.error),
68072
68092
  "border-eui-danger-500": meta.touched && meta.error
68073
68093
  },
68074
- _b["".concat(shapes[shape])] = shape,
68094
+ _b["".concat(shapes[resolvedShape])] = true,
68075
68095
  // "transition-all ease-in-out": true,
68076
68096
  _b["".concat(styles)] = styles,
68077
68097
  _b)) })), jsx(InputLabel, { text: placeholder, styles: "absolute left-2 top-[0.7px] eui-text-sm text-[13.5px] peer-placeholder-shown:text-base peer-placeholder-shown:top-3 pointer-events-none" }), type === "password" && (jsx(PasswordVisibilityToggler, { onClick: function (v) { return setPasswordVisibilty(v); } })), jsx(InputResponse, { name: field.name, visibility: meta.touched && meta.error ? true : false, variant: "danger" })] })));
@@ -78747,11 +78767,20 @@ var ConnectedDroppable = connect(makeMapStateToProps$1, mapDispatchToProps$1, nu
78747
78767
  ConnectedDroppable.defaultProps = defaultProps;
78748
78768
 
78749
78769
  var InputList = function (_a) {
78750
- var name = _a.name, placeholder = _a.placeholder;
78751
- var _b = useFormikContext(), values = _b.values, errors = _b.errors, touched = _b.touched;
78770
+ var _b, _c;
78771
+ var name = _a.name, placeholder = _a.placeholder, shape = _a.shape;
78772
+ var eui = useEUIConfig();
78773
+ // Resolved Global Overrides
78774
+ var resolvedShape = (_c = shape !== null && shape !== void 0 ? shape : (_b = eui === null || eui === void 0 ? void 0 : eui.global) === null || _b === void 0 ? void 0 : _b.shape) !== null && _c !== void 0 ? _c : "square";
78775
+ var _d = useFormikContext(), values = _d.values, errors = _d.errors, touched = _d.touched;
78752
78776
  return (jsxs("div", { children: [jsx(InputLabel, { text: placeholder }), jsx("div", __assign$1({ className: "mt-2" }, { children: jsx(FieldArray, __assign$1({ name: name }, { children: function (_a) {
78777
+ var _b;
78753
78778
  var push = _a.push, remove = _a.remove, move = _a.move;
78754
- return (jsxs("div", __assign$1({ className: "flex flex-col space-y-2 w-full bg-eui-primary-300/10 rounded-md" }, { children: [jsx(DragDropContext, __assign$1({ onDragEnd: function (result) {
78779
+ return (jsxs("div", __assign$1({ className: classnames((_b = {
78780
+ "flex flex-col space-y-2 w-full bg-eui-primary-300/10": true
78781
+ },
78782
+ _b["".concat(shapes[resolvedShape])] = true,
78783
+ _b)) }, { children: [jsx(DragDropContext, __assign$1({ onDragEnd: function (result) {
78755
78784
  if (!result.destination)
78756
78785
  return;
78757
78786
  move(result.source.index, result.destination.index);
@@ -78759,7 +78788,7 @@ var InputList = function (_a) {
78759
78788
  var _a;
78760
78789
  return (jsxs("div", __assign$1({ ref: provided.innerRef }, provided.droppableProps, { children: [(_a = values[name]) === null || _a === void 0 ? void 0 : _a.map(function (_, index) { return (jsx(PublicDraggable, __assign$1({ draggableId: index.toString(), index: index }, { children: function (provided) {
78761
78790
  var _a;
78762
- return (jsxs("div", __assign$1({ ref: provided.innerRef }, provided.draggableProps, { className: "flex items-center space-x-2 bg-eui-primary-300/10 p-2" }, { children: [jsx("div", __assign$1({}, provided.dragHandleProps, { children: jsx(FaGripVertical, { className: "cursor-grab text-gray-500" }) })), jsx(Field, { name: "".concat(name, "[").concat(index, "]"), placeholder: "Item ".concat(index + 1), className: classnames("border peer w-full rounded-sm bg-eui-primary-300/10 pt-5 px-3 pb-2 text-md eui-text-md placeholder-transparent placeholder-shown:p-3 focus:outline-none h-[50px]", ((_a = errors[name]) === null || _a === void 0 ? void 0 : _a[index])
78791
+ return (jsxs("div", __assign$1({ ref: provided.innerRef }, provided.draggableProps, { className: "flex items-center space-x-2 bg-eui-primary-300/10 p-2" }, { children: [jsx("div", __assign$1({}, provided.dragHandleProps, { children: jsx(FaGripVertical, { className: "cursor-grab text-gray-500" }) })), jsx(Field, { name: "".concat(name, "[").concat(index, "]"), placeholder: "Item ".concat(index + 1), className: classnames("border peer w-full bg-eui-primary-300/10 pt-5 px-3 pb-2 text-md eui-text-md placeholder-transparent placeholder-shown:p-3 focus:outline-none h-[50px]", ["".concat(shapes[resolvedShape])], ((_a = errors[name]) === null || _a === void 0 ? void 0 : _a[index])
78763
78792
  ? "border-eui-danger-500"
78764
78793
  : "border-eui-primary-400 focus:border-eui-secondary-500") }), jsx("button", __assign$1({ type: "button", onClick: function () { return remove(index); }, className: "text-red-500" }, { children: jsx(FaTrash, {}) }))] })));
78765
78794
  } }), index)); }), provided.placeholder] })));
@@ -78772,25 +78801,48 @@ var InputList = function (_a) {
78772
78801
  };
78773
78802
 
78774
78803
  var InputListGroup = function (_a) {
78775
- var name = _a.name, placeholder = _a.placeholder;
78776
- var _b = useFormikContext(), values = _b.values, errors = _b.errors, touched = _b.touched, setFieldValue = _b.setFieldValue;
78804
+ var _b, _c;
78805
+ var name = _a.name, placeholder = _a.placeholder, shape = _a.shape;
78806
+ var eui = useEUIConfig();
78807
+ // Resolved Global Overrides
78808
+ var resolvedShape = (_c = shape !== null && shape !== void 0 ? shape : (_b = eui === null || eui === void 0 ? void 0 : eui.global) === null || _b === void 0 ? void 0 : _b.shape) !== null && _c !== void 0 ? _c : "square";
78809
+ var _d = useFormikContext(), values = _d.values, errors = _d.errors, touched = _d.touched, setFieldValue = _d.setFieldValue;
78777
78810
  return (jsxs("div", __assign$1({ className: "flex flex-col space-y-2" }, { children: [jsx(InputLabel, { text: placeholder }), jsx(FieldArray, __assign$1({ name: name }, { children: function (_a) {
78778
78811
  var _b;
78779
78812
  var push = _a.push, remove = _a.remove;
78780
- return (jsxs("div", __assign$1({ className: "space-y-3" }, { children: [(_b = values[name]) === null || _b === void 0 ? void 0 : _b.map(function (group, groupIndex) { return (jsxs("div", __assign$1({ className: "flex flex-col gap-2 bg-eui-primary-300/10 p-3 rounded-md" }, { children: [jsxs("div", __assign$1({ className: "flex items-baseline gap-2" }, { children: [jsx(FaGripVertical, { className: "cursor-grab text-gray-500" }), jsx(Field, { name: "".concat(name, "[").concat(groupIndex, "].name"), placeholder: "Group ".concat(groupIndex + 1), className: classnames("border w-full rounded-sm bg-eui-primary-300/10 px-3 py-2 text-md focus:outline-none h-[40px]", "border-eui-primary-400 focus:border-eui-secondary-500") }), jsx("button", __assign$1({ type: "button", onClick: function () { return remove(groupIndex); }, className: "text-red-500" }, { children: jsx(FaTrash, {}) }))] })), jsx(FieldArray, __assign$1({ name: "".concat(name, "[").concat(groupIndex, "].items") }, { children: function (_a) {
78781
- var pushItem = _a.push, removeItem = _a.remove; _a.move;
78782
- return (jsx(DragDropContext, __assign$1({ onDragEnd: function (result) {
78783
- if (!result.destination)
78784
- return;
78785
- var updatedItems = __spreadArray([], group.items, true);
78786
- var movedItem = updatedItems.splice(result.source.index, 1)[0];
78787
- updatedItems.splice(result.destination.index, 0, movedItem);
78788
- setFieldValue("".concat(name, "[").concat(groupIndex, "].items"), updatedItems);
78789
- } }, { children: jsx(ConnectedDroppable, __assign$1({ droppableId: "".concat(name, "[").concat(groupIndex, "].items") }, { children: function (provided) {
78790
- var _a;
78791
- return (jsxs("div", __assign$1({ ref: provided.innerRef }, provided.droppableProps, { className: "space-y-2 bg-eui-primary-300/10 p-2 rounded-md" }, { children: [(_a = group.items) === null || _a === void 0 ? void 0 : _a.map(function (_, itemIndex) { return (jsx(PublicDraggable, __assign$1({ draggableId: "".concat(groupIndex, "-").concat(itemIndex), index: itemIndex }, { children: function (provided) { return (jsxs("div", __assign$1({ ref: provided.innerRef }, provided.draggableProps, { className: "flex items-center gap-2 bg-eui-primary-300/10 p-2 rounded-md" }, { children: [jsx("div", __assign$1({}, provided.dragHandleProps, { children: jsx(FaGripVertical, { className: "cursor-grab text-gray-500" }) })), jsx(Field, { name: "".concat(name, "[").concat(groupIndex, "].items[").concat(itemIndex, "]"), placeholder: "Item ".concat(itemIndex + 1), className: classnames("border w-full rounded-sm bg-eui-primary-300/10 px-3 py-2 text-md focus:outline-none h-[40px]", "border-eui-primary-400 focus:border-eui-secondary-500") }), jsx("button", __assign$1({ type: "button", onClick: function () { return removeItem(itemIndex); }, className: "text-gray-500" }, { children: jsx(FaTrash, {}) }))] }))); } }), itemIndex)); }), provided.placeholder, jsxs("button", __assign$1({ type: "button", onClick: function () { return pushItem(""); }, className: "flex items-center space-x-2 text-green-800 px-2 w-fit" }, { children: [jsx(FaPlus, {}), " ", jsx("span", { children: "Add Item" })] }))] })));
78792
- } })) })));
78793
- } }))] }), groupIndex)); }), jsxs("button", __assign$1({ type: "button", onClick: function () { return push({ name: "", items: [] }); }, className: "flex items-center space-x-2 text-green-600 px-2 w-fit" }, { children: [jsx(FaPlus, {}), " ", jsx("span", { children: "Add New Group" })] })), jsx(InputResponse, { name: name, visibility: errors[name] &&
78813
+ return (jsxs("div", __assign$1({ className: "space-y-3" }, { children: [(_b = values[name]) === null || _b === void 0 ? void 0 : _b.map(function (group, groupIndex) {
78814
+ var _a;
78815
+ return (jsxs("div", __assign$1({ className: classnames((_a = {
78816
+ "flex flex-col gap-2 bg-eui-primary-300/10 p-3": true
78817
+ },
78818
+ _a["".concat(shapes[resolvedShape])] = true,
78819
+ _a)) }, { children: [jsxs("div", __assign$1({ className: "flex items-baseline gap-2" }, { children: [jsx(FaGripVertical, { className: "cursor-grab text-gray-500" }), jsx(Field, { name: "".concat(name, "[").concat(groupIndex, "].name"), placeholder: "Group ".concat(groupIndex + 1), className: classnames("border w-full bg-eui-primary-300/10 px-3 py-2 text-md focus:outline-none h-[40px]", ["".concat(shapes[resolvedShape])], "border-eui-primary-400 focus:border-eui-secondary-500") }), jsx("button", __assign$1({ type: "button", onClick: function () { return remove(groupIndex); }, className: "text-red-500" }, { children: jsx(FaTrash, {}) }))] })), jsx(FieldArray, __assign$1({ name: "".concat(name, "[").concat(groupIndex, "].items") }, { children: function (_a) {
78820
+ var pushItem = _a.push, removeItem = _a.remove; _a.move;
78821
+ return (jsx(DragDropContext, __assign$1({ onDragEnd: function (result) {
78822
+ if (!result.destination)
78823
+ return;
78824
+ var updatedItems = __spreadArray([], group.items, true);
78825
+ var movedItem = updatedItems.splice(result.source.index, 1)[0];
78826
+ updatedItems.splice(result.destination.index, 0, movedItem);
78827
+ setFieldValue("".concat(name, "[").concat(groupIndex, "].items"), updatedItems);
78828
+ } }, { children: jsx(ConnectedDroppable, __assign$1({ droppableId: "".concat(name, "[").concat(groupIndex, "].items") }, { children: function (provided) {
78829
+ var _a;
78830
+ var _b;
78831
+ return (jsxs("div", __assign$1({ ref: provided.innerRef }, provided.droppableProps, { className: classnames((_a = {
78832
+ "space-y-2 bg-eui-primary-300/10 p-2": true
78833
+ },
78834
+ _a["".concat(shapes[resolvedShape])] = true,
78835
+ _a)) }, { children: [(_b = group.items) === null || _b === void 0 ? void 0 : _b.map(function (_, itemIndex) { return (jsx(PublicDraggable, __assign$1({ draggableId: "".concat(groupIndex, "-").concat(itemIndex), index: itemIndex }, { children: function (provided) {
78836
+ var _a;
78837
+ return (jsxs("div", __assign$1({ ref: provided.innerRef }, provided.draggableProps, { className: classnames((_a = {
78838
+ "flex items-center gap-2 bg-eui-primary-300/10 p-2": true
78839
+ },
78840
+ _a["".concat(shapes[resolvedShape])] = true,
78841
+ _a)) }, { children: [jsx("div", __assign$1({}, provided.dragHandleProps, { children: jsx(FaGripVertical, { className: "cursor-grab text-gray-500" }) })), jsx(Field, { name: "".concat(name, "[").concat(groupIndex, "].items[").concat(itemIndex, "]"), placeholder: "Item ".concat(itemIndex + 1), className: classnames("border w-full bg-eui-primary-300/10 px-3 py-2 text-md focus:outline-none h-[40px]", ["".concat(shapes[resolvedShape])], "border-eui-primary-400 focus:border-eui-secondary-500") }), jsx("button", __assign$1({ type: "button", onClick: function () { return removeItem(itemIndex); }, className: "text-gray-500" }, { children: jsx(FaTrash, {}) }))] })));
78842
+ } }), itemIndex)); }), provided.placeholder, jsxs("button", __assign$1({ type: "button", onClick: function () { return pushItem(""); }, className: "flex items-center space-x-2 text-green-800 px-2 w-fit" }, { children: [jsx(FaPlus, {}), " ", jsx("span", { children: "Add Item" })] }))] })));
78843
+ } })) })));
78844
+ } }))] }), groupIndex));
78845
+ }), jsxs("button", __assign$1({ type: "button", onClick: function () { return push({ name: "", items: [] }); }, className: "flex items-center space-x-2 text-green-600 px-2 w-fit" }, { children: [jsx(FaPlus, {}), " ", jsx("span", { children: "Add New Group" })] })), jsx(InputResponse, { name: name, visibility: errors[name] &&
78794
78846
  touched[name] &&
78795
78847
  typeof errors[name] === "string"
78796
78848
  ? true
@@ -78829,13 +78881,18 @@ var Checkbox = function (props) {
78829
78881
 
78830
78882
  var DateSelector = function (_a) {
78831
78883
  var _b;
78832
- var placeholder = _a.placeholder, styles = _a.styles, props = __rest$1(_a, ["placeholder", "styles"]);
78833
- var _c = useField(props), field = _c[0], meta = _c[1];
78884
+ var _c, _d;
78885
+ var placeholder = _a.placeholder, styles = _a.styles, shape = _a.shape, props = __rest$1(_a, ["placeholder", "styles", "shape"]);
78886
+ var eui = useEUIConfig();
78887
+ // Resolved Global Overrides
78888
+ var resolvedShape = (_d = shape !== null && shape !== void 0 ? shape : (_c = eui === null || eui === void 0 ? void 0 : eui.global) === null || _c === void 0 ? void 0 : _c.shape) !== null && _d !== void 0 ? _d : "square";
78889
+ var _e = useField(props), field = _e[0], meta = _e[1];
78834
78890
  return (jsxs("div", __assign$1({ className: "relative w-full" }, { children: [jsx(InputLabel, { text: placeholder, styles: "absolute left-2 top-[0.7px] peer-placeholder-shown:text-base peer-placeholder-shown:top-3" }), jsx(Field, __assign$1({ type: "date" }, field, props, { placeholder: placeholder, className: classnames((_b = {
78835
- "border border-eui-primary-400 peer w-full rounded-sm bg-eui-primary-300/10 pt-5 px-3 pb-2 text-md eui-text-md placeholder-transparent placeholder-shown:p-3 focus:border-eui-secondary-500 focus:outline-none h-[50px]": true,
78891
+ "border border-eui-primary-400 peer w-full bg-eui-primary-300/10 pt-5 px-3 pb-2 text-md eui-text-md placeholder-transparent placeholder-shown:p-3 focus:border-eui-secondary-500 focus:outline-none h-[50px]": true,
78836
78892
  "border-eui-danger-500": meta.touched && meta.error,
78837
78893
  "transition-all ease-in-out": true
78838
78894
  },
78895
+ _b["".concat(shapes[resolvedShape])] = true,
78839
78896
  _b["".concat(styles)] = styles,
78840
78897
  _b)) })), meta.touched && meta.error && (jsx(InputResponse, { name: field.name, visibility: true, variant: "danger" }))] })));
78841
78898
  };
@@ -79006,14 +79063,19 @@ function StarRatingInput(_a) {
79006
79063
 
79007
79064
  function Select$2(_a) {
79008
79065
  var _b;
79009
- var placeholder = _a.placeholder, options = _a.options, styles = _a.styles, props = __rest$1(_a, ["placeholder", "options", "styles"]);
79010
- var _c = useField(props), field = _c[0], meta = _c[1];
79066
+ var _c, _d;
79067
+ var placeholder = _a.placeholder, options = _a.options, styles = _a.styles, shape = _a.shape, props = __rest$1(_a, ["placeholder", "options", "styles", "shape"]);
79068
+ var eui = useEUIConfig();
79069
+ // Resolved Global Overrides
79070
+ var resolvedShape = (_d = shape !== null && shape !== void 0 ? shape : (_c = eui === null || eui === void 0 ? void 0 : eui.global) === null || _c === void 0 ? void 0 : _c.shape) !== null && _d !== void 0 ? _d : "square";
79071
+ var _e = useField(props), field = _e[0], meta = _e[1];
79011
79072
  return (jsxs("div", __assign$1({ className: "relative" }, { children: [jsx(InputLabel, { text: placeholder, styles: "absolute left-2 top-[0.7px] peer-placeholder-shown:text-base peer-placeholder-shown:top-3" }), jsx(Field, __assign$1({ as: "select" }, props, { className: classnames((_b = {
79012
- "border peer w-full rounded-sm bg-eui-primary-300/10 pt-5 px-3 pb-2 text-md eui-text-md placeholder-transparent placeholder-shown:p-3 focus:border-eui-secondary-500 focus:outline-none h-[50px]": true,
79073
+ "border peer w-full bg-eui-primary-300/10 pt-5 px-3 pb-2 text-md eui-text-md placeholder-transparent placeholder-shown:p-3 focus:border-eui-secondary-500 focus:outline-none h-[50px]": true,
79013
79074
  "border-eui-primary-400": !(meta.touched && meta.error),
79014
79075
  "border-red-500": meta.touched && meta.error,
79015
79076
  "transition-all ease-in-out": true
79016
79077
  },
79078
+ _b["".concat(shapes[resolvedShape])] = true,
79017
79079
  _b["".concat(styles)] = styles,
79018
79080
  _b)) }, { children: options.map(function (option) {
79019
79081
  return (jsx("option", __assign$1({ value: option.value }, { children: option.label }), option.value));
@@ -79070,17 +79132,21 @@ function Tags(_a) {
79070
79132
 
79071
79133
  function TextArea(_a) {
79072
79134
  var _b;
79073
- var _c;
79074
- var placeholder = _a.placeholder, limit = _a.limit, styles = _a.styles, props = __rest$1(_a, ["placeholder", "limit", "styles"]);
79075
- var _d = useField(props), field = _d[0], meta = _d[1];
79135
+ var _c, _d, _e;
79136
+ var placeholder = _a.placeholder, limit = _a.limit, styles = _a.styles, shape = _a.shape, props = __rest$1(_a, ["placeholder", "limit", "styles", "shape"]);
79137
+ var eui = useEUIConfig();
79138
+ // Resolved Global Overrides
79139
+ var resolvedShape = (_d = shape !== null && shape !== void 0 ? shape : (_c = eui === null || eui === void 0 ? void 0 : eui.global) === null || _c === void 0 ? void 0 : _c.shape) !== null && _d !== void 0 ? _d : "square";
79140
+ var _f = useField(props), field = _f[0], meta = _f[1];
79076
79141
  return (jsxs("div", { children: [jsxs("div", __assign$1({ className: "relative" }, { children: [jsx(Field, __assign$1({ as: "textarea" }, field, props, { className: classnames((_b = {
79077
- "border peer w-full bg-eui-primary-300/10 eui-text-md outline-none px-3 py-5 rounded-sm resize-none focus:resize-none focus:outline-none": true,
79142
+ "border peer w-full bg-eui-primary-300/10 eui-text-md outline-none px-3 py-5 resize-none focus:resize-none focus:outline-none": true,
79078
79143
  "transition-all ease-in-out": true,
79079
79144
  "border-eui-primary-400 focus:border-eui-secondary-500": !(meta.touched && meta.error),
79080
79145
  "border-eui-danger-500": meta.touched && meta.error
79081
79146
  },
79147
+ _b["".concat(shapes[resolvedShape])] = true,
79082
79148
  _b["".concat(styles)] = styles,
79083
- _b)) })), jsx(InputLabel, { text: placeholder, styles: classnames("absolute left-2 transition-all pointer-events-none text-eui-dark-200", field.value ? "top-[2px] text-[13.5px]" : "top-3 text-base") }), jsxs("div", __assign$1({ className: "absolute bottom-3 right-3 text-xs text-eui-dark-50 font-semibold" }, { children: [(_c = field.value) === null || _c === void 0 ? void 0 : _c.length, "/", limit] }))] })), jsx(InputResponse, { name: field.name, visibility: meta.touched && meta.error ? true : false, variant: "danger" })] }));
79149
+ _b)) })), jsx(InputLabel, { text: placeholder, styles: classnames("absolute left-2 transition-all pointer-events-none text-eui-dark-200", field.value ? "top-[2px] text-[13.5px]" : "top-3 text-base") }), jsxs("div", __assign$1({ className: "absolute bottom-3 right-3 text-xs text-eui-dark-50 font-semibold" }, { children: [(_e = field.value) === null || _e === void 0 ? void 0 : _e.length, "/", limit] }))] })), jsx(InputResponse, { name: field.name, visibility: meta.touched && meta.error ? true : false, variant: "danger" })] }));
79084
79150
  }
79085
79151
 
79086
79152
  function ContentArea(_a) {
@@ -140801,4 +140867,4 @@ function SidemenuLayout(_a) {
140801
140867
  }) }, { children: [jsx("div", __assign$1({ className: "col-span-2 mb-10" }, { children: jsx(Menu, { data: data }) })), jsx("div", __assign$1({ className: "w-full col-span-5" }, { children: jsx("div", __assign$1({ className: "px-5 py-3" }, { children: children })) }))] })) }));
140802
140868
  }
140803
140869
 
140804
- export { Accordion, AsyncComponentWrapper, Avatar, Backdrop, Badge, BarChart, BoxNav, BoxNavItem, Brand, Breadcrumb, BreadcrumbItem, Button$2 as Button, Card, CardContent, CardFooter, CardHeader, Chapter, Checkbox, Chip, CloudinaryImage, CloudinaryProvider, CloudinaryVideo, Content$2 as Content, ContentArea, DateSelector, DefaultLayout, Drawer, DrawerToggler, Flag, Flex, FlexCol, FlexRow, Footer, FooterNav, FooterNavGroup, FooterNavItem, FooterNavItemContext, FooterNavItemTitle, Form, FormResponse, GenericLayout, GlowWrapper, Grid, Header, HeaderNav, HeaderNavGroup, HeaderNavItem, HeaderNavItemContext, HeaderNavItemTitle, HomeLayout, Image$1 as Image, ImageInput, Info, Input, InputFile, InputLabel, InputList, InputListGroup, InputResponse, Layout, LineChart, Link, List, ListItem, MarkdownEditor, MarkdownViewer, Menu, MenuGroup, MenuItem, MenuItemTitle, Modal, MultiImageInput, Paragraph, PieChart, PriceTag, Quote, Radio, RouteTab, RouteTabs, Section, Select$2 as Select, ShowMore, Sidebar, SidebarLayout, SidemenuLayout, Skeleton, Slider, StarRating, StarRatingDistribution, StarRatingInput, Switch, Table, Tag, Tags, TextArea, ThemeContext, ThemeProvider, ThemeSwitch, TitleBanner, Toast, Tooltip$1 as Tooltip, Transition$1 as Transition, TransitionDropdown, TransitionFadeIn, Typography, UnderConstructionBanner, ValueBadge, WorldMap, WorldMapCountryTable, YoutubeVideoPlayer, getCurrencySymbol, sendToast, useClickOutside, useCloudinaryConfig, useCurrentTheme, useDrawer, useIsMobile, useModal, useTheme };
140870
+ export { Accordion, AsyncComponentWrapper, Avatar, Backdrop, Badge, BarChart, BoxNav, BoxNavItem, Brand, Breadcrumb, BreadcrumbItem, Button$2 as Button, Card, CardContent, CardFooter, CardHeader, Chapter, Checkbox, Chip, CloudinaryImage, CloudinaryProvider, CloudinaryVideo, Content$2 as Content, ContentArea, DateSelector, DefaultLayout, Drawer, DrawerToggler, EUIProvider, Flag, Flex, FlexCol, FlexRow, Footer, FooterNav, FooterNavGroup, FooterNavItem, FooterNavItemContext, FooterNavItemTitle, Form, FormResponse, GenericLayout, GlowWrapper, Grid, Header, HeaderNav, HeaderNavGroup, HeaderNavItem, HeaderNavItemContext, HeaderNavItemTitle, HomeLayout, Image$1 as Image, ImageInput, Info, Input, InputFile, InputLabel, InputList, InputListGroup, InputResponse, Layout, LineChart, Link, List, ListItem, MarkdownEditor, MarkdownViewer, Menu, MenuGroup, MenuItem, MenuItemTitle, Modal, MultiImageInput, Paragraph, PieChart, PriceTag, Quote, Radio, RouteTab, RouteTabs, Section, Select$2 as Select, ShowMore, Sidebar, SidebarLayout, SidemenuLayout, Skeleton, Slider, StarRating, StarRatingDistribution, StarRatingInput, Switch, Table, Tag, Tags, TextArea, ThemeContext, ThemeProvider, ThemeSwitch, TitleBanner, Toast, Tooltip$1 as Tooltip, Transition$1 as Transition, TransitionDropdown, TransitionFadeIn, Typography, UnderConstructionBanner, ValueBadge, WorldMap, WorldMapCountryTable, YoutubeVideoPlayer, getCurrencySymbol, resolveWithGlobal, sendToast, useClickOutside, useCloudinaryConfig, useCurrentTheme, useDrawer, useEUIConfig, useIsMobile, useModal, useTheme };
package/build/index.js CHANGED
@@ -68011,6 +68011,18 @@ function WorldMapCountryTable(_a) {
68011
68011
  return (jsxRuntime.jsx("div", __assign$1({ className: "bg-white dark:bg-neutral-950 rounded-2xl shadow-md p-4" }, { children: jsxRuntime.jsx(Table, { title: title, data: finalData, columns: columns, defaultPageSize: defaultPageSize, pageSizeOptions: [5, 10, "All"] }) })));
68012
68012
  }
68013
68013
 
68014
+ var EUIContext = React.createContext(null);
68015
+ var EUIProvider = function (_a) {
68016
+ var config = _a.config, children = _a.children;
68017
+ return jsxRuntime.jsx(EUIContext.Provider, __assign$1({ value: config }, { children: children }));
68018
+ };
68019
+ var useEUIConfig = function () { return React.useContext(EUIContext); };
68020
+
68021
+ function resolveWithGlobal(config, props, defaults) {
68022
+ var _a;
68023
+ return __assign$1(__assign$1(__assign$1({}, defaults), ((_a = config === null || config === void 0 ? void 0 : config.global) !== null && _a !== void 0 ? _a : {})), props);
68024
+ }
68025
+
68014
68026
  var sizes = {
68015
68027
  xs: "px-2 py-1 text-xs",
68016
68028
  sm: "px-3 py-1.5 text-sm",
@@ -68020,7 +68032,11 @@ var sizes = {
68020
68032
  };
68021
68033
  var Button$2 = function (_a) {
68022
68034
  var _b;
68023
- var _c = _a.type, type = _c === void 0 ? "button" : _c, icon = _a.icon, text = _a.text, children = _a.children, loading = _a.loading, disabled = _a.disabled, ghost = _a.ghost, block = _a.block, _d = _a.variant, variant = _d === void 0 ? "default" : _d, _e = _a.shape, shape = _e === void 0 ? "square" : _e, _f = _a.size, size = _f === void 0 ? "md" : _f, styles = _a.styles, onClick = _a.onClick;
68035
+ var _c, _d;
68036
+ var _e = _a.type, type = _e === void 0 ? "button" : _e, icon = _a.icon, text = _a.text, children = _a.children, loading = _a.loading, disabled = _a.disabled, ghost = _a.ghost, block = _a.block, _f = _a.variant, variant = _f === void 0 ? "success" : _f, shape = _a.shape, _g = _a.size, size = _g === void 0 ? "md" : _g, styles = _a.styles, onClick = _a.onClick;
68037
+ var eui = useEUIConfig();
68038
+ // Resolved Global Overrides
68039
+ var resolvedShape = (_d = shape !== null && shape !== void 0 ? shape : (_c = eui === null || eui === void 0 ? void 0 : eui.global) === null || _c === void 0 ? void 0 : _c.shape) !== null && _d !== void 0 ? _d : "square";
68024
68040
  var btnRef = React.useRef(null);
68025
68041
  // 👉 Glow effect on mouse move
68026
68042
  var handleMouseMove = function (e) {
@@ -68039,7 +68055,7 @@ var Button$2 = function (_a) {
68039
68055
  },
68040
68056
  _b["".concat(variants[variant])] = !ghost,
68041
68057
  _b["".concat(variantsGhost[variant])] = ghost,
68042
- _b["".concat(shapes[shape])] = true,
68058
+ _b["".concat(shapes[resolvedShape])] = true,
68043
68059
  _b["".concat(sizes[size])] = true,
68044
68060
  _b["w-full"] = block,
68045
68061
  _b["brightness-75 grayscale text-gray-900 cursor-not-allowed"] = loading || disabled,
@@ -68088,9 +68104,13 @@ var PasswordVisibilityToggler = function (_a) {
68088
68104
  };
68089
68105
  var Input = function (_a) {
68090
68106
  var _b;
68091
- var _c = _a.type, type = _c === void 0 ? "text" : _c, placeholder = _a.placeholder, styles = _a.styles, step = _a.step, _d = _a.shape, shape = _d === void 0 ? "square" : _d, props = __rest$1(_a, ["type", "placeholder", "styles", "step", "shape"]);
68092
- var _e = useField(props), field = _e[0], meta = _e[1];
68093
- var _f = React.useState(false), passwordVisibility = _f[0], setPasswordVisibilty = _f[1];
68107
+ var _c, _d;
68108
+ var _e = _a.type, type = _e === void 0 ? "text" : _e, placeholder = _a.placeholder, styles = _a.styles, step = _a.step, shape = _a.shape, props = __rest$1(_a, ["type", "placeholder", "styles", "step", "shape"]);
68109
+ var eui = useEUIConfig();
68110
+ // Resolved Global Overrides
68111
+ var resolvedShape = (_d = shape !== null && shape !== void 0 ? shape : (_c = eui === null || eui === void 0 ? void 0 : eui.global) === null || _c === void 0 ? void 0 : _c.shape) !== null && _d !== void 0 ? _d : "square";
68112
+ var _f = useField(props), field = _f[0], meta = _f[1];
68113
+ var _g = React.useState(false), passwordVisibility = _g[0], setPasswordVisibilty = _g[1];
68094
68114
  // Determine the final input type
68095
68115
  var inputType = type === "password" ? toggleType(passwordVisibility) : type;
68096
68116
  return (jsxRuntime.jsxs("div", __assign$1({ className: "relative w-full" }, { children: [jsxRuntime.jsx(Field, __assign$1({ type: inputType, step: inputType === "number" && step ? step : undefined }, field, props, { placeholder: placeholder, className: classnames((_b = {
@@ -68098,7 +68118,7 @@ var Input = function (_a) {
68098
68118
  "border-eui-primary-400 focus:border-eui-secondary-500": !(meta.touched && meta.error),
68099
68119
  "border-eui-danger-500": meta.touched && meta.error
68100
68120
  },
68101
- _b["".concat(shapes[shape])] = shape,
68121
+ _b["".concat(shapes[resolvedShape])] = true,
68102
68122
  // "transition-all ease-in-out": true,
68103
68123
  _b["".concat(styles)] = styles,
68104
68124
  _b)) })), jsxRuntime.jsx(InputLabel, { text: placeholder, styles: "absolute left-2 top-[0.7px] eui-text-sm text-[13.5px] peer-placeholder-shown:text-base peer-placeholder-shown:top-3 pointer-events-none" }), type === "password" && (jsxRuntime.jsx(PasswordVisibilityToggler, { onClick: function (v) { return setPasswordVisibilty(v); } })), jsxRuntime.jsx(InputResponse, { name: field.name, visibility: meta.touched && meta.error ? true : false, variant: "danger" })] })));
@@ -78774,11 +78794,20 @@ var ConnectedDroppable = connect(makeMapStateToProps$1, mapDispatchToProps$1, nu
78774
78794
  ConnectedDroppable.defaultProps = defaultProps;
78775
78795
 
78776
78796
  var InputList = function (_a) {
78777
- var name = _a.name, placeholder = _a.placeholder;
78778
- var _b = useFormikContext(), values = _b.values, errors = _b.errors, touched = _b.touched;
78797
+ var _b, _c;
78798
+ var name = _a.name, placeholder = _a.placeholder, shape = _a.shape;
78799
+ var eui = useEUIConfig();
78800
+ // Resolved Global Overrides
78801
+ var resolvedShape = (_c = shape !== null && shape !== void 0 ? shape : (_b = eui === null || eui === void 0 ? void 0 : eui.global) === null || _b === void 0 ? void 0 : _b.shape) !== null && _c !== void 0 ? _c : "square";
78802
+ var _d = useFormikContext(), values = _d.values, errors = _d.errors, touched = _d.touched;
78779
78803
  return (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(InputLabel, { text: placeholder }), jsxRuntime.jsx("div", __assign$1({ className: "mt-2" }, { children: jsxRuntime.jsx(FieldArray, __assign$1({ name: name }, { children: function (_a) {
78804
+ var _b;
78780
78805
  var push = _a.push, remove = _a.remove, move = _a.move;
78781
- return (jsxRuntime.jsxs("div", __assign$1({ className: "flex flex-col space-y-2 w-full bg-eui-primary-300/10 rounded-md" }, { children: [jsxRuntime.jsx(DragDropContext, __assign$1({ onDragEnd: function (result) {
78806
+ return (jsxRuntime.jsxs("div", __assign$1({ className: classnames((_b = {
78807
+ "flex flex-col space-y-2 w-full bg-eui-primary-300/10": true
78808
+ },
78809
+ _b["".concat(shapes[resolvedShape])] = true,
78810
+ _b)) }, { children: [jsxRuntime.jsx(DragDropContext, __assign$1({ onDragEnd: function (result) {
78782
78811
  if (!result.destination)
78783
78812
  return;
78784
78813
  move(result.source.index, result.destination.index);
@@ -78786,7 +78815,7 @@ var InputList = function (_a) {
78786
78815
  var _a;
78787
78816
  return (jsxRuntime.jsxs("div", __assign$1({ ref: provided.innerRef }, provided.droppableProps, { children: [(_a = values[name]) === null || _a === void 0 ? void 0 : _a.map(function (_, index) { return (jsxRuntime.jsx(PublicDraggable, __assign$1({ draggableId: index.toString(), index: index }, { children: function (provided) {
78788
78817
  var _a;
78789
- return (jsxRuntime.jsxs("div", __assign$1({ ref: provided.innerRef }, provided.draggableProps, { className: "flex items-center space-x-2 bg-eui-primary-300/10 p-2" }, { children: [jsxRuntime.jsx("div", __assign$1({}, provided.dragHandleProps, { children: jsxRuntime.jsx(FaGripVertical, { className: "cursor-grab text-gray-500" }) })), jsxRuntime.jsx(Field, { name: "".concat(name, "[").concat(index, "]"), placeholder: "Item ".concat(index + 1), className: classnames("border peer w-full rounded-sm bg-eui-primary-300/10 pt-5 px-3 pb-2 text-md eui-text-md placeholder-transparent placeholder-shown:p-3 focus:outline-none h-[50px]", ((_a = errors[name]) === null || _a === void 0 ? void 0 : _a[index])
78818
+ return (jsxRuntime.jsxs("div", __assign$1({ ref: provided.innerRef }, provided.draggableProps, { className: "flex items-center space-x-2 bg-eui-primary-300/10 p-2" }, { children: [jsxRuntime.jsx("div", __assign$1({}, provided.dragHandleProps, { children: jsxRuntime.jsx(FaGripVertical, { className: "cursor-grab text-gray-500" }) })), jsxRuntime.jsx(Field, { name: "".concat(name, "[").concat(index, "]"), placeholder: "Item ".concat(index + 1), className: classnames("border peer w-full bg-eui-primary-300/10 pt-5 px-3 pb-2 text-md eui-text-md placeholder-transparent placeholder-shown:p-3 focus:outline-none h-[50px]", ["".concat(shapes[resolvedShape])], ((_a = errors[name]) === null || _a === void 0 ? void 0 : _a[index])
78790
78819
  ? "border-eui-danger-500"
78791
78820
  : "border-eui-primary-400 focus:border-eui-secondary-500") }), jsxRuntime.jsx("button", __assign$1({ type: "button", onClick: function () { return remove(index); }, className: "text-red-500" }, { children: jsxRuntime.jsx(FaTrash, {}) }))] })));
78792
78821
  } }), index)); }), provided.placeholder] })));
@@ -78799,25 +78828,48 @@ var InputList = function (_a) {
78799
78828
  };
78800
78829
 
78801
78830
  var InputListGroup = function (_a) {
78802
- var name = _a.name, placeholder = _a.placeholder;
78803
- var _b = useFormikContext(), values = _b.values, errors = _b.errors, touched = _b.touched, setFieldValue = _b.setFieldValue;
78831
+ var _b, _c;
78832
+ var name = _a.name, placeholder = _a.placeholder, shape = _a.shape;
78833
+ var eui = useEUIConfig();
78834
+ // Resolved Global Overrides
78835
+ var resolvedShape = (_c = shape !== null && shape !== void 0 ? shape : (_b = eui === null || eui === void 0 ? void 0 : eui.global) === null || _b === void 0 ? void 0 : _b.shape) !== null && _c !== void 0 ? _c : "square";
78836
+ var _d = useFormikContext(), values = _d.values, errors = _d.errors, touched = _d.touched, setFieldValue = _d.setFieldValue;
78804
78837
  return (jsxRuntime.jsxs("div", __assign$1({ className: "flex flex-col space-y-2" }, { children: [jsxRuntime.jsx(InputLabel, { text: placeholder }), jsxRuntime.jsx(FieldArray, __assign$1({ name: name }, { children: function (_a) {
78805
78838
  var _b;
78806
78839
  var push = _a.push, remove = _a.remove;
78807
- return (jsxRuntime.jsxs("div", __assign$1({ className: "space-y-3" }, { children: [(_b = values[name]) === null || _b === void 0 ? void 0 : _b.map(function (group, groupIndex) { return (jsxRuntime.jsxs("div", __assign$1({ className: "flex flex-col gap-2 bg-eui-primary-300/10 p-3 rounded-md" }, { children: [jsxRuntime.jsxs("div", __assign$1({ className: "flex items-baseline gap-2" }, { children: [jsxRuntime.jsx(FaGripVertical, { className: "cursor-grab text-gray-500" }), jsxRuntime.jsx(Field, { name: "".concat(name, "[").concat(groupIndex, "].name"), placeholder: "Group ".concat(groupIndex + 1), className: classnames("border w-full rounded-sm bg-eui-primary-300/10 px-3 py-2 text-md focus:outline-none h-[40px]", "border-eui-primary-400 focus:border-eui-secondary-500") }), jsxRuntime.jsx("button", __assign$1({ type: "button", onClick: function () { return remove(groupIndex); }, className: "text-red-500" }, { children: jsxRuntime.jsx(FaTrash, {}) }))] })), jsxRuntime.jsx(FieldArray, __assign$1({ name: "".concat(name, "[").concat(groupIndex, "].items") }, { children: function (_a) {
78808
- var pushItem = _a.push, removeItem = _a.remove; _a.move;
78809
- return (jsxRuntime.jsx(DragDropContext, __assign$1({ onDragEnd: function (result) {
78810
- if (!result.destination)
78811
- return;
78812
- var updatedItems = __spreadArray([], group.items, true);
78813
- var movedItem = updatedItems.splice(result.source.index, 1)[0];
78814
- updatedItems.splice(result.destination.index, 0, movedItem);
78815
- setFieldValue("".concat(name, "[").concat(groupIndex, "].items"), updatedItems);
78816
- } }, { children: jsxRuntime.jsx(ConnectedDroppable, __assign$1({ droppableId: "".concat(name, "[").concat(groupIndex, "].items") }, { children: function (provided) {
78817
- var _a;
78818
- return (jsxRuntime.jsxs("div", __assign$1({ ref: provided.innerRef }, provided.droppableProps, { className: "space-y-2 bg-eui-primary-300/10 p-2 rounded-md" }, { children: [(_a = group.items) === null || _a === void 0 ? void 0 : _a.map(function (_, itemIndex) { return (jsxRuntime.jsx(PublicDraggable, __assign$1({ draggableId: "".concat(groupIndex, "-").concat(itemIndex), index: itemIndex }, { children: function (provided) { return (jsxRuntime.jsxs("div", __assign$1({ ref: provided.innerRef }, provided.draggableProps, { className: "flex items-center gap-2 bg-eui-primary-300/10 p-2 rounded-md" }, { children: [jsxRuntime.jsx("div", __assign$1({}, provided.dragHandleProps, { children: jsxRuntime.jsx(FaGripVertical, { className: "cursor-grab text-gray-500" }) })), jsxRuntime.jsx(Field, { name: "".concat(name, "[").concat(groupIndex, "].items[").concat(itemIndex, "]"), placeholder: "Item ".concat(itemIndex + 1), className: classnames("border w-full rounded-sm bg-eui-primary-300/10 px-3 py-2 text-md focus:outline-none h-[40px]", "border-eui-primary-400 focus:border-eui-secondary-500") }), jsxRuntime.jsx("button", __assign$1({ type: "button", onClick: function () { return removeItem(itemIndex); }, className: "text-gray-500" }, { children: jsxRuntime.jsx(FaTrash, {}) }))] }))); } }), itemIndex)); }), provided.placeholder, jsxRuntime.jsxs("button", __assign$1({ type: "button", onClick: function () { return pushItem(""); }, className: "flex items-center space-x-2 text-green-800 px-2 w-fit" }, { children: [jsxRuntime.jsx(FaPlus, {}), " ", jsxRuntime.jsx("span", { children: "Add Item" })] }))] })));
78819
- } })) })));
78820
- } }))] }), groupIndex)); }), jsxRuntime.jsxs("button", __assign$1({ type: "button", onClick: function () { return push({ name: "", items: [] }); }, className: "flex items-center space-x-2 text-green-600 px-2 w-fit" }, { children: [jsxRuntime.jsx(FaPlus, {}), " ", jsxRuntime.jsx("span", { children: "Add New Group" })] })), jsxRuntime.jsx(InputResponse, { name: name, visibility: errors[name] &&
78840
+ return (jsxRuntime.jsxs("div", __assign$1({ className: "space-y-3" }, { children: [(_b = values[name]) === null || _b === void 0 ? void 0 : _b.map(function (group, groupIndex) {
78841
+ var _a;
78842
+ return (jsxRuntime.jsxs("div", __assign$1({ className: classnames((_a = {
78843
+ "flex flex-col gap-2 bg-eui-primary-300/10 p-3": true
78844
+ },
78845
+ _a["".concat(shapes[resolvedShape])] = true,
78846
+ _a)) }, { children: [jsxRuntime.jsxs("div", __assign$1({ className: "flex items-baseline gap-2" }, { children: [jsxRuntime.jsx(FaGripVertical, { className: "cursor-grab text-gray-500" }), jsxRuntime.jsx(Field, { name: "".concat(name, "[").concat(groupIndex, "].name"), placeholder: "Group ".concat(groupIndex + 1), className: classnames("border w-full bg-eui-primary-300/10 px-3 py-2 text-md focus:outline-none h-[40px]", ["".concat(shapes[resolvedShape])], "border-eui-primary-400 focus:border-eui-secondary-500") }), jsxRuntime.jsx("button", __assign$1({ type: "button", onClick: function () { return remove(groupIndex); }, className: "text-red-500" }, { children: jsxRuntime.jsx(FaTrash, {}) }))] })), jsxRuntime.jsx(FieldArray, __assign$1({ name: "".concat(name, "[").concat(groupIndex, "].items") }, { children: function (_a) {
78847
+ var pushItem = _a.push, removeItem = _a.remove; _a.move;
78848
+ return (jsxRuntime.jsx(DragDropContext, __assign$1({ onDragEnd: function (result) {
78849
+ if (!result.destination)
78850
+ return;
78851
+ var updatedItems = __spreadArray([], group.items, true);
78852
+ var movedItem = updatedItems.splice(result.source.index, 1)[0];
78853
+ updatedItems.splice(result.destination.index, 0, movedItem);
78854
+ setFieldValue("".concat(name, "[").concat(groupIndex, "].items"), updatedItems);
78855
+ } }, { children: jsxRuntime.jsx(ConnectedDroppable, __assign$1({ droppableId: "".concat(name, "[").concat(groupIndex, "].items") }, { children: function (provided) {
78856
+ var _a;
78857
+ var _b;
78858
+ return (jsxRuntime.jsxs("div", __assign$1({ ref: provided.innerRef }, provided.droppableProps, { className: classnames((_a = {
78859
+ "space-y-2 bg-eui-primary-300/10 p-2": true
78860
+ },
78861
+ _a["".concat(shapes[resolvedShape])] = true,
78862
+ _a)) }, { children: [(_b = group.items) === null || _b === void 0 ? void 0 : _b.map(function (_, itemIndex) { return (jsxRuntime.jsx(PublicDraggable, __assign$1({ draggableId: "".concat(groupIndex, "-").concat(itemIndex), index: itemIndex }, { children: function (provided) {
78863
+ var _a;
78864
+ return (jsxRuntime.jsxs("div", __assign$1({ ref: provided.innerRef }, provided.draggableProps, { className: classnames((_a = {
78865
+ "flex items-center gap-2 bg-eui-primary-300/10 p-2": true
78866
+ },
78867
+ _a["".concat(shapes[resolvedShape])] = true,
78868
+ _a)) }, { children: [jsxRuntime.jsx("div", __assign$1({}, provided.dragHandleProps, { children: jsxRuntime.jsx(FaGripVertical, { className: "cursor-grab text-gray-500" }) })), jsxRuntime.jsx(Field, { name: "".concat(name, "[").concat(groupIndex, "].items[").concat(itemIndex, "]"), placeholder: "Item ".concat(itemIndex + 1), className: classnames("border w-full bg-eui-primary-300/10 px-3 py-2 text-md focus:outline-none h-[40px]", ["".concat(shapes[resolvedShape])], "border-eui-primary-400 focus:border-eui-secondary-500") }), jsxRuntime.jsx("button", __assign$1({ type: "button", onClick: function () { return removeItem(itemIndex); }, className: "text-gray-500" }, { children: jsxRuntime.jsx(FaTrash, {}) }))] })));
78869
+ } }), itemIndex)); }), provided.placeholder, jsxRuntime.jsxs("button", __assign$1({ type: "button", onClick: function () { return pushItem(""); }, className: "flex items-center space-x-2 text-green-800 px-2 w-fit" }, { children: [jsxRuntime.jsx(FaPlus, {}), " ", jsxRuntime.jsx("span", { children: "Add Item" })] }))] })));
78870
+ } })) })));
78871
+ } }))] }), groupIndex));
78872
+ }), jsxRuntime.jsxs("button", __assign$1({ type: "button", onClick: function () { return push({ name: "", items: [] }); }, className: "flex items-center space-x-2 text-green-600 px-2 w-fit" }, { children: [jsxRuntime.jsx(FaPlus, {}), " ", jsxRuntime.jsx("span", { children: "Add New Group" })] })), jsxRuntime.jsx(InputResponse, { name: name, visibility: errors[name] &&
78821
78873
  touched[name] &&
78822
78874
  typeof errors[name] === "string"
78823
78875
  ? true
@@ -78856,13 +78908,18 @@ var Checkbox = function (props) {
78856
78908
 
78857
78909
  var DateSelector = function (_a) {
78858
78910
  var _b;
78859
- var placeholder = _a.placeholder, styles = _a.styles, props = __rest$1(_a, ["placeholder", "styles"]);
78860
- var _c = useField(props), field = _c[0], meta = _c[1];
78911
+ var _c, _d;
78912
+ var placeholder = _a.placeholder, styles = _a.styles, shape = _a.shape, props = __rest$1(_a, ["placeholder", "styles", "shape"]);
78913
+ var eui = useEUIConfig();
78914
+ // Resolved Global Overrides
78915
+ var resolvedShape = (_d = shape !== null && shape !== void 0 ? shape : (_c = eui === null || eui === void 0 ? void 0 : eui.global) === null || _c === void 0 ? void 0 : _c.shape) !== null && _d !== void 0 ? _d : "square";
78916
+ var _e = useField(props), field = _e[0], meta = _e[1];
78861
78917
  return (jsxRuntime.jsxs("div", __assign$1({ className: "relative w-full" }, { children: [jsxRuntime.jsx(InputLabel, { text: placeholder, styles: "absolute left-2 top-[0.7px] peer-placeholder-shown:text-base peer-placeholder-shown:top-3" }), jsxRuntime.jsx(Field, __assign$1({ type: "date" }, field, props, { placeholder: placeholder, className: classnames((_b = {
78862
- "border border-eui-primary-400 peer w-full rounded-sm bg-eui-primary-300/10 pt-5 px-3 pb-2 text-md eui-text-md placeholder-transparent placeholder-shown:p-3 focus:border-eui-secondary-500 focus:outline-none h-[50px]": true,
78918
+ "border border-eui-primary-400 peer w-full bg-eui-primary-300/10 pt-5 px-3 pb-2 text-md eui-text-md placeholder-transparent placeholder-shown:p-3 focus:border-eui-secondary-500 focus:outline-none h-[50px]": true,
78863
78919
  "border-eui-danger-500": meta.touched && meta.error,
78864
78920
  "transition-all ease-in-out": true
78865
78921
  },
78922
+ _b["".concat(shapes[resolvedShape])] = true,
78866
78923
  _b["".concat(styles)] = styles,
78867
78924
  _b)) })), meta.touched && meta.error && (jsxRuntime.jsx(InputResponse, { name: field.name, visibility: true, variant: "danger" }))] })));
78868
78925
  };
@@ -79033,14 +79090,19 @@ function StarRatingInput(_a) {
79033
79090
 
79034
79091
  function Select$2(_a) {
79035
79092
  var _b;
79036
- var placeholder = _a.placeholder, options = _a.options, styles = _a.styles, props = __rest$1(_a, ["placeholder", "options", "styles"]);
79037
- var _c = useField(props), field = _c[0], meta = _c[1];
79093
+ var _c, _d;
79094
+ var placeholder = _a.placeholder, options = _a.options, styles = _a.styles, shape = _a.shape, props = __rest$1(_a, ["placeholder", "options", "styles", "shape"]);
79095
+ var eui = useEUIConfig();
79096
+ // Resolved Global Overrides
79097
+ var resolvedShape = (_d = shape !== null && shape !== void 0 ? shape : (_c = eui === null || eui === void 0 ? void 0 : eui.global) === null || _c === void 0 ? void 0 : _c.shape) !== null && _d !== void 0 ? _d : "square";
79098
+ var _e = useField(props), field = _e[0], meta = _e[1];
79038
79099
  return (jsxRuntime.jsxs("div", __assign$1({ className: "relative" }, { children: [jsxRuntime.jsx(InputLabel, { text: placeholder, styles: "absolute left-2 top-[0.7px] peer-placeholder-shown:text-base peer-placeholder-shown:top-3" }), jsxRuntime.jsx(Field, __assign$1({ as: "select" }, props, { className: classnames((_b = {
79039
- "border peer w-full rounded-sm bg-eui-primary-300/10 pt-5 px-3 pb-2 text-md eui-text-md placeholder-transparent placeholder-shown:p-3 focus:border-eui-secondary-500 focus:outline-none h-[50px]": true,
79100
+ "border peer w-full bg-eui-primary-300/10 pt-5 px-3 pb-2 text-md eui-text-md placeholder-transparent placeholder-shown:p-3 focus:border-eui-secondary-500 focus:outline-none h-[50px]": true,
79040
79101
  "border-eui-primary-400": !(meta.touched && meta.error),
79041
79102
  "border-red-500": meta.touched && meta.error,
79042
79103
  "transition-all ease-in-out": true
79043
79104
  },
79105
+ _b["".concat(shapes[resolvedShape])] = true,
79044
79106
  _b["".concat(styles)] = styles,
79045
79107
  _b)) }, { children: options.map(function (option) {
79046
79108
  return (jsxRuntime.jsx("option", __assign$1({ value: option.value }, { children: option.label }), option.value));
@@ -79097,17 +79159,21 @@ function Tags(_a) {
79097
79159
 
79098
79160
  function TextArea(_a) {
79099
79161
  var _b;
79100
- var _c;
79101
- var placeholder = _a.placeholder, limit = _a.limit, styles = _a.styles, props = __rest$1(_a, ["placeholder", "limit", "styles"]);
79102
- var _d = useField(props), field = _d[0], meta = _d[1];
79162
+ var _c, _d, _e;
79163
+ var placeholder = _a.placeholder, limit = _a.limit, styles = _a.styles, shape = _a.shape, props = __rest$1(_a, ["placeholder", "limit", "styles", "shape"]);
79164
+ var eui = useEUIConfig();
79165
+ // Resolved Global Overrides
79166
+ var resolvedShape = (_d = shape !== null && shape !== void 0 ? shape : (_c = eui === null || eui === void 0 ? void 0 : eui.global) === null || _c === void 0 ? void 0 : _c.shape) !== null && _d !== void 0 ? _d : "square";
79167
+ var _f = useField(props), field = _f[0], meta = _f[1];
79103
79168
  return (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs("div", __assign$1({ className: "relative" }, { children: [jsxRuntime.jsx(Field, __assign$1({ as: "textarea" }, field, props, { className: classnames((_b = {
79104
- "border peer w-full bg-eui-primary-300/10 eui-text-md outline-none px-3 py-5 rounded-sm resize-none focus:resize-none focus:outline-none": true,
79169
+ "border peer w-full bg-eui-primary-300/10 eui-text-md outline-none px-3 py-5 resize-none focus:resize-none focus:outline-none": true,
79105
79170
  "transition-all ease-in-out": true,
79106
79171
  "border-eui-primary-400 focus:border-eui-secondary-500": !(meta.touched && meta.error),
79107
79172
  "border-eui-danger-500": meta.touched && meta.error
79108
79173
  },
79174
+ _b["".concat(shapes[resolvedShape])] = true,
79109
79175
  _b["".concat(styles)] = styles,
79110
- _b)) })), jsxRuntime.jsx(InputLabel, { text: placeholder, styles: classnames("absolute left-2 transition-all pointer-events-none text-eui-dark-200", field.value ? "top-[2px] text-[13.5px]" : "top-3 text-base") }), jsxRuntime.jsxs("div", __assign$1({ className: "absolute bottom-3 right-3 text-xs text-eui-dark-50 font-semibold" }, { children: [(_c = field.value) === null || _c === void 0 ? void 0 : _c.length, "/", limit] }))] })), jsxRuntime.jsx(InputResponse, { name: field.name, visibility: meta.touched && meta.error ? true : false, variant: "danger" })] }));
79176
+ _b)) })), jsxRuntime.jsx(InputLabel, { text: placeholder, styles: classnames("absolute left-2 transition-all pointer-events-none text-eui-dark-200", field.value ? "top-[2px] text-[13.5px]" : "top-3 text-base") }), jsxRuntime.jsxs("div", __assign$1({ className: "absolute bottom-3 right-3 text-xs text-eui-dark-50 font-semibold" }, { children: [(_e = field.value) === null || _e === void 0 ? void 0 : _e.length, "/", limit] }))] })), jsxRuntime.jsx(InputResponse, { name: field.name, visibility: meta.touched && meta.error ? true : false, variant: "danger" })] }));
79111
79177
  }
79112
79178
 
79113
79179
  function ContentArea(_a) {
@@ -140856,6 +140922,7 @@ exports.DateSelector = DateSelector;
140856
140922
  exports.DefaultLayout = DefaultLayout;
140857
140923
  exports.Drawer = Drawer;
140858
140924
  exports.DrawerToggler = DrawerToggler;
140925
+ exports.EUIProvider = EUIProvider;
140859
140926
  exports.Flag = Flag;
140860
140927
  exports.Flex = Flex;
140861
140928
  exports.FlexCol = FlexCol;
@@ -140939,11 +141006,13 @@ exports.WorldMap = WorldMap;
140939
141006
  exports.WorldMapCountryTable = WorldMapCountryTable;
140940
141007
  exports.YoutubeVideoPlayer = YoutubeVideoPlayer;
140941
141008
  exports.getCurrencySymbol = getCurrencySymbol;
141009
+ exports.resolveWithGlobal = resolveWithGlobal;
140942
141010
  exports.sendToast = sendToast;
140943
141011
  exports.useClickOutside = useClickOutside;
140944
141012
  exports.useCloudinaryConfig = useCloudinaryConfig;
140945
141013
  exports.useCurrentTheme = useCurrentTheme;
140946
141014
  exports.useDrawer = useDrawer;
141015
+ exports.useEUIConfig = useEUIConfig;
140947
141016
  exports.useIsMobile = useIsMobile;
140948
141017
  exports.useModal = useModal;
140949
141018
  exports.useTheme = useTheme;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elseware-ui",
3
- "version": "2.17.3",
3
+ "version": "2.18.0",
4
4
  "private": false,
5
5
  "description": "A modern and customizable React UI component library by elseware Technology.",
6
6
  "keywords": [