maru_design2 2.22.4 → 2.23.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.23.0](https://github.com/42maru-ai/maru-design2/compare/v2.22.4...v2.23.0) (2025-02-17)
4
+
5
+
6
+ ### Features
7
+
8
+ * :bug: Popover,Tooltip,Dropdown - update open logics [#486](https://github.com/42maru-ai/maru-design2/issues/486) ([dc76a0d](https://github.com/42maru-ai/maru-design2/commit/dc76a0d067598bc2cc070c584611d0707c824f17))
9
+ * :sparkles: Input - add date, time type [#444](https://github.com/42maru-ai/maru-design2/issues/444) ([f520e00](https://github.com/42maru-ai/maru-design2/commit/f520e004c4416ce9a4c2ba5b977d9b175ca87bdb))
10
+ * :sparkles: Input - add persistent placeholder [#479](https://github.com/42maru-ai/maru-design2/issues/479) ([7c30ffc](https://github.com/42maru-ai/maru-design2/commit/7c30ffcf02231764c5869d58369b3669a75d5227))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * :bug: SearchInput - update popover to div [#480](https://github.com/42maru-ai/maru-design2/issues/480) ([b20ea19](https://github.com/42maru-ai/maru-design2/commit/b20ea1959991000e07bbfb196dc65d6816d62885))
16
+
3
17
  ## [2.22.4](https://github.com/42maru-ai/maru-design2/compare/v2.22.3...v2.22.4) (2025-02-12)
4
18
 
5
19
 
@@ -4,6 +4,7 @@ import { TCheckboxSize } from '../../../enums/size';
4
4
  import './checkbox.scss';
5
5
  export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'checked' | 'type'> {
6
6
  checked?: boolean;
7
+ label?: string;
7
8
  /**
8
9
  * (@v1 variant)
9
10
  */
@@ -12,7 +13,6 @@ export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputE
12
13
  * 컴포넌트와 라벨 사이의 거리
13
14
  */
14
15
  gap?: TGap;
15
- label?: string;
16
16
  /**
17
17
  * [16, 18, 24]
18
18
  */
@@ -11,7 +11,7 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
11
11
  };
12
12
  label?: string;
13
13
  /**
14
- * 데이터 타입. ['text', 'password', 'number']
14
+ * 데이터 타입
15
15
  */
16
16
  type?: TInputType;
17
17
  /**
@@ -35,5 +35,9 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
35
35
  */
36
36
  endNode?: React.ReactNode;
37
37
  className?: string;
38
+ /**
39
+ * true이면 placeholder가 없어지지 않음
40
+ */
41
+ persistentPlaceholder?: boolean;
38
42
  }
39
43
  export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
@@ -22,7 +22,7 @@ export interface TooltipProps {
22
22
  */
23
23
  portal?: boolean;
24
24
  /**
25
- * 대상와 툴팁 사이의 거리. ['6px', '4px', '0px']
25
+ * 대상와 툴팁 사이의 거리
26
26
  */
27
27
  gap?: TTooltipGap;
28
28
  }
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ interface Props {
3
+ parent: HTMLElement;
4
+ onClose: () => void;
5
+ formats: {
6
+ columnIdKey: string;
7
+ columnName?: string;
8
+ filter?: React.ReactNode;
9
+ }[];
10
+ resetButtonContent?: string;
11
+ onReset: () => void;
12
+ searchButtonContent?: string;
13
+ onSearch: () => void;
14
+ }
15
+ declare function FilterPopover({ parent, onClose, formats, resetButtonContent, onReset, searchButtonContent, onSearch, }: Props): import("react/jsx-runtime").JSX.Element;
16
+ export default FilterPopover;
@@ -1,4 +1,4 @@
1
1
  export declare const GAPS: readonly ["8px", "4px", "2px"];
2
2
  export type TGap = (typeof GAPS)[number];
3
- export declare const TOOLTIP_GAPS: readonly ["6px", "4px", "0px"];
3
+ export declare const TOOLTIP_GAPS: readonly [6, 4, 0];
4
4
  export type TTooltipGap = (typeof TOOLTIP_GAPS)[number];
@@ -1,4 +1,4 @@
1
- export declare const INPUT_TYPES: readonly ["text", "password", "number"];
1
+ export declare const INPUT_TYPES: readonly ["text", "password", "number", "date", "time"];
2
2
  export type TInputType = (typeof INPUT_TYPES)[number];
3
3
  export declare const DROPDOWN_TYPES: readonly ["button", "search"];
4
4
  export type TDropdownType = (typeof DROPDOWN_TYPES)[number];
package/dist/index.js CHANGED
@@ -6362,7 +6362,7 @@ function Chip(_a) {
6362
6362
  }));
6363
6363
  }
6364
6364
 
6365
- var css_248z$g = ".maru-input-wrapper .maru-input-label {\n margin-bottom: 8px;\n font-family: Pretendard;\n font-style: normal;\n line-height: 150%;\n font-size: 14px;\n letter-spacing: -0.56px;\n font-weight: 500;\n}\n.maru-input-wrapper .maru-input-label label {\n color: #5c5c5c;\n}\n.maru-input-wrapper .maru-input {\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: row;\n height: 37px;\n padding: 8px 10px 8px 14px;\n border: 1px solid #e4e4e4;\n border-radius: 6px;\n}\n.maru-input-wrapper .maru-input > input {\n width: 100%;\n border: unset;\n outline: unset;\n background-color: transparent;\n font-family: Pretendard;\n font-style: normal;\n line-height: 150%;\n font-size: 14px;\n letter-spacing: -0.56px;\n font-weight: 400;\n color: #5c5c5c;\n}\n.maru-input-wrapper .maru-input > input::-webkit-input-placeholder {\n font-weight: 300;\n color: #8c8c8c;\n}\n.maru-input-wrapper .maru-input > input::-moz-placeholder {\n font-weight: 300;\n color: #8c8c8c;\n}\n.maru-input-wrapper .maru-input > input:-ms-input-placeholder {\n font-weight: 300;\n color: #8c8c8c;\n}\n.maru-input-wrapper .maru-input > input::-ms-input-placeholder {\n font-weight: 300;\n color: #8c8c8c;\n}\n.maru-input-wrapper .maru-input > input::placeholder {\n font-weight: 300;\n color: #8c8c8c;\n}\n.maru-input-wrapper .maru-input:focus-visible, .maru-input-wrapper .maru-input:focus-within {\n border-color: #5c5c5c;\n background-color: #fafafa;\n}\n.maru-input-wrapper .maru-input.errored {\n outline: 1px solid #e53e3e;\n border-color: #e53e3e;\n}\n.maru-input-wrapper .maru-input:hover {\n outline: 1px solid #e4e4e4;\n border-color: #e4e4e4;\n background-color: #fafafa;\n}\n.maru-input-wrapper .maru-input.disabled {\n background-color: #fafafa;\n}\n.maru-input-wrapper .maru-input.disabled > input {\n color: #bdbdbd;\n}\n.maru-input-wrapper .maru-input.disabled > input::-webkit-input-placeholder {\n color: #bdbdbd;\n}\n.maru-input-wrapper .maru-input.disabled > input::-moz-placeholder {\n color: #bdbdbd;\n}\n.maru-input-wrapper .maru-input.disabled > input:-ms-input-placeholder {\n color: #bdbdbd;\n}\n.maru-input-wrapper .maru-input.disabled > input::-ms-input-placeholder {\n color: #bdbdbd;\n}\n.maru-input-wrapper .maru-input.disabled > input::placeholder {\n color: #bdbdbd;\n}\n.maru-input-wrapper .maru-input.disabled:hover {\n outline: unset;\n}\n.maru-input-wrapper .maru-input-start-node {\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: row;\n margin-right: 10px;\n}\n.maru-input-wrapper .maru-input-end-node-wrapper {\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: row;\n gap: 6px;\n}\n.maru-input-wrapper .maru-input-end-node-wrapper > button {\n padding: unset;\n margin: unset;\n border: unset;\n background-color: unset;\n cursor: pointer;\n display: flex;\n}\n.maru-input-wrapper .maru-input-end-node-wrapper .maru-input-end-node {\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: row;\n}\n.maru-input-wrapper .maru-input-footer {\n display: block;\n margin-top: 4px;\n}\n.maru-input-wrapper .maru-input-footer > span {\n font-family: Pretendard;\n font-style: normal;\n line-height: 150%;\n font-size: 12px;\n letter-spacing: -0.48px;\n font-weight: 500;\n color: #e53e3e;\n font-weight: 400;\n}";
6365
+ var css_248z$g = ".maru-input-wrapper .maru-input-label {\n margin-bottom: 8px;\n font-family: Pretendard;\n font-style: normal;\n line-height: 150%;\n font-size: 14px;\n letter-spacing: -0.56px;\n font-weight: 500;\n}\n.maru-input-wrapper .maru-input-label label {\n color: #5c5c5c;\n}\n.maru-input-wrapper .maru-input {\n display: flex;\n justify-content: flex-start;\n align-items: center;\n flex-direction: row;\n height: 37px;\n padding: 8px 10px 8px 14px;\n border: 1px solid #e4e4e4;\n border-radius: 6px;\n}\n.maru-input-wrapper .maru-input .persistent-placeholder {\n position: absolute;\n z-index: -1;\n}\n.maru-input-wrapper .maru-input .persistent-placeholder > span {\n color: #8c8c8c;\n font-family: Pretendard;\n font-style: normal;\n line-height: 150%;\n font-size: 14px;\n letter-spacing: -0.56px;\n font-weight: 300;\n}\n.maru-input-wrapper .maru-input .persistent-placeholder > span[data-hidden] {\n visibility: hidden;\n}\n.maru-input-wrapper .maru-input > input {\n width: 100%;\n border: unset;\n outline: unset;\n background-color: transparent;\n font-family: Pretendard;\n font-style: normal;\n line-height: 150%;\n font-size: 14px;\n letter-spacing: -0.56px;\n font-weight: 400;\n color: #5c5c5c;\n padding: unset;\n}\n.maru-input-wrapper .maru-input > input::-webkit-input-placeholder {\n font-weight: 300;\n color: #8c8c8c;\n}\n.maru-input-wrapper .maru-input > input::-moz-placeholder {\n font-weight: 300;\n color: #8c8c8c;\n}\n.maru-input-wrapper .maru-input > input:-ms-input-placeholder {\n font-weight: 300;\n color: #8c8c8c;\n}\n.maru-input-wrapper .maru-input > input::-ms-input-placeholder {\n font-weight: 300;\n color: #8c8c8c;\n}\n.maru-input-wrapper .maru-input > input::placeholder {\n font-weight: 300;\n color: #8c8c8c;\n}\n.maru-input-wrapper .maru-input:focus-visible, .maru-input-wrapper .maru-input:focus-within {\n border-color: #5c5c5c;\n background-color: rgba(228, 228, 228, 0.2);\n}\n.maru-input-wrapper .maru-input.errored {\n outline: 1px solid #e53e3e;\n border-color: #e53e3e;\n}\n.maru-input-wrapper .maru-input:hover {\n outline: 1px solid #e4e4e4;\n border-color: #e4e4e4;\n background-color: rgba(228, 228, 228, 0.2);\n}\n.maru-input-wrapper .maru-input.disabled {\n background-color: #fafafa;\n}\n.maru-input-wrapper .maru-input.disabled > input {\n color: #bdbdbd;\n}\n.maru-input-wrapper .maru-input.disabled > input::-webkit-input-placeholder {\n color: #bdbdbd;\n}\n.maru-input-wrapper .maru-input.disabled > input::-moz-placeholder {\n color: #bdbdbd;\n}\n.maru-input-wrapper .maru-input.disabled > input:-ms-input-placeholder {\n color: #bdbdbd;\n}\n.maru-input-wrapper .maru-input.disabled > input::-ms-input-placeholder {\n color: #bdbdbd;\n}\n.maru-input-wrapper .maru-input.disabled > input::placeholder {\n color: #bdbdbd;\n}\n.maru-input-wrapper .maru-input.disabled:hover {\n outline: unset;\n}\n.maru-input-wrapper .maru-input-start-node {\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: row;\n margin-right: 10px;\n}\n.maru-input-wrapper .maru-input-end-node-wrapper {\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: row;\n gap: 6px;\n}\n.maru-input-wrapper .maru-input-end-node-wrapper > button {\n padding: unset;\n margin: unset;\n border: unset;\n background-color: unset;\n cursor: pointer;\n display: flex;\n}\n.maru-input-wrapper .maru-input-end-node-wrapper .maru-input-end-node {\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: row;\n}\n.maru-input-wrapper .maru-input-footer {\n display: block;\n margin-top: 4px;\n}\n.maru-input-wrapper .maru-input-footer > span {\n font-family: Pretendard;\n font-style: normal;\n line-height: 150%;\n font-size: 12px;\n letter-spacing: -0.48px;\n font-weight: 500;\n color: #e53e3e;\n font-weight: 400;\n}";
6366
6366
  styleInject(css_248z$g);
6367
6367
 
6368
6368
  var Input = /*#__PURE__*/forwardRef(function (_a, inputRef) {
@@ -6376,13 +6376,21 @@ var Input = /*#__PURE__*/forwardRef(function (_a, inputRef) {
6376
6376
  startNode = _a.startNode,
6377
6377
  endNode = _a.endNode,
6378
6378
  className = _a.className,
6379
- props = __rest(_a, ["invalid", "label", "type", "onClear", "hiddenClearButton", "wrapperRef", "startNode", "endNode", "className"]);
6380
- var _c = useState(true),
6381
- maskingPassword = _c[0],
6382
- setMaskingPassword = _c[1]; // *로 보이고 싶으면 true
6383
- var _d = useState(false),
6384
- showClearButton = _d[0],
6385
- setShowClearButton = _d[1];
6379
+ _c = _a.persistentPlaceholder,
6380
+ persistentPlaceholder = _c === void 0 ? false : _c,
6381
+ props = __rest(_a, ["invalid", "label", "type", "onClear", "hiddenClearButton", "wrapperRef", "startNode", "endNode", "className", "persistentPlaceholder"]);
6382
+ var _d = useState(true),
6383
+ maskingPassword = _d[0],
6384
+ setMaskingPassword = _d[1]; // *로 보이고 싶으면 true
6385
+ var _e = useState(false),
6386
+ showClearButton = _e[0],
6387
+ setShowClearButton = _e[1];
6388
+ var _f = useState(''),
6389
+ hiddenPlaceholder = _f[0],
6390
+ setHiddenPlaceholder = _f[1];
6391
+ var _g = useState(''),
6392
+ remainPlaceholder = _g[0],
6393
+ setRemainPlaceholder = _g[1];
6386
6394
  var combineRef = useCombineRef(inputRef);
6387
6395
  var hashId = uuidv4(4);
6388
6396
  useEffect(function () {
@@ -6408,6 +6416,14 @@ var Input = /*#__PURE__*/forwardRef(function (_a, inputRef) {
6408
6416
  setShowClearButton(!hiddenClearButton);
6409
6417
  }
6410
6418
  }, [combineRef.current, hiddenClearButton]);
6419
+ /**
6420
+ * persistentPlaceholder = true일때 보여줄 placeholder 세팅
6421
+ */
6422
+ useEffect(function () {
6423
+ if (persistentPlaceholder && props.placeholder) {
6424
+ setRemainPlaceholder(props.placeholder);
6425
+ }
6426
+ }, [persistentPlaceholder, props.placeholder]);
6411
6427
  var handleInputChange = function handleInputChange(e) {
6412
6428
  var _a;
6413
6429
  setShowClearButton(!hiddenClearButton);
@@ -6420,10 +6436,44 @@ var Input = /*#__PURE__*/forwardRef(function (_a, inputRef) {
6420
6436
  } else {
6421
6437
  newValue = value.slice(0, value.length - 1);
6422
6438
  }
6439
+ } else if (type === 'date') {
6440
+ var regexNum = /[^0-9]/g;
6441
+ var onlyNum = value.replace(regexNum, ''); // 숫자가 아닌 경우 ''
6442
+ var format = void 0;
6443
+ var regexDate = void 0;
6444
+ if (onlyNum.length <= 6) {
6445
+ // 000000 -> 0000-00
6446
+ format = '$1-$2';
6447
+ regexDate = /([0-9]{4})([0-9]+)/;
6448
+ } else if (onlyNum.length <= 8) {
6449
+ // 00000000 -> 0000-00-00
6450
+ format = '$1-$2-$3';
6451
+ regexDate = /([0-9]{4})([0-9]{2})([0-9]+)/;
6452
+ }
6453
+ newValue = onlyNum.replace(regexDate, format);
6454
+ } else if (type === 'time') {
6455
+ var regexNum = /[^0-9]/g;
6456
+ var onlyNum = value.replace(regexNum, ''); // 숫자가 아닌 경우 ''
6457
+ var format = void 0;
6458
+ var regexTime = void 0;
6459
+ if (onlyNum.length <= 4) {
6460
+ // 0000 -> 00:00
6461
+ format = '$1:$2';
6462
+ regexTime = /([0-9]{2})([0-9]+)/;
6463
+ } else if (onlyNum.length <= 6) {
6464
+ // 000000 -> 00:00:00
6465
+ format = '$1:$2:$3';
6466
+ regexTime = /([0-9]{2})([0-9]{2})([0-9]+)/;
6467
+ }
6468
+ newValue = onlyNum.replace(regexTime, format);
6423
6469
  }
6424
6470
  if (!newValue) {
6425
6471
  setShowClearButton(false );
6426
6472
  }
6473
+ if (persistentPlaceholder && props.placeholder) {
6474
+ setHiddenPlaceholder(newValue);
6475
+ setRemainPlaceholder(props.placeholder.substring(newValue.length));
6476
+ }
6427
6477
  e.currentTarget.value = newValue;
6428
6478
  (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, e);
6429
6479
  };
@@ -6447,6 +6497,10 @@ var Input = /*#__PURE__*/forwardRef(function (_a, inputRef) {
6447
6497
  setShowClearButton(false );
6448
6498
  combineRef.current.value = '';
6449
6499
  combineRef.current.focus();
6500
+ if (persistentPlaceholder && props.placeholder) {
6501
+ setHiddenPlaceholder('');
6502
+ setRemainPlaceholder(props.placeholder);
6503
+ }
6450
6504
  }
6451
6505
  onClear === null || onClear === void 0 ? void 0 : onClear();
6452
6506
  };
@@ -6472,12 +6526,23 @@ var Input = /*#__PURE__*/forwardRef(function (_a, inputRef) {
6472
6526
  className: "maru-input-start-node"
6473
6527
  }, {
6474
6528
  children: startNode
6529
+ })), persistentPlaceholder && jsxs("span", __assign({
6530
+ className: "persistent-placeholder"
6531
+ }, {
6532
+ children: [jsx("span", __assign({
6533
+ "data-hidden": true
6534
+ }, {
6535
+ children: hiddenPlaceholder
6536
+ })), jsx("span", {
6537
+ children: remainPlaceholder
6538
+ })]
6475
6539
  })), jsx("input", __assign({}, props, {
6476
6540
  id: "maru-input-".concat(hashId),
6477
6541
  ref: combineRef,
6478
6542
  type: type === 'password' && maskingPassword ? 'password' : 'text',
6479
6543
  onChange: handleInputChange,
6480
- onBlur: handleInputBlur
6544
+ onBlur: handleInputBlur,
6545
+ placeholder: persistentPlaceholder ? undefined : props.placeholder
6481
6546
  })), jsxs("div", __assign({
6482
6547
  className: "maru-input-end-node-wrapper"
6483
6548
  }, {
@@ -6530,7 +6595,8 @@ Input.defaultProps = {
6530
6595
  wrapperRef: undefined,
6531
6596
  startNode: undefined,
6532
6597
  endNode: undefined,
6533
- className: undefined
6598
+ className: undefined,
6599
+ persistentPlaceholder: undefined
6534
6600
  };
6535
6601
  Input.displayName = 'Input';
6536
6602
 
@@ -8353,36 +8419,16 @@ function Popover(_a) {
8353
8419
  * instance를 useMemo로 선언하면 레퍼런스의 DOM을 찾지 못 하고,
8354
8420
  * useCallback으로 선언하면 함수라서 호출 될 때 마다 새로운 객체가 생성되어 .update가 동작하지 않음
8355
8421
  */
8356
- var instance_1 = createPopper(anchorEl, popoverRef.current, {
8422
+ var instance = createPopper(anchorEl, popoverRef.current, {
8357
8423
  placement: direction,
8358
8424
  modifiers: [{
8359
- name: 'flip',
8360
- options: {
8361
- padding: 10
8362
- }
8363
- }, {
8364
8425
  name: 'offset',
8365
8426
  options: {
8366
8427
  offset: [0, 4]
8367
8428
  }
8368
8429
  }]
8369
8430
  });
8370
- var instanceSetOptions = function instanceSetOptions(isEnabled) {
8371
- return instance_1.setOptions(function (options) {
8372
- return __assign(__assign({}, options), {
8373
- modifiers: __spreadArray(__spreadArray([], options.modifiers, true), [{
8374
- name: 'eventListeners',
8375
- enabled: isEnabled,
8376
- options: {
8377
- resize: isEnabled,
8378
- scroll: isEnabled
8379
- }
8380
- }], false)
8381
- });
8382
- });
8383
- };
8384
- instanceSetOptions(true);
8385
- instance_1.update();
8431
+ instance.update();
8386
8432
  popoverRef.current.focus();
8387
8433
  }
8388
8434
  }, [open]);
@@ -8401,18 +8447,15 @@ function Popover(_a) {
8401
8447
  var PopoverBody = open ? jsx("div", __assign({
8402
8448
  className: "maru-popover-background",
8403
8449
  onClick: handleBackgroundClick,
8404
- tabIndex: -1,
8405
- "aria-hidden": true
8450
+ tabIndex: -1
8406
8451
  }, {
8407
8452
  children: jsx("div", __assign({
8408
8453
  ref: popoverRef,
8409
8454
  className: classNames('maru-popover', className),
8410
8455
  role: "tooltip",
8411
- // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
8412
8456
  tabIndex: 0,
8413
8457
  onKeyUp: handleKeyUp,
8414
- onClick: handlePopoverClick,
8415
- "aria-hidden": true
8458
+ onClick: handlePopoverClick
8416
8459
  }, {
8417
8460
  children: children
8418
8461
  }))
@@ -8775,7 +8818,7 @@ function Toggle(_a) {
8775
8818
  });
8776
8819
  }
8777
8820
 
8778
- var css_248z$9 = ".maru-tooltip-wrapper {\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: row;\n width: -webkit-fit-content;\n width: -moz-fit-content;\n width: fit-content;\n padding: 0;\n}\n.maru-tooltip-wrapper[data-dir=top][data-gap=\"6px\"] {\n padding-top: 6px;\n}\n.maru-tooltip-wrapper[data-dir=top][data-gap=\"4px\"] {\n padding-top: 4px;\n}\n.maru-tooltip-wrapper[data-dir=left][data-gap=\"6px\"] {\n padding-left: 6px;\n}\n.maru-tooltip-wrapper[data-dir=left][data-gap=\"4px\"] {\n padding-left: 4px;\n}\n.maru-tooltip-wrapper[data-dir=bottom][data-gap=\"6px\"] {\n padding-bottom: 6px;\n}\n.maru-tooltip-wrapper[data-dir=bottom][data-gap=\"4px\"] {\n padding-bottom: 4px;\n}\n.maru-tooltip-wrapper[data-dir=right][data-gap=\"6px\"] {\n padding-right: 6px;\n}\n.maru-tooltip-wrapper[data-dir=right][data-gap=\"4px\"] {\n padding-right: 4px;\n}\n\n.maru-tooltip {\n z-index: 1612;\n border-radius: 6px;\n padding: 6px 10px 6px 12px;\n display: none;\n background-color: rgba(0, 0, 0, 0.8);\n}\n.maru-tooltip[data-show=true] {\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: row;\n}\n.maru-tooltip[data-show=false] {\n display: none;\n}\n.maru-tooltip,\n.maru-tooltip span,\n.maru-tooltip p,\n.maru-tooltip pre {\n color: white;\n white-space: pre-wrap;\n font-family: Pretendard;\n font-style: normal;\n line-height: 150%;\n font-size: 12px;\n letter-spacing: -0.48px;\n font-weight: 400;\n line-height: 140%;\n}";
8821
+ var css_248z$9 = ".maru-tooltip-wrapper {\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: row;\n width: -webkit-fit-content;\n width: -moz-fit-content;\n width: fit-content;\n}\n\n.maru-tooltip {\n z-index: 1612;\n border-radius: 6px;\n padding: 6px 10px 6px 12px;\n display: none;\n background-color: rgba(0, 0, 0, 0.8);\n}\n.maru-tooltip[data-show=true] {\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: row;\n}\n.maru-tooltip[data-show=false] {\n display: none;\n}\n.maru-tooltip,\n.maru-tooltip span,\n.maru-tooltip p,\n.maru-tooltip pre {\n color: white;\n white-space: pre-wrap;\n font-family: Pretendard;\n font-style: normal;\n line-height: 150%;\n font-size: 12px;\n letter-spacing: -0.48px;\n font-weight: 400;\n line-height: 140%;\n}";
8779
8822
  styleInject(css_248z$9);
8780
8823
 
8781
8824
  function Tooltip(_a) {
@@ -8789,7 +8832,7 @@ function Tooltip(_a) {
8789
8832
  _d = _a.portal,
8790
8833
  portal = _d === void 0 ? false : _d,
8791
8834
  _e = _a.gap,
8792
- gap = _e === void 0 ? '6px' : _e;
8835
+ gap = _e === void 0 ? 6 : _e;
8793
8836
  var _f = useState(false),
8794
8837
  open = _f[0],
8795
8838
  setOpen = _f[1];
@@ -8803,11 +8846,17 @@ function Tooltip(_a) {
8803
8846
  * useCallback으로 선언하면 함수라서 호출 될 때 마다 새로운 객체가 생성되어 .update가 동작하지 않음
8804
8847
  */
8805
8848
  var instance = createPopper(wrapperRef.current, tooltipRef.current, {
8806
- placement: direction
8849
+ placement: direction,
8850
+ modifiers: [{
8851
+ name: 'offset',
8852
+ options: {
8853
+ offset: [0, gap]
8854
+ }
8855
+ }]
8807
8856
  });
8808
8857
  instance.update();
8809
8858
  }
8810
- }, [show]);
8859
+ }, [show, gap]);
8811
8860
  var Tootip = useMemo(function () {
8812
8861
  return jsx("div", __assign({
8813
8862
  className: "maru-tooltip",
@@ -25609,7 +25658,6 @@ function DropdownMenu$1(_a) {
25609
25658
  var newWidth = width || pw;
25610
25659
  menu.style.width = "".concat(newWidth, "px");
25611
25660
  menu.style.left = "".concat(pl, "px");
25612
- // FIXME: 무슨 조건인지 잘 모르겠음
25613
25661
  if (ph + pt + menu.offsetHeight + 10 > document.body.offsetHeight) {
25614
25662
  menu.style.top = "".concat(pt - menu.offsetHeight - 4, "px");
25615
25663
  } else {
@@ -25656,17 +25704,13 @@ function DropdownMenu$1(_a) {
25656
25704
  return jsx("div", __assign({
25657
25705
  ref: menuWrapperRef,
25658
25706
  className: "maru-dropdown-menu-wrapper",
25659
- "aria-hidden": true,
25660
25707
  onClick: handleWrapperClick
25661
25708
  }, {
25662
25709
  children: jsxs("div", __assign({
25663
25710
  ref: menuRef,
25664
25711
  className: classNames('maru-dropdown-menu', "maru-dropdown-menu-".concat(color), {
25665
25712
  'maru-dropdown-search-menu': isSearch
25666
- // TODO:
25667
- // footer: menuBottomButton,
25668
25713
  }),
25669
- "aria-hidden": true,
25670
25714
  onClick: handleMenuClick
25671
25715
  }, {
25672
25716
  children: [jsx("div", __assign({
@@ -26767,6 +26811,89 @@ function Pagination(_a) {
26767
26811
  }));
26768
26812
  }
26769
26813
 
26814
+ function FilterPopover(_a) {
26815
+ var parent = _a.parent,
26816
+ onClose = _a.onClose,
26817
+ formats = _a.formats,
26818
+ resetButtonContent = _a.resetButtonContent,
26819
+ onReset = _a.onReset,
26820
+ searchButtonContent = _a.searchButtonContent,
26821
+ onSearch = _a.onSearch;
26822
+ var wrapperRef = useRef(null);
26823
+ var ref = useRef(null);
26824
+ /**
26825
+ * 팝오버 위치 설정
26826
+ */
26827
+ useEffect(function () {
26828
+ var popover = ref.current;
26829
+ if (popover) {
26830
+ var _a = parent.getClientRects()[0],
26831
+ pw = _a.width,
26832
+ ph = _a.height,
26833
+ pt = _a.top,
26834
+ pr = _a.right;
26835
+ popover.style.right = "".concat(pr - pw, "px");
26836
+ if (ph + pt + popover.offsetHeight + 10 > document.body.offsetHeight) {
26837
+ popover.style.top = "".concat(pt - popover.offsetHeight - 4, "px");
26838
+ } else {
26839
+ popover.style.top = "".concat(pt + ph, "px");
26840
+ }
26841
+ if (wrapperRef === null || wrapperRef === void 0 ? void 0 : wrapperRef.current) {
26842
+ wrapperRef.current.style.display = 'block';
26843
+ }
26844
+ }
26845
+ }, []);
26846
+ var handleWrapperClick = function handleWrapperClick(e) {
26847
+ e.stopPropagation();
26848
+ onClose();
26849
+ };
26850
+ var handlePopoverClick = function handlePopoverClick(e) {
26851
+ e.stopPropagation();
26852
+ };
26853
+ return jsx("div", __assign({
26854
+ ref: wrapperRef,
26855
+ className: "maru-search-input-filter-popover-wrapper",
26856
+ onClick: handleWrapperClick
26857
+ }, {
26858
+ children: jsx("div", __assign({
26859
+ ref: ref,
26860
+ className: "maru-search-input-filter-popover",
26861
+ onClick: handlePopoverClick
26862
+ }, {
26863
+ children: jsxs("div", {
26864
+ children: [jsx("ul", {
26865
+ children: formats.map(function (f) {
26866
+ return jsxs("li", {
26867
+ children: [jsx("div", __assign({
26868
+ className: "filter-key"
26869
+ }, {
26870
+ children: jsx("span", {
26871
+ children: f.columnName
26872
+ })
26873
+ })), jsx("div", __assign({
26874
+ className: "filter-value"
26875
+ }, {
26876
+ children: f.filter
26877
+ }))]
26878
+ }, f.columnIdKey);
26879
+ })
26880
+ }), jsxs("div", {
26881
+ children: [jsx(Button, __assign({
26882
+ variant: "outline",
26883
+ onClick: onReset
26884
+ }, {
26885
+ children: resetButtonContent
26886
+ })), jsx(Button, __assign({
26887
+ onClick: onSearch
26888
+ }, {
26889
+ children: searchButtonContent
26890
+ }))]
26891
+ })]
26892
+ })
26893
+ }))
26894
+ }));
26895
+ }
26896
+
26770
26897
  function Filter(_a) {
26771
26898
  var on = _a.on,
26772
26899
  formats = _a.formats,
@@ -26783,7 +26910,9 @@ function Filter(_a) {
26783
26910
  onSearch();
26784
26911
  setOpen(false);
26785
26912
  };
26786
- return jsxs(Fragment, {
26913
+ return jsxs("div", __assign({
26914
+ className: "maru-search-input-filter"
26915
+ }, {
26787
26916
  children: [jsx("button", __assign({
26788
26917
  type: "button",
26789
26918
  className: classNames('maru-search-input-filter-button', {
@@ -26802,50 +26931,25 @@ function Filter(_a) {
26802
26931
  name: ICONS.Filter_s1613
26803
26932
  })
26804
26933
  }))
26805
- })), jsx(Popover, __assign({
26806
- anchorEl: inputWrapperRef.current,
26807
- open: open,
26808
- onClose: function onClose() {
26809
- return setOpen(false);
26810
- },
26811
- direction: "bottom-end",
26812
- className: "maru-search-input-filter-popover"
26934
+ })), open && jsx(CreatePortal, __assign({
26935
+ parent: inputWrapperRef.current
26813
26936
  }, {
26814
- children: jsxs("div", {
26815
- children: [jsx("ul", {
26816
- children: formats.map(function (f) {
26817
- return jsxs("li", {
26818
- children: [jsx("div", __assign({
26819
- className: "filter-key"
26820
- }, {
26821
- children: jsx("span", {
26822
- children: f.columnName
26823
- })
26824
- })), jsx("div", __assign({
26825
- className: "filter-value"
26826
- }, {
26827
- children: f.filter
26828
- }))]
26829
- }, f.columnIdKey);
26830
- })
26831
- }), jsxs("div", {
26832
- children: [jsx(Button, __assign({
26833
- variant: "outline",
26834
- onClick: onReset
26835
- }, {
26836
- children: resetButtonContent
26837
- })), jsx(Button, __assign({
26838
- onClick: handleSearch
26839
- }, {
26840
- children: searchButtonContent
26841
- }))]
26842
- })]
26937
+ children: jsx(FilterPopover, {
26938
+ parent: inputWrapperRef.current,
26939
+ onClose: function onClose() {
26940
+ return setOpen(false);
26941
+ },
26942
+ formats: formats,
26943
+ resetButtonContent: resetButtonContent,
26944
+ onReset: onReset,
26945
+ searchButtonContent: searchButtonContent,
26946
+ onSearch: handleSearch
26843
26947
  })
26844
26948
  }))]
26845
- });
26949
+ }));
26846
26950
  }
26847
26951
 
26848
- var css_248z$2 = ".maru-search-input .maru-input {\n border: 1px solid #e4e4e4;\n background-color: white;\n}\n.maru-search-input .maru-input:focus-visible, .maru-search-input .maru-input:focus-within {\n background-color: white;\n}\n.maru-search-input .maru-input:hover {\n background-color: white;\n}\n.maru-search-input .maru-input .maru-input-start-node {\n margin-right: 8px;\n}\n.maru-search-input .maru-search-input-filter-button {\n border: unset;\n background-color: unset;\n padding: unset;\n cursor: pointer;\n display: flex;\n flex-direction: column;\n}\n.maru-search-input .maru-search-input-filter-button .maru-tooltip-wrapper {\n padding: 6px 0;\n}\n.maru-search-input .maru-search-input-filter-button svg > path {\n stroke: #bdbdbd;\n fill: white;\n}\n.maru-search-input .maru-search-input-filter-button:hover svg > path {\n stroke: #8c8c8c;\n fill: #e4e4e4;\n}\n.maru-search-input .maru-search-input-filter-button.active {\n visibility: hidden;\n}\n.maru-search-input .maru-search-input-filter-button.selected svg > path {\n stroke: var(--p);\n fill: var(--p-50);\n}\n.maru-search-input .maru-search-input-filter-popover {\n padding: 32px;\n border: 1px solid #e4e4e4;\n border-radius: 6px;\n}\n.maru-search-input .maru-search-input-filter-popover > div > ul {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n.maru-search-input .maru-search-input-filter-popover > div > ul > li {\n display: flex;\n gap: 16px;\n}\n.maru-search-input .maru-search-input-filter-popover > div > ul > li .filter-key {\n width: 88px;\n display: flex;\n align-items: center;\n font-family: Pretendard;\n font-style: normal;\n line-height: 150%;\n font-size: 14px;\n letter-spacing: -0.56px;\n font-weight: 500;\n color: #5c5c5c;\n}\n.maru-search-input .maru-search-input-filter-popover > div > ul > li .filter-value {\n width: 232px;\n}\n.maru-search-input .maru-search-input-filter-popover > div > div {\n margin-top: 24px;\n display: flex;\n justify-content: flex-end;\n gap: 6px;\n}";
26952
+ var css_248z$2 = ".maru-search-input .maru-input {\n border: 1px solid #e4e4e4;\n background-color: white;\n}\n.maru-search-input .maru-input:focus-visible, .maru-search-input .maru-input:focus-within {\n background-color: white;\n}\n.maru-search-input .maru-input:hover {\n background-color: white;\n}\n.maru-search-input .maru-input .maru-input-start-node {\n margin-right: 8px;\n}\n.maru-search-input .maru-search-input-filter .maru-search-input-filter-button {\n border: unset;\n background-color: unset;\n padding: unset;\n cursor: pointer;\n display: flex;\n flex-direction: column;\n}\n.maru-search-input .maru-search-input-filter .maru-search-input-filter-button .maru-tooltip-wrapper {\n padding: 6px 0;\n}\n.maru-search-input .maru-search-input-filter .maru-search-input-filter-button svg > path {\n stroke: #bdbdbd;\n fill: white;\n}\n.maru-search-input .maru-search-input-filter .maru-search-input-filter-button:hover svg > path {\n stroke: #8c8c8c;\n fill: #e4e4e4;\n}\n.maru-search-input .maru-search-input-filter .maru-search-input-filter-button.active {\n visibility: hidden;\n}\n.maru-search-input .maru-search-input-filter .maru-search-input-filter-button.selected svg > path {\n stroke: var(--p);\n fill: var(--p-50);\n}\n.maru-search-input .maru-search-input-filter-popover-wrapper {\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n position: fixed;\n z-index: 1600;\n display: none;\n}\n.maru-search-input .maru-search-input-filter-popover-wrapper .maru-search-input-filter-popover {\n margin-top: 4px;\n position: absolute;\n z-index: 1601;\n border-radius: 6px;\n box-shadow: 0px 0px 4px #e4e4e4;\n background-color: white;\n padding: 32px;\n border: 1px solid #e4e4e4;\n border-radius: 6px;\n}\n.maru-search-input .maru-search-input-filter-popover-wrapper .maru-search-input-filter-popover > div > ul {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n.maru-search-input .maru-search-input-filter-popover-wrapper .maru-search-input-filter-popover > div > ul > li {\n display: flex;\n gap: 16px;\n}\n.maru-search-input .maru-search-input-filter-popover-wrapper .maru-search-input-filter-popover > div > ul > li .filter-key {\n width: 88px;\n display: flex;\n align-items: center;\n font-family: Pretendard;\n font-style: normal;\n line-height: 150%;\n font-size: 14px;\n letter-spacing: -0.56px;\n font-weight: 500;\n color: #5c5c5c;\n}\n.maru-search-input .maru-search-input-filter-popover-wrapper .maru-search-input-filter-popover > div > ul > li .filter-value {\n width: 232px;\n}\n.maru-search-input .maru-search-input-filter-popover-wrapper .maru-search-input-filter-popover > div > div {\n margin-top: 24px;\n display: flex;\n justify-content: flex-end;\n gap: 6px;\n}";
26849
26953
  styleInject(css_248z$2);
26850
26954
 
26851
26955
  function SearchInput(_a) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maru_design2",
3
- "version": "2.22.4",
3
+ "version": "2.23.0",
4
4
  "main": "./dist/index.js",
5
5
  "author": "zena-42maru",
6
6
  "license": "MIT",