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 { DEFAULT_WEEK_START, useControllable, DEFAULT_WEEK_START_INDEX, weekStartIndex, toWireDate } from './chunk-
|
|
2
|
-
import { Popover } from './chunk-
|
|
3
|
-
import { DateInput } from './chunk-
|
|
4
|
-
import { DEFAULT_FORMAT, parseFormat, fromISO, BE_OFFSET } from './chunk-
|
|
5
|
-
import { Button } from './chunk-A5WQLN4B.js';
|
|
1
|
+
import { DEFAULT_WEEK_START, useControllable, DEFAULT_WEEK_START_INDEX, weekStartIndex, toWireDate } from './chunk-FWRHBMWT.js';
|
|
2
|
+
import { Popover } from './chunk-YPNL2NBD.js';
|
|
3
|
+
import { DateInput } from './chunk-E2YZ7IMT.js';
|
|
4
|
+
import { DEFAULT_FORMAT, parseFormat, fromISO, BE_OFFSET } from './chunk-3QXLIZIX.js';
|
|
6
5
|
import { INTRINSIC_CELL, INTRINSIC_STACK, IntrinsicWidth } from './chunk-7S2TBALK.js';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { useLocaleConfig } from './chunk-YIHKQ63K.js';
|
|
7
|
+
import { Button } from './chunk-OACWA4TC.js';
|
|
8
|
+
import { FieldShell } from './chunk-X2VMIBK5.js';
|
|
9
|
+
import { useFieldValidity, FieldFrame, CONTROL_ICON } from './chunk-5KSD4WKN.js';
|
|
9
10
|
import { CalendarIcon, ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon } from './chunk-BLIZ3CL3.js';
|
|
10
|
-
import { warnPositiveInt, devWarn } from './chunk-QDYE5LVT.js';
|
|
11
11
|
import { cn } from './chunk-ZSNJ6UA3.js';
|
|
12
|
+
import { useLabels, usePublishedLabels, LabelsContext } from './chunk-RJTVCA62.js';
|
|
13
|
+
import { warnPositiveInt, devWarn } from './chunk-QDYE5LVT.js';
|
|
12
14
|
import { enUS } from 'date-fns/locale';
|
|
13
15
|
import * as React5 from 'react';
|
|
14
16
|
import { startOfDay, subDays, endOfWeek, startOfWeek, endOfMonth, startOfMonth, subMonths, endOfYear, startOfYear, subYears, isValid, addYears, format } from 'date-fns';
|
|
@@ -371,6 +373,35 @@ function DayGrid(props) {
|
|
|
371
373
|
const value = selected;
|
|
372
374
|
return /* @__PURE__ */ jsx(DayPicker, { ...shared, mode: "single", selected: value ?? void 0, onSelect: (next) => onSelect(next ?? null) });
|
|
373
375
|
}
|
|
376
|
+
|
|
377
|
+
// src/components/date-picker/labels.ts
|
|
378
|
+
var DATE_PICKER_LABELS = {
|
|
379
|
+
/** The trigger's accessible name when the field has no `label`. */
|
|
380
|
+
openCalendar: "Choose a date",
|
|
381
|
+
openRange: "Choose a date range",
|
|
382
|
+
/** The two typed segments of a range. */
|
|
383
|
+
startDate: "Start date",
|
|
384
|
+
endDate: "End date",
|
|
385
|
+
/** The confirm footer, shown under `commit="confirm"`. */
|
|
386
|
+
cancel: "Cancel",
|
|
387
|
+
apply: "Apply",
|
|
388
|
+
/** Defaults behind the `placeholder` props — each prop still wins. */
|
|
389
|
+
placeholder: "Select date",
|
|
390
|
+
rangePlaceholder: "Select dates",
|
|
391
|
+
/** Defaults behind the standalone calendars' `aria-label`. */
|
|
392
|
+
calendarName: "Calendar",
|
|
393
|
+
rangeCalendarName: "Date range calendar",
|
|
394
|
+
/**
|
|
395
|
+
* Appended to the trigger's accessible name when the field is required, visually hidden —
|
|
396
|
+
* `aria-required` is illegal on `role="button"`, so the requirement has to travel in the NAME.
|
|
397
|
+
*
|
|
398
|
+
* Deliberately the bare word, NOT the `", required"` that `FIELD_LABELS` and `DROPZONE_LABELS`
|
|
399
|
+
* carry: this converts an existing literal and the pass's rule is that a default is byte-identical
|
|
400
|
+
* to what it replaced. The three spellings SHOULD agree — the comma is a pause a screen reader
|
|
401
|
+
* honours — but changing what a picker announces is a decision, not a conversion.
|
|
402
|
+
*/
|
|
403
|
+
required: "required"
|
|
404
|
+
};
|
|
374
405
|
function DateCalendar(props) {
|
|
375
406
|
const {
|
|
376
407
|
value,
|
|
@@ -379,13 +410,19 @@ function DateCalendar(props) {
|
|
|
379
410
|
min,
|
|
380
411
|
max,
|
|
381
412
|
disabledDates,
|
|
382
|
-
locale
|
|
383
|
-
weekStartsOn
|
|
384
|
-
era
|
|
413
|
+
locale: localeProp,
|
|
414
|
+
weekStartsOn: weekStartsOnProp,
|
|
415
|
+
era: eraProp,
|
|
416
|
+
labels,
|
|
385
417
|
size = "md",
|
|
386
418
|
defaultMonth,
|
|
387
419
|
className
|
|
388
420
|
} = props;
|
|
421
|
+
const t = useLabels("datePicker", DATE_PICKER_LABELS, labels);
|
|
422
|
+
const app = useLocaleConfig();
|
|
423
|
+
const locale = localeProp ?? app.locale ?? enUS;
|
|
424
|
+
const era = eraProp ?? app.era ?? "ce";
|
|
425
|
+
const weekStartsOn = weekStartsOnProp ?? app.weekStartsOn ?? DEFAULT_WEEK_START;
|
|
389
426
|
const [selected, setSelected] = useControllable(value, defaultValue, onValueChange);
|
|
390
427
|
const normalized = React5.useMemo(() => toCalendarDate(selected), [selected]);
|
|
391
428
|
return /* @__PURE__ */ jsx(
|
|
@@ -402,7 +439,7 @@ function DateCalendar(props) {
|
|
|
402
439
|
era,
|
|
403
440
|
size,
|
|
404
441
|
defaultMonth,
|
|
405
|
-
ariaLabel: props["aria-label"] ??
|
|
442
|
+
ariaLabel: props["aria-label"] ?? t.calendarName,
|
|
406
443
|
className
|
|
407
444
|
}
|
|
408
445
|
);
|
|
@@ -420,13 +457,19 @@ function DateRangeCalendar(props) {
|
|
|
420
457
|
min,
|
|
421
458
|
max,
|
|
422
459
|
disabledDates,
|
|
423
|
-
locale
|
|
424
|
-
weekStartsOn
|
|
425
|
-
era
|
|
460
|
+
locale: localeProp,
|
|
461
|
+
weekStartsOn: weekStartsOnProp,
|
|
462
|
+
era: eraProp,
|
|
463
|
+
labels,
|
|
426
464
|
size = "md",
|
|
427
465
|
defaultMonth,
|
|
428
466
|
className
|
|
429
467
|
} = props;
|
|
468
|
+
const t = useLabels("datePicker", DATE_PICKER_LABELS, labels);
|
|
469
|
+
const app = useLocaleConfig();
|
|
470
|
+
const locale = localeProp ?? app.locale ?? enUS;
|
|
471
|
+
const era = eraProp ?? app.era ?? "ce";
|
|
472
|
+
const weekStartsOn = weekStartsOnProp ?? app.weekStartsOn ?? DEFAULT_WEEK_START;
|
|
430
473
|
const [selected, setSelected] = useControllable(value, defaultValue, (next) => onValueChange?.(next ?? EMPTY_RANGE));
|
|
431
474
|
const normalized = React5.useMemo(
|
|
432
475
|
() => ({ start: toCalendarDate(selected?.start), end: toCalendarDate(selected?.end) }),
|
|
@@ -449,7 +492,7 @@ function DateRangeCalendar(props) {
|
|
|
449
492
|
era,
|
|
450
493
|
size,
|
|
451
494
|
defaultMonth,
|
|
452
|
-
ariaLabel: props["aria-label"] ??
|
|
495
|
+
ariaLabel: props["aria-label"] ?? t.rangeCalendarName,
|
|
453
496
|
className
|
|
454
497
|
}
|
|
455
498
|
);
|
|
@@ -627,9 +670,10 @@ function usePickerDraft(committed, commit, setCommitted, onOpen) {
|
|
|
627
670
|
};
|
|
628
671
|
}
|
|
629
672
|
function ApplyRow({ onCancel, onApply, disabled }) {
|
|
673
|
+
const t = useLabels("datePicker", DATE_PICKER_LABELS, void 0);
|
|
630
674
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
631
|
-
/* @__PURE__ */ jsx(Button, { type: "button", variant: "secondary", color: "neutral", size: "sm", onClick: onCancel, children:
|
|
632
|
-
/* @__PURE__ */ jsx(Button, { type: "button", variant: "primary", size: "sm", onClick: onApply, disabled, children:
|
|
675
|
+
/* @__PURE__ */ jsx(Button, { type: "button", variant: "secondary", color: "neutral", size: "sm", onClick: onCancel, children: t.cancel }),
|
|
676
|
+
/* @__PURE__ */ jsx(Button, { type: "button", variant: "primary", size: "sm", onClick: onApply, disabled, children: t.apply })
|
|
633
677
|
] });
|
|
634
678
|
}
|
|
635
679
|
var BODY = "flex flex-col gap-3";
|
|
@@ -642,7 +686,7 @@ function DatePicker(props) {
|
|
|
642
686
|
format: formatProp,
|
|
643
687
|
dateInputFormat = DEFAULT_FORMAT,
|
|
644
688
|
commit = "instant",
|
|
645
|
-
placeholder
|
|
689
|
+
placeholder: placeholderProp,
|
|
646
690
|
side = "bottom",
|
|
647
691
|
align = "start",
|
|
648
692
|
label,
|
|
@@ -664,13 +708,21 @@ function DatePicker(props) {
|
|
|
664
708
|
min,
|
|
665
709
|
max,
|
|
666
710
|
disabledDates,
|
|
667
|
-
locale
|
|
668
|
-
weekStartsOn
|
|
669
|
-
era
|
|
711
|
+
locale: localeProp,
|
|
712
|
+
weekStartsOn: weekStartsOnProp,
|
|
713
|
+
era: eraProp,
|
|
714
|
+
labels,
|
|
670
715
|
size = "md",
|
|
671
716
|
defaultMonth,
|
|
672
717
|
className
|
|
673
718
|
} = props;
|
|
719
|
+
const t = useLabels("datePicker", DATE_PICKER_LABELS, labels);
|
|
720
|
+
const publishedLabels = usePublishedLabels("datePicker", labels);
|
|
721
|
+
const placeholder = placeholderProp ?? t.placeholder;
|
|
722
|
+
const app = useLocaleConfig();
|
|
723
|
+
const locale = localeProp ?? app.locale ?? enUS;
|
|
724
|
+
const era = eraProp ?? app.era ?? "ce";
|
|
725
|
+
const weekStartsOn = weekStartsOnProp ?? app.weekStartsOn ?? DEFAULT_WEEK_START;
|
|
674
726
|
const hasTime = hasTimeSegments(dateInputFormat);
|
|
675
727
|
const displayFormat = formatProp ?? defaultDisplayFormat(dateInputFormat);
|
|
676
728
|
const [rawCommitted, setCommitted] = useControllable(value, defaultValue, onValueChange);
|
|
@@ -730,12 +782,12 @@ function DatePicker(props) {
|
|
|
730
782
|
valueNode,
|
|
731
783
|
/* @__PURE__ */ jsx(IntrinsicWidth, { candidates: sizingCandidates, className: "font-medium" })
|
|
732
784
|
] }) : valueNode,
|
|
733
|
-
required && !hideRequiredIndicator ? /* @__PURE__ */ jsx("span", { id: requiredId, className: "sr-only", children:
|
|
785
|
+
required && !hideRequiredIndicator ? /* @__PURE__ */ jsx("span", { id: requiredId, className: "sr-only", children: t.required }) : null,
|
|
734
786
|
/* @__PURE__ */ jsx(TriggerGlyph, { size })
|
|
735
787
|
]
|
|
736
788
|
}
|
|
737
789
|
);
|
|
738
|
-
return /* @__PURE__ */ jsx(
|
|
790
|
+
return /* @__PURE__ */ jsx(LabelsContext.Provider, { value: publishedLabels, children: /* @__PURE__ */ jsx(
|
|
739
791
|
FieldFrame,
|
|
740
792
|
{
|
|
741
793
|
label,
|
|
@@ -787,10 +839,22 @@ function DatePicker(props) {
|
|
|
787
839
|
size: "lg",
|
|
788
840
|
className: "max-h-[var(--available-height)] max-w-none",
|
|
789
841
|
dividers: commit === "confirm" ? "line" : "none",
|
|
790
|
-
"aria-label": label ??
|
|
842
|
+
"aria-label": label ?? t.openCalendar,
|
|
791
843
|
footer: commit === "confirm" ? () => /* @__PURE__ */ jsx(ApplyRow, { onCancel: picker.close, onApply: picker.apply }) : void 0,
|
|
792
844
|
children: /* @__PURE__ */ jsxs("div", { className: BODY, children: [
|
|
793
|
-
/* @__PURE__ */ jsx(
|
|
845
|
+
/* @__PURE__ */ jsx(
|
|
846
|
+
TypedRow,
|
|
847
|
+
{
|
|
848
|
+
value: picker.draft,
|
|
849
|
+
onValueChange: onTypedChange,
|
|
850
|
+
format: dateInputFormat,
|
|
851
|
+
hasTime,
|
|
852
|
+
era,
|
|
853
|
+
size,
|
|
854
|
+
min,
|
|
855
|
+
max
|
|
856
|
+
}
|
|
857
|
+
),
|
|
794
858
|
/* @__PURE__ */ jsx(
|
|
795
859
|
DayGrid,
|
|
796
860
|
{
|
|
@@ -817,7 +881,7 @@ function DatePicker(props) {
|
|
|
817
881
|
}
|
|
818
882
|
)
|
|
819
883
|
}
|
|
820
|
-
);
|
|
884
|
+
) });
|
|
821
885
|
}
|
|
822
886
|
DatePicker.displayName = "DatePicker";
|
|
823
887
|
var EMPTY_RANGE2 = { start: null, end: null };
|
|
@@ -833,7 +897,7 @@ function DateRangePicker(props) {
|
|
|
833
897
|
format: formatProp,
|
|
834
898
|
dateInputFormat = DEFAULT_FORMAT,
|
|
835
899
|
commit = "instant",
|
|
836
|
-
placeholder
|
|
900
|
+
placeholder: placeholderProp,
|
|
837
901
|
side = "bottom",
|
|
838
902
|
align = "start",
|
|
839
903
|
label,
|
|
@@ -855,13 +919,21 @@ function DateRangePicker(props) {
|
|
|
855
919
|
min,
|
|
856
920
|
max,
|
|
857
921
|
disabledDates,
|
|
858
|
-
locale
|
|
859
|
-
weekStartsOn
|
|
860
|
-
era
|
|
922
|
+
locale: localeProp,
|
|
923
|
+
weekStartsOn: weekStartsOnProp,
|
|
924
|
+
era: eraProp,
|
|
925
|
+
labels,
|
|
861
926
|
size = "md",
|
|
862
927
|
defaultMonth,
|
|
863
928
|
className
|
|
864
929
|
} = props;
|
|
930
|
+
const t = useLabels("datePicker", DATE_PICKER_LABELS, labels);
|
|
931
|
+
const publishedLabels = usePublishedLabels("datePicker", labels);
|
|
932
|
+
const placeholder = placeholderProp ?? t.rangePlaceholder;
|
|
933
|
+
const app = useLocaleConfig();
|
|
934
|
+
const locale = localeProp ?? app.locale ?? enUS;
|
|
935
|
+
const era = eraProp ?? app.era ?? "ce";
|
|
936
|
+
const weekStartsOn = weekStartsOnProp ?? app.weekStartsOn ?? DEFAULT_WEEK_START;
|
|
865
937
|
const hasTime = hasTimeSegments(dateInputFormat);
|
|
866
938
|
const displayFormat = formatProp ?? defaultDisplayFormat(dateInputFormat);
|
|
867
939
|
const [rawCommitted, setCommitted] = useControllable(value, defaultValue, (next) => onValueChange?.(next ?? EMPTY_RANGE2));
|
|
@@ -916,12 +988,12 @@ function DateRangePicker(props) {
|
|
|
916
988
|
className: TRIGGER_CLASS,
|
|
917
989
|
children: [
|
|
918
990
|
/* @__PURE__ */ jsx("span", { id: valueId, className: cn("truncate", printed == null ? "text-quaternary" : "font-medium"), children: printed ?? placeholder }),
|
|
919
|
-
required && !hideRequiredIndicator ? /* @__PURE__ */ jsx("span", { id: requiredId, className: "sr-only", children:
|
|
991
|
+
required && !hideRequiredIndicator ? /* @__PURE__ */ jsx("span", { id: requiredId, className: "sr-only", children: t.required }) : null,
|
|
920
992
|
/* @__PURE__ */ jsx(TriggerGlyph, { size })
|
|
921
993
|
]
|
|
922
994
|
}
|
|
923
995
|
);
|
|
924
|
-
return /* @__PURE__ */ jsx(
|
|
996
|
+
return /* @__PURE__ */ jsx(LabelsContext.Provider, { value: publishedLabels, children: /* @__PURE__ */ jsx(
|
|
925
997
|
FieldFrame,
|
|
926
998
|
{
|
|
927
999
|
label,
|
|
@@ -970,14 +1042,14 @@ function DateRangePicker(props) {
|
|
|
970
1042
|
size: "lg",
|
|
971
1043
|
className: "max-h-[var(--available-height)] max-w-none",
|
|
972
1044
|
dividers: commit === "confirm" ? "line" : "none",
|
|
973
|
-
"aria-label": label ??
|
|
1045
|
+
"aria-label": label ?? t.openRange,
|
|
974
1046
|
footer: commit === "confirm" ? () => /* @__PURE__ */ jsx(ApplyRow, { onCancel: picker.close, onApply: picker.apply }) : void 0,
|
|
975
1047
|
children: /* @__PURE__ */ jsxs("div", { className: BODY, children: [
|
|
976
1048
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
977
1049
|
/* @__PURE__ */ jsx(
|
|
978
1050
|
TypedRow,
|
|
979
1051
|
{
|
|
980
|
-
label:
|
|
1052
|
+
label: t.startDate,
|
|
981
1053
|
value: picker.draft.start,
|
|
982
1054
|
onValueChange: (next) => onTypedChange("start", next),
|
|
983
1055
|
format: dateInputFormat,
|
|
@@ -992,7 +1064,7 @@ function DateRangePicker(props) {
|
|
|
992
1064
|
/* @__PURE__ */ jsx(
|
|
993
1065
|
TypedRow,
|
|
994
1066
|
{
|
|
995
|
-
label:
|
|
1067
|
+
label: t.endDate,
|
|
996
1068
|
value: picker.draft.end,
|
|
997
1069
|
onValueChange: (next) => onTypedChange("end", next),
|
|
998
1070
|
format: dateInputFormat,
|
|
@@ -1037,10 +1109,10 @@ function DateRangePicker(props) {
|
|
|
1037
1109
|
}
|
|
1038
1110
|
)
|
|
1039
1111
|
}
|
|
1040
|
-
);
|
|
1112
|
+
) });
|
|
1041
1113
|
}
|
|
1042
1114
|
DateRangePicker.displayName = "DateRangePicker";
|
|
1043
1115
|
|
|
1044
1116
|
export { DATE_PRESETS, DateCalendar, DatePicker, DateRangeCalendar, DateRangePicker, resolvePreset };
|
|
1045
|
-
//# sourceMappingURL=chunk-
|
|
1046
|
-
//# sourceMappingURL=chunk-
|
|
1117
|
+
//# sourceMappingURL=chunk-7QXOGAN6.js.map
|
|
1118
|
+
//# sourceMappingURL=chunk-7QXOGAN6.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { devWarn } from './chunk-QDYE5LVT.js';
|
|
2
1
|
import { cn } from './chunk-ZSNJ6UA3.js';
|
|
2
|
+
import { devWarn } from './chunk-QDYE5LVT.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
|
|
5
5
|
var SEAMLESS_COLOR = "bg-current/10 text-inherit ring-1 ring-inset ring-current/20";
|
|
@@ -48,5 +48,5 @@ function warnSeamlessFieldChrome(component, chrome) {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
export { SEAMLESS_BOX, SEAMLESS_CHIP, SEAMLESS_CHIP_NUM, SEAMLESS_CHIP_PX, SEAMLESS_COLOR, SEAMLESS_CONTROL, SEAMLESS_DOT, SEAMLESS_FILL_COUPLED_FG, SEAMLESS_INHERIT_FG, SeamlessProvider, addonSlotClasses, useSeamlessSlot, warnSeamlessFieldChrome };
|
|
51
|
-
//# sourceMappingURL=chunk-
|
|
52
|
-
//# sourceMappingURL=chunk-
|
|
51
|
+
//# sourceMappingURL=chunk-7ZM7SNCZ.js.map
|
|
52
|
+
//# sourceMappingURL=chunk-7ZM7SNCZ.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { LinkContext } from './chunk-5AZKP4KZ.js';
|
|
2
|
+
import { LocaleContext } from './chunk-YIHKQ63K.js';
|
|
3
|
+
import { LabelsContext, mergeLabels } from './chunk-RJTVCA62.js';
|
|
4
|
+
import { devWarn } from './chunk-QDYE5LVT.js';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
function JenosizeUIProvider(props) {
|
|
9
|
+
const { link, labels, locale, timeZone, era, weekStartsOn, children } = props;
|
|
10
|
+
const outer = React.useContext(LabelsContext);
|
|
11
|
+
const mergedLabels = React.useMemo(() => mergeLabels(outer, labels), [outer, labels]);
|
|
12
|
+
const outerLocale = React.useContext(LocaleContext);
|
|
13
|
+
const localeConfig = React.useMemo(() => {
|
|
14
|
+
const own = { locale, timeZone, era, weekStartsOn };
|
|
15
|
+
const declared = Object.fromEntries(Object.entries(own).filter(([, v]) => v !== void 0));
|
|
16
|
+
if (Object.keys(declared).length === 0) return outerLocale;
|
|
17
|
+
return { ...outerLocale, ...declared };
|
|
18
|
+
}, [outerLocale, locale, timeZone, era, weekStartsOn]);
|
|
19
|
+
const outerLink = React.useContext(LinkContext);
|
|
20
|
+
const previousLink = React.useRef(link);
|
|
21
|
+
if (link != null && previousLink.current != null && link !== previousLink.current) {
|
|
22
|
+
devWarn(
|
|
23
|
+
"`JenosizeUIProvider link` changed identity between renders, which REMOUNTS every link in the app (losing keyboard focus and router prefetch state). Hoist the wrapper to module scope \u2014 `const AppLink = ({ href, ...rest }) => <Link to={href} {...rest} />` \u2014 or wrap it in `useCallback`."
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
previousLink.current = link;
|
|
27
|
+
return /* @__PURE__ */ jsx(LinkContext.Provider, { value: link ?? outerLink, children: /* @__PURE__ */ jsx(LabelsContext.Provider, { value: mergedLabels, children: /* @__PURE__ */ jsx(LocaleContext.Provider, { value: localeConfig, children }) }) });
|
|
28
|
+
}
|
|
29
|
+
JenosizeUIProvider.displayName = "JenosizeUIProvider";
|
|
30
|
+
|
|
31
|
+
export { JenosizeUIProvider };
|
|
32
|
+
//# sourceMappingURL=chunk-AIARANKE.js.map
|
|
33
|
+
//# sourceMappingURL=chunk-AIARANKE.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Slot } from './chunk-52IFGFTL.js';
|
|
2
1
|
import { useScrollFade } from './chunk-O2LG3PNI.js';
|
|
3
2
|
import { useIsomorphicLayoutEffect } from './chunk-EDSK6FEH.js';
|
|
4
|
-
import {
|
|
3
|
+
import { Slot } from './chunk-52IFGFTL.js';
|
|
5
4
|
import { cn } from './chunk-ZSNJ6UA3.js';
|
|
5
|
+
import { warnStickyNoScrollport, nearestScrollport, warnNeedsName } from './chunk-QDYE5LVT.js';
|
|
6
6
|
import { Tabs as Tabs$1 } from '@base-ui/react/tabs';
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -162,6 +162,7 @@ function Tabs(props) {
|
|
|
162
162
|
value: it.value,
|
|
163
163
|
disabled: it.disabled,
|
|
164
164
|
"aria-label": it.ariaLabel,
|
|
165
|
+
render: it.render,
|
|
165
166
|
className: cn(TAB_BASE, TAB_SIZE[size], TAB_VARIANT[variant], fitted && (horizontal ? "min-w-0 flex-1" : "flex-1"), it.className),
|
|
166
167
|
children: [
|
|
167
168
|
it.leading != null ? /* @__PURE__ */ jsx(Slot, { className: TAB_SLOT_ICON[size], children: it.leading }) : null,
|
|
@@ -201,5 +202,5 @@ function Tabs(props) {
|
|
|
201
202
|
Tabs.displayName = "Tabs";
|
|
202
203
|
|
|
203
204
|
export { Tabs };
|
|
204
|
-
//# sourceMappingURL=chunk-
|
|
205
|
-
//# sourceMappingURL=chunk-
|
|
205
|
+
//# sourceMappingURL=chunk-AIGYMTCU.js.map
|
|
206
|
+
//# sourceMappingURL=chunk-AIGYMTCU.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { GLYPH } from './chunk-
|
|
2
|
-
import { TooltipExport } from './chunk-
|
|
3
|
-
import { warnNeedsName } from './chunk-QDYE5LVT.js';
|
|
1
|
+
import { GLYPH } from './chunk-MCQG4H6T.js';
|
|
2
|
+
import { TooltipExport } from './chunk-KZP6B6B3.js';
|
|
4
3
|
import { cn } from './chunk-ZSNJ6UA3.js';
|
|
4
|
+
import { warnNeedsName } from './chunk-QDYE5LVT.js';
|
|
5
5
|
import { mergeProps } from '@base-ui/react/merge-props';
|
|
6
6
|
import { useRender } from '@base-ui/react/use-render';
|
|
7
7
|
import 'react';
|
|
@@ -59,5 +59,5 @@ function ButtonUtility(props) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
export { ButtonUtility };
|
|
62
|
-
//# sourceMappingURL=chunk-
|
|
63
|
-
//# sourceMappingURL=chunk-
|
|
62
|
+
//# sourceMappingURL=chunk-AZ7DKRBY.js.map
|
|
63
|
+
//# sourceMappingURL=chunk-AZ7DKRBY.js.map
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { useControlScrollFade } from './chunk-7EUAMHMU.js';
|
|
2
|
-
import { FieldShell } from './chunk-
|
|
3
|
-
import { useFieldValidity, FieldFrame } from './chunk-
|
|
2
|
+
import { FieldShell } from './chunk-X2VMIBK5.js';
|
|
3
|
+
import { useFieldValidity, FieldFrame } from './chunk-5KSD4WKN.js';
|
|
4
4
|
import { PlusIcon, ChevronUpIcon, ChevronDownIcon, MinusIcon } from './chunk-BLIZ3CL3.js';
|
|
5
|
-
import { warnPositiveNumber } from './chunk-QDYE5LVT.js';
|
|
6
5
|
import { cn } from './chunk-ZSNJ6UA3.js';
|
|
6
|
+
import { useLabels } from './chunk-RJTVCA62.js';
|
|
7
|
+
import { warnPositiveNumber } from './chunk-QDYE5LVT.js';
|
|
7
8
|
import { NumberField } from '@base-ui/react/number-field';
|
|
8
9
|
import 'react';
|
|
9
10
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
10
11
|
|
|
12
|
+
// src/components/number-input/labels.ts
|
|
13
|
+
var NUMBER_INPUT_LABELS = {
|
|
14
|
+
decrease: "Decrease",
|
|
15
|
+
increase: "Increase"
|
|
16
|
+
};
|
|
11
17
|
var STEP_GAP = { sm: "gap-3", md: "gap-3", lg: "gap-3.5" };
|
|
12
18
|
var STEP_BTN = "inline-flex shrink-0 cursor-pointer items-center justify-center self-stretch text-tertiary outline-none transition-colors duration-100 ease-linear enabled:hover:bg-secondary enabled:hover:text-secondary disabled:cursor-not-allowed disabled:[&_svg]:opacity-50 [&_svg]:size-5";
|
|
13
19
|
var STEP_PX = { sm: "px-2", md: "px-2.5", lg: "px-3" };
|
|
@@ -50,8 +56,10 @@ function NumberInput(props) {
|
|
|
50
56
|
format,
|
|
51
57
|
onValueChange,
|
|
52
58
|
className,
|
|
53
|
-
"aria-label": ariaLabel
|
|
59
|
+
"aria-label": ariaLabel,
|
|
60
|
+
labels
|
|
54
61
|
} = props;
|
|
62
|
+
const t = useLabels("numberInput", NUMBER_INPUT_LABELS, labels);
|
|
55
63
|
warnPositiveNumber("NumberInput", "step", step === "any" ? void 0 : step);
|
|
56
64
|
warnPositiveNumber("NumberInput", "smallStep", smallStep);
|
|
57
65
|
warnPositiveNumber("NumberInput", "largeStep", largeStep);
|
|
@@ -103,10 +111,10 @@ function NumberInput(props) {
|
|
|
103
111
|
leadingAddon,
|
|
104
112
|
trailingAddon,
|
|
105
113
|
segmentDivider: variant !== "horizontal",
|
|
106
|
-
segmentLeading: variant === "horizontal" ? /* @__PURE__ */ jsx(NumberField.Decrement, { "aria-label":
|
|
107
|
-
segmentTrailing: variant === "horizontal" ? /* @__PURE__ */ jsx(NumberField.Increment, { "aria-label":
|
|
108
|
-
/* @__PURE__ */ jsx(NumberField.Increment, { "aria-label":
|
|
109
|
-
/* @__PURE__ */ jsx(NumberField.Decrement, { "aria-label":
|
|
114
|
+
segmentLeading: variant === "horizontal" ? /* @__PURE__ */ jsx(NumberField.Decrement, { "aria-label": t.decrease, className: cn(STEP_BTN, STEP_PX[size]), children: /* @__PURE__ */ jsx(MinusIcon, {}) }) : null,
|
|
115
|
+
segmentTrailing: variant === "horizontal" ? /* @__PURE__ */ jsx(NumberField.Increment, { "aria-label": t.increase, className: cn(STEP_BTN, STEP_PX[size]), children: /* @__PURE__ */ jsx(PlusIcon, {}) }) : /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col self-stretch", size === "lg" ? "w-7.5" : "w-7"), children: [
|
|
116
|
+
/* @__PURE__ */ jsx(NumberField.Increment, { "aria-label": t.increase, className: cn(CHEVRON_BTN, CHEVRON_ICON[size]), children: /* @__PURE__ */ jsx(ChevronUpIcon, {}) }),
|
|
117
|
+
/* @__PURE__ */ jsx(NumberField.Decrement, { "aria-label": t.decrease, className: cn(CHEVRON_BTN, "border-t border-primary", CHEVRON_ICON[size]), children: /* @__PURE__ */ jsx(ChevronDownIcon, {}) })
|
|
110
118
|
] }),
|
|
111
119
|
className: STEP_GAP[size],
|
|
112
120
|
children: /* @__PURE__ */ jsx(
|
|
@@ -129,5 +137,5 @@ function NumberInput(props) {
|
|
|
129
137
|
}
|
|
130
138
|
|
|
131
139
|
export { NumberInput };
|
|
132
|
-
//# sourceMappingURL=chunk-
|
|
133
|
-
//# sourceMappingURL=chunk-
|
|
140
|
+
//# sourceMappingURL=chunk-BBKE4W3B.js.map
|
|
141
|
+
//# sourceMappingURL=chunk-BBKE4W3B.js.map
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
+
import { useLinkElement } from './chunk-5AZKP4KZ.js';
|
|
1
2
|
import { Slot } from './chunk-52IFGFTL.js';
|
|
2
3
|
import { ChevronRightIcon, SlashIcon } from './chunk-BLIZ3CL3.js';
|
|
3
|
-
import { warnPositiveInt, devWarn } from './chunk-QDYE5LVT.js';
|
|
4
4
|
import { cn } from './chunk-ZSNJ6UA3.js';
|
|
5
|
+
import { useLabels } from './chunk-RJTVCA62.js';
|
|
6
|
+
import { warnPositiveInt, devWarn } from './chunk-QDYE5LVT.js';
|
|
5
7
|
import { useRender } from '@base-ui/react/use-render';
|
|
6
8
|
import * as React from 'react';
|
|
7
9
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
10
|
|
|
11
|
+
// src/components/breadcrumb/labels.ts
|
|
12
|
+
var BREADCRUMB_LABELS = {
|
|
13
|
+
/** The "…" trigger. The English default owns its own `count === 1` branch — a language with a
|
|
14
|
+
* different plural rule owns the whole function, which is why this is not a string. */
|
|
15
|
+
showHidden: (ctx) => `Show ${ctx.count} hidden breadcrumb${ctx.count === 1 ? "" : "s"}`
|
|
16
|
+
};
|
|
9
17
|
var NAV = "min-w-0";
|
|
10
18
|
var OL_BASE = "flex items-center";
|
|
11
19
|
var OL_GAP = {
|
|
@@ -44,9 +52,12 @@ function CrumbContent({ item, truncate }) {
|
|
|
44
52
|
}
|
|
45
53
|
function Crumb({ item, variant }) {
|
|
46
54
|
const { href, render, onClick, ariaLabel, className } = item;
|
|
55
|
+
const link = useLinkElement(href);
|
|
47
56
|
return useRender({
|
|
48
57
|
defaultTagName: "button",
|
|
49
|
-
|
|
58
|
+
// The item's own `render` still wins — it is the more specific statement than the provider's
|
|
59
|
+
// app-wide `link`, which is what `useLinkElement` reads.
|
|
60
|
+
render: render ?? link,
|
|
50
61
|
// A crumb takes no `...rest` (its whole API is the item fields), so there is nothing to
|
|
51
62
|
// merge — unlike Button, which merges its computed props over the caller's spread.
|
|
52
63
|
props: {
|
|
@@ -69,7 +80,8 @@ function collapse(items, maxItems) {
|
|
|
69
80
|
return { lead: rest.slice(0, keep), hidden: rest.slice(keep), current };
|
|
70
81
|
}
|
|
71
82
|
function Breadcrumb(props) {
|
|
72
|
-
const { items, variant = "text", divider = "chevron", bordered = false, maxItems, className } = props;
|
|
83
|
+
const { items, variant = "text", divider = "chevron", bordered = false, maxItems, labels, className } = props;
|
|
84
|
+
const t = useLabels("breadcrumb", BREADCRUMB_LABELS, labels);
|
|
73
85
|
const ariaLabel = props["aria-label"] ?? "Breadcrumb";
|
|
74
86
|
const [expanded, setExpanded] = React.useState(false);
|
|
75
87
|
warnPositiveInt("Breadcrumb", "maxItems", maxItems);
|
|
@@ -81,7 +93,7 @@ function Breadcrumb(props) {
|
|
|
81
93
|
if (current.href != null || current.render != null) {
|
|
82
94
|
devWarn("<Breadcrumb> the last item is the current page and never renders as a link \u2014 its `href`/`render` are ignored.");
|
|
83
95
|
}
|
|
84
|
-
const overflowLabel =
|
|
96
|
+
const overflowLabel = t.showHidden({ count: hidden.length });
|
|
85
97
|
return /* @__PURE__ */ jsx("nav", { "aria-label": ariaLabel, className: cn(NAV, className), children: /* @__PURE__ */ jsxs("ol", { className: cn(OL_BASE, OL_GAP[variant], bordered && OL_BORDERED), children: [
|
|
86
98
|
lead.map((item, i) => /* @__PURE__ */ jsxs("li", { className: cn(LI_BASE, OL_GAP[variant]), children: [
|
|
87
99
|
/* @__PURE__ */ jsx(Crumb, { item, variant }),
|
|
@@ -110,5 +122,5 @@ function Breadcrumb(props) {
|
|
|
110
122
|
Breadcrumb.displayName = "Breadcrumb";
|
|
111
123
|
|
|
112
124
|
export { Breadcrumb };
|
|
113
|
-
//# sourceMappingURL=chunk-
|
|
114
|
-
//# sourceMappingURL=chunk-
|
|
125
|
+
//# sourceMappingURL=chunk-CFFWYXDW.js.map
|
|
126
|
+
//# sourceMappingURL=chunk-CFFWYXDW.js.map
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { XIcon } from './chunk-BLIZ3CL3.js';
|
|
2
2
|
import { cn } from './chunk-ZSNJ6UA3.js';
|
|
3
|
+
import { useLabels } from './chunk-RJTVCA62.js';
|
|
3
4
|
import { mergeProps } from '@base-ui/react/merge-props';
|
|
4
5
|
import { useRender } from '@base-ui/react/use-render';
|
|
5
6
|
import 'react';
|
|
6
7
|
import { jsx } from 'react/jsx-runtime';
|
|
7
8
|
|
|
9
|
+
// src/components/button/labels.ts
|
|
10
|
+
var CLOSE_BUTTON_LABELS = {
|
|
11
|
+
close: "Close"
|
|
12
|
+
};
|
|
8
13
|
var BASE = "flex cursor-pointer items-center justify-center rounded-lg p-2 outline-focus-ring transition duration-100 ease-linear focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&_svg]:shrink-0 [&_svg]:transition-colors [&_svg]:duration-100 [&_svg]:ease-linear";
|
|
9
14
|
var SIZE = {
|
|
10
15
|
xs: "size-7 [&_svg]:size-4",
|
|
@@ -17,7 +22,8 @@ var THEME = {
|
|
|
17
22
|
dark: "text-white/70 hover:bg-white/20 hover:text-white"
|
|
18
23
|
};
|
|
19
24
|
function CloseButton(props) {
|
|
20
|
-
const { render, size = "sm", theme = "light", label
|
|
25
|
+
const { render, size = "sm", theme = "light", label, labels, disabled = false, type = "button", className, ...rest } = props;
|
|
26
|
+
const t = useLabels("closeButton", CLOSE_BUTTON_LABELS, labels);
|
|
21
27
|
return useRender({
|
|
22
28
|
defaultTagName: "button",
|
|
23
29
|
render,
|
|
@@ -27,7 +33,7 @@ function CloseButton(props) {
|
|
|
27
33
|
className: cn(BASE, SIZE[size], THEME[theme], className),
|
|
28
34
|
children: /* @__PURE__ */ jsx(XIcon, {}),
|
|
29
35
|
disabled,
|
|
30
|
-
"aria-label": label
|
|
36
|
+
"aria-label": label ?? t.close
|
|
31
37
|
},
|
|
32
38
|
rest
|
|
33
39
|
)
|
|
@@ -35,5 +41,5 @@ function CloseButton(props) {
|
|
|
35
41
|
}
|
|
36
42
|
|
|
37
43
|
export { CloseButton };
|
|
38
|
-
//# sourceMappingURL=chunk-
|
|
39
|
-
//# sourceMappingURL=chunk-
|
|
44
|
+
//# sourceMappingURL=chunk-CGHYXWTT.js.map
|
|
45
|
+
//# sourceMappingURL=chunk-CGHYXWTT.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ScrollView } from './chunk-SKJC2KYD.js';
|
|
2
|
+
import { SURFACE_PADDING } from './chunk-45Y2ZGNK.js';
|
|
2
3
|
import { ruleEdge } from './chunk-LCG34A5T.js';
|
|
3
|
-
import { ScrollView } from './chunk-FKVPAEJ6.js';
|
|
4
4
|
import { Slot } from './chunk-52IFGFTL.js';
|
|
5
5
|
import { cn } from './chunk-ZSNJ6UA3.js';
|
|
6
6
|
import { mergeProps } from '@base-ui/react/merge-props';
|
|
@@ -109,5 +109,5 @@ function PanelChrome(props) {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
export { PanelChrome };
|
|
112
|
-
//# sourceMappingURL=chunk-
|
|
113
|
-
//# sourceMappingURL=chunk-
|
|
112
|
+
//# sourceMappingURL=chunk-CGZXQ7PA.js.map
|
|
113
|
+
//# sourceMappingURL=chunk-CGZXQ7PA.js.map
|