@itilite/lumina-ui 1.1.13 → 1.1.14

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.
@@ -0,0 +1,141 @@
1
+ import {
2
+ Button
3
+ } from "./chunk-3XUHGVYA.mjs";
4
+ import {
5
+ __objRest,
6
+ __spreadProps,
7
+ __spreadValues
8
+ } from "./chunk-FWCSY2DS.mjs";
9
+
10
+ // src/atom/Modal/Modal.tsx
11
+ import { Modal as AntModal } from "antd";
12
+ import clsx from "clsx";
13
+
14
+ // src/atom/Modal/Modal.module.scss
15
+ var Modal_module_default = { "modal": "Modal-module__modal___PKrAi", "footerMargintopDisable": "Modal-module__footerMargintopDisable___4B6u-", "ant-modal-footer": "Modal-module__ant-modal-footer___HKsDR", "okBtn": "Modal-module__okBtn___Ut8e5", "cancelBtn": "Modal-module__cancelBtn___i0Rm8" };
16
+
17
+ // src/atom/Modal/Modal.tsx
18
+ import { jsx, jsxs } from "react/jsx-runtime";
19
+ var Close = (_a) => {
20
+ var _b = _a, { size = 14, color = "#B6BAC3" } = _b, rest = __objRest(_b, ["size", "color"]);
21
+ return /* @__PURE__ */ jsx(
22
+ "svg",
23
+ __spreadProps(__spreadValues({
24
+ width: size,
25
+ height: size,
26
+ viewBox: "0 0 14 14",
27
+ fill: "none",
28
+ xmlns: "http://www.w3.org/2000/svg"
29
+ }, rest), {
30
+ children: /* @__PURE__ */ jsx(
31
+ "path",
32
+ {
33
+ d: "M0.292893 0.292893C0.683417 -0.0976311 1.31658 -0.0976311 1.70711 0.292893L7 5.58579L12.2929 0.292893C12.6834 -0.0976311 13.3166 -0.0976311 13.7071 0.292893C14.0976 0.683417 14.0976 1.31658 13.7071 1.70711L8.41421 7L13.7071 12.2929C14.0976 12.6834 14.0976 13.3166 13.7071 13.7071C13.3166 14.0976 12.6834 14.0976 12.2929 13.7071L7 8.41421L1.70711 13.7071C1.31658 14.0976 0.683417 14.0976 0.292893 13.7071C-0.0976311 13.3166 -0.0976311 12.6834 0.292893 12.2929L5.58579 7L0.292893 1.70711C-0.0976311 1.31658 -0.0976311 0.683417 0.292893 0.292893Z",
34
+ fill: color
35
+ }
36
+ )
37
+ })
38
+ );
39
+ };
40
+ var Modal = (_a) => {
41
+ var _b = _a, {
42
+ className = "",
43
+ title = "",
44
+ children,
45
+ open = false,
46
+ handleOk,
47
+ handleCancel,
48
+ okText = "",
49
+ cancelText = "",
50
+ closeIcon = /* @__PURE__ */ jsx(Close, { color: "#6B7280" }),
51
+ bodyClassName = "modalBody",
52
+ outsideClickDisable = false,
53
+ hideCross = false,
54
+ okButtonLoading = false,
55
+ okButtonDisabled = false,
56
+ variant = "primary",
57
+ okBtnClasses = "",
58
+ cancelButtonAnalytics = {},
59
+ okButtonAnalytics = {},
60
+ footerMargintopDisable = true
61
+ } = _b, rest = __objRest(_b, [
62
+ "className",
63
+ "title",
64
+ "children",
65
+ "open",
66
+ "handleOk",
67
+ "handleCancel",
68
+ "okText",
69
+ "cancelText",
70
+ "closeIcon",
71
+ "bodyClassName",
72
+ "outsideClickDisable",
73
+ "hideCross",
74
+ "okButtonLoading",
75
+ "okButtonDisabled",
76
+ "variant",
77
+ "okBtnClasses",
78
+ "cancelButtonAnalytics",
79
+ "okButtonAnalytics",
80
+ "footerMargintopDisable"
81
+ ]);
82
+ return /* @__PURE__ */ jsx("div", { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx(
83
+ AntModal,
84
+ __spreadProps(__spreadValues({
85
+ title,
86
+ open,
87
+ onOk: handleOk,
88
+ onCancel: handleCancel,
89
+ className: clsx(Modal_module_default.modal, className, {
90
+ footerMargintopDisable
91
+ }),
92
+ okText,
93
+ cancelText,
94
+ closeIcon,
95
+ closable: !hideCross,
96
+ maskClosable: !outsideClickDisable,
97
+ footer: okText || cancelText ? /* @__PURE__ */ jsxs(
98
+ "div",
99
+ {
100
+ className: clsx({
101
+ primaryFooter: variant === "primary",
102
+ secondaryFooter: variant === "secondary"
103
+ }),
104
+ children: [
105
+ cancelText && /* @__PURE__ */ jsx(
106
+ Button,
107
+ __spreadProps(__spreadValues({
108
+ onClick: handleCancel,
109
+ type: "secondary",
110
+ className: "cancelBtn",
111
+ variant: "subtle"
112
+ }, cancelButtonAnalytics), {
113
+ children: cancelText
114
+ })
115
+ ),
116
+ okText && /* @__PURE__ */ jsx(
117
+ Button,
118
+ __spreadProps(__spreadValues({
119
+ onClick: handleOk,
120
+ className: clsx(okBtnClasses, "okBtn"),
121
+ loading: okButtonLoading,
122
+ disabled: okButtonDisabled
123
+ }, okButtonAnalytics), {
124
+ children: okText
125
+ })
126
+ )
127
+ ]
128
+ }
129
+ ) : null
130
+ }, rest), {
131
+ children: /* @__PURE__ */ jsx("div", { className: bodyClassName, children })
132
+ })
133
+ ) });
134
+ };
135
+ Modal.displayName = "Modal";
136
+ var Modal_default = Modal;
137
+
138
+ export {
139
+ Modal,
140
+ Modal_default
141
+ };
package/dist/index.d.mts CHANGED
@@ -10,6 +10,7 @@ export { default as RangePicker } from './atom/RangePicker/RangePicker.mjs';
10
10
  export { default as Select } from './atom/Select/Select.mjs';
11
11
  export { default as LoadingSpinner } from './atom/LoadingSpinner/LoadingSpinner.mjs';
12
12
  export { default as Slider } from './atom/Slider/Slider.mjs';
13
+ export { default as UserProfile } from './molecules/UserProfile/UserProfile.mjs';
13
14
  import 'react';
14
15
  import 'antd/es/checkbox';
15
16
  import 'antd/lib/radio';
package/dist/index.d.ts CHANGED
@@ -10,6 +10,7 @@ export { default as RangePicker } from './atom/RangePicker/RangePicker.js';
10
10
  export { default as Select } from './atom/Select/Select.js';
11
11
  export { default as LoadingSpinner } from './atom/LoadingSpinner/LoadingSpinner.js';
12
12
  export { default as Slider } from './atom/Slider/Slider.js';
13
+ export { default as UserProfile } from './molecules/UserProfile/UserProfile.js';
13
14
  import 'react';
14
15
  import 'antd/es/checkbox';
15
16
  import 'antd/lib/radio';
package/dist/index.js CHANGED
@@ -89,7 +89,7 @@ function Button(props) {
89
89
  type = "primary",
90
90
  variant = "default",
91
91
  size = "normal",
92
- shape = "default",
92
+ shape = "round",
93
93
  className = "",
94
94
  icon = null,
95
95
  children,
@@ -762,6 +762,46 @@ var LoadingSpinner_default = LoadingSpinner;
762
762
 
763
763
  // src/atom/Select/Select.tsx
764
764
  var import_jsx_runtime14 = require("react/jsx-runtime");
765
+ var InputWrapper = (0, import_react2.memo)(({ children, disabled, disabledTooltip }) => {
766
+ if (disabled && disabledTooltip)
767
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Tooltip_default, { title: disabledTooltip, children });
768
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_jsx_runtime14.Fragment, { children });
769
+ });
770
+ var OptionItem = (0, import_react2.memo)(({
771
+ option,
772
+ index,
773
+ isSelected,
774
+ isHighlighted,
775
+ experience,
776
+ size,
777
+ optionClassName,
778
+ onSelectHandler,
779
+ onMouseEnterHandler
780
+ }) => {
781
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
782
+ "div",
783
+ {
784
+ onClick: () => onSelectHandler(option),
785
+ onMouseEnter: () => onMouseEnterHandler(index),
786
+ className: (0, import_clsx8.default)(
787
+ "tw-transition-all tw-duration-150",
788
+ { "tw-typography-body2": size !== "small" },
789
+ { "tw-typography-caption1": size === "small" },
790
+ optionClassName
791
+ ),
792
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
793
+ "div",
794
+ {
795
+ className: (0, import_clsx8.default)(
796
+ "tw-px-4 tw-cursor-pointer tw-py-2 tw-mx-0.5 tw-rounded-xl",
797
+ isSelected ? experience === "personal" ? "tw-bg-[#f1e8fa]" : "tw-bg-[#fff1e1]" : isHighlighted ? "tw-bg-[#f3f4f6] tw-text-gray-900" : "tw-text-gray-900 hover:tw-bg-[#1118270a]"
798
+ ),
799
+ children: option.label
800
+ }
801
+ )
802
+ }
803
+ );
804
+ });
765
805
  var Select = ({
766
806
  label,
767
807
  mandatory = false,
@@ -1000,6 +1040,31 @@ var Select = ({
1000
1040
  }
1001
1041
  return "";
1002
1042
  }, [selectedValue, validatedOptions, showDisplayValue, normalizeValue]);
1043
+ const displayValue = (0, import_react2.useMemo)(() => getDisplayValue(), [getDisplayValue]);
1044
+ const inputClasses = (0, import_react2.useMemo)(() => {
1045
+ return (0, import_clsx8.default)(
1046
+ "tw-w-full tw-rounded-xl tw-outline-none tw-transition-all tw-duration-200 tw-cursor-pointer tw-border-solid tw-text-color-text-default",
1047
+ sizeClasses.input,
1048
+ sizeClasses.padding,
1049
+ variantClasses,
1050
+ {
1051
+ "tw-bg-white": valueSelected || displayValue || isFocused,
1052
+ "tw-bg-color-gray-5": !valueSelected || !displayValue,
1053
+ "!tw-bg-[#F8F7F6] tw-cursor-not-allowed tw-pointer-events-none": disabled
1054
+ },
1055
+ !label && "tw-flex tw-items-center",
1056
+ {
1057
+ "!tw-border-color-primary": isFocused && experience === "business"
1058
+ },
1059
+ {
1060
+ "!tw-border-[#804D7B]": isFocused && experience === "personal"
1061
+ },
1062
+ error ? "!tw-border-color-text-critical " : "tw-border-[#EBE3DD] hover:tw-border-[#C5B7AC]",
1063
+ "focus:tw-shadow-sm focus:tw-ring-offset-1",
1064
+ className,
1065
+ inputClassName
1066
+ );
1067
+ }, [sizeClasses, variantClasses, valueSelected, displayValue, isFocused, disabled, label, experience, error, className, inputClassName]);
1003
1068
  const filteredOptions = (0, import_react2.useMemo)(() => {
1004
1069
  var _a;
1005
1070
  if (!enableSearch) {
@@ -1094,7 +1159,7 @@ var Select = ({
1094
1159
  }, [highlightedIndex]);
1095
1160
  (0, import_react2.useEffect)(() => {
1096
1161
  optionRefs.current = [];
1097
- }, [filteredOptions]);
1162
+ }, [filteredOptions.length]);
1098
1163
  const handleMouseEnter = (0, import_react2.useCallback)(() => {
1099
1164
  if (hoverTimeoutRef.current) {
1100
1165
  clearTimeout(hoverTimeoutRef.current);
@@ -1131,12 +1196,23 @@ var Select = ({
1131
1196
  },
1132
1197
  [isOpen, handleInputInteraction]
1133
1198
  );
1134
- const InputWrapper = ({ children }) => {
1135
- if (disabled && disabledTooltip)
1136
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Tooltip_default, { title: disabledTooltip, children });
1137
- return children;
1138
- };
1139
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(InputWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1199
+ const handleChevronMouseDown = (0, import_react2.useCallback)(
1200
+ (e) => {
1201
+ if (isHovering && selectedValue && allowClear) {
1202
+ handleClear(e);
1203
+ } else {
1204
+ handleChevronClick(e);
1205
+ }
1206
+ },
1207
+ [isHovering, selectedValue, allowClear, handleClear, handleChevronClick]
1208
+ );
1209
+ const handleOptionClick = (0, import_react2.useCallback)((option) => {
1210
+ handleOptionSelect(option);
1211
+ }, [handleOptionSelect]);
1212
+ const handleOptionMouseEnter = (0, import_react2.useCallback)((index) => {
1213
+ setHighlightedIndex(index);
1214
+ }, []);
1215
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(InputWrapper, { disabled, disabledTooltip, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1140
1216
  "div",
1141
1217
  {
1142
1218
  style,
@@ -1160,35 +1236,11 @@ var Select = ({
1160
1236
  autoCorrect: "off",
1161
1237
  autoCapitalize: "off",
1162
1238
  spellCheck: "false",
1163
- value: isFocused && enableSearch ? searchTerm : getDisplayValue(),
1239
+ value: isFocused && enableSearch ? searchTerm : displayValue,
1164
1240
  onChange: enableSearch ? handleSearchChange : void 0,
1165
1241
  onClick: handleInputInteraction,
1166
1242
  onKeyDown: handleKeyDown,
1167
- className: (0, import_clsx8.default)(
1168
- "tw-w-full tw-rounded-xl tw-outline-none tw-transition-all tw-duration-200 tw-cursor-pointer tw-border-solid tw-text-color-text-default",
1169
- sizeClasses.input,
1170
- sizeClasses.padding,
1171
- variantClasses,
1172
- {
1173
- "tw-bg-white": valueSelected || getDisplayValue() || isFocused,
1174
- "tw-bg-color-gray-5": !valueSelected || !getDisplayValue(),
1175
- "!tw-bg-[#F8F7F6] tw-cursor-not-allowed tw-pointer-events-none": disabled
1176
- },
1177
- // Conditional padding based on label presence
1178
- !label && "tw-flex tw-items-center",
1179
- {
1180
- "!tw-border-color-primary": isFocused && experience === "business"
1181
- },
1182
- {
1183
- "!tw-border-[#804D7B]": isFocused && experience === "personal"
1184
- },
1185
- error ? "!tw-border-color-text-critical " : "tw-border-[#EBE3DD] hover:tw-border-[#C5B7AC]",
1186
- // Add focus state styling
1187
- "focus:tw-shadow-sm focus:tw-ring-offset-1",
1188
- className,
1189
- inputClassName
1190
- // Put inputClassName last so it can override default classes
1191
- ),
1243
+ className: inputClasses,
1192
1244
  readOnly: !isFocused || !enableSearch
1193
1245
  }
1194
1246
  ),
@@ -1229,13 +1281,7 @@ var Select = ({
1229
1281
  // Only rotate chevron when open and not showing clear icon
1230
1282
  isOpen && !(isHovering && selectedValue && allowClear) && "-tw-rotate-180"
1231
1283
  ),
1232
- onMouseDown: (e) => {
1233
- if (isHovering && selectedValue && allowClear) {
1234
- handleClear(e);
1235
- } else {
1236
- handleChevronClick(e);
1237
- }
1238
- },
1284
+ onMouseDown: handleChevronMouseDown,
1239
1285
  children: disabled ? null : isHovering && selectedValue && allowClear ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1240
1286
  CrossV2,
1241
1287
  {
@@ -1266,75 +1312,32 @@ var Select = ({
1266
1312
  dropdownClassName
1267
1313
  ),
1268
1314
  ref: optionListRef,
1269
- children: filteredOptions.length > 0 ? filteredOptions.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1270
- "div",
1271
- {
1272
- ref: (el) => optionRefs.current[index] = el,
1273
- onClick: () => handleOptionSelect(option),
1274
- onMouseEnter: () => setHighlightedIndex(index),
1275
- className: (0, import_clsx8.default)(
1276
- "tw-transition-all tw-duration-150",
1277
- { "tw-typography-body2": size !== "small" },
1278
- { "tw-typography-caption1": size === "small" },
1279
- optionClassName
1280
- ),
1281
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1282
- "div",
1283
- {
1284
- className: (0, import_clsx8.default)(
1285
- "tw-px-4 tw-cursor-pointer tw-py-2 tw-mx-0.5 tw-rounded-xl",
1286
- normalizeValue(selectedValue) === normalizeValue(option.value) ? experience === "personal" ? "tw-bg-[#f1e8fa]" : "tw-bg-[#fff1e1]" : (
1287
- // Highlighted option styling (keyboard navigation)
1288
- index === highlightedIndex ? "tw-bg-[#f3f4f6] tw-text-gray-900" : (
1289
- // Default option styling
1290
- "tw-text-gray-900 hover:tw-bg-[#1118270a]"
1291
- )
1292
- )
1293
- ),
1294
- children: option.label
1295
- }
1296
- )
1297
- },
1298
- doubleCharSearch ? option.label : option.value
1299
- )) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "tw-px-4 tw-py-3 tw-text-gray-500 tw-text-sm", children: "No options found" })
1315
+ children: filteredOptions.length > 0 ? filteredOptions.map((option, index) => {
1316
+ const isSelected = normalizeValue(selectedValue) === normalizeValue(option.value);
1317
+ const isHighlighted = index === highlightedIndex;
1318
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { ref: (el) => optionRefs.current[index] = el, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1319
+ OptionItem,
1320
+ {
1321
+ option,
1322
+ index,
1323
+ isSelected,
1324
+ isHighlighted,
1325
+ experience,
1326
+ size,
1327
+ optionClassName,
1328
+ onSelectHandler: handleOptionClick,
1329
+ onMouseEnterHandler: handleOptionMouseEnter
1330
+ }
1331
+ ) }, doubleCharSearch ? option.label : option.value);
1332
+ }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "tw-px-4 tw-py-3 tw-text-gray-500 tw-text-sm", children: "No options found" })
1300
1333
  }
1301
1334
  )
1302
1335
  ]
1303
1336
  }
1304
1337
  ) });
1305
1338
  };
1306
- var arePropsEqual = (prevProps, nextProps) => {
1307
- var _a, _b;
1308
- const criticalProps = [
1309
- "value",
1310
- "valueSelected",
1311
- "options",
1312
- "error",
1313
- "disabled",
1314
- "label",
1315
- "mandatory"
1316
- ];
1317
- for (const prop of criticalProps) {
1318
- if (prevProps[prop] !== nextProps[prop]) {
1319
- return false;
1320
- }
1321
- }
1322
- if (((_a = prevProps.options) == null ? void 0 : _a.length) !== ((_b = nextProps.options) == null ? void 0 : _b.length)) {
1323
- return false;
1324
- }
1325
- if (prevProps.options && nextProps.options) {
1326
- for (let i = 0; i < prevProps.options.length; i++) {
1327
- const prevOpt = prevProps.options[i];
1328
- const nextOpt = nextProps.options[i];
1329
- if ((prevOpt == null ? void 0 : prevOpt.value) !== (nextOpt == null ? void 0 : nextOpt.value) || (prevOpt == null ? void 0 : prevOpt.label) !== (nextOpt == null ? void 0 : nextOpt.label)) {
1330
- return false;
1331
- }
1332
- }
1333
- }
1334
- return true;
1335
- };
1336
1339
  Select.displayName = "Select";
1337
- var Select_default = (0, import_react2.memo)(Select, arePropsEqual);
1340
+ var Select_default = Select;
1338
1341
 
1339
1342
  // src/atom/RangePicker/RangePicker.tsx
1340
1343
  var import_jsx_runtime15 = require("react/jsx-runtime");
package/dist/index.mjs CHANGED
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  RangePicker_default
3
- } from "./chunk-35KDS27M.mjs";
3
+ } from "./chunk-PSBEYGD4.mjs";
4
4
  import {
5
5
  Slider_default
6
6
  } from "./chunk-D3N7VFER.mjs";
7
7
  import {
8
8
  Select_default
9
- } from "./chunk-E4FCLHYA.mjs";
9
+ } from "./chunk-GU5F7Z7I.mjs";
10
10
  import {
11
11
  Switch_default
12
12
  } from "./chunk-MNARBWAJ.mjs";
@@ -30,10 +30,10 @@ import {
30
30
  } from "./chunk-QKTMWS4J.mjs";
31
31
  import {
32
32
  Modal_default
33
- } from "./chunk-UQJ3BDM4.mjs";
33
+ } from "./chunk-UTMZY37A.mjs";
34
34
  import {
35
35
  Button_default
36
- } from "./chunk-AF2RKLH6.mjs";
36
+ } from "./chunk-3XUHGVYA.mjs";
37
37
  import {
38
38
  Radio_default
39
39
  } from "./chunk-2EBPXGRY.mjs";