@team-monolith/cds 1.37.0 → 1.37.2

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.
@@ -82,6 +82,8 @@ interface CodleColors {
82
82
  boardAlt: string;
83
83
  scratch: string;
84
84
  scratchAlt: string;
85
+ entry: string;
86
+ entryAlt: string;
85
87
  };
86
88
  }
87
89
 
@@ -252,5 +252,4 @@ export declare const CustomEntryIcon: React.ForwardRefExoticComponent<{
252
252
  export declare const customEntryColorSvg: string;
253
253
  export declare const CustomEntryColorIcon: React.ForwardRefExoticComponent<{
254
254
  className?: string | undefined;
255
- color?: string | undefined;
256
255
  } & React.RefAttributes<any>>;
@@ -274,10 +274,10 @@ export const CustomPythonColorIcon = forwardRef((props, ref) => {
274
274
  import customEntrySvgImport from "./custom/entry.svg";
275
275
  export const customEntrySvg = customEntrySvgImport;
276
276
  export const CustomEntryIcon = forwardRef((props, ref) => {
277
- return (_jsxs("svg", Object.assign({}, props, { ref: ref, width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsx("path", { d: "M10.2223 10.3262C9.97191 10.603 9.79843 10.9558 9.70189 11.3789H13.0149C12.9491 10.9487 12.7868 10.5944 12.5336 10.3219C12.2398 10.005 11.8677 9.85152 11.378 9.85152C10.8883 9.85152 10.5106 10.0064 10.2223 10.3262Z", fill: "currentColor" }), _jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M20.5334 5.50174V8.99826C20.5334 9.20048 20.6118 9.3941 20.7517 9.53608L22.8909 11.7289C23.0364 11.8795 23.0364 12.1219 22.8909 12.2711L20.7517 14.4639C20.6118 14.6073 20.5334 14.7995 20.5334 15.0017V18.4983C20.5334 18.7005 20.4551 18.8927 20.3166 19.0361L18.1298 21.2777C17.9913 21.4197 17.8025 21.5 17.6066 21.5H4.92965C4.73238 21.5 4.5449 21.4197 4.405 21.2777L2.21825 19.0361C2.07835 18.8927 2 18.699 2 18.4983V5.50317C2 5.30095 2.07835 5.10734 2.21825 4.96535L4.4036 2.7223C4.5435 2.58031 4.73098 2.5 4.92825 2.5H17.6066C17.8025 2.5 17.9913 2.58031 18.1298 2.7223L20.3166 4.96392C20.4551 5.10734 20.5334 5.30095 20.5334 5.50174ZM11.3472 8.51487C12.0509 8.51487 12.6539 8.70705 13.1422 9.08567V9.0871C13.6235 9.45999 13.9649 9.91176 14.1593 10.4295C14.3482 10.9343 14.4433 11.4793 14.4433 12.053L14.4251 12.7184H9.63614C9.70329 13.2577 9.89497 13.6894 10.2028 14.0035C10.5539 14.3606 11.0072 14.5341 11.5864 14.5341C12.2482 14.5341 12.8008 14.2387 13.2737 13.6335L13.4122 13.457L14.393 14.385L14.2671 14.5384C13.5437 15.4233 12.6078 15.8708 11.5864 15.8708C10.5651 15.8708 9.73687 15.528 9.12408 14.8511C8.51688 14.1813 8.20769 13.2706 8.20769 12.228C8.20769 11.1853 8.4903 10.3004 9.05133 9.59624C9.62075 8.87915 10.3944 8.51487 11.3472 8.51487Z", fill: "currentColor" })] })));
277
+ return (_jsxs("svg", Object.assign({}, props, { ref: ref, width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsx("path", { d: "M10.2223 10.3262C9.97191 10.603 9.79843 10.9558 9.70189 11.3789H13.0149C12.9491 10.9487 12.7868 10.5944 12.5336 10.3219C12.2398 10.005 11.8677 9.85152 11.378 9.85152C10.8883 9.85152 10.5106 10.0064 10.2223 10.3262Z", fill: "currentColor" }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M20.5334 5.50174V8.99826C20.5334 9.20048 20.6118 9.3941 20.7517 9.53608L22.8909 11.7289C23.0364 11.8795 23.0364 12.1219 22.8909 12.2711L20.7517 14.4639C20.6118 14.6073 20.5334 14.7995 20.5334 15.0017V18.4983C20.5334 18.7005 20.4551 18.8927 20.3166 19.0361L18.1298 21.2777C17.9913 21.4197 17.8025 21.5 17.6066 21.5H4.92965C4.73238 21.5 4.5449 21.4197 4.405 21.2777L2.21825 19.0361C2.07835 18.8927 2 18.699 2 18.4983V5.50317C2 5.30095 2.07835 5.10734 2.21825 4.96535L4.4036 2.7223C4.5435 2.58031 4.73098 2.5 4.92825 2.5H17.6066C17.8025 2.5 17.9913 2.58031 18.1298 2.7223L20.3166 4.96392C20.4551 5.10734 20.5334 5.30095 20.5334 5.50174ZM11.3472 8.51487C12.0509 8.51487 12.6539 8.70705 13.1422 9.08567V9.0871C13.6235 9.45999 13.9649 9.91176 14.1593 10.4295C14.3482 10.9343 14.4433 11.4793 14.4433 12.053L14.4251 12.7184H9.63614C9.70329 13.2577 9.89497 13.6894 10.2028 14.0035C10.5539 14.3606 11.0072 14.5341 11.5864 14.5341C12.2482 14.5341 12.8008 14.2387 13.2737 13.6335L13.4122 13.457L14.393 14.385L14.2671 14.5384C13.5437 15.4233 12.6078 15.8708 11.5864 15.8708C10.5651 15.8708 9.73687 15.528 9.12408 14.8511C8.51688 14.1813 8.20769 13.2706 8.20769 12.228C8.20769 11.1853 8.4903 10.3004 9.05133 9.59624C9.62075 8.87915 10.3944 8.51487 11.3472 8.51487Z", fill: "currentColor" })] })));
278
278
  });
279
279
  import customEntryColorSvgImport from "./custom/entry-color.svg";
280
280
  export const customEntryColorSvg = customEntryColorSvgImport;
281
281
  export const CustomEntryColorIcon = forwardRef((props, ref) => {
282
- return (_jsxs("svg", Object.assign({}, props, { ref: ref, width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsx("path", { d: "M20.5334 8.99826V5.50174C20.5334 5.30095 20.4551 5.10734 20.3166 4.96392L18.1298 2.7223C17.9913 2.58031 17.8025 2.5 17.6066 2.5H4.92825C4.73098 2.5 4.5435 2.58031 4.4036 2.7223L2.21825 4.96535C2.07835 5.10734 2 5.30095 2 5.50317V18.4983C2 18.6991 2.07835 18.8927 2.21825 19.0361L4.405 21.2777C4.5449 21.4197 4.73238 21.5 4.92965 21.5H17.6066C17.8025 21.5 17.9913 21.4197 18.1298 21.2777L20.3166 19.0361C20.4551 18.8927 20.5334 18.7005 20.5334 18.4983V15.0017C20.5334 14.7995 20.6118 14.6073 20.7517 14.4639L22.8909 12.2711C23.0364 12.1219 23.0364 11.8795 22.8909 11.7289L20.7517 9.53608C20.6118 9.3941 20.5334 9.20048 20.5334 8.99826Z", fill: "white" }), _jsx("path", { d: "M10.2223 10.3262C9.97191 10.603 9.79843 10.9558 9.70189 11.3789H13.0149C12.9491 10.9487 12.7868 10.5944 12.5336 10.3219C12.2398 10.005 11.8677 9.85152 11.378 9.85152C10.8883 9.85152 10.5106 10.0064 10.2223 10.3262Z", fill: "#32D27D" }), _jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M20.5334 5.50174V8.99826C20.5334 9.20048 20.6118 9.3941 20.7517 9.53608L22.8909 11.7289C23.0364 11.8795 23.0364 12.1219 22.8909 12.2711L20.7517 14.4639C20.6118 14.6073 20.5334 14.7995 20.5334 15.0017V18.4983C20.5334 18.7005 20.4551 18.8927 20.3166 19.0361L18.1298 21.2777C17.9913 21.4197 17.8025 21.5 17.6066 21.5H4.92965C4.73238 21.5 4.5449 21.4197 4.405 21.2777L2.21825 19.0361C2.07835 18.8927 2 18.699 2 18.4983V5.50317C2 5.30095 2.07835 5.10734 2.21825 4.96535L4.4036 2.7223C4.5435 2.58031 4.73098 2.5 4.92825 2.5H17.6066C17.8025 2.5 17.9913 2.58031 18.1298 2.7223L20.3166 4.96392C20.4551 5.10734 20.5334 5.30095 20.5334 5.50174ZM11.3472 8.51487C12.0509 8.51487 12.6539 8.70705 13.1422 9.08567V9.0871C13.6235 9.45999 13.9649 9.91176 14.1593 10.4295C14.3482 10.9343 14.4433 11.4793 14.4433 12.053L14.4251 12.7184H9.63614C9.70329 13.2577 9.89497 13.6894 10.2028 14.0035C10.5539 14.3606 11.0072 14.5341 11.5864 14.5341C12.2482 14.5341 12.8008 14.2387 13.2737 13.6335L13.4122 13.457L14.393 14.385L14.2671 14.5384C13.5437 15.4233 12.6078 15.8708 11.5864 15.8708C10.5651 15.8708 9.73687 15.528 9.12408 14.8511C8.51688 14.1813 8.20769 13.2706 8.20769 12.228C8.20769 11.1853 8.4903 10.3004 9.05133 9.59624C9.62075 8.87915 10.3944 8.51487 11.3472 8.51487Z", fill: "#32D27D" })] })));
282
+ return (_jsxs("svg", Object.assign({}, props, { ref: ref, width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [_jsx("path", { d: "M20.5334 8.99826V5.50174C20.5334 5.30095 20.4551 5.10734 20.3166 4.96392L18.1298 2.7223C17.9913 2.58031 17.8025 2.5 17.6066 2.5H4.92825C4.73098 2.5 4.5435 2.58031 4.4036 2.7223L2.21825 4.96535C2.07835 5.10734 2 5.30095 2 5.50317V18.4983C2 18.6991 2.07835 18.8927 2.21825 19.0361L4.405 21.2777C4.5449 21.4197 4.73238 21.5 4.92965 21.5H17.6066C17.8025 21.5 17.9913 21.4197 18.1298 21.2777L20.3166 19.0361C20.4551 18.8927 20.5334 18.7005 20.5334 18.4983V15.0017C20.5334 14.7995 20.6118 14.6073 20.7517 14.4639L22.8909 12.2711C23.0364 12.1219 23.0364 11.8795 22.8909 11.7289L20.7517 9.53608C20.6118 9.3941 20.5334 9.20048 20.5334 8.99826Z", fill: "white" }), _jsx("path", { d: "M10.2223 10.3262C9.97191 10.603 9.79843 10.9558 9.70189 11.3789H13.0149C12.9491 10.9487 12.7868 10.5944 12.5336 10.3219C12.2398 10.005 11.8677 9.85152 11.378 9.85152C10.8883 9.85152 10.5106 10.0064 10.2223 10.3262Z", fill: "#32D27D" }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M20.5334 5.50174V8.99826C20.5334 9.20048 20.6118 9.3941 20.7517 9.53608L22.8909 11.7289C23.0364 11.8795 23.0364 12.1219 22.8909 12.2711L20.7517 14.4639C20.6118 14.6073 20.5334 14.7995 20.5334 15.0017V18.4983C20.5334 18.7005 20.4551 18.8927 20.3166 19.0361L18.1298 21.2777C17.9913 21.4197 17.8025 21.5 17.6066 21.5H4.92965C4.73238 21.5 4.5449 21.4197 4.405 21.2777L2.21825 19.0361C2.07835 18.8927 2 18.699 2 18.4983V5.50317C2 5.30095 2.07835 5.10734 2.21825 4.96535L4.4036 2.7223C4.5435 2.58031 4.73098 2.5 4.92825 2.5H17.6066C17.8025 2.5 17.9913 2.58031 18.1298 2.7223L20.3166 4.96392C20.4551 5.10734 20.5334 5.30095 20.5334 5.50174ZM11.3472 8.51487C12.0509 8.51487 12.6539 8.70705 13.1422 9.08567V9.0871C13.6235 9.45999 13.9649 9.91176 14.1593 10.4295C14.3482 10.9343 14.4433 11.4793 14.4433 12.053L14.4251 12.7184H9.63614C9.70329 13.2577 9.89497 13.6894 10.2028 14.0035C10.5539 14.3606 11.0072 14.5341 11.5864 14.5341C12.2482 14.5341 12.8008 14.2387 13.2737 13.6335L13.4122 13.457L14.393 14.385L14.2671 14.5384C13.5437 15.4233 12.6078 15.8708 11.5864 15.8708C10.5651 15.8708 9.73687 15.528 9.12408 14.8511C8.51688 14.1813 8.20769 13.2706 8.20769 12.228C8.20769 11.1853 8.4903 10.3004 9.05133 9.59624C9.62075 8.87915 10.3944 8.51487 11.3472 8.51487Z", fill: "#32D27D" })] })));
283
283
  });
@@ -1,3 +1,14 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
13
  /** @jsxImportSource @emotion/react */
3
14
  import { forwardRef, useRef, useState } from "react";
@@ -7,7 +18,7 @@ import { DropdownMenu } from "./DropdownMenu";
7
18
  * [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?type=design&node-id=203-95329&t=FwczLZ1IVvskUVbT-0)
8
19
  */
9
20
  const Dropdown = forwardRef((props, ref) => {
10
- const { className, component: Component = "div", disabled, color = "primary", size = "medium", bold, startIcon, endIcon = _jsx(ArrowDropDownFillIcon, {}), buttonCss, label, onClick, menuProps = {}, children, closeOnItemClick, } = props;
21
+ const { className, component: Component = "div", disabled, color = "primary", size = "medium", bold, startIcon, endIcon = _jsx(ArrowDropDownFillIcon, {}), buttonCss, label, onClick, menuProps = {}, children, closeOnItemClick } = props, other = __rest(props, ["className", "component", "disabled", "color", "size", "bold", "startIcon", "endIcon", "buttonCss", "label", "onClick", "menuProps", "children", "closeOnItemClick"]);
11
22
  const buttonProps = {
12
23
  disabled,
13
24
  color,
@@ -16,16 +27,19 @@ const Dropdown = forwardRef((props, ref) => {
16
27
  endIcon,
17
28
  };
18
29
  const menuRef = useRef(null);
30
+ const isControlled = menuProps.open !== undefined;
19
31
  const [open, setOpen] = useState(false);
20
32
  const [itemState, setItemState] = useState(new Map());
21
33
  const handleClick = (e) => {
22
34
  onClick === null || onClick === void 0 ? void 0 : onClick(e);
23
- setOpen(true);
35
+ if (!isControlled)
36
+ setOpen(true);
24
37
  };
25
38
  const handleClose = (e) => {
26
39
  var _a;
27
40
  e.stopPropagation();
28
- setOpen(false);
41
+ if (!isControlled)
42
+ setOpen(false);
29
43
  setItemState((prevState) => {
30
44
  const newState = new Map(prevState);
31
45
  newState.forEach((value, key) => {
@@ -38,6 +52,6 @@ const Dropdown = forwardRef((props, ref) => {
38
52
  });
39
53
  (_a = menuProps === null || menuProps === void 0 ? void 0 : menuProps.onClose) === null || _a === void 0 ? void 0 : _a.call(menuProps, e);
40
54
  };
41
- return (_jsxs(Component, Object.assign({ className: className, ref: ref }, { children: [_jsx(Button, Object.assign({ css: buttonCss, ref: menuRef }, buttonProps, { label: label, bold: bold, onClick: handleClick, fullWidth: true })), _jsx(DropdownMenu, Object.assign({}, menuProps, { open: open, onClose: handleClose, anchorEl: menuRef.current, closeOnItemClick: closeOnItemClick, itemState: itemState, setItemState: setItemState }, { children: children }))] })));
55
+ return (_jsxs(Component, Object.assign({ className: className }, other, { ref: ref }, { children: [_jsx(Button, Object.assign({ css: buttonCss, ref: menuRef }, buttonProps, { label: label, bold: bold, onClick: handleClick, fullWidth: true })), _jsx(DropdownMenu, Object.assign({}, menuProps, { open: isControlled ? menuProps.open : open, onClose: handleClose, anchorEl: menuRef.current, closeOnItemClick: closeOnItemClick, itemState: itemState, setItemState: setItemState }, { children: children }))] })));
42
56
  });
43
57
  export { Dropdown };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-monolith/cds",
3
- "version": "1.37.0",
3
+ "version": "1.37.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": false,