@teamturing/react-kit 2.32.8 → 2.33.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,10 +1,12 @@
1
- /// <reference types="react" />
1
+ import { ReactNode } from 'react';
2
2
  import { TextareaAutosizeProps } from 'react-textarea-autosize';
3
3
  type Props = {
4
4
  validationStatus?: 'error' | 'success' | undefined;
5
+ renderCount?: (count: number, element: HTMLTextAreaElement | null) => ReactNode;
5
6
  } & TextareaAutosizeProps;
6
7
  declare const Textarea: import("react").ForwardRefExoticComponent<{
7
8
  validationStatus?: 'error' | 'success' | undefined;
9
+ renderCount?: ((count: number, element: HTMLTextAreaElement | null) => ReactNode) | undefined;
8
10
  } & TextareaAutosizeProps & import("react").RefAttributes<HTMLTextAreaElement>>;
9
11
  export default Textarea;
10
12
  export type { Props as TextareaProps };
package/dist/index.js CHANGED
@@ -18989,13 +18989,13 @@ const Dialog = ({
18989
18989
  tabIndex: -1,
18990
18990
  sx: {
18991
18991
  ...(size === 's' ? {
18992
- maxHeight: 'calc(100vh - 64px)',
18992
+ maxHeight: 'calc(100dvh - 64px)',
18993
18993
  width: ['calc(100% - 64px)', 400, 400],
18994
18994
  marginX: 'auto',
18995
18995
  marginY: 'auto',
18996
18996
  borderRadius: 'l'
18997
18997
  } : size === 'm' ? {
18998
- maxHeight: ['100%', '100%', 'calc(100vh - 64px)'],
18998
+ maxHeight: ['100%', '100%', 'calc(100dvh - 64px)'],
18999
18999
  height: ['100%', '100%', 'auto'],
19000
19000
  minHeight: ['-webkit-fill-available', '-webkit-fill-available', 'auto'],
19001
19001
  width: ['100%', '100%', 640],
@@ -19003,7 +19003,7 @@ const Dialog = ({
19003
19003
  marginY: 'auto',
19004
19004
  borderRadius: ['none', 'none', 'l']
19005
19005
  } : size === 'l' ? {
19006
- maxHeight: ['100%', '100%', 'calc(100vh - 64px)'],
19006
+ maxHeight: ['100%', '100%', 'calc(100dvh - 64px)'],
19007
19007
  height: ['100%', '100%', 'auto'],
19008
19008
  minHeight: ['-webkit-fill-available', '-webkit-fill-available', 'auto'],
19009
19009
  width: ['100%', '100%', 860],
@@ -19011,7 +19011,7 @@ const Dialog = ({
19011
19011
  marginY: 'auto',
19012
19012
  borderRadius: ['none', 'none', 'l']
19013
19013
  } : size === 'full' ? {
19014
- height: ['100%', '100%', 'calc(100vh - 40px)'],
19014
+ height: ['100%', '100%', 'calc(100dvh - 40px)'],
19015
19015
  width: ['100%', '100%', 'calc(100vw - 40px)'],
19016
19016
  marginX: [0, 0, 'auto'],
19017
19017
  marginY: 'auto',
@@ -36640,6 +36640,7 @@ var toArray$1 = /*@__PURE__*/getDefaultExportFromCjs(lodash_toarray);
36640
36640
  const Textarea = /*#__PURE__*/React.forwardRef(({
36641
36641
  validationStatus,
36642
36642
  disabled,
36643
+ renderCount = count => `${commaizeNumber(count)}자`,
36643
36644
  ...props
36644
36645
  }, ref) => {
36645
36646
  const inputRef = useProvidedOrCreatedRef(ref);
@@ -36672,8 +36673,8 @@ const Textarea = /*#__PURE__*/React.forwardRef(({
36672
36673
  },
36673
36674
  disabled: disabled,
36674
36675
  onChange: handleChange
36675
- }), /*#__PURE__*/jsxRuntimeExports.jsxs(TextareaCount, {
36676
- children: [commaizeNumber(count), "\uC790"]
36676
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(TextareaCount, {
36677
+ children: renderCount(count, inputRef.current)
36677
36678
  })]
36678
36679
  });
36679
36680
  });
@@ -74,13 +74,13 @@ const Dialog = ({
74
74
  tabIndex: -1,
75
75
  sx: {
76
76
  ...(size === 's' ? {
77
- maxHeight: 'calc(100vh - 64px)',
77
+ maxHeight: 'calc(100dvh - 64px)',
78
78
  width: ['calc(100% - 64px)', 400, 400],
79
79
  marginX: 'auto',
80
80
  marginY: 'auto',
81
81
  borderRadius: 'l'
82
82
  } : size === 'm' ? {
83
- maxHeight: ['100%', '100%', 'calc(100vh - 64px)'],
83
+ maxHeight: ['100%', '100%', 'calc(100dvh - 64px)'],
84
84
  height: ['100%', '100%', 'auto'],
85
85
  minHeight: ['-webkit-fill-available', '-webkit-fill-available', 'auto'],
86
86
  width: ['100%', '100%', 640],
@@ -88,7 +88,7 @@ const Dialog = ({
88
88
  marginY: 'auto',
89
89
  borderRadius: ['none', 'none', 'l']
90
90
  } : size === 'l' ? {
91
- maxHeight: ['100%', '100%', 'calc(100vh - 64px)'],
91
+ maxHeight: ['100%', '100%', 'calc(100dvh - 64px)'],
92
92
  height: ['100%', '100%', 'auto'],
93
93
  minHeight: ['-webkit-fill-available', '-webkit-fill-available', 'auto'],
94
94
  width: ['100%', '100%', 860],
@@ -96,7 +96,7 @@ const Dialog = ({
96
96
  marginY: 'auto',
97
97
  borderRadius: ['none', 'none', 'l']
98
98
  } : size === 'full' ? {
99
- height: ['100%', '100%', 'calc(100vh - 40px)'],
99
+ height: ['100%', '100%', 'calc(100dvh - 40px)'],
100
100
  width: ['100%', '100%', 'calc(100vw - 40px)'],
101
101
  marginX: [0, 0, 'auto'],
102
102
  marginY: 'auto',
@@ -11,6 +11,7 @@ import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js'
11
11
  const Textarea = /*#__PURE__*/forwardRef(({
12
12
  validationStatus,
13
13
  disabled,
14
+ renderCount = count => `${commaizeNumber(count)}자`,
14
15
  ...props
15
16
  }, ref) => {
16
17
  const inputRef = useProvidedOrCreatedRef(ref);
@@ -43,8 +44,8 @@ const Textarea = /*#__PURE__*/forwardRef(({
43
44
  },
44
45
  disabled: disabled,
45
46
  onChange: handleChange
46
- }), /*#__PURE__*/jsxRuntimeExports.jsxs(TextareaCount, {
47
- children: [commaizeNumber(count), "\uC790"]
47
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(TextareaCount, {
48
+ children: renderCount(count, inputRef.current)
48
49
  })]
49
50
  });
50
51
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamturing/react-kit",
3
- "version": "2.32.8",
3
+ "version": "2.33.0",
4
4
  "description": "React components, hooks for create teamturing web application",
5
5
  "author": "Sungchang Park <psch300@gmail.com> (https://github.com/psch300)",
6
6
  "homepage": "https://github.com/weareteamturing/bombe#readme",
@@ -66,5 +66,5 @@
66
66
  "react-textarea-autosize": "^8.5.3",
67
67
  "styled-system": "^5.1.5"
68
68
  },
69
- "gitHead": "3a4c9dd6c4cd3b1238b05e1e3d952bad3de73041"
69
+ "gitHead": "249a90d29a2e6dcd0cff9076059492615777a08a"
70
70
  }