@oxy.so/bloom 4.31.0 → 4.32.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/docs/date-picker.mdx +37 -0
- package/lib/commonjs/date-picker/Calendar.js +2 -0
- package/lib/commonjs/date-picker/Calendar.js.map +1 -1
- package/lib/commonjs/date-picker/CalendarMonth.js +3 -2
- package/lib/commonjs/date-picker/CalendarMonth.js.map +1 -1
- package/lib/commonjs/date-picker/DatePicker.js +3 -0
- package/lib/commonjs/date-picker/DatePicker.js.map +1 -1
- package/lib/commonjs/date-picker/DateRangePicker.js +14 -6
- package/lib/commonjs/date-picker/DateRangePicker.js.map +1 -1
- package/lib/commonjs/date-picker/MeetingScheduler.js +1 -0
- package/lib/commonjs/date-picker/MeetingScheduler.js.map +1 -1
- package/lib/commonjs/date-picker/PickerShell.js +5 -3
- package/lib/commonjs/date-picker/PickerShell.js.map +1 -1
- package/lib/commonjs/date-picker/calendar-grid.js +9 -1
- package/lib/commonjs/date-picker/calendar-grid.js.map +1 -1
- package/lib/module/date-picker/Calendar.js +2 -0
- package/lib/module/date-picker/Calendar.js.map +1 -1
- package/lib/module/date-picker/CalendarMonth.js +3 -2
- package/lib/module/date-picker/CalendarMonth.js.map +1 -1
- package/lib/module/date-picker/DatePicker.js +3 -0
- package/lib/module/date-picker/DatePicker.js.map +1 -1
- package/lib/module/date-picker/DateRangePicker.js +14 -6
- package/lib/module/date-picker/DateRangePicker.js.map +1 -1
- package/lib/module/date-picker/MeetingScheduler.js +1 -0
- package/lib/module/date-picker/MeetingScheduler.js.map +1 -1
- package/lib/module/date-picker/PickerShell.js +4 -4
- package/lib/module/date-picker/PickerShell.js.map +1 -1
- package/lib/module/date-picker/calendar-grid.js +9 -1
- package/lib/module/date-picker/calendar-grid.js.map +1 -1
- package/lib/typescript/commonjs/date-picker/Calendar.d.ts.map +1 -1
- package/lib/typescript/commonjs/date-picker/CalendarMonth.d.ts +3 -2
- package/lib/typescript/commonjs/date-picker/CalendarMonth.d.ts.map +1 -1
- package/lib/typescript/commonjs/date-picker/DatePicker.d.ts +1 -1
- package/lib/typescript/commonjs/date-picker/DatePicker.d.ts.map +1 -1
- package/lib/typescript/commonjs/date-picker/DateRangePicker.d.ts +1 -1
- package/lib/typescript/commonjs/date-picker/DateRangePicker.d.ts.map +1 -1
- package/lib/typescript/commonjs/date-picker/MeetingScheduler.d.ts.map +1 -1
- package/lib/typescript/commonjs/date-picker/PickerShell.d.ts +3 -1
- package/lib/typescript/commonjs/date-picker/PickerShell.d.ts.map +1 -1
- package/lib/typescript/commonjs/date-picker/calendar-grid.d.ts +3 -2
- package/lib/typescript/commonjs/date-picker/calendar-grid.d.ts.map +1 -1
- package/lib/typescript/commonjs/date-picker/index.d.ts +1 -1
- package/lib/typescript/commonjs/date-picker/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/date-picker/types.d.ts +39 -1
- package/lib/typescript/commonjs/date-picker/types.d.ts.map +1 -1
- package/lib/typescript/module/date-picker/Calendar.d.ts.map +1 -1
- package/lib/typescript/module/date-picker/CalendarMonth.d.ts +3 -2
- package/lib/typescript/module/date-picker/CalendarMonth.d.ts.map +1 -1
- package/lib/typescript/module/date-picker/DatePicker.d.ts +1 -1
- package/lib/typescript/module/date-picker/DatePicker.d.ts.map +1 -1
- package/lib/typescript/module/date-picker/DateRangePicker.d.ts +1 -1
- package/lib/typescript/module/date-picker/DateRangePicker.d.ts.map +1 -1
- package/lib/typescript/module/date-picker/MeetingScheduler.d.ts.map +1 -1
- package/lib/typescript/module/date-picker/PickerShell.d.ts +3 -1
- package/lib/typescript/module/date-picker/PickerShell.d.ts.map +1 -1
- package/lib/typescript/module/date-picker/calendar-grid.d.ts +3 -2
- package/lib/typescript/module/date-picker/calendar-grid.d.ts.map +1 -1
- package/lib/typescript/module/date-picker/index.d.ts +1 -1
- package/lib/typescript/module/date-picker/index.d.ts.map +1 -1
- package/lib/typescript/module/date-picker/types.d.ts +39 -1
- package/lib/typescript/module/date-picker/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/date-picker/Calendar.tsx +10 -1
- package/src/date-picker/CalendarMonth.tsx +5 -3
- package/src/date-picker/DatePicker.tsx +3 -0
- package/src/date-picker/DateRangePicker.tsx +13 -5
- package/src/date-picker/MeetingScheduler.tsx +1 -0
- package/src/date-picker/PickerShell.tsx +5 -2
- package/src/date-picker/calendar-grid.ts +13 -11
- package/src/date-picker/index.ts +4 -0
- package/src/date-picker/types.ts +51 -1
- package/src/__tests__/support/adoption-matrix.ts +0 -708
- package/src/__tests__/support/collision-fixture-barrel.ts +0 -20
- package/src/__tests__/support/commerce-harness.tsx +0 -97
- package/src/__tests__/support/composite.ts +0 -68
- package/src/__tests__/support/constructed-style-sheets.ts +0 -68
- package/src/__tests__/support/press-host.ts +0 -30
- package/src/__tests__/support/rendered-style.ts +0 -99
- package/src/__tests__/support/unread-hook-fixture.ts +0 -33
- package/src/__tests__/support/worklet-capture-fixture.tsx +0 -28
- package/src/theme/__tests__/__fixtures__/golden-resolved-tokens.json +0 -9346
- package/src/theme/__tests__/__fixtures__/tonal-glass-primary-failures.json +0 -69
- package/src/theme/__tests__/fixtures/color-engine-golden.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-grid.d.ts","sourceRoot":"","sources":["../../../../src/date-picker/calendar-grid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"calendar-grid.d.ts","sourceRoot":"","sources":["../../../../src/date-picker/calendar-grid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAIrE,iEAAiE;AACjE,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAE3C;AAED,gC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C;AAC7C,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,eAAe,GAAG,IAAI,CAIjF;AAED,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAChC,GAAG,GAAE,IAAc,GAClB;IAAE,GAAG,EAAE,eAAe,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,EAAE,CAc7D;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,EAAE,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAErG"}
|
|
@@ -3,5 +3,5 @@ export { DatePicker } from './DatePicker';
|
|
|
3
3
|
export { DateRangePicker } from './DateRangePicker';
|
|
4
4
|
export { MeetingScheduler } from './MeetingScheduler';
|
|
5
5
|
export { TimeField } from './TimeField';
|
|
6
|
-
export type { CalendarConstraintProps, CalendarProps, DatePickerProps, DateRange, DateRangePickerProps, HourFormat, MeetingSchedulerDetails, MeetingSchedulerHost, MeetingSchedulerHourFormat, MeetingSchedulerLabels, MeetingSchedulerProps, MeetingSchedulerValue, RangeCalendarProps, TimeFieldProps, TimeFieldSize, WeekStart, } from './types';
|
|
6
|
+
export type { CalendarConstraintProps, CalendarLabels, CalendarProps, DatePickerLabels, DatePickerProps, DateRange, DateRangePickerLabels, DateRangePickerProps, DateRangePreset, HourFormat, MeetingSchedulerDetails, MeetingSchedulerHost, MeetingSchedulerHourFormat, MeetingSchedulerLabels, MeetingSchedulerProps, MeetingSchedulerValue, RangeCalendarProps, TimeFieldProps, TimeFieldSize, WeekStart, } from './types';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/date-picker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC,YAAY,EACV,uBAAuB,EACvB,aAAa,EACb,eAAe,EACf,SAAS,EACT,oBAAoB,EACpB,UAAU,EACV,uBAAuB,EACvB,oBAAoB,EACpB,0BAA0B,EAC1B,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,SAAS,GACV,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/date-picker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC,YAAY,EACV,uBAAuB,EACvB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,UAAU,EACV,uBAAuB,EACvB,oBAAoB,EACpB,0BAA0B,EAC1B,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,SAAS,GACV,MAAM,SAAS,CAAC"}
|
|
@@ -19,11 +19,22 @@ export interface CalendarConstraintProps {
|
|
|
19
19
|
/** BCP 47 locale for month, weekday and trigger text. Defaults to the runtime's. */
|
|
20
20
|
locale?: string;
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Fixed strings of the month panels, overridable for localisation. Month and
|
|
24
|
+
* weekday names already follow `locale`; these are the rest.
|
|
25
|
+
*/
|
|
26
|
+
export interface CalendarLabels {
|
|
27
|
+
/** Names the previous-month chevron. Default `'Previous month'`. */
|
|
28
|
+
previousMonth?: string;
|
|
29
|
+
/** Names the next-month chevron. Default `'Next month'`. */
|
|
30
|
+
nextMonth?: string;
|
|
31
|
+
}
|
|
22
32
|
interface CalendarBaseProps extends CalendarConstraintProps {
|
|
23
33
|
/** Month shown first. Defaults to the selected day's month, else today's. */
|
|
24
34
|
defaultMonth?: Date;
|
|
25
35
|
/** Names the calendar grid. Defaults to the month title. */
|
|
26
36
|
accessibilityLabel?: string;
|
|
37
|
+
labels?: CalendarLabels;
|
|
27
38
|
style?: StyleProp<ViewStyle>;
|
|
28
39
|
testID?: string;
|
|
29
40
|
}
|
|
@@ -60,6 +71,29 @@ interface PickerBaseProps extends CalendarConstraintProps {
|
|
|
60
71
|
style?: StyleProp<ViewStyle>;
|
|
61
72
|
testID?: string;
|
|
62
73
|
}
|
|
74
|
+
/** `DatePicker`'s fixed strings, overridable for localisation. */
|
|
75
|
+
export interface DatePickerLabels extends CalendarLabels {
|
|
76
|
+
/** The footer's dismiss button. Default `'Cancel'`. */
|
|
77
|
+
cancel?: string;
|
|
78
|
+
/** The footer's commit button. Default `'Apply'`. */
|
|
79
|
+
apply?: string;
|
|
80
|
+
}
|
|
81
|
+
/** The quick-select column's rows, in the order they are drawn. */
|
|
82
|
+
export type DateRangePreset = 'today' | 'yesterday' | 'lastWeek' | 'thisMonth' | 'lastMonth' | 'thisYear' | 'lastYear' | 'allTime';
|
|
83
|
+
/** `DateRangePicker`'s fixed strings, overridable for localisation. */
|
|
84
|
+
export interface DateRangePickerLabels extends DatePickerLabels {
|
|
85
|
+
/**
|
|
86
|
+
* The footer pill. Receives the count so the app pluralises with its own
|
|
87
|
+
* i18n rules. Default `(n) => \`${n} day${n === 1 ? '' : 's'} selected\``.
|
|
88
|
+
*/
|
|
89
|
+
daysSelected?: (days: number) => string;
|
|
90
|
+
/** Names the start-date chip. Default `'Start date'`. */
|
|
91
|
+
startDate?: string;
|
|
92
|
+
/** Names the end-date chip. Default `'End date'`. */
|
|
93
|
+
endDate?: string;
|
|
94
|
+
/** Quick-select rows; any left out keep their English text (`'Today'`, `'Last week'`, …). */
|
|
95
|
+
presets?: Partial<Record<DateRangePreset, string>>;
|
|
96
|
+
}
|
|
63
97
|
export interface DatePickerProps extends PickerBaseProps {
|
|
64
98
|
/** Committed day (controlled). `null` for none. */
|
|
65
99
|
value?: Date | null;
|
|
@@ -71,6 +105,8 @@ export interface DatePickerProps extends PickerBaseProps {
|
|
|
71
105
|
placeholder?: string;
|
|
72
106
|
/** Names the popup and its calendar. Defaults to `'Date'`. */
|
|
73
107
|
accessibilityLabel?: string;
|
|
108
|
+
/** Footer buttons and month chevrons. */
|
|
109
|
+
labels?: DatePickerLabels;
|
|
74
110
|
}
|
|
75
111
|
export interface DateRangePickerProps extends PickerBaseProps {
|
|
76
112
|
/** Committed range (controlled). `null` for none. */
|
|
@@ -85,6 +121,8 @@ export interface DateRangePickerProps extends PickerBaseProps {
|
|
|
85
121
|
accessibilityLabel?: string;
|
|
86
122
|
/** Show the quick-select column (Today, Last week, …). Defaults to `true`. */
|
|
87
123
|
quickSelect?: boolean;
|
|
124
|
+
/** Footer buttons and pill, date chips, quick-select rows and month chevrons. */
|
|
125
|
+
labels?: DateRangePickerLabels;
|
|
88
126
|
}
|
|
89
127
|
/** The person the meeting is booked with. */
|
|
90
128
|
export interface MeetingSchedulerHost {
|
|
@@ -121,7 +159,7 @@ export type HourFormat = '12h' | '24h';
|
|
|
121
159
|
/** The hour-format toggle. An alias of {@link HourFormat}. */
|
|
122
160
|
export type MeetingSchedulerHourFormat = HourFormat;
|
|
123
161
|
/** Fixed strings, overridable for localisation. */
|
|
124
|
-
export interface MeetingSchedulerLabels {
|
|
162
|
+
export interface MeetingSchedulerLabels extends CalendarLabels {
|
|
125
163
|
/** Default `'Send meeting'`. */
|
|
126
164
|
send?: string;
|
|
127
165
|
/** Chip text before a time is picked. Default `'Select a time'`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/date-picker/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE,iFAAiF;AACjF,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,IAAI,CAAC;IACZ,GAAG,EAAE,IAAI,CAAC;CACX;AAED,yEAAyE;AACzE,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAElD,kGAAkG;AAClG,MAAM,WAAW,uBAAuB;IACtC,qCAAqC;IACrC,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACtB,oCAAoC;IACpC,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACtB,mDAAmD;IACnD,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;IAC5C,0DAA0D;IAC1D,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,oFAAoF;IACpF,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,iBAAkB,SAAQ,uBAAuB;IACzD,6EAA6E;IAC7E,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,4DAA4D;IAC5D,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD,kDAAkD;IAClD,KAAK,CAAC,EAAE,IAAI,GAAG,IAAI,CAA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AE,MAAM,CAAC;IAC5B,uEAAuE;IACvE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
package/package.json
CHANGED
|
@@ -22,7 +22,13 @@ import {
|
|
|
22
22
|
} from './calendar-grid';
|
|
23
23
|
import { CALENDAR_CSS, CalendarMonth, dayKey } from './CalendarMonth';
|
|
24
24
|
import { resolveCalendarPalette } from './palette';
|
|
25
|
-
import type {
|
|
25
|
+
import type {
|
|
26
|
+
CalendarConstraintProps,
|
|
27
|
+
CalendarLabels,
|
|
28
|
+
CalendarProps,
|
|
29
|
+
DateRange,
|
|
30
|
+
RangeCalendarProps,
|
|
31
|
+
} from './types';
|
|
26
32
|
|
|
27
33
|
/**
|
|
28
34
|
* `Calendar` (one day) and `RangeCalendar` (a span of days): month panels
|
|
@@ -51,6 +57,7 @@ interface CalendarFrameProps extends CalendarConstraintProps {
|
|
|
51
57
|
/** The day under the pointer, or under keyboard focus. */
|
|
52
58
|
onPreviewDay?: (date: Date | null) => void;
|
|
53
59
|
accessibilityLabel?: string;
|
|
60
|
+
labels?: CalendarLabels;
|
|
54
61
|
style?: StyleProp<ViewStyle>;
|
|
55
62
|
testID?: string;
|
|
56
63
|
}
|
|
@@ -68,6 +75,7 @@ function CalendarFrame({
|
|
|
68
75
|
weekStartsOn = 0,
|
|
69
76
|
locale,
|
|
70
77
|
accessibilityLabel,
|
|
78
|
+
labels,
|
|
71
79
|
style,
|
|
72
80
|
testID,
|
|
73
81
|
}: CalendarFrameProps) {
|
|
@@ -194,6 +202,7 @@ function CalendarFrame({
|
|
|
194
202
|
onKeyDown={onKeyDown}
|
|
195
203
|
registerNode={registerNode}
|
|
196
204
|
accessibilityLabel={accessibilityLabel}
|
|
205
|
+
labels={labels}
|
|
197
206
|
testID={testID ? `${testID}-month-${index}` : undefined}
|
|
198
207
|
/>
|
|
199
208
|
))}
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
type DayCellState,
|
|
15
15
|
} from './calendar-grid';
|
|
16
16
|
import type { CalendarPalette } from './palette';
|
|
17
|
-
import type { WeekStart } from './types';
|
|
17
|
+
import type { CalendarLabels, WeekStart } from './types';
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* One month panel: header, weekday row and day grid.
|
|
@@ -281,6 +281,7 @@ export interface CalendarMonthProps {
|
|
|
281
281
|
onKeyDown: (key: string, preventDefault: () => void) => void;
|
|
282
282
|
registerNode: (key: string, node: View | null) => void;
|
|
283
283
|
accessibilityLabel?: string;
|
|
284
|
+
labels?: CalendarLabels;
|
|
284
285
|
testID?: string;
|
|
285
286
|
}
|
|
286
287
|
|
|
@@ -308,6 +309,7 @@ export function CalendarMonth({
|
|
|
308
309
|
onKeyDown,
|
|
309
310
|
registerNode,
|
|
310
311
|
accessibilityLabel,
|
|
312
|
+
labels,
|
|
311
313
|
testID,
|
|
312
314
|
}: CalendarMonthProps) {
|
|
313
315
|
const title = formatMonthTitle(month, locale);
|
|
@@ -339,7 +341,7 @@ export function CalendarMonth({
|
|
|
339
341
|
{onPrevious ? (
|
|
340
342
|
<NavButton
|
|
341
343
|
direction="left"
|
|
342
|
-
label=
|
|
344
|
+
label={labels?.previousMonth ?? 'Previous month'}
|
|
343
345
|
onPress={onPrevious}
|
|
344
346
|
disabled={previousDisabled}
|
|
345
347
|
palette={palette}
|
|
@@ -356,7 +358,7 @@ export function CalendarMonth({
|
|
|
356
358
|
{onNext ? (
|
|
357
359
|
<NavButton
|
|
358
360
|
direction="right"
|
|
359
|
-
label=
|
|
361
|
+
label={labels?.nextMonth ?? 'Next month'}
|
|
360
362
|
onPress={onNext}
|
|
361
363
|
disabled={nextDisabled}
|
|
362
364
|
palette={palette}
|
|
@@ -29,6 +29,7 @@ export function DatePicker({
|
|
|
29
29
|
onChange,
|
|
30
30
|
placeholder = 'Select date',
|
|
31
31
|
accessibilityLabel = 'Date',
|
|
32
|
+
labels,
|
|
32
33
|
disabled,
|
|
33
34
|
open: openProp,
|
|
34
35
|
defaultOpen = false,
|
|
@@ -91,6 +92,7 @@ export function DatePicker({
|
|
|
91
92
|
weekStartsOn={weekStartsOn}
|
|
92
93
|
locale={locale}
|
|
93
94
|
accessibilityLabel={accessibilityLabel}
|
|
95
|
+
labels={labels}
|
|
94
96
|
testID={testID ? `${testID}-calendar` : undefined}
|
|
95
97
|
/>
|
|
96
98
|
<View
|
|
@@ -126,6 +128,7 @@ export function DatePicker({
|
|
|
126
128
|
setOpenState(false);
|
|
127
129
|
}}
|
|
128
130
|
applyDisabled={!pending}
|
|
131
|
+
labels={labels}
|
|
129
132
|
testID={testID}
|
|
130
133
|
/>
|
|
131
134
|
</View>
|
|
@@ -36,6 +36,11 @@ import type { DateRange, DateRangePickerProps } from './types';
|
|
|
36
36
|
/** 16 + 118 + 12 + two panels + 8 between them + 8 — the popup width. */
|
|
37
37
|
const DUAL_MONTH_WIDTH = 16 + 118 + 12 + MONTH_PANEL_WIDTH * 2 + 8 + 8;
|
|
38
38
|
|
|
39
|
+
/** The pill's English default; `labels.daysSelected` takes the app's own plural rules. */
|
|
40
|
+
function daysSelected(days: number): string {
|
|
41
|
+
return `${days} day${days === 1 ? '' : 's'} selected`;
|
|
42
|
+
}
|
|
43
|
+
|
|
39
44
|
/** `text-body-medium`, in Inter. */
|
|
40
45
|
const BODY: TextStyle = TYPE_SCALE['body-medium'];
|
|
41
46
|
|
|
@@ -88,6 +93,7 @@ export function DateRangePicker({
|
|
|
88
93
|
placeholder = 'Select date range',
|
|
89
94
|
accessibilityLabel = 'Date range',
|
|
90
95
|
quickSelect = true,
|
|
96
|
+
labels,
|
|
91
97
|
disabled,
|
|
92
98
|
open: openProp,
|
|
93
99
|
defaultOpen = false,
|
|
@@ -154,8 +160,8 @@ export function DateRangePicker({
|
|
|
154
160
|
<View style={{ width: 118, gap: 6 }}>
|
|
155
161
|
{presets.map((preset) => (
|
|
156
162
|
<PresetRow
|
|
157
|
-
key={preset.
|
|
158
|
-
label={preset.label}
|
|
163
|
+
key={preset.key}
|
|
164
|
+
label={labels?.presets?.[preset.key] ?? preset.label}
|
|
159
165
|
active={isSameRange(pending, preset.range)}
|
|
160
166
|
onPress={() => choose(preset.range)}
|
|
161
167
|
palette={palette}
|
|
@@ -183,6 +189,7 @@ export function DateRangePicker({
|
|
|
183
189
|
weekStartsOn={weekStartsOn}
|
|
184
190
|
locale={locale}
|
|
185
191
|
accessibilityLabel={accessibilityLabel}
|
|
192
|
+
labels={labels}
|
|
186
193
|
testID={testID ? `${testID}-calendar` : undefined}
|
|
187
194
|
/>
|
|
188
195
|
<View
|
|
@@ -206,7 +213,7 @@ export function DateRangePicker({
|
|
|
206
213
|
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 5 }}>
|
|
207
214
|
<DateChipInput
|
|
208
215
|
date={pending.start}
|
|
209
|
-
label=
|
|
216
|
+
label={labels?.startDate ?? 'Start date'}
|
|
210
217
|
palette={palette}
|
|
211
218
|
onCommit={(start) =>
|
|
212
219
|
setPending({ start, end: start > pending.end ? start : pending.end })
|
|
@@ -215,7 +222,7 @@ export function DateRangePicker({
|
|
|
215
222
|
<Text style={{ ...BODY, color: palette.secondaryText }}>-</Text>
|
|
216
223
|
<DateChipInput
|
|
217
224
|
date={pending.end}
|
|
218
|
-
label=
|
|
225
|
+
label={labels?.endDate ?? 'End date'}
|
|
219
226
|
palette={palette}
|
|
220
227
|
onCommit={(end) =>
|
|
221
228
|
setPending({ start: end < pending.start ? end : pending.start, end })
|
|
@@ -234,7 +241,7 @@ export function DateRangePicker({
|
|
|
234
241
|
}}
|
|
235
242
|
>
|
|
236
243
|
<Text style={{ ...BODY, color: palette.secondaryText }}>
|
|
237
|
-
{
|
|
244
|
+
{(labels?.daysSelected ?? daysSelected)(days)}
|
|
238
245
|
</Text>
|
|
239
246
|
</View>
|
|
240
247
|
) : null}
|
|
@@ -252,6 +259,7 @@ export function DateRangePicker({
|
|
|
252
259
|
setOpenState(false);
|
|
253
260
|
}}
|
|
254
261
|
applyDisabled={!pending}
|
|
262
|
+
labels={labels}
|
|
255
263
|
testID={testID}
|
|
256
264
|
/>
|
|
257
265
|
</View>
|
|
@@ -7,6 +7,7 @@ import { RiCalendarLine as CalendarIcon } from '../icons/remix/RiCalendarLine';
|
|
|
7
7
|
import { Popover, PopoverContent, PopoverTrigger } from '../popover';
|
|
8
8
|
import { useTheme } from '../theme/use-theme';
|
|
9
9
|
import { resolveCalendarPalette, type CalendarPalette } from './palette';
|
|
10
|
+
import type { DatePickerLabels } from './types';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* The chrome both pickers share (`date-picker/shared.tsx`).
|
|
@@ -99,20 +100,22 @@ export function PickerActions({
|
|
|
99
100
|
onCancel,
|
|
100
101
|
onApply,
|
|
101
102
|
applyDisabled,
|
|
103
|
+
labels,
|
|
102
104
|
testID,
|
|
103
105
|
}: {
|
|
104
106
|
onCancel: () => void;
|
|
105
107
|
onApply: () => void;
|
|
106
108
|
applyDisabled: boolean;
|
|
109
|
+
labels?: DatePickerLabels;
|
|
107
110
|
testID?: string;
|
|
108
111
|
}) {
|
|
109
112
|
return (
|
|
110
113
|
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 10 }}>
|
|
111
114
|
<Button onPress={onCancel} testID={testID ? `${testID}-cancel` : undefined} appearance="subtle" tone="neutral">
|
|
112
|
-
Cancel
|
|
115
|
+
{labels?.cancel ?? 'Cancel'}
|
|
113
116
|
</Button>
|
|
114
117
|
<Button onPress={onApply} disabled={applyDisabled} testID={testID ? `${testID}-apply` : undefined}>
|
|
115
|
-
Apply
|
|
118
|
+
{labels?.apply ?? 'Apply'}
|
|
116
119
|
</Button>
|
|
117
120
|
</View>
|
|
118
121
|
);
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* internal state. The time of day on an input is ignored.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import type { DateRange, WeekStart } from './types';
|
|
13
|
+
import type { DateRange, DateRangePreset, WeekStart } from './types';
|
|
14
14
|
|
|
15
15
|
const MS_PER_DAY = 86_400_000;
|
|
16
16
|
|
|
@@ -334,20 +334,22 @@ export function clampDate(date: Date, { minDate, maxDate }: DateConstraints): Da
|
|
|
334
334
|
return startOfDay(date);
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
-
/** Quick-select presets, relative to `now`. */
|
|
338
|
-
export function quickSelectPresets(
|
|
337
|
+
/** Quick-select presets, relative to `now`. `label` is the English default. */
|
|
338
|
+
export function quickSelectPresets(
|
|
339
|
+
now: Date = today(),
|
|
340
|
+
): { key: DateRangePreset; label: string; range: DateRange }[] {
|
|
339
341
|
const lastMonth = addMonths(now, -1);
|
|
340
342
|
const lastYear = new Date(now.getFullYear() - 1, now.getMonth(), 1);
|
|
341
343
|
const yesterday = addDays(now, -1);
|
|
342
344
|
return [
|
|
343
|
-
{ label: 'Today', range: { start: now, end: now } },
|
|
344
|
-
{ label: 'Yesterday', range: { start: yesterday, end: yesterday } },
|
|
345
|
-
{ label: 'Last week', range: { start: addDays(now, -7), end: yesterday } },
|
|
346
|
-
{ label: 'This month', range: { start: startOfMonth(now), end: endOfMonth(now) } },
|
|
347
|
-
{ label: 'Last month', range: { start: startOfMonth(lastMonth), end: endOfMonth(lastMonth) } },
|
|
348
|
-
{ label: 'This year', range: { start: startOfYear(now), end: endOfYear(now) } },
|
|
349
|
-
{ label: 'Last year', range: { start: startOfYear(lastYear), end: endOfYear(lastYear) } },
|
|
350
|
-
{ label: 'All time', range: { start: addMonths(now, -120), end: now } },
|
|
345
|
+
{ key: 'today', label: 'Today', range: { start: now, end: now } },
|
|
346
|
+
{ key: 'yesterday', label: 'Yesterday', range: { start: yesterday, end: yesterday } },
|
|
347
|
+
{ key: 'lastWeek', label: 'Last week', range: { start: addDays(now, -7), end: yesterday } },
|
|
348
|
+
{ key: 'thisMonth', label: 'This month', range: { start: startOfMonth(now), end: endOfMonth(now) } },
|
|
349
|
+
{ key: 'lastMonth', label: 'Last month', range: { start: startOfMonth(lastMonth), end: endOfMonth(lastMonth) } },
|
|
350
|
+
{ key: 'thisYear', label: 'This year', range: { start: startOfYear(now), end: endOfYear(now) } },
|
|
351
|
+
{ key: 'lastYear', label: 'Last year', range: { start: startOfYear(lastYear), end: endOfYear(lastYear) } },
|
|
352
|
+
{ key: 'allTime', label: 'All time', range: { start: addMonths(now, -120), end: now } },
|
|
351
353
|
];
|
|
352
354
|
}
|
|
353
355
|
|
package/src/date-picker/index.ts
CHANGED
|
@@ -8,10 +8,14 @@ export { TimeField } from './TimeField';
|
|
|
8
8
|
|
|
9
9
|
export type {
|
|
10
10
|
CalendarConstraintProps,
|
|
11
|
+
CalendarLabels,
|
|
11
12
|
CalendarProps,
|
|
13
|
+
DatePickerLabels,
|
|
12
14
|
DatePickerProps,
|
|
13
15
|
DateRange,
|
|
16
|
+
DateRangePickerLabels,
|
|
14
17
|
DateRangePickerProps,
|
|
18
|
+
DateRangePreset,
|
|
15
19
|
HourFormat,
|
|
16
20
|
MeetingSchedulerDetails,
|
|
17
21
|
MeetingSchedulerHost,
|
package/src/date-picker/types.ts
CHANGED
|
@@ -23,11 +23,23 @@ export interface CalendarConstraintProps {
|
|
|
23
23
|
locale?: string;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Fixed strings of the month panels, overridable for localisation. Month and
|
|
28
|
+
* weekday names already follow `locale`; these are the rest.
|
|
29
|
+
*/
|
|
30
|
+
export interface CalendarLabels {
|
|
31
|
+
/** Names the previous-month chevron. Default `'Previous month'`. */
|
|
32
|
+
previousMonth?: string;
|
|
33
|
+
/** Names the next-month chevron. Default `'Next month'`. */
|
|
34
|
+
nextMonth?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
26
37
|
interface CalendarBaseProps extends CalendarConstraintProps {
|
|
27
38
|
/** Month shown first. Defaults to the selected day's month, else today's. */
|
|
28
39
|
defaultMonth?: Date;
|
|
29
40
|
/** Names the calendar grid. Defaults to the month title. */
|
|
30
41
|
accessibilityLabel?: string;
|
|
42
|
+
labels?: CalendarLabels;
|
|
31
43
|
style?: StyleProp<ViewStyle>;
|
|
32
44
|
testID?: string;
|
|
33
45
|
}
|
|
@@ -68,6 +80,40 @@ interface PickerBaseProps extends CalendarConstraintProps {
|
|
|
68
80
|
testID?: string;
|
|
69
81
|
}
|
|
70
82
|
|
|
83
|
+
/** `DatePicker`'s fixed strings, overridable for localisation. */
|
|
84
|
+
export interface DatePickerLabels extends CalendarLabels {
|
|
85
|
+
/** The footer's dismiss button. Default `'Cancel'`. */
|
|
86
|
+
cancel?: string;
|
|
87
|
+
/** The footer's commit button. Default `'Apply'`. */
|
|
88
|
+
apply?: string;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** The quick-select column's rows, in the order they are drawn. */
|
|
92
|
+
export type DateRangePreset =
|
|
93
|
+
| 'today'
|
|
94
|
+
| 'yesterday'
|
|
95
|
+
| 'lastWeek'
|
|
96
|
+
| 'thisMonth'
|
|
97
|
+
| 'lastMonth'
|
|
98
|
+
| 'thisYear'
|
|
99
|
+
| 'lastYear'
|
|
100
|
+
| 'allTime';
|
|
101
|
+
|
|
102
|
+
/** `DateRangePicker`'s fixed strings, overridable for localisation. */
|
|
103
|
+
export interface DateRangePickerLabels extends DatePickerLabels {
|
|
104
|
+
/**
|
|
105
|
+
* The footer pill. Receives the count so the app pluralises with its own
|
|
106
|
+
* i18n rules. Default `(n) => \`${n} day${n === 1 ? '' : 's'} selected\``.
|
|
107
|
+
*/
|
|
108
|
+
daysSelected?: (days: number) => string;
|
|
109
|
+
/** Names the start-date chip. Default `'Start date'`. */
|
|
110
|
+
startDate?: string;
|
|
111
|
+
/** Names the end-date chip. Default `'End date'`. */
|
|
112
|
+
endDate?: string;
|
|
113
|
+
/** Quick-select rows; any left out keep their English text (`'Today'`, `'Last week'`, …). */
|
|
114
|
+
presets?: Partial<Record<DateRangePreset, string>>;
|
|
115
|
+
}
|
|
116
|
+
|
|
71
117
|
export interface DatePickerProps extends PickerBaseProps {
|
|
72
118
|
/** Committed day (controlled). `null` for none. */
|
|
73
119
|
value?: Date | null;
|
|
@@ -79,6 +125,8 @@ export interface DatePickerProps extends PickerBaseProps {
|
|
|
79
125
|
placeholder?: string;
|
|
80
126
|
/** Names the popup and its calendar. Defaults to `'Date'`. */
|
|
81
127
|
accessibilityLabel?: string;
|
|
128
|
+
/** Footer buttons and month chevrons. */
|
|
129
|
+
labels?: DatePickerLabels;
|
|
82
130
|
}
|
|
83
131
|
|
|
84
132
|
export interface DateRangePickerProps extends PickerBaseProps {
|
|
@@ -94,6 +142,8 @@ export interface DateRangePickerProps extends PickerBaseProps {
|
|
|
94
142
|
accessibilityLabel?: string;
|
|
95
143
|
/** Show the quick-select column (Today, Last week, …). Defaults to `true`. */
|
|
96
144
|
quickSelect?: boolean;
|
|
145
|
+
/** Footer buttons and pill, date chips, quick-select rows and month chevrons. */
|
|
146
|
+
labels?: DateRangePickerLabels;
|
|
97
147
|
}
|
|
98
148
|
|
|
99
149
|
/** The person the meeting is booked with. */
|
|
@@ -136,7 +186,7 @@ export type HourFormat = '12h' | '24h';
|
|
|
136
186
|
export type MeetingSchedulerHourFormat = HourFormat;
|
|
137
187
|
|
|
138
188
|
/** Fixed strings, overridable for localisation. */
|
|
139
|
-
export interface MeetingSchedulerLabels {
|
|
189
|
+
export interface MeetingSchedulerLabels extends CalendarLabels {
|
|
140
190
|
/** Default `'Send meeting'`. */
|
|
141
191
|
send?: string;
|
|
142
192
|
/** Chip text before a time is picked. Default `'Select a time'`. */
|