@bestow-ui/react 0.2.0 → 0.2.1
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/index.cjs +46 -56
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +36 -46
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -175,19 +175,7 @@ var TextField = forwardRef5(function TextField2({ label: label2, helperText: hel
|
|
|
175
175
|
|
|
176
176
|
// src/components/Modal/Modal.tsx
|
|
177
177
|
import * as Dialog from "@radix-ui/react-dialog";
|
|
178
|
-
|
|
179
|
-
// src/icons/index.tsx
|
|
180
|
-
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
181
|
-
var base = { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", "aria-hidden": true };
|
|
182
|
-
function CloseIcon(props) {
|
|
183
|
-
return /* @__PURE__ */ jsx6("svg", { ...base, ...props, children: /* @__PURE__ */ jsx6("path", { d: "M4 4l8 8M12 4l-8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) });
|
|
184
|
-
}
|
|
185
|
-
function ChevronDownIcon(props) {
|
|
186
|
-
return /* @__PURE__ */ jsx6("svg", { ...base, ...props, children: /* @__PURE__ */ jsx6("path", { d: "M4 6l4 4 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
187
|
-
}
|
|
188
|
-
function CheckIcon(props) {
|
|
189
|
-
return /* @__PURE__ */ jsx6("svg", { ...base, ...props, children: /* @__PURE__ */ jsx6("path", { d: "M3.5 8.5l3 3 6-7", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
190
|
-
}
|
|
178
|
+
import { XIcon } from "@bestow-ui/icons";
|
|
191
179
|
|
|
192
180
|
// src/components/Modal/Modal.css.ts
|
|
193
181
|
import { createRuntimeFn as _7a4684 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
@@ -202,7 +190,7 @@ var overlay = "_1pdsmv00";
|
|
|
202
190
|
var title = "_1pdsmv07";
|
|
203
191
|
|
|
204
192
|
// src/components/Modal/Modal.tsx
|
|
205
|
-
import { jsx as
|
|
193
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
206
194
|
function Modal({
|
|
207
195
|
open,
|
|
208
196
|
defaultOpen,
|
|
@@ -219,9 +207,9 @@ function Modal({
|
|
|
219
207
|
}) {
|
|
220
208
|
const portalClassName = usePortalClassName();
|
|
221
209
|
return /* @__PURE__ */ jsxs5(Dialog.Root, { open, defaultOpen, onOpenChange, children: [
|
|
222
|
-
trigger2 && /* @__PURE__ */
|
|
210
|
+
trigger2 && /* @__PURE__ */ jsx6(Dialog.Trigger, { asChild: true, children: trigger2 }),
|
|
223
211
|
/* @__PURE__ */ jsxs5(Dialog.Portal, { children: [
|
|
224
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ jsx6(Dialog.Overlay, { className: cx(portalClassName, overlay) }),
|
|
225
213
|
/* @__PURE__ */ jsxs5(
|
|
226
214
|
Dialog.Content,
|
|
227
215
|
{
|
|
@@ -231,13 +219,13 @@ function Modal({
|
|
|
231
219
|
children: [
|
|
232
220
|
/* @__PURE__ */ jsxs5("div", { className: header, children: [
|
|
233
221
|
/* @__PURE__ */ jsxs5("div", { className: headings, children: [
|
|
234
|
-
/* @__PURE__ */
|
|
235
|
-
description3 && /* @__PURE__ */
|
|
222
|
+
/* @__PURE__ */ jsx6(Dialog.Title, { className: title, children: title3 }),
|
|
223
|
+
description3 && /* @__PURE__ */ jsx6(Dialog.Description, { className: description, children: description3 })
|
|
236
224
|
] }),
|
|
237
|
-
!hideCloseButton && /* @__PURE__ */
|
|
225
|
+
!hideCloseButton && /* @__PURE__ */ jsx6(Dialog.Close, { className: closeButton, "aria-label": "\uB2EB\uAE30", children: /* @__PURE__ */ jsx6(XIcon, { size: 16 }) })
|
|
238
226
|
] }),
|
|
239
|
-
children && /* @__PURE__ */
|
|
240
|
-
footer2 && /* @__PURE__ */
|
|
227
|
+
children && /* @__PURE__ */ jsx6("div", { className: body, children }),
|
|
228
|
+
footer2 && /* @__PURE__ */ jsx6("div", { className: footer, children: footer2 })
|
|
241
229
|
]
|
|
242
230
|
}
|
|
243
231
|
)
|
|
@@ -249,6 +237,7 @@ var ModalClose = Dialog.Close;
|
|
|
249
237
|
// src/components/Select/Select.tsx
|
|
250
238
|
import * as RadixSelect from "@radix-ui/react-select";
|
|
251
239
|
import { forwardRef as forwardRef6, useId as useId2 } from "react";
|
|
240
|
+
import { CheckIcon, ChevronDownIcon } from "@bestow-ui/icons";
|
|
252
241
|
|
|
253
242
|
// src/components/Select/Select.css.ts
|
|
254
243
|
var content2 = "_1kx81e83";
|
|
@@ -260,7 +249,7 @@ var value = "_1kx81e81";
|
|
|
260
249
|
var viewport = "_1kx81e84";
|
|
261
250
|
|
|
262
251
|
// src/components/Select/Select.tsx
|
|
263
|
-
import { jsx as
|
|
252
|
+
import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
264
253
|
var Select = forwardRef6(function Select2({
|
|
265
254
|
options,
|
|
266
255
|
value: value2,
|
|
@@ -286,7 +275,7 @@ var Select = forwardRef6(function Select2({
|
|
|
286
275
|
return /* @__PURE__ */ jsxs6("div", { className: cx(field, fullWidth && fieldFullWidth), children: [
|
|
287
276
|
label2 && /* @__PURE__ */ jsxs6("label", { htmlFor: triggerId, className: label, children: [
|
|
288
277
|
label2,
|
|
289
|
-
required && /* @__PURE__ */
|
|
278
|
+
required && /* @__PURE__ */ jsx7("span", { className: requiredMark, "aria-hidden": true, children: "*" })
|
|
290
279
|
] }),
|
|
291
280
|
/* @__PURE__ */ jsxs6(
|
|
292
281
|
RadixSelect.Root,
|
|
@@ -309,27 +298,27 @@ var Select = forwardRef6(function Select2({
|
|
|
309
298
|
"data-invalid": error || void 0,
|
|
310
299
|
className: cx(root3({ size, fullWidth }), trigger, className),
|
|
311
300
|
children: [
|
|
312
|
-
/* @__PURE__ */
|
|
313
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ jsx7("span", { className: value, children: /* @__PURE__ */ jsx7(RadixSelect.Value, { placeholder }) }),
|
|
302
|
+
/* @__PURE__ */ jsx7(RadixSelect.Icon, { className: icon2, children: /* @__PURE__ */ jsx7(ChevronDownIcon, { size: 16 }) })
|
|
314
303
|
]
|
|
315
304
|
}
|
|
316
305
|
),
|
|
317
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ jsx7(RadixSelect.Portal, { children: /* @__PURE__ */ jsx7(
|
|
318
307
|
RadixSelect.Content,
|
|
319
308
|
{
|
|
320
309
|
position: "popper",
|
|
321
310
|
sideOffset: 4,
|
|
322
311
|
collisionPadding: 8,
|
|
323
312
|
className: cx(portalClassName, content2),
|
|
324
|
-
children: /* @__PURE__ */
|
|
313
|
+
children: /* @__PURE__ */ jsx7(RadixSelect.Viewport, { className: viewport, children: options.map((option) => /* @__PURE__ */ jsxs6(
|
|
325
314
|
RadixSelect.Item,
|
|
326
315
|
{
|
|
327
316
|
value: option.value,
|
|
328
317
|
disabled: option.disabled,
|
|
329
318
|
className: item,
|
|
330
319
|
children: [
|
|
331
|
-
/* @__PURE__ */
|
|
332
|
-
/* @__PURE__ */
|
|
320
|
+
/* @__PURE__ */ jsx7(RadixSelect.ItemText, { children: option.label }),
|
|
321
|
+
/* @__PURE__ */ jsx7(RadixSelect.ItemIndicator, { className: itemIndicator, children: /* @__PURE__ */ jsx7(CheckIcon, { size: 16 }) })
|
|
333
322
|
]
|
|
334
323
|
},
|
|
335
324
|
option.value
|
|
@@ -339,7 +328,7 @@ var Select = forwardRef6(function Select2({
|
|
|
339
328
|
]
|
|
340
329
|
}
|
|
341
330
|
),
|
|
342
|
-
helperText2 && /* @__PURE__ */
|
|
331
|
+
helperText2 && /* @__PURE__ */ jsx7("p", { id: helperId, className: helperText({ error }), children: helperText2 })
|
|
343
332
|
] });
|
|
344
333
|
});
|
|
345
334
|
|
|
@@ -351,9 +340,9 @@ import { createRuntimeFn as _7a4685 } from "@vanilla-extract/recipes/createRunti
|
|
|
351
340
|
var stack = _7a4685({ defaultClassName: "_1jz9hj90", variantClassNames: { direction: { row: "_1jz9hj91", column: "_1jz9hj92", "row-reverse": "_1jz9hj93", "column-reverse": "_1jz9hj94" }, gap: { "0": "_1jz9hj95", "1": "_1jz9hj96", "2": "_1jz9hj97", "3": "_1jz9hj98", "4": "_1jz9hj99", "5": "_1jz9hj9a", "6": "_1jz9hj9b", "8": "_1jz9hj9c", "10": "_1jz9hj9d", "12": "_1jz9hj9e", "16": "_1jz9hj9f" }, align: { start: "_1jz9hj9g", center: "_1jz9hj9h", end: "_1jz9hj9i", stretch: "_1jz9hj9j", baseline: "_1jz9hj9k" }, justify: { start: "_1jz9hj9l", center: "_1jz9hj9m", end: "_1jz9hj9n", between: "_1jz9hj9o", around: "_1jz9hj9p", evenly: "_1jz9hj9q" }, wrap: { true: "_1jz9hj9r" } }, defaultVariants: { direction: "column" }, compoundVariants: [] });
|
|
352
341
|
|
|
353
342
|
// src/components/Stack/Stack.tsx
|
|
354
|
-
import { jsx as
|
|
343
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
355
344
|
var Stack = forwardRef7(function Stack2({ as: Component = "div", direction, gap, align, justify, wrap, className, ...rest }, ref) {
|
|
356
|
-
return /* @__PURE__ */
|
|
345
|
+
return /* @__PURE__ */ jsx8(
|
|
357
346
|
Component,
|
|
358
347
|
{
|
|
359
348
|
ref,
|
|
@@ -366,6 +355,7 @@ var Stack = forwardRef7(function Stack2({ as: Component = "div", direction, gap,
|
|
|
366
355
|
// src/components/Toast/Toast.tsx
|
|
367
356
|
import * as RadixToast from "@radix-ui/react-toast";
|
|
368
357
|
import { createContext as createContext2, useCallback, useContext as useContext2, useMemo, useRef as useRef2, useState } from "react";
|
|
358
|
+
import { XIcon as XIcon2 } from "@bestow-ui/icons";
|
|
369
359
|
|
|
370
360
|
// src/components/Toast/Toast.css.ts
|
|
371
361
|
import { createRuntimeFn as _7a4686 } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
@@ -377,7 +367,7 @@ var toast = _7a4686({ defaultClassName: "_1g11zvx1", variantClassNames: { varian
|
|
|
377
367
|
var viewport2 = "_1g11zvx0";
|
|
378
368
|
|
|
379
369
|
// src/components/Toast/Toast.tsx
|
|
380
|
-
import { jsx as
|
|
370
|
+
import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
381
371
|
var REMOVE_DELAY = 500;
|
|
382
372
|
var ToastContext = createContext2(null);
|
|
383
373
|
function ToastProvider({ children, duration = 5e3, label: label2 = "\uC54C\uB9BC" }) {
|
|
@@ -395,7 +385,7 @@ function ToastProvider({ children, duration = 5e3, label: label2 = "\uC54C\uB9BC
|
|
|
395
385
|
setTimeout(() => setToasts((prev) => prev.filter((t) => t.open || !isTarget(t))), REMOVE_DELAY);
|
|
396
386
|
}, []);
|
|
397
387
|
const value2 = useMemo(() => ({ toast: toast2, dismiss }), [toast2, dismiss]);
|
|
398
|
-
return /* @__PURE__ */
|
|
388
|
+
return /* @__PURE__ */ jsx9(ToastContext.Provider, { value: value2, children: /* @__PURE__ */ jsxs7(RadixToast.Provider, { duration, label: label2, swipeDirection: "right", children: [
|
|
399
389
|
children,
|
|
400
390
|
toasts.map(({ id, open, title: title3, description: description3, variant, duration: itemDuration, action: action2 }) => /* @__PURE__ */ jsxs7(
|
|
401
391
|
RadixToast.Root,
|
|
@@ -407,15 +397,15 @@ function ToastProvider({ children, duration = 5e3, label: label2 = "\uC54C\uB9BC
|
|
|
407
397
|
},
|
|
408
398
|
className: toast({ variant }),
|
|
409
399
|
children: [
|
|
410
|
-
/* @__PURE__ */
|
|
411
|
-
description3 && /* @__PURE__ */
|
|
412
|
-
action2 && /* @__PURE__ */
|
|
413
|
-
/* @__PURE__ */
|
|
400
|
+
/* @__PURE__ */ jsx9(RadixToast.Title, { className: title2, children: title3 }),
|
|
401
|
+
description3 && /* @__PURE__ */ jsx9(RadixToast.Description, { className: description2, children: description3 }),
|
|
402
|
+
action2 && /* @__PURE__ */ jsx9(RadixToast.Action, { asChild: true, altText: action2.altText ?? action2.label, className: action, children: /* @__PURE__ */ jsx9(Button, { size: "sm", variant: "soft", color: "neutral", onClick: action2.onClick, children: action2.label }) }),
|
|
403
|
+
/* @__PURE__ */ jsx9(RadixToast.Close, { className: close, "aria-label": "\uB2EB\uAE30", children: /* @__PURE__ */ jsx9(XIcon2, { size: 16 }) })
|
|
414
404
|
]
|
|
415
405
|
},
|
|
416
406
|
id
|
|
417
407
|
)),
|
|
418
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ jsx9(RadixToast.Viewport, { className: cx(portalClassName, viewport2) })
|
|
419
409
|
] }) });
|
|
420
410
|
}
|
|
421
411
|
function useToast() {
|
|
@@ -432,7 +422,7 @@ var arrow = "z7rufs1";
|
|
|
432
422
|
var content3 = "z7rufs0";
|
|
433
423
|
|
|
434
424
|
// src/components/Tooltip/Tooltip.tsx
|
|
435
|
-
import { jsx as
|
|
425
|
+
import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
436
426
|
function Tooltip({
|
|
437
427
|
content: content4,
|
|
438
428
|
children,
|
|
@@ -447,9 +437,9 @@ function Tooltip({
|
|
|
447
437
|
}) {
|
|
448
438
|
const portalClassName = usePortalClassName();
|
|
449
439
|
if (disabled || content4 == null || content4 === "") return children;
|
|
450
|
-
return /* @__PURE__ */
|
|
451
|
-
/* @__PURE__ */
|
|
452
|
-
/* @__PURE__ */
|
|
440
|
+
return /* @__PURE__ */ jsx10(RadixTooltip.Provider, { delayDuration: delay, children: /* @__PURE__ */ jsxs8(RadixTooltip.Root, { open, defaultOpen, onOpenChange, children: [
|
|
441
|
+
/* @__PURE__ */ jsx10(RadixTooltip.Trigger, { asChild: true, children }),
|
|
442
|
+
/* @__PURE__ */ jsx10(RadixTooltip.Portal, { children: /* @__PURE__ */ jsxs8(
|
|
453
443
|
RadixTooltip.Content,
|
|
454
444
|
{
|
|
455
445
|
side,
|
|
@@ -459,7 +449,7 @@ function Tooltip({
|
|
|
459
449
|
className: cx(portalClassName, content3, className),
|
|
460
450
|
children: [
|
|
461
451
|
content4,
|
|
462
|
-
/* @__PURE__ */
|
|
452
|
+
/* @__PURE__ */ jsx10(RadixTooltip.Arrow, { className: arrow, width: 10, height: 5 })
|
|
463
453
|
]
|
|
464
454
|
}
|
|
465
455
|
) })
|
|
@@ -474,7 +464,7 @@ import { createRuntimeFn as _7a4687 } from "@vanilla-extract/recipes/createRunti
|
|
|
474
464
|
var typography = _7a4687({ defaultClassName: "kiolio0", variantClassNames: { variant: { display: "kiolio1", h1: "kiolio2", h2: "kiolio3", h3: "kiolio4", h4: "kiolio5", "body-lg": "kiolio6", body: "kiolio7", "body-sm": "kiolio8", caption: "kiolio9" }, color: { "default": "kiolioa", muted: "kioliob", subtle: "kiolioc", primary: "kioliod", danger: "kiolioe", success: "kioliof", inherit: "kioliog" }, weight: { regular: "kiolioh", medium: "kiolioi", semibold: "kiolioj", bold: "kioliok" }, align: { start: "kioliol", center: "kioliom", end: "kiolion" }, truncate: { true: "kiolioo" } }, defaultVariants: { variant: "body", color: "default" }, compoundVariants: [] });
|
|
475
465
|
|
|
476
466
|
// src/components/Typography/Typography.tsx
|
|
477
|
-
import { jsx as
|
|
467
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
478
468
|
var defaultElement = {
|
|
479
469
|
display: "h1",
|
|
480
470
|
h1: "h1",
|
|
@@ -488,7 +478,7 @@ var defaultElement = {
|
|
|
488
478
|
};
|
|
489
479
|
var Typography = forwardRef8(function Typography2({ variant = "body", as, color, weight, align, truncate, className, ...rest }, ref) {
|
|
490
480
|
const Component = as ?? defaultElement[variant];
|
|
491
|
-
return /* @__PURE__ */
|
|
481
|
+
return /* @__PURE__ */ jsx11(
|
|
492
482
|
Component,
|
|
493
483
|
{
|
|
494
484
|
ref,
|