@westpac/ui 0.55.3 → 0.56.1
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/CHANGELOG.md +12 -0
- package/dist/component-type.json +1 -1
- package/dist/components/date-picker-beta/components/date-field/components/date-segment/date-segment.component.js +0 -1
- package/dist/components/date-picker-beta/components/date-field/components/date-segment/date-segment.styles.d.ts +2 -14
- package/dist/components/date-picker-beta/components/date-field/components/date-segment/date-segment.styles.js +2 -6
- package/dist/components/date-picker-beta/components/popover/popover.styles.js +1 -1
- package/dist/components/date-picker-beta/date-picker.component.d.ts +1 -1
- package/dist/components/date-picker-beta/date-picker.component.js +4 -3
- package/dist/components/date-picker-beta/date-picker.styles.d.ts +15 -0
- package/dist/components/date-picker-beta/date-picker.styles.js +13 -8
- package/dist/components/date-picker-beta/date-picker.types.d.ts +11 -1
- package/dist/css/westpac-ui.css +155 -246
- package/dist/css/westpac-ui.min.css +155 -246
- package/package.json +2 -2
- package/src/components/date-picker-beta/components/date-field/components/date-segment/date-segment.component.tsx +0 -1
- package/src/components/date-picker-beta/components/date-field/components/date-segment/date-segment.styles.ts +2 -6
- package/src/components/date-picker-beta/components/popover/popover.styles.ts +1 -1
- package/src/components/date-picker-beta/date-picker.component.tsx +9 -2
- package/src/components/date-picker-beta/date-picker.styles.ts +13 -8
- package/src/components/date-picker-beta/date-picker.types.ts +11 -4
|
@@ -8,7 +8,6 @@ export function DateSegment({ segment, state, separator, ...props }) {
|
|
|
8
8
|
const { segmentProps } = useDateSegment(segment, state, ref);
|
|
9
9
|
const styles = dateSegmentStyles({
|
|
10
10
|
isFocusVisible,
|
|
11
|
-
isPlaceholder: segment.isPlaceholder,
|
|
12
11
|
isSeparator: segmentProps.role !== 'spinbutton'
|
|
13
12
|
});
|
|
14
13
|
return React.createElement("span", {
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
2
|
-
isPlaceholder: {
|
|
3
|
-
true: string;
|
|
4
|
-
false: string;
|
|
5
|
-
};
|
|
6
2
|
isFocusVisible: {
|
|
7
3
|
true: string;
|
|
8
4
|
false: string;
|
|
@@ -11,13 +7,9 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
11
7
|
true: string;
|
|
12
8
|
false: string;
|
|
13
9
|
};
|
|
14
|
-
}, undefined, "
|
|
10
|
+
}, undefined, "uppercase disabled:form-control-disabled focus:focus-outline", {
|
|
15
11
|
responsiveVariants: string[];
|
|
16
12
|
}, {
|
|
17
|
-
isPlaceholder: {
|
|
18
|
-
true: string;
|
|
19
|
-
false: string;
|
|
20
|
-
};
|
|
21
13
|
isFocusVisible: {
|
|
22
14
|
true: string;
|
|
23
15
|
false: string;
|
|
@@ -27,10 +19,6 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
27
19
|
false: string;
|
|
28
20
|
};
|
|
29
21
|
}, undefined, import("tailwind-variants").TVReturnType<{
|
|
30
|
-
isPlaceholder: {
|
|
31
|
-
true: string;
|
|
32
|
-
false: string;
|
|
33
|
-
};
|
|
34
22
|
isFocusVisible: {
|
|
35
23
|
true: string;
|
|
36
24
|
false: string;
|
|
@@ -39,6 +27,6 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
39
27
|
true: string;
|
|
40
28
|
false: string;
|
|
41
29
|
};
|
|
42
|
-
}, undefined, "
|
|
30
|
+
}, undefined, "uppercase disabled:form-control-disabled focus:focus-outline", {
|
|
43
31
|
responsiveVariants: string[];
|
|
44
32
|
}, unknown, unknown, undefined>>;
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import { tv } from 'tailwind-variants';
|
|
2
2
|
export const styles = tv({
|
|
3
|
-
base: '
|
|
3
|
+
base: 'uppercase disabled:form-control-disabled focus:focus-outline',
|
|
4
4
|
variants: {
|
|
5
|
-
isPlaceholder: {
|
|
6
|
-
true: 'text-text-50 opacity-100',
|
|
7
|
-
false: ''
|
|
8
|
-
},
|
|
9
5
|
isFocusVisible: {
|
|
10
6
|
true: 'focus-outline',
|
|
11
7
|
false: ''
|
|
12
8
|
},
|
|
13
9
|
isSeparator: {
|
|
14
|
-
true: 'px-0.5 text-text
|
|
10
|
+
true: 'px-0.5 text-text',
|
|
15
11
|
false: ''
|
|
16
12
|
}
|
|
17
13
|
}
|
|
@@ -20,7 +20,7 @@ export const styles = tv({
|
|
|
20
20
|
underlay: '',
|
|
21
21
|
closeButton: 'pointer-events-none absolute right-0 top-0 size-5 -translate-y-1/2 translate-x-1/2 touch-none rounded-full border border-border bg-white opacity-0 focus:pointer-events-auto focus:touch-auto focus:opacity-100',
|
|
22
22
|
headerLabel: 'hidden',
|
|
23
|
-
popover: 'absolute
|
|
23
|
+
popover: 'absolute my-1 scale-100 animate-fadeIn rounded border border-border bg-white opacity-100 shadow-[0_5px_10px_rgba(0,0,0,0.2)]'
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type DatePickerBetaProps } from './date-picker.types.js';
|
|
2
|
-
export declare function DatePickerBeta({ size, className, bottomSheetView, isDateUnavailable, disableDaysOfWeek, disableWeekends, separator, portalContainer, ...props }: DatePickerBetaProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function DatePickerBeta({ size, className, bottomSheetView, isDateUnavailable, disableDaysOfWeek, disableWeekends, separator, placement, block, portalContainer, ...props }: DatePickerBetaProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -22,7 +22,7 @@ const BREAKPOINTS_DECRECENT = [
|
|
|
22
22
|
export function DatePickerBeta({ size = 'medium', className, bottomSheetView = {
|
|
23
23
|
initial: true,
|
|
24
24
|
xsl: false
|
|
25
|
-
}, isDateUnavailable, disableDaysOfWeek, disableWeekends, separator, portalContainer, ...props }) {
|
|
25
|
+
}, isDateUnavailable, disableDaysOfWeek, disableWeekends, separator, placement = 'bottom left', block = false, portalContainer, ...props }) {
|
|
26
26
|
const { locale } = useLocale();
|
|
27
27
|
const enhancedIsDateUnavailable = useMemo(()=>{
|
|
28
28
|
return disableDaysOfWeek || disableWeekends ? (date)=>{
|
|
@@ -56,7 +56,8 @@ export function DatePickerBeta({ size = 'medium', className, bottomSheetView = {
|
|
|
56
56
|
const styles = datePickerStyles({
|
|
57
57
|
size,
|
|
58
58
|
isInvalid: state.isInvalid,
|
|
59
|
-
isDisabled: props.isDisabled
|
|
59
|
+
isDisabled: props.isDisabled,
|
|
60
|
+
block
|
|
60
61
|
});
|
|
61
62
|
const breakpoint = useBreakpoint();
|
|
62
63
|
const ref = useRef(null);
|
|
@@ -106,7 +107,7 @@ export function DatePickerBeta({ size = 'medium', className, bottomSheetView = {
|
|
|
106
107
|
showAsBottomSheet: showAsBottomSheet,
|
|
107
108
|
state: state,
|
|
108
109
|
triggerRef: ref,
|
|
109
|
-
placement:
|
|
110
|
+
placement: placement
|
|
110
111
|
}, React.createElement(Dialog, dialogProps, React.createElement(Calendar, {
|
|
111
112
|
...calendarProps,
|
|
112
113
|
firstDayOfWeek: props.firstDayOfWeek
|
|
@@ -17,6 +17,11 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
17
17
|
button: string;
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
+
block: {
|
|
21
|
+
true: {
|
|
22
|
+
input: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
20
25
|
isInvalid: {
|
|
21
26
|
true: {
|
|
22
27
|
input: string;
|
|
@@ -53,6 +58,11 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
53
58
|
button: string;
|
|
54
59
|
};
|
|
55
60
|
};
|
|
61
|
+
block: {
|
|
62
|
+
true: {
|
|
63
|
+
input: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
56
66
|
isInvalid: {
|
|
57
67
|
true: {
|
|
58
68
|
input: string;
|
|
@@ -87,6 +97,11 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
87
97
|
button: string;
|
|
88
98
|
};
|
|
89
99
|
};
|
|
100
|
+
block: {
|
|
101
|
+
true: {
|
|
102
|
+
input: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
90
105
|
isInvalid: {
|
|
91
106
|
true: {
|
|
92
107
|
input: string;
|
|
@@ -7,20 +7,25 @@ export const styles = tv({
|
|
|
7
7
|
variants: {
|
|
8
8
|
size: {
|
|
9
9
|
small: {
|
|
10
|
-
input: 'form-control-small gap-1.5',
|
|
11
|
-
button: '-
|
|
10
|
+
input: 'form-control-small max-h-5 gap-1.5',
|
|
11
|
+
button: '-mr-1.5 min-h-[1.75rem]'
|
|
12
12
|
},
|
|
13
13
|
medium: {
|
|
14
|
-
input: 'form-control-medium gap-2',
|
|
15
|
-
button: '
|
|
14
|
+
input: 'form-control-medium max-h-6 gap-2',
|
|
15
|
+
button: '-mr-2 min-h-[2.125rem]'
|
|
16
16
|
},
|
|
17
17
|
large: {
|
|
18
|
-
input: 'form-control-large gap-2.5',
|
|
19
|
-
button: '
|
|
18
|
+
input: 'form-control-large max-h-7 gap-2.5',
|
|
19
|
+
button: '-mr-2.5 min-h-[2.5rem]'
|
|
20
20
|
},
|
|
21
21
|
xlarge: {
|
|
22
|
-
input: 'form-control-xlarge gap-3',
|
|
23
|
-
button: '-
|
|
22
|
+
input: 'form-control-xlarge max-h-8 gap-3',
|
|
23
|
+
button: '-mr-3 min-h-[2.875rem]'
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
block: {
|
|
27
|
+
true: {
|
|
28
|
+
input: 'w-full justify-between gap-0'
|
|
24
29
|
}
|
|
25
30
|
},
|
|
26
31
|
isInvalid: {
|
|
@@ -5,7 +5,12 @@ import { VariantProps } from 'tailwind-variants';
|
|
|
5
5
|
import { Breakpoint } from '../../tailwind/constants/index.js';
|
|
6
6
|
import { styles } from './date-picker.styles.js';
|
|
7
7
|
type Variants = VariantProps<typeof styles>;
|
|
8
|
-
export type DatePickerBetaProps<T extends DateValue = DateValue> = DatePickerStateOptions<T> & Variants & Omit<HTMLAttributes<HTMLDivElement>, 'invalid'> & {
|
|
8
|
+
export type DatePickerBetaProps<T extends DateValue = DateValue> = DatePickerStateOptions<T> & Omit<Variants, 'block'> & Omit<HTMLAttributes<HTMLDivElement>, 'invalid'> & {
|
|
9
|
+
/**
|
|
10
|
+
* Allows the input to take the full width of its container.
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
block?: boolean;
|
|
9
14
|
/**
|
|
10
15
|
* Determines whether to display the component as a bottom sheet view.
|
|
11
16
|
* Can also accept an object to conditionally enable the bottom sheet based on breakpoints.
|
|
@@ -24,6 +29,11 @@ export type DatePickerBetaProps<T extends DateValue = DateValue> = DatePickerSta
|
|
|
24
29
|
* Separator character used in the date field. Defaults to "/".
|
|
25
30
|
*/
|
|
26
31
|
separator?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Placement for the datepicker popover.
|
|
34
|
+
* @default "bottom left"
|
|
35
|
+
*/
|
|
36
|
+
placement?: 'top left' | 'top right' | 'bottom left' | 'bottom right';
|
|
27
37
|
/**
|
|
28
38
|
* portal container for date picker
|
|
29
39
|
*/
|