@westpac/ui 0.53.2 → 0.55.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/CHANGELOG.md +26 -0
- package/dist/component-type.json +1 -1
- package/dist/components/accordion/components/accordion-item/accordion-item.styles.js +9 -1
- package/dist/components/autocomplete/components/autocomplete-list-box/autocomplete-list-box.component.js +1 -1
- package/dist/components/autocomplete/components/autocomplete-popover/autocomplete-popover.component.js +1 -1
- package/dist/components/button/button.component.d.ts +1 -0
- package/dist/components/button/button.component.js +3 -2
- package/dist/components/button/button.styles.d.ts +9 -0
- package/dist/components/button/button.styles.js +12 -1
- package/dist/components/button/button.types.d.ts +5 -0
- package/dist/components/button-dropdown/button-dropdown.component.d.ts +1 -1
- package/dist/components/button-dropdown/button-dropdown.component.js +2 -2
- package/dist/components/button-dropdown/button-dropdown.types.d.ts +5 -0
- package/dist/components/button-group/button-group.component.js +1 -0
- package/dist/components/checkbox-group/checkbox-group.component.js +1 -0
- package/dist/components/header/header.component.js +2 -1
- package/dist/components/header/header.types.d.ts +2 -1
- package/dist/components/modal/components/modal-backdrop/modal-backdrop.component.d.ts +1 -1
- package/dist/components/modal/components/modal-backdrop/modal-backdrop.component.js +3 -3
- package/dist/components/modal/components/modal-backdrop/modal-backdrop.styles.d.ts +39 -20
- package/dist/components/modal/components/modal-backdrop/modal-backdrop.styles.js +52 -11
- package/dist/components/modal/components/modal-backdrop/modal-backdrop.types.d.ts +5 -0
- package/dist/components/modal/components/modal-dialog/components/modal-dialog-body/modal-dialog-body.component.js +8 -2
- package/dist/components/modal/components/modal-dialog/components/modal-dialog-body/modal-dialog-body.styles.d.ts +54 -0
- package/dist/components/modal/components/modal-dialog/components/modal-dialog-body/modal-dialog-body.styles.js +64 -4
- package/dist/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.component.js +9 -3
- package/dist/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.styles.d.ts +12 -0
- package/dist/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.styles.js +25 -8
- package/dist/components/modal/components/modal-dialog/modal-dialog.component.d.ts +1 -1
- package/dist/components/modal/components/modal-dialog/modal-dialog.component.js +49 -4
- package/dist/components/modal/components/modal-dialog/modal-dialog.styles.d.ts +27 -0
- package/dist/components/modal/components/modal-dialog/modal-dialog.styles.js +39 -6
- package/dist/components/modal/components/modal-dialog/modal-dialog.types.d.ts +33 -0
- package/dist/components/modal/modal.component.d.ts +1 -1
- package/dist/components/modal/modal.component.js +4 -2
- package/dist/components/popover/components/panel/panel.styles.js +1 -1
- package/dist/components/radio-group/radio-group.component.js +1 -0
- package/dist/components/selector/components/selector-checkbox-group/selector-checkbox-group.component.js +1 -0
- package/dist/components/selector/components/selector-radio-group/selector-radio-group.component.js +1 -0
- package/dist/css/westpac-ui.css +226 -25
- package/dist/css/westpac-ui.min.css +226 -25
- package/package.json +6 -6
- package/src/components/accordion/components/accordion-item/accordion-item.styles.ts +7 -1
- package/src/components/autocomplete/components/autocomplete-list-box/autocomplete-list-box.component.tsx +1 -1
- package/src/components/autocomplete/components/autocomplete-popover/autocomplete-popover.component.tsx +1 -4
- package/src/components/button/button.component.tsx +2 -0
- package/src/components/button/button.styles.ts +10 -1
- package/src/components/button/button.types.ts +5 -0
- package/src/components/button-dropdown/button-dropdown.component.tsx +2 -1
- package/src/components/button-dropdown/button-dropdown.types.ts +5 -0
- package/src/components/button-group/button-group.component.tsx +1 -0
- package/src/components/checkbox-group/checkbox-group.component.tsx +1 -0
- package/src/components/header/header.component.tsx +3 -1
- package/src/components/header/header.types.ts +2 -1
- package/src/components/modal/components/modal-backdrop/modal-backdrop.component.tsx +5 -2
- package/src/components/modal/components/modal-backdrop/modal-backdrop.styles.ts +35 -15
- package/src/components/modal/components/modal-backdrop/modal-backdrop.types.ts +5 -0
- package/src/components/modal/components/modal-dialog/components/modal-dialog-body/modal-dialog-body.component.tsx +7 -3
- package/src/components/modal/components/modal-dialog/components/modal-dialog-body/modal-dialog-body.styles.ts +45 -3
- package/src/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.component.tsx +8 -3
- package/src/components/modal/components/modal-dialog/components/modal-dialog-footer/modal-dialog-footer.styles.ts +22 -6
- package/src/components/modal/components/modal-dialog/modal-dialog.component.tsx +51 -5
- package/src/components/modal/components/modal-dialog/modal-dialog.styles.ts +28 -5
- package/src/components/modal/components/modal-dialog/modal-dialog.types.ts +33 -0
- package/src/components/modal/modal.component.tsx +4 -2
- package/src/components/popover/components/panel/panel.styles.ts +1 -1
- package/src/components/radio-group/radio-group.component.tsx +1 -0
- package/src/components/selector/components/selector-checkbox-group/selector-checkbox-group.component.tsx +1 -0
- package/src/components/selector/components/selector-radio-group/selector-radio-group.component.tsx +1 -0
|
@@ -5,7 +5,7 @@ export const styles = tv({
|
|
|
5
5
|
itemHeader: 'typography-body-9 flex w-full flex-1 items-center justify-between px-3 py-2 group-first:border-t-0',
|
|
6
6
|
headerTitleWrapper: 'flex-1 pr-2 text-left',
|
|
7
7
|
indicator: 'size-3 rotate-90',
|
|
8
|
-
content: '[&_:focus-visible]:focus-outline',
|
|
8
|
+
content: 'bg-white [&_:focus-visible]:focus-outline',
|
|
9
9
|
motionContent: ''
|
|
10
10
|
},
|
|
11
11
|
variants: {
|
|
@@ -88,6 +88,14 @@ export const styles = tv({
|
|
|
88
88
|
rounded: true,
|
|
89
89
|
className: 'group-last:rounded-none'
|
|
90
90
|
},
|
|
91
|
+
{
|
|
92
|
+
slots: [
|
|
93
|
+
'content'
|
|
94
|
+
],
|
|
95
|
+
isOpen: true,
|
|
96
|
+
rounded: true,
|
|
97
|
+
className: 'group-last:rounded-b'
|
|
98
|
+
},
|
|
91
99
|
{
|
|
92
100
|
slots: [
|
|
93
101
|
'content'
|
|
@@ -8,7 +8,7 @@ export function AutocompleteListBox(props) {
|
|
|
8
8
|
return React.createElement("ul", {
|
|
9
9
|
...listBoxProps,
|
|
10
10
|
ref: listBoxRef,
|
|
11
|
-
className: "max-h-[400px] w-full outline-none"
|
|
11
|
+
className: "max-h-[400px] w-full overflow-auto outline-none"
|
|
12
12
|
}, [
|
|
13
13
|
...state.collection
|
|
14
14
|
].map((item)=>item.type === 'section' ? React.createElement(AutocompleteListBoxSection, {
|
|
@@ -28,7 +28,7 @@ export function AutocompletePopover(props) {
|
|
|
28
28
|
width: width ? `${width}px` : undefined
|
|
29
29
|
},
|
|
30
30
|
ref: popoverRef,
|
|
31
|
-
className: clsx('z-10 mt-1 max-h-[400px]
|
|
31
|
+
className: clsx('z-10 mt-1 max-h-[400px] rounded border border-border bg-white shadow-lg', className)
|
|
32
32
|
}, !isNonModal && React.createElement(DismissButton, {
|
|
33
33
|
onDismiss: ()=>state.close()
|
|
34
34
|
}), children, React.createElement(DismissButton, {
|
|
@@ -16,6 +16,7 @@ export declare const Button: React.ForwardRefExoticComponent<{
|
|
|
16
16
|
look?: "link" | "primary" | "hero" | "faint" | "unstyled" | {
|
|
17
17
|
[x: string]: "link" | "primary" | "hero" | "faint" | "unstyled" | undefined;
|
|
18
18
|
} | undefined;
|
|
19
|
+
removeLinkPadding?: boolean;
|
|
19
20
|
size?: "small" | "xlarge" | "medium" | "large" | {
|
|
20
21
|
[x: string]: "small" | "xlarge" | "medium" | "large" | undefined;
|
|
21
22
|
} | undefined;
|
|
@@ -3,7 +3,7 @@ import React, { forwardRef, useMemo } from 'react';
|
|
|
3
3
|
import { mergeProps, useFocusRing } from 'react-aria';
|
|
4
4
|
import { styles as buttonStyles } from './button.styles.js';
|
|
5
5
|
import { getIconSize } from './button.utils.js';
|
|
6
|
-
function BaseButton({ className, size = 'medium', look = 'hero', soft, block = false, justify, tag: Tag = 'button', iconBefore: IconBefore, iconAfter: IconAfter, iconLook, iconColor, iconSize, children, ...props }, ref) {
|
|
6
|
+
function BaseButton({ className, size = 'medium', look = 'hero', soft, block = false, justify, tag: Tag = 'button', iconBefore: IconBefore, iconAfter: IconAfter, iconLook, iconColor, iconSize, children, removeLinkPadding, ...props }, ref) {
|
|
7
7
|
const { isFocusVisible, focusProps } = useFocusRing();
|
|
8
8
|
const btnIconSize = useMemo(()=>iconSize || getIconSize(size), [
|
|
9
9
|
iconSize,
|
|
@@ -16,7 +16,8 @@ function BaseButton({ className, size = 'medium', look = 'hero', soft, block = f
|
|
|
16
16
|
block,
|
|
17
17
|
justify,
|
|
18
18
|
isFocusVisible,
|
|
19
|
-
hasChildren: !!children
|
|
19
|
+
hasChildren: !!children,
|
|
20
|
+
removeLinkPadding
|
|
20
21
|
});
|
|
21
22
|
return React.createElement(Tag, {
|
|
22
23
|
ref: ref,
|
|
@@ -62,6 +62,9 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
62
62
|
base: string;
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
|
+
removeLinkPadding: {
|
|
66
|
+
true: string;
|
|
67
|
+
};
|
|
65
68
|
}, {
|
|
66
69
|
base: string;
|
|
67
70
|
iconBefore: string;
|
|
@@ -131,6 +134,9 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
131
134
|
base: string;
|
|
132
135
|
};
|
|
133
136
|
};
|
|
137
|
+
removeLinkPadding: {
|
|
138
|
+
true: string;
|
|
139
|
+
};
|
|
134
140
|
}, {
|
|
135
141
|
base: string;
|
|
136
142
|
iconBefore: string;
|
|
@@ -198,6 +204,9 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
198
204
|
base: string;
|
|
199
205
|
};
|
|
200
206
|
};
|
|
207
|
+
removeLinkPadding: {
|
|
208
|
+
true: string;
|
|
209
|
+
};
|
|
201
210
|
}, {
|
|
202
211
|
base: string;
|
|
203
212
|
iconBefore: string;
|
|
@@ -33,7 +33,7 @@ export const styles = tv({
|
|
|
33
33
|
base: 'border border-borderDark bg-light text-muted hover:bg-white active:bg-white'
|
|
34
34
|
},
|
|
35
35
|
link: {
|
|
36
|
-
base: '
|
|
36
|
+
base: 'text-link underline'
|
|
37
37
|
},
|
|
38
38
|
unstyled: {
|
|
39
39
|
base: 'p-0 text-left'
|
|
@@ -67,6 +67,9 @@ export const styles = tv({
|
|
|
67
67
|
false: {
|
|
68
68
|
base: 'outline-none'
|
|
69
69
|
}
|
|
70
|
+
},
|
|
71
|
+
removeLinkPadding: {
|
|
72
|
+
true: ''
|
|
70
73
|
}
|
|
71
74
|
},
|
|
72
75
|
compoundSlots: [
|
|
@@ -94,6 +97,14 @@ export const styles = tv({
|
|
|
94
97
|
soft: true,
|
|
95
98
|
className: 'hover:bg-light active:bg-light'
|
|
96
99
|
},
|
|
100
|
+
{
|
|
101
|
+
slots: [
|
|
102
|
+
'base'
|
|
103
|
+
],
|
|
104
|
+
look: 'link',
|
|
105
|
+
removeLinkPadding: true,
|
|
106
|
+
className: 'px-0'
|
|
107
|
+
},
|
|
97
108
|
{
|
|
98
109
|
slots: [
|
|
99
110
|
'iconBefore'
|
|
@@ -49,6 +49,11 @@ export type ButtonProps = {
|
|
|
49
49
|
* @default hero
|
|
50
50
|
*/
|
|
51
51
|
look?: Variants['look'];
|
|
52
|
+
/**
|
|
53
|
+
* Removes horizontal padding from the 'link' look button
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
removeLinkPadding?: boolean;
|
|
52
57
|
/**
|
|
53
58
|
* Size of the button
|
|
54
59
|
* @default medium
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type ButtonDropdownProps } from './button-dropdown.types.js';
|
|
2
|
-
export declare function ButtonDropdown({ className, dropdownSize, iconBefore: IconBefore, open, text, children, size, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelBy, look, soft, block, dropDownIcon: Icon, shouldFlip, }: ButtonDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function ButtonDropdown({ className, dropdownSize, iconBefore: IconBefore, open, text, children, size, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelBy, look, soft, block, dropDownIcon: Icon, placement, shouldFlip, }: ButtonDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,7 +6,7 @@ import { Button } from '../button/index.js';
|
|
|
6
6
|
import { DropDownIcon } from '../icon/index.js';
|
|
7
7
|
import { styles as buttonDropdownStyles } from './button-dropdown.styles.js';
|
|
8
8
|
import { ButtonDropdownPanel } from './components/button-dropdown-panel/button-dropdown-panel.component.js';
|
|
9
|
-
export function ButtonDropdown({ className, dropdownSize = 'medium', iconBefore: IconBefore, open = false, text, children, size, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelBy, look = 'hero', soft = false, block = false, dropDownIcon: Icon = DropDownIcon, shouldFlip }) {
|
|
9
|
+
export function ButtonDropdown({ className, dropdownSize = 'medium', iconBefore: IconBefore, open = false, text, children, size, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelBy, look = 'hero', soft = false, block = false, dropDownIcon: Icon = DropDownIcon, placement = 'bottom start', shouldFlip }) {
|
|
10
10
|
const ref = useRef(null);
|
|
11
11
|
const panelId = useId();
|
|
12
12
|
const styles = buttonDropdownStyles({
|
|
@@ -54,7 +54,7 @@ export function ButtonDropdown({ className, dropdownSize = 'medium', iconBefore:
|
|
|
54
54
|
className: styles.panel({
|
|
55
55
|
className
|
|
56
56
|
}),
|
|
57
|
-
placement:
|
|
57
|
+
placement: placement,
|
|
58
58
|
triggerRef: ref,
|
|
59
59
|
state: state,
|
|
60
60
|
block: block,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { Placement } from 'react-aria';
|
|
2
3
|
import { type VariantProps } from 'tailwind-variants';
|
|
3
4
|
import { ButtonProps } from '../button/index.js';
|
|
4
5
|
import { IconProps } from '../icon/icon.types.js';
|
|
@@ -22,6 +23,10 @@ export type ButtonDropdownProps = {
|
|
|
22
23
|
* State of whether the Popover is open
|
|
23
24
|
*/
|
|
24
25
|
open?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* placement of the popover
|
|
28
|
+
*/
|
|
29
|
+
placement?: Placement;
|
|
25
30
|
/**
|
|
26
31
|
* Soft look button
|
|
27
32
|
*/
|
|
@@ -67,6 +67,7 @@ export function Header({ anchorTarget, brand, className, children, disableLogoLi
|
|
|
67
67
|
"aria-label": logoAssistiveText,
|
|
68
68
|
className: styles.largeLogo()
|
|
69
69
|
}));
|
|
70
|
+
const defaultAssistiveText = leftIcon === 'arrow' ? 'Back' : 'Menu';
|
|
70
71
|
return React.createElement("header", {
|
|
71
72
|
className: styles.base({
|
|
72
73
|
className
|
|
@@ -86,7 +87,7 @@ export function Header({ anchorTarget, brand, className, children, disableLogoLi
|
|
|
86
87
|
iconAfter: ButtonIcon,
|
|
87
88
|
iconSize: leftIcon === 'arrow' ? 'medium' : 'small',
|
|
88
89
|
onClick: leftOnClick,
|
|
89
|
-
"aria-label": leftAssistiveText,
|
|
90
|
+
"aria-label": leftAssistiveText !== null && leftAssistiveText !== void 0 ? leftAssistiveText : defaultAssistiveText,
|
|
90
91
|
className: styles.leftButton(),
|
|
91
92
|
iconColor: "text"
|
|
92
93
|
})), disableLogoLink ? React.createElement("div", {
|
|
@@ -2,4 +2,4 @@ import { type ModalBackdropProps } from './modal-backdrop.types.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* @private
|
|
4
4
|
*/
|
|
5
|
-
export declare function ModalBackdrop({ zIndex, portalContainer, size, ...props }: ModalBackdropProps): import("react/jsx-runtime").JSX.Element | null;
|
|
5
|
+
export declare function ModalBackdrop({ zIndex, portalContainer, size, compact, ...props }: ModalBackdropProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import React, { useMemo, useRef } from 'react';
|
|
3
3
|
import { Overlay, useModalOverlay } from 'react-aria';
|
|
4
4
|
import { styles as backdropStyles } from './modal-backdrop.styles.js';
|
|
5
|
-
export function ModalBackdrop({ zIndex = 100, portalContainer, size, ...props }) {
|
|
5
|
+
export function ModalBackdrop({ zIndex = 100, portalContainer, size, compact, ...props }) {
|
|
6
6
|
const { children, state, className } = props;
|
|
7
7
|
const ref = useRef(null);
|
|
8
8
|
const styles = backdropStyles({
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
size,
|
|
10
|
+
compact: compact && (size === 'md' || size === 'lg')
|
|
11
11
|
});
|
|
12
12
|
const { modalProps, underlayProps } = useModalOverlay(props, state, ref);
|
|
13
13
|
const brandContainer = useMemo(()=>{
|
|
@@ -1,46 +1,65 @@
|
|
|
1
1
|
export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
modal: string;
|
|
2
|
+
size: {
|
|
3
|
+
fluid: {
|
|
5
4
|
base: string;
|
|
6
5
|
};
|
|
7
|
-
|
|
8
|
-
fluid: {
|
|
9
|
-
true: {
|
|
6
|
+
full: {
|
|
10
7
|
modal: string;
|
|
8
|
+
base: string;
|
|
11
9
|
};
|
|
10
|
+
lg: string;
|
|
11
|
+
md: string;
|
|
12
|
+
sm: string;
|
|
13
|
+
};
|
|
14
|
+
compact: {
|
|
15
|
+
true: string;
|
|
16
|
+
false: string;
|
|
12
17
|
};
|
|
13
18
|
}, {
|
|
14
19
|
base: string;
|
|
15
20
|
modal: string;
|
|
16
|
-
}, undefined,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
}, undefined, {
|
|
22
|
+
responsiveVariants: string[];
|
|
23
|
+
}, {
|
|
24
|
+
size: {
|
|
25
|
+
fluid: {
|
|
20
26
|
base: string;
|
|
21
27
|
};
|
|
22
|
-
|
|
23
|
-
fluid: {
|
|
24
|
-
true: {
|
|
28
|
+
full: {
|
|
25
29
|
modal: string;
|
|
30
|
+
base: string;
|
|
26
31
|
};
|
|
32
|
+
lg: string;
|
|
33
|
+
md: string;
|
|
34
|
+
sm: string;
|
|
35
|
+
};
|
|
36
|
+
compact: {
|
|
37
|
+
true: string;
|
|
38
|
+
false: string;
|
|
27
39
|
};
|
|
28
40
|
}, {
|
|
29
41
|
base: string;
|
|
30
42
|
modal: string;
|
|
31
43
|
}, import("tailwind-variants").TVReturnType<{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
modal: string;
|
|
44
|
+
size: {
|
|
45
|
+
fluid: {
|
|
35
46
|
base: string;
|
|
36
47
|
};
|
|
37
|
-
|
|
38
|
-
fluid: {
|
|
39
|
-
true: {
|
|
48
|
+
full: {
|
|
40
49
|
modal: string;
|
|
50
|
+
base: string;
|
|
41
51
|
};
|
|
52
|
+
lg: string;
|
|
53
|
+
md: string;
|
|
54
|
+
sm: string;
|
|
55
|
+
};
|
|
56
|
+
compact: {
|
|
57
|
+
true: string;
|
|
58
|
+
false: string;
|
|
42
59
|
};
|
|
43
60
|
}, {
|
|
44
61
|
base: string;
|
|
45
62
|
modal: string;
|
|
46
|
-
}, undefined,
|
|
63
|
+
}, undefined, {
|
|
64
|
+
responsiveVariants: string[];
|
|
65
|
+
}, unknown, unknown, undefined>>;
|
|
@@ -1,20 +1,61 @@
|
|
|
1
1
|
import { tv } from 'tailwind-variants';
|
|
2
2
|
export const styles = tv({
|
|
3
3
|
slots: {
|
|
4
|
-
base: 'fixed inset-0 flex animate-fadeIn
|
|
5
|
-
modal: 'relative top-
|
|
4
|
+
base: 'fixed inset-0 flex animate-fadeIn justify-center bg-black/50 px-4',
|
|
5
|
+
modal: 'relative top-[5vh] z-10 size-fit max-w-full animate-fadeInDown'
|
|
6
6
|
},
|
|
7
7
|
variants: {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
size: {
|
|
9
|
+
fluid: {
|
|
10
|
+
base: 'px-4'
|
|
11
|
+
},
|
|
12
|
+
full: {
|
|
13
|
+
modal: '!top-0 flex w-full flex-1 flex-col p-0',
|
|
11
14
|
base: 'flex flex-col p-0'
|
|
12
|
-
}
|
|
15
|
+
},
|
|
16
|
+
lg: '',
|
|
17
|
+
md: '',
|
|
18
|
+
sm: ''
|
|
13
19
|
},
|
|
14
|
-
|
|
15
|
-
true:
|
|
16
|
-
|
|
17
|
-
}
|
|
20
|
+
compact: {
|
|
21
|
+
true: '',
|
|
22
|
+
false: ''
|
|
18
23
|
}
|
|
19
|
-
}
|
|
24
|
+
},
|
|
25
|
+
compoundSlots: [
|
|
26
|
+
{
|
|
27
|
+
slots: [
|
|
28
|
+
'base'
|
|
29
|
+
],
|
|
30
|
+
size: [
|
|
31
|
+
'sm',
|
|
32
|
+
'md',
|
|
33
|
+
'lg',
|
|
34
|
+
'fluid'
|
|
35
|
+
],
|
|
36
|
+
compact: false,
|
|
37
|
+
className: 'overflow-y-auto'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
slots: [
|
|
41
|
+
'modal'
|
|
42
|
+
],
|
|
43
|
+
size: [
|
|
44
|
+
'sm',
|
|
45
|
+
'md',
|
|
46
|
+
'lg',
|
|
47
|
+
'fluid'
|
|
48
|
+
],
|
|
49
|
+
compact: false,
|
|
50
|
+
className: 'pb-[5vh]'
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}, {
|
|
54
|
+
responsiveVariants: [
|
|
55
|
+
'xsl',
|
|
56
|
+
'sm',
|
|
57
|
+
'md',
|
|
58
|
+
'lg',
|
|
59
|
+
'xl'
|
|
60
|
+
]
|
|
20
61
|
});
|
|
@@ -10,6 +10,11 @@ export type ModalBackdropProps = {
|
|
|
10
10
|
* Clasname
|
|
11
11
|
*/
|
|
12
12
|
className?: string;
|
|
13
|
+
/**
|
|
14
|
+
* For medium and large sizes.
|
|
15
|
+
* Keeps entire modal in view by adding internal scrolling.
|
|
16
|
+
*/
|
|
17
|
+
compact?: boolean;
|
|
13
18
|
/**
|
|
14
19
|
* Element where backdrop will be placed
|
|
15
20
|
*/
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { useModalDialogContext } from '../../modal-dialog.component.js';
|
|
3
4
|
import { styles as modalBodyStyles } from './modal-dialog-body.styles.js';
|
|
4
5
|
export function ModalDialogBody({ className, children, ...props }) {
|
|
5
|
-
const { size } = useModalDialogContext();
|
|
6
|
+
const { size, scrollingRef, canScroll, compact, footerPresent, scrollAtBottom } = useModalDialogContext();
|
|
6
7
|
const styles = modalBodyStyles({
|
|
7
|
-
size
|
|
8
|
+
size,
|
|
9
|
+
canScroll,
|
|
10
|
+
scrollAtBottom,
|
|
11
|
+
compact,
|
|
12
|
+
footerPresent
|
|
8
13
|
});
|
|
9
14
|
return React.createElement("div", {
|
|
10
15
|
className: styles.base({
|
|
11
16
|
className
|
|
12
17
|
}),
|
|
18
|
+
ref: scrollingRef,
|
|
13
19
|
...props
|
|
14
20
|
}, children);
|
|
15
21
|
}
|
|
@@ -16,6 +16,24 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
16
16
|
base: string;
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
+
canScroll: {
|
|
20
|
+
true: {
|
|
21
|
+
base: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
scrollAtBottom: {
|
|
25
|
+
true: {
|
|
26
|
+
base: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
compact: {
|
|
30
|
+
true: string;
|
|
31
|
+
false: string;
|
|
32
|
+
};
|
|
33
|
+
footerPresent: {
|
|
34
|
+
true: string;
|
|
35
|
+
false: string;
|
|
36
|
+
};
|
|
19
37
|
}, {
|
|
20
38
|
base: string;
|
|
21
39
|
}, undefined, {
|
|
@@ -38,6 +56,24 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
38
56
|
base: string;
|
|
39
57
|
};
|
|
40
58
|
};
|
|
59
|
+
canScroll: {
|
|
60
|
+
true: {
|
|
61
|
+
base: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
scrollAtBottom: {
|
|
65
|
+
true: {
|
|
66
|
+
base: string;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
compact: {
|
|
70
|
+
true: string;
|
|
71
|
+
false: string;
|
|
72
|
+
};
|
|
73
|
+
footerPresent: {
|
|
74
|
+
true: string;
|
|
75
|
+
false: string;
|
|
76
|
+
};
|
|
41
77
|
}, {
|
|
42
78
|
base: string;
|
|
43
79
|
}, import("tailwind-variants").TVReturnType<{
|
|
@@ -58,6 +94,24 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
58
94
|
base: string;
|
|
59
95
|
};
|
|
60
96
|
};
|
|
97
|
+
canScroll: {
|
|
98
|
+
true: {
|
|
99
|
+
base: string;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
scrollAtBottom: {
|
|
103
|
+
true: {
|
|
104
|
+
base: string;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
compact: {
|
|
108
|
+
true: string;
|
|
109
|
+
false: string;
|
|
110
|
+
};
|
|
111
|
+
footerPresent: {
|
|
112
|
+
true: string;
|
|
113
|
+
false: string;
|
|
114
|
+
};
|
|
61
115
|
}, {
|
|
62
116
|
base: string;
|
|
63
117
|
}, undefined, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { tv } from 'tailwind-variants';
|
|
2
2
|
export const styles = tv({
|
|
3
3
|
slots: {
|
|
4
|
-
base: 'flex-1
|
|
4
|
+
base: 'flex-1 transition-shadow delay-0 duration-200 ease-[ease]'
|
|
5
5
|
},
|
|
6
6
|
variants: {
|
|
7
7
|
size: {
|
|
@@ -15,13 +15,73 @@ export const styles = tv({
|
|
|
15
15
|
base: 'px-7 pb-7'
|
|
16
16
|
},
|
|
17
17
|
sm: {
|
|
18
|
-
base: 'px-5 pb-
|
|
18
|
+
base: 'px-5 pb-5'
|
|
19
19
|
},
|
|
20
20
|
fluid: {
|
|
21
|
-
base: 'px-5 pb-
|
|
21
|
+
base: 'px-5 pb-5'
|
|
22
22
|
}
|
|
23
|
+
},
|
|
24
|
+
canScroll: {
|
|
25
|
+
true: {
|
|
26
|
+
base: 'shadow-[0px_-4px_5px_-2px_inset] shadow-black/30'
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
scrollAtBottom: {
|
|
30
|
+
true: {
|
|
31
|
+
base: 'shadow-[0_0_0_0_inset]'
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
compact: {
|
|
35
|
+
true: '',
|
|
36
|
+
false: ''
|
|
37
|
+
},
|
|
38
|
+
footerPresent: {
|
|
39
|
+
true: '',
|
|
40
|
+
false: ''
|
|
23
41
|
}
|
|
24
|
-
}
|
|
42
|
+
},
|
|
43
|
+
compoundSlots: [
|
|
44
|
+
{
|
|
45
|
+
slots: [
|
|
46
|
+
'base'
|
|
47
|
+
],
|
|
48
|
+
size: [
|
|
49
|
+
'lg'
|
|
50
|
+
],
|
|
51
|
+
compact: true,
|
|
52
|
+
className: 'overflow-y-auto px-5 pb-3'
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
slots: [
|
|
56
|
+
'base'
|
|
57
|
+
],
|
|
58
|
+
size: [
|
|
59
|
+
'md'
|
|
60
|
+
],
|
|
61
|
+
compact: true,
|
|
62
|
+
className: 'overflow-y-auto px-5 pb-2'
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
slots: [
|
|
66
|
+
'base'
|
|
67
|
+
],
|
|
68
|
+
size: [
|
|
69
|
+
'md'
|
|
70
|
+
],
|
|
71
|
+
footerPresent: true,
|
|
72
|
+
className: 'pb-5'
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
slots: [
|
|
76
|
+
'base'
|
|
77
|
+
],
|
|
78
|
+
size: [
|
|
79
|
+
'lg'
|
|
80
|
+
],
|
|
81
|
+
footerPresent: true,
|
|
82
|
+
className: 'pb-6'
|
|
83
|
+
}
|
|
84
|
+
]
|
|
25
85
|
}, {
|
|
26
86
|
responsiveVariants: [
|
|
27
87
|
'xsl',
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useEffect } from 'react';
|
|
3
3
|
import { Button } from '../../../../../button/index.js';
|
|
4
4
|
import { useModalDialogContext } from '../../modal-dialog.component.js';
|
|
5
5
|
import { styles as modalFooterStyles } from './modal-dialog-footer.styles.js';
|
|
6
6
|
export function ModalDialogFooter({ className, primaryLabel, primaryOnClick, secondaryLabel, secondaryOnClick, ...props }) {
|
|
7
|
-
const { size } = useModalDialogContext();
|
|
7
|
+
const { size, compact, setFooterPresent } = useModalDialogContext();
|
|
8
8
|
const styles = modalFooterStyles({
|
|
9
|
-
size
|
|
9
|
+
size,
|
|
10
|
+
compact
|
|
10
11
|
});
|
|
12
|
+
useEffect(()=>{
|
|
13
|
+
setFooterPresent === null || setFooterPresent === void 0 ? void 0 : setFooterPresent(true);
|
|
14
|
+
}, [
|
|
15
|
+
setFooterPresent
|
|
16
|
+
]);
|
|
11
17
|
return React.createElement("div", {
|
|
12
18
|
className: styles.base({
|
|
13
19
|
className
|
|
@@ -16,6 +16,10 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
16
16
|
base: string;
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
+
compact: {
|
|
20
|
+
true: string;
|
|
21
|
+
false: string;
|
|
22
|
+
};
|
|
19
23
|
}, {
|
|
20
24
|
base: string;
|
|
21
25
|
primaryBtn: string;
|
|
@@ -40,6 +44,10 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
40
44
|
base: string;
|
|
41
45
|
};
|
|
42
46
|
};
|
|
47
|
+
compact: {
|
|
48
|
+
true: string;
|
|
49
|
+
false: string;
|
|
50
|
+
};
|
|
43
51
|
}, {
|
|
44
52
|
base: string;
|
|
45
53
|
primaryBtn: string;
|
|
@@ -62,6 +70,10 @@ export declare const styles: import("tailwind-variants").TVReturnType<{
|
|
|
62
70
|
base: string;
|
|
63
71
|
};
|
|
64
72
|
};
|
|
73
|
+
compact: {
|
|
74
|
+
true: string;
|
|
75
|
+
false: string;
|
|
76
|
+
};
|
|
65
77
|
}, {
|
|
66
78
|
base: string;
|
|
67
79
|
primaryBtn: string;
|