cetec-design-system 4.1.1-0 → 4.2.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +299 -151
- package/dist/index.js.map +1 -1
- package/dist/panda.buildinfo.json +65 -60
- package/dist/styles.css +20 -0
- package/dist/types/index.d.ts +197 -1
- package/package.json +10 -2
package/dist/index.js
CHANGED
|
@@ -15388,6 +15388,76 @@ const Text = (props) => {
|
|
|
15388
15388
|
);
|
|
15389
15389
|
return definition ? /* @__PURE__ */ jsx(Tooltip, { text: definition, children: content }) : content;
|
|
15390
15390
|
};
|
|
15391
|
+
const defaultLocaleLabels = {
|
|
15392
|
+
cancel: "Cancel",
|
|
15393
|
+
submit: "Submit",
|
|
15394
|
+
apply: "Apply",
|
|
15395
|
+
dismiss: "Dismiss",
|
|
15396
|
+
closeDialog: "Close dialog",
|
|
15397
|
+
removeItem: (item) => `Remove ${item}`,
|
|
15398
|
+
switchToTheme: (nextTheme) => `Switch to ${nextTheme} theme`,
|
|
15399
|
+
selectPlaceholder: "Select...",
|
|
15400
|
+
noResults: "No results found",
|
|
15401
|
+
suggestions: "Suggestions",
|
|
15402
|
+
loadingOptions: "Loading options…",
|
|
15403
|
+
noOptions: "No options",
|
|
15404
|
+
addOption: (value) => `Add “${value}”`,
|
|
15405
|
+
optionSelected: (label2) => `${label2} selected.`,
|
|
15406
|
+
optionCreated: (value) => `${value} created and selected.`,
|
|
15407
|
+
optionRemoved: (label2) => `${label2} removed.`,
|
|
15408
|
+
moreSelected: (count2) => `${count2} more selected`,
|
|
15409
|
+
chooseDate: "Choose date",
|
|
15410
|
+
previousMonth: "Previous month",
|
|
15411
|
+
nextMonth: "Next month",
|
|
15412
|
+
previousYear: "Previous year",
|
|
15413
|
+
nextYear: "Next year",
|
|
15414
|
+
previousYears: "Previous years",
|
|
15415
|
+
nextYears: "Next years",
|
|
15416
|
+
chooseMonthIn: (year) => `Choose a month in ${year}`,
|
|
15417
|
+
chooseYear: "Choose a year",
|
|
15418
|
+
today: "today",
|
|
15419
|
+
selected: "selected",
|
|
15420
|
+
rangeStart: "range start",
|
|
15421
|
+
rangeEnd: "range end",
|
|
15422
|
+
date: "Date",
|
|
15423
|
+
time: "Time",
|
|
15424
|
+
startDate: "Start date",
|
|
15425
|
+
endDate: "End date",
|
|
15426
|
+
startTime: "Start time",
|
|
15427
|
+
endTime: "End time",
|
|
15428
|
+
month: "Month",
|
|
15429
|
+
day: "Day",
|
|
15430
|
+
year: "Year",
|
|
15431
|
+
hour: "Hour",
|
|
15432
|
+
minute: "Minute",
|
|
15433
|
+
meridiem: "AM or PM",
|
|
15434
|
+
fieldHour: (field) => `${field} hour`,
|
|
15435
|
+
fieldMinute: (field) => `${field} minute`,
|
|
15436
|
+
fieldMeridiem: (field) => `${field} AM or PM`,
|
|
15437
|
+
monthPlaceholder: "MM",
|
|
15438
|
+
dayPlaceholder: "DD",
|
|
15439
|
+
yearPlaceholder: "YYYY",
|
|
15440
|
+
hourPlaceholder: "HH",
|
|
15441
|
+
minutePlaceholder: "MM",
|
|
15442
|
+
hourColumn: "HR",
|
|
15443
|
+
minuteColumn: "MIN",
|
|
15444
|
+
meridiemColumn: "AM/PM",
|
|
15445
|
+
clearDate: "Clear date",
|
|
15446
|
+
clearDateRange: "Clear date range",
|
|
15447
|
+
clearTime: "Clear time",
|
|
15448
|
+
clearTimeRange: "Clear time range",
|
|
15449
|
+
clearDateTime: "Clear date and time",
|
|
15450
|
+
clearStartDateTime: "Clear start date and time",
|
|
15451
|
+
clearEndDateTime: "Clear end date and time"
|
|
15452
|
+
};
|
|
15453
|
+
const DEFAULT_LOCALE = "en-US";
|
|
15454
|
+
const LocaleContext = createContext({
|
|
15455
|
+
locale: DEFAULT_LOCALE,
|
|
15456
|
+
labels: defaultLocaleLabels
|
|
15457
|
+
});
|
|
15458
|
+
function useLocale() {
|
|
15459
|
+
return useContext(LocaleContext);
|
|
15460
|
+
}
|
|
15391
15461
|
const toneIconNames$3 = {
|
|
15392
15462
|
info: "info",
|
|
15393
15463
|
success: "success",
|
|
@@ -15403,6 +15473,7 @@ const toneIconColors$2 = {
|
|
|
15403
15473
|
neutral: "icon.subtle"
|
|
15404
15474
|
};
|
|
15405
15475
|
const Alert = (props) => {
|
|
15476
|
+
const { labels } = useLocale();
|
|
15406
15477
|
const {
|
|
15407
15478
|
tone = "info",
|
|
15408
15479
|
title,
|
|
@@ -15411,7 +15482,7 @@ const Alert = (props) => {
|
|
|
15411
15482
|
secondaryAction,
|
|
15412
15483
|
dismissible = false,
|
|
15413
15484
|
onDismiss,
|
|
15414
|
-
dismissLabel =
|
|
15485
|
+
dismissLabel = labels.dismiss,
|
|
15415
15486
|
...rest
|
|
15416
15487
|
} = props;
|
|
15417
15488
|
const [className, otherProps] = splitProps(rest);
|
|
@@ -16190,44 +16261,64 @@ function getMinuteValues(minuteStep) {
|
|
|
16190
16261
|
}
|
|
16191
16262
|
return values;
|
|
16192
16263
|
}
|
|
16193
|
-
const
|
|
16194
|
-
|
|
16195
|
-
|
|
16196
|
-
|
|
16197
|
-
|
|
16198
|
-
|
|
16199
|
-
|
|
16200
|
-
|
|
16201
|
-
|
|
16202
|
-
|
|
16203
|
-
|
|
16204
|
-
|
|
16205
|
-
|
|
16206
|
-
|
|
16207
|
-
|
|
16208
|
-
|
|
16209
|
-
|
|
16210
|
-
|
|
16211
|
-
|
|
16212
|
-
|
|
16213
|
-
|
|
16214
|
-
|
|
16215
|
-
|
|
16216
|
-
|
|
16217
|
-
|
|
16218
|
-
|
|
16219
|
-
|
|
16220
|
-
|
|
16221
|
-
|
|
16222
|
-
|
|
16223
|
-
|
|
16224
|
-
"
|
|
16225
|
-
"
|
|
16226
|
-
"
|
|
16227
|
-
"
|
|
16228
|
-
"
|
|
16229
|
-
"
|
|
16230
|
-
|
|
16264
|
+
const WEEK_START_UTC = Date.UTC(2017, 0, 1);
|
|
16265
|
+
const DAY_MS = 24 * 60 * 60 * 1e3;
|
|
16266
|
+
function utcDate(year, month, day) {
|
|
16267
|
+
const date = /* @__PURE__ */ new Date(0);
|
|
16268
|
+
date.setUTCFullYear(year, month - 1, day);
|
|
16269
|
+
return date;
|
|
16270
|
+
}
|
|
16271
|
+
function resolveLocale(locale) {
|
|
16272
|
+
try {
|
|
16273
|
+
return Intl.DateTimeFormat.supportedLocalesOf(locale).length > 0 ? locale : DEFAULT_LOCALE;
|
|
16274
|
+
} catch {
|
|
16275
|
+
return DEFAULT_LOCALE;
|
|
16276
|
+
}
|
|
16277
|
+
}
|
|
16278
|
+
function getFirstDayOfWeek(locale) {
|
|
16279
|
+
var _a;
|
|
16280
|
+
try {
|
|
16281
|
+
const intlLocale = new Intl.Locale(locale);
|
|
16282
|
+
const weekInfo = ((_a = intlLocale.getWeekInfo) == null ? void 0 : _a.call(intlLocale)) ?? intlLocale.weekInfo;
|
|
16283
|
+
return weekInfo ? weekInfo.firstDay % 7 : 0;
|
|
16284
|
+
} catch {
|
|
16285
|
+
return 0;
|
|
16286
|
+
}
|
|
16287
|
+
}
|
|
16288
|
+
function getCalendarNames(locale) {
|
|
16289
|
+
const resolved = resolveLocale(locale);
|
|
16290
|
+
const format = (options) => new Intl.DateTimeFormat(resolved, {
|
|
16291
|
+
...options,
|
|
16292
|
+
calendar: "gregory",
|
|
16293
|
+
timeZone: "UTC"
|
|
16294
|
+
});
|
|
16295
|
+
const monthLong = format({ month: "long" });
|
|
16296
|
+
const monthShort = format({ month: "short" });
|
|
16297
|
+
const weekdayLong = format({ weekday: "long" });
|
|
16298
|
+
const weekdayShort = format({ weekday: "short" });
|
|
16299
|
+
const monthYear = format({ month: "long", year: "numeric" });
|
|
16300
|
+
const fullDate = format({ month: "long", day: "numeric", year: "numeric" });
|
|
16301
|
+
const monthDates = Array.from(
|
|
16302
|
+
{ length: 12 },
|
|
16303
|
+
(_, index2) => utcDate(2e3, index2 + 1, 1)
|
|
16304
|
+
);
|
|
16305
|
+
const firstDayOfWeek = getFirstDayOfWeek(resolved);
|
|
16306
|
+
const weekDates = Array.from(
|
|
16307
|
+
{ length: 7 },
|
|
16308
|
+
(_, index2) => new Date(WEEK_START_UTC + (firstDayOfWeek + index2) % 7 * DAY_MS)
|
|
16309
|
+
);
|
|
16310
|
+
return {
|
|
16311
|
+
firstDayOfWeek,
|
|
16312
|
+
months: monthDates.map((date) => monthLong.format(date)),
|
|
16313
|
+
monthsShort: monthDates.map((date) => monthShort.format(date)),
|
|
16314
|
+
weekdays: weekDates.map((date) => weekdayLong.format(date)),
|
|
16315
|
+
weekdaysShort: weekDates.map(
|
|
16316
|
+
(date) => weekdayShort.format(date).replace(/\.$/, "")
|
|
16317
|
+
),
|
|
16318
|
+
formatMonthYear: (year, month) => monthYear.format(utcDate(year, month, 1)),
|
|
16319
|
+
formatDate: ({ year, month, day }) => fullDate.format(utcDate(year, month, day))
|
|
16320
|
+
};
|
|
16321
|
+
}
|
|
16231
16322
|
const YEAR_WINDOW_SIZE = 12;
|
|
16232
16323
|
function monthInRange(year, month, min2, max2) {
|
|
16233
16324
|
if (min2 && (year < min2.year || year === min2.year && month < min2.month))
|
|
@@ -16250,13 +16341,13 @@ function getCellVariant(state) {
|
|
|
16250
16341
|
}
|
|
16251
16342
|
return state.isInRange ? "selected" : "ghost";
|
|
16252
16343
|
}
|
|
16253
|
-
function getDayAriaLabel(date,
|
|
16254
|
-
const
|
|
16255
|
-
if (state.isToday)
|
|
16256
|
-
if (state.isSelected)
|
|
16257
|
-
if (state.isRangeStart)
|
|
16258
|
-
if (state.isRangeEnd)
|
|
16259
|
-
return
|
|
16344
|
+
function getDayAriaLabel(date, state, labels, names) {
|
|
16345
|
+
const parts = [names.formatDate(date)];
|
|
16346
|
+
if (state.isToday) parts.push(labels.today);
|
|
16347
|
+
if (state.isSelected) parts.push(labels.selected);
|
|
16348
|
+
if (state.isRangeStart) parts.push(labels.rangeStart);
|
|
16349
|
+
if (state.isRangeEnd) parts.push(labels.rangeEnd);
|
|
16350
|
+
return parts.join(", ");
|
|
16260
16351
|
}
|
|
16261
16352
|
const CalendarCell = ({
|
|
16262
16353
|
ariaLabel,
|
|
@@ -16294,20 +16385,21 @@ const DayGridContent = ({
|
|
|
16294
16385
|
disabled,
|
|
16295
16386
|
getDayState,
|
|
16296
16387
|
handleDaySelect,
|
|
16297
|
-
|
|
16388
|
+
labels,
|
|
16389
|
+
names,
|
|
16298
16390
|
viewDate
|
|
16299
16391
|
}) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
16300
|
-
|
|
16392
|
+
names.weekdaysShort.map((weekday, index2) => /* @__PURE__ */ jsx(
|
|
16301
16393
|
Text,
|
|
16302
16394
|
{
|
|
16303
16395
|
textStyle: "mono.xs",
|
|
16304
16396
|
allCaps: true,
|
|
16305
16397
|
className: classes.weekdayLabel,
|
|
16306
16398
|
role: "columnheader",
|
|
16307
|
-
"aria-label":
|
|
16399
|
+
"aria-label": names.weekdays[index2] ?? weekday,
|
|
16308
16400
|
children: weekday
|
|
16309
16401
|
},
|
|
16310
|
-
|
|
16402
|
+
index2
|
|
16311
16403
|
)),
|
|
16312
16404
|
Array.from({ length: dayCells.length / 7 }, (_, rowIndex) => /* @__PURE__ */ jsx(Box, { role: "row", display: "contents", children: dayCells.slice(rowIndex * 7, rowIndex * 7 + 7).map((day, columnIndex) => {
|
|
16313
16405
|
if (day === null) {
|
|
@@ -16332,7 +16424,7 @@ const DayGridContent = ({
|
|
|
16332
16424
|
classes,
|
|
16333
16425
|
disabled,
|
|
16334
16426
|
label: day,
|
|
16335
|
-
ariaLabel: getDayAriaLabel(date,
|
|
16427
|
+
ariaLabel: getDayAriaLabel(date, state, labels, names),
|
|
16336
16428
|
state,
|
|
16337
16429
|
onClick: () => handleDaySelect(date),
|
|
16338
16430
|
onKeyDown: (event) => {
|
|
@@ -16351,21 +16443,21 @@ const MonthGridContent = ({
|
|
|
16351
16443
|
disabled,
|
|
16352
16444
|
getMonthState,
|
|
16353
16445
|
handleMonthSelect,
|
|
16446
|
+
names,
|
|
16354
16447
|
year
|
|
16355
|
-
}) => /* @__PURE__ */ jsx(Fragment, { children:
|
|
16448
|
+
}) => /* @__PURE__ */ jsx(Fragment, { children: names.monthsShort.map((label2, index2) => {
|
|
16356
16449
|
const month = index2 + 1;
|
|
16357
|
-
const fullMonthName = MONTH_NAMES[index2] ?? label2;
|
|
16358
16450
|
return /* @__PURE__ */ jsx(
|
|
16359
16451
|
CalendarCell,
|
|
16360
16452
|
{
|
|
16361
16453
|
classes,
|
|
16362
16454
|
disabled,
|
|
16363
16455
|
label: label2,
|
|
16364
|
-
ariaLabel:
|
|
16456
|
+
ariaLabel: names.formatMonthYear(year, month),
|
|
16365
16457
|
state: getMonthState(month),
|
|
16366
16458
|
onClick: () => handleMonthSelect(month)
|
|
16367
16459
|
},
|
|
16368
|
-
|
|
16460
|
+
month
|
|
16369
16461
|
);
|
|
16370
16462
|
}) });
|
|
16371
16463
|
const YearGridContent = ({
|
|
@@ -16387,6 +16479,8 @@ const YearGridContent = ({
|
|
|
16387
16479
|
year
|
|
16388
16480
|
)) });
|
|
16389
16481
|
const Calendar = (props) => {
|
|
16482
|
+
const { labels, locale } = useLocale();
|
|
16483
|
+
const names = useMemo(() => getCalendarNames(locale), [locale]);
|
|
16390
16484
|
const {
|
|
16391
16485
|
value = null,
|
|
16392
16486
|
onChange,
|
|
@@ -16398,7 +16492,7 @@ const Calendar = (props) => {
|
|
|
16398
16492
|
defaultViewDate,
|
|
16399
16493
|
onViewDateChange,
|
|
16400
16494
|
disabled = false,
|
|
16401
|
-
label: label2 =
|
|
16495
|
+
label: label2 = labels.chooseDate,
|
|
16402
16496
|
...rest
|
|
16403
16497
|
} = props;
|
|
16404
16498
|
const [className, otherProps] = splitProps(rest);
|
|
@@ -16419,18 +16513,17 @@ const Calendar = (props) => {
|
|
|
16419
16513
|
() => getYearWindowStart(viewDate.year)
|
|
16420
16514
|
);
|
|
16421
16515
|
const classes = calendar({ type: viewLevel });
|
|
16422
|
-
const
|
|
16423
|
-
const monthLabel = `${monthName} ${viewDate.year}`;
|
|
16516
|
+
const monthLabel = names.formatMonthYear(viewDate.year, viewDate.month);
|
|
16424
16517
|
const yearWindowEnd = yearWindowStart + YEAR_WINDOW_SIZE - 1;
|
|
16425
16518
|
const dayCells = useMemo(() => {
|
|
16426
|
-
const
|
|
16519
|
+
const leadingDays = (firstWeekdayOfMonth(viewDate.year, viewDate.month) - names.firstDayOfWeek + 7) % 7;
|
|
16427
16520
|
const totalDays = daysInMonth$1(viewDate.year, viewDate.month);
|
|
16428
16521
|
const cells = [];
|
|
16429
|
-
for (let i = 0; i <
|
|
16522
|
+
for (let i = 0; i < leadingDays; i += 1) cells.push(null);
|
|
16430
16523
|
for (let day = 1; day <= totalDays; day += 1) cells.push(day);
|
|
16431
16524
|
while (cells.length % 7 !== 0) cells.push(null);
|
|
16432
16525
|
return cells;
|
|
16433
|
-
}, [viewDate.month, viewDate.year]);
|
|
16526
|
+
}, [names.firstDayOfWeek, viewDate.month, viewDate.year]);
|
|
16434
16527
|
const windowYears = useMemo(
|
|
16435
16528
|
() => Array.from({ length: YEAR_WINDOW_SIZE }, (_, i) => yearWindowStart + i),
|
|
16436
16529
|
[yearWindowStart]
|
|
@@ -16486,8 +16579,8 @@ const Calendar = (props) => {
|
|
|
16486
16579
|
switch (viewLevel) {
|
|
16487
16580
|
case "days":
|
|
16488
16581
|
return {
|
|
16489
|
-
previousLabel:
|
|
16490
|
-
nextLabel:
|
|
16582
|
+
previousLabel: labels.previousMonth,
|
|
16583
|
+
nextLabel: labels.nextMonth,
|
|
16491
16584
|
title: monthLabel,
|
|
16492
16585
|
onTitleClick: () => setViewLevel("months"),
|
|
16493
16586
|
previousDisabled: disabled || !monthInRange(
|
|
@@ -16502,8 +16595,8 @@ const Calendar = (props) => {
|
|
|
16502
16595
|
};
|
|
16503
16596
|
case "months":
|
|
16504
16597
|
return {
|
|
16505
|
-
previousLabel:
|
|
16506
|
-
nextLabel:
|
|
16598
|
+
previousLabel: labels.previousYear,
|
|
16599
|
+
nextLabel: labels.nextYear,
|
|
16507
16600
|
title: String(viewDate.year),
|
|
16508
16601
|
onTitleClick: () => {
|
|
16509
16602
|
setYearWindowStart(getYearWindowStart(viewDate.year));
|
|
@@ -16516,8 +16609,8 @@ const Calendar = (props) => {
|
|
|
16516
16609
|
};
|
|
16517
16610
|
case "years":
|
|
16518
16611
|
return {
|
|
16519
|
-
previousLabel:
|
|
16520
|
-
nextLabel:
|
|
16612
|
+
previousLabel: labels.previousYears,
|
|
16613
|
+
nextLabel: labels.nextYears,
|
|
16521
16614
|
title: `${yearWindowStart}-${yearWindowEnd}`,
|
|
16522
16615
|
titleDisabled: true,
|
|
16523
16616
|
previousDisabled: disabled || !yearInRange(yearWindowStart - 1, minDate, maxDate),
|
|
@@ -16528,7 +16621,7 @@ const Calendar = (props) => {
|
|
|
16528
16621
|
}
|
|
16529
16622
|
};
|
|
16530
16623
|
const headerConfig = getHeaderConfig();
|
|
16531
|
-
const gridAriaLabel = viewLevel === "days" ? monthLabel : viewLevel === "months" ?
|
|
16624
|
+
const gridAriaLabel = viewLevel === "days" ? monthLabel : viewLevel === "months" ? labels.chooseMonthIn(viewDate.year) : labels.chooseYear;
|
|
16532
16625
|
return /* @__PURE__ */ jsxs(
|
|
16533
16626
|
Box,
|
|
16534
16627
|
{
|
|
@@ -16584,7 +16677,8 @@ const Calendar = (props) => {
|
|
|
16584
16677
|
disabled,
|
|
16585
16678
|
getDayState,
|
|
16586
16679
|
handleDaySelect,
|
|
16587
|
-
|
|
16680
|
+
labels,
|
|
16681
|
+
names,
|
|
16588
16682
|
viewDate
|
|
16589
16683
|
}
|
|
16590
16684
|
) : viewLevel === "months" ? /* @__PURE__ */ jsx(
|
|
@@ -16594,6 +16688,7 @@ const Calendar = (props) => {
|
|
|
16594
16688
|
disabled,
|
|
16595
16689
|
getMonthState,
|
|
16596
16690
|
handleMonthSelect,
|
|
16691
|
+
names,
|
|
16597
16692
|
year: viewDate.year
|
|
16598
16693
|
}
|
|
16599
16694
|
) : /* @__PURE__ */ jsx(
|
|
@@ -16803,6 +16898,7 @@ const MAX_VISIBLE_ITEMS = 2;
|
|
|
16803
16898
|
const Chip = (props) => {
|
|
16804
16899
|
const groupContext = useChipGroup();
|
|
16805
16900
|
const fieldContext = useFieldContext();
|
|
16901
|
+
const { labels } = useLocale();
|
|
16806
16902
|
const slotContext = useSlotContext();
|
|
16807
16903
|
const {
|
|
16808
16904
|
size: sizeProp,
|
|
@@ -16923,7 +17019,7 @@ const Chip = (props) => {
|
|
|
16923
17019
|
};
|
|
16924
17020
|
const isOverflowing = items !== void 0 && items.length > MAX_VISIBLE_ITEMS;
|
|
16925
17021
|
const label2 = items ? isOverflowing ? `${items.slice(0, MAX_VISIBLE_ITEMS).join(", ")} +${items.length - MAX_VISIBLE_ITEMS}` : items.join(", ") : children;
|
|
16926
|
-
const resolvedDismissLabel = dismissLabel ||
|
|
17022
|
+
const resolvedDismissLabel = dismissLabel || labels.removeItem(items ? items.join(", ") : String(children));
|
|
16927
17023
|
const handleDismissClick = (e) => {
|
|
16928
17024
|
e.stopPropagation();
|
|
16929
17025
|
onDismiss == null ? void 0 : onDismiss();
|
|
@@ -17637,13 +17733,14 @@ const getSeparatorContent = (format, separator) => {
|
|
|
17637
17733
|
return format === "YYYY-MM-DD" ? "-" : "/";
|
|
17638
17734
|
};
|
|
17639
17735
|
const SegmentedDate = (props) => {
|
|
17736
|
+
const { labels } = useLocale();
|
|
17640
17737
|
const {
|
|
17641
17738
|
value,
|
|
17642
17739
|
defaultValue = null,
|
|
17643
17740
|
onChange,
|
|
17644
17741
|
format = "YYYY-MM-DD",
|
|
17645
17742
|
separators,
|
|
17646
|
-
label: label2 =
|
|
17743
|
+
label: label2 = labels.date,
|
|
17647
17744
|
disabled,
|
|
17648
17745
|
onFocusWithin,
|
|
17649
17746
|
onBlurWithin,
|
|
@@ -17667,8 +17764,8 @@ const SegmentedDate = (props) => {
|
|
|
17667
17764
|
type: "segment",
|
|
17668
17765
|
kind: "numeric",
|
|
17669
17766
|
id: "month",
|
|
17670
|
-
label:
|
|
17671
|
-
placeholder:
|
|
17767
|
+
label: labels.month,
|
|
17768
|
+
placeholder: labels.monthPlaceholder,
|
|
17672
17769
|
value: values.month,
|
|
17673
17770
|
digits: 2,
|
|
17674
17771
|
min: 1,
|
|
@@ -17678,8 +17775,8 @@ const SegmentedDate = (props) => {
|
|
|
17678
17775
|
type: "segment",
|
|
17679
17776
|
kind: "numeric",
|
|
17680
17777
|
id: "day",
|
|
17681
|
-
label:
|
|
17682
|
-
placeholder:
|
|
17778
|
+
label: labels.day,
|
|
17779
|
+
placeholder: labels.dayPlaceholder,
|
|
17683
17780
|
value: values.day,
|
|
17684
17781
|
digits: 2,
|
|
17685
17782
|
min: 1,
|
|
@@ -17696,8 +17793,8 @@ const SegmentedDate = (props) => {
|
|
|
17696
17793
|
type: "segment",
|
|
17697
17794
|
kind: "numeric",
|
|
17698
17795
|
id: "year",
|
|
17699
|
-
label:
|
|
17700
|
-
placeholder:
|
|
17796
|
+
label: labels.year,
|
|
17797
|
+
placeholder: labels.yearPlaceholder,
|
|
17701
17798
|
value: values.year,
|
|
17702
17799
|
digits: 4,
|
|
17703
17800
|
min: 1900,
|
|
@@ -17725,7 +17822,7 @@ const SegmentedDate = (props) => {
|
|
|
17725
17822
|
separator("day-year"),
|
|
17726
17823
|
yearSegment
|
|
17727
17824
|
];
|
|
17728
|
-
}, [format, resolvedValue, separatorGap, separators]);
|
|
17825
|
+
}, [format, labels, resolvedValue, separatorGap, separators]);
|
|
17729
17826
|
return /* @__PURE__ */ jsx(
|
|
17730
17827
|
SegmentedInput,
|
|
17731
17828
|
{
|
|
@@ -17759,6 +17856,7 @@ const to24Hour = (hour12, meridiem) => {
|
|
|
17759
17856
|
return hour12 === 12 ? 12 : hour12 + 12;
|
|
17760
17857
|
};
|
|
17761
17858
|
const SegmentedTime = (props) => {
|
|
17859
|
+
const { labels } = useLocale();
|
|
17762
17860
|
const {
|
|
17763
17861
|
value,
|
|
17764
17862
|
defaultValue = null,
|
|
@@ -17766,7 +17864,7 @@ const SegmentedTime = (props) => {
|
|
|
17766
17864
|
timeFormat,
|
|
17767
17865
|
minuteStep = 1,
|
|
17768
17866
|
separators,
|
|
17769
|
-
label: label2 =
|
|
17867
|
+
label: label2 = labels.time,
|
|
17770
17868
|
disabled,
|
|
17771
17869
|
onFocusWithin,
|
|
17772
17870
|
onBlurWithin,
|
|
@@ -17791,8 +17889,8 @@ const SegmentedTime = (props) => {
|
|
|
17791
17889
|
type: "segment",
|
|
17792
17890
|
kind: "numeric",
|
|
17793
17891
|
id: "hour",
|
|
17794
|
-
label:
|
|
17795
|
-
placeholder:
|
|
17892
|
+
label: labels.hour,
|
|
17893
|
+
placeholder: labels.hourPlaceholder,
|
|
17796
17894
|
value: displayHour,
|
|
17797
17895
|
digits: 2,
|
|
17798
17896
|
min: resolvedTimeFormat === "12" ? 1 : 0,
|
|
@@ -17808,8 +17906,8 @@ const SegmentedTime = (props) => {
|
|
|
17808
17906
|
type: "segment",
|
|
17809
17907
|
kind: "numeric",
|
|
17810
17908
|
id: "minute",
|
|
17811
|
-
label:
|
|
17812
|
-
placeholder:
|
|
17909
|
+
label: labels.minute,
|
|
17910
|
+
placeholder: labels.minutePlaceholder,
|
|
17813
17911
|
value: (resolvedValue == null ? void 0 : resolvedValue.minute) ?? null,
|
|
17814
17912
|
digits: 2,
|
|
17815
17913
|
min: 0,
|
|
@@ -17829,7 +17927,7 @@ const SegmentedTime = (props) => {
|
|
|
17829
17927
|
type: "segment",
|
|
17830
17928
|
kind: "choice",
|
|
17831
17929
|
id: "meridiem",
|
|
17832
|
-
label:
|
|
17930
|
+
label: labels.meridiem,
|
|
17833
17931
|
placeholder: "AM",
|
|
17834
17932
|
value: meridiem,
|
|
17835
17933
|
choices: ["AM", "PM"],
|
|
@@ -17841,7 +17939,13 @@ const SegmentedTime = (props) => {
|
|
|
17841
17939
|
);
|
|
17842
17940
|
}
|
|
17843
17941
|
return nextItems;
|
|
17844
|
-
}, [
|
|
17942
|
+
}, [
|
|
17943
|
+
labels,
|
|
17944
|
+
resolvedMinuteStep,
|
|
17945
|
+
resolvedTimeFormat,
|
|
17946
|
+
resolvedValue,
|
|
17947
|
+
separators
|
|
17948
|
+
]);
|
|
17845
17949
|
return /* @__PURE__ */ jsx(
|
|
17846
17950
|
SegmentedInput,
|
|
17847
17951
|
{
|
|
@@ -17923,6 +18027,7 @@ const InputSlot = ({
|
|
|
17923
18027
|
};
|
|
17924
18028
|
const DateInput = (props) => {
|
|
17925
18029
|
const fieldContext = useFieldContext();
|
|
18030
|
+
const { labels } = useLocale();
|
|
17926
18031
|
const {
|
|
17927
18032
|
id,
|
|
17928
18033
|
value,
|
|
@@ -17935,7 +18040,7 @@ const DateInput = (props) => {
|
|
|
17935
18040
|
iconBefore,
|
|
17936
18041
|
iconAfter,
|
|
17937
18042
|
clearable = true,
|
|
17938
|
-
clearLabel =
|
|
18043
|
+
clearLabel = labels.clearDate,
|
|
17939
18044
|
error: errorProp,
|
|
17940
18045
|
disabled: disabledProp,
|
|
17941
18046
|
invalid: invalidProp,
|
|
@@ -18031,20 +18136,21 @@ const DateInput = (props) => {
|
|
|
18031
18136
|
const EMPTY_RANGE$6 = { start: null, end: null };
|
|
18032
18137
|
const DateRangeInput = (props) => {
|
|
18033
18138
|
const fieldContext = useFieldContext();
|
|
18139
|
+
const { labels } = useLocale();
|
|
18034
18140
|
const {
|
|
18035
18141
|
id,
|
|
18036
18142
|
value,
|
|
18037
18143
|
defaultValue,
|
|
18038
18144
|
onChange,
|
|
18039
18145
|
dateFormat,
|
|
18040
|
-
startLabel =
|
|
18041
|
-
endLabel =
|
|
18146
|
+
startLabel = labels.startDate,
|
|
18147
|
+
endLabel = labels.endDate,
|
|
18042
18148
|
before,
|
|
18043
18149
|
after,
|
|
18044
18150
|
iconBefore,
|
|
18045
18151
|
iconAfter,
|
|
18046
18152
|
clearable = true,
|
|
18047
|
-
clearLabel =
|
|
18153
|
+
clearLabel = labels.clearDateRange,
|
|
18048
18154
|
error: errorProp,
|
|
18049
18155
|
disabled: disabledProp,
|
|
18050
18156
|
invalid: invalidProp,
|
|
@@ -18183,6 +18289,7 @@ const DateRangeInput = (props) => {
|
|
|
18183
18289
|
};
|
|
18184
18290
|
const TimeInput = (props) => {
|
|
18185
18291
|
const fieldContext = useFieldContext();
|
|
18292
|
+
const { labels } = useLocale();
|
|
18186
18293
|
const {
|
|
18187
18294
|
id,
|
|
18188
18295
|
value,
|
|
@@ -18196,7 +18303,7 @@ const TimeInput = (props) => {
|
|
|
18196
18303
|
iconBefore,
|
|
18197
18304
|
iconAfter,
|
|
18198
18305
|
clearable = true,
|
|
18199
|
-
clearLabel =
|
|
18306
|
+
clearLabel = labels.clearTime,
|
|
18200
18307
|
error: errorProp,
|
|
18201
18308
|
disabled: disabledProp,
|
|
18202
18309
|
invalid: invalidProp,
|
|
@@ -18295,6 +18402,7 @@ const TimeInput = (props) => {
|
|
|
18295
18402
|
const EMPTY_RANGE$5 = { start: null, end: null };
|
|
18296
18403
|
const TimeRangeInput = (props) => {
|
|
18297
18404
|
const fieldContext = useFieldContext();
|
|
18405
|
+
const { labels } = useLocale();
|
|
18298
18406
|
const {
|
|
18299
18407
|
id,
|
|
18300
18408
|
value,
|
|
@@ -18302,14 +18410,14 @@ const TimeRangeInput = (props) => {
|
|
|
18302
18410
|
onChange,
|
|
18303
18411
|
timeFormat,
|
|
18304
18412
|
minuteStep,
|
|
18305
|
-
startLabel =
|
|
18306
|
-
endLabel =
|
|
18413
|
+
startLabel = labels.startTime,
|
|
18414
|
+
endLabel = labels.endTime,
|
|
18307
18415
|
before,
|
|
18308
18416
|
after,
|
|
18309
18417
|
iconBefore,
|
|
18310
18418
|
iconAfter,
|
|
18311
18419
|
clearable = true,
|
|
18312
|
-
clearLabel =
|
|
18420
|
+
clearLabel = labels.clearTimeRange,
|
|
18313
18421
|
error: errorProp,
|
|
18314
18422
|
disabled: disabledProp,
|
|
18315
18423
|
invalid: invalidProp,
|
|
@@ -18450,6 +18558,7 @@ const TimeRangeInput = (props) => {
|
|
|
18450
18558
|
};
|
|
18451
18559
|
const DateTimeInput = (props) => {
|
|
18452
18560
|
const fieldContext = useFieldContext();
|
|
18561
|
+
const { labels } = useLocale();
|
|
18453
18562
|
const {
|
|
18454
18563
|
id,
|
|
18455
18564
|
value,
|
|
@@ -18458,14 +18567,14 @@ const DateTimeInput = (props) => {
|
|
|
18458
18567
|
dateFormat,
|
|
18459
18568
|
timeFormat,
|
|
18460
18569
|
minuteStep,
|
|
18461
|
-
dateLabel =
|
|
18462
|
-
timeLabel =
|
|
18570
|
+
dateLabel = labels.date,
|
|
18571
|
+
timeLabel = labels.time,
|
|
18463
18572
|
before,
|
|
18464
18573
|
after,
|
|
18465
18574
|
iconBefore,
|
|
18466
18575
|
iconAfter,
|
|
18467
18576
|
clearable = true,
|
|
18468
|
-
clearLabel =
|
|
18577
|
+
clearLabel = labels.clearDateTime,
|
|
18469
18578
|
error: errorProp,
|
|
18470
18579
|
disabled: disabledProp,
|
|
18471
18580
|
invalid: invalidProp,
|
|
@@ -18902,6 +19011,7 @@ const withLevelScopedKeys = (nodes, levelKey) => {
|
|
|
18902
19011
|
};
|
|
18903
19012
|
const Menu = (props) => {
|
|
18904
19013
|
var _a;
|
|
19014
|
+
const { labels } = useLocale();
|
|
18905
19015
|
const nodeId = useFloatingNodeId();
|
|
18906
19016
|
const floatingLayer = useFloatingLayer();
|
|
18907
19017
|
const {
|
|
@@ -19318,7 +19428,7 @@ const Menu = (props) => {
|
|
|
19318
19428
|
...otherProps,
|
|
19319
19429
|
style: floatingStyle,
|
|
19320
19430
|
children: [
|
|
19321
|
-
!hasVisibleResults && /* @__PURE__ */ jsx(Box, { className: classes.noResults, children: renderNoResults ?? /* @__PURE__ */ jsx(Text, { textStyle: "body.sm", children:
|
|
19431
|
+
!hasVisibleResults && /* @__PURE__ */ jsx(Box, { className: classes.noResults, children: renderNoResults ?? /* @__PURE__ */ jsx(Text, { textStyle: "body.sm", children: labels.noResults }) }),
|
|
19322
19432
|
hasVisibleResults && /* @__PURE__ */ jsxs(
|
|
19323
19433
|
Box,
|
|
19324
19434
|
{
|
|
@@ -20442,6 +20552,7 @@ const DateMenu = (props) => {
|
|
|
20442
20552
|
const EMPTY_RANGE$4 = { start: null, end: null };
|
|
20443
20553
|
const sameMonth = (a, b) => a.year === b.year && a.month === b.month;
|
|
20444
20554
|
const DateRangeMenu = (props) => {
|
|
20555
|
+
const { labels } = useLocale();
|
|
20445
20556
|
const {
|
|
20446
20557
|
trigger,
|
|
20447
20558
|
open: controlledOpen,
|
|
@@ -20453,8 +20564,8 @@ const DateRangeMenu = (props) => {
|
|
|
20453
20564
|
minDate,
|
|
20454
20565
|
maxDate,
|
|
20455
20566
|
disabled = false,
|
|
20456
|
-
startLabel =
|
|
20457
|
-
endLabel =
|
|
20567
|
+
startLabel = labels.startDate,
|
|
20568
|
+
endLabel = labels.endDate,
|
|
20458
20569
|
...rest
|
|
20459
20570
|
} = props;
|
|
20460
20571
|
const isInline = rest.inline === true;
|
|
@@ -20555,14 +20666,14 @@ const DateRangeMenu = (props) => {
|
|
|
20555
20666
|
)
|
|
20556
20667
|
] }),
|
|
20557
20668
|
/* @__PURE__ */ jsxs(Box, { className: classes.footer, children: [
|
|
20558
|
-
/* @__PURE__ */ jsx(Button, { variant: "standard", onClick: handleCancel, children:
|
|
20669
|
+
/* @__PURE__ */ jsx(Button, { variant: "standard", onClick: handleCancel, children: labels.cancel }),
|
|
20559
20670
|
/* @__PURE__ */ jsx(
|
|
20560
20671
|
Button,
|
|
20561
20672
|
{
|
|
20562
20673
|
variant: "primary",
|
|
20563
20674
|
disabled: !draft.start || !draft.end,
|
|
20564
20675
|
onClick: handleApply,
|
|
20565
|
-
children:
|
|
20676
|
+
children: labels.apply
|
|
20566
20677
|
}
|
|
20567
20678
|
)
|
|
20568
20679
|
] })
|
|
@@ -20750,6 +20861,7 @@ const scrollSelectedIntoView$2 = (colRef) => {
|
|
|
20750
20861
|
col.scrollTop = Math.min(Math.max(targetScrollTop, 0), maxScrollTop);
|
|
20751
20862
|
};
|
|
20752
20863
|
const TimeMenu = (props) => {
|
|
20864
|
+
const { labels } = useLocale();
|
|
20753
20865
|
const {
|
|
20754
20866
|
trigger,
|
|
20755
20867
|
open: controlledOpen,
|
|
@@ -20823,9 +20935,9 @@ const TimeMenu = (props) => {
|
|
|
20823
20935
|
ref: hourColRef,
|
|
20824
20936
|
className: classes.column,
|
|
20825
20937
|
role: "listbox",
|
|
20826
|
-
"aria-label":
|
|
20938
|
+
"aria-label": labels.hour,
|
|
20827
20939
|
children: [
|
|
20828
|
-
/* @__PURE__ */ jsx(Box, { "data-column-header": true, className: classes.columnHeader, children:
|
|
20940
|
+
/* @__PURE__ */ jsx(Box, { "data-column-header": true, className: classes.columnHeader, children: labels.hourColumn }),
|
|
20829
20941
|
/* @__PURE__ */ jsx(List, { children: hourValues.map((hour) => /* @__PURE__ */ jsx(
|
|
20830
20942
|
ListItem,
|
|
20831
20943
|
{
|
|
@@ -20845,9 +20957,9 @@ const TimeMenu = (props) => {
|
|
|
20845
20957
|
ref: minuteColRef,
|
|
20846
20958
|
className: classes.column,
|
|
20847
20959
|
role: "listbox",
|
|
20848
|
-
"aria-label":
|
|
20960
|
+
"aria-label": labels.minute,
|
|
20849
20961
|
children: [
|
|
20850
|
-
/* @__PURE__ */ jsx(Box, { "data-column-header": true, className: classes.columnHeader, children:
|
|
20962
|
+
/* @__PURE__ */ jsx(Box, { "data-column-header": true, className: classes.columnHeader, children: labels.minuteColumn }),
|
|
20851
20963
|
/* @__PURE__ */ jsx(List, { children: minuteValues.map((minute) => /* @__PURE__ */ jsx(
|
|
20852
20964
|
ListItem,
|
|
20853
20965
|
{
|
|
@@ -20867,9 +20979,9 @@ const TimeMenu = (props) => {
|
|
|
20867
20979
|
ref: meridiemColRef,
|
|
20868
20980
|
className: classes.column,
|
|
20869
20981
|
role: "listbox",
|
|
20870
|
-
"aria-label":
|
|
20982
|
+
"aria-label": labels.meridiem,
|
|
20871
20983
|
children: [
|
|
20872
|
-
/* @__PURE__ */ jsx(Box, { "data-column-header": true, className: classes.columnHeader, children:
|
|
20984
|
+
/* @__PURE__ */ jsx(Box, { "data-column-header": true, className: classes.columnHeader, children: labels.meridiemColumn }),
|
|
20873
20985
|
/* @__PURE__ */ jsx(List, { children: ["AM", "PM"].map((meridiem) => /* @__PURE__ */ jsx(
|
|
20874
20986
|
ListItem,
|
|
20875
20987
|
{
|
|
@@ -20914,6 +21026,7 @@ const TimeColumns = ({
|
|
|
20914
21026
|
value,
|
|
20915
21027
|
onChange
|
|
20916
21028
|
}) => {
|
|
21029
|
+
const { labels } = useLocale();
|
|
20917
21030
|
const displayHour = value && timeFormat === "12" ? to12Hour$1(value.hour).hour12 : (value == null ? void 0 : value.hour) ?? null;
|
|
20918
21031
|
const displayMeridiem = value && timeFormat === "12" ? to12Hour$1(value.hour).meridiem : null;
|
|
20919
21032
|
const displayMinute = (value == null ? void 0 : value.minute) ?? null;
|
|
@@ -20947,9 +21060,9 @@ const TimeColumns = ({
|
|
|
20947
21060
|
ref: hourColRef,
|
|
20948
21061
|
className: classes.column,
|
|
20949
21062
|
role: "listbox",
|
|
20950
|
-
"aria-label":
|
|
21063
|
+
"aria-label": labels.fieldHour(label2),
|
|
20951
21064
|
children: [
|
|
20952
|
-
/* @__PURE__ */ jsx(Box, { "data-column-header": true, className: classes.columnHeader, children:
|
|
21065
|
+
/* @__PURE__ */ jsx(Box, { "data-column-header": true, className: classes.columnHeader, children: labels.hourColumn }),
|
|
20953
21066
|
/* @__PURE__ */ jsx(List, { children: hourValues.map((hour) => /* @__PURE__ */ jsx(
|
|
20954
21067
|
ListItem,
|
|
20955
21068
|
{
|
|
@@ -20969,9 +21082,9 @@ const TimeColumns = ({
|
|
|
20969
21082
|
ref: minuteColRef,
|
|
20970
21083
|
className: classes.column,
|
|
20971
21084
|
role: "listbox",
|
|
20972
|
-
"aria-label":
|
|
21085
|
+
"aria-label": labels.fieldMinute(label2),
|
|
20973
21086
|
children: [
|
|
20974
|
-
/* @__PURE__ */ jsx(Box, { "data-column-header": true, className: classes.columnHeader, children:
|
|
21087
|
+
/* @__PURE__ */ jsx(Box, { "data-column-header": true, className: classes.columnHeader, children: labels.minuteColumn }),
|
|
20975
21088
|
/* @__PURE__ */ jsx(List, { children: minuteValues.map((minute) => /* @__PURE__ */ jsx(
|
|
20976
21089
|
ListItem,
|
|
20977
21090
|
{
|
|
@@ -20991,9 +21104,9 @@ const TimeColumns = ({
|
|
|
20991
21104
|
ref: meridiemColRef,
|
|
20992
21105
|
className: classes.column,
|
|
20993
21106
|
role: "listbox",
|
|
20994
|
-
"aria-label":
|
|
21107
|
+
"aria-label": labels.fieldMeridiem(label2),
|
|
20995
21108
|
children: [
|
|
20996
|
-
/* @__PURE__ */ jsx(Box, { "data-column-header": true, className: classes.columnHeader, children:
|
|
21109
|
+
/* @__PURE__ */ jsx(Box, { "data-column-header": true, className: classes.columnHeader, children: labels.meridiemColumn }),
|
|
20997
21110
|
/* @__PURE__ */ jsx(List, { children: ["AM", "PM"].map((meridiem) => /* @__PURE__ */ jsx(
|
|
20998
21111
|
ListItem,
|
|
20999
21112
|
{
|
|
@@ -21010,6 +21123,7 @@ const TimeColumns = ({
|
|
|
21010
21123
|
] });
|
|
21011
21124
|
};
|
|
21012
21125
|
const TimeRangeMenu = (props) => {
|
|
21126
|
+
const { labels } = useLocale();
|
|
21013
21127
|
const {
|
|
21014
21128
|
trigger,
|
|
21015
21129
|
open: controlledOpen,
|
|
@@ -21021,8 +21135,8 @@ const TimeRangeMenu = (props) => {
|
|
|
21021
21135
|
timeFormat = "12",
|
|
21022
21136
|
minuteStep = 1,
|
|
21023
21137
|
disabled = false,
|
|
21024
|
-
startLabel =
|
|
21025
|
-
endLabel =
|
|
21138
|
+
startLabel = labels.startTime,
|
|
21139
|
+
endLabel = labels.endTime,
|
|
21026
21140
|
...rest
|
|
21027
21141
|
} = props;
|
|
21028
21142
|
const isInline = rest.inline === true;
|
|
@@ -21094,14 +21208,14 @@ const TimeRangeMenu = (props) => {
|
|
|
21094
21208
|
)
|
|
21095
21209
|
] }),
|
|
21096
21210
|
/* @__PURE__ */ jsxs(Box, { className: classes.footer, children: [
|
|
21097
|
-
/* @__PURE__ */ jsx(Button, { variant: "standard", onClick: handleCancel, children:
|
|
21211
|
+
/* @__PURE__ */ jsx(Button, { variant: "standard", onClick: handleCancel, children: labels.cancel }),
|
|
21098
21212
|
/* @__PURE__ */ jsx(
|
|
21099
21213
|
Button,
|
|
21100
21214
|
{
|
|
21101
21215
|
variant: "primary",
|
|
21102
21216
|
disabled: !draft.start || !draft.end,
|
|
21103
21217
|
onClick: handleApply,
|
|
21104
|
-
children:
|
|
21218
|
+
children: labels.apply
|
|
21105
21219
|
}
|
|
21106
21220
|
)
|
|
21107
21221
|
] })
|
|
@@ -21127,6 +21241,7 @@ const scrollSelectedIntoView = (colRef) => {
|
|
|
21127
21241
|
col.scrollTop = Math.min(Math.max(targetScrollTop, 0), maxScrollTop);
|
|
21128
21242
|
};
|
|
21129
21243
|
const DateTimeMenu = (props) => {
|
|
21244
|
+
const { labels } = useLocale();
|
|
21130
21245
|
const {
|
|
21131
21246
|
trigger,
|
|
21132
21247
|
open: controlledOpen,
|
|
@@ -21275,9 +21390,9 @@ const DateTimeMenu = (props) => {
|
|
|
21275
21390
|
ref: hourColRef,
|
|
21276
21391
|
className: columnClasses.column,
|
|
21277
21392
|
role: "listbox",
|
|
21278
|
-
"aria-label":
|
|
21393
|
+
"aria-label": labels.hour,
|
|
21279
21394
|
children: [
|
|
21280
|
-
/* @__PURE__ */ jsx(Box, { "data-column-header": true, className: columnClasses.columnHeader, children:
|
|
21395
|
+
/* @__PURE__ */ jsx(Box, { "data-column-header": true, className: columnClasses.columnHeader, children: labels.hourColumn }),
|
|
21281
21396
|
/* @__PURE__ */ jsx(List, { children: hourValues.map((hour) => /* @__PURE__ */ jsx(
|
|
21282
21397
|
ListItem,
|
|
21283
21398
|
{
|
|
@@ -21297,9 +21412,9 @@ const DateTimeMenu = (props) => {
|
|
|
21297
21412
|
ref: minuteColRef,
|
|
21298
21413
|
className: columnClasses.column,
|
|
21299
21414
|
role: "listbox",
|
|
21300
|
-
"aria-label":
|
|
21415
|
+
"aria-label": labels.minute,
|
|
21301
21416
|
children: [
|
|
21302
|
-
/* @__PURE__ */ jsx(Box, { "data-column-header": true, className: columnClasses.columnHeader, children:
|
|
21417
|
+
/* @__PURE__ */ jsx(Box, { "data-column-header": true, className: columnClasses.columnHeader, children: labels.minuteColumn }),
|
|
21303
21418
|
/* @__PURE__ */ jsx(List, { children: minuteValues.map((minute) => /* @__PURE__ */ jsx(
|
|
21304
21419
|
ListItem,
|
|
21305
21420
|
{
|
|
@@ -21319,9 +21434,9 @@ const DateTimeMenu = (props) => {
|
|
|
21319
21434
|
ref: meridiemColRef,
|
|
21320
21435
|
className: columnClasses.column,
|
|
21321
21436
|
role: "listbox",
|
|
21322
|
-
"aria-label":
|
|
21437
|
+
"aria-label": labels.meridiem,
|
|
21323
21438
|
children: [
|
|
21324
|
-
/* @__PURE__ */ jsx(Box, { "data-column-header": true, className: columnClasses.columnHeader, children:
|
|
21439
|
+
/* @__PURE__ */ jsx(Box, { "data-column-header": true, className: columnClasses.columnHeader, children: labels.meridiemColumn }),
|
|
21325
21440
|
/* @__PURE__ */ jsx(List, { children: ["AM", "PM"].map((meridiem) => /* @__PURE__ */ jsx(
|
|
21326
21441
|
ListItem,
|
|
21327
21442
|
{
|
|
@@ -21340,14 +21455,14 @@ const DateTimeMenu = (props) => {
|
|
|
21340
21455
|
)
|
|
21341
21456
|
] }),
|
|
21342
21457
|
/* @__PURE__ */ jsxs(Box, { className: classes.footer, children: [
|
|
21343
|
-
/* @__PURE__ */ jsx(Button, { variant: "standard", onClick: handleCancel, children:
|
|
21458
|
+
/* @__PURE__ */ jsx(Button, { variant: "standard", onClick: handleCancel, children: labels.cancel }),
|
|
21344
21459
|
/* @__PURE__ */ jsx(
|
|
21345
21460
|
Button,
|
|
21346
21461
|
{
|
|
21347
21462
|
variant: "primary",
|
|
21348
21463
|
disabled: !draftDate || !draftTime,
|
|
21349
21464
|
onClick: handleApply,
|
|
21350
|
-
children:
|
|
21465
|
+
children: labels.apply
|
|
21351
21466
|
}
|
|
21352
21467
|
)
|
|
21353
21468
|
] })
|
|
@@ -21811,6 +21926,7 @@ const DateTimePicker = (props) => {
|
|
|
21811
21926
|
const WRAP_BREAKPOINT = 458;
|
|
21812
21927
|
const EMPTY_RANGE = { start: null, end: null };
|
|
21813
21928
|
const DateTimeRangePicker = (props) => {
|
|
21929
|
+
const { labels } = useLocale();
|
|
21814
21930
|
const {
|
|
21815
21931
|
before,
|
|
21816
21932
|
after,
|
|
@@ -21829,12 +21945,12 @@ const DateTimeRangePicker = (props) => {
|
|
|
21829
21945
|
minuteStep,
|
|
21830
21946
|
minDate,
|
|
21831
21947
|
maxDate,
|
|
21832
|
-
startDateLabel =
|
|
21833
|
-
startTimeLabel =
|
|
21834
|
-
endDateLabel =
|
|
21835
|
-
endTimeLabel =
|
|
21836
|
-
startClearLabel =
|
|
21837
|
-
endClearLabel =
|
|
21948
|
+
startDateLabel = labels.startDate,
|
|
21949
|
+
startTimeLabel = labels.startTime,
|
|
21950
|
+
endDateLabel = labels.endDate,
|
|
21951
|
+
endTimeLabel = labels.endTime,
|
|
21952
|
+
startClearLabel = labels.clearStartDateTime,
|
|
21953
|
+
endClearLabel = labels.clearEndDateTime,
|
|
21838
21954
|
placement
|
|
21839
21955
|
} = props;
|
|
21840
21956
|
const [currentValue, setCurrentValue] = useControllableState({
|
|
@@ -22459,6 +22575,7 @@ const ModalFooter = (props) => {
|
|
|
22459
22575
|
return /* @__PURE__ */ jsx(Box, { className: cx(classes.footer, className), ...otherProps, children });
|
|
22460
22576
|
};
|
|
22461
22577
|
const ModalHeader = (props) => {
|
|
22578
|
+
const { labels } = useLocale();
|
|
22462
22579
|
const { title, titleId, showCloseButton = true, children, ...rest } = props;
|
|
22463
22580
|
const [className, otherProps] = splitProps(rest);
|
|
22464
22581
|
const classes = modal();
|
|
@@ -22481,8 +22598,8 @@ const ModalHeader = (props) => {
|
|
|
22481
22598
|
variant: "ghost",
|
|
22482
22599
|
size: isSm ? "md" : "lg",
|
|
22483
22600
|
onClick: onClose,
|
|
22484
|
-
altText:
|
|
22485
|
-
"aria-label":
|
|
22601
|
+
altText: labels.closeDialog,
|
|
22602
|
+
"aria-label": labels.closeDialog,
|
|
22486
22603
|
className: classes.closeButton,
|
|
22487
22604
|
iconName: "x"
|
|
22488
22605
|
}
|
|
@@ -22490,6 +22607,7 @@ const ModalHeader = (props) => {
|
|
|
22490
22607
|
] }) });
|
|
22491
22608
|
};
|
|
22492
22609
|
const Modal = (props) => {
|
|
22610
|
+
const { labels } = useLocale();
|
|
22493
22611
|
const {
|
|
22494
22612
|
open,
|
|
22495
22613
|
onOpenChange,
|
|
@@ -22497,8 +22615,8 @@ const Modal = (props) => {
|
|
|
22497
22615
|
defaultValues,
|
|
22498
22616
|
onSubmit,
|
|
22499
22617
|
children,
|
|
22500
|
-
submitLabel =
|
|
22501
|
-
cancelLabel =
|
|
22618
|
+
submitLabel = labels.submit,
|
|
22619
|
+
cancelLabel = labels.cancel,
|
|
22502
22620
|
submitDisabled = false,
|
|
22503
22621
|
footer,
|
|
22504
22622
|
size: size2,
|
|
@@ -22581,13 +22699,14 @@ const typeDefaults = {
|
|
|
22581
22699
|
}
|
|
22582
22700
|
};
|
|
22583
22701
|
const ConfirmationModal = (props) => {
|
|
22702
|
+
const { labels } = useLocale();
|
|
22584
22703
|
const {
|
|
22585
22704
|
open,
|
|
22586
22705
|
onOpenChange,
|
|
22587
22706
|
title,
|
|
22588
22707
|
description,
|
|
22589
22708
|
confirmLabel,
|
|
22590
|
-
cancelLabel =
|
|
22709
|
+
cancelLabel = labels.cancel,
|
|
22591
22710
|
type = "default",
|
|
22592
22711
|
onConfirm,
|
|
22593
22712
|
confirmLoading = false,
|
|
@@ -22881,6 +23000,7 @@ const RadioInput = (props) => {
|
|
|
22881
23000
|
);
|
|
22882
23001
|
};
|
|
22883
23002
|
const AutocompleteListbox = (props) => {
|
|
23003
|
+
const { labels } = useLocale();
|
|
22884
23004
|
const {
|
|
22885
23005
|
activeIndex,
|
|
22886
23006
|
baseId,
|
|
@@ -22915,7 +23035,7 @@ const AutocompleteListbox = (props) => {
|
|
|
22915
23035
|
ref: floatingRef,
|
|
22916
23036
|
id: listboxId,
|
|
22917
23037
|
role: "listbox",
|
|
22918
|
-
"aria-label":
|
|
23038
|
+
"aria-label": labels.suggestions,
|
|
22919
23039
|
"aria-multiselectable": multiple || void 0,
|
|
22920
23040
|
"aria-busy": loading || loadingMore || void 0,
|
|
22921
23041
|
density,
|
|
@@ -23240,7 +23360,6 @@ const resolveSelectedAutocompleteOption = (selectedValue, childOptionByValue, op
|
|
|
23240
23360
|
};
|
|
23241
23361
|
const getFirstEnabledOptionIndex = (options) => options.findIndex((option) => !option.disabled);
|
|
23242
23362
|
const LOAD_MORE_THRESHOLD_PX = 32;
|
|
23243
|
-
const defaultGetCreateOptionLabel = (inputValue) => `Add “${inputValue}”`;
|
|
23244
23363
|
const chipSizeByAutocompleteSize = {
|
|
23245
23364
|
sm: "sm",
|
|
23246
23365
|
md: "sm",
|
|
@@ -23264,6 +23383,7 @@ const useAutocompleteController = (props) => {
|
|
|
23264
23383
|
var _a;
|
|
23265
23384
|
const floatingLayer = useFloatingLayer();
|
|
23266
23385
|
const fieldContext = useFieldContext();
|
|
23386
|
+
const { labels } = useLocale();
|
|
23267
23387
|
const {
|
|
23268
23388
|
value: controlledValue,
|
|
23269
23389
|
defaultValue,
|
|
@@ -23279,9 +23399,9 @@ const useAutocompleteController = (props) => {
|
|
|
23279
23399
|
multiple = false,
|
|
23280
23400
|
allowCustomValue = false,
|
|
23281
23401
|
isCustomValue,
|
|
23282
|
-
getCreateOptionLabel =
|
|
23402
|
+
getCreateOptionLabel = labels.addOption,
|
|
23283
23403
|
limitTags,
|
|
23284
|
-
placeholder =
|
|
23404
|
+
placeholder = labels.selectPlaceholder,
|
|
23285
23405
|
placement = "bottom-start",
|
|
23286
23406
|
offset: offset2 = 4,
|
|
23287
23407
|
children,
|
|
@@ -23298,8 +23418,8 @@ const useAutocompleteController = (props) => {
|
|
|
23298
23418
|
loadingMore = false,
|
|
23299
23419
|
hasMore = false,
|
|
23300
23420
|
onLoadMore,
|
|
23301
|
-
loadingText =
|
|
23302
|
-
noOptionsText =
|
|
23421
|
+
loadingText = labels.loadingOptions,
|
|
23422
|
+
noOptionsText = labels.noOptions,
|
|
23303
23423
|
"aria-label": ariaLabel,
|
|
23304
23424
|
"aria-labelledby": ariaLabelledBy,
|
|
23305
23425
|
"aria-describedby": ariaDescribedBy,
|
|
@@ -23456,17 +23576,17 @@ const useAutocompleteController = (props) => {
|
|
|
23456
23576
|
if (option.created) {
|
|
23457
23577
|
const createdOption = { ...option, label: option.value };
|
|
23458
23578
|
state.selectOption(createdOption, "create-option");
|
|
23459
|
-
setAnnouncement(
|
|
23579
|
+
setAnnouncement(labels.optionCreated(option.value));
|
|
23460
23580
|
} else {
|
|
23461
23581
|
state.selectOption(option);
|
|
23462
|
-
setAnnouncement(
|
|
23582
|
+
setAnnouncement(labels.optionSelected(option.label));
|
|
23463
23583
|
}
|
|
23464
23584
|
setActiveIndex(null);
|
|
23465
23585
|
if (restoreFocus) {
|
|
23466
23586
|
requestAnimationFrame(focusInput);
|
|
23467
23587
|
}
|
|
23468
23588
|
},
|
|
23469
|
-
[focusInput, state]
|
|
23589
|
+
[focusInput, labels, state]
|
|
23470
23590
|
);
|
|
23471
23591
|
const tryCommitCreateOption = useCallback(() => {
|
|
23472
23592
|
if (!createOption || disabled || readOnly || suppressCreateCommitRef.current) {
|
|
@@ -23548,9 +23668,9 @@ const useAutocompleteController = (props) => {
|
|
|
23548
23668
|
const removeSelectedValue = useCallback(
|
|
23549
23669
|
(selectedValue, label2) => {
|
|
23550
23670
|
state.removeOption(selectedValue);
|
|
23551
|
-
setAnnouncement(
|
|
23671
|
+
setAnnouncement(labels.optionRemoved(label2));
|
|
23552
23672
|
},
|
|
23553
|
-
[state]
|
|
23673
|
+
[labels, state]
|
|
23554
23674
|
);
|
|
23555
23675
|
const handleTokenDismiss = useCallback(
|
|
23556
23676
|
(selectedValue, label2) => {
|
|
@@ -23775,6 +23895,7 @@ const useAutocompleteController = (props) => {
|
|
|
23775
23895
|
};
|
|
23776
23896
|
};
|
|
23777
23897
|
const Autocomplete = (props) => {
|
|
23898
|
+
const { labels } = useLocale();
|
|
23778
23899
|
const controller = useAutocompleteController(props);
|
|
23779
23900
|
const {
|
|
23780
23901
|
activeIndex,
|
|
@@ -23892,7 +24013,7 @@ const Autocomplete = (props) => {
|
|
|
23892
24013
|
{
|
|
23893
24014
|
as: "span",
|
|
23894
24015
|
className: classes.overflowIndicator,
|
|
23895
|
-
"aria-label":
|
|
24016
|
+
"aria-label": labels.moreSelected(hiddenTagCount),
|
|
23896
24017
|
children: `+${hiddenTagCount}`
|
|
23897
24018
|
}
|
|
23898
24019
|
),
|
|
@@ -24045,13 +24166,14 @@ const getSelectedOptions = (options, value, multiple) => {
|
|
|
24045
24166
|
};
|
|
24046
24167
|
const Select = (props) => {
|
|
24047
24168
|
var _a;
|
|
24169
|
+
const { labels } = useLocale();
|
|
24048
24170
|
const floatingLayer = useFloatingLayer();
|
|
24049
24171
|
const {
|
|
24050
24172
|
value: controlledValue,
|
|
24051
24173
|
defaultValue = null,
|
|
24052
24174
|
onChange,
|
|
24053
24175
|
multiple = false,
|
|
24054
|
-
placeholder =
|
|
24176
|
+
placeholder = labels.selectPlaceholder,
|
|
24055
24177
|
open: controlledOpen,
|
|
24056
24178
|
defaultOpen = false,
|
|
24057
24179
|
onOpenChange,
|
|
@@ -24588,8 +24710,30 @@ function useTheme() {
|
|
|
24588
24710
|
}
|
|
24589
24711
|
return context2;
|
|
24590
24712
|
}
|
|
24713
|
+
function mergeLabels(parent, overrides) {
|
|
24714
|
+
const defined = Object.fromEntries(
|
|
24715
|
+
Object.entries(overrides).filter(([, value]) => value !== void 0)
|
|
24716
|
+
);
|
|
24717
|
+
return { ...parent, ...defined };
|
|
24718
|
+
}
|
|
24719
|
+
function LocaleProvider({
|
|
24720
|
+
locale,
|
|
24721
|
+
labels,
|
|
24722
|
+
children
|
|
24723
|
+
}) {
|
|
24724
|
+
const parent = useContext(LocaleContext);
|
|
24725
|
+
const contextValue = useMemo(
|
|
24726
|
+
() => ({
|
|
24727
|
+
locale: locale ?? parent.locale,
|
|
24728
|
+
labels: labels ? mergeLabels(parent.labels, labels) : parent.labels
|
|
24729
|
+
}),
|
|
24730
|
+
[locale, labels, parent]
|
|
24731
|
+
);
|
|
24732
|
+
return /* @__PURE__ */ jsx(LocaleContext.Provider, { value: contextValue, children });
|
|
24733
|
+
}
|
|
24591
24734
|
const ThemeSwitcher = () => {
|
|
24592
24735
|
const { theme, setTheme } = useTheme();
|
|
24736
|
+
const { labels } = useLocale();
|
|
24593
24737
|
const toggleTheme = () => {
|
|
24594
24738
|
setTheme(theme === "light" ? "dark" : "light");
|
|
24595
24739
|
};
|
|
@@ -24598,7 +24742,7 @@ const ThemeSwitcher = () => {
|
|
|
24598
24742
|
{
|
|
24599
24743
|
...dsComponent("ThemeSwitcher"),
|
|
24600
24744
|
variant: "ghost",
|
|
24601
|
-
altText:
|
|
24745
|
+
altText: labels.switchToTheme(theme === "light" ? "dark" : "light"),
|
|
24602
24746
|
onClick: toggleTheme,
|
|
24603
24747
|
iconName: theme === "light" ? "moon" : "sun"
|
|
24604
24748
|
}
|
|
@@ -24619,6 +24763,7 @@ const toneIconColors = {
|
|
|
24619
24763
|
neutral: "icon.subtle"
|
|
24620
24764
|
};
|
|
24621
24765
|
const Toast = (props) => {
|
|
24766
|
+
const { labels } = useLocale();
|
|
24622
24767
|
const {
|
|
24623
24768
|
tone = "neutral",
|
|
24624
24769
|
children,
|
|
@@ -24627,7 +24772,7 @@ const Toast = (props) => {
|
|
|
24627
24772
|
dismissible = true,
|
|
24628
24773
|
onDismiss,
|
|
24629
24774
|
duration = null,
|
|
24630
|
-
dismissLabel =
|
|
24775
|
+
dismissLabel = labels.dismiss,
|
|
24631
24776
|
state = "open",
|
|
24632
24777
|
onMouseEnter,
|
|
24633
24778
|
onMouseLeave,
|
|
@@ -25018,6 +25163,7 @@ export {
|
|
|
25018
25163
|
List,
|
|
25019
25164
|
ListItem,
|
|
25020
25165
|
ListItemGroup,
|
|
25166
|
+
LocaleProvider,
|
|
25021
25167
|
Menu,
|
|
25022
25168
|
MenuGroup,
|
|
25023
25169
|
MenuItem,
|
|
@@ -25057,6 +25203,7 @@ export {
|
|
|
25057
25203
|
Toggle,
|
|
25058
25204
|
ToggleInput,
|
|
25059
25205
|
Tooltip,
|
|
25206
|
+
defaultLocaleLabels,
|
|
25060
25207
|
deriveItemTextValue,
|
|
25061
25208
|
getComponentType,
|
|
25062
25209
|
getHighlightedTextParts,
|
|
@@ -25070,6 +25217,7 @@ export {
|
|
|
25070
25217
|
useForm2 as useForm,
|
|
25071
25218
|
useIconConfig,
|
|
25072
25219
|
useListContext,
|
|
25220
|
+
useLocale,
|
|
25073
25221
|
useMediaQuery,
|
|
25074
25222
|
useMenuFilterContext,
|
|
25075
25223
|
useMenuListContext,
|