@dotss/ui 0.0.10 → 0.0.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.
Files changed (159) hide show
  1. package/Accordion/Accordion.cjs +13 -7
  2. package/Accordion/Accordion.d.ts +2 -0
  3. package/Accordion/Accordion.es.js +86 -65
  4. package/Autocomplete/Autocomplete.cjs +1 -1
  5. package/Autocomplete/Autocomplete.d.ts +1 -1
  6. package/Autocomplete/Autocomplete.es.js +235 -80
  7. package/BottomSheet/BottomSheet.cjs +5 -5
  8. package/BottomSheet/BottomSheet.d.ts +3 -0
  9. package/BottomSheet/BottomSheet.es.js +88 -70
  10. package/BottomSheet/BottomSheetText/BottomSheetText.cjs +2 -2
  11. package/BottomSheet/BottomSheetText/BottomSheetText.es.js +18 -6
  12. package/BottomSheet/BottomSheetTitle/BottomSheetTitle.cjs +6 -6
  13. package/BottomSheet/BottomSheetTitle/BottomSheetTitle.d.ts +2 -1
  14. package/BottomSheet/BottomSheetTitle/BottomSheetTitle.es.js +26 -15
  15. package/Button/Button.cjs +6 -6
  16. package/Button/Button.es.js +35 -29
  17. package/ChainPicker/ChainPicker.cjs +16 -6
  18. package/ChainPicker/ChainPicker.d.ts +4 -2
  19. package/ChainPicker/ChainPicker.es.js +155 -110
  20. package/ChainPicker/ChainPicker.stories.d.ts +1 -1
  21. package/Checkbox/Checkbox.cjs +3 -3
  22. package/Checkbox/Checkbox.es.js +12 -10
  23. package/CircularProgressIndicator/CircularProgressIndicator.cjs +5 -5
  24. package/CircularProgressIndicator/CircularProgressIndicator.es.js +25 -22
  25. package/DatePicker/DatePicker.cjs +37 -20
  26. package/DatePicker/DatePicker.d.ts +2 -1
  27. package/DatePicker/DatePicker.es.js +345 -320
  28. package/DatePicker/DatePicker.stories.d.ts +1 -0
  29. package/DatePicker/EventDot/EventDot.cjs +8 -0
  30. package/DatePicker/EventDot/EventDot.d.ts +8 -0
  31. package/DatePicker/EventDot/EventDot.es.js +19 -0
  32. package/DatePicker/EventDot/index.cjs +1 -0
  33. package/DatePicker/EventDot/index.d.ts +3 -0
  34. package/DatePicker/EventDot/index.es.js +4 -0
  35. package/DatePicker/EventDotGroup/EventDotGroup.cjs +8 -0
  36. package/DatePicker/EventDotGroup/EventDotGroup.d.ts +8 -0
  37. package/DatePicker/EventDotGroup/EventDotGroup.es.js +39 -0
  38. package/DatePicker/EventDotGroup/index.cjs +1 -0
  39. package/DatePicker/EventDotGroup/index.d.ts +3 -0
  40. package/DatePicker/EventDotGroup/index.es.js +4 -0
  41. package/DatePicker/index.cjs +1 -1
  42. package/DatePicker/index.d.ts +2 -0
  43. package/DatePicker/index.es.js +6 -2
  44. package/Dialog/Dialog.cjs +2 -2
  45. package/Dialog/Dialog.d.ts +2 -0
  46. package/Dialog/Dialog.es.js +45 -40
  47. package/Dialog/Dialog.stories.d.ts +10 -0
  48. package/Dialog/DialogText/DialogText.cjs +1 -1
  49. package/Dialog/DialogText/DialogText.es.js +1 -1
  50. package/Dialog/DialogTitle/DialogTitle.cjs +4 -4
  51. package/Dialog/DialogTitle/DialogTitle.d.ts +2 -1
  52. package/Dialog/DialogTitle/DialogTitle.es.js +17 -17
  53. package/FocusBoundary/FocusBoundary.cjs +1 -1
  54. package/FocusBoundary/FocusBoundary.d.ts +3 -1
  55. package/FocusBoundary/FocusBoundary.es.js +49 -42
  56. package/FormControlText/FormControlText.cjs +7 -5
  57. package/FormControlText/FormControlText.d.ts +2 -0
  58. package/FormControlText/FormControlText.es.js +50 -40
  59. package/Icon/Icon.cjs +1 -1
  60. package/Icon/Icon.es.js +1 -1
  61. package/IconButton/IconButton.cjs +8 -8
  62. package/IconButton/IconButton.es.js +32 -25
  63. package/LineProgressIndicator/LineProgressIndicator.cjs +6 -6
  64. package/LineProgressIndicator/LineProgressIndicator.es.js +34 -22
  65. package/Menu/Menu.cjs +16 -16
  66. package/Menu/Menu.d.ts +3 -2
  67. package/Menu/Menu.es.js +115 -81
  68. package/Menu/Menu.stories.d.ts +1 -0
  69. package/Menu/MenuBlock/MenuBlock.cjs +14 -7
  70. package/Menu/MenuBlock/MenuBlock.d.ts +1 -0
  71. package/Menu/MenuBlock/MenuBlock.es.js +47 -35
  72. package/Menu/MenuButton/MenuButton.cjs +1 -0
  73. package/Menu/MenuButton/MenuButton.d.ts +10 -0
  74. package/Menu/MenuButton/MenuButton.es.js +44 -0
  75. package/Menu/MenuButton/index.cjs +1 -0
  76. package/Menu/MenuButton/index.d.ts +3 -0
  77. package/Menu/MenuButton/index.es.js +4 -0
  78. package/Menu/index.cjs +1 -1
  79. package/Menu/index.d.ts +1 -0
  80. package/Menu/index.es.js +4 -2
  81. package/NumberKeypad/NumberKeypad.cjs +2 -2
  82. package/NumberKeypad/NumberKeypad.es.js +18 -16
  83. package/NumberKeypad/NumberKeypadBlock/NumberKeypadBlock.cjs +1 -1
  84. package/NumberKeypad/NumberKeypadBlock/NumberKeypadBlock.es.js +10 -1
  85. package/PageControl/PageControl.cjs +16 -5
  86. package/PageControl/PageControl.d.ts +3 -0
  87. package/PageControl/PageControl.es.js +77 -24
  88. package/PageControl/PageControl.stories.d.ts +1 -0
  89. package/Radio/Radio.cjs +3 -3
  90. package/Radio/Radio.es.js +22 -20
  91. package/RadioGroup/RadioGroup.cjs +1 -0
  92. package/RadioGroup/RadioGroup.d.ts +8 -0
  93. package/RadioGroup/RadioGroup.es.js +28 -0
  94. package/RadioGroup/RadioGroup.stories.d.ts +14 -0
  95. package/RadioGroup/index.cjs +1 -0
  96. package/RadioGroup/index.d.ts +3 -0
  97. package/RadioGroup/index.es.js +4 -0
  98. package/SegmentedButton/SegmentedButton.cjs +14 -3
  99. package/SegmentedButton/SegmentedButton.es.js +108 -34
  100. package/Select/Select.cjs +4 -4
  101. package/Select/Select.es.js +95 -86
  102. package/Slider/Slider.cjs +27 -12
  103. package/Slider/Slider.d.ts +1 -0
  104. package/Slider/Slider.es.js +177 -90
  105. package/Switch/Switch.cjs +28 -11
  106. package/Switch/Switch.d.ts +2 -0
  107. package/Switch/Switch.es.js +185 -65
  108. package/Switch/Switch.stories.d.ts +1 -0
  109. package/Tab/Tab.es.js +2 -4
  110. package/TextArea/TextArea.cjs +42 -34
  111. package/TextArea/TextArea.es.js +116 -82
  112. package/TextArea/TextArea.stories.d.ts +1 -1
  113. package/TextField/TextField.cjs +29 -13
  114. package/TextField/TextField.d.ts +2 -1
  115. package/TextField/TextField.es.js +122 -79
  116. package/TextField/TextField.stories.d.ts +1 -0
  117. package/Tooltip/Tooltip.cjs +7 -6
  118. package/Tooltip/Tooltip.d.ts +8 -3
  119. package/Tooltip/Tooltip.es.js +248 -146
  120. package/Tooltip/Tooltip.stories.d.ts +1 -0
  121. package/hooks/index.cjs +1 -1
  122. package/hooks/index.d.ts +3 -0
  123. package/hooks/index.es.js +7 -1
  124. package/hooks/useCheckHasFocus/useCheckHasFocus.cjs +1 -0
  125. package/hooks/useCheckHasFocus/useCheckHasFocus.d.ts +9 -0
  126. package/hooks/useCheckHasFocus/useCheckHasFocus.es.js +21 -0
  127. package/hooks/useCheckKeyboardMode/useCheckKeyboardMode.cjs +1 -0
  128. package/hooks/useCheckKeyboardMode/useCheckKeyboardMode.d.ts +4 -0
  129. package/hooks/useCheckKeyboardMode/useCheckKeyboardMode.es.js +30 -0
  130. package/hooks/useFocusBoundary/useFocusBoundary.cjs +1 -0
  131. package/hooks/useFocusBoundary/useFocusBoundary.d.ts +12 -0
  132. package/hooks/useFocusBoundary/useFocusBoundary.es.js +63 -0
  133. package/index.cjs +1 -1
  134. package/index.d.ts +2 -1
  135. package/index.es.js +97 -90
  136. package/package.json +3 -3
  137. package/resources/tictoccroc/icons/fill/certified-fill.svg-B_RVx6K_.cjs +1 -0
  138. package/resources/tictoccroc/icons/fill/certified-fill.svg-CK7UqYft.js +5 -0
  139. package/resources/tictoccroc/icons/fill/index.d.ts +3 -0
  140. package/resources/tictoccroc/icons/fill/location-fill.svg-DfSHAnsd.js +5 -0
  141. package/resources/tictoccroc/icons/fill/location-fill.svg-Die9mxQH.cjs +1 -0
  142. package/resources/tictoccroc/icons/fill/send-fill.svg-CItD_2L1.js +5 -0
  143. package/resources/tictoccroc/icons/fill/send-fill.svg-D197Lwl0.cjs +1 -0
  144. package/resources/tictoccroc/icons/index.ts-BmqvB_n6.cjs +1 -0
  145. package/resources/tictoccroc/icons/index.ts-CzTh-XsD.js +228 -0
  146. package/resources/tictoccroc/icons/line/index.d.ts +4 -0
  147. package/resources/tictoccroc/icons/line/list-line.svg-r5d5htjN.cjs +1 -0
  148. package/resources/tictoccroc/icons/line/list-line.svg-yFfhZxUp.js +5 -0
  149. package/resources/tictoccroc/icons/line/monthly-line.svg-BdyaJ1t_.cjs +1 -0
  150. package/resources/tictoccroc/icons/line/monthly-line.svg-DY5-Xv34.js +5 -0
  151. package/resources/tictoccroc/icons/line/review-line.svg-B4rfJrsO.js +5 -0
  152. package/resources/tictoccroc/icons/line/review-line.svg-DYUuUybx.cjs +1 -0
  153. package/resources/tictoccroc/icons/line/weekly-line.svg-BCO-LS_a.cjs +1 -0
  154. package/resources/tictoccroc/icons/line/weekly-line.svg-BUPmmgeE.js +5 -0
  155. package/utils/getIconLabel/getIconLabel.cjs +1 -1
  156. package/utils/getIconLabel/getIconLabel.es.js +8 -1
  157. package/utils/getSibling/getSibling.es.js +1 -2
  158. package/resources/tictoccroc/icons/index.ts-CarI_z7q.js +0 -214
  159. package/resources/tictoccroc/icons/index.ts-IVJAK4qr.cjs +0 -1
@@ -1,59 +1,100 @@
1
- import { jsxs as m, jsx as p } from "@emotion/react/jsx-runtime";
2
- import { forwardRef as s } from "react";
3
- import i from "@emotion/styled";
4
- const x = i.div`
1
+ import { jsxs as E, jsx as c } from "@emotion/react/jsx-runtime";
2
+ import { forwardRef as j, useState as b, useRef as v, useEffect as T } from "react";
3
+ import h from "@emotion/styled";
4
+ import U from "../core/useTheme.es.js";
5
+ const B = h.div`
5
6
  position: relative;
6
7
  display: flex;
7
- width: 56px;
8
+ min-width: 56px;
8
9
  height: 32px;
9
- padding: ${({ theme: { spacing: r } }) => `${r.content(1)}px`};
10
+ padding: ${({ theme: { spacing: t } }) => `${t.content(1)}px`};
10
11
  align-items: center;
11
12
  border-radius: 20px;
12
- transition: ${({ transitionDuration: r }) => `background-color ${r}ms ease-in-out`};
13
- pointer-events: ${({ disabled: r }) => r ? "none" : "auto"};
13
+ transition: ${({ transitionDuration: t }) => `background-color ${t}ms ease-in-out`};
14
+ pointer-events: ${({ disabled: t }) => t ? "none" : "auto"};
14
15
 
15
16
  ${({
16
17
  theme: {
17
- palette: { brand: r, grey: n }
18
+ palette: { brand: t, grey: r }
18
19
  },
19
20
  selected: o,
20
- disabled: t
21
- }) => o && t ? {
22
- backgroundColor: r.primary.bg
23
- } : o && !t ? {
24
- backgroundColor: r.primary.main
25
- } : !o && t ? {
26
- backgroundColor: n[20]
27
- } : !o && !t ? {
28
- backgroundColor: n[40]
21
+ disabled: n
22
+ }) => o && n ? {
23
+ backgroundColor: t.primary.bg
24
+ } : o && !n ? {
25
+ backgroundColor: t.primary.main
26
+ } : !o && n ? {
27
+ backgroundColor: r[20]
28
+ } : !o && !n ? {
29
+ backgroundColor: r[40]
29
30
  } : {}}
30
- `, g = i.div`
31
+ `, I = h.div`
32
+ position: absolute;
33
+ right: ${({ withLabel: t }) => t ? "24px" : "auto"};
31
34
  width: 24px;
32
35
  height: 24px;
33
36
  border-radius: 50%;
34
- transition: ${({ transitionDuration: r }) => `all ${r}ms ease-in-out`};
37
+ transition: ${({ transitionDuration: t }) => `all ${t}ms ease-in-out`};
35
38
  transition-property: background-color, transform, filter;
36
39
 
37
40
  ${({
38
41
  theme: {
39
- palette: { grey: r, background: n }
42
+ palette: { grey: t, background: r },
43
+ spacing: o
40
44
  },
41
- selected: o,
42
- disabled: t
43
- }) => o && t ? {
44
- backgroundColor: r.white,
45
- transform: "translateX(100%)"
46
- } : o && !t ? {
47
- backgroundColor: r.white,
48
- filter: "drop-shadow(0px 0px 16px rgba(0, 0, 0, 0.20))",
49
- transform: "translateX(100%)"
50
- } : !o && t ? {
51
- backgroundColor: n.primary
52
- } : !o && !t ? {
53
- backgroundColor: r.white,
54
- filter: "drop-shadow(0px 0px 16px rgba(0, 0, 0, 0.20))"
55
- } : {}}
56
- `, l = i.input`
45
+ selected: n,
46
+ disabled: e,
47
+ labelWidth: u,
48
+ withLabel: s
49
+ }) => {
50
+ if (s) {
51
+ if (n && e)
52
+ return {
53
+ backgroundColor: t.white,
54
+ transform: `translateX(calc(100% - ${o.content(1)}px))`
55
+ };
56
+ if (n && !e)
57
+ return {
58
+ backgroundColor: t.white,
59
+ filter: "drop-shadow(0px 0px 16px rgba(69, 55, 55, 0.2))",
60
+ transform: `translateX(calc(100% - ${o.content(1)}px))`
61
+ };
62
+ if (!n && e)
63
+ return {
64
+ backgroundColor: r.primary,
65
+ transform: `translateX(calc(100% - ${u + o.content(1)}px))`
66
+ };
67
+ if (!n && !e)
68
+ return {
69
+ backgroundColor: t.white,
70
+ filter: "drop-shadow(0px 0px 16px rgba(0, 0, 0, 0.20))",
71
+ transform: `translateX(calc(100% - ${u + o.content(1)}px))`
72
+ };
73
+ } else {
74
+ if (n && e)
75
+ return {
76
+ backgroundColor: t.white,
77
+ transform: "translateX(100%)"
78
+ };
79
+ if (n && !e)
80
+ return {
81
+ backgroundColor: t.white,
82
+ filter: "drop-shadow(0px 0px 16px rgba(69, 55, 55, 0.2))",
83
+ transform: "translateX(100%)"
84
+ };
85
+ if (!n && e)
86
+ return {
87
+ backgroundColor: r.primary
88
+ };
89
+ if (!n && !e)
90
+ return {
91
+ backgroundColor: t.white,
92
+ filter: "drop-shadow(0px 0px 16px rgba(0, 0, 0, 0.20))"
93
+ };
94
+ }
95
+ return {};
96
+ }}
97
+ `, q = h.input`
57
98
  position: absolute;
58
99
  appearance: none;
59
100
  width: 100%;
@@ -62,50 +103,129 @@ const x = i.div`
62
103
  left: 0;
63
104
  border-radius: 20px;
64
105
  cursor: pointer;
65
- `, d = s(function({
66
- selected: n,
106
+ `, C = h.div`
107
+ position: absolute;
108
+ opacity: ${({ selected: t }) => t ? 1 : 0};
109
+ pointer-events: none;
110
+ transition: opacity 0.2s;
111
+
112
+ ${({ theme: { spacing: t }, variant: r }) => {
113
+ switch (r) {
114
+ case "unselected":
115
+ return {
116
+ right: t.content(2)
117
+ };
118
+ case "selected":
119
+ return {
120
+ left: t.content(2)
121
+ };
122
+ default:
123
+ return {};
124
+ }
125
+ }}
126
+
127
+ ${({
128
+ theme: {
129
+ typography: t,
130
+ palette: { grey: r }
131
+ }
132
+ }) => ({
133
+ fontSize: t.c2M.size,
134
+ fontWeight: t.c2M.weight,
135
+ lineHeight: t.c2M.lineHeight,
136
+ color: r.white
137
+ })}
138
+ `, S = h.div`
139
+ ${({ theme: { spacing: t }, variant: r }) => {
140
+ switch (r) {
141
+ case "unselected":
142
+ return {
143
+ marginRight: `${t.content(8)}px`
144
+ };
145
+ case "selected":
146
+ return {
147
+ marginRight: `${t.content(8)}px`
148
+ };
149
+ default:
150
+ return {};
151
+ }
152
+ }}
153
+
154
+ visibility: hidden;
155
+
156
+ ${({
157
+ theme: {
158
+ typography: t,
159
+ palette: { grey: r }
160
+ }
161
+ }) => ({
162
+ fontSize: t.c2M.size,
163
+ fontWeight: t.c2M.weight,
164
+ lineHeight: t.c2M.lineHeight,
165
+ color: r.white
166
+ })}
167
+ `, G = j(function({
168
+ selected: r,
67
169
  disabled: o,
68
- onChange: t,
69
- transitionDuration: a = 150,
70
- inputProps: e,
71
- thumbProps: u,
72
- inlineCSS: h,
73
- ...c
74
- }, f) {
75
- return /* @__PURE__ */ m(
76
- x,
170
+ onChange: n,
171
+ transitionDuration: e = 150,
172
+ inputProps: u,
173
+ thumbProps: s,
174
+ inlineCSS: W,
175
+ selectedLabel: i,
176
+ unselectedLabel: a,
177
+ ...z
178
+ }, R) {
179
+ const { spacing: f } = U(), [l, M] = b(0), [m, X] = b(0), d = v(null), w = v(null), H = !!i || !!a, L = r ? m || l : l || m;
180
+ return T(() => {
181
+ const p = () => {
182
+ var $, k;
183
+ const x = (($ = w.current) == null ? void 0 : $.offsetWidth) ?? 0, g = ((k = d.current) == null ? void 0 : k.offsetWidth) ?? 0;
184
+ x > 0 && X(x + f.content(2)), g > 0 && M(g + f.content(2));
185
+ };
186
+ return p(), window.addEventListener("resize", p), () => {
187
+ window.removeEventListener("resize", p);
188
+ };
189
+ }, [f, a, i, r]), /* @__PURE__ */ E(
190
+ B,
77
191
  {
78
- ref: f,
79
- selected: n,
192
+ ref: R,
193
+ selected: r,
80
194
  disabled: o,
81
- transitionDuration: a,
82
- css: h,
83
- ...c,
195
+ transitionDuration: e,
196
+ css: W,
197
+ ...z,
84
198
  children: [
85
- /* @__PURE__ */ p(
86
- g,
199
+ /* @__PURE__ */ c(
200
+ I,
87
201
  {
88
- selected: n,
202
+ selected: r,
89
203
  disabled: o,
90
- transitionDuration: a,
91
- ...u
204
+ labelWidth: L,
205
+ withLabel: H,
206
+ transitionDuration: e,
207
+ ...s
92
208
  }
93
209
  ),
94
- /* @__PURE__ */ p(
95
- l,
210
+ /* @__PURE__ */ c(
211
+ q,
96
212
  {
97
213
  type: "checkbox",
98
214
  role: "switch",
99
- checked: n,
215
+ checked: r,
100
216
  disabled: o,
101
- onChange: t,
102
- ...e
217
+ onChange: n,
218
+ ...u
103
219
  }
104
- )
220
+ ),
221
+ a && !r && /* @__PURE__ */ c(S, { ref: d, variant: "unselected", "aria-hidden": !0, children: a }),
222
+ i && r && /* @__PURE__ */ c(S, { ref: w, variant: "selected", "aria-hidden": !0, children: i }),
223
+ a && /* @__PURE__ */ c(C, { variant: "unselected", selected: !r, "aria-hidden": r, children: a }),
224
+ i && /* @__PURE__ */ c(C, { variant: "selected", selected: r, "aria-hidden": !r, children: i })
105
225
  ]
106
226
  }
107
227
  );
108
228
  });
109
229
  export {
110
- d as default
230
+ G as default
111
231
  };
@@ -11,3 +11,4 @@ declare const meta: {
11
11
  export default meta;
12
12
  type Story = StoryObj<typeof meta>;
13
13
  export declare const Default: Story;
14
+ export declare const Label: Story;
package/Tab/Tab.es.js CHANGED
@@ -40,8 +40,7 @@ const tt = D.div`
40
40
  )), _ = (t) => (n) => {
41
41
  v.current && (T(t, n.currentTarget), v.current = !1);
42
42
  }, G = (t) => {
43
- if (!s.current)
44
- return;
43
+ if (!s.current) return;
45
44
  const n = s.current.querySelectorAll(
46
45
  '[role="tab"]:not([disabled])'
47
46
  ), o = Array.from(n).findIndex((e) => e === document.activeElement);
@@ -109,8 +108,7 @@ const tt = D.div`
109
108
  };
110
109
  }, [m, l, w]), F(() => {
111
110
  const t = s.current, n = (r) => {
112
- if (!g || !s.current)
113
- return;
111
+ if (!g || !s.current) return;
114
112
  const a = x - r;
115
113
  let c = E + a;
116
114
  const p = s.current.scrollWidth - s.current.clientWidth;
@@ -1,68 +1,76 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("@emotion/react/jsx-runtime"),l=require("react"),k=require("@emotion/styled"),_=t=>t&&t.__esModule?t:{default:t},c=_(k),M=c.default.div`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("@emotion/react/jsx-runtime"),a=require("react"),_=require("@emotion/styled"),h=require("../Typography/Typography.cjs"),q=e=>e&&e.__esModule?e:{default:e},d=q(_),A=d.default.div`
2
+ position: relative;
3
+ display: flex;
4
+ flex-direction: column;
5
+ ${({fullWidth:e})=>e?{width:"100%"}:null};
6
+ `,T=d.default.div`
2
7
  position: relative;
3
8
  border-radius: 12px;
4
9
  height: auto;
5
10
  overflow: hidden;
6
11
 
7
- ${({theme:{palette:{brand:t,background:i,grey:n}},variant:d,isFocused:r})=>d==="filled"?{backgroundColor:i.primary,border:"1px solid transparent"}:d==="outlined"?r?{backgroundColor:n.white,border:`1px solid ${t.primary.line}`}:{backgroundColor:n.white,border:`1px solid ${n[50]}`}:{}};
12
+ ${({theme:{palette:{brand:e,background:t,grey:n}},variant:c,isFocused:r})=>c==="filled"?{backgroundColor:t.primary,border:"1px solid transparent"}:c==="outlined"?r?{backgroundColor:n.white,border:`1px solid ${e.primary.line}`}:{backgroundColor:n.white,border:`1px solid ${n[50]}`}:{}};
8
13
 
9
- ${({theme:{palette:{etc:t}},variant:i,helper:n})=>i==="outlined"&&((n==null?void 0:n.severity)==="error"||n!=null&&n.message)?{borderColor:t.red}:{}}
14
+ ${({theme:{palette:{etc:e}},variant:t,helper:n})=>t==="outlined"&&((n==null?void 0:n.severity)==="error"||n!=null&&n.message)?{borderColor:e.red}:{}}
10
15
 
11
- ${({theme:{palette:{grey:t}},variant:i,disabled:n})=>i==="outlined"&&n?{backgroundColor:t[10],borderColor:t[30]}:{}}
16
+ ${({theme:{palette:{grey:e}},variant:t,disabled:n})=>t==="outlined"&&n?{backgroundColor:e[10],borderColor:e[30]}:{}}
12
17
 
13
- ${({fullWidth:t})=>t?{width:"100%"}:{}}
14
- `,W=c.default.textarea`
18
+ ${({fullWidth:e})=>e?{width:"100%"}:{}}
19
+ `,F=d.default.textarea`
15
20
  width: 100%;
16
21
  overflow: hidden;
17
22
  resize: none;
18
23
  border: none;
19
24
  outline: 0;
20
25
  background: transparent;
21
- padding: ${({theme:t})=>`${t.spacing.content(3)}px ${t.spacing.content(4)}px ${t.spacing.content(2)}px`};
22
- min-height: ${({minHeight:t})=>t}px;
26
+ padding: ${({theme:e})=>`${e.spacing.content(3)}px ${e.spacing.content(4)}px ${e.spacing.content(2)}px`};
27
+ min-height: ${({minHeight:e})=>e}px;
23
28
 
24
- ${({theme:{typography:{b2R:t}}})=>({fontSize:t.size,fontWeight:t.weight,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing})};
29
+ ${({theme:{typography:{b2R:e}}})=>({fontSize:e.size,fontWeight:e.weight,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing})};
25
30
 
26
31
  @media (max-width: 360px) {
27
- ${({theme:{typography:{b3R:t}}})=>({fontSize:t.size,fontWeight:t.weight,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing})};
32
+ ${({theme:{typography:{b3R:e}}})=>({fontSize:e.size,fontWeight:e.weight,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing})};
28
33
  }
29
34
 
30
- &::placeholder {
31
- color: ${({theme:t})=>t.palette.grey[50]};
35
+ &::placeholder,
36
+ &::-webkit-input-placeholder,
37
+ &::-ms-input-placeholder,
38
+ &::-moz-placeholder {
39
+ color: ${({theme:e})=>e.palette.grey[50]};
32
40
  text-align: justify;
33
41
  }
34
42
 
35
43
  &[disabled] {
36
- color: ${({theme:t})=>t.palette.grey[30]};
44
+ color: ${({theme:e})=>e.palette.grey[30]};
37
45
  cursor: not-allowed;
38
46
  }
39
47
 
40
48
  &[disabled]::placeholder {
41
- color: ${({theme:t})=>t.palette.grey[30]};
49
+ color: ${({theme:e})=>e.palette.grey[30]};
42
50
  }
43
- `,q=c.default.div`
44
- color: ${({theme:t,disabled:i})=>i?t.palette.grey[30]:t.palette.grey[50]};
51
+ `,B=d.default.div`
52
+ color: ${({theme:e,disabled:t})=>t?e.palette.grey[30]:e.palette.grey[50]};
45
53
  text-align: right;
46
- padding-right: ${({theme:t})=>t.spacing.content(4)}px;
47
- padding-bottom: ${({theme:t})=>t.spacing.content(3)}px;
54
+ padding-right: ${({theme:e})=>e.spacing.content(4)}px;
55
+ padding-bottom: ${({theme:e})=>e.spacing.content(3)}px;
48
56
 
49
- ${({theme:{typography:{b4R:t}}})=>({fontSize:t.size,fontWeight:t.weight,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing})};
57
+ ${({theme:{typography:{b4R:e}}})=>({fontSize:e.size,fontWeight:e.weight,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing})};
50
58
 
51
59
  & > span {
52
- color: ${({theme:t,disabled:i})=>i?t.palette.grey[30]:t.palette.grey[100]};
60
+ color: ${({theme:e,disabled:t})=>t?e.palette.grey[30]:e.palette.grey[100]};
53
61
  }
54
- `,A=c.default.p`
55
- margin-top: ${({theme:{spacing:t}})=>t.content(1)}px;
56
- color: ${({theme:t})=>t.palette.etc.red};
57
-
58
- ${({theme:{typography:{c3R:t}}})=>({fontSize:t.size,fontWeight:t.weight,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing})};
59
- `,T=c.default.p`
62
+ `,D=d.default.p`
60
63
  position: absolute;
61
- width: 1px;
62
- height: 1px;
63
- margin: -1px;
64
- padding: 0;
65
- overflow: hidden;
66
- clip: rect(0, 0, 0, 0);
67
- border: 0;
68
- `,F=l.forwardRef(({onChange:t,value:i,variant:n="filled",size:d="large",maxLength:r=290,onFocus:p,onBlur:x,helper:o,disabled:g=!1,wrapperProps:u,...S},m)=>{const f=l.useRef(null),h=l.useRef(d==="large"?112.5:57.5),[v,y]=l.useState(!1),$=l.useId(),H=e=>{e.target.value.length>r&&(e.target.value=e.target.value.slice(0,r)),typeof t=="function"&&t(e)},w=e=>{y(!0),typeof p=="function"&&p(e)},j=e=>{y(!1),typeof x=="function"&&x(e)},C=()=>{var s;const e=(s=f.current)==null?void 0:s.querySelector("textarea");e&&e.focus()};return l.useEffect(()=>{var s;const e=(s=f.current)==null?void 0:s.querySelector("textarea");if(e){e.style.height="auto";const{scrollHeight:b,clientHeight:z}=e;e.style.height=`${h.current}px`,e.style.height=`${Math.max(b,h.current,z)}px`}},[i]),a.jsxs("div",{children:[a.jsxs(M,{ref:f,isFocused:v,variant:n,helper:o,disabled:g,...u,css:u==null?void 0:u.inlineCSS,children:[a.jsx(W,{ref:m,onChange:H,onFocus:w,onBlur:j,value:i,disabled:g,"aria-invalid":(o==null?void 0:o.severity)==="error","aria-describedby":o!=null&&o.message?$:void 0,minHeight:h.current,...S}),a.jsxs(q,{disabled:g,onClick:C,children:["(",a.jsx("span",{children:i.length})," / ",r,")"]})]}),(o==null?void 0:o.message)&&!g&&a.jsx(A,{id:$,helper:o,children:o.message}),i.length>=r&&a.jsxs(T,{"aria-live":"assertive",role:"alert",children:["최대 입력 글자 수에 도달하였습니다. ",r," 자까지 입력이 가능합니다."]})]})});exports.default=F;
64
+ left: 0;
65
+ bottom: calc(
66
+ ${({theme:{spacing:e}})=>-e.content(1)}px -
67
+ ${({theme:{typography:{c3R:e}}})=>e.lineHeight}
68
+ );
69
+ color: ${({theme:e})=>e.palette.etc.red};
70
+
71
+ ${({theme:{typography:{c3R:e}}})=>({fontSize:e.size,fontWeight:e.weight,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing})};
72
+
73
+ &:empty {
74
+ display: none;
75
+ }
76
+ `,E=a.forwardRef(({onChange:e,value:t,variant:n="filled",size:c="large",maxLength:r=290,onFocus:y,onBlur:x,helper:o,disabled:u=!1,fullWidth:H,wrapperProps:g,...v},j)=>{const f=a.useRef(null),p=a.useRef(c==="large"?112.5:57.5),[b,$]=a.useState(!1),S=a.useId(),w=a.useId(),m=a.useId(),z=i=>{i.target.value.length>r&&(i.target.value=i.target.value.slice(0,r)),typeof e=="function"&&e(i)},C=i=>{$(!0),typeof y=="function"&&y(i)},k=i=>{$(!1),typeof x=="function"&&x(i)},I=()=>{var s;const i=(s=f.current)==null?void 0:s.querySelector("textarea");i&&i.focus()};return a.useEffect(()=>{var s;const i=(s=f.current)==null?void 0:s.querySelector("textarea");if(i){i.style.height="auto";const{scrollHeight:M,clientHeight:W}=i;i.style.height=`${p.current}px`,i.style.height=`${Math.max(M,p.current,W)}px`}},[t]),l.jsxs(A,{fullWidth:H,children:[l.jsxs(T,{ref:f,isFocused:b,variant:n,helper:o,disabled:u,...g,css:g==null?void 0:g.inlineCSS,children:[l.jsx(F,{ref:j,id:w,onChange:z,onFocus:C,onBlur:k,value:t,disabled:u,"aria-invalid":(o==null?void 0:o.severity)==="error","aria-describedby":o!=null&&o.message?S:m,minHeight:p.current,...v}),l.jsxs(B,{disabled:u,onClick:I,"aria-label":`현재 ${t.length}자 입력됨, 최대 ${r}자까지 입력 가능`,children:["(",l.jsx("span",{children:t.length})," / ",r,")"]})]}),l.jsx(D,{id:S,helper:o,"aria-live":"assertive",role:"alert",children:!u&&(o==null?void 0:o.message)}),l.jsxs(h.default,{visuallyHidden:!0,id:m,children:["최대 ",r,"까지 입력 가능"]}),l.jsx(h.default,{visuallyHidden:!0,"aria-live":"assertive",role:"alert",children:t.length>=r&&`최대 입력 글자 수에 도달하였습니다. ${r} 자까지 입력이 가능합니다.`}),l.jsx(h.default,{visuallyHidden:!0,role:"status",children:t.length>=r*.8&&t.length<r&&`최대 입력 가능한 글자 수의 80퍼센트에 도달했습니다. ${r*.8}자 입력됨.`})]})});exports.default=E;