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