@codecademy/gamut

68.2.268.2.3-alpha.794432.0
dist/DatePicker/utils/locale.d.ts
+dist/DatePicker/utils/locale.d.tsNew file
+38
Index: package/dist/DatePicker/utils/locale.d.ts
===================================================================
--- package/dist/DatePicker/utils/locale.d.ts
+++ package/dist/DatePicker/utils/locale.d.ts
@@ -0,0 +1,38 @@
+import '@formatjs/intl-locale/polyfill.js';
+/**
+ * The runtime default locale string (user agent), matching what `Intl` uses when no locale is passed.
+ */
+export declare const getDefaultLocaleTag: () => string;
+/**
+ * Resolves `Intl.LocalesArgument` (or `undefined`) to a stable `Intl.Locale` instance for formatting
+ * and locale metadata (e.g. `getWeekInfo()` in supporting environments).
+ *
+ * - `undefined` → default runtime locale via {@link getDefaultLocaleTag}
+ * - `Intl.Locale` → returned as-is (no duplicate allocation)
+ * - `string` / `readonly string[]` → `new Intl.Locale(...)`
+ */
+export declare const resolveLocale: (locales?: Intl.LocalesArgument) => Intl.Locale;
+/**
+ * Memoized {@link resolveLocale} for calendar subcomponents. Pass the same `locale` prop you accept
+ * from `CalendarBaseProps` (optional `Intl.LocalesArgument`).
+ */
+export declare const useResolvedLocale: (locale?: Intl.LocalesArgument) => Intl.Locale;
+/**
+ * Convert an Intl.Locale to a string. This is necessary the Intl.DateTimeFormat constructor only accepts a string in some versions of TS.
+ * @param locale - The Intl.Locale to convert to a string.
+ * @returns The stringified locale.
+ */
+export declare const stringifyLocale: (locale: Intl.Locale) => string;
+/** ISO weekday: 1 = Monday … 7 = Sunday (matches `Intl.Locale#getWeekInfo().firstDay`). */
+export type IsoWeekday = 1 | 2 | 3 | 4 | 5 | 6 | 7;
+/**
+ * First calendar column weekday from `locale` (via `getWeekInfo()`), or explicit override.
+ * - `weekStartsOnOverride` — ISO weekday **1–7** (Monday … Sunday), same as `getWeekInfo().firstDay`
+ * - omitted → `locale.getWeekInfo().firstDay` when available, else **7** (Sunday)
+ */
+export declare const getIsoFirstDayFromLocale: (locale: Intl.Locale, weekStartsOnOverride?: IsoWeekday) => IsoWeekday;
+/**
+ * Hook: resolved first weekday for the calendar grid. Re-reads after mount so async polyfills
+ * (e.g. Firefox) can install `getWeekInfo` before the first paint in some bundles.
+ */
+export declare const useIsoFirstWeekday: (locale: Intl.Locale, weekStartsOnOverride?: IsoWeekday) => IsoWeekday;