@team-monolith/cds 0.25.0 → 0.26.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,8 +1,8 @@
1
1
  import "@emotion/react";
2
2
 
3
3
  interface CodleFontFamilies {
4
- uiFont: string;
5
- titleFont: string;
4
+ ui: string;
5
+ title: string;
6
6
  }
7
7
 
8
8
  interface CodleColors {
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  export declare const light: {
3
3
  fontFamily: {
4
- uiFont: string;
5
- titleFont: string;
4
+ ui: string;
5
+ title: string;
6
6
  };
7
7
  color: {
8
8
  background: {
@@ -21,8 +21,8 @@ import FONT from "./foundation/font";
21
21
  import { createTheme } from "@mui/material";
22
22
  export var light = {
23
23
  fontFamily: {
24
- uiFont: FONT.pretendard,
25
- titleFont: FONT.naumSquareNeo,
24
+ ui: FONT.pretendard,
25
+ title: FONT.naumSquareNeo,
26
26
  },
27
27
  color: {
28
28
  background: {
@@ -36,6 +36,6 @@ export var AlertDialogTitle = React.forwardRef(function (props, ref) {
36
36
  var className = props.className, _a = props.component, Component = _a === void 0 ? "div" : _a, onClose = props.onClose, children = props.children, other = __rest(props, ["className", "component", "onClose", "children"]);
37
37
  var icon = React.useContext(AlertDialogContext).icon;
38
38
  var theme = useTheme();
39
- return (_jsx(_Fragment, { children: _jsxs(Component, __assign({}, other, { ref: ref, className: className, css: css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n grid-area: title;\n font-family: ", ";\n font-style: normal;\n font-weight: 500;\n font-size: 20px;\n line-height: 36px;\n color: ", ";\n\n display: flex;\n justify-content: space-between;\n "], ["\n grid-area: title;\n font-family: ", ";\n font-style: normal;\n font-weight: 500;\n font-size: 20px;\n line-height: 36px;\n color: ", ";\n\n display: flex;\n justify-content: space-between;\n "])), theme.fontFamily.uiFont, theme.color.foreground.neutralBase) }, { children: [_jsxs("div", __assign({ css: css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: flex-start;\n gap: 16px;\n "], ["\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: flex-start;\n gap: 16px;\n "]))) }, { children: [icon && (_jsx("div", __assign({ css: css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: none;\n ", "\n "], ["\n display: none;\n ", "\n "])), MOBILE(css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n color: ", ";\n\n svg {\n width: 32px;\n height: 32px;\n }\n "], ["\n display: flex;\n justify-content: center;\n align-items: center;\n color: ", ";\n\n svg {\n width: 32px;\n height: 32px;\n }\n "])), theme.color.background.infoActive))) }, { children: icon }))), children] })), onClose && (_jsx(SquareButton, { color: "icon", size: "small", icon: _jsx(CloseFillIcon, {}), onClick: onClose }))] })) }));
39
+ return (_jsx(_Fragment, { children: _jsxs(Component, __assign({}, other, { ref: ref, className: className, css: css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n grid-area: title;\n font-family: ", ";\n font-style: normal;\n font-weight: 500;\n font-size: 20px;\n line-height: 36px;\n color: ", ";\n\n display: flex;\n justify-content: space-between;\n "], ["\n grid-area: title;\n font-family: ", ";\n font-style: normal;\n font-weight: 500;\n font-size: 20px;\n line-height: 36px;\n color: ", ";\n\n display: flex;\n justify-content: space-between;\n "])), theme.fontFamily.ui, theme.color.foreground.neutralBase) }, { children: [_jsxs("div", __assign({ css: css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: flex-start;\n gap: 16px;\n "], ["\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: flex-start;\n gap: 16px;\n "]))) }, { children: [icon && (_jsx("div", __assign({ css: css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: none;\n ", "\n "], ["\n display: none;\n ", "\n "])), MOBILE(css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n color: ", ";\n\n svg {\n width: 32px;\n height: 32px;\n }\n "], ["\n display: flex;\n justify-content: center;\n align-items: center;\n color: ", ";\n\n svg {\n width: 32px;\n height: 32px;\n }\n "])), theme.color.background.infoActive))) }, { children: icon }))), children] })), onClose && (_jsx(SquareButton, { color: "icon", size: "small", icon: _jsx(CloseFillIcon, {}), onClick: onClose }))] })) }));
40
40
  });
41
41
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
@@ -57,11 +57,11 @@ var Banner = React.forwardRef(function (props, ref) {
57
57
  var IconDiv = styled.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n padding: 16px 0px 16px 16px;\n"], ["\n display: flex;\n align-items: center;\n padding: 16px 0px 16px 16px;\n"])));
58
58
  var HeadlineDiv = styled.div(function (_a) {
59
59
  var theme = _a.theme;
60
- return css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n font-family: ", ";\n font-size: 16px;\n font-style: normal;\n font-weight: 700;\n line-height: 20px; /* 125% */\n "], ["\n font-family: ", ";\n font-size: 16px;\n font-style: normal;\n font-weight: 700;\n line-height: 20px; /* 125% */\n "])), theme.fontFamily.uiFont);
60
+ return css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n font-family: ", ";\n font-size: 16px;\n font-style: normal;\n font-weight: 700;\n line-height: 20px; /* 125% */\n "], ["\n font-family: ", ";\n font-size: 16px;\n font-style: normal;\n font-weight: 700;\n line-height: 20px; /* 125% */\n "])), theme.fontFamily.ui);
61
61
  });
62
62
  var ContentDiv = styled.div(function (_a) {
63
63
  var theme = _a.theme;
64
- return css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n font-family: ", ";\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n line-height: 24px; /* 150% */\n "], ["\n font-family: ", ";\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n line-height: 24px; /* 150% */\n "])), theme.fontFamily.uiFont);
64
+ return css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n font-family: ", ";\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n line-height: 24px; /* 150% */\n "], ["\n font-family: ", ";\n font-size: 16px;\n font-style: normal;\n font-weight: 400;\n line-height: 24px; /* 150% */\n "])), theme.fontFamily.ui);
65
65
  });
66
66
  var TextContainer = styled.div(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n flex: 1;\n\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n padding: 16px;\n gap: 4px;\n"], ["\n flex: 1;\n\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n padding: 16px;\n gap: 4px;\n"])));
67
67
  var BannerButton = styled.button(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n ", "\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 10px 12px;\n cursor: pointer;\n color: currentColor;\n"], ["\n ", "\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 10px 12px;\n cursor: pointer;\n color: currentColor;\n"])), RESET_BUTTON);
@@ -68,7 +68,7 @@ var Button = React.forwardRef(function Button(props, ref) {
68
68
  var theme = useTheme();
69
69
  return (_jsxs(Component, __assign({ type: "button" }, other, { className: className, ref: ref, css: [
70
70
  css(templateObject_39 || (templateObject_39 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n\n border: none;\n border-radius: 8px;\n\n ", "\n\n font-family: ", ";\n text-decoration: none;\n\n width: ", ";\n "], ["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n\n border: none;\n border-radius: 8px;\n\n ", "\n\n font-family: ", ";\n text-decoration: none;\n\n width: ", ";\n "])), disabled
71
- ? css(templateObject_37 || (templateObject_37 = __makeTemplateObject(["\n cursor: default;\n pointer-events: none;\n "], ["\n cursor: default;\n pointer-events: none;\n "]))) : css(templateObject_38 || (templateObject_38 = __makeTemplateObject(["\n cursor: pointer;\n "], ["\n cursor: pointer;\n "]))), theme.fontFamily.uiFont, fullWidth ? "100%" : "auto"),
71
+ ? css(templateObject_37 || (templateObject_37 = __makeTemplateObject(["\n cursor: default;\n pointer-events: none;\n "], ["\n cursor: default;\n pointer-events: none;\n "]))) : css(templateObject_38 || (templateObject_38 = __makeTemplateObject(["\n cursor: pointer;\n "], ["\n cursor: pointer;\n "]))), theme.fontFamily.ui, fullWidth ? "100%" : "auto"),
72
72
  COLOR_TO_BUTTON_STYLE(theme, color, Boolean(disabled)),
73
73
  SIZE_TO_BUTTON_STYLE[size],
74
74
  ], disabled: disabled }, { children: [startIcon, _jsx(Label, __assign({ size: size }, { children: label })), endIcon] })));
@@ -43,7 +43,7 @@ var StyledTooltip = styled(function (_a) {
43
43
  return (_jsx(MuiTooltip, __assign({}, props, { classes: { popper: className } })));
44
44
  })(function (_a) {
45
45
  var theme = _a.theme;
46
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .MuiTooltip-tooltip {\n background: ", ";\n border-radius: 8px;\n padding: 6px 10px;\n\n display: flex;\n flex-direction: column;\n gap: 2px;\n\n color: ", ";\n font-family: ", ";\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 22px;\n }\n "], ["\n .MuiTooltip-tooltip {\n background: ", ";\n border-radius: 8px;\n padding: 6px 10px;\n\n display: flex;\n flex-direction: column;\n gap: 2px;\n\n color: ", ";\n font-family: ", ";\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 22px;\n }\n "])), theme.color.foreground.neutralBase, theme.color.background.neutralBase, theme.fontFamily.uiFont);
46
+ return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .MuiTooltip-tooltip {\n background: ", ";\n border-radius: 8px;\n padding: 6px 10px;\n\n display: flex;\n flex-direction: column;\n gap: 2px;\n\n color: ", ";\n font-family: ", ";\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 22px;\n }\n "], ["\n .MuiTooltip-tooltip {\n background: ", ";\n border-radius: 8px;\n padding: 6px 10px;\n\n display: flex;\n flex-direction: column;\n gap: 2px;\n\n color: ", ";\n font-family: ", ";\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 22px;\n }\n "])), theme.color.foreground.neutralBase, theme.color.background.neutralBase, theme.fontFamily.ui);
47
47
  });
48
48
  var TitleDiv = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-weight: 700;\n"], ["\n font-weight: 700;\n"])));
49
49
  export default Tooltip;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { ButtonProps } from "../..";
2
3
  export interface SegmentedControlButtonProps extends Omit<ButtonProps, "color" | "size"> {
3
4
  value: string;
@@ -5,4 +6,4 @@ export interface SegmentedControlButtonProps extends Omit<ButtonProps, "color" |
5
6
  /**
6
7
  * [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?node-id=181%3A89883)
7
8
  */
8
- export declare function SegmentedControlButton(props: SegmentedControlButtonProps): import("@emotion/react/jsx-runtime").JSX.Element;
9
+ export declare const SegmentedControlButton: React.ForwardRefExoticComponent<Omit<SegmentedControlButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
@@ -27,13 +27,13 @@ var __rest = (this && this.__rest) || function (s, e) {
27
27
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
28
28
  /** @jsxImportSource @emotion/react */
29
29
  import { css } from "@emotion/react";
30
- import { useContext } from "react";
30
+ import React, { useContext } from "react";
31
31
  import { SegmentedControlGroupPropsContext } from "./SegmentedControlGroupPropsContext";
32
32
  import { Button, shadows } from "../..";
33
33
  /**
34
34
  * [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?node-id=181%3A89883)
35
35
  */
36
- export function SegmentedControlButton(props) {
36
+ export var SegmentedControlButton = React.forwardRef(function SegmentedControlButton(props, ref) {
37
37
  var onClick = props.onClick, other = __rest(props, ["onClick"]);
38
38
  var context = useContext(SegmentedControlGroupPropsContext);
39
39
  var handleClick = function (e) {
@@ -44,6 +44,6 @@ export function SegmentedControlButton(props) {
44
44
  var isActive = context.multiSelect
45
45
  ? context.value.includes(props.value)
46
46
  : context.value === props.value;
47
- return (_jsx(Button, __assign({ css: css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n flex-grow: 1;\n ", "\n "], ["\n display: flex;\n justify-content: center;\n flex-grow: 1;\n ", "\n "])), isActive && "box-shadow: ".concat(shadows.shadow04, ";")) }, other, { color: isActive ? "primary" : "textNeutral", size: context.size, onClick: handleClick })));
48
- }
47
+ return (_jsx(Button, __assign({ css: css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n flex-grow: 1;\n ", "\n "], ["\n display: flex;\n justify-content: center;\n flex-grow: 1;\n ", "\n "])), isActive && "box-shadow: ".concat(shadows.shadow04, ";")) }, other, { ref: ref, color: isActive ? "primary" : "textNeutral", size: context.size, onClick: handleClick })));
48
+ });
49
49
  var templateObject_1;
@@ -1,5 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { ButtonSize, SquareButtonSize } from "../..";
2
+ import React from "react";
3
3
  export type SegmentedControlGroupProps = {
4
4
  className?: string;
5
5
  component?: React.ElementType;
@@ -22,4 +22,4 @@ export type SegmentedControlGroupProps = {
22
22
  /**
23
23
  * [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?node-id=181%3A89883)
24
24
  */
25
- export declare function SegmentedControlGroup(props: SegmentedControlGroupProps): import("@emotion/react/jsx-runtime").JSX.Element;
25
+ export declare const SegmentedControlGroup: React.ForwardRefExoticComponent<SegmentedControlGroupProps & React.RefAttributes<HTMLDivElement>>;
@@ -26,13 +26,14 @@ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
26
26
  /** @jsxImportSource @emotion/react */
27
27
  import { css, useTheme } from "@emotion/react";
28
28
  import { SegmentedControlGroupPropsContext } from "./SegmentedControlGroupPropsContext";
29
+ import React from "react";
29
30
  /**
30
31
  * [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?node-id=181%3A89883)
31
32
  */
32
- export function SegmentedControlGroup(props) {
33
+ export var SegmentedControlGroup = React.forwardRef(function SegmentedControlGroup(props, ref) {
33
34
  var _a = props.component, Component = _a === void 0 ? "div" : _a, className = props.className, children = props.children, fullWidth = props.fullWidth, multiSelect = props.multiSelect;
34
35
  var theme = useTheme();
35
- return (_jsx(Component, __assign({ className: className, css: css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n gap: 4px;\n\n width: ", ";\n background-color: ", ";\n border-radius: 8px;\n border: 1px solid ", ";\n "], ["\n display: flex;\n gap: 4px;\n\n width: ", ";\n background-color: ", ";\n border-radius: 8px;\n border: 1px solid ", ";\n "])), fullWidth ? "100%" : "fit-content", theme.color.background.neutralAlt, theme.color.background.neutralAltActive) }, { children: _jsx(SegmentedControlGroupPropsContext.Provider, __assign({ value: __assign(__assign({}, props), { onClick: function (newValue) {
36
+ return (_jsx(Component, __assign({ ref: ref, className: className, css: css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n gap: 4px;\n\n width: ", ";\n background-color: ", ";\n border-radius: 8px;\n border: 1px solid ", ";\n "], ["\n display: flex;\n gap: 4px;\n\n width: ", ";\n background-color: ", ";\n border-radius: 8px;\n border: 1px solid ", ";\n "])), fullWidth ? "100%" : "fit-content", theme.color.background.neutralAlt, theme.color.background.neutralAltActive) }, { children: _jsx(SegmentedControlGroupPropsContext.Provider, __assign({ value: __assign(__assign({}, props), { onClick: function (newValue) {
36
37
  var _a, _b, _c;
37
38
  if (multiSelect) {
38
39
  if (props.value.includes(newValue)) {
@@ -46,5 +47,5 @@ export function SegmentedControlGroup(props) {
46
47
  (_c = props.onChange) === null || _c === void 0 ? void 0 : _c.call(props, newValue);
47
48
  }
48
49
  } }) }, { children: children })) })));
49
- }
50
+ });
50
51
  var templateObject_1;
@@ -1,8 +1,9 @@
1
1
  import { SquareButtonProps } from "../..";
2
+ import React from "react";
2
3
  export interface SegmentedControlSquareButtonProps extends Omit<SquareButtonProps, "color" | "size"> {
3
4
  value: string;
4
5
  }
5
6
  /**
6
7
  * [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?node-id=181%3A89883)
7
8
  */
8
- export declare function SegmentedControlSquareButton(props: SegmentedControlSquareButtonProps): import("@emotion/react/jsx-runtime").JSX.Element;
9
+ export declare const SegmentedControlSquareButton: React.ForwardRefExoticComponent<Omit<SegmentedControlSquareButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
@@ -19,22 +19,23 @@ import styled from "@emotion/styled";
19
19
  import { useContext } from "react";
20
20
  import { shadows, SquareButton } from "../..";
21
21
  import { SegmentedControlGroupPropsContext } from "./SegmentedControlGroupPropsContext";
22
+ import React from "react";
22
23
  /**
23
24
  * [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?node-id=181%3A89883)
24
25
  */
25
- export function SegmentedControlSquareButton(props) {
26
+ export var SegmentedControlSquareButton = React.forwardRef(function SegmentedControlSquareButton(props, ref) {
26
27
  var context = useContext(SegmentedControlGroupPropsContext);
27
28
  var isActive = context.multiSelect
28
29
  ? context.value.includes(props.value)
29
30
  : context.value === props.value;
30
- return (_jsx(StyledSquareButton, __assign({}, props, { isActive: isActive, color: isActive ? "primary" : "icon", size: context.size, fullWidth: context.fullWidth, onClick: function () {
31
+ return (_jsx(StyledSquareButton, __assign({}, props, { ref: ref, isActive: isActive, color: isActive ? "primary" : "icon", size: context.size, fullWidth: context.fullWidth, onClick: function () {
31
32
  var _a;
32
33
  if (context.onClick) {
33
34
  context.onClick(props.value);
34
35
  (_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props);
35
36
  }
36
37
  } })));
37
- }
38
+ });
38
39
  var StyledSquareButton = styled(SquareButton, {
39
40
  shouldForwardProp: function (prop) { return prop !== "isActive"; },
40
41
  })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n flex-grow: 1;\n button {\n ", "\n }\n"], ["\n display: flex;\n justify-content: center;\n flex-grow: 1;\n button {\n ", "\n }\n"])), function (_a) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-monolith/cds",
3
- "version": "0.25.0",
3
+ "version": "0.26.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": false,