@nurihaus/web-design-system 3.9.2 → 3.9.3
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/.storybook/preview.d.ts +49 -0
- package/dist/ai/components.md +675 -105
- package/dist/ai/motion.md +156 -134
- package/dist/ai/tokens.md +295 -137
- package/dist/asset.js +328 -0
- package/dist/avatar.js +208 -33
- package/dist/bottom-nav.js +86 -6
- package/dist/breadcrumb.js +6 -3
- package/dist/card.js +5 -2
- package/dist/check-box.js +81 -45
- package/dist/chip-group.js +50 -12
- package/dist/chunk-1563.js +42 -18
- package/dist/chunk-1983.js +100 -0
- package/dist/chunk-3297.js +130 -0
- package/dist/chunk-3640.js +94 -0
- package/dist/chunk-3839.js +54 -0
- package/dist/chunk-4558.js +13 -2
- package/dist/chunk-4577.js +35 -0
- package/dist/chunk-5302.js +111 -0
- package/dist/{chunk-1657.js → chunk-5589.js} +41 -5
- package/dist/chunk-5670.js +122 -0
- package/dist/chunk-6302.js +10 -10
- package/dist/chunk-6706.js +64 -0
- package/dist/chunk-7302.js +66 -0
- package/dist/chunk-7460.js +204 -0
- package/dist/{chunk-6149.js → chunk-8377.js} +36 -2
- package/dist/chunk-8734.js +33 -0
- package/dist/chunk-8787.js +260 -0
- package/dist/chunk-8933.js +14 -2
- package/dist/chunk-910.js +82 -27
- package/dist/chunk-948.js +166 -0
- package/dist/collapsible-menu.js +39 -14
- package/dist/components/asset/asset-props.d.ts +43 -0
- package/dist/components/asset/asset-type.d.ts +38 -0
- package/dist/components/asset/asset.d.ts +21 -0
- package/dist/components/asset/asset.stories.d.ts +65 -0
- package/dist/components/asset/base-asset.d.ts +7 -0
- package/dist/components/avatar/avatar-props.d.ts +1 -0
- package/dist/components/avatar/avatar-type.d.ts +6 -4
- package/dist/components/avatar/avatar.stories.d.ts +10 -0
- package/dist/components/badge/badge-type.d.ts +10 -4
- package/dist/components/badge/badge.stories.d.ts +15 -0
- package/dist/components/bottom-bar/bottom-bar.stories.d.ts +12 -5
- package/dist/components/bottom-nav/bottom-nav-type.d.ts +2 -1
- package/dist/components/bottom-nav/bottom-nav.stories.d.ts +16 -1
- package/dist/components/breadcrumb/breadcrumb-type.d.ts +2 -1
- package/dist/components/breadcrumb/breadcrumb.stories.d.ts +15 -0
- package/dist/components/button/button-appearance.d.ts +50 -0
- package/dist/components/button/button-props.d.ts +12 -3
- package/dist/components/button/button-type.d.ts +14 -4
- package/dist/components/button/button.stories.d.ts +34 -3
- package/dist/components/button/cta-button.d.ts +1 -1
- package/dist/components/callout/callout.stories.d.ts +11 -0
- package/dist/components/card/card-type.d.ts +2 -1
- package/dist/components/card/card.stories.d.ts +9 -0
- package/dist/components/check-box/check-box-props.d.ts +8 -0
- package/dist/components/check-box/check-box-type.d.ts +7 -3
- package/dist/components/check-box/check-box.stories.d.ts +32 -1
- package/dist/components/chip-group/chip-group-props.d.ts +13 -1
- package/dist/components/chip-group/chip-group-type.d.ts +5 -1
- package/dist/components/chip-group/chip-group.stories.d.ts +30 -0
- package/dist/components/collapsible-menu/collapsible-menu-type.d.ts +6 -2
- package/dist/components/collapsible-menu/collapsible-menu.stories.d.ts +12 -0
- package/dist/components/description-list/description-list.stories.d.ts +7 -0
- package/dist/components/drawer/base-drawer.d.ts +2 -4
- package/dist/components/drawer/drawer-type.d.ts +17 -2
- package/dist/components/drawer/drawer.stories.d.ts +21 -0
- package/dist/components/drop-down/drop-down-type.d.ts +4 -2
- package/dist/components/drop-down/drop-down.stories.d.ts +16 -0
- package/dist/components/elements/text/text-props.d.ts +3 -3
- package/dist/components/elements/text/text-type.d.ts +3 -2
- package/dist/components/elements/text/text.stories.d.ts +13 -1
- package/dist/components/empty-state/empty-state.stories.d.ts +33 -8
- package/dist/components/icon/icon.stories.d.ts +11 -1
- package/dist/components/icon-button/icon-button-type.d.ts +2 -1
- package/dist/components/icon-button/icon-button.stories.d.ts +9 -0
- package/dist/components/list/list-group.stories.d.ts +7 -0
- package/dist/components/list/list-row.stories.d.ts +18 -8
- package/dist/components/list/list-type.d.ts +2 -1
- package/dist/components/loading/index.d.ts +4 -0
- package/dist/components/loading/inline-loading/base-inline-loading.d.ts +3 -2
- package/dist/components/loading/inline-loading/inline-loading-props.d.ts +3 -0
- package/dist/components/loading/inline-loading/inline-loading-type.d.ts +6 -6
- package/dist/components/loading/inline-loading/inline-loading.stories.d.ts +28 -2
- package/dist/components/loading/loading-dots/base-loading-dots.d.ts +4 -0
- package/dist/components/loading/loading-dots/loading-dots-props.d.ts +4 -0
- package/dist/components/loading/loading-dots/loading-dots-type.d.ts +6 -0
- package/dist/components/loading/loading-dots/loading-dots.d.ts +4 -0
- package/dist/components/loading/loading-dots/loading-dots.stories.d.ts +37 -0
- package/dist/components/loading/loading-props.d.ts +9 -0
- package/dist/components/loading/loading-type.d.ts +9 -0
- package/dist/components/loading/loading.stories.d.ts +15 -0
- package/dist/components/loading/overlay-loading/overlay-loading-type.d.ts +4 -0
- package/dist/components/loading/overlay-loading/overlay-loading.stories.d.ts +17 -0
- package/dist/components/loading/progress-bar/base-progress-bar.d.ts +3 -0
- package/dist/components/loading/progress-bar/progress-bar-props.d.ts +4 -0
- package/dist/components/loading/progress-bar/progress-bar-type.d.ts +19 -0
- package/dist/components/loading/progress-bar/progress-bar.d.ts +4 -0
- package/dist/components/loading/progress-bar/progress-bar.stories.d.ts +63 -0
- package/dist/components/loading/spinner/spinner-props.d.ts +4 -1
- package/dist/components/loading/spinner/spinner-type.d.ts +3 -1
- package/dist/components/loading/spinner/spinner.d.ts +2 -1
- package/dist/components/loading/spinner/spinner.stories.d.ts +30 -4
- package/dist/components/logging/logging.stories.d.ts +5 -0
- package/dist/components/media/media-thumbnail.stories.d.ts +9 -0
- package/dist/components/media/media-type.d.ts +2 -1
- package/dist/components/media/media-viewer.stories.d.ts +7 -0
- package/dist/components/message/message.stories.d.ts +15 -8
- package/dist/components/message-composer/message-composer-type.d.ts +2 -1
- package/dist/components/message-composer/message-composer.stories.d.ts +10 -0
- package/dist/components/modal/modal-type.d.ts +22 -3
- package/dist/components/modal/modal-with-double-button.stories.d.ts +15 -0
- package/dist/components/modal/modal.stories.d.ts +16 -0
- package/dist/components/motion/motion.stories.d.ts +7 -0
- package/dist/components/notice/notice-type.d.ts +1 -1
- package/dist/components/notice/notice.stories.d.ts +13 -6
- package/dist/components/overlay/overlay-context.d.ts +34 -0
- package/dist/components/overlay/overlay-provider.d.ts +6 -0
- package/dist/components/overlay/overlay-type.d.ts +45 -0
- package/dist/components/overlay/overlay.d.ts +4 -0
- package/dist/components/overlay/overlay.stories.d.ts +34 -0
- package/dist/components/overlay/use-dialog.d.ts +3 -0
- package/dist/components/overlay/use-toast.d.ts +3 -0
- package/dist/components/pagination/pagination-type.d.ts +2 -1
- package/dist/components/pagination/pagination.stories.d.ts +15 -0
- package/dist/components/radio/base-radio.d.ts +5 -2
- package/dist/components/radio/radio-type.d.ts +11 -3
- package/dist/components/radio/radio.stories.d.ts +20 -2
- package/dist/components/skeleton/base-skeleton.d.ts +7 -3
- package/dist/components/skeleton/skeleton-group-props.d.ts +4 -0
- package/dist/components/skeleton/skeleton-group-type.d.ts +47 -0
- package/dist/components/skeleton/skeleton-group.d.ts +4 -0
- package/dist/components/skeleton/skeleton-group.stories.d.ts +57 -0
- package/dist/components/skeleton/skeleton-type.d.ts +1 -0
- package/dist/components/skeleton/skeleton.stories.d.ts +17 -6
- package/dist/components/step-progress/step-progress-props.d.ts +10 -0
- package/dist/components/step-progress/step-progress-type.d.ts +22 -3
- package/dist/components/step-progress/step-progress.d.ts +1 -1
- package/dist/components/step-progress/step-progress.stories.d.ts +40 -0
- package/dist/components/switch/base-switch.d.ts +2 -4
- package/dist/components/switch/switch-type.d.ts +5 -2
- package/dist/components/switch/switch.stories.d.ts +22 -0
- package/dist/components/table/table-type.d.ts +2 -1
- package/dist/components/table/table.stories.d.ts +23 -0
- package/dist/components/tabs/tabs-type.d.ts +4 -1
- package/dist/components/tabs/tabs.stories.d.ts +17 -0
- package/dist/components/tag/tag-type.d.ts +2 -1
- package/dist/components/tag/tag.stories.d.ts +9 -0
- package/dist/components/text-area/base-text-area.d.ts +2 -1
- package/dist/components/text-area/text-area-type.d.ts +11 -3
- package/dist/components/text-area/text-area.stories.d.ts +15 -0
- package/dist/components/text-field/base-text-field.d.ts +12 -6
- package/dist/components/text-field/text-field-type.d.ts +37 -6
- package/dist/components/text-field/text-field.stories.d.ts +32 -5
- package/dist/components/toast/toast-type.d.ts +4 -1
- package/dist/components/toast/toast.stories.d.ts +21 -6
- package/dist/components/tooltip/tooltip-type.d.ts +4 -1
- package/dist/components/tooltip/tooltip.stories.d.ts +11 -0
- package/dist/components.css +1924 -697
- package/dist/cta-button.js +94 -33
- package/dist/data-table.js +5 -3
- package/dist/drawer.js +79 -13
- package/dist/drop-down.js +18 -10
- package/dist/helpers/hooks/useCloseOnBackEvent.d.ts +12 -0
- package/dist/helpers/hooks/useFieldClear.d.ts +21 -0
- package/dist/helpers/hooks/useReturnFocus.d.ts +9 -0
- package/dist/helpers/motion/appear.d.ts +3 -0
- package/dist/helpers/motion/effects.d.ts +9 -0
- package/dist/helpers/motion/motion-props.d.ts +35 -0
- package/dist/helpers/motion/stagger.d.ts +3 -0
- package/dist/helpers/motion/use-appear.d.ts +12 -0
- package/dist/helpers/motion/use-attention-handle.d.ts +7 -0
- package/dist/helpers/motion/use-confirm-spring.d.ts +7 -0
- package/dist/helpers/motion/use-effect-trigger.d.ts +11 -0
- package/dist/helpers/motion/use-hide-on-scroll.d.ts +12 -0
- package/dist/helpers/motion/use-presence-callbacks.d.ts +13 -0
- package/dist/icon-button.js +4 -2
- package/dist/icon-text-badge.js +27 -17
- package/dist/icon-text-option-badge.js +19 -13
- package/dist/index.d.ts +11 -4
- package/dist/index.js +3992 -967
- package/dist/list-row.js +5 -2
- package/dist/loading.js +200 -39
- package/dist/media-thumbnail.js +9 -5
- package/dist/message-composer.js +15 -11
- package/dist/modal-with-double-button.js +71 -53
- package/dist/modal.js +95 -29
- package/dist/notice.js +14 -8
- package/dist/option-badge.js +27 -17
- package/dist/overlay.js +1213 -0
- package/dist/pagination.js +11 -7
- package/dist/radio.js +117 -21
- package/dist/skeleton-group.js +445 -0
- package/dist/skeleton.js +24 -112
- package/dist/step-progress.js +125 -16
- package/dist/styles.css +2235 -777
- package/dist/switch.js +89 -17
- package/dist/tabs.js +77 -23
- package/dist/tag.js +4 -2
- package/dist/text-area.js +81 -31
- package/dist/text-field.js +160 -33
- package/dist/toast.js +98 -241
- package/dist/tokens/generated/motion.d.ts +21 -4
- package/dist/tokens/generated/semantic-admin.d.ts +103 -46
- package/dist/tokens/generated/semantic-app.d.ts +164 -16
- package/dist/tokens.css +578 -103
- package/dist/tokens.js +293 -71
- package/dist/tooltip.js +50 -22
- package/package.json +14 -1
- package/dist/chunk-5226.js +0 -79
package/dist/text-field.js
CHANGED
|
@@ -16,12 +16,16 @@ __nuri_require__.d(__webpack_exports__, {
|
|
|
16
16
|
var jsx_runtime_ = __nuri_require__(612);
|
|
17
17
|
// EXTERNAL MODULE: external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react","module":"react"}
|
|
18
18
|
var external_root_React_commonjs2_react_commonjs_react_amd_react_module_react_ = __nuri_require__(1041);
|
|
19
|
+
// EXTERNAL MODULE: ./helpers/hooks/useFieldClear.ts
|
|
20
|
+
var useFieldClear = __nuri_require__(7302);
|
|
19
21
|
// EXTERNAL MODULE: ./helpers/hooks/useTrack.ts
|
|
20
22
|
var useTrack = __nuri_require__(4560);
|
|
21
23
|
// EXTERNAL MODULE: ./helpers/utils/classNames.js
|
|
22
24
|
var classNames = __nuri_require__(3274);
|
|
23
25
|
// EXTERNAL MODULE: ./helpers/utils/getMergedProps.ts
|
|
24
26
|
var getMergedProps = __nuri_require__(7335);
|
|
27
|
+
// EXTERNAL MODULE: ./components/icon/icon.tsx
|
|
28
|
+
var icon = __nuri_require__(3547);
|
|
25
29
|
// EXTERNAL MODULE: ./components/elements/text/text.tsx
|
|
26
30
|
var text_text = __nuri_require__(7739);
|
|
27
31
|
;// ./components/text-field/base-text-field.tsx
|
|
@@ -47,30 +51,31 @@ var __rest = undefined && undefined.__rest || function (s, e) {
|
|
|
47
51
|
|
|
48
52
|
|
|
49
53
|
|
|
54
|
+
var identity = function identity(text) {
|
|
55
|
+
return text;
|
|
56
|
+
};
|
|
50
57
|
var TextFieldContext = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_module_react_.createContext)({
|
|
51
|
-
|
|
58
|
+
display: '',
|
|
52
59
|
onChange: function onChange() {}
|
|
53
60
|
});
|
|
54
61
|
// context 만 내려주고 DOM 을 그리지 않아 ref 를 받을 곳이 없다.
|
|
55
62
|
var TextFieldRootBase = function TextFieldRootBase(props) {
|
|
63
|
+
var _a, _b;
|
|
56
64
|
var children = props.children,
|
|
57
65
|
value = props.value,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
var
|
|
61
|
-
var
|
|
62
|
-
innerValue = _a[0],
|
|
63
|
-
setInnerValue = _a[1];
|
|
64
|
-
var inputValue = isControlled ? value !== null && value !== void 0 ? value : '' : innerValue;
|
|
66
|
+
format = props.format,
|
|
67
|
+
onChange = props.onChange;
|
|
68
|
+
var transform = (_a = format === null || format === void 0 ? void 0 : format.transform) !== null && _a !== void 0 ? _a : identity;
|
|
69
|
+
var reset = (_b = format === null || format === void 0 ? void 0 : format.reset) !== null && _b !== void 0 ? _b : identity;
|
|
65
70
|
var handleChange = function handleChange(e) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
onChange
|
|
71
|
+
var raw = reset(e.target.value);
|
|
72
|
+
// DOM 값을 raw 로 맞춰야 받는 쪽이 raw 를 읽고, React 가 다음 렌더에서 transform(raw) 로 다시 그린다
|
|
73
|
+
if (raw !== e.target.value) e.target.value = raw;
|
|
74
|
+
onChange(e);
|
|
70
75
|
};
|
|
71
76
|
return (0,jsx_runtime_.jsx)(TextFieldContext.Provider, {
|
|
72
77
|
value: {
|
|
73
|
-
|
|
78
|
+
display: transform(value),
|
|
74
79
|
onChange: handleChange
|
|
75
80
|
},
|
|
76
81
|
children: children
|
|
@@ -94,7 +99,7 @@ var TextFieldInput = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonj
|
|
|
94
99
|
disabled = props.disabled,
|
|
95
100
|
restProps = __rest(props, ["className", "disabled"]);
|
|
96
101
|
var _a = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_module_react_.useContext)(TextFieldContext),
|
|
97
|
-
|
|
102
|
+
display = _a.display,
|
|
98
103
|
onChange = _a.onChange;
|
|
99
104
|
return (0,jsx_runtime_.jsx)("input", __assign({
|
|
100
105
|
ref: ref,
|
|
@@ -103,11 +108,46 @@ var TextFieldInput = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonj
|
|
|
103
108
|
"data-disabled": disabled
|
|
104
109
|
}, restProps, {
|
|
105
110
|
// 값은 Root 가 쥔다. 넘겨받은 value·onChange 가 Root 상태를 덮지 않게 spread 뒤에 둔다.
|
|
106
|
-
value:
|
|
111
|
+
value: display,
|
|
107
112
|
onChange: onChange
|
|
108
113
|
}));
|
|
109
114
|
});
|
|
110
115
|
TextFieldInput.displayName = 'TextFieldInput';
|
|
116
|
+
var TextFieldPrefix = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_module_react_.forwardRef)(function (props, ref) {
|
|
117
|
+
var className = props.className,
|
|
118
|
+
restProps = __rest(props, ["className"]);
|
|
119
|
+
return (0,jsx_runtime_.jsx)("span", __assign({
|
|
120
|
+
ref: ref,
|
|
121
|
+
className: (0,classNames/* classNames */.x)('nuri-theme base-text-field prefix', className)
|
|
122
|
+
}, restProps));
|
|
123
|
+
});
|
|
124
|
+
TextFieldPrefix.displayName = 'TextFieldPrefix';
|
|
125
|
+
var TextFieldSuffix = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_module_react_.forwardRef)(function (props, ref) {
|
|
126
|
+
var className = props.className,
|
|
127
|
+
restProps = __rest(props, ["className"]);
|
|
128
|
+
return (0,jsx_runtime_.jsx)("span", __assign({
|
|
129
|
+
ref: ref,
|
|
130
|
+
className: (0,classNames/* classNames */.x)('nuri-theme base-text-field suffix', className)
|
|
131
|
+
}, restProps));
|
|
132
|
+
});
|
|
133
|
+
TextFieldSuffix.displayName = 'TextFieldSuffix';
|
|
134
|
+
var TextFieldAction = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_module_react_.forwardRef)(function (props, ref) {
|
|
135
|
+
var className = props.className,
|
|
136
|
+
_onMouseDown = props.onMouseDown,
|
|
137
|
+
restProps = __rest(props, ["className", "onMouseDown"]);
|
|
138
|
+
return (0,jsx_runtime_.jsx)("button", __assign({
|
|
139
|
+
ref: ref,
|
|
140
|
+
className: (0,classNames/* classNames */.x)('nuri-theme base-text-field action', className),
|
|
141
|
+
type: 'button'
|
|
142
|
+
}, restProps, {
|
|
143
|
+
// 눌러도 포커스가 input 에 남아야 자판이 닫히지 않는다. 넘겨받은 onMouseDown 이 덮지 않게 spread 뒤에 둔다.
|
|
144
|
+
onMouseDown: function onMouseDown(e) {
|
|
145
|
+
e.preventDefault();
|
|
146
|
+
_onMouseDown === null || _onMouseDown === void 0 ? void 0 : _onMouseDown(e);
|
|
147
|
+
}
|
|
148
|
+
}));
|
|
149
|
+
});
|
|
150
|
+
TextFieldAction.displayName = 'TextFieldAction';
|
|
111
151
|
var TextFieldHelperText = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_module_react_.forwardRef)(function (props, ref) {
|
|
112
152
|
var text = props.text,
|
|
113
153
|
className = props.className;
|
|
@@ -123,6 +163,9 @@ TextFieldHelperText.displayName = 'TextFieldHelperText';
|
|
|
123
163
|
var TextFieldRoot = Object.assign(TextFieldRootBase, {
|
|
124
164
|
Label: TextFieldLabel,
|
|
125
165
|
Input: TextFieldInput,
|
|
166
|
+
Prefix: TextFieldPrefix,
|
|
167
|
+
Suffix: TextFieldSuffix,
|
|
168
|
+
Action: TextFieldAction,
|
|
126
169
|
HelperText: TextFieldHelperText
|
|
127
170
|
});
|
|
128
171
|
/* harmony default export */ const base_text_field = (TextFieldRoot);
|
|
@@ -161,52 +204,130 @@ var text_field_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
161
204
|
|
|
162
205
|
|
|
163
206
|
|
|
207
|
+
|
|
208
|
+
|
|
164
209
|
var TextField = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_module_react_.forwardRef)(function (props, ref) {
|
|
165
210
|
var _a = (0,getMergedProps/* getMergedProps */.p)(props, textFieldProps),
|
|
166
211
|
className = _a.className,
|
|
167
212
|
style = _a.style,
|
|
168
213
|
leftIcon = _a.leftIcon,
|
|
169
214
|
rightIcon = _a.rightIcon,
|
|
215
|
+
prefix = _a.prefix,
|
|
216
|
+
suffix = _a.suffix,
|
|
217
|
+
format = _a.format,
|
|
218
|
+
clearable = _a.clearable,
|
|
219
|
+
onClear = _a.onClear,
|
|
220
|
+
passwordToggle = _a.passwordToggle,
|
|
221
|
+
onVisibilityChange = _a.onVisibilityChange,
|
|
170
222
|
title = _a.title,
|
|
171
223
|
value = _a.value,
|
|
172
224
|
onChange = _a.onChange,
|
|
173
225
|
defaultValue = _a.defaultValue,
|
|
174
226
|
helperText = _a.helperText,
|
|
175
227
|
isError = _a.isError,
|
|
228
|
+
type = _a.type,
|
|
229
|
+
disabled = _a.disabled,
|
|
230
|
+
readOnly = _a.readOnly,
|
|
176
231
|
_onFocus = _a.onFocus,
|
|
177
232
|
_onBlur = _a.onBlur,
|
|
178
233
|
track = _a.track,
|
|
179
234
|
trackProps = _a.trackProps,
|
|
180
|
-
restProps = text_field_rest(_a, ["className", "style", "leftIcon", "rightIcon", "title", "value", "onChange", "defaultValue", "helperText", "isError", "onFocus", "onBlur", "track", "trackProps"]);
|
|
235
|
+
restProps = text_field_rest(_a, ["className", "style", "leftIcon", "rightIcon", "prefix", "suffix", "format", "clearable", "onClear", "passwordToggle", "onVisibilityChange", "title", "value", "onChange", "defaultValue", "helperText", "isError", "type", "disabled", "readOnly", "onFocus", "onBlur", "track", "trackProps"]);
|
|
181
236
|
var emit = (0,useTrack/* useTrack */.n)('TextField', {
|
|
182
237
|
track: track,
|
|
183
238
|
trackProps: trackProps
|
|
184
239
|
});
|
|
185
240
|
var focusedValueRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_module_react_.useRef)('');
|
|
241
|
+
var _b = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_module_react_.useState)(defaultValue !== null && defaultValue !== void 0 ? defaultValue : ''),
|
|
242
|
+
innerValue = _b[0],
|
|
243
|
+
setInnerValue = _b[1];
|
|
244
|
+
var raw = value !== null && value !== void 0 ? value : innerValue;
|
|
245
|
+
var _c = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_module_react_.useState)(false),
|
|
246
|
+
passwordVisible = _c[0],
|
|
247
|
+
setPasswordVisible = _c[1];
|
|
248
|
+
var _d = (0,useFieldClear/* useFieldClear */.h)(onClear),
|
|
249
|
+
fieldRef = _d.fieldRef,
|
|
250
|
+
engaged = _d.engaged,
|
|
251
|
+
wrapperProps = _d.wrapperProps,
|
|
252
|
+
clearProps = _d.clearProps;
|
|
253
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_module_react_.useImperativeHandle)(ref, function () {
|
|
254
|
+
return fieldRef.current;
|
|
255
|
+
});
|
|
256
|
+
var handleChange = function handleChange(e) {
|
|
257
|
+
if (value === undefined) setInnerValue(e.target.value);
|
|
258
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(e);
|
|
259
|
+
};
|
|
260
|
+
var showClear = clearable && raw !== '' && engaged && !disabled && !readOnly;
|
|
261
|
+
var hasPasswordToggle = passwordToggle && type === 'password';
|
|
262
|
+
var actions = [];
|
|
263
|
+
if (showClear) {
|
|
264
|
+
actions.push(text_field_assign({
|
|
265
|
+
id: 'clear',
|
|
266
|
+
'aria-label': '입력 지우기',
|
|
267
|
+
children: (0,jsx_runtime_.jsx)(icon/* default */.A, {
|
|
268
|
+
name: 'x',
|
|
269
|
+
size: 's'
|
|
270
|
+
})
|
|
271
|
+
}, clearProps));
|
|
272
|
+
}
|
|
273
|
+
if (hasPasswordToggle) {
|
|
274
|
+
actions.push({
|
|
275
|
+
id: 'password-toggle',
|
|
276
|
+
'aria-label': passwordVisible ? '비밀번호 숨기기' : '비밀번호 보기',
|
|
277
|
+
'aria-pressed': passwordVisible,
|
|
278
|
+
disabled: disabled,
|
|
279
|
+
children: (0,jsx_runtime_.jsx)(icon/* default */.A, {
|
|
280
|
+
name: 'eye',
|
|
281
|
+
size: 's',
|
|
282
|
+
weight: passwordVisible ? 'fill' : 'regular'
|
|
283
|
+
}),
|
|
284
|
+
onClick: function onClick() {
|
|
285
|
+
setPasswordVisible(!passwordVisible);
|
|
286
|
+
onVisibilityChange === null || onVisibilityChange === void 0 ? void 0 : onVisibilityChange(!passwordVisible);
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
}
|
|
186
290
|
return (0,jsx_runtime_.jsx)(base_text_field, {
|
|
187
|
-
value:
|
|
188
|
-
|
|
189
|
-
|
|
291
|
+
value: raw,
|
|
292
|
+
format: format,
|
|
293
|
+
onChange: handleChange,
|
|
190
294
|
children: (0,jsx_runtime_.jsxs)("div", {
|
|
191
295
|
className: 'text-field',
|
|
192
296
|
children: [title && (0,jsx_runtime_.jsx)(base_text_field.Label, {
|
|
193
297
|
className: 'text-field-title',
|
|
194
298
|
text: title
|
|
195
|
-
}), (0,jsx_runtime_.jsxs)("div", {
|
|
196
|
-
className: (0,classNames/* classNames */.x)('nuri-theme text-field-input-wrapper', className),
|
|
197
|
-
style: style
|
|
198
|
-
|
|
199
|
-
|
|
299
|
+
}), (0,jsx_runtime_.jsxs)("div", text_field_assign({
|
|
300
|
+
className: (0,classNames/* classNames */.x)('nuri-theme text-field-input-wrapper', isError && 'error', className),
|
|
301
|
+
style: style
|
|
302
|
+
}, wrapperProps, {
|
|
303
|
+
children: [leftIcon, prefix != null && (0,jsx_runtime_.jsx)(base_text_field.Prefix, {
|
|
304
|
+
className: 'text-field-prefix',
|
|
305
|
+
children: prefix
|
|
306
|
+
}), (0,jsx_runtime_.jsx)(base_text_field.Input, text_field_assign({
|
|
307
|
+
ref: fieldRef,
|
|
308
|
+
type: hasPasswordToggle && passwordVisible ? 'text' : type,
|
|
309
|
+
disabled: disabled,
|
|
310
|
+
readOnly: readOnly,
|
|
311
|
+
"aria-invalid": isError || undefined,
|
|
200
312
|
onFocus: function onFocus(e) {
|
|
201
|
-
focusedValueRef.current =
|
|
313
|
+
focusedValueRef.current = raw;
|
|
202
314
|
_onFocus === null || _onFocus === void 0 ? void 0 : _onFocus(e);
|
|
203
315
|
},
|
|
204
316
|
onBlur: function onBlur(e) {
|
|
205
|
-
if (
|
|
317
|
+
if (raw !== focusedValueRef.current) emit('change');
|
|
206
318
|
_onBlur === null || _onBlur === void 0 ? void 0 : _onBlur(e);
|
|
207
319
|
}
|
|
208
|
-
}, restProps)),
|
|
209
|
-
|
|
320
|
+
}, restProps)), suffix != null && (0,jsx_runtime_.jsx)(base_text_field.Suffix, {
|
|
321
|
+
className: 'text-field-suffix',
|
|
322
|
+
children: suffix
|
|
323
|
+
}), actions.map(function (_a) {
|
|
324
|
+
var id = _a.id,
|
|
325
|
+
action = text_field_rest(_a, ["id"]);
|
|
326
|
+
return (0,jsx_runtime_.jsx)(base_text_field.Action, text_field_assign({
|
|
327
|
+
className: 'text-field-action motion-press'
|
|
328
|
+
}, action), id);
|
|
329
|
+
}), rightIcon]
|
|
330
|
+
})), helperText && (0,jsx_runtime_.jsx)(base_text_field.HelperText, {
|
|
210
331
|
className: (0,classNames/* classNames */.x)('text-field-helper-text', isError && 'error'),
|
|
211
332
|
text: helperText
|
|
212
333
|
})]
|
|
@@ -225,7 +346,7 @@ var x = (y) => {
|
|
|
225
346
|
var x = {}; __nuri_require__.d(x, y); return x
|
|
226
347
|
}
|
|
227
348
|
var y = (x) => (() => (x))
|
|
228
|
-
module.exports = x({ ["createContext"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.createContext), ["forwardRef"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.forwardRef), ["useCallback"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useCallback), ["useContext"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useContext), ["useRef"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useRef), ["useState"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useState) });
|
|
349
|
+
module.exports = x({ ["createContext"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.createContext), ["forwardRef"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.forwardRef), ["useCallback"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useCallback), ["useContext"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useContext), ["useImperativeHandle"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useImperativeHandle), ["useRef"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useRef), ["useState"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useState) });
|
|
229
350
|
|
|
230
351
|
/***/ },
|
|
231
352
|
|
|
@@ -376,17 +497,23 @@ module.exports = x({ ["jsx"]: () => (__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime
|
|
|
376
497
|
/******/ __nuri_require__.C(__webpack_chunk_2__);
|
|
377
498
|
/******/ import * as __webpack_chunk_3__ from "./chunk-4560.js";
|
|
378
499
|
/******/ __nuri_require__.C(__webpack_chunk_3__);
|
|
379
|
-
/******/ import * as __webpack_chunk_4__ from "./chunk-
|
|
500
|
+
/******/ import * as __webpack_chunk_4__ from "./chunk-7653.js";
|
|
380
501
|
/******/ __nuri_require__.C(__webpack_chunk_4__);
|
|
381
|
-
/******/ import * as __webpack_chunk_5__ from "./chunk-
|
|
502
|
+
/******/ import * as __webpack_chunk_5__ from "./chunk-3547.js";
|
|
382
503
|
/******/ __nuri_require__.C(__webpack_chunk_5__);
|
|
383
|
-
/******/ import * as __webpack_chunk_6__ from "./chunk-
|
|
504
|
+
/******/ import * as __webpack_chunk_6__ from "./chunk-4917.js";
|
|
384
505
|
/******/ __nuri_require__.C(__webpack_chunk_6__);
|
|
506
|
+
/******/ import * as __webpack_chunk_7__ from "./chunk-4558.js";
|
|
507
|
+
/******/ __nuri_require__.C(__webpack_chunk_7__);
|
|
508
|
+
/******/ import * as __webpack_chunk_8__ from "./chunk-7739.js";
|
|
509
|
+
/******/ __nuri_require__.C(__webpack_chunk_8__);
|
|
510
|
+
/******/ import * as __webpack_chunk_9__ from "./chunk-7302.js";
|
|
511
|
+
/******/ __nuri_require__.C(__webpack_chunk_9__);
|
|
385
512
|
/******/
|
|
386
513
|
/******/ // startup
|
|
387
514
|
/******/ // Load entry module and return exports
|
|
388
515
|
/******/ // This entry module depends on other loaded chunks and execution need to be delayed
|
|
389
|
-
/******/ var __webpack_exports__ = __nuri_require__.O(undefined, [3274,7335,4560,4917,4558,7739], () => (__nuri_require__(295)))
|
|
516
|
+
/******/ var __webpack_exports__ = __nuri_require__.O(undefined, [3274,7335,4560,7653,3547,4917,4558,7739,7302], () => (__nuri_require__(295)))
|
|
390
517
|
/******/ __webpack_exports__ = __nuri_require__.O(__webpack_exports__);
|
|
391
518
|
/******/ const __webpack_exports__default = __webpack_exports__.A;
|
|
392
519
|
/******/ export { __webpack_exports__default as default };
|