@westpac/ui 0.52.0 → 0.53.2
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 +29 -0
- package/dist/component-type.json +1 -1
- package/dist/components/accordion/components/accordion-item/accordion-item.styles.js +1 -1
- package/dist/components/alert/alert.styles.js +1 -1
- package/dist/components/autocomplete/autocomplete.styles.js +1 -1
- package/dist/components/badge/badge.styles.d.ts +2 -2
- package/dist/components/badge/badge.styles.js +2 -2
- package/dist/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.styles.js +2 -2
- package/dist/components/breadcrumb/components/breadcrumb-item/breadcrumb-item.component.js +1 -1
- package/dist/components/button/button.styles.js +1 -1
- package/dist/components/button-dropdown/button-dropdown.component.d.ts +1 -1
- package/dist/components/button-dropdown/button-dropdown.component.js +5 -3
- package/dist/components/button-dropdown/button-dropdown.types.d.ts +7 -2
- package/dist/components/button-dropdown/components/button-dropdown-panel/button-dropdown-panel.styles.js +1 -1
- package/dist/components/collapsible/collapsible.styles.js +1 -1
- package/dist/components/compacta/compacta.styles.js +1 -1
- package/dist/components/date-picker-beta/components/calendar/components/calendar-grid/calendar-grid.component.js +1 -1
- package/dist/components/date-picker-beta/components/date-field/components/date-segment/date-segment.styles.d.ts +2 -2
- package/dist/components/date-picker-beta/components/date-field/components/date-segment/date-segment.styles.js +1 -1
- package/dist/components/date-picker-beta/components/popover/popover.styles.js +1 -1
- package/dist/components/filter/components/filter-buttons/filter-buttons.component.js +2 -3
- package/dist/components/filter/components/filter-buttons/filter-buttons.styles.js +5 -5
- package/dist/components/filter/filter.component.js +1 -1
- package/dist/components/flexi-cell/components/flexi-cell-body/flexi-cell-body.styles.d.ts +2 -2
- package/dist/components/flexi-cell/components/flexi-cell-body/flexi-cell-body.styles.js +1 -1
- package/dist/components/flexi-cell/flexi-cell.styles.js +1 -1
- package/dist/components/footer/footer.styles.js +1 -1
- package/dist/components/header/header.styles.js +1 -1
- package/dist/components/input-group/components/input-group-add-ons/input-group-add-ons.styles.d.ts +2 -2
- package/dist/components/input-group/components/input-group-add-ons/input-group-add-ons.styles.js +3 -3
- package/dist/components/input-group/input-group.component.js +3 -1
- package/dist/components/modal/components/modal-dialog/modal-dialog.styles.js +1 -1
- package/dist/components/pagination/components/pagination-item/pagination-item.component.js +8 -2
- package/dist/components/pagination/components/pagination-item/pagination-item.styles.d.ts +12 -0
- package/dist/components/pagination/components/pagination-item/pagination-item.styles.js +5 -1
- package/dist/components/pagination/components/pagination-presentational/pagination-presentational.styles.js +1 -1
- package/dist/components/panel/components/panel-footer/panel-footer.styles.js +1 -1
- package/dist/components/panel/panel.styles.js +1 -1
- package/dist/components/popover/components/panel/panel.styles.js +2 -2
- package/dist/components/progress-rope/components/progress-rope-group-step/progress-rope-group-step.component.js +37 -19
- package/dist/components/repeater/repeater.styles.js +1 -1
- package/dist/components/table/table.styles.js +1 -1
- package/dist/components/tabs/components/tabs-tab/tabs-tab.styles.js +1 -1
- package/dist/components/tabs/components/tabs-tab-panel/tabs-tab-panel.styles.d.ts +2 -2
- package/dist/components/tabs/components/tabs-tab-panel/tabs-tab-panel.styles.js +1 -1
- package/dist/components/well/well.styles.d.ts +2 -2
- package/dist/components/well/well.styles.js +1 -1
- package/dist/css/westpac-ui.css +59 -9
- package/dist/css/westpac-ui.min.css +59 -9
- package/package.json +2 -2
- package/src/components/accordion/components/accordion-item/accordion-item.styles.ts +1 -1
- package/src/components/alert/alert.styles.ts +1 -1
- package/src/components/autocomplete/autocomplete.styles.ts +1 -1
- package/src/components/badge/badge.styles.ts +2 -2
- package/src/components/bottom-sheet/components/bottom-sheet-dialog/bottom-sheet-dialog.styles.ts +2 -2
- package/src/components/breadcrumb/components/breadcrumb-item/breadcrumb-item.component.tsx +1 -1
- package/src/components/button/button.styles.ts +1 -1
- package/src/components/button-dropdown/button-dropdown.component.tsx +8 -1
- package/src/components/button-dropdown/button-dropdown.types.ts +7 -2
- package/src/components/button-dropdown/components/button-dropdown-panel/button-dropdown-panel.styles.ts +1 -1
- package/src/components/collapsible/collapsible.styles.ts +1 -1
- package/src/components/compacta/compacta.styles.ts +1 -1
- package/src/components/date-picker-beta/components/calendar/components/calendar-grid/calendar-grid.component.tsx +1 -1
- package/src/components/date-picker-beta/components/date-field/components/date-segment/date-segment.styles.ts +1 -1
- package/src/components/date-picker-beta/components/popover/popover.styles.ts +1 -1
- package/src/components/filter/components/filter-buttons/filter-buttons.component.tsx +1 -2
- package/src/components/filter/components/filter-buttons/filter-buttons.styles.ts +5 -5
- package/src/components/filter/filter.component.tsx +1 -1
- package/src/components/flexi-cell/components/flexi-cell-body/flexi-cell-body.styles.ts +1 -1
- package/src/components/flexi-cell/flexi-cell.styles.ts +1 -1
- package/src/components/footer/footer.styles.ts +1 -1
- package/src/components/header/header.styles.ts +1 -1
- package/src/components/input-group/components/input-group-add-ons/input-group-add-ons.styles.ts +3 -3
- package/src/components/input-group/input-group.component.tsx +3 -0
- package/src/components/modal/components/modal-dialog/modal-dialog.styles.ts +1 -1
- package/src/components/pagination/components/pagination-item/pagination-item.component.tsx +9 -2
- package/src/components/pagination/components/pagination-item/pagination-item.styles.ts +5 -1
- package/src/components/pagination/components/pagination-presentational/pagination-presentational.styles.ts +1 -1
- package/src/components/panel/components/panel-footer/panel-footer.styles.ts +1 -1
- package/src/components/panel/panel.styles.ts +1 -1
- package/src/components/popover/components/panel/panel.styles.ts +2 -2
- package/src/components/progress-rope/components/progress-rope-group-step/progress-rope-group-step.component.tsx +62 -38
- package/src/components/repeater/repeater.styles.ts +1 -1
- package/src/components/table/table.styles.ts +1 -1
- package/src/components/tabs/components/tabs-tab/tabs-tab.styles.ts +1 -1
- package/src/components/tabs/components/tabs-tab-panel/tabs-tab-panel.styles.ts +1 -1
- package/src/components/well/well.styles.ts +1 -1
|
@@ -2,17 +2,17 @@ import { tv } from 'tailwind-variants';
|
|
|
2
2
|
|
|
3
3
|
export const styles = tv({
|
|
4
4
|
slots: {
|
|
5
|
-
base: 'relative flex justify-start',
|
|
6
|
-
buttonList: 'flex w-full touch-pan-x gap-1 overflow-
|
|
7
|
-
scrollButton: 'absolute rounded-none contrast-more:bg-black',
|
|
5
|
+
base: 'relative -left-1 flex justify-start', // left positioning for padding on buttons to show focus ring but be aligned to input
|
|
6
|
+
buttonList: 'flex w-full touch-pan-x gap-1 overflow-y-visible overflow-x-scroll whitespace-nowrap p-1',
|
|
7
|
+
scrollButton: 'absolute inset-y-0 h-auto rounded-none contrast-more:bg-black',
|
|
8
8
|
},
|
|
9
9
|
variants: {
|
|
10
10
|
position: {
|
|
11
11
|
left: {
|
|
12
|
-
scrollButton: '
|
|
12
|
+
scrollButton: 'left-0 bg-[linear-gradient(90deg,_#fff_66%,_transparent)] pl-0',
|
|
13
13
|
},
|
|
14
14
|
right: {
|
|
15
|
-
scrollButton: '-right-
|
|
15
|
+
scrollButton: '-right-2 bg-[linear-gradient(270deg,_#fff_66%,_transparent)] pr-0',
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
hidden: {
|
|
@@ -3,7 +3,7 @@ import { tv } from 'tailwind-variants';
|
|
|
3
3
|
export const styles = tv(
|
|
4
4
|
{
|
|
5
5
|
slots: {
|
|
6
|
-
base: 'relative flex bg-white transition-colors',
|
|
6
|
+
base: 'relative flex bg-white transition-colors [&_:focus-visible]:focus-outline',
|
|
7
7
|
topBadgeWrapper: 'absolute right-[-1px] top-[-1px]',
|
|
8
8
|
topBadge: 'rounded-br-none rounded-tl-none',
|
|
9
9
|
},
|
|
@@ -3,7 +3,7 @@ import { tv } from 'tailwind-variants';
|
|
|
3
3
|
export const styles = tv(
|
|
4
4
|
{
|
|
5
5
|
slots: {
|
|
6
|
-
base: 'relative overflow-hidden border-t border-t-border',
|
|
6
|
+
base: 'relative overflow-hidden border-t border-t-border [&_:focus-visible]:focus-outline',
|
|
7
7
|
wrapper: 'pt-3 max-md:px-2 max-md:pb-3 md:px-4 md:pb-3',
|
|
8
8
|
link: 'float-right block',
|
|
9
9
|
logoWrapper: 'flex justify-end',
|
|
@@ -12,7 +12,7 @@ export const styles = tv(
|
|
|
12
12
|
leftContent: 'flex items-center',
|
|
13
13
|
leftButton:
|
|
14
14
|
'my-1 rounded-none border-r border-[#E8E8ED] p-0 max-sm:-ml-2 max-sm:mr-2 max-sm:h-7 max-sm:min-w-7 sm:-ml-4 sm:mr-3 sm:h-[3.3125rem] sm:min-w-10',
|
|
15
|
-
rightContent: 'ml-auto flex items-center',
|
|
15
|
+
rightContent: 'ml-auto flex items-center [&_:focus-visible]:focus-outline',
|
|
16
16
|
},
|
|
17
17
|
variants: {
|
|
18
18
|
logoCenter: {
|
package/src/components/input-group/components/input-group-add-ons/input-group-add-ons.styles.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { tv } from 'tailwind-variants';
|
|
|
2
2
|
|
|
3
3
|
export const styles = tv(
|
|
4
4
|
{
|
|
5
|
-
base: 'inset-y-0',
|
|
5
|
+
base: 'inset-y-0 focus-within:z-20',
|
|
6
6
|
variants: {
|
|
7
7
|
isInset: {
|
|
8
8
|
true: 'absolute',
|
|
@@ -17,12 +17,12 @@ export const styles = tv(
|
|
|
17
17
|
{
|
|
18
18
|
isInset: true,
|
|
19
19
|
position: 'before',
|
|
20
|
-
className: 'left-0',
|
|
20
|
+
className: 'left-0 z-[11]',
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
isInset: true,
|
|
24
24
|
position: 'after',
|
|
25
|
-
className: 'right-0',
|
|
25
|
+
className: 'right-0 z-[11]',
|
|
26
26
|
},
|
|
27
27
|
],
|
|
28
28
|
},
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { clsx } from 'clsx';
|
|
3
4
|
import React, {
|
|
4
5
|
Attributes,
|
|
5
6
|
Children,
|
|
@@ -96,6 +97,8 @@ export function InputGroup({
|
|
|
96
97
|
'aria-describedby': ariaDescribedBy || ariaDescribedByValue,
|
|
97
98
|
'aria-label': ariaLabel,
|
|
98
99
|
...(width !== 'full' ? { width: width } : {}),
|
|
100
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
|
|
101
|
+
className: clsx(child.props.className, 'focus:z-10'), // for focus ring visibility
|
|
99
102
|
} as Partial<unknown> & Attributes);
|
|
100
103
|
}
|
|
101
104
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { AriaButtonOptions, mergeProps, useButton, useFocusRing } from 'react-aria';
|
|
2
3
|
|
|
3
4
|
import { styles } from './pagination-item.styles.js';
|
|
4
5
|
import { type PaginationItemProps } from './pagination-item.types.js';
|
|
@@ -16,10 +17,16 @@ export function PaginationItem({
|
|
|
16
17
|
disabled = false,
|
|
17
18
|
...props
|
|
18
19
|
}: PaginationItemProps) {
|
|
20
|
+
const ref = React.useRef(null);
|
|
21
|
+
const { focusProps, isFocusVisible } = useFocusRing();
|
|
22
|
+
const { buttonProps } = useButton(props as AriaButtonOptions<'button'>, ref);
|
|
23
|
+
|
|
24
|
+
const finalButtonProps = mergeProps(focusProps, buttonProps);
|
|
25
|
+
|
|
19
26
|
return (
|
|
20
27
|
<Tag
|
|
21
|
-
className={styles({ className, firstItem, lastItem, active, disabled })}
|
|
22
|
-
{...
|
|
28
|
+
className={styles({ className, firstItem, lastItem, active, disabled, isFocusVisible })}
|
|
29
|
+
{...finalButtonProps}
|
|
23
30
|
disabled={disabled}
|
|
24
31
|
aria-disabled={disabled ? 'true' : 'false'}
|
|
25
32
|
aria-current={active ? 'page' : undefined}
|
|
@@ -4,6 +4,10 @@ export const styles = tv(
|
|
|
4
4
|
{
|
|
5
5
|
base: 'typography-body-10 relative block min-w-7 border border-border px-2 py-1.5 text-center text-text',
|
|
6
6
|
variants: {
|
|
7
|
+
isFocusVisible: {
|
|
8
|
+
true: 'z-10 focus-outline',
|
|
9
|
+
false: '',
|
|
10
|
+
},
|
|
7
11
|
firstItem: {
|
|
8
12
|
true: 'rounded-l',
|
|
9
13
|
false: 'ml-[-1px]',
|
|
@@ -13,7 +17,7 @@ export const styles = tv(
|
|
|
13
17
|
false: '',
|
|
14
18
|
},
|
|
15
19
|
active: {
|
|
16
|
-
true: '
|
|
20
|
+
true: 'border-hero bg-hero text-white',
|
|
17
21
|
false: 'hover:bg-light',
|
|
18
22
|
},
|
|
19
23
|
disabled: {
|
|
@@ -3,7 +3,7 @@ import { tv } from 'tailwind-variants';
|
|
|
3
3
|
export const styles = tv(
|
|
4
4
|
{
|
|
5
5
|
slots: {
|
|
6
|
-
base: 'border-0 border-t border-border bg-light px-2 py-[0.625rem] sm:px-4',
|
|
6
|
+
base: 'border-0 border-t border-border bg-light px-2 py-[0.625rem] sm:px-4 [&_:focus-visible]:focus-outline',
|
|
7
7
|
},
|
|
8
8
|
variants: {},
|
|
9
9
|
},
|
|
@@ -3,7 +3,7 @@ import { tv } from 'tailwind-variants';
|
|
|
3
3
|
export const styles = tv(
|
|
4
4
|
{
|
|
5
5
|
slots: {
|
|
6
|
-
base: 'group/panel overflow-hidden rounded border border-hero',
|
|
6
|
+
base: 'group/panel overflow-hidden rounded border border-hero [&_:focus-visible]:focus-outline',
|
|
7
7
|
header: 'px-2 py-[0.625rem] sm:px-4',
|
|
8
8
|
},
|
|
9
9
|
variants: {
|
|
@@ -11,8 +11,8 @@ export const styles = tv(
|
|
|
11
11
|
`,
|
|
12
12
|
closeBtn: 'absolute right-1 top-1 h-3 p-0 hover:opacity-80',
|
|
13
13
|
content: 'w-[17.625rem] rounded-[3px] bg-white py-4 pl-3 pr-5',
|
|
14
|
-
heading: 'typography-body-9 mb-2 font-medium text-text',
|
|
15
|
-
body: 'typography-body-10 text-text',
|
|
14
|
+
heading: 'typography-body-9 mb-2 font-medium text-text focus-visible:focus-outline',
|
|
15
|
+
body: 'typography-body-10 text-text focus-visible:focus-outline',
|
|
16
16
|
},
|
|
17
17
|
variants: {
|
|
18
18
|
placement: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React, { useId, useMemo } from 'react';
|
|
1
|
+
import { LazyMotion, m, useAnimate } from 'motion/react';
|
|
2
|
+
import React, { useEffect, useId, useMemo, useState } from 'react';
|
|
3
3
|
import { useFocusRing } from 'react-aria';
|
|
4
4
|
|
|
5
5
|
import { Circle, VisuallyHidden } from '../../../index.js';
|
|
@@ -23,6 +23,8 @@ export function ProgressRopeGroupStep({
|
|
|
23
23
|
onToggle,
|
|
24
24
|
tag: Tag,
|
|
25
25
|
}: ProgressRopeGroupStepProps) {
|
|
26
|
+
// Handling expanding animation this way for focus ring on steps
|
|
27
|
+
const [scope, animate] = useAnimate();
|
|
26
28
|
const id = useId();
|
|
27
29
|
const stepsContainerID = `progress-rope-group-steps-container-${id}`;
|
|
28
30
|
|
|
@@ -60,6 +62,38 @@ export function ProgressRopeGroupStep({
|
|
|
60
62
|
}, [current, visited]);
|
|
61
63
|
|
|
62
64
|
const styles = progressRopeGroupStyles({ firstItem, state, isFocusVisible });
|
|
65
|
+
const [overflowVisible, setOverflowVisible] = useState(false);
|
|
66
|
+
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
// Animates expanding/collapsing steps
|
|
69
|
+
if (opened) {
|
|
70
|
+
animate(
|
|
71
|
+
scope.current,
|
|
72
|
+
{ height: 'auto' },
|
|
73
|
+
{
|
|
74
|
+
duration: 0.2,
|
|
75
|
+
ease: 'easeInOut',
|
|
76
|
+
onComplete: () => {
|
|
77
|
+
setOverflowVisible(true);
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
);
|
|
81
|
+
} else {
|
|
82
|
+
animate(
|
|
83
|
+
scope.current,
|
|
84
|
+
{ height: 0 },
|
|
85
|
+
{
|
|
86
|
+
duration: 0.2,
|
|
87
|
+
ease: 'easeInOut',
|
|
88
|
+
onPlay: () => {
|
|
89
|
+
setOverflowVisible(false);
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
95
|
+
}, [opened]);
|
|
96
|
+
|
|
63
97
|
return (
|
|
64
98
|
<Tag>
|
|
65
99
|
<button
|
|
@@ -74,42 +108,32 @@ export function ProgressRopeGroupStep({
|
|
|
74
108
|
<VisuallyHidden>{visuallyHiddenMessage}</VisuallyHidden>
|
|
75
109
|
</button>
|
|
76
110
|
<LazyMotion features={loadAnimations}>
|
|
77
|
-
<
|
|
78
|
-
{
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
furthest={furthestVisitedStep === step.index}
|
|
104
|
-
>
|
|
105
|
-
{step.text}
|
|
106
|
-
</ProgressRopeStep>
|
|
107
|
-
</li>
|
|
108
|
-
))}
|
|
109
|
-
</ol>
|
|
110
|
-
</m.div>
|
|
111
|
-
)}
|
|
112
|
-
</AnimatePresence>
|
|
111
|
+
<m.div
|
|
112
|
+
ref={scope}
|
|
113
|
+
initial={{ height: opened ? 'auto' : 0 }}
|
|
114
|
+
style={{
|
|
115
|
+
overflow: overflowVisible ? 'visible' : 'hidden', // to show focus ring correctly when expanded
|
|
116
|
+
}}
|
|
117
|
+
>
|
|
118
|
+
<ol className={styles.stepsWrapper({})} id={stepsContainerID} aria-hidden={!opened}>
|
|
119
|
+
{steps.map((step, index) => (
|
|
120
|
+
<li key={step.index}>
|
|
121
|
+
<ProgressRopeStep
|
|
122
|
+
firstItem={index === 0}
|
|
123
|
+
lastItemInGroup={index === steps.length - 1}
|
|
124
|
+
size="small"
|
|
125
|
+
onClick={(furthestVisitedStep || 0) >= step.index ? step.onClick : undefined}
|
|
126
|
+
current={step.index === currentKey}
|
|
127
|
+
visited={(furthestVisitedStep || 0) > step.index}
|
|
128
|
+
furthest={furthestVisitedStep === step.index}
|
|
129
|
+
tabIndex={opened ? 0 : -1} // Using hidden/visibility breaks styles
|
|
130
|
+
>
|
|
131
|
+
{step.text}
|
|
132
|
+
</ProgressRopeStep>
|
|
133
|
+
</li>
|
|
134
|
+
))}
|
|
135
|
+
</ol>
|
|
136
|
+
</m.div>
|
|
113
137
|
</LazyMotion>
|
|
114
138
|
</Tag>
|
|
115
139
|
);
|
|
@@ -7,7 +7,7 @@ export const styles = tv(
|
|
|
7
7
|
list: 'm-0 flex list-none flex-col pl-0',
|
|
8
8
|
item: 'relative',
|
|
9
9
|
itemIndex: 'mb-3 font-bold',
|
|
10
|
-
content: '',
|
|
10
|
+
content: '[&_:focus-visible]:focus-outline',
|
|
11
11
|
removeBtn: 'absolute right-0 top-0 h-auto p-0 no-underline hover:underline',
|
|
12
12
|
footer: 'flex justify-between pt-[0.875rem]',
|
|
13
13
|
addBtn: 'h-auto p-0 no-underline hover:underline',
|
|
@@ -3,7 +3,7 @@ import { tv } from 'tailwind-variants';
|
|
|
3
3
|
export const styles = tv(
|
|
4
4
|
{
|
|
5
5
|
slots: {
|
|
6
|
-
base: 'mb-4 w-full',
|
|
6
|
+
base: 'mb-4 w-full [&_:focus-visible]:focus-outline',
|
|
7
7
|
wrapper: 'max-xsl:mb-3 max-xsl:w-full max-xsl:overflow-x-auto max-xsl:overflow-y-hidden',
|
|
8
8
|
},
|
|
9
9
|
variants: {},
|