@nurimedia/react-ui 0.1.1 → 0.1.2

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 (97) hide show
  1. package/dist/AlertDialog/index.cjs +4 -181
  2. package/dist/AlertDialog/index.cjs.map +1 -1
  3. package/dist/AlertDialog/index.js +4 -145
  4. package/dist/AlertDialog/index.js.map +1 -1
  5. package/dist/Button/index.cjs +4 -132
  6. package/dist/Button/index.cjs.map +1 -1
  7. package/dist/Button/index.js +4 -106
  8. package/dist/Button/index.js.map +1 -1
  9. package/dist/Checkbox/index.cjs +4 -79
  10. package/dist/Checkbox/index.cjs.map +1 -1
  11. package/dist/Checkbox/index.js +4 -43
  12. package/dist/Checkbox/index.js.map +1 -1
  13. package/dist/Input/index.cjs +4 -99
  14. package/dist/Input/index.cjs.map +1 -1
  15. package/dist/Input/index.js +4 -73
  16. package/dist/Input/index.js.map +1 -1
  17. package/dist/Modal/index.cjs +4 -116
  18. package/dist/Modal/index.cjs.map +1 -1
  19. package/dist/Modal/index.js +4 -80
  20. package/dist/Modal/index.js.map +1 -1
  21. package/dist/Radio/index.cjs +6 -82
  22. package/dist/Radio/index.cjs.map +1 -1
  23. package/dist/Radio/index.js +5 -44
  24. package/dist/Radio/index.js.map +1 -1
  25. package/dist/Select/index.cjs +4 -112
  26. package/dist/Select/index.cjs.map +1 -1
  27. package/dist/Select/index.js +4 -76
  28. package/dist/Select/index.js.map +1 -1
  29. package/dist/Switch/index.cjs +4 -67
  30. package/dist/Switch/index.cjs.map +1 -1
  31. package/dist/Switch/index.js +4 -31
  32. package/dist/Switch/index.js.map +1 -1
  33. package/dist/Textarea/index.cjs +4 -123
  34. package/dist/Textarea/index.cjs.map +1 -1
  35. package/dist/Textarea/index.js +4 -97
  36. package/dist/Textarea/index.js.map +1 -1
  37. package/dist/Toast/index.cjs +4 -178
  38. package/dist/Toast/index.cjs.map +1 -1
  39. package/dist/Toast/index.js +5 -142
  40. package/dist/Toast/index.js.map +1 -1
  41. package/dist/Tooltip/index.cjs +6 -101
  42. package/dist/Tooltip/index.cjs.map +1 -1
  43. package/dist/Tooltip/index.js +5 -63
  44. package/dist/Tooltip/index.js.map +1 -1
  45. package/dist/chunk-2LFW4MM6.cjs +47 -0
  46. package/dist/chunk-2LFW4MM6.cjs.map +1 -0
  47. package/dist/chunk-2WKLA5RC.cjs +82 -0
  48. package/dist/chunk-2WKLA5RC.cjs.map +1 -0
  49. package/dist/chunk-2YGYLCCA.js +66 -0
  50. package/dist/chunk-2YGYLCCA.js.map +1 -0
  51. package/dist/chunk-323VGYMK.cjs +147 -0
  52. package/dist/chunk-323VGYMK.cjs.map +1 -0
  53. package/dist/chunk-3H47QMKS.js +47 -0
  54. package/dist/chunk-3H47QMKS.js.map +1 -0
  55. package/dist/chunk-3QSLHLC2.cjs +45 -0
  56. package/dist/chunk-3QSLHLC2.cjs.map +1 -0
  57. package/dist/chunk-4N5JIGIU.js +82 -0
  58. package/dist/chunk-4N5JIGIU.js.map +1 -0
  59. package/dist/chunk-DTGPVOJK.js +99 -0
  60. package/dist/chunk-DTGPVOJK.js.map +1 -0
  61. package/dist/chunk-DTQE42F7.js +33 -0
  62. package/dist/chunk-DTQE42F7.js.map +1 -0
  63. package/dist/chunk-DYO4PIBB.js +75 -0
  64. package/dist/chunk-DYO4PIBB.js.map +1 -0
  65. package/dist/chunk-GBMYANHH.js +149 -0
  66. package/dist/chunk-GBMYANHH.js.map +1 -0
  67. package/dist/chunk-I7KJ7WTN.cjs +149 -0
  68. package/dist/chunk-I7KJ7WTN.cjs.map +1 -0
  69. package/dist/chunk-JM4HDCLU.cjs +110 -0
  70. package/dist/chunk-JM4HDCLU.cjs.map +1 -0
  71. package/dist/chunk-JXJ6G634.cjs +75 -0
  72. package/dist/chunk-JXJ6G634.cjs.map +1 -0
  73. package/dist/chunk-LAPTEQ5N.js +45 -0
  74. package/dist/chunk-LAPTEQ5N.js.map +1 -0
  75. package/dist/chunk-LRATCHCB.cjs +66 -0
  76. package/dist/chunk-LRATCHCB.cjs.map +1 -0
  77. package/dist/chunk-OM4QMC4F.js +110 -0
  78. package/dist/chunk-OM4QMC4F.js.map +1 -0
  79. package/dist/chunk-PAXRFQUJ.cjs +33 -0
  80. package/dist/chunk-PAXRFQUJ.cjs.map +1 -0
  81. package/dist/chunk-PC3B67B4.cjs +78 -0
  82. package/dist/chunk-PC3B67B4.cjs.map +1 -0
  83. package/dist/chunk-PS6QXS5Z.js +11 -0
  84. package/dist/chunk-PS6QXS5Z.js.map +1 -0
  85. package/dist/chunk-Q26BJSLP.cjs +99 -0
  86. package/dist/chunk-Q26BJSLP.cjs.map +1 -0
  87. package/dist/chunk-R4E4BIPC.cjs +11 -0
  88. package/dist/chunk-R4E4BIPC.cjs.map +1 -0
  89. package/dist/chunk-R757N7RU.js +78 -0
  90. package/dist/chunk-R757N7RU.js.map +1 -0
  91. package/dist/chunk-RC773ZEY.js +147 -0
  92. package/dist/chunk-RC773ZEY.js.map +1 -0
  93. package/dist/index.cjs +54 -900
  94. package/dist/index.cjs.map +1 -1
  95. package/dist/index.js +37 -834
  96. package/dist/index.js.map +1 -1
  97. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,838 +1,41 @@
1
1
  'use client';
2
-
3
- // src/Button/Button.tsx
4
- import "./Button/styles.css";
5
- import { Slot } from "@radix-ui/react-slot";
6
- import { Children, cloneElement, forwardRef, isValidElement } from "react";
7
-
8
- // src/Button/Spinner.tsx
9
- import { jsx, jsxs } from "react/jsx-runtime";
10
- var Spinner = () => /* @__PURE__ */ jsx("span", { className: "nuri-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ jsxs("svg", { className: "nuri-button__spinner", viewBox: "0 0 16 16", width: "16", height: "16", fill: "none", children: [
11
- /* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "6", stroke: "currentColor", strokeOpacity: "0.25", strokeWidth: "2" }),
12
- /* @__PURE__ */ jsx("path", { d: "M14 8a6 6 0 0 0-6-6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })
13
- ] }) });
14
-
15
- // src/utils/cx.ts
16
- function cx(...classes) {
17
- return classes.filter(Boolean).join(" ");
18
- }
19
-
20
- // src/Button/Button.tsx
21
- import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
22
- var Button = forwardRef(function Button2({
23
- variant = "primary",
24
- size = "md",
25
- iconLeft,
26
- iconRight,
27
- iconOnly = false,
28
- block = false,
29
- loading = false,
30
- disabled = false,
31
- asChild = false,
32
- type = "button",
33
- className,
34
- children,
35
- onClick,
36
- ...rest
37
- }, ref) {
38
- const isBlocked = disabled || loading;
39
- if (process.env.NODE_ENV !== "production" && iconOnly && !rest["aria-label"] && !rest["aria-labelledby"]) {
40
- console.warn(
41
- "[nuri/Button] `iconOnly` \uBC84\uD2BC\uC740 `aria-label`(\uB610\uB294 `aria-labelledby`)\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."
42
- );
43
- }
44
- const hasLeftSlot = !iconOnly && (loading || iconLeft != null);
45
- const hasRightSlot = !iconOnly && !loading && iconRight != null;
46
- const classes = cx(
47
- "nuri-button",
48
- `nuri-button--${variant}`,
49
- `nuri-button--${size}`,
50
- block && "nuri-button--block",
51
- iconOnly && "nuri-button--icon-only",
52
- isBlocked && "nuri-button--disabled",
53
- loading && "nuri-button--loading",
54
- hasLeftSlot && "nuri-button--has-left",
55
- hasRightSlot && "nuri-button--has-right",
56
- className
57
- );
58
- const handleClick = (e) => {
59
- if (isBlocked) {
60
- e.preventDefault();
61
- e.stopPropagation();
62
- return;
63
- }
64
- onClick?.(e);
65
- };
66
- const renderContent = (content) => {
67
- if (iconOnly) {
68
- return /* @__PURE__ */ jsx2("span", { className: "nuri-button__icon", "aria-hidden": "true", children: loading ? /* @__PURE__ */ jsx2(Spinner, {}) : content });
69
- }
70
- return /* @__PURE__ */ jsxs2(Fragment, { children: [
71
- loading ? /* @__PURE__ */ jsx2(Spinner, {}) : iconLeft != null && /* @__PURE__ */ jsx2("span", { className: "nuri-button__icon nuri-button__icon--left", "aria-hidden": "true", children: iconLeft }),
72
- content,
73
- hasRightSlot && /* @__PURE__ */ jsx2("span", { className: "nuri-button__icon nuri-button__icon--right", "aria-hidden": "true", children: iconRight })
74
- ] });
75
- };
76
- if (asChild) {
77
- const child = Children.only(children);
78
- if (!isValidElement(child)) return null;
79
- const childElement = child;
80
- return /* @__PURE__ */ jsx2(
81
- Slot,
82
- {
83
- ref,
84
- className: classes,
85
- "aria-disabled": isBlocked || void 0,
86
- "aria-busy": loading || void 0,
87
- onClick: handleClick,
88
- ...rest,
89
- children: cloneElement(childElement, void 0, renderContent(childElement.props.children))
90
- }
91
- );
92
- }
93
- return /* @__PURE__ */ jsx2(
94
- "button",
95
- {
96
- ref,
97
- type,
98
- className: classes,
99
- disabled,
100
- "aria-disabled": loading || void 0,
101
- "aria-busy": loading || void 0,
102
- onClick: handleClick,
103
- ...rest,
104
- children: renderContent(children)
105
- }
106
- );
107
- });
108
-
109
- // src/Input/Input.tsx
110
- import "./Input/styles.css";
111
- import { forwardRef as forwardRef2, useId } from "react";
112
- import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
113
- var Input = forwardRef2(function Input2({
114
- size = "md",
115
- label,
116
- hideLabel = false,
117
- description,
118
- invalid = false,
119
- errorMessage,
120
- iconLeft,
121
- iconRight,
122
- block = false,
123
- disabled = false,
124
- className,
125
- id: idProp,
126
- "aria-describedby": ariaDescribedby,
127
- ...rest
128
- }, ref) {
129
- const reactId = useId();
130
- const id = idProp ?? `nuri-input-${reactId}`;
131
- const messageId = `${id}-message`;
132
- const message = invalid && errorMessage != null ? errorMessage : description;
133
- const hasMessage = message != null;
134
- const describedBy = cx(hasMessage ? messageId : void 0, ariaDescribedby) || void 0;
135
- return /* @__PURE__ */ jsxs3("div", { className: cx("nuri-input", block && "nuri-input--block", className), children: [
136
- label != null && /* @__PURE__ */ jsx3("label", { htmlFor: id, className: cx("nuri-input__label", hideLabel && "nuri-sr-only"), children: label }),
137
- /* @__PURE__ */ jsxs3(
138
- "div",
139
- {
140
- className: cx(
141
- "nuri-input__field",
142
- `nuri-input__field--${size}`,
143
- invalid && "nuri-input__field--invalid",
144
- disabled && "nuri-input__field--disabled"
145
- ),
146
- children: [
147
- iconLeft != null && /* @__PURE__ */ jsx3("span", { className: "nuri-input__icon", "aria-hidden": "true", children: iconLeft }),
148
- /* @__PURE__ */ jsx3(
149
- "input",
150
- {
151
- ref,
152
- id,
153
- className: "nuri-input__control",
154
- disabled,
155
- "aria-invalid": invalid || void 0,
156
- "aria-describedby": describedBy,
157
- ...rest
158
- }
159
- ),
160
- iconRight != null && /* @__PURE__ */ jsx3("span", { className: "nuri-input__icon", "aria-hidden": "true", children: iconRight })
161
- ]
162
- }
163
- ),
164
- hasMessage && /* @__PURE__ */ jsx3(
165
- "p",
166
- {
167
- id: messageId,
168
- className: cx("nuri-input__message", invalid && "nuri-input__message--error"),
169
- children: message
170
- }
171
- )
172
- ] });
173
- });
174
-
175
- // src/Textarea/Textarea.tsx
176
- import "./Textarea/styles.css";
177
- import { forwardRef as forwardRef3, useCallback, useId as useId2, useLayoutEffect, useRef } from "react";
178
- import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
179
- var Textarea = forwardRef3(function Textarea2({
180
- label,
181
- hideLabel = false,
182
- description,
183
- invalid = false,
184
- errorMessage,
185
- block = false,
186
- resize = "vertical",
187
- autosize = false,
188
- maxRows,
189
- rows = 3,
190
- disabled = false,
191
- className,
192
- id: idProp,
193
- value,
194
- onChange,
195
- "aria-describedby": ariaDescribedby,
196
- ...rest
197
- }, ref) {
198
- const reactId = useId2();
199
- const id = idProp ?? `nuri-textarea-${reactId}`;
200
- const messageId = `${id}-message`;
201
- const innerRef = useRef(null);
202
- const setRefs = useCallback(
203
- (node) => {
204
- innerRef.current = node;
205
- if (typeof ref === "function") ref(node);
206
- else if (ref) ref.current = node;
207
- },
208
- [ref]
209
- );
210
- const fitHeight = useCallback(() => {
211
- const el = innerRef.current;
212
- if (!el) return;
213
- const cs = getComputedStyle(el);
214
- const borders = parseFloat(cs.borderTopWidth) + parseFloat(cs.borderBottomWidth);
215
- const lineHeight = parseFloat(cs.lineHeight);
216
- const maxHeight = maxRows != null && !Number.isNaN(lineHeight) ? maxRows * lineHeight + parseFloat(cs.paddingTop) + parseFloat(cs.paddingBottom) + borders : Infinity;
217
- el.style.height = "auto";
218
- const contentHeight = el.scrollHeight + borders;
219
- const next = Math.min(contentHeight, maxHeight);
220
- if (!Number.isNaN(next)) el.style.height = `${next}px`;
221
- el.style.overflowY = contentHeight > maxHeight ? "auto" : "hidden";
222
- }, [maxRows]);
223
- useLayoutEffect(() => {
224
- if (autosize) fitHeight();
225
- }, [autosize, fitHeight, value]);
226
- const handleChange = (e) => {
227
- onChange?.(e);
228
- if (autosize) fitHeight();
229
- };
230
- const message = invalid && errorMessage != null ? errorMessage : description;
231
- const hasMessage = message != null;
232
- const describedBy = cx(hasMessage ? messageId : void 0, ariaDescribedby) || void 0;
233
- return /* @__PURE__ */ jsxs4("div", { className: cx("nuri-textarea", block && "nuri-textarea--block", className), children: [
234
- label != null && /* @__PURE__ */ jsx4("label", { htmlFor: id, className: cx("nuri-textarea__label", hideLabel && "nuri-sr-only"), children: label }),
235
- /* @__PURE__ */ jsx4(
236
- "textarea",
237
- {
238
- ref: setRefs,
239
- id,
240
- rows,
241
- value,
242
- onChange: handleChange,
243
- className: cx(
244
- "nuri-textarea__control",
245
- invalid && "nuri-textarea__control--invalid",
246
- (resize === "none" || autosize) && "nuri-textarea__control--resize-none"
247
- ),
248
- disabled,
249
- "aria-invalid": invalid || void 0,
250
- "aria-describedby": describedBy,
251
- ...rest
252
- }
253
- ),
254
- hasMessage && /* @__PURE__ */ jsx4(
255
- "p",
256
- {
257
- id: messageId,
258
- className: cx("nuri-textarea__message", invalid && "nuri-textarea__message--error"),
259
- children: message
260
- }
261
- )
262
- ] });
263
- });
264
-
265
- // src/Checkbox/Checkbox.tsx
266
- import "./Checkbox/styles.css";
267
- import * as RadixCheckbox from "@radix-ui/react-checkbox";
268
- import { forwardRef as forwardRef4, useId as useId3 } from "react";
269
- import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
270
- var CheckIcon = () => /* @__PURE__ */ jsx5("svg", { viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx5(
271
- "path",
272
- {
273
- d: "M2.5 6.2l2.4 2.4 4.6-5",
274
- stroke: "currentColor",
275
- strokeWidth: "1.6",
276
- strokeLinecap: "round",
277
- strokeLinejoin: "round"
278
- }
279
- ) });
280
- var IndeterminateIcon = () => /* @__PURE__ */ jsx5("svg", { viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx5("path", { d: "M2.8 6h6.4", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round" }) });
281
- var Checkbox = forwardRef4(function Checkbox2({ label, size = "md", disabled = false, id: idProp, className, checked, ...rest }, ref) {
282
- const reactId = useId3();
283
- const id = idProp ?? `nuri-checkbox-${reactId}`;
284
- return /* @__PURE__ */ jsxs5("div", { className: cx("nuri-checkbox", `nuri-checkbox--${size}`, className), children: [
285
- /* @__PURE__ */ jsx5(
286
- RadixCheckbox.Root,
287
- {
288
- ref,
289
- id,
290
- className: "nuri-checkbox__control",
291
- disabled,
292
- checked,
293
- ...rest,
294
- children: /* @__PURE__ */ jsx5(RadixCheckbox.Indicator, { className: "nuri-checkbox__indicator", children: checked === "indeterminate" ? /* @__PURE__ */ jsx5(IndeterminateIcon, {}) : /* @__PURE__ */ jsx5(CheckIcon, {}) })
295
- }
296
- ),
297
- label != null && /* @__PURE__ */ jsx5("label", { htmlFor: id, className: "nuri-checkbox__label", children: label })
298
- ] });
299
- });
300
-
301
- // src/Radio/Radio.tsx
302
- import "./Radio/styles.css";
303
- import * as RadixRadioGroup from "@radix-ui/react-radio-group";
304
- import { forwardRef as forwardRef5, useId as useId4 } from "react";
305
- import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
306
- var RadioGroup = forwardRef5(function RadioGroup2({ children, orientation = "vertical", className, ...rest }, ref) {
307
- return /* @__PURE__ */ jsx6(
308
- RadixRadioGroup.Root,
309
- {
310
- ref,
311
- orientation,
312
- className: cx("nuri-radio-group", `nuri-radio-group--${orientation}`, className),
313
- ...rest,
314
- children
315
- }
316
- );
317
- });
318
- var Radio = forwardRef5(function Radio2({ value, label, disabled = false, id: idProp, className, ...rest }, ref) {
319
- const reactId = useId4();
320
- const id = idProp ?? `nuri-radio-${reactId}`;
321
- return /* @__PURE__ */ jsxs6("div", { className: cx("nuri-radio", className), children: [
322
- /* @__PURE__ */ jsx6(
323
- RadixRadioGroup.Item,
324
- {
325
- ref,
326
- id,
327
- value,
328
- disabled,
329
- className: "nuri-radio__control",
330
- ...rest,
331
- children: /* @__PURE__ */ jsx6(RadixRadioGroup.Indicator, { className: "nuri-radio__indicator" })
332
- }
333
- ),
334
- label != null && /* @__PURE__ */ jsx6("label", { htmlFor: id, className: "nuri-radio__label", children: label })
335
- ] });
336
- });
337
-
338
- // src/Switch/Switch.tsx
339
- import "./Switch/styles.css";
340
- import * as RadixSwitch from "@radix-ui/react-switch";
341
- import { forwardRef as forwardRef6, useId as useId5 } from "react";
342
- import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
343
- var Switch = forwardRef6(function Switch2({ label, disabled = false, id: idProp, className, ...rest }, ref) {
344
- const reactId = useId5();
345
- const id = idProp ?? `nuri-switch-${reactId}`;
346
- return /* @__PURE__ */ jsxs7("div", { className: cx("nuri-switch", className), children: [
347
- /* @__PURE__ */ jsx7(
348
- RadixSwitch.Root,
349
- {
350
- ref,
351
- id,
352
- className: "nuri-switch__control",
353
- disabled,
354
- ...rest,
355
- children: /* @__PURE__ */ jsx7(RadixSwitch.Thumb, { className: "nuri-switch__thumb" })
356
- }
357
- ),
358
- label != null && /* @__PURE__ */ jsx7("label", { htmlFor: id, className: "nuri-switch__label", children: label })
359
- ] });
360
- });
361
-
362
- // src/Select/Select.tsx
363
- import "./Select/styles.css";
364
- import * as RadixSelect from "@radix-ui/react-select";
365
- import { forwardRef as forwardRef7 } from "react";
366
- import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
367
- var CaretIcon = () => /* @__PURE__ */ jsx8("svg", { width: "8", height: "8", viewBox: "0 0 8 8", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx8("path", { d: "M1.1 2.5h5.8L4 5.9z", fill: "currentColor" }) });
368
- var Select = forwardRef7(function Select2({
369
- options,
370
- size = "md",
371
- placeholder,
372
- value,
373
- defaultValue,
374
- onValueChange,
375
- open,
376
- defaultOpen,
377
- onOpenChange,
378
- disabled = false,
379
- block = false,
380
- name,
381
- required,
382
- container,
383
- className,
384
- "aria-label": ariaLabel
385
- }, ref) {
386
- return /* @__PURE__ */ jsxs8(
387
- RadixSelect.Root,
388
- {
389
- value,
390
- defaultValue,
391
- onValueChange,
392
- open,
393
- defaultOpen,
394
- onOpenChange,
395
- disabled,
396
- name,
397
- required,
398
- children: [
399
- /* @__PURE__ */ jsxs8(
400
- RadixSelect.Trigger,
401
- {
402
- ref,
403
- "aria-label": ariaLabel,
404
- className: cx(
405
- "nuri-select__trigger",
406
- `nuri-select__trigger--${size}`,
407
- block && "nuri-select__trigger--block",
408
- className
409
- ),
410
- children: [
411
- /* @__PURE__ */ jsx8("span", { className: "nuri-select__value", children: /* @__PURE__ */ jsx8(RadixSelect.Value, { placeholder }) }),
412
- /* @__PURE__ */ jsx8(RadixSelect.Icon, { className: "nuri-select__caret", children: /* @__PURE__ */ jsx8(CaretIcon, {}) })
413
- ]
414
- }
415
- ),
416
- /* @__PURE__ */ jsx8(RadixSelect.Portal, { container, children: /* @__PURE__ */ jsx8(RadixSelect.Content, { className: "nuri-select__content", position: "popper", sideOffset: 6, children: /* @__PURE__ */ jsx8(RadixSelect.Viewport, { className: "nuri-select__viewport", children: options.map((option) => /* @__PURE__ */ jsx8(
417
- RadixSelect.Item,
418
- {
419
- value: option.value,
420
- disabled: option.disabled,
421
- className: "nuri-select__item",
422
- children: /* @__PURE__ */ jsx8(RadixSelect.ItemText, { children: option.label })
423
- },
424
- option.value
425
- )) }) }) })
426
- ]
427
- }
428
- );
429
- });
430
-
431
- // src/Modal/Modal.tsx
432
- import "./Modal/styles.css";
433
- import * as Dialog from "@radix-ui/react-dialog";
434
- import { forwardRef as forwardRef8 } from "react";
435
- import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
436
- var Root6 = (props) => /* @__PURE__ */ jsx9(Dialog.Root, { ...props });
437
- Root6.displayName = "Modal";
438
- var Trigger3 = Dialog.Trigger;
439
- var Content3 = forwardRef8(
440
- function ModalContent({ placement = "center", size = "md", overlay = true, container, className, children, ...rest }, ref) {
441
- const classes = cx("nuri-modal", `nuri-modal--${placement}`, `nuri-modal--${size}`, className);
442
- return /* @__PURE__ */ jsxs9(Dialog.Portal, { container, children: [
443
- overlay && /* @__PURE__ */ jsx9(Dialog.Overlay, { className: "nuri-modal__overlay" }),
444
- /* @__PURE__ */ jsx9(Dialog.Content, { ref, className: classes, ...rest, children })
445
- ] });
446
- }
447
- );
448
- var Header = forwardRef8(function ModalHeader({ className, ...rest }, ref) {
449
- return /* @__PURE__ */ jsx9("div", { ref, className: cx("nuri-modal__header", className), ...rest });
450
- });
451
- var Title2 = forwardRef8(function ModalTitle({ visuallyHidden = false, className, ...rest }, ref) {
452
- return /* @__PURE__ */ jsx9(
453
- Dialog.Title,
454
- {
455
- ref,
456
- className: cx("nuri-modal__title", visuallyHidden && "nuri-sr-only", className),
457
- ...rest
458
- }
459
- );
460
- });
461
- var Description2 = forwardRef8(function ModalDescription({ className, ...rest }, ref) {
462
- return /* @__PURE__ */ jsx9(Dialog.Description, { ref, className: cx("nuri-modal__description", className), ...rest });
463
- });
464
- var Body = forwardRef8(function ModalBody({ className, ...rest }, ref) {
465
- return /* @__PURE__ */ jsx9("div", { ref, className: cx("nuri-modal__body", className), ...rest });
466
- });
467
- var Footer = forwardRef8(function ModalFooter({ align = "end", className, ...rest }, ref) {
468
- return /* @__PURE__ */ jsx9(
469
- "div",
470
- {
471
- ref,
472
- className: cx("nuri-modal__footer", `nuri-modal__footer--${align}`, className),
473
- ...rest
474
- }
475
- );
476
- });
477
- var Close2 = Dialog.Close;
478
- var CloseIcon = () => /* @__PURE__ */ jsx9("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx9("path", { d: "M5 5l10 10M15 5L5 15", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) });
479
- var CloseButton = forwardRef8(function ModalCloseButton({ className, "aria-label": ariaLabel = "\uB2EB\uAE30", children, ...rest }, ref) {
480
- return /* @__PURE__ */ jsx9(Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsx9(
481
- "button",
482
- {
483
- ref,
484
- type: "button",
485
- "aria-label": ariaLabel,
486
- className: cx("nuri-modal__close", className),
487
- ...rest,
488
- children: children ?? /* @__PURE__ */ jsx9(CloseIcon, {})
489
- }
490
- ) });
491
- });
492
- var Modal = Object.assign(Root6, {
493
- Trigger: Trigger3,
494
- Content: Content3,
495
- Header,
496
- Title: Title2,
497
- Description: Description2,
498
- Body,
499
- Footer,
500
- Close: Close2,
501
- CloseButton
502
- });
503
-
504
- // src/AlertDialog/AlertDialog.tsx
505
- import "./AlertDialog/styles.css";
506
- import * as Alert from "@radix-ui/react-alert-dialog";
507
- import { forwardRef as forwardRef9 } from "react";
508
-
509
- // src/AlertDialog/icons.tsx
510
- import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
511
- var SuccessIcon = () => /* @__PURE__ */ jsxs10("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
512
- /* @__PURE__ */ jsx10("circle", { cx: "12", cy: "12", r: "12", fill: "var(--nuri-alert-tone-success-bg)" }),
513
- /* @__PURE__ */ jsx10(
514
- "path",
515
- {
516
- d: "M15.77 9.58L10.65 14.70L8.90 12.95",
517
- stroke: "var(--nuri-alert-tone-success-fg)",
518
- strokeWidth: "2.5",
519
- strokeLinecap: "round",
520
- strokeLinejoin: "round"
521
- }
522
- )
523
- ] });
524
- var WarningIcon = () => /* @__PURE__ */ jsxs10("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
525
- /* @__PURE__ */ jsx10("circle", { cx: "12", cy: "12", r: "12", fill: "var(--nuri-alert-tone-warning-bg)" }),
526
- /* @__PURE__ */ jsx10(
527
- "path",
528
- {
529
- d: "M12 6.75V12",
530
- stroke: "var(--nuri-alert-tone-warning-fg)",
531
- strokeWidth: "2.5",
532
- strokeLinecap: "round"
533
- }
534
- ),
535
- /* @__PURE__ */ jsx10("circle", { cx: "12", cy: "16.31", r: "1.1", fill: "var(--nuri-alert-tone-warning-fg)" })
536
- ] });
537
- var InfoIcon = () => /* @__PURE__ */ jsxs10("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
538
- /* @__PURE__ */ jsx10("circle", { cx: "12", cy: "12", r: "12", fill: "var(--nuri-alert-tone-info-bg)" }),
539
- /* @__PURE__ */ jsx10(
540
- "path",
541
- {
542
- d: "M12.25 7h0.01",
543
- stroke: "var(--nuri-alert-tone-info-fg)",
544
- strokeWidth: "3",
545
- strokeLinecap: "round",
546
- strokeLinejoin: "round"
547
- }
548
- ),
549
- /* @__PURE__ */ jsx10(
550
- "path",
551
- {
552
- d: "M11 12h1.25v5h1.25",
553
- stroke: "var(--nuri-alert-tone-info-fg)",
554
- strokeWidth: "2.5",
555
- strokeLinecap: "round",
556
- strokeLinejoin: "round"
557
- }
558
- )
559
- ] });
560
- var defaultToneIcon = {
561
- info: /* @__PURE__ */ jsx10(InfoIcon, {}),
562
- success: /* @__PURE__ */ jsx10(SuccessIcon, {}),
563
- warning: /* @__PURE__ */ jsx10(WarningIcon, {})
564
- };
565
-
566
- // src/AlertDialog/AlertDialog.tsx
567
- import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
568
- var Root8 = (props) => /* @__PURE__ */ jsx11(Alert.Root, { ...props });
569
- Root8.displayName = "AlertDialog";
570
- var Trigger5 = Alert.Trigger;
571
- var Content5 = forwardRef9(
572
- function AlertDialogContent({ tone = "info", icon, overlay = true, container, className, children, ...rest }, ref) {
573
- const resolvedIcon = icon === void 0 ? defaultToneIcon[tone] : icon;
574
- return /* @__PURE__ */ jsxs11(Alert.Portal, { container, children: [
575
- overlay && /* @__PURE__ */ jsx11(Alert.Overlay, { className: "nuri-alert__overlay" }),
576
- /* @__PURE__ */ jsxs11(
577
- Alert.Content,
578
- {
579
- ref,
580
- className: cx("nuri-alert", `nuri-alert--${tone}`, className),
581
- ...rest,
582
- children: [
583
- resolvedIcon != null && /* @__PURE__ */ jsx11("div", { className: "nuri-alert__icon", "aria-hidden": "true", children: resolvedIcon }),
584
- children
585
- ]
586
- }
587
- )
588
- ] });
589
- }
590
- );
591
- var Header2 = forwardRef9(
592
- function AlertDialogHeader({ className, ...rest }, ref) {
593
- return /* @__PURE__ */ jsx11("div", { ref, className: cx("nuri-alert__header", className), ...rest });
594
- }
595
- );
596
- var Title4 = forwardRef9(function AlertDialogTitle({ className, ...rest }, ref) {
597
- return /* @__PURE__ */ jsx11(Alert.Title, { ref, className: cx("nuri-alert__title", className), ...rest });
598
- });
599
- var Description4 = forwardRef9(function AlertDialogDescription({ className, ...rest }, ref) {
600
- return /* @__PURE__ */ jsx11(Alert.Description, { ref, className: cx("nuri-alert__description", className), ...rest });
601
- });
602
- var Body2 = forwardRef9(function AlertDialogBody({ className, ...rest }, ref) {
603
- return /* @__PURE__ */ jsx11("div", { ref, className: cx("nuri-alert__body", className), ...rest });
604
- });
605
- var Footer2 = forwardRef9(function AlertDialogFooter({ align = "full", className, ...rest }, ref) {
606
- return /* @__PURE__ */ jsx11(
607
- "div",
608
- {
609
- ref,
610
- className: cx("nuri-alert__footer", `nuri-alert__footer--${align}`, className),
611
- ...rest
612
- }
613
- );
614
- });
615
- var Action2 = Alert.Action;
616
- var Cancel2 = Alert.Cancel;
617
- var CloseIcon2 = () => /* @__PURE__ */ jsx11("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx11("path", { d: "M5 5l10 10M15 5L5 15", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) });
618
- var CloseButton2 = forwardRef9(function AlertDialogCloseButton({ className, "aria-label": ariaLabel = "\uB2EB\uAE30", children, ...rest }, ref) {
619
- return /* @__PURE__ */ jsx11(Alert.Cancel, { asChild: true, children: /* @__PURE__ */ jsx11(
620
- "button",
621
- {
622
- ref,
623
- type: "button",
624
- "aria-label": ariaLabel,
625
- className: cx("nuri-alert__close", className),
626
- ...rest,
627
- children: children ?? /* @__PURE__ */ jsx11(CloseIcon2, {})
628
- }
629
- ) });
630
- });
631
- var AlertDialog = Object.assign(Root8, {
632
- Trigger: Trigger5,
633
- Content: Content5,
634
- Header: Header2,
635
- Title: Title4,
636
- Description: Description4,
637
- Body: Body2,
638
- Footer: Footer2,
639
- Action: Action2,
640
- Cancel: Cancel2,
641
- CloseButton: CloseButton2
642
- });
643
-
644
- // src/Toast/Toaster.tsx
645
- import "./Toast/styles.css";
646
- import * as RadixToast from "@radix-ui/react-toast";
647
-
648
- // src/Toast/store.ts
649
- import { useSyncExternalStore } from "react";
650
- var toasts = [];
651
- var listeners = /* @__PURE__ */ new Set();
652
- var EMPTY = [];
653
- var counter = 0;
654
- var emit = () => {
655
- for (const l of listeners) l();
656
- };
657
- function add(message, options = {}) {
658
- const id = options.id ?? `nuri-toast-${++counter}`;
659
- const record = {
660
- id,
661
- message,
662
- tone: options.tone ?? "default",
663
- duration: options.duration ?? 3e3
664
- };
665
- const idx = toasts.findIndex((t) => t.id === id);
666
- toasts = idx >= 0 ? toasts.map((t) => t.id === id ? record : t) : [...toasts, record];
667
- emit();
668
- return id;
669
- }
670
- function remove(id) {
671
- toasts = toasts.filter((t) => t.id !== id);
672
- emit();
673
- }
674
- function clear() {
675
- toasts = [];
676
- emit();
677
- }
678
- var toastStore = {
679
- add,
680
- remove,
681
- clear,
682
- subscribe(listener) {
683
- listeners.add(listener);
684
- return () => {
685
- listeners.delete(listener);
686
- };
687
- },
688
- getSnapshot: () => toasts,
689
- getServerSnapshot: () => EMPTY
690
- };
691
- function useToasts() {
692
- return useSyncExternalStore(
693
- toastStore.subscribe,
694
- toastStore.getSnapshot,
695
- toastStore.getServerSnapshot
696
- );
697
- }
698
-
699
- // src/Toast/icons.tsx
700
- import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
701
- var CheckIcon2 = () => /* @__PURE__ */ jsx12("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx12(
702
- "path",
703
- {
704
- d: "M3.5 8.5l3 3 6-6.5",
705
- stroke: "currentColor",
706
- strokeWidth: "1.6",
707
- strokeLinecap: "round",
708
- strokeLinejoin: "round"
709
- }
710
- ) });
711
- var ErrorIcon = () => /* @__PURE__ */ jsxs12("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [
712
- /* @__PURE__ */ jsx12("path", { d: "M8 4v4.5", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round" }),
713
- /* @__PURE__ */ jsx12("circle", { cx: "8", cy: "11.3", r: "0.95", fill: "currentColor" })
714
- ] });
715
- var InfoIcon2 = () => /* @__PURE__ */ jsxs12("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [
716
- /* @__PURE__ */ jsx12("path", { d: "M8 7.5v4", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round" }),
717
- /* @__PURE__ */ jsx12("circle", { cx: "8", cy: "4.7", r: "0.95", fill: "currentColor" })
718
- ] });
719
- var toneIcon = {
720
- success: /* @__PURE__ */ jsx12(CheckIcon2, {}),
721
- error: /* @__PURE__ */ jsx12(ErrorIcon, {}),
722
- info: /* @__PURE__ */ jsx12(InfoIcon2, {})
723
- };
724
-
725
- // src/Toast/Toaster.tsx
726
- import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
727
- function Toaster({
728
- swipeDirection = "down",
729
- swipeThreshold = 50,
730
- className,
731
- label = "\uC54C\uB9BC"
732
- }) {
733
- const toasts2 = useToasts();
734
- return /* @__PURE__ */ jsxs13(
735
- RadixToast.Provider,
736
- {
737
- swipeDirection,
738
- swipeThreshold,
739
- label,
740
- children: [
741
- toasts2.map((t) => /* @__PURE__ */ jsxs13(
742
- RadixToast.Root,
743
- {
744
- duration: t.duration,
745
- onOpenChange: (open) => {
746
- if (!open) toastStore.remove(t.id);
747
- },
748
- type: t.tone === "error" ? "foreground" : "background",
749
- className: cx("nuri-toast", t.tone !== "default" && `nuri-toast--${t.tone}`),
750
- children: [
751
- t.tone !== "default" && /* @__PURE__ */ jsx13("span", { className: "nuri-toast__icon", "aria-hidden": "true", children: toneIcon[t.tone] }),
752
- /* @__PURE__ */ jsx13(RadixToast.Title, { className: "nuri-toast__message", children: t.message })
753
- ]
754
- },
755
- t.id
756
- )),
757
- /* @__PURE__ */ jsx13(
758
- RadixToast.Viewport,
759
- {
760
- className: cx("nuri-toast__viewport", className),
761
- label: `${label} ({hotkey})`
762
- }
763
- )
764
- ]
765
- }
766
- );
767
- }
768
-
769
- // src/Toast/toast.ts
770
- function toastFn(message, options) {
771
- return toastStore.add(message, options);
772
- }
773
- var toast = Object.assign(toastFn, {
774
- success: (message, options) => toastStore.add(message, { ...options, tone: "success" }),
775
- error: (message, options) => toastStore.add(message, { ...options, tone: "error" }),
776
- info: (message, options) => toastStore.add(message, { ...options, tone: "info" }),
777
- /** id 지정 시 해당 토스트만, 없으면 전체 제거. */
778
- dismiss: (id) => id ? toastStore.remove(id) : toastStore.clear()
779
- });
780
-
781
- // src/Tooltip/Tooltip.tsx
782
- import "./Tooltip/styles.css";
783
- import * as RadixTooltip from "@radix-ui/react-tooltip";
784
- import { createContext, useContext } from "react";
785
- import { jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
786
- var HasProviderContext = createContext(false);
787
- function TooltipProvider({ children, ...props }) {
788
- return /* @__PURE__ */ jsx14(HasProviderContext.Provider, { value: true, children: /* @__PURE__ */ jsx14(RadixTooltip.Provider, { ...props, children }) });
789
- }
790
- function Tooltip({
791
- content,
792
- children,
793
- side = "top",
794
- align = "center",
795
- arrow = true,
796
- delayDuration,
797
- open,
798
- defaultOpen,
799
- onOpenChange,
800
- disabled = false,
801
- container,
802
- className
803
- }) {
804
- const hasProvider = useContext(HasProviderContext);
805
- if (disabled) return children;
806
- const root = /* @__PURE__ */ jsxs14(
807
- RadixTooltip.Root,
808
- {
809
- open,
810
- defaultOpen,
811
- onOpenChange,
812
- delayDuration,
813
- children: [
814
- /* @__PURE__ */ jsx14(RadixTooltip.Trigger, { asChild: true, children }),
815
- /* @__PURE__ */ jsx14(RadixTooltip.Portal, { container, children: /* @__PURE__ */ jsxs14(
816
- RadixTooltip.Content,
817
- {
818
- className: cx("nuri-tooltip", className),
819
- side,
820
- align,
821
- sideOffset: 4,
822
- collisionPadding: 8,
823
- arrowPadding: 6,
824
- hideWhenDetached: true,
825
- children: [
826
- content,
827
- arrow && /* @__PURE__ */ jsx14(RadixTooltip.Arrow, { className: "nuri-tooltip__arrow", width: 14, height: 7 })
828
- ]
829
- }
830
- ) })
831
- ]
832
- }
833
- );
834
- return hasProvider ? root : /* @__PURE__ */ jsx14(RadixTooltip.Provider, { delayDuration: 100, children: root });
835
- }
2
+ import {
3
+ Modal
4
+ } from "./chunk-4N5JIGIU.js";
5
+ import {
6
+ AlertDialog
7
+ } from "./chunk-GBMYANHH.js";
8
+ import {
9
+ Toaster,
10
+ toast
11
+ } from "./chunk-RC773ZEY.js";
12
+ import {
13
+ Tooltip,
14
+ TooltipProvider
15
+ } from "./chunk-2YGYLCCA.js";
16
+ import {
17
+ Button
18
+ } from "./chunk-OM4QMC4F.js";
19
+ import {
20
+ Input
21
+ } from "./chunk-DYO4PIBB.js";
22
+ import {
23
+ Textarea
24
+ } from "./chunk-DTGPVOJK.js";
25
+ import {
26
+ Checkbox
27
+ } from "./chunk-LAPTEQ5N.js";
28
+ import {
29
+ Radio,
30
+ RadioGroup
31
+ } from "./chunk-3H47QMKS.js";
32
+ import {
33
+ Switch
34
+ } from "./chunk-DTQE42F7.js";
35
+ import {
36
+ Select
37
+ } from "./chunk-R757N7RU.js";
38
+ import "./chunk-PS6QXS5Z.js";
836
39
  export {
837
40
  AlertDialog,
838
41
  Button,