@dloizides/ui-forms 1.63.0 → 1.64.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.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +11 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1153,7 +1153,7 @@ interface DatePickerLabels {
|
|
|
1153
1153
|
interface DatePickerProviderProps {
|
|
1154
1154
|
/** PRE-LOCALIZED picker labels; any omitted key keeps its English default. */
|
|
1155
1155
|
labels?: Partial<DatePickerLabels>;
|
|
1156
|
-
/** BCP 47 locale for display, typing order and week start; omitted = the
|
|
1156
|
+
/** BCP 47 locale for display, typing order and week start; omitted = en-GB, never the browser locale. */
|
|
1157
1157
|
locale?: string;
|
|
1158
1158
|
/** Fixed `YYYY-MM-DD` today, for demos and tests. */
|
|
1159
1159
|
today?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1153,7 +1153,7 @@ interface DatePickerLabels {
|
|
|
1153
1153
|
interface DatePickerProviderProps {
|
|
1154
1154
|
/** PRE-LOCALIZED picker labels; any omitted key keeps its English default. */
|
|
1155
1155
|
labels?: Partial<DatePickerLabels>;
|
|
1156
|
-
/** BCP 47 locale for display, typing order and week start; omitted = the
|
|
1156
|
+
/** BCP 47 locale for display, typing order and week start; omitted = en-GB, never the browser locale. */
|
|
1157
1157
|
locale?: string;
|
|
1158
1158
|
/** Fixed `YYYY-MM-DD` today, for demos and tests. */
|
|
1159
1159
|
today?: string;
|
package/dist/index.js
CHANGED
|
@@ -2054,6 +2054,7 @@ var FormSwitch = ({
|
|
|
2054
2054
|
}) => variant === "box" ? /* @__PURE__ */ jsxRuntime.jsx(FormSwitchBox, { ...props, disabled, stateLabel, testID }) : /* @__PURE__ */ jsxRuntime.jsx(FormSwitchRow, { ...props, disabled, testID });
|
|
2055
2055
|
var checkboxBoxColors = (colors, brand, checked) => checked ? { backgroundColor: brand, borderColor: brand } : { backgroundColor: "transparent", borderColor: colors.textSecondary };
|
|
2056
2056
|
var checkboxTickColor = (brand) => designTokens.resolveOnBrand(brand);
|
|
2057
|
+
var CHECKBOX_TEXT_COLUMN = { flexGrow: 1, flexShrink: 1 };
|
|
2057
2058
|
var COMPACT_BOX = { width: 16, height: 16, borderRadius: 4, borderWidth: 1.5 };
|
|
2058
2059
|
var CheckboxLookContext = React41.createContext("default");
|
|
2059
2060
|
function CheckboxLookProvider({ look, children }) {
|
|
@@ -2123,9 +2124,7 @@ var styles18 = reactNative.StyleSheet.create({
|
|
|
2123
2124
|
borderBottomWidth: TICK_STROKE,
|
|
2124
2125
|
transform: [{ rotate: "45deg" }]
|
|
2125
2126
|
},
|
|
2126
|
-
textColumn:
|
|
2127
|
-
flex: 1
|
|
2128
|
-
},
|
|
2127
|
+
textColumn: CHECKBOX_TEXT_COLUMN,
|
|
2129
2128
|
label: {
|
|
2130
2129
|
fontWeight: "600"
|
|
2131
2130
|
},
|
|
@@ -3136,6 +3135,9 @@ function useReducedMotion() {
|
|
|
3136
3135
|
return reduced;
|
|
3137
3136
|
}
|
|
3138
3137
|
|
|
3138
|
+
// src/DatePicker/data/defaultLocale.ts
|
|
3139
|
+
var DEFAULT_DATE_LOCALE = "en-GB";
|
|
3140
|
+
|
|
3139
3141
|
// src/DatePicker/data/defaultLabels.ts
|
|
3140
3142
|
var DEFAULT_DATE_PICKER_LABELS = {
|
|
3141
3143
|
dialog: "Choose a date",
|
|
@@ -3341,8 +3343,9 @@ function DatePickerProvider({ labels, locale, today, display, children }) {
|
|
|
3341
3343
|
}
|
|
3342
3344
|
function useDatePickerConfig() {
|
|
3343
3345
|
const config = React41.useContext(DatePickerContext);
|
|
3344
|
-
const
|
|
3345
|
-
|
|
3346
|
+
const locale = config.locale ?? DEFAULT_DATE_LOCALE;
|
|
3347
|
+
const firstDay = React41.useMemo(() => weekFirstDay(locale), [locale]);
|
|
3348
|
+
return { labels: config.labels, locale, today: config.today ?? todayIso(), firstDay, display: config.display ?? "long" /* Long */ };
|
|
3346
3349
|
}
|
|
3347
3350
|
|
|
3348
3351
|
// src/DatePicker/utils/motionStyles.ts
|
|
@@ -4030,7 +4033,8 @@ function orNone(value) {
|
|
|
4030
4033
|
return value !== "" ? value : void 0;
|
|
4031
4034
|
}
|
|
4032
4035
|
function WebDateRange({ value, onChange, onSubmit, fromLabel, toLabel, hint, testID, context, onTypedError }) {
|
|
4033
|
-
const { labels } = useDatePickerConfig();
|
|
4036
|
+
const { labels, locale } = useDatePickerConfig();
|
|
4037
|
+
const placeholder = labels.datePlaceholder !== "" ? labels.datePlaceholder : datePattern(locale);
|
|
4034
4038
|
const phone = useIsPhone();
|
|
4035
4039
|
const [open, setOpen] = React41.useState(false);
|
|
4036
4040
|
const [fromError, setFromError] = React41.useState(void 0);
|
|
@@ -4067,6 +4071,7 @@ function WebDateRange({ value, onChange, onSubmit, fromLabel, toLabel, hint, tes
|
|
|
4067
4071
|
autoComplete: "off",
|
|
4068
4072
|
"data-testid": `${testID}-${side}`,
|
|
4069
4073
|
id: side === "from" /* From */ ? context.controlId : void 0,
|
|
4074
|
+
placeholder,
|
|
4070
4075
|
style: SEGMENT,
|
|
4071
4076
|
title: hint,
|
|
4072
4077
|
type: "text",
|