jenosize-ui 0.2.0 → 0.2.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.
- 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 +10 -9
- 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 +16 -14
- 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-X2X7Q7NW.js → chunk-2R3QWWOT.js} +3 -3
- package/dist/{chunk-A46ED5JQ.js → chunk-33TOK7ES.js} +7 -5
- package/dist/{chunk-BNIWT6CW.js → chunk-3HOHLQVP.js} +7 -6
- 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-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-L53Y7KUV.js → chunk-5YWH2ANQ.js} +62 -29
- package/dist/{chunk-6UBYHSBX.js → chunk-5ZEUTSCV.js} +5 -5
- package/dist/{chunk-JAVNGTOE.js → chunk-6MMBQVRO.js} +58 -43
- package/dist/{chunk-RNXRZGXN.js → chunk-74AIU53R.js} +5 -3
- package/dist/{chunk-JMWYCT63.js → chunk-7GUPNTAH.js} +14 -6
- package/dist/{chunk-DCGTB7P7.js → chunk-7QXOGAN6.js} +111 -39
- package/dist/{chunk-TBN644IN.js → chunk-7ZM7SNCZ.js} +3 -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-FFTRB2UU.js → chunk-CFFWYXDW.js} +18 -6
- package/dist/{chunk-42FCPC77.js → chunk-CGHYXWTT.js} +10 -4
- package/dist/{chunk-FZBZGA3P.js → chunk-CGZXQ7PA.js} +4 -4
- package/dist/{chunk-GAFGIT4Q.js → chunk-D6XO4JVM.js} +30 -10
- package/dist/{chunk-GTHJWR3Q.js → chunk-D7EE5GWU.js} +21 -22
- package/dist/{chunk-USL3TDZM.js → chunk-DD5KJVFV.js} +321 -105
- package/dist/{chunk-NMERLWT7.js → chunk-E2YZ7IMT.js} +23 -7
- 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-PO2TYK3C.js → chunk-GWYDOZGQ.js} +3 -3
- package/dist/{chunk-HSVBTIP2.js → chunk-HHYEAFCL.js} +70 -27
- package/dist/{chunk-DTMYD63D.js → chunk-HV2W6HUR.js} +47 -27
- package/dist/{chunk-P7DH62UY.js → chunk-I6WMNXC7.js} +5 -5
- package/dist/{chunk-6HJA7NPL.js → chunk-IEAWNA3V.js} +9 -4
- package/dist/{chunk-34J5AANZ.js → chunk-IQNVSQRK.js} +3 -3
- package/dist/{chunk-MCUASLZH.js → chunk-KHGW72BM.js} +3 -3
- package/dist/{chunk-FIGBJGH2.js → chunk-KJ5JUS53.js} +115 -79
- package/dist/{chunk-4R7WDDCW.js → chunk-KZP6B6B3.js} +4 -4
- package/dist/{chunk-4W6AYGLR.js → chunk-LE44X5GS.js} +55 -39
- package/dist/{chunk-7HV6EIGZ.js → chunk-LLPWQDF7.js} +3 -3
- 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-4BRMM3I5.js → chunk-MFFA5MXY.js} +7 -6
- package/dist/{chunk-PXEJ5RKO.js → chunk-N3RVMBPX.js} +6 -9
- package/dist/{chunk-VH35QHD4.js → chunk-NC63TYNW.js} +16 -8
- 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-VEOYCAJP.js → chunk-QNIKRB62.js} +27 -7
- package/dist/{chunk-JYBGO6GY.js → chunk-R4Z7BINC.js} +11 -8
- package/dist/chunk-RJTVCA62.js +42 -0
- package/dist/{chunk-3GT43XPK.js → chunk-SB3DG572.js} +15 -8
- package/dist/{chunk-FKVPAEJ6.js → chunk-SKJC2KYD.js} +4 -3
- 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-4HKDD3PR.js → chunk-TX57TNJS.js} +92 -58
- package/dist/{chunk-CWMFEF6R.js → chunk-UGBNYSBN.js} +81 -29
- 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-YPNL2NBD.js} +5 -5
- package/dist/{chunk-MYQ3FD4Y.js → chunk-ZD3MOLIB.js} +8 -5
- package/dist/{chunk-BD5YKFRA.js → chunk-ZR6HNKSN.js} +5 -3
- package/dist/{chunk-WKWAUU64.js → chunk-ZZSNTCCL.js} +6 -5
- package/dist/combobox.d.ts +5 -0
- package/dist/combobox.js +13 -12
- 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 +24 -22
- package/dist/dialog.d.ts +21 -1
- package/dist/dialog.js +11 -9
- package/dist/drawer.d.ts +11 -1
- package/dist/drawer.js +10 -8
- package/dist/dropdown-menu.d.ts +12 -0
- package/dist/dropdown-menu.js +7 -6
- package/dist/dropzone.d.ts +3 -2
- package/dist/dropzone.js +13 -12
- package/dist/form.d.ts +5 -4
- package/dist/form.js +61 -45
- 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 +83 -78
- 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 +15 -13
- 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 +10 -8
- 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/scroll-area.js +2 -2
- package/dist/select.d.ts +2 -1
- package/dist/select.js +15 -14
- package/dist/shared-CxAedkiy.d.ts +68 -0
- package/dist/sidebar-navigation.d.ts +36 -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 +37 -35
- 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,14 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DEFAULT_WEEK_START, resolveTimeZone, useControllable, startOfDayIn, dayKey, formatIn, displayYear, monthOf, differenceInDaysIn, startOfMonthIn, startOfLastDayOfMonthIn, toWireDate, toWireInstant, addDaysIn, startOfWeekIn, addMonthsIn, minutesFromMidnight, earlierOf, laterOf } from './chunk-FWRHBMWT.js';
|
|
2
|
+
import { Card } from './chunk-3HOHLQVP.js';
|
|
2
3
|
import { useAutoScroll, useDrag, snapToStep } from './chunk-P6CON2R2.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { Slot } from './chunk-52IFGFTL.js';
|
|
4
|
+
import { Popover } from './chunk-YPNL2NBD.js';
|
|
5
|
+
import { ScrollView } from './chunk-SKJC2KYD.js';
|
|
6
|
+
import { useLocaleConfig } from './chunk-YIHKQ63K.js';
|
|
7
|
+
import { ACCENT, SUBTLE } from './chunk-MCQG4H6T.js';
|
|
8
8
|
import { useIsomorphicLayoutEffect } from './chunk-EDSK6FEH.js';
|
|
9
|
+
import { Slot } from './chunk-52IFGFTL.js';
|
|
9
10
|
import { ChevronLeftIcon, ChevronRightIcon } from './chunk-BLIZ3CL3.js';
|
|
10
|
-
import { devWarn, warnStickyNoScrollport } from './chunk-QDYE5LVT.js';
|
|
11
11
|
import { cn } from './chunk-ZSNJ6UA3.js';
|
|
12
|
+
import { useLabels, usePublishedLabels, LabelsContext } from './chunk-RJTVCA62.js';
|
|
13
|
+
import { devWarn, warnStickyNoScrollport } from './chunk-QDYE5LVT.js';
|
|
12
14
|
import { enUS } from 'date-fns/locale';
|
|
13
15
|
import * as React from 'react';
|
|
14
16
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -176,6 +178,26 @@ function dayDelta(from, to, cfg) {
|
|
|
176
178
|
return differenceInDaysIn(to, from, cfg.timeZone);
|
|
177
179
|
}
|
|
178
180
|
|
|
181
|
+
// src/components/calendar/labels.ts
|
|
182
|
+
var CALENDAR_LABELS = {
|
|
183
|
+
/** The grid's landmark name, when the caller gave none. */
|
|
184
|
+
nav: (ctx) => `Calendar, ${ctx.period}`,
|
|
185
|
+
agendaEmpty: "Nothing scheduled this week.",
|
|
186
|
+
/** VISIBLE — the time grid's all-day row, in the hour gutter. Lowercase, matching the hour labels
|
|
187
|
+
* beneath it ("9 AM"), and the one string in this scope a user READS rather than hears. */
|
|
188
|
+
allDay: "all-day",
|
|
189
|
+
/** A day cell that cannot take an event. */
|
|
190
|
+
unavailable: (ctx) => `${ctx.name} (unavailable)`,
|
|
191
|
+
/** A time-grid slot button — the same "(unavailable)" suffix, on a name that includes the hour. */
|
|
192
|
+
slot: (ctx) => `${ctx.when}${ctx.placeable ? "" : " (unavailable)"}`,
|
|
193
|
+
/** The week-of-month readout. */
|
|
194
|
+
weekNumber: (ctx) => `Week ${ctx.week}`,
|
|
195
|
+
/* ── the keyboard grab's live region ───────────────────────────────── */
|
|
196
|
+
grabbed: (ctx) => `Grabbed ${ctx.title}. Use arrow keys to move, Enter to confirm, Escape to cancel.`,
|
|
197
|
+
movedTo: (ctx) => `${ctx.title} moved to ${ctx.when}`,
|
|
198
|
+
nowEndsAt: (ctx) => `${ctx.title} now ends at ${ctx.time}`
|
|
199
|
+
};
|
|
200
|
+
|
|
179
201
|
// src/components/calendar/layout.ts
|
|
180
202
|
function byStartThenEndThenId(a, b) {
|
|
181
203
|
return a.start.getTime() - b.start.getTime() || a.end.getTime() - b.end.getTime() || (a.id < b.id ? -1 : a.id > b.id ? 1 : 0);
|
|
@@ -304,9 +326,9 @@ function useCalendar(options) {
|
|
|
304
326
|
defaultFocusedDate,
|
|
305
327
|
onFocusedDateChange,
|
|
306
328
|
timeZone: timeZoneProp,
|
|
307
|
-
locale
|
|
308
|
-
weekStartsOn
|
|
309
|
-
era
|
|
329
|
+
locale: localeProp,
|
|
330
|
+
weekStartsOn: weekStartsOnProp,
|
|
331
|
+
era: eraProp,
|
|
310
332
|
now: nowProp,
|
|
311
333
|
hours = [0, 24],
|
|
312
334
|
slotDuration = 30,
|
|
@@ -323,7 +345,12 @@ function useCalendar(options) {
|
|
|
323
345
|
return () => clearInterval(id);
|
|
324
346
|
}, [pinned]);
|
|
325
347
|
const now = nowProp ?? autoNow;
|
|
326
|
-
const
|
|
348
|
+
const labels = useLabels("calendar", CALENDAR_LABELS, void 0);
|
|
349
|
+
const app = useLocaleConfig();
|
|
350
|
+
const locale = localeProp ?? app.locale ?? enUS;
|
|
351
|
+
const weekStartsOn = weekStartsOnProp ?? app.weekStartsOn ?? DEFAULT_WEEK_START;
|
|
352
|
+
const era = eraProp ?? app.era ?? "ce";
|
|
353
|
+
const timeZone = resolveTimeZone(timeZoneProp ?? app.timeZone);
|
|
327
354
|
const bothView = viewProp !== void 0 && options.defaultView !== void 0;
|
|
328
355
|
const bothFocused = focusedProp !== void 0 && defaultFocusedDate !== void 0;
|
|
329
356
|
const warnedBoth = React.useRef(false);
|
|
@@ -385,7 +412,7 @@ function useCalendar(options) {
|
|
|
385
412
|
const periodLabel = React.useMemo(() => buildPeriodLabel(view, focusedDate, config), [view, focusedKey, config]);
|
|
386
413
|
const rangeLabel = React.useMemo(() => buildRangeLabel(view, focusedDate, config), [view, focusedKey, config]);
|
|
387
414
|
const monthLabel = React.useMemo(() => buildMonthLabel(focusedDate, config), [focusedKey, config]);
|
|
388
|
-
const weekLabel = React.useMemo(() => buildWeekLabel(focusedDate, config), [focusedKey, config]);
|
|
415
|
+
const weekLabel = React.useMemo(() => buildWeekLabel(focusedDate, config, labels), [focusedKey, config, labels]);
|
|
389
416
|
const todayLabel = React.useMemo(() => buildTodayLabel(config), [config]);
|
|
390
417
|
const [draft, setDraft] = React.useState(null);
|
|
391
418
|
const [grabbed, setGrabbed] = React.useState(null);
|
|
@@ -442,9 +469,9 @@ function buildPeriodLabel(view, focused, cfg) {
|
|
|
442
469
|
function buildMonthLabel(focused, cfg) {
|
|
443
470
|
return `${formatIn(focused, cfg.timeZone, "LLLL", cfg.locale)} ${displayYear(focused, cfg.timeZone, cfg.era)}`;
|
|
444
471
|
}
|
|
445
|
-
function buildWeekLabel(focused, cfg) {
|
|
472
|
+
function buildWeekLabel(focused, cfg, t) {
|
|
446
473
|
const offset = differenceInDaysIn(focused, startOfMonthIn(focused, cfg.timeZone), cfg.timeZone);
|
|
447
|
-
return
|
|
474
|
+
return t.weekNumber({ week: Math.floor(offset / 7) + 1 });
|
|
448
475
|
}
|
|
449
476
|
function buildTodayLabel(cfg) {
|
|
450
477
|
return {
|
|
@@ -636,9 +663,10 @@ EventChip.displayName = "EventChip";
|
|
|
636
663
|
function AgendaView({ instance, size, focusRef }) {
|
|
637
664
|
const { config, layout, onEventClick } = instance;
|
|
638
665
|
const { groups } = layout;
|
|
666
|
+
const t = useLabels("calendar", CALENDAR_LABELS, void 0);
|
|
639
667
|
const total = groups.reduce((sum, g) => sum + g.events.length, 0);
|
|
640
668
|
if (total === 0) {
|
|
641
|
-
return /* @__PURE__ */ jsx("div", { ref: focusRef, className: "min-w-0", children: /* @__PURE__ */ jsx(Card, { variant: "subtle", padding: "lg", className: "text-center", children: /* @__PURE__ */ jsx("p", { className: "text-sm text-tertiary", children:
|
|
669
|
+
return /* @__PURE__ */ jsx("div", { ref: focusRef, className: "min-w-0", children: /* @__PURE__ */ jsx(Card, { variant: "subtle", padding: "lg", className: "text-center", children: /* @__PURE__ */ jsx("p", { className: "text-sm text-tertiary", children: t.agendaEmpty }) }) });
|
|
642
670
|
}
|
|
643
671
|
return /* @__PURE__ */ jsx("div", { ref: focusRef, className: "min-w-0", children: /* @__PURE__ */ jsx(Card, { variant: "outlined", padding: "none", children: /* @__PURE__ */ jsx("dl", { className: "m-0 flex flex-col", children: groups.map((group, index) => /* @__PURE__ */ jsxs("div", { className: cn("flex min-w-0 flex-col gap-2 p-4 sm:flex-row sm:gap-6", index > 0 && cn("border-t", GRID_LINE)), children: [
|
|
644
672
|
/* @__PURE__ */ jsxs("dt", { className: "flex shrink-0 items-baseline gap-2 sm:w-32 sm:flex-col sm:gap-0.5", children: [
|
|
@@ -849,17 +877,18 @@ TimeGhost.displayName = "TimeGhost";
|
|
|
849
877
|
LaneGhost.displayName = "LaneGhost";
|
|
850
878
|
var ANNOUNCE_MS = 300;
|
|
851
879
|
var ARROWS = /* @__PURE__ */ new Set(["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"]);
|
|
852
|
-
function describe(event, range, kind, instance) {
|
|
880
|
+
function describe(event, range, kind, instance, t) {
|
|
853
881
|
const { timeZone: tz, locale } = instance.config;
|
|
854
882
|
if (kind === "resize") {
|
|
855
|
-
return
|
|
883
|
+
return t.nowEndsAt({ title: event.title, time: formatIn(range.end, tz, "HH:mm", locale) });
|
|
856
884
|
}
|
|
857
885
|
const when = formatIn(range.start, tz, event.allDay === true ? "EEEE d MMMM" : "EEEE HH:mm", locale);
|
|
858
|
-
return
|
|
886
|
+
return t.movedTo({ title: event.title, when });
|
|
859
887
|
}
|
|
860
888
|
function useGrabMode(instance) {
|
|
861
889
|
const { config, canPlace, setDraft, commit, grabbed, setGrabbed } = instance;
|
|
862
890
|
const [announcement, setAnnouncement] = React.useState("");
|
|
891
|
+
const t = useLabels("calendar", CALENDAR_LABELS, void 0);
|
|
863
892
|
const range = React.useRef(null);
|
|
864
893
|
const timer = React.useRef(null);
|
|
865
894
|
const latest = React.useRef({ config, canPlace, setDraft, commit, grabbed, setGrabbed, instance });
|
|
@@ -892,7 +921,7 @@ function useGrabMode(instance) {
|
|
|
892
921
|
range.current = { start: event.start, end: event.end };
|
|
893
922
|
latest.current.setGrabbed(event);
|
|
894
923
|
latest.current.setDraft({ kind: "move", event, start: event.start, end: event.end, allDay: event.allDay === true, valid: true });
|
|
895
|
-
setAnnouncement(
|
|
924
|
+
setAnnouncement(t.grabbed({ title: event.title }));
|
|
896
925
|
return;
|
|
897
926
|
}
|
|
898
927
|
if (e.key === "Escape") {
|
|
@@ -938,7 +967,7 @@ function useGrabMode(instance) {
|
|
|
938
967
|
if (!latest.current.canPlace({ event, start: next.start, end: next.end, allDay })) return;
|
|
939
968
|
range.current = next;
|
|
940
969
|
latest.current.setDraft({ kind, event, start: next.start, end: next.end, allDay, valid: true });
|
|
941
|
-
announce(describe(event, next, kind, latest.current.instance));
|
|
970
|
+
announce(describe(event, next, kind, latest.current.instance, t));
|
|
942
971
|
},
|
|
943
972
|
[announce, release]
|
|
944
973
|
);
|
|
@@ -953,6 +982,7 @@ function useGrabMode(instance) {
|
|
|
953
982
|
}
|
|
954
983
|
var MONTH_CELL_BUDGET = 4;
|
|
955
984
|
function MonthView({ instance, size, focusRef }) {
|
|
985
|
+
const t = useLabels("calendar", CALENDAR_LABELS, void 0);
|
|
956
986
|
const { config, layout, visibleEvents, onEventClick, onSlotClick, canPlace, draft } = instance;
|
|
957
987
|
const { monthRows, lanes } = layout;
|
|
958
988
|
const gridRef = React.useRef(null);
|
|
@@ -988,7 +1018,7 @@ function MonthView({ instance, size, focusRef }) {
|
|
|
988
1018
|
"button",
|
|
989
1019
|
{
|
|
990
1020
|
type: "button",
|
|
991
|
-
"aria-label": placeable ? dayName :
|
|
1021
|
+
"aria-label": placeable ? dayName : t.unavailable({ name: dayName }),
|
|
992
1022
|
disabled: !placeable,
|
|
993
1023
|
onClick: placeable ? () => onSlotClick(wholeDay) : void 0,
|
|
994
1024
|
...placeable ? drag.createHandlers(day2, null) : {},
|
|
@@ -1082,6 +1112,7 @@ function MonthView({ instance, size, focusRef }) {
|
|
|
1082
1112
|
}
|
|
1083
1113
|
MonthView.displayName = "MonthView";
|
|
1084
1114
|
function TimeGridView({ instance, size, showNowLine, focusRef }) {
|
|
1115
|
+
const t = useLabels("calendar", CALENDAR_LABELS, void 0);
|
|
1085
1116
|
const { config, layout, onEventClick, onSlotClick, canPlace } = instance;
|
|
1086
1117
|
const { days, timed, lanes } = layout;
|
|
1087
1118
|
const slotHeight = SLOT_PX[size];
|
|
@@ -1167,7 +1198,7 @@ function TimeGridView({ instance, size, showNowLine, focusRef }) {
|
|
|
1167
1198
|
className: cn("grid", ALL_DAY_ROW, "grid-cols-[var(--cal-gutter)_1fr]"),
|
|
1168
1199
|
style: { "--cal-gutter": gutterWidth(size) },
|
|
1169
1200
|
children: [
|
|
1170
|
-
/* @__PURE__ */ jsx("div", { className: cn(GUTTER_W[size], "border-r py-1 pr-2 text-right", GRID_LINE, HOUR_GUTTER, "static"), children:
|
|
1201
|
+
/* @__PURE__ */ jsx("div", { className: cn(GUTTER_W[size], "border-r py-1 pr-2 text-right", GRID_LINE, HOUR_GUTTER, "static"), children: t.allDay }),
|
|
1171
1202
|
/* @__PURE__ */ jsxs("div", { className: cn("relative grid px-1 py-1", columnsClass), style: { minHeight: laneRows * (barHeight + BAR_GAP_PX) }, children: [
|
|
1172
1203
|
lanes.segments.map((segment) => /* @__PURE__ */ jsx(
|
|
1173
1204
|
"div",
|
|
@@ -1228,7 +1259,7 @@ function TimeGridView({ instance, size, showNowLine, focusRef }) {
|
|
|
1228
1259
|
disabled: !placeable,
|
|
1229
1260
|
onClick: placeable ? () => onSlotClick({ start, end, allDay: false }) : void 0,
|
|
1230
1261
|
...placeable ? drag.createHandlers(day2, i * config.slotDuration) : {},
|
|
1231
|
-
"aria-label":
|
|
1262
|
+
"aria-label": t.slot({ when: formatIn(start, config.timeZone, "EEEE d MMMM, HH:mm", config.locale), placeable }),
|
|
1232
1263
|
className: cn(
|
|
1233
1264
|
"absolute inset-x-0 border-b",
|
|
1234
1265
|
// TWO weights, not one. The hour keeps the full rule; the half hour gets a
|
|
@@ -1293,7 +1324,9 @@ function gutterWidth(size) {
|
|
|
1293
1324
|
}
|
|
1294
1325
|
TimeGridView.displayName = "TimeGridView";
|
|
1295
1326
|
function Calendar(props) {
|
|
1296
|
-
const { instance, size = "md", showNowLine = true, className } = props;
|
|
1327
|
+
const { instance, size = "md", showNowLine = true, labels, className } = props;
|
|
1328
|
+
const t = useLabels("calendar", CALENDAR_LABELS, labels);
|
|
1329
|
+
const publishedLabels = usePublishedLabels("calendar", labels);
|
|
1297
1330
|
const ariaLabel = props["aria-label"];
|
|
1298
1331
|
const rootRef = React.useRef(null);
|
|
1299
1332
|
const view = instance.view;
|
|
@@ -1301,17 +1334,17 @@ function Calendar(props) {
|
|
|
1301
1334
|
// Week and day are ONE implementation — day is a `dayCount` of 1, not a second grid.
|
|
1302
1335
|
/* @__PURE__ */ jsx(TimeGridView, { instance, size, showNowLine, focusRef: rootRef })
|
|
1303
1336
|
);
|
|
1304
|
-
return /* @__PURE__ */ jsx("div", { className: cn(CONTAINER, className), children: /* @__PURE__ */ jsx(
|
|
1337
|
+
return /* @__PURE__ */ jsx(LabelsContext.Provider, { value: publishedLabels, children: /* @__PURE__ */ jsx("div", { className: cn(CONTAINER, className), children: /* @__PURE__ */ jsx(
|
|
1305
1338
|
"section",
|
|
1306
1339
|
{
|
|
1307
|
-
"aria-label": ariaLabel ??
|
|
1340
|
+
"aria-label": ariaLabel ?? t.nav({ period: instance.periodLabel }),
|
|
1308
1341
|
className: cn(ROOT, "h-full"),
|
|
1309
1342
|
children: body
|
|
1310
1343
|
}
|
|
1311
|
-
) });
|
|
1344
|
+
) }) });
|
|
1312
1345
|
}
|
|
1313
1346
|
Calendar.displayName = "Calendar";
|
|
1314
1347
|
|
|
1315
1348
|
export { Calendar, isWireDate, parseEvent, serializeEvent, useCalendar };
|
|
1316
|
-
//# sourceMappingURL=chunk-
|
|
1317
|
-
//# sourceMappingURL=chunk-
|
|
1349
|
+
//# sourceMappingURL=chunk-5YWH2ANQ.js.map
|
|
1350
|
+
//# sourceMappingURL=chunk-5YWH2ANQ.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { controlBoxClasses } from './chunk-
|
|
2
|
-
import { useFieldValidity, FieldFrame, CONTROL_TEXT } from './chunk-
|
|
1
|
+
import { controlBoxClasses } from './chunk-X2VMIBK5.js';
|
|
2
|
+
import { useFieldValidity, FieldFrame, CONTROL_TEXT } from './chunk-5KSD4WKN.js';
|
|
3
3
|
import { CircleIcon, AsteriskIcon } from './chunk-BLIZ3CL3.js';
|
|
4
|
-
import { warnPositiveInt } from './chunk-QDYE5LVT.js';
|
|
5
4
|
import { cn } from './chunk-ZSNJ6UA3.js';
|
|
5
|
+
import { warnPositiveInt } from './chunk-QDYE5LVT.js';
|
|
6
6
|
import { OTPField } from '@base-ui/react/otp-field';
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
@@ -143,5 +143,5 @@ function VerificationCodeInput(props) {
|
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
export { VerificationCodeInput };
|
|
146
|
-
//# sourceMappingURL=chunk-
|
|
147
|
-
//# sourceMappingURL=chunk-
|
|
146
|
+
//# sourceMappingURL=chunk-5ZEUTSCV.js.map
|
|
147
|
+
//# sourceMappingURL=chunk-5ZEUTSCV.js.map
|
|
@@ -1,13 +1,51 @@
|
|
|
1
|
+
import { NativeSelect } from './chunk-I6WMNXC7.js';
|
|
1
2
|
import { Separator } from './chunk-7VLYQR4D.js';
|
|
2
|
-
import { Input } from './chunk-
|
|
3
|
-
import {
|
|
4
|
-
import { TooltipExport } from './chunk-4R7WDDCW.js';
|
|
3
|
+
import { Input } from './chunk-7GUPNTAH.js';
|
|
4
|
+
import { TooltipExport } from './chunk-KZP6B6B3.js';
|
|
5
5
|
import { ChevronsLeftIcon, ChevronLeftIcon, ChevronRightIcon, ChevronsRightIcon } from './chunk-BLIZ3CL3.js';
|
|
6
|
-
import { warnPositiveInt, warnNonNegativeInt } from './chunk-QDYE5LVT.js';
|
|
7
6
|
import { cn } from './chunk-ZSNJ6UA3.js';
|
|
7
|
+
import { useLabels } from './chunk-RJTVCA62.js';
|
|
8
|
+
import { warnPositiveInt, warnNonNegativeInt } from './chunk-QDYE5LVT.js';
|
|
8
9
|
import * as React from 'react';
|
|
9
10
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
10
11
|
|
|
12
|
+
// src/components/pagination/labels.ts
|
|
13
|
+
var PAGINATION_LABELS = {
|
|
14
|
+
/** The `<nav>` landmark. */
|
|
15
|
+
nav: "Pagination",
|
|
16
|
+
/** VISIBLE — the readout word before the page number. */
|
|
17
|
+
page: "Page",
|
|
18
|
+
/**
|
|
19
|
+
* VISIBLE — the words AFTER the page number, carrying the total: `Page` [3] `of 12`.
|
|
20
|
+
*
|
|
21
|
+
* Two keys bracketing the number rather than one whole-sentence key, because under `goto` the
|
|
22
|
+
* middle of that sentence is an `<input>`. A label returns a STRING, so it cannot wrap a node —
|
|
23
|
+
* the field has to sit between two labels. Thai keeps the same order (`หน้า` 3 `จาก 12`), so the
|
|
24
|
+
* bracket is a fit here and not a compromise; a language that puts the total first would need
|
|
25
|
+
* this pair rethought, and the existing `page` key already carried that constraint.
|
|
26
|
+
*/
|
|
27
|
+
ofTotal: (ctx) => `of ${ctx.total}`,
|
|
28
|
+
/** The jump input's accessible name. */
|
|
29
|
+
goToPage: "Go to page",
|
|
30
|
+
/** Each numbered button. */
|
|
31
|
+
pageNumber: (ctx) => `Page ${ctx.page}`,
|
|
32
|
+
/** VISIBLE and also the select's accessible name — one key, both sites, because they are one
|
|
33
|
+
* phrase and a translation that split them would be saying two things. */
|
|
34
|
+
rowsPerPage: "Rows per page",
|
|
35
|
+
/**
|
|
36
|
+
* VISIBLE — the result count beside the pager.
|
|
37
|
+
*
|
|
38
|
+
* `formatted` arrives already locale-grouped (`"1,204"`), because formatting is the component's
|
|
39
|
+
* decision and a translator must never have to reimplement `toLocaleString`. `count` is the raw
|
|
40
|
+
* number, there for a plural rule: English owns its own two-form branch here, so a language with
|
|
41
|
+
* three forms overrides the whole function rather than fighting a hard-coded `s`.
|
|
42
|
+
*/
|
|
43
|
+
results: (ctx) => `${ctx.formatted} ${ctx.count === 1 ? "result" : "results"}`,
|
|
44
|
+
first: "First page",
|
|
45
|
+
previous: "Previous page",
|
|
46
|
+
next: "Next page",
|
|
47
|
+
last: "Last page"
|
|
48
|
+
};
|
|
11
49
|
var ELLIPSIS = "\u2026";
|
|
12
50
|
function pageWindow(page, pageCount, siblingCount = 1) {
|
|
13
51
|
const total = Math.max(1, pageCount);
|
|
@@ -84,8 +122,10 @@ function Pagination({
|
|
|
84
122
|
goto = false,
|
|
85
123
|
siblingCount = 1,
|
|
86
124
|
disabled,
|
|
125
|
+
labels,
|
|
87
126
|
className
|
|
88
127
|
}) {
|
|
128
|
+
const t = useLabels("pagination", PAGINATION_LABELS, labels);
|
|
89
129
|
const total = Math.max(1, pageCount);
|
|
90
130
|
const current = Math.min(Math.max(1, page), total);
|
|
91
131
|
React.useEffect(() => {
|
|
@@ -111,7 +151,7 @@ function Pagination({
|
|
|
111
151
|
{
|
|
112
152
|
size: "sm",
|
|
113
153
|
inputMode: "numeric",
|
|
114
|
-
"aria-label":
|
|
154
|
+
"aria-label": t.goToPage,
|
|
115
155
|
value: draft ?? String(current),
|
|
116
156
|
disabled,
|
|
117
157
|
onChange: (event) => setDraft(event.target.value),
|
|
@@ -132,12 +172,9 @@ function Pagination({
|
|
|
132
172
|
const showReadoutWords = variant !== "minimal";
|
|
133
173
|
const gotoInMetadata = goto && variant === "numbered";
|
|
134
174
|
const readoutBody = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
135
|
-
showReadoutWords ? /* @__PURE__ */ jsx("span", { children:
|
|
175
|
+
showReadoutWords ? /* @__PURE__ */ jsx("span", { children: t.page }) : null,
|
|
136
176
|
goto ? pageField : /* @__PURE__ */ jsx("span", { className: "font-medium text-primary", children: current }),
|
|
137
|
-
showReadoutWords ? /* @__PURE__ */
|
|
138
|
-
"of ",
|
|
139
|
-
total
|
|
140
|
-
] }) : null
|
|
177
|
+
showReadoutWords ? /* @__PURE__ */ jsx("span", { children: t.ofTotal({ total }) }) : null
|
|
141
178
|
] });
|
|
142
179
|
const metadata = [];
|
|
143
180
|
if (gotoInMetadata) {
|
|
@@ -152,12 +189,12 @@ function Pagination({
|
|
|
152
189
|
id: "size",
|
|
153
190
|
tier: 30,
|
|
154
191
|
node: (tierClass) => /* @__PURE__ */ jsxs("div", { className: cn("items-center gap-2 text-sm text-tertiary", tierClass), children: [
|
|
155
|
-
/* @__PURE__ */ jsx("span", { className: "whitespace-nowrap", children:
|
|
192
|
+
/* @__PURE__ */ jsx("span", { className: "whitespace-nowrap", children: t.rowsPerPage }),
|
|
156
193
|
/* @__PURE__ */ jsx(
|
|
157
194
|
NativeSelect,
|
|
158
195
|
{
|
|
159
196
|
size: "sm",
|
|
160
|
-
"aria-label":
|
|
197
|
+
"aria-label": t.rowsPerPage,
|
|
161
198
|
value: String(pageSize),
|
|
162
199
|
disabled,
|
|
163
200
|
onChange: (event) => onPageSizeChange(Number(event.target.value)),
|
|
@@ -171,14 +208,10 @@ function Pagination({
|
|
|
171
208
|
metadata.push({
|
|
172
209
|
id: "total",
|
|
173
210
|
tier: 42,
|
|
174
|
-
node: (tierClass) => /* @__PURE__ */
|
|
175
|
-
totalItems.toLocaleString(),
|
|
176
|
-
" ",
|
|
177
|
-
totalItems === 1 ? "result" : "results"
|
|
178
|
-
] })
|
|
211
|
+
node: (tierClass) => /* @__PURE__ */ jsx("span", { className: cn("text-sm whitespace-nowrap text-tertiary", tierClass), children: t.results({ count: totalItems, formatted: totalItems.toLocaleString() }) })
|
|
179
212
|
});
|
|
180
213
|
}
|
|
181
|
-
return /* @__PURE__ */ jsx("div", { className: cn("@container w-full", className), children: /* @__PURE__ */ jsxs("nav", { "aria-label":
|
|
214
|
+
return /* @__PURE__ */ jsx("div", { className: cn("@container w-full", className), children: /* @__PURE__ */ jsxs("nav", { "aria-label": t.nav, className: cn("flex w-full flex-wrap items-center gap-2 @[46rem]:gap-3", ALIGN[align]), children: [
|
|
182
215
|
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-3", children: metadata.map((member, index) => {
|
|
183
216
|
const previous = metadata[index - 1];
|
|
184
217
|
return /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
@@ -191,7 +224,7 @@ function Pagination({
|
|
|
191
224
|
variant === "numbered" ? /* @__PURE__ */ jsx(
|
|
192
225
|
Arrow,
|
|
193
226
|
{
|
|
194
|
-
label:
|
|
227
|
+
label: t.first,
|
|
195
228
|
icon: /* @__PURE__ */ jsx(ChevronsLeftIcon, {}),
|
|
196
229
|
color,
|
|
197
230
|
disabled: Boolean(disabled) || current <= 1,
|
|
@@ -199,16 +232,7 @@ function Pagination({
|
|
|
199
232
|
className: "hidden @[46rem]:flex"
|
|
200
233
|
}
|
|
201
234
|
) : null,
|
|
202
|
-
/* @__PURE__ */ jsx(
|
|
203
|
-
Arrow,
|
|
204
|
-
{
|
|
205
|
-
label: "Previous page",
|
|
206
|
-
icon: /* @__PURE__ */ jsx(ChevronLeftIcon, {}),
|
|
207
|
-
color,
|
|
208
|
-
disabled: Boolean(disabled) || current <= 1,
|
|
209
|
-
onClick: () => go(current - 1)
|
|
210
|
-
}
|
|
211
|
-
)
|
|
235
|
+
/* @__PURE__ */ jsx(Arrow, { label: t.previous, icon: /* @__PURE__ */ jsx(ChevronLeftIcon, {}), color, disabled: Boolean(disabled) || current <= 1, onClick: () => go(current - 1) })
|
|
212
236
|
] }),
|
|
213
237
|
variant === "numbered" ? /* @__PURE__ */ jsx("div", { className: "hidden items-center gap-0.5 @[46rem]:flex", children: pageWindow(current, total, siblingCount).map(
|
|
214
238
|
(entry, index) => entry === ELLIPSIS ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "flex size-9 shrink-0 items-center justify-center text-tertiary", children: ELLIPSIS }, `gap-${index}`) : /* @__PURE__ */ jsx(
|
|
@@ -217,7 +241,7 @@ function Pagination({
|
|
|
217
241
|
type: "button",
|
|
218
242
|
disabled,
|
|
219
243
|
"aria-current": entry === current ? "page" : void 0,
|
|
220
|
-
"aria-label":
|
|
244
|
+
"aria-label": t.pageNumber({ page: entry }),
|
|
221
245
|
onClick: () => go(entry),
|
|
222
246
|
className: cn(PAGE_BUTTON, entry === current ? PAGE_BUTTON_ACTIVE[color] : PAGE_BUTTON_IDLE[color]),
|
|
223
247
|
children: entry
|
|
@@ -242,20 +266,11 @@ function Pagination({
|
|
|
242
266
|
)
|
|
243
267
|
) : null,
|
|
244
268
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
245
|
-
/* @__PURE__ */ jsx(
|
|
246
|
-
Arrow,
|
|
247
|
-
{
|
|
248
|
-
label: "Next page",
|
|
249
|
-
icon: /* @__PURE__ */ jsx(ChevronRightIcon, {}),
|
|
250
|
-
color,
|
|
251
|
-
disabled: Boolean(disabled) || current >= total,
|
|
252
|
-
onClick: () => go(current + 1)
|
|
253
|
-
}
|
|
254
|
-
),
|
|
269
|
+
/* @__PURE__ */ jsx(Arrow, { label: t.next, icon: /* @__PURE__ */ jsx(ChevronRightIcon, {}), color, disabled: Boolean(disabled) || current >= total, onClick: () => go(current + 1) }),
|
|
255
270
|
variant === "numbered" ? /* @__PURE__ */ jsx(
|
|
256
271
|
Arrow,
|
|
257
272
|
{
|
|
258
|
-
label:
|
|
273
|
+
label: t.last,
|
|
259
274
|
icon: /* @__PURE__ */ jsx(ChevronsRightIcon, {}),
|
|
260
275
|
color,
|
|
261
276
|
disabled: Boolean(disabled) || current >= total,
|
|
@@ -270,5 +285,5 @@ function Pagination({
|
|
|
270
285
|
Pagination.displayName = "Pagination";
|
|
271
286
|
|
|
272
287
|
export { Pagination, pageWindow };
|
|
273
|
-
//# sourceMappingURL=chunk-
|
|
274
|
-
//# sourceMappingURL=chunk-
|
|
288
|
+
//# sourceMappingURL=chunk-6MMBQVRO.js.map
|
|
289
|
+
//# sourceMappingURL=chunk-6MMBQVRO.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useControllableOpen, DialogSurface } from './chunk-
|
|
1
|
+
import { useControllableOpen, DialogSurface } from './chunk-QNIKRB62.js';
|
|
2
2
|
import { AlertDialog as AlertDialog$1 } from '@base-ui/react/alert-dialog';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
@@ -10,6 +10,7 @@ function AlertDialog(props) {
|
|
|
10
10
|
defaultOpen = false,
|
|
11
11
|
onOpenChange,
|
|
12
12
|
size = "md",
|
|
13
|
+
backdrop = "scrim",
|
|
13
14
|
showClose = false,
|
|
14
15
|
dividers = "line",
|
|
15
16
|
keepMounted = false,
|
|
@@ -33,6 +34,7 @@ function AlertDialog(props) {
|
|
|
33
34
|
DialogSurface,
|
|
34
35
|
{
|
|
35
36
|
size,
|
|
37
|
+
backdrop,
|
|
36
38
|
showClose,
|
|
37
39
|
dividers,
|
|
38
40
|
keepMounted,
|
|
@@ -53,5 +55,5 @@ function AlertDialog(props) {
|
|
|
53
55
|
AlertDialog.displayName = "AlertDialog";
|
|
54
56
|
|
|
55
57
|
export { AlertDialog };
|
|
56
|
-
//# sourceMappingURL=chunk-
|
|
57
|
-
//# sourceMappingURL=chunk-
|
|
58
|
+
//# sourceMappingURL=chunk-74AIU53R.js.map
|
|
59
|
+
//# sourceMappingURL=chunk-74AIU53R.js.map
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { useControlScrollFade } from './chunk-7EUAMHMU.js';
|
|
2
|
-
import { FieldShell } from './chunk-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { FieldShell } from './chunk-X2VMIBK5.js';
|
|
3
|
+
import { useFieldValidity, FieldFrame } from './chunk-5KSD4WKN.js';
|
|
4
|
+
import { useSeamlessSlot } from './chunk-7ZM7SNCZ.js';
|
|
5
5
|
import { EyeOffIcon, EyeIcon } from './chunk-BLIZ3CL3.js';
|
|
6
6
|
import { cn } from './chunk-ZSNJ6UA3.js';
|
|
7
|
+
import { useLabels } from './chunk-RJTVCA62.js';
|
|
7
8
|
import { Field } from '@base-ui/react/field';
|
|
8
9
|
import * as React from 'react';
|
|
9
10
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
10
11
|
|
|
12
|
+
// src/components/input/labels.ts
|
|
13
|
+
var INPUT_LABELS = {
|
|
14
|
+
showPassword: "Show password",
|
|
15
|
+
hidePassword: "Hide password"
|
|
16
|
+
};
|
|
11
17
|
function InputAddon({ size: sizeProp, children, className }) {
|
|
12
18
|
const slot = useSeamlessSlot();
|
|
13
19
|
const size = sizeProp ?? slot?.size ?? "md";
|
|
@@ -35,8 +41,10 @@ function Input(props) {
|
|
|
35
41
|
name,
|
|
36
42
|
id,
|
|
37
43
|
className,
|
|
44
|
+
labels,
|
|
38
45
|
...rest
|
|
39
46
|
} = props;
|
|
47
|
+
const t = useLabels("input", INPUT_LABELS, labels);
|
|
40
48
|
const [revealed, setRevealed] = React.useState(false);
|
|
41
49
|
const isPassword = type === "password";
|
|
42
50
|
const controlType = isPassword ? revealed ? "text" : "password" : type;
|
|
@@ -75,7 +83,7 @@ function Input(props) {
|
|
|
75
83
|
type: "button",
|
|
76
84
|
disabled,
|
|
77
85
|
onClick: () => setRevealed((v) => !v),
|
|
78
|
-
"aria-label": revealed ?
|
|
86
|
+
"aria-label": revealed ? t.hidePassword : t.showPassword,
|
|
79
87
|
className: cn(
|
|
80
88
|
"inline-flex shrink-0 cursor-pointer text-fg-quaternary transition duration-100 ease-linear outline-none disabled:cursor-not-allowed",
|
|
81
89
|
"hover:text-fg-quaternary_hover focus-visible:text-fg-quaternary_hover",
|
|
@@ -106,5 +114,5 @@ function Input(props) {
|
|
|
106
114
|
}
|
|
107
115
|
|
|
108
116
|
export { Input, InputAddon };
|
|
109
|
-
//# sourceMappingURL=chunk-
|
|
110
|
-
//# sourceMappingURL=chunk-
|
|
117
|
+
//# sourceMappingURL=chunk-7GUPNTAH.js.map
|
|
118
|
+
//# sourceMappingURL=chunk-7GUPNTAH.js.map
|