jenosize-ui 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/README.md +2 -2
- package/dist/{PaymentInput-CKPIPNWH.d.ts → PaymentInput-Dn5WVQVy.d.ts} +4 -0
- package/dist/{Select-CVbEQ2Ep.d.ts → Select-Dt5ARIH8.d.ts} +4 -0
- package/dist/{TagInput-CTJYOB4J.d.ts → TagInput-BaBeve6L.d.ts} +4 -0
- package/dist/area-chart.d.ts +3 -2
- package/dist/area-chart.js +6 -5
- package/dist/avatar.d.ts +5 -0
- package/dist/avatar.js +9 -8
- package/dist/badge.d.ts +4 -0
- package/dist/badge.js +5 -4
- package/dist/bar-chart.d.ts +3 -2
- package/dist/bar-chart.js +6 -5
- package/dist/breadcrumb.d.ts +4 -0
- package/dist/breadcrumb.js +4 -2
- package/dist/button.d.ts +6 -1
- package/dist/button.js +9 -8
- package/dist/calendar.d.ts +5 -0
- package/dist/calendar.js +15 -13
- package/dist/callout.d.ts +6 -6
- package/dist/callout.js +11 -9
- package/dist/card-D56VxyAe.d.ts +123 -0
- package/dist/card.d.ts +3 -51
- package/dist/card.js +5 -5
- package/dist/checkbox.js +8 -7
- package/dist/{chunk-75M43ELV.js → chunk-22M75A3N.js} +75 -45
- package/dist/{chunk-A46ED5JQ.js → chunk-33TOK7ES.js} +7 -5
- package/dist/{chunk-RNXRZGXN.js → chunk-3H444OJA.js} +5 -3
- package/dist/{chunk-DJYWPJZ3.js → chunk-3QXLIZIX.js} +3 -12
- package/dist/chunk-3ZEEGXYF.js +8 -0
- package/dist/chunk-45Y2ZGNK.js +34 -0
- package/dist/{chunk-ILICYNK7.js → chunk-4RBIWI2Q.js} +3 -3
- package/dist/{chunk-FIGBJGH2.js → chunk-4VGEJG4M.js} +115 -79
- package/dist/{chunk-EX374YWB.js → chunk-54SIZR63.js} +15 -7
- package/dist/chunk-5AZKP4KZ.js +49 -0
- package/dist/{chunk-NA35YZRD.js → chunk-5DP7W5HX.js} +13 -11
- package/dist/{chunk-QKDEQFOQ.js → chunk-5KSD4WKN.js} +13 -4
- package/dist/{chunk-RIXEUAPY.js → chunk-5XPMY2LF.js} +5 -5
- package/dist/{chunk-6UBYHSBX.js → chunk-5ZEUTSCV.js} +5 -5
- package/dist/{chunk-DCGTB7P7.js → chunk-667ZHY3T.js} +111 -39
- package/dist/{chunk-MYQ3FD4Y.js → chunk-6B6BWTXC.js} +8 -5
- package/dist/{chunk-6HJA7NPL.js → chunk-6H4LNWQ7.js} +3 -3
- package/dist/{chunk-JAVNGTOE.js → chunk-6MMBQVRO.js} +58 -43
- package/dist/{chunk-JMWYCT63.js → chunk-7GUPNTAH.js} +14 -6
- package/dist/{chunk-TBN644IN.js → chunk-7ZM7SNCZ.js} +3 -3
- package/dist/{chunk-BD5YKFRA.js → chunk-A323V6AI.js} +5 -3
- package/dist/{chunk-AC6ZWKRN.js → chunk-AFYXSZGW.js} +2 -2
- package/dist/chunk-AIARANKE.js +33 -0
- package/dist/{chunk-54S5CUY6.js → chunk-AIGYMTCU.js} +5 -4
- package/dist/{chunk-C6OTOTKI.js → chunk-AZ7DKRBY.js} +5 -5
- package/dist/{chunk-QBHQOX23.js → chunk-BBKE4W3B.js} +18 -10
- package/dist/{chunk-4BRMM3I5.js → chunk-BFVJHH7S.js} +7 -6
- package/dist/{chunk-FFTRB2UU.js → chunk-CFFWYXDW.js} +18 -6
- package/dist/{chunk-42FCPC77.js → chunk-CGHYXWTT.js} +10 -4
- package/dist/{chunk-VEOYCAJP.js → chunk-CKMWBVRR.js} +27 -7
- package/dist/{chunk-GTHJWR3Q.js → chunk-D7EE5GWU.js} +21 -22
- package/dist/{chunk-NMERLWT7.js → chunk-E2YZ7IMT.js} +23 -7
- package/dist/{chunk-GAFGIT4Q.js → chunk-FFMTYQXE.js} +30 -10
- package/dist/{chunk-L53Y7KUV.js → chunk-FH7Z7SGQ.js} +61 -28
- package/dist/{chunk-5JRM3OES.js → chunk-FNQJJO63.js} +3 -3
- package/dist/{chunk-MD4AR43X.js → chunk-FWRHBMWT.js} +3 -3
- package/dist/{chunk-4K6V6NNK.js → chunk-GLKFFA7N.js} +10 -8
- package/dist/{chunk-EDOUI2BG.js → chunk-GQRSABRN.js} +4 -4
- package/dist/{chunk-BNIWT6CW.js → chunk-GZMDZF2V.js} +7 -6
- package/dist/{chunk-HSVBTIP2.js → chunk-HHYEAFCL.js} +70 -27
- package/dist/{chunk-P7DH62UY.js → chunk-I6WMNXC7.js} +5 -5
- package/dist/{chunk-34J5AANZ.js → chunk-IQNVSQRK.js} +3 -3
- package/dist/{chunk-MCUASLZH.js → chunk-KHGW72BM.js} +3 -3
- package/dist/{chunk-4R7WDDCW.js → chunk-KZP6B6B3.js} +4 -4
- package/dist/{chunk-7HV6EIGZ.js → chunk-LLPWQDF7.js} +3 -3
- package/dist/{chunk-FZBZGA3P.js → chunk-LO22VQL5.js} +4 -4
- package/dist/{chunk-JXHZHUB3.js → chunk-LQURV7HQ.js} +9 -7
- package/dist/{chunk-EDT5J5WK.js → chunk-LYXPJERB.js} +14 -4
- package/dist/{chunk-6IUTVDNI.js → chunk-MCQG4H6T.js} +35 -3
- package/dist/{chunk-JYBGO6GY.js → chunk-MVG5MABV.js} +11 -8
- package/dist/{chunk-PXEJ5RKO.js → chunk-N3RVMBPX.js} +6 -9
- package/dist/{chunk-VWGAMOSE.js → chunk-NKG4N6HA.js} +3 -3
- package/dist/{chunk-A5WQLN4B.js → chunk-OACWA4TC.js} +14 -52
- package/dist/{chunk-LBYCCLVI.js → chunk-OLLD2BZN.js} +9 -9
- package/dist/{chunk-T2WAD4QP.js → chunk-POQTE7JI.js} +55 -16
- package/dist/{chunk-74HPBSVY.js → chunk-QDKETK7D.js} +4 -4
- package/dist/{chunk-VH35QHD4.js → chunk-QHH6AUR3.js} +16 -8
- package/dist/chunk-RJTVCA62.js +42 -0
- package/dist/{chunk-DTMYD63D.js → chunk-S5TEWPWW.js} +46 -26
- package/dist/{chunk-3GT43XPK.js → chunk-SB3DG572.js} +15 -8
- package/dist/{chunk-NKDW6C7K.js → chunk-SKRR3ZMP.js} +3 -3
- package/dist/{chunk-CTENRS34.js → chunk-T4ZFZTY6.js} +8 -6
- package/dist/{chunk-YLEHYDXC.js → chunk-T5574MXM.js} +33 -45
- package/dist/{chunk-USL3TDZM.js → chunk-U4WSJAYK.js} +321 -105
- package/dist/{chunk-4W6AYGLR.js → chunk-UGKELBNC.js} +55 -39
- package/dist/{chunk-M5TVCASC.js → chunk-ULGCGKOE.js} +8 -6
- package/dist/{chunk-JUWDRRD6.js → chunk-X2VMIBK5.js} +4 -4
- package/dist/{chunk-763VS2FY.js → chunk-YHBI52P2.js} +3 -3
- package/dist/chunk-YIHKQ63K.js +13 -0
- package/dist/{chunk-3Z3SDKIA.js → chunk-YQYVGWIC.js} +5 -5
- package/dist/{chunk-4HKDD3PR.js → chunk-ZHAT2XZ4.js} +91 -57
- package/dist/{chunk-CWMFEF6R.js → chunk-ZMFY7WAY.js} +60 -24
- package/dist/{chunk-WKWAUU64.js → chunk-ZZSNTCCL.js} +6 -5
- package/dist/combobox.d.ts +5 -0
- package/dist/combobox.js +12 -11
- package/dist/date-input.d.ts +4 -0
- package/dist/date-input.js +11 -9
- package/dist/date-picker.d.ts +6 -0
- package/dist/date-picker.js +23 -21
- package/dist/dialog.d.ts +21 -1
- package/dist/dialog.js +10 -8
- package/dist/drawer.d.ts +11 -1
- package/dist/drawer.js +9 -7
- package/dist/dropdown-menu.d.ts +12 -0
- package/dist/dropdown-menu.js +6 -5
- package/dist/dropzone.d.ts +3 -2
- package/dist/dropzone.js +13 -12
- package/dist/form.d.ts +5 -4
- package/dist/form.js +60 -44
- package/dist/header-navigation.d.ts +5 -1
- package/dist/header-navigation.js +21 -19
- package/dist/helper.d.ts +36 -0
- package/dist/helper.js +3 -0
- package/dist/index.d.ts +13 -11
- package/dist/index.js +81 -76
- package/dist/indicator.js +4 -4
- package/dist/input.d.ts +4 -0
- package/dist/input.js +9 -8
- package/dist/kanban-board.d.ts +21 -81
- package/dist/kanban-board.js +14 -12
- package/dist/labels-DPrh0se9.d.ts +627 -0
- package/dist/line-chart.d.ts +3 -2
- package/dist/line-chart.js +6 -5
- package/dist/{nav-DcCyt00p.d.ts → nav-CKKqjBs6.d.ts} +10 -0
- package/dist/number-input.d.ts +4 -0
- package/dist/number-input.js +9 -8
- package/dist/pagination.d.ts +7 -1
- package/dist/pagination.js +11 -10
- package/dist/payment-input.d.ts +3 -2
- package/dist/payment-input.js +9 -8
- package/dist/pie-chart.d.ts +7 -3
- package/dist/pie-chart.js +6 -5
- package/dist/popover.js +9 -7
- package/dist/progress-steps.js +2 -2
- package/dist/progress.d.ts +21 -1
- package/dist/progress.js +3 -2
- package/dist/provider.d.ts +212 -0
- package/dist/provider.js +7 -0
- package/dist/radar-chart.d.ts +7 -3
- package/dist/radar-chart.js +6 -5
- package/dist/radial-chart.d.ts +7 -3
- package/dist/radial-chart.js +6 -5
- package/dist/radio.js +8 -7
- package/dist/select.d.ts +2 -1
- package/dist/select.js +14 -13
- package/dist/shared-CxAedkiy.d.ts +68 -0
- package/dist/sidebar-navigation.d.ts +28 -7
- package/dist/sidebar-navigation.js +15 -13
- package/dist/skeleton.js +2 -2
- package/dist/styles.css +1 -1
- package/dist/switch.js +4 -4
- package/dist/table.d.ts +56 -6
- package/dist/table.js +36 -34
- package/dist/tabs.d.ts +22 -0
- package/dist/tabs.js +3 -3
- package/dist/tag-input.d.ts +3 -2
- package/dist/tag-input.js +12 -11
- package/dist/tag.d.ts +4 -0
- package/dist/tag.js +3 -2
- package/dist/textarea.js +6 -5
- package/dist/theme.css +69 -6
- package/dist/theme.js +10 -9
- package/dist/toast.d.ts +11 -2
- package/dist/toast.js +11 -9
- package/dist/{tooltip-surface-Dmvb8v5K.d.ts → tooltip-surface-C2I9o2QM.d.ts} +1 -1
- package/dist/tooltip.d.ts +2 -2
- package/dist/tooltip.js +3 -3
- package/dist/tree.d.ts +5 -0
- package/dist/tree.js +5 -4
- package/dist/{types-6kvYwtRH.d.ts → types-DR9rAEy1.d.ts} +45 -13
- package/dist/{use-uploads-ButS4dGe.d.ts → use-uploads-KaPqDklo.d.ts} +9 -0
- package/dist/verification-code-input.js +8 -7
- package/package.json +12 -1
- package/dist/chunk-MFJP5FA7.js +0 -20
- package/dist/shared-BNXAdgh2.d.ts +0 -9
- package/dist/surface-DFyDnrTJ.d.ts +0 -34
|
@@ -1,12 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useLinkResolver, LinkOrButton } from './chunk-5AZKP4KZ.js';
|
|
2
|
+
import { Button } from './chunk-OACWA4TC.js';
|
|
3
|
+
import { WASH, FILL } from './chunk-MCQG4H6T.js';
|
|
2
4
|
import { Slot } from './chunk-52IFGFTL.js';
|
|
3
5
|
import { XIcon, CircleXIcon, TriangleAlertIcon, CircleCheckIcon, InfoIcon, BellIcon } from './chunk-BLIZ3CL3.js';
|
|
4
|
-
import { devWarn, warnPositiveInt } from './chunk-QDYE5LVT.js';
|
|
5
6
|
import { cn } from './chunk-ZSNJ6UA3.js';
|
|
7
|
+
import { usePublishedLabels, LabelsContext, useLabels } from './chunk-RJTVCA62.js';
|
|
8
|
+
import { devWarn, warnPositiveInt } from './chunk-QDYE5LVT.js';
|
|
6
9
|
import { Toast } from '@base-ui/react/toast';
|
|
7
10
|
import * as React from 'react';
|
|
8
|
-
import { jsx,
|
|
11
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
9
12
|
|
|
13
|
+
// src/components/toast/labels.ts
|
|
14
|
+
var TOAST_LABELS = {
|
|
15
|
+
/** The close affordance on every toast. */
|
|
16
|
+
dismiss: "Dismiss",
|
|
17
|
+
/** The viewport landmark. A secondary viewport names its corner so two regions are tellable
|
|
18
|
+
* apart; the ctx carries the raw `position`, and the space-separated rendering is this default's
|
|
19
|
+
* decision, not the caller's. */
|
|
20
|
+
region: (ctx) => ctx.primary ? "Notifications" : `Notifications (${ctx.position.replace("-", " ")})`
|
|
21
|
+
};
|
|
10
22
|
var regions = /* @__PURE__ */ new Map();
|
|
11
23
|
var regionsVersion = 0;
|
|
12
24
|
var regionListeners = /* @__PURE__ */ new Set();
|
|
@@ -162,35 +174,11 @@ var toast = Object.assign((title, options) => enqueue("info", title, options), {
|
|
|
162
174
|
});
|
|
163
175
|
var TYPE_COLOR = {
|
|
164
176
|
neutral: "neutral",
|
|
165
|
-
info: "
|
|
177
|
+
info: "info",
|
|
166
178
|
success: "success",
|
|
167
179
|
warning: "warning",
|
|
168
180
|
error: "error"
|
|
169
181
|
};
|
|
170
|
-
var ICON_TINT = {
|
|
171
|
-
// `neutral` has no hue to carry, so it takes the quiet wash + the muted glyph `lib/color.ts`'s
|
|
172
|
-
// `FG.neutral` already resolves to — the one tone shared with the library-wide colour axis agrees
|
|
173
|
-
// with it. The circle stays a circle: the other four are round, and a square in that row would
|
|
174
|
-
// read as a different kind of thing.
|
|
175
|
-
//
|
|
176
|
-
// It is also the ONLY row with a ring, and that is the point rather than an inconsistency: the
|
|
177
|
-
// other four delineate themselves by HUE, which this one does not have. Measured on the real card
|
|
178
|
-
// (canvas-normalised, both themes): `bg-secondary` against `bg-primary` is 1.05:1 in light and 1.06:1 in
|
|
179
|
-
// dark — no visible container at all, so the glyph floated where its four siblings sit in a circle.
|
|
180
|
-
// The ring lands at 1.18:1 / 1.28:1, which is not a new value to justify — it is `--color-border-secondary`,
|
|
181
|
-
// the same hairline every outlined `Card` in the library draws — and `color.ts`'s `SUBTLE.neutral`
|
|
182
|
-
// likewise ships one. The glyph itself reads at 7.36:1 / 6.89:1 against the wash, well past the
|
|
183
|
-
// 3:1 that WCAG 1.4.11 asks of non-text.
|
|
184
|
-
//
|
|
185
|
-
// (This used to cite `Callout` as agreeing. It no longer does, and the disagreement is the point:
|
|
186
|
-
// Callout unified all six tones on ONE raised square, so its row has no round siblings to match.
|
|
187
|
-
// Here four of five are circles, so the fifth must be too.)
|
|
188
|
-
neutral: "bg-secondary text-tertiary ring-1 ring-secondary ring-inset",
|
|
189
|
-
info: "bg-brand-primary text-brand-secondary",
|
|
190
|
-
success: "bg-success-primary text-success-primary",
|
|
191
|
-
warning: "bg-warning-primary text-warning-primary",
|
|
192
|
-
error: "bg-error-primary text-utility-red-700"
|
|
193
|
-
};
|
|
194
182
|
var TYPE_ICON = {
|
|
195
183
|
neutral: BellIcon,
|
|
196
184
|
info: InfoIcon,
|
|
@@ -357,24 +345,21 @@ var COUNTDOWN_FILL = cn(
|
|
|
357
345
|
"[animation:jz-toast-countdown_var(--toast-countdown)_linear_forwards]",
|
|
358
346
|
"group-data-[expanded]/toast:[animation-play-state:paused]"
|
|
359
347
|
);
|
|
360
|
-
var COUNTDOWN_TINT =
|
|
361
|
-
neutral: "bg-secondary-solid",
|
|
362
|
-
brand: "bg-brand-solid",
|
|
363
|
-
success: "bg-success-solid",
|
|
364
|
-
warning: "bg-warning-solid",
|
|
365
|
-
error: "bg-error-solid",
|
|
366
|
-
info: "bg-utility-blue-500"
|
|
367
|
-
};
|
|
348
|
+
var COUNTDOWN_TINT = FILL;
|
|
368
349
|
function relFor(action) {
|
|
369
350
|
return action.rel?.join(" ") ?? (action.target === "_blank" ? "noreferrer" : void 0);
|
|
370
351
|
}
|
|
371
352
|
function ToastActionRow({ actions, id }) {
|
|
353
|
+
const resolveLink = useLinkResolver();
|
|
372
354
|
return /* @__PURE__ */ jsx("div", { className: ACTION_ROW, children: actions.map((action) => {
|
|
373
355
|
const onClick = () => {
|
|
374
356
|
action.onClick?.();
|
|
375
357
|
closeToast(id);
|
|
376
358
|
};
|
|
377
|
-
const
|
|
359
|
+
const linkElement = resolveLink(action.href, { target: action.target });
|
|
360
|
+
const rel = relFor(action);
|
|
361
|
+
const overrides = { ...action.target != null && { target: action.target }, ...rel != null && { rel } };
|
|
362
|
+
const anchor = linkElement ? { render: Object.keys(overrides).length > 0 ? React.cloneElement(linkElement, overrides) : linkElement } : null;
|
|
378
363
|
if (action.variant === "primary") {
|
|
379
364
|
return /* @__PURE__ */ jsx(Button, { size: "sm", variant: "primary", leading: action.leading, onClick, ...anchor, children: action.label }, action.label);
|
|
380
365
|
}
|
|
@@ -382,11 +367,12 @@ function ToastActionRow({ actions, id }) {
|
|
|
382
367
|
action.leading === void 0 ? null : /* @__PURE__ */ jsx(Slot, { className: "[&>svg]:size-4", children: action.leading }),
|
|
383
368
|
action.label
|
|
384
369
|
] });
|
|
385
|
-
return
|
|
370
|
+
return /* @__PURE__ */ jsx(LinkOrButton, { render: anchor?.render, className: ACTION, onClick, children: label }, action.label);
|
|
386
371
|
}) });
|
|
387
372
|
}
|
|
388
373
|
function ToastList({ position, stacked, countdown }) {
|
|
389
374
|
const { toasts } = Toast.useToastManager();
|
|
375
|
+
const t = useLabels("toast", TOAST_LABELS, void 0);
|
|
390
376
|
const rootClassName = rootClasses(position, stacked);
|
|
391
377
|
const swipeDirection = SWIPE[AXIS[position]];
|
|
392
378
|
return /* @__PURE__ */ jsx(Fragment, { children: toasts.map((item) => {
|
|
@@ -397,7 +383,7 @@ function ToastList({ position, stacked, countdown }) {
|
|
|
397
383
|
const runFor = countdown && item.timeout ? item.timeout : 0;
|
|
398
384
|
return /* @__PURE__ */ jsxs(Toast.Root, { toast: item, swipeDirection, "data-slot": "toast", className: cn("group/toast", rootClassName), children: [
|
|
399
385
|
/* @__PURE__ */ jsxs(Toast.Content, { className: cn(CONTENT, compact ? CONTENT_ALIGN.compact : CONTENT_ALIGN.tall, stacked && CONTENT_STACKED), children: [
|
|
400
|
-
leading === void 0 ? /* @__PURE__ */ jsx("span", { className: cn(ICON_CIRCLE,
|
|
386
|
+
leading === void 0 ? /* @__PURE__ */ jsx("span", { className: cn(ICON_CIRCLE, WASH[TYPE_COLOR[type]]), "aria-hidden": "true", children: /* @__PURE__ */ jsx(TypeIcon, { type }) }) : /* @__PURE__ */ jsx(Slot, { className: LEADING_SLOT, children: leading }),
|
|
401
387
|
/* @__PURE__ */ jsxs("div", { className: TEXT, children: [
|
|
402
388
|
meta === void 0 && trailing === void 0 ? /* @__PURE__ */ jsx(Toast.Title, { className: TITLE }) : /* @__PURE__ */ jsxs("div", { className: TITLE_ROW, children: [
|
|
403
389
|
/* @__PURE__ */ jsx(Toast.Title, { className: TITLE }),
|
|
@@ -408,7 +394,7 @@ function ToastList({ position, stacked, countdown }) {
|
|
|
408
394
|
addOn === void 0 ? null : /* @__PURE__ */ jsx("div", { className: ADDON, children: addOn }),
|
|
409
395
|
actions?.length ? /* @__PURE__ */ jsx(ToastActionRow, { actions, id: item.id }) : null
|
|
410
396
|
] }),
|
|
411
|
-
/* @__PURE__ */ jsx(Toast.Close, { className: cn(CLOSE, !compact && CLOSE_TALL), "aria-label":
|
|
397
|
+
/* @__PURE__ */ jsx(Toast.Close, { className: cn(CLOSE, !compact && CLOSE_TALL), "aria-label": t.dismiss, children: /* @__PURE__ */ jsx(XIcon, { className: "size-4" }) })
|
|
412
398
|
] }),
|
|
413
399
|
runFor > 0 ? (
|
|
414
400
|
// Keyed on `updateKey` so `toast.update` — which resets Base UI's dismiss timer —
|
|
@@ -428,6 +414,7 @@ function ToastList({ position, stacked, countdown }) {
|
|
|
428
414
|
}
|
|
429
415
|
function ToastRegion(props) {
|
|
430
416
|
const { position, stacked, countdown, duration, limit, primary, className, children } = props;
|
|
417
|
+
const t = useLabels("toast", TOAST_LABELS, void 0);
|
|
431
418
|
warnPositiveInt("ToastProvider", "limit", limit);
|
|
432
419
|
const region = regionFor(position);
|
|
433
420
|
React.useEffect(() => {
|
|
@@ -446,7 +433,7 @@ function ToastRegion(props) {
|
|
|
446
433
|
/* @__PURE__ */ jsx(Toast.Portal, { children: /* @__PURE__ */ jsx(
|
|
447
434
|
Toast.Viewport,
|
|
448
435
|
{
|
|
449
|
-
"aria-label":
|
|
436
|
+
"aria-label": t.region({ position, primary }),
|
|
450
437
|
className: cn(VIEWPORT, VIEWPORT_POSITION[position], !stacked && VIEWPORT_LIST[EDGE[position]], className),
|
|
451
438
|
children: /* @__PURE__ */ jsx(ToastList, { position, stacked, countdown })
|
|
452
439
|
}
|
|
@@ -459,7 +446,8 @@ var subscribeToRegions = (onChange) => {
|
|
|
459
446
|
};
|
|
460
447
|
var regionsSnapshot = () => regionsVersion;
|
|
461
448
|
function ToastProvider(props) {
|
|
462
|
-
const { duration = 5e3, limit = 3, position = "top-right", stacked = true, countdown = true, className, children } = props;
|
|
449
|
+
const { duration = 5e3, limit = 3, position = "top-right", stacked = true, countdown = true, className, labels, children } = props;
|
|
450
|
+
const mergedLabels = usePublishedLabels("toast", labels);
|
|
463
451
|
defaultTimeout = duration;
|
|
464
452
|
defaultPosition = position;
|
|
465
453
|
React.useEffect(() => {
|
|
@@ -482,7 +470,7 @@ function ToastProvider(props) {
|
|
|
482
470
|
const positions = React.useMemo(() => {
|
|
483
471
|
return [.../* @__PURE__ */ new Set([position, ...regions.keys()])];
|
|
484
472
|
}, [position, version]);
|
|
485
|
-
return /* @__PURE__ */ jsx(
|
|
473
|
+
return /* @__PURE__ */ jsx(LabelsContext.Provider, { value: mergedLabels, children: positions.map((p) => /* @__PURE__ */ jsx(
|
|
486
474
|
ToastRegion,
|
|
487
475
|
{
|
|
488
476
|
position: p,
|
|
@@ -499,5 +487,5 @@ function ToastProvider(props) {
|
|
|
499
487
|
}
|
|
500
488
|
|
|
501
489
|
export { ToastProvider, toast };
|
|
502
|
-
//# sourceMappingURL=chunk-
|
|
503
|
-
//# sourceMappingURL=chunk-
|
|
490
|
+
//# sourceMappingURL=chunk-T5574MXM.js.map
|
|
491
|
+
//# sourceMappingURL=chunk-T5574MXM.js.map
|