@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.mjs
CHANGED
|
@@ -2047,6 +2047,7 @@ var FormSwitch = ({
|
|
|
2047
2047
|
}) => variant === "box" ? /* @__PURE__ */ jsx(FormSwitchBox, { ...props, disabled, stateLabel, testID }) : /* @__PURE__ */ jsx(FormSwitchRow, { ...props, disabled, testID });
|
|
2048
2048
|
var checkboxBoxColors = (colors, brand, checked) => checked ? { backgroundColor: brand, borderColor: brand } : { backgroundColor: "transparent", borderColor: colors.textSecondary };
|
|
2049
2049
|
var checkboxTickColor = (brand) => resolveOnBrand(brand);
|
|
2050
|
+
var CHECKBOX_TEXT_COLUMN = { flexGrow: 1, flexShrink: 1 };
|
|
2050
2051
|
var COMPACT_BOX = { width: 16, height: 16, borderRadius: 4, borderWidth: 1.5 };
|
|
2051
2052
|
var CheckboxLookContext = createContext("default");
|
|
2052
2053
|
function CheckboxLookProvider({ look, children }) {
|
|
@@ -2116,9 +2117,7 @@ var styles18 = StyleSheet.create({
|
|
|
2116
2117
|
borderBottomWidth: TICK_STROKE,
|
|
2117
2118
|
transform: [{ rotate: "45deg" }]
|
|
2118
2119
|
},
|
|
2119
|
-
textColumn:
|
|
2120
|
-
flex: 1
|
|
2121
|
-
},
|
|
2120
|
+
textColumn: CHECKBOX_TEXT_COLUMN,
|
|
2122
2121
|
label: {
|
|
2123
2122
|
fontWeight: "600"
|
|
2124
2123
|
},
|
|
@@ -3129,6 +3128,9 @@ function useReducedMotion() {
|
|
|
3129
3128
|
return reduced;
|
|
3130
3129
|
}
|
|
3131
3130
|
|
|
3131
|
+
// src/DatePicker/data/defaultLocale.ts
|
|
3132
|
+
var DEFAULT_DATE_LOCALE = "en-GB";
|
|
3133
|
+
|
|
3132
3134
|
// src/DatePicker/data/defaultLabels.ts
|
|
3133
3135
|
var DEFAULT_DATE_PICKER_LABELS = {
|
|
3134
3136
|
dialog: "Choose a date",
|
|
@@ -3334,8 +3336,9 @@ function DatePickerProvider({ labels, locale, today, display, children }) {
|
|
|
3334
3336
|
}
|
|
3335
3337
|
function useDatePickerConfig() {
|
|
3336
3338
|
const config = useContext(DatePickerContext);
|
|
3337
|
-
const
|
|
3338
|
-
|
|
3339
|
+
const locale = config.locale ?? DEFAULT_DATE_LOCALE;
|
|
3340
|
+
const firstDay = useMemo(() => weekFirstDay(locale), [locale]);
|
|
3341
|
+
return { labels: config.labels, locale, today: config.today ?? todayIso(), firstDay, display: config.display ?? "long" /* Long */ };
|
|
3339
3342
|
}
|
|
3340
3343
|
|
|
3341
3344
|
// src/DatePicker/utils/motionStyles.ts
|
|
@@ -4023,7 +4026,8 @@ function orNone(value) {
|
|
|
4023
4026
|
return value !== "" ? value : void 0;
|
|
4024
4027
|
}
|
|
4025
4028
|
function WebDateRange({ value, onChange, onSubmit, fromLabel, toLabel, hint, testID, context, onTypedError }) {
|
|
4026
|
-
const { labels } = useDatePickerConfig();
|
|
4029
|
+
const { labels, locale } = useDatePickerConfig();
|
|
4030
|
+
const placeholder = labels.datePlaceholder !== "" ? labels.datePlaceholder : datePattern(locale);
|
|
4027
4031
|
const phone = useIsPhone();
|
|
4028
4032
|
const [open, setOpen] = useState(false);
|
|
4029
4033
|
const [fromError, setFromError] = useState(void 0);
|
|
@@ -4060,6 +4064,7 @@ function WebDateRange({ value, onChange, onSubmit, fromLabel, toLabel, hint, tes
|
|
|
4060
4064
|
autoComplete: "off",
|
|
4061
4065
|
"data-testid": `${testID}-${side}`,
|
|
4062
4066
|
id: side === "from" /* From */ ? context.controlId : void 0,
|
|
4067
|
+
placeholder,
|
|
4063
4068
|
style: SEGMENT,
|
|
4064
4069
|
title: hint,
|
|
4065
4070
|
type: "text",
|