@shoplflow/templates 0.2.12 → 0.2.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.
package/dist/index.cjs CHANGED
@@ -67,10 +67,7 @@ var StyledRequired = styled2__default.default.div`
67
67
  var TitleGroupContext = React6.createContext(null);
68
68
  var useTitleGroupContext = () => {
69
69
  const context = React6.useContext(TitleGroupContext);
70
- if (!context) {
71
- throw new Error("useTitleGroupContext must be used within a TitleGroup");
72
- }
73
- return context;
70
+ return context != null ? context : { depth: 1 };
74
71
  };
75
72
  var TitleGroupHelpIcon = ({
76
73
  tooltipPlacement,
@@ -94,8 +91,16 @@ var Actions = ({ children }) => {
94
91
  var HeaderBox = ({ children }) => {
95
92
  return /* @__PURE__ */ jsxRuntime.jsx(base.StackContainer.Horizontal, { align: "center", width: "100%", minHeight: "40px", height: "auto", justify: "space-between", children });
96
93
  };
97
- var Header = ({ title, isRequired, count, helpIconProps, rightIconButton }) => {
98
- const { depth } = useTitleGroupContext();
94
+ var Header = ({
95
+ title,
96
+ isRequired,
97
+ count,
98
+ helpIconProps,
99
+ rightIconButton,
100
+ depth: depthProp
101
+ }) => {
102
+ const { depth: contextDepth } = useTitleGroupContext();
103
+ const depth = depthProp != null ? depthProp : contextDepth;
99
104
  const { color, typography } = getTypographyAndColor(depth);
100
105
  return /* @__PURE__ */ jsxRuntime.jsxs(base.Stack.Horizontal, { align: "center", children: [
101
106
  /* @__PURE__ */ jsxRuntime.jsxs(base.Stack.Horizontal, { spacing: "spacing04", align: "center", justify: "center", children: [
package/dist/index.d.cts CHANGED
@@ -39,6 +39,11 @@ type TitleGroupHeaderProps = {
39
39
  * 제목
40
40
  */
41
41
  title: string;
42
+ /**
43
+ * 제목의 타이포그래피 스타일.
44
+ * @deprecated TitleGroup의 depth prop을 사용하세요.
45
+ */
46
+ depth?: 1 | 2 | 3;
42
47
  /**
43
48
  * 아이템의 총 갯수
44
49
  */
@@ -61,7 +66,7 @@ interface TitleGroupProps extends ChildrenProps {
61
66
  declare const TitleGroup: {
62
67
  ({ children, depth }: TitleGroupProps): react_jsx_runtime.JSX.Element;
63
68
  HeaderBox: ({ children }: ChildrenProps) => react_jsx_runtime.JSX.Element;
64
- Header: ({ title, isRequired, count, helpIconProps, rightIconButton }: TitleGroupHeaderProps) => react_jsx_runtime.JSX.Element;
69
+ Header: ({ title, isRequired, count, helpIconProps, rightIconButton, depth: depthProp, }: TitleGroupHeaderProps) => react_jsx_runtime.JSX.Element;
65
70
  Actions: ({ children }: ActionsProps) => react_jsx_runtime.JSX.Element;
66
71
  Description: ({ description, ...rest }: DescriptionProps) => react_jsx_runtime.JSX.Element;
67
72
  };
package/dist/index.d.ts CHANGED
@@ -39,6 +39,11 @@ type TitleGroupHeaderProps = {
39
39
  * 제목
40
40
  */
41
41
  title: string;
42
+ /**
43
+ * 제목의 타이포그래피 스타일.
44
+ * @deprecated TitleGroup의 depth prop을 사용하세요.
45
+ */
46
+ depth?: 1 | 2 | 3;
42
47
  /**
43
48
  * 아이템의 총 갯수
44
49
  */
@@ -61,7 +66,7 @@ interface TitleGroupProps extends ChildrenProps {
61
66
  declare const TitleGroup: {
62
67
  ({ children, depth }: TitleGroupProps): react_jsx_runtime.JSX.Element;
63
68
  HeaderBox: ({ children }: ChildrenProps) => react_jsx_runtime.JSX.Element;
64
- Header: ({ title, isRequired, count, helpIconProps, rightIconButton }: TitleGroupHeaderProps) => react_jsx_runtime.JSX.Element;
69
+ Header: ({ title, isRequired, count, helpIconProps, rightIconButton, depth: depthProp, }: TitleGroupHeaderProps) => react_jsx_runtime.JSX.Element;
65
70
  Actions: ({ children }: ActionsProps) => react_jsx_runtime.JSX.Element;
66
71
  Description: ({ description, ...rest }: DescriptionProps) => react_jsx_runtime.JSX.Element;
67
72
  };
package/dist/index.js CHANGED
@@ -61,10 +61,7 @@ var StyledRequired = styled2.div`
61
61
  var TitleGroupContext = createContext(null);
62
62
  var useTitleGroupContext = () => {
63
63
  const context = useContext(TitleGroupContext);
64
- if (!context) {
65
- throw new Error("useTitleGroupContext must be used within a TitleGroup");
66
- }
67
- return context;
64
+ return context != null ? context : { depth: 1 };
68
65
  };
69
66
  var TitleGroupHelpIcon = ({
70
67
  tooltipPlacement,
@@ -88,8 +85,16 @@ var Actions = ({ children }) => {
88
85
  var HeaderBox = ({ children }) => {
89
86
  return /* @__PURE__ */ jsx(StackContainer.Horizontal, { align: "center", width: "100%", minHeight: "40px", height: "auto", justify: "space-between", children });
90
87
  };
91
- var Header = ({ title, isRequired, count, helpIconProps, rightIconButton }) => {
92
- const { depth } = useTitleGroupContext();
88
+ var Header = ({
89
+ title,
90
+ isRequired,
91
+ count,
92
+ helpIconProps,
93
+ rightIconButton,
94
+ depth: depthProp
95
+ }) => {
96
+ const { depth: contextDepth } = useTitleGroupContext();
97
+ const depth = depthProp != null ? depthProp : contextDepth;
93
98
  const { color, typography } = getTypographyAndColor(depth);
94
99
  return /* @__PURE__ */ jsxs(Stack.Horizontal, { align: "center", children: [
95
100
  /* @__PURE__ */ jsxs(Stack.Horizontal, { spacing: "spacing04", align: "center", justify: "center", children: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shoplflow/templates",
3
- "version": "0.2.12",
3
+ "version": "0.2.14",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",
@@ -77,10 +77,10 @@
77
77
  "react-datepicker": "^7.3.0",
78
78
  "react-dom": "^18.2.0",
79
79
  "simplebar-react": "^3.2.6",
80
- "@shoplflow/base": "^0.46.11",
81
- "@shoplflow/shopl-assets": "^0.12.37",
82
- "@shoplflow/utils": "^0.8.0",
83
- "@shoplflow/hada-assets": "^0.1.10"
80
+ "@shoplflow/hada-assets": "^0.1.10",
81
+ "@shoplflow/shopl-assets": "^0.12.38",
82
+ "@shoplflow/base": "^0.46.12",
83
+ "@shoplflow/utils": "^0.8.0"
84
84
  },
85
85
  "repository": {
86
86
  "type": "git",