@team-monolith/cds 1.99.11 → 1.99.12

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.
@@ -5,6 +5,8 @@ import { TooltipProps } from "./Tooltip";
5
5
  interface OverflowTooltipProps extends Omit<TooltipProps, "open" | "onOpen" | "onClose" | "children"> {
6
6
  className?: string;
7
7
  childrenCss?: SerializedStyles;
8
+ /** 접근성을 위한 aria 속성을 전달하기 위한 prop */
9
+ divProps?: React.HTMLAttributes<HTMLDivElement>;
8
10
  }
9
11
  /**
10
12
  * 인자로 주어진 텍스트를 그립니다.
@@ -23,7 +23,7 @@ export function OverflowTooltip(props) {
23
23
  const handleClose = () => {
24
24
  setIsTooltipOpen(false);
25
25
  };
26
- return (_jsx(Tooltip, Object.assign({ open: isTooltipOpen, onOpen: handleOpen, onClose: handleClose }, props, { children: _jsx(OverflowDiv, Object.assign({ css: props.childrenCss, ref: tooltipRef, onMouseOver: handleOpen }, { children: props.text })) })));
26
+ return (_jsx(Tooltip, Object.assign({ open: isTooltipOpen, onOpen: handleOpen, onClose: handleClose }, props, { children: _jsx(OverflowDiv, Object.assign({ css: props.childrenCss, ref: tooltipRef, onMouseOver: handleOpen }, props.divProps, { children: props.text })) })));
27
27
  }
28
28
  const OverflowDiv = styled.div `
29
29
  overflow: hidden;
@@ -11,10 +11,9 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
13
13
  /** @jsxImportSource @emotion/react */
14
- import { forwardRef, useMemo, useRef, useState } from "react";
14
+ import { forwardRef, useId, useRef, useState } from "react";
15
15
  import { Button, ArrowDownSFillIcon, } from "../..";
16
16
  import { DropdownMenu } from "./DropdownMenu";
17
- import { uid } from "uid";
18
17
  /**
19
18
  * [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?type=design&node-id=203-95329&t=FwczLZ1IVvskUVbT-0)
20
19
  */
@@ -32,7 +31,7 @@ const Dropdown = forwardRef(function Dropdown(props, ref) {
32
31
  const isControlled = menuProps.open !== undefined;
33
32
  const [open, setOpen] = useState(false);
34
33
  const [itemState, setItemState] = useState(new Map());
35
- const dropdownMenuId = useMemo(() => `dropdown-menu-${uid()}`, []);
34
+ const dropdownMenuId = `dropdown-menu-${useId()}`;
36
35
  const handleClick = (e) => {
37
36
  onClick === null || onClick === void 0 ? void 0 : onClick(e);
38
37
  if (!isControlled)
@@ -15,11 +15,10 @@ import { css } from "@emotion/react";
15
15
  import * as React from "react";
16
16
  import styled from "@emotion/styled";
17
17
  import { CheckboxInput, ArrowRightSLineIcon, HOVER, } from "../../..";
18
- import { useContext, useMemo, useRef } from "react";
18
+ import { useContext, useId, useRef } from "react";
19
19
  import { DropdownMenu } from "../DropdownMenu";
20
20
  import { DropdownContext } from "../DropdownContext";
21
21
  import { getSelected, setSelected } from "./selected";
22
- import { uid } from "uid";
23
22
  const TYPE_TO_COLOR = (theme, type) => ({
24
23
  default: theme.color.foreground.neutralBase,
25
24
  danger: theme.color.foreground.danger,
@@ -31,7 +30,7 @@ const DropdownItem = React.forwardRef(function DropdownItem(props, ref) {
31
30
  const { className, index, labelCss, component: Component = "div", type = "default", checkbox, checkboxProps = { checked: false }, startIcon, label, endIcon, preserveIconColor = false, disabled, active, onMouseEnter, onMouseLeave, onClick, subMenuProps, children } = props, other = __rest(props, ["className", "index", "labelCss", "component", "type", "checkbox", "checkboxProps", "startIcon", "label", "endIcon", "preserveIconColor", "disabled", "active", "onMouseEnter", "onMouseLeave", "onClick", "subMenuProps", "children"]);
32
31
  const itemRef = useRef(null);
33
32
  const { open, onCloseOnItemClick, nestedIndex, itemState, setItemState } = useContext(DropdownContext);
34
- const dropdownMenuId = useMemo(() => `dropdown-menu-${uid()}`, []);
33
+ const dropdownMenuId = `dropdown-menu-${useId()}`;
35
34
  const absItemIndex = nestedIndex ? `${nestedIndex}-${index}` : `${index}`;
36
35
  // 서브메뉴가 존재하는지 여부
37
36
  const isSubMenuExist = Boolean(children);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-monolith/cds",
3
- "version": "1.99.11",
3
+ "version": "1.99.12",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": false,